deepline 0.3.395 → 0.3.397

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 (126) hide show
  1. package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
  4. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
  5. package/dist/cli/{auth-NMQXZRS7.mjs → auth-AZJFXGKP.mjs} +5 -4
  6. package/dist/cli/auth-CZJQU7B5.js +40 -0
  7. package/dist/cli/{billing-Z4JTGUU3.js → billing-MQV5AGDJ.js} +77 -76
  8. package/dist/cli/{billing-5MVXZRS6.mjs → billing-MZAAUHGH.mjs} +6 -5
  9. package/dist/cli/{chunk-6D7A2FSL.mjs → chunk-2LDADJNO.mjs} +7 -107
  10. package/dist/cli/{chunk-UKU6JM3S.js → chunk-3VP34TAU.js} +8 -8
  11. package/dist/cli/{chunk-7XAM7KDW.mjs → chunk-4D745XZO.mjs} +21 -108
  12. package/dist/cli/chunk-7DRPTGCK.js +930 -0
  13. package/dist/cli/{chunk-ZMVJSS6N.js → chunk-BQR6UN3C.js} +62 -78
  14. package/dist/cli/{chunk-HRWUQJ4K.js → chunk-DQ65ZVHN.js} +6 -6
  15. package/dist/cli/{chunk-5VCZ3WRH.mjs → chunk-EIMG75BT.mjs} +1 -0
  16. package/dist/cli/{chunk-EFLQHJZ6.mjs → chunk-F3BUFYKE.mjs} +182 -1031
  17. package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
  18. package/dist/cli/{describe-DBRY5BNK.mjs → chunk-HFYQBC2D.mjs} +51 -171
  19. package/dist/cli/chunk-HGFFYVXN.js +210 -0
  20. package/dist/cli/{chunk-VB6KECLU.mjs → chunk-IHG7UAHD.mjs} +63 -79
  21. package/dist/cli/{chunk-TO2MWPGR.js → chunk-IZ74ABSX.js} +1 -1
  22. package/dist/cli/{chunk-G4IWGRMK.mjs → chunk-J7ABTQQ7.mjs} +5 -3
  23. package/dist/cli/{chunk-LZLBR2SF.js → chunk-K33MXVXQ.js} +323 -1172
  24. package/dist/cli/{chunk-DRM3CMHL.js → chunk-KXMNM4AQ.js} +2 -1
  25. package/dist/cli/chunk-LJ5747UC.mjs +107 -0
  26. package/dist/cli/{chunk-BON3DRC6.mjs → chunk-MRXMMERY.mjs} +1 -1
  27. package/dist/cli/{chunk-7MVWUXOD.mjs → chunk-MV7QRALK.mjs} +3 -3
  28. package/dist/cli/{chunk-WCCKMLHL.mjs → chunk-MYPH2LUU.mjs} +2 -2
  29. package/dist/cli/{chunk-RDXFGPJU.js → chunk-NA4T3B62.js} +64 -272
  30. package/dist/cli/{chunk-BLYL3KOC.mjs → chunk-NOX2TCBP.mjs} +1 -1
  31. package/dist/cli/chunk-OSDXE27V.mjs +88 -0
  32. package/dist/cli/{chunk-R4XZO6Z5.js → chunk-PSGEDGLT.js} +28 -115
  33. package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
  34. package/dist/cli/chunk-RFG3MRAC.js +286 -0
  35. package/dist/cli/{chunk-47M6HPGP.mjs → chunk-RNSWDKBM.mjs} +1 -1
  36. package/dist/cli/{chunk-56IFFVIB.js → chunk-RYW4HPSM.js} +21 -121
  37. package/dist/cli/{chunk-K5T3EN6D.js → chunk-SO7RUVTY.js} +26 -26
  38. package/dist/cli/{chunk-KZZC33PY.mjs → chunk-TXZVVBQZ.mjs} +63 -271
  39. package/dist/cli/{chunk-36ML3YKA.js → chunk-UVXBVUZQ.js} +15 -13
  40. package/dist/cli/{chunk-PZ5BZ76S.js → chunk-VTF4RRWJ.js} +50 -50
  41. package/dist/cli/{chunk-3TRY7KAC.mjs → chunk-W3HMGKMI.mjs} +2 -2
  42. package/dist/cli/{chunk-ZWH2TFA7.mjs → chunk-WM2QEHZL.mjs} +2 -2
  43. package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
  44. package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
  45. package/dist/cli/{chunk-UCXK2DS4.js → chunk-YLRME7MK.js} +15 -15
  46. package/dist/cli/{chunk-MYIBHORT.js → chunk-YSVORIEW.js} +2 -2
  47. package/dist/cli/{chunk-OCSG6X67.mjs → chunk-YUDKBQUD.mjs} +4 -4
  48. package/dist/cli/chunk-ZAAKSJAS.js +88 -0
  49. package/dist/cli/{chunk-VYLJJQ7Y.js → chunk-ZHUMDMOS.js} +65 -65
  50. package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
  51. package/dist/cli/{csv-HTS5ZYQ4.js → csv-AQBQ5O3I.js} +13 -12
  52. package/dist/cli/{csv-SVOD5UBH.mjs → csv-MB7PJMYQ.mjs} +4 -3
  53. package/dist/cli/{db-7AP4P52N.js → db-JPUYC5RB.js} +31 -30
  54. package/dist/cli/{db-7QLNI3Q4.mjs → db-L5IEI2AU.mjs} +6 -5
  55. package/dist/cli/describe-6WT74AOR.js +164 -0
  56. package/dist/cli/describe-S6BFANVI.mjs +164 -0
  57. package/dist/cli/describe-core.d.mts +100 -0
  58. package/dist/cli/describe-core.d.ts +100 -0
  59. package/dist/cli/describe-core.js +18 -0
  60. package/dist/cli/describe-core.mjs +18 -0
  61. package/dist/cli/{executions-GRQXTB2P.js → executions-6TMQTFP4.js} +8 -7
  62. package/dist/cli/{executions-QNZTPNG4.mjs → executions-L7I2ZW4Z.mjs} +6 -5
  63. package/dist/cli/{feedback-JMCSR624.mjs → feedback-DSJ63HK6.mjs} +4 -3
  64. package/dist/cli/{feedback-ZOLA2KY7.js → feedback-XF7CQGMD.js} +8 -7
  65. package/dist/cli/{git-LJGL2IHS.mjs → git-C3ENM67D.mjs} +5 -4
  66. package/dist/cli/git-HYDZK2QR.js +24 -0
  67. package/dist/cli/index.js +96 -94
  68. package/dist/cli/index.mjs +41 -39
  69. package/dist/cli/{legacy-noops-YSCIR2SD.js → legacy-noops-B2NHWIVD.js} +8 -7
  70. package/dist/cli/{legacy-noops-F23PKVBN.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
  71. package/dist/cli/{monitors-WMZ6HJZX.js → monitors-ORFWOVZB.js} +87 -86
  72. package/dist/cli/{monitors-S4LOEL7W.mjs → monitors-TCEDBDGY.mjs} +6 -5
  73. package/dist/cli/{org-U3WA2NQM.mjs → org-45KREIKZ.mjs} +6 -5
  74. package/dist/cli/{org-PFHM5ZLY.js → org-T74CJESN.js} +66 -65
  75. package/dist/cli/{chunk-XMAPE2KH.mjs → play-MU7MYBIM.mjs} +78 -131
  76. package/dist/cli/{chunk-4KLCLLTO.js → play-XHK2LPON.js} +273 -326
  77. package/dist/cli/{providers-XYMHLKCA.js → providers-4MGQKYFD.js} +9 -8
  78. package/dist/cli/{providers-QBBRFBOH.mjs → providers-VYCXIJT5.mjs} +6 -5
  79. package/dist/cli/{quickstart-IYGD6ZY3.js → quickstart-47G3VEOT.js} +6 -5
  80. package/dist/cli/{quickstart-5JTDGISY.mjs → quickstart-H724EFM2.mjs} +4 -3
  81. package/dist/cli/search-3356ENLD.js +30 -0
  82. package/dist/cli/{search-X6W6GRHS.mjs → search-VQHXEFQ4.mjs} +8 -6
  83. package/dist/cli/{secrets-UHG6OQFD.js → secrets-ALLKCU35.js} +15 -14
  84. package/dist/cli/{secrets-N55B67H6.mjs → secrets-CPBNGA44.mjs} +6 -5
  85. package/dist/cli/{sessions-JTRSTDSS.mjs → sessions-7RSQB7IX.mjs} +5 -4
  86. package/dist/cli/sessions-FKGAY7WQ.js +16 -0
  87. package/dist/cli/{settings-Q24HRAQI.mjs → settings-UYSGV4IC.mjs} +9 -8
  88. package/dist/cli/{settings-ATX4U5AS.js → settings-Y5BI42P7.js} +76 -75
  89. package/dist/cli/{setup-77ZWLVHT.mjs → setup-L3ZBBTS4.mjs} +7 -6
  90. package/dist/cli/{setup-EJCNOUCE.js → setup-VXQPEU3E.js} +42 -41
  91. package/dist/cli/skills-DUZQTDTE.js +29 -0
  92. package/dist/cli/{skills-XIS5AWQI.mjs → skills-QHVDLSFE.mjs} +5 -4
  93. package/dist/cli/{tools-WCKLYEGQ.mjs → tools-LSCEK4K2.mjs} +16 -19
  94. package/dist/cli/tools-YWU5QOQ5.js +39 -0
  95. package/dist/cli/update-5LYQAI55.js +29 -0
  96. package/dist/cli/{update-UT5WANMV.mjs → update-CU22OTBM.mjs} +7 -6
  97. package/dist/cli/{workflow-226QYUN2.js → workflow-ERFLTRNX.js} +17 -16
  98. package/dist/cli/{workflow-ZMX3L4ML.mjs → workflow-KQARK5BZ.mjs} +7 -6
  99. package/dist/{client-hdFtwhTm.d.mts → client-D0j-_aaa.d.mts} +2 -1
  100. package/dist/{client-CivP-PAI.d.ts → client-DflfVyj6.d.ts} +2 -1
  101. package/dist/index.d.mts +2 -2
  102. package/dist/index.d.ts +2 -2
  103. package/dist/index.js +15 -11
  104. package/dist/index.mjs +19 -15
  105. package/dist/install-integrity.json +94 -80
  106. package/dist/plays/play-description.d.mts +1 -1
  107. package/dist/plays/play-description.d.ts +1 -1
  108. package/dist/plays/play-description.js +4 -2
  109. package/dist/plays/play-description.mjs +3 -1
  110. package/dist/plays/run-request.d.mts +1 -1
  111. package/dist/plays/run-request.d.ts +1 -1
  112. package/dist/release.d.mts +1 -1
  113. package/dist/release.d.ts +1 -1
  114. package/dist/release.js +2 -2
  115. package/dist/release.mjs +1 -1
  116. package/package.json +6 -1
  117. package/dist/cli/auth-UYCOBAL5.js +0 -39
  118. package/dist/cli/describe-YKOE54ZO.js +0 -406
  119. package/dist/cli/git-EJQLRK27.js +0 -23
  120. package/dist/cli/play-AGSECQFN.mjs +0 -159
  121. package/dist/cli/play-BR2LWGXK.js +0 -159
  122. package/dist/cli/search-ZVSYH5GY.js +0 -28
  123. package/dist/cli/sessions-57L5MGHN.js +0 -15
  124. package/dist/cli/skills-SPXUBLII.js +0 -28
  125. package/dist/cli/tools-DBHUUZJX.js +0 -42
  126. package/dist/cli/update-VSNFXRHJ.js +0 -28
@@ -0,0 +1,210 @@
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; }// src/tool-output.ts
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _fs = require('fs');
9
+ var _os = require('os');
10
+ var _path = require('path');
11
+ function isPlainObject(value) {
12
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
13
+ }
14
+ function getByDottedPath(root, dottedPath) {
15
+ let current = root;
16
+ for (const segment of String(dottedPath || "").split(".").filter(Boolean)) {
17
+ if (!isPlainObject(current) || !(segment in current)) {
18
+ return null;
19
+ }
20
+ current = current[segment];
21
+ }
22
+ return current;
23
+ }
24
+ function normalizeRows(value) {
25
+ if (!Array.isArray(value)) return null;
26
+ return value.map((entry) => {
27
+ if (isPlainObject(entry)) return entry;
28
+ return { value: entry };
29
+ });
30
+ }
31
+ function columnsForRows(rows) {
32
+ const seen = /* @__PURE__ */ new Set();
33
+ const columns = [];
34
+ for (const row of rows) {
35
+ for (const key of Object.keys(row)) {
36
+ if (!seen.has(key)) {
37
+ seen.add(key);
38
+ columns.push(key);
39
+ }
40
+ }
41
+ }
42
+ return columns;
43
+ }
44
+ function candidateRoots(payload) {
45
+ const roots = [
46
+ { path: null, value: payload }
47
+ ];
48
+ if (isPlainObject(payload) && isPlainObject(payload.toolResponse)) {
49
+ roots.push({ path: "toolResponse", value: payload.toolResponse });
50
+ if (Object.prototype.hasOwnProperty.call(payload.toolResponse, "raw")) {
51
+ roots.push({
52
+ path: "toolResponse.raw",
53
+ value: payload.toolResponse.raw
54
+ });
55
+ }
56
+ }
57
+ if (isPlainObject(payload) && isPlainObject(payload.output)) {
58
+ roots.push({ path: "output", value: payload.output });
59
+ if (Object.prototype.hasOwnProperty.call(payload.output, "body")) {
60
+ roots.push({ path: "output.body", value: payload.output.body });
61
+ }
62
+ }
63
+ if (isPlainObject(payload) && isPlainObject(payload.result)) {
64
+ roots.push({ path: "result", value: payload.result });
65
+ if (isPlainObject(payload.result.data)) {
66
+ roots.push({ path: "result.data", value: payload.result.data });
67
+ }
68
+ }
69
+ return roots;
70
+ }
71
+ function findBestArrayCandidate(value, pathPrefix = "", depth = 0) {
72
+ if (depth > 5) return null;
73
+ const directRows = normalizeRows(value);
74
+ const hasObjectRow = _nullishCoalesce(_optionalChain([directRows, 'optionalAccess', _ => _.some, 'call', _2 => _2(
75
+ (row) => Object.keys(row).some((key) => key !== "value")
76
+ )]), () => ( false));
77
+ let best = directRows && directRows.length > 0 && hasObjectRow ? { path: pathPrefix, rows: directRows } : null;
78
+ if (!isPlainObject(value)) {
79
+ return best;
80
+ }
81
+ for (const [key, child] of Object.entries(value)) {
82
+ const childPath = pathPrefix ? `${pathPrefix}.${key}` : key;
83
+ const candidate = findBestArrayCandidate(child, childPath, depth + 1);
84
+ if (!candidate) continue;
85
+ if (!best || candidate.rows.length > best.rows.length) {
86
+ best = candidate;
87
+ }
88
+ }
89
+ return best;
90
+ }
91
+ function tryConvertToList(payload, options) {
92
+ const listExtractorPaths = Array.isArray(_optionalChain([options, 'optionalAccess', _3 => _3.listExtractorPaths])) ? _optionalChain([options, 'optionalAccess', _4 => _4.listExtractorPaths, 'access', _5 => _5.filter, 'call', _6 => _6(
93
+ (entry) => typeof entry === "string" && entry.trim().length > 0
94
+ )]) : [];
95
+ if (listExtractorPaths.length > 0) {
96
+ let emptyMatch = null;
97
+ for (const root of candidateRoots(payload)) {
98
+ for (const extractorPath of listExtractorPaths) {
99
+ const resolved = getByDottedPath(root.value, extractorPath);
100
+ const rows = normalizeRows(resolved);
101
+ if (!rows) {
102
+ continue;
103
+ }
104
+ const sourcePath = root.path ? `${root.path}.${extractorPath}` : extractorPath;
105
+ if (rows.length > 0) {
106
+ return { rows, strategy: "configured_paths", sourcePath };
107
+ }
108
+ emptyMatch ??= { rows, strategy: "configured_paths", sourcePath };
109
+ }
110
+ }
111
+ if (emptyMatch) {
112
+ return emptyMatch;
113
+ }
114
+ }
115
+ const roots = candidateRoots(payload);
116
+ const v2Raw = roots.find((root) => root.path === "toolResponse.raw");
117
+ for (const root of v2Raw ? [v2Raw] : roots) {
118
+ const candidate = findBestArrayCandidate(root.value, _nullishCoalesce(root.path, () => ( "")));
119
+ if (!candidate || candidate.rows.length === 0) continue;
120
+ return {
121
+ rows: candidate.rows,
122
+ strategy: "auto_detected",
123
+ sourcePath: candidate.path || root.path
124
+ };
125
+ }
126
+ return null;
127
+ }
128
+ function projectRowOutput(conversion) {
129
+ return {
130
+ rows: conversion.rows,
131
+ rowCount: conversion.rows.length,
132
+ columns: columnsForRows(conversion.rows),
133
+ previewRows: conversion.rows.slice(0, 5),
134
+ strategy: conversion.strategy,
135
+ sourcePath: conversion.sourcePath
136
+ };
137
+ }
138
+ function ensureOutputDir() {
139
+ const outputDir = _path.join.call(void 0, _os.homedir.call(void 0, ), ".local", "share", "deepline", "data");
140
+ _fs.mkdirSync.call(void 0, outputDir, { recursive: true });
141
+ return outputDir;
142
+ }
143
+ function writeJsonOutputFile(payload, stem) {
144
+ const outputDir = ensureOutputDir();
145
+ const outputPath = _path.join.call(void 0, outputDir, `${stem}_${Date.now()}.json`);
146
+ _fs.writeFileSync.call(void 0, outputPath, JSON.stringify(payload, null, 2), "utf-8");
147
+ return outputPath;
148
+ }
149
+ function writeCsvOutputFile(rows, stem, options) {
150
+ const outputPath = _optionalChain([options, 'optionalAccess', _7 => _7.outPath]) ? options.outPath : _path.join.call(void 0, ensureOutputDir(), `${stem}_${Date.now()}.csv`);
151
+ _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, outputPath), { recursive: true });
152
+ const columns = columnsForRows(rows);
153
+ const escapeCell = (value) => {
154
+ const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
155
+ if (/[",\n]/.test(normalized)) {
156
+ return `"${normalized.replace(/"/g, '""')}"`;
157
+ }
158
+ return normalized;
159
+ };
160
+ const fd = _fs.openSync.call(void 0, outputPath, "w");
161
+ try {
162
+ _fs.writeSync.call(void 0, fd, `${columns.map(escapeCell).join(",")}
163
+ `);
164
+ for (const row of rows) {
165
+ _fs.writeSync.call(void 0,
166
+ fd,
167
+ `${columns.map((column) => escapeCell(row[column])).join(",")}
168
+ `
169
+ );
170
+ }
171
+ } finally {
172
+ _fs.closeSync.call(void 0, fd);
173
+ }
174
+ const previewRows = rows.slice(0, 5);
175
+ const previewColumns = columns.slice(0, 5);
176
+ const preview = [
177
+ previewColumns.join(","),
178
+ ...previewRows.map(
179
+ (row) => previewColumns.map((column) => escapeCell(row[column])).join(",")
180
+ )
181
+ ].join("\n");
182
+ return {
183
+ path: outputPath,
184
+ rowCount: rows.length,
185
+ columns,
186
+ preview
187
+ };
188
+ }
189
+ function extractSummaryFields(payload) {
190
+ const candidates = candidateRoots(payload);
191
+ for (const candidate of candidates) {
192
+ if (!isPlainObject(candidate.value)) continue;
193
+ const summaryEntries = Object.entries(candidate.value).filter(
194
+ ([, value]) => {
195
+ return value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
196
+ }
197
+ );
198
+ if (summaryEntries.length === 0) continue;
199
+ return Object.fromEntries(summaryEntries);
200
+ }
201
+ return {};
202
+ }
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ exports.tryConvertToList = tryConvertToList; exports.projectRowOutput = projectRowOutput; exports.writeJsonOutputFile = writeJsonOutputFile; exports.writeCsvOutputFile = writeCsvOutputFile; exports.extractSummaryFields = extractSummaryFields;
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  shellQuote
3
3
  } from "./chunk-OVDNJAJN.mjs";
