deepline 0.3.552 → 0.3.554

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 (323) 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-HJUNW7T2.mjs} +8 -7
  131. package/dist/cli/auth-SP6SKZJZ.js +44 -0
  132. package/dist/cli/{billing-FQREA7UA.js → billing-4TSA5HEC.js} +297 -161
  133. package/dist/cli/{billing-54RHFEBI.mjs → billing-SJYRJAQ2.mjs} +197 -61
  134. package/dist/cli/{chunk-4MK42735.js → chunk-2HMN5H54.js} +215 -130
  135. package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
  136. package/dist/cli/{chunk-EOPEYCY7.mjs → chunk-2ORPFQUA.mjs} +18 -18
  137. package/dist/cli/{chunk-RQZQVFCJ.js → chunk-2OVHNHCF.js} +2 -2
  138. package/dist/cli/{chunk-QX7LFGJR.mjs → chunk-33WRQSQ2.mjs} +1874 -91
  139. package/dist/cli/{chunk-UPMRIVZB.js → chunk-3IKGZ4CG.js} +74 -13
  140. package/dist/cli/{chunk-EUPVF4SU.mjs → chunk-3Z4VFCXO.mjs} +8 -8
  141. package/dist/cli/{chunk-GKYAYLRI.js → chunk-4DOFGIEJ.js} +27 -31
  142. package/dist/cli/{chunk-4TALT2M3.mjs → chunk-52Q5KETX.mjs} +69 -3
  143. package/dist/cli/{chunk-RBEUVDZF.js → chunk-5CYZHOKI.js} +249 -107
  144. package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
  145. package/dist/cli/{chunk-IYSTRCLX.mjs → chunk-62AUAWQV.mjs} +4 -4
  146. package/dist/cli/{chunk-ZIAXDBXX.mjs → chunk-62HWJXST.mjs} +17 -21
  147. package/dist/cli/{chunk-QY3ZNU6Z.mjs → chunk-6EXOAT6T.mjs} +2 -2
  148. package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
  149. package/dist/cli/{chunk-ADRC5I3R.js → chunk-7OWI736E.js} +30 -30
  150. package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
  151. package/dist/cli/{chunk-PTVD2GVQ.mjs → chunk-B6HO2XWH.mjs} +13 -13
  152. package/dist/cli/{chunk-YJHE3O5M.mjs → chunk-BOZAP2EM.mjs} +141 -56
  153. package/dist/cli/chunk-BVXIGOBZ.js +32 -0
  154. package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
  155. package/dist/cli/{chunk-WE5HES3H.mjs → chunk-D6Z6POKE.mjs} +151 -43
  156. package/dist/cli/{chunk-AZQ264ID.mjs → chunk-DSKSFFK2.mjs} +1 -1
  157. package/dist/cli/{chunk-SHLFOPD6.js → chunk-DUBXUAAO.js} +5 -5
  158. package/dist/cli/{chunk-V436Z54K.js → chunk-E2G2DNAB.js} +3 -1
  159. package/dist/cli/{chunk-HO3XK3R7.js → chunk-E74KGKFZ.js} +8 -8
  160. package/dist/cli/{chunk-77AAAGVB.js → chunk-ECHKAC7M.js} +2 -2
  161. package/dist/cli/{chunk-KWSH5T7K.js → chunk-EN5NHCCQ.js} +21 -21
  162. package/dist/cli/{chunk-6RZOWL2V.mjs → chunk-F7CMRKSK.mjs} +1 -1
  163. package/dist/cli/{chunk-JWUAX6OP.js → chunk-FBAFX43W.js} +11 -11
  164. package/dist/cli/{chunk-AQWQ2BFX.mjs → chunk-FXQ3JKE3.mjs} +1 -1
  165. package/dist/cli/{chunk-QPKH23EC.mjs → chunk-GA2M3G3Y.mjs} +5 -5
  166. package/dist/cli/{chunk-G4O75EXF.js → chunk-GHT2NDL7.js} +18 -18
  167. package/dist/cli/{chunk-MF2GHZDO.js → chunk-GRZENGNE.js} +2 -2
  168. package/dist/cli/{chunk-4UUR4TCH.js → chunk-IVZKMJUK.js} +1875 -92
  169. package/dist/cli/{chunk-FTJLJCE5.mjs → chunk-KVBQY4ST.mjs} +3 -3
  170. package/dist/cli/{chunk-S5S355UY.mjs → chunk-KZHBDMGF.mjs} +12 -12
  171. package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
  172. package/dist/cli/{chunk-6ZORHRKB.mjs → chunk-LRZGS6RZ.mjs} +2 -0
  173. package/dist/cli/{chunk-2WFPHBR4.js → chunk-LY5MMXFF.js} +47 -29
  174. package/dist/cli/{chunk-BAIST2BR.js → chunk-M7STM3MZ.js} +36 -36
  175. package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
  176. package/dist/cli/{chunk-45PVGZST.js → chunk-OPTV7D2V.js} +508 -361
  177. package/dist/cli/{chunk-PFO3ISXA.js → chunk-OVEYWO4H.js} +174 -129
  178. package/dist/cli/{chunk-BGBJV26E.mjs → chunk-PC2FTUCP.mjs} +4 -4
  179. package/dist/cli/{chunk-WLN3SUIA.js → chunk-PQQMPUCZ.js} +3 -3
  180. package/dist/cli/{chunk-HYC4MKGK.mjs → chunk-Q7ACILL2.mjs} +5 -5
  181. package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
  182. package/dist/cli/{chunk-57VZVF5D.mjs → chunk-RBBTCYQB.mjs} +3 -3
  183. package/dist/cli/{chunk-F2LH7TGF.js → chunk-RTHMGSZX.js} +21 -21
  184. package/dist/cli/{chunk-YLTMXJFC.mjs → chunk-S6W6SJ6E.mjs} +158 -16
  185. package/dist/cli/chunk-STXDSVQZ.mjs +32 -0
  186. package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-TGUQET3O.mjs} +67 -6
  187. package/dist/cli/{chunk-IHRKLXZN.js → chunk-TJ6HLN56.js} +5 -5
  188. package/dist/cli/{chunk-3FD5EQ62.js → chunk-TOO3YM5N.js} +6 -7
  189. package/dist/cli/{chunk-QILKGXYF.mjs → chunk-UBBYHB2B.mjs} +2 -2
  190. package/dist/cli/{chunk-6PRW5UBA.mjs → chunk-UC4BDZKI.mjs} +299 -69
  191. package/dist/cli/{chunk-634ZDA3F.js → chunk-UNNOZKRT.js} +1 -1
  192. package/dist/cli/{chunk-IDVVIXPJ.js → chunk-UOT7HPBH.js} +41 -41
  193. package/dist/cli/{chunk-6YCA5NKJ.js → chunk-UYCZFQYQ.js} +12 -12
  194. package/dist/cli/{chunk-7IKQKKNX.js → chunk-VIUUTEHY.js} +90 -24
  195. package/dist/cli/{chunk-Z5TSLLOW.mjs → chunk-VLO5NFH2.mjs} +63 -18
  196. package/dist/cli/{chunk-U7QRMBIY.mjs → chunk-VQ75KX7G.mjs} +5 -5
  197. package/dist/cli/{chunk-4NQF6KJ3.js → chunk-VV4XGZ24.js} +13 -13
  198. package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
  199. package/dist/cli/{chunk-S46HWQKO.js → chunk-W6CZDTIR.js} +69 -69
  200. package/dist/cli/{chunk-XVB7V4N7.js → chunk-WL7P32PI.js} +161 -53
  201. package/dist/cli/{chunk-DJ2JDK4O.mjs → chunk-XD3MFTHA.mjs} +1 -1
  202. package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-XFZX6FNM.mjs} +40 -22
  203. package/dist/cli/{chunk-AWJPDPMA.mjs → chunk-XU6QNM4D.mjs} +1 -1
  204. package/dist/cli/{chunk-QAORXEY3.mjs → chunk-YCOGPOUX.mjs} +6 -7
  205. package/dist/cli/{chunk-VQALXEXO.js → chunk-YQKCH4R7.js} +348 -118
  206. package/dist/cli/{chunk-6O5HOODW.mjs → chunk-YY55NYAH.mjs} +207 -60
  207. package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
  208. package/dist/cli/command-docs.js +3 -3
  209. package/dist/cli/command-docs.mjs +2 -2
  210. package/dist/cli/{concurrent-runs-help-Q4KPAUJX.mjs → concurrent-runs-help-O3Q5IPLF.mjs} +9 -8
  211. package/dist/cli/concurrent-runs-help-ZFRZWX5V.js +22 -0
  212. package/dist/cli/{csv-F5VAGX4K.js → csv-4ZQ2RATI.js} +16 -15
  213. package/dist/cli/{csv-2PTVDNO6.mjs → csv-Y3BFPEM6.mjs} +7 -6
  214. package/dist/cli/{db-IEDXAUF7.mjs → db-3JYY4JNN.mjs} +17 -17
  215. package/dist/cli/{db-Z3OIUFMM.js → db-VEIFS4M7.js} +45 -45
  216. package/dist/cli/describe-EVJ4MFVU.mjs +50 -0
  217. package/dist/cli/describe-FG625QPF.js +50 -0
  218. package/dist/cli/describe-core.d.mts +3 -3
  219. package/dist/cli/describe-core.d.ts +3 -3
  220. package/dist/cli/describe-core.js +7 -7
  221. package/dist/cli/describe-core.mjs +6 -6
  222. package/dist/cli/{executions-H6H5655J.js → executions-HPZXOOVX.js} +12 -12
  223. package/dist/cli/{executions-R3LP74QN.mjs → executions-PCXZKEHM.mjs} +10 -10
  224. package/dist/cli/{feedback-WL3MRVT5.mjs → feedback-Y6VKZNY6.mjs} +9 -8
  225. package/dist/cli/{feedback-VFOUR66B.js → feedback-ZKFHFVL6.js} +17 -16
  226. package/dist/cli/git-RUBMALLH.js +26 -0
  227. package/dist/cli/{git-YX2J4GCI.mjs → git-UMPR2QYC.mjs} +8 -7
  228. package/dist/cli/index.js +170 -158
  229. package/dist/cli/index.mjs +60 -48
  230. package/dist/cli/{integrations-E2JZYKHS.js → integrations-3GQCTRTF.js} +23 -27
  231. package/dist/cli/{integrations-5ZK5KLVP.mjs → integrations-V3TM6XAB.mjs} +15 -19
  232. package/dist/cli/{legacy-noops-SMN3GSXY.mjs → legacy-noops-JZBUD7ZE.mjs} +9 -8
  233. package/dist/cli/{legacy-noops-3VW4IJTH.js → legacy-noops-VYCO7NGW.js} +12 -11
  234. package/dist/cli/{mcp-UQV2K4EW.js → mcp-4OIWTCE6.js} +121 -48
  235. package/dist/cli/{mcp-V6MGCYAG.mjs → mcp-PH4KZ76P.mjs} +100 -27
  236. package/dist/cli/{monitors-R3BBDCRC.js → monitors-E2A6VPBY.js} +221 -186
  237. package/dist/cli/{monitors-GGKS5W6M.mjs → monitors-SSMGIDGX.mjs} +58 -23
  238. package/dist/cli/org-SFDKSK5D.mjs +2289 -0
  239. package/dist/cli/org-WUDZGWBT.js +2289 -0
  240. package/dist/cli/outcomes-QT7LQBPK.mjs +2865 -0
  241. package/dist/cli/outcomes-Y7SZTLSL.js +2865 -0
  242. package/dist/cli/{play-MDWPR4XG.mjs → play-EK7KSFPL.mjs} +376 -106
  243. package/dist/cli/{play-2MVO27VO.js → play-GDNHCRRR.js} +1150 -880
  244. package/dist/cli/{providers-AKDYFZJZ.mjs → providers-FVZLRXAU.mjs} +10 -10
  245. package/dist/cli/{providers-2AACRUZH.js → providers-ZKOSECLV.js} +13 -13
  246. package/dist/cli/{quickstart-H6IV3PV3.js → quickstart-KSDKIXYD.js} +9 -8
  247. package/dist/cli/{quickstart-QDGRJFZY.mjs → quickstart-UJZ6PIQV.mjs} +7 -6
  248. package/dist/cli/{run-RTSQNGRD.mjs → run-E7MZ7P35.mjs} +35 -33
  249. package/dist/cli/{run-2634REDK.js → run-PD2BBG6S.js} +55 -53
  250. package/dist/cli/run-identity-LMLFMACS.js +31 -0
  251. package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
  252. package/dist/cli/search-TKSPTPHA.js +32 -0
  253. package/dist/cli/{search-6AOJ4XPP.mjs → search-VTFUFTOY.mjs} +11 -11
  254. package/dist/cli/{search-output-S5ODBL5E.js → search-output-G2AGDCOY.js} +13 -12
  255. package/dist/cli/{search-output-6ADMTOU5.mjs → search-output-PFVXQCWA.mjs} +10 -9
  256. package/dist/cli/{secrets-TFIFBFB3.mjs → secrets-7CIMEMX7.mjs} +11 -11
  257. package/dist/cli/{secrets-LHCIIHMT.js → secrets-BCOQ4U7U.js} +20 -20
  258. package/dist/cli/sessions-4CO556VD.js +23 -0
  259. package/dist/cli/{sessions-WHBVUHVW.mjs → sessions-IUCQZEF7.mjs} +9 -8
  260. package/dist/cli/{settings-EBONWL5C.mjs → settings-KZN62UQK.mjs} +16 -16
  261. package/dist/cli/{settings-CP4FVK2W.js → settings-REL4736M.js} +89 -89
  262. package/dist/cli/{setup-I5AZE3IU.mjs → setup-2P7OG3OU.mjs} +22 -24
  263. package/dist/cli/{setup-LFGHTNLQ.js → setup-2XIVBBCS.js} +62 -64
  264. package/dist/cli/skills-JYT5DEY6.js +37 -0
  265. package/dist/cli/{skills-W76AO5XE.mjs → skills-VIGNDJKI.mjs} +10 -9
  266. package/dist/cli/tools-NTVUQ2TG.js +57 -0
  267. package/dist/cli/{tools-7IJHGF6W.mjs → tools-W3QT5EJY.mjs} +24 -24
  268. package/dist/cli/{update-GFOPZTHY.mjs → update-GZVBVMY3.mjs} +14 -11
  269. package/dist/cli/update-TWJZPUZM.js +37 -0
  270. package/dist/cli/{views-D4NX4SBG.mjs → views-BOGEH424.mjs} +47 -49
  271. package/dist/cli/{views-BPL2TQJ4.js → views-TOLJNLSV.js} +62 -64
  272. package/dist/cli/{workflow-ZYNAUCKC.js → workflow-ENWFRK5M.js} +23 -23
  273. package/dist/cli/{workflow-YXP42FUI.mjs → workflow-VDG2FDQV.mjs} +13 -13
  274. package/dist/{client-CyXGrO4D.d.mts → client-B8f7RNF8.d.mts} +1 -1
  275. package/dist/{client-Bf3IpUKN.d.ts → client-C5TgXmJQ.d.ts} +1 -1
  276. package/dist/{client-core-BxsLnXlm.d.mts → client-core-SLLGBTht.d.mts} +268 -23
  277. package/dist/{client-core-BWd0lX0Z.d.ts → client-core-p0sOxnkl.d.ts} +268 -23
  278. package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
  279. package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
  280. package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
  281. package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
  282. package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
  283. package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
  284. package/dist/index.d.mts +7 -7
  285. package/dist/index.d.ts +7 -7
  286. package/dist/index.js +66 -55
  287. package/dist/index.mjs +25 -14
  288. package/dist/install-integrity.json +163 -144
  289. package/dist/plays/bundle-play-file.d.mts +3 -3
  290. package/dist/plays/bundle-play-file.d.ts +3 -3
  291. package/dist/plays/bundle-play-file.mjs +23 -4
  292. package/dist/plays/csv-data-input.js +3 -3
  293. package/dist/plays/csv-data-input.mjs +2 -2
  294. package/dist/plays/play-description.d.mts +2 -2
  295. package/dist/plays/play-description.d.ts +2 -2
  296. package/dist/plays/run-request.d.mts +2 -2
  297. package/dist/plays/run-request.d.ts +2 -2
  298. package/dist/plays/run-request.js +4 -4
  299. package/dist/plays/run-request.mjs +3 -3
  300. package/dist/release.d.mts +1 -1
  301. package/dist/release.d.ts +1 -1
  302. package/dist/release.js +2 -2
  303. package/dist/release.mjs +1 -1
  304. package/dist/server.d.mts +4 -4
  305. package/dist/server.d.ts +4 -4
  306. package/dist/server.js +15 -13
  307. package/dist/server.mjs +9 -7
  308. package/package.json +1 -1
  309. package/dist/cli/auth-MMNVWATX.js +0 -43
  310. package/dist/cli/chunk-AID3OYVJ.js +0 -8
  311. package/dist/cli/chunk-OVDNJAJN.mjs +0 -8
  312. package/dist/cli/concurrent-runs-help-FQAIHKKC.js +0 -21
  313. package/dist/cli/describe-QDANCTS3.mjs +0 -50
  314. package/dist/cli/describe-VUTT5ZKU.js +0 -50
  315. package/dist/cli/git-ETB3GH3K.js +0 -25
  316. package/dist/cli/org-GRYVMNSW.js +0 -1282
  317. package/dist/cli/org-Z37NGJV4.mjs +0 -1282
  318. package/dist/cli/run-identity-G257GQED.js +0 -25
  319. package/dist/cli/search-VTW2YNBS.js +0 -32
  320. package/dist/cli/sessions-CJ4FJ2WB.js +0 -22
  321. package/dist/cli/skills-R7EBXREW.js +0 -36
  322. package/dist/cli/tools-V7U2BDXM.js +0 -57
  323. package/dist/cli/update-4COPZETK.js +0 -34
