stitchkit 0.135.1 → 0.136.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 +109 -0
- package/README.md +25 -11
- package/dist/agent-executor/acp/v1-session-build.d.ts +51 -0
- package/dist/agent-executor/acp/v1-session-build.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-session.d.ts +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/classify.d.ts +1 -1
- package/dist/agent-executor/claude/classify.d.ts.map +1 -1
- package/dist/agent-executor/claude/events-wire.d.ts +13 -0
- package/dist/agent-executor/claude/events-wire.d.ts.map +1 -0
- package/dist/agent-executor/claude/events.d.ts +1 -11
- package/dist/agent-executor/claude/events.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +0 -143
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/server-requests.d.ts +150 -0
- package/dist/agent-executor/codex/server-requests.d.ts.map +1 -0
- package/dist/agent-executor/image-input.d.ts +10 -3
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
- package/dist/agent-runtime/browser/browser-control-contract.d.ts +4 -0
- package/dist/agent-runtime/browser/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-schema.d.ts +4 -0
- package/dist/agent-runtime/browser/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/browser/control-view.d.ts.map +1 -1
- package/dist/agent-runtime/event-schema.d.ts +16 -3
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/loop/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/loop/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/loop/invocation-stream.d.ts +9 -1
- package/dist/agent-runtime/loop/invocation-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/provider-stream-parts.d.ts +6 -0
- package/dist/agent-runtime/loop/provider-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/loop/provider-stream-segments.d.ts +1 -1
- package/dist/agent-runtime/loop/provider-stream-segments.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-approval-signature.d.ts +34 -0
- package/dist/agent-runtime/loop/run-approval-signature.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-approval.d.ts +0 -28
- package/dist/agent-runtime/loop/run-approval.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete-port.d.ts +24 -0
- package/dist/agent-runtime/loop/run-complete-port.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-complete-stream.d.ts +7 -2
- package/dist/agent-runtime/loop/run-complete-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete-types.d.ts +14 -1
- package/dist/agent-runtime/loop/run-complete-types.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-complete.d.ts +2 -2
- package/dist/agent-runtime/loop/run-complete.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-execution-state.d.ts +8 -0
- package/dist/agent-runtime/loop/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-model-call.d.ts +44 -0
- package/dist/agent-runtime/loop/run-model-call.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-model-step.d.ts +25 -28
- package/dist/agent-runtime/loop/run-model-step.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-model-steps.d.ts +6 -0
- package/dist/agent-runtime/loop/run-model-steps.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-model-stream.d.ts +3 -1
- package/dist/agent-runtime/loop/run-model-stream.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts +0 -2
- package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-step-loop.d.ts +19 -0
- package/dist/agent-runtime/loop/run-step-loop.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-step-port.d.ts +175 -0
- package/dist/agent-runtime/loop/run-step-port.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-stream-step-text.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts +2 -1
- package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-call-input.d.ts +39 -0
- package/dist/agent-runtime/loop/run-tool-call-input.d.ts.map +1 -0
- package/dist/agent-runtime/loop/run-tool-call.d.ts +2 -31
- package/dist/agent-runtime/loop/run-tool-call.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-errors.d.ts +5 -0
- package/dist/agent-runtime/loop/run-tool-errors.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-executor.d.ts +1 -1
- package/dist/agent-runtime/loop/run-tool-executor.d.ts.map +1 -1
- package/dist/agent-runtime/loop/run-tool-slots.d.ts +2 -1
- package/dist/agent-runtime/loop/run-tool-slots.d.ts.map +1 -1
- package/dist/agent-runtime/loop/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/loop/runtime.d.ts +0 -5
- package/dist/agent-runtime/loop/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/providers/ai-sdk-convert.d.ts +1 -5
- package/dist/agent-runtime/providers/ai-sdk-convert.d.ts.map +1 -1
- package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts +11 -0
- package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts.map +1 -0
- package/dist/agent-runtime/providers/ai-sdk-tools.d.ts +11 -0
- package/dist/agent-runtime/providers/ai-sdk-tools.d.ts.map +1 -0
- package/dist/agent-runtime/providers/ai-sdk.d.ts +1 -9
- package/dist/agent-runtime/providers/ai-sdk.d.ts.map +1 -1
- package/dist/agent-runtime/providers/anthropic-sse.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-admission.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-audio.d.ts +123 -81
- package/dist/agent-runtime/providers/openrouter-audio.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-catalog-cache.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-catalog-query.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-catalog.d.ts +2 -2
- package/dist/agent-runtime/providers/openrouter-catalog.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-client.d.ts +37 -0
- package/dist/agent-runtime/providers/openrouter-client.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-http.d.ts +26 -6
- package/dist/agent-runtime/providers/openrouter-http.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-media.d.ts +91 -77
- package/dist/agent-runtime/providers/openrouter-media.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-models.d.ts +2 -23
- package/dist/agent-runtime/providers/openrouter-models.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-options.d.ts +2 -0
- package/dist/agent-runtime/providers/openrouter-options.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-request.d.ts +23 -0
- package/dist/agent-runtime/providers/openrouter-request.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-retrieval.d.ts +86 -55
- package/dist/agent-runtime/providers/openrouter-retrieval.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-speech.d.ts +90 -0
- package/dist/agent-runtime/providers/openrouter-speech.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter-spend.d.ts +2 -2
- package/dist/agent-runtime/providers/openrouter-spend.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-stream.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-systemone.d.ts +87 -32
- package/dist/agent-runtime/providers/openrouter-systemone.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-url.d.ts +7 -1
- package/dist/agent-runtime/providers/openrouter-url.d.ts.map +1 -1
- package/dist/agent-runtime/providers/openrouter-wire.d.ts +45 -0
- package/dist/agent-runtime/providers/openrouter-wire.d.ts.map +1 -0
- package/dist/agent-runtime/providers/openrouter.d.ts +1 -3
- package/dist/agent-runtime/providers/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-http.d.ts +14 -2
- package/dist/agent-runtime/providers/provider-http.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-json-schema-strip.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-json-schema.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-openai-chat-sse.d.ts.map +1 -1
- package/dist/agent-runtime/providers/provider-openai-chat-state.d.ts +42 -0
- package/dist/agent-runtime/providers/provider-openai-chat-state.d.ts.map +1 -0
- package/dist/agent-runtime/providers/provider-usage.d.ts +9 -0
- package/dist/agent-runtime/providers/provider-usage.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts +9 -0
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts +6 -0
- package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-linux.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts +5 -1
- package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox/sandbox-process-wrapper.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/stores/branch-observations.d.ts +42 -42
- package/dist/agent-runtime/stores/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/agent-runtime/testing/fault-bench.d.ts +5 -1
- package/dist/agent-runtime/testing/fault-bench.d.ts.map +1 -1
- package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/testing/store-conformance-support.d.ts +10 -10
- package/dist/application/diagnostic-journal-contract.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/contract/define.d.ts +3 -7
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +17 -5
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +4 -2
- package/dist/entrypoints/agent-executor/claude-sdk.js +20 -20
- package/dist/entrypoints/agent-executor/claude.js +7 -7
- package/dist/entrypoints/agent-executor/codex.d.ts +2 -1
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +129 -35
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +2 -2
- package/dist/entrypoints/agent-executor/testing.js +17 -13
- package/dist/entrypoints/agent-executor.js +1 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts +2 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/ai-sdk.js +10 -12
- package/dist/entrypoints/agent-runtime/anthropic.js +13 -10
- package/dist/entrypoints/agent-runtime/browser.js +8 -4
- package/dist/entrypoints/agent-runtime/harness.js +18 -19
- package/dist/entrypoints/agent-runtime/openai.js +5 -5
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +7 -5
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +1095 -854
- package/dist/entrypoints/agent-runtime/postgres.js +2 -2
- package/dist/entrypoints/agent-runtime/realtime.js +5 -5
- package/dist/entrypoints/agent-runtime/sandbox.js +167 -139
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.js +3 -3
- package/dist/entrypoints/agent-runtime.js +246 -360
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +36 -15
- package/dist/entrypoints/contract.js +12 -10
- package/dist/entrypoints/geo.js +1 -1
- package/dist/entrypoints/handler.js +5 -6
- package/dist/entrypoints/http.d.ts +2 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +16 -4
- package/dist/entrypoints/index.js +26 -35
- package/dist/entrypoints/live.js +3 -3
- package/dist/entrypoints/node.js +7 -7
- package/dist/entrypoints/observability.js +9 -7
- package/dist/entrypoints/process.js +3 -3
- package/dist/entrypoints/remote.js +5 -5
- package/dist/entrypoints/server.js +29 -16
- package/dist/entrypoints/telegram/grammy.d.ts +1 -1
- package/dist/entrypoints/telegram/grammy.d.ts.map +1 -1
- package/dist/entrypoints/telegram/grammy.js +39 -5
- package/dist/entrypoints/telegram/screens.js +3 -0
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +19 -6
- package/dist/entrypoints/testing.js +10 -11
- package/dist/entrypoints/tools/agent.js +8 -9
- package/dist/entrypoints/tools/connections.js +27 -57
- package/dist/entrypoints/tools/contract.js +4 -4
- package/dist/entrypoints/tools/invoker.js +7 -8
- package/dist/entrypoints/tools/mcp.js +9 -10
- package/dist/entrypoints/tools/toolkit.js +11 -12
- package/dist/entrypoints/tools.js +20 -20
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +1 -1
- package/dist/entrypoints/tracking.js +1 -1
- package/dist/{index-3czc3ykr.js → index-08a3qfr8.js} +1 -1
- package/dist/{index-grhhsrd5.js → index-1en7k3q5.js} +2 -1
- package/dist/{index-pdcbjd6a.js → index-1yky29qg.js} +6 -3
- package/dist/{index-b4c9dpzm.js → index-252den5a.js} +10 -11
- package/dist/{index-xtby8rj3.js → index-28kbdn63.js} +5 -47
- package/dist/{index-57sbckhv.js → index-36mtj8xm.js} +2 -2
- package/dist/{index-dm84tsd5.js → index-3kb8dw48.js} +1 -1
- package/dist/index-3tb82xr7.js +11 -0
- package/dist/{index-c24bj2r1.js → index-4243301z.js} +2 -2
- package/dist/{index-nr4fhfn4.js → index-4p2zx593.js} +2 -0
- package/dist/{index-q86qnzzf.js → index-54wp467c.js} +4 -4
- package/dist/{index-mcv7b2n0.js → index-63ctzjp4.js} +497 -495
- package/dist/{index-y0a4gt1s.js → index-65p8v81y.js} +3 -2
- package/dist/{index-z72vazf5.js → index-6y3eae97.js} +27 -83
- package/dist/{index-5awtbyns.js → index-9vj869rx.js} +1 -1
- package/dist/{index-5q0qpw3v.js → index-aqm7e864.js} +23 -8
- package/dist/{index-d4at0q09.js → index-b9mj31q7.js} +90 -88
- package/dist/{index-baba8ehy.js → index-bjrcbcn2.js} +2 -2
- package/dist/{index-fsw9wxk9.js → index-c9j8441q.js} +1 -103
- package/dist/{index-wdb5jhas.js → index-d1pdv8qc.js} +1 -1
- package/dist/{index-73wq9abg.js → index-df5xr2f9.js} +13 -59
- package/dist/{index-n9358ydy.js → index-dm50x3by.js} +1 -1
- package/dist/{index-zyyerdny.js → index-dmrx8xma.js} +3 -0
- package/dist/{index-78da4g74.js → index-dwq6a6sq.js} +17 -13
- package/dist/{index-9be3tf6r.js → index-e413q2cj.js} +49 -22
- package/dist/{index-g4gstmp1.js → index-ednf2cxs.js} +1 -1
- package/dist/{index-84tp547a.js → index-edpkm3k7.js} +29 -97
- package/dist/{index-gs0jw0hy.js → index-efbzm2se.js} +3 -3
- package/dist/{index-de7b0kvz.js → index-epwvp88y.js} +1 -1
- package/dist/{index-asnd4h2k.js → index-f0dzyskg.js} +27 -4
- package/dist/{index-xbb8ysmq.js → index-fatke81t.js} +2 -2
- package/dist/{index-6nzzj7qr.js → index-gq35s3bm.js} +1 -1
- package/dist/index-gvgtmt7a.js +102 -0
- package/dist/{index-m2b49tvc.js → index-h08xqfw9.js} +20 -21
- package/dist/{index-gk6dq9ay.js → index-ha1tv70k.js} +3 -26
- package/dist/{index-wsv11dhg.js → index-hberxns4.js} +1 -1
- package/dist/{index-rkphknhx.js → index-hpzhz1vm.js} +1 -1
- package/dist/{index-npfdymav.js → index-j5vzhj3d.js} +1 -1
- package/dist/{index-d3s070eh.js → index-jperyn0c.js} +1 -1
- package/dist/{index-yhwx4fwk.js → index-kzsetgh9.js} +1 -1
- package/dist/{index-x6sp5vpa.js → index-q4tr9vnf.js} +1 -1
- package/dist/{index-hce3hbdg.js → index-qj0sq69b.js} +6 -2
- package/dist/{index-v0j22shs.js → index-rg08syp1.js} +9 -6
- package/dist/{index-8vzh5wpv.js → index-rw1caff2.js} +14 -26
- package/dist/index-s8af9jqw.js +6 -0
- package/dist/{index-bgj9hbm3.js → index-sdppfbrh.js} +30 -16
- package/dist/{index-y0mwkgkf.js → index-shte29pg.js} +1086 -1055
- package/dist/{index-fec05c9k.js → index-ta0e2daw.js} +9 -7
- package/dist/{index-ht71v1ag.js → index-tb36xawm.js} +59 -44
- package/dist/{index-c0yym4a0.js → index-w7e402wx.js} +11 -105
- package/dist/{index-bvpevwt6.js → index-xnqab06h.js} +207 -202
- package/dist/index-xrbrvn15.js +147 -0
- package/dist/{index-ac3rfec5.js → index-y6wzzk2e.js} +21 -1
- package/dist/{index-3d2c45jn.js → index-yjx5jna7.js} +2 -2
- package/dist/internal/loopback-host.d.ts +8 -0
- package/dist/internal/loopback-host.d.ts.map +1 -0
- package/dist/internal/own-member.d.ts +7 -0
- package/dist/internal/own-member.d.ts.map +1 -0
- package/dist/internal/request.d.ts +17 -8
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/secret-shapes.d.ts +33 -4
- package/dist/internal/secret-shapes.d.ts.map +1 -1
- package/dist/json-schema/dialect.d.ts.map +1 -1
- package/dist/json-schema/keywords.d.ts +25 -6
- package/dist/json-schema/keywords.d.ts.map +1 -1
- package/dist/json-schema/string-format.d.ts.map +1 -1
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/observability/context.d.ts +4 -3
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/sanitize.d.ts.map +1 -1
- package/dist/observability/secret-values.d.ts +0 -9
- package/dist/observability/secret-values.d.ts.map +1 -1
- package/dist/server/context.d.ts +3 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +4 -3
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/event-bus.d.ts.map +1 -1
- package/dist/server/file.d.ts +11 -3
- package/dist/server/file.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +2 -2
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +12 -1
- package/dist/server/middleware/jwt.d.ts.map +1 -1
- package/dist/server/middleware/trust-fence.d.ts +4 -0
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart.d.ts +2 -3
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-body.d.ts +12 -1
- package/dist/server/request-body.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/types.d.ts +14 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts +4 -4
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts.map +1 -1
- package/dist/telegram/screens/test-chat.d.ts.map +1 -1
- package/dist/telegram/widget-api.d.ts +85 -13
- package/dist/telegram/widget-api.d.ts.map +1 -1
- package/dist/telegram/widget.d.ts +46 -2
- package/dist/telegram/widget.d.ts.map +1 -1
- package/dist/tools/cli/args-classify.d.ts +4 -74
- package/dist/tools/cli/args-classify.d.ts.map +1 -1
- package/dist/tools/cli/args-framework.d.ts +79 -0
- package/dist/tools/cli/args-framework.d.ts.map +1 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -1
- package/dist/tools/cli/args-tokens.d.ts.map +1 -1
- package/dist/tools/cli/checkpoint.d.ts +5 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/execute-handler.d.ts +24 -0
- package/dist/tools/execute-handler.d.ts.map +1 -0
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/mcp/round.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/flatten.d.ts.map +1 -1
- package/dist/tools/schema/inline-references.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -1
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tracking/privacy.d.ts.map +1 -1
- package/llms/agent-runtime-openrouter.txt +10 -9
- package/llms/agent-runtime-sandbox.txt +50 -11
- package/llms/agent-runtime-testing.txt +1 -1
- package/llms/agent-runtime.2.txt +9 -6
- package/llms/agent-runtime.3.txt +2 -2
- package/llms/agent-runtime.4.txt +11 -5
- package/llms/agent-runtime.5.txt +1 -1
- package/llms/agent-runtime.txt +283 -36
- package/llms/application.txt +3 -1
- package/llms/http.txt +1 -1
- package/llms/live.txt +3 -1
- package/llms/observability.txt +16 -9
- package/llms/server.2.txt +13 -8
- package/llms/server.4.txt +23 -11
- package/llms/server.5.txt +5 -5
- package/llms/server.txt +54 -1
- package/llms/spend.txt +1 -0
- package/llms/stitchkit.2.txt +4 -2
- package/llms/stitchkit.txt +113 -93
- package/llms/telegram-grammy.txt +3 -2
- package/llms/telegram.2.txt +3 -1
- package/llms/telegram.txt +35 -10
- package/llms/upgrading-0.128.0-0.129.0.txt +175 -0
- package/llms/{upgrading-0.128.0-0.135.0.txt → upgrading-0.130.0-0.136.0.txt} +353 -169
- package/llms/upgrading.txt +2 -1
- package/llms-full.txt +994 -217
- package/llms.txt +13 -12
- package/package.json +6 -6
- package/dist/agent-runtime/loop/deferred-tools-internal.d.ts +0 -19
- package/dist/agent-runtime/loop/deferred-tools-internal.d.ts.map +0 -1
- package/dist/agent-runtime/loop/run-complete-retry.d.ts +0 -24
- package/dist/agent-runtime/loop/run-complete-retry.d.ts.map +0 -1
- package/dist/agent-runtime/loop/run-model-attempts.d.ts +0 -6
- package/dist/agent-runtime/loop/run-model-attempts.d.ts.map +0 -1
- package/dist/index-sznqf8fx.js +0 -20
- /package/dist/{index-fthw8dwa.js → index-4gbybjg6.js} +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveRouteParamsSchema
|
|
3
|
+
} from "./index-m38ej7e5.js";
|
|
4
|
+
import {
|
|
5
|
+
defineContract2
|
|
6
|
+
} from "./index-dmrx8xma.js";
|
|
7
|
+
import {
|
|
8
|
+
describeRefusals
|
|
9
|
+
} from "./index-dxft2mnm.js";
|
|
10
|
+
import {
|
|
11
|
+
canonicalDigest
|
|
12
|
+
} from "./index-3dq8466w.js";
|
|
13
|
+
import {
|
|
14
|
+
typedEntries,
|
|
15
|
+
isRecord
|
|
16
|
+
} from "./index-ps3djm8d.js";
|
|
17
|
+
|
|
18
|
+
// src/contract/fingerprint.ts
|
|
19
|
+
import { z } from "zod";
|
|
20
|
+
var ContractFingerprintSchema2 = z.strictObject({
|
|
21
|
+
fingerprint: z.string(),
|
|
22
|
+
operations: z.record(z.string(), z.string())
|
|
23
|
+
});
|
|
24
|
+
var ANNOTATIONS = new Set(["description", "title", "examples", "deprecated", "$comment"]);
|
|
25
|
+
function constraintsOf(schema) {
|
|
26
|
+
if (Array.isArray(schema))
|
|
27
|
+
return schema.map(constraintsOf);
|
|
28
|
+
if (!isRecord(schema))
|
|
29
|
+
return schema;
|
|
30
|
+
const constraints = {};
|
|
31
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
32
|
+
if (ANNOTATIONS.has(key))
|
|
33
|
+
continue;
|
|
34
|
+
constraints[key] = key === "required" && Array.isArray(value) ? [...value].sort() : key === "properties" && isRecord(value) ? Object.fromEntries(Object.entries(value).map(([name, property]) => [name, constraintsOf(property)])) : constraintsOf(value);
|
|
35
|
+
}
|
|
36
|
+
return constraints;
|
|
37
|
+
}
|
|
38
|
+
function schemaIdentity(schema, io) {
|
|
39
|
+
if (schema === undefined)
|
|
40
|
+
return null;
|
|
41
|
+
return constraintsOf(z.toJSONSchema(schema, { io, unrepresentable: "any", cycles: "ref" }));
|
|
42
|
+
}
|
|
43
|
+
function refusalIdentity(refuses) {
|
|
44
|
+
return [...refuses].sort((left, right) => left.code < right.code ? -1 : left.code > right.code ? 1 : 0).map((refusal) => ({
|
|
45
|
+
code: refusal.code,
|
|
46
|
+
status: refusal.status,
|
|
47
|
+
details: schemaIdentity(refusal.details, "output")
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
function fingerprintOperations(operations) {
|
|
51
|
+
const digests = {};
|
|
52
|
+
for (const operation of operations) {
|
|
53
|
+
if (Object.hasOwn(digests, operation.name)) {
|
|
54
|
+
throw new Error(`[stitchkit] contract fingerprint: duplicate operation "${operation.name}"`);
|
|
55
|
+
}
|
|
56
|
+
digests[operation.name] = canonicalDigest({
|
|
57
|
+
method: operation.method,
|
|
58
|
+
path: operation.path,
|
|
59
|
+
params: schemaIdentity(operation.params, "input"),
|
|
60
|
+
input: schemaIdentity(operation.input, "input"),
|
|
61
|
+
output: schemaIdentity(operation.output, "output"),
|
|
62
|
+
item: schemaIdentity(operation.item, "output"),
|
|
63
|
+
...operation.refuses && { refuses: refusalIdentity(operation.refuses) }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return { fingerprint: canonicalDigest(digests), operations: digests };
|
|
67
|
+
}
|
|
68
|
+
function contractFingerprint2(contracts) {
|
|
69
|
+
const list = Array.isArray(contracts) ? contracts : [contracts];
|
|
70
|
+
return fingerprintOperations(list.flatMap(contractOperations));
|
|
71
|
+
}
|
|
72
|
+
function contractOperations(contract) {
|
|
73
|
+
const operations = [];
|
|
74
|
+
for (const [key, endpoint] of typedEntries(contract.endpoints)) {
|
|
75
|
+
if (endpoint.expose && !endpoint.expose.includes("HTTP"))
|
|
76
|
+
continue;
|
|
77
|
+
operations.push({
|
|
78
|
+
name: `${contract.meta.prefix}.${key}`,
|
|
79
|
+
method: endpoint.method,
|
|
80
|
+
path: endpoint.path,
|
|
81
|
+
params: resolveRouteParamsSchema(endpoint.path, endpoint.params),
|
|
82
|
+
input: endpoint.input,
|
|
83
|
+
output: endpoint.output,
|
|
84
|
+
item: "stream" in endpoint ? endpoint.stream?.item : undefined,
|
|
85
|
+
refuses: describeRefusals(endpoint.refuses)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return operations;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/contract/identity.ts
|
|
92
|
+
var contractIdentityContract2 = defineContract2({ prefix: "contract-identity", scope: "public" }, {
|
|
93
|
+
read: {
|
|
94
|
+
method: "GET",
|
|
95
|
+
path: "/",
|
|
96
|
+
desc: "The fingerprint of the contract operations this server answers",
|
|
97
|
+
expose: ["HTTP"],
|
|
98
|
+
output: ContractFingerprintSchema2
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export { ContractFingerprintSchema2, fingerprintOperations, contractFingerprint2, contractIdentityContract2 };
|
|
@@ -9,12 +9,6 @@ import {
|
|
|
9
9
|
joinRoutePath,
|
|
10
10
|
parseTrailingWildcard
|
|
11
11
|
} from "./index-m38ej7e5.js";
|
|
12
|
-
import {
|
|
13
|
-
errorCode2,
|
|
14
|
-
recordedErrorMessage,
|
|
15
|
-
normalizeError2,
|
|
16
|
-
validateDeclaredOutput
|
|
17
|
-
} from "./index-78da4g74.js";
|
|
18
12
|
import {
|
|
19
13
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
|
|
20
14
|
readContractStreamItems,
|
|
@@ -38,7 +32,7 @@ import {
|
|
|
38
32
|
runWithRequestContext2,
|
|
39
33
|
getRequestContext2,
|
|
40
34
|
setRequestEndpoint2
|
|
41
|
-
} from "./index-
|
|
35
|
+
} from "./index-q4tr9vnf.js";
|
|
42
36
|
import {
|
|
43
37
|
resolveTraceId2,
|
|
44
38
|
resolveSocketIp2,
|
|
@@ -46,7 +40,14 @@ import {
|
|
|
46
40
|
getClientInfo2,
|
|
47
41
|
MalformedQueryError,
|
|
48
42
|
parseQueryParams
|
|
49
|
-
} from "./index-
|
|
43
|
+
} from "./index-aqm7e864.js";
|
|
44
|
+
import {
|
|
45
|
+
errorCode2,
|
|
46
|
+
parseContractInput,
|
|
47
|
+
recordedErrorMessage,
|
|
48
|
+
normalizeError2,
|
|
49
|
+
validateDeclaredOutput
|
|
50
|
+
} from "./index-dwq6a6sq.js";
|
|
50
51
|
import {
|
|
51
52
|
mediaTypeEssence
|
|
52
53
|
} from "./index-zs8cze4j.js";
|
|
@@ -1091,7 +1092,7 @@ async function parseMultipart2(req, descriptor, fieldsSchema, receivers) {
|
|
|
1091
1092
|
}
|
|
1092
1093
|
return {
|
|
1093
1094
|
files,
|
|
1094
|
-
fields: fieldsSchema ? fieldsSchema
|
|
1095
|
+
fields: fieldsSchema ? parseContractInput(fieldsSchema, fields) : fields,
|
|
1095
1096
|
rollback
|
|
1096
1097
|
};
|
|
1097
1098
|
} catch (error) {
|
|
@@ -1104,11 +1105,10 @@ async function parseMultipart2(req, descriptor, fieldsSchema, receivers) {
|
|
|
1104
1105
|
}
|
|
1105
1106
|
|
|
1106
1107
|
// src/server/request-body.ts
|
|
1107
|
-
|
|
1108
|
+
var DEFAULT_REQUEST_BODY_BYTES = 1024 * 1024;
|
|
1109
|
+
async function readRequestText(req, maxBytes = DEFAULT_REQUEST_BODY_BYTES) {
|
|
1108
1110
|
if (req.signal.aborted)
|
|
1109
1111
|
throw abortReason(req.signal);
|
|
1110
|
-
if (maxBytes === undefined)
|
|
1111
|
-
return req.text();
|
|
1112
1112
|
assertPositiveSafeInteger("maxJsonBodyBytes", maxBytes, Error);
|
|
1113
1113
|
const result = await readBoundedText(req, { maxBytes, signal: req.signal });
|
|
1114
1114
|
if (result.kind === "over-limit")
|
|
@@ -1162,7 +1162,7 @@ function buildBaseContext(req, url, pathParams, traceId, clientIp) {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
function parsePathParamsInto(ctx, method) {
|
|
1164
1164
|
if (method.paramsSchema) {
|
|
1165
|
-
ctx.params = method.paramsSchema
|
|
1165
|
+
ctx.params = parseContractInput(method.paramsSchema, ctx.params);
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
async function parseRequestPayloadInto(ctx, req, url, method, maxJsonBodyBytes, cors) {
|
|
@@ -1174,21 +1174,21 @@ async function parseRequestPayloadInto(ctx, req, url, method, maxJsonBodyBytes,
|
|
|
1174
1174
|
}
|
|
1175
1175
|
if (method.inputSchema) {
|
|
1176
1176
|
if (req.method === "GET") {
|
|
1177
|
-
ctx.input = method.inputSchema
|
|
1177
|
+
ctx.input = parseContractInput(method.inputSchema, parseQueryParams(url));
|
|
1178
1178
|
} else if (req.method === "DELETE") {
|
|
1179
1179
|
if (mediaTypeEssence(req.headers.get("content-type")) === "application/json") {
|
|
1180
1180
|
const text = await readRequestText(req, method.maxJsonBodyBytes ?? maxJsonBodyBytes);
|
|
1181
1181
|
if (method.rawBody)
|
|
1182
1182
|
ctx.rawBody = text;
|
|
1183
|
-
ctx.input = method.inputSchema
|
|
1183
|
+
ctx.input = parseContractInput(method.inputSchema, parseJsonBody(req, text, method, cors));
|
|
1184
1184
|
} else {
|
|
1185
|
-
ctx.input = method.inputSchema
|
|
1185
|
+
ctx.input = parseContractInput(method.inputSchema, parseQueryParams(url));
|
|
1186
1186
|
}
|
|
1187
1187
|
} else {
|
|
1188
1188
|
const text = await readRequestText(req, method.maxJsonBodyBytes ?? maxJsonBodyBytes);
|
|
1189
1189
|
if (method.rawBody)
|
|
1190
1190
|
ctx.rawBody = text;
|
|
1191
|
-
ctx.input = method.inputSchema
|
|
1191
|
+
ctx.input = parseContractInput(method.inputSchema, parseJsonBody(req, text, method, cors));
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
1194
|
return;
|
|
@@ -2067,7 +2067,6 @@ function logOutgoing(entry) {
|
|
|
2067
2067
|
|
|
2068
2068
|
// src/server/request-completion.ts
|
|
2069
2069
|
var BODY_METHODS = new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
2070
|
-
var DEFAULT_PAYLOAD_LOG_BYTES = 1024 * 1024;
|
|
2071
2070
|
async function readPayload(clone, maxBytes) {
|
|
2072
2071
|
try {
|
|
2073
2072
|
const result = await readBoundedText(clone, { maxBytes, signal: clone.signal });
|
|
@@ -2082,7 +2081,7 @@ function openRequestCompletion(state, window) {
|
|
|
2082
2081
|
const { logConfig, customLogger, useDefaultLog, observability } = state;
|
|
2083
2082
|
const { req, url, traceId, startedAt, ipAddress } = window;
|
|
2084
2083
|
const shouldLogRequest = logConfig !== null && shouldLog(url.pathname, req.method) && !shouldSkipLog(logConfig, req, url);
|
|
2085
|
-
const payloadRead = observability?.includePayload && BODY_METHODS.has(req.method) ? readPayload(req.clone(), observability.payloadMaxBytes ?? state.config.maxJsonBodyBytes ??
|
|
2084
|
+
const payloadRead = observability?.includePayload && BODY_METHODS.has(req.method) ? readPayload(req.clone(), observability.payloadMaxBytes ?? state.config.maxJsonBodyBytes ?? DEFAULT_REQUEST_BODY_BYTES) : undefined;
|
|
2086
2085
|
const logFormat = resolveLogFormat(logConfig?.format);
|
|
2087
2086
|
let reqLog;
|
|
2088
2087
|
if (shouldLogRequest && useDefaultLog) {
|
|
@@ -2183,7 +2182,7 @@ function writeCompletionLine(state, logConfig, window, line) {
|
|
|
2183
2182
|
|
|
2184
2183
|
// src/server/create.ts
|
|
2185
2184
|
function createHandler2(config) {
|
|
2186
|
-
const { trustProxy
|
|
2185
|
+
const { trustProxy, observability } = config;
|
|
2187
2186
|
const state = createHandlerState(config);
|
|
2188
2187
|
const handler = async (req, server) => {
|
|
2189
2188
|
const url = new URL(req.url, "http://localhost");
|
|
@@ -2340,4 +2339,4 @@ async function dispatch(state, req, url, traceId, server, clientIp, startedAt, c
|
|
|
2340
2339
|
return dispatchEndpoint(state, request, match);
|
|
2341
2340
|
}
|
|
2342
2341
|
|
|
2343
|
-
export { isTrustProxyHandler, contextContributionDelta, prepareContextContribution, mergeContextContribution, parseMultipart2, DEFAULT_STREAM_HEARTBEAT_MS2, streamingRoute2, ndjsonRoute2, sseRoute2, createHandler2 };
|
|
2342
|
+
export { isTrustProxyHandler, contextContributionDelta, prepareContextContribution, mergeContextContribution, parseMultipart2, DEFAULT_REQUEST_BODY_BYTES, DEFAULT_STREAM_HEARTBEAT_MS2, streamingRoute2, ndjsonRoute2, sseRoute2, createHandler2 };
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
SCHEMA_MAP_KEYWORDS
|
|
5
|
-
} from "./index-9be3tf6r.js";
|
|
6
|
-
import {
|
|
7
|
-
isRecord
|
|
8
|
-
} from "./index-ps3djm8d.js";
|
|
2
|
+
mapSubschemas
|
|
3
|
+
} from "./index-e413q2cj.js";
|
|
9
4
|
|
|
10
5
|
// src/json-schema/string-format.ts
|
|
11
6
|
import { z } from "zod";
|
|
@@ -32,29 +27,11 @@ var STANDARD_STRING_FORMATS = new Set([
|
|
|
32
27
|
]);
|
|
33
28
|
var SERVED_FORMAT = "x-stitchkit-served-format";
|
|
34
29
|
function withServedFormats(schema) {
|
|
35
|
-
const carried = {};
|
|
36
|
-
for (const [key, child] of Object.entries(schema)) {
|
|
37
|
-
if (SCHEMA_KEYWORDS.includes(key)) {
|
|
38
|
-
carried[key] = Array.isArray(child) ? child.map(carriedSchema) : carriedSchema(child);
|
|
39
|
-
} else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
|
|
40
|
-
carried[key] = child.map(carriedSchema);
|
|
41
|
-
} else if (SCHEMA_MAP_KEYWORDS.includes(key) && isRecord(child)) {
|
|
42
|
-
carried[key] = Object.fromEntries(Object.entries(child).map(([name, member]) => [name, carriedSchema(member)]));
|
|
43
|
-
} else if (key === "dependencies" && isRecord(child)) {
|
|
44
|
-
carried[key] = Object.fromEntries(Object.entries(child).map(([name, member]) => [
|
|
45
|
-
name,
|
|
46
|
-
isRecord(member) ? carriedSchema(member) : member
|
|
47
|
-
]));
|
|
48
|
-
} else
|
|
49
|
-
carried[key] = child;
|
|
50
|
-
}
|
|
30
|
+
const carried = mapSubschemas(schema, { schema: withServedFormats });
|
|
51
31
|
if (typeof schema.format === "string")
|
|
52
32
|
carried[SERVED_FORMAT] = schema.format;
|
|
53
33
|
return carried;
|
|
54
34
|
}
|
|
55
|
-
function carriedSchema(schema) {
|
|
56
|
-
return isRecord(schema) ? withServedFormats(schema) : schema;
|
|
57
|
-
}
|
|
58
35
|
var readerExpressions = new Map;
|
|
59
36
|
function readerExpression(format) {
|
|
60
37
|
if (!readerExpressions.has(format)) {
|
|
@@ -3,10 +3,13 @@ import {
|
|
|
3
3
|
} from "./index-dsa676h8.js";
|
|
4
4
|
import {
|
|
5
5
|
unwrapZodWrappers
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-dm50x3by.js";
|
|
7
7
|
import {
|
|
8
8
|
safeJsonParse
|
|
9
9
|
} from "./index-zsarb5xp.js";
|
|
10
|
+
import {
|
|
11
|
+
setOwnMember
|
|
12
|
+
} from "./index-3tb82xr7.js";
|
|
10
13
|
import {
|
|
11
14
|
isRecord
|
|
12
15
|
} from "./index-ps3djm8d.js";
|
|
@@ -100,7 +103,8 @@ function coerceValue(value, schema, path) {
|
|
|
100
103
|
const shape = base.shape;
|
|
101
104
|
const out = {};
|
|
102
105
|
for (const [key, item] of Object.entries(current)) {
|
|
103
|
-
|
|
106
|
+
const field = Object.hasOwn(shape, key) ? shape[key] : undefined;
|
|
107
|
+
setOwnMember(out, key, coerceValue(item, field, [...path, key]));
|
|
104
108
|
}
|
|
105
109
|
return out;
|
|
106
110
|
}
|
|
@@ -70,6 +70,9 @@ import {
|
|
|
70
70
|
import {
|
|
71
71
|
assistantStatus
|
|
72
72
|
} from "./index-kgj8j7bv.js";
|
|
73
|
+
import {
|
|
74
|
+
setOwnMember
|
|
75
|
+
} from "./index-3tb82xr7.js";
|
|
73
76
|
import {
|
|
74
77
|
assertPositiveSafeInteger
|
|
75
78
|
} from "./index-gr0kxymw.js";
|
|
@@ -2108,7 +2111,7 @@ function branchOpaqueRecord(ids, value, path = "") {
|
|
|
2108
2111
|
for (const [key, entry] of Object.entries(value)) {
|
|
2109
2112
|
const at = path ? `${path}.${key}` : key;
|
|
2110
2113
|
if (!RUNTIME_REFERENCE_KEYS.has(key)) {
|
|
2111
|
-
out
|
|
2114
|
+
setOwnMember(out, key, branchOpaqueJson(ids, entry, at));
|
|
2112
2115
|
continue;
|
|
2113
2116
|
}
|
|
2114
2117
|
const mode = ids.applicationKey(key);
|
|
@@ -2119,14 +2122,14 @@ function branchOpaqueRecord(ids, value, path = "") {
|
|
|
2119
2122
|
key,
|
|
2120
2123
|
path: at
|
|
2121
2124
|
});
|
|
2122
|
-
out
|
|
2125
|
+
setOwnMember(out, key, branchOpaqueJson(ids, entry, at));
|
|
2123
2126
|
continue;
|
|
2124
2127
|
}
|
|
2125
2128
|
if (mode === "rekey-spill") {
|
|
2126
2129
|
if (typeof entry === "string") {
|
|
2127
2130
|
const kinds = ids.sourceIdentitiesOf(entry);
|
|
2128
2131
|
if (kinds.size === 1 && kinds.has("spill")) {
|
|
2129
|
-
out
|
|
2132
|
+
setOwnMember(out, key, ids.reference("spill", entry));
|
|
2130
2133
|
} else {
|
|
2131
2134
|
ids.refuse({
|
|
2132
2135
|
code: "application-key-source-identity",
|
|
@@ -2134,10 +2137,10 @@ function branchOpaqueRecord(ids, value, path = "") {
|
|
|
2134
2137
|
key,
|
|
2135
2138
|
path: at
|
|
2136
2139
|
});
|
|
2137
|
-
out
|
|
2140
|
+
setOwnMember(out, key, entry);
|
|
2138
2141
|
}
|
|
2139
2142
|
} else {
|
|
2140
|
-
out
|
|
2143
|
+
setOwnMember(out, key, branchOpaqueJson(ids, entry, at));
|
|
2141
2144
|
}
|
|
2142
2145
|
continue;
|
|
2143
2146
|
}
|
|
@@ -2154,7 +2157,7 @@ function branchOpaqueRecord(ids, value, path = "") {
|
|
|
2154
2157
|
break;
|
|
2155
2158
|
}
|
|
2156
2159
|
}
|
|
2157
|
-
out
|
|
2160
|
+
setOwnMember(out, key, branchOpaqueJson(ids, entry, at));
|
|
2158
2161
|
}
|
|
2159
2162
|
return out;
|
|
2160
2163
|
}
|
|
@@ -1,40 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isSecretQueryName,
|
|
3
|
+
maskKeyShapes,
|
|
4
|
+
maskAuthorizationValues,
|
|
5
|
+
maskUrlPasswords
|
|
6
|
+
} from "./index-xrbrvn15.js";
|
|
7
|
+
|
|
1
8
|
// src/tracking/privacy.ts
|
|
2
9
|
var MASK = "[masked]";
|
|
3
10
|
var MAX_REDACTED_CHARS = 16384;
|
|
4
11
|
var TELEGRAM_SIGNED_FIELD = "tgwebappdata";
|
|
5
|
-
var PASSWORD_FIELD = /^(?:current|new|old|confirm|repeat|repeated)?(?:password|passwd|pwd)(?:confirmation)?$/;
|
|
6
|
-
var CREDENTIAL_FIELDS = new Set([
|
|
7
|
-
"token",
|
|
8
|
-
"accesstoken",
|
|
9
|
-
"idtoken",
|
|
10
|
-
"refreshtoken",
|
|
11
|
-
"authtoken",
|
|
12
|
-
"sessiontoken",
|
|
13
|
-
"csrftoken",
|
|
14
|
-
"resettoken",
|
|
15
|
-
"magictoken",
|
|
16
|
-
"secret",
|
|
17
|
-
"clientsecret",
|
|
18
|
-
"apikey",
|
|
19
|
-
"privatekey",
|
|
20
|
-
"authorization",
|
|
21
|
-
"signature",
|
|
22
|
-
"xamzsignature"
|
|
23
|
-
]);
|
|
24
12
|
var OAUTH_FIELDS = new Set(["code", "state", "sessionstate"]);
|
|
25
13
|
var SIGNED_LOGIN_FIELDS = new Set(["hash"]);
|
|
26
14
|
var PARAMETER = /([?&#])([^=&#?\s]+)=([^&#\s]*)/g;
|
|
27
|
-
var URL_PASSWORD = /(https?:\/\/[^\s/:@]+:)[^\s/@]+(@)/gi;
|
|
28
|
-
var BEARER = /\b(bearer\s+)[^\s,;]+/gi;
|
|
29
15
|
var ASSIGNMENT = /(^|[^\w?&#/-])("[^"\n]+"|'[^'\n]+'|[\w.$[\]-]+)(\s*[:=]\s*)("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\s,;}]+)/g;
|
|
16
|
+
function lastFieldName(key) {
|
|
17
|
+
return key.replace(/^amp;/, "").split(/[.[\]]/).filter((part) => part !== "" && !/^\d+$/.test(part)).at(-1) ?? "";
|
|
18
|
+
}
|
|
30
19
|
function fieldName(key) {
|
|
31
|
-
|
|
32
|
-
return field.replace(/[-_\s]/g, "").toLowerCase();
|
|
20
|
+
return lastFieldName(key).replace(/[-_\s]/g, "").toLowerCase();
|
|
33
21
|
}
|
|
34
22
|
function isSecretField(key, context) {
|
|
35
|
-
|
|
36
|
-
if (PASSWORD_FIELD.test(field) || CREDENTIAL_FIELDS.has(field))
|
|
23
|
+
if (isSecretQueryName(lastFieldName(key)))
|
|
37
24
|
return true;
|
|
25
|
+
const field = fieldName(key);
|
|
38
26
|
if (field === TELEGRAM_SIGNED_FIELD)
|
|
39
27
|
return true;
|
|
40
28
|
if (context?.oauth && OAUTH_FIELDS.has(field))
|
|
@@ -58,7 +46,7 @@ function secretContextOf(input) {
|
|
|
58
46
|
function redactTrackingText2(input) {
|
|
59
47
|
const text = input.slice(0, MAX_REDACTED_CHARS);
|
|
60
48
|
const context = secretContextOf(text);
|
|
61
|
-
return text
|
|
49
|
+
return maskAuthorizationValues(maskUrlPasswords(maskKeyShapes(text, MASK), MASK), MASK).replace(PARAMETER, (whole, separator, key, value) => {
|
|
62
50
|
try {
|
|
63
51
|
if (isSecretField(decodeKey(key), context))
|
|
64
52
|
return `${separator}${key}=${MASK}`;
|
|
@@ -58,6 +58,19 @@ var TelegramWidgetMessageSchema2 = z.looseObject({
|
|
|
58
58
|
chat_data: z.string().optional()
|
|
59
59
|
})
|
|
60
60
|
});
|
|
61
|
+
var QueryTypeSchema = z.discriminatedUnion("type", [
|
|
62
|
+
z.looseObject({ type: z.literal("data"), wallet_card: z.looseObject({}).optional() }),
|
|
63
|
+
z.looseObject({
|
|
64
|
+
type: z.literal("sign_data"),
|
|
65
|
+
wallet: WalletSchema,
|
|
66
|
+
sign_data: z.string()
|
|
67
|
+
}),
|
|
68
|
+
z.looseObject({
|
|
69
|
+
type: z.literal("sent_transaction"),
|
|
70
|
+
wallet: WalletSchema,
|
|
71
|
+
msg_hash: z.string()
|
|
72
|
+
})
|
|
73
|
+
]);
|
|
61
74
|
var TelegramWidgetQuerySchema2 = z.looseObject({
|
|
62
75
|
id: z.string().min(1),
|
|
63
76
|
from: z.looseObject({ id: z.int() }),
|
|
@@ -66,28 +79,29 @@ var TelegramWidgetQuerySchema2 = z.looseObject({
|
|
|
66
79
|
inline_message_id: z.string().optional(),
|
|
67
80
|
chat_instance: z.string(),
|
|
68
81
|
chat_type: z.string().optional(),
|
|
69
|
-
type:
|
|
70
|
-
z.looseObject({ type: z.literal("data"), wallet_card: z.looseObject({}).optional() }),
|
|
71
|
-
z.looseObject({
|
|
72
|
-
type: z.literal("sign_data"),
|
|
73
|
-
wallet: WalletSchema,
|
|
74
|
-
sign_data: z.string()
|
|
75
|
-
}),
|
|
76
|
-
z.looseObject({
|
|
77
|
-
type: z.literal("sent_transaction"),
|
|
78
|
-
wallet: WalletSchema,
|
|
79
|
-
msg_hash: z.string()
|
|
80
|
-
})
|
|
81
|
-
]),
|
|
82
|
+
type: QueryTypeSchema,
|
|
82
83
|
data: QueryDataSchema,
|
|
83
84
|
widget_id: z.string().optional()
|
|
84
85
|
});
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
var TelegramSharedWidgetQuerySchema2 = z.looseObject({
|
|
87
|
+
id: z.string().min(1),
|
|
88
|
+
from: z.looseObject({ id: z.int() }),
|
|
89
|
+
type: QueryTypeSchema,
|
|
90
|
+
data: QueryDataSchema,
|
|
91
|
+
widget_id: z.string().min(1)
|
|
92
|
+
});
|
|
93
|
+
function parseQuery(schema, value) {
|
|
94
|
+
const parsed = schema.safeParse(value);
|
|
87
95
|
if (parsed.success)
|
|
88
96
|
return { query: parsed.data };
|
|
89
97
|
const id = typeof value === "object" && value !== null ? Reflect.get(value, "id") : undefined;
|
|
90
98
|
return typeof id === "string" && id.length > 0 ? { id, error: parsed.error } : undefined;
|
|
91
99
|
}
|
|
100
|
+
function parseTelegramWidgetQuery2(value) {
|
|
101
|
+
return parseQuery(TelegramWidgetQuerySchema2, value);
|
|
102
|
+
}
|
|
103
|
+
function parseTelegramSharedWidgetQuery2(value) {
|
|
104
|
+
return parseQuery(TelegramSharedWidgetQuerySchema2, value);
|
|
105
|
+
}
|
|
92
106
|
|
|
93
|
-
export { TELEGRAM_WIDGET_LIMITS2, TelegramWidgetHtmlSchema2, TelegramWidgetDataSchema2, TelegramWidgetMessageSchema2, TelegramWidgetQuerySchema2, parseTelegramWidgetQuery2 };
|
|
107
|
+
export { TELEGRAM_WIDGET_LIMITS2, TelegramWidgetHtmlSchema2, TelegramWidgetDataSchema2, TelegramWidgetMessageSchema2, TelegramWidgetQuerySchema2, TelegramSharedWidgetQuerySchema2, parseTelegramWidgetQuery2, parseTelegramSharedWidgetQuery2 };
|