@okrlinkhub/agent-factory 1.0.10 → 1.0.11
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 +14 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -293,9 +293,17 @@ If you use `exposeApi(...)`, the worker contract is available directly on the co
|
|
|
293
293
|
- `workerComplete`
|
|
294
294
|
- `workerFail`
|
|
295
295
|
|
|
296
|
-
###
|
|
296
|
+
### `agent-bridge`: config and secrets for OpenClaw workers
|
|
297
297
|
|
|
298
|
-
`agent-factory`
|
|
298
|
+
`agent-factory` does **not** execute `agent-bridge` tools.
|
|
299
|
+
|
|
300
|
+
Its role stops at:
|
|
301
|
+
- storing bridge settings on the agent profile
|
|
302
|
+
- resolving bridge secrets from the component secret store
|
|
303
|
+
- exposing `bridgeRuntimeConfig` in hydration
|
|
304
|
+
- forwarding bridge-related env vars to spawned OpenClaw workers
|
|
305
|
+
|
|
306
|
+
Tool execution belongs to the OpenClaw worker runtime / worker image, not to `agent-factory`.
|
|
299
307
|
|
|
300
308
|
1) Configure an agent profile with bridge settings:
|
|
301
309
|
|
|
@@ -346,32 +354,8 @@ skills (`APP_BASE_URL_MAP_JSON`).
|
|
|
346
354
|
|
|
347
355
|
Hydration includes `bridgeRuntimeConfig` for the worker loop.
|
|
348
356
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
```ts
|
|
352
|
-
import {
|
|
353
|
-
maybeExecuteBridgeToolCall,
|
|
354
|
-
resolveBridgeRuntimeConfig,
|
|
355
|
-
} from "@okrlinkhub/agent-factory";
|
|
356
|
-
|
|
357
|
-
const resolved = resolveBridgeRuntimeConfig(hydration.bridgeRuntimeConfig);
|
|
358
|
-
if (resolved.ok) {
|
|
359
|
-
// Optional proactive resolution check
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
const toolResult = await maybeExecuteBridgeToolCall({
|
|
363
|
-
toolName: pendingToolCall.toolName,
|
|
364
|
-
toolArgs,
|
|
365
|
-
hydratedConfig: hydration.bridgeRuntimeConfig,
|
|
366
|
-
userToken: maybeUserJwtOrNull,
|
|
367
|
-
});
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
`maybeExecuteBridgeToolCall` handles:
|
|
371
|
-
- `bridge.<functionKey>` mapping to `POST /agent/execute`
|
|
372
|
-
- strict headers (`X-Agent-Service-Id`, `X-Agent-Service-Key`, `X-Agent-App`)
|
|
373
|
-
- retry for `429` and `5xx`
|
|
374
|
-
- deterministic response object to map back into conversation/tool messages
|
|
357
|
+
Do **not** treat `agent-factory` as the place where `bridge.<functionKey>` tool calls are executed.
|
|
358
|
+
If your OpenClaw agents use `agent-bridge`, that execution flow must live in the worker runtime itself.
|
|
375
359
|
|
|
376
360
|
Fallback env (worker-side only, used when hydration misses values):
|
|
377
361
|
- `OPENCLAW_AGENT_BRIDGE_BASE_URL` or `AGENT_BRIDGE_BASE_URL`
|
|
@@ -381,7 +365,7 @@ Fallback env (worker-side only, used when hydration misses values):
|
|
|
381
365
|
|
|
382
366
|
### Required Fly.io / component secrets for agent-bridge
|
|
383
367
|
|
|
384
|
-
When `agent-factory` is
|
|
368
|
+
When `agent-factory` is used together with `agent-bridge`, spawned workers may need these environment variables available in their runtime:
|
|
385
369
|
|
|
386
370
|
| Env var | Component secret ref | Purpose |
|
|
387
371
|
|---------|----------------------|---------|
|
|
@@ -389,7 +373,7 @@ When `agent-factory` is connected to `agent-bridge`, every spawned worker must r
|
|
|
389
373
|
| `OPENCLAW_SERVICE_KEY` | `agent-bridge.serviceKey` | Service key for bridge auth |
|
|
390
374
|
| `OPENCLAW_LINKING_SHARED_SECRET` | `agent-bridge.linkingSharedSecret` | Shared secret for `execute-on-behalf` user linking |
|
|
391
375
|
|
|
392
|
-
The scheduler forwards these from the component secret store into each machine's env at spawn time.
|
|
376
|
+
The scheduler forwards these from the component secret store into each machine's env at spawn time. These values prepare the worker runtime for bridge usage; they do not implement bridge tool execution inside `agent-factory`.
|
|
393
377
|
|
|
394
378
|
Import all three into the component secret store:
|
|
395
379
|
|