deepline 0.3.522 → 0.3.524

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 (176) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +178 -60
  2. package/dist/bundling-sources/sdk/src/index.ts +3 -0
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +60 -14
  5. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +9 -3
  6. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +406 -40
  8. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +1 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/db-session-renewal.ts +209 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +16 -6
  11. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +388 -13
  12. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +28 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +5 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +1 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +38 -5
  16. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +92 -10
  17. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +96 -25
  18. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +29 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +139 -17
  20. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/durable-run-sql.ts +26 -3
  21. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +145 -5
  22. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +190 -10
  23. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +85 -5
  24. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +21 -11
  25. package/dist/cli/auth-OKPHHMMP.js +43 -0
  26. package/dist/cli/{auth-YIBY5IKT.mjs → auth-QXJMVLPN.mjs} +5 -5
  27. package/dist/cli/{billing-UDKL53GI.js → billing-N5R4HTHT.js} +82 -82
  28. package/dist/cli/{billing-G3IX3SNY.mjs → billing-SNSIFM4B.mjs} +7 -7
  29. package/dist/cli/{chunk-EJBW7Y6Z.js → chunk-2ZWNIS54.js} +108 -96
  30. package/dist/cli/{chunk-3KMGVOBM.mjs → chunk-2ZX7XSAQ.mjs} +4 -4
  31. package/dist/cli/{chunk-4TUMKJZX.mjs → chunk-3WWTBQHC.mjs} +2 -2
  32. package/dist/cli/{chunk-MD524MRB.mjs → chunk-536TGWR6.mjs} +1 -1
  33. package/dist/cli/{chunk-37SXIFIU.js → chunk-66N76YZG.js} +44 -44
  34. package/dist/cli/{chunk-BZY335JP.js → chunk-7E6B7VMS.js} +5 -5
  35. package/dist/cli/{chunk-HYR34KFA.js → chunk-7OQGZBDG.js} +109 -24
  36. package/dist/cli/{chunk-GVKW3LCA.js → chunk-7QM6DNR4.js} +11 -11
  37. package/dist/cli/{chunk-DNJJ3ULJ.js → chunk-ANKD3AIR.js} +2 -2
  38. package/dist/cli/{chunk-4DFWDA2Q.js → chunk-ATATJNJ6.js} +9 -9
  39. package/dist/cli/{chunk-ZZ7U4YJS.mjs → chunk-BXIQD2IY.mjs} +1 -1
  40. package/dist/cli/{chunk-XT25FX6T.js → chunk-BXVYVIMB.js} +3 -3
  41. package/dist/cli/{chunk-XR6TN5DT.mjs → chunk-CH7JVSA7.mjs} +6 -6
  42. package/dist/cli/{chunk-RKE5YTHY.mjs → chunk-EO55Y4QW.mjs} +5 -5
  43. package/dist/cli/{chunk-RI672VNY.js → chunk-EQNAQENZ.js} +2 -2
  44. package/dist/cli/{chunk-LFSOBW7E.mjs → chunk-FXTV5B3D.mjs} +22 -10
  45. package/dist/cli/{chunk-C6WGMODR.mjs → chunk-GMO3JDZA.mjs} +2 -2
  46. package/dist/cli/{chunk-DRDZBRXV.js → chunk-GTGJBZVH.js} +7 -7
  47. package/dist/cli/{chunk-SFMCKB57.mjs → chunk-HLAFGQPV.mjs} +76 -34
  48. package/dist/cli/{chunk-534YYHIF.js → chunk-HTYT2OHB.js} +6 -6
  49. package/dist/cli/{chunk-ZZLZCO6Y.js → chunk-I75VRGQG.js} +22 -22
  50. package/dist/cli/{chunk-Y3LDRCMB.mjs → chunk-II3BJKCH.mjs} +2 -2
  51. package/dist/cli/{chunk-5BQPEHEP.js → chunk-JDIQBZ6O.js} +14 -14
  52. package/dist/cli/{chunk-ENWJFUWK.mjs → chunk-KKPBCB6D.mjs} +2 -2
  53. package/dist/cli/{chunk-BONXEWYF.mjs → chunk-KSQXBLRW.mjs} +3 -3
  54. package/dist/cli/{chunk-7JEN3FX4.js → chunk-LRWDZDBS.js} +5 -5
  55. package/dist/cli/{chunk-5477PEHL.mjs → chunk-MW3YMPD2.mjs} +1 -1
  56. package/dist/cli/{chunk-VFCVH2LV.mjs → chunk-NUC7ZVDG.mjs} +5 -5
  57. package/dist/cli/{chunk-DLDWAPA5.js → chunk-OCT4SUJA.js} +4 -4
  58. package/dist/cli/{chunk-FQQAAR3Q.mjs → chunk-OQ5G7RFQ.mjs} +1 -1
  59. package/dist/cli/{chunk-VIM6I7RC.js → chunk-PFKKZVFK.js} +41 -41
  60. package/dist/cli/{chunk-OAQIVJFY.mjs → chunk-PFKWKWUJ.mjs} +2 -2
  61. package/dist/cli/{chunk-52MHE7B4.mjs → chunk-R457IMHJ.mjs} +1 -1
  62. package/dist/cli/{chunk-UV6XCHOZ.mjs → chunk-RIX26ZJD.mjs} +1 -1
  63. package/dist/cli/{chunk-RDJTCW3I.mjs → chunk-RTDX5NNN.mjs} +3 -3
  64. package/dist/cli/{chunk-FNHUDCJE.js → chunk-RUULUCBP.js} +10 -10
  65. package/dist/cli/{chunk-GMYDVW7Z.js → chunk-SF4QJVBE.js} +3 -3
  66. package/dist/cli/{chunk-DARD7TJ7.js → chunk-SMWFOGUT.js} +53 -53
  67. package/dist/cli/{chunk-XXY4E57R.mjs → chunk-T43FF5PF.mjs} +2 -2
  68. package/dist/cli/{chunk-ZUAKRBZB.js → chunk-TZTWH53O.js} +1 -1
  69. package/dist/cli/{chunk-7J5PLHII.mjs → chunk-V2YIBBVT.mjs} +1 -1
  70. package/dist/cli/{chunk-6SJPZV5E.js → chunk-V4RJ57MA.js} +2 -2
  71. package/dist/cli/{chunk-4MF44THR.js → chunk-V7KUBDEB.js} +82 -40
  72. package/dist/cli/{chunk-ISUUSSS4.js → chunk-VHTVXS5A.js} +16 -16
  73. package/dist/cli/{chunk-NDNG3MAT.mjs → chunk-WCVIPZWX.mjs} +5 -5
  74. package/dist/cli/{chunk-F5D623KO.js → chunk-WOEPDSO3.js} +26 -26
  75. package/dist/cli/{chunk-VE6FHVXZ.mjs → chunk-XURWFEXM.mjs} +109 -24
  76. package/dist/cli/{chunk-G65FJ5JX.mjs → chunk-YCIXY66B.mjs} +2 -2
  77. package/dist/cli/{chunk-CFXERH7F.mjs → chunk-YGOI5ZE5.mjs} +1 -1
  78. package/dist/cli/{chunk-PDLRUZ42.mjs → chunk-YKFW3NNA.mjs} +5 -5
  79. package/dist/cli/{chunk-5H22VJPE.js → chunk-YXVYPYIP.js} +6 -6
  80. package/dist/cli/{chunk-KMBF3N2Z.js → chunk-Z4MOEQSY.js} +16 -16
  81. package/dist/cli/command-docs.js +2 -2
  82. package/dist/cli/command-docs.mjs +1 -1
  83. package/dist/cli/{csv-PE35WGRO.mjs → csv-HT2JBCW2.mjs} +4 -4
  84. package/dist/cli/{csv-3HIE4VCO.js → csv-Q2LWKXAV.js} +13 -13
  85. package/dist/cli/{db-L7ZMMQKW.mjs → db-CS3XQ2LX.mjs} +6 -6
  86. package/dist/cli/{db-O2YRTTDO.js → db-XEV4WEE4.js} +27 -27
  87. package/dist/cli/describe-5G5NXO5E.js +50 -0
  88. package/dist/cli/{describe-NI324Y2M.mjs → describe-OUTXLDGZ.mjs} +18 -18
  89. package/dist/cli/describe-core.d.mts +3 -3
  90. package/dist/cli/describe-core.d.ts +3 -3
  91. package/dist/cli/{executions-VH4DKLFI.js → executions-JCC34WAD.js} +8 -8
  92. package/dist/cli/{executions-T6KU2OKK.mjs → executions-L6XFG5MP.mjs} +6 -6
  93. package/dist/cli/{feedback-SCSJC3FX.mjs → feedback-AWBDO5I6.mjs} +5 -5
  94. package/dist/cli/{feedback-ZLC6G5OK.js → feedback-HV2M2G7N.js} +10 -10
  95. package/dist/cli/git-GDPTG52F.js +25 -0
  96. package/dist/cli/{git-I4LVQCID.mjs → git-S4LRXTRX.mjs} +5 -5
  97. package/dist/cli/index.js +146 -146
  98. package/dist/cli/index.mjs +45 -45
  99. package/dist/cli/{legacy-noops-44FQ2256.mjs → legacy-noops-7MOKBL4O.mjs} +6 -6
  100. package/dist/cli/{legacy-noops-UPFWEHPG.js → legacy-noops-RGSZUD6V.js} +9 -9
  101. package/dist/cli/{monitors-JN6IQGK6.js → monitors-JEFM2C5W.js} +100 -100
  102. package/dist/cli/{monitors-LMSASWXE.mjs → monitors-XQNXDZPQ.mjs} +7 -7
  103. package/dist/cli/{org-F7O3ZU5O.js → org-GYLA5V32.js} +235 -72
  104. package/dist/cli/{org-QYLVEE7A.mjs → org-KTMJZGTN.mjs} +169 -6
  105. package/dist/cli/{pages-KEL3Y4L4.js → pages-RY4U7OCL.js} +18 -18
  106. package/dist/cli/{pages-5XE4LBZN.mjs → pages-WOMU2T2O.mjs} +6 -6
  107. package/dist/cli/{play-OURHH6KV.js → play-2Q6MWJ3D.js} +363 -323
  108. package/dist/cli/{play-MWQG3G32.mjs → play-KOYGGNYS.mjs} +64 -24
  109. package/dist/cli/{providers-IQY7LUBB.mjs → providers-7YKDITJC.mjs} +6 -6
  110. package/dist/cli/{providers-ZCBWPE3C.js → providers-HOIRHMN2.js} +9 -9
  111. package/dist/cli/{quickstart-O53OXTN6.js → quickstart-OWCJOSQA.js} +6 -6
  112. package/dist/cli/{quickstart-L45NGRMI.mjs → quickstart-RDXHSMVX.mjs} +4 -4
  113. package/dist/cli/{run-W745Z3Z5.js → run-MT2ABKO5.js} +41 -41
  114. package/dist/cli/{run-VCSIWLEU.mjs → run-RT73NDP5.mjs} +23 -23
  115. package/dist/cli/search-7VBA6IGS.js +33 -0
  116. package/dist/cli/{search-THELKULN.mjs → search-CJPKIGSA.mjs} +8 -8
  117. package/dist/cli/{search-output-N7MJLYYD.mjs → search-output-AREMA544.mjs} +4 -4
  118. package/dist/cli/{search-output-SJW7LEOM.js → search-output-OSBZ7WK6.js} +6 -6
  119. package/dist/cli/{secrets-44ST3FJH.mjs → secrets-BTIY2FEJ.mjs} +6 -6
  120. package/dist/cli/{secrets-GDXPX3KB.js → secrets-OV6KH633.js} +15 -15
  121. package/dist/cli/{sessions-LYCBI77S.mjs → sessions-3CO3ZFOD.mjs} +6 -6
  122. package/dist/cli/sessions-B3WNEWRW.js +18 -0
  123. package/dist/cli/{settings-GXPDMJFG.mjs → settings-7BQIC7QN.mjs} +13 -13
  124. package/dist/cli/{settings-3WOFF642.js → settings-LBIECYDB.js} +86 -86
  125. package/dist/cli/{setup-YHLMBJP4.js → setup-QZE7QR3F.js} +50 -50
  126. package/dist/cli/{setup-YM6JEB64.mjs → setup-XPTSNNES.mjs} +10 -10
  127. package/dist/cli/{skills-WX4XWEAT.mjs → skills-TGGKIQLT.mjs} +8 -8
  128. package/dist/cli/skills-TXBRTWEV.js +37 -0
  129. package/dist/cli/{tools-K24VSQ7S.mjs → tools-MKIFX2TQ.mjs} +17 -17
  130. package/dist/cli/tools-RZJV4X3J.js +57 -0
  131. package/dist/cli/{update-PSSCF5AT.mjs → update-5R3D3WNH.mjs} +10 -10
  132. package/dist/cli/update-YWGGPWUA.js +35 -0
  133. package/dist/cli/{artifacts-RY2MK74N.mjs → views-VHKDHHUP.mjs} +76 -76
  134. package/dist/cli/views-VPWEINIA.js +270 -0
  135. package/dist/cli/{workflow-FPVI3NIA.js → workflow-7K2VEQ4V.js} +17 -17
  136. package/dist/cli/{workflow-DGOPYATO.mjs → workflow-D5DF65N6.mjs} +7 -7
  137. package/dist/{client-DA71-2_u.d.mts → client-C5_6W8yd.d.mts} +1 -1
  138. package/dist/{client-core-C0IzDKMJ.d.ts → client-core-B-GPfmaC.d.ts} +121 -44
  139. package/dist/{client-core-BXbds1cb.d.mts → client-core-Dob428Z4.d.mts} +121 -44
  140. package/dist/{client-B-2Am2y6.d.ts → client-iXW4TOat.d.ts} +1 -1
  141. package/dist/{compiler-manifest-B4mIIbw7.d.mts → compiler-manifest-DsxsQP-T.d.mts} +14 -7
  142. package/dist/{compiler-manifest-B4mIIbw7.d.ts → compiler-manifest-DsxsQP-T.d.ts} +14 -7
  143. package/dist/{errors-Gj9i5Rkd.d.ts → errors-Bk5h1D-C.d.ts} +1 -1
  144. package/dist/{errors-C2F4qzAq.d.mts → errors-qdJUVQ3g.d.mts} +1 -1
  145. package/dist/{index-5JZBufdF.d.mts → index-PaupwX1B.d.mts} +1 -1
  146. package/dist/{index-BXtSj8bv.d.ts → index-bL66eHYz.d.ts} +1 -1
  147. package/dist/index.d.mts +7 -7
  148. package/dist/index.d.ts +7 -7
  149. package/dist/index.js +9 -9
  150. package/dist/index.mjs +6 -6
  151. package/dist/install-integrity.json +117 -116
  152. package/dist/plays/bundle-play-file.d.mts +3 -3
  153. package/dist/plays/bundle-play-file.d.ts +3 -3
  154. package/dist/plays/bundle-play-file.mjs +7 -5
  155. package/dist/plays/play-description.d.mts +2 -2
  156. package/dist/plays/play-description.d.ts +2 -2
  157. package/dist/plays/run-request.d.mts +2 -2
  158. package/dist/plays/run-request.d.ts +2 -2
  159. package/dist/release.d.mts +1 -1
  160. package/dist/release.d.ts +1 -1
  161. package/dist/release.js +2 -2
  162. package/dist/release.mjs +1 -1
  163. package/dist/server.d.mts +4 -4
  164. package/dist/server.d.ts +4 -4
  165. package/dist/server.js +5 -5
  166. package/dist/server.mjs +3 -3
  167. package/package.json +1 -1
  168. package/dist/cli/artifacts-GIZZH5VA.js +0 -270
  169. package/dist/cli/auth-JSES2JOQ.js +0 -43
  170. package/dist/cli/describe-EB336DAO.js +0 -50
  171. package/dist/cli/git-23T7TXAH.js +0 -25
  172. package/dist/cli/search-R6K7ZAMU.js +0 -33
  173. package/dist/cli/sessions-2V5ZFOWL.js +0 -18
  174. package/dist/cli/skills-XNGADDO6.js +0 -37
  175. package/dist/cli/tools-ROUMCB7B.js +0 -57
  176. package/dist/cli/update-RXURGIRW.js +0 -35
