deepline 0.3.454 → 0.3.456

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 (115) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +23 -0
  2. package/dist/bundling-sources/sdk/src/http.ts +17 -3
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/tool-calls.ts +13 -1
  5. package/dist/bundling-sources/sdk/src/types.ts +2 -0
  6. package/dist/cli/{auth-YNPT3IER.mjs → auth-OBWRDCK3.mjs} +4 -4
  7. package/dist/cli/auth-X5H25CM4.js +40 -0
  8. package/dist/cli/{billing-VXIIND6T.js → billing-XDDTD7C3.js} +73 -73
  9. package/dist/cli/{billing-TLRVAOXB.mjs → billing-ZR4OHVLA.mjs} +4 -4
  10. package/dist/cli/{chunk-U72KDMYJ.mjs → chunk-4EMVWEUJ.mjs} +2 -2
  11. package/dist/cli/{chunk-VHGGHRGY.js → chunk-4X5H47H5.js} +93 -92
  12. package/dist/cli/{chunk-BUYQU7TB.js → chunk-76GTVFFG.js} +8 -8
  13. package/dist/cli/{chunk-R2GLGLDR.mjs → chunk-77Z5BO7D.mjs} +21 -0
  14. package/dist/cli/{chunk-27NNEBIS.mjs → chunk-7PW2K3AT.mjs} +2 -2
  15. package/dist/cli/{chunk-RDAUQGPG.mjs → chunk-AGWG2PVB.mjs} +1 -1
  16. package/dist/cli/{chunk-5OQMUDPM.mjs → chunk-APPPIUEW.mjs} +1 -1
  17. package/dist/cli/{chunk-NMJ4D2WO.js → chunk-AQFHU3DW.js} +21 -0
  18. package/dist/cli/{chunk-KPPL2WNH.js → chunk-BQWHXKXO.js} +16 -16
  19. package/dist/cli/{chunk-WONLZMDF.js → chunk-CJTOZLFI.js} +6 -6
  20. package/dist/cli/{chunk-DCZSJON4.mjs → chunk-GQVMERZ7.mjs} +2 -2
  21. package/dist/cli/{chunk-LVHRP7XM.mjs → chunk-HZODG765.mjs} +4 -4
  22. package/dist/cli/{chunk-THJ7ORNM.mjs → chunk-IQ5OW2WC.mjs} +3 -3
  23. package/dist/cli/{chunk-7ICOQRW5.js → chunk-J2KWJKTM.js} +3 -3
  24. package/dist/cli/{chunk-YPYR4ACF.js → chunk-K5TWU5I6.js} +51 -51
  25. package/dist/cli/{chunk-IJ5WCZ32.js → chunk-KFCXTVDW.js} +20 -20
  26. package/dist/cli/{chunk-TECW24CR.mjs → chunk-M7FF76WO.mjs} +5 -3
  27. package/dist/cli/{chunk-5GJH2BYN.mjs → chunk-NXJEDRPH.mjs} +2 -2
  28. package/dist/cli/{chunk-SJH66N73.js → chunk-OQEIP4HF.js} +6 -6
  29. package/dist/cli/{chunk-G6ZOZQXT.mjs → chunk-P5MB2PXV.mjs} +3 -3
  30. package/dist/cli/{chunk-FKGXZXRP.js → chunk-PPF557JY.js} +8 -8
  31. package/dist/cli/{chunk-6JY2NGJN.js → chunk-QLB5T7IS.js} +26 -26
  32. package/dist/cli/{chunk-VXBEHDM6.js → chunk-S3D7OY6D.js} +8 -6
  33. package/dist/cli/{chunk-S2PO3X5R.js → chunk-SAO7KYJE.js} +2 -2
  34. package/dist/cli/{chunk-QLMQ2NAQ.js → chunk-SHWMFFKX.js} +2 -2
  35. package/dist/cli/{chunk-33FEF4RH.js → chunk-SOUPX3YJ.js} +50 -50
  36. package/dist/cli/{chunk-2I7GE7KB.mjs → chunk-U4JZWJ52.mjs} +1 -1
  37. package/dist/cli/{chunk-Z5PQSTYX.js → chunk-VVYM2F7X.js} +252 -239
  38. package/dist/cli/{chunk-UT6W675P.mjs → chunk-W64S7C55.mjs} +1 -1
  39. package/dist/cli/{chunk-7V3OKSB2.js → chunk-WEHXHC7N.js} +1 -1
  40. package/dist/cli/{chunk-CPXT4KPC.mjs → chunk-WXCYW6PA.mjs} +3 -3
  41. package/dist/cli/{chunk-YETNOEAZ.mjs → chunk-XRNBDUYR.mjs} +10 -9
  42. package/dist/cli/{chunk-P5IQ6LIK.js → chunk-XVGEAB44.js} +35 -35
  43. package/dist/cli/{chunk-EXWKHMMP.mjs → chunk-YMV3AULG.mjs} +5 -5
  44. package/dist/cli/{chunk-LWYOJG66.mjs → chunk-ZCXFZSVH.mjs} +1 -1
  45. package/dist/cli/{chunk-YXCLG3KB.mjs → chunk-ZODPS5JW.mjs} +15 -2
  46. package/dist/cli/command-docs.js +2 -2
  47. package/dist/cli/command-docs.mjs +1 -1
  48. package/dist/cli/{csv-BSKJR3CR.js → csv-B35BFYGT.js} +12 -12
  49. package/dist/cli/{csv-I4CAAV6A.mjs → csv-P2ATJQUY.mjs} +3 -3
  50. package/dist/cli/{db-RA3IL6MC.js → db-ELEZFHG7.js} +25 -25
  51. package/dist/cli/{db-EQP24K3B.mjs → db-PSITREEX.mjs} +4 -4
  52. package/dist/cli/{describe-62KPTIFH.js → describe-AXWFWCWZ.js} +17 -17
  53. package/dist/cli/{describe-EZDVJDPQ.mjs → describe-E2ZFRC5Z.mjs} +13 -13
  54. package/dist/cli/describe-core.d.mts +1 -1
  55. package/dist/cli/describe-core.d.ts +1 -1
  56. package/dist/cli/{executions-W5KR56KP.mjs → executions-BZTPNWW2.mjs} +4 -4
  57. package/dist/cli/{executions-2HBBXRPM.js → executions-GWYPVJYE.js} +6 -6
  58. package/dist/cli/{feedback-6UTOLSFP.mjs → feedback-F3RKOHZN.mjs} +3 -3
  59. package/dist/cli/{feedback-CVYS7ZPV.js → feedback-UCW6EFOR.js} +7 -7
  60. package/dist/cli/git-HEKGLILK.js +24 -0
  61. package/dist/cli/{git-JXH64LI4.mjs → git-LGQMBBO3.mjs} +4 -4
  62. package/dist/cli/index.js +136 -136
  63. package/dist/cli/index.mjs +38 -38
  64. package/dist/cli/{legacy-noops-NYMLGQNX.mjs → legacy-noops-4TVFFILL.mjs} +4 -4
  65. package/dist/cli/{legacy-noops-5XTXIPU2.js → legacy-noops-SRH3BPNV.js} +7 -7
  66. package/dist/cli/{monitors-J6HAQLX2.js → monitors-6NHXI3EW.js} +89 -89
  67. package/dist/cli/{monitors-CEU6SP2B.mjs → monitors-WBST3XUH.mjs} +5 -5
  68. package/dist/cli/{org-CYE3DCIT.js → org-5EFVZUB2.js} +66 -66
  69. package/dist/cli/{org-RRKAJM5V.mjs → org-DSDNRGDV.mjs} +4 -4
  70. package/dist/cli/{play-PXISXZ2P.mjs → play-EKOV2T5N.mjs} +11 -11
  71. package/dist/cli/{play-NJDW74YH.js → play-RMWBABCH.js} +284 -284
  72. package/dist/cli/{providers-6QGGDOWK.mjs → providers-AWNJWZWD.mjs} +46 -4
  73. package/dist/cli/{providers-JE3MUBYK.js → providers-Y4EYH7IZ.js} +50 -8
  74. package/dist/cli/{quickstart-MKJ7TYQZ.mjs → quickstart-CPW66MBY.mjs} +3 -3
  75. package/dist/cli/{quickstart-AQBBOFQL.js → quickstart-JQ3W6LWQ.js} +5 -5
  76. package/dist/cli/search-PJXI2GJR.js +30 -0
  77. package/dist/cli/{search-6PKFZ2JD.mjs → search-VP4Y6MQU.mjs} +5 -5
  78. package/dist/cli/{secrets-QBWRVZCT.mjs → secrets-2VEENFF4.mjs} +4 -4
  79. package/dist/cli/{secrets-IKGJYESD.js → secrets-CPMHM5HU.js} +13 -13
  80. package/dist/cli/{sessions-462I5YEQ.js → sessions-ALPCLDJI.js} +5 -5
  81. package/dist/cli/{sessions-SVYTBNRJ.mjs → sessions-INDUUZ3K.mjs} +4 -4
  82. package/dist/cli/{settings-FH4XZ7FE.mjs → settings-3YBZZPAM.mjs} +10 -10
  83. package/dist/cli/{settings-WHLTLPXZ.js → settings-5PO4C33K.js} +77 -77
  84. package/dist/cli/{setup-ISCNCB4W.mjs → setup-7SOJ4INF.mjs} +8 -8
  85. package/dist/cli/{setup-IKTCP3QB.js → setup-RK2MUVXO.js} +43 -43
  86. package/dist/cli/{skills-HITZS5EJ.mjs → skills-5PR5RTOX.mjs} +6 -6
  87. package/dist/cli/skills-J3243JQE.js +30 -0
  88. package/dist/cli/{tools-SQUTVLPO.mjs → tools-OSJJUP36.mjs} +13 -13
  89. package/dist/cli/tools-V2B44RFH.js +45 -0
  90. package/dist/cli/update-CKIL2SWB.js +32 -0
  91. package/dist/cli/{update-AFYEREBX.mjs → update-TDCMXJ62.mjs} +8 -8
  92. package/dist/cli/{workflow-AAOOROIR.js → workflow-6DKCCQYA.js} +15 -15
  93. package/dist/cli/{workflow-VBCZPKVF.mjs → workflow-6O24O6LT.mjs} +5 -5
  94. package/dist/{client-Ct6OBj9Y.d.mts → client-BX2EVlPo.d.mts} +21 -0
  95. package/dist/{client-BV7tC6oq.d.ts → client-CRz2laoR.d.ts} +21 -0
  96. package/dist/index.d.mts +2 -2
  97. package/dist/index.d.ts +2 -2
  98. package/dist/index.js +6 -6
  99. package/dist/index.mjs +3 -3
  100. package/dist/install-integrity.json +84 -84
  101. package/dist/plays/play-description.d.mts +1 -1
  102. package/dist/plays/play-description.d.ts +1 -1
  103. package/dist/plays/run-request.d.mts +1 -1
  104. package/dist/plays/run-request.d.ts +1 -1
  105. package/dist/release.d.mts +1 -1
  106. package/dist/release.d.ts +1 -1
  107. package/dist/release.js +2 -2
  108. package/dist/release.mjs +1 -1
  109. package/package.json +1 -1
  110. package/dist/cli/auth-GUZWKNXM.js +0 -40
  111. package/dist/cli/git-U6FMVAAM.js +0 -24
  112. package/dist/cli/search-EJGRNQQK.js +0 -30
  113. package/dist/cli/skills-LC2YKUSO.js +0 -30
  114. package/dist/cli/tools-Y55OXE72.js +0 -45
  115. package/dist/cli/update-Q3I6MSEQ.js +0 -32
@@ -28,7 +28,7 @@ var _chunkKXMNM4AQjs = require('./chunk-KXMNM4AQ.js');
28
28
 
29
29
 
30
30
 
31
- var _chunkVXBEHDM6js = require('./chunk-VXBEHDM6.js');
31
+ var _chunkS3D7OY6Djs = require('./chunk-S3D7OY6D.js');
32
32
 
33
33
 
34
34
  var _chunkALJJRZNJjs = require('./chunk-ALJJRZNJ.js');
@@ -626,6 +626,7 @@ var ToolCalls = class {
626
626
  const legacyEndpoint = `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`;
627
627
  let useLegacyEndpoint = idempotencyKey === void 0;
628
628
  const atomicToolOnly = _optionalChain([options, 'optionalAccess', _25 => _25.atomicToolOnly]) === true;
629
+ const retryAmbiguousDelivery = atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _26 => _26.retryAmbiguousDelivery]) === true;
629
630
  const dispatchRequest = async (requestTimeoutMs) => {
630
631
  let recoverySupported = false;
631
632
  let atomicToolsSupported = false;
@@ -638,18 +639,19 @@ var ToolCalls = class {
638
639
  headers,
639
640
  {
640
641
  timeout: requestTimeoutMs,
641
- maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.maxRetries]), () => ( 0)),
642
- ...atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _27 => _27.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
643
- retryApiErrors: atomicToolOnly || _optionalChain([options, 'optionalAccess', _28 => _28.retryApiErrors]) === true,
642
+ maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _27 => _27.maxRetries]), () => ( (retryAmbiguousDelivery ? 2 : 0))),
643
+ ...atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _28 => _28.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
644
+ retryApiErrors: atomicToolOnly || _optionalChain([options, 'optionalAccess', _29 => _29.retryApiErrors]) === true,
644
645
  retryFromExecutePolicy: atomicToolOnly,
646
+ retryAmbiguousDelivery,
645
647
  exactUrlOnly: true,
646
648
  toolId,
