deepline 0.3.389 → 0.3.391

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 (124) hide show
  1. package/dist/bundling-sources/sdk/src/agent-runtime.ts +21 -16
  2. package/dist/bundling-sources/sdk/src/billing-idempotency.ts +1 -1
  3. package/dist/bundling-sources/sdk/src/cli-invocation-id.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/client.ts +75 -52
  5. package/dist/bundling-sources/sdk/src/config.ts +3 -2
  6. package/dist/bundling-sources/sdk/src/db/query.ts +3 -3
  7. package/dist/bundling-sources/sdk/src/deployment-protection.ts +7 -5
  8. package/dist/bundling-sources/sdk/src/http.ts +31 -41
  9. package/dist/bundling-sources/sdk/src/index.ts +26 -26
  10. package/dist/bundling-sources/sdk/src/play.ts +5 -5
  11. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
  12. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
  13. package/dist/bundling-sources/sdk/src/plays/run-request.ts +2 -2
  14. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  15. package/dist/bundling-sources/sdk/src/runs/read-errors.ts +1 -1
  16. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +1 -1
  17. package/dist/bundling-sources/sdk/src/skills-version.ts +2 -2
  18. package/dist/bundling-sources/sdk/src/tool-calls.ts +3 -3
  19. package/dist/bundling-sources/sdk/src/types.ts +10 -1
  20. package/dist/bundling-sources/sdk/src/version.ts +1 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +87 -1
  22. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +19 -11
  23. package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +1 -1
  24. package/dist/cli/{auth-DEASEYUJ.mjs → auth-6QET7NFP.mjs} +4 -4
  25. package/dist/cli/auth-6ZUH42ZA.js +39 -0
  26. package/dist/cli/{billing-TUTB4H6F.mjs → billing-HAQ2VDQX.mjs} +4 -4
  27. package/dist/cli/{billing-QIWD5GYZ.js → billing-KJAGTCFR.js} +73 -73
  28. package/dist/cli/{chunk-WRLYF4DS.js → chunk-4S6X74A3.js} +2 -2
  29. package/dist/cli/{chunk-HXENYWVS.js → chunk-4TCT77UF.js} +485 -114
  30. package/dist/cli/{chunk-KWGB3RWA.js → chunk-556BMGEB.js} +235 -220
  31. package/dist/cli/{chunk-CCIEPJSX.mjs → chunk-6L4P7Z6C.mjs} +2 -2
  32. package/dist/cli/{chunk-M6BQYSV3.mjs → chunk-DRZFTRZJ.mjs} +46 -31
  33. package/dist/cli/{chunk-7IPMWJNZ.js → chunk-ED42XCOW.js} +226 -226
  34. package/dist/cli/{chunk-B6BQ6EAR.mjs → chunk-H2ER7QWR.mjs} +6 -6
  35. package/dist/cli/{chunk-HHRQYYHK.mjs → chunk-H3DCZOXR.mjs} +5 -5
  36. package/dist/cli/{chunk-63ZXA57X.mjs → chunk-HFTOOZGN.mjs} +3 -3
  37. package/dist/cli/{chunk-PPKNOVMF.mjs → chunk-I3MKXASV.mjs} +2 -2
  38. package/dist/cli/{chunk-CLOICRTK.js → chunk-I7EVBLTW.js} +6 -6
  39. package/dist/cli/{chunk-7WQGDKNO.mjs → chunk-K3ODOHOI.mjs} +34 -26
  40. package/dist/cli/{chunk-MCWGQIDV.js → chunk-KA7X75HC.js} +48 -48
  41. package/dist/cli/{chunk-NBXJJBBT.mjs → chunk-KWF4HJF7.mjs} +1 -1
  42. package/dist/cli/{chunk-CMWDXAQH.js → chunk-ME2DZAHC.js} +26 -26
  43. package/dist/cli/{chunk-Z43SUQUL.js → chunk-MHLCMJ2E.js} +99 -91
  44. package/dist/cli/{chunk-MP7FWY76.mjs → chunk-PFPP4BKS.mjs} +2 -2
  45. package/dist/cli/{chunk-HVDBGPDP.mjs → chunk-PQSA443V.mjs} +485 -114
  46. package/dist/cli/{chunk-RHAP7ZW5.mjs → chunk-QCWIORKR.mjs} +2 -2
  47. package/dist/cli/{chunk-FZXZLFNC.js → chunk-RA2SDTSX.js} +15 -15
  48. package/dist/cli/{chunk-ABLS54ZL.js → chunk-RTH26NF3.js} +61 -61
  49. package/dist/cli/{chunk-Z4ZB2CDV.mjs → chunk-TLHF54VX.mjs} +1 -1
  50. package/dist/cli/{chunk-FZZC3A7J.js → chunk-UOSKJIXE.js} +8 -8
  51. package/dist/cli/{chunk-GB3KEA34.mjs → chunk-VH4B5OYM.mjs} +1 -1
  52. package/dist/cli/{chunk-RPGSXBS3.js → chunk-WLODHQ7S.js} +1 -1
  53. package/dist/cli/{chunk-OWP6SI5W.js → chunk-XBPLTHGB.js} +8 -8
  54. package/dist/cli/{chunk-5VCRXKAU.js → chunk-XEV5LMS2.js} +50 -50
  55. package/dist/cli/{chunk-2L6BBM7Z.mjs → chunk-YBZY3EZF.mjs} +4 -4
  56. package/dist/cli/command-docs.d.mts +24 -1
  57. package/dist/cli/command-docs.d.ts +24 -1
  58. package/dist/cli/command-docs.js +8 -2
  59. package/dist/cli/command-docs.mjs +9 -3
  60. package/dist/cli/{csv-FYI4XWEA.js → csv-2WSF5TEM.js} +12 -12
  61. package/dist/cli/{csv-GQ5K6MDD.mjs → csv-V7UHOBFE.mjs} +3 -3
  62. package/dist/cli/{db-WYSI3J43.js → db-42RL4FZD.js} +29 -29
  63. package/dist/cli/{db-DYXQOAWZ.mjs → db-TD375E4N.mjs} +4 -4
  64. package/dist/cli/{describe-T25AHZEJ.js → describe-7WFCBZUY.js} +18 -18
  65. package/dist/cli/{describe-YIIUMAZF.mjs → describe-GPUKAWOZ.mjs} +8 -8
  66. package/dist/cli/{executions-3D7KAJ2C.js → executions-LGVG3FPH.js} +6 -6
  67. package/dist/cli/{executions-RYFSOPMQ.mjs → executions-M7O63JNA.mjs} +4 -4
  68. package/dist/cli/{feedback-CIZXMDMJ.mjs → feedback-6PBSKVB2.mjs} +3 -3
  69. package/dist/cli/{feedback-I7FWPC7V.js → feedback-PZZA2M4S.js} +7 -7
  70. package/dist/cli/{git-JCURDXPQ.mjs → git-2VIFM5DI.mjs} +4 -4
  71. package/dist/cli/git-ZSJD3BID.js +23 -0
  72. package/dist/cli/index.js +93 -93
  73. package/dist/cli/index.mjs +33 -33
  74. package/dist/cli/{legacy-noops-4BW4EZJG.mjs → legacy-noops-DPUBZI7N.mjs} +4 -4
  75. package/dist/cli/{legacy-noops-G6F5LNUM.js → legacy-noops-IQ6QTZNZ.js} +7 -7
  76. package/dist/cli/{monitors-43UXU5C3.js → monitors-6GWAZFYV.js} +85 -85
  77. package/dist/cli/{monitors-LTKH5IWE.mjs → monitors-KBZVQG2U.mjs} +4 -4
  78. package/dist/cli/{org-I3WHUV67.mjs → org-CP3VSJBX.mjs} +4 -4
  79. package/dist/cli/{org-7MSUEPXL.js → org-JKGTHXOZ.js} +64 -64
  80. package/dist/cli/{play-HRZXSNXV.mjs → play-DD2ME4L4.mjs} +7 -7
  81. package/dist/cli/play-G5GVMIBN.js +157 -0
  82. package/dist/cli/{providers-BY6JPMKP.mjs → providers-JUNOFKI7.mjs} +4 -4
  83. package/dist/cli/{providers-DWLWK5VX.js → providers-P34QYYG6.js} +7 -7
  84. package/dist/cli/{quickstart-E647CKUQ.mjs → quickstart-N6SWOK7E.mjs} +3 -3
  85. package/dist/cli/{quickstart-QO6GCK4U.js → quickstart-UL3DEFA4.js} +5 -5
  86. package/dist/cli/{search-3WUQBHRV.mjs → search-SC7I56HX.mjs} +5 -5
  87. package/dist/cli/search-W4GXWTOM.js +26 -0
  88. package/dist/cli/{secrets-CPNHE5XI.js → secrets-6ZJE7ZPM.js} +13 -13
  89. package/dist/cli/{secrets-WTGMFFP7.mjs → secrets-RTARNYF5.mjs} +4 -4
  90. package/dist/cli/{sessions-UFGGEDZP.js → sessions-6IZ2XHGW.js} +5 -5
  91. package/dist/cli/{sessions-6Q5E7GSY.mjs → sessions-7RKV2T3O.mjs} +4 -4
  92. package/dist/cli/{settings-QMEIKOUI.mjs → settings-V6PXA6HY.mjs} +7 -7
  93. package/dist/cli/{settings-NF5726RU.js → settings-YX3XJDXE.js} +74 -74
  94. package/dist/cli/{setup-J35MMJ7C.js → setup-CQ5VRNNU.js} +41 -41
  95. package/dist/cli/{setup-ZOQOJMJ7.mjs → setup-V2O4UJNT.mjs} +6 -6
  96. package/dist/cli/skills-LBZPJTPI.js +28 -0
  97. package/dist/cli/{skills-UFDKCSYR.mjs → skills-VHJZWEHA.mjs} +4 -4
  98. package/dist/cli/{tools-3SU3EUQT.mjs → tools-OD5WKEWY.mjs} +6 -6
  99. package/dist/cli/tools-TQNM473H.js +40 -0
  100. package/dist/cli/{update-SXYX4PMC.mjs → update-CRMNOMJ3.mjs} +6 -6
  101. package/dist/cli/update-QY6GAK6B.js +28 -0
  102. package/dist/cli/{workflow-2LINUMOP.mjs → workflow-EVDYNCDD.mjs} +5 -5
  103. package/dist/cli/{workflow-XAIEXDUI.js → workflow-XHORSD5T.js} +15 -15
  104. package/dist/{client-DEKvymBI.d.ts → client-BhK9kix9.d.ts} +19 -0
  105. package/dist/{client-0avPvYBP.d.mts → client-DpzZi4fU.d.mts} +19 -0
  106. package/dist/index.d.mts +2 -2
  107. package/dist/index.d.ts +2 -2
  108. package/dist/index.js +6 -6
  109. package/dist/index.mjs +3 -3
  110. package/dist/install-integrity.json +76 -76
  111. package/dist/plays/run-request.d.mts +1 -1
  112. package/dist/plays/run-request.d.ts +1 -1
  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-AOM2LA73.js +0 -39
  119. package/dist/cli/git-MVMIPHQ6.js +0 -23
  120. package/dist/cli/play-R5TYLP5L.js +0 -157
  121. package/dist/cli/search-34AC6FC7.js +0 -26
  122. package/dist/cli/skills-WGYISRE5.js +0 -28
  123. package/dist/cli/tools-Q642ZZ2M.js +0 -40
  124. package/dist/cli/update-T5MNWAQC.js +0 -28
@@ -21,7 +21,7 @@ var _chunkPAIMOGCMjs = require('./chunk-PAIMOGCM.js');
21
21
 
22
22
 
23
23
 
24
- var _chunkZ43SUQULjs = require('./chunk-Z43SUQUL.js');
24
+ var _chunkMHLCMJ2Ejs = require('./chunk-MHLCMJ2E.js');
25
25
 
26
26
 
27
27
 
