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
|
@@ -1,556 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The canonical declaration is packages/monitors/monitor-fleet-limits.ts,
|
|
5
|
-
* which the Convex commit mutation reads to size its transaction. This package
|
|
6
|
-
* cannot import it: the workspace-architecture ratchet forbids NEW shared_libs
|
|
7
|
-
* imports from packages absolutely (only relocations of pre-existing edges
|
|
8
|
-
* pass CI), because shared_libs is being migrated into workspace packages.
|
|
9
|
-
* Until a monitors package exists, the two copies are held equal by
|
|
10
|
-
* tests/lib/monitors/monitor-fleet-limits-mirror.test.ts — change one without
|
|
11
|
-
* the other and that test names both files.
|
|
12
|
-
*/
|
|
13
|
-
export const MONITOR_FLEET_MAX_MEMBERS = 1_000;
|
|
14
|
-
|
|
15
|
-
export const MONITOR_FLEET_FRONTIER_MAX_ROWS = 10_000;
|
|
16
|
-
/**
|
|
17
|
-
* Fleet definitions are admitted once and executed many times. Keep the
|
|
18
|
-
* edition beside the definition just as Plays keep their authoring-contract
|
|
19
|
-
* edition: a future syntax change can add a reader without reinterpreting a
|
|
20
|
-
* stored Fleet under new rules.
|
|
21
|
-
*/
|
|
22
|
-
export const MONITOR_FLEET_AUTHORING_CONTRACT_EDITION = 1 as const;
|
|
23
|
-
export const SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS = [
|
|
24
|
-
MONITOR_FLEET_AUTHORING_CONTRACT_EDITION,
|
|
25
|
-
] as const;
|
|
26
|
-
|
|
27
|
-
export type MonitorFleetAuthoringContractEdition =
|
|
28
|
-
(typeof SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS)[number];
|
|
29
|
-
|
|
30
|
-
export const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = [
|
|
31
|
-
{
|
|
32
|
-
edition: 1,
|
|
33
|
-
changed:
|
|
34
|
-
'Initial Fleet JSON contract: bounded sticky table membership, one daily sync, and a seven-day removal grace.',
|
|
35
|
-
compatibilityOwner: 'Monitors Runtime',
|
|
36
|
-
newWritesEnd: null,
|
|
37
|
-
readerRemoval: null,
|
|
38
|
-
},
|
|
39
|
-
] as const;
|
|
40
|
-
/**
|
|
41
|
-
* Fleets are deliberately opinionated in beta: a member absent from the
|
|
42
|
-
* source remains intact for seven days, then its ordinary monitor is
|
|
43
|
-
* deactivated. This prevents transient source refreshes from deleting a
|
|
44
|
-
* provider resource while keeping the customer contract small.
|
|
45
|
-
*/
|
|
46
|
-
export const MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 60_000;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Public, machine-readable guidance for every Monitor Fleet authoring
|
|
50
|
-
* surface. SDK clients may render this directly; the CLI uses the same fixed
|
|
51
|
-
* policy values in its help rather than maintaining another contract.
|
|
52
|
-
*/
|
|
53
|
-
export const MONITOR_FLEET_DOCUMENTATION = {
|
|
54
|
-
summary:
|
|
55
|
-
'A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.',
|
|
56
|
-
authoredFields: {
|
|
57
|
-
id: 'Stable lowercase fleet id used by sync, get, and deactivate.',
|
|
58
|
-
source:
|
|
59
|
-
'Customer DB table, unique row key, and optional equality filters that select candidate rows.',
|
|
60
|
-
member:
|
|
61
|
-
'Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.',
|
|
62
|
-
selection:
|
|
63
|
-
'Deterministic ranking and an active-member limit between 1 and 1,000.',
|
|
64
|
-
},
|
|
65
|
-
fixedPolicy: {
|
|
66
|
-
cadence: 'daily',
|
|
67
|
-
membership: 'sticky',
|
|
68
|
-
removalGrace: '7d',
|
|
69
|
-
onRemoved: 'deactivate',
|
|
70
|
-
ownership:
|
|
71
|
-
'A Fleet may adopt a same-tool ordinary monitor with its deterministic member key. The first Fleet claim wins; another Fleet or a different tool receives a conflict.',
|
|
72
|
-
billing:
|
|
73
|
-
'No Fleet fee, permit, or renewal. Dry-run reports ordinary monitor lifecycle charges due now.',
|
|
74
|
-
},
|
|
75
|
-
stickyMembership:
|
|
76
|
-
'Ranking fills vacancies but never replaces a current member merely because another row ranks higher.',
|
|
77
|
-
columnExpression:
|
|
78
|
-
'Use { "$fleet": "column", "name": "column_name" } in a member key or payload to read a value from each source row.',
|
|
79
|
-
} as const;
|
|
80
|
-
|
|
81
|
-
export type MonitorFleetColumn = {
|
|
82
|
-
$fleet: 'column';
|
|
83
|
-
name: string;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export type MonitorFleetTemplate = {
|
|
87
|
-
$fleet: 'template';
|
|
88
|
-
parts: Array<string | MonitorFleetColumn>;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type MonitorFleetExpression = MonitorFleetColumn | MonitorFleetTemplate;
|
|
92
|
-
|
|
93
|
-
export type MonitorFleetDefinition = {
|
|
94
|
-
/** Stable lowercase fleet id, used by CLI and API lifecycle commands. */
|
|
95
|
-
id: string;
|
|
96
|
-
/** Customer DB rows that may become members. */
|
|
97
|
-
source: {
|
|
98
|
-
kind: 'customer_db_table';
|
|
99
|
-
schema: string;
|
|
100
|
-
table: string;
|
|
101
|
-
key: { column: string; type: 'text' | 'uuid' | 'int4' | 'int8' };
|
|
102
|
-
where?: Record<string, string | number | boolean | null>;
|
|
103
|
-
};
|
|
104
|
-
/** One ordinary monitor definition, evaluated once for each selected row. */
|
|
105
|
-
member: {
|
|
106
|
-
tool: string;
|
|
107
|
-
key: MonitorFleetTemplate;
|
|
108
|
-
payload: Record<string, unknown>;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Bounded deterministic candidate selection. Membership is intentionally
|
|
112
|
-
* sticky: ranking chooses vacant slots but does not replace existing members
|
|
113
|
-
* merely because another row's score changed.
|
|
114
|
-
*/
|
|
115
|
-
selection: {
|
|
116
|
-
limit: number;
|
|
117
|
-
orderBy: Array<{
|
|
118
|
-
column: string;
|
|
119
|
-
direction: 'asc' | 'desc';
|
|
120
|
-
}>;
|
|
121
|
-
membership: 'sticky';
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export type MonitorFleetContractIssue = {
|
|
126
|
-
path: string;
|
|
127
|
-
code: string;
|
|
128
|
-
message: string;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/** The durable, validated snapshot that a Fleet sync is allowed to execute. */
|
|
132
|
-
export type AdmittedMonitorFleetAuthoringContract = {
|
|
133
|
-
edition: MonitorFleetAuthoringContractEdition;
|
|
134
|
-
definition: MonitorFleetDefinition;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export type MonitorFleetAuthoringContractResult = {
|
|
138
|
-
valid: boolean;
|
|
139
|
-
contract?: AdmittedMonitorFleetAuthoringContract;
|
|
140
|
-
issues: MonitorFleetContractIssue[];
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
function record(value: unknown): Record<string, unknown> | null {
|
|
144
|
-
return value && typeof value === 'object' && !Array.isArray(value)
|
|
145
|
-
? (value as Record<string, unknown>)
|
|
146
|
-
: null;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function identifier(value: unknown): value is string {
|
|
150
|
-
return typeof value === 'string' && /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function exactKeys(
|
|
154
|
-
input: Record<string, unknown> | null,
|
|
155
|
-
keys: readonly string[],
|
|
156
|
-
path: string,
|
|
157
|
-
issues: MonitorFleetContractIssue[],
|
|
158
|
-
): void {
|
|
159
|
-
if (!input) return;
|
|
160
|
-
for (const key of Object.keys(input)) {
|
|
161
|
-
if (keys.includes(key)) continue;
|
|
162
|
-
issues.push({
|
|
163
|
-
path: path ? `${path}.${key}` : key,
|
|
164
|
-
code: 'unknown_fleet_field',
|
|
165
|
-
message: `${path || 'Fleet'} does not accept '${key}'.`,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function jsonValue(
|
|
171
|
-
value: unknown,
|
|
172
|
-
path: string,
|
|
173
|
-
issues: MonitorFleetContractIssue[],
|
|
174
|
-
): void {
|
|
175
|
-
if (
|
|
176
|
-
value === null ||
|
|
177
|
-
typeof value === 'string' ||
|
|
178
|
-
typeof value === 'boolean' ||
|
|
179
|
-
(typeof value === 'number' && Number.isFinite(value))
|
|
180
|
-
) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
if (Array.isArray(value)) {
|
|
184
|
-
value.forEach((item, index) => jsonValue(item, `${path}.${index}`, issues));
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
const input = record(value);
|
|
188
|
-
if (!input) {
|
|
189
|
-
issues.push({
|
|
190
|
-
path,
|
|
191
|
-
code: 'invalid_fleet_json_value',
|
|
192
|
-
message: 'Fleet payload values must be JSON values.',
|
|
193
|
-
});
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
for (const [key, item] of Object.entries(input)) {
|
|
197
|
-
jsonValue(item, `${path}.${key}`, issues);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export function fleetColumn(name: string): MonitorFleetColumn {
|
|
202
|
-
if (!identifier(name)) throw new Error(`Invalid fleet column '${name}'.`);
|
|
203
|
-
return { $fleet: 'column', name };
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export function fleetKey(
|
|
207
|
-
...parts: Array<string | MonitorFleetColumn>
|
|
208
|
-
): MonitorFleetTemplate {
|
|
209
|
-
if (parts.length === 0)
|
|
210
|
-
throw new Error('A fleet key needs at least one part.');
|
|
211
|
-
return { $fleet: 'template', parts };
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export function defineMonitorFleet<const T extends MonitorFleetDefinition>(
|
|
215
|
-
definition: T,
|
|
216
|
-
): T {
|
|
217
|
-
return definition;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function validateExpression(
|
|
221
|
-
value: unknown,
|
|
222
|
-
path: string,
|
|
223
|
-
issues: MonitorFleetContractIssue[],
|
|
224
|
-
): void {
|
|
225
|
-
const input = record(value);
|
|
226
|
-
if (!input || input.$fleet !== 'column' || !identifier(input.name)) {
|
|
227
|
-
issues.push({
|
|
228
|
-
path,
|
|
229
|
-
code: 'invalid_fleet_expression',
|
|
230
|
-
message: 'Fleet expressions must be an exact tagged column reference.',
|
|
231
|
-
});
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
exactKeys(input, ['$fleet', 'name'], path, issues);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function walkPayload(
|
|
238
|
-
value: unknown,
|
|
239
|
-
path: string,
|
|
240
|
-
issues: MonitorFleetContractIssue[],
|
|
241
|
-
): void {
|
|
242
|
-
if (Array.isArray(value)) {
|
|
243
|
-
value.forEach((item, index) =>
|
|
244
|
-
walkPayload(item, `${path}.${index}`, issues),
|
|
245
|
-
);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
const input = record(value);
|
|
249
|
-
if (!input) return;
|
|
250
|
-
if ('$fleet' in input) {
|
|
251
|
-
validateExpression(input, path, issues);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
for (const [key, item] of Object.entries(input)) {
|
|
255
|
-
walkPayload(item, `${path}.${key}`, issues);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export function validateMonitorFleetDefinition(value: unknown): {
|
|
260
|
-
valid: boolean;
|
|
261
|
-
definition?: MonitorFleetDefinition;
|
|
262
|
-
issues: MonitorFleetContractIssue[];
|
|
263
|
-
} {
|
|
264
|
-
const issues: MonitorFleetContractIssue[] = [];
|
|
265
|
-
const input = record(value);
|
|
266
|
-
if (!input) {
|
|
267
|
-
return {
|
|
268
|
-
valid: false,
|
|
269
|
-
issues: [
|
|
270
|
-
{
|
|
271
|
-
path: '',
|
|
272
|
-
code: 'invalid_fleet',
|
|
273
|
-
message: 'Fleet must be an object.',
|
|
274
|
-
},
|
|
275
|
-
],
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
exactKeys(input, ['id', 'source', 'member', 'selection'], '', issues);
|
|
279
|
-
if (
|
|
280
|
-
typeof input.id !== 'string' ||
|
|
281
|
-
!/^[a-z][a-z0-9-]{0,199}$/.test(input.id)
|
|
282
|
-
) {
|
|
283
|
-
issues.push({
|
|
284
|
-
path: 'id',
|
|
285
|
-
code: 'invalid_fleet_id',
|
|
286
|
-
message: 'Fleet id must be lowercase kebab-case.',
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
const source = record(input.source);
|
|
290
|
-
exactKeys(
|
|
291
|
-
source,
|
|
292
|
-
['kind', 'schema', 'table', 'key', 'where'],
|
|
293
|
-
'source',
|
|
294
|
-
issues,
|
|
295
|
-
);
|
|
296
|
-
if (!source || source.kind !== 'customer_db_table') {
|
|
297
|
-
issues.push({
|
|
298
|
-
path: 'source.kind',
|
|
299
|
-
code: 'invalid_fleet_source',
|
|
300
|
-
message: 'Beta fleets require customer_db_table.',
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
if (!identifier(source?.schema) || !identifier(source?.table)) {
|
|
304
|
-
issues.push({
|
|
305
|
-
path: 'source',
|
|
306
|
-
code: 'invalid_fleet_table',
|
|
307
|
-
message: 'Source schema and table must be SQL identifiers.',
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
const sourceKey = record(source?.key);
|
|
311
|
-
exactKeys(sourceKey, ['column', 'type'], 'source.key', issues);
|
|
312
|
-
if (
|
|
313
|
-
!sourceKey ||
|
|
314
|
-
!identifier(sourceKey.column) ||
|
|
315
|
-
!['text', 'uuid', 'int4', 'int8'].includes(String(sourceKey.type))
|
|
316
|
-
) {
|
|
317
|
-
issues.push({
|
|
318
|
-
path: 'source.key',
|
|
319
|
-
code: 'invalid_fleet_source_key',
|
|
320
|
-
message: 'Source key must name a supported typed column.',
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
if (source?.where !== undefined) {
|
|
324
|
-
const where = record(source.where);
|
|
325
|
-
if (!where) {
|
|
326
|
-
issues.push({
|
|
327
|
-
path: 'source.where',
|
|
328
|
-
code: 'invalid_fleet_where',
|
|
329
|
-
message: 'source.where must be an object of equality values.',
|
|
330
|
-
});
|
|
331
|
-
} else {
|
|
332
|
-
for (const [column, expected] of Object.entries(where)) {
|
|
333
|
-
if (!identifier(column)) {
|
|
334
|
-
issues.push({
|
|
335
|
-
path: `source.where.${column}`,
|
|
336
|
-
code: 'invalid_fleet_where_column',
|
|
337
|
-
message: 'source.where keys must be SQL identifiers.',
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
if (
|
|
341
|
-
expected !== null &&
|
|
342
|
-
typeof expected !== 'string' &&
|
|
343
|
-
typeof expected !== 'boolean' &&
|
|
344
|
-
!(typeof expected === 'number' && Number.isFinite(expected))
|
|
345
|
-
) {
|
|
346
|
-
issues.push({
|
|
347
|
-
path: `source.where.${column}`,
|
|
348
|
-
code: 'invalid_fleet_where_value',
|
|
349
|
-
message: 'source.where values must be finite JSON scalars or null.',
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
const member = record(input.member);
|
|
356
|
-
exactKeys(member, ['tool', 'key', 'payload'], 'member', issues);
|
|
357
|
-
const key = record(member?.key);
|
|
358
|
-
if (!member || typeof member.tool !== 'string' || !member.tool.trim()) {
|
|
359
|
-
issues.push({
|
|
360
|
-
path: 'member.tool',
|
|
361
|
-
code: 'invalid_fleet_tool',
|
|
362
|
-
message: 'Member tool is required.',
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
if (
|
|
366
|
-
!key ||
|
|
367
|
-
key.$fleet !== 'template' ||
|
|
368
|
-
!Array.isArray(key.parts) ||
|
|
369
|
-
key.parts.length === 0
|
|
370
|
-
) {
|
|
371
|
-
issues.push({
|
|
372
|
-
path: 'member.key',
|
|
373
|
-
code: 'invalid_fleet_key',
|
|
374
|
-
message: 'Member key must be a tagged fleet template.',
|
|
375
|
-
});
|
|
376
|
-
} else {
|
|
377
|
-
exactKeys(key, ['$fleet', 'parts'], 'member.key', issues);
|
|
378
|
-
for (const [index, part] of key.parts.entries()) {
|
|
379
|
-
if (typeof part !== 'string')
|
|
380
|
-
validateExpression(part, `member.key.parts.${index}`, issues);
|
|
381
|
-
}
|
|
382
|
-
if (
|
|
383
|
-
sourceKey &&
|
|
384
|
-
!key.parts.some(
|
|
385
|
-
(part) =>
|
|
386
|
-
record(part)?.$fleet === 'column' &&
|
|
387
|
-
record(part)?.name === sourceKey.column,
|
|
388
|
-
)
|
|
389
|
-
) {
|
|
390
|
-
issues.push({
|
|
391
|
-
path: 'member.key.parts',
|
|
392
|
-
code: 'fleet_key_missing_source_key',
|
|
393
|
-
message: 'Member key must include the source key column.',
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
if (!member || !('payload' in member)) {
|
|
398
|
-
issues.push({
|
|
399
|
-
path: 'member.payload',
|
|
400
|
-
code: 'invalid_fleet_payload',
|
|
401
|
-
message: 'Member payload is required.',
|
|
402
|
-
});
|
|
403
|
-
} else {
|
|
404
|
-
jsonValue(member.payload, 'member.payload', issues);
|
|
405
|
-
}
|
|
406
|
-
walkPayload(member?.payload, 'member.payload', issues);
|
|
407
|
-
const selection = record(input.selection);
|
|
408
|
-
exactKeys(selection, ['limit', 'orderBy', 'membership'], 'selection', issues);
|
|
409
|
-
if (
|
|
410
|
-
!selection ||
|
|
411
|
-
!Number.isSafeInteger(selection.limit) ||
|
|
412
|
-
Number(selection.limit) < 1 ||
|
|
413
|
-
Number(selection.limit) > MONITOR_FLEET_MAX_MEMBERS
|
|
414
|
-
) {
|
|
415
|
-
issues.push({
|
|
416
|
-
path: 'selection.limit',
|
|
417
|
-
code: 'MONITOR_FLEET_LIMIT_EXCEEDED',
|
|
418
|
-
message: 'selection.limit must be between 1 and 1,000.',
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
if (selection?.membership !== 'sticky') {
|
|
422
|
-
issues.push({
|
|
423
|
-
path: 'selection.membership',
|
|
424
|
-
code: 'invalid_fleet_membership',
|
|
425
|
-
message: `Fleet membership is fixed to ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.membership}. ${MONITOR_FLEET_DOCUMENTATION.stickyMembership}`,
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
const orderBy = selection?.orderBy;
|
|
429
|
-
if (!Array.isArray(orderBy) || orderBy.length === 0) {
|
|
430
|
-
issues.push({
|
|
431
|
-
path: 'selection.orderBy',
|
|
432
|
-
code: 'invalid_fleet_order',
|
|
433
|
-
message: 'At least one deterministic order field is required.',
|
|
434
|
-
});
|
|
435
|
-
} else {
|
|
436
|
-
const orderColumns = new Set<string>();
|
|
437
|
-
for (const [index, order] of orderBy.entries()) {
|
|
438
|
-
const item = record(order);
|
|
439
|
-
exactKeys(
|
|
440
|
-
item,
|
|
441
|
-
['column', 'direction'],
|
|
442
|
-
`selection.orderBy.${index}`,
|
|
443
|
-
issues,
|
|
444
|
-
);
|
|
445
|
-
if (
|
|
446
|
-
!item ||
|
|
447
|
-
!identifier(item.column) ||
|
|
448
|
-
!['asc', 'desc'].includes(String(item.direction))
|
|
449
|
-
) {
|
|
450
|
-
issues.push({
|
|
451
|
-
path: `selection.orderBy.${index}`,
|
|
452
|
-
code: 'invalid_fleet_order',
|
|
453
|
-
message: 'Order fields need a column and asc/desc direction.',
|
|
454
|
-
});
|
|
455
|
-
} else if (orderColumns.has(item.column as string)) {
|
|
456
|
-
issues.push({
|
|
457
|
-
path: `selection.orderBy.${index}.column`,
|
|
458
|
-
code: 'duplicate_fleet_order_column',
|
|
459
|
-
message: 'Each selection order column may appear only once.',
|
|
460
|
-
});
|
|
461
|
-
} else {
|
|
462
|
-
orderColumns.add(item.column as string);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
if (sourceKey && record(orderBy.at(-1))?.column !== sourceKey.column) {
|
|
466
|
-
issues.push({
|
|
467
|
-
path: 'selection.orderBy',
|
|
468
|
-
code: 'fleet_order_missing_key',
|
|
469
|
-
message: 'The final order field must be the source key.',
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
for (const removedOption of ['spendLimits', 'lifecycle', 'reconciliation']) {
|
|
474
|
-
if (removedOption in input) {
|
|
475
|
-
issues.push({
|
|
476
|
-
path: removedOption,
|
|
477
|
-
code: 'unsupported_fleet_option',
|
|
478
|
-
message:
|
|
479
|
-
`${removedOption} is fixed by Monitor Fleets and must be omitted. ` +
|
|
480
|
-
`Fleets sync ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved} members after ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.removalGrace} absent from the source.`,
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
return issues.length === 0
|
|
485
|
-
? { valid: true, definition: value as MonitorFleetDefinition, issues }
|
|
486
|
-
: { valid: false, issues };
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Compile JSON into the exact authoring snapshot persisted by a Fleet. This
|
|
491
|
-
* does not inspect the Customer DB or provider; use
|
|
492
|
-
* `fleets sync --file <fleet.json> --dry-run` for that environment-aware
|
|
493
|
-
* preflight, which returns the real plan and the credits due.
|
|
494
|
-
*/
|
|
495
|
-
export function admitMonitorFleetAuthoringContract(
|
|
496
|
-
value: unknown,
|
|
497
|
-
edition: number = MONITOR_FLEET_AUTHORING_CONTRACT_EDITION,
|
|
498
|
-
): MonitorFleetAuthoringContractResult {
|
|
499
|
-
if (
|
|
500
|
-
!SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS.includes(
|
|
501
|
-
edition as MonitorFleetAuthoringContractEdition,
|
|
502
|
-
)
|
|
503
|
-
) {
|
|
504
|
-
return {
|
|
505
|
-
valid: false,
|
|
506
|
-
issues: [
|
|
507
|
-
{
|
|
508
|
-
path: 'authoring_contract_edition',
|
|
509
|
-
code: 'unsupported_fleet_authoring_contract_edition',
|
|
510
|
-
message: `Monitor Fleet authoring contract edition ${edition} is not supported.`,
|
|
511
|
-
},
|
|
512
|
-
],
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
const result = validateMonitorFleetDefinition(value);
|
|
516
|
-
return result.valid && result.definition
|
|
517
|
-
? {
|
|
518
|
-
valid: true,
|
|
519
|
-
contract: {
|
|
520
|
-
edition: edition as MonitorFleetAuthoringContractEdition,
|
|
521
|
-
// JSON cloning prevents later caller mutation from changing the
|
|
522
|
-
// admitted snapshot.
|
|
523
|
-
definition: JSON.parse(
|
|
524
|
-
JSON.stringify(result.definition),
|
|
525
|
-
) as MonitorFleetDefinition,
|
|
526
|
-
},
|
|
527
|
-
issues: [],
|
|
528
|
-
}
|
|
529
|
-
: { valid: false, issues: result.issues };
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
export function evaluateMonitorFleetValue(
|
|
533
|
-
value: unknown,
|
|
534
|
-
row: Record<string, unknown>,
|
|
535
|
-
): unknown {
|
|
536
|
-
if (Array.isArray(value))
|
|
537
|
-
return value.map((item) => evaluateMonitorFleetValue(item, row));
|
|
538
|
-
const input = record(value);
|
|
539
|
-
if (!input) return value;
|
|
540
|
-
if (input.$fleet === 'column') return row[String(input.name)];
|
|
541
|
-
if (input.$fleet === 'template' && Array.isArray(input.parts)) {
|
|
542
|
-
return input.parts
|
|
543
|
-
.map((part) =>
|
|
544
|
-
typeof part === 'string'
|
|
545
|
-
? part
|
|
546
|
-
: String(evaluateMonitorFleetValue(part, row) ?? ''),
|
|
547
|
-
)
|
|
548
|
-
.join('');
|
|
549
|
-
}
|
|
550
|
-
return Object.fromEntries(
|
|
551
|
-
Object.entries(input).map(([key, item]) => [
|
|
552
|
-
key,
|
|
553
|
-
evaluateMonitorFleetValue(item, row),
|
|
554
|
-
]),
|
|
555
|
-
);
|
|
556
|
-
}
|
|
1
|
+
// Preserve the published SDK entrypoint; the shared contract has one owner.
|
|
2
|
+
export * from '../../shared_libs/integration-contracts/monitor-fleet-contract';
|
|
@@ -17,7 +17,7 @@ export {
|
|
|
17
17
|
fleetColumn,
|
|
18
18
|
fleetKey,
|
|
19
19
|
validateMonitorFleetDefinition,
|
|
20
|
-
} from '
|
|
20
|
+
} from '../../shared_libs/integration-contracts/monitor-fleet-contract';
|
|
21
21
|
|
|
22
22
|
export type {
|
|
23
23
|
AdmittedMonitorFleetAuthoringContract,
|
|
@@ -28,4 +28,4 @@ export type {
|
|
|
28
28
|
MonitorFleetDefinition,
|
|
29
29
|
MonitorFleetExpression,
|
|
30
30
|
MonitorFleetTemplate,
|
|
31
|
-
} from '
|
|
31
|
+
} from '../../shared_libs/integration-contracts/monitor-fleet-contract';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Walk bounded cursor pages without reporting a partial result as complete. */
|
|
2
|
+
export async function* iterateCursorPages<T>(
|
|
3
|
+
fetchPage: (cursor: string | null) => Promise<{
|
|
4
|
+
items: T[];
|
|
5
|
+
hasMore: boolean;
|
|
6
|
+
cursor: string | null;
|
|
7
|
+
}>,
|
|
8
|
+
): AsyncGenerator<T[]> {
|
|
9
|
+
let cursor: string | null = null;
|
|
10
|
+
const seen = new Set<string>();
|
|
11
|
+
for (;;) {
|
|
12
|
+
const page = await fetchPage(cursor);
|
|
13
|
+
if (page.hasMore) {
|
|
14
|
+
if (!page.cursor || seen.has(page.cursor)) {
|
|
15
|
+
throw new Error(
|
|
16
|
+
'Pagination reported more results without an advancing cursor',
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
seen.add(page.cursor);
|
|
20
|
+
}
|
|
21
|
+
yield page.items;
|
|
22
|
+
if (!page.hasMore) return;
|
|
23
|
+
cursor = page.cursor;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -89,7 +89,7 @@ let hasWarnedAboutNonDevelopmentBundling = false;
|
|
|
89
89
|
* Tool-aware validation belongs to the Deepline API after upload:
|
|
90
90
|
* `compilePlayManifest` / server preflight runs the cloud typechecker inside
|
|
91
91
|
* the app deployment, where the generated catalog is a normal build artifact.
|
|
92
|
-
* Do not import `src/lib/plays/cloud-tool-typecheck` or any generated app
|
|
92
|
+
* Do not import `apps/deepline-api/src/lib/plays/cloud-tool-typecheck` or any generated app
|
|
93
93
|
* catalog from this SDK adapter.
|
|
94
94
|
*/
|
|
95
95
|
function warnAboutNonDevelopmentBundling(filePath: string): void {
|
|
@@ -23,12 +23,12 @@ import { CURRENT_PLAY_ARTIFACT_CONTRACT_VERSION } from '../../shared_libs/plays/
|
|
|
23
23
|
* Everything else derives from these values:
|
|
24
24
|
*
|
|
25
25
|
* - `packages/sdk/src/version.ts` re-exports `SDK_VERSION` and `SDK_API_CONTRACT`.
|
|
26
|
-
* - `src/lib/sdk/release-policy.ts` re-exports `SDK_RELEASE_POLICY`.
|
|
26
|
+
* - `apps/deepline-api/src/lib/sdk/release-policy.ts` re-exports `SDK_RELEASE_POLICY`.
|
|
27
27
|
* - `packages/sdk/package.json` `version` is stamped from `SDK_RELEASE.version` by
|
|
28
28
|
* `scripts/sync-sdk-package-version.ts`, which runs as part of
|
|
29
29
|
* `bun run sdk:build`.
|
|
30
30
|
* - `contracts/sdk-api.manifest.json` is regenerated at build time from
|
|
31
|
-
* `src/lib/sdk/api-routes.ts` and the apiContract here; the matching
|
|
31
|
+
* `apps/deepline-api/src/lib/sdk/api-routes.ts` and the apiContract here; the matching
|
|
32
32
|
* `contracts/sdk-api.manifest.hash` is an ignored local/CI audit artifact.
|
|
33
33
|
*
|
|
34
34
|
* Any drift between release source and derived release locations is a
|
|
@@ -199,21 +199,23 @@ export const SDK_RELEASE = {
|
|
|
199
199
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
|
-
|
|
202
|
+
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
203
|
+
version: '0.3.91',
|
|
203
204
|
updateSummary:
|
|
204
|
-
'Automatic CLI updates are
|
|
205
|
+
'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
|
|
205
206
|
packageCapabilities: {
|
|
206
207
|
updatePreferences: 1,
|
|
207
208
|
},
|
|
208
209
|
contracts: {
|
|
209
210
|
api: {
|
|
210
211
|
name: 'sdk-http-api',
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
currentMajor:
|
|
214
|
-
supportedMajors: [2],
|
|
215
|
-
//
|
|
212
|
+
// Concise Play grep has the current wire id. Older ids follow the
|
|
213
|
+
// standard API support window.
|
|
214
|
+
currentMajor: 3,
|
|
215
|
+
supportedMajors: [3, 2],
|
|
216
|
+
// Older ids remain subject to the API support window.
|
|
216
217
|
legacyWireIds: [
|
|
218
|
+
'2026-09-play-grep-concise-results',
|
|
217
219
|
'2026-07-admin-cli-local-cutover',
|
|
218
220
|
'2026-07-native-monitor-launch-hard-cutover',
|
|
219
221
|
],
|