@stdiobus/workers-registry 1.4.14 → 1.5.0-beta.2

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.
Files changed (129) hide show
  1. package/README.md +181 -21
  2. package/out/dist/workers-registry/acp-registry/index.js +128 -2
  3. package/out/dist/workers-registry/acp-registry/index.js.map +4 -4
  4. package/out/dist/workers-registry/acp-worker/index.js +1 -3
  5. package/out/dist/workers-registry/acp-worker/index.js.map +4 -4
  6. package/out/dist/workers-registry/index.d.ts +1 -0
  7. package/out/dist/workers-registry/index.js +6 -0
  8. package/out/dist/workers-registry/openai-agent/index.js +1 -1
  9. package/out/dist/workers-registry/openai-agent/index.js.map +2 -2
  10. package/out/dist/workers-registry/registry-launcher/index.js +131 -0
  11. package/out/dist/workers-registry/registry-launcher/index.js.map +7 -0
  12. package/out/tsc/workers-registry/acp-worker/src/index.d.ts +0 -10
  13. package/out/tsc/workers-registry/registry-launcher/src/auth/auth-manager.d.ts +392 -0
  14. package/out/tsc/workers-registry/registry-launcher/src/auth/cli/cli.property.test.d.ts +22 -0
  15. package/out/tsc/workers-registry/registry-launcher/src/auth/cli/index.d.ts +9 -0
  16. package/out/tsc/workers-registry/registry-launcher/src/auth/cli/login-command.d.ts +32 -0
  17. package/out/tsc/workers-registry/registry-launcher/src/auth/cli/logout-command.d.ts +25 -0
  18. package/out/tsc/workers-registry/registry-launcher/src/auth/cli/setup-command.d.ts +25 -0
  19. package/out/tsc/workers-registry/registry-launcher/src/auth/cli/status-command.d.ts +21 -0
  20. package/out/tsc/workers-registry/registry-launcher/src/auth/errors.d.ts +190 -0
  21. package/out/tsc/workers-registry/registry-launcher/src/auth/flows/agent-auth-flow.d.ts +146 -0
  22. package/out/tsc/workers-registry/registry-launcher/src/auth/flows/callback-server.d.ts +131 -0
  23. package/out/tsc/workers-registry/registry-launcher/src/auth/flows/callback-server.test.d.ts +1 -0
  24. package/out/tsc/workers-registry/registry-launcher/src/auth/flows/index.d.ts +11 -0
  25. package/out/tsc/workers-registry/registry-launcher/src/auth/flows/terminal-auth-flow.d.ts +252 -0
  26. package/out/tsc/workers-registry/registry-launcher/src/auth/flows/terminal-auth-flow.test.d.ts +1 -0
  27. package/out/tsc/workers-registry/registry-launcher/src/auth/index.d.ts +33 -0
  28. package/out/tsc/workers-registry/registry-launcher/src/auth/integration.test.d.ts +1 -0
  29. package/out/tsc/workers-registry/registry-launcher/src/auth/model-credentials/anthropic-api-key.d.ts +154 -0
  30. package/out/tsc/workers-registry/registry-launcher/src/auth/model-credentials/index.d.ts +20 -0
  31. package/out/tsc/workers-registry/registry-launcher/src/auth/model-credentials/model-credentials.test.d.ts +1 -0
  32. package/out/tsc/workers-registry/registry-launcher/src/auth/model-credentials/openai-api-key.d.ts +182 -0
  33. package/out/tsc/workers-registry/registry-launcher/src/auth/model-credentials/types.d.ts +186 -0
  34. package/out/tsc/workers-registry/registry-launcher/src/auth/pkce.d.ts +61 -0
  35. package/out/tsc/workers-registry/registry-launcher/src/auth/pkce.property.test.d.ts +1 -0
  36. package/out/tsc/workers-registry/registry-launcher/src/auth/pkce.test.d.ts +1 -0
  37. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/base-provider.d.ts +138 -0
  38. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/base-provider.test.d.ts +1 -0
  39. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/cognito-provider.d.ts +44 -0
  40. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/concrete-providers.test.d.ts +1 -0
  41. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/entra-provider.d.ts +54 -0
  42. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/github-provider.d.ts +19 -0
  43. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/google-provider.d.ts +19 -0
  44. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/index.d.ts +107 -0
  45. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/index.test.d.ts +1 -0
  46. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/oidc-provider.d.ts +413 -0
  47. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/oidc-provider.property.test.d.ts +1 -0
  48. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/oidc-provider.test.d.ts +1 -0
  49. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/providers.property.test.d.ts +1 -0
  50. package/out/tsc/workers-registry/registry-launcher/src/auth/providers/types.d.ts +28 -0
  51. package/out/tsc/workers-registry/registry-launcher/src/auth/session.d.ts +251 -0
  52. package/out/tsc/workers-registry/registry-launcher/src/auth/session.property.test.d.ts +1 -0
  53. package/out/tsc/workers-registry/registry-launcher/src/auth/session.test.d.ts +1 -0
  54. package/out/tsc/workers-registry/registry-launcher/src/auth/state.d.ts +26 -0
  55. package/out/tsc/workers-registry/registry-launcher/src/auth/state.property.test.d.ts +1 -0
  56. package/out/tsc/workers-registry/registry-launcher/src/auth/state.test.d.ts +1 -0
  57. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/credential-store.d.ts +98 -0
  58. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/credential-store.test.d.ts +1 -0
  59. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/encrypted-file-backend.d.ts +101 -0
  60. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/encrypted-file-backend.test.d.ts +1 -0
  61. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/index.d.ts +12 -0
  62. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/keychain-backend.d.ts +80 -0
  63. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/keychain-backend.test.d.ts +1 -0
  64. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/memory-backend.d.ts +54 -0
  65. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/storage.property.test.d.ts +1 -0
  66. package/out/tsc/workers-registry/registry-launcher/src/auth/storage/types.d.ts +44 -0
  67. package/out/tsc/workers-registry/registry-launcher/src/auth/token-manager.d.ts +171 -0
  68. package/out/tsc/workers-registry/registry-launcher/src/auth/token-manager.property.test.d.ts +1 -0
  69. package/out/tsc/workers-registry/registry-launcher/src/auth/token-manager.test.d.ts +1 -0
  70. package/out/tsc/workers-registry/registry-launcher/src/auth/types.d.ts +369 -0
  71. package/out/tsc/workers-registry/registry-launcher/src/auth/types.test.d.ts +1 -0
  72. package/out/tsc/workers-registry/registry-launcher/src/config/config.property.test.d.ts +1 -0
  73. package/out/tsc/workers-registry/registry-launcher/src/config/config.test.d.ts +1 -0
  74. package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/registry/index.d.ts +51 -2
  75. package/out/tsc/workers-registry/registry-launcher/src/registry/index.property.test.d.ts +1 -0
  76. package/out/tsc/workers-registry/registry-launcher/src/registry/index.test.d.ts +1 -0
  77. package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/registry/types.d.ts +24 -0
  78. package/out/tsc/workers-registry/registry-launcher/src/router/message-router.d.ts +770 -0
  79. package/out/tsc/workers-registry/registry-launcher/src/router/message-router.property.test.d.ts +1 -0
  80. package/out/tsc/workers-registry/registry-launcher/src/router/message-router.test.d.ts +1 -0
  81. package/out/tsc/workers-registry/registry-launcher/src/runtime/manager.property.test.d.ts +1 -0
  82. package/out/tsc/workers-registry/registry-launcher/src/runtime/manager.test.d.ts +1 -0
  83. package/out/tsc/workers-registry/registry-launcher/src/stream/ndjson-handler.property.test.d.ts +1 -0
  84. package/out/tsc/workers-registry/registry-launcher/src/stream/ndjson-handler.test.d.ts +1 -0
  85. package/out/tsc/workers-registry/registry-launcher/tests/e2e/auth-flow.e2e.test.d.ts +1 -0
  86. package/out/tsc/workers-registry/registry-launcher/tests/e2e/auth-required-flow.e2e.test.d.ts +1 -0
  87. package/out/tsc/workers-registry/registry-launcher/tests/e2e/helpers/api-keys.d.ts +32 -0
  88. package/out/tsc/workers-registry/registry-launcher/tests/e2e/helpers/index.d.ts +17 -0
  89. package/out/tsc/workers-registry/registry-launcher/tests/e2e/helpers/launcher-harness.d.ts +101 -0
  90. package/out/tsc/workers-registry/registry-launcher/tests/e2e/helpers/registry-server.d.ts +46 -0
  91. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-agent-auth.e2e.test.d.ts +1 -0
  92. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-api-keys.e2e.test.d.ts +1 -0
  93. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-auth-required.e2e.test.d.ts +1 -0
  94. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-cli.e2e.test.d.ts +1 -0
  95. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-concurrent.e2e.test.d.ts +1 -0
  96. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-lifecycle.e2e.test.d.ts +1 -0
  97. package/out/tsc/workers-registry/registry-launcher/tests/e2e/production-terminal-auth.e2e.test.d.ts +1 -0
  98. package/out/tsc/workers-registry/registry-launcher/tests/integration/agent-auth.integration.test.d.ts +9 -0
  99. package/out/tsc/workers-registry/registry-launcher/tests/integration/registry-launcher.test.d.ts +1 -0
  100. package/out/tsc/workers-registry/registry-launcher/tests/integration/terminal-auth.integration.test.d.ts +12 -0
  101. package/package.json +16 -11
  102. package/out/tsc/workers-registry/acp-worker/src/registry-launcher/router/message-router.d.ts +0 -199
  103. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/config/config.property.test.d.ts → registry-launcher/src/auth/auth-manager.property.test.d.ts} +0 -0
  104. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/config/config.test.d.ts → registry-launcher/src/auth/auth-manager.test.d.ts} +0 -0
  105. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/registry/index.property.test.d.ts → registry-launcher/src/auth/cli/cli.test.d.ts} +0 -0
  106. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/registry/index.test.d.ts → registry-launcher/src/auth/cli/login-command.test.d.ts} +0 -0
  107. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/router/message-router.property.test.d.ts → registry-launcher/src/auth/cli/provider-config.test.d.ts} +0 -0
  108. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/router/message-router.test.d.ts → registry-launcher/src/auth/cli/setup-command.test.d.ts} +0 -0
  109. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/runtime/manager.property.test.d.ts → registry-launcher/src/auth/cli/status-command.test.d.ts} +0 -0
  110. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/runtime/manager.test.d.ts → registry-launcher/src/auth/errors.property.test.d.ts} +0 -0
  111. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/stream/ndjson-handler.property.test.d.ts → registry-launcher/src/auth/errors.test.d.ts} +0 -0
  112. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher/stream/ndjson-handler.test.d.ts → registry-launcher/src/auth/flows/agent-auth-flow.test.d.ts} +0 -0
  113. /package/out/tsc/workers-registry/{acp-worker/tests/integration/registry-launcher.test.d.ts → registry-launcher/src/auth/flows/callback-server.property.test.d.ts} +0 -0
  114. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/config/api-keys.d.ts +0 -0
  115. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/config/config.d.ts +0 -0
  116. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/config/index.d.ts +0 -0
  117. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/config/types.d.ts +0 -0
  118. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/index.d.ts +0 -0
  119. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/log.d.ts +0 -0
  120. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/log.test.d.ts +0 -0
  121. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/registry/resolver.d.ts +0 -0
  122. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/router/index.d.ts +0 -0
  123. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/runtime/agent-runtime.d.ts +0 -0
  124. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/runtime/index.d.ts +0 -0
  125. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/runtime/manager.d.ts +0 -0
  126. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/runtime/types.d.ts +0 -0
  127. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/stream/index.d.ts +0 -0
  128. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/stream/ndjson-handler.d.ts +0 -0
  129. /package/out/tsc/workers-registry/{acp-worker/src/registry-launcher → registry-launcher/src}/test-utils/index.d.ts +0 -0
