stitchkit 0.132.3 → 0.133.0
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/CHANGELOG.md +172 -1
- package/dist/agent-executor/acp/v1-connect.d.ts +12 -1
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +3 -1
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +9 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +3 -2
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-probe.d.ts +10 -1
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +11 -2
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +13 -10
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +6 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/record-router.d.ts +44 -0
- package/dist/agent-executor/claude/record-router.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +20 -2
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts +18 -0
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +8 -11
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-manager.d.ts +4 -2
- package/dist/agent-executor/claude-sdk/query-manager.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-options.d.ts +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/capabilities.d.ts +8 -0
- package/dist/agent-executor/codex/capabilities.d.ts.map +1 -0
- package/dist/agent-executor/codex/connect.d.ts +6 -1
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/driver.d.ts +10 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/event-routing.d.ts +23 -1
- package/dist/agent-executor/codex/event-routing.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +23 -3
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +17 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +23 -3
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-bind.d.ts +6 -1
- package/dist/agent-executor/codex/session-bind.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-types.d.ts +5 -1
- package/dist/agent-executor/codex/session-types.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-thread.d.ts +6 -8
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-open.d.ts +12 -3
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
- package/dist/agent-executor/engine-requests.d.ts +42 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
- package/dist/agent-executor/handoff.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +6 -5
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/profile.d.ts +3 -5
- package/dist/agent-executor/profile.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +64 -3
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts +5 -0
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts +11 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-support.d.ts +23 -0
- package/dist/agent-executor/testing/conformance-support.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +7 -2
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/consumer-stubs.d.ts +5 -3
- package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts +5 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +6 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-gate.d.ts +4 -1
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/operation-refusal.d.ts +10 -0
- package/dist/browser/operation-refusal.d.ts.map +1 -0
- package/dist/contract/client-types.d.ts +13 -4
- package/dist/contract/client-types.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +6 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors-factory.d.ts +8 -2
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +9 -0
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/fingerprint.d.ts +4 -1
- package/dist/contract/fingerprint.d.ts.map +1 -1
- package/dist/contract/operation-refusals.d.ts +51 -0
- package/dist/contract/operation-refusals.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +4 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +253 -210
- package/dist/entrypoints/agent-executor/claude-sdk.js +248 -173
- package/dist/entrypoints/agent-executor/claude.js +57 -109
- package/dist/entrypoints/agent-executor/codex.js +412 -335
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts +3 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +329 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +1 -2
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +413 -667
- package/dist/entrypoints/agent-executor.d.ts +1 -1
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +12 -12
- package/dist/entrypoints/agent-runtime/browser.js +2 -2
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/postgres.js +5 -5
- package/dist/entrypoints/agent-runtime/realtime.js +2 -2
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +26 -18
- package/dist/entrypoints/application/grammy.js +1 -1
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.d.ts +3 -2
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +6 -4
- package/dist/entrypoints/files/packaging.d.ts +4 -1
- package/dist/entrypoints/files/packaging.d.ts.map +1 -1
- package/dist/entrypoints/files/packaging.js +868 -167
- package/dist/entrypoints/files.js +1 -1
- package/dist/entrypoints/handler.js +7 -7
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +10 -8
- package/dist/entrypoints/node.js +11 -11
- package/dist/entrypoints/observability.js +1 -1
- package/dist/entrypoints/process/bootstrap.d.ts +3 -0
- package/dist/entrypoints/process/bootstrap.d.ts.map +1 -0
- package/dist/entrypoints/process/bootstrap.js +16 -0
- package/dist/entrypoints/process.js +7 -7
- package/dist/entrypoints/realtime.js +3 -3
- package/dist/entrypoints/remote.js +8 -7
- package/dist/entrypoints/server.js +30 -14
- package/dist/entrypoints/service-host/macos.js +72 -206
- package/dist/entrypoints/service-host/work.d.ts +15 -0
- package/dist/entrypoints/service-host/work.d.ts.map +1 -0
- package/dist/entrypoints/service-host/work.js +676 -0
- package/dist/entrypoints/service-host.js +146 -536
- package/dist/entrypoints/telegram/screens.js +4 -4
- package/dist/entrypoints/telegram.js +4 -4
- package/dist/entrypoints/testing.d.ts +2 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +27 -8
- package/dist/entrypoints/tools/agent.js +6 -6
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +5 -5
- package/dist/entrypoints/tools/mcp.js +8 -6
- package/dist/entrypoints/tools/toolkit.js +11 -9
- package/dist/entrypoints/tools.js +19 -17
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +3 -3
- package/dist/files/client-artifact.d.ts +14 -42
- package/dist/files/client-artifact.d.ts.map +1 -1
- package/dist/files/client-build.d.ts +57 -0
- package/dist/files/client-build.d.ts.map +1 -0
- package/dist/files/client-declarations.d.ts +35 -0
- package/dist/files/client-declarations.d.ts.map +1 -0
- package/dist/files/client-package-contract.d.ts +162 -0
- package/dist/files/client-package-contract.d.ts.map +1 -0
- package/dist/files/client-package-proof.d.ts +38 -0
- package/dist/files/client-package-proof.d.ts.map +1 -0
- package/dist/files/client-package.d.ts +17 -0
- package/dist/files/client-package.d.ts.map +1 -0
- package/dist/files/declaration-specifiers.d.ts +30 -0
- package/dist/files/declaration-specifiers.d.ts.map +1 -0
- package/dist/{index-v759mzed.js → index-02r5sq9p.js} +36 -23
- package/dist/{index-0r15pkjq.js → index-0k1ba0ss.js} +1 -1
- package/dist/{index-znd1b57f.js → index-1dn2wjq6.js} +5 -4
- package/dist/{index-p06z7g7w.js → index-1p8q0yrt.js} +6 -5
- package/dist/{index-wa6h4tz6.js → index-1qwd54n3.js} +6 -5
- package/dist/index-2dzc7mv9.js +174 -0
- package/dist/index-2mz8hj58.js +155 -0
- package/dist/{index-17qgm6xe.js → index-34k82crg.js} +2 -2
- package/dist/index-3mcbr8sx.js +349 -0
- package/dist/{index-ybdq8kk2.js → index-3y2tzhr8.js} +3 -3
- package/dist/{index-fgahdc7s.js → index-5n3a8hd8.js} +5 -3
- package/dist/{index-jb4m241t.js → index-6918kxbf.js} +45 -1
- package/dist/{index-n3bm7zqq.js → index-6kmjcm81.js} +4 -4
- package/dist/{index-akf0xkrm.js → index-78da4g74.js} +1 -1
- package/dist/{index-9pv126eh.js → index-7fjbdga8.js} +7 -1
- package/dist/{index-zhshhxew.js → index-8jf4bt7v.js} +1 -1
- package/dist/{index-p16q492v.js → index-8t9dr41h.js} +18 -5
- package/dist/{index-xq4s9mka.js → index-8yt3rwe7.js} +1 -1
- package/dist/{index-39c2hj6h.js → index-9c76vfxf.js} +7 -3
- package/dist/index-9ft4n9j1.js +432 -0
- package/dist/{index-sd4e5x5j.js → index-9wdrwx3b.js} +8 -7
- package/dist/{index-z114ax5e.js → index-an7vcmwf.js} +49 -2
- package/dist/{index-pzhqydxb.js → index-d04w81fz.js} +1 -1
- package/dist/index-d2drhb9c.js +219 -0
- package/dist/{index-8gmmdz7k.js → index-dacxr7nf.js} +1 -1
- package/dist/{index-dnzxxf8a.js → index-dm6nxkn1.js} +1 -1
- package/dist/index-dxft2mnm.js +42 -0
- package/dist/{index-rxh3qy4x.js → index-fzd477xk.js} +1 -1
- package/dist/{index-xgae0bn7.js → index-g4gstmp1.js} +2 -2
- package/dist/{index-athc412x.js → index-g5fgeb6v.js} +1 -1
- package/dist/{index-z9d74jmb.js → index-gbhj370g.js} +3 -3
- package/dist/{index-3fym4j8n.js → index-gtaaxe9d.js} +1 -1
- package/dist/{index-v59pxmf1.js → index-jpecjm30.js} +2 -2
- package/dist/index-k9g061ma.js +164 -0
- package/dist/{index-669374qc.js → index-ma26mfnt.js} +84 -315
- package/dist/{index-ryxb427v.js → index-msxf2r8x.js} +16 -3
- package/dist/{index-rbd2rq3z.js → index-nr4fhfn4.js} +1 -1
- package/dist/{index-qa2jjb65.js → index-pbekeqzm.js} +1 -1
- package/dist/{index-mkfhpk11.js → index-pq6g1k9t.js} +2 -2
- package/dist/{index-gya4hwh3.js → index-pws5c3x6.js} +21 -1
- package/dist/{index-x2fb37t0.js → index-q427q23r.js} +3 -2
- package/dist/{index-jcrj0b8z.js → index-qggqqja2.js} +39 -2
- package/dist/{index-jxtg307y.js → index-rkjfzs0a.js} +1 -1
- package/dist/{index-5tdc0q43.js → index-rw8ze745.js} +5 -3
- package/dist/index-s43tr4my.js +129 -0
- package/dist/{index-f9p62ean.js → index-stpy56r3.js} +175 -249
- package/dist/index-t5g5rm9n.js +213 -0
- package/dist/{index-z20pdxeb.js → index-tmv3ez1h.js} +3 -3
- package/dist/{index-dcsxj68j.js → index-tqjamnax.js} +1 -1
- package/dist/{index-j15dhkda.js → index-wddcfbng.js} +1 -325
- package/dist/{index-9sfhje6y.js → index-wh70tmpd.js} +24 -234
- package/dist/index-wxjv4sqx.js +82 -0
- package/dist/{index-qhjmmsm2.js → index-x46y9z26.js} +2 -2
- package/dist/{index-nk0cy9g1.js → index-y53cqwke.js} +1 -1
- package/dist/{index-sv5svtq7.js → index-y68gavb5.js} +1 -1
- package/dist/{index-5y7j383h.js → index-yrhw10ef.js} +1 -1
- package/dist/process/bootstrap.d.ts +12 -0
- package/dist/process/bootstrap.d.ts.map +1 -0
- package/dist/process/owner-loss-guard.d.ts +2 -9
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/process/work-root.d.ts +20 -0
- package/dist/process/work-root.d.ts.map +1 -0
- package/dist/server/contract-identity.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +12 -0
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/service-host/host-adapter.d.ts +2 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -1
- package/dist/service-host/work/command.d.ts +72 -0
- package/dist/service-host/work/command.d.ts.map +1 -0
- package/dist/service-host/work/errors.d.ts +29 -0
- package/dist/service-host/work/errors.d.ts.map +1 -0
- package/dist/service-host/work/host.d.ts +38 -0
- package/dist/service-host/work/host.d.ts.map +1 -0
- package/dist/service-host/work/launch.d.ts +51 -0
- package/dist/service-host/work/launch.d.ts.map +1 -0
- package/dist/service-host/work/membership.d.ts +51 -0
- package/dist/service-host/work/membership.d.ts.map +1 -0
- package/dist/service-host/work/origin.d.ts +79 -0
- package/dist/service-host/work/origin.d.ts.map +1 -0
- package/dist/service-host/work/owner.d.ts +45 -0
- package/dist/service-host/work/owner.d.ts.map +1 -0
- package/dist/service-host/work/placement.d.ts +55 -0
- package/dist/service-host/work/placement.d.ts.map +1 -0
- package/dist/service-host/work/probe.d.ts +24 -0
- package/dist/service-host/work/probe.d.ts.map +1 -0
- package/dist/service-host/work/scope-command.d.ts +68 -0
- package/dist/service-host/work/scope-command.d.ts.map +1 -0
- package/dist/sync/session.d.ts +4 -1
- package/dist/sync/session.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +2 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +32 -3
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +2 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/internal/mcp-projection.d.ts +58 -0
- package/dist/tools/internal/mcp-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +3 -47
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -0
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +4 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +5 -2
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +2 -0
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts +8 -0
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +7 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +3 -3
- package/llms/agent-executor-claude-sdk.txt +1 -1
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +1 -1
- package/llms/agent-executor-testing-claude-sdk.txt +28 -0
- package/llms/agent-executor-testing.txt +7 -8
- package/llms/agent-executor.txt +27 -4
- package/llms/agent-runtime.txt +1 -1
- package/llms/contract.txt +8 -2
- package/llms/files-packaging.txt +11 -6
- package/llms/process-bootstrap.txt +18 -0
- package/llms/process.2.txt +215 -18
- package/llms/process.txt +130 -92
- package/llms/server.4.txt +49 -1
- package/llms/service-host-work.txt +34 -0
- package/llms/stitchkit.2.txt +31 -0
- package/llms/stitchkit.txt +78 -75
- package/llms/sync.txt +5 -2
- package/llms/testing.txt +1 -0
- package/llms/tools.2.txt +747 -775
- package/llms/tools.3.txt +846 -210
- package/llms/tools.4.txt +226 -0
- package/llms/tools.txt +3 -790
- package/llms/{upgrading-0.128.0-0.132.0.txt → upgrading-0.128.0-0.133.0.txt} +194 -6
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +746 -135
- package/llms.txt +18 -16
- package/package.json +12 -4
- package/dist/entrypoints/process/owner-loss.d.ts +0 -3
- package/dist/entrypoints/process/owner-loss.d.ts.map +0 -1
- package/dist/entrypoints/process/owner-loss.js +0 -7
- package/llms/process-owner-loss.txt +0 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
offerTurnDelta
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-stpy56r3.js";
|
|
4
4
|
|
|
5
5
|
// src/agent-executor/engine-requests.ts
|
|
6
6
|
function holdEngineRequest(turn, request) {
|
|
@@ -41,6 +41,7 @@ function drainEngineRequests(turn, answer) {
|
|
|
41
41
|
function endEngineTurn(turn, answer, deltas) {
|
|
42
42
|
if (turn === undefined)
|
|
43
43
|
return;
|
|
44
|
+
turn.settled = true;
|
|
44
45
|
drainEngineRequests(turn, answer);
|
|
45
46
|
for (const delta of deltas)
|
|
46
47
|
offerTurnDelta(turn.channel, delta);
|
|
@@ -49,8 +50,44 @@ function endEngineTurn(turn, answer, deltas) {
|
|
|
49
50
|
function loseEngineTurn(turn, answer, error) {
|
|
50
51
|
if (turn === undefined)
|
|
51
52
|
return;
|
|
53
|
+
turn.settled = true;
|
|
54
|
+
turn.lost ??= { error };
|
|
52
55
|
drainEngineRequests(turn, answer);
|
|
53
56
|
turn.channel.fail(error);
|
|
54
57
|
}
|
|
58
|
+
function abandonEngineTurn(turn, error) {
|
|
59
|
+
if (turn === undefined)
|
|
60
|
+
return;
|
|
61
|
+
turn.settled = true;
|
|
62
|
+
turn.lost ??= { error };
|
|
63
|
+
turn.pending.clear();
|
|
64
|
+
turn.channel.fail(error);
|
|
65
|
+
}
|
|
66
|
+
function leaveEngineRequestUnanswered() {
|
|
67
|
+
return new Promise(() => {
|
|
68
|
+
return;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function refuseEngineTurnRequests(turn, refusal) {
|
|
72
|
+
turn.state.interruptRequested = true;
|
|
73
|
+
drainEngineRequests(turn, refusal);
|
|
74
|
+
}
|
|
75
|
+
async function interruptEngineTurn(turn, liveness, stop) {
|
|
76
|
+
if (turn.settled || !liveness.isAlive())
|
|
77
|
+
return;
|
|
78
|
+
refuseEngineTurnRequests(turn, stop.refusal);
|
|
79
|
+
await stop.tell();
|
|
80
|
+
}
|
|
81
|
+
function respondToEngineRequest(turn, liveness, interactionId, answer) {
|
|
82
|
+
liveness.ensureAlive();
|
|
83
|
+
if (turn.lost !== undefined) {
|
|
84
|
+
throw turn.lost.error instanceof Error ? turn.lost.error : new Error(String(turn.lost.error));
|
|
85
|
+
}
|
|
86
|
+
const waiting = turn.pending.get(interactionId);
|
|
87
|
+
if (waiting === undefined) {
|
|
88
|
+
throw new TypeError(`Unknown interaction ${interactionId} for this turn`);
|
|
89
|
+
}
|
|
90
|
+
answerEngineRequest(turn, interactionId, answer(waiting.detail));
|
|
91
|
+
}
|
|
55
92
|
|
|
56
|
-
export { holdEngineRequest, answerEngineRequest,
|
|
93
|
+
export { holdEngineRequest, answerEngineRequest, endEngineTurn, loseEngineTurn, abandonEngineTurn, leaveEngineRequestUnanswered, refuseEngineTurnRequests, interruptEngineTurn, respondToEngineRequest };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectToolSurface
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-ma26mfnt.js";
|
|
4
4
|
|
|
5
5
|
// src/tools/manifest.ts
|
|
6
6
|
function utf8Length(value) {
|
|
@@ -11,7 +11,8 @@ function describeToolCatalog2(config) {
|
|
|
11
11
|
const entries = projectToolSurface(config, config.transport, {
|
|
12
12
|
extend: config.extend,
|
|
13
13
|
flattenUnionInput: config.flattenUnionInput,
|
|
14
|
-
inputRecursionDepth: config.inputRecursionDepth
|
|
14
|
+
inputRecursionDepth: config.inputRecursionDepth,
|
|
15
|
+
inputNestingDepth: config.inputNestingDepth
|
|
15
16
|
}).map((projected) => {
|
|
16
17
|
const schemaBytes = utf8Length(projected.presentationSchema);
|
|
17
18
|
const description = projected.kind === "contract" ? projected.source.desc : projected.source.description;
|
|
@@ -40,7 +41,8 @@ function buildToolManifest2(config) {
|
|
|
40
41
|
return projectToolSurface(config, config.transport, {
|
|
41
42
|
extend: config.extend,
|
|
42
43
|
flattenUnionInput: config.flattenUnionInput,
|
|
43
|
-
inputRecursionDepth: config.inputRecursionDepth
|
|
44
|
+
inputRecursionDepth: config.inputRecursionDepth,
|
|
45
|
+
inputNestingDepth: config.inputNestingDepth
|
|
44
46
|
}).map((projected) => ({
|
|
45
47
|
name: projected.name,
|
|
46
48
|
description: projected.kind === "contract" ? projected.source.desc : projected.source.description,
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentTextPartSchema2,
|
|
3
|
+
AgentReasoningPartSchema2,
|
|
4
|
+
AgentToolCallPartSchema2,
|
|
5
|
+
AgentToolResultPartSchema2
|
|
6
|
+
} from "./index-2rf33y2h.js";
|
|
7
|
+
|
|
8
|
+
// src/agent-executor/vocabulary.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var ExecutorRawSchema2 = z.strictObject({
|
|
11
|
+
source: z.string().min(1),
|
|
12
|
+
type: z.string().min(1)
|
|
13
|
+
});
|
|
14
|
+
var base = {
|
|
15
|
+
turnId: z.string().min(1),
|
|
16
|
+
itemId: z.string().min(1),
|
|
17
|
+
raw: ExecutorRawSchema2
|
|
18
|
+
};
|
|
19
|
+
var ExecutorTextDeltaSchema = AgentTextPartSchema2.extend(base).strict();
|
|
20
|
+
var ExecutorReasoningDeltaSchema = AgentReasoningPartSchema2.extend(base).strict();
|
|
21
|
+
var ExecutorToolCallDeltaSchema = AgentToolCallPartSchema2.extend(base).strict();
|
|
22
|
+
var ExecutorToolResultDeltaSchema = AgentToolResultPartSchema2.extend(base).strict();
|
|
23
|
+
var ExecutorRequestDeltaSchema = z.strictObject({
|
|
24
|
+
type: z.literal("request"),
|
|
25
|
+
...base,
|
|
26
|
+
interactionId: z.string().min(1),
|
|
27
|
+
kind: z.enum(["approval", "input"]),
|
|
28
|
+
callId: z.string().min(1).optional(),
|
|
29
|
+
toolName: z.string().min(1).optional(),
|
|
30
|
+
input: z.json().optional(),
|
|
31
|
+
prompt: z.string().optional()
|
|
32
|
+
});
|
|
33
|
+
var ExecutorRequestResolvedDeltaSchema = z.strictObject({
|
|
34
|
+
type: z.literal("request-resolved"),
|
|
35
|
+
...base,
|
|
36
|
+
interactionId: z.string().min(1)
|
|
37
|
+
});
|
|
38
|
+
var TokenCountSchema = z.int().nonnegative();
|
|
39
|
+
var MAX_MODEL_USAGE_ENTRIES = 64;
|
|
40
|
+
var ExecutorTokenUsageSchema2 = z.strictObject({
|
|
41
|
+
inputTokens: TokenCountSchema.optional(),
|
|
42
|
+
outputTokens: TokenCountSchema.optional(),
|
|
43
|
+
cachedInputTokens: TokenCountSchema.optional(),
|
|
44
|
+
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
45
|
+
thinkingTokens: TokenCountSchema.optional(),
|
|
46
|
+
totalTokens: TokenCountSchema.optional()
|
|
47
|
+
});
|
|
48
|
+
var ExecutorModelUsageSchema2 = z.strictObject({
|
|
49
|
+
inputTokens: TokenCountSchema,
|
|
50
|
+
outputTokens: TokenCountSchema,
|
|
51
|
+
cacheReadInputTokens: TokenCountSchema.optional(),
|
|
52
|
+
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
53
|
+
thinkingTokens: TokenCountSchema.optional(),
|
|
54
|
+
cacheCreationEphemeral5mInputTokens: TokenCountSchema.optional(),
|
|
55
|
+
cacheCreationEphemeral1hInputTokens: TokenCountSchema.optional(),
|
|
56
|
+
webSearchRequests: TokenCountSchema.optional(),
|
|
57
|
+
costUsd: z.number().nonnegative().optional(),
|
|
58
|
+
contextWindow: TokenCountSchema.optional(),
|
|
59
|
+
maxOutputTokens: TokenCountSchema.optional(),
|
|
60
|
+
canonicalModel: z.string().min(1).max(256).optional(),
|
|
61
|
+
provider: z.string().min(1).max(128).optional(),
|
|
62
|
+
costBasis: z.enum(["list", "managed", "unknown"]).optional()
|
|
63
|
+
});
|
|
64
|
+
var ExecutorUsageDeltaSchema = z.strictObject({
|
|
65
|
+
type: z.literal("usage"),
|
|
66
|
+
...base,
|
|
67
|
+
inputTokens: TokenCountSchema.optional(),
|
|
68
|
+
outputTokens: TokenCountSchema.optional(),
|
|
69
|
+
cachedInputTokens: TokenCountSchema.optional(),
|
|
70
|
+
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
71
|
+
thinkingTokens: TokenCountSchema.optional(),
|
|
72
|
+
totalTokens: TokenCountSchema.optional(),
|
|
73
|
+
costUsd: z.number().nonnegative().optional(),
|
|
74
|
+
total: ExecutorTokenUsageSchema2.optional(),
|
|
75
|
+
modelUsage: z.record(z.string().min(1).max(256), ExecutorModelUsageSchema2).refine((entries) => Object.keys(entries).length <= MAX_MODEL_USAGE_ENTRIES, `modelUsage must carry at most ${MAX_MODEL_USAGE_ENTRIES} models`).optional()
|
|
76
|
+
});
|
|
77
|
+
var ExecutorContextUsageDeltaSchema = z.strictObject({
|
|
78
|
+
type: z.literal("context-usage"),
|
|
79
|
+
...base,
|
|
80
|
+
usedTokens: TokenCountSchema,
|
|
81
|
+
windowTokens: TokenCountSchema
|
|
82
|
+
});
|
|
83
|
+
var ExecutorThreadDispositionSchema2 = z.enum(["reusable", "broken"]);
|
|
84
|
+
var ExecutorStartupPhaseSchema2 = z.string().trim().min(1).max(64);
|
|
85
|
+
var ExecutorStatusDeltaSchema2 = z.strictObject({
|
|
86
|
+
type: z.literal("status"),
|
|
87
|
+
...base,
|
|
88
|
+
phase: ExecutorStartupPhaseSchema2
|
|
89
|
+
});
|
|
90
|
+
var ExecutorTurnEndDeltaSchema = z.strictObject({
|
|
91
|
+
type: z.literal("turn-end"),
|
|
92
|
+
...base,
|
|
93
|
+
outcome: z.enum(["completed", "interrupted", "failed"]),
|
|
94
|
+
threadDisposition: ExecutorThreadDispositionSchema2.optional()
|
|
95
|
+
});
|
|
96
|
+
var ExecutorErrorKindSchema2 = z.enum([
|
|
97
|
+
"authRequired",
|
|
98
|
+
"rateLimited",
|
|
99
|
+
"restartRecommended",
|
|
100
|
+
"staleTurn",
|
|
101
|
+
"unhandled"
|
|
102
|
+
]);
|
|
103
|
+
var ExecutorErrorDeltaSchema = z.strictObject({
|
|
104
|
+
type: z.literal("error"),
|
|
105
|
+
...base,
|
|
106
|
+
kind: ExecutorErrorKindSchema2,
|
|
107
|
+
message: z.string().min(1)
|
|
108
|
+
});
|
|
109
|
+
var ExecutorWindowDeltaSchema = z.strictObject({
|
|
110
|
+
type: z.literal("window"),
|
|
111
|
+
...base,
|
|
112
|
+
reset: z.enum(["initial", "gap", "generation", "context"])
|
|
113
|
+
});
|
|
114
|
+
var ExecutorDeltaSchema2 = z.discriminatedUnion("type", [
|
|
115
|
+
ExecutorTextDeltaSchema,
|
|
116
|
+
ExecutorReasoningDeltaSchema,
|
|
117
|
+
ExecutorToolCallDeltaSchema,
|
|
118
|
+
ExecutorToolResultDeltaSchema,
|
|
119
|
+
ExecutorRequestDeltaSchema,
|
|
120
|
+
ExecutorRequestResolvedDeltaSchema,
|
|
121
|
+
ExecutorUsageDeltaSchema,
|
|
122
|
+
ExecutorContextUsageDeltaSchema,
|
|
123
|
+
ExecutorStatusDeltaSchema2,
|
|
124
|
+
ExecutorTurnEndDeltaSchema,
|
|
125
|
+
ExecutorErrorDeltaSchema,
|
|
126
|
+
ExecutorWindowDeltaSchema
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
export { ExecutorRawSchema2, ExecutorTokenUsageSchema2, ExecutorModelUsageSchema2, ExecutorThreadDispositionSchema2, ExecutorStartupPhaseSchema2, ExecutorStatusDeltaSchema2, ExecutorErrorKindSchema2, ExecutorDeltaSchema2 };
|