@@ -137,7 +137,7 @@ async function queryCustomerDatabase(http, input) {
137
137
  if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (_optionalChain([error, 'access', _ => _.code, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
138
138
  // lost connections and explicitly unknown transaction resolution.
139
139
  /^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
140
- throw new (0, _chunkZ43SUQULjs.CustomerDbQueryOutcomeUnknownError)(
140
+ throw new (0, _chunkMHLCMJ2Ejs.CustomerDbQueryOutcomeUnknownError)(
141
141
  error,
142
142
  plan.request.body.operation_key
143
143
  );
@@ -145,7 +145,7 @@ async function queryCustomerDatabase(http, input) {
145
145
  throw error;
146
146
  }
147
147
  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) {
148
- throw new (0, _chunkZ43SUQULjs.CustomerDbQueryOutcomeUnknownError)(
148
+ throw new (0, _chunkMHLCMJ2Ejs.CustomerDbQueryOutcomeUnknownError)(
149
149
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
150
150
  "The SQL response did not contain a valid result.",
151
151
  200,
@@ -156,7 +156,7 @@ async function queryCustomerDatabase(http, input) {
156
156
  }
157
157
  const operation = result.operation;
158
158
  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))) {
159
- throw new (0, _chunkZ43SUQULjs.CustomerDbQueryOutcomeUnknownError)(
159
+ throw new (0, _chunkMHLCMJ2Ejs.CustomerDbQueryOutcomeUnknownError)(
160
160
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
161
161
  "The server did not confirm the original atomic SQL operation.",
162
162
  200,
@@ -2804,12 +2804,12 @@ function normalizePlayRunIntegrationMode(value) {
2804
2804
  }
2805
2805
  return void 0;
2806
2806
  }
2807
- function resolvePlayRunIntegrationMode(request) {
2807
+ function resolvePlayRunIntegrationMode(request, env) {
2808
2808
  return normalizePlayRunIntegrationMode(
2809
- _nullishCoalesce(request.integrationMode, () => ( process.env.DEEPLINE_EVAL_INTEGRATION_MODE))
2809
+ _nullishCoalesce(request.integrationMode, () => ( env.DEEPLINE_EVAL_INTEGRATION_MODE))
2810
2810
  );
2811
2811
  }
2812
- function resolvePlayRunRuntimeSelection(request) {
2812
+ function resolvePlayRunRuntimeSelection(request, env) {
2813
2813
  if (request.runtime !== void 0) {
2814
2814
  const runtime = normalizePlayRuntimeSelection(request.runtime);
2815
2815
  if (!runtime) {
@@ -2821,10 +2821,10 @@ function resolvePlayRunRuntimeSelection(request) {
2821
2821
  }
2822
2822
  return runtime;
2823
2823
  }
2824
- const configured = _optionalChain([process, 'access', _80 => _80.env, 'access', _81 => _81.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]);
2825
- const configuredNamespace = _optionalChain([process, 'access', _84 => _84.env, 'access', _85 => _85.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87()]);
2826
- const configuredToken = _optionalChain([process, 'access', _88 => _88.env, 'access', _89 => _89.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _90 => _90.trim, 'call', _91 => _91()]);
2827
- const configuredPlacementPolicy = _optionalChain([process, 'access', _92 => _92.env, 'access', _93 => _93.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]);
2824
+ const configured = _optionalChain([env, 'access', _80 => _80.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _81 => _81.trim, 'call', _82 => _82()]);
2825
+ const configuredNamespace = _optionalChain([env, 'access', _83 => _83.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _84 => _84.trim, 'call', _85 => _85()]);
2826
+ const configuredToken = _optionalChain([env, 'access', _86 => _86.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _87 => _87.trim, 'call', _88 => _88()]);
2827
+ const configuredPlacementPolicy = _optionalChain([env, 'access', _89 => _89.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _90 => _90.trim, 'call', _91 => _91()]);
2828
2828
  if (!configured) {
2829
2829
  if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
2830
2830
  const present = [];
@@ -2863,7 +2863,7 @@ function resolvePlayRunRuntimeSelection(request) {
2863
2863
  "INVALID_RUNTIME_NAMESPACE"
2864
2864
  );
2865
2865
  }
2866
- const configuredBackendValue = _optionalChain([process, 'access', _96 => _96.env, 'access', _97 => _97.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
2866
+ const configuredBackendValue = _optionalChain([env, 'access', _92 => _92.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _93 => _93.trim, 'call', _94 => _94()]);
2867
2867
  const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
2868
2868
  if (configuredBackendValue && !configuredBackend) {
2869
2869
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
@@ -2886,10 +2886,10 @@ function resolvePlayRunRuntimeSelection(request) {
2886
2886
  ...configuredPlacementPolicy ? { sandboxPlacementPolicy: configuredPlacementPolicy } : {}
2887
2887
  };
2888
2888
  }
2889
- function resolveStartPlayRunRequest(request) {
2890
- const integrationMode = resolvePlayRunIntegrationMode(request);
2891
- const testPolicyOverrides = _nullishCoalesce(request.testPolicyOverrides, () => ( parseEnvTestPolicyOverrides()));
2892
- const runtime = resolvePlayRunRuntimeSelection(request);
2889
+ function resolveStartPlayRunRequest(request, env) {
2890
+ const integrationMode = resolvePlayRunIntegrationMode(request, env);
2891
+ const testPolicyOverrides = _nullishCoalesce(request.testPolicyOverrides, () => ( parseEnvTestPolicyOverrides(env)));
2892
+ const runtime = resolvePlayRunRuntimeSelection(request, env);
2893
2893
  const resolved = { ...request };
2894
2894
  delete resolved.integrationMode;
2895
2895
  delete resolved.runtime;
@@ -2899,9 +2899,9 @@ function resolveStartPlayRunRequest(request) {
2899
2899
  if (testPolicyOverrides) resolved.testPolicyOverrides = testPolicyOverrides;
2900
2900
  return { request: resolved, runtime };
2901
2901
  }
2902
- function runtimeSelectionHeaders(runtime) {
2902
+ function runtimeSelectionHeaders(runtime, env) {
2903
2903
  if (!runtime) return void 0;
2904
- const token = _optionalChain([process, 'access', _100 => _100.env, 'access', _101 => _101.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()]);
2904
+ const token = _optionalChain([env, 'access', _95 => _95.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _96 => _96.trim, 'call', _97 => _97()]);
2905
2905
  if (!token) {
2906
2906
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2907
2907
  "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
@@ -2909,18 +2909,18 @@ function runtimeSelectionHeaders(runtime) {
2909
2909
  "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
2910
2910
  );
2911
2911
  }
2912
- const receivers = _optionalChain([process, 'access', _104 => _104.env, 'access', _105 => _105.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()]);
2912
+ const receivers = _optionalChain([env, 'access', _98 => _98.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()]);
2913
2913
  return {
2914
- [_chunkZ43SUQULjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2915
- ...receivers ? { [_chunkZ43SUQULjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2914
+ [_chunkMHLCMJ2Ejs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2915
+ ...receivers ? { [_chunkMHLCMJ2Ejs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2916
2916
  };
2917
2917
  }
2918
- function isolatedCiRuntimeEventReadHeaders() {
2919
- const schema = _optionalChain([process, 'access', _108 => _108.env, 'access', _109 => _109.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()]);
2920
- 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)) {
2918
+ function isolatedCiRuntimeEventReadHeaders(env) {
2919
+ const schema = _optionalChain([env, 'access', _101 => _101.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()]);
2920
+ if (_optionalChain([env, 'access', _104 => _104.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
2921
2921
  return void 0;
2922
2922
  }
2923
- const token = _optionalChain([process, 'access', _116 => _116.env, 'access', _117 => _117.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]);
2923
+ const token = _optionalChain([env, 'access', _107 => _107.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _108 => _108.trim, 'call', _109 => _109()]);
2924
2924
  if (!token) {
2925
2925
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2926
2926
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -2928,7 +2928,7 @@ function isolatedCiRuntimeEventReadHeaders() {
2928
2928
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
2929
2929
  );
2930
2930
  }
2931
- return { [_chunkZ43SUQULjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2931
+ return { [_chunkMHLCMJ2Ejs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2932
2932
  }
2933
2933
  function normalizeTestPolicyOverrides(value, source) {
2934
2934
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -2940,9 +2940,9 @@ function normalizeTestPolicyOverrides(value, source) {
2940
2940
  "INVALID_TEST_POLICY_OVERRIDES"
2941
2941
  );
2942
2942
  }
2943
- function parseEnvTestPolicyOverrides() {
2944
- const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _120 => _120.env, 'optionalAccess', _121 => _121.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
2945
- const trimmed = _optionalChain([raw, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
2943
+ function parseEnvTestPolicyOverrides(env) {
2944
+ const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
2945
+ const trimmed = _optionalChain([raw, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()]);
2946
2946
  if (!trimmed) return void 0;
2947
2947
  let parsed;
2948
2948
  try {
@@ -2970,7 +2970,7 @@ function isTransientCompileManifestError(error) {
2970
2970
  );
2971
2971
  }
2972
2972
  function requireCompileManifestResponse(response, playName) {
2973
- const compilerManifest = _optionalChain([response, 'optionalAccess', _124 => _124.compilerManifest]);
2973
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _112 => _112.compilerManifest]);
2974
2974
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
2975
2975
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2976
2976
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -3022,7 +3022,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
3022
3022
  }
3023
3023
  function searchParams(options) {
3024
3024
  const params = new URLSearchParams();
3025
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _125 => _125.query, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]), () => ( "")));
3025
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _113 => _113.query, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()]), () => ( "")));
3026
3026
  params.set(
3027
3027
  "include_search_debug",
3028
3028
  options.includeSearchDebug ? "true" : "false"
@@ -3032,13 +3032,13 @@ function searchParams(options) {
3032
3032
  if (options.offset !== void 0) {
3033
3033
  params.set("offset", String(options.offset));
3034
3034
  }
3035
- if (_optionalChain([options, 'access', _128 => _128.categories, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()])) {
3035
+ if (_optionalChain([options, 'access', _116 => _116.categories, 'optionalAccess', _117 => _117.trim, 'call', _118 => _118()])) {
3036
3036
  params.set("categories", options.categories.trim());
3037
3037
  }
3038
- if (_optionalChain([options, 'access', _131 => _131.searchTerms, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()])) {
3038
+ if (_optionalChain([options, 'access', _119 => _119.searchTerms, 'optionalAccess', _120 => _120.trim, 'call', _121 => _121()])) {
3039
3039
  params.set("search_terms", options.searchTerms.trim());
3040
3040
  }
3041
- if (_optionalChain([options, 'access', _134 => _134.task, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()])) params.set("task", options.task.trim());
3041
+ if (_optionalChain([options, 'access', _122 => _122.task, 'optionalAccess', _123 => _123.trim, 'call', _124 => _124()])) params.set("task", options.task.trim());
3042
3042
  return params;
3043
3043
  }
3044
3044
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -3077,17 +3077,17 @@ function preferPrebuiltPlayDescriptions(plays) {
3077
3077
  }
3078
3078
  function normalizePlayStatus(raw) {
3079
3079
  const runPackage = _chunkPAIMOGCMjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkPAIMOGCMjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
3080
- const packageRun = _optionalChain([runPackage, 'optionalAccess', _137 => _137.run]);
3081
- const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _138 => _138.status]) === "string" ? packageRun.status : null;
3080
+ const packageRun = _optionalChain([runPackage, 'optionalAccess', _125 => _125.run]);
3081
+ const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _126 => _126.status]) === "string" ? packageRun.status : null;
3082
3082
  const status = _chunkPAIMOGCMjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
3083
3083
  if (!status) {
3084
3084
  throw new Error(
3085
3085
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
3086
3086
  );
3087
3087
  }
3088
- const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _139 => _139.id]), () => ( ""));
3089
- const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _140 => _140.overview]), () => ( raw.overview));
3090
- const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _141 => _141.runStatus]), () => ( raw.runStatus));
3088
+ const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _127 => _127.id]), () => ( ""));
3089
+ const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _128 => _128.overview]), () => ( raw.overview));
3090
+ const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _129 => _129.runStatus]), () => ( raw.runStatus));
3091
3091
  return {
3092
3092
  ...raw,
3093
3093
  runId,
@@ -3189,15 +3189,16 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
3189
3189
  runId: status.runId || fallbackRunId,
3190
3190
  result: _nullishCoalesce(status.package, () => ( status.result)),
3191
3191
  ...status.package ? { package: status.package } : {},
3192
- logs: _nullishCoalesce(_optionalChain([status, 'access', _142 => _142.progress, 'optionalAccess', _143 => _143.logs]), () => ( [])),
3192
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _130 => _130.progress, 'optionalAccess', _131 => _131.logs]), () => ( [])),
3193
3193
  durationMs: Date.now() - startedAt,
3194
- error: _nullishCoalesce(_optionalChain([status, 'access', _144 => _144.progress, 'optionalAccess', _145 => _145.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3194
+ error: _nullishCoalesce(_optionalChain([status, 'access', _132 => _132.progress, 'optionalAccess', _133 => _133.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3195
3195
  };
3196
3196
  }
3197
3197
  var DeeplineClient = (_class = class _DeeplineClient {
3198
3198
 
3199
3199
 
3200
3200
 
3201
+
3201
3202
  /** Canonical run lifecycle namespace backed by `/api/v2/runs`. */
3202
3203
 
3203
3204
  /** Current mutable customer database namespace backed by `/api/v2/db/query`. */
@@ -3218,12 +3219,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3218
3219
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3219
3220
  */
3220
3221
  constructor(options) {
3221
- this.config = _chunkZ43SUQULjs.resolveConfig.call(void 0, options);
3222
- this.http = new (0, _chunkZ43SUQULjs.HttpClient)(this.config);
3222
+ this.config = _chunkMHLCMJ2Ejs.resolveConfig.call(void 0, options);
3223
+ this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
3224
+ this.http = new (0, _chunkMHLCMJ2Ejs.HttpClient)(this.config);
3223
3225
  this.toolCalls = new ToolCalls(
3224
3226
  this.http,
3225
3227
  this.config.timeout,
3226
- _optionalChain([options, 'optionalAccess', _146 => _146.timeout])
3228
+ _optionalChain([options, 'optionalAccess', _134 => _134.timeout])
3227
3229
  );
3228
3230
  this.runs = {
3229
3231
  getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
@@ -3284,7 +3286,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3284
3286
  {},
3285
3287
  {
3286
3288
  "Idempotency-Key": requireBillingIdempotencyKey(
3287
- _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _147 => _147.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3289
+ _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _135 => _135.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3288
3290
  )
3289
3291
  }
3290
3292
  ),
@@ -3303,7 +3305,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3303
3305
  available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
3304
3306
  check: (definition) => this.checkMonitor(definition),
3305
3307
  deploy: (definition, options2) => this.deployMonitor(definition, options2),
3306
- sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _148 => _148.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3308
+ sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _136 => _136.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3307
3309
  list: (options2) => this.listMonitors(options2),
3308
3310
  get: (key) => this.getMonitor(key),
3309
3311
  test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
@@ -3312,13 +3314,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3312
3314
  update: (key, patch) => this.updateMonitor(key, patch),
3313
3315
  delete: (key, options2) => this.deleteMonitor(key, options2),
3314
3316
  reactivate: (key, options2) => this.reactivateMonitor(key, options2),
3315
- start: (key, options2) => _optionalChain([options2, 'optionalAccess', _149 => _149.dryRun]) ? this.submitMonitorBatch({
3317
+ start: (key, options2) => _optionalChain([options2, 'optionalAccess', _137 => _137.dryRun]) ? this.submitMonitorBatch({
3316
3318
  kind: "reactivate",
3317
3319
  scope: { kind: "keys", monitorKeys: [key] },
3318
3320
  dryRun: true,
3319
3321
  idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3320
3322
  }) : this.submitScalarMonitorLifecycle(key, "start", options2),
3321
- stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _150 => _150.dryRun]) ? this.submitMonitorBatch({
3323
+ stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _138 => _138.dryRun]) ? this.submitMonitorBatch({
3322
3324
  kind: "deactivate",
3323
3325
  scope: { kind: "keys", monitorKeys: [key] },
3324
3326
  dryRun: true,
@@ -3369,7 +3371,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3369
3371
  type: _nullishCoalesce(field.type, () => ( void 0)),
3370
3372
  required: _nullishCoalesce(field.required, () => ( void 0))
3371
3373
  } : null
3372
- ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _151 => _151.name]))) : [];
3374
+ ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _139 => _139.name]))) : [];
3373
3375
  return fields.length > 0 ? { fields } : schema;
3374
3376
  }
3375
3377
  schemaMetadata(schema, key) {
@@ -3399,13 +3401,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3399
3401
  };
3400
3402
  }
