deepline 0.3.530 → 0.3.531

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 (139) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +6 -0
  3. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +10 -8
  4. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +95 -9
  5. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +7 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +615 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +16 -1
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +26 -8
  9. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +27 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +317 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +129 -39
  12. package/dist/cli/{auth-LRWNDQFT.mjs → auth-33B3OEM4.mjs} +5 -5
  13. package/dist/cli/auth-3UDRBF5D.js +43 -0
  14. package/dist/cli/{billing-7T73MRYF.mjs → billing-X4OQRH6D.mjs} +7 -7
  15. package/dist/cli/{billing-5FDPWGCG.js → billing-Y2M2ABLW.js} +82 -82
  16. package/dist/cli/{chunk-5DJUNUHN.mjs → chunk-2CUPFDW5.mjs} +5 -5
  17. package/dist/cli/{chunk-V4EK7ZZX.js → chunk-2WWTIR2G.js} +98 -98
  18. package/dist/cli/{chunk-YI7QOP6L.js → chunk-3PMVNMG4.js} +16 -16
  19. package/dist/cli/{chunk-2FLODRM2.js → chunk-4M4AASO3.js} +13 -13
  20. package/dist/cli/{chunk-KUHH7RW4.js → chunk-4O7UET74.js} +44 -44
  21. package/dist/cli/{chunk-VYSQ76RP.js → chunk-4WPHK2R3.js} +7 -7
  22. package/dist/cli/{chunk-YVLPGYRS.mjs → chunk-567HD6G6.mjs} +1 -1
  23. package/dist/cli/{chunk-QWEPCX6L.mjs → chunk-57PPAYDB.mjs} +2 -2
  24. package/dist/cli/{chunk-SJQ7Z3NI.js → chunk-5M24K577.js} +132 -81
  25. package/dist/cli/{chunk-4VQ63Y6S.mjs → chunk-623FFVZU.mjs} +5 -5
  26. package/dist/cli/{chunk-QI2LKPW5.mjs → chunk-6W73VXMK.mjs} +2 -2
  27. package/dist/cli/{chunk-7E7CP5KA.js → chunk-BUK6WHY2.js} +4 -4
  28. package/dist/cli/{chunk-QQ4LNSY5.mjs → chunk-CVOFP6BU.mjs} +1 -1
  29. package/dist/cli/{chunk-4WPIORJX.js → chunk-D5BLTX5L.js} +1 -1
  30. package/dist/cli/{chunk-E6L3NEFV.js → chunk-DWYX5DFJ.js} +41 -41
  31. package/dist/cli/{chunk-K4Y6CNFV.mjs → chunk-EURLINZT.mjs} +1 -1
  32. package/dist/cli/{chunk-7FCD34YS.mjs → chunk-EVXRQXNV.mjs} +3 -2
  33. package/dist/cli/{chunk-L4QR7CYL.js → chunk-H26ZSNLX.js} +14 -14
  34. package/dist/cli/{chunk-6NG3FRJB.mjs → chunk-HYPLMUMA.mjs} +5 -5
  35. package/dist/cli/{chunk-M4Q4LEMM.js → chunk-IOOWKPF7.js} +2 -2
  36. package/dist/cli/{chunk-MHR3XVJD.js → chunk-IXOEKHOY.js} +5 -5
  37. package/dist/cli/{chunk-32NTC5UD.js → chunk-JFTO33FK.js} +7 -7
  38. package/dist/cli/{chunk-VKVLJTW5.js → chunk-L4XVL4LW.js} +9 -9
  39. package/dist/cli/{chunk-MVF7ZBJX.mjs → chunk-MGWYYTZN.mjs} +1 -1
  40. package/dist/cli/{chunk-2LKVNWRA.mjs → chunk-MYTA37IL.mjs} +10 -10
  41. package/dist/cli/{chunk-D7Y7I4EE.js → chunk-NXEQMKSM.js} +2 -2
  42. package/dist/cli/{chunk-EADHDZW2.js → chunk-O267YGUV.js} +6 -6
  43. package/dist/cli/{chunk-X547OW3I.js → chunk-O4NTPEQV.js} +16 -16
  44. package/dist/cli/{chunk-LNZILMVK.mjs → chunk-O7EFJR6Y.mjs} +4 -4
  45. package/dist/cli/{chunk-GW76IDID.js → chunk-PTKSHGUM.js} +22 -22
  46. package/dist/cli/{chunk-J6XSBTEX.mjs → chunk-PTOPMO22.mjs} +1 -1
  47. package/dist/cli/{chunk-WWLIDAVT.js → chunk-RBPCXQBE.js} +11 -11
  48. package/dist/cli/{chunk-5B37ER3C.js → chunk-RLRPEHQ3.js} +3 -3
  49. package/dist/cli/{chunk-C44RZGM5.js → chunk-RZXSCWEB.js} +26 -26
  50. package/dist/cli/{chunk-OUM2V7R6.mjs → chunk-SPODXGBZ.mjs} +6 -6
  51. package/dist/cli/{chunk-KEXGBXUG.js → chunk-TDJCNVDE.js} +5 -5
  52. package/dist/cli/{chunk-KI63L5H3.mjs → chunk-TU7HU5K2.mjs} +2 -2
  53. package/dist/cli/{chunk-HCWPX2UP.mjs → chunk-U5YBINPF.mjs} +2 -2
  54. package/dist/cli/{chunk-ERMDXXP5.mjs → chunk-UNTFERUX.mjs} +1 -1
  55. package/dist/cli/{chunk-WL6GAZBD.js → chunk-V6LUMGVI.js} +3 -2
  56. package/dist/cli/{chunk-3MAHDV5C.mjs → chunk-VGWUCBNA.mjs} +1 -1
  57. package/dist/cli/{chunk-5KX3TWBK.mjs → chunk-VHIHGMZD.mjs} +1 -1
  58. package/dist/cli/{chunk-A5MYJM4K.mjs → chunk-VWOOOU6G.mjs} +2 -2
  59. package/dist/cli/{chunk-WYI3VMTO.js → chunk-WDLY4HST.js} +6 -6
  60. package/dist/cli/{chunk-7WGMCOM6.js → chunk-WHAMLN6B.js} +2 -2
  61. package/dist/cli/{chunk-BVY4QRVT.mjs → chunk-XOXKVLJZ.mjs} +82 -31
  62. package/dist/cli/{chunk-2FLRKNME.mjs → chunk-XQGLHKDI.mjs} +2 -2
  63. package/dist/cli/{chunk-XNWS2WJG.mjs → chunk-XWQI4TMS.mjs} +1 -1
  64. package/dist/cli/{chunk-VQMGCNX2.mjs → chunk-YMGQP7WI.mjs} +5 -5
  65. package/dist/cli/{chunk-WAWOMHWO.mjs → chunk-YVOFNLGN.mjs} +2 -2
  66. package/dist/cli/{chunk-MVFKZQ7E.js → chunk-ZBL4CP75.js} +3 -3
  67. package/dist/cli/{chunk-I2YXEHDO.mjs → chunk-ZJQITGPV.mjs} +3 -3
  68. package/dist/cli/command-docs.js +2 -2
  69. package/dist/cli/command-docs.mjs +1 -1
  70. package/dist/cli/{csv-VY2S7KKV.mjs → csv-CMUWCM46.mjs} +4 -4
  71. package/dist/cli/{csv-EFIEDJA2.js → csv-N4P2XOKP.js} +13 -13
  72. package/dist/cli/{db-3DLI5TYW.js → db-GFI45WV5.js} +27 -27
  73. package/dist/cli/{db-D32CBDTN.mjs → db-J5HFGOUO.mjs} +6 -6
  74. package/dist/cli/describe-HFUWQN3A.js +50 -0
  75. package/dist/cli/{describe-6MYKK2P3.mjs → describe-NKHH3VVI.mjs} +18 -18
  76. package/dist/cli/{executions-U6TPX4RX.mjs → executions-54QEYYE6.mjs} +6 -6
  77. package/dist/cli/{executions-QG3DEEY3.js → executions-FMWHU72C.js} +8 -8
  78. package/dist/cli/{feedback-YZ6H4VMQ.mjs → feedback-HA4QUWMU.mjs} +6 -6
  79. package/dist/cli/{feedback-ZSPW6NXL.js → feedback-R7C3AZKN.js} +14 -14
  80. package/dist/cli/git-ETBABM6D.js +25 -0
  81. package/dist/cli/{git-ENN72IK4.mjs → git-OVG63PJV.mjs} +5 -5
  82. package/dist/cli/index.js +145 -145
  83. package/dist/cli/index.mjs +44 -44
  84. package/dist/cli/{legacy-noops-Q6EVYIGN.js → legacy-noops-GM2F7GMV.js} +9 -9
  85. package/dist/cli/{legacy-noops-MNA6LWJU.mjs → legacy-noops-PLQWYZ7A.mjs} +6 -6
  86. package/dist/cli/{monitors-KENWEEWC.mjs → monitors-QXK7JTRG.mjs} +7 -7
  87. package/dist/cli/{monitors-BUH54HXJ.js → monitors-SJBIPV4K.js} +100 -100
  88. package/dist/cli/{org-HWOHKYP3.mjs → org-OFMMMVYT.mjs} +6 -6
  89. package/dist/cli/{org-AHWQJMV7.js → org-XKO7BBT4.js} +86 -86
  90. package/dist/cli/{pages-I7DYTCW6.mjs → pages-NDI2K34M.mjs} +6 -6
  91. package/dist/cli/{pages-Z5R7NYEF.js → pages-ZGXRON5S.js} +18 -18
  92. package/dist/cli/{play-3LXZB4ED.js → play-2YD5NTH6.js} +317 -317
  93. package/dist/cli/{play-ET7CRVWJ.mjs → play-SMKNTBRK.mjs} +18 -18
  94. package/dist/cli/{providers-ZV2E7NGX.js → providers-52PIA36O.js} +9 -9
  95. package/dist/cli/{providers-GZSAZVHZ.mjs → providers-6SKF5W4Y.mjs} +6 -6
  96. package/dist/cli/{quickstart-VJZAT4RY.js → quickstart-4Z22WVLK.js} +6 -6
  97. package/dist/cli/{quickstart-5746NBS2.mjs → quickstart-RVA335ED.mjs} +4 -4
  98. package/dist/cli/{run-WGUAVYZC.js → run-FDTSTMDM.js} +41 -41
  99. package/dist/cli/{run-WOQ6XMTT.mjs → run-GMN4TCVV.mjs} +23 -23
  100. package/dist/cli/{search-NNPFJYEW.mjs → search-2FG2USCF.mjs} +8 -8
  101. package/dist/cli/search-63X5FPDM.js +33 -0
  102. package/dist/cli/{search-output-K4ISMPKD.js → search-output-5FKQYLFW.js} +6 -6
  103. package/dist/cli/{search-output-65HDEEFS.mjs → search-output-AC3AAV6E.mjs} +4 -4
  104. package/dist/cli/{secrets-NBKGWMF4.js → secrets-5A7AY2YU.js} +15 -15
  105. package/dist/cli/{secrets-RK44OV3X.mjs → secrets-MA4ZTNVG.mjs} +6 -6
  106. package/dist/cli/{sessions-ULQJJN3J.mjs → sessions-LBYKV5O4.mjs} +6 -6
  107. package/dist/cli/sessions-SMWWKKD4.js +22 -0
  108. package/dist/cli/{settings-V5ZRL2EF.mjs → settings-6MQVNROV.mjs} +13 -13
  109. package/dist/cli/{settings-IHNA7X3Y.js → settings-HA3D4GNZ.js} +86 -86
  110. package/dist/cli/{setup-HTEBFMOQ.js → setup-3JWTNSOK.js} +78 -63
  111. package/dist/cli/{setup-54VZPJGM.mjs → setup-BXCUZOZH.mjs} +28 -13
  112. package/dist/cli/{skills-3FCPWMHX.mjs → skills-7ASML2WZ.mjs} +8 -8
  113. package/dist/cli/skills-OJ7NZL6S.js +37 -0
  114. package/dist/cli/{tools-2NTDNUQT.mjs → tools-7IJWJXZ3.mjs} +17 -17
  115. package/dist/cli/tools-Y2VMPUSI.js +57 -0
  116. package/dist/cli/{update-25MTBTGU.mjs → update-JFKH4SVK.mjs} +10 -10
  117. package/dist/cli/update-JURCS2FE.js +35 -0
  118. package/dist/cli/{views-OBE5LUSW.mjs → views-2EURG3P5.mjs} +6 -6
  119. package/dist/cli/{views-37K4JNNS.js → views-XTAIIX2Y.js} +18 -18
  120. package/dist/cli/{workflow-HAPCL4K6.mjs → workflow-7FCQ34QD.mjs} +7 -7
  121. package/dist/cli/{workflow-6YTIHHJH.js → workflow-AXOF74HO.js} +17 -17
  122. package/dist/index.js +9 -9
  123. package/dist/index.mjs +6 -6
  124. package/dist/install-integrity.json +108 -106
  125. package/dist/release.d.mts +1 -1
  126. package/dist/release.d.ts +1 -1
  127. package/dist/release.js +2 -2
  128. package/dist/release.mjs +1 -1
  129. package/dist/server.js +5 -5
  130. package/dist/server.mjs +3 -3
  131. package/package.json +1 -1
  132. package/dist/cli/auth-QFIXECQV.js +0 -43
  133. package/dist/cli/describe-U6HM52X6.js +0 -50
  134. package/dist/cli/git-OBV73OVY.js +0 -25
  135. package/dist/cli/search-IGHNMXI4.js +0 -33
  136. package/dist/cli/sessions-ZJNV4SEL.js +0 -22
  137. package/dist/cli/skills-ZCJ6FOOK.js +0 -37
  138. package/dist/cli/tools-Q75XC2BS.js +0 -57
  139. package/dist/cli/update-3G3GO7IE.js +0 -35
