deepline 0.3.88 → 0.3.90
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 +652 -39
- package/dist/bundling-sources/sdk/src/config.ts +77 -0
- package/dist/bundling-sources/sdk/src/http.ts +76 -30
- package/dist/bundling-sources/sdk/src/index.ts +10 -0
- package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
- package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
- package/dist/bundling-sources/sdk/src/play.ts +15 -1
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +3 -3
- package/dist/bundling-sources/sdk/src/release.ts +16 -9
- package/dist/bundling-sources/sdk/src/types.ts +106 -4
- package/dist/bundling-sources/shared_libs/integration-contracts/AGENTS.md +9 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/README.md +3 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/index.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-install-guides.ts +77 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/charges.ts +125 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +686 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +54 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +72 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/session.ts +45 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +454 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +260 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +215 -0
- package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +333 -0
- package/dist/bundling-sources/shared_libs/monitors/cursor-page.ts +42 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/framework-managed-payload-fields.ts +71 -0
- package/dist/bundling-sources/shared_libs/monitors/generated/provider-monitor-callback-admission-targets.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +270 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +39 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +82 -0
- package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +471 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/package.json +36 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +1125 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +305 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +964 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +56 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +131 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +535 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-priority-execution.ts +56 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-runtime-read-eligibility.ts +38 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-status.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +112 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +300 -0
- package/dist/bundling-sources/shared_libs/monitors/quickstart-prompts.ts +22 -0
- 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 +93 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +332 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +221 -0
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +105 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +73 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +81 -0
- package/dist/bundling-sources/shared_libs/monitors/tsconfig.json +10 -0
- 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 +654 -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/activity-observation.ts +6 -11
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +135 -12
- 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 +77 -0
- package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
- package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1159 -166
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +103 -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/default-batch-strategies.ts +20 -1
- 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 +29 -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 +7 -1
- 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/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 +189 -0
- 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/play-runtime-semantics.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +4 -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 +23 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +90 -13
- 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-start-admission.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +21 -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 -43
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +67 -213
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +12 -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 +38 -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 +37 -1
- 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/tool-http-errors.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -1
- 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/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 +8 -3
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +454 -17
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +8 -14
- package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
- package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/email-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
- package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
- 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/slack-hitl-timeout-error.ts +37 -0
- package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +50 -15
- package/dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts +2 -2
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +566 -0
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +60 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
- package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
- package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
- 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/product-notifications/workspace.ts +38 -0
- package/dist/bundling-sources/shared_libs/runtime-env.ts +12 -0
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
- package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +35 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +267 -0
- 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 +1611 -453
- package/dist/cli/index.mjs +1596 -447
- package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-BaJfE-5H.d.mts} +136 -10
- package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-BaJfE-5H.d.ts} +136 -10
- package/dist/index.d.mts +910 -155
- package/dist/index.d.ts +910 -155
- package/dist/index.js +550 -64
- package/dist/index.mjs +550 -64
- package/dist/install-integrity.json +193 -4
- package/dist/monitor-fleet-contract.d.mts +138 -0
- package/dist/monitor-fleet-contract.d.ts +138 -0
- package/dist/monitor-fleet-contract.js +404 -0
- package/dist/monitor-fleet-contract.mjs +367 -0
- package/dist/plays/bundle-play-file.d.mts +8 -3
- package/dist/plays/bundle-play-file.d.ts +8 -3
- package/dist/plays/bundle-play-file.mjs +100 -20
- package/dist/release.d.mts +255 -0
- package/dist/release.d.ts +255 -0
- package/dist/release.js +215 -0
- package/dist/release.mjs +188 -0
- package/package.json +23 -4
- /package/dist/bundling-sources/shared_libs/{integrations/bettercontact-execution-policy.ts → integration-contracts/bettercontact/execution-policy.ts} +0 -0
- /package/dist/bundling-sources/shared_libs/{integrations/theirstack-execution-policy.ts → integration-contracts/theirstack/execution-policy.ts} +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/// <reference path="./text-imports.d.ts" />
|
|
2
|
+
/**
|
|
3
|
+
* The fleet member ceiling, mirrored — deliberately a literal.
|
|
4
|
+
*
|
|
5
|
+
* The canonical declaration is packages/monitors/monitor-fleet-limits.ts,
|
|
6
|
+
* which the Convex commit mutation reads to size its transaction. This package
|
|
7
|
+
* cannot import it: the workspace-architecture ratchet forbids NEW shared_libs
|
|
8
|
+
* imports from packages absolutely (only relocations of pre-existing edges
|
|
9
|
+
* pass CI), because shared_libs is being migrated into workspace packages.
|
|
10
|
+
* Until a monitors package exists, the two copies are held equal by
|
|
11
|
+
* tests/lib/monitors/monitor-fleet-limits-mirror.test.ts — change one without
|
|
12
|
+
* the other and that test names both files.
|
|
13
|
+
*/
|
|
14
|
+
declare const MONITOR_FLEET_MAX_MEMBERS = 1000;
|
|
15
|
+
declare const MONITOR_FLEET_FRONTIER_MAX_ROWS = 10000;
|
|
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
|
+
declare const MONITOR_FLEET_AUTHORING_CONTRACT_EDITION: 1;
|
|
23
|
+
declare const SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS: readonly [1];
|
|
24
|
+
type MonitorFleetAuthoringContractEdition = (typeof SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS)[number];
|
|
25
|
+
declare const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG: readonly [{
|
|
26
|
+
readonly edition: 1;
|
|
27
|
+
readonly changed: "Initial Fleet JSON contract: bounded sticky table membership, one daily sync, and a seven-day removal grace.";
|
|
28
|
+
readonly compatibilityOwner: "Monitors Runtime";
|
|
29
|
+
readonly newWritesEnd: null;
|
|
30
|
+
readonly readerRemoval: null;
|
|
31
|
+
}];
|
|
32
|
+
/**
|
|
33
|
+
* Fleets are deliberately opinionated in beta: a member absent from the
|
|
34
|
+
* source remains intact for seven days, then its ordinary monitor is
|
|
35
|
+
* deactivated. This prevents transient source refreshes from deleting a
|
|
36
|
+
* provider resource while keeping the customer contract small.
|
|
37
|
+
*/
|
|
38
|
+
declare const MONITOR_FLEET_REMOVAL_GRACE_MS: number;
|
|
39
|
+
/**
|
|
40
|
+
* Public, machine-readable guidance for every Monitor Fleet authoring
|
|
41
|
+
* surface. SDK clients may render this directly; the CLI uses the same fixed
|
|
42
|
+
* policy values in its help rather than maintaining another contract.
|
|
43
|
+
*/
|
|
44
|
+
declare const MONITOR_FLEET_DOCUMENTATION: {
|
|
45
|
+
readonly summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.";
|
|
46
|
+
readonly authoredFields: {
|
|
47
|
+
readonly id: "Stable lowercase fleet id used by sync, get, and deactivate.";
|
|
48
|
+
readonly source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.";
|
|
49
|
+
readonly member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.";
|
|
50
|
+
readonly selection: "Deterministic ranking and an active-member limit between 1 and 1,000.";
|
|
51
|
+
};
|
|
52
|
+
readonly fixedPolicy: {
|
|
53
|
+
readonly cadence: "daily";
|
|
54
|
+
readonly membership: "sticky";
|
|
55
|
+
readonly removalGrace: "7d";
|
|
56
|
+
readonly onRemoved: "deactivate";
|
|
57
|
+
readonly ownership: "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.";
|
|
58
|
+
readonly billing: "No Fleet fee, permit, or renewal. Dry-run reports ordinary monitor lifecycle charges due now.";
|
|
59
|
+
};
|
|
60
|
+
readonly stickyMembership: "Ranking fills vacancies but never replaces a current member merely because another row ranks higher.";
|
|
61
|
+
readonly columnExpression: "Use { \"$fleet\": \"column\", \"name\": \"column_name\" } in a member key or payload to read a value from each source row.";
|
|
62
|
+
};
|
|
63
|
+
type MonitorFleetColumn = {
|
|
64
|
+
$fleet: 'column';
|
|
65
|
+
name: string;
|
|
66
|
+
};
|
|
67
|
+
type MonitorFleetTemplate = {
|
|
68
|
+
$fleet: 'template';
|
|
69
|
+
parts: Array<string | MonitorFleetColumn>;
|
|
70
|
+
};
|
|
71
|
+
type MonitorFleetExpression = MonitorFleetColumn | MonitorFleetTemplate;
|
|
72
|
+
type MonitorFleetDefinition = {
|
|
73
|
+
/** Stable lowercase fleet id, used by CLI and API lifecycle commands. */
|
|
74
|
+
id: string;
|
|
75
|
+
/** Customer DB rows that may become members. */
|
|
76
|
+
source: {
|
|
77
|
+
kind: 'customer_db_table';
|
|
78
|
+
schema: string;
|
|
79
|
+
table: string;
|
|
80
|
+
key: {
|
|
81
|
+
column: string;
|
|
82
|
+
type: 'text' | 'uuid' | 'int4' | 'int8';
|
|
83
|
+
};
|
|
84
|
+
where?: Record<string, string | number | boolean | null>;
|
|
85
|
+
};
|
|
86
|
+
/** One ordinary monitor definition, evaluated once for each selected row. */
|
|
87
|
+
member: {
|
|
88
|
+
tool: string;
|
|
89
|
+
key: MonitorFleetTemplate;
|
|
90
|
+
payload: Record<string, unknown>;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Bounded deterministic candidate selection. Membership is intentionally
|
|
94
|
+
* sticky: ranking chooses vacant slots but does not replace existing members
|
|
95
|
+
* merely because another row's score changed.
|
|
96
|
+
*/
|
|
97
|
+
selection: {
|
|
98
|
+
limit: number;
|
|
99
|
+
orderBy: Array<{
|
|
100
|
+
column: string;
|
|
101
|
+
direction: 'asc' | 'desc';
|
|
102
|
+
}>;
|
|
103
|
+
membership: 'sticky';
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
type MonitorFleetContractIssue = {
|
|
107
|
+
path: string;
|
|
108
|
+
code: string;
|
|
109
|
+
message: string;
|
|
110
|
+
};
|
|
111
|
+
/** The durable, validated snapshot that a Fleet sync is allowed to execute. */
|
|
112
|
+
type AdmittedMonitorFleetAuthoringContract = {
|
|
113
|
+
edition: MonitorFleetAuthoringContractEdition;
|
|
114
|
+
definition: MonitorFleetDefinition;
|
|
115
|
+
};
|
|
116
|
+
type MonitorFleetAuthoringContractResult = {
|
|
117
|
+
valid: boolean;
|
|
118
|
+
contract?: AdmittedMonitorFleetAuthoringContract;
|
|
119
|
+
issues: MonitorFleetContractIssue[];
|
|
120
|
+
};
|
|
121
|
+
declare function fleetColumn(name: string): MonitorFleetColumn;
|
|
122
|
+
declare function fleetKey(...parts: Array<string | MonitorFleetColumn>): MonitorFleetTemplate;
|
|
123
|
+
declare function defineMonitorFleet<const T extends MonitorFleetDefinition>(definition: T): T;
|
|
124
|
+
declare function validateMonitorFleetDefinition(value: unknown): {
|
|
125
|
+
valid: boolean;
|
|
126
|
+
definition?: MonitorFleetDefinition;
|
|
127
|
+
issues: MonitorFleetContractIssue[];
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Compile JSON into the exact authoring snapshot persisted by a Fleet. This
|
|
131
|
+
* does not inspect the Customer DB or provider; use
|
|
132
|
+
* `fleets sync --file <fleet.json> --dry-run` for that environment-aware
|
|
133
|
+
* preflight, which returns the real plan and the credits due.
|
|
134
|
+
*/
|
|
135
|
+
declare function admitMonitorFleetAuthoringContract(value: unknown, edition?: number): MonitorFleetAuthoringContractResult;
|
|
136
|
+
declare function evaluateMonitorFleetValue(value: unknown, row: Record<string, unknown>): unknown;
|
|
137
|
+
|
|
138
|
+
export { type AdmittedMonitorFleetAuthoringContract, MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG, MONITOR_FLEET_AUTHORING_CONTRACT_EDITION, MONITOR_FLEET_DOCUMENTATION, MONITOR_FLEET_FRONTIER_MAX_ROWS, MONITOR_FLEET_MAX_MEMBERS, MONITOR_FLEET_REMOVAL_GRACE_MS, type MonitorFleetAuthoringContractEdition, type MonitorFleetAuthoringContractResult, type MonitorFleetColumn, type MonitorFleetContractIssue, type MonitorFleetDefinition, type MonitorFleetExpression, type MonitorFleetTemplate, SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS, admitMonitorFleetAuthoringContract, defineMonitorFleet, evaluateMonitorFleetValue, fleetColumn, fleetKey, validateMonitorFleetDefinition };
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/monitor-fleet-contract.ts
|
|
21
|
+
var monitor_fleet_contract_exports = {};
|
|
22
|
+
__export(monitor_fleet_contract_exports, {
|
|
23
|
+
MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG: () => MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG,
|
|
24
|
+
MONITOR_FLEET_AUTHORING_CONTRACT_EDITION: () => MONITOR_FLEET_AUTHORING_CONTRACT_EDITION,
|
|
25
|
+
MONITOR_FLEET_DOCUMENTATION: () => MONITOR_FLEET_DOCUMENTATION,
|
|
26
|
+
MONITOR_FLEET_FRONTIER_MAX_ROWS: () => MONITOR_FLEET_FRONTIER_MAX_ROWS,
|
|
27
|
+
MONITOR_FLEET_MAX_MEMBERS: () => MONITOR_FLEET_MAX_MEMBERS,
|
|
28
|
+
MONITOR_FLEET_REMOVAL_GRACE_MS: () => MONITOR_FLEET_REMOVAL_GRACE_MS,
|
|
29
|
+
SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS: () => SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS,
|
|
30
|
+
admitMonitorFleetAuthoringContract: () => admitMonitorFleetAuthoringContract,
|
|
31
|
+
defineMonitorFleet: () => defineMonitorFleet,
|
|
32
|
+
evaluateMonitorFleetValue: () => evaluateMonitorFleetValue,
|
|
33
|
+
fleetColumn: () => fleetColumn,
|
|
34
|
+
fleetKey: () => fleetKey,
|
|
35
|
+
validateMonitorFleetDefinition: () => validateMonitorFleetDefinition
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(monitor_fleet_contract_exports);
|
|
38
|
+
var MONITOR_FLEET_MAX_MEMBERS = 1e3;
|
|
39
|
+
var MONITOR_FLEET_FRONTIER_MAX_ROWS = 1e4;
|
|
40
|
+
var MONITOR_FLEET_AUTHORING_CONTRACT_EDITION = 1;
|
|
41
|
+
var SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS = [
|
|
42
|
+
MONITOR_FLEET_AUTHORING_CONTRACT_EDITION
|
|
43
|
+
];
|
|
44
|
+
var MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = [
|
|
45
|
+
{
|
|
46
|
+
edition: 1,
|
|
47
|
+
changed: "Initial Fleet JSON contract: bounded sticky table membership, one daily sync, and a seven-day removal grace.",
|
|
48
|
+
compatibilityOwner: "Monitors Runtime",
|
|
49
|
+
newWritesEnd: null,
|
|
50
|
+
readerRemoval: null
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
var MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 6e4;
|
|
54
|
+
var MONITOR_FLEET_DOCUMENTATION = {
|
|
55
|
+
summary: "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: "Customer DB table, unique row key, and optional equality filters that select candidate rows.",
|
|
59
|
+
member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.",
|
|
60
|
+
selection: "Deterministic ranking and an active-member limit between 1 and 1,000."
|
|
61
|
+
},
|
|
62
|
+
fixedPolicy: {
|
|
63
|
+
cadence: "daily",
|
|
64
|
+
membership: "sticky",
|
|
65
|
+
removalGrace: "7d",
|
|
66
|
+
onRemoved: "deactivate",
|
|
67
|
+
ownership: "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.",
|
|
68
|
+
billing: "No Fleet fee, permit, or renewal. Dry-run reports ordinary monitor lifecycle charges due now."
|
|
69
|
+
},
|
|
70
|
+
stickyMembership: "Ranking fills vacancies but never replaces a current member merely because another row ranks higher.",
|
|
71
|
+
columnExpression: 'Use { "$fleet": "column", "name": "column_name" } in a member key or payload to read a value from each source row.'
|
|
72
|
+
};
|
|
73
|
+
function record(value) {
|
|
74
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
75
|
+
}
|
|
76
|
+
function identifier(value) {
|
|
77
|
+
return typeof value === "string" && /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
|
|
78
|
+
}
|
|
79
|
+
function exactKeys(input, keys, path, issues) {
|
|
80
|
+
if (!input) return;
|
|
81
|
+
for (const key of Object.keys(input)) {
|
|
82
|
+
if (keys.includes(key)) continue;
|
|
83
|
+
issues.push({
|
|
84
|
+
path: path ? `${path}.${key}` : key,
|
|
85
|
+
code: "unknown_fleet_field",
|
|
86
|
+
message: `${path || "Fleet"} does not accept '${key}'.`
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function jsonValue(value, path, issues) {
|
|
91
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (Array.isArray(value)) {
|
|
95
|
+
value.forEach((item, index) => jsonValue(item, `${path}.${index}`, issues));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const input = record(value);
|
|
99
|
+
if (!input) {
|
|
100
|
+
issues.push({
|
|
101
|
+
path,
|
|
102
|
+
code: "invalid_fleet_json_value",
|
|
103
|
+
message: "Fleet payload values must be JSON values."
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
for (const [key, item] of Object.entries(input)) {
|
|
108
|
+
jsonValue(item, `${path}.${key}`, issues);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function fleetColumn(name) {
|
|
112
|
+
if (!identifier(name)) throw new Error(`Invalid fleet column '${name}'.`);
|
|
113
|
+
return { $fleet: "column", name };
|
|
114
|
+
}
|
|
115
|
+
function fleetKey(...parts) {
|
|
116
|
+
if (parts.length === 0)
|
|
117
|
+
throw new Error("A fleet key needs at least one part.");
|
|
118
|
+
return { $fleet: "template", parts };
|
|
119
|
+
}
|
|
120
|
+
function defineMonitorFleet(definition) {
|
|
121
|
+
return definition;
|
|
122
|
+
}
|
|
123
|
+
function validateExpression(value, path, issues) {
|
|
124
|
+
const input = record(value);
|
|
125
|
+
if (!input || input.$fleet !== "column" || !identifier(input.name)) {
|
|
126
|
+
issues.push({
|
|
127
|
+
path,
|
|
128
|
+
code: "invalid_fleet_expression",
|
|
129
|
+
message: "Fleet expressions must be an exact tagged column reference."
|
|
130
|
+
});
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
exactKeys(input, ["$fleet", "name"], path, issues);
|
|
134
|
+
}
|
|
135
|
+
function walkPayload(value, path, issues) {
|
|
136
|
+
if (Array.isArray(value)) {
|
|
137
|
+
value.forEach(
|
|
138
|
+
(item, index) => walkPayload(item, `${path}.${index}`, issues)
|
|
139
|
+
);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const input = record(value);
|
|
143
|
+
if (!input) return;
|
|
144
|
+
if ("$fleet" in input) {
|
|
145
|
+
validateExpression(input, path, issues);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
for (const [key, item] of Object.entries(input)) {
|
|
149
|
+
walkPayload(item, `${path}.${key}`, issues);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function validateMonitorFleetDefinition(value) {
|
|
153
|
+
const issues = [];
|
|
154
|
+
const input = record(value);
|
|
155
|
+
if (!input) {
|
|
156
|
+
return {
|
|
157
|
+
valid: false,
|
|
158
|
+
issues: [
|
|
159
|
+
{
|
|
160
|
+
path: "",
|
|
161
|
+
code: "invalid_fleet",
|
|
162
|
+
message: "Fleet must be an object."
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
exactKeys(input, ["id", "source", "member", "selection"], "", issues);
|
|
168
|
+
if (typeof input.id !== "string" || !/^[a-z][a-z0-9-]{0,199}$/.test(input.id)) {
|
|
169
|
+
issues.push({
|
|
170
|
+
path: "id",
|
|
171
|
+
code: "invalid_fleet_id",
|
|
172
|
+
message: "Fleet id must be lowercase kebab-case."
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const source = record(input.source);
|
|
176
|
+
exactKeys(
|
|
177
|
+
source,
|
|
178
|
+
["kind", "schema", "table", "key", "where"],
|
|
179
|
+
"source",
|
|
180
|
+
issues
|
|
181
|
+
);
|
|
182
|
+
if (!source || source.kind !== "customer_db_table") {
|
|
183
|
+
issues.push({
|
|
184
|
+
path: "source.kind",
|
|
185
|
+
code: "invalid_fleet_source",
|
|
186
|
+
message: "Beta fleets require customer_db_table."
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (!identifier(source?.schema) || !identifier(source?.table)) {
|
|
190
|
+
issues.push({
|
|
191
|
+
path: "source",
|
|
192
|
+
code: "invalid_fleet_table",
|
|
193
|
+
message: "Source schema and table must be SQL identifiers."
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
const sourceKey = record(source?.key);
|
|
197
|
+
exactKeys(sourceKey, ["column", "type"], "source.key", issues);
|
|
198
|
+
if (!sourceKey || !identifier(sourceKey.column) || !["text", "uuid", "int4", "int8"].includes(String(sourceKey.type))) {
|
|
199
|
+
issues.push({
|
|
200
|
+
path: "source.key",
|
|
201
|
+
code: "invalid_fleet_source_key",
|
|
202
|
+
message: "Source key must name a supported typed column."
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if (source?.where !== void 0) {
|
|
206
|
+
const where = record(source.where);
|
|
207
|
+
if (!where) {
|
|
208
|
+
issues.push({
|
|
209
|
+
path: "source.where",
|
|
210
|
+
code: "invalid_fleet_where",
|
|
211
|
+
message: "source.where must be an object of equality values."
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
for (const [column, expected] of Object.entries(where)) {
|
|
215
|
+
if (!identifier(column)) {
|
|
216
|
+
issues.push({
|
|
217
|
+
path: `source.where.${column}`,
|
|
218
|
+
code: "invalid_fleet_where_column",
|
|
219
|
+
message: "source.where keys must be SQL identifiers."
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
if (expected !== null && typeof expected !== "string" && typeof expected !== "boolean" && !(typeof expected === "number" && Number.isFinite(expected))) {
|
|
223
|
+
issues.push({
|
|
224
|
+
path: `source.where.${column}`,
|
|
225
|
+
code: "invalid_fleet_where_value",
|
|
226
|
+
message: "source.where values must be finite JSON scalars or null."
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const member = record(input.member);
|
|
233
|
+
exactKeys(member, ["tool", "key", "payload"], "member", issues);
|
|
234
|
+
const key = record(member?.key);
|
|
235
|
+
if (!member || typeof member.tool !== "string" || !member.tool.trim()) {
|
|
236
|
+
issues.push({
|
|
237
|
+
path: "member.tool",
|
|
238
|
+
code: "invalid_fleet_tool",
|
|
239
|
+
message: "Member tool is required."
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
if (!key || key.$fleet !== "template" || !Array.isArray(key.parts) || key.parts.length === 0) {
|
|
243
|
+
issues.push({
|
|
244
|
+
path: "member.key",
|
|
245
|
+
code: "invalid_fleet_key",
|
|
246
|
+
message: "Member key must be a tagged fleet template."
|
|
247
|
+
});
|
|
248
|
+
} else {
|
|
249
|
+
exactKeys(key, ["$fleet", "parts"], "member.key", issues);
|
|
250
|
+
for (const [index, part] of key.parts.entries()) {
|
|
251
|
+
if (typeof part !== "string")
|
|
252
|
+
validateExpression(part, `member.key.parts.${index}`, issues);
|
|
253
|
+
}
|
|
254
|
+
if (sourceKey && !key.parts.some(
|
|
255
|
+
(part) => record(part)?.$fleet === "column" && record(part)?.name === sourceKey.column
|
|
256
|
+
)) {
|
|
257
|
+
issues.push({
|
|
258
|
+
path: "member.key.parts",
|
|
259
|
+
code: "fleet_key_missing_source_key",
|
|
260
|
+
message: "Member key must include the source key column."
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (!member || !("payload" in member)) {
|
|
265
|
+
issues.push({
|
|
266
|
+
path: "member.payload",
|
|
267
|
+
code: "invalid_fleet_payload",
|
|
268
|
+
message: "Member payload is required."
|
|
269
|
+
});
|
|
270
|
+
} else {
|
|
271
|
+
jsonValue(member.payload, "member.payload", issues);
|
|
272
|
+
}
|
|
273
|
+
walkPayload(member?.payload, "member.payload", issues);
|
|
274
|
+
const selection = record(input.selection);
|
|
275
|
+
exactKeys(selection, ["limit", "orderBy", "membership"], "selection", issues);
|
|
276
|
+
if (!selection || !Number.isSafeInteger(selection.limit) || Number(selection.limit) < 1 || Number(selection.limit) > MONITOR_FLEET_MAX_MEMBERS) {
|
|
277
|
+
issues.push({
|
|
278
|
+
path: "selection.limit",
|
|
279
|
+
code: "MONITOR_FLEET_LIMIT_EXCEEDED",
|
|
280
|
+
message: "selection.limit must be between 1 and 1,000."
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
if (selection?.membership !== "sticky") {
|
|
284
|
+
issues.push({
|
|
285
|
+
path: "selection.membership",
|
|
286
|
+
code: "invalid_fleet_membership",
|
|
287
|
+
message: `Fleet membership is fixed to ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.membership}. ${MONITOR_FLEET_DOCUMENTATION.stickyMembership}`
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
const orderBy = selection?.orderBy;
|
|
291
|
+
if (!Array.isArray(orderBy) || orderBy.length === 0) {
|
|
292
|
+
issues.push({
|
|
293
|
+
path: "selection.orderBy",
|
|
294
|
+
code: "invalid_fleet_order",
|
|
295
|
+
message: "At least one deterministic order field is required."
|
|
296
|
+
});
|
|
297
|
+
} else {
|
|
298
|
+
const orderColumns = /* @__PURE__ */ new Set();
|
|
299
|
+
for (const [index, order] of orderBy.entries()) {
|
|
300
|
+
const item = record(order);
|
|
301
|
+
exactKeys(
|
|
302
|
+
item,
|
|
303
|
+
["column", "direction"],
|
|
304
|
+
`selection.orderBy.${index}`,
|
|
305
|
+
issues
|
|
306
|
+
);
|
|
307
|
+
if (!item || !identifier(item.column) || !["asc", "desc"].includes(String(item.direction))) {
|
|
308
|
+
issues.push({
|
|
309
|
+
path: `selection.orderBy.${index}`,
|
|
310
|
+
code: "invalid_fleet_order",
|
|
311
|
+
message: "Order fields need a column and asc/desc direction."
|
|
312
|
+
});
|
|
313
|
+
} else if (orderColumns.has(item.column)) {
|
|
314
|
+
issues.push({
|
|
315
|
+
path: `selection.orderBy.${index}.column`,
|
|
316
|
+
code: "duplicate_fleet_order_column",
|
|
317
|
+
message: "Each selection order column may appear only once."
|
|
318
|
+
});
|
|
319
|
+
} else {
|
|
320
|
+
orderColumns.add(item.column);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (sourceKey && record(orderBy.at(-1))?.column !== sourceKey.column) {
|
|
324
|
+
issues.push({
|
|
325
|
+
path: "selection.orderBy",
|
|
326
|
+
code: "fleet_order_missing_key",
|
|
327
|
+
message: "The final order field must be the source key."
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
for (const removedOption of ["spendLimits", "lifecycle", "reconciliation"]) {
|
|
332
|
+
if (removedOption in input) {
|
|
333
|
+
issues.push({
|
|
334
|
+
path: removedOption,
|
|
335
|
+
code: "unsupported_fleet_option",
|
|
336
|
+
message: `${removedOption} is fixed by Monitor Fleets and must be omitted. Fleets sync ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved} members after ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.removalGrace} absent from the source.`
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return issues.length === 0 ? { valid: true, definition: value, issues } : { valid: false, issues };
|
|
341
|
+
}
|
|
342
|
+
function admitMonitorFleetAuthoringContract(value, edition = MONITOR_FLEET_AUTHORING_CONTRACT_EDITION) {
|
|
343
|
+
if (!SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS.includes(
|
|
344
|
+
edition
|
|
345
|
+
)) {
|
|
346
|
+
return {
|
|
347
|
+
valid: false,
|
|
348
|
+
issues: [
|
|
349
|
+
{
|
|
350
|
+
path: "authoring_contract_edition",
|
|
351
|
+
code: "unsupported_fleet_authoring_contract_edition",
|
|
352
|
+
message: `Monitor Fleet authoring contract edition ${edition} is not supported.`
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
const result = validateMonitorFleetDefinition(value);
|
|
358
|
+
return result.valid && result.definition ? {
|
|
359
|
+
valid: true,
|
|
360
|
+
contract: {
|
|
361
|
+
edition,
|
|
362
|
+
// JSON cloning prevents later caller mutation from changing the
|
|
363
|
+
// admitted snapshot.
|
|
364
|
+
definition: JSON.parse(
|
|
365
|
+
JSON.stringify(result.definition)
|
|
366
|
+
)
|
|
367
|
+
},
|
|
368
|
+
issues: []
|
|
369
|
+
} : { valid: false, issues: result.issues };
|
|
370
|
+
}
|
|
371
|
+
function evaluateMonitorFleetValue(value, row) {
|
|
372
|
+
if (Array.isArray(value))
|
|
373
|
+
return value.map((item) => evaluateMonitorFleetValue(item, row));
|
|
374
|
+
const input = record(value);
|
|
375
|
+
if (!input) return value;
|
|
376
|
+
if (input.$fleet === "column") return row[String(input.name)];
|
|
377
|
+
if (input.$fleet === "template" && Array.isArray(input.parts)) {
|
|
378
|
+
return input.parts.map(
|
|
379
|
+
(part) => typeof part === "string" ? part : String(evaluateMonitorFleetValue(part, row) ?? "")
|
|
380
|
+
).join("");
|
|
381
|
+
}
|
|
382
|
+
return Object.fromEntries(
|
|
383
|
+
Object.entries(input).map(([key, item]) => [
|
|
384
|
+
key,
|
|
385
|
+
evaluateMonitorFleetValue(item, row)
|
|
386
|
+
])
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
390
|
+
0 && (module.exports = {
|
|
391
|
+
MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG,
|
|
392
|
+
MONITOR_FLEET_AUTHORING_CONTRACT_EDITION,
|
|
393
|
+
MONITOR_FLEET_DOCUMENTATION,
|
|
394
|
+
MONITOR_FLEET_FRONTIER_MAX_ROWS,
|
|
395
|
+
MONITOR_FLEET_MAX_MEMBERS,
|
|
396
|
+
MONITOR_FLEET_REMOVAL_GRACE_MS,
|
|
397
|
+
SUPPORTED_MONITOR_FLEET_AUTHORING_CONTRACT_EDITIONS,
|
|
398
|
+
admitMonitorFleetAuthoringContract,
|
|
399
|
+
defineMonitorFleet,
|
|
400
|
+
evaluateMonitorFleetValue,
|
|
401
|
+
fleetColumn,
|
|
402
|
+
fleetKey,
|
|
403
|
+
validateMonitorFleetDefinition
|
|
404
|
+
});
|