@@ -287,8 +287,14 @@ export type ToolExecuteHttpFailureOutcome = ToolExecuteHttpRetryDecision & {
287
287
  chargeRetryBudget: boolean;
288
288
  /** The response proves the provider request was never dispatched. */
289
289
  knownNotDispatched: boolean;
290
- /** The response proves this attempt's billing reservation was released. */
290
+ /** The response shape implies this attempt's billing reservation was released. */
291
291
  billingReservationReleased: boolean;
292
+ /**
293
+ * The app's optional `billing_reservation_released: true`: it awaited this
294
+ * attempt's release and billing confirmed it. Absent from an older app, a
295
+ * retained async hold, an ambiguous launch, and a refused or failed release.
296
+ */
297
+ billingReservationReleaseConfirmed: boolean;
292
298
  };
293
299
 
294
300
  /**
@@ -304,8 +310,15 @@ export function toolExecuteBillingRetryIdentity(input: {
304
310
  | 'backpressureDelayMs'
305
311
  | 'knownNotDispatched'
306
312
  | 'billingReservationReleased'
313
+ | 'billingReservationReleaseConfirmed'
307
314
  >;
308
315
  executionFenced: boolean;
316
+ /**
317
+ * The call reconnects to an accepted async provider job, whose recovery
318
+ * invocation key and hold are fixed. It never takes the confirmed-release
319
+ * renewal; absent means an ordinary call.
320
+ */
321
+ asyncExecutionRecovery?: boolean;
309
322
  httpFailureAttempt: number;
