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.
Files changed (324) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +130 -12
  2. package/dist/bundling-sources/sdk/src/compat.ts +239 -87
  3. package/dist/bundling-sources/sdk/src/config.ts +113 -2
  4. package/dist/bundling-sources/sdk/src/errors.ts +2 -0
  5. package/dist/bundling-sources/sdk/src/http-core.ts +124 -10
  6. package/dist/bundling-sources/sdk/src/index.ts +2 -0
  7. package/dist/bundling-sources/sdk/src/integrations.ts +6 -4
  8. package/dist/bundling-sources/sdk/src/play.ts +3 -0
  9. package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
  10. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  11. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +66 -30
  12. package/dist/bundling-sources/sdk/src/tool-calls.ts +2 -1
  13. package/dist/bundling-sources/sdk/src/tool-failure-hint.ts +104 -0
  14. package/dist/bundling-sources/sdk/src/types.ts +9 -1
  15. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +4 -2
  16. package/dist/bundling-sources/shared_libs/integration-contracts/billing-plan-skus.ts +25 -0
  17. package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +2 -0
  18. package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +58 -4
  19. package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +8 -0
  20. package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +11 -0
  21. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +13 -0
  22. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +103 -5
  23. package/dist/bundling-sources/shared_libs/monitors/fleets/converge-admission.ts +133 -0
  24. package/dist/bundling-sources/shared_libs/monitors/fleets/fence-attention.ts +165 -0
  25. package/dist/bundling-sources/shared_libs/monitors/fleets/fence-release.ts +726 -0
  26. package/dist/bundling-sources/shared_libs/monitors/fleets/fence-walk.ts +274 -0
  27. package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +1 -0
  28. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +28 -0
  29. package/dist/bundling-sources/shared_libs/monitors/fleets/provider-bulk-wait.ts +126 -0
  30. package/dist/bundling-sources/shared_libs/monitors/fleets/shared-payload.ts +189 -0
  31. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +28 -0
  32. package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +4 -0
  33. package/dist/bundling-sources/shared_libs/monitors/inventory-counter-errors.ts +25 -0
  34. package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +65 -0
  35. package/dist/bundling-sources/shared_libs/monitors/package.json +11 -0
  36. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +152 -1
  37. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +6 -0
  38. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +390 -10
  39. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +34 -0
  40. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +66 -30
  41. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +30 -0
  42. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +80 -13
  43. package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +26 -3
  44. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
  45. package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
  46. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
  47. package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
  48. package/dist/bundling-sources/shared_libs/monitors/tamradar-countries.ts +285 -0
  49. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
  50. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
  51. package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
  52. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
  53. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
  54. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  55. package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
  56. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +312 -41
  57. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
  58. package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
  59. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
  60. package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
  62. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +568 -26
  63. package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
  64. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
  65. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
  66. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
  67. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +14 -2
  68. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
  69. package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
  70. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
  71. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +92 -16
  72. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
  73. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
  74. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
  75. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
  76. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
  77. package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
  79. package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
  80. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
  81. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
  82. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +300 -57
  85. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
  86. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
  87. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
  88. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
  89. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +298 -46
  92. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +39 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
  95. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
  97. package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
  98. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
  99. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
  100. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
  101. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
  102. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
  105. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +32 -10
  106. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
  108. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
  109. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
  110. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
  112. package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
  113. package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
  114. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
  116. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
  117. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
  118. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +37 -7
  119. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
  120. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
  121. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
  122. package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
  123. package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
  124. package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
  125. package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
  126. package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
  127. package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
  128. package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
  129. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
  130. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
  131. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
  132. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
  133. package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
  134. package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
  135. package/dist/cli/{auth-E7BH4GMJ.mjs → auth-I3QAU4RV.mjs} +8 -7
  136. package/dist/cli/auth-MQCN7WGZ.js +44 -0
  137. package/dist/cli/{billing-OXKU462W.mjs → billing-3IC54OQQ.mjs} +202 -59
  138. package/dist/cli/{billing-DNQAZGX7.js → billing-YGFFVAIC.js} +302 -159
  139. package/dist/cli/{chunk-COGREZAO.js → chunk-2B5B5KAW.js} +210 -128
  140. package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
  141. package/dist/cli/{chunk-T2B5BVZE.js → chunk-3NTP2OSG.js} +13 -13
  142. package/dist/cli/{chunk-FOTGUFVK.mjs → chunk-45OAVGU6.mjs} +5 -5
  143. package/dist/cli/{chunk-54EEYLTF.js → chunk-4747TPLV.js} +3 -3
  144. package/dist/cli/{chunk-CLRAANWH.mjs → chunk-4BFTDNHU.mjs} +1 -1
  145. package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
  146. package/dist/cli/{chunk-5S6PHKRV.mjs → chunk-4SMCFQ23.mjs} +1 -1
  147. package/dist/cli/{chunk-VWLHRZFG.mjs → chunk-55F6HNOY.mjs} +5 -5
  148. package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
  149. package/dist/cli/{chunk-VTGG2RT3.js → chunk-6NE3RRRY.js} +1 -1
  150. package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
  151. package/dist/cli/{chunk-MNSTCJMX.mjs → chunk-72V4PDH5.mjs} +18 -18
  152. package/dist/cli/{chunk-ZCDKE4UH.js → chunk-74RES4DS.js} +5 -5
  153. package/dist/cli/{chunk-WKBHUB6R.js → chunk-7GEMELKI.js} +366 -320
  154. package/dist/cli/{chunk-C4CUZH57.js → chunk-7O6J6A7P.js} +1871 -92
  155. package/dist/cli/{chunk-7RSIFA72.js → chunk-7SERLBNR.js} +161 -53
  156. package/dist/cli/{chunk-3G6QZACZ.js → chunk-7YRJ5UC4.js} +21 -21
  157. package/dist/cli/{chunk-I4VKGNAQ.mjs → chunk-A7DLBE5K.mjs} +136 -54
  158. package/dist/cli/{chunk-GGB3JYCW.mjs → chunk-AGICYWGN.mjs} +299 -69
  159. package/dist/cli/{chunk-44KSACJW.mjs → chunk-AGIQDA2T.mjs} +12 -12
  160. package/dist/cli/{chunk-PACD5DGC.js → chunk-AGLR6QVN.js} +255 -109
  161. package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
  162. package/dist/cli/{chunk-4OMAGJ6U.js → chunk-BVDKFS2T.js} +2 -2
  163. package/dist/cli/{chunk-LPJPCGT3.js → chunk-CACFJODG.js} +190 -134
  164. package/dist/cli/{chunk-GVYLCCKN.mjs → chunk-CAEBJOYU.mjs} +1 -1
  165. package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
  166. package/dist/cli/{chunk-POLUE7D5.js → chunk-DP2VH7CO.js} +12 -12
  167. package/dist/cli/{chunk-D6M5HFBB.mjs → chunk-DP64MD6U.mjs} +1 -1
  168. package/dist/cli/{chunk-W425ERWN.mjs → chunk-DZA7RFGL.mjs} +5 -5
  169. package/dist/cli/{chunk-R7J7CJPZ.js → chunk-E2G2DNAB.js} +4 -1
  170. package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
  171. package/dist/cli/{chunk-44I675YK.js → chunk-FM7LPUPA.js} +41 -41
  172. package/dist/cli/{chunk-2UXDHFSF.mjs → chunk-GAVZ4EOD.mjs} +1 -1
  173. package/dist/cli/{chunk-Z2FIOG3V.js → chunk-HEBO3XNZ.js} +27 -31
  174. package/dist/cli/{chunk-6PWJKMFQ.mjs → chunk-HSJ6X2AQ.mjs} +4 -4
  175. package/dist/cli/{chunk-UPMRIVZB.js → chunk-HVI55MTK.js} +61 -10
  176. package/dist/cli/{chunk-KWSH5T7K.js → chunk-IH6GDNKW.js} +21 -21
  177. package/dist/cli/{chunk-3KYBDAR3.js → chunk-IMX7J4DU.js} +8 -8
  178. package/dist/cli/{chunk-HEHVGEZV.mjs → chunk-INEMTYMT.mjs} +8 -8
  179. package/dist/cli/{chunk-5VVSEU67.js → chunk-IUOGII7D.js} +6 -7
  180. package/dist/cli/{chunk-MXGA6JFI.mjs → chunk-JJGWHITQ.mjs} +5 -5
  181. package/dist/cli/{chunk-QM6Y6S4E.js → chunk-JLGP5XAJ.js} +5 -5
  182. package/dist/cli/{chunk-V6SCP4B7.mjs → chunk-LFOERUQY.mjs} +69 -3
  183. package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
  184. package/dist/cli/{chunk-ZMNGZ6XS.mjs → chunk-LH5PZKER.mjs} +80 -24
  185. package/dist/cli/{chunk-MR5LTVHD.js → chunk-LRDHPOZW.js} +69 -69
  186. package/dist/cli/{chunk-5LUF4LAR.mjs → chunk-LRZGS6RZ.mjs} +3 -0
  187. package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
  188. package/dist/cli/{chunk-UDXULACQ.js → chunk-MLABYI4M.js} +90 -24
  189. package/dist/cli/{chunk-S7IZWGUA.mjs → chunk-NDNHYONK.mjs} +17 -21
  190. package/dist/cli/{chunk-4D3WIZST.mjs → chunk-OTV2UUKW.mjs} +164 -18
  191. package/dist/cli/{chunk-XYE5XPGF.js → chunk-Q6Z6N3A7.js} +18 -18
  192. package/dist/cli/{chunk-7WQNWJQW.mjs → chunk-QG6JIWUL.mjs} +151 -43
  193. package/dist/cli/{chunk-3T65J5RG.mjs → chunk-QI5S5HWB.mjs} +2 -2
  194. package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
  195. package/dist/cli/{chunk-PM7MO62Y.mjs → chunk-RMNOZKRI.mjs} +3 -3
  196. package/dist/cli/{chunk-NMWGZD6Y.js → chunk-RTV4RF7N.js} +36 -36
  197. package/dist/cli/{chunk-CQ6JYQSW.js → chunk-SBH4CKPN.js} +11 -11
  198. package/dist/cli/{chunk-BIIJATTX.mjs → chunk-SG3LUONJ.mjs} +3 -3
  199. package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
  200. package/dist/cli/{chunk-5IL7SC45.mjs → chunk-TN4TY6TT.mjs} +6 -7
  201. package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
  202. package/dist/cli/{chunk-RE5MJBEV.mjs → chunk-UVQJYV76.mjs} +2 -2
  203. package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
  204. package/dist/cli/{chunk-W2ZWQUHT.js → chunk-WOCHZCUJ.js} +2 -2
  205. package/dist/cli/{chunk-ZDQFBJPO.js → chunk-XLIHTJVM.js} +348 -118
  206. package/dist/cli/{chunk-2ZYRBMQM.js → chunk-Y6SP3JMI.js} +22 -22
  207. package/dist/cli/{chunk-PPSDCN6C.js → chunk-YUA6HA6D.js} +2 -2
  208. package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
  209. package/dist/cli/{chunk-E64HFB4L.mjs → chunk-Z6XPSHKM.mjs} +87 -41
  210. package/dist/cli/{chunk-7DOQ3OEX.mjs → chunk-Z7AOIHFE.mjs} +1870 -91
  211. package/dist/cli/command-docs.js +3 -3
  212. package/dist/cli/command-docs.mjs +2 -2
  213. package/dist/cli/concurrent-runs-help-CFJH4KXV.js +22 -0
  214. package/dist/cli/{concurrent-runs-help-C6L6I5OR.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
  215. package/dist/cli/{csv-QMF4FWE7.js → csv-SA6ELJY6.js} +16 -15
  216. package/dist/cli/{csv-SYSDXFEM.mjs → csv-ZXZGHWOM.mjs} +7 -6
  217. package/dist/cli/{db-Q7HURWRZ.mjs → db-A54SP6AD.mjs} +16 -16
  218. package/dist/cli/{db-YSHPPA4H.js → db-JHFEIQBU.js} +43 -43
  219. package/dist/cli/describe-PHQ33AGS.mjs +50 -0
  220. package/dist/cli/describe-RHJ4XRFI.js +50 -0
  221. package/dist/cli/describe-core.d.mts +3 -3
  222. package/dist/cli/describe-core.d.ts +3 -3
  223. package/dist/cli/describe-core.js +6 -6
  224. package/dist/cli/describe-core.mjs +5 -5
  225. package/dist/cli/{executions-G7U3VUXN.mjs → executions-HL2M2DFU.mjs} +10 -10
  226. package/dist/cli/{executions-MWBC5TAW.js → executions-TLFZRHBJ.js} +12 -12
  227. package/dist/cli/{feedback-SD55OY6H.js → feedback-5UEX5UZK.js} +17 -16
  228. package/dist/cli/{feedback-GMHIFLBJ.mjs → feedback-QMBTNXVG.mjs} +9 -8
  229. package/dist/cli/git-4JWOOHBG.js +26 -0
  230. package/dist/cli/{git-HPE45OPD.mjs → git-LKGXVIVC.mjs} +8 -7
  231. package/dist/cli/index.js +170 -158
  232. package/dist/cli/index.mjs +60 -48
  233. package/dist/cli/{integrations-HFKVBY6G.js → integrations-6RUTLMN7.js} +23 -27
  234. package/dist/cli/{integrations-2W4MGIQR.mjs → integrations-FGGRVUJ7.mjs} +15 -19
  235. package/dist/cli/{legacy-noops-SXVNDEXN.js → legacy-noops-J3Z7QRWZ.js} +12 -11
  236. package/dist/cli/{legacy-noops-GZYKNU2Z.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
  237. package/dist/cli/{mcp-PJRHQHHU.js → mcp-6LWFP7RW.js} +121 -48
  238. package/dist/cli/{mcp-BWA6KULG.mjs → mcp-CHDYFO7F.mjs} +100 -27
  239. package/dist/cli/{monitors-K2WSI6CR.js → monitors-STM6A7OU.js} +221 -186
  240. package/dist/cli/{monitors-SYQKCATO.mjs → monitors-UGRY2BXI.mjs} +58 -23
  241. package/dist/cli/org-3SYOUQCX.mjs +2289 -0
  242. package/dist/cli/org-ZOBSNSIB.js +2289 -0
  243. package/dist/cli/outcomes-H4YYAT5X.js +2865 -0
  244. package/dist/cli/outcomes-Z3P2JE67.mjs +2865 -0
  245. package/dist/cli/{play-SZXY2F2S.js → play-SM4CW2GS.js} +1116 -846
  246. package/dist/cli/{play-TTMABJEI.mjs → play-SN5YWLS7.mjs} +375 -105
  247. package/dist/cli/{providers-GQIOMRQO.mjs → providers-WZ4YBR5Y.mjs} +10 -10
  248. package/dist/cli/{providers-YDHCTZAF.js → providers-WZARYMCF.js} +13 -13
  249. package/dist/cli/{quickstart-PHSSMKCA.mjs → quickstart-2575BNKA.mjs} +7 -6
  250. package/dist/cli/{quickstart-BNYOXQXG.js → quickstart-PS4YHQJ6.js} +9 -8
  251. package/dist/cli/{run-GFIAZXVL.js → run-FLZ6OTM7.js} +51 -51
  252. package/dist/cli/{run-74C3C75C.mjs → run-ZUHCZOJS.mjs} +31 -31
  253. package/dist/cli/run-identity-LMLFMACS.js +31 -0
  254. package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
  255. package/dist/cli/{search-3SWUB7KX.mjs → search-HLPPKQEO.mjs} +11 -11
  256. package/dist/cli/search-JJWVHR3N.js +32 -0
  257. package/dist/cli/{search-output-K2SWHVHQ.mjs → search-output-PDAXNOGP.mjs} +9 -8
  258. package/dist/cli/{search-output-6JF3S4TP.js → search-output-RXJLU36B.js} +12 -11
  259. package/dist/cli/{secrets-2M4XWEKE.mjs → secrets-CGELYQ3H.mjs} +11 -11
  260. package/dist/cli/{secrets-2SAKLH2H.js → secrets-QJNG7G2Y.js} +20 -20
  261. package/dist/cli/sessions-DHTBT2GN.js +23 -0
  262. package/dist/cli/{sessions-A64BCXTO.mjs → sessions-ELMWVR4M.mjs} +9 -8
  263. package/dist/cli/{settings-HV64WIJF.js → settings-44I44P5F.js} +89 -89
  264. package/dist/cli/{settings-SVGEC3FI.mjs → settings-RR3LZXL7.mjs} +16 -16
  265. package/dist/cli/{setup-EDC3NEJ3.mjs → setup-KGWRWH4B.mjs} +20 -19
  266. package/dist/cli/{setup-FHXOLQGQ.js → setup-KTEYOCJO.js} +60 -59
  267. package/dist/cli/skills-EPZPEXI2.js +37 -0
  268. package/dist/cli/{skills-3HGHZMXB.mjs → skills-FPRID2I5.mjs} +10 -9
  269. package/dist/cli/tools-IGQQ5TML.js +57 -0
  270. package/dist/cli/{tools-P2QS6A6Q.mjs → tools-PI4WMDLY.mjs} +23 -23
  271. package/dist/cli/update-4RNCVYGE.js +37 -0
  272. package/dist/cli/{update-552BYQM4.mjs → update-VJOJAZ7B.mjs} +14 -11
  273. package/dist/cli/{views-PA25NAE3.js → views-NTUOLNQU.js} +62 -64
  274. package/dist/cli/{views-LD5HXJYY.mjs → views-OVPSINZO.mjs} +47 -49
  275. package/dist/cli/{workflow-FIDBUQV6.js → workflow-2UDYDM6F.js} +23 -23
  276. package/dist/cli/{workflow-LDYFGBYP.mjs → workflow-7OEFNXZC.mjs} +13 -13
  277. package/dist/{client-DuDFiJDU.d.mts → client-B8f7RNF8.d.mts} +1 -1
  278. package/dist/{client-t9HZAkFD.d.ts → client-C5TgXmJQ.d.ts} +1 -1
  279. package/dist/{client-core-DydMQOft.d.mts → client-core-SLLGBTht.d.mts} +285 -23
  280. package/dist/{client-core-CJRzLanv.d.ts → client-core-p0sOxnkl.d.ts} +285 -23
  281. package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
  282. package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
  283. package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
  284. package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
  285. package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
  286. package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
  287. package/dist/index.d.mts +7 -7
  288. package/dist/index.d.ts +7 -7
  289. package/dist/index.js +66 -55
  290. package/dist/index.mjs +25 -14
  291. package/dist/install-integrity.json +162 -142
  292. package/dist/plays/bundle-play-file.d.mts +3 -3
  293. package/dist/plays/bundle-play-file.d.ts +3 -3
  294. package/dist/plays/bundle-play-file.mjs +23 -4
  295. package/dist/plays/csv-data-input.js +3 -3
  296. package/dist/plays/csv-data-input.mjs +2 -2
  297. package/dist/plays/play-description.d.mts +2 -2
  298. package/dist/plays/play-description.d.ts +2 -2
  299. package/dist/plays/run-request.d.mts +2 -2
  300. package/dist/plays/run-request.d.ts +2 -2
  301. package/dist/plays/run-request.js +4 -4
  302. package/dist/plays/run-request.mjs +3 -3
  303. package/dist/release.d.mts +1 -1
  304. package/dist/release.d.ts +1 -1
  305. package/dist/release.js +2 -2
  306. package/dist/release.mjs +1 -1
  307. package/dist/server.d.mts +4 -4
  308. package/dist/server.d.ts +4 -4
  309. package/dist/server.js +15 -13
  310. package/dist/server.mjs +9 -7
  311. package/package.json +1 -1
  312. package/dist/cli/auth-B4PI7GVY.js +0 -43
  313. package/dist/cli/concurrent-runs-help-JEFQZTJI.js +0 -21
  314. package/dist/cli/describe-PXTSBJTL.js +0 -50
  315. package/dist/cli/describe-YGMQBV44.mjs +0 -50
  316. package/dist/cli/git-I3JV7IGH.js +0 -25
  317. package/dist/cli/org-5KD7X7IA.mjs +0 -1282
  318. package/dist/cli/org-YQ2CR32B.js +0 -1282
  319. package/dist/cli/run-identity-G257GQED.js +0 -25
  320. package/dist/cli/search-2RRRF4LW.js +0 -32
  321. package/dist/cli/sessions-SBH27JNW.js +0 -22
  322. package/dist/cli/skills-Y3SRLOYD.js +0 -36
  323. package/dist/cli/tools-OFYPUPUV.js +0 -57
  324. package/dist/cli/update-SOUSCLB7.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
- async function mutateClaim(
643
- action: 'activate' | 'release',
644
- input: {
645
- auth: OrgAuthContext;
646
- monitorKey: string;
647
- claim: ProviderMonitorIdentityClaim;
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[action],
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
- ...(input.operationId ? { operationId: input.operationId } : {}),
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
@@ -7,6 +7,8 @@
7
7
  // and declares the same fields on its capability; registry validation keeps the
8
8
  // two declarations aligned.
9
9
 
10
+ import { tamradarCanonicalCountryName } from './tamradar-countries';
11
+
10
12
  export type ProviderMonitorUpstreamIdentityValue = string | null;
11
13
 
12
14
  export type ProviderMonitorUpstreamIdentitySignature = {
@@ -32,15 +34,26 @@ type ProviderMonitorUpstreamIdentityDefinition = {
32
34
  */
33
35
  allowDistinctConfigurations?: boolean;
34
36
  /**
35
- * Scope values whose provider resource has no configuration of its own: a
36
- * global feed delivers the same findings whatever else the payload says.
37
- * Inside these scopes every other payload field (such as `updates_since`)
38
- * is left out of the claim, so a second monitor for the same feed is an
39
- * exact duplicate even when its other fields differ.
37
+ * Scope values whose provider resource is a global feed: it delivers the
38
+ * same findings whatever else the payload says, except for the scope's
39
+ * `configurationFields` filters. Inside these scopes every other payload
40
+ * field (such as `updates_since`) is left out of the claim, so a second
41
+ * monitor for the same feed with the same filters is an exact duplicate
42
+ * even when its other fields differ. A monitor that sets none of the
43
+ * filters keeps the scope-only key.
40
44
  */
41
45
  configurationFreeScopes?: readonly {
42
46
  field: string;
43
47
  values: readonly string[];
48
+ configurationFields?: readonly {
49
+ name: string;
50
+ /**
51
+ * The provider's one spelling for an accepted value, so aliases that
52
+ * select the same findings claim the same feed. Values it does not
53
+ * recognize key as written; the provider refuses them at create.
54
+ */
55
+ canonicalValue?: (value: string) => string | null;
56
+ }[];
44
57
  }[];
45
58
  /**
46
59
  * Payload fields that never change which findings the provider resource
@@ -71,12 +84,22 @@ const PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS = {
71
84
  { name: 'industry', runtimePayloadAliases: ['keyword'] },
72
85
  ],
73
86
  allowDistinctConfigurations: true,
74
- // TamRadar's funding-round and new-company radars take no filter, so one
75
- // per workspace is the whole feed.
87
+ // TamRadar's new-company radar takes no filter, so one per workspace is
88
+ // the whole feed. Its funding-round radar is the same global feed narrowed
89
+ // only by `countries` and `rounds` (2026-11-17), so one unfiltered and any
90
+ // number of differently filtered funding monitors can coexist.
76
91
  configurationFreeScopes: [
77
92
  {
78
93
  field: 'radar_type',
79
- values: ['industry_funding_rounds', 'industry_new_companies'],
94
+ values: ['industry_new_companies'],
95
+ },
96
+ {
97
+ field: 'radar_type',
98
+ values: ['industry_funding_rounds'],
99
+ configurationFields: [
100
+ { name: 'countries', canonicalValue: tamradarCanonicalCountryName },
101
+ { name: 'rounds' },
102
+ ],
80
103
  },
81
104
  ],
82
105
  nonConfigurationFields: ['updates_since'],
@@ -194,13 +217,29 @@ export function providerMonitorUpstreamIdentityClaimKey(
194
217
  PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS[
195
218
  signature.tool as keyof typeof PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS
196
219
  ];
197
- if (
198
- definition.configurationFreeScopes?.some((scope) => {
220
+ const configurationFreeScope = definition.configurationFreeScopes?.find(
221
+ (scope) => {
199
222
  const value = signature.key[scope.field];
200
223
  return typeof value === 'string' && scope.values.includes(value);
201
- })
202
- ) {
203
- return scopeKey;
224
+ },
225
+ );
226
+ if (configurationFreeScope) {
227
+ // Spelling, case and order do not change which findings the provider
228
+ // delivers, so each filter value is canonicalized, lowercased and sorted
229
+ // before keying: "us", "US" and "United States" claim one feed.
230
+ const filters = Object.fromEntries(
231
+ (configurationFreeScope.configurationFields ?? [])
232
+ .map(
233
+ (field) =>
234
+ [
235
+ field.name,
236
+ normalizeFilterValue(payload?.[field.name], field.canonicalValue),
237
+ ] as const,
238
+ )
239
+ .filter(([, value]) => !isEmptyFilterValue(value)),
240
+ );
241
+ if (Object.keys(filters).length === 0) return scopeKey;
242
+ return `${scopeKey}${CONFIGURATION_SEPARATOR}${stableJson(filters)}`;
204
243
  }
205
244
  const scopeAndAliases = new Set<string>(
206
245
  definition.fields.flatMap((field) => [
@@ -220,6 +259,34 @@ export function providerMonitorUpstreamIdentityClaimKey(
220
259
  return `${scopeKey}${CONFIGURATION_SEPARATOR}${stableJson(configuration)}`;
221
260
  }
222
261
 
262
+ /**
263
+ * A filter list canonicalized, trimmed, lowercased and sorted, keeping blank
264
+ * entries out.
265
+ */
266
+ function normalizeFilterValue(
267
+ value: unknown,
268
+ canonicalValue?: (value: string) => string | null,
269
+ ) {
270
+ if (!Array.isArray(value)) return value;
271
+ return value
272
+ .map((entry) =>
273
+ typeof entry === 'string'
274
+ ? (canonicalValue?.(entry) ?? entry).trim().toLowerCase()
275
+ : entry,
276
+ )
277
+ .filter((entry) => entry !== '' && entry !== null && entry !== undefined)
278
+ .sort((left, right) => stableJson(left).localeCompare(stableJson(right)));
279
+ }
280
+
281
+ /** An omitted filter and an empty list both mean "no filter". */
282
+ function isEmptyFilterValue(value: unknown) {
283
+ return (
284
+ value === undefined ||
285
+ value === null ||
286
+ (Array.isArray(value) && value.length === 0)
287
+ );
288
+ }
289
+
223
290
  function parseJsonObject(text: string): Record<string, unknown> | null {
224
291
  try {
225
292
  const parsed: unknown = JSON.parse(text);
@@ -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 (failureCount >= PROVIDER_RESOURCE_FAILURES_BEFORE_ERRORED) {
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 = !isKnownTamradarRadarFailureReason(input.reason);
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
- `radar_failure reason=${input.reason} on radar ${input.providerResourceId}`,
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. Best-effort: a missing table/row must not block the
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
- [eventIdempotencyKey, lastError.slice(0, 4000)],
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
- if (eventIdempotencyKey) {
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, eventIdempotencyKey, lastError);
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