deepline 0.3.551 → 0.3.553
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/dist/bundling-sources/sdk/src/client-core.ts +130 -12
- package/dist/bundling-sources/sdk/src/compat.ts +239 -87
- package/dist/bundling-sources/sdk/src/config.ts +113 -2
- package/dist/bundling-sources/sdk/src/errors.ts +2 -0
- package/dist/bundling-sources/sdk/src/http-core.ts +124 -10
- package/dist/bundling-sources/sdk/src/index.ts +2 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +6 -4
- package/dist/bundling-sources/sdk/src/play.ts +3 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +66 -30
- package/dist/bundling-sources/sdk/src/tool-calls.ts +2 -1
- package/dist/bundling-sources/sdk/src/tool-failure-hint.ts +104 -0
- package/dist/bundling-sources/sdk/src/types.ts +9 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +4 -2
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-plan-skus.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +58 -4
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +11 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +103 -5
- package/dist/bundling-sources/shared_libs/monitors/fleets/converge-admission.ts +133 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-attention.ts +165 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-release.ts +726 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-walk.ts +274 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +1 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/provider-bulk-wait.ts +126 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/shared-payload.ts +189 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +4 -0
- package/dist/bundling-sources/shared_libs/monitors/inventory-counter-errors.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +65 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +11 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +152 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +390 -10
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +34 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +66 -30
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +30 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +80 -13
- package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +26 -3
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/tamradar-countries.ts +285 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +312 -41
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +568 -26
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +14 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +92 -16
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +300 -57
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +298 -46
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +39 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +32 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +37 -7
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
- package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
- package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
- package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
- package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
- package/dist/cli/{auth-E7BH4GMJ.mjs → auth-I3QAU4RV.mjs} +8 -7
- package/dist/cli/auth-MQCN7WGZ.js +44 -0
- package/dist/cli/{billing-OXKU462W.mjs → billing-3IC54OQQ.mjs} +202 -59
- package/dist/cli/{billing-DNQAZGX7.js → billing-YGFFVAIC.js} +302 -159
- package/dist/cli/{chunk-COGREZAO.js → chunk-2B5B5KAW.js} +210 -128
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-T2B5BVZE.js → chunk-3NTP2OSG.js} +13 -13
- package/dist/cli/{chunk-FOTGUFVK.mjs → chunk-45OAVGU6.mjs} +5 -5
- package/dist/cli/{chunk-54EEYLTF.js → chunk-4747TPLV.js} +3 -3
- package/dist/cli/{chunk-CLRAANWH.mjs → chunk-4BFTDNHU.mjs} +1 -1
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
- package/dist/cli/{chunk-5S6PHKRV.mjs → chunk-4SMCFQ23.mjs} +1 -1
- package/dist/cli/{chunk-VWLHRZFG.mjs → chunk-55F6HNOY.mjs} +5 -5
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-VTGG2RT3.js → chunk-6NE3RRRY.js} +1 -1
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-MNSTCJMX.mjs → chunk-72V4PDH5.mjs} +18 -18
- package/dist/cli/{chunk-ZCDKE4UH.js → chunk-74RES4DS.js} +5 -5
- package/dist/cli/{chunk-WKBHUB6R.js → chunk-7GEMELKI.js} +366 -320
- package/dist/cli/{chunk-C4CUZH57.js → chunk-7O6J6A7P.js} +1871 -92
- package/dist/cli/{chunk-7RSIFA72.js → chunk-7SERLBNR.js} +161 -53
- package/dist/cli/{chunk-3G6QZACZ.js → chunk-7YRJ5UC4.js} +21 -21
- package/dist/cli/{chunk-I4VKGNAQ.mjs → chunk-A7DLBE5K.mjs} +136 -54
- package/dist/cli/{chunk-GGB3JYCW.mjs → chunk-AGICYWGN.mjs} +299 -69
- package/dist/cli/{chunk-44KSACJW.mjs → chunk-AGIQDA2T.mjs} +12 -12
- package/dist/cli/{chunk-PACD5DGC.js → chunk-AGLR6QVN.js} +255 -109
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-4OMAGJ6U.js → chunk-BVDKFS2T.js} +2 -2
- package/dist/cli/{chunk-LPJPCGT3.js → chunk-CACFJODG.js} +190 -134
- package/dist/cli/{chunk-GVYLCCKN.mjs → chunk-CAEBJOYU.mjs} +1 -1
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-POLUE7D5.js → chunk-DP2VH7CO.js} +12 -12
- package/dist/cli/{chunk-D6M5HFBB.mjs → chunk-DP64MD6U.mjs} +1 -1
- package/dist/cli/{chunk-W425ERWN.mjs → chunk-DZA7RFGL.mjs} +5 -5
- package/dist/cli/{chunk-R7J7CJPZ.js → chunk-E2G2DNAB.js} +4 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
- package/dist/cli/{chunk-44I675YK.js → chunk-FM7LPUPA.js} +41 -41
- package/dist/cli/{chunk-2UXDHFSF.mjs → chunk-GAVZ4EOD.mjs} +1 -1
- package/dist/cli/{chunk-Z2FIOG3V.js → chunk-HEBO3XNZ.js} +27 -31
- package/dist/cli/{chunk-6PWJKMFQ.mjs → chunk-HSJ6X2AQ.mjs} +4 -4
- package/dist/cli/{chunk-UPMRIVZB.js → chunk-HVI55MTK.js} +61 -10
- package/dist/cli/{chunk-KWSH5T7K.js → chunk-IH6GDNKW.js} +21 -21
- package/dist/cli/{chunk-3KYBDAR3.js → chunk-IMX7J4DU.js} +8 -8
- package/dist/cli/{chunk-HEHVGEZV.mjs → chunk-INEMTYMT.mjs} +8 -8
- package/dist/cli/{chunk-5VVSEU67.js → chunk-IUOGII7D.js} +6 -7
- package/dist/cli/{chunk-MXGA6JFI.mjs → chunk-JJGWHITQ.mjs} +5 -5
- package/dist/cli/{chunk-QM6Y6S4E.js → chunk-JLGP5XAJ.js} +5 -5
- package/dist/cli/{chunk-V6SCP4B7.mjs → chunk-LFOERUQY.mjs} +69 -3
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-ZMNGZ6XS.mjs → chunk-LH5PZKER.mjs} +80 -24
- package/dist/cli/{chunk-MR5LTVHD.js → chunk-LRDHPOZW.js} +69 -69
- package/dist/cli/{chunk-5LUF4LAR.mjs → chunk-LRZGS6RZ.mjs} +3 -0
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-UDXULACQ.js → chunk-MLABYI4M.js} +90 -24
- package/dist/cli/{chunk-S7IZWGUA.mjs → chunk-NDNHYONK.mjs} +17 -21
- package/dist/cli/{chunk-4D3WIZST.mjs → chunk-OTV2UUKW.mjs} +164 -18
- package/dist/cli/{chunk-XYE5XPGF.js → chunk-Q6Z6N3A7.js} +18 -18
- package/dist/cli/{chunk-7WQNWJQW.mjs → chunk-QG6JIWUL.mjs} +151 -43
- package/dist/cli/{chunk-3T65J5RG.mjs → chunk-QI5S5HWB.mjs} +2 -2
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-PM7MO62Y.mjs → chunk-RMNOZKRI.mjs} +3 -3
- package/dist/cli/{chunk-NMWGZD6Y.js → chunk-RTV4RF7N.js} +36 -36
- package/dist/cli/{chunk-CQ6JYQSW.js → chunk-SBH4CKPN.js} +11 -11
- package/dist/cli/{chunk-BIIJATTX.mjs → chunk-SG3LUONJ.mjs} +3 -3
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
- package/dist/cli/{chunk-5IL7SC45.mjs → chunk-TN4TY6TT.mjs} +6 -7
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
- package/dist/cli/{chunk-RE5MJBEV.mjs → chunk-UVQJYV76.mjs} +2 -2
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-W2ZWQUHT.js → chunk-WOCHZCUJ.js} +2 -2
- package/dist/cli/{chunk-ZDQFBJPO.js → chunk-XLIHTJVM.js} +348 -118
- package/dist/cli/{chunk-2ZYRBMQM.js → chunk-Y6SP3JMI.js} +22 -22
- package/dist/cli/{chunk-PPSDCN6C.js → chunk-YUA6HA6D.js} +2 -2
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/{chunk-E64HFB4L.mjs → chunk-Z6XPSHKM.mjs} +87 -41
- package/dist/cli/{chunk-7DOQ3OEX.mjs → chunk-Z7AOIHFE.mjs} +1870 -91
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-CFJH4KXV.js +22 -0
- package/dist/cli/{concurrent-runs-help-C6L6I5OR.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
- package/dist/cli/{csv-QMF4FWE7.js → csv-SA6ELJY6.js} +16 -15
- package/dist/cli/{csv-SYSDXFEM.mjs → csv-ZXZGHWOM.mjs} +7 -6
- package/dist/cli/{db-Q7HURWRZ.mjs → db-A54SP6AD.mjs} +16 -16
- package/dist/cli/{db-YSHPPA4H.js → db-JHFEIQBU.js} +43 -43
- package/dist/cli/describe-PHQ33AGS.mjs +50 -0
- package/dist/cli/describe-RHJ4XRFI.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-G7U3VUXN.mjs → executions-HL2M2DFU.mjs} +10 -10
- package/dist/cli/{executions-MWBC5TAW.js → executions-TLFZRHBJ.js} +12 -12
- package/dist/cli/{feedback-SD55OY6H.js → feedback-5UEX5UZK.js} +17 -16
- package/dist/cli/{feedback-GMHIFLBJ.mjs → feedback-QMBTNXVG.mjs} +9 -8
- package/dist/cli/git-4JWOOHBG.js +26 -0
- package/dist/cli/{git-HPE45OPD.mjs → git-LKGXVIVC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-HFKVBY6G.js → integrations-6RUTLMN7.js} +23 -27
- package/dist/cli/{integrations-2W4MGIQR.mjs → integrations-FGGRVUJ7.mjs} +15 -19
- package/dist/cli/{legacy-noops-SXVNDEXN.js → legacy-noops-J3Z7QRWZ.js} +12 -11
- package/dist/cli/{legacy-noops-GZYKNU2Z.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
- package/dist/cli/{mcp-PJRHQHHU.js → mcp-6LWFP7RW.js} +121 -48
- package/dist/cli/{mcp-BWA6KULG.mjs → mcp-CHDYFO7F.mjs} +100 -27
- package/dist/cli/{monitors-K2WSI6CR.js → monitors-STM6A7OU.js} +221 -186
- package/dist/cli/{monitors-SYQKCATO.mjs → monitors-UGRY2BXI.mjs} +58 -23
- package/dist/cli/org-3SYOUQCX.mjs +2289 -0
- package/dist/cli/org-ZOBSNSIB.js +2289 -0
- package/dist/cli/outcomes-H4YYAT5X.js +2865 -0
- package/dist/cli/outcomes-Z3P2JE67.mjs +2865 -0
- package/dist/cli/{play-SZXY2F2S.js → play-SM4CW2GS.js} +1116 -846
- package/dist/cli/{play-TTMABJEI.mjs → play-SN5YWLS7.mjs} +375 -105
- package/dist/cli/{providers-GQIOMRQO.mjs → providers-WZ4YBR5Y.mjs} +10 -10
- package/dist/cli/{providers-YDHCTZAF.js → providers-WZARYMCF.js} +13 -13
- package/dist/cli/{quickstart-PHSSMKCA.mjs → quickstart-2575BNKA.mjs} +7 -6
- package/dist/cli/{quickstart-BNYOXQXG.js → quickstart-PS4YHQJ6.js} +9 -8
- package/dist/cli/{run-GFIAZXVL.js → run-FLZ6OTM7.js} +51 -51
- package/dist/cli/{run-74C3C75C.mjs → run-ZUHCZOJS.mjs} +31 -31
- package/dist/cli/run-identity-LMLFMACS.js +31 -0
- package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
- package/dist/cli/{search-3SWUB7KX.mjs → search-HLPPKQEO.mjs} +11 -11
- package/dist/cli/search-JJWVHR3N.js +32 -0
- package/dist/cli/{search-output-K2SWHVHQ.mjs → search-output-PDAXNOGP.mjs} +9 -8
- package/dist/cli/{search-output-6JF3S4TP.js → search-output-RXJLU36B.js} +12 -11
- package/dist/cli/{secrets-2M4XWEKE.mjs → secrets-CGELYQ3H.mjs} +11 -11
- package/dist/cli/{secrets-2SAKLH2H.js → secrets-QJNG7G2Y.js} +20 -20
- package/dist/cli/sessions-DHTBT2GN.js +23 -0
- package/dist/cli/{sessions-A64BCXTO.mjs → sessions-ELMWVR4M.mjs} +9 -8
- package/dist/cli/{settings-HV64WIJF.js → settings-44I44P5F.js} +89 -89
- package/dist/cli/{settings-SVGEC3FI.mjs → settings-RR3LZXL7.mjs} +16 -16
- package/dist/cli/{setup-EDC3NEJ3.mjs → setup-KGWRWH4B.mjs} +20 -19
- package/dist/cli/{setup-FHXOLQGQ.js → setup-KTEYOCJO.js} +60 -59
- package/dist/cli/skills-EPZPEXI2.js +37 -0
- package/dist/cli/{skills-3HGHZMXB.mjs → skills-FPRID2I5.mjs} +10 -9
- package/dist/cli/tools-IGQQ5TML.js +57 -0
- package/dist/cli/{tools-P2QS6A6Q.mjs → tools-PI4WMDLY.mjs} +23 -23
- package/dist/cli/update-4RNCVYGE.js +37 -0
- package/dist/cli/{update-552BYQM4.mjs → update-VJOJAZ7B.mjs} +14 -11
- package/dist/cli/{views-PA25NAE3.js → views-NTUOLNQU.js} +62 -64
- package/dist/cli/{views-LD5HXJYY.mjs → views-OVPSINZO.mjs} +47 -49
- package/dist/cli/{workflow-FIDBUQV6.js → workflow-2UDYDM6F.js} +23 -23
- package/dist/cli/{workflow-LDYFGBYP.mjs → workflow-7OEFNXZC.mjs} +13 -13
- package/dist/{client-DuDFiJDU.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-t9HZAkFD.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-DydMQOft.d.mts → client-core-SLLGBTht.d.mts} +285 -23
- package/dist/{client-core-CJRzLanv.d.ts → client-core-p0sOxnkl.d.ts} +285 -23
- package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
- package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
- package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
- package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
- package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +66 -55
- package/dist/index.mjs +25 -14
- package/dist/install-integrity.json +162 -142
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +23 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +4 -4
- package/dist/plays/run-request.mjs +3 -3
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +15 -13
- package/dist/server.mjs +9 -7
- package/package.json +1 -1
- package/dist/cli/auth-B4PI7GVY.js +0 -43
- package/dist/cli/concurrent-runs-help-JEFQZTJI.js +0 -21
- package/dist/cli/describe-PXTSBJTL.js +0 -50
- package/dist/cli/describe-YGMQBV44.mjs +0 -50
- package/dist/cli/git-I3JV7IGH.js +0 -25
- package/dist/cli/org-5KD7X7IA.mjs +0 -1282
- package/dist/cli/org-YQ2CR32B.js +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-2RRRF4LW.js +0 -32
- package/dist/cli/sessions-SBH27JNW.js +0 -22
- package/dist/cli/skills-Y3SRLOYD.js +0 -36
- package/dist/cli/tools-OFYPUPUV.js +0 -57
- package/dist/cli/update-SOUSCLB7.js +0 -34
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { PROVIDER_BULK_LISTING_CLOCK_SKEW_MS } from './provider-bulk-wait';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The durable listing walk behind a Fleet create-fence release (#11210,
|
|
5
|
+
* `deepline-admin monitors fleets release-fence` and `release-fence-op`).
|
|
6
|
+
*
|
|
7
|
+
* A release on `listing_absent` evidence needs a complete read of every radar
|
|
8
|
+
* created since the fence. A fence early in a 100,000-member deploy is
|
|
9
|
+
* followed by hundreds of listing pages, more than one admin request can read
|
|
10
|
+
* inside its 300 s, so the walk is saved after every page
|
|
11
|
+
* (`providerMonitorFleetFenceWalks`) and the next request resumes it.
|
|
12
|
+
*
|
|
13
|
+
* TamRadar lists newest first behind a keyset cursor, so a radar created
|
|
14
|
+
* while a walk waits between requests lands ahead of the saved cursor, where
|
|
15
|
+
* resuming never reaches it. The walk therefore reads in segments: each one
|
|
16
|
+
* reads from the top down to a `created_since`, and finishing it proves every
|
|
17
|
+
* radar from the walk's start up to the moment its first page was read. A
|
|
18
|
+
* segment that started in an earlier request leaves a gap behind it, so the
|
|
19
|
+
* walk then reads a catch-up segment from just before that moment, and it is
|
|
20
|
+
* complete only once a segment that started in the current request finishes.
|
|
21
|
+
* That is the same guarantee a single uninterrupted walk gives: everything
|
|
22
|
+
* created up to the start of the read that ended it.
|
|
23
|
+
*
|
|
24
|
+
* Everything here is pure; the caller injects the page read, the save and
|
|
25
|
+
* the clock.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How long one request keeps reading pages before it saves and stops. The
|
|
30
|
+
* admin route allows 300 s; the rest is left for reading the members and
|
|
31
|
+
* recording up to 100 of them. A request always reads at least one page, so
|
|
32
|
+
* every request moves the walk forward.
|
|
33
|
+
*/
|
|
34
|
+
export const FLEET_FENCE_WALK_REQUEST_BUDGET_MS = 180_000;
|
|
35
|
+
|
|
36
|
+
/** The most keys one walk matches: one fence op fences at most 100 members. */
|
|
37
|
+
export const FLEET_FENCE_WALK_MAX_KEYS = 100;
|
|
38
|
+
|
|
39
|
+
/** A radar the walk found under one of its keys. */
|
|
40
|
+
export type FleetFenceWalkMatch = {
|
|
41
|
+
monitorKey: string;
|
|
42
|
+
radarId: string;
|
|
43
|
+
orgId: string | null;
|
|
44
|
+
status: string;
|
|
45
|
+
/** The provider's creation time; null when it reports none. */
|
|
46
|
+
createdAt: string | null;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** What one walk must cover, from the release decision. */
|
|
50
|
+
export type FleetFenceWalkRequest = {
|
|
51
|
+
tool: string;
|
|
52
|
+
createdSince: string;
|
|
53
|
+
monitorKeys: readonly string[];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** A walk as saved between requests. */
|
|
57
|
+
export type FleetFenceWalkState = {
|
|
58
|
+
tool: string;
|
|
59
|
+
/** The walk covers radars created from here on. */
|
|
60
|
+
createdSince: string;
|
|
61
|
+
/** Every key matched on every page read so far. */
|
|
62
|
+
monitorKeys: string[];
|
|
63
|
+
/**
|
|
64
|
+
* The segment being read: its `created_since`, when its first page was read
|
|
65
|
+
* (Deepline's clock), and the cursor of its next page. Null between
|
|
66
|
+
* segments.
|
|
67
|
+
*/
|
|
68
|
+
segment: { since: string; startedAt: number; cursor: string } | null;
|
|
69
|
+
/**
|
|
70
|
+
* Every radar created from `createdSince` until this time has been read:
|
|
71
|
+
* the start of the last finished segment. Null until one finishes.
|
|
72
|
+
*/
|
|
73
|
+
coveredThrough: number | null;
|
|
74
|
+
pages: number;
|
|
75
|
+
scanned: number;
|
|
76
|
+
/**
|
|
77
|
+
* The newest radar per key from this workspace, and the newest from anyone
|
|
78
|
+
* else: all a release decision reads (an own radar refuses as accepted, any
|
|
79
|
+
* other as unattributable), and its time window only bounds from below.
|
|
80
|
+
*/
|
|
81
|
+
matches: FleetFenceWalkMatch[];
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** One page of the listing, already matched against the walk's keys. */
|
|
85
|
+
export type FleetFenceWalkPage = {
|
|
86
|
+
scanned: number;
|
|
87
|
+
matches: FleetFenceWalkMatch[];
|
|
88
|
+
nextCursor: string | null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Whether a saved walk answers for a request: same tool, started no later,
|
|
93
|
+
* and matching every key the request needs. A walk saved for an op still
|
|
94
|
+
* answers once some of its members are released and the rest ask again.
|
|
95
|
+
*/
|
|
96
|
+
export function fleetFenceWalkCovers(
|
|
97
|
+
saved: Pick<FleetFenceWalkState, 'tool' | 'createdSince' | 'monitorKeys'>,
|
|
98
|
+
request: FleetFenceWalkRequest,
|
|
99
|
+
): boolean {
|
|
100
|
+
if (saved.tool !== request.tool) return false;
|
|
101
|
+
if (!(Date.parse(saved.createdSince) <= Date.parse(request.createdSince))) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const keys = new Set(saved.monitorKeys);
|
|
105
|
+
return request.monitorKeys.every((key) => keys.has(key));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function newFleetFenceWalk(
|
|
109
|
+
request: FleetFenceWalkRequest,
|
|
110
|
+
): FleetFenceWalkState {
|
|
111
|
+
const monitorKeys = [...new Set(request.monitorKeys)].sort();
|
|
112
|
+
if (monitorKeys.length === 0) {
|
|
113
|
+
throw new Error('A fence walk must match at least one key.');
|
|
114
|
+
}
|
|
115
|
+
if (monitorKeys.length > FLEET_FENCE_WALK_MAX_KEYS) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
`A fence walk matches at most ${FLEET_FENCE_WALK_MAX_KEYS} keys, not ${monitorKeys.length}.`,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
tool: request.tool,
|
|
122
|
+
createdSince: request.createdSince,
|
|
123
|
+
monitorKeys,
|
|
124
|
+
segment: null,
|
|
125
|
+
coveredThrough: null,
|
|
126
|
+
pages: 0,
|
|
127
|
+
scanned: 0,
|
|
128
|
+
matches: [],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** A creation time to compare; none counts as newest, so it is kept. */
|
|
133
|
+
function createdAtMs(match: FleetFenceWalkMatch): number {
|
|
134
|
+
if (match.createdAt === null) return Number.POSITIVE_INFINITY;
|
|
135
|
+
const ms = Date.parse(match.createdAt);
|
|
136
|
+
return Number.isFinite(ms) ? ms : Number.POSITIVE_INFINITY;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Keep the newest radar per key and side (this workspace's stamp, or any
|
|
141
|
+
* other). Segments read out of creation order, so newest is decided by the
|
|
142
|
+
* listed time, not by which page came first.
|
|
143
|
+
*/
|
|
144
|
+
export function mergeFleetFenceWalkMatches(
|
|
145
|
+
orgId: string,
|
|
146
|
+
kept: readonly FleetFenceWalkMatch[],
|
|
147
|
+
found: readonly FleetFenceWalkMatch[],
|
|
148
|
+
): FleetFenceWalkMatch[] {
|
|
149
|
+
const newest = new Map<string, FleetFenceWalkMatch>();
|
|
150
|
+
for (const match of [...kept, ...found]) {
|
|
151
|
+
const slot = `${match.orgId === orgId ? 'own' : 'other'}:${match.monitorKey}`;
|
|
152
|
+
const current = newest.get(slot);
|
|
153
|
+
if (!current || createdAtMs(match) > createdAtMs(current)) {
|
|
154
|
+
newest.set(slot, match);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return [...newest.values()].sort(
|
|
158
|
+
(a, b) =>
|
|
159
|
+
a.monitorKey.localeCompare(b.monitorKey) ||
|
|
160
|
+
a.radarId.localeCompare(b.radarId),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function nextSegmentSince(state: FleetFenceWalkState): string {
|
|
165
|
+
if (state.coveredThrough === null) return state.createdSince;
|
|
166
|
+
// The segment start is Deepline's clock and `created_since` TamRadar's.
|
|
167
|
+
const since = Math.max(
|
|
168
|
+
Date.parse(state.createdSince),
|
|
169
|
+
state.coveredThrough - PROVIDER_BULK_LISTING_CLOCK_SKEW_MS,
|
|
170
|
+
);
|
|
171
|
+
return new Date(since).toISOString();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type FleetFenceWalkRun = {
|
|
175
|
+
state: FleetFenceWalkState;
|
|
176
|
+
/** True only when a segment started in this request finished. */
|
|
177
|
+
complete: boolean;
|
|
178
|
+
pagesThisRequest: number;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Where the catch-up after the segment being read starts: just before that
|
|
183
|
+
* segment began (or the last finished one, between segments), less the
|
|
184
|
+
* provider clock skew. A dry run reports it so the apply's catch-up can be
|
|
185
|
+
* checked against the plan.
|
|
186
|
+
*/
|
|
187
|
+
export function fleetFenceWalkCatchUpSince(state: FleetFenceWalkState): string {
|
|
188
|
+
return nextSegmentSince(
|
|
189
|
+
state.segment
|
|
190
|
+
? { ...state, coveredThrough: state.segment.startedAt }
|
|
191
|
+
: state,
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Read the walk forward until it is complete or the request's budget is
|
|
197
|
+
* spent, saving after every page. A page read that fails is thrown with the
|
|
198
|
+
* walk saved up to the page before it, except once: a cursor the provider
|
|
199
|
+
* explicitly refuses (`isCursorRefusal`, TamRadar's 400 for an invalid or
|
|
200
|
+
* stale cursor) restarts its segment, since a cursor may not outlive the wait
|
|
201
|
+
* between requests. Any other failure (authorization, a malformed page, a
|
|
202
|
+
* provider outage) keeps the saved cursor for the next request.
|
|
203
|
+
*/
|
|
204
|
+
export async function runFleetFenceWalk(input: {
|
|
205
|
+
orgId: string;
|
|
206
|
+
state: FleetFenceWalkState;
|
|
207
|
+
now: () => number;
|
|
208
|
+
budgetMs: number;
|
|
209
|
+
readPage: (page: {
|
|
210
|
+
createdSince: string;
|
|
211
|
+
cursor: string | null;
|
|
212
|
+
monitorKeys: readonly string[];
|
|
213
|
+
}) => Promise<FleetFenceWalkPage>;
|
|
214
|
+
save: (state: FleetFenceWalkState) => Promise<void>;
|
|
215
|
+
isCursorRefusal: (error: unknown) => boolean;
|
|
216
|
+
}): Promise<FleetFenceWalkRun> {
|
|
217
|
+
const requestStartedAt = input.now();
|
|
218
|
+
let state = input.state;
|
|
219
|
+
let pagesThisRequest = 0;
|
|
220
|
+
// Whether the segment being read started in this request.
|
|
221
|
+
let segmentStartedHere = false;
|
|
222
|
+
let restartedSegment = false;
|
|
223
|
+
for (;;) {
|
|
224
|
+
if (
|
|
225
|
+
pagesThisRequest > 0 &&
|
|
226
|
+
input.now() - requestStartedAt >= input.budgetMs
|
|
227
|
+
) {
|
|
228
|
+
return { state, complete: false, pagesThisRequest };
|
|
229
|
+
}
|
|
230
|
+
const segment = state.segment;
|
|
231
|
+
if (segment === null) segmentStartedHere = true;
|
|
232
|
+
const since = segment?.since ?? nextSegmentSince(state);
|
|
233
|
+
const startedAt = segment?.startedAt ?? input.now();
|
|
234
|
+
let page: FleetFenceWalkPage;
|
|
235
|
+
try {
|
|
236
|
+
page = await input.readPage({
|
|
237
|
+
createdSince: since,
|
|
238
|
+
cursor: segment?.cursor ?? null,
|
|
239
|
+
monitorKeys: state.monitorKeys,
|
|
240
|
+
});
|
|
241
|
+
} catch (error) {
|
|
242
|
+
if (
|
|
243
|
+
segment === null ||
|
|
244
|
+
restartedSegment ||
|
|
245
|
+
!input.isCursorRefusal(error)
|
|
246
|
+
) {
|
|
247
|
+
throw error;
|
|
248
|
+
}
|
|
249
|
+
restartedSegment = true;
|
|
250
|
+
state = { ...state, segment: null };
|
|
251
|
+
await input.save(state);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
pagesThisRequest += 1;
|
|
255
|
+
const read: FleetFenceWalkState = {
|
|
256
|
+
...state,
|
|
257
|
+
pages: state.pages + 1,
|
|
258
|
+
scanned: state.scanned + page.scanned,
|
|
259
|
+
matches: mergeFleetFenceWalkMatches(
|
|
260
|
+
input.orgId,
|
|
261
|
+
state.matches,
|
|
262
|
+
page.matches,
|
|
263
|
+
),
|
|
264
|
+
...(page.nextCursor === null
|
|
265
|
+
? { segment: null, coveredThrough: startedAt }
|
|
266
|
+
: { segment: { since, startedAt, cursor: page.nextCursor } }),
|
|
267
|
+
};
|
|
268
|
+
await input.save(read);
|
|
269
|
+
state = read;
|
|
270
|
+
if (page.nextCursor === null && segmentStartedHere) {
|
|
271
|
+
return { state, complete: true, pagesThisRequest };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
@@ -98,6 +98,7 @@ const BLOCKED_CAUSES: Readonly<Record<string, FleetBlockedCause>> = {
|
|
|
98
98
|
[FLEET_BLOCKED_BY.rolloutAccess]: 'rollout_access',
|
|
99
99
|
[FLEET_BLOCKED_BY.invalidPayload]: 'invalid_payload',
|
|
100
100
|
[FLEET_REFUSAL.identityOccupied]: 'identity_occupied',
|
|
101
|
+
[FLEET_REFUSAL.identityOrphaned]: 'needs_support',
|
|
101
102
|
[FLEET_REFUSAL.batchUnsupported]: 'unsupported_tool',
|
|
102
103
|
[FLEET_REFUSAL.orphanedResource]: 'needs_support',
|
|
103
104
|
[FLEET_REFUSAL.resourceOwnedByOtherOrg]: 'needs_support',
|
|
@@ -16,6 +16,12 @@ export const FLEET_BLOCKED_BY = {
|
|
|
16
16
|
export const FLEET_REFUSAL = {
|
|
17
17
|
batchUnsupported: 'provider.batch_create_unsupported',
|
|
18
18
|
identityOccupied: 'provider.identity_occupied',
|
|
19
|
+
/**
|
|
20
|
+
* The monitor holding this member's target was deleted and its claim
|
|
21
|
+
* outlived it (#10305). Only an operator release ends it:
|
|
22
|
+
* `deepline-admin monitors identity-claims orphans`.
|
|
23
|
+
*/
|
|
24
|
+
identityOrphaned: 'provider.identity_orphaned',
|
|
19
25
|
/** Created, unbillable, and its deletion could not be confirmed. */
|
|
20
26
|
orphanedResource: 'provider.orphaned_resource',
|
|
21
27
|
/**
|
|
@@ -30,12 +36,28 @@ export const FLEET_REFUSAL = {
|
|
|
30
36
|
resourceBindingConflict: 'provider.resource_binding_conflict',
|
|
31
37
|
} as const;
|
|
32
38
|
export const MAX_MEMBER_DEFINITION_BYTES = 2_048;
|
|
39
|
+
/**
|
|
40
|
+
* The largest bulk-create body a Fleet sends in one request: 20% under
|
|
41
|
+
* TamRadar's 1,000,000-byte limit (`TAMRADAR_BULK_MAX_BODY_BYTES`). Requests
|
|
42
|
+
* are partitioned to it before any member is fenced. Verified 2026-11-20 on
|
|
43
|
+
* the dev account: 80 radars with 9,000-character filters (805,039 bytes)
|
|
44
|
+
* and 20 radars (201,319 bytes) were each accepted and stored intact.
|
|
45
|
+
*/
|
|
46
|
+
export const FLEET_BULK_CREATE_BODY_BUDGET_BYTES = 800_000;
|
|
33
47
|
/**
|
|
34
48
|
* The largest plan published in ONE Convex transaction (`commitPlan`). It is
|
|
35
49
|
* the size that transaction was built and ceiling-tested for; a larger plan is
|
|
36
50
|
* staged in chunks of STAGED_COMMIT_CHUNK_MEMBERS.
|
|
37
51
|
*/
|
|
38
52
|
export const SINGLE_COMMIT_MAX_MEMBERS = 1_000;
|
|
53
|
+
/**
|
|
54
|
+
* The most plan bytes one `commitPlan` transaction carries: the
|
|
55
|
+
* SINGLE_COMMIT_MAX_MEMBERS × MAX_MEMBER_DEFINITION_BYTES budget its read
|
|
56
|
+
* arithmetic was proved against. A plan over it is staged in chunks of
|
|
57
|
+
* STAGED_COMMIT_CHUNK_MEMBERS regardless of its member count.
|
|
58
|
+
*/
|
|
59
|
+
export const SINGLE_COMMIT_MAX_PLAN_BYTES =
|
|
60
|
+
SINGLE_COMMIT_MAX_MEMBERS * MAX_MEMBER_DEFINITION_BYTES;
|
|
39
61
|
/** Members one staged-commit chunk carries; see `commitStagedChunk`. */
|
|
40
62
|
export const STAGED_COMMIT_CHUNK_MEMBERS = 250;
|
|
41
63
|
/**
|
|
@@ -56,6 +78,12 @@ export const MONITOR_FLEET_COMMIT_BUDGET_HEADER =
|
|
|
56
78
|
export const MONITOR_FLEET_MAX_COMMIT_BUDGET_MS = 240_000;
|
|
57
79
|
/** The least, so each request still has time to commit something. */
|
|
58
80
|
export const MONITOR_FLEET_MIN_COMMIT_BUDGET_MS = 1_000;
|
|
81
|
+
/**
|
|
82
|
+
* Commit budget of a scheduled source refresh, from the request's start. Its
|
|
83
|
+
* caller (the convergence tick's dispatcher) waits 60 s, so a refresh that
|
|
84
|
+
* cannot commit in this budget parks and is resumed on the next tick.
|
|
85
|
+
*/
|
|
86
|
+
export const MONITOR_FLEET_SOURCE_REFRESH_COMMIT_BUDGET_MS = 40_000;
|
|
59
87
|
export const MONITOR_FLEET_STAGED_COMMIT_IN_PROGRESS =
|
|
60
88
|
'staged_commit_in_progress';
|
|
61
89
|
export const MAX_FLEET_SETTLE_ITEMS = 100;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a Fleet waits on a provider bulk create that is still `processing`
|
|
3
|
+
* (#10896).
|
|
4
|
+
*
|
|
5
|
+
* TamRadar answers an accepted `POST /v1/radars/bulk` with a bulk id and makes
|
|
6
|
+
* the radars later. It is usually done within a minute, but not always: a
|
|
7
|
+
* Prove bulk was still `processing` after more than two hours on 2026-11-19,
|
|
8
|
+
* and a Kindred bulk posted that evening made its radars about thirteen hours
|
|
9
|
+
* late. The member's create fence is the only thing standing between a retry
|
|
10
|
+
* and a duplicate radar, so the wait never ends in "it was not created": only
|
|
11
|
+
* the provider's own record (the bulk status, or a radar in the account
|
|
12
|
+
* listing carrying the member's correlation key) ends it.
|
|
13
|
+
*
|
|
14
|
+
* What these rules change is how the wait is spent:
|
|
15
|
+
*
|
|
16
|
+
* - The bulk is re-read less often the longer it runs
|
|
17
|
+
* (`providerBulkRecheckDelayMs`), instead of every thirty seconds forever.
|
|
18
|
+
* - Once it has run `PROVIDER_BULK_LISTING_AFTER_MS`, each re-read also walks
|
|
19
|
+
* the account listing from the acceptance, so a radar the status endpoint
|
|
20
|
+
* never reports is still found.
|
|
21
|
+
* - A durable operation whose only outstanding work is such a wait is not
|
|
22
|
+
* "making no progress" for `PROVIDER_BULK_WAIT_MS`, so the no-progress guard
|
|
23
|
+
* does not fail it two hours in. Past that window the guard counts again; the
|
|
24
|
+
* run fails and dead-letters, and its Fleet's next run (on its backoff) picks
|
|
25
|
+
* the wait up where it left off.
|
|
26
|
+
* - Past `PROVIDER_BULK_WAIT_ALERT_MS` the run alerts once.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** How long a wait on a still-processing bulk does not spend the no-progress budget. */
|
|
30
|
+
export const PROVIDER_BULK_WAIT_MS = 24 * 60 * 60_000;
|
|
31
|
+
|
|
32
|
+
/** How long a bulk may stay `processing` before its operation alerts. */
|
|
33
|
+
export const PROVIDER_BULK_WAIT_ALERT_MS = 60 * 60_000;
|
|
34
|
+
|
|
35
|
+
/** How long a bulk stays `processing` before each re-read also walks the listing. */
|
|
36
|
+
export const PROVIDER_BULK_LISTING_AFTER_MS = 10 * 60_000;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* How far before the acceptance the listing walk starts. The acceptance is
|
|
40
|
+
* Deepline's clock and `created_since` is TamRadar's.
|
|
41
|
+
*/
|
|
42
|
+
export const PROVIDER_BULK_LISTING_CLOCK_SKEW_MS = 10 * 60_000;
|
|
43
|
+
|
|
44
|
+
/** Listing pages one re-read may walk, so a busy account cannot stall a pass. */
|
|
45
|
+
export const PROVIDER_BULK_LISTING_MAX_PAGES = 3;
|
|
46
|
+
|
|
47
|
+
const RECHECK_SCHEDULE: ReadonlyArray<{
|
|
48
|
+
beforeAgeMs: number;
|
|
49
|
+
delayMs: number;
|
|
50
|
+
}> = [
|
|
51
|
+
{ beforeAgeMs: 10 * 60_000, delayMs: 30_000 },
|
|
52
|
+
{ beforeAgeMs: 60 * 60_000, delayMs: 2 * 60_000 },
|
|
53
|
+
{ beforeAgeMs: 6 * 60 * 60_000, delayMs: 10 * 60_000 },
|
|
54
|
+
];
|
|
55
|
+
const RECHECK_CEILING_MS = 30 * 60_000;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* How soon a bulk that has been `processing` for `ageMs` is read again. An
|
|
59
|
+
* unknown age (a fence accepted before its acceptance was recorded) is read
|
|
60
|
+
* as a new one.
|
|
61
|
+
*/
|
|
62
|
+
export function providerBulkRecheckDelayMs(ageMs: number | null): number {
|
|
63
|
+
const age =
|
|
64
|
+
ageMs === null || !Number.isFinite(ageMs) ? 0 : Math.max(0, ageMs);
|
|
65
|
+
for (const step of RECHECK_SCHEDULE) {
|
|
66
|
+
if (age < step.beforeAgeMs) return step.delayMs;
|
|
67
|
+
}
|
|
68
|
+
return RECHECK_CEILING_MS;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** A short duration for operator messages: `45s`, `12m`, `2h 10m`. */
|
|
72
|
+
export function formatProviderBulkWait(ageMs: number): string {
|
|
73
|
+
const seconds = Math.max(0, Math.floor(ageMs / 1_000));
|
|
74
|
+
if (seconds < 60) return `${seconds}s`;
|
|
75
|
+
const minutes = Math.floor(seconds / 60);
|
|
76
|
+
if (minutes < 60) return `${minutes}m`;
|
|
77
|
+
const hours = Math.floor(minutes / 60);
|
|
78
|
+
const rest = minutes % 60;
|
|
79
|
+
return rest === 0 ? `${hours}h` : `${hours}h ${rest}m`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The member fields that say what it waits on. */
|
|
83
|
+
export type ProviderBulkWaitMember = {
|
|
84
|
+
convergence?: string;
|
|
85
|
+
opId?: string;
|
|
86
|
+
providerOpRef?: string;
|
|
87
|
+
opSubmission?: {
|
|
88
|
+
opId: string;
|
|
89
|
+
acceptedAt?: number;
|
|
90
|
+
processingAt?: number;
|
|
91
|
+
listingCursor?: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* When the provider accepted the bulk this member waits on, or null when it
|
|
97
|
+
* is not waiting on a still-processing bulk. A member waits on one when its
|
|
98
|
+
* create fence names an accepted bulk and its last settle recorded the bulk
|
|
99
|
+
* as still processing (`opSubmission.processingAt`, cleared by any other
|
|
100
|
+
* outcome that keeps the fence).
|
|
101
|
+
*/
|
|
102
|
+
export function providerBulkWaitAcceptedAt(
|
|
103
|
+
member: ProviderBulkWaitMember | null | undefined,
|
|
104
|
+
): number | null {
|
|
105
|
+
if (!member) return null;
|
|
106
|
+
// `submitting` is a pass rechecking the same stamped fence; the wait holds
|
|
107
|
+
// until a provider outcome settles it (#11126 review).
|
|
108
|
+
if (
|
|
109
|
+
member.convergence !== 'rate_limited' &&
|
|
110
|
+
member.convergence !== 'submitting'
|
|
111
|
+
) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
if (member.opId === undefined || member.providerOpRef === undefined) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const submission = member.opSubmission;
|
|
118
|
+
if (submission === undefined || submission.opId !== member.opId) return null;
|
|
119
|
+
if (
|
|
120
|
+
submission.processingAt === undefined ||
|
|
121
|
+
submission.acceptedAt === undefined
|
|
122
|
+
) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
return submission.acceptedAt;
|
|
126
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Monitor Fleet's shared payload: the part of every member's payload that
|
|
3
|
+
* the template fixes for all members, stored once instead of on every member
|
|
4
|
+
* row (#11087, `docs/plans/2026-11-20-fleet-shared-payload.md`).
|
|
5
|
+
*
|
|
6
|
+
* This module is pure and dependency-free so the app planner and Convex use
|
|
7
|
+
* the same split, merge and canonical form. Whether a top-level payload key is
|
|
8
|
+
* shared is decided from the template alone, never from rendered values:
|
|
9
|
+
*
|
|
10
|
+
* - edition 2 (`monitor.payload`, Handlebars strings): shared when no string
|
|
11
|
+
* anywhere in the key's subtree contains `{{`;
|
|
12
|
+
* - edition 1 (`member.payload`, `$fleet` nodes): shared when the subtree
|
|
13
|
+
* holds no `$fleet` node. A root-level `$fleet` column makes the whole
|
|
14
|
+
* payload member-owned.
|
|
15
|
+
*
|
|
16
|
+
* Shared and member parts are disjoint by top-level key, so merging them
|
|
17
|
+
* gives back an object structurally equal to the rendered payload. Raw key
|
|
18
|
+
* order is not preserved; every consumer that hashes or fingerprints a
|
|
19
|
+
* payload canonicalizes it with `stableJson` first.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** The largest shared payload one Fleet may store (UTF-8 bytes of its JSON). */
|
|
23
|
+
export const MAX_FLEET_SHARED_PAYLOAD_BYTES = 40_000;
|
|
24
|
+
|
|
25
|
+
type JsonRecord = Record<string, unknown>;
|
|
26
|
+
|
|
27
|
+
function isRecord(value: unknown): value is JsonRecord {
|
|
28
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The canonical JSON every Fleet hash uses: keys sorted with
|
|
33
|
+
* `localeCompare`, recursively. Byte-for-byte the planner's historical
|
|
34
|
+
* `stableJson`, so existing `desiredHash` values do not move.
|
|
35
|
+
*/
|
|
36
|
+
export function stableJson(value: unknown): string {
|
|
37
|
+
if (value === null || typeof value !== 'object') return JSON.stringify(value);
|
|
38
|
+
if (Array.isArray(value)) return `[${value.map(stableJson).join(',')}]`;
|
|
39
|
+
return `{${Object.entries(value as JsonRecord)
|
|
40
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
41
|
+
.map(([key, item]) => `${JSON.stringify(key)}:${stableJson(item)}`)
|
|
42
|
+
.join(',')}}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function edition2Templated(value: unknown): boolean {
|
|
46
|
+
if (typeof value === 'string') return value.includes('{{');
|
|
47
|
+
if (Array.isArray(value)) return value.some(edition2Templated);
|
|
48
|
+
if (isRecord(value)) return Object.values(value).some(edition2Templated);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A `$fleet` node, as authored or as stored in Convex, where `$`-prefixed
|
|
54
|
+
* keys are escaped to `dlr__` (`@deepline/convex-client/dollar-key-escape`).
|
|
55
|
+
*/
|
|
56
|
+
function isFleetNode(value: JsonRecord): boolean {
|
|
57
|
+
return '$fleet' in value || 'dlr__fleet' in value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function edition1Templated(value: unknown): boolean {
|
|
61
|
+
if (Array.isArray(value)) return value.some(edition1Templated);
|
|
62
|
+
if (!isRecord(value)) return false;
|
|
63
|
+
if (isFleetNode(value)) return true;
|
|
64
|
+
return Object.values(value).some(edition1Templated);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The top-level payload keys a Fleet definition fixes for every member, or
|
|
69
|
+
* an empty list when it fixes none. Accepts the admitted definition of
|
|
70
|
+
* either authoring edition, as authored or as stored in Convex (escaped
|
|
71
|
+
* `$` keys); anything unrecognised shares nothing.
|
|
72
|
+
*/
|
|
73
|
+
export function fleetSharedPayloadKeys(definition: unknown): string[] {
|
|
74
|
+
if (!isRecord(definition)) return [];
|
|
75
|
+
if (isRecord(definition.monitor)) {
|
|
76
|
+
const payload = definition.monitor.payload;
|
|
77
|
+
if (!isRecord(payload)) return [];
|
|
78
|
+
return Object.keys(payload).filter(
|
|
79
|
+
(key) => !edition2Templated(payload[key]),
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (isRecord(definition.member)) {
|
|
83
|
+
const payload = definition.member.payload;
|
|
84
|
+
if (!isRecord(payload) || isFleetNode(payload)) return [];
|
|
85
|
+
return Object.keys(payload).filter(
|
|
86
|
+
(key) => !edition1Templated(payload[key]),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* True when two distinct keys compare equal under `localeCompare` (for
|
|
94
|
+
* example a precomposed and a combining accent). `stableJson` then keeps
|
|
95
|
+
* their insertion order, which a split and merge can change, so such a
|
|
96
|
+
* payload is never split.
|
|
97
|
+
*/
|
|
98
|
+
function hasCanonicalTie(keys: readonly string[]): boolean {
|
|
99
|
+
const sorted = [...keys].sort((left, right) => left.localeCompare(right));
|
|
100
|
+
for (let index = 1; index < sorted.length; index += 1) {
|
|
101
|
+
if (sorted[index - 1]!.localeCompare(sorted[index]!) === 0) return true;
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type FleetPayloadSplit = {
|
|
107
|
+
shared: JsonRecord;
|
|
108
|
+
member: JsonRecord;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Splits a rendered member payload into the shared part (the given keys that
|
|
113
|
+
* are present) and the member part (everything else). Returns null when the
|
|
114
|
+
* payload must stay whole: nothing to share, or a canonical-ordering tie.
|
|
115
|
+
*/
|
|
116
|
+
export function splitFleetMemberPayload(
|
|
117
|
+
sharedKeys: readonly string[],
|
|
118
|
+
payload: JsonRecord,
|
|
119
|
+
): FleetPayloadSplit | null {
|
|
120
|
+
if (sharedKeys.length === 0) return null;
|
|
121
|
+
if (hasCanonicalTie(Object.keys(payload))) return null;
|
|
122
|
+
const sharedKeySet = new Set(sharedKeys);
|
|
123
|
+
const shared: JsonRecord = {};
|
|
124
|
+
const member: JsonRecord = {};
|
|
125
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
126
|
+
if (sharedKeySet.has(key)) shared[key] = value;
|
|
127
|
+
else member[key] = value;
|
|
128
|
+
}
|
|
129
|
+
if (Object.keys(shared).length === 0) return null;
|
|
130
|
+
return { shared, member };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The member part of `full` against a stored shared payload, or null when
|
|
135
|
+
* `full` does not carry every shared key with a canonically equal value (it
|
|
136
|
+
* must then be stored whole, with no reference).
|
|
137
|
+
*/
|
|
138
|
+
export function encodeAgainstSharedPayload(
|
|
139
|
+
full: JsonRecord,
|
|
140
|
+
shared: JsonRecord,
|
|
141
|
+
): JsonRecord | null {
|
|
142
|
+
if (hasCanonicalTie(Object.keys(full))) return null;
|
|
143
|
+
for (const [key, value] of Object.entries(shared)) {
|
|
144
|
+
if (!Object.prototype.hasOwnProperty.call(full, key)) return null;
|
|
145
|
+
if (stableJson(full[key]) !== stableJson(value)) return null;
|
|
146
|
+
}
|
|
147
|
+
const member: JsonRecord = {};
|
|
148
|
+
for (const [key, value] of Object.entries(full)) {
|
|
149
|
+
if (!Object.prototype.hasOwnProperty.call(shared, key)) member[key] = value;
|
|
150
|
+
}
|
|
151
|
+
return member;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** The full payload a member part and its shared payload stand for. */
|
|
155
|
+
export function mergeFleetSharedPayload(
|
|
156
|
+
shared: JsonRecord,
|
|
157
|
+
member: JsonRecord,
|
|
158
|
+
): JsonRecord {
|
|
159
|
+
return { ...shared, ...member };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** UTF-8 bytes of a value's JSON, the unit every Fleet storage limit uses. */
|
|
163
|
+
export function jsonUtf8Bytes(value: unknown): number {
|
|
164
|
+
return new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The search text of a Fleet's shared settings: each shared key and its
|
|
169
|
+
* template value, normalized the way monitor search text is (`_` and `-`
|
|
170
|
+
* collapse to spaces, lowercase). A word found only in a Fleet's filter
|
|
171
|
+
* matches the Fleet once, not each of its members (#11087).
|
|
172
|
+
*/
|
|
173
|
+
export function fleetSharedSettingsSearchText(definition: unknown): string {
|
|
174
|
+
if (!isRecord(definition)) return '';
|
|
175
|
+
const template = isRecord(definition.monitor)
|
|
176
|
+
? definition.monitor.payload
|
|
177
|
+
: isRecord(definition.member)
|
|
178
|
+
? definition.member.payload
|
|
179
|
+
: null;
|
|
180
|
+
if (!isRecord(template)) return '';
|
|
181
|
+
return fleetSharedPayloadKeys(definition)
|
|
182
|
+
.map((key) => {
|
|
183
|
+
const value = template[key];
|
|
184
|
+
return `${key} ${typeof value === 'string' ? value : JSON.stringify(value)}`;
|
|
185
|
+
})
|
|
186
|
+
.join(' ')
|
|
187
|
+
.replace(/[_-]+/g, ' ')
|
|
188
|
+
.toLocaleLowerCase();
|
|
189
|
+
}
|