deepline 0.3.552 → 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 +107 -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 +118 -8
- 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 +8 -1
- 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 +9 -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-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/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 +168 -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 +444 -39
- 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-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 +72 -0
- 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 +254 -44
- 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 +259 -52
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +30 -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-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/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-KVSBJZOX.mjs → auth-I3QAU4RV.mjs} +8 -7
- package/dist/cli/auth-MQCN7WGZ.js +44 -0
- package/dist/cli/{billing-54RHFEBI.mjs → billing-3IC54OQQ.mjs} +197 -61
- package/dist/cli/{billing-FQREA7UA.js → billing-YGFFVAIC.js} +297 -161
- package/dist/cli/{chunk-4MK42735.js → chunk-2B5B5KAW.js} +210 -128
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-4NQF6KJ3.js → chunk-3NTP2OSG.js} +13 -13
- package/dist/cli/{chunk-HYC4MKGK.mjs → chunk-45OAVGU6.mjs} +5 -5
- package/dist/cli/{chunk-WLN3SUIA.js → chunk-4747TPLV.js} +3 -3
- package/dist/cli/{chunk-AZQ264ID.mjs → chunk-4BFTDNHU.mjs} +1 -1
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
- package/dist/cli/{chunk-DJ2JDK4O.mjs → chunk-4SMCFQ23.mjs} +1 -1
- package/dist/cli/{chunk-QPKH23EC.mjs → chunk-55F6HNOY.mjs} +5 -5
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-634ZDA3F.js → chunk-6NE3RRRY.js} +1 -1
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-EOPEYCY7.mjs → chunk-72V4PDH5.mjs} +18 -18
- package/dist/cli/{chunk-IHRKLXZN.js → chunk-74RES4DS.js} +5 -5
- package/dist/cli/{chunk-45PVGZST.js → chunk-7GEMELKI.js} +366 -320
- package/dist/cli/{chunk-4UUR4TCH.js → chunk-7O6J6A7P.js} +1871 -92
- package/dist/cli/{chunk-XVB7V4N7.js → chunk-7SERLBNR.js} +161 -53
- package/dist/cli/{chunk-F2LH7TGF.js → chunk-7YRJ5UC4.js} +21 -21
- package/dist/cli/{chunk-YJHE3O5M.mjs → chunk-A7DLBE5K.mjs} +136 -54
- package/dist/cli/{chunk-6PRW5UBA.mjs → chunk-AGICYWGN.mjs} +299 -69
- package/dist/cli/{chunk-S5S355UY.mjs → chunk-AGIQDA2T.mjs} +12 -12
- package/dist/cli/{chunk-RBEUVDZF.js → chunk-AGLR6QVN.js} +249 -107
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-RQZQVFCJ.js → chunk-BVDKFS2T.js} +2 -2
- package/dist/cli/{chunk-PFO3ISXA.js → chunk-CACFJODG.js} +174 -129
- package/dist/cli/{chunk-6RZOWL2V.mjs → chunk-CAEBJOYU.mjs} +1 -1
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-6YCA5NKJ.js → chunk-DP2VH7CO.js} +12 -12
- package/dist/cli/{chunk-AWJPDPMA.mjs → chunk-DP64MD6U.mjs} +1 -1
- package/dist/cli/{chunk-PTVD2GVQ.mjs → chunk-DZA7RFGL.mjs} +5 -5
- package/dist/cli/{chunk-V436Z54K.js → chunk-E2G2DNAB.js} +3 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
- package/dist/cli/{chunk-IDVVIXPJ.js → chunk-FM7LPUPA.js} +41 -41
- package/dist/cli/{chunk-AQWQ2BFX.mjs → chunk-GAVZ4EOD.mjs} +1 -1
- package/dist/cli/{chunk-GKYAYLRI.js → chunk-HEBO3XNZ.js} +27 -31
- package/dist/cli/{chunk-IYSTRCLX.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-HO3XK3R7.js → chunk-IMX7J4DU.js} +8 -8
- package/dist/cli/{chunk-EUPVF4SU.mjs → chunk-INEMTYMT.mjs} +8 -8
- package/dist/cli/{chunk-3FD5EQ62.js → chunk-IUOGII7D.js} +6 -7
- package/dist/cli/{chunk-U7QRMBIY.mjs → chunk-JJGWHITQ.mjs} +5 -5
- package/dist/cli/{chunk-SHLFOPD6.js → chunk-JLGP5XAJ.js} +5 -5
- package/dist/cli/{chunk-4TALT2M3.mjs → chunk-LFOERUQY.mjs} +69 -3
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-Z5TSLLOW.mjs → chunk-LH5PZKER.mjs} +63 -18
- package/dist/cli/{chunk-S46HWQKO.js → chunk-LRDHPOZW.js} +69 -69
- package/dist/cli/{chunk-6ZORHRKB.mjs → chunk-LRZGS6RZ.mjs} +2 -0
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-7IKQKKNX.js → chunk-MLABYI4M.js} +90 -24
- package/dist/cli/{chunk-ZIAXDBXX.mjs → chunk-NDNHYONK.mjs} +17 -21
- package/dist/cli/{chunk-YLTMXJFC.mjs → chunk-OTV2UUKW.mjs} +158 -16
- package/dist/cli/{chunk-G4O75EXF.js → chunk-Q6Z6N3A7.js} +18 -18
- package/dist/cli/{chunk-WE5HES3H.mjs → chunk-QG6JIWUL.mjs} +151 -43
- package/dist/cli/{chunk-QY3ZNU6Z.mjs → chunk-QI5S5HWB.mjs} +2 -2
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-57VZVF5D.mjs → chunk-RMNOZKRI.mjs} +3 -3
- package/dist/cli/{chunk-BAIST2BR.js → chunk-RTV4RF7N.js} +36 -36
- package/dist/cli/{chunk-JWUAX6OP.js → chunk-SBH4CKPN.js} +11 -11
- package/dist/cli/{chunk-FTJLJCE5.mjs → chunk-SG3LUONJ.mjs} +3 -3
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
- package/dist/cli/{chunk-QAORXEY3.mjs → chunk-TN4TY6TT.mjs} +6 -7
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
- package/dist/cli/{chunk-QILKGXYF.mjs → chunk-UVQJYV76.mjs} +2 -2
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-MF2GHZDO.js → chunk-WOCHZCUJ.js} +2 -2
- package/dist/cli/{chunk-VQALXEXO.js → chunk-XLIHTJVM.js} +348 -118
- package/dist/cli/{chunk-ADRC5I3R.js → chunk-Y6SP3JMI.js} +22 -22
- package/dist/cli/{chunk-77AAAGVB.js → chunk-YUA6HA6D.js} +2 -2
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/{chunk-6O5HOODW.mjs → chunk-Z6XPSHKM.mjs} +87 -41
- package/dist/cli/{chunk-QX7LFGJR.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-Q4KPAUJX.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
- package/dist/cli/{csv-F5VAGX4K.js → csv-SA6ELJY6.js} +16 -15
- package/dist/cli/{csv-2PTVDNO6.mjs → csv-ZXZGHWOM.mjs} +7 -6
- package/dist/cli/{db-IEDXAUF7.mjs → db-A54SP6AD.mjs} +16 -16
- package/dist/cli/{db-Z3OIUFMM.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-R3LP74QN.mjs → executions-HL2M2DFU.mjs} +10 -10
- package/dist/cli/{executions-H6H5655J.js → executions-TLFZRHBJ.js} +12 -12
- package/dist/cli/{feedback-VFOUR66B.js → feedback-5UEX5UZK.js} +17 -16
- package/dist/cli/{feedback-WL3MRVT5.mjs → feedback-QMBTNXVG.mjs} +9 -8
- package/dist/cli/git-4JWOOHBG.js +26 -0
- package/dist/cli/{git-YX2J4GCI.mjs → git-LKGXVIVC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-E2JZYKHS.js → integrations-6RUTLMN7.js} +23 -27
- package/dist/cli/{integrations-5ZK5KLVP.mjs → integrations-FGGRVUJ7.mjs} +15 -19
- package/dist/cli/{legacy-noops-3VW4IJTH.js → legacy-noops-J3Z7QRWZ.js} +12 -11
- package/dist/cli/{legacy-noops-SMN3GSXY.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
- package/dist/cli/{mcp-UQV2K4EW.js → mcp-6LWFP7RW.js} +121 -48
- package/dist/cli/{mcp-V6MGCYAG.mjs → mcp-CHDYFO7F.mjs} +100 -27
- package/dist/cli/{monitors-R3BBDCRC.js → monitors-STM6A7OU.js} +221 -186
- package/dist/cli/{monitors-GGKS5W6M.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-2MVO27VO.js → play-SM4CW2GS.js} +1116 -846
- package/dist/cli/{play-MDWPR4XG.mjs → play-SN5YWLS7.mjs} +375 -105
- package/dist/cli/{providers-AKDYFZJZ.mjs → providers-WZ4YBR5Y.mjs} +10 -10
- package/dist/cli/{providers-2AACRUZH.js → providers-WZARYMCF.js} +13 -13
- package/dist/cli/{quickstart-QDGRJFZY.mjs → quickstart-2575BNKA.mjs} +7 -6
- package/dist/cli/{quickstart-H6IV3PV3.js → quickstart-PS4YHQJ6.js} +9 -8
- package/dist/cli/{run-2634REDK.js → run-FLZ6OTM7.js} +51 -51
- package/dist/cli/{run-RTSQNGRD.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-6AOJ4XPP.mjs → search-HLPPKQEO.mjs} +11 -11
- package/dist/cli/search-JJWVHR3N.js +32 -0
- package/dist/cli/{search-output-6ADMTOU5.mjs → search-output-PDAXNOGP.mjs} +9 -8
- package/dist/cli/{search-output-S5ODBL5E.js → search-output-RXJLU36B.js} +12 -11
- package/dist/cli/{secrets-TFIFBFB3.mjs → secrets-CGELYQ3H.mjs} +11 -11
- package/dist/cli/{secrets-LHCIIHMT.js → secrets-QJNG7G2Y.js} +20 -20
- package/dist/cli/sessions-DHTBT2GN.js +23 -0
- package/dist/cli/{sessions-WHBVUHVW.mjs → sessions-ELMWVR4M.mjs} +9 -8
- package/dist/cli/{settings-CP4FVK2W.js → settings-44I44P5F.js} +89 -89
- package/dist/cli/{settings-EBONWL5C.mjs → settings-RR3LZXL7.mjs} +16 -16
- package/dist/cli/{setup-I5AZE3IU.mjs → setup-KGWRWH4B.mjs} +20 -19
- package/dist/cli/{setup-LFGHTNLQ.js → setup-KTEYOCJO.js} +60 -59
- package/dist/cli/skills-EPZPEXI2.js +37 -0
- package/dist/cli/{skills-W76AO5XE.mjs → skills-FPRID2I5.mjs} +10 -9
- package/dist/cli/tools-IGQQ5TML.js +57 -0
- package/dist/cli/{tools-7IJHGF6W.mjs → tools-PI4WMDLY.mjs} +23 -23
- package/dist/cli/update-4RNCVYGE.js +37 -0
- package/dist/cli/{update-GFOPZTHY.mjs → update-VJOJAZ7B.mjs} +14 -11
- package/dist/cli/{views-BPL2TQJ4.js → views-NTUOLNQU.js} +62 -64
- package/dist/cli/{views-D4NX4SBG.mjs → views-OVPSINZO.mjs} +47 -49
- package/dist/cli/{workflow-ZYNAUCKC.js → workflow-2UDYDM6F.js} +23 -23
- package/dist/cli/{workflow-YXP42FUI.mjs → workflow-7OEFNXZC.mjs} +13 -13
- package/dist/{client-CyXGrO4D.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-Bf3IpUKN.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-BxsLnXlm.d.mts → client-core-SLLGBTht.d.mts} +268 -23
- package/dist/{client-core-BWd0lX0Z.d.ts → client-core-p0sOxnkl.d.ts} +268 -23
- package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.mts → 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 +161 -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-MMNVWATX.js +0 -43
- package/dist/cli/concurrent-runs-help-FQAIHKKC.js +0 -21
- package/dist/cli/describe-QDANCTS3.mjs +0 -50
- package/dist/cli/describe-VUTT5ZKU.js +0 -50
- package/dist/cli/git-ETB3GH3K.js +0 -25
- package/dist/cli/org-GRYVMNSW.js +0 -1282
- package/dist/cli/org-Z37NGJV4.mjs +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-VTW2YNBS.js +0 -32
- package/dist/cli/sessions-CJ4FJ2WB.js +0 -22
- package/dist/cli/skills-R7EBXREW.js +0 -36
- package/dist/cli/tools-V7U2BDXM.js +0 -57
- package/dist/cli/update-4COPZETK.js +0 -34
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Keep aliases tied to specific offers for billing replay across deployments.
|
|
2
|
+
const PLAN_OFFER_SKUS = {
|
|
3
|
+
solo: 'payg-v1',
|
|
4
|
+
builder: 'builder-v1',
|
|
5
|
+
team: 'growth-v1',
|
|
6
|
+
scale: 'team-v2',
|
|
7
|
+
founding: 'legacy-growth-v1',
|
|
8
|
+
enterprise: 'enterprise-v1',
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export type PublicBillingPlanSku = keyof typeof PLAN_OFFER_SKUS;
|
|
12
|
+
|
|
13
|
+
export const PUBLIC_PLAN_SKUS = Object.keys(
|
|
14
|
+
PLAN_OFFER_SKUS,
|
|
15
|
+
) as readonly PublicBillingPlanSku[];
|
|
16
|
+
|
|
17
|
+
export function getPublicPlanSku(sku: string): PublicBillingPlanSku | undefined {
|
|
18
|
+
return PUBLIC_PLAN_SKUS.find((alias) => PLAN_OFFER_SKUS[alias] === sku);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function resolvePublicPlanSku(sku: string): string {
|
|
22
|
+
return Object.hasOwn(PLAN_OFFER_SKUS, sku)
|
|
23
|
+
? PLAN_OFFER_SKUS[sku as PublicBillingPlanSku]
|
|
24
|
+
: sku;
|
|
25
|
+
}
|
|
@@ -191,6 +191,8 @@ export type MonitorActionName =
|
|
|
191
191
|
| 'fleet_deactivate'
|
|
192
192
|
| 'fleet_reactivate'
|
|
193
193
|
| 'fleet_billing_suspend'
|
|
194
|
+
/** An operator recorded provider evidence that releases a member's create fence (#10280). */
|
|
195
|
+
| 'fleet_member_fence_release'
|
|
194
196
|
| 'workspace_monitors_suspend'
|
|
195
197
|
| 'admin_verb';
|
|
196
198
|
|
|
@@ -36,6 +36,14 @@ export const POLICY_CREDIT_SUSPENSION_REASON = 'insufficient_balance';
|
|
|
36
36
|
/** The policy's spending-cap pause (KAR-43). */
|
|
37
37
|
export const POLICY_CAP_SUSPENSION_REASON = 'monthly_cap_exceeded';
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* A named workspace's own cap pause (org workspaces Phase 6), both the
|
|
41
|
+
* event-time denial and the policy's. Healed once that workspace's spend this
|
|
42
|
+
* period is under its cap again. Deliberately not `monthly_cap_exceeded`, so
|
|
43
|
+
* org-cap recovery (and every older build) never selects it.
|
|
44
|
+
*/
|
|
45
|
+
export const POLICY_TEAM_CAP_SUSPENSION_REASON = 'team_monthly_cap_exceeded';
|
|
46
|
+
|
|
39
47
|
/**
|
|
40
48
|
* A Fleet's billing suspension that a restored balance heals: an event-time
|
|
41
49
|
* credit denial or the policy's own credit pause. The Fleet's suspension
|
|
@@ -58,6 +66,13 @@ export function isMonitorCapSuspensionReason(
|
|
|
58
66
|
return reason === POLICY_CAP_SUSPENSION_REASON;
|
|
59
67
|
}
|
|
60
68
|
|
|
69
|
+
/** A workspace-cap suspension, healed once that workspace's cap admits. */
|
|
70
|
+
export function isMonitorTeamCapSuspensionReason(
|
|
71
|
+
reason: string | undefined,
|
|
72
|
+
): boolean {
|
|
73
|
+
return reason === POLICY_TEAM_CAP_SUSPENSION_REASON;
|
|
74
|
+
}
|
|
75
|
+
|
|
61
76
|
function isDirectCreditSuspension(input: {
|
|
62
77
|
suspensionReason: string | undefined;
|
|
63
78
|
deactivationReason: string | undefined;
|
|
@@ -78,7 +93,12 @@ function isDirectCreditSuspension(input: {
|
|
|
78
93
|
export type MonitorPauseKind = 'credits' | 'cap' | 'billing';
|
|
79
94
|
|
|
80
95
|
export function monitorPauseKind(reason: string | undefined): MonitorPauseKind {
|
|
81
|
-
if (
|
|
96
|
+
if (
|
|
97
|
+
isMonitorCapSuspensionReason(reason) ||
|
|
98
|
+
isMonitorTeamCapSuspensionReason(reason)
|
|
99
|
+
) {
|
|
100
|
+
return 'cap';
|
|
101
|
+
}
|
|
82
102
|
if (
|
|
83
103
|
isCreditExhaustionSuspensionReason(reason) ||
|
|
84
104
|
reason === POLICY_CREDIT_SUSPENSION_REASON ||
|
|
@@ -117,13 +137,15 @@ export function monitorRecoveryProjection(input: {
|
|
|
117
137
|
return {
|
|
118
138
|
automatic:
|
|
119
139
|
isCreditRestorableFleetSuspensionReason(reason) ||
|
|
120
|
-
isMonitorCapSuspensionReason(reason)
|
|
140
|
+
isMonitorCapSuspensionReason(reason) ||
|
|
141
|
+
isMonitorTeamCapSuspensionReason(reason),
|
|
121
142
|
blocked_by: null,
|
|
122
143
|
};
|
|
123
144
|
}
|
|
124
145
|
if (
|
|
125
146
|
isCreditRestorableDirectMonitorSuspension(input) ||
|
|
126
|
-
isCapRestorableDirectMonitorSuspension(input)
|
|
147
|
+
isCapRestorableDirectMonitorSuspension(input) ||
|
|
148
|
+
isTeamCapRestorableDirectMonitorSuspension(input)
|
|
127
149
|
) {
|
|
128
150
|
return { automatic: true, blocked_by: null };
|
|
129
151
|
}
|
|
@@ -138,7 +160,8 @@ export function monitorRecoveryProjection(input: {
|
|
|
138
160
|
}
|
|
139
161
|
const policyProvenance =
|
|
140
162
|
input.deactivationReason === POLICY_CREDIT_SUSPENSION_REASON ||
|
|
141
|
-
input.deactivationReason === POLICY_CAP_SUSPENSION_REASON
|
|
163
|
+
input.deactivationReason === POLICY_CAP_SUSPENSION_REASON ||
|
|
164
|
+
input.deactivationReason === POLICY_TEAM_CAP_SUSPENSION_REASON;
|
|
142
165
|
return {
|
|
143
166
|
automatic: false,
|
|
144
167
|
blocked_by:
|
|
@@ -245,3 +268,34 @@ export function isCapRestorableDirectMonitorSuspension(input: {
|
|
|
245
268
|
input.deactivationReason === POLICY_CAP_SUSPENSION_REASON
|
|
246
269
|
);
|
|
247
270
|
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Narrow selector for direct workspace-cap suspensions (org workspaces Phase
|
|
274
|
+
* 6): the same rule as `isCapRestorableDirectMonitorSuspension`, for the
|
|
275
|
+
* `team_monthly_cap_exceeded` reason. The caller proves the monitor's own
|
|
276
|
+
* workspace cap (and the org cap) admits; this proves the platform switched
|
|
277
|
+
* the row off for that cap and that upstream cleanup is confirmed.
|
|
278
|
+
*/
|
|
279
|
+
export function isTeamCapRestorableDirectMonitorSuspension(input: {
|
|
280
|
+
fleetId?: string;
|
|
281
|
+
status: string;
|
|
282
|
+
desired?: 'active' | 'inactive';
|
|
283
|
+
deactivationReason?: string;
|
|
284
|
+
billingState: unknown;
|
|
285
|
+
providerBinding: unknown;
|
|
286
|
+
}): boolean {
|
|
287
|
+
if (input.fleetId !== undefined || input.status !== 'disabled') return false;
|
|
288
|
+
const billingState = parseStoredMonitorBillingState(input.billingState);
|
|
289
|
+
if (
|
|
290
|
+
billingState.state !== 'billing_suspended' ||
|
|
291
|
+
!billingState.reactivation_required ||
|
|
292
|
+
!isMonitorTeamCapSuspensionReason(billingState.suspension_reason) ||
|
|
293
|
+
!hasConfirmedProviderMonitorUpstreamCleanup(input.providerBinding)
|
|
294
|
+
) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
return (
|
|
298
|
+
input.desired !== 'inactive' ||
|
|
299
|
+
input.deactivationReason === POLICY_TEAM_CAP_SUSPENSION_REASON
|
|
300
|
+
);
|
|
301
|
+
}
|
|
@@ -266,6 +266,8 @@ export function defineMeteredStaticMonitorBillingPolicy(input: {
|
|
|
266
266
|
provider: string;
|
|
267
267
|
capability: string;
|
|
268
268
|
customerMarkupMultiplier?: number;
|
|
269
|
+
/** See `MonitorBillingPolicy.customerKeyLaneCharge`. */
|
|
270
|
+
customerKeyLaneCharge?: MonitorBillingPolicy['customerKeyLaneCharge'];
|
|
269
271
|
sources: MonitorBillingSourceInput[];
|
|
270
272
|
createProviderComponents: MonitorProviderChargeComponent[];
|
|
271
273
|
usageCharges: {
|
|
@@ -275,6 +277,8 @@ export function defineMeteredStaticMonitorBillingPolicy(input: {
|
|
|
275
277
|
units: number | { min: number; max: number };
|
|
276
278
|
unitCostUsd: number;
|
|
277
279
|
sourceLabel: string;
|
|
280
|
+
/** See `MonitorRetailCharge.basis`. */
|
|
281
|
+
basis?: string;
|
|
278
282
|
}[];
|
|
279
283
|
}): MonitorBillingPolicy {
|
|
280
284
|
const providerCapability = providerMonitorCapabilityId(input);
|
|
@@ -290,6 +294,7 @@ export function defineMeteredStaticMonitorBillingPolicy(input: {
|
|
|
290
294
|
return retailCharge({
|
|
291
295
|
phase: 'webhook_event',
|
|
292
296
|
label: charge.label,
|
|
297
|
+
...(charge.basis ? { basis: charge.basis } : {}),
|
|
293
298
|
components: [
|
|
294
299
|
upstreamMarkupCharge({
|
|
295
300
|
customerLabel: charge.label,
|
|
@@ -370,6 +375,9 @@ export function defineMeteredStaticMonitorBillingPolicy(input: {
|
|
|
370
375
|
}),
|
|
371
376
|
],
|
|
372
377
|
disableOnBillingFailure: true,
|
|
378
|
+
...(input.customerKeyLaneCharge
|
|
379
|
+
? { customerKeyLaneCharge: input.customerKeyLaneCharge }
|
|
380
|
+
: {}),
|
|
373
381
|
};
|
|
374
382
|
}
|
|
375
383
|
|
|
@@ -49,6 +49,17 @@ export function monitorProviderUsdToRetailCredits(
|
|
|
49
49
|
return roundUpMonitorCredits(rawCredits);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Credits for `units` of a per-unit monitor charge. The per-unit price is
|
|
54
|
+
* already rounded; this only removes floating-point noise from the product.
|
|
55
|
+
*/
|
|
56
|
+
export function monitorUnitCredits(perUnitCredits: number, units: number) {
|
|
57
|
+
if (!Number.isSafeInteger(units) || units < 1) {
|
|
58
|
+
throw new Error(`Invalid monitor charge units: ${units}`);
|
|
59
|
+
}
|
|
60
|
+
return roundUpMonitorCredits(perUnitCredits * units);
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
export const MONITOR_BASE_LIFECYCLE_CREDITS = deeplineRetailUsdToCredits(
|
|
53
64
|
MONITOR_BASE_LIFECYCLE_USD,
|
|
54
65
|
);
|
|
@@ -76,6 +76,12 @@ export type MonitorRetailChargeComponent =
|
|
|
76
76
|
export type MonitorRetailCharge = {
|
|
77
77
|
phase: MonitorBillingPhase;
|
|
78
78
|
label: string;
|
|
79
|
+
/**
|
|
80
|
+
* What one charge of this size is for, as the pricing docs show it. Absent
|
|
81
|
+
* means one charge per accepted event; a metered charge billed several
|
|
82
|
+
* times per event says what one unit is.
|
|
83
|
+
*/
|
|
84
|
+
basis?: string;
|
|
79
85
|
components: readonly MonitorRetailChargeComponent[];
|
|
80
86
|
};
|
|
81
87
|
|
|
@@ -178,6 +184,13 @@ export type MonitorBillingPolicy = {
|
|
|
178
184
|
providerChargeComponents: readonly MonitorProviderChargeComponent[];
|
|
179
185
|
disableOnBillingFailure: boolean;
|
|
180
186
|
payloadPricing?: MonitorPayloadPricingMap;
|
|
187
|
+
/**
|
|
188
|
+
* How a run on the workspace's own provider key (binding
|
|
189
|
+
* `credential_lane: 'customer_key'`) is billed. `none`: the provider bills
|
|
190
|
+
* the workspace directly and Deepline charges nothing per event. Required
|
|
191
|
+
* when the capability offers the `customer_key` lane.
|
|
192
|
+
*/
|
|
193
|
+
customerKeyLaneCharge?: 'none';
|
|
181
194
|
};
|
|
182
195
|
|
|
183
196
|
export type MonitorBillingSession = {
|
|
@@ -2,6 +2,11 @@ import {
|
|
|
2
2
|
monitorBillingRequiresExplicitReactivation,
|
|
3
3
|
monitorWithinPaidSubscriptionPeriod,
|
|
4
4
|
} from './billing/state';
|
|
5
|
+
import {
|
|
6
|
+
PROVIDER_MONITOR_CREDENTIAL_LANE_BINDING_FIELD,
|
|
7
|
+
PROVIDER_MONITOR_CREDENTIAL_PAYLOAD_FIELD,
|
|
8
|
+
type ProviderMonitorCredentialLane,
|
|
9
|
+
} from './provider-monitor-capability';
|
|
5
10
|
|
|
6
11
|
/**
|
|
7
12
|
* Why a monitor is desired-inactive.
|
|
@@ -79,6 +84,17 @@ export const MONITOR_DEACTIVATION_REASONS: readonly MonitorDeactivationReasonDef
|
|
|
79
84
|
resolution:
|
|
80
85
|
"Raise the cap, or wait for the next billing period. Monitors are reactivated automatically once this period's spend is under the cap again.",
|
|
81
86
|
},
|
|
87
|
+
{
|
|
88
|
+
// Org workspaces Phase 6. A distinct reason, not `monthly_cap_exceeded`:
|
|
89
|
+
// an older build that does not know it never revives the monitor, and
|
|
90
|
+
// org-cap recovery never selects it.
|
|
91
|
+
id: 'team_monthly_cap_exceeded',
|
|
92
|
+
owner: 'policy',
|
|
93
|
+
summary:
|
|
94
|
+
"Deactivated because the monitor's workspace reached its monthly spending cap.",
|
|
95
|
+
resolution:
|
|
96
|
+
"Ask an organization owner or admin to raise or remove the workspace's cap, or wait for the next billing period. Monitors are reactivated automatically once the workspace's spend this period is under its cap again.",
|
|
97
|
+
},
|
|
82
98
|
{
|
|
83
99
|
id: 'billing_failure',
|
|
84
100
|
owner: 'policy',
|
|
@@ -114,7 +130,7 @@ export const MONITOR_DEACTIVATION_REASONS: readonly MonitorDeactivationReasonDef
|
|
|
114
130
|
id: 'provider_resource_failed',
|
|
115
131
|
owner: 'provider',
|
|
116
132
|
summary:
|
|
117
|
-
'Errored because the provider failed this monitor twice in a row.',
|
|
133
|
+
'Errored because the provider failed this monitor twice in a row, or stopped running it after repeated failed runs.',
|
|
118
134
|
resolution:
|
|
119
135
|
'Update or remove the monitor. Resubmitting the same payload leaves it errored.',
|
|
120
136
|
},
|
|
@@ -202,10 +218,45 @@ export type MonitorPolicyRow = {
|
|
|
202
218
|
fleetId?: string | undefined;
|
|
203
219
|
};
|
|
204
220
|
|
|
205
|
-
|
|
221
|
+
function readRecord(value: unknown): Record<string, unknown> | null {
|
|
222
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
223
|
+
? (value as Record<string, unknown>)
|
|
224
|
+
: null;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The account a monitor's provider runs are billed to, as spend policy reads
|
|
229
|
+
* it from the monitor's own row: the lane its upstream resource was created
|
|
230
|
+
* in (binding `credential_lane`), or, before it has one, the lane its payload
|
|
231
|
+
* names explicitly (`credential: 'byok' | 'deepline'`). Null when neither
|
|
232
|
+
* says: a capability without lanes, or `auto` before its first create. A
|
|
233
|
+
* Fleet member is decided by its Fleet's lane instead, when the Fleet has one
|
|
234
|
+
* (`monitorFleets.credentialLane`).
|
|
235
|
+
*/
|
|
236
|
+
export function monitorPolicyCredentialLane(row: {
|
|
237
|
+
providerBinding?: unknown;
|
|
238
|
+
payload?: unknown;
|
|
239
|
+
}): ProviderMonitorCredentialLane | null {
|
|
240
|
+
const bound =
|
|
241
|
+
readRecord(row.providerBinding)?.[
|
|
242
|
+
PROVIDER_MONITOR_CREDENTIAL_LANE_BINDING_FIELD
|
|
243
|
+
];
|
|
244
|
+
if (bound === 'customer_key' || bound === 'deepline_managed') return bound;
|
|
245
|
+
const choice =
|
|
246
|
+
readRecord(row.payload)?.[PROVIDER_MONITOR_CREDENTIAL_PAYLOAD_FIELD];
|
|
247
|
+
if (choice === 'byok') return 'customer_key';
|
|
248
|
+
if (choice === 'deepline') return 'deepline_managed';
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The spend reasons policy writes and reverts: the wallet and the org cap
|
|
254
|
+
* (KAR-43), and a named workspace's own cap (org workspaces Phase 6).
|
|
255
|
+
*/
|
|
206
256
|
export const SPEND_POLICY_REASONS: ReadonlySet<string> = new Set([
|
|
207
257
|
'insufficient_balance',
|
|
208
258
|
'monthly_cap_exceeded',
|
|
259
|
+
'team_monthly_cap_exceeded',
|
|
209
260
|
]);
|
|
210
261
|
|
|
211
262
|
export type MonitorPolicyDecision =
|
|
@@ -234,19 +285,60 @@ export function decideMonitorBalancePolicy(input: {
|
|
|
234
285
|
* monthly cap (KAR-43). Absent means no cap applies.
|
|
235
286
|
*/
|
|
236
287
|
capExceeded?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* The monitor's own workspace is at or over its workspace cap (org
|
|
290
|
+
* workspaces Phase 6). Absent means no workspace cap applies.
|
|
291
|
+
*/
|
|
292
|
+
teamCapExceeded?: boolean;
|
|
237
293
|
/** Decision time, for the paid-subscription-period exclusion. */
|
|
238
294
|
now?: number;
|
|
295
|
+
/**
|
|
296
|
+
* The monitor runs on the workspace's own provider key (`customer_key`).
|
|
297
|
+
* The provider bills the workspace for its runs and Deepline charges
|
|
298
|
+
* nothing (`customerKeyLaneCharge: 'none'`), so neither the wallet nor a
|
|
299
|
+
* cap is a reason to switch it off. A spend pause of one whose upstream
|
|
300
|
+
* teardown has not settled comes back whatever the balance says; a settled
|
|
301
|
+
* billing suspension (the explicit-reactivation states) is left to the
|
|
302
|
+
* fenced credit recovery, as for any monitor.
|
|
303
|
+
*/
|
|
304
|
+
customerKey?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* The monitor runs on Deepline's own provider account (`deepline_managed`,
|
|
307
|
+
* today Exa managed), which bills Deepline for every run. Each run is
|
|
308
|
+
* charged under finding admission, which refuses a wallet nobody has
|
|
309
|
+
* seeded (`monitorFindingBalanceAdmits`), so for this monitor an unseeded
|
|
310
|
+
* wallet is no credit: left running, Deepline would pay for every run and
|
|
311
|
+
* drop every result (Exa smoke 2026-11-24).
|
|
312
|
+
*/
|
|
313
|
+
managedLane?: boolean;
|
|
239
314
|
}): MonitorPolicyDecision {
|
|
240
|
-
|
|
315
|
+
if (input.customerKey === true) {
|
|
316
|
+
const reason = input.row.deactivationReason;
|
|
317
|
+
return input.row.desired === 'inactive' &&
|
|
318
|
+
reason !== undefined &&
|
|
319
|
+
SPEND_POLICY_REASONS.has(reason) &&
|
|
320
|
+
!monitorBillingRequiresExplicitReactivation(input.row.billingState)
|
|
321
|
+
? { kind: 'reactivate' }
|
|
322
|
+
: { kind: 'none' };
|
|
323
|
+
}
|
|
324
|
+
const admits =
|
|
325
|
+
input.managedLane === true
|
|
326
|
+
? input.balance !== null && input.balance > 0
|
|
327
|
+
: balanceAdmitsMonitors(input.balance);
|
|
241
328
|
const capExceeded = input.capExceeded === true;
|
|
329
|
+
const teamCapExceeded = input.teamCapExceeded === true;
|
|
242
330
|
const reason = input.row.deactivationReason;
|
|
243
331
|
// An exhausted wallet outranks an exceeded cap: a top-up alone must not
|
|
244
332
|
// leave a monitor that the cap still holds off labelled as a credit pause.
|
|
333
|
+
// The org cap outranks the workspace cap the same way: raising the
|
|
334
|
+
// workspace cap alone must not leave it labelled as a workspace pause.
|
|
245
335
|
const offReason = !admits
|
|
246
336
|
? 'insufficient_balance'
|
|
247
337
|
: capExceeded
|
|
248
338
|
? 'monthly_cap_exceeded'
|
|
249
|
-
:
|
|
339
|
+
: teamCapExceeded
|
|
340
|
+
? 'team_monthly_cap_exceeded'
|
|
341
|
+
: null;
|
|
250
342
|
if (offReason !== null) {
|
|
251
343
|
if (input.row.desired === 'inactive') {
|
|
252
344
|
// Already off. Only re-label when policy already owned the reason: a
|
|
@@ -334,6 +426,12 @@ export function monitorShutdownNotificationReason(
|
|
|
334
426
|
) {
|
|
335
427
|
return 'insufficient_credits';
|
|
336
428
|
}
|
|
337
|
-
|
|
429
|
+
// A workspace cap pause has the same remedy: raise the cap.
|
|
430
|
+
if (
|
|
431
|
+
reason === 'monthly_cap_exceeded' ||
|
|
432
|
+
reason === 'team_monthly_cap_exceeded'
|
|
433
|
+
) {
|
|
434
|
+
return 'monthly_cap_exceeded';
|
|
435
|
+
}
|
|
338
436
|
return null;
|
|
339
437
|
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which converge run a Fleet should have, decided from the one run its row
|
|
3
|
+
* points at (`monitorFleets.convergeRunId`) (#10954).
|
|
4
|
+
*
|
|
5
|
+
* A Fleet's converge run used to be named from evidence: its generation and
|
|
6
|
+
* plan hash, then a fingerprint of its newest due member. Names that changed
|
|
7
|
+
* every tick started a run every tick (14 on one Fleet on 2026-11-17); a name
|
|
8
|
+
* that stopped changing pointed at a run that had already failed, and the
|
|
9
|
+
* Fleet never converged again. The Fleet row's pointer is the authority now:
|
|
10
|
+
* a live run is joined, a finished one is followed by a new one, and a failed
|
|
11
|
+
* one is followed only after a backoff, so a Fleet whose members never stop
|
|
12
|
+
* waiting fails (and dead-letters) once per backoff, not once per tick.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export type FleetConvergeRunState =
|
|
16
|
+
| 'running'
|
|
17
|
+
| 'continuation_pending'
|
|
18
|
+
| 'completed'
|
|
19
|
+
| 'failed'
|
|
20
|
+
| 'cancelled';
|
|
21
|
+
|
|
22
|
+
export type FleetConvergeRunFacts = {
|
|
23
|
+
state: FleetConvergeRunState;
|
|
24
|
+
/** A cancel was asked for; the run ends after the page it is on. */
|
|
25
|
+
cancelRequested: boolean;
|
|
26
|
+
/** When the run last changed: its failure time once it has failed. */
|
|
27
|
+
updatedAt: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* How long a Fleet waits after its Nth consecutive failed converge run before
|
|
32
|
+
* starting another. The first retry is soon, since the commonest cause (a
|
|
33
|
+
* provider bulk that finished late) has usually cleared by the time a run
|
|
34
|
+
* spends its no-progress budget; later ones space out to one a day.
|
|
35
|
+
*/
|
|
36
|
+
export const FLEET_CONVERGE_RETRY_BACKOFF_MS = [
|
|
37
|
+
15 * 60_000,
|
|
38
|
+
60 * 60_000,
|
|
39
|
+
4 * 60 * 60_000,
|
|
40
|
+
12 * 60 * 60_000,
|
|
41
|
+
24 * 60 * 60_000,
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
export function fleetConvergeRetryBackoffMs(consecutiveFailures: number) {
|
|
45
|
+
if (!Number.isInteger(consecutiveFailures) || consecutiveFailures < 1) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`A converge retry backoff needs at least one failure, received ${consecutiveFailures}.`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
const index = Math.min(
|
|
51
|
+
consecutiveFailures,
|
|
52
|
+
FLEET_CONVERGE_RETRY_BACKOFF_MS.length,
|
|
53
|
+
);
|
|
54
|
+
return FLEET_CONVERGE_RETRY_BACKOFF_MS[index - 1]!;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type FleetConvergeAdmission =
|
|
58
|
+
/** The pointed-at run is still working the Fleet. */
|
|
59
|
+
| { kind: 'join' }
|
|
60
|
+
/** The last run failed; the next one waits out its backoff. */
|
|
61
|
+
| { kind: 'wait'; retryAt: number; consecutiveFailures: number }
|
|
62
|
+
/**
|
|
63
|
+
* Start a new run. `failedStreak` is what the Fleet records: the failed
|
|
64
|
+
* runs in a row that this one follows, zero when it follows none.
|
|
65
|
+
*/
|
|
66
|
+
| { kind: 'start'; failedStreak: number };
|
|
67
|
+
|
|
68
|
+
export function decideFleetConvergeAdmission(input: {
|
|
69
|
+
/** The run the Fleet points at, or null when it points at none. */
|
|
70
|
+
current: FleetConvergeRunFacts | null;
|
|
71
|
+
/** Failed runs in a row before `current`, as the Fleet recorded them. */
|
|
72
|
+
failedStreak: number;
|
|
73
|
+
now: number;
|
|
74
|
+
}): FleetConvergeAdmission {
|
|
75
|
+
const { current } = input;
|
|
76
|
+
if (current === null) return { kind: 'start', failedStreak: 0 };
|
|
77
|
+
if (current.state === 'running' || current.state === 'continuation_pending') {
|
|
78
|
+
// A run asked to cancel is still working until its page ends. Starting
|
|
79
|
+
// another beside it is the two-runs-on-one-Fleet race (#10624).
|
|
80
|
+
return { kind: 'join' };
|
|
81
|
+
}
|
|
82
|
+
if (current.state === 'failed') {
|
|
83
|
+
const consecutiveFailures = input.failedStreak + 1;
|
|
84
|
+
const retryAt =
|
|
85
|
+
current.updatedAt + fleetConvergeRetryBackoffMs(consecutiveFailures);
|
|
86
|
+
return input.now < retryAt
|
|
87
|
+
? { kind: 'wait', retryAt, consecutiveFailures }
|
|
88
|
+
: { kind: 'start', failedStreak: consecutiveFailures };
|
|
89
|
+
}
|
|
90
|
+
return { kind: 'start', failedStreak: 0 };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type FleetLifecycleAdmission =
|
|
94
|
+
/** The pointed-at run is working, finished, or there is none yet: submit it by its own key. */
|
|
95
|
+
| { kind: 'join' }
|
|
96
|
+
/** The run failed; the next attempt waits out its backoff. */
|
|
97
|
+
| { kind: 'wait'; retryAt: number; consecutiveFailures: number }
|
|
98
|
+
/** Start the next attempt. `failedStreak` is the failed runs it follows. */
|
|
99
|
+
| { kind: 'start'; failedStreak: number };
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Which run a Fleet's lifecycle transition (deactivate, billing suspension,
|
|
103
|
+
* billing reactivation) should have, decided from the run it points at
|
|
104
|
+
* (#10280).
|
|
105
|
+
*
|
|
106
|
+
* The first attempt of an epoch keeps `fleet-<kind>-<epoch>-<fleet>`, and
|
|
107
|
+
* submitting that key again rejoins it, which is right while it works and
|
|
108
|
+
* after it completes. A failed one used to be rejoined forever: the Fleet
|
|
109
|
+
* stayed `deactivating` with nothing driving it (Kindred, 2026-11-19). A
|
|
110
|
+
* failed run is now followed by a new attempt after the same backoff converge
|
|
111
|
+
* uses. An explicit request (a person asking to deactivate again) skips the
|
|
112
|
+
* backoff, since someone is waiting on the answer.
|
|
113
|
+
*
|
|
114
|
+
* A completed or cancelled run is still joined, not restarted: the counter
|
|
115
|
+
* fold finishes the transition from member rows, and a run started every tick
|
|
116
|
+
* while that fold catches up would only walk settled members.
|
|
117
|
+
*/
|
|
118
|
+
export function decideFleetLifecycleAdmission(input: {
|
|
119
|
+
current: FleetConvergeRunFacts | null;
|
|
120
|
+
failedStreak: number;
|
|
121
|
+
now: number;
|
|
122
|
+
explicit: boolean;
|
|
123
|
+
}): FleetLifecycleAdmission {
|
|
124
|
+
const { current } = input;
|
|
125
|
+
if (current === null || current.state !== 'failed') return { kind: 'join' };
|
|
126
|
+
const consecutiveFailures = input.failedStreak + 1;
|
|
127
|
+
if (input.explicit) return { kind: 'start', failedStreak: consecutiveFailures };
|
|
128
|
+
const retryAt =
|
|
129
|
+
current.updatedAt + fleetConvergeRetryBackoffMs(consecutiveFailures);
|
|
130
|
+
return input.now < retryAt
|
|
131
|
+
? { kind: 'wait', retryAt, consecutiveFailures }
|
|
132
|
+
: { kind: 'start', failedStreak: consecutiveFailures };
|
|
133
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FLEET_FENCE_HOLDING_STATES,
|
|
3
|
+
fleetFenceReleasedOnEvidence,
|
|
4
|
+
type FleetFenceReleaseMember,
|
|
5
|
+
} from './fence-release';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Fleet create fences that need an operator (#11210).
|
|
9
|
+
*
|
|
10
|
+
* A Fleet member whose bulk create got no answer is fenced "provider
|
|
11
|
+
* acceptance unknown" and re-read every 30 s. Most resolve on their own: the
|
|
12
|
+
* provider accepted the create late and a read finds the radar. When the
|
|
13
|
+
* read does not find it, either because a complete inventory read misses it
|
|
14
|
+
* or because the account listing is longer than the one page a convergence
|
|
15
|
+
* pass reads (every 100K-member account), nothing automatic may end the
|
|
16
|
+
* fence; only an operator releasing it on evidence
|
|
17
|
+
* (`deepline-admin monitors fleets release-fence-op`, which walks the whole
|
|
18
|
+
* listing) does.
|
|
19
|
+
*
|
|
20
|
+
* Each such create batch (one fence op, at most 100 members) gets one row in
|
|
21
|
+
* `providerMonitorFleetFenceAttention`, written by the settle that records the
|
|
22
|
+
* miss and cleared member by member by the settles that end those fences. The
|
|
23
|
+
* operations queue `monitor-fleet-fence-attention` lists the rows
|
|
24
|
+
* (`deepline-admin operations queue-items monitor-fleet-fence-attention`), and a
|
|
25
|
+
* batch still listed after `FLEET_FENCE_ATTENTION_ALERT_MS` raises one
|
|
26
|
+
* Production alert. The member rows stay the truth: every reader re-reads a
|
|
27
|
+
* row's members and ignores any that no longer carries the fence, since many
|
|
28
|
+
* writers (Fleet deletion, member removal) can end one.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* How long a batch stays listed before it alerts. TamRadar has made an
|
|
33
|
+
* accepted create's radars hours late (`provider-bulk-wait.ts`), so a first
|
|
34
|
+
* miss is not yet a stuck create; an hour matches the alert for a bulk still
|
|
35
|
+
* `processing` (`PROVIDER_BULK_WAIT_ALERT_MS`).
|
|
36
|
+
*/
|
|
37
|
+
export const FLEET_FENCE_ATTENTION_ALERT_MS = 60 * 60_000;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* How often a batch's `lastAbsentAt` is refreshed while its members keep
|
|
41
|
+
* missing, at most. A stuck member is re-read every 30 s; refreshing the row
|
|
42
|
+
* on each would put a write on every settle that carries one.
|
|
43
|
+
*/
|
|
44
|
+
export const FLEET_FENCE_ATTENTION_REFRESH_MS = 10 * 60_000;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A batch whose members have recorded no miss for this long is no longer
|
|
48
|
+
* being re-read (its fences ended elsewhere, or its Fleet stopped
|
|
49
|
+
* converging): queue health stops counting it as blocked. The listing still
|
|
50
|
+
* shows it, with its members re-read.
|
|
51
|
+
*/
|
|
52
|
+
export const FLEET_FENCE_ATTENTION_STALE_MS = 60 * 60_000;
|
|
53
|
+
|
|
54
|
+
/** Batches one queue page lists, each with up to 100 members re-read. */
|
|
55
|
+
export const FLEET_FENCE_ATTENTION_PAGE_MAX = 25;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* How long a claimed alert waits for its delivery to be acknowledged before
|
|
59
|
+
* another pass may claim and send it again. A worker that dies between the
|
|
60
|
+
* claim and the send never loses the alert, only delays it.
|
|
61
|
+
*/
|
|
62
|
+
export const FLEET_FENCE_ATTENTION_CLAIM_LEASE_MS = 10 * 60_000;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* What the read that listed a member found: a complete inventory that does
|
|
66
|
+
* not name the create, or a listing too long to read in one pass.
|
|
67
|
+
*/
|
|
68
|
+
export type FleetFenceAttentionMiss =
|
|
69
|
+
| 'inventory_absent'
|
|
70
|
+
| 'inventory_truncated';
|
|
71
|
+
|
|
72
|
+
/** Batches one alert claim reads and reports, at most. */
|
|
73
|
+
export const FLEET_FENCE_ATTENTION_REPORT_MAX_ROWS = 10;
|
|
74
|
+
|
|
75
|
+
/** The most members one batch lists: one bulk create carries at most 100. */
|
|
76
|
+
export const FLEET_FENCE_ATTENTION_MAX_KEYS = 100;
|
|
77
|
+
|
|
78
|
+
/** The member fields that decide whether a member still needs an operator. */
|
|
79
|
+
export type FleetFenceAttentionMember = Pick<
|
|
80
|
+
FleetFenceReleaseMember,
|
|
81
|
+
| 'monitorKey'
|
|
82
|
+
| 'fleetId'
|
|
83
|
+
| 'opId'
|
|
84
|
+
| 'convergence'
|
|
85
|
+
| 'providerOpRef'
|
|
86
|
+
| 'opSubmission'
|
|
87
|
+
>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Whether a member still waits on an operator for the fence a batch row lists
|
|
91
|
+
* it under: same Fleet, same fence op, in a state a fence survives in, and no
|
|
92
|
+
* release evidence recorded on it yet (that member waits on its next claim).
|
|
93
|
+
*/
|
|
94
|
+
export function fleetFenceAttentionHolds(
|
|
95
|
+
row: { fleetId: string; opId: string },
|
|
96
|
+
member: FleetFenceAttentionMember | null | undefined,
|
|
97
|
+
): boolean {
|
|
98
|
+
return (
|
|
99
|
+
member !== null &&
|
|
100
|
+
member !== undefined &&
|
|
101
|
+
member.fleetId === row.fleetId &&
|
|
102
|
+
member.opId === row.opId &&
|
|
103
|
+
(FLEET_FENCE_HOLDING_STATES as readonly string[]).includes(
|
|
104
|
+
member.convergence ?? '',
|
|
105
|
+
) &&
|
|
106
|
+
!fleetFenceReleasedOnEvidence({
|
|
107
|
+
opId: member.opId,
|
|
108
|
+
providerOpRef: member.providerOpRef ?? null,
|
|
109
|
+
opSubmission: member.opSubmission ?? null,
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The command that releases one batch, dry run first. */
|
|
115
|
+
export function fleetFenceAttentionReleaseCommand(input: {
|
|
116
|
+
orgId: string;
|
|
117
|
+
fleetId: string;
|
|
118
|
+
opId: string;
|
|
119
|
+
}): string {
|
|
120
|
+
return `deepline-admin monitors fleets release-fence-op ${input.orgId} ${input.fleetId} ${input.opId} --proof '<evidence TamRadar never accepted the create, with a link>' --dry-run --environment production`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** One batch an alert reports. */
|
|
124
|
+
export type FleetFenceAttentionReport = {
|
|
125
|
+
opId: string;
|
|
126
|
+
members: number;
|
|
127
|
+
firstAbsentAt: number;
|
|
128
|
+
sample: string[];
|
|
129
|
+
/** The latest read was a truncated listing, not a complete miss. */
|
|
130
|
+
truncated: boolean;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** The alert's text for the batches of one Fleet that crossed the threshold. */
|
|
134
|
+
export function fleetFenceAttentionAlertDetail(input: {
|
|
135
|
+
orgId: string;
|
|
136
|
+
fleetId: string;
|
|
137
|
+
reports: readonly FleetFenceAttentionReport[];
|
|
138
|
+
/** Batches past the threshold this claim did not report. */
|
|
139
|
+
more: boolean;
|
|
140
|
+
now: number;
|
|
141
|
+
}): string {
|
|
142
|
+
const members = input.reports.reduce(
|
|
143
|
+
(total, report) => total + report.members,
|
|
144
|
+
0,
|
|
145
|
+
);
|
|
146
|
+
const oldest = Math.min(
|
|
147
|
+
...input.reports.map((report) => report.firstAbsentAt),
|
|
148
|
+
);
|
|
149
|
+
const hours = Math.max(1, Math.floor((input.now - oldest) / (60 * 60_000)));
|
|
150
|
+
const batches = input.reports.map((report) => report.opId);
|
|
151
|
+
return [
|
|
152
|
+
`Fleet ${input.fleetId}: ${members} member(s) in ${input.reports.length}${input.more ? '+' : ''} create batch(es) have been fenced "provider acceptance unknown" for over ${hours} h.`,
|
|
153
|
+
input.reports.some((report) => report.truncated)
|
|
154
|
+
? "Their bulk create got no answer, and the convergence's TamRadar reads cannot find the radars: the account listing is longer than one read (or a complete read misses them). Nothing automatic will release them, and Deepline never sends the creates again on its own; the release walks the whole listing."
|
|
155
|
+
: 'Their bulk create got no answer and complete TamRadar inventory reads still do not find the radars, so nothing automatic will release them, and Deepline never sends the creates again on its own.',
|
|
156
|
+
`Batches (fence op ids): ${batches.join(', ')}${input.more ? ', and more (deepline-admin operations queue-items monitor-fleet-fence-attention --environment production)' : ''}.`,
|
|
157
|
+
'To release one: confirm with TamRadar or the request logs that the POST was never accepted, then run',
|
|
158
|
+
fleetFenceAttentionReleaseCommand({
|
|
159
|
+
orgId: input.orgId,
|
|
160
|
+
fleetId: input.fleetId,
|
|
161
|
+
opId: batches[0]!,
|
|
162
|
+
}),
|
|
163
|
+
'and apply it with --yes; rerun the apply until its listing walk completes.',
|
|
164
|
+
].join(' ');
|
|
165
|
+
}
|