deepline 0.1.20 → 0.1.22
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 +845 -337
- package/dist/cli/index.mjs +902 -389
- package/dist/index.d.mts +23 -58
- package/dist/index.d.ts +23 -58
- package/dist/index.js +195 -92
- package/dist/index.mjs +195 -92
- package/dist/repo/apps/play-runner-workers/src/coordinator-entry.ts +888 -227
- package/dist/repo/apps/play-runner-workers/src/dedup-do.ts +540 -36
- package/dist/repo/apps/play-runner-workers/src/entry.ts +477 -374
- package/dist/repo/sdk/src/client.ts +245 -118
- package/dist/repo/sdk/src/http.ts +19 -1
- package/dist/repo/sdk/src/plays/harness-stub.ts +12 -0
- package/dist/repo/sdk/src/types.ts +8 -14
- package/dist/repo/sdk/src/version.ts +1 -1
- package/dist/repo/shared_libs/play-runtime/profiles.ts +4 -14
- package/dist/repo/shared_libs/play-runtime/runtime-actions.ts +1 -1
- package/dist/repo/shared_libs/play-runtime/scheduler-backend.ts +3 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -342,7 +342,7 @@ interface ToolMetadata extends ToolDefinition {
|
|
|
342
342
|
interface PlayRunResult {
|
|
343
343
|
/** `true` if the play completed successfully (`status === 'completed'`). */
|
|
344
344
|
success: boolean;
|
|
345
|
-
/** Public play-run identifier
|
|
345
|
+
/** Public play-run identifier. */
|
|
346
346
|
runId: string;
|
|
347
347
|
/** The play's return value. Only present on success. */
|
|
348
348
|
result?: unknown;
|
|
@@ -363,8 +363,6 @@ interface PlayProgressStatus {
|
|
|
363
363
|
totalRows?: number;
|
|
364
364
|
/** Accumulated log lines from `ctx.log()`. Grows monotonically. */
|
|
365
365
|
logs: string[];
|
|
366
|
-
/** Zero-based offset of the first returned log line when a tail cursor is used. */
|
|
367
|
-
logOffset?: number;
|
|
368
366
|
/** Error message if the play has failed. */
|
|
369
367
|
error?: string;
|
|
370
368
|
}
|
|
@@ -399,7 +397,7 @@ interface PlayStatus {
|
|
|
399
397
|
progress?: PlayProgressStatus;
|
|
400
398
|
/** Partial or final result. Available once the play returns. */
|
|
401
399
|
result?: unknown;
|
|
402
|
-
/**
|
|
400
|
+
/** Scheduler-backed run metadata when returned by the status endpoint. */
|
|
403
401
|
run?: {
|
|
404
402
|
startTime?: string | null;
|
|
405
403
|
closeTime?: string | null;
|
|
@@ -444,9 +442,9 @@ interface StopPlayRunResult {
|
|
|
444
442
|
* Summary of a single play run, returned by {@link DeeplineClient.listPlayRuns}.
|
|
445
443
|
*/
|
|
446
444
|
interface PlayRunListItem {
|
|
447
|
-
/**
|
|
445
|
+
/** Public Deepline play-run id. */
|
|
448
446
|
workflowId: string;
|
|
449
|
-
/**
|
|
447
|
+
/** Backend run attempt id, when exposed. */
|
|
450
448
|
runId: string;
|
|
451
449
|
/** Workflow type (typically `'Workflow'`). */
|
|
452
450
|
type: string;
|
|
@@ -564,7 +562,7 @@ interface PlayDefinitionDetail {
|
|
|
564
562
|
runCount: number;
|
|
565
563
|
/** Primary key column for CSV-based plays. */
|
|
566
564
|
tableNamespace?: string | null;
|
|
567
|
-
/**
|
|
565
|
+
/** Public Deepline id of the latest run. */
|
|
568
566
|
latestRunId?: string | null;
|
|
569
567
|
/** Unix timestamp (ms). */
|
|
570
568
|
createdAt: number;
|
|
@@ -677,12 +675,11 @@ interface ClearPlayHistoryResult {
|
|
|
677
675
|
* ```typescript
|
|
678
676
|
* const started = await client.startPlayRun({ name: 'my-play', input: { domain: 'stripe.com' } });
|
|
679
677
|
* console.log(`Started: ${started.workflowId}`);
|
|
680
|
-
* console.log(`Status URL: ${started.statusUrl}`);
|
|
681
678
|
* console.log(`Dashboard: ${started.dashboardUrl}`);
|
|
682
679
|
* ```
|
|
683
680
|
*/
|
|
684
681
|
interface PlayRunStart {
|
|
685
|
-
/**
|
|
682
|
+
/** Public Deepline play-run id for tracking this execution. */
|
|
686
683
|
workflowId: string;
|
|
687
684
|
/** Public Deepline play-run API version. */
|
|
688
685
|
apiVersion?: number;
|
|
@@ -694,8 +691,6 @@ interface PlayRunStart {
|
|
|
694
691
|
runtimeBackend?: string;
|
|
695
692
|
/** Canonical run contract compatibility metadata. */
|
|
696
693
|
contract?: Record<string, unknown> | null;
|
|
697
|
-
/** URL to poll for status updates. */
|
|
698
|
-
statusUrl?: string;
|
|
699
694
|
/** Dashboard URL for the named play. */
|
|
700
695
|
dashboardUrl?: string;
|
|
701
696
|
/** Terminal status returned when the start request used a short completion wait. */
|
|
@@ -706,7 +701,7 @@ interface PlayRunStart {
|
|
|
706
701
|
*
|
|
707
702
|
* This is the check-only version of play artifact registration: the server runs
|
|
708
703
|
* the same preflight compiler and static-analysis pass without storing,
|
|
709
|
-
* publishing, or starting a
|
|
704
|
+
* publishing, or starting a play run.
|
|
710
705
|
*/
|
|
711
706
|
interface PlayCheckResult {
|
|
712
707
|
valid: boolean;
|
|
@@ -773,8 +768,7 @@ interface StartPlayRunRequest {
|
|
|
773
768
|
waitForCompletionMs?: number;
|
|
774
769
|
/**
|
|
775
770
|
* Per-run execution profile override. The server defaults to `workers_edge`;
|
|
776
|
-
* tests
|
|
777
|
-
* this unset.
|
|
771
|
+
* tests can pass `local` here. Most callers should leave this unset.
|
|
778
772
|
*/
|
|
779
773
|
profile?: string;
|
|
780
774
|
}
|
|
@@ -836,11 +830,7 @@ type RunsListOptions = {
|
|
|
836
830
|
status?: string;
|
|
837
831
|
};
|
|
838
832
|
type RunsTailOptions = {
|
|
839
|
-
|
|
840
|
-
afterLogIndex?: number;
|
|
841
|
-
waitMs?: number;
|
|
842
|
-
terminalOnly?: boolean;
|
|
843
|
-
compact?: boolean;
|
|
833
|
+
signal?: AbortSignal;
|
|
844
834
|
};
|
|
845
835
|
type RunsLogsOptions = {
|
|
846
836
|
limit?: number;
|
|
@@ -919,7 +909,7 @@ declare class DeeplineClient {
|
|
|
919
909
|
/**
|
|
920
910
|
* Search available tools using Deepline's ranked backend search.
|
|
921
911
|
*
|
|
922
|
-
* This is the same discovery surface used by the
|
|
912
|
+
* This is the same discovery surface used by the CLI: it ranks across
|
|
923
913
|
* tool metadata, categories, agent guidance, and input schema fields.
|
|
924
914
|
*/
|
|
925
915
|
searchTools(options?: ToolSearchOptions): Promise<ToolSearchResult>;
|
|
@@ -970,7 +960,7 @@ declare class DeeplineClient {
|
|
|
970
960
|
* `progress.logs`; they are not part of the user output object.
|
|
971
961
|
*
|
|
972
962
|
* @param request - Play run configuration (name, code, input, etc.)
|
|
973
|
-
* @returns
|
|
963
|
+
* @returns Run metadata including the public `workflowId`
|
|
974
964
|
*
|
|
975
965
|
* @example
|
|
976
966
|
* ```typescript
|
|
@@ -1160,9 +1150,6 @@ declare class DeeplineClient {
|
|
|
1160
1150
|
* Internal/advanced primitive. Public callers should usually prefer
|
|
1161
1151
|
* {@link runPlay}, {@link PlayJob.get}, or `deepline play run --watch`.
|
|
1162
1152
|
*
|
|
1163
|
-
* Poll this method until `status` reaches a terminal state:
|
|
1164
|
-
* `'completed'`, `'failed'`, or `'cancelled'`.
|
|
1165
|
-
*
|
|
1166
1153
|
* @param workflowId - Play-run id from {@link startPlayRun}
|
|
1167
1154
|
* @returns Current status with progress logs and partial results
|
|
1168
1155
|
*
|
|
@@ -1173,25 +1160,14 @@ declare class DeeplineClient {
|
|
|
1173
1160
|
* console.log(`Logs: ${status.progress?.logs.length ?? 0} lines`);
|
|
1174
1161
|
* ```
|
|
1175
1162
|
*/
|
|
1176
|
-
getPlayStatus(workflowId: string
|
|
1177
|
-
|
|
1178
|
-
* Get the lightweight tail-polling status for a play execution.
|
|
1179
|
-
*
|
|
1180
|
-
* This is intentionally smaller than {@link getPlayStatus}: it returns the
|
|
1181
|
-
* fields needed for CLI log tailing while the run is in flight, without
|
|
1182
|
-
* forcing the API to rebuild final result views on every poll. Call
|
|
1183
|
-
* {@link getPlayStatus} once after a terminal state for the full result.
|
|
1184
|
-
*/
|
|
1185
|
-
getPlayTailStatus(workflowId: string, options?: {
|
|
1186
|
-
afterLogIndex?: number;
|
|
1187
|
-
waitMs?: number;
|
|
1188
|
-
terminalOnly?: boolean;
|
|
1163
|
+
getPlayStatus(workflowId: string, options?: {
|
|
1164
|
+
billing?: boolean;
|
|
1189
1165
|
}): Promise<PlayStatus>;
|
|
1190
1166
|
/**
|
|
1191
1167
|
* Stream semantic play-run events using the same SSE feed as the dashboard.
|
|
1192
1168
|
*
|
|
1193
|
-
*
|
|
1194
|
-
*
|
|
1169
|
+
* The server emits a canonical `play.run.snapshot` event first for every
|
|
1170
|
+
* connection, then incremental live events until terminal state or reconnect.
|
|
1195
1171
|
*/
|
|
1196
1172
|
streamPlayRunEvents(workflowId: string, options?: {
|
|
1197
1173
|
signal?: AbortSignal;
|
|
@@ -1203,7 +1179,7 @@ declare class DeeplineClient {
|
|
|
1203
1179
|
*
|
|
1204
1180
|
* Sends a stop request for the run.
|
|
1205
1181
|
*
|
|
1206
|
-
* @param workflowId -
|
|
1182
|
+
* @param workflowId - Public Deepline play-run id to cancel
|
|
1207
1183
|
*
|
|
1208
1184
|
* @example
|
|
1209
1185
|
* ```typescript
|
|
@@ -1214,7 +1190,7 @@ declare class DeeplineClient {
|
|
|
1214
1190
|
/**
|
|
1215
1191
|
* Stop a running play execution, including open HITL waits.
|
|
1216
1192
|
*
|
|
1217
|
-
* @param workflowId -
|
|
1193
|
+
* @param workflowId - Public Deepline play-run id to stop
|
|
1218
1194
|
* @param options.reason - Optional audit/debug reason
|
|
1219
1195
|
*/
|
|
1220
1196
|
stopPlay(workflowId: string, options?: {
|
|
@@ -1258,15 +1234,7 @@ declare class DeeplineClient {
|
|
|
1258
1234
|
* ```
|
|
1259
1235
|
*/
|
|
1260
1236
|
listRuns(options: RunsListOptions): Promise<PlayRunListItem[]>;
|
|
1261
|
-
/**
|
|
1262
|
-
* Fetch the lightweight tail status for a run using the public runs resource model.
|
|
1263
|
-
*
|
|
1264
|
-
* This is the SDK equivalent of:
|
|
1265
|
-
*
|
|
1266
|
-
* ```bash
|
|
1267
|
-
* deepline runs tail <run-id> --json
|
|
1268
|
-
* ```
|
|
1269
|
-
*/
|
|
1237
|
+
/** Read the canonical run stream and return the latest run snapshot. */
|
|
1270
1238
|
tailRun(runId: string, options?: RunsTailOptions): Promise<PlayStatus>;
|
|
1271
1239
|
/**
|
|
1272
1240
|
* Fetch persisted logs for a run using the public runs resource model.
|
|
@@ -1358,11 +1326,11 @@ declare class DeeplineClient {
|
|
|
1358
1326
|
*/
|
|
1359
1327
|
deletePlay(name: string): Promise<DeletePlayResult>;
|
|
1360
1328
|
/**
|
|
1361
|
-
* Run a play end-to-end: submit,
|
|
1329
|
+
* Run a play end-to-end: submit, stream until terminal, return result.
|
|
1362
1330
|
*
|
|
1363
1331
|
* This is the highest-level play execution method. It submits the play,
|
|
1364
|
-
*
|
|
1365
|
-
* and timing. Supports cancellation via `AbortSignal`.
|
|
1332
|
+
* reads the canonical run stream for status updates, and returns a structured
|
|
1333
|
+
* result with logs and timing. Supports cancellation via `AbortSignal`.
|
|
1366
1334
|
*
|
|
1367
1335
|
* @param code - Source string fallback; pass the bundled artifact in `options.artifact`
|
|
1368
1336
|
* @param csvPath - Input CSV path, or `null`
|
|
@@ -1378,7 +1346,6 @@ declare class DeeplineClient {
|
|
|
1378
1346
|
* const logs = status.progress?.logs ?? [];
|
|
1379
1347
|
* console.log(`[${status.status}] ${logs.length} log lines`);
|
|
1380
1348
|
* },
|
|
1381
|
-
* pollIntervalMs: 1000,
|
|
1382
1349
|
* });
|
|
1383
1350
|
*
|
|
1384
1351
|
* if (result.success) {
|
|
@@ -1400,10 +1367,8 @@ declare class DeeplineClient {
|
|
|
1400
1367
|
* ```
|
|
1401
1368
|
*/
|
|
1402
1369
|
runPlay(code: string, csvPath: string | null, name?: string, options?: {
|
|
1403
|
-
/** Called
|
|
1370
|
+
/** Called for each status snapshot emitted by the run stream. */
|
|
1404
1371
|
onProgress?: (status: PlayStatus) => void;
|
|
1405
|
-
/** Milliseconds between status polls. Default: `500`. */
|
|
1406
|
-
pollIntervalMs?: number;
|
|
1407
1372
|
/** Abort signal — triggers cancellation and immediate return. */
|
|
1408
1373
|
signal?: AbortSignal;
|
|
1409
1374
|
/** Runtime input for the play function. */
|
|
@@ -1434,7 +1399,7 @@ declare class DeeplineClient {
|
|
|
1434
1399
|
}>;
|
|
1435
1400
|
}
|
|
1436
1401
|
|
|
1437
|
-
declare const SDK_VERSION = "0.1.
|
|
1402
|
+
declare const SDK_VERSION = "0.1.22";
|
|
1438
1403
|
declare const SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
1439
1404
|
|
|
1440
1405
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -342,7 +342,7 @@ interface ToolMetadata extends ToolDefinition {
|
|
|
342
342
|
interface PlayRunResult {
|
|
343
343
|
/** `true` if the play completed successfully (`status === 'completed'`). */
|
|
344
344
|
success: boolean;
|
|
345
|
-
/** Public play-run identifier
|
|
345
|
+
/** Public play-run identifier. */
|
|
346
346
|
runId: string;
|
|
347
347
|
/** The play's return value. Only present on success. */
|
|
348
348
|
result?: unknown;
|
|
@@ -363,8 +363,6 @@ interface PlayProgressStatus {
|
|
|
363
363
|
totalRows?: number;
|
|
364
364
|
/** Accumulated log lines from `ctx.log()`. Grows monotonically. */
|
|
365
365
|
logs: string[];
|
|
366
|
-
/** Zero-based offset of the first returned log line when a tail cursor is used. */
|
|
367
|
-
logOffset?: number;
|
|
368
366
|
/** Error message if the play has failed. */
|
|
369
367
|
error?: string;
|
|
370
368
|
}
|
|
@@ -399,7 +397,7 @@ interface PlayStatus {
|
|
|
399
397
|
progress?: PlayProgressStatus;
|
|
400
398
|
/** Partial or final result. Available once the play returns. */
|
|
401
399
|
result?: unknown;
|
|
402
|
-
/**
|
|
400
|
+
/** Scheduler-backed run metadata when returned by the status endpoint. */
|
|
403
401
|
run?: {
|
|
404
402
|
startTime?: string | null;
|
|
405
403
|
closeTime?: string | null;
|
|
@@ -444,9 +442,9 @@ interface StopPlayRunResult {
|
|
|
444
442
|
* Summary of a single play run, returned by {@link DeeplineClient.listPlayRuns}.
|
|
445
443
|
*/
|
|
446
444
|
interface PlayRunListItem {
|
|
447
|
-
/**
|
|
445
|
+
/** Public Deepline play-run id. */
|
|
448
446
|
workflowId: string;
|
|
449
|
-
/**
|
|
447
|
+
/** Backend run attempt id, when exposed. */
|
|
450
448
|
runId: string;
|
|
451
449
|
/** Workflow type (typically `'Workflow'`). */
|
|
452
450
|
type: string;
|
|
@@ -564,7 +562,7 @@ interface PlayDefinitionDetail {
|
|
|
564
562
|
runCount: number;
|
|
565
563
|
/** Primary key column for CSV-based plays. */
|
|
566
564
|
tableNamespace?: string | null;
|
|
567
|
-
/**
|
|
565
|
+
/** Public Deepline id of the latest run. */
|
|
568
566
|
latestRunId?: string | null;
|
|
569
567
|
/** Unix timestamp (ms). */
|
|
570
568
|
createdAt: number;
|
|
@@ -677,12 +675,11 @@ interface ClearPlayHistoryResult {
|
|
|
677
675
|
* ```typescript
|
|
678
676
|
* const started = await client.startPlayRun({ name: 'my-play', input: { domain: 'stripe.com' } });
|
|
679
677
|
* console.log(`Started: ${started.workflowId}`);
|
|
680
|
-
* console.log(`Status URL: ${started.statusUrl}`);
|
|
681
678
|
* console.log(`Dashboard: ${started.dashboardUrl}`);
|
|
682
679
|
* ```
|
|
683
680
|
*/
|
|
684
681
|
interface PlayRunStart {
|
|
685
|
-
/**
|
|
682
|
+
/** Public Deepline play-run id for tracking this execution. */
|
|
686
683
|
workflowId: string;
|
|
687
684
|
/** Public Deepline play-run API version. */
|
|
688
685
|
apiVersion?: number;
|
|
@@ -694,8 +691,6 @@ interface PlayRunStart {
|
|
|
694
691
|
runtimeBackend?: string;
|
|
695
692
|
/** Canonical run contract compatibility metadata. */
|
|
696
693
|
contract?: Record<string, unknown> | null;
|
|
697
|
-
/** URL to poll for status updates. */
|
|
698
|
-
statusUrl?: string;
|
|
699
694
|
/** Dashboard URL for the named play. */
|
|
700
695
|
dashboardUrl?: string;
|
|
701
696
|
/** Terminal status returned when the start request used a short completion wait. */
|
|
@@ -706,7 +701,7 @@ interface PlayRunStart {
|
|
|
706
701
|
*
|
|
707
702
|
* This is the check-only version of play artifact registration: the server runs
|
|
708
703
|
* the same preflight compiler and static-analysis pass without storing,
|
|
709
|
-
* publishing, or starting a
|
|
704
|
+
* publishing, or starting a play run.
|
|
710
705
|
*/
|
|
711
706
|
interface PlayCheckResult {
|
|
712
707
|
valid: boolean;
|
|
@@ -773,8 +768,7 @@ interface StartPlayRunRequest {
|
|
|
773
768
|
waitForCompletionMs?: number;
|
|
774
769
|
/**
|
|
775
770
|
* Per-run execution profile override. The server defaults to `workers_edge`;
|
|
776
|
-
* tests
|
|
777
|
-
* this unset.
|
|
771
|
+
* tests can pass `local` here. Most callers should leave this unset.
|
|
778
772
|
*/
|
|
779
773
|
profile?: string;
|
|
780
774
|
}
|
|
@@ -836,11 +830,7 @@ type RunsListOptions = {
|
|
|
836
830
|
status?: string;
|
|
837
831
|
};
|
|
838
832
|
type RunsTailOptions = {
|
|
839
|
-
|
|
840
|
-
afterLogIndex?: number;
|
|
841
|
-
waitMs?: number;
|
|
842
|
-
terminalOnly?: boolean;
|
|
843
|
-
compact?: boolean;
|
|
833
|
+
signal?: AbortSignal;
|
|
844
834
|
};
|
|
845
835
|
type RunsLogsOptions = {
|
|
846
836
|
limit?: number;
|
|
@@ -919,7 +909,7 @@ declare class DeeplineClient {
|
|
|
919
909
|
/**
|
|
920
910
|
* Search available tools using Deepline's ranked backend search.
|
|
921
911
|
*
|
|
922
|
-
* This is the same discovery surface used by the
|
|
912
|
+
* This is the same discovery surface used by the CLI: it ranks across
|
|
923
913
|
* tool metadata, categories, agent guidance, and input schema fields.
|
|
924
914
|
*/
|
|
925
915
|
searchTools(options?: ToolSearchOptions): Promise<ToolSearchResult>;
|
|
@@ -970,7 +960,7 @@ declare class DeeplineClient {
|
|
|
970
960
|
* `progress.logs`; they are not part of the user output object.
|
|
971
961
|
*
|
|
972
962
|
* @param request - Play run configuration (name, code, input, etc.)
|
|
973
|
-
* @returns
|
|
963
|
+
* @returns Run metadata including the public `workflowId`
|
|
974
964
|
*
|
|
975
965
|
* @example
|
|
976
966
|
* ```typescript
|
|
@@ -1160,9 +1150,6 @@ declare class DeeplineClient {
|
|
|
1160
1150
|
* Internal/advanced primitive. Public callers should usually prefer
|
|
1161
1151
|
* {@link runPlay}, {@link PlayJob.get}, or `deepline play run --watch`.
|
|
1162
1152
|
*
|
|
1163
|
-
* Poll this method until `status` reaches a terminal state:
|
|
1164
|
-
* `'completed'`, `'failed'`, or `'cancelled'`.
|
|
1165
|
-
*
|
|
1166
1153
|
* @param workflowId - Play-run id from {@link startPlayRun}
|
|
1167
1154
|
* @returns Current status with progress logs and partial results
|
|
1168
1155
|
*
|
|
@@ -1173,25 +1160,14 @@ declare class DeeplineClient {
|
|
|
1173
1160
|
* console.log(`Logs: ${status.progress?.logs.length ?? 0} lines`);
|
|
1174
1161
|
* ```
|
|
1175
1162
|
*/
|
|
1176
|
-
getPlayStatus(workflowId: string
|
|
1177
|
-
|
|
1178
|
-
* Get the lightweight tail-polling status for a play execution.
|
|
1179
|
-
*
|
|
1180
|
-
* This is intentionally smaller than {@link getPlayStatus}: it returns the
|
|
1181
|
-
* fields needed for CLI log tailing while the run is in flight, without
|
|
1182
|
-
* forcing the API to rebuild final result views on every poll. Call
|
|
1183
|
-
* {@link getPlayStatus} once after a terminal state for the full result.
|
|
1184
|
-
*/
|
|
1185
|
-
getPlayTailStatus(workflowId: string, options?: {
|
|
1186
|
-
afterLogIndex?: number;
|
|
1187
|
-
waitMs?: number;
|
|
1188
|
-
terminalOnly?: boolean;
|
|
1163
|
+
getPlayStatus(workflowId: string, options?: {
|
|
1164
|
+
billing?: boolean;
|
|
1189
1165
|
}): Promise<PlayStatus>;
|
|
1190
1166
|
/**
|
|
1191
1167
|
* Stream semantic play-run events using the same SSE feed as the dashboard.
|
|
1192
1168
|
*
|
|
1193
|
-
*
|
|
1194
|
-
*
|
|
1169
|
+
* The server emits a canonical `play.run.snapshot` event first for every
|
|
1170
|
+
* connection, then incremental live events until terminal state or reconnect.
|
|
1195
1171
|
*/
|
|
1196
1172
|
streamPlayRunEvents(workflowId: string, options?: {
|
|
1197
1173
|
signal?: AbortSignal;
|
|
@@ -1203,7 +1179,7 @@ declare class DeeplineClient {
|
|
|
1203
1179
|
*
|
|
1204
1180
|
* Sends a stop request for the run.
|
|
1205
1181
|
*
|
|
1206
|
-
* @param workflowId -
|
|
1182
|
+
* @param workflowId - Public Deepline play-run id to cancel
|
|
1207
1183
|
*
|
|
1208
1184
|
* @example
|
|
1209
1185
|
* ```typescript
|
|
@@ -1214,7 +1190,7 @@ declare class DeeplineClient {
|
|
|
1214
1190
|
/**
|
|
1215
1191
|
* Stop a running play execution, including open HITL waits.
|
|
1216
1192
|
*
|
|
1217
|
-
* @param workflowId -
|
|
1193
|
+
* @param workflowId - Public Deepline play-run id to stop
|
|
1218
1194
|
* @param options.reason - Optional audit/debug reason
|
|
1219
1195
|
*/
|
|
1220
1196
|
stopPlay(workflowId: string, options?: {
|
|
@@ -1258,15 +1234,7 @@ declare class DeeplineClient {
|
|
|
1258
1234
|
* ```
|
|
1259
1235
|
*/
|
|
1260
1236
|
listRuns(options: RunsListOptions): Promise<PlayRunListItem[]>;
|
|
1261
|
-
/**
|
|
1262
|
-
* Fetch the lightweight tail status for a run using the public runs resource model.
|
|
1263
|
-
*
|
|
1264
|
-
* This is the SDK equivalent of:
|
|
1265
|
-
*
|
|
1266
|
-
* ```bash
|
|
1267
|
-
* deepline runs tail <run-id> --json
|
|
1268
|
-
* ```
|
|
1269
|
-
*/
|
|
1237
|
+
/** Read the canonical run stream and return the latest run snapshot. */
|
|
1270
1238
|
tailRun(runId: string, options?: RunsTailOptions): Promise<PlayStatus>;
|
|
1271
1239
|
/**
|
|
1272
1240
|
* Fetch persisted logs for a run using the public runs resource model.
|
|
@@ -1358,11 +1326,11 @@ declare class DeeplineClient {
|
|
|
1358
1326
|
*/
|
|
1359
1327
|
deletePlay(name: string): Promise<DeletePlayResult>;
|
|
1360
1328
|
/**
|
|
1361
|
-
* Run a play end-to-end: submit,
|
|
1329
|
+
* Run a play end-to-end: submit, stream until terminal, return result.
|
|
1362
1330
|
*
|
|
1363
1331
|
* This is the highest-level play execution method. It submits the play,
|
|
1364
|
-
*
|
|
1365
|
-
* and timing. Supports cancellation via `AbortSignal`.
|
|
1332
|
+
* reads the canonical run stream for status updates, and returns a structured
|
|
1333
|
+
* result with logs and timing. Supports cancellation via `AbortSignal`.
|
|
1366
1334
|
*
|
|
1367
1335
|
* @param code - Source string fallback; pass the bundled artifact in `options.artifact`
|
|
1368
1336
|
* @param csvPath - Input CSV path, or `null`
|
|
@@ -1378,7 +1346,6 @@ declare class DeeplineClient {
|
|
|
1378
1346
|
* const logs = status.progress?.logs ?? [];
|
|
1379
1347
|
* console.log(`[${status.status}] ${logs.length} log lines`);
|
|
1380
1348
|
* },
|
|
1381
|
-
* pollIntervalMs: 1000,
|
|
1382
1349
|
* });
|
|
1383
1350
|
*
|
|
1384
1351
|
* if (result.success) {
|
|
@@ -1400,10 +1367,8 @@ declare class DeeplineClient {
|
|
|
1400
1367
|
* ```
|
|
1401
1368
|
*/
|
|
1402
1369
|
runPlay(code: string, csvPath: string | null, name?: string, options?: {
|
|
1403
|
-
/** Called
|
|
1370
|
+
/** Called for each status snapshot emitted by the run stream. */
|
|
1404
1371
|
onProgress?: (status: PlayStatus) => void;
|
|
1405
|
-
/** Milliseconds between status polls. Default: `500`. */
|
|
1406
|
-
pollIntervalMs?: number;
|
|
1407
1372
|
/** Abort signal — triggers cancellation and immediate return. */
|
|
1408
1373
|
signal?: AbortSignal;
|
|
1409
1374
|
/** Runtime input for the play function. */
|
|
@@ -1434,7 +1399,7 @@ declare class DeeplineClient {
|
|
|
1434
1399
|
}>;
|
|
1435
1400
|
}
|
|
1436
1401
|
|
|
1437
|
-
declare const SDK_VERSION = "0.1.
|
|
1402
|
+
declare const SDK_VERSION = "0.1.22";
|
|
1438
1403
|
declare const SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
1439
1404
|
|
|
1440
1405
|
/**
|