deepline 0.3.325 → 0.3.327

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 (128) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +23 -25
  2. package/dist/bundling-sources/sdk/src/compat.ts +11 -6
  3. package/dist/bundling-sources/sdk/src/db/query.ts +172 -0
  4. package/dist/bundling-sources/sdk/src/errors.ts +35 -0
  5. package/dist/bundling-sources/sdk/src/index.ts +13 -0
  6. package/dist/bundling-sources/sdk/src/play.ts +34 -31
  7. package/dist/bundling-sources/sdk/src/plays/authoring-graph-path.ts +13 -0
  8. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -1
  9. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +189 -0
  10. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  11. package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
  12. package/dist/bundling-sources/shared_libs/play-runtime/projection.ts +11 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +98 -11
  14. package/dist/cli/auth-67YOPQ6M.js +31 -0
  15. package/dist/cli/{auth-PIZESRPC.mjs → auth-EBBDOKNV.mjs} +4 -4
  16. package/dist/cli/{billing-DQKFCQV5.js → billing-6AAB7WPJ.js} +70 -70
  17. package/dist/cli/{billing-HSL6VTCM.mjs → billing-IM2QUFX4.mjs} +4 -4
  18. package/dist/cli/{chunk-WW4XZIVM.mjs → chunk-3ITDKXNC.mjs} +12 -9
  19. package/dist/cli/{chunk-K7FC5IUU.js → chunk-3MXRNPBN.js} +1 -1
  20. package/dist/cli/{chunk-DLW7X2UK.js → chunk-4TO56P22.js} +5928 -5730
  21. package/dist/cli/{chunk-MNKDSR2J.js → chunk-4ZARCCPT.js} +344 -254
  22. package/dist/cli/{chunk-PBNZXZCW.js → chunk-77RAV5XX.js} +48 -48
  23. package/dist/cli/{chunk-HUKWYHBG.js → chunk-7RCJDAJX.js} +2 -2
  24. package/dist/cli/{chunk-5TYU3UIS.mjs → chunk-A5SKM3GL.mjs} +1 -1
  25. package/dist/cli/{chunk-XNL3SEMC.js → chunk-AFNEQ43J.js} +8 -3
  26. package/dist/cli/{chunk-XSEMQ4II.js → chunk-AGH6YP2T.js} +2 -1
  27. package/dist/cli/chunk-AID3OYVJ.js +8 -0
  28. package/dist/cli/{chunk-YE3O2UHM.mjs → chunk-CCRQ2VGJ.mjs} +24 -1
  29. package/dist/cli/{chunk-HPTQEWCF.js → chunk-CISKBOXD.js} +70 -67
  30. package/dist/cli/{chunk-OPERWJR6.mjs → chunk-D6GD5AVN.mjs} +3 -3
  31. package/dist/cli/{chunk-6RMKHN7S.mjs → chunk-DCAU6PND.mjs} +4 -20
  32. package/dist/cli/{chunk-PVDQ55PS.js → chunk-DM3SHV6U.js} +29 -6
  33. package/dist/cli/{chunk-CV5GDCKN.js → chunk-DSDX6EUW.js} +29 -45
  34. package/dist/cli/{chunk-5FHU7TV4.mjs → chunk-DVV4FPS7.mjs} +2 -2
  35. package/dist/cli/{chunk-AQUNQJ5Y.mjs → chunk-F45425TB.mjs} +1 -1
  36. package/dist/cli/{chunk-NWBARG3F.mjs → chunk-G5774EFF.mjs} +1 -1
  37. package/dist/cli/chunk-GVESPYSY.mjs +234 -0
  38. package/dist/cli/{chunk-H5TJBRSC.mjs → chunk-HOWQKN6J.mjs} +98 -113
  39. package/dist/cli/{chunk-UYFWTIKF.js → chunk-HZZJR2GV.js} +26 -26
  40. package/dist/cli/{chunk-76VKBPOC.mjs → chunk-JOA6IKDE.mjs} +7 -2
  41. package/dist/cli/chunk-LVEDPCLJ.js +234 -0
  42. package/dist/cli/{chunk-KZNFYOHX.js → chunk-MOP6D7Z5.js} +6 -6
  43. package/dist/cli/{chunk-YXRPWMGN.js → chunk-NWIJLTRL.js} +147 -162
  44. package/dist/cli/chunk-OVDNJAJN.mjs +8 -0
  45. package/dist/cli/{chunk-XIVUB36F.mjs → chunk-QZAP5VOS.mjs} +104 -14
  46. package/dist/cli/{chunk-6VZDSBK6.mjs → chunk-REP2MYBI.mjs} +2 -2
  47. package/dist/cli/{chunk-PWV2M4LW.mjs → chunk-RSEVBSFE.mjs} +1 -1
  48. package/dist/cli/{chunk-OOPSX57I.js → chunk-TAGHNT5P.js} +6 -6
  49. package/dist/cli/{chunk-QQ2FG5W3.js → chunk-UROXKPND.js} +6 -6
  50. package/dist/cli/{chunk-7PZFGB7L.mjs → chunk-YIY74KUF.mjs} +2 -1
  51. package/dist/cli/{chunk-7MD453WV.mjs → chunk-ZOFARJWH.mjs} +5674 -5476
  52. package/dist/cli/client-7LZCG4VD.js +20 -0
  53. package/dist/cli/{client-57SR4KVM.mjs → client-JCMSACT4.mjs} +3 -3
  54. package/dist/cli/{csv-G2FRMOXL.mjs → csv-NPMWVM5D.mjs} +3 -3
  55. package/dist/cli/{csv-5DJSC6BD.js → csv-OILKDKUX.js} +12 -12
  56. package/dist/cli/{db-WWZEXM3N.mjs → db-AZUAOWPQ.mjs} +214 -137
  57. package/dist/cli/{db-NVO7P4VO.js → db-MNDRYYEX.js} +226 -149
  58. package/dist/cli/{describe-26OMF3A4.mjs → describe-KJWOHMKC.mjs} +12 -11
  59. package/dist/cli/{describe-M26LHDBQ.js → describe-QENLDLM2.js} +28 -27
  60. package/dist/cli/{executions-KI47LPKE.js → executions-P36UHBPG.js} +6 -6
  61. package/dist/cli/{executions-2LLHY3IL.mjs → executions-QZNQWF6F.mjs} +4 -4
  62. package/dist/cli/{feedback-2Y26C2BZ.js → feedback-K4UGTLFD.js} +6 -6
  63. package/dist/cli/{feedback-O26VL2OF.mjs → feedback-RQ6HSZSG.mjs} +3 -3
  64. package/dist/cli/{git-UVPGZN3K.mjs → git-PBRMCBMI.mjs} +4 -4
  65. package/dist/cli/git-RPFH3NJ2.js +23 -0
  66. package/dist/cli/index.js +105 -87
  67. package/dist/cli/index.mjs +65 -47
  68. package/dist/cli/{legacy-noops-IK5CH72U.mjs → legacy-noops-G7GWJ5UC.mjs} +4 -4
  69. package/dist/cli/{legacy-noops-H6Y3SEVB.js → legacy-noops-X74FM35Q.js} +7 -7
  70. package/dist/cli/{monitors-SFVVMAJT.mjs → monitors-KL2MCR57.mjs} +4 -4
  71. package/dist/cli/{monitors-JL6TTQCI.js → monitors-VKURX3YM.js} +85 -85
  72. package/dist/cli/{org-SSDONL57.mjs → org-DT53KTNW.mjs} +4 -4
  73. package/dist/cli/{org-OVMAZCQS.js → org-ZYXJDC44.js} +60 -60
  74. package/dist/cli/play-BUQV47E2.js +153 -0
  75. package/dist/cli/{play-X6NPACUO.mjs → play-WIJGQYTB.mjs} +11 -10
  76. package/dist/cli/{providers-E24JDWSR.js → providers-GRTW4TXX.js} +7 -7
  77. package/dist/cli/{providers-ONUBYYY4.mjs → providers-GYGKGS2J.mjs} +4 -4
  78. package/dist/cli/{quickstart-TB7C3DLG.js → quickstart-WB26543C.js} +5 -5
  79. package/dist/cli/{quickstart-B7NIXACV.mjs → quickstart-XF3M2M2S.mjs} +3 -3
  80. package/dist/cli/{search-N3QUIATW.mjs → search-ANJLTOF2.mjs} +5 -5
  81. package/dist/cli/search-CR2GZLCM.js +26 -0
  82. package/dist/cli/{secrets-CPCVFDYB.js → secrets-5KBUGMTK.js} +13 -13
  83. package/dist/cli/{secrets-V7Z4M67T.mjs → secrets-D6UR5CTW.mjs} +4 -4
  84. package/dist/cli/{sessions-E4FIZLQP.js → sessions-46PXFULL.js} +5 -5
  85. package/dist/cli/{sessions-PDOBKAKO.mjs → sessions-S7N4JEWK.mjs} +4 -4
  86. package/dist/cli/{settings-UVM2WDE4.js → settings-KMNBITSU.js} +74 -74
  87. package/dist/cli/{settings-QYHYHZDI.mjs → settings-V6U3SRTH.mjs} +7 -7
  88. package/dist/cli/{setup-3JFAXQLJ.js → setup-4K5FY6AU.js} +41 -41
  89. package/dist/cli/{setup-4RLAETDW.mjs → setup-OGITSLTN.mjs} +6 -6
  90. package/dist/cli/skills-4FP2MZKL.js +28 -0
  91. package/dist/cli/{skills-ZX2JSWOZ.mjs → skills-AXWAYPBY.mjs} +4 -4
  92. package/dist/cli/tools-7YZPH6WC.js +39 -0
  93. package/dist/cli/{tools-EGXCVIPJ.mjs → tools-LJCY6B23.mjs} +8 -7
  94. package/dist/cli/update-3VUOW6AP.js +28 -0
  95. package/dist/cli/{update-7FEKRQFE.mjs → update-DDR5XIUB.mjs} +6 -6
  96. package/dist/cli/{workflow-54VCKIG2.js → workflow-7CTCDWL3.js} +15 -15
  97. package/dist/cli/{workflow-7V7TTTKK.mjs → workflow-PRNCVANQ.mjs} +5 -5
  98. package/dist/{client-Bb4Jjzmj.d.ts → client-DHq8dJ56.d.ts} +39 -11
  99. package/dist/{client-COa-3GHK.d.mts → client-wiWPZhnI.d.mts} +39 -11
  100. package/dist/{compiler-manifest-CsnWj-AK.d.mts → compiler-manifest-9TkZ_ykI.d.mts} +711 -711
  101. package/dist/{compiler-manifest-CsnWj-AK.d.ts → compiler-manifest-9TkZ_ykI.d.ts} +711 -711
  102. package/dist/index-B-5_Xhud.d.mts +75 -0
  103. package/dist/index-ykksoEyR.d.ts +75 -0
  104. package/dist/index.d.mts +52 -13
  105. package/dist/index.d.ts +52 -13
  106. package/dist/index.js +142 -68
  107. package/dist/index.mjs +102 -28
  108. package/dist/install-integrity.json +91 -84
  109. package/dist/plays/bundle-play-file.d.mts +7 -75
  110. package/dist/plays/bundle-play-file.d.ts +7 -75
  111. package/dist/plays/bundle-play-file.mjs +1 -1
  112. package/dist/plays/run-request.d.mts +2 -2
  113. package/dist/plays/run-request.d.ts +2 -2
  114. package/dist/release.d.mts +1 -1
  115. package/dist/release.d.ts +1 -1
  116. package/dist/release.js +2 -2
  117. package/dist/release.mjs +1 -1
  118. package/package.json +1 -1
  119. package/dist/cli/auth-RXCD4GOV.js +0 -31
  120. package/dist/cli/chunk-OWJZUE3Y.mjs +0 -103
  121. package/dist/cli/chunk-SDK3ZA2C.js +0 -103
  122. package/dist/cli/client-562MULXK.js +0 -20
  123. package/dist/cli/git-KGPX5YPD.js +0 -23
  124. package/dist/cli/play-3DB4MSHN.js +0 -152
  125. package/dist/cli/search-NJ637YGQ.js +0 -26
  126. package/dist/cli/skills-BYRYG64R.js +0 -28
  127. package/dist/cli/tools-TAWOAY5X.js +0 -38
  128. package/dist/cli/update-H24GEBXM.js +0 -28
