deepline 0.3.346 → 0.3.348

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 (125) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +5 -0
  2. package/dist/bundling-sources/sdk/src/http.ts +14 -0
  3. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/tool-calls.ts +78 -17
  6. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +29 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +32 -1
  8. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +17 -1
  9. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +18 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +9 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +11 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +6 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
  14. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +13 -0
  15. package/dist/cli/{auth-HTWHQNMY.mjs → auth-ME53BGXD.mjs} +4 -4
  16. package/dist/cli/auth-YHS2NN4I.js +31 -0
  17. package/dist/cli/{billing-X56CVZWC.mjs → billing-466LUN65.mjs} +31 -4
  18. package/dist/cli/{billing-4DCHVGO5.js → billing-EMRJAWNG.js} +99 -72
  19. package/dist/cli/{chunk-MOVEHSNM.mjs → chunk-2G7KMDDI.mjs} +1 -1
  20. package/dist/cli/{chunk-T7EVEXHS.js → chunk-2JRKH263.js} +15 -15
  21. package/dist/cli/{chunk-KQCTQGUU.mjs → chunk-35PLGSH6.mjs} +52 -16
  22. package/dist/cli/{chunk-EJ2NVO5K.js → chunk-4JJN7BDI.js} +48 -48
  23. package/dist/cli/{chunk-2GRMXCLZ.mjs → chunk-5AZNXX2S.mjs} +1 -1
  24. package/dist/cli/{chunk-L2R72RQJ.js → chunk-5HLM2PGK.js} +8 -8
  25. package/dist/cli/{chunk-5NNSJTJ3.js → chunk-5IYFQJHX.js} +280 -244
  26. package/dist/cli/{chunk-FKKNYKDY.js → chunk-5O4B6AUN.js} +2 -0
  27. package/dist/cli/{chunk-XAM3XOUA.mjs → chunk-5UWZ52IW.mjs} +2 -2
  28. package/dist/cli/{chunk-2RJ7RMRM.js → chunk-6NM2IY4B.js} +8 -8
  29. package/dist/cli/{chunk-NTVTZAVZ.mjs → chunk-7E66A24V.mjs} +2 -0
  30. package/dist/cli/{chunk-3GLIYDIF.mjs → chunk-BAJXRIRP.mjs} +2 -2
  31. package/dist/cli/{chunk-62TKYGY6.mjs → chunk-CA7RR4UD.mjs} +3 -3
  32. package/dist/cli/{chunk-O4SXVVNQ.mjs → chunk-CEC3BXRV.mjs} +1 -1
  33. package/dist/cli/{chunk-IIOBMOMH.mjs → chunk-DSWSEHRX.mjs} +1 -1
  34. package/dist/cli/{chunk-4Q572AVS.js → chunk-EWYHXSV4.js} +6 -6
  35. package/dist/cli/{chunk-22GXXUTB.js → chunk-GVJPI7MB.js} +33 -27
  36. package/dist/cli/{chunk-SGBSQHXS.js → chunk-IICCYB57.js} +64 -62
  37. package/dist/cli/{chunk-5QG2UAYH.js → chunk-KGKPHGDT.js} +2 -2
  38. package/dist/cli/{chunk-GCBLVWDQ.mjs → chunk-L645OZEB.mjs} +17 -8
  39. package/dist/cli/{chunk-ZR4EHO62.mjs → chunk-MM6X5ADB.mjs} +2 -2
  40. package/dist/cli/{chunk-AFNEQ43J.js → chunk-MX53GIOB.js} +40 -1
  41. package/dist/cli/{chunk-YUKZHAFW.js → chunk-NX4WJO5P.js} +26 -26
  42. package/dist/cli/{chunk-GGSLHWTB.js → chunk-PQZURAHR.js} +1 -1
  43. package/dist/cli/{chunk-WKZTHHJI.mjs → chunk-Q37KLZXK.mjs} +10 -8
  44. package/dist/cli/{chunk-OJVAVQLB.js → chunk-QGKPTBRR.js} +3 -3
  45. package/dist/cli/{chunk-ZEUFYRUR.js → chunk-SIE7MILM.js} +257 -248
  46. package/dist/cli/{chunk-YEKAGC52.js → chunk-U5U2DJ3A.js} +60 -60
  47. package/dist/cli/{chunk-NVNHV73C.mjs → chunk-UCVFMPAO.mjs} +2 -2
  48. package/dist/cli/{chunk-VC7M2QR7.mjs → chunk-VWSEZMCR.mjs} +7 -1
  49. package/dist/cli/{chunk-P4IKGWYF.mjs → chunk-XVWOERRO.mjs} +4 -4
  50. package/dist/cli/{chunk-JOA6IKDE.mjs → chunk-Z6B4UPM4.mjs} +39 -0
  51. package/dist/cli/client-F47WSZBF.js +20 -0
  52. package/dist/cli/{client-C2KUT452.mjs → client-K3EFOESB.mjs} +3 -3
  53. package/dist/cli/{csv-3TAA2MTR.js → csv-4UFHUMIR.js} +12 -12
  54. package/dist/cli/{csv-SLACAH4F.mjs → csv-ZFH725GM.mjs} +3 -3
  55. package/dist/cli/{db-BT6Q3FE6.js → db-EJHH7IBM.js} +29 -29
  56. package/dist/cli/{db-IN4I6KJ5.mjs → db-KTJSJ6LJ.mjs} +4 -4
  57. package/dist/cli/{describe-EDXTYMOF.mjs → describe-2GXTRRSJ.mjs} +11 -11
  58. package/dist/cli/{describe-FJZXYKFH.js → describe-ZQXDXWKZ.js} +27 -27
  59. package/dist/cli/{executions-YYQC2TVR.js → executions-FEBZXTAI.js} +6 -6
  60. package/dist/cli/{executions-X36QA5NY.mjs → executions-ZFEW2R3V.mjs} +4 -4
  61. package/dist/cli/{feedback-KTEPHZ4S.mjs → feedback-BYMYIBHU.mjs} +3 -3
  62. package/dist/cli/{feedback-BS3S46O3.js → feedback-F3LKI327.js} +7 -7
  63. package/dist/cli/{git-3ZVYB63W.mjs → git-A3V2AKGA.mjs} +4 -4
  64. package/dist/cli/git-PWHYGNBR.js +23 -0
  65. package/dist/cli/index.js +79 -79
  66. package/dist/cli/index.mjs +31 -31
  67. package/dist/cli/{legacy-noops-VVBJXM2K.mjs → legacy-noops-IMOMP5NH.mjs} +4 -4
  68. package/dist/cli/{legacy-noops-V5R7ITER.js → legacy-noops-TYXWVLSD.js} +7 -7
  69. package/dist/cli/{monitors-J6XDE76B.js → monitors-BG2EP4M2.js} +85 -85
  70. package/dist/cli/{monitors-KYTMBNUQ.mjs → monitors-PJWHKJAG.mjs} +4 -4
  71. package/dist/cli/{org-RGABGQKP.mjs → org-CVCRHGQF.mjs} +4 -4
  72. package/dist/cli/{org-MHF2NGDV.js → org-NM7EROYH.js} +60 -60
  73. package/dist/cli/{play-UII4SSA7.mjs → play-ESB6ZDMP.mjs} +10 -10
  74. package/dist/cli/play-MYWKV6MH.js +153 -0
  75. package/dist/cli/{providers-LQOSKPUH.mjs → providers-BPDX7QBF.mjs} +4 -4
  76. package/dist/cli/{providers-3GDMD7T6.js → providers-EXITLSJG.js} +7 -7
  77. package/dist/cli/{quickstart-R34Z7EMU.js → quickstart-55MBPFRI.js} +5 -5
  78. package/dist/cli/{quickstart-GAMYLCLJ.mjs → quickstart-P5HLSTZB.mjs} +3 -3
  79. package/dist/cli/search-2JFDCWWK.js +26 -0
  80. package/dist/cli/{search-AOOMDVF5.mjs → search-UJ3KOFZV.mjs} +5 -5
  81. package/dist/cli/{secrets-T4XXIASK.js → secrets-TLV2Q4Z5.js} +13 -13
  82. package/dist/cli/{secrets-U7YGLUSX.mjs → secrets-XJCZM2M2.mjs} +4 -4
  83. package/dist/cli/{sessions-VPXR4DSZ.mjs → sessions-4XMG3DEE.mjs} +4 -4
  84. package/dist/cli/{sessions-JQGKWKJS.js → sessions-DJWLUVXM.js} +5 -5
  85. package/dist/cli/{settings-LP55G43L.mjs → settings-3ZGLOANJ.mjs} +7 -7
  86. package/dist/cli/{settings-LXF45R7X.js → settings-KBNCPN3E.js} +74 -74
  87. package/dist/cli/{setup-36QA4JI3.mjs → setup-R3UV4ZXN.mjs} +6 -6
  88. package/dist/cli/{setup-MA2GLU4N.js → setup-WZZXC7H5.js} +41 -41
  89. package/dist/cli/{skills-HB6PARLZ.mjs → skills-44RXNHZH.mjs} +4 -4
  90. package/dist/cli/skills-52WTBX7A.js +28 -0
  91. package/dist/cli/tools-4ESTBMSN.js +40 -0
  92. package/dist/cli/{tools-E7K7R4AO.mjs → tools-NLUPNYR3.mjs} +8 -8
  93. package/dist/cli/{update-IT63P3NV.mjs → update-57GQJRXF.mjs} +6 -6
  94. package/dist/cli/update-V2FZCYNP.js +28 -0
  95. package/dist/cli/{workflow-UO3PMX7R.mjs → workflow-ARCLSKBC.mjs} +5 -5
  96. package/dist/cli/{workflow-SJHASZ5C.js → workflow-XI7LZRTQ.js} +15 -15
  97. package/dist/{client-DW3zASj8.d.ts → client-4DbE-U6e.d.ts} +9 -1
  98. package/dist/{client-BHReRdWK.d.mts → client-DIJpwhl-.d.mts} +9 -1
  99. package/dist/{compiler-manifest-CButyeZ8.d.mts → compiler-manifest-DgdW0q0b.d.mts} +42 -1
  100. package/dist/{compiler-manifest-CButyeZ8.d.ts → compiler-manifest-DgdW0q0b.d.ts} +42 -1
  101. package/dist/{index-BMsNUoL5.d.mts → index-C3nQQTI-.d.mts} +1 -1
  102. package/dist/{index-LDRzwo09.d.ts → index-CEYQAfS0.d.ts} +1 -1
  103. package/dist/index.d.mts +6 -6
  104. package/dist/index.d.ts +6 -6
  105. package/dist/index.js +7 -7
  106. package/dist/index.mjs +4 -4
  107. package/dist/install-integrity.json +87 -86
  108. package/dist/plays/bundle-play-file.d.mts +3 -3
  109. package/dist/plays/bundle-play-file.d.ts +3 -3
  110. package/dist/plays/bundle-play-file.mjs +2 -2
  111. package/dist/plays/run-request.d.mts +2 -2
  112. package/dist/plays/run-request.d.ts +2 -2
  113. package/dist/release.d.mts +1 -1
  114. package/dist/release.d.ts +1 -1
  115. package/dist/release.js +2 -2
  116. package/dist/release.mjs +1 -1
  117. package/package.json +1 -1
  118. package/dist/cli/auth-5YTC2XH2.js +0 -31
  119. package/dist/cli/client-4RKYHB7Z.js +0 -20
  120. package/dist/cli/git-ZHAD5TJN.js +0 -23
  121. package/dist/cli/play-ZWAH3U44.js +0 -153
  122. package/dist/cli/search-FVB7ZNCO.js +0 -26
  123. package/dist/cli/skills-GUWC4FV7.js +0 -28
  124. package/dist/cli/tools-T5WIAD5Z.js +0 -40
  125. package/dist/cli/update-QY6RY3A6.js +0 -28
@@ -15,7 +15,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
15
15
 
16
16
 
17
17
 
18
- var _chunk22GXXUTBjs = require('./chunk-22GXXUTB.js');
18
+ var _chunkGVJPI7MBjs = require('./chunk-GVJPI7MB.js');
19
19
 
20
20
 
21
21
 
