deepline 0.3.89 → 0.3.91
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/contracts/install-commands.json +29 -0
- package/dist/bundling-sources/sdk/src/client.ts +221 -43
- package/dist/bundling-sources/sdk/src/index.ts +4 -0
- package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +2 -556
- package/dist/bundling-sources/sdk/src/monitor-fleets.ts +2 -2
- package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +11 -9
- package/dist/bundling-sources/sdk/src/types.ts +29 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +549 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/errors.ts +96 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +320 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +106 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +8 -1
- package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +4 -4
- package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +7 -9
- package/dist/bundling-sources/shared_libs/monitors/monitor-fleet-limits.ts +2 -12
- package/dist/bundling-sources/shared_libs/monitors/package.json +113 -4
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +56 -9
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
- package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +690 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +46 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +779 -140
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +46 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
- package/dist/bundling-sources/shared_libs/play-runtime/db-session-lease-store.ts +578 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-execution-relay.ts +521 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-receipt-gateway.ts +1378 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/runtime-topology.ts +1024 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-gateway-route-probe.ts +193 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machine-lifecycle.ts +104 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +1844 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/process-tree.ts +40 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-gateway-drain.ts +262 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-surface.ts +98 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +303 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-tuple-publication-guardian.ts +70 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-tuple-recovery.ts +519 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-fly-rollback-alignment.ts +280 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-production-gate.ts +159 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +23 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/memory-store.ts +114 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +3 -5
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +44 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/child-play-resolver.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +3662 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/progress-sidecar.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-deadline.ts +84 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-gateway-transport.ts +91 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +424 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +321 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts +110 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +625 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +72 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -44
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +103 -208
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +14 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
- package/dist/bundling-sources/shared_libs/play-runtime/webhook-receipt-retry.ts +50 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
- package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/repository-adapter.ts +24 -0
- package/dist/bundling-sources/shared_libs/plays/child-run-projection.ts +174 -0
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +267 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +73 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/manifest.ts +162 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/project-serializer.ts +87 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/source-file-path.ts +26 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/target-paths.ts +36 -0
- package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +400 -0
- package/dist/bundling-sources/shared_libs/plays/launch/prepare.ts +96 -0
- package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +385 -0
- package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +112 -0
- package/dist/bundling-sources/shared_libs/plays/play-reference.ts +117 -0
- package/dist/bundling-sources/shared_libs/plays/run-input-summary.ts +260 -0
- package/dist/bundling-sources/shared_libs/plays/run-summary-types.ts +49 -0
- package/dist/bundling-sources/shared_libs/plays/secrets/errors.ts +19 -0
- package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
- package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
- package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
- package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
- package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
- package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
- package/dist/bundling-sources/shared_libs/plays/sheet-filter.ts +347 -0
- package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
- package/dist/bundling-sources/shared_libs/plays/standard-webhooks.ts +117 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -1
- package/dist/bundling-sources/shared_libs/plays/status-result.ts +388 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/transform-factor-structure.ts +377 -0
- package/dist/bundling-sources/shared_libs/plays/webhook-payload.ts +113 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +7 -1
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +3 -2
- package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
- package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
- package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +10 -3
- package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
- package/dist/cli/getting-started.d.mts +52 -0
- package/dist/cli/getting-started.d.ts +52 -0
- package/dist/cli/getting-started.js +65 -0
- package/dist/cli/getting-started.mjs +36 -0
- package/dist/cli/index.d.mts +9 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.js +895 -407
- package/dist/cli/index.mjs +893 -414
- package/dist/{compiler-manifest-DsLbQaew.d.mts → compiler-manifest-x14KL83E.d.mts} +4 -2
- package/dist/{compiler-manifest-DsLbQaew.d.ts → compiler-manifest-x14KL83E.d.ts} +4 -2
- package/dist/index.d.mts +124 -154
- package/dist/index.d.ts +124 -154
- package/dist/index.js +132 -28
- package/dist/index.mjs +132 -28
- package/dist/install-integrity.json +182 -2
- package/dist/monitor-fleet-contract.d.mts +131 -0
- package/dist/monitor-fleet-contract.d.ts +131 -0
- package/dist/monitor-fleet-contract.js +406 -0
- package/dist/monitor-fleet-contract.mjs +367 -0
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/dist/release.d.mts +255 -0
- package/dist/release.d.ts +255 -0
- package/dist/release.js +210 -0
- package/dist/release.mjs +183 -0
- package/package.json +21 -4
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
export type DurableInvocationResponse = {
|
|
2
|
+
status: number;
|
|
3
|
+
headers: Array<[string, string]>;
|
|
4
|
+
bodyBase64: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type DurableInvocationRecord = {
|
|
8
|
+
invocationKey: string;
|
|
9
|
+
requestFingerprint: string;
|
|
10
|
+
ownerId: string;
|
|
11
|
+
parentRunId: string;
|
|
12
|
+
state: 'running' | 'completed' | 'compacted' | 'indeterminate';
|
|
13
|
+
response: DurableInvocationResponse | null;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type DurableInvocationStore = {
|
|
18
|
+
get(input: {
|
|
19
|
+
invocationKey: string;
|
|
20
|
+
}): Promise<DurableInvocationRecord | null>;
|
|
21
|
+
begin(input: {
|
|
22
|
+
invocationKey: string;
|
|
23
|
+
requestFingerprint: string;
|
|
24
|
+
acceptedRequestFingerprints?: readonly string[];
|
|
25
|
+
ownerId: string;
|
|
26
|
+
parentRunId: string;
|
|
27
|
+
}): Promise<DurableInvocationRecord>;
|
|
28
|
+
complete(input: {
|
|
29
|
+
invocationKey: string;
|
|
30
|
+
requestFingerprint: string;
|
|
31
|
+
ownerId: string;
|
|
32
|
+
response: DurableInvocationResponse;
|
|
33
|
+
}): Promise<DurableInvocationRecord | null>;
|
|
34
|
+
markIndeterminate(input: {
|
|
35
|
+
invocationKey: string;
|
|
36
|
+
requestFingerprint: string;
|
|
37
|
+
ownerId: string;
|
|
38
|
+
}): Promise<DurableInvocationRecord | null>;
|
|
39
|
+
abandon(input: {
|
|
40
|
+
invocationKey: string;
|
|
41
|
+
requestFingerprint: string;
|
|
42
|
+
ownerId: string;
|
|
43
|
+
}): Promise<boolean>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type DurableInvocationDiagnosticPhase =
|
|
47
|
+
| 'existing_indeterminate'
|
|
48
|
+
| 'existing_compacted'
|
|
49
|
+
| 'stale_running_indeterminate'
|
|
50
|
+
| 'foreign_owner_running'
|
|
51
|
+
| 'dispatch_failed'
|
|
52
|
+
| 'completion_failed'
|
|
53
|
+
| 'completion_missing'
|
|
54
|
+
| 'completion_recovered'
|
|
55
|
+
| 'fixture_abandon_succeeded'
|
|
56
|
+
| 'fixture_abandon_rejected'
|
|
57
|
+
| 'fixture_abandon_failed'
|
|
58
|
+
| 'wait_exhausted';
|
|
59
|
+
|
|
60
|
+
export type DurableInvocationDiagnostic = {
|
|
61
|
+
phase: DurableInvocationDiagnosticPhase;
|
|
62
|
+
error?: unknown;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export class DurableInvocationConflictError extends Error {
|
|
66
|
+
readonly code = 'DURABLE_INVOCATION_REQUEST_CONFLICT';
|
|
67
|
+
|
|
68
|
+
constructor() {
|
|
69
|
+
super('The durable invocation key was reused for a different request.');
|
|
70
|
+
this.name = 'DurableInvocationConflictError';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class DurableInvocationOutcomeUnknownError extends Error {
|
|
75
|
+
readonly code = 'DURABLE_INVOCATION_OUTCOME_UNKNOWN';
|
|
76
|
+
|
|
77
|
+
constructor() {
|
|
78
|
+
super(
|
|
79
|
+
'The durable invocation started but no response was committed. Deepline will not dispatch it again because its outcome may already have taken effect.',
|
|
80
|
+
);
|
|
81
|
+
this.name = 'DurableInvocationOutcomeUnknownError';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class DurableInvocationInProgressError extends Error {
|
|
86
|
+
readonly code = 'GATEWAY_INVOCATION_IN_PROGRESS';
|
|
87
|
+
|
|
88
|
+
constructor() {
|
|
89
|
+
super(
|
|
90
|
+
'The same durable invocation is still executing. Retry this transport delivery with the same invocation attempt.',
|
|
91
|
+
);
|
|
92
|
+
this.name = 'DurableInvocationInProgressError';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export class DurableInvocationCommitError extends Error {
|
|
97
|
+
readonly code = 'DURABLE_INVOCATION_COMMIT_FAILED';
|
|
98
|
+
|
|
99
|
+
constructor() {
|
|
100
|
+
super(
|
|
101
|
+
'The integration response could not be committed before delivery. Its outcome is unknown and Deepline will not dispatch it again automatically.',
|
|
102
|
+
);
|
|
103
|
+
this.name = 'DurableInvocationCommitError';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function assertMatchingRequest(
|
|
108
|
+
record: DurableInvocationRecord,
|
|
109
|
+
requestFingerprint: string,
|
|
110
|
+
acceptedRequestFingerprints: readonly string[] = [],
|
|
111
|
+
): void {
|
|
112
|
+
if (
|
|
113
|
+
record.requestFingerprint !== requestFingerprint &&
|
|
114
|
+
!acceptedRequestFingerprints.includes(record.requestFingerprint)
|
|
115
|
+
) {
|
|
116
|
+
throw new DurableInvocationConflictError();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function completedResponse(
|
|
121
|
+
record: DurableInvocationRecord,
|
|
122
|
+
): DurableInvocationResponse | null {
|
|
123
|
+
if (record.state !== 'completed') return null;
|
|
124
|
+
if (!record.response) throw new DurableInvocationCommitError();
|
|
125
|
+
return record.response;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function decodedBodyBytes(response: DurableInvocationResponse): number {
|
|
129
|
+
const padding = response.bodyBase64.endsWith('==')
|
|
130
|
+
? 2
|
|
131
|
+
: response.bodyBase64.endsWith('=')
|
|
132
|
+
? 1
|
|
133
|
+
: 0;
|
|
134
|
+
return Math.max(
|
|
135
|
+
0,
|
|
136
|
+
Math.floor((response.bodyBase64.length * 3) / 4) - padding,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Deep transport-redelivery Module for integration execution.
|
|
142
|
+
*
|
|
143
|
+
* A live owner is never stolen. An indeterminate outcome stays blocked inside
|
|
144
|
+
* its owning run, but a later explicit Play Run may replace it. That rerun is
|
|
145
|
+
* fresh user intent and may repeat a side effect whose first outcome was
|
|
146
|
+
* unknown; automatic transport and same-run retries remain fenced.
|
|
147
|
+
*/
|
|
148
|
+
export async function executeWithDurableInvocationFence(input: {
|
|
149
|
+
invocationKey: string;
|
|
150
|
+
requestFingerprint: string;
|
|
151
|
+
/** Exact historical fingerprint aliases accepted during a rolling upgrade. */
|
|
152
|
+
acceptedRequestFingerprints?: readonly string[];
|
|
153
|
+
ownerId: string;
|
|
154
|
+
parentRunId: string;
|
|
155
|
+
store: DurableInvocationStore;
|
|
156
|
+
execute: () => Promise<DurableInvocationResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Fixture execution has no provider-side effect. It may discard an
|
|
159
|
+
* ambiguous transport owner and redeliver the exact request. Live provider
|
|
160
|
+
* execution must leave this false and retain the fail-closed tombstone.
|
|
161
|
+
*/
|
|
162
|
+
replaySafeAfterDispatch?: boolean;
|
|
163
|
+
onDispatchStart?: () => void;
|
|
164
|
+
beforeReplay?: () => Promise<void>;
|
|
165
|
+
wait?: (attempt: number) => Promise<void>;
|
|
166
|
+
maxWaitAttempts?: number;
|
|
167
|
+
runningStaleAfterMs?: number;
|
|
168
|
+
now?: () => number;
|
|
169
|
+
onOutcome?: (
|
|
170
|
+
outcome: 'live' | 'replay' | 'in_progress' | 'unknown',
|
|
171
|
+
responseBytes?: number,
|
|
172
|
+
) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Exceptional transition telemetry. This is intentionally silent on the
|
|
175
|
+
* normal dispatch/commit path so large maps do not produce per-row logs.
|
|
176
|
+
*/
|
|
177
|
+
onDiagnostic?: (diagnostic: DurableInvocationDiagnostic) => void;
|
|
178
|
+
}): Promise<DurableInvocationResponse> {
|
|
179
|
+
const diagnose = (
|
|
180
|
+
phase: DurableInvocationDiagnosticPhase,
|
|
181
|
+
error?: unknown,
|
|
182
|
+
): void => {
|
|
183
|
+
try {
|
|
184
|
+
input.onDiagnostic?.({
|
|
185
|
+
phase,
|
|
186
|
+
...(error === undefined ? {} : { error }),
|
|
187
|
+
});
|
|
188
|
+
} catch {
|
|
189
|
+
// Observability must never change invocation fencing semantics.
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const retryReplaySafeInvocation = async (
|
|
193
|
+
record: Pick<
|
|
194
|
+
DurableInvocationRecord,
|
|
195
|
+
'invocationKey' | 'requestFingerprint' | 'ownerId'
|
|
196
|
+
>,
|
|
197
|
+
): Promise<never> => {
|
|
198
|
+
try {
|
|
199
|
+
const abandoned = await input.store.abandon(record);
|
|
200
|
+
diagnose(
|
|
201
|
+
abandoned ? 'fixture_abandon_succeeded' : 'fixture_abandon_rejected',
|
|
202
|
+
);
|
|
203
|
+
} catch (error) {
|
|
204
|
+
diagnose('fixture_abandon_failed', error);
|
|
205
|
+
// The store may be the failed boundary. The next delivery retries this
|
|
206
|
+
// conditional cleanup after storage recovers; fixture execution remains
|
|
207
|
+
// safe to redeliver either way.
|
|
208
|
+
}
|
|
209
|
+
input.onOutcome?.('in_progress');
|
|
210
|
+
throw new DurableInvocationInProgressError();
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const markStaleRunningUnknown = async (
|
|
214
|
+
record: DurableInvocationRecord,
|
|
215
|
+
): Promise<DurableInvocationRecord> => {
|
|
216
|
+
if (record.state !== 'running') return record;
|
|
217
|
+
const updatedAt = Date.parse(record.updatedAt);
|
|
218
|
+
const staleAfterMs = input.runningStaleAfterMs ?? 30 * 60_000;
|
|
219
|
+
if (
|
|
220
|
+
Number.isFinite(updatedAt) &&
|
|
221
|
+
(input.now ?? Date.now)() - updatedAt >= staleAfterMs
|
|
222
|
+
) {
|
|
223
|
+
const marked = await input.store.markIndeterminate({
|
|
224
|
+
invocationKey: record.invocationKey,
|
|
225
|
+
requestFingerprint: record.requestFingerprint,
|
|
226
|
+
ownerId: record.ownerId,
|
|
227
|
+
});
|
|
228
|
+
if (marked?.state === 'indeterminate') {
|
|
229
|
+
diagnose('stale_running_indeterminate');
|
|
230
|
+
if (marked.parentRunId !== input.parentRunId) {
|
|
231
|
+
return await input.store.begin({
|
|
232
|
+
invocationKey: input.invocationKey,
|
|
233
|
+
requestFingerprint: input.requestFingerprint,
|
|
234
|
+
acceptedRequestFingerprints: input.acceptedRequestFingerprints,
|
|
235
|
+
ownerId: input.ownerId,
|
|
236
|
+
parentRunId: input.parentRunId,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
if (input.replaySafeAfterDispatch) {
|
|
240
|
+
return await retryReplaySafeInvocation(marked);
|
|
241
|
+
}
|
|
242
|
+
throw new DurableInvocationOutcomeUnknownError();
|
|
243
|
+
}
|
|
244
|
+
// The owner may have committed between this follower's stale read and
|
|
245
|
+
// the conditional transition. Read the winner before declaring the
|
|
246
|
+
// provider outcome unknown.
|
|
247
|
+
const winner =
|
|
248
|
+
marked ??
|
|
249
|
+
(await input.store.get({ invocationKey: record.invocationKey }));
|
|
250
|
+
if (!winner) {
|
|
251
|
+
diagnose('stale_running_indeterminate');
|
|
252
|
+
throw new DurableInvocationOutcomeUnknownError();
|
|
253
|
+
}
|
|
254
|
+
assertMatchingRequest(
|
|
255
|
+
winner,
|
|
256
|
+
input.requestFingerprint,
|
|
257
|
+
input.acceptedRequestFingerprints,
|
|
258
|
+
);
|
|
259
|
+
if (winner.state === 'indeterminate' || winner.state === 'compacted') {
|
|
260
|
+
diagnose(
|
|
261
|
+
winner.state === 'indeterminate'
|
|
262
|
+
? 'stale_running_indeterminate'
|
|
263
|
+
: 'existing_compacted',
|
|
264
|
+
);
|
|
265
|
+
if (input.replaySafeAfterDispatch) {
|
|
266
|
+
return await retryReplaySafeInvocation(winner);
|
|
267
|
+
}
|
|
268
|
+
throw new DurableInvocationOutcomeUnknownError();
|
|
269
|
+
}
|
|
270
|
+
return winner;
|
|
271
|
+
}
|
|
272
|
+
return record;
|
|
273
|
+
};
|
|
274
|
+
let begun = await input.store.begin({
|
|
275
|
+
invocationKey: input.invocationKey,
|
|
276
|
+
requestFingerprint: input.requestFingerprint,
|
|
277
|
+
acceptedRequestFingerprints: input.acceptedRequestFingerprints,
|
|
278
|
+
ownerId: input.ownerId,
|
|
279
|
+
parentRunId: input.parentRunId,
|
|
280
|
+
});
|
|
281
|
+
assertMatchingRequest(
|
|
282
|
+
begun,
|
|
283
|
+
input.requestFingerprint,
|
|
284
|
+
input.acceptedRequestFingerprints,
|
|
285
|
+
);
|
|
286
|
+
if (begun.state === 'indeterminate' || begun.state === 'compacted') {
|
|
287
|
+
diagnose(
|
|
288
|
+
begun.state === 'indeterminate'
|
|
289
|
+
? 'existing_indeterminate'
|
|
290
|
+
: 'existing_compacted',
|
|
291
|
+
);
|
|
292
|
+
if (input.replaySafeAfterDispatch) {
|
|
293
|
+
return await retryReplaySafeInvocation(begun);
|
|
294
|
+
}
|
|
295
|
+
input.onOutcome?.('unknown');
|
|
296
|
+
throw new DurableInvocationOutcomeUnknownError();
|
|
297
|
+
}
|
|
298
|
+
begun = await markStaleRunningUnknown(begun);
|
|
299
|
+
const replay = completedResponse(begun);
|
|
300
|
+
if (replay) {
|
|
301
|
+
await input.beforeReplay?.();
|
|
302
|
+
input.onOutcome?.('replay', decodedBodyBytes(replay));
|
|
303
|
+
return replay;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (begun.ownerId === input.ownerId) {
|
|
307
|
+
let response: DurableInvocationResponse;
|
|
308
|
+
try {
|
|
309
|
+
// Store/control-plane failures before this boundary are safely
|
|
310
|
+
// retryable: no integration request has started. Unclassified failures
|
|
311
|
+
// after it must fail closed because the provider outcome may be unknown.
|
|
312
|
+
input.onDispatchStart?.();
|
|
313
|
+
response = await input.execute();
|
|
314
|
+
} catch (error) {
|
|
315
|
+
diagnose('dispatch_failed', error);
|
|
316
|
+
if (input.replaySafeAfterDispatch) {
|
|
317
|
+
return await retryReplaySafeInvocation(begun);
|
|
318
|
+
}
|
|
319
|
+
await input.store.markIndeterminate({
|
|
320
|
+
invocationKey: input.invocationKey,
|
|
321
|
+
requestFingerprint: input.requestFingerprint,
|
|
322
|
+
ownerId: input.ownerId,
|
|
323
|
+
});
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
let completed: DurableInvocationRecord | null;
|
|
327
|
+
try {
|
|
328
|
+
completed = await input.store.complete({
|
|
329
|
+
invocationKey: input.invocationKey,
|
|
330
|
+
requestFingerprint: input.requestFingerprint,
|
|
331
|
+
ownerId: input.ownerId,
|
|
332
|
+
response,
|
|
333
|
+
});
|
|
334
|
+
} catch (error) {
|
|
335
|
+
diagnose('completion_failed', error);
|
|
336
|
+
if (!input.replaySafeAfterDispatch) throw error;
|
|
337
|
+
try {
|
|
338
|
+
const winner = await input.store.get({
|
|
339
|
+
invocationKey: input.invocationKey,
|
|
340
|
+
});
|
|
341
|
+
if (winner) {
|
|
342
|
+
assertMatchingRequest(
|
|
343
|
+
winner,
|
|
344
|
+
input.requestFingerprint,
|
|
345
|
+
input.acceptedRequestFingerprints,
|
|
346
|
+
);
|
|
347
|
+
const committed = completedResponse(winner);
|
|
348
|
+
if (committed) {
|
|
349
|
+
diagnose('completion_recovered');
|
|
350
|
+
input.onOutcome?.('replay', decodedBodyBytes(committed));
|
|
351
|
+
return committed;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
} catch {
|
|
355
|
+
// Fall through to the fixture-safe conditional cleanup below.
|
|
356
|
+
}
|
|
357
|
+
return await retryReplaySafeInvocation(begun);
|
|
358
|
+
}
|
|
359
|
+
if (!completed) {
|
|
360
|
+
diagnose('completion_missing');
|
|
361
|
+
const winner = await input.store.get({
|
|
362
|
+
invocationKey: input.invocationKey,
|
|
363
|
+
});
|
|
364
|
+
if (winner) {
|
|
365
|
+
assertMatchingRequest(
|
|
366
|
+
winner,
|
|
367
|
+
input.requestFingerprint,
|
|
368
|
+
input.acceptedRequestFingerprints,
|
|
369
|
+
);
|
|
370
|
+
const committed = completedResponse(winner);
|
|
371
|
+
if (committed) {
|
|
372
|
+
diagnose('completion_recovered');
|
|
373
|
+
input.onOutcome?.('replay', decodedBodyBytes(committed));
|
|
374
|
+
return committed;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (input.replaySafeAfterDispatch) {
|
|
378
|
+
return await retryReplaySafeInvocation(begun);
|
|
379
|
+
}
|
|
380
|
+
await input.store.markIndeterminate({
|
|
381
|
+
invocationKey: input.invocationKey,
|
|
382
|
+
requestFingerprint: input.requestFingerprint,
|
|
383
|
+
ownerId: input.ownerId,
|
|
384
|
+
});
|
|
385
|
+
input.onOutcome?.('unknown');
|
|
386
|
+
throw new DurableInvocationCommitError();
|
|
387
|
+
}
|
|
388
|
+
assertMatchingRequest(
|
|
389
|
+
completed,
|
|
390
|
+
input.requestFingerprint,
|
|
391
|
+
input.acceptedRequestFingerprints,
|
|
392
|
+
);
|
|
393
|
+
const committed = completedResponse(completed) ?? response;
|
|
394
|
+
input.onOutcome?.('live', decodedBodyBytes(committed));
|
|
395
|
+
return committed;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (input.replaySafeAfterDispatch) {
|
|
399
|
+
diagnose('foreign_owner_running');
|
|
400
|
+
return await retryReplaySafeInvocation(begun);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const maxWaitAttempts = input.maxWaitAttempts ?? 20;
|
|
404
|
+
for (let attempt = 1; attempt <= maxWaitAttempts; attempt += 1) {
|
|
405
|
+
await (input.wait?.(attempt) ??
|
|
406
|
+
new Promise<void>((resolve) => setTimeout(resolve, 250)));
|
|
407
|
+
let latest = await input.store.get({
|
|
408
|
+
invocationKey: input.invocationKey,
|
|
409
|
+
});
|
|
410
|
+
if (!latest) continue;
|
|
411
|
+
assertMatchingRequest(
|
|
412
|
+
latest,
|
|
413
|
+
input.requestFingerprint,
|
|
414
|
+
input.acceptedRequestFingerprints,
|
|
415
|
+
);
|
|
416
|
+
if (
|
|
417
|
+
latest.state === 'indeterminate' &&
|
|
418
|
+
latest.parentRunId !== input.parentRunId
|
|
419
|
+
) {
|
|
420
|
+
return await executeWithDurableInvocationFence(input);
|
|
421
|
+
}
|
|
422
|
+
if (latest.state === 'indeterminate' || latest.state === 'compacted') {
|
|
423
|
+
diagnose(
|
|
424
|
+
latest.state === 'indeterminate'
|
|
425
|
+
? 'existing_indeterminate'
|
|
426
|
+
: 'existing_compacted',
|
|
427
|
+
);
|
|
428
|
+
input.onOutcome?.('unknown');
|
|
429
|
+
throw new DurableInvocationOutcomeUnknownError();
|
|
430
|
+
}
|
|
431
|
+
latest = await markStaleRunningUnknown(latest);
|
|
432
|
+
const response = completedResponse(latest);
|
|
433
|
+
if (response) {
|
|
434
|
+
await input.beforeReplay?.();
|
|
435
|
+
input.onOutcome?.('replay', decodedBodyBytes(response));
|
|
436
|
+
return response;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
diagnose('wait_exhausted');
|
|
440
|
+
input.onOutcome?.('in_progress');
|
|
441
|
+
throw new DurableInvocationInProgressError();
|
|
442
|
+
}
|
|
@@ -14,9 +14,9 @@ export const PLAY_RUNTIME_PROTOCOL = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Current scheduler/runner protocol. This number STAYS AT 1: the additive
|
|
16
16
|
* compatibility rule (`docs/runtime-compatibility-contract.md`) covers new
|
|
17
|
-
* fields and new named actions without a bump.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* fields and new named actions without a bump. The required compatibility
|
|
18
|
+
* audit freezes these historical tags; ship a new action's reader before
|
|
19
|
+
* its writer instead of changing a global number.
|
|
20
20
|
*/
|
|
21
21
|
current: 1,
|
|
22
22
|
} as const;
|
|
@@ -51,6 +51,10 @@ const FIXTURE_MODE_BYPASS_PROVIDERS = new Set([
|
|
|
51
51
|
'test',
|
|
52
52
|
'test_high',
|
|
53
53
|
'test_low',
|
|
54
|
+
// Dedicated stateful failure fixtures must reach their local custom handlers
|
|
55
|
+
// even when the surrounding Play runs in fixture mode.
|
|
56
|
+
'test_receipt',
|
|
57
|
+
'test_retry',
|
|
54
58
|
'test_unhinted',
|
|
55
59
|
]);
|
|
56
60
|
|
|
@@ -443,6 +447,20 @@ export function shouldRouteFixtureToolId(toolId: string): boolean {
|
|
|
443
447
|
);
|
|
444
448
|
}
|
|
445
449
|
|
|
450
|
+
/** Only canned fixture responses are safe to redispatch after response loss. */
|
|
451
|
+
export function isReplaySafeFixtureToolId(toolId: string): boolean {
|
|
452
|
+
const normalized = toolId.trim().toLowerCase();
|
|
453
|
+
// Managed inference can use the fake Gateway while exercising real wallet
|
|
454
|
+
// authorization and settlement. Its invocation fence must survive retries.
|
|
455
|
+
// Keep all inference variants fenced, including aliases and local emulators.
|
|
456
|
+
return (
|
|
457
|
+
shouldRouteFixtureToolId(normalized) &&
|
|
458
|
+
normalized !== 'ai_inference' &&
|
|
459
|
+
normalized !== 'deeplineagent' &&
|
|
460
|
+
!normalized.startsWith('deeplineagent_')
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
446
464
|
function stableFixtureRequestHash(value: string): number {
|
|
447
465
|
let hash = 0x811c9dc5;
|
|
448
466
|
for (let index = 0; index < value.length; index += 1) {
|
package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts
CHANGED
|
@@ -483,6 +483,15 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
|
|
|
483
483
|
);
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
|
+
// Zero grants without a finite positive wait cannot make progress.
|
|
487
|
+
// Older gateways return this for an empty/invalid normalized rule set;
|
|
488
|
+
// fail exhausted instead of spinning once per millisecond forever.
|
|
489
|
+
if (!Number.isFinite(response.waitMs) || response.waitMs <= 0) {
|
|
490
|
+
throw this.providerExhaustedFromResponse(bucketId, {
|
|
491
|
+
...response,
|
|
492
|
+
waitMs: 0,
|
|
493
|
+
});
|
|
494
|
+
}
|
|
486
495
|
// Live path: the server told us to wait past the threshold. Fail fast
|
|
487
496
|
// with a typed PROVIDER_EXHAUSTED instead of sleeping toward it. The
|
|
488
497
|
// rejection propagates to every waiter parked on this single-flight
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* is no `null`, no "off", no implicit infinity. Unaccounted resource use
|
|
17
17
|
* must be impossible.
|
|
18
18
|
*
|
|
19
|
-
* The docs catalog (`src/lib/plays/limits-catalog.ts`) and its generated public
|
|
19
|
+
* The docs catalog (`apps/deepline-api/src/lib/plays/limits-catalog.ts`) and its generated public
|
|
20
20
|
* + internal pages source their numbers from this table.
|
|
21
21
|
*/
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ export interface PacingRule {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Per-tool queue-hint metadata produced by the runtime tool catalog
|
|
27
|
-
* (`
|
|
27
|
+
* (`packages/integrations/runtime-tool-metadata.ts`) and surfaced to the runtime via
|
|
28
28
|
* `ContextOptions.getToolQueueHints`. It is the raw provider rate-limit metadata
|
|
29
29
|
* that the runtime maps into one {@link PacingRule} per hint before handing it
|
|
30
30
|
* to the Governor's pacing resolver. The `provider` field identifies the pacing
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The storage format a gateway may write for one Runtime Postgres schema.
|
|
3
|
+
*
|
|
4
|
+
* `canonical_v1` is deliberately a reader capability, not a deploy toggle:
|
|
5
|
+
* every gateway which can encounter the schema must be able to materialize
|
|
6
|
+
* canonical operation outcomes before this mode is recorded.
|
|
7
|
+
*/
|
|
8
|
+
export type IntegrationOperationStorageMode =
|
|
9
|
+
| 'legacy_byte_reader'
|
|
10
|
+
| 'canonical_v1';
|
|
11
|
+
|
|
12
|
+
export const INTEGRATION_OPERATION_CANONICAL_READER_CAPABILITY =
|
|
13
|
+
'integration-operation-canonical-v1' as const;
|
|
14
|
+
|
|
15
|
+
export type RuntimeGatewayRole = 'receipt' | 'execution';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Operator-verified evidence that both durable gateway reader fleets can
|
|
19
|
+
* understand canonical Integration Operation rows. The control-plane verifier
|
|
20
|
+
* collects this evidence; this module records and validates its shape.
|
|
21
|
+
*/
|
|
22
|
+
export type CanonicalReaderProof = {
|
|
23
|
+
capability: typeof INTEGRATION_OPERATION_CANONICAL_READER_CAPABILITY;
|
|
24
|
+
sourceSha: string;
|
|
25
|
+
machineIds: Readonly<Record<RuntimeGatewayRole, readonly string[]>>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The local Runtime Postgres mirror of the control-plane reader fence.
|
|
30
|
+
* `schema` is the scheduler schema/namespace, never an application or lane.
|
|
31
|
+
*/
|
|
32
|
+
export type RuntimeGatewayReaderFence = {
|
|
33
|
+
schema: string;
|
|
34
|
+
/** Strictly positive, monotonically increasing within a schema. */
|
|
35
|
+
epoch: number;
|
|
36
|
+
mode: IntegrationOperationStorageMode;
|
|
37
|
+
canonicalReaderProof: CanonicalReaderProof | null;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type RuntimeGatewayReaderFenceCandidate = RuntimeGatewayReaderFence;
|
|
41
|
+
|
|
42
|
+
export type ReaderFenceWriterMode = {
|
|
43
|
+
mode: IntegrationOperationStorageMode;
|
|
44
|
+
/** `absent` and unavailable storage are intentionally legacy-only. */
|
|
45
|
+
source: 'fence' | 'absent' | 'fail_closed';
|
|
46
|
+
epoch: number | null;
|
|
47
|
+
failure?: 'store_unavailable' | 'invalid_record';
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type ReaderFenceApplyOutcome =
|
|
51
|
+
| { kind: 'advanced'; fence: RuntimeGatewayReaderFence }
|
|
52
|
+
| { kind: 'already_applied'; fence: RuntimeGatewayReaderFence }
|
|
53
|
+
| {
|
|
54
|
+
kind: 'rejected';
|
|
55
|
+
reason: 'stale_epoch' | 'epoch_conflict' | 'unsafe_mode_downgrade';
|
|
56
|
+
current: RuntimeGatewayReaderFence;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type RuntimeGatewayReaderFenceJob = {
|
|
60
|
+
/** Resolve the only format this gateway may write. Never returns canonical on uncertainty. */
|
|
61
|
+
writerMode(input: { schema: string }): Promise<ReaderFenceWriterMode>;
|
|
62
|
+
/** Advance the mirror only with a strictly newer epoch, or retry the exact same fence. */
|
|
63
|
+
apply(
|
|
64
|
+
candidate: RuntimeGatewayReaderFenceCandidate,
|
|
65
|
+
): Promise<ReaderFenceApplyOutcome>;
|
|
66
|
+
};
|