package/README.md CHANGED
@@ -21,9 +21,15 @@ Worker implementations for [stdio Bus kernel](https://github.com/stdiobus/stdiob
21
21
  npm install @stdiobus/workers-registry
22
22
  ```
23
23
 
24
+ For embedded usage (no Docker/binary needed):
25
+
26
+ ```bash
27
+ npm install @stdiobus/node @stdiobus/workers-registry
28
+ ```
29
+
24
30
  **Requirements:**
25
31
  - Node.js ≥20.0.0
26
- - [stdio Bus kernel](https://github.com/stdiobus/stdiobus) (Docker or binary)
32
+ - [stdio Bus kernel](https://github.com/stdiobus/stdiobus) (Docker or binary) — or [`@stdiobus/node`](https://www.npmjs.com/package/@stdiobus/node) for embedded mode
27
33
 
28
34
  **Keywords:** `stdiobus`, `protocol`, `acp`, `mcp`, `agent`, `transport`, `json-rpc`, `stdio-bus`, `worker`
29
35
 
@@ -61,22 +67,26 @@ graph TB
61
67
 
62
68
  ## Prerequisites
63
69
 
64
- - stdio Bus kernel - available via [Docker](https://hub.docker.com/r/stdiobus/stdiobus) or [build from source](https://github.com/stdiobus/stdiobus)
65
- - Node.js 20.0.0 or later (for building workers)
70
+ - Node.js 20.0.0 or later
71
+ - One of:
72
+ - [`@stdiobus/node`](https://www.npmjs.com/package/@stdiobus/node) — embedded mode, no external dependencies
73
+ - [stdio Bus kernel via Docker](https://hub.docker.com/r/stdiobus/stdiobus) — TCP/Unix socket mode
74
+ - [stdio Bus kernel binary](https://github.com/stdiobus/stdiobus) — build from source
66
75
 
67
76
  ## Workers
68
77
 
69
78
  | Worker | Description | Protocol | Command |
70
79
  |--------|-------------|----------|---------|
71
- | `acp-registry` | Registry Launcher worker that routes to ACP Registry agents (requires `api-keys.json`) | ACP | `node ./node_modules/@stdiobus/workers-registry/launch acp-registry` |
72
- | `acp-worker` | Full ACP protocol implementation (standalone agent; does **not** route to ACP Registry) | ACP | `node ./node_modules/@stdiobus/workers-registry/launch acp-worker` |
80
+ | `acp-registry` | Registry Launcher worker that routes to ACP Registry agents (requires `api-keys.json`) | ACP | `npx @stdiobus/workers-registry acp-registry` |
81
+ | `acp-worker` | Full ACP protocol implementation (standalone agent; does **not** route to ACP Registry) | ACP | `npx @stdiobus/workers-registry acp-worker` |
73
82
  | `registry-launcher` | Registry Launcher implementation module used by `acp-registry` (not a launch target) | ACP | Use `acp-registry` |
74
- | `mcp-to-acp-proxy` | Bridges MCP clients (like IDEs) to ACP agents | MCP → ACP | `node ./node_modules/@stdiobus/workers-registry/launch mcp-to-acp-proxy` |
75
- | `echo-worker` | Simple echo worker for testing NDJSON protocol | NDJSON | `node ./node_modules/@stdiobus/workers-registry/launch echo-worker` |
76
- | `mcp-echo-server` | MCP server example for testing | MCP | `node ./node_modules/@stdiobus/workers-registry/launch mcp-echo-server` |
83
+ | `openai-agent` | OpenAI Chat Completions API agent (bridges ACP to any OpenAI-compatible endpoint) | ACP | `npx @stdiobus/workers-registry openai-agent` |
84
+ | `mcp-to-acp-proxy` | Bridges MCP clients (like IDEs) to ACP agents | MCP → ACP | `npx @stdiobus/workers-registry mcp-to-acp-proxy` |
85
+ | `echo-worker` | Simple echo worker for testing NDJSON protocol | NDJSON | `npx @stdiobus/workers-registry echo-worker` |
86
+ | `mcp-echo-server` | MCP server example for testing | MCP | `npx @stdiobus/workers-registry mcp-echo-server` |
77
87
 
78
- **Note:** The universal launcher is `@stdiobus/workers-registry/launch`. In this repo, use
79
- `node ./launch/index.js <worker-name>` after `npm run build`.
88
+ **Note:** The universal launcher is `@stdiobus/workers-registry/launch`. For local
89
+ development in this repo, use `node ./launch/index.js <worker-name>` after `npm run build`.
80
90
 
81
91
  ## Package API
82
92
 
@@ -111,13 +121,75 @@ import type { MCPServer } from '@stdiobus/workers-registry/workers/mcp-echo-serv
111
121
 
112
122
  ## Quick Start
113
123
 
114
- ### 1. Install Package
124
+ ### Option A: Embedded via `@stdiobus/node` (simplest)
125
+
126
+ No Docker, no binary, no TCP — just npm packages. The bus runs inside your Node.js process.
127
+
128
+ ```bash
129
+ npm install @stdiobus/node @stdiobus/workers-registry
130
+ ```
131
+
132
+ Create `config.json`:
133
+
134
+ ```json
135
+ {
136
+ "pools": [
137
+ {
138
+ "id": "openai-agent",
139
+ "command": "npx",
140
+ "args": ["@stdiobus/workers-registry", "openai-agent"],
141
+ "instances": 1
142
+ }
143
+ ]
144
+ }
145
+ ```
146
+
147
+ Use it in code:
148
+
149
+ ```javascript
150
+ import { StdioBus } from '@stdiobus/node';
151
+
152
+ const bus = new StdioBus({ configPath: './config.json' });
153
+ await bus.start();
154
+
155
+ // Send ACP initialize request
156
+ const result = await bus.request('initialize', {
157
+ protocolVersion: 1,
158
+ clientInfo: { name: 'my-app', version: '1.0.0' },
159
+ });
160
+
161
+ console.log(result.agentInfo.name); // 'openai-agent'
162
+ console.log(result.authMethods); // [{ id: 'oauth2', ... }]
163
+
164
+ await bus.stop();
165
+ ```
166
+
167
+ Or run any other worker the same way — just change the pool config:
168
+
169
+ ```json
170
+ {
171
+ "pools": [
172
+ {
173
+ "id": "acp-registry",
174
+ "command": "npx",
175
+ "args": ["@stdiobus/workers-registry", "acp-registry"],
176
+ "instances": 1
177
+ }
178
+ ]
179
+ }
180
+ ```
181
+
182
+ See [`@stdiobus/node` on npm](https://www.npmjs.com/package/@stdiobus/node) for TCP mode, Unix socket mode, Docker backend, and full API reference.
183
+
184
+ ### Option B: Docker / Binary (TCP mode)
185
+
186
+ #### 1. Install Package
115
187
 
116
188
  ```bash
117
189
  npm install @stdiobus/workers-registry
118
190
  ```
119
191
 
120
- ### 2. Get stdio Bus kernel
192
+ #### 2. Get stdio Bus kernel
121
193
 
122
194
  **Option A: Using Docker (recommended)**
123
195
 
@@ -129,7 +201,7 @@ docker pull stdiobus/stdiobus:latest
129
201
 
130
202
  See [stdio Bus kernel repository](https://github.com/stdiobus/stdiobus) for build instructions.
131
203
 
132
- ### 3. Run with ACP Registry (recommended for real agents)
204
+ #### 3. Run with ACP Registry (recommended for real agents)
133
205
 
134
206
  **Create config.json:**
135
207
  ```json
@@ -155,7 +227,7 @@ or pass a custom config file (third arg to `launch acp-registry`) with an absolu
155
227
  Use the same Docker/binary commands below (they run `config.json`), and ensure
156
228
  `api-keys.json` is mounted into the container when using Docker.
157
229
 
158
- ### 4. Run with ACP Worker
230
+ #### 4. Run with ACP Worker
159
231
 
160
232
  **Note:** `acp-worker` is a standalone ACP agent for SDK/protocol testing. It does **not**
161
233
  route to the ACP Registry. Use `acp-registry` when you need real registry agents.
@@ -191,7 +263,7 @@ docker run -p 9000:9000 \
191
263
  ./stdio_bus --config config.json --tcp 0.0.0.0:9000
192
264
  ```
193
265
 
194
- ### 5. Test Connection
266
+ #### 5. Test Connection
195
267
 
196
268
  ```bash
197
269
  # ACP worker (standalone)
@@ -210,8 +282,8 @@ echo '{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"agentId":"claud
210
282
  The simplest way to run any worker:
211
283
 
212
284
  ```bash
213
- # Run any worker by name (package install)
214
- node ./node_modules/@stdiobus/workers-registry/launch <worker-name>
285
+ # Run any worker by name (recommended)
286
+ npx @stdiobus/workers-registry <worker-name>
215
287
 
216
288
  # Run any worker by name (this repo, after build)
217
289
  node ./launch/index.js <worker-name>
@@ -222,9 +294,10 @@ node ./launch/index.js <worker-name>
222
294
  # - echo-worker
223
295
  # - mcp-echo-server
224
296
  # - mcp-to-acp-proxy
297
+ # - openai-agent
225
298
 
226
299
  # Example: Run echo worker for testing
227
- node ./node_modules/@stdiobus/workers-registry/launch echo-worker
300
+ npx @stdiobus/workers-registry echo-worker
228
301
  ```
229
302
 
230
303
  ### Using in stdio Bus Configuration
@@ -814,14 +887,35 @@ rl.on('close', () => process.exit(0));
814
887
 
815
888
  ```
816
889
  workers-registry/
890
+ ├── index.ts # Package entry point
891
+ ├── launch/ # Universal launcher (npx entry point)
817
892
  ├── acp-worker/ # Full ACP protocol implementation
818
893
  │ ├── src/
819
894
  │ │ ├── agent.ts # ACP Agent implementation
820
895
  │ │ ├── index.ts # Main entry point
896
+ │ │ ├── acp/ # ACP protocol layer
821
897
  │ │ ├── mcp/ # MCP server integration
898
+ │ │ ├── mcp-proxy/ # MCP-to-ACP proxy logic
822
899
  │ │ ├── session/ # Session management
823
- │ │ └── registry-launcher/ # Registry Launcher implementation
900
+ │ │ ├── stdio/ # Session ID routing
901
+ │ │ └── test-utils/ # Testing utilities
824
902
  │ └── tests/ # Test suites
903
+ ├── registry-launcher/ # Registry Launcher (agent discovery + routing)
904
+ │ └── src/
905
+ │ ├── auth/ # OAuth 2.1 authentication
906
+ │ ├── config/ # Configuration management
907
+ │ ├── registry/ # ACP Registry resolution
908
+ │ ├── router/ # Message routing
909
+ │ ├── runtime/ # Agent runtime management
910
+ │ ├── stream/ # NDJSON stream handling
911
+ │ └── test-utils/ # Testing utilities
912
+ ├── openai-agent/ # OpenAI Chat Completions API agent
913
+ │ └── src/
914
+ │ ├── agent.ts # ACP Agent bridging to OpenAI API
915
+ │ ├── client.ts # Chat Completions HTTP + SSE client
916
+ │ ├── sse-parser.ts # SSE line parser
917
+ │ ├── session.ts # Session state management
918
+ │ └── config.ts # Environment-based configuration
825
919
  ├── acp-registry/ # ACP Registry worker entrypoint + configs
826
920
  ├── echo-worker/ # Simple echo worker example
827
921
  ├── mcp-echo-server/ # MCP server example
@@ -884,8 +978,8 @@ nvm install 20 # If using nvm
884
978
  **Permission errors:**
885
979
  ```bash
886
980
  npm install -g @stdiobus/workers-registry # Global install (may need sudo)
887
- # Or use a local install
888
- node ./node_modules/@stdiobus/workers-registry/launch acp-worker
981
+ # Or use npx
982
+ npx @stdiobus/workers-registry acp-worker
889
983
  ```
890
984
 
891
985
  ### Runtime Issues
@@ -950,9 +1044,75 @@ npm test
950
1044
 
951
1045
  ---
952
1046
 
1047
+ ## OAuth 2.1 Authentication
1048
+
1049
+ Registry Launcher supports OAuth 2.1 with PKCE for secure browser-based authentication with AI providers.
1050
+
1051
+ ### Supported Providers
1052
+
1053
+ | Provider | OAuth 2.1 | API Key | Status |
1054
+ |----------|-----------|---------|--------|
1055
+ | OpenAI | ✓ | ✓ | Production |
1056
+ | Anthropic | ✓ | ✓ | Production |
1057
+ | GitHub | ✓ | ✓ | Production |
1058
+ | Google | ✓ | ✓ | Production |
1059
+ | Azure AD | ✓ | ✓ | Production |
1060
+ | AWS Cognito | ✓ | ✓ | Production |
1061
+
1062
+ ### Quick Start
1063
+
1064
+ ```bash
1065
+ # Check current authentication status
1066
+ npx @stdiobus/workers-registry acp-registry --auth-status
1067
+
1068
+ # Login with browser OAuth (opens browser)
1069
+ npx @stdiobus/workers-registry acp-registry --login openai
1070
+
1071
+ # Interactive setup wizard
1072
+ npx @stdiobus/workers-registry acp-registry --setup
1073
+
1074
+ # Logout from all providers
1075
+ npx @stdiobus/workers-registry acp-registry --logout
1076
+ ```
1077
+
1078
+ ### Backward Compatibility
1079
+
1080
+ Existing `api-keys.json` configuration continues to work. OAuth credentials take precedence when available, with automatic fallback to API keys.
1081
+
1082
+ **Feature Flag:** `AUTH_AUTO_OAUTH`
1083
+ - `false` (default): Only use OAuth if explicitly logged in via `--login`
1084
+ - `true`: Auto-trigger browser OAuth when agent requires it
1085
+
1086
+ ### Headless/CI Environments
1087
+
1088
+ Browser OAuth is not available in headless environments (CI, SSH, Docker). Use one of these alternatives:
1089
+
1090
+ ```bash
1091
+ # Option 1: Use api-keys.json
1092
+ echo '{"claude-acp":{"apiKey":"sk-..."}}' > api-keys.json
1093
+
1094
+ # Option 2: Use environment variables
1095
+ export ANTHROPIC_API_KEY=sk-...
1096
+
1097
+ # Option 3: Interactive setup (if TTY available)
1098
+ npx @stdiobus/workers-registry acp-registry --setup
1099
+ ```
1100
+
1101
+ ### Documentation
1102
+
1103
+ - [User Guide](docs/oauth/user-guide.md) - How to use OAuth authentication
1104
+ - [CLI Reference](docs/oauth/cli-reference.md) - Complete CLI command reference
1105
+ - [Configuration](docs/oauth/configuration.md) - Environment variables and settings
1106
+ - [Security](docs/oauth/security.md) - Security considerations and best practices
1107
+ - [Technical Reference](docs/oauth/technical-reference.md) - Architecture and internals
1108
+ - [Troubleshooting](docs/oauth/troubleshooting.md) - Common issues and solutions
1109
+
1110
+ ---
1111
+
953
1112
  ## Resources
954
1113
 
955
1114
  - [stdio Bus kernel](https://github.com/stdiobus/stdiobus) - Core protocol and daemon (source code)
1115
+ - [`@stdiobus/node`](https://www.npmjs.com/package/@stdiobus/node) - Embedded Node.js binding (no Docker/binary needed)
956
1116
  - [stdio Bus on Docker Hub](https://hub.docker.com/r/stdiobus/stdiobus) - Docker images for easy deployment
957
1117
  - [stdio Bus Full Documentation](https://stdiobus.com) – Core protocol documentation
958
1118
  - [ACP Registry](https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json) - Available ACP agents