@stdiobus/workers-registry 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ See [stdio Bus kernel repository](https://github.com/stdiobus/stdiobus) for buil
|
|
|
139
139
|
"id": "acp-registry",
|
|
140
140
|
"command": "node",
|
|
141
141
|
"args": [
|
|
142
|
-
"
|
|
142
|
+
"@stdiobus/workers-registry",
|
|
143
143
|
"acp-registry"
|
|
144
144
|
],
|
|
145
145
|
"instances": 1
|
|
@@ -168,7 +168,7 @@ route to the ACP Registry. Use `acp-registry` when you need real registry agents
|
|
|
168
168
|
"id": "acp-worker",
|
|
169
169
|
"command": "node",
|
|
170
170
|
"args": [
|
|
171
|
-
"
|
|
171
|
+
"@stdiobus/workers-registry",
|
|
172
172
|
"acp-worker"
|
|
173
173
|
],
|
|
174
174
|
"instances": 1
|
|
@@ -236,7 +236,7 @@ node ./node_modules/@stdiobus/workers-registry/launch echo-worker
|
|
|
236
236
|
"id": "acp-worker",
|
|
237
237
|
"command": "node",
|
|
238
238
|
"args": [
|
|
239
|
-
"
|
|
239
|
+
"@stdiobus/workers-registry",
|
|
240
240
|
"acp-worker"
|
|
241
241
|
],
|
|
242
242
|
"instances": 1
|
|
@@ -252,7 +252,7 @@ node ./node_modules/@stdiobus/workers-registry/launch echo-worker
|
|
|
252
252
|
"id": "acp-registry",
|
|
253
253
|
"command": "node",
|
|
254
254
|
"args": [
|
|
255
|
-
"
|
|
255
|
+
"@stdiobus/workers-registry",
|
|
256
256
|
"acp-registry"
|
|
257
257
|
],
|
|
258
258
|
"instances": 1
|
|
@@ -272,7 +272,7 @@ arg to `launch acp-registry`.
|
|
|
272
272
|
"id": "acp-worker",
|
|
273
273
|
"command": "node",
|
|
274
274
|
"args": [
|
|
275
|
-
"
|
|
275
|
+
"@stdiobus/workers-registry",
|
|
276
276
|
"acp-worker"
|
|
277
277
|
],
|
|
278
278
|
"instances": 2
|
|
@@ -281,7 +281,7 @@ arg to `launch acp-registry`.
|
|
|
281
281
|
"id": "echo-worker",
|
|
282
282
|
"command": "node",
|
|
283
283
|
"args": [
|
|
284
|
-
"
|
|
284
|
+
"@stdiobus/workers-registry",
|
|
285
285
|
"echo-worker"
|
|
286
286
|
],
|
|
287
287
|
"instances": 1
|
|
@@ -390,7 +390,7 @@ Routes messages to any agent in the [ACP Registry](https://cdn.agentclientprotoc
|
|
|
390
390
|
"id": "acp-registry",
|
|
391
391
|
"command": "node",
|
|
392
392
|
"args": [
|
|
393
|
-
"
|
|
393
|
+
"@stdiobus/workers-registry",
|
|
394
394
|
"acp-registry"
|
|
395
395
|
],
|
|
396
396
|
"instances": 1
|
|
@@ -442,7 +442,7 @@ IDE (MCP Client) → MCP-to-ACP Proxy → stdio Bus → ACP Registry Worker (acp
|
|
|
442
442
|
"stdio-bus-acp": {
|
|
443
443
|
"command": "node",
|
|
444
444
|
"args": [
|
|
445
|
-
"
|
|
445
|
+
"@stdiobus/workers-registry",
|
|
446
446
|
"mcp-to-acp-proxy"
|
|
447
447
|
],
|
|
448
448
|
"env": {
|
|
@@ -578,7 +578,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
578
578
|
"id": "echo-worker",
|
|
579
579
|
"command": "node",
|
|
580
580
|
"args": [
|
|
581
|
-
"
|
|
581
|
+
"@stdiobus/workers-registry",
|
|
582
582
|
"echo-worker"
|
|
583
583
|
],
|
|
584
584
|
"instances": 1
|
|
@@ -594,7 +594,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
594
594
|
"id": "acp-worker",
|
|
595
595
|
"command": "node",
|
|
596
596
|
"args": [
|
|
597
|
-
"
|
|
597
|
+
"@stdiobus/workers-registry",
|
|
598
598
|
"acp-worker"
|
|
599
599
|
],
|
|
600
600
|
"instances": 4
|
|
@@ -616,7 +616,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
616
616
|
"id": "acp-worker",
|
|
617
617
|
"command": "node",
|
|
618
618
|
"args": [
|
|
619
|
-
"
|
|
619
|
+
"@stdiobus/workers-registry",
|
|
620
620
|
"acp-worker"
|
|
621
621
|
],
|
|
622
622
|
"instances": 2
|
|
@@ -625,7 +625,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
625
625
|
"id": "echo-worker",
|
|
626
626
|
"command": "node",
|
|
627
627
|
"args": [
|
|
628
|
-
"
|
|
628
|
+
"@stdiobus/workers-registry",
|
|
629
629
|
"echo-worker"
|
|
630
630
|
],
|
|
631
631
|
"instances": 1
|
package/launch/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{fileURLToPath}from"url";import{dirname,join}from"path";import{readFile}from"fs/promises";var __filename=fileURLToPath(import.meta.url);var __dirname=dirname(__filename);var STDIO_BUS_WORKERS={"acp-worker":{path:"../out/dist/workers-registry/acp-worker/index.js",description:"Full ACP protocol implementation with MCP integration"},"acp-registry":{path:"../out/dist/workers-registry/acp-registry/index.js",description:"Registry Launcher worker for ACP Registry agents"},"echo-worker":{path:"../out/dist/workers-registry/echo-worker/echo-worker.js",description:"Simple echo worker for testing NDJSON protocol"},"mcp-echo-server":{path:"../out/dist/workers-registry/mcp-echo-server/index.js",description:"MCP server example for testing"},"mcp-to-acp-proxy":{path:"../out/dist/workers-registry/mcp-to-acp-proxy/proxy.js",description:"MCP-to-ACP protocol bridge"}};function showUsage(){console.error("Usage:
|
|
2
|
+
import{fileURLToPath}from"url";import{dirname,join}from"path";import{readFile}from"fs/promises";var __filename=fileURLToPath(import.meta.url);var __dirname=dirname(__filename);var STDIO_BUS_WORKERS={"acp-worker":{path:"../out/dist/workers-registry/acp-worker/index.js",description:"Full ACP protocol implementation with MCP integration"},"acp-registry":{path:"../out/dist/workers-registry/acp-registry/index.js",description:"Registry Launcher worker for ACP Registry agents"},"echo-worker":{path:"../out/dist/workers-registry/echo-worker/echo-worker.js",description:"Simple echo worker for testing NDJSON protocol"},"mcp-echo-server":{path:"../out/dist/workers-registry/mcp-echo-server/index.js",description:"MCP server example for testing"},"mcp-to-acp-proxy":{path:"../out/dist/workers-registry/mcp-to-acp-proxy/proxy.js",description:"MCP-to-ACP protocol bridge"}};function showUsage(){console.error("Usage: stdiobus <worker-name>");console.error(" node ./node_modules/@stdiobus/workers-registry/launch <worker-name>");console.error("");console.error("Available workers:");for(const[name,config]of Object.entries(STDIO_BUS_WORKERS)){console.error(` - ${name.padEnd(20)} ${config.description}`)}console.error("");console.error("Examples:");console.error(" stdiobus acp-worker");console.error(" stdiobus echo-worker");console.error(" stdiobus mcp-echo-server")}function isValidWorkerName(name){return name in STDIO_BUS_WORKERS}async function main(){const workerName=process.argv[2];if(!workerName){console.error("Error: Worker name is required\n");showUsage();process.exit(1)}if(!isValidWorkerName(workerName)){console.error(`Error: Unknown worker "${workerName}"
|
|
3
3
|
`);showUsage();process.exit(1)}const workerConfig=STDIO_BUS_WORKERS[workerName];const workerPath=workerConfig.path;const absolutePath=join(__dirname,workerPath);try{await readFile(absolutePath);console.error(`[launcher] Starting worker: ${workerName}`);console.error(`[launcher] Description: ${workerConfig.description}`);console.error(`[launcher] Path: ${absolutePath}`);await import(absolutePath)}catch(error){if(error&&typeof error==="object"&&"code"in error&&error.code==="ENOENT"){console.error(`Error: Worker file not found: ${absolutePath}`);console.error("");console.error('Please run "npm run build" first to compile the workers.');process.exit(1)}const errorMessage=error instanceof Error?error.message:String(error);const errorStack=error instanceof Error?error.stack:void 0;console.error(`Error loading worker "${workerName}":`,errorMessage);if(errorStack){console.error(errorStack)}process.exit(1)}}main().catch(error=>{console.error("Fatal error:",error);process.exit(1)});export{STDIO_BUS_WORKERS,isValidWorkerName,main as launch,showUsage};
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/launch/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../workers-registry/launch/index.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n\n/*\n * Apache License 2.0\n * Copyright (c) 2025\u2013present Raman Marozau, Target Insight Function.\n * Contact: raman@worktif.com\n *\n * This file is part of the stdio bus protocol reference implementation:\n * stdio_bus_kernel_workers (target: <target_stdio_bus_kernel_workers>).\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Universal worker launcher for stdio Bus Workers Registry\n *\n * Usage:\n *
|
|
5
|
-
"mappings": ";AAqCA,OAAS,kBAAqB,MAC9B,OAAS,QAAS,SAAY,OAC9B,OAAS,aAAgB,cAEzB,IAAM,WAAa,cAAc,YAAY,GAAG,EAChD,IAAM,UAAY,QAAQ,UAAU,EAapC,IAAM,kBAA4D,CAChE,aAAc,CACZ,KAAM,mDACN,YAAa,uDACf,EACA,eAAgB,CACd,KAAM,qDACN,YAAa,kDACf,EACA,cAAe,CACb,KAAM,0DACN,YAAa,gDACf,EACA,kBAAmB,CACjB,KAAM,wDACN,YAAa,gCACf,EACA,mBAAoB,CAClB,KAAM,yDACN,YAAa,4BACf,CACF,EAUA,SAAS,WAAkB,CACzB,QAAQ,MAAM,
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n\n/*\n * Apache License 2.0\n * Copyright (c) 2025\u2013present Raman Marozau, Target Insight Function.\n * Contact: raman@worktif.com\n *\n * This file is part of the stdio bus protocol reference implementation:\n * stdio_bus_kernel_workers (target: <target_stdio_bus_kernel_workers>).\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Universal worker launcher for stdio Bus Workers Registry\n *\n * Usage:\n * stdiobus <worker-name>\n * stdiobus acp-worker\n * stdiobus echo-worker\n * stdiobus mcp-echo-server\n *\n * This script dynamically imports and runs the specified worker from the compiled output.\n */\n\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { readFile } from 'fs/promises';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Worker configuration mapping worker names to their entry points\n */\ninterface WorkerConfig {\n readonly path: string;\n readonly description: string;\n}\n\n/**\n * Available workers mapping\n */\nconst STDIO_BUS_WORKERS: Readonly<Record<string, WorkerConfig>> = {\n 'acp-worker': {\n path: '../out/dist/workers-registry/acp-worker/index.js',\n description: 'Full ACP protocol implementation with MCP integration'\n },\n 'acp-registry': {\n path: '../out/dist/workers-registry/acp-registry/index.js',\n description: 'Registry Launcher worker for ACP Registry agents'\n },\n 'echo-worker': {\n path: '../out/dist/workers-registry/echo-worker/echo-worker.js',\n description: 'Simple echo worker for testing NDJSON protocol'\n },\n 'mcp-echo-server': {\n path: '../out/dist/workers-registry/mcp-echo-server/index.js',\n description: 'MCP server example for testing'\n },\n 'mcp-to-acp-proxy': {\n path: '../out/dist/workers-registry/mcp-to-acp-proxy/proxy.js',\n description: 'MCP-to-ACP protocol bridge'\n }\n} as const;\n\n/**\n * Worker name type\n */\ntype WorkerName = keyof typeof STDIO_BUS_WORKERS;\n\n/**\n * Display usage information\n */\nfunction showUsage(): void {\n console.error('Usage: stdiobus <worker-name>');\n console.error(' node ./node_modules/@stdiobus/workers-registry/launch <worker-name>');\n console.error('');\n console.error('Available workers:');\n\n for (const [name, config] of Object.entries(STDIO_BUS_WORKERS)) {\n console.error(` - ${name.padEnd(20)} ${config.description}`);\n }\n\n console.error('');\n console.error('Examples:');\n console.error(' stdiobus acp-worker');\n console.error(' stdiobus echo-worker');\n console.error(' stdiobus mcp-echo-server');\n}\n\n/**\n * Validate worker name\n */\nfunction isValidWorkerName(name: string): name is WorkerName {\n return name in STDIO_BUS_WORKERS;\n}\n\n/**\n * Main entry point\n */\nasync function main(): Promise<void> {\n const workerName = process.argv[2];\n\n // Check if worker name is provided\n if (!workerName) {\n console.error('Error: Worker name is required\\n');\n showUsage();\n process.exit(1);\n }\n\n // Check if worker exists\n if (!isValidWorkerName(workerName)) {\n console.error(`Error: Unknown worker \"${workerName}\"\\n`);\n showUsage();\n process.exit(1);\n }\n\n const workerConfig = STDIO_BUS_WORKERS[workerName];\n const workerPath = workerConfig.path;\n\n // Resolve absolute path\n const absolutePath = join(__dirname, workerPath);\n\n try {\n // Verify the worker file exists\n await readFile(absolutePath);\n\n // Import and run the worker\n console.error(`[launcher] Starting worker: ${workerName}`);\n console.error(`[launcher] Description: ${workerConfig.description}`);\n console.error(`[launcher] Path: ${absolutePath}`);\n\n await import(absolutePath);\n } catch (error) {\n if (error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT') {\n console.error(`Error: Worker file not found: ${absolutePath}`);\n console.error('');\n console.error('Please run \"npm run build\" first to compile the workers.');\n process.exit(1);\n }\n\n const errorMessage = error instanceof Error ? error.message : String(error);\n const errorStack = error instanceof Error ? error.stack : undefined;\n\n console.error(`Error loading worker \"${workerName}\":`, errorMessage);\n if (errorStack) {\n console.error(errorStack);\n }\n process.exit(1);\n }\n}\n\n// Run main function\nmain().catch((error) => {\n console.error('Fatal error:', error);\n process.exit(1);\n});\n\n// Export for programmatic usage\nexport { STDIO_BUS_WORKERS, showUsage, isValidWorkerName, main as launch };\nexport type { WorkerConfig, WorkerName };\n"],
|
|
5
|
+
"mappings": ";AAqCA,OAA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,YAAY,EAG3B,QAAQ,MAAM,+BAA+B,UAAU,EAAE,EACzD,QAAQ,MAAM,2BAA2B,aAAa,WAAW,EAAE,EACnE,QAAQ,MAAM,oBAAoB,YAAY,EAAE,EAEhD,MAAM,OAAO,aACf,OAAS,MAAO,CACd,GAAI,OAAS,OAAO,QAAU,UAAY,SAAU,OAAS,MAAM,OAAS,SAAU,CACpF,QAAQ,MAAM,iCAAiC,YAAY,EAAE,EAC7D,QAAQ,MAAM,EAAE,EAChB,QAAQ,MAAM,0DAA0D,EACxE,QAAQ,KAAK,CAAC,CAChB,CAEA,MAAM,aAAe,iBAAiB,MAAQ,MAAM,QAAU,OAAO,KAAK,EAC1E,MAAM,WAAa,iBAAiB,MAAQ,MAAM,MAAQ,OAE1D,QAAQ,MAAM,yBAAyB,UAAU,KAAM,YAAY,EACnE,GAAI,WAAY,CACd,QAAQ,MAAM,UAAU,CAC1B,CACA,QAAQ,KAAK,CAAC,CAChB,CACF,CAGA,KAAK,EAAE,MAAO,OAAU,CACtB,QAAQ,MAAM,eAAgB,KAAK,EACnC,QAAQ,KAAK,CAAC,CAChB,CAAC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import net from"net";import{createInterface}from"readline";var ACP_HOST=process.env.ACP_HOST||"127.0.0.1";var ACP_PORT=process.env.ACP_PORT||9e3;var AGENT_ID=process.env.AGENT_ID||"default-agent";console.error(`[MCP-APC][proxy] Starting proxy...`);console.error(`[MCP-APC][proxy] Target: ${ACP_HOST}:${ACP_PORT}`);console.error(`[MCP-APC][proxy] Agent ID: ${AGENT_ID}`);var acpSocket=net.connect(ACP_PORT,ACP_HOST);var acpConnected=false;var proxySessionId=null;var acpSessionId=null;var pendingRequests=new Map;var accumulatedText=new Map;acpSocket.on("connect",()=>{console.error("[MCP-APC][proxy] Connected to ACP stdio Bus");acpConnected=true});acpSocket.on("error",err=>{console.error(`[MCP-APC][proxy] ACP connection error: ${err.message}`);process.exit(1)});var acpBuffer="";acpSocket.on("data",data=>{acpBuffer+=data.toString();let newlineIndex;while((newlineIndex=acpBuffer.indexOf("\n"))!==-1){const line=acpBuffer.slice(0,newlineIndex);acpBuffer=acpBuffer.slice(newlineIndex+1);if(line.trim()){try{const acpMsg=JSON.parse(line);console.error(`[MCP-APC][proxy] \u2190 ACP: ${JSON.stringify(acpMsg)}`);if(acpMsg.id===void 0||acpMsg.id===null){console.error(`[MCP-APC][proxy] Processing notification: ${acpMsg.method}`);handleACPNotification(acpMsg)}else{console.error(`[MCP-APC][proxy] Processing response id=${acpMsg.id}`);console.error(`[MCP-APC][proxy] Pending: ${JSON.stringify([...pendingRequests.keys()])}`);const mcpResponse=convertACPtoMCP(acpMsg);if(mcpResponse){console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(mcpResponse)}`);process.stdout.write(JSON.stringify(mcpResponse)+"\n")}else{console.error(`[MCP-APC][proxy] WARNING: No MCP response for id=${acpMsg.id}`)}}}catch(err){console.error(`[MCP-APC][proxy] Error parsing ACP: ${err.message}`)}}}});var rl=createInterface({input:process.stdin,terminal:false});rl.on("line",line=>{if(!line.trim())return;try{const mcpReq=JSON.parse(line);console.error(`[MCP-APC][proxy] \u2190 MCP: ${JSON.stringify(mcpReq)}`);const acpReq=convertMCPtoACP(mcpReq);if(acpReq){console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(acpReq)}`);if(acpConnected){acpSocket.write(JSON.stringify(acpReq)+"\n")}}}catch(err){console.error(`[MCP-APC][proxy] Error parsing MCP: ${err.message}`)}});function handleACPNotification(msg){const{method,params}=msg;if(method==="session/update"&¶ms?.update){const update=params.update;for(const[reqId,pending]of pendingRequests.entries()){if(pending.method==="session/prompt"){if(update.sessionUpdate==="agent_message_chunk"&&update.content?.text){if(!accumulatedText.has(reqId)){accumulatedText.set(reqId,"")}accumulatedText.set(reqId,accumulatedText.get(reqId)+update.content.text)}break}}}}function convertMCPtoACP(mcpReq){const{id,method,params}=mcpReq;if(id===void 0||id===null){return null}pendingRequests.set(id,{method,params});if(!proxySessionId){proxySessionId=`proxy-${Date.now()}`}switch(method){case"initialize":return{jsonrpc:"2.0",id,method:"initialize",agentId:AGENT_ID,sessionId:proxySessionId,params:{protocolVersion:1,clientCapabilities:params?.capabilities||{},clientInfo:params?.clientInfo||{name:"mcp-proxy",version:"1.0.0"}}};case"tools/list":sendMCP({jsonrpc:"2.0",id,result:{tools:[{name:"acp_prompt",description:`Send prompt to ${AGENT_ID}`,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Prompt text"}},required:["prompt"]}}]}});pendingRequests.delete(id);return null;case"tools/call":const promptText=params?.arguments?.prompt||"";if(!acpSessionId){const sessionReqId=`sess-${id}`;pendingRequests.set(sessionReqId,{method:"session/new",originalId:id,promptText});return{jsonrpc:"2.0",id:sessionReqId,method:"session/new",agentId:AGENT_ID,sessionId:proxySessionId,params:{cwd:process.cwd(),mcpServers:[]}}}pendingRequests.set(id,{method:"session/prompt",params});return{jsonrpc:"2.0",id,method:"session/prompt",agentId:AGENT_ID,sessionId:proxySessionId,params:{sessionId:acpSessionId,prompt:[{type:"text",text:promptText}]}};case"resources/list":sendMCP({jsonrpc:"2.0",id,result:{resources:[]}});pendingRequests.delete(id);return null;case"resources/templates/list":sendMCP({jsonrpc:"2.0",id,result:{resourceTemplates:[]}});pendingRequests.delete(id);return null;case"prompts/list":sendMCP({jsonrpc:"2.0",id,result:{prompts:[]}});pendingRequests.delete(id);return null;default:sendMCP({jsonrpc:"2.0",id,error:{code:-32601,message:`Unknown method: ${method}`}});pendingRequests.delete(id);return null}}function convertACPtoMCP(acpResp){const{id,result,error}=acpResp;const pending=pendingRequests.get(id);if(!pending){console.error(`[MCP-APC][proxy] ERROR: No pending request for id=${id}`);return null}console.error(`[MCP-APC][proxy] Converting ACP->MCP for method: ${pending.method}`);pendingRequests.delete(id);if(error){accumulatedText.delete(id);return{jsonrpc:"2.0",id,error:{code:error.code||-32603,message:error.message||"ACP error"}}}switch(pending.method){case"initialize":return{jsonrpc:"2.0",id,result:{protocolVersion:"2024-11-05",capabilities:{tools:{},resources:{}},serverInfo:result?.agentInfo||{name:"acp-agent",version:"1.0.0"}}};case"session/new":acpSessionId=result?.sessionId;console.error(`[MCP-APC][proxy] ACP session: ${acpSessionId}`);if(pending.originalId&&pending.promptText){const promptReq={jsonrpc:"2.0",id:pending.originalId,method:"session/prompt",agentId:AGENT_ID,sessionId:proxySessionId,params:{sessionId:acpSessionId,prompt:[{type:"text",text:pending.promptText}]}};pendingRequests.set(pending.originalId,{method:"session/prompt"});console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(promptReq)}`);if(acpConnected){acpSocket.write(JSON.stringify(promptReq)+"\n")}}return null;case"session/prompt":const text=accumulatedText.get(id)||"";accumulatedText.delete(id);console.error(`[MCP-APC][proxy] Returning accumulated text (${text.length} chars): "${text.substring(0,50)}..."`);return{jsonrpc:"2.0",id,result:{content:[{type:"text",text:text||"No response"}]}};default:console.error(`[MCP-APC][proxy] WARNING: Unhandled method ${pending.method}, returning raw result`);return{jsonrpc:"2.0",id,result:result||{}}}}function sendMCP(msg){console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(msg)}`);process.stdout.write(JSON.stringify(msg)+"\n")}process.on("SIGTERM",()=>{acpSocket.end();process.exit(0)});process.on("SIGINT",()=>{acpSocket.end();process.exit(0)});
|
|
2
|
+
import net from"net";import{createInterface}from"readline";var ACP_HOST=process.env.ACP_HOST||"127.0.0.1";var ACP_PORT=process.env.ACP_PORT||9e3;var AGENT_ID=process.env.AGENT_ID||"default-agent";console.error(`[MCP-APC][proxy] Starting proxy...`);console.error(`[MCP-APC][proxy] Target: ${ACP_HOST}:${ACP_PORT}`);console.error(`[MCP-APC][proxy] Agent ID: ${AGENT_ID}`);var acpSocket=net.connect(ACP_PORT,ACP_HOST);var acpConnected=false;var proxySessionId=null;var acpSessionId=null;var pendingRequests=new Map;var accumulatedText=new Map;acpSocket.on("connect",()=>{console.error("[MCP-APC][proxy] Connected to ACP stdio Bus");acpConnected=true});acpSocket.on("error",err=>{console.error(`[MCP-APC][proxy] ACP connection error: ${err.message}`);process.exit(1)});var acpBuffer="";acpSocket.on("data",data=>{acpBuffer+=data.toString();let newlineIndex;while((newlineIndex=acpBuffer.indexOf("\n"))!==-1){const line=acpBuffer.slice(0,newlineIndex);acpBuffer=acpBuffer.slice(newlineIndex+1);if(line.trim()){try{const acpMsg=JSON.parse(line);console.error(`[MCP-APC][proxy] \u2190 ACP: ${JSON.stringify(acpMsg)}`);if(acpMsg.id===void 0||acpMsg.id===null){console.error(`[MCP-APC][proxy] Processing notification: ${acpMsg.method}`);handleACPNotification(acpMsg)}else{console.error(`[MCP-APC][proxy] Processing response id=${acpMsg.id}`);console.error(`[MCP-APC][proxy] Pending: ${JSON.stringify([...pendingRequests.keys()])}`);const mcpResponse=convertACPtoMCP(acpMsg);if(mcpResponse){console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(mcpResponse)}`);process.stdout.write(JSON.stringify(mcpResponse)+"\n")}else{console.error(`[MCP-APC][proxy] WARNING: No MCP response for id=${acpMsg.id}`)}}}catch(err){console.error(`[MCP-APC][proxy] Error parsing ACP: ${err.message}`)}}}});var rl=createInterface({input:process.stdin,terminal:false});rl.on("line",line=>{if(!line.trim())return;try{const mcpReq=JSON.parse(line);console.error(`[MCP-APC][proxy] \u2190 MCP: ${JSON.stringify(mcpReq)}`);const acpReq=convertMCPtoACP(mcpReq);if(acpReq){console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(acpReq)}`);if(acpConnected){acpSocket.write(JSON.stringify(acpReq)+"\n")}}}catch(err){console.error(`[MCP-APC][proxy] Error parsing MCP: ${err.message}`)}});function handleACPNotification(msg){const{method,params}=msg;if(method==="session/update"&¶ms?.update){const update=params.update;for(const[reqId,pending]of pendingRequests.entries()){if(pending.method==="session/prompt"){if(update.sessionUpdate==="agent_message_chunk"&&update.content?.text){if(!accumulatedText.has(reqId)){accumulatedText.set(reqId,"")}accumulatedText.set(reqId,accumulatedText.get(reqId)+update.content.text)}break}}}if(proxySessionId&&acpConnected){const notificationWithSession={...msg,sessionId:proxySessionId};console.error(`[MCP-ACP][proxy] \u2192 stdio_bus notification with sessionId: ${JSON.stringify(notificationWithSession)}`);acpSocket.write(JSON.stringify(notificationWithSession)+"\n")}}function convertMCPtoACP(mcpReq){const{id,method,params}=mcpReq;if(id===void 0||id===null){return null}pendingRequests.set(id,{method,params});if(!proxySessionId){proxySessionId=`proxy-${Date.now()}`}switch(method){case"initialize":return{jsonrpc:"2.0",id,method:"initialize",agentId:AGENT_ID,sessionId:proxySessionId,params:{protocolVersion:1,clientCapabilities:params?.capabilities||{},clientInfo:params?.clientInfo||{name:"mcp-proxy",version:"1.0.0"}}};case"tools/list":sendMCP({jsonrpc:"2.0",id,result:{tools:[{name:"acp_prompt",description:`Send prompt to ${AGENT_ID}`,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Prompt text"}},required:["prompt"]}}]}});pendingRequests.delete(id);return null;case"tools/call":const promptText=params?.arguments?.prompt||"";if(!acpSessionId){const sessionReqId=`sess-${id}`;pendingRequests.set(sessionReqId,{method:"session/new",originalId:id,promptText});return{jsonrpc:"2.0",id:sessionReqId,method:"session/new",agentId:AGENT_ID,sessionId:proxySessionId,params:{cwd:process.cwd(),mcpServers:[]}}}pendingRequests.set(id,{method:"session/prompt",params});return{jsonrpc:"2.0",id,method:"session/prompt",agentId:AGENT_ID,sessionId:proxySessionId,params:{sessionId:acpSessionId,prompt:[{type:"text",text:promptText}]}};case"resources/list":sendMCP({jsonrpc:"2.0",id,result:{resources:[]}});pendingRequests.delete(id);return null;case"resources/templates/list":sendMCP({jsonrpc:"2.0",id,result:{resourceTemplates:[]}});pendingRequests.delete(id);return null;case"prompts/list":sendMCP({jsonrpc:"2.0",id,result:{prompts:[]}});pendingRequests.delete(id);return null;default:sendMCP({jsonrpc:"2.0",id,error:{code:-32601,message:`Unknown method: ${method}`}});pendingRequests.delete(id);return null}}function convertACPtoMCP(acpResp){const{id,result,error}=acpResp;const pending=pendingRequests.get(id);if(!pending){console.error(`[MCP-APC][proxy] ERROR: No pending request for id=${id}`);return null}console.error(`[MCP-APC][proxy] Converting ACP->MCP for method: ${pending.method}`);pendingRequests.delete(id);if(error){accumulatedText.delete(id);return{jsonrpc:"2.0",id,error:{code:error.code||-32603,message:error.message||"ACP error"}}}switch(pending.method){case"initialize":return{jsonrpc:"2.0",id,result:{protocolVersion:"2024-11-05",capabilities:{tools:{},resources:{}},serverInfo:result?.agentInfo||{name:"acp-agent",version:"1.0.0"}}};case"session/new":acpSessionId=result?.sessionId;console.error(`[MCP-APC][proxy] ACP session: ${acpSessionId}`);if(pending.originalId&&pending.promptText){const promptReq={jsonrpc:"2.0",id:pending.originalId,method:"session/prompt",agentId:AGENT_ID,sessionId:proxySessionId,params:{sessionId:acpSessionId,prompt:[{type:"text",text:pending.promptText}]}};pendingRequests.set(pending.originalId,{method:"session/prompt"});console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(promptReq)}`);if(acpConnected){acpSocket.write(JSON.stringify(promptReq)+"\n")}}return null;case"session/prompt":const text=accumulatedText.get(id)||"";accumulatedText.delete(id);console.error(`[MCP-APC][proxy] Returning accumulated text (${text.length} chars): "${text.substring(0,50)}..."`);return{jsonrpc:"2.0",id,result:{content:[{type:"text",text:text||"No response"}]}};default:console.error(`[MCP-APC][proxy] WARNING: Unhandled method ${pending.method}, returning raw result`);return{jsonrpc:"2.0",id,result:result||{}}}}function sendMCP(msg){console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(msg)}`);process.stdout.write(JSON.stringify(msg)+"\n")}process.on("SIGTERM",()=>{acpSocket.end();process.exit(0)});process.on("SIGINT",()=>{acpSocket.end();process.exit(0)});
|
|
3
3
|
//# sourceMappingURL=proxy.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../workers-registry/mcp-to-acp-proxy/proxy.js"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n\n/*\n * Apache License 2.0\n * Copyright (c) 2025\u2013present Raman Marozau, Target Insight Function.\n * Contact: raman@worktif.com\n *\n * This file is part of the stdio bus protocol reference implementation:\n * stdio_bus_kernel_workers (target: <target_stdio_bus_kernel_workers>).\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * MCP-to-ACP Protocol Proxy\n *\n * Converts MCP protocol (from Kiro) to ACP protocol (for stdio Bus)\n * Runs as MCP server for Kiro, forwards to ACP via TCP\n */\n\nimport net from 'net';\nimport { createInterface } from 'readline';\n\nconst ACP_HOST = process.env.ACP_HOST || '127.0.0.1';\nconst ACP_PORT = process.env.ACP_PORT || 9000;\nconst AGENT_ID = process.env.AGENT_ID || 'default-agent';\n\nconsole.error(`[MCP-APC][proxy] Starting proxy...`);\nconsole.error(`[MCP-APC][proxy] Target: ${ACP_HOST}:${ACP_PORT}`);\nconsole.error(`[MCP-APC][proxy] Agent ID: ${AGENT_ID}`);\n\n// State\nconst acpSocket = net.connect(ACP_PORT, ACP_HOST);\nlet acpConnected = false;\nlet proxySessionId = null; // For stdio Bus routing\nlet acpSessionId = null; // From ACP agent\nlet pendingRequests = new Map(); // id -> {method, params, ...}\nlet accumulatedText = new Map(); // requestId -> accumulated text\n\nacpSocket.on('connect', () => {\n console.error('[MCP-APC][proxy] Connected to ACP stdio Bus');\n acpConnected = true;\n});\n\nacpSocket.on('error', (err) => {\n console.error(`[MCP-APC][proxy] ACP connection error: ${err.message}`);\n process.exit(1);\n});\n\n// Handle ACP messages\nlet acpBuffer = '';\nacpSocket.on('data', (data) => {\n acpBuffer += data.toString();\n\n let newlineIndex;\n while ((newlineIndex = acpBuffer.indexOf('\\n')) !== -1) {\n const line = acpBuffer.slice(0, newlineIndex);\n acpBuffer = acpBuffer.slice(newlineIndex + 1);\n\n if (line.trim()) {\n try {\n const acpMsg = JSON.parse(line);\n console.error(`[MCP-APC][proxy] \u2190 ACP: ${JSON.stringify(acpMsg)}`);\n\n // Check if notification or response\n if (acpMsg.id === undefined || acpMsg.id === null) {\n // Notification from ACP worker - rewrite sessionId and send back to stdio Bus\n console.error(`[MCP-APC][proxy] Processing notification: ${acpMsg.method}`);\n handleACPNotification(acpMsg);\n } else {\n // Response\n console.error(`[MCP-APC][proxy] Processing response id=${acpMsg.id}`);\n console.error(`[MCP-APC][proxy] Pending: ${JSON.stringify([...pendingRequests.keys()])}`);\n const mcpResponse = convertACPtoMCP(acpMsg);\n if (mcpResponse) {\n console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(mcpResponse)}`);\n process.stdout.write(JSON.stringify(mcpResponse) + '\\n');\n } else {\n console.error(`[MCP-APC][proxy] WARNING: No MCP response for id=${acpMsg.id}`);\n }\n }\n } catch (err) {\n console.error(`[MCP-APC][proxy] Error parsing ACP: ${err.message}`);\n }\n }\n }\n});\n\n// Handle MCP requests\nconst rl = createInterface({\n input: process.stdin,\n terminal: false\n});\n\nrl.on('line', (line) => {\n if (!line.trim()) return;\n\n try {\n const mcpReq = JSON.parse(line);\n console.error(`[MCP-APC][proxy] \u2190 MCP: ${JSON.stringify(mcpReq)}`);\n\n const acpReq = convertMCPtoACP(mcpReq);\n if (acpReq) {\n console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(acpReq)}`);\n if (acpConnected) {\n acpSocket.write(JSON.stringify(acpReq) + '\\n');\n }\n }\n } catch (err) {\n console.error(`[MCP-APC][proxy] Error parsing MCP: ${err.message}`);\n }\n});\n\nfunction handleACPNotification(msg) {\n const { method, params } = msg;\n\n if (method === 'session/update' && params?.update) {\n const update = params.update;\n\n // Find pending session/prompt request\n for (const [reqId, pending] of pendingRequests.entries()) {\n if (pending.method === 'session/prompt') {\n if (update.sessionUpdate === 'agent_message_chunk' && update.content?.text) {\n if (!accumulatedText.has(reqId)) {\n accumulatedText.set(reqId, '');\n }\n accumulatedText.set(reqId, accumulatedText.get(reqId) + update.content.text);\n }\n break;\n }\n }\n }\n}\n\nfunction convertMCPtoACP(mcpReq) {\n const { id, method, params } = mcpReq;\n\n if (id === undefined || id === null) {\n return null; // Ignore notifications\n }\n\n pendingRequests.set(id, { method, params });\n\n if (!proxySessionId) {\n proxySessionId = `proxy-${Date.now()}`;\n }\n\n switch (method) {\n case 'initialize':\n return {\n jsonrpc: '2.0',\n id,\n method: 'initialize',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: {\n protocolVersion: 1,\n clientCapabilities: params?.capabilities || {},\n clientInfo: params?.clientInfo || { name: 'mcp-proxy', version: '1.0.0' }\n }\n };\n\n case 'tools/list':\n sendMCP({\n jsonrpc: '2.0',\n id,\n result: {\n tools: [{\n name: 'acp_prompt',\n description: `Send prompt to ${AGENT_ID}`,\n inputSchema: {\n type: 'object',\n properties: {\n prompt: { type: 'string', description: 'Prompt text' }\n },\n required: ['prompt']\n }\n }]\n }\n });\n pendingRequests.delete(id);\n return null;\n\n case 'tools/call':\n const promptText = params?.arguments?.prompt || '';\n\n if (!acpSessionId) {\n // Need to create session first\n const sessionReqId = `sess-${id}`;\n pendingRequests.set(sessionReqId, {\n method: 'session/new',\n originalId: id,\n promptText\n });\n return {\n jsonrpc: '2.0',\n id: sessionReqId,\n method: 'session/new',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: { cwd: process.cwd(), mcpServers: [] }\n };\n }\n\n // Session exists, send prompt\n // IMPORTANT: Update pending to session/prompt since that's what we're sending\n pendingRequests.set(id, { method: 'session/prompt', params });\n return {\n jsonrpc: '2.0',\n id,\n method: 'session/prompt',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: {\n sessionId: acpSessionId,\n prompt: [{ type: 'text', text: promptText }]\n }\n };\n\n case 'resources/list':\n sendMCP({ jsonrpc: '2.0', id, result: { resources: [] } });\n pendingRequests.delete(id);\n return null;\n\n case 'resources/templates/list':\n sendMCP({ jsonrpc: '2.0', id, result: { resourceTemplates: [] } });\n pendingRequests.delete(id);\n return null;\n\n case 'prompts/list':\n sendMCP({ jsonrpc: '2.0', id, result: { prompts: [] } });\n pendingRequests.delete(id);\n return null;\n\n default:\n sendMCP({ jsonrpc: '2.0', id, error: { code: -32601, message: `Unknown method: ${method}` } });\n pendingRequests.delete(id);\n return null;\n }\n}\n\nfunction convertACPtoMCP(acpResp) {\n const { id, result, error } = acpResp;\n\n const pending = pendingRequests.get(id);\n if (!pending) {\n console.error(`[MCP-APC][proxy] ERROR: No pending request for id=${id}`);\n return null;\n }\n\n console.error(`[MCP-APC][proxy] Converting ACP->MCP for method: ${pending.method}`);\n pendingRequests.delete(id);\n\n if (error) {\n accumulatedText.delete(id);\n return {\n jsonrpc: '2.0',\n id,\n error: { code: error.code || -32603, message: error.message || 'ACP error' }\n };\n }\n\n switch (pending.method) {\n case 'initialize':\n return {\n jsonrpc: '2.0',\n id,\n result: {\n protocolVersion: '2024-11-05',\n capabilities: { tools: {}, resources: {} },\n serverInfo: result?.agentInfo || { name: 'acp-agent', version: '1.0.0' }\n }\n };\n\n case 'session/new':\n acpSessionId = result?.sessionId;\n console.error(`[MCP-APC][proxy] ACP session: ${acpSessionId}`);\n\n if (pending.originalId && pending.promptText) {\n // Send queued prompt\n const promptReq = {\n jsonrpc: '2.0',\n id: pending.originalId,\n method: 'session/prompt',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: {\n sessionId: acpSessionId,\n prompt: [{ type: 'text', text: pending.promptText }]\n }\n };\n\n pendingRequests.set(pending.originalId, { method: 'session/prompt' });\n\n console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(promptReq)}`);\n if (acpConnected) {\n acpSocket.write(JSON.stringify(promptReq) + '\\n');\n }\n }\n return null;\n\n case 'session/prompt':\n const text = accumulatedText.get(id) || '';\n accumulatedText.delete(id);\n console.error(`[MCP-APC][proxy] Returning accumulated text (${text.length} chars): \"${text.substring(0, 50)}...\"`);\n return {\n jsonrpc: '2.0',\n id,\n result: {\n content: [{ type: 'text', text: text || 'No response' }]\n }\n };\n\n default:\n console.error(`[MCP-APC][proxy] WARNING: Unhandled method ${pending.method}, returning raw result`);\n return { jsonrpc: '2.0', id, result: result || {} };\n }\n}\n\nfunction sendMCP(msg) {\n console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(msg)}`);\n process.stdout.write(JSON.stringify(msg) + '\\n');\n}\n\nprocess.on('SIGTERM', () => {\n acpSocket.end();\n process.exit(0);\n});\n\nprocess.on('SIGINT', () => {\n acpSocket.end();\n process.exit(0);\n});\n"],
|
|
5
|
-
"mappings": ";AAgCA,OAAO,QAAS,MAChB,OAAS,oBAAuB,WAEhC,IAAM,SAAW,QAAQ,IAAI,UAAY,YACzC,IAAM,SAAW,QAAQ,IAAI,UAAY,IACzC,IAAM,SAAW,QAAQ,IAAI,UAAY,gBAEzC,QAAQ,MAAM,oCAAoC,EAClD,QAAQ,MAAM,4BAA4B,QAAQ,IAAI,QAAQ,EAAE,EAChE,QAAQ,MAAM,8BAA8B,QAAQ,EAAE,EAGtD,IAAM,UAAY,IAAI,QAAQ,SAAU,QAAQ,EAChD,IAAI,aAAe,MACnB,IAAI,eAAiB,KACrB,IAAI,aAAe,KACnB,IAAI,gBAAkB,IAAI,IAC1B,IAAI,gBAAkB,IAAI,IAE1B,UAAU,GAAG,UAAW,IAAM,CAC5B,QAAQ,MAAM,6CAA6C,EAC3D,aAAe,IACjB,CAAC,EAED,UAAU,GAAG,QAAU,KAAQ,CAC7B,QAAQ,MAAM,0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ET,IAAK,iBACH,MAAM,KAAO,gBAAgB,IAAI,EAAE,GAAK,GACxC,gBAAgB,OAAO,EAAE,EACzB,QAAQ,MAAM,gDAAgD,KAAK,MAAM,aAAa,KAAK,UAAU,EAAG,EAAE,CAAC,MAAM,EACjH,MAAO,CACL,QAAS,MACT,GACA,OAAQ,CACN,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAM,MAAQ,aAAc,CAAC,CACzD,CACF,EAEF,QACE,QAAQ,MAAM,8CAA8C,QAAQ,MAAM,wBAAwB,EAClG,MAAO,CAAE,QAAS,MAAO,GAAI,OAAQ,QAAU,CAAC,CAAE,CACtD,CACF,CAEA,SAAS,QAAQ,IAAK,CACpB,QAAQ,MAAM,gCAA2B,KAAK,UAAU,GAAG,CAAC,EAAE,EAC9D,QAAQ,OAAO,MAAM,KAAK,UAAU,GAAG,EAAI,IAAI,CACjD,CAEA,QAAQ,GAAG,UAAW,IAAM,CAC1B,UAAU,IAAI,EACd,QAAQ,KAAK,CAAC,CAChB,CAAC,EAED,QAAQ,GAAG,SAAU,IAAM,CACzB,UAAU,IAAI,EACd,QAAQ,KAAK,CAAC,CAChB,CAAC",
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n\n/*\n * Apache License 2.0\n * Copyright (c) 2025\u2013present Raman Marozau, Target Insight Function.\n * Contact: raman@worktif.com\n *\n * This file is part of the stdio bus protocol reference implementation:\n * stdio_bus_kernel_workers (target: <target_stdio_bus_kernel_workers>).\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * MCP-to-ACP Protocol Proxy\n *\n * Converts MCP protocol (from Kiro) to ACP protocol (for stdio Bus)\n * Runs as MCP server for Kiro, forwards to ACP via TCP\n */\n\nimport net from 'net';\nimport { createInterface } from 'readline';\n\nconst ACP_HOST = process.env.ACP_HOST || '127.0.0.1';\nconst ACP_PORT = process.env.ACP_PORT || 9000;\nconst AGENT_ID = process.env.AGENT_ID || 'default-agent';\n\nconsole.error(`[MCP-APC][proxy] Starting proxy...`);\nconsole.error(`[MCP-APC][proxy] Target: ${ACP_HOST}:${ACP_PORT}`);\nconsole.error(`[MCP-APC][proxy] Agent ID: ${AGENT_ID}`);\n\n// State\nconst acpSocket = net.connect(ACP_PORT, ACP_HOST);\nlet acpConnected = false;\nlet proxySessionId = null; // For stdio Bus routing\nlet acpSessionId = null; // From ACP agent\nlet pendingRequests = new Map(); // id -> {method, params, ...}\nlet accumulatedText = new Map(); // requestId -> accumulated text\n\nacpSocket.on('connect', () => {\n console.error('[MCP-APC][proxy] Connected to ACP stdio Bus');\n acpConnected = true;\n});\n\nacpSocket.on('error', (err) => {\n console.error(`[MCP-APC][proxy] ACP connection error: ${err.message}`);\n process.exit(1);\n});\n\n// Handle ACP messages\nlet acpBuffer = '';\nacpSocket.on('data', (data) => {\n acpBuffer += data.toString();\n\n let newlineIndex;\n while ((newlineIndex = acpBuffer.indexOf('\\n')) !== -1) {\n const line = acpBuffer.slice(0, newlineIndex);\n acpBuffer = acpBuffer.slice(newlineIndex + 1);\n\n if (line.trim()) {\n try {\n const acpMsg = JSON.parse(line);\n console.error(`[MCP-APC][proxy] \u2190 ACP: ${JSON.stringify(acpMsg)}`);\n\n // Check if notification or response\n if (acpMsg.id === undefined || acpMsg.id === null) {\n // Notification from ACP worker - rewrite sessionId and send back to stdio Bus\n console.error(`[MCP-APC][proxy] Processing notification: ${acpMsg.method}`);\n handleACPNotification(acpMsg);\n } else {\n // Response\n console.error(`[MCP-APC][proxy] Processing response id=${acpMsg.id}`);\n console.error(`[MCP-APC][proxy] Pending: ${JSON.stringify([...pendingRequests.keys()])}`);\n const mcpResponse = convertACPtoMCP(acpMsg);\n if (mcpResponse) {\n console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(mcpResponse)}`);\n process.stdout.write(JSON.stringify(mcpResponse) + '\\n');\n } else {\n console.error(`[MCP-APC][proxy] WARNING: No MCP response for id=${acpMsg.id}`);\n }\n }\n } catch (err) {\n console.error(`[MCP-APC][proxy] Error parsing ACP: ${err.message}`);\n }\n }\n }\n});\n\n// Handle MCP requests\nconst rl = createInterface({\n input: process.stdin,\n terminal: false\n});\n\nrl.on('line', (line) => {\n if (!line.trim()) return;\n\n try {\n const mcpReq = JSON.parse(line);\n console.error(`[MCP-APC][proxy] \u2190 MCP: ${JSON.stringify(mcpReq)}`);\n\n const acpReq = convertMCPtoACP(mcpReq);\n if (acpReq) {\n console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(acpReq)}`);\n if (acpConnected) {\n acpSocket.write(JSON.stringify(acpReq) + '\\n');\n }\n }\n } catch (err) {\n console.error(`[MCP-APC][proxy] Error parsing MCP: ${err.message}`);\n }\n});\n\nfunction handleACPNotification(msg) {\n const { method, params } = msg;\n\n if (method === 'session/update' && params?.update) {\n const update = params.update;\n\n // Find pending session/prompt request\n for (const [reqId, pending] of pendingRequests.entries()) {\n if (pending.method === 'session/prompt') {\n if (update.sessionUpdate === 'agent_message_chunk' && update.content?.text) {\n if (!accumulatedText.has(reqId)) {\n accumulatedText.set(reqId, '');\n }\n accumulatedText.set(reqId, accumulatedText.get(reqId) + update.content.text);\n }\n break;\n }\n }\n }\n\n // CRITICAL FIX: Forward notification back to stdio_bus with sessionId for proper routing\n // Without sessionId, stdio_bus cannot route the notification and logs warning:\n // \"[WARN] Worker message has no id or sessionId, cannot route\"\n if (proxySessionId && acpConnected) {\n const notificationWithSession = {\n ...msg,\n sessionId: proxySessionId\n };\n console.error(`[MCP-ACP][proxy] \u2192 stdio_bus notification with sessionId: ${JSON.stringify(notificationWithSession)}`);\n acpSocket.write(JSON.stringify(notificationWithSession) + '\\n');\n }\n}\n\nfunction convertMCPtoACP(mcpReq) {\n const { id, method, params } = mcpReq;\n\n if (id === undefined || id === null) {\n return null; // Ignore notifications\n }\n\n pendingRequests.set(id, { method, params });\n\n if (!proxySessionId) {\n proxySessionId = `proxy-${Date.now()}`;\n }\n\n switch (method) {\n case 'initialize':\n return {\n jsonrpc: '2.0',\n id,\n method: 'initialize',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: {\n protocolVersion: 1,\n clientCapabilities: params?.capabilities || {},\n clientInfo: params?.clientInfo || { name: 'mcp-proxy', version: '1.0.0' }\n }\n };\n\n case 'tools/list':\n sendMCP({\n jsonrpc: '2.0',\n id,\n result: {\n tools: [{\n name: 'acp_prompt',\n description: `Send prompt to ${AGENT_ID}`,\n inputSchema: {\n type: 'object',\n properties: {\n prompt: { type: 'string', description: 'Prompt text' }\n },\n required: ['prompt']\n }\n }]\n }\n });\n pendingRequests.delete(id);\n return null;\n\n case 'tools/call':\n const promptText = params?.arguments?.prompt || '';\n\n if (!acpSessionId) {\n // Need to create session first\n const sessionReqId = `sess-${id}`;\n pendingRequests.set(sessionReqId, {\n method: 'session/new',\n originalId: id,\n promptText\n });\n return {\n jsonrpc: '2.0',\n id: sessionReqId,\n method: 'session/new',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: { cwd: process.cwd(), mcpServers: [] }\n };\n }\n\n // Session exists, send prompt\n // IMPORTANT: Update pending to session/prompt since that's what we're sending\n pendingRequests.set(id, { method: 'session/prompt', params });\n return {\n jsonrpc: '2.0',\n id,\n method: 'session/prompt',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: {\n sessionId: acpSessionId,\n prompt: [{ type: 'text', text: promptText }]\n }\n };\n\n case 'resources/list':\n sendMCP({ jsonrpc: '2.0', id, result: { resources: [] } });\n pendingRequests.delete(id);\n return null;\n\n case 'resources/templates/list':\n sendMCP({ jsonrpc: '2.0', id, result: { resourceTemplates: [] } });\n pendingRequests.delete(id);\n return null;\n\n case 'prompts/list':\n sendMCP({ jsonrpc: '2.0', id, result: { prompts: [] } });\n pendingRequests.delete(id);\n return null;\n\n default:\n sendMCP({ jsonrpc: '2.0', id, error: { code: -32601, message: `Unknown method: ${method}` } });\n pendingRequests.delete(id);\n return null;\n }\n}\n\nfunction convertACPtoMCP(acpResp) {\n const { id, result, error } = acpResp;\n\n const pending = pendingRequests.get(id);\n if (!pending) {\n console.error(`[MCP-APC][proxy] ERROR: No pending request for id=${id}`);\n return null;\n }\n\n console.error(`[MCP-APC][proxy] Converting ACP->MCP for method: ${pending.method}`);\n pendingRequests.delete(id);\n\n if (error) {\n accumulatedText.delete(id);\n return {\n jsonrpc: '2.0',\n id,\n error: { code: error.code || -32603, message: error.message || 'ACP error' }\n };\n }\n\n switch (pending.method) {\n case 'initialize':\n return {\n jsonrpc: '2.0',\n id,\n result: {\n protocolVersion: '2024-11-05',\n capabilities: { tools: {}, resources: {} },\n serverInfo: result?.agentInfo || { name: 'acp-agent', version: '1.0.0' }\n }\n };\n\n case 'session/new':\n acpSessionId = result?.sessionId;\n console.error(`[MCP-APC][proxy] ACP session: ${acpSessionId}`);\n\n if (pending.originalId && pending.promptText) {\n // Send queued prompt\n const promptReq = {\n jsonrpc: '2.0',\n id: pending.originalId,\n method: 'session/prompt',\n agentId: AGENT_ID,\n sessionId: proxySessionId,\n params: {\n sessionId: acpSessionId,\n prompt: [{ type: 'text', text: pending.promptText }]\n }\n };\n\n pendingRequests.set(pending.originalId, { method: 'session/prompt' });\n\n console.error(`[MCP-APC][proxy] \u2192 ACP: ${JSON.stringify(promptReq)}`);\n if (acpConnected) {\n acpSocket.write(JSON.stringify(promptReq) + '\\n');\n }\n }\n return null;\n\n case 'session/prompt':\n const text = accumulatedText.get(id) || '';\n accumulatedText.delete(id);\n console.error(`[MCP-APC][proxy] Returning accumulated text (${text.length} chars): \"${text.substring(0, 50)}...\"`);\n return {\n jsonrpc: '2.0',\n id,\n result: {\n content: [{ type: 'text', text: text || 'No response' }]\n }\n };\n\n default:\n console.error(`[MCP-APC][proxy] WARNING: Unhandled method ${pending.method}, returning raw result`);\n return { jsonrpc: '2.0', id, result: result || {} };\n }\n}\n\nfunction sendMCP(msg) {\n console.error(`[MCP-APC][proxy] \u2192 MCP: ${JSON.stringify(msg)}`);\n process.stdout.write(JSON.stringify(msg) + '\\n');\n}\n\nprocess.on('SIGTERM', () => {\n acpSocket.end();\n process.exit(0);\n});\n\nprocess.on('SIGINT', () => {\n acpSocket.end();\n process.exit(0);\n});\n"],
|
|
5
|
+
"mappings": ";AAgCA,OAAO,QAAS,MAChB,OAAS,oBAAuB,WAEhC,IAAM,SAAW,QAAQ,IAAI,UAAY,YACzC,IAAM,SAAW,QAAQ,IAAI,UAAY,IACzC,IAAM,SAAW,QAAQ,IAAI,UAAY,gBAEzC,QAAQ,MAAM,oCAAoC,EAClD,QAAQ,MAAM,4BAA4B,QAAQ,IAAI,QAAQ,EAAE,EAChE,QAAQ,MAAM,8BAA8B,QAAQ,EAAE,EAGtD,IAAM,UAAY,IAAI,QAAQ,SAAU,QAAQ,EAChD,IAAI,aAAe,MACnB,IAAI,eAAiB,KACrB,IAAI,aAAe,KACnB,IAAI,gBAAkB,IAAI,IAC1B,IAAI,gBAAkB,IAAI,IAE1B,UAAU,GAAG,UAAW,IAAM,CAC5B,QAAQ,MAAM,6CAA6C,EAC3D,aAAe,IACjB,CAAC,EAED,UAAU,GAAG,QAAU,KAAQ,CAC7B,QAAQ,MAAM,0CAA0C,IAAI,OAAO,EAAE,EACrE,QAAQ,KAAK,CAAC,CAChB,CAAC,EAGD,IAAI,UAAY,GAChB,UAAU,GAAG,OAAS,MAAS,CAC7B,WAAa,KAAK,SAAS,EAE3B,IAAI,aACJ,OAAQ,aAAe,UAAU,QAAQ,IAAI,KAAO,GAAI,CACtD,MAAM,KAAO,UAAU,MAAM,EAAG,YAAY,EAC5C,UAAY,UAAU,MAAM,aAAe,CAAC,EAE5C,GAAI,KAAK,K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AAK,MAAM,aAAa,KAAK,UAAU,EAAG,EAAE,CAAC,MAAM,EACjH,MAAO,CACL,QAAS,MACT,GACA,OAAQ,CACN,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAM,MAAQ,aAAc,CAAC,CACzD,CACF,EAEF,QACE,QAAQ,MAAM,8CAA8C,QAAQ,MAAM,wBAAwB,EAClG,MAAO,CAAE,QAAS,MAAO,GAAI,OAAQ,QAAU,CAAC,CAAE,CACtD,CACF,CAEA,SAAS,QAAQ,IAAK,CACpB,QAAQ,MAAM,gCAA2B,KAAK,UAAU,GAAG,CAAC,EAAE,EAC9D,QAAQ,OAAO,MAAM,KAAK,UAAU,GAAG,EAAI,IAAI,CACjD,CAEA,QAAQ,GAAG,UAAW,IAAM,CAC1B,UAAU,IAAI,EACd,QAAQ,KAAK,CAAC,CAChB,CAAC,EAED,QAAQ,GAAG,SAAU,IAAM,CACzB,UAAU,IAAI,EACd,QAAQ,KAAK,CAAC,CAChB,CAAC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdiobus/workers-registry",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "Worker implementations for stdio Bus kernel - ACP, MCP, and protocol bridges",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./out/dist/workers-registry/acp-
|
|
7
|
-
"types": "./out/tsc/workers-registry/
|
|
6
|
+
"main": "./out/dist/workers-registry/acp-registry/index.js",
|
|
7
|
+
"types": "./out/tsc/workers-registry/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./out/dist/workers-registry/acp-worker/index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"bugs": {
|
|
85
85
|
"url": "https://github.com/stdiobus/workers-registry/issues"
|
|
86
86
|
},
|
|
87
|
-
"homepage": "https://
|
|
87
|
+
"homepage": "https://stdiobus.com/",
|
|
88
88
|
"license": "Apache-2.0",
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=20.0.0"
|