deepline 0.3.406 → 0.3.408

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 (130) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +56 -57
  2. package/dist/bundling-sources/sdk/src/play.ts +21 -5
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/types.ts +27 -3
  5. package/dist/bundling-sources/shared_libs/play-runtime/admission-timings.ts +64 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +11 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +1 -4
  8. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +4 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +2 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +15 -6
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +275 -73
  13. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +22 -4
  14. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +10 -4
  15. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +72 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/webhook-receipt-source-commit-retry.ts +90 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +5 -0
  18. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -1
  19. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +6 -0
  20. package/dist/cli/auth-3GB2K636.js +40 -0
  21. package/dist/cli/{auth-U7LIMXIS.mjs → auth-UVD3CUBB.mjs} +4 -4
  22. package/dist/cli/{billing-KGGS3444.mjs → billing-BZVTXXLM.mjs} +23 -16
  23. package/dist/cli/{billing-5ABVIJFU.js → billing-BZVYAF6T.js} +92 -85
  24. package/dist/cli/{chunk-KPU53YBB.js → chunk-2XXXFPTD.js} +67 -67
  25. package/dist/cli/{chunk-FQBKK5DG.js → chunk-3ZB6IIA7.js} +26 -26
  26. package/dist/cli/{chunk-5IGBBYXH.mjs → chunk-4CFULMRB.mjs} +73 -4
  27. package/dist/cli/{chunk-OPHLT4TM.mjs → chunk-4QFT5LGV.mjs} +2 -2
  28. package/dist/cli/{chunk-W2BAO4OR.js → chunk-4RNDKFNQ.js} +2 -2
  29. package/dist/cli/{chunk-GAMFK2ZP.mjs → chunk-67RWR34T.mjs} +10 -3
  30. package/dist/cli/{chunk-APLRSERF.js → chunk-AUMD2VXP.js} +60 -63
  31. package/dist/cli/{chunk-N6DJQQ2S.js → chunk-BRJUESQV.js} +50 -50
  32. package/dist/cli/{chunk-W3ZNQE5Y.js → chunk-D6FFBSM5.js} +1 -1
  33. package/dist/cli/{chunk-AYHLUHE5.js → chunk-E3PJF6YP.js} +6 -2
  34. package/dist/cli/{chunk-IE6IKRQA.js → chunk-ECVLPS67.js} +15 -15
  35. package/dist/cli/{chunk-QJBJZVG6.js → chunk-HQY2SG3K.js} +15 -8
  36. package/dist/cli/{chunk-2OFPPAUY.mjs → chunk-I3DHIXVJ.mjs} +4 -4
  37. package/dist/cli/{chunk-RXDJKAM2.mjs → chunk-IOHRWLQE.mjs} +6 -6
  38. package/dist/cli/{chunk-2MLY2ZBT.mjs → chunk-IWBXJDZA.mjs} +2 -2
  39. package/dist/cli/{chunk-URWF7NGQ.js → chunk-J5PTX66Y.js} +28 -14
  40. package/dist/cli/{chunk-7ZMVAV2B.mjs → chunk-LOYISF7S.mjs} +55 -58
  41. package/dist/cli/{chunk-T7YF4MQH.mjs → chunk-MJELBQBU.mjs} +4 -4
  42. package/dist/cli/{chunk-WJYPBHTE.js → chunk-OSFWFV72.js} +11 -4
  43. package/dist/cli/{chunk-ZI2ZNDJK.mjs → chunk-PYZZMAJQ.mjs} +28 -14
  44. package/dist/cli/{chunk-N43PX2CA.js → chunk-Q3LFI3VH.js} +8 -8
  45. package/dist/cli/{chunk-NYDRX6JJ.js → chunk-Q3PUHXOY.js} +99 -30
  46. package/dist/cli/{chunk-YSAZVLJD.js → chunk-QUAQX3FQ.js} +4 -4
  47. package/dist/cli/{chunk-4REBZQNK.js → chunk-RWCY6YI2.js} +53 -53
  48. package/dist/cli/{chunk-CGX4NSS3.mjs → chunk-SD7MXAJA.mjs} +1 -1
  49. package/dist/cli/{chunk-UFS752TU.mjs → chunk-SJVVBWRL.mjs} +5 -1
  50. package/dist/cli/{chunk-V3OTRWVK.mjs → chunk-URACNNLO.mjs} +2 -2
  51. package/dist/cli/{chunk-WXLOW623.mjs → chunk-WPAB4DCU.mjs} +14 -7
  52. package/dist/cli/{chunk-42RUJLQI.mjs → chunk-WTT6CLED.mjs} +1 -1
  53. package/dist/cli/{chunk-YLV6PT6B.mjs → chunk-XXLXOUUU.mjs} +1 -1
  54. package/dist/cli/{chunk-77UGRG6X.mjs → chunk-YMOFWHGO.mjs} +3 -3
  55. package/dist/cli/{chunk-EKS2FXL5.js → chunk-ZBABPK6Y.js} +8 -8
  56. package/dist/cli/command-docs.js +2 -2
  57. package/dist/cli/command-docs.mjs +1 -1
  58. package/dist/cli/{csv-HXJAAW3H.mjs → csv-WPSXG6ZZ.mjs} +3 -3
  59. package/dist/cli/{csv-U36TIOKU.js → csv-XLGLHJ6P.js} +12 -12
  60. package/dist/cli/{db-T5MLQQWJ.js → db-5PTNJG4X.js} +25 -25
  61. package/dist/cli/{db-GRWD3JAC.mjs → db-ABS57ABJ.mjs} +4 -4
  62. package/dist/cli/{describe-NFX6THJE.js → describe-EZS6PQXA.js} +11 -11
  63. package/dist/cli/{describe-HXFEIZFO.mjs → describe-PVWQJ2PB.mjs} +7 -7
  64. package/dist/cli/describe-core.d.mts +2 -2
  65. package/dist/cli/describe-core.d.ts +2 -2
  66. package/dist/cli/{executions-KBHTDL3A.js → executions-FNTAFQ7Y.js} +6 -6
  67. package/dist/cli/{executions-YGOS5E44.mjs → executions-OKJGATQZ.mjs} +4 -4
  68. package/dist/cli/{feedback-VP3GWJIH.js → feedback-6YBOMSUA.js} +7 -7
  69. package/dist/cli/{feedback-NEQGCSHB.mjs → feedback-W27HDMRR.mjs} +3 -3
  70. package/dist/cli/git-YKUXXJOR.js +24 -0
  71. package/dist/cli/{git-JJ3CHOTL.mjs → git-YOOUEL6M.mjs} +4 -4
  72. package/dist/cli/index.js +204 -127
  73. package/dist/cli/index.mjs +124 -47
  74. package/dist/cli/{legacy-noops-ITTD33ZN.js → legacy-noops-2VZ7XT6C.js} +7 -7
  75. package/dist/cli/{legacy-noops-A6KGBODU.mjs → legacy-noops-V6OKW7VR.mjs} +4 -4
  76. package/dist/cli/{monitors-DXVP5YFC.js → monitors-FBWGVIUS.js} +84 -84
  77. package/dist/cli/{monitors-NGEXCUEY.mjs → monitors-P2YYWTWT.mjs} +4 -4
  78. package/dist/cli/{org-C4ZTOSQC.js → org-3XUSVX5T.js} +64 -64
  79. package/dist/cli/{org-34DBJSFP.mjs → org-DVMG6H3C.mjs} +4 -4
  80. package/dist/cli/{play-SVLQKZBG.mjs → play-GNC5CQAS.mjs} +70 -18
  81. package/dist/cli/{play-5FWTZCHN.js → play-YG5L4BWQ.js} +345 -293
  82. package/dist/cli/{providers-QWR2HRNY.js → providers-7PSWG2OV.js} +7 -7
  83. package/dist/cli/{providers-RQTSGYE4.mjs → providers-JR33SLWL.mjs} +4 -4
  84. package/dist/cli/{quickstart-DHFNEMGY.js → quickstart-FDVZ5BL3.js} +5 -5
  85. package/dist/cli/{quickstart-W5UHZAEU.mjs → quickstart-VUOBQYIQ.mjs} +3 -3
  86. package/dist/cli/{search-U4AJC3FH.mjs → search-JZYLO33K.mjs} +5 -5
  87. package/dist/cli/search-PPPYC5OZ.js +30 -0
  88. package/dist/cli/{secrets-YSMQ7CVZ.mjs → secrets-3MCYBT4I.mjs} +4 -4
  89. package/dist/cli/{secrets-HH4H7BLE.js → secrets-VS266FVA.js} +13 -13
  90. package/dist/cli/{sessions-URONRCTV.mjs → sessions-ELLLT23E.mjs} +4 -4
  91. package/dist/cli/{sessions-AJZXYUCJ.js → sessions-TEHEWW7O.js} +5 -5
  92. package/dist/cli/{settings-QAW62BH4.js → settings-7364NMMA.js} +75 -75
  93. package/dist/cli/{settings-KGAMW4MN.mjs → settings-PZCKAFII.mjs} +8 -8
  94. package/dist/cli/{setup-P54DPBFO.mjs → setup-A7GQ4KIA.mjs} +7 -7
  95. package/dist/cli/{setup-KAMFU5VE.js → setup-PMWYLCT6.js} +42 -42
  96. package/dist/cli/skills-SYS7VRRK.js +29 -0
  97. package/dist/cli/{skills-UMWRJ6TL.mjs → skills-WS6BIFPQ.mjs} +5 -5
  98. package/dist/cli/{tools-HN4EFVY7.mjs → tools-BR4DOZA2.mjs} +7 -7
  99. package/dist/cli/{tools-HX3BHT55.js → tools-KK4BKVQR.js} +8 -8
  100. package/dist/cli/update-2IV5JTX2.js +29 -0
  101. package/dist/cli/{update-7AFQCJ75.mjs → update-D2B7UNFT.mjs} +7 -7
  102. package/dist/cli/{workflow-7EHU5ZPX.js → workflow-6ODTCYXU.js} +15 -15
  103. package/dist/cli/{workflow-ARDO4VHU.mjs → workflow-PQXC2R47.mjs} +5 -5
  104. package/dist/{client-Db1jFLpF.d.ts → client-BcvhDfJJ.d.ts} +80 -58
  105. package/dist/{client-Buv1_ktG.d.mts → client-Z9Pye1Wm.d.mts} +80 -58
  106. package/dist/{compiler-manifest-N77W75Py.d.ts → compiler-manifest-Ycx-hoAr.d.mts} +8 -1
  107. package/dist/{compiler-manifest-N77W75Py.d.mts → compiler-manifest-Ycx-hoAr.d.ts} +8 -1
  108. package/dist/{index-3WOfyVhW.d.mts → index-CZXgiN3E.d.mts} +1 -1
  109. package/dist/{index-CtIJFTCl.d.ts → index-NPG5pqxQ.d.ts} +1 -1
  110. package/dist/index.d.mts +13 -10
  111. package/dist/index.d.ts +13 -10
  112. package/dist/index.js +28 -11
  113. package/dist/index.mjs +25 -8
  114. package/dist/install-integrity.json +86 -84
  115. package/dist/plays/bundle-play-file.d.mts +3 -3
  116. package/dist/plays/bundle-play-file.d.ts +3 -3
  117. package/dist/plays/play-description.d.mts +2 -2
  118. package/dist/plays/play-description.d.ts +2 -2
  119. package/dist/plays/run-request.d.mts +2 -2
  120. package/dist/plays/run-request.d.ts +2 -2
  121. package/dist/release.d.mts +1 -1
  122. package/dist/release.d.ts +1 -1
  123. package/dist/release.js +2 -2
  124. package/dist/release.mjs +1 -1
  125. package/package.json +1 -1
  126. package/dist/cli/auth-K5QAZH42.js +0 -40
  127. package/dist/cli/git-63RYCZSI.js +0 -24
  128. package/dist/cli/search-YAYYU3WD.js +0 -30
  129. package/dist/cli/skills-M2GGHYJU.js +0 -29
  130. package/dist/cli/update-I23NN5QI.js +0 -29
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkYSAZVLJDjs = require('./chunk-YSAZVLJD.js');
6
+ var _chunkQUAQX3FQjs = require('./chunk-QUAQX3FQ.js');
7
7
 