310
323
  invocationAttempt: number;
311
324
  }): string | null {
@@ -319,6 +332,30 @@ export function toolExecuteBillingRetryIdentity(input: {
319
332
  ? `transient-retry:${input.httpFailureAttempt}`
320
333
  : null;
321
334
  }
335
+ // The app released this attempt's reservation and never reopens one, so a
336
+ // resend under the same identity is refused as a closed reservation (409)
337
+ // and halts the run. An unfenced call needs the renewal as much as a fenced
338
+ // one: a billed read that is not declared retry-safe is resent after a
339
+ // provider 5xx once `retryProviderServerErrors` is on.
340
+ if (
341
+ failure.billingReservationReleased &&
342
+ failure.reason === 'provider_server_error'
343
+ ) {
344
+ return `transient-retry:${input.httpFailureAttempt}`;
345
+ }
346
+ // A `retrySafeTransientHttp` action bills through the same request identity,
347
+ // but its 502 shape is also sent while a hold is retained (an async hold with
348
+ // an attached provider job, an ambiguous launch) or after a release failed.
349
+ // Renewing there would open a second reservation beside one that can still
350
+ // settle, so only the app's explicit confirmation renews; without it the
351
+ // retry keeps its identity and recovers the reservation it already has.
352
+ if (
353
+ failure.billingReservationReleaseConfirmed &&
354
+ failure.reason === 'retry_safe_transient_5xx' &&
355
+ input.asyncExecutionRecovery !== true
356
+ ) {
357
+ return `transient-retry:${input.httpFailureAttempt}`;
358
+ }
322
359
  return failure.backpressureDelayMs !== null ||
323
360
  (failure.reason === 'rate_limit' && failure.knownNotDispatched)
324
361
  ? `provider-rate-limit-retry:${input.invocationAttempt}`
@@ -332,6 +369,7 @@ export type ToolExecuteHttpFailureAttemptTracker = {
332
369
  bodyText?: string;
333
370
  transientHttpRetrySafe?: boolean;
334
371
  executionFenced?: boolean;
372
+ providerServerErrorReplay?: ProviderServerErrorReplay;
335
373
  }): number;
336
374
  };
