deepline 0.1.152 → 0.1.154
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 +46 -6
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +1180 -825
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/batching.ts +34 -18
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/harness-receipt-store.ts +41 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/receipts.ts +143 -8
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-receipts.ts +104 -0
- package/dist/bundling-sources/sdk/src/index.ts +0 -1
- package/dist/bundling-sources/sdk/src/play.ts +3 -48
- package/dist/bundling-sources/sdk/src/plays/harness-stub.ts +27 -2
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/worker-play-entry.ts +0 -10
- package/dist/bundling-sources/shared_libs/play-data-plane/index.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +87 -0
- package/dist/bundling-sources/shared_libs/play-runtime/batch-runtime.ts +0 -59
- package/dist/bundling-sources/shared_libs/play-runtime/cell-staleness.ts +0 -253
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +805 -1570
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +47 -74
- package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +36 -14
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +145 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +284 -0
- package/dist/bundling-sources/shared_libs/play-runtime/postgres-json.ts +12 -5
- package/dist/bundling-sources/shared_libs/play-runtime/run-lifecycle-policy.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +10 -45
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +923 -535
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-neon-serverless.ts +58 -78
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/step-program-dataset-builder.ts +1 -14
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +159 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +32 -0
- package/dist/bundling-sources/shared_libs/plays/definition.ts +4 -2
- package/dist/bundling-sources/shared_libs/plays/runtime-validation.ts +3 -14
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -43
- package/dist/cli/index.js +1301 -399
- package/dist/cli/index.mjs +1269 -361
- package/dist/{compiler-manifest-BjoRENv9.d.ts → compiler-manifest-DW1flrHk.d.mts} +0 -9
- package/dist/{compiler-manifest-BjoRENv9.d.mts → compiler-manifest-DW1flrHk.d.ts} +0 -9
- package/dist/index.d.mts +9 -38
- package/dist/index.d.ts +9 -38
- package/dist/index.js +22 -11
- package/dist/index.mjs +22 -11
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/cell-policy.ts +0 -76
- package/dist/bundling-sources/shared_libs/play-runtime/progress-emitter.ts +0 -197
- package/dist/bundling-sources/shared_libs/play-runtime/waterfall-replay.ts +0 -79
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
const POSTGRES_UNSUPPORTED_NUL_RE = /\u0000/g;
|
|
2
2
|
|
|
3
|
+
function postgresJsonReplacer(_key: string, value: unknown): unknown {
|
|
4
|
+
return typeof value === 'string'
|
|
5
|
+
? value.replace(POSTGRES_UNSUPPORTED_NUL_RE, '')
|
|
6
|
+
: value;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function sanitizePostgresJsonValue<T>(value: T): T {
|
|
10
|
+
const serialized = stringifyPostgresJson(value);
|
|
11
|
+
return serialized === undefined ? value : (JSON.parse(serialized) as T);
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
export function stringifyPostgresJson(value: unknown): string | undefined {
|
|
4
|
-
return JSON.stringify(value,
|
|
5
|
-
typeof nestedValue === 'string'
|
|
6
|
-
? nestedValue.replace(POSTGRES_UNSUPPORTED_NUL_RE, '')
|
|
7
|
-
: nestedValue,
|
|
8
|
-
);
|
|
15
|
+
return JSON.stringify(value, postgresJsonReplacer);
|
|
9
16
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type PlayRunLifecycleStatus =
|
|
2
|
+
| 'queued'
|
|
3
|
+
| 'running'
|
|
4
|
+
| 'completed'
|
|
5
|
+
| 'failed'
|
|
6
|
+
| 'cancelled'
|
|
7
|
+
| 'terminated'
|
|
8
|
+
| 'timed_out'
|
|
9
|
+
| 'unknown';
|
|
10
|
+
|
|
11
|
+
const TERMINAL_PLAY_RUN_STATUSES = new Set<PlayRunLifecycleStatus>([
|
|
12
|
+
'completed',
|
|
13
|
+
'failed',
|
|
14
|
+
'cancelled',
|
|
15
|
+
'terminated',
|
|
16
|
+
'timed_out',
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
const RECOVERABLE_DATASET_ROW_STATUSES = new Set<PlayRunLifecycleStatus>([
|
|
20
|
+
'failed',
|
|
21
|
+
'cancelled',
|
|
22
|
+
'terminated',
|
|
23
|
+
'timed_out',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
export function normalizePlayRunLifecycleStatus(
|
|
27
|
+
value: unknown,
|
|
28
|
+
): PlayRunLifecycleStatus {
|
|
29
|
+
const normalized = String(value ?? '')
|
|
30
|
+
.trim()
|
|
31
|
+
.toLowerCase();
|
|
32
|
+
switch (normalized) {
|
|
33
|
+
case 'queued':
|
|
34
|
+
case 'pending':
|
|
35
|
+
return 'running';
|
|
36
|
+
case 'running':
|
|
37
|
+
case 'started':
|
|
38
|
+
case 'waiting':
|
|
39
|
+
return 'running';
|
|
40
|
+
case 'completed':
|
|
41
|
+
case 'complete':
|
|
42
|
+
case 'succeeded':
|
|
43
|
+
return 'completed';
|
|
44
|
+
case 'failed':
|
|
45
|
+
case 'error':
|
|
46
|
+
return 'failed';
|
|
47
|
+
case 'cancelled':
|
|
48
|
+
case 'canceled':
|
|
49
|
+
return 'cancelled';
|
|
50
|
+
case 'terminated':
|
|
51
|
+
return 'terminated';
|
|
52
|
+
case 'timed_out':
|
|
53
|
+
case 'timeout':
|
|
54
|
+
return 'timed_out';
|
|
55
|
+
default:
|
|
56
|
+
return 'unknown';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function isTerminalPlayRunLifecycleStatus(status: unknown): boolean {
|
|
61
|
+
return TERMINAL_PLAY_RUN_STATUSES.has(normalizePlayRunLifecycleStatus(status));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function isActivePlayRunLifecycleStatus(status: unknown): boolean {
|
|
65
|
+
return normalizePlayRunLifecycleStatus(status) === 'running';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function isRecoverableDatasetRowStatus(status: unknown): boolean {
|
|
69
|
+
return RECOVERABLE_DATASET_ROW_STATUSES.has(
|
|
70
|
+
normalizePlayRunLifecycleStatus(status),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function datasetSummaryRowModeForRunStatus(
|
|
75
|
+
status: unknown,
|
|
76
|
+
): 'output' | 'all' {
|
|
77
|
+
return isRecoverableDatasetRowStatus(status) ? 'all' : 'output';
|
|
78
|
+
}
|
|
@@ -5,6 +5,12 @@ import {
|
|
|
5
5
|
type PlayRunLedgerSnapshot,
|
|
6
6
|
type PlayRunLedgerStepSnapshot,
|
|
7
7
|
} from './run-ledger';
|
|
8
|
+
import {
|
|
9
|
+
isActivePlayRunLifecycleStatus,
|
|
10
|
+
isTerminalPlayRunLifecycleStatus,
|
|
11
|
+
normalizePlayRunLifecycleStatus,
|
|
12
|
+
type PlayRunLifecycleStatus,
|
|
13
|
+
} from './run-lifecycle-policy';
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* Run Snapshot Stream.
|
|
@@ -17,15 +23,7 @@ import {
|
|
|
17
23
|
* event streams from the same Convex Run Snapshot. See ADR-0008.
|
|
18
24
|
*/
|
|
19
25
|
|
|
20
|
-
export type PlayRunLiveStatus =
|
|
21
|
-
| 'queued'
|
|
22
|
-
| 'running'
|
|
23
|
-
| 'completed'
|
|
24
|
-
| 'failed'
|
|
25
|
-
| 'cancelled'
|
|
26
|
-
| 'terminated'
|
|
27
|
-
| 'timed_out'
|
|
28
|
-
| 'unknown';
|
|
26
|
+
export type PlayRunLiveStatus = PlayRunLifecycleStatus;
|
|
29
27
|
|
|
30
28
|
export type PlayRunStreamNodeProgress = {
|
|
31
29
|
completed?: number;
|
|
@@ -81,50 +79,17 @@ export type PlayRunLiveSnapshot = {
|
|
|
81
79
|
};
|
|
82
80
|
|
|
83
81
|
export function normalizePlayRunLiveStatus(value: unknown): PlayRunLiveStatus {
|
|
84
|
-
|
|
85
|
-
.trim()
|
|
86
|
-
.toLowerCase();
|
|
87
|
-
switch (normalized) {
|
|
88
|
-
case 'queued':
|
|
89
|
-
case 'pending':
|
|
90
|
-
return 'running';
|
|
91
|
-
case 'running':
|
|
92
|
-
case 'started':
|
|
93
|
-
return 'running';
|
|
94
|
-
case 'completed':
|
|
95
|
-
case 'complete':
|
|
96
|
-
case 'succeeded':
|
|
97
|
-
return 'completed';
|
|
98
|
-
case 'failed':
|
|
99
|
-
case 'error':
|
|
100
|
-
return 'failed';
|
|
101
|
-
case 'cancelled':
|
|
102
|
-
case 'canceled':
|
|
103
|
-
return 'cancelled';
|
|
104
|
-
case 'terminated':
|
|
105
|
-
return 'terminated';
|
|
106
|
-
case 'timed_out':
|
|
107
|
-
case 'timeout':
|
|
108
|
-
return 'timed_out';
|
|
109
|
-
default:
|
|
110
|
-
return 'unknown';
|
|
111
|
-
}
|
|
82
|
+
return normalizePlayRunLifecycleStatus(value);
|
|
112
83
|
}
|
|
113
84
|
|
|
114
85
|
export function isTerminalPlayRunLiveStatus(
|
|
115
86
|
status: PlayRunLiveStatus,
|
|
116
87
|
): boolean {
|
|
117
|
-
return (
|
|
118
|
-
status === 'completed' ||
|
|
119
|
-
status === 'failed' ||
|
|
120
|
-
status === 'cancelled' ||
|
|
121
|
-
status === 'terminated' ||
|
|
122
|
-
status === 'timed_out'
|
|
123
|
-
);
|
|
88
|
+
return isTerminalPlayRunLifecycleStatus(status);
|
|
124
89
|
}
|
|
125
90
|
|
|
126
91
|
export function isActivePlayRunStatus(status: unknown): boolean {
|
|
127
|
-
return
|
|
92
|
+
return isActivePlayRunLifecycleStatus(status);
|
|
128
93
|
}
|
|
129
94
|
|
|
130
95
|
/**
|