Files
ContractorAgent/src/contractor/runtime-state.ts
hzhang 76a7931f97 feat: implement MCP proxy for OpenClaw tool access in contractor agent
Complete the MCP tool call chain:
- contractor-agent bridge exposes /mcp/execute endpoint for tool callbacks
- openclaw-mcp-server.mjs proxies OpenClaw tool defs to Claude as MCP tools
- sdk-adapter passes --mcp-config on first turn with all OpenClaw tools
- tool-test plugin registers contractor_echo in globalThis tool handler map
- agent-config-writer auto-sets tools.profile=full so OpenClaw sends tool defs
- Fix --mcp-config arg ordering: prompt must come before <configs...> flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 13:05:03 +01:00

16 lines
491 B
TypeScript

import path from "node:path";
import fs from "node:fs";
export function getContractorStateDir(workspace: string): string {
return path.join(workspace, ".openclaw", "contractor-agent");
}
export function getSessionMapPath(workspace: string): string {
return path.join(getContractorStateDir(workspace), "session-map.json");
}
export function ensureContractorStateDir(workspace: string): void {
const dir = getContractorStateDir(workspace);
fs.mkdirSync(dir, { recursive: true });
}