4
+ import {
5
+ cloneEditStarter
6
+ } from "./chunk-EIMG75BT.mjs";
4
7
 
5
8
  // src/cli/described.ts
6
9
  var SHAPE = "{}";
@@ -617,84 +620,66 @@ function describedJson(described, view) {
617
620
  ...hidden.length ? { hidden } : {}
618
621
  };
619
622
  }
620
-
621
- // src/cli/execution-observation.ts
622
- import { writeFileSync, renameSync } from "fs";
623
- function writeObservation(observation) {
624
- const path = process.env.DEEPLINE_EXECUTION_OBSERVATION_PATH;
625
- const invocationId = process.env.DEEPLINE_EXECUTION_OBSERVATION_ID;
626
- if (!path || !invocationId) return;
627
- const pending = `${path}.pending`;
628
- writeFileSync(
629
- pending,
630
- JSON.stringify({
631
- schema_version: 1,
632
- invocation_id: invocationId,
633
- ...observation
634
- }),
635
- { mode: 384 }
636
- );
637
- renameSync(pending, path);
623
+ function buildPlayDashboardUrl(baseUrl, playName) {
624
+ const trimmedBase = baseUrl.replace(/\/$/, "");
625
+ const encodedPlayName = encodeURIComponent(playName);
626
+ return `${trimmedBase}/dashboard/plays/${encodedPlayName}`;
638
627
  }
639
- function recordApiResponse(observation) {
640
- writeObservation({
641
- kind: "api_response",
642
- received_at_ms: observation.receivedAtMs,
643
- state: observation.state,
644
- http_status: observation.httpStatus
645
- });
646
- }
647
- function recordPlayTermination(run) {
648
- if (typeof run.id !== "string" || !["completed", "failed", "cancelled", "canceled"].includes(
649
- String(run.status)
650
- ) || typeof run.finishedAt !== "number" || !Number.isSafeInteger(run.finishedAt) || run.finishedAt <= 0)
651
- return;
652
- writeObservation({
653
- kind: "play_terminal",
654
- run: { id: run.id, status: run.status, finishedAt: run.finishedAt }
628
+ function describedPlay(play) {
629
+ const reference = play.reference || play.name;
630
+ const starter = play.cloneEditStarter ?? cloneEditStarter(play);
631
+ const csv = play.csvInput ?? {};
632
+ const csvField = typeof csv.inputField === "string" ? csv.inputField : "csv";
633
+ const alongside = /* @__PURE__ */ new Set([
634
+ csvField,
635
+ "columns",
636
+ ...Array.isArray(csv.runLevelControlFields) ? csv.runLevelControlFields.map(String) : []
637
+ ]);
638
+ const declared = schemaFields(play.inputSchema).map((field) => field.name);
639
+ const rowNames = schemaFields(csv.rowInputSchema).map((field) => field.name);
640
+ const replaced = play.csvInput ? (rowNames.length > 0 ? rowNames : declared).filter(
641
+ (name) => declared.includes(name) && !alongside.has(name)
642
+ ) : [];
643
+ const exclusive = replaced.length ? { field: csvField, with: replaced } : void 0;
644
+ const headers = isRecord(csv.defaultColumns) ? csv.defaultColumns : {};
645
+ const rowInputs = schemaFields(csv.rowInputSchema).map((field) => {
646
+ const header = [headers[field.name]].flat().filter((name) => name && name !== field.name).join(" or ");
647
+ return header ? {
648
+ ...field,
649
+ description: [field.description, `CSV header: ${header}`].filter(Boolean).join(" - ")
650
+ } : field;
655
651
  });
656
- }
657
-
658
- // src/cli/describe-options.ts
659
- function addDescribeOptions(command, options = {}) {
660
- command.option(
661
- "--prebuilt",
662
- "Show the Deepline tool or play, not a play your workspace created under the same name"
663
- ).option("--tool", "Same as --prebuilt").option(
664
- "--verbose",
665
- "Show secondary fields, and fill in every input and read every output in the examples"
666
- ).option(
667
- "--cli-example",
668
- "Show only the CLI example, and explain how it takes inputs and returns outputs"
669
- ).option(
670
- "--play-example",
671
- "Show only the in-play example, and explain how it takes inputs and returns outputs"
672
- ).option("--no-example", "Hide the run examples").option(
673
- "--full-schema",
674
- `Print every field: a long schema unfolded (over ${SCHEMA_LINE_LIMIT} lines), list rows, and a tool's raw response`
675
- ).option(
676
- "--fields <names>",
677
- "Show only these fields, comma-separated, plus every required input"
678
- ).option(
679
- "--feature <name[=value]>",
680
- "Describe one feature of a tool, such as a model: --feature model=openai/gpt-5.6-luna. A tool lists its features."
681
- ).option(
682
- "-o, --out <path>",
683
- "Save the output to this file instead of printing it"
684
- );
685
- if (options.schemaOnly !== false) {
686
- command.option(
687
- "--schema-only",
688
- "Print only the schema, with every field, and nothing else"
689
- );
690
- }
691
- if (options.json !== false) {
692
- command.option(
693
- "--json",
694
- "Print JSON instead of text; with --schema-only, only the input and output JSON Schemas"
695
- );
696
- }
697
- return command;
652
+ const rowOutput = play.rowOutputSchema ?? {};
653
+ const added = isRecord(rowOutput.addedColumns) ? rowOutput.addedColumns : {};
654
+ const rowOutputs = schemaFields(
655
+ Object.keys(added).length ? { properties: added } : rowOutput
656
+ ).map((field) => ({ ...field, required: true }));
657
+ return {
658
+ kind: play.ownerType === "deepline" ? "prebuilt_play" : "custom_play",
659
+ id: reference,
660
+ ...play.displayName && play.displayName !== play.name ? { displayName: play.displayName } : {},
661
+ ...play.description ? { description: play.description } : {},
662
+ ...play.observedCost ? { cost: play.observedCost.displayText } : {},
663
+ guidance: [],
664
+ inputs: schemaFields(play.inputSchema),
665
+ outputs: schemaFields(play.outputSchema),
666
+ ...rowInputs.length ? { rowInputs } : {},
667
+ ...typeof csv.inputField === "string" ? { csvInput: csv.inputField } : {},
668
+ ...rowOutputs.length ? {
669
+ rowOutputs,
670
+ rowOutputsAddToSource: Object.keys(added).length > 0 || rowOutput.preservesSourceColumns === true
671
+ } : {},
672
+ runner: {
673
+ via: "play",
674
+ reference,
675
+ // A CSV play's run command is built by the server around its columns.
676
+ ...play.csvInput ? { cli: play.runCommand } : {}
677
+ },
678
+ ...starter ? { source: starter.command } : {},
679
+ ...exclusive ? { exclusive } : {},
680
+ // A prebuilt's cost is what its recent runs were charged; there is no rate.
681
+ ...play.observedCost?.displayText ? { cost: play.observedCost.displayText } : {}
682
+ };
698
683
  }
699
684
 
700
685
  export {
@@ -708,7 +693,6 @@ export {
708
693
  describedLines,
709
694
  topLevelField,
710
695
  describedJson,
711
- recordApiResponse,
712
- recordPlayTermination,
713
- addDescribeOptions
696
+ buildPlayDashboardUrl,
697
+ describedPlay
714
698
  };
@@ -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.395",
52
+ version: "0.3.397",
53
53
  updateSummary: "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.",
54
54
  packageCapabilities: {
55
55
  updatePreferences: 1,
@@ -17,15 +17,17 @@ import {
17
17
  import {
18
18
  describePlayDetail,
19
19
  describePlayListItem
20
- } from "./chunk-5VCZ3WRH.mjs";
20
+ } from "./chunk-EIMG75BT.mjs";
21
21
  import {
22
22
  COORDINATOR_INTERNAL_TOKEN_HEADER,
23
- CustomerDbQueryOutcomeUnknownError,
24
23
  HttpClient,
25
24
  RETAINED_PIPELINE_RECEIVERS_HEADER,
26
25
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
27
26
  resolveConfig
28
- } from "./chunk-6D7A2FSL.mjs";
27
+ } from "./chunk-2LDADJNO.mjs";
28
+ import {
29
+ CustomerDbQueryOutcomeUnknownError
30
+ } from "./chunk-YHPYUZZX.mjs";
29
31
  import {
30
32
  DeeplineError,
31
33
  TOOL_EXECUTION_ERROR_SCHEMA_HEADER,