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
@@ -192,6 +192,23 @@ export const EXPERIMENT_SWITCHES = {
192
192
  },
193
193
  ],
194
194
  },
195
+ LH: {
196
+ perRun: true,
197
+ summary:
198
+ "With E2, the gateway sends the run's early-sandbox hint only to the worker currently listening for the run's release queue, bound to its leadership generation and one free slot; no claim gate (gateway and worker).",
199
+ constants: [
200
+ {
201
+ file: 'packages/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts',
202
+ name: 'EARLY_SANDBOX_LISTENER_HINT',
203
+ },
204
+ ],
205
+ },
206
+ EN: {
207
+ perRun: true,
208
+ summary:
209
+ "With E2 and no sidecar, the early sandbox carries a narrowed allowlist (each gateway IPv4 as /32, contained in the deployment's and stable 30 min); only a launch whose own fresh derivation gives the same list adopts it, and every fallback create keeps the deployment's allowlist (worker).",
210
+ constants: [{ file: MODAL, name: 'NARROW_EARLY_SANDBOX_EGRESS' }],
211
+ },
195
212
  V3: {
196
213
  perRun: true,
197
214
  summary:
@@ -203,6 +220,17 @@ export const EXPERIMENT_SWITCHES = {
203
220
  },
204
221
  ],
205
222
  },
223
+ PG: {
224
+ perRun: true,
225
+ summary:
226
+ 'Start every run before its run.created projection; run-scoped app reads authorize from the signed token and the Postgres admission (admission launch plan).',
227
+ constants: [
228
+ {
229
+ file: 'apps/deepline-api/src/lib/plays/launch/plan.ts',
230
+ name: 'START_RUNS_BEFORE_RUN_PROJECTION',
231
+ },
232
+ ],
233
+ },
206
234
  F3: {
207
235
  perRun: true,
208
236
  summary:
@@ -214,10 +242,43 @@ export const EXPERIMENT_SWITCHES = {
214
242
  },
215
243
  ],
216
244
  },
