deepline 0.3.551 → 0.3.553
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client-core.ts +130 -12
- package/dist/bundling-sources/sdk/src/compat.ts +239 -87
- package/dist/bundling-sources/sdk/src/config.ts +113 -2
- package/dist/bundling-sources/sdk/src/errors.ts +2 -0
- package/dist/bundling-sources/sdk/src/http-core.ts +124 -10
- package/dist/bundling-sources/sdk/src/index.ts +2 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +6 -4
- package/dist/bundling-sources/sdk/src/play.ts +3 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +66 -30
- package/dist/bundling-sources/sdk/src/tool-calls.ts +2 -1
- package/dist/bundling-sources/sdk/src/tool-failure-hint.ts +104 -0
- package/dist/bundling-sources/sdk/src/types.ts +9 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +4 -2
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-plan-skus.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +58 -4
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +11 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +103 -5
- package/dist/bundling-sources/shared_libs/monitors/fleets/converge-admission.ts +133 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-attention.ts +165 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-release.ts +726 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-walk.ts +274 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +1 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/provider-bulk-wait.ts +126 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/shared-payload.ts +189 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +4 -0
- package/dist/bundling-sources/shared_libs/monitors/inventory-counter-errors.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +65 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +11 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +152 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +390 -10
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +34 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +66 -30
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +30 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +80 -13
- package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +26 -3
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/tamradar-countries.ts +285 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +312 -41
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +568 -26
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +14 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +92 -16
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +300 -57
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +298 -46
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +39 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +32 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +37 -7
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
- package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
- package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
- package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
- package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
- package/dist/cli/{auth-E7BH4GMJ.mjs → auth-I3QAU4RV.mjs} +8 -7
- package/dist/cli/auth-MQCN7WGZ.js +44 -0
- package/dist/cli/{billing-OXKU462W.mjs → billing-3IC54OQQ.mjs} +202 -59
- package/dist/cli/{billing-DNQAZGX7.js → billing-YGFFVAIC.js} +302 -159
- package/dist/cli/{chunk-COGREZAO.js → chunk-2B5B5KAW.js} +210 -128
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-T2B5BVZE.js → chunk-3NTP2OSG.js} +13 -13
- package/dist/cli/{chunk-FOTGUFVK.mjs → chunk-45OAVGU6.mjs} +5 -5
- package/dist/cli/{chunk-54EEYLTF.js → chunk-4747TPLV.js} +3 -3
- package/dist/cli/{chunk-CLRAANWH.mjs → chunk-4BFTDNHU.mjs} +1 -1
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
- package/dist/cli/{chunk-5S6PHKRV.mjs → chunk-4SMCFQ23.mjs} +1 -1
- package/dist/cli/{chunk-VWLHRZFG.mjs → chunk-55F6HNOY.mjs} +5 -5
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-VTGG2RT3.js → chunk-6NE3RRRY.js} +1 -1
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-MNSTCJMX.mjs → chunk-72V4PDH5.mjs} +18 -18
- package/dist/cli/{chunk-ZCDKE4UH.js → chunk-74RES4DS.js} +5 -5
- package/dist/cli/{chunk-WKBHUB6R.js → chunk-7GEMELKI.js} +366 -320
- package/dist/cli/{chunk-C4CUZH57.js → chunk-7O6J6A7P.js} +1871 -92
- package/dist/cli/{chunk-7RSIFA72.js → chunk-7SERLBNR.js} +161 -53
- package/dist/cli/{chunk-3G6QZACZ.js → chunk-7YRJ5UC4.js} +21 -21
- package/dist/cli/{chunk-I4VKGNAQ.mjs → chunk-A7DLBE5K.mjs} +136 -54
- package/dist/cli/{chunk-GGB3JYCW.mjs → chunk-AGICYWGN.mjs} +299 -69
- package/dist/cli/{chunk-44KSACJW.mjs → chunk-AGIQDA2T.mjs} +12 -12
- package/dist/cli/{chunk-PACD5DGC.js → chunk-AGLR6QVN.js} +255 -109
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-4OMAGJ6U.js → chunk-BVDKFS2T.js} +2 -2
- package/dist/cli/{chunk-LPJPCGT3.js → chunk-CACFJODG.js} +190 -134
- package/dist/cli/{chunk-GVYLCCKN.mjs → chunk-CAEBJOYU.mjs} +1 -1
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-POLUE7D5.js → chunk-DP2VH7CO.js} +12 -12
- package/dist/cli/{chunk-D6M5HFBB.mjs → chunk-DP64MD6U.mjs} +1 -1
- package/dist/cli/{chunk-W425ERWN.mjs → chunk-DZA7RFGL.mjs} +5 -5
- package/dist/cli/{chunk-R7J7CJPZ.js → chunk-E2G2DNAB.js} +4 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
- package/dist/cli/{chunk-44I675YK.js → chunk-FM7LPUPA.js} +41 -41
- package/dist/cli/{chunk-2UXDHFSF.mjs → chunk-GAVZ4EOD.mjs} +1 -1
- package/dist/cli/{chunk-Z2FIOG3V.js → chunk-HEBO3XNZ.js} +27 -31
- package/dist/cli/{chunk-6PWJKMFQ.mjs → chunk-HSJ6X2AQ.mjs} +4 -4
- package/dist/cli/{chunk-UPMRIVZB.js → chunk-HVI55MTK.js} +61 -10
- package/dist/cli/{chunk-KWSH5T7K.js → chunk-IH6GDNKW.js} +21 -21
- package/dist/cli/{chunk-3KYBDAR3.js → chunk-IMX7J4DU.js} +8 -8
- package/dist/cli/{chunk-HEHVGEZV.mjs → chunk-INEMTYMT.mjs} +8 -8
- package/dist/cli/{chunk-5VVSEU67.js → chunk-IUOGII7D.js} +6 -7
- package/dist/cli/{chunk-MXGA6JFI.mjs → chunk-JJGWHITQ.mjs} +5 -5
- package/dist/cli/{chunk-QM6Y6S4E.js → chunk-JLGP5XAJ.js} +5 -5
- package/dist/cli/{chunk-V6SCP4B7.mjs → chunk-LFOERUQY.mjs} +69 -3
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-ZMNGZ6XS.mjs → chunk-LH5PZKER.mjs} +80 -24
- package/dist/cli/{chunk-MR5LTVHD.js → chunk-LRDHPOZW.js} +69 -69
- package/dist/cli/{chunk-5LUF4LAR.mjs → chunk-LRZGS6RZ.mjs} +3 -0
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-UDXULACQ.js → chunk-MLABYI4M.js} +90 -24
- package/dist/cli/{chunk-S7IZWGUA.mjs → chunk-NDNHYONK.mjs} +17 -21
- package/dist/cli/{chunk-4D3WIZST.mjs → chunk-OTV2UUKW.mjs} +164 -18
- package/dist/cli/{chunk-XYE5XPGF.js → chunk-Q6Z6N3A7.js} +18 -18
- package/dist/cli/{chunk-7WQNWJQW.mjs → chunk-QG6JIWUL.mjs} +151 -43
- package/dist/cli/{chunk-3T65J5RG.mjs → chunk-QI5S5HWB.mjs} +2 -2
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-PM7MO62Y.mjs → chunk-RMNOZKRI.mjs} +3 -3
- package/dist/cli/{chunk-NMWGZD6Y.js → chunk-RTV4RF7N.js} +36 -36
- package/dist/cli/{chunk-CQ6JYQSW.js → chunk-SBH4CKPN.js} +11 -11
- package/dist/cli/{chunk-BIIJATTX.mjs → chunk-SG3LUONJ.mjs} +3 -3
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
- package/dist/cli/{chunk-5IL7SC45.mjs → chunk-TN4TY6TT.mjs} +6 -7
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
- package/dist/cli/{chunk-RE5MJBEV.mjs → chunk-UVQJYV76.mjs} +2 -2
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-W2ZWQUHT.js → chunk-WOCHZCUJ.js} +2 -2
- package/dist/cli/{chunk-ZDQFBJPO.js → chunk-XLIHTJVM.js} +348 -118
- package/dist/cli/{chunk-2ZYRBMQM.js → chunk-Y6SP3JMI.js} +22 -22
- package/dist/cli/{chunk-PPSDCN6C.js → chunk-YUA6HA6D.js} +2 -2
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/{chunk-E64HFB4L.mjs → chunk-Z6XPSHKM.mjs} +87 -41
- package/dist/cli/{chunk-7DOQ3OEX.mjs → chunk-Z7AOIHFE.mjs} +1870 -91
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-CFJH4KXV.js +22 -0
- package/dist/cli/{concurrent-runs-help-C6L6I5OR.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
- package/dist/cli/{csv-QMF4FWE7.js → csv-SA6ELJY6.js} +16 -15
- package/dist/cli/{csv-SYSDXFEM.mjs → csv-ZXZGHWOM.mjs} +7 -6
- package/dist/cli/{db-Q7HURWRZ.mjs → db-A54SP6AD.mjs} +16 -16
- package/dist/cli/{db-YSHPPA4H.js → db-JHFEIQBU.js} +43 -43
- package/dist/cli/describe-PHQ33AGS.mjs +50 -0
- package/dist/cli/describe-RHJ4XRFI.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-G7U3VUXN.mjs → executions-HL2M2DFU.mjs} +10 -10
- package/dist/cli/{executions-MWBC5TAW.js → executions-TLFZRHBJ.js} +12 -12
- package/dist/cli/{feedback-SD55OY6H.js → feedback-5UEX5UZK.js} +17 -16
- package/dist/cli/{feedback-GMHIFLBJ.mjs → feedback-QMBTNXVG.mjs} +9 -8
- package/dist/cli/git-4JWOOHBG.js +26 -0
- package/dist/cli/{git-HPE45OPD.mjs → git-LKGXVIVC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-HFKVBY6G.js → integrations-6RUTLMN7.js} +23 -27
- package/dist/cli/{integrations-2W4MGIQR.mjs → integrations-FGGRVUJ7.mjs} +15 -19
- package/dist/cli/{legacy-noops-SXVNDEXN.js → legacy-noops-J3Z7QRWZ.js} +12 -11
- package/dist/cli/{legacy-noops-GZYKNU2Z.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
- package/dist/cli/{mcp-PJRHQHHU.js → mcp-6LWFP7RW.js} +121 -48
- package/dist/cli/{mcp-BWA6KULG.mjs → mcp-CHDYFO7F.mjs} +100 -27
- package/dist/cli/{monitors-K2WSI6CR.js → monitors-STM6A7OU.js} +221 -186
- package/dist/cli/{monitors-SYQKCATO.mjs → monitors-UGRY2BXI.mjs} +58 -23
- package/dist/cli/org-3SYOUQCX.mjs +2289 -0
- package/dist/cli/org-ZOBSNSIB.js +2289 -0
- package/dist/cli/outcomes-H4YYAT5X.js +2865 -0
- package/dist/cli/outcomes-Z3P2JE67.mjs +2865 -0
- package/dist/cli/{play-SZXY2F2S.js → play-SM4CW2GS.js} +1116 -846
- package/dist/cli/{play-TTMABJEI.mjs → play-SN5YWLS7.mjs} +375 -105
- package/dist/cli/{providers-GQIOMRQO.mjs → providers-WZ4YBR5Y.mjs} +10 -10
- package/dist/cli/{providers-YDHCTZAF.js → providers-WZARYMCF.js} +13 -13
- package/dist/cli/{quickstart-PHSSMKCA.mjs → quickstart-2575BNKA.mjs} +7 -6
- package/dist/cli/{quickstart-BNYOXQXG.js → quickstart-PS4YHQJ6.js} +9 -8
- package/dist/cli/{run-GFIAZXVL.js → run-FLZ6OTM7.js} +51 -51
- package/dist/cli/{run-74C3C75C.mjs → run-ZUHCZOJS.mjs} +31 -31
- package/dist/cli/run-identity-LMLFMACS.js +31 -0
- package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
- package/dist/cli/{search-3SWUB7KX.mjs → search-HLPPKQEO.mjs} +11 -11
- package/dist/cli/search-JJWVHR3N.js +32 -0
- package/dist/cli/{search-output-K2SWHVHQ.mjs → search-output-PDAXNOGP.mjs} +9 -8
- package/dist/cli/{search-output-6JF3S4TP.js → search-output-RXJLU36B.js} +12 -11
- package/dist/cli/{secrets-2M4XWEKE.mjs → secrets-CGELYQ3H.mjs} +11 -11
- package/dist/cli/{secrets-2SAKLH2H.js → secrets-QJNG7G2Y.js} +20 -20
- package/dist/cli/sessions-DHTBT2GN.js +23 -0
- package/dist/cli/{sessions-A64BCXTO.mjs → sessions-ELMWVR4M.mjs} +9 -8
- package/dist/cli/{settings-HV64WIJF.js → settings-44I44P5F.js} +89 -89
- package/dist/cli/{settings-SVGEC3FI.mjs → settings-RR3LZXL7.mjs} +16 -16
- package/dist/cli/{setup-EDC3NEJ3.mjs → setup-KGWRWH4B.mjs} +20 -19
- package/dist/cli/{setup-FHXOLQGQ.js → setup-KTEYOCJO.js} +60 -59
- package/dist/cli/skills-EPZPEXI2.js +37 -0
- package/dist/cli/{skills-3HGHZMXB.mjs → skills-FPRID2I5.mjs} +10 -9
- package/dist/cli/tools-IGQQ5TML.js +57 -0
- package/dist/cli/{tools-P2QS6A6Q.mjs → tools-PI4WMDLY.mjs} +23 -23
- package/dist/cli/update-4RNCVYGE.js +37 -0
- package/dist/cli/{update-552BYQM4.mjs → update-VJOJAZ7B.mjs} +14 -11
- package/dist/cli/{views-PA25NAE3.js → views-NTUOLNQU.js} +62 -64
- package/dist/cli/{views-LD5HXJYY.mjs → views-OVPSINZO.mjs} +47 -49
- package/dist/cli/{workflow-FIDBUQV6.js → workflow-2UDYDM6F.js} +23 -23
- package/dist/cli/{workflow-LDYFGBYP.mjs → workflow-7OEFNXZC.mjs} +13 -13
- package/dist/{client-DuDFiJDU.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-t9HZAkFD.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-DydMQOft.d.mts → client-core-SLLGBTht.d.mts} +285 -23
- package/dist/{client-core-CJRzLanv.d.ts → client-core-p0sOxnkl.d.ts} +285 -23
- package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
- package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
- package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
- package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
- package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +66 -55
- package/dist/index.mjs +25 -14
- package/dist/install-integrity.json +162 -142
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +23 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +4 -4
- package/dist/plays/run-request.mjs +3 -3
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +15 -13
- package/dist/server.mjs +9 -7
- package/package.json +1 -1
- package/dist/cli/auth-B4PI7GVY.js +0 -43
- package/dist/cli/concurrent-runs-help-JEFQZTJI.js +0 -21
- package/dist/cli/describe-PXTSBJTL.js +0 -50
- package/dist/cli/describe-YGMQBV44.mjs +0 -50
- package/dist/cli/git-I3JV7IGH.js +0 -25
- package/dist/cli/org-5KD7X7IA.mjs +0 -1282
- package/dist/cli/org-YQ2CR32B.js +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-2RRRF4LW.js +0 -32
- package/dist/cli/sessions-SBH27JNW.js +0 -22
- package/dist/cli/skills-Y3SRLOYD.js +0 -36
- package/dist/cli/tools-OFYPUPUV.js +0 -57
- package/dist/cli/update-SOUSCLB7.js +0 -34
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server';
|
|
2
2
|
import { isExplicitConvexOCC } from '@deepline/convex-client/occ-retry';
|
|
3
|
+
import {
|
|
4
|
+
isMonitorInventoryCountersRefreshing,
|
|
5
|
+
MONITOR_INVENTORY_COUNTERS_REFRESHING_CODE,
|
|
6
|
+
MONITOR_INVENTORY_COUNTERS_REFRESHING_MESSAGE,
|
|
7
|
+
} from './inventory-counter-errors';
|
|
3
8
|
|
|
4
9
|
export const MONITOR_ERROR_FALLBACK_NEXT_ACTION =
|
|
5
10
|
"Do not retry blindly. Read the deepline-monitors skill's 'Recover from errors by code' section, inspect the returned message and relevant state, then diagnose this failure.";
|
|
@@ -140,6 +145,26 @@ export function monitorWriteConflictResponse(
|
|
|
140
145
|
);
|
|
141
146
|
}
|
|
142
147
|
|
|
148
|
+
/**
|
|
149
|
+
* The inventory's counter journal is folding more deltas than one read may
|
|
150
|
+
* sum (#10553). It settles on its own: a retryable 503, never a 400 or 500.
|
|
151
|
+
*/
|
|
152
|
+
export function monitorInventoryCountersRefreshingResponse(
|
|
153
|
+
error: unknown,
|
|
154
|
+
): NextResponse | null {
|
|
155
|
+
if (!isMonitorInventoryCountersRefreshing(error)) return null;
|
|
156
|
+
return monitorErrorResponse(
|
|
157
|
+
{
|
|
158
|
+
error: {
|
|
159
|
+
code: MONITOR_INVENTORY_COUNTERS_REFRESHING_CODE,
|
|
160
|
+
message: MONITOR_INVENTORY_COUNTERS_REFRESHING_MESSAGE,
|
|
161
|
+
retry_after_ms: 1_000,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{ status: 503, headers: { 'retry-after': '1' } },
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
143
168
|
/**
|
|
144
169
|
* Server-owned recovery guidance for every agent-facing monitor error.
|
|
145
170
|
* Known codes get an exact next step. Unknown failures deliberately point at
|
|
@@ -168,6 +193,9 @@ export function monitorErrorNextAction(payload: MonitorErrorPayload): string {
|
|
|
168
193
|
? `Wait ${retryAfterMs} ms, then retry the same read or check once.`
|
|
169
194
|
: 'Wait for Customer DB provisioning, then retry the same read or check once.';
|
|
170
195
|
}
|
|
196
|
+
if (code === MONITOR_INVENTORY_COUNTERS_REFRESHING_CODE) {
|
|
197
|
+
return 'Wait about a second, then rerun the same monitor read. No monitor state was changed.';
|
|
198
|
+
}
|
|
171
199
|
if (code === 'monitor_control_plane_unavailable') {
|
|
172
200
|
return 'Wait briefly, then rerun the same monitor read. No monitor state was changed.';
|
|
173
201
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
parseProviderCallbackPayload,
|
|
4
4
|
providerCallbackWireEventId,
|
|
5
5
|
} from '@deepline/monitors/provider-callback-verification';
|
|
6
|
+
import type { ProviderMonitorCallbackContract } from '@deepline/monitors/provider-monitor-capability';
|
|
6
7
|
|
|
7
8
|
// The Neon-free publish idempotency key the thin receiver forwards to the queue
|
|
8
9
|
// producer's send(..., { idempotencyKey }). Pure function of what is on the wire:
|
|
@@ -21,6 +22,8 @@ export function signalRadarInboundPublishIdempotencyKey(input: {
|
|
|
21
22
|
token: string;
|
|
22
23
|
headers: Headers;
|
|
23
24
|
rawBody: string;
|
|
25
|
+
/** The provider's declared callback contract, for its event id paths. */
|
|
26
|
+
callbackContract?: ProviderMonitorCallbackContract | null;
|
|
24
27
|
}): string {
|
|
25
28
|
const payload = parseProviderCallbackPayload({
|
|
26
29
|
contentType: input.headers.get('content-type'),
|
|
@@ -31,6 +34,7 @@ export function signalRadarInboundPublishIdempotencyKey(input: {
|
|
|
31
34
|
provider: input.provider,
|
|
32
35
|
headers: input.headers,
|
|
33
36
|
payload,
|
|
37
|
+
callbackContract: input.callbackContract,
|
|
34
38
|
});
|
|
35
39
|
|
|
36
40
|
return `sr_inbound_${createHash('sha256')
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The monitor inventory's counter journal holds more unfolded deltas than one
|
|
3
|
+
* read may sum. The fold drains it on its own, so a read that meets this
|
|
4
|
+
* should be retried shortly; nothing about the request is wrong (#10553).
|
|
5
|
+
*
|
|
6
|
+
* Convex throws it as a `ConvexError` whose `data.code` is this value; routes
|
|
7
|
+
* answer it with a retryable 503.
|
|
8
|
+
*/
|
|
9
|
+
export const MONITOR_INVENTORY_COUNTERS_REFRESHING_CODE =
|
|
10
|
+
'monitor_inventory_counters_refreshing';
|
|
11
|
+
|
|
12
|
+
export const MONITOR_INVENTORY_COUNTERS_REFRESHING_MESSAGE =
|
|
13
|
+
'Monitor inventory counters are refreshing; retry after their journal settles.';
|
|
14
|
+
|
|
15
|
+
/** True for the Convex error above, by its structured code. */
|
|
16
|
+
export function isMonitorInventoryCountersRefreshing(error: unknown): boolean {
|
|
17
|
+
if (!error || typeof error !== 'object' || !('data' in error)) return false;
|
|
18
|
+
const data = (error as { data?: unknown }).data;
|
|
19
|
+
return (
|
|
20
|
+
!!data &&
|
|
21
|
+
typeof data === 'object' &&
|
|
22
|
+
(data as { code?: unknown }).code ===
|
|
23
|
+
MONITOR_INVENTORY_COUNTERS_REFRESHING_CODE
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
* product and is deliberately not a third number to reason about.
|
|
12
12
|
*/
|
|
13
13
|
import { ORG_LIMITS, OrgLimit } from '@deepline/billing/org-limits/registry';
|
|
14
|
+
import {
|
|
15
|
+
monitorBillingRequiresExplicitReactivation,
|
|
16
|
+
parseStoredMonitorBillingState,
|
|
17
|
+
} from './billing/state';
|
|
14
18
|
import {
|
|
15
19
|
DEFAULT_PLAN_KEY,
|
|
16
20
|
PLAN_LIMITS,
|
|
@@ -87,6 +91,67 @@ export function orgMonitorCapacity(input: {
|
|
|
87
91
|
};
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
function readRecord(value: unknown): Record<string, unknown> {
|
|
95
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
96
|
+
? (value as Record<string, unknown>)
|
|
97
|
+
: {};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Whether a stopped monitor has given its watched account back: the
|
|
102
|
+
* customer's own stop, and only once the provider has confirmed it.
|
|
103
|
+
*
|
|
104
|
+
* Every deactivation reason is the platform's, and a suspension keeps its
|
|
105
|
+
* account for the recovery Deepline owes. A customer stop holds its account
|
|
106
|
+
* until its teardown is proven, exactly as the stop path proves it: an exact
|
|
107
|
+
* provider read recorded `inactive` or `missing`, taken no earlier than the
|
|
108
|
+
* stop itself (`desiredChangedAt`), so a read left from an earlier stop of a
|
|
109
|
+
* since-restarted monitor proves nothing. A claimed stop whose provider
|
|
110
|
+
* delete is still in flight, failed or inconclusive has no such read, so the
|
|
111
|
+
* provider may still be watching and the account stays taken.
|
|
112
|
+
*
|
|
113
|
+
* Billing suspensions written before their reason was recorded carry only a
|
|
114
|
+
* billing state that needs an explicit reactivation, a binding
|
|
115
|
+
* `billing_suspension` record, or (a Fleet member's) a `disabled` state that
|
|
116
|
+
* still requires reactivation; each keeps its account. The exception is a
|
|
117
|
+
* settled org-wide pause the customer took over, which the takeover marks
|
|
118
|
+
* with `billing_suspension.customer_stopped_at` beside the suspension's own
|
|
119
|
+
* confirmed `upstream_disabled_at`.
|
|
120
|
+
*/
|
|
121
|
+
export function stoppedMonitorReleasesAccount(input: {
|
|
122
|
+
status: string;
|
|
123
|
+
deactivationReason?: string | null;
|
|
124
|
+
providerBinding?: unknown;
|
|
125
|
+
billingState?: unknown;
|
|
126
|
+
observed?: string | null;
|
|
127
|
+
observedAt?: number | null;
|
|
128
|
+
desiredChangedAt?: number | null;
|
|
129
|
+
}): boolean {
|
|
130
|
+
if (input.status !== 'disabled' || input.deactivationReason) return false;
|
|
131
|
+
const suspension = readRecord(
|
|
132
|
+
readRecord(input.providerBinding).billing_suspension,
|
|
133
|
+
);
|
|
134
|
+
if (Object.keys(suspension).length > 0) {
|
|
135
|
+
return (
|
|
136
|
+
typeof suspension.customer_stopped_at === 'string' &&
|
|
137
|
+
typeof suspension.upstream_disabled_at === 'string' &&
|
|
138
|
+
suspension.upstream_disabled_at.length > 0
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
if (monitorBillingRequiresExplicitReactivation(input.billingState)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
const billing = parseStoredMonitorBillingState(input.billingState);
|
|
145
|
+
if (billing.state === 'disabled' && billing.reactivation_required) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return (
|
|
149
|
+
(input.observed === 'inactive' || input.observed === 'missing') &&
|
|
150
|
+
typeof input.observedAt === 'number' &&
|
|
151
|
+
input.observedAt >= (input.desiredChangedAt ?? 0)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
90
155
|
/**
|
|
91
156
|
* Whether one more monitor may be admitted against a given account.
|
|
92
157
|
*
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"./action-actor": "./action-actor.ts",
|
|
8
8
|
"./action-actor.js": "./action-actor.ts",
|
|
9
9
|
"./fleets/limits": "./fleets/limits.ts",
|
|
10
|
+
"./fleets/shared-payload": "./fleets/shared-payload.ts",
|
|
10
11
|
"./fleets/count-drift-alert": "./fleets/count-drift-alert.ts",
|
|
11
12
|
"./analytics-install-guides": "./analytics-install-guides.ts",
|
|
12
13
|
"./analytics-install-guides.js": "./analytics-install-guides.ts",
|
|
@@ -42,6 +43,11 @@
|
|
|
42
43
|
"./fleets/overview.js": "./fleets/overview.ts",
|
|
43
44
|
"./fleets/issues.js": "./fleets/issues.ts",
|
|
44
45
|
"./fleets/errors.js": "./fleets/errors.ts",
|
|
46
|
+
"./fleets/converge-admission": "./fleets/converge-admission.ts",
|
|
47
|
+
"./fleets/provider-bulk-wait": "./fleets/provider-bulk-wait.ts",
|
|
48
|
+
"./fleets/fence-release": "./fleets/fence-release.ts",
|
|
49
|
+
"./fleets/fence-walk": "./fleets/fence-walk.ts",
|
|
50
|
+
"./fleets/fence-attention": "./fleets/fence-attention.ts",
|
|
45
51
|
"./fleets/plan": "./fleets/plan.ts",
|
|
46
52
|
"./fleets/plan.js": "./fleets/plan.ts",
|
|
47
53
|
"./fleets/verdict": "./fleets/verdict.ts",
|
|
@@ -51,6 +57,7 @@
|
|
|
51
57
|
"./generated/provider-monitor-callback-admission-targets": "./generated/provider-monitor-callback-admission-targets.ts",
|
|
52
58
|
"./generated/provider-monitor-callback-admission-targets.js": "./generated/provider-monitor-callback-admission-targets.ts",
|
|
53
59
|
"./http-error-response": "./http-error-response.ts",
|
|
60
|
+
"./inventory-counter-errors": "./inventory-counter-errors.ts",
|
|
54
61
|
"./http-error-response.js": "./http-error-response.ts",
|
|
55
62
|
"./inbound-publish-key": "./inbound-publish-key.ts",
|
|
56
63
|
"./inbound-publish-key.js": "./inbound-publish-key.ts",
|
|
@@ -116,6 +123,8 @@
|
|
|
116
123
|
"./signal-radars/inbound-queue-delivery": "./signal-radars/inbound-queue-delivery.ts",
|
|
117
124
|
"./signal-radars/inbound-queue-delivery.js": "./signal-radars/inbound-queue-delivery.ts",
|
|
118
125
|
"./signal-radars/inbound-queue.js": "./signal-radars/inbound-queue.ts",
|
|
126
|
+
"./signal-radars/raw-receipt-causes": "./signal-radars/raw-receipt-causes.ts",
|
|
127
|
+
"./signal-radars/raw-receipt-causes.js": "./signal-radars/raw-receipt-causes.ts",
|
|
119
128
|
"./snitcher-install-validation": "./snitcher-install-validation.ts",
|
|
120
129
|
"./snitcher-install-validation.js": "./snitcher-install-validation.ts",
|
|
121
130
|
"./snitcher-ip2company": "./snitcher-ip2company.ts",
|
|
@@ -124,6 +133,8 @@
|
|
|
124
133
|
"./snitcher-radar.js": "./snitcher-radar.ts",
|
|
125
134
|
"./starter-templates": "./starter-templates.ts",
|
|
126
135
|
"./starter-templates.js": "./starter-templates.ts",
|
|
136
|
+
"./tamradar-countries": "./tamradar-countries.ts",
|
|
137
|
+
"./tamradar-countries.js": "./tamradar-countries.ts",
|
|
127
138
|
"./tracking-provider-guidance": "./tracking-provider-guidance.ts",
|
|
128
139
|
"./tracking-provider-guidance.js": "./tracking-provider-guidance.ts",
|
|
129
140
|
"./tracking-provider-integrations": "./tracking-provider-integrations.ts",
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
timingSafeEqual,
|
|
6
6
|
} from 'node:crypto';
|
|
7
7
|
import { unwrapTamradarPayload } from '@deepline/ingestion-v2/provider-native-monitor-writer';
|
|
8
|
+
import {
|
|
9
|
+
LEGACY_SIGNED_CALLBACK_PROVIDERS,
|
|
10
|
+
type ProviderMonitorCallbackContract,
|
|
11
|
+
type ProviderMonitorInboundAuthDescriptor,
|
|
12
|
+
} from '@deepline/monitors/provider-monitor-capability';
|
|
8
13
|
|
|
9
14
|
export const MONITOR_CALLBACK_SECRET_HEADER = 'x-deepline-monitor-secret';
|
|
10
15
|
|
|
@@ -47,7 +52,7 @@ export type ProviderCallbackBindingResult =
|
|
|
47
52
|
| { ok: true; event: ProviderCallbackEventContext }
|
|
48
53
|
| ProviderCallbackVerificationFailure;
|
|
49
54
|
|
|
50
|
-
const SIGNED_PROVIDERS =
|
|
55
|
+
const SIGNED_PROVIDERS = LEGACY_SIGNED_CALLBACK_PROVIDERS;
|
|
51
56
|
const BODY_SECRET_PROVIDERS = new Set(['lemlist']);
|
|
52
57
|
|
|
53
58
|
const SENSITIVE_HEADER_NAMES = new Set([
|
|
@@ -181,6 +186,38 @@ export function verifyHmacSha256(input: {
|
|
|
181
186
|
);
|
|
182
187
|
}
|
|
183
188
|
|
|
189
|
+
/**
|
|
190
|
+
* `t=<unix>,v1=<hex>[,v1=<hex>]` over `${t}.${rawBody}` (Stripe/Exa style).
|
|
191
|
+
* Every `v1` candidate is checked so a provider rotating secrets can send two.
|
|
192
|
+
* No timestamp window is enforced: a replayed delivery is a duplicate event
|
|
193
|
+
* and dedupes on its provider event id, while a window would drop the
|
|
194
|
+
* provider's own late retries.
|
|
195
|
+
*/
|
|
196
|
+
export function verifyTimestampedHmacSha256(input: {
|
|
197
|
+
secret: string;
|
|
198
|
+
rawBody: string;
|
|
199
|
+
signatureHeader: string | null;
|
|
200
|
+
}) {
|
|
201
|
+
if (!input.signatureHeader) return false;
|
|
202
|
+
let timestamp: string | null = null;
|
|
203
|
+
const candidates: string[] = [];
|
|
204
|
+
for (const part of input.signatureHeader.split(',')) {
|
|
205
|
+
const separator = part.indexOf('=');
|
|
206
|
+
if (separator <= 0) continue;
|
|
207
|
+
const key = part.slice(0, separator).trim();
|
|
208
|
+
const value = part.slice(separator + 1).trim();
|
|
209
|
+
if (key === 't' && /^\d+$/.test(value)) timestamp = value;
|
|
210
|
+
if (key === 'v1' && value) candidates.push(value);
|
|
211
|
+
}
|
|
212
|
+
if (!timestamp || candidates.length === 0) return false;
|
|
213
|
+
const expectedHex = createHmac('sha256', input.secret)
|
|
214
|
+
.update(`${timestamp}.${input.rawBody}`)
|
|
215
|
+
.digest('hex');
|
|
216
|
+
return candidates.some((candidate) =>
|
|
217
|
+
timingSafeHexEqual(expectedHex, candidate),
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
184
221
|
function lowerCaseHeaders(headers: Headers) {
|
|
185
222
|
const entries = new Map<string, string>();
|
|
186
223
|
headers.forEach((value, key) => {
|
|
@@ -347,7 +384,26 @@ export function verifyProviderCallbackAuthenticity(input: {
|
|
|
347
384
|
rawBody: string;
|
|
348
385
|
providerBinding: Record<string, unknown>;
|
|
349
386
|
payload?: Record<string, unknown>;
|
|
387
|
+
/**
|
|
388
|
+
* The provider's declared `runtime.inboundAuth`. Required, so a caller
|
|
389
|
+
* cannot drop it and fall back to token-only admission for a signed
|
|
390
|
+
* provider; pass null only for a provider with no declaration.
|
|
391
|
+
*/
|
|
392
|
+
authDescriptor: ProviderMonitorInboundAuthDescriptor | null;
|
|
350
393
|
}): ProviderCallbackAuthenticityResult {
|
|
394
|
+
if (
|
|
395
|
+
input.authDescriptor?.mode === 'hmac_sha256' &&
|
|
396
|
+
!SIGNED_PROVIDERS.has(input.provider)
|
|
397
|
+
) {
|
|
398
|
+
return verifyDeclaredHmacSignature({
|
|
399
|
+
provider: input.provider,
|
|
400
|
+
headers: input.headers,
|
|
401
|
+
rawBody: input.rawBody,
|
|
402
|
+
providerBinding: input.providerBinding,
|
|
403
|
+
descriptor: input.authDescriptor,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
|
|
351
407
|
if (input.provider === 'attio') {
|
|
352
408
|
const secret = signingSecret(input.provider, input.providerBinding);
|
|
353
409
|
if (!secret) return missingSecret(input.provider);
|
|
@@ -446,6 +502,51 @@ export function verifyProviderCallbackAuthenticity(input: {
|
|
|
446
502
|
};
|
|
447
503
|
}
|
|
448
504
|
|
|
505
|
+
function verifyDeclaredHmacSignature(input: {
|
|
506
|
+
provider: string;
|
|
507
|
+
headers: Headers;
|
|
508
|
+
rawBody: string;
|
|
509
|
+
providerBinding: Record<string, unknown>;
|
|
510
|
+
descriptor: Extract<
|
|
511
|
+
ProviderMonitorInboundAuthDescriptor,
|
|
512
|
+
{ mode: 'hmac_sha256' }
|
|
513
|
+
>;
|
|
514
|
+
}): ProviderCallbackAuthenticityResult {
|
|
515
|
+
const signature = input.descriptor.signature;
|
|
516
|
+
if (!signature) {
|
|
517
|
+
// Never fall through to token-only admission for a signed provider.
|
|
518
|
+
return {
|
|
519
|
+
ok: false,
|
|
520
|
+
status: 500,
|
|
521
|
+
code: 'provider_callback_signature_contract_missing',
|
|
522
|
+
message: `${input.provider} declares hmac_sha256 callbacks without a signature contract.`,
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
const secret = firstBindingSecret(input.providerBinding, [
|
|
526
|
+
'secret',
|
|
527
|
+
'webhook_secret',
|
|
528
|
+
'signing_secret',
|
|
529
|
+
]);
|
|
530
|
+
if (!secret) return missingSecret(input.provider);
|
|
531
|
+
const signatureHeader = header(input.headers, signature.header);
|
|
532
|
+
if (!signatureHeader) return missingSignature(input.provider);
|
|
533
|
+
const verified =
|
|
534
|
+
signature.signedPayload === 'timestamp_dot_body'
|
|
535
|
+
? verifyTimestampedHmacSha256({
|
|
536
|
+
secret,
|
|
537
|
+
rawBody: input.rawBody,
|
|
538
|
+
signatureHeader,
|
|
539
|
+
})
|
|
540
|
+
: verifyHmacSha256({
|
|
541
|
+
secret,
|
|
542
|
+
rawBody: input.rawBody,
|
|
543
|
+
signatureHeader,
|
|
544
|
+
});
|
|
545
|
+
return verified
|
|
546
|
+
? { ok: true, mode: 'hmac_signature' }
|
|
547
|
+
: invalidSignature(input.provider);
|
|
548
|
+
}
|
|
549
|
+
|
|
449
550
|
function sanitizedPayloadForProvider(
|
|
450
551
|
provider: string,
|
|
451
552
|
payload: Record<string, unknown>,
|
|
@@ -696,6 +797,7 @@ function providerEventId(input: {
|
|
|
696
797
|
provider: string;
|
|
697
798
|
headers: Headers;
|
|
698
799
|
payload: Record<string, unknown>;
|
|
800
|
+
callbackContract?: ProviderMonitorCallbackContract | null;
|
|
699
801
|
}) {
|
|
700
802
|
const eventId = providerEventIdInner(input);
|
|
701
803
|
observeHashFallback({
|
|
@@ -706,11 +808,26 @@ function providerEventId(input: {
|
|
|
706
808
|
return eventId;
|
|
707
809
|
}
|
|
708
810
|
|
|
811
|
+
function declaredProviderEventId(input: {
|
|
812
|
+
payload: Record<string, unknown>;
|
|
813
|
+
callbackContract?: ProviderMonitorCallbackContract | null;
|
|
814
|
+
}) {
|
|
815
|
+
const paths = input.callbackContract?.eventIdPaths;
|
|
816
|
+
if (!paths?.length) return null;
|
|
817
|
+
const parts = paths.map((path) => readStringAtPath(input.payload, path));
|
|
818
|
+
return parts.every((part): part is string => Boolean(part))
|
|
819
|
+
? parts.join(':')
|
|
820
|
+
: null;
|
|
821
|
+
}
|
|
822
|
+
|
|
709
823
|
function providerEventIdInner(input: {
|
|
710
824
|
provider: string;
|
|
711
825
|
headers: Headers;
|
|
712
826
|
payload: Record<string, unknown>;
|
|
827
|
+
callbackContract?: ProviderMonitorCallbackContract | null;
|
|
713
828
|
}) {
|
|
829
|
+
const declared = declaredProviderEventId(input);
|
|
830
|
+
if (declared) return declared;
|
|
714
831
|
switch (input.provider) {
|
|
715
832
|
case 'attio':
|
|
716
833
|
return (
|
|
@@ -1006,6 +1123,28 @@ function validateDeeplineNative(input: {
|
|
|
1006
1123
|
}
|
|
1007
1124
|
}
|
|
1008
1125
|
|
|
1126
|
+
/**
|
|
1127
|
+
* The generic upstream-resource fence: the callback must name the exact
|
|
1128
|
+
* resource Deepline stored for this monitor. A missing id fails closed too,
|
|
1129
|
+
* because on a shared provider account an unattributed callback could belong
|
|
1130
|
+
* to any tenant.
|
|
1131
|
+
*/
|
|
1132
|
+
function validateDeclaredResourceFence(input: {
|
|
1133
|
+
payload: Record<string, unknown>;
|
|
1134
|
+
providerBinding: Record<string, unknown>;
|
|
1135
|
+
callbackContract: ProviderMonitorCallbackContract;
|
|
1136
|
+
fields: string[];
|
|
1137
|
+
}) {
|
|
1138
|
+
const expected = upstreamWebhookId(input.providerBinding);
|
|
1139
|
+
const actual = firstStringAtPaths(
|
|
1140
|
+
input.payload,
|
|
1141
|
+
input.callbackContract.upstreamResourceIdPaths,
|
|
1142
|
+
);
|
|
1143
|
+
if (!expected || !actual || expected !== actual) {
|
|
1144
|
+
input.fields.push('upstream_resource_id');
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1009
1148
|
export function validateProviderCallbackBindingAndIdempotency(input: {
|
|
1010
1149
|
provider: string;
|
|
1011
1150
|
headers: Headers;
|
|
@@ -1014,9 +1153,19 @@ export function validateProviderCallbackBindingAndIdempotency(input: {
|
|
|
1014
1153
|
monitorKey: string;
|
|
1015
1154
|
sourceCapability: string;
|
|
1016
1155
|
authenticity: ProviderCallbackVerificationOk;
|
|
1156
|
+
/** The provider's declared `runtime.callbackContract`. */
|
|
1157
|
+
callbackContract?: ProviderMonitorCallbackContract | null;
|
|
1017
1158
|
}): ProviderCallbackBindingResult {
|
|
1018
1159
|
const fields: string[] = [];
|
|
1019
1160
|
const payload = sanitizedPayloadForProvider(input.provider, input.payload);
|
|
1161
|
+
if (input.callbackContract) {
|
|
1162
|
+
validateDeclaredResourceFence({
|
|
1163
|
+
payload,
|
|
1164
|
+
providerBinding: input.providerBinding,
|
|
1165
|
+
callbackContract: input.callbackContract,
|
|
1166
|
+
fields,
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1020
1169
|
|
|
1021
1170
|
switch (input.provider) {
|
|
1022
1171
|
case 'attio':
|
|
@@ -1087,6 +1236,7 @@ export function validateProviderCallbackBindingAndIdempotency(input: {
|
|
|
1087
1236
|
provider: input.provider,
|
|
1088
1237
|
headers: input.headers,
|
|
1089
1238
|
payload,
|
|
1239
|
+
callbackContract: input.callbackContract,
|
|
1090
1240
|
});
|
|
1091
1241
|
const idempotencyKey = monitorEventIdempotencyKey({
|
|
1092
1242
|
provider: input.provider,
|
|
@@ -1124,6 +1274,7 @@ export function providerCallbackWireEventId(input: {
|
|
|
1124
1274
|
provider: string;
|
|
1125
1275
|
headers: Headers;
|
|
1126
1276
|
payload: Record<string, unknown>;
|
|
1277
|
+
callbackContract?: ProviderMonitorCallbackContract | null;
|
|
1127
1278
|
}): string {
|
|
1128
1279
|
return providerEventId(input);
|
|
1129
1280
|
}
|
|
@@ -559,6 +559,10 @@ export const PROVIDER_MONITOR_BATCH_CHANGE_BUCKETS: Readonly<
|
|
|
559
559
|
named_batch_start: 'created',
|
|
560
560
|
provider_repaired: 'created',
|
|
561
561
|
fleet_converged: 'created',
|
|
562
|
+
// A capability with no bulk create (Exa): the scalar deploy, or the scalar
|
|
563
|
+
// reactivation of a suspended monitor, each makes a new resource.
|
|
564
|
+
scalar_monitor_created: 'created',
|
|
565
|
+
scalar_monitor_reactivated: 'created',
|
|
562
566
|
// An existing provider resource replaced or reconciled.
|
|
563
567
|
existing_monitor_replaced: 'updated',
|
|
564
568
|
existing_monitor_reconciled_by_identity: 'updated',
|
|
@@ -567,6 +571,8 @@ export const PROVIDER_MONITOR_BATCH_CHANGE_BUCKETS: Readonly<
|
|
|
567
571
|
// A provider resource closed, or proven absent. A create stopped or deleted
|
|
568
572
|
// by the customer's intent before it settled ends removed.
|
|
569
573
|
upstream_deactivated: 'removed',
|
|
574
|
+
// The scalar delete of a capability with no batch-delete adapter.
|
|
575
|
+
upstream_deleted: 'removed',
|
|
570
576
|
upstream_inactive_verified: 'removed',
|
|
571
577
|
already_absent_upstream: 'removed',
|
|
572
578
|
deleted_monitor_resource_closed: 'removed',
|