647
649
  idempotencyKey,
648
650
  onResponse: (response2) => {
649
651
  lastResponse = null;
650
- atomicToolsSupported = response2.headers.get(_chunkVXBEHDM6js.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
652
+ atomicToolsSupported = response2.headers.get(_chunkS3D7OY6Djs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
651
653
  recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
652
- if (_optionalChain([options, 'optionalAccess', _29 => _29.onServerTiming])) {
654
+ if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
653
655
  try {
654
656
  const notification = options.onServerTiming(
655
657
  parseExecuteServerTiming(
@@ -685,7 +687,7 @@ var ToolCalls = class {
685
687
  await this.lookupExecutionByKey(
686
688
  idempotencyKey,
687
689
  requestTimeoutMs,
688
- _optionalChain([options, 'optionalAccess', _30 => _30.cliInvocationId])
690
+ _optionalChain([options, 'optionalAccess', _31 => _31.cliInvocationId])
689
691
  );
690
692
  useLegacyEndpoint = true;
691
693
  return post();
@@ -702,7 +704,7 @@ var ToolCalls = class {
702
704
  };
703
705
  let response;
704
706
  let recoveryDeadline = null;
705
- const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _31 => _31.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
707
+ const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _32 => _32.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
706
708
  let retryDelayMs = 1e3;
707
709
  const recoveryTimeoutError = () => executionRecoveryError({
708
710
  toolId,
@@ -730,7 +732,7 @@ var ToolCalls = class {
730
732
  this.defaultRequestTimeoutMs,
731
733
  remainingMs
732
734
  ),
733
- _optionalChain([options, 'optionalAccess', _32 => _32.cliInvocationId])
735
+ _optionalChain([options, 'optionalAccess', _33 => _33.cliInvocationId])
734
736
  );
735
737
  } catch (error) {
736
738
  if (!isRecoverableExecutionLookupError(error)) throw error;
@@ -907,10 +909,10 @@ function resolvePlayRunRuntimeSelection(request, env) {
907
909
  }
908
910
  return runtime;
909
911
  }
910
- const configured = _optionalChain([env, 'access', _33 => _33.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _34 => _34.trim, 'call', _35 => _35()]);
911
- const configuredNamespace = _optionalChain([env, 'access', _36 => _36.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _37 => _37.trim, 'call', _38 => _38()]);
912
- const configuredToken = _optionalChain([env, 'access', _39 => _39.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _40 => _40.trim, 'call', _41 => _41()]);
913
- const configuredPlacementPolicy = _optionalChain([env, 'access', _42 => _42.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _43 => _43.trim, 'call', _44 => _44()]);
912
+ const configured = _optionalChain([env, 'access', _34 => _34.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]);
913
+ const configuredNamespace = _optionalChain([env, 'access', _37 => _37.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]);
914
+ const configuredToken = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
915
+ const configuredPlacementPolicy = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
914
916
  if (!configured) {
915
917
  if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
916
918
  const present = [];
@@ -949,7 +951,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
949
951
  "INVALID_RUNTIME_NAMESPACE"
950
952
  );
951
953
  }
952
- const configuredBackendValue = _optionalChain([env, 'access', _45 => _45.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()]);
954
+ const configuredBackendValue = _optionalChain([env, 'access', _46 => _46.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()]);
953
955
  const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
954
956
  if (configuredBackendValue && !configuredBackend) {
955
957
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
@@ -987,7 +989,7 @@ function resolveStartPlayRunRequest(request, env) {
987
989
  }
988
990
  function runtimeSelectionHeaders(runtime, env) {
989
991
  if (!runtime) return void 0;
990
- const token = _optionalChain([env, 'access', _48 => _48.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _49 => _49.trim, 'call', _50 => _50()]);
992
+ const token = _optionalChain([env, 'access', _49 => _49.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()]);
991
993
  if (!token) {
992
994
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
993
995
  "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
@@ -995,10 +997,10 @@ function runtimeSelectionHeaders(runtime, env) {
995
997
  "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
996
998
  );
997
999
  }
998
- const receivers = _optionalChain([env, 'access', _51 => _51.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]);
1000
+ const receivers = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
999
1001
  return {
1000
- [_chunkVXBEHDM6js.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1001
- ...receivers ? { [_chunkVXBEHDM6js.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1002
+ [_chunkS3D7OY6Djs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1003
+ ...receivers ? { [_chunkS3D7OY6Djs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1002
1004
  };
1003
1005
  }
1004
1006
  function normalizeTestPolicyOverrides(value, source) {
@@ -1013,7 +1015,7 @@ function normalizeTestPolicyOverrides(value, source) {
1013
1015
  }
1014
1016
  function parseEnvTestPolicyOverrides(env) {
1015
1017
  const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
1016
- const trimmed = _optionalChain([raw, 'optionalAccess', _54 => _54.trim, 'call', _55 => _55()]);
1018
+ const trimmed = _optionalChain([raw, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()]);
1017
1019
  if (!trimmed) return void 0;
1018
1020
  let parsed;
1019
1021
  try {
@@ -1033,17 +1035,17 @@ function isRecord2(value) {
1033
1035
  }
1034
1036
  function normalizePlayStatus(raw) {
1035
1037
  const runPackage = _chunkJKVRBCZLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkJKVRBCZLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1036
- const packageRun = _optionalChain([runPackage, 'optionalAccess', _56 => _56.run]);
1037
- const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _57 => _57.status]) === "string" ? packageRun.status : null;
1038
+ const packageRun = _optionalChain([runPackage, 'optionalAccess', _57 => _57.run]);
1039
+ const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _58 => _58.status]) === "string" ? packageRun.status : null;
1038
1040
  const status = _chunkJKVRBCZLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1039
1041
  if (!status) {
1040
1042
  throw new Error(
1041
1043
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
1042
1044
  );
1043
1045
  }
1044
- const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _58 => _58.id]), () => ( ""));
1045
- const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _59 => _59.overview]), () => ( raw.overview));
1046
- const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _60 => _60.runStatus]), () => ( raw.runStatus));
1046
+ const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _59 => _59.id]), () => ( ""));
1047
+ const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _60 => _60.overview]), () => ( raw.overview));
1048
+ const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _61 => _61.runStatus]), () => ( raw.runStatus));
1047
1049
  return {
1048
1050
  ...raw,
1049
1051
  runId,
@@ -1069,16 +1071,16 @@ var PlayClient = class {
1069
1071
  return _chunkJKVRBCZLjs.startPlayRun.call(void 0,
1070
1072
  this.http,
1071
1073
  resolved.request,
1072
- _optionalChain([options, 'optionalAccess', _61 => _61.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkVXBEHDM6js.SDK_API_MAJOR) } : headers,
1074
+ _optionalChain([options, 'optionalAccess', _62 => _62.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkS3D7OY6Djs.SDK_API_MAJOR) } : headers,
1073
1075
  options
1074
1076
  );
1075
1077
  }
1076
1078
  async getPlayStatus(workflowId, options) {
1077
1079
  const params = new URLSearchParams();
1078
- if (_optionalChain([options, 'optionalAccess', _62 => _62.billing]) === false) {
1080
+ if (_optionalChain([options, 'optionalAccess', _63 => _63.billing]) === false) {
1079
1081
  params.set("billing", "false");
1080
1082
  }
1081
- if (_optionalChain([options, 'optionalAccess', _63 => _63.full]) === true) {
1083
+ if (_optionalChain([options, 'optionalAccess', _64 => _64.full]) === true) {
1082
1084
  params.set("full", "true");
1083
1085
  }
1084
1086
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -1096,7 +1098,7 @@ var PlayClient = class {
1096
1098
  async stopPlay(workflowId, options) {
1097
1099
  return this.http.post(
1098
1100
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
1099
- _optionalChain([options, 'optionalAccess', _64 => _64.reason]) ? { reason: options.reason } : {}
1101
+ _optionalChain([options, 'optionalAccess', _65 => _65.reason]) ? { reason: options.reason } : {}
1100
1102
  );
1101
1103
  }
1102
1104
  async listPlayRuns(playName) {
@@ -1108,7 +1110,7 @@ var PlayClient = class {
1108
1110
  }
1109
1111
  async getPlay(name, options) {
1110
1112
  const encodedName = encodeURIComponent(name);
1111
- const query = _optionalChain([options, 'optionalAccess', _65 => _65.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _66 => _66.guidance]) ? "?include=guidance" : "";
1113
+ const query = _optionalChain([options, 'optionalAccess', _66 => _66.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _67 => _67.guidance]) ? "?include=guidance" : "";
1112
1114
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
1113
1115
  }
1114
1116
  async clearPlayHistory(name, request = {}) {
@@ -1120,7 +1122,7 @@ var PlayClient = class {
1120
1122
  }
1121
1123
  async listPlayVersions(name, options) {
1122
1124
  const encodedName = encodeURIComponent(name);
1123
- const suffix = _optionalChain([options, 'optionalAccess', _67 => _67.full]) ? "?full=true" : "";
1125
+ const suffix = _optionalChain([options, 'optionalAccess', _68 => _68.full]) ? "?full=true" : "";
1124
1126
  const response = await this.http.get(
1125
1127
  `/api/v2/plays/${encodedName}/versions${suffix}`
1126
1128
  );
@@ -1135,9 +1137,9 @@ var PlayClient = class {
1135
1137
  }
1136
1138
  };
1137
1139
  function createPlayClient(options) {
1138
- const config = _chunkVXBEHDM6js.resolveConfig.call(void 0, options);
1140
+ const config = _chunkS3D7OY6Djs.resolveConfig.call(void 0, options);
1139
1141
  return new PlayClient(
1140
- new (0, _chunkVXBEHDM6js.HttpClient)(config),
1142
+ new (0, _chunkS3D7OY6Djs.HttpClient)(config),
1141
1143
  _nullishCoalesce(config.environment, () => ( process.env))
1142
1144
  );
1143
1145
  }
@@ -2084,7 +2086,7 @@ function parseDsl(input) {
2084
2086
  input.slice(position)
2085
2087
  );
2086
2088
  if (!operation) {
2087
- const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _68 => _68.exec, 'call', _69 => _69(input.slice(position)), 'optionalAccess', _70 => _70[0]]), () => ( input[position])), () => ( "<end>"));
2089
+ const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _69 => _69.exec, 'call', _70 => _70(input.slice(position)), 'optionalAccess', _71 => _71[0]]), () => ( input[position])), () => ( "<end>"));
2088
2090
  if (token === "=") {
2089
2091
  const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
2090
2092
  fail(
@@ -2163,7 +2165,7 @@ function normalizeRunEventQueryTimestamp(value) {
2163
2165
  return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
2164
2166
  }
2165
2167
  function timestampMicros(value) {
2166
- const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _71 => _71.exec, 'call', _72 => _72(value), 'optionalAccess', _73 => _73[1]]), () => ( ""));
2168
+ const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _72 => _72.exec, 'call', _73 => _73(value), 'optionalAccess', _74 => _74[1]]), () => ( ""));
2167
2169
  return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
2168
2170
  }
2169
2171
  function time(value, nowMs, fallback) {
@@ -2669,10 +2671,10 @@ function getStepStatusSignature(snapshot) {
2669
2671
  _nullishCoalesce(state.artifactTableNamespace, () => ( "")),
2670
2672
  _nullishCoalesce(state.startedAt, () => ( "")),
2671
2673
  _nullishCoalesce(state.completedAt, () => ( "")),
2672
- _nullishCoalesce(_optionalChain([state, 'access', _74 => _74.progress, 'optionalAccess', _75 => _75.startedAt]), () => ( "")),
2673
- _nullishCoalesce(_optionalChain([state, 'access', _76 => _76.progress, 'optionalAccess', _77 => _77.completedAt]), () => ( "")),
2674
+ _nullishCoalesce(_optionalChain([state, 'access', _75 => _75.progress, 'optionalAccess', _76 => _76.startedAt]), () => ( "")),
2675
+ _nullishCoalesce(_optionalChain([state, 'access', _77 => _77.progress, 'optionalAccess', _78 => _78.completedAt]), () => ( "")),
2674
2676
  _nullishCoalesce(state.updatedAt, () => ( "")),
2675
- _nullishCoalesce(_optionalChain([state, 'access', _78 => _78.progress, 'optionalAccess', _79 => _79.updatedAt]), () => ( ""))
2677
+ _nullishCoalesce(_optionalChain([state, 'access', _79 => _79.progress, 'optionalAccess', _80 => _80.updatedAt]), () => ( ""))
2676
2678
  ].join(":")
2677
2679
  ).join("|");
2678
2680
  }
@@ -2681,11 +2683,11 @@ function getStepProgressSignature(snapshot) {
2681
2683
  snapshot.nodeStates.map((state) => [
2682
2684
  state.nodeId,
2683
2685
  projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
2684
- _nullishCoalesce(_optionalChain([state, 'access', _80 => _80.progress, 'optionalAccess', _81 => _81.artifactTableNamespace]), () => ( "")),
2685
- _nullishCoalesce(_optionalChain([state, 'access', _82 => _82.progress, 'optionalAccess', _83 => _83.startedAt]), () => ( "")),
2686
- _nullishCoalesce(_optionalChain([state, 'access', _84 => _84.progress, 'optionalAccess', _85 => _85.completedAt]), () => ( "")),
2687
- _nullishCoalesce(_optionalChain([state, 'access', _86 => _86.progress, 'optionalAccess', _87 => _87.updatedAt]), () => ( "")),
2688
- _nullishCoalesce(_optionalChain([state, 'access', _88 => _88.progress, 'optionalAccess', _89 => _89.message]), () => ( ""))
2686
+ _nullishCoalesce(_optionalChain([state, 'access', _81 => _81.progress, 'optionalAccess', _82 => _82.artifactTableNamespace]), () => ( "")),
2687
+ _nullishCoalesce(_optionalChain([state, 'access', _83 => _83.progress, 'optionalAccess', _84 => _84.startedAt]), () => ( "")),
2688
+ _nullishCoalesce(_optionalChain([state, 'access', _85 => _85.progress, 'optionalAccess', _86 => _86.completedAt]), () => ( "")),
2689
+ _nullishCoalesce(_optionalChain([state, 'access', _87 => _87.progress, 'optionalAccess', _88 => _88.updatedAt]), () => ( "")),
2690
+ _nullishCoalesce(_optionalChain([state, 'access', _89 => _89.progress, 'optionalAccess', _90 => _90.message]), () => ( ""))
2689
2691
  ])
2690
2692
  );
