deepline 0.3.391 → 0.3.393

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 (154) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +156 -24
  2. package/dist/bundling-sources/sdk/src/compat.ts +9 -0
  3. package/dist/bundling-sources/sdk/src/http.ts +5 -1
  4. package/dist/bundling-sources/sdk/src/index.ts +5 -0
  5. package/dist/bundling-sources/sdk/src/plays/csv-data-input.ts +3 -0
  6. package/dist/bundling-sources/sdk/src/plays/run-request.ts +182 -6
  7. package/dist/bundling-sources/sdk/src/release.ts +4 -1
  8. package/dist/bundling-sources/sdk/src/types.ts +15 -0
  9. package/dist/bundling-sources/shared_libs/integration-contracts/request-warnings.ts +64 -0
  10. package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +315 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +41 -8
  12. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +418 -44
  13. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +36 -3
  14. package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +11 -3
  16. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +1 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +19 -1
  18. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +26 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +158 -10
  20. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +235 -2
  21. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +92 -58
  22. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +7 -1
  23. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +30 -7
  24. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1161 -316
  25. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +28 -15
  26. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +24 -3
  27. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +31 -0
  28. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -4
  29. package/dist/bundling-sources/shared_libs/plays/dataset.ts +172 -79
  30. package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +57 -0
  31. package/dist/bundling-sources/shared_libs/plays/run-summary-types.ts +1 -0
  32. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +173 -1
  33. package/dist/cli/{auth-6QET7NFP.mjs → auth-5PXHA232.mjs} +4 -4
  34. package/dist/cli/auth-P3MVDTXM.js +39 -0
  35. package/dist/cli/{billing-KJAGTCFR.js → billing-JFB2XLSO.js} +101 -74
  36. package/dist/cli/{billing-HAQ2VDQX.mjs → billing-Z2N7ZAGM.mjs} +32 -5
  37. package/dist/cli/{chunk-556BMGEB.js → chunk-2HAD745V.js} +242 -183
  38. package/dist/cli/{chunk-HFTOOZGN.mjs → chunk-2LGC4EFT.mjs} +3 -3
  39. package/dist/cli/{chunk-QCWIORKR.mjs → chunk-4PT2VA3A.mjs} +2 -2
  40. package/dist/cli/{chunk-KA7X75HC.js → chunk-4XX6443T.js} +176 -87
  41. package/dist/cli/{chunk-YBZY3EZF.mjs → chunk-5KWKZIQR.mjs} +4 -4
  42. package/dist/cli/{chunk-VH4B5OYM.mjs → chunk-5PRVMXKB.mjs} +27 -2
  43. package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-6I73X254.mjs} +1 -1
  44. package/dist/cli/{chunk-6L4P7Z6C.mjs → chunk-7HR7BGZL.mjs} +13 -3
  45. package/dist/cli/{chunk-4S6X74A3.js → chunk-AARX5L4B.js} +2 -2
  46. package/dist/cli/{chunk-MHLCMJ2E.js → chunk-CDFH2DYL.js} +20 -19
  47. package/dist/cli/{chunk-PFPP4BKS.mjs → chunk-FQ6VHPW4.mjs} +2 -2
  48. package/dist/cli/{chunk-5JLQPVNX.js → chunk-GSK6NHVM.js} +1 -0
  49. package/dist/cli/{chunk-TLHF54VX.mjs → chunk-HLEESTCH.mjs} +1 -1
  50. package/dist/cli/{chunk-EDWJY6T4.mjs → chunk-HQXL5526.mjs} +1 -0
  51. package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
  52. package/dist/cli/{chunk-I3MKXASV.mjs → chunk-KIYU2TGL.mjs} +2 -2
  53. package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
  54. package/dist/cli/{chunk-XBPLTHGB.js → chunk-L2SYLGRP.js} +8 -8
  55. package/dist/cli/{chunk-K3ODOHOI.mjs → chunk-LMMEAMA7.mjs} +3 -2
  56. package/dist/cli/{chunk-KWF4HJF7.mjs → chunk-LZPCDB7U.mjs} +3 -2
  57. package/dist/cli/{chunk-I7EVBLTW.js → chunk-M7Y7JYZX.js} +32 -7
  58. package/dist/cli/{chunk-QGKPTBRR.js → chunk-MS6GUPBB.js} +3 -3
  59. package/dist/cli/{chunk-ME2DZAHC.js → chunk-OXNOAD6Y.js} +26 -26
  60. package/dist/cli/{chunk-XEV5LMS2.js → chunk-PTDECJGP.js} +50 -50
  61. package/dist/cli/{chunk-5O4B6AUN.js → chunk-PWSWAN7Q.js} +25 -2
  62. package/dist/cli/{chunk-DRZFTRZJ.mjs → chunk-Q26LUSQ2.mjs} +79 -20
  63. package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
  64. package/dist/cli/{chunk-7E66A24V.mjs → chunk-RKMB3N7K.mjs} +25 -2
  65. package/dist/cli/{chunk-WLODHQ7S.js → chunk-RWHWF5ZJ.js} +3 -2
  66. package/dist/cli/{chunk-H3DCZOXR.mjs → chunk-STNYIMIV.mjs} +97 -8
  67. package/dist/cli/chunk-UBKA33KY.mjs +310 -0
  68. package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
  69. package/dist/cli/{chunk-H2ER7QWR.mjs → chunk-UOGZUA24.mjs} +180 -18
  70. package/dist/cli/{chunk-RTH26NF3.js → chunk-VIQJIX2P.js} +73 -63
  71. package/dist/cli/{chunk-ED42XCOW.js → chunk-VIWE6WRK.js} +629 -467
  72. package/dist/cli/{chunk-RA2SDTSX.js → chunk-W4WOMXR3.js} +15 -15
  73. package/dist/cli/chunk-XDVT3GOM.js +310 -0
  74. package/dist/cli/{chunk-UOSKJIXE.js → chunk-Z3OOZM5L.js} +8 -8
  75. package/dist/cli/{csv-V7UHOBFE.mjs → csv-KJWZHKCH.mjs} +3 -3
  76. package/dist/cli/{csv-2WSF5TEM.js → csv-P3Z3YE7H.js} +12 -12
  77. package/dist/cli/{db-TD375E4N.mjs → db-NCM4CQIS.mjs} +6 -5
  78. package/dist/cli/{db-42RL4FZD.js → db-NUZGJNQC.js} +31 -30
  79. package/dist/cli/{describe-GPUKAWOZ.mjs → describe-WT6MM2GO.mjs} +18 -17
  80. package/dist/cli/{describe-7WFCBZUY.js → describe-YGSEN5WC.js} +25 -24
  81. package/dist/cli/{executions-LGVG3FPH.js → executions-PCOLHN7Q.js} +8 -7
  82. package/dist/cli/{executions-M7O63JNA.mjs → executions-XS2IPJ4W.mjs} +6 -5
  83. package/dist/cli/{feedback-PZZA2M4S.js → feedback-4MSH7TFU.js} +7 -7
  84. package/dist/cli/{feedback-6PBSKVB2.mjs → feedback-CCLTS5SV.mjs} +3 -3
  85. package/dist/cli/{git-2VIFM5DI.mjs → git-K2DHPMPC.mjs} +4 -4
  86. package/dist/cli/git-RNM45FX4.js +23 -0
  87. package/dist/cli/index.js +96 -92
  88. package/dist/cli/index.mjs +46 -42
  89. package/dist/cli/{legacy-noops-DPUBZI7N.mjs → legacy-noops-B5S4AR3P.mjs} +4 -4
  90. package/dist/cli/{legacy-noops-IQ6QTZNZ.js → legacy-noops-GPNOPFXV.js} +7 -7
  91. package/dist/cli/{monitors-KBZVQG2U.mjs → monitors-JLMAIPRG.mjs} +6 -5
  92. package/dist/cli/{monitors-6GWAZFYV.js → monitors-ZAWD7NSN.js} +87 -86
  93. package/dist/cli/{org-JKGTHXOZ.js → org-P2KN4CES.js} +66 -65
  94. package/dist/cli/{org-CP3VSJBX.mjs → org-T3JTHP4G.mjs} +6 -5
  95. package/dist/cli/{play-DD2ME4L4.mjs → play-NK6BLRGL.mjs} +12 -11
  96. package/dist/cli/play-PDXR6JFB.js +158 -0
  97. package/dist/cli/{providers-JUNOFKI7.mjs → providers-3NQRA7IT.mjs} +6 -5
  98. package/dist/cli/{providers-P34QYYG6.js → providers-5QRZN3DT.js} +9 -8
  99. package/dist/cli/{quickstart-N6SWOK7E.mjs → quickstart-PIA2JGPV.mjs} +3 -3
  100. package/dist/cli/{quickstart-UL3DEFA4.js → quickstart-R7NUZGNW.js} +5 -5
  101. package/dist/cli/run-identity-G257GQED.js +25 -0
  102. package/dist/cli/run-identity-MRNCEGV2.mjs +25 -0
  103. package/dist/cli/{search-SC7I56HX.mjs → search-AIDIIGLY.mjs} +7 -6
  104. package/dist/cli/search-QRWL7MFM.js +27 -0
  105. package/dist/cli/{secrets-6ZJE7ZPM.js → secrets-BT3PGMWN.js} +15 -14
  106. package/dist/cli/{secrets-RTARNYF5.mjs → secrets-OQNHL45O.mjs} +6 -5
  107. package/dist/cli/{sessions-6IZ2XHGW.js → sessions-EYXWOSWK.js} +5 -5
  108. package/dist/cli/{sessions-7RKV2T3O.mjs → sessions-SF7WJPJP.mjs} +4 -4
  109. package/dist/cli/{settings-YX3XJDXE.js → settings-BA3GHBOD.js} +76 -75
  110. package/dist/cli/{settings-V6PXA6HY.mjs → settings-Y57JTFDD.mjs} +9 -8
  111. package/dist/cli/{setup-V2O4UJNT.mjs → setup-7GR5GBHA.mjs} +6 -6
  112. package/dist/cli/{setup-CQ5VRNNU.js → setup-RERXYC66.js} +41 -41
  113. package/dist/cli/{skills-VHJZWEHA.mjs → skills-SJWIQAV5.mjs} +4 -4
  114. package/dist/cli/skills-V7EY75HB.js +28 -0
  115. package/dist/cli/tools-H5HLBCHH.js +41 -0
  116. package/dist/cli/{tools-OD5WKEWY.mjs → tools-ZF3JXPNL.mjs} +10 -9
  117. package/dist/cli/update-472HA3LT.js +28 -0
  118. package/dist/cli/{update-CRMNOMJ3.mjs → update-FFFYQAOJ.mjs} +6 -6
  119. package/dist/cli/{workflow-XHORSD5T.js → workflow-SZJVQH4T.js} +17 -16
  120. package/dist/cli/{workflow-EVDYNCDD.mjs → workflow-XVFEEGAS.mjs} +7 -6
  121. package/dist/{client-DpzZi4fU.d.mts → client-DU5dtHDy.d.mts} +157 -4
  122. package/dist/{client-BhK9kix9.d.ts → client-mCE88hC4.d.ts} +157 -4
  123. package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DE4RdAiY.d.mts} +61 -1
  124. package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DE4RdAiY.d.ts} +61 -1
  125. package/dist/{index-B9fBZH1g.d.mts → index-BI6nWgaV.d.mts} +1 -1
  126. package/dist/{index-BZ6uzZJl.d.ts → index-Bi-f7HFT.d.ts} +1 -1
  127. package/dist/index.d.mts +5 -5
  128. package/dist/index.d.ts +5 -5
  129. package/dist/index.js +120 -29
  130. package/dist/index.mjs +111 -20
  131. package/dist/install-integrity.json +94 -88
  132. package/dist/plays/bundle-play-file.d.mts +3 -3
  133. package/dist/plays/bundle-play-file.d.ts +3 -3
  134. package/dist/plays/bundle-play-file.mjs +2 -2
  135. package/dist/plays/csv-data-input.d.mts +2 -0
  136. package/dist/plays/csv-data-input.d.ts +2 -0
  137. package/dist/plays/csv-data-input.js +2 -2
  138. package/dist/plays/csv-data-input.mjs +1 -1
  139. package/dist/plays/run-request.d.mts +2 -2
  140. package/dist/plays/run-request.d.ts +2 -2
  141. package/dist/plays/run-request.js +5 -2
  142. package/dist/plays/run-request.mjs +4 -1
  143. package/dist/release.d.mts +4 -1
  144. package/dist/release.d.ts +4 -1
  145. package/dist/release.js +2 -2
  146. package/dist/release.mjs +1 -1
  147. package/package.json +1 -1
  148. package/dist/cli/auth-6ZUH42ZA.js +0 -39
  149. package/dist/cli/git-ZSJD3BID.js +0 -23
  150. package/dist/cli/play-G5GVMIBN.js +0 -157
  151. package/dist/cli/search-W4GXWTOM.js +0 -26
  152. package/dist/cli/skills-LBZPJTPI.js +0 -28
  153. package/dist/cli/tools-TQNM473H.js +0 -40
  154. package/dist/cli/update-QY6GAK6B.js +0 -28
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  npmSupportsAllowScripts,
3
3
  readNpmVersion