3401
3403
  summarizePlayListItem(play, options) {
3402
- const aliases = _optionalChain([play, 'access', _152 => _152.aliases, 'optionalAccess', _153 => _153.length]) ? play.aliases : [play.name];
3404
+ const aliases = _optionalChain([play, 'access', _140 => _140.aliases, 'optionalAccess', _141 => _141.length]) ? play.aliases : [play.name];
3403
3405
  const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
3404
3406
  const rowOutputSchema = this.schemaMetadata(
3405
3407
  play.outputSchema,
3406
3408
  "rowOutputSchema"
3407
3409
  );
3408
- 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;
3410
+ const description = _optionalChain([play, 'access', _142 => _142.description, 'optionalAccess', _143 => _143.trim, 'call', _144 => _144()]) || _optionalChain([play, 'access', _145 => _145.currentRevision, 'optionalAccess', _146 => _146.description, 'optionalAccess', _147 => _147.trim, 'call', _148 => _148()]) || _optionalChain([play, 'access', _149 => _149.liveRevision, 'optionalAccess', _150 => _150.description, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]) || null;
3409
3411
  const runCommand = this.playRunCommand(play);
3410
3412
  const cloneEditStarter = this.playCloneEditStarter(play);
3411
3413
  return {
@@ -3425,9 +3427,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
3425
3427
  canEdit: play.canEdit,
3426
3428
  canClone: play.canClone,
3427
3429
  aliases,
3428
- inputSchema: _optionalChain([options, 'optionalAccess', _165 => _165.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
3429
- outputSchema: _optionalChain([options, 'optionalAccess', _166 => _166.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
3430
- 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,
3430
+ inputSchema: _optionalChain([options, 'optionalAccess', _153 => _153.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
3431
+ outputSchema: _optionalChain([options, 'optionalAccess', _154 => _154.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
3432
+ staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _155 => _155.currentRevision, 'optionalAccess', _156 => _156.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _157 => _157.liveRevision, 'optionalAccess', _158 => _158.staticPipeline])) ? play.liveRevision.staticPipeline : null,
3431
3433
  ...csvInput ? {
3432
3434
  csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
3433
3435
  } : {},
@@ -3439,7 +3441,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3439
3441
  // Read the live version off the live revision. It was previously only
3440
3442
  // ever written by the publish/live routes, so every list and describe
3441
3443
  // payload reported liveVersion: null even for an actively serving play.
3442
- liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _171 => _171.liveRevision, 'optionalAccess', _172 => _172.version]), () => ( null)),
3444
+ liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _159 => _159.liveRevision, 'optionalAccess', _160 => _160.version]), () => ( null)),
3443
3445
  ...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
3444
3446
  isDraftDirty: play.isDraftDirty
3445
3447
  };
@@ -3448,8 +3450,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3448
3450
  const play = detail.play;
3449
3451
  return {
3450
3452
  ...this.summarizePlayListItem(play, options),
3451
- currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _173 => _173.liveRevision, 'optionalAccess', _174 => _174.version]))), () => ( null)),
3452
- latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _175 => _175.latestRuns, 'access', _176 => _176[0], 'optionalAccess', _177 => _177.workflowId]))), () => ( null)),
3453
+ currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _161 => _161.liveRevision, 'optionalAccess', _162 => _162.version]))), () => ( null)),
3454
+ latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _163 => _163.latestRuns, 'access', _164 => _164[0], 'optionalAccess', _165 => _165.workflowId]))), () => ( null)),
3453
3455
  ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
3454
3456
  ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
3455
3457
  ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {},
@@ -3517,17 +3519,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3517
3519
  */