@@ -89,6 +89,13 @@ export const TOOL_EXECUTE_FENCED_PRE_DISPATCH_RATE_REFUSAL_MAX_ATTEMPTS =
89
89
  (TOOL_EXECUTE_CUSTOMER_DB_STORAGE_UNAVAILABLE_MAX_ATTEMPTS - 1) -
90
90
  3 * (TOOL_EXECUTE_TRANSIENT_HTTP_MAX_ATTEMPTS - 1) +
91
91
  1;
92
+ // The billing plane could not open this call's charge, so the provider was
93
+ // never called (`billingUnavailableResponse` stamps
94
+ // `provider_request_dispatched: false`). Production saw these singly and
95
+ // intermittently (one org, 180 of 10,324 LeadMagic calls over 1.7 h on
96
+ // 2026-11-14, every one sent once and failed), so a short bounded wait
97
+ // recovers them: 1 s, 2 s, 4 s, 5 s between five sends.
98
+ export const TOOL_EXECUTE_BILLING_UNAVAILABLE_MAX_ATTEMPTS = 5;
92
99
  export const TOOL_EXECUTE_TRANSPORT_MAX_ATTEMPTS = 3;
93
100
  export const TOOL_EXECUTE_TRANSPORT_RETRY_DELAY_MS = 1_000;
