deepline 0.3.396 → 0.3.398
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.
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +50 -26
- package/dist/cli/auth-3GA2ASQF.js +40 -0
- package/dist/cli/{auth-3LTD62VL.mjs → auth-7ZBPAAZU.mjs} +5 -4
- package/dist/cli/{billing-DP7ZAJBO.mjs → billing-QTWEEL27.mjs} +5 -4
- package/dist/cli/{billing-PA5OXEM5.js → billing-WHP3YMNQ.js} +76 -75
- package/dist/cli/{chunk-I4T4XAA2.mjs → chunk-2QC2T7E3.mjs} +4 -4
- package/dist/cli/{chunk-3T4MCB5R.mjs → chunk-52HHMLRM.mjs} +89 -969
- package/dist/cli/{chunk-ME6XRFLY.js → chunk-6CBU7W56.js} +15 -15
- package/dist/cli/{chunk-LOGGNW4H.mjs → chunk-6DVXLWPB.mjs} +2 -2
- package/dist/cli/{chunk-AUYXWELC.mjs → chunk-6HXULNTW.mjs} +2 -2
- package/dist/cli/chunk-7DRPTGCK.js +930 -0
- package/dist/cli/{chunk-TLQ3FZOC.mjs → chunk-ATDUVJCW.mjs} +3 -3
- package/dist/cli/{chunk-23GAA3YO.mjs → chunk-AWQNG55D.mjs} +1 -1
- package/dist/cli/{chunk-NSOTASOP.js → chunk-BQR6UN3C.js} +1 -83
- package/dist/cli/{chunk-XKZXO7D3.mjs → chunk-CH6EFAJ3.mjs} +1 -1
- package/dist/cli/{chunk-KAEZNPUM.js → chunk-CTZJLQ7A.js} +13 -115
- package/dist/cli/{chunk-AVHLATII.js → chunk-FDAMQFQ7.js} +50 -50
- package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
- package/dist/cli/{chunk-7Z66NHUC.js → chunk-G6BP55EP.js} +26 -26
- package/dist/cli/{chunk-GNN4MY5X.js → chunk-HFDBZXMV.js} +1 -1
- package/dist/cli/{describe-6O2ENKTP.mjs → chunk-HFYQBC2D.mjs} +22 -160
- package/dist/cli/chunk-HGFFYVXN.js +210 -0
- package/dist/cli/{chunk-5WNJF2T3.mjs → chunk-IHG7UAHD.mjs} +1 -83
- package/dist/cli/{chunk-QHGPA362.mjs → chunk-IJU5YQSF.mjs} +6 -108
- package/dist/cli/{chunk-772W2SAU.js → chunk-J4WYPANC.js} +8 -8
- package/dist/cli/{chunk-V7UP2F4U.js → chunk-JU3PF7WM.js} +21 -121
- package/dist/cli/{chunk-MR6XCBQJ.mjs → chunk-LCRQKI7D.mjs} +4 -2
- package/dist/cli/chunk-LJ5747UC.mjs +107 -0
- package/dist/cli/{chunk-LWERJUKN.js → chunk-NA4T3B62.js} +7 -215
- package/dist/cli/{chunk-WQJJNIMQ.js → chunk-NUBIAJI2.js} +11 -9
- package/dist/cli/chunk-OSDXE27V.mjs +88 -0
- package/dist/cli/{chunk-RMTASUAK.js → chunk-OU2RZYVS.js} +65 -65
- package/dist/cli/{chunk-JCN4DHF7.mjs → chunk-OVUFHUMG.mjs} +2 -2
- package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
- package/dist/cli/{chunk-2VOLOWYZ.js → chunk-Q3FNSWJG.js} +293 -1173
- package/dist/cli/{chunk-NHB5YUCS.mjs → chunk-QP2TRM7M.mjs} +1 -1
- package/dist/cli/{describe-EFWNECHI.js → chunk-RFG3MRAC.js} +37 -175
- package/dist/cli/{chunk-RTO5QZWT.js → chunk-S22ZQZMU.js} +6 -6
- package/dist/cli/{chunk-H5KLUGY7.mjs → chunk-TXZVVBQZ.mjs} +1 -209
- package/dist/cli/{chunk-DC6LTULT.js → chunk-U46S43LV.js} +2 -2
- package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
- package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
- package/dist/cli/chunk-ZAAKSJAS.js +88 -0
- package/dist/cli/{chunk-VE3U3SQC.mjs → chunk-ZJ7HLJRF.mjs} +7 -107
- package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
- package/dist/cli/{csv-TF576S77.js → csv-NM25BBX7.js} +13 -12
- package/dist/cli/{csv-RLRR74RQ.mjs → csv-TSBHKVNU.mjs} +4 -3
- package/dist/cli/{db-FDBJUTFO.js → db-GBDNQJF3.js} +30 -29
- package/dist/cli/{db-XORGNBIC.mjs → db-JQN6SYLK.mjs} +5 -4
- package/dist/cli/describe-ETTGW5LT.mjs +164 -0
- package/dist/cli/describe-NVLINP5A.js +164 -0
- package/dist/cli/describe-core.d.mts +100 -0
- package/dist/cli/describe-core.d.ts +100 -0
- package/dist/cli/describe-core.js +18 -0
- package/dist/cli/describe-core.mjs +18 -0
- package/dist/cli/{executions-YPP7WR77.mjs → executions-6S4KIVEY.mjs} +5 -4
- package/dist/cli/{executions-SFYAXPF4.js → executions-IH5JUPIT.js} +7 -6
- package/dist/cli/{feedback-5UZFYMGB.js → feedback-ER375ZCB.js} +8 -7
- package/dist/cli/{feedback-RBGA5ARU.mjs → feedback-PGOZLNXU.mjs} +4 -3
- package/dist/cli/{git-IRSAJEK2.mjs → git-7SBFCM52.mjs} +5 -4
- package/dist/cli/git-W6DBPLZO.js +24 -0
- package/dist/cli/index.js +93 -91
- package/dist/cli/index.mjs +35 -33
- package/dist/cli/{legacy-noops-CVAOQY2F.js → legacy-noops-IOEF2SB7.js} +8 -7
- package/dist/cli/{legacy-noops-NA7N6ZOU.mjs → legacy-noops-Q4UQIOQN.mjs} +5 -4
- package/dist/cli/{monitors-4OMRXCXP.js → monitors-NZ2J4YGD.js} +86 -85
- package/dist/cli/{monitors-ILZ2XHYG.mjs → monitors-RZYBFY3Z.mjs} +5 -4
- package/dist/cli/{org-YGNJDD2X.js → org-ERUOT4B2.js} +65 -64
- package/dist/cli/{org-QDDXAE3J.mjs → org-JLSEM6GG.mjs} +5 -4
- package/dist/cli/{play-L535H26U.js → play-7TUO7YNG.js} +251 -247
- package/dist/cli/{play-VT6OHB2D.mjs → play-Z73VC7YR.mjs} +19 -15
- package/dist/cli/{providers-KG4W5MPK.mjs → providers-7HIII2PW.mjs} +5 -4
- package/dist/cli/{providers-GPZ6PQAL.js → providers-ABKBK2C7.js} +8 -7
- package/dist/cli/{quickstart-UI27S5LO.js → quickstart-JBG5RTFZ.js} +6 -5
- package/dist/cli/{quickstart-2JDGTXIG.mjs → quickstart-QQAOCPCZ.mjs} +4 -3
- package/dist/cli/{search-PW3RAUX7.mjs → search-MT2Q64WC.mjs} +7 -5
- package/dist/cli/search-QMQBC6SV.js +30 -0
- package/dist/cli/{secrets-WFAXOUZE.js → secrets-MEW6LLU5.js} +14 -13
- package/dist/cli/{secrets-HNOMK5A2.mjs → secrets-ZFJPIT6B.mjs} +5 -4
- package/dist/cli/{sessions-XLX3E5UO.mjs → sessions-F2KVVZ2Z.mjs} +5 -4
- package/dist/cli/sessions-TBPU4S6M.js +16 -0
- package/dist/cli/{settings-GADAG2UK.js → settings-6VDZ6G5V.js} +75 -74
- package/dist/cli/{settings-YNZ4YKCH.mjs → settings-LUDDM7HO.mjs} +8 -7
- package/dist/cli/{setup-R5YO7GT6.js → setup-IP2KTFYO.js} +42 -41
- package/dist/cli/{setup-PSEHIUXO.mjs → setup-MCEY473G.mjs} +7 -6
- package/dist/cli/skills-EVIIEX6N.js +29 -0
- package/dist/cli/{skills-LTQBP6CZ.mjs → skills-KMJ3CY4O.mjs} +5 -4
- package/dist/cli/tools-KNLHQ3L6.js +39 -0
- package/dist/cli/{tools-UAXDWU63.mjs → tools-WY3PLUA7.mjs} +13 -8
- package/dist/cli/update-LVADY5YE.js +29 -0
- package/dist/cli/{update-SMNIBIMS.mjs → update-XBV52OFM.mjs} +7 -6
- package/dist/cli/{workflow-IKGMBGF6.mjs → workflow-5N5HMYDY.mjs} +6 -5
- package/dist/cli/{workflow-AOQVZHMD.js → workflow-CO7XWS4D.js} +16 -15
- package/dist/{client-DiGl8ska.d.mts → client-D0j-_aaa.d.mts} +1 -1
- package/dist/{client-Bgis7F6-.d.ts → client-DflfVyj6.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -10
- package/dist/index.mjs +19 -15
- package/dist/install-integrity.json +92 -76
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +6 -1
- package/dist/cli/auth-562JPKOM.js +0 -39
- package/dist/cli/git-5LDY5ZID.js +0 -23
- package/dist/cli/search-MGWROZ33.js +0 -28
- package/dist/cli/sessions-366KROUA.js +0 -15
- package/dist/cli/skills-JF2LPEGM.js +0 -28
- package/dist/cli/tools-CP2PEFRN.js +0 -34
- package/dist/cli/update-HZHZOU6C.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;
|
|
@@ -682,85 +682,6 @@ function describedPlay(play) {
|
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
// src/cli/describe-options.ts
|
|
686
|
-
function addDescribeOptions(command, options = {}) {
|
|
687
|
-
command.option(
|
|
688
|
-
"--prebuilt",
|
|
689
|
-
"Show the Deepline tool or play, not a play your workspace created under the same name"
|
|
690
|
-
).option("--tool", "Same as --prebuilt").option(
|
|
691
|
-
"--verbose",
|
|
692
|
-
"Show secondary fields, and fill in every input and read every output in the examples"
|
|
693
|
-
).option(
|
|
694
|
-
"--cli-example",
|
|
695
|
-
"Show only the CLI example, and explain how it takes inputs and returns outputs"
|
|
696
|
-
).option(
|
|
697
|
-
"--play-example",
|
|
698
|
-
"Show only the in-play example, and explain how it takes inputs and returns outputs"
|
|
699
|
-
).option("--no-example", "Hide the run examples").option(
|
|
700
|
-
"--full-schema",
|
|
701
|
-
`Print every field: a long schema unfolded (over ${SCHEMA_LINE_LIMIT} lines), list rows, and a tool's raw response`
|
|
702
|
-
).option(
|
|
703
|
-
"--fields <names>",
|
|
704
|
-
"Show only these fields, comma-separated, plus every required input"
|
|
705
|
-
).option(
|
|
706
|
-
"--feature <name[=value]>",
|
|
707
|
-
"Describe one feature of a tool, such as a model: --feature model=openai/gpt-5.6-luna. A tool lists its features."
|
|
708
|
-
).option(
|
|
709
|
-
"-o, --out <path>",
|
|
710
|
-
"Save the output to this file instead of printing it"
|
|
711
|
-
);
|
|
712
|
-
if (options.schemaOnly !== false) {
|
|
713
|
-
command.option(
|
|
714
|
-
"--schema-only",
|
|
715
|
-
"Print only the schema, with every field, and nothing else"
|
|
716
|
-
);
|
|
717
|
-
}
|
|
718
|
-
if (options.json !== false) {
|
|
719
|
-
command.option(
|
|
720
|
-
"--json",
|
|
721
|
-
"Print JSON instead of text; with --schema-only, only the input and output JSON Schemas"
|
|
722
|
-
);
|
|
723
|
-
}
|
|
724
|
-
return command;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
// src/cli/execution-observation.ts
|
|
728
|
-
import { writeFileSync, renameSync } from "fs";
|
|
729
|
-
function writeObservation(observation) {
|
|
730
|
-
const path = process.env.DEEPLINE_EXECUTION_OBSERVATION_PATH;
|
|
731
|
-
const invocationId = process.env.DEEPLINE_EXECUTION_OBSERVATION_ID;
|
|
732
|
-
if (!path || !invocationId) return;
|
|
733
|
-
const pending = `${path}.pending`;
|
|
734
|
-
writeFileSync(
|
|
735
|
-
pending,
|
|
736
|
-
JSON.stringify({
|
|
737
|
-
schema_version: 1,
|
|
738
|
-
invocation_id: invocationId,
|
|
739
|
-
...observation
|
|
740
|
-
}),
|
|
741
|
-
{ mode: 384 }
|
|
742
|
-
);
|
|
743
|
-
renameSync(pending, path);
|
|
744
|
-
}
|
|
745
|
-
function recordApiResponse(observation) {
|
|
746
|
-
writeObservation({
|
|
747
|
-
kind: "api_response",
|
|
748
|
-
received_at_ms: observation.receivedAtMs,
|
|
749
|
-
state: observation.state,
|
|
750
|
-
http_status: observation.httpStatus
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
function recordPlayTermination(run) {
|
|
754
|
-
if (typeof run.id !== "string" || !["completed", "failed", "cancelled", "canceled"].includes(
|
|
755
|
-
String(run.status)
|
|
756
|
-
) || typeof run.finishedAt !== "number" || !Number.isSafeInteger(run.finishedAt) || run.finishedAt <= 0)
|
|
757
|
-
return;
|
|
758
|
-
writeObservation({
|
|
759
|
-
kind: "play_terminal",
|
|
760
|
-
run: { id: run.id, status: run.status, finishedAt: run.finishedAt }
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
|
|
764
685
|
export {
|
|
765
686
|
byokLines,
|
|
766
687
|
SCHEMA_LINE_LIMIT,
|
|
@@ -773,8 +694,5 @@ export {
|
|
|
773
694
|
topLevelField,
|
|
774
695
|
describedJson,
|
|
775
696
|
buildPlayDashboardUrl,
|
|
776
|
-
describedPlay
|
|
777
|
-
addDescribeOptions,
|
|
778
|
-
recordApiResponse,
|
|
779
|
-
recordPlayTermination
|
|
697
|
+
describedPlay
|
|
780
698
|
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
observedMaxText
|
|
3
|
+
} from "./chunk-LJ5747UC.mjs";
|
|
1
4
|
import {
|
|
2
5
|
DeeplineClient
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LCRQKI7D.mjs";
|
|
4
7
|
import {
|
|
5
8
|
printCommandEnvelope,
|
|
6
9
|
renderCommandEnvelopeText
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CH6EFAJ3.mjs";
|
|
8
11
|
import {
|
|
9
12
|
resolveConfig,
|
|
10
13
|
sdkCliStateDirPath
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZJ7HLJRF.mjs";
|
|
12
15
|
|
|
13
16
|
// src/cli/commands/search.ts
|
|
14
17
|
import { Option } from "commander";
|
|
@@ -63,109 +66,6 @@ function formatTextTable(rows, columns) {
|
|
|
63
66
|
}).split("\n").map((line) => line.trimEnd()).join("\n").trimEnd();
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
// src/cli/tool-description.ts
|
|
67
|
-
function observedMaxText(pricing) {
|
|
68
|
-
const max = recordValue(recordValue(pricing).observedMax);
|
|
69
|
-
return typeof max.creditsPerCall === "number" && max.creditsPerCall > 0 ? `max observed ${max.creditsPerCall} credits/call (last ${String(max.windowDays)} days)` : "";
|
|
70
|
-
}
|
|
71
|
-
var Capability = class _Capability {
|
|
72
|
-
#catalogEntry;
|
|
73
|
-
constructor(catalogEntry) {
|
|
74
|
-
this.#catalogEntry = catalogEntry;
|
|
75
|
-
}
|
|
76
|
-
static fromCatalogEntry(catalogEntry) {
|
|
77
|
-
return new _Capability(catalogEntry);
|
|
78
|
-
}
|
|
79
|
-
describe() {
|
|
80
|
-
return CapabilityDescription.fromCatalogEntry(this.#catalogEntry);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var CapabilityDescription = class _CapabilityDescription {
|
|
84
|
-
#catalogEntry;
|
|
85
|
-
constructor(catalogEntry) {
|
|
86
|
-
this.#catalogEntry = catalogEntry;
|
|
87
|
-
}
|
|
88
|
-
static fromCatalogEntry(catalogEntry) {
|
|
89
|
-
return new _CapabilityDescription(catalogEntry);
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* The customer price already resolved by the catalog. This intentionally
|
|
93
|
-
* omits provider-price fields, even when a catalog Adapter carried them.
|
|
94
|
-
*/
|
|
95
|
-
customerCost() {
|
|
96
|
-
const legacyCost = recordValue(this.#catalogEntry.cost);
|
|
97
|
-
const pricing = recordValue(this.#catalogEntry.pricing);
|
|
98
|
-
const unit = stringValue(pricing.unit);
|
|
99
|
-
const legacyPricingModel = stringValue(
|
|
100
|
-
legacyCost.pricingModel ?? legacyCost.pricing_model
|
|
101
|
-
);
|
|
102
|
-
const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
|
|
103
|
-
const canonicalCredits = pricingNumber(
|
|
104
|
-
pricing,
|
|
105
|
-
"creditsPerUnit",
|
|
106
|
-
"credits_per_unit",
|
|
107
|
-
this.#catalogEntry.deeplineCreditsPerPricingUnit ?? this.#catalogEntry.deepline_credits_per_pricing_unit
|
|
108
|
-
);
|
|
109
|
-
const canonicalUsd = pricingNumber(
|
|
110
|
-
pricing,
|
|
111
|
-
"usdPerUnit",
|
|
112
|
-
"usd_per_unit",
|
|
113
|
-
this.#catalogEntry.deeplineUsdPerPricingUnit ?? this.#catalogEntry.deepline_usd_per_pricing_unit
|
|
114
|
-
);
|
|
115
|
-
const billingSource = stringValue(
|
|
116
|
-
this.#catalogEntry.billingSource ?? this.#catalogEntry.billing_source
|
|
117
|
-
);
|
|
118
|
-
const billingSourceLabel = stringValue(
|
|
119
|
-
this.#catalogEntry.billingSourceLabel ?? this.#catalogEntry.billing_source_label
|
|
120
|
-
);
|
|
121
|
-
const isFree = billingSource === "free";
|
|
122
|
-
return {
|
|
123
|
-
pricingModel: pricingModel || null,
|
|
124
|
-
unit: unit || null,
|
|
125
|
-
displayText: isFree ? "Free" : stringValue(pricing.displayText ?? pricing.display_text),
|
|
126
|
-
summary: isFree ? null : stringValue(pricing.summary),
|
|
127
|
-
billingMode: stringValue(
|
|
128
|
-
legacyCost.billingMode ?? legacyCost.billing_mode
|
|
129
|
-
),
|
|
130
|
-
billingSource,
|
|
131
|
-
billingSourceLabel,
|
|
132
|
-
deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
|
|
133
|
-
deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
|
|
134
|
-
...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
135
|
-
estimatedRange: pricing.estimatedRange,
|
|
136
|
-
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
137
|
-
(value) => typeof value === "string"
|
|
138
|
-
) : []
|
|
139
|
-
} : {},
|
|
140
|
-
...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
141
|
-
observedReference: pricing.observedReference,
|
|
142
|
-
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
143
|
-
(value) => typeof value === "string"
|
|
144
|
-
) : []
|
|
145
|
-
} : {},
|
|
146
|
-
...pricing.observedMax && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
147
|
-
observedMax: pricing.observedMax
|
|
148
|
-
} : {}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
function recordValue(value) {
|
|
153
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
154
|
-
}
|
|
155
|
-
function stringValue(value) {
|
|
156
|
-
return typeof value === "string" && value.trim() ? value : null;
|
|
157
|
-
}
|
|
158
|
-
function numberValue(value) {
|
|
159
|
-
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
160
|
-
}
|
|
161
|
-
function pricingNumber(pricing, canonicalKey, aliasKey, legacyValue) {
|
|
162
|
-
for (const key of [canonicalKey, aliasKey]) {
|
|
163
|
-
if (Object.prototype.hasOwnProperty.call(pricing, key))
|
|
164
|
-
return numberValue(pricing[key]);
|
|
165
|
-
}
|
|
166
|
-
return numberValue(legacyValue);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
69
|
// src/cli/search-output.ts
|
|
170
70
|
function clipSummary(value) {
|
|
171
71
|
const characters = Array.from(value.replace(/\s+/gu, " ").trim());
|
|
@@ -483,8 +383,6 @@ Examples:
|
|
|
483
383
|
|
|
484
384
|
export {
|
|
485
385
|
recentSearchRef,
|
|
486
|
-
observedMaxText,
|
|
487
|
-
Capability,
|
|
488
386
|
SEARCH_TYPES,
|
|
489
387
|
parseTypes,
|
|
490
388
|
appendCsv,
|
|
@@ -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
|
|
4
|
+
var _chunkS22ZQZMUjs = require('./chunk-S22ZQZMU.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJU3PF7WMjs = require('./chunk-JU3PF7WM.js');
|
|
8
8
|
|
|
9
9
|
// src/cli/commands/sessions.ts
|
|
10
10
|
|
|
@@ -139,7 +139,7 @@ function currentSessionFile(agent) {
|
|
|
139
139
|
const newestFirst = listSessionFiles(agent).sort(
|
|
140
140
|
(a, b) => b.mtimeMs - a.mtimeMs
|
|
141
141
|
);
|
|
142
|
-
const sessionId =
|
|
142
|
+
const sessionId = _chunkJU3PF7WMjs.agentSessionIdFromEnvironment.call(void 0, );
|
|
143
143
|
const cwd = process.cwd();
|
|
144
144
|
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(newestFirst.find((candidate) => candidate.sessionId === sessionId), () => ( newestFirst.find(
|
|
145
145
|
(candidate) => sessionStartedInDirectory(candidate, cwd)
|
|
@@ -448,7 +448,7 @@ function buildSessionUploadContent(raw) {
|
|
|
448
448
|
return { encodedContent: encoded, needsChunking: true };
|
|
449
449
|
}
|
|
450
450
|
async function uploadPayload(path, payload) {
|
|
451
|
-
const { http } =
|
|
451
|
+
const { http } = _chunkS22ZQZMUjs.getAuthedHttpClient.call(void 0, );
|
|
452
452
|
return await http.post(path, payload);
|
|
453
453
|
}
|
|
454
454
|
async function uploadChunkedSessions(sessions, options) {
|
|
@@ -481,7 +481,7 @@ async function uploadChunkedSessions(sessions, options) {
|
|
|
481
481
|
...options.rating ? { rating: options.rating } : {}
|
|
482
482
|
});
|
|
483
483
|
const sessionIds = sessions.map((session) => session.sessionId);
|
|
484
|
-
|
|
484
|
+
_chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
|
|
485
485
|
{
|
|
486
486
|
...response,
|
|
487
487
|
ok: true,
|
|
@@ -513,7 +513,7 @@ async function handleSessionsSend(options) {
|
|
|
513
513
|
filename: _path.basename.call(void 0, filePath),
|
|
514
514
|
...rating ? { rating } : {}
|
|
515
515
|
});
|
|
516
|
-
|
|
516
|
+
_chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
|
|
517
517
|
{
|
|
518
518
|
...response2,
|
|
519
519
|
ok: true,
|
|
@@ -563,7 +563,7 @@ async function handleSessionsSend(options) {
|
|
|
563
563
|
...rating ? { rating } : {}
|
|
564
564
|
});
|
|
565
565
|
const sessionIds = built.map((session) => session.sessionId);
|
|
566
|
-
|
|
566
|
+
_chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
|
|
567
567
|
{
|
|
568
568
|
...response,
|
|
569
569
|
ok: true,
|
|
@@ -671,7 +671,7 @@ ${refreshMeta}
|
|
|
671
671
|
</body>
|
|
672
672
|
</html>`;
|
|
673
673
|
_fs.writeFileSync.call(void 0, outputPath, html, "utf8");
|
|
674
|
-
|
|
674
|
+
_chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
|
|
675
675
|
{
|
|
676
676
|
ok: true,
|
|
677
677
|
file: outputPath,
|