4
- } from "./chunk-TLHF54VX.mjs";
4
+ } from "./chunk-HLEESTCH.mjs";
5
5
  import {
6
6
  resolveShellSpawn,
7
7
  runSkillsCommand
8
- } from "./chunk-6L4P7Z6C.mjs";
8
+ } from "./chunk-7HR7BGZL.mjs";
9
9
  import {
10
10
  printCommandEnvelope
11
- } from "./chunk-VH4B5OYM.mjs";
11
+ } from "./chunk-5PRVMXKB.mjs";
12
12
  import {
13
13
  autoDetectBaseUrl
14
- } from "./chunk-K3ODOHOI.mjs";
14
+ } from "./chunk-LMMEAMA7.mjs";
15
15
 
16
16
  // src/cli/commands/update.ts
17
17
  import { spawn, spawnSync } from "child_process";
@@ -3,9 +3,10 @@ import {
3
3
  detectAgentRuntime,
4
4
  resolveCliCommandContext,
5
5
  resolveConfig
6
- } from "./chunk-K3ODOHOI.mjs";
6
+ } from "./chunk-LMMEAMA7.mjs";
7
7
  import {
8
- DeeplineError
8
+ DeeplineError,
9
+ serializeToolExecutionFailure
9
10
  } from "./chunk-NXGCO4JB.mjs";
