deepline 0.3.514 → 0.3.516

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 (180) hide show
  1. package/dist/bundling-sources/sdk/src/errors.ts +1 -0
  2. package/dist/bundling-sources/sdk/src/http-core.ts +9 -4
  3. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +30 -15
  6. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +6 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +71 -1
  8. package/dist/bundling-sources/shared_libs/play-runtime/secret-redaction.ts +20 -7
  9. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +3 -1
  10. package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +45 -0
  11. package/dist/bundling-sources/shared_libs/tool-execution-error.ts +45 -0
  12. package/dist/cli/{artifacts-GNFL5LY4.mjs → artifacts-G56FISIE.mjs} +9 -9
  13. package/dist/cli/{artifacts-OZRO4LHT.js → artifacts-KMWS32R5.js} +21 -21
  14. package/dist/cli/auth-6EIEZ3UE.js +43 -0
  15. package/dist/cli/{auth-53EDAX7Y.mjs → auth-RSS7MOBV.mjs} +7 -7
  16. package/dist/cli/{billing-ZMX2V5X3.mjs → billing-2ALO3XEG.mjs} +10 -10
  17. package/dist/cli/{billing-B6V3FELL.js → billing-RCC6WBIZ.js} +93 -93
  18. package/dist/cli/{chunk-753MZFDF.mjs → chunk-2YEFJHAF.mjs} +3 -3
  19. package/dist/cli/{chunk-BBDWIUJA.js → chunk-4IIK6GIY.js} +17 -17
  20. package/dist/cli/{chunk-DMBCJFGY.mjs → chunk-5NU37KME.mjs} +2 -2
  21. package/dist/cli/{chunk-Z5WO6IBV.mjs → chunk-6ADGVZRX.mjs} +21 -6
  22. package/dist/cli/{chunk-RNSHCJME.js → chunk-6Y3DDRRN.js} +30 -30
  23. package/dist/cli/{chunk-NXT52SIV.js → chunk-6ZLL5GDN.js} +2 -2
  24. package/dist/cli/{chunk-QSFAUGFK.js → chunk-72L5HQ3J.js} +5 -5
  25. package/dist/cli/{chunk-DLYWOHO4.mjs → chunk-72MFP7V4.mjs} +1 -1
  26. package/dist/cli/{chunk-MF7ZVWJK.js → chunk-7R2V5Z6O.js} +41 -41
  27. package/dist/cli/{chunk-W3TN352L.mjs → chunk-C2SR3X7Y.mjs} +4 -4
  28. package/dist/cli/{chunk-76M3DL5G.mjs → chunk-C72J6JE3.mjs} +1 -1
  29. package/dist/cli/{chunk-RMRZ4BC4.mjs → chunk-CA24C3XL.mjs} +4 -4
  30. package/dist/cli/{chunk-2RCZCWPO.js → chunk-CKEZXNMV.js} +6 -6
  31. package/dist/cli/{chunk-C24VEYSP.js → chunk-D4OZSC3C.js} +8 -4
  32. package/dist/cli/{chunk-EVTD3ELD.mjs → chunk-E7ZM2ZRD.mjs} +5 -5
  33. package/dist/cli/{chunk-MJIS4XAZ.mjs → chunk-EYWP5JPU.mjs} +4 -4
  34. package/dist/cli/{chunk-TG4IMWAL.js → chunk-FIIBDWAO.js} +55 -55
  35. package/dist/cli/{chunk-7MJYZ33I.mjs → chunk-GJYLC4JB.mjs} +1 -1
  36. package/dist/cli/{chunk-7MBI2OLW.mjs → chunk-H6BSB2YJ.mjs} +1 -1
  37. package/dist/cli/{chunk-N4TR6QRI.mjs → chunk-HT675XNR.mjs} +1 -1
  38. package/dist/cli/{chunk-IZJGOMCW.mjs → chunk-HY6KAW5H.mjs} +5 -5
  39. package/dist/cli/{chunk-ILITNKGM.mjs → chunk-J4VMWSQK.mjs} +7 -7
  40. package/dist/cli/{chunk-TZS4G7CS.js → chunk-JB6FEEDQ.js} +2 -2
  41. package/dist/cli/{chunk-6FYGFIXD.mjs → chunk-JPLEDOEW.mjs} +2 -2
  42. package/dist/cli/{chunk-7ZCXQDOQ.mjs → chunk-LCKAG5RL.mjs} +2 -2
  43. package/dist/cli/{chunk-RVMV4MXO.mjs → chunk-LWUFEX26.mjs} +3 -3
  44. package/dist/cli/{chunk-FPWOEK7G.js → chunk-LZROM6VQ.js} +2 -2
  45. package/dist/cli/{chunk-RLVSWAWB.js → chunk-N6Q5SDGA.js} +62 -51
  46. package/dist/cli/{chunk-A6QCMBGL.js → chunk-NRO3NTVO.js} +5 -5
  47. package/dist/cli/{chunk-VLIDBQYL.js → chunk-P6AADORO.js} +3 -3
  48. package/dist/cli/{chunk-55WBE4UK.js → chunk-PKKSXXZ5.js} +26 -26
  49. package/dist/cli/{chunk-G6PUQQJP.js → chunk-PMS3LQ6B.js} +5 -5
  50. package/dist/cli/{chunk-JC3ABOZP.js → chunk-PPYJXP4Z.js} +38 -23
  51. package/dist/cli/{chunk-6SSISVXD.mjs → chunk-PVVWKOEB.mjs} +8 -7
  52. package/dist/cli/{chunk-DBBLPDXK.mjs → chunk-Q47MAAHI.mjs} +1 -1
  53. package/dist/cli/{chunk-2CTTSNFE.js → chunk-QG3MRMU5.js} +58 -57
  54. package/dist/cli/{chunk-53F6JDQ3.mjs → chunk-QG4LIOGI.mjs} +2 -2
  55. package/dist/cli/{chunk-4QF2K7TM.mjs → chunk-QNHHZ63P.mjs} +1 -1
  56. package/dist/cli/{chunk-A253CMOI.js → chunk-QUSYG3VP.js} +8 -8
  57. package/dist/cli/{chunk-T4NQ2ZOH.js → chunk-QX7WDG4V.js} +11 -11
  58. package/dist/cli/{chunk-MQK5SY5N.js → chunk-RB3OR32I.js} +16 -16
  59. package/dist/cli/{chunk-RFN7OKT2.mjs → chunk-RB5EMAWD.mjs} +1 -1
  60. package/dist/cli/{chunk-WP3ULMRU.js → chunk-RLI6FDQM.js} +6 -6
  61. package/dist/cli/{chunk-TMQUMILM.js → chunk-RVHUW4TN.js} +2 -2
  62. package/dist/cli/{chunk-DIAWYWT5.js → chunk-SQWET4SL.js} +18 -1
  63. package/dist/cli/{chunk-OZDT2CZW.mjs → chunk-STR5LXK4.mjs} +1 -1
  64. package/dist/cli/{chunk-ALJJRZNJ.js → chunk-T2N3B7IQ.js} +8 -8
  65. package/dist/cli/{chunk-OQ4JV3IW.js → chunk-TZNQRKDF.js} +1 -1
  66. package/dist/cli/{chunk-CUMA6DE2.js → chunk-UW5QWTUG.js} +19 -19
  67. package/dist/cli/{chunk-G6A7CGFV.mjs → chunk-V46UBZBJ.mjs} +6 -3
  68. package/dist/cli/{chunk-R5PJ6XZI.js → chunk-VIZJIBI4.js} +10 -10
  69. package/dist/cli/{chunk-Y2RIMVEM.js → chunk-W5I53WQ4.js} +112 -112
  70. package/dist/cli/{chunk-H7L5MS5E.mjs → chunk-WCQ7JGDV.mjs} +4 -4
  71. package/dist/cli/{chunk-7KD4IYLA.js → chunk-WE223LFR.js} +19 -19
  72. package/dist/cli/{chunk-H53YG6QG.mjs → chunk-X2YP36YP.mjs} +1 -1
  73. package/dist/cli/{chunk-LV2DGEJ3.js → chunk-XEQBYK4B.js} +16 -13
  74. package/dist/cli/{chunk-5LBXLQRW.js → chunk-YS7AI7R6.js} +108 -108
  75. package/dist/cli/{chunk-HJ5B67S3.mjs → chunk-YXGTO5XA.mjs} +8 -4
  76. package/dist/cli/{chunk-54IH5U3I.mjs → chunk-Z3KLCDCB.mjs} +23 -12
  77. package/dist/cli/{chunk-6OIRN4PC.mjs → chunk-ZFRN3B2R.mjs} +2 -2
  78. package/dist/cli/{chunk-EO52BKGA.mjs → chunk-ZMCQP4EU.mjs} +11 -11
  79. package/dist/cli/{chunk-HBL4PM5Q.mjs → chunk-ZPGGW27Q.mjs} +17 -0
  80. package/dist/cli/command-docs.js +2 -2
  81. package/dist/cli/command-docs.mjs +1 -1
  82. package/dist/cli/{csv-2BLYUV2G.js → csv-RPR64UBS.js} +15 -15
  83. package/dist/cli/{csv-ONKAMLL4.mjs → csv-YXK5TB47.mjs} +6 -6
  84. package/dist/cli/{db-YKT6LEQ3.js → db-KO3JCGRG.js} +36 -36
  85. package/dist/cli/{db-4GVSGAXL.mjs → db-UQYILAMF.mjs} +9 -9
  86. package/dist/cli/describe-BPX3U2BF.js +50 -0
  87. package/dist/cli/describe-P2OK5X2S.mjs +50 -0
  88. package/dist/cli/describe-core.d.mts +3 -3
  89. package/dist/cli/describe-core.d.ts +3 -3
  90. package/dist/cli/describe-core.js +4 -4
  91. package/dist/cli/describe-core.mjs +3 -3
  92. package/dist/cli/{executions-VFCU5NGH.js → executions-5Z7H7HV3.js} +11 -11
  93. package/dist/cli/{executions-7OSL25KJ.mjs → executions-IQCRQXVA.mjs} +9 -9
  94. package/dist/cli/{feedback-ERTOLEC4.js → feedback-EDZJDARP.js} +12 -12
  95. package/dist/cli/{feedback-RPZELEA5.mjs → feedback-ZO6A4HTV.mjs} +7 -7
  96. package/dist/cli/{git-XKRQZ4A6.mjs → git-OBXSILWM.mjs} +7 -7
  97. package/dist/cli/git-Y34J73QC.js +25 -0
  98. package/dist/cli/index.js +150 -150
  99. package/dist/cli/index.mjs +46 -46
  100. package/dist/cli/{legacy-noops-MZCFS2FQ.mjs → legacy-noops-4UJM3FMN.mjs} +8 -8
  101. package/dist/cli/{legacy-noops-HG3M5HGZ.js → legacy-noops-HKXU2EU6.js} +11 -11
  102. package/dist/cli/{monitors-MESMMU5P.js → monitors-7EP3Q2DX.js} +110 -110
  103. package/dist/cli/{monitors-GBO5XAEZ.mjs → monitors-ZXF2KCW7.mjs} +10 -10
  104. package/dist/cli/{org-DJRNWIPO.mjs → org-EDHCUR6V.mjs} +9 -9
  105. package/dist/cli/{org-EZPREEWH.js → org-GFGOTUWP.js} +75 -75
  106. package/dist/cli/{pages-36BHVOFL.mjs → pages-EGEWMPJN.mjs} +9 -9
  107. package/dist/cli/{pages-ACI7VV6I.js → pages-TLFQQL5S.js} +21 -21
  108. package/dist/cli/{play-SUSVQHX5.mjs → play-NBO3MPDL.mjs} +22 -22
  109. package/dist/cli/{play-KCLLAGWR.js → play-XDHJY5R4.js} +392 -392
  110. package/dist/cli/{providers-MV2YW3J5.mjs → providers-NXJ7WPNH.mjs} +9 -9
  111. package/dist/cli/{providers-YFO3EFLK.js → providers-RU6BGEDM.js} +12 -12
  112. package/dist/cli/{quickstart-MATFTZVQ.js → quickstart-4ZZBMZPF.js} +8 -8
  113. package/dist/cli/{quickstart-KMXU2T3Z.mjs → quickstart-YBNDPNAR.mjs} +6 -6
  114. package/dist/cli/{run-UW5FM64G.js → run-374CTJBV.js} +46 -46
  115. package/dist/cli/{run-YRYVGUCJ.mjs → run-LX52KVZM.mjs} +27 -27
  116. package/dist/cli/{search-WF3Q3I5X.mjs → search-EH6JPV62.mjs} +11 -11
  117. package/dist/cli/search-YS4DHSQC.js +33 -0
  118. package/dist/cli/{search-output-BG743WAM.js → search-output-NATLJOWW.js} +9 -9
  119. package/dist/cli/{search-output-THOAHTCU.mjs → search-output-XIQERUHF.mjs} +7 -7
  120. package/dist/cli/{secrets-EOGBWN44.js → secrets-A3UXDE5V.js} +18 -18
  121. package/dist/cli/{secrets-LM7OTAUE.mjs → secrets-VRJQFUKF.mjs} +9 -9
  122. package/dist/cli/sessions-5TTH5FGZ.mjs +18 -0
  123. package/dist/cli/sessions-EXII5VOV.js +18 -0
  124. package/dist/cli/{settings-OWE3EEG7.js → settings-LX5EGLVT.js} +89 -89
  125. package/dist/cli/{settings-JXTFX5G2.mjs → settings-VRGFTOTJ.mjs} +16 -16
  126. package/dist/cli/{setup-FG37SKMB.mjs → setup-FXP5Y3Y6.mjs} +12 -12
  127. package/dist/cli/{setup-Z5BEQKA7.js → setup-QL4YWKOR.js} +52 -52
  128. package/dist/cli/skills-5L4CYX3V.js +37 -0
  129. package/dist/cli/{skills-UGNCBZTJ.mjs → skills-ET4PMBJE.mjs} +10 -10
  130. package/dist/cli/tools-5V77VIUA.js +57 -0
  131. package/dist/cli/{tools-J3PKLQSL.mjs → tools-WPL3NZAA.mjs} +20 -20
  132. package/dist/cli/update-G5RSSWM5.js +35 -0
  133. package/dist/cli/{update-GGZ2XTMZ.mjs → update-OCAHAKL2.mjs} +12 -12
  134. package/dist/cli/{workflow-AUZCSCZP.js → workflow-CWO3XL4O.js} +20 -20
  135. package/dist/cli/{workflow-C66BBXHH.mjs → workflow-NPZ2RLQG.mjs} +10 -10
  136. package/dist/{client-CmlKSBXd.d.ts → client-CQSPuqxh.d.ts} +1 -1
  137. package/dist/{client-By7bUS8h.d.mts → client-K1g4ab5Y.d.mts} +1 -1
  138. package/dist/{client-core-BZ3tpY_J.d.mts → client-core-BksGf5Gd.d.mts} +1 -1
  139. package/dist/{client-core-BM0mKhgp.d.ts → client-core-BlaqOlQ7.d.ts} +1 -1
  140. package/dist/{compiler-manifest-BeURaD5Y.d.mts → compiler-manifest-BliMS7ax.d.mts} +14 -1
  141. package/dist/{compiler-manifest-BeURaD5Y.d.ts → compiler-manifest-BliMS7ax.d.ts} +14 -1
  142. package/dist/{errors-kBuT4kGK.d.mts → errors-BZ6Zq1cz.d.mts} +1 -1
  143. package/dist/{errors-BoPXPrSy.d.ts → errors-xfNscfS1.d.ts} +1 -1
  144. package/dist/{index-DC7oRAAC.d.mts → index-DbvCg4zg.d.mts} +1 -1
  145. package/dist/{index-D0crdGM1.d.ts → index-FGdQv8J8.d.ts} +1 -1
  146. package/dist/index.d.mts +7 -7
  147. package/dist/index.d.ts +7 -7
  148. package/dist/index.js +13 -13
  149. package/dist/index.mjs +9 -9
  150. package/dist/install-integrity.json +126 -126
  151. package/dist/plays/bundle-play-file.d.mts +3 -3
  152. package/dist/plays/bundle-play-file.d.ts +3 -3
  153. package/dist/plays/bundle-play-file.mjs +1 -1
  154. package/dist/plays/csv-data-input.js +3 -3
  155. package/dist/plays/csv-data-input.mjs +2 -2
  156. package/dist/plays/play-description.d.mts +2 -2
  157. package/dist/plays/play-description.d.ts +2 -2
  158. package/dist/plays/run-request.d.mts +2 -2
  159. package/dist/plays/run-request.d.ts +2 -2
  160. package/dist/plays/run-request.js +3 -3
  161. package/dist/plays/run-request.mjs +2 -2
  162. package/dist/release.d.mts +1 -1
  163. package/dist/release.d.ts +1 -1
  164. package/dist/release.js +2 -2
  165. package/dist/release.mjs +1 -1
  166. package/dist/server.d.mts +4 -4
  167. package/dist/server.d.ts +4 -4
  168. package/dist/server.js +12 -12
  169. package/dist/server.mjs +6 -6
  170. package/package.json +1 -1
  171. package/dist/cli/auth-SM5GLO45.js +0 -43
  172. package/dist/cli/describe-KPGQP4LH.js +0 -50
  173. package/dist/cli/describe-PRT2WQMS.mjs +0 -50
  174. package/dist/cli/git-U353JURQ.js +0 -25
  175. package/dist/cli/search-4ZQOFG7G.js +0 -33
  176. package/dist/cli/sessions-GDSJ72XI.js +0 -18
  177. package/dist/cli/sessions-SP2JL27H.mjs +0 -18
  178. package/dist/cli/skills-SIX5OTNX.js +0 -37
  179. package/dist/cli/tools-EZOV37MQ.js +0 -57
  180. package/dist/cli/update-ISU7YN34.js +0 -35
