deepline 0.1.83 → 0.1.85
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 +64 -11
- package/dist/cli/index.mjs +64 -11
- package/dist/index.d.mts +230 -10
- package/dist/index.d.ts +230 -10
- package/dist/index.js +115 -2
- package/dist/index.mjs +110 -2
- package/dist/repo/apps/play-runner-workers/src/entry.ts +123 -26
- package/dist/repo/sdk/src/index.ts +11 -0
- package/dist/repo/sdk/src/play.ts +61 -5
- package/dist/repo/sdk/src/plays/harness-stub.ts +2 -1
- package/dist/repo/sdk/src/release.ts +2 -2
- package/dist/repo/sdk/src/types.ts +4 -0
- package/dist/repo/shared_libs/play-runtime/cell-staleness.ts +156 -7
- package/dist/repo/shared_libs/play-runtime/execution-plan.ts +3 -3
- package/dist/repo/shared_libs/play-runtime/extractor-targets.ts +106 -0
- package/dist/repo/shared_libs/play-runtime/providers.ts +28 -0
- package/dist/repo/shared_libs/play-runtime/scheduler-backend.ts +11 -0
- package/dist/repo/shared_libs/play-runtime/step-program-dataset-builder.ts +96 -6
- package/dist/repo/shared_libs/play-runtime/tool-result.ts +82 -0
- package/dist/repo/shared_libs/plays/static-pipeline.ts +133 -24
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -229,10 +229,10 @@ var import_node_path2 = require("path");
|
|
|
229
229
|
|
|
230
230
|
// src/release.ts
|
|
231
231
|
var SDK_RELEASE = {
|
|
232
|
-
version: "0.1.
|
|
232
|
+
version: "0.1.85",
|
|
233
233
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
234
234
|
supportPolicy: {
|
|
235
|
-
latest: "0.1.
|
|
235
|
+
latest: "0.1.85",
|
|
236
236
|
minimumSupported: "0.1.53",
|
|
237
237
|
deprecatedBelow: "0.1.53"
|
|
238
238
|
}
|
|
@@ -2136,6 +2136,9 @@ function readCsvRows(csvPath) {
|
|
|
2136
2136
|
function csvStringFromRows(rows, columns) {
|
|
2137
2137
|
return (0, import_sync2.stringify)(rows, {
|
|
2138
2138
|
header: true,
|
|
2139
|
+
cast: {
|
|
2140
|
+
boolean: (value) => value ? "true" : "false"
|
|
2141
|
+
},
|
|
2139
2142
|
...columns?.length ? { columns } : {}
|
|
2140
2143
|
});
|
|
2141
2144
|
}
|
|
@@ -5506,12 +5509,16 @@ var PLAY_DEDUP_BACKENDS = {
|
|
|
5506
5509
|
var PLAY_SCHEDULER_BACKENDS = {
|
|
5507
5510
|
temporal: "temporal",
|
|
5508
5511
|
cfWorkflows: "cf-workflows",
|
|
5512
|
+
postgres: "postgres",
|
|
5509
5513
|
inProcess: "in-process"
|
|
5510
5514
|
};
|
|
5511
5515
|
|
|
5512
5516
|
// ../shared_libs/play-runtime/providers.ts
|
|
5513
5517
|
var PLAY_RUNTIME_PROVIDER_IDS = {
|
|
5514
5518
|
workersEdge: "workers_edge",
|
|
5519
|
+
postgresFast: "postgres_fast",
|
|
5520
|
+
postgresFastSandbox: "postgres_fast_sandbox",
|
|
5521
|
+
postgresFastWorkers: "postgres_fast_workers",
|
|
5515
5522
|
local: "local"
|
|
5516
5523
|
};
|
|
5517
5524
|
var PLAY_RUNTIME_PROVIDERS = {
|
|
@@ -5523,6 +5530,30 @@ var PLAY_RUNTIME_PROVIDERS = {
|
|
|
5523
5530
|
artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
|
|
5524
5531
|
label: "Cloudflare Dynamic Workflows + Dynamic Workers + DO dedup"
|
|
5525
5532
|
},
|
|
5533
|
+
postgres_fast: {
|
|
5534
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.postgresFast,
|
|
5535
|
+
scheduler: PLAY_SCHEDULER_BACKENDS.postgres,
|
|
5536
|
+
runner: PLAY_RUNTIME_BACKENDS.daytona,
|
|
5537
|
+
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5538
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
5539
|
+
label: "Experimental Postgres Scheduler + warm sandbox runner + DO dedup"
|
|
5540
|
+
},
|
|
5541
|
+
postgres_fast_sandbox: {
|
|
5542
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.postgresFastSandbox,
|
|
5543
|
+
scheduler: PLAY_SCHEDULER_BACKENDS.postgres,
|
|
5544
|
+
runner: PLAY_RUNTIME_BACKENDS.daytona,
|
|
5545
|
+
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5546
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
5547
|
+
label: "Experimental Postgres Scheduler + warm sandbox runner + DO dedup"
|
|
5548
|
+
},
|
|
5549
|
+
postgres_fast_workers: {
|
|
5550
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.postgresFastWorkers,
|
|
5551
|
+
scheduler: PLAY_SCHEDULER_BACKENDS.postgres,
|
|
5552
|
+
runner: PLAY_RUNTIME_BACKENDS.cloudflareWorkers,
|
|
5553
|
+
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5554
|
+
artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
|
|
5555
|
+
label: "Experimental Postgres Scheduler + Queue/DO-woken Workers + DO dedup"
|
|
5556
|
+
},
|
|
5526
5557
|
local: {
|
|
5527
5558
|
id: PLAY_RUNTIME_PROVIDER_IDS.local,
|
|
5528
5559
|
scheduler: PLAY_SCHEDULER_BACKENDS.temporal,
|
|
@@ -8143,9 +8174,10 @@ function formatUnresolvedPackagedFiles(filePath, unresolvedFileReferences) {
|
|
|
8143
8174
|
const details = unresolvedFileReferences.map((unresolved) => `${unresolved.sourceFragment}: ${unresolved.message}`).join("; ");
|
|
8144
8175
|
return `Failed to package local ctx.csv(...) files in ${filePath}: ${details}`;
|
|
8145
8176
|
}
|
|
8146
|
-
async function collectBundledPlayGraph(entryFile) {
|
|
8177
|
+
async function collectBundledPlayGraph(entryFile, profile = null) {
|
|
8147
8178
|
const nodes = /* @__PURE__ */ new Map();
|
|
8148
8179
|
const visiting = /* @__PURE__ */ new Set();
|
|
8180
|
+
const artifactKind = resolveExecutionProfile(profile).artifactKind;
|
|
8149
8181
|
const visit = async (filePath) => {
|
|
8150
8182
|
const absolutePath = normalizePlayPath(filePath);
|
|
8151
8183
|
const cached = nodes.get(absolutePath);
|
|
@@ -8160,7 +8192,7 @@ async function collectBundledPlayGraph(entryFile) {
|
|
|
8160
8192
|
visiting.add(absolutePath);
|
|
8161
8193
|
try {
|
|
8162
8194
|
const bundleResult = await bundlePlayFile2(absolutePath, {
|
|
8163
|
-
target:
|
|
8195
|
+
target: artifactKind
|
|
8164
8196
|
});
|
|
8165
8197
|
if (bundleResult.success === false) {
|
|
8166
8198
|
throw new Error(
|
|
@@ -8275,7 +8307,8 @@ function formatTimestamp(value) {
|
|
|
8275
8307
|
return date.toISOString();
|
|
8276
8308
|
}
|
|
8277
8309
|
function formatRunLine(run) {
|
|
8278
|
-
|
|
8310
|
+
const credits = typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount(run.billingTotalCredits)} credits` : "\u2014";
|
|
8311
|
+
return `${run.workflowId} ${run.status} ${formatTimestamp(run.startTime)} ${credits}`;
|
|
8279
8312
|
}
|
|
8280
8313
|
function isTransientPlayStreamError(error) {
|
|
8281
8314
|
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
@@ -10127,7 +10160,7 @@ function writeStartedPlayRun(input2) {
|
|
|
10127
10160
|
);
|
|
10128
10161
|
}
|
|
10129
10162
|
function parsePlayRunOptions(args) {
|
|
10130
|
-
const usage = "Usage: deepline plays run <play-name> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run <play-file.ts> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --file <play-file.ts> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --name <name> [--input '{...}'] [--live|--latest|--revision-id <id>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--no-open] [--json] [--full] [--<input> value]\n Unknown --<input> value flags, such as --limit 5, are passed into play input.\nRun `deepline plays run --help` for idempotency, tool call id, and ctx.dataset guidance.";
|
|
10163
|
+
const usage = "Usage: deepline plays run <play-name> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run <play-file.ts> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --file <play-file.ts> [--input '{...}'] [--profile <id>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --name <name> [--input '{...}'] [--profile <id>] [--live|--latest|--revision-id <id>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--no-open] [--json] [--full] [--<input> value]\n Unknown --<input> value flags, such as --limit 5, are passed into play input.\nRun `deepline plays run --help` for idempotency, tool call id, and ctx.dataset guidance.";
|
|
10131
10164
|
let filePath = null;
|
|
10132
10165
|
let playName = null;
|
|
10133
10166
|
let input2 = null;
|
|
@@ -10140,6 +10173,7 @@ function parsePlayRunOptions(args) {
|
|
|
10140
10173
|
const force = args.includes("--force");
|
|
10141
10174
|
const noOpen = args.includes("--no-open");
|
|
10142
10175
|
let waitTimeoutMs = null;
|
|
10176
|
+
let profile = null;
|
|
10143
10177
|
for (let index = 0; index < args.length; index += 1) {
|
|
10144
10178
|
const arg = args[index];
|
|
10145
10179
|
if (arg === "--file" && args[index + 1]) {
|
|
@@ -10158,6 +10192,16 @@ function parsePlayRunOptions(args) {
|
|
|
10158
10192
|
revisionId = args[++index];
|
|
10159
10193
|
continue;
|
|
10160
10194
|
}
|
|
10195
|
+
if (arg === "--profile") {
|
|
10196
|
+
const value = args[index + 1];
|
|
10197
|
+
if (!value) {
|
|
10198
|
+
throw new Error("--profile requires an execution profile id.");
|
|
10199
|
+
}
|
|
10200
|
+
profile = value.trim();
|
|
10201
|
+
resolveExecutionProfile(profile);
|
|
10202
|
+
index += 1;
|
|
10203
|
+
continue;
|
|
10204
|
+
}
|
|
10161
10205
|
if (arg === "--live") {
|
|
10162
10206
|
revisionSelector = "live";
|
|
10163
10207
|
continue;
|
|
@@ -10245,7 +10289,8 @@ function parsePlayRunOptions(args) {
|
|
|
10245
10289
|
fullJson,
|
|
10246
10290
|
waitTimeoutMs,
|
|
10247
10291
|
force,
|
|
10248
|
-
noOpen
|
|
10292
|
+
noOpen,
|
|
10293
|
+
profile
|
|
10249
10294
|
};
|
|
10250
10295
|
}
|
|
10251
10296
|
function parsePlayCheckOptions(args) {
|
|
@@ -10522,7 +10567,7 @@ async function handleFileBackedRun(options) {
|
|
|
10522
10567
|
graph = await traceCliSpan(
|
|
10523
10568
|
"cli.play_file_bundle_graph",
|
|
10524
10569
|
{ targetKind: "file" },
|
|
10525
|
-
() => collectBundledPlayGraph(absolutePlayPath)
|
|
10570
|
+
() => collectBundledPlayGraph(absolutePlayPath, options.profile)
|
|
10526
10571
|
);
|
|
10527
10572
|
await traceCliSpan(
|
|
10528
10573
|
"cli.play_file_compile_manifests",
|
|
@@ -10582,7 +10627,8 @@ async function handleFileBackedRun(options) {
|
|
|
10582
10627
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
10583
10628
|
...stagedFileInputs.inputFile ? { inputFile: stagedFileInputs.inputFile } : {},
|
|
10584
10629
|
...stagedFileInputs.packagedFiles.length ? { packagedFiles: stagedFileInputs.packagedFiles } : {},
|
|
10585
|
-
...options.force ? { force: true } : {}
|
|
10630
|
+
...options.force ? { force: true } : {},
|
|
10631
|
+
...options.profile ? { profile: options.profile } : {}
|
|
10586
10632
|
};
|
|
10587
10633
|
if (options.watch) {
|
|
10588
10634
|
progress.phase("starting run");
|
|
@@ -10728,7 +10774,8 @@ async function handleNamedRun(options) {
|
|
|
10728
10774
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
10729
10775
|
...stagedFileInputs.inputFile ? { inputFile: stagedFileInputs.inputFile } : {},
|
|
10730
10776
|
...stagedFileInputs.packagedFiles.length ? { packagedFiles: stagedFileInputs.packagedFiles } : {},
|
|
10731
|
-
...options.force ? { force: true } : {}
|
|
10777
|
+
...options.force ? { force: true } : {},
|
|
10778
|
+
...options.profile ? { profile: options.profile } : {}
|
|
10732
10779
|
};
|
|
10733
10780
|
if (options.watch) {
|
|
10734
10781
|
progress.phase("starting run");
|
|
@@ -10892,10 +10939,12 @@ async function handleRunsList(args) {
|
|
|
10892
10939
|
startedAt: run.startTime,
|
|
10893
10940
|
finishedAt: run.closeTime,
|
|
10894
10941
|
executionTime: run.executionTime,
|
|
10942
|
+
billingTotalCredits: run.billingTotalCredits,
|
|
10943
|
+
billingMaxCreditsPerRun: run.billingMaxCreditsPerRun,
|
|
10895
10944
|
playName: run.memo?.playName ?? playName
|
|
10896
10945
|
}));
|
|
10897
10946
|
const lines = runs.length === 0 ? [`No runs found for ${playName}.`] : runs.map(
|
|
10898
|
-
(run) => `${run.runId} ${run.status} ${formatTimestamp(run.startedAt)}`
|
|
10947
|
+
(run) => `${run.runId} ${run.status} ${formatTimestamp(run.startedAt)} ${typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount(run.billingTotalCredits)} credits` : "\u2014"}`
|
|
10899
10948
|
);
|
|
10900
10949
|
printCommandEnvelope(
|
|
10901
10950
|
{
|
|
@@ -11816,6 +11865,9 @@ Examples:
|
|
|
11816
11865
|
).option("--file <path>", "Local play file to run").option("--name <name>", "Saved play name to run").option("-i, --input <json>", "Input JSON object or @file path").option("--live", "Run the current live revision explicitly").option("--latest", "Run the newest saved revision, even if it is not live").option(
|
|
11817
11866
|
"--revision-id <id>",
|
|
11818
11867
|
"Run a specific saved revision instead of the live revision"
|
|
11868
|
+
).option(
|
|
11869
|
+
"--profile <id>",
|
|
11870
|
+
"Internal/testing: override the execution profile for this run"
|
|
11819
11871
|
).option("--watch", "Compatibility alias; run waits by default").option("--wait", "Compatibility alias; run waits by default").option("--no-wait", "Start the run and return immediately").option(
|
|
11820
11872
|
"--logs",
|
|
11821
11873
|
"When output is non-interactive, stream play logs to stderr while waiting"
|
|
@@ -11849,6 +11901,7 @@ Pass-through input flags:
|
|
|
11849
11901
|
...options.live ? ["--live"] : [],
|
|
11850
11902
|
...options.latest ? ["--latest"] : [],
|
|
11851
11903
|
...options.revisionId ? ["--revision-id", options.revisionId] : [],
|
|
11904
|
+
...options.profile ? ["--profile", options.profile] : [],
|
|
11852
11905
|
...options.wait === false ? ["--no-wait"] : [],
|
|
11853
11906
|
...options.watch || options.wait ? ["--watch"] : [],
|
|
11854
11907
|
...options.logs ? ["--logs"] : [],
|
package/dist/cli/index.mjs
CHANGED
|
@@ -206,10 +206,10 @@ import { join as join2 } from "path";
|
|
|
206
206
|
|
|
207
207
|
// src/release.ts
|
|
208
208
|
var SDK_RELEASE = {
|
|
209
|
-
version: "0.1.
|
|
209
|
+
version: "0.1.85",
|
|
210
210
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
211
211
|
supportPolicy: {
|
|
212
|
-
latest: "0.1.
|
|
212
|
+
latest: "0.1.85",
|
|
213
213
|
minimumSupported: "0.1.53",
|
|
214
214
|
deprecatedBelow: "0.1.53"
|
|
215
215
|
}
|
|
@@ -2125,6 +2125,9 @@ function readCsvRows(csvPath) {
|
|
|
2125
2125
|
function csvStringFromRows(rows, columns) {
|
|
2126
2126
|
return stringify(rows, {
|
|
2127
2127
|
header: true,
|
|
2128
|
+
cast: {
|
|
2129
|
+
boolean: (value) => value ? "true" : "false"
|
|
2130
|
+
},
|
|
2128
2131
|
...columns?.length ? { columns } : {}
|
|
2129
2132
|
});
|
|
2130
2133
|
}
|
|
@@ -5508,12 +5511,16 @@ var PLAY_DEDUP_BACKENDS = {
|
|
|
5508
5511
|
var PLAY_SCHEDULER_BACKENDS = {
|
|
5509
5512
|
temporal: "temporal",
|
|
5510
5513
|
cfWorkflows: "cf-workflows",
|
|
5514
|
+
postgres: "postgres",
|
|
5511
5515
|
inProcess: "in-process"
|
|
5512
5516
|
};
|
|
5513
5517
|
|
|
5514
5518
|
// ../shared_libs/play-runtime/providers.ts
|
|
5515
5519
|
var PLAY_RUNTIME_PROVIDER_IDS = {
|
|
5516
5520
|
workersEdge: "workers_edge",
|
|
5521
|
+
postgresFast: "postgres_fast",
|
|
5522
|
+
postgresFastSandbox: "postgres_fast_sandbox",
|
|
5523
|
+
postgresFastWorkers: "postgres_fast_workers",
|
|
5517
5524
|
local: "local"
|
|
5518
5525
|
};
|
|
5519
5526
|
var PLAY_RUNTIME_PROVIDERS = {
|
|
@@ -5525,6 +5532,30 @@ var PLAY_RUNTIME_PROVIDERS = {
|
|
|
5525
5532
|
artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
|
|
5526
5533
|
label: "Cloudflare Dynamic Workflows + Dynamic Workers + DO dedup"
|
|
5527
5534
|
},
|
|
5535
|
+
postgres_fast: {
|
|
5536
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.postgresFast,
|
|
5537
|
+
scheduler: PLAY_SCHEDULER_BACKENDS.postgres,
|
|
5538
|
+
runner: PLAY_RUNTIME_BACKENDS.daytona,
|
|
5539
|
+
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5540
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
5541
|
+
label: "Experimental Postgres Scheduler + warm sandbox runner + DO dedup"
|
|
5542
|
+
},
|
|
5543
|
+
postgres_fast_sandbox: {
|
|
5544
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.postgresFastSandbox,
|
|
5545
|
+
scheduler: PLAY_SCHEDULER_BACKENDS.postgres,
|
|
5546
|
+
runner: PLAY_RUNTIME_BACKENDS.daytona,
|
|
5547
|
+
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5548
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
5549
|
+
label: "Experimental Postgres Scheduler + warm sandbox runner + DO dedup"
|
|
5550
|
+
},
|
|
5551
|
+
postgres_fast_workers: {
|
|
5552
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.postgresFastWorkers,
|
|
5553
|
+
scheduler: PLAY_SCHEDULER_BACKENDS.postgres,
|
|
5554
|
+
runner: PLAY_RUNTIME_BACKENDS.cloudflareWorkers,
|
|
5555
|
+
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5556
|
+
artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
|
|
5557
|
+
label: "Experimental Postgres Scheduler + Queue/DO-woken Workers + DO dedup"
|
|
5558
|
+
},
|
|
5528
5559
|
local: {
|
|
5529
5560
|
id: PLAY_RUNTIME_PROVIDER_IDS.local,
|
|
5530
5561
|
scheduler: PLAY_SCHEDULER_BACKENDS.temporal,
|
|
@@ -8152,9 +8183,10 @@ function formatUnresolvedPackagedFiles(filePath, unresolvedFileReferences) {
|
|
|
8152
8183
|
const details = unresolvedFileReferences.map((unresolved) => `${unresolved.sourceFragment}: ${unresolved.message}`).join("; ");
|
|
8153
8184
|
return `Failed to package local ctx.csv(...) files in ${filePath}: ${details}`;
|
|
8154
8185
|
}
|
|
8155
|
-
async function collectBundledPlayGraph(entryFile) {
|
|
8186
|
+
async function collectBundledPlayGraph(entryFile, profile = null) {
|
|
8156
8187
|
const nodes = /* @__PURE__ */ new Map();
|
|
8157
8188
|
const visiting = /* @__PURE__ */ new Set();
|
|
8189
|
+
const artifactKind = resolveExecutionProfile(profile).artifactKind;
|
|
8158
8190
|
const visit = async (filePath) => {
|
|
8159
8191
|
const absolutePath = normalizePlayPath(filePath);
|
|
8160
8192
|
const cached = nodes.get(absolutePath);
|
|
@@ -8169,7 +8201,7 @@ async function collectBundledPlayGraph(entryFile) {
|
|
|
8169
8201
|
visiting.add(absolutePath);
|
|
8170
8202
|
try {
|
|
8171
8203
|
const bundleResult = await bundlePlayFile2(absolutePath, {
|
|
8172
|
-
target:
|
|
8204
|
+
target: artifactKind
|
|
8173
8205
|
});
|
|
8174
8206
|
if (bundleResult.success === false) {
|
|
8175
8207
|
throw new Error(
|
|
@@ -8284,7 +8316,8 @@ function formatTimestamp(value) {
|
|
|
8284
8316
|
return date.toISOString();
|
|
8285
8317
|
}
|
|
8286
8318
|
function formatRunLine(run) {
|
|
8287
|
-
|
|
8319
|
+
const credits = typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount(run.billingTotalCredits)} credits` : "\u2014";
|
|
8320
|
+
return `${run.workflowId} ${run.status} ${formatTimestamp(run.startTime)} ${credits}`;
|
|
8288
8321
|
}
|
|
8289
8322
|
function isTransientPlayStreamError(error) {
|
|
8290
8323
|
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
@@ -10136,7 +10169,7 @@ function writeStartedPlayRun(input2) {
|
|
|
10136
10169
|
);
|
|
10137
10170
|
}
|
|
10138
10171
|
function parsePlayRunOptions(args) {
|
|
10139
|
-
const usage = "Usage: deepline plays run <play-name> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run <play-file.ts> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --file <play-file.ts> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --name <name> [--input '{...}'] [--live|--latest|--revision-id <id>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--no-open] [--json] [--full] [--<input> value]\n Unknown --<input> value flags, such as --limit 5, are passed into play input.\nRun `deepline plays run --help` for idempotency, tool call id, and ctx.dataset guidance.";
|
|
10172
|
+
const usage = "Usage: deepline plays run <play-name> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run <play-file.ts> [--input '{...}'] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --file <play-file.ts> [--input '{...}'] [--profile <id>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--full] [--<input> value]\n deepline plays run --name <name> [--input '{...}'] [--profile <id>] [--live|--latest|--revision-id <id>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--no-open] [--json] [--full] [--<input> value]\n Unknown --<input> value flags, such as --limit 5, are passed into play input.\nRun `deepline plays run --help` for idempotency, tool call id, and ctx.dataset guidance.";
|
|
10140
10173
|
let filePath = null;
|
|
10141
10174
|
let playName = null;
|
|
10142
10175
|
let input2 = null;
|
|
@@ -10149,6 +10182,7 @@ function parsePlayRunOptions(args) {
|
|
|
10149
10182
|
const force = args.includes("--force");
|
|
10150
10183
|
const noOpen = args.includes("--no-open");
|
|
10151
10184
|
let waitTimeoutMs = null;
|
|
10185
|
+
let profile = null;
|
|
10152
10186
|
for (let index = 0; index < args.length; index += 1) {
|
|
10153
10187
|
const arg = args[index];
|
|
10154
10188
|
if (arg === "--file" && args[index + 1]) {
|
|
@@ -10167,6 +10201,16 @@ function parsePlayRunOptions(args) {
|
|
|
10167
10201
|
revisionId = args[++index];
|
|
10168
10202
|
continue;
|
|
10169
10203
|
}
|
|
10204
|
+
if (arg === "--profile") {
|
|
10205
|
+
const value = args[index + 1];
|
|
10206
|
+
if (!value) {
|
|
10207
|
+
throw new Error("--profile requires an execution profile id.");
|
|
10208
|
+
}
|
|
10209
|
+
profile = value.trim();
|
|
10210
|
+
resolveExecutionProfile(profile);
|
|
10211
|
+
index += 1;
|
|
10212
|
+
continue;
|
|
10213
|
+
}
|
|
10170
10214
|
if (arg === "--live") {
|
|
10171
10215
|
revisionSelector = "live";
|
|
10172
10216
|
continue;
|
|
@@ -10254,7 +10298,8 @@ function parsePlayRunOptions(args) {
|
|
|
10254
10298
|
fullJson,
|
|
10255
10299
|
waitTimeoutMs,
|
|
10256
10300
|
force,
|
|
10257
|
-
noOpen
|
|
10301
|
+
noOpen,
|
|
10302
|
+
profile
|
|
10258
10303
|
};
|
|
10259
10304
|
}
|
|
10260
10305
|
function parsePlayCheckOptions(args) {
|
|
@@ -10531,7 +10576,7 @@ async function handleFileBackedRun(options) {
|
|
|
10531
10576
|
graph = await traceCliSpan(
|
|
10532
10577
|
"cli.play_file_bundle_graph",
|
|
10533
10578
|
{ targetKind: "file" },
|
|
10534
|
-
() => collectBundledPlayGraph(absolutePlayPath)
|
|
10579
|
+
() => collectBundledPlayGraph(absolutePlayPath, options.profile)
|
|
10535
10580
|
);
|
|
10536
10581
|
await traceCliSpan(
|
|
10537
10582
|
"cli.play_file_compile_manifests",
|
|
@@ -10591,7 +10636,8 @@ async function handleFileBackedRun(options) {
|
|
|
10591
10636
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
10592
10637
|
...stagedFileInputs.inputFile ? { inputFile: stagedFileInputs.inputFile } : {},
|
|
10593
10638
|
...stagedFileInputs.packagedFiles.length ? { packagedFiles: stagedFileInputs.packagedFiles } : {},
|
|
10594
|
-
...options.force ? { force: true } : {}
|
|
10639
|
+
...options.force ? { force: true } : {},
|
|
10640
|
+
...options.profile ? { profile: options.profile } : {}
|
|
10595
10641
|
};
|
|
10596
10642
|
if (options.watch) {
|
|
10597
10643
|
progress.phase("starting run");
|
|
@@ -10737,7 +10783,8 @@ async function handleNamedRun(options) {
|
|
|
10737
10783
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
10738
10784
|
...stagedFileInputs.inputFile ? { inputFile: stagedFileInputs.inputFile } : {},
|
|
10739
10785
|
...stagedFileInputs.packagedFiles.length ? { packagedFiles: stagedFileInputs.packagedFiles } : {},
|
|
10740
|
-
...options.force ? { force: true } : {}
|
|
10786
|
+
...options.force ? { force: true } : {},
|
|
10787
|
+
...options.profile ? { profile: options.profile } : {}
|
|
10741
10788
|
};
|
|
10742
10789
|
if (options.watch) {
|
|
10743
10790
|
progress.phase("starting run");
|
|
@@ -10901,10 +10948,12 @@ async function handleRunsList(args) {
|
|
|
10901
10948
|
startedAt: run.startTime,
|
|
10902
10949
|
finishedAt: run.closeTime,
|
|
10903
10950
|
executionTime: run.executionTime,
|
|
10951
|
+
billingTotalCredits: run.billingTotalCredits,
|
|
10952
|
+
billingMaxCreditsPerRun: run.billingMaxCreditsPerRun,
|
|
10904
10953
|
playName: run.memo?.playName ?? playName
|
|
10905
10954
|
}));
|
|
10906
10955
|
const lines = runs.length === 0 ? [`No runs found for ${playName}.`] : runs.map(
|
|
10907
|
-
(run) => `${run.runId} ${run.status} ${formatTimestamp(run.startedAt)}`
|
|
10956
|
+
(run) => `${run.runId} ${run.status} ${formatTimestamp(run.startedAt)} ${typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount(run.billingTotalCredits)} credits` : "\u2014"}`
|
|
10908
10957
|
);
|
|
10909
10958
|
printCommandEnvelope(
|
|
10910
10959
|
{
|
|
@@ -11825,6 +11874,9 @@ Examples:
|
|
|
11825
11874
|
).option("--file <path>", "Local play file to run").option("--name <name>", "Saved play name to run").option("-i, --input <json>", "Input JSON object or @file path").option("--live", "Run the current live revision explicitly").option("--latest", "Run the newest saved revision, even if it is not live").option(
|
|
11826
11875
|
"--revision-id <id>",
|
|
11827
11876
|
"Run a specific saved revision instead of the live revision"
|
|
11877
|
+
).option(
|
|
11878
|
+
"--profile <id>",
|
|
11879
|
+
"Internal/testing: override the execution profile for this run"
|
|
11828
11880
|
).option("--watch", "Compatibility alias; run waits by default").option("--wait", "Compatibility alias; run waits by default").option("--no-wait", "Start the run and return immediately").option(
|
|
11829
11881
|
"--logs",
|
|
11830
11882
|
"When output is non-interactive, stream play logs to stderr while waiting"
|
|
@@ -11858,6 +11910,7 @@ Pass-through input flags:
|
|
|
11858
11910
|
...options.live ? ["--live"] : [],
|
|
11859
11911
|
...options.latest ? ["--latest"] : [],
|
|
11860
11912
|
...options.revisionId ? ["--revision-id", options.revisionId] : [],
|
|
11913
|
+
...options.profile ? ["--profile", options.profile] : [],
|
|
11861
11914
|
...options.wait === false ? ["--no-wait"] : [],
|
|
11862
11915
|
...options.watch || options.wait ? ["--watch"] : [],
|
|
11863
11916
|
...options.logs ? ["--logs"] : [],
|