10
11
 
11
12
  // src/cli/json-fields.ts
@@ -828,8 +829,30 @@ function printCompactJson(value) {
828
829
  process.stdout.write(`${JSON.stringify(withAgentCommandContext(value))}
829
830
  `);
830
831
  }
832
+ function cliToolExecutionFailure(error) {
833
+ const failure = serializeToolExecutionFailure(error);
834
+ if (!failure) return null;
835
+ const { publicDetails: _publicDetails, ...facts } = failure;
836
+ return facts;
837
+ }
838
+ function formatToolExecutionErrorDiagnostic(error) {
839
+ const failure = cliToolExecutionFailure(error);
840
+ if (!failure) return null;
841
+ const lines = [
842
+ `Tool: ${failure.toolId}${failure.provider ? `; provider: ${failure.provider}` : ""}${failure.operation ? `; operation: ${failure.operation}` : ""}.`,
843
+ `Failure: ${failure.origin} / ${failure.category}. Same-call retry: ${failure.retryable ? `safe${failure.retryAfterMs === null ? "" : ` after ${failure.retryAfterMs}ms`}` : "unsafe"}.`
844
+ ];
845
+ if (failure.networkKind || failure.networkScope) {
846
+ lines.push(
847
+ `Network: ${failure.networkKind ?? "unknown"}${failure.networkScope ? ` (${failure.networkScope})` : ""}.`
848
+ );
849
+ }
850
+ if (failure.requestId) lines.push(`Request: ${failure.requestId}.`);
851
+ return lines.join("\n");
852
+ }
831
853
  function errorToJsonPayload(error) {
832
854
  const message = error instanceof Error ? error.message : String(error);
855
+ const toolFailure = cliToolExecutionFailure(error);
833
856
  const maybeRecord = error && typeof error === "object" ? error : null;
834
857
  const code = typeof maybeRecord?.code === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
835
858
  const details = {};
@@ -868,6 +891,7 @@ function errorToJsonPayload(error) {
868
891
  error: {
869
892
  message,
870
893
  code,
894
+ ...toolFailure ? { tool_error: toolFailure } : {},
871
895
  ...Object.keys(details).length > 0 ? { details } : {}
872
896
  }
873
897
  };
@@ -966,6 +990,7 @@ export {
966
990
  markdownTableFromRows,
967
991
  printJson,
968
992
  printCompactJson,
993
+ formatToolExecutionErrorDiagnostic,
969
994
  errorToJsonPayload,
970
995
  formatProviderConcurrencyDiagnostic,
971
996
  printJsonError,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-H7HIDGZ7.mjs";
4
4
  import {
5
5
  PLAY_AUTHORING_CONTRACT_EDITION
6
- } from "./chunk-7E66A24V.mjs";
6
+ } from "./chunk-RKMB3N7K.mjs";
7
7
  import {
8
8
  PLAY_ARTIFACT_KINDS,
9
9
  PLAY_RUNTIME_BACKENDS,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-VH4B5OYM.mjs";
6
+ } from "./chunk-5PRVMXKB.mjs";
7
7
  import {
8
8
  DEFAULT_SKILL_AGENTS,
9
9
  KNOWN_SKILL_AGENTS,
@@ -22,10 +22,13 @@ import {
22
22
  sdkCliStateDirPath,
23
23
  skillsAgentPathSegment,
24
24
  writeSdkSkillsLocalVersion
25
- } from "./chunk-K3ODOHOI.mjs";
25
+ } from "./chunk-LMMEAMA7.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
29
+ import {
30
+ SDK_RELEASE
31
+ } from "./chunk-LZPCDB7U.mjs";
29
32
 
30
33
  // src/cli/commands/skills.ts
31
34
  import { spawn as spawn2 } from "child_process";
@@ -317,6 +320,10 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
317
320
  }
