feat(coder): add flow-artifacts write helper and boocontext MCP template
This commit is contained in:
23
apps/coder/src/services/flow-artifacts.ts
Normal file
23
apps/coder/src/services/flow-artifacts.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { mkdir, writeFile } from 'node:fs/promises';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import { existsSync } from 'node:fs';
|
||||||
|
|
||||||
|
const ARTIFACTS_ROOT = 'data/flow-artifacts';
|
||||||
|
|
||||||
|
export function getArtifactPath(flowRunId: string, stepId: string): string {
|
||||||
|
return join(ARTIFACTS_ROOT, flowRunId, `${stepId}.md`);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function writeFlowArtifact(
|
||||||
|
flowRunId: string,
|
||||||
|
stepId: string,
|
||||||
|
content: string,
|
||||||
|
): Promise<string> {
|
||||||
|
const dir = join(ARTIFACTS_ROOT, flowRunId);
|
||||||
|
if (!existsSync(dir)) {
|
||||||
|
await mkdir(dir, { recursive: true });
|
||||||
|
}
|
||||||
|
const path = getArtifactPath(flowRunId, stepId);
|
||||||
|
await writeFile(path, content, 'utf8');
|
||||||
|
return path;
|
||||||
|
}
|
||||||
@@ -7,6 +7,17 @@
|
|||||||
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
|
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
|
||||||
},
|
},
|
||||||
"enabled": false
|
"enabled": false
|
||||||
|
},
|
||||||
|
"boocontext": {
|
||||||
|
"type": "stdio",
|
||||||
|
"command": "node",
|
||||||
|
"args": ["/opt/forks/boocontext/dist/index.js"],
|
||||||
|
"env": {
|
||||||
|
"TYPE_INJECT_MCP_PATH": "/opt/forks/type-inject/packages/mcp/dist/index.js",
|
||||||
|
"TREE_SITTER_MCP_CMD": "uvx",
|
||||||
|
"TREE_SITTER_MCP_ARGS": "--from tree-sitter-analyzer[mcp] tree-sitter-analyzer-mcp"
|
||||||
|
},
|
||||||
|
"enabled": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user