@@ -167,7 +167,7 @@ async function queryCustomerDatabase(http, input) {
167
167
  if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (_optionalChain([error, 'access', _2 => _2.code, 'optionalAccess', _3 => _3.startsWith, 'call', _4 => _4("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
168
168
  // lost connections and explicitly unknown transaction resolution.
169
169
  /^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
170
- throw new (0, _chunk22GXXUTBjs.CustomerDbQueryOutcomeUnknownError)(
170
+ throw new (0, _chunkGVJPI7MBjs.CustomerDbQueryOutcomeUnknownError)(
171
171
  error,
172
172
  plan.request.body.operation_key
173
173
  );
@@ -175,7 +175,7 @@ async function queryCustomerDatabase(http, input) {
175
175
  throw error;
176
176
  }
177
177
  if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
178
- throw new (0, _chunk22GXXUTBjs.CustomerDbQueryOutcomeUnknownError)(
178
+ throw new (0, _chunkGVJPI7MBjs.CustomerDbQueryOutcomeUnknownError)(
179
179
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
180
180
  "The SQL response did not contain a valid result.",
181
181
  200,
@@ -186,7 +186,7 @@ async function queryCustomerDatabase(http, input) {
186
186
  }
187
187
  const operation = result.operation;
188
188
  if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
189
- throw new (0, _chunk22GXXUTBjs.CustomerDbQueryOutcomeUnknownError)(
189
+ throw new (0, _chunkGVJPI7MBjs.CustomerDbQueryOutcomeUnknownError)(
190
190
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
191
191
  "The server did not confirm the original atomic SQL operation.",
192
192
  200,
@@ -477,25 +477,59 @@ var ToolCalls = class {
477
477
  ..._optionalChain([options, 'optionalAccess', _19 => _19.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
478
478
  ..._optionalChain([options, 'optionalAccess', _20 => _20.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
479
479
  };
480
- const request = (requestTimeoutMs) => this.http.post(
481
- `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
482
- {
483
- payload: inputSnapshot,
484
- ...metadataSnapshot ? { metadata: metadataSnapshot } : {}
485
- },
486
- headers,
487
- {
488
- timeout: requestTimeoutMs,
489
- maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.maxRetries]), () => ( 0)),
490
- retryApiErrors: _optionalChain([options, 'optionalAccess', _22 => _22.retryApiErrors]) === true,
491
- exactUrlOnly: true,
492
- toolId,
493
- idempotencyKey
480
+ let lastResponse = null;
481
+ const observeTerminal = (failure) => {
482
+ if (!lastResponse) return;
483
+ if (failure) {
484
+ const { error } = failure;
485
+ if (isRecoverableExecutionAttemptError(error) || !(error instanceof _chunk7P5AA3SNjs.DeeplineError) || error.statusCode === void 0 || error.statusCode !== lastResponse.httpStatus || error.code === "EXECUTION_OUTCOME_UNKNOWN")
486
+ return;
494
487
  }
495
- );
488
+ const body = lastResponse.body;
489
+ const recovery = getExecutionRecoveryState(body);
490
+ if (recovery === "running" || recovery === "outcome_unknown") return;
491
+ const state = isRecord(body) ? body.status : null;
492
+ const terminal = state === "completed" || state === "failed" || state === "cancelled" ? state : state === "canceled" ? "cancelled" : failure ? "failed" : null;
493
+ if (terminal)
494
+ _optionalChain([options, 'optionalAccess', _21 => _21.onResponseReceived, 'optionalCall', _22 => _22({
495
+ receivedAtMs: lastResponse.receivedAtMs,
496
+ httpStatus: lastResponse.httpStatus,
497
+ state: terminal
498
+ })]);
499
+ };
500
+ const request = async (requestTimeoutMs) => {
501
+ lastResponse = null;
502
+ try {
503
+ return await this.http.post(
504
+ `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
505
+ {
506
+ payload: inputSnapshot,
507
+ ...metadataSnapshot ? { metadata: metadataSnapshot } : {}
508
+ },
509
+ headers,
510
+ {
511
+ timeout: requestTimeoutMs,
512
+ maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _23 => _23.maxRetries]), () => ( 0)),
513
+ retryApiErrors: _optionalChain([options, 'optionalAccess', _24 => _24.retryApiErrors]) === true,
514
+ exactUrlOnly: true,
515
+ toolId,
516
+ idempotencyKey,
517
+ onResponse: () => {
518
+ lastResponse = null;
519
+ },
520
+ onResponseBody: (observation) => {
521
+ lastResponse = observation;
522
+ }
523
+ }
524
+ );
525
+ } catch (error) {
526
+ observeTerminal({ error });
527
+ throw error;
528
+ }
529
+ };
496
530
  let response;
497
531
  let recoveryDeadline = null;
498
- const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _23 => _23.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
532
+ const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _25 => _25.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
499
533
  let retryDelayMs = 1e3;
500
534
  const recoveryTimeoutError = () => executionRecoveryError({
501
535
  toolId,
@@ -523,7 +557,7 @@ var ToolCalls = class {
523
557
  this.defaultRequestTimeoutMs,
524
558
  remainingMs
525
559
  ),
526
- _optionalChain([options, 'optionalAccess', _24 => _24.cliInvocationId])
560
+ _optionalChain([options, 'optionalAccess', _26 => _26.cliInvocationId])
527
561
  );
528
562
  } catch (error) {
529
563
  if (!isRecoverableExecutionLookupError(error)) throw error;
@@ -587,6 +621,7 @@ var ToolCalls = class {
587
621
  });
588
622
  }
589
623
  }
624
+ observeTerminal();
590
625
  const materialized = materializeToolExecutionResponse(response);
591
626
  return idempotencyKey ? { ...materialized, idempotencyKey } : materialized;
592
627
  }
@@ -1762,10 +1797,10 @@ function getStepStatusSignature(snapshot) {
1762
1797
  _nullishCoalesce(state.artifactTableNamespace, () => ( "")),
1763
1798
  _nullishCoalesce(state.startedAt, () => ( "")),
1764
1799
  _nullishCoalesce(state.completedAt, () => ( "")),
1765
- _nullishCoalesce(_optionalChain([state, 'access', _25 => _25.progress, 'optionalAccess', _26 => _26.startedAt]), () => ( "")),
1766
- _nullishCoalesce(_optionalChain([state, 'access', _27 => _27.progress, 'optionalAccess', _28 => _28.completedAt]), () => ( "")),
1800
+ _nullishCoalesce(_optionalChain([state, 'access', _27 => _27.progress, 'optionalAccess', _28 => _28.startedAt]), () => ( "")),
1801
+ _nullishCoalesce(_optionalChain([state, 'access', _29 => _29.progress, 'optionalAccess', _30 => _30.completedAt]), () => ( "")),
1767
1802
  _nullishCoalesce(state.updatedAt, () => ( "")),
1768
- _nullishCoalesce(_optionalChain([state, 'access', _29 => _29.progress, 'optionalAccess', _30 => _30.updatedAt]), () => ( ""))
1803
+ _nullishCoalesce(_optionalChain([state, 'access', _31 => _31.progress, 'optionalAccess', _32 => _32.updatedAt]), () => ( ""))
1769
1804
  ].join(":")
1770
1805
  ).join("|");
1771
1806
  }
@@ -1774,11 +1809,11 @@ function getStepProgressSignature(snapshot) {
1774
1809
  snapshot.nodeStates.map((state) => [
1775
1810
  state.nodeId,
1776
1811
  projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
1777
- _nullishCoalesce(_optionalChain([state, 'access', _31 => _31.progress, 'optionalAccess', _32 => _32.artifactTableNamespace]), () => ( "")),
1778
- _nullishCoalesce(_optionalChain([state, 'access', _33 => _33.progress, 'optionalAccess', _34 => _34.startedAt]), () => ( "")),
1779
- _nullishCoalesce(_optionalChain([state, 'access', _35 => _35.progress, 'optionalAccess', _36 => _36.completedAt]), () => ( "")),
1780
- _nullishCoalesce(_optionalChain([state, 'access', _37 => _37.progress, 'optionalAccess', _38 => _38.updatedAt]), () => ( "")),
1781
- _nullishCoalesce(_optionalChain([state, 'access', _39 => _39.progress, 'optionalAccess', _40 => _40.message]), () => ( ""))
1812
+ _nullishCoalesce(_optionalChain([state, 'access', _33 => _33.progress, 'optionalAccess', _34 => _34.artifactTableNamespace]), () => ( "")),
1813
+ _nullishCoalesce(_optionalChain([state, 'access', _35 => _35.progress, 'optionalAccess', _36 => _36.startedAt]), () => ( "")),
1814
+ _nullishCoalesce(_optionalChain([state, 'access', _37 => _37.progress, 'optionalAccess', _38 => _38.completedAt]), () => ( "")),
1815
+ _nullishCoalesce(_optionalChain([state, 'access', _39 => _39.progress, 'optionalAccess', _40 => _40.updatedAt]), () => ( "")),
1816
+ _nullishCoalesce(_optionalChain([state, 'access', _41 => _41.progress, 'optionalAccess', _42 => _42.message]), () => ( ""))
1782
1817
  ])
1783
1818
  );
1784
1819
  }
@@ -1848,8 +1883,8 @@ function diffPlayRunStreamEvents(input) {
1848
1883
  if (state.status === "idle") {
1849
1884
  continue;
1850
1885
  }
1851
- const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _41 => _41.progress, 'optionalAccess', _42 => _42.startedAt]))), () => ( null));
1852
- const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _43 => _43.progress, 'optionalAccess', _44 => _44.completedAt]))), () => ( null));
1886
+ const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _43 => _43.progress, 'optionalAccess', _44 => _44.startedAt]))), () => ( null));
1887
+ const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _45 => _45.progress, 'optionalAccess', _46 => _46.completedAt]))), () => ( null));
1853
1888
  events.push(
1854
1889
  makeRunStreamEvent({
1855
1890
  cursor,
@@ -1863,7 +1898,7 @@ function diffPlayRunStreamEvents(input) {
1863
1898
  ...resolveTimingWindow({
1864
1899
  startedAt: persistedStartedAt,
1865
1900
  completedAt: persistedCompletedAt,
1866
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _45 => _45.progress, 'optionalAccess', _46 => _46.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
1901
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _47 => _47.progress, 'optionalAccess', _48 => _48.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
1867
1902
  })
1868
1903
  }
1869
1904
  })
@@ -1917,9 +1952,9 @@ function diffPlayRunStreamEvents(input) {
1917
1952
  if (next.snapshotSignature !== previous.snapshotSignature) {
1918
1953
  const enrichedNodeStates = snapshot.nodeStates.map((state) => {
1919
1954
  const timing = resolveTimingWindow({
1920
- startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _47 => _47.progress, 'optionalAccess', _48 => _48.startedAt]))), () => ( null)),
1921
- completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _49 => _49.progress, 'optionalAccess', _50 => _50.completedAt]))), () => ( null)),
1922
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _51 => _51.progress, 'optionalAccess', _52 => _52.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
1955
+ startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _49 => _49.progress, 'optionalAccess', _50 => _50.startedAt]))), () => ( null)),
1956
+ completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _51 => _51.progress, 'optionalAccess', _52 => _52.completedAt]))), () => ( null)),
1957
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _53 => _53.progress, 'optionalAccess', _54 => _54.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
1923
1958
  });