2691
2693
  }
@@ -2755,8 +2757,8 @@ function diffPlayRunStreamEvents(input) {
2755
2757
  if (state.status === "idle") {
2756
2758
  continue;
2757
2759
  }
2758
- const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _90 => _90.progress, 'optionalAccess', _91 => _91.startedAt]))), () => ( null));
2759
- const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _92 => _92.progress, 'optionalAccess', _93 => _93.completedAt]))), () => ( null));
2760
+ const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _91 => _91.progress, 'optionalAccess', _92 => _92.startedAt]))), () => ( null));
2761
+ const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _93 => _93.progress, 'optionalAccess', _94 => _94.completedAt]))), () => ( null));
2760
2762
  events.push(
2761
2763
  makeRunStreamEvent({
2762
2764
  cursor,
@@ -2770,7 +2772,7 @@ function diffPlayRunStreamEvents(input) {
2770
2772
  ...resolveTimingWindow({
2771
2773
  startedAt: persistedStartedAt,
2772
2774
  completedAt: persistedCompletedAt,
2773
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _94 => _94.progress, 'optionalAccess', _95 => _95.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2775
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _95 => _95.progress, 'optionalAccess', _96 => _96.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2774
2776
  })
2775
2777
  }
2776
2778
  })
@@ -2824,9 +2826,9 @@ function diffPlayRunStreamEvents(input) {
2824
2826
  if (next.snapshotSignature !== previous.snapshotSignature) {
2825
2827
  const enrichedNodeStates = snapshot.nodeStates.map((state) => {
2826
2828
  const timing = resolveTimingWindow({
2827
- startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _96 => _96.progress, 'optionalAccess', _97 => _97.startedAt]))), () => ( null)),
2828
- completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _98 => _98.progress, 'optionalAccess', _99 => _99.completedAt]))), () => ( null)),
2829
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _100 => _100.progress, 'optionalAccess', _101 => _101.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2829
+ startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _97 => _97.progress, 'optionalAccess', _98 => _98.startedAt]))), () => ( null)),
2830
+ completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _99 => _99.progress, 'optionalAccess', _100 => _100.completedAt]))), () => ( null)),
2831
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _101 => _101.progress, 'optionalAccess', _102 => _102.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2830
2832
  });