245
+ N1: {
246
+ perRun: true,
247
+ summary:
248
+ 'Inline baked launch: one Node process verifies the baked runner (verdict on the exec stdout, exit 98 on any non-ok verdict), materializes the payload and becomes the watchdog, instead of three Node starts in series (worker launch).',
249
+ constants: [
250
+ {
251
+ file: 'packages/play-runtime/runner-backends/backends/daytona-payload-transport.ts',
252
+ name: 'ONE_NODE_GUARDED_INLINE_LAUNCH',
253
+ },
254
+ ],
255
+ },
256
+ SO1: {
257
+ perRun: true,
258
+ summary:
259
+ "Serialize each dataset row once on the runner: cell-meta bytes are charged per changed cell, a terminal row's size is measured once for every tracker, and a map-row write body is built from the rows' prepared JSON (runner).",
260
+ constants: [
261
+ {
262
+ file: 'packages/play-runtime/context.ts',
263
+ name: 'SERIALIZE_DATASET_ROWS_ONCE',
264
+ },
265
+ ],
266
+ },
267
+ PA1: {
268
+ perRun: true,
269
+ summary:
270
+ 'Admit an in-memory dataset one execution page at a time on the streaming path, so the rows of the first page run while later pages are admitted (runner).',
271
+ constants: [
272
+ {
273
+ file: 'packages/play-runtime/context.ts',
274
+ name: 'PIPELINE_ARRAY_DATASET_ADMISSION',
275
+ },
276
+ ],
277
+ },
217
278
  RH: {
218
279
  perRun: false,
219
280
  summary:
220
- "Run status route holds a watch snapshot with waitForTerminalMs until the run is terminal, bounded. E3 and the SDK's RUN_WATCH_SERVER_WAIT_MS need it: without RH the SDK setting would poll with no delay.",
281
+ "Run status route holds a watch snapshot with waitForTerminalMs until the run is terminal, bounded. E3 needs it. The SDK asks for the hold (RUN_WATCH_SERVER_WAIT_MS) and keeps its own poll cadence unless the response carries `x-deepline-run-watch-hold: applied`. Also on, per organization, when the caller's `runtime-fast-launch` rollout grants it.",
221
282
  constants: [
222
283
  {
223
284
  file: 'apps/deepline-api/src/app/api/v2/runs/[runId]/route.ts',
@@ -225,11 +286,12 @@ export const EXPERIMENT_SWITCHES = {
225
286
  },
226
287
  ],
227
288
  reason:
228
- 'read route: GET /api/v2/runs/{runId} does not read the launch, so it has no run-carried override.',
289
+ "read route: GET /api/v2/runs/{runId} does not read the launch, so it has no run-carried override. It is org-gated instead: the authenticated caller organization's cached `runtime-fast-launch` rollout decision turns it on.",
229
290
  },
230
291
  E3: {
231
292
  perRun: false,
232
- summary: 'Run watch reads the Postgres terminal first.',
293
+ summary:
294
+ "Run watch reads the Postgres terminal first. Also on, per organization, inside an RH hold when the caller's `runtime-fast-launch` rollout grants it.",
233
295
  constants: [
234
296
  {
235
297
  file: 'apps/deepline-api/src/app/api/v2/runs/[runId]/route.ts',
@@ -237,7 +299,7 @@ export const EXPERIMENT_SWITCHES = {
237
299
  },
238
300
  ],
239
301
  reason:
240
- 'read route: GET /api/v2/runs/{runId} does not read the launch, so it has no run-carried override.',
302
+ "read route: GET /api/v2/runs/{runId} does not read the launch, so it has no run-carried override. It is org-gated instead: the authenticated caller organization's cached `runtime-fast-launch` rollout decision turns it on.",
241
303
  },
242
304
  CAR: {
243
305
  perRun: false,
@@ -277,40 +339,37 @@ export const EXPERIMENT_SWITCHES = {
277
339
  'module-load time: shapes the checker program an instance builds once.',
278
340
  },
279
341
  C3: {
280
- perRun: false,
281
- summary: 'Durable typecheck verdicts.',
342
+ perRun: true,
343
+ summary:
344
+ "Durable typecheck and source verdicts (admission): the run's source check reads and writes R2 verdicts keyed by checker fingerprint and full input (source verdicts per workspace). Responses are identical either way, but a timing A/B is confounded on a warm instance: an R2 hit seeds the process-wide typecheck result cache, and once an off run has built a program the typecheck skips R2. Measure C3 on cold instances.",
282
345
  constants: [
283
346
  {
284
347
  file: 'apps/deepline-api/src/lib/plays/typecheck-verdict-store.ts',
285
348
  name: 'DURABLE_TYPECHECK_VERDICTS',
286
349
  },
287
350
  ],
288
- reason:
289
- "shared cache: one run's verdict writes would warm the other arm, so a per-run A/B is confounded.",
290
351
  },
291
352
  C4: {
292
- perRun: false,
293
- summary: 'Launch credential check without the checker.',
353
+ perRun: true,
354
+ summary:
355
+ 'Launch credential check loaded without the checker (TS-free module; admission).',
294
356
  constants: [
295
357
  {
296
358
  file: 'apps/deepline-api/src/lib/plays/launch-credential-check.ts',
297
359
  name: 'LAUNCH_CREDENTIAL_CHECK_WITHOUT_CHECKER',
298
360
  },
299
361
  ],
300
- reason:
301
- 'module-load time: selects which credential-check module the instance loads and keeps.',
302
362
  },
303
363
  C5: {
304
- perRun: false,
305
- summary: 'Start the source-verdict read during route admission.',
364
+ perRun: true,
365
+ summary:
366
+ 'With C3, start the source-verdict read during route admission, after auth (run route). C5=1 without C3=1 is refused.',
306
367
  constants: [
307
368
  {
308
369
  file: 'apps/deepline-api/src/lib/plays/play-source-verdicts.ts',
309
370
  name: 'EARLY_SOURCE_VERDICT_READ',
310
371
  },
311
372
  ],
312
- reason:
313
- 'shared cache: reads the durable verdict cache that the other arm writes; also starts while auth runs, before the header is authorized.',
314
373
  },
315
374
  E4: {
316
375
  perRun: false,
@@ -334,6 +393,17 @@ export const EXPERIMENT_SWITCHES = {
334
393
  ],
335
394
  reason: 'billing: E4/F1 are uncertified, never per-run.',
336
395
  },
396
+ SR: {
397
+ perRun: true,
398
+ summary:
399
+ "The runner's park-fence startup reads (every declared tool's metadata and auth-scope) go out as one GET instead of two per tool.",
400
+ constants: [
401
+ {
402
+ file: 'packages/play-runtime/scheduler-backends/absurd-runtime-worker.ts',
403
+ name: 'STARTUP_READS_IN_ONE_REQUEST',
404
+ },
405
+ ],
406
+ },
337
407
  } as const satisfies Record<string, ExperimentSwitchDefinition>;
338
408
 
339
409
  /**
@@ -454,6 +524,12 @@ export function parseExperimentSwitchesHeader(
454
524
  }
455
525
  overrides[perRunId] = match[2] === '1';
456
526
  }
527
+ // C5 reads the durable store C3 provides; alone it would do nothing.
528
+ if (overrides.C5 === true && overrides.C3 !== true) {
529
+ throw new ExperimentSwitchesHeaderError(
530
+ 'Experiment switch "C5" needs "C3=1" in the same header (the early read uses the durable verdict store).',
531
+ );
532
+ }
457
533
  return overrides;
458
534
  }
459
535
 
@@ -720,6 +720,7 @@ export function isReplaySafeFixtureToolId(toolId: string): boolean {
720
720
  shouldRouteFixtureToolId(normalized) &&
721
721
  normalized !== 'ai_inference' &&
722
722
  normalized !== 'ai_evaluate' &&
723
+ normalized !== 'ai_decision' &&
723
724
  normalized !== 'deeplineagent' &&
724
725
  !normalized.startsWith('deeplineagent_')
725
726
  );
@@ -79,7 +79,13 @@ export interface ResolvedExecutionPolicy {
79
79
  readonly pacing: ExecutionPacingPolicy;
80
80
  }
81
81
 
82
- export const DEFAULT_MAX_CONCURRENT_EXTERNAL_CALLS = 64;
82
+ // A run that asks for no cap keeps at most this many provider calls in flight.
83
+ // At 64 a 100-row waterfall could not run all its rows at once: per-run arms
84
+ // on the load lane (round 44681005917, cap 64 against 100 run by run on one
85
+ // deployment) measured waterfall-100 -3.5 s (29.6 s from 33.1 s) and a
86
+ // 300-row billed batch -5.7 s at 100. Provider pacing and per-provider
87
+ // concurrency still bound each provider below this.
88
+ export const DEFAULT_MAX_CONCURRENT_EXTERNAL_CALLS = 100;
83
89
  // A 1,000-row Play may legitimately need 1,000 resident provider calls to
84
90
  // sustain a declared start rate while responses are slow. This is a validated
85
91
  // opt-in ceiling, not the default transport load: short runtime-to-app fetches
@@ -1,3 +1,4 @@
1
+ import { RUN_LEDGER_TERMINAL_BACKLOG_PREFIX_MAX_FACTS } from './/run-ledger-projection-contract';
1
2
  import { WORKFLOW_EXECUTOR_TOKEN_TTL_SECONDS } from './/runtime-constants';
2
3
  import {
3
4
  isExecutionOperationPolicy,
@@ -334,6 +335,11 @@ export type WorkflowRunExecutionTokenClaims =
334
335
  // launches have no human actor, and older tokens predate the claims.
335
336
  actor_user_id?: string;
336
337
  actor_email?: string;
338
+ /**
339
+ * The run's team inside the org. Absent is the org's default team, as on
340
+ * every token minted before teams; older verifiers ignore it.
341
+ */
342
+ team_id?: string;
337
343
  /** Durable scheduler topology attested by the launch-time app. */
338
344
  scheduler_schema?: string;
339
345
  /** Scheduler generation that owns durable writes for this execution leg. */
@@ -359,6 +365,13 @@ export type WorkflowRunExecutionTokenClaims =
359
365
  runtime_origin?: string;
360
366
  /** Immutable receiver advertising leased Run Ledger ingress-prefix support. */
361
367
  run_ledger_ingress_prefix_origin?: string;
368
+ /**
369
+ * Facts that receiver proves in one terminal backlog receipt. Minted only
370
+ * beside `run_ledger_ingress_prefix_origin`, which only the receiving app
371
+ * supplies for itself, so it states that same build's verifier. Typed as a
372
+ * number: a projector uses it only within its own bound.
373
+ */
374
+ run_ledger_terminal_backlog_prefix_facts?: number;
362
375
  };
363
376
 
364
377
  export type RuntimeRateScopeTokenClaims = {
@@ -662,6 +675,8 @@ function isValidWorkflowClaimsShape(
662
675
  typeof claims.actor_user_id === 'string') &&
663
676
  (claims.actor_email === undefined ||
664
677
  typeof claims.actor_email === 'string') &&
678
+ (claims.team_id === undefined ||
679
+ (typeof claims.team_id === 'string' && claims.team_id.trim() !== '')) &&
665
680
  (claims.scheduler_schema === undefined ||
666
681
  normalizeRuntimeSchedulerSchema(claims.scheduler_schema) !== null) &&
667
682
  (claims.run_attempt === undefined ||
@@ -681,6 +696,8 @@ function isValidWorkflowClaimsShape(
681
696
  isValidRuntimeOrigin(claims.runtime_origin)) &&
682
697
  (claims.run_ledger_ingress_prefix_origin === undefined ||
683
698
  isValidRuntimeOrigin(claims.run_ledger_ingress_prefix_origin)) &&
699
+ (claims.run_ledger_terminal_backlog_prefix_facts === undefined ||
700
+ typeof claims.run_ledger_terminal_backlog_prefix_facts === 'number') &&
684
701
  Array.isArray(claims.capabilities) &&
685
702
  claims.capabilities.length > 0 &&
686
703
  claims.capabilities.every(isRuntimeExecutionCapability) &&
@@ -755,6 +772,43 @@ export async function mintIngestionSubscriptionExecutionToken(input: {
755
772
  return `${signingInput}.${signature}`;
756
773
  }
757
774
 
775
+ /** Retained identity grammar for server-owned Monitor work outside a Play Run. */
776
+ export function providerMonitorExecutorIdentity(monitorKey: string) {
777
+ if (!monitorKey) throw new Error('Monitor service identity requires a key.');
778
+ const workflowId = `provider-monitor:${monitorKey}`;
779
+ const runId = `deploy:${monitorKey}`;
780
+ return { workflowId, runId, billingRunId: runId, playName: workflowId };
781
+ }
782
+
783
+ /** Classify only after signature/issuer/audience/expiry verification. Scope remains handler-owned. */
784
+ export function isProviderMonitorServiceExecution(
785
+ claims: WorkflowRunExecutionTokenClaims,
786
+ ): boolean {
787
+ const prefix = 'provider-monitor:';
788
+ if (!claims.workflow_id.startsWith(prefix)) return false;
789
+ const key = claims.workflow_id.slice(prefix.length);
790
+ if (!key) return false;
791
+ const identity = providerMonitorExecutorIdentity(key);
792
+ // Public v2 Play identities have workflow_id === run_id; legacy Plays use
793
+ // document IDs. Only the Monitor producer signs this complete distinct pair.
794
+ return (
795
+ claims.sub === 'workflow_executor' &&
796
+ claims.workflow_id === identity.workflowId &&
797
+ claims.run_id === identity.runId &&
798
+ claims.billing_run_id === identity.billingRunId &&
799
+ claims.play_name === identity.playName &&
800
+ claims.actor_user_id === undefined &&
801
+ claims.scheduler_schema === undefined &&
802
+ claims.run_attempt === undefined &&
803
+ claims.resume_epoch === undefined &&
804
+ claims.run_lease_token === undefined &&
805
+ claims.synthetic === undefined &&
806
+ claims.fixture_behavior === undefined &&
807
+ (claims.integration_mode === undefined ||
808
+ claims.integration_mode === 'live')
809
+ );
810
+ }
811
+
758
812
  export async function mintWorkflowRunExecutionToken(input: {
759
813
  operationPolicy?: ExecutionOperationPolicy;
760
814
  calendarBookingBinding?: CalendarBookingBinding;
@@ -770,6 +824,8 @@ export async function mintWorkflowRunExecutionToken(input: {
770
824
  synthetic?: boolean | null;
771
825
  actorUserId?: string | null;
772
826
  actorEmail?: string | null;
827
+ /** The run's team; absent or null is the org's default team. */
828
+ teamId?: string | null;
773
829
  schedulerSchema?: string | null;
774
830
  runAttempt?: number | null;
775
831
  resumeEpoch?: number | null;
@@ -790,6 +846,7 @@ export async function mintWorkflowRunExecutionToken(input: {
790
846
  }
791
847
  const actorUserId = input.actorUserId?.trim() || null;
792
848
  const actorEmail = input.actorEmail?.trim() || null;
849
+ const teamId = input.teamId?.trim() || null;
793
850
  const schedulerSchema = normalizeRuntimeSchedulerSchema(
794
851
  input.schedulerSchema,
795
852
  );
@@ -842,6 +899,7 @@ export async function mintWorkflowRunExecutionToken(input: {
842
899
  ...(input.synthetic ? { synthetic: true as const } : {}),
843
900
  ...(actorUserId ? { actor_user_id: actorUserId } : {}),
844
901
  ...(actorEmail ? { actor_email: actorEmail } : {}),
902
+ ...(teamId ? { team_id: teamId } : {}),
845
903
  ...(schedulerSchema ? { scheduler_schema: schedulerSchema } : {}),
846
904
  ...(typeof input.runAttempt === 'number' &&
847
905
  Number.isSafeInteger(input.runAttempt) &&
@@ -870,6 +928,10 @@ export async function mintWorkflowRunExecutionToken(input: {
870
928
  run_ledger_ingress_prefix_origin: new URL(
871
929
  input.runLedgerIngressPrefixOrigin,
872
930
  ).origin,
931
+ // The receiving app supplies its own origin above, so this states
932
+ // the facts its verifier proves (run-ledger-projection-contract).
933
+ run_ledger_terminal_backlog_prefix_facts:
934
+ RUN_LEDGER_TERMINAL_BACKLOG_PREFIX_MAX_FACTS,
873
935
  }
874
936
  : {}),
875
937
  sub: input.subject ?? 'workflow_executor',
@@ -2125,6 +2125,72 @@ export class RuntimeMapMemoryLimitError extends Error {
2125
2125
  */
2126
2126
  export const runtimeMapJsonByteLength = runtimeJsonByteLength;
2127
2127
 
2128
+ /** Each record's serialized key and per-property shares, by record key. */
2129
+ export type RuntimeMapRecordEntryBytesCache = Map<
2130
+ string,
2131
+ {
2132
+ keyBytes: number;
2133
+ properties: Map<string, { value: unknown; bytes: number }>;
2134
+ }
2135
+ >;
2136
+
2137
+ const recordEntryTextEncoder =
2138
+ typeof TextEncoder === 'undefined' ? null : new TextEncoder();
2139
+
2140
+ /** UTF-8 bytes of a string, counted as `runtimeJsonByteLength` counts them. */
2141
+ function utf8Bytes(value: string): number {
2142
+ if (typeof Buffer !== 'undefined') return Buffer.byteLength(value, 'utf8');
2143
+ return recordEntryTextEncoder?.encode(value).byteLength ?? value.length;
2144
+ }
2145
+
2146
+ /**
2147
+ * `runtimeMapJsonByteLength({ [key]: value })` for a plain record `value`,
2148
+ * reusing each property's serialized share while its value is the same object
2149
+ * (or primitive) as the last time this key was measured. Only properties whose
2150
+ * value changed are serialized, so a record merged one property at a time
2151
+ * (`{ ...previous, ...patch }`) costs its patch, not the whole record.
2152
+ *
2153
+ * `{"key":{p1,p2,...}}` is its framing, the key, the shares and the commas
2154
+ * between them; a property JSON cannot represent is dropped, as
2155
+ * `JSON.stringify` drops it.
2156
+ */
2157
+ export function runtimeMapJsonByteLengthOfRecordEntry(
2158
+ key: string,
2159
+ value: Record<string, unknown>,
2160
+ cache: RuntimeMapRecordEntryBytesCache,
2161
+ ): number {
2162
+ let entry = cache.get(key);
2163
+ if (!entry) {
2164
+ entry = { keyBytes: utf8Bytes(JSON.stringify(key)), properties: new Map() };
2165
+ cache.set(key, entry);
2166
+ }
2167
+ const properties = new Map<string, { value: unknown; bytes: number }>();
2168
+ let count = 0;
2169
+ let shares = 0;
2170
+ for (const name of Object.keys(value)) {
2171
+ const propertyValue = value[name];
2172
+ let share = entry.properties.get(name);
2173
+ if (!share || !Object.is(share.value, propertyValue)) {
2174
+ const valueJson = JSON.stringify(propertyValue);
2175
+ share = {
2176
+ value: propertyValue,
2177
+ bytes:
2178
+ valueJson === undefined
2179
+ ? -1
2180
+ : utf8Bytes(JSON.stringify(name)) + 1 + utf8Bytes(valueJson),
2181
+ };
2182
+ }
2183
+ properties.set(name, share);
2184
+ if (share.bytes >= 0) {
2185
+ count += 1;
2186
+ shares += share.bytes;
2187
+ }
2188
+ }
2189
+ entry.properties = properties;
2190
+ // `{` key `:` `{` shares joined by `,` `}` `}`
2191
+ return 2 + entry.keyBytes + 1 + 2 + shares + Math.max(0, count - 1);
2192
+ }
2193
+
2128
2194
  export function defaultRuntimeMapMemoryLimits(): RuntimeMapMemoryLimits {
2129
2195
  return {
2130
2196
  materializedBudgetBytes: NODE_RUNTIME_MAP_MEMORY_BUDGET_BYTES,
@@ -2192,7 +2258,12 @@ export type RuntimeMapTrackedRow = {
2192
2258
  };
2193
2259
 
2194
2260
  type RuntimeMapRowsTracker = {
2195
- track(row: unknown): RuntimeMapTrackedRow;
2261
+ /**
2262
+ * Charge one row. `serializedBytes`, when given, must be the row's
2263
+ * `runtimeMapJsonByteLength`, measured once by a caller that sizes the
2264
+ * same row for other trackers too.
2265
+ */
2266
+ track(row: unknown, serializedBytes?: number): RuntimeMapTrackedRow;
2196
2267
  /**
2197
2268
  * Stop charging a row `track` returned, once nothing retains it. The
2198
2269
  * largest row seen stays: it describes what was tracked, not what is held.
@@ -2305,8 +2376,8 @@ function createRuntimeMapRowsTracker(
2305
2376
  estimatedResidentBytes,
2306
2377
  });
2307
2378
  return {
2308
- track(row) {
2309
- const rowBytes = runtimeMapJsonByteLength(row);
2379
+ track(row, measuredBytes) {
2380
+ const rowBytes = measuredBytes ?? runtimeMapJsonByteLength(row);
2310
2381
  const residentBytes = residentBytesOf(row, rowBytes);
2311
2382
  rowCount += 1;
2312
2383
  serializedBytes += rowBytes;
@@ -60,12 +60,40 @@ export const RUNTIME_RECEIPT_CONTROL_BUFFER_MAX_ITEMS = 2_000;
60
60
  export const RUNNER_TERMINAL_PUSH_MAX_BODY_BYTES = 16 * 1024 * 1024;
61
61
  /**
62
62
  * Stable-intent sheet admission responses include row details, so input bytes
63
- * alone do not bound response size. Use a conservative row page size and
64
- * split further when the gateway reports that the decoded response is too
65
- * large. This is transport paging, not a customer input or output limit.
63
+ * alone do not bound response size. The first page of a paged admission holds
64
+ * this many rows, and so does every page once rows are seen to come back
65
+ * heavy (a rerun returning stored cells); a response that is still too large
66
+ * splits further. This is transport paging, not a customer input or output
67
+ * limit.
66
68
  */
67
69
  export const RUNTIME_SHEET_START_MAX_RESPONSE_ROWS = 64;
68
70
  export const RUNTIME_SHEET_START_TARGET_BODY_BYTES = 12 * 1024 * 1024;
71
+ /**
72
+ * After the first page, a paged admission sizes each page from the heaviest
73
+ * per-row response bytes its earlier pages returned: as many rows as fit this
74
+ * response target, between RUNTIME_SHEET_START_MAX_RESPONSE_ROWS and
75
+ * RUNTIME_SHEET_START_SIZED_PAGE_MAX_ROWS. A fresh row comes back as the row
76
+ * it was sent, so fresh datasets reach the maximum and a heavy rerun keeps the
77
+ * first page's size.
78
+ *
79
+ * Each page is one serial gateway round trip, and the dataset's rows wait for
80
+ * all of them before any row executes. At 64 rows a page, a 10,000-row
81
+ * dataset of three plain JavaScript columns spent 157 round trips and 9.9 s of
82
+ * its 32 s run on admission (load round 44228744140, stream js-10k), about
83
+ * 55 ms of gateway time each.
84
+ *
85
+ * The maximum bounds the one page that can find heavy rows after light ones
86
+ * (new rows ahead of rows a previous run filled): the shared gateway builds
87
+ * that whole response in memory before the runner refuses and splits it, so
88
+ * it costs up to this many stored rows, four times a first page. Production
89
+ * holds rows that heavy: 81 stable-intent admissions of 64 rows came back
90
+ * over the 16 MiB response budget from 6 to 9 November 2026, so at least
91
+ * 256 KiB a row. 256 rows of those is at least 64 MiB built on a 4 GB
92
+ * gateway; 1,024 would be at least 256 MiB. At 256 a page, the 10,000-row
93
+ * dataset above takes about 40 round trips instead of 157.
94
+ */
95
+ export const RUNTIME_SHEET_START_TARGET_RESPONSE_BYTES = 1024 * 1024;
96
+ export const RUNTIME_SHEET_START_SIZED_PAGE_MAX_ROWS = 256;
69
97
  /**
70
98
  * Receipt commands are measured before the runtime client adds its request
71
99
  * envelope. Keep a full 4 MiB below the gateway body ceiling so one legal
@@ -222,6 +222,8 @@ export async function sendPlayHttpRequest(input: {
222
222
  fetchImpl?: SafeFetchImplementation;
223
223
  log: (message: string) => void;
224
224
  reportAmbiguousWrite?: boolean;
225
+ /** Told when the request waits for a pacing permit and when it is sent. */
226
+ queueClock?: { enterQueue(): void; dispatched(): void; retried(): void };
225
227
  }): Promise<{ response: Response; bodyText: string }> {
226
228
  const { url, init } = input;
227
229
  const method = String(init.method ?? 'GET').toUpperCase();
@@ -285,6 +287,7 @@ export async function sendPlayHttpRequest(input: {
285
287
  fetchImpl: async (physicalUrl, physicalInit) => {
286
288
  await releasePhysicalPermit();
287
289
  const signal = attemptInit.signal;
290
+ input.queueClock?.enterQueue();
288
291
  permit = await runCtxFetchPhase({
289
292
  callerSignal: init.signal,
290
293
  controller: attemptController,
@@ -316,6 +319,7 @@ export async function sendPlayHttpRequest(input: {
316
319
  phase: 'headers',
317
320
  run: () => {
318
321
  dispatched = true;
322
+ input.queueClock?.dispatched();
319
323
  if (!['GET', 'HEAD', 'OPTIONS'].includes(method))
320
324
  writeDispatched = true;
321
325
  return (input.fetchImpl ?? globalThis.fetch)(
@@ -372,6 +376,7 @@ export async function sendPlayHttpRequest(input: {
372
376
  await releasePhysicalPermit();
373
377
  }
374
378
  if (transportRetry) {
379
+ input.queueClock?.retried();
375
380
  await sleepWithinCtxFetchDeadline({
376
381
  callerSignal: init.signal,
377
382
  deadline: fetchDeadline,
@@ -393,6 +398,7 @@ export async function sendPlayHttpRequest(input: {
393
398
  ? TOOL_EXECUTE_RATE_LIMIT_MAX_ATTEMPTS
394
399
  : TOOL_EXECUTE_BARE_RATE_LIMIT_MAX_ATTEMPTS;
395
400
  if (rateLimitAttempt >= attemptCap) break;
401
+ input.queueClock?.retried();
396
402
  const delayMs = Math.max(
397
403
  parseToolExecuteRetryAfterMs(retryAfter),
398
404
  Math.min(
@@ -339,6 +339,14 @@ export interface PlayRunnerContextConfig extends RetainedPipelineCarrier {
339
339
  * runner derives them from `staticPipeline` as before (skipped when absent).
340
340
  */
341
341
  startupReadToolIds?: string[] | null;
342
+ /**
343
+ * Switch SR: set by the worker when the run's park-fence startup
344
+ * prefetch should fetch every named tool's metadata and auth-scope in one GET
345
+ * (`PLAY_RUNTIME_TOOL_STARTUP_READS_PATH`). Absent: one GET per lookup, as
346
+ * before. Each lookup still reuses its own answer once, and falls back to
347
+ * its own GET.
348
+ */
349
+ startupReadBatch?: boolean;
342
350
  force?: boolean | null;
343
351
  forceToolRefresh?: boolean | null;
344
352
  /**
@@ -5,6 +5,25 @@ export type QueryResultDatasetRequest = {
5
5
  totalRows?: number;
6
6
  };
7
7
 
8
+ /**
9
+ * The stored-result handle a dataset descriptor reports, or null. Only a
10
+ * non-empty string of bounded length is passed on to later pages; its content
11
+ * belongs to the tool.
12
+ */
13
+ export function readQueryResultDatasetResultRef(
14
+ dataset: Record<string, unknown> | null | undefined,
15
+ ): string | null {
16
+ const raw = dataset?.result_ref;
17
+ if (typeof raw !== 'string') return null;
18
+ const resultRef = raw.trim();
19
+ return resultRef &&
20
+ resultRef.length <= QUERY_RESULT_DATASET_RESULT_REF_MAX_LENGTH
21
+ ? resultRef
22
+ : null;
23
+ }
24
+
25
+ export const QUERY_RESULT_DATASET_RESULT_REF_MAX_LENGTH = 256;
26
+
8
27
  export const QUERY_RESULT_DATASET_PAGE_SIZE = 1_000;
9
28
 
10
29
  function maskSqlForDatasetClassifier(sql: string): string {
@@ -988,6 +988,15 @@ export interface RuntimeResourceGovernor {
988
988
  stopSampling(): void;
989
989
  /** Smoothed event-loop lag from the sampler, or null before its first tick. */
990
990
  eventLoopLagEwmaMs(): number | null;
991
+ /**
992
+ * A reader of smoothed event-loop lag over only the samples taken after this
993
+ * call, starting from a quiet loop, or null until the sampler next ticks. A
994
+ * map judges its own load by it, so lag from work that ran before the map
995
+ * opened (runner boot, row preparation, admission pages) cannot narrow the
996
+ * map's rows. One late tick, such as the map's own launch wave, moves it a
997
+ * fifth of the way; lag that persists still reaches the map's hold.
998
+ */
999
+ eventLoopLagSinceNow(): () => number | null;
991
1000
  /** Retain a closed map's admission snapshot for the terminal summary. */
992
1001
  recordMapAdmission(
993
1002
  mapName: string,
@@ -1002,7 +1011,10 @@ type Ewma = {
1002
1011
  observe(value: number | null | undefined): void;
1003
1012
  };
1004
1013
 
1005
- function createEwma(alpha = 0.2): Ewma {
1014
+ /** The weight each new sample takes in a runtime EWMA. */
1015
+ const RUNTIME_EWMA_ALPHA = 0.2;
1016
+
1017
+ function createEwma(alpha = RUNTIME_EWMA_ALPHA): Ewma {
1006
1018
  let value: number | null = null;
1007
1019
  return {
1008
1020
  get value() {
@@ -1584,6 +1596,10 @@ export function createRuntimeResourceGovernor(input: {
1584
1596
 
1585
1597
  let eventLoopLagTimer: ReturnType<typeof setInterval> | null = null;
1586
1598
  let eventLoopLagTickedAt: number | null = null;
1599
+ // The lag EWMA started from zero instead of from its first sample, so the
1600
+ // samples after any point can be read apart from everything before it.
1601
+ let eventLoopLagFromZero = 0;
1602
+ let eventLoopLagSamples = 0;
1587
1603
  const startEventLoopLagSampler = (): void => {
1588
1604
  if (eventLoopLagTimer !== null) return;
1589
1605
  eventLoopLagTickedAt = Date.now();
@@ -1592,7 +1608,12 @@ export function createRuntimeResourceGovernor(input: {
1592
1608
  const dueAt =
1593
1609
  (eventLoopLagTickedAt ?? now) + EVENT_LOOP_LAG_SAMPLE_INTERVAL_MS;
1594
1610
  eventLoopLagTickedAt = now;
1595
- phases.eventLoopLag.observe(Math.max(0, now - dueAt));
1611
+ const lagMs = Math.max(0, now - dueAt);
1612
+ phases.eventLoopLag.observe(lagMs);
1613
+ eventLoopLagFromZero =
1614
+ eventLoopLagFromZero * (1 - RUNTIME_EWMA_ALPHA) +
1615
+ lagMs * RUNTIME_EWMA_ALPHA;
1616
+ eventLoopLagSamples += 1;
1596
1617
  }, EVENT_LOOP_LAG_SAMPLE_INTERVAL_MS);
1597
1618
  // Measurement must never hold a runner open past its work.
1598
1619
  const handle = eventLoopLagTimer as { unref?: () => void };
@@ -2091,6 +2112,22 @@ export function createRuntimeResourceGovernor(input: {
2091
2112
 
2092
2113
  stopSampling: stopEventLoopLagSampler,
2093
2114
  eventLoopLagEwmaMs: () => phases.eventLoopLag.snapshot().ewmaMs,
2115
+ eventLoopLagSinceNow: () => {
2116
+ const openedSamples = eventLoopLagSamples;
2117
+ const openedFromZero = eventLoopLagFromZero;
2118
+ return () => {
2119
+ const samples = eventLoopLagSamples - openedSamples;
2120
+ if (samples === 0) return null;
2121
+ // Every sample keeps (1 - alpha) of the value before it, so of the
2122
+ // value at opening (1 - alpha)^samples remains. Taking that out
2123
+ // leaves the EWMA of the newer samples alone, started from zero.
2124
+ return Math.max(
2125
+ 0,
2126
+ eventLoopLagFromZero -
2127
+ (1 - RUNTIME_EWMA_ALPHA) ** samples * openedFromZero,
2128
+ );
2129
+ };
2130
+ },
2094
2131
 
2095
2132
  recordMapAdmission(mapName, snapshot) {
2096
2133
  // The ledger is per-process, not per-map: the runner publishes it once
@@ -389,6 +389,8 @@ export type PlayRunFailureDetails = {
389
389
  origin?: ToolExecutionErrorOrigin;
390
390
  /** Original reason family when the failure came from a typed tool call. */
391
391
  category?: ToolExecutionErrorCategory;
392
+ /** Recognized diagnostic tool code; absent on historical generic failures. */
393
+ toolCode?: string;
392
394
  cause?: string;
393
395
  name?: string;
394
396
  stack?: string;
@@ -781,7 +783,13 @@ export function normalizePlayRunFailure(error: unknown): PlayRunFailureDetails {
781
783
  message: cause,
782
784
  retryable: error instanceof ToolExecutionError ? error.retryable : null,
783
785
  ...(error instanceof ToolExecutionError
784
- ? { origin: error.origin, category: error.category }
786
+ ? {
787
+ origin: error.origin,
788
+ category: error.category,
789
+ ...(error.code === 'INTEGRATION_OAUTH_REFRESH_FAILED_CLOSED'
790
+ ? { toolCode: error.code }
791
+ : {}),
792
+ }
785
793
  : {}),
786
794
  ...(diagnostics
787
795
  ? {