deepline 0.1.23 → 0.1.24
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/cli/index.js +506 -49
- package/dist/cli/index.mjs +506 -49
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/repo/apps/play-runner-workers/src/coordinator-entry.ts +95 -81
- package/dist/repo/apps/play-runner-workers/src/dedup-do.ts +18 -5
- package/dist/repo/apps/play-runner-workers/src/entry.ts +37 -32
- package/dist/repo/apps/play-runner-workers/src/runtime/live-progress.ts +18 -0
- package/dist/repo/sdk/src/plays/harness-stub.ts +2 -0
- package/dist/repo/sdk/src/version.ts +1 -1
- package/package.json +1 -1
|
@@ -93,6 +93,10 @@ import {
|
|
|
93
93
|
type CsvRenameOptions,
|
|
94
94
|
} from '../../../shared_libs/play-runtime/csv-rename';
|
|
95
95
|
import { coordinatorRequestHeaders } from '../../../shared_libs/play-runtime/coordinator-headers';
|
|
96
|
+
import type {
|
|
97
|
+
LiveNodeProgressMap,
|
|
98
|
+
LiveNodeProgressSnapshot,
|
|
99
|
+
} from './runtime/live-progress';
|
|
96
100
|
|
|
97
101
|
// The play's default export. The bundler injects this — see bundle-play-file.ts.
|
|
98
102
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -496,9 +500,7 @@ function makeWorkerDataset<T extends Record<string, unknown>>(
|
|
|
496
500
|
preview: plainRows,
|
|
497
501
|
tableNamespace: name,
|
|
498
502
|
...(cacheSummary ? { cacheSummary } : {}),
|
|
499
|
-
...(workProgress
|
|
500
|
-
? { _metadata: { workProgress } }
|
|
501
|
-
: {}),
|
|
503
|
+
...(workProgress ? { _metadata: { workProgress } } : {}),
|
|
502
504
|
};
|
|
503
505
|
},
|
|
504
506
|
enumerable: false,
|
|
@@ -521,22 +523,11 @@ type WorkflowRunOutput = {
|
|
|
521
523
|
playName: string;
|
|
522
524
|
result: unknown;
|
|
523
525
|
outputRows: number;
|
|
526
|
+
liveLogs?: string[];
|
|
527
|
+
liveNodeProgress?: LiveNodeProgressMap;
|
|
524
528
|
durationMs: number;
|
|
525
529
|
};
|
|
526
530
|
|
|
527
|
-
type LiveNodeProgressSnapshot = {
|
|
528
|
-
completed?: number;
|
|
529
|
-
total?: number;
|
|
530
|
-
failed?: number;
|
|
531
|
-
message?: string;
|
|
532
|
-
updatedAt?: number;
|
|
533
|
-
startedAt?: number;
|
|
534
|
-
completedAt?: number;
|
|
535
|
-
artifactTableNamespace?: string | null;
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
type LiveNodeProgressMap = Record<string, LiveNodeProgressSnapshot>;
|
|
539
|
-
|
|
540
531
|
type WorkerCtxCallbacks = {
|
|
541
532
|
onNodeProgress?: (input: {
|
|
542
533
|
nodeId: string;
|
|
@@ -952,7 +943,8 @@ async function signalParentPlayTerminal(input: {
|
|
|
952
943
|
}
|
|
953
944
|
const text = await res.text().catch(() => '');
|
|
954
945
|
throw new Error(
|
|
955
|
-
text.slice(0, 800) ||
|
|
946
|
+
text.slice(0, 800) ||
|
|
947
|
+
`Coordinator parent signal failed with ${res.status}.`,
|
|
956
948
|
);
|
|
957
949
|
}
|
|
958
950
|
throw new Error(
|
|
@@ -2523,6 +2515,7 @@ async function persistCompletedMapRows(input: {
|
|
|
2523
2515
|
],
|
|
2524
2516
|
runId: input.req.runId,
|
|
2525
2517
|
userEmail: input.req.userEmail,
|
|
2518
|
+
preloadedDbSessions: input.req.preloadedDbSessions ?? null,
|
|
2526
2519
|
});
|
|
2527
2520
|
}
|
|
2528
2521
|
|
|
@@ -2548,6 +2541,7 @@ async function prepareMapRows(input: {
|
|
|
2548
2541
|
rows: input.rows.map((row) => ({ ...row })),
|
|
2549
2542
|
runId: input.req.runId,
|
|
2550
2543
|
userEmail: input.req.userEmail,
|
|
2544
|
+
preloadedDbSessions: input.req.preloadedDbSessions ?? null,
|
|
2551
2545
|
});
|
|
2552
2546
|
return {
|
|
2553
2547
|
inserted: result.inserted,
|
|
@@ -3097,8 +3091,7 @@ function createMinimalWorkerCtx(
|
|
|
3097
3091
|
executedCellMetaPatches[executedIndex],
|
|
3098
3092
|
}
|
|
3099
3093
|
: {}),
|
|
3100
|
-
__deeplineRowKey:
|
|
3101
|
-
uniqueRowsToExecuteEntries[executedIndex]!.rowKey,
|
|
3094
|
+
__deeplineRowKey: uniqueRowsToExecuteEntries[executedIndex]!.rowKey,
|
|
3102
3095
|
})),
|
|
3103
3096
|
});
|
|
3104
3097
|
};
|
|
@@ -3332,7 +3325,11 @@ function createMinimalWorkerCtx(
|
|
|
3332
3325
|
req,
|
|
3333
3326
|
phase: 'runner.map.total',
|
|
3334
3327
|
ms: nowMs() - mapStartedAt,
|
|
3335
|
-
extra: {
|
|
3328
|
+
extra: {
|
|
3329
|
+
mapName: name,
|
|
3330
|
+
rowsWritten: totalRowsWritten,
|
|
3331
|
+
streaming: true,
|
|
3332
|
+
},
|
|
3336
3333
|
});
|
|
3337
3334
|
return dataset;
|
|
3338
3335
|
}
|
|
@@ -3366,7 +3363,11 @@ function createMinimalWorkerCtx(
|
|
|
3366
3363
|
req,
|
|
3367
3364
|
phase: 'runner.map.total',
|
|
3368
3365
|
ms: nowMs() - mapStartedAt,
|
|
3369
|
-
extra: {
|
|
3366
|
+
extra: {
|
|
3367
|
+
mapName: name,
|
|
3368
|
+
rowsWritten: totalRowsWritten,
|
|
3369
|
+
streaming: false,
|
|
3370
|
+
},
|
|
3370
3371
|
});
|
|
3371
3372
|
return dataset;
|
|
3372
3373
|
}
|
|
@@ -4182,6 +4183,7 @@ async function executeRunRequest(
|
|
|
4182
4183
|
phase: 'runner.terminal_status_update',
|
|
4183
4184
|
ms: nowMs() - terminalUpdateStartedAt,
|
|
4184
4185
|
});
|
|
4186
|
+
|
|
4185
4187
|
const billingStartedAt = nowMs();
|
|
4186
4188
|
await finalizeWorkerComputeBilling({
|
|
4187
4189
|
req,
|
|
@@ -4220,6 +4222,8 @@ async function executeRunRequest(
|
|
|
4220
4222
|
playName: req.playName,
|
|
4221
4223
|
result: serializedResult,
|
|
4222
4224
|
outputRows: inferOutputRows(serializedResult),
|
|
4225
|
+
liveLogs,
|
|
4226
|
+
liveNodeProgress: liveNodeProgressSnapshot(),
|
|
4223
4227
|
durationMs: nowMs() - startedAt,
|
|
4224
4228
|
};
|
|
4225
4229
|
} catch (error) {
|
|
@@ -4435,6 +4439,7 @@ async function persistResultDatasets(
|
|
|
4435
4439
|
rows: dataset.rows,
|
|
4436
4440
|
runId: req.runId,
|
|
4437
4441
|
userEmail: req.userEmail,
|
|
4442
|
+
preloadedDbSessions: req.preloadedDbSessions ?? null,
|
|
4438
4443
|
});
|
|
4439
4444
|
}
|
|
4440
4445
|
}
|
|
@@ -4521,14 +4526,16 @@ function serializeValue(value: unknown, depth: number): unknown {
|
|
|
4521
4526
|
? (value as unknown as { __deeplineCacheSummary: string })
|
|
4522
4527
|
.__deeplineCacheSummary
|
|
4523
4528
|
: null;
|
|
4524
|
-
const workProgress =
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4529
|
+
const workProgress = isRecord(
|
|
4530
|
+
(value as unknown as { __deeplineWorkProgress?: unknown })
|
|
4531
|
+
.__deeplineWorkProgress,
|
|
4532
|
+
)
|
|
4533
|
+
? (
|
|
4534
|
+
value as unknown as {
|
|
4535
|
+
__deeplineWorkProgress: Record<string, unknown>;
|
|
4536
|
+
}
|
|
4537
|
+
).__deeplineWorkProgress
|
|
4538
|
+
: null;
|
|
4532
4539
|
const previewRows = value
|
|
4533
4540
|
.slice(0, 5)
|
|
4534
4541
|
.map((row) => serializeValue(row, depth + 1))
|
|
@@ -4546,9 +4553,7 @@ function serializeValue(value: unknown, depth: number): unknown {
|
|
|
4546
4553
|
preview: previewRows,
|
|
4547
4554
|
tableNamespace,
|
|
4548
4555
|
...(cacheSummary ? { cacheSummary } : {}),
|
|
4549
|
-
...(workProgress
|
|
4550
|
-
? { _metadata: { workProgress } }
|
|
4551
|
-
: {}),
|
|
4556
|
+
...(workProgress ? { _metadata: { workProgress } } : {}),
|
|
4552
4557
|
};
|
|
4553
4558
|
}
|
|
4554
4559
|
return value.map((entry) => serializeValue(entry, depth + 1));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type LiveNodeProgressSnapshot = {
|
|
2
|
+
completed?: number;
|
|
3
|
+
total?: number;
|
|
4
|
+
failed?: number;
|
|
5
|
+
message?: string;
|
|
6
|
+
updatedAt?: number;
|
|
7
|
+
startedAt?: number;
|
|
8
|
+
completedAt?: number;
|
|
9
|
+
artifactTableNamespace?: string | null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type LiveNodeProgressMap = Record<string, LiveNodeProgressSnapshot>;
|
|
13
|
+
|
|
14
|
+
export function sanitizeLiveLogLines(value: unknown): string[] | null {
|
|
15
|
+
return Array.isArray(value)
|
|
16
|
+
? value.filter((line): line is string => typeof line === 'string')
|
|
17
|
+
: null;
|
|
18
|
+
}
|
|
@@ -146,6 +146,7 @@ export async function harnessStartSheetDataset(input: {
|
|
|
146
146
|
rows: Array<Record<string, unknown>>;
|
|
147
147
|
runId: string;
|
|
148
148
|
userEmail?: string | null;
|
|
149
|
+
preloadedDbSessions?: PreloadedRuntimeDbSessionInput[] | null;
|
|
149
150
|
}): Promise<{
|
|
150
151
|
inserted: number;
|
|
151
152
|
skipped: number;
|
|
@@ -170,6 +171,7 @@ export async function harnessPersistCompletedSheetRows(input: {
|
|
|
170
171
|
outputFields: string[];
|
|
171
172
|
runId: string;
|
|
172
173
|
userEmail?: string | null;
|
|
174
|
+
preloadedDbSessions?: PreloadedRuntimeDbSessionInput[] | null;
|
|
173
175
|
}): Promise<{ ok: true; rowsWritten: number; tableNamespace: string }> {
|
|
174
176
|
return requireBinding().persistCompletedMapRows(input);
|
|
175
177
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.24";
|
|
2
2
|
export const SDK_API_CONTRACT = "2026-05-runs-v2";
|