2831
2833
  return {
2832
2834
  ...state,
@@ -2873,18 +2875,18 @@ var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
2873
2875
  var RUN_WATCH_STARTUP_POLL_INTERVAL_MS = 500;
2874
2876
  var RUN_WATCH_STARTUP_WINDOW_MS = 6e3;
2875
2877
  function waitForNextPoll(ms, signal) {
2876
- if (_optionalChain([signal, 'optionalAccess', _102 => _102.aborted])) {
2878
+ if (_optionalChain([signal, 'optionalAccess', _103 => _103.aborted])) {
2877
2879
  return Promise.resolve(false);
2878
2880
  }
2879
2881
  return new Promise((resolve) => {
2880
2882
  const finish = (elapsed) => {
2881
2883
  clearTimeout(timeout);
2882
- _optionalChain([signal, 'optionalAccess', _103 => _103.removeEventListener, 'call', _104 => _104("abort", onAbort)]);
2884
+ _optionalChain([signal, 'optionalAccess', _104 => _104.removeEventListener, 'call', _105 => _105("abort", onAbort)]);
2883
2885
  resolve(elapsed);
2884
2886
  };
2885
2887
  const onAbort = () => finish(false);
2886
2888
  const timeout = setTimeout(() => finish(true), ms);
2887
- _optionalChain([signal, 'optionalAccess', _105 => _105.addEventListener, 'call', _106 => _106("abort", onAbort, { once: true })]);
2889
+ _optionalChain([signal, 'optionalAccess', _106 => _106.addEventListener, 'call', _107 => _107("abort", onAbort, { once: true })]);
2888
2890
  });
2889
2891
  }
2890
2892
  function readSnapshotResponse(response, runId) {
@@ -2964,7 +2966,7 @@ async function* watchRunEvents(options) {
2964
2966
  let consecutiveFailures = 0;
2965
2967
  let outageNoticeSent = false;
2966
2968
  let pollCount = 0;
2967
- while (!_optionalChain([signal, 'optionalAccess', _107 => _107.aborted])) {
2969
+ while (!_optionalChain([signal, 'optionalAccess', _108 => _108.aborted])) {
2968
2970
  const pollStartedAt = Date.now();
2969
2971
  const poll = ++pollCount;
2970
2972
  const pollIntervalMs = _nullishCoalesce(options.pollIntervalMs, () => ( (pollStartedAt - watchStartedAt < RUN_WATCH_STARTUP_WINDOW_MS ? RUN_WATCH_STARTUP_POLL_INTERVAL_MS : RUN_WATCH_POLL_INTERVAL_MS)));
@@ -3008,7 +3010,7 @@ async function* watchRunEvents(options) {
3008
3010
  reportPoll();
3009
3011
  } catch (error) {
3010
3012
  reportPoll();
3011
- if (_optionalChain([signal, 'optionalAccess', _108 => _108.aborted])) {
3013
+ if (_optionalChain([signal, 'optionalAccess', _109 => _109.aborted])) {
3012
3014
  return;
3013
3015
  }
3014
3016
  if (!isTransientPlayRunReadError(error)) {
@@ -3017,12 +3019,12 @@ async function* watchRunEvents(options) {
3017
3019
  consecutiveFailures += 1;
3018
3020
  const reason = error instanceof Error ? error.message : String(error);
3019
3021
  if (!outageNoticeSent) {
3020
- _optionalChain([options, 'access', _109 => _109.onRetry, 'optionalCall', _110 => _110({
3022
+ _optionalChain([options, 'access', _110 => _110.onRetry, 'optionalCall', _111 => _111({
3021
3023
  attempt: consecutiveFailures,
3022
3024
  delayMs: pollIntervalMs,
3023
3025
  reason
3024
3026
  })]);
3025
- _optionalChain([options, 'access', _111 => _111.onNotice, 'optionalCall', _112 => _112(
3027
+ _optionalChain([options, 'access', _112 => _112.onNotice, 'optionalCall', _113 => _113(
3026
3028
  `[watch] run snapshot request failed; retrying snapshot polling (${reason})`
3027
3029
  )]);
3028
3030
  outageNoticeSent = true;
@@ -3037,12 +3039,12 @@ async function* watchRunEvents(options) {
3037
3039
  continue;
3038
3040
  }
3039
3041
  if (outageNoticeSent) {
3040
- _optionalChain([options, 'access', _113 => _113.onNotice, 'optionalCall', _114 => _114("[watch] run snapshot polling recovered")]);
3042
+ _optionalChain([options, 'access', _114 => _114.onNotice, 'optionalCall', _115 => _115("[watch] run snapshot polling recovered")]);
3041
3043
  outageNoticeSent = false;
3042
3044
  }
3043
3045
  consecutiveFailures = 0;
3044
3046
  if (terminalStatus) {
3045
- await _optionalChain([options, 'access', _115 => _115.terminalStatus, 'optionalAccess', _116 => _116.onStatus, 'call', _117 => _117(terminalStatus, snapshot.status)]);
3047
+ await _optionalChain([options, 'access', _116 => _116.terminalStatus, 'optionalAccess', _117 => _117.onStatus, 'call', _118 => _118(terminalStatus, snapshot.status)]);
3046
3048
  }
3047
3049
  const diff = diffPlayRunStreamEvents({
3048
3050
  streamId,
@@ -3106,7 +3108,7 @@ function parseNotificationGroupTarget(value) {
3106
3108
  }
3107
3109
  return { kind: "email", email };
3108
3110
  }
3109
- const slack = _optionalChain([/^slack:(.+)$/i, 'access', _118 => _118.exec, 'call', _119 => _119(normalized), 'optionalAccess', _120 => _120[1], 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()]);
3111
+ const slack = _optionalChain([/^slack:(.+)$/i, 'access', _119 => _119.exec, 'call', _120 => _120(normalized), 'optionalAccess', _121 => _121[1], 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
3110
3112
  if (!slack) {
3111
3113
  const provider = normalized.split(":", 1)[0] || normalized;
3112
3114
  throw new Error(
@@ -3114,7 +3116,7 @@ function parseNotificationGroupTarget(value) {
3114
3116
  );
3115
3117
  }
3116
3118
  const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
3117
- if (_optionalChain([member, 'optionalAccess', _123 => _123[1]])) {
3119
+ if (_optionalChain([member, 'optionalAccess', _124 => _124[1]])) {
3118
3120
  return { kind: "slack", memberId: member[1].toUpperCase() };
3119
3121
  }
3120
3122
  if (slack.toLowerCase().startsWith("member:")) {
@@ -3139,11 +3141,11 @@ var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
3139
3141
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
3140
3142
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
3141
3143
  function isolatedCiRuntimeEventReadHeaders(env) {
3142
- const schema = _optionalChain([env, 'access', _124 => _124.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _125 => _125.trim, 'call', _126 => _126()]);
3143
- if (_optionalChain([env, 'access', _127 => _127.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _128 => _128.trim, 'call', _129 => _129()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3144
+ const schema = _optionalChain([env, 'access', _125 => _125.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]);
3145
+ if (_optionalChain([env, 'access', _128 => _128.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3144
3146
  return void 0;
3145
3147
  }
3146
- const token = _optionalChain([env, 'access', _130 => _130.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _131 => _131.trim, 'call', _132 => _132()]);
3148
+ const token = _optionalChain([env, 'access', _131 => _131.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()]);
3147
3149
  if (!token) {
3148
3150
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
3149
3151
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -3151,7 +3153,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
3151
3153
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
3152
3154
  );
3153
3155
  }
3154
- return { [_chunkVXBEHDM6js.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3156
+ return { [_chunkS3D7OY6Djs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3155
3157
  }
3156
3158
  function sleep(ms) {
3157
3159
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -3166,7 +3168,7 @@ function isTransientCompileManifestError(error) {
3166
3168
  );
3167
3169
  }
3168
3170
  function requireCompileManifestResponse(response, playName) {
3169
- const compilerManifest = _optionalChain([response, 'optionalAccess', _133 => _133.compilerManifest]);
3171
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _134 => _134.compilerManifest]);
3170
3172
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
3171
3173
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
3172
3174
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -3218,7 +3220,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
3218
3220
  }
3219
3221
  function searchParams(options) {
3220
3222
  const params = new URLSearchParams();
3221
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _134 => _134.query, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()]), () => ( "")));
3223
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _135 => _135.query, 'optionalAccess', _136 => _136.trim, 'call', _137 => _137()]), () => ( "")));
3222
3224
  params.set(
3223
3225
  "include_search_debug",
3224
3226
  options.includeSearchDebug ? "true" : "false"
@@ -3228,13 +3230,13 @@ function searchParams(options) {
3228
3230
  if (options.offset !== void 0) {
3229
3231
  params.set("offset", String(options.offset));
3230
3232
  }
3231
- if (_optionalChain([options, 'access', _137 => _137.categories, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139()])) {
3233
+ if (_optionalChain([options, 'access', _138 => _138.categories, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()])) {
3232
3234
  params.set("categories", options.categories.trim());
3233
3235
  }
3234
- if (_optionalChain([options, 'access', _140 => _140.searchTerms, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()])) {
3236
+ if (_optionalChain([options, 'access', _141 => _141.searchTerms, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()])) {
3235
3237
  params.set("search_terms", options.searchTerms.trim());
3236
3238
  }
3237
- if (_optionalChain([options, 'access', _143 => _143.task, 'optionalAccess', _144 => _144.trim, 'call', _145 => _145()])) params.set("task", options.task.trim());
3239
+ if (_optionalChain([options, 'access', _144 => _144.task, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) params.set("task", options.task.trim());
3238
3240
  return params;
3239
3241
  }
3240
3242
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -3358,9 +3360,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
3358
3360
  runId: status.runId || fallbackRunId,
3359
3361
  result: _nullishCoalesce(status.package, () => ( status.result)),
3360
3362
  ...status.package ? { package: status.package } : {},
3361
- logs: _nullishCoalesce(_optionalChain([status, 'access', _146 => _146.progress, 'optionalAccess', _147 => _147.logs]), () => ( [])),
3363
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _147 => _147.progress, 'optionalAccess', _148 => _148.logs]), () => ( [])),
3362
3364
  durationMs: Date.now() - startedAt,
3363
- error: _nullishCoalesce(_optionalChain([status, 'access', _148 => _148.progress, 'optionalAccess', _149 => _149.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3365
+ error: _nullishCoalesce(_optionalChain([status, 'access', _149 => _149.progress, 'optionalAccess', _150 => _150.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3364
3366
  };
3365
3367
  }
3366
3368
  var DeeplineClient = (_class = class _DeeplineClient {
@@ -3389,14 +3391,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
3389
3391
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3390
3392
  */
3391
3393
  constructor(options) {
3392
- this.config = _chunkVXBEHDM6js.resolveConfig.call(void 0, options);
3394
+ this.config = _chunkS3D7OY6Djs.resolveConfig.call(void 0, options);
3393
3395
  this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
3394
- this.http = new (0, _chunkVXBEHDM6js.HttpClient)(this.config);
3396
+ this.http = new (0, _chunkS3D7OY6Djs.HttpClient)(this.config);
3395
3397
  this.playClient = new PlayClient(this.http, this.environment);
3396
3398
  this.toolCalls = new ToolCalls(
3397
3399
  this.http,
3398
3400
  this.config.timeout,
3399
- _optionalChain([options, 'optionalAccess', _150 => _150.timeout])
3401
+ _optionalChain([options, 'optionalAccess', _151 => _151.timeout])
3400
3402
  );
3401
3403
  this.runs = {
3402
3404
  getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
@@ -3459,7 +3461,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3459
3461
  {},
3460
3462
  {
3461
3463
  "Idempotency-Key": requireBillingIdempotencyKey(
3462
- _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _151 => _151.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3464
+ _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _152 => _152.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3463
3465
  )
3464
3466
  }
3465
3467
  ),
@@ -3479,7 +3481,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3479
3481
  check: (definition) => this.checkMonitor(definition),
3480
3482
  preview: (definition, options2) => this.previewMonitor(definition, options2),
3481
3483
  deploy: (definition, options2) => this.deployMonitor(definition, options2),
3482
- sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _152 => _152.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3484
+ sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _153 => _153.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3483
3485
  list: (options2) => this.listMonitors(options2),
3484
3486
  get: (key) => this.getMonitor(key),
3485
3487
  test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
@@ -3488,13 +3490,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3488
3490
  update: (key, patch) => this.updateMonitor(key, patch),
3489
3491
  delete: (key, options2) => this.deleteMonitor(key, options2),
3490
3492
  reactivate: (key, options2) => this.reactivateMonitor(key, options2),
3491
- start: (key, options2) => _optionalChain([options2, 'optionalAccess', _153 => _153.dryRun]) ? this.submitMonitorBatch({
3493
+ start: (key, options2) => _optionalChain([options2, 'optionalAccess', _154 => _154.dryRun]) ? this.submitMonitorBatch({
3492
3494
  kind: "reactivate",
3493
3495
  scope: { kind: "keys", monitorKeys: [key] },
3494
3496
  dryRun: true,
3495
3497
  idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3496
3498
  }) : this.submitScalarMonitorLifecycle(key, "start", options2),
3497
- stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _154 => _154.dryRun]) ? this.submitMonitorBatch({
3499
+ stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _155 => _155.dryRun]) ? this.submitMonitorBatch({
3498
3500
  kind: "deactivate",
3499
3501
  scope: { kind: "keys", monitorKeys: [key] },
3500
3502
  dryRun: true,
@@ -3598,17 +3600,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3598
3600
  */
3599
3601
  async listTools(options) {
3600
3602
  const params = new URLSearchParams();
3601
- if (_optionalChain([options, 'optionalAccess', _155 => _155.categories, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()])) {
3603
+ if (_optionalChain([options, 'optionalAccess', _156 => _156.categories, 'optionalAccess', _157 => _157.trim, 'call', _158 => _158()])) {
3602
3604
  params.set("categories", options.categories.trim());
3603
3605
  }
3604
- if (_optionalChain([options, 'optionalAccess', _158 => _158.tags, 'optionalAccess', _159 => _159.trim, 'call', _160 => _160()])) {
3606
+ if (_optionalChain([options, 'optionalAccess', _159 => _159.tags, 'optionalAccess', _160 => _160.trim, 'call', _161 => _161()])) {
3605
3607
  params.set("tags", options.tags.trim());
3606
3608
  }
3607
- if (_optionalChain([options, 'optionalAccess', _161 => _161.grep, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()])) {
3609
+ if (_optionalChain([options, 'optionalAccess', _162 => _162.grep, 'optionalAccess', _163 => _163.trim, 'call', _164 => _164()])) {
3608
3610
  params.set("grep", options.grep.trim());
3609
3611
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3610
3612
  }
3611
- params.set("compact", _optionalChain([options, 'optionalAccess', _164 => _164.compact]) === true ? "true" : "false");
3613
+ params.set("compact", _optionalChain([options, 'optionalAccess', _165 => _165.compact]) === true ? "true" : "false");
3612
3614
  const suffix = params.toString() ? `?${params.toString()}` : "";
3613
3615
  const res = await this.http.get(
3614
3616
  `/api/v2/tools${suffix}`
@@ -3641,7 +3643,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3641
3643
  const params = new URLSearchParams({
3642
3644
  view: "category",
3643
3645
  categories: normalizedCategory,
3644
- compact: _optionalChain([options, 'optionalAccess', _165 => _165.compact]) === true ? "true" : "false"
3646
+ compact: _optionalChain([options, 'optionalAccess', _166 => _166.compact]) === true ? "true" : "false"
3645
3647
  });
3646
3648
  const response = await this.http.get(
3647
3649
  `/api/v2/tools?${params}`
@@ -3656,7 +3658,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3656
3658
  }
3657
3659
  /** List discoverable providers without requiring a local plugin catalog. */
3658
3660
  async listProviders(options) {
3659
- const suffix = _optionalChain([options, 'optionalAccess', _166 => _166.changed]) ? "?changed=true" : "";
3661
+ const suffix = _optionalChain([options, 'optionalAccess', _167 => _167.changed]) ? "?changed=true" : "";
3660
3662
  const res = await this.http.get(
3661
3663
  `/api/v2/tools/providers${suffix}`
3662
3664
  );
@@ -3687,8 +3689,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3687
3689
  */
3688
3690
  async search(options = {}) {
3689
3691
  const params = searchParams(options);
3690
- if (_optionalChain([options, 'access', _167 => _167.types, 'optionalAccess', _168 => _168.length])) params.set("types", options.types.join(","));
3691
- if (_optionalChain([options, 'access', _169 => _169.exclude, 'optionalAccess', _170 => _170.length])) {
3692
+ if (_optionalChain([options, 'access', _168 => _168.types, 'optionalAccess', _169 => _169.length])) params.set("types", options.types.join(","));
3693
+ if (_optionalChain([options, 'access', _170 => _170.exclude, 'optionalAccess', _171 => _171.length])) {
3692
3694
  params.set("exclude", options.exclude.join(","));
3693
3695
  }
3694
3696
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3710,7 +3712,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3710
3712
  * ```
3711
3713
  */
3712
3714
  async getTool(toolId, options) {
3713
- if (_optionalChain([options, 'optionalAccess', _171 => _171.cliInvocationId]) !== void 0) {
3715
+ if (_optionalChain([options, 'optionalAccess', _172 => _172.cliInvocationId]) !== void 0) {
3714
3716
  validateCliInvocationId(options.cliInvocationId);
3715
3717
  }
3716
3718
  return this.http.request(
@@ -3723,7 +3725,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3723
3725
  retryApiErrors: true,
3724
3726
  headers: {
3725
3727
  "x-deepline-tool-meta-only": "1",
3726
- ..._optionalChain([options, 'optionalAccess', _172 => _172.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3728
+ ..._optionalChain([options, 'optionalAccess', _173 => _173.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3727
3729
  }
3728
3730
  }
3729
3731
  );
@@ -3814,7 +3816,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3814
3816
  return this.http.post(
3815
3817
  "/api/v2/ingestion/repair",
3816
3818
  {
3817
- ..._optionalChain([input, 'optionalAccess', _173 => _173.provider]) ? { provider: input.provider } : {}
3819
+ ..._optionalChain([input, 'optionalAccess', _174 => _174.provider]) ? { provider: input.provider } : {}
3818
3820
  }
3819
3821
  );
3820
3822
  }
@@ -3869,7 +3871,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3869
3871
  const prepared = await _chunkJKVRBCZLjs.preparePlayRunAdmission.call(void 0,
3870
3872
  this.http,
3871
3873
  resolved.request,
3872
- _optionalChain([options, 'optionalAccess', _174 => _174.onSubmission])
3874
+ _optionalChain([options, 'optionalAccess', _175 => _175.onSubmission])
3873
3875
  );
3874
3876
  const bodyJson = JSON.stringify(prepared.body);
3875
3877
  const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
@@ -3892,19 +3894,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
3892
3894
  );
3893
3895
  }
3894
3896
  submitted = true;
3895
- const streamPath = _optionalChain([options, 'optionalAccess', _175 => _175.cliAdmission]) ? _chunkJKVRBCZLjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkJKVRBCZLjs.PLAY_RUN_START_STREAM_PATH;
3897
+ const streamPath = _optionalChain([options, 'optionalAccess', _176 => _176.cliAdmission]) ? _chunkJKVRBCZLjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkJKVRBCZLjs.PLAY_RUN_START_STREAM_PATH;
3896
3898
  try {
3897
3899
  for await (const event of http.streamSse(streamPath, {
3898
3900
  method: "POST",
3899
3901
  body: JSON.parse(bodyJson),
3900
3902
  headers,
3901
- signal: _optionalChain([streamOptions, 'optionalAccess', _176 => _176.signal]),
3903
+ signal: _optionalChain([streamOptions, 'optionalAccess', _177 => _177.signal]),
3902
3904
  exactUrlOnly: true
3903
3905
  })) {
3904
3906
  if (event.scope === "play") yield event;
3905
3907
  }
3906
3908
  } catch (error) {
3907
- if (_optionalChain([options, 'optionalAccess', _177 => _177.cliAdmission]) && error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
3909
+ if (_optionalChain([options, 'optionalAccess', _178 => _178.cliAdmission]) && error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
3908
3910
  throw new (0, _chunkJKVRBCZLjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
3909
3911
  }
3910
3912
  throw error;
@@ -3927,7 +3929,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3927
3929
  */
3928
3930
  async *startPlayRunStream(request, options) {
3929
3931
  const prepared = await this.preparePlayRunAdmission(request, options);
3930
- yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _178 => _178.signal]) });
3932
+ yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _179 => _179.signal]) });
3931
3933
  }
3932
3934
  /**
3933
3935
  * Register a bundled play artifact.
@@ -4080,7 +4082,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4080
4082
  compilerManifest,
4081
4083
  ...input.input ? { input: input.input } : {},
4082
4084
  ...input.inputFile ? { inputFile: input.inputFile } : {},
4083
- ..._optionalChain([input, 'access', _179 => _179.packagedFiles, 'optionalAccess', _180 => _180.length]) ? { packagedFiles: input.packagedFiles } : {},
4085
+ ..._optionalChain([input, 'access', _180 => _180.packagedFiles, 'optionalAccess', _181 => _181.length]) ? { packagedFiles: input.packagedFiles } : {},
4084
4086
  ...input.force ? { force: true } : {},
4085
4087
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
4086
4088
  });
@@ -4110,29 +4112,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
4110
4112
  * ```
4111
4113
  */
4112
4114
  async submitPlay(code, csvPath, name, options) {
4113
- const runtimeInput = _optionalChain([options, 'optionalAccess', _181 => _181.input]) ? { ...options.input } : {};
4115
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _182 => _182.input]) ? { ...options.input } : {};
4114
4116
  if (csvPath) {
4115
4117
  runtimeInput.file = csvPath;
4116
4118
  }
4117
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _182 => _182.sourceCode]), () => ( code));
4118
- const artifact = _optionalChain([options, 'optionalAccess', _183 => _183.artifact]);
4119
- if (!_optionalChain([name, 'optionalAccess', _184 => _184.trim, 'call', _185 => _185()])) {
4119
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _183 => _183.sourceCode]), () => ( code));
4120
+ const artifact = _optionalChain([options, 'optionalAccess', _184 => _184.artifact]);
4121
+ if (!_optionalChain([name, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()])) {
4120
4122
  throw new Error("submitPlay requires a play name.");
4121
4123
  }
4122
4124
  if (!artifact) {
4123
4125
  throw new Error("submitPlay requires a bundled play artifact.");
4124
4126
  }
4125
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _186 => _186.compilerManifest]), async () => ( await this.compilePlayManifest({
4127
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _187 => _187.compilerManifest]), async () => ( await this.compilePlayManifest({
4126
4128
  name,
4127
4129
  sourceCode,
4128
- sourceFiles: _optionalChain([options, 'optionalAccess', _187 => _187.sourceFiles]),
4130
+ sourceFiles: _optionalChain([options, 'optionalAccess', _188 => _188.sourceFiles]),
4129
4131
  artifact
4130
4132
  })));
4131
4133
  const registeredArtifact = await this.registerPlayArtifact({
4132
4134
  name,
4133
4135
  sourceCode,
4134
- sourceFiles: _optionalChain([options, 'optionalAccess', _188 => _188.sourceFiles]),
4135
- description: _optionalChain([options, 'optionalAccess', _189 => _189.description]),
4136
+ sourceFiles: _optionalChain([options, 'optionalAccess', _189 => _189.sourceFiles]),
4137
+ description: _optionalChain([options, 'optionalAccess', _190 => _190.description]),
4136
4138
  artifact,
4137
4139
  compilerManifest,
4138
4140
  publish: false
@@ -4146,17 +4148,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
4146
4148
  name,
4147
4149
  artifactStorageKey: registeredArtifact.artifactStorageKey,
4148
4150
  sourceCode,
4149
- description: _optionalChain([options, 'optionalAccess', _190 => _190.description]),
4151
+ description: _optionalChain([options, 'optionalAccess', _191 => _191.description]),
4150
4152
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
4151
4153
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
4152
4154
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
4153
4155
  runtimeArtifact: artifact,
4154
4156
  compilerManifest,
4155
4157
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
4156
- ..._optionalChain([options, 'optionalAccess', _191 => _191.inputFile]) ? { inputFile: options.inputFile } : {},
4157
- ..._optionalChain([options, 'optionalAccess', _192 => _192.packagedFiles, 'optionalAccess', _193 => _193.length]) ? { packagedFiles: options.packagedFiles } : {},
4158
- ..._optionalChain([options, 'optionalAccess', _194 => _194.force]) ? { force: true } : {},
4159
- ..._optionalChain([options, 'optionalAccess', _195 => _195.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4158
+ ..._optionalChain([options, 'optionalAccess', _192 => _192.inputFile]) ? { inputFile: options.inputFile } : {},
4159
+ ..._optionalChain([options, 'optionalAccess', _193 => _193.packagedFiles, 'optionalAccess', _194 => _194.length]) ? { packagedFiles: options.packagedFiles } : {},
4160
+ ..._optionalChain([options, 'optionalAccess', _195 => _195.force]) ? { force: true } : {},
4161
+ ..._optionalChain([options, 'optionalAccess', _196 => _196.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4160
4162
  });
4161
4163
  }
4162
4164
  /**
@@ -4232,13 +4234,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
4232
4234
  for await (const event of watchRunEvents({
4233
4235
  http: this.http,
4234
4236
  runId: workflowId,
4235
- signal: _optionalChain([options, 'optionalAccess', _196 => _196.signal]),
4236
- onNotice: _optionalChain([options, 'optionalAccess', _197 => _197.onNotice]),
4237
- onRetry: _optionalChain([options, 'optionalAccess', _198 => _198.onRetry]),
4238
- deferLogs: _optionalChain([options, 'optionalAccess', _199 => _199.deferLogs]),
4239
- omitTerminalLogs: _optionalChain([options, 'optionalAccess', _200 => _200.omitTerminalLogs]),
4240
- onPoll: _optionalChain([options, 'optionalAccess', _201 => _201.onPoll]),
4241
- ..._optionalChain([options, 'optionalAccess', _202 => _202.terminalStatus]) ? {
4237
+ signal: _optionalChain([options, 'optionalAccess', _197 => _197.signal]),
4238
+ onNotice: _optionalChain([options, 'optionalAccess', _198 => _198.onNotice]),
4239
+ onRetry: _optionalChain([options, 'optionalAccess', _199 => _199.onRetry]),
4240
+ deferLogs: _optionalChain([options, 'optionalAccess', _200 => _200.deferLogs]),
4241
+ omitTerminalLogs: _optionalChain([options, 'optionalAccess', _201 => _201.omitTerminalLogs]),
4242
+ onPoll: _optionalChain([options, 'optionalAccess', _202 => _202.onPoll]),
4243
+ ..._optionalChain([options, 'optionalAccess', _203 => _203.terminalStatus]) ? {
4242
4244
  terminalStatus: {
4243
4245
  ...options.terminalStatus,
4244
4246
  onStatus: async (raw, expectedStatus) => {
@@ -4248,7 +4250,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4248
4250
  `Run watch returned a mismatched terminal status for ${workflowId}.`
4249
4251
  );
4250
4252
  }
4251
- await _optionalChain([options, 'access', _203 => _203.terminalStatus, 'optionalAccess', _204 => _204.onStatus, 'call', _205 => _205(status)]);
4253
+ await _optionalChain([options, 'access', _204 => _204.terminalStatus, 'optionalAccess', _205 => _205.onStatus, 'call', _206 => _206(status)]);
4252
4254
  }
4253
4255
  }
4254
4256
  } : {}
@@ -4263,12 +4265,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4263
4265
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4264
4266
  */
4265
4267
  async *streamPlayRunEvents(workflowId, options) {
4266
- const headers = _optionalChain([options, 'optionalAccess', _206 => _206.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4268
+ const headers = _optionalChain([options, 'optionalAccess', _207 => _207.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4267
4269
  const params = new URLSearchParams();
4268
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _207 => _207.mode]), () => ( "cli")));
4270
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _208 => _208.mode]), () => ( "cli")));
4269
4271
  for await (const event of this.http.streamSse(
4270
4272
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4271
- { signal: _optionalChain([options, 'optionalAccess', _208 => _208.signal]), headers }
4273
+ { signal: _optionalChain([options, 'optionalAccess', _209 => _209.signal]), headers }
4272
4274
  )) {
4273
4275
  if (event.scope === "play") {
4274
4276
  yield event;
@@ -4284,8 +4286,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4284
4286
  */
4285
4287
  async *observeRunEvents(runId, options) {
4286
4288
  yield* this.watchRunEvents(runId, {
4287
- signal: _optionalChain([options, 'optionalAccess', _209 => _209.signal]),
4288
- onNotice: _optionalChain([options, 'optionalAccess', _210 => _210.onNotice])
4289
+ signal: _optionalChain([options, 'optionalAccess', _210 => _210.signal]),
4290
+ onNotice: _optionalChain([options, 'optionalAccess', _211 => _211.onNotice])
4289
4291
  });
4290
4292
  }
4291
4293
  /** Poll snapshots to terminal status and return the durable package. */
@@ -4293,9 +4295,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4293
4295
  let terminalObserved = false;
4294
4296
  let terminalStatus = null;
4295
4297
  for await (const event of this.watchRunEvents(runId, {
4296
- signal: _optionalChain([options, 'optionalAccess', _211 => _211.signal]),
4297
- onNotice: _optionalChain([options, 'optionalAccess', _212 => _212.onNotice]),
4298
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _213 => _213.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _214 => _214.onReconnect]))),
4298
+ signal: _optionalChain([options, 'optionalAccess', _212 => _212.signal]),
4299
+ onNotice: _optionalChain([options, 'optionalAccess', _213 => _213.onNotice]),
4300
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _214 => _214.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _215 => _215.onReconnect]))),
4299
4301
  terminalStatus: {
4300
4302
  runStatus: true,
4301
4303
  onStatus: (status) => {
@@ -4303,12 +4305,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4303
4305
  }
4304
4306
  }
4305
4307
  })) {
4306
- _optionalChain([options, 'optionalAccess', _215 => _215.onEvent, 'optionalCall', _216 => _216(event)]);
4308
+ _optionalChain([options, 'optionalAccess', _216 => _216.onEvent, 'optionalCall', _217 => _217(event)]);
4307
4309
  if (_chunkJKVRBCZLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4308
4310
  terminalObserved = true;
4309
4311
  }
4310
4312
  }
4311
- if (_optionalChain([options, 'optionalAccess', _217 => _217.signal, 'optionalAccess', _218 => _218.aborted])) {
4313
+ if (_optionalChain([options, 'optionalAccess', _218 => _218.signal, 'optionalAccess', _219 => _219.aborted])) {
4312
4314
  throw new (0, _chunkDIAWYWT5js.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4313
4315
  }
4314
4316
  const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
@@ -4388,7 +4390,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4388
4390
  /** List the org's workflows. `GET /api/v2/workflows`. */
4389
4391
  async listWorkflows(options) {
4390
4392
  const params = new URLSearchParams();
4391
- if (typeof _optionalChain([options, 'optionalAccess', _219 => _219.limit]) === "number") {
4393
+ if (typeof _optionalChain([options, 'optionalAccess', _220 => _220.limit]) === "number") {
4392
4394
  params.set("limit", String(options.limit));
4393
4395
  }
4394
4396
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4441,7 +4443,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4441
4443
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4442
4444
  async listWorkflowRuns(id, options) {
4443
4445
  const params = new URLSearchParams();
4444
- if (typeof _optionalChain([options, 'optionalAccess', _220 => _220.limit]) === "number") {
4446
+ if (typeof _optionalChain([options, 'optionalAccess', _221 => _221.limit]) === "number") {
4445
4447
  params.set("limit", String(options.limit));
4446
4448
  }
4447
4449
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4477,10 +4479,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4477
4479
  */
4478
4480
  async getRunStatus(runId, options) {
4479
4481
  const params = new URLSearchParams();
4480
- if (_optionalChain([options, 'optionalAccess', _221 => _221.full]) === true) {
4482
+ if (_optionalChain([options, 'optionalAccess', _222 => _222.full]) === true) {
4481
4483
  params.set("full", "true");
4482
4484
  }
4483
- if (_optionalChain([options, 'optionalAccess', _222 => _222.configuration]) === true) {
4485
+ if (_optionalChain([options, 'optionalAccess', _223 => _223.configuration]) === true) {
4484
4486
  params.set("include", "configuration");
4485
4487
  }
4486
4488
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4488,7 +4490,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4488
4490
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4489
4491
  { headers: { "x-deepline-run-status": "1" } }
4490
4492
  );
4491
- if (_optionalChain([options, 'optionalAccess', _223 => _223.configuration]) === true && !Object.hasOwn(response, "contract")) {
4493
+ if (_optionalChain([options, 'optionalAccess', _224 => _224.configuration]) === true && !Object.hasOwn(response, "contract")) {
4492
4494
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4493
4495
  "This server does not support recorded configuration reads.",
4494
4496
  void 0,
@@ -4496,7 +4498,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4496
4498
  );
4497
4499
  }
4498
4500
  const status = normalizePlayStatus(response);
4499
- if (_optionalChain([options, 'optionalAccess', _224 => _224.failedLogs]) !== true || status.status !== "failed") {
4501
+ if (_optionalChain([options, 'optionalAccess', _225 => _225.failedLogs]) !== true || status.status !== "failed") {
4500
4502
  return status;
4501
4503
  }
4502
4504
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4585,7 +4587,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4585
4587
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4586
4588
  async getRunsHistory(options = {}) {
4587
4589
  const params = new URLSearchParams();
4588
- const search = _optionalChain([options, 'access', _225 => _225.search, 'optionalAccess', _226 => _226.trim, 'call', _227 => _227()]);
4590
+ const search = _optionalChain([options, 'access', _226 => _226.search, 'optionalAccess', _227 => _227.trim, 'call', _228 => _228()]);
4589
4591
  if (search && search.length > 200) {
4590
4592
  throw new Error("Run search must be at most 200 characters.");
4591
4593
  }
@@ -4611,16 +4613,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4611
4613
  }
4612
4614
  /** Read one run page without discarding server pagination metadata. */
4613
4615
  async listRunsPage(options) {
4614
- const playName = _optionalChain([options, 'access', _228 => _228.play, 'optionalAccess', _229 => _229.trim, 'call', _230 => _230()]);
4616
+ const playName = _optionalChain([options, 'access', _229 => _229.play, 'optionalAccess', _230 => _230.trim, 'call', _231 => _231()]);
4615
4617
  const params = new URLSearchParams();
4616
4618
  if (playName) {
4617
4619
  params.set("play", playName);
4618
4620
  }
4619
- const status = _optionalChain([options, 'access', _231 => _231.status, 'optionalAccess', _232 => _232.trim, 'call', _233 => _233()]);
4621
+ const status = _optionalChain([options, 'access', _232 => _232.status, 'optionalAccess', _233 => _233.trim, 'call', _234 => _234()]);
4620
4622
  if (status) {
4621
4623
  params.set("status", status);
4622
4624
  }
4623
- const node = _optionalChain([options, 'access', _234 => _234.node, 'optionalAccess', _235 => _235.trim, 'call', _236 => _236()]);
4625
+ const node = _optionalChain([options, 'access', _235 => _235.node, 'optionalAccess', _236 => _236.trim, 'call', _237 => _237()]);
4624
4626
  if (node) {
4625
4627
  if (!playName)
4626
4628
  throw new Error("runs.list options.node requires options.play.");
@@ -4694,8 +4696,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4694
4696
  * A different key starts another rerun.
4695
4697
  */
4696
4698
  async rerun(runId, options) {
4697
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _237 => _237.idempotencyKey, 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
4698
- if (_optionalChain([options, 'optionalAccess', _240 => _240.idempotencyKey]) !== void 0 && !idempotencyKey) {
4699
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _238 => _238.idempotencyKey, 'optionalAccess', _239 => _239.trim, 'call', _240 => _240()]);
4700
+ if (_optionalChain([options, 'optionalAccess', _241 => _241.idempotencyKey]) !== void 0 && !idempotencyKey) {
4699
4701
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4700
4702
  "runs.rerun idempotencyKey must not be empty.",
4701
4703
  void 0,
@@ -4704,7 +4706,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4704
4706
  }
4705
4707
  return this.http.post(
4706
4708
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
4707
- _optionalChain([options, 'optionalAccess', _241 => _241.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4709
+ _optionalChain([options, 'optionalAccess', _242 => _242.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4708
4710
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
4709
4711
  );
4710
4712
  }
@@ -4718,21 +4720,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
4718
4720
  * ```
4719
4721
  */
4720
4722
  async getRunLogs(runId, options) {
4721
- if (_optionalChain([options, 'optionalAccess', _242 => _242.all]) === true && options.failed === true) {
4723
+ if (_optionalChain([options, 'optionalAccess', _243 => _243.all]) === true && options.failed === true) {
4722
4724
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4723
4725
  "runs.logs cannot combine all and failed views.",
4724
4726
  void 0,
4725
4727
  "INVALID_RUN_LOG_VIEW"
4726
4728
  );
4727
4729
  }
4728
- if (_optionalChain([options, 'optionalAccess', _243 => _243.cursor]) !== void 0 && options.failed === true) {
4730
+ if (_optionalChain([options, 'optionalAccess', _244 => _244.cursor]) !== void 0 && options.failed === true) {
4729
4731
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4730
4732
  "runs.logs cannot combine failed with cursor.",
4731
4733
  void 0,
4732
4734
  "INVALID_RUN_LOG_VIEW"
4733
4735
  );
4734
4736
  }
4735
- if (_optionalChain([options, 'optionalAccess', _244 => _244.failed]) === true) {
4737
+ if (_optionalChain([options, 'optionalAccess', _245 => _245.failed]) === true) {
4736
4738
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
4737
4739
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
4738
4740
  const page = await this.http.get(
@@ -4757,18 +4759,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
4757
4759
  ...page.logsTruncated ? { logsTruncated: true } : {}
4758
4760
  };
4759
4761
  }
4760
- const beforeSequence = _optionalChain([options, 'optionalAccess', _245 => _245.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4761
- const limit = _optionalChain([options, 'optionalAccess', _246 => _246.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _247 => _247.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4762
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _246 => _246.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4763
+ const limit = _optionalChain([options, 'optionalAccess', _247 => _247.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _248 => _248.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4762
4764
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
4763
4765
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
4764
4766
  { retryApiErrors: true }
4765
4767
  );
4766
4768
  const probe = await fetchPage(0, 1);
4767
4769
  const lastStoredSeq = probe.lastStoredSeq;
4768
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _248 => _248.entries, 'access', _249 => _249[0], 'optionalAccess', _250 => _250.seq]), () => ( null));
4770
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _249 => _249.entries, 'access', _250 => _250[0], 'optionalAccess', _251 => _251.seq]), () => ( null));
4769
4771
  const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
4770
4772
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
4771
- let afterSeq = _optionalChain([options, 'optionalAccess', _251 => _251.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4773
+ let afterSeq = _optionalChain([options, 'optionalAccess', _252 => _252.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4772
4774
  const entries = [];
4773
4775
  while (entries.length < limit && afterSeq < upperSeq) {
4774
4776
  const page = await fetchPage(
@@ -4802,7 +4804,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4802
4804
  hasMore: olderLinesExist,
4803
4805
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
4804
4806
  entries: entries.map((entry) => entry.line),
4805
- view: _optionalChain([options, 'optionalAccess', _252 => _252.all]) ? "all" : "tail",
4807
+ view: _optionalChain([options, 'optionalAccess', _253 => _253.all]) ? "all" : "tail",
4806
4808
  ...probe.logsTruncated ? { logsTruncated: true } : {}
4807
4809
  };
4808
4810
  }
@@ -4978,7 +4980,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4978
4980
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
4979
4981
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
4980
4982
  });
4981
- if (_optionalChain([input, 'access', _253 => _253.runId, 'optionalAccess', _254 => _254.trim, 'call', _255 => _255()])) {
4983
+ if (_optionalChain([input, 'access', _254 => _254.runId, 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()])) {
4982
4984
  params.set("runId", input.runId.trim());
4983
4985
  }
4984
4986
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -4988,9 +4990,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4988
4990
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
4989
4991
  { signal: input.signal }
4990
4992
  );
4991
- const requestedRunId = _optionalChain([input, 'access', _256 => _256.runId, 'optionalAccess', _257 => _257.trim, 'call', _258 => _258()]) || "";
4993
+ const requestedRunId = _optionalChain([input, 'access', _257 => _257.runId, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]) || "";
4992
4994
  if (requestedRunId) {
4993
- const confirmedRunId = _optionalChain([result, 'access', _259 => _259.scope, 'optionalAccess', _260 => _260.kind]) === "run" ? result.scope.runId.trim() : "";
4995
+ const confirmedRunId = _optionalChain([result, 'access', _260 => _260.scope, 'optionalAccess', _261 => _261.kind]) === "run" ? result.scope.runId.trim() : "";
4994
4996
  const foreignRowRunIds = [
4995
4997
  ...new Set(
4996
4998
  result.rows.map(
@@ -4998,7 +5000,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4998
5000
  ).filter((runId) => runId && runId !== requestedRunId)
4999
5001
  )
5000
5002
  ];
5001
- if (_optionalChain([result, 'access', _261 => _261.scope, 'optionalAccess', _262 => _262.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5003
+ if (_optionalChain([result, 'access', _262 => _262.scope, 'optionalAccess', _263 => _263.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5002
5004
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
5003
5005
  `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.`,
5004
5006
  void 0,
@@ -5027,7 +5029,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5027
5029
  async stopRun(runId, options) {
5028
5030
  return this.http.post(
5029
5031
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
5030
- _optionalChain([options, 'optionalAccess', _263 => _263.reason]) ? { reason: options.reason } : {}
5032
+ _optionalChain([options, 'optionalAccess', _264 => _264.reason]) ? { reason: options.reason } : {}
5031
5033
  );
5032
5034
  }
5033
5035
  /**
@@ -5045,11 +5047,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
5045
5047
  * The method clears workspace run-slot state without requiring each run ID.
5046
5048
  */
5047
5049
  async stopAllRuns(options) {
5048
- const dryRun = _optionalChain([options, 'optionalAccess', _264 => _264.dryRun]) === true;
5050
+ const dryRun = _optionalChain([options, 'optionalAccess', _265 => _265.dryRun]) === true;
5049
5051
  const result = await this.http.post(
5050
5052
  "/api/v2/runs/stop-all",
5051
5053
  {
5052
- ..._optionalChain([options, 'optionalAccess', _265 => _265.reason]) ? { reason: options.reason } : {},
5054
+ ..._optionalChain([options, 'optionalAccess', _266 => _266.reason]) ? { reason: options.reason } : {},
5053
5055
  ...dryRun ? { dryRun: true } : {}
5054
5056
  }
5055
5057
  );
@@ -5070,7 +5072,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5070
5072
  * `origin: "owned"` for org-owned plays.
5071
5073
  */
5072
5074
  async listPlays(options) {
5073
- if (!_optionalChain([options, 'optionalAccess', _266 => _266.grep, 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()])) {
5075
+ if (!_optionalChain([options, 'optionalAccess', _267 => _267.grep, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()])) {
5074
5076
  return (await this.requestPlaysPage(options, false)).plays;
5075
5077
  }
5076
5078
  const plays = [];
@@ -5092,45 +5094,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
5092
5094
  }
5093
5095
  async requestPlaysPage(options, paginateInventory = true) {
5094
5096
  const params = new URLSearchParams();
5095
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _269 => _269.grep, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]))
5097
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _270 => _270.grep, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]))
5096
5098
  params.set("inventory_paginated", "1");
5097
- if (_optionalChain([options, 'optionalAccess', _272 => _272.origin])) params.set("origin", options.origin);
5098
- if (_optionalChain([options, 'optionalAccess', _273 => _273.categories])) {
5099
+ if (_optionalChain([options, 'optionalAccess', _273 => _273.origin])) params.set("origin", options.origin);
5100
+ if (_optionalChain([options, 'optionalAccess', _274 => _274.categories])) {
5099
5101
  params.set(
5100
5102
  "categories",
5101
5103
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
5102
5104
  );
5103
5105
  }
5104
- if (_optionalChain([options, 'optionalAccess', _274 => _274.categories]) || _optionalChain([options, 'optionalAccess', _275 => _275.includeToolCategories])) {
5106
+ if (_optionalChain([options, 'optionalAccess', _275 => _275.categories]) || _optionalChain([options, 'optionalAccess', _276 => _276.includeToolCategories])) {
5105
5107
  params.set("include_tool_categories", "1");
5106
5108
  }
5107
- if (_optionalChain([options, 'optionalAccess', _276 => _276.tags])) {
5109
+ if (_optionalChain([options, 'optionalAccess', _277 => _277.tags])) {
5108
5110
  params.set(
5109
5111
  "tags",
5110
5112
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
5111
5113
  );
5112
5114
  }
5113
- if (_optionalChain([options, 'optionalAccess', _277 => _277.includeArchived])) params.set("include_archived", "1");
5114
- if (_optionalChain([options, 'optionalAccess', _278 => _278.includeCostEstimates])) {
5115
+ if (_optionalChain([options, 'optionalAccess', _278 => _278.includeArchived])) params.set("include_archived", "1");
5116
+ if (_optionalChain([options, 'optionalAccess', _279 => _279.includeCostEstimates])) {
5115
5117
  params.set("include_cost_estimates", "1");
5116
5118
  }
5117
- if (_optionalChain([options, 'optionalAccess', _279 => _279.grep, 'optionalAccess', _280 => _280.trim, 'call', _281 => _281()])) {
5119
+ if (_optionalChain([options, 'optionalAccess', _280 => _280.grep, 'optionalAccess', _281 => _281.trim, 'call', _282 => _282()])) {
5118
5120
  params.set("grep", options.grep.trim());
5119
5121
  params.set("limit", "60");
5120
5122
  }
5121
- if (_optionalChain([options, 'optionalAccess', _282 => _282.limit]) !== void 0) {
5123
+ if (_optionalChain([options, 'optionalAccess', _283 => _283.limit]) !== void 0) {
5122
5124
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
5123
5125
  throw new Error("Play page limit must be a positive integer");
5124
5126
  }
5125
5127
  params.set("limit", String(options.limit));
5126
5128
  }
5127
- if (_optionalChain([options, 'optionalAccess', _283 => _283.cursor])) params.set("cursor", options.cursor);
5129
+ if (_optionalChain([options, 'optionalAccess', _284 => _284.cursor])) params.set("cursor", options.cursor);
5128
5130
  const suffix = params.size ? `?${params.toString()}` : "";
5129
5131
  const response = await this.http.get(`/api/v2/plays${suffix}`);
5130
5132
  return {
5131
5133
  plays: _nullishCoalesce(response.plays, () => ( [])),
5132
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _284 => _284.pagination, 'optionalAccess', _285 => _285.cursor]), () => ( response.cursor)), () => ( null)),
5133
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _286 => _286.pagination, 'optionalAccess', _287 => _287.hasMore]), () => ( response.hasMore)))
5134
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _285 => _285.pagination, 'optionalAccess', _286 => _286.cursor]), () => ( response.cursor)), () => ( null)),
5135
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _287 => _287.pagination, 'optionalAccess', _288 => _288.hasMore]), () => ( response.hasMore)))
5134
5136
  };
5135
5137
  }
5136
5138
  /** Read definition-level settings, independently of code revisions. */
@@ -5175,6 +5177,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
5175
5177
  async getNotificationSettings() {
5176
5178
  return this.http.get("/api/v2/settings/notifications");
5177
5179
  }
5180
+ /** Start provider OAuth; complete the returned URL in an authenticated browser. */
5181
+ async connectIntegration(provider, scopes) {
5182
+ return this.http.post("/api/v2/integrations/connect", {
5183
+ provider,
5184
+ ...scopes ? { scopes } : {}
5185
+ });
5186
+ }
5187
+ /** Probe an OAuth connection, refreshing expired tokens through the normal lifecycle. */
5188
+ async testIntegration(provider) {
5189
+ return this.http.get(`/api/oauth/test/${encodeURIComponent(provider)}`);
5190
+ }
5178
5191
  /** Save provider-owned credential fields without starting an OAuth browser flow. */
5179
5192
  async setIntegrationCredentials(provider, credentials) {
5180
5193
  return this.http.post("/api/v2/integrations/connect", {
@@ -5184,7 +5197,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5184
5197
  }
5185
5198
  /** Start provider OAuth and return the URL to open in a browser. */
5186
5199
  async startIntegrationOAuth(provider, options = {}) {
5187
- const scopes = _optionalChain([options, 'access', _288 => _288.scopes, 'optionalAccess', _289 => _289.map, 'call', _290 => _290((scope) => scope.trim()), 'access', _291 => _291.filter, 'call', _292 => _292(Boolean)]);
5200
+ const scopes = _optionalChain([options, 'access', _289 => _289.scopes, 'optionalAccess', _290 => _290.map, 'call', _291 => _291((scope) => scope.trim()), 'access', _292 => _292.filter, 'call', _293 => _293(Boolean)]);
5188
5201
  if (scopes !== void 0 && scopes.length === 0) {
5189
5202
  throw new Error("scopes must contain at least one OAuth scope.");
5190
5203
  }
@@ -5200,8 +5213,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5200
5213
  return this.http.post("/api/v2/integrations/connect", {
5201
5214
  provider: "slack",
5202
5215
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
5203
- ..._optionalChain([options, 'optionalAccess', _293 => _293.successUrl]) ? { success_url: options.successUrl } : {},
5204
- ..._optionalChain([options, 'optionalAccess', _294 => _294.failureUrl]) ? { failure_url: options.failureUrl } : {}
5216
+ ..._optionalChain([options, 'optionalAccess', _294 => _294.successUrl]) ? { success_url: options.successUrl } : {},
5217
+ ..._optionalChain([options, 'optionalAccess', _295 => _295.failureUrl]) ? { failure_url: options.failureUrl } : {}
5205
5218
  });
5206
5219
  }
5207
5220
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5276,7 +5289,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5276
5289
  }
5277
5290
  const targets = input.targets.map(parseNotificationGroupTarget);
5278
5291
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5279
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _295 => _295[0], 'optionalAccess', _296 => _296.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5292
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _296 => _296[0], 'optionalAccess', _297 => _297.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5280
5293
  if (legacyEvents.length > 0 && !legacyTarget) {
5281
5294
  throw new Error(
5282
5295
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5312,7 +5325,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5312
5325
  const existingGroup = current.configuration.groups.find(
5313
5326
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5314
5327
  );
5315
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _297 => _297.groupKey]), () => ( notificationObjectKey("group")));
5328
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _298 => _298.groupKey]), () => ( notificationObjectKey("group")));
5316
5329
  const group = _nullishCoalesce(existingGroup, () => ( {
5317
5330
  groupKey,
5318
5331
  name,
@@ -5536,7 +5549,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5536
5549
  /** Read one trigger inventory page without loading run histories. */
5537
5550
  async listPlayTriggerInventory(options) {
5538
5551
  const params = new URLSearchParams({ view: "inventory" });
5539
- if (_optionalChain([options, 'optionalAccess', _298 => _298.cursor])) params.set("cursor", options.cursor);
5552
+ if (_optionalChain([options, 'optionalAccess', _299 => _299.cursor])) params.set("cursor", options.cursor);
5540
5553
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5541
5554
  }
5542
5555
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5545,7 +5558,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5545
5558
  view: "history",
5546
5559
  binding_id: bindingId
5547
5560
  });
5548
- if (_optionalChain([options, 'optionalAccess', _299 => _299.limit]) !== void 0)
5561
+ if (_optionalChain([options, 'optionalAccess', _300 => _300.limit]) !== void 0)
5549
5562
  params.set("history_limit", String(options.limit));
5550
5563
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5551
5564
  }
@@ -5733,14 +5746,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
5733
5746
  */
5734
5747
  async runPlay(code, csvPath, name, options) {
5735
5748
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
5736
- input: _optionalChain([options, 'optionalAccess', _300 => _300.input]),
5737
- sourceCode: _optionalChain([options, 'optionalAccess', _301 => _301.sourceCode]),
5738
- artifact: _optionalChain([options, 'optionalAccess', _302 => _302.artifact]),
5739
- compilerManifest: _optionalChain([options, 'optionalAccess', _303 => _303.compilerManifest]),
5740
- inputFile: _optionalChain([options, 'optionalAccess', _304 => _304.inputFile]),
5741
- packagedFiles: _optionalChain([options, 'optionalAccess', _305 => _305.packagedFiles]),
5742
- force: _optionalChain([options, 'optionalAccess', _306 => _306.force]),
5743
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _307 => _307.forceToolRefresh])
5749
+ input: _optionalChain([options, 'optionalAccess', _301 => _301.input]),
5750
+ sourceCode: _optionalChain([options, 'optionalAccess', _302 => _302.sourceCode]),
5751
+ artifact: _optionalChain([options, 'optionalAccess', _303 => _303.artifact]),
5752
+ compilerManifest: _optionalChain([options, 'optionalAccess', _304 => _304.compilerManifest]),
5753
+ inputFile: _optionalChain([options, 'optionalAccess', _305 => _305.inputFile]),
5754
+ packagedFiles: _optionalChain([options, 'optionalAccess', _306 => _306.packagedFiles]),
5755
+ force: _optionalChain([options, 'optionalAccess', _307 => _307.force]),
5756
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _308 => _308.forceToolRefresh])
5744
5757
  });
5745
5758
  const start = Date.now();
5746
5759
  const state = {
@@ -5751,7 +5764,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5751
5764
  latest: null
5752
5765
  };
5753
5766
  let terminalObserved = null;
5754
- if (_optionalChain([options, 'optionalAccess', _308 => _308.signal, 'optionalAccess', _309 => _309.aborted])) {
5767
+ if (_optionalChain([options, 'optionalAccess', _309 => _309.signal, 'optionalAccess', _310 => _310.aborted])) {
5755
5768
  await this.cancelPlay(workflowId);
5756
5769
  return {
5757
5770
  success: false,
@@ -5762,9 +5775,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5762
5775
  };
5763
5776
  }
5764
5777
  for await (const event of this.watchRunEvents(workflowId, {
5765
- signal: _optionalChain([options, 'optionalAccess', _310 => _310.signal])
5778
+ signal: _optionalChain([options, 'optionalAccess', _311 => _311.signal])
5766
5779
  })) {
5767
- if (_optionalChain([options, 'optionalAccess', _311 => _311.signal, 'optionalAccess', _312 => _312.aborted])) {
5780
+ if (_optionalChain([options, 'optionalAccess', _312 => _312.signal, 'optionalAccess', _313 => _313.aborted])) {
5768
5781
  await this.cancelPlay(workflowId);
5769
5782
  return {
5770
5783
  success: false,
@@ -5774,19 +5787,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
5774
5787
  error: "Cancelled by user"
5775
5788
  };
5776
5789
  }
5777
- const previousStatus = _optionalChain([state, 'access', _313 => _313.latest, 'optionalAccess', _314 => _314.status]);
5790
+ const previousStatus = _optionalChain([state, 'access', _314 => _314.latest, 'optionalAccess', _315 => _315.status]);
5778
5791
  const status = updatePlayLiveStatusState(state, event);
5779
5792
  if (!status) {
5780
5793
  continue;
5781
5794
  }
5782
5795
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
5783
- _optionalChain([options, 'optionalAccess', _315 => _315.onProgress, 'optionalCall', _316 => _316(status)]);
5796
+ _optionalChain([options, 'optionalAccess', _316 => _316.onProgress, 'optionalCall', _317 => _317(status)]);
5784
5797
  }
5785
5798
  if (_chunkJKVRBCZLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
5786
5799
  terminalObserved = status;
5787
5800
  }
5788
5801
  }
5789
- if (_optionalChain([options, 'optionalAccess', _317 => _317.signal, 'optionalAccess', _318 => _318.aborted])) {
5802
+ if (_optionalChain([options, 'optionalAccess', _318 => _318.signal, 'optionalAccess', _319 => _319.aborted])) {
5790
5803
  await this.cancelPlay(workflowId);
5791
5804
  return {
5792
5805
  success: false,
@@ -5839,7 +5852,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5839
5852
  const response = await this.http.get(
5840
5853
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
5841
5854
  );
5842
- const event = _optionalChain([response, 'access', _319 => _319.entries, 'optionalAccess', _320 => _320[0]]);
5855
+ const event = _optionalChain([response, 'access', _320 => _320.entries, 'optionalAccess', _321 => _321[0]]);
5843
5856
  if (!event) {
5844
5857
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
5845
5858
  "No usage event was found for this request_id.",
@@ -5970,7 +5983,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5970
5983
  async cancelBillingSubscription(options) {
5971
5984
  return this.http.post(
5972
5985
  "/api/v2/billing/subscription/cancel",
5973
- { action: _optionalChain([options, 'optionalAccess', _321 => _321.undo]) ? "undo_cancel" : "cancel" }
5986
+ { action: _optionalChain([options, 'optionalAccess', _322 => _322.undo]) ? "undo_cancel" : "cancel" }
5974
5987
  );
5975
5988
  }
5976
5989
  /**
@@ -5982,7 +5995,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5982
5995
  */
5983
5996
  async listBillingInvoices(options) {
5984
5997
  const params = new URLSearchParams();
5985
- if (_optionalChain([options, 'optionalAccess', _322 => _322.limit]) !== void 0) {
5998
+ if (_optionalChain([options, 'optionalAccess', _323 => _323.limit]) !== void 0) {
5986
5999
  params.set("limit", String(options.limit));
5987
6000
  }
5988
6001
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -6092,7 +6105,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6092
6105
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
6093
6106
  async createTargetBillingPortalSession(options) {
6094
6107
  const response = await this.http.post(
6095
- _optionalChain([options, 'optionalAccess', _323 => _323.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6108
+ _optionalChain([options, 'optionalAccess', _324 => _324.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6096
6109
  {}
6097
6110
  );
6098
6111
  return response.data;
@@ -6142,8 +6155,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6142
6155
  return this.http.request("/api/v2/monitors/audit", {
6143
6156
  method: "POST",
6144
6157
  body: {
6145
- ..._optionalChain([options, 'optionalAccess', _324 => _324.fleetId]) ? { fleet_id: options.fleetId } : {},
6146
- ..._optionalChain([options, 'optionalAccess', _325 => _325.cursor]) ? { cursor: options.cursor } : {}
6158
+ ..._optionalChain([options, 'optionalAccess', _325 => _325.fleetId]) ? { fleet_id: options.fleetId } : {},
6159
+ ..._optionalChain([options, 'optionalAccess', _326 => _326.cursor]) ? { cursor: options.cursor } : {}
6147
6160
  },
6148
6161
  maxRetries: 0
6149
6162
  });
@@ -6153,8 +6166,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6153
6166
  return this.http.request("/api/v2/monitors/repair", {
6154
6167
  method: "POST",
6155
6168
  body: {
6156
- ..._optionalChain([options, 'optionalAccess', _326 => _326.fleetId]) ? { fleet_id: options.fleetId } : {},
6157
- ..._optionalChain([options, 'optionalAccess', _327 => _327.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6169
+ ..._optionalChain([options, 'optionalAccess', _327 => _327.fleetId]) ? { fleet_id: options.fleetId } : {},
6170
+ ..._optionalChain([options, 'optionalAccess', _328 => _328.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6158
6171
  },
6159
6172
  maxRetries: 0
6160
6173
  });
@@ -6162,7 +6175,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6162
6175
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
6163
6176
  async readMonitorsHealth(options) {
6164
6177
  const params = new URLSearchParams();
6165
- if (_optionalChain([options, 'optionalAccess', _328 => _328.fleetId])) params.set("fleet_id", options.fleetId);
6178
+ if (_optionalChain([options, 'optionalAccess', _329 => _329.fleetId])) params.set("fleet_id", options.fleetId);
6166
6179
  const query = params.toString();
6167
6180
  const suffix = query ? `?${query}` : "";
6168
6181
  return this.http.request(
@@ -6235,7 +6248,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6235
6248
  );
6236
6249
  }
6237
6250
  const params = new URLSearchParams();
6238
- if (_optionalChain([options, 'optionalAccess', _329 => _329.cursor])) params.set("cursor", options.cursor);
6251
+ if (_optionalChain([options, 'optionalAccess', _330 => _330.cursor])) params.set("cursor", options.cursor);
6239
6252
  const suffix = params.size > 0 ? `?${params}` : "";
6240
6253
  return this.http.request(
6241
6254
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6282,7 +6295,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6282
6295
  * a second charge. The submission is never replayed automatically.
6283
6296
  */
6284
6297
  async previewMonitor(definition, options) {
6285
- const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _330 => _330.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _331 => _331.crypto, 'optionalAccess', _332 => _332.randomUUID, 'optionalCall', _333 => _333()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6298
+ const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _331 => _331.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _332 => _332.crypto, 'optionalAccess', _333 => _333.randomUUID, 'optionalCall', _334 => _334()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6286
6299
  try {
6287
6300
  const result = await this.http.request(
6288
6301
  "/api/v2/monitors/preview",
@@ -6290,7 +6303,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6290
6303
  method: "POST",
6291
6304
  body: {
6292
6305
  ...definition,
6293
- ..._optionalChain([options, 'optionalAccess', _334 => _334.limit]) === void 0 ? {} : { limit: options.limit }
6306
+ ..._optionalChain([options, 'optionalAccess', _335 => _335.limit]) === void 0 ? {} : { limit: options.limit }
6294
6307
  },
6295
6308
  headers: { "Idempotency-Key": idempotencyKey },
6296
6309
  maxRetries: 0,
@@ -6312,7 +6325,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6312
6325
  * `client.monitors.deploy(...)`.
6313
6326
  */
6314
6327
  async deployMonitor(definition, options) {
6315
- if (_optionalChain([options, 'optionalAccess', _335 => _335.dryRun])) {
6328
+ if (_optionalChain([options, 'optionalAccess', _336 => _336.dryRun])) {
6316
6329
  return this.http.request("/api/v2/monitors/check", {
6317
6330
  method: "POST",
6318
6331
  body: definition
@@ -6348,12 +6361,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6348
6361
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6349
6362
  async listMonitors(options) {
6350
6363
  const params = new URLSearchParams();
6351
- if (_optionalChain([options, 'optionalAccess', _336 => _336.state])) params.set("state", options.state);
6352
- else if (_optionalChain([options, 'optionalAccess', _337 => _337.status])) params.set("status", options.status);
6353
- if (_optionalChain([options, 'optionalAccess', _338 => _338.limit]) !== void 0)
6364
+ if (_optionalChain([options, 'optionalAccess', _337 => _337.state])) params.set("state", options.state);
6365
+ else if (_optionalChain([options, 'optionalAccess', _338 => _338.status])) params.set("status", options.status);
6366
+ if (_optionalChain([options, 'optionalAccess', _339 => _339.limit]) !== void 0)
6354
6367
  params.set("limit", String(options.limit));
6355
- if (_optionalChain([options, 'optionalAccess', _339 => _339.cursor])) params.set("cursor", options.cursor);
6356
- if (_optionalChain([options, 'optionalAccess', _340 => _340.includeConsumers])) params.set("include_consumers", "true");
6368
+ if (_optionalChain([options, 'optionalAccess', _340 => _340.cursor])) params.set("cursor", options.cursor);
6369
+ if (_optionalChain([options, 'optionalAccess', _341 => _341.includeConsumers])) params.set("include_consumers", "true");
6357
6370
  const query = params.toString();
6358
6371
  const suffix = query ? `?${query}` : "";
6359
6372
  return this.http.request(
@@ -6369,7 +6382,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6369
6382
  );
6370
6383
  }
6371
6384
  async testMonitorWebhook(key, payload, options) {
6372
- if (_optionalChain([options, 'optionalAccess', _341 => _341.dispatch]) === true || _optionalChain([options, 'optionalAccess', _342 => _342.validationOnly]) === false) {
6385
+ if (_optionalChain([options, 'optionalAccess', _342 => _342.dispatch]) === true || _optionalChain([options, 'optionalAccess', _343 => _343.validationOnly]) === false) {
6373
6386
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
6374
6387
  "Monitor tests are validation-only and cannot dispatch events.",
6375
6388
  void 0,
@@ -6424,7 +6437,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6424
6437
  }
6425
6438
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6426
6439
  async deleteMonitor(key, options) {
6427
- if (_optionalChain([options, 'optionalAccess', _343 => _343.localOnly]) === true) {
6440
+ if (_optionalChain([options, 'optionalAccess', _344 => _344.localOnly]) === true) {
6428
6441
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
6429
6442
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6430
6443
  void 0,
@@ -6432,11 +6445,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6432
6445
  );
6433
6446
  }
6434
6447
  const params = new URLSearchParams();
6435
- if (_optionalChain([options, 'optionalAccess', _344 => _344.dryRun])) params.set("dry_run", "true");
6448
+ if (_optionalChain([options, 'optionalAccess', _345 => _345.dryRun])) params.set("dry_run", "true");
6436
6449
  const query = params.toString();
6437
6450
  return this.http.request(
6438
6451
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6439
- _optionalChain([options, 'optionalAccess', _345 => _345.dryRun]) ? { method: "DELETE" } : {
6452
+ _optionalChain([options, 'optionalAccess', _346 => _346.dryRun]) ? { method: "DELETE" } : {
6440
6453
  method: "DELETE",
6441
6454
  // Deletion is a provider lifecycle operation. A timeout is an
6442
6455
  // unknown outcome, not authority to begin another delete attempt.
@@ -6449,10 +6462,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6449
6462
  * Prefer `client.monitors.reactivate(...)`.
6450
6463
  */
6451
6464
  async reactivateMonitor(key, options) {
6452
- const query = _optionalChain([options, 'optionalAccess', _346 => _346.dryRun]) ? "?dry_run=true" : "";
6465
+ const query = _optionalChain([options, 'optionalAccess', _347 => _347.dryRun]) ? "?dry_run=true" : "";
6453
6466
  return this.http.request(
6454
6467
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6455
- _optionalChain([options, 'optionalAccess', _347 => _347.dryRun]) ? { method: "POST", body: {} } : {
6468
+ _optionalChain([options, 'optionalAccess', _348 => _348.dryRun]) ? { method: "POST", body: {} } : {
6456
6469
  method: "POST",
6457
6470
  body: {},
6458
6471
  // Reactivation can create an upstream resource, so it must not use
@@ -6466,7 +6479,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6466
6479
  // ——————————————————————————————————————————————————————————
6467
6480
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6468
6481
  monitorJobIdempotencyKey(operation) {
6469
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _348 => _348.crypto, 'optionalAccess', _349 => _349.randomUUID, 'optionalCall', _350 => _350()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6482
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _349 => _349.crypto, 'optionalAccess', _350 => _350.randomUUID, 'optionalCall', _351 => _351()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6470
6483
  const prefix = "monitor-job-";
6471
6484
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6472
6485
  const maxOperationLength = Math.max(
@@ -6477,7 +6490,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6477
6490
  }
6478
6491
  monitorJobHeaders(operation, idempotencyKey) {
6479
6492
  return {
6480
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _351 => _351.trim, 'call', _352 => _352()]) || this.monitorJobIdempotencyKey(operation)
6493
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _352 => _352.trim, 'call', _353 => _353()]) || this.monitorJobIdempotencyKey(operation)
6481
6494
  };
6482
6495
  }
6483
6496
  async deployMonitorBatch(definitions, options) {
@@ -6488,7 +6501,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6488
6501
  body: { version: 1, kind: "batch", monitors: definitions },
6489
6502
  headers: this.monitorJobHeaders(
6490
6503
  "batch-deploy",
6491
- _optionalChain([options, 'optionalAccess', _353 => _353.idempotencyKey])
6504
+ _optionalChain([options, 'optionalAccess', _354 => _354.idempotencyKey])
6492
6505
  ),
6493
6506
  maxRetries: 0,
6494
6507
  exactUrlOnly: true
@@ -6507,11 +6520,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6507
6520
  version: 1,
6508
6521
  kind: "batch",
6509
6522
  monitors: definitions,
6510
- ..._optionalChain([options, 'optionalAccess', _354 => _354.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6523
+ ..._optionalChain([options, 'optionalAccess', _355 => _355.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6511
6524
  },
6512
6525
  headers: this.monitorJobHeaders(
6513
6526
  `batch-sync-${batchId}`,
6514
- _optionalChain([options, 'optionalAccess', _355 => _355.idempotencyKey])
6527
+ _optionalChain([options, 'optionalAccess', _356 => _356.idempotencyKey])
6515
6528
  ),
6516
6529
  maxRetries: 0,
6517
6530
  exactUrlOnly: true
@@ -6526,7 +6539,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6526
6539
  body: {},
6527
6540
  headers: this.monitorJobHeaders(
6528
6541
  `batch-start-${batchId}`,
6529
- _optionalChain([options, 'optionalAccess', _356 => _356.idempotencyKey])
6542
+ _optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
6530
6543
  ),
6531
6544
  maxRetries: 0,
6532
6545
  exactUrlOnly: true
@@ -6541,7 +6554,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6541
6554
  body: {},
6542
6555
  headers: this.monitorJobHeaders(
6543
6556
  `batch-stop-${batchId}`,
6544
- _optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
6557
+ _optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
6545
6558
  ),
6546
6559
  maxRetries: 0,
6547
6560
  exactUrlOnly: true
@@ -6562,7 +6575,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6562
6575
  body: {},
6563
6576
  headers: this.monitorJobHeaders(
6564
6577
  `${action}-${monitorKey}`,
6565
- _optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
6578
+ _optionalChain([options, 'optionalAccess', _359 => _359.idempotencyKey])
6566
6579
  ),
6567
6580
  maxRetries: 0,
6568
6581
  exactUrlOnly: true
@@ -6575,7 +6588,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6575
6588
  body: definition,
6576
6589
  headers: this.monitorJobHeaders(
6577
6590
  `sync-${definition.key}`,
6578
- _optionalChain([options, 'optionalAccess', _359 => _359.idempotencyKey])
6591
+ _optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
6579
6592
  ),
6580
6593
  maxRetries: 0,
6581
6594
  exactUrlOnly: true
@@ -6588,7 +6601,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6588
6601
  );
6589
6602
  }
6590
6603
  async getMonitorJobLogs(jobId, options) {
6591
- const query = _optionalChain([options, 'optionalAccess', _360 => _360.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6604
+ const query = _optionalChain([options, 'optionalAccess', _361 => _361.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6592
6605
  return this.http.request(
6593
6606
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
6594
6607
  { method: "GET" }
@@ -6601,15 +6614,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6601
6614
  );
6602
6615
  }
6603
6616
  async waitForMonitorJob(jobId, options) {
6604
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _361 => _361.timeoutMs]), () => ( 10 * 6e4)));
6605
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _362 => _362.pollIntervalMs]), () => ( 2e3)));
6617
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _362 => _362.timeoutMs]), () => ( 10 * 6e4)));
6618
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _363 => _363.pollIntervalMs]), () => ( 2e3)));
6606
6619
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
6607
6620
  const startedAt = Date.now();
6608
6621
  let latest = await this.getMonitorJob(jobId);
6609
6622
  while (true) {
6610
- _optionalChain([options, 'optionalAccess', _363 => _363.onProgress, 'optionalCall', _364 => _364(latest)]);
6623
+ _optionalChain([options, 'optionalAccess', _364 => _364.onProgress, 'optionalCall', _365 => _365(latest)]);
6611
6624
  const job = latest.job;
6612
- const state = typeof _optionalChain([job, 'optionalAccess', _365 => _365.state]) === "string" ? job.state : void 0;
6625
+ const state = typeof _optionalChain([job, 'optionalAccess', _366 => _366.state]) === "string" ? job.state : void 0;
6613
6626
  if (state && terminal.has(state)) return latest;
6614
6627
  if (Date.now() - startedAt >= timeoutMs) return latest;
6615
6628
  await sleep(pollIntervalMs);
@@ -6620,12 +6633,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6620
6633
  // Monitor Fleets
6621
6634
  // ——————————————————————————————————————————————————————————
6622
6635
  monitorFleetIdempotencyKey(operation) {
6623
- const uuid = _optionalChain([globalThis, 'access', _366 => _366.crypto, 'optionalAccess', _367 => _367.randomUUID, 'optionalCall', _368 => _368()]);
6636
+ const uuid = _optionalChain([globalThis, 'access', _367 => _367.crypto, 'optionalAccess', _368 => _368.randomUUID, 'optionalCall', _369 => _369()]);
6624
6637
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
6625
6638
  }
6626
6639
  monitorFleetHeaders(operation, idempotencyKey) {
6627
6640
  return {
6628
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _369 => _369.trim, 'call', _370 => _370()]) || this.monitorFleetIdempotencyKey(operation)
6641
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _370 => _370.trim, 'call', _371 => _371()]) || this.monitorFleetIdempotencyKey(operation)
6629
6642
  };
6630
6643
  }
6631
6644
  monitorFleetPath(fleetId) {
@@ -6645,15 +6658,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6645
6658
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
6646
6659
  const body = {
6647
6660
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
6648
- ..._optionalChain([options, 'optionalAccess', _371 => _371.dryRun]) ? { dry_run: true } : {},
6649
- ..._optionalChain([options, 'optionalAccess', _372 => _372.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6661
+ ..._optionalChain([options, 'optionalAccess', _372 => _372.dryRun]) ? { dry_run: true } : {},
6662
+ ..._optionalChain([options, 'optionalAccess', _373 => _373.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6650
6663
  };
6651
6664
  return this.http.request(
6652
6665
  this.monitorFleetPath(fleetId),
6653
6666
  {
6654
6667
  method: "PUT",
6655
6668
  body,
6656
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _373 => _373.idempotencyKey])),
6669
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _374 => _374.idempotencyKey])),
6657
6670
  maxRetries: 0,
6658
6671
  exactUrlOnly: true
6659
6672
  }
@@ -6666,8 +6679,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6666
6679
  }
6667
6680
  async getMonitorFleet(fleetId, options) {
6668
6681
  const params = new URLSearchParams();
6669
- if (_optionalChain([options, 'optionalAccess', _374 => _374.drift])) params.set("drift", "1");
6670
- if (_optionalChain([options, 'optionalAccess', _375 => _375.limit]) !== void 0)
6682
+ if (_optionalChain([options, 'optionalAccess', _375 => _375.drift])) params.set("drift", "1");
6683
+ if (_optionalChain([options, 'optionalAccess', _376 => _376.limit]) !== void 0)
6671
6684
  params.set("limit", String(options.limit));
6672
6685
  const query = params.toString();
6673
6686
  return this.http.request(
@@ -6680,10 +6693,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6680
6693
  this.monitorFleetPath(fleetId),
6681
6694
  {
6682
6695
  method: "DELETE",
6683
- body: _optionalChain([options, 'optionalAccess', _376 => _376.dryRun]) ? { dry_run: true } : {},
6696
+ body: _optionalChain([options, 'optionalAccess', _377 => _377.dryRun]) ? { dry_run: true } : {},
6684
6697
  headers: this.monitorFleetHeaders(
6685
6698
  "deactivate",
6686
- _optionalChain([options, 'optionalAccess', _377 => _377.idempotencyKey])
6699
+ _optionalChain([options, 'optionalAccess', _378 => _378.idempotencyKey])
6687
6700
  ),
6688
6701
  maxRetries: 0,
6689
6702
  exactUrlOnly: true
@@ -6698,7 +6711,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6698
6711
  body: {},
6699
6712
  headers: this.monitorFleetHeaders(
6700
6713
  "reactivate",
6701
- _optionalChain([options, 'optionalAccess', _378 => _378.idempotencyKey])
6714
+ _optionalChain([options, 'optionalAccess', _379 => _379.idempotencyKey])
6702
6715
  ),
6703
6716
  maxRetries: 0,
6704
6717
  exactUrlOnly: true
@@ -6715,13 +6728,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
6715
6728
  * identical to "the request failed".
6716
6729
  */
6717
6730
  async waitForMonitorFleetConvergence(fleetId, options) {
6718
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _379 => _379.timeoutMs]), () => ( 10 * 6e4)));
6719
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _380 => _380.pollIntervalMs]), () => ( 2e3)));
6720
- const terminal = _optionalChain([options, 'optionalAccess', _381 => _381.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6731
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _380 => _380.timeoutMs]), () => ( 10 * 6e4)));
6732
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _381 => _381.pollIntervalMs]), () => ( 2e3)));
6733
+ const terminal = _optionalChain([options, 'optionalAccess', _382 => _382.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6721
6734
  const startedAt = Date.now();
6722
6735
  let latest = await this.getMonitorFleet(fleetId);
6723
6736
  while (true) {
6724
- _optionalChain([options, 'optionalAccess', _382 => _382.onProgress, 'optionalCall', _383 => _383(latest)]);
6737
+ _optionalChain([options, 'optionalAccess', _383 => _383.onProgress, 'optionalCall', _384 => _384(latest)]);
6725
6738
  const status = typeof latest.status === "string" ? latest.status : void 0;
6726
6739
  if (status && terminal.has(status)) return latest;
6727
6740
  if (Date.now() - startedAt >= timeoutMs) return latest;