1924
1959
  return {
1925
1960
  ...state,
@@ -1978,18 +2013,18 @@ function isTransientPlayRunReadError(error) {
1978
2013
  // src/runs/watch-polling.ts
1979
2014
  var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
1980
2015
  function waitForNextPoll(ms, signal) {
1981
- if (_optionalChain([signal, 'optionalAccess', _53 => _53.aborted])) {
2016
+ if (_optionalChain([signal, 'optionalAccess', _55 => _55.aborted])) {
1982
2017
  return Promise.resolve(false);
1983
2018
  }
1984
2019
  return new Promise((resolve) => {
1985
2020
  const finish = (elapsed) => {
1986
2021
  clearTimeout(timeout);
1987
- _optionalChain([signal, 'optionalAccess', _54 => _54.removeEventListener, 'call', _55 => _55("abort", onAbort)]);
2022
+ _optionalChain([signal, 'optionalAccess', _56 => _56.removeEventListener, 'call', _57 => _57("abort", onAbort)]);
1988
2023
  resolve(elapsed);
1989
2024
  };
1990
2025
  const onAbort = () => finish(false);
1991
2026
  const timeout = setTimeout(() => finish(true), ms);
1992
- _optionalChain([signal, 'optionalAccess', _56 => _56.addEventListener, 'call', _57 => _57("abort", onAbort, { once: true })]);
2027
+ _optionalChain([signal, 'optionalAccess', _58 => _58.addEventListener, 'call', _59 => _59("abort", onAbort, { once: true })]);
1993
2028
  });
1994
2029
  }
1995
2030
  function readSnapshotResponse(response, runId) {
@@ -2046,7 +2081,7 @@ async function* watchRunEvents(options) {
2046
2081
  let previous = EMPTY_PLAY_RUN_STREAM_DIFF_STATE;
2047
2082
  let consecutiveFailures = 0;
2048
2083
  let outageNoticeSent = false;
2049
- while (!_optionalChain([signal, 'optionalAccess', _58 => _58.aborted])) {
2084
+ while (!_optionalChain([signal, 'optionalAccess', _60 => _60.aborted])) {
2050
2085
  const pollStartedAt = Date.now();
2051
2086
  let snapshot;
2052
2087
  try {
@@ -2059,7 +2094,7 @@ async function* watchRunEvents(options) {
2059
2094
  signal
2060
2095
  });
2061
2096
  } catch (error) {
2062
- if (_optionalChain([signal, 'optionalAccess', _59 => _59.aborted])) {
2097
+ if (_optionalChain([signal, 'optionalAccess', _61 => _61.aborted])) {
2063
2098
  return;
2064
2099
  }
2065
2100
  if (!isTransientPlayRunReadError(error)) {
@@ -2068,12 +2103,12 @@ async function* watchRunEvents(options) {
2068
2103
  consecutiveFailures += 1;
2069
2104
  const reason = error instanceof Error ? error.message : String(error);
2070
2105
  if (!outageNoticeSent) {
2071
- _optionalChain([options, 'access', _60 => _60.onRetry, 'optionalCall', _61 => _61({
2106
+ _optionalChain([options, 'access', _62 => _62.onRetry, 'optionalCall', _63 => _63({
2072
2107
  attempt: consecutiveFailures,
2073
2108
  delayMs: pollIntervalMs,
2074
2109
  reason
2075
2110
  })]);
2076
- _optionalChain([options, 'access', _62 => _62.onNotice, 'optionalCall', _63 => _63(
2111
+ _optionalChain([options, 'access', _64 => _64.onNotice, 'optionalCall', _65 => _65(
2077
2112
  `[watch] run snapshot request failed; retrying every ${pollIntervalMs / 1e3}s (${reason})`
2078
2113
  )]);
2079
2114
  outageNoticeSent = true;
@@ -2088,7 +2123,7 @@ async function* watchRunEvents(options) {
2088
2123
  continue;
2089
2124
  }
2090
2125
  if (outageNoticeSent) {
2091
- _optionalChain([options, 'access', _64 => _64.onNotice, 'optionalCall', _65 => _65("[watch] run snapshot polling recovered")]);
2126
+ _optionalChain([options, 'access', _66 => _66.onNotice, 'optionalCall', _67 => _67("[watch] run snapshot polling recovered")]);
2092
2127
  outageNoticeSent = false;
2093
2128
  }
2094
2129
  consecutiveFailures = 0;
@@ -2418,7 +2453,7 @@ function parseDsl(input) {
2418
2453
  input.slice(position)
2419
2454
  );
2420
2455
  if (!operation) {
2421
- const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _66 => _66.exec, 'call', _67 => _67(input.slice(position)), 'optionalAccess', _68 => _68[0]]), () => ( input[position])), () => ( "<end>"));
2456
+ const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _68 => _68.exec, 'call', _69 => _69(input.slice(position)), 'optionalAccess', _70 => _70[0]]), () => ( input[position])), () => ( "<end>"));
2422
2457
  if (token === "=") {
2423
2458
  const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
2424
2459
  fail(
@@ -2497,7 +2532,7 @@ function normalizeRunEventQueryTimestamp(value) {
2497
2532
  return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
2498
2533
  }
2499
2534
  function timestampMicros(value) {
2500
- const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _69 => _69.exec, 'call', _70 => _70(value), 'optionalAccess', _71 => _71[1]]), () => ( ""));
2535
+ const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _71 => _71.exec, 'call', _72 => _72(value), 'optionalAccess', _73 => _73[1]]), () => ( ""));
2501
2536
  return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
2502
2537
  }
2503
2538
  function time(value, nowMs, fallback) {
@@ -2730,7 +2765,7 @@ function parseNotificationGroupTarget(value) {
2730
2765
  }
2731
2766
  return { kind: "email", email };
2732
2767
  }
2733
- const slack = _optionalChain([/^slack:(.+)$/i, 'access', _72 => _72.exec, 'call', _73 => _73(normalized), 'optionalAccess', _74 => _74[1], 'optionalAccess', _75 => _75.trim, 'call', _76 => _76()]);
2768
+ const slack = _optionalChain([/^slack:(.+)$/i, 'access', _74 => _74.exec, 'call', _75 => _75(normalized), 'optionalAccess', _76 => _76[1], 'optionalAccess', _77 => _77.trim, 'call', _78 => _78()]);
2734
2769
  if (!slack) {
2735
2770
  const provider = normalized.split(":", 1)[0] || normalized;
2736
2771
  throw new Error(
@@ -2738,7 +2773,7 @@ function parseNotificationGroupTarget(value) {
2738
2773
  );
2739
2774
  }
2740
2775
  const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
2741
- if (_optionalChain([member, 'optionalAccess', _77 => _77[1]])) {
2776
+ if (_optionalChain([member, 'optionalAccess', _79 => _79[1]])) {
2742
2777
  return { kind: "slack", memberId: member[1].toUpperCase() };
2743
2778
  }
2744
2779
  if (slack.toLowerCase().startsWith("member:")) {
@@ -2785,10 +2820,10 @@ function resolvePlayRunRuntimeSelection(request) {
2785
2820
  }
2786
2821
  return runtime;
2787
2822
  }
2788
- const configured = _optionalChain([process, 'access', _78 => _78.env, 'access', _79 => _79.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]);
2789
- const configuredNamespace = _optionalChain([process, 'access', _82 => _82.env, 'access', _83 => _83.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _84 => _84.trim, 'call', _85 => _85()]);
2790
- const configuredToken = _optionalChain([process, 'access', _86 => _86.env, 'access', _87 => _87.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _88 => _88.trim, 'call', _89 => _89()]);
2791
- const configuredPlacementPolicy = _optionalChain([process, 'access', _90 => _90.env, 'access', _91 => _91.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _92 => _92.trim, 'call', _93 => _93()]);
2823
+ const configured = _optionalChain([process, 'access', _80 => _80.env, 'access', _81 => _81.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]);
2824
+ const configuredNamespace = _optionalChain([process, 'access', _84 => _84.env, 'access', _85 => _85.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87()]);
2825
+ const configuredToken = _optionalChain([process, 'access', _88 => _88.env, 'access', _89 => _89.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _90 => _90.trim, 'call', _91 => _91()]);
2826
+ const configuredPlacementPolicy = _optionalChain([process, 'access', _92 => _92.env, 'access', _93 => _93.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]);
2792
2827
  if (!configured) {
2793
2828
  if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
2794
2829
  const present = [];
@@ -2827,7 +2862,7 @@ function resolvePlayRunRuntimeSelection(request) {
2827
2862
  "INVALID_RUNTIME_NAMESPACE"
2828
2863
  );
2829
2864
  }
2830
- const configuredBackendValue = _optionalChain([process, 'access', _94 => _94.env, 'access', _95 => _95.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _96 => _96.trim, 'call', _97 => _97()]);
2865
+ const configuredBackendValue = _optionalChain([process, 'access', _96 => _96.env, 'access', _97 => _97.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
2831
2866
  const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
2832
2867
  if (configuredBackendValue && !configuredBackend) {
2833
2868
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
@@ -2865,7 +2900,7 @@ function resolveStartPlayRunRequest(request) {
2865
2900
  }
2866
2901
  function runtimeSelectionHeaders(runtime) {
2867
2902
  if (!runtime) return void 0;
2868
- const token = _optionalChain([process, 'access', _98 => _98.env, 'access', _99 => _99.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]);
2903
+ const token = _optionalChain([process, 'access', _100 => _100.env, 'access', _101 => _101.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()]);
2869
2904
  if (!token) {
2870
2905
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2871
2906
  "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
@@ -2873,18 +2908,18 @@ function runtimeSelectionHeaders(runtime) {
2873
2908
  "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
2874
2909
  );
2875
2910
  }
2876
- const receivers = _optionalChain([process, 'access', _102 => _102.env, 'access', _103 => _103.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()]);
2911
+ const receivers = _optionalChain([process, 'access', _104 => _104.env, 'access', _105 => _105.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()]);
2877
2912
  return {
2878
- [_chunk22GXXUTBjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2879
- ...receivers ? { [_chunk22GXXUTBjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2913
+ [_chunkGVJPI7MBjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2914
+ ...receivers ? { [_chunkGVJPI7MBjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2880
2915
  };
2881
2916
  }
2882
2917
  function isolatedCiRuntimeEventReadHeaders() {
2883
- const schema = _optionalChain([process, 'access', _106 => _106.env, 'access', _107 => _107.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _108 => _108.trim, 'call', _109 => _109()]);
2884
- if (_optionalChain([process, 'access', _110 => _110.env, 'access', _111 => _111.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
2918
+ const schema = _optionalChain([process, 'access', _108 => _108.env, 'access', _109 => _109.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()]);
2919
+ if (_optionalChain([process, 'access', _112 => _112.env, 'access', _113 => _113.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
2885
2920
  return void 0;
2886
2921
  }
2887
- const token = _optionalChain([process, 'access', _114 => _114.env, 'access', _115 => _115.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _116 => _116.trim, 'call', _117 => _117()]);
2922
+ const token = _optionalChain([process, 'access', _116 => _116.env, 'access', _117 => _117.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]);
2888
2923
  if (!token) {
2889
2924
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2890
2925
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -2892,7 +2927,7 @@ function isolatedCiRuntimeEventReadHeaders() {
2892
2927
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
2893
2928
  );
2894
2929
  }
2895
- return { [_chunk22GXXUTBjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2930
+ return { [_chunkGVJPI7MBjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2896
2931
  }
2897
2932
  function normalizeTestPolicyOverrides(value, source) {
2898
2933
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -2905,8 +2940,8 @@ function normalizeTestPolicyOverrides(value, source) {
2905
2940
  );
2906
2941
  }
2907
2942
  function parseEnvTestPolicyOverrides() {
2908
- const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _118 => _118.env, 'optionalAccess', _119 => _119.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
2909
- const trimmed = _optionalChain([raw, 'optionalAccess', _120 => _120.trim, 'call', _121 => _121()]);
2943
+ const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _120 => _120.env, 'optionalAccess', _121 => _121.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
2944
+ const trimmed = _optionalChain([raw, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
2910
2945
  if (!trimmed) return void 0;
2911
2946
  let parsed;
2912
2947
  try {
@@ -2934,7 +2969,7 @@ function isTransientCompileManifestError(error) {
2934
2969
  );
2935
2970
  }
2936
2971
  function requireCompileManifestResponse(response, playName) {
2937
- const compilerManifest = _optionalChain([response, 'optionalAccess', _122 => _122.compilerManifest]);
2972
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _124 => _124.compilerManifest]);
2938
2973
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
2939
2974
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2940
2975
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -2986,7 +3021,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
2986
3021
  }
2987
3022
  function searchParams(options) {
2988
3023
  const params = new URLSearchParams();
2989
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _123 => _123.query, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]), () => ( "")));
3024
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _125 => _125.query, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]), () => ( "")));
2990
3025
  params.set(
2991
3026
  "include_search_debug",
2992
3027
  options.includeSearchDebug ? "true" : "false"
@@ -2996,13 +3031,13 @@ function searchParams(options) {
2996
3031
  if (options.offset !== void 0) {
2997
3032
  params.set("offset", String(options.offset));
2998
3033
  }
2999
- if (_optionalChain([options, 'access', _126 => _126.categories, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()])) {
3034
+ if (_optionalChain([options, 'access', _128 => _128.categories, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()])) {
3000
3035
  params.set("categories", options.categories.trim());
3001
3036
  }
3002
- if (_optionalChain([options, 'access', _129 => _129.searchTerms, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()])) {
3037
+ if (_optionalChain([options, 'access', _131 => _131.searchTerms, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()])) {
3003
3038
  params.set("search_terms", options.searchTerms.trim());
3004
3039
  }
3005
- if (_optionalChain([options, 'access', _132 => _132.task, 'optionalAccess', _133 => _133.trim, 'call', _134 => _134()])) params.set("task", options.task.trim());
3040
+ if (_optionalChain([options, 'access', _134 => _134.task, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()])) params.set("task", options.task.trim());
3006
3041
  return params;
3007
3042
  }
3008
3043
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -3041,17 +3076,17 @@ function preferPrebuiltPlayDescriptions(plays) {
3041
3076
  }
3042
3077
  function normalizePlayStatus(raw) {
3043
3078
  const runPackage = _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
3044
- const packageRun = _optionalChain([runPackage, 'optionalAccess', _135 => _135.run]);
3045
- const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _136 => _136.status]) === "string" ? packageRun.status : null;
3079
+ const packageRun = _optionalChain([runPackage, 'optionalAccess', _137 => _137.run]);
3080
+ const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _138 => _138.status]) === "string" ? packageRun.status : null;
3046
3081
  const status = _chunkLA46MMTLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
3047
3082
  if (!status) {
3048
3083
  throw new Error(
3049
3084
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
3050
3085
  );
3051
3086
  }
3052
- const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _137 => _137.id]), () => ( ""));
3053
- const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _138 => _138.overview]), () => ( raw.overview));
3054
- const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _139 => _139.runStatus]), () => ( raw.runStatus));
3087
+ const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _139 => _139.id]), () => ( ""));
3088
+ const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _140 => _140.overview]), () => ( raw.overview));
3089
+ const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _141 => _141.runStatus]), () => ( raw.runStatus));
3055
3090
  return {
3056
3091
  ...raw,
3057
3092
  runId,
@@ -3153,9 +3188,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
3153
3188
  runId: status.runId || fallbackRunId,
3154
3189
  result: _nullishCoalesce(status.package, () => ( status.result)),
3155
3190
  ...status.package ? { package: status.package } : {},
3156
- logs: _nullishCoalesce(_optionalChain([status, 'access', _140 => _140.progress, 'optionalAccess', _141 => _141.logs]), () => ( [])),
3191
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _142 => _142.progress, 'optionalAccess', _143 => _143.logs]), () => ( [])),
3157
3192
  durationMs: Date.now() - startedAt,
3158
- error: _nullishCoalesce(_optionalChain([status, 'access', _142 => _142.progress, 'optionalAccess', _143 => _143.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3193
+ error: _nullishCoalesce(_optionalChain([status, 'access', _144 => _144.progress, 'optionalAccess', _145 => _145.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3159
3194
  };
3160
3195
  }
3161
3196
  var DeeplineClient = (_class = class _DeeplineClient {
@@ -3182,12 +3217,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
3182
3217
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3183
3218
  */
3184
3219
  constructor(options) {
3185
- this.config = _chunk22GXXUTBjs.resolveConfig.call(void 0, options);
3186
- this.http = new (0, _chunk22GXXUTBjs.HttpClient)(this.config);
3220
+ this.config = _chunkGVJPI7MBjs.resolveConfig.call(void 0, options);
3221
+ this.http = new (0, _chunkGVJPI7MBjs.HttpClient)(this.config);
3187
3222
  this.toolCalls = new ToolCalls(
3188
3223
  this.http,
3189
3224
  this.config.timeout,
3190
- _optionalChain([options, 'optionalAccess', _144 => _144.timeout])
3225
+ _optionalChain([options, 'optionalAccess', _146 => _146.timeout])
3191
3226
  );
3192
3227
  this.runs = {
3193
3228
  getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
@@ -3226,6 +3261,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3226
3261
  planQuery: (input) => planCustomerDbQuery(input)
3227
3262
  };
3228
3263
  this.billing = {
3264
+ entitlements: () => this.http.get("/api/v2/billing/entitlements"),
3229
3265
  topUp: (options2) => this.topUpBillingBalance(options2),
3230
3266
  topUpWithReceipt: (options2) => this.topUpBillingBalanceWithReceipt(options2),
3231
3267
  plans: () => this.getBillingPlans(),
@@ -3247,7 +3283,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3247
3283
  {},
3248
3284
  {
3249
3285
  "Idempotency-Key": requireBillingIdempotencyKey(
3250
- _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _145 => _145.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3286
+ _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _147 => _147.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3251
3287
  )
3252
3288
  }
3253
3289
  ),
@@ -3266,7 +3302,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3266
3302
  available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
3267
3303
  check: (definition) => this.checkMonitor(definition),
3268
3304
  deploy: (definition, options2) => this.deployMonitor(definition, options2),
3269
- sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _146 => _146.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3305
+ sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _148 => _148.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3270
3306
  list: (options2) => this.listMonitors(options2),
3271
3307
  get: (key) => this.getMonitor(key),
3272
3308
  test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
@@ -3275,13 +3311,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3275
3311
  update: (key, patch) => this.updateMonitor(key, patch),
3276
3312
  delete: (key, options2) => this.deleteMonitor(key, options2),
3277
3313
  reactivate: (key, options2) => this.reactivateMonitor(key, options2),
3278
- start: (key, options2) => _optionalChain([options2, 'optionalAccess', _147 => _147.dryRun]) ? this.submitMonitorBatch({
3314
+ start: (key, options2) => _optionalChain([options2, 'optionalAccess', _149 => _149.dryRun]) ? this.submitMonitorBatch({
3279
3315
  kind: "reactivate",
3280
3316
  scope: { kind: "keys", monitorKeys: [key] },
3281
3317
  dryRun: true,
3282
3318
  idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3283
3319
  }) : this.submitScalarMonitorLifecycle(key, "start", options2),
3284
- stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _148 => _148.dryRun]) ? this.submitMonitorBatch({
3320
+ stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _150 => _150.dryRun]) ? this.submitMonitorBatch({
3285
3321
  kind: "deactivate",
3286
3322
  scope: { kind: "keys", monitorKeys: [key] },
3287
3323
  dryRun: true,
@@ -3332,7 +3368,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3332
3368
  type: _nullishCoalesce(field.type, () => ( void 0)),
3333
3369
  required: _nullishCoalesce(field.required, () => ( void 0))
3334
3370
  } : null
3335
- ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _149 => _149.name]))) : [];
3371
+ ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _151 => _151.name]))) : [];
3336
3372
  return fields.length > 0 ? { fields } : schema;
3337
3373
  }