@@ -3,11 +3,14 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkXNL3SEMCjs = require('./chunk-XNL3SEMC.js');
6
+ var _chunkAFNEQ43Jjs = require('./chunk-AFNEQ43J.js');
7
7
 
8
8
 
9
+ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
9
10
 
10
- var _chunkKZNFYOHXjs = require('./chunk-KZNFYOHX.js');
11
+
12
+
13
+ var _chunkMOP6D7Z5js = require('./chunk-MOP6D7Z5.js');
11
14
 
12
15
 
13
16
 
@@ -18,14 +21,14 @@ var _chunkKZNFYOHXjs = require('./chunk-KZNFYOHX.js');
18
21
  var _chunkNXDRDJ4Kjs = require('./chunk-NXDRDJ4K.js');
19
22
 
20
23
 
21
- var _chunkMNKDSR2Jjs = require('./chunk-MNKDSR2J.js');
22
24
 
25
+ var _chunk4ZARCCPTjs = require('./chunk-4ZARCCPT.js');
23
26
 
24
27
 
25
28
 
26
29
 
27
- var _chunkQJBJZVG6js = require('./chunk-QJBJZVG6.js');
28
30
 
31
+ var _chunkQJBJZVG6js = require('./chunk-QJBJZVG6.js');
29
32
 
