stitchkit 0.104.2 → 0.105.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 +372 -13
- package/darwin-native.cjs +4 -2
- package/dist/agent-runtime/browser-control-contract.d.ts +32 -2
- package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser-controller.d.ts +21 -3
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-refusals.d.ts +1 -0
- package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/contained-write.d.ts.map +1 -1
- package/dist/agent-runtime/control-schema.d.ts +48 -1
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-search.d.ts +3 -2
- package/dist/agent-runtime/deferred-tool-search.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts +34 -4
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-process-owner.d.ts +9 -1
- package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +32 -1
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +9 -4
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/testing.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-contract.d.ts +50 -0
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-generations.d.ts +24 -0
- package/dist/application/diagnostic-journal-generations.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-open.d.ts +10 -0
- package/dist/application/diagnostic-journal-open.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-quarantine.d.ts +28 -0
- package/dist/application/diagnostic-journal-quarantine.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-read-contract.d.ts +73 -3
- package/dist/application/diagnostic-journal-read-contract.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-reader.d.ts +17 -2
- package/dist/application/diagnostic-journal-reader.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-recovery.d.ts +18 -2
- package/dist/application/diagnostic-journal-recovery.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts +6 -2
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-tail.d.ts +12 -0
- package/dist/application/diagnostic-journal-tail.d.ts.map +1 -0
- package/dist/application/diagnostic-journal.d.ts +3 -0
- package/dist/application/diagnostic-journal.d.ts.map +1 -1
- package/dist/application/directory-inbox-accept.d.ts +3 -3
- package/dist/application/directory-inbox-accept.d.ts.map +1 -1
- package/dist/application/directory-inbox-contract.d.ts +38 -10
- package/dist/application/directory-inbox-contract.d.ts.map +1 -1
- package/dist/application/directory-inbox-delivery.d.ts +3 -3
- package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
- package/dist/application/directory-inbox-files.d.ts +17 -2
- package/dist/application/directory-inbox-files.d.ts.map +1 -1
- package/dist/application/directory-inbox-state.d.ts +1 -1
- package/dist/application/directory-inbox-state.d.ts.map +1 -1
- package/dist/application/directory-inbox.d.ts +1 -1
- package/dist/application/directory-inbox.d.ts.map +1 -1
- package/dist/application/file-state-store.d.ts +21 -1
- package/dist/application/file-state-store.d.ts.map +1 -1
- package/dist/application/grammy.d.ts.map +1 -1
- package/dist/application/kernel-contract.d.ts.map +1 -1
- package/dist/application/revision-signal.d.ts.map +1 -1
- package/dist/application/state-store.d.ts +3 -0
- package/dist/application/state-store.d.ts.map +1 -1
- package/dist/browser/api-error.d.ts +38 -0
- package/dist/browser/api-error.d.ts.map +1 -0
- package/dist/browser/chunked-upload.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http.d.ts +0 -25
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/resumable.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +0 -1
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +15 -18
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/durability/effect.d.ts.map +1 -1
- package/dist/durability/scheduler.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +29 -18
- package/dist/entrypoints/agent-runtime/coding-tools.js +8 -7
- package/dist/entrypoints/agent-runtime/harness.js +15 -14
- package/dist/entrypoints/agent-runtime/realtime.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/realtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/realtime.js +119 -54
- package/dist/entrypoints/agent-runtime/sandbox.js +23 -17
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +4 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +4 -3
- package/dist/entrypoints/agent-runtime/testing.js +8 -6
- package/dist/entrypoints/agent-runtime.js +37 -38
- package/dist/entrypoints/application/diagnostic-journal.js +305 -111
- package/dist/entrypoints/application/directory-inbox.js +174 -77
- package/dist/entrypoints/application/grammy.js +5 -2
- package/dist/entrypoints/application/opentelemetry.js +2 -2
- package/dist/entrypoints/application.d.ts +2 -2
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +17 -8
- package/dist/entrypoints/cli/publish.d.ts +16 -0
- package/dist/entrypoints/cli/publish.d.ts.map +1 -0
- package/dist/entrypoints/cli/publish.js +527 -0
- package/dist/entrypoints/cli.d.ts +1 -2
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +59 -966
- package/dist/entrypoints/contract.js +3 -3
- package/dist/entrypoints/files/packaging.js +153 -64
- package/dist/entrypoints/files.d.ts +1 -0
- package/dist/entrypoints/files.d.ts.map +1 -1
- package/dist/entrypoints/files.js +17 -10
- package/dist/entrypoints/index.d.ts +2 -1
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +31 -60
- package/dist/entrypoints/node.js +8 -8
- package/dist/entrypoints/observability.js +3 -3
- package/dist/entrypoints/primitives.js +67 -83
- package/dist/entrypoints/process.d.ts +1 -1
- package/dist/entrypoints/process.d.ts.map +1 -1
- package/dist/entrypoints/process.js +2 -2
- package/dist/entrypoints/react.js +4 -2
- package/dist/entrypoints/remote.js +37 -13
- package/dist/entrypoints/server.js +18 -16
- package/dist/entrypoints/telegram/screens.js +5 -3
- package/dist/entrypoints/telegram.js +31 -46
- package/dist/entrypoints/testing.d.ts +1 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +444 -448
- package/dist/entrypoints/tools/connections.js +268 -105
- package/dist/entrypoints/tools/contract.js +2 -2
- package/dist/entrypoints/tools/invoker.js +8 -7
- package/dist/entrypoints/tools/mcp.d.ts +2 -2
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
- package/dist/entrypoints/tools/mcp.js +10 -9
- package/dist/entrypoints/tools.d.ts +0 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +118 -53
- package/dist/entrypoints/tracking.js +2 -3
- package/dist/files/boundary.d.ts +2 -2
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/chunk-spool.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +2 -2
- package/dist/files/file-io.d.ts.map +1 -1
- package/dist/files/native-packaging-layout.d.ts +50 -4
- package/dist/files/native-packaging-layout.d.ts.map +1 -1
- package/dist/files/native-packaging.d.ts +78 -17
- package/dist/files/native-packaging.d.ts.map +1 -1
- package/dist/{index-r5hsgkz5.js → index-0gs4ymfj.js} +6 -3
- package/dist/{index-zax7resm.js → index-0gxvns6s.js} +1 -13
- package/dist/index-0s4xebbg.js +8 -0
- package/dist/{index-r4r70zmh.js → index-12zsej7b.js} +5 -2
- package/dist/{index-kemm0ej5.js → index-1pwwan01.js} +65 -22
- package/dist/{index-vgkbcnkc.js → index-299sm5tr.js} +1 -1
- package/dist/{index-2vnh05w4.js → index-2k91mewf.js} +31 -74
- package/dist/{index-269zqj8m.js → index-2rc6jd9n.js} +28 -12
- package/dist/{index-wh0ecvyk.js → index-37asdw3a.js} +1 -1
- package/dist/index-3h0ztg0z.js +285 -0
- package/dist/{index-g95fk660.js → index-4vsby8n8.js} +8 -15
- package/dist/index-556g5hsh.js +17 -0
- package/dist/{index-adhgd4pe.js → index-5p55xreg.js} +2 -2
- package/dist/index-5w6t91ze.js +47 -0
- package/dist/{index-9pw0a51a.js → index-6yxhe58g.js} +40 -7
- package/dist/{index-6d9xaxw1.js → index-8ks9b85e.js} +33 -5
- package/dist/{index-bhb950qs.js → index-916yh4e2.js} +25 -12
- package/dist/index-9tqbxv5p.js +44 -0
- package/dist/{index-5csmzesf.js → index-azx12jgv.js} +4 -3
- package/dist/{index-mbnnw3f2.js → index-b0kddvzw.js} +15 -5
- package/dist/{index-n5yqxd3d.js → index-b0w7rbpt.js} +23 -2
- package/dist/index-b56nnscm.js +132 -0
- package/dist/{index-0ndk4555.js → index-c0hffcmj.js} +2 -2
- package/dist/{index-pptyv13k.js → index-c17xcx4k.js} +42 -6
- package/dist/{index-g2j7pnak.js → index-cmzvhhtd.js} +5 -2
- package/dist/index-cq59agna.js +51 -0
- package/dist/{index-ssmd41kh.js → index-d2h99n7d.js} +1 -1
- package/dist/{index-z94wht4y.js → index-dky0dcmf.js} +34 -5
- package/dist/{index-za6j7nwy.js → index-dsnjzb62.js} +104 -51
- package/dist/index-eemvahkc.js +21 -0
- package/dist/index-ef8gdaq0.js +105 -0
- package/dist/{index-fa4wg312.js → index-f199nfq5.js} +10 -6
- package/dist/{index-ck71tbcf.js → index-fsw1ybf3.js} +11 -15
- package/dist/{index-f330qqyg.js → index-g2vfg7ak.js} +217 -63
- package/dist/{index-fk18k56k.js → index-gr5g3xfw.js} +11 -18
- package/dist/{index-jn9g8xdt.js → index-hjvje0pf.js} +6 -4
- package/dist/{index-x928baz2.js → index-j9gxbztg.js} +18 -14
- package/dist/index-kfjkb396.js +37 -0
- package/dist/{index-6drst9sg.js → index-ksfagmyz.js} +45 -345
- package/dist/index-m616f0yz.js +120 -0
- package/dist/{index-fm1c1a08.js → index-m6w6jtda.js} +40 -21
- package/dist/{index-ptn0g0gj.js → index-ma963wz7.js} +21 -20
- package/dist/{index-bakgedh8.js → index-msfpyy2f.js} +2 -4
- package/dist/{index-ywppsaby.js → index-n1nszyk0.js} +23 -34
- package/dist/{index-v14qqmys.js → index-n4689krb.js} +1 -1
- package/dist/{index-a0zzh8ak.js → index-pz3y6b6g.js} +3 -3
- package/dist/{index-43p08g7t.js → index-pzb63z66.js} +12 -8
- package/dist/{index-h97tqqp1.js → index-qaet40b2.js} +5 -3
- package/dist/{index-t1sr4aks.js → index-qaqbdm7s.js} +52 -6
- package/dist/{index-77nxk6ay.js → index-r393tnfp.js} +16 -10
- package/dist/{index-kb8styz3.js → index-rpzewktb.js} +15 -5
- package/dist/{index-27a2pj09.js → index-sj28htvf.js} +1 -1
- package/dist/index-szybbezc.js +455 -0
- package/dist/{index-2hyavjjj.js → index-wbhdzxar.js} +3 -3
- package/dist/{index-4e0ah203.js → index-wdy68sh6.js} +47 -24
- package/dist/{index-hbd32c6a.js → index-wqmvtnkp.js} +38 -89
- package/dist/{index-hp9d77wk.js → index-x7w1z6pf.js} +15 -4
- package/dist/{index-20yvtn9a.js → index-yt7gyg5x.js} +1 -1
- package/dist/{index-cvda079a.js → index-yvfk3y36.js} +12 -2
- package/dist/{index-5z6jn897.js → index-z23rfxhj.js} +1 -1
- package/dist/internal/abort-race.d.ts +8 -2
- package/dist/internal/abort-race.d.ts.map +1 -1
- package/dist/internal/atomic-file.d.ts +55 -9
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/atomic-publication.d.ts +39 -4
- package/dist/internal/atomic-publication.d.ts.map +1 -1
- package/dist/internal/atomic-staging.d.ts +46 -0
- package/dist/internal/atomic-staging.d.ts.map +1 -0
- package/dist/internal/bounded-file-read.d.ts +19 -11
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/bounded-lines.d.ts.map +1 -1
- package/dist/internal/close-after.d.ts +11 -0
- package/dist/internal/close-after.d.ts.map +1 -0
- package/dist/internal/deadline.d.ts +10 -0
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-read.d.ts +10 -12
- package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts +2 -2
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +14 -0
- package/dist/internal/file-observation.d.ts.map +1 -0
- package/dist/internal/json-data.d.ts +22 -5
- package/dist/internal/json-data.d.ts.map +1 -1
- package/dist/internal/positive-integer.d.ts +9 -0
- package/dist/internal/positive-integer.d.ts.map +1 -0
- package/dist/internal/process-instance.d.ts +35 -5
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/timers.d.ts +11 -0
- package/dist/internal/timers.d.ts.map +1 -0
- package/dist/internal/with-exclusive-lock.d.ts +5 -4
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts.map +1 -1
- package/dist/primitives/canonical-json.d.ts +23 -2
- package/dist/primitives/canonical-json.d.ts.map +1 -1
- package/dist/primitives/delivery.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/money.d.ts.map +1 -1
- package/dist/process/cleanup.d.ts +6 -1
- package/dist/process/cleanup.d.ts.map +1 -1
- package/dist/process/command-lifetime.d.ts +4 -0
- package/dist/process/command-lifetime.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/command.d.ts +4 -0
- package/dist/process/command.d.ts.map +1 -1
- package/dist/process/contract.d.ts +67 -2
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/process/group.d.ts +40 -3
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +12 -1
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/terminate.d.ts +39 -0
- package/dist/process/terminate.d.ts.map +1 -0
- package/dist/react/query-client.d.ts.map +1 -1
- package/dist/realtime/rejection.d.ts.map +1 -1
- package/dist/server/contract-stream.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/request-body.d.ts +0 -1
- package/dist/server/request-body.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/telegram/broadcast-delivery.d.ts.map +1 -1
- package/dist/telegram/broadcast-failure.d.ts +10 -2
- package/dist/telegram/broadcast-failure.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/screens/outcome.d.ts.map +1 -1
- package/dist/testing/surface-conformance.d.ts +1 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +0 -6
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +1 -1
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +2 -2
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/profile.d.ts.map +1 -1
- package/dist/tools/cli/publication-assets.d.ts.map +1 -1
- package/dist/tools/cli/publication-contract.d.ts +8 -0
- package/dist/tools/cli/publication-contract.d.ts.map +1 -1
- package/dist/tools/cli/publication-control.d.ts.map +1 -1
- package/dist/tools/cli/publication-storage.d.ts +23 -2
- package/dist/tools/cli/publication-storage.d.ts.map +1 -1
- package/dist/tools/cli/publication.d.ts +8 -1
- package/dist/tools/cli/publication.d.ts.map +1 -1
- package/dist/tools/connections/errors.d.ts +18 -6
- package/dist/tools/connections/errors.d.ts.map +1 -1
- package/dist/tools/connections/limits.d.ts +8 -2
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp-envelope.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/schema-budget.d.ts +1 -1
- package/dist/tools/connections/schema-budget.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts.map +1 -1
- package/dist/tools/execute-result.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +17 -3
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/internal/tool-error-projection.d.ts +16 -0
- package/dist/tools/internal/tool-error-projection.d.ts.map +1 -0
- package/dist/tools/internal/tool-view.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +3 -2
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +3 -2
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts +7 -0
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +18 -2
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +3 -3
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mcp/stdio-signals.d.ts +14 -0
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -1
- package/dist/tools/mcp/stdio.d.ts +7 -0
- package/dist/tools/mcp/stdio.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts +3 -3
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
- package/dist/tools/operations/wait-core.d.ts +0 -6
- package/dist/tools/operations/wait-core.d.ts.map +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/{runtime-tool-execution.d.ts → runtime-tool-declaration.d.ts} +32 -9
- package/dist/tools/runtime-tool-declaration.d.ts.map +1 -0
- package/dist/tools/runtime-tool-mcp.d.ts +6 -15
- package/dist/tools/runtime-tool-mcp.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +14 -12
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts +4 -0
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/flatten-join.d.ts.map +1 -1
- package/dist/tools/surface.d.ts +7 -11
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -1
- package/dist/tools/transfer/view-file-contract.d.ts.map +1 -1
- package/dist/tools/transfer/view-file.d.ts +1 -1
- package/dist/tools/transfer/view-file.d.ts.map +1 -1
- package/dist/tools/transports.d.ts +3 -2
- package/dist/tools/transports.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +10 -4
- package/llms/agent-runtime-harness.txt +32 -31
- package/llms/agent-runtime-react.txt +1 -1
- package/llms/agent-runtime-realtime.txt +14 -5
- package/llms/agent-runtime-sandbox.txt +3 -11
- package/llms/agent-runtime.3.txt +2 -2
- package/llms/agent-runtime.txt +0 -9
- package/llms/application.2.txt +3 -12
- package/llms/application.3.txt +7 -4
- package/llms/application.txt +44 -15
- package/llms/cli-publish.txt +29 -0
- package/llms/cli.2.txt +9 -11
- package/llms/cli.txt +26 -14
- package/llms/declaration.txt +0 -9
- package/llms/files-packaging.txt +16 -8
- package/llms/files.txt +4 -2
- package/llms/geo.txt +0 -9
- package/llms/live.txt +4 -13
- package/llms/observability.txt +31 -5
- package/llms/primitives.txt +38 -20
- package/llms/process.txt +287 -157
- package/llms/react-keyboard.txt +0 -9
- package/llms/react.txt +0 -18
- package/llms/server.4.txt +1 -1
- package/llms/server.5.txt +1 -1
- package/llms/server.txt +1 -1
- package/llms/stitchkit.txt +6 -7
- package/llms/telegram-screens.txt +2 -2
- package/llms/testing.txt +0 -1
- package/llms/tools-mcp.txt +2 -3
- package/llms/tools.2.txt +12 -0
- package/llms/tools.3.txt +5 -6
- package/llms/tools.txt +6 -4
- package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
- package/llms/{upgrading-0.44.0-0.61.0.txt → upgrading-0.53.0-0.67.0.txt} +576 -506
- package/llms/{upgrading-0.62.0-0.80.0.txt → upgrading-0.68.0-0.94.0.txt} +562 -576
- package/llms/{upgrading-0.81.0-0.104.0.txt → upgrading-0.95.0-0.105.0.txt} +452 -567
- package/llms/upgrading.txt +4 -4
- package/llms-full.txt +1029 -409
- package/llms.txt +24 -24
- package/native-assets.json +11 -3
- package/package.json +6 -6
- package/dist/agent-runtime/harness-tools.d.ts +0 -11
- package/dist/agent-runtime/harness-tools.d.ts.map +0 -1
- package/dist/entrypoints/agent-runtime/harness-tools.d.ts +0 -2
- package/dist/entrypoints/agent-runtime/harness-tools.d.ts.map +0 -1
- package/dist/entrypoints/agent-runtime/harness-tools.js +0 -32
- package/dist/index-1a6jtnd9.js +0 -88
- package/dist/index-8a9ksm91.js +0 -95
- package/dist/index-a3wma1hk.js +0 -48
- package/dist/index-jd470k6q.js +0 -109
- package/dist/index-n1dqr7gf.js +0 -20
- package/dist/index-nggfa2yn.js +0 -34
- package/dist/index-s4evrmp5.js +0 -98
- package/dist/index-ze1eph1k.js +0 -20
- package/dist/tools/connections/error-projection.d.ts +0 -4
- package/dist/tools/connections/error-projection.d.ts.map +0 -1
- package/dist/tools/runtime-tool-execution.d.ts.map +0 -1
- package/llms/agent-runtime-harness-tools.txt +0 -25
- package/llms/upgrading-0.37.0-0.44.0.txt +0 -444
|
@@ -30,6 +30,14 @@ function jsonStringSize(text, budget) {
|
|
|
30
30
|
|
|
31
31
|
// src/internal/json-data.ts
|
|
32
32
|
function isJsonData(value, limits, snapshot) {
|
|
33
|
+
return jsonDataRefusal(value, limits, snapshot) === undefined;
|
|
34
|
+
}
|
|
35
|
+
function jsonDataRefusal(value, limits, snapshot) {
|
|
36
|
+
let refusal;
|
|
37
|
+
const refuse = (reason) => {
|
|
38
|
+
refusal ??= reason;
|
|
39
|
+
return false;
|
|
40
|
+
};
|
|
33
41
|
const ancestors = new Set;
|
|
34
42
|
let nodes = 0;
|
|
35
43
|
let bytes = 0;
|
|
@@ -38,12 +46,14 @@ function isJsonData(value, limits, snapshot) {
|
|
|
38
46
|
if (byteLimit === undefined)
|
|
39
47
|
return true;
|
|
40
48
|
bytes += amount;
|
|
41
|
-
return bytes <= byteLimit;
|
|
49
|
+
return bytes <= byteLimit || refuse("bytes");
|
|
42
50
|
};
|
|
43
51
|
const chargeText = (text) => byteLimit === undefined || charge(jsonStringSize(text, byteLimit - bytes));
|
|
44
52
|
const visit = (item, depth, target, key) => {
|
|
45
|
-
if (++nodes > limits.maxNodes
|
|
46
|
-
return
|
|
53
|
+
if (++nodes > limits.maxNodes)
|
|
54
|
+
return refuse("nodes");
|
|
55
|
+
if (depth > limits.maxDepth)
|
|
56
|
+
return refuse("depth");
|
|
47
57
|
let captured = item;
|
|
48
58
|
if (item === null) {
|
|
49
59
|
if (!charge(4))
|
|
@@ -55,36 +65,43 @@ function isJsonData(value, limits, snapshot) {
|
|
|
55
65
|
if (!charge(item ? 4 : 5))
|
|
56
66
|
return false;
|
|
57
67
|
} else if (typeof item === "number") {
|
|
58
|
-
if (!Number.isFinite(item)
|
|
59
|
-
return
|
|
68
|
+
if (!Number.isFinite(item))
|
|
69
|
+
return refuse("not-json");
|
|
70
|
+
if (Object.is(item, -0)) {
|
|
71
|
+
if (!limits.zodJson)
|
|
72
|
+
return refuse("negative-zero");
|
|
73
|
+
captured = 0;
|
|
74
|
+
}
|
|
60
75
|
if (byteLimit !== undefined && !charge(String(item).length))
|
|
61
76
|
return false;
|
|
62
77
|
} else {
|
|
63
|
-
if (typeof item !== "object"
|
|
64
|
-
return
|
|
78
|
+
if (typeof item !== "object")
|
|
79
|
+
return refuse("not-json");
|
|
80
|
+
if (ancestors.has(item))
|
|
81
|
+
return refuse("cycle");
|
|
65
82
|
const array = Array.isArray(item);
|
|
66
83
|
const prototype = Object.getPrototypeOf(item);
|
|
67
84
|
if (array ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null)
|
|
68
|
-
return
|
|
85
|
+
return refuse("not-json");
|
|
69
86
|
let length = 0;
|
|
70
87
|
if (array) {
|
|
71
88
|
const descriptor = Object.getOwnPropertyDescriptor(item, "length");
|
|
72
89
|
if (!descriptor || !("value" in descriptor))
|
|
73
|
-
return
|
|
90
|
+
return refuse("not-json");
|
|
74
91
|
const capturedLength = descriptor.value;
|
|
75
92
|
if (typeof capturedLength !== "number" || !Number.isInteger(capturedLength) || capturedLength < 0 || capturedLength > 2 ** 32 - 1)
|
|
76
|
-
return
|
|
93
|
+
return refuse("not-json");
|
|
77
94
|
length = capturedLength;
|
|
78
95
|
if (length > limits.maxNodes - nodes)
|
|
79
|
-
return
|
|
96
|
+
return refuse("nodes");
|
|
80
97
|
if (byteLimit !== undefined && Math.max(2, length * 2 + 1) > byteLimit - bytes)
|
|
81
|
-
return
|
|
98
|
+
return refuse("bytes");
|
|
82
99
|
}
|
|
83
100
|
const keys = Reflect.ownKeys(item);
|
|
84
101
|
if (keys.length > limits.maxNodes - nodes + (array ? 1 : 0))
|
|
85
|
-
return
|
|
102
|
+
return refuse("nodes");
|
|
86
103
|
if (array && keys.length !== length + 1)
|
|
87
|
-
return
|
|
104
|
+
return refuse("not-json");
|
|
88
105
|
if (!charge(2))
|
|
89
106
|
return false;
|
|
90
107
|
const copy = target ? array ? [] : {} : undefined;
|
|
@@ -95,16 +112,18 @@ function isJsonData(value, limits, snapshot) {
|
|
|
95
112
|
if (array && memberKey === "length")
|
|
96
113
|
continue;
|
|
97
114
|
if (typeof memberKey !== "string")
|
|
98
|
-
return
|
|
115
|
+
return refuse("not-json");
|
|
116
|
+
if (limits.zodJson && !array && memberKey === "__proto__")
|
|
117
|
+
continue;
|
|
99
118
|
if (array && (!/^(0|[1-9][0-9]*)$/.test(memberKey) || Number(memberKey) >= length))
|
|
100
|
-
return
|
|
119
|
+
return refuse("not-json");
|
|
101
120
|
const descriptor = Object.getOwnPropertyDescriptor(item, memberKey);
|
|
102
121
|
if (!descriptor?.enumerable || !("value" in descriptor))
|
|
103
|
-
return
|
|
122
|
+
return refuse("not-json");
|
|
104
123
|
const memberValue = descriptor.value;
|
|
105
124
|
if (!array && limits.omitObjectUndefined && memberValue === undefined) {
|
|
106
125
|
if (++nodes > limits.maxNodes)
|
|
107
|
-
return
|
|
126
|
+
return refuse("nodes");
|
|
108
127
|
continue;
|
|
109
128
|
}
|
|
110
129
|
if (members++ > 0 && !charge(1))
|
|
@@ -129,10 +148,10 @@ function isJsonData(value, limits, snapshot) {
|
|
|
129
148
|
return true;
|
|
130
149
|
};
|
|
131
150
|
try {
|
|
132
|
-
return visit(value, 0, snapshot, "value");
|
|
151
|
+
return visit(value, 0, snapshot, "value") ? undefined : refusal ?? "not-json";
|
|
133
152
|
} catch {
|
|
134
|
-
return
|
|
153
|
+
return "not-json";
|
|
135
154
|
}
|
|
136
155
|
}
|
|
137
156
|
|
|
138
|
-
export { isJsonData };
|
|
157
|
+
export { isJsonData, jsonDataRefusal };
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
forbidden2,
|
|
3
3
|
conflict2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-j9gxbztg.js";
|
|
5
5
|
import {
|
|
6
6
|
loadDarwinBinding
|
|
7
7
|
} from "./index-v5ee8ath.js";
|
|
8
|
+
import {
|
|
9
|
+
stagingName
|
|
10
|
+
} from "./index-cq59agna.js";
|
|
8
11
|
import {
|
|
9
12
|
NativeCommandError2,
|
|
10
|
-
|
|
11
|
-
ownsCommandGroup,
|
|
13
|
+
CommandStopped,
|
|
12
14
|
startNativeCommand
|
|
13
|
-
} from "./index-
|
|
15
|
+
} from "./index-g2vfg7ak.js";
|
|
14
16
|
import {
|
|
15
|
-
|
|
17
|
+
probeAgentProcessSandboxOutcome,
|
|
16
18
|
missingSandboxRestrictions2,
|
|
17
19
|
codingRefusal,
|
|
18
20
|
codingPathRefusal,
|
|
19
21
|
refuseMissingCodingPath
|
|
20
|
-
} from "./index-
|
|
22
|
+
} from "./index-8ks9b85e.js";
|
|
21
23
|
import {
|
|
22
24
|
NumericFileHandle,
|
|
23
25
|
descriptorPath,
|
|
@@ -34,7 +36,7 @@ import {
|
|
|
34
36
|
} from "./index-gxm9rc97.js";
|
|
35
37
|
import {
|
|
36
38
|
defineRuntimeTool2
|
|
37
|
-
} from "./index-
|
|
39
|
+
} from "./index-yvfk3y36.js";
|
|
38
40
|
|
|
39
41
|
// src/agent-runtime/coding-tool-contract.ts
|
|
40
42
|
import { z } from "zod";
|
|
@@ -390,7 +392,7 @@ async function writeContainedFile(input) {
|
|
|
390
392
|
await writeFile(path2.join(descriptorPath(input.parent.handle), input.parent.basename), input.content, { flag: "wx", mode });
|
|
391
393
|
return;
|
|
392
394
|
}
|
|
393
|
-
const temporary =
|
|
395
|
+
const temporary = stagingName();
|
|
394
396
|
if (process.platform === "darwin") {
|
|
395
397
|
const binding = loadDarwinBinding();
|
|
396
398
|
let created = false;
|
|
@@ -1067,15 +1069,14 @@ async function runCodingShell(input) {
|
|
|
1067
1069
|
env: { ...input.environment },
|
|
1068
1070
|
envPolicy: "declared-only",
|
|
1069
1071
|
signal: input.signal ?? new AbortController().signal,
|
|
1070
|
-
|
|
1072
|
+
stop: { target: "group", graceMs: 0 },
|
|
1073
|
+
descendants: "terminate-after-leader",
|
|
1071
1074
|
onOutput: (bytes, channel) => retain(channel === "stdout" ? stdout : stderr, channel === "stdout" ? artifactStdout : artifactStderr, bytes),
|
|
1072
|
-
onLeaderSettled:
|
|
1075
|
+
onLeaderSettled: (event) => {
|
|
1073
1076
|
if (event.kind !== "exit")
|
|
1074
1077
|
return;
|
|
1075
1078
|
exitCode = event.exitCode;
|
|
1076
1079
|
signal = event.signal;
|
|
1077
|
-
if (process.platform !== "win32" && child && ownsCommandGroup(child))
|
|
1078
|
-
await stopCommandGroup(child?.pid, 0, input.terminationGraceMs, true);
|
|
1079
1080
|
}
|
|
1080
1081
|
}, (started) => {
|
|
1081
1082
|
child = started;
|
|
@@ -1104,7 +1105,7 @@ async function runCodingShell(input) {
|
|
|
1104
1105
|
outcome = "cancelled";
|
|
1105
1106
|
else if (error instanceof NativeCommandError2 && error.code === "COMMAND_LIMIT" && (error.reason === "deadline" || error.reason === "output-budget"))
|
|
1106
1107
|
outcome = error.reason === "deadline" ? "timeout" : "output-limit";
|
|
1107
|
-
else if (error instanceof
|
|
1108
|
+
else if (error instanceof CommandStopped)
|
|
1108
1109
|
outcome = "cancelled";
|
|
1109
1110
|
else
|
|
1110
1111
|
throw error;
|
|
@@ -1182,10 +1183,12 @@ function createShellCodingTool(config, limits) {
|
|
|
1182
1183
|
let executableArgs = input.args;
|
|
1183
1184
|
let environment = config.environment ?? {};
|
|
1184
1185
|
if (config.sandbox) {
|
|
1185
|
-
const
|
|
1186
|
+
const probed = await probeAgentProcessSandboxOutcome(config.sandbox.adapter);
|
|
1187
|
+
const grade = probed.grade;
|
|
1186
1188
|
if (grade.grade === "unavailable") {
|
|
1187
1189
|
codingRefusal("SANDBOX_UNAVAILABLE", "The configured process sandbox is unavailable", {
|
|
1188
|
-
details: { reason: grade.reason }
|
|
1190
|
+
details: { reason: grade.reason },
|
|
1191
|
+
...probed.cause !== undefined && { cause: probed.cause }
|
|
1189
1192
|
});
|
|
1190
1193
|
}
|
|
1191
1194
|
const missing = missingSandboxRestrictions2(grade, config.sandbox.required);
|
|
@@ -1206,14 +1209,12 @@ function createShellCodingTool(config, limits) {
|
|
|
1206
1209
|
executableArgs = [...prepared.args];
|
|
1207
1210
|
environment = prepared.environment ?? environment;
|
|
1208
1211
|
} catch (error) {
|
|
1209
|
-
const refreshed = await
|
|
1212
|
+
const refreshed = await probeAgentProcessSandboxOutcome(config.sandbox.adapter, {
|
|
1210
1213
|
refresh: true
|
|
1211
1214
|
});
|
|
1212
1215
|
codingRefusal("SANDBOX_UNAVAILABLE", "The process sandbox failed while preparing a command", {
|
|
1213
|
-
details: {
|
|
1214
|
-
|
|
1215
|
-
reason: error instanceof Error ? error.message : "unknown sandbox error"
|
|
1216
|
-
}
|
|
1216
|
+
details: { grade: refreshed.grade.grade, reason: "sandbox prepare failed" },
|
|
1217
|
+
cause: refreshed.cause === undefined ? error : new AggregateError([error, refreshed.cause], "Sandbox prepare failed and probing it again failed")
|
|
1217
1218
|
});
|
|
1218
1219
|
}
|
|
1219
1220
|
}
|
|
@@ -133,10 +133,8 @@ function renewEntry(state, claim, now, leaseMs) {
|
|
|
133
133
|
}
|
|
134
134
|
function forgetMissing(state, present, now) {
|
|
135
135
|
const live = (claim) => claim.leaseUntil !== null && Date.parse(claim.leaseUntil) > now.getTime();
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
claims: state.claims.filter((claim) => present.has(claim.key) || live(claim))
|
|
139
|
-
};
|
|
136
|
+
const claims = state.claims.filter((claim) => present.has(claim.key) || live(claim));
|
|
137
|
+
return claims.length === state.claims.length ? state : { ...state, claims };
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
export { DirectoryInboxIdentitySchema2, DirectoryInboxAcceptResultSchema2, DirectoryInboxRejectionReasonSchema2, DirectoryInboxStateSchema2, emptyDirectoryInboxState, withRejection, claimEntry, completeEntry, releaseEntry, ownsClaim, renewEntry, forgetMissing };
|
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
createTraceContext2,
|
|
3
3
|
formatTraceparent2
|
|
4
4
|
} from "./index-yex7eg1v.js";
|
|
5
|
+
import {
|
|
6
|
+
ApiError2
|
|
7
|
+
} from "./index-kfjkb396.js";
|
|
5
8
|
import {
|
|
6
9
|
isRecord,
|
|
7
10
|
transportResult
|
|
@@ -366,36 +369,6 @@ function responseOf(xhr) {
|
|
|
366
369
|
}
|
|
367
370
|
|
|
368
371
|
// src/browser/http.ts
|
|
369
|
-
var API_ERROR_BRAND = Symbol.for("stitchkit.ApiError");
|
|
370
|
-
function messageForCode(code, message) {
|
|
371
|
-
return message !== undefined && message.length > 0 ? message : `${code} (no message supplied)`;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
class ApiError2 extends Error {
|
|
375
|
-
code;
|
|
376
|
-
status;
|
|
377
|
-
details;
|
|
378
|
-
hint;
|
|
379
|
-
traceId;
|
|
380
|
-
retryable;
|
|
381
|
-
constructor(code, status = 0, details, message, hint, traceId, options, retryable) {
|
|
382
|
-
super(messageForCode(code, message), options);
|
|
383
|
-
this.code = code;
|
|
384
|
-
this.status = status;
|
|
385
|
-
this.details = details;
|
|
386
|
-
this.hint = hint;
|
|
387
|
-
this.traceId = traceId;
|
|
388
|
-
this.retryable = retryable;
|
|
389
|
-
this.name = "ApiError";
|
|
390
|
-
Object.defineProperty(this, API_ERROR_BRAND, { value: true });
|
|
391
|
-
}
|
|
392
|
-
static is(error) {
|
|
393
|
-
return typeof error === "object" && error !== null && API_ERROR_BRAND in error;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
function refuseLocally(path, message) {
|
|
397
|
-
return new ApiError2("VALIDATION_ERROR", 0, { issues: [{ path, code: "invalid_type", message }] }, message);
|
|
398
|
-
}
|
|
399
372
|
function isAbortLikeError(error) {
|
|
400
373
|
if (error instanceof RequestCancellationError)
|
|
401
374
|
return true;
|
|
@@ -439,7 +412,10 @@ function assertTransportChoice(config) {
|
|
|
439
412
|
}
|
|
440
413
|
function requestFailure(error, emit) {
|
|
441
414
|
if (error instanceof RequestCancellationError) {
|
|
442
|
-
return new ApiError2(error.cause === "caller" ? "REQUEST_ABORTED" : "REQUEST_TIMEOUT",
|
|
415
|
+
return new ApiError2(error.cause === "caller" ? "REQUEST_ABORTED" : "REQUEST_TIMEOUT", {
|
|
416
|
+
status: 0,
|
|
417
|
+
message: error.message
|
|
418
|
+
});
|
|
443
419
|
}
|
|
444
420
|
if (ApiError2.is(error))
|
|
445
421
|
return error;
|
|
@@ -447,7 +423,13 @@ function requestFailure(error, emit) {
|
|
|
447
423
|
const response = isHTTPError(error) ? error.response : undefined;
|
|
448
424
|
const status = response?.status ?? 0;
|
|
449
425
|
const msg = error instanceof Error ? error.message : undefined;
|
|
450
|
-
return new ApiError2("UNKNOWN_ERROR",
|
|
426
|
+
return new ApiError2("UNKNOWN_ERROR", {
|
|
427
|
+
status,
|
|
428
|
+
details: msg ? { message: msg } : undefined,
|
|
429
|
+
message: msg,
|
|
430
|
+
traceId: responseTraceId(response),
|
|
431
|
+
cause: error
|
|
432
|
+
});
|
|
451
433
|
}
|
|
452
434
|
function jsonBodyOf(data) {
|
|
453
435
|
return data === undefined ? null : JSON.stringify(data);
|
|
@@ -526,7 +508,14 @@ function createHttpClient2(config) {
|
|
|
526
508
|
const parsed = body === null ? null : parseError(body);
|
|
527
509
|
if (!parsed)
|
|
528
510
|
return error;
|
|
529
|
-
return new ApiError2(parsed.code,
|
|
511
|
+
return new ApiError2(parsed.code, {
|
|
512
|
+
status: error.response.status,
|
|
513
|
+
details: parsed.details,
|
|
514
|
+
message: parsed.message,
|
|
515
|
+
hint: parsed.hint,
|
|
516
|
+
traceId: responseTraceId(error.response),
|
|
517
|
+
retryable: typeof parsed.retryable === "boolean" ? parsed.retryable : undefined
|
|
518
|
+
});
|
|
530
519
|
}
|
|
531
520
|
]
|
|
532
521
|
}
|
|
@@ -581,4 +570,4 @@ function createHttpClient2(config) {
|
|
|
581
570
|
};
|
|
582
571
|
}
|
|
583
572
|
|
|
584
|
-
export { RequestCancellationError, createRequestCancellation, resolveClientFetch, responseTraceId, uploadProgressRoute, withUploadProgress,
|
|
573
|
+
export { RequestCancellationError, createRequestCancellation, resolveClientFetch, responseTraceId, uploadProgressRoute, withUploadProgress, isAbortLikeError, parseApiErrorBody, createHttpClient2 };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectToolSurface
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-r393tnfp.js";
|
|
4
4
|
import {
|
|
5
5
|
contractToolMountable
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-wbhdzxar.js";
|
|
7
7
|
import {
|
|
8
8
|
runtimeToolMountable
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-yvfk3y36.js";
|
|
10
10
|
|
|
11
11
|
// src/tools/surface.ts
|
|
12
12
|
function collectToolSurface({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppError2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-j9gxbztg.js";
|
|
4
4
|
import {
|
|
5
5
|
RealtimeRequestInvalidAcknowledgementError2,
|
|
6
6
|
RealtimeRequestRejectedError2
|
|
@@ -60,13 +60,17 @@ import { z } from "zod";
|
|
|
60
60
|
function realtimeContractViolation(options) {
|
|
61
61
|
const issues = options.cause instanceof z.ZodError ? zodIssues2(options.cause) : undefined;
|
|
62
62
|
const reason = options.reason.replaceAll("-", " ");
|
|
63
|
-
const error = new AppError2("REALTIME_CONTRACT_VIOLATION",
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
const error = new AppError2("REALTIME_CONTRACT_VIOLATION", {
|
|
64
|
+
message: `Realtime event "${options.event}" (${options.direction}, ${options.phase}): ${reason}`,
|
|
65
|
+
status: 500,
|
|
66
|
+
details: {
|
|
67
|
+
event: options.event,
|
|
68
|
+
direction: options.direction,
|
|
69
|
+
phase: options.phase,
|
|
70
|
+
reason: options.reason,
|
|
71
|
+
fault: options.fault,
|
|
72
|
+
...issues !== undefined && { issues }
|
|
73
|
+
}
|
|
70
74
|
});
|
|
71
75
|
if (options.cause !== undefined)
|
|
72
76
|
error.cause = options.cause;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertPositiveSafeInteger
|
|
3
|
+
} from "./index-0s4xebbg.js";
|
|
4
|
+
|
|
1
5
|
// src/observability/status.ts
|
|
2
6
|
import { z } from "zod";
|
|
3
7
|
var NonNegativeIntegerSchema = z.number().int().nonnegative();
|
|
@@ -100,9 +104,7 @@ function invokeIsolated(callback) {
|
|
|
100
104
|
}
|
|
101
105
|
function createBoundedSinkManager(config) {
|
|
102
106
|
const maxPending = config.maxPending ?? DEFAULT_MAX_PENDING;
|
|
103
|
-
|
|
104
|
-
throw new TypeError("Observability maxPending must be a positive safe integer");
|
|
105
|
-
}
|
|
107
|
+
assertPositiveSafeInteger("Observability maxPending", maxPending);
|
|
106
108
|
let sequence = 0;
|
|
107
109
|
let closed = false;
|
|
108
110
|
let received = 0;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentToolError2,
|
|
3
3
|
resolveToolDurability
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-c17xcx4k.js";
|
|
5
5
|
import {
|
|
6
6
|
toolResultFromError,
|
|
7
7
|
toolCauseFromResult,
|
|
8
8
|
isToolExecutionControlError2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-2k91mewf.js";
|
|
10
10
|
import {
|
|
11
11
|
createToolRunner,
|
|
12
12
|
formatToolError
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-wbhdzxar.js";
|
|
14
14
|
import {
|
|
15
15
|
collectToolSurface
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-pz3y6b6g.js";
|
|
17
|
+
import {
|
|
18
|
+
agentPresenterOf
|
|
19
|
+
} from "./index-yvfk3y36.js";
|
|
17
20
|
import {
|
|
18
21
|
isRecord
|
|
19
22
|
} from "./index-9jfdm5tg.js";
|
|
@@ -75,7 +78,7 @@ function mountAgent2(services, config = {}) {
|
|
|
75
78
|
return result.data;
|
|
76
79
|
throw new AgentToolError2(formatToolError(result, mountable.name, config.errorHint), toolCauseFromResult(result));
|
|
77
80
|
};
|
|
78
|
-
const presenter = entry.kind === "runtime" ? entry.definition
|
|
81
|
+
const presenter = entry.kind === "runtime" ? agentPresenterOf(entry.definition) : undefined;
|
|
79
82
|
if (entry.kind === "runtime" && presenter) {
|
|
80
83
|
const { definition } = entry;
|
|
81
84
|
const output = definition.output;
|
|
@@ -108,4 +111,47 @@ function mountAgent2(services, config = {}) {
|
|
|
108
111
|
return tools;
|
|
109
112
|
}
|
|
110
113
|
|
|
111
|
-
|
|
114
|
+
// src/tools/manifest.ts
|
|
115
|
+
function utf8Length(value) {
|
|
116
|
+
return new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
117
|
+
}
|
|
118
|
+
function describeToolCatalog2(config) {
|
|
119
|
+
const deferred = new Set(config.deferredNames ?? []);
|
|
120
|
+
const entries = collectToolSurface({
|
|
121
|
+
surface: config,
|
|
122
|
+
transport: config.transport,
|
|
123
|
+
extend: config.extend,
|
|
124
|
+
flattenUnionInput: config.flattenUnionInput
|
|
125
|
+
}).map(({ kind, service, action, mountable }) => {
|
|
126
|
+
const schemaBytes = utf8Length(mountable.presentationSchema);
|
|
127
|
+
return {
|
|
128
|
+
name: mountable.name,
|
|
129
|
+
description: mountable.method.desc,
|
|
130
|
+
inputSchema: mountable.presentationSchema,
|
|
131
|
+
source: { kind, service, action },
|
|
132
|
+
schemaBytes,
|
|
133
|
+
deferred: deferred.has(mountable.name)
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
if (config.maxSchemaBytes !== undefined) {
|
|
137
|
+
const total = entries.reduce((sum, entry) => sum + entry.schemaBytes, 0);
|
|
138
|
+
if (total > config.maxSchemaBytes) {
|
|
139
|
+
throw new TypeError(`Tool catalog schemas use ${total} bytes, exceeding maxSchemaBytes ${config.maxSchemaBytes}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return entries;
|
|
143
|
+
}
|
|
144
|
+
function buildToolManifest2(config) {
|
|
145
|
+
return collectToolSurface({
|
|
146
|
+
surface: config,
|
|
147
|
+
transport: config.transport,
|
|
148
|
+
extend: config.extend,
|
|
149
|
+
flattenUnionInput: config.flattenUnionInput
|
|
150
|
+
}).map(({ mountable }) => ({
|
|
151
|
+
name: mountable.name,
|
|
152
|
+
description: mountable.method.desc,
|
|
153
|
+
inputSchema: mountable.presentationSchema
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { mountAgent2, describeToolCatalog2, buildToolManifest2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppError2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-j9gxbztg.js";
|
|
4
4
|
import {
|
|
5
5
|
validateDeclaredOutput
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-rpzewktb.js";
|
|
7
7
|
import {
|
|
8
8
|
toJsonSchema
|
|
9
9
|
} from "./index-ct75c3at.js";
|
|
@@ -324,8 +324,8 @@ function describeVariants(properties, discriminator) {
|
|
|
324
324
|
}
|
|
325
325
|
return [...groups].map(([description, labels]) => ({
|
|
326
326
|
description,
|
|
327
|
-
labels: [...new Set(labels)].
|
|
328
|
-
})).
|
|
327
|
+
labels: [...new Set(labels)].join(" | ")
|
|
328
|
+
})).map(({ description, labels }) => `When ${discriminator} = ${labels}: ${description}`).join(" ");
|
|
329
329
|
}
|
|
330
330
|
function mergePropertySchemas(properties, discriminator) {
|
|
331
331
|
const schemas = properties.map((property) => nullableProjection(property.schema));
|
|
@@ -337,7 +337,7 @@ function mergePropertySchemas(properties, discriminator) {
|
|
|
337
337
|
} else {
|
|
338
338
|
const values = schemas.map(stringValues);
|
|
339
339
|
const allStrings = values.every((value) => value !== null);
|
|
340
|
-
merged = allStrings ? { type: "string", enum: [...new Set(values.flatMap((value) => value ?? []))]
|
|
340
|
+
merged = allStrings ? { type: "string", enum: [...new Set(values.flatMap((value) => value ?? []))] } : commonBaseType(structural);
|
|
341
341
|
}
|
|
342
342
|
const description = describeVariants(properties.map((property, index) => ({
|
|
343
343
|
...property,
|
|
@@ -457,7 +457,7 @@ function flattenNode(node) {
|
|
|
457
457
|
[discriminator.key]: mergePropertySchemas(discriminatorProperties, discriminator.key)
|
|
458
458
|
};
|
|
459
459
|
const required = [discriminator.key];
|
|
460
|
-
for (const [key, entries] of
|
|
460
|
+
for (const [key, entries] of perKey) {
|
|
461
461
|
let merged = mergePropertySchemas(entries, discriminator.key);
|
|
462
462
|
const requiredEverywhere = entries.length === variants.length && entries.every((entry) => entry.required);
|
|
463
463
|
if (requiredEverywhere) {
|
|
@@ -465,9 +465,9 @@ function flattenNode(node) {
|
|
|
465
465
|
} else {
|
|
466
466
|
const requiredLabels = entries.filter((entry) => entry.required).flatMap((entry) => entry.labels);
|
|
467
467
|
const presentLabels = entries.flatMap((entry) => entry.labels);
|
|
468
|
-
merged = appendHint(merged, `Available if ${discriminator.key} = ${[...new Set(presentLabels)].
|
|
468
|
+
merged = appendHint(merged, `Available if ${discriminator.key} = ${[...new Set(presentLabels)].join(" | ")}.`);
|
|
469
469
|
if (requiredLabels.length > 0) {
|
|
470
|
-
merged = appendHint(merged, `Required if ${discriminator.key} = ${[...new Set(requiredLabels)].
|
|
470
|
+
merged = appendHint(merged, `Required if ${discriminator.key} = ${[...new Set(requiredLabels)].join(" | ")}`);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
properties[key] = merged;
|
|
@@ -597,7 +597,10 @@ function projectToolView(options) {
|
|
|
597
597
|
try {
|
|
598
598
|
projected = Reflect.apply(view.project, undefined, [options.full, options.call]);
|
|
599
599
|
} catch (error) {
|
|
600
|
-
const failure = new AppError2("INTERNAL_SERVER_ERROR",
|
|
600
|
+
const failure = new AppError2("INTERNAL_SERVER_ERROR", {
|
|
601
|
+
message: `${options.operation} toolView.project threw`,
|
|
602
|
+
status: 500
|
|
603
|
+
});
|
|
601
604
|
failure.cause = error;
|
|
602
605
|
throw failure;
|
|
603
606
|
}
|
|
@@ -605,7 +608,10 @@ function projectToolView(options) {
|
|
|
605
608
|
Promise.resolve(projected).catch(() => {
|
|
606
609
|
return;
|
|
607
610
|
});
|
|
608
|
-
throw new AppError2("INTERNAL_SERVER_ERROR",
|
|
611
|
+
throw new AppError2("INTERNAL_SERVER_ERROR", {
|
|
612
|
+
message: `${options.operation} toolView.project returned a Promise — it must be synchronous`,
|
|
613
|
+
status: 500
|
|
614
|
+
});
|
|
609
615
|
}
|
|
610
616
|
if (projected === undefined) {
|
|
611
617
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppError2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-j9gxbztg.js";
|
|
4
4
|
import {
|
|
5
5
|
zodIssues2,
|
|
6
6
|
formatZodError2
|
|
@@ -31,18 +31,28 @@ function recordedErrorMessage(code, envelopeMessage, thrown) {
|
|
|
31
31
|
function normalizeError2(err, options = {}) {
|
|
32
32
|
if (AppError2.is(err)) {
|
|
33
33
|
if (err.code === "REALTIME_CONTRACT_VIOLATION") {
|
|
34
|
-
return new AppError2("REALTIME_CONTRACT_VIOLATION",
|
|
34
|
+
return new AppError2("REALTIME_CONTRACT_VIOLATION", {
|
|
35
|
+
message: "Realtime contract violation",
|
|
36
|
+
status: 500
|
|
37
|
+
});
|
|
35
38
|
}
|
|
36
39
|
return err;
|
|
37
40
|
}
|
|
38
41
|
if (err instanceof z.ZodError) {
|
|
39
|
-
return new AppError2("VALIDATION_ERROR",
|
|
40
|
-
|
|
42
|
+
return new AppError2("VALIDATION_ERROR", {
|
|
43
|
+
message: formatZodError2(err),
|
|
44
|
+
status: 400,
|
|
45
|
+
details: {
|
|
46
|
+
issues: zodIssues2(err).slice(0, MAX_DETAIL_ISSUES)
|
|
47
|
+
}
|
|
41
48
|
});
|
|
42
49
|
}
|
|
43
50
|
if (options.logUnexpected !== false)
|
|
44
51
|
console.error("[stitchkit] unhandled error:", err);
|
|
45
|
-
return new AppError2("INTERNAL_SERVER_ERROR",
|
|
52
|
+
return new AppError2("INTERNAL_SERVER_ERROR", {
|
|
53
|
+
message: "Internal server error",
|
|
54
|
+
status: 500
|
|
55
|
+
});
|
|
46
56
|
}
|
|
47
57
|
function strippedPaths(before, after, prefix) {
|
|
48
58
|
if (Array.isArray(before)) {
|