3338
3374
  schemaMetadata(schema, key) {
@@ -3362,13 +3398,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3362
3398
  };
3363
3399
  }
3364
3400
  summarizePlayListItem(play, options) {
3365
- const aliases = _optionalChain([play, 'access', _150 => _150.aliases, 'optionalAccess', _151 => _151.length]) ? play.aliases : [play.name];
3401
+ const aliases = _optionalChain([play, 'access', _152 => _152.aliases, 'optionalAccess', _153 => _153.length]) ? play.aliases : [play.name];
3366
3402
  const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
3367
3403
  const rowOutputSchema = this.schemaMetadata(
3368
3404
  play.outputSchema,
3369
3405
  "rowOutputSchema"
3370
3406
  );
3371
- const description = _optionalChain([play, 'access', _152 => _152.description, 'optionalAccess', _153 => _153.trim, 'call', _154 => _154()]) || _optionalChain([play, 'access', _155 => _155.currentRevision, 'optionalAccess', _156 => _156.description, 'optionalAccess', _157 => _157.trim, 'call', _158 => _158()]) || _optionalChain([play, 'access', _159 => _159.liveRevision, 'optionalAccess', _160 => _160.description, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()]) || null;
3407
+ const description = _optionalChain([play, 'access', _154 => _154.description, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()]) || _optionalChain([play, 'access', _157 => _157.currentRevision, 'optionalAccess', _158 => _158.description, 'optionalAccess', _159 => _159.trim, 'call', _160 => _160()]) || _optionalChain([play, 'access', _161 => _161.liveRevision, 'optionalAccess', _162 => _162.description, 'optionalAccess', _163 => _163.trim, 'call', _164 => _164()]) || null;
3372
3408
  const runCommand = this.playRunCommand(play);
3373
3409
  const cloneEditStarter = this.playCloneEditStarter(play);
3374
3410
  return {
@@ -3388,9 +3424,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
3388
3424
  canEdit: play.canEdit,
3389
3425
  canClone: play.canClone,
3390
3426
  aliases,
3391
- inputSchema: _optionalChain([options, 'optionalAccess', _163 => _163.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
3392
- outputSchema: _optionalChain([options, 'optionalAccess', _164 => _164.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
3393
- staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _165 => _165.currentRevision, 'optionalAccess', _166 => _166.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _167 => _167.liveRevision, 'optionalAccess', _168 => _168.staticPipeline])) ? play.liveRevision.staticPipeline : null,
3427
+ inputSchema: _optionalChain([options, 'optionalAccess', _165 => _165.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
3428
+ outputSchema: _optionalChain([options, 'optionalAccess', _166 => _166.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
3429
+ staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _167 => _167.currentRevision, 'optionalAccess', _168 => _168.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _169 => _169.liveRevision, 'optionalAccess', _170 => _170.staticPipeline])) ? play.liveRevision.staticPipeline : null,
3394
3430
  ...csvInput ? {
3395
3431
  csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
3396
3432
  } : {},
@@ -3402,7 +3438,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3402
3438
  // Read the live version off the live revision. It was previously only
3403
3439
  // ever written by the publish/live routes, so every list and describe
3404
3440
  // payload reported liveVersion: null even for an actively serving play.
3405
- liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _169 => _169.liveRevision, 'optionalAccess', _170 => _170.version]), () => ( null)),
3441
+ liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _171 => _171.liveRevision, 'optionalAccess', _172 => _172.version]), () => ( null)),
3406
3442
  ...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
3407
3443
  isDraftDirty: play.isDraftDirty
3408
3444
  };
@@ -3411,8 +3447,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3411
3447
  const play = detail.play;
3412
3448
  return {
3413
3449
  ...this.summarizePlayListItem(play, options),
3414
- currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _171 => _171.liveRevision, 'optionalAccess', _172 => _172.version]))), () => ( null)),
3415
- latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _173 => _173.latestRuns, 'access', _174 => _174[0], 'optionalAccess', _175 => _175.workflowId]))), () => ( null)),
3450
+ currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _173 => _173.liveRevision, 'optionalAccess', _174 => _174.version]))), () => ( null)),
3451
+ latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _175 => _175.latestRuns, 'access', _176 => _176[0], 'optionalAccess', _177 => _177.workflowId]))), () => ( null)),
3416
3452
  ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
3417
3453
  ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
3418
3454
  ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {}
@@ -3479,17 +3515,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3479
3515
  */
3480
3516
  async listTools(options) {
3481
3517
  const params = new URLSearchParams();
3482
- if (_optionalChain([options, 'optionalAccess', _176 => _176.categories, 'optionalAccess', _177 => _177.trim, 'call', _178 => _178()])) {
3518
+ if (_optionalChain([options, 'optionalAccess', _178 => _178.categories, 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()])) {
3483
3519
  params.set("categories", options.categories.trim());
3484
3520
  }
3485
- if (_optionalChain([options, 'optionalAccess', _179 => _179.tags, 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()])) {
3521
+ if (_optionalChain([options, 'optionalAccess', _181 => _181.tags, 'optionalAccess', _182 => _182.trim, 'call', _183 => _183()])) {
3486
3522
  params.set("tags", options.tags.trim());
3487
3523
  }
3488
- if (_optionalChain([options, 'optionalAccess', _182 => _182.grep, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()])) {
3524
+ if (_optionalChain([options, 'optionalAccess', _184 => _184.grep, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()])) {
3489
3525
  params.set("grep", options.grep.trim());
3490
3526
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3491
3527
  }
3492
- params.set("compact", _optionalChain([options, 'optionalAccess', _185 => _185.compact]) === true ? "true" : "false");
3528
+ params.set("compact", _optionalChain([options, 'optionalAccess', _187 => _187.compact]) === true ? "true" : "false");
3493
3529
  const suffix = params.toString() ? `?${params.toString()}` : "";
3494
3530
  const res = await this.http.get(
3495
3531
  `/api/v2/tools${suffix}`
@@ -3498,7 +3534,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3498
3534
  }
3499
3535
  /** List discoverable providers without requiring a local plugin catalog. */
3500
3536
  async listProviders(options) {
3501
- const suffix = _optionalChain([options, 'optionalAccess', _186 => _186.changed]) ? "?changed=true" : "";
3537
+ const suffix = _optionalChain([options, 'optionalAccess', _188 => _188.changed]) ? "?changed=true" : "";
3502
3538
  const res = await this.http.get(
3503
3539
  `/api/v2/tools/providers${suffix}`
3504
3540
  );
@@ -3529,8 +3565,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3529
3565
  */
3530
3566
  async search(options = {}) {
3531
3567
  const params = searchParams(options);
3532
- if (_optionalChain([options, 'access', _187 => _187.types, 'optionalAccess', _188 => _188.length])) params.set("types", options.types.join(","));
3533
- if (_optionalChain([options, 'access', _189 => _189.exclude, 'optionalAccess', _190 => _190.length])) {
3568
+ if (_optionalChain([options, 'access', _189 => _189.types, 'optionalAccess', _190 => _190.length])) params.set("types", options.types.join(","));
3569
+ if (_optionalChain([options, 'access', _191 => _191.exclude, 'optionalAccess', _192 => _192.length])) {
3534
3570
  params.set("exclude", options.exclude.join(","));
3535
3571
  }
3536
3572
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3552,7 +3588,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3552
3588
  * ```
3553
3589
  */
3554
3590
  async getTool(toolId, options) {
3555
- if (_optionalChain([options, 'optionalAccess', _191 => _191.cliInvocationId]) !== void 0) {
3591
+ if (_optionalChain([options, 'optionalAccess', _193 => _193.cliInvocationId]) !== void 0) {
3556
3592
  validateCliInvocationId(options.cliInvocationId);
3557
3593
  }
3558
3594
  return this.http.request(
@@ -3565,7 +3601,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3565
3601
  retryApiErrors: true,
3566
3602
  headers: {
3567
3603
  "x-deepline-tool-meta-only": "1",
3568
- ..._optionalChain([options, 'optionalAccess', _192 => _192.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3604
+ ..._optionalChain([options, 'optionalAccess', _194 => _194.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3569
3605
  }
3570
3606
  }
3571
3607
  );
@@ -3657,7 +3693,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3657
3693
  return this.http.post(
3658
3694
  "/api/v2/ingestion/repair",
3659
3695
  {
3660
- ..._optionalChain([input, 'optionalAccess', _193 => _193.provider]) ? { provider: input.provider } : {}
3696
+ ..._optionalChain([input, 'optionalAccess', _195 => _195.provider]) ? { provider: input.provider } : {}
3661
3697
  }
3662
3698
  );
3663
3699
  }
@@ -3727,7 +3763,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3727
3763
  method: "POST",
3728
3764
  body,
3729
3765
  headers: runtimeSelectionHeaders(resolved.runtime),
3730
- signal: _optionalChain([options, 'optionalAccess', _194 => _194.signal])
3766
+ signal: _optionalChain([options, 'optionalAccess', _196 => _196.signal])
3731
3767
  }
3732
3768
  )) {
3733
3769
  if (event.scope === "play") {
@@ -3887,7 +3923,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3887
3923
  compilerManifest,
3888
3924
  ...input.input ? { input: input.input } : {},
3889
3925
  ...input.inputFile ? { inputFile: input.inputFile } : {},
3890
- ..._optionalChain([input, 'access', _195 => _195.packagedFiles, 'optionalAccess', _196 => _196.length]) ? { packagedFiles: input.packagedFiles } : {},
3926
+ ..._optionalChain([input, 'access', _197 => _197.packagedFiles, 'optionalAccess', _198 => _198.length]) ? { packagedFiles: input.packagedFiles } : {},
3891
3927
  ...input.force ? { force: true } : {},
3892
3928
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
3893
3929
  });
@@ -3917,29 +3953,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
3917
3953
  * ```
3918
3954
  */
3919
3955
  async submitPlay(code, csvPath, name, options) {
3920
- const runtimeInput = _optionalChain([options, 'optionalAccess', _197 => _197.input]) ? { ...options.input } : {};
3956
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _199 => _199.input]) ? { ...options.input } : {};
3921
3957
  if (csvPath) {
3922
3958
  runtimeInput.file = csvPath;
3923
3959
  }
3924
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _198 => _198.sourceCode]), () => ( code));
3925
- const artifact = _optionalChain([options, 'optionalAccess', _199 => _199.artifact]);
3926
- if (!_optionalChain([name, 'optionalAccess', _200 => _200.trim, 'call', _201 => _201()])) {
3960
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _200 => _200.sourceCode]), () => ( code));
3961
+ const artifact = _optionalChain([options, 'optionalAccess', _201 => _201.artifact]);
3962
+ if (!_optionalChain([name, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203()])) {
3927
3963
  throw new Error("submitPlay requires a play name.");
3928
3964
  }
3929
3965
  if (!artifact) {
3930
3966
  throw new Error("submitPlay requires a bundled play artifact.");
3931
3967
  }
3932
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _202 => _202.compilerManifest]), async () => ( await this.compilePlayManifest({
3968
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _204 => _204.compilerManifest]), async () => ( await this.compilePlayManifest({
3933
3969
  name,
3934
3970
  sourceCode,
3935
- sourceFiles: _optionalChain([options, 'optionalAccess', _203 => _203.sourceFiles]),
3971
+ sourceFiles: _optionalChain([options, 'optionalAccess', _205 => _205.sourceFiles]),
3936
3972
  artifact
3937
3973
  })));