30
33
 
31
34
 
@@ -33,11 +36,11 @@ var _chunkQJBJZVG6js = require('./chunk-QJBJZVG6.js');
33
36
 
34
37
 
35
38
 
36
- var _chunkQQ2FG5W3js = require('./chunk-QQ2FG5W3.js');
39
+ var _chunkUROXKPNDjs = require('./chunk-UROXKPND.js');
37
40
 
38
41
 
39
42
 
40
- var _chunkPVDQ55PSjs = require('./chunk-PVDQ55PS.js');
43
+ var _chunkDM3SHV6Ujs = require('./chunk-DM3SHV6U.js');
41
44
 
42
45
 
43
46
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -82,10 +85,10 @@ var ToolCallRecovery = class _ToolCallRecovery {
82
85
  }
83
86
  };
84
87
  function pendingToolExecutionPath(input) {
85
- const config = _chunkPVDQ55PSjs.resolveConfig.call(void 0, );
88
+ const config = _chunkDM3SHV6Ujs.resolveConfig.call(void 0, );
86
89
  const fingerprint = _crypto.createHash.call(void 0, "sha256").update(config.baseUrl).update("\0").update(_crypto.createHash.call(void 0, "sha256").update(config.apiKey).digest("hex")).update("\0").update(input.toolId).update("\0").update(_chunkNXDRDJ4Kjs.stableStringify.call(void 0, input.params)).update("\0").update(input.responseIntent).digest("hex");
87
90
  return _path.join.call(void 0,
88
- _chunkPVDQ55PSjs.sdkCliStateDirPath.call(void 0, config.baseUrl),
91
+ _chunkDM3SHV6Ujs.sdkCliStateDirPath.call(void 0, config.baseUrl),
89
92
  `pending-tool-execution-${fingerprint}.json`
90
93
  );
91
94
  }
@@ -517,12 +520,12 @@ function categoryEnumerationRender(summaries) {
517
520
  };
518
521
  }
