MCPcopy Index your code
hub / github.com/Waishnav/devspace / boot

Function boot

src/ui/workspace-app.tsx:64–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62void boot();
63
64async function boot(): Promise<void> {
65 render();
66
67 app = new App(
68 { name: "devspace-tool-cards", version: "0.4.0" },
69 {},
70 );
71
72 app.ontoolresult = (result) => {
73 const structuredContent = getStructuredContent<Partial<ToolResultCard>>(result);
74 const metaCard = cardFromMeta(result);
75 const structured = metaCard
76 ? { ...structuredContent, ...metaCard }
77 : structuredContent;
78 const tool = toolNameFromMeta(result);
79
80 if (!tool || !isToolResultCard(structured)) {
81 card = null;
82 expanded = false;
83 reviewFilesExpanded = false;
84 errorMessage = "No result card is available for this tool result.";
85 render();
86 return;
87 }
88
89 card = { ...structured, tool };
90 expanded = false;
91 reviewFilesExpanded = false;
92 errorMessage = null;
93 render();
94 };
95
96 app.onhostcontextchanged = (ctx) => {
97 hostContext = {
98 ...hostContext,
99 ...ctx,
100 };
101 applyHostContext();
102 renderPayloadIfNeeded();
103 };
104
105 app.onteardown = async () => {
106 unmountPayload();
107 return {};
108 };
109
110 try {
111 await app.connect();
112 const initialContext = app.getHostContext();
113 if (initialContext) hostContext = initialContext;
114 applyHostContext();
115 connected = true;
116 } catch (connectError) {
117 connectionError = connectError instanceof Error
118 ? connectError.message
119 : String(connectError);
120 }
121

Callers 1

workspace-app.tsxFile · 0.85

Calls 8

renderFunction · 0.85
getStructuredContentFunction · 0.85
cardFromMetaFunction · 0.85
toolNameFromMetaFunction · 0.85
isToolResultCardFunction · 0.85
applyHostContextFunction · 0.85
renderPayloadIfNeededFunction · 0.85
unmountPayloadFunction · 0.85

Tested by

no test coverage detected