3938
3974
  const registeredArtifact = await this.registerPlayArtifact({
3939
3975
  name,
3940
3976
  sourceCode,
3941
- sourceFiles: _optionalChain([options, 'optionalAccess', _204 => _204.sourceFiles]),
3942
- description: _optionalChain([options, 'optionalAccess', _205 => _205.description]),
3977
+ sourceFiles: _optionalChain([options, 'optionalAccess', _206 => _206.sourceFiles]),
3978
+ description: _optionalChain([options, 'optionalAccess', _207 => _207.description]),
3943
3979
  artifact,
3944
3980
  compilerManifest,
3945
3981
  publish: false
@@ -3953,17 +3989,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3953
3989
  name,
3954
3990
  artifactStorageKey: registeredArtifact.artifactStorageKey,
3955
3991
  sourceCode,
3956
- description: _optionalChain([options, 'optionalAccess', _206 => _206.description]),
3992
+ description: _optionalChain([options, 'optionalAccess', _208 => _208.description]),
3957
3993
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
3958
3994
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
3959
3995
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
3960
3996
  runtimeArtifact: artifact,
3961
3997
  compilerManifest,
3962
3998
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
3963
- ..._optionalChain([options, 'optionalAccess', _207 => _207.inputFile]) ? { inputFile: options.inputFile } : {},
3964
- ..._optionalChain([options, 'optionalAccess', _208 => _208.packagedFiles, 'optionalAccess', _209 => _209.length]) ? { packagedFiles: options.packagedFiles } : {},
3965
- ..._optionalChain([options, 'optionalAccess', _210 => _210.force]) ? { force: true } : {},
3966
- ..._optionalChain([options, 'optionalAccess', _211 => _211.forceToolRefresh]) ? { forceToolRefresh: true } : {}
3999
+ ..._optionalChain([options, 'optionalAccess', _209 => _209.inputFile]) ? { inputFile: options.inputFile } : {},
4000
+ ..._optionalChain([options, 'optionalAccess', _210 => _210.packagedFiles, 'optionalAccess', _211 => _211.length]) ? { packagedFiles: options.packagedFiles } : {},
4001
+ ..._optionalChain([options, 'optionalAccess', _212 => _212.force]) ? { force: true } : {},
4002
+ ..._optionalChain([options, 'optionalAccess', _213 => _213.forceToolRefresh]) ? { forceToolRefresh: true } : {}
3967
4003
  });
3968
4004
  }
3969
4005
  /**
@@ -4033,10 +4069,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4033
4069
  */
4034
4070
  async getPlayStatus(workflowId, options) {
4035
4071
  const params = new URLSearchParams();
4036
- if (_optionalChain([options, 'optionalAccess', _212 => _212.billing]) === false) {
4072
+ if (_optionalChain([options, 'optionalAccess', _214 => _214.billing]) === false) {
4037
4073
  params.set("billing", "false");
4038
4074
  }
4039
- if (_optionalChain([options, 'optionalAccess', _213 => _213.full]) === true) {
4075
+ if (_optionalChain([options, 'optionalAccess', _215 => _215.full]) === true) {
4040
4076
  params.set("full", "true");
4041
4077
  }
4042
4078
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4050,9 +4086,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4050
4086
  for await (const event of watchRunEvents({
4051
4087
  http: this.http,
4052
4088
  runId: workflowId,
4053
- signal: _optionalChain([options, 'optionalAccess', _214 => _214.signal]),
4054
- onNotice: _optionalChain([options, 'optionalAccess', _215 => _215.onNotice]),
4055
- onRetry: _optionalChain([options, 'optionalAccess', _216 => _216.onRetry])
4089
+ signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]),
4090
+ onNotice: _optionalChain([options, 'optionalAccess', _217 => _217.onNotice]),
4091
+ onRetry: _optionalChain([options, 'optionalAccess', _218 => _218.onRetry])
4056
4092
  })) {
4057
4093
  yield event;
4058
4094
  }
@@ -4064,12 +4100,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4064
4100
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4065
4101
  */
4066
4102
  async *streamPlayRunEvents(workflowId, options) {
4067
- const headers = _optionalChain([options, 'optionalAccess', _217 => _217.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4103
+ const headers = _optionalChain([options, 'optionalAccess', _219 => _219.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4068
4104
  const params = new URLSearchParams();
4069
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _218 => _218.mode]), () => ( "cli")));
4105
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _220 => _220.mode]), () => ( "cli")));
4070
4106
  for await (const event of this.http.streamSse(
4071
4107
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4072
- { signal: _optionalChain([options, 'optionalAccess', _219 => _219.signal]), headers }
4108
+ { signal: _optionalChain([options, 'optionalAccess', _221 => _221.signal]), headers }
4073
4109
  )) {
4074
4110
  if (event.scope === "play") {
4075
4111
  yield event;
@@ -4085,24 +4121,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
4085
4121
  */
4086
4122
  async *observeRunEvents(runId, options) {
4087
4123
  yield* this.watchRunEvents(runId, {
4088
- signal: _optionalChain([options, 'optionalAccess', _220 => _220.signal]),
4089
- onNotice: _optionalChain([options, 'optionalAccess', _221 => _221.onNotice])
4124
+ signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]),
4125
+ onNotice: _optionalChain([options, 'optionalAccess', _223 => _223.onNotice])
4090
4126
  });
4091
4127
  }
4092
4128
  /** Poll snapshots to terminal status and return the durable package. */
4093
4129
  async watchRunToTerminal(runId, options) {
4094
4130
  let terminalObserved = false;
4095
4131
  for await (const event of this.watchRunEvents(runId, {
4096
- signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]),
4097
- onNotice: _optionalChain([options, 'optionalAccess', _223 => _223.onNotice]),
4098
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _224 => _224.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _225 => _225.onReconnect])))
4132
+ signal: _optionalChain([options, 'optionalAccess', _224 => _224.signal]),
4133
+ onNotice: _optionalChain([options, 'optionalAccess', _225 => _225.onNotice]),
4134
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _226 => _226.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _227 => _227.onReconnect])))
4099
4135
  })) {
4100
- _optionalChain([options, 'optionalAccess', _226 => _226.onEvent, 'optionalCall', _227 => _227(event)]);
4136
+ _optionalChain([options, 'optionalAccess', _228 => _228.onEvent, 'optionalCall', _229 => _229(event)]);
4101
4137
  if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4102
4138
  terminalObserved = true;
4103
4139
  }
4104
4140
  }