3518
3520
  async listTools(options) {
3519
3521
  const params = new URLSearchParams();
3520
- if (_optionalChain([options, 'optionalAccess', _178 => _178.categories, 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()])) {
3522
+ if (_optionalChain([options, 'optionalAccess', _166 => _166.categories, 'optionalAccess', _167 => _167.trim, 'call', _168 => _168()])) {
3521
3523
  params.set("categories", options.categories.trim());
3522
3524
  }
3523
- if (_optionalChain([options, 'optionalAccess', _181 => _181.tags, 'optionalAccess', _182 => _182.trim, 'call', _183 => _183()])) {
3525
+ if (_optionalChain([options, 'optionalAccess', _169 => _169.tags, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()])) {
3524
3526
  params.set("tags", options.tags.trim());
3525
3527
  }
3526
- if (_optionalChain([options, 'optionalAccess', _184 => _184.grep, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()])) {
3528
+ if (_optionalChain([options, 'optionalAccess', _172 => _172.grep, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()])) {
3527
3529
  params.set("grep", options.grep.trim());
3528
3530
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3529
3531
  }
3530
- params.set("compact", _optionalChain([options, 'optionalAccess', _187 => _187.compact]) === true ? "true" : "false");
3532
+ params.set("compact", _optionalChain([options, 'optionalAccess', _175 => _175.compact]) === true ? "true" : "false");
3531
3533
  const suffix = params.toString() ? `?${params.toString()}` : "";
3532
3534
  const res = await this.http.get(
3533
3535
  `/api/v2/tools${suffix}`
@@ -3536,7 +3538,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3536
3538
  }
3537
3539
  /** List discoverable providers without requiring a local plugin catalog. */
3538
3540
  async listProviders(options) {
3539
- const suffix = _optionalChain([options, 'optionalAccess', _188 => _188.changed]) ? "?changed=true" : "";
3541
+ const suffix = _optionalChain([options, 'optionalAccess', _176 => _176.changed]) ? "?changed=true" : "";
3540
3542
  const res = await this.http.get(
3541
3543
  `/api/v2/tools/providers${suffix}`
3542
3544
  );
@@ -3567,8 +3569,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3567
3569
  */
3568
3570
  async search(options = {}) {
3569
3571
  const params = searchParams(options);
3570
- if (_optionalChain([options, 'access', _189 => _189.types, 'optionalAccess', _190 => _190.length])) params.set("types", options.types.join(","));
3571
- if (_optionalChain([options, 'access', _191 => _191.exclude, 'optionalAccess', _192 => _192.length])) {
3572
+ if (_optionalChain([options, 'access', _177 => _177.types, 'optionalAccess', _178 => _178.length])) params.set("types", options.types.join(","));
3573
+ if (_optionalChain([options, 'access', _179 => _179.exclude, 'optionalAccess', _180 => _180.length])) {
3572
3574
  params.set("exclude", options.exclude.join(","));
3573
3575
  }
3574
3576
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3590,7 +3592,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3590
3592
  * ```
3591
3593
  */
3592
3594
  async getTool(toolId, options) {
3593
- if (_optionalChain([options, 'optionalAccess', _193 => _193.cliInvocationId]) !== void 0) {
3595
+ if (_optionalChain([options, 'optionalAccess', _181 => _181.cliInvocationId]) !== void 0) {
3594
3596
  validateCliInvocationId(options.cliInvocationId);
3595
3597
  }
3596
3598
  return this.http.request(
@@ -3603,7 +3605,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3603
3605
  retryApiErrors: true,
3604
3606
  headers: {
3605
3607
  "x-deepline-tool-meta-only": "1",
3606
- ..._optionalChain([options, 'optionalAccess', _194 => _194.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3608
+ ..._optionalChain([options, 'optionalAccess', _182 => _182.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3607
3609
  }
3608
3610
  }
3609
3611
  );
@@ -3695,7 +3697,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3695
3697
  return this.http.post(
3696
3698
  "/api/v2/ingestion/repair",
3697
3699
  {
3698
- ..._optionalChain([input, 'optionalAccess', _195 => _195.provider]) ? { provider: input.provider } : {}
3700
+ ..._optionalChain([input, 'optionalAccess', _183 => _183.provider]) ? { provider: input.provider } : {}
3699
3701
  }
3700
3702
  );
3701
3703
  }
@@ -3736,11 +3738,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
3736
3738
  * ```
3737
3739
  */
3738
3740
  async startPlayRun(request) {
3739
- const resolved = resolveStartPlayRunRequest(request);
3741
+ const resolved = resolveStartPlayRunRequest(request, this.environment);
3740
3742
  return _chunkPAIMOGCMjs.startPlayRun.call(void 0,
3741
3743
  this.http,
3742
3744
  resolved.request,
3743
- runtimeSelectionHeaders(resolved.runtime)
3745
+ runtimeSelectionHeaders(resolved.runtime, this.environment)
3744
3746
  );
3745
3747
  }
3746
3748
  /**
@@ -3757,15 +3759,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
3757
3759
  * @returns Async generator of play-scoped live events.
3758
3760
  */
3759
3761
  async *startPlayRunStream(request, options) {
3760
- const resolved = resolveStartPlayRunRequest(request);
3762
+ const resolved = resolveStartPlayRunRequest(request, this.environment);
3761
3763
  const body = _chunkPAIMOGCMjs.buildPlayRunStartBody.call(void 0, resolved.request);
3762
3764
  for await (const event of this.http.streamSse(
3763
3765
  _chunkPAIMOGCMjs.PLAY_RUN_START_STREAM_PATH,
3764
3766
  {
3765
3767
  method: "POST",
3766
3768
  body,
3767
- headers: runtimeSelectionHeaders(resolved.runtime),
3768
- signal: _optionalChain([options, 'optionalAccess', _196 => _196.signal])
3769
+ headers: runtimeSelectionHeaders(resolved.runtime, this.environment),
3770
+ signal: _optionalChain([options, 'optionalAccess', _184 => _184.signal])
3769
3771
  }
3770
3772
  )) {
3771
3773
  if (event.scope === "play") {
@@ -3876,7 +3878,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3876
3878
  */
3877
3879
  async checkPlayArtifact(input) {
3878
3880
  const integrationMode = normalizePlayRunIntegrationMode(
3879
- _nullishCoalesce(input.integrationMode, () => ( process.env.DEEPLINE_EVAL_INTEGRATION_MODE))
3881
+ _nullishCoalesce(input.integrationMode, () => ( this.environment.DEEPLINE_EVAL_INTEGRATION_MODE))
3880
3882
  );
3881
3883
  return this.http.post("/api/v2/plays/check", {
3882
3884
  ...input,
@@ -3925,7 +3927,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3925
3927
  compilerManifest,
3926
3928
  ...input.input ? { input: input.input } : {},
3927
3929
  ...input.inputFile ? { inputFile: input.inputFile } : {},
3928
- ..._optionalChain([input, 'access', _197 => _197.packagedFiles, 'optionalAccess', _198 => _198.length]) ? { packagedFiles: input.packagedFiles } : {},
3930
+ ..._optionalChain([input, 'access', _185 => _185.packagedFiles, 'optionalAccess', _186 => _186.length]) ? { packagedFiles: input.packagedFiles } : {},
3929
3931
  ...input.force ? { force: true } : {},
3930
3932
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
3931
3933
  });
@@ -3955,29 +3957,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
3955
3957
  * ```
3956
3958
  */
3957
3959
  async submitPlay(code, csvPath, name, options) {
3958
- const runtimeInput = _optionalChain([options, 'optionalAccess', _199 => _199.input]) ? { ...options.input } : {};
3960
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _187 => _187.input]) ? { ...options.input } : {};
3959
3961
  if (csvPath) {
3960
3962
  runtimeInput.file = csvPath;
3961
3963
  }
3962
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _200 => _200.sourceCode]), () => ( code));
3963
- const artifact = _optionalChain([options, 'optionalAccess', _201 => _201.artifact]);
3964
- if (!_optionalChain([name, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203()])) {
3964
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _188 => _188.sourceCode]), () => ( code));
3965
+ const artifact = _optionalChain([options, 'optionalAccess', _189 => _189.artifact]);
3966
+ if (!_optionalChain([name, 'optionalAccess', _190 => _190.trim, 'call', _191 => _191()])) {
3965
3967
  throw new Error("submitPlay requires a play name.");
3966
3968
  }
3967
3969
  if (!artifact) {
3968
3970
  throw new Error("submitPlay requires a bundled play artifact.");
3969
3971
  }
3970
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _204 => _204.compilerManifest]), async () => ( await this.compilePlayManifest({
3972
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _192 => _192.compilerManifest]), async () => ( await this.compilePlayManifest({
3971
3973
  name,
3972
3974
  sourceCode,
3973
- sourceFiles: _optionalChain([options, 'optionalAccess', _205 => _205.sourceFiles]),
3975
+ sourceFiles: _optionalChain([options, 'optionalAccess', _193 => _193.sourceFiles]),
3974
3976
  artifact
3975
3977
  })));
3976
3978
  const registeredArtifact = await this.registerPlayArtifact({
3977
3979
  name,
3978
3980
  sourceCode,
3979
- sourceFiles: _optionalChain([options, 'optionalAccess', _206 => _206.sourceFiles]),
3980
- description: _optionalChain([options, 'optionalAccess', _207 => _207.description]),
3981
+ sourceFiles: _optionalChain([options, 'optionalAccess', _194 => _194.sourceFiles]),
3982
+ description: _optionalChain([options, 'optionalAccess', _195 => _195.description]),
3981
3983
  artifact,
3982
3984
  compilerManifest,
3983
3985
  publish: false
@@ -3991,17 +3993,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3991
3993
  name,
3992
3994
  artifactStorageKey: registeredArtifact.artifactStorageKey,
3993
3995
  sourceCode,
3994
- description: _optionalChain([options, 'optionalAccess', _208 => _208.description]),
3996
+ description: _optionalChain([options, 'optionalAccess', _196 => _196.description]),
3995
3997
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
3996
3998
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
3997
3999
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
3998
4000
  runtimeArtifact: artifact,
3999
4001
  compilerManifest,
4000
4002
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
4001
- ..._optionalChain([options, 'optionalAccess', _209 => _209.inputFile]) ? { inputFile: options.inputFile } : {},
4002
- ..._optionalChain([options, 'optionalAccess', _210 => _210.packagedFiles, 'optionalAccess', _211 => _211.length]) ? { packagedFiles: options.packagedFiles } : {},
4003
- ..._optionalChain([options, 'optionalAccess', _212 => _212.force]) ? { force: true } : {},
4004
- ..._optionalChain([options, 'optionalAccess', _213 => _213.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4003
+ ..._optionalChain([options, 'optionalAccess', _197 => _197.inputFile]) ? { inputFile: options.inputFile } : {},
4004
+ ..._optionalChain([options, 'optionalAccess', _198 => _198.packagedFiles, 'optionalAccess', _199 => _199.length]) ? { packagedFiles: options.packagedFiles } : {},
4005
+ ..._optionalChain([options, 'optionalAccess', _200 => _200.force]) ? { force: true } : {},
4006
+ ..._optionalChain([options, 'optionalAccess', _201 => _201.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4005
4007
  });
4006
4008
  }
4007
4009
  /**
@@ -4071,10 +4073,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4071
4073
  */
4072
4074
  async getPlayStatus(workflowId, options) {
4073
4075
  const params = new URLSearchParams();
4074
- if (_optionalChain([options, 'optionalAccess', _214 => _214.billing]) === false) {
4076
+ if (_optionalChain([options, 'optionalAccess', _202 => _202.billing]) === false) {
4075
4077
  params.set("billing", "false");
4076
4078
  }
4077
- if (_optionalChain([options, 'optionalAccess', _215 => _215.full]) === true) {
4079
+ if (_optionalChain([options, 'optionalAccess', _203 => _203.full]) === true) {
4078
4080
  params.set("full", "true");
4079
4081
  }
4080
4082
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4088,9 +4090,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4088
4090
  for await (const event of watchRunEvents({
4089
4091
  http: this.http,
4090
4092
  runId: workflowId,
4091
- signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]),
4092
- onNotice: _optionalChain([options, 'optionalAccess', _217 => _217.onNotice]),
4093
- onRetry: _optionalChain([options, 'optionalAccess', _218 => _218.onRetry])
4093
+ signal: _optionalChain([options, 'optionalAccess', _204 => _204.signal]),
4094
+ onNotice: _optionalChain([options, 'optionalAccess', _205 => _205.onNotice]),
4095
+ onRetry: _optionalChain([options, 'optionalAccess', _206 => _206.onRetry])
4094
4096
  })) {
4095
4097
  yield event;
4096
4098
  }
@@ -4102,12 +4104,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4102
4104
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4103
4105
  */
4104
4106
  async *streamPlayRunEvents(workflowId, options) {
4105
- const headers = _optionalChain([options, 'optionalAccess', _219 => _219.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4107
+ const headers = _optionalChain([options, 'optionalAccess', _207 => _207.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4106
4108
  const params = new URLSearchParams();
4107
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _220 => _220.mode]), () => ( "cli")));
4109
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _208 => _208.mode]), () => ( "cli")));
4108
4110
  for await (const event of this.http.streamSse(
4109
4111
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4110
- { signal: _optionalChain([options, 'optionalAccess', _221 => _221.signal]), headers }
4112
+ { signal: _optionalChain([options, 'optionalAccess', _209 => _209.signal]), headers }
4111
4113
  )) {
4112
4114
  if (event.scope === "play") {
4113
4115
  yield event;
@@ -4123,24 +4125,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
4123
4125
  */
4124
4126
  async *observeRunEvents(runId, options) {
4125
4127
  yield* this.watchRunEvents(runId, {
4126
- signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]),
4127
- onNotice: _optionalChain([options, 'optionalAccess', _223 => _223.onNotice])
4128
+ signal: _optionalChain([options, 'optionalAccess', _210 => _210.signal]),
4129
+ onNotice: _optionalChain([options, 'optionalAccess', _211 => _211.onNotice])
4128
4130
  });
4129
4131
  }
4130
4132
  /** Poll snapshots to terminal status and return the durable package. */
4131
4133
  async watchRunToTerminal(runId, options) {
4132
4134
  let terminalObserved = false;
4133
4135
  for await (const event of this.watchRunEvents(runId, {
4134
- signal: _optionalChain([options, 'optionalAccess', _224 => _224.signal]),
4135
- onNotice: _optionalChain([options, 'optionalAccess', _225 => _225.onNotice]),
4136
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _226 => _226.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _227 => _227.onReconnect])))
4136
+ signal: _optionalChain([options, 'optionalAccess', _212 => _212.signal]),
4137
+ onNotice: _optionalChain([options, 'optionalAccess', _213 => _213.onNotice]),
4138
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _214 => _214.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _215 => _215.onReconnect])))
4137
4139
  })) {
4138
- _optionalChain([options, 'optionalAccess', _228 => _228.onEvent, 'optionalCall', _229 => _229(event)]);
4140
+ _optionalChain([options, 'optionalAccess', _216 => _216.onEvent, 'optionalCall', _217 => _217(event)]);
4139
4141
  if (_chunkPAIMOGCMjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4140
4142
  terminalObserved = true;
4141
4143
  }
4142
4144
  }
4143
- if (_optionalChain([options, 'optionalAccess', _230 => _230.signal, 'optionalAccess', _231 => _231.aborted])) {
4145
+ if (_optionalChain([options, 'optionalAccess', _218 => _218.signal, 'optionalAccess', _219 => _219.aborted])) {
4144
4146
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4145
4147
  }
4146
4148
  const refreshed = await this.getRunStatus(runId);
@@ -4194,7 +4196,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4194
4196
  async stopPlay(workflowId, options) {
4195
4197
  return this.http.post(
4196
4198
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
4197
- _optionalChain([options, 'optionalAccess', _232 => _232.reason]) ? { reason: options.reason } : {}
4199
+ _optionalChain([options, 'optionalAccess', _220 => _220.reason]) ? { reason: options.reason } : {}
4198
4200
  );
4199
4201
  }
4200
4202
  /**
@@ -4230,7 +4232,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4230
4232
  /** List the org's workflows. `GET /api/v2/workflows`. */
4231
4233
  async listWorkflows(options) {
4232
4234
  const params = new URLSearchParams();
4233
- if (typeof _optionalChain([options, 'optionalAccess', _233 => _233.limit]) === "number") {
4235
+ if (typeof _optionalChain([options, 'optionalAccess', _221 => _221.limit]) === "number") {
4234
4236
  params.set("limit", String(options.limit));
4235
4237
  }
4236
4238
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4283,7 +4285,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4283
4285
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4284
4286
  async listWorkflowRuns(id, options) {
4285
4287
  const params = new URLSearchParams();
4286
- if (typeof _optionalChain([options, 'optionalAccess', _234 => _234.limit]) === "number") {
4288
+ if (typeof _optionalChain([options, 'optionalAccess', _222 => _222.limit]) === "number") {
4287
4289
  params.set("limit", String(options.limit));
4288
4290
  }
4289
4291
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4319,10 +4321,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4319
4321
  */
4320
4322
  async getRunStatus(runId, options) {
4321
4323
  const params = new URLSearchParams();
4322
- if (_optionalChain([options, 'optionalAccess', _235 => _235.full]) === true) {
4324
+ if (_optionalChain([options, 'optionalAccess', _223 => _223.full]) === true) {
4323
4325
  params.set("full", "true");
4324
4326
  }
4325
- if (_optionalChain([options, 'optionalAccess', _236 => _236.configuration]) === true) {
4327
+ if (_optionalChain([options, 'optionalAccess', _224 => _224.configuration]) === true) {
4326
4328
  params.set("include", "configuration");
4327
4329
  }
4328
4330
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4330,7 +4332,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4330
4332
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4331
4333
  { headers: { "x-deepline-run-status": "1" } }
4332
4334
  );
4333
- if (_optionalChain([options, 'optionalAccess', _237 => _237.configuration]) === true && !Object.hasOwn(response, "contract")) {
4335
+ if (_optionalChain([options, 'optionalAccess', _225 => _225.configuration]) === true && !Object.hasOwn(response, "contract")) {
4334
4336
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4335
4337
  "This server does not support recorded configuration reads.",
4336
4338
  void 0,
@@ -4338,7 +4340,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4338
4340
  );
4339
4341
  }
4340
4342
  const status = normalizePlayStatus(response);
4341
- if (_optionalChain([options, 'optionalAccess', _238 => _238.failedLogs]) !== true || status.status !== "failed") {
4343
+ if (_optionalChain([options, 'optionalAccess', _226 => _226.failedLogs]) !== true || status.status !== "failed") {
4342
4344
  return status;
4343
4345
  }
4344
4346
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4427,7 +4429,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4427
4429
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4428
4430
  async getRunsHistory(options = {}) {
4429
4431
  const params = new URLSearchParams();
4430
- const search = _optionalChain([options, 'access', _239 => _239.search, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
4432
+ const search = _optionalChain([options, 'access', _227 => _227.search, 'optionalAccess', _228 => _228.trim, 'call', _229 => _229()]);
4431
4433
  if (search && search.length > 200) {
4432
4434
  throw new Error("Run search must be at most 200 characters.");
4433
4435
  }
@@ -4453,16 +4455,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4453
4455
  }
4454
4456
  /** Read one run page without discarding server pagination metadata. */
4455
4457
  async listRunsPage(options) {
4456
- const playName = _optionalChain([options, 'access', _242 => _242.play, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
4458
+ const playName = _optionalChain([options, 'access', _230 => _230.play, 'optionalAccess', _231 => _231.trim, 'call', _232 => _232()]);
4457
4459
  const params = new URLSearchParams();
4458
4460
  if (playName) {
4459
4461
  params.set("play", playName);
4460
4462
  }
4461
- const status = _optionalChain([options, 'access', _245 => _245.status, 'optionalAccess', _246 => _246.trim, 'call', _247 => _247()]);
4463
+ const status = _optionalChain([options, 'access', _233 => _233.status, 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]);
4462
4464
  if (status) {
4463
4465
  params.set("status", status);
4464
4466
  }
4465
- const node = _optionalChain([options, 'access', _248 => _248.node, 'optionalAccess', _249 => _249.trim, 'call', _250 => _250()]);
4467
+ const node = _optionalChain([options, 'access', _236 => _236.node, 'optionalAccess', _237 => _237.trim, 'call', _238 => _238()]);
4466
4468
  if (node) {
4467
4469
  if (!playName)
4468
4470
  throw new Error("runs.list options.node requires options.play.");
@@ -4536,8 +4538,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4536
4538
  * different key intentionally starts another rerun.
4537
4539
  */
4538
4540
  async rerun(runId, options) {
4539
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _251 => _251.idempotencyKey, 'optionalAccess', _252 => _252.trim, 'call', _253 => _253()]);
4540
- if (_optionalChain([options, 'optionalAccess', _254 => _254.idempotencyKey]) !== void 0 && !idempotencyKey) {
4541
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _239 => _239.idempotencyKey, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
4542
+ if (_optionalChain([options, 'optionalAccess', _242 => _242.idempotencyKey]) !== void 0 && !idempotencyKey) {
4541
4543
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4542
4544
  "runs.rerun idempotencyKey must not be empty.",
4543
4545
  void 0,
@@ -4546,7 +4548,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4546
4548
  }
4547
4549
  return this.http.post(
4548
4550
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
4549
- _optionalChain([options, 'optionalAccess', _255 => _255.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4551
+ _optionalChain([options, 'optionalAccess', _243 => _243.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4550
4552
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
4551
4553
  );
4552
4554
  }
@@ -4560,21 +4562,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
4560
4562
  * ```
4561
4563
  */
4562
4564
  async getRunLogs(runId, options) {
4563
- if (_optionalChain([options, 'optionalAccess', _256 => _256.all]) === true && options.failed === true) {
4565
+ if (_optionalChain([options, 'optionalAccess', _244 => _244.all]) === true && options.failed === true) {
4564
4566
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4565
4567
  "runs.logs cannot combine all and failed views.",
4566
4568
  void 0,
4567
4569
  "INVALID_RUN_LOG_VIEW"
4568
4570
  );
4569
4571
  }
4570
- if (_optionalChain([options, 'optionalAccess', _257 => _257.cursor]) !== void 0 && options.failed === true) {
4572
+ if (_optionalChain([options, 'optionalAccess', _245 => _245.cursor]) !== void 0 && options.failed === true) {
4571
4573
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4572
4574
  "runs.logs cannot combine failed with cursor.",
4573
4575
  void 0,
4574
4576
  "INVALID_RUN_LOG_VIEW"
4575
4577
  );
4576
4578
  }
4577
- if (_optionalChain([options, 'optionalAccess', _258 => _258.failed]) === true) {
4579
+ if (_optionalChain([options, 'optionalAccess', _246 => _246.failed]) === true) {
4578
4580
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
4579
4581
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
4580
4582
  const page = await this.http.get(
@@ -4599,18 +4601,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
4599
4601
  ...page.logsTruncated ? { logsTruncated: true } : {}
4600
4602
  };
4601
4603
  }
4602
- const beforeSequence = _optionalChain([options, 'optionalAccess', _259 => _259.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4603
- 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;
4604
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _247 => _247.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4605
+ const limit = _optionalChain([options, 'optionalAccess', _248 => _248.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _249 => _249.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4604
4606
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
4605
4607
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
4606
4608
  { retryApiErrors: true }
4607
4609
  );
4608
4610
  const probe = await fetchPage(0, 1);
4609
4611
  const lastStoredSeq = probe.lastStoredSeq;
4610
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _262 => _262.entries, 'access', _263 => _263[0], 'optionalAccess', _264 => _264.seq]), () => ( null));
4612
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _250 => _250.entries, 'access', _251 => _251[0], 'optionalAccess', _252 => _252.seq]), () => ( null));
4611
4613
  const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
4612
4614
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
4613
- let afterSeq = _optionalChain([options, 'optionalAccess', _265 => _265.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4615
+ let afterSeq = _optionalChain([options, 'optionalAccess', _253 => _253.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4614
4616
  const entries = [];
4615
4617
  while (entries.length < limit && afterSeq < upperSeq) {
4616
4618
  const page = await fetchPage(
@@ -4644,7 +4646,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4644
4646
  hasMore: olderLinesExist,
4645
4647
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
4646
4648
  entries: entries.map((entry) => entry.line),
4647
- view: _optionalChain([options, 'optionalAccess', _266 => _266.all]) ? "all" : "tail",
4649
+ view: _optionalChain([options, 'optionalAccess', _254 => _254.all]) ? "all" : "tail",
4648
4650
  ...probe.logsTruncated ? { logsTruncated: true } : {}
4649
4651
  };
4650
4652
  }
@@ -4727,10 +4729,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4727
4729
  params.set("runtime", "preview");
4728
4730
  params.set("namespace", runtime.namespace);
4729
4731
  if (runtime.backend) params.set("backend", runtime.backend);
4730
- headers = runtimeSelectionHeaders(runtime);
4732
+ headers = runtimeSelectionHeaders(runtime, this.environment);
4731
4733
  selectedRuntime = runtime;
4732
4734
  } else {
4733
- headers = isolatedCiRuntimeEventReadHeaders();
4735
+ headers = isolatedCiRuntimeEventReadHeaders(this.environment);
4734
4736
  }
4735
4737
  const suffix = params.size > 0 ? `?${params.toString()}` : "";
4736
4738
  const result = await this.http.post(
@@ -4784,9 +4786,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4784
4786
  params.set("runtime", "preview");
4785
4787
  params.set("namespace", runtime.namespace);
4786
4788
  if (runtime.backend) params.set("backend", runtime.backend);
4787
- headers = runtimeSelectionHeaders(runtime);
4789
+ headers = runtimeSelectionHeaders(runtime, this.environment);
4788
4790
  } else {
4789
- headers = isolatedCiRuntimeEventReadHeaders();
4791
+ headers = isolatedCiRuntimeEventReadHeaders(this.environment);
4790
4792
  }
4791
4793
  return this.http.get(
4792
4794
  `/api/v2/runs/events?${params.toString()}`,
@@ -4805,7 +4807,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4805
4807
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
4806
4808
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
4807
4809
  });
4808
- if (_optionalChain([input, 'access', _267 => _267.runId, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()])) {
4810
+ if (_optionalChain([input, 'access', _255 => _255.runId, 'optionalAccess', _256 => _256.trim, 'call', _257 => _257()])) {
4809
4811
  params.set("runId", input.runId.trim());
4810
4812
  }
4811
4813
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -4815,9 +4817,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4815
4817
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
4816
4818
  { signal: input.signal }
4817
4819
  );
4818
- const requestedRunId = _optionalChain([input, 'access', _270 => _270.runId, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]) || "";
4820
+ const requestedRunId = _optionalChain([input, 'access', _258 => _258.runId, 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()]) || "";
4819
4821
  if (requestedRunId) {
4820
- const confirmedRunId = _optionalChain([result, 'access', _273 => _273.scope, 'optionalAccess', _274 => _274.kind]) === "run" ? result.scope.runId.trim() : "";
4822
+ const confirmedRunId = _optionalChain([result, 'access', _261 => _261.scope, 'optionalAccess', _262 => _262.kind]) === "run" ? result.scope.runId.trim() : "";
4821
4823
  const foreignRowRunIds = [
4822
4824
  ...new Set(
4823
4825
  result.rows.map(
@@ -4825,7 +4827,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4825
4827
  ).filter((runId) => runId && runId !== requestedRunId)
4826
4828
  )
4827
4829
  ];
4828
- if (_optionalChain([result, 'access', _275 => _275.scope, 'optionalAccess', _276 => _276.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
4830
+ if (_optionalChain([result, 'access', _263 => _263.scope, 'optionalAccess', _264 => _264.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
4829
4831
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4830
4832
  `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.`,
4831
4833
  void 0,
@@ -4854,7 +4856,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4854
4856
  async stopRun(runId, options) {
4855
4857
  return this.http.post(
4856
4858
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
4857
- _optionalChain([options, 'optionalAccess', _277 => _277.reason]) ? { reason: options.reason } : {}
4859
+ _optionalChain([options, 'optionalAccess', _265 => _265.reason]) ? { reason: options.reason } : {}
4858
4860
  );
4859
4861
  }
4860
4862
  /**
@@ -4872,11 +4874,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
4872
4874
  * need to clear the workspace run-slot state without knowing each run id.
4873
4875
  */
4874
4876
  async stopAllRuns(options) {
4875
- const dryRun = _optionalChain([options, 'optionalAccess', _278 => _278.dryRun]) === true;
4877
+ const dryRun = _optionalChain([options, 'optionalAccess', _266 => _266.dryRun]) === true;
4876
4878
  const result = await this.http.post(
4877
4879
  "/api/v2/runs/stop-all",
4878
4880
  {
4879
- ..._optionalChain([options, 'optionalAccess', _279 => _279.reason]) ? { reason: options.reason } : {},
4881
+ ..._optionalChain([options, 'optionalAccess', _267 => _267.reason]) ? { reason: options.reason } : {},
4880
4882
  ...dryRun ? { dryRun: true } : {}
4881
4883
  }
4882
4884
  );
@@ -4897,7 +4899,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4897
4899
  * `origin: "owned"` for org-owned plays.
4898
4900
  */
4899
4901
  async listPlays(options) {
4900
- if (!_optionalChain([options, 'optionalAccess', _280 => _280.grep, 'optionalAccess', _281 => _281.trim, 'call', _282 => _282()])) {
4902
+ if (!_optionalChain([options, 'optionalAccess', _268 => _268.grep, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()])) {
4901
4903
  return (await this.requestPlaysPage(options, false)).plays;
4902
4904
  }
4903
4905
  const plays = [];
@@ -4919,45 +4921,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
4919
4921
  }
4920
4922
  async requestPlaysPage(options, paginateInventory = true) {
4921
4923
  const params = new URLSearchParams();
4922
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _283 => _283.grep, 'optionalAccess', _284 => _284.trim, 'call', _285 => _285()]))
4924
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _271 => _271.grep, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()]))
4923
4925
  params.set("inventory_paginated", "1");
4924
- if (_optionalChain([options, 'optionalAccess', _286 => _286.origin])) params.set("origin", options.origin);
4925
- if (_optionalChain([options, 'optionalAccess', _287 => _287.categories])) {
4926
+ if (_optionalChain([options, 'optionalAccess', _274 => _274.origin])) params.set("origin", options.origin);
4927
+ if (_optionalChain([options, 'optionalAccess', _275 => _275.categories])) {
4926
4928
  params.set(
4927
4929
  "categories",
4928
4930
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
4929
4931
  );
4930
4932
  }
4931
- if (_optionalChain([options, 'optionalAccess', _288 => _288.categories]) || _optionalChain([options, 'optionalAccess', _289 => _289.includeToolCategories])) {
4933
+ if (_optionalChain([options, 'optionalAccess', _276 => _276.categories]) || _optionalChain([options, 'optionalAccess', _277 => _277.includeToolCategories])) {
4932
4934
  params.set("include_tool_categories", "1");
4933
4935
  }
4934
- if (_optionalChain([options, 'optionalAccess', _290 => _290.tags])) {
4936
+ if (_optionalChain([options, 'optionalAccess', _278 => _278.tags])) {
4935
4937
  params.set(
4936
4938
  "tags",
4937
4939
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
4938
4940
  );
4939
4941
  }
4940
- if (_optionalChain([options, 'optionalAccess', _291 => _291.includeArchived])) params.set("include_archived", "1");
4941
- if (_optionalChain([options, 'optionalAccess', _292 => _292.includeCostEstimates])) {
4942
+ if (_optionalChain([options, 'optionalAccess', _279 => _279.includeArchived])) params.set("include_archived", "1");
4943
+ if (_optionalChain([options, 'optionalAccess', _280 => _280.includeCostEstimates])) {
4942
4944
  params.set("include_cost_estimates", "1");
4943
4945
  }
4944
- if (_optionalChain([options, 'optionalAccess', _293 => _293.grep, 'optionalAccess', _294 => _294.trim, 'call', _295 => _295()])) {
4946
+ if (_optionalChain([options, 'optionalAccess', _281 => _281.grep, 'optionalAccess', _282 => _282.trim, 'call', _283 => _283()])) {
4945
4947
  params.set("grep", options.grep.trim());
4946
4948
  params.set("limit", "60");
4947
4949
  }
4948
- if (_optionalChain([options, 'optionalAccess', _296 => _296.limit]) !== void 0) {
4950
+ if (_optionalChain([options, 'optionalAccess', _284 => _284.limit]) !== void 0) {
4949
4951
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
4950
4952
  throw new Error("Play page limit must be a positive integer");
4951
4953
  }
4952
4954
  params.set("limit", String(options.limit));
4953
4955
  }
4954
- if (_optionalChain([options, 'optionalAccess', _297 => _297.cursor])) params.set("cursor", options.cursor);
4956
+ if (_optionalChain([options, 'optionalAccess', _285 => _285.cursor])) params.set("cursor", options.cursor);
4955
4957
  const suffix = params.size ? `?${params.toString()}` : "";
4956
4958
  const response = await this.http.get(`/api/v2/plays${suffix}`);
4957
4959
  return {
4958
4960
  plays: _nullishCoalesce(response.plays, () => ( [])),
4959
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _298 => _298.pagination, 'optionalAccess', _299 => _299.cursor]), () => ( response.cursor)), () => ( null)),
4960
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _300 => _300.pagination, 'optionalAccess', _301 => _301.hasMore]), () => ( response.hasMore)))
4961
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _286 => _286.pagination, 'optionalAccess', _287 => _287.cursor]), () => ( response.cursor)), () => ( null)),
4962
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _288 => _288.pagination, 'optionalAccess', _289 => _289.hasMore]), () => ( response.hasMore)))
4961
4963
  };
4962
4964
  }
4963
4965
  /** Read definition-level settings, independently of code revisions. */
@@ -5007,8 +5009,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5007
5009
  return this.http.post("/api/v2/integrations/connect", {
5008
5010
  provider: "slack",
5009
5011
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
5010
- ..._optionalChain([options, 'optionalAccess', _302 => _302.successUrl]) ? { success_url: options.successUrl } : {},
5011
- ..._optionalChain([options, 'optionalAccess', _303 => _303.failureUrl]) ? { failure_url: options.failureUrl } : {}
5012
+ ..._optionalChain([options, 'optionalAccess', _290 => _290.successUrl]) ? { success_url: options.successUrl } : {},
5013
+ ..._optionalChain([options, 'optionalAccess', _291 => _291.failureUrl]) ? { failure_url: options.failureUrl } : {}
5012
5014
  });
5013
5015
  }
5014
5016
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5083,7 +5085,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5083
5085
  }
5084
5086
  const targets = input.targets.map(parseNotificationGroupTarget);
5085
5087
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5086
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _304 => _304[0], 'optionalAccess', _305 => _305.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5088
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _292 => _292[0], 'optionalAccess', _293 => _293.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5087
5089
  if (legacyEvents.length > 0 && !legacyTarget) {
5088
5090
  throw new Error(
5089
5091
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5119,7 +5121,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5119
5121
  const existingGroup = current.configuration.groups.find(
5120
5122
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5121
5123
  );
5122
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _306 => _306.groupKey]), () => ( notificationObjectKey("group")));
5124
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _294 => _294.groupKey]), () => ( notificationObjectKey("group")));
5123
5125
  const group = _nullishCoalesce(existingGroup, () => ( {
5124
5126
  groupKey,
5125
5127
  name,
@@ -5337,13 +5339,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
5337
5339
  */
5338
5340
  async getPlay(name, options) {
5339
5341
  const encodedName = encodeURIComponent(name);
5340
- const query = _optionalChain([options, 'optionalAccess', _307 => _307.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _308 => _308.guidance]) ? "?include=guidance" : "";
5342
+ const query = _optionalChain([options, 'optionalAccess', _295 => _295.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _296 => _296.guidance]) ? "?include=guidance" : "";
5341
5343
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
5342
5344
  }
5343
5345
  /** Read one trigger inventory page without loading run histories. */
5344
5346
  async listPlayTriggerInventory(options) {
5345
5347
  const params = new URLSearchParams({ view: "inventory" });
5346
- if (_optionalChain([options, 'optionalAccess', _309 => _309.cursor])) params.set("cursor", options.cursor);
5348
+ if (_optionalChain([options, 'optionalAccess', _297 => _297.cursor])) params.set("cursor", options.cursor);
5347
5349
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5348
5350
  }
5349
5351
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5352,7 +5354,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5352
5354
  view: "history",
5353
5355
  binding_id: bindingId
5354
5356
  });
5355
- if (_optionalChain([options, 'optionalAccess', _310 => _310.limit]) !== void 0)
5357
+ if (_optionalChain([options, 'optionalAccess', _298 => _298.limit]) !== void 0)
5356
5358
  params.set("history_limit", String(options.limit));
5357
5359
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5358
5360
  }
