Add inter-sandbox chat MCP server
This commit is contained in:
@@ -36,8 +36,9 @@ const helpPath = path.join(root, 'app/components/HelpPanel.tsx')
|
||||
const sidebarPath = path.join(root, 'app/components/Sidebar.tsx')
|
||||
const sandboxListPath = path.join(root, 'app/components/SandboxList.tsx')
|
||||
const pagePath = path.join(root, 'app/page.tsx')
|
||||
const interSandboxChatPath = path.join(root, 'scripts/inter-sandbox-chat-mcp.mjs')
|
||||
|
||||
const [storeSource, brokerStoreSource, brokerClientSource, brokerProtocolSource, sandboxAutoSyncSource, manifestSource, privilegedFilesSource, routeSource, uploadRouteSource, preflightRouteSource, healthRouteSource, registryRouteSource, registriesRouteSource, registriesAssistRouteSource, installAssistRouteSource, registryStoreSource, inferenceModelSource, brokerCapabilitiesRouteSource, brokerCallRouteSource, brokerMcpRouteSource, sandboxMcpRouteSource, brokerUrlSource, sandboxOpenClawMcpConfigSource, preflightLibSource, preflightRepairLibSource, mcpServerSpecsSource, middlewareSource, panelSource, helpSource, sidebarSource, sandboxListSource, pageSource] = await Promise.all([
|
||||
const [storeSource, brokerStoreSource, brokerClientSource, brokerProtocolSource, sandboxAutoSyncSource, manifestSource, privilegedFilesSource, routeSource, uploadRouteSource, preflightRouteSource, healthRouteSource, registryRouteSource, registriesRouteSource, registriesAssistRouteSource, installAssistRouteSource, registryStoreSource, inferenceModelSource, brokerCapabilitiesRouteSource, brokerCallRouteSource, brokerMcpRouteSource, sandboxMcpRouteSource, brokerUrlSource, sandboxOpenClawMcpConfigSource, preflightLibSource, preflightRepairLibSource, mcpServerSpecsSource, middlewareSource, panelSource, helpSource, sidebarSource, sandboxListSource, pageSource, interSandboxChatSource] = await Promise.all([
|
||||
readFile(storePath, 'utf8'),
|
||||
readFile(brokerStorePath, 'utf8'),
|
||||
readFile(brokerClientPath, 'utf8'),
|
||||
@@ -70,16 +71,21 @@ const [storeSource, brokerStoreSource, brokerClientSource, brokerProtocolSource,
|
||||
readFile(sidebarPath, 'utf8'),
|
||||
readFile(sandboxListPath, 'utf8'),
|
||||
readFile(pagePath, 'utf8'),
|
||||
readFile(interSandboxChatPath, 'utf8'),
|
||||
])
|
||||
|
||||
assert.match(storeSource, /export const MCP_SERVER_CATALOG/, 'MCP store must expose an install catalog')
|
||||
assert.match(storeSource, /blendermcp\.org/, 'MCP catalog must include the requested BlenderMCP site')
|
||||
assert.match(storeSource, /args:\s*\["blender-mcp"\]/, 'MCP catalog must install BlenderMCP via uvx blender-mcp')
|
||||
assert.match(storeSource, /id: "inter-sandbox-chat"/, 'MCP catalog must include Inter-Sandbox Chat')
|
||||
assert.match(storeSource, /Inter-Sandbox Chat/, 'MCP catalog must expose the Inter-Sandbox Chat display name')
|
||||
assert.match(storeSource, /inter-sandbox-chat-mcp\.mjs/, 'MCP catalog must launch the local Inter-Sandbox Chat server')
|
||||
assert.match(storeSource, /BASELINE_MCP_SERVER_IDS = \["memory"\]/, 'MCP dashboard should install Memory as the baseline test server')
|
||||
assert.match(storeSource, /ensureBaselineMcpServers/, 'MCP store must seed baseline servers into dashboard state')
|
||||
assert.match(storeSource, /mcp-servers\.json/, 'MCP installs must persist to dashboard state')
|
||||
assert.match(storeSource, /accessMode/, 'MCP installs must persist sandbox access mode')
|
||||
assert.match(storeSource, /allowedSandboxIds/, 'MCP installs must persist allowed sandbox lists')
|
||||
assert.match(storeSource, /withoutUndefined/, 'MCP catalog installs must not let omitted API fields erase preset command definitions')
|
||||
assert.match(storeSource, /existing\?\.accessMode \|\| "disabled"/, 'MCP server access should default to disabled for sandboxes')
|
||||
assert.match(storeSource, /export function buildMcpClientConfig/, 'MCP store must export client config JSON')
|
||||
assert.match(storeSource, /mcpServers/, 'MCP client config must use the common mcpServers shape')
|
||||
@@ -90,6 +96,10 @@ assert.match(brokerClientSource, /@modelcontextprotocol\/sdk\/client\/index\.js/
|
||||
assert.match(brokerClientSource, /StdioClientTransport/, 'MCP broker must support stdio servers')
|
||||
assert.match(brokerClientSource, /StreamableHTTPClientTransport/, 'MCP broker must support streamable HTTP servers')
|
||||
assert.match(brokerClientSource, /callBrokerServerTool/, 'MCP broker must forward allowed tool calls')
|
||||
assert.match(interSandboxChatSource, /post_message/, 'Inter-Sandbox Chat MCP server must let agents post messages')
|
||||
assert.match(interSandboxChatSource, /read_messages/, 'Inter-Sandbox Chat MCP server must let agents read messages')
|
||||
assert.match(interSandboxChatSource, /list_rooms/, 'Inter-Sandbox Chat MCP server must let agents discover rooms')
|
||||
assert.match(interSandboxChatSource, /inter-sandbox-chat\.json/, 'Inter-Sandbox Chat MCP server must persist chat state in dashboard storage')
|
||||
assert.match(brokerProtocolSource, /tools\/list/, 'MCP broker protocol adapter must expose an MCP tools/list JSON-RPC method')
|
||||
assert.match(brokerProtocolSource, /tools\/call/, 'MCP broker protocol adapter must expose an MCP tools/call JSON-RPC method')
|
||||
assert.match(brokerProtocolSource, /listAllowedBrokerServers/, 'MCP broker protocol adapter must reuse broker access policy')
|
||||
|
||||
@@ -16,6 +16,7 @@ const sandboxInferenceApplyLibPath = path.join(root, 'app/lib/sandboxInferenceAp
|
||||
const sandboxInferenceStorePath = path.join(root, 'app/lib/sandboxInferenceStore.ts')
|
||||
const sandboxRestartRoutePath = path.join(root, 'app/api/sandbox/[sandboxId]/restart/route.ts')
|
||||
const gatewayRepairRoutePath = path.join(root, 'app/api/openshell/gateway/repair/route.ts')
|
||||
const sandboxPrivilegedFilesPath = path.join(root, 'app/lib/sandboxPrivilegedFiles.ts')
|
||||
const hookPath = path.join(root, 'app/hooks/useSandboxInventory.ts')
|
||||
const pagePath = path.join(root, 'app/page.tsx')
|
||||
const configPanelPath = path.join(root, 'app/components/ConfigurationPanel.tsx')
|
||||
@@ -37,6 +38,7 @@ const sandboxInferenceApplyLibSource = await readFile(sandboxInferenceApplyLibPa
|
||||
const sandboxInferenceStoreSource = await readFile(sandboxInferenceStorePath, 'utf8')
|
||||
const sandboxRestartRouteSource = await readFile(sandboxRestartRoutePath, 'utf8')
|
||||
const gatewayRepairRouteSource = await readFile(gatewayRepairRoutePath, 'utf8')
|
||||
const sandboxPrivilegedFilesSource = await readFile(sandboxPrivilegedFilesPath, 'utf8')
|
||||
const hookSource = await readFile(hookPath, 'utf8')
|
||||
const pageSource = await readFile(pagePath, 'utf8')
|
||||
const configPanelSource = await readFile(configPanelPath, 'utf8')
|
||||
@@ -62,6 +64,16 @@ assert.match(createRouteSource, /NEMOCLAW_EXPERIMENTAL = "1"/, 'blueprint create
|
||||
assert.match(createRouteSource, /NEMOCLAW_PROVIDER = "vllm"/, 'blueprint create must support the vLLM onboarding provider')
|
||||
assert.match(createRouteSource, /NEMOCLAW_PROVIDER = "nim-local"/, 'blueprint create must support the NVIDIA NIM onboarding provider')
|
||||
assert.match(createRouteSource, /NEMOCLAW_PROVIDER_KEY = apiKey/, 'blueprint create must pass NVIDIA API keys through provider env without changing NemoClaw')
|
||||
assert.match(createRouteSource, /repairOpenClawWorkspacePermissions/, 'sandbox create must repair OpenClaw workspace permissions after readiness')
|
||||
assert.match(createRouteSource, /workspaceRepair/, 'sandbox create response must report OpenClaw workspace permission repair status')
|
||||
assert.match(sandboxPrivilegedFilesSource, /"workspace"/, 'workspace repair must target the OpenClaw workspace directory')
|
||||
assert.match(sandboxPrivilegedFilesSource, /\/sandbox\/\.openclaw-data\/\$dir/, 'workspace repair must use the policy-writable OpenClaw data tree')
|
||||
assert.match(sandboxPrivilegedFilesSource, /ln -sfn/, 'workspace repair must link the OpenClaw workspace path into writable storage')
|
||||
assert.match(sandboxPrivilegedFilesSource, /chown -R sandbox:sandbox \/sandbox\/\.openclaw-data/, 'workspace repair must make the writable OpenClaw data tree owned by the sandbox user')
|
||||
assert.match(sandboxPrivilegedFilesSource, /AGENTS\.md/, 'workspace repair note must document the AGENTS.md permission failure it prevents')
|
||||
assert.match(sandboxPrivilegedFilesSource, /"agents"/, 'workspace repair must target the OpenClaw agent directory so sessions are writable through .openclaw-data')
|
||||
assert.match(sandboxPrivilegedFilesSource, /"agents"[\s\S]*"workspace"[\s\S]*"memory"/, 'workspace repair must cover NemoClaw expected OpenClaw mutable symlink directories')
|
||||
assert.match(sandboxPrivilegedFilesSource, /sessions\.json\.lock|session lock/, 'workspace repair note must document the sessions.json.lock permission failure it prevents')
|
||||
|
||||
assert.match(hookSource, /type RefreshOptions = \{\s*force\?: boolean\s*\}/, 'inventory refresh must accept a force option')
|
||||
assert.match(hookSource, /!refreshOptions\?\.force && inFlightRef\.current/, 'forced inventory refresh must bypass existing in-flight reads')
|
||||
|
||||
Reference in New Issue
Block a user