337
375
 
@@ -509,7 +547,9 @@ const PROVIDER_SERVER_ERROR_RETRY_JITTER_RATIO = 0.2;
509
547
  /**
510
548
  * Exponential backoff for a provider 5xx (2 s, 4 s, ... capped at 30 s), with
511
549
  * ±20% jitter so rows that failed together do not retry together. A longer
512
- * provider Retry-After wins.
550
+ * provider Retry-After wins, up to the same 30 s ceiling a bare 429 uses: an
551
+ * unbounded header on a 5xx (an hour, a far-future date) would otherwise park
552
+ * the row, and its run's compute, for the whole wait inside one attempt.
513
553
  */
514
554
  export function providerServerErrorRetryDelayMs(input: {
515
555
  attempt: number;
@@ -524,7 +564,10 @@ export function providerServerErrorRetryDelayMs(input: {
524
564
  1 +
525
565
  ((input.random ?? Math.random)() * 2 - 1) *
526
566
  PROVIDER_SERVER_ERROR_RETRY_JITTER_RATIO;
527
- return Math.max(Math.round(base * spread), input.retryAfterMs);
567
+ return Math.max(
568
+ Math.round(base * spread),
569
+ Math.min(TOOL_EXECUTE_RATE_LIMIT_RETRY_DELAY_MAX_MS, input.retryAfterMs),
570
+ );
528
571
  }
529
572
 
530
573
  /** Exponential backoff for edge gateway failures: 1 s, 2 s, 4 s, capped. */
@@ -575,11 +618,28 @@ function isProviderServerErrorResponse(input: {
575
618
  );
576
619
  }
577
620
 
621
+ /**
622
+ * How an action classifies for a provider 5xx (see
623
+ * `retry.providerServerErrorReplay` in the provider registry). Anything but a
624
+ * declared `idempotent_key` or `read_safe` is `never`.
625
+ */
626
+ export type ProviderServerErrorReplay =
627
+ | 'idempotent_key'
628
+ | 'read_safe'
629
+ | 'never';
630
+
631
+ /** Only an explicit classification may replay; absent and unknown never do. */
632
+ export function providerServerErrorReplayAllowed(value: unknown): boolean {
633
+ return value === 'idempotent_key' || value === 'read_safe';
634
+ }
635
+
578
636
  function decideToolExecuteHttpRetry(input: {
579
637
  status: number;
580
638
  /** A 5xx the provider itself returned (failure_origin provider). */
581
639
  providerServerError?: boolean;
582
640
  retryProviderServerErrors?: boolean;
641
+ /** The action's classification; absent means `never`. */
642
+ providerServerErrorReplay?: ProviderServerErrorReplay;
583
643
  idempotencyInProgress?: boolean;
584
644
  gatewayInvocationInProgress?: boolean;
585
645
  customerDbStorageUnavailable?: boolean;
@@ -688,7 +748,8 @@ function decideToolExecuteHttpRetry(input: {
688
748
  if (
689
749
  !input.transientHttpRetrySafe &&
690
750
  input.retryProviderServerErrors === true &&
691
- input.providerServerError === true
751
+ input.providerServerError === true &&
752
+ providerServerErrorReplayAllowed(input.providerServerErrorReplay)
692
753
  ) {
693
754
  // Only successes are final: the same call is sent again with the same
694
755
  // provider idempotency key, after a backoff with jitter.
@@ -760,6 +821,7 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
760
821
  }),
761
822
  retryProviderServerErrors:
762
823
  DURABLE_RUNS_ROLLOUT.retryProviderServerErrors,
824
+ providerServerErrorReplay: input.providerServerErrorReplay,
763
825
  idempotencyInProgress: isIdempotencyInProgressResponse({
764
826
  status: input.status,
765
827
  bodyText: input.bodyText ?? '',
@@ -843,6 +905,14 @@ export function classifyToolExecuteHttpFailure(input: {
843
905
  executionFenced?: boolean;
844
906
  /** Defaults to `DURABLE_RUNS_ROLLOUT.retryProviderServerErrors`. */
845
907
  retryProviderServerErrors?: boolean;
908
+ /**
909
+ * The action's classification for a provider 5xx. Absent means `never`: a
910
+ * write, upsert, create or send, and a paid call whose 5xx is ambiguous
911
+ * after dispatch, is not replayed. The gateway previous-outcome check
912
+ * passes `idempotent_key` because it only validates the recorded outcome;
913
+ * the runner, which owns the resend, has already applied the classification.
914
+ */
915
+ providerServerErrorReplay?: ProviderServerErrorReplay;
846
916
  providerLatencyMs?: number;
847
917
  nowMs?: number;
848
918
  }): ToolExecuteHttpFailureOutcome {
@@ -870,6 +940,7 @@ export function classifyToolExecuteHttpFailure(input: {
870
940
  status: input.status,
871
941
  providerServerError,
872
942
  retryProviderServerErrors,
943
+ providerServerErrorReplay: input.providerServerErrorReplay,
873
944
  idempotencyInProgress,
874
945
  gatewayInvocationInProgress,
875
946
  customerDbStorageUnavailable,
@@ -942,6 +1013,7 @@ export function classifyToolExecuteHttpFailure(input: {
942
1013
  status: input.status,
943
1014
  providerServerError,
944
1015
  retryProviderServerErrors,
1016
+ providerServerErrorReplay: input.providerServerErrorReplay,
945
1017
  idempotencyInProgress,
946
1018
  gatewayInvocationInProgress,
947
1019
  customerDbStorageUnavailable,
@@ -1087,7 +1159,12 @@ export function classifyToolExecuteHttpFailure(input: {
1087
1159
  retryDecision.reason !== 'gateway_invocation_in_progress' &&
1088
1160
  retryDecision.reason !== 'concurrency_backpressure' &&
1089
1161
  retryDecision.reason !== 'runtime_scheduler_capacity' &&
1090
- retryDecision.reason !== 'provider_pacing_wait',
1162
+ retryDecision.reason !== 'provider_pacing_wait' &&
1163
+ // Bounded per call by its attempt cap, and each call already charges
1164
+ // the tool-call budget. The run-wide retry budget is a runaway guard
1165
+ // whose breach is run-fatal; a provider outage across a large map must
1166
+ // surface as row failures, not exhaust it and fail the whole run.
1167
+ retryDecision.reason !== 'provider_server_error',
1091
1168
  // The app reported a provider failure and asked for a retry, so it has
1092
1169
  // already released that attempt's reservation, and admission never reopens
1093
1170
  // one. BILLING_UNAVAILABLE may follow an authorization whose response was
@@ -1099,6 +1176,9 @@ export function classifyToolExecuteHttpFailure(input: {
1099
1176
  retryDecision.reason === 'provider_server_error') &&
1100
1177
  explicitRetryable === true &&
1101
1178
  providerOriginFailure,
1179
+ // Reader-first optional field: anything but a literal `true` is absence.
1180
+ billingReservationReleaseConfirmed:
1181
+ shouldRetry && failureBody?.billing_reservation_released === true,
1102
1182
  // Only explicit pre-dispatch refusals permit automatic replay of an
1103
1183
  // operation that does not declare ordinary transient retry safety.
1104
1184
  knownNotDispatched:
@@ -1467,12 +1467,7 @@ export type PlayAuthoringRunStepsOptions = {
1467
1467
  staleAfterSeconds?: DurableCallStaleAfterSeconds;
1468
1468
  };
1469
1469
 
1470
- /**
1471
- * Stable identity of the currently executing Play invocation.
1472
- *
1473
- * The id is unchanged while Deepline resumes or retries the same durable run.
1474
- * A separately submitted run intentionally receives a new id.
1475
- */
1470
+ /** Account that launched the run; see `PlayAuthoringRunScope.actor`. */
1476
1471
  export type PlayAuthoringRunActor = {
1477
1472
  readonly userId: string;
1478
1473
  readonly name: string | null;
@@ -1480,7 +1475,19 @@ export type PlayAuthoringRunActor = {
1480
1475
  };
1481
1476
 
1482
1477
  export type PlayAuthoringRunScope = {
1478
+ /**
1479
+ * This Play invocation. In a submitted run it is the run id. Inside an inline
1480
+ * `deepline.runPlay` child it is the child's composition id, which is the
1481
+ * same in every parent run that makes the same call with the same input.
1482
+ */
1483
1483
  readonly id: string;
1484
+ /**
1485
+ * The submitted run this code executes in: the run id shown on the dashboard.
1486
+ * Equal to `id` in a submitted run; inside an inline child it is the calling
1487
+ * run's id. Stable across retry and resume, new for every separately
1488
+ * submitted run. Build external idempotency keys from this value.
1489
+ */
1490
+ readonly rootId: string;
1484
1491
  /** Authenticated launching account, inherited by child Plays. Never read from inputs. */
1485
1492
  readonly actor: PlayAuthoringRunActor | null;
1486
1493
  };
@@ -1491,12 +1498,12 @@ export const PLAY_AUTHORING_DOCUMENTATION = {
1491
1498
  warning:
1492
1499
  'A static deepline.fetch key inside a loop is a warning because every iteration must still have distinct method, URL, body, or safe headers. One durable receipt must never stand in for every request.',
1493
1500
  guidance:
1494
- 'Keep the static fetch label. For a mutating batch, make the body distinct and use a replay-stable external Idempotency-Key such as `${deepline.run.id}:signals:${batchIndex}`.',
1501
+ 'Keep the static fetch label. For a mutating batch, make the body distinct and use a replay-stable external Idempotency-Key such as `${deepline.run.rootId}:signals:${batchIndex}`.',
1495
1502
  },
1496
1503
  runId: {
1497
1504
  semantics:
1498
- 'deepline.run.id is stable while Deepline retries or resumes one durable run. A separately submitted run receives a new id.',
1499
- use: 'Use it when deriving an external idempotency key for a sequence of batches.',
1505
+ 'deepline.run.rootId is the submitted run: it is stable while Deepline retries or resumes that run, and a separately submitted run receives a new one. deepline.run.id names the Play invocation; it equals rootId in a submitted run, but inside an inline deepline.runPlay child it is the child\'s composition id, which repeats in every parent run that makes the same call with the same input.',
1506
+ use: 'Build external idempotency keys from deepline.run.rootId plus whatever names the operation, such as a batch index or record id. It is correct in a submitted run and inside an inline child.',
1500
1507
  },
1501
1508
  staticCallKeys: {
1502
1509
  constraint:
@@ -3063,7 +3070,10 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
3063
3070
  resolution: 'runtime-dynamic',
3064
3071
  issueCode: 'play_authoring_durable_policy_invalid',
3065
3072
  description: 'Customer DB queries always execute with freshness 0.',
3066
- errorMessage: 'Customer DB queries must use staleAfterSeconds: 0.',
3073
+ // Must equal reusableWindowEligibility({ kind: 'customer_db_query' })
3074
+ // in ../play-runtime/tool-cache-policy (asserted by its test).
3075
+ errorMessage:
3076
+ 'customerDb.query can change data even when its SQL looks like a read, so it cannot reuse an old result. Remove staleAfterSeconds or set it to 0.',
3067
3077
  },
3068
3078
  'ctx.customerDb.query.options.maxRows': {
3069
3079
  schema: Type.Integer({ minimum: 1 }),
@@ -3519,7 +3529,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3519
3529
  ' csv<T = Record<string, unknown>>(path: string | CsvInput<T & object>, options?: CsvOptions): Promise<PlayDataset<T>>;',
3520
3530
  ' dataset<TSource extends PlayDatasetInput<object>>(key: string, items: TSource): DatasetBuilder<PlayDatasetRow<TSource> & object, PlayDatasetRow<TSource> & object>;',
3521
3531
  ' map<TSource extends PlayDatasetInput<object>>(key: string, items: TSource, options?: DatasetDefinitionOptions<PlayDatasetRow<TSource> & object>): never;',
3522
- ' readonly run: { readonly id: string; readonly actor: { readonly userId: string; readonly name: string | null; readonly email: string | null } | null };',
3532
+ ' readonly run: { readonly id: string; readonly rootId: string; readonly actor: { readonly userId: string; readonly name: string | null; readonly email: string | null } | null };',
3523
3533
  ` runSteps<TInput extends Record<string, unknown>, TOutput>(program: RunnableStepProgram<TInput, TOutput>, input: TInput, options?: { description?: ${cloudReferenceType('ctx.runSteps.options.description')}; staleAfterSeconds?: ${cloudReferenceType('ctx.runSteps.options.staleAfterSeconds')} }): Promise<TOutput>;`,
3524
3534
  ' tools: { execute<K extends string>(request: ToolExecutionRequest<K>): Promise<ToolExecutionOutput<K>> };',
3525
3535
  ` customerDb: { query<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: SqlQuery, options?: { id?: ${cloudReferenceType('ctx.customerDb.query.options.id')}; staleAfterSeconds?: ${cloudReferenceType('ctx.customerDb.query.options.staleAfterSeconds')}; maxRows?: ${cloudReferenceType('ctx.customerDb.query.options.maxRows')}; timeoutMs?: ${cloudReferenceType('ctx.customerDb.query.options.timeoutMs')} }): Promise<TRow[]> };`,
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkSMWFOGUTjs = require('./chunk-SMWFOGUT.js');
18
+ require('./chunk-GTGJBZVH.js');
19
+ require('./chunk-SF4QJVBE.js');
20
+ require('./chunk-OCT4SUJA.js');
21
+ require('./chunk-T2N3B7IQ.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-SQWET4SL.js');
24
+ require('./chunk-TZTWH53O.js');
25
+ require('./chunk-OG64RBAC.js');
26
+ require('./chunk-COGTRVWW.js');
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkSMWFOGUTjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkSMWFOGUTjs.authStatusLine; exports.clearPendingClaim = _chunkSMWFOGUTjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkSMWFOGUTjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkSMWFOGUTjs.handleRegister; exports.handleStatus = _chunkSMWFOGUTjs.handleStatus; exports.handleWait = _chunkSMWFOGUTjs.handleWait; exports.httpJson = _chunkSMWFOGUTjs.httpJson; exports.readPendingAuthClaim = _chunkSMWFOGUTjs.readPendingAuthClaim; exports.readStatusBanner = _chunkSMWFOGUTjs.readStatusBanner; exports.registerAuthCommands = _chunkSMWFOGUTjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkSMWFOGUTjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkSMWFOGUTjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkSMWFOGUTjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkSMWFOGUTjs.statusBannerLine;
@@ -14,14 +14,14 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-BONXEWYF.mjs";
18
- import "./chunk-4TUMKJZX.mjs";
19
- import "./chunk-5477PEHL.mjs";
20
- import "./chunk-FQQAAR3Q.mjs";
17
+ } from "./chunk-KSQXBLRW.mjs";
18
+ import "./chunk-3WWTBQHC.mjs";
19
+ import "./chunk-MW3YMPD2.mjs";
20
+ import "./chunk-OQ5G7RFQ.mjs";
21
21
  import "./chunk-QNHHZ63P.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-ZPGGW27Q.mjs";
24
- import "./chunk-UV6XCHOZ.mjs";
24
+ import "./chunk-RIX26ZJD.mjs";
25
25
  import "./chunk-WZYKRD7T.mjs";
26
26
  import "./chunk-KRD6H754.mjs";
27
27
  export {