@@ -4,19 +4,20 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk7IKQKKNXjs = require('./chunk-7IKQKKNX.js');
7
+ var _chunkVIUUTEHYjs = require('./chunk-VIUUTEHY.js');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
- var _chunkRBEUVDZFjs = require('./chunk-RBEUVDZF.js');
14
13
 
14
+ var _chunk5CYZHOKIjs = require('./chunk-5CYZHOKI.js');
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkBBTKAASQjs = require('./chunk-BBTKAASQ.js');
19
+
20
+ var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
20
21
 
21
22
  // src/cli/json-fields.ts
22
23
  var RUN_FIELDS = new Set(
@@ -51,7 +52,7 @@ function parseJsonFields(args, surface) {
51
52
  if (parts.some(
52
53
  (part) => !/^[a-zA-Z_][a-zA-Z_0-9]*$/.test(part) || ["__proto__", "prototype", "constructor"].includes(part)
53
54
  ) || !allowed.has(parts[0])) {
54
- throw new (0, _chunkBBTKAASQjs.DeeplineError)(
55
+ throw new (0, _chunkLFQJW4S2js.DeeplineError)(
55
56
  `Unknown --json field '${path}'. Available roots: ${[...allowed].join(", ")}.`,
56
57
  void 0,
57
58
  "INVALID_ARGUMENT"
@@ -59,7 +60,7 @@ function parseJsonFields(args, surface) {
59
60
  }
60
61
  if (parts[0] === "run" && parts[1] && !RUN_FIELDS.has(parts[1])) {
61
62
  const hint = parts[1] === "url" ? " Use runUrl." : parts[1] === "stats" ? " Dataset summaries are in datasets; run timing is in run.durationMs." : "";
62
- throw new (0, _chunkBBTKAASQjs.DeeplineError)(
63
+ throw new (0, _chunkLFQJW4S2js.DeeplineError)(
63
64
  `Unknown --json run field '${parts[1]}'. Available: ${[...RUN_FIELDS].join(", ")}.${hint}`,
64
65
  void 0,
65
66
  "INVALID_ARGUMENT"
@@ -69,7 +70,7 @@ function parseJsonFields(args, surface) {
69
70
  const target = args[0] && !args[0].startsWith("-") ? args[0] : "<target>";
70
71
  const command = surface === "get" ? "runs get" : `plays ${surface}`;
71
72
  const quotedTarget = `'${target.replace(/'/g, "'\\''")}'`;
72
- throw new (0, _chunkBBTKAASQjs.DeeplineError)(
73
+ throw new (0, _chunkLFQJW4S2js.DeeplineError)(
73
74
  `--json diagnostics requires --full. For inspection, use: deepline ${surface === "run" ? "runs get <run-id>" : `${command} ${quotedTarget}`} --full`,
74
75
  void 0,
75
76
  "INVALID_ARGUMENT"
@@ -79,7 +80,7 @@ function parseJsonFields(args, surface) {
79
80
  fields = [..._nullishCoalesce(fields, () => ( [])), ...paths];
80
81
  }
81
82
  if (fields && normalized.includes("--input") && surface === "get") {
82
- throw new (0, _chunkBBTKAASQjs.DeeplineError)(
83
+ throw new (0, _chunkLFQJW4S2js.DeeplineError)(
83
84
  "--json fields selects the run response, not --input. Use bare --json with --input.",
84
85
  void 0,
85
86
  "INVALID_ARGUMENT"
@@ -146,8 +147,8 @@ function installJsonStderrGuard() {
146
147
  return stdoutWrite(...args);
147
148
  });
148
149
  const capture = (chunk) => {
149
- const text = (typeof chunk === "string" ? chunk : chunk instanceof Uint8Array ? Buffer.from(chunk).toString("utf8") : String(chunk)).replace(ANSI_PATTERN, "").trim();
150
- if (text) pending.push(text);
150
+ const text2 = (typeof chunk === "string" ? chunk : chunk instanceof Uint8Array ? Buffer.from(chunk).toString("utf8") : String(chunk)).replace(ANSI_PATTERN, "").trim();
151
+ if (text2) pending.push(text2);
151
152
  };
152
153
  process.stderr.write = ((chunk, ...rest) => {
153
154
  capture(chunk);
@@ -166,8 +167,8 @@ function installJsonStderrGuard() {
166
167
  function addJsonNotice(notice) {
167
168
  if (installed) pending.push(notice);
168
169
  }
169
- function writeRawStderr(text) {
170
- (_nullishCoalesce(rawStderrWrite, () => ( process.stderr.write.bind(process.stderr))))(text);
170
+ function writeRawStderr(text2) {
171
+ (_nullishCoalesce(rawStderrWrite, () => ( process.stderr.write.bind(process.stderr))))(text2);
171
172
  }
172
173
  function markJsonOutputHandled() {
173
174
  jsonOutputHandled = true;
@@ -185,11 +186,11 @@ function withJsonNotices(value) {
185
186
  if (pending.length === 0 || value === null || typeof value !== "object" || Array.isArray(value)) {
186
187
  return value;
187
188
  }
188
- const record = value;
189
- const existing = Array.isArray(record.notices) ? record.notices : [];
189
+ const record2 = value;
190
+ const existing = Array.isArray(record2.notices) ? record2.notices : [];
190
191
  const notices = [...existing, ...pending];
191
192
  pending = [];
192
- return { ...record, notices };
193
+ return { ...record2, notices };
193
194
  }
194
195
 
195
196
  // src/cli/failure-reporting.ts
@@ -217,12 +218,12 @@ function isFailureReportingDisabled() {
217
218
  }
218
219
  function redactFailureText(value, maxChars = MAX_FAILURE_TEXT_CHARS) {
219
220
  const home = _optionalChain([process, 'access', _2 => _2.env, 'access', _3 => _3.HOME, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5()]);
220
- let text = String(_nullishCoalesce(value, () => ( "")));
221
- if (!text) return "";
221
+ let text2 = String(_nullishCoalesce(value, () => ( "")));
222
+ if (!text2) return "";
222
223
  if (home && home !== "/") {
223
- text = text.split(home).join("~");
224
+ text2 = text2.split(home).join("~");
224
225
  }
225
- return text.replace(EMAIL_RE, "[redacted-email]").replace(UNIX_PATH_RE, "[redacted-path]").replace(WINDOWS_PATH_RE, "[redacted-path]").replace(BEARER_SECRET_RE, "$1 [redacted-secret]").replace(ASSIGNMENT_SECRET_RE, "$1$2[redacted-secret]").replace(GENERIC_TOKEN_RE, "[redacted-secret]").slice(0, maxChars);
226
+ return text2.replace(EMAIL_RE, "[redacted-email]").replace(UNIX_PATH_RE, "[redacted-path]").replace(WINDOWS_PATH_RE, "[redacted-path]").replace(BEARER_SECRET_RE, "$1 [redacted-secret]").replace(ASSIGNMENT_SECRET_RE, "$1$2[redacted-secret]").replace(GENERIC_TOKEN_RE, "[redacted-secret]").slice(0, maxChars);
226
227
  }
227
228
  function sanitizeCommand(argv, prefix = "deepline") {
228
229
  const tokens = [];
@@ -256,13 +257,13 @@ function classifyNetworkFailure(error) {
256
257
  let current = error;
257
258
  while (current && !seen.has(current)) {
258
259
  seen.add(current);
259
- const record = typeof current === "object" && current !== null ? current : {};
260
- const code = String(_nullishCoalesce(record.code, () => ( ""))).toLowerCase();
260
+ const record2 = typeof current === "object" && current !== null ? current : {};
261
+ const code = String(_nullishCoalesce(record2.code, () => ( ""))).toLowerCase();
261
262
  const name = current instanceof Error ? current.name.toLowerCase() : "";
262
- const text = String(
263
+ const text2 = String(
263
264
  current instanceof Error ? current.message : current
264
265
  ).toLowerCase();
265
- const combined = `${code} ${name} ${text}`;
266
+ const combined = `${code} ${name} ${text2}`;
266
267
  if (combined.includes("aborterror") || combined.includes("timeout") || combined.includes("timed out") || combined.includes("etimedout")) {
267
268
  return "network_timeout";
268
269
  }
@@ -285,12 +286,12 @@ function classifyNetworkFailure(error) {
285
286
  // Local filenames and retry commands may contain "ssl" or "tls".
286
287
  // Require a transport identifier or protocol failure text instead.
287
288
  code.includes("ssl") || code.includes("tls") || name.includes("ssl") || name.includes("tls") || /(?:^|[\s[(:])(?:ssl|tls)[\s:_-]+(?:error|handshake|certificate|routines|connection|failed|failure)(?:$|[\s:_-])/.test(
288
- text
289
+ text2
289
290
  ) || combined.includes("unexpected_eof_while_reading")
290
291
  ) {
291
292
  return "network_ssl_error";
292
293
  }
293
- current = _nullishCoalesce(record.cause, () => ( record.context));
294
+ current = _nullishCoalesce(record2.cause, () => ( record2.context));
294
295
  }
295
296
  return "network_error";
296
297
  }
@@ -299,9 +300,9 @@ function classifyNetworkCauseCategory(error) {
299
300
  let cause = error;
300
301
  while (cause && typeof cause === "object" && !seen.has(cause)) {
301
302
  seen.add(cause);
302
- const record = cause;
303
- if (record.code === "UND_ERR_CONNECT_TIMEOUT") return "connect_timeout";
304
- cause = record.cause;
303
+ const record2 = cause;
304
+ if (record2.code === "UND_ERR_CONNECT_TIMEOUT") return "connect_timeout";
305
+ cause = record2.cause;
305
306
  }
306
307
  switch (classifyNetworkFailure(error)) {
307
308
  case "network_dns_resolution_failed":
@@ -318,7 +319,7 @@ function classifyNetworkCauseCategory(error) {
318
319
  }
319
320
  function isNetworkFailure(error) {
320
321
  if (!(error instanceof Error)) return false;
321
- if (error instanceof _chunkBBTKAASQjs.DeeplineError && error.statusCode) return false;
322
+ if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.statusCode) return false;
322
323
  const code = classifyNetworkFailure(error);
323
324
  return code !== "network_error" || /unable to connect|unable to stream/i.test(error.message);
324
325
  }
@@ -330,7 +331,7 @@ function buildEnvironmentContext() {
330
331
  node_version: process.version,
331
332
  runtime: "Node.js",
332
333
  hostname: _os.hostname.call(void 0, ),
333
- agent_runtime: _chunkRBEUVDZFjs.detectAgentRuntime.call(void 0, )
334
+ agent_runtime: _chunk5CYZHOKIjs.detectAgentRuntime.call(void 0, )
334
335
  };
335
336
  for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
336
337
  const normalized = _optionalChain([process, 'access', _6 => _6.env, 'access', _7 => _7[key], 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]);
@@ -351,18 +352,18 @@ function buildEnvironmentContext() {
351
352
  return context;
352
353
  }
353
354
  function failureReportHeaders(apiKey) {
354
- const agentSessionId = _chunkRBEUVDZFjs.agentSessionIdFromEnvironment.call(void 0, );
355
+ const agentSessionId = _chunk5CYZHOKIjs.agentSessionIdFromEnvironment.call(void 0, );
355
356
  return {
356
- ..._chunkRBEUVDZFjs.deploymentProtectionHeaders.call(void 0, ),
357
+ ..._chunk5CYZHOKIjs.deploymentProtectionHeaders.call(void 0, ),
357
358
  ...agentSessionId ? { "X-Deepline-Agent-Session-Id": agentSessionId } : {},
358
359
  Authorization: `Bearer ${apiKey}`,
359
360
  "Content-Type": "application/json",
360
- "User-Agent": `deepline-ts-sdk/${_chunkRBEUVDZFjs.SDK_VERSION}`,
361
+ "User-Agent": `deepline-ts-sdk/${_chunk5CYZHOKIjs.SDK_VERSION}`,
361
362
  "X-Deepline-Client-Family": "sdk",
362
363
  "X-Deepline-CLI-Family": "sdk",
363
- "X-Deepline-Agent-Runtime": _chunkRBEUVDZFjs.detectAgentRuntime.call(void 0, ),
364
- "X-Deepline-CLI-Version": _chunkRBEUVDZFjs.SDK_VERSION,
365
- "X-Deepline-SDK-Version": _chunkRBEUVDZFjs.SDK_VERSION
364
+ "X-Deepline-Agent-Runtime": _chunk5CYZHOKIjs.detectAgentRuntime.call(void 0, ),
365
+ "X-Deepline-CLI-Version": _chunk5CYZHOKIjs.SDK_VERSION,
366
+ "X-Deepline-SDK-Version": _chunk5CYZHOKIjs.SDK_VERSION
366
367
  };
367
368
  }
368
369
  async function postFailureReport(input) {
@@ -390,7 +391,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
390
391
  if (isFailureReportingDisabled()) return false;
391
392
  let apiKey = "";
392
393
  try {
393
- apiKey = _chunk7IKQKKNXjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
394
+ apiKey = _chunkVIUUTEHYjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
394
395
  } catch (e2) {
395
396
  return false;
396
397
  }
@@ -417,7 +418,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
417
418
  failure_code: failureCode2,
418
419
  failure_stage: failureStage,
419
420
  error_body: "Automatic Deepline skills installation failed.",
420
- cli_version: _chunkRBEUVDZFjs.SDK_VERSION,
421
+ cli_version: _chunk5CYZHOKIjs.SDK_VERSION,
421
422
  context: {
422
423
  environment: buildEnvironmentContext(),
423
424
  skills_sync: {
@@ -448,7 +449,7 @@ function commandTokens(argv) {
448
449
  }
449
450
  function isServerLoggedPlayRunStartFailure(input) {
450
451
  const [subcommand, command] = commandTokens(input.argv);
451
- return subcommand === "plays" && command === "run" && input.error instanceof _chunkBBTKAASQjs.DeeplineError && typeof input.error.statusCode === "number";
452
+ return subcommand === "plays" && command === "run" && input.error instanceof _chunkLFQJW4S2js.DeeplineError && typeof input.error.statusCode === "number";
452
453
  }
453
454
  function shouldReport(input) {
454
455
  if (input.error !== void 0) return true;
@@ -458,7 +459,7 @@ function failureCode(input) {
458
459
  if (input.error !== void 0) {
459
460
  if (isNetworkFailure(input.error))
460
461
  return classifyNetworkFailure(input.error);
461
- if (input.error instanceof _chunkBBTKAASQjs.DeeplineError && input.error.code) {
462
+ if (input.error instanceof _chunkLFQJW4S2js.DeeplineError && input.error.code) {
462
463
  return input.error.code;
463
464
  }
464
465
  if (input.error instanceof Error && input.error.name)
@@ -481,7 +482,7 @@ function resolvedFailureKind(input) {
481
482
  return input.error === void 0 ? "command_exit" : "uncaught_exception";
482
483
  }
483
484
  function safeRequestDiagnostics(error) {
484
- if (!(error instanceof _chunkBBTKAASQjs.DeeplineError)) return null;
485
+ if (!(error instanceof _chunkLFQJW4S2js.DeeplineError)) return null;
485
486
  const request = _optionalChain([error, 'access', _28 => _28.details, 'optionalAccess', _29 => _29.request]);
486
487
  if (!request || typeof request !== "object" || Array.isArray(request))
487
488
  return null;
@@ -537,7 +538,7 @@ function buildFailureReport(input) {
537
538
  failure_kind: failureKind,
538
539
  failure_code: code,
539
540
  failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
540
- cli_version: _chunkRBEUVDZFjs.SDK_VERSION,
541
+ cli_version: _chunk5CYZHOKIjs.SDK_VERSION,
541
542
  context: {
542
543
  base_url: redactFailureText(input.baseUrl, 400),
543
544
  command_summary: sanitizeCommand(input.argv),
@@ -557,8 +558,8 @@ async function maybeReportSdkCliFailure(input) {
557
558
  if (isServerLoggedPlayRunStartFailure(input)) return false;
558
559
  const exitCode = resolvedExitCode(input);
559
560
  if (!shouldReport({ exitCode, error: input.error })) return false;
560
- const baseUrl = _chunk7IKQKKNXjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
561
- const apiKey = _chunk7IKQKKNXjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
561
+ const baseUrl = _chunkVIUUTEHYjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
562
+ const apiKey = _chunkVIUUTEHYjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
562
563
  if (!apiKey) return false;
563
564
  return postFailureReport({
564
565
  baseUrl,
@@ -659,14 +660,14 @@ function repairMisdecodedText(value) {
659
660
  });
660
661
  return changed ? repaired : value;
661
662
  }
662
- function repairRecordText(record) {
663
- for (const key of Object.keys(record)) {
664
- const value = record[key];
663
+ function repairRecordText(record2) {
664
+ for (const key of Object.keys(record2)) {
665
+ const value = record2[key];
665
666
  if (typeof value === "string") {
666
- record[key] = repairMisdecodedText(value);
667
+ record2[key] = repairMisdecodedText(value);
667
668
  }
668
669
  }
669
- return record;
670
+ return record2;
670
671
  }
671
672
  function csvInputTextOptions() {
672
673
  return {
@@ -678,12 +679,243 @@ function csvInputTextOptions() {
678
679
 
679
680
  // src/cli/utils.ts
680
681
  var _sync3 = require('csv-stringify/sync');
682
+
683
+ // src/cli/retry-guidance.ts
684
+ var OUT_OF_CREDITS_CODES = /* @__PURE__ */ new Set([
685
+ "INSUFFICIENT_CREDITS",
686
+ "INSUFFICIENT_FUNDS",
687
+ "FREE_ALLOWANCE_EXHAUSTED"
688
+ ]);
689
+ var SPENDING_CAP_CODES = /* @__PURE__ */ new Set([
690
+ "MONTHLY_BILLING_LIMIT_EXCEEDED",
691
+ "MONTHLY_CREDIT_CAP_EXCEEDED",
692
+ "RUN_BILLING_CAP_EXCEEDED",
693
+ "RUN_CREDIT_CAP_EXCEEDED",
694
+ "WORKFLOW_COST_CAP_EXCEEDED"
695
+ ]);
696
+ var RATE_LIMIT_CODES = /* @__PURE__ */ new Set(["RATE_LIMIT", "UPSTREAM_RATE_LIMIT"]);
697
+ var BAD_INPUT_CODES = /* @__PURE__ */ new Set([
698
+ "UPSTREAM_BAD_INPUT",
699
+ "UPSTREAM_VALIDATION_ERROR",
700
+ "VALIDATION_ERROR"
701
+ ]);
702
+ var CREDENTIAL_CODES = /* @__PURE__ */ new Set([
703
+ "PROVIDER_AUTHENTICATION_FAILED",
704
+ "PROVIDER_AUTHORIZATION_FAILED",
705
+ "INTEGRATION_CREDENTIALS_MISSING"
706
+ ]);
707
+ var TRANSIENT_CLIENT_ERROR_STATUSES = /* @__PURE__ */ new Set([408, 425, 429]);
708
+ var MAX_FIELDS = 8;
709
+ var MAX_HINT_CHARS = 400;
710
+ function record(value) {
711
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
712
+ }
713
+ function text(value) {
714
+ return typeof value === "string" && value.trim() ? value.trim() : null;
715
+ }
716
+ function formatRetryWait(ms) {
717
+ if (ms < 1e4) {
718
+ const tenths = Math.max(1, Math.ceil(ms / 100));
719
+ return `${tenths % 10 === 0 ? tenths / 10 : (tenths / 10).toFixed(1)}s`;
720
+ }
721
+ const seconds = Math.ceil(ms / 1e3);
722
+ if (seconds < 60) return `${seconds}s`;
723
+ const minutes = Math.floor(seconds / 60);
724
+ if (minutes < 60) {
725
+ const rest2 = seconds % 60;
726
+ return rest2 ? `${minutes}m ${rest2}s` : `${minutes}m`;
727
+ }
728
+ const hours = Math.floor(minutes / 60);
729
+ const rest = minutes % 60;
730
+ return rest ? `${hours}h ${rest}m` : `${hours}h`;
731
+ }
732
+ function envelopes(error, failureHint) {
733
+ const details = record(error.details);
734
+ const response = _nullishCoalesce(record(_optionalChain([record, 'call', _30 => _30(_optionalChain([details, 'optionalAccess', _31 => _31.details])), 'optionalAccess', _32 => _32.response])), () => ( record(_optionalChain([details, 'optionalAccess', _33 => _33.response]))));
735
+ const sources = [
736
+ failureHint,
737
+ response,
738
+ record(_optionalChain([response, 'optionalAccess', _34 => _34.error])),
739
+ record(_optionalChain([details, 'optionalAccess', _35 => _35.publicDetails])),
740
+ error
741
+ ];
742
+ return [...sources, ...sources.map((source) => record(_optionalChain([source, 'optionalAccess', _36 => _36.billing])))].filter(
743
+ (value) => value !== null
744
+ );
745
+ }
746
+ function firstText(sources, ...keys) {
747
+ for (const source of sources) {
748
+ for (const key of keys) {
749
+ const value = text(source[key]);
750
+ if (value) return value;
751
+ }
752
+ }
753
+ return null;
754
+ }
755
+ function namedFields(sources) {
756
+ const fields = [];
757
+ const add = (value) => {
758
+ const name = text(value);
759
+ if (name && !fields.includes(name) && fields.length < MAX_FIELDS) {
760
+ fields.push(name);
761
+ }
762
+ };
763
+ for (const source of sources) {
764
+ for (const field of Array.isArray(source.fields) ? source.fields : []) {
765
+ add(field);
766
+ }
767
+ const issues = Array.isArray(source.validation_issues) ? source.validation_issues : Array.isArray(source.issues) ? source.issues : [];
768
+ for (const issue of issues) {
769
+ const path = _optionalChain([record, 'call', _37 => _37(issue), 'optionalAccess', _38 => _38.path]);
770
+ const name = Array.isArray(path) ? path.map(String).join(".") : path;
771
+ if (name !== "(root)") add(name);
772
+ }
773
+ const mappings = Array.isArray(source.adapter_field_mappings) ? source.adapter_field_mappings : [];
774
+ for (const mapping of mappings) add(_optionalChain([record, 'call', _39 => _39(mapping), 'optionalAccess', _40 => _40.deepline_field]));
775
+ add(source.field);
776
+ }
777
+ return fields;
778
+ }
779
+ function clipHint(hint) {
780
+ if (!hint) return void 0;
781
+ const oneLine = hint.replace(/\s+/g, " ").trim();
782
+ return oneLine.length > MAX_HINT_CHARS ? `${oneLine.slice(0, MAX_HINT_CHARS - 1)}\u2026` : oneLine;
783
+ }
784
+ function cliRetryGuidance(error, failureHint = null) {
785
+ const value = record(error);
786
+ if (!value) return null;
787
+ const existing = record(value.retry);
788
+ if (existing && typeof existing.reason === "string") {
789
+ return existing;
790
+ }
791
+ const failure = _chunkLFQJW4S2js.normalizeToolExecutionFailure.call(void 0, value.tool_error);
792
+ const code = (_nullishCoalesce(_nullishCoalesce(text(value.code), () => ( _optionalChain([failure, 'optionalAccess', _41 => _41.code]))), () => ( ""))).toUpperCase();
793
+ const toolCode = (_nullishCoalesce(_optionalChain([failure, 'optionalAccess', _42 => _42.code]), () => ( ""))).toUpperCase();
794
+ const codes = new Set([code, toolCode].filter(Boolean));
795
+ const has = (set) => [...codes].some((entry) => set.has(entry));
796
+ const details = record(value.details);
797
+ const upstream = record(value.upstreamResponse);
798
+ const deeplineStatus = _nullishCoalesce(_optionalChain([failure, 'optionalAccess', _43 => _43.statusCode]), () => ( (typeof _optionalChain([details, 'optionalAccess', _44 => _44.statusCode]) === "number" ? details.statusCode : null)));
799
+ const status = _nullishCoalesce((typeof _optionalChain([upstream, 'optionalAccess', _45 => _45.status]) === "number" ? upstream.status : null), () => ( deeplineStatus));
800
+ const sources = envelopes(value, record(failureHint));
801
+ const hint = clipHint(firstText(sources, "operatorHint", "operator_hint"));
802
+ const fields = namedFields(sources);
803
+ const extras = hint ? { hint } : {};
804
+ const afterMs = _nullishCoalesce(_optionalChain([failure, 'optionalAccess', _46 => _46.retryAfterMs]), () => ( (typeof _optionalChain([details, 'optionalAccess', _47 => _47.retryAfterMs]) === "number" ? details.retryAfterMs : null)));
805
+ if (has(OUT_OF_CREDITS_CODES)) {
806
+ const billingUrl = firstText(sources, "billing_url", "billingUrl");
807
+ return {
808
+ canSucceed: false,
809
+ afterMs: null,
810
+ reason: "out_of_credits",
811
+ next: `The workspace is out of Deepline credits, so every paid call fails until credits are added. Stop and tell the user; they can add credits ${billingUrl ? `at ${billingUrl}` : "in the Billing page"} or with \`deepline billing top-up <credits>\`.`,
812
+ ...extras
813
+ };
814
+ }
815
+ if (has(SPENDING_CAP_CODES)) {
816
+ return {
817
+ canSucceed: false,
818
+ afterMs: null,
819
+ reason: "spending_cap",
820
+ next: "A Deepline spending cap blocks this call, so it fails until the cap is raised. Stop and tell the user; the error names the cap and the command that changes it.",
821
+ ...extras
822
+ };
823
+ }
824
+ if (codes.has("PROVIDER_ACCOUNT_CAPACITY")) {
825
+ return {
826
+ canSucceed: false,
827
+ afterMs: null,
828
+ reason: "provider_capacity",
829
+ next: "The provider account behind this tool is out of capacity, so the same call fails until it is restored. Use another provider's tool for this step.",
830
+ ...extras
831
+ };
832
+ }
833
+ const rateLimited = {
834
+ canSucceed: true,
835
+ afterMs,
836
+ reason: "rate_limited",
837
+ next: `Rate limited: wait${afterMs === null ? " a few seconds" : ""} before sending this call again, and run fewer calls at once. Sending it sooner fails the same way.`,
838
+ ...extras
839
+ };
840
+ if (has(RATE_LIMIT_CODES) || _optionalChain([failure, 'optionalAccess', _48 => _48.category]) === "rate_limit") {
841
+ return rateLimited;
842
+ }
843
+ if (has(CREDENTIAL_CODES) || _optionalChain([failure, 'optionalAccess', _49 => _49.category]) === "authentication" || _optionalChain([failure, 'optionalAccess', _50 => _50.category]) === "authorization") {
844
+ return {
845
+ canSucceed: false,
846
+ afterMs: null,
847
+ reason: "credentials",
848
+ next: codes.has("INTEGRATION_CREDENTIALS_MISSING") ? "This tool needs a provider connection that is not set up, so the same call fails until it is connected." : upstream ? "The provider refused the connected credential or its permissions. Check the connected key and its plan; the same call fails until that changes." : (
849
+ // Only a customer's connected key carries `upstreamResponse`; a
850
+ // refusal of Deepline's managed key is not the customer's to fix.
851
+ "The provider refused Deepline's credential for this tool, so the same call fails until Deepline restores it. Use another provider's tool for this step, or report the request id."
852
+ ),
853
+ ...extras
854
+ };
855
+ }
856
+ if (has(BAD_INPUT_CODES) || _optionalChain([failure, 'optionalAccess', _51 => _51.category]) === "validation") {
857
+ return {
858
+ canSucceed: false,
859
+ afterMs: null,
860
+ reason: "bad_input",
861
+ next: `The input was rejected, so the same call fails again. Fix ${fields.length ? fields.join(", ") : "the input"} first.`,
862
+ ...fields.length ? { fields } : {},
863
+ ...extras
864
+ };
865
+ }
866
+ if (codes.has("UPSTREAM_NOT_FOUND")) {
867
+ return {
868
+ canSucceed: false,
869
+ afterMs: null,
870
+ reason: "no_match",
871
+ next: "The provider has no record for this input. Treat it as no match (found: false), not a failure to retry; the same call returns the same answer.",
872
+ ...extras
873
+ };
874
+ }
875
+ if (deeplineStatus === 429) return rateLimited;
876
+ if (_optionalChain([failure, 'optionalAccess', _52 => _52.retryable])) {
877
+ return {
878
+ canSucceed: true,
879
+ afterMs,
880
+ reason: "temporary",
881
+ next: "Temporary failure: send the same call again. If it fails the same way twice, stop and report the request id.",
882
+ ...extras
883
+ };
884
+ }
885
+ if ((_optionalChain([failure, 'optionalAccess', _53 => _53.origin]) === "provider" || upstream) && typeof status === "number" && status >= 400 && status < 500 && !TRANSIENT_CLIENT_ERROR_STATUSES.has(status)) {
886
+ return {
887
+ canSucceed: false,
888
+ afterMs: null,
889
+ reason: "provider_rejected",
890
+ next: "The provider rejected this request, so the same call fails again. Change the input or use another provider.",
891
+ ...extras
892
+ };
893
+ }
894
+ if (!failure) return null;
895
+ return {
896
+ canSucceed: null,
897
+ afterMs: null,
898
+ reason: "not_retry_safe",
899
+ next: "Not marked safe to repeat, and it may not help. Send it again at most once; if it fails the same way, stop and report the request id.",
900
+ ...extras
901
+ };
902
+ }
903
+ function formatCliRetryGuidance(guidance, message) {
904
+ const verdict = guidance.canSucceed === true ? guidance.afterMs === null ? "yes" : `yes, after ${formatRetryWait(guidance.afterMs)}` : guidance.canSucceed === false ? "no" : "unknown";
905
+ const lines = [`Retry: ${verdict}. ${guidance.next}`];
906
+ if (guidance.hint && !(_nullishCoalesce(message, () => ( ""))).includes(guidance.hint)) {
907
+ lines.push(`Hint: ${guidance.hint}`);
908
+ }
909
+ return lines;
910
+ }
911
+
912
+ // src/cli/utils.ts
681
913
  var BROWSER_OPEN_COOLDOWN_MS = 3e4;
682
914
  var SAME_URL_BROWSER_OPEN_COOLDOWN_MS = 5 * 6e4;
683
915
  var defaultBrowserCommandRunner = childProcess;
684
916
  function getAuthedHttpClient() {
685
- const config = _chunk7IKQKKNXjs.resolveConfig.call(void 0, );
686
- return { config, http: new (0, _chunk7IKQKKNXjs.HttpClient)(config) };
917
+ const config = _chunkVIUUTEHYjs.resolveConfig.call(void 0, );
918
+ return { config, http: new (0, _chunkVIUUTEHYjs.HttpClient)(config) };
687
919
  }
688
920
  function stableOsUserId() {
689
921
  try {
@@ -793,7 +1025,7 @@ function readMacosUserHome(runner = defaultBrowserCommandRunner) {
793
1025
  { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }
794
1026
  );
795
1027
  const match = String(output).match(/NFSHomeDirectory:\s*(.+)\s*$/m);
796
- const home = _optionalChain([match, 'optionalAccess', _30 => _30[1], 'optionalAccess', _31 => _31.trim, 'call', _32 => _32()]);
1028
+ const home = _optionalChain([match, 'optionalAccess', _54 => _54[1], 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()]);
797
1029
  if (home) return home;
798
1030
  } catch (e10) {
799
1031
  }
@@ -1019,12 +1251,12 @@ function sleep(ms) {
1019
1251
  return new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
1020
1252
  }
1021
1253
  function collectLocalEnvInfo() {
1022
- const homeDir = _optionalChain([process, 'access', _33 => _33.env, 'access', _34 => _34.HOME, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]) || _os.homedir.call(void 0, );
1254
+ const homeDir = _optionalChain([process, 'access', _57 => _57.env, 'access', _58 => _58.HOME, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]) || _os.homedir.call(void 0, );
1023
1255
  const info = {
1024
1256
  os: `${process.platform} ${process.arch}`,
1025
1257
  node_version: process.version,
1026
1258
  home_dir: homeDir,
1027
- agent_runtime: _chunkRBEUVDZFjs.detectAgentRuntime.call(void 0, )
1259
+ agent_runtime: _chunk5CYZHOKIjs.detectAgentRuntime.call(void 0, )
1028
1260
  };
1029
1261
  const env = process.env;
1030
1262
  const optional = {
@@ -1032,15 +1264,15 @@ function collectLocalEnvInfo() {
1032
1264
  deepline_plugin_mode: env.DEEPLINE_PLUGIN_MODE
1033
1265
  };
1034
1266
  for (const [key, value] of Object.entries(optional)) {
1035
- if (_optionalChain([value, 'optionalAccess', _37 => _37.trim, 'call', _38 => _38()])) info[key] = value.trim();
1267
+ if (_optionalChain([value, 'optionalAccess', _61 => _61.trim, 'call', _62 => _62()])) info[key] = value.trim();
1036
1268
  }
1037
- if (_optionalChain([env, 'access', _39 => _39.CLAUDE_PROJECT_DIR, 'optionalAccess', _40 => _40.trim, 'call', _41 => _41()])) {
1269
+ if (_optionalChain([env, 'access', _63 => _63.CLAUDE_PROJECT_DIR, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()])) {
1038
1270
  info.claude_project_dir_present = "true";
1039
1271
  }
1040
- if (_optionalChain([env, 'access', _42 => _42.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _43 => _43.trim, 'call', _44 => _44()])) {
1272
+ if (_optionalChain([env, 'access', _66 => _66.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()])) {
1041
1273
  info.deepline_plugin_root_present = "true";
1042
1274
  }
1043
- if (_optionalChain([env, 'access', _45 => _45.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()])) {
1275
+ if (_optionalChain([env, 'access', _69 => _69.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()])) {
1044
1276
  info.deepline_plugin_skills_dir_present = "true";
1045
1277
  }
1046
1278
  if (info.home_dir === "/sessions" || info.home_dir.startsWith("/sessions/")) {
@@ -1059,7 +1291,7 @@ function readCsvRows(csvPath) {
1059
1291
  });
1060
1292
  }
1061
1293
  function csvStringFromRows(rows, columns) {
1062
- const effectiveColumns = _optionalChain([columns, 'optionalAccess', _48 => _48.length]) ? columns : Object.keys(_nullishCoalesce(rows[0], () => ( {})));
1294
+ const effectiveColumns = _optionalChain([columns, 'optionalAccess', _72 => _72.length]) ? columns : Object.keys(_nullishCoalesce(rows[0], () => ( {})));
1063
1295
  if (!effectiveColumns.length) {
1064
1296
  return _sync3.stringify.call(void 0,
1065
1297
  rows.map(() => ({})),
@@ -1144,7 +1376,7 @@ function failureMessageFromRecord(value) {
1144
1376
  const status = typeof value.status === "string" ? value.status.trim().toLowerCase() : "";
1145
1377
  const directError = typeof value.error === "string" ? value.error.trim() : typeof value.last_error === "string" ? value.last_error.trim() : "";
1146
1378
  const result = value.result && typeof value.result === "object" && !Array.isArray(value.result) ? value.result : null;
1147
- const resultError = typeof _optionalChain([result, 'optionalAccess', _49 => _49.error]) === "string" ? result.error.trim() : typeof _optionalChain([result, 'optionalAccess', _50 => _50.message]) === "string" ? result.message.trim() : "";
1379
+ const resultError = typeof _optionalChain([result, 'optionalAccess', _73 => _73.error]) === "string" ? result.error.trim() : typeof _optionalChain([result, 'optionalAccess', _74 => _74.message]) === "string" ? result.message.trim() : "";
1148
1380
  if (!directError && !resultError && status !== "error" && status !== "failed") {
1149
1381
  return null;
1150
1382
  }
@@ -1170,30 +1402,30 @@ function flattenObjectColumns(row, options = {}) {
1170
1402
  continue;
1171
1403
  }
1172
1404
  if (value && typeof value === "object" && !Array.isArray(value)) {
1173
- const record = value;
1405
+ const record2 = value;
1174
1406
  if (options.objectColumns === "json") {
1175
- flattened[key] = csvSafeJsonString(record);
1407
+ flattened[key] = csvSafeJsonString(record2);
1176
1408
  continue;
1177
1409
  }
1178
- const hasMatchedEnvelope = Object.prototype.hasOwnProperty.call(record, "matched_result") || Object.prototype.hasOwnProperty.call(record, "matchedResult");
1410
+ const hasMatchedEnvelope = Object.prototype.hasOwnProperty.call(record2, "matched_result") || Object.prototype.hasOwnProperty.call(record2, "matchedResult");
1179
1411
  if (hasMatchedEnvelope) {
1180
- flattened[key] = csvSafeJsonString(record);
1412
+ flattened[key] = csvSafeJsonString(record2);
1181
1413
  continue;
1182
1414
  }
1183
1415
  if (parsedFromString && shouldPreserveJsonStringColumn(options.preserveJsonStringColumns, key)) {
1184
1416
  flattened[key] = rawValue;
1185
1417
  continue;
1186
1418
  } else {
1187
- const failureMessage = failureMessageFromRecord(record);
1419
+ const failureMessage = failureMessageFromRecord(record2);
1188
1420
  if (failureMessage) {
1189
1421
  flattened[key] = failureMessage;
1190
1422
  continue;
1191
- } else if (Object.prototype.hasOwnProperty.call(record, "result")) {
1192
- flattened[key] = csvSafeJsonString(record);
1423
+ } else if (Object.prototype.hasOwnProperty.call(record2, "result")) {
1424
+ flattened[key] = csvSafeJsonString(record2);
1193
1425
  continue;
1194
1426
  }
1195
1427
  }
1196
- for (const [nestedKey, nestedValue] of Object.entries(record)) {
1428
+ for (const [nestedKey, nestedValue] of Object.entries(record2)) {
1197
1429
  flattened[`${key}.${nestedKey}`] = nestedValue && typeof nestedValue === "object" ? csvSafeJsonString(nestedValue) : nestedValue;
1198
1430
  }
1199
1431
  continue;
@@ -1255,8 +1487,8 @@ function markdownCell(value) {
1255
1487
  if (value === null || value === void 0) {
1256
1488
  return "";
1257
1489
  }
1258
- const text = typeof value === "object" ? JSON.stringify(value) : String(value);
1259
- return text.replace(/\|/g, "\\|").replace(/\r?\n/g, "<br>");
1490
+ const text2 = typeof value === "object" ? JSON.stringify(value) : String(value);
1491
+ return text2.replace(/\|/g, "\\|").replace(/\r?\n/g, "<br>");
1260
1492
  }
1261
1493
  function markdownTableFromRows(rows, preferredColumns = []) {
1262
1494
  const flattenedRows = dataExportRows(rows);
@@ -1271,9 +1503,9 @@ function markdownTableFromRows(rows, preferredColumns = []) {
1271
1503
  }
1272
1504
  function withAgentCommandContext(value) {
1273
1505
  const valueRecord = value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
1274
- return _chunkRBEUVDZFjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
1506
+ return _chunk5CYZHOKIjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
1275
1507
  ...valueRecord,
1276
- command_context: _chunk7IKQKKNXjs.resolveCliCommandContext.call(void 0, )
1508
+ command_context: _chunkVIUUTEHYjs.resolveCliCommandContext.call(void 0, )
1277
1509
  } : value;
1278
1510
  }
1279
1511
  function printJson(value, fields, options = {}) {
@@ -1317,7 +1549,7 @@ function printCompactJson(value) {
1317
1549
  );
1318
1550
  }
1319
1551
  function cliToolExecutionFailure(error) {
1320
- const failure = _chunkBBTKAASQjs.serializeToolExecutionFailure.call(void 0, error);
1552
+ const failure = _chunkLFQJW4S2js.serializeToolExecutionFailure.call(void 0, error);
1321
1553
  if (!failure) return null;
1322
1554
  const { publicDetails: _publicDetails, ...facts } = failure;
1323
1555
  return facts;
@@ -1325,7 +1557,6 @@ function cliToolExecutionFailure(error) {
1325
1557
  var UPSTREAM_BODY_EXCERPT_CHARS = 300;
1326
1558
  var UPSTREAM_BODY_MAX_DEPTH = 6;
1327
1559
  var CREDENTIAL_FIELD_RE = /(?:^|[-_])(?:auth|key|sig(?:nature)?|session)$|api[-_]?key|apikey|access[-_]?key|private|token|secret|passw(?:or)?d|authorization|cookie|credential|bearer/i;
1328
- var TRANSIENT_CLIENT_ERROR_STATUSES = /* @__PURE__ */ new Set([408, 425, 429]);
1329
1560
  function maskCredentialFields(value, depth = 0) {
1330
1561
  if (value === null || typeof value !== "object") return value;
1331
1562
  if (depth >= UPSTREAM_BODY_MAX_DEPTH) return "[nested]";
@@ -1351,38 +1582,31 @@ function formatUpstreamBodyExcerpt(body) {
1351
1582
  }
1352
1583
  }
1353
1584
  if (value === null || value === void 0) return "(empty body)";
1354
- let text;
1585
+ let text2;
1355
1586
  try {
1356
- text = typeof value === "string" ? value : _nullishCoalesce(JSON.stringify(maskCredentialFields(value)), () => ( String(value)));
1587
+ text2 = typeof value === "string" ? value : _nullishCoalesce(JSON.stringify(maskCredentialFields(value)), () => ( String(value)));
1357
1588
  } catch (e19) {
1358
- text = String(value);
1589
+ text2 = String(value);
1359
1590
  }
1360
- const redacted = redactFailureText(text, Number.MAX_SAFE_INTEGER).replace(/\s+/g, " ").trim();
1591
+ const redacted = redactFailureText(text2, Number.MAX_SAFE_INTEGER).replace(/\s+/g, " ").trim();
1361
1592
  if (!redacted) return "(empty body)";
1362
1593
  return redacted.length > UPSTREAM_BODY_EXCERPT_CHARS ? `${redacted.slice(0, UPSTREAM_BODY_EXCERPT_CHARS)}\u2026 (full body: rerun with --json)` : redacted;
1363
1594
  }
1364
- function permanentProviderFailureLine(status, connectedCredential) {
1365
- if (typeof status !== "number" || status < 400 || status >= 500) return null;
1366
- if (TRANSIENT_CLIENT_ERROR_STATUSES.has(status)) return null;
1367
- if (connectedCredential && (status === 401 || status === 403)) {
1368
- return "Permanent: the provider refused this credential or its permissions. Check the connected key and its plan before retrying.";
1369
- }
1370
- return "Permanent: the provider rejected this request. Retrying it unchanged will fail again.";
1371
- }
1372
1595
  function formatToolExecutionErrorDiagnostic(error) {
1373
1596
  return formatCliFailureDiagnostic(errorToJsonPayload(error).error);
1374
1597
  }
1375
1598
  function formatCliFailureDiagnostic(error) {
1376
1599
  if (error === null || typeof error !== "object") return null;
1377
- const record = error;
1378
- const failure = _chunkBBTKAASQjs.normalizeToolExecutionFailure.call(void 0, record.tool_error);
1379
- const upstreamResponse = _chunkBBTKAASQjs.readToolUpstreamResponse.call(void 0, record);
1380
- if (!failure && !upstreamResponse) return null;
1600
+ const record2 = error;
1601
+ const failure = _chunkLFQJW4S2js.normalizeToolExecutionFailure.call(void 0, record2.tool_error);
1602
+ const upstreamResponse = _chunkLFQJW4S2js.readToolUpstreamResponse.call(void 0, record2);
1603
+ const retry = cliRetryGuidance(record2);
1604
+ if (!failure && !upstreamResponse && !retry) return null;
1381
1605
  const lines = [];
1382
1606
  if (failure) {
1383
1607
  lines.push(
1384
1608
  `Tool: ${failure.toolId}${failure.provider ? `; provider: ${failure.provider}` : ""}${failure.operation ? `; operation: ${failure.operation}` : ""}.`,
1385
- `Failure: ${failure.origin} / ${failure.category}. Same-call retry: ${failure.retryable ? `safe${failure.retryAfterMs === null ? "" : ` after ${failure.retryAfterMs}ms`}` : "unsafe"}.`
1609
+ `Failure: ${failure.origin} / ${failure.category}${failure.code ? ` (${failure.code})` : ""}.`
1386
1610
  );
1387
1611
  }
1388
1612
  if (upstreamResponse) {
@@ -1390,70 +1614,76 @@ function formatCliFailureDiagnostic(error) {
1390
1614
  `Provider response: HTTP ${upstreamResponse.status}: ${formatUpstreamBodyExcerpt(upstreamResponse.body)}`
1391
1615
  );
1392
1616
  }
1393
- if (!failure || failure.origin === "provider" && !failure.retryable) {
1394
- const permanent = permanentProviderFailureLine(
1395
- _nullishCoalesce(_optionalChain([upstreamResponse, 'optionalAccess', _51 => _51.status]), () => ( _optionalChain([failure, 'optionalAccess', _52 => _52.statusCode]))),
1396
- upstreamResponse !== null && upstreamResponse !== void 0
1617
+ if (retry) {
1618
+ lines.push(
1619
+ ...formatCliRetryGuidance(
1620
+ retry,
1621
+ typeof record2.message === "string" ? record2.message : null
1622
+ )
1397
1623
  );
1398
- if (permanent) lines.push(permanent);
1399
1624
  }
1400
- if (_optionalChain([failure, 'optionalAccess', _53 => _53.networkKind]) || _optionalChain([failure, 'optionalAccess', _54 => _54.networkScope])) {
1625
+ if (_optionalChain([failure, 'optionalAccess', _75 => _75.networkKind]) || _optionalChain([failure, 'optionalAccess', _76 => _76.networkScope])) {
1401
1626
  lines.push(
1402
1627
  `Network: ${_nullishCoalesce(failure.networkKind, () => ( "unknown"))}${failure.networkScope ? ` (${failure.networkScope})` : ""}.`
1403
1628
  );
1404
1629
  }
1405
- if (_optionalChain([failure, 'optionalAccess', _55 => _55.requestId])) lines.push(`Request: ${failure.requestId}.`);
1630
+ if (_optionalChain([failure, 'optionalAccess', _77 => _77.requestId])) lines.push(`Request: ${failure.requestId}.`);
1406
1631
  return lines.join("\n");
1407
1632
  }
1408
1633
  function errorToJsonPayload(error) {
1409
1634
  const message = error instanceof Error ? error.message : String(error);
1410
1635
  const toolFailure = cliToolExecutionFailure(error);
1411
- const upstreamResponse = _chunkBBTKAASQjs.readToolUpstreamResponse.call(void 0, error);
1636
+ const upstreamResponse = _chunkLFQJW4S2js.readToolUpstreamResponse.call(void 0, error);
1412
1637
  const maybeRecord = error && typeof error === "object" ? error : null;
1413
- const code = typeof _optionalChain([maybeRecord, 'optionalAccess', _56 => _56.code]) === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
1638
+ const code = typeof _optionalChain([maybeRecord, 'optionalAccess', _78 => _78.code]) === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
1414
1639
  const details = {};
1415
- const exitCode = typeof _optionalChain([maybeRecord, 'optionalAccess', _57 => _57.exitCode]) === "number" ? maybeRecord.exitCode : void 0;
1416
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _58 => _58.statusCode]) === "number") {
1640
+ const exitCode = typeof _optionalChain([maybeRecord, 'optionalAccess', _79 => _79.exitCode]) === "number" ? maybeRecord.exitCode : void 0;
1641
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _80 => _80.statusCode]) === "number") {
1417
1642
  details.statusCode = maybeRecord.statusCode;
1418
1643
  }
1419
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _59 => _59.status]) === "number") {
1644
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _81 => _81.status]) === "number") {
1420
1645
  details.status = maybeRecord.status;
1421
1646
  }
1422
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _60 => _60.requestId]) === "string" || _optionalChain([maybeRecord, 'optionalAccess', _61 => _61.requestId]) === null) {
1647
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _82 => _82.requestId]) === "string" || _optionalChain([maybeRecord, 'optionalAccess', _83 => _83.requestId]) === null) {
1423
1648
  details.requestId = maybeRecord.requestId;
1424
1649
  }
1425
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _62 => _62.retryable]) === "boolean") {
1650
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _84 => _84.retryable]) === "boolean") {
1426
1651
  details.retryable = maybeRecord.retryable;
1427
1652
  }
1428
- if (_optionalChain([maybeRecord, 'optionalAccess', _63 => _63.publicDetails]) && typeof maybeRecord.publicDetails === "object" && !Array.isArray(maybeRecord.publicDetails)) {
1653
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _85 => _85.retryAfterMs]) === "number" && Number.isFinite(maybeRecord.retryAfterMs)) {
1654
+ details.retryAfterMs = maybeRecord.retryAfterMs;
1655
+ }
1656
+ if (_optionalChain([maybeRecord, 'optionalAccess', _86 => _86.publicDetails]) && typeof maybeRecord.publicDetails === "object" && !Array.isArray(maybeRecord.publicDetails)) {
1429
1657
  details.publicDetails = maybeRecord.publicDetails;
1430
1658
  }
1431
- if (_optionalChain([maybeRecord, 'optionalAccess', _64 => _64.details]) && typeof maybeRecord.details === "object" && !Array.isArray(maybeRecord.details)) {
1659
+ if (_optionalChain([maybeRecord, 'optionalAccess', _87 => _87.details]) && typeof maybeRecord.details === "object" && !Array.isArray(maybeRecord.details)) {
1432
1660
  details.details = maybeRecord.details;
1433
1661
  }
1434
- if (_optionalChain([maybeRecord, 'optionalAccess', _65 => _65.guidance]) && typeof maybeRecord.guidance === "object" && !Array.isArray(maybeRecord.guidance)) {
1662
+ if (_optionalChain([maybeRecord, 'optionalAccess', _88 => _88.guidance]) && typeof maybeRecord.guidance === "object" && !Array.isArray(maybeRecord.guidance)) {
1435
1663
  details.guidance = maybeRecord.guidance;
1436
1664
  }
1437
1665
  const providerConcurrency = providerConcurrencyDiagnostic(maybeRecord);
1438
1666
  if (providerConcurrency) {
1439
1667
  details.providerConcurrency = providerConcurrency;
1440
1668
  }
1441
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _66 => _66.cause]) === "string") {
1669
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _89 => _89.cause]) === "string") {
1442
1670
  details.cause = maybeRecord.cause;
1443
1671
  }
1444
- const statusCode = typeof _optionalChain([maybeRecord, 'optionalAccess', _67 => _67.statusCode]) === "number" ? maybeRecord.statusCode : typeof _optionalChain([maybeRecord, 'optionalAccess', _68 => _68.status]) === "number" ? maybeRecord.status : _nullishCoalesce(_optionalChain([toolFailure, 'optionalAccess', _69 => _69.statusCode]), () => ( void 0));
1672
+ const statusCode = typeof _optionalChain([maybeRecord, 'optionalAccess', _90 => _90.statusCode]) === "number" ? maybeRecord.statusCode : typeof _optionalChain([maybeRecord, 'optionalAccess', _91 => _91.status]) === "number" ? maybeRecord.status : _nullishCoalesce(_optionalChain([toolFailure, 'optionalAccess', _92 => _92.statusCode]), () => ( void 0));
1673
+ const payloadError = {
1674
+ message,
1675
+ code,
1676
+ ...toolFailure ? { tool_error: toolFailure } : {},
1677
+ ...upstreamResponse ? { upstreamResponse } : {},
1678
+ ...Object.keys(details).length > 0 ? { details } : {}
1679
+ };
1680
+ const retry = cliRetryGuidance(payloadError, _chunk5CYZHOKIjs.readToolFailureHint.call(void 0, error));
1445
1681
  return {
1446
1682
  ok: false,
1447
1683
  status: "failed",
1448
1684
  ...typeof statusCode === "number" ? { statusCode } : {},
1449
1685
  ...exitCode !== void 0 ? { exitCode } : {},
1450
- error: {
1451
- message,
1452
- code,
1453
- ...toolFailure ? { tool_error: toolFailure } : {},
1454
- ...upstreamResponse ? { upstreamResponse } : {},
1455
- ...Object.keys(details).length > 0 ? { details } : {}
1456
- }
1686
+ error: { ...payloadError, ...retry ? { retry } : {} }
1457
1687
  };
1458
1688
  }
1459
1689
  function formatProviderConcurrencyDiagnostic(error) {
@@ -1503,12 +1733,12 @@ function clip(value, maxLength) {
1503
1733
  // src/cli/command-envelope.ts
1504
1734
  function renderSections(render) {
1505
1735
  const lines = [];
1506
- for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _70 => _70.sections]), () => ( []))) {
1736
+ for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _93 => _93.sections]), () => ( []))) {
1507
1737
  if (!section.title || section.lines.length === 0) continue;
1508
1738
  lines.push(section.title);
1509
1739
  lines.push(...section.lines.map((line) => ` ${line}`));
1510
1740
  }
1511
- for (const action of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _71 => _71.actions]), () => ( []))) {
1741
+ for (const action of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _94 => _94.actions]), () => ( []))) {
1512
1742
  if (!action.label || !action.command) continue;
1513
1743
  lines.push(`${action.label}: ${action.command}`);
1514
1744
  }