deepline 0.1.149 → 0.1.151
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 +157 -140
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/csv-rows.ts +2 -19
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/row-isolation.ts +5 -53
- package/dist/bundling-sources/sdk/src/client.ts +5 -0
- package/dist/bundling-sources/sdk/src/config.ts +2 -2
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/tool-output.ts +63 -17
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +100 -158
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durability-store.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-row-outcome.ts +167 -0
- package/dist/bundling-sources/shared_libs/play-runtime/pacing.ts +79 -0
- package/dist/bundling-sources/shared_libs/play-runtime/row-isolation.ts +39 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +19 -86
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +90 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-session.ts +43 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +142 -11
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +3 -2
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +17 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +343 -26
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +20 -23
- package/dist/cli/index.js +186 -105
- package/dist/cli/index.mjs +193 -106
- package/dist/index.d.mts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.js +33 -20
- package/dist/index.mjs +40 -21
- package/dist/plays/bundle-play-file.mjs +22 -19
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -238,7 +238,7 @@ function loadProjectEnvCandidates(startDir = process.cwd()) {
|
|
|
238
238
|
}));
|
|
239
239
|
}
|
|
240
240
|
function normalizeBaseUrl(baseUrl) {
|
|
241
|
-
const trimmed = baseUrl
|
|
241
|
+
const trimmed = baseUrl?.trim().replace(/\/+$/, "") ?? "";
|
|
242
242
|
if (!trimmed) return "";
|
|
243
243
|
try {
|
|
244
244
|
const parsed = new URL(trimmed);
|
|
@@ -349,10 +349,10 @@ var SDK_RELEASE = {
|
|
|
349
349
|
// the SDK enrich generator's one-second stale policy.
|
|
350
350
|
// 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
|
|
351
351
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
352
|
-
version: "0.1.
|
|
352
|
+
version: "0.1.151",
|
|
353
353
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
354
354
|
supportPolicy: {
|
|
355
|
-
latest: "0.1.
|
|
355
|
+
latest: "0.1.151",
|
|
356
356
|
minimumSupported: "0.1.53",
|
|
357
357
|
deprecatedBelow: "0.1.53",
|
|
358
358
|
commandMinimumSupported: [
|
|
@@ -1816,6 +1816,7 @@ async function* observeRunEvents(options) {
|
|
|
1816
1816
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
1817
1817
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
1818
1818
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
1819
|
+
var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
|
|
1819
1820
|
var V2_EXECUTE_RESPONSE_CONTRACT = "v2-tool-response";
|
|
1820
1821
|
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
1821
1822
|
var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
@@ -2300,7 +2301,8 @@ var DeeplineClient = class {
|
|
|
2300
2301
|
async executeTool(toolId, input, options) {
|
|
2301
2302
|
const headers = {
|
|
2302
2303
|
[EXECUTE_RESPONSE_CONTRACT_HEADER]: V2_EXECUTE_RESPONSE_CONTRACT,
|
|
2303
|
-
...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {}
|
|
2304
|
+
...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
2305
|
+
...options?.responseIntent ? { [EXECUTE_RESPONSE_INTENT_HEADER]: options.responseIntent } : {}
|
|
2304
2306
|
};
|
|
2305
2307
|
return this.http.post(
|
|
2306
2308
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
@@ -5499,7 +5501,13 @@ function getDefinedPlayMetadata(value) {
|
|
|
5499
5501
|
}
|
|
5500
5502
|
|
|
5501
5503
|
// src/tool-output.ts
|
|
5502
|
-
import {
|
|
5504
|
+
import {
|
|
5505
|
+
closeSync,
|
|
5506
|
+
mkdirSync as mkdirSync2,
|
|
5507
|
+
openSync,
|
|
5508
|
+
writeFileSync as writeFileSync2,
|
|
5509
|
+
writeSync
|
|
5510
|
+
} from "fs";
|
|
5503
5511
|
import { homedir as homedir4 } from "os";
|
|
5504
5512
|
import { dirname as dirname2, join as join3 } from "path";
|
|
5505
5513
|
function isPlainObject(value) {
|
|
@@ -5522,6 +5530,19 @@ function normalizeRows2(value) {
|
|
|
5522
5530
|
return { value: entry };
|
|
5523
5531
|
});
|
|
5524
5532
|
}
|
|
5533
|
+
function columnsForRows(rows) {
|
|
5534
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5535
|
+
const columns = [];
|
|
5536
|
+
for (const row of rows) {
|
|
5537
|
+
for (const key of Object.keys(row)) {
|
|
5538
|
+
if (!seen.has(key)) {
|
|
5539
|
+
seen.add(key);
|
|
5540
|
+
columns.push(key);
|
|
5541
|
+
}
|
|
5542
|
+
}
|
|
5543
|
+
}
|
|
5544
|
+
return columns;
|
|
5545
|
+
}
|
|
5525
5546
|
function candidateRoots(payload) {
|
|
5526
5547
|
const roots = [
|
|
5527
5548
|
{ path: null, value: payload }
|
|
@@ -5618,16 +5639,7 @@ function writeJsonOutputFile(payload, stem) {
|
|
|
5618
5639
|
function writeCsvOutputFile(rows, stem, options) {
|
|
5619
5640
|
const outputPath = options?.outPath ? options.outPath : join3(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
|
|
5620
5641
|
mkdirSync2(dirname2(outputPath), { recursive: true });
|
|
5621
|
-
const
|
|
5622
|
-
const columns = [];
|
|
5623
|
-
for (const row of rows) {
|
|
5624
|
-
for (const key of Object.keys(row)) {
|
|
5625
|
-
if (!seen.has(key)) {
|
|
5626
|
-
seen.add(key);
|
|
5627
|
-
columns.push(key);
|
|
5628
|
-
}
|
|
5629
|
-
}
|
|
5630
|
-
}
|
|
5642
|
+
const columns = columnsForRows(rows);
|
|
5631
5643
|
const escapeCell = (value) => {
|
|
5632
5644
|
const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
|
|
5633
5645
|
if (/[",\n]/.test(normalized)) {
|
|
@@ -5635,13 +5647,20 @@ function writeCsvOutputFile(rows, stem, options) {
|
|
|
5635
5647
|
}
|
|
5636
5648
|
return normalized;
|
|
5637
5649
|
};
|
|
5638
|
-
const
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5650
|
+
const fd = openSync(outputPath, "w");
|
|
5651
|
+
try {
|
|
5652
|
+
writeSync(fd, `${columns.map(escapeCell).join(",")}
|
|
5653
|
+
`);
|
|
5654
|
+
for (const row of rows) {
|
|
5655
|
+
writeSync(
|
|
5656
|
+
fd,
|
|
5657
|
+
`${columns.map((column) => escapeCell(row[column])).join(",")}
|
|
5658
|
+
`
|
|
5659
|
+
);
|
|
5660
|
+
}
|
|
5661
|
+
} finally {
|
|
5662
|
+
closeSync(fd);
|
|
5642
5663
|
}
|
|
5643
|
-
writeFileSync2(outputPath, `${lines.join("\n")}
|
|
5644
|
-
`, "utf-8");
|
|
5645
5664
|
const previewRows = rows.slice(0, 5);
|
|
5646
5665
|
const previewColumns = columns.slice(0, 5);
|
|
5647
5666
|
const preview = [
|
|
@@ -1120,19 +1120,32 @@ async function computeWorkersHarnessFingerprintWithAdapter(adapter) {
|
|
|
1120
1120
|
hash: sha256(contents)
|
|
1121
1121
|
});
|
|
1122
1122
|
};
|
|
1123
|
-
const
|
|
1123
|
+
const collectTsFilesRecursive = async (rootDir, parts2) => {
|
|
1124
1124
|
if (!await fileExists(rootDir)) return;
|
|
1125
|
-
const
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1125
|
+
const filePaths = [];
|
|
1126
|
+
const visitDir = async (dir) => {
|
|
1127
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
1128
|
+
for (const entry of entries) {
|
|
1129
|
+
const childPath = join(dir, entry.name);
|
|
1130
|
+
if (entry.isDirectory()) {
|
|
1131
|
+
await visitDir(childPath);
|
|
1132
|
+
continue;
|
|
1133
|
+
}
|
|
1134
|
+
if (entry.isFile() && /\.[cm]?ts$/.test(entry.name)) {
|
|
1135
|
+
filePaths.push(childPath);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
await visitDir(rootDir);
|
|
1140
|
+
for (const filePath of filePaths.sort()) {
|
|
1141
|
+
await addFilePart(parts2, rootDir, filePath);
|
|
1129
1142
|
}
|
|
1130
1143
|
};
|
|
1131
1144
|
const collectIntegrationBatchingFiles = async (rootDir, parts2) => {
|
|
1132
1145
|
if (!await fileExists(rootDir)) return;
|
|
1133
|
-
const
|
|
1146
|
+
const entries = await readdir(rootDir, { withFileTypes: true });
|
|
1134
1147
|
const filePaths = [];
|
|
1135
|
-
for (const entry of
|
|
1148
|
+
for (const entry of entries) {
|
|
1136
1149
|
if (entry.isFile() && (entry.name === "play-runtime-batching-registry.ts" || /^batching.*\.ts$/.test(entry.name))) {
|
|
1137
1150
|
filePaths.push(join(rootDir, entry.name));
|
|
1138
1151
|
}
|
|
@@ -1147,23 +1160,13 @@ async function computeWorkersHarnessFingerprintWithAdapter(adapter) {
|
|
|
1147
1160
|
await addFilePart(parts2, rootDir, filePath);
|
|
1148
1161
|
}
|
|
1149
1162
|
};
|
|
1150
|
-
const entries = await readdir(adapter.workersHarnessFilesDir, {
|
|
1151
|
-
withFileTypes: true
|
|
1152
|
-
});
|
|
1153
|
-
const tsFiles = entries.filter((e) => e.isFile() && /\.[cm]?ts$/.test(e.name)).map((e) => e.name).sort();
|
|
1154
1163
|
const parts = [];
|
|
1155
|
-
|
|
1156
|
-
await addFilePart(
|
|
1157
|
-
parts,
|
|
1158
|
-
adapter.workersHarnessFilesDir,
|
|
1159
|
-
join(adapter.workersHarnessFilesDir, name)
|
|
1160
|
-
);
|
|
1161
|
-
}
|
|
1164
|
+
await collectTsFilesRecursive(adapter.workersHarnessFilesDir, parts);
|
|
1162
1165
|
for (const dir of adapter.workersRuntimeFingerprintDirs ?? []) {
|
|
1163
1166
|
if (basename(dir) === "integrations") {
|
|
1164
1167
|
await collectIntegrationBatchingFiles(dir, parts);
|
|
1165
1168
|
} else {
|
|
1166
|
-
await
|
|
1169
|
+
await collectTsFilesRecursive(dir, parts);
|
|
1167
1170
|
}
|
|
1168
1171
|
}
|
|
1169
1172
|
return sha256(JSON.stringify(parts));
|