@cleocode/core 2026.6.13 → 2026.6.15
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/dist/admin/ops.d.ts +4 -0
- package/dist/admin/ops.d.ts.map +1 -1
- package/dist/check/index.d.ts +12 -0
- package/dist/check/index.d.ts.map +1 -0
- package/dist/check/index.js +12 -0
- package/dist/check/index.js.map +1 -0
- package/dist/check/pr-gate.d.ts +183 -0
- package/dist/check/pr-gate.d.ts.map +1 -0
- package/dist/check/pr-gate.js +348 -0
- package/dist/check/pr-gate.js.map +1 -0
- package/dist/conduit/delivery-router.d.ts +134 -0
- package/dist/conduit/delivery-router.d.ts.map +1 -0
- package/dist/conduit/delivery-router.js +0 -0
- package/dist/conduit/delivery-router.js.map +1 -0
- package/dist/conduit/index.d.ts +5 -2
- package/dist/conduit/index.d.ts.map +1 -1
- package/dist/conduit/index.js +5 -2
- package/dist/conduit/index.js.map +1 -1
- package/dist/conduit/local-tui-adapter.d.ts +89 -0
- package/dist/conduit/local-tui-adapter.d.ts.map +1 -0
- package/dist/conduit/local-tui-adapter.js +225 -0
- package/dist/conduit/local-tui-adapter.js.map +1 -0
- package/dist/config/config-repair.d.ts +70 -0
- package/dist/config/config-repair.d.ts.map +1 -0
- package/dist/config/config-repair.js +248 -0
- package/dist/config/config-repair.js.map +1 -0
- package/dist/config/registry.d.ts +54 -0
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/registry.js +92 -0
- package/dist/config/registry.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -10
- package/dist/config.js.map +1 -1
- package/dist/deriver/queue-manager.d.ts +30 -2
- package/dist/deriver/queue-manager.d.ts.map +1 -1
- package/dist/deriver/queue-manager.js +54 -9
- package/dist/deriver/queue-manager.js.map +1 -1
- package/dist/dispatch/config-domain-handler.d.ts +125 -0
- package/dist/dispatch/config-domain-handler.d.ts.map +1 -0
- package/dist/dispatch/config-domain-handler.js +160 -0
- package/dist/dispatch/config-domain-handler.js.map +1 -0
- package/dist/dispatch/contracts/input-contracts.d.ts.map +1 -1
- package/dist/dispatch/contracts/input-contracts.js +19 -1
- package/dist/dispatch/contracts/input-contracts.js.map +1 -1
- package/dist/docs/export-document.js +3721 -696
- package/dist/docs/export-document.js.map +3 -3
- package/dist/gateway-client/client.d.ts +123 -0
- package/dist/gateway-client/client.d.ts.map +1 -0
- package/dist/gateway-client/client.js +93 -0
- package/dist/gateway-client/client.js.map +1 -0
- package/dist/gateway-client/generated/client/client.gen.d.ts +3 -0
- package/dist/gateway-client/generated/client/client.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/client/client.gen.js +217 -0
- package/dist/gateway-client/generated/client/client.gen.js.map +1 -0
- package/dist/gateway-client/generated/client/index.d.ts +11 -0
- package/dist/gateway-client/generated/client/index.d.ts.map +1 -0
- package/dist/gateway-client/generated/client/index.js +7 -0
- package/dist/gateway-client/generated/client/index.js.map +1 -0
- package/dist/gateway-client/generated/client/types.gen.d.ts +121 -0
- package/dist/gateway-client/generated/client/types.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/client/types.gen.js +3 -0
- package/dist/gateway-client/generated/client/types.gen.js.map +1 -0
- package/dist/gateway-client/generated/client/utils.gen.d.ts +38 -0
- package/dist/gateway-client/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/client/utils.gen.js +229 -0
- package/dist/gateway-client/generated/client/utils.gen.js.map +1 -0
- package/dist/gateway-client/generated/client.gen.d.ts +13 -0
- package/dist/gateway-client/generated/client.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/client.gen.js +4 -0
- package/dist/gateway-client/generated/client.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/auth.gen.d.ts +26 -0
- package/dist/gateway-client/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/auth.gen.js +15 -0
- package/dist/gateway-client/generated/core/auth.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/bodySerializer.gen.d.ts +26 -0
- package/dist/gateway-client/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/bodySerializer.gen.js +58 -0
- package/dist/gateway-client/generated/core/bodySerializer.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/params.gen.d.ts +44 -0
- package/dist/gateway-client/generated/core/params.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/params.gen.js +101 -0
- package/dist/gateway-client/generated/core/params.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/gateway-client/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/pathSerializer.gen.js +107 -0
- package/dist/gateway-client/generated/core/pathSerializer.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/gateway-client/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/queryKeySerializer.gen.js +93 -0
- package/dist/gateway-client/generated/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/gateway-client/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/serverSentEvents.gen.js +133 -0
- package/dist/gateway-client/generated/core/serverSentEvents.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/types.gen.d.ts +84 -0
- package/dist/gateway-client/generated/core/types.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/types.gen.js +3 -0
- package/dist/gateway-client/generated/core/types.gen.js.map +1 -0
- package/dist/gateway-client/generated/core/utils.gen.d.ts +20 -0
- package/dist/gateway-client/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/core/utils.gen.js +88 -0
- package/dist/gateway-client/generated/core/utils.gen.js.map +1 -0
- package/dist/gateway-client/generated/index.d.ts +3 -0
- package/dist/gateway-client/generated/index.d.ts.map +1 -0
- package/dist/gateway-client/generated/index.js +3 -0
- package/dist/gateway-client/generated/index.js.map +1 -0
- package/dist/gateway-client/generated/namespaces.gen.d.ts +512 -0
- package/dist/gateway-client/generated/namespaces.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/namespaces.gen.js +521 -0
- package/dist/gateway-client/generated/namespaces.gen.js.map +1 -0
- package/dist/gateway-client/generated/sdk.gen.d.ts +1780 -0
- package/dist/gateway-client/generated/sdk.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/sdk.gen.js +3811 -0
- package/dist/gateway-client/generated/sdk.gen.js.map +1 -0
- package/dist/gateway-client/generated/types.gen.d.ts +14681 -0
- package/dist/gateway-client/generated/types.gen.d.ts.map +1 -0
- package/dist/gateway-client/generated/types.gen.js +3 -0
- package/dist/gateway-client/generated/types.gen.js.map +1 -0
- package/dist/gateway-client/index.d.ts +27 -0
- package/dist/gateway-client/index.d.ts.map +1 -0
- package/dist/gateway-client/index.js +25 -0
- package/dist/gateway-client/index.js.map +1 -0
- package/dist/gc/cleanup.d.ts +23 -8
- package/dist/gc/cleanup.d.ts.map +1 -1
- package/dist/gc/cleanup.js +287 -22
- package/dist/gc/cleanup.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +28 -0
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +10 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +18 -1
- package/dist/internal.js.map +1 -1
- package/dist/llm/catalog-model-resolver.d.ts +19 -0
- package/dist/llm/catalog-model-resolver.d.ts.map +1 -1
- package/dist/llm/catalog-model-resolver.js +36 -0
- package/dist/llm/catalog-model-resolver.js.map +1 -1
- package/dist/llm/catalog-resolver.d.ts +112 -0
- package/dist/llm/catalog-resolver.d.ts.map +1 -0
- package/dist/llm/catalog-resolver.js +207 -0
- package/dist/llm/catalog-resolver.js.map +1 -0
- package/dist/llm/catalog-seeder.d.ts +96 -0
- package/dist/llm/catalog-seeder.d.ts.map +1 -0
- package/dist/llm/catalog-seeder.js +189 -0
- package/dist/llm/catalog-seeder.js.map +1 -0
- package/dist/llm/cli-ops.d.ts +16 -0
- package/dist/llm/cli-ops.d.ts.map +1 -1
- package/dist/llm/cli-ops.js +37 -10
- package/dist/llm/cli-ops.js.map +1 -1
- package/dist/llm/complexity-classifier.d.ts +208 -0
- package/dist/llm/complexity-classifier.d.ts.map +1 -0
- package/dist/llm/complexity-classifier.js +359 -0
- package/dist/llm/complexity-classifier.js.map +1 -0
- package/dist/llm/credential-pool.d.ts +2 -0
- package/dist/llm/credential-pool.d.ts.map +1 -1
- package/dist/llm/credential-pool.js +5 -2
- package/dist/llm/credential-pool.js.map +1 -1
- package/dist/llm/credentials-store.d.ts +10 -14
- package/dist/llm/credentials-store.d.ts.map +1 -1
- package/dist/llm/credentials-store.js.map +1 -1
- package/dist/llm/cross-provider-selector.d.ts +249 -0
- package/dist/llm/cross-provider-selector.d.ts.map +1 -0
- package/dist/llm/cross-provider-selector.js +572 -0
- package/dist/llm/cross-provider-selector.js.map +1 -0
- package/dist/llm/entity-ops.d.ts +299 -0
- package/dist/llm/entity-ops.d.ts.map +1 -0
- package/dist/llm/entity-ops.js +441 -0
- package/dist/llm/entity-ops.js.map +1 -0
- package/dist/llm/index.d.ts +17 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +9 -0
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/llm-queue-admit.d.ts +118 -0
- package/dist/llm/llm-queue-admit.d.ts.map +1 -0
- package/dist/llm/llm-queue-admit.js +275 -0
- package/dist/llm/llm-queue-admit.js.map +1 -0
- package/dist/llm/local-model-fit.d.ts +260 -0
- package/dist/llm/local-model-fit.d.ts.map +1 -0
- package/dist/llm/local-model-fit.js +563 -0
- package/dist/llm/local-model-fit.js.map +1 -0
- package/dist/llm/oauth/device-code.d.ts.map +1 -1
- package/dist/llm/oauth/device-code.js +2 -8
- package/dist/llm/oauth/device-code.js.map +1 -1
- package/dist/llm/oauth/google-pkce.d.ts.map +1 -1
- package/dist/llm/oauth/google-pkce.js +2 -18
- package/dist/llm/oauth/google-pkce.js.map +1 -1
- package/dist/llm/oauth/pkce.d.ts +70 -0
- package/dist/llm/oauth/pkce.d.ts.map +1 -1
- package/dist/llm/oauth/pkce.js +106 -29
- package/dist/llm/oauth/pkce.js.map +1 -1
- package/dist/llm/onboarding/front-door.d.ts +146 -0
- package/dist/llm/onboarding/front-door.d.ts.map +1 -0
- package/dist/llm/onboarding/front-door.js +153 -0
- package/dist/llm/onboarding/front-door.js.map +1 -0
- package/dist/llm/onboarding/login-engine.d.ts +175 -0
- package/dist/llm/onboarding/login-engine.d.ts.map +1 -0
- package/dist/llm/onboarding/login-engine.js +286 -0
- package/dist/llm/onboarding/login-engine.js.map +1 -0
- package/dist/llm/pi/pi-gondolin-env.d.ts +23 -0
- package/dist/llm/pi/pi-gondolin-env.d.ts.map +1 -1
- package/dist/llm/pi/pi-gondolin-env.js +2 -2
- package/dist/llm/pi/pi-gondolin-env.js.map +1 -1
- package/dist/llm/plugin-facade.js +4612 -1042
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/provider-registry/builtin/anthropic.d.ts.map +1 -1
- package/dist/llm/provider-registry/builtin/anthropic.js +23 -10
- package/dist/llm/provider-registry/builtin/anthropic.js.map +1 -1
- package/dist/llm/provider-registry/builtin/ollama.d.ts +18 -0
- package/dist/llm/provider-registry/builtin/ollama.d.ts.map +1 -1
- package/dist/llm/provider-registry/builtin/ollama.js +20 -2
- package/dist/llm/provider-registry/builtin/ollama.js.map +1 -1
- package/dist/llm/provider-registry/provider-alias.d.ts +62 -0
- package/dist/llm/provider-registry/provider-alias.d.ts.map +1 -0
- package/dist/llm/provider-registry/provider-alias.js +85 -0
- package/dist/llm/provider-registry/provider-alias.js.map +1 -0
- package/dist/llm/provider-registry/provider-defs.d.ts +45 -0
- package/dist/llm/provider-registry/provider-defs.d.ts.map +1 -0
- package/dist/llm/provider-registry/provider-defs.js +145 -0
- package/dist/llm/provider-registry/provider-defs.js.map +1 -0
- package/dist/llm/provider-registry/provider-seed.d.ts +78 -0
- package/dist/llm/provider-registry/provider-seed.d.ts.map +1 -0
- package/dist/llm/provider-registry/provider-seed.js +113 -0
- package/dist/llm/provider-registry/provider-seed.js.map +1 -0
- package/dist/llm/role-executor.d.ts.map +1 -1
- package/dist/llm/role-executor.js +36 -0
- package/dist/llm/role-executor.js.map +1 -1
- package/dist/llm/role-resolver.d.ts.map +1 -1
- package/dist/llm/role-resolver.js +52 -10
- package/dist/llm/role-resolver.js.map +1 -1
- package/dist/llm/system-resolver.d.ts.map +1 -1
- package/dist/llm/system-resolver.js +73 -22
- package/dist/llm/system-resolver.js.map +1 -1
- package/dist/llm/transports/codex-responses.d.ts +111 -88
- package/dist/llm/transports/codex-responses.d.ts.map +1 -1
- package/dist/llm/transports/codex-responses.js +456 -258
- package/dist/llm/transports/codex-responses.js.map +1 -1
- package/dist/memory/learnings.d.ts +4 -0
- package/dist/memory/learnings.d.ts.map +1 -1
- package/dist/memory/patterns.d.ts +4 -0
- package/dist/memory/patterns.d.ts.map +1 -1
- package/dist/metrics/index.d.ts +2 -0
- package/dist/metrics/index.d.ts.map +1 -1
- package/dist/metrics/index.js +1 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/orchestration/spawn.d.ts +89 -0
- package/dist/orchestration/spawn.d.ts.map +1 -1
- package/dist/orchestration/spawn.js +68 -0
- package/dist/orchestration/spawn.js.map +1 -1
- package/dist/playbooks/cantbook-profile.d.ts +96 -0
- package/dist/playbooks/cantbook-profile.d.ts.map +1 -0
- package/dist/playbooks/cantbook-profile.js +97 -0
- package/dist/playbooks/cantbook-profile.js.map +1 -0
- package/dist/playbooks/guarded-deterministic-runner.d.ts +153 -0
- package/dist/playbooks/guarded-deterministic-runner.d.ts.map +1 -0
- package/dist/playbooks/guarded-deterministic-runner.js +155 -0
- package/dist/playbooks/guarded-deterministic-runner.js.map +1 -0
- package/dist/playbooks/index.d.ts +2 -0
- package/dist/playbooks/index.d.ts.map +1 -1
- package/dist/playbooks/index.js +10 -0
- package/dist/playbooks/index.js.map +1 -1
- package/dist/playbooks/pi-runner-wiring.d.ts +75 -0
- package/dist/playbooks/pi-runner-wiring.d.ts.map +1 -0
- package/dist/playbooks/pi-runner-wiring.js +82 -0
- package/dist/playbooks/pi-runner-wiring.js.map +1 -0
- package/dist/release/index.d.ts +2 -2
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js +1 -1
- package/dist/release/index.js.map +1 -1
- package/dist/release/reconcile.d.ts +97 -0
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +412 -5
- package/dist/release/reconcile.js.map +1 -1
- package/dist/resources/backend.d.ts +155 -0
- package/dist/resources/backend.d.ts.map +1 -0
- package/dist/resources/backend.js +23 -0
- package/dist/resources/backend.js.map +1 -0
- package/dist/resources/linux-backend.d.ts +167 -0
- package/dist/resources/linux-backend.d.ts.map +1 -0
- package/dist/resources/linux-backend.js +259 -0
- package/dist/resources/linux-backend.js.map +1 -0
- package/dist/resources/monitor.d.ts +230 -0
- package/dist/resources/monitor.d.ts.map +1 -0
- package/dist/resources/monitor.js +255 -0
- package/dist/resources/monitor.js.map +1 -0
- package/dist/resources/spawn-wrapper.d.ts +265 -0
- package/dist/resources/spawn-wrapper.d.ts.map +1 -0
- package/dist/resources/spawn-wrapper.js +304 -0
- package/dist/resources/spawn-wrapper.js.map +1 -0
- package/dist/runtime/openapi/generate-openapi.d.ts +211 -0
- package/dist/runtime/openapi/generate-openapi.d.ts.map +1 -0
- package/dist/runtime/openapi/generate-openapi.js +300 -0
- package/dist/runtime/openapi/generate-openapi.js.map +1 -0
- package/dist/runtime/openapi/index.d.ts +16 -0
- package/dist/runtime/openapi/index.d.ts.map +1 -0
- package/dist/runtime/openapi/index.js +16 -0
- package/dist/runtime/openapi/index.js.map +1 -0
- package/dist/selfimprove/budget.d.ts +11 -2
- package/dist/selfimprove/budget.d.ts.map +1 -1
- package/dist/selfimprove/budget.js +11 -2
- package/dist/selfimprove/budget.js.map +1 -1
- package/dist/selfimprove/fix-gen.d.ts +229 -0
- package/dist/selfimprove/fix-gen.d.ts.map +1 -0
- package/dist/selfimprove/fix-gen.js +266 -0
- package/dist/selfimprove/fix-gen.js.map +1 -0
- package/dist/selfimprove/run-loop.d.ts +44 -4
- package/dist/selfimprove/run-loop.d.ts.map +1 -1
- package/dist/selfimprove/run-loop.js +73 -6
- package/dist/selfimprove/run-loop.js.map +1 -1
- package/dist/selfimprove/scenarios/dhq-replay-find/golden.json +32 -0
- package/dist/selfimprove/scenarios/dhq-replay-find/scenario.json +18 -0
- package/dist/sentient/cross-project-hygiene.d.ts +11 -2
- package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
- package/dist/sentient/cross-project-hygiene.js +73 -10
- package/dist/sentient/cross-project-hygiene.js.map +1 -1
- package/dist/sentient/daemon.d.ts.map +1 -1
- package/dist/sentient/daemon.js +7 -2
- package/dist/sentient/daemon.js.map +1 -1
- package/dist/sentient/worktree-dispatch.d.ts.map +1 -1
- package/dist/sentient/worktree-dispatch.js +8 -1
- package/dist/sentient/worktree-dispatch.js.map +1 -1
- package/dist/setup/config-json-merge.d.ts.map +1 -1
- package/dist/setup/config-json-merge.js +14 -0
- package/dist/setup/config-json-merge.js.map +1 -1
- package/dist/setup/index.d.ts +23 -11
- package/dist/setup/index.d.ts.map +1 -1
- package/dist/setup/index.js +25 -12
- package/dist/setup/index.js.map +1 -1
- package/dist/setup/sections/llm.d.ts +28 -1
- package/dist/setup/sections/llm.d.ts.map +1 -1
- package/dist/setup/sections/llm.js +27 -6
- package/dist/setup/sections/llm.js.map +1 -1
- package/dist/setup/sections/models-roles.d.ts +40 -0
- package/dist/setup/sections/models-roles.d.ts.map +1 -0
- package/dist/setup/sections/models-roles.js +219 -0
- package/dist/setup/sections/models-roles.js.map +1 -0
- package/dist/setup/wizard.d.ts +19 -1
- package/dist/setup/wizard.d.ts.map +1 -1
- package/dist/setup/wizard.js.map +1 -1
- package/dist/spawn/branch-lock.d.ts.map +1 -1
- package/dist/spawn/branch-lock.js +7 -1
- package/dist/spawn/branch-lock.js.map +1 -1
- package/dist/store/attachment-repair.d.ts +110 -0
- package/dist/store/attachment-repair.d.ts.map +1 -0
- package/dist/store/attachment-repair.js +326 -0
- package/dist/store/attachment-repair.js.map +1 -0
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +24 -7
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/schedule-schema.d.ts +195 -0
- package/dist/store/schedule-schema.d.ts.map +1 -0
- package/dist/store/schedule-schema.js +84 -0
- package/dist/store/schedule-schema.js.map +1 -0
- package/dist/store/schedule-store.d.ts +144 -0
- package/dist/store/schedule-store.d.ts.map +1 -0
- package/dist/store/schedule-store.js +162 -0
- package/dist/store/schedule-store.js.map +1 -0
- package/dist/store/schema/attachments.d.ts +1 -1
- package/dist/store/schema/cleo-global/index.d.ts +3 -0
- package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/index.js +5 -0
- package/dist/store/schema/cleo-global/index.js.map +1 -1
- package/dist/store/schema/cleo-global/models-catalog.d.ts +359 -0
- package/dist/store/schema/cleo-global/models-catalog.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/models-catalog.js +114 -0
- package/dist/store/schema/cleo-global/models-catalog.js.map +1 -0
- package/dist/store/schema/cleo-global/providers.d.ts +279 -0
- package/dist/store/schema/cleo-global/providers.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/providers.js +94 -0
- package/dist/store/schema/cleo-global/providers.js.map +1 -0
- package/dist/store/schema/cleo-global/services.d.ts +493 -0
- package/dist/store/schema/cleo-global/services.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/services.js +200 -0
- package/dist/store/schema/cleo-global/services.js.map +1 -0
- package/dist/store/schema/cleo-project/docs.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
- package/dist/store/schema/cleo-shared/brain.d.ts +2 -2
- package/dist/store/schema/memory-schema.d.ts +182 -2
- package/dist/store/schema/memory-schema.d.ts.map +1 -1
- package/dist/store/schema/memory-schema.js +111 -2
- package/dist/store/schema/memory-schema.js.map +1 -1
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/service-connections-accessor.d.ts +313 -0
- package/dist/store/service-connections-accessor.d.ts.map +1 -0
- package/dist/store/service-connections-accessor.js +464 -0
- package/dist/store/service-connections-accessor.js.map +1 -0
- package/dist/store/service-host-matcher.d.ts +70 -0
- package/dist/store/service-host-matcher.d.ts.map +1 -0
- package/dist/store/service-host-matcher.js +127 -0
- package/dist/store/service-host-matcher.js.map +1 -0
- package/dist/store/service-injection.d.ts +152 -0
- package/dist/store/service-injection.d.ts.map +1 -0
- package/dist/store/service-injection.js +225 -0
- package/dist/store/service-injection.js.map +1 -0
- package/dist/store/service-oauth.d.ts +287 -0
- package/dist/store/service-oauth.d.ts.map +1 -0
- package/dist/store/service-oauth.js +524 -0
- package/dist/store/service-oauth.js.map +1 -0
- package/dist/store/service-trust-gate.d.ts +164 -0
- package/dist/store/service-trust-gate.d.ts.map +1 -0
- package/dist/store/service-trust-gate.js +122 -0
- package/dist/store/service-trust-gate.js.map +1 -0
- package/dist/store/validation-schemas.d.ts +4 -4
- package/dist/tasks/agent-lifecycle-lane.d.ts +175 -0
- package/dist/tasks/agent-lifecycle-lane.d.ts.map +1 -0
- package/dist/tasks/agent-lifecycle-lane.js +176 -0
- package/dist/tasks/agent-lifecycle-lane.js.map +1 -0
- package/dist/tasks/complete.d.ts +17 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +53 -10
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/depends-waiver-audit.d.ts +52 -0
- package/dist/tasks/depends-waiver-audit.d.ts.map +1 -0
- package/dist/tasks/depends-waiver-audit.js +36 -0
- package/dist/tasks/depends-waiver-audit.js.map +1 -0
- package/dist/tasks/engine-wrap.d.ts +36 -2
- package/dist/tasks/engine-wrap.d.ts.map +1 -1
- package/dist/tasks/engine-wrap.js +44 -2
- package/dist/tasks/engine-wrap.js.map +1 -1
- package/dist/tasks/evidence.d.ts +34 -2
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +293 -35
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +1 -0
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/ops.d.ts +3 -0
- package/dist/tasks/ops.d.ts.map +1 -1
- package/dist/tasks/task-ops.d.ts +1 -1
- package/dist/tasks/task-ops.d.ts.map +1 -1
- package/dist/tasks/task-ops.js +3 -1
- package/dist/tasks/task-ops.js.map +1 -1
- package/dist/tasks/task-reparent.d.ts +90 -0
- package/dist/tasks/task-reparent.d.ts.map +1 -1
- package/dist/tasks/task-reparent.js +171 -0
- package/dist/tasks/task-reparent.js.map +1 -1
- package/dist/tools/builtin-agent-tools.d.ts.map +1 -1
- package/dist/tools/builtin-agent-tools.js +41 -0
- package/dist/tools/builtin-agent-tools.js.map +1 -1
- package/dist/tools/exec-code-agent-tool.d.ts +179 -0
- package/dist/tools/exec-code-agent-tool.d.ts.map +1 -0
- package/dist/tools/exec-code-agent-tool.js +239 -0
- package/dist/tools/exec-code-agent-tool.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +15 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/mcp-agent-tool.d.ts +189 -0
- package/dist/tools/mcp-agent-tool.d.ts.map +1 -0
- package/dist/tools/mcp-agent-tool.js +243 -0
- package/dist/tools/mcp-agent-tool.js.map +1 -0
- package/dist/tools/media-agent-tools.d.ts +105 -0
- package/dist/tools/media-agent-tools.d.ts.map +1 -0
- package/dist/tools/media-agent-tools.js +255 -0
- package/dist/tools/media-agent-tools.js.map +1 -0
- package/dist/tools/memory-agent-tools.d.ts +99 -0
- package/dist/tools/memory-agent-tools.d.ts.map +1 -0
- package/dist/tools/memory-agent-tools.js +190 -0
- package/dist/tools/memory-agent-tools.js.map +1 -0
- package/dist/tools/schedule-agent-tools.d.ts +151 -0
- package/dist/tools/schedule-agent-tools.d.ts.map +1 -0
- package/dist/tools/schedule-agent-tools.js +238 -0
- package/dist/tools/schedule-agent-tools.js.map +1 -0
- package/dist/tools/skill-agent-tool.d.ts +108 -0
- package/dist/tools/skill-agent-tool.d.ts.map +1 -0
- package/dist/tools/skill-agent-tool.js +135 -0
- package/dist/tools/skill-agent-tool.js.map +1 -0
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +17 -1
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/verification/verify-tools.d.ts.map +1 -1
- package/dist/verification/verify-tools.js +5 -6
- package/dist/verification/verify-tools.js.map +1 -1
- package/migrations/drizzle-brain/20260610000001_t10405-bitemporal-network-columns/migration.sql +71 -0
- package/migrations/drizzle-cleo-global/20260609000000_t11937-service-vault/migration.sql +93 -0
- package/migrations/drizzle-cleo-global/20260609010000_t11733-models-catalog/migration.sql +65 -0
- package/migrations/drizzle-cleo-global/20260609020000_t11703-providers/migration.sql +52 -0
- package/migrations/drizzle-cleo-global/20260610000000_t11962-schedules/migration.sql +48 -0
- package/migrations/drizzle-cleo-project/20260610000000_t11962-schedules/migration.sql +48 -0
- package/package.json +33 -13
- package/templates/workflows/release-prepare.yml.tmpl +48 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service host/path → provider matcher (T11940 · M2-W3 · AC1).
|
|
3
|
+
*
|
|
4
|
+
* EP-UNIVERSAL-SERVICE-VAULT (epic T11765 · saga SG-VAULT-CORE T10409). The first
|
|
5
|
+
* half of the injection-at-tool-boundary seam: given the host (and optional path)
|
|
6
|
+
* of an outbound request a harness tool is about to make, resolve which
|
|
7
|
+
* {@link ServiceProviderDef} (and therefore which `service_connections` provider)
|
|
8
|
+
* the request's host belongs to, plus the matching {@link ServiceHostRule} that
|
|
9
|
+
* declares HOW the credential is injected (the {@link HostAuthStrategy}).
|
|
10
|
+
*
|
|
11
|
+
* Pure, side-effect-free, decrypt-free: it consults ONLY the declarative
|
|
12
|
+
* {@link SERVICE_PROVIDERS} registry (frozen DATA in `@cleocode/contracts`). It
|
|
13
|
+
* never opens a DB, never decrypts, never touches the network — so it is NOT a DB
|
|
14
|
+
* chokepoint concern (Gate 3) and carries no credential material.
|
|
15
|
+
*
|
|
16
|
+
* ## Matching model (mirrors onecli `apps.rs::match_host`)
|
|
17
|
+
*
|
|
18
|
+
* `host` matches EXACTLY against `ServiceHostRule.host`, with one well-defined
|
|
19
|
+
* suffix case: a rule host beginning with `.` (or a registry host that is a bare
|
|
20
|
+
* apex like `amazonaws.com`) matches any sub-domain suffix — used for wildcard
|
|
21
|
+
* families like AWS. `pathPrefix`, when present on a rule, further narrows the
|
|
22
|
+
* match to requests whose path starts with it (e.g. the legacy
|
|
23
|
+
* `www.googleapis.com/gmail/` endpoints). When multiple rules match, the MOST
|
|
24
|
+
* SPECIFIC wins: a `pathPrefix` rule beats a host-only rule, and a longer
|
|
25
|
+
* `pathPrefix` beats a shorter one.
|
|
26
|
+
*
|
|
27
|
+
* @module store/service-host-matcher
|
|
28
|
+
* @task T11940
|
|
29
|
+
* @epic T11765
|
|
30
|
+
* @saga T10409
|
|
31
|
+
* @see @cleocode/contracts/vault/service-provider — SERVICE_PROVIDERS + ServiceHostRule
|
|
32
|
+
* @see ./service-injection.ts — the injector that consumes a match to mutate a request
|
|
33
|
+
*/
|
|
34
|
+
import { SERVICE_PROVIDERS, } from '@cleocode/contracts';
|
|
35
|
+
/**
|
|
36
|
+
* Normalize a host: lowercase, strip a trailing dot, strip a `:port` suffix.
|
|
37
|
+
*
|
|
38
|
+
* @param host - The raw host (may carry a port / trailing dot / mixed case).
|
|
39
|
+
* @returns The normalized host for exact / suffix comparison.
|
|
40
|
+
*/
|
|
41
|
+
function normalizeHost(host) {
|
|
42
|
+
const lower = host.trim().toLowerCase().replace(/\.$/, '');
|
|
43
|
+
const colon = lower.indexOf(':');
|
|
44
|
+
return colon === -1 ? lower : lower.slice(0, colon);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Does `requestHost` match a rule's `ruleHost`?
|
|
48
|
+
*
|
|
49
|
+
* Exact match, OR a suffix match when the rule host is an apex domain (no
|
|
50
|
+
* sub-domain label of its own, e.g. `amazonaws.com`) — then any `*.amazonaws.com`
|
|
51
|
+
* host matches. An exact-equality rule host with sub-domain labels
|
|
52
|
+
* (e.g. `api.github.com`) matches ONLY that host.
|
|
53
|
+
*/
|
|
54
|
+
function hostMatches(requestHost, ruleHost) {
|
|
55
|
+
if (requestHost === ruleHost)
|
|
56
|
+
return true;
|
|
57
|
+
// Apex-domain suffix match: a two-label rule host (`amazonaws.com`) matches any
|
|
58
|
+
// deeper sub-domain (`s3.us-east-1.amazonaws.com`). A rule host with three or
|
|
59
|
+
// more labels (`api.github.com`) is treated as exact-only.
|
|
60
|
+
const ruleLabels = ruleHost.split('.');
|
|
61
|
+
if (ruleLabels.length === 2 && requestHost.endsWith(`.${ruleHost}`)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
/** Does a rule's optional `pathPrefix` admit `requestPath`? (absent prefix ⇒ yes) */
|
|
67
|
+
function pathMatches(requestPath, rule) {
|
|
68
|
+
if (rule.pathPrefix === undefined)
|
|
69
|
+
return true;
|
|
70
|
+
return requestPath.startsWith(rule.pathPrefix);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Resolve an outbound request's host (+ optional path) to the matching service
|
|
74
|
+
* provider + host rule, or `null` when no provider claims the host (T11940 AC1).
|
|
75
|
+
*
|
|
76
|
+
* When several rules match (e.g. a host-only rule and a `pathPrefix` rule on the
|
|
77
|
+
* same host), the MOST SPECIFIC wins: a rule with a `pathPrefix` beats one without,
|
|
78
|
+
* and a longer `pathPrefix` beats a shorter one. Among equally-specific matches the
|
|
79
|
+
* first registry entry wins (stable iteration order of {@link SERVICE_PROVIDERS}).
|
|
80
|
+
*
|
|
81
|
+
* @param host - The request host (e.g. `api.github.com`; a `:port` / trailing dot
|
|
82
|
+
* is tolerated).
|
|
83
|
+
* @param path - The request path (defaults to `/`); narrows `pathPrefix` rules.
|
|
84
|
+
* @returns The {@link ServiceHostMatch}, or `null` when no provider matches.
|
|
85
|
+
* @task T11940
|
|
86
|
+
*/
|
|
87
|
+
export function matchServiceHost(host, path = '/') {
|
|
88
|
+
const reqHost = normalizeHost(host);
|
|
89
|
+
const reqPath = path.startsWith('/') ? path : `/${path}`;
|
|
90
|
+
let best = null;
|
|
91
|
+
let bestScore = -1;
|
|
92
|
+
for (const provider of Object.values(SERVICE_PROVIDERS)) {
|
|
93
|
+
for (const rule of provider.hostRules) {
|
|
94
|
+
if (!hostMatches(reqHost, rule.host))
|
|
95
|
+
continue;
|
|
96
|
+
if (!pathMatches(reqPath, rule))
|
|
97
|
+
continue;
|
|
98
|
+
// Specificity score: path-prefixed rules outrank host-only; longer prefix wins.
|
|
99
|
+
const score = rule.pathPrefix === undefined ? 0 : rule.pathPrefix.length;
|
|
100
|
+
if (score > bestScore) {
|
|
101
|
+
bestScore = score;
|
|
102
|
+
best = { provider, rule, strategy: rule.strategy };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return best;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Resolve the matching provider for a full URL string (convenience over
|
|
110
|
+
* {@link matchServiceHost} that parses the URL's host + path).
|
|
111
|
+
*
|
|
112
|
+
* @param url - The absolute request URL (e.g. `https://api.github.com/user`).
|
|
113
|
+
* @returns The {@link ServiceHostMatch}, or `null` when the URL is unparseable or
|
|
114
|
+
* no provider matches.
|
|
115
|
+
* @task T11940
|
|
116
|
+
*/
|
|
117
|
+
export function matchServiceUrl(url) {
|
|
118
|
+
let parsed;
|
|
119
|
+
try {
|
|
120
|
+
parsed = new URL(url);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
return matchServiceHost(parsed.host, parsed.pathname);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=service-host-matcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-host-matcher.js","sourceRoot":"","sources":["../../src/store/service-host-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAEL,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAY7B;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,WAAmB,EAAE,QAAgB;IACxD,IAAI,WAAW,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,gFAAgF;IAChF,8EAA8E;IAC9E,2DAA2D;IAC3D,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC,EAAE,CAAC;QACpE,OAAO,IAAI,C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;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service-credential injection at the harness tool boundary (T11940 · M2-W3).
|
|
3
|
+
*
|
|
4
|
+
* EP-UNIVERSAL-SERVICE-VAULT (epic T11765 · saga SG-VAULT-CORE T10409). The second
|
|
5
|
+
* half of the injection seam: given an outbound HTTP request a harness tool is about
|
|
6
|
+
* to make, resolve the matching service connection, refresh it if expired, and apply
|
|
7
|
+
* the declarative {@link InjectionRule} model — materializing the secret ONLY at the
|
|
8
|
+
* wire inside the sealed handle's `fetch()`.
|
|
9
|
+
*
|
|
10
|
+
* ## NO MITM proxy (AC4)
|
|
11
|
+
*
|
|
12
|
+
* The seam is the IN-PROCESS tool boundary — {@link injectServiceCredentials} is a
|
|
13
|
+
* pure function over a {@link OutboundRequest} descriptor. There is NO CONNECT proxy,
|
|
14
|
+
* no man-in-the-middle process, no port to bind: the harness calls this immediately
|
|
15
|
+
* before it builds its `fetch()`, gets back the mutated headers/URL, and makes the
|
|
16
|
+
* call itself. The function neither performs nor intercepts any network I/O.
|
|
17
|
+
*
|
|
18
|
+
* ## Trust-gated, refresh-first (AC2)
|
|
19
|
+
*
|
|
20
|
+
* Credential resolution delegates to {@link selfHealConnection} (the store's
|
|
21
|
+
* resolve-path): it runs the trust gate FIRST (a denied agent gets `null` with NO
|
|
22
|
+
* decrypt) and transparently REFRESHES a past-expiry token before sealing. Only on a
|
|
23
|
+
* passing gate is a {@link SealedCredential} returned.
|
|
24
|
+
*
|
|
25
|
+
* ## Decrypt-only-at-wire + redaction (AC3)
|
|
26
|
+
*
|
|
27
|
+
* The credential is a {@link SealedCredential}: its `fetch()` is the SOLE decrypt
|
|
28
|
+
* point and is invoked HERE, exactly once, when an injection rule needs the token —
|
|
29
|
+
* the materialized plaintext is consumed in-place to build the header/param value and
|
|
30
|
+
* NEVER bound to a returned field, logged, or serialized. The only credential-derived
|
|
31
|
+
* string that crosses the diagnostic boundary is the non-secret
|
|
32
|
+
* {@link SealedCredential.tokenPreview} ({@link InjectionDiagnostic.tokenPreview}).
|
|
33
|
+
*
|
|
34
|
+
* @module store/service-injection
|
|
35
|
+
* @task T11940
|
|
36
|
+
* @epic T11765
|
|
37
|
+
* @saga T10409
|
|
38
|
+
* @see ./service-host-matcher.ts — host/path → provider resolution (AC1)
|
|
39
|
+
* @see ./service-oauth.ts — `selfHealConnection` (trust-gated, refresh-first sealed resolve)
|
|
40
|
+
* @see ../llm/sealed-credential.ts — `makeSealedCredential` (the shared egress handle)
|
|
41
|
+
*/
|
|
42
|
+
import type { HostAuthStrategy, InjectionRule } from '@cleocode/contracts';
|
|
43
|
+
import { type ServiceOAuthDeps } from './service-oauth.js';
|
|
44
|
+
/**
|
|
45
|
+
* The mutable outbound-request descriptor the injector reads and rewrites. The
|
|
46
|
+
* harness builds this from the request it is about to make; after injection it
|
|
47
|
+
* uses the (possibly rewritten) `url` + `headers` to call `fetch()`.
|
|
48
|
+
*/
|
|
49
|
+
export interface OutboundRequest {
|
|
50
|
+
/** The absolute request URL (host + path drive provider matching). */
|
|
51
|
+
readonly url: string;
|
|
52
|
+
/** The request headers (case-insensitive on the wire; stored case-preserving). */
|
|
53
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
54
|
+
}
|
|
55
|
+
/** The header/URL mutations an injection produced (the rewritten request). */
|
|
56
|
+
export interface InjectedRequest {
|
|
57
|
+
/** The (possibly rewritten) request URL — `set-param` rules add query params. */
|
|
58
|
+
readonly url: string;
|
|
59
|
+
/** The rewritten request headers with the credential injected. */
|
|
60
|
+
readonly headers: Record<string, string>;
|
|
61
|
+
}
|
|
62
|
+
/** A NON-SECRET diagnostic describing what an injection did (safe to log). */
|
|
63
|
+
export interface InjectionDiagnostic {
|
|
64
|
+
/** The matched provider key (e.g. `github`), or `null` when no provider matched. */
|
|
65
|
+
readonly provider: string | null;
|
|
66
|
+
/** The connection label that was injected, or `null` when none. */
|
|
67
|
+
readonly label: string | null;
|
|
68
|
+
/** The injection strategy applied, or `null` when no provider matched. */
|
|
69
|
+
readonly strategy: HostAuthStrategy | null;
|
|
70
|
+
/**
|
|
71
|
+
* The NON-SECRET redacted token preview ({@link SealedCredential.tokenPreview}) —
|
|
72
|
+
* the ONLY credential-derived string permitted to cross a logging/diagnostic
|
|
73
|
+
* boundary (≤ last 4 chars). `null` when no credential was injected.
|
|
74
|
+
*/
|
|
75
|
+
readonly tokenPreview: string | null;
|
|
76
|
+
/** Whether a transparent refresh fired before injection. */
|
|
77
|
+
readonly refreshed: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** The result of {@link injectServiceCredentials}. */
|
|
80
|
+
export interface InjectionResult {
|
|
81
|
+
/**
|
|
82
|
+
* Whether a credential was injected. `false` when no provider claims the host, or
|
|
83
|
+
* the agent's trust gate denied / the connection is missing-or-uncredentialed —
|
|
84
|
+
* in which case `request` is the ORIGINAL request, untouched.
|
|
85
|
+
*/
|
|
86
|
+
readonly injected: boolean;
|
|
87
|
+
/** The (possibly rewritten) request — mutated only when {@link injected}. */
|
|
88
|
+
readonly request: InjectedRequest;
|
|
89
|
+
/** A non-secret diagnostic (safe to log). */
|
|
90
|
+
readonly diagnostic: InjectionDiagnostic;
|
|
91
|
+
}
|
|
92
|
+
/** Parameters for {@link injectServiceCredentials}. */
|
|
93
|
+
export interface InjectServiceCredentialsParams {
|
|
94
|
+
/** The agent making the outbound request (trust-gated). */
|
|
95
|
+
readonly agentId: string;
|
|
96
|
+
/** The outbound request descriptor to inject into. */
|
|
97
|
+
readonly request: OutboundRequest;
|
|
98
|
+
/**
|
|
99
|
+
* The connection label to use for the matched provider (defaults to `'default'`).
|
|
100
|
+
* A provider can have several labelled connections; the caller selects which.
|
|
101
|
+
*/
|
|
102
|
+
readonly label?: string;
|
|
103
|
+
/** Out-of-band manual-approval flag forwarded to the trust gate. */
|
|
104
|
+
readonly approved?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Seconds of pre-expiry headroom at which to refresh (forwarded to
|
|
107
|
+
* {@link selfHealConnection}). Defaults to 0 (refresh only once past expiry).
|
|
108
|
+
*/
|
|
109
|
+
readonly skewSeconds?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Translate a host rule's {@link HostAuthStrategy} into the concrete
|
|
113
|
+
* {@link InjectionRule} list applied for a matched request.
|
|
114
|
+
*
|
|
115
|
+
* This is the SSoT mapping strategy → injection actions:
|
|
116
|
+
* - `bearer` — `Authorization: Bearer <token>` (overwrite any existing auth).
|
|
117
|
+
* - `basic-x-access-token` — `Authorization: Basic base64("x-access-token:<token>")`
|
|
118
|
+
* (GitHub git-over-HTTPS).
|
|
119
|
+
* - `header` — the token goes via a named header rather than `Authorization`; the
|
|
120
|
+
* concrete header is provider-declared (`credentialHeaders`), so here we still
|
|
121
|
+
* set `Authorization: Bearer` as the safe default and let a provider that needs a
|
|
122
|
+
* custom header carry it via its `credentialHeaders` (a later breadth task wires
|
|
123
|
+
* those). All three strategies first strip a stale `Authorization` the tool may
|
|
124
|
+
* have emitted (`remove-header`) so the vault credential is authoritative.
|
|
125
|
+
*
|
|
126
|
+
* @param strategy - The matched host rule's injection strategy.
|
|
127
|
+
* @returns The ordered injection actions.
|
|
128
|
+
*/
|
|
129
|
+
export declare function injectionRulesForStrategy(strategy: HostAuthStrategy): readonly InjectionRule[];
|
|
130
|
+
/**
|
|
131
|
+
* Resolve + inject a service credential into an outbound request at the tool
|
|
132
|
+
* boundary (T11940 · AC1–AC4).
|
|
133
|
+
*
|
|
134
|
+
* Flow:
|
|
135
|
+
* 1. Match the request URL's host/path to a provider ({@link matchServiceUrl}).
|
|
136
|
+
* No match → return the original request untouched (`injected: false`).
|
|
137
|
+
* 2. Resolve the connection via {@link selfHealConnection} — trust-gated +
|
|
138
|
+
* refresh-first. Denied / missing / uncredentialed → original request untouched.
|
|
139
|
+
* 3. Materialize the token ONCE at the wire (`sealed.fetch()`) and apply the
|
|
140
|
+
* {@link injectionRulesForStrategy} rule list to a COPY of the headers + a
|
|
141
|
+
* parsed URL. The plaintext is consumed in-place; only the non-secret
|
|
142
|
+
* {@link SealedCredential.tokenPreview} reaches the diagnostic.
|
|
143
|
+
*
|
|
144
|
+
* @param params - The agent, request, label, and refresh knobs.
|
|
145
|
+
* @param deps - Injectable OAuth/clock/vault deps (test seam; a fake vault proves
|
|
146
|
+
* injection + redaction without a real `cleo.db` or network).
|
|
147
|
+
* @returns The {@link InjectionResult} — the (possibly rewritten) request + a
|
|
148
|
+
* non-secret diagnostic.
|
|
149
|
+
* @task T11940
|
|
150
|
+
*/
|
|
151
|
+
export declare function injectServiceCredentials(params: InjectServiceCredentialsParams, deps?: ServiceOAuthDeps): Promise<InjectionResult>;
|
|
152
|
+
//# sourceMappingURL=service-injection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-injection.d.ts","sourceRoot":"","sources":["../../src/store/service-injection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,QAAQ,CAAC,OA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,CAAC;CAC/B;AAKD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,aAAa,EAAE,CAM9F;AAqED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,8BAA8B,EACtC,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,eAAe,CAAC,CA0E1B"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service-credential injection at the harness tool boundary (T11940 · M2-W3).
|
|
3
|
+
*
|
|
4
|
+
* EP-UNIVERSAL-SERVICE-VAULT (epic T11765 · saga SG-VAULT-CORE T10409). The second
|
|
5
|
+
* half of the injection seam: given an outbound HTTP request a harness tool is about
|
|
6
|
+
* to make, resolve the matching service connection, refresh it if expired, and apply
|
|
7
|
+
* the declarative {@link InjectionRule} model — materializing the secret ONLY at the
|
|
8
|
+
* wire inside the sealed handle's `fetch()`.
|
|
9
|
+
*
|
|
10
|
+
* ## NO MITM proxy (AC4)
|
|
11
|
+
*
|
|
12
|
+
* The seam is the IN-PROCESS tool boundary — {@link injectServiceCredentials} is a
|
|
13
|
+
* pure function over a {@link OutboundRequest} descriptor. There is NO CONNECT proxy,
|
|
14
|
+
* no man-in-the-middle process, no port to bind: the harness calls this immediately
|
|
15
|
+
* before it builds its `fetch()`, gets back the mutated headers/URL, and makes the
|
|
16
|
+
* call itself. The function neither performs nor intercepts any network I/O.
|
|
17
|
+
*
|
|
18
|
+
* ## Trust-gated, refresh-first (AC2)
|
|
19
|
+
*
|
|
20
|
+
* Credential resolution delegates to {@link selfHealConnection} (the store's
|
|
21
|
+
* resolve-path): it runs the trust gate FIRST (a denied agent gets `null` with NO
|
|
22
|
+
* decrypt) and transparently REFRESHES a past-expiry token before sealing. Only on a
|
|
23
|
+
* passing gate is a {@link SealedCredential} returned.
|
|
24
|
+
*
|
|
25
|
+
* ## Decrypt-only-at-wire + redaction (AC3)
|
|
26
|
+
*
|
|
27
|
+
* The credential is a {@link SealedCredential}: its `fetch()` is the SOLE decrypt
|
|
28
|
+
* point and is invoked HERE, exactly once, when an injection rule needs the token —
|
|
29
|
+
* the materialized plaintext is consumed in-place to build the header/param value and
|
|
30
|
+
* NEVER bound to a returned field, logged, or serialized. The only credential-derived
|
|
31
|
+
* string that crosses the diagnostic boundary is the non-secret
|
|
32
|
+
* {@link SealedCredential.tokenPreview} ({@link InjectionDiagnostic.tokenPreview}).
|
|
33
|
+
*
|
|
34
|
+
* @module store/service-injection
|
|
35
|
+
* @task T11940
|
|
36
|
+
* @epic T11765
|
|
37
|
+
* @saga T10409
|
|
38
|
+
* @see ./service-host-matcher.ts — host/path → provider resolution (AC1)
|
|
39
|
+
* @see ./service-oauth.ts — `selfHealConnection` (trust-gated, refresh-first sealed resolve)
|
|
40
|
+
* @see ../llm/sealed-credential.ts — `makeSealedCredential` (the shared egress handle)
|
|
41
|
+
*/
|
|
42
|
+
import { matchServiceUrl } from './service-host-matcher.js';
|
|
43
|
+
import { selfHealConnection, } from './service-oauth.js';
|
|
44
|
+
/** The default connection label when the caller does not specify one. */
|
|
45
|
+
const DEFAULT_LABEL = 'default';
|
|
46
|
+
/**
|
|
47
|
+
* Translate a host rule's {@link HostAuthStrategy} into the concrete
|
|
48
|
+
* {@link InjectionRule} list applied for a matched request.
|
|
49
|
+
*
|
|
50
|
+
* This is the SSoT mapping strategy → injection actions:
|
|
51
|
+
* - `bearer` — `Authorization: Bearer <token>` (overwrite any existing auth).
|
|
52
|
+
* - `basic-x-access-token` — `Authorization: Basic base64("x-access-token:<token>")`
|
|
53
|
+
* (GitHub git-over-HTTPS).
|
|
54
|
+
* - `header` — the token goes via a named header rather than `Authorization`; the
|
|
55
|
+
* concrete header is provider-declared (`credentialHeaders`), so here we still
|
|
56
|
+
* set `Authorization: Bearer` as the safe default and let a provider that needs a
|
|
57
|
+
* custom header carry it via its `credentialHeaders` (a later breadth task wires
|
|
58
|
+
* those). All three strategies first strip a stale `Authorization` the tool may
|
|
59
|
+
* have emitted (`remove-header`) so the vault credential is authoritative.
|
|
60
|
+
*
|
|
61
|
+
* @param strategy - The matched host rule's injection strategy.
|
|
62
|
+
* @returns The ordered injection actions.
|
|
63
|
+
*/
|
|
64
|
+
export function injectionRulesForStrategy(strategy) {
|
|
65
|
+
// Always strip any stale Authorization the tool emitted, then set the vault one.
|
|
66
|
+
return [
|
|
67
|
+
{ kind: 'remove-header', name: 'Authorization' },
|
|
68
|
+
{ kind: 'set-header', name: 'Authorization', valueSource: 'token', framing: strategy },
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/** Build the framed `Authorization` value for a token under a host strategy. */
|
|
72
|
+
function frameToken(token, framing) {
|
|
73
|
+
switch (framing) {
|
|
74
|
+
case 'basic-x-access-token': {
|
|
75
|
+
const basic = Buffer.from(`x-access-token:${token}`, 'utf8').toString('base64');
|
|
76
|
+
return `Basic ${basic}`;
|
|
77
|
+
}
|
|
78
|
+
default:
|
|
79
|
+
// `bearer`, `header` (default), and an absent framing all bearer-frame.
|
|
80
|
+
return `Bearer ${token}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Find a header key case-insensitively; returns the existing key or `undefined`. */
|
|
84
|
+
function findHeaderKey(headers, name) {
|
|
85
|
+
const lower = name.toLowerCase();
|
|
86
|
+
for (const key of Object.keys(headers)) {
|
|
87
|
+
if (key.toLowerCase() === lower)
|
|
88
|
+
return key;
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Apply one injection rule to a header bag + URL, materializing the token from the
|
|
94
|
+
* sealed handle ONLY when a value-bearing rule needs it.
|
|
95
|
+
*
|
|
96
|
+
* The plaintext token (when materialized) lives ONLY as the local `token` binding
|
|
97
|
+
* for the duration of this call and is consumed in-place into the header/param —
|
|
98
|
+
* it is never returned, logged, or stored.
|
|
99
|
+
*/
|
|
100
|
+
function applyRule(rule, headers, url, token) {
|
|
101
|
+
switch (rule.kind) {
|
|
102
|
+
case 'remove-header': {
|
|
103
|
+
const existing = findHeaderKey(headers, rule.name);
|
|
104
|
+
if (existing !== undefined)
|
|
105
|
+
delete headers[existing];
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
case 'set-header': {
|
|
109
|
+
const existing = findHeaderKey(headers, rule.name);
|
|
110
|
+
const value = rule.valueSource === 'token' ? frameToken(token, rule.framing) : token;
|
|
111
|
+
if (existing !== undefined)
|
|
112
|
+
delete headers[existing];
|
|
113
|
+
headers[rule.name] = value;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
case 'replace-header': {
|
|
117
|
+
const existing = findHeaderKey(headers, rule.name);
|
|
118
|
+
if (existing === undefined)
|
|
119
|
+
return; // only replace a present header
|
|
120
|
+
headers[existing] = rule.valueSource === 'token' ? frameToken(token, rule.framing) : token;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
case 'set-param': {
|
|
124
|
+
url.searchParams.set(rule.name, token);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Whether the rule set contains any value-bearing rule (needs a materialized token). */
|
|
130
|
+
function needsToken(rules) {
|
|
131
|
+
return rules.some((r) => r.kind !== 'remove-header');
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Resolve + inject a service credential into an outbound request at the tool
|
|
135
|
+
* boundary (T11940 · AC1–AC4).
|
|
136
|
+
*
|
|
137
|
+
* Flow:
|
|
138
|
+
* 1. Match the request URL's host/path to a provider ({@link matchServiceUrl}).
|
|
139
|
+
* No match → return the original request untouched (`injected: false`).
|
|
140
|
+
* 2. Resolve the connection via {@link selfHealConnection} — trust-gated +
|
|
141
|
+
* refresh-first. Denied / missing / uncredentialed → original request untouched.
|
|
142
|
+
* 3. Materialize the token ONCE at the wire (`sealed.fetch()`) and apply the
|
|
143
|
+
* {@link injectionRulesForStrategy} rule list to a COPY of the headers + a
|
|
144
|
+
* parsed URL. The plaintext is consumed in-place; only the non-secret
|
|
145
|
+
* {@link SealedCredential.tokenPreview} reaches the diagnostic.
|
|
146
|
+
*
|
|
147
|
+
* @param params - The agent, request, label, and refresh knobs.
|
|
148
|
+
* @param deps - Injectable OAuth/clock/vault deps (test seam; a fake vault proves
|
|
149
|
+
* injection + redaction without a real `cleo.db` or network).
|
|
150
|
+
* @returns The {@link InjectionResult} — the (possibly rewritten) request + a
|
|
151
|
+
* non-secret diagnostic.
|
|
152
|
+
* @task T11940
|
|
153
|
+
*/
|
|
154
|
+
export async function injectServiceCredentials(params, deps = {}) {
|
|
155
|
+
const label = params.label ?? DEFAULT_LABEL;
|
|
156
|
+
const originalRequest = {
|
|
157
|
+
url: params.request.url,
|
|
158
|
+
headers: { ...params.request.headers },
|
|
159
|
+
};
|
|
160
|
+
// 1. Match the host/path to a provider.
|
|
161
|
+
const match = matchServiceUrl(params.request.url);
|
|
162
|
+
if (match === null) {
|
|
163
|
+
return {
|
|
164
|
+
injected: false,
|
|
165
|
+
request: originalRequest,
|
|
166
|
+
diagnostic: {
|
|
167
|
+
provider: null,
|
|
168
|
+
label: null,
|
|
169
|
+
strategy: null,
|
|
170
|
+
tokenPreview: null,
|
|
171
|
+
refreshed: false,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
// 2. Resolve the connection — trust-gated + refresh-first (sealed on allow).
|
|
176
|
+
const healOptions = {
|
|
177
|
+
agentId: params.agentId,
|
|
178
|
+
provider: match.provider.provider,
|
|
179
|
+
label,
|
|
180
|
+
...(params.approved !== undefined ? { approved: params.approved } : {}),
|
|
181
|
+
...(params.skewSeconds !== undefined ? { skewSeconds: params.skewSeconds } : {}),
|
|
182
|
+
};
|
|
183
|
+
const heal = await selfHealConnection(healOptions, deps);
|
|
184
|
+
const sealed = heal.sealed;
|
|
185
|
+
if (sealed === null) {
|
|
186
|
+
// Denied / missing / uncredentialed — leave the request untouched.
|
|
187
|
+
return {
|
|
188
|
+
injected: false,
|
|
189
|
+
request: originalRequest,
|
|
190
|
+
diagnostic: {
|
|
191
|
+
provider: match.provider.provider,
|
|
192
|
+
label,
|
|
193
|
+
strategy: match.strategy,
|
|
194
|
+
tokenPreview: null,
|
|
195
|
+
refreshed: heal.refreshed,
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
// 3. Apply the strategy's injection rules. Materialize the token at the wire ONCE
|
|
200
|
+
// (the SOLE decrypt point) and consume it in-place; it never escapes this scope.
|
|
201
|
+
const rules = injectionRulesForStrategy(match.strategy);
|
|
202
|
+
const headers = { ...params.request.headers };
|
|
203
|
+
const url = new URL(params.request.url);
|
|
204
|
+
let token = '';
|
|
205
|
+
if (needsToken(rules)) {
|
|
206
|
+
const decrypted = await sealed.fetch();
|
|
207
|
+
token = decrypted.value;
|
|
208
|
+
}
|
|
209
|
+
for (const rule of rules) {
|
|
210
|
+
applyRule(rule, headers, url, token);
|
|
211
|
+
}
|
|
212
|
+
// The local `token` goes out of scope here — never returned or logged.
|
|
213
|
+
return {
|
|
214
|
+
injected: true,
|
|
215
|
+
request: { url: url.toString(), headers },
|
|
216
|
+
diagnostic: {
|
|
217
|
+
provider: match.provider.provider,
|
|
218
|
+
label,
|
|
219
|
+
strategy: match.strategy,
|
|
220
|
+
tokenPreview: sealed.tokenPreview,
|
|
221
|
+
refreshed: heal.refreshed,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=service-injection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-injection.js","sourceRoot":"","sources":["../../src/store/service-injection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,EAAE,eAAe,EAAyB,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAGL,kBAAkB,GACnB,MAAM,oBAAoB,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