@proofoftech/flowsafe 0.11.0 → 0.12.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 +36 -0
- package/README.md +65 -43
- package/deployment-identity-protocol.d.mts +52 -0
- package/deployment-identity-protocol.mjs +231 -0
- package/dist/agent-host/approval-resumer.d.ts +3 -3
- package/dist/agent-host/approval-resumer.d.ts.map +1 -1
- package/dist/agent-host/approval-resumer.js +6 -7
- package/dist/agent-host/approval-resumer.js.map +1 -1
- package/dist/agent-host/catalog.js +2 -2
- package/dist/agent-host/catalog.js.map +1 -1
- package/dist/agent-host/index.d.ts +2 -2
- package/dist/agent-host/index.d.ts.map +1 -1
- package/dist/agent-host/index.js.map +1 -1
- package/dist/agent-host/router.d.ts +2 -2
- package/dist/agent-host/router.d.ts.map +1 -1
- package/dist/agent-host/router.js +22 -54
- package/dist/agent-host/router.js.map +1 -1
- package/dist/agent-host/thread-host.d.ts +42 -8
- package/dist/agent-host/thread-host.d.ts.map +1 -1
- package/dist/agent-host/thread-host.js +533 -106
- package/dist/agent-host/thread-host.js.map +1 -1
- package/dist/agent-host/thread-topology.d.ts +28 -7
- package/dist/agent-host/thread-topology.d.ts.map +1 -1
- package/dist/agent-host/thread-topology.js +97 -39
- package/dist/agent-host/thread-topology.js.map +1 -1
- package/dist/agent-host/trusted-context.d.ts.map +1 -1
- package/dist/agent-host/trusted-context.js +3 -1
- package/dist/agent-host/trusted-context.js.map +1 -1
- package/dist/agent-host/types.d.ts +2 -0
- package/dist/agent-host/types.d.ts.map +1 -1
- package/dist/agent-runner/agent-run-state.d.ts +9 -8
- package/dist/agent-runner/agent-run-state.d.ts.map +1 -1
- package/dist/agent-runner/agent-run-state.js +78 -40
- package/dist/agent-runner/agent-run-state.js.map +1 -1
- package/dist/agent-runner/durable-agent-runner.d.ts +18 -16
- package/dist/agent-runner/durable-agent-runner.d.ts.map +1 -1
- package/dist/agent-runner/durable-agent-runner.js +120 -43
- package/dist/agent-runner/durable-agent-runner.js.map +1 -1
- package/dist/agent-runner/index.d.ts +1 -1
- package/dist/agent-runner/index.d.ts.map +1 -1
- package/dist/agent-runner/index.js +1 -1
- package/dist/agent-runner/index.js.map +1 -1
- package/dist/approval-api/actor-context.d.ts +67 -0
- package/dist/approval-api/actor-context.d.ts.map +1 -0
- package/dist/approval-api/actor-context.js +120 -0
- package/dist/approval-api/actor-context.js.map +1 -0
- package/dist/approval-api/contract.d.ts +12 -23
- package/dist/approval-api/contract.d.ts.map +1 -1
- package/dist/approval-api/d1-store.d.ts +7 -15
- package/dist/approval-api/d1-store.d.ts.map +1 -1
- package/dist/approval-api/d1-store.js +83 -159
- package/dist/approval-api/d1-store.js.map +1 -1
- package/dist/approval-api/grants.d.ts +3 -17
- package/dist/approval-api/grants.d.ts.map +1 -1
- package/dist/approval-api/grants.js +19 -39
- package/dist/approval-api/grants.js.map +1 -1
- package/dist/approval-api/index.d.ts +8 -8
- package/dist/approval-api/index.d.ts.map +1 -1
- package/dist/approval-api/index.js +5 -5
- package/dist/approval-api/index.js.map +1 -1
- package/dist/approval-api/principal.d.ts +29 -30
- package/dist/approval-api/principal.d.ts.map +1 -1
- package/dist/approval-api/principal.js +73 -54
- package/dist/approval-api/principal.js.map +1 -1
- package/dist/approval-api/resource-ownership.d.ts +64 -0
- package/dist/approval-api/resource-ownership.d.ts.map +1 -0
- package/dist/approval-api/resource-ownership.js +329 -0
- package/dist/approval-api/resource-ownership.js.map +1 -0
- package/dist/approval-api/retention.d.ts +6 -11
- package/dist/approval-api/retention.d.ts.map +1 -1
- package/dist/approval-api/retention.js +7 -12
- package/dist/approval-api/retention.js.map +1 -1
- package/dist/approval-api/router.d.ts +9 -8
- package/dist/approval-api/router.d.ts.map +1 -1
- package/dist/approval-api/router.js +50 -18
- package/dist/approval-api/router.js.map +1 -1
- package/dist/approval-api/service.d.ts +26 -36
- package/dist/approval-api/service.d.ts.map +1 -1
- package/dist/approval-api/service.js +104 -166
- package/dist/approval-api/service.js.map +1 -1
- package/dist/approval-api/store-factory.d.ts +19 -0
- package/dist/approval-api/store-factory.d.ts.map +1 -0
- package/dist/approval-api/store-factory.js +49 -0
- package/dist/approval-api/store-factory.js.map +1 -0
- package/dist/approval-api/store.d.ts +22 -36
- package/dist/approval-api/store.d.ts.map +1 -1
- package/dist/approval-api/store.js +48 -66
- package/dist/approval-api/store.js.map +1 -1
- package/dist/approval-api/types.d.ts +28 -22
- package/dist/approval-api/types.d.ts.map +1 -1
- package/dist/approval-api/types.js +51 -3
- package/dist/approval-api/types.js.map +1 -1
- package/dist/approval-ui/client.js +3 -3
- package/dist/approval-ui/client.js.map +1 -1
- package/dist/approval-ui/stream.d.ts +4 -4
- package/dist/approval-ui/stream.d.ts.map +1 -1
- package/dist/approval-ui/stream.js +2 -2
- package/dist/approval-ui/tips.d.ts +1 -1
- package/dist/approval-ui/tips.js +1 -1
- package/dist/approval-ui/tips.js.map +1 -1
- package/dist/approval-ui/use-approval-dashboard.d.ts +3 -3
- package/dist/approval-ui/use-approval-dashboard.js +1 -1
- package/dist/artifacts/index.d.ts +2 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +9 -8
- package/dist/artifacts/index.js.map +1 -1
- package/dist/audit-export/audit-proxy.d.ts +71 -0
- package/dist/audit-export/audit-proxy.d.ts.map +1 -0
- package/dist/audit-export/audit-proxy.js +142 -0
- package/dist/audit-export/audit-proxy.js.map +1 -0
- package/dist/audit-export/index.d.ts +4 -7
- package/dist/audit-export/index.d.ts.map +1 -1
- package/dist/audit-export/index.js +1 -4
- package/dist/audit-export/index.js.map +1 -1
- package/dist/audit-export/queue-types.d.ts +5 -0
- package/dist/audit-export/queue-types.d.ts.map +1 -0
- package/dist/audit-export/queue-types.js +3 -0
- package/dist/audit-export/queue-types.js.map +1 -0
- package/dist/background-tasks/d1-storage.d.ts +9 -19
- package/dist/background-tasks/d1-storage.d.ts.map +1 -1
- package/dist/background-tasks/d1-storage.js +22 -52
- package/dist/background-tasks/d1-storage.js.map +1 -1
- package/dist/background-tasks/host.d.ts +4 -6
- package/dist/background-tasks/host.d.ts.map +1 -1
- package/dist/background-tasks/host.js +14 -17
- package/dist/background-tasks/host.js.map +1 -1
- package/dist/background-tasks/index.d.ts +1 -1
- package/dist/background-tasks/index.d.ts.map +1 -1
- package/dist/background-tasks/index.js +3 -3
- package/dist/background-tasks/index.js.map +1 -1
- package/dist/background-tasks/routes.d.ts +8 -4
- package/dist/background-tasks/routes.d.ts.map +1 -1
- package/dist/background-tasks/routes.js +33 -31
- package/dist/background-tasks/routes.js.map +1 -1
- package/dist/deployment-identity-protocol.d.ts +3 -0
- package/dist/deployment-identity-protocol.d.ts.map +1 -0
- package/dist/deployment-identity-protocol.js +3 -0
- package/dist/deployment-identity-protocol.js.map +1 -0
- package/dist/do-runner/breakwater-keys.d.ts +7 -5
- package/dist/do-runner/breakwater-keys.d.ts.map +1 -1
- package/dist/do-runner/breakwater-keys.js +7 -5
- package/dist/do-runner/breakwater-keys.js.map +1 -1
- package/dist/do-runner/cf-types.d.ts +18 -12
- package/dist/do-runner/cf-types.d.ts.map +1 -1
- package/dist/do-runner/cf-types.js.map +1 -1
- package/dist/do-runner/d1-storage.d.ts +44 -182
- package/dist/do-runner/d1-storage.d.ts.map +1 -1
- package/dist/do-runner/d1-storage.js +102 -353
- package/dist/do-runner/d1-storage.js.map +1 -1
- package/dist/do-runner/deployment-identity.d.ts +121 -0
- package/dist/do-runner/deployment-identity.d.ts.map +1 -0
- package/dist/do-runner/deployment-identity.js +272 -0
- package/dist/do-runner/deployment-identity.js.map +1 -0
- package/dist/do-runner/do-error-response.d.ts +1 -1
- package/dist/do-runner/do-error-response.d.ts.map +1 -1
- package/dist/do-runner/do-error-response.js +7 -1
- package/dist/do-runner/do-error-response.js.map +1 -1
- package/dist/do-runner/durable-object.d.ts +23 -16
- package/dist/do-runner/durable-object.d.ts.map +1 -1
- package/dist/do-runner/durable-object.js +303 -70
- package/dist/do-runner/durable-object.js.map +1 -1
- package/dist/do-runner/execution-context.d.ts +1 -0
- package/dist/do-runner/execution-context.d.ts.map +1 -1
- package/dist/do-runner/execution-context.js +4 -7
- package/dist/do-runner/execution-context.js.map +1 -1
- package/dist/do-runner/execution-principal-header.d.ts +16 -0
- package/dist/do-runner/execution-principal-header.d.ts.map +1 -0
- package/dist/do-runner/execution-principal-header.js +20 -0
- package/dist/do-runner/execution-principal-header.js.map +1 -0
- package/dist/do-runner/hub-do.d.ts +17 -25
- package/dist/do-runner/hub-do.d.ts.map +1 -1
- package/dist/do-runner/hub-do.js +63 -59
- package/dist/do-runner/hub-do.js.map +1 -1
- package/dist/do-runner/index.d.ts +12 -10
- package/dist/do-runner/index.d.ts.map +1 -1
- package/dist/do-runner/index.js +10 -9
- package/dist/do-runner/index.js.map +1 -1
- package/dist/do-runner/init.d.ts +0 -7
- package/dist/do-runner/init.d.ts.map +1 -1
- package/dist/do-runner/init.js +1 -2
- package/dist/do-runner/init.js.map +1 -1
- package/dist/do-runner/memory-id.d.ts +8 -25
- package/dist/do-runner/memory-id.d.ts.map +1 -1
- package/dist/do-runner/memory-id.js +25 -52
- package/dist/do-runner/memory-id.js.map +1 -1
- package/dist/do-runner/path-safe-id.d.ts +2 -48
- package/dist/do-runner/path-safe-id.d.ts.map +1 -1
- package/dist/do-runner/path-safe-id.js +3 -93
- package/dist/do-runner/path-safe-id.js.map +1 -1
- package/dist/do-runner/pubsub.d.ts +1 -1
- package/dist/do-runner/pubsub.js +1 -1
- package/dist/do-runner/runtime.d.ts +47 -34
- package/dist/do-runner/runtime.d.ts.map +1 -1
- package/dist/do-runner/runtime.js +281 -143
- package/dist/do-runner/runtime.js.map +1 -1
- package/dist/do-runner/schedule-source.d.ts +81 -0
- package/dist/do-runner/schedule-source.d.ts.map +1 -0
- package/dist/do-runner/schedule-source.js +64 -0
- package/dist/do-runner/schedule-source.js.map +1 -0
- package/dist/do-runner/thread-do.d.ts +18 -32
- package/dist/do-runner/thread-do.d.ts.map +1 -1
- package/dist/do-runner/thread-do.js +52 -74
- package/dist/do-runner/thread-do.js.map +1 -1
- package/dist/goals/objective-routes.d.ts +7 -4
- package/dist/goals/objective-routes.d.ts.map +1 -1
- package/dist/goals/objective-routes.js +58 -43
- package/dist/goals/objective-routes.js.map +1 -1
- package/dist/host-kit/approval-bridge.d.ts +18 -21
- package/dist/host-kit/approval-bridge.d.ts.map +1 -1
- package/dist/host-kit/approval-bridge.js +37 -37
- package/dist/host-kit/approval-bridge.js.map +1 -1
- package/dist/host-kit/bearer-auth.d.ts +3 -4
- package/dist/host-kit/bearer-auth.d.ts.map +1 -1
- package/dist/host-kit/bearer-auth.js +7 -11
- package/dist/host-kit/bearer-auth.js.map +1 -1
- package/dist/host-kit/do-run-topology.d.ts +14 -5
- package/dist/host-kit/do-run-topology.d.ts.map +1 -1
- package/dist/host-kit/do-run-topology.js +47 -15
- package/dist/host-kit/do-run-topology.js.map +1 -1
- package/dist/host-kit/env-vars.d.ts +1 -1
- package/dist/host-kit/env-vars.js +1 -1
- package/dist/host-kit/flowsafe-worker.d.ts +149 -73
- package/dist/host-kit/flowsafe-worker.d.ts.map +1 -1
- package/dist/host-kit/flowsafe-worker.js +619 -141
- package/dist/host-kit/flowsafe-worker.js.map +1 -1
- package/dist/host-kit/host-approval-service.d.ts +62 -54
- package/dist/host-kit/host-approval-service.d.ts.map +1 -1
- package/dist/host-kit/host-approval-service.js +90 -61
- package/dist/host-kit/host-approval-service.js.map +1 -1
- package/dist/host-kit/hub-topology.d.ts +6 -7
- package/dist/host-kit/hub-topology.d.ts.map +1 -1
- package/dist/host-kit/hub-topology.js +16 -12
- package/dist/host-kit/hub-topology.js.map +1 -1
- package/dist/host-kit/index.d.ts +13 -11
- package/dist/host-kit/index.d.ts.map +1 -1
- package/dist/host-kit/index.js +9 -12
- package/dist/host-kit/index.js.map +1 -1
- package/dist/host-kit/maintenance-capability.d.ts +58 -0
- package/dist/host-kit/maintenance-capability.d.ts.map +1 -0
- package/dist/host-kit/maintenance-capability.js +268 -0
- package/dist/host-kit/maintenance-capability.js.map +1 -0
- package/dist/host-kit/memory-boundary.d.ts +4 -19
- package/dist/host-kit/memory-boundary.d.ts.map +1 -1
- package/dist/host-kit/memory-boundary.js +12 -27
- package/dist/host-kit/memory-boundary.js.map +1 -1
- package/dist/host-kit/resource-access.d.ts +4 -0
- package/dist/host-kit/resource-access.d.ts.map +1 -0
- package/dist/host-kit/resource-access.js +12 -0
- package/dist/host-kit/resource-access.js.map +1 -0
- package/dist/host-kit/run-router.d.ts +25 -15
- package/dist/host-kit/run-router.d.ts.map +1 -1
- package/dist/host-kit/run-router.js +61 -46
- package/dist/host-kit/run-router.js.map +1 -1
- package/dist/host-kit/state-egress.d.ts +51 -0
- package/dist/host-kit/state-egress.d.ts.map +1 -0
- package/dist/host-kit/state-egress.js +120 -0
- package/dist/host-kit/state-egress.js.map +1 -0
- package/dist/host-kit/stream-router.d.ts +9 -4
- package/dist/host-kit/stream-router.d.ts.map +1 -1
- package/dist/host-kit/stream-router.js +45 -38
- package/dist/host-kit/stream-router.js.map +1 -1
- package/dist/host-kit/stream-ticket.d.ts +10 -10
- package/dist/host-kit/stream-ticket.d.ts.map +1 -1
- package/dist/host-kit/stream-ticket.js +60 -90
- package/dist/host-kit/stream-ticket.js.map +1 -1
- package/dist/host-kit/thread-topology.d.ts +17 -11
- package/dist/host-kit/thread-topology.d.ts.map +1 -1
- package/dist/host-kit/thread-topology.js +33 -59
- package/dist/host-kit/thread-topology.js.map +1 -1
- package/dist/host-kit/verifier.d.ts +6 -6
- package/dist/host-kit/verifier.d.ts.map +1 -1
- package/dist/host-kit/verifier.js +51 -119
- package/dist/host-kit/verifier.js.map +1 -1
- package/dist/http-body.d.ts +20 -0
- package/dist/http-body.d.ts.map +1 -0
- package/dist/http-body.js +67 -0
- package/dist/http-body.js.map +1 -0
- package/dist/schedules/index.d.ts +3 -2
- package/dist/schedules/index.d.ts.map +1 -1
- package/dist/schedules/index.js +5 -4
- package/dist/schedules/index.js.map +1 -1
- package/dist/schedules/router.d.ts +16 -10
- package/dist/schedules/router.d.ts.map +1 -1
- package/dist/schedules/router.js +153 -91
- package/dist/schedules/router.js.map +1 -1
- package/dist/schedules/schedules-d1.d.ts +88 -0
- package/dist/schedules/schedules-d1.d.ts.map +1 -1
- package/dist/schedules/schedules-d1.js +411 -50
- package/dist/schedules/schedules-d1.js.map +1 -1
- package/dist/schedules/target-policy.d.ts +29 -0
- package/dist/schedules/target-policy.d.ts.map +1 -0
- package/dist/schedules/target-policy.js +70 -0
- package/dist/schedules/target-policy.js.map +1 -0
- package/dist/schedules/tick.d.ts +125 -21
- package/dist/schedules/tick.d.ts.map +1 -1
- package/dist/schedules/tick.js +637 -160
- package/dist/schedules/tick.js.map +1 -1
- package/dist/signal-providers/delivery.d.ts +0 -19
- package/dist/signal-providers/delivery.d.ts.map +1 -1
- package/dist/signal-providers/delivery.js +5 -54
- package/dist/signal-providers/delivery.js.map +1 -1
- package/dist/signal-providers/github-provider.d.ts.map +1 -1
- package/dist/signal-providers/github-provider.js +9 -16
- package/dist/signal-providers/github-provider.js.map +1 -1
- package/dist/signal-providers/host-do.d.ts +3 -45
- package/dist/signal-providers/host-do.d.ts.map +1 -1
- package/dist/signal-providers/host-do.js +86 -106
- package/dist/signal-providers/host-do.js.map +1 -1
- package/dist/signal-providers/host-topology.d.ts +5 -14
- package/dist/signal-providers/host-topology.d.ts.map +1 -1
- package/dist/signal-providers/host-topology.js +11 -25
- package/dist/signal-providers/host-topology.js.map +1 -1
- package/dist/signal-providers/index.d.ts +3 -3
- package/dist/signal-providers/index.d.ts.map +1 -1
- package/dist/signal-providers/index.js +3 -3
- package/dist/signal-providers/index.js.map +1 -1
- package/dist/signal-providers/provider.d.ts +4 -5
- package/dist/signal-providers/provider.d.ts.map +1 -1
- package/dist/signal-providers/provider.js +5 -6
- package/dist/signal-providers/provider.js.map +1 -1
- package/dist/signal-providers/subscription-d1.d.ts +10 -57
- package/dist/signal-providers/subscription-d1.d.ts.map +1 -1
- package/dist/signal-providers/subscription-d1.js +208 -155
- package/dist/signal-providers/subscription-d1.js.map +1 -1
- package/dist/signal-providers/webhook-route.d.ts +28 -14
- package/dist/signal-providers/webhook-route.d.ts.map +1 -1
- package/dist/signal-providers/webhook-route.js +117 -88
- package/dist/signal-providers/webhook-route.js.map +1 -1
- package/dist/signals/client.js +8 -8
- package/dist/signals/client.js.map +1 -1
- package/dist/signals/d1-shared.js +1 -1
- package/dist/signals/d1-shared.js.map +1 -1
- package/dist/signals/index.d.ts +1 -1
- package/dist/signals/index.d.ts.map +1 -1
- package/dist/signals/index.js.map +1 -1
- package/dist/signals/notification-dispatch.d.ts +12 -6
- package/dist/signals/notification-dispatch.d.ts.map +1 -1
- package/dist/signals/notification-dispatch.js +37 -21
- package/dist/signals/notification-dispatch.js.map +1 -1
- package/dist/signals/notifications-d1.d.ts +5 -8
- package/dist/signals/notifications-d1.d.ts.map +1 -1
- package/dist/signals/notifications-d1.js +8 -13
- package/dist/signals/notifications-d1.js.map +1 -1
- package/dist/signals/router.d.ts +10 -10
- package/dist/signals/router.d.ts.map +1 -1
- package/dist/signals/router.js +49 -51
- package/dist/signals/router.js.map +1 -1
- package/dist/signals/thread-do-routes.d.ts +74 -15
- package/dist/signals/thread-do-routes.d.ts.map +1 -1
- package/dist/signals/thread-do-routes.js +484 -41
- package/dist/signals/thread-do-routes.js.map +1 -1
- package/dist/signals/thread-state-d1.d.ts.map +1 -1
- package/dist/signals/thread-state-d1.js +2 -3
- package/dist/signals/thread-state-d1.js.map +1 -1
- package/package.json +29 -6
- package/scripts/seed-deployment-identity.mjs +252 -0
- package/dist/approval-api/tenant-brand.d.ts +0 -35
- package/dist/approval-api/tenant-brand.d.ts.map +0 -1
- package/dist/approval-api/tenant-brand.js +0 -19
- package/dist/approval-api/tenant-brand.js.map +0 -1
- package/dist/approval-api/tenant-context.d.ts +0 -84
- package/dist/approval-api/tenant-context.d.ts.map +0 -1
- package/dist/approval-api/tenant-context.js +0 -112
- package/dist/approval-api/tenant-context.js.map +0 -1
- package/dist/approval-api/tenant-store.d.ts +0 -36
- package/dist/approval-api/tenant-store.d.ts.map +0 -1
- package/dist/approval-api/tenant-store.js +0 -129
- package/dist/approval-api/tenant-store.js.map +0 -1
- package/dist/do-runner/resume-ledger.d.ts +0 -48
- package/dist/do-runner/resume-ledger.d.ts.map +0 -1
- package/dist/do-runner/resume-ledger.js +0 -60
- package/dist/do-runner/resume-ledger.js.map +0 -1
- package/dist/do-runner/thread-header.d.ts +0 -31
- package/dist/do-runner/thread-header.d.ts.map +0 -1
- package/dist/do-runner/thread-header.js +0 -39
- package/dist/do-runner/thread-header.js.map +0 -1
- package/dist/host-kit/subdomain-check.d.ts +0 -23
- package/dist/host-kit/subdomain-check.d.ts.map +0 -1
- package/dist/host-kit/subdomain-check.js +0 -61
- package/dist/host-kit/subdomain-check.js.map +0 -1
- package/dist/host-kit/tenant-registry.d.ts +0 -51
- package/dist/host-kit/tenant-registry.d.ts.map +0 -1
- package/dist/host-kit/tenant-registry.js +0 -88
- package/dist/host-kit/tenant-registry.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CreateBackgroundTaskD1DomainsOptions, PurgeExpiredBackgroundTasksOptions, PurgeExpiredBackgroundTasksResult, } from './d1-storage.js';
|
|
2
|
-
export { BACKGROUND_TASK_TTL_PURGE_TABLES, backgroundTasksStore, createBackgroundTaskD1Domains,
|
|
2
|
+
export { BACKGROUND_TASK_TTL_PURGE_TABLES, backgroundTasksStore, createBackgroundTaskD1Domains, DURABLE_OBJECT_BACKGROUND_TASKS_D1, DurableObjectBackgroundTasksStorageD1, DurableObjectWorkflowsStorageD1, purgeExpiredBackgroundTasks, SERIALIZED_WORKFLOWS_D1, } from './d1-storage.js';
|
|
3
3
|
export type { BackgroundTaskHostOptions } from './host.js';
|
|
4
4
|
export { BackgroundTaskHost } from './host.js';
|
|
5
5
|
export type { BackgroundTaskRouter, BackgroundTaskRoutesOptions, } from './routes.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/background-tasks/index.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,oCAAoC,EACpC,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gCAAgC,EAChC,oBAAoB,EACpB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/background-tasks/index.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,oCAAoC,EACpC,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gCAAgC,EAChC,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,qCAAqC,EACrC,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EACV,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// Track B (M-003) — background tasks. Subpath-only (`@proofoftech/flowsafe/
|
|
3
3
|
// background-tasks`), like agent-runner: host-side wiring a consumer opts into,
|
|
4
|
-
// not part of the root barrel. The
|
|
5
|
-
//
|
|
4
|
+
// not part of the root barrel. The completedAt TTL cleanup lives in do-runner
|
|
5
|
+
// (coupled there to the schema guard) and is
|
|
6
6
|
// re-exported here for a single import surface.
|
|
7
|
-
export { BACKGROUND_TASK_TTL_PURGE_TABLES, backgroundTasksStore, createBackgroundTaskD1Domains,
|
|
7
|
+
export { BACKGROUND_TASK_TTL_PURGE_TABLES, backgroundTasksStore, createBackgroundTaskD1Domains, DURABLE_OBJECT_BACKGROUND_TASKS_D1, DurableObjectBackgroundTasksStorageD1, DurableObjectWorkflowsStorageD1, purgeExpiredBackgroundTasks, SERIALIZED_WORKFLOWS_D1, } from './d1-storage.js';
|
|
8
8
|
export { BackgroundTaskHost } from './host.js';
|
|
9
9
|
export { createBackgroundTaskRoutes } from './routes.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/background-tasks/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAC5E,gFAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/background-tasks/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,6CAA6C;AAC7C,gDAAgD;AAOhD,OAAO,EACL,gCAAgC,EAChC,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,qCAAqC,EACrC,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAK/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -2,14 +2,18 @@ import type { BackgroundTaskManager } from '@mastra/core/background-tasks';
|
|
|
2
2
|
export interface BackgroundTaskRoutesOptions {
|
|
3
3
|
/** The manager to read through — WRAPPED, never exposed over the wire. */
|
|
4
4
|
manager: BackgroundTaskManager;
|
|
5
|
+
/** Host-owned authorization for the run/thread scope of every returned row. */
|
|
6
|
+
authorize(scope: {
|
|
7
|
+
runId?: string;
|
|
8
|
+
threadId?: string;
|
|
9
|
+
}): Promise<boolean>;
|
|
5
10
|
/** Route prefix. Default '/background-tasks'. */
|
|
6
11
|
basePath?: string;
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
9
|
-
* A router `(request
|
|
10
|
-
*
|
|
11
|
-
* tenant — never read from the request.
|
|
14
|
+
* A router `(request) => Response | null`. `null` means the path is not one of
|
|
15
|
+
* ours (the DO falls through).
|
|
12
16
|
*/
|
|
13
|
-
export type BackgroundTaskRouter = (request: Request
|
|
17
|
+
export type BackgroundTaskRouter = (request: Request) => Promise<Response | null>;
|
|
14
18
|
export declare function createBackgroundTaskRoutes(options: BackgroundTaskRoutesOptions): BackgroundTaskRouter;
|
|
15
19
|
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/background-tasks/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/background-tasks/routes.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,+BAA+B,CAAC;AAKvC,MAAM,WAAW,2BAA2B;IAC1C,0EAA0E;IAC1E,OAAO,EAAE,qBAAqB,CAAC;IAC/B,+EAA+E;IAC/E,SAAS,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1E,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AAmD9B,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,oBAAoB,CAgEtB"}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// Track B (M-003): the
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// cross-tenant existence/content oracle. So this router:
|
|
7
|
-
// - REQUIRES a `runId` or `threadId` filter on list AND stream, and validates
|
|
8
|
-
// its salted prefix against the authenticated tenant (400 if absent, 404 if
|
|
9
|
-
// foreign — no oracle);
|
|
10
|
-
// - loads a task for `getTask` and 404s if its `runId` is not tenant-owned,
|
|
11
|
-
// whether the task is missing or another tenant's (one response, no oracle);
|
|
2
|
+
// Track B (M-003): the read-only HTTP surface over background tasks (DL-014).
|
|
3
|
+
// Core's `listTasks` / `getTask` / `stream` are not run-bound, so this router:
|
|
4
|
+
// - requires a path-safe `runId` or `threadId` filter on list and stream;
|
|
5
|
+
// - loads a task for `getTask` and 404s when missing;
|
|
12
6
|
// - never returns or accepts the raw BackgroundTaskManager.
|
|
13
|
-
//
|
|
14
|
-
// The hosting DO passes the already-authenticated tenant (its own idFromName
|
|
15
|
-
// identity), exactly as the run/thread DOs recover theirs. Mutating the queue
|
|
7
|
+
// Mutating the queue
|
|
16
8
|
// (dispatch/cancel/resume) is NOT here: v1 keeps background dispatch server-side
|
|
17
9
|
// (an agent's tool call), and a suspended non-gated task's resume, if ever
|
|
18
10
|
// exposed, is a separate role-gated route that mints no capability (P8).
|
|
19
|
-
import {
|
|
11
|
+
import { isPathSafeId } from '../do-runner/index.js';
|
|
20
12
|
import { safeDecodeSegment } from '../host-kit/route-path.js';
|
|
21
13
|
function json(payload, status = 200) {
|
|
22
14
|
return new Response(JSON.stringify(payload), {
|
|
@@ -25,21 +17,19 @@ function json(payload, status = 200) {
|
|
|
25
17
|
});
|
|
26
18
|
}
|
|
27
19
|
/**
|
|
28
|
-
* Resolve the
|
|
29
|
-
*
|
|
30
|
-
* `tenantOwnsSaltedId` is exact for either. Absent means 400; foreign means
|
|
31
|
-
* 404 (no oracle — a foreign id gets the same answer as a nonexistent one).
|
|
20
|
+
* Resolve the run/thread filter from the query, or a fail-closed Response.
|
|
21
|
+
* Absent means 400; malformed means 404.
|
|
32
22
|
*/
|
|
33
|
-
function resolveScopedFilter(url
|
|
23
|
+
function resolveScopedFilter(url) {
|
|
34
24
|
const runId = url.searchParams.get('runId') ?? undefined;
|
|
35
25
|
const threadId = url.searchParams.get('threadId') ?? undefined;
|
|
36
26
|
if (runId === undefined && threadId === undefined) {
|
|
37
27
|
return json({
|
|
38
|
-
error: 'a runId or threadId filter is required (background-task queries are
|
|
28
|
+
error: 'a runId or threadId filter is required (background-task queries are run-scoped)',
|
|
39
29
|
}, 400);
|
|
40
30
|
}
|
|
41
31
|
const scopeValue = runId ?? threadId;
|
|
42
|
-
if (!
|
|
32
|
+
if (!isPathSafeId(scopeValue)) {
|
|
43
33
|
return json({ error: 'not found' }, 404);
|
|
44
34
|
}
|
|
45
35
|
return {
|
|
@@ -49,7 +39,7 @@ function resolveScopedFilter(url, tenantId) {
|
|
|
49
39
|
}
|
|
50
40
|
/**
|
|
51
41
|
* The scope-ownership predicate shared by list and stream: a row is in
|
|
52
|
-
* scope iff its runId or threadId equals the validated
|
|
42
|
+
* scope iff its runId or threadId equals the validated scope value
|
|
53
43
|
* the request was filtered by. Defense-in-depth OVER core's own filter — a future
|
|
54
44
|
* regression in core's `listTasks`/`stream` scoping cannot leak a foreign or
|
|
55
45
|
* out-of-scope row past this. One predicate so list and stream can never drift.
|
|
@@ -60,21 +50,24 @@ function ownsScope(row, scopeValue) {
|
|
|
60
50
|
export function createBackgroundTaskRoutes(options) {
|
|
61
51
|
const { manager } = options;
|
|
62
52
|
const base = options.basePath ?? '/background-tasks';
|
|
63
|
-
return async (request
|
|
53
|
+
return async (request) => {
|
|
64
54
|
if (request.method !== 'GET')
|
|
65
55
|
return null;
|
|
66
56
|
const url = new URL(request.url);
|
|
67
57
|
const path = url.pathname;
|
|
68
58
|
if (path !== base && !path.startsWith(`${base}/`))
|
|
69
59
|
return null;
|
|
70
|
-
// GET {base}/stream — SSE of lifecycle events for one
|
|
60
|
+
// GET {base}/stream — SSE of lifecycle events for one run/thread.
|
|
71
61
|
if (path === `${base}/stream`) {
|
|
72
|
-
const resolved = resolveScopedFilter(url
|
|
62
|
+
const resolved = resolveScopedFilter(url);
|
|
73
63
|
if (resolved instanceof Response)
|
|
74
64
|
return resolved;
|
|
65
|
+
if (!(await options.authorize(resolved.filter))) {
|
|
66
|
+
return json({ error: 'not found' }, 404);
|
|
67
|
+
}
|
|
75
68
|
return streamResponse(manager, resolved, request.signal);
|
|
76
69
|
}
|
|
77
|
-
// GET {base}/task/:taskId — one task, 404
|
|
70
|
+
// GET {base}/task/:taskId — one task, 404 when missing.
|
|
78
71
|
if (path.startsWith(`${base}/task/`)) {
|
|
79
72
|
// Malformed percent-encoding in the taskId is not a real task — 404 (the
|
|
80
73
|
// no-oracle response), never a decodeURIComponent throw out of the DO
|
|
@@ -83,16 +76,25 @@ export function createBackgroundTaskRoutes(options) {
|
|
|
83
76
|
if (taskId === undefined || taskId === '' || taskId.includes('/'))
|
|
84
77
|
return json({ error: 'not found' }, 404);
|
|
85
78
|
const task = await manager.getTask(taskId);
|
|
86
|
-
if (!task
|
|
79
|
+
if (!task) {
|
|
80
|
+
return json({ error: 'not found' }, 404);
|
|
81
|
+
}
|
|
82
|
+
if (!(await options.authorize({
|
|
83
|
+
runId: task.runId,
|
|
84
|
+
...(task.threadId !== undefined ? { threadId: task.threadId } : {}),
|
|
85
|
+
}))) {
|
|
87
86
|
return json({ error: 'not found' }, 404);
|
|
88
87
|
}
|
|
89
88
|
return json({ task });
|
|
90
89
|
}
|
|
91
|
-
// GET {base} — list, filtered to one
|
|
90
|
+
// GET {base} — list, filtered to one run/thread.
|
|
92
91
|
if (path === base) {
|
|
93
|
-
const resolved = resolveScopedFilter(url
|
|
92
|
+
const resolved = resolveScopedFilter(url);
|
|
94
93
|
if (resolved instanceof Response)
|
|
95
94
|
return resolved;
|
|
95
|
+
if (!(await options.authorize(resolved.filter))) {
|
|
96
|
+
return json({ error: 'not found' }, 404);
|
|
97
|
+
}
|
|
96
98
|
const result = await manager.listTasks(resolved.filter);
|
|
97
99
|
// Per-row parity with the stream guard (DL-014): re-check every returned
|
|
98
100
|
// row against the requested scope, so a future regression in core's
|
|
@@ -110,8 +112,8 @@ export function createBackgroundTaskRoutes(options) {
|
|
|
110
112
|
* Response. The stream is passed the validated filter so core scopes both its
|
|
111
113
|
* on-connect snapshot and its live events; a second exact-match guard in the
|
|
112
114
|
* transform drops any chunk whose runId/threadId is not the requested one, so a
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
+
* out-of-scope leak is blocked even if core's filter ever loosened. This is
|
|
116
|
+
* defense in depth. `abortSignal` is the request's own, so a client
|
|
115
117
|
* disconnect closes the upstream subscription.
|
|
116
118
|
*/
|
|
117
119
|
function streamResponse(manager, scoped, abortSignal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/background-tasks/routes.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/background-tasks/routes.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,wDAAwD;AACxD,8DAA8D;AAC9D,qBAAqB;AACrB,iFAAiF;AACjF,2EAA2E;AAC3E,yEAAyE;AAOzE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAmB9D,SAAS,IAAI,CAAC,OAAgB,EAAE,MAAM,GAAG,GAAG;IAC1C,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QAC3C,MAAM;QACN,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAC1B,GAAQ;IAER,MAAM,KAAK,GAAG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,CACrB,OAA8B,EAC9B,MAAkD,EAClD,WAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACtC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,IAAI,eAAe,CAAsC;QACvD,SAAS,CAAC,KAAK,EAAE,UAAU;YACzB,yEAAyE;YACzE,0EAA0E;YAC1E,MAAM,OAAO,GACX,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;gBACjC,KAAK,CAAC,OAAO,KAAK,IAAI;gBACtB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;gBAC3B,CAAC,CAAE,KAAK,CAAC,OAAmC;gBAC5C,CAAC,CAAC,SAAS,CAAC;YAChB,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC;gBAAE,OAAO;YACxD,UAAU,CAAC,OAAO,CAChB,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CACrD,CAAC;QACJ,CAAC;KACF,CAAC,CACH,CAAC;IACF,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;QAC3B,MAAM,EAAE,GAAG;QACX,OAAO,EAAE;YACP,cAAc,EAAE,mBAAmB;YACnC,eAAe,EAAE,UAAU;YAC3B,UAAU,EAAE,YAAY;SACzB;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { DeploymentIdentityProtocolExecutor, DeploymentIdentityProtocolRow, DeploymentIdentityProtocolStatement, } from '#deployment-identity-protocol';
|
|
2
|
+
export { assertValidDeploymentTag, DEPLOYMENT_ENVIRONMENT_PATTERN, DEPLOYMENT_SENTINEL_COLUMNS, DEPLOYMENT_SENTINEL_DDL, DEPLOYMENT_SENTINEL_TABLE, DEPLOYMENT_TAG_PATTERN, DeploymentIdentityError, deploymentIdentityApplicationTables, isDeploymentEnvironment, normalizeDeploymentSentinelSql, provisionDeploymentIdentityProtocol, readDeploymentIdentityProtocol, } from '#deployment-identity-protocol';
|
|
3
|
+
//# sourceMappingURL=deployment-identity-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-identity-protocol.d.ts","sourceRoot":"","sources":["../src/deployment-identity-protocol.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,kCAAkC,EAClC,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,mCAAmC,EACnC,uBAAuB,EACvB,8BAA8B,EAC9B,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
export { assertValidDeploymentTag, DEPLOYMENT_ENVIRONMENT_PATTERN, DEPLOYMENT_SENTINEL_COLUMNS, DEPLOYMENT_SENTINEL_DDL, DEPLOYMENT_SENTINEL_TABLE, DEPLOYMENT_TAG_PATTERN, DeploymentIdentityError, deploymentIdentityApplicationTables, isDeploymentEnvironment, normalizeDeploymentSentinelSql, provisionDeploymentIdentityProtocol, readDeploymentIdentityProtocol, } from '#deployment-identity-protocol';
|
|
3
|
+
//# sourceMappingURL=deployment-identity-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-identity-protocol.js","sourceRoot":"","sources":["../src/deployment-identity-protocol.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAOtC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,mCAAmC,EACnC,uBAAuB,EACvB,8BAA8B,EAC9B,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,+BAA+B,CAAC"}
|
|
@@ -20,11 +20,13 @@ export declare const BREAKWATER_PRINCIPAL_PERMISSIONS_KEY = "breakwater.principa
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const BREAKWATER_WORKFLOW_SCOPE_KEY = "breakwater.workflowScope";
|
|
22
22
|
/**
|
|
23
|
-
* requestContext key breakwater's
|
|
24
|
-
* key-scoping read: the caller's OPAQUE isolation scope.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* requestContext key breakwater's isolation-scope evaluator and connector
|
|
24
|
+
* key-scoping read: the caller's OPAQUE isolation scope. flowsafe no longer
|
|
25
|
+
* mints it (a deployment serves one organization, so connector idempotency
|
|
26
|
+
* and rate-limit keys are deployment-wide by construction), but the key stays
|
|
27
|
+
* RESERVED: RunnerRuntime drops it from provider values so nothing can mint a
|
|
28
|
+
* scope that desyncs from the execution identity, and the shared
|
|
29
|
+
* execution-context boundary refuses it from external input.
|
|
28
30
|
*/
|
|
29
31
|
export declare const BREAKWATER_ISOLATION_SCOPE_KEY = "breakwater.isolationScope";
|
|
30
32
|
//# sourceMappingURL=breakwater-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakwater-keys.d.ts","sourceRoot":"","sources":["../../src/do-runner/breakwater-keys.ts"],"names":[],"mappings":"AAiBA,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,kCACd,CAAC;AAElC,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,oCACd,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"breakwater-keys.d.ts","sourceRoot":"","sources":["../../src/do-runner/breakwater-keys.ts"],"names":[],"mappings":"AAiBA,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,kCACd,CAAC;AAElC,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,oCACd,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,8BAA8B,CAAC"}
|
|
@@ -36,11 +36,13 @@ export const BREAKWATER_PRINCIPAL_PERMISSIONS_KEY = 'breakwater.principalPermiss
|
|
|
36
36
|
*/
|
|
37
37
|
export const BREAKWATER_WORKFLOW_SCOPE_KEY = 'breakwater.workflowScope';
|
|
38
38
|
/**
|
|
39
|
-
* requestContext key breakwater's
|
|
40
|
-
* key-scoping read: the caller's OPAQUE isolation scope.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
39
|
+
* requestContext key breakwater's isolation-scope evaluator and connector
|
|
40
|
+
* key-scoping read: the caller's OPAQUE isolation scope. flowsafe no longer
|
|
41
|
+
* mints it (a deployment serves one organization, so connector idempotency
|
|
42
|
+
* and rate-limit keys are deployment-wide by construction), but the key stays
|
|
43
|
+
* RESERVED: RunnerRuntime drops it from provider values so nothing can mint a
|
|
44
|
+
* scope that desyncs from the execution identity, and the shared
|
|
45
|
+
* execution-context boundary refuses it from external input.
|
|
44
46
|
*/
|
|
45
47
|
export const BREAKWATER_ISOLATION_SCOPE_KEY = 'breakwater.isolationScope';
|
|
46
48
|
//# sourceMappingURL=breakwater-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakwater-keys.js","sourceRoot":"","sources":["../../src/do-runner/breakwater-keys.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,qDAAqD;AACrD,EAAE;AACF,4EAA4E;AAC5E,2DAA2D;AAC3D,2DAA2D;AAC3D,4EAA4E;AAC5E,2EAA2E;AAC3E,wEAAwE;AACxE,oEAAoE;AACpE,cAAc;AACd,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,6EAA6E;AAC7E,wCAAwC;AAExC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,+BAA+B,GAAG,4BAA4B,CAAC;AAE5E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kCAAkC,GAC7C,+BAA+B,CAAC;AAElC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAC/C,iCAAiC,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"breakwater-keys.js","sourceRoot":"","sources":["../../src/do-runner/breakwater-keys.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,qDAAqD;AACrD,EAAE;AACF,4EAA4E;AAC5E,2DAA2D;AAC3D,2DAA2D;AAC3D,4EAA4E;AAC5E,2EAA2E;AAC3E,wEAAwE;AACxE,oEAAoE;AACpE,cAAc;AACd,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,6EAA6E;AAC7E,wCAAwC;AAExC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,+BAA+B,GAAG,4BAA4B,CAAC;AAE5E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kCAAkC,GAC7C,+BAA+B,CAAC;AAElC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAC/C,iCAAiC,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ResumeLedgerStorage } from './resume-ledger.js';
|
|
2
1
|
/**
|
|
3
2
|
* Structural subset of D1Database — the binding init() and createD1Storage
|
|
4
3
|
* forward, opaque, into @mastra/cloudflare-d1's D1Store (see the cast at
|
|
@@ -36,6 +35,14 @@ export interface WebSocketPairLike {
|
|
|
36
35
|
readonly 0: WebSocketLike;
|
|
37
36
|
readonly 1: WebSocketLike;
|
|
38
37
|
}
|
|
38
|
+
/** Structural key/value and alarm subset shared by the Durable Object hosts. */
|
|
39
|
+
export interface DurableKeyValueStorage {
|
|
40
|
+
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
41
|
+
put<T>(key: string, value: T): Promise<void>;
|
|
42
|
+
delete(key: string): Promise<boolean>;
|
|
43
|
+
setAlarm?(scheduledTime: number | Date): Promise<void>;
|
|
44
|
+
deleteAlarm?(): Promise<void>;
|
|
45
|
+
}
|
|
39
46
|
/**
|
|
40
47
|
* The `WebSocketPair` runtime global (workerd), typed to the structural
|
|
41
48
|
* WebSocketPairLike. Read off globalThis — NOT imported from 'cloudflare:workers'
|
|
@@ -58,9 +65,8 @@ export declare function newWebSocketPair(): WebSocketPairLike;
|
|
|
58
65
|
export declare function safeSend(ws: WebSocketLike, frame: string): void;
|
|
59
66
|
/**
|
|
60
67
|
* Structural subset of DurableObjectState — the shape DurableObjectRunner
|
|
61
|
-
* reads from. `id.name` (
|
|
62
|
-
*
|
|
63
|
-
* ledger — DurableStorageResumeLedger in resume-ledger.ts) are always touched;
|
|
68
|
+
* reads from. `id.name` (run-identity recovery off the DO's own idFromName
|
|
69
|
+
* address) and `storage` (owner-recovery records and alarms) are always touched;
|
|
64
70
|
* the Hibernatable-WebSocket members are OPTIONAL so node/vitest stubs that
|
|
65
71
|
* set only id.name/storage still satisfy the type and the per-run WS stream
|
|
66
72
|
* route can guard on their presence (absent ⇒ the non-WS 426 fallback).
|
|
@@ -69,20 +75,20 @@ export interface DurableObjectRunnerState {
|
|
|
69
75
|
readonly id: {
|
|
70
76
|
readonly name?: string;
|
|
71
77
|
};
|
|
72
|
-
readonly storage:
|
|
78
|
+
readonly storage: DurableKeyValueStorage;
|
|
73
79
|
/** Make a server socket hibernatable (workerd-only). */
|
|
74
80
|
acceptWebSocket?(ws: WebSocketLike, tags?: string[]): void;
|
|
75
81
|
/** Every hibernatable socket currently attached, optionally by tag. */
|
|
76
82
|
getWebSockets?(tag?: string): WebSocketLike[];
|
|
77
83
|
}
|
|
78
84
|
/**
|
|
79
|
-
* Structural subset of DurableObjectState the
|
|
80
|
-
* reads: its OWN idFromName identity — `id.name` IS the
|
|
81
|
-
* ':' join and no runId decode, unlike
|
|
82
|
-
* `${workflowId}:${runId}` — plus the
|
|
83
|
-
* events out over. The hub holds no
|
|
84
|
-
* required here. Same OPTIONAL-WS,
|
|
85
|
-
* DurableObjectRunnerState.
|
|
85
|
+
* Structural subset of DurableObjectState the deployment hub DO (hub-do.ts)
|
|
86
|
+
* reads: its OWN idFromName identity — `id.name` IS the fixed
|
|
87
|
+
* HUB_INSTANCE_NAME, with no ':' join and no runId decode, unlike
|
|
88
|
+
* DurableObjectRunner whose name is `${workflowId}:${runId}` — plus the
|
|
89
|
+
* Hibernatable-WebSocket members it fans events out over. The hub holds no
|
|
90
|
+
* D1/DO storage, so `storage` is not required here. Same OPTIONAL-WS,
|
|
91
|
+
* guard-on-presence posture as DurableObjectRunnerState.
|
|
86
92
|
*/
|
|
87
93
|
export interface HubDurableObjectState {
|
|
88
94
|
readonly id: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cf-types.d.ts","sourceRoot":"","sources":["../../src/do-runner/cf-types.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,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM/D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE;QACX,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,wDAAwD;IACxD,eAAe,CAAC,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3D,uEAAuE;IACvE,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CAAC;CAC/C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE;QACX,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,eAAe,CAAC,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3D,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CAAC;CAC/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cf-types.js","sourceRoot":"","sources":["../../src/do-runner/cf-types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,2EAA2E;AAC3E,4DAA4D;AAC5D,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,4EAA4E;AAC5E,uEAAuE;AACvE,4EAA4E;AAC5E,qEAAqE;
|
|
1
|
+
{"version":3,"file":"cf-types.js","sourceRoot":"","sources":["../../src/do-runner/cf-types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,2EAA2E;AAC3E,4DAA4D;AAC5D,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,4EAA4E;AAC5E,uEAAuE;AACvE,4EAA4E;AAC5E,qEAAqE;AAqDrE;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,IAAI,GACR,UACD,CAAC,aAAa,CAAC;IAChB,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAiB,EAAE,KAAa;IACvD,IAAI,CAAC;QACH,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,8EAA8E;IAChF,CAAC;AACH,CAAC"}
|