deepline 0.1.156 → 0.1.158
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/entry.ts +146 -14
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +53 -1
- package/dist/bundling-sources/sdk/src/play.ts +21 -0
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/worker-play-entry.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +8 -4
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-plan.ts +159 -42
- package/dist/bundling-sources/shared_libs/play-runtime/map-chunk-limits.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/step-program-dataset-builder.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +19 -3
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +484 -226
- package/dist/cli/index.js +67 -24
- package/dist/cli/index.mjs +91 -44
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/dist/plays/bundle-play-file.mjs +338 -181
- package/package.json +3 -1
package/dist/cli/index.js
CHANGED
|
@@ -657,10 +657,10 @@ var SDK_RELEASE = {
|
|
|
657
657
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
658
658
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
659
659
|
// fields shipped in 0.1.153.
|
|
660
|
-
version: "0.1.
|
|
660
|
+
version: "0.1.158",
|
|
661
661
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
662
662
|
supportPolicy: {
|
|
663
|
-
latest: "0.1.
|
|
663
|
+
latest: "0.1.158",
|
|
664
664
|
minimumSupported: "0.1.53",
|
|
665
665
|
deprecatedBelow: "0.1.53",
|
|
666
666
|
commandMinimumSupported: [
|
|
@@ -17637,7 +17637,7 @@ async function buildEnrichFailureReport(input2) {
|
|
|
17637
17637
|
rows: input2.rows,
|
|
17638
17638
|
rowRange: input2.rowRange,
|
|
17639
17639
|
client: input2.client,
|
|
17640
|
-
outputPath: input2.exportResult?.path ?? input2.outputPath ?? null,
|
|
17640
|
+
outputPath: input2.reportOutputPath ?? input2.exportResult?.path ?? input2.outputPath ?? null,
|
|
17641
17641
|
status: input2.status
|
|
17642
17642
|
});
|
|
17643
17643
|
}
|
|
@@ -18926,7 +18926,7 @@ function registerEnrichCommand(program) {
|
|
|
18926
18926
|
return;
|
|
18927
18927
|
}
|
|
18928
18928
|
const rows = parseRows(options.rows, options.all);
|
|
18929
|
-
|
|
18929
|
+
let outputPath = options.inPlace ? inputCsv : options.output;
|
|
18930
18930
|
const sourceCsvPath = !options.inPlace && outputPath && await regularFileExists(outputPath) ? outputPath : inputCsv;
|
|
18931
18931
|
const forceAliases = resolveForceAliases(config, options);
|
|
18932
18932
|
for (const alias of collectFailedInputAliases(
|
|
@@ -18944,8 +18944,39 @@ function registerEnrichCommand(program) {
|
|
|
18944
18944
|
});
|
|
18945
18945
|
const tempDir = await (0, import_promises3.mkdtemp)((0, import_node_path12.join)((0, import_node_os8.tmpdir)(), "deepline-enrich-play-"));
|
|
18946
18946
|
const tempPlay = (0, import_node_path12.join)(tempDir, "deepline-enrich.play.ts");
|
|
18947
|
+
let inPlaceTempDir = null;
|
|
18948
|
+
let inPlaceTempOutputPath = null;
|
|
18949
|
+
const inPlaceFinalOutputPath = options.inPlace ? (0, import_node_path12.resolve)(inputCsv) : null;
|
|
18950
|
+
const inPlaceCommitOutputPath = options.inPlace ? (await (0, import_promises3.lstat)(inputCsv)).isSymbolicLink() ? await (0, import_promises3.realpath)(inputCsv) : inPlaceFinalOutputPath : null;
|
|
18951
|
+
const failureReportOutputPath = options.inPlace ? inPlaceFinalOutputPath : null;
|
|
18952
|
+
let inPlaceCommitted = false;
|
|
18953
|
+
const commitInPlaceOutput = async (exportResult) => {
|
|
18954
|
+
if (!inPlaceTempOutputPath || !inPlaceCommitOutputPath || !inPlaceFinalOutputPath) {
|
|
18955
|
+
return exportResult;
|
|
18956
|
+
}
|
|
18957
|
+
await (0, import_promises3.rename)(inPlaceTempOutputPath, inPlaceCommitOutputPath);
|
|
18958
|
+
inPlaceCommitted = true;
|
|
18959
|
+
if (!exportResult) {
|
|
18960
|
+
return null;
|
|
18961
|
+
}
|
|
18962
|
+
return {
|
|
18963
|
+
...exportResult,
|
|
18964
|
+
path: inPlaceFinalOutputPath
|
|
18965
|
+
};
|
|
18966
|
+
};
|
|
18947
18967
|
try {
|
|
18948
18968
|
await (0, import_promises3.writeFile)(tempPlay, playSource, "utf8");
|
|
18969
|
+
if (options.inPlace) {
|
|
18970
|
+
inPlaceTempDir = await (0, import_promises3.mkdtemp)(
|
|
18971
|
+
(0, import_node_path12.join)(
|
|
18972
|
+
(0, import_node_path12.dirname)(inPlaceCommitOutputPath ?? (0, import_node_path12.resolve)(inputCsv)),
|
|
18973
|
+
".deepline-enrich-in-place-"
|
|
18974
|
+
)
|
|
18975
|
+
);
|
|
18976
|
+
inPlaceTempOutputPath = (0, import_node_path12.join)(inPlaceTempDir, "output.csv");
|
|
18977
|
+
await (0, import_promises3.copyFile)((0, import_node_path12.resolve)(inputCsv), inPlaceTempOutputPath);
|
|
18978
|
+
outputPath = inPlaceTempOutputPath;
|
|
18979
|
+
}
|
|
18949
18980
|
const runOne = async (input2) => {
|
|
18950
18981
|
const runtimeInput = {
|
|
18951
18982
|
file: (0, import_node_path12.resolve)(input2.sourceCsvPath),
|
|
@@ -19042,10 +19073,10 @@ function registerEnrichCommand(program) {
|
|
|
19042
19073
|
rows: chunkRows
|
|
19043
19074
|
},
|
|
19044
19075
|
result: chunk.status,
|
|
19045
|
-
output: enrichOutputJson(chunk.exportResult)
|
|
19076
|
+
output: options.inPlace ? null : enrichOutputJson(chunk.exportResult)
|
|
19046
19077
|
});
|
|
19047
19078
|
} else {
|
|
19048
|
-
if (chunk.exportResult) {
|
|
19079
|
+
if (chunk.exportResult && !options.inPlace) {
|
|
19049
19080
|
process.stderr.write(
|
|
19050
19081
|
`Wrote ${chunk.exportResult.rows} row(s) to ${chunk.exportResult.path}${chunk.exportResult.partial ? " (partial run output)" : ""}
|
|
19051
19082
|
`
|
|
@@ -19077,15 +19108,18 @@ function registerEnrichCommand(program) {
|
|
|
19077
19108
|
rowEnd: selectedRange.end
|
|
19078
19109
|
},
|
|
19079
19110
|
client: client2,
|
|
19080
|
-
outputPath,
|
|
19111
|
+
outputPath: failureReportOutputPath ?? finalExportResult?.path ?? outputPath,
|
|
19081
19112
|
status: lastStatus
|
|
19082
19113
|
});
|
|
19114
|
+
if (!failureReport2) {
|
|
19115
|
+
finalExportResult = await commitInPlaceOutput(finalExportResult);
|
|
19116
|
+
}
|
|
19083
19117
|
if (options.json) {
|
|
19084
19118
|
const run = rewriteEnrichJsonStatus({
|
|
19085
19119
|
status: lastStatus,
|
|
19086
19120
|
config,
|
|
19087
19121
|
forceAliases,
|
|
19088
|
-
output: finalExportResult ? {
|
|
19122
|
+
output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
|
|
19089
19123
|
...finalExportResult,
|
|
19090
19124
|
sourceCsvRows: selectedRange.sourceRows,
|
|
19091
19125
|
selectedRows: selectedRange.count,
|
|
@@ -19103,7 +19137,7 @@ function registerEnrichCommand(program) {
|
|
|
19103
19137
|
chunkRows: ENRICH_AUTO_BATCH_ROWS,
|
|
19104
19138
|
selectedRows: selectedRange.count
|
|
19105
19139
|
},
|
|
19106
|
-
output: finalExportResult ? {
|
|
19140
|
+
output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
|
|
19107
19141
|
sourceCsvRows: selectedRange.sourceRows,
|
|
19108
19142
|
selectedRows: selectedRange.count,
|
|
19109
19143
|
enrichedRows: totalEnrichedRows,
|
|
@@ -19130,7 +19164,7 @@ function registerEnrichCommand(program) {
|
|
|
19130
19164
|
});
|
|
19131
19165
|
const rowsForFailureReport = exportResult?.enrichedDataRows ?? extractCanonicalRowsInfo(status)?.rows ?? [];
|
|
19132
19166
|
if (captured.result !== 0) {
|
|
19133
|
-
if (exportResult) {
|
|
19167
|
+
if (exportResult && !options.inPlace) {
|
|
19134
19168
|
process.stderr.write(
|
|
19135
19169
|
`Wrote ${exportResult.rows} row(s) to ${exportResult.path}${exportResult.partial ? " (partial run output)" : ""}
|
|
19136
19170
|
`
|
|
@@ -19143,13 +19177,14 @@ function registerEnrichCommand(program) {
|
|
|
19143
19177
|
client: client2,
|
|
19144
19178
|
exportResult,
|
|
19145
19179
|
outputPath,
|
|
19180
|
+
reportOutputPath: failureReportOutputPath,
|
|
19146
19181
|
status
|
|
19147
19182
|
});
|
|
19148
19183
|
if (options.json) {
|
|
19149
19184
|
printJson({
|
|
19150
19185
|
ok: false,
|
|
19151
19186
|
run: status,
|
|
19152
|
-
output: enrichOutputJson(exportResult),
|
|
19187
|
+
output: options.inPlace ? null : enrichOutputJson(exportResult),
|
|
19153
19188
|
...failureReport2 ? {
|
|
19154
19189
|
failure_report: {
|
|
19155
19190
|
path: failureReport2.path,
|
|
@@ -19169,19 +19204,21 @@ function registerEnrichCommand(program) {
|
|
|
19169
19204
|
client: client2,
|
|
19170
19205
|
exportResult,
|
|
19171
19206
|
outputPath,
|
|
19207
|
+
reportOutputPath: failureReportOutputPath,
|
|
19172
19208
|
status
|
|
19173
19209
|
});
|
|
19210
|
+
const committedExportResult2 = failureReport2 ? exportResult : await commitInPlaceOutput(exportResult);
|
|
19174
19211
|
const run = rewriteEnrichJsonStatus({
|
|
19175
19212
|
status,
|
|
19176
19213
|
config,
|
|
19177
19214
|
forceAliases,
|
|
19178
|
-
output:
|
|
19215
|
+
output: failureReport2 && options.inPlace ? null : committedExportResult2,
|
|
19179
19216
|
failureReport: failureReport2
|
|
19180
19217
|
});
|
|
19181
19218
|
printJson({
|
|
19182
19219
|
ok: !failureReport2,
|
|
19183
19220
|
run,
|
|
19184
|
-
output: enrichOutputJson(
|
|
19221
|
+
output: failureReport2 && options.inPlace ? null : enrichOutputJson(committedExportResult2),
|
|
19185
19222
|
...failureReport2 ? {
|
|
19186
19223
|
failure_report: {
|
|
19187
19224
|
path: failureReport2.path,
|
|
@@ -19194,32 +19231,38 @@ function registerEnrichCommand(program) {
|
|
|
19194
19231
|
}
|
|
19195
19232
|
return;
|
|
19196
19233
|
}
|
|
19197
|
-
|
|
19234
|
+
const failureReport = await maybeEmitEnrichFailureReport({
|
|
19235
|
+
config,
|
|
19236
|
+
rows: rowsForFailureReport,
|
|
19237
|
+
rowRange: rows,
|
|
19238
|
+
client: client2,
|
|
19239
|
+
outputPath: failureReportOutputPath ?? exportResult?.path ?? null,
|
|
19240
|
+
status
|
|
19241
|
+
});
|
|
19242
|
+
const committedExportResult = failureReport ? options.inPlace ? null : exportResult : await commitInPlaceOutput(exportResult);
|
|
19243
|
+
if (committedExportResult) {
|
|
19198
19244
|
process.stderr.write(
|
|
19199
|
-
`Wrote ${
|
|
19245
|
+
`Wrote ${committedExportResult.rows} row(s) to ${committedExportResult.path}
|
|
19200
19246
|
`
|
|
19201
19247
|
);
|
|
19202
19248
|
const waterfallSummaryLines = buildEnrichWaterfallSummaryLines(
|
|
19203
19249
|
config,
|
|
19204
|
-
|
|
19250
|
+
committedExportResult.enrichedDataRows
|
|
19205
19251
|
);
|
|
19206
19252
|
if (waterfallSummaryLines.length > 0) {
|
|
19207
19253
|
process.stdout.write(`${waterfallSummaryLines.join("\n")}
|
|
19208
19254
|
`);
|
|
19209
19255
|
}
|
|
19210
19256
|
}
|
|
19211
|
-
const failureReport = await maybeEmitEnrichFailureReport({
|
|
19212
|
-
config,
|
|
19213
|
-
rows: rowsForFailureReport,
|
|
19214
|
-
rowRange: rows,
|
|
19215
|
-
client: client2,
|
|
19216
|
-
outputPath: exportResult?.path ?? outputPath ?? null,
|
|
19217
|
-
status
|
|
19218
|
-
});
|
|
19219
19257
|
if (failureReport) {
|
|
19220
19258
|
process.exitCode = EXIT_SERVER2;
|
|
19221
19259
|
}
|
|
19222
19260
|
} finally {
|
|
19261
|
+
if (inPlaceTempDir) {
|
|
19262
|
+
await (0, import_promises3.rm)(inPlaceTempDir, { recursive: true, force: true });
|
|
19263
|
+
} else if (inPlaceTempOutputPath && !inPlaceCommitted) {
|
|
19264
|
+
await (0, import_promises3.rm)(inPlaceTempOutputPath, { force: true });
|
|
19265
|
+
}
|
|
19223
19266
|
await (0, import_promises3.rm)(tempDir, { recursive: true, force: true });
|
|
19224
19267
|
}
|
|
19225
19268
|
});
|
package/dist/cli/index.mjs
CHANGED
|
@@ -642,10 +642,10 @@ var SDK_RELEASE = {
|
|
|
642
642
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
643
643
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
644
644
|
// fields shipped in 0.1.153.
|
|
645
|
-
version: "0.1.
|
|
645
|
+
version: "0.1.158",
|
|
646
646
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
647
647
|
supportPolicy: {
|
|
648
|
-
latest: "0.1.
|
|
648
|
+
latest: "0.1.158",
|
|
649
649
|
minimumSupported: "0.1.53",
|
|
650
650
|
deprecatedBelow: "0.1.53",
|
|
651
651
|
commandMinimumSupported: [
|
|
@@ -7636,15 +7636,19 @@ Examples:
|
|
|
7636
7636
|
|
|
7637
7637
|
// src/cli/commands/enrich.ts
|
|
7638
7638
|
import {
|
|
7639
|
+
copyFile,
|
|
7640
|
+
lstat,
|
|
7639
7641
|
mkdir as mkdir3,
|
|
7640
7642
|
mkdtemp,
|
|
7641
7643
|
readFile,
|
|
7644
|
+
realpath,
|
|
7645
|
+
rename,
|
|
7642
7646
|
rm,
|
|
7643
7647
|
stat,
|
|
7644
7648
|
writeFile as writeFile3
|
|
7645
7649
|
} from "fs/promises";
|
|
7646
7650
|
import { homedir as homedir7, tmpdir as tmpdir2 } from "os";
|
|
7647
|
-
import { join as join7, resolve as resolve9 } from "path";
|
|
7651
|
+
import { dirname as dirname7, join as join7, resolve as resolve9 } from "path";
|
|
7648
7652
|
|
|
7649
7653
|
// src/cli/commands/play.ts
|
|
7650
7654
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -17660,7 +17664,7 @@ async function buildEnrichFailureReport(input2) {
|
|
|
17660
17664
|
rows: input2.rows,
|
|
17661
17665
|
rowRange: input2.rowRange,
|
|
17662
17666
|
client: input2.client,
|
|
17663
|
-
outputPath: input2.exportResult?.path ?? input2.outputPath ?? null,
|
|
17667
|
+
outputPath: input2.reportOutputPath ?? input2.exportResult?.path ?? input2.outputPath ?? null,
|
|
17664
17668
|
status: input2.status
|
|
17665
17669
|
});
|
|
17666
17670
|
}
|
|
@@ -18949,7 +18953,7 @@ function registerEnrichCommand(program) {
|
|
|
18949
18953
|
return;
|
|
18950
18954
|
}
|
|
18951
18955
|
const rows = parseRows(options.rows, options.all);
|
|
18952
|
-
|
|
18956
|
+
let outputPath = options.inPlace ? inputCsv : options.output;
|
|
18953
18957
|
const sourceCsvPath = !options.inPlace && outputPath && await regularFileExists(outputPath) ? outputPath : inputCsv;
|
|
18954
18958
|
const forceAliases = resolveForceAliases(config, options);
|
|
18955
18959
|
for (const alias of collectFailedInputAliases(
|
|
@@ -18967,8 +18971,39 @@ function registerEnrichCommand(program) {
|
|
|
18967
18971
|
});
|
|
18968
18972
|
const tempDir = await mkdtemp(join7(tmpdir2(), "deepline-enrich-play-"));
|
|
18969
18973
|
const tempPlay = join7(tempDir, "deepline-enrich.play.ts");
|
|
18974
|
+
let inPlaceTempDir = null;
|
|
18975
|
+
let inPlaceTempOutputPath = null;
|
|
18976
|
+
const inPlaceFinalOutputPath = options.inPlace ? resolve9(inputCsv) : null;
|
|
18977
|
+
const inPlaceCommitOutputPath = options.inPlace ? (await lstat(inputCsv)).isSymbolicLink() ? await realpath(inputCsv) : inPlaceFinalOutputPath : null;
|
|
18978
|
+
const failureReportOutputPath = options.inPlace ? inPlaceFinalOutputPath : null;
|
|
18979
|
+
let inPlaceCommitted = false;
|
|
18980
|
+
const commitInPlaceOutput = async (exportResult) => {
|
|
18981
|
+
if (!inPlaceTempOutputPath || !inPlaceCommitOutputPath || !inPlaceFinalOutputPath) {
|
|
18982
|
+
return exportResult;
|
|
18983
|
+
}
|
|
18984
|
+
await rename(inPlaceTempOutputPath, inPlaceCommitOutputPath);
|
|
18985
|
+
inPlaceCommitted = true;
|
|
18986
|
+
if (!exportResult) {
|
|
18987
|
+
return null;
|
|
18988
|
+
}
|
|
18989
|
+
return {
|
|
18990
|
+
...exportResult,
|
|
18991
|
+
path: inPlaceFinalOutputPath
|
|
18992
|
+
};
|
|
18993
|
+
};
|
|
18970
18994
|
try {
|
|
18971
18995
|
await writeFile3(tempPlay, playSource, "utf8");
|
|
18996
|
+
if (options.inPlace) {
|
|
18997
|
+
inPlaceTempDir = await mkdtemp(
|
|
18998
|
+
join7(
|
|
18999
|
+
dirname7(inPlaceCommitOutputPath ?? resolve9(inputCsv)),
|
|
19000
|
+
".deepline-enrich-in-place-"
|
|
19001
|
+
)
|
|
19002
|
+
);
|
|
19003
|
+
inPlaceTempOutputPath = join7(inPlaceTempDir, "output.csv");
|
|
19004
|
+
await copyFile(resolve9(inputCsv), inPlaceTempOutputPath);
|
|
19005
|
+
outputPath = inPlaceTempOutputPath;
|
|
19006
|
+
}
|
|
18972
19007
|
const runOne = async (input2) => {
|
|
18973
19008
|
const runtimeInput = {
|
|
18974
19009
|
file: resolve9(input2.sourceCsvPath),
|
|
@@ -19065,10 +19100,10 @@ function registerEnrichCommand(program) {
|
|
|
19065
19100
|
rows: chunkRows
|
|
19066
19101
|
},
|
|
19067
19102
|
result: chunk.status,
|
|
19068
|
-
output: enrichOutputJson(chunk.exportResult)
|
|
19103
|
+
output: options.inPlace ? null : enrichOutputJson(chunk.exportResult)
|
|
19069
19104
|
});
|
|
19070
19105
|
} else {
|
|
19071
|
-
if (chunk.exportResult) {
|
|
19106
|
+
if (chunk.exportResult && !options.inPlace) {
|
|
19072
19107
|
process.stderr.write(
|
|
19073
19108
|
`Wrote ${chunk.exportResult.rows} row(s) to ${chunk.exportResult.path}${chunk.exportResult.partial ? " (partial run output)" : ""}
|
|
19074
19109
|
`
|
|
@@ -19100,15 +19135,18 @@ function registerEnrichCommand(program) {
|
|
|
19100
19135
|
rowEnd: selectedRange.end
|
|
19101
19136
|
},
|
|
19102
19137
|
client: client2,
|
|
19103
|
-
outputPath,
|
|
19138
|
+
outputPath: failureReportOutputPath ?? finalExportResult?.path ?? outputPath,
|
|
19104
19139
|
status: lastStatus
|
|
19105
19140
|
});
|
|
19141
|
+
if (!failureReport2) {
|
|
19142
|
+
finalExportResult = await commitInPlaceOutput(finalExportResult);
|
|
19143
|
+
}
|
|
19106
19144
|
if (options.json) {
|
|
19107
19145
|
const run = rewriteEnrichJsonStatus({
|
|
19108
19146
|
status: lastStatus,
|
|
19109
19147
|
config,
|
|
19110
19148
|
forceAliases,
|
|
19111
|
-
output: finalExportResult ? {
|
|
19149
|
+
output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
|
|
19112
19150
|
...finalExportResult,
|
|
19113
19151
|
sourceCsvRows: selectedRange.sourceRows,
|
|
19114
19152
|
selectedRows: selectedRange.count,
|
|
@@ -19126,7 +19164,7 @@ function registerEnrichCommand(program) {
|
|
|
19126
19164
|
chunkRows: ENRICH_AUTO_BATCH_ROWS,
|
|
19127
19165
|
selectedRows: selectedRange.count
|
|
19128
19166
|
},
|
|
19129
|
-
output: finalExportResult ? {
|
|
19167
|
+
output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
|
|
19130
19168
|
sourceCsvRows: selectedRange.sourceRows,
|
|
19131
19169
|
selectedRows: selectedRange.count,
|
|
19132
19170
|
enrichedRows: totalEnrichedRows,
|
|
@@ -19153,7 +19191,7 @@ function registerEnrichCommand(program) {
|
|
|
19153
19191
|
});
|
|
19154
19192
|
const rowsForFailureReport = exportResult?.enrichedDataRows ?? extractCanonicalRowsInfo(status)?.rows ?? [];
|
|
19155
19193
|
if (captured.result !== 0) {
|
|
19156
|
-
if (exportResult) {
|
|
19194
|
+
if (exportResult && !options.inPlace) {
|
|
19157
19195
|
process.stderr.write(
|
|
19158
19196
|
`Wrote ${exportResult.rows} row(s) to ${exportResult.path}${exportResult.partial ? " (partial run output)" : ""}
|
|
19159
19197
|
`
|
|
@@ -19166,13 +19204,14 @@ function registerEnrichCommand(program) {
|
|
|
19166
19204
|
client: client2,
|
|
19167
19205
|
exportResult,
|
|
19168
19206
|
outputPath,
|
|
19207
|
+
reportOutputPath: failureReportOutputPath,
|
|
19169
19208
|
status
|
|
19170
19209
|
});
|
|
19171
19210
|
if (options.json) {
|
|
19172
19211
|
printJson({
|
|
19173
19212
|
ok: false,
|
|
19174
19213
|
run: status,
|
|
19175
|
-
output: enrichOutputJson(exportResult),
|
|
19214
|
+
output: options.inPlace ? null : enrichOutputJson(exportResult),
|
|
19176
19215
|
...failureReport2 ? {
|
|
19177
19216
|
failure_report: {
|
|
19178
19217
|
path: failureReport2.path,
|
|
@@ -19192,19 +19231,21 @@ function registerEnrichCommand(program) {
|
|
|
19192
19231
|
client: client2,
|
|
19193
19232
|
exportResult,
|
|
19194
19233
|
outputPath,
|
|
19234
|
+
reportOutputPath: failureReportOutputPath,
|
|
19195
19235
|
status
|
|
19196
19236
|
});
|
|
19237
|
+
const committedExportResult2 = failureReport2 ? exportResult : await commitInPlaceOutput(exportResult);
|
|
19197
19238
|
const run = rewriteEnrichJsonStatus({
|
|
19198
19239
|
status,
|
|
19199
19240
|
config,
|
|
19200
19241
|
forceAliases,
|
|
19201
|
-
output:
|
|
19242
|
+
output: failureReport2 && options.inPlace ? null : committedExportResult2,
|
|
19202
19243
|
failureReport: failureReport2
|
|
19203
19244
|
});
|
|
19204
19245
|
printJson({
|
|
19205
19246
|
ok: !failureReport2,
|
|
19206
19247
|
run,
|
|
19207
|
-
output: enrichOutputJson(
|
|
19248
|
+
output: failureReport2 && options.inPlace ? null : enrichOutputJson(committedExportResult2),
|
|
19208
19249
|
...failureReport2 ? {
|
|
19209
19250
|
failure_report: {
|
|
19210
19251
|
path: failureReport2.path,
|
|
@@ -19217,32 +19258,38 @@ function registerEnrichCommand(program) {
|
|
|
19217
19258
|
}
|
|
19218
19259
|
return;
|
|
19219
19260
|
}
|
|
19220
|
-
|
|
19261
|
+
const failureReport = await maybeEmitEnrichFailureReport({
|
|
19262
|
+
config,
|
|
19263
|
+
rows: rowsForFailureReport,
|
|
19264
|
+
rowRange: rows,
|
|
19265
|
+
client: client2,
|
|
19266
|
+
outputPath: failureReportOutputPath ?? exportResult?.path ?? null,
|
|
19267
|
+
status
|
|
19268
|
+
});
|
|
19269
|
+
const committedExportResult = failureReport ? options.inPlace ? null : exportResult : await commitInPlaceOutput(exportResult);
|
|
19270
|
+
if (committedExportResult) {
|
|
19221
19271
|
process.stderr.write(
|
|
19222
|
-
`Wrote ${
|
|
19272
|
+
`Wrote ${committedExportResult.rows} row(s) to ${committedExportResult.path}
|
|
19223
19273
|
`
|
|
19224
19274
|
);
|
|
19225
19275
|
const waterfallSummaryLines = buildEnrichWaterfallSummaryLines(
|
|
19226
19276
|
config,
|
|
19227
|
-
|
|
19277
|
+
committedExportResult.enrichedDataRows
|
|
19228
19278
|
);
|
|
19229
19279
|
if (waterfallSummaryLines.length > 0) {
|
|
19230
19280
|
process.stdout.write(`${waterfallSummaryLines.join("\n")}
|
|
19231
19281
|
`);
|
|
19232
19282
|
}
|
|
19233
19283
|
}
|
|
19234
|
-
const failureReport = await maybeEmitEnrichFailureReport({
|
|
19235
|
-
config,
|
|
19236
|
-
rows: rowsForFailureReport,
|
|
19237
|
-
rowRange: rows,
|
|
19238
|
-
client: client2,
|
|
19239
|
-
outputPath: exportResult?.path ?? outputPath ?? null,
|
|
19240
|
-
status
|
|
19241
|
-
});
|
|
19242
19284
|
if (failureReport) {
|
|
19243
19285
|
process.exitCode = EXIT_SERVER2;
|
|
19244
19286
|
}
|
|
19245
19287
|
} finally {
|
|
19288
|
+
if (inPlaceTempDir) {
|
|
19289
|
+
await rm(inPlaceTempDir, { recursive: true, force: true });
|
|
19290
|
+
} else if (inPlaceTempOutputPath && !inPlaceCommitted) {
|
|
19291
|
+
await rm(inPlaceTempOutputPath, { force: true });
|
|
19292
|
+
}
|
|
19246
19293
|
await rm(tempDir, { recursive: true, force: true });
|
|
19247
19294
|
}
|
|
19248
19295
|
});
|
|
@@ -19302,7 +19349,7 @@ import {
|
|
|
19302
19349
|
writeFileSync as writeFileSync10
|
|
19303
19350
|
} from "fs";
|
|
19304
19351
|
import { homedir as homedir8, platform } from "os";
|
|
19305
|
-
import { basename as basename2, dirname as
|
|
19352
|
+
import { basename as basename2, dirname as dirname8, join as join8, resolve as resolve10 } from "path";
|
|
19306
19353
|
import { gzipSync } from "zlib";
|
|
19307
19354
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
19308
19355
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -19814,9 +19861,9 @@ function loadViewerAssets() {
|
|
|
19814
19861
|
const cliEntry = process.argv[1]?.trim() ? resolve10(process.argv[1]) : null;
|
|
19815
19862
|
const candidateRoots2 = [
|
|
19816
19863
|
...cliEntry ? [
|
|
19817
|
-
join8(
|
|
19864
|
+
join8(dirname8(dirname8(cliEntry)), "viewer"),
|
|
19818
19865
|
join8(
|
|
19819
|
-
|
|
19866
|
+
dirname8(dirname8(dirname8(cliEntry))),
|
|
19820
19867
|
"src",
|
|
19821
19868
|
"lib",
|
|
19822
19869
|
"cli",
|
|
@@ -19865,7 +19912,7 @@ async function handleSessionsRender(options) {
|
|
|
19865
19912
|
targets.length > 1 ? "session-viewer.html" : `session-${targets[0]?.sessionId}.html`
|
|
19866
19913
|
);
|
|
19867
19914
|
} else {
|
|
19868
|
-
mkdirSync6(
|
|
19915
|
+
mkdirSync6(dirname8(outputPath), { recursive: true });
|
|
19869
19916
|
}
|
|
19870
19917
|
const sessions = targets.map((target) => ({
|
|
19871
19918
|
label: target.label,
|
|
@@ -21340,7 +21387,7 @@ Examples:
|
|
|
21340
21387
|
// src/cli/commands/switch.ts
|
|
21341
21388
|
import { existsSync as existsSync9, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync11 } from "fs";
|
|
21342
21389
|
import { homedir as homedir9 } from "os";
|
|
21343
|
-
import { dirname as
|
|
21390
|
+
import { dirname as dirname9, join as join9 } from "path";
|
|
21344
21391
|
function hostSlugFromBaseUrl(baseUrl) {
|
|
21345
21392
|
try {
|
|
21346
21393
|
const url = new URL(baseUrl);
|
|
@@ -21380,7 +21427,7 @@ function readActiveFamily() {
|
|
|
21380
21427
|
}
|
|
21381
21428
|
function writeActiveFamily(family) {
|
|
21382
21429
|
const path = activeFamilyPath();
|
|
21383
|
-
mkdirSync7(
|
|
21430
|
+
mkdirSync7(dirname9(path), { recursive: true });
|
|
21384
21431
|
writeFileSync11(path, `${family}
|
|
21385
21432
|
`, "utf-8");
|
|
21386
21433
|
return path;
|
|
@@ -21517,7 +21564,7 @@ import {
|
|
|
21517
21564
|
writeSync
|
|
21518
21565
|
} from "fs";
|
|
21519
21566
|
import { homedir as homedir10 } from "os";
|
|
21520
|
-
import { dirname as
|
|
21567
|
+
import { dirname as dirname10, join as join10 } from "path";
|
|
21521
21568
|
function isPlainObject(value) {
|
|
21522
21569
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
21523
21570
|
}
|
|
@@ -21656,7 +21703,7 @@ function writeJsonOutputFile(payload, stem) {
|
|
|
21656
21703
|
}
|
|
21657
21704
|
function writeCsvOutputFile(rows, stem, options) {
|
|
21658
21705
|
const outputPath = options?.outPath ? options.outPath : join10(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
|
|
21659
|
-
mkdirSync8(
|
|
21706
|
+
mkdirSync8(dirname10(outputPath), { recursive: true });
|
|
21660
21707
|
const columns = columnsForRows(rows);
|
|
21661
21708
|
const escapeCell = (value) => {
|
|
21662
21709
|
const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
|
|
@@ -23320,7 +23367,7 @@ async function executeTool(args) {
|
|
|
23320
23367
|
|
|
23321
23368
|
// src/cli/commands/workflow.ts
|
|
23322
23369
|
import { mkdir as mkdir4, readFile as readFile2, writeFile as writeFile4 } from "fs/promises";
|
|
23323
|
-
import { dirname as
|
|
23370
|
+
import { dirname as dirname11, join as join12, resolve as resolve12 } from "path";
|
|
23324
23371
|
|
|
23325
23372
|
// src/cli/workflow-to-play.ts
|
|
23326
23373
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -23599,7 +23646,7 @@ async function transformOne(api, workflowId, outDir, publish) {
|
|
|
23599
23646
|
{ workflowName: workflow.name, version: revision.version }
|
|
23600
23647
|
);
|
|
23601
23648
|
const file = join12(resolve12(outDir), `${compiled.playName}.play.ts`);
|
|
23602
|
-
await mkdir4(
|
|
23649
|
+
await mkdir4(dirname11(file), { recursive: true });
|
|
23603
23650
|
await writeFile4(file, compiled.sourceCode, "utf8");
|
|
23604
23651
|
let published = false;
|
|
23605
23652
|
if (publish) {
|
|
@@ -23857,12 +23904,12 @@ import {
|
|
|
23857
23904
|
writeFileSync as writeFileSync15
|
|
23858
23905
|
} from "fs";
|
|
23859
23906
|
import { homedir as homedir11 } from "os";
|
|
23860
|
-
import { dirname as
|
|
23907
|
+
import { dirname as dirname13, isAbsolute as isAbsolute2, join as join14, relative as relative2, resolve as resolve13 } from "path";
|
|
23861
23908
|
|
|
23862
23909
|
// src/cli/skills-sync.ts
|
|
23863
23910
|
import { spawn as spawn3, spawnSync as spawnSync2 } from "child_process";
|
|
23864
23911
|
import { existsSync as existsSync11, mkdirSync as mkdirSync9, readFileSync as readFileSync11, writeFileSync as writeFileSync14 } from "fs";
|
|
23865
|
-
import { dirname as
|
|
23912
|
+
import { dirname as dirname12, join as join13 } from "path";
|
|
23866
23913
|
|
|
23867
23914
|
// ../shared_libs/cli/install-commands.json
|
|
23868
23915
|
var install_commands_default = {
|
|
@@ -23996,7 +24043,7 @@ function sdkSkillsVersionPath(baseUrl) {
|
|
|
23996
24043
|
return join13(sdkCliStateDirPath(baseUrl), "skills-version");
|
|
23997
24044
|
}
|
|
23998
24045
|
function legacySdkSkillsVersionPath(baseUrl) {
|
|
23999
|
-
return join13(
|
|
24046
|
+
return join13(dirname12(sdkCliStateDirPath(baseUrl)), "sdk-skills", ".version");
|
|
24000
24047
|
}
|
|
24001
24048
|
function readSdkSkillsLocalVersion(baseUrl) {
|
|
24002
24049
|
const pluginVersion = readPluginSkillsVersion();
|
|
@@ -24011,7 +24058,7 @@ function readSdkSkillsLocalVersion(baseUrl) {
|
|
|
24011
24058
|
}
|
|
24012
24059
|
function writeLocalSkillsVersion(baseUrl, version) {
|
|
24013
24060
|
const path = sdkSkillsVersionPath(baseUrl);
|
|
24014
|
-
mkdirSync9(
|
|
24061
|
+
mkdirSync9(dirname12(path), { recursive: true });
|
|
24015
24062
|
writeFileSync14(path, `${version}
|
|
24016
24063
|
`, "utf-8");
|
|
24017
24064
|
}
|
|
@@ -24340,7 +24387,7 @@ function findRepoBackedSdkRoot(startPath) {
|
|
|
24340
24387
|
if (existsSync12(join14(current, "sdk", "package.json")) && existsSync12(join14(current, "sdk", "bin", "deepline-dev.ts"))) {
|
|
24341
24388
|
return current;
|
|
24342
24389
|
}
|
|
24343
|
-
const parent =
|
|
24390
|
+
const parent = dirname13(current);
|
|
24344
24391
|
if (parent === current) return null;
|
|
24345
24392
|
current = parent;
|
|
24346
24393
|
}
|
|
@@ -24370,7 +24417,7 @@ function resolveUpdatePlan(options = {}) {
|
|
|
24370
24417
|
const env = options.env ?? process.env;
|
|
24371
24418
|
const homeDir2 = options.homeDir ?? homedir11();
|
|
24372
24419
|
const entrypoint = options.entrypoint ?? (process.argv[1] ? resolve13(process.argv[1]) : "");
|
|
24373
|
-
const sourceRoot = entrypoint ? findRepoBackedSdkRoot(
|
|
24420
|
+
const sourceRoot = entrypoint ? findRepoBackedSdkRoot(dirname13(entrypoint)) : null;
|
|
24374
24421
|
if (sourceRoot) {
|
|
24375
24422
|
return {
|
|
24376
24423
|
kind: "source",
|
|
@@ -24449,7 +24496,7 @@ function writeAutoUpdateFailure(plan, exitCode) {
|
|
|
24449
24496
|
manualCommand: plan.manualCommand
|
|
24450
24497
|
};
|
|
24451
24498
|
try {
|
|
24452
|
-
mkdirSync10(
|
|
24499
|
+
mkdirSync10(dirname13(path), { recursive: true });
|
|
24453
24500
|
writeFileSync15(path, `${JSON.stringify(marker, null, 2)}
|
|
24454
24501
|
`, "utf8");
|
|
24455
24502
|
} catch {
|
|
@@ -24544,7 +24591,7 @@ function runCommand(command, args, env = process.env, options = {}) {
|
|
|
24544
24591
|
});
|
|
24545
24592
|
}
|
|
24546
24593
|
function writeSidecarLauncher(input2) {
|
|
24547
|
-
mkdirSync10(
|
|
24594
|
+
mkdirSync10(dirname13(input2.path), { recursive: true });
|
|
24548
24595
|
if (process.platform === "win32") {
|
|
24549
24596
|
writeFileSync15(
|
|
24550
24597
|
input2.path,
|
|
@@ -24581,7 +24628,7 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
|
|
|
24581
24628
|
writeFileSync15(join14(tempDir, "package.json"), NPM_SDK_SIDECAR_PACKAGE_JSON);
|
|
24582
24629
|
const env = {
|
|
24583
24630
|
...process.env,
|
|
24584
|
-
PATH: `${
|
|
24631
|
+
PATH: `${dirname13(plan.nodeBin)}${process.platform === "win32" ? ";" : ":"}${process.env.PATH ?? ""}`
|
|
24585
24632
|
};
|
|
24586
24633
|
const installExitCode = await runCommand(
|
|
24587
24634
|
plan.npmCommand,
|
package/dist/index.d.mts
CHANGED
|
@@ -2983,6 +2983,17 @@ type ConditionalStepResolver<Row, Value, Else = null> = {
|
|
|
2983
2983
|
type StepOptions<Row, Value = unknown> = {
|
|
2984
2984
|
/** Optional row-level gate. Skipped rows produce `null` for this column. */
|
|
2985
2985
|
readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Legacy dataset-column recompute flag accepted for older authored plays.
|
|
2988
|
+
*
|
|
2989
|
+
* Prefer putting freshness on the actual reusable call
|
|
2990
|
+
* (`ctx.tools.execute`, `ctx.step`, `ctx.fetch`, or `ctx.runPlay`).
|
|
2991
|
+
*/
|
|
2992
|
+
readonly recompute?: boolean;
|
|
2993
|
+
/** Legacy error-recompute flag accepted for older authored plays. */
|
|
2994
|
+
readonly recomputeOnError?: boolean;
|
|
2995
|
+
/** Legacy cell staleness metadata accepted for older authored plays. */
|
|
2996
|
+
readonly staleAfterSeconds?: number;
|
|
2986
2997
|
};
|
|
2987
2998
|
type StepProgram<Input, Output, Return = Output> = {
|
|
2988
2999
|
readonly kind: 'steps';
|
|
@@ -3001,6 +3012,9 @@ type StepProgramResolver<Input, Return> = {
|
|
|
3001
3012
|
};
|
|
3002
3013
|
type PlayStepProgramStep = {
|
|
3003
3014
|
readonly name: string;
|
|
3015
|
+
readonly recompute?: boolean;
|
|
3016
|
+
readonly recomputeOnError?: boolean;
|
|
3017
|
+
readonly staleAfterSeconds?: number;
|
|
3004
3018
|
readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown>;
|
|
3005
3019
|
};
|
|
3006
3020
|
type ColumnResolver<Row, Value> = StepResolver<Row, Value> | ConditionalStepResolver<Row, Value> | StepProgramResolver<Row, Value>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2983,6 +2983,17 @@ type ConditionalStepResolver<Row, Value, Else = null> = {
|
|
|
2983
2983
|
type StepOptions<Row, Value = unknown> = {
|
|
2984
2984
|
/** Optional row-level gate. Skipped rows produce `null` for this column. */
|
|
2985
2985
|
readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Legacy dataset-column recompute flag accepted for older authored plays.
|
|
2988
|
+
*
|
|
2989
|
+
* Prefer putting freshness on the actual reusable call
|
|
2990
|
+
* (`ctx.tools.execute`, `ctx.step`, `ctx.fetch`, or `ctx.runPlay`).
|
|
2991
|
+
*/
|
|
2992
|
+
readonly recompute?: boolean;
|
|
2993
|
+
/** Legacy error-recompute flag accepted for older authored plays. */
|
|
2994
|
+
readonly recomputeOnError?: boolean;
|
|
2995
|
+
/** Legacy cell staleness metadata accepted for older authored plays. */
|
|
2996
|
+
readonly staleAfterSeconds?: number;
|
|
2986
2997
|
};
|
|
2987
2998
|
type StepProgram<Input, Output, Return = Output> = {
|
|
2988
2999
|
readonly kind: 'steps';
|
|
@@ -3001,6 +3012,9 @@ type StepProgramResolver<Input, Return> = {
|
|
|
3001
3012
|
};
|
|
3002
3013
|
type PlayStepProgramStep = {
|
|
3003
3014
|
readonly name: string;
|
|
3015
|
+
readonly recompute?: boolean;
|
|
3016
|
+
readonly recomputeOnError?: boolean;
|
|
3017
|
+
readonly staleAfterSeconds?: number;
|
|
3004
3018
|
readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown>;
|
|
3005
3019
|
};
|
|
3006
3020
|
type ColumnResolver<Row, Value> = StepResolver<Row, Value> | ConditionalStepResolver<Row, Value> | StepProgramResolver<Row, Value>;
|
package/dist/index.js
CHANGED
|
@@ -421,10 +421,10 @@ var SDK_RELEASE = {
|
|
|
421
421
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
422
422
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
423
423
|
// fields shipped in 0.1.153.
|
|
424
|
-
version: "0.1.
|
|
424
|
+
version: "0.1.158",
|
|
425
425
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
426
426
|
supportPolicy: {
|
|
427
|
-
latest: "0.1.
|
|
427
|
+
latest: "0.1.158",
|
|
428
428
|
minimumSupported: "0.1.53",
|
|
429
429
|
deprecatedBelow: "0.1.53",
|
|
430
430
|
commandMinimumSupported: [
|
|
@@ -5114,6 +5114,9 @@ var DeeplineStepProgram = class _DeeplineStepProgram {
|
|
|
5114
5114
|
...this.steps,
|
|
5115
5115
|
{
|
|
5116
5116
|
name,
|
|
5117
|
+
...options?.recompute === true ? { recompute: true } : {},
|
|
5118
|
+
...options?.recomputeOnError === true ? { recomputeOnError: true } : {},
|
|
5119
|
+
...typeof options?.staleAfterSeconds === "number" ? { staleAfterSeconds: options.staleAfterSeconds } : {},
|
|
5117
5120
|
resolver: stepResolver
|
|
5118
5121
|
}
|
|
5119
5122
|
],
|