MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / withArtifactSource

Function withArtifactSource

packages/hosts/mcp/src/tool-server.ts:1118–1130  ·  view source on GitHub ↗
(result: McpToolResult, code: string)

Source from the content-addressed store, hash-verified

1116
1117/** Add source to both MCP result channels. */
1118const withArtifactSource = (result: McpToolResult, code: string): McpToolResult => {
1119 const source = artifactSourceText(code);
1120 const content = result.content.map((block, index) =>
1121 index === 0 && block.type === "text"
1122 ? { type: "text" as const, text: `${block.text}\n\n${source}` }
1123 : block,
1124 );
1125 return {
1126 ...result,
1127 content,
1128 structuredContent: { ...result.structuredContent, code },
1129 };
1130};
1131
1132const renderedInAppResult = (input: {
1133 readonly code: string;

Callers 1

showArtifactFunction · 0.85

Calls 1

artifactSourceTextFunction · 0.85

Tested by

no test coverage detected