@pleri/olam-cli 0.1.201 → 0.1.205
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 +102 -169
- package/dist/agent-stream/agent-sdk-to-chunks.js +1 -1
- package/dist/agent-stream/driver-runner.js +73 -7
- package/dist/agent-stream/host-driver-launch.js +14 -1
- package/dist/agent-stream/prototype-gen-launch.js +113 -0
- package/dist/agent-stream/question-broker-bridge.js +335 -0
- package/dist/agent-stream/sdk-env-merge.demo.js +35 -0
- package/dist/agent-stream/sdk-env-merge.js +98 -0
- package/dist/image-digests.json +8 -8
- package/dist/index.js +9533 -6258
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +24721 -12934
- package/hermes-bundle/version.json +1 -1
- package/hooks/__tests__/_loader.py +26 -0
- package/hooks/__tests__/prompts.py +63 -0
- package/hooks/__tests__/test_classify_bench.py +94 -0
- package/hooks/__tests__/test_classify_pins.py +78 -0
- package/hooks/model-router.py +17 -4
- package/host-cp/k8s/manifests/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +1 -1
- package/host-cp/src/op-side-longpoll.mjs +212 -0
- package/host-cp/src/plan-chat-proxy-headers.mjs +53 -0
- package/host-cp/src/plan-chat-service.mjs +100 -0
- package/host-cp/src/plan-orchestrator.mjs +100 -6
- package/host-cp/src/server.mjs +607 -45
- package/memory-hooks/agentmemory-classify-queue.mjs +363 -0
- package/memory-hooks/agentmemory-recall-trigger.mjs +233 -0
- package/memory-hooks/agentmemory-reflect-cite.mjs +332 -0
- package/memory-hooks/agentmemory-session-recall.js +332 -0
- package/memory-hooks/recall-log.mjs +185 -0
- package/package.json +9 -4
- package/dist/ask/checkout.d.ts +0 -19
- package/dist/ask/checkout.d.ts.map +0 -1
- package/dist/ask/checkout.js +0 -40
- package/dist/ask/checkout.js.map +0 -1
- package/dist/ask/knowledge-pack-builder.d.ts +0 -72
- package/dist/ask/knowledge-pack-builder.d.ts.map +0 -1
- package/dist/ask/knowledge-pack-builder.js +0 -96
- package/dist/ask/knowledge-pack-builder.js.map +0 -1
- package/dist/ask/knowledge-pack.generated.d.ts +0 -8
- package/dist/ask/knowledge-pack.generated.d.ts.map +0 -1
- package/dist/ask/knowledge-pack.generated.js +0 -2362
- package/dist/ask/knowledge-pack.generated.js.map +0 -1
- package/dist/ask/one-shot.d.ts +0 -21
- package/dist/ask/one-shot.d.ts.map +0 -1
- package/dist/ask/one-shot.js +0 -50
- package/dist/ask/one-shot.js.map +0 -1
- package/dist/ask/repl.d.ts +0 -30
- package/dist/ask/repl.d.ts.map +0 -1
- package/dist/ask/repl.js +0 -109
- package/dist/ask/repl.js.map +0 -1
- package/dist/ask/sdk-client.d.ts +0 -87
- package/dist/ask/sdk-client.d.ts.map +0 -1
- package/dist/ask/sdk-client.js +0 -118
- package/dist/ask/sdk-client.js.map +0 -1
- package/dist/ask/system-prompt.d.ts +0 -30
- package/dist/ask/system-prompt.d.ts.map +0 -1
- package/dist/ask/system-prompt.js +0 -31
- package/dist/ask/system-prompt.js.map +0 -1
- package/dist/cli-version.d.ts +0 -16
- package/dist/cli-version.d.ts.map +0 -1
- package/dist/cli-version.js +0 -39
- package/dist/cli-version.js.map +0 -1
- package/dist/commands/ask.d.ts +0 -27
- package/dist/commands/ask.d.ts.map +0 -1
- package/dist/commands/ask.js +0 -63
- package/dist/commands/ask.js.map +0 -1
- package/dist/commands/auth-list-json.d.ts +0 -87
- package/dist/commands/auth-list-json.d.ts.map +0 -1
- package/dist/commands/auth-list-json.js +0 -71
- package/dist/commands/auth-list-json.js.map +0 -1
- package/dist/commands/auth-migrate.d.ts +0 -212
- package/dist/commands/auth-migrate.d.ts.map +0 -1
- package/dist/commands/auth-migrate.js +0 -465
- package/dist/commands/auth-migrate.js.map +0 -1
- package/dist/commands/auth-status.d.ts +0 -51
- package/dist/commands/auth-status.d.ts.map +0 -1
- package/dist/commands/auth-status.js +0 -250
- package/dist/commands/auth-status.js.map +0 -1
- package/dist/commands/auth-upgrade.d.ts +0 -88
- package/dist/commands/auth-upgrade.d.ts.map +0 -1
- package/dist/commands/auth-upgrade.js +0 -431
- package/dist/commands/auth-upgrade.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -31
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js +0 -784
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/begin.d.ts +0 -27
- package/dist/commands/begin.d.ts.map +0 -1
- package/dist/commands/begin.js +0 -45
- package/dist/commands/begin.js.map +0 -1
- package/dist/commands/bootstrap.d.ts +0 -111
- package/dist/commands/bootstrap.d.ts.map +0 -1
- package/dist/commands/bootstrap.js +0 -485
- package/dist/commands/bootstrap.js.map +0 -1
- package/dist/commands/clean.d.ts +0 -41
- package/dist/commands/clean.d.ts.map +0 -1
- package/dist/commands/clean.js +0 -382
- package/dist/commands/clean.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -30
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -50
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -146
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/create.d.ts +0 -8
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -775
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/crystallize.d.ts +0 -18
- package/dist/commands/crystallize.d.ts.map +0 -1
- package/dist/commands/crystallize.js +0 -123
- package/dist/commands/crystallize.js.map +0 -1
- package/dist/commands/destroy.d.ts +0 -59
- package/dist/commands/destroy.d.ts.map +0 -1
- package/dist/commands/destroy.js +0 -148
- package/dist/commands/destroy.js.map +0 -1
- package/dist/commands/diagnose.d.ts +0 -36
- package/dist/commands/diagnose.d.ts.map +0 -1
- package/dist/commands/diagnose.js +0 -177
- package/dist/commands/diagnose.js.map +0 -1
- package/dist/commands/dispatch-resolve.d.ts +0 -54
- package/dist/commands/dispatch-resolve.d.ts.map +0 -1
- package/dist/commands/dispatch-resolve.js +0 -105
- package/dist/commands/dispatch-resolve.js.map +0 -1
- package/dist/commands/dispatch.d.ts +0 -18
- package/dist/commands/dispatch.d.ts.map +0 -1
- package/dist/commands/dispatch.js +0 -159
- package/dist/commands/dispatch.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -258
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -1073
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/enter.d.ts +0 -63
- package/dist/commands/enter.d.ts.map +0 -1
- package/dist/commands/enter.js +0 -230
- package/dist/commands/enter.js.map +0 -1
- package/dist/commands/flywheel/check-persona-skeleton.d.ts +0 -35
- package/dist/commands/flywheel/check-persona-skeleton.d.ts.map +0 -1
- package/dist/commands/flywheel/check-persona-skeleton.js +0 -151
- package/dist/commands/flywheel/check-persona-skeleton.js.map +0 -1
- package/dist/commands/flywheel/diversity-check.d.ts +0 -17
- package/dist/commands/flywheel/diversity-check.d.ts.map +0 -1
- package/dist/commands/flywheel/diversity-check.js +0 -64
- package/dist/commands/flywheel/diversity-check.js.map +0 -1
- package/dist/commands/flywheel/emit-breadcrumb.d.ts +0 -20
- package/dist/commands/flywheel/emit-breadcrumb.d.ts.map +0 -1
- package/dist/commands/flywheel/emit-breadcrumb.js +0 -137
- package/dist/commands/flywheel/emit-breadcrumb.js.map +0 -1
- package/dist/commands/flywheel/index.d.ts +0 -27
- package/dist/commands/flywheel/index.d.ts.map +0 -1
- package/dist/commands/flywheel/index.js +0 -54
- package/dist/commands/flywheel/index.js.map +0 -1
- package/dist/commands/flywheel/install-sessionstart-hook.d.ts +0 -64
- package/dist/commands/flywheel/install-sessionstart-hook.d.ts.map +0 -1
- package/dist/commands/flywheel/install-sessionstart-hook.js +0 -197
- package/dist/commands/flywheel/install-sessionstart-hook.js.map +0 -1
- package/dist/commands/flywheel/install-shims.d.ts +0 -41
- package/dist/commands/flywheel/install-shims.d.ts.map +0 -1
- package/dist/commands/flywheel/install-shims.js +0 -126
- package/dist/commands/flywheel/install-shims.js.map +0 -1
- package/dist/commands/flywheel/k10-measure.d.ts +0 -17
- package/dist/commands/flywheel/k10-measure.d.ts.map +0 -1
- package/dist/commands/flywheel/k10-measure.js +0 -63
- package/dist/commands/flywheel/k10-measure.js.map +0 -1
- package/dist/commands/flywheel/k5-score.d.ts +0 -14
- package/dist/commands/flywheel/k5-score.d.ts.map +0 -1
- package/dist/commands/flywheel/k5-score.js +0 -59
- package/dist/commands/flywheel/k5-score.js.map +0 -1
- package/dist/commands/flywheel/k5-validate.d.ts +0 -46
- package/dist/commands/flywheel/k5-validate.d.ts.map +0 -1
- package/dist/commands/flywheel/k5-validate.js +0 -246
- package/dist/commands/flywheel/k5-validate.js.map +0 -1
- package/dist/commands/flywheel/migrate-overlays.d.ts +0 -116
- package/dist/commands/flywheel/migrate-overlays.d.ts.map +0 -1
- package/dist/commands/flywheel/migrate-overlays.js +0 -792
- package/dist/commands/flywheel/migrate-overlays.js.map +0 -1
- package/dist/commands/flywheel/ping.d.ts +0 -21
- package/dist/commands/flywheel/ping.d.ts.map +0 -1
- package/dist/commands/flywheel/ping.js +0 -79
- package/dist/commands/flywheel/ping.js.map +0 -1
- package/dist/commands/flywheel/sanitize-persona-output.d.ts +0 -38
- package/dist/commands/flywheel/sanitize-persona-output.d.ts.map +0 -1
- package/dist/commands/flywheel/sanitize-persona-output.js +0 -102
- package/dist/commands/flywheel/sanitize-persona-output.js.map +0 -1
- package/dist/commands/flywheel/session-start.d.ts +0 -26
- package/dist/commands/flywheel/session-start.d.ts.map +0 -1
- package/dist/commands/flywheel/session-start.js +0 -119
- package/dist/commands/flywheel/session-start.js.map +0 -1
- package/dist/commands/hermes-kg-hook.d.ts +0 -36
- package/dist/commands/hermes-kg-hook.d.ts.map +0 -1
- package/dist/commands/hermes-kg-hook.js +0 -80
- package/dist/commands/hermes-kg-hook.js.map +0 -1
- package/dist/commands/hermes.d.ts +0 -46
- package/dist/commands/hermes.d.ts.map +0 -1
- package/dist/commands/hermes.js +0 -320
- package/dist/commands/hermes.js.map +0 -1
- package/dist/commands/host-cp.d.ts +0 -216
- package/dist/commands/host-cp.d.ts.map +0 -1
- package/dist/commands/host-cp.js +0 -913
- package/dist/commands/host-cp.js.map +0 -1
- package/dist/commands/implode.d.ts +0 -86
- package/dist/commands/implode.d.ts.map +0 -1
- package/dist/commands/implode.js +0 -468
- package/dist/commands/implode.js.map +0 -1
- package/dist/commands/init.d.ts +0 -86
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -357
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/install.d.ts +0 -22
- package/dist/commands/install.d.ts.map +0 -1
- package/dist/commands/install.js +0 -203
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/keys-list-json.d.ts +0 -55
- package/dist/commands/keys-list-json.d.ts.map +0 -1
- package/dist/commands/keys-list-json.js +0 -54
- package/dist/commands/keys-list-json.js.map +0 -1
- package/dist/commands/keys.d.ts +0 -26
- package/dist/commands/keys.d.ts.map +0 -1
- package/dist/commands/keys.js +0 -157
- package/dist/commands/keys.js.map +0 -1
- package/dist/commands/kg-build.d.ts +0 -80
- package/dist/commands/kg-build.d.ts.map +0 -1
- package/dist/commands/kg-build.js +0 -282
- package/dist/commands/kg-build.js.map +0 -1
- package/dist/commands/kg-classify.d.ts +0 -30
- package/dist/commands/kg-classify.d.ts.map +0 -1
- package/dist/commands/kg-classify.js +0 -88
- package/dist/commands/kg-classify.js.map +0 -1
- package/dist/commands/kg-doctor.d.ts +0 -76
- package/dist/commands/kg-doctor.d.ts.map +0 -1
- package/dist/commands/kg-doctor.js +0 -262
- package/dist/commands/kg-doctor.js.map +0 -1
- package/dist/commands/kg-install-hook.d.ts +0 -20
- package/dist/commands/kg-install-hook.d.ts.map +0 -1
- package/dist/commands/kg-install-hook.js +0 -208
- package/dist/commands/kg-install-hook.js.map +0 -1
- package/dist/commands/kg-mirror.d.ts +0 -72
- package/dist/commands/kg-mirror.d.ts.map +0 -1
- package/dist/commands/kg-mirror.js +0 -397
- package/dist/commands/kg-mirror.js.map +0 -1
- package/dist/commands/kg-savings.d.ts +0 -20
- package/dist/commands/kg-savings.d.ts.map +0 -1
- package/dist/commands/kg-savings.js +0 -77
- package/dist/commands/kg-savings.js.map +0 -1
- package/dist/commands/kg-service-container.d.ts +0 -68
- package/dist/commands/kg-service-container.d.ts.map +0 -1
- package/dist/commands/kg-service-container.js +0 -191
- package/dist/commands/kg-service-container.js.map +0 -1
- package/dist/commands/kg-status.d.ts +0 -59
- package/dist/commands/kg-status.d.ts.map +0 -1
- package/dist/commands/kg-status.js +0 -344
- package/dist/commands/kg-status.js.map +0 -1
- package/dist/commands/kg-uninstall-hook.d.ts +0 -12
- package/dist/commands/kg-uninstall-hook.d.ts.map +0 -1
- package/dist/commands/kg-uninstall-hook.js +0 -121
- package/dist/commands/kg-uninstall-hook.js.map +0 -1
- package/dist/commands/kg-watch.d.ts +0 -49
- package/dist/commands/kg-watch.d.ts.map +0 -1
- package/dist/commands/kg-watch.js +0 -172
- package/dist/commands/kg-watch.js.map +0 -1
- package/dist/commands/lanes-list-json.d.ts +0 -69
- package/dist/commands/lanes-list-json.d.ts.map +0 -1
- package/dist/commands/lanes-list-json.js +0 -42
- package/dist/commands/lanes-list-json.js.map +0 -1
- package/dist/commands/lanes.d.ts +0 -18
- package/dist/commands/lanes.d.ts.map +0 -1
- package/dist/commands/lanes.js +0 -133
- package/dist/commands/lanes.js.map +0 -1
- package/dist/commands/list.d.ts +0 -33
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -87
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -52
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -180
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/mcp/add.d.ts +0 -9
- package/dist/commands/mcp/add.d.ts.map +0 -1
- package/dist/commands/mcp/add.js +0 -87
- package/dist/commands/mcp/add.js.map +0 -1
- package/dist/commands/mcp/client.d.ts +0 -60
- package/dist/commands/mcp/client.d.ts.map +0 -1
- package/dist/commands/mcp/client.js +0 -70
- package/dist/commands/mcp/client.js.map +0 -1
- package/dist/commands/mcp/complete.d.ts +0 -36
- package/dist/commands/mcp/complete.d.ts.map +0 -1
- package/dist/commands/mcp/complete.js +0 -66
- package/dist/commands/mcp/complete.js.map +0 -1
- package/dist/commands/mcp/import-discovery.d.ts +0 -25
- package/dist/commands/mcp/import-discovery.d.ts.map +0 -1
- package/dist/commands/mcp/import-discovery.js +0 -135
- package/dist/commands/mcp/import-discovery.js.map +0 -1
- package/dist/commands/mcp/import-validate.d.ts +0 -15
- package/dist/commands/mcp/import-validate.d.ts.map +0 -1
- package/dist/commands/mcp/import-validate.js +0 -55
- package/dist/commands/mcp/import-validate.js.map +0 -1
- package/dist/commands/mcp/import.d.ts +0 -12
- package/dist/commands/mcp/import.d.ts.map +0 -1
- package/dist/commands/mcp/import.js +0 -126
- package/dist/commands/mcp/import.js.map +0 -1
- package/dist/commands/mcp/index.d.ts +0 -14
- package/dist/commands/mcp/index.d.ts.map +0 -1
- package/dist/commands/mcp/index.js +0 -39
- package/dist/commands/mcp/index.js.map +0 -1
- package/dist/commands/mcp/install-shared.d.ts +0 -24
- package/dist/commands/mcp/install-shared.d.ts.map +0 -1
- package/dist/commands/mcp/install-shared.js +0 -42
- package/dist/commands/mcp/install-shared.js.map +0 -1
- package/dist/commands/mcp/install.d.ts +0 -20
- package/dist/commands/mcp/install.d.ts.map +0 -1
- package/dist/commands/mcp/install.js +0 -59
- package/dist/commands/mcp/install.js.map +0 -1
- package/dist/commands/mcp/list.d.ts +0 -6
- package/dist/commands/mcp/list.d.ts.map +0 -1
- package/dist/commands/mcp/list.js +0 -56
- package/dist/commands/mcp/list.js.map +0 -1
- package/dist/commands/mcp/login.d.ts +0 -6
- package/dist/commands/mcp/login.d.ts.map +0 -1
- package/dist/commands/mcp/login.js +0 -38
- package/dist/commands/mcp/login.js.map +0 -1
- package/dist/commands/mcp/remove.d.ts +0 -6
- package/dist/commands/mcp/remove.d.ts.map +0 -1
- package/dist/commands/mcp/remove.js +0 -21
- package/dist/commands/mcp/remove.js.map +0 -1
- package/dist/commands/mcp/revoke.d.ts +0 -11
- package/dist/commands/mcp/revoke.d.ts.map +0 -1
- package/dist/commands/mcp/revoke.js +0 -51
- package/dist/commands/mcp/revoke.js.map +0 -1
- package/dist/commands/mcp/serve.d.ts +0 -23
- package/dist/commands/mcp/serve.d.ts.map +0 -1
- package/dist/commands/mcp/serve.js +0 -55
- package/dist/commands/mcp/serve.js.map +0 -1
- package/dist/commands/mcp/status.d.ts +0 -6
- package/dist/commands/mcp/status.d.ts.map +0 -1
- package/dist/commands/mcp/status.js +0 -57
- package/dist/commands/mcp/status.js.map +0 -1
- package/dist/commands/mcp/uninstall.d.ts +0 -20
- package/dist/commands/mcp/uninstall.d.ts.map +0 -1
- package/dist/commands/mcp/uninstall.js +0 -60
- package/dist/commands/mcp/uninstall.js.map +0 -1
- package/dist/commands/memory/_paths.d.ts +0 -25
- package/dist/commands/memory/_paths.d.ts.map +0 -1
- package/dist/commands/memory/_paths.js +0 -57
- package/dist/commands/memory/_paths.js.map +0 -1
- package/dist/commands/memory/bridge.d.ts +0 -57
- package/dist/commands/memory/bridge.d.ts.map +0 -1
- package/dist/commands/memory/bridge.js +0 -152
- package/dist/commands/memory/bridge.js.map +0 -1
- package/dist/commands/memory/index.d.ts +0 -20
- package/dist/commands/memory/index.d.ts.map +0 -1
- package/dist/commands/memory/index.js +0 -47
- package/dist/commands/memory/index.js.map +0 -1
- package/dist/commands/memory/install-hooks.d.ts +0 -22
- package/dist/commands/memory/install-hooks.d.ts.map +0 -1
- package/dist/commands/memory/install-hooks.js +0 -156
- package/dist/commands/memory/install-hooks.js.map +0 -1
- package/dist/commands/memory/install.d.ts +0 -57
- package/dist/commands/memory/install.d.ts.map +0 -1
- package/dist/commands/memory/install.js +0 -114
- package/dist/commands/memory/install.js.map +0 -1
- package/dist/commands/memory/logs.d.ts +0 -19
- package/dist/commands/memory/logs.d.ts.map +0 -1
- package/dist/commands/memory/logs.js +0 -50
- package/dist/commands/memory/logs.js.map +0 -1
- package/dist/commands/memory/mode.d.ts +0 -47
- package/dist/commands/memory/mode.d.ts.map +0 -1
- package/dist/commands/memory/mode.js +0 -185
- package/dist/commands/memory/mode.js.map +0 -1
- package/dist/commands/memory/reclassify.d.ts +0 -56
- package/dist/commands/memory/reclassify.d.ts.map +0 -1
- package/dist/commands/memory/reclassify.js +0 -177
- package/dist/commands/memory/reclassify.js.map +0 -1
- package/dist/commands/memory/secret.d.ts +0 -16
- package/dist/commands/memory/secret.d.ts.map +0 -1
- package/dist/commands/memory/secret.js +0 -80
- package/dist/commands/memory/secret.js.map +0 -1
- package/dist/commands/memory/start.d.ts +0 -25
- package/dist/commands/memory/start.d.ts.map +0 -1
- package/dist/commands/memory/start.js +0 -83
- package/dist/commands/memory/start.js.map +0 -1
- package/dist/commands/memory/stats.d.ts +0 -69
- package/dist/commands/memory/stats.d.ts.map +0 -1
- package/dist/commands/memory/stats.js +0 -164
- package/dist/commands/memory/stats.js.map +0 -1
- package/dist/commands/memory/status.d.ts +0 -45
- package/dist/commands/memory/status.d.ts.map +0 -1
- package/dist/commands/memory/status.js +0 -134
- package/dist/commands/memory/status.js.map +0 -1
- package/dist/commands/memory/stop.d.ts +0 -13
- package/dist/commands/memory/stop.d.ts.map +0 -1
- package/dist/commands/memory/stop.js +0 -52
- package/dist/commands/memory/stop.js.map +0 -1
- package/dist/commands/memory/uninstall.d.ts +0 -19
- package/dist/commands/memory/uninstall.d.ts.map +0 -1
- package/dist/commands/memory/uninstall.js +0 -60
- package/dist/commands/memory/uninstall.js.map +0 -1
- package/dist/commands/memory-service-container.d.ts +0 -130
- package/dist/commands/memory-service-container.d.ts.map +0 -1
- package/dist/commands/memory-service-container.js +0 -251
- package/dist/commands/memory-service-container.js.map +0 -1
- package/dist/commands/observe.d.ts +0 -9
- package/dist/commands/observe.d.ts.map +0 -1
- package/dist/commands/observe.js +0 -42
- package/dist/commands/observe.js.map +0 -1
- package/dist/commands/plans-list-json.d.ts +0 -77
- package/dist/commands/plans-list-json.d.ts.map +0 -1
- package/dist/commands/plans-list-json.js +0 -61
- package/dist/commands/plans-list-json.js.map +0 -1
- package/dist/commands/plans.d.ts +0 -3
- package/dist/commands/plans.d.ts.map +0 -1
- package/dist/commands/plans.js +0 -221
- package/dist/commands/plans.js.map +0 -1
- package/dist/commands/policy-check.d.ts +0 -14
- package/dist/commands/policy-check.d.ts.map +0 -1
- package/dist/commands/policy-check.js +0 -76
- package/dist/commands/policy-check.js.map +0 -1
- package/dist/commands/pr.d.ts +0 -17
- package/dist/commands/pr.d.ts.map +0 -1
- package/dist/commands/pr.js +0 -148
- package/dist/commands/pr.js.map +0 -1
- package/dist/commands/ps.d.ts +0 -57
- package/dist/commands/ps.d.ts.map +0 -1
- package/dist/commands/ps.js +0 -202
- package/dist/commands/ps.js.map +0 -1
- package/dist/commands/refresh-helpers.d.ts +0 -25
- package/dist/commands/refresh-helpers.d.ts.map +0 -1
- package/dist/commands/refresh-helpers.js +0 -56
- package/dist/commands/refresh-helpers.js.map +0 -1
- package/dist/commands/refresh.d.ts +0 -23
- package/dist/commands/refresh.d.ts.map +0 -1
- package/dist/commands/refresh.js +0 -237
- package/dist/commands/refresh.js.map +0 -1
- package/dist/commands/rekey.d.ts +0 -84
- package/dist/commands/rekey.d.ts.map +0 -1
- package/dist/commands/rekey.js +0 -209
- package/dist/commands/rekey.js.map +0 -1
- package/dist/commands/repos-list-json.d.ts +0 -58
- package/dist/commands/repos-list-json.d.ts.map +0 -1
- package/dist/commands/repos-list-json.js +0 -45
- package/dist/commands/repos-list-json.js.map +0 -1
- package/dist/commands/repos.d.ts +0 -11
- package/dist/commands/repos.d.ts.map +0 -1
- package/dist/commands/repos.js +0 -102
- package/dist/commands/repos.js.map +0 -1
- package/dist/commands/restart.d.ts +0 -18
- package/dist/commands/restart.d.ts.map +0 -1
- package/dist/commands/restart.js +0 -113
- package/dist/commands/restart.js.map +0 -1
- package/dist/commands/resume.d.ts +0 -63
- package/dist/commands/resume.d.ts.map +0 -1
- package/dist/commands/resume.js +0 -174
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/runbooks.d.ts +0 -45
- package/dist/commands/runbooks.d.ts.map +0 -1
- package/dist/commands/runbooks.js +0 -313
- package/dist/commands/runbooks.js.map +0 -1
- package/dist/commands/seed.d.ts +0 -27
- package/dist/commands/seed.d.ts.map +0 -1
- package/dist/commands/seed.js +0 -303
- package/dist/commands/seed.js.map +0 -1
- package/dist/commands/services-tls.d.ts +0 -120
- package/dist/commands/services-tls.d.ts.map +0 -1
- package/dist/commands/services-tls.js +0 -489
- package/dist/commands/services-tls.js.map +0 -1
- package/dist/commands/services.d.ts +0 -218
- package/dist/commands/services.d.ts.map +0 -1
- package/dist/commands/services.js +0 -830
- package/dist/commands/services.js.map +0 -1
- package/dist/commands/setup-linux-gate.d.ts +0 -26
- package/dist/commands/setup-linux-gate.d.ts.map +0 -1
- package/dist/commands/setup-linux-gate.js +0 -40
- package/dist/commands/setup-linux-gate.js.map +0 -1
- package/dist/commands/setup-metrics.d.ts +0 -26
- package/dist/commands/setup-metrics.d.ts.map +0 -1
- package/dist/commands/setup-metrics.js +0 -56
- package/dist/commands/setup-metrics.js.map +0 -1
- package/dist/commands/setup-phase-5a-skill-source.d.ts +0 -84
- package/dist/commands/setup-phase-5a-skill-source.d.ts.map +0 -1
- package/dist/commands/setup-phase-5a-skill-source.js +0 -259
- package/dist/commands/setup-phase-5a-skill-source.js.map +0 -1
- package/dist/commands/setup-phase-5b-project-sweep.d.ts +0 -38
- package/dist/commands/setup-phase-5b-project-sweep.d.ts.map +0 -1
- package/dist/commands/setup-phase-5b-project-sweep.js +0 -175
- package/dist/commands/setup-phase-5b-project-sweep.js.map +0 -1
- package/dist/commands/setup-phase-8-kg-hook.d.ts +0 -48
- package/dist/commands/setup-phase-8-kg-hook.d.ts.map +0 -1
- package/dist/commands/setup-phase-8-kg-hook.js +0 -93
- package/dist/commands/setup-phase-8-kg-hook.js.map +0 -1
- package/dist/commands/setup-phase-9-memory-bridge.d.ts +0 -36
- package/dist/commands/setup-phase-9-memory-bridge.d.ts.map +0 -1
- package/dist/commands/setup-phase-9-memory-bridge.js +0 -59
- package/dist/commands/setup-phase-9-memory-bridge.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -231
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -1374
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/skills-100x.d.ts +0 -34
- package/dist/commands/skills-100x.d.ts.map +0 -1
- package/dist/commands/skills-100x.js +0 -405
- package/dist/commands/skills-100x.js.map +0 -1
- package/dist/commands/skills-doctor.d.ts +0 -14
- package/dist/commands/skills-doctor.d.ts.map +0 -1
- package/dist/commands/skills-doctor.js +0 -126
- package/dist/commands/skills-doctor.js.map +0 -1
- package/dist/commands/skills-hook.d.ts +0 -19
- package/dist/commands/skills-hook.d.ts.map +0 -1
- package/dist/commands/skills-hook.js +0 -99
- package/dist/commands/skills-hook.js.map +0 -1
- package/dist/commands/skills-install-model-router.d.ts +0 -20
- package/dist/commands/skills-install-model-router.d.ts.map +0 -1
- package/dist/commands/skills-install-model-router.js +0 -55
- package/dist/commands/skills-install-model-router.js.map +0 -1
- package/dist/commands/skills-migrate-back.d.ts +0 -21
- package/dist/commands/skills-migrate-back.d.ts.map +0 -1
- package/dist/commands/skills-migrate-back.js +0 -222
- package/dist/commands/skills-migrate-back.js.map +0 -1
- package/dist/commands/skills-migrate-hooks-back.d.ts +0 -19
- package/dist/commands/skills-migrate-hooks-back.d.ts.map +0 -1
- package/dist/commands/skills-migrate-hooks-back.js +0 -83
- package/dist/commands/skills-migrate-hooks-back.js.map +0 -1
- package/dist/commands/skills-migrate-hooks.d.ts +0 -40
- package/dist/commands/skills-migrate-hooks.d.ts.map +0 -1
- package/dist/commands/skills-migrate-hooks.js +0 -178
- package/dist/commands/skills-migrate-hooks.js.map +0 -1
- package/dist/commands/skills-migrate.d.ts +0 -33
- package/dist/commands/skills-migrate.d.ts.map +0 -1
- package/dist/commands/skills-migrate.js +0 -216
- package/dist/commands/skills-migrate.js.map +0 -1
- package/dist/commands/skills-onboard.d.ts +0 -26
- package/dist/commands/skills-onboard.d.ts.map +0 -1
- package/dist/commands/skills-onboard.js +0 -230
- package/dist/commands/skills-onboard.js.map +0 -1
- package/dist/commands/skills-shadow-backups.d.ts +0 -15
- package/dist/commands/skills-shadow-backups.d.ts.map +0 -1
- package/dist/commands/skills-shadow-backups.js +0 -132
- package/dist/commands/skills-shadow-backups.js.map +0 -1
- package/dist/commands/skills-source.d.ts +0 -61
- package/dist/commands/skills-source.d.ts.map +0 -1
- package/dist/commands/skills-source.js +0 -895
- package/dist/commands/skills-source.js.map +0 -1
- package/dist/commands/skills.d.ts +0 -59
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js +0 -461
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/status.d.ts +0 -65
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -249
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/stop.d.ts +0 -10
- package/dist/commands/stop.d.ts.map +0 -1
- package/dist/commands/stop.js +0 -17
- package/dist/commands/stop.js.map +0 -1
- package/dist/commands/substrate-audit-log.d.ts +0 -51
- package/dist/commands/substrate-audit-log.d.ts.map +0 -1
- package/dist/commands/substrate-audit-log.js +0 -161
- package/dist/commands/substrate-audit-log.js.map +0 -1
- package/dist/commands/substrate.d.ts +0 -87
- package/dist/commands/substrate.d.ts.map +0 -1
- package/dist/commands/substrate.js +0 -194
- package/dist/commands/substrate.js.map +0 -1
- package/dist/commands/update.d.ts +0 -89
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -331
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/upgrade-history.d.ts +0 -15
- package/dist/commands/upgrade-history.d.ts.map +0 -1
- package/dist/commands/upgrade-history.js +0 -34
- package/dist/commands/upgrade-history.js.map +0 -1
- package/dist/commands/upgrade-lock.d.ts +0 -93
- package/dist/commands/upgrade-lock.d.ts.map +0 -1
- package/dist/commands/upgrade-lock.js +0 -225
- package/dist/commands/upgrade-lock.js.map +0 -1
- package/dist/commands/upgrade-log.d.ts +0 -86
- package/dist/commands/upgrade-log.d.ts.map +0 -1
- package/dist/commands/upgrade-log.js +0 -146
- package/dist/commands/upgrade-log.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -445
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -1718
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/workspace-list-json.d.ts +0 -73
- package/dist/commands/workspace-list-json.d.ts.map +0 -1
- package/dist/commands/workspace-list-json.js +0 -59
- package/dist/commands/workspace-list-json.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -23
- package/dist/commands/workspace.d.ts.map +0 -1
- package/dist/commands/workspace.js +0 -203
- package/dist/commands/workspace.js.map +0 -1
- package/dist/commands/world-snapshot.d.ts +0 -32
- package/dist/commands/world-snapshot.d.ts.map +0 -1
- package/dist/commands/world-snapshot.js +0 -531
- package/dist/commands/world-snapshot.js.map +0 -1
- package/dist/commands/world-upgrade.d.ts +0 -33
- package/dist/commands/world-upgrade.d.ts.map +0 -1
- package/dist/commands/world-upgrade.js +0 -82
- package/dist/commands/world-upgrade.js.map +0 -1
- package/dist/commands/world.d.ts +0 -12
- package/dist/commands/world.d.ts.map +0 -1
- package/dist/commands/world.js +0 -18
- package/dist/commands/world.js.map +0 -1
- package/dist/commands/worldspec/compile.d.ts +0 -20
- package/dist/commands/worldspec/compile.d.ts.map +0 -1
- package/dist/commands/worldspec/compile.js +0 -130
- package/dist/commands/worldspec/compile.js.map +0 -1
- package/dist/commands/worldspec/index.d.ts +0 -12
- package/dist/commands/worldspec/index.d.ts.map +0 -1
- package/dist/commands/worldspec/index.js +0 -23
- package/dist/commands/worldspec/index.js.map +0 -1
- package/dist/commands/worldspec/init.d.ts +0 -15
- package/dist/commands/worldspec/init.d.ts.map +0 -1
- package/dist/commands/worldspec/init.js +0 -166
- package/dist/commands/worldspec/init.js.map +0 -1
- package/dist/commands/worldspec/schema.d.ts +0 -11
- package/dist/commands/worldspec/schema.d.ts.map +0 -1
- package/dist/commands/worldspec/schema.js +0 -55
- package/dist/commands/worldspec/schema.js.map +0 -1
- package/dist/commands/worldspec/validate.d.ts +0 -15
- package/dist/commands/worldspec/validate.d.ts.map +0 -1
- package/dist/commands/worldspec/validate.js +0 -66
- package/dist/commands/worldspec/validate.js.map +0 -1
- package/dist/commands/yolo.d.ts +0 -95
- package/dist/commands/yolo.d.ts.map +0 -1
- package/dist/commands/yolo.js +0 -377
- package/dist/commands/yolo.js.map +0 -1
- package/dist/context.d.ts +0 -30
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -56
- package/dist/context.js.map +0 -1
- package/dist/docker-host.d.ts +0 -18
- package/dist/docker-host.d.ts.map +0 -1
- package/dist/docker-host.js +0 -17
- package/dist/docker-host.js.map +0 -1
- package/dist/exit-codes.d.ts +0 -67
- package/dist/exit-codes.d.ts.map +0 -1
- package/dist/exit-codes.js +0 -67
- package/dist/exit-codes.js.map +0 -1
- package/dist/from-manifest.d.ts +0 -53
- package/dist/from-manifest.d.ts.map +0 -1
- package/dist/from-manifest.js +0 -95
- package/dist/from-manifest.js.map +0 -1
- package/dist/image-presence.d.ts +0 -40
- package/dist/image-presence.d.ts.map +0 -1
- package/dist/image-presence.js +0 -39
- package/dist/image-presence.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/install-root.d.ts +0 -74
- package/dist/install-root.d.ts.map +0 -1
- package/dist/install-root.js +0 -98
- package/dist/install-root.js.map +0 -1
- package/dist/lib/anthropic-base-url-file.d.ts +0 -37
- package/dist/lib/anthropic-base-url-file.d.ts.map +0 -1
- package/dist/lib/anthropic-base-url-file.js +0 -46
- package/dist/lib/anthropic-base-url-file.js.map +0 -1
- package/dist/lib/auth-backend.d.ts +0 -168
- package/dist/lib/auth-backend.d.ts.map +0 -1
- package/dist/lib/auth-backend.js +0 -172
- package/dist/lib/auth-backend.js.map +0 -1
- package/dist/lib/auth-list-cache.d.ts +0 -67
- package/dist/lib/auth-list-cache.d.ts.map +0 -1
- package/dist/lib/auth-list-cache.js +0 -84
- package/dist/lib/auth-list-cache.js.map +0 -1
- package/dist/lib/auth-list.d.ts +0 -107
- package/dist/lib/auth-list.d.ts.map +0 -1
- package/dist/lib/auth-list.js +0 -123
- package/dist/lib/auth-list.js.map +0 -1
- package/dist/lib/auth-login.d.ts +0 -92
- package/dist/lib/auth-login.d.ts.map +0 -1
- package/dist/lib/auth-login.js +0 -124
- package/dist/lib/auth-login.js.map +0 -1
- package/dist/lib/auth-mutator-backend.d.ts +0 -54
- package/dist/lib/auth-mutator-backend.d.ts.map +0 -1
- package/dist/lib/auth-mutator-backend.js +0 -62
- package/dist/lib/auth-mutator-backend.js.map +0 -1
- package/dist/lib/auth-refresh-kubernetes.d.ts +0 -65
- package/dist/lib/auth-refresh-kubernetes.d.ts.map +0 -1
- package/dist/lib/auth-refresh-kubernetes.js +0 -125
- package/dist/lib/auth-refresh-kubernetes.js.map +0 -1
- package/dist/lib/auth-remote.d.ts +0 -172
- package/dist/lib/auth-remote.d.ts.map +0 -1
- package/dist/lib/auth-remote.js +0 -394
- package/dist/lib/auth-remote.js.map +0 -1
- package/dist/lib/bootstrap-kubernetes.d.ts +0 -164
- package/dist/lib/bootstrap-kubernetes.d.ts.map +0 -1
- package/dist/lib/bootstrap-kubernetes.js +0 -1002
- package/dist/lib/bootstrap-kubernetes.js.map +0 -1
- package/dist/lib/build-if-stale.d.ts +0 -33
- package/dist/lib/build-if-stale.d.ts.map +0 -1
- package/dist/lib/build-if-stale.js +0 -156
- package/dist/lib/build-if-stale.js.map +0 -1
- package/dist/lib/bundle-freshness.d.ts +0 -57
- package/dist/lib/bundle-freshness.d.ts.map +0 -1
- package/dist/lib/bundle-freshness.js +0 -223
- package/dist/lib/bundle-freshness.js.map +0 -1
- package/dist/lib/bundle-source.d.ts +0 -52
- package/dist/lib/bundle-source.d.ts.map +0 -1
- package/dist/lib/bundle-source.js +0 -83
- package/dist/lib/bundle-source.js.map +0 -1
- package/dist/lib/cf-access-token.d.ts +0 -32
- package/dist/lib/cf-access-token.d.ts.map +0 -1
- package/dist/lib/cf-access-token.js +0 -51
- package/dist/lib/cf-access-token.js.map +0 -1
- package/dist/lib/completion-generator.d.ts +0 -107
- package/dist/lib/completion-generator.d.ts.map +0 -1
- package/dist/lib/completion-generator.js +0 -226
- package/dist/lib/completion-generator.js.map +0 -1
- package/dist/lib/config.d.ts +0 -114
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -246
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/flywheel-probes.d.ts +0 -58
- package/dist/lib/flywheel-probes.d.ts.map +0 -1
- package/dist/lib/flywheel-probes.js +0 -163
- package/dist/lib/flywheel-probes.js.map +0 -1
- package/dist/lib/health-probes.d.ts +0 -267
- package/dist/lib/health-probes.d.ts.map +0 -1
- package/dist/lib/health-probes.js +0 -933
- package/dist/lib/health-probes.js.map +0 -1
- package/dist/lib/help-groups.d.ts +0 -36
- package/dist/lib/help-groups.d.ts.map +0 -1
- package/dist/lib/help-groups.js +0 -124
- package/dist/lib/help-groups.js.map +0 -1
- package/dist/lib/host-side-proxy.d.ts +0 -67
- package/dist/lib/host-side-proxy.d.ts.map +0 -1
- package/dist/lib/host-side-proxy.js +0 -177
- package/dist/lib/host-side-proxy.js.map +0 -1
- package/dist/lib/instrumentation.d.ts +0 -85
- package/dist/lib/instrumentation.d.ts.map +0 -1
- package/dist/lib/instrumentation.js +0 -104
- package/dist/lib/instrumentation.js.map +0 -1
- package/dist/lib/k8s-bootstrap.d.ts +0 -126
- package/dist/lib/k8s-bootstrap.d.ts.map +0 -1
- package/dist/lib/k8s-bootstrap.js +0 -218
- package/dist/lib/k8s-bootstrap.js.map +0 -1
- package/dist/lib/k8s-context-discovery.d.ts +0 -80
- package/dist/lib/k8s-context-discovery.d.ts.map +0 -1
- package/dist/lib/k8s-context-discovery.js +0 -102
- package/dist/lib/k8s-context-discovery.js.map +0 -1
- package/dist/lib/k8s-secret-render.d.ts +0 -141
- package/dist/lib/k8s-secret-render.d.ts.map +0 -1
- package/dist/lib/k8s-secret-render.js +0 -318
- package/dist/lib/k8s-secret-render.js.map +0 -1
- package/dist/lib/kg-caps.d.ts +0 -19
- package/dist/lib/kg-caps.d.ts.map +0 -1
- package/dist/lib/kg-caps.js +0 -19
- package/dist/lib/kg-caps.js.map +0 -1
- package/dist/lib/kubectl-context.d.ts +0 -87
- package/dist/lib/kubectl-context.d.ts.map +0 -1
- package/dist/lib/kubectl-context.js +0 -105
- package/dist/lib/kubectl-context.js.map +0 -1
- package/dist/lib/kubectl-wrap.d.ts +0 -65
- package/dist/lib/kubectl-wrap.d.ts.map +0 -1
- package/dist/lib/kubectl-wrap.js +0 -135
- package/dist/lib/kubectl-wrap.js.map +0 -1
- package/dist/lib/manifest-refresh.d.ts +0 -136
- package/dist/lib/manifest-refresh.d.ts.map +0 -1
- package/dist/lib/manifest-refresh.js +0 -298
- package/dist/lib/manifest-refresh.js.map +0 -1
- package/dist/lib/memory-host-process-migration.d.ts +0 -56
- package/dist/lib/memory-host-process-migration.d.ts.map +0 -1
- package/dist/lib/memory-host-process-migration.js +0 -156
- package/dist/lib/memory-host-process-migration.js.map +0 -1
- package/dist/lib/memory-secret.d.ts +0 -83
- package/dist/lib/memory-secret.d.ts.map +0 -1
- package/dist/lib/memory-secret.js +0 -147
- package/dist/lib/memory-secret.js.map +0 -1
- package/dist/lib/peripheral-registry.d.ts +0 -53
- package/dist/lib/peripheral-registry.d.ts.map +0 -1
- package/dist/lib/peripheral-registry.js +0 -73
- package/dist/lib/peripheral-registry.js.map +0 -1
- package/dist/lib/plans-client.d.ts +0 -69
- package/dist/lib/plans-client.d.ts.map +0 -1
- package/dist/lib/plans-client.js +0 -140
- package/dist/lib/plans-client.js.map +0 -1
- package/dist/lib/port-forward.d.ts +0 -168
- package/dist/lib/port-forward.d.ts.map +0 -1
- package/dist/lib/port-forward.js +0 -393
- package/dist/lib/port-forward.js.map +0 -1
- package/dist/lib/shell-rc.d.ts +0 -90
- package/dist/lib/shell-rc.d.ts.map +0 -1
- package/dist/lib/shell-rc.js +0 -91
- package/dist/lib/shell-rc.js.map +0 -1
- package/dist/lib/shim-generator.d.ts +0 -51
- package/dist/lib/shim-generator.d.ts.map +0 -1
- package/dist/lib/shim-generator.js +0 -88
- package/dist/lib/shim-generator.js.map +0 -1
- package/dist/lib/skills-apply-overlays.d.ts +0 -35
- package/dist/lib/skills-apply-overlays.d.ts.map +0 -1
- package/dist/lib/skills-apply-overlays.js +0 -243
- package/dist/lib/skills-apply-overlays.js.map +0 -1
- package/dist/lib/symlink-reconcile.d.ts +0 -32
- package/dist/lib/symlink-reconcile.d.ts.map +0 -1
- package/dist/lib/symlink-reconcile.js +0 -80
- package/dist/lib/symlink-reconcile.js.map +0 -1
- package/dist/lib/upgrade-check.d.ts +0 -60
- package/dist/lib/upgrade-check.d.ts.map +0 -1
- package/dist/lib/upgrade-check.js +0 -169
- package/dist/lib/upgrade-check.js.map +0 -1
- package/dist/lib/upgrade-kubernetes.d.ts +0 -193
- package/dist/lib/upgrade-kubernetes.d.ts.map +0 -1
- package/dist/lib/upgrade-kubernetes.js +0 -1014
- package/dist/lib/upgrade-kubernetes.js.map +0 -1
- package/dist/lib/world-mcp-register.d.ts +0 -98
- package/dist/lib/world-mcp-register.d.ts.map +0 -1
- package/dist/lib/world-mcp-register.js +0 -117
- package/dist/lib/world-mcp-register.js.map +0 -1
- package/dist/output.d.ts +0 -10
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -31
- package/dist/output.js.map +0 -1
- package/dist/pleri-config.d.ts +0 -22
- package/dist/pleri-config.d.ts.map +0 -1
- package/dist/pleri-config.js +0 -42
- package/dist/pleri-config.js.map +0 -1
- package/dist/protocol-version.d.ts +0 -79
- package/dist/protocol-version.d.ts.map +0 -1
- package/dist/protocol-version.js +0 -133
- package/dist/protocol-version.js.map +0 -1
- package/dist/registry-allowlist.d.ts +0 -47
- package/dist/registry-allowlist.d.ts.map +0 -1
- package/dist/registry-allowlist.js +0 -67
- package/dist/registry-allowlist.js.map +0 -1
- package/dist/spawn/home-override.d.ts +0 -82
- package/dist/spawn/home-override.d.ts.map +0 -1
- package/dist/spawn/home-override.js +0 -107
- package/dist/spawn/home-override.js.map +0 -1
- package/host-cp/src/linear-sync.mjs +0 -43
package/host-cp/src/server.mjs
CHANGED
|
@@ -27,6 +27,7 @@ import path from 'node:path';
|
|
|
27
27
|
import url from 'node:url';
|
|
28
28
|
import { execFile } from 'node:child_process';
|
|
29
29
|
import { promisify } from 'node:util';
|
|
30
|
+
import { createHash } from 'node:crypto';
|
|
30
31
|
|
|
31
32
|
const execFileAsync = promisify(execFile);
|
|
32
33
|
import { SecretCache } from './secret-cache.mjs';
|
|
@@ -48,6 +49,10 @@ import {
|
|
|
48
49
|
import { betaResponseEmitter, cfAccessHeaders } from '@olam/auth-client';
|
|
49
50
|
import { attemptRecovery, findScenarioForKind } from '../recovery/index.mjs';
|
|
50
51
|
import { detectHaltChunk } from './halt-detect.mjs';
|
|
52
|
+
import {
|
|
53
|
+
buildPlanChatProxyHeaders,
|
|
54
|
+
injectBrokerSecret,
|
|
55
|
+
} from './plan-chat-proxy-headers.mjs';
|
|
51
56
|
import { evaluateRedirect, applyRedirect } from './redirect.mjs';
|
|
52
57
|
import { spawnUpgraderContainer } from './upgrade-spawner.mjs';
|
|
53
58
|
import { isPlanningPath } from './bootstrap-selective.mjs';
|
|
@@ -104,6 +109,11 @@ import { handleDispatchFromLinear } from './lib/linear-dispatch.mjs';
|
|
|
104
109
|
// (safePersistLastDispatch imported above alongside readLastDispatch)
|
|
105
110
|
import { emitTierSuggestion } from '../dispatch/auto-tier-scheduler.mjs';
|
|
106
111
|
import { isServeOnly, isOrchestrationRoute, ORCHESTRATION_UNAVAILABLE } from './serve-only-config.mjs';
|
|
112
|
+
// D.1 — operator-side long-poll (Phase D of 3-axis-local-cloud-mode-v1).
|
|
113
|
+
// Feature-flag-gated: only imported when OLAM_OPSIDE_LONGPOLL=1.
|
|
114
|
+
// Import is static so the module is parsed at startup (cheap), but
|
|
115
|
+
// startPoll() is only called when the flag is on.
|
|
116
|
+
import { startPoll, stopPoll } from './op-side-longpoll.mjs';
|
|
107
117
|
|
|
108
118
|
// ── Deployment-mode detection ─────────────────────────────────────
|
|
109
119
|
//
|
|
@@ -197,13 +207,43 @@ const OLAM_EMAIL_ATTACHMENTS_ROOT =
|
|
|
197
207
|
(HOST_CP_MODE === 'container'
|
|
198
208
|
? '/data/email-attachments'
|
|
199
209
|
: path.join(os.homedir(), '.olam', 'email-attachments'));
|
|
200
|
-
// Linear-
|
|
201
|
-
//
|
|
210
|
+
// Linear-dispatch trigger (POST /v1/dispatch-from-linear).
|
|
211
|
+
// OLAM_LINEAR_DISPATCH_SIGNING_SECRET — shared secret with the
|
|
212
|
+
// cloudflare-worker-linear-sync Worker. The Worker signs a canonical
|
|
213
|
+
// dispatch string and carries the signature in the request BODY (NOT an
|
|
214
|
+
// X-Linear-Signature header). This MUST match the Worker's
|
|
215
|
+
// OLAM_LINEAR_DISPATCH_SIGNING_SECRET.
|
|
216
|
+
// OLAM_LINEAR_WEBHOOK_SECRET — retained for back-compat / any future direct
|
|
217
|
+
// inbound-Linear-webhook receiver; NOT used by the dispatch hop.
|
|
202
218
|
// OLAM_LINEAR_WORLD_ID — optional; when set, route events to this worldId
|
|
203
219
|
// instead of spawning a new world each time.
|
|
204
220
|
// See docs/architecture/linear-as-trigger.md.
|
|
205
221
|
const OLAM_LINEAR_WEBHOOK_SECRET = process.env.OLAM_LINEAR_WEBHOOK_SECRET ?? '';
|
|
222
|
+
const OLAM_LINEAR_DISPATCH_SIGNING_SECRET =
|
|
223
|
+
process.env.OLAM_LINEAR_DISPATCH_SIGNING_SECRET ?? '';
|
|
206
224
|
const OLAM_LINEAR_WORLD_ID = process.env.OLAM_LINEAR_WORLD_ID ?? '';
|
|
225
|
+
// Cloud-burst dispatch (3-axis-local-cloud-mode-v1 Phase A1).
|
|
226
|
+
// OLAM_SANDBOX_RUNNER_URL — public HTTPS URL of the worker-runner-cloudflare-sandbox /spawn endpoint.
|
|
227
|
+
// OLAM_SANDBOX_RUNNER_TOKEN — bearer token presented to the runner's /spawn.
|
|
228
|
+
// Both required for the /api/world/:id/dispatch-cloud-burst endpoint to function.
|
|
229
|
+
// When either is absent, the endpoint returns 503 cloud_burst_not_configured.
|
|
230
|
+
const OLAM_SANDBOX_RUNNER_URL = process.env.OLAM_SANDBOX_RUNNER_URL ?? '';
|
|
231
|
+
const OLAM_SANDBOX_RUNNER_TOKEN = process.env.OLAM_SANDBOX_RUNNER_TOKEN ?? '';
|
|
232
|
+
|
|
233
|
+
// D.1 — operator-side long-poll feature flag.
|
|
234
|
+
// Set OLAM_OPSIDE_LONGPOLL=1 to enable. Default OFF (no behavior change
|
|
235
|
+
// when unset). Also requires OLAM_CLOUD_URL to know where plan-DO lives.
|
|
236
|
+
// OLAM_OPSIDE_LONGPOLL_AUTH provides the Authorization header value for
|
|
237
|
+
// Basic auth to plan-DO; defaults to Basic auth with operator/<SHOWCASE_PW>.
|
|
238
|
+
const OLAM_OPSIDE_LONGPOLL = process.env.OLAM_OPSIDE_LONGPOLL === '1';
|
|
239
|
+
const OLAM_CLOUD_URL = process.env.OLAM_CLOUD_URL ?? '';
|
|
240
|
+
const OLAM_SHOWCASE_PASSWORD = process.env.OLAM_SHOWCASE_PASSWORD ?? '';
|
|
241
|
+
// Build the Basic auth header from OLAM_SHOWCASE_PASSWORD when not
|
|
242
|
+
// explicitly overridden. Showcase Basic auth is the v1 mechanism (Decision #7).
|
|
243
|
+
const OLAM_OPSIDE_LONGPOLL_AUTH = process.env.OLAM_OPSIDE_LONGPOLL_AUTH
|
|
244
|
+
?? (OLAM_SHOWCASE_PASSWORD
|
|
245
|
+
? `Basic ${Buffer.from(`operator:${OLAM_SHOWCASE_PASSWORD}`).toString('base64')}`
|
|
246
|
+
: '');
|
|
207
247
|
|
|
208
248
|
// In-flight delivery IDs for deduplication. Linear retries on non-2xx;
|
|
209
249
|
// we MUST return 2xx for duplicates so retries terminate. Never use 409.
|
|
@@ -360,6 +400,33 @@ function readDogfoodRepoUrl() {
|
|
|
360
400
|
return '';
|
|
361
401
|
}
|
|
362
402
|
|
|
403
|
+
/**
|
|
404
|
+
* Resolve the default MULTI-repo clone list to inject into cloud-dispatch
|
|
405
|
+
* bodies as `repoUrls[]`. The SPA composer has no multi-repo picker (it sends
|
|
406
|
+
* a single optional repoUrl at most), so for multi-repo worlds (e.g.
|
|
407
|
+
* atlas-core + diner-app) host-cp injects the operator-configured default.
|
|
408
|
+
* Source order: OLAM_DOGFOOD_REPO_URLS env, then ~/.olam/dogfood-repo-urls
|
|
409
|
+
* file. Both accept newline- OR comma-separated URLs. Absent/empty → [] (no
|
|
410
|
+
* injection; falls back to the single-repo dogfoodRepoUrl path). Mirrors
|
|
411
|
+
* readDogfoodRepoUrl() — operators have ONE pattern, singular + plural.
|
|
412
|
+
* @returns {string[]}
|
|
413
|
+
*/
|
|
414
|
+
function readDogfoodRepoUrls() {
|
|
415
|
+
const raw =
|
|
416
|
+
process.env['OLAM_DOGFOOD_REPO_URLS'] ??
|
|
417
|
+
(() => {
|
|
418
|
+
try {
|
|
419
|
+
return fs.readFileSync(path.join(os.homedir(), '.olam', 'dogfood-repo-urls'), 'utf-8');
|
|
420
|
+
} catch {
|
|
421
|
+
return '';
|
|
422
|
+
}
|
|
423
|
+
})();
|
|
424
|
+
return raw
|
|
425
|
+
.split(/[\n,]/)
|
|
426
|
+
.map((s) => s.trim())
|
|
427
|
+
.filter((s) => s.length > 0);
|
|
428
|
+
}
|
|
429
|
+
|
|
363
430
|
/**
|
|
364
431
|
* Resolve the cloud-kg-mirror classifier proxy URL the runner forwards
|
|
365
432
|
* into spawned CF Sandbox child worlds. When set, host-cp enriches
|
|
@@ -404,6 +471,139 @@ function readKgProxyBearer() {
|
|
|
404
471
|
return '';
|
|
405
472
|
}
|
|
406
473
|
|
|
474
|
+
/**
|
|
475
|
+
* KG workspace the dispatched sandbox queries (e.g. `atlas-one`, which spans
|
|
476
|
+
* atlas-core + diner-app + 9 sibling repos). The runner exports it as
|
|
477
|
+
* OLAM_KG_PROXY_WORKSPACE so the in-sandbox `kg` helper scopes `/v1/graph` and
|
|
478
|
+
* the classify hook scopes its L2 probe. Source order: OLAM_KG_PROXY_WORKSPACE
|
|
479
|
+
* env, then ~/.olam/kg-proxy-workspace file. The per-world `workspace` field on
|
|
480
|
+
* the dispatch body (when present) wins over this at the enrich site below.
|
|
481
|
+
* Absent → no workspace injection (the KG is reachable but graph queries are
|
|
482
|
+
* un-scoped). Mirrors readKgProxyUrl/Bearer — operators have ONE pattern.
|
|
483
|
+
*/
|
|
484
|
+
function readKgProxyWorkspace() {
|
|
485
|
+
const fromOlamEnv = process.env['OLAM_KG_PROXY_WORKSPACE'];
|
|
486
|
+
if (fromOlamEnv && fromOlamEnv.length > 0) return fromOlamEnv.trim();
|
|
487
|
+
try {
|
|
488
|
+
const file = path.join(os.homedir(), '.olam', 'kg-proxy-workspace');
|
|
489
|
+
const content = fs.readFileSync(file, 'utf-8').trim();
|
|
490
|
+
if (content.length > 0) return content;
|
|
491
|
+
} catch {
|
|
492
|
+
// file absent — fall through
|
|
493
|
+
}
|
|
494
|
+
return '';
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Resolve the REMOTE host-cp base URL to inject into cloud-dispatch bodies as
|
|
499
|
+
* `hostCpUrl`. The CF-Sandbox runner posts chunks back to whatever
|
|
500
|
+
* OLAM_HOST_CP_URL it was deployed with — NOT this local host-cp. To see live
|
|
501
|
+
* agent reasoning in the SPA, the operator stands up a public tunnel (e.g.
|
|
502
|
+
* `cloudflared tunnel --url http://127.0.0.1:19000`) to THIS host-cp and writes
|
|
503
|
+
* the tunnel URL to ~/.olam/remote-host-cp-url. We forward it so the runner's
|
|
504
|
+
* in-container chunk-poster targets it (body.hostCpUrl wins over the runner's
|
|
505
|
+
* deploy-time env). Source order: OLAM_REMOTE_HOST_CP_URL env, then the file.
|
|
506
|
+
* Absent → no injection (chunks land at the runner's default sink). Mirrors
|
|
507
|
+
* readKgProxyUrl() — operators have ONE pattern.
|
|
508
|
+
*/
|
|
509
|
+
function readRemoteHostCpUrl() {
|
|
510
|
+
const fromOlamEnv = process.env['OLAM_REMOTE_HOST_CP_URL'];
|
|
511
|
+
if (fromOlamEnv && fromOlamEnv.length > 0) return fromOlamEnv.trim();
|
|
512
|
+
try {
|
|
513
|
+
const file = path.join(os.homedir(), '.olam', 'remote-host-cp-url');
|
|
514
|
+
const content = fs.readFileSync(file, 'utf-8').trim();
|
|
515
|
+
if (content.length > 0) return content;
|
|
516
|
+
} catch {
|
|
517
|
+
// file absent — fall through
|
|
518
|
+
}
|
|
519
|
+
return '';
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* TTL-cached aggregator for the four ~/.olam/ config values that enrich
|
|
524
|
+
* cloud-dispatch payloads. Called on every /api/cloud-dispatch and
|
|
525
|
+
* /api/plans/create request — without caching each call issued 4 synchronous
|
|
526
|
+
* readFileSync syscalls that block the Node.js event loop in series.
|
|
527
|
+
*
|
|
528
|
+
* Cache design:
|
|
529
|
+
* TTL: OLAM_DISPATCH_CONFIG_TTL_MS (default 10 000 ms).
|
|
530
|
+
* Worst-case staleness after an operator file edit: one TTL window.
|
|
531
|
+
*
|
|
532
|
+
* fs.watch: each of the 4 ~/.olam/ files is watched for 'change'/'rename'
|
|
533
|
+
* events on first read. A watcher event immediately sets _dispatchConfigCache.value
|
|
534
|
+
* to null, so the next request re-reads all four files fresh — operator
|
|
535
|
+
* edits typically take effect on the very next dispatch, not after the TTL.
|
|
536
|
+
* Watchers are armed once and never torn down (host-cp is a long-running
|
|
537
|
+
* process; the 4 files are operator-written config, rarely mutated).
|
|
538
|
+
* fs.watch failures (e.g. network-mounted homedir, non-existent file) are
|
|
539
|
+
* swallowed — the TTL provides the fallback path.
|
|
540
|
+
*
|
|
541
|
+
* Env-var paths (OLAM_ANTHROPIC_BASE_URL etc.) can only change on process
|
|
542
|
+
* restart; the individual readers short-circuit on env before touching disk,
|
|
543
|
+
* so their values naturally stay consistent with the cached result.
|
|
544
|
+
*
|
|
545
|
+
* Thread-safety: Node.js is single-threaded. Concurrent async handlers
|
|
546
|
+
* race to read/write the same cache object. All outcomes are idempotent
|
|
547
|
+
* (same files → same values); the last writer wins harmlessly.
|
|
548
|
+
*
|
|
549
|
+
* Saving: 4 synchronous readFileSync calls per dispatch eliminated within the
|
|
550
|
+
* TTL window. Under concurrent dispatch bursts this removes the most
|
|
551
|
+
* common event-loop blocking on the hot path.
|
|
552
|
+
*
|
|
553
|
+
* @returns {{ anthropicBaseUrl: string, dogfoodRepoUrl: string, kgProxyUrl: string, kgProxyBearer: string, kgWorkspace: string }}
|
|
554
|
+
*/
|
|
555
|
+
const _DISPATCH_CONFIG_TTL_MS =
|
|
556
|
+
Number(process.env['OLAM_DISPATCH_CONFIG_TTL_MS'] ?? 10_000);
|
|
557
|
+
|
|
558
|
+
/** @type {{ value: { anthropicBaseUrl: string, dogfoodRepoUrl: string, kgProxyUrl: string, kgProxyBearer: string, kgWorkspace: string } | null, ts: number, watchersArmed: boolean }} */
|
|
559
|
+
const _dispatchConfigCache = { value: null, ts: 0, watchersArmed: false };
|
|
560
|
+
|
|
561
|
+
function _invalidateDispatchConfigCache() {
|
|
562
|
+
_dispatchConfigCache.value = null;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function _armDispatchConfigWatchers() {
|
|
566
|
+
if (_dispatchConfigCache.watchersArmed) return;
|
|
567
|
+
_dispatchConfigCache.watchersArmed = true;
|
|
568
|
+
const watchFiles = [
|
|
569
|
+
'anthropic-base-url',
|
|
570
|
+
'dogfood-repo-url',
|
|
571
|
+
'kg-proxy-url',
|
|
572
|
+
'kg-proxy-bearer',
|
|
573
|
+
'kg-proxy-workspace',
|
|
574
|
+
];
|
|
575
|
+
for (const name of watchFiles) {
|
|
576
|
+
const file = path.join(os.homedir(), '.olam', name);
|
|
577
|
+
try {
|
|
578
|
+
fs.watch(file, () => _invalidateDispatchConfigCache());
|
|
579
|
+
} catch {
|
|
580
|
+
// File absent or fs.watch unavailable (e.g. network-mounted homedir).
|
|
581
|
+
// TTL covers this fallback path — no action needed.
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function readHostDispatchConfig() {
|
|
587
|
+
const now = Date.now();
|
|
588
|
+
if (
|
|
589
|
+
_dispatchConfigCache.value !== null &&
|
|
590
|
+
now - _dispatchConfigCache.ts < _DISPATCH_CONFIG_TTL_MS
|
|
591
|
+
) {
|
|
592
|
+
return _dispatchConfigCache.value;
|
|
593
|
+
}
|
|
594
|
+
const value = {
|
|
595
|
+
anthropicBaseUrl: readAnthropicBaseUrl(),
|
|
596
|
+
dogfoodRepoUrl: readDogfoodRepoUrl(),
|
|
597
|
+
kgProxyUrl: readKgProxyUrl(),
|
|
598
|
+
kgProxyBearer: readKgProxyBearer(),
|
|
599
|
+
kgWorkspace: readKgProxyWorkspace(),
|
|
600
|
+
};
|
|
601
|
+
_dispatchConfigCache.value = value;
|
|
602
|
+
_dispatchConfigCache.ts = now;
|
|
603
|
+
_armDispatchConfigWatchers();
|
|
604
|
+
return value;
|
|
605
|
+
}
|
|
606
|
+
|
|
407
607
|
/** @type {Record<string, number>} */
|
|
408
608
|
let WORLDS = {};
|
|
409
609
|
|
|
@@ -825,7 +1025,6 @@ async function tickWorldsSnapshot() {
|
|
|
825
1025
|
String(a?.id ?? '').localeCompare(String(b?.id ?? '')),
|
|
826
1026
|
);
|
|
827
1027
|
const json = JSON.stringify(sorted);
|
|
828
|
-
const { createHash } = await import('node:crypto');
|
|
829
1028
|
const hash = createHash('sha1').update(json).digest('hex');
|
|
830
1029
|
if (hash === lastWorldsHash) return;
|
|
831
1030
|
lastWorldsHash = hash;
|
|
@@ -895,7 +1094,6 @@ async function tickTunnelsSnapshot() {
|
|
|
895
1094
|
tunnels: [...byWorld[id]].sort((a, b) => a.name.localeCompare(b.name)),
|
|
896
1095
|
}));
|
|
897
1096
|
const json = JSON.stringify(stable);
|
|
898
|
-
const { createHash } = await import('node:crypto');
|
|
899
1097
|
const hash = createHash('sha1').update(json).digest('hex');
|
|
900
1098
|
if (hash === lastTunnelsHash) return;
|
|
901
1099
|
lastTunnelsHash = hash;
|
|
@@ -938,7 +1136,6 @@ async function tickListeningSnapshot() {
|
|
|
938
1136
|
servers: [...w.servers].sort((a, b) => a.port - b.port),
|
|
939
1137
|
}));
|
|
940
1138
|
const json = JSON.stringify(stable);
|
|
941
|
-
const { createHash } = await import('node:crypto');
|
|
942
1139
|
const hash = createHash('sha1').update(json).digest('hex');
|
|
943
1140
|
if (hash === lastListeningHash) return;
|
|
944
1141
|
lastListeningHash = hash;
|
|
@@ -1055,6 +1252,11 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
1055
1252
|
// anything local that can hit 127.0.0.1:19000 can also read the token
|
|
1056
1253
|
// file directly (same OS-level privilege boundary). Single-user-only;
|
|
1057
1254
|
// multi-user mode (Phase G+) will swap this for cookie-with-Secure.
|
|
1255
|
+
//
|
|
1256
|
+
// Phase B (3-axis-local-cloud-mode-v1) adds two new fields:
|
|
1257
|
+
// capabilities — { local_docker, cloud_burst, cloud_tier } runtime capability flags
|
|
1258
|
+
// apiBase — '' by default; non-empty routes all SPA fetches to a different host
|
|
1259
|
+
// Both fields are additive; existing fields are preserved for backward compat.
|
|
1058
1260
|
if (url.pathname === '/api/bootstrap') {
|
|
1059
1261
|
return jsonReply(res, 200, {
|
|
1060
1262
|
token: auth.token,
|
|
@@ -1063,6 +1265,17 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
1063
1265
|
header_format: 'Bearer <token>',
|
|
1064
1266
|
hint: 'SPA: set document.cookie = `olam_host_cp_token=${token}; path=/; samesite=strict` then fetch (`/api/world/...`) freely.',
|
|
1065
1267
|
cloud_enabled: Boolean(process.env.OLAM_CLOUD_URL && process.env.OLAM_SHOWCASE_PASSWORD),
|
|
1268
|
+
// Phase B: tri-state capability flags. SPA reads these to populate
|
|
1269
|
+
// the PlanModeSelector (Phase C) and to gate the executor dispatch path.
|
|
1270
|
+
capabilities: {
|
|
1271
|
+
local_docker: true,
|
|
1272
|
+
cloud_burst: Boolean(OLAM_SANDBOX_RUNNER_URL && OLAM_SANDBOX_RUNNER_TOKEN),
|
|
1273
|
+
cloud_tier: Boolean(process.env.OLAM_CLOUD_URL),
|
|
1274
|
+
},
|
|
1275
|
+
// Phase B: remote host-cp re-targeting. '' means same origin (no-op).
|
|
1276
|
+
// v1 always returns '' — the field exists so the SPA can read it
|
|
1277
|
+
// without a code change when a future operator sets a non-empty value.
|
|
1278
|
+
apiBase: '',
|
|
1066
1279
|
});
|
|
1067
1280
|
}
|
|
1068
1281
|
|
|
@@ -1949,6 +2162,118 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
1949
2162
|
const parsed = parseProxyPath(url.pathname);
|
|
1950
2163
|
if (parsed) {
|
|
1951
2164
|
const { worldId, subPath } = parsed;
|
|
2165
|
+
|
|
2166
|
+
// /api/world/:id/dispatch-cloud-burst — must be checked BEFORE the WORLDS
|
|
2167
|
+
// registry lookup below. Cloud-burst dispatches to the CF Sandbox runner
|
|
2168
|
+
// directly (no local Docker world required). The runner can receive bursts
|
|
2169
|
+
// for worlds that have never been registered locally — this is the whole
|
|
2170
|
+
// point of the cloud-burst path. The handler after the if(parsed) block is
|
|
2171
|
+
// unreachable because the proxy block returns before it; this is the
|
|
2172
|
+
// authoritative check.
|
|
2173
|
+
if (subPath === '/dispatch-cloud-burst' && req.method === 'POST') {
|
|
2174
|
+
if (!OLAM_SANDBOX_RUNNER_URL || !OLAM_SANDBOX_RUNNER_TOKEN) {
|
|
2175
|
+
return jsonReply(res, 503, {
|
|
2176
|
+
error: 'cloud_burst_not_configured',
|
|
2177
|
+
message:
|
|
2178
|
+
'host-cp needs OLAM_SANDBOX_RUNNER_URL + OLAM_SANDBOX_RUNNER_TOKEN to dispatch cloud bursts. ' +
|
|
2179
|
+
'Set both env vars + restart host-cp.',
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
try {
|
|
2183
|
+
const reqChunks = [];
|
|
2184
|
+
for await (const c of req) reqChunks.push(c);
|
|
2185
|
+
let parsedBody;
|
|
2186
|
+
try {
|
|
2187
|
+
parsedBody = JSON.parse(Buffer.concat(reqChunks).toString('utf8'));
|
|
2188
|
+
} catch {
|
|
2189
|
+
return jsonReply(res, 400, { error: 'body_not_json' });
|
|
2190
|
+
}
|
|
2191
|
+
// Seam C guard (T1): strip ANTHROPIC_API_KEY + sk-ant-* keys from options
|
|
2192
|
+
// before building the spawn body. Structural — matches sandbox-dispatch-client.
|
|
2193
|
+
const safeOptions = {};
|
|
2194
|
+
if (parsedBody.options && typeof parsedBody.options === 'object') {
|
|
2195
|
+
for (const [k, v] of Object.entries(parsedBody.options)) {
|
|
2196
|
+
if (k !== 'ANTHROPIC_API_KEY' && !k.startsWith('sk-ant-')) safeOptions[k] = v;
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
// Enrich with host config (parity with cloud-dispatch handler).
|
|
2200
|
+
// readHostDispatchConfig() is TTL-cached (default 10 s) + fs.watch invalidated.
|
|
2201
|
+
// Body-field-wins semantics: caller-supplied value always takes precedence over
|
|
2202
|
+
// the host default for each optional field (additive: absent fields use the
|
|
2203
|
+
// host default so vault-routed deployments propagate without SPA changes).
|
|
2204
|
+
// idempotencyKey is always generated fresh — deduplicates retried bursts at
|
|
2205
|
+
// the runner's /spawn endpoint (mirrors the cloud-dispatch handler A3.2 contract).
|
|
2206
|
+
const {
|
|
2207
|
+
anthropicBaseUrl: hostAnthropicBaseUrl,
|
|
2208
|
+
dogfoodRepoUrl: hostRepoUrl,
|
|
2209
|
+
kgProxyUrl: hostKgProxyUrl,
|
|
2210
|
+
kgProxyBearer: hostKgProxyBearer,
|
|
2211
|
+
kgWorkspace: hostKgWorkspace,
|
|
2212
|
+
} = readHostDispatchConfig();
|
|
2213
|
+
const burstAnthropicBaseUrl = parsedBody.anthropicBaseUrl || hostAnthropicBaseUrl;
|
|
2214
|
+
const burstRepoUrl = parsedBody.repoUrl || hostRepoUrl;
|
|
2215
|
+
const burstKgProxyUrl = parsedBody.kgProxyUrl || hostKgProxyUrl;
|
|
2216
|
+
const burstKgProxyBearer = parsedBody.kgProxyBearer || hostKgProxyBearer;
|
|
2217
|
+
const burstKgWorkspace = parsedBody.kgWorkspace ||
|
|
2218
|
+
(typeof parsedBody.workspace === 'string' && parsedBody.workspace.length > 0 ? parsedBody.workspace : '') ||
|
|
2219
|
+
hostKgWorkspace;
|
|
2220
|
+
const burstHostCpUrl = parsedBody.hostCpUrl || readRemoteHostCpUrl();
|
|
2221
|
+
const burstChunksSinkUrl = parsedBody.chunksSinkUrl || OLAM_CLOUD_URL;
|
|
2222
|
+
// Always generate a fresh idempotency key — prevents double-spawn on
|
|
2223
|
+
// retried requests (mirrors the cloud-dispatch handler's A3.2 contract).
|
|
2224
|
+
const idempotencyKey = crypto.randomUUID();
|
|
2225
|
+
const spawnBody = {
|
|
2226
|
+
prompt: parsedBody.prompt ?? '',
|
|
2227
|
+
sessionId: parsedBody.session_id ?? worldId,
|
|
2228
|
+
worldId: parsedBody.world_id ?? worldId,
|
|
2229
|
+
bypassPermissions: typeof parsedBody.bypassPermissions === 'boolean' ? parsedBody.bypassPermissions : true,
|
|
2230
|
+
...(burstRepoUrl ? { repoUrl: burstRepoUrl } : {}),
|
|
2231
|
+
...(parsedBody.repoUrls && Array.isArray(parsedBody.repoUrls) && parsedBody.repoUrls.length > 0 ? { repoUrls: parsedBody.repoUrls } : {}),
|
|
2232
|
+
// submodules → runner clones with --recurse-submodules (vs --depth 1).
|
|
2233
|
+
// cloud-dispatch forwards it via its `...parsed` spread; cloud-burst
|
|
2234
|
+
// builds an explicit spawnBody, so it must forward it too or a
|
|
2235
|
+
// submodule repo dispatched via burst silently clones without its
|
|
2236
|
+
// submodules (drift parity with cloud-dispatch — same class as #1572).
|
|
2237
|
+
...(typeof parsedBody.submodules === 'boolean' ? { submodules: parsedBody.submodules } : {}),
|
|
2238
|
+
...(burstAnthropicBaseUrl ? { anthropicBaseUrl: burstAnthropicBaseUrl } : {}),
|
|
2239
|
+
...(burstKgProxyUrl ? { kgProxyUrl: burstKgProxyUrl } : {}),
|
|
2240
|
+
...(burstKgProxyBearer ? { kgProxyBearer: burstKgProxyBearer } : {}),
|
|
2241
|
+
...(burstKgWorkspace ? { kgWorkspace: burstKgWorkspace } : {}),
|
|
2242
|
+
...(burstHostCpUrl ? { hostCpUrl: burstHostCpUrl } : {}),
|
|
2243
|
+
...(burstChunksSinkUrl ? { chunksSinkUrl: burstChunksSinkUrl } : {}),
|
|
2244
|
+
idempotencyKey,
|
|
2245
|
+
...safeOptions,
|
|
2246
|
+
};
|
|
2247
|
+
const spawnRes = await fetch(`${OLAM_SANDBOX_RUNNER_URL}/spawn`, {
|
|
2248
|
+
method: 'POST',
|
|
2249
|
+
headers: {
|
|
2250
|
+
Authorization: `Bearer ${OLAM_SANDBOX_RUNNER_TOKEN}`,
|
|
2251
|
+
'content-type': 'application/json',
|
|
2252
|
+
},
|
|
2253
|
+
body: JSON.stringify(spawnBody),
|
|
2254
|
+
});
|
|
2255
|
+
if (!spawnRes.ok) {
|
|
2256
|
+
const errText = (await spawnRes.text()).slice(0, 200);
|
|
2257
|
+
return jsonReply(res, spawnRes.status, {
|
|
2258
|
+
error: 'cloud_burst_runner_error',
|
|
2259
|
+
message: errText,
|
|
2260
|
+
});
|
|
2261
|
+
}
|
|
2262
|
+
let spawnAck = {};
|
|
2263
|
+
try { spawnAck = await spawnRes.json(); } catch { /* older runner */ }
|
|
2264
|
+
return jsonReply(res, 200, {
|
|
2265
|
+
status: 'dispatched',
|
|
2266
|
+
sandbox_session_id: spawnAck.sessionId,
|
|
2267
|
+
world_id: parsedBody.world_id ?? worldId,
|
|
2268
|
+
});
|
|
2269
|
+
} catch (err) {
|
|
2270
|
+
return jsonReply(res, 502, {
|
|
2271
|
+
error: 'cloud_burst_dispatch_failed',
|
|
2272
|
+
message: err instanceof Error ? err.message : String(err),
|
|
2273
|
+
});
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
1952
2277
|
const port = WORLDS[worldId];
|
|
1953
2278
|
if (port === undefined) {
|
|
1954
2279
|
return jsonReply(res, 404, {
|
|
@@ -1958,6 +2283,53 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
1958
2283
|
});
|
|
1959
2284
|
}
|
|
1960
2285
|
|
|
2286
|
+
// SPA-driven UAT (WS4): /api/world/<id>/uat[/status] is NOT a per-world-CP
|
|
2287
|
+
// proxy — it forwards to the Cloudflare worker-runner that boots atlas-core
|
|
2288
|
+
// + diner-app in a sandbox and returns the two quick-tunnel URLs. Handle it
|
|
2289
|
+
// HERE, BEFORE the docker per-world secret-fetch + proxy below (which assumes
|
|
2290
|
+
// a local `olam-<id>-devbox` container and 500s for cloud UAT worlds).
|
|
2291
|
+
if ((subPath === '/uat' || subPath === '/uat/status') && req.method === 'POST') {
|
|
2292
|
+
if (!OLAM_SANDBOX_RUNNER_URL || !OLAM_SANDBOX_RUNNER_TOKEN) {
|
|
2293
|
+
return jsonReply(res, 503, {
|
|
2294
|
+
error: 'uat_not_configured',
|
|
2295
|
+
message: 'host-cp needs OLAM_SANDBOX_RUNNER_URL + OLAM_SANDBOX_RUNNER_TOKEN to run UAT.',
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
const isStatus = subPath === '/uat/status';
|
|
2299
|
+
try {
|
|
2300
|
+
const reqChunks = [];
|
|
2301
|
+
for await (const c of req) reqChunks.push(c);
|
|
2302
|
+
let uatIn = {};
|
|
2303
|
+
if (reqChunks.length) {
|
|
2304
|
+
try { uatIn = JSON.parse(Buffer.concat(reqChunks).toString('utf8')); }
|
|
2305
|
+
catch { return jsonReply(res, 400, { error: 'body_not_json' }); }
|
|
2306
|
+
}
|
|
2307
|
+
const uatBody = {
|
|
2308
|
+
sessionId: uatIn.session_id ?? uatIn.sessionId ?? worldId,
|
|
2309
|
+
...(uatIn.atlasCoreUrl ? { atlasCoreUrl: uatIn.atlasCoreUrl } : {}),
|
|
2310
|
+
...(uatIn.dinerAppUrl ? { dinerAppUrl: uatIn.dinerAppUrl } : {}),
|
|
2311
|
+
// Only the start call clones; inject the gh token server-side so the
|
|
2312
|
+
// browser never carries it.
|
|
2313
|
+
...(!isStatus && process.env.OLAM_UAT_GH_TOKEN ? { ghToken: process.env.OLAM_UAT_GH_TOKEN } : {}),
|
|
2314
|
+
};
|
|
2315
|
+
const uatRes = await fetch(`${OLAM_SANDBOX_RUNNER_URL}${isStatus ? '/uat/status' : '/uat'}`, {
|
|
2316
|
+
method: 'POST',
|
|
2317
|
+
headers: { Authorization: `Bearer ${OLAM_SANDBOX_RUNNER_TOKEN}`, 'content-type': 'application/json' },
|
|
2318
|
+
body: JSON.stringify(uatBody),
|
|
2319
|
+
signal: AbortSignal.timeout(90_000),
|
|
2320
|
+
});
|
|
2321
|
+
const text = await uatRes.text();
|
|
2322
|
+
let payload;
|
|
2323
|
+
try { payload = JSON.parse(text); } catch { payload = { raw: text.slice(0, 400) }; }
|
|
2324
|
+
return jsonReply(res, uatRes.ok ? 200 : uatRes.status, payload);
|
|
2325
|
+
} catch (err) {
|
|
2326
|
+
return jsonReply(res, 502, {
|
|
2327
|
+
error: 'uat_dispatch_failed',
|
|
2328
|
+
message: err instanceof Error ? err.message : String(err),
|
|
2329
|
+
});
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
|
|
1961
2333
|
// Phase F-2-D dogfood: synthesize /session/<id>/state. The CF Worker
|
|
1962
2334
|
// had a Durable Object tracking phase progression (created → syncing
|
|
1963
2335
|
// → cloning → configuring → warming-claude → ready). The per-world
|
|
@@ -2445,12 +2817,7 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2445
2817
|
: url.pathname.slice('/api/plan-chat'.length);
|
|
2446
2818
|
const upstreamUrl = new URL(subPath + url.search, upstreamBase);
|
|
2447
2819
|
try {
|
|
2448
|
-
const headers =
|
|
2449
|
-
for (const [k, v] of Object.entries(req.headers)) {
|
|
2450
|
-
if (k === 'host' || k === 'connection' || k === 'content-length') continue;
|
|
2451
|
-
if (Array.isArray(v)) headers[k] = v.join(', ');
|
|
2452
|
-
else if (typeof v === 'string') headers[k] = v;
|
|
2453
|
-
}
|
|
2820
|
+
const headers = buildPlanChatProxyHeaders(req.headers);
|
|
2454
2821
|
// Buffer body for non-GET/HEAD; GET shouldn't carry one.
|
|
2455
2822
|
let body;
|
|
2456
2823
|
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
@@ -2472,6 +2839,17 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2472
2839
|
} catch {
|
|
2473
2840
|
// Body not JSON — pass through to upstream as-is. No event.
|
|
2474
2841
|
}
|
|
2842
|
+
|
|
2843
|
+
// F3 (T9) — this host-cp proxy is the TRUSTED operator surface: the
|
|
2844
|
+
// SPA browser → host-cp → plan-chat-service. A WORLD process never
|
|
2845
|
+
// routes through here (it talks to plan-chat-service directly via
|
|
2846
|
+
// host.docker.internal). So when the operator-chunk broker secret is
|
|
2847
|
+
// configured, inject it here so the operator's own SPA interject is
|
|
2848
|
+
// authorised to write operator chunks, while a world process — which
|
|
2849
|
+
// cannot present this secret — is rejected by plan-chat-service's gate.
|
|
2850
|
+
// Injected only for chunk writes; harmless for non-operator chunks
|
|
2851
|
+
// (the gate only checks it for actor_type='operator').
|
|
2852
|
+
injectBrokerSecret(headers, process.env.OLAM_OPERATOR_CHUNK_SECRET);
|
|
2475
2853
|
}
|
|
2476
2854
|
|
|
2477
2855
|
const upstreamRes = await fetch(upstreamUrl.toString(), {
|
|
@@ -2582,13 +2960,16 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2582
2960
|
return;
|
|
2583
2961
|
}
|
|
2584
2962
|
|
|
2585
|
-
// POST /v1/dispatch-from-linear —
|
|
2963
|
+
// POST /v1/dispatch-from-linear — linear-sync Worker dispatch receiver.
|
|
2586
2964
|
//
|
|
2587
|
-
//
|
|
2588
|
-
//
|
|
2589
|
-
//
|
|
2590
|
-
//
|
|
2591
|
-
//
|
|
2965
|
+
// The cloudflare-worker-linear-sync Worker POSTs a structured dispatch
|
|
2966
|
+
// payload whose HMAC-SHA256 signature is carried IN THE BODY
|
|
2967
|
+
// (`payload.signature`) over a canonical string, keyed by
|
|
2968
|
+
// OLAM_LINEAR_DISPATCH_SIGNING_SECRET (NOT an X-Linear-Signature header,
|
|
2969
|
+
// NOT the Linear webhook secret). host-cp validates that signature +
|
|
2970
|
+
// replay window, deduplicates by deliveryId (Worker retries — duplicates
|
|
2971
|
+
// MUST return 202), and either routes to a pinned world
|
|
2972
|
+
// (OLAM_LINEAR_WORLD_ID) or returns a spawn_pending descriptor.
|
|
2592
2973
|
//
|
|
2593
2974
|
// Dedup rule: HTTP 202 { action: 'deduplicated' } — NEVER 409.
|
|
2594
2975
|
// Body cap: 1 MiB (Linear payloads are small JSON, no attachments).
|
|
@@ -2610,7 +2991,6 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2610
2991
|
req.on('end', async () => {
|
|
2611
2992
|
if (aborted) return;
|
|
2612
2993
|
const rawBody = Buffer.concat(chunks);
|
|
2613
|
-
const signature = req.headers['x-linear-signature'] ?? '';
|
|
2614
2994
|
let payload;
|
|
2615
2995
|
try {
|
|
2616
2996
|
payload = JSON.parse(rawBody.toString('utf8') || '{}');
|
|
@@ -2619,10 +2999,8 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2619
2999
|
}
|
|
2620
3000
|
try {
|
|
2621
3001
|
const result = await handleDispatchFromLinear({
|
|
2622
|
-
rawBody,
|
|
2623
3002
|
payload,
|
|
2624
|
-
|
|
2625
|
-
secret: OLAM_LINEAR_WEBHOOK_SECRET,
|
|
3003
|
+
secret: OLAM_LINEAR_DISPATCH_SIGNING_SECRET,
|
|
2626
3004
|
worlds: WORLDS,
|
|
2627
3005
|
inFlight: linearInFlight,
|
|
2628
3006
|
targetWorldId: OLAM_LINEAR_WORLD_ID || undefined,
|
|
@@ -2638,6 +3016,100 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2638
3016
|
return;
|
|
2639
3017
|
}
|
|
2640
3018
|
|
|
3019
|
+
// plan-chat-spa-attachments Phase A — POST /api/cloud-attachment.
|
|
3020
|
+
//
|
|
3021
|
+
// Bearer-gated (the central auth.isAuthorized gate above covers all /api/*
|
|
3022
|
+
// routes — same auth the SPA already carries for /api/cloud-dispatch). This
|
|
3023
|
+
// is a RAW-BYTE proxy: it streams the multipart body to plan-DO's
|
|
3024
|
+
// /v1/attachment (Basic operator:$OLAM_SHOWCASE_PASSWORD) WITHOUT decoding
|
|
3025
|
+
// it — `Buffer.concat(chunks)` with NO `.toString('utf8')` (utf8-decoding
|
|
3026
|
+
// binary file bytes corrupts them) and forwards Content-Type VERBATIM so the
|
|
3027
|
+
// upstream multipart boundary stays intact.
|
|
3028
|
+
//
|
|
3029
|
+
// Streaming size-guard (mirrors /v1/dispatch-from-email @ ~2893): a running
|
|
3030
|
+
// byte counter aborts with 413 + req.destroy() BEFORE fully buffering. Capped
|
|
3031
|
+
// at 32 MiB/file. Do NOT copy the JSON-buffering shape of /api/cloud-dispatch.
|
|
3032
|
+
if (url.pathname === '/api/cloud-attachment' && req.method === 'POST') {
|
|
3033
|
+
const cloudUrl = process.env.OLAM_CLOUD_URL;
|
|
3034
|
+
const showcasePw = process.env.OLAM_SHOWCASE_PASSWORD;
|
|
3035
|
+
if (!cloudUrl || !showcasePw) {
|
|
3036
|
+
return jsonReply(res, 503, {
|
|
3037
|
+
error: 'cloud_attachment_not_configured',
|
|
3038
|
+
message:
|
|
3039
|
+
'host-cp needs OLAM_CLOUD_URL + OLAM_SHOWCASE_PASSWORD to proxy cloud attachments. ' +
|
|
3040
|
+
'Set both env vars + restart host-cp.',
|
|
3041
|
+
});
|
|
3042
|
+
}
|
|
3043
|
+
// session_id query param → upstream plan_id (per-session = per-plan).
|
|
3044
|
+
// NOTE: this proxy reads session_id from the QUERY STRING, NOT the parsed
|
|
3045
|
+
// body — it is a raw-byte multipart proxy that never decodes the envelope.
|
|
3046
|
+
// (/api/cloud-dispatch differs: it parses its JSON body and reads
|
|
3047
|
+
// session_id from there.) The SPA must therefore carry session_id in the
|
|
3048
|
+
// upload URL query, or every upload forwards plan_id='default'. Defaults
|
|
3049
|
+
// to 'default' when absent.
|
|
3050
|
+
const sessionId = url.searchParams.get('session_id') ?? 'default';
|
|
3051
|
+
const contentType = req.headers['content-type'] ?? 'application/octet-stream';
|
|
3052
|
+
|
|
3053
|
+
const chunks = [];
|
|
3054
|
+
let size = 0;
|
|
3055
|
+
// P2-5 — this caps the RAW MULTIPART BODY (envelope), not the file. A
|
|
3056
|
+
// max-allowed 32 MiB file plus its multipart headers/boundary exceeds
|
|
3057
|
+
// 32 MiB, so capping at 32 here 413'd an at-ceiling file. The 32 MiB
|
|
3058
|
+
// PER-FILE limit is enforced downstream at plan-DO (/v1/attachment); this
|
|
3059
|
+
// 33 MiB cap only bounds the envelope to keep a runaway upload from
|
|
3060
|
+
// buffering unbounded.
|
|
3061
|
+
const MAX_BODY = 33 * 1024 * 1024;
|
|
3062
|
+
let aborted = false;
|
|
3063
|
+
req.on('data', (chunk) => {
|
|
3064
|
+
size += chunk.length;
|
|
3065
|
+
if (size > MAX_BODY) {
|
|
3066
|
+
aborted = true;
|
|
3067
|
+
jsonReply(res, 413, { error: 'attachment_too_large', maxBytes: MAX_BODY });
|
|
3068
|
+
req.destroy();
|
|
3069
|
+
return;
|
|
3070
|
+
}
|
|
3071
|
+
chunks.push(chunk);
|
|
3072
|
+
});
|
|
3073
|
+
req.on('error', () => {
|
|
3074
|
+
if (!aborted && !res.headersSent) {
|
|
3075
|
+
aborted = true;
|
|
3076
|
+
jsonReply(res, 400, { error: 'attachment_stream_error' });
|
|
3077
|
+
}
|
|
3078
|
+
});
|
|
3079
|
+
req.on('end', async () => {
|
|
3080
|
+
if (aborted) return;
|
|
3081
|
+
// RAW BYTES — never decode. utf8-decoding binary corrupts the file.
|
|
3082
|
+
const rawBody = Buffer.concat(chunks);
|
|
3083
|
+
const basicAuth = Buffer.from(`operator:${showcasePw}`).toString('base64');
|
|
3084
|
+
try {
|
|
3085
|
+
const upstream = await fetch(
|
|
3086
|
+
`${cloudUrl.replace(/\/+$/, '')}/v1/attachment?plan_id=${encodeURIComponent(sessionId)}`,
|
|
3087
|
+
{
|
|
3088
|
+
method: 'POST',
|
|
3089
|
+
headers: {
|
|
3090
|
+
'Authorization': `Basic ${basicAuth}`,
|
|
3091
|
+
// Content-Type VERBATIM — preserves the multipart boundary.
|
|
3092
|
+
'content-type': contentType,
|
|
3093
|
+
...cfAccessHeaders(),
|
|
3094
|
+
},
|
|
3095
|
+
body: rawBody,
|
|
3096
|
+
},
|
|
3097
|
+
);
|
|
3098
|
+
const upstreamBody = await upstream.text();
|
|
3099
|
+
res.statusCode = upstream.status;
|
|
3100
|
+
res.setHeader('content-type', upstream.headers.get('content-type') ?? 'application/json');
|
|
3101
|
+
res.setHeader('cache-control', 'no-store');
|
|
3102
|
+
return res.end(upstreamBody);
|
|
3103
|
+
} catch (err) {
|
|
3104
|
+
return jsonReply(res, 502, {
|
|
3105
|
+
error: 'cloud_attachment_proxy_failed',
|
|
3106
|
+
message: err.message,
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
});
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
|
|
2641
3113
|
if (url.pathname === '/api/cloud-dispatch' && req.method === 'POST') {
|
|
2642
3114
|
const cloudUrl = process.env.OLAM_CLOUD_URL;
|
|
2643
3115
|
const showcasePw = process.env.OLAM_SHOWCASE_PASSWORD;
|
|
@@ -2706,34 +3178,77 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2706
3178
|
);
|
|
2707
3179
|
}
|
|
2708
3180
|
|
|
2709
|
-
// Gap 3: enrich the dispatch body with the operator's
|
|
2710
|
-
//
|
|
2711
|
-
// Only injected when not already set by the SPA
|
|
2712
|
-
//
|
|
2713
|
-
|
|
2714
|
-
//
|
|
2715
|
-
//
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
//
|
|
2724
|
-
//
|
|
2725
|
-
//
|
|
2726
|
-
|
|
2727
|
-
|
|
3181
|
+
// Gap 3: enrich the dispatch body with the operator's host config so
|
|
3182
|
+
// plan-DO can propagate these values to spawned CF Sandbox child worlds.
|
|
3183
|
+
// Only injected when not already set by the SPA — host-cp is the sole
|
|
3184
|
+
// injection point for auth-worker / repo / kg-proxy config.
|
|
3185
|
+
// readHostDispatchConfig() is TTL-cached (default 10 s) + fs.watch
|
|
3186
|
+
// invalidated — eliminates 4 synchronous readFileSync calls per dispatch
|
|
3187
|
+
// on the hot path; see its JSDoc for the staleness window contract.
|
|
3188
|
+
const {
|
|
3189
|
+
anthropicBaseUrl,
|
|
3190
|
+
dogfoodRepoUrl,
|
|
3191
|
+
kgProxyUrl,
|
|
3192
|
+
kgProxyBearer,
|
|
3193
|
+
kgWorkspace: hostKgWorkspace,
|
|
3194
|
+
} = readHostDispatchConfig();
|
|
3195
|
+
// KG workspace: the per-world `workspace` field (set by the SPA's
|
|
3196
|
+
// WorkspacePicker) wins; otherwise fall back to the host default
|
|
3197
|
+
// (~/.olam/kg-proxy-workspace). The runner exports it as
|
|
3198
|
+
// OLAM_KG_PROXY_WORKSPACE so the in-sandbox `kg` helper + classify hook
|
|
3199
|
+
// scope their queries to the right graph (e.g. atlas-one).
|
|
3200
|
+
const kgWorkspace =
|
|
3201
|
+
(typeof parsed.workspace === 'string' && parsed.workspace.length > 0
|
|
3202
|
+
? parsed.workspace
|
|
3203
|
+
: '') || hostKgWorkspace;
|
|
3204
|
+
// 3-axis-local-cloud-mode-v1 Phase A3 A3.2: generate a uuid-v7 per dispatch
|
|
3205
|
+
// for idempotency deduplication at the runner's /spawn endpoint. The key
|
|
3206
|
+
// travels as both a header (Idempotency-Key) and a body field (idempotencyKey)
|
|
3207
|
+
// so plan-DO can forward it even without native header-forwarding support
|
|
3208
|
+
// (the body field path is the safe fallback until plan-DO gains header
|
|
3209
|
+
// propagation in a follow-up phase).
|
|
3210
|
+
const idempotencyKey = crypto.randomUUID();
|
|
3211
|
+
// Multi-repo default: the SPA composer can't pass repoUrls[] (no picker),
|
|
3212
|
+
// so inject the operator-configured multi-repo default for multi-repo
|
|
3213
|
+
// worlds (atlas-core + diner-app). Only when the body carries neither a
|
|
3214
|
+
// repoUrls[] nor a single repoUrl — explicit caller input always wins.
|
|
3215
|
+
const dogfoodRepoUrls = readDogfoodRepoUrls();
|
|
3216
|
+
// plan-chat-spa-attachments Phase A: `parsed.attachments` (a top-level
|
|
3217
|
+
// AttachmentRef[] field — NEVER inside messages[].content) is forwarded
|
|
3218
|
+
// UNTOUCHED to plan-DO. It rides through the `...parsed` spread chain
|
|
3219
|
+
// below verbatim; it is NOT routed through the messages→prompt `.join`
|
|
3220
|
+
// normalisation above (which would stringify a structured array — T1).
|
|
3221
|
+
// Keep it on the enriched body if a future refactor narrows the spread.
|
|
2728
3222
|
let enrichedObj = null;
|
|
2729
3223
|
if (anthropicBaseUrl && !parsed.anthropicBaseUrl) enrichedObj = { ...(enrichedObj ?? parsed), anthropicBaseUrl };
|
|
2730
|
-
if (
|
|
3224
|
+
if (
|
|
3225
|
+
dogfoodRepoUrls.length > 0 &&
|
|
3226
|
+
!(Array.isArray(parsed.repoUrls) && parsed.repoUrls.length > 0) &&
|
|
3227
|
+
!parsed.repoUrl
|
|
3228
|
+
) {
|
|
3229
|
+
enrichedObj = { ...(enrichedObj ?? parsed), repoUrls: dogfoodRepoUrls };
|
|
3230
|
+
} else if (dogfoodRepoUrl && !parsed.repoUrl) {
|
|
3231
|
+
enrichedObj = { ...(enrichedObj ?? parsed), repoUrl: dogfoodRepoUrl };
|
|
3232
|
+
}
|
|
2731
3233
|
if (kgProxyUrl && !parsed.kgProxyUrl) enrichedObj = { ...(enrichedObj ?? parsed), kgProxyUrl };
|
|
2732
3234
|
if (kgProxyBearer && !parsed.kgProxyBearer) enrichedObj = { ...(enrichedObj ?? parsed), kgProxyBearer };
|
|
3235
|
+
if (kgWorkspace && !parsed.kgWorkspace) enrichedObj = { ...(enrichedObj ?? parsed), kgWorkspace };
|
|
3236
|
+
// Dynamic chunk-sink: forward the operator's remote (tunnel) host-cp URL
|
|
3237
|
+
// so the CF-Sandbox runner streams chunks back to the host-cp the
|
|
3238
|
+
// operator is watching (live SPA reasoning). body value wins if present.
|
|
3239
|
+
const remoteHostCpUrl = readRemoteHostCpUrl();
|
|
3240
|
+
if (remoteHostCpUrl && !parsed.hostCpUrl) enrichedObj = { ...(enrichedObj ?? parsed), hostCpUrl: remoteHostCpUrl };
|
|
3241
|
+
// Host-cp-independent chunk sink: forward the public plan-DO URL so the
|
|
3242
|
+
// runner posts chunks straight to plan-DO /v1/chunks → Neon → Electric →
|
|
3243
|
+
// SPA (no host-cp in the chunk path). OLAM_CLOUD_URL is plan-DO's URL.
|
|
3244
|
+
if (OLAM_CLOUD_URL && !parsed.chunksSinkUrl) enrichedObj = { ...(enrichedObj ?? parsed), chunksSinkUrl: OLAM_CLOUD_URL };
|
|
3245
|
+
// Always inject idempotencyKey into the body so plan-DO forwards it to the
|
|
3246
|
+
// runner even when the Idempotency-Key header is not propagated.
|
|
3247
|
+
enrichedObj = { ...(enrichedObj ?? parsed), idempotencyKey };
|
|
2733
3248
|
// Use `parsed` (not raw `body`) as the no-enrichment fallback so that the
|
|
2734
3249
|
// messages→prompt normalisation above is always forwarded even when no
|
|
2735
3250
|
// env-var enrichments are applied.
|
|
2736
|
-
const enriched =
|
|
3251
|
+
const enriched = JSON.stringify(enrichedObj);
|
|
2737
3252
|
|
|
2738
3253
|
if (parsed.world_id && parsed.prompt) {
|
|
2739
3254
|
safePersistLastDispatch({
|
|
@@ -2758,6 +3273,7 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2758
3273
|
headers: {
|
|
2759
3274
|
'Authorization': `Basic ${basicAuth}`,
|
|
2760
3275
|
'content-type': 'application/json',
|
|
3276
|
+
'Idempotency-Key': idempotencyKey,
|
|
2761
3277
|
...cfAccessHeaders(),
|
|
2762
3278
|
},
|
|
2763
3279
|
body: enriched,
|
|
@@ -2776,6 +3292,14 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2776
3292
|
}
|
|
2777
3293
|
}
|
|
2778
3294
|
|
|
3295
|
+
// (dispatch-cloud-burst /api/world/<id>/dispatch-cloud-burst is handled earlier,
|
|
3296
|
+
// inside the /api/world/<id>/* block, BEFORE the WORLDS registry check — see above.
|
|
3297
|
+
// The subPath check fires before the WORLDS lookup because cloud-burst does not
|
|
3298
|
+
// require a locally-registered Docker world.)
|
|
3299
|
+
|
|
3300
|
+
// (SPA-driven UAT /api/world/<id>/uat[/status] is handled earlier, inside the
|
|
3301
|
+
// /api/world/<id>/* block, BEFORE the docker per-world proxy — see above.)
|
|
3302
|
+
|
|
2779
3303
|
// /api/plans/create — Gap 3 plan-creation handshake (Phase H h2 v1 dogfood).
|
|
2780
3304
|
//
|
|
2781
3305
|
// Accepts a plan-creation request from the SPA, enriches it with the
|
|
@@ -2808,9 +3332,18 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2808
3332
|
}
|
|
2809
3333
|
|
|
2810
3334
|
// Enrich with anthropicBaseUrl + kgProxy from the host config.
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
3335
|
+
// Note: plans/create always stamps host values (no !parsed.X guard) —
|
|
3336
|
+
// plan-DO needs the authoritative bearer URL, not whatever the SPA sent.
|
|
3337
|
+
// dogfoodRepoUrl is intentionally not forwarded here (plans/create is
|
|
3338
|
+
// a bearer-registration call, not a coding-sandbox dispatch).
|
|
3339
|
+
// kgWorkspace MUST travel with kgProxyUrl/kgProxyBearer: the worker-runner
|
|
3340
|
+
// gates KG on `kgEnabled = Boolean(kgProxyUrl && kgWorkspace)`, and plan-DO
|
|
3341
|
+
// forwards all three onto the sandbox spawn body (plan-agent.ts). Stamping
|
|
3342
|
+
// only 2 of the 3 would send the bearer but leave KG disabled (or silently
|
|
3343
|
+
// fall back to the runner's deploy-time workspace, not the authoritative
|
|
3344
|
+
// host value) — the same drift the other two dispatch sites already avoid.
|
|
3345
|
+
// readHostDispatchConfig() is TTL-cached — see its JSDoc.
|
|
3346
|
+
const { anthropicBaseUrl, kgProxyUrl, kgProxyBearer, kgWorkspace } = readHostDispatchConfig();
|
|
2814
3347
|
const planId = parsed.planId ?? parsed.session_id ?? `plan-${Date.now()}`;
|
|
2815
3348
|
const requestBody = {
|
|
2816
3349
|
...parsed,
|
|
@@ -2818,6 +3351,7 @@ const server = http.createServer(instrumentHandler('host-cp', async (req, res) =
|
|
|
2818
3351
|
...(anthropicBaseUrl ? { anthropicBaseUrl } : {}),
|
|
2819
3352
|
...(kgProxyUrl ? { kgProxyUrl } : {}),
|
|
2820
3353
|
...(kgProxyBearer ? { kgProxyBearer } : {}),
|
|
3354
|
+
...(kgWorkspace ? { kgWorkspace } : {}),
|
|
2821
3355
|
};
|
|
2822
3356
|
|
|
2823
3357
|
const basicAuth = Buffer.from(`operator:${showcasePw}`).toString('base64');
|
|
@@ -3615,6 +4149,18 @@ async function renderSpaShell(filePath, pathname) {
|
|
|
3615
4149
|
// which 404s. Rewrite to absolute `/assets/` so all SPA shell paths
|
|
3616
4150
|
// (/, /worlds, /workspaces, /world/<id>) reference the same bundle.
|
|
3617
4151
|
html = html.replace(/(href|src)="\.\/assets\//g, '$1="/assets/');
|
|
4152
|
+
// Idempotent injection: strip ANY pre-existing bearer / cloud-enabled
|
|
4153
|
+
// bootstrap script before injecting fresh values. A built dist may carry a
|
|
4154
|
+
// STALE baked `<script>window.__OLAM_PLAN_CHAT_BEARER__=...;window.__OLAM_CLOUD_ENABLED__=false;</script>`
|
|
4155
|
+
// (a fixture stamped at build/stage time). Without stripping it, host-cp's
|
|
4156
|
+
// freshly-injected `__OLAM_CLOUD_ENABLED__=true` is OVERRIDDEN by the stale
|
|
4157
|
+
// `=false` that runs second in source order — silently force-disabling Cloud
|
|
4158
|
+
// mode in the browser. Remove any such prior injection first so the
|
|
4159
|
+
// server-resolved values are authoritative.
|
|
4160
|
+
html = html.replace(
|
|
4161
|
+
/<script>window\.__OLAM_(?:PLAN_CHAT_BEARER|CLOUD_ENABLED)__=[^<]*<\/script>/g,
|
|
4162
|
+
'',
|
|
4163
|
+
);
|
|
3618
4164
|
// Inject the bearer right after <head> so window.__OLAM_PLAN_CHAT_BEARER__
|
|
3619
4165
|
// is set before the SPA bundle reads it. No bootstrap shim — see the
|
|
3620
4166
|
// block comment above (Phase E5 cutover).
|
|
@@ -3937,6 +4483,20 @@ server.listen(PORT, '0.0.0.0', () => {
|
|
|
3937
4483
|
} else if (hasShowcasePw && !hasCloudUrl) {
|
|
3938
4484
|
console.warn(' [cloud] OLAM_SHOWCASE_PASSWORD set but OLAM_CLOUD_URL missing — cloud_enabled will be false');
|
|
3939
4485
|
}
|
|
4486
|
+
|
|
4487
|
+
// D.1 — start operator-side long-poll after server is ready.
|
|
4488
|
+
// Only when OLAM_OPSIDE_LONGPOLL=1. Requires OLAM_CLOUD_URL and auth.
|
|
4489
|
+
// Default OFF — byte-for-byte no change when the flag is unset.
|
|
4490
|
+
if (OLAM_OPSIDE_LONGPOLL) {
|
|
4491
|
+
if (!OLAM_CLOUD_URL) {
|
|
4492
|
+
console.warn(' [op-poll] OLAM_OPSIDE_LONGPOLL=1 but OLAM_CLOUD_URL is not set — long-poll disabled');
|
|
4493
|
+
} else if (!OLAM_OPSIDE_LONGPOLL_AUTH) {
|
|
4494
|
+
console.warn(' [op-poll] OLAM_OPSIDE_LONGPOLL=1 but OLAM_SHOWCASE_PASSWORD is not set — long-poll disabled (no auth)');
|
|
4495
|
+
} else {
|
|
4496
|
+
console.log(` [op-poll] starting operator-side long-poll → ${OLAM_CLOUD_URL}/v1/op-poll`);
|
|
4497
|
+
startPoll(OLAM_CLOUD_URL, OLAM_OPSIDE_LONGPOLL_AUTH);
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
3940
4500
|
});
|
|
3941
4501
|
|
|
3942
4502
|
// Graceful shutdown so docker compose down → SIGTERM → flush + close.
|
|
@@ -3945,6 +4505,8 @@ for (const sig of ['SIGTERM', 'SIGINT']) {
|
|
|
3945
4505
|
console.log(`received ${sig}, shutting down`);
|
|
3946
4506
|
stopEvents();
|
|
3947
4507
|
prPoller.stop();
|
|
4508
|
+
// D.1: stop the operator-side long-poll loop if it was started.
|
|
4509
|
+
stopPoll();
|
|
3948
4510
|
// worldsDbReconciler + worldActivityTracker + worldWatchdog are null in SERVE-ONLY mode.
|
|
3949
4511
|
worldsDbReconciler?.stop();
|
|
3950
4512
|
stopWorldsSnapshotLoop();
|