stitchkit 0.136.7 → 0.137.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 +68 -0
- package/dist/agent-runtime/stores/branch-observations.d.ts +19 -19
- package/dist/agent-runtime/stores/schedule-contract.d.ts.map +1 -1
- package/dist/agent-runtime/stores/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/stores/schedule-tools.d.ts.map +1 -1
- package/dist/agent-runtime/stores/sql-rows.d.ts +36 -36
- package/dist/agent-runtime/terminal-commit.d.ts +5 -5
- package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts +52 -52
- package/dist/agent-runtime/testing/store-conformance-support.d.ts +26 -26
- package/dist/browser/client-executors.d.ts +2 -3
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +6 -1
- package/dist/browser/realtime-client.d.ts.map +1 -1
- package/dist/browser/socket-io-client.d.ts.map +1 -1
- package/dist/browser/socket-io-contract.d.ts +2 -0
- package/dist/browser/socket-io-contract.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +6 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +1 -1
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/error-mapping.d.ts +71 -0
- package/dist/contract/error-mapping.d.ts.map +1 -0
- package/dist/contract/errors.d.ts +8 -0
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/factory.d.ts +8 -0
- package/dist/contract/factory.d.ts.map +1 -1
- package/dist/contract/fragments.d.ts +45 -0
- package/dist/contract/fragments.d.ts.map +1 -0
- package/dist/contract/normalize.d.ts +6 -3
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/contract/operation-read.d.ts +38 -0
- package/dist/contract/operation-read.d.ts.map +1 -0
- package/dist/contract/stream.d.ts.map +1 -1
- package/dist/contract/time-zone.d.ts +31 -0
- package/dist/contract/time-zone.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +1 -1
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/device-relay/hub.d.ts +1 -1
- package/dist/device-relay/hub.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +9 -9
- package/dist/entrypoints/agent-executor/claude-sdk.js +11 -11
- package/dist/entrypoints/agent-executor/claude.js +8 -8
- package/dist/entrypoints/agent-executor/codex.js +15 -15
- package/dist/entrypoints/agent-executor/testing.js +11 -11
- package/dist/entrypoints/agent-executor.js +14 -13
- package/dist/entrypoints/agent-runtime/ai-sdk.js +5 -5
- package/dist/entrypoints/agent-runtime/anthropic.js +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +5 -5
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +14 -15
- package/dist/entrypoints/agent-runtime/openai.js +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +7 -7
- package/dist/entrypoints/agent-runtime/postgres.js +5 -5
- package/dist/entrypoints/agent-runtime/realtime.js +8 -8
- package/dist/entrypoints/agent-runtime/sandbox.js +7 -7
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +33 -29
- package/dist/entrypoints/application/diagnostic-journal.js +3 -3
- package/dist/entrypoints/application/directory-inbox.js +1 -1
- package/dist/entrypoints/application/grammy.js +1 -1
- package/dist/entrypoints/application/opentelemetry.js +2 -2
- package/dist/entrypoints/application.js +10 -10
- package/dist/entrypoints/cli/publish.d.ts +4 -4
- package/dist/entrypoints/cli/publish.d.ts.map +1 -1
- package/dist/entrypoints/cli/publish.js +160 -52
- package/dist/entrypoints/cli.d.ts +3 -1
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +520 -59
- package/dist/entrypoints/contract.d.ts +5 -1
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +25 -7
- package/dist/entrypoints/device-relay.js +20 -10
- package/dist/entrypoints/files/packaging.js +2 -2
- package/dist/entrypoints/files.js +10 -10
- package/dist/entrypoints/handler.d.ts +1 -1
- package/dist/entrypoints/handler.d.ts.map +1 -1
- package/dist/entrypoints/handler.js +12 -12
- package/dist/entrypoints/http.js +13 -12
- package/dist/entrypoints/index.js +36 -18
- package/dist/entrypoints/live.d.ts +2 -1
- package/dist/entrypoints/live.d.ts.map +1 -1
- package/dist/entrypoints/live.js +630 -1
- package/dist/entrypoints/node.d.ts +5 -0
- package/dist/entrypoints/node.d.ts.map +1 -1
- package/dist/entrypoints/node.js +36 -16
- package/dist/entrypoints/observability.js +25 -10
- package/dist/entrypoints/postgres.d.ts +4 -1
- package/dist/entrypoints/postgres.d.ts.map +1 -1
- package/dist/entrypoints/postgres.js +312 -0
- package/dist/entrypoints/primitives.js +11 -4
- package/dist/entrypoints/process.js +7 -7
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/realtime.js +3 -3
- package/dist/entrypoints/remote.js +6 -29
- package/dist/entrypoints/server.d.ts +6 -1
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +93 -32
- package/dist/entrypoints/service-host/macos.js +6 -6
- package/dist/entrypoints/service-host/work.js +6 -6
- package/dist/entrypoints/service-host.js +10 -10
- package/dist/entrypoints/spend.js +2 -1
- package/dist/entrypoints/sync.js +5 -5
- package/dist/entrypoints/telegram.js +8 -8
- package/dist/entrypoints/testing.d.ts +1 -0
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +1501 -13
- package/dist/entrypoints/tools/agent.js +6 -7
- package/dist/entrypoints/tools/connections.js +9 -11
- package/dist/entrypoints/tools/contract.js +1 -2
- package/dist/entrypoints/tools/invoker.js +4 -5
- package/dist/entrypoints/tools/mcp.js +10 -11
- package/dist/entrypoints/tools/toolkit.d.ts +1 -1
- package/dist/entrypoints/tools/toolkit.d.ts.map +1 -1
- package/dist/entrypoints/tools/toolkit.js +29 -24
- package/dist/entrypoints/tools.js +28 -30
- package/dist/entrypoints/tracking/contract.js +2 -1
- package/dist/entrypoints/xlsx.js +5 -8
- package/dist/{index-033tyx59.js → index-0zw0hcyg.js} +4 -1
- package/dist/{index-zcq3dby3.js → index-1bjwfnnj.js} +1 -1
- package/dist/{index-f103md2v.js → index-1cfacbe2.js} +88 -23
- package/dist/{index-gj4wdts6.js → index-1ckh9qx1.js} +1 -1
- package/dist/index-1pvwmbxp.js +1435 -0
- package/dist/{index-0s75mjh7.js → index-2e4hdh32.js} +1 -1
- package/dist/{index-3shdhzt6.js → index-2j0pqxkn.js} +12 -6
- package/dist/index-3k8w02se.js +28 -0
- package/dist/{index-7fjbdga8.js → index-3pb4ccj2.js} +8 -0
- package/dist/{index-w7e402wx.js → index-48kb4gqq.js} +46 -7
- package/dist/{index-cv9b7fz2.js → index-6rws2xf5.js} +8 -0
- package/dist/{index-bbpygynk.js → index-77w5vx0g.js} +1 -1
- package/dist/index-7dz1ngaf.js +35 -0
- package/dist/{index-y68gavb5.js → index-7n4atsm4.js} +1 -1
- package/dist/index-8ef1bfea.js +71 -0
- package/dist/{index-0x4mnwg5.js → index-8k3y9nd4.js} +6 -9
- package/dist/{index-ezwsqyad.js → index-8rkdkefj.js} +40 -23
- package/dist/{index-3cwq5byx.js → index-9nax7tkn.js} +2 -2
- package/dist/{index-dz6tstcp.js → index-9r6emjwz.js} +1 -1
- package/dist/{index-32ew02z1.js → index-c4b7d6ej.js} +5 -5
- package/dist/index-ceshyndf.js +284 -0
- package/dist/{index-w161azza.js → index-d13rw31w.js} +6 -6
- package/dist/{index-1h0dtfz3.js → index-dmm7vs3f.js} +1 -1
- package/dist/{index-ypm85xwe.js → index-dp8j2e77.js} +1 -1
- package/dist/{index-qqd979f7.js → index-edycjvrv.js} +9 -9
- package/dist/{index-18qdpbcq.js → index-egpf9dv0.js} +200 -1479
- package/dist/{index-fatke81t.js → index-ezgvsj9w.js} +2 -2
- package/dist/{index-chapre0y.js → index-f3e7tj1g.js} +1 -1
- package/dist/{index-df5xr2f9.js → index-frsd2a94.js} +16 -1
- package/dist/index-fy9mmek1.js +95 -0
- package/dist/{index-2331y2tf.js → index-g0gvfzrx.js} +12 -12
- package/dist/index-gpe8d1ka.js +19 -0
- package/dist/{index-4p2zx593.js → index-gyw4qd0m.js} +1 -1
- package/dist/index-gzqy81tw.js +172 -0
- package/dist/{index-yrhw10ef.js → index-h34c510q.js} +8 -4
- package/dist/{index-rr94xcj6.js → index-h527p1yj.js} +10 -4
- package/dist/{index-qj0sq69b.js → index-hgf1tbgz.js} +76 -16
- package/dist/{index-smvmnz5y.js → index-hvpan32x.js} +1 -1
- package/dist/{index-4gbybjg6.js → index-hxawqrb6.js} +2 -2
- package/dist/{index-0k1ba0ss.js → index-j91jffhv.js} +1 -1
- package/dist/{index-d01akj5n.js → index-jr4kwetx.js} +8 -8
- package/dist/{index-xqppqn97.js → index-ka6z48zc.js} +315 -69
- package/dist/{index-by8w2461.js → index-kw0segzt.js} +104 -3
- package/dist/{index-6f4fjygr.js → index-m5t4dr7h.js} +29 -7
- package/dist/{index-afaq0nc4.js → index-n0egp1ke.js} +1 -1
- package/dist/{index-9fzjgg86.js → index-n74rb1dq.js} +2 -2
- package/dist/{index-dwq6a6sq.js → index-pt25vmhc.js} +33 -16
- package/dist/{index-vwg0n3e6.js → index-pyazb8q4.js} +23 -14
- package/dist/{index-5md04mwc.js → index-qpjjbkc5.js} +4 -4
- package/dist/{index-08a3qfr8.js → index-r1qt6zgj.js} +1 -1
- package/dist/{index-ctaxjpa4.js → index-r709pqed.js} +1 -1
- package/dist/{index-2zrx0nzv.js → index-rzc40z6e.js} +3 -5
- package/dist/{index-gq35s3bm.js → index-s5axtd56.js} +2 -2
- package/dist/{index-edpkm3k7.js → index-scpcps66.js} +669 -16
- package/dist/{index-ry8m2mhg.js → index-sf2mt6wj.js} +1 -1
- package/dist/{index-tjhhsnjv.js → index-t1213r0t.js} +1 -1
- package/dist/{index-gvgtmt7a.js → index-t7efje30.js} +2 -2
- package/dist/{index-w3s79kcb.js → index-tzyk36dy.js} +1 -1
- package/dist/{index-8tn10tp6.js → index-v64bvwjr.js} +1 -1
- package/dist/{index-1fhbe4e4.js → index-vksbsqpb.js} +1 -1
- package/dist/{index-dxft2mnm.js → index-wdg7bswj.js} +1 -1
- package/dist/{index-ppy23bd2.js → index-wjx1zs2r.js} +7 -578
- package/dist/{index-efbzm2se.js → index-x2r0ma9t.js} +1 -1
- package/dist/{index-kd48gk7d.js → index-x8py72a3.js} +1 -1
- package/dist/index-xvydbxmk.js +1404 -0
- package/dist/index-xwaphv0d.js +31 -0
- package/dist/{index-a09r9ff0.js → index-y44j39yk.js} +1 -1
- package/dist/{index-7mjsb7zv.js → index-ybrrxjhb.js} +1 -1
- package/dist/{index-xsrma0jd.js → index-ysthxsa8.js} +6 -6
- package/dist/{index-6p5pshcd.js → index-yyh3ey4b.js} +1 -1
- package/dist/{index-mr3njw67.js → index-z6hq9j8j.js} +1 -1
- package/dist/{index-67mzzkdv.js → index-z72agxdn.js} +2 -2
- package/dist/{index-e4w0sfm1.js → index-z78mtc16.js} +1 -1
- package/dist/{index-7csn6pva.js → index-ze94h4ph.js} +5 -0
- package/dist/internal/json-stringify.d.ts +12 -0
- package/dist/internal/json-stringify.d.ts.map +1 -1
- package/dist/internal/unix-client-error.d.ts +4 -0
- package/dist/internal/unix-client-error.d.ts.map +1 -1
- package/dist/live/watch-contract.d.ts +4 -0
- package/dist/live/watch-contract.d.ts.map +1 -1
- package/dist/live/watch-fanout-frame.d.ts +81 -0
- package/dist/live/watch-fanout-frame.d.ts.map +1 -0
- package/dist/live/watch-fanout.d.ts +57 -0
- package/dist/live/watch-fanout.d.ts.map +1 -0
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/spool-core.d.ts +1 -0
- package/dist/observability/spool-core.d.ts.map +1 -1
- package/dist/observability/spool-drain.d.ts +48 -0
- package/dist/observability/spool-drain.d.ts.map +1 -0
- package/dist/observability/spool.d.ts +12 -6
- package/dist/observability/spool.d.ts.map +1 -1
- package/dist/postgres/connection-config.d.ts +54 -0
- package/dist/postgres/connection-config.d.ts.map +1 -0
- package/dist/postgres/rollback-transaction.d.ts +61 -0
- package/dist/postgres/rollback-transaction.d.ts.map +1 -0
- package/dist/primitives/deadline.d.ts +4 -4
- package/dist/primitives/deadline.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +3 -32
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/local-consent-key.d.ts +104 -0
- package/dist/server/local-consent-key.d.ts.map +1 -0
- package/dist/server/local-control-journal.d.ts +51 -0
- package/dist/server/local-control-journal.d.ts.map +1 -0
- package/dist/server/local-control-reporter.d.ts +32 -0
- package/dist/server/local-control-reporter.d.ts.map +1 -0
- package/dist/server/local-control.d.ts +48 -0
- package/dist/server/local-control.d.ts.map +1 -0
- package/dist/server/local-host-clients.d.ts +105 -0
- package/dist/server/local-host-clients.d.ts.map +1 -0
- package/dist/server/middleware/trust-fence.d.ts +20 -0
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/spend/receipt-spool.d.ts +9 -4
- package/dist/spend/receipt-spool.d.ts.map +1 -1
- package/dist/testing/tool-surface-checks.d.ts +89 -0
- package/dist/testing/tool-surface-checks.d.ts.map +1 -0
- package/dist/testing/tool-surface-cli-callable.d.ts +63 -0
- package/dist/testing/tool-surface-cli-callable.d.ts.map +1 -0
- package/dist/testing/tool-surface-dead-refs.d.ts +32 -0
- package/dist/testing/tool-surface-dead-refs.d.ts.map +1 -0
- package/dist/testing/tool-surface-gates.d.ts +72 -0
- package/dist/testing/tool-surface-gates.d.ts.map +1 -0
- package/dist/testing/tool-surface-parity-drivers.d.ts +56 -0
- package/dist/testing/tool-surface-parity-drivers.d.ts.map +1 -0
- package/dist/testing/tool-surface-parity.d.ts +28 -0
- package/dist/testing/tool-surface-parity.d.ts.map +1 -0
- package/dist/testing/tool-surface-ratchet.d.ts +71 -0
- package/dist/testing/tool-surface-ratchet.d.ts.map +1 -0
- package/dist/tools/agent-tools.d.ts +3 -0
- package/dist/tools/agent-tools.d.ts.map +1 -1
- package/dist/tools/cli/command.d.ts +3 -0
- package/dist/tools/cli/command.d.ts.map +1 -1
- package/dist/tools/cli/create-cli.d.ts.map +1 -1
- package/dist/tools/cli/distribution-config.d.ts +39 -1
- package/dist/tools/cli/distribution-config.d.ts.map +1 -1
- package/dist/tools/cli/distribution-routes.d.ts +4 -2
- package/dist/tools/cli/distribution-routes.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts +3 -6
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +4 -0
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/local-key-command.d.ts +53 -0
- package/dist/tools/cli/local-key-command.d.ts.map +1 -0
- package/dist/tools/cli/managed-surface.d.ts.map +1 -1
- package/dist/tools/cli/publication-contract.d.ts +9 -2
- package/dist/tools/cli/publication-contract.d.ts.map +1 -1
- package/dist/tools/cli/publication.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/run-stream.d.ts.map +1 -1
- package/dist/tools/cli/runner.d.ts +8 -3
- package/dist/tools/cli/runner.d.ts.map +1 -1
- package/dist/tools/cli/secret.d.ts +55 -0
- package/dist/tools/cli/secret.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +2 -2
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/cli/signature.d.ts +23 -9
- package/dist/tools/cli/signature.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/cli/unix-outcome.d.ts +6 -0
- package/dist/tools/cli/unix-outcome.d.ts.map +1 -1
- package/dist/tools/cli/update.d.ts +6 -1
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/execute-result.d.ts +20 -0
- package/dist/tools/execute-result.d.ts.map +1 -1
- package/dist/tools/execute.d.ts +3 -0
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/json-projection.d.ts +13 -9
- package/dist/tools/internal/json-projection.d.ts.map +1 -1
- package/dist/tools/internal/remote-error.d.ts +15 -0
- package/dist/tools/internal/remote-error.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +2 -0
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +3 -0
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts +2 -0
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +5 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +2 -0
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts +2 -0
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mcp/stdio.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +3 -0
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/read-operation.d.ts +2 -6
- package/dist/tools/read-operation.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +10 -3
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/xlsx/schema.d.ts.map +1 -1
- package/llms/cli-publish.txt +4 -1
- package/llms/cli.2.txt +42 -51
- package/llms/cli.3.txt +34 -1
- package/llms/cli.txt +18 -3
- package/llms/contract.txt +47 -5
- package/llms/handler.txt +1 -1
- package/llms/live.txt +82 -0
- package/llms/node.txt +5 -0
- package/llms/observability.2.txt +1 -1
- package/llms/observability.txt +6 -0
- package/llms/postgres.txt +14 -3
- package/llms/server.2.txt +206 -240
- package/llms/server.3.txt +242 -202
- package/llms/server.4.txt +202 -1025
- package/llms/server.5.txt +1053 -255
- package/llms/server.6.txt +274 -0
- package/llms/server.txt +32 -116
- package/llms/spend.txt +8 -7
- package/llms/stitchkit.2.txt +13 -35
- package/llms/stitchkit.3.txt +27 -0
- package/llms/stitchkit.txt +82 -82
- package/llms/testing.txt +40 -0
- package/llms/tools-toolkit.txt +2 -2
- package/llms/tools.2.txt +29 -20
- package/llms/{upgrading-0.128.0-0.129.0.txt → upgrading-0.128.0-0.131.0.txt} +101 -3
- package/llms/{upgrading-0.130.0-0.136.0.txt → upgrading-0.132.0-0.137.0.txt} +62 -101
- package/llms/upgrading.txt +2 -2
- package/llms-full.txt +641 -189
- package/llms.txt +14 -14
- package/package.json +3 -3
- package/dist/index-9118dw8d.js +0 -603
- package/dist/index-9vj869rx.js +0 -19
- package/dist/index-a1rjr381.js +0 -114
- package/dist/index-dacxr7nf.js +0 -17
- package/dist/index-dm50x3by.js +0 -63
- package/dist/index-dmrx8xma.js +0 -163
- package/dist/index-ednf2cxs.js +0 -37
- package/dist/{index-e4zt2x70.js → index-3czppvrr.js} +3 -3
- package/dist/{index-42n9jycn.js → index-3f79t32b.js} +3 -3
- package/dist/{index-mfe9a266.js → index-84n49vam.js} +0 -0
- package/dist/{index-f16b7rze.js → index-er1tp8de.js} +3 -3
- package/dist/{index-k137ezb6.js → index-f5d0fdcf.js} +3 -3
- package/dist/{index-65p8v81y.js → index-psz8qrz0.js} +3 -3
- package/dist/{index-kadgaw1s.js → index-r8cq86h1.js} +0 -0
- package/dist/{index-1yky29qg.js → index-tyyvbarf.js} +0 -0
- package/dist/{index-tjakdpf2.js → index-wq71v08n.js} +3 -3
- package/dist/{index-7an2fs5h.js → index-wswcpbm4.js} +3 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run an interactive database transaction that may intentionally roll back
|
|
3
|
+
* while still returning a typed payload — for dry runs, batch validation, or
|
|
4
|
+
* stop-on-first-failure workflows.
|
|
5
|
+
*
|
|
6
|
+
* Returning `rollback(value)` keeps the planned rollback out of user
|
|
7
|
+
* `try / catch` blocks inside `work`: the private `PlannedRollbackSignal` is
|
|
8
|
+
* only thrown after `work` returns, forcing the client's `$transaction` to roll
|
|
9
|
+
* back and catching strictly that invocation's signal on the outside. Real
|
|
10
|
+
* database errors, nested rollbacks, and rollback failures always propagate
|
|
11
|
+
* untouched with their original identity and `cause`.
|
|
12
|
+
*
|
|
13
|
+
* Structural and peer-free — works with Prisma's overloaded `$transaction` and
|
|
14
|
+
* any compatible interactive transaction client without importing Prisma or `pg`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Structural client exposing an interactive `$transaction(fn, options?)` method.
|
|
18
|
+
* Compatible with Prisma's overloaded `$transaction` without importing Prisma.
|
|
19
|
+
*/
|
|
20
|
+
export interface InteractiveTransactionClient<TTx, TOptions = never> {
|
|
21
|
+
$transaction<T>(fn: (tx: TTx) => Promise<T>, options?: TOptions): Promise<T>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Branded token returned by `rollback(value)` inside `runRollbackTransaction`.
|
|
25
|
+
* Return this token from the transaction callback to trigger a planned rollback.
|
|
26
|
+
*/
|
|
27
|
+
export interface PlannedRollback<T> {
|
|
28
|
+
readonly __stitchkitPlannedRollback: true;
|
|
29
|
+
readonly value: T;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Callback argument passed to `runRollbackTransaction`'s `work` function.
|
|
33
|
+
* Call `return rollback(value)` to roll back the transaction and resolve with
|
|
34
|
+
* `{ committed: false, value }`.
|
|
35
|
+
*/
|
|
36
|
+
export type TransactionRollback = <T>(value: T) => PlannedRollback<T>;
|
|
37
|
+
type CommittedValue<TResult> = Exclude<TResult, PlannedRollback<unknown>>;
|
|
38
|
+
type RolledBackValue<TResult> = TResult extends PlannedRollback<infer TValue> ? TValue : never;
|
|
39
|
+
/** Discriminated result of {@link runRollbackTransaction}. */
|
|
40
|
+
export type RollbackTransactionResult<TCommitted, TRolledBack> = ([TCommitted] extends [never] ? never : {
|
|
41
|
+
readonly committed: true;
|
|
42
|
+
readonly value: TCommitted;
|
|
43
|
+
}) | ([TRolledBack] extends [never] ? never : {
|
|
44
|
+
readonly committed: false;
|
|
45
|
+
readonly value: TRolledBack;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Execute `work` inside `client.$transaction(...)` with a typed planned-rollback
|
|
49
|
+
* escape hatch.
|
|
50
|
+
*
|
|
51
|
+
* - Normal return `value` → commits and resolves `{ committed: true, value }`.
|
|
52
|
+
* - `return rollback(value)` → rolls back the transaction and resolves
|
|
53
|
+
* `{ committed: false, value }`.
|
|
54
|
+
* - Calling `rollback(value)` without returning its token throws a `TypeError`
|
|
55
|
+
* after `work` returns, rolling back the transaction instead of committing.
|
|
56
|
+
* - Any real error thrown inside `work` or by the rollback itself propagates as
|
|
57
|
+
* the exact same object with its `cause` intact.
|
|
58
|
+
*/
|
|
59
|
+
export declare function runRollbackTransaction<TTx, TOptions = never, TResult = unknown>(client: InteractiveTransactionClient<TTx, TOptions>, work: (tx: TTx, rollback: TransactionRollback) => Promise<TResult>, options?: NoInfer<TOptions>): Promise<RollbackTransactionResult<CommittedValue<TResult>, RolledBackValue<TResult>>>;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=rollback-transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollback-transaction.d.ts","sourceRoot":"","sources":["../../src/postgres/rollback-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,MAAM,WAAW,4BAA4B,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK;IACjE,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9E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AAC,cAAc,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -17,14 +17,14 @@ export declare function defineDeadlinePolicy<const TOnTrack extends string, cons
|
|
|
17
17
|
};
|
|
18
18
|
}): Readonly<{
|
|
19
19
|
definition: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly categories: {
|
|
20
|
+
boundary: 'elapsed-day' | 'calendar-day';
|
|
21
|
+
warningDays: number;
|
|
22
|
+
categories: {
|
|
24
23
|
readonly onTrack: TOnTrack;
|
|
25
24
|
readonly warning: TWarning;
|
|
26
25
|
readonly overdue: TOverdue;
|
|
27
26
|
};
|
|
27
|
+
timeZone: string;
|
|
28
28
|
};
|
|
29
29
|
evaluate(input: {
|
|
30
30
|
readonly anchorAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../src/primitives/deadline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../src/primitives/deadline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AA8ElE,wBAAgB,oBAAoB,CAClC,KAAK,CAAC,QAAQ,SAAS,MAAM,EAC7B,KAAK,CAAC,QAAQ,SAAS,MAAM,EAC7B,KAAK,CAAC,QAAQ,SAAS,MAAM,EAC7B,MAAM,EAAE;IACR,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,cAAc,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;KAC5B,CAAC;CACH;;kBARoB,aAAa,GAAG,cAAc;qBAE3B,MAAM;oBACP;YACnB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;SAC5B;;;oBAgBiB;QACd,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;QACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;KACpB,GAAG,cAAc;uBAuBC,IAAI;;;;GAO1B"}
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
* createServer({ services, hooks: { onError } });
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
import { type
|
|
40
|
+
import { type ErrorCodeMapping } from '../contract/error-mapping.js';
|
|
41
41
|
import type { RuntimeContext } from '../contract/runtime-context.js';
|
|
42
42
|
import type { LifecycleHooks, MethodDef } from './types.js';
|
|
43
|
+
export type { ErrorCodeMapping };
|
|
43
44
|
/** The normalised error handed to `render` — code already remapped. */
|
|
44
45
|
export interface ResolvedError {
|
|
45
46
|
/** Wire code — the app code from `codeMap` for a stitch error, else the thrown code. */
|
|
@@ -60,38 +61,8 @@ export interface ErrorHookBase {
|
|
|
60
61
|
/** Observe the raw thrown value before rendering. */
|
|
61
62
|
onError?: (error: unknown, info: ResolvedError, ctx: RuntimeContext, endpoint?: MethodDef) => unknown | Promise<unknown>;
|
|
62
63
|
}
|
|
63
|
-
/** Mapping strategy translating framework error codes to public wire error codes. */
|
|
64
|
-
export type ErrorHookMapping<TWireCode extends string> = {
|
|
65
|
-
/** A vocabulary returned by `defineErrors`; its generated map is canonical. */
|
|
66
|
-
vocabulary: {
|
|
67
|
-
readonly codeMap: Partial<Record<StitchErrorCode, TWireCode>>;
|
|
68
|
-
};
|
|
69
|
-
codeMap?: never;
|
|
70
|
-
unmappedCode?: never;
|
|
71
|
-
} | {
|
|
72
|
-
vocabulary?: never;
|
|
73
|
-
/**
|
|
74
|
-
* Remap stitchkit's own error codes to your public wire codes.
|
|
75
|
-
*
|
|
76
|
-
* **Partial on purpose.** It once said "Exhaustive — `satisfies
|
|
77
|
-
* Record<StitchErrorCode, …>` makes a new framework code a compile error
|
|
78
|
-
* here", which stopped being true in 0.56.1 and kept shipping in the `.d.ts`
|
|
79
|
-
* for a consumer to read on hover. The set grows in ordinary releases, so an
|
|
80
|
-
* exhaustive map would break every consumer on an additive one; a code you
|
|
81
|
-
* leave out falls through to `unmappedCode`. → ADR 0105
|
|
82
|
-
*
|
|
83
|
-
* Codes you threw yourself (not stitchkit's) pass through as-is.
|
|
84
|
-
*/
|
|
85
|
-
codeMap?: Partial<Record<StitchErrorCode, TWireCode>>;
|
|
86
|
-
/**
|
|
87
|
-
* Wire code for every unmapped stitchkit code, or a resolver for grouping
|
|
88
|
-
* them. Explicit `codeMap` entries win. Project-owned codes never use this
|
|
89
|
-
* fallback and continue to pass through unchanged.
|
|
90
|
-
*/
|
|
91
|
-
unmappedCode?: TWireCode | ((code: StitchErrorCode) => TWireCode);
|
|
92
|
-
};
|
|
93
64
|
/** Configuration options for `createErrorHook`. */
|
|
94
|
-
export type ErrorHookConfig<TWireCode extends string = string> = ErrorHookBase &
|
|
65
|
+
export type ErrorHookConfig<TWireCode extends string = string> = ErrorHookBase & ErrorCodeMapping<TWireCode>;
|
|
95
66
|
/** Build an `onError` hook from a code map + envelope renderer. */
|
|
96
67
|
export declare function createErrorHook<TWireCode extends string = string>(config: ErrorHookConfig<TWireCode>): NonNullable<LifecycleHooks['onError']>;
|
|
97
68
|
//# sourceMappingURL=error-hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-hook.d.ts","sourceRoot":"","sources":["../../src/server/error-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"error-hook.d.ts","sourceRoot":"","sources":["../../src/server/error-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,MAAM,EAAE,CACN,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,cAAc,EACnB,QAAQ,CAAC,EAAE,SAAS,KACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,qDAAqD;IACrD,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,cAAc,EACnB,QAAQ,CAAC,EAAE,SAAS,KACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED,mDAAmD;AACnD,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,IAAI,aAAa,GAC5E,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAE9B,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,EAC/D,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,GACjC,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAyBxC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-side primitive for issuing a scoped local program key over a Unix
|
|
3
|
+
* control socket strictly after explicit human approval in a native dialog
|
|
4
|
+
* outside the web page. → ADR 0346.
|
|
5
|
+
*
|
|
6
|
+
* Security invariants:
|
|
7
|
+
* - Fail-closed session & role checks before touching `consent`:
|
|
8
|
+
* `callerCanManageKeys === true` (else `403 KEYS_MANAGE_REQUIRED`),
|
|
9
|
+
* `allowsKeyManagement === false` (else `403 ROLE_NOT_ALLOWED`).
|
|
10
|
+
* - Single-pending-prompt lock acquired synchronously after validation and
|
|
11
|
+
* authorization so malformed requests cannot DoS the lock while concurrent
|
|
12
|
+
* valid requests (and other guarded control routes) receive `409 CONSENT_PENDING`.
|
|
13
|
+
* - Bounded by `withSignalDeadline(consentTimeoutMs, request.signal)` +
|
|
14
|
+
* `raceAbort` so a slow or non-cooperative consent implementation cannot hang
|
|
15
|
+
* or issue an orphaned key after timeout (`408 INIT_TIMEOUT`, `retryable: false`)
|
|
16
|
+
* or client disconnect (`499 REQUEST_ABORTED`).
|
|
17
|
+
* - Successful responses set `Cache-Control: no-store` and return the issued
|
|
18
|
+
* key once.
|
|
19
|
+
*/
|
|
20
|
+
import { z } from 'zod';
|
|
21
|
+
import { type ReportedClient, type ReportedClientOptions } from './local-control-reporter.js';
|
|
22
|
+
import type { RawRoute } from './types.js';
|
|
23
|
+
/** Default request body schema for {@link createLocalConsentKeyIssuance}. */
|
|
24
|
+
export declare const LocalConsentKeyRequestSchema: z.ZodObject<{
|
|
25
|
+
role: z.ZodString;
|
|
26
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
/** Default parsed request type for {@link createLocalConsentKeyIssuance}. */
|
|
30
|
+
export type LocalConsentKeyRequest = z.infer<typeof LocalConsentKeyRequestSchema>;
|
|
31
|
+
/** Human decision returned by the native consent prompt port. */
|
|
32
|
+
export type LocalConsentDecision = 'approve' | 'deny' | 'timeout';
|
|
33
|
+
/** Fail-closed authorization verdict supplied by the host application. */
|
|
34
|
+
export interface LocalConsentAuthorization<TAuth = unknown> {
|
|
35
|
+
/** Must be strictly `true` — otherwise refused with `403 KEYS_MANAGE_REQUIRED`. */
|
|
36
|
+
readonly callerCanManageKeys: boolean;
|
|
37
|
+
/** Must be strictly `false` — roles able to manage keys are always refused (`403 ROLE_NOT_ALLOWED`). */
|
|
38
|
+
readonly allowsKeyManagement: boolean;
|
|
39
|
+
/** Human-readable summary presented in the native consent prompt. */
|
|
40
|
+
readonly summary: string;
|
|
41
|
+
/** Optional application-owned authorization details forwarded to `issueKey`. */
|
|
42
|
+
readonly authorized?: TAuth;
|
|
43
|
+
}
|
|
44
|
+
/** Prompt payload handed to the host's native consent port. */
|
|
45
|
+
export interface LocalConsentQuestion<TRequest> {
|
|
46
|
+
readonly request: TRequest;
|
|
47
|
+
readonly client: ReportedClient;
|
|
48
|
+
readonly summary: string;
|
|
49
|
+
}
|
|
50
|
+
/** Configuration for {@link createLocalConsentKeyIssuance}. */
|
|
51
|
+
export interface LocalConsentKeyConfig<TRequest = LocalConsentKeyRequest, TAuth = unknown, TIssued = unknown> {
|
|
52
|
+
/** Raw route path mounted on the Unix listener. Default `'/v1/init-key'`. */
|
|
53
|
+
readonly path?: string;
|
|
54
|
+
/** Optional custom Zod schema overriding {@link LocalConsentKeyRequestSchema}. */
|
|
55
|
+
readonly requestSchema?: z.ZodType<TRequest>;
|
|
56
|
+
/** Maximum JSON request body size in bytes. Default `16384` (16 KiB). */
|
|
57
|
+
readonly maxBodyBytes?: number;
|
|
58
|
+
/** Maximum milliseconds to wait for human consent before `408 INIT_TIMEOUT`. Default `60000`. */
|
|
59
|
+
readonly consentTimeoutMs?: number;
|
|
60
|
+
/** Self-reported client attribution header options. */
|
|
61
|
+
readonly reporter?: ReportedClientOptions;
|
|
62
|
+
/**
|
|
63
|
+
* Verify the current desktop session can manage keys and that the requested
|
|
64
|
+
* role cannot escalate to key management. Runs before `consent`.
|
|
65
|
+
*/
|
|
66
|
+
readonly authorizeRequest: (input: {
|
|
67
|
+
readonly request: TRequest;
|
|
68
|
+
readonly client: ReportedClient;
|
|
69
|
+
readonly rawRequest: Request;
|
|
70
|
+
}) => LocalConsentAuthorization<TAuth> | Promise<LocalConsentAuthorization<TAuth>>;
|
|
71
|
+
/** Show the native out-of-page consent prompt and return the human decision. */
|
|
72
|
+
readonly consent: (question: LocalConsentQuestion<TRequest>, options: {
|
|
73
|
+
readonly signal: AbortSignal;
|
|
74
|
+
}) => LocalConsentDecision | Promise<LocalConsentDecision>;
|
|
75
|
+
/** Issue the scoped credential once after explicit approval. */
|
|
76
|
+
readonly issueKey: (input: {
|
|
77
|
+
readonly request: TRequest;
|
|
78
|
+
readonly authorization: LocalConsentAuthorization<TAuth>;
|
|
79
|
+
readonly client: ReportedClient;
|
|
80
|
+
}) => TIssued | Promise<TIssued>;
|
|
81
|
+
}
|
|
82
|
+
/** Local consent-gated key issuance route and shared pending-prompt guard. */
|
|
83
|
+
export interface LocalConsentKeyIssuance {
|
|
84
|
+
/** `POST` raw route to mount on `createServer({ unix, rawRoutes: [issuance.route, ...] })`. */
|
|
85
|
+
readonly route: RawRoute;
|
|
86
|
+
/** Whether a native consent prompt is currently awaiting human response. */
|
|
87
|
+
isConsentPending(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Wrap another fetch handler so other local control routes fail closed with
|
|
90
|
+
* `409 CONSENT_PENDING` while a native consent prompt is open.
|
|
91
|
+
*/
|
|
92
|
+
guardWhileConsentPending<TServer = unknown>(next: (request: Request, server: TServer) => Response | Promise<Response>): (request: Request, server: TServer) => Promise<Response>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Create the local Unix-socket raw route and pending-consent guard for issuing
|
|
96
|
+
* a scoped program key strictly after native human approval.
|
|
97
|
+
*/
|
|
98
|
+
export declare function createLocalConsentKeyIssuance<TAuth = unknown, TIssued = unknown>(config: Omit<LocalConsentKeyConfig<LocalConsentKeyRequest, TAuth, TIssued>, 'requestSchema'> & {
|
|
99
|
+
readonly requestSchema?: undefined;
|
|
100
|
+
}): LocalConsentKeyIssuance;
|
|
101
|
+
export declare function createLocalConsentKeyIssuance<TRequest, TAuth = unknown, TIssued = unknown>(config: LocalConsentKeyConfig<TRequest, TAuth, TIssued> & {
|
|
102
|
+
readonly requestSchema: z.ZodType<TRequest>;
|
|
103
|
+
}): LocalConsentKeyIssuance;
|
|
104
|
+
//# sourceMappingURL=local-consent-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-consent-key.d.ts","sourceRoot":"","sources":["../../src/server/local-consent-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMxC,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B;;;;kBAIvC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,MAAM,GAAG,SA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3B,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACxF,MAAM,EAAE,qBAAqB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG;IACxD,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC7C,GACA,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Zod schema for one local-control call-journal line. */
|
|
3
|
+
export declare const LocalControlJournalEntrySchema: z.ZodObject<{
|
|
4
|
+
at: z.ZodString;
|
|
5
|
+
method: z.ZodString;
|
|
6
|
+
path: z.ZodString;
|
|
7
|
+
status: z.ZodInt;
|
|
8
|
+
durationMs: z.ZodNumber;
|
|
9
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
10
|
+
client: z.ZodObject<{
|
|
11
|
+
verified: z.ZodLiteral<false>;
|
|
12
|
+
client: z.ZodOptional<z.ZodString>;
|
|
13
|
+
harness: z.ZodOptional<z.ZodString>;
|
|
14
|
+
model: z.ZodOptional<z.ZodString>;
|
|
15
|
+
session: z.ZodOptional<z.ZodString>;
|
|
16
|
+
machine: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
/** One validated record written to a {@link LocalControlJournal}. */
|
|
20
|
+
export type LocalControlJournalEntry = z.infer<typeof LocalControlJournalEntrySchema>;
|
|
21
|
+
/** Options for {@link createLocalControlJournal}. */
|
|
22
|
+
export interface LocalControlJournalConfig {
|
|
23
|
+
/** Absolute or relative path of the JSONL journal file (`0600`). */
|
|
24
|
+
readonly path: string;
|
|
25
|
+
/** Maximum file size in bytes before rotating to `<path>.1`. Default 1 MiB. */
|
|
26
|
+
readonly maxFileBytes?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum number of pending writes (including the currently executing disk
|
|
29
|
+
* write) queued in memory before excess entries are dropped and reported to
|
|
30
|
+
* `onError`. Default `256`.
|
|
31
|
+
*/
|
|
32
|
+
readonly maxPendingWrites?: number;
|
|
33
|
+
/** Optional observer invoked if writing, rotating, or queueing the journal fails. */
|
|
34
|
+
readonly onError?: (error: unknown) => void;
|
|
35
|
+
}
|
|
36
|
+
/** Serialized append-only JSONL journal for local control listeners. */
|
|
37
|
+
export interface LocalControlJournal {
|
|
38
|
+
readonly path: string;
|
|
39
|
+
/** Append one validated metadata entry, rotating to `<path>.1` when needed. */
|
|
40
|
+
append(entry: LocalControlJournalEntry): Promise<void>;
|
|
41
|
+
/** Wait for all queued appends and rotations to finish writing to disk. */
|
|
42
|
+
flush(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create an append-only `0600` JSONL call journal with serialized writes and
|
|
46
|
+
* single-generation rotation (`<path>.1`). Survives restrictive process `umask`
|
|
47
|
+
* via explicit `fchmod(0o600)` on the opened descriptor and refuses symlinks or
|
|
48
|
+
* non-regular files at both `<path>` and `<path>.1`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createLocalControlJournal(config: LocalControlJournalConfig): LocalControlJournal;
|
|
51
|
+
//# sourceMappingURL=local-control-journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-control-journal.d.ts","sourceRoot":"","sources":["../../src/server/local-control-journal.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,0DAA0D;AAC1D,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;kBAQzC,CAAC;AAEH,qEAAqE;AACrE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,qDAAqD;AACrD,MAAM,WAAW,yBAAyB;IACxC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C;AAED,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,2EAA2E;IAC3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA4CD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,yBAAyB,GAChC,mBAAmB,CAqGrB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Attribution fields extracted from local-control request headers. */
|
|
2
|
+
export type ReportedClientField = 'client' | 'harness' | 'model' | 'session' | 'machine';
|
|
3
|
+
/**
|
|
4
|
+
* Self-reported client metadata extracted from request headers.
|
|
5
|
+
* Always carries `verified: false` — headers are caller-supplied and spoofable
|
|
6
|
+
* by any process running as the same OS user.
|
|
7
|
+
*/
|
|
8
|
+
export interface ReportedClient {
|
|
9
|
+
readonly verified: false;
|
|
10
|
+
readonly client?: string;
|
|
11
|
+
readonly harness?: string;
|
|
12
|
+
readonly model?: string;
|
|
13
|
+
readonly session?: string;
|
|
14
|
+
readonly machine?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Header-naming and sanitization options for {@link extractReportedClient}. */
|
|
17
|
+
export interface ReportedClientOptions {
|
|
18
|
+
/** Header prefix for `<prefix><field>` lookup (case-insensitive). Default `'x-client-'`. */
|
|
19
|
+
readonly headerPrefix?: string;
|
|
20
|
+
/** Explicit per-field header names overriding `headerPrefix`. */
|
|
21
|
+
readonly headers?: Partial<Record<ReportedClientField, string>>;
|
|
22
|
+
/** Maximum Unicode code points kept per field after stripping control chars. Default `128`. */
|
|
23
|
+
readonly maxFieldLength?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extract sanitized self-reported client attribution from `request` headers.
|
|
27
|
+
* Strips all C0/DEL control characters (`\r`, `\n`, `\t`, NUL, etc.), trims
|
|
28
|
+
* whitespace, truncates each field to `maxFieldLength`, and always marks
|
|
29
|
+
* `verified: false`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function extractReportedClient(request: Request, options?: ReportedClientOptions): ReportedClient;
|
|
32
|
+
//# sourceMappingURL=local-control-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-control-reporter.d.ts","sourceRoot":"","sources":["../../src/server/local-control-reporter.ts"],"names":[],"mappings":"AAaA,uEAAuE;AACvE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAUzF;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;IAChE,+FAA+F;IAC/F,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAaD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,qBAA0B,GAClC,cAAc,CA8BhB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { LocalControlJournal } from './local-control-journal.js';
|
|
2
|
+
import { type ReportedClientOptions } from './local-control-reporter.js';
|
|
3
|
+
/** Configuration for {@link createLocalControlGuard}. */
|
|
4
|
+
export interface LocalControlGuardConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Maximum estimated UTF-8 bytes of the request line plus headers before
|
|
7
|
+
* refusing with `431 HEADERS_TOO_LARGE`. Default `8192` (8 KiB).
|
|
8
|
+
*
|
|
9
|
+
* Note: Bun's native HTTP parser enforces its own ceiling (~16 KiB) before
|
|
10
|
+
* `fetch` runs; values above that ceiling cannot raise Bun's native limit.
|
|
11
|
+
*/
|
|
12
|
+
readonly maxHeaderBytes?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum declared `Content-Length` bytes before refusing with
|
|
15
|
+
* `413 REQUEST_TOO_LARGE`. Requests with `Transfer-Encoding` or a non-null
|
|
16
|
+
* body without `Content-Length` are refused with `400 BAD_REQUEST`, while
|
|
17
|
+
* body-less requests (`req.body === null` and no `Content-Length`, including
|
|
18
|
+
* body-less `POST` from `createUnixClientTransport`) are accepted as 0 bytes.
|
|
19
|
+
* Default `2 MiB`.
|
|
20
|
+
*/
|
|
21
|
+
readonly maxBodyBytes?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum concurrent in-flight requests (including open `text/event-stream`
|
|
24
|
+
* and `application/x-ndjson` streams) before refusing with
|
|
25
|
+
* `503 CONTROL_API_BUSY`. Default `16`.
|
|
26
|
+
*/
|
|
27
|
+
readonly maxConcurrentRequests?: number;
|
|
28
|
+
/** Header prefix / field mapping for self-reported client attribution. */
|
|
29
|
+
readonly reporter?: ReportedClientOptions;
|
|
30
|
+
/** Optional `0600` JSONL call journal recording metadata only (no bodies or `Authorization`). */
|
|
31
|
+
readonly journal?: LocalControlJournal;
|
|
32
|
+
/** Injectable monotonic clock in ms for tests. Default `Date.now`. */
|
|
33
|
+
readonly now?: () => number;
|
|
34
|
+
}
|
|
35
|
+
/** Local control-socket wrapper returned by {@link createLocalControlGuard}. */
|
|
36
|
+
export interface LocalControlGuard {
|
|
37
|
+
/** Wrap `createServer`'s fetch handler without replacing or cloning the `Request`. */
|
|
38
|
+
wrapFetch<TServer = unknown>(next: (request: Request, server: TServer) => Response | Promise<Response>): (request: Request, server: TServer) => Promise<Response>;
|
|
39
|
+
/** Current number of active requests (including open streaming responses). */
|
|
40
|
+
activeRequests(): number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create a local control-socket fetch guard enforcing header size, explicit
|
|
44
|
+
* body-length limits, bounded request/stream concurrency, and optional
|
|
45
|
+
* metadata-only call-journal logging.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createLocalControlGuard(config?: LocalControlGuardConfig): LocalControlGuard;
|
|
48
|
+
//# sourceMappingURL=local-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-control.d.ts","sourceRoot":"","sources":["../../src/server/local-control.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAQ7F,yDAAyD;AACzD,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAC1C,iGAAiG;IACjG,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,sEAAsE;IACtE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B;AAED,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,SAAS,CAAC,OAAO,GAAG,OAAO,EACzB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GACxE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5D,8EAA8E;IAC9E,cAAc,IAAI,MAAM,CAAC;CAC1B;AAyJD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,GAAE,uBAA4B,GACnC,iBAAiB,CAsGnB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-client identity, targeted delivery, and departure lifecycle for a
|
|
3
|
+
* multi-window local desktop host built on `createLocalHostGuard`,
|
|
4
|
+
* `createSocketIOServer`, and `bindRealtimeServer` (→ ADR 0008, ADR 0079, ADR 0303).
|
|
5
|
+
*
|
|
6
|
+
* Strictly peer-free (zero runtime imports of `socket.io`) and runtime-neutral
|
|
7
|
+
* across Bun (`stitchkit/server`) and Node (`stitchkit/node`).
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import type { StitchLogger } from '../internal/logger.js';
|
|
11
|
+
import type { RealtimeEmitArguments, RealtimeEventArguments, RealtimeEventRegistry } from '../realtime/contract.js';
|
|
12
|
+
import type { LocalHostGuard } from './local-host.js';
|
|
13
|
+
import type { RealtimeServer } from './realtime.js';
|
|
14
|
+
import type { SocketIOHandshakeConfig } from './socket-io-config.js';
|
|
15
|
+
/** Default HTTP header carrying a connected window's Socket.IO client id for `callerFromRequest`. */
|
|
16
|
+
export declare const DEFAULT_LOCAL_HOST_CLIENT_ID_HEADER = "x-stitchkit-client";
|
|
17
|
+
/** Immutable identity of one connected local-host client window. */
|
|
18
|
+
export interface HostClient<TLabel> {
|
|
19
|
+
readonly client: string;
|
|
20
|
+
readonly label: TLabel;
|
|
21
|
+
}
|
|
22
|
+
/** Socket handshake identity stored in `socket.data` by `LocalHostClientsSetup.handshake`. */
|
|
23
|
+
export interface LocalHostClientData<TLabel> {
|
|
24
|
+
readonly localHost?: true;
|
|
25
|
+
readonly label: TLabel;
|
|
26
|
+
}
|
|
27
|
+
/** Configuration for {@link createLocalHostClients}. */
|
|
28
|
+
export interface LocalHostClientsConfig<TLabel> {
|
|
29
|
+
/** Zod schema validating the client's self-identifying `label` in the Socket.IO handshake. */
|
|
30
|
+
readonly labelSchema: z.ZodType<TLabel>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional `createLocalHostGuard` whose constant-time secret check and CORS
|
|
33
|
+
* origin allow-list are composed into `handshake`, `cors`, and `callerFromRequest`.
|
|
34
|
+
*/
|
|
35
|
+
readonly guard?: LocalHostGuard;
|
|
36
|
+
/**
|
|
37
|
+
* HTTP header name carrying a connected client's `client` id (read from
|
|
38
|
+
* `realtimeClient.id`). Default `'x-stitchkit-client'`.
|
|
39
|
+
*/
|
|
40
|
+
readonly clientIdHeader?: string;
|
|
41
|
+
/** Maximum concurrently tracked clients before new connections are closed. Default `64`. */
|
|
42
|
+
readonly maxClients?: number;
|
|
43
|
+
/** Invoked when a validated client connects and joins the live registry. */
|
|
44
|
+
readonly onClientConnected?: (caller: HostClient<TLabel>) => void | Promise<void>;
|
|
45
|
+
/** Invoked when any single connected client disconnects (after removal from the registry). */
|
|
46
|
+
readonly onClientGone?: (caller: HostClient<TLabel>) => void | Promise<void>;
|
|
47
|
+
/** Invoked strictly when the last connected client disconnects (`1 → 0`), after `onClientGone`. */
|
|
48
|
+
readonly onLastClientGone?: (lastCaller: HostClient<TLabel>) => void | Promise<void>;
|
|
49
|
+
/** Optional structured logger for isolated hook/handler failures and rejected connections. */
|
|
50
|
+
readonly logger?: StitchLogger;
|
|
51
|
+
}
|
|
52
|
+
/** Attached per-client registry, event router, and targeted sender bound to one `RealtimeServer`. */
|
|
53
|
+
export interface LocalHostClients<TServerToClient extends RealtimeEventRegistry, TClientToServer extends RealtimeEventRegistry, TLabel> {
|
|
54
|
+
/**
|
|
55
|
+
* Register a handler for a `clientToServer` event across every current and
|
|
56
|
+
* future connected client. `caller` is passed first so variadic event
|
|
57
|
+
* arguments and any trailing `ack` callback stay cleanly typed without casts.
|
|
58
|
+
*/
|
|
59
|
+
on<TEvent extends keyof TClientToServer & string>(event: TEvent, handler: (caller: HostClient<TLabel>, ...args: RealtimeEventArguments<TClientToServer[TEvent]>) => void | Promise<void>): () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Emit a `serverToClient` event directly to one connected client's own
|
|
62
|
+
* socket. Returns `false` without emitting when `client` is unknown or gone.
|
|
63
|
+
*/
|
|
64
|
+
sendTo<TEvent extends keyof TServerToClient & string>(client: string, event: TEvent, ...args: RealtimeEmitArguments<TServerToClient[TEvent]>): boolean;
|
|
65
|
+
/** Snapshot of every currently connected client. */
|
|
66
|
+
clients(): readonly HostClient<TLabel>[];
|
|
67
|
+
/** Look up one currently connected client by id. */
|
|
68
|
+
get(client: string): HostClient<TLabel> | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve a connected client from an HTTP request carrying `clientIdHeader`.
|
|
71
|
+
* Fail-closed: when `guard` is configured, requests failing `guard.check()`
|
|
72
|
+
* return `undefined`; unknown or disconnected ids always return `undefined`.
|
|
73
|
+
*
|
|
74
|
+
* Trust boundary: identifies a window among callers that already hold the
|
|
75
|
+
* shared local-host secret; not cryptographically bound to the TCP stream.
|
|
76
|
+
*/
|
|
77
|
+
callerFromRequest(request: Request): HostClient<TLabel> | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Detach from the realtime server and remove all per-socket listeners
|
|
80
|
+
* without firing `onClientGone` or `onLastClientGone`. Idempotent.
|
|
81
|
+
*/
|
|
82
|
+
detach(): void;
|
|
83
|
+
}
|
|
84
|
+
/** Stateless setup returned by {@link createLocalHostClients} before binding a `RealtimeServer`. */
|
|
85
|
+
export interface LocalHostClientsSetup<TLabel> {
|
|
86
|
+
/** Socket.IO `handshake` gate validating `labelSchema` (and `guard.handshake` when provided). */
|
|
87
|
+
readonly handshake: SocketIOHandshakeConfig<unknown, LocalHostClientData<TLabel>>;
|
|
88
|
+
/**
|
|
89
|
+
* CORS config extending `guard.cors` with `clientIdHeader` alongside
|
|
90
|
+
* `DEFAULT_CORS_ALLOW_HEADERS`, or `undefined` when `guard?.cors` is absent.
|
|
91
|
+
*/
|
|
92
|
+
readonly cors: {
|
|
93
|
+
origin: string[];
|
|
94
|
+
credentials: false;
|
|
95
|
+
headers: string;
|
|
96
|
+
} | undefined;
|
|
97
|
+
/** Bind this client registry to one `RealtimeServer`. Refuses a second active `attach()` without `detach()`. */
|
|
98
|
+
attach<TServerToClient extends RealtimeEventRegistry, TClientToServer extends RealtimeEventRegistry>(realtime: RealtimeServer<TServerToClient, TClientToServer, LocalHostClientData<TLabel>>): LocalHostClients<TServerToClient, TClientToServer, TLabel>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create per-client handshake validation, CORS header extension, and a live
|
|
102
|
+
* client registry for a multi-window local desktop host (ADR 0303).
|
|
103
|
+
*/
|
|
104
|
+
export declare function createLocalHostClients<TLabel>(config: LocalHostClientsConfig<TLabel>): LocalHostClientsSetup<TLabel>;
|
|
105
|
+
//# sourceMappingURL=local-host-clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-host-clients.d.ts","sourceRoot":"","sources":["../../src/server/local-host-clients.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;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EAAE,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACrF,gHAAgH;IAChH,MAAM,CACJ,eAAe,SAAS,qBAAqB,EAC7C,eAAe,SAAS,qBAAqB,EAE7C,QAAQ,EAAE,cAAc,CAAC,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,GACtF,gBAAgB,CAAC,eAAe,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;CAC/D;AAyTD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAC3C,MAAM,EAAE,sBAAsB,CAAC,MAAM,CAAC,GACrC,qBAAqB,CAAC,MAAM,CAAC,CA8B/B"}
|
|
@@ -105,6 +105,26 @@ export interface TrustFenceConfig {
|
|
|
105
105
|
* check.
|
|
106
106
|
*/
|
|
107
107
|
readonly trustedOrigins?: readonly string[];
|
|
108
|
+
/**
|
|
109
|
+
* Optional predicate marking safe public read routes that may be requested
|
|
110
|
+
* cross-site on the HTTP lane without triggering `cross-site` or
|
|
111
|
+
* `origin-mismatch` refusals.
|
|
112
|
+
*
|
|
113
|
+
* Applied strictly **after** `trustedHosts` (`missing-host` /
|
|
114
|
+
* `untrusted-host` are never bypassed), **only** on `lane === 'http'`,
|
|
115
|
+
* **only** for exact `'GET'` or `'HEAD'` requests with no `Upgrade` header,
|
|
116
|
+
* and **only** when the request would otherwise be refused for `cross-site`
|
|
117
|
+
* or `origin-mismatch`. The Socket.IO lane (`allowRequest` / `'socket'`),
|
|
118
|
+
* WebSocket upgrades, `OPTIONS`, and every state-changing method never call
|
|
119
|
+
* or honour this predicate.
|
|
120
|
+
*
|
|
121
|
+
* Must be synchronous and return strictly `true` to admit; any thrown error,
|
|
122
|
+
* non-boolean value, or thenable fails closed to the normal 403 refusal and
|
|
123
|
+
* logs an error via `logger.error` (or `console.error`). Note that this only
|
|
124
|
+
* admits safe reads past the trust fence — it does not add CORS headers or
|
|
125
|
+
* exempt `OPTIONS` preflights.
|
|
126
|
+
*/
|
|
127
|
+
readonly publicReads?: (request: Request) => boolean;
|
|
108
128
|
/** Called on every refusal, before the 403 is written. */
|
|
109
129
|
readonly onRefused?: (refusal: TrustRefusal) => void;
|
|
110
130
|
/** Refusals are logged at `warn` when a logger is supplied. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust-fence.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/trust-fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,qCAAqC;AACrC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1C,MAAM,MAAM,kBAAkB;AAC5B,yEAAyE;AACvE,cAAc;AAChB,wEAAwE;GACtE,gBAAgB;AAClB,iEAAiE;GAC/D,iBAAiB;AACnB,4DAA4D;GAC1D,YAAY,CAAC;AAEjB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,M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AiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAM1D;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,CA8KrE"}
|
|
@@ -12,12 +12,17 @@ export interface SpooledSpendStoreConfig {
|
|
|
12
12
|
error: unknown;
|
|
13
13
|
}) => void;
|
|
14
14
|
}
|
|
15
|
-
/** A ledger whose writes reach disk before the database, with `
|
|
15
|
+
/** A ledger whose writes reach disk before the database, with `flush` in-process and `recover` across restarts. */
|
|
16
16
|
export interface SpooledSpendStore extends SpendLedgerStore {
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
18
|
+
* Redeliver undelivered attempts and receipts in this process, preserving per-attempt
|
|
19
|
+
* order and single-flight concurrency alongside live `begin()` / `settle()` calls.
|
|
20
|
+
*/
|
|
21
|
+
flush(): Promise<SpoolRecovery>;
|
|
22
|
+
/**
|
|
23
|
+
* Replay what an earlier process left undelivered on disk, in the order it was written —
|
|
24
|
+
* an attempt before its receipts — stopping a group at its first refusal. Call once at
|
|
25
|
+
* startup, before the gateway is used; use `flush()` for explicit in-process redelivery.
|
|
21
26
|
*/
|
|
22
27
|
recover(): Promise<SpoolRecovery>;
|
|
23
28
|
pending(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt-spool.d.ts","sourceRoot":"","sources":["../../src/spend/receipt-spool.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,KAAK,gBAAgB,EAGtB,MAAM,WAAW,CAAC;AAQnB,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,6EAA6E;IAC7E,KAAK,EAAE,gBAAgB,CAAC;IACxB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAA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