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
|
@@ -58,6 +58,12 @@ export type ProviderMonitorIdentityReservation =
|
|
|
58
58
|
monitorKey: string;
|
|
59
59
|
state: 'provisioning' | 'active' | 'migration_conflict';
|
|
60
60
|
conflictingMonitorKeys?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* The holder is a deleted monitor that holds nothing by the lifecycle
|
|
63
|
+
* rules (#10305). The target is still occupied until an operator
|
|
64
|
+
* releases the orphaned claim.
|
|
65
|
+
*/
|
|
66
|
+
holderOrphaned?: true;
|
|
61
67
|
}
|
|
62
68
|
| {
|
|
63
69
|
kind: 'in_progress';
|
|
@@ -81,6 +87,8 @@ export type ProviderMonitorLifecycleReservation =
|
|
|
81
87
|
kind: 'in_progress';
|
|
82
88
|
state: 'provisioning' | 'deleting';
|
|
83
89
|
retryAt: number;
|
|
90
|
+
/** A create whose provider answer was lost holds this fence. */
|
|
91
|
+
createOutcomeUnknown?: true;
|
|
84
92
|
}
|
|
85
93
|
| {
|
|
86
94
|
kind: 'deleting';
|
|
@@ -142,6 +150,9 @@ export function normalizeProviderMonitorLifecycleReservation(input: {
|
|
|
142
150
|
kind: 'in_progress',
|
|
143
151
|
state: result.state as 'provisioning' | 'deleting',
|
|
144
152
|
retryAt: result.retryAt as number,
|
|
153
|
+
...(result.createOutcomeUnknown === true
|
|
154
|
+
? { createOutcomeUnknown: true as const }
|
|
155
|
+
: {}),
|
|
145
156
|
};
|
|
146
157
|
}
|
|
147
158
|
return {
|
|
@@ -297,6 +308,12 @@ export async function beginProviderMonitorLifecycleReservation(input: {
|
|
|
297
308
|
priorityExecutionSlots?: number;
|
|
298
309
|
expectedControlStateRevision?: number;
|
|
299
310
|
requiredMonitorStatus?: 'active';
|
|
311
|
+
/**
|
|
312
|
+
* A deploy or start's request time. The provisioning fence records it on
|
|
313
|
+
* the monitor, so an older customer stop waiting for the fence leaves the
|
|
314
|
+
* monitor running. Ignored for a deletion.
|
|
315
|
+
*/
|
|
316
|
+
requestedAt?: number;
|
|
300
317
|
}): Promise<ProviderMonitorLifecycleReservation> {
|
|
301
318
|
const operationId = input.operationId ?? randomUUID();
|
|
302
319
|
const action =
|
|
@@ -318,6 +335,9 @@ export async function beginProviderMonitorLifecycleReservation(input: {
|
|
|
318
335
|
...(input.requiredMonitorStatus
|
|
319
336
|
? { requiredMonitorStatus: input.requiredMonitorStatus }
|
|
320
337
|
: {}),
|
|
338
|
+
...(input.state === 'provisioning' && input.requestedAt !== undefined
|
|
339
|
+
? { requestedAt: input.requestedAt }
|
|
340
|
+
: {}),
|
|
321
341
|
});
|
|
322
342
|
let result = await retryProviderMonitorLifecycleAdmission(request);
|
|
323
343
|
if (result.kind === 'backfill_required') {
|
|
@@ -383,6 +403,8 @@ export async function beginProviderMonitorProvisioningBatch(input: {
|
|
|
383
403
|
operationId: string;
|
|
384
404
|
entityKey?: string | null;
|
|
385
405
|
}>;
|
|
406
|
+
/** The deploy or start's request time; see the scalar reservation. */
|
|
407
|
+
requestedAt?: number;
|
|
386
408
|
}): Promise<Map<string, ProviderMonitorLifecycleAdmission>> {
|
|
387
409
|
const client = getRequiredInternalConvexClient();
|
|
388
410
|
const orgId = input.auth.orgId;
|
|
@@ -396,6 +418,9 @@ export async function beginProviderMonitorProvisioningBatch(input: {
|
|
|
396
418
|
operationId: item.operationId,
|
|
397
419
|
entityKey: item.entityKey ?? null,
|
|
398
420
|
state: 'provisioning',
|
|
421
|
+
...(input.requestedAt === undefined
|
|
422
|
+
? {}
|
|
423
|
+
: { requestedAt: input.requestedAt }),
|
|
399
424
|
});
|
|
400
425
|
for (
|
|
401
426
|
let offset = 0;
|
|
@@ -455,6 +480,9 @@ export async function beginProviderMonitorProvisioningBatch(input: {
|
|
|
455
480
|
{
|
|
456
481
|
orgId,
|
|
457
482
|
...(admission ? { reservationId } : {}),
|
|
483
|
+
...(input.requestedAt === undefined
|
|
484
|
+
? {}
|
|
485
|
+
: { requestedAt: input.requestedAt }),
|
|
458
486
|
items: chunk.map((item) => ({
|
|
459
487
|
monitorKey: item.monitorKey,
|
|
460
488
|
operationId: item.operationId,
|
|
@@ -595,6 +623,29 @@ export function failProviderMonitorLifecycleReservation(input: {
|
|
|
595
623
|
);
|
|
596
624
|
}
|
|
597
625
|
|
|
626
|
+
/**
|
|
627
|
+
* Keep a create's lifecycle fence while its provider outcome is unknown (see
|
|
628
|
+
* `holdLifecycleProvisioning`). Returns when the hold ends, or null when this
|
|
629
|
+
* operation no longer holds the fence.
|
|
630
|
+
*/
|
|
631
|
+
export async function holdProviderMonitorLifecycleProvisioning(input: {
|
|
632
|
+
auth: OrgAuthContext;
|
|
633
|
+
monitorKey: string;
|
|
634
|
+
operationId: string;
|
|
635
|
+
}): Promise<number | null> {
|
|
636
|
+
const result = (await getRequiredInternalConvexClient().mutation(
|
|
637
|
+
internal.providerMonitorIdentityClaims.holdLifecycleProvisioning,
|
|
638
|
+
{
|
|
639
|
+
orgId: input.auth.orgId,
|
|
640
|
+
monitorKey: input.monitorKey,
|
|
641
|
+
operationId: input.operationId,
|
|
642
|
+
},
|
|
643
|
+
)) as { held: boolean; leaseExpiresAt?: number };
|
|
644
|
+
return result.held && typeof result.leaseExpiresAt === 'number'
|
|
645
|
+
? result.leaseExpiresAt
|
|
646
|
+
: null;
|
|
647
|
+
}
|
|
648
|
+
|
|
598
649
|
export async function beginProviderMonitorIdentityReservation(input: {
|
|
599
650
|
auth: OrgAuthContext;
|
|
600
651
|
monitorKey: string;
|
|
@@ -606,11 +657,17 @@ export async function beginProviderMonitorIdentityReservation(input: {
|
|
|
606
657
|
* see `reclaimSelfProvisioning` on the mutation.
|
|
607
658
|
*/
|
|
608
659
|
reclaimSelfProvisioning?: boolean;
|
|
660
|
+
/**
|
|
661
|
+
* The id to reserve under. A Fleet create passes its fence's op id, so the
|
|
662
|
+
* settle that clears that fence ends exactly the reservations its pass made
|
|
663
|
+
* (`endFenceReservationsInMutation`). Defaults to a new id.
|
|
664
|
+
*/
|
|
665
|
+
operationId?: string;
|
|
609
666
|
}): Promise<ProviderMonitorIdentityReservation | null> {
|
|
610
667
|
const claim = providerMonitorIdentityClaim(input);
|
|
611
668
|
if (!claim) return null;
|
|
612
669
|
await ensureProviderMonitorIdentityBackfill({ auth: input.auth });
|
|
613
|
-
const operationId = randomUUID();
|
|
670
|
+
const operationId = input.operationId ?? randomUUID();
|
|
614
671
|
const result = await getRequiredInternalConvexClient().mutation(
|
|
615
672
|
internal.providerMonitorIdentityClaims.begin,
|
|
616
673
|
{
|
|
@@ -639,45 +696,24 @@ export async function beginProviderMonitorIdentityReservation(input: {
|
|
|
639
696
|
return { ...result, claim };
|
|
640
697
|
}
|
|
641
698
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
operationId?: string;
|
|
649
|
-
},
|
|
650
|
-
) {
|
|
699
|
+
export function activateProviderMonitorIdentityReservation(input: {
|
|
700
|
+
auth: OrgAuthContext;
|
|
701
|
+
monitorKey: string;
|
|
702
|
+
claim: ProviderMonitorIdentityClaim;
|
|
703
|
+
operationId: string;
|
|
704
|
+
}) {
|
|
651
705
|
return getRequiredInternalConvexClient().mutation(
|
|
652
|
-
internal.providerMonitorIdentityClaims
|
|
706
|
+
internal.providerMonitorIdentityClaims.activate,
|
|
653
707
|
{
|
|
654
708
|
orgId: input.auth.orgId,
|
|
655
709
|
tool: input.claim.tool,
|
|
656
710
|
identityKey: input.claim.identityKey,
|
|
657
|
-
...(action === 'release' ? { scopeKey: input.claim.scopeKey } : {}),
|
|
658
711
|
monitorKey: input.monitorKey,
|
|
659
|
-
|
|
712
|
+
operationId: input.operationId,
|
|
660
713
|
},
|
|
661
714
|
);
|
|
662
715
|
}
|
|
663
716
|
|
|
664
|
-
export function activateProviderMonitorIdentityReservation(input: {
|
|
665
|
-
auth: OrgAuthContext;
|
|
666
|
-
monitorKey: string;
|
|
667
|
-
claim: ProviderMonitorIdentityClaim;
|
|
668
|
-
operationId: string;
|
|
669
|
-
}) {
|
|
670
|
-
return mutateClaim('activate', input);
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
export function releaseProviderMonitorIdentityClaim(input: {
|
|
674
|
-
auth: OrgAuthContext;
|
|
675
|
-
monitorKey: string;
|
|
676
|
-
claim: ProviderMonitorIdentityClaim;
|
|
677
|
-
}) {
|
|
678
|
-
return mutateClaim('release', input);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
717
|
export function failProviderMonitorIdentityReservation(input: {
|
|
682
718
|
auth: OrgAuthContext;
|
|
683
719
|
monitorKey: string;
|
|
@@ -81,6 +81,36 @@ export function providerMonitorResourceId(
|
|
|
81
81
|
return normalized === '' ? null : (normalized as ProviderMonitorResourceId);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* The binding identity every native monitor row records
|
|
86
|
+
* (`_dl_binding_id`, `_dl_monitor_binding_version`), read from the stored
|
|
87
|
+
* provider binding. Each inbound handler passes it to its row writer, so a
|
|
88
|
+
* row says which binding of the monitor delivered it, including across a
|
|
89
|
+
* replacement.
|
|
90
|
+
*/
|
|
91
|
+
export function providerMonitorBindingWriteIdentity(
|
|
92
|
+
binding: Record<string, unknown>,
|
|
93
|
+
): { bindingId?: string; bindingVersion?: number } {
|
|
94
|
+
const bindingId =
|
|
95
|
+
typeof binding.binding_id === 'string' && binding.binding_id.trim()
|
|
96
|
+
? binding.binding_id
|
|
97
|
+
: undefined;
|
|
98
|
+
const rawVersion = binding.binding_version;
|
|
99
|
+
const parsedVersion =
|
|
100
|
+
typeof rawVersion === 'number'
|
|
101
|
+
? rawVersion
|
|
102
|
+
: typeof rawVersion === 'string' && rawVersion.trim()
|
|
103
|
+
? Number(rawVersion)
|
|
104
|
+
: Number.NaN;
|
|
105
|
+
const bindingVersion = Number.isFinite(parsedVersion)
|
|
106
|
+
? parsedVersion
|
|
107
|
+
: undefined;
|
|
108
|
+
return {
|
|
109
|
+
...(bindingId === undefined ? {} : { bindingId }),
|
|
110
|
+
...(bindingVersion === undefined ? {} : { bindingVersion }),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
84
114
|
/**
|
|
85
115
|
* A provider-neutral proof that this control record has an upstream
|
|
86
116
|
* counterpart. The identifier might be a radar id today and a different
|
|
@@ -49,6 +49,23 @@ export function isKnownTamradarRadarFailureReason(reason: string): boolean {
|
|
|
49
49
|
return KNOWN_TAMRADAR_RADAR_FAILURE_REASONS.has(reason);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* The provider stopped running the monitor on its own after repeated failed
|
|
54
|
+
* runs: Exa disables a monitor after 10 consecutive failed runs, and the
|
|
55
|
+
* monitor audit reads that status (`readProviderStatus` on the capability).
|
|
56
|
+
* It errors the monitor at once: a recreate from the same payload would run
|
|
57
|
+
* into the same failures.
|
|
58
|
+
*/
|
|
59
|
+
export const PROVIDER_MONITOR_DISABLED_REASON = 'monitor_disabled';
|
|
60
|
+
|
|
61
|
+
/** Every reason the errored rule has been decided for, any provider. */
|
|
62
|
+
function isKnownProviderResourceFailureReason(reason: string): boolean {
|
|
63
|
+
return (
|
|
64
|
+
isKnownTamradarRadarFailureReason(reason) ||
|
|
65
|
+
reason === PROVIDER_MONITOR_DISABLED_REASON
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
52
69
|
/**
|
|
53
70
|
* The `provider`-owned deactivation reasons that mean `errored`. Declared in
|
|
54
71
|
* `deactivation-reasons.ts`; repeated here, import-free, so the customer state
|
|
@@ -147,7 +164,10 @@ export function decideProviderResourceFailure(input: {
|
|
|
147
164
|
deactivationReason: 'provider_source_inaccessible',
|
|
148
165
|
};
|
|
149
166
|
}
|
|
150
|
-
if (
|
|
167
|
+
if (
|
|
168
|
+
event.reason === PROVIDER_MONITOR_DISABLED_REASON ||
|
|
169
|
+
failureCount >= PROVIDER_RESOURCE_FAILURES_BEFORE_ERRORED
|
|
170
|
+
) {
|
|
151
171
|
return {
|
|
152
172
|
kind: 'errored',
|
|
153
173
|
failure,
|
|
@@ -220,6 +240,9 @@ export function providerResourceFailureMessage(input: {
|
|
|
220
240
|
? "This LinkedIn URL no longer resolves (the provider could not reach it). Update the monitor with the person's current URL, or remove it."
|
|
221
241
|
: 'The provider could not reach the source this monitor watches (reason: source_inaccessible). Update the monitor with a source that resolves, or remove it.';
|
|
222
242
|
}
|
|
243
|
+
if (input.reason === PROVIDER_MONITOR_DISABLED_REASON) {
|
|
244
|
+
return 'The provider stopped running this monitor after repeated failed runs (reason: monitor_disabled). Check the connected key if it uses your own, then update the monitor, or remove it.';
|
|
245
|
+
}
|
|
223
246
|
return `The provider could not run this monitor (reason: ${input.reason}). Update or remove the monitor.`;
|
|
224
247
|
}
|
|
225
248
|
|
|
@@ -309,11 +332,11 @@ export function providerResourceFailureAlert(input: {
|
|
|
309
332
|
sourceCapability?: string | null;
|
|
310
333
|
}): { reason: string; detail: string } | null {
|
|
311
334
|
if (input.outcome === 'duplicate') return null;
|
|
312
|
-
const unknownReason = !
|
|
335
|
+
const unknownReason = !isKnownProviderResourceFailureReason(input.reason);
|
|
313
336
|
const errored = input.outcome === 'errored';
|
|
314
337
|
if (!errored && !unknownReason) return null;
|
|
315
338
|
const parts = [
|
|
316
|
-
`
|
|
339
|
+
`provider resource failure reason=${input.reason} on ${input.providerResourceId}`,
|
|
317
340
|
`outcome=${input.outcome}`,
|
|
318
341
|
...(input.failureCount ? [`failure ${input.failureCount}`] : []),
|
|
319
342
|
...(input.errorId ? [`error_id=${input.errorId}`] : []),
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
PROVIDER_MONITOR_CONTROL_STATE_PENDING_CODE,
|
|
7
7
|
} from '@deepline/monitors/signal-radars/inbound-failure-codes';
|
|
8
8
|
import type { SignalRadarInboundMessage } from '@deepline/monitors/signal-radars/inbound-message';
|
|
9
|
+
import { rawReceiptWriteFailedError } from '@deepline/monitors/signal-radars/raw-receipt-causes';
|
|
9
10
|
import {
|
|
10
11
|
hasMonitorSdkValidationIssues,
|
|
11
12
|
MONITOR_SDK_VALIDATION_ERROR_CODE,
|
|
@@ -110,6 +111,17 @@ function inboundFailureCode(error: unknown): string {
|
|
|
110
111
|
: '';
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
/** The raw receipt a failed delivery left `write_failed`, when it names one. */
|
|
115
|
+
function inboundFailureRawId(error: unknown): string | null {
|
|
116
|
+
const rawId =
|
|
117
|
+
error && typeof error === 'object'
|
|
118
|
+
? (error as { rawId?: unknown }).rawId
|
|
119
|
+
: undefined;
|
|
120
|
+
return typeof rawId === 'string' && rawId.length > 0 && rawId.length <= 300
|
|
121
|
+
? rawId
|
|
122
|
+
: null;
|
|
123
|
+
}
|
|
124
|
+
|
|
113
125
|
export function classifyInboundFailure(error: unknown): InboundFailureClass {
|
|
114
126
|
if (isRepairableTenantDataPlaneError(error)) return 'transient';
|
|
115
127
|
|
|
@@ -221,23 +233,40 @@ type DeadLetterMessageInput = Pick<
|
|
|
221
233
|
|
|
222
234
|
async function markCapturedRawWriteFailed(
|
|
223
235
|
client: InboundPgClient,
|
|
224
|
-
eventIdempotencyKey: string,
|
|
236
|
+
receipt: { eventIdempotencyKey: string | null; rawId: string | null },
|
|
225
237
|
lastError: string,
|
|
226
238
|
) {
|
|
227
239
|
// The capture-first raw row (dl_meta.monitor_inbound_raw) may already exist for
|
|
228
240
|
// this event. Flip it to write_failed so on-call sees "captured, dead-lettered,
|
|
229
|
-
// replayable" in one place
|
|
241
|
+
// replayable" in one place; the `dead_lettered` cause points the raw-receipt
|
|
242
|
+
// reader at the dead letter. Best-effort: a missing table/row must not block the
|
|
230
243
|
// dead-letter record itself.
|
|
244
|
+
//
|
|
245
|
+
// A receipt keyed by the receiver's key is found by that key. One keyed by a
|
|
246
|
+
// semantic finding identity (every TamRadar finding) has another key, so the
|
|
247
|
+
// worker names it by id. That receipt is marked only while it still holds
|
|
248
|
+
// the failure this dead letter records (`write_failed`, with the writer's
|
|
249
|
+
// own message, which is the failure's message): a redelivery that has since
|
|
250
|
+
// reclaimed it, written it, or failed it another way is left alone.
|
|
251
|
+
if (!receipt.eventIdempotencyKey && !receipt.rawId) return;
|
|
231
252
|
try {
|
|
232
253
|
await client.query(
|
|
233
254
|
`UPDATE dl_meta.monitor_inbound_raw
|
|
234
255
|
SET status = 'write_failed', error = $2, updated_at = now()
|
|
235
|
-
WHERE event_idempotency_key = $1
|
|
236
|
-
|
|
256
|
+
WHERE ($1::text IS NOT NULL AND event_idempotency_key = $1::text)
|
|
257
|
+
OR ($3::text IS NOT NULL AND raw_id = $3::text
|
|
258
|
+
AND status = 'write_failed' AND error = $4::text)`,
|
|
259
|
+
[
|
|
260
|
+
receipt.eventIdempotencyKey,
|
|
261
|
+
rawReceiptWriteFailedError('dead_lettered', lastError).slice(0, 4000),
|
|
262
|
+
receipt.rawId,
|
|
263
|
+
lastError,
|
|
264
|
+
],
|
|
237
265
|
);
|
|
238
266
|
} catch (error) {
|
|
239
267
|
console.warn('[signal-radar.dead_letter.raw_mark_failed]', {
|
|
240
|
-
event_idempotency_key: eventIdempotencyKey,
|
|
268
|
+
event_idempotency_key: receipt.eventIdempotencyKey,
|
|
269
|
+
raw_id: receipt.rawId,
|
|
241
270
|
error: error instanceof Error ? error.message : String(error),
|
|
242
271
|
});
|
|
243
272
|
}
|
|
@@ -264,6 +293,10 @@ export async function recordSignalRadarDeadLetter(input: {
|
|
|
264
293
|
const { client, message } = input;
|
|
265
294
|
const lastError = errorMessage(input.error);
|
|
266
295
|
const eventIdempotencyKey = message.eventIdempotencyKey ?? null;
|
|
296
|
+
const rawReceipt = {
|
|
297
|
+
eventIdempotencyKey,
|
|
298
|
+
rawId: inboundFailureRawId(input.error),
|
|
299
|
+
};
|
|
267
300
|
const payload = {
|
|
268
301
|
provider: message.provider,
|
|
269
302
|
orgId: message.orgId,
|
|
@@ -315,13 +348,7 @@ export async function recordSignalRadarDeadLetter(input: {
|
|
|
315
348
|
'Signal radar dead-letter status changed while recording a failure.',
|
|
316
349
|
);
|
|
317
350
|
}
|
|
318
|
-
|
|
319
|
-
await markCapturedRawWriteFailed(
|
|
320
|
-
client,
|
|
321
|
-
eventIdempotencyKey,
|
|
322
|
-
lastError,
|
|
323
|
-
);
|
|
324
|
-
}
|
|
351
|
+
await markCapturedRawWriteFailed(client, rawReceipt, lastError);
|
|
325
352
|
return;
|
|
326
353
|
}
|
|
327
354
|
}
|
|
@@ -360,7 +387,7 @@ export async function recordSignalRadarDeadLetter(input: {
|
|
|
360
387
|
lastError.slice(0, 8000),
|
|
361
388
|
],
|
|
362
389
|
);
|
|
363
|
-
await markCapturedRawWriteFailed(client,
|
|
390
|
+
await markCapturedRawWriteFailed(client, rawReceipt, lastError);
|
|
364
391
|
return;
|
|
365
392
|
}
|
|
366
393
|
|
|
@@ -382,6 +409,7 @@ export async function recordSignalRadarDeadLetter(input: {
|
|
|
382
409
|
lastError.slice(0, 8000),
|
|
383
410
|
],
|
|
384
411
|
);
|
|
412
|
+
await markCapturedRawWriteFailed(client, rawReceipt, lastError);
|
|
385
413
|
}
|
|
386
414
|
|
|
387
415
|
// The load-bearing retry-callback decision (plan §4a). Runs on every handler
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// Why a captured raw callback receipt (`dl_meta.monitor_inbound_raw`) ended
|
|
2
|
+
// `write_failed`. The inbound processor and the dead-letter recorder write the
|
|
3
|
+
// `error` text with `rawReceiptWriteFailedError`; the admin queue reader and
|
|
4
|
+
// the daily dead-letter digest read it back with `classifyRawReceiptError`.
|
|
5
|
+
// Both sides use this one table, so a new or reworded cause cannot drift into
|
|
6
|
+
// the generic typed-write failure (every `write_failed` once read as one).
|
|
7
|
+
//
|
|
8
|
+
// Many `write_failed` receipts are deliberate: a billing-suspended, inactive,
|
|
9
|
+
// errored or retired-binding monitor captures raw-only on purpose, and a
|
|
10
|
+
// finding refused for credits is never recovered (KAR-43). `expected` marks
|
|
11
|
+
// those, so the digest can leave them out of its "needs attention" count.
|
|
12
|
+
import { PROVIDER_CALLBACK_TYPED_WRITE_FAILED_CODE } from './inbound-failure-codes';
|
|
13
|
+
|
|
14
|
+
type ExactCause = {
|
|
15
|
+
readonly text: string;
|
|
16
|
+
readonly expected: boolean;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
};
|
|
19
|
+
type PrefixCause = {
|
|
20
|
+
readonly prefix: string;
|
|
21
|
+
readonly expected: boolean;
|
|
22
|
+
readonly message: string;
|
|
23
|
+
/**
|
|
24
|
+
* `reason`: the detail is a short machine reason (for example
|
|
25
|
+
* `insufficient_credits`) and is shown in the operator message. `withheld`:
|
|
26
|
+
* the detail is free text (an exception message) and is never echoed.
|
|
27
|
+
*/
|
|
28
|
+
readonly detail: 'reason' | 'withheld';
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The real typed-write failure stores the writer's own message, unchanged, as
|
|
32
|
+
* it always has. It is what any text no other cause owns reads as.
|
|
33
|
+
*/
|
|
34
|
+
type FallbackCause = {
|
|
35
|
+
readonly fallback: true;
|
|
36
|
+
readonly expected: false;
|
|
37
|
+
readonly message: string;
|
|
38
|
+
};
|
|
39
|
+
type Cause = ExactCause | PrefixCause | FallbackCause;
|
|
40
|
+
|
|
41
|
+
/** The generic code, kept only for a real typed-write failure. */
|
|
42
|
+
export const RAW_RECEIPT_TYPED_WRITE_FAILED_CODE =
|
|
43
|
+
PROVIDER_CALLBACK_TYPED_WRITE_FAILED_CODE;
|
|
44
|
+
|
|
45
|
+
export const RAW_RECEIPT_CAUSES = {
|
|
46
|
+
binding_retired_raw_only: {
|
|
47
|
+
text: 'Callback matched a retired provider binding during cleanup; typed write skipped.',
|
|
48
|
+
expected: true,
|
|
49
|
+
message:
|
|
50
|
+
'Captured raw-only on purpose: the callback matched a retired provider binding during cleanup, so no row was written.',
|
|
51
|
+
},
|
|
52
|
+
billing_suspended_raw_only: {
|
|
53
|
+
text: 'Monitor billing is suspended; typed write skipped.',
|
|
54
|
+
expected: true,
|
|
55
|
+
message:
|
|
56
|
+
"Captured raw-only on purpose: the monitor's billing is suspended, so no row was written.",
|
|
57
|
+
},
|
|
58
|
+
monitor_inactive_raw_only: {
|
|
59
|
+
text: 'Monitor is inactive; typed write skipped.',
|
|
60
|
+
expected: true,
|
|
61
|
+
message:
|
|
62
|
+
'Captured raw-only on purpose: the monitor is inactive, so no row was written.',
|
|
63
|
+
},
|
|
64
|
+
monitor_errored_raw_only: {
|
|
65
|
+
text: 'Monitor is errored; typed write skipped.',
|
|
66
|
+
expected: true,
|
|
67
|
+
message:
|
|
68
|
+
'Captured raw-only on purpose: the monitor is errored, so no row was written, charged or dispatched.',
|
|
69
|
+
},
|
|
70
|
+
post_write_credit_exhausted: {
|
|
71
|
+
text: 'A provider event was already admitted before the credit balance changed; no automatic monitor suspension was started.',
|
|
72
|
+
expected: false,
|
|
73
|
+
message:
|
|
74
|
+
'The typed row was written, then the credit balance changed before delivery finished; no monitor suspension was started.',
|
|
75
|
+
},
|
|
76
|
+
monitor_billing_denied: {
|
|
77
|
+
prefix: 'Monitor billing admission denied before typed write: ',
|
|
78
|
+
detail: 'reason',
|
|
79
|
+
expected: true,
|
|
80
|
+
message:
|
|
81
|
+
'Refused before the typed write because billing admission was denied; refused findings are not recovered and cannot be redriven.',
|
|
82
|
+
},
|
|
83
|
+
billing_preflight_failed: {
|
|
84
|
+
prefix: 'Monitor billing preflight failed before typed write: ',
|
|
85
|
+
detail: 'reason',
|
|
86
|
+
expected: false,
|
|
87
|
+
message:
|
|
88
|
+
'Billing preflight failed before the typed write; no row was written and the monitor was moved to billing suspension.',
|
|
89
|
+
},
|
|
90
|
+
post_write_billing_suspended: {
|
|
91
|
+
prefix: 'Post-write delivery incomplete: ',
|
|
92
|
+
detail: 'reason',
|
|
93
|
+
expected: false,
|
|
94
|
+
message:
|
|
95
|
+
'The typed row was written, but billing failed before delivery finished; the monitor was moved to billing suspension.',
|
|
96
|
+
},
|
|
97
|
+
billing_settle_unavailable_after_write: {
|
|
98
|
+
prefix: 'Billing settle unavailable after typed write: ',
|
|
99
|
+
detail: 'withheld',
|
|
100
|
+
expected: false,
|
|
101
|
+
message:
|
|
102
|
+
'The typed row was written, but billing settlement was unavailable; the inbound queue retries the receipt.',
|
|
103
|
+
},
|
|
104
|
+
dispatch_failed_after_write: {
|
|
105
|
+
prefix: 'Inline dispatch failed after typed write: ',
|
|
106
|
+
detail: 'withheld',
|
|
107
|
+
expected: false,
|
|
108
|
+
message:
|
|
109
|
+
'The typed row was written and billed, but the inline dispatch after it failed.',
|
|
110
|
+
},
|
|
111
|
+
retryable_failure_redelivery_pending: {
|
|
112
|
+
prefix: 'Retryable failure; the inbound queue redelivers this receipt: ',
|
|
113
|
+
detail: 'withheld',
|
|
114
|
+
expected: false,
|
|
115
|
+
message:
|
|
116
|
+
'A retryable failure after capture; the inbound queue redelivers the receipt, and one that uses up its deliveries becomes a dead letter.',
|
|
117
|
+
},
|
|
118
|
+
dead_lettered: {
|
|
119
|
+
prefix: 'Dead-lettered: ',
|
|
120
|
+
detail: 'withheld',
|
|
121
|
+
expected: false,
|
|
122
|
+
message:
|
|
123
|
+
'The event used up its deliveries and was dead-lettered; act on its signal-radar-inbound-legacy-dlq item.',
|
|
124
|
+
},
|
|
125
|
+
[RAW_RECEIPT_TYPED_WRITE_FAILED_CODE]: {
|
|
126
|
+
fallback: true,
|
|
127
|
+
expected: false,
|
|
128
|
+
message: 'The provider callback could not be written by its typed owner.',
|
|
129
|
+
},
|
|
130
|
+
} as const satisfies Record<string, Cause>;
|
|
131
|
+
|
|
132
|
+
export type RawReceiptCauseCode = keyof typeof RAW_RECEIPT_CAUSES;
|
|
133
|
+
type ExactCauseCode = {
|
|
134
|
+
[Code in RawReceiptCauseCode]: (typeof RAW_RECEIPT_CAUSES)[Code] extends {
|
|
135
|
+
text: string;
|
|
136
|
+
}
|
|
137
|
+
? Code
|
|
138
|
+
: never;
|
|
139
|
+
}[RawReceiptCauseCode];
|
|
140
|
+
|
|
141
|
+
const CAUSE_ENTRIES = Object.entries(RAW_RECEIPT_CAUSES) as Array<
|
|
142
|
+
[RawReceiptCauseCode, Cause]
|
|
143
|
+
>;
|
|
144
|
+
|
|
145
|
+
/** The `error` text a `write_failed` mark stores for one cause. */
|
|
146
|
+
export function rawReceiptWriteFailedError<Code extends RawReceiptCauseCode>(
|
|
147
|
+
code: Code,
|
|
148
|
+
...detail: Code extends ExactCauseCode ? [] : [detail: string]
|
|
149
|
+
): string {
|
|
150
|
+
const cause: Cause = RAW_RECEIPT_CAUSES[code];
|
|
151
|
+
if ('text' in cause) return cause.text;
|
|
152
|
+
if ('prefix' in cause) return `${cause.prefix}${detail[0] ?? ''}`;
|
|
153
|
+
return detail[0] ?? '';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type RawReceiptCause = {
|
|
157
|
+
code: RawReceiptCauseCode;
|
|
158
|
+
/** Captured raw-only on purpose; nothing to recover. */
|
|
159
|
+
expected: boolean;
|
|
160
|
+
message: string;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const REASON = /^[a-z][a-z0-9_]{0,63}$/;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The cause of a `write_failed` receipt from its stored `error` text. Text no
|
|
167
|
+
* other cause owns - the real typed-write failure, an empty error, or one
|
|
168
|
+
* stored before this table existed - reads as the generic typed-write failure,
|
|
169
|
+
* as every receipt did before.
|
|
170
|
+
*/
|
|
171
|
+
export function classifyRawReceiptError(value: unknown): RawReceiptCause {
|
|
172
|
+
const text = typeof value === 'string' ? value : '';
|
|
173
|
+
for (const [code, cause] of CAUSE_ENTRIES) {
|
|
174
|
+
if ('text' in cause) {
|
|
175
|
+
if (text === cause.text) {
|
|
176
|
+
return { code, expected: cause.expected, message: cause.message };
|
|
177
|
+
}
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (!('prefix' in cause) || !text.startsWith(cause.prefix)) continue;
|
|
181
|
+
const detail = text.slice(cause.prefix.length);
|
|
182
|
+
return {
|
|
183
|
+
code,
|
|
184
|
+
expected: cause.expected,
|
|
185
|
+
message:
|
|
186
|
+
cause.detail === 'reason' && REASON.test(detail)
|
|
187
|
+
? `${cause.message} Reason: ${detail}.`
|
|
188
|
+
: cause.message,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const fallback = RAW_RECEIPT_CAUSES[RAW_RECEIPT_TYPED_WRITE_FAILED_CODE];
|
|
192
|
+
return {
|
|
193
|
+
code: RAW_RECEIPT_TYPED_WRITE_FAILED_CODE,
|
|
194
|
+
expected: fallback.expected,
|
|
195
|
+
message: fallback.message,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* One SQL `CASE` expression that classifies `column` the way
|
|
201
|
+
* `classifyRawReceiptError` does, for a grouped count that never reads rows
|
|
202
|
+
* out. The texts are bound as parameters through `bind`, which returns the
|
|
203
|
+
* placeholder for each value.
|
|
204
|
+
*/
|
|
205
|
+
export function rawReceiptCauseSqlCase(
|
|
206
|
+
column: string,
|
|
207
|
+
bind: (value: string) => string,
|
|
208
|
+
): string {
|
|
209
|
+
const branches = CAUSE_ENTRIES.flatMap(([code, cause]) =>
|
|
210
|
+
'text' in cause
|
|
211
|
+
? [`WHEN ${column} = ${bind(cause.text)}::text THEN ${bind(code)}::text`]
|
|
212
|
+
: 'prefix' in cause
|
|
213
|
+
? [
|
|
214
|
+
`WHEN starts_with(${column}, ${bind(cause.prefix)}::text) THEN ${bind(code)}::text`,
|
|
215
|
+
]
|
|
216
|
+
: [],
|
|
217
|
+
);
|
|
218
|
+
return `CASE ${branches.join(' ')} ELSE ${bind(RAW_RECEIPT_TYPED_WRITE_FAILED_CODE)}::text END`;
|
|
219
|
+
}
|