@@ -1,10 +1,10 @@
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
3
 
4
- var _chunk2CTTSNFEjs = require('./chunk-2CTTSNFE.js');
4
+ var _chunkQG3MRMU5js = require('./chunk-QG3MRMU5.js');
5
5
 
6
6
 
7
- var _chunkALJJRZNJjs = require('./chunk-ALJJRZNJ.js');
7
+ var _chunkT2N3B7IQjs = require('./chunk-T2N3B7IQ.js');
8
8
 
9
9
  // src/config.ts
10
10
 
@@ -382,7 +382,7 @@ function resolveBaseUrlOnly(options) {
382
382
  _optionalChain([options, 'optionalAccess', _36 => _36.baseUrl, 'optionalAccess', _37 => _37.trim, 'call', _38 => _38()]) || autoDetectBaseUrl()
383
383
  );
384
384
  if (!baseUrl) {
385
- throw new (0, _chunkALJJRZNJjs.ConfigError)(
385
+ throw new (0, _chunkT2N3B7IQjs.ConfigError)(
386
386
  `Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`
387
387
  );
388
388
  }
@@ -393,13 +393,13 @@ function resolveConfig(options) {
393
393
  _optionalChain([options, 'optionalAccess', _39 => _39.baseUrl, 'optionalAccess', _40 => _40.trim, 'call', _41 => _41()]) || autoDetectBaseUrl()
394
394
  );
395
395
  if (!baseUrl) {
396
- throw new (0, _chunkALJJRZNJjs.ConfigError)(
396
+ throw new (0, _chunkT2N3B7IQjs.ConfigError)(
397
397
  `Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`
398
398
  );
399
399
  }
400
400
  const apiKey = resolveApiKeyForBaseUrl(baseUrl, _optionalChain([options, 'optionalAccess', _42 => _42.apiKey]));
401
401
  if (!apiKey) {
402
- throw new (0, _chunkALJJRZNJjs.ConfigError)(
402
+ throw new (0, _chunkT2N3B7IQjs.ConfigError)(
403
403
  `No API key found. Set ${API_KEY_ENV}, add it to .env.deepline, or run: deepline auth register`
404
404
  );
405
405
  }
@@ -502,7 +502,7 @@ function findNearestGitCommonDir(startDir) {
502
502
  function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
503
503
  const target = resolveProjectPinTarget(startDir);
504
504
  if (!target.ok) {
505
- throw new (0, _chunkALJJRZNJjs.ConfigError)(
505
+ throw new (0, _chunkT2N3B7IQjs.ConfigError)(
506
506
  `Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
507
507
  ", "
508
508
  )}. Set CLAUDE_PROJECT_DIR or cd into the intended project folder before running this command.`
@@ -711,7 +711,7 @@ function readSkillsVersionFile(path) {
711
711
  }
712
712
  }
713
713
  function resolveAutoSyncSkillAgents() {
714
- switch (_chunk2CTTSNFEjs.detectAgentRuntime.call(void 0, )) {
714
+ switch (_chunkQG3MRMU5js.detectAgentRuntime.call(void 0, )) {
715
715
  case "codex":
716
716
  return ["codex"];
717
717
  case "claude_code":
@@ -781,7 +781,7 @@ function writeSdkSkillsLocalVersion(baseUrl, version, agents) {
781
781
  }
782
782
 
783
783
  // src/http.ts
784
- var HttpClient2 = class extends _chunk2CTTSNFEjs.HttpClient {
784
+ var HttpClient2 = class extends _chunkQG3MRMU5js.HttpClient {
785
785
  constructor(config) {
786
786
  super(config, readSdkSkillsLocalVersion);
787
787
  }
@@ -3,18 +3,18 @@
3
3
  var _chunkD3BCSAN7js = require('./chunk-D3BCSAN7.js');
4
4
 
5
5
 
6
- var _chunkG6PUQQJPjs = require('./chunk-G6PUQQJP.js');
6
+ var _chunkPMS3LQ6Bjs = require('./chunk-PMS3LQ6B.js');
7
7
 
8
8
 
9
- var _chunkCUMA6DE2js = require('./chunk-CUMA6DE2.js');
9
+ var _chunkUW5QWTUGjs = require('./chunk-UW5QWTUG.js');
10
10
 
11
11
 
12
12
 
13
- var _chunkLV2DGEJ3js = require('./chunk-LV2DGEJ3.js');
13
+ var _chunkXEQBYK4Bjs = require('./chunk-XEQBYK4B.js');
14
14
 
15
15
 
16
16
 
17
- var _chunkA253CMOIjs = require('./chunk-A253CMOI.js');
17
+ var _chunkQUSYG3VPjs = require('./chunk-QUSYG3VP.js');
18
18
 
19
19
  // src/cli/commands/search.ts
20
20
  var _commander = require('commander');
@@ -24,7 +24,7 @@ var _fs = require('fs');
24
24
  var _path = require('path');
25
25
  var SEARCH_REF_TTL_MS = 15 * 6e4;
26
26
  function lastSearchPath() {
27
- return _path.join.call(void 0, _chunkA253CMOIjs.sdkCliStateDirPath.call(void 0, _chunkA253CMOIjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
27
+ return _path.join.call(void 0, _chunkQUSYG3VPjs.sdkCliStateDirPath.call(void 0, _chunkQUSYG3VPjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
28
28
  }
29
29
  function rememberSearchRef(searchRef) {
30
30
  writeSearchRefs({ searchRef });
@@ -134,9 +134,9 @@ async function runSearch(queryInputs, options, types, exclude = []) {
134
134
  console.error("--summary-width must be an integer of at least 2.");
135
135
  return 1;
136
136
  }
137
- const client = new (0, _chunkG6PUQQJPjs.DeeplineClient)();
137
+ const client = new (0, _chunkPMS3LQ6Bjs.DeeplineClient)();
138
138
  const json = options.json === true;
139
- const renderer = json ? void 0 : await Promise.resolve().then(() => _interopRequireWildcard(require("./search-output-BG743WAM.js")));
139
+ const renderer = json ? void 0 : await Promise.resolve().then(() => _interopRequireWildcard(require("./search-output-NATLJOWW.js")));
140
140
  const searches = [];
141
141
  const chunks = [];
142
142
  const refs = /* @__PURE__ */ new Map();
@@ -159,7 +159,7 @@ async function runSearch(queryInputs, options, types, exclude = []) {
159
159
  const text = _optionalChain([renderer, 'optionalAccess', _12 => _12.renderSearchResults, 'call', _13 => _13(result, summaryWidth)]);
160
160
  if (!multiple) {
161
161
  if (searchRef) rememberSearchRef(searchRef);
162
- _chunkLV2DGEJ3js.printCommandEnvelope.call(void 0, result, { json, text });
162
+ _chunkXEQBYK4Bjs.printCommandEnvelope.call(void 0, result, { json, text });
163
163
  return 0;
164
164
  }
165
165
  searches.push({ ...result, query });
@@ -173,8 +173,8 @@ ${text}`);
173
173
  }
174
174
  } catch (error) {
175
175
  if (!multiple) throw error;
176
- const payload = _chunkLV2DGEJ3js.errorToJsonPayload.call(void 0, error);
177
- const queryExitCode = _nullishCoalesce(payload.exitCode, () => ( _chunkCUMA6DE2js.resolveSdkCliFailureExitCode.call(void 0, error)));
176
+ const payload = _chunkXEQBYK4Bjs.errorToJsonPayload.call(void 0, error);
177
+ const queryExitCode = _nullishCoalesce(payload.exitCode, () => ( _chunkUW5QWTUGjs.resolveSdkCliFailureExitCode.call(void 0, error)));
178
178
  searches.push({ ...payload, query, exitCode: queryExitCode });
179
179
  if (!json) {
180
180
  console.error(`${JSON.stringify(query)}: ${payload.error.message}`);
@@ -186,7 +186,7 @@ Search failed.
186
186
  }
187
187
  }
188
188
  rememberSearchRefsByTool(refs);
189
- _chunkLV2DGEJ3js.printCommandEnvelope.call(void 0,
189
+ _chunkXEQBYK4Bjs.printCommandEnvelope.call(void 0,
190
190
  { searches },
191
191
  {
192
192
  json,
@@ -1,19 +1,19 @@
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
3
 
4
- var _chunkNXT52SIVjs = require('./chunk-NXT52SIV.js');
4
+ var _chunk6ZLL5GDNjs = require('./chunk-6ZLL5GDN.js');
5
5
 
6
6
 
7
- var _chunkMF7ZVWJKjs = require('./chunk-MF7ZVWJK.js');
7
+ var _chunk7R2V5Z6Ojs = require('./chunk-7R2V5Z6O.js');
8
8
 
9
9
 
10
- var _chunkRLVSWAWBjs = require('./chunk-RLVSWAWB.js');
10
+ var _chunkN6Q5SDGAjs = require('./chunk-N6Q5SDGA.js');
11
11
 
12
12
 
13
- var _chunkLV2DGEJ3js = require('./chunk-LV2DGEJ3.js');
13
+ var _chunkXEQBYK4Bjs = require('./chunk-XEQBYK4B.js');
14
14
 
15
15
 
16
- var _chunkA253CMOIjs = require('./chunk-A253CMOI.js');
16
+ var _chunkQUSYG3VPjs = require('./chunk-QUSYG3VP.js');
17
17
 
18
18
  // src/cli/commands/update.ts
19
19
  var _child_process = require('child_process');
@@ -495,7 +495,7 @@ function normalizedNpmPrefix(value) {
495
495
  }
496
496
  function resolveNpmGlobalPrefix(env) {
497
497
  try {
498
- const plan = _chunkRLVSWAWBjs.resolveShellSpawn.call(void 0,
498
+ const plan = _chunkN6Q5SDGAjs.resolveShellSpawn.call(void 0,
499
499
  "npm",
500
500
  ["prefix", "-g"],
501
501
  process.platform,
@@ -556,8 +556,8 @@ function resolveUpdatePlan(options = {}) {
556
556
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
557
557
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
558
558
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
559
- const npmVersion = options.npmVersion === void 0 ? _chunkNXT52SIVjs.readNpmVersion.call(void 0, env) : options.npmVersion;
560
- const npmGlobalInstallFlags = _chunkNXT52SIVjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
559
+ const npmVersion = options.npmVersion === void 0 ? _chunk6ZLL5GDNjs.readNpmVersion.call(void 0, env) : options.npmVersion;
560
+ const npmGlobalInstallFlags = _chunk6ZLL5GDNjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
561
561
  const args = installPrefix ? [
562
562
  "install",
563
563
  "-g",
@@ -567,7 +567,7 @@ function resolveUpdatePlan(options = {}) {
567
567
  packageSpec
568
568
  ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
569
569
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
570
- _optionalChain([env, 'access', _22 => _22.DEEPLINE_HOST_URL, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]) || _chunkA253CMOIjs.autoDetectBaseUrl.call(void 0, )
570
+ _optionalChain([env, 'access', _22 => _22.DEEPLINE_HOST_URL, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]) || _chunkQUSYG3VPjs.autoDetectBaseUrl.call(void 0, )
571
571
  );
572
572
  return {
573
573
  kind: "npm-global",
@@ -816,7 +816,7 @@ function sidecarInstallFailure(versionDir) {
816
816
  function runCommand(command, args, env = process.env) {
817
817
  return new Promise((resolveResult) => {
818
818
  let output = "";
819
- const plan = _chunkRLVSWAWBjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
819
+ const plan = _chunkN6Q5SDGAjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
820
820
  const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
821
821
  stdio: ["inherit", "pipe", "pipe"],
822
822
  shell: plan.shell,
@@ -1199,14 +1199,14 @@ async function publishedVersionSupportsPin(version, fallbackRegistryUrl) {
1199
1199
  throw _nullishCoalesce(lastError, () => ( new Error("No npm registry was available")));
1200
1200
  }
1201
1201
  async function runUpdateCommand(options, dependencies = {}) {
1202
- const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkA253CMOIjs.autoDetectBaseUrl));
1202
+ const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkQUSYG3VPjs.autoDetectBaseUrl));
1203
1203
  const resolvePlan = _nullishCoalesce(dependencies.resolvePlan, () => ( resolveUpdatePlan));
1204
1204
  const runPlan = _nullishCoalesce(dependencies.runPlan, () => ( runUpdatePlan));
1205
1205
  const syncSkills = _nullishCoalesce(dependencies.syncSkillsIfNeeded, () => ( (async () => {
1206
1206
  const originalWrite = process.stdout.write.bind(process.stdout);
1207
1207
  process.stdout.write = (() => true);
1208
1208
  try {
1209
- const exitCode = await _chunkMF7ZVWJKjs.runSkillsCommand.call(void 0, { json: true });
1209
+ const exitCode = await _chunk7R2V5Z6Ojs.runSkillsCommand.call(void 0, { json: true });
1210
1210
  if (exitCode !== 0) {
1211
1211
  throw new Error(
1212
1212
  `Deepline skills update failed with exit ${exitCode}.`
@@ -1277,11 +1277,11 @@ async function runUpdateCommand(options, dependencies = {}) {
1277
1277
  ]
1278
1278
  };
1279
1279
  if (options.json && !options.executeWithJson) {
1280
- _chunkLV2DGEJ3js.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1280
+ _chunkXEQBYK4Bjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1281
1281
  return 0;
1282
1282
  }
1283
1283
  if (options.printCommand) {
1284
- _chunkLV2DGEJ3js.printCommandEnvelope.call(void 0,
1284
+ _chunkXEQBYK4Bjs.printCommandEnvelope.call(void 0,
1285
1285
  {
1286
1286
  ...plan,
1287
1287
  render: {
@@ -1294,7 +1294,7 @@ async function runUpdateCommand(options, dependencies = {}) {
1294
1294
  return 0;
1295
1295
  }
1296
1296
  if (plan.kind === "source" || plan.kind === "homebrew") {
1297
- _chunkLV2DGEJ3js.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1297
+ _chunkXEQBYK4Bjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1298
1298
  return 0;
1299
1299
  }
1300
1300
  stderr.write(`Updating Deepline SDK/CLI with: ${plan.manualCommand}
@@ -1324,7 +1324,7 @@ To retry with full installer output, run: deepline skills install
1324
1324
  );
1325
1325
  }
1326
1326
  if (options.executeWithJson && options.json) {
1327
- _chunkLV2DGEJ3js.printCommandEnvelope.call(void 0,
1327
+ _chunkXEQBYK4Bjs.printCommandEnvelope.call(void 0,
1328
1328
  {
1329
1329
  ok: true,
1330
1330
  pinnedVersion
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-54IH5U3I.mjs";
3
+ } from "./chunk-Z3KLCDCB.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -8,7 +8,7 @@ var _chunkNTLBZUHDjs = require('./chunk-NTLBZUHD.js');
8
8
 
9
9
 
10
10
 
11
- var _chunkLV2DGEJ3js = require('./chunk-LV2DGEJ3.js');
11
+ var _chunkXEQBYK4Bjs = require('./chunk-XEQBYK4B.js');
12
12
 
13
13
  // src/cli/describe-options.ts
14
14
  function addDescribeOptions(command, options = {}) {
@@ -249,7 +249,7 @@ function projectRunDatasetCell(value) {
249
249
  const logicalValue = parseSerializedDatasetValue(value);
250
250
  if (logicalValue === null || logicalValue === void 0) return logicalValue;
251
251
  if (typeof logicalValue === "object") {
252
- return _chunkLV2DGEJ3js.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
252
+ return _chunkXEQBYK4Bjs.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
253
253
  }
254
254
  return logicalValue;
255
255
  }
@@ -641,7 +641,7 @@ function csvText(rows, columns = []) {
641
641
  rows: rows.map((row) => record(row) ? row : { value: row }),
642
642
  columns
643
643
  });
644
- return _chunkLV2DGEJ3js.csvStringFromRows.call(void 0, projection.rows, projection.columns);
644
+ return _chunkXEQBYK4Bjs.csvStringFromRows.call(void 0, projection.rows, projection.columns);
645
645
  }
646
646
  function writeExecutionOutput(result, options, { skipReceiptFile = false } = {}) {
647
647
  let temp;
@@ -768,7 +768,7 @@ function writeExecutionOutput(result, options, { skipReceiptFile = false } = {})
768
768
  };
769
769
  if (options.receiptOut && !skipReceiptFile) {
770
770
  persist(options.receiptOut, jsonText(receipt));
771
- _chunkLV2DGEJ3js.markJsonOutputHandled.call(void 0, );
771
+ _chunkXEQBYK4Bjs.markJsonOutputHandled.call(void 0, );
772
772
  } else {
773
773
  printReceipt(receipt, options, {
774
774
  data: hasData ? result.data : void 0,
@@ -1027,8 +1027,8 @@ function printReceipt(receipt, options, extra) {
1027
1027
  const text = options.receiptJson ? `${JSON.stringify(receipt, null, 2)}
1028
1028
  ` : receiptText(receipt, options, extra);
1029
1029
  if (options.receiptOut !== void 0) {
1030
- _chunkLV2DGEJ3js.writeRawStderr.call(void 0, text);
1031
- _chunkLV2DGEJ3js.markJsonOutputHandled.call(void 0, );
1030
+ _chunkXEQBYK4Bjs.writeRawStderr.call(void 0, text);
1031
+ _chunkXEQBYK4Bjs.markJsonOutputHandled.call(void 0, );
1032
1032
  } else {
1033
1033
  (dataOnStdout(options) ? process.stderr : process.stdout).write(text);
1034
1034
  }
@@ -16,7 +16,7 @@ var _chunkBN5VKY4Xjs = require('./chunk-BN5VKY4X.js');
16
16
  var _chunkNTLBZUHDjs = require('./chunk-NTLBZUHD.js');
17
17
 
18
18
 
19
- var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
19
+ var _chunkSQWET4SLjs = require('./chunk-SQWET4SL.js');
20
20
 
21
21
  // src/cli/tool-features.ts
22
22
  var VIEWS = {
@@ -100,7 +100,7 @@ async function found(lookup) {
100
100
  try {
101
101
  return await lookup;
102
102
  } catch (error) {
103
- if (error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
103
+ if (error instanceof _chunkSQWET4SLjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
104
104
  return null;
105
105
  }
106
106
  throw error;
@@ -32,6 +32,21 @@ function applyBrand(value, brand) {
32
32
  value: true
33
33
  });
34
34
  }
35
+ function readToolUpstreamResponse(value) {
36
+ if (!isRecord(value)) return void 0;
37
+ const raw = isRecord(value.toolResponse) ? value.toolResponse.rawV2 : null;
38
+ const upstream = _nullishCoalesce(value.upstreamResponse, () => ( (isRecord(raw) ? raw.upstreamResponse : null)));
39
+ if (!isRecord(upstream) || typeof upstream.status !== "number" || !Number.isInteger(upstream.status) || upstream.status < 100 || upstream.status > 599 || !Object.hasOwn(upstream, "body"))
40
+ return void 0;
41
+ return { status: upstream.status, body: upstream.body };
42
+ }
43
+ function attachToolUpstreamResponse(error, response) {
44
+ const upstream = readToolUpstreamResponse(response);
45
+ if (upstream) {
46
+ Object.defineProperty(error, "upstreamResponse", { value: upstream });
47
+ }
48
+ return error;
49
+ }
35
50
  var DeeplineError = class _DeeplineError extends Error {
36
51
  /** HTTP status when the failure crossed an HTTP boundary. */
37
52
 
@@ -351,4 +366,6 @@ function deserializeToolExecutionFailure(message, value, acceptedSchemaVersion)
351
366
 
352
367
 
353
368
 
354
- exports.TOOL_EXECUTION_ERROR_SCHEMA_VERSION = TOOL_EXECUTION_ERROR_SCHEMA_VERSION; exports.SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS = SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS; exports.TOOL_EXECUTION_ERROR_SCHEMA_HEADER = TOOL_EXECUTION_ERROR_SCHEMA_HEADER; exports.DeeplineError = DeeplineError; exports.ToolExecutionError = ToolExecutionError; exports.brandAsToolExecutionError = brandAsToolExecutionError; exports.isProviderTransientFailure = isProviderTransientFailure; exports.ProviderTransientError = ProviderTransientError; exports.getProviderUnavailableReason = getProviderUnavailableReason; exports.isProviderUnavailable = isProviderUnavailable; exports.isProviderWaterfallUnavailableError = isProviderWaterfallUnavailableError; exports.brandAsProviderTransientError = brandAsProviderTransientError; exports.serializeToolExecutionFailure = serializeToolExecutionFailure; exports.deserializeToolExecutionFailure = deserializeToolExecutionFailure;
369
+
370
+
371
+ exports.TOOL_EXECUTION_ERROR_SCHEMA_VERSION = TOOL_EXECUTION_ERROR_SCHEMA_VERSION; exports.SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS = SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS; exports.TOOL_EXECUTION_ERROR_SCHEMA_HEADER = TOOL_EXECUTION_ERROR_SCHEMA_HEADER; exports.readToolUpstreamResponse = readToolUpstreamResponse; exports.attachToolUpstreamResponse = attachToolUpstreamResponse; exports.DeeplineError = DeeplineError; exports.ToolExecutionError = ToolExecutionError; exports.brandAsToolExecutionError = brandAsToolExecutionError; exports.isProviderTransientFailure = isProviderTransientFailure; exports.ProviderTransientError = ProviderTransientError; exports.getProviderUnavailableReason = getProviderUnavailableReason; exports.isProviderUnavailable = isProviderUnavailable; exports.isProviderWaterfallUnavailableError = isProviderWaterfallUnavailableError; exports.brandAsProviderTransientError = brandAsProviderTransientError; exports.serializeToolExecutionFailure = serializeToolExecutionFailure; exports.deserializeToolExecutionFailure = deserializeToolExecutionFailure;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DeeplineError
3
- } from "./chunk-HBL4PM5Q.mjs";
3
+ } from "./chunk-ZPGGW27Q.mjs";
4
4
 
5
5
  // node_modules/csv-parse/dist/esm/sync.js
6
6
  var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
@@ -3,10 +3,10 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
6
+ var _chunkSQWET4SLjs = require('./chunk-SQWET4SL.js');
7
7
 
8
8
  // src/errors.ts
9
- var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunkDIAWYWT5js.DeeplineError {
9
+ var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunkSQWET4SLjs.DeeplineError {
10
10
  __init() {this.outcome = "unknown"}
11
11
 
12
12
 
@@ -28,14 +28,14 @@ var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunkDIAWYWT5j
28
28
  Object.defineProperty(this, "cause", { value: cause, configurable: true });
29
29
  }
30
30
  }, _class);
31
- var AuthError = class extends _chunkDIAWYWT5js.DeeplineError {
31
+ var AuthError = class extends _chunkSQWET4SLjs.DeeplineError {
32
32
  /** Constructed by the SDK when Deepline rejects the caller's credentials. */
33
33
  constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
34
34
  super(message, 401, "AUTH_ERROR");
35
35
  this.name = "AuthError";
36
36
  }
37
37
  };
38
- var RateLimitError = class extends _chunkDIAWYWT5js.DeeplineError {
38
+ var RateLimitError = class extends _chunkSQWET4SLjs.DeeplineError {
39
39
  /** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
40
40
 
41
41
  /** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
@@ -89,13 +89,13 @@ var ToolRateLimitError = class extends RateLimitError {
89
89
  this.networkScope = options.networkScope;
90
90
  this.publicDetails = _nullishCoalesce(options.publicDetails, () => ( null));
91
91
  this.details = options.details;
92
- _chunkDIAWYWT5js.brandAsToolExecutionError.call(void 0, this);
93
- if (_chunkDIAWYWT5js.isProviderTransientFailure.call(void 0, this)) {
94
- _chunkDIAWYWT5js.brandAsProviderTransientError.call(void 0, this);
92
+ _chunkSQWET4SLjs.brandAsToolExecutionError.call(void 0, this);
93
+ if (_chunkSQWET4SLjs.isProviderTransientFailure.call(void 0, this)) {
94
+ _chunkSQWET4SLjs.brandAsProviderTransientError.call(void 0, this);
95
95
  }
96
96
  }
97
97
  };
98
- var ConfigError = class extends _chunkDIAWYWT5js.DeeplineError {
98
+ var ConfigError = class extends _chunkSQWET4SLjs.DeeplineError {
99
99
  /** Construct a local SDK configuration failure. */
100
100
  constructor(message) {
101
101
  super(message, void 0, "CONFIG_ERROR");
@@ -49,7 +49,7 @@ var SDK_RELEASE = {
49
49
  // getters keep their established compatibility behavior.
50
50
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
51
51
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
52
- version: "0.3.514",
52
+ version: "0.3.516",
53
53
  updateSummary: {
54
54
  introducedIn: "0.3.90",
55
55
  summary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release."
@@ -1,16 +1,16 @@
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
3
 
4
- var _chunkA253CMOIjs = require('./chunk-A253CMOI.js');
4
+ var _chunkQUSYG3VPjs = require('./chunk-QUSYG3VP.js');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunk2CTTSNFEjs = require('./chunk-2CTTSNFE.js');
10
+ var _chunkQG3MRMU5js = require('./chunk-QG3MRMU5.js');
11
11
 
12
12
 
13
- var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
13
+ var _chunkSQWET4SLjs = require('./chunk-SQWET4SL.js');
14
14
 
15
15
  // src/cli/failure-reporting.ts
16
16
  var _os = require('os');
@@ -138,7 +138,7 @@ function classifyNetworkCauseCategory(error) {
138
138
  }
139
139
  function isNetworkFailure(error) {
140
140
  if (!(error instanceof Error)) return false;
141
- if (error instanceof _chunkDIAWYWT5js.DeeplineError && error.statusCode) return false;
141
+ if (error instanceof _chunkSQWET4SLjs.DeeplineError && error.statusCode) return false;
142
142
  const code = classifyNetworkFailure(error);
143
143
  return code !== "network_error" || /unable to connect|unable to stream/i.test(error.message);
144
144
  }
@@ -150,7 +150,7 @@ function buildEnvironmentContext() {
150
150
  node_version: process.version,
151
151
  runtime: "Node.js",
152
152
  hostname: _os.hostname.call(void 0, ),
153
- agent_runtime: _chunk2CTTSNFEjs.detectAgentRuntime.call(void 0, )
153
+ agent_runtime: _chunkQG3MRMU5js.detectAgentRuntime.call(void 0, )
154
154
  };
155
155
  for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
156
156
  const normalized = _optionalChain([process, 'access', _5 => _5.env, 'access', _6 => _6[key], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);
@@ -171,18 +171,18 @@ function buildEnvironmentContext() {
171
171
  return context;
172
172
  }
173
173
  function failureReportHeaders(apiKey) {
174
- const agentSessionId = _chunk2CTTSNFEjs.agentSessionIdFromEnvironment.call(void 0, );
174
+ const agentSessionId = _chunkQG3MRMU5js.agentSessionIdFromEnvironment.call(void 0, );
175
175
  return {
176
- ..._chunk2CTTSNFEjs.deploymentProtectionHeaders.call(void 0, ),
176
+ ..._chunkQG3MRMU5js.deploymentProtectionHeaders.call(void 0, ),
177
177
  ...agentSessionId ? { "X-Deepline-Agent-Session-Id": agentSessionId } : {},
178
178
  Authorization: `Bearer ${apiKey}`,
179
179
  "Content-Type": "application/json",
180
- "User-Agent": `deepline-ts-sdk/${_chunk2CTTSNFEjs.SDK_VERSION}`,
180
+ "User-Agent": `deepline-ts-sdk/${_chunkQG3MRMU5js.SDK_VERSION}`,
181
181
  "X-Deepline-Client-Family": "sdk",
182
182
  "X-Deepline-CLI-Family": "sdk",
183
- "X-Deepline-Agent-Runtime": _chunk2CTTSNFEjs.detectAgentRuntime.call(void 0, ),
184
- "X-Deepline-CLI-Version": _chunk2CTTSNFEjs.SDK_VERSION,
185
- "X-Deepline-SDK-Version": _chunk2CTTSNFEjs.SDK_VERSION
183
+ "X-Deepline-Agent-Runtime": _chunkQG3MRMU5js.detectAgentRuntime.call(void 0, ),
184
+ "X-Deepline-CLI-Version": _chunkQG3MRMU5js.SDK_VERSION,
185
+ "X-Deepline-SDK-Version": _chunkQG3MRMU5js.SDK_VERSION
186
186
  };
187
187
  }
188
188
  async function postFailureReport(input) {
@@ -210,7 +210,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
210
210
  if (isFailureReportingDisabled()) return false;
211
211
  let apiKey = "";
212
212
  try {
213
- apiKey = _chunkA253CMOIjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
213
+ apiKey = _chunkQUSYG3VPjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
214
214
  } catch (e2) {
215
215
  return false;
216
216
  }
@@ -237,7 +237,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
237
237
  failure_code: failureCode2,
238
238
  failure_stage: failureStage,
239
239
  error_body: "Automatic Deepline skills installation failed.",
240
- cli_version: _chunk2CTTSNFEjs.SDK_VERSION,
240
+ cli_version: _chunkQG3MRMU5js.SDK_VERSION,
241
241
  context: {
242
242
  environment: buildEnvironmentContext(),
243
243
  skills_sync: {
@@ -268,7 +268,7 @@ function commandTokens(argv) {
268
268
  }
269
269
  function isServerLoggedPlayRunStartFailure(input) {
270
270
  const [subcommand, command] = commandTokens(input.argv);
271
- return subcommand === "plays" && command === "run" && input.error instanceof _chunkDIAWYWT5js.DeeplineError && typeof input.error.statusCode === "number";
271
+ return subcommand === "plays" && command === "run" && input.error instanceof _chunkSQWET4SLjs.DeeplineError && typeof input.error.statusCode === "number";
272
272
  }
273
273
  function shouldReport(input) {
274
274
  if (input.error !== void 0) return true;
@@ -278,7 +278,7 @@ function failureCode(input) {
278
278
  if (input.error !== void 0) {
279
279
  if (isNetworkFailure(input.error))
280
280
  return classifyNetworkFailure(input.error);
281
- if (input.error instanceof _chunkDIAWYWT5js.DeeplineError && input.error.code) {
281
+ if (input.error instanceof _chunkSQWET4SLjs.DeeplineError && input.error.code) {
282
282
  return input.error.code;
283
283
  }
284
284
  if (input.error instanceof Error && input.error.name)
@@ -301,7 +301,7 @@ function resolvedFailureKind(input) {
301
301
  return input.error === void 0 ? "command_exit" : "uncaught_exception";
302
302
  }
303
303
  function safeRequestDiagnostics(error) {
304
- if (!(error instanceof _chunkDIAWYWT5js.DeeplineError)) return null;
304
+ if (!(error instanceof _chunkSQWET4SLjs.DeeplineError)) return null;
305
305
  const request = _optionalChain([error, 'access', _27 => _27.details, 'optionalAccess', _28 => _28.request]);
306
306
  if (!request || typeof request !== "object" || Array.isArray(request))
307
307
  return null;
@@ -357,7 +357,7 @@ function buildFailureReport(input) {
357
357
  failure_kind: failureKind,
358
358
  failure_code: code,
359
359
  failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
360
- cli_version: _chunk2CTTSNFEjs.SDK_VERSION,
360
+ cli_version: _chunkQG3MRMU5js.SDK_VERSION,
361
361
  context: {
362
362
  base_url: redactFailureText(input.baseUrl, 400),
363
363
  command_summary: sanitizeCommand(input.argv),
@@ -377,8 +377,8 @@ async function maybeReportSdkCliFailure(input) {
377
377
  if (isServerLoggedPlayRunStartFailure(input)) return false;
378
378
  const exitCode = resolvedExitCode(input);
379
379
  if (!shouldReport({ exitCode, error: input.error })) return false;
380
- const baseUrl = _chunkA253CMOIjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
381
- const apiKey = _chunkA253CMOIjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
380
+ const baseUrl = _chunkQUSYG3VPjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
381
+ const apiKey = _chunkQUSYG3VPjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
382
382
  if (!apiKey) return false;
383
383
  return postFailureReport({
384
384
  baseUrl,
@@ -2,14 +2,15 @@ import {
2
2
  HttpClient,
3
3
  resolveCliCommandContext,
4
4
  resolveConfig
5
- } from "./chunk-6OIRN4PC.mjs";
5
+ } from "./chunk-ZFRN3B2R.mjs";
6
6
  import {
7
7
  detectAgentRuntime
8
- } from "./chunk-6SSISVXD.mjs";
8
+ } from "./chunk-PVVWKOEB.mjs";
9
9
  import {
10
10
  DeeplineError,
11
+ readToolUpstreamResponse,
11
12
  serializeToolExecutionFailure
12
- } from "./chunk-HBL4PM5Q.mjs";
13
+ } from "./chunk-ZPGGW27Q.mjs";
13
14
 
14
15
  // src/cli/json-fields.ts
15
16
  var RUN_FIELDS = new Set(
@@ -922,6 +923,7 @@ function formatToolExecutionErrorDiagnostic(error) {
922
923
  function errorToJsonPayload(error) {
923
924
  const message = error instanceof Error ? error.message : String(error);
924
925
  const toolFailure = cliToolExecutionFailure(error);
926
+ const upstreamResponse = readToolUpstreamResponse(error);
925
927
  const maybeRecord = error && typeof error === "object" ? error : null;
926
928
  const code = typeof maybeRecord?.code === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
927
929
  const details = {};
@@ -964,6 +966,7 @@ function errorToJsonPayload(error) {
964
966
  message,
965
967
  code,
966
968
  ...toolFailure ? { tool_error: toolFailure } : {},
969
+ ...upstreamResponse ? { upstreamResponse } : {},
967
970
  ...Object.keys(details).length > 0 ? { details } : {}
968
971
  }
969
972
  };