@@ -5388,7 +5390,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5388
5390
  */
5389
5391
  async listPlayVersions(name, options) {
5390
5392
  const encodedName = encodeURIComponent(name);
5391
- const suffix = _optionalChain([options, 'optionalAccess', _311 => _311.full]) ? "?full=true" : "";
5393
+ const suffix = _optionalChain([options, 'optionalAccess', _299 => _299.full]) ? "?full=true" : "";
5392
5394
  const response = await this.http.get(
5393
5395
  `/api/v2/plays/${encodedName}/versions${suffix}`
5394
5396
  );
@@ -5541,14 +5543,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
5541
5543
  */
5542
5544
  async runPlay(code, csvPath, name, options) {
5543
5545
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
5544
- input: _optionalChain([options, 'optionalAccess', _312 => _312.input]),
5545
- sourceCode: _optionalChain([options, 'optionalAccess', _313 => _313.sourceCode]),
5546
- artifact: _optionalChain([options, 'optionalAccess', _314 => _314.artifact]),
5547
- compilerManifest: _optionalChain([options, 'optionalAccess', _315 => _315.compilerManifest]),
5548
- inputFile: _optionalChain([options, 'optionalAccess', _316 => _316.inputFile]),
5549
- packagedFiles: _optionalChain([options, 'optionalAccess', _317 => _317.packagedFiles]),
5550
- force: _optionalChain([options, 'optionalAccess', _318 => _318.force]),
5551
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _319 => _319.forceToolRefresh])
5546
+ input: _optionalChain([options, 'optionalAccess', _300 => _300.input]),
5547
+ sourceCode: _optionalChain([options, 'optionalAccess', _301 => _301.sourceCode]),
5548
+ artifact: _optionalChain([options, 'optionalAccess', _302 => _302.artifact]),
5549
+ compilerManifest: _optionalChain([options, 'optionalAccess', _303 => _303.compilerManifest]),
5550
+ inputFile: _optionalChain([options, 'optionalAccess', _304 => _304.inputFile]),
5551
+ packagedFiles: _optionalChain([options, 'optionalAccess', _305 => _305.packagedFiles]),
5552
+ force: _optionalChain([options, 'optionalAccess', _306 => _306.force]),
5553
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _307 => _307.forceToolRefresh])
5552
5554
  });
