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,169 @@
|
|
|
1
|
+
import { mintWorkflowRunExecutionToken } from './internal-bootstrap-token';
|
|
2
|
+
import type { RuntimeExecutionCapability } from './/execution-capabilities';
|
|
3
|
+
import type { FixtureBehavior } from './/fixture-behavior';
|
|
4
|
+
import type { DirectCompletedTerminalContract } from './/scheduler-backends/terminal-contract';
|
|
5
|
+
|
|
6
|
+
const ENCRYPTION_KEY_ENV = 'INTEGRATION_CREDENTIALS_ENCRYPTION_KEY';
|
|
7
|
+
const AES_GCM_ALGORITHM = 'AES-GCM';
|
|
8
|
+
const IV_LENGTH_BYTES = 12;
|
|
9
|
+
const AUTH_TAG_LENGTH_BYTES = 16;
|
|
10
|
+
|
|
11
|
+
export type EncryptedWorkflowExecutorApiKey = {
|
|
12
|
+
ciphertext: string;
|
|
13
|
+
iv: string;
|
|
14
|
+
tag: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export function hasWorkflowExecutorEncryptionKey(): boolean {
|
|
18
|
+
return typeof process.env[ENCRYPTION_KEY_ENV] === 'string';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getEncryptionKeyBytes(): Uint8Array {
|
|
22
|
+
const raw = process.env[ENCRYPTION_KEY_ENV];
|
|
23
|
+
if (!raw) {
|
|
24
|
+
throw new Error(`Missing ${ENCRYPTION_KEY_ENV} environment variable.`);
|
|
25
|
+
}
|
|
26
|
+
const key = decodeBase64(raw);
|
|
27
|
+
if (key.byteLength !== 32) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`${ENCRYPTION_KEY_ENV} must be a base64-encoded 32-byte key.`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return key;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function importEncryptionKey() {
|
|
36
|
+
return crypto.subtle.importKey(
|
|
37
|
+
'raw',
|
|
38
|
+
toArrayBuffer(getEncryptionKeyBytes()),
|
|
39
|
+
{ name: AES_GCM_ALGORITHM },
|
|
40
|
+
false,
|
|
41
|
+
['encrypt', 'decrypt'],
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export async function encryptWorkflowExecutorApiKey(
|
|
46
|
+
apiKey: string,
|
|
47
|
+
): Promise<EncryptedWorkflowExecutorApiKey> {
|
|
48
|
+
const iv = crypto.getRandomValues(new Uint8Array(IV_LENGTH_BYTES));
|
|
49
|
+
const key = await importEncryptionKey();
|
|
50
|
+
const encrypted = new Uint8Array(
|
|
51
|
+
await crypto.subtle.encrypt(
|
|
52
|
+
{
|
|
53
|
+
name: AES_GCM_ALGORITHM,
|
|
54
|
+
iv: toArrayBuffer(iv),
|
|
55
|
+
tagLength: AUTH_TAG_LENGTH_BYTES * 8,
|
|
56
|
+
},
|
|
57
|
+
key,
|
|
58
|
+
new TextEncoder().encode(apiKey),
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
const ciphertext = encrypted.slice(0, -AUTH_TAG_LENGTH_BYTES);
|
|
62
|
+
const tag = encrypted.slice(-AUTH_TAG_LENGTH_BYTES);
|
|
63
|
+
return {
|
|
64
|
+
ciphertext: encodeBase64(ciphertext),
|
|
65
|
+
iv: encodeBase64(iv),
|
|
66
|
+
tag: encodeBase64(tag),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function maybeEncryptWorkflowExecutorApiKey(
|
|
71
|
+
apiKey: string,
|
|
72
|
+
): Promise<EncryptedWorkflowExecutorApiKey | null> {
|
|
73
|
+
if (!hasWorkflowExecutorEncryptionKey()) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return encryptWorkflowExecutorApiKey(apiKey);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function decryptWorkflowExecutorApiKey(
|
|
80
|
+
payload: EncryptedWorkflowExecutorApiKey,
|
|
81
|
+
): Promise<string> {
|
|
82
|
+
const key = await importEncryptionKey();
|
|
83
|
+
const iv = decodeBase64(payload.iv);
|
|
84
|
+
const ciphertext = decodeBase64(payload.ciphertext);
|
|
85
|
+
const tag = decodeBase64(payload.tag);
|
|
86
|
+
const combined = new Uint8Array(ciphertext.byteLength + tag.byteLength);
|
|
87
|
+
combined.set(ciphertext, 0);
|
|
88
|
+
combined.set(tag, ciphertext.byteLength);
|
|
89
|
+
const plaintext = await crypto.subtle.decrypt(
|
|
90
|
+
{
|
|
91
|
+
name: AES_GCM_ALGORITHM,
|
|
92
|
+
iv: toArrayBuffer(iv),
|
|
93
|
+
tagLength: AUTH_TAG_LENGTH_BYTES * 8,
|
|
94
|
+
},
|
|
95
|
+
key,
|
|
96
|
+
toArrayBuffer(combined),
|
|
97
|
+
);
|
|
98
|
+
return new TextDecoder().decode(plaintext);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export async function mintWorkflowExecutorToken(input: {
|
|
102
|
+
orgId: string;
|
|
103
|
+
workflowId: string;
|
|
104
|
+
runId: string;
|
|
105
|
+
billingRunId?: string | null;
|
|
106
|
+
playName?: string;
|
|
107
|
+
allowedSecrets?: readonly string[] | null;
|
|
108
|
+
maxCreditsPerRun?: number | null;
|
|
109
|
+
integrationMode?: 'live' | 'eval_stub' | 'fixture' | null;
|
|
110
|
+
fixtureBehavior?: FixtureBehavior | null;
|
|
111
|
+
synthetic?: boolean | null;
|
|
112
|
+
actorUserId?: string | null;
|
|
113
|
+
actorEmail?: string | null;
|
|
114
|
+
schedulerSchema?: string | null;
|
|
115
|
+
runAttempt?: number | null;
|
|
116
|
+
runLeaseToken?: string | null;
|
|
117
|
+
terminalContract?: DirectCompletedTerminalContract | null;
|
|
118
|
+
capabilities?: readonly RuntimeExecutionCapability[];
|
|
119
|
+
runtimeOrigin?: string | null;
|
|
120
|
+
}) {
|
|
121
|
+
const playName = input.playName?.trim() || input.workflowId;
|
|
122
|
+
return mintWorkflowRunExecutionToken({
|
|
123
|
+
orgId: input.orgId,
|
|
124
|
+
workflowId: input.workflowId,
|
|
125
|
+
runId: input.runId,
|
|
126
|
+
billingRunId: input.billingRunId,
|
|
127
|
+
playName,
|
|
128
|
+
allowedSecrets: input.allowedSecrets,
|
|
129
|
+
maxCreditsPerRun: input.maxCreditsPerRun,
|
|
130
|
+
integrationMode: input.integrationMode,
|
|
131
|
+
fixtureBehavior: input.fixtureBehavior,
|
|
132
|
+
synthetic: input.synthetic,
|
|
133
|
+
actorUserId: input.actorUserId,
|
|
134
|
+
actorEmail: input.actorEmail,
|
|
135
|
+
schedulerSchema: input.schedulerSchema,
|
|
136
|
+
runAttempt: input.runAttempt,
|
|
137
|
+
runLeaseToken: input.runLeaseToken,
|
|
138
|
+
terminalContract: input.terminalContract,
|
|
139
|
+
capabilities: input.capabilities,
|
|
140
|
+
runtimeOrigin: input.runtimeOrigin,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function encodeBase64(bytes: Uint8Array): string {
|
|
145
|
+
return btoa(String.fromCharCode(...bytes));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function decodeBase64(value: string): Uint8Array {
|
|
149
|
+
// Match the lenient base64 handling the rest of the app uses for
|
|
150
|
+
// INTEGRATION_CREDENTIALS_ENCRYPTION_KEY (Buffer.from(raw, 'base64') in
|
|
151
|
+
// crypto.ts / cloud-jobs/runtime.ts): tolerate the base64url alphabet and
|
|
152
|
+
// missing padding. This module runs in the edge/Convex runtime (no Buffer),
|
|
153
|
+
// and bare atob() rejects base64url / unpadded keys with "InvalidCharacterError",
|
|
154
|
+
// which previously made `workflows call` 500 on any deployment whose key was
|
|
155
|
+
// stored base64url. Standard padded base64 is unaffected (normalization is a
|
|
156
|
+
// no-op), so production keys decode identically.
|
|
157
|
+
let normalized = value.trim().replace(/-/g, '+').replace(/_/g, '/');
|
|
158
|
+
const remainder = normalized.length % 4;
|
|
159
|
+
if (remainder === 2) normalized += '==';
|
|
160
|
+
else if (remainder === 3) normalized += '=';
|
|
161
|
+
return Uint8Array.from(atob(normalized), (char) => char.charCodeAt(0));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function toArrayBuffer(bytes: Uint8Array): ArrayBuffer {
|
|
165
|
+
return bytes.buffer.slice(
|
|
166
|
+
bytes.byteOffset,
|
|
167
|
+
bytes.byteOffset + bytes.byteLength,
|
|
168
|
+
) as ArrayBuffer;
|
|
169
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineBatchStrategyMap,
|
|
3
|
+
type BatchOperationStrategy,
|
|
4
|
+
} from './batching-types';
|
|
5
|
+
|
|
6
|
+
type Single = { email?: string; ip_address?: string };
|
|
7
|
+
type Bulk = {
|
|
8
|
+
email_batch: Array<{ email_address: string; ip_address?: string }>;
|
|
9
|
+
};
|
|
10
|
+
type Verdict = Record<string, unknown> & { address: string; status: string };
|
|
11
|
+
type Results = { email_batch?: unknown[]; errors?: unknown[]; data?: Results };
|
|
12
|
+
|
|
13
|
+
function emailKey(email: string) {
|
|
14
|
+
return email.trim().toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
function bucket(payload: Single) {
|
|
17
|
+
// The response identifies emails, but does not echo the supplied IP.
|
|
18
|
+
return JSON.stringify([
|
|
19
|
+
'zerobounce_batch_validate',
|
|
20
|
+
payload.ip_address ?? null,
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const zerobounceValidateBatchStrategy: BatchOperationStrategy<
|
|
25
|
+
Single,
|
|
26
|
+
Bulk,
|
|
27
|
+
Results,
|
|
28
|
+
{ data: Verdict }
|
|
29
|
+
> = {
|
|
30
|
+
sourceOperation: 'zerobounce_validate',
|
|
31
|
+
batchOperation: 'zerobounce_batch_validate',
|
|
32
|
+
kind: 'identifier_batch',
|
|
33
|
+
maxBatchSize: 100,
|
|
34
|
+
bucketKeyPayloadFields: ['ip_address'],
|
|
35
|
+
canBatchWith: (left, right) => bucket(left) === bucket(right),
|
|
36
|
+
toBucketKey: bucket,
|
|
37
|
+
toItemKey: (payload) =>
|
|
38
|
+
JSON.stringify([emailKey(payload.email ?? ''), payload.ip_address ?? null]),
|
|
39
|
+
compile(payloads) {
|
|
40
|
+
const first = payloads[0];
|
|
41
|
+
if (
|
|
42
|
+
!first ||
|
|
43
|
+
payloads.length > 100 ||
|
|
44
|
+
payloads.some((p) => !p.email?.trim() || bucket(p) !== bucket(first))
|
|
45
|
+
) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
'ZeroBounce batch requires 1–100 emails with matching IP options.',
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
// Receipt deduplication may leave one owned email. Keep the bulk operation.
|
|
52
|
+
batchOperation: 'zerobounce_batch_validate',
|
|
53
|
+
batchPayload: {
|
|
54
|
+
email_batch: [...new Set(payloads.map((p) => emailKey(p.email!)))].map(
|
|
55
|
+
(email_address) => ({
|
|
56
|
+
email_address,
|
|
57
|
+
...(first.ip_address ? { ip_address: first.ip_address } : {}),
|
|
58
|
+
}),
|
|
59
|
+
),
|
|
60
|
+
},
|
|
61
|
+
items: payloads.map((payload) => ({
|
|
62
|
+
itemKey: zerobounceValidateBatchStrategy.toItemKey(payload),
|
|
63
|
+
payload,
|
|
64
|
+
})),
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
splitResult(fullResult, compiled) {
|
|
68
|
+
const result = fullResult.data ?? fullResult;
|
|
69
|
+
if (
|
|
70
|
+
!Array.isArray(result.email_batch) ||
|
|
71
|
+
(result.errors !== undefined &&
|
|
72
|
+
(!Array.isArray(result.errors) || result.errors.length > 0))
|
|
73
|
+
) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
'ZeroBounce bulk verification returned errors or no result list.',
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
const expected = new Set(
|
|
79
|
+
compiled.batchPayload.email_batch.map((p) => emailKey(p.email_address)),
|
|
80
|
+
);
|
|
81
|
+
const byEmail = new Map<string, Verdict>();
|
|
82
|
+
for (const value of result.email_batch) {
|
|
83
|
+
const row = value as Verdict | null;
|
|
84
|
+
if (
|
|
85
|
+
!row ||
|
|
86
|
+
typeof row.address !== 'string' ||
|
|
87
|
+
![
|
|
88
|
+
'valid',
|
|
89
|
+
'invalid',
|
|
90
|
+
'catch-all',
|
|
91
|
+
'unknown',
|
|
92
|
+
'spamtrap',
|
|
93
|
+
'abuse',
|
|
94
|
+
'do_not_mail',
|
|
95
|
+
].includes(row.status)
|
|
96
|
+
) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
'ZeroBounce bulk verification returned a malformed verdict.',
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const key = emailKey(row.address);
|
|
102
|
+
if (!expected.has(key) || byEmail.has(key)) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
'ZeroBounce bulk verification returned unexpected or duplicate verdicts.',
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
byEmail.set(key, row);
|
|
108
|
+
}
|
|
109
|
+
return compiled.items.map((item) => {
|
|
110
|
+
const row = byEmail.get(emailKey(item.payload.email!));
|
|
111
|
+
if (!row)
|
|
112
|
+
throw new Error(
|
|
113
|
+
'ZeroBounce bulk verification omitted a requested email result.',
|
|
114
|
+
);
|
|
115
|
+
return { itemKey: item.itemKey, result: { data: row }, rawResult: row };
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const zerobounceBatchStrategies = defineBatchStrategyMap({
|
|
121
|
+
zerobounce_validate: zerobounceValidateBatchStrategy,
|
|
122
|
+
});
|
|
@@ -36,6 +36,8 @@ export type PlayArtifactCompatibility = {
|
|
|
36
36
|
toolResponseContract?: ToolResponseContract;
|
|
37
37
|
/** Missing preserves the receipt namespace of artifacts created before this revision existed. */
|
|
38
38
|
toolResponseReceiptRevision?: string;
|
|
39
|
+
/** Missing preserves Slack HITL's historical parked timeout behavior. */
|
|
40
|
+
slackHitlTimeoutOutcome?: 'error';
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
/** The only executable Play artifact contract. */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { tmpdir } from 'node:os';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import type { PlayBundlingAdapter } from './index';
|
|
4
|
+
import { discoverPackagedLocalFiles } from '../local-file-discovery';
|
|
5
|
+
|
|
6
|
+
/** Repository source bundling shared by the API and the deploy worker.
|
|
7
|
+
* Callers supply their repository root; cloud validation is an API adapter.
|
|
8
|
+
*/
|
|
9
|
+
export function createRepositoryPlayBundlingAdapter(options: {
|
|
10
|
+
projectRoot: string;
|
|
11
|
+
sourceIdentityRoot?: string;
|
|
12
|
+
}): PlayBundlingAdapter {
|
|
13
|
+
const sdkSourceRoot = resolve(options.projectRoot, 'packages', 'sdk', 'src');
|
|
14
|
+
return {
|
|
15
|
+
projectRoot: options.projectRoot,
|
|
16
|
+
sourceIdentityRoot: options.sourceIdentityRoot,
|
|
17
|
+
nodeModulesDir: resolve(options.projectRoot, 'node_modules'),
|
|
18
|
+
cacheDir: join(tmpdir(), 'deepline-play-artifacts-v37'),
|
|
19
|
+
sdkSourceRoot,
|
|
20
|
+
sdkPackageJson: resolve(sdkSourceRoot, '..', 'package.json'),
|
|
21
|
+
sdkEntryFile: resolve(sdkSourceRoot, 'index.ts'),
|
|
22
|
+
discoverPackagedLocalFiles,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded, durable read model for direct `ctx.runPlayAsync` descendants.
|
|
3
|
+
*
|
|
4
|
+
* A child belongs to an authored launch site through `launchKey`, not through
|
|
5
|
+
* its play name: one Play may be launched from several sites, and an async
|
|
6
|
+
* launch inside a fan-out has many independently progressing invocations.
|
|
7
|
+
* `invocationKey` is deliberately opaque; callers use its `runId` to drill
|
|
8
|
+
* into one actual Run instead of reconstructing an identity from input data.
|
|
9
|
+
*/
|
|
10
|
+
export type AsyncChildRunSummary = {
|
|
11
|
+
runId: string;
|
|
12
|
+
playName: string | null;
|
|
13
|
+
launchKey: string | null;
|
|
14
|
+
invocationKey: string | null;
|
|
15
|
+
rootBillingOwned: boolean;
|
|
16
|
+
status: string;
|
|
17
|
+
parentRunId: string | null;
|
|
18
|
+
rootRunId: string | null;
|
|
19
|
+
createdAt: number | null;
|
|
20
|
+
startedAt: number | null;
|
|
21
|
+
finishedAt: number | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type AsyncChildRunStatusCounts = {
|
|
25
|
+
total: number;
|
|
26
|
+
queued: number;
|
|
27
|
+
active: number;
|
|
28
|
+
waiting: number;
|
|
29
|
+
succeeded: number;
|
|
30
|
+
failed: number;
|
|
31
|
+
cancelled: number;
|
|
32
|
+
unknown: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type AsyncChildRunLaunchProjection = {
|
|
36
|
+
/** `null` is an older child run that predates durable authored attribution. */
|
|
37
|
+
launchKey: string | null;
|
|
38
|
+
playName: string | null;
|
|
39
|
+
counts: AsyncChildRunStatusCounts;
|
|
40
|
+
children: AsyncChildRunSummary[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type AsyncChildRunProjection = {
|
|
44
|
+
kind: 'async_child_runs';
|
|
45
|
+
/** Direct children returned by the bounded durable index read. */
|
|
46
|
+
returnedCount: number;
|
|
47
|
+
/** False means the displayed counts are a lower bound, never a fake total. */
|
|
48
|
+
complete: boolean;
|
|
49
|
+
counts: AsyncChildRunStatusCounts;
|
|
50
|
+
launches: AsyncChildRunLaunchProjection[];
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Wire guard for the bounded projection. Callers must never turn a partial
|
|
55
|
+
* response into an invented zero-child fanout.
|
|
56
|
+
*/
|
|
57
|
+
export function isAsyncChildRunProjection(
|
|
58
|
+
value: unknown,
|
|
59
|
+
): value is AsyncChildRunProjection {
|
|
60
|
+
if (!value || typeof value !== 'object') return false;
|
|
61
|
+
const candidate = value as Record<string, unknown>;
|
|
62
|
+
return (
|
|
63
|
+
candidate.kind === 'async_child_runs' &&
|
|
64
|
+
typeof candidate.returnedCount === 'number' &&
|
|
65
|
+
typeof candidate.complete === 'boolean' &&
|
|
66
|
+
Array.isArray(candidate.launches) &&
|
|
67
|
+
candidate.counts !== null &&
|
|
68
|
+
typeof candidate.counts === 'object'
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* New async children persist root-owned billing attribution at admission. Their
|
|
74
|
+
* execution facts are therefore already present in the root Run's billing
|
|
75
|
+
* query. Historic children have no such proof and retain the compatibility
|
|
76
|
+
* lookup rather than being silently undercounted.
|
|
77
|
+
*/
|
|
78
|
+
export function requiresLegacyChildBillingRead(input: {
|
|
79
|
+
billingRunId: string;
|
|
80
|
+
child: Pick<AsyncChildRunSummary, 'runId' | 'rootBillingOwned'>;
|
|
81
|
+
}): boolean {
|
|
82
|
+
return (
|
|
83
|
+
!input.child.rootBillingOwned && input.billingRunId !== input.child.runId
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const EMPTY_COUNTS = (): AsyncChildRunStatusCounts => ({
|
|
88
|
+
total: 0,
|
|
89
|
+
queued: 0,
|
|
90
|
+
active: 0,
|
|
91
|
+
waiting: 0,
|
|
92
|
+
succeeded: 0,
|
|
93
|
+
failed: 0,
|
|
94
|
+
cancelled: 0,
|
|
95
|
+
unknown: 0,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
function addStatus(counts: AsyncChildRunStatusCounts, status: string): void {
|
|
99
|
+
counts.total += 1;
|
|
100
|
+
switch (status.trim().toLowerCase()) {
|
|
101
|
+
case 'queued':
|
|
102
|
+
case 'pending':
|
|
103
|
+
case 'scheduled':
|
|
104
|
+
counts.queued += 1;
|
|
105
|
+
return;
|
|
106
|
+
case 'running':
|
|
107
|
+
case 'in_progress':
|
|
108
|
+
counts.active += 1;
|
|
109
|
+
return;
|
|
110
|
+
case 'waiting':
|
|
111
|
+
case 'suspended':
|
|
112
|
+
case 'awaiting_signal':
|
|
113
|
+
counts.waiting += 1;
|
|
114
|
+
return;
|
|
115
|
+
case 'completed':
|
|
116
|
+
case 'complete':
|
|
117
|
+
case 'succeeded':
|
|
118
|
+
case 'success':
|
|
119
|
+
counts.succeeded += 1;
|
|
120
|
+
return;
|
|
121
|
+
case 'failed':
|
|
122
|
+
case 'error':
|
|
123
|
+
counts.failed += 1;
|
|
124
|
+
return;
|
|
125
|
+
case 'cancelled':
|
|
126
|
+
case 'canceled':
|
|
127
|
+
case 'stopped':
|
|
128
|
+
counts.cancelled += 1;
|
|
129
|
+
return;
|
|
130
|
+
default:
|
|
131
|
+
counts.unknown += 1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Builds the one child-run representation shared by agent/API callers and UI.
|
|
137
|
+
* The input must already be sorted by newest child first; grouping preserves
|
|
138
|
+
* that order so a consumer can display recent child Runs without re-sorting.
|
|
139
|
+
*/
|
|
140
|
+
export function projectAsyncChildRuns(input: {
|
|
141
|
+
children: readonly AsyncChildRunSummary[];
|
|
142
|
+
complete: boolean;
|
|
143
|
+
}): AsyncChildRunProjection {
|
|
144
|
+
const counts = EMPTY_COUNTS();
|
|
145
|
+
const byLaunchKey = new Map<string, AsyncChildRunLaunchProjection>();
|
|
146
|
+
|
|
147
|
+
for (const child of input.children) {
|
|
148
|
+
addStatus(counts, child.status);
|
|
149
|
+
const mapKey = child.launchKey ?? '__unattributed_async_child__';
|
|
150
|
+
let launch = byLaunchKey.get(mapKey);
|
|
151
|
+
if (!launch) {
|
|
152
|
+
launch = {
|
|
153
|
+
launchKey: child.launchKey,
|
|
154
|
+
playName: child.playName,
|
|
155
|
+
counts: EMPTY_COUNTS(),
|
|
156
|
+
children: [],
|
|
157
|
+
};
|
|
158
|
+
byLaunchKey.set(mapKey, launch);
|
|
159
|
+
}
|
|
160
|
+
// A key is the authored site, so preserve the first (most-recent) name
|
|
161
|
+
// while still retaining exact identity on every child row.
|
|
162
|
+
if (!launch.playName && child.playName) launch.playName = child.playName;
|
|
163
|
+
addStatus(launch.counts, child.status);
|
|
164
|
+
launch.children.push(child);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
kind: 'async_child_runs',
|
|
169
|
+
returnedCount: input.children.length,
|
|
170
|
+
complete: input.complete,
|
|
171
|
+
counts,
|
|
172
|
+
launches: [...byLaunchKey.values()],
|
|
173
|
+
};
|
|
174
|
+
}
|
|
@@ -47,6 +47,8 @@ export type PlayContractCompatibilitySnapshot = {
|
|
|
47
47
|
toolResponseContract?: ToolResponseContract;
|
|
48
48
|
/** Legacy response metadata; it does not change completed-result caching. */
|
|
49
49
|
toolResponseReceiptRevision?: string;
|
|
50
|
+
/** Missing preserves Slack HITL's historical parked timeout behavior. */
|
|
51
|
+
slackHitlTimeoutOutcome?: 'error';
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
export type NormalizedPlayContractCompatibilitySnapshot =
|