deepline 0.3.394 → 0.3.396
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/client.ts +30 -162
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/plays/play-description.ts +167 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/cli/{auth-OSXDAVCF.mjs → auth-3LTD62VL.mjs} +4 -4
- package/dist/cli/auth-562JPKOM.js +39 -0
- package/dist/cli/{billing-ZNNKX3UR.mjs → billing-DP7ZAJBO.mjs} +5 -4
- package/dist/cli/{billing-EKLYOXUY.js → billing-PA5OXEM5.js} +76 -75
- package/dist/cli/{chunk-BP33SIZF.mjs → chunk-23GAA3YO.mjs} +1 -1
- package/dist/cli/{chunk-KI635JN4.js → chunk-2VOLOWYZ.js} +1087 -1056
- package/dist/cli/{chunk-XXUDVEXK.mjs → chunk-3T4MCB5R.mjs} +1026 -995
- package/dist/cli/{chunk-VB6KECLU.mjs → chunk-5WNJF2T3.mjs} +102 -36
- package/dist/cli/{chunk-KIUMEOM5.js → chunk-772W2SAU.js} +8 -8
- package/dist/cli/{chunk-2MDDA7A4.js → chunk-7Z66NHUC.js} +26 -26
- package/dist/cli/{chunk-M57J2SK4.mjs → chunk-AUYXWELC.mjs} +2 -2
- package/dist/cli/{chunk-354JCXA2.js → chunk-AVHLATII.js} +50 -50
- package/dist/cli/{chunk-MLPU5SMZ.js → chunk-DC6LTULT.js} +2 -2
- package/dist/cli/chunk-EIMG75BT.mjs +130 -0
- package/dist/cli/{chunk-6YAUMG27.js → chunk-GNN4MY5X.js} +1 -1
- package/dist/cli/{chunk-UXFSWG3Q.mjs → chunk-I4T4XAA2.mjs} +4 -4
- package/dist/cli/{chunk-MFB2VKBO.mjs → chunk-JCN4DHF7.mjs} +2 -2
- package/dist/cli/{chunk-VK6FYZLP.js → chunk-KAEZNPUM.js} +23 -8
- package/dist/cli/chunk-KXMNM4AQ.js +130 -0
- package/dist/cli/{chunk-XRQ2AQL7.mjs → chunk-LOGGNW4H.mjs} +2 -2
- package/dist/cli/{chunk-RDXFGPJU.js → chunk-LWERJUKN.js} +218 -218
- package/dist/cli/{chunk-QIQBYKLB.js → chunk-ME6XRFLY.js} +15 -15
- package/dist/cli/{chunk-JHIJIHFB.mjs → chunk-MR6XCBQJ.mjs} +23 -131
- package/dist/cli/{chunk-TJI2EN6K.mjs → chunk-NHB5YUCS.mjs} +1 -1
- package/dist/cli/{chunk-ZMVJSS6N.js → chunk-NSOTASOP.js} +101 -35
- package/dist/cli/{chunk-ZYBGA4AR.mjs → chunk-QHGPA362.mjs} +18 -3
- package/dist/cli/{chunk-4P27AXEA.js → chunk-RMTASUAK.js} +65 -65
- package/dist/cli/{chunk-KGNTKMRG.js → chunk-RTO5QZWT.js} +6 -6
- package/dist/cli/{chunk-X63FDZJZ.mjs → chunk-TLQ3FZOC.mjs} +3 -3
- package/dist/cli/{chunk-CS6RAIVY.js → chunk-V7UP2F4U.js} +4 -4
- package/dist/cli/{chunk-FJGW5GXU.mjs → chunk-VE3U3SQC.mjs} +1 -1
- package/dist/cli/{chunk-E23BQ5SC.js → chunk-WQJJNIMQ.js} +241 -349
- package/dist/cli/{chunk-NR3DFKNF.mjs → chunk-XKZXO7D3.mjs} +1 -1
- package/dist/cli/{csv-5AXRB35H.mjs → csv-RLRR74RQ.mjs} +3 -3
- package/dist/cli/{csv-LU7O75WE.js → csv-TF576S77.js} +12 -12
- package/dist/cli/{db-F7YTFKVM.js → db-FDBJUTFO.js} +30 -29
- package/dist/cli/{db-7XP5UWEW.mjs → db-XORGNBIC.mjs} +5 -4
- package/dist/cli/{describe-K4ES5LIL.mjs → describe-6O2ENKTP.mjs} +86 -67
- package/dist/cli/{describe-FRH32RDV.js → describe-EFWNECHI.js} +100 -81
- package/dist/cli/{executions-RZV5XPT2.js → executions-SFYAXPF4.js} +7 -6
- package/dist/cli/{executions-IEHEHJUO.mjs → executions-YPP7WR77.mjs} +5 -4
- package/dist/cli/{feedback-3P65QTX3.js → feedback-5UZFYMGB.js} +7 -7
- package/dist/cli/{feedback-FPUVZBAN.mjs → feedback-RBGA5ARU.mjs} +3 -3
- package/dist/cli/git-5LDY5ZID.js +23 -0
- package/dist/cli/{git-GLVVP7TY.mjs → git-IRSAJEK2.mjs} +4 -4
- package/dist/cli/index.js +93 -93
- package/dist/cli/index.mjs +42 -42
- package/dist/cli/{legacy-noops-XKSGZR7Q.js → legacy-noops-CVAOQY2F.js} +7 -7
- package/dist/cli/{legacy-noops-3MOI6NBM.mjs → legacy-noops-NA7N6ZOU.mjs} +4 -4
- package/dist/cli/{monitors-NZ2DYNST.js → monitors-4OMRXCXP.js} +86 -85
- package/dist/cli/{monitors-FTBGNEFG.mjs → monitors-ILZ2XHYG.mjs} +5 -4
- package/dist/cli/{org-V2J5RBCN.mjs → org-QDDXAE3J.mjs} +5 -4
- package/dist/cli/{org-MCKDQXIV.js → org-YGNJDD2X.js} +65 -64
- package/dist/cli/{chunk-RBJYWRCF.js → play-L535H26U.js} +270 -325
- package/dist/cli/{chunk-5BB2RGAX.mjs → play-VT6OHB2D.mjs} +77 -132
- package/dist/cli/{providers-2JEZ2264.js → providers-GPZ6PQAL.js} +8 -7
- package/dist/cli/{providers-I6RQJZFZ.mjs → providers-KG4W5MPK.mjs} +5 -4
- package/dist/cli/{quickstart-BIDQDMO4.mjs → quickstart-2JDGTXIG.mjs} +3 -3
- package/dist/cli/{quickstart-GJ2RPDU3.js → quickstart-UI27S5LO.js} +5 -5
- package/dist/cli/search-MGWROZ33.js +28 -0
- package/dist/cli/{search-ELRXFWG5.mjs → search-PW3RAUX7.mjs} +6 -5
- package/dist/cli/{secrets-SQXGZXIC.mjs → secrets-HNOMK5A2.mjs} +5 -4
- package/dist/cli/{secrets-53IT6VXD.js → secrets-WFAXOUZE.js} +14 -13
- package/dist/cli/{sessions-CAV5M77Y.js → sessions-366KROUA.js} +5 -5
- package/dist/cli/{sessions-2X5QF7SL.mjs → sessions-XLX3E5UO.mjs} +4 -4
- package/dist/cli/{settings-532WNAZO.js → settings-GADAG2UK.js} +75 -74
- package/dist/cli/{settings-7P67VGCJ.mjs → settings-YNZ4YKCH.mjs} +8 -7
- package/dist/cli/{setup-QGGBV2LE.mjs → setup-PSEHIUXO.mjs} +6 -6
- package/dist/cli/{setup-6L2VSUWJ.js → setup-R5YO7GT6.js} +41 -41
- package/dist/cli/skills-JF2LPEGM.js +28 -0
- package/dist/cli/{skills-3FE62WBG.mjs → skills-LTQBP6CZ.mjs} +4 -4
- package/dist/cli/tools-CP2PEFRN.js +34 -0
- package/dist/cli/{tools-DMR25DEF.mjs → tools-UAXDWU63.mjs} +11 -18
- package/dist/cli/update-HZHZOU6C.js +28 -0
- package/dist/cli/{update-6RZMHJZP.mjs → update-SMNIBIMS.mjs} +6 -6
- package/dist/cli/{workflow-TX4F2PIX.js → workflow-AOQVZHMD.js} +16 -15
- package/dist/cli/{workflow-L2DQRE6R.mjs → workflow-IKGMBGF6.mjs} +6 -5
- package/dist/{client-C3O1Ipf3.d.ts → client-Bgis7F6-.d.ts} +22 -12
- package/dist/{client-BktIPdIj.d.mts → client-DiGl8ska.d.mts} +22 -12
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -10
- package/dist/index.mjs +9 -8
- package/dist/install-integrity.json +83 -78
- package/dist/plays/play-description.d.mts +6 -0
- package/dist/plays/play-description.d.ts +6 -0
- package/dist/plays/play-description.js +11 -0
- package/dist/plays/play-description.mjs +11 -0
- 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-IHKISLJQ.js +0 -39
- package/dist/cli/git-MFFAWVVX.js +0 -23
- package/dist/cli/play-AJFGME3B.mjs +0 -158
- package/dist/cli/play-WLSN2EO2.js +0 -158
- package/dist/cli/search-5VN4YD4I.js +0 -27
- package/dist/cli/skills-S6NPZAN7.js +0 -28
- package/dist/cli/tools-647RLXQS.js +0 -41
- package/dist/cli/update-WVTSC3EM.js +0 -28
- package/dist/cli/{chunk-KZZC33PY.mjs → chunk-H5KLUGY7.mjs} +214 -214
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
printCommandEnvelope,
|
|
5
5
|
printJson,
|
|
6
6
|
readCsvRows
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-XKZXO7D3.mjs";
|
|
8
|
+
import "./chunk-VE3U3SQC.mjs";
|
|
9
9
|
import "./chunk-DLIRSHV6.mjs";
|
|
10
10
|
import "./chunk-NXGCO4JB.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-NHB5YUCS.mjs";
|
|
12
12
|
import "./chunk-WZYKRD7T.mjs";
|
|
13
13
|
import "./chunk-KRD6H754.mjs";
|
|
14
14
|
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
|
|
8
|
+
require('./chunk-V7UP2F4U.js');
|
|
9
9
|
require('./chunk-XNYIZMNQ.js');
|
|
10
10
|
require('./chunk-7P5AA3SN.js');
|
|
11
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-GNN4MY5X.js');
|
|
12
12
|
require('./chunk-OG64RBAC.js');
|
|
13
13
|
require('./chunk-COGTRVWW.js');
|
|
14
14
|
|
|
@@ -126,7 +126,7 @@ function renderTable(rows, totalRows, verbose, footer = `showing ${rows.length}
|
|
|
126
126
|
column.length,
|
|
127
127
|
...rows.map((row) => {
|
|
128
128
|
const value = _nullishCoalesce(row[column], () => ( ""));
|
|
129
|
-
return (verbose ? value :
|
|
129
|
+
return (verbose ? value : _chunkRTO5QZWTjs.clip.call(void 0, value, 42)).length;
|
|
130
130
|
})
|
|
131
131
|
)
|
|
132
132
|
])
|
|
@@ -136,7 +136,7 @@ function renderTable(rows, totalRows, verbose, footer = `showing ${rows.length}
|
|
|
136
136
|
const body = rows.map(
|
|
137
137
|
(row) => columns.map((column) => {
|
|
138
138
|
const raw = _nullishCoalesce(row[column], () => ( ""));
|
|
139
|
-
const display = verbose ? raw :
|
|
139
|
+
const display = verbose ? raw : _chunkRTO5QZWTjs.clip.call(void 0, raw, 42);
|
|
140
140
|
return display.padEnd(widths[column]);
|
|
141
141
|
}).join(" | ")
|
|
142
142
|
);
|
|
@@ -156,7 +156,7 @@ async function handleCsvShow(path, options, command) {
|
|
|
156
156
|
{ exitCode: 2 }
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
|
-
const allRows =
|
|
159
|
+
const allRows = _chunkRTO5QZWTjs.readCsvRows.call(void 0, csvPath);
|
|
160
160
|
const [rowStart, rowEnd] = parseRowRange(options.rows);
|
|
161
161
|
const rows = options.summary && options.rows === void 0 ? allRows : selectRows(allRows, rowStart, rowEnd);
|
|
162
162
|
const { rows: selected, columns } = selectColumns(
|
|
@@ -169,7 +169,7 @@ async function handleCsvShow(path, options, command) {
|
|
|
169
169
|
if (options.summary) {
|
|
170
170
|
const summaries = summarizeColumns(selected, columns);
|
|
171
171
|
if (format === "json") {
|
|
172
|
-
|
|
172
|
+
_chunkRTO5QZWTjs.printJson.call(void 0, {
|
|
173
173
|
rows: summaries,
|
|
174
174
|
total_rows: selected.length,
|
|
175
175
|
source_total_rows: allRows.length
|
|
@@ -178,7 +178,7 @@ async function handleCsvShow(path, options, command) {
|
|
|
178
178
|
}
|
|
179
179
|
const displayRows = summaryDisplayRows(summaries);
|
|
180
180
|
if (format === "csv") {
|
|
181
|
-
process.stdout.write(
|
|
181
|
+
process.stdout.write(_chunkRTO5QZWTjs.csvStringFromRows.call(void 0, displayRows));
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
process.stdout.write(
|
|
@@ -193,7 +193,7 @@ async function handleCsvShow(path, options, command) {
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
if (format === "json") {
|
|
196
|
-
|
|
196
|
+
_chunkRTO5QZWTjs.printJson.call(void 0, {
|
|
197
197
|
rows: selected.map((row, index) => ({ __row: rowStart + index, ...row }))
|
|
198
198
|
});
|
|
199
199
|
return;
|
|
@@ -436,7 +436,7 @@ async function handleCsvRenderStart(options) {
|
|
|
436
436
|
if (log) {
|
|
437
437
|
detail = `
|
|
438
438
|
CSV render log:
|
|
439
|
-
${
|
|
439
|
+
${_chunkRTO5QZWTjs.clip.call(void 0, log, 2e3)}`;
|
|
440
440
|
}
|
|
441
441
|
} catch (e7) {
|
|
442
442
|
}
|
|
@@ -487,7 +487,7 @@ async function handleCsvRenderStatus(options) {
|
|
|
487
487
|
if (payload.pid) lines.push(`Render PID: ${payload.pid}`);
|
|
488
488
|
if (payload.url) lines.push(`Render URL: ${payload.url}`);
|
|
489
489
|
lines.push(`Render Health: ${payload.health_status}`);
|
|
490
|
-
|
|
490
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, payload, {
|
|
491
491
|
json: options.json,
|
|
492
492
|
text: `${lines.join("\n")}
|
|
493
493
|
`
|
|
@@ -523,7 +523,7 @@ async function handleCsvRenderStop(options) {
|
|
|
523
523
|
};
|
|
524
524
|
const text = stopped.length > 0 ? `Stopped CSV render process(es): ${stopped.join(" ")}
|
|
525
525
|
` : "No running CSV render process found.\n";
|
|
526
|
-
|
|
526
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
|
|
527
527
|
}
|
|
528
528
|
async function handleCsvRender(action, options) {
|
|
529
529
|
const normalized = _nullishCoalesce(action, () => ( "start"));
|
|
@@ -4,9 +4,10 @@ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
|
|
8
8
|
require('./chunk-S6R3OX7B.js');
|
|
9
9
|
require('./chunk-UHNDVD3P.js');
|
|
10
|
+
require('./chunk-KXMNM4AQ.js');
|
|
10
11
|
require('./chunk-XDVT3GOM.js');
|
|
11
12
|
|
|
12
13
|
|
|
@@ -17,15 +18,15 @@ require('./chunk-XDVT3GOM.js');
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
var
|
|
21
|
+
var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
var
|
|
24
|
+
var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
|
|
24
25
|
require('./chunk-XNYIZMNQ.js');
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
28
|
-
require('./chunk-
|
|
29
|
+
require('./chunk-GNN4MY5X.js');
|
|
29
30
|
require('./chunk-OG64RBAC.js');
|
|
30
31
|
require('./chunk-COGTRVWW.js');
|
|
31
32
|
|
|
@@ -48,8 +49,8 @@ function formatCell(value) {
|
|
|
48
49
|
return text.length > 80 ? `${text.slice(0, 77)}...` : text;
|
|
49
50
|
}
|
|
50
51
|
function tableLines(result) {
|
|
51
|
-
const rows =
|
|
52
|
-
const responseColumns =
|
|
52
|
+
const rows = _chunkRTO5QZWTjs.dataExportRows.call(void 0, customerDbRows(result));
|
|
53
|
+
const responseColumns = _chunkRTO5QZWTjs.dataExportColumns.call(void 0,
|
|
53
54
|
rows,
|
|
54
55
|
customerDbColumnNames(result)
|
|
55
56
|
);
|
|
@@ -95,7 +96,7 @@ function tableLines(result) {
|
|
|
95
96
|
return lines;
|
|
96
97
|
}
|
|
97
98
|
function customerDbRows(result) {
|
|
98
|
-
return
|
|
99
|
+
return _chunkRTO5QZWTjs.recordRows.call(void 0, result.rows);
|
|
99
100
|
}
|
|
100
101
|
function customerDbColumnNames(result) {
|
|
101
102
|
return result.columns.map((column) => column.name).filter(Boolean);
|
|
@@ -117,15 +118,15 @@ function collectErrorText(value) {
|
|
|
117
118
|
].filter(Boolean).join("\n");
|
|
118
119
|
}
|
|
119
120
|
function formatDbQueryError(sql, error) {
|
|
120
|
-
const text = error instanceof
|
|
121
|
+
const text = error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? collectErrorText(error.cause) : collectErrorText(error);
|
|
121
122
|
const lower = text.toLowerCase();
|
|
122
123
|
const referencesStorage = /"storage"\.|storage\./i.test(sql);
|
|
123
124
|
const runIdColumnMissing = /column\s+"?run_id"?\s+does not exist/i.test(text) || /run_id.*does not exist/i.test(lower);
|
|
124
125
|
const relationMissing = /relation\s+["']?[^"']*storage[^"']*["']?\s+does not exist/i.test(text) || /42p01/i.test(text);
|
|
125
126
|
if (referencesStorage && relationMissing) {
|
|
126
127
|
return [
|
|
127
|
-
...error instanceof
|
|
128
|
-
error instanceof
|
|
128
|
+
...error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? [error.message] : [],
|
|
129
|
+
error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? "The server reported that the referenced storage table does not exist." : "Customer DB query failed: the referenced storage table does not exist.",
|
|
129
130
|
"Play dataset tables are created only when the corresponding ctx.dataset(...).run(...) call executes. Pilot branches, early returns, and runs that fail before the dataset do not create that table.",
|
|
130
131
|
"Use `deepline runs get <run-id> --full` to inspect returned dataset handles, then export them with `deepline runs export <run-id> --dataset result.rows --out rows.csv`.",
|
|
131
132
|
`Original error: ${errorMessage(error)}`
|
|
@@ -133,7 +134,7 @@ function formatDbQueryError(sql, error) {
|
|
|
133
134
|
}
|
|
134
135
|
if (referencesStorage && runIdColumnMissing) {
|
|
135
136
|
return [
|
|
136
|
-
...error instanceof
|
|
137
|
+
...error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? [error.message] : [],
|
|
137
138
|
"Customer DB query failed: storage dataset tables use `_run_id`, not `run_id`.",
|
|
138
139
|
"Prefer `deepline runs export <run-id> --dataset result.rows --out rows.csv` unless you are doing deep table debugging.",
|
|
139
140
|
`Original error: ${errorMessage(error)}`
|
|
@@ -148,7 +149,7 @@ function writeCustomerDbCsv(result, outPath) {
|
|
|
148
149
|
const resolved = _path.resolve.call(void 0, outPath);
|
|
149
150
|
_fs.writeFileSync.call(void 0,
|
|
150
151
|
resolved,
|
|
151
|
-
|
|
152
|
+
_chunkRTO5QZWTjs.dataExportCsvString.call(void 0, customerDbRows(result), customerDbColumnNames(result)),
|
|
152
153
|
"utf-8"
|
|
153
154
|
);
|
|
154
155
|
return resolved;
|
|
@@ -189,7 +190,7 @@ function dbQueryExportEnvelope(input) {
|
|
|
189
190
|
function renderDbQueryResult(result, query, options) {
|
|
190
191
|
const { sql, maxRows, operationKey } = query;
|
|
191
192
|
const { format, out: outPath, json: explicitJsonOutput = false } = options;
|
|
192
|
-
const jsonOutput = explicitJsonOutput ||
|
|
193
|
+
const jsonOutput = explicitJsonOutput || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, );
|
|
193
194
|
const toolPayload = JSON.stringify({
|
|
194
195
|
sql,
|
|
195
196
|
result_mode: "rows",
|
|
@@ -200,7 +201,7 @@ function renderDbQueryResult(result, query, options) {
|
|
|
200
201
|
if (format === "csv") {
|
|
201
202
|
if (outPath) {
|
|
202
203
|
const exportedPath = writeCustomerDbCsv(result, outPath);
|
|
203
|
-
|
|
204
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
204
205
|
dbQueryExportEnvelope({
|
|
205
206
|
result,
|
|
206
207
|
format,
|
|
@@ -216,7 +217,7 @@ function renderDbQueryResult(result, query, options) {
|
|
|
216
217
|
);
|
|
217
218
|
return;
|
|
218
219
|
}
|
|
219
|
-
|
|
220
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
220
221
|
dbQueryExportEnvelope({
|
|
221
222
|
result,
|
|
222
223
|
format,
|
|
@@ -226,7 +227,7 @@ function renderDbQueryResult(result, query, options) {
|
|
|
226
227
|
}),
|
|
227
228
|
{
|
|
228
229
|
json: explicitJsonOutput,
|
|
229
|
-
text:
|
|
230
|
+
text: _chunkRTO5QZWTjs.dataExportCsvString.call(void 0,
|
|
230
231
|
customerDbRows(result),
|
|
231
232
|
customerDbColumnNames(result)
|
|
232
233
|
)
|
|
@@ -235,14 +236,14 @@ function renderDbQueryResult(result, query, options) {
|
|
|
235
236
|
return;
|
|
236
237
|
}
|
|
237
238
|
if (format === "markdown") {
|
|
238
|
-
const content =
|
|
239
|
+
const content = _chunkRTO5QZWTjs.markdownTableFromRows.call(void 0,
|
|
239
240
|
customerDbRows(result),
|
|
240
241
|
customerDbColumnNames(result)
|
|
241
242
|
);
|
|
242
243
|
if (outPath) {
|
|
243
244
|
const exportedPath = _path.resolve.call(void 0, outPath);
|
|
244
245
|
_fs.writeFileSync.call(void 0, exportedPath, content, "utf-8");
|
|
245
|
-
|
|
246
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
246
247
|
dbQueryExportEnvelope({
|
|
247
248
|
result,
|
|
248
249
|
format,
|
|
@@ -258,7 +259,7 @@ function renderDbQueryResult(result, query, options) {
|
|
|
258
259
|
);
|
|
259
260
|
return;
|
|
260
261
|
}
|
|
261
|
-
|
|
262
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
262
263
|
dbQueryExportEnvelope({
|
|
263
264
|
result,
|
|
264
265
|
format,
|
|
@@ -273,7 +274,7 @@ function renderDbQueryResult(result, query, options) {
|
|
|
273
274
|
);
|
|
274
275
|
return;
|
|
275
276
|
}
|
|
276
|
-
|
|
277
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
277
278
|
{
|
|
278
279
|
...result,
|
|
279
280
|
next: {
|
|
@@ -347,9 +348,9 @@ async function runDbQueryCommand(options) {
|
|
|
347
348
|
...maxRows === void 0 ? {} : { maxRows },
|
|
348
349
|
...operationKey === void 0 ? {} : { operationKey }
|
|
349
350
|
};
|
|
350
|
-
const plan =
|
|
351
|
+
const plan = _chunkWQJJNIMQjs.planCustomerDbQuery.call(void 0, query);
|
|
351
352
|
if (options.dryRun) {
|
|
352
|
-
|
|
353
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
353
354
|
{
|
|
354
355
|
dryRun: true,
|
|
355
356
|
...plan,
|
|
@@ -362,11 +363,11 @@ async function runDbQueryCommand(options) {
|
|
|
362
363
|
...out === void 0 ? {} : { file: _path.resolve.call(void 0, out) }
|
|
363
364
|
}
|
|
364
365
|
},
|
|
365
|
-
{ json: options.json ||
|
|
366
|
+
{ json: options.json || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, ) }
|
|
366
367
|
);
|
|
367
368
|
return 0;
|
|
368
369
|
}
|
|
369
|
-
const client = new (0,
|
|
370
|
+
const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
|
|
370
371
|
const result = await client.db.query(query);
|
|
371
372
|
renderDbQueryResult(result, query, {
|
|
372
373
|
format,
|
|
@@ -375,8 +376,8 @@ async function runDbQueryCommand(options) {
|
|
|
375
376
|
});
|
|
376
377
|
return 0;
|
|
377
378
|
} catch (error) {
|
|
378
|
-
if (error instanceof
|
|
379
|
-
|
|
379
|
+
if (error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError && (options.json || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, ))) {
|
|
380
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
380
381
|
{
|
|
381
382
|
ok: false,
|
|
382
383
|
error: {
|
|
@@ -424,8 +425,8 @@ function dbRepairPlainText(result) {
|
|
|
424
425
|
async function handleDbRepair(args) {
|
|
425
426
|
const providerIndex = args.indexOf("--provider");
|
|
426
427
|
const provider = providerIndex >= 0 ? _optionalChain([args, 'access', _9 => _9[providerIndex + 1], 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]) : void 0;
|
|
427
|
-
const jsonOutput =
|
|
428
|
-
const client = new (0,
|
|
428
|
+
const jsonOutput = _chunkRTO5QZWTjs.argsWantJson.call(void 0, args);
|
|
429
|
+
const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
|
|
429
430
|
let result;
|
|
430
431
|
try {
|
|
431
432
|
result = await client.repairIngestionStorage(
|
|
@@ -441,7 +442,7 @@ async function handleDbRepair(args) {
|
|
|
441
442
|
console.error(errorMessage2(error));
|
|
442
443
|
return 1;
|
|
443
444
|
}
|
|
444
|
-
|
|
445
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
445
446
|
{
|
|
446
447
|
command: "db repair",
|
|
447
448
|
status: result.status,
|
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
DeeplineClient,
|
|
6
6
|
planCustomerDbQuery
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MR6XCBQJ.mjs";
|
|
8
8
|
import "./chunk-6IKARAYD.mjs";
|
|
9
9
|
import "./chunk-JI2B4RZP.mjs";
|
|
10
|
+
import "./chunk-EIMG75BT.mjs";
|
|
10
11
|
import "./chunk-UBKA33KY.mjs";
|
|
11
12
|
import {
|
|
12
13
|
argsWantJson,
|
|
@@ -17,15 +18,15 @@ import {
|
|
|
17
18
|
printCommandEnvelope,
|
|
18
19
|
recordRows,
|
|
19
20
|
shouldEmitJson
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XKZXO7D3.mjs";
|
|
21
22
|
import {
|
|
22
23
|
CustomerDbQueryOutcomeUnknownError
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VE3U3SQC.mjs";
|
|
24
25
|
import "./chunk-DLIRSHV6.mjs";
|
|
25
26
|
import {
|
|
26
27
|
DeeplineError
|
|
27
28
|
} from "./chunk-NXGCO4JB.mjs";
|
|
28
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-NHB5YUCS.mjs";
|
|
29
30
|
import "./chunk-WZYKRD7T.mjs";
|
|
30
31
|
import "./chunk-KRD6H754.mjs";
|
|
31
32
|
|
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildPlayDashboardUrl,
|
|
3
|
-
describedPlay
|
|
4
|
-
} from "./chunk-5BB2RGAX.mjs";
|
|
5
1
|
import {
|
|
6
2
|
describedTool,
|
|
7
3
|
formatModelDescription,
|
|
8
4
|
publicToolSchemas,
|
|
5
|
+
seedToolListScript,
|
|
9
6
|
toolMetadataJsonForDescribe
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3T4MCB5R.mjs";
|
|
11
8
|
import {
|
|
12
9
|
SCHEMA_LINE_LIMIT,
|
|
13
10
|
addDescribeOptions,
|
|
11
|
+
buildPlayDashboardUrl,
|
|
14
12
|
byokLines,
|
|
15
13
|
describedJson,
|
|
16
14
|
describedLines,
|
|
15
|
+
describedPlay,
|
|
17
16
|
examples,
|
|
18
17
|
schemaLines,
|
|
19
18
|
topLevelField
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5WNJF2T3.mjs";
|
|
21
20
|
import "./chunk-OVDNJAJN.mjs";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-HQXL5526.mjs";
|
|
25
|
-
import "./chunk-ZYBGA4AR.mjs";
|
|
26
|
-
import "./chunk-XRQ2AQL7.mjs";
|
|
27
|
-
import "./chunk-ERFN2QY4.mjs";
|
|
28
|
-
import "./chunk-KZZC33PY.mjs";
|
|
21
|
+
import "./chunk-QHGPA362.mjs";
|
|
22
|
+
import "./chunk-H5KLUGY7.mjs";
|
|
29
23
|
import "./chunk-3HU47EGZ.mjs";
|
|
30
24
|
import {
|
|
31
25
|
DeeplineClient
|
|
32
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MR6XCBQJ.mjs";
|
|
33
27
|
import "./chunk-6IKARAYD.mjs";
|
|
34
28
|
import "./chunk-JI2B4RZP.mjs";
|
|
29
|
+
import "./chunk-EIMG75BT.mjs";
|
|
35
30
|
import "./chunk-UBKA33KY.mjs";
|
|
36
|
-
import "./chunk-UFS752TU.mjs";
|
|
37
31
|
import "./chunk-WXLOW623.mjs";
|
|
38
|
-
import "./chunk-GAMFK2ZP.mjs";
|
|
39
32
|
import {
|
|
40
33
|
printCommandEnvelope
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-XKZXO7D3.mjs";
|
|
35
|
+
import "./chunk-VE3U3SQC.mjs";
|
|
43
36
|
import "./chunk-DLIRSHV6.mjs";
|
|
44
37
|
import {
|
|
45
38
|
DeeplineError
|
|
46
39
|
} from "./chunk-NXGCO4JB.mjs";
|
|
47
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-NHB5YUCS.mjs";
|
|
48
41
|
import "./chunk-WZYKRD7T.mjs";
|
|
49
42
|
import "./chunk-KRD6H754.mjs";
|
|
50
43
|
|
|
@@ -115,29 +108,19 @@ async function describeFeature(tool, feature, value, dependencies) {
|
|
|
115
108
|
return VIEWS[feature.view](value ?? feature.defaultValue, tool, dependencies);
|
|
116
109
|
}
|
|
117
110
|
|
|
118
|
-
// src/cli/
|
|
111
|
+
// src/cli/describe-core.ts
|
|
119
112
|
var FILTER_OF = {
|
|
120
113
|
tool: "tools",
|
|
121
114
|
monitor_type: "monitors",
|
|
122
115
|
prebuilt_play: "prebuilts",
|
|
123
116
|
custom_play: "custom"
|
|
124
117
|
};
|
|
125
|
-
async function
|
|
126
|
-
try {
|
|
127
|
-
return await lookup;
|
|
128
|
-
} catch (error) {
|
|
129
|
-
if (error instanceof DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
throw error;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
async function describeAnything(name, options, onMissing) {
|
|
118
|
+
async function describeName(name, options, lookups) {
|
|
136
119
|
const maintainedOnly = options.prebuilt === true || options.tool === true;
|
|
137
120
|
const wants = (filter) => (!options.kinds || options.kinds.includes(filter)) && !(maintainedOnly && filter === "custom");
|
|
138
|
-
const client = new DeeplineClient();
|
|
139
121
|
const play = async (reference) => {
|
|
140
|
-
const record2 = await
|
|
122
|
+
const record2 = await lookups.play(reference);
|
|
123
|
+
if (!record2) return null;
|
|
141
124
|
return {
|
|
142
125
|
described: describedPlay(record2),
|
|
143
126
|
record: { ...record2 },
|
|
@@ -148,7 +131,8 @@ async function describeAnything(name, options, onMissing) {
|
|
|
148
131
|
};
|
|
149
132
|
};
|
|
150
133
|
const tool = async () => {
|
|
151
|
-
const record2 =
|
|
134
|
+
const record2 = await lookups.tool(name);
|
|
135
|
+
if (!record2) return null;
|
|
152
136
|
const { byok } = record2;
|
|
153
137
|
const features = toolFeatures(record2);
|
|
154
138
|
return {
|
|
@@ -159,12 +143,16 @@ async function describeAnything(name, options, onMissing) {
|
|
|
159
143
|
...byok?.required === true ? { byok } : {},
|
|
160
144
|
...features.length ? { features: features.map(({ view: _view, ...feature }) => feature) } : {}
|
|
161
145
|
},
|
|
162
|
-
record: toolMetadataJsonForDescribe(
|
|
146
|
+
record: toolMetadataJsonForDescribe(
|
|
147
|
+
record2,
|
|
148
|
+
name,
|
|
149
|
+
lookups.seedStarterScript
|
|
150
|
+
),
|
|
163
151
|
schemas: publicToolSchemas(record2),
|
|
164
152
|
feature: (featureName, value) => {
|
|
165
153
|
const feature = features.find(({ name: name2 }) => name2 === featureName);
|
|
166
154
|
return feature ? describeFeature(record2, feature, value, {
|
|
167
|
-
describeModel: (model) =>
|
|
155
|
+
describeModel: (model) => lookups.describeModel(model)
|
|
168
156
|
}) : null;
|
|
169
157
|
}
|
|
170
158
|
};
|
|
@@ -176,19 +164,13 @@ async function describeAnything(name, options, onMissing) {
|
|
|
176
164
|
];
|
|
177
165
|
const matches = await Promise.all(
|
|
178
166
|
sources.filter((source) => source.kinds.some(wants)).map(async ({ kinds, find }) => {
|
|
179
|
-
const match = await
|
|
167
|
+
const match = await find();
|
|
180
168
|
const filter = match && FILTER_OF[match.described.kind];
|
|
181
169
|
return filter && kinds.includes(filter) && wants(filter) ? match : null;
|
|
182
170
|
})
|
|
183
171
|
);
|
|
184
172
|
const [chosen, shadowed] = matches.filter((match) => match !== null);
|
|
185
|
-
if (!chosen) {
|
|
186
|
-
if (onMissing) return onMissing();
|
|
187
|
-
console.error(
|
|
188
|
-
`Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
|
|
189
|
-
);
|
|
190
|
-
return 2;
|
|
191
|
-
}
|
|
173
|
+
if (!chosen) return { status: "missing" };
|
|
192
174
|
const { described, record } = chosen;
|
|
193
175
|
const shadows = described.kind === "custom_play" && shadowed ? {
|
|
194
176
|
kind: shadowed.described.kind,
|
|
@@ -196,49 +178,49 @@ async function describeAnything(name, options, onMissing) {
|
|
|
196
178
|
} : null;
|
|
197
179
|
const note = shadows ? `Showing your workspace play "${name}". It has the same name as a Deepline ${shadows.kind.replace("_", " ")}; see that one with: ${shadows.describeCommand}` : null;
|
|
198
180
|
const verbose = options.verbose === true;
|
|
199
|
-
const json = options.json === true;
|
|
200
181
|
const isPlay = described.kind === "prebuilt_play" || described.kind === "custom_play";
|
|
201
|
-
const dashboardUrl = isPlay ? buildPlayDashboardUrl(
|
|
182
|
+
const dashboardUrl = isPlay ? buildPlayDashboardUrl(lookups.baseUrl, described.id) : null;
|
|
202
183
|
if (options.webUrl) {
|
|
203
184
|
if (!dashboardUrl) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
185
|
+
return {
|
|
186
|
+
status: "refused",
|
|
187
|
+
message: `${described.id} is a ${described.kind.replace("_", " ")}, not a play; only plays have a play page.`,
|
|
188
|
+
exitCode: 1
|
|
189
|
+
};
|
|
208
190
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return 0;
|
|
191
|
+
return {
|
|
192
|
+
status: "described",
|
|
193
|
+
envelope: { dashboardUrl },
|
|
194
|
+
lines: [dashboardUrl]
|
|
195
|
+
};
|
|
215
196
|
}
|
|
216
197
|
if (options.feature !== void 0) {
|
|
217
198
|
const { name: featureName, value } = parseFeatureRequest(options.feature);
|
|
218
199
|
const pending = chosen.feature?.(featureName, value) ?? null;
|
|
219
200
|
const features = described.features ?? [];
|
|
220
201
|
if (!pending) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
202
|
+
return {
|
|
203
|
+
status: "refused",
|
|
204
|
+
message: features.length ? `${described.id} has no feature "${featureName}". Its features: ${features.map(({ name: name2 }) => name2).join(", ")}.` : `${described.id} has no features to describe.`,
|
|
205
|
+
exitCode: 2
|
|
206
|
+
};
|
|
225
207
|
}
|
|
226
208
|
const shownValue = value ?? features.find(({ name: name2 }) => name2 === featureName)?.defaultValue;
|
|
227
209
|
const { details, lines } = await pending;
|
|
228
|
-
return
|
|
229
|
-
|
|
210
|
+
return {
|
|
211
|
+
status: "described",
|
|
212
|
+
envelope: {
|
|
230
213
|
kind: described.kind,
|
|
231
214
|
id: described.id,
|
|
232
215
|
feature: featureName,
|
|
233
216
|
...shownValue ? { value: shownValue } : {},
|
|
234
217
|
details
|
|
235
218
|
},
|
|
236
|
-
[
|
|
219
|
+
lines: [
|
|
237
220
|
`${described.id} --feature ${featureName}${shownValue ? `=${shownValue}` : ""}`,
|
|
238
221
|
...lines
|
|
239
|
-
]
|
|
240
|
-
|
|
241
|
-
);
|
|
222
|
+
]
|
|
223
|
+
};
|
|
242
224
|
}
|
|
243
225
|
const fields = (options.fields ?? "").split(",").map((name2) => name2.trim()).filter(Boolean);
|
|
244
226
|
const named = options.cliExample === true || options.playExample === true;
|
|
@@ -304,7 +286,44 @@ async function describeAnything(name, options, onMissing) {
|
|
|
304
286
|
...dashboardUrl ? { dashboardUrl } : {},
|
|
305
287
|
...shadows ? { shadows, note } : {}
|
|
306
288
|
};
|
|
307
|
-
return
|
|
289
|
+
return { status: "described", envelope, lines: view.lines };
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// src/cli/commands/describe.ts
|
|
293
|
+
async function found(lookup) {
|
|
294
|
+
try {
|
|
295
|
+
return await lookup;
|
|
296
|
+
} catch (error) {
|
|
297
|
+
if (error instanceof DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async function describeAnything(name, options, onMissing) {
|
|
304
|
+
const client = new DeeplineClient();
|
|
305
|
+
const outcome = await describeName(name, options, {
|
|
306
|
+
play: (reference) => found(client.describePlay(reference)),
|
|
307
|
+
tool: async (toolName) => options.fetchedTool ?? await found(client.getTool(toolName)),
|
|
308
|
+
describeModel: (model) => client.describeModel(model),
|
|
309
|
+
baseUrl: client.baseUrl,
|
|
310
|
+
seedStarterScript: seedToolListScript
|
|
311
|
+
});
|
|
312
|
+
if (outcome.status === "missing") {
|
|
313
|
+
if (onMissing) return onMissing();
|
|
314
|
+
console.error(
|
|
315
|
+
`Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
|
|
316
|
+
);
|
|
317
|
+
return 2;
|
|
318
|
+
}
|
|
319
|
+
if (outcome.status === "refused") {
|
|
320
|
+
console.error(outcome.message);
|
|
321
|
+
return outcome.exitCode;
|
|
322
|
+
}
|
|
323
|
+
return deliver(outcome.envelope, outcome.lines, {
|
|
324
|
+
json: options.json === true,
|
|
325
|
+
out: options.out
|
|
326
|
+
});
|
|
308
327
|
}
|
|
309
328
|
function deliver(envelope, lines, { json, out }) {
|
|
310
329
|
const text = `${lines.join("\n")}
|