5553
5555
  const start = Date.now();
5554
5556
  const state = {
@@ -5559,7 +5561,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5559
5561
  latest: null
5560
5562
  };
5561
5563
  let terminalObserved = null;
5562
- if (_optionalChain([options, 'optionalAccess', _320 => _320.signal, 'optionalAccess', _321 => _321.aborted])) {
5564
+ if (_optionalChain([options, 'optionalAccess', _308 => _308.signal, 'optionalAccess', _309 => _309.aborted])) {
5563
5565
  await this.cancelPlay(workflowId);
5564
5566
  return {
5565
5567
  success: false,
@@ -5570,9 +5572,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5570
5572
  };
5571
5573
  }
5572
5574
  for await (const event of this.watchRunEvents(workflowId, {
5573
- signal: _optionalChain([options, 'optionalAccess', _322 => _322.signal])
5575
+ signal: _optionalChain([options, 'optionalAccess', _310 => _310.signal])
5574
5576
  })) {
5575
- if (_optionalChain([options, 'optionalAccess', _323 => _323.signal, 'optionalAccess', _324 => _324.aborted])) {
5577
+ if (_optionalChain([options, 'optionalAccess', _311 => _311.signal, 'optionalAccess', _312 => _312.aborted])) {
5576
5578
  await this.cancelPlay(workflowId);
5577
5579
  return {
5578
5580
  success: false,
@@ -5582,19 +5584,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
5582
5584
  error: "Cancelled by user"
5583
5585
  };
5584
5586
  }
5585
- const previousStatus = _optionalChain([state, 'access', _325 => _325.latest, 'optionalAccess', _326 => _326.status]);
5587
+ const previousStatus = _optionalChain([state, 'access', _313 => _313.latest, 'optionalAccess', _314 => _314.status]);
5586
5588
  const status = updatePlayLiveStatusState(state, event);
5587
5589
  if (!status) {
5588
5590
  continue;
5589
5591
  }
5590
5592
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
5591
- _optionalChain([options, 'optionalAccess', _327 => _327.onProgress, 'optionalCall', _328 => _328(status)]);
5593
+ _optionalChain([options, 'optionalAccess', _315 => _315.onProgress, 'optionalCall', _316 => _316(status)]);
5592
5594
  }
5593
5595
  if (_chunkPAIMOGCMjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
5594
5596
  terminalObserved = status;
5595
5597
  }
5596
5598
  }
5597
- if (_optionalChain([options, 'optionalAccess', _329 => _329.signal, 'optionalAccess', _330 => _330.aborted])) {
5599
+ if (_optionalChain([options, 'optionalAccess', _317 => _317.signal, 'optionalAccess', _318 => _318.aborted])) {
5598
5600
  await this.cancelPlay(workflowId);
5599
5601
  return {
5600
5602
  success: false,
@@ -5647,7 +5649,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5647
5649
  const response = await this.http.get(
5648
5650
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
5649
5651
  );
5650
- const event = _optionalChain([response, 'access', _331 => _331.entries, 'optionalAccess', _332 => _332[0]]);
5652
+ const event = _optionalChain([response, 'access', _319 => _319.entries, 'optionalAccess', _320 => _320[0]]);
5651
5653
  if (!event) {
5652
5654
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
5653
5655
  "No usage event was found for this request_id.",
@@ -5778,7 +5780,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5778
5780
  async cancelBillingSubscription(options) {
5779
5781
  return this.http.post(
5780
5782
  "/api/v2/billing/subscription/cancel",
5781
- { action: _optionalChain([options, 'optionalAccess', _333 => _333.undo]) ? "undo_cancel" : "cancel" }
5783
+ { action: _optionalChain([options, 'optionalAccess', _321 => _321.undo]) ? "undo_cancel" : "cancel" }
5782
5784
  );
5783
5785
  }
5784
5786
  /**
@@ -5790,7 +5792,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5790
5792
  */
5791
5793
  async listBillingInvoices(options) {
5792
5794
  const params = new URLSearchParams();
5793
- if (_optionalChain([options, 'optionalAccess', _334 => _334.limit]) !== void 0) {
5795
+ if (_optionalChain([options, 'optionalAccess', _322 => _322.limit]) !== void 0) {
5794
5796
  params.set("limit", String(options.limit));
5795
5797
  }
5796
5798
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -5900,7 +5902,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5900
5902
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
5901
5903
  async createTargetBillingPortalSession(options) {
5902
5904
  const response = await this.http.post(
5903
- _optionalChain([options, 'optionalAccess', _335 => _335.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
5905
+ _optionalChain([options, 'optionalAccess', _323 => _323.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
5904
5906
  {}
5905
5907
  );
5906
5908
  return response.data;
@@ -5950,8 +5952,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5950
5952
  return this.http.request("/api/v2/monitors/audit", {
5951
5953
  method: "POST",
5952
5954
  body: {
5953
- ..._optionalChain([options, 'optionalAccess', _336 => _336.fleetId]) ? { fleet_id: options.fleetId } : {},
5954
- ..._optionalChain([options, 'optionalAccess', _337 => _337.cursor]) ? { cursor: options.cursor } : {}
5955
+ ..._optionalChain([options, 'optionalAccess', _324 => _324.fleetId]) ? { fleet_id: options.fleetId } : {},
5956
+ ..._optionalChain([options, 'optionalAccess', _325 => _325.cursor]) ? { cursor: options.cursor } : {}
5955
5957
  },
5956
5958
  maxRetries: 0
5957
5959
  });
@@ -5961,8 +5963,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5961
5963
  return this.http.request("/api/v2/monitors/repair", {
5962
5964
  method: "POST",
5963
5965
  body: {
5964
- ..._optionalChain([options, 'optionalAccess', _338 => _338.fleetId]) ? { fleet_id: options.fleetId } : {},
5965
- ..._optionalChain([options, 'optionalAccess', _339 => _339.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
5966
+ ..._optionalChain([options, 'optionalAccess', _326 => _326.fleetId]) ? { fleet_id: options.fleetId } : {},
5967
+ ..._optionalChain([options, 'optionalAccess', _327 => _327.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
5966
5968
  },
5967
5969
  maxRetries: 0
5968
5970
  });
@@ -5970,7 +5972,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5970
5972
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
5971
5973
  async readMonitorsHealth(options) {
5972
5974
  const params = new URLSearchParams();
5973
- if (_optionalChain([options, 'optionalAccess', _340 => _340.fleetId])) params.set("fleet_id", options.fleetId);
5975
+ if (_optionalChain([options, 'optionalAccess', _328 => _328.fleetId])) params.set("fleet_id", options.fleetId);
5974
5976
  const query = params.toString();
5975
5977
  const suffix = query ? `?${query}` : "";
5976
5978
  return this.http.request(
@@ -6043,7 +6045,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6043
6045
  );
6044
6046
  }
6045
6047
  const params = new URLSearchParams();
6046
- if (_optionalChain([options, 'optionalAccess', _341 => _341.cursor])) params.set("cursor", options.cursor);
6048
+ if (_optionalChain([options, 'optionalAccess', _329 => _329.cursor])) params.set("cursor", options.cursor);
6047
6049
  const suffix = params.size > 0 ? `?${params}` : "";
6048
6050
  return this.http.request(
6049
6051
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6087,7 +6089,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6087
6089
  * `client.monitors.deploy(...)`.
6088
6090
  */
6089
6091
  async deployMonitor(definition, options) {
6090
- if (_optionalChain([options, 'optionalAccess', _342 => _342.dryRun])) {
6092
+ if (_optionalChain([options, 'optionalAccess', _330 => _330.dryRun])) {
6091
6093
  return this.http.request("/api/v2/monitors/check", {
6092
6094
  method: "POST",
6093
6095
  body: definition
@@ -6123,12 +6125,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6123
6125
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6124
6126
  async listMonitors(options) {
6125
6127
  const params = new URLSearchParams();
6126
- if (_optionalChain([options, 'optionalAccess', _343 => _343.state])) params.set("state", options.state);
6127
- else if (_optionalChain([options, 'optionalAccess', _344 => _344.status])) params.set("status", options.status);
6128
- if (_optionalChain([options, 'optionalAccess', _345 => _345.limit]) !== void 0)
6128
+ if (_optionalChain([options, 'optionalAccess', _331 => _331.state])) params.set("state", options.state);
6129
+ else if (_optionalChain([options, 'optionalAccess', _332 => _332.status])) params.set("status", options.status);
6130
+ if (_optionalChain([options, 'optionalAccess', _333 => _333.limit]) !== void 0)
6129
6131
  params.set("limit", String(options.limit));
6130
- if (_optionalChain([options, 'optionalAccess', _346 => _346.cursor])) params.set("cursor", options.cursor);
6131
- if (_optionalChain([options, 'optionalAccess', _347 => _347.includeConsumers])) params.set("include_consumers", "true");
6132
+ if (_optionalChain([options, 'optionalAccess', _334 => _334.cursor])) params.set("cursor", options.cursor);
6133
+ if (_optionalChain([options, 'optionalAccess', _335 => _335.includeConsumers])) params.set("include_consumers", "true");
6132
6134
  const query = params.toString();
6133
6135
  const suffix = query ? `?${query}` : "";
6134
6136
  return this.http.request(
@@ -6144,7 +6146,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6144
6146
  );
6145
6147
  }
6146
6148
  async testMonitorWebhook(key, payload, options) {
6147
- if (_optionalChain([options, 'optionalAccess', _348 => _348.dispatch]) === true || _optionalChain([options, 'optionalAccess', _349 => _349.validationOnly]) === false) {
6149
+ if (_optionalChain([options, 'optionalAccess', _336 => _336.dispatch]) === true || _optionalChain([options, 'optionalAccess', _337 => _337.validationOnly]) === false) {
6148
6150
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
6149
6151
  "Monitor tests are validation-only and cannot dispatch events.",
6150
6152
  void 0,
@@ -6199,7 +6201,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6199
6201
  }
6200
6202
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6201
6203
  async deleteMonitor(key, options) {
6202
- if (_optionalChain([options, 'optionalAccess', _350 => _350.localOnly]) === true) {
6204
+ if (_optionalChain([options, 'optionalAccess', _338 => _338.localOnly]) === true) {
6203
6205
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
6204
6206
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6205
6207
  void 0,
@@ -6207,11 +6209,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6207
6209
  );
6208
6210
  }
6209
6211
  const params = new URLSearchParams();
6210
- if (_optionalChain([options, 'optionalAccess', _351 => _351.dryRun])) params.set("dry_run", "true");
6212
+ if (_optionalChain([options, 'optionalAccess', _339 => _339.dryRun])) params.set("dry_run", "true");
6211
6213
  const query = params.toString();
6212
6214
  return this.http.request(
6213
6215
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6214
- _optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? { method: "DELETE" } : {
6216
+ _optionalChain([options, 'optionalAccess', _340 => _340.dryRun]) ? { method: "DELETE" } : {
6215
6217
  method: "DELETE",
6216
6218
  // Deletion is a provider lifecycle operation. A timeout is an
6217
6219
  // unknown outcome, not authority to begin another delete attempt.
@@ -6224,10 +6226,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6224
6226
  * Prefer `client.monitors.reactivate(...)`.
6225
6227
  */
6226
6228
  async reactivateMonitor(key, options) {
6227
- const query = _optionalChain([options, 'optionalAccess', _353 => _353.dryRun]) ? "?dry_run=true" : "";
6229
+ const query = _optionalChain([options, 'optionalAccess', _341 => _341.dryRun]) ? "?dry_run=true" : "";
6228
6230
  return this.http.request(
6229
6231
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6230
- _optionalChain([options, 'optionalAccess', _354 => _354.dryRun]) ? { method: "POST", body: {} } : {
6232
+ _optionalChain([options, 'optionalAccess', _342 => _342.dryRun]) ? { method: "POST", body: {} } : {
6231
6233
  method: "POST",
6232
6234
  body: {},
6233
6235
  // Reactivation can create an upstream resource, so it must not use
@@ -6241,7 +6243,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6241
6243
  // ——————————————————————————————————————————————————————————
6242
6244
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6243
6245
  monitorJobIdempotencyKey(operation) {
6244
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _355 => _355.crypto, 'optionalAccess', _356 => _356.randomUUID, 'optionalCall', _357 => _357()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6246
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _343 => _343.crypto, 'optionalAccess', _344 => _344.randomUUID, 'optionalCall', _345 => _345()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6245
6247
  const prefix = "monitor-job-";
6246
6248
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6247
6249
  const maxOperationLength = Math.max(
@@ -6252,7 +6254,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6252
6254
  }
6253
6255
  monitorJobHeaders(operation, idempotencyKey) {
6254
6256
  return {
6255
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _358 => _358.trim, 'call', _359 => _359()]) || this.monitorJobIdempotencyKey(operation)
6257
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _346 => _346.trim, 'call', _347 => _347()]) || this.monitorJobIdempotencyKey(operation)
6256
6258
  };
6257
6259
  }
6258
6260
  async deployMonitorBatch(definitions, options) {
@@ -6263,7 +6265,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6263
6265
  body: { version: 1, kind: "batch", monitors: definitions },
6264
6266
  headers: this.monitorJobHeaders(
6265
6267
  "batch-deploy",
6266
- _optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
6268
+ _optionalChain([options, 'optionalAccess', _348 => _348.idempotencyKey])
6267
6269
  ),
6268
6270
  maxRetries: 0,
6269
6271
  exactUrlOnly: true
@@ -6282,11 +6284,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6282
6284
  version: 1,
6283
6285
  kind: "batch",
6284
6286
  monitors: definitions,
6285
- ..._optionalChain([options, 'optionalAccess', _361 => _361.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6287
+ ..._optionalChain([options, 'optionalAccess', _349 => _349.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6286
6288
  },
6287
6289
  headers: this.monitorJobHeaders(
6288
6290
  `batch-sync-${batchId}`,
6289
- _optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
6291
+ _optionalChain([options, 'optionalAccess', _350 => _350.idempotencyKey])
6290
6292
  ),
6291
6293
  maxRetries: 0,
6292
6294
  exactUrlOnly: true
@@ -6301,7 +6303,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6301
6303
  body: {},
6302
6304
  headers: this.monitorJobHeaders(
6303
6305
  `batch-start-${batchId}`,
6304
- _optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
6306
+ _optionalChain([options, 'optionalAccess', _351 => _351.idempotencyKey])
6305
6307
  ),
6306
6308
  maxRetries: 0,
6307
6309
  exactUrlOnly: true
@@ -6316,7 +6318,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6316
6318
  body: {},
6317
6319
  headers: this.monitorJobHeaders(
6318
6320
  `batch-stop-${batchId}`,
6319
- _optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
6321
+ _optionalChain([options, 'optionalAccess', _352 => _352.idempotencyKey])
6320
6322
  ),
6321
6323
  maxRetries: 0,
6322
6324
  exactUrlOnly: true
@@ -6337,7 +6339,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6337
6339
  body: {},
6338
6340
  headers: this.monitorJobHeaders(
6339
6341
  `${action}-${monitorKey}`,
6340
- _optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey])
6342
+ _optionalChain([options, 'optionalAccess', _353 => _353.idempotencyKey])
6341
6343
  ),
6342
6344
  maxRetries: 0,
6343
6345
  exactUrlOnly: true
@@ -6350,7 +6352,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6350
6352
  body: definition,
6351
6353
  headers: this.monitorJobHeaders(
6352
6354
  `sync-${definition.key}`,
6353
- _optionalChain([options, 'optionalAccess', _366 => _366.idempotencyKey])
6355
+ _optionalChain([options, 'optionalAccess', _354 => _354.idempotencyKey])
6354
6356
  ),
6355
6357
  maxRetries: 0,
6356
6358
  exactUrlOnly: true
@@ -6363,7 +6365,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6363
6365
  );
6364
6366
  }
6365
6367
  async getMonitorJobLogs(jobId, options) {
6366
- const query = _optionalChain([options, 'optionalAccess', _367 => _367.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6368
+ const query = _optionalChain([options, 'optionalAccess', _355 => _355.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6367
6369
  return this.http.request(
6368
6370
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
6369
6371
  { method: "GET" }
@@ -6376,15 +6378,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6376
6378
  );
6377
6379
  }
6378
6380
  async waitForMonitorJob(jobId, options) {
6379
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _368 => _368.timeoutMs]), () => ( 10 * 6e4)));
6380
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _369 => _369.pollIntervalMs]), () => ( 2e3)));
6381
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _356 => _356.timeoutMs]), () => ( 10 * 6e4)));
6382
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _357 => _357.pollIntervalMs]), () => ( 2e3)));
6381
6383
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
6382
6384
  const startedAt = Date.now();
6383
6385
  let latest = await this.getMonitorJob(jobId);
6384
6386
  while (true) {
6385
- _optionalChain([options, 'optionalAccess', _370 => _370.onProgress, 'optionalCall', _371 => _371(latest)]);
6387
+ _optionalChain([options, 'optionalAccess', _358 => _358.onProgress, 'optionalCall', _359 => _359(latest)]);
6386
6388
  const job = latest.job;
6387
- const state = typeof _optionalChain([job, 'optionalAccess', _372 => _372.state]) === "string" ? job.state : void 0;
6389
+ const state = typeof _optionalChain([job, 'optionalAccess', _360 => _360.state]) === "string" ? job.state : void 0;
6388
6390
  if (state && terminal.has(state)) return latest;
6389
6391
  if (Date.now() - startedAt >= timeoutMs) return latest;
6390
6392
  await sleep(pollIntervalMs);
@@ -6395,12 +6397,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6395
6397
  // Monitor Fleets
6396
6398
  // ——————————————————————————————————————————————————————————
6397
6399
  monitorFleetIdempotencyKey(operation) {
6398
- const uuid = _optionalChain([globalThis, 'access', _373 => _373.crypto, 'optionalAccess', _374 => _374.randomUUID, 'optionalCall', _375 => _375()]);
6400
+ const uuid = _optionalChain([globalThis, 'access', _361 => _361.crypto, 'optionalAccess', _362 => _362.randomUUID, 'optionalCall', _363 => _363()]);
6399
6401
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
6400
6402
  }
6401
6403
  monitorFleetHeaders(operation, idempotencyKey) {
6402
6404
  return {
6403
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _376 => _376.trim, 'call', _377 => _377()]) || this.monitorFleetIdempotencyKey(operation)
6405
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _364 => _364.trim, 'call', _365 => _365()]) || this.monitorFleetIdempotencyKey(operation)
6404
6406
  };
6405
6407
  }
6406
6408
  monitorFleetPath(fleetId) {
@@ -6420,15 +6422,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6420
6422
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
6421
6423
  const body = {
6422
6424
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
6423
- ..._optionalChain([options, 'optionalAccess', _378 => _378.dryRun]) ? { dry_run: true } : {},
6424
- ..._optionalChain([options, 'optionalAccess', _379 => _379.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6425
+ ..._optionalChain([options, 'optionalAccess', _366 => _366.dryRun]) ? { dry_run: true } : {},
6426
+ ..._optionalChain([options, 'optionalAccess', _367 => _367.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6425
6427
  };
6426
6428
  return this.http.request(
6427
6429
  this.monitorFleetPath(fleetId),
6428
6430
  {
6429
6431
  method: "PUT",
6430
6432
  body,
6431
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _380 => _380.idempotencyKey])),
6433
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _368 => _368.idempotencyKey])),
6432
6434
  maxRetries: 0,
6433
6435
  exactUrlOnly: true
6434
6436
  }
@@ -6441,8 +6443,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6441
6443
  }
6442
6444
  async getMonitorFleet(fleetId, options) {
6443
6445
  const params = new URLSearchParams();
6444
- if (_optionalChain([options, 'optionalAccess', _381 => _381.drift])) params.set("drift", "1");
6445
- if (_optionalChain([options, 'optionalAccess', _382 => _382.limit]) !== void 0)
6446
+ if (_optionalChain([options, 'optionalAccess', _369 => _369.drift])) params.set("drift", "1");
6447
+ if (_optionalChain([options, 'optionalAccess', _370 => _370.limit]) !== void 0)
6446
6448
  params.set("limit", String(options.limit));
6447
6449
  const query = params.toString();
6448
6450
  return this.http.request(
@@ -6455,10 +6457,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6455
6457
  this.monitorFleetPath(fleetId),
6456
6458
  {
6457
6459
  method: "DELETE",
6458
- body: _optionalChain([options, 'optionalAccess', _383 => _383.dryRun]) ? { dry_run: true } : {},
6460
+ body: _optionalChain([options, 'optionalAccess', _371 => _371.dryRun]) ? { dry_run: true } : {},
6459
6461
  headers: this.monitorFleetHeaders(
6460
6462
  "deactivate",
6461
- _optionalChain([options, 'optionalAccess', _384 => _384.idempotencyKey])
6463
+ _optionalChain([options, 'optionalAccess', _372 => _372.idempotencyKey])
6462
6464
  ),
6463
6465
  maxRetries: 0,
6464
6466
  exactUrlOnly: true
@@ -6473,7 +6475,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6473
6475
  body: {},
6474
6476
  headers: this.monitorFleetHeaders(
6475
6477
  "reactivate",
6476
- _optionalChain([options, 'optionalAccess', _385 => _385.idempotencyKey])
6478
+ _optionalChain([options, 'optionalAccess', _373 => _373.idempotencyKey])
6477
6479
  ),
6478
6480
  maxRetries: 0,
6479
6481
  exactUrlOnly: true
@@ -6490,13 +6492,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
6490
6492
  * identical to "the request failed".
6491
6493
  */
6492
6494
  async waitForMonitorFleetConvergence(fleetId, options) {
6493
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _386 => _386.timeoutMs]), () => ( 10 * 6e4)));
6494
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _387 => _387.pollIntervalMs]), () => ( 2e3)));
6495
- const terminal = _optionalChain([options, 'optionalAccess', _388 => _388.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6495
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _374 => _374.timeoutMs]), () => ( 10 * 6e4)));
6496
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _375 => _375.pollIntervalMs]), () => ( 2e3)));
6497
+ const terminal = _optionalChain([options, 'optionalAccess', _376 => _376.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6496
6498
  const startedAt = Date.now();
6497
6499
  let latest = await this.getMonitorFleet(fleetId);
6498
6500
  while (true) {
6499
- _optionalChain([options, 'optionalAccess', _389 => _389.onProgress, 'optionalCall', _390 => _390(latest)]);
6501
+ _optionalChain([options, 'optionalAccess', _377 => _377.onProgress, 'optionalCall', _378 => _378(latest)]);
6500
6502
  const status = typeof latest.status === "string" ? latest.status : void 0;
6501
6503
  if (status && terminal.has(status)) return latest;
6502
6504
  if (Date.now() - startedAt >= timeoutMs) return latest;
@@ -6504,6 +6506,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
6504
6506
  latest = await this.getMonitorFleet(fleetId);
6505
6507
  }
6506
6508
  }
6509
+ /**
6510
+ * The workspace and user this client's API key authenticates as.
6511
+ *
6512
+ * @example
6513
+ * ```typescript
6514
+ * const status = await client.authStatus();
6515
+ * ```
6516
+ */
6517
+ async authStatus() {
6518
+ return this.http.post("/api/v2/auth/cli/status", {
6519
+ api_key: this.config.apiKey
6520
+ });
6521
+ }
6507
6522
  /**
6508
6523
  * Check API connectivity and server health.
6509
6524
  *