deepline 0.1.144 → 0.1.146
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/apps/play-runner-workers/src/coordinator-entry.ts +36 -4
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +5 -2
- package/dist/bundling-sources/sdk/src/client.ts +5 -0
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/shared_libs/temporal/constants.ts +4 -3
- package/dist/cli/index.js +492 -43
- package/dist/cli/index.mjs +492 -43
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -604,10 +604,10 @@ var SDK_RELEASE = {
|
|
|
604
604
|
// 0.1.108 ships explicit dataset column/tool recompute policy and removes
|
|
605
605
|
// the SDK enrich generator's one-second stale policy.
|
|
606
606
|
// 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
|
|
607
|
-
version: "0.1.
|
|
607
|
+
version: "0.1.146",
|
|
608
608
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
609
609
|
supportPolicy: {
|
|
610
|
-
latest: "0.1.
|
|
610
|
+
latest: "0.1.146",
|
|
611
611
|
minimumSupported: "0.1.53",
|
|
612
612
|
deprecatedBelow: "0.1.53",
|
|
613
613
|
commandMinimumSupported: [
|
|
@@ -3484,6 +3484,9 @@ var DeeplineClient = class {
|
|
|
3484
3484
|
if (input2.runId?.trim()) {
|
|
3485
3485
|
params.set("runId", input2.runId.trim());
|
|
3486
3486
|
}
|
|
3487
|
+
if (input2.rowMode === "all") {
|
|
3488
|
+
params.set("rowMode", "all");
|
|
3489
|
+
}
|
|
3487
3490
|
return await this.http.get(
|
|
3488
3491
|
`/api/v2/plays/${encodeURIComponent(input2.playName)}/sheet?${params.toString()}`
|
|
3489
3492
|
);
|
|
@@ -11963,7 +11966,8 @@ async function fetchBackingDatasetRows(input2) {
|
|
|
11963
11966
|
tableNamespace,
|
|
11964
11967
|
runId: input2.status.runId,
|
|
11965
11968
|
limit: RUN_EXPORT_PAGE_SIZE,
|
|
11966
|
-
offset
|
|
11969
|
+
offset,
|
|
11970
|
+
rowMode: "all"
|
|
11967
11971
|
});
|
|
11968
11972
|
sheetRows.push(...page.rows);
|
|
11969
11973
|
const summaryTotal = page.summary?.stats?.total;
|
|
@@ -16303,8 +16307,10 @@ function helperSource() {
|
|
|
16303
16307
|
|
|
16304
16308
|
// src/cli/commands/enrich.ts
|
|
16305
16309
|
var ENRICH_EXPORT_PAGE_SIZE = 5e3;
|
|
16310
|
+
var ENRICH_AUTO_BATCH_ROWS = 250;
|
|
16306
16311
|
var EXIT_SERVER2 = 5;
|
|
16307
16312
|
var ENRICH_DEBUG_T0 = Date.now();
|
|
16313
|
+
var GENERATED_ENRICH_ROWS_TABLE_NAMESPACE = "deepline_enrich_rows";
|
|
16308
16314
|
var PLAN_SHAPING_OPTION_NAMES = [
|
|
16309
16315
|
"with",
|
|
16310
16316
|
"withWaterfall",
|
|
@@ -16968,7 +16974,12 @@ async function runGeneratedEnrichPlay(runArgs, options = {}) {
|
|
|
16968
16974
|
async function writeOutputCsv(outputPath, status, options) {
|
|
16969
16975
|
let rowsInfo = extractCanonicalRowsInfo(status);
|
|
16970
16976
|
if (!rowsInfo) {
|
|
16971
|
-
|
|
16977
|
+
rowsInfo = fallbackRowsInfoForGeneratedEnrichExport(status, options);
|
|
16978
|
+
}
|
|
16979
|
+
if (!rowsInfo) {
|
|
16980
|
+
throw new Error(
|
|
16981
|
+
"The generated play did not return row-shaped output, and no durable enrich rows were available to export."
|
|
16982
|
+
);
|
|
16972
16983
|
}
|
|
16973
16984
|
if (options?.client) {
|
|
16974
16985
|
rowsInfo = await fetchBackingRowsForCsvExport({
|
|
@@ -17031,6 +17042,98 @@ function extractPlayName2(status) {
|
|
|
17031
17042
|
}
|
|
17032
17043
|
return null;
|
|
17033
17044
|
}
|
|
17045
|
+
function selectedSourceCsvRange(sourceCsvPath, rows) {
|
|
17046
|
+
const sourceRows = readCsvRows(sourceCsvPath).length;
|
|
17047
|
+
if (sourceRows === 0) {
|
|
17048
|
+
return { start: 0, end: -1, count: 0, sourceRows };
|
|
17049
|
+
}
|
|
17050
|
+
const start = Math.max(0, rows?.rowStart ?? 0);
|
|
17051
|
+
if (start >= sourceRows) {
|
|
17052
|
+
return { start, end: start - 1, count: 0, sourceRows };
|
|
17053
|
+
}
|
|
17054
|
+
const maxEnd = sourceRows - 1;
|
|
17055
|
+
const end = rows?.rowEnd === null || rows?.rowEnd === void 0 ? maxEnd : Math.min(maxEnd, rows.rowEnd);
|
|
17056
|
+
return {
|
|
17057
|
+
start,
|
|
17058
|
+
end,
|
|
17059
|
+
count: Math.max(0, end - start + 1),
|
|
17060
|
+
sourceRows
|
|
17061
|
+
};
|
|
17062
|
+
}
|
|
17063
|
+
function selectedSourceCsvRowCount(options) {
|
|
17064
|
+
if (!options?.sourceCsvPath) {
|
|
17065
|
+
return null;
|
|
17066
|
+
}
|
|
17067
|
+
return selectedSourceCsvRange(options.sourceCsvPath, options.rows).count;
|
|
17068
|
+
}
|
|
17069
|
+
function collectStringFields(value, key, output2, depth = 0) {
|
|
17070
|
+
if (depth > 12 || !value || typeof value !== "object") {
|
|
17071
|
+
return;
|
|
17072
|
+
}
|
|
17073
|
+
if (Array.isArray(value)) {
|
|
17074
|
+
for (const item of value.slice(0, 50)) {
|
|
17075
|
+
collectStringFields(item, key, output2, depth + 1);
|
|
17076
|
+
}
|
|
17077
|
+
return;
|
|
17078
|
+
}
|
|
17079
|
+
const record = value;
|
|
17080
|
+
const direct = record[key];
|
|
17081
|
+
if (typeof direct === "string" && direct.trim()) {
|
|
17082
|
+
output2.add(direct.trim());
|
|
17083
|
+
}
|
|
17084
|
+
for (const child of Object.values(record)) {
|
|
17085
|
+
collectStringFields(child, key, output2, depth + 1);
|
|
17086
|
+
}
|
|
17087
|
+
}
|
|
17088
|
+
function fallbackRowsInfoForGeneratedEnrichExport(status, options) {
|
|
17089
|
+
if (!extractRunId(status) || !extractPlayName2(status)) {
|
|
17090
|
+
return null;
|
|
17091
|
+
}
|
|
17092
|
+
const totalRows = selectedSourceCsvRowCount(options);
|
|
17093
|
+
if (totalRows === null) {
|
|
17094
|
+
return null;
|
|
17095
|
+
}
|
|
17096
|
+
const tableNamespaces = /* @__PURE__ */ new Set();
|
|
17097
|
+
collectStringFields(status, "tableNamespace", tableNamespaces);
|
|
17098
|
+
collectStringFields(status, "artifactTableNamespace", tableNamespaces);
|
|
17099
|
+
const tableNamespace = tableNamespaces.values().next().value ?? GENERATED_ENRICH_ROWS_TABLE_NAMESPACE;
|
|
17100
|
+
return {
|
|
17101
|
+
rows: [],
|
|
17102
|
+
totalRows,
|
|
17103
|
+
columns: [],
|
|
17104
|
+
columnsExplicit: false,
|
|
17105
|
+
complete: false,
|
|
17106
|
+
source: tableNamespace,
|
|
17107
|
+
tableNamespace
|
|
17108
|
+
};
|
|
17109
|
+
}
|
|
17110
|
+
function firstCollectedStringField(value, key) {
|
|
17111
|
+
const fields = /* @__PURE__ */ new Set();
|
|
17112
|
+
collectStringFields(value, key, fields);
|
|
17113
|
+
return fields.values().next().value ?? null;
|
|
17114
|
+
}
|
|
17115
|
+
function emitPlainBatchRunFailure(input2) {
|
|
17116
|
+
process.stderr.write(
|
|
17117
|
+
`Batch ${input2.chunkIndex + 1}/${input2.chunkCount} failed for rows ${input2.rows.rowStart}:${input2.rows.rowEnd}.
|
|
17118
|
+
`
|
|
17119
|
+
);
|
|
17120
|
+
const runId = extractRunId(input2.status);
|
|
17121
|
+
const error = firstCollectedStringField(input2.status, "error") ?? firstCollectedStringField(input2.status, "message");
|
|
17122
|
+
if (runId) {
|
|
17123
|
+
process.stderr.write(`Run id: ${runId}
|
|
17124
|
+
`);
|
|
17125
|
+
}
|
|
17126
|
+
if (error) {
|
|
17127
|
+
process.stderr.write(`Error: ${error}
|
|
17128
|
+
`);
|
|
17129
|
+
}
|
|
17130
|
+
if (runId) {
|
|
17131
|
+
process.stderr.write(
|
|
17132
|
+
`Inspect run output: deepline runs get ${runId} --full --json
|
|
17133
|
+
`
|
|
17134
|
+
);
|
|
17135
|
+
}
|
|
17136
|
+
}
|
|
17034
17137
|
function exportableSheetRow2(row) {
|
|
17035
17138
|
if (!row || typeof row !== "object" || Array.isArray(row)) {
|
|
17036
17139
|
return null;
|
|
@@ -17398,7 +17501,8 @@ async function fetchBackingRowsForCsvExport(input2) {
|
|
|
17398
17501
|
tableNamespace,
|
|
17399
17502
|
runId,
|
|
17400
17503
|
limit: ENRICH_EXPORT_PAGE_SIZE,
|
|
17401
|
-
offset
|
|
17504
|
+
offset,
|
|
17505
|
+
rowMode: "all"
|
|
17402
17506
|
});
|
|
17403
17507
|
sheetRows.push(...page.rows);
|
|
17404
17508
|
const summaryTotal = page.summary?.stats?.total;
|
|
@@ -17766,41 +17870,177 @@ function registerEnrichCommand(program) {
|
|
|
17766
17870
|
const tempPlay = join6(tempDir, "deepline-enrich.play.ts");
|
|
17767
17871
|
try {
|
|
17768
17872
|
await writeFile3(tempPlay, playSource, "utf8");
|
|
17769
|
-
const
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17873
|
+
const runOne = async (input2) => {
|
|
17874
|
+
const runtimeInput = {
|
|
17875
|
+
file: resolve8(input2.sourceCsvPath),
|
|
17876
|
+
...input2.rows.rowStart !== null ? { rowStart: input2.rows.rowStart } : {},
|
|
17877
|
+
...input2.rows.rowEnd !== null ? { rowEnd: input2.rows.rowEnd } : {}
|
|
17878
|
+
};
|
|
17879
|
+
const runArgs = [
|
|
17880
|
+
"--file",
|
|
17881
|
+
tempPlay,
|
|
17882
|
+
"--input",
|
|
17883
|
+
JSON.stringify(runtimeInput),
|
|
17884
|
+
"--watch"
|
|
17885
|
+
];
|
|
17886
|
+
if (options.profile) {
|
|
17887
|
+
runArgs.push("--profile", options.profile);
|
|
17888
|
+
}
|
|
17889
|
+
if (options.noOpen || input2.suppressOpen) {
|
|
17890
|
+
runArgs.push("--no-open");
|
|
17891
|
+
}
|
|
17892
|
+
if (input2.json) {
|
|
17893
|
+
runArgs.push("--json");
|
|
17894
|
+
} else {
|
|
17895
|
+
runArgs.push("--logs");
|
|
17896
|
+
}
|
|
17897
|
+
const timeoutSeconds = options.timeout ? Number.parseInt(options.timeout, 10) : null;
|
|
17898
|
+
if (timeoutSeconds !== null && Number.isFinite(timeoutSeconds) && timeoutSeconds > 0) {
|
|
17899
|
+
runArgs.push("--tail-timeout-ms", String(timeoutSeconds * 1e3));
|
|
17900
|
+
}
|
|
17901
|
+
const captured2 = await runGeneratedEnrichPlay(runArgs, {
|
|
17902
|
+
passthroughStdout: input2.passthroughStdout
|
|
17903
|
+
});
|
|
17904
|
+
const status2 = input2.json ? parseJsonOutput(captured2.stdout) : await resolveWatchedGeneratedPlayStatus({
|
|
17905
|
+
client: client2,
|
|
17906
|
+
stdout: captured2.stdout,
|
|
17907
|
+
exitCode: captured2.result
|
|
17908
|
+
});
|
|
17909
|
+
const exportResult2 = captured2.result === 0 && outputPath ? await writeOutputCsv(outputPath, status2, {
|
|
17910
|
+
client: client2,
|
|
17911
|
+
config,
|
|
17912
|
+
sourceCsvPath: input2.sourceCsvPath,
|
|
17913
|
+
rows: input2.rows,
|
|
17914
|
+
inPlace: Boolean(options.inPlace)
|
|
17915
|
+
}) : null;
|
|
17916
|
+
return { captured: captured2, status: status2, exportResult: exportResult2 };
|
|
17773
17917
|
};
|
|
17774
|
-
const
|
|
17775
|
-
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
|
|
17779
|
-
|
|
17780
|
-
|
|
17781
|
-
|
|
17782
|
-
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
17794
|
-
|
|
17918
|
+
const selectedRange = selectedSourceCsvRange(sourceCsvPath, rows);
|
|
17919
|
+
if (outputPath && selectedRange.count > ENRICH_AUTO_BATCH_ROWS) {
|
|
17920
|
+
const chunkCount = Math.ceil(
|
|
17921
|
+
selectedRange.count / ENRICH_AUTO_BATCH_ROWS
|
|
17922
|
+
);
|
|
17923
|
+
if (!options.json) {
|
|
17924
|
+
process.stderr.write(
|
|
17925
|
+
`Large enrich input selected ${selectedRange.count.toLocaleString()} rows. Running ${chunkCount.toLocaleString()} sequential batch runs of up to ${ENRICH_AUTO_BATCH_ROWS.toLocaleString()} rows and merging ${resolve8(outputPath)}.
|
|
17926
|
+
`
|
|
17927
|
+
);
|
|
17928
|
+
}
|
|
17929
|
+
let workingSourceCsvPath = sourceCsvPath;
|
|
17930
|
+
let lastStatus = null;
|
|
17931
|
+
let finalExportResult = null;
|
|
17932
|
+
let totalEnrichedRows = 0;
|
|
17933
|
+
const batchFailureRows = [];
|
|
17934
|
+
for (let chunkStart = selectedRange.start, chunkIndex = 0; chunkStart <= selectedRange.end; chunkStart += ENRICH_AUTO_BATCH_ROWS, chunkIndex += 1) {
|
|
17935
|
+
const chunkRows = {
|
|
17936
|
+
rowStart: chunkStart,
|
|
17937
|
+
rowEnd: Math.min(
|
|
17938
|
+
selectedRange.end,
|
|
17939
|
+
chunkStart + ENRICH_AUTO_BATCH_ROWS - 1
|
|
17940
|
+
)
|
|
17941
|
+
};
|
|
17942
|
+
if (!options.json) {
|
|
17943
|
+
process.stderr.write(
|
|
17944
|
+
`Batch ${chunkIndex + 1}/${chunkCount}: rows ${chunkRows.rowStart}:${chunkRows.rowEnd}
|
|
17945
|
+
`
|
|
17946
|
+
);
|
|
17947
|
+
}
|
|
17948
|
+
const chunk = await runOne({
|
|
17949
|
+
sourceCsvPath: workingSourceCsvPath,
|
|
17950
|
+
rows: chunkRows,
|
|
17951
|
+
json: true,
|
|
17952
|
+
passthroughStdout: false,
|
|
17953
|
+
suppressOpen: true
|
|
17954
|
+
});
|
|
17955
|
+
lastStatus = chunk.status;
|
|
17956
|
+
if (chunk.captured.result !== 0) {
|
|
17957
|
+
if (options.json) {
|
|
17958
|
+
printJson({
|
|
17959
|
+
ok: false,
|
|
17960
|
+
batch: {
|
|
17961
|
+
chunk: chunkIndex + 1,
|
|
17962
|
+
chunks: chunkCount,
|
|
17963
|
+
rows: chunkRows
|
|
17964
|
+
},
|
|
17965
|
+
result: chunk.status
|
|
17966
|
+
});
|
|
17967
|
+
} else {
|
|
17968
|
+
emitPlainBatchRunFailure({
|
|
17969
|
+
chunkIndex,
|
|
17970
|
+
chunkCount,
|
|
17971
|
+
rows: chunkRows,
|
|
17972
|
+
status: chunk.status
|
|
17973
|
+
});
|
|
17974
|
+
}
|
|
17975
|
+
process.exitCode = chunk.captured.result;
|
|
17976
|
+
return;
|
|
17977
|
+
}
|
|
17978
|
+
if (chunk.exportResult) {
|
|
17979
|
+
finalExportResult = chunk.exportResult;
|
|
17980
|
+
totalEnrichedRows += chunk.exportResult.enrichedRows;
|
|
17981
|
+
batchFailureRows.push(...chunk.exportResult.enrichedDataRows);
|
|
17982
|
+
workingSourceCsvPath = outputPath;
|
|
17983
|
+
}
|
|
17984
|
+
}
|
|
17985
|
+
const outputRows = readCsvRows(outputPath);
|
|
17986
|
+
const failureReport2 = await maybeEmitEnrichFailureReport({
|
|
17987
|
+
config,
|
|
17988
|
+
rows: batchFailureRows,
|
|
17989
|
+
rowRange: {
|
|
17990
|
+
rowStart: selectedRange.start,
|
|
17991
|
+
rowEnd: selectedRange.end
|
|
17992
|
+
},
|
|
17993
|
+
client: client2,
|
|
17994
|
+
outputPath
|
|
17995
|
+
});
|
|
17996
|
+
if (options.json) {
|
|
17997
|
+
const run = rewriteEnrichJsonStatus({
|
|
17998
|
+
status: lastStatus,
|
|
17999
|
+
config,
|
|
18000
|
+
forceAliases,
|
|
18001
|
+
output: finalExportResult ? {
|
|
18002
|
+
...finalExportResult,
|
|
18003
|
+
sourceCsvRows: selectedRange.sourceRows,
|
|
18004
|
+
selectedRows: selectedRange.count,
|
|
18005
|
+
enrichedRows: totalEnrichedRows,
|
|
18006
|
+
rows: outputRows.length,
|
|
18007
|
+
enrichedDataRows: outputRows
|
|
18008
|
+
} : null,
|
|
18009
|
+
failureReport: failureReport2
|
|
18010
|
+
});
|
|
18011
|
+
printJson({
|
|
18012
|
+
ok: !failureReport2,
|
|
18013
|
+
run,
|
|
18014
|
+
batch: {
|
|
18015
|
+
chunks: chunkCount,
|
|
18016
|
+
chunkRows: ENRICH_AUTO_BATCH_ROWS,
|
|
18017
|
+
selectedRows: selectedRange.count
|
|
18018
|
+
},
|
|
18019
|
+
output: finalExportResult ? {
|
|
18020
|
+
sourceCsvRows: selectedRange.sourceRows,
|
|
18021
|
+
selectedRows: selectedRange.count,
|
|
18022
|
+
enrichedRows: totalEnrichedRows,
|
|
18023
|
+
path: finalExportResult.path
|
|
18024
|
+
} : null,
|
|
18025
|
+
...failureReport2 ? {
|
|
18026
|
+
failure_report: {
|
|
18027
|
+
path: failureReport2.path,
|
|
18028
|
+
jobs: failureReport2.jobs.length
|
|
18029
|
+
}
|
|
18030
|
+
} : {}
|
|
18031
|
+
});
|
|
18032
|
+
}
|
|
18033
|
+
if (failureReport2) {
|
|
18034
|
+
process.exitCode = EXIT_SERVER2;
|
|
18035
|
+
}
|
|
18036
|
+
return;
|
|
17795
18037
|
}
|
|
17796
|
-
const captured = await
|
|
18038
|
+
const { captured, status, exportResult } = await runOne({
|
|
18039
|
+
sourceCsvPath,
|
|
18040
|
+
rows,
|
|
18041
|
+
json: Boolean(options.json),
|
|
17797
18042
|
passthroughStdout: !options.json
|
|
17798
18043
|
});
|
|
17799
|
-
const status = options.json ? parseJsonOutput(captured.stdout) : await resolveWatchedGeneratedPlayStatus({
|
|
17800
|
-
client: client2,
|
|
17801
|
-
stdout: captured.stdout,
|
|
17802
|
-
exitCode: captured.result
|
|
17803
|
-
});
|
|
17804
18044
|
if (captured.result !== 0) {
|
|
17805
18045
|
if (options.json) {
|
|
17806
18046
|
printJson({
|
|
@@ -17810,13 +18050,6 @@ function registerEnrichCommand(program) {
|
|
|
17810
18050
|
process.exitCode = captured.result;
|
|
17811
18051
|
return;
|
|
17812
18052
|
}
|
|
17813
|
-
const exportResult = outputPath ? await writeOutputCsv(outputPath, status, {
|
|
17814
|
-
client: client2,
|
|
17815
|
-
config,
|
|
17816
|
-
sourceCsvPath,
|
|
17817
|
-
rows,
|
|
17818
|
-
inPlace: Boolean(options.inPlace)
|
|
17819
|
-
}) : null;
|
|
17820
18053
|
const rowsForFailureReport = exportResult?.enrichedDataRows ?? extractCanonicalRowsInfo(status)?.rows ?? [];
|
|
17821
18054
|
if (options.json) {
|
|
17822
18055
|
const failureReport2 = await maybeEmitEnrichFailureReport({
|
|
@@ -18737,6 +18970,221 @@ Examples:
|
|
|
18737
18970
|
}
|
|
18738
18971
|
}
|
|
18739
18972
|
|
|
18973
|
+
// src/cli/commands/monitors.ts
|
|
18974
|
+
var FORBIDDEN_AS_API_ERROR = { forbiddenAsApiError: true };
|
|
18975
|
+
function buildHttpClient() {
|
|
18976
|
+
return new HttpClient(resolveConfig());
|
|
18977
|
+
}
|
|
18978
|
+
function parseJsonObjectArg(raw, flag) {
|
|
18979
|
+
let parsed;
|
|
18980
|
+
try {
|
|
18981
|
+
parsed = JSON.parse(raw);
|
|
18982
|
+
} catch (error) {
|
|
18983
|
+
throw new Error(
|
|
18984
|
+
`${flag} must be a JSON object. ${error instanceof Error ? error.message : String(error)}`
|
|
18985
|
+
);
|
|
18986
|
+
}
|
|
18987
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
18988
|
+
throw new Error(`${flag} must be a JSON object.`);
|
|
18989
|
+
}
|
|
18990
|
+
return parsed;
|
|
18991
|
+
}
|
|
18992
|
+
function encodeKey(key) {
|
|
18993
|
+
return encodeURIComponent(key);
|
|
18994
|
+
}
|
|
18995
|
+
async function handleMonitorsTools(options) {
|
|
18996
|
+
const http = buildHttpClient();
|
|
18997
|
+
const params = new URLSearchParams();
|
|
18998
|
+
if (options.provider) params.set("provider", options.provider);
|
|
18999
|
+
if (options.tool) params.set("tool", options.tool);
|
|
19000
|
+
if (options.search) params.set("search", options.search);
|
|
19001
|
+
if (options.limit) params.set("limit", options.limit);
|
|
19002
|
+
const query = params.toString();
|
|
19003
|
+
const payload = await http.request(
|
|
19004
|
+
`/api/v2/monitors/tools${query ? `?${query}` : ""}`,
|
|
19005
|
+
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
19006
|
+
);
|
|
19007
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19008
|
+
}
|
|
19009
|
+
async function handleMonitorsCheck(definition, options) {
|
|
19010
|
+
const http = buildHttpClient();
|
|
19011
|
+
const body = parseJsonObjectArg(definition, "--definition");
|
|
19012
|
+
const payload = await http.request(
|
|
19013
|
+
"/api/v2/monitors/check",
|
|
19014
|
+
{ method: "POST", body, ...FORBIDDEN_AS_API_ERROR }
|
|
19015
|
+
);
|
|
19016
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19017
|
+
}
|
|
19018
|
+
async function handleMonitorsDeploy(definition, options) {
|
|
19019
|
+
const http = buildHttpClient();
|
|
19020
|
+
const body = parseJsonObjectArg(definition, "--definition");
|
|
19021
|
+
const payload = await http.request(
|
|
19022
|
+
"/api/v2/monitors/deploy",
|
|
19023
|
+
{ method: "POST", body, ...FORBIDDEN_AS_API_ERROR }
|
|
19024
|
+
);
|
|
19025
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19026
|
+
}
|
|
19027
|
+
async function handleDeployedList(options) {
|
|
19028
|
+
const http = buildHttpClient();
|
|
19029
|
+
const params = new URLSearchParams();
|
|
19030
|
+
if (options.status) params.set("status", options.status);
|
|
19031
|
+
if (options.limit) params.set("limit", options.limit);
|
|
19032
|
+
const query = params.toString();
|
|
19033
|
+
const payload = await http.request(
|
|
19034
|
+
`/api/v2/monitors/deployed${query ? `?${query}` : ""}`,
|
|
19035
|
+
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
19036
|
+
);
|
|
19037
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19038
|
+
}
|
|
19039
|
+
async function handleDeployedGet(key, options) {
|
|
19040
|
+
const http = buildHttpClient();
|
|
19041
|
+
const payload = await http.request(
|
|
19042
|
+
`/api/v2/monitors/deployed/${encodeKey(key)}`,
|
|
19043
|
+
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
19044
|
+
);
|
|
19045
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19046
|
+
}
|
|
19047
|
+
async function handleDeployedDelete(key, options) {
|
|
19048
|
+
const http = buildHttpClient();
|
|
19049
|
+
const params = new URLSearchParams();
|
|
19050
|
+
if (options.localOnly) params.set("local_only", "true");
|
|
19051
|
+
const query = params.toString();
|
|
19052
|
+
const payload = await http.request(
|
|
19053
|
+
`/api/v2/monitors/deployed/${encodeKey(key)}${query ? `?${query}` : ""}`,
|
|
19054
|
+
{ method: "DELETE", ...FORBIDDEN_AS_API_ERROR }
|
|
19055
|
+
);
|
|
19056
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19057
|
+
}
|
|
19058
|
+
async function handleDeployedUpdate(key, patch, options) {
|
|
19059
|
+
const http = buildHttpClient();
|
|
19060
|
+
const body = parseJsonObjectArg(patch, "<patch>");
|
|
19061
|
+
const payload = await http.request(
|
|
19062
|
+
`/api/v2/monitors/deployed/${encodeKey(key)}`,
|
|
19063
|
+
{ method: "PATCH", body, ...FORBIDDEN_AS_API_ERROR }
|
|
19064
|
+
);
|
|
19065
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19066
|
+
}
|
|
19067
|
+
async function handleReactivate(key, options) {
|
|
19068
|
+
const http = buildHttpClient();
|
|
19069
|
+
const payload = await http.request(
|
|
19070
|
+
`/api/v2/monitors/deployed/${encodeKey(key)}/reactivate`,
|
|
19071
|
+
{ method: "POST", body: {}, ...FORBIDDEN_AS_API_ERROR }
|
|
19072
|
+
);
|
|
19073
|
+
printCommandEnvelope(payload, { json: options.json });
|
|
19074
|
+
}
|
|
19075
|
+
function registerMonitorsCommands(program) {
|
|
19076
|
+
const monitors = program.command("monitors").description("Discover, deploy, and manage Deepline monitors.").addHelpText(
|
|
19077
|
+
"after",
|
|
19078
|
+
`
|
|
19079
|
+
Notes:
|
|
19080
|
+
Monitors are provider-backed signal feeds that deliver events into your
|
|
19081
|
+
workspace. Access is granted by a Deepline admin via Admin -> Rollouts; until
|
|
19082
|
+
then these commands return a clear monitor_access_required error.
|
|
19083
|
+
|
|
19084
|
+
Examples:
|
|
19085
|
+
deepline monitors tools --json
|
|
19086
|
+
deepline monitors check '{"key":"my-monitor","tool":"...","payload":{}}'
|
|
19087
|
+
deepline monitors deploy '{"key":"my-monitor","tool":"...","payload":{}}'
|
|
19088
|
+
deepline monitors deployed --json
|
|
19089
|
+
deepline monitors deployed get my-monitor --json
|
|
19090
|
+
deepline monitors reactivate my-monitor --json
|
|
19091
|
+
`
|
|
19092
|
+
);
|
|
19093
|
+
monitors.command("tools").description("List or describe the monitor tools available to your org.").addHelpText(
|
|
19094
|
+
"after",
|
|
19095
|
+
`
|
|
19096
|
+
Notes:
|
|
19097
|
+
Read-only. Filter the catalog with --provider, --tool, --search, or --limit.
|
|
19098
|
+
Pass --tool to describe a single monitor tool.
|
|
19099
|
+
|
|
19100
|
+
Examples:
|
|
19101
|
+
deepline monitors tools
|
|
19102
|
+
deepline monitors tools --provider theirstack --json
|
|
19103
|
+
deepline monitors tools --tool theirstack_jobs --json
|
|
19104
|
+
`
|
|
19105
|
+
).option("--provider <provider>", "Filter by provider").option("--tool <tool>", "Describe a single monitor tool by id").option("--search <query>", "Search monitor tools by text").option("--limit <n>", "Limit the number of monitor tools returned").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleMonitorsTools);
|
|
19106
|
+
monitors.command("check <definition>").description("Validate a monitor definition without deploying it.").addHelpText(
|
|
19107
|
+
"after",
|
|
19108
|
+
`
|
|
19109
|
+
Notes:
|
|
19110
|
+
Read-only validation. <definition> is a JSON object with key, tool, payload,
|
|
19111
|
+
and optional controls. Does not deploy or spend credits.
|
|
19112
|
+
|
|
19113
|
+
Examples:
|
|
19114
|
+
deepline monitors check '{"key":"my-monitor","tool":"theirstack_jobs","payload":{}}'
|
|
19115
|
+
`
|
|
19116
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleMonitorsCheck);
|
|
19117
|
+
monitors.command("deploy <definition>").description("Deploy a monitor from a definition.").addHelpText(
|
|
19118
|
+
"after",
|
|
19119
|
+
`
|
|
19120
|
+
Notes:
|
|
19121
|
+
Mutates workspace state and may spend Deepline credits. <definition> is a JSON
|
|
19122
|
+
object with key, tool, payload, and optional controls.
|
|
19123
|
+
|
|
19124
|
+
Examples:
|
|
19125
|
+
deepline monitors deploy '{"key":"my-monitor","tool":"theirstack_jobs","payload":{}}'
|
|
19126
|
+
`
|
|
19127
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleMonitorsDeploy);
|
|
19128
|
+
monitors.command("reactivate <key>").description("Reactivate a previously disabled deployed monitor.").addHelpText(
|
|
19129
|
+
"after",
|
|
19130
|
+
`
|
|
19131
|
+
Notes:
|
|
19132
|
+
Mutates workspace state and may spend Deepline credits.
|
|
19133
|
+
|
|
19134
|
+
Examples:
|
|
19135
|
+
deepline monitors reactivate my-monitor --json
|
|
19136
|
+
`
|
|
19137
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleReactivate);
|
|
19138
|
+
const deployed = monitors.command("deployed").description("List and manage your deployed monitors.").addHelpText(
|
|
19139
|
+
"after",
|
|
19140
|
+
`
|
|
19141
|
+
Notes:
|
|
19142
|
+
With no subcommand, lists deployed monitors. Use get/update/delete to manage a
|
|
19143
|
+
single monitor by its public key.
|
|
19144
|
+
|
|
19145
|
+
Examples:
|
|
19146
|
+
deepline monitors deployed --json
|
|
19147
|
+
deepline monitors deployed --status all --json
|
|
19148
|
+
deepline monitors deployed get my-monitor --json
|
|
19149
|
+
`
|
|
19150
|
+
).option("--status <status>", 'Filter by monitor status (or "all")').option("--limit <n>", "Limit the number of deployed monitors returned").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleDeployedList);
|
|
19151
|
+
deployed.command("get <key>").description("Show a single deployed monitor by its public key.").addHelpText(
|
|
19152
|
+
"after",
|
|
19153
|
+
`
|
|
19154
|
+
Notes:
|
|
19155
|
+
Read-only.
|
|
19156
|
+
|
|
19157
|
+
Examples:
|
|
19158
|
+
deepline monitors deployed get my-monitor --json
|
|
19159
|
+
`
|
|
19160
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleDeployedGet);
|
|
19161
|
+
deployed.command("update <key> <patch>").description("Update a deployed monitor by its public key.").addHelpText(
|
|
19162
|
+
"after",
|
|
19163
|
+
`
|
|
19164
|
+
Notes:
|
|
19165
|
+
Mutates workspace state. <patch> is a JSON object of fields to update.
|
|
19166
|
+
|
|
19167
|
+
Examples:
|
|
19168
|
+
deepline monitors deployed update my-monitor '{"controls":{"enabled":false}}' --json
|
|
19169
|
+
`
|
|
19170
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleDeployedUpdate);
|
|
19171
|
+
deployed.command("delete <key>").description("Delete a deployed monitor by its public key.").addHelpText(
|
|
19172
|
+
"after",
|
|
19173
|
+
`
|
|
19174
|
+
Notes:
|
|
19175
|
+
Mutates workspace state. By default deprovisions the upstream provider
|
|
19176
|
+
resource; pass --local-only to remove only the Deepline-managed record.
|
|
19177
|
+
|
|
19178
|
+
Examples:
|
|
19179
|
+
deepline monitors deployed delete my-monitor --json
|
|
19180
|
+
deepline monitors deployed delete my-monitor --local-only --json
|
|
19181
|
+
`
|
|
19182
|
+
).option(
|
|
19183
|
+
"--local-only",
|
|
19184
|
+
"Remove only the Deepline-managed record, leaving the upstream resource"
|
|
19185
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleDeployedDelete);
|
|
19186
|
+
}
|
|
19187
|
+
|
|
18740
19188
|
// src/cli/commands/org.ts
|
|
18741
19189
|
async function fetchOrganizations(http, apiKey) {
|
|
18742
19190
|
return http.post("/api/v2/auth/cli/organizations", { api_key: apiKey });
|
|
@@ -23797,6 +24245,7 @@ Exit codes:
|
|
|
23797
24245
|
registerWorkflowCommands(program);
|
|
23798
24246
|
registerSecretsCommands(program);
|
|
23799
24247
|
registerBillingCommands(program);
|
|
24248
|
+
registerMonitorsCommands(program);
|
|
23800
24249
|
registerOrgCommands(program);
|
|
23801
24250
|
registerEnrichCommand(program);
|
|
23802
24251
|
registerCsvCommands(program);
|
package/dist/index.d.mts
CHANGED
|
@@ -1205,6 +1205,7 @@ type RunsNamespace = {
|
|
|
1205
1205
|
runId?: string;
|
|
1206
1206
|
limit?: number;
|
|
1207
1207
|
offset?: number;
|
|
1208
|
+
rowMode?: 'output' | 'all';
|
|
1208
1209
|
}) => Promise<PlaySheetRowsResult>;
|
|
1209
1210
|
/** Stop a running/waiting run. */
|
|
1210
1211
|
stop: (runId: string, options?: {
|
|
@@ -1956,6 +1957,7 @@ declare class DeeplineClient {
|
|
|
1956
1957
|
runId?: string;
|
|
1957
1958
|
limit?: number;
|
|
1958
1959
|
offset?: number;
|
|
1960
|
+
rowMode?: 'output' | 'all';
|
|
1959
1961
|
}): Promise<PlaySheetRowsResult>;
|
|
1960
1962
|
/**
|
|
1961
1963
|
* Stop a run by id using the public runs resource model.
|
package/dist/index.d.ts
CHANGED
|
@@ -1205,6 +1205,7 @@ type RunsNamespace = {
|
|
|
1205
1205
|
runId?: string;
|
|
1206
1206
|
limit?: number;
|
|
1207
1207
|
offset?: number;
|
|
1208
|
+
rowMode?: 'output' | 'all';
|
|
1208
1209
|
}) => Promise<PlaySheetRowsResult>;
|
|
1209
1210
|
/** Stop a running/waiting run. */
|
|
1210
1211
|
stop: (runId: string, options?: {
|
|
@@ -1956,6 +1957,7 @@ declare class DeeplineClient {
|
|
|
1956
1957
|
runId?: string;
|
|
1957
1958
|
limit?: number;
|
|
1958
1959
|
offset?: number;
|
|
1960
|
+
rowMode?: 'output' | 'all';
|
|
1959
1961
|
}): Promise<PlaySheetRowsResult>;
|
|
1960
1962
|
/**
|
|
1961
1963
|
* Stop a run by id using the public runs resource model.
|
package/dist/index.js
CHANGED
|
@@ -418,10 +418,10 @@ var SDK_RELEASE = {
|
|
|
418
418
|
// 0.1.108 ships explicit dataset column/tool recompute policy and removes
|
|
419
419
|
// the SDK enrich generator's one-second stale policy.
|
|
420
420
|
// 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
|
|
421
|
-
version: "0.1.
|
|
421
|
+
version: "0.1.146",
|
|
422
422
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
423
423
|
supportPolicy: {
|
|
424
|
-
latest: "0.1.
|
|
424
|
+
latest: "0.1.146",
|
|
425
425
|
minimumSupported: "0.1.53",
|
|
426
426
|
deprecatedBelow: "0.1.53",
|
|
427
427
|
commandMinimumSupported: [
|
|
@@ -3298,6 +3298,9 @@ var DeeplineClient = class {
|
|
|
3298
3298
|
if (input.runId?.trim()) {
|
|
3299
3299
|
params.set("runId", input.runId.trim());
|
|
3300
3300
|
}
|
|
3301
|
+
if (input.rowMode === "all") {
|
|
3302
|
+
params.set("rowMode", "all");
|
|
3303
|
+
}
|
|
3301
3304
|
return await this.http.get(
|
|
3302
3305
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`
|
|
3303
3306
|
);
|