@stdiobus/workers-registry 1.3.15 → 1.3.16
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 +16 -16
- package/index.js +3 -3
- package/{launcher → launch}/index.js.map +1 -1
- package/out/dist/workers/acp-registry/registry-launcher-config.json +2 -2
- package/out/dist/workers/index.d.ts +1 -1
- package/out/dist/workers/index.js +3 -3
- package/out/tsc/workers-registry/index.d.ts +1 -1
- package/package.json +5 -5
- package/launcher/index.cjs +0 -4
- package/launcher/index.cjs.map +0 -7
- /package/{launcher → launch}/index.js +0 -0
- /package/out/tsc/workers-registry/{launcher → launch}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -143,7 +143,7 @@ See [stdio Bus kernel repository](https://github.com/stdiobus/stdiobus) for buil
|
|
|
143
143
|
"id": "acp-worker",
|
|
144
144
|
"command": "node",
|
|
145
145
|
"args": [
|
|
146
|
-
"./workers/
|
|
146
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
147
147
|
"acp-worker"
|
|
148
148
|
],
|
|
149
149
|
"instances": 1
|
|
@@ -204,7 +204,7 @@ node ./node_modules/@stdiobus/workers-registry/out/dist/index.js echo-worker
|
|
|
204
204
|
"id": "acp-worker",
|
|
205
205
|
"command": "node",
|
|
206
206
|
"args": [
|
|
207
|
-
"./workers/
|
|
207
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
208
208
|
"acp-worker"
|
|
209
209
|
],
|
|
210
210
|
"instances": 1
|
|
@@ -220,7 +220,7 @@ node ./node_modules/@stdiobus/workers-registry/out/dist/index.js echo-worker
|
|
|
220
220
|
"id": "registry-launcher",
|
|
221
221
|
"command": "node",
|
|
222
222
|
"args": [
|
|
223
|
-
"./workers/
|
|
223
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
224
224
|
"registry-launcher",
|
|
225
225
|
"./api-keys.json"
|
|
226
226
|
],
|
|
@@ -238,7 +238,7 @@ node ./node_modules/@stdiobus/workers-registry/out/dist/index.js echo-worker
|
|
|
238
238
|
"id": "acp-worker",
|
|
239
239
|
"command": "node",
|
|
240
240
|
"args": [
|
|
241
|
-
"./workers/
|
|
241
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
242
242
|
"acp-worker"
|
|
243
243
|
],
|
|
244
244
|
"instances": 2
|
|
@@ -247,7 +247,7 @@ node ./node_modules/@stdiobus/workers-registry/out/dist/index.js echo-worker
|
|
|
247
247
|
"id": "echo-worker",
|
|
248
248
|
"command": "node",
|
|
249
249
|
"args": [
|
|
250
|
-
"./workers/
|
|
250
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
251
251
|
"echo-worker"
|
|
252
252
|
],
|
|
253
253
|
"instances": 1
|
|
@@ -305,7 +305,7 @@ Using Docker:
|
|
|
305
305
|
docker run \
|
|
306
306
|
--name stdiobus-acp \
|
|
307
307
|
-p 9000:9000 \
|
|
308
|
-
-v $(pwd)
|
|
308
|
+
-v $(pwd):/stdiobus:ro \
|
|
309
309
|
-v $(pwd)/workers-registry/acp-worker/acp-worker-config.json:/config.json:ro \
|
|
310
310
|
stdiobus/stdiobus:latest \
|
|
311
311
|
--config /config.json --tcp 0.0.0.0:9000
|
|
@@ -347,7 +347,7 @@ Routes messages to any agent in the [ACP Registry](https://cdn.agentclientprotoc
|
|
|
347
347
|
"id": "registry-launcher",
|
|
348
348
|
"command": "node",
|
|
349
349
|
"args": [
|
|
350
|
-
"./workers/
|
|
350
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
351
351
|
"registry-launcher",
|
|
352
352
|
"./api-keys.json"
|
|
353
353
|
],
|
|
@@ -364,7 +364,7 @@ Using Docker:
|
|
|
364
364
|
docker run \
|
|
365
365
|
--name stdiobus-registry \
|
|
366
366
|
-p 9000:9000 \
|
|
367
|
-
-v $(pwd)
|
|
367
|
+
-v $(pwd):/stdiobus:ro \
|
|
368
368
|
-v $(pwd)/workers-registry/acp-registry/registry-launcher-config.json:/config.json:ro \
|
|
369
369
|
-v $(pwd)/api-keys.json:/api-keys.json:ro \
|
|
370
370
|
stdiobus/stdiobus:latest \
|
|
@@ -396,7 +396,7 @@ IDE (MCP Client) → MCP-to-ACP Proxy → stdio Bus → Registry Launcher → AC
|
|
|
396
396
|
"stdio-bus-acp": {
|
|
397
397
|
"command": "node",
|
|
398
398
|
"args": [
|
|
399
|
-
"./workers/
|
|
399
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
400
400
|
"mcp-to-acp-proxy"
|
|
401
401
|
],
|
|
402
402
|
"env": {
|
|
@@ -436,7 +436,7 @@ Using Docker:
|
|
|
436
436
|
docker run \
|
|
437
437
|
--name stdiobus-echo \
|
|
438
438
|
-p 9000:9000 \
|
|
439
|
-
-v $(pwd)
|
|
439
|
+
-v $(pwd):/stdiobus:ro \
|
|
440
440
|
-v $(pwd)/workers-registry/echo-worker/echo-worker-config.json:/config.json:ro \
|
|
441
441
|
stdiobus/stdiobus:latest \
|
|
442
442
|
--config /config.json --tcp 0.0.0.0:9000
|
|
@@ -545,7 +545,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
545
545
|
"id": "acp-worker",
|
|
546
546
|
"command": "node",
|
|
547
547
|
"args": [
|
|
548
|
-
"./workers/
|
|
548
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
549
549
|
"acp-worker"
|
|
550
550
|
],
|
|
551
551
|
"instances": 4
|
|
@@ -567,7 +567,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
567
567
|
"id": "acp-worker",
|
|
568
568
|
"command": "node",
|
|
569
569
|
"args": [
|
|
570
|
-
"./workers/
|
|
570
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
571
571
|
"acp-worker"
|
|
572
572
|
],
|
|
573
573
|
"instances": 2
|
|
@@ -576,7 +576,7 @@ stdio Bus kernel is configured via JSON files. This repository includes example
|
|
|
576
576
|
"id": "echo-worker",
|
|
577
577
|
"command": "node",
|
|
578
578
|
"args": [
|
|
579
|
-
"./workers/
|
|
579
|
+
"./stdiobus/node_modules/@stdiobus/workers-registry/launch",
|
|
580
580
|
"echo-worker"
|
|
581
581
|
],
|
|
582
582
|
"instances": 1
|
|
@@ -658,7 +658,7 @@ npm run test:property
|
|
|
658
658
|
docker run \
|
|
659
659
|
--name stdiobus-test \
|
|
660
660
|
-p 9000:9000 \
|
|
661
|
-
-v $(pwd)
|
|
661
|
+
-v $(pwd):/stdiobus:ro \
|
|
662
662
|
-v $(pwd)/workers-registry/echo-worker/echo-worker-config.json:/config.json:ro \
|
|
663
663
|
stdiobus/stdiobus:latest \
|
|
664
664
|
--config /config.json --tcp 0.0.0.0:9000
|
|
@@ -676,7 +676,7 @@ docker stop stdiobus-test && docker rm stdiobus-test
|
|
|
676
676
|
docker run \
|
|
677
677
|
--name stdiobus-acp-test \
|
|
678
678
|
-p 9000:9000 \
|
|
679
|
-
-v $(pwd)
|
|
679
|
+
-v $(pwd):/stdiobus:ro \
|
|
680
680
|
-v $(pwd)/workers-registry/acp-worker/acp-worker-config.json:/config.json:ro \
|
|
681
681
|
stdiobus/stdiobus:latest \
|
|
682
682
|
--config /config.json --tcp 0.0.0.0:9000
|
|
@@ -694,7 +694,7 @@ docker stop stdiobus-acp-test && docker rm stdiobus-acp-test
|
|
|
694
694
|
docker run \
|
|
695
695
|
--name stdiobus-registry-test \
|
|
696
696
|
-p 9000:9000 \
|
|
697
|
-
-v $(pwd)
|
|
697
|
+
-v $(pwd):/stdiobus:ro \
|
|
698
698
|
-v $(pwd)/workers-registry/acp-registry/registry-launcher-config.json:/config.json:ro \
|
|
699
699
|
-v $(pwd)/api-keys.json:/api-keys.json:ro \
|
|
700
700
|
stdiobus/stdiobus:latest \
|
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
* Universal Worker Launcher
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
5
|
* Usage:
|
|
6
6
|
* stdiobus-worker <worker-name>
|
|
7
7
|
* node index.js <worker-name>
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Examples:
|
|
10
10
|
* stdiobus-worker launcher
|
|
11
11
|
* stdiobus-worker acp-worker
|
|
@@ -28,7 +28,7 @@ if (!workerName) {
|
|
|
28
28
|
|
|
29
29
|
// Map worker names to their entry points
|
|
30
30
|
const workers = {
|
|
31
|
-
'
|
|
31
|
+
'launch': './out/dist/workers/launch/index.js',
|
|
32
32
|
'acp-worker': './out/dist/workers/acp-worker/index.js',
|
|
33
33
|
'echo-worker': './out/dist/workers/echo-worker/echo-worker.js',
|
|
34
34
|
'mcp-echo-server': './out/dist/workers/mcp-echo-server/index.js',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../workers-registry/
|
|
3
|
+
"sources": ["../workers-registry/launch/index.ts"],
|
|
4
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 * node index.js <worker-name>\n * node index.js acp-worker\n * node index.js echo-worker\n * node index.js 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/acp-worker/index.js',\n description: 'Full ACP protocol implementation with MCP integration'\n },\n 'acp-registry': {\n path: '../out/dist/workers/acp-registry/registry-launcher-client.js',\n description: 'Registry Launcher for ACP Registry agents'\n },\n 'echo-worker': {\n path: '../out/dist/workers/echo-worker/echo-worker.js',\n description: 'Simple echo worker for testing NDJSON protocol'\n },\n 'mcp-echo-server': {\n path: '../out/dist/workers/mcp-echo-server/index.js',\n description: 'MCP server example for testing'\n },\n 'mcp-to-acp-proxy': {\n path: '../out/dist/workers/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: node index.js <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(' node index.js acp-worker');\n console.error(' node index.js echo-worker');\n console.error(' node index.js 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
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,0CACN,YAAa,uDACf,EACA,eAAgB,CACd,KAAM,+DACN,YAAa,2CACf,EACA,cAAe,CACb,KAAM,iDACN,YAAa,gDACf,EACA,kBAAmB,CACjB,KAAM,+CACN,YAAa,gCACf,EACA,mBAAoB,CAClB,KAAM,gDACN,YAAa,4BACf,CACF,EAUA,SAAS,WAAkB,CACzB,QAAQ,MAAM,oCAAoC,E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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 +7,7 @@
|
|
|
7
7
|
"id": "registry-launcher",
|
|
8
8
|
"command": "node",
|
|
9
9
|
"args": [
|
|
10
|
-
"/workers-registry/
|
|
10
|
+
"/workers-registry/launch/index.js",
|
|
11
11
|
"acp-registry"
|
|
12
12
|
],
|
|
13
13
|
"instances": 1
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
"_comment_backpressure_timeout_sec": "Timeout for backpressure before dropping messages",
|
|
28
28
|
"backpressure_timeout_sec": 60
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -18,9 +18,9 @@ export const workers = {
|
|
|
18
18
|
"config": "./echo-worker/echo-worker-config.json",
|
|
19
19
|
"type": "javascript"
|
|
20
20
|
},
|
|
21
|
-
"
|
|
22
|
-
"entrypoint": "./
|
|
23
|
-
"types": "../tsc/workers-registry/
|
|
21
|
+
"launch": {
|
|
22
|
+
"entrypoint": "./launch/index.js",
|
|
23
|
+
"types": "../tsc/workers-registry/launch/index.d.ts",
|
|
24
24
|
"config": null,
|
|
25
25
|
"type": "typescript"
|
|
26
26
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdiobus/workers-registry",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"description": "Worker implementations for stdio Bus kernel - ACP, MCP, and protocol bridges",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./out/dist/workers/acp-worker/index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"import": "./out/dist/workers/acp-worker/index.js",
|
|
11
11
|
"types": "./out/tsc/workers-registry/acp-worker/src/index.d.ts"
|
|
12
12
|
},
|
|
13
|
-
"./
|
|
14
|
-
"import": "./
|
|
15
|
-
"types": "./out/tsc/workers-registry/
|
|
13
|
+
"./launch": {
|
|
14
|
+
"import": "./launch/index.js",
|
|
15
|
+
"types": "./out/tsc/workers-registry/launch/index.d.ts"
|
|
16
16
|
},
|
|
17
17
|
"./workers/acp-worker": {
|
|
18
18
|
"import": "./out/dist/workers/acp-worker/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
54
|
"out/",
|
|
55
|
-
"
|
|
55
|
+
"launch/",
|
|
56
56
|
"index.js",
|
|
57
57
|
"README.md",
|
|
58
58
|
"LICENSE"
|
package/launcher/index.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";var import_url=require("url");var import_path=require("path");var import_promises=require("fs/promises");var import_meta={};var __filename=(0,import_url.fileURLToPath)(import_meta.url);var __dirname=(0,import_path.dirname)(__filename);var WORKERS={"acp-worker":{path:"../out/dist/workers/acp-worker/index.js",description:"Full ACP protocol implementation with MCP integration"},"acp-registry":{path:"../out/dist/workers/acp-registry/registry-launcher-client.js",description:"Registry Launcher for ACP Registry agents"},"echo-worker":{path:"../out/dist/workers/echo-worker/echo-worker.js",description:"Simple echo worker for testing NDJSON protocol"},"mcp-echo-server":{path:"../out/dist/workers/mcp-echo-server/index.js",description:"MCP server example for testing"},"mcp-to-acp-proxy":{path:"../out/dist/workers/mcp-to-acp-proxy/proxy.js",description:"MCP-to-ACP protocol bridge"}};function showUsage(){console.error("Usage: node index.js <worker-name>");console.error("");console.error("Available workers:");for(const[name,config]of Object.entries(WORKERS)){console.error(` - ${name.padEnd(20)} ${config.description}`)}console.error("");console.error("Examples:");console.error(" node index.js acp-worker");console.error(" node index.js echo-worker");console.error(" node index.js mcp-echo-server")}function isValidWorkerName(name){return name in 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
|
-
`);showUsage();process.exit(1)}const workerConfig=WORKERS[workerName];const workerPath=workerConfig.path;const absolutePath=(0,import_path.join)(__dirname,workerPath);try{await(0,import_promises.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)});
|
|
4
|
-
//# sourceMappingURL=index.cjs.map
|
package/launcher/index.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../workers-registry/launcher/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 * node index.js <worker-name>\n * node index.js acp-worker\n * node index.js echo-worker\n * node index.js 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 WORKERS: Readonly<Record<string, WorkerConfig>> = {\n 'acp-worker': {\n path: '../out/dist/workers/acp-worker/index.js',\n description: 'Full ACP protocol implementation with MCP integration'\n },\n 'acp-registry': {\n path: '../out/dist/workers/acp-registry/registry-launcher-client.js',\n description: 'Registry Launcher for ACP Registry agents'\n },\n 'echo-worker': {\n path: '../out/dist/workers/echo-worker/echo-worker.js',\n description: 'Simple echo worker for testing NDJSON protocol'\n },\n 'mcp-echo-server': {\n path: '../out/dist/workers/mcp-echo-server/index.js',\n description: 'MCP server example for testing'\n },\n 'mcp-to-acp-proxy': {\n path: '../out/dist/workers/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 WORKERS;\n\n/**\n * Display usage information\n */\nfunction showUsage(): void {\n console.error('Usage: node index.js <worker-name>');\n console.error('');\n console.error('Available workers:');\n\n for (const [name, config] of Object.entries(WORKERS)) {\n console.error(` - ${name.padEnd(20)} ${config.description}`);\n }\n\n console.error('');\n console.error('Examples:');\n console.error(' node index.js acp-worker');\n console.error(' node index.js echo-worker');\n console.error(' node index.js mcp-echo-server');\n}\n\n/**\n * Validate worker name\n */\nfunction isValidWorkerName(name: string): name is WorkerName {\n return name in 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 = 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"],
|
|
5
|
-
"mappings": ";aAqCA,eAA8B,eAC9B,gBAA8B,gBAC9B,oBAAyB,uBAvCzB,mBAyCA,IAAM,cAAa,0BAAc,YAAY,GAAG,EAChD,IAAM,aAAY,qBAAQ,UAAU,EAapC,IAAM,QAAkD,CACtD,aAAc,CACZ,KAAM,0CACN,YAAa,uDACf,EACA,eAAgB,CACd,KAAM,+DACN,YAAa,2CACf,EACA,cAAe,CACb,KAAM,iDACN,YAAa,gDACf,EACA,kBAAmB,CACjB,KAAM,+CACN,YAAa,gCACf,EACA,mBAAoB,CAClB,KAAM,gDACN,YAAa,4BACf,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