4105
- if (_optionalChain([options, 'optionalAccess', _228 => _228.signal, 'optionalAccess', _229 => _229.aborted])) {
4141
+ if (_optionalChain([options, 'optionalAccess', _230 => _230.signal, 'optionalAccess', _231 => _231.aborted])) {
4106
4142
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4107
4143
  }
4108
4144
  const refreshed = await this.getRunStatus(runId);
@@ -4156,7 +4192,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4156
4192
  async stopPlay(workflowId, options) {
4157
4193
  return this.http.post(
4158
4194
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
4159
- _optionalChain([options, 'optionalAccess', _230 => _230.reason]) ? { reason: options.reason } : {}
4195
+ _optionalChain([options, 'optionalAccess', _232 => _232.reason]) ? { reason: options.reason } : {}
4160
4196
  );
4161
4197
  }
4162
4198
  /**
@@ -4192,7 +4228,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4192
4228
  /** List the org's workflows. `GET /api/v2/workflows`. */
4193
4229
  async listWorkflows(options) {
4194
4230
  const params = new URLSearchParams();
4195
- if (typeof _optionalChain([options, 'optionalAccess', _231 => _231.limit]) === "number") {
4231
+ if (typeof _optionalChain([options, 'optionalAccess', _233 => _233.limit]) === "number") {
4196
4232
  params.set("limit", String(options.limit));
4197
4233
  }
4198
4234
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4245,7 +4281,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4245
4281
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4246
4282
  async listWorkflowRuns(id, options) {
4247
4283
  const params = new URLSearchParams();
4248
- if (typeof _optionalChain([options, 'optionalAccess', _232 => _232.limit]) === "number") {
4284
+ if (typeof _optionalChain([options, 'optionalAccess', _234 => _234.limit]) === "number") {
4249
4285
  params.set("limit", String(options.limit));
4250
4286
  }
4251
4287
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4281,10 +4317,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4281
4317
  */
4282
4318
  async getRunStatus(runId, options) {
4283
4319
  const params = new URLSearchParams();
4284
- if (_optionalChain([options, 'optionalAccess', _233 => _233.full]) === true) {
4320
+ if (_optionalChain([options, 'optionalAccess', _235 => _235.full]) === true) {
4285
4321
  params.set("full", "true");
4286
4322
  }
4287
- if (_optionalChain([options, 'optionalAccess', _234 => _234.configuration]) === true) {
4323
+ if (_optionalChain([options, 'optionalAccess', _236 => _236.configuration]) === true) {
4288
4324
  params.set("include", "configuration");
4289
4325
  }
4290
4326
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4292,7 +4328,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4292
4328
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4293
4329
  { headers: { "x-deepline-run-status": "1" } }
4294
4330
  );
4295
- if (_optionalChain([options, 'optionalAccess', _235 => _235.configuration]) === true && !Object.hasOwn(response, "contract")) {
4331
+ if (_optionalChain([options, 'optionalAccess', _237 => _237.configuration]) === true && !Object.hasOwn(response, "contract")) {
4296
4332
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4297
4333
  "This server does not support recorded configuration reads.",
4298
4334
  void 0,
@@ -4300,7 +4336,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4300
4336
  );
4301
4337
  }
4302
4338
  const status = normalizePlayStatus(response);
4303
- if (_optionalChain([options, 'optionalAccess', _236 => _236.failedLogs]) !== true || status.status !== "failed") {
4339
+ if (_optionalChain([options, 'optionalAccess', _238 => _238.failedLogs]) !== true || status.status !== "failed") {
4304
4340
  return status;
4305
4341
  }
4306
4342
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4389,7 +4425,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4389
4425
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4390
4426
  async getRunsHistory(options = {}) {
4391
4427
  const params = new URLSearchParams();
4392
- const search = _optionalChain([options, 'access', _237 => _237.search, 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
4428
+ const search = _optionalChain([options, 'access', _239 => _239.search, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
4393
4429
  if (search && search.length > 200) {
4394
4430
  throw new Error("Run search must be at most 200 characters.");
4395
4431
  }
@@ -4415,16 +4451,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4415
4451
  }
4416
4452
  /** Read one run page without discarding server pagination metadata. */
4417
4453
  async listRunsPage(options) {
4418
- const playName = _optionalChain([options, 'access', _240 => _240.play, 'optionalAccess', _241 => _241.trim, 'call', _242 => _242()]);
4454
+ const playName = _optionalChain([options, 'access', _242 => _242.play, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
4419
4455
  const params = new URLSearchParams();
4420
4456
  if (playName) {
4421
4457
  params.set("play", playName);
4422
4458
  }
4423
- const status = _optionalChain([options, 'access', _243 => _243.status, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
4459
+ const status = _optionalChain([options, 'access', _245 => _245.status, 'optionalAccess', _246 => _246.trim, 'call', _247 => _247()]);
4424
4460
  if (status) {
4425
4461
  params.set("status", status);
4426
4462
  }
4427
- const node = _optionalChain([options, 'access', _246 => _246.node, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]);
4463
+ const node = _optionalChain([options, 'access', _248 => _248.node, 'optionalAccess', _249 => _249.trim, 'call', _250 => _250()]);
4428
4464
  if (node) {
4429
4465
  if (!playName)
4430
4466
  throw new Error("runs.list options.node requires options.play.");
@@ -4498,8 +4534,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4498
4534
  * different key intentionally starts another rerun.
4499
4535
  */
4500
4536
  async rerun(runId, options) {
4501
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _249 => _249.idempotencyKey, 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]);
4502
- if (_optionalChain([options, 'optionalAccess', _252 => _252.idempotencyKey]) !== void 0 && !idempotencyKey) {
4537
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _251 => _251.idempotencyKey, 'optionalAccess', _252 => _252.trim, 'call', _253 => _253()]);
4538
+ if (_optionalChain([options, 'optionalAccess', _254 => _254.idempotencyKey]) !== void 0 && !idempotencyKey) {
4503
4539
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4504
4540
  "runs.rerun idempotencyKey must not be empty.",
4505
4541
  void 0,
@@ -4508,7 +4544,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4508
4544
  }
4509
4545
  return this.http.post(
4510
4546
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
4511
- _optionalChain([options, 'optionalAccess', _253 => _253.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4547
+ _optionalChain([options, 'optionalAccess', _255 => _255.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4512
4548
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
4513
4549
  );
4514
4550
  }
@@ -4522,21 +4558,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
4522
4558
  * ```
4523
4559
  */
4524
4560
  async getRunLogs(runId, options) {
4525
- if (_optionalChain([options, 'optionalAccess', _254 => _254.all]) === true && options.failed === true) {
4561
+ if (_optionalChain([options, 'optionalAccess', _256 => _256.all]) === true && options.failed === true) {
4526
4562
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4527
4563
  "runs.logs cannot combine all and failed views.",
4528
4564
  void 0,
4529
4565
  "INVALID_RUN_LOG_VIEW"
4530
4566
  );
4531
4567
  }
4532
- if (_optionalChain([options, 'optionalAccess', _255 => _255.cursor]) !== void 0 && options.failed === true) {
4568
+ if (_optionalChain([options, 'optionalAccess', _257 => _257.cursor]) !== void 0 && options.failed === true) {
4533
4569
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4534
4570
  "runs.logs cannot combine failed with cursor.",
4535
4571
  void 0,
4536
4572
  "INVALID_RUN_LOG_VIEW"
4537
4573
  );
4538
4574
  }
4539
- if (_optionalChain([options, 'optionalAccess', _256 => _256.failed]) === true) {
4575
+ if (_optionalChain([options, 'optionalAccess', _258 => _258.failed]) === true) {
4540
4576
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
4541
4577
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
4542
4578
  const page = await this.http.get(
@@ -4561,18 +4597,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
4561
4597
  ...page.logsTruncated ? { logsTruncated: true } : {}
4562
4598
  };
4563
4599
  }
4564
- const beforeSequence = _optionalChain([options, 'optionalAccess', _257 => _257.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4565
- const limit = _optionalChain([options, 'optionalAccess', _258 => _258.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _259 => _259.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4600
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _259 => _259.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4601
+ const limit = _optionalChain([options, 'optionalAccess', _260 => _260.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _261 => _261.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4566
4602
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
4567
4603
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
4568
4604
  { retryApiErrors: true }
4569
4605
  );
4570
4606
  const probe = await fetchPage(0, 1);
4571
4607
  const lastStoredSeq = probe.lastStoredSeq;
4572
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _260 => _260.entries, 'access', _261 => _261[0], 'optionalAccess', _262 => _262.seq]), () => ( null));
4608
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _262 => _262.entries, 'access', _263 => _263[0], 'optionalAccess', _264 => _264.seq]), () => ( null));
4573
4609
  const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
4574
4610
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
4575
- let afterSeq = _optionalChain([options, 'optionalAccess', _263 => _263.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4611
+ let afterSeq = _optionalChain([options, 'optionalAccess', _265 => _265.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4576
4612
  const entries = [];
4577
4613
  while (entries.length < limit && afterSeq < upperSeq) {
4578
4614
  const page = await fetchPage(
@@ -4606,7 +4642,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4606
4642
  hasMore: olderLinesExist,
4607
4643
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
4608
4644
  entries: entries.map((entry) => entry.line),
4609
- view: _optionalChain([options, 'optionalAccess', _264 => _264.all]) ? "all" : "tail",
4645
+ view: _optionalChain([options, 'optionalAccess', _266 => _266.all]) ? "all" : "tail",
4610
4646
  ...probe.logsTruncated ? { logsTruncated: true } : {}
4611
4647
  };
4612
4648
  }
@@ -4767,7 +4803,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4767
4803
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
4768
4804
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
4769
4805
  });
4770
- if (_optionalChain([input, 'access', _265 => _265.runId, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()])) {
4806
+ if (_optionalChain([input, 'access', _267 => _267.runId, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()])) {
4771
4807
  params.set("runId", input.runId.trim());
4772
4808
  }
4773
4809
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -4777,9 +4813,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4777
4813
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
4778
4814
  { signal: input.signal }
4779
4815
  );
4780
- const requestedRunId = _optionalChain([input, 'access', _268 => _268.runId, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]) || "";
4816
+ const requestedRunId = _optionalChain([input, 'access', _270 => _270.runId, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]) || "";
4781
4817
  if (requestedRunId) {
4782
- const confirmedRunId = _optionalChain([result, 'access', _271 => _271.scope, 'optionalAccess', _272 => _272.kind]) === "run" ? result.scope.runId.trim() : "";
4818
+ const confirmedRunId = _optionalChain([result, 'access', _273 => _273.scope, 'optionalAccess', _274 => _274.kind]) === "run" ? result.scope.runId.trim() : "";
4783
4819
  const foreignRowRunIds = [
4784
4820
  ...new Set(
4785
4821
  result.rows.map(
@@ -4787,7 +4823,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4787
4823
  ).filter((runId) => runId && runId !== requestedRunId)
4788
4824
  )
4789
4825
  ];
4790
- if (_optionalChain([result, 'access', _273 => _273.scope, 'optionalAccess', _274 => _274.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
4826
+ if (_optionalChain([result, 'access', _275 => _275.scope, 'optionalAccess', _276 => _276.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
4791
4827
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4792
4828
  `Run-scoped dataset export was not confirmed for ${requestedRunId}; no rows were returned to the caller. Update Deepline, then retry the same export command. Do not rerun the play.`,
4793
4829
  void 0,
@@ -4816,7 +4852,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4816
4852
  async stopRun(runId, options) {
4817
4853
  return this.http.post(
4818
4854
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
4819
- _optionalChain([options, 'optionalAccess', _275 => _275.reason]) ? { reason: options.reason } : {}
4855
+ _optionalChain([options, 'optionalAccess', _277 => _277.reason]) ? { reason: options.reason } : {}
4820
4856
  );
4821
4857
  }
4822
4858
  /**
@@ -4834,11 +4870,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
4834
4870
  * need to clear the workspace run-slot state without knowing each run id.
4835
4871
  */
4836
4872
  async stopAllRuns(options) {
4837
- const dryRun = _optionalChain([options, 'optionalAccess', _276 => _276.dryRun]) === true;
4873
+ const dryRun = _optionalChain([options, 'optionalAccess', _278 => _278.dryRun]) === true;
4838
4874
  const result = await this.http.post(
4839
4875
  "/api/v2/runs/stop-all",
4840
4876
  {
4841
- ..._optionalChain([options, 'optionalAccess', _277 => _277.reason]) ? { reason: options.reason } : {},
4877
+ ..._optionalChain([options, 'optionalAccess', _279 => _279.reason]) ? { reason: options.reason } : {},
4842
4878
  ...dryRun ? { dryRun: true } : {}
4843
4879
  }
4844
4880
  );
@@ -4859,7 +4895,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4859
4895
  * `origin: "owned"` for org-owned plays.
4860
4896
  */
4861
4897
  async listPlays(options) {
4862
- if (!_optionalChain([options, 'optionalAccess', _278 => _278.grep, 'optionalAccess', _279 => _279.trim, 'call', _280 => _280()])) {
4898
+ if (!_optionalChain([options, 'optionalAccess', _280 => _280.grep, 'optionalAccess', _281 => _281.trim, 'call', _282 => _282()])) {
4863
4899
  return (await this.requestPlaysPage(options, false)).plays;
4864
4900
  }
4865
4901
  const plays = [];
@@ -4881,45 +4917,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
4881
4917
  }
4882
4918
  async requestPlaysPage(options, paginateInventory = true) {
4883
4919
  const params = new URLSearchParams();
4884
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _281 => _281.grep, 'optionalAccess', _282 => _282.trim, 'call', _283 => _283()]))
4920
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _283 => _283.grep, 'optionalAccess', _284 => _284.trim, 'call', _285 => _285()]))
4885
4921
  params.set("inventory_paginated", "1");
4886
- if (_optionalChain([options, 'optionalAccess', _284 => _284.origin])) params.set("origin", options.origin);
4887
- if (_optionalChain([options, 'optionalAccess', _285 => _285.categories])) {
4922
+ if (_optionalChain([options, 'optionalAccess', _286 => _286.origin])) params.set("origin", options.origin);
4923
+ if (_optionalChain([options, 'optionalAccess', _287 => _287.categories])) {
4888
4924
  params.set(
4889
4925
  "categories",
4890
4926
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
4891
4927
  );
4892
4928
  }
4893
- if (_optionalChain([options, 'optionalAccess', _286 => _286.categories]) || _optionalChain([options, 'optionalAccess', _287 => _287.includeToolCategories])) {
4929
+ if (_optionalChain([options, 'optionalAccess', _288 => _288.categories]) || _optionalChain([options, 'optionalAccess', _289 => _289.includeToolCategories])) {
4894
4930
  params.set("include_tool_categories", "1");
4895
4931
  }
4896
- if (_optionalChain([options, 'optionalAccess', _288 => _288.tags])) {
4932
+ if (_optionalChain([options, 'optionalAccess', _290 => _290.tags])) {
4897
4933
  params.set(
4898
4934
  "tags",
4899
4935
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
4900
4936
  );
4901
4937
  }
4902
- if (_optionalChain([options, 'optionalAccess', _289 => _289.includeArchived])) params.set("include_archived", "1");
4903
- if (_optionalChain([options, 'optionalAccess', _290 => _290.includeCostEstimates])) {
4938
+ if (_optionalChain([options, 'optionalAccess', _291 => _291.includeArchived])) params.set("include_archived", "1");
4939
+ if (_optionalChain([options, 'optionalAccess', _292 => _292.includeCostEstimates])) {
4904
4940
  params.set("include_cost_estimates", "1");
4905
4941
  }
4906
- if (_optionalChain([options, 'optionalAccess', _291 => _291.grep, 'optionalAccess', _292 => _292.trim, 'call', _293 => _293()])) {
4942
+ if (_optionalChain([options, 'optionalAccess', _293 => _293.grep, 'optionalAccess', _294 => _294.trim, 'call', _295 => _295()])) {
4907
4943
  params.set("grep", options.grep.trim());
4908
4944
  params.set("limit", "60");
4909
4945
  }
4910
- if (_optionalChain([options, 'optionalAccess', _294 => _294.limit]) !== void 0) {
4946
+ if (_optionalChain([options, 'optionalAccess', _296 => _296.limit]) !== void 0) {
4911
4947
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
4912
4948
  throw new Error("Play page limit must be a positive integer");
4913
4949
  }
4914
4950
  params.set("limit", String(options.limit));
4915
4951
  }
4916
- if (_optionalChain([options, 'optionalAccess', _295 => _295.cursor])) params.set("cursor", options.cursor);
4952
+ if (_optionalChain([options, 'optionalAccess', _297 => _297.cursor])) params.set("cursor", options.cursor);
4917
4953
  const suffix = params.size ? `?${params.toString()}` : "";
4918
4954
  const response = await this.http.get(`/api/v2/plays${suffix}`);
4919
4955
  return {
4920
4956
  plays: _nullishCoalesce(response.plays, () => ( [])),
4921
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _296 => _296.pagination, 'optionalAccess', _297 => _297.cursor]), () => ( response.cursor)), () => ( null)),
4922
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _298 => _298.pagination, 'optionalAccess', _299 => _299.hasMore]), () => ( response.hasMore)))
4957
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _298 => _298.pagination, 'optionalAccess', _299 => _299.cursor]), () => ( response.cursor)), () => ( null)),
4958
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _300 => _300.pagination, 'optionalAccess', _301 => _301.hasMore]), () => ( response.hasMore)))
4923
4959
  };
4924
4960
  }
4925
4961
  /** Read definition-level settings, independently of code revisions. */
@@ -4969,8 +5005,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4969
5005
  return this.http.post("/api/v2/integrations/connect", {
4970
5006
  provider: "slack",
4971
5007
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
4972
- ..._optionalChain([options, 'optionalAccess', _300 => _300.successUrl]) ? { success_url: options.successUrl } : {},
4973
- ..._optionalChain([options, 'optionalAccess', _301 => _301.failureUrl]) ? { failure_url: options.failureUrl } : {}
5008
+ ..._optionalChain([options, 'optionalAccess', _302 => _302.successUrl]) ? { success_url: options.successUrl } : {},
5009
+ ..._optionalChain([options, 'optionalAccess', _303 => _303.failureUrl]) ? { failure_url: options.failureUrl } : {}
4974
5010
  });
4975
5011
  }
4976
5012
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5045,7 +5081,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5045
5081
  }
5046
5082
  const targets = input.targets.map(parseNotificationGroupTarget);
5047
5083
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5048
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _302 => _302[0], 'optionalAccess', _303 => _303.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5084
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _304 => _304[0], 'optionalAccess', _305 => _305.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5049
5085
  if (legacyEvents.length > 0 && !legacyTarget) {
5050
5086
  throw new Error(
5051
5087
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5081,7 +5117,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5081
5117
  const existingGroup = current.configuration.groups.find(
5082
5118
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5083
5119
  );
5084
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _304 => _304.groupKey]), () => ( notificationObjectKey("group")));
5120
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _306 => _306.groupKey]), () => ( notificationObjectKey("group")));
5085
5121
  const group = _nullishCoalesce(existingGroup, () => ( {
5086
5122
  groupKey,
5087
5123
  name,
@@ -5299,13 +5335,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
5299
5335
  */
5300
5336
  async getPlay(name, options) {
5301
5337
  const encodedName = encodeURIComponent(name);
5302
- const query = _optionalChain([options, 'optionalAccess', _305 => _305.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _306 => _306.guidance]) ? "?include=guidance" : "";
5338
+ const query = _optionalChain([options, 'optionalAccess', _307 => _307.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _308 => _308.guidance]) ? "?include=guidance" : "";
5303
5339
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
5304
5340
  }
5305
5341
  /** Read one trigger inventory page without loading run histories. */
5306
5342
  async listPlayTriggerInventory(options) {
5307
5343
  const params = new URLSearchParams({ view: "inventory" });
5308
- if (_optionalChain([options, 'optionalAccess', _307 => _307.cursor])) params.set("cursor", options.cursor);
5344
+ if (_optionalChain([options, 'optionalAccess', _309 => _309.cursor])) params.set("cursor", options.cursor);
5309
5345
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5310
5346
  }
5311
5347
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5314,7 +5350,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5314
5350
  view: "history",
5315
5351
  binding_id: bindingId
5316
5352
  });
5317
- if (_optionalChain([options, 'optionalAccess', _308 => _308.limit]) !== void 0)
5353
+ if (_optionalChain([options, 'optionalAccess', _310 => _310.limit]) !== void 0)
5318
5354
  params.set("history_limit", String(options.limit));
5319
5355
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5320
5356
  }
@@ -5350,7 +5386,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5350
5386
  */
5351
5387
  async listPlayVersions(name, options) {
5352
5388
  const encodedName = encodeURIComponent(name);
5353
- const suffix = _optionalChain([options, 'optionalAccess', _309 => _309.full]) ? "?full=true" : "";
5389
+ const suffix = _optionalChain([options, 'optionalAccess', _311 => _311.full]) ? "?full=true" : "";
5354
5390
  const response = await this.http.get(
5355
5391
  `/api/v2/plays/${encodedName}/versions${suffix}`
5356
5392
  );
@@ -5503,14 +5539,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
5503
5539
  */
5504
5540
  async runPlay(code, csvPath, name, options) {
5505
5541
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
5506
- input: _optionalChain([options, 'optionalAccess', _310 => _310.input]),
5507
- sourceCode: _optionalChain([options, 'optionalAccess', _311 => _311.sourceCode]),
5508
- artifact: _optionalChain([options, 'optionalAccess', _312 => _312.artifact]),
5509
- compilerManifest: _optionalChain([options, 'optionalAccess', _313 => _313.compilerManifest]),
5510
- inputFile: _optionalChain([options, 'optionalAccess', _314 => _314.inputFile]),
5511
- packagedFiles: _optionalChain([options, 'optionalAccess', _315 => _315.packagedFiles]),
5512
- force: _optionalChain([options, 'optionalAccess', _316 => _316.force]),
5513
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _317 => _317.forceToolRefresh])
5542
+ input: _optionalChain([options, 'optionalAccess', _312 => _312.input]),
5543
+ sourceCode: _optionalChain([options, 'optionalAccess', _313 => _313.sourceCode]),
5544
+ artifact: _optionalChain([options, 'optionalAccess', _314 => _314.artifact]),
5545
+ compilerManifest: _optionalChain([options, 'optionalAccess', _315 => _315.compilerManifest]),
5546
+ inputFile: _optionalChain([options, 'optionalAccess', _316 => _316.inputFile]),
5547
+ packagedFiles: _optionalChain([options, 'optionalAccess', _317 => _317.packagedFiles]),
5548
+ force: _optionalChain([options, 'optionalAccess', _318 => _318.force]),
5549
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _319 => _319.forceToolRefresh])
5514
5550
  });
5515
5551
  const start = Date.now();
5516
5552
  const state = {
@@ -5521,7 +5557,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5521
5557
  latest: null
5522
5558
  };
5523
5559
  let terminalObserved = null;
5524
- if (_optionalChain([options, 'optionalAccess', _318 => _318.signal, 'optionalAccess', _319 => _319.aborted])) {
5560
+ if (_optionalChain([options, 'optionalAccess', _320 => _320.signal, 'optionalAccess', _321 => _321.aborted])) {
5525
5561
  await this.cancelPlay(workflowId);
5526
5562
  return {
5527
5563
  success: false,
@@ -5532,9 +5568,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5532
5568
  };
5533
5569
  }
5534
5570
  for await (const event of this.watchRunEvents(workflowId, {
5535
- signal: _optionalChain([options, 'optionalAccess', _320 => _320.signal])
5571
+ signal: _optionalChain([options, 'optionalAccess', _322 => _322.signal])
5536
5572
  })) {
5537
- if (_optionalChain([options, 'optionalAccess', _321 => _321.signal, 'optionalAccess', _322 => _322.aborted])) {
5573
+ if (_optionalChain([options, 'optionalAccess', _323 => _323.signal, 'optionalAccess', _324 => _324.aborted])) {
5538
5574
  await this.cancelPlay(workflowId);
5539
5575
  return {
5540
5576
  success: false,
@@ -5544,19 +5580,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
5544
5580
  error: "Cancelled by user"
5545
5581
  };
5546
5582
  }
5547
- const previousStatus = _optionalChain([state, 'access', _323 => _323.latest, 'optionalAccess', _324 => _324.status]);
5583
+ const previousStatus = _optionalChain([state, 'access', _325 => _325.latest, 'optionalAccess', _326 => _326.status]);
5548
5584
  const status = updatePlayLiveStatusState(state, event);
5549
5585
  if (!status) {
5550
5586
  continue;
5551
5587
  }
5552
5588
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
5553
- _optionalChain([options, 'optionalAccess', _325 => _325.onProgress, 'optionalCall', _326 => _326(status)]);
5589
+ _optionalChain([options, 'optionalAccess', _327 => _327.onProgress, 'optionalCall', _328 => _328(status)]);
5554
5590
  }
5555
5591
  if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
5556
5592
  terminalObserved = status;
5557
5593
  }
5558
5594
  }
5559
- if (_optionalChain([options, 'optionalAccess', _327 => _327.signal, 'optionalAccess', _328 => _328.aborted])) {
5595
+ if (_optionalChain([options, 'optionalAccess', _329 => _329.signal, 'optionalAccess', _330 => _330.aborted])) {
5560
5596
  await this.cancelPlay(workflowId);
5561
5597
  return {
5562
5598
  success: false,
@@ -5609,7 +5645,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5609
5645
  const response = await this.http.get(
5610
5646
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
5611
5647
  );
5612
- const event = _optionalChain([response, 'access', _329 => _329.entries, 'optionalAccess', _330 => _330[0]]);
5648
+ const event = _optionalChain([response, 'access', _331 => _331.entries, 'optionalAccess', _332 => _332[0]]);
5613
5649
  if (!event) {
5614
5650
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
5615
5651
  "No usage event was found for this request_id.",
@@ -5740,7 +5776,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5740
5776
  async cancelBillingSubscription(options) {
5741
5777
  return this.http.post(
5742
5778
  "/api/v2/billing/subscription/cancel",
5743
- { action: _optionalChain([options, 'optionalAccess', _331 => _331.undo]) ? "undo_cancel" : "cancel" }
5779
+ { action: _optionalChain([options, 'optionalAccess', _333 => _333.undo]) ? "undo_cancel" : "cancel" }
5744
5780
  );
5745
5781
  }
5746
5782
  /**
@@ -5752,7 +5788,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5752
5788
  */
5753
5789
  async listBillingInvoices(options) {
5754
5790
  const params = new URLSearchParams();
5755
- if (_optionalChain([options, 'optionalAccess', _332 => _332.limit]) !== void 0) {
5791
+ if (_optionalChain([options, 'optionalAccess', _334 => _334.limit]) !== void 0) {
5756
5792
  params.set("limit", String(options.limit));
5757
5793
  }
5758
5794
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -5862,7 +5898,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5862
5898
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
5863
5899
  async createTargetBillingPortalSession(options) {
5864
5900
  const response = await this.http.post(
5865
- _optionalChain([options, 'optionalAccess', _333 => _333.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
5901
+ _optionalChain([options, 'optionalAccess', _335 => _335.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
5866
5902
  {}
5867
5903
  );
5868
5904
  return response.data;
@@ -5912,8 +5948,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5912
5948
  return this.http.request("/api/v2/monitors/audit", {
5913
5949
  method: "POST",
5914
5950
  body: {
5915
- ..._optionalChain([options, 'optionalAccess', _334 => _334.fleetId]) ? { fleet_id: options.fleetId } : {},
5916
- ..._optionalChain([options, 'optionalAccess', _335 => _335.cursor]) ? { cursor: options.cursor } : {}
5951
+ ..._optionalChain([options, 'optionalAccess', _336 => _336.fleetId]) ? { fleet_id: options.fleetId } : {},
5952
+ ..._optionalChain([options, 'optionalAccess', _337 => _337.cursor]) ? { cursor: options.cursor } : {}
5917
5953
  },
5918
5954
  maxRetries: 0
5919
5955
  });
@@ -5923,8 +5959,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5923
5959
  return this.http.request("/api/v2/monitors/repair", {
5924
5960
  method: "POST",
5925
5961
  body: {
5926
- ..._optionalChain([options, 'optionalAccess', _336 => _336.fleetId]) ? { fleet_id: options.fleetId } : {},
5927
- ..._optionalChain([options, 'optionalAccess', _337 => _337.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
5962
+ ..._optionalChain([options, 'optionalAccess', _338 => _338.fleetId]) ? { fleet_id: options.fleetId } : {},
5963
+ ..._optionalChain([options, 'optionalAccess', _339 => _339.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
5928
5964
  },
5929
5965
  maxRetries: 0
5930
5966
  });
@@ -5932,7 +5968,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5932
5968
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
5933
5969
  async readMonitorsHealth(options) {
5934
5970
  const params = new URLSearchParams();
5935
- if (_optionalChain([options, 'optionalAccess', _338 => _338.fleetId])) params.set("fleet_id", options.fleetId);
5971
+ if (_optionalChain([options, 'optionalAccess', _340 => _340.fleetId])) params.set("fleet_id", options.fleetId);
5936
5972
  const query = params.toString();
5937
5973
  const suffix = query ? `?${query}` : "";
5938
5974
  return this.http.request(
@@ -6005,7 +6041,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6005
6041
  );
6006
6042
  }
6007
6043
  const params = new URLSearchParams();
6008
- if (_optionalChain([options, 'optionalAccess', _339 => _339.cursor])) params.set("cursor", options.cursor);
6044
+ if (_optionalChain([options, 'optionalAccess', _341 => _341.cursor])) params.set("cursor", options.cursor);
6009
6045
  const suffix = params.size > 0 ? `?${params}` : "";
6010
6046
  return this.http.request(
6011
6047
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6049,7 +6085,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6049
6085
  * `client.monitors.deploy(...)`.
6050
6086
  */
6051
6087
  async deployMonitor(definition, options) {
6052
- if (_optionalChain([options, 'optionalAccess', _340 => _340.dryRun])) {
6088
+ if (_optionalChain([options, 'optionalAccess', _342 => _342.dryRun])) {
6053
6089
  return this.http.request("/api/v2/monitors/check", {
6054
6090
  method: "POST",
6055
6091
  body: definition
@@ -6085,12 +6121,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6085
6121
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6086
6122
  async listMonitors(options) {
6087
6123
  const params = new URLSearchParams();
6088
- if (_optionalChain([options, 'optionalAccess', _341 => _341.state])) params.set("state", options.state);
6089
- else if (_optionalChain([options, 'optionalAccess', _342 => _342.status])) params.set("status", options.status);
6090
- if (_optionalChain([options, 'optionalAccess', _343 => _343.limit]) !== void 0)
6124
+ if (_optionalChain([options, 'optionalAccess', _343 => _343.state])) params.set("state", options.state);
6125
+ else if (_optionalChain([options, 'optionalAccess', _344 => _344.status])) params.set("status", options.status);
6126
+ if (_optionalChain([options, 'optionalAccess', _345 => _345.limit]) !== void 0)
6091
6127
  params.set("limit", String(options.limit));
6092
- if (_optionalChain([options, 'optionalAccess', _344 => _344.cursor])) params.set("cursor", options.cursor);
6093
- if (_optionalChain([options, 'optionalAccess', _345 => _345.includeConsumers])) params.set("include_consumers", "true");
6128
+ if (_optionalChain([options, 'optionalAccess', _346 => _346.cursor])) params.set("cursor", options.cursor);
6129
+ if (_optionalChain([options, 'optionalAccess', _347 => _347.includeConsumers])) params.set("include_consumers", "true");
6094
6130
  const query = params.toString();
6095
6131
  const suffix = query ? `?${query}` : "";
6096
6132
  return this.http.request(
@@ -6106,7 +6142,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6106
6142
  );
6107
6143
  }
6108
6144
  async testMonitorWebhook(key, payload, options) {
6109
- if (_optionalChain([options, 'optionalAccess', _346 => _346.dispatch]) === true || _optionalChain([options, 'optionalAccess', _347 => _347.validationOnly]) === false) {
6145
+ if (_optionalChain([options, 'optionalAccess', _348 => _348.dispatch]) === true || _optionalChain([options, 'optionalAccess', _349 => _349.validationOnly]) === false) {
6110
6146
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
6111
6147
  "Monitor tests are validation-only and cannot dispatch events.",
6112
6148
  void 0,
@@ -6161,7 +6197,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6161
6197
  }
6162
6198
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6163
6199
  async deleteMonitor(key, options) {
6164
- if (_optionalChain([options, 'optionalAccess', _348 => _348.localOnly]) === true) {
6200
+ if (_optionalChain([options, 'optionalAccess', _350 => _350.localOnly]) === true) {
6165
6201
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
6166
6202
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6167
6203
  void 0,
@@ -6169,11 +6205,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6169
6205
  );
6170
6206
  }
6171
6207
  const params = new URLSearchParams();
6172
- if (_optionalChain([options, 'optionalAccess', _349 => _349.dryRun])) params.set("dry_run", "true");
6208
+ if (_optionalChain([options, 'optionalAccess', _351 => _351.dryRun])) params.set("dry_run", "true");
6173
6209
  const query = params.toString();
6174
6210
  return this.http.request(
6175
6211
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6176
- _optionalChain([options, 'optionalAccess', _350 => _350.dryRun]) ? { method: "DELETE" } : {
6212
+ _optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? { method: "DELETE" } : {
6177
6213
  method: "DELETE",
6178
6214
  // Deletion is a provider lifecycle operation. A timeout is an
6179
6215
  // unknown outcome, not authority to begin another delete attempt.
@@ -6186,10 +6222,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6186
6222
  * Prefer `client.monitors.reactivate(...)`.
6187
6223
  */
6188
6224
  async reactivateMonitor(key, options) {
6189
- const query = _optionalChain([options, 'optionalAccess', _351 => _351.dryRun]) ? "?dry_run=true" : "";
6225
+ const query = _optionalChain([options, 'optionalAccess', _353 => _353.dryRun]) ? "?dry_run=true" : "";
6190
6226
  return this.http.request(
6191
6227
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6192
- _optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? { method: "POST", body: {} } : {
6228
+ _optionalChain([options, 'optionalAccess', _354 => _354.dryRun]) ? { method: "POST", body: {} } : {
6193
6229
  method: "POST",
6194
6230
  body: {},
6195
6231
  // Reactivation can create an upstream resource, so it must not use
@@ -6203,7 +6239,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6203
6239
  // ——————————————————————————————————————————————————————————
6204
6240
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6205
6241
  monitorJobIdempotencyKey(operation) {
6206
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _353 => _353.crypto, 'optionalAccess', _354 => _354.randomUUID, 'optionalCall', _355 => _355()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6242
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _355 => _355.crypto, 'optionalAccess', _356 => _356.randomUUID, 'optionalCall', _357 => _357()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6207
6243
  const prefix = "monitor-job-";
6208
6244
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6209
6245
  const maxOperationLength = Math.max(
@@ -6214,7 +6250,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6214
6250
  }
6215
6251
  monitorJobHeaders(operation, idempotencyKey) {
6216
6252
  return {
6217
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _356 => _356.trim, 'call', _357 => _357()]) || this.monitorJobIdempotencyKey(operation)
6253
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _358 => _358.trim, 'call', _359 => _359()]) || this.monitorJobIdempotencyKey(operation)
6218
6254
  };
6219
6255
  }
6220
6256
  async deployMonitorBatch(definitions, options) {
@@ -6225,7 +6261,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6225
6261
  body: { version: 1, kind: "batch", monitors: definitions },
6226
6262
  headers: this.monitorJobHeaders(
6227
6263
  "batch-deploy",
6228
- _optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
6264
+ _optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
6229
6265
  ),
6230
6266
  maxRetries: 0,
6231
6267
  exactUrlOnly: true
@@ -6244,11 +6280,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6244
6280
  version: 1,
6245
6281
  kind: "batch",
6246
6282
  monitors: definitions,
6247
- ..._optionalChain([options, 'optionalAccess', _359 => _359.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6283
+ ..._optionalChain([options, 'optionalAccess', _361 => _361.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6248
6284
  },
6249
6285
  headers: this.monitorJobHeaders(
6250
6286
  `batch-sync-${batchId}`,
6251
- _optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
6287
+ _optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
6252
6288
  ),
6253
6289
  maxRetries: 0,
6254
6290
  exactUrlOnly: true
@@ -6263,7 +6299,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6263
6299
  body: {},
6264
6300
  headers: this.monitorJobHeaders(
6265
6301
  `batch-start-${batchId}`,
6266
- _optionalChain([options, 'optionalAccess', _361 => _361.idempotencyKey])
6302
+ _optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
6267
6303
  ),
6268
6304
  maxRetries: 0,
6269
6305
  exactUrlOnly: true
@@ -6278,7 +6314,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6278
6314
  body: {},
6279
6315
  headers: this.monitorJobHeaders(
6280
6316
  `batch-stop-${batchId}`,
6281
- _optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
6317
+ _optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
6282
6318
  ),
6283
6319
  maxRetries: 0,
6284
6320
  exactUrlOnly: true
@@ -6299,7 +6335,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6299
6335
  body: {},
6300
6336
  headers: this.monitorJobHeaders(
6301
6337
  `${action}-${monitorKey}`,
6302
- _optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
6338
+ _optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey])
6303
6339
  ),
6304
6340
  maxRetries: 0,
6305
6341
  exactUrlOnly: true
@@ -6312,7 +6348,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6312
6348
  body: definition,
6313
6349
  headers: this.monitorJobHeaders(
6314
6350
  `sync-${definition.key}`,
6315
- _optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
6351
+ _optionalChain([options, 'optionalAccess', _366 => _366.idempotencyKey])
6316
6352
  ),
6317
6353
  maxRetries: 0,
6318
6354
  exactUrlOnly: true
@@ -6325,7 +6361,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6325
6361
  );
6326
6362
  }
6327
6363
  async getMonitorJobLogs(jobId, options) {
6328
- const query = _optionalChain([options, 'optionalAccess', _365 => _365.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6364
+ const query = _optionalChain([options, 'optionalAccess', _367 => _367.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6329
6365
  return this.http.request(
6330
6366
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
6331
6367
  { method: "GET" }
@@ -6338,15 +6374,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6338
6374
  );
6339
6375
  }
6340
6376
  async waitForMonitorJob(jobId, options) {
6341
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _366 => _366.timeoutMs]), () => ( 10 * 6e4)));
6342
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _367 => _367.pollIntervalMs]), () => ( 2e3)));
6377
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _368 => _368.timeoutMs]), () => ( 10 * 6e4)));
6378
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _369 => _369.pollIntervalMs]), () => ( 2e3)));
6343
6379
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
6344
6380
  const startedAt = Date.now();
6345
6381
  let latest = await this.getMonitorJob(jobId);
6346
6382
  while (true) {
6347
- _optionalChain([options, 'optionalAccess', _368 => _368.onProgress, 'optionalCall', _369 => _369(latest)]);
6383
+ _optionalChain([options, 'optionalAccess', _370 => _370.onProgress, 'optionalCall', _371 => _371(latest)]);
6348
6384
  const job = latest.job;
6349
- const state = typeof _optionalChain([job, 'optionalAccess', _370 => _370.state]) === "string" ? job.state : void 0;
6385
+ const state = typeof _optionalChain([job, 'optionalAccess', _372 => _372.state]) === "string" ? job.state : void 0;
6350
6386
  if (state && terminal.has(state)) return latest;
6351
6387
  if (Date.now() - startedAt >= timeoutMs) return latest;
6352
6388
  await sleep(pollIntervalMs);
@@ -6357,12 +6393,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6357
6393
  // Monitor Fleets
6358
6394
  // ——————————————————————————————————————————————————————————
6359
6395
  monitorFleetIdempotencyKey(operation) {
6360
- const uuid = _optionalChain([globalThis, 'access', _371 => _371.crypto, 'optionalAccess', _372 => _372.randomUUID, 'optionalCall', _373 => _373()]);
6396
+ const uuid = _optionalChain([globalThis, 'access', _373 => _373.crypto, 'optionalAccess', _374 => _374.randomUUID, 'optionalCall', _375 => _375()]);
6361
6397
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
6362
6398
  }
6363
6399
  monitorFleetHeaders(operation, idempotencyKey) {
6364
6400
  return {
6365
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _374 => _374.trim, 'call', _375 => _375()]) || this.monitorFleetIdempotencyKey(operation)
6401
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _376 => _376.trim, 'call', _377 => _377()]) || this.monitorFleetIdempotencyKey(operation)
6366
6402
  };
6367
6403
  }
6368
6404
  monitorFleetPath(fleetId) {
@@ -6382,15 +6418,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6382
6418
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
6383
6419
  const body = {
6384
6420
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
6385
- ..._optionalChain([options, 'optionalAccess', _376 => _376.dryRun]) ? { dry_run: true } : {},
6386
- ..._optionalChain([options, 'optionalAccess', _377 => _377.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6421
+ ..._optionalChain([options, 'optionalAccess', _378 => _378.dryRun]) ? { dry_run: true } : {},
6422
+ ..._optionalChain([options, 'optionalAccess', _379 => _379.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6387
6423
  };
6388
6424
  return this.http.request(
6389
6425
  this.monitorFleetPath(fleetId),
6390
6426
  {
6391
6427
  method: "PUT",
6392
6428
  body,
6393
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _378 => _378.idempotencyKey])),
6429
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _380 => _380.idempotencyKey])),
6394
6430
  maxRetries: 0,
6395
6431
  exactUrlOnly: true
6396
6432
  }
@@ -6403,8 +6439,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6403
6439
  }
6404
6440
  async getMonitorFleet(fleetId, options) {
6405
6441
  const params = new URLSearchParams();
6406
- if (_optionalChain([options, 'optionalAccess', _379 => _379.drift])) params.set("drift", "1");
6407
- if (_optionalChain([options, 'optionalAccess', _380 => _380.limit]) !== void 0)
6442
+ if (_optionalChain([options, 'optionalAccess', _381 => _381.drift])) params.set("drift", "1");
6443
+ if (_optionalChain([options, 'optionalAccess', _382 => _382.limit]) !== void 0)
6408
6444
  params.set("limit", String(options.limit));
6409
6445
  const query = params.toString();
6410
6446
  return this.http.request(
@@ -6417,10 +6453,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6417
6453
  this.monitorFleetPath(fleetId),
6418
6454
  {
6419
6455
  method: "DELETE",
6420
- body: _optionalChain([options, 'optionalAccess', _381 => _381.dryRun]) ? { dry_run: true } : {},
6456
+ body: _optionalChain([options, 'optionalAccess', _383 => _383.dryRun]) ? { dry_run: true } : {},
6421
6457
  headers: this.monitorFleetHeaders(
6422
6458
  "deactivate",
6423
- _optionalChain([options, 'optionalAccess', _382 => _382.idempotencyKey])
6459
+ _optionalChain([options, 'optionalAccess', _384 => _384.idempotencyKey])
6424
6460
  ),
6425
6461
  maxRetries: 0,
6426
6462
  exactUrlOnly: true
@@ -6435,7 +6471,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6435
6471
  body: {},
6436
6472
  headers: this.monitorFleetHeaders(
6437
6473
  "reactivate",
6438
- _optionalChain([options, 'optionalAccess', _383 => _383.idempotencyKey])
6474
+ _optionalChain([options, 'optionalAccess', _385 => _385.idempotencyKey])
6439
6475
  ),
6440
6476
  maxRetries: 0,
6441
6477
  exactUrlOnly: true
@@ -6452,13 +6488,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
6452
6488
  * identical to "the request failed".
6453
6489
  */
6454
6490
  async waitForMonitorFleetConvergence(fleetId, options) {
6455
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _384 => _384.timeoutMs]), () => ( 10 * 6e4)));
6456
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _385 => _385.pollIntervalMs]), () => ( 2e3)));
6457
- const terminal = _optionalChain([options, 'optionalAccess', _386 => _386.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6491
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _386 => _386.timeoutMs]), () => ( 10 * 6e4)));
6492
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _387 => _387.pollIntervalMs]), () => ( 2e3)));
6493
+ const terminal = _optionalChain([options, 'optionalAccess', _388 => _388.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6458
6494
  const startedAt = Date.now();
6459
6495
  let latest = await this.getMonitorFleet(fleetId);
6460
6496
  while (true) {
6461
- _optionalChain([options, 'optionalAccess', _387 => _387.onProgress, 'optionalCall', _388 => _388(latest)]);
6497
+ _optionalChain([options, 'optionalAccess', _389 => _389.onProgress, 'optionalCall', _390 => _390(latest)]);
6462
6498
  const status = typeof latest.status === "string" ? latest.status : void 0;
6463
6499
  if (status && terminal.has(status)) return latest;
6464
6500
  if (Date.now() - startedAt >= timeoutMs) return latest;