@orcha-ai/runtime-bridge 0.1.38 → 0.1.40
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 +51 -331
- package/bin/orcha-runtime-bridge.js +21 -18
- package/openclaw-plugin/index.js +5 -1
- package/openclaw-plugin/openclaw.plugin.json +68 -7
- package/openclaw-plugin/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,384 +1,104 @@
|
|
|
1
1
|
# Orcha Runtime Bridge
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
agent runtimes outside the Python API process.
|
|
3
|
+
Bridge connects a user's device and discovers Codex, Claude Code and configured OpenClaw agents. Cloud Node Runtime infrastructure is managed separately in `cloud-agent-runtime/` and the Runtime Nodes page.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
third-party ACP package: JSON-RPC framing, request ids, notifications,
|
|
8
|
-
runtime permission requests, and process lifecycle are implemented under
|
|
9
|
-
`src/acp/`.
|
|
5
|
+
## Connect a device
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
computer
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
runs the bundled Linux Bubblewrap broker probe. Every prompt/dispatch is bound
|
|
16
|
-
to a control-plane `runId` and frozen sandbox policy, and the actual Runtime
|
|
17
|
-
process is started by the broker inside an empty-root namespace. Missing
|
|
18
|
-
Bubblewrap, `prlimit`, Egress Proxy, trusted workspace, or a failed escape probe
|
|
19
|
-
keeps the node visible for diagnostics but unavailable for dispatch. It never
|
|
20
|
-
falls back to spawning Codex/OpenClaw/Claude directly on the host.
|
|
21
|
-
|
|
22
|
-
The broker does not mount `/usr/local` or other operator directories by
|
|
23
|
-
default. Install runtime CLIs under a dedicated immutable directory, list it in
|
|
24
|
-
`ORCHA_RUNTIME_TRUSTED_TOOLCHAIN_ROOTS`, and repeat it in each target's
|
|
25
|
-
`toolchainRoots`. This keeps the executable surface explicit and avoids
|
|
26
|
-
exposing unrelated host installations or credentials.
|
|
27
|
-
|
|
28
|
-
## Install
|
|
7
|
+
1. Open **智能体 → 添加智能体 → 从我的设备添加** in the current tenant.
|
|
8
|
+
2. Install or update the npm package on the computer with your agents installed. Node.js 22.19 or newer is required.
|
|
9
|
+
3. Copy and run the one-time connection command. Bridge starts in the background; the terminal can be closed.
|
|
10
|
+
4. Select discovered agents, confirm names and local directories, then add.
|
|
29
11
|
|
|
30
12
|
```bash
|
|
31
|
-
npm install -g @orcha-ai/runtime-bridge
|
|
13
|
+
npm install -g @orcha-ai/runtime-bridge@latest
|
|
14
|
+
orcha-runtime-bridge connect --url https://orcha.example.com --pair-code ONE_TIME_CODE
|
|
32
15
|
```
|
|
33
16
|
|
|
34
|
-
|
|
35
|
-
requires Linux with Bubblewrap, `prlimit`, `ip`, and `socat`. External Runtime
|
|
36
|
-
Nodes execute operator-configured agents directly on Linux, macOS, or Windows.
|
|
37
|
-
An OpenClaw Gateway must separately satisfy its host version's requirements.
|
|
38
|
-
|
|
39
|
-
Run it with:
|
|
17
|
+
The code expires after 10 minutes and is consumed once. The device belongs to the signed-in user and tenant. Imported agents are private by default and use existing sharing settings. Shared users still execute on the owner's device.
|
|
40
18
|
|
|
41
|
-
|
|
42
|
-
orcha-runtime-bridge
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
You can also run without a global install:
|
|
19
|
+
For subsequent connections, omit the consumed code:
|
|
46
20
|
|
|
47
21
|
```bash
|
|
48
|
-
|
|
22
|
+
orcha-runtime-bridge connect --url https://orcha.example.com
|
|
49
23
|
```
|
|
50
24
|
|
|
51
|
-
|
|
25
|
+
`connect` exchanges the one-time code in the foreground, then starts the existing daemon manager with the saved profile. The code and device credential are not passed to the background command. Reconnecting an already running device returns its existing process; stop it first before replacing its pairing.
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
CLI into `bin/orcha-runtime-bridge.js`, then prepares a clean release directory.
|
|
27
|
+
Manage the device from any terminal directory with the same server address:
|
|
55
28
|
|
|
56
29
|
```bash
|
|
57
|
-
|
|
58
|
-
|
|
30
|
+
orcha-runtime-bridge status --url https://orcha.example.com
|
|
31
|
+
orcha-runtime-bridge reload --url https://orcha.example.com
|
|
32
|
+
orcha-runtime-bridge stop --url https://orcha.example.com
|
|
33
|
+
orcha-runtime-bridge start --url https://orcha.example.com
|
|
59
34
|
```
|
|
60
35
|
|
|
61
|
-
|
|
62
|
-
npm tarball under `dist/`. The release package includes the minified `bin/`
|
|
63
|
-
runtime, the bundled `openclaw-plugin/`, `README.md`, and `.env.example`; it does not publish `src/`, build
|
|
64
|
-
scripts, test scripts, or the local `.env` file.
|
|
36
|
+
The server-specific PID and log files live beside the device profile under `~/.orcha/devices/`; `--pid-file` and `--log-file` override them. `status` reports the local process state; the Orcha page reports whether the device is online. Use `connect --foreground --url ...` for diagnosis after stopping its background process. Closing the terminal does not stop the daemon; shutting down the computer does. This command does not install an OS login/startup service. Legacy env-configured `start/status/reload/stop --env-file ...` keep their existing behavior.
|
|
65
37
|
|
|
66
|
-
|
|
38
|
+
The credential and local launch configuration live under `~/.orcha/devices/<server-hash>.json`, written atomically with mode 0600. A new pairing for the same server replaces that local profile. Disconnect the previous device in Orcha to revoke its credential. Discovery does not upload vendor credentials, command paths, environment maps or transcripts.
|
|
67
39
|
|
|
68
|
-
|
|
69
|
-
Deploy this release with the Orcha backend that accepts v2; that backend rejects
|
|
70
|
-
older Bridge clients using v1. The standalone execution protocol remains
|
|
71
|
-
`orcha.runtime-execution/v1`.
|
|
40
|
+
Remote deployments require HTTPS; HTTP is allowed only on loopback. Bridge opens an outbound WebSocket to `/api/agent-runtime-bridge/ws`. The device needs no inbound port. The reverse proxy must forward WebSocket upgrades to the Runtime Gateway.
|
|
72
41
|
|
|
73
|
-
|
|
74
|
-
images. After publishing, upgrade each external Runtime Node's installed package
|
|
75
|
-
and reload its Bridge process using the existing env file as described in
|
|
76
|
-
[Background Process](#background-process).
|
|
42
|
+
## Discovery and execution
|
|
77
43
|
|
|
78
|
-
|
|
79
|
-
prepared tarball from this directory:
|
|
44
|
+
Discovery checks executables in absolute PATH entries and runs fixed probes:
|
|
80
45
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
46
|
+
- Codex: `--version`, `login status`.
|
|
47
|
+
- Claude Code: `--version`, `auth status` (JSON is the default).
|
|
48
|
+
- OpenClaw: `--version`, `agents list --json`, `health --json`.
|
|
84
49
|
|
|
85
|
-
|
|
50
|
+
Missing installations are absent; failed probes are explicit errors. Login and Gateway setup happen locally. Discovery does not install applications, sign in, run a model prompt or scan the entire disk. Detection does not guarantee vendor quota or future model calls.
|
|
86
51
|
|
|
87
|
-
|
|
88
|
-
members, including credential refresh, operation reattachment, cancellation,
|
|
89
|
-
and session cleanup. The tarball includes the bundled OpenClaw Gateway plugin;
|
|
90
|
-
install and configure it as described in [Delegated group member tools](#delegated-group-member-tools).
|
|
91
|
-
Local adapter fixtures cover these integrations; a real OpenClaw Gateway has
|
|
92
|
-
not yet been verified.
|
|
52
|
+
Codex/Claude Code use a user-selected existing local directory. OpenClaw keeps its existing agent ID and directory; its private session key uses that ID, not Orcha's generated Agent code. Core cannot supply arbitrary launch commands. Every selection and directory is validated before one atomic profile update. Core serializes imports by locking the device credential to prevent duplicate Agents.
|
|
93
53
|
|
|
94
|
-
|
|
54
|
+
Codex device targets use `exec --skip-git-repo-check --json` so ordinary directories work as well as Git repositories. Existing device profiles created without this flag need their Codex target arguments updated locally and Bridge reloaded; updating the npm package alone does not rewrite saved profiles.
|
|
95
55
|
|
|
96
|
-
|
|
97
|
-
Each verification check requires a positive integer `requiredMatches` and
|
|
98
|
-
counts distinct successful tool call IDs. Results report `requiredMatches`,
|
|
99
|
-
`observedMatches`, and `toolCallIds` instead of the previous single `toolCallId`.
|
|
100
|
-
Callers and result consumers must use these fields when upgrading from 0.1.35.
|
|
56
|
+
Targets are namespaced by device code and candidate digest. Chat, group delegation, workflow dispatch and recovery are pinned to that device; an offline or revoked device never falls back to a different computer. External execution uses the local CLI's own permissions, not Orcha's cloud Docker Sandbox.
|
|
101
57
|
|
|
102
|
-
|
|
58
|
+
The automated discovery path is exercised on macOS/Linux. On Windows, use WSL with the CLIs installed there; native `.cmd`/`.bat` launchers are not supported by the shell-free process adapter.
|
|
103
59
|
|
|
104
|
-
|
|
105
|
-
cp .env.example .env
|
|
106
|
-
# Edit .env and fill ORCHA_RUNTIME_ORCHA_URL / ORCHA_RUNTIME_NODE_TOKEN / targets.
|
|
107
|
-
orcha-runtime-bridge
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Background Process
|
|
60
|
+
Official probe references: [Codex CLI](https://developers.openai.com/codex/cli/reference/), [Claude Code CLI](https://code.claude.com/docs/en/cli-reference), [OpenClaw agents](https://docs.openclaw.ai/cli/agents).
|
|
111
61
|
|
|
112
|
-
|
|
113
|
-
forever, or any third-party package.
|
|
62
|
+
## Protocol and cutover
|
|
114
63
|
|
|
115
|
-
|
|
116
|
-
# Start in the background.
|
|
117
|
-
orcha-runtime-bridge start --env-file /etc/orcha/runtime-node.env
|
|
64
|
+
The existing `orcha-runtime-node.v2` transport negotiates `devices/discover` and `devices/configure` alongside execution/session methods. Existing Node and ServiceToken records are reused. Core checks ownership, exact node/candidate identity, target namespace and the returned selections before creating Agents.
|
|
118
65
|
|
|
119
|
-
|
|
120
|
-
orcha-runtime-bridge status --env-file /etc/orcha/runtime-node.env
|
|
66
|
+
Legacy manual external-node registration is rejected. Platform service tokens create only cloud Node Runtime nodes. Arbitrary `runtimeTargetCode` is no longer an Agent creation path. The explicit cleanup procedure is in [智能体管理与构建](../docs/新文档/05-智能体/01-智能体管理与构建.md).
|
|
121
67
|
|
|
122
|
-
|
|
123
|
-
orcha-runtime-bridge reload --env-file /etc/orcha/runtime-node.env
|
|
124
|
-
|
|
125
|
-
# Stop.
|
|
126
|
-
orcha-runtime-bridge stop --env-file /etc/orcha/runtime-node.env
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
`start` writes the process id to `ORCHA_RUNTIME_PID_FILE` and redirects stdout
|
|
130
|
-
and stderr to `ORCHA_RUNTIME_LOG_FILE`. Both paths can be set in the env file or
|
|
131
|
-
overridden on the command line:
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
orcha-runtime-bridge start \
|
|
135
|
-
--env-file /etc/orcha/runtime-node.env \
|
|
136
|
-
--pid-file /var/run/orcha-runtime-bridge.pid \
|
|
137
|
-
--log-file /var/log/orcha-runtime-bridge.log
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Running `orcha-runtime-bridge` with no command still runs in the foreground,
|
|
141
|
-
which is the right mode for systemd, Docker, launchd, and supervised services.
|
|
142
|
-
|
|
143
|
-
The built-in daemon keeps Runtime Bridge logs for 3 days by default. It cleans
|
|
144
|
-
`ORCHA_RUNTIME_LOG_FILE` on start and then once per hour, using each JSON log
|
|
145
|
-
line's `ts` field. Non-JSON lines and lines without a parseable timestamp are
|
|
146
|
-
kept. Configure with:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
ORCHA_RUNTIME_LOG_RETENTION_DAYS=3
|
|
150
|
-
ORCHA_RUNTIME_LOG_CLEANUP_INTERVAL_MS=3600000
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
The bridge loads environment variables from `ORCHA_RUNTIME_ENV_FILE` when it is
|
|
154
|
-
set. Otherwise it reads `.env` from the current working directory. Real process
|
|
155
|
-
environment variables always win over values from the file.
|
|
156
|
-
|
|
157
|
-
Runtime Node mode reconnects to Orcha automatically. `ORCHA_RUNTIME_RECONNECT_MS`
|
|
158
|
-
controls the delay between attempts, and `ORCHA_RUNTIME_CONNECT_TIMEOUT_MS`
|
|
159
|
-
controls how long one WebSocket handshake may wait before the node closes it and
|
|
160
|
-
tries again.
|
|
161
|
-
|
|
162
|
-
The node connects to:
|
|
163
|
-
|
|
164
|
-
- `WS /api/agent-runtime-bridge/ws`
|
|
165
|
-
|
|
166
|
-
and receives Orcha RPC frames for:
|
|
167
|
-
|
|
168
|
-
- `agents/create`
|
|
169
|
-
- `agents/dispatch`
|
|
170
|
-
- `sessions/prompt`
|
|
171
|
-
- `sessions/policy`
|
|
172
|
-
- `sessions/cancel`
|
|
173
|
-
- `permissions/respond`
|
|
174
|
-
|
|
175
|
-
Runtime targets are configured with `ORCHA_RUNTIME_TARGETS_JSON`.
|
|
176
|
-
|
|
177
|
-
ACP runtimes complete a JSON-RPC `initialize` handshake before a session is
|
|
178
|
-
created. `ORCHA_RUNTIME_INITIALIZE_TIMEOUT_MS` controls that handshake only
|
|
179
|
-
(30 seconds by default); it is independent from the task/prompt timeout. A
|
|
180
|
-
target can override it with `"initializeTimeoutMs"`. Target processes use
|
|
181
|
-
`cwd`, then `workspace`, then the request workspace as their working directory.
|
|
182
|
-
|
|
183
|
-
Start the bundled Egress Proxy as a separate supervised process before the
|
|
184
|
-
Runtime Bridge. In production use separate protected environment files: the
|
|
185
|
-
proxy file contains only its socket, token, and limits; the bridge file contains
|
|
186
|
-
the Node identity plus the matching proxy socket/token. The proxy accepts
|
|
187
|
-
`ORCHA_RUNTIME_EGRESS_PROXY_SOCKET` and `ORCHA_RUNTIME_EGRESS_PROXY_TOKEN`, and
|
|
188
|
-
listens only on that Unix Socket.
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
orcha-runtime-egress-proxy --env-file /etc/orcha/runtime-egress.env
|
|
192
|
-
orcha-runtime-bridge start --env-file /etc/orcha/runtime-node.env
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
The proxy must run under its own OS account in production. The bridge uses its
|
|
196
|
-
admin token only to create and revoke short-lived Run-bound grants; sandboxed
|
|
197
|
-
commands receive only the individual grant credential. A node whose proxy or
|
|
198
|
-
escape probe is unavailable remains registered for diagnostics but cannot
|
|
199
|
-
receive work.
|
|
200
|
-
|
|
201
|
-
```json
|
|
202
|
-
{
|
|
203
|
-
"codex": {
|
|
204
|
-
"type": "cli",
|
|
205
|
-
"command": "/opt/orcha-runtime-tools/bin/codex",
|
|
206
|
-
"toolchainRoots": ["/opt/orcha-runtime-tools"],
|
|
207
|
-
"args": ["exec", "--json"],
|
|
208
|
-
"promptMode": "stdin",
|
|
209
|
-
"outputMode": "json-lines",
|
|
210
|
-
"workspace": "/workspaces/project-a"
|
|
211
|
-
},
|
|
212
|
-
"openclaw": {
|
|
213
|
-
"type": "openclaw",
|
|
214
|
-
"command": "openclaw",
|
|
215
|
-
"workspace": "/workspaces/project-a",
|
|
216
|
-
"maxSessions": 1,
|
|
217
|
-
"releaseAfterPrompt": true,
|
|
218
|
-
"sessionIdleTtlMs": 60000,
|
|
219
|
-
"mcpServers": []
|
|
220
|
-
},
|
|
221
|
-
"custom-acp": {
|
|
222
|
-
"type": "stdio-acp",
|
|
223
|
-
"command": "node",
|
|
224
|
-
"args": ["/path/to/runtime.js"],
|
|
225
|
-
"framing": "line"
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
External Runtime Nodes call the agents configured by the node operator directly.
|
|
231
|
-
They do not require a Bridge-managed process sandbox and remain dispatchable on
|
|
232
|
-
Linux, macOS, and Windows. Keep target commands, workspaces, credentials, and OS
|
|
233
|
-
permissions under the operator's control.
|
|
234
|
-
|
|
235
|
-
If a request references a missing target, the bridge returns
|
|
236
|
-
`RUNTIME_TARGET_NOT_FOUND`. The built-in `echo` adapter is available only when
|
|
237
|
-
you explicitly configure a target with `"type": "echo"`.
|
|
238
|
-
|
|
239
|
-
Target types:
|
|
240
|
-
|
|
241
|
-
- `stdio-acp`: spawn a runtime process and speak Orcha ACP over stdio JSON-RPC.
|
|
242
|
-
- `openclaw`: built-in `openclaw acp --session ...` command adapter.
|
|
243
|
-
- `cli`: run an independent CLI per prompt and wrap stdout as session updates.
|
|
244
|
-
- `echo`: local test adapter.
|
|
245
|
-
|
|
246
|
-
For `cli` targets, `agents/dispatch` requests are treated as task execution and
|
|
247
|
-
emit only final text by default. Direct `sessions/prompt` requests keep normal
|
|
248
|
-
streaming text for interactive chat. Set `"dispatchFinalTextOnly": false` on a
|
|
249
|
-
target to opt out for task execution, or `"finalTextOnly": true` as the target
|
|
250
|
-
default when a request does not provide its own text-streaming policy.
|
|
251
|
-
|
|
252
|
-
For ACP-compatible targets (`stdio-acp`, `acp`, and `openclaw`), task dispatch
|
|
253
|
-
is treated as one-shot execution and releases the runtime process after each
|
|
254
|
-
completed prompt by default. Direct `sessions/prompt` requests keep the normal
|
|
255
|
-
target lifecycle. Set `"dispatchReleaseAfterPrompt": false` on a target only
|
|
256
|
-
when task dispatch should intentionally reuse the same ACP process.
|
|
257
|
-
|
|
258
|
-
Generic ACP-compatible targets receive `mcpServers` in `session/new`. When
|
|
259
|
-
omitted in target config, the bridge sends an empty array. OpenClaw targets
|
|
260
|
-
always receive an empty `mcpServers` array, because the field is required by the
|
|
261
|
-
ACP schema while OpenClaw bridge mode requires actual MCP servers to be
|
|
262
|
-
configured on the OpenClaw gateway or agent instead.
|
|
263
|
-
|
|
264
|
-
### Delegated group member tools
|
|
265
|
-
|
|
266
|
-
Group delegation uses one independent `runId`, session, and correlation for
|
|
267
|
-
each member task. Its task-scoped Orcha MCP credential grants only that member's
|
|
268
|
-
authorized capabilities. It is kept in memory and refreshed by attaching to the
|
|
269
|
-
existing operation. Lost operations fail explicitly; the Bridge never starts a
|
|
270
|
-
second prompt to simulate recovery. Permission changes cancel the old task;
|
|
271
|
-
native authorization or input pauses are not automatically approved or resumed.
|
|
272
|
-
|
|
273
|
-
For a Codex CLI target, the adapter adds a required HTTP MCP server through
|
|
274
|
-
per-process `-c` configuration and a private loopback proxy. Codex receives a
|
|
275
|
-
temporary proxy credential through `ORCHA_TASK_MCP_TOKEN`; upstream credentials
|
|
276
|
-
remain in Bridge memory. This does not edit the operator's Codex configuration.
|
|
277
|
-
This adapter requires a direct external Runtime Node; its loopback transport is
|
|
278
|
-
not supported inside a Bridge-managed sandbox. See [Codex MCP configuration](https://developers.openai.com/codex/mcp).
|
|
279
|
-
|
|
280
|
-
OpenClaw requires the bundled Gateway tool plugin. Build the Bridge, then install
|
|
281
|
-
the **built** plugin directory on the OpenClaw host:
|
|
68
|
+
## Build and validate
|
|
282
69
|
|
|
283
70
|
```bash
|
|
71
|
+
npm ci
|
|
72
|
+
npm run check
|
|
73
|
+
npm test
|
|
284
74
|
npm run build
|
|
285
|
-
openclaw plugins install /absolute/path/to/runtime-bridge/dist/package/openclaw-plugin
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
Configure `plugins.entries.orcha-runtime` on that Gateway, preserving other
|
|
289
|
-
installed plugin entries and allowlists:
|
|
290
|
-
|
|
291
|
-
```json
|
|
292
|
-
{
|
|
293
|
-
"enabled": true,
|
|
294
|
-
"config": { "allowedOrchaMcpUrl": "https://orcha.example.com/api/mcp/orcha" }
|
|
295
|
-
}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
If plugin or tool allowlists are configured, permit `orcha-runtime` and its four
|
|
299
|
-
`orcha_` tools for the intended OpenClaw Agent. The plugin binds tools only to
|
|
300
|
-
the trusted host `agentId` and task `sessionKey`; ordinary sessions receive none.
|
|
301
|
-
Its manifest declares all four tools and activates the binding route at startup.
|
|
302
|
-
Follow the host's [plugin installation](https://docs.openclaw.ai/cli/plugins/install)
|
|
303
|
-
and [runtime verification](https://docs.openclaw.ai/plugins/building-plugins) steps,
|
|
304
|
-
including loading the new code in the running Gateway. Pin and verify the actual
|
|
305
|
-
host version before enabling dispatch; this package does not claim a tested
|
|
306
|
-
OpenClaw version range yet.
|
|
307
|
-
|
|
308
|
-
Add these fields to the existing OpenClaw Runtime Target:
|
|
309
|
-
|
|
310
|
-
```json
|
|
311
|
-
{
|
|
312
|
-
"type": "openclaw",
|
|
313
|
-
"command": "openclaw",
|
|
314
|
-
"mcpBridgeUrl": "http://127.0.0.1:18789/plugins/orcha-runtime/mcp-bindings",
|
|
315
|
-
"mcpBridgeTokenEnv": "ORCHA_OPENCLAW_GATEWAY_TOKEN"
|
|
316
|
-
}
|
|
317
75
|
```
|
|
318
76
|
|
|
319
|
-
|
|
320
|
-
authentication credential. The binding URL must reach that same Gateway. Orcha's
|
|
321
|
-
Agent code must match the OpenClaw Agent id. Do not configure a shared fixed
|
|
322
|
-
`--session`: delegated sessions use `agent:<agentCode>:delegation-<runId>`.
|
|
323
|
-
The Gateway credential authorizes binding management; each tool call uses the
|
|
324
|
-
separate, short-lived member credential supplied by Core. Missing configuration,
|
|
325
|
-
rejected credentials, or a lost binding produces an explicit task failure.
|
|
326
|
-
Bindings expire and are released on completion, failure, or cancellation.
|
|
77
|
+
Build produces `bin/orcha-runtime-bridge.js` and the clean npm package in `dist/package`, including the OpenClaw plugin. Bridge is distributed through npm; backend images do not bundle a separate browser download.
|
|
327
78
|
|
|
328
|
-
|
|
329
|
-
Codex check performs a model call using the installed CLI's login and a temporary
|
|
330
|
-
MCP server:
|
|
79
|
+
Version 0.1.40 ships the OpenClaw native Orcha Channel adapter and bundled Gateway plugin, including channel delivery, active messages/files and authorized background runs. Bridge and the bundled plugin now share the release version. It retains the device pairing and ordinary-directory Codex execution from 0.1.39 and keeps `orcha-runtime-node.v2` unchanged. Deploying Orcha does not publish npm or upgrade connected devices automatically. Build and validate the release tarball before publishing:
|
|
331
80
|
|
|
332
81
|
```bash
|
|
333
|
-
|
|
82
|
+
npm run pack:local
|
|
83
|
+
npm publish ./dist/orcha-ai-runtime-bridge-0.1.40.tgz --access public --registry=https://registry.npmjs.org
|
|
334
84
|
```
|
|
335
85
|
|
|
336
|
-
|
|
337
|
-
acceptance on the configured nodes. This repository does not install the plugin
|
|
338
|
-
or change credentials on remote hosts.
|
|
339
|
-
|
|
340
|
-
OpenClaw targets use request metadata `agentCode` as the local OpenClaw agent
|
|
341
|
-
id, producing sessions like `agent:<agentCode>:<sessionId>`. When `agentCode`
|
|
342
|
-
is missing, the bridge falls back to a plain `orcha-<sessionId>` session.
|
|
343
|
-
|
|
344
|
-
OpenClaw may start browser processes under the hood, so the bridge applies
|
|
345
|
-
stricter defaults for this target type:
|
|
86
|
+
After updating the npm package on a device, run `orcha-runtime-bridge reload --url ...` to switch the existing background process to the installed version. The earlier manually downloaded foreground process must be stopped before connecting with npm to avoid duplicate connections.
|
|
346
87
|
|
|
347
|
-
|
|
348
|
-
- `releaseAfterPrompt`: defaults to `true` for OpenClaw, stopping the runtime
|
|
349
|
-
process after each prompt.
|
|
350
|
-
- `sessionIdleTtlMs`: defaults to `60000` for OpenClaw.
|
|
88
|
+
For native OpenClaw Channel use, also update the bundled OpenClaw plugin using the host's supported plugin update/reload procedure; updating Bridge alone does not update an installed Gateway plugin. Create a binding in the Orcha Agent's **消息通道** tab, merge its generated `channels.orcha.accounts` configuration into OpenClaw, and retain the existing Gateway/MCP binding configuration below. Existing ACP/CLI targets without a native binding continue using their configured execution path. Native Channel progress is currently final-result-only; real OpenClaw host/model acceptance remains required before production use.
|
|
351
89
|
|
|
352
|
-
|
|
353
|
-
reports each target's configured capacity, busy sessions, reclaimable idle
|
|
354
|
-
sessions, in-flight reservations, and currently available sessions on every
|
|
355
|
-
heartbeat. Orcha selects a compatible node from that live capacity; the bridge
|
|
356
|
-
still performs the final atomic reservation before starting a runtime.
|
|
90
|
+
Tests cover discovery errors, paths, public-field filtering, immutable commands, exact OpenClaw IDs, atomic configuration, capacity, reconnect, MCP lifecycle and cancellation. The live Codex model test is opt-in; fixtures do not certify a real vendor account or OpenClaw Gateway version.
|
|
357
91
|
|
|
358
|
-
|
|
92
|
+
## Delegated group member tools
|
|
359
93
|
|
|
360
|
-
|
|
361
|
-
ORCHA_RUNTIME_SESSION_IDLE_TTL_MS=600000
|
|
362
|
-
ORCHA_RUNTIME_SESSION_CLEANUP_INTERVAL_MS=60000
|
|
363
|
-
ORCHA_RUNTIME_MAX_SESSIONS_PER_TARGET=8
|
|
364
|
-
ORCHA_RUNTIME_OPENCLAW_SESSION_IDLE_TTL_MS=60000
|
|
365
|
-
ORCHA_RUNTIME_OPENCLAW_MAX_SESSIONS=1
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
Supported stdio framing:
|
|
369
|
-
|
|
370
|
-
- `line`: one JSON-RPC frame per line.
|
|
371
|
-
- `content-length`: `Content-Length: N` headers, compatible with LSP-style stdio transports.
|
|
94
|
+
Codex supports task-scoped Orcha MCP through the existing local transport adapter. OpenClaw additionally requires the bundled Gateway plugin, a trusted binding endpoint and Gateway authentication. Discovery/import does not install the plugin or configure these credentials. Claude Code's delegated dynamic MCP adapter remains unsupported and returns an explicit error.
|
|
372
95
|
|
|
373
|
-
|
|
96
|
+
For OpenClaw, install the built plugin, set `plugins.entries.orcha-runtime.enabled` to `true` and its `config.allowedOrchaMcpUrl` to the Orcha MCP URL. Preserve existing plugins and allowlists, permit the `orcha_` tools for the local Agent, then follow the host version's plugin reload procedure:
|
|
374
97
|
|
|
375
98
|
```bash
|
|
376
|
-
|
|
99
|
+
openclaw plugins install /absolute/path/to/runtime-bridge/dist/package/openclaw-plugin
|
|
377
100
|
```
|
|
378
101
|
|
|
379
|
-
|
|
380
|
-
managed by the host:
|
|
102
|
+
Advanced local target configuration retains `mcpBridgeUrl` (the Gateway `/plugins/orcha-runtime/mcp-bindings` route) and `mcpBridgeTokenEnv` (the existing local environment variable holding Gateway authentication). Configure these in the connected device profile while Bridge is stopped, then reconnect. Tokens stay on the device. Orcha's per-run MCP credential is separate and short-lived. The binding uses the discovered local Agent ID; grants are task-scoped and released on termination. Missing configuration, rejected credentials or a lost binding fails explicitly.
|
|
381
103
|
|
|
382
|
-
|
|
383
|
-
ORCHA_RUNTIME_ENV_FILE=/etc/orcha/runtime-node.env npm start
|
|
384
|
-
```
|
|
104
|
+
The env-configured `run`/`start` commands and HTTP adapter remain for adapter development. They do not authorize legacy manual external nodes to register with current Core; user devices use `connect` or `start --url` with a saved pairing.
|