519
522
  async function listToolCategories(emitJson, compact) {
520
- const client = new (0, _chunkMNKDSR2Jjs.DeeplineClient)();
523
+ const client = new (0, _chunk4ZARCCPTjs.DeeplineClient)();
521
524
  const rawTools = await client.listTools({ compact });
522
525
  const items = rawTools.map(toListedTool);
523
526
  const summaries = aggregateCategorySummaries(rawTools);
524
527
  const outputItems = compact ? items.map(compactTool) : items;
525
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
528
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
526
529
  {
527
530
  tools: outputItems,
528
531
  count: outputItems.length,
@@ -541,7 +544,7 @@ function unknownCategoryError(category, summaries, emitJson) {
541
544
  const known = summaries.map((item) => item.name);
542
545
  const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
543
546
  if (emitJson) {
544
- _chunkQQ2FG5W3js.printJson.call(void 0, {
547
+ _chunkUROXKPNDjs.printJson.call(void 0, {
545
548
  ok: false,
546
549
  exitCode: 4,
547
550
  code: "TOOL_CATEGORY_NOT_FOUND",
@@ -555,13 +558,13 @@ function unknownCategoryError(category, summaries, emitJson) {
555
558
  const render = categoryEnumerationRender(summaries);
556
559
  console.error(message);
557
560
  console.error("");
558
- console.error(_chunkQQ2FG5W3js.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
561
+ console.error(_chunkUROXKPNDjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
559
562
  console.error("");
560
563
  console.error(`Valid categories: ${known.join(", ")}`);
561
564
  return 4;
562
565
  }
563
566
  async function listToolsInCategory(category, emitJson) {
564
- const client = new (0, _chunkMNKDSR2Jjs.DeeplineClient)();
567
+ const client = new (0, _chunk4ZARCCPTjs.DeeplineClient)();
565
568
  const rawTools = await client.listTools({
566
569
  categories: category,
567
570
  compact: false
@@ -598,7 +601,7 @@ async function listToolsInCategory(category, emitJson) {
598
601
  }
599
602
  ]
600
603
  };
601
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
604
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
602
605
  {
603
606
  category,
604
607
  total: rows.length,
@@ -611,7 +614,7 @@ async function listToolsInCategory(category, emitJson) {
611
614
  return 0;
612
615
  }
613
616
  async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
614
- const client = new (0, _chunkMNKDSR2Jjs.DeeplineClient)();
617
+ const client = new (0, _chunk4ZARCCPTjs.DeeplineClient)();
615
618
  const items = (await client.listTools({
616
619
  categories: requestedCategories.join(","),
617
620
  compact
@@ -640,7 +643,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
640
643
  ]
641
644
  };
642
645
  const outputItems = compact ? items.map(compactTool) : items;
643
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
646
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
644
647
  {
645
648
  tools: outputItems,
646
649
  count: outputItems.length,
@@ -659,13 +662,13 @@ async function listTools(category, options = {}) {
659
662
  const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]), () => ( ""));
660
663
  const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
661
664
  const compact = options.compact !== false;
662
- const emitJson = options.json === true || _chunkQQ2FG5W3js.shouldEmitJson.call(void 0, );
665
+ const emitJson = options.json === true || _chunkUROXKPNDjs.shouldEmitJson.call(void 0, );
663
666
  if (positional && flagCategories.length > 0) {
664
667
  const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
665
668
  if (!flagIsSameSingle) {
666
669
  const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
667
670
  if (emitJson) {
668
- _chunkQQ2FG5W3js.printJson.call(void 0, {
671
+ _chunkUROXKPNDjs.printJson.call(void 0, {
669
672
  ok: false,
670
673
  exitCode: 2,
671
674
  code: "TOOL_LIST_CATEGORY_CONFLICT",
@@ -692,7 +695,7 @@ async function grepTools(queryInput, options = {}) {
692
695
  console.error("Usage: deepline tools grep <query> [--json]");
693
696
  return 1;
694
697
  }
695
- const client = new (0, _chunkMNKDSR2Jjs.DeeplineClient)();
698
+ const client = new (0, _chunk4ZARCCPTjs.DeeplineClient)();
696
699
  const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
697
700
  const mode = _nullishCoalesce(options.mode, () => ( "all"));
698
701
  const jsonOutput = options.json === true;
@@ -735,7 +738,7 @@ async function grepTools(queryInput, options = {}) {
735
738
  query,
736
739
  mode
737
740
  }) : null;
738
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
741
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
739
742
  {
740
743
  tools: outputTools,
741
744
  count: outputTools.length,
@@ -753,7 +756,7 @@ async function grepTools(queryInput, options = {}) {
753
756
  } : {},
754
757
  commandTemplates: TOOL_COMMAND_TEMPLATES
755
758
  },
756
- { json: options.json || _chunkQQ2FG5W3js.shouldEmitJson.call(void 0, ) }
759
+ { json: options.json || _chunkUROXKPNDjs.shouldEmitJson.call(void 0, ) }
757
760
  );
758
761
  return 0;
759
762
  }
@@ -909,7 +912,7 @@ Examples:
909
912
  json: Boolean(options.json)
910
913
  });
911
914
  });
912
- _chunkKZNFYOHXjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
915
+ _chunkMOP6D7Z5js.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
913
916
  tools.command("grep <query>").description(
914
917
  "Literal grep over tool ids, descriptions, categories, and input fields."
915
918
  ).addHelpText(
@@ -1010,7 +1013,7 @@ Examples:
1010
1013
  process.exitCode = await narrowView();
1011
1014
  return;
1012
1015
  }
1013
- const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-M26LHDBQ.js")));
1016
+ const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-QENLDLM2.js")));
1014
1017
  process.exitCode = await describeAnything(
1015
1018
  toolId,
1016
1019
  { ...options, kinds: ["tools", "monitors"], fetchedTool: metadata },
@@ -1020,12 +1023,12 @@ Examples:
1020
1023
  });
1021
1024
  };
1022
1025
  addToolMetadataCommand(
1023
- _chunkXNL3SEMCjs.addDescribeOptions.call(void 0,
1026
+ _chunkAFNEQ43Jjs.addDescribeOptions.call(void 0,
1024
1027
  tools.command("describe <toolId>", { hidden: true }).alias("get"),
1025
1028
  { json: false }
1026
1029
  )
1027
1030
  );
1028
- tools.command("execute <toolId>").description("Execute a tool by id.").addHelpText(
1031
+ tools.command("execute <toolId>").alias("call").description("Execute a tool by id.").addHelpText(
1029
1032
  "after",
1030
1033
  `
1031
1034
  Notes:
@@ -1084,22 +1087,7 @@ Examples:
1084
1087
  "--recovery-timeout-ms <milliseconds>",
1085
1088
  "Maximum wait for a keyed execution to finish (default: 900000)"
1086
1089
  ).action(async (toolId, options) => {
1087
- const args = [
1088
- toolId,
1089
- ...options.param.flatMap((value) => ["--param", value]),
1090
- ...options.json === true ? ["--json"] : [],
1091
- ...typeof options.json === "string" ? ["--json", options.json] : [],
1092
- ...options.input ? ["--input", options.input] : [],
1093
- ...options.payload ? ["--payload", options.payload] : [],
1094
- ...options.timeout ? ["--timeout", options.timeout] : [],
1095
- ...options.outputFormat ? ["--output-format", options.outputFormat] : [],
1096
- ...options.out ? ["--out", options.out] : [],
1097
- ...options.preview === false ? ["--no-preview"] : [],
1098
- ...options.idempotencyKey ? ["--idempotency-key", options.idempotencyKey] : [],
1099
- ...options.recover ? ["--recover"] : [],
1100
- ...options.recoveryTimeoutMs ? ["--recovery-timeout-ms", options.recoveryTimeoutMs] : []
1101
- ];
1102
- process.exitCode = await executeTool(args);
1090
+ process.exitCode = await executeTool(toolId, options);
1103
1091
  });
1104
1092
  }
1105
1093
  async function getTool(toolId, options = {}, compatibilityMetadata) {
@@ -1107,7 +1095,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1107
1095
  console.error("Usage: deepline tools describe <toolId> [--json]");
1108
1096
  return 1;
1109
1097
  }
1110
- const client = new (0, _chunkMNKDSR2Jjs.DeeplineClient)();
1098
+ const client = new (0, _chunk4ZARCCPTjs.DeeplineClient)();
1111
1099
  let tool;
1112
1100
  try {
1113
1101
  tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
@@ -1161,7 +1149,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1161
1149
  const lines = toolPricingOnlyLines(tool, toolId);
1162
1150
  if (inferenceQuote)
1163
1151
  lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
1164
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
1152
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
1165
1153
  {
1166
1154
  toolId: String(tool.toolId || toolId),
1167
1155
  cost: Capability.fromCatalogEntry(tool).describe().customerCost(),
@@ -1179,7 +1167,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1179
1167
  }
1180
1168
  if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !isMonitorTypeTool(tool) && !isPlayLikeTool(tool) && (options.json || options.contractJson)) {
1181
1169
  const contract = toolContractJsonForDescribe(tool, toolId);
1182
- _chunkQQ2FG5W3js.printCompactJson.call(void 0, {
1170
+ _chunkUROXKPNDjs.printCompactJson.call(void 0, {
1183
1171
  toolId: contract.toolId,
1184
1172
  ...options.schemaOnly ? {
1185
1173
  inputSchema: contract.inputSchema,
@@ -1202,7 +1190,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1202
1190
  return 0;
1203
1191
  }
1204
1192
  if (options.contractJson) {
1205
- _chunkQQ2FG5W3js.printCompactJson.call(void 0, {
1193
+ _chunkUROXKPNDjs.printCompactJson.call(void 0, {
1206
1194
  ...toolContractJsonForDescribe(tool, toolId),
1207
1195
  ...modelDescription ? { modelOptions: modelDescription } : {},
1208
1196
  ...inferenceQuote ? { inferenceQuote } : {}
@@ -1211,7 +1199,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1211
1199
  }
1212
1200
  const emitJson = options.json === true;
1213
1201
  if (emitJson) {
1214
- _chunkQQ2FG5W3js.printCompactJson.call(void 0, {
1202
+ _chunkUROXKPNDjs.printCompactJson.call(void 0, {
1215
1203
  ...toolMetadataJsonForDescribe(tool, toolId),
1216
1204
  ...modelDescription ? { modelOptions: modelDescription } : {},
1217
1205
  ...inferenceQuote ? { inferenceQuote } : {}
@@ -1242,8 +1230,8 @@ ${formatModelDescription(modelDescription)}`);
1242
1230
  if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
1243
1231
  return 0;
1244
1232
  }
1245
- if (_chunkQQ2FG5W3js.shouldEmitJson.call(void 0, )) {
1246
- _chunkQQ2FG5W3js.printCompactJson.call(void 0, {
1233
+ if (_chunkUROXKPNDjs.shouldEmitJson.call(void 0, )) {
1234
+ _chunkUROXKPNDjs.printCompactJson.call(void 0, {
1247
1235
  ...toolContractJsonForDescribe(tool, toolId),
1248
1236
  ...modelDescription ? { modelOptions: modelDescription } : {},
1249
1237
  ...inferenceQuote ? { inferenceQuote } : {}
@@ -1527,7 +1515,7 @@ function describedTool(tool, requestedToolId) {
1527
1515
  description,
1528
1516
  cost: stringField2(recordField(tool, "pricing"), "displayText") || void 0,
1529
1517
  guidance: [],
1530
- inputs: _chunkXNL3SEMCjs.schemaFields.call(void 0,
1518
+ inputs: _chunkAFNEQ43Jjs.schemaFields.call(void 0,
1531
1519
  recordField(tool, "payload_schema", "payloadSchema")
1532
1520
  ),
1533
1521
  outputs: [],
@@ -1559,7 +1547,7 @@ function describedTool(tool, requestedToolId) {
1559
1547
  "rawToolOutputPaths"
1560
1548
  ).map((path) => String(path).replace(/^toolResponse\.raw\./, ""));
1561
1549
  const node = roots.flatMap((root) => paths.map((path) => schemaNodeAt(root, path))).find(isRecord);
1562
- const { fields, ...typed } = _chunkXNL3SEMCjs.schemaField.call(void 0, name, node, true);
1550
+ const { fields, ...typed } = _chunkAFNEQ43Jjs.schemaField.call(void 0, name, node, true);
1563
1551
  const valueType = stringField2(_nullishCoalesce(details.get(name), () => ( {})), "valueType");
1564
1552
  const field = {
1565
1553
  ...typed,
@@ -1594,12 +1582,12 @@ function describedTool(tool, requestedToolId) {
1594
1582
  (line) => typeof line === "string" && /[a-z0-9]/i.test(line)
1595
1583
  )
1596
1584
  ],
1597
- rateLimit: _chunkXNL3SEMCjs.rateLimitSummary.call(void 0,
1585
+ rateLimit: _chunkAFNEQ43Jjs.rateLimitSummary.call(void 0,
1598
1586
  recordField(contract, "executionMetadata").configuredRateLimits
1599
1587
  ),
1600
- inputs: _chunkXNL3SEMCjs.schemaFields.call(void 0, jsonSchemaOf(recordField(contract, "inputSchema"))),
1588
+ inputs: _chunkAFNEQ43Jjs.schemaFields.call(void 0, jsonSchemaOf(recordField(contract, "inputSchema"))),
1601
1589
  outputs: [...lists, ...values].map(({ field }) => field),
1602
- rawResponse: _chunkXNL3SEMCjs.schemaFields.call(void 0, outputSchema),
1590
+ rawResponse: _chunkAFNEQ43Jjs.schemaFields.call(void 0, outputSchema),
1603
1591
  runner: playReference ? { via: "play", reference: playReference } : { via: "tool", toolId: String(contract.toolId) }
1604
1592
  };
1605
1593
  }
@@ -1808,6 +1796,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
1808
1796
  console.log(`Use in a play:`);
1809
1797
  console.log("```ts");
1810
1798
  console.log("const result = await ctx.tools.execute({");
1799
+ console.log(" staleAfterSeconds: 0,");
1811
1800
  console.log(` id: '${stableStepIdForTool(toolId)}',`);
1812
1801
  console.log(` tool: '${toolId}',`);
1813
1802
  console.log(
@@ -2423,9 +2412,9 @@ function apifySyncRecoveryNext(rawResponse) {
2423
2412
  const getDatasetItemsTool = stringField2(getDatasetItems, "tool");
2424
2413
  const getDatasetItemsPayload = recordField(getDatasetItems, "payload");
2425
2414
  return {
2426
- getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote(JSON.stringify(getActorRunPayload))} --json`,
2415
+ getActorRun: `deepline tools execute ${getActorRunTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getActorRunPayload))} --json`,
2427
2416
  ...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
2428
- getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote(JSON.stringify(getDatasetItemsPayload))} --json`
2417
+ getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getDatasetItemsPayload))} --json`
2429
2418
  } : {}
2430
2419
  };
2431
2420
  }
@@ -2545,87 +2534,63 @@ function parseJsonObjectArgument(raw, flagName) {
2545
2534
  }
2546
2535
  return parsed;
2547
2536
  }
2548
- function parseExecuteOptions(args) {
2549
- const toolId = args[0];
2537
+ function toolExecuteJsonOption(value) {
2538
+ const legacyInput = typeof value === "string" ? value : void 0;
2539
+ return {
2540
+ requested: value === true || legacyInput !== void 0,
2541
+ legacyInput
2542
+ };
2543
+ }
2544
+ function parseExecuteOptions(toolId, options, output) {
2550
2545
  if (!toolId) {
2551
2546
  throw new Error(
2552
2547
  `Usage: deepline tools execute <toolId> [--param key=value ...] [--input '{"k":"v"}'] [--timeout <duration>] [--recover | --idempotency-key <key>] [--recovery-timeout-ms <ms>] [--out rows.csv] [--output-format auto|csv|csv_file|json|json_file] [--no-preview]`
2553
2548
  );
2554
2549
  }
2555
2550
  const params = {};
2556
- let outputFormat = "auto";
2557
- let noPreview = false;
2558
- let outPath = null;
2559
- let timeoutMs;
2560
- let idempotencyKey;
2561
- let recover = false;
2551
+ let outputFormat = output.requested ? "json" : "auto";
2562
2552
  let recoveryTimeoutMs;
2563
- for (let index = 1; index < args.length; index += 1) {
2564
- const arg = args[index];
2565
- if ((arg === "--param" || arg === "-p") && args[index + 1]) {
2566
- const kv = args[++index];
2567
- const eqIdx = kv.indexOf("=");
2568
- if (eqIdx > 0) params[kv.slice(0, eqIdx)] = kv.slice(eqIdx + 1);
2569
- continue;
2570
- }
2571
- if (arg === "--json") {
2572
- const next = args[index + 1];
2573
- outputFormat = "json";
2574
- if (next && !next.startsWith("--")) {
2575
- Object.assign(
2576
- params,
2577
- parseJsonObjectArgument(args[++index], "--json")
2578
- );
2579
- }
2580
- continue;
2581
- }
2582
- if ((arg === "--input" || arg === "--payload") && args[index + 1]) {
2583
- Object.assign(params, parseJsonObjectArgument(args[++index], arg));
2584
- continue;
2585
- }
2586
- if (arg === "--timeout" && args[index + 1]) {
2587
- timeoutMs = parseToolExecuteTimeout(args[++index]);
2588
- continue;
2589
- }
2590
- if (arg === "--output-format" && args[index + 1]) {
2591
- outputFormat = normalizeOutputFormat(args[++index]);
2592
- continue;
2593
- }
2594
- if (arg === "--no-preview") {
2595
- noPreview = true;
2596
- continue;
2597
- }
2598
- if (arg === "--idempotency-key" && args[index + 1]) {
2599
- idempotencyKey = args[++index];
2600
- continue;
2601
- }
2602
- if (arg === "--recover") {
2603
- recover = true;
2604
- continue;
2605
- }
2606
- if (arg === "--recovery-timeout-ms" && args[index + 1]) {
2607
- const parsed = Number(args[++index]);
2608
- if (!Number.isFinite(parsed) || parsed < 0) {
2609
- throw new Error("--recovery-timeout-ms must be a non-negative number.");
2610
- }
2611
- recoveryTimeoutMs = parsed;
2612
- continue;
2613
- }
2614
- if ((arg === "--out" || arg === "-o") && args[index + 1]) {
2615
- outPath = _path.resolve.call(void 0, args[++index]);
2616
- continue;
2553
+ for (const kv of _nullishCoalesce(options.param, () => ( []))) {
2554
+ const eqIdx = kv.indexOf("=");
2555
+ if (eqIdx > 0) params[kv.slice(0, eqIdx)] = kv.slice(eqIdx + 1);
2556
+ }
2557
+ if (output.legacyInput !== void 0) {
2558
+ Object.assign(
2559
+ params,
2560
+ parseJsonObjectArgument(output.legacyInput, "--json")
2561
+ );
2562
+ }
2563
+ if (options.input !== void 0) {
2564
+ Object.assign(params, parseJsonObjectArgument(options.input, "--input"));
2565
+ }
2566
+ if (options.payload !== void 0) {
2567
+ Object.assign(
2568
+ params,
2569
+ parseJsonObjectArgument(options.payload, "--payload")
2570
+ );
2571
+ }
2572
+ if (options.outputFormat !== void 0) {
2573
+ outputFormat = normalizeOutputFormat(options.outputFormat);
2574
+ }
2575
+ if (options.idempotencyKey !== void 0) {
2576
+ _chunk4ZARCCPTjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
2577
+ }
2578
+ if (options.recoveryTimeoutMs !== void 0) {
2579
+ const parsed = Number(options.recoveryTimeoutMs);
2580
+ if (!options.recoveryTimeoutMs.trim() || !Number.isFinite(parsed) || parsed < 0) {
2581
+ throw new Error("--recovery-timeout-ms must be a non-negative number.");
2617
2582
  }
2618
- throw new Error(`Unknown option: ${arg}`);
2583
+ recoveryTimeoutMs = parsed;
2619
2584
  }
2620
2585
  return {
2621
2586
  toolId,
2622
2587
  params,
2623
2588
  outputFormat,
2624
- noPreview,
2625
- outPath,
2626
- timeoutMs,
2627
- idempotencyKey,
2628
- recover,
2589
+ noPreview: options.preview === false,
2590
+ outPath: options.out !== void 0 ? _path.resolve.call(void 0, options.out) : null,
2591
+ timeoutMs: options.timeout !== void 0 ? parseToolExecuteTimeout(options.timeout) : void 0,
2592
+ idempotencyKey: options.idempotencyKey,
2593
+ recover: options.recover === true,
2629
2594
  recoveryTimeoutMs
2630
2595
  };
2631
2596
  }
@@ -2650,9 +2615,6 @@ function parseToolExecuteTimeout(raw) {
2650
2615
  function safeFileStem(value) {
2651
2616
  return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
2652
2617
  }
2653
- function shellQuote(value) {
2654
- return `'${value.replace(/'/g, `'\\''`)}'`;
2655
- }
2656
2618
  function powerShellQuote(value) {
2657
2619
  return `'${value.replace(/'/g, "''")}'`;
2658
2620
  }
@@ -2682,6 +2644,7 @@ function seedToolListScript(input) {
2682
2644
 
2683
2645
  export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
2684
2646
  const result = await ctx.tools.execute({
2647
+ staleAfterSeconds: 0,
2685
2648
  id: ${JSON.stringify(input.toolId)},
2686
2649
  tool: ${JSON.stringify(input.toolId)},
2687
2650
  input: ${JSON.stringify(input.payload)},
@@ -2699,7 +2662,7 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
2699
2662
  // Pass it to ctx.dataset; use rows.peek/count/materialize only for deliberate bounded inspection.
2700
2663
  // .withColumn('email_waterfall', (row, rowCtx) => rowCtx.runPlay('name_domain_email', 'name-and-domain-to-email', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), domain: String(row.domain ?? '') }, { description: 'Resolve email.' }))
2701
2664
  // .withColumn('phone_waterfall', (row, rowCtx) => rowCtx.runPlay('contact_phone', 'contact-to-phone', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), email: String(row.email ?? '') }, { description: 'Resolve phone.' }))
2702
- // ctx.dataset is idempotent by dataset key + row key; reruns reuse completed rows.
2665
+ // ctx.dataset is idempotent for completed rows during same-run recovery. New runs follow each call's freshness.
2703
2666
  const enrichedData = await ctx
2704
2667
  .dataset('enriched_data', rows)
2705
2668
  .run({
@@ -2720,10 +2683,16 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
2720
2683
  path: scriptPath,
2721
2684
  sourceCode: script,
2722
2685
  projectDir,
2723
- macCopyCommand: `mkdir -p ${shellQuote(projectDir)} && cp ${shellQuote(scriptPath)} ${shellQuote(`${projectDir}/${fileName}`)}`,
2686
+ macCopyCommand: `mkdir -p ${_chunkAID3OYVJjs.shellQuote.call(void 0, projectDir)} && cp ${_chunkAID3OYVJjs.shellQuote.call(void 0, scriptPath)} ${_chunkAID3OYVJjs.shellQuote.call(void 0, `${projectDir}/${fileName}`)}`,
2724
2687
  windowsCopyCommand: `New-Item -ItemType Directory -Force -Path ${powerShellQuote(projectDir.replace(/\//g, "\\"))} | Out-Null; Copy-Item -LiteralPath ${powerShellQuote(scriptPath)} -Destination ${powerShellQuote(`${projectDir.replace(/\//g, "\\")}\\${fileName}`)}`
2725
2688
  };
2726
2689
  }
2690
+ function toolExecutionInspection(input) {
2691
+ return {
2692
+ inspect: input.idempotencyKey !== void 0 ? `deepline executions get --idempotency-key ${_chunkAID3OYVJjs.shellQuote.call(void 0, input.idempotencyKey)} --json` : `deepline describe ${_chunkAID3OYVJjs.shellQuote.call(void 0, input.toolId)} --json`,
2693
+ inspectDescription: input.idempotencyKey !== void 0 ? "Read the saved execution without starting new work." : "Read the tool contract; this unkeyed call has no saved recovery identity."
2694
+ };
2695
+ }
2727
2696
  function buildToolExecuteBaseEnvelope(input) {
2728
2697
  const envelope = commandEnvelopeFromRawResponse(input.rawResponse);
2729
2698
  const guidanceLines = toolExecuteExitCode(envelope) !== 0 || input.listExpected === true && !input.listConversion ? toolGuidanceLines(input.guidance) : [];
@@ -2748,8 +2717,8 @@ function buildToolExecuteBaseEnvelope(input) {
2748
2717
  envelope,
2749
2718
  "output"
2750
2719
  );
2751
- const billingLookup = typeof envelope.job_id === "string" && envelope.job_id.trim() ? `deepline billing usage --request-id ${shellQuote(envelope.job_id)} --json` : null;
2752
- const inspectCommand = `deepline tools execute ${input.toolId} --input ${shellQuote(JSON.stringify(input.params))} --json`;
2720
+ const billingLookup = typeof envelope.job_id === "string" && envelope.job_id.trim() ? `deepline billing usage --request-id ${_chunkAID3OYVJjs.shellQuote.call(void 0, envelope.job_id)} --json` : null;
2721
+ const inspection = toolExecutionInspection(input);
2753
2722
  const actions = input.listConversion ? [
2754
2723
  {
2755
2724
  label: "next",
@@ -2767,6 +2736,7 @@ function buildToolExecuteBaseEnvelope(input) {
2767
2736
  if (billingLookup) {
2768
2737
  actions.push({ label: "charge", command: billingLookup });
2769
2738
  }
2739
+ actions.unshift({ label: "inspect", command: inspection.inspect });
2770
2740
  return {
2771
2741
  ...envelope,
2772
2742
  ...input.idempotencyKey ? { idempotency_key: input.idempotencyKey } : {},
@@ -2775,13 +2745,13 @@ function buildToolExecuteBaseEnvelope(input) {
2775
2745
  ...summaryEntries.length > 0 ? { summary: input.summary } : {},
2776
2746
  ...warningMessages.length > 0 ? { warnings: warningMessages } : {},
2777
2747
  next: {
2778
- inspect: inspectCommand,
2748
+ ...inspection,
2779
2749
  ...billingLookup ? { billing: billingLookup } : {},
2780
2750
  ..._nullishCoalesce(apifyRecovery, () => ( {})),
2781
2751
  ...guidanceLines.length > 0 ? { guidance: input.guidance } : {},
2782
2752
  playDebugging: "When fixing a play getter, inspect returned dataset handles with runs get and export rows with runs export; do not copy CLI preview paths blindly.",
2783
2753
  ...input.listConversion ? {
2784
- expandToPlay: "Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again.",
2754
+ expandToPlay: "Use stable map and step keys for recovery within a run. New runs follow each call's explicit freshness.",
2785
2755
  listSourcePath: _nullishCoalesce(input.listConversion.sourcePath, () => ( "auto-detected list in the CLI response preview"))
2786
2756
  } : {}
2787
2757
  },
@@ -2832,6 +2802,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
2832
2802
  void _next;
2833
2803
  void _local;
2834
2804
  const billingLookup = isRecord(input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
2805
+ const inspection = toolExecutionInspection(input);
2835
2806
  return {
2836
2807
  ...base,
2837
2808
  status: typeof base.status === "string" ? base.status : "completed",
@@ -2873,10 +2844,10 @@ function buildToolExecuteRowArtifactEnvelope(input) {
2873
2844
  windows_powershell: input.seededScript.windowsCopyCommand
2874
2845
  },
2875
2846
  next: {
2876
- inspect: "Re-run with --json only when you need the raw provider/tool response.",
2847
+ ...inspection,
2877
2848
  ...billingLookup ? { billing: billingLookup } : {},
2878
2849
  listSourcePath: input.rowOutput.sourcePath,
2879
- expandToPlay: "Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
2850
+ expandToPlay: "Use stable map and step keys for recovery within a run. New runs follow each call's explicit freshness."
2880
2851
  },
2881
2852
  render: {
2882
2853
  sections: [
@@ -2893,10 +2864,11 @@ function buildToolExecuteRowArtifactEnvelope(input) {
2893
2864
  }
2894
2865
  ],
2895
2866
  actions: [
2867
+ { label: "inspect", command: inspection.inspect },
2896
2868
  ...billingLookup ? [{ label: "charge", command: billingLookup }] : [],
2897
2869
  {
2898
2870
  label: "next",
2899
- command: "Move the script into a project folder and expand it into a Deepline play. Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
2871
+ command: "Move the script into a project folder and expand it into a Deepline play. Use stable map and step keys for same-run recovery; choose explicit freshness for calls in new runs."
2900
2872
  },
2901
2873
  {
2902
2874
  label: "macOS/Linux",
@@ -2910,20 +2882,22 @@ function buildToolExecuteRowArtifactEnvelope(input) {
2910
2882
  }
2911
2883
  };
2912
2884
  }
2913
- async function executeTool(args) {
2885
+ async function executeTool(toolId, options) {
2886
+ const output = toolExecuteJsonOption(options.json);
2887
+ const wantsJson = _chunkUROXKPNDjs.shouldEmitJson.call(void 0, output.requested);
2914
2888
  let parsed;
2915
2889
  try {
2916
- parsed = parseExecuteOptions(args);
2890
+ parsed = parseExecuteOptions(toolId, options, output);
2917
2891
  } catch (error) {
2918
- if (_chunkQQ2FG5W3js.argsWantJson.call(void 0, args)) {
2919
- _chunkQQ2FG5W3js.printJsonError.call(void 0, error);
2892
+ if (wantsJson) {
2893
+ _chunkUROXKPNDjs.printJsonError.call(void 0, error);
2920
2894
  } else {
2921
2895
  console.error(error instanceof Error ? error.message : String(error));
2922
2896
  }
2923
- return 1;
2897
+ return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
2924
2898
  }
2925
2899
  const cliInvocationId = _nullishCoalesce(_chunkQJBJZVG6js.getToolExecuteInvocationId.call(void 0, ), () => ( _chunkQJBJZVG6js.beginToolExecuteCommand.call(void 0, )));
2926
- const client = new (0, _chunkMNKDSR2Jjs.DeeplineClient)();
2900
+ const client = new (0, _chunk4ZARCCPTjs.DeeplineClient)();
2927
2901
  let metadata;
2928
2902
  try {
2929
2903
  metadata = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0,
@@ -2937,8 +2911,8 @@ async function executeTool(args) {
2937
2911
  () => findPlayForToolId(client, parsed.toolId, cliInvocationId)
2938
2912
  );
2939
2913
  if (play) {
2940
- if (_chunkQQ2FG5W3js.argsWantJson.call(void 0, args)) {
2941
- _chunkQQ2FG5W3js.printJsonError.call(void 0,
2914
+ if (wantsJson) {
2915
+ _chunkUROXKPNDjs.printJsonError.call(void 0,
2942
2916
  new Error(playAliasToolErrorMessage(parsed.toolId, play))
2943
2917
  );
2944
2918
  } else {
@@ -2950,8 +2924,8 @@ async function executeTool(args) {
2950
2924
  throw error;
2951
2925
  }
2952
2926
  if (isPlayLikeTool(metadata)) {
2953
- if (_chunkQQ2FG5W3js.argsWantJson.call(void 0, args)) {
2954
- _chunkQQ2FG5W3js.printJsonError.call(void 0,
2927
+ if (wantsJson) {
2928
+ _chunkUROXKPNDjs.printJsonError.call(void 0,
2955
2929
  new Error(
2956
2930
  playLikeToolExecuteErrorMessage(
2957
2931
  parsed.toolId,
@@ -2987,12 +2961,12 @@ async function executeTool(args) {
2987
2961
  responseIntent,
2988
2962
  ...idempotencyKey ? { idempotencyKey } : {},
2989
2963
  ...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
2990
- searchRef: _chunkKZNFYOHXjs.recentSearchRef.call(void 0, ),
2964
+ searchRef: _chunkMOP6D7Z5js.recentSearchRef.call(void 0, ),
2991
2965
  cliInvocationId
2992
2966
  }).catch((error) => {
2993
2967
  const guidanceLines = toolGuidanceLines(metadata.guidance);
2994
2968
  if (guidanceLines.length > 0) {
2995
- if (args.includes("--json") && error instanceof Error) {
2969
+ if (wantsJson && error instanceof Error) {
2996
2970
  Object.assign(error, { guidance: metadata.guidance });
2997
2971
  } else {
2998
2972
  console.error(
@@ -3026,8 +3000,8 @@ async function executeTool(args) {
3026
3000
  );
3027
3001
  const executeExitCode = toolExecuteExitCode(baseEnvelope);
3028
3002
  const delivered = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0, "output delivery", () => {
3029
- if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && _chunkQQ2FG5W3js.shouldEmitJson.call(void 0, ))) {
3030
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0, baseEnvelope, { json: true });
3003
+ if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && _chunkUROXKPNDjs.shouldEmitJson.call(void 0, ))) {
3004
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: true });
3031
3005
  return true;
3032
3006
  }
3033
3007
  if (parsed.outputFormat === "json_file") {
@@ -3035,7 +3009,7 @@ async function executeTool(args) {
3035
3009
  rawResponse,
3036
3010
  `payload_${parsed.toolId}`
3037
3011
  );
3038
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
3012
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
3039
3013
  {
3040
3014
  ...baseEnvelope,
3041
3015
  local: {
@@ -3049,11 +3023,15 @@ async function executeTool(args) {
3049
3023
  }
3050
3024
  if (!listConversion) {
3051
3025
  if (parsed.outPath) {
3026
+ const inspection = toolExecutionInspection({
3027
+ toolId: parsed.toolId,
3028
+ idempotencyKey
3029
+ });
3052
3030
  const error = new Error(
3053
- `${parsed.toolId} did not expose row-shaped output to write as CSV. Re-run with --json to inspect the raw tool response.`
3031
+ `${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
3054
3032
  );
3055
- if (_chunkQQ2FG5W3js.argsWantJson.call(void 0, args)) {
3056
- _chunkQQ2FG5W3js.printJsonError.call(void 0, error);
3033
+ if (wantsJson) {
3034
+ _chunkUROXKPNDjs.printJsonError.call(void 0, error);
3057
3035
  } else {
3058
3036
  console.error(error.message);
3059
3037
  }
@@ -3064,18 +3042,18 @@ async function executeTool(args) {
3064
3042
  rawResponse,
3065
3043
  `payload_${parsed.toolId}`
3066
3044
  );
3067
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
3045
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
3068
3046
  {
3069
3047
  ...baseEnvelope,
3070
3048
  local: {
3071
3049
  payload_file: jsonPath
3072
3050
  }
3073
3051
  },
3074
- { json: parsed.outputFormat === "csv_file" || _chunkQQ2FG5W3js.shouldEmitJson.call(void 0, ) }
3052
+ { json: parsed.outputFormat === "csv_file" || _chunkUROXKPNDjs.shouldEmitJson.call(void 0, ) }
3075
3053
  );
3076
3054
  return true;
3077
3055
  }
3078
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0, baseEnvelope, { json: false });
3056
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: false });
3079
3057
  return true;
3080
3058
  }
3081
3059
  const rowOutput = _chunkNXDRDJ4Kjs.projectRowOutput.call(void 0, listConversion);
@@ -3090,6 +3068,8 @@ async function executeTool(args) {
3090
3068
  rows: listConversion.rows
3091
3069
  });
3092
3070
  const materializedEnvelope = buildToolExecuteRowArtifactEnvelope({
3071
+ toolId: parsed.toolId,
3072
+ idempotencyKey,
3093
3073
  baseEnvelope,
3094
3074
  csv,
3095
3075
  rowOutput,
@@ -3097,19 +3077,24 @@ async function executeTool(args) {
3097
3077
  seededScript
3098
3078
  });
3099
3079
  if (parsed.outputFormat === "csv_file") {
3100
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0, materializedEnvelope, { json: true });
3080
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0, materializedEnvelope, { json: true });
3101
3081
  return true;
3102
3082
  }
3103
3083
  if (parsed.outPath) {
3104
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0, materializedEnvelope, {
3105
- json: _chunkQQ2FG5W3js.argsWantJson.call(void 0, args) || _chunkQQ2FG5W3js.shouldEmitJson.call(void 0, ),
3084
+ const inspection = toolExecutionInspection({
3085
+ toolId: parsed.toolId,
3086
+ idempotencyKey
3087
+ });
3088
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
3089
+ json: wantsJson,
3106
3090
  text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
3091
+ inspect: ${inspection.inspect}
3107
3092
  `
3108
3093
  });
3109
3094
  return true;
3110
3095
  }
3111
3096
  if (parsed.noPreview) {
3112
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0,
3097
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0,
3113
3098
  {
3114
3099
  ...materializedEnvelope,
3115
3100
  local: {
@@ -3117,12 +3102,12 @@ async function executeTool(args) {
3117
3102
  output_path: csv.path
3118
3103
  }
3119
3104
  },
3120
- { json: _chunkQQ2FG5W3js.shouldEmitJson.call(void 0, ), text: `${csv.path}
3105
+ { json: _chunkUROXKPNDjs.shouldEmitJson.call(void 0, ), text: `${csv.path}
3121
3106
  ` }
3122
3107
  );
3123
3108
  return true;
3124
3109
  }
3125
- _chunkQQ2FG5W3js.printCommandEnvelope.call(void 0, materializedEnvelope, { json: false });
3110
+ _chunkUROXKPNDjs.printCommandEnvelope.call(void 0, materializedEnvelope, { json: false });
3126
3111
  return true;
3127
3112
  });
3128
3113
  if (delivered) {