318
321
  if (options.skillsVersion !== void 0) {
319
322
  url.searchParams.set("skills_version", options.skillsVersion ?? "");
323
+ url.searchParams.set(
324
+ "skills_cli_capability",
325
+ String(SDK_RELEASE.packageCapabilities.skillsGuidance)
326
+ );
320
327
  }
321
328
  if (options.catalog) {
322
329
  url.searchParams.set("catalog_tool_id", options.catalog.toolId);
@@ -1417,8 +1424,10 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
1417
1424
  method: "POST",
1418
1425
  headers: { "Content-Type": "application/json" },
1419
1426
  body: JSON.stringify({
1427
+ sdk_cli: { version: SDK_VERSION },
1420
1428
  skills: {
1421
- version: localVersion
1429
+ version: localVersion,
1430
+ capability: SDK_RELEASE.packageCapabilities.skillsGuidance
1422
1431
  }
1423
1432
  }),
1424
1433
  signal: controller.signal
@@ -2368,6 +2377,7 @@ export {
2368
2377
  enforceSdkCompatibilityResponse,
2369
2378
  resolveShellSpawn,
2370
2379
  isFailureReportingDisabled,
2380
+ redactFailureText,
2371
2381
  sanitizeCommand,
2372
2382
  failureReportHeaders,
2373
2383
  resolveSdkCliFailureExitCode,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkRTH26NF3js = require('./chunk-RTH26NF3.js');
3
+ var _chunkVIQJIX2Pjs = require('./chunk-VIQJIX2P.js');
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  var _child_process = require('child_process');
@@ -13,7 +13,7 @@ function npmSupportsAllowScripts(version) {
13
13
  }
14
14
  function readNpmVersion(env) {
15
15
  try {
16
- const plan = _chunkRTH26NF3js.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
16
+ const plan = _chunkVIQJIX2Pjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
17
17
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
18
18
  encoding: "utf8",
19
19
  env,
@@ -14,7 +14,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
14
14
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
15
15
 
16
16
 
17
- var _chunkWLODHQ7Sjs = require('./chunk-WLODHQ7S.js');
17
+ var _chunkRWHWF5ZJjs = require('./chunk-RWHWF5ZJ.js');
18
18
 
19
19
  // src/errors.ts
20
20
  var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
@@ -744,9 +744,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
744
744
  }
745
745
 
746
746
  // src/version.ts
747
- var SDK_VERSION = _chunkWLODHQ7Sjs.SDK_RELEASE.version;
748
- var SDK_API_MAJOR = _chunkWLODHQ7Sjs.SDK_RELEASE.contracts.api.currentMajor;
749
- var SDK_API_CONTRACT = _nullishCoalesce(_chunkWLODHQ7Sjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
747
+ var SDK_VERSION = _chunkRWHWF5ZJjs.SDK_RELEASE.version;
748
+ var SDK_API_MAJOR = _chunkRWHWF5ZJjs.SDK_RELEASE.contracts.api.currentMajor;
749
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkRWHWF5ZJjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
750
750
 
751
751
  // src/agent-runtime.ts
752
752
 
@@ -1739,13 +1739,14 @@ var HttpClient = class {
1739
1739
  applyExplicitHeaders(headers, { "Content-Type": "application/json" });
1740
1740
  }
1741
1741
  let lastError = null;
1742
- for (const candidateUrl of buildCandidateUrls(url)) {
1742
+ const candidateUrls = _optionalChain([options, 'optionalAccess', _209 => _209.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
1743
+ for (const candidateUrl of candidateUrls) {
1743
1744
  try {
1744
1745
  const response = await fetch(candidateUrl, {
1745
1746
  method,
1746
1747
  headers,
1747
- body: _optionalChain([options, 'optionalAccess', _209 => _209.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
1748
- signal: _optionalChain([options, 'optionalAccess', _210 => _210.signal])
1748
+ body: _optionalChain([options, 'optionalAccess', _210 => _210.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
1749
+ signal: _optionalChain([options, 'optionalAccess', _211 => _211.signal])
1749
1750
  });
1750
1751
  if (!response.ok) {
1751
1752
  const body = await response.text();
@@ -1786,7 +1787,7 @@ var HttpClient = class {
1786
1787
  throw error;
1787
1788
  }
1788
1789
  const normalized = error instanceof Error ? error : new Error(String(error));
1789
- if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _211 => _211.signal, 'optionalAccess', _212 => _212.aborted])) {
1790
+ if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _212 => _212.signal, 'optionalAccess', _213 => _213.aborted])) {
1790
1791
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
1791
1792
  `Stream from ${this.config.baseUrl} was aborted by the caller.`,
1792
1793
  void 0,
@@ -1807,7 +1808,7 @@ var HttpClient = class {
1807
1808
  }
1808
1809
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
1809
1810
  withCoworkNetworkHint(
1810
- _optionalChain([lastError, 'optionalAccess', _213 => _213.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
1811
+ _optionalChain([lastError, 'optionalAccess', _214 => _214.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
1811
1812
  )
1812
1813
  );
1813
1814
  }
@@ -1869,15 +1870,15 @@ function parseResponseBody(body) {
1869
1870
  }
1870
1871
  function isProviderOriginatedHttpError(parsed) {
1871
1872
  const response = asRecord(parsed);
1872
- const error = asRecord(_optionalChain([response, 'optionalAccess', _214 => _214.error]));
1873
- const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _215 => _215.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _216 => _216.failure_origin])));
1874
- const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _217 => _217.code]), () => ( _optionalChain([response, 'optionalAccess', _218 => _218.code])));
1873
+ const error = asRecord(_optionalChain([response, 'optionalAccess', _215 => _215.error]));
1874
+ const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _216 => _216.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _217 => _217.failure_origin])));
1875
+ const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _218 => _218.code]), () => ( _optionalChain([response, 'optionalAccess', _219 => _219.code])));
1875
1876
  return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