8
8
 
9
9
 
@@ -118,6 +118,68 @@ function describeArgs(target, options) {
118
118
  ];
119
119
  }
120
120
 
121
+ // src/cli/json-mode.ts
122
+ var ANSI_PATTERN = /\x1b\[[0-9;?]*[A-Za-z]|\r/g;
123
+ var installed = false;
124
+ var pending = [];
125
+ var rawStderrWrite = null;
126
+ var stdoutWritten = false;
127
+ function isJsonOutputMode() {
128
+ return process.argv.includes("--json");
129
+ }
130
+ function installJsonStderrGuard() {
131
+ if (installed || !isJsonOutputMode()) return;
132
+ installed = true;
133
+ rawStderrWrite = process.stderr.write.bind(process.stderr);
134
+ const stdoutWrite = process.stdout.write.bind(process.stdout);
135
+ process.stdout.write = ((...args) => {
136
+ stdoutWritten = true;
137
+ return stdoutWrite(...args);
138
+ });
139
+ const capture = (chunk) => {
140
+ const text = (typeof chunk === "string" ? chunk : chunk instanceof Uint8Array ? Buffer.from(chunk).toString("utf8") : String(chunk)).replace(ANSI_PATTERN, "").trim();
141
+ if (text) pending.push(text);
142
+ };
143
+ process.stderr.write = ((chunk, ...rest) => {
144
+ capture(chunk);
145
+ const callback = rest.find((arg) => typeof arg === "function");
146
+ _optionalChain([callback, 'optionalCall', _ => _()]);
147
+ return true;
148
+ });
149
+ const toNotice = (...args) => capture(
150
+ args.map(
151
+ (arg) => typeof arg === "string" ? arg : arg instanceof Error ? arg.message : JSON.stringify(arg)
152
+ ).join(" ")
153
+ );
154
+ console.error = toNotice;
155
+ console.warn = toNotice;
156
+ }
157
+ function addJsonNotice(notice) {
158
+ if (installed) pending.push(notice);
159
+ }
160
+ function writeRawStderr(text) {
161
+ (_nullishCoalesce(rawStderrWrite, () => ( process.stderr.write.bind(process.stderr))))(text);
162
+ }
163
+ function takeSilentJsonFailureMessage(exitCode) {
164
+ if (!installed || stdoutWritten || !exitCode || Number(exitCode) === 0) {
165
+ return null;
166
+ }
167
+ const index = pending.findIndex((notice) => typeof notice === "string");
168
+ if (index === -1) return "Command failed without an error message.";
169
+ const [message] = pending.splice(index, 1);
170
+ return message;
171
+ }
172
+ function withJsonNotices(value) {
173
+ if (pending.length === 0 || value === null || typeof value !== "object" || Array.isArray(value)) {
174
+ return value;
175
+ }
176
+ const record = value;
177
+ const existing = Array.isArray(record.notices) ? record.notices : [];
178
+ const notices = [...existing, ...pending];
179
+ pending = [];
180
+ return { ...record, notices };
181
+ }
182
+
121
183
  // src/cli/utils.ts
122
184
  var _crypto = require('crypto');
123
185
 
@@ -226,8 +288,8 @@ var BROWSER_OPEN_COOLDOWN_MS = 3e4;
226
288
  var SAME_URL_BROWSER_OPEN_COOLDOWN_MS = 5 * 6e4;
227
289
  var defaultBrowserCommandRunner = childProcess;
228
290
  function getAuthedHttpClient() {
229
- const config = _chunkYSAZVLJDjs.resolveConfig.call(void 0, );
230
- return { config, http: new (0, _chunkYSAZVLJDjs.HttpClient)(config) };
291
+ const config = _chunkQUAQX3FQjs.resolveConfig.call(void 0, );
292
+ return { config, http: new (0, _chunkQUAQX3FQjs.HttpClient)(config) };
231
293
  }
232
294
  function stableOsUserId() {
233
295
  try {
@@ -337,7 +399,7 @@ function readMacosUserHome(runner = defaultBrowserCommandRunner) {
337
399
  { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }
338
400
  );
339
401
  const match = String(output).match(/NFSHomeDirectory:\s*(.+)\s*$/m);
340
- const home = _optionalChain([match, 'optionalAccess', _ => _[1], 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]);
402
+ const home = _optionalChain([match, 'optionalAccess', _2 => _2[1], 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]);
341
403
  if (home) return home;
342
404
  } catch (e7) {
343
405
  }
@@ -562,12 +624,12 @@ function sleep(ms) {
562
624
  return new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
563
625
  }
564
626
  function collectLocalEnvInfo() {
565
- const homeDir = _optionalChain([process, 'access', _4 => _4.env, 'access', _5 => _5.HOME, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) || _os.homedir.call(void 0, );
627
+ const homeDir = _optionalChain([process, 'access', _5 => _5.env, 'access', _6 => _6.HOME, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]) || _os.homedir.call(void 0, );
566
628
  const info = {
567
629
  os: `${process.platform} ${process.arch}`,
568
630
  node_version: process.version,
569
631
  home_dir: homeDir,
570
- agent_runtime: _chunkYSAZVLJDjs.detectAgentRuntime.call(void 0, )
632
+ agent_runtime: _chunkQUAQX3FQjs.detectAgentRuntime.call(void 0, )
571
633
  };
572
634
  const env = process.env;
573
635
  const optional = {
@@ -575,15 +637,15 @@ function collectLocalEnvInfo() {
575
637
  deepline_plugin_mode: env.DEEPLINE_PLUGIN_MODE
576
638
  };
577
639
  for (const [key, value] of Object.entries(optional)) {
578
- if (_optionalChain([value, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()])) info[key] = value.trim();
640
+ if (_optionalChain([value, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()])) info[key] = value.trim();
579
641
  }
580
- if (_optionalChain([env, 'access', _10 => _10.CLAUDE_PROJECT_DIR, 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()])) {
642
+ if (_optionalChain([env, 'access', _11 => _11.CLAUDE_PROJECT_DIR, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()])) {
581
643
  info.claude_project_dir_present = "true";
582
644
  }
583
- if (_optionalChain([env, 'access', _13 => _13.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _14 => _14.trim, 'call', _15 => _15()])) {
645
+ if (_optionalChain([env, 'access', _14 => _14.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()])) {
584
646
  info.deepline_plugin_root_present = "true";
585
647
  }
586
- if (_optionalChain([env, 'access', _16 => _16.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()])) {
648
+ if (_optionalChain([env, 'access', _17 => _17.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()])) {
587
649
  info.deepline_plugin_skills_dir_present = "true";
588
650
  }
589
651
  if (info.home_dir === "/sessions" || info.home_dir.startsWith("/sessions/")) {
@@ -602,7 +664,7 @@ function readCsvRows(csvPath) {
602
664
  });
603
665
  }
604
666
  function csvStringFromRows(rows, columns) {
605
- const effectiveColumns = _optionalChain([columns, 'optionalAccess', _19 => _19.length]) ? columns : Object.keys(_nullishCoalesce(rows[0], () => ( {})));
667
+ const effectiveColumns = _optionalChain([columns, 'optionalAccess', _20 => _20.length]) ? columns : Object.keys(_nullishCoalesce(rows[0], () => ( {})));
606
668
  if (!effectiveColumns.length) {
607
669
  return _sync3.stringify.call(void 0,
608
670
  rows.map(() => ({})),
@@ -687,7 +749,7 @@ function failureMessageFromRecord(value) {
687
749
  const status = typeof value.status === "string" ? value.status.trim().toLowerCase() : "";
688
750
  const directError = typeof value.error === "string" ? value.error.trim() : typeof value.last_error === "string" ? value.last_error.trim() : "";
689
751
  const result = value.result && typeof value.result === "object" && !Array.isArray(value.result) ? value.result : null;
690
- const resultError = typeof _optionalChain([result, 'optionalAccess', _20 => _20.error]) === "string" ? result.error.trim() : typeof _optionalChain([result, 'optionalAccess', _21 => _21.message]) === "string" ? result.message.trim() : "";
752
+ const resultError = typeof _optionalChain([result, 'optionalAccess', _21 => _21.error]) === "string" ? result.error.trim() : typeof _optionalChain([result, 'optionalAccess', _22 => _22.message]) === "string" ? result.message.trim() : "";
691
753
  if (!directError && !resultError && status !== "error" && status !== "failed") {
692
754
  return null;
693
755
  }
@@ -814,20 +876,22 @@ function markdownTableFromRows(rows, preferredColumns = []) {
814
876
  }
815
877
  function withAgentCommandContext(value) {
816
878
  const valueRecord = value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
817
- return _chunkYSAZVLJDjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
879
+ return _chunkQUAQX3FQjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
818
880
  ...valueRecord,
819
- command_context: _chunkYSAZVLJDjs.resolveCliCommandContext.call(void 0, )
881
+ command_context: _chunkQUAQX3FQjs.resolveCliCommandContext.call(void 0, )
820
882
  } : value;
821
883
  }
822
884
  function printJson(value, fields) {
823
885
  process.stdout.write(
824
- `${JSON.stringify(selectJsonFields(withAgentCommandContext(value), fields), null, 2)}
886
+ `${JSON.stringify(withJsonNotices(selectJsonFields(withAgentCommandContext(value), fields)), null, 2)}
825
887
  `
826
888
  );
827
889
  }
828
890
  function printCompactJson(value) {
829
- process.stdout.write(`${JSON.stringify(withAgentCommandContext(value))}
830
- `);
891
+ process.stdout.write(
892
+ `${JSON.stringify(withJsonNotices(withAgentCommandContext(value)))}
893
+ `
894
+ );
831
895
  }
832
896
  function cliToolExecutionFailure(error) {
833
897
  const failure = _chunk7P5AA3SNjs.serializeToolExecutionFailure.call(void 0, error);
@@ -854,35 +918,35 @@ function errorToJsonPayload(error) {
854
918
  const message = error instanceof Error ? error.message : String(error);
855
919
  const toolFailure = cliToolExecutionFailure(error);
856
920
  const maybeRecord = error && typeof error === "object" ? error : null;
857
- const code = typeof _optionalChain([maybeRecord, 'optionalAccess', _22 => _22.code]) === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
921
+ const code = typeof _optionalChain([maybeRecord, 'optionalAccess', _23 => _23.code]) === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
858
922
  const details = {};
859
- const exitCode = typeof _optionalChain([maybeRecord, 'optionalAccess', _23 => _23.exitCode]) === "number" ? maybeRecord.exitCode : void 0;
860
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _24 => _24.statusCode]) === "number") {
923
+ const exitCode = typeof _optionalChain([maybeRecord, 'optionalAccess', _24 => _24.exitCode]) === "number" ? maybeRecord.exitCode : void 0;
924
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _25 => _25.statusCode]) === "number") {
861
925
  details.statusCode = maybeRecord.statusCode;
862
926
  }
863
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _25 => _25.status]) === "number") {
927
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _26 => _26.status]) === "number") {
864
928
  details.status = maybeRecord.status;
865
929
  }
866
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _26 => _26.requestId]) === "string" || _optionalChain([maybeRecord, 'optionalAccess', _27 => _27.requestId]) === null) {
930
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _27 => _27.requestId]) === "string" || _optionalChain([maybeRecord, 'optionalAccess', _28 => _28.requestId]) === null) {
867
931
  details.requestId = maybeRecord.requestId;
868
932
  }
869
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _28 => _28.retryable]) === "boolean") {
933
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _29 => _29.retryable]) === "boolean") {
870
934
  details.retryable = maybeRecord.retryable;
871
935
  }
872
- if (_optionalChain([maybeRecord, 'optionalAccess', _29 => _29.publicDetails]) && typeof maybeRecord.publicDetails === "object" && !Array.isArray(maybeRecord.publicDetails)) {
936
+ if (_optionalChain([maybeRecord, 'optionalAccess', _30 => _30.publicDetails]) && typeof maybeRecord.publicDetails === "object" && !Array.isArray(maybeRecord.publicDetails)) {
873
937
  details.publicDetails = maybeRecord.publicDetails;
874
938
  }
875
- if (_optionalChain([maybeRecord, 'optionalAccess', _30 => _30.details]) && typeof maybeRecord.details === "object" && !Array.isArray(maybeRecord.details)) {
939
+ if (_optionalChain([maybeRecord, 'optionalAccess', _31 => _31.details]) && typeof maybeRecord.details === "object" && !Array.isArray(maybeRecord.details)) {
876
940
  details.details = maybeRecord.details;
877
941
  }
878
- if (_optionalChain([maybeRecord, 'optionalAccess', _31 => _31.guidance]) && typeof maybeRecord.guidance === "object" && !Array.isArray(maybeRecord.guidance)) {
942
+ if (_optionalChain([maybeRecord, 'optionalAccess', _32 => _32.guidance]) && typeof maybeRecord.guidance === "object" && !Array.isArray(maybeRecord.guidance)) {
879
943
  details.guidance = maybeRecord.guidance;
880
944
  }
881
945
  const providerConcurrency = providerConcurrencyDiagnostic(maybeRecord);
882
946
  if (providerConcurrency) {
883
947
  details.providerConcurrency = providerConcurrency;
884
948
  }
885
- if (typeof _optionalChain([maybeRecord, 'optionalAccess', _32 => _32.cause]) === "string") {
949
+ if (typeof _optionalChain([maybeRecord, 'optionalAccess', _33 => _33.cause]) === "string") {
886
950
  details.cause = maybeRecord.cause;
887
951
  }
888
952
  return {
@@ -943,12 +1007,12 @@ function clip(value, maxLength) {
943
1007
  // src/cli/command-envelope.ts
944
1008
  function renderSections(render) {
945
1009
  const lines = [];
946
- for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _33 => _33.sections]), () => ( []))) {
1010
+ for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _34 => _34.sections]), () => ( []))) {
947
1011
  if (!section.title || section.lines.length === 0) continue;
948
1012
  lines.push(section.title);
949
1013
  lines.push(...section.lines.map((line) => ` ${line}`));
950
1014
  }
951
- for (const action of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _34 => _34.actions]), () => ( []))) {
1015
+ for (const action of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _35 => _35.actions]), () => ( []))) {
952
1016
  if (!action.label || !action.command) continue;
953
1017
  lines.push(`${action.label}: ${action.command}`);
954
1018
  }
@@ -1000,4 +1064,9 @@ function printCommandEnvelope(envelope, options = {}) {
1000
1064
 
1001
1065
 
1002
1066
 
1003
- exports.parseJsonFields = parseJsonFields; exports.jsonFieldArgs = jsonFieldArgs; exports.describeArgs = describeArgs; exports.getAuthedHttpClient = getAuthedHttpClient; exports.openInBrowser = openInBrowser; exports.sleep = sleep; exports.collectLocalEnvInfo = collectLocalEnvInfo; exports.readCsvRows = readCsvRows; exports.csvStringFromRows = csvStringFromRows; exports.csvSafeJsonString = csvSafeJsonString; exports.recordRows = recordRows; exports.dataExportRows = dataExportRows; exports.dataExportColumns = dataExportColumns; exports.dataExportCsvString = dataExportCsvString; exports.markdownTableFromRows = markdownTableFromRows; exports.printJson = printJson; exports.printCompactJson = printCompactJson; exports.formatToolExecutionErrorDiagnostic = formatToolExecutionErrorDiagnostic; exports.errorToJsonPayload = errorToJsonPayload; exports.formatProviderConcurrencyDiagnostic = formatProviderConcurrencyDiagnostic; exports.printJsonError = printJsonError; exports.shouldEmitJson = shouldEmitJson; exports.argsWantJson = argsWantJson; exports.createTimestampedName = createTimestampedName; exports.clip = clip; exports.renderCommandEnvelopeText = renderCommandEnvelopeText; exports.printCommandEnvelope = printCommandEnvelope;
1067
+
1068
+
1069
+
1070
+
1071
+
1072
+ exports.parseJsonFields = parseJsonFields; exports.jsonFieldArgs = jsonFieldArgs; exports.describeArgs = describeArgs; exports.isJsonOutputMode = isJsonOutputMode; exports.installJsonStderrGuard = installJsonStderrGuard; exports.addJsonNotice = addJsonNotice; exports.writeRawStderr = writeRawStderr; exports.takeSilentJsonFailureMessage = takeSilentJsonFailureMessage; exports.getAuthedHttpClient = getAuthedHttpClient; exports.openInBrowser = openInBrowser; exports.sleep = sleep; exports.collectLocalEnvInfo = collectLocalEnvInfo; exports.readCsvRows = readCsvRows; exports.csvStringFromRows = csvStringFromRows; exports.csvSafeJsonString = csvSafeJsonString; exports.recordRows = recordRows; exports.dataExportRows = dataExportRows; exports.dataExportColumns = dataExportColumns; exports.dataExportCsvString = dataExportCsvString; exports.markdownTableFromRows = markdownTableFromRows; exports.printJson = printJson; exports.printCompactJson = printCompactJson; exports.formatToolExecutionErrorDiagnostic = formatToolExecutionErrorDiagnostic; exports.errorToJsonPayload = errorToJsonPayload; exports.formatProviderConcurrencyDiagnostic = formatProviderConcurrencyDiagnostic; exports.printJsonError = printJsonError; exports.shouldEmitJson = shouldEmitJson; exports.argsWantJson = argsWantJson; exports.createTimestampedName = createTimestampedName; exports.clip = clip; exports.renderCommandEnvelopeText = renderCommandEnvelopeText; exports.printCommandEnvelope = printCommandEnvelope;
@@ -17,7 +17,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
17
17
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
18
18
 
19
19
 
20
- var _chunkW3ZNQE5Yjs = require('./chunk-W3ZNQE5Y.js');
20
+ var _chunkD6FFBSM5js = require('./chunk-D6FFBSM5.js');
21
21
 
22
22
  // src/config.ts
23
23
 
@@ -649,9 +649,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
649
649
  }
650
650
 
651
651
  // src/version.ts
652
- var SDK_VERSION = _chunkW3ZNQE5Yjs.SDK_RELEASE.version;
653
- var SDK_API_MAJOR = _chunkW3ZNQE5Yjs.SDK_RELEASE.contracts.api.currentMajor;
654
- var SDK_API_CONTRACT = _nullishCoalesce(_chunkW3ZNQE5Yjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
652
+ var SDK_VERSION = _chunkD6FFBSM5js.SDK_RELEASE.version;
653
+ var SDK_API_MAJOR = _chunkD6FFBSM5js.SDK_RELEASE.contracts.api.currentMajor;
654
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkD6FFBSM5js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
655
655
 
656
656
  // src/agent-runtime.ts
657
657