@cleocode/core 2026.6.12 → 2026.6.13
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/conduit/local-transport.d.ts +12 -0
- package/dist/conduit/local-transport.d.ts.map +1 -1
- package/dist/conduit/local-transport.js +53 -23
- package/dist/conduit/local-transport.js.map +1 -1
- package/dist/crypto/credentials.d.ts +37 -0
- package/dist/crypto/credentials.d.ts.map +1 -1
- package/dist/crypto/credentials.js +110 -0
- package/dist/crypto/credentials.js.map +1 -1
- package/dist/dispatch/contracts/derive-output-contract.d.ts +86 -0
- package/dist/dispatch/contracts/derive-output-contract.d.ts.map +1 -0
- package/dist/dispatch/contracts/derive-output-contract.js +347 -0
- package/dist/dispatch/contracts/derive-output-contract.js.map +1 -0
- package/dist/dispatch/contracts/ensures-schema.d.ts +77 -0
- package/dist/dispatch/contracts/ensures-schema.d.ts.map +1 -0
- package/dist/dispatch/contracts/ensures-schema.js +91 -0
- package/dist/dispatch/contracts/ensures-schema.js.map +1 -0
- package/dist/dispatch/contracts/output-contracts.d.ts +27 -5
- package/dist/dispatch/contracts/output-contracts.d.ts.map +1 -1
- package/dist/dispatch/contracts/output-contracts.js +29 -6
- package/dist/dispatch/contracts/output-contracts.js.map +1 -1
- package/dist/docs/export-document.js +2294 -1250
- package/dist/docs/export-document.js.map +3 -3
- package/dist/go/driver.d.ts +132 -7
- package/dist/go/driver.d.ts.map +1 -1
- package/dist/go/driver.js +135 -10
- package/dist/go/driver.js.map +1 -1
- package/dist/go/index.d.ts +1 -1
- package/dist/go/index.d.ts.map +1 -1
- package/dist/go/index.js +1 -1
- package/dist/go/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +13 -10
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +11 -11
- package/dist/internal.js.map +1 -1
- package/dist/lifecycle/engine-ops.d.ts.map +1 -1
- package/dist/lifecycle/engine-ops.js +7 -4
- package/dist/lifecycle/engine-ops.js.map +1 -1
- package/dist/lifecycle/ivtr-loop.d.ts +108 -183
- package/dist/lifecycle/ivtr-loop.d.ts.map +1 -1
- package/dist/lifecycle/ivtr-loop.js +207 -522
- package/dist/lifecycle/ivtr-loop.js.map +1 -1
- package/dist/llm/auxiliary-fallback.js +1 -1
- package/dist/llm/auxiliary-fallback.js.map +1 -1
- package/dist/llm/cli-ops.d.ts +14 -1
- package/dist/llm/cli-ops.d.ts.map +1 -1
- package/dist/llm/cli-ops.js +41 -12
- package/dist/llm/cli-ops.js.map +1 -1
- package/dist/llm/concrete-session.d.ts.map +1 -1
- package/dist/llm/concrete-session.js +4 -0
- package/dist/llm/concrete-session.js.map +1 -1
- package/dist/llm/credentials.d.ts +35 -0
- package/dist/llm/credentials.d.ts.map +1 -1
- package/dist/llm/credentials.js +49 -0
- package/dist/llm/credentials.js.map +1 -1
- package/dist/llm/index.d.ts +4 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +4 -0
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/pi/gondolin-loader.d.ts +241 -0
- package/dist/llm/pi/gondolin-loader.d.ts.map +1 -0
- package/dist/llm/pi/gondolin-loader.js +195 -0
- package/dist/llm/pi/gondolin-loader.js.map +1 -0
- package/dist/llm/pi/index.d.ts +28 -0
- package/dist/llm/pi/index.d.ts.map +1 -0
- package/dist/llm/pi/index.js +27 -0
- package/dist/llm/pi/index.js.map +1 -0
- package/dist/llm/pi/pi-agent-adapter.d.ts +135 -0
- package/dist/llm/pi/pi-agent-adapter.d.ts.map +1 -0
- package/dist/llm/pi/pi-agent-adapter.js +329 -0
- package/dist/llm/pi/pi-agent-adapter.js.map +1 -0
- package/dist/llm/pi/pi-errors.d.ts +161 -0
- package/dist/llm/pi/pi-errors.d.ts.map +1 -0
- package/dist/llm/pi/pi-errors.js +296 -0
- package/dist/llm/pi/pi-errors.js.map +1 -0
- package/dist/llm/pi/pi-execution-env.d.ts +286 -0
- package/dist/llm/pi/pi-execution-env.d.ts.map +1 -0
- package/dist/llm/pi/pi-execution-env.js +406 -0
- package/dist/llm/pi/pi-execution-env.js.map +1 -0
- package/dist/llm/pi/pi-gondolin-env.d.ts +227 -0
- package/dist/llm/pi/pi-gondolin-env.d.ts.map +1 -0
- package/dist/llm/pi/pi-gondolin-env.js +541 -0
- package/dist/llm/pi/pi-gondolin-env.js.map +1 -0
- package/dist/llm/pi/pi-session-storage.d.ts +154 -0
- package/dist/llm/pi/pi-session-storage.d.ts.map +1 -0
- package/dist/llm/pi/pi-session-storage.js +314 -0
- package/dist/llm/pi/pi-session-storage.js.map +1 -0
- package/dist/llm/pi/pi-stream-fn.d.ts +124 -0
- package/dist/llm/pi/pi-stream-fn.d.ts.map +1 -0
- package/dist/llm/pi/pi-stream-fn.js +504 -0
- package/dist/llm/pi/pi-stream-fn.js.map +1 -0
- package/dist/llm/pi/pi-tool-bridge.d.ts +99 -0
- package/dist/llm/pi/pi-tool-bridge.d.ts.map +1 -0
- package/dist/llm/pi/pi-tool-bridge.js +117 -0
- package/dist/llm/pi/pi-tool-bridge.js.map +1 -0
- package/dist/llm/pi/pi-types.d.ts +56 -0
- package/dist/llm/pi/pi-types.d.ts.map +1 -0
- package/dist/llm/pi/pi-types.js +16 -0
- package/dist/llm/pi/pi-types.js.map +1 -0
- package/dist/llm/pi/resolve-execution-env.d.ts +194 -0
- package/dist/llm/pi/resolve-execution-env.d.ts.map +1 -0
- package/dist/llm/pi/resolve-execution-env.js +132 -0
- package/dist/llm/pi/resolve-execution-env.js.map +1 -0
- package/dist/llm/plugin-facade.js +2253 -1151
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/role-executor.d.ts.map +1 -1
- package/dist/llm/role-executor.js +8 -5
- package/dist/llm/role-executor.js.map +1 -1
- package/dist/llm/role-resolver.d.ts +46 -14
- package/dist/llm/role-resolver.d.ts.map +1 -1
- package/dist/llm/role-resolver.js +178 -20
- package/dist/llm/role-resolver.js.map +1 -1
- package/dist/llm/sealed-credential.d.ts +125 -0
- package/dist/llm/sealed-credential.d.ts.map +1 -0
- package/dist/llm/sealed-credential.js +133 -0
- package/dist/llm/sealed-credential.js.map +1 -0
- package/dist/llm/session-factory.d.ts.map +1 -1
- package/dist/llm/session-factory.js +6 -2
- package/dist/llm/session-factory.js.map +1 -1
- package/dist/llm/system-key.d.ts +67 -0
- package/dist/llm/system-key.d.ts.map +1 -0
- package/dist/llm/system-key.js +87 -0
- package/dist/llm/system-key.js.map +1 -0
- package/dist/llm/system-of-use-registry.d.ts +119 -0
- package/dist/llm/system-of-use-registry.d.ts.map +1 -0
- package/dist/llm/system-of-use-registry.js +200 -0
- package/dist/llm/system-of-use-registry.js.map +1 -0
- package/dist/llm/system-resolver.d.ts +32 -10
- package/dist/llm/system-resolver.d.ts.map +1 -1
- package/dist/llm/system-resolver.js +70 -18
- package/dist/llm/system-resolver.js.map +1 -1
- package/dist/memory/brain-writer-thread.d.ts.map +1 -1
- package/dist/memory/brain-writer-thread.js +116 -11
- package/dist/memory/brain-writer-thread.js.map +1 -1
- package/dist/memory/claude-mem-migration.d.ts.map +1 -1
- package/dist/memory/claude-mem-migration.js +21 -0
- package/dist/memory/claude-mem-migration.js.map +1 -1
- package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
- package/dist/memory/graph-memory-bridge.js +32 -25
- package/dist/memory/graph-memory-bridge.js.map +1 -1
- package/dist/memory/llm-backend-resolver.js +23 -5
- package/dist/memory/llm-backend-resolver.js.map +1 -1
- package/dist/nexus/migrations/M-split-graph.d.ts.map +1 -1
- package/dist/nexus/migrations/M-split-graph.js +60 -53
- package/dist/nexus/migrations/M-split-graph.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +20 -2
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/release/engine-ops.js +2 -2
- package/dist/release/engine-ops.js.map +1 -1
- package/dist/routing/capability-matrix.d.ts.map +1 -1
- package/dist/routing/capability-matrix.js +0 -57
- package/dist/routing/capability-matrix.js.map +1 -1
- package/dist/selfimprove/budget.d.ts +206 -0
- package/dist/selfimprove/budget.d.ts.map +1 -0
- package/dist/selfimprove/budget.js +203 -0
- package/dist/selfimprove/budget.js.map +1 -0
- package/dist/selfimprove/dhq-adapter.d.ts +105 -0
- package/dist/selfimprove/dhq-adapter.d.ts.map +1 -0
- package/dist/selfimprove/dhq-adapter.js +95 -0
- package/dist/selfimprove/dhq-adapter.js.map +1 -0
- package/dist/selfimprove/draft-pr.d.ts +129 -0
- package/dist/selfimprove/draft-pr.d.ts.map +1 -0
- package/dist/selfimprove/draft-pr.js +158 -0
- package/dist/selfimprove/draft-pr.js.map +1 -0
- package/dist/selfimprove/envelope-diff.d.ts +162 -0
- package/dist/selfimprove/envelope-diff.d.ts.map +1 -0
- package/dist/selfimprove/envelope-diff.js +321 -0
- package/dist/selfimprove/envelope-diff.js.map +1 -0
- package/dist/selfimprove/replay.d.ts +121 -0
- package/dist/selfimprove/replay.d.ts.map +1 -0
- package/dist/selfimprove/replay.js +109 -0
- package/dist/selfimprove/replay.js.map +1 -0
- package/dist/selfimprove/run-loop.d.ts +148 -0
- package/dist/selfimprove/run-loop.d.ts.map +1 -0
- package/dist/selfimprove/run-loop.js +240 -0
- package/dist/selfimprove/run-loop.js.map +1 -0
- package/dist/selfimprove/scenario.d.ts +145 -0
- package/dist/selfimprove/scenario.d.ts.map +1 -0
- package/dist/selfimprove/scenario.js +243 -0
- package/dist/selfimprove/scenario.js.map +1 -0
- package/dist/sentient/daemon-entry.js +5 -0
- package/dist/sentient/daemon-entry.js.map +1 -1
- package/dist/sentient/daemon.d.ts.map +1 -1
- package/dist/sentient/daemon.js +19 -0
- package/dist/sentient/daemon.js.map +1 -1
- package/dist/sentient/hygiene-scan.d.ts.map +1 -1
- package/dist/sentient/hygiene-scan.js +14 -6
- package/dist/sentient/hygiene-scan.js.map +1 -1
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +13 -9
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/connection-session-handle.d.ts +161 -0
- package/dist/sessions/connection-session-handle.d.ts.map +1 -0
- package/dist/sessions/connection-session-handle.js +168 -0
- package/dist/sessions/connection-session-handle.js.map +1 -0
- package/dist/sessions/handoff.d.ts.map +1 -1
- package/dist/sessions/handoff.js +9 -0
- package/dist/sessions/handoff.js.map +1 -1
- package/dist/sessions/index.d.ts +4 -1
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +31 -1
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/session-id.d.ts +34 -0
- package/dist/sessions/session-id.d.ts.map +1 -1
- package/dist/sessions/session-id.js +37 -0
- package/dist/sessions/session-id.js.map +1 -1
- package/dist/sessions/session-manifest-mirror.d.ts +115 -0
- package/dist/sessions/session-manifest-mirror.d.ts.map +1 -0
- package/dist/sessions/session-manifest-mirror.js +250 -0
- package/dist/sessions/session-manifest-mirror.js.map +1 -0
- package/dist/sessions/session-switch.d.ts.map +1 -1
- package/dist/sessions/session-switch.js +5 -2
- package/dist/sessions/session-switch.js.map +1 -1
- package/dist/store/converters.d.ts.map +1 -1
- package/dist/store/converters.js +2 -0
- package/dist/store/converters.js.map +1 -1
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +2 -0
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +87 -47
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/pi-session-store.d.ts +151 -0
- package/dist/store/pi-session-store.d.ts.map +1 -0
- package/dist/store/pi-session-store.js +166 -0
- package/dist/store/pi-session-store.js.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +1 -0
- package/dist/store/safety-data-accessor.d.ts.map +1 -1
- package/dist/store/safety-data-accessor.js +5 -0
- package/dist/store/safety-data-accessor.js.map +1 -1
- package/dist/store/schema/cleo-global/accounts.d.ts +357 -0
- package/dist/store/schema/cleo-global/accounts.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/accounts.js +136 -0
- package/dist/store/schema/cleo-global/accounts.js.map +1 -0
- package/dist/store/schema/cleo-global/index.d.ts +2 -0
- package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/index.js +2 -0
- package/dist/store/schema/cleo-global/index.js.map +1 -1
- package/dist/store/schema/cleo-global/session-manifest.d.ts +217 -0
- package/dist/store/schema/cleo-global/session-manifest.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/session-manifest.js +99 -0
- package/dist/store/schema/cleo-global/session-manifest.js.map +1 -0
- package/dist/store/schema/cleo-project/tasks-core.d.ts +16 -0
- package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core.js +14 -0
- package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
- package/dist/store/schema/tasks.d.ts +16 -0
- package/dist/store/schema/tasks.d.ts.map +1 -1
- package/dist/store/schema/tasks.js +10 -0
- package/dist/store/schema/tasks.js.map +1 -1
- package/dist/store/selfimprove-dhq-schema.d.ts +284 -0
- package/dist/store/selfimprove-dhq-schema.d.ts.map +1 -0
- package/dist/store/selfimprove-dhq-schema.js +128 -0
- package/dist/store/selfimprove-dhq-schema.js.map +1 -0
- package/dist/store/selfimprove-dhq-store.d.ts +175 -0
- package/dist/store/selfimprove-dhq-store.d.ts.map +1 -0
- package/dist/store/selfimprove-dhq-store.js +182 -0
- package/dist/store/selfimprove-dhq-store.js.map +1 -0
- package/dist/store/session-store.d.ts +52 -13
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +71 -13
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +7 -0
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/umbrella-data-accessor.d.ts +1 -0
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +5 -0
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +32 -0
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/store/writer-lease-schema.d.ts +392 -0
- package/dist/store/writer-lease-schema.d.ts.map +1 -0
- package/dist/store/writer-lease-schema.js +142 -0
- package/dist/store/writer-lease-schema.js.map +1 -0
- package/dist/store/writer-lease.d.ts +368 -0
- package/dist/store/writer-lease.d.ts.map +1 -0
- package/dist/store/writer-lease.js +1002 -0
- package/dist/store/writer-lease.js.map +1 -0
- package/dist/tasks/backfill-child-projections.d.ts.map +1 -1
- package/dist/tasks/backfill-child-projections.js +14 -9
- package/dist/tasks/backfill-child-projections.js.map +1 -1
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +7 -10
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +14 -7
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +10 -4
- package/dist/telemetry/index.js.map +1 -1
- package/dist/tools/agent-registry.d.ts +250 -0
- package/dist/tools/agent-registry.d.ts.map +1 -0
- package/dist/tools/agent-registry.js +292 -0
- package/dist/tools/agent-registry.js.map +1 -0
- package/dist/tools/agent-tool-families.d.ts +107 -0
- package/dist/tools/agent-tool-families.d.ts.map +1 -0
- package/dist/tools/agent-tool-families.js +527 -0
- package/dist/tools/agent-tool-families.js.map +1 -0
- package/dist/tools/browser-driver.d.ts +183 -0
- package/dist/tools/browser-driver.d.ts.map +1 -0
- package/dist/tools/browser-driver.js +242 -0
- package/dist/tools/browser-driver.js.map +1 -0
- package/dist/tools/builtin-agent-tools.d.ts +36 -0
- package/dist/tools/builtin-agent-tools.d.ts.map +1 -0
- package/dist/tools/builtin-agent-tools.js +150 -0
- package/dist/tools/builtin-agent-tools.js.map +1 -0
- package/dist/tools/dispatch.d.ts +370 -0
- package/dist/tools/dispatch.d.ts.map +1 -0
- package/dist/tools/dispatch.js +505 -0
- package/dist/tools/dispatch.js.map +1 -0
- package/dist/tools/env-scrub.d.ts +93 -0
- package/dist/tools/env-scrub.d.ts.map +1 -0
- package/dist/tools/env-scrub.js +176 -0
- package/dist/tools/env-scrub.js.map +1 -0
- package/dist/tools/fs.d.ts +30 -0
- package/dist/tools/fs.d.ts.map +1 -1
- package/dist/tools/fs.js +55 -2
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/guard.d.ts +15 -0
- package/dist/tools/guard.d.ts.map +1 -1
- package/dist/tools/guard.js +49 -12
- package/dist/tools/guard.js.map +1 -1
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +37 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/pty.d.ts +45 -0
- package/dist/tools/pty.d.ts.map +1 -0
- package/dist/tools/pty.js +166 -0
- package/dist/tools/pty.js.map +1 -0
- package/dist/tools/schema-gen.d.ts +57 -0
- package/dist/tools/schema-gen.d.ts.map +1 -0
- package/dist/tools/schema-gen.js +52 -0
- package/dist/tools/schema-gen.js.map +1 -0
- package/dist/tools/shell.d.ts +12 -0
- package/dist/tools/shell.d.ts.map +1 -1
- package/dist/tools/shell.js +14 -1
- package/dist/tools/shell.js.map +1 -1
- package/dist/tools/web-agent-tools.d.ts +72 -0
- package/dist/tools/web-agent-tools.d.ts.map +1 -0
- package/dist/tools/web-agent-tools.js +393 -0
- package/dist/tools/web-agent-tools.js.map +1 -0
- package/dist/tools/web-search-backends.d.ts +156 -0
- package/dist/tools/web-search-backends.d.ts.map +1 -0
- package/dist/tools/web-search-backends.js +290 -0
- package/dist/tools/web-search-backends.js.map +1 -0
- package/dist/validation/ops.d.ts +1 -15
- package/dist/validation/ops.d.ts.map +1 -1
- package/dist/validation/ops.js +0 -20
- package/dist/validation/ops.js.map +1 -1
- package/migrations/drizzle-cleo-global/20260607000000_t11891-writer-leases/migration.sql +55 -0
- package/migrations/drizzle-cleo-global/20260607010000_t11639-session-manifest/migration.sql +43 -0
- package/migrations/drizzle-cleo-global/20260608000000_t11899-pi-session-tree/migration.sql +52 -0
- package/migrations/drizzle-cleo-global/20260608010000_t11709-accounts-credential-pool/migration.sql +72 -0
- package/migrations/drizzle-cleo-global/20260608020000_t11889-selfimprove-dhq/migration.sql +64 -0
- package/migrations/drizzle-cleo-project/20260607000000_t11891-writer-leases/migration.sql +55 -0
- package/migrations/drizzle-cleo-project/20260607010000_t11639-session-parent/migration.sql +22 -0
- package/migrations/drizzle-cleo-project/20260608000000_t11899-pi-session-tree/migration.sql +52 -0
- package/migrations/drizzle-cleo-project/20260608020000_t11889-selfimprove-dhq/migration.sql +64 -0
- package/package.json +15 -13
- package/dist/lifecycle/chain-composition.d.ts +0 -30
- package/dist/lifecycle/chain-composition.d.ts.map +0 -1
- package/dist/lifecycle/chain-composition.js +0 -152
- package/dist/lifecycle/chain-composition.js.map +0 -1
- package/dist/lifecycle/chain-store.d.ts +0 -70
- package/dist/lifecycle/chain-store.d.ts.map +0 -1
- package/dist/lifecycle/chain-store.js +0 -246
- package/dist/lifecycle/chain-store.js.map +0 -1
- package/dist/lifecycle/default-chain.d.ts +0 -39
- package/dist/lifecycle/default-chain.d.ts.map +0 -1
- package/dist/lifecycle/default-chain.js +0 -176
- package/dist/lifecycle/default-chain.js.map +0 -1
- package/dist/lifecycle/tessera-engine.d.ts +0 -48
- package/dist/lifecycle/tessera-engine.d.ts.map +0 -1
- package/dist/lifecycle/tessera-engine.js +0 -249
- package/dist/lifecycle/tessera-engine.js.map +0 -1
- package/dist/validation/chain-validation.d.ts +0 -43
- package/dist/validation/chain-validation.d.ts.map +0 -1
- package/dist/validation/chain-validation.js +0 -146
- package/dist/validation/chain-validation.js.map +0 -1
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent tool-call dispatch engine (T1740 · epic T11456 · SG-TOOLS).
|
|
3
|
+
*
|
|
4
|
+
* The SINGLE chokepoint that turns a model-emitted tool-call `{ name, args }`
|
|
5
|
+
* into an executed, LLM-safe result. It is the SDK-side dispatch path the T1738
|
|
6
|
+
* architecture (D11141) names: **core DISPATCHES, cleo-os DRIVES**. Given a tool
|
|
7
|
+
* call from the agent loop, it:
|
|
8
|
+
*
|
|
9
|
+
* 1. **Looks up** the tool in the injected {@link AgentToolRegistry} (the
|
|
10
|
+
* name→descriptor catalog). An unknown name is a typed
|
|
11
|
+
* `tool-not-found` result — never a throw.
|
|
12
|
+
* 2. **Validates** the model-supplied arguments against the tool's Zod schema
|
|
13
|
+
* (defense in depth: the wire layer advertised the JSON-schema, but the
|
|
14
|
+
* model's emitted args are re-validated here before any side effect). A
|
|
15
|
+
* schema failure is a typed `invalid-args` result carrying the FLATTENED
|
|
16
|
+
* issue list — not the raw Zod error (no internals leak).
|
|
17
|
+
* 3. **Checks availability** for the current {@link ToolAvailabilityContext}
|
|
18
|
+
* (network egress, binaries on PATH, capability flags). An unavailable tool
|
|
19
|
+
* is a typed `guard-denied` result — the model is told the tool is not
|
|
20
|
+
* offered right now, with no precondition internals.
|
|
21
|
+
* 4. **Charges the budget** ({@link ToolCallBudget}) — per-call count / wall-time
|
|
22
|
+
* ceilings. An exhausted budget short-circuits with a typed `guard-denied`
|
|
23
|
+
* result BEFORE the tool runs; a per-call timeout races the execution and
|
|
24
|
+
* yields a typed `timeout` result.
|
|
25
|
+
* 5. **Executes** the bound {@link AgentToolExecutable} over the injected
|
|
26
|
+
* {@link GuardedToolSurface} — the deny-first chokepoint
|
|
27
|
+
* ({@link ./guard.js}). Every fs/shell side effect therefore still funnels
|
|
28
|
+
* through the guard's path allowlist + command denylist + env scrub; there
|
|
29
|
+
* is NO raw-primitive bypass.
|
|
30
|
+
* 6. **Formats** the outcome for LLM consumption ({@link formatToolResultForLlm})
|
|
31
|
+
* — a `tool_result`-shaped payload the Pi loop feeds back to the model. On
|
|
32
|
+
* ANY error the message is a redacted, classified summary; a raw secret,
|
|
33
|
+
* stack trace, or guard internal NEVER reaches the model-facing string.
|
|
34
|
+
*
|
|
35
|
+
* ## Sync + async handlers (AC2)
|
|
36
|
+
*
|
|
37
|
+
* A registered {@link AgentToolExecutable} returns a `Promise<unknown>`, but a
|
|
38
|
+
* synchronous handler that returns a plain value is equally supported: the
|
|
39
|
+
* engine `await`s the call so a non-thenable return is normalized to a resolved
|
|
40
|
+
* value, and a synchronous throw is caught the same as a rejected promise.
|
|
41
|
+
*
|
|
42
|
+
* ## Why it lives in `core/src/tools` (Gate-11)
|
|
43
|
+
*
|
|
44
|
+
* The dispatch engine is a CORE-SDK concern, built entirely against the frozen
|
|
45
|
+
* {@link AgentToolRegistry} + {@link GuardedToolSurface} contracts. It defines
|
|
46
|
+
* NO new atomic tool primitive (Gate-11 Tools-vs-Skills boundary) and makes NO
|
|
47
|
+
* LLM call (Gate-13): result-formatting is pure serialization. The harness
|
|
48
|
+
* (`cleo-os`) and the in-process Pi adapter merely SUPPLY the registry, the
|
|
49
|
+
* guard, and the workspace context, then read the {@link ToolDispatchResult}.
|
|
50
|
+
*
|
|
51
|
+
* @task T1740
|
|
52
|
+
* @epic T11456
|
|
53
|
+
* @see ./agent-registry.js — the name→descriptor catalog + availability checks
|
|
54
|
+
* @see ./guard.js — the deny-first surface every executable routes side effects through
|
|
55
|
+
* @see ../llm/pi/pi-tool-bridge.js — the AC6 consumer wiring this into the Pi loop
|
|
56
|
+
*/
|
|
57
|
+
import type { GuardedToolSurface } from '@cleocode/contracts/tools/skill-executor';
|
|
58
|
+
import type { z } from 'zod';
|
|
59
|
+
import type { AgentToolRegistry, ToolAvailabilityContext } from './agent-registry.js';
|
|
60
|
+
/**
|
|
61
|
+
* The typed failure classes a dispatch can produce (AC3). Each maps a distinct
|
|
62
|
+
* failure mode to a stable, model-safe category so the loop (and any UI) can
|
|
63
|
+
* branch on the KIND without parsing a free-text message:
|
|
64
|
+
*
|
|
65
|
+
* - `tool-not-found` — the model named a tool not in the registry.
|
|
66
|
+
* - `invalid-args` — arguments failed the tool's Zod schema.
|
|
67
|
+
* - `guard-denied` — the tool is unavailable for this context, or the
|
|
68
|
+
* per-call budget was exhausted before it ran.
|
|
69
|
+
* - `execution-error`— the tool ran but threw (incl. a `GuardDeniedError`
|
|
70
|
+
* from the deny-first surface during the side effect), OR
|
|
71
|
+
* the call was cancelled via its abort signal before it
|
|
72
|
+
* completed (the run was cancelled out from under it).
|
|
73
|
+
* - `timeout` — the tool exceeded the per-call wall-time ceiling.
|
|
74
|
+
*/
|
|
75
|
+
export type ToolDispatchErrorKind = 'tool-not-found' | 'invalid-args' | 'guard-denied' | 'execution-error' | 'timeout';
|
|
76
|
+
/**
|
|
77
|
+
* Stable machine-readable error codes, one per {@link ToolDispatchErrorKind}.
|
|
78
|
+
* Surfaced on the failure envelope so a programmatic caller never string-matches
|
|
79
|
+
* the human message.
|
|
80
|
+
*/
|
|
81
|
+
export declare const TOOL_DISPATCH_ERROR_CODE: Readonly<Record<ToolDispatchErrorKind, string>>;
|
|
82
|
+
/**
|
|
83
|
+
* A single tool call as the model emits it — the dispatch engine's input. The
|
|
84
|
+
* `name` is the model-visible tool name; `arguments` is the JSON-parsed argument
|
|
85
|
+
* object (the engine never sees the raw JSON string — parsing is the loop's job,
|
|
86
|
+
* the engine validates the parsed shape).
|
|
87
|
+
*/
|
|
88
|
+
export interface ToolCall {
|
|
89
|
+
/** Stable id correlating the call to its `tool_result` (loop-supplied). */
|
|
90
|
+
readonly id: string;
|
|
91
|
+
/** Model-visible tool name to dispatch. */
|
|
92
|
+
readonly name: string;
|
|
93
|
+
/** JSON-parsed argument object the model supplied. */
|
|
94
|
+
readonly arguments: Readonly<Record<string, unknown>>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The successful outcome of a dispatch (AC4). `value` is the tool's raw return
|
|
98
|
+
* (opaque to the engine); `display` is the LLM-facing string the loop feeds back
|
|
99
|
+
* in the `tool_result` message.
|
|
100
|
+
*/
|
|
101
|
+
export interface ToolDispatchSuccess {
|
|
102
|
+
/** Discriminant. */
|
|
103
|
+
readonly ok: true;
|
|
104
|
+
/** The dispatched tool's name (echoed for correlation). */
|
|
105
|
+
readonly name: string;
|
|
106
|
+
/** The raw tool return value (for structured logging / details). */
|
|
107
|
+
readonly value: unknown;
|
|
108
|
+
/** The LLM-facing rendering of `value` (the `tool_result` body). */
|
|
109
|
+
readonly display: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The failed outcome of a dispatch (AC3 + AC4). Carries the typed
|
|
113
|
+
* {@link ToolDispatchErrorKind}, a stable code, and a REDACTED, model-safe
|
|
114
|
+
* `message` — a raw secret / stack / guard internal is never placed here.
|
|
115
|
+
*/
|
|
116
|
+
export interface ToolDispatchFailure {
|
|
117
|
+
/** Discriminant. */
|
|
118
|
+
readonly ok: false;
|
|
119
|
+
/** The dispatched tool's name (echoed for correlation). */
|
|
120
|
+
readonly name: string;
|
|
121
|
+
/** The typed failure class (AC3). */
|
|
122
|
+
readonly kind: ToolDispatchErrorKind;
|
|
123
|
+
/** Stable machine-readable code ({@link TOOL_DISPATCH_ERROR_CODE}). */
|
|
124
|
+
readonly code: string;
|
|
125
|
+
/** Redacted, model-safe failure summary (the `tool_result` body). */
|
|
126
|
+
readonly message: string;
|
|
127
|
+
/**
|
|
128
|
+
* For `invalid-args`, the flattened schema issues (path + reason) — safe to
|
|
129
|
+
* show the model so it can correct its call. Absent for other kinds.
|
|
130
|
+
*/
|
|
131
|
+
readonly issues?: readonly ToolArgIssue[];
|
|
132
|
+
}
|
|
133
|
+
/** A flattened Zod issue: the field path and the human-readable reason. */
|
|
134
|
+
export interface ToolArgIssue {
|
|
135
|
+
/** Dotted field path, e.g. `path` or `args.0`. Empty for a root issue. */
|
|
136
|
+
readonly path: string;
|
|
137
|
+
/** Human-readable validation reason. */
|
|
138
|
+
readonly message: string;
|
|
139
|
+
}
|
|
140
|
+
/** The terminal result of a single dispatch — success or a classified failure. */
|
|
141
|
+
export type ToolDispatchResult = ToolDispatchSuccess | ToolDispatchFailure;
|
|
142
|
+
/** Caps for {@link ToolCallBudget}. A cap of `undefined` means "unbounded". */
|
|
143
|
+
export interface ToolBudgetLimits {
|
|
144
|
+
/** Max number of tool calls this budget admits. */
|
|
145
|
+
readonly maxCalls?: number;
|
|
146
|
+
/** Per-call wall-time ceiling in milliseconds (a slower call → `timeout`). */
|
|
147
|
+
readonly perCallTimeoutMs?: number;
|
|
148
|
+
/** Cumulative wall-time ceiling across all calls in milliseconds. */
|
|
149
|
+
readonly totalTimeBudgetMs?: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* A snapshot of a {@link ToolCallBudget}'s consumption — surfaced so a consumer
|
|
153
|
+
* (the Pi loop / a UI) can report remaining headroom (AC5).
|
|
154
|
+
*/
|
|
155
|
+
export interface ToolBudgetSnapshot {
|
|
156
|
+
/** Calls charged so far. */
|
|
157
|
+
readonly callsUsed: number;
|
|
158
|
+
/** Calls remaining (`Infinity` when uncapped). */
|
|
159
|
+
readonly callsRemaining: number;
|
|
160
|
+
/** Cumulative wall-time charged so far, in ms. */
|
|
161
|
+
readonly timeUsedMs: number;
|
|
162
|
+
/** Cumulative wall-time remaining, in ms (`Infinity` when uncapped). */
|
|
163
|
+
readonly timeRemainingMs: number;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Per-run tool-call budget (AC5). Tracks call count + cumulative wall-time
|
|
167
|
+
* against the configured {@link ToolBudgetLimits}. The engine consults
|
|
168
|
+
* {@link admit} BEFORE running a tool (rejecting once a ceiling is hit) and
|
|
169
|
+
* {@link charge}s the elapsed time AFTER. A single budget instance is threaded
|
|
170
|
+
* across all calls of one run, so the count/time caps are run-scoped.
|
|
171
|
+
*/
|
|
172
|
+
export declare class ToolCallBudget {
|
|
173
|
+
#private;
|
|
174
|
+
/**
|
|
175
|
+
* @param limits - The ceilings this budget enforces (each optional → uncapped).
|
|
176
|
+
*/
|
|
177
|
+
constructor(limits?: ToolBudgetLimits);
|
|
178
|
+
/** The per-call timeout ceiling in ms, or `undefined` when uncapped. */
|
|
179
|
+
get perCallTimeoutMs(): number | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* Whether another call is admitted right now. Returns a typed denial reason
|
|
182
|
+
* (or `null` when admitted) so the engine can map it onto the precise
|
|
183
|
+
* `guard-denied` message WITHOUT exposing the limit internals to the model.
|
|
184
|
+
*
|
|
185
|
+
* @returns `null` when a call is admitted; otherwise the human-readable reason.
|
|
186
|
+
*/
|
|
187
|
+
admit(): string | null;
|
|
188
|
+
/**
|
|
189
|
+
* Charge one completed call against the budget.
|
|
190
|
+
*
|
|
191
|
+
* @param elapsedMs - The call's measured wall-time in milliseconds.
|
|
192
|
+
*/
|
|
193
|
+
charge(elapsedMs: number): void;
|
|
194
|
+
/** A read-only snapshot of current consumption (AC5). */
|
|
195
|
+
snapshot(): ToolBudgetSnapshot;
|
|
196
|
+
}
|
|
197
|
+
/** Maximum length of a formatted `tool_result` body before truncation (AC4). */
|
|
198
|
+
export declare const MAX_TOOL_RESULT_CHARS = 16000;
|
|
199
|
+
/**
|
|
200
|
+
* Construction dependencies for {@link ToolDispatchEngine}.
|
|
201
|
+
*/
|
|
202
|
+
export interface ToolDispatchEngineDeps {
|
|
203
|
+
/** The frozen tool catalog the engine dispatches against (name→descriptor). */
|
|
204
|
+
readonly registry: AgentToolRegistry;
|
|
205
|
+
/**
|
|
206
|
+
* The deny-first guarded surface every executable performs side effects
|
|
207
|
+
* through. Injected — the engine never constructs a guard (Gate-11).
|
|
208
|
+
*/
|
|
209
|
+
readonly tools: GuardedToolSurface;
|
|
210
|
+
/**
|
|
211
|
+
* Availability context (AC5 of the registry): a tool whose
|
|
212
|
+
* {@link AgentToolDescriptor.available} predicate is false for this context is
|
|
213
|
+
* `guard-denied` before it runs. Defaults to `{}` (everything available).
|
|
214
|
+
*/
|
|
215
|
+
readonly availability?: ToolAvailabilityContext;
|
|
216
|
+
/**
|
|
217
|
+
* Optional run-scoped budget (AC5). When omitted an unbounded budget is used,
|
|
218
|
+
* so a call count / time ceiling is opt-in. Threaded across all
|
|
219
|
+
* {@link ToolDispatchEngine.dispatch} calls of one run.
|
|
220
|
+
*/
|
|
221
|
+
readonly budget?: ToolCallBudget;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* The agent tool-call dispatch engine (AC1).
|
|
225
|
+
*
|
|
226
|
+
* One instance per agent run: it holds the frozen registry, the guarded surface,
|
|
227
|
+
* the availability context, and the run-scoped budget, and dispatches each
|
|
228
|
+
* model-emitted {@link ToolCall} to a classified {@link ToolDispatchResult}.
|
|
229
|
+
* {@link dispatch} NEVER throws — every failure mode is encoded as a typed
|
|
230
|
+
* {@link ToolDispatchFailure} (AC3), so the agent loop can always feed a
|
|
231
|
+
* `tool_result` back and continue.
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```ts
|
|
235
|
+
* const registry = await createAgentToolRegistry();
|
|
236
|
+
* const tools = createToolGuard({ allowedRoots: [root], mode: 'enforce' });
|
|
237
|
+
* const engine = new ToolDispatchEngine({
|
|
238
|
+
* registry,
|
|
239
|
+
* tools,
|
|
240
|
+
* budget: new ToolCallBudget({ maxCalls: 50, perCallTimeoutMs: 30_000 }),
|
|
241
|
+
* });
|
|
242
|
+
* const result = await engine.dispatch({ id: 'c1', name: 'read_file_paged', arguments: { path } });
|
|
243
|
+
* // result.ok ? feed result.display : feed the classified result.message
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export declare class ToolDispatchEngine {
|
|
247
|
+
#private;
|
|
248
|
+
/**
|
|
249
|
+
* @param deps - The registry, guarded surface, availability context, and
|
|
250
|
+
* optional run-scoped budget.
|
|
251
|
+
*/
|
|
252
|
+
constructor(deps: ToolDispatchEngineDeps);
|
|
253
|
+
/** A read-only snapshot of the run's budget consumption (AC5). */
|
|
254
|
+
budgetSnapshot(): ToolBudgetSnapshot;
|
|
255
|
+
/**
|
|
256
|
+
* Dispatch a single model-emitted tool call to a classified result (AC1–AC5).
|
|
257
|
+
*
|
|
258
|
+
* The full pipeline — lookup → validate → availability → budget admit →
|
|
259
|
+
* (timed) execute → charge → format — runs here. It NEVER throws: a thrown
|
|
260
|
+
* executable (incl. a deny-first `GuardDeniedError` during the side effect)
|
|
261
|
+
* becomes an `execution-error`, a slow executable a `timeout`, a cancelled call
|
|
262
|
+
* an `execution-error`, an unknown name a `tool-not-found`, bad args an
|
|
263
|
+
* `invalid-args`, and an unavailable tool / exhausted budget a `guard-denied`.
|
|
264
|
+
*
|
|
265
|
+
* ## Abort handling (honest contract)
|
|
266
|
+
*
|
|
267
|
+
* A `signal` (when supplied) is honoured REGARDLESS of whether a per-call
|
|
268
|
+
* timeout is configured — including the default no-budget production path: an
|
|
269
|
+
* already-aborted signal short-circuits before the executable is awaited, and
|
|
270
|
+
* an abort RACED in flight rejects with an `execution-error`. BUT this is
|
|
271
|
+
* abandon-the-promise cancellation, NOT preemptive kill: the frozen
|
|
272
|
+
* {@link AgentToolExecutable}/{@link GuardedToolSurface} contracts expose no
|
|
273
|
+
* signal channel, so a tool that already spawned an OS process keeps that
|
|
274
|
+
* process running until the tool's own internal bound fires. The engine
|
|
275
|
+
* returns promptly; the side effect may still be settling. See
|
|
276
|
+
* {@link ToolDispatchEngine.#runWithTimeout} for the full rationale.
|
|
277
|
+
*
|
|
278
|
+
* @param call - The model-emitted tool call (`{ id, name, arguments }`).
|
|
279
|
+
* @param signal - Optional abort signal honoured on every path (timeout or
|
|
280
|
+
* not); aborting yields an `execution-error` but cannot preemptively kill an
|
|
281
|
+
* in-flight OS process (frozen-contract limitation).
|
|
282
|
+
* @returns The terminal {@link ToolDispatchResult}.
|
|
283
|
+
*/
|
|
284
|
+
dispatch(call: ToolCall, signal?: AbortSignal): Promise<ToolDispatchResult>;
|
|
285
|
+
}
|
|
286
|
+
/** Thrown internally when a tool call exceeds its per-call timeout (AC5). */
|
|
287
|
+
export declare class ToolTimeoutError extends Error {
|
|
288
|
+
/** Machine-readable code. */
|
|
289
|
+
readonly code = "E_TOOL_TIMEOUT";
|
|
290
|
+
constructor(message: string);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Thrown internally when a tool call is cancelled via its {@link AbortSignal}
|
|
294
|
+
* (containment-managed run cancel / OOM-guard / budget kill). Distinct from
|
|
295
|
+
* {@link ToolTimeoutError}: a timeout means "the call was too slow", an abort
|
|
296
|
+
* means "the run was cancelled out from under the call". The engine maps it to a
|
|
297
|
+
* typed `execution-error` result (the call did not complete).
|
|
298
|
+
*
|
|
299
|
+
* @remarks Winning the abort race only ABANDONS the executable promise — it does
|
|
300
|
+
* NOT preemptively kill a tool that already spawned an OS process, because the
|
|
301
|
+
* frozen {@link AgentToolExecutable}/{@link GuardedToolSurface} contracts carry
|
|
302
|
+
* no signal channel (see {@link ToolDispatchEngine.dispatch}).
|
|
303
|
+
*/
|
|
304
|
+
export declare class ToolAbortError extends Error {
|
|
305
|
+
/** Machine-readable code. */
|
|
306
|
+
readonly code = "E_TOOL_ABORTED";
|
|
307
|
+
constructor(message: string);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Render a tool's raw return value into the LLM-facing `tool_result` body (AC4).
|
|
311
|
+
*
|
|
312
|
+
* A string passes through; everything else is JSON-serialized (pretty, stable).
|
|
313
|
+
* A circular / non-serializable value degrades to its `String(...)` form rather
|
|
314
|
+
* than throwing. The result is hard-capped at {@link MAX_TOOL_RESULT_CHARS} with
|
|
315
|
+
* a truncation marker so one tool call cannot blow the model's context window.
|
|
316
|
+
*
|
|
317
|
+
* @param value - The raw tool return.
|
|
318
|
+
* @returns The model-safe `tool_result` string.
|
|
319
|
+
*/
|
|
320
|
+
export declare function formatToolValueForLlm(value: unknown): string;
|
|
321
|
+
/**
|
|
322
|
+
* Project a terminal {@link ToolDispatchResult} onto the `tool_result` message
|
|
323
|
+
* shape the agent loop feeds back to the model (AC4).
|
|
324
|
+
*
|
|
325
|
+
* The `content` is `result.display` on success or the redacted, classified
|
|
326
|
+
* `result.message` on failure (with the flattened arg issues appended when
|
|
327
|
+
* present). `isError` lets the loop / transport mark the turn so the model knows
|
|
328
|
+
* the call did not succeed.
|
|
329
|
+
*
|
|
330
|
+
* @param result - The dispatch outcome.
|
|
331
|
+
* @returns A `{ toolCallId, toolName, content, isError }` envelope.
|
|
332
|
+
*/
|
|
333
|
+
export declare function formatToolResultForLlm(call: Pick<ToolCall, 'id'>, result: ToolDispatchResult): ToolResultPayload;
|
|
334
|
+
/**
|
|
335
|
+
* The LLM-facing `tool_result` payload shape (AC4) — the minimal subset the loop
|
|
336
|
+
* needs to build a provider `tool_result` / `toolResult` message. Structurally a
|
|
337
|
+
* subset of `pi-ai`'s `ToolResultMessage`, so the Pi bridge maps it 1:1.
|
|
338
|
+
*/
|
|
339
|
+
export interface ToolResultPayload {
|
|
340
|
+
/** Correlates back to the originating {@link ToolCall.id}. */
|
|
341
|
+
readonly toolCallId: string;
|
|
342
|
+
/** The tool's name (echoed for the provider message). */
|
|
343
|
+
readonly toolName: string;
|
|
344
|
+
/** The model-facing result body (display on success, redacted summary on error). */
|
|
345
|
+
readonly content: string;
|
|
346
|
+
/** Whether the turn is an error result. */
|
|
347
|
+
readonly isError: boolean;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Produce a REDACTED, model-safe message from a thrown executable error (AC3).
|
|
351
|
+
*
|
|
352
|
+
* Only the error's single-line `message` is kept — never the stack trace (which
|
|
353
|
+
* can leak absolute paths / internal module structure) and never an attached
|
|
354
|
+
* `cause`. The message itself is scrubbed for obvious secret-looking tokens so a
|
|
355
|
+
* tool that interpolates a credential into its error string cannot leak it to
|
|
356
|
+
* the model. A non-`Error` throw degrades to a fixed, generic summary.
|
|
357
|
+
*
|
|
358
|
+
* @param err - The thrown value.
|
|
359
|
+
* @returns A single-line, secret-scrubbed message safe for the model.
|
|
360
|
+
*/
|
|
361
|
+
export declare function redactErrorMessage(err: unknown): string;
|
|
362
|
+
/**
|
|
363
|
+
* Flatten a {@link z.ZodError} into the minimal, model-safe
|
|
364
|
+
* {@link ToolArgIssue}[] — path + reason only, no raw Zod internals.
|
|
365
|
+
*
|
|
366
|
+
* @param error - The Zod validation error.
|
|
367
|
+
* @returns The flattened issues.
|
|
368
|
+
*/
|
|
369
|
+
export declare function flattenZodIssues(error: z.ZodError): readonly ToolArgIssue[];
|
|
370
|
+
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/tools/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAEV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAS7B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,iBAAiB,GACjB,SAAS,CAAC;AAEd;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAMpF,CAAC;AAMF;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;A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