94
101
  // A sandbox lost new connections for about 97 seconds on 2026-10-30, and each
@@ -283,6 +290,7 @@ export type ToolExecuteHttpRetryDecision = {
283
290
  | 'idempotency_in_progress'
284
291
  | 'gateway_invocation_in_progress'
285
292
  | 'customer_db_storage_unavailable'
293
+ | 'billing_unavailable_before_dispatch'
286
294
  | 'retry_safe_transient_5xx'
287
295
  | 'edge_gateway_transient'
288
296
  | 'unsafe_transient_5xx'
@@ -465,6 +473,25 @@ function isCustomerDbStorageUnavailableResponse(input: {
465
473
  );
466
474
  }
467
475
 
476
+ /**
477
+ * The app could not open this call's charge because the billing plane was
478
+ * unavailable, and says so before any provider dispatch. Only the explicit
479
+ * `provider_request_dispatched: false` proof qualifies: an older app's body
480
+ * lacks it and keeps its old, non-retried classification.
481
+ */
482
+ function isBillingUnavailableBeforeDispatchResponse(input: {
483
+ status: number;
484
+ bodyText: string;
485
+ }): boolean {
486
+ if (input.status !== 503) return false;
487
+ const body = parseJsonObject(input.bodyText);
488
+ return (
489
+ body?.code === 'BILLING_UNAVAILABLE' &&
490
+ body.failure_origin === 'deepline_billing' &&
491
+ body.provider_request_dispatched === false
492
+ );
493
+ }
494
+
468
495
  function isConcurrencyBackpressureResponse(input: {
469
496
  status: number;
470
497
  bodyText: string;
@@ -592,6 +619,31 @@ export function providerServerErrorRetryDelayMs(input: {
592
619
  );
593
620
  }
594
621
 
622
+ /**
623
+ * Backoff after the billing plane could not open a charge: 1 s, 2 s, 4 s, then
624
+ * 5 s, each with ±20% jitter so rows refused together during a billing outage
625
+ * do not resend together, or the app's Retry-After when it is longer, never
626
+ * above 5 s.
627
+ */
628
+ export function billingUnavailableRetryDelayMs(input: {
629
+ attempt: number;
630
+ retryAfterMs: number;
631
+ random?: () => number;
632
+ }): number {
633
+ const base = Math.min(
634
+ TOOL_EXECUTE_RETRY_DELAY_MAX_MS,
635
+ TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * 2 ** Math.max(0, input.attempt - 1),
636
+ );
637
+ const spread =
638
+ 1 +
639
+ ((input.random ?? Math.random)() * 2 - 1) *
640
+ PROVIDER_SERVER_ERROR_RETRY_JITTER_RATIO;
641
+ return Math.min(
642
+ TOOL_EXECUTE_RETRY_DELAY_MAX_MS,
643
+ Math.max(input.retryAfterMs, Math.round(base * spread)),
644
+ );
645
+ }
646
+
595
647
  /** Exponential backoff for edge gateway failures: 1 s, 2 s, 4 s, capped. */
596
648
  function edgeGatewayRetryDelayMs(attempt: number): number {
597
649
  return Math.min(
@@ -665,6 +717,8 @@ function decideToolExecuteHttpRetry(input: {
665
717
  idempotencyInProgress?: boolean;
666
718
  gatewayInvocationInProgress?: boolean;
667
719
  customerDbStorageUnavailable?: boolean;
720
+ /** `isBillingUnavailableBeforeDispatchResponse`. */
721
+ billingUnavailableBeforeDispatch?: boolean;
668
722
  concurrencyBackpressure?: boolean;
669
723
  runtimeSchedulerCapacity?: boolean;
670
724
  providerPacingWait?: boolean;
@@ -758,6 +812,20 @@ function decideToolExecuteHttpRetry(input: {
758
812
  reason: 'customer_db_storage_unavailable',
759
813
  };
760
814
  }
815
+ // Nothing was sent to the provider, so a resend cannot repeat an effect.
816
+ // A fenced call stays out: each fenced resend opens a new gateway logical
817
+ // attempt, and a gateway built before this reason would refuse it as a
818
+ // conflict instead of the plain row failure it reports today.
819
+ if (
820
+ input.billingUnavailableBeforeDispatch &&
821
+ input.executionFenced !== true
822
+ ) {
823
+ return {
824
+ retryable: true,
825
+ attemptCap: TOOL_EXECUTE_BILLING_UNAVAILABLE_MAX_ATTEMPTS,
826
+ reason: 'billing_unavailable_before_dispatch',
827
+ };
828
+ }
761
829
  if (input.status >= 500 && input.status < 600) {
762
830
  if (input.explicitRetryable === false) {
763
831
  return {
@@ -841,6 +909,7 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
841
909
  idempotency_in_progress: 0,
842
910
  gateway_invocation_in_progress: 0,
843
911
  customer_db_storage_unavailable: 0,
912
+ billing_unavailable_before_dispatch: 0,
844
913
  retry_safe_transient_5xx: 0,
845
914
  edge_gateway_transient: 0,
846
915
  unsafe_transient_5xx: 0,
@@ -873,6 +942,11 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
873
942
  status: input.status,
874
943
  bodyText: input.bodyText ?? '',
875
944
  }),
945
+ billingUnavailableBeforeDispatch:
946
+ isBillingUnavailableBeforeDispatchResponse({
947
+ status: input.status,
948
+ bodyText: input.bodyText ?? '',
949
+ }),
876
950
  concurrencyBackpressure: isConcurrencyBackpressureResponse({
877
951
  status: input.status,
878
952
  bodyText: input.bodyText ?? '',
@@ -963,6 +1037,8 @@ export function classifyToolExecuteHttpFailure(input: {
963
1037
  isGatewayInvocationInProgressResponse(input);
964
1038
  const customerDbStorageUnavailable =
965
1039
  isCustomerDbStorageUnavailableResponse(input);
1040
+ const billingUnavailableBeforeDispatch =
1041
+ isBillingUnavailableBeforeDispatchResponse(input);
966
1042
  const concurrencyBackpressure = isConcurrencyBackpressureResponse(input);
967
1043
  const runtimeSchedulerCapacity = isRuntimeSchedulerCapacityResponse(input);
968
1044
  const providerPacingWait = isProviderPacingWaitResponse(input);
@@ -982,6 +1058,7 @@ export function classifyToolExecuteHttpFailure(input: {
982
1058
  idempotencyInProgress,
983
1059
  gatewayInvocationInProgress,
984
1060
  customerDbStorageUnavailable,
1061
+ billingUnavailableBeforeDispatch,
985
1062
  concurrencyBackpressure,
986
1063
  runtimeSchedulerCapacity,
987
1064
  providerPacingWait,
@@ -1056,6 +1133,7 @@ export function classifyToolExecuteHttpFailure(input: {
1056
1133
  idempotencyInProgress,
1057
1134
  gatewayInvocationInProgress,
1058
1135
  customerDbStorageUnavailable,
1136
+ billingUnavailableBeforeDispatch,
1059
1137
  concurrencyBackpressure,
1060
1138
  runtimeSchedulerCapacity,
1061
1139
  providerPacingWait,
@@ -1125,49 +1203,58 @@ export function classifyToolExecuteHttpFailure(input: {
1125
1203
  TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
1126
1204
  ),
1127
1205
  )
1128
- : retryDecision.reason === 'runtime_scheduler_capacity'
1129
- ? Math.min(
1130
- TOOL_EXECUTE_RETRY_DELAY_MAX_MS,
1131
- Math.max(retryAfterMs, TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS),
1132
- )
1133
- : retryDecision.reason === 'provider_pacing_wait'
1134
- ? retryAfterMs
1135
- : input.status === 429
1136
- ? hasRetryAfterHeader
1137
- ? providerOwnedRateLimit
1138
- ? // The provider's explicit deadline is authoritative. Attempt-
1139
- // scaled fallback backoff is only for a bare 429; extending a
1140
- // valid Retry-After by the attempt number needlessly idles this
1141
- // row after the shared provider pacer has already enforced the
1142
- // deadline for every caller using the credential.
1143
- retryAfterMs
1144
- : Math.max(
1145
- retryAfterMs,
1146
- TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
1206
+ : retryDecision.reason === 'billing_unavailable_before_dispatch'
1207
+ ? billingUnavailableRetryDelayMs({
1208
+ attempt: input.attempt,
1209
+ retryAfterMs,
1210
+ })
1211
+ : retryDecision.reason === 'runtime_scheduler_capacity'
1212
+ ? Math.min(
1213
+ TOOL_EXECUTE_RETRY_DELAY_MAX_MS,
1214
+ Math.max(retryAfterMs, TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS),
1215
+ )
1216
+ : retryDecision.reason === 'provider_pacing_wait'
1217
+ ? retryAfterMs
1218
+ : input.status === 429
1219
+ ? hasRetryAfterHeader
1220
+ ? providerOwnedRateLimit
1221
+ ? // The provider's explicit deadline is authoritative. Attempt-
1222
+ // scaled fallback backoff is only for a bare 429; extending a
1223
+ // valid Retry-After by the attempt number needlessly idles this
1224
+ // row after the shared provider pacer has already enforced the
1225
+ // deadline for every caller using the credential.
1226
+ retryAfterMs
1227
+ : Math.max(
1228
+ retryAfterMs,
1229
+ TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
1230
+ )
1231
+ : Math.min(
1232
+ TOOL_EXECUTE_RATE_LIMIT_RETRY_DELAY_MAX_MS,
1233
+ Math.max(
1234
+ retryAfterMs,
1235
+ TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
1236
+ ),
1147
1237
  )
1148
- : Math.min(
1149
- TOOL_EXECUTE_RATE_LIMIT_RETRY_DELAY_MAX_MS,
1150
- Math.max(
1238
+ : retryDecision.reason === 'provider_server_error'
1239
+ ? providerServerErrorRetryDelayMs({
1240
+ attempt: input.attempt,
1151
1241
  retryAfterMs,
1152
- TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
1153
- ),
1154
- )
1155
- : retryDecision.reason === 'provider_server_error'
1156
- ? providerServerErrorRetryDelayMs({
1157
- attempt: input.attempt,
1158
- retryAfterMs,
1159
- })
1160
- : retryDecision.reason === 'edge_gateway_transient'
1161
- ? edgeGatewayRetryDelayMs(input.attempt)
1162
- : retryDecision.reason === 'idempotency_in_progress' &&
1163
- !hasRetryAfterHeader
1164
- ? idempotencyInProgressRetryDelayMs(input.attempt)
1165
- : retryDecision.reason === 'gateway_invocation_in_progress' &&
1242
+ })
1243
+ : retryDecision.reason === 'edge_gateway_transient'
1244
+ ? edgeGatewayRetryDelayMs(input.attempt)
1245
+ : retryDecision.reason === 'idempotency_in_progress' &&
1166
1246
  !hasRetryAfterHeader
1167
1247
  ? idempotencyInProgressRetryDelayMs(input.attempt)
1168
- : retryAfterMs > 0
1169
- ? Math.min(TOOL_EXECUTE_RETRY_DELAY_MAX_MS, retryAfterMs)
1170
- : TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS;
1248
+ : retryDecision.reason ===
1249
+ 'gateway_invocation_in_progress' &&
1250
+ !hasRetryAfterHeader
1251
+ ? idempotencyInProgressRetryDelayMs(input.attempt)
1252
+ : retryAfterMs > 0
1253
+ ? Math.min(
1254
+ TOOL_EXECUTE_RETRY_DELAY_MAX_MS,
1255
+ retryAfterMs,
1256
+ )
1257
+ : TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS;
1171
1258
  return {
1172
1259
  ...retryDecision,
1173
1260
  ...(acceptedOperationNeedsRecovery
@@ -1200,6 +1287,8 @@ export function classifyToolExecuteHttpFailure(input: {
1200
1287
  retryDecision.reason !== 'concurrency_backpressure' &&
1201
1288
  retryDecision.reason !== 'runtime_scheduler_capacity' &&
1202
1289
  retryDecision.reason !== 'provider_pacing_wait' &&
1290
+ // Billing refused before dispatch: a wait, not a failed provider call.
1291
+ retryDecision.reason !== 'billing_unavailable_before_dispatch' &&
1203
1292
  // Bounded per call by its attempt cap, and each call already charges
1204
1293
  // the tool-call budget. The run-wide retry budget is a runaway guard
1205
1294
  // whose breach is run-fatal; a provider outage across a large map must
@@ -1224,6 +1313,7 @@ export function classifyToolExecuteHttpFailure(input: {
1224
1313
  // Only explicit pre-dispatch refusals permit automatic replay of an
1225
1314
  // operation that does not declare ordinary transient retry safety.
1226
1315
  knownNotDispatched:
1316
+ retryDecision.reason === 'billing_unavailable_before_dispatch' ||
1227
1317
  runtimeSchedulerCapacity ||
1228
1318
  concurrencyBackpressure ||
1229
1319
  providerPacingWait ||
@@ -14,14 +14,14 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-BVY4QRVT.mjs";
18
- import "./chunk-A5MYJM4K.mjs";
19
- import "./chunk-ERMDXXP5.mjs";
20
- import "./chunk-MVF7ZBJX.mjs";
17
+ } from "./chunk-XOXKVLJZ.mjs";
18
+ import "./chunk-VWOOOU6G.mjs";
19
+ import "./chunk-UNTFERUX.mjs";
20
+ import "./chunk-MGWYYTZN.mjs";
21
21
  import "./chunk-QNHHZ63P.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-ZPGGW27Q.mjs";
24
- import "./chunk-J6XSBTEX.mjs";
24
+ import "./chunk-PTOPMO22.mjs";
25
25
  import "./chunk-WZYKRD7T.mjs";
26
26
  import "./chunk-KRD6H754.mjs";
27
27
  export {
@@ -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 _chunk5M24K577js = require('./chunk-5M24K577.js');
18
+ require('./chunk-JFTO33FK.js');
19
+ require('./chunk-RLRPEHQ3.js');
20
+ require('./chunk-BUK6WHY2.js');
21
+ require('./chunk-T2N3B7IQ.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-SQWET4SL.js');
24
+ require('./chunk-D5BLTX5L.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 = _chunk5M24K577js.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk5M24K577js.authStatusLine; exports.clearPendingClaim = _chunk5M24K577js.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk5M24K577js.clearSatisfiedPendingClaim; exports.handleRegister = _chunk5M24K577js.handleRegister; exports.handleStatus = _chunk5M24K577js.handleStatus; exports.handleWait = _chunk5M24K577js.handleWait; exports.httpJson = _chunk5M24K577js.httpJson; exports.readPendingAuthClaim = _chunk5M24K577js.readPendingAuthClaim; exports.readStatusBanner = _chunk5M24K577js.readStatusBanner; exports.registerAuthCommands = _chunk5M24K577js.registerAuthCommands; exports.reportApprovalLinkShown = _chunk5M24K577js.reportApprovalLinkShown; exports.reportSetupCompleted = _chunk5M24K577js.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk5M24K577js.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk5M24K577js.statusBannerLine;
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-QWEPCX6L.mjs";
3
+ } from "./chunk-57PPAYDB.mjs";
4
4
  import {
5
5
  iterateCursorPages,
6
6
  requireBillingIdempotencyKey
7
- } from "./chunk-YVLPGYRS.mjs";
7
+ } from "./chunk-567HD6G6.mjs";
8
8
  import "./chunk-L2VKAASU.mjs";
9
9
  import "./chunk-FKD3KL5Q.mjs";
10
10
  import "./chunk-PSX3WHIH.mjs";
11
11
  import "./chunk-UBKA33KY.mjs";
12
12
  import {
13
13
  PLAY_RUNTIME_PRICING_NOTE
14
- } from "./chunk-7FCD34YS.mjs";
14
+ } from "./chunk-EVXRQXNV.mjs";
15
15
  import "./chunk-5LUF4LAR.mjs";
16
16
  import {
17
17
  PLAY_SANDBOX_SIZE_INPUTS
@@ -22,9 +22,9 @@ import {
22
22
  openInBrowser,
23
23
  printCommandEnvelope,
24
24
  shouldEmitJson
25
- } from "./chunk-A5MYJM4K.mjs";
26
- import "./chunk-ERMDXXP5.mjs";
27
- import "./chunk-MVF7ZBJX.mjs";
25
+ } from "./chunk-VWOOOU6G.mjs";
26
+ import "./chunk-UNTFERUX.mjs";
27
+ import "./chunk-MGWYYTZN.mjs";
28
28
  import {
29
29
  AuthError,
30
30
  ConfigError
@@ -33,7 +33,7 @@ import "./chunk-DLIRSHV6.mjs";
33
33
  import {
34
34
  DeeplineError
35
35
  } from "./chunk-ZPGGW27Q.mjs";
36
- import "./chunk-J6XSBTEX.mjs";
36
+ import "./chunk-PTOPMO22.mjs";
37
37
  import "./chunk-WZYKRD7T.mjs";
38
38
  import "./chunk-KRD6H754.mjs";
39
39