1876
1877
  }
1877
1878
  function isMonitorRateLimitEnvelope(parsed) {
1878
1879
  const response = asRecord(parsed);
1879
- const error = asRecord(_optionalChain([response, 'optionalAccess', _219 => _219.error]));
1880
- return _optionalChain([error, 'optionalAccess', _220 => _220.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
1880
+ const error = asRecord(_optionalChain([response, 'optionalAccess', _220 => _220.error]));
1881
+ return _optionalChain([error, 'optionalAccess', _221 => _221.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
1881
1882
  }
1882
1883
  function asRecord(value) {
1883
1884
  return typeof value === "object" && value !== null ? value : null;
@@ -1893,7 +1894,7 @@ function detectHtmlErrorBody(body, contentType) {
1893
1894
  return null;
1894
1895
  }
1895
1896
  const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
1896
- const title = _optionalChain([titleMatch, 'optionalAccess', _221 => _221[1], 'optionalAccess', _222 => _222.replace, 'call', _223 => _223(/\s+/g, " "), 'access', _224 => _224.trim, 'call', _225 => _225()]) || void 0;
1897
+ const title = _optionalChain([titleMatch, 'optionalAccess', _222 => _222[1], 'optionalAccess', _223 => _223.replace, 'call', _224 => _224(/\s+/g, " "), 'access', _225 => _225.trim, 'call', _226 => _226()]) || void 0;
1897
1898
  const workerThrewException = /worker threw exception/i.test(trimmed);
1898
1899
  return {
1899
1900
  title,
@@ -1977,20 +1978,20 @@ function decodeSseFrame(frame) {
1977
1978
  }
1978
1979
  function sleep(ms, signal) {
1979
1980
  return new Promise((resolve2, reject) => {
1980
- if (_optionalChain([signal, 'optionalAccess', _226 => _226.aborted])) {
1981
+ if (_optionalChain([signal, 'optionalAccess', _227 => _227.aborted])) {
1981
1982
  reject(requestCancelledError(signal));
1982
1983
  return;
1983
1984
  }
1984
1985
  const timeoutId = setTimeout(() => {
1985
- _optionalChain([signal, 'optionalAccess', _227 => _227.removeEventListener, 'call', _228 => _228("abort", abort)]);
1986
+ _optionalChain([signal, 'optionalAccess', _228 => _228.removeEventListener, 'call', _229 => _229("abort", abort)]);
1986
1987
  resolve2();
1987
1988
  }, ms);
1988
1989
  const abort = () => {
1989
1990
  clearTimeout(timeoutId);
1990
- _optionalChain([signal, 'optionalAccess', _229 => _229.removeEventListener, 'call', _230 => _230("abort", abort)]);
1991
+ _optionalChain([signal, 'optionalAccess', _230 => _230.removeEventListener, 'call', _231 => _231("abort", abort)]);
1991
1992
  reject(requestCancelledError(signal));
1992
1993
  };
1993
- _optionalChain([signal, 'optionalAccess', _231 => _231.addEventListener, 'call', _232 => _232("abort", abort, { once: true })]);
1994
+ _optionalChain([signal, 'optionalAccess', _232 => _232.addEventListener, 'call', _233 => _233("abort", abort, { once: true })]);
1994
1995
  });
1995
1996
  }
1996
1997
  function withCoworkNetworkHint(message) {
@@ -2,7 +2,7 @@ import {
2
2
  argsWantJson,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-VH4B5OYM.mjs";
5
+ } from "./chunk-5PRVMXKB.mjs";
6
6
  import {
7
7
  ACTIVE_ORG_ID_ENV,
8
8
  ACTIVE_ORG_NAME_ENV,
@@ -25,7 +25,7 @@ import {
25
25
  saveHostEnvValues,
26
26
  saveProjectDeeplineEnvValues,
27
27
  storedHostApiKey
28
- } from "./chunk-K3ODOHOI.mjs";
28
+ } from "./chunk-LMMEAMA7.mjs";
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
  import {
@@ -2982,6 +2982,7 @@ function parseCsvDataInput(source, content, options = {}) {
2982
2982
  let records;
2983
2983
  try {
2984
2984
  records = parse(content, {
2985
+ delimiter: _nullishCoalesce(options.delimiter, () => ( ",")),
2985
2986
  bom: true,
2986
2987
  columns: false,
2987
2988
  skip_empty_lines: true,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-6L4P7Z6C.mjs";
3
+ } from "./chunk-7HR7BGZL.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -2982,6 +2982,7 @@ function parseCsvDataInput(source, content, options = {}) {
2982
2982
  let records;
2983
2983
  try {
2984
2984
  records = parse(content, {
2985
+ delimiter: options.delimiter ?? ",",
2985
2986
  bom: true,
2986
2987
  columns: false,
2987
2988
  skip_empty_lines: true,
@@ -1,3 +1,7 @@
1
+ import {
2
+ buildCallerPlayWorkflowId,
3
+ callerPlayWorkflowIdMatchesRequest
4
+ } from "./chunk-UBKA33KY.mjs";
1
5
  import {
2
6
  apiErrorCodeFromResponse,
3
7
  apiErrorMessage
@@ -74,6 +78,9 @@ var PLAY_FILES_STAGE_PATH = "/api/v2/plays/files/stage";
74
78
  var PLAY_FILES_STAGE_MINT_PATH = `${PLAY_FILES_STAGE_PATH}/mint`;
75
79
  function buildPlayRunStartBody(request) {
76
80
  return {
81
+ ...request.admissionOrgId ? { admissionOrgId: request.admissionOrgId } : {},
82
+ ...request.workflowId ? { workflowId: request.workflowId } : {},
83
+ ...request.maxTotalCredits !== void 0 ? { maxTotalCredits: request.maxTotalCredits } : {},
77
84
  ...request.name ? { name: request.name } : {},
78
85
  ...request.revisionId ? { revisionId: request.revisionId } : {},
79
86
  ...request.artifactStorageKey ? { artifactStorageKey: request.artifactStorageKey } : {},
@@ -105,13 +112,117 @@ function buildPlayRunStartBody(request) {
105
112
  ...request.testPolicyOverrides ? { testPolicyOverrides: request.testPolicyOverrides } : {}
106
113
  };
107
114
  }
108
- async function startPlayRun(http, request, headers) {
109
- const response = await http.post(
110
- PLAY_RUN_START_PATH,
111
- buildPlayRunStartBody(request),
112
- headers,
113
- { maxRetries: 0, exactUrlOnly: true }
115
+ async function preparePlayRunAdmission(http, request, onSubmission) {
116
+ let capability = null;
117
+ if (http.get) {
118
+ try {
119
+ capability = await http.get(PLAY_RUN_START_PATH);
120
+ } catch (error) {
121
+ if (!(error instanceof DeeplineError) || ![404, 405].includes(error.statusCode ?? 0))
122
+ throw error;
123
+ }
124
+ if (capability && !["caller-intent-v1", "unsupported"].includes(
125
+ capability.admissionContract ?? ""
126
+ )) {
127
+ throw new DeeplineError(
128
+ "The server admission capability response is unknown; execution was not submitted.",
129
+ 503,
130
+ "PLAY_RUN_ADMISSION_CAPABILITY_UNKNOWN"
131
+ );
132
+ }
133
+ }
134
+ const supportsCallerIntent = capability?.admissionContract === "caller-intent-v1";
135
+ if (supportsCallerIntent && (!capability?.orgId || request.admissionOrgId && request.admissionOrgId !== capability.orgId)) {
136
+ throw new DeeplineError(
137
+ "The admission workspace could not be pinned to this request; execution was not submitted.",
138
+ 409,
139
+ "PLAY_RUN_ADMISSION_TENANT_CONFLICT"
140
+ );
141
+ }
142
+ if (request.workflowId && !supportsCallerIntent) {
143
+ throw new DeeplineError(
144
+ "This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
145
+ 409,
146
+ "PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
147
+ );
148
+ }
149
+ if (request.maxTotalCredits !== void 0 && capability?.strictTotalBudget !== "fail-closed-v1") {
150
+ throw new DeeplineError(
151
+ "This server cannot honor a strict total Play budget. Execution was not submitted.",
152
+ 409,
153
+ "PLAY_TOTAL_BUDGET_UNSUPPORTED"
154
+ );
155
+ }
156
+ const wireBody = JSON.parse(
157
+ JSON.stringify(
158
+ buildPlayRunStartBody({
159
+ ...request,
160
+ ...supportsCallerIntent ? { admissionOrgId: capability.orgId } : {}
161
+ })
162
+ )
114
163
  );
164
+ const workflowId = supportsCallerIntent ? request.workflowId ?? buildCallerPlayWorkflowId(request.name ?? "play", wireBody) : void 0;
165
+ const submittedBody = workflowId ? { workflowId, ...wireBody } : wireBody;
166
+ if (workflowId && !callerPlayWorkflowIdMatchesRequest(workflowId, submittedBody)) {
167
+ throw new DeeplineError(
168
+ "workflowId must be the caller run ID of this same immutable request.",
169
+ 400,
170
+ "PLAY_RUN_START_INTENT_CONFLICT"
171
+ );
172
+ }
173
+ if (onSubmission) {
174
+ if (!workflowId || !capability?.orgId) {
175
+ throw new DeeplineError(
176
+ "This server cannot persist a recoverable submission intent. Execution was not submitted.",
177
+ 409,
178
+ "PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
179
+ );
180
+ }
181
+ await onSubmission({
182
+ workflowId,
183
+ orgId: capability.orgId,
184
+ request: submittedBody
185
+ });
186
+ }
187
+ return { body: submittedBody, workflowId, supportsCallerIntent };
188
+ }
189
+ async function startPlayRun(http, request, headers, onSubmission) {
190
+ const {
191
+ body: submittedBody,
192
+ workflowId,
193
+ supportsCallerIntent
194
+ } = await preparePlayRunAdmission(http, request, onSubmission);
195
+ let response;
196
+ try {
197
+ response = await http.post(
198
+ PLAY_RUN_START_PATH,
199
+ submittedBody,
200
+ headers,
201
+ { maxRetries: 0, exactUrlOnly: true }
202
+ );
203
+ } catch (error) {
204
+ if (error instanceof DeeplineError && ["NETWORK_TIMEOUT", "NETWORK_ERROR", "FETCH_FAILED"].includes(
205
+ error.code ?? ""
206
+ ) || error instanceof TypeError || error instanceof Error && ["AbortError", "TimeoutError"].includes(error.name)) {
207
+ const originalMessage = error instanceof Error ? error.message : "Transport failed";
208
+ const failure = new DeeplineError(
209
+ workflowId ? `${originalMessage} Admission outcome is unknown for ${workflowId}. Inspect this run before retrying; reuse this workflowId for the same immutable request.` : `${originalMessage} Admission outcome is unknown. This server did not prove caller-owned recovery support; inspect existing runs before starting again.`,
210
+ error instanceof DeeplineError ? error.statusCode : void 0,
211
+ error instanceof DeeplineError ? error.code : "NETWORK_ERROR",
212
+ {
213
+ ...workflowId ? { runId: workflowId, workflowId } : {},
214
+ admissionState: "unknown",
215
+ recoverySupported: supportsCallerIntent,
216
+ next: {
217
+ inspect: workflowId ? `deepline runs get ${workflowId} --json` : "deepline runs list --json"
218
+ }
219
+ }
220
+ );
221
+ Object.assign(failure, { cause: error });
222
+ throw failure;
223
+ }
224
+ throw error;
225
+ }
115
226
  return normalizePlayRunStart(response);
116
227
  }
117
228
  function isPlayRunPackage(value) {
@@ -520,6 +631,7 @@ function createSessionPlayRunHttp(fetchImpl = (...args) => fetch(...args)) {
520
631
  return parsed;
521
632
  };
522
633
  return {
634
+ get: (path) => send(path, { method: "GET" }),
523
635
  post: (path, body, headers) => send(path, {
524
636
  method: "POST",
525
637
  headers: { "content-type": "application/json", ...headers },
@@ -540,6 +652,7 @@ export {
540
652
  PLAY_FILES_STAGE_PATH,
541
653
  PLAY_FILES_STAGE_MINT_PATH,
542
654
  buildPlayRunStartBody,
655
+ preparePlayRunAdmission,
543
656
  startPlayRun,
544
657
  isPlayRunPackage,
545
658
  normalizePlayRunStart,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getAuthedHttpClient,
3
3
  printCommandEnvelope
4
- } from "./chunk-VH4B5OYM.mjs";
4
+ } from "./chunk-5PRVMXKB.mjs";
5
5
  import {
6
6
  agentSessionIdFromEnvironment
7
- } from "./chunk-K3ODOHOI.mjs";
7
+ } from "./chunk-LMMEAMA7.mjs";
8
8
 
9
9
  // src/cli/commands/sessions.ts
10
10
  import {