deepline 0.3.552 → 0.3.553

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +107 -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 +118 -8
  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 +8 -1
  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 +9 -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-resource-failure.ts +26 -3
  43. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
  44. package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
  45. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
  46. package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
  47. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
  48. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
  49. package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
  50. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
  51. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
  52. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  53. package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
  54. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +168 -41
  55. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
  56. package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
  57. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
  58. package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
  59. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
  60. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +444 -39
  61. package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
  63. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
  64. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
  65. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
  66. package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
  67. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
  68. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +72 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
  71. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
  73. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
  74. package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
  75. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
  78. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
  79. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
  80. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +254 -44
  82. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
  83. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
  84. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
  85. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
  86. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +259 -52
  89. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +30 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
  92. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
  95. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
  97. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
  98. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
  99. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
  100. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
  101. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
  102. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
  104. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
  105. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
  106. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
  108. package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
  109. package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
  113. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
  114. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
  116. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
  117. package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
  118. package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
  119. package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
  120. package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
  121. package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
  122. package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
  123. package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
  124. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
  125. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
  126. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
  127. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
  128. package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
  129. package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
  130. package/dist/cli/{auth-KVSBJZOX.mjs → auth-I3QAU4RV.mjs} +8 -7
  131. package/dist/cli/auth-MQCN7WGZ.js +44 -0
  132. package/dist/cli/{billing-54RHFEBI.mjs → billing-3IC54OQQ.mjs} +197 -61
  133. package/dist/cli/{billing-FQREA7UA.js → billing-YGFFVAIC.js} +297 -161
  134. package/dist/cli/{chunk-4MK42735.js → chunk-2B5B5KAW.js} +210 -128
  135. package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
  136. package/dist/cli/{chunk-4NQF6KJ3.js → chunk-3NTP2OSG.js} +13 -13
  137. package/dist/cli/{chunk-HYC4MKGK.mjs → chunk-45OAVGU6.mjs} +5 -5
  138. package/dist/cli/{chunk-WLN3SUIA.js → chunk-4747TPLV.js} +3 -3
  139. package/dist/cli/{chunk-AZQ264ID.mjs → chunk-4BFTDNHU.mjs} +1 -1
  140. package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
  141. package/dist/cli/{chunk-DJ2JDK4O.mjs → chunk-4SMCFQ23.mjs} +1 -1
  142. package/dist/cli/{chunk-QPKH23EC.mjs → chunk-55F6HNOY.mjs} +5 -5
  143. package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
  144. package/dist/cli/{chunk-634ZDA3F.js → chunk-6NE3RRRY.js} +1 -1
  145. package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
  146. package/dist/cli/{chunk-EOPEYCY7.mjs → chunk-72V4PDH5.mjs} +18 -18
  147. package/dist/cli/{chunk-IHRKLXZN.js → chunk-74RES4DS.js} +5 -5
  148. package/dist/cli/{chunk-45PVGZST.js → chunk-7GEMELKI.js} +366 -320
  149. package/dist/cli/{chunk-4UUR4TCH.js → chunk-7O6J6A7P.js} +1871 -92
  150. package/dist/cli/{chunk-XVB7V4N7.js → chunk-7SERLBNR.js} +161 -53
  151. package/dist/cli/{chunk-F2LH7TGF.js → chunk-7YRJ5UC4.js} +21 -21
  152. package/dist/cli/{chunk-YJHE3O5M.mjs → chunk-A7DLBE5K.mjs} +136 -54
  153. package/dist/cli/{chunk-6PRW5UBA.mjs → chunk-AGICYWGN.mjs} +299 -69
  154. package/dist/cli/{chunk-S5S355UY.mjs → chunk-AGIQDA2T.mjs} +12 -12
  155. package/dist/cli/{chunk-RBEUVDZF.js → chunk-AGLR6QVN.js} +249 -107
  156. package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
  157. package/dist/cli/{chunk-RQZQVFCJ.js → chunk-BVDKFS2T.js} +2 -2
  158. package/dist/cli/{chunk-PFO3ISXA.js → chunk-CACFJODG.js} +174 -129
  159. package/dist/cli/{chunk-6RZOWL2V.mjs → chunk-CAEBJOYU.mjs} +1 -1
  160. package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
  161. package/dist/cli/{chunk-6YCA5NKJ.js → chunk-DP2VH7CO.js} +12 -12
  162. package/dist/cli/{chunk-AWJPDPMA.mjs → chunk-DP64MD6U.mjs} +1 -1
  163. package/dist/cli/{chunk-PTVD2GVQ.mjs → chunk-DZA7RFGL.mjs} +5 -5
  164. package/dist/cli/{chunk-V436Z54K.js → chunk-E2G2DNAB.js} +3 -1
  165. package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
  166. package/dist/cli/{chunk-IDVVIXPJ.js → chunk-FM7LPUPA.js} +41 -41
  167. package/dist/cli/{chunk-AQWQ2BFX.mjs → chunk-GAVZ4EOD.mjs} +1 -1
  168. package/dist/cli/{chunk-GKYAYLRI.js → chunk-HEBO3XNZ.js} +27 -31
  169. package/dist/cli/{chunk-IYSTRCLX.mjs → chunk-HSJ6X2AQ.mjs} +4 -4
  170. package/dist/cli/{chunk-UPMRIVZB.js → chunk-HVI55MTK.js} +61 -10
  171. package/dist/cli/{chunk-KWSH5T7K.js → chunk-IH6GDNKW.js} +21 -21
  172. package/dist/cli/{chunk-HO3XK3R7.js → chunk-IMX7J4DU.js} +8 -8
  173. package/dist/cli/{chunk-EUPVF4SU.mjs → chunk-INEMTYMT.mjs} +8 -8
  174. package/dist/cli/{chunk-3FD5EQ62.js → chunk-IUOGII7D.js} +6 -7
  175. package/dist/cli/{chunk-U7QRMBIY.mjs → chunk-JJGWHITQ.mjs} +5 -5
  176. package/dist/cli/{chunk-SHLFOPD6.js → chunk-JLGP5XAJ.js} +5 -5
  177. package/dist/cli/{chunk-4TALT2M3.mjs → chunk-LFOERUQY.mjs} +69 -3
  178. package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
  179. package/dist/cli/{chunk-Z5TSLLOW.mjs → chunk-LH5PZKER.mjs} +63 -18
  180. package/dist/cli/{chunk-S46HWQKO.js → chunk-LRDHPOZW.js} +69 -69
  181. package/dist/cli/{chunk-6ZORHRKB.mjs → chunk-LRZGS6RZ.mjs} +2 -0
  182. package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
  183. package/dist/cli/{chunk-7IKQKKNX.js → chunk-MLABYI4M.js} +90 -24
  184. package/dist/cli/{chunk-ZIAXDBXX.mjs → chunk-NDNHYONK.mjs} +17 -21
  185. package/dist/cli/{chunk-YLTMXJFC.mjs → chunk-OTV2UUKW.mjs} +158 -16
  186. package/dist/cli/{chunk-G4O75EXF.js → chunk-Q6Z6N3A7.js} +18 -18
  187. package/dist/cli/{chunk-WE5HES3H.mjs → chunk-QG6JIWUL.mjs} +151 -43
  188. package/dist/cli/{chunk-QY3ZNU6Z.mjs → chunk-QI5S5HWB.mjs} +2 -2
  189. package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
  190. package/dist/cli/{chunk-57VZVF5D.mjs → chunk-RMNOZKRI.mjs} +3 -3
  191. package/dist/cli/{chunk-BAIST2BR.js → chunk-RTV4RF7N.js} +36 -36
  192. package/dist/cli/{chunk-JWUAX6OP.js → chunk-SBH4CKPN.js} +11 -11
  193. package/dist/cli/{chunk-FTJLJCE5.mjs → chunk-SG3LUONJ.mjs} +3 -3
  194. package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
  195. package/dist/cli/{chunk-QAORXEY3.mjs → chunk-TN4TY6TT.mjs} +6 -7
  196. package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
  197. package/dist/cli/{chunk-QILKGXYF.mjs → chunk-UVQJYV76.mjs} +2 -2
  198. package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
  199. package/dist/cli/{chunk-MF2GHZDO.js → chunk-WOCHZCUJ.js} +2 -2
  200. package/dist/cli/{chunk-VQALXEXO.js → chunk-XLIHTJVM.js} +348 -118
  201. package/dist/cli/{chunk-ADRC5I3R.js → chunk-Y6SP3JMI.js} +22 -22
  202. package/dist/cli/{chunk-77AAAGVB.js → chunk-YUA6HA6D.js} +2 -2
  203. package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
  204. package/dist/cli/{chunk-6O5HOODW.mjs → chunk-Z6XPSHKM.mjs} +87 -41
  205. package/dist/cli/{chunk-QX7LFGJR.mjs → chunk-Z7AOIHFE.mjs} +1870 -91
  206. package/dist/cli/command-docs.js +3 -3
  207. package/dist/cli/command-docs.mjs +2 -2
  208. package/dist/cli/concurrent-runs-help-CFJH4KXV.js +22 -0
  209. package/dist/cli/{concurrent-runs-help-Q4KPAUJX.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
  210. package/dist/cli/{csv-F5VAGX4K.js → csv-SA6ELJY6.js} +16 -15
  211. package/dist/cli/{csv-2PTVDNO6.mjs → csv-ZXZGHWOM.mjs} +7 -6
  212. package/dist/cli/{db-IEDXAUF7.mjs → db-A54SP6AD.mjs} +16 -16
  213. package/dist/cli/{db-Z3OIUFMM.js → db-JHFEIQBU.js} +43 -43
  214. package/dist/cli/describe-PHQ33AGS.mjs +50 -0
  215. package/dist/cli/describe-RHJ4XRFI.js +50 -0
  216. package/dist/cli/describe-core.d.mts +3 -3
  217. package/dist/cli/describe-core.d.ts +3 -3
  218. package/dist/cli/describe-core.js +6 -6
  219. package/dist/cli/describe-core.mjs +5 -5
  220. package/dist/cli/{executions-R3LP74QN.mjs → executions-HL2M2DFU.mjs} +10 -10
  221. package/dist/cli/{executions-H6H5655J.js → executions-TLFZRHBJ.js} +12 -12
  222. package/dist/cli/{feedback-VFOUR66B.js → feedback-5UEX5UZK.js} +17 -16
  223. package/dist/cli/{feedback-WL3MRVT5.mjs → feedback-QMBTNXVG.mjs} +9 -8
  224. package/dist/cli/git-4JWOOHBG.js +26 -0
  225. package/dist/cli/{git-YX2J4GCI.mjs → git-LKGXVIVC.mjs} +8 -7
  226. package/dist/cli/index.js +170 -158
  227. package/dist/cli/index.mjs +60 -48
  228. package/dist/cli/{integrations-E2JZYKHS.js → integrations-6RUTLMN7.js} +23 -27
  229. package/dist/cli/{integrations-5ZK5KLVP.mjs → integrations-FGGRVUJ7.mjs} +15 -19
  230. package/dist/cli/{legacy-noops-3VW4IJTH.js → legacy-noops-J3Z7QRWZ.js} +12 -11
  231. package/dist/cli/{legacy-noops-SMN3GSXY.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
  232. package/dist/cli/{mcp-UQV2K4EW.js → mcp-6LWFP7RW.js} +121 -48
  233. package/dist/cli/{mcp-V6MGCYAG.mjs → mcp-CHDYFO7F.mjs} +100 -27
  234. package/dist/cli/{monitors-R3BBDCRC.js → monitors-STM6A7OU.js} +221 -186
  235. package/dist/cli/{monitors-GGKS5W6M.mjs → monitors-UGRY2BXI.mjs} +58 -23
  236. package/dist/cli/org-3SYOUQCX.mjs +2289 -0
  237. package/dist/cli/org-ZOBSNSIB.js +2289 -0
  238. package/dist/cli/outcomes-H4YYAT5X.js +2865 -0
  239. package/dist/cli/outcomes-Z3P2JE67.mjs +2865 -0
  240. package/dist/cli/{play-2MVO27VO.js → play-SM4CW2GS.js} +1116 -846
  241. package/dist/cli/{play-MDWPR4XG.mjs → play-SN5YWLS7.mjs} +375 -105
  242. package/dist/cli/{providers-AKDYFZJZ.mjs → providers-WZ4YBR5Y.mjs} +10 -10
  243. package/dist/cli/{providers-2AACRUZH.js → providers-WZARYMCF.js} +13 -13
  244. package/dist/cli/{quickstart-QDGRJFZY.mjs → quickstart-2575BNKA.mjs} +7 -6
  245. package/dist/cli/{quickstart-H6IV3PV3.js → quickstart-PS4YHQJ6.js} +9 -8
  246. package/dist/cli/{run-2634REDK.js → run-FLZ6OTM7.js} +51 -51
  247. package/dist/cli/{run-RTSQNGRD.mjs → run-ZUHCZOJS.mjs} +31 -31
  248. package/dist/cli/run-identity-LMLFMACS.js +31 -0
  249. package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
  250. package/dist/cli/{search-6AOJ4XPP.mjs → search-HLPPKQEO.mjs} +11 -11
  251. package/dist/cli/search-JJWVHR3N.js +32 -0
  252. package/dist/cli/{search-output-6ADMTOU5.mjs → search-output-PDAXNOGP.mjs} +9 -8
  253. package/dist/cli/{search-output-S5ODBL5E.js → search-output-RXJLU36B.js} +12 -11
  254. package/dist/cli/{secrets-TFIFBFB3.mjs → secrets-CGELYQ3H.mjs} +11 -11
  255. package/dist/cli/{secrets-LHCIIHMT.js → secrets-QJNG7G2Y.js} +20 -20
  256. package/dist/cli/sessions-DHTBT2GN.js +23 -0
  257. package/dist/cli/{sessions-WHBVUHVW.mjs → sessions-ELMWVR4M.mjs} +9 -8
  258. package/dist/cli/{settings-CP4FVK2W.js → settings-44I44P5F.js} +89 -89
  259. package/dist/cli/{settings-EBONWL5C.mjs → settings-RR3LZXL7.mjs} +16 -16
  260. package/dist/cli/{setup-I5AZE3IU.mjs → setup-KGWRWH4B.mjs} +20 -19
  261. package/dist/cli/{setup-LFGHTNLQ.js → setup-KTEYOCJO.js} +60 -59
  262. package/dist/cli/skills-EPZPEXI2.js +37 -0
  263. package/dist/cli/{skills-W76AO5XE.mjs → skills-FPRID2I5.mjs} +10 -9
  264. package/dist/cli/tools-IGQQ5TML.js +57 -0
  265. package/dist/cli/{tools-7IJHGF6W.mjs → tools-PI4WMDLY.mjs} +23 -23
  266. package/dist/cli/update-4RNCVYGE.js +37 -0
  267. package/dist/cli/{update-GFOPZTHY.mjs → update-VJOJAZ7B.mjs} +14 -11
  268. package/dist/cli/{views-BPL2TQJ4.js → views-NTUOLNQU.js} +62 -64
  269. package/dist/cli/{views-D4NX4SBG.mjs → views-OVPSINZO.mjs} +47 -49
  270. package/dist/cli/{workflow-ZYNAUCKC.js → workflow-2UDYDM6F.js} +23 -23
  271. package/dist/cli/{workflow-YXP42FUI.mjs → workflow-7OEFNXZC.mjs} +13 -13
  272. package/dist/{client-CyXGrO4D.d.mts → client-B8f7RNF8.d.mts} +1 -1
  273. package/dist/{client-Bf3IpUKN.d.ts → client-C5TgXmJQ.d.ts} +1 -1
  274. package/dist/{client-core-BxsLnXlm.d.mts → client-core-SLLGBTht.d.mts} +268 -23
  275. package/dist/{client-core-BWd0lX0Z.d.ts → client-core-p0sOxnkl.d.ts} +268 -23
  276. package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
  277. package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
  278. package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
  279. package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
  280. package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
  281. package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
  282. package/dist/index.d.mts +7 -7
  283. package/dist/index.d.ts +7 -7
  284. package/dist/index.js +66 -55
  285. package/dist/index.mjs +25 -14
  286. package/dist/install-integrity.json +161 -142
  287. package/dist/plays/bundle-play-file.d.mts +3 -3
  288. package/dist/plays/bundle-play-file.d.ts +3 -3
  289. package/dist/plays/bundle-play-file.mjs +23 -4
  290. package/dist/plays/csv-data-input.js +3 -3
  291. package/dist/plays/csv-data-input.mjs +2 -2
  292. package/dist/plays/play-description.d.mts +2 -2
  293. package/dist/plays/play-description.d.ts +2 -2
  294. package/dist/plays/run-request.d.mts +2 -2
  295. package/dist/plays/run-request.d.ts +2 -2
  296. package/dist/plays/run-request.js +4 -4
  297. package/dist/plays/run-request.mjs +3 -3
  298. package/dist/release.d.mts +1 -1
  299. package/dist/release.d.ts +1 -1
  300. package/dist/release.js +2 -2
  301. package/dist/release.mjs +1 -1
  302. package/dist/server.d.mts +4 -4
  303. package/dist/server.d.ts +4 -4
  304. package/dist/server.js +15 -13
  305. package/dist/server.mjs +9 -7
  306. package/package.json +1 -1
  307. package/dist/cli/auth-MMNVWATX.js +0 -43
  308. package/dist/cli/concurrent-runs-help-FQAIHKKC.js +0 -21
  309. package/dist/cli/describe-QDANCTS3.mjs +0 -50
  310. package/dist/cli/describe-VUTT5ZKU.js +0 -50
  311. package/dist/cli/git-ETB3GH3K.js +0 -25
  312. package/dist/cli/org-GRYVMNSW.js +0 -1282
  313. package/dist/cli/org-Z37NGJV4.mjs +0 -1282
  314. package/dist/cli/run-identity-G257GQED.js +0 -25
  315. package/dist/cli/search-VTW2YNBS.js +0 -32
  316. package/dist/cli/sessions-CJ4FJ2WB.js +0 -22
  317. package/dist/cli/skills-R7EBXREW.js +0 -36
  318. package/dist/cli/tools-V7U2BDXM.js +0 -57
  319. package/dist/cli/update-4COPZETK.js +0 -34
@@ -45,3 +45,63 @@ export function readStartupReadToolIds(value: unknown): string[] | null {
45
45
  .slice(0, STARTUP_READ_TOOL_IDS_MAX);
46
46
  return ids.length > 0 ? ids : null;
47
47
  }
48
+
49
+ /**
50
+ * The per-tool routes' own answer, carried verbatim: the HTTP status and the
51
+ * exact body text the route returned.
52
+ */
53
+ export type RuntimeToolStartupReadAnswer = { status: number; body: string };
54
+
55
+ /**
56
+ * Body of `PLAY_RUNTIME_TOOL_STARTUP_READS_PATH`: for each requested tool id,
57
+ * what `GET runtime-tools/<id>` and `GET runtime-tools/<id>/auth-scope` would
58
+ * have returned to the same executor token.
59
+ */
60
+ export type RuntimeToolStartupReadsResponse = {
61
+ tools: Record<
62
+ string,
63
+ {
64
+ metadata: RuntimeToolStartupReadAnswer;
65
+ authScope: RuntimeToolStartupReadAnswer;
66
+ }
67
+ >;
68
+ };
69
+
70
+ /** Query parameter naming one tool; repeated once per tool. */
71
+ export const RUNTIME_TOOL_STARTUP_READS_TOOL_PARAM = 'toolId';
72
+
73
+ /**
74
+ * The route's reader for its `toolId` parameters: 1 to 16 distinct, trimmed,
75
+ * non-empty ids in request order, or null for anything else (the route then
76
+ * answers 400 and the runner falls back to the per-tool reads).
77
+ */
78
+ export function readRuntimeToolStartupReadsToolIds(
79
+ values: readonly string[],
80
+ ): string[] | null {
81
+ const ids = values.map((id) => id.trim());
82
+ if (ids.length === 0 || ids.length > STARTUP_READ_TOOL_IDS_MAX) return null;
83
+ if (ids.some((id) => !id)) return null;
84
+ if (new Set(ids).size !== ids.length) return null;
85
+ return ids;
86
+ }
87
+
88
+ /** One answer from a startup-reads body, or null when the body does not carry it. */
89
+ export function readRuntimeToolStartupReadAnswer(
90
+ body: unknown,
91
+ toolId: string,
92
+ kind: 'metadata' | 'authScope',
93
+ ): RuntimeToolStartupReadAnswer | null {
94
+ if (!body || typeof body !== 'object') return null;
95
+ const tools = (body as { tools?: unknown }).tools;
96
+ if (!tools || typeof tools !== 'object') return null;
97
+ if (!Object.hasOwn(tools, toolId)) return null;
98
+ const entry = (tools as Record<string, unknown>)[toolId];
99
+ if (!entry || typeof entry !== 'object' || !Object.hasOwn(entry, kind))
100
+ return null;
101
+ const answer = (entry as Record<string, unknown>)[kind];
102
+ if (!answer || typeof answer !== 'object') return null;
103
+ const { status, body: text } = answer as { status?: unknown; body?: unknown };
104
+ return typeof status === 'number' && typeof text === 'string'
105
+ ? { status, body: text }
106
+ : null;
107
+ }
@@ -1,6 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { getRuntimeEnv } from './runtime-env';
3
3
  import type { PlayRunnerEvent } from './protocol';
4
+ import { isIsolatedRuntimeSchedulerSchema } from './runtime-scheduler-topology';
4
5
  import {
5
6
  runtimeTestFaultDrills,
6
7
  type RuntimeTestFaultName,
@@ -557,3 +558,53 @@ export function parseRuntimeTestFaultCounts(input: {
557
558
  headerValue,
558
559
  };
559
560
  }
561
+
562
+ /**
563
+ * Preview fixture: a worker Machine whose LH listener status read answers 503,
564
+ * through the same path as a worker with no listener status. It gives a lane a
565
+ * mixed outcome set ({other_queue, http_503}) whose completion order varies,
566
+ * which the path warmer's change detector must treat as one outcome (#11436).
567
+ *
568
+ * Set per Machine by the lane operator (`flyctl machine update -e`), never by
569
+ * the release gate, so it reaches exactly one worker and is cleared the same
570
+ * way. Valid only on an isolated Preview scheduler schema with the Preview
571
+ * runtime marker; anywhere else, or with any other value, the worker refuses
572
+ * to boot rather than ignore it. Unset everywhere else: unchanged.
573
+ */
574
+ export const PREVIEW_WORKER_LISTENER_STATUS_FAULT_ENV =
575
+ 'DEEPLINE_PREVIEW_WORKER_LISTENER_STATUS_FAULT';
576
+
577
+ export type PreviewWorkerListenerStatusFault = 'http_503';
578
+
579
+ export function resolvePreviewWorkerListenerStatusFault(
580
+ env: Readonly<Record<string, string | undefined>>,
581
+ schedulerSchema: string | null | undefined,
582
+ ): PreviewWorkerListenerStatusFault | null {
583
+ const raw = env[PREVIEW_WORKER_LISTENER_STATUS_FAULT_ENV]?.trim();
584
+ if (!raw) return null;
585
+ if (raw !== 'http_503') {
586
+ throw new Error(
587
+ `${PREVIEW_WORKER_LISTENER_STATUS_FAULT_ENV} must be http_503 or unset; got "${raw}".`,
588
+ );
589
+ }
590
+ if (
591
+ env.DEEPLINE_RUNTIME_ENVIRONMENT !== 'preview' ||
592
+ !isIsolatedRuntimeSchedulerSchema(schedulerSchema)
593
+ ) {
594
+ throw new Error(
595
+ `${PREVIEW_WORKER_LISTENER_STATUS_FAULT_ENV} is valid only on an isolated Preview scheduler schema with DEEPLINE_RUNTIME_ENVIRONMENT=preview.`,
596
+ );
597
+ }
598
+ return 'http_503';
599
+ }
600
+
601
+ /**
602
+ * The line a faulted worker appends to its `/healthz` body, for an operator's
603
+ * manual readback of the fixture; empty (body unchanged) when absent. Fly
604
+ * checks read only the status code, which the fixture never changes.
605
+ */
606
+ export function previewWorkerListenerStatusFaultHealthLine(
607
+ fault: PreviewWorkerListenerStatusFault | null,
608
+ ): string {
609
+ return fault ? `preview-listener-status-fault=${fault}\n` : '';
610
+ }
@@ -28,6 +28,8 @@ export const TOOL_CALL_RETRY_REASONS = [
28
28
  'gateway_invocation_in_progress',
29
29
  'customer_db_storage_unavailable',
30
30
  'billing_unavailable_before_dispatch',
31
+ 'runtime_jwks_unavailable',
32
+ 'account_access_unavailable',
31
33
  'retry_safe_transient_5xx',
32
34
  'edge_gateway_transient',
33
35
  'unsafe_transient_5xx',
@@ -1,5 +1,8 @@
1
1
  import { DURABLE_RUNS_ROLLOUT } from './durable-runs-rollout';
2
- import { RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS } from './runtime-constants';
2
+ import {
3
+ ACCOUNT_ACCESS_UNAVAILABLE_CODE,
4
+ RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS,
5
+ } from './runtime-constants';
3
6
  import {
4
7
  isHardBillingToolHttpError,
5
8
  isHtmlErrorBody,
@@ -102,6 +105,21 @@ export const TOOL_EXECUTE_FENCED_PRE_DISPATCH_RATE_REFUSAL_MAX_ATTEMPTS =
102
105
  // 2026-11-14, every one sent once and failed), so a short bounded wait
103
106
  // recovers them: 1 s, 2 s, 4 s, 5 s between five sends.
104
107
  export const TOOL_EXECUTE_BILLING_UNAVAILABLE_MAX_ATTEMPTS = 5;
108
+ // The runtime gateway could not fetch the key set that verifies executor or
109
+ // rate-scope tokens, so it refused the request before any provider request: at
110
+ // authentication, or at a dispatch-permit re-check that releases the claimed
111
+ // invocation as not dispatched first. A ~7-second key-set blip
112
+ // on 2026-11-20 failed six runs that each sent the call once; five sends with
113
+ // the same 1 s, 2 s, 4 s, 5 s waits cover it.
114
+ export const TOOL_EXECUTE_RUNTIME_JWKS_UNAVAILABLE_MAX_ATTEMPTS = 5;
115
+ export const TOOL_EXECUTE_RUNTIME_JWKS_UNAVAILABLE_CODE =
116
+ 'RUNTIME_JWKS_UNAVAILABLE';
117
+ // The app's pre-route account-access cutoff could not verify the executor (a
118
+ // dependency failed) and answered 503 with `x-deepline-error-code:
119
+ // ACCOUNT_ACCESS_UNAVAILABLE` before any route handler ran. A ~9-second blip on
120
+ // 2026-11-24 failed 13 runs whose calls were refused this way. Six sends with
121
+ // 1 s, 2 s, 4 s, 5 s, 5 s waits (about 17 s) cover it.
122
+ export const TOOL_EXECUTE_ACCOUNT_ACCESS_UNAVAILABLE_MAX_ATTEMPTS = 6;
105
123
  export const TOOL_EXECUTE_TRANSPORT_MAX_ATTEMPTS = 3;
106
124
  export const TOOL_EXECUTE_TRANSPORT_RETRY_DELAY_MS = 1_000;
107
125
  // A sandbox lost new connections for about 97 seconds on 2026-10-30, and each
@@ -297,6 +315,8 @@ export type ToolExecuteHttpRetryDecision = {
297
315
  | 'gateway_invocation_in_progress'
298
316
  | 'customer_db_storage_unavailable'
299
317
  | 'billing_unavailable_before_dispatch'
318
+ | 'runtime_jwks_unavailable'
319
+ | 'account_access_unavailable'
300
320
  | 'retry_safe_transient_5xx'
301
321
  | 'edge_gateway_transient'
302
322
  | 'unsafe_transient_5xx'
@@ -406,6 +426,8 @@ export type ToolExecuteHttpFailureAttemptTracker = {
406
426
  transientHttpRetrySafe?: boolean;
407
427
  executionFenced?: boolean;
408
428
  providerServerErrorReplay?: ProviderServerErrorReplay;
429
+ /** The response's `x-deepline-error-code`. */
430
+ errorCodeHeader?: string | null;
409
431
  }): number;
410
432
  };
411
433
 
@@ -485,6 +507,40 @@ function isCustomerDbStorageUnavailableResponse(input: {
485
507
  );
486
508
  }
487
509
 
510
+ /**
511
+ * The runtime gateway's own refusal when it could not fetch the signing key set
512
+ * (`runtimeJwksUnavailableResponse`). Every gateway path that answers this code
513
+ * does so before any provider request: at executor-token authentication, before
514
+ * any invocation state, or at a dispatch-permit re-check inside a claimed
515
+ * invocation, which it first releases as not dispatched. So no provider request
516
+ * exists for this delivery. The app never emits the code.
517
+ */
518
+ function isRuntimeJwksUnavailableResponse(input: {
519
+ status: number;
520
+ bodyText: string;
521
+ }): boolean {
522
+ if (input.status !== 503) return false;
523
+ return (
524
+ parseJsonObject(input.bodyText)?.code ===
525
+ TOOL_EXECUTE_RUNTIME_JWKS_UNAVAILABLE_CODE
526
+ );
527
+ }
528
+
529
+ /**
530
+ * The app's account-access cutoff refused before any route handler ran. Only
531
+ * the cutoff's header qualifies: an execute handler can return the same body
532
+ * code after its own work, so the body proves nothing.
533
+ */
534
+ function isAccountAccessUnavailableExecuteResponse(input: {
535
+ status: number;
536
+ errorCodeHeader?: string | null;
537
+ }): boolean {
538
+ return (
539
+ input.status === 503 &&
540
+ input.errorCodeHeader === ACCOUNT_ACCESS_UNAVAILABLE_CODE
541
+ );
542
+ }
543
+
488
544
  /**
489
545
  * The app could not open this call's charge because the billing plane was
490
546
  * unavailable, and says so before any provider dispatch. Only the explicit
@@ -635,7 +691,8 @@ export function providerServerErrorRetryDelayMs(input: {
635
691
  * Backoff after the billing plane could not open a charge: 1 s, 2 s, 4 s, then
636
692
  * 5 s, each with ±20% jitter so rows refused together during a billing outage
637
693
  * do not resend together, or the app's Retry-After when it is longer, never
638
- * above 5 s.
694
+ * above 5 s. A gateway signing-key outage and an app account-access outage
695
+ * use the same waits.
639
696
  */
640
697
  export function billingUnavailableRetryDelayMs(input: {
641
698
  attempt: number;
@@ -755,6 +812,10 @@ function decideToolExecuteHttpRetry(input: {
755
812
  customerDbStorageUnavailable?: boolean;
756
813
  /** `isBillingUnavailableBeforeDispatchResponse`. */
757
814
  billingUnavailableBeforeDispatch?: boolean;
815
+ /** `isRuntimeJwksUnavailableResponse`. */
816
+ runtimeJwksUnavailable?: boolean;
817
+ /** `isAccountAccessUnavailableExecuteResponse`. */
818
+ accountAccessUnavailable?: boolean;
758
819
  concurrencyBackpressure?: boolean;
759
820
  runtimeSchedulerCapacity?: boolean;
760
821
  providerPacingWait?: boolean;
@@ -862,6 +923,28 @@ function decideToolExecuteHttpRetry(input: {
862
923
  reason: 'billing_unavailable_before_dispatch',
863
924
  };
864
925
  }
926
+ // The gateway refused before any provider request and holds no invocation
927
+ // for it (none opened, or released as not dispatched), so a resend of the
928
+ // same logical attempt, fenced or not, reaches the gateway as if for the
929
+ // first time.
930
+ if (input.runtimeJwksUnavailable) {
931
+ return {
932
+ retryable: true,
933
+ attemptCap: TOOL_EXECUTE_RUNTIME_JWKS_UNAVAILABLE_MAX_ATTEMPTS,
934
+ reason: 'runtime_jwks_unavailable',
935
+ };
936
+ }
937
+ // The app's cutoff refused before any route handler, so nothing reached a
938
+ // provider or the billing plane. Fenced or not: a fenced gateway releases
939
+ // its claim as not dispatched on this declared 503, so a resend of the same
940
+ // logical attempt reaches the gateway as if for the first time.
941
+ if (input.accountAccessUnavailable) {
942
+ return {
943
+ retryable: true,
944
+ attemptCap: TOOL_EXECUTE_ACCOUNT_ACCESS_UNAVAILABLE_MAX_ATTEMPTS,
945
+ reason: 'account_access_unavailable',
946
+ };
947
+ }
865
948
  if (input.status >= 500 && input.status < 600) {
866
949
  // A provider 5xx retries even when the response says it is not
867
950
  // retryable: an API built before the owner's retry-all-5xx rule refused
@@ -951,6 +1034,8 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
951
1034
  gateway_invocation_in_progress: 0,
952
1035
  customer_db_storage_unavailable: 0,
953
1036
  billing_unavailable_before_dispatch: 0,
1037
+ runtime_jwks_unavailable: 0,
1038
+ account_access_unavailable: 0,
954
1039
  retry_safe_transient_5xx: 0,
955
1040
  edge_gateway_transient: 0,
956
1041
  unsafe_transient_5xx: 0,
@@ -988,6 +1073,14 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
988
1073
  status: input.status,
989
1074
  bodyText: input.bodyText ?? '',
990
1075
  }),
1076
+ runtimeJwksUnavailable: isRuntimeJwksUnavailableResponse({
1077
+ status: input.status,
1078
+ bodyText: input.bodyText ?? '',
1079
+ }),
1080
+ accountAccessUnavailable: isAccountAccessUnavailableExecuteResponse({
1081
+ status: input.status,
1082
+ errorCodeHeader: input.errorCodeHeader,
1083
+ }),
991
1084
  concurrencyBackpressure: isConcurrencyBackpressureResponse({
992
1085
  status: input.status,
993
1086
  bodyText: input.bodyText ?? '',
@@ -1051,6 +1144,8 @@ export function classifyToolExecuteHttpFailure(input: {
1051
1144
  bodyText: string;
1052
1145
  schemaVersion?: ToolExecutionErrorSchemaVersion;
1053
1146
  retryAfterHeader?: string | null;
1147
+ /** The response's `x-deepline-error-code`; absent classifies from the body alone. */
1148
+ errorCodeHeader?: string | null;
1054
1149
  /** Captured at response-header arrival; absent keeps the legacy header path. */
1055
1150
  retryAtMs?: number;
1056
1151
  transientHttpRetrySafe?: boolean;
@@ -1080,6 +1175,9 @@ export function classifyToolExecuteHttpFailure(input: {
1080
1175
  isCustomerDbStorageUnavailableResponse(input);
1081
1176
  const billingUnavailableBeforeDispatch =
1082
1177
  isBillingUnavailableBeforeDispatchResponse(input);
1178
+ const runtimeJwksUnavailable = isRuntimeJwksUnavailableResponse(input);
1179
+ const accountAccessUnavailable =
1180
+ isAccountAccessUnavailableExecuteResponse(input);
1083
1181
  const concurrencyBackpressure = isConcurrencyBackpressureResponse(input);
1084
1182
  const runtimeSchedulerCapacity = isRuntimeSchedulerCapacityResponse(input);
1085
1183
  const providerPacingWait = isProviderPacingWaitResponse(input);
@@ -1100,6 +1198,8 @@ export function classifyToolExecuteHttpFailure(input: {
1100
1198
  gatewayInvocationInProgress,
1101
1199
  customerDbStorageUnavailable,
1102
1200
  billingUnavailableBeforeDispatch,
1201
+ runtimeJwksUnavailable,
1202
+ accountAccessUnavailable,
1103
1203
  concurrencyBackpressure,
1104
1204
  runtimeSchedulerCapacity,
1105
1205
  providerPacingWait,
@@ -1175,6 +1275,8 @@ export function classifyToolExecuteHttpFailure(input: {
1175
1275
  gatewayInvocationInProgress,
1176
1276
  customerDbStorageUnavailable,
1177
1277
  billingUnavailableBeforeDispatch,
1278
+ runtimeJwksUnavailable,
1279
+ accountAccessUnavailable,
1178
1280
  concurrencyBackpressure,
1179
1281
  runtimeSchedulerCapacity,
1180
1282
  providerPacingWait,
@@ -1244,7 +1346,9 @@ export function classifyToolExecuteHttpFailure(input: {
1244
1346
  TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
1245
1347
  ),
1246
1348
  )
1247
- : retryDecision.reason === 'billing_unavailable_before_dispatch'
1349
+ : retryDecision.reason === 'billing_unavailable_before_dispatch' ||
1350
+ retryDecision.reason === 'runtime_jwks_unavailable' ||
1351
+ retryDecision.reason === 'account_access_unavailable'
1248
1352
  ? billingUnavailableRetryDelayMs({
1249
1353
  attempt: input.attempt,
1250
1354
  retryAfterMs,
@@ -1330,6 +1434,10 @@ export function classifyToolExecuteHttpFailure(input: {
1330
1434
  retryDecision.reason !== 'provider_pacing_wait' &&
1331
1435
  // Billing refused before dispatch: a wait, not a failed provider call.
1332
1436
  retryDecision.reason !== 'billing_unavailable_before_dispatch' &&
1437
+ // The gateway refused at authentication: a wait, not a failed call.
1438
+ retryDecision.reason !== 'runtime_jwks_unavailable' &&
1439
+ // The app refused at its account-access cutoff: a wait, not a failed call.
1440
+ retryDecision.reason !== 'account_access_unavailable' &&
1333
1441
  // Bounded per call by its attempt cap, and each call already charges
1334
1442
  // the tool-call budget. The run-wide retry budget is a runaway guard
1335
1443
  // whose breach is run-fatal; a provider outage across a large map must
@@ -1355,6 +1463,8 @@ export function classifyToolExecuteHttpFailure(input: {
1355
1463
  // operation that does not declare ordinary transient retry safety.
1356
1464
  knownNotDispatched:
1357
1465
  retryDecision.reason === 'billing_unavailable_before_dispatch' ||
1466
+ retryDecision.reason === 'runtime_jwks_unavailable' ||
1467
+ retryDecision.reason === 'account_access_unavailable' ||
1358
1468
  runtimeSchedulerCapacity ||
1359
1469
  concurrencyBackpressure ||
1360
1470
  providerPacingWait ||
@@ -5,7 +5,7 @@ import {
5
5
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
6
6
  ToolExecutionError,
7
7
  deserializeToolExecutionFailure,
8
- isProviderTransientFailure,
8
+ structuredToolErrorName,
9
9
  normalizeToolExecutionCategory,
10
10
  normalizeToolExecutionOrigin,
11
11
  type ToolExecutionErrorSchemaVersion,
@@ -146,9 +146,7 @@ class StructuredToolHttpError extends ToolExecutionError {
146
146
  this.status = input.status;
147
147
  this.receiptFailureKind = input.receiptFailureKind;
148
148
  applyToolHttpErrorFields(this, input);
149
- this.name = isProviderTransientFailure(this)
150
- ? 'ProviderTransientError'
151
- : 'ToolExecutionError';
149
+ this.name = structuredToolErrorName(this);
152
150
  }
153
151
  }
154
152
 
@@ -369,7 +367,7 @@ function formatInsufficientCreditsMessage(input: {
369
367
  typeof minimum === 'number' &&
370
368
  input.billing.required_credits === minimum
371
369
  ) {
372
- return `Spendable workspace balance ${balance} credits is below the ${formatCreditAmount(minimum)}-credit workspace minimum for starting a billable call (${operation}); this is a workspace-wide minimum, separate from the tool's own price.${estimatedPrice} Spendable credits exclude pending spending and can be lower than the posted balance shown by billing balance.${addSuffix}`;
370
+ return `Spendable workspace balance ${balance} credits is below the ${formatCreditAmount(minimum)}-credit workspace minimum for starting a billable call (${operation}); this is a workspace-wide minimum, separate from the tool's own price.${estimatedPrice} Spendable credits exclude finalizing usage (usage incurred, final price pending) and can be lower than the posted balance shown by billing balance.${addSuffix}`;
373
371
  }
374
372
  // A required balance above the call's estimate is headroom, not a price.
375
373
  if (
@@ -377,9 +375,9 @@ function formatInsufficientCreditsMessage(input: {
377
375
  typeof input.billing.required_credits === 'number' &&
378
376
  input.billing.required_credits > estimate
379
377
  ) {
380
- return `Spendable workspace balance ${balance} credits is below the ${required}-credit balance required to start ${operation}; this is a required balance, not the price.${estimatedPrice} Spendable credits exclude pending spending and can be lower than the posted balance shown by billing balance.${addSuffix}`;
378
+ return `Spendable workspace balance ${balance} credits is below the ${required}-credit balance required to start ${operation}; this is a required balance, not the price.${estimatedPrice} Spendable credits exclude finalizing usage (usage incurred, final price pending) and can be lower than the posted balance shown by billing balance.${addSuffix}`;
381
379
  }
382
- return `Spendable workspace balance ${balance} credits < required ${required} for ${operation}. Spendable credits exclude pending spending and can be lower than the posted balance shown by billing balance.${addSuffix}`;
380
+ return `Spendable workspace balance ${balance} credits < required ${required} for ${operation}. Spendable credits exclude finalizing usage (usage incurred, final price pending) and can be lower than the posted balance shown by billing balance.${addSuffix}`;
383
381
  }
384
382
 
385
383
  /** An HTML document, as an edge proxy (Cloudflare, Vercel) serves for a 5xx. */
@@ -113,6 +113,8 @@ export const WORK_RECEIPT_TABLE_COLUMNS = [
113
113
  ['updated_at', 'timestamptz NOT NULL DEFAULT now()'],
114
114
  ] as const;
115
115
 
116
+ export const WORK_RECEIPT_KEY_INDEX = 'idx_deepline_step_receipts_k_unique';
117
+
116
118
  /** The non-idempotent-work lock shares the receipt deployment boundary. */
117
119
  export const WORK_RECEIPT_EXECUTION_LOCK_TABLE =
118
120
  '_deepline_receipt_execution_locks';
@@ -114,6 +114,8 @@ export async function mintWorkflowExecutorToken(input: {
114
114
  synthetic?: boolean | null;
115
115
  actorUserId?: string | null;
116
116
  actorEmail?: string | null;
117
+ /** The run's team; absent or null is the org's default team. */
118
+ teamId?: string | null;
117
119
  schedulerSchema?: string | null;
118
120
  runAttempt?: number | null;
119
121
  resumeEpoch?: number | null;
@@ -139,6 +141,7 @@ export async function mintWorkflowExecutorToken(input: {
139
141
  synthetic: input.synthetic,
140
142
  actorUserId: input.actorUserId,
141
143
  actorEmail: input.actorEmail,
144
+ teamId: input.teamId,
142
145
  schedulerSchema: input.schedulerSchema,
143
146
  runAttempt: input.runAttempt,
144
147
  resumeEpoch: input.resumeEpoch,
@@ -725,6 +725,8 @@ export type PlayTriggersSummary = {
725
725
  schedule: string;
726
726
  timezone?: string;
727
727
  input?: Record<string, unknown>;
728
+ /** Present only for the opt-in policy; absent means overlapping runs are allowed. */
729
+ overlap?: 'skip';
728
730
  };
729
731
  webhook?: true;
730
732
  };
@@ -763,6 +765,7 @@ export function derivePlayTriggersSummary(
763
765
  schedule: bindings.cron.schedule,
764
766
  ...(bindings.cron.timezone ? { timezone: bindings.cron.timezone } : {}),
765
767
  ...(bindings.cron.input ? { input: bindings.cron.input } : {}),
768
+ ...(bindings.cron.overlap === 'skip' ? { overlap: 'skip' as const } : {}),
766
769
  };
767
770
  }
768
771
  if (bindings.webhook) summary.webhook = true;
@@ -801,6 +804,8 @@ export type PlayAuthoringAstBindings = {
801
804
  timezone?: string;
802
805
  /** Static JSON object supplied to every run started by this cron binding. */
803
806
  input?: Record<string, unknown>;
807
+ /** Omitted means `allow`. */
808
+ overlap?: PlayCronOverlapPolicy;
804
809
  };
805
810
  sqlListeners?: PlayAuthoringAstSqlListenerDeclaration[];
806
811
  invalidSqlListenerSingular?: boolean;
@@ -826,7 +831,7 @@ export const PLAY_AUTHORING_BINDING_FIELDS = {
826
831
  'sqlListeners',
827
832
  'webhook',
828
833
  ],
829
- cron: ['schedule', 'timezone', 'input'],
834
+ cron: ['schedule', 'timezone', 'input', 'overlap'],
830
835
  webhook: ['auth', 'hmac'],
831
836
  sqlListener: [
832
837
  'id',
@@ -851,6 +856,10 @@ export const PLAY_AUTHORING_DEFINE_PLAY_OPTION_FIELDS = [
851
856
  ...PLAY_AUTHORING_BINDING_FIELDS.root,
852
857
  ] as const;
853
858
 
859
+ /** Cron overlap policies. Omitted means `allow`, the historical behavior. */
860
+ export const PLAY_CRON_OVERLAP_POLICIES = ['allow', 'skip'] as const;
861
+ export type PlayCronOverlapPolicy = (typeof PLAY_CRON_OVERLAP_POLICIES)[number];
862
+
854
863
  /**
855
864
  * Static cron input must be an object because the scheduler accepts a JSON
856
865
  * object. It is tied to the Play handler input so TypeScript rejects missing
@@ -912,6 +921,12 @@ export type PlayAuthoringBindings<TInput = Record<string, unknown>> = {
912
921
  timezone?: string;
913
922
  /** Static JSON object supplied to every run started by this cron binding. */
914
923
  input?: PlayAuthoringCronInput<TInput>;
924
+ /**
925
+ * What a cron occurrence does while an earlier cron run of this Play is
926
+ * still queued or running. `allow` (the default) starts another run;
927
+ * `skip` records the occurrence as skipped and starts nothing.
928
+ */
929
+ overlap?: PlayCronOverlapPolicy;
915
930
  };
916
931
  sqlListeners?: PlaySqlListenerDeclaration[];
917
932
  secrets?: readonly string[];
@@ -1597,8 +1612,8 @@ export type PlayAuthoringViewLink = {
1597
1612
  url: string;
1598
1613
  /** Opens the view at this run, for a link sent from the run itself. */
1599
1614
  runUrl: string;
1600
- /** Who can open the links: workspace members, or anyone. */
1601
- access: 'workspace' | 'public';
1615
+ /** Who can open the links: the view's team, every org member, or anyone. */
1616
+ access: 'workspace' | 'org' | 'public';
1602
1617
  };
1603
1618
 
1604
1619
  export interface PlayAuthoringRuntimeContext<
@@ -2145,6 +2160,26 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2145
2160
  errorMessage:
2146
2161
  'bindings.cron.input must be a static JSON object (no variables, spreads, or functions).',
2147
2162
  },
2163
+ 'bindings.cron.overlap': {
2164
+ schema: Type.Union(
2165
+ PLAY_CRON_OVERLAP_POLICIES.map((policy) => Type.Literal(policy)),
2166
+ ),
2167
+ fixtures: {
2168
+ valid: 'skip',
2169
+ invalid: 'queue',
2170
+ absent: undefined,
2171
+ unresolved: { expression: 'overlap' },
2172
+ edition1: undefined,
2173
+ },
2174
+ referenceType: "'allow' | 'skip'",
2175
+ required: false,
2176
+ resolution: 'static-required',
2177
+ issueCode: 'play_authoring_binding_invalid',
2178
+ description:
2179
+ 'What a cron occurrence does while an earlier cron run of this Play is still queued or running: "allow" (default) starts another run, "skip" records the occurrence as skipped.',
2180
+ errorMessage:
2181
+ 'bindings.cron.overlap must be the static string "allow" or "skip".',
2182
+ },
2148
2183
  'bindings.sqlListeners': {
2149
2184
  schema: Type.Array(Type.Object({}, { additionalProperties: true })),
2150
2185
  fixtures: {
@@ -3627,7 +3662,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3627
3662
  ` runtime?: { timeout?: ${cloudReferenceType('runtime.timeout')}; size?: ${cloudReferenceType('runtime.size')} };`,
3628
3663
  ` rateLimit?: { every: ${cloudReferenceType('rateLimit.every')} };`,
3629
3664
  ` webhook?: { hmac?: { algorithm?: ${cloudReferenceType('bindings.webhook.hmac.algorithm')}; header?: ${cloudReferenceType('bindings.webhook.hmac.header')}; signaturePrefix?: ${cloudReferenceType('bindings.webhook.hmac.signaturePrefix')}; secretEnv: ${cloudReferenceType('bindings.webhook.hmac.secretEnv')} }; auth?: { type: ${cloudReferenceType('bindings.webhook.auth.type')}; headerFamily: ${cloudReferenceType('bindings.webhook.auth.headerFamily')}; signingSecrets: readonly ${cloudReferenceType('bindings.webhook.auth.signingSecrets[]')}[]; toleranceSeconds?: ${cloudReferenceType('bindings.webhook.auth.toleranceSeconds')} } };`,
3630
- ` cron?: { schedule: ${cloudReferenceType('bindings.cron.schedule')}; timezone?: ${cloudReferenceType('bindings.cron.timezone')}; input?: PlayCronInput<TInput> };`,
3665
+ ` cron?: { schedule: ${cloudReferenceType('bindings.cron.schedule')}; timezone?: ${cloudReferenceType('bindings.cron.timezone')}; input?: PlayCronInput<TInput>; overlap?: ${cloudReferenceType('bindings.cron.overlap')} };`,
3631
3666
  ' sqlListeners?: readonly SqlListenerDeclaration[];',
3632
3667
  ` secrets?: readonly ${cloudReferenceType('bindings.secrets[]')}[];`,
3633
3668
  '};',
@@ -3688,7 +3723,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3688
3723
  "export type BillingEntitlements = { org_id: string; as_of: number; plan: { sku: string; name: string; catalog_revision: string | null; included_credits: number; interval: 'month' | 'year' | null } | null; benefits: { quickenrichUnlimited?: { status: 'active' | 'past_due'; value: BillingBenefitValues['quickenrichUnlimited']; expiresAt?: number }; peopleSearch?: { status: 'active'; value: BillingBenefitValues['peopleSearch']; expiresAt?: number; usage: { month: string; periodStartsAt?: number; resetsAt?: number; resetsOn?: 'calendar_month' | 'billing_cycle'; limit: number; consumed: number; remaining: number } }; includedStorage?: { status: 'active'; usage: { limit: number; consumed: number; remaining: number; measuredDay: string; overageCharged: boolean } } }; concurrent_runs?: { limit: number; source: 'override' | 'plan' | 'default'; plans: Array<{ sku: string; name: string; limit: number }> }; effective_limits: { quickenrichUnlimited?: { baseline: number; effective: number; source: 'plan' | 'override'; override_expires_at?: number } } };",
3689
3724
  'export interface DeeplinePlayRuntimeContext {',
3690
3725
  ' billing: { entitlements(): Promise<BillingEntitlements> };',
3691
- " views: { list(): Promise<Array<{ id: string; name: string; url: string; runUrl: string; access: 'workspace' | 'public' }>> };",
3726
+ " views: { list(): Promise<Array<{ id: string; name: string; url: string; runUrl: string; access: 'workspace' | 'org' | 'public' }>> };",
3692
3727
  ' csv<T = Record<string, unknown>>(path: string | CsvInput<T & object>, options?: CsvOptions): Promise<PlayDataset<T>>;',
3693
3728
  ' dataset<TSource extends PlayDatasetInput<object>>(key: string, items: TSource): DatasetBuilder<PlayDatasetRow<TSource> & object, PlayDatasetRow<TSource> & object>;',
3694
3729
  ' map<TSource extends PlayDatasetInput<object>>(key: string, items: TSource, options?: DatasetDefinitionOptions<PlayDatasetRow<TSource> & object>): never;',
@@ -290,6 +290,9 @@ export class DeployApiClient {
290
290
  path: '/api/v2/plays/artifacts',
291
291
  body: {
292
292
  artifacts: batch.map((entry) => ({ ...entry, publish: false })),
293
+ // Every revision a deployment registers is its own; the server
294
+ // never hands it another writer's revision or rewrites it in place.
295
+ deploymentId: this.config.deploymentId,
293
296
  },
294
297
  });
295
298
  results.push(...payload.artifacts);
@@ -31,10 +31,24 @@ export type GithubInstallationDoc = {
31
31
  updatedAt: number;
32
32
  };
33
33
 
34
+ /**
35
+ * Whether a project or deployment row is in the request's team
36
+ * (AuthContext.teamId). The default team is an absent `teamId` on the row and
37
+ * null (or absent) on the request; another team's row reads as not found.
38
+ */
39
+ export function isInRequestTeam(
40
+ row: { teamId?: string | null },
41
+ requestTeamId: string | null | undefined,
42
+ ): boolean {
43
+ return (row.teamId ?? null) === (requestTeamId ?? null);
44
+ }
45
+
34
46
  export type PlayProjectDoc = {
35
47
  _id: GenericId<'playProjects'>;
36
48
  _creationTime: number;
37
49
  orgId: string;
50
+ /** The team that connected the repository; absent is the default team. */
51
+ teamId?: string | null;
38
52
  gitHost: string;
39
53
  installationId: string;
40
54
  repoId: number;
@@ -54,6 +68,8 @@ export type PlayDeploymentDoc = {
54
68
  _id: GenericId<'playDeployments'>;
55
69
  _creationTime: number;
56
70
  orgId: string;
71
+ /** The project's team, or the starting request's for a directory deploy. */
72
+ teamId?: string | null;
57
73
  /** Absent for a deployment the workspace ran itself, with no linked repo. */
58
74
  playProjectId?: GenericId<'playProjects'>;
59
75
  commitSha?: string;
@@ -1110,30 +1110,19 @@ export async function runDeployment(
1110
1110
  (play.result.importedPlayDependencies ?? []).length > 0;
1111
1111
  const matches = (revision: DeploymentPlayState['liveRevision']) =>
1112
1112
  !importsOtherPlays && carriesArtifact(revision, artifact);
1113
- if (matches(playState?.liveRevision ?? null)) {
1114
- // A live-identical play still needs binding + provenance on its
1115
- // FIRST deploy from this project — otherwise it never carries
1116
- // playProjectId and later manual publishes escape the drift flag.
1117
- // Re-promoting the identical revision is idempotent and stamps both.
1118
- // Same when driftFromGit is set with matching hashes (a manual
1119
- // republish of the identical bundle): only the git-synced flip
1120
- // clears the flag, so skipping as unchanged would leave the play
1121
- // falsely marked drifted forever.
1122
- //
1123
- // A directory deploy binds nothing and never clears drift, so an
1124
- // identical bundle is simply unchanged: re-promoting it would churn
1125
- // revision history for no change in what is live.
1126
- if (
1113
+ // A play identical to what is live is unchanged, unless a production
1114
+ // deploy must bind it to this project or clear its drift flag (only a
1115
+ // git-synced flip clears it). A directory deploy binds nothing and never
1116
+ // clears drift. Anything this deployment promotes, it registers itself:
1117
+ // it never promotes a revision another writer registered.
1118
+ if (
1119
+ matches(playState?.liveRevision ?? null) &&
1120
+ !(
1127
1121
  deployment.isProduction &&
1128
1122
  project &&
1129
1123
  (playState?.playProjectId !== project.id || playState?.driftFromGit)
1130
- ) {
1131
- toPromote.push({
1132
- name: play.name,
1133
- revisionId: playState!.liveRevision!.revisionId,
1134
- });
1135
- continue;
1136
- }
1124
+ )
1125
+ ) {
1137
1126
  outcomes.push({
1138
1127
  name: play.name,
1139
1128
  file: play.file,
@@ -1143,26 +1132,6 @@ export async function runDeployment(
1143
1132
  });
1144
1133
  continue;
1145
1134
  }
1146
- if (matches(playState?.workingRevision ?? null)) {
1147
- // Registered before (an earlier attempt, another push of this PR, or
1148
- // a sibling PR); reuse the revision instead of writing a duplicate.
1149
- if (deployment.isProduction) {
1150
- toPromote.push({
1151
- name: play.name,
1152
- revisionId: playState!.workingRevision!.revisionId,
1153
- });
1154
- } else {
1155
- outcomes.push({
1156
- name: play.name,
1157
- file: play.file,
1158
- status: 'registered',
1159
- version: playState?.workingRevision?.version ?? undefined,
1160
- ...sdkUpdated(play.name),
1161
- ...(warning ? { warning } : {}),
1162
- });
1163
- }
1164
- continue;
1165
- }
1166
1135
  toRegister.push({
1167
1136
  play,
1168
1137
  entry: {