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
@@ -1,3 +1,4 @@
1
+ import { MONITOR_FLEET_MAX_MEMBERS } from '../integration-contracts/monitor-fleet-contract';
1
2
  import {
2
3
  monitorSdkIssue,
3
4
  type MonitorSdkValidationIssue,
@@ -83,6 +84,33 @@ export type ProviderMonitorCapabilityPayloadValidator = (input: {
83
84
  entityKey: string;
84
85
  }) => MonitorSdkValidationIssue[];
85
86
 
87
+ /** What a provider's status answer says about one monitor resource. */
88
+ export type ProviderMonitorStatusReading =
89
+ /** The provider runs the monitor. */
90
+ | { kind: 'running' }
91
+ /**
92
+ * The provider holds it but does not run it on schedule, for a reason that
93
+ * is not a failure (for example someone paused it).
94
+ */
95
+ | { kind: 'not_running'; providerStatus: string }
96
+ /** The provider stopped it because it failed; `reason` goes to the errored owner. */
97
+ | { kind: 'provider_failed'; reason: string };
98
+
99
+ /**
100
+ * How the monitor audit reads one resource's status when the capability has
101
+ * no `runtime.batchRead`: `runtime.statusAction` is called once per monitor
102
+ * with `payload(id)`, under that monitor's own credential lane, and `parse`
103
+ * says what the answer means. Only the audit reads it, to record what it saw
104
+ * and to hand a resource the provider stopped to the errored owner
105
+ * (`providerMonitorResourceFailures.record`). It never stands in for a
106
+ * batch read: delete readbacks treat a batch read's "inactive" as gone, and a
107
+ * monitor a provider disabled still exists.
108
+ */
109
+ export type ProviderMonitorStatusReader = {
110
+ payload(providerResourceId: string): Record<string, unknown>;
111
+ parse(raw: unknown, providerResourceId: string): ProviderMonitorStatusReading;
112
+ };
113
+
86
114
  export type ProviderMonitorCapabilityExample = {
87
115
  label: string;
88
116
  definition: {
@@ -132,8 +160,33 @@ export const PROVIDER_MONITOR_SHARED_DOCUMENTATION = {
132
160
  ],
133
161
  } as const;
134
162
 
163
+ /**
164
+ * How a provider signs a callback. Declaring it lets the shared verifier check
165
+ * the signature without a provider-specific branch. `timestamp_dot_body` signs
166
+ * `${t}.${rawBody}` where the header carries `t=<unix>,v1=<hex>` (Stripe and
167
+ * Exa style); `raw_body` signs the raw body alone.
168
+ */
169
+ export type ProviderMonitorCallbackSignatureDescriptor = {
170
+ header: string;
171
+ signedPayload: 'raw_body' | 'timestamp_dot_body';
172
+ };
173
+
135
174
  export type ProviderMonitorInboundAuthDescriptor =
136
- | { mode: 'hmac_sha256'; secretSource: 'provider' | 'deepline' }
175
+ | {
176
+ mode: 'hmac_sha256';
177
+ secretSource: 'provider' | 'deepline';
178
+ /**
179
+ * Required for every provider outside the legacy verifier allowlist
180
+ * (attio, theirstack, snitcher). Without it the callback would be
181
+ * admitted on its URL token alone.
182
+ */
183
+ signature?: ProviderMonitorCallbackSignatureDescriptor;
184
+ /**
185
+ * Dotted path of the signing secret in the provider's create response,
186
+ * for `secretSource: 'provider'` (for example Exa's `webhookSecret`).
187
+ */
188
+ providerSecretResponsePath?: string;
189
+ }
137
190
  | { mode: 'body_secret'; secretSource: 'deepline' }
138
191
  | {
139
192
  mode: 'custom_header';
@@ -142,6 +195,55 @@ export type ProviderMonitorInboundAuthDescriptor =
142
195
  }
143
196
  | { mode: 'callback_token' };
144
197
 
198
+ /**
199
+ * Which provider account a monitor's upstream resource lives in.
200
+ *
201
+ * - `deepline_managed`: Deepline's platform key. One provider account holds
202
+ * every customer's resources, so the capability must never expose an
203
+ * account-wide read or write to customers.
204
+ * - `customer_key`: the workspace's own connected key.
205
+ *
206
+ * The lane is resolved once at deploy, stored on the binding as
207
+ * `credential_lane`, and enforced on every later provider call for that
208
+ * monitor, so a monitor id is never sent to a different account.
209
+ */
210
+ export type ProviderMonitorCredentialLane = 'deepline_managed' | 'customer_key';
211
+
212
+ /** Customer-facing values of the framework-managed `credential` payload field. */
213
+ export const PROVIDER_MONITOR_CREDENTIAL_CHOICES = [
214
+ 'auto',
215
+ 'deepline',
216
+ 'byok',
217
+ ] as const;
218
+ export type ProviderMonitorCredentialChoice =
219
+ (typeof PROVIDER_MONITOR_CREDENTIAL_CHOICES)[number];
220
+
221
+ /** Payload field a customer uses to choose a credential lane. */
222
+ export const PROVIDER_MONITOR_CREDENTIAL_PAYLOAD_FIELD = 'credential';
223
+
224
+ /** Binding field holding the lane the upstream resource was created in. */
225
+ export const PROVIDER_MONITOR_CREDENTIAL_LANE_BINDING_FIELD = 'credential_lane';
226
+
227
+ /**
228
+ * Identifiers a signed callback must carry, checked against the stored
229
+ * binding before any row, charge, or Play. This is the generic form of the
230
+ * TamRadar `radar_id` fence.
231
+ */
232
+ export type ProviderMonitorCallbackContract = {
233
+ /**
234
+ * Payload paths holding the upstream resource id. The first path present
235
+ * must equal the binding's `upstream_resource_id`; a callback with none of
236
+ * them, or a different id, fails as `provider_callback_binding_mismatch`.
237
+ */
238
+ upstreamResourceIdPaths: readonly string[];
239
+ /**
240
+ * Payload paths whose values, joined with `:`, form the provider event id
241
+ * used for dedupe. Every path must be present; otherwise the shared
242
+ * content hash is used.
243
+ */
244
+ eventIdPaths?: readonly string[];
245
+ };
246
+
145
247
  /**
146
248
  * Provider-owned instructions shown only after Deepline has minted a callback
147
249
  * endpoint for a monitor. `{{callback_url}}` is interpolated at read time; the
@@ -153,6 +255,13 @@ export type ProviderMonitorPostDeployGuidance = {
153
255
  documentation: Array<{ label: string; url: string }>;
154
256
  event_type?: string;
155
257
  payload_example?: Record<string, unknown>;
258
+ /**
259
+ * What the customer removes in the provider after deleting the monitor.
260
+ * Declaring it lets a `provider_manual_webhook` monitor be deleted by
261
+ * retiring its callback; leave it out when Deepline holds another provider
262
+ * resource for the monitor (Deepline Analytics' Snitcher tracker).
263
+ */
264
+ removal_step?: string;
156
265
  };
157
266
 
158
267
  export type ProviderMonitorCapabilityDefinition = {
@@ -164,6 +273,8 @@ export type ProviderMonitorCapabilityDefinition = {
164
273
  description: string;
165
274
  payloadSchema: ProviderMonitorCapabilityPayloadSchema;
166
275
  validatePayload?: ProviderMonitorCapabilityPayloadValidator;
276
+ /** See `ProviderMonitorStatusReader`. Needs `runtime.statusAction`. */
277
+ readProviderStatus?: ProviderMonitorStatusReader;
167
278
  /**
168
279
  * A narrow compatibility declaration for payload fields whose validation was
169
280
  * tightened after customer monitors were already stored. It applies only
@@ -174,10 +285,36 @@ export type ProviderMonitorCapabilityDefinition = {
174
285
  grandfatheredPaths: readonly string[];
175
286
  /** Generic schema issue codes eligible for those same legacy paths. */
176
287
  grandfatheredSchemaIssueCodes?: readonly string[];
288
+ /**
289
+ * Capability issue codes kept even on grandfathered paths, because the
290
+ * provider itself refuses the value (TamRadar's `job_titles` length).
291
+ */
292
+ enforcedIssueCodes?: readonly string[];
177
293
  };
294
+ /**
295
+ * Payload fields that only some `radar_type` values accept, mapped to those
296
+ * values. Describing one radar type leaves out the fields it doesn't accept,
297
+ * so the shown filters match what deploy validation admits.
298
+ */
299
+ radarTypeScopedPayloadFields?: Readonly<Record<string, readonly string[]>>;
178
300
  payloadExamples: ProviderMonitorCapabilityExample[];
179
301
  documentation: ProviderMonitorCapabilityDocumentation;
180
302
  postDeployGuidance?: ProviderMonitorPostDeployGuidance;
303
+ /**
304
+ * Opts a provider capability into customer discovery and new deploys.
305
+ * Without it only native radars and manual-webhook pixels are offered;
306
+ * other bundles stay inspectable and deletable but cannot be deployed.
307
+ */
308
+ offered?: boolean;
309
+ /**
310
+ * Feature-rollout id (`FEATURE_ROLLOUTS` in `@deepline/auth`) that gates an
311
+ * offered capability per workspace. While set, the capability is left out
312
+ * of every static discovery surface (tools catalogs, public describe,
313
+ * generated contract and pricing docs) and is visible, checkable and
314
+ * deployable only for workspaces the rollout admits, staff included.
315
+ * Deployed monitors keep running and can be deleted. Remove it to launch.
316
+ */
317
+ rolloutFeature?: string;
181
318
  /** Friendly provider-specific setup target, e.g. deepline.analytics. */
182
319
  setupAlias?: string;
183
320
  /**
@@ -286,6 +423,29 @@ export type ProviderMonitorCapabilityDefinition = {
286
423
  maxIds: number;
287
424
  rateLimitId: string;
288
425
  };
426
+ /**
427
+ * Monitor Fleet transport for a provider with no bulk endpoints: each
428
+ * member is created with `deployAction` and deleted with `deleteAction`,
429
+ * one provider request per member, under that member's pinned credential
430
+ * lane and on its own callback URL. Only Monitor Fleets read this. Named
431
+ * Batches and Monitor Jobs use the scalar lifecycle ("Providers without
432
+ * batch adapters" in `docs/provider-monitor-playbook.md`), and a
433
+ * capability with bulk adapters uses those instead.
434
+ *
435
+ * The provider must return the created resource's id in the create
436
+ * answer: that answer, recorded on the member's fence, is what a resumed
437
+ * pass settles from. A create whose answer is lost is held, never sent
438
+ * again, because nothing can look it up.
439
+ */
440
+ fleetPerResource?: {
441
+ /**
442
+ * The most members one Fleet of this capability may select
443
+ * (`selection.limit`). Refused at check, plan and commit.
444
+ */
445
+ maxMembers: number;
446
+ /** Provider requests one convergence pass keeps in flight at once. */
447
+ concurrency: number;
448
+ };
289
449
  /**
290
450
  * Optional paid sample: a few recent matches for the definition being
291
451
  * considered, with nothing created. Only payloads whose `payloadField`
@@ -322,6 +482,19 @@ export type ProviderMonitorCapabilityDefinition = {
322
482
  | 'per_monitor_create_url'
323
483
  | 'managed_deploy_action'
324
484
  | 'account_marker';
485
+ /**
486
+ * Identifiers every callback must carry for the shared verifier's
487
+ * resource fence and event id. Required for a native webhook monitor
488
+ * that can run on a shared Deepline-managed account.
489
+ */
490
+ callbackContract?: ProviderMonitorCallbackContract;
491
+ /**
492
+ * Credential lanes this monitor can run on. Declaring more than one adds
493
+ * the framework-managed `credential` payload field (`auto`, `deepline`,
494
+ * `byok`). Undeclared means the legacy behaviour: whatever key the
495
+ * integration request resolves, with nothing pinned.
496
+ */
497
+ credentialLanes?: readonly ProviderMonitorCredentialLane[];
325
498
  };
326
499
  outputs: Record<string, ProviderMonitorCapabilityOutput>;
327
500
  lifecycle: {
@@ -453,6 +626,168 @@ export function parseProviderMonitorCapabilityId(value: string) {
453
626
  };
454
627
  }
455
628
 
629
+ /**
630
+ * Providers whose HMAC callbacks predate `inboundAuth.signature` and are
631
+ * verified by name in `provider-callback-verification.ts`. Every other HMAC
632
+ * provider must declare its signature.
633
+ */
634
+ export const LEGACY_SIGNED_CALLBACK_PROVIDERS: ReadonlySet<string> = new Set([
635
+ 'attio',
636
+ 'theirstack',
637
+ 'snitcher',
638
+ ]);
639
+
640
+ function assertProviderMonitorRuntimeContract(input: {
641
+ providerCapability: string;
642
+ provider: string;
643
+ runtime: ProviderMonitorCapabilityDefinition['runtime'];
644
+ }) {
645
+ const { runtime } = input;
646
+ const auth = runtime.inboundAuth;
647
+ if (
648
+ auth?.mode === 'hmac_sha256' &&
649
+ !auth.signature &&
650
+ !LEGACY_SIGNED_CALLBACK_PROVIDERS.has(input.provider)
651
+ ) {
652
+ throw new Error(
653
+ `Monitor ${input.providerCapability} uses hmac_sha256 callbacks but declares no inboundAuth.signature, so callbacks would be admitted unsigned.`,
654
+ );
655
+ }
656
+ if (
657
+ auth?.mode === 'hmac_sha256' &&
658
+ auth.secretSource !== 'provider' &&
659
+ auth.providerSecretResponsePath
660
+ ) {
661
+ throw new Error(
662
+ `Monitor ${input.providerCapability} names providerSecretResponsePath but its secret is not provider-issued.`,
663
+ );
664
+ }
665
+ assertFleetPerResourceContract(input);
666
+ const lanes = runtime.credentialLanes ?? [];
667
+ if (new Set(lanes).size !== lanes.length) {
668
+ throw new Error(
669
+ `Monitor ${input.providerCapability} lists a credential lane twice.`,
670
+ );
671
+ }
672
+ if (
673
+ lanes.includes('deepline_managed') &&
674
+ runtime.inbound === 'webhook' &&
675
+ !runtime.callbackContract?.upstreamResourceIdPaths.length
676
+ ) {
677
+ // A shared Deepline account holds every customer's resources. Without a
678
+ // resource fence, a signed callback for one monitor could be written to
679
+ // another monitor's binding.
680
+ throw new Error(
681
+ `Monitor ${input.providerCapability} runs on a shared Deepline-managed account and must declare runtime.callbackContract.upstreamResourceIdPaths.`,
682
+ );
683
+ }
684
+ }
685
+
686
+ /** Most per-resource requests one convergence pass may keep in flight. */
687
+ export const FLEET_PER_RESOURCE_MAX_CONCURRENCY = 10;
688
+
689
+ function assertFleetPerResourceContract(input: {
690
+ providerCapability: string;
691
+ runtime: ProviderMonitorCapabilityDefinition['runtime'];
692
+ }) {
693
+ const declaration = input.runtime.fleetPerResource;
694
+ if (!declaration) return;
695
+ const name = `Monitor ${input.providerCapability}`;
696
+ if (input.runtime.batchCreate || input.runtime.batchDelete) {
697
+ // Two Fleet transports for one capability would make which one runs a
698
+ // matter of call order.
699
+ throw new Error(
700
+ `${name} declares runtime.fleetPerResource beside a batch adapter; declare one Fleet transport.`,
701
+ );
702
+ }
703
+ if (!input.runtime.deployAction || !input.runtime.deleteAction) {
704
+ throw new Error(
705
+ `${name} declares runtime.fleetPerResource without both deployAction and deleteAction.`,
706
+ );
707
+ }
708
+ if (
709
+ input.runtime.inbound === 'webhook' &&
710
+ input.runtime.webhookRegistrationStrategy !== 'per_monitor_create_url'
711
+ ) {
712
+ // Each member is created on its own callback URL; an account-level
713
+ // webhook would need the shared batch admission this transport has none of.
714
+ throw new Error(
715
+ `${name} declares runtime.fleetPerResource but its webhook is not registered per monitor at create.`,
716
+ );
717
+ }
718
+ if (
719
+ !Number.isSafeInteger(declaration.maxMembers) ||
720
+ declaration.maxMembers < 1 ||
721
+ declaration.maxMembers > MONITOR_FLEET_MAX_MEMBERS
722
+ ) {
723
+ throw new Error(
724
+ `${name} declares runtime.fleetPerResource.maxMembers ${declaration.maxMembers}; it must be an integer from 1 through ${MONITOR_FLEET_MAX_MEMBERS}.`,
725
+ );
726
+ }
727
+ if (
728
+ !Number.isSafeInteger(declaration.concurrency) ||
729
+ declaration.concurrency < 1 ||
730
+ declaration.concurrency > FLEET_PER_RESOURCE_MAX_CONCURRENCY
731
+ ) {
732
+ throw new Error(
733
+ `${name} declares runtime.fleetPerResource.concurrency ${declaration.concurrency}; it must be an integer from 1 through ${FLEET_PER_RESOURCE_MAX_CONCURRENCY}.`,
734
+ );
735
+ }
736
+ }
737
+
738
+ function assertRadarTypeScopedPayloadFields(input: {
739
+ providerCapability: string;
740
+ payloadSchema: ProviderMonitorCapabilityPayloadSchema;
741
+ scopedFields: ProviderMonitorCapabilityDefinition['radarTypeScopedPayloadFields'];
742
+ }): void {
743
+ if (!input.scopedFields) return;
744
+ const properties = input.payloadSchema.properties ?? {};
745
+ const radarTypes = new Set(
746
+ (properties.radar_type?.enum ?? []).map((value) => String(value)),
747
+ );
748
+ for (const [field, scopedTypes] of Object.entries(input.scopedFields)) {
749
+ if (!properties[field]) {
750
+ throw new Error(
751
+ `Monitor ${input.providerCapability} scopes payload field "${field}" to radar types, but its payload schema has no such field.`,
752
+ );
753
+ }
754
+ // A scoped list may name a radar type that isn't deployable (such as
755
+ // company_social_posts_cxo), but it must reach at least one that is.
756
+ if (!scopedTypes.some((radarType) => radarTypes.has(radarType))) {
757
+ throw new Error(
758
+ `Monitor ${input.providerCapability} scopes payload field "${field}" to radar types none of which are deployable.`,
759
+ );
760
+ }
761
+ }
762
+ }
763
+
764
+ function withCredentialChoicePayloadField(input: {
765
+ payloadSchema: ProviderMonitorCapabilityPayloadSchema;
766
+ runtime: ProviderMonitorCapabilityDefinition['runtime'];
767
+ }): ProviderMonitorCapabilityPayloadSchema {
768
+ const lanes = input.runtime.credentialLanes ?? [];
769
+ if (lanes.length < 2) return input.payloadSchema;
770
+ if (
771
+ input.payloadSchema.properties?.[PROVIDER_MONITOR_CREDENTIAL_PAYLOAD_FIELD]
772
+ ) {
773
+ throw new Error(
774
+ `Monitor payload field "${PROVIDER_MONITOR_CREDENTIAL_PAYLOAD_FIELD}" is framework-managed when a capability declares credential lanes.`,
775
+ );
776
+ }
777
+ return {
778
+ ...input.payloadSchema,
779
+ properties: {
780
+ ...input.payloadSchema.properties,
781
+ [PROVIDER_MONITOR_CREDENTIAL_PAYLOAD_FIELD]: {
782
+ type: 'string',
783
+ enum: PROVIDER_MONITOR_CREDENTIAL_CHOICES,
784
+ description:
785
+ 'Which provider account runs this monitor. "auto" (default) uses the workspace\'s connected key when there is one and Deepline\'s managed account otherwise. "deepline" always uses Deepline\'s account and bills its provider usage in Deepline credits. "byok" always uses the workspace\'s own key; the provider bills the workspace directly. "auto" is resolved once, at the first deploy; later updates keep that account unless you set "deepline" or "byok" explicitly.',
786
+ },
787
+ },
788
+ };
789
+ }
790
+
456
791
  export function defineProviderMonitorCapability(input: {
457
792
  provider: string;
458
793
  capability: string;
@@ -460,10 +795,14 @@ export function defineProviderMonitorCapability(input: {
460
795
  description: string;
461
796
  payloadSchema: ProviderMonitorCapabilityPayloadSchema;
462
797
  validatePayload?: ProviderMonitorCapabilityPayloadValidator;
798
+ readProviderStatus?: ProviderMonitorStatusReader;
463
799
  legacyPayloadValidation?: ProviderMonitorCapabilityDefinition['legacyPayloadValidation'];
800
+ radarTypeScopedPayloadFields?: ProviderMonitorCapabilityDefinition['radarTypeScopedPayloadFields'];
464
801
  payloadExamples: ProviderMonitorCapabilityExample[];
465
802
  documentation?: ProviderMonitorCapabilityDocumentation;
466
803
  postDeployGuidance?: ProviderMonitorPostDeployGuidance;
804
+ offered?: boolean;
805
+ rolloutFeature?: string;
467
806
  setupAlias?: string;
468
807
  coverageKeyFields?: readonly string[];
469
808
  upstreamCollision?: ProviderMonitorCapabilityDefinition['upstreamCollision'];
@@ -475,19 +814,57 @@ export function defineProviderMonitorCapability(input: {
475
814
  lifecycle: ProviderMonitorCapabilityDefinition['lifecycle'];
476
815
  }): ProviderMonitorCapabilityDefinition {
477
816
  const providerCapability = providerMonitorCapabilityId(input);
817
+ assertProviderMonitorRuntimeContract({
818
+ providerCapability,
819
+ provider: input.provider,
820
+ runtime: input.runtime,
821
+ });
822
+ if (input.rolloutFeature !== undefined && !input.rolloutFeature.trim()) {
823
+ throw new Error(
824
+ `Monitor ${providerCapability} has an empty rolloutFeature.`,
825
+ );
826
+ }
827
+ if (input.readProviderStatus) {
828
+ if (!input.runtime.statusAction) {
829
+ throw new Error(
830
+ `Monitor ${providerCapability} declares readProviderStatus without runtime.statusAction to read with.`,
831
+ );
832
+ }
833
+ if (input.runtime.batchRead) {
834
+ throw new Error(
835
+ `Monitor ${providerCapability} declares both runtime.batchRead and readProviderStatus; the audit reads one way.`,
836
+ );
837
+ }
838
+ }
839
+ if (input.rolloutFeature && input.runtime.batchCreate) {
840
+ // Provider batch creates skip the scalar create path, which is where the
841
+ // per-workspace rollout backstop runs. A rollout-gated Fleet uses
842
+ // `runtime.fleetPerResource`, whose plan, commit and creates check it.
843
+ throw new Error(
844
+ `Monitor ${providerCapability} is rollout-gated and cannot declare runtime.batchCreate until the batch path checks the rollout.`,
845
+ );
846
+ }
847
+ const payloadSchema = withCredentialChoicePayloadField({
848
+ payloadSchema: input.payloadSchema,
849
+ runtime: input.runtime,
850
+ });
851
+ assertRadarTypeScopedPayloadFields({
852
+ providerCapability,
853
+ payloadSchema,
854
+ scopedFields: input.radarTypeScopedPayloadFields,
855
+ });
478
856
  const fields = Object.fromEntries(
479
- Object.entries(input.payloadSchema.properties ?? {}).map(
480
- ([field, schema]) => [
481
- field,
482
- {
483
- semantics:
484
- schema.description ?? `Provider-specific ${field} monitor filter.`,
485
- },
486
- ],
487
- ),
857
+ Object.entries(payloadSchema.properties ?? {}).map(([field, schema]) => [
858
+ field,
859
+ {
860
+ semantics:
861
+ schema.description ?? `Provider-specific ${field} monitor filter.`,
862
+ },
863
+ ]),
488
864
  );
489
865
  return {
490
866
  ...input,
867
+ payloadSchema,
491
868
  id: providerCapability,
492
869
  providerCapability,
493
870
  // Existing monitor bundles predate the generic type contract. Their
@@ -946,6 +1323,8 @@ export function validateProviderMonitorCapabilityPayload(input: {
946
1323
  const grandfatheredSchemaIssueCodes =
947
1324
  input.capability.legacyPayloadValidation?.grandfatheredSchemaIssueCodes ??
948
1325
  [];
1326
+ const enforcedIssueCodes =
1327
+ input.capability.legacyPayloadValidation?.enforcedIssueCodes ?? [];
949
1328
  return [
950
1329
  ...schemaIssues.filter(
951
1330
  (validationIssue) =>
@@ -959,6 +1338,7 @@ export function validateProviderMonitorCapabilityPayload(input: {
959
1338
  ...capabilityIssues.filter(
960
1339
  (validationIssue) =>
961
1340
  validationIssue.severity !== 'error' ||
1341
+ enforcedIssueCodes.includes(validationIssue.code) ||
962
1342
  !validationIssueMatchesGrandfatheredPath({
963
1343
  issue: validationIssue,
964
1344
  paths: grandfatheredPaths,
@@ -131,6 +131,40 @@ export class ProviderMonitorStoppedAfterSubmitError extends Error {
131
131
  }
132
132
  }
133
133
 
134
+ /**
135
+ * A provider create left Deepline but no answer came back, so the provider may
136
+ * hold a resource Deepline has no binding for. The create's fence is held
137
+ * (`holdLifecycleProvisioning`) and the attempt is never retried
138
+ * automatically: with no idempotency key, a second create would orphan the
139
+ * first. An operator reconciles from the alert. The message avoids words a
140
+ * retry classifier reads as transient.
141
+ */
142
+ export class ProviderMonitorCreateOutcomeUnknownError extends Error {
143
+ constructor(
144
+ readonly monitorKey: string,
145
+ readonly provider: string,
146
+ readonly heldUntil: number | null,
147
+ /**
148
+ * The account the create was sent to, for a lane-pinned provider: the
149
+ * one an operator reconciles in. Null for a provider without lanes.
150
+ */
151
+ readonly credentialLane: 'deepline_managed' | 'customer_key' | null = null,
152
+ ) {
153
+ super(
154
+ `${provider} may have created monitor "${monitorKey}"${
155
+ credentialLane === 'customer_key'
156
+ ? ` in this workspace's own ${provider} account`
157
+ : credentialLane === 'deepline_managed'
158
+ ? ` in Deepline's ${provider} account`
159
+ : ''
160
+ }, but its answer never arrived. Deepline holds this monitor${
161
+ heldUntil === null ? '' : ` until ${new Date(heldUntil).toISOString()}`
162
+ } and does not try again on its own, so no second ${provider} monitor is made; support has been alerted to reconcile it.`,
163
+ );
164
+ this.name = 'ProviderMonitorCreateOutcomeUnknownError';
165
+ }
166
+ }
167
+
134
168
  /**
135
169
  * The provider failed this monitor's resource and only a payload change fixes
136
170
  * it (`errored`, KAR-193). Nothing else may recreate it from the same payload: