deepline 0.3.392 → 0.3.393
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/sdk/src/client.ts +156 -24
- package/dist/bundling-sources/sdk/src/compat.ts +9 -0
- package/dist/bundling-sources/sdk/src/http.ts +5 -1
- package/dist/bundling-sources/sdk/src/index.ts +5 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +182 -6
- package/dist/bundling-sources/sdk/src/release.ts +4 -1
- package/dist/bundling-sources/sdk/src/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/request-warnings.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +315 -0
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +41 -8
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +418 -44
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +11 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +19 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +158 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +235 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +92 -58
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +30 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1161 -316
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +28 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +24 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +31 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -4
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +172 -79
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +173 -1
- package/dist/cli/{auth-6JSA2ZCW.mjs → auth-5PXHA232.mjs} +4 -4
- package/dist/cli/auth-P3MVDTXM.js +39 -0
- package/dist/cli/{billing-Q5BLQHIU.js → billing-JFB2XLSO.js} +101 -74
- package/dist/cli/{billing-MRRO643H.mjs → billing-Z2N7ZAGM.mjs} +32 -5
- package/dist/cli/{chunk-CVLM3WMJ.js → chunk-2HAD745V.js} +242 -183
- package/dist/cli/{chunk-HGYBEAQP.mjs → chunk-2LGC4EFT.mjs} +3 -3
- package/dist/cli/{chunk-A3APGZFP.mjs → chunk-4PT2VA3A.mjs} +2 -2
- package/dist/cli/{chunk-6DBOU7UH.js → chunk-4XX6443T.js} +176 -87
- package/dist/cli/{chunk-2QLML6G4.mjs → chunk-5KWKZIQR.mjs} +4 -4
- package/dist/cli/{chunk-2G7DXFHI.mjs → chunk-5PRVMXKB.mjs} +27 -2
- package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-6I73X254.mjs} +1 -1
- package/dist/cli/{chunk-ZTACINO5.mjs → chunk-7HR7BGZL.mjs} +13 -3
- package/dist/cli/{chunk-BB3FNYFY.js → chunk-AARX5L4B.js} +2 -2
- package/dist/cli/{chunk-WMS5U6YB.js → chunk-CDFH2DYL.js} +20 -19
- package/dist/cli/{chunk-R3O2CZ4H.mjs → chunk-FQ6VHPW4.mjs} +2 -2
- package/dist/cli/{chunk-MU6M3URX.mjs → chunk-HLEESTCH.mjs} +1 -1
- package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
- package/dist/cli/{chunk-2Q3GEFL4.mjs → chunk-KIYU2TGL.mjs} +2 -2
- package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
- package/dist/cli/{chunk-UCKJQG25.js → chunk-L2SYLGRP.js} +8 -8
- package/dist/cli/{chunk-2GAHHSLB.mjs → chunk-LMMEAMA7.mjs} +3 -2
- package/dist/cli/{chunk-YAZCDBXX.mjs → chunk-LZPCDB7U.mjs} +3 -2
- package/dist/cli/{chunk-RV6ALZIX.js → chunk-M7Y7JYZX.js} +32 -7
- package/dist/cli/{chunk-QGKPTBRR.js → chunk-MS6GUPBB.js} +3 -3
- package/dist/cli/{chunk-4SFPVW7A.js → chunk-OXNOAD6Y.js} +26 -26
- package/dist/cli/{chunk-JOFPQGXW.js → chunk-PTDECJGP.js} +50 -50
- package/dist/cli/{chunk-5O4B6AUN.js → chunk-PWSWAN7Q.js} +25 -2
- package/dist/cli/{chunk-YN6YA7ZZ.mjs → chunk-Q26LUSQ2.mjs} +79 -20
- package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
- package/dist/cli/{chunk-7E66A24V.mjs → chunk-RKMB3N7K.mjs} +25 -2
- package/dist/cli/{chunk-JSLPHFP7.js → chunk-RWHWF5ZJ.js} +3 -2
- package/dist/cli/{chunk-3FV4GBRK.mjs → chunk-STNYIMIV.mjs} +97 -8
- package/dist/cli/chunk-UBKA33KY.mjs +310 -0
- package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
- package/dist/cli/{chunk-24VEN5PQ.mjs → chunk-UOGZUA24.mjs} +179 -17
- package/dist/cli/{chunk-T7OKJ2T6.js → chunk-VIQJIX2P.js} +73 -63
- package/dist/cli/{chunk-RIV2GS5E.js → chunk-VIWE6WRK.js} +627 -465
- package/dist/cli/{chunk-EY7RFC6A.js → chunk-W4WOMXR3.js} +15 -15
- package/dist/cli/chunk-XDVT3GOM.js +310 -0
- package/dist/cli/{chunk-2FQG2HU4.js → chunk-Z3OOZM5L.js} +8 -8
- package/dist/cli/{csv-E4QGUIGI.mjs → csv-KJWZHKCH.mjs} +3 -3
- package/dist/cli/{csv-26U5T24Z.js → csv-P3Z3YE7H.js} +12 -12
- package/dist/cli/{db-JTRJIAQW.mjs → db-NCM4CQIS.mjs} +6 -5
- package/dist/cli/{db-QHBFLMVL.js → db-NUZGJNQC.js} +31 -30
- package/dist/cli/{describe-E3DE3ZK3.mjs → describe-WT6MM2GO.mjs} +17 -16
- package/dist/cli/{describe-FDV2V74F.js → describe-YGSEN5WC.js} +24 -23
- package/dist/cli/{executions-VZYOGVQY.js → executions-PCOLHN7Q.js} +8 -7
- package/dist/cli/{executions-B3GTNPRE.mjs → executions-XS2IPJ4W.mjs} +6 -5
- package/dist/cli/{feedback-CR55FJA2.js → feedback-4MSH7TFU.js} +7 -7
- package/dist/cli/{feedback-4CEBR3OV.mjs → feedback-CCLTS5SV.mjs} +3 -3
- package/dist/cli/{git-NM2PHHZ4.mjs → git-K2DHPMPC.mjs} +4 -4
- package/dist/cli/git-RNM45FX4.js +23 -0
- package/dist/cli/index.js +96 -92
- package/dist/cli/index.mjs +46 -42
- package/dist/cli/{legacy-noops-A7MSW5ND.mjs → legacy-noops-B5S4AR3P.mjs} +4 -4
- package/dist/cli/{legacy-noops-ZUA4YFIH.js → legacy-noops-GPNOPFXV.js} +7 -7
- package/dist/cli/{monitors-NVPRQYP3.mjs → monitors-JLMAIPRG.mjs} +6 -5
- package/dist/cli/{monitors-ZE3TLZ4H.js → monitors-ZAWD7NSN.js} +87 -86
- package/dist/cli/{org-U7A6DV5D.js → org-P2KN4CES.js} +66 -65
- package/dist/cli/{org-KUBILNQV.mjs → org-T3JTHP4G.mjs} +6 -5
- package/dist/cli/{play-HRDXQ4QE.mjs → play-NK6BLRGL.mjs} +11 -10
- package/dist/cli/play-PDXR6JFB.js +158 -0
- package/dist/cli/{providers-OHIWI453.mjs → providers-3NQRA7IT.mjs} +6 -5
- package/dist/cli/{providers-VD6YTVQZ.js → providers-5QRZN3DT.js} +9 -8
- package/dist/cli/{quickstart-UBV2FONF.mjs → quickstart-PIA2JGPV.mjs} +3 -3
- package/dist/cli/{quickstart-ETTCWPA4.js → quickstart-R7NUZGNW.js} +5 -5
- package/dist/cli/run-identity-G257GQED.js +25 -0
- package/dist/cli/run-identity-MRNCEGV2.mjs +25 -0
- package/dist/cli/{search-F44IZRT7.mjs → search-AIDIIGLY.mjs} +7 -6
- package/dist/cli/search-QRWL7MFM.js +27 -0
- package/dist/cli/{secrets-CAEMRORF.js → secrets-BT3PGMWN.js} +15 -14
- package/dist/cli/{secrets-R6XOJZKU.mjs → secrets-OQNHL45O.mjs} +6 -5
- package/dist/cli/{sessions-6GC7OFTT.js → sessions-EYXWOSWK.js} +5 -5
- package/dist/cli/{sessions-RLN6UQS3.mjs → sessions-SF7WJPJP.mjs} +4 -4
- package/dist/cli/{settings-DPNVUAV2.js → settings-BA3GHBOD.js} +76 -75
- package/dist/cli/{settings-KIPAMRPP.mjs → settings-Y57JTFDD.mjs} +9 -8
- package/dist/cli/{setup-TU2F7PU5.mjs → setup-7GR5GBHA.mjs} +6 -6
- package/dist/cli/{setup-DTL3L5SG.js → setup-RERXYC66.js} +41 -41
- package/dist/cli/{skills-UV5MYJ46.mjs → skills-SJWIQAV5.mjs} +4 -4
- package/dist/cli/skills-V7EY75HB.js +28 -0
- package/dist/cli/tools-H5HLBCHH.js +41 -0
- package/dist/cli/{tools-QRRNDCQ7.mjs → tools-ZF3JXPNL.mjs} +10 -9
- package/dist/cli/update-472HA3LT.js +28 -0
- package/dist/cli/{update-4426TF35.mjs → update-FFFYQAOJ.mjs} +6 -6
- package/dist/cli/{workflow-HNLOVISB.js → workflow-SZJVQH4T.js} +17 -16
- package/dist/cli/{workflow-N4U5VLZ3.mjs → workflow-XVFEEGAS.mjs} +7 -6
- package/dist/{client-e6Qh5ZIg.d.mts → client-DU5dtHDy.d.mts} +153 -4
- package/dist/{client-Uxuy-xQ2.d.ts → client-mCE88hC4.d.ts} +153 -4
- package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DE4RdAiY.d.mts} +61 -1
- package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DE4RdAiY.d.ts} +61 -1
- package/dist/{index-B9fBZH1g.d.mts → index-BI6nWgaV.d.mts} +1 -1
- package/dist/{index-BZ6uzZJl.d.ts → index-Bi-f7HFT.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +120 -29
- package/dist/index.mjs +111 -20
- package/dist/install-integrity.json +91 -86
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +5 -2
- package/dist/plays/run-request.mjs +4 -1
- package/dist/release.d.mts +4 -1
- package/dist/release.d.ts +4 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-67TAELQL.js +0 -39
- package/dist/cli/git-I5JTK6YU.js +0 -23
- package/dist/cli/play-A2V7YDU7.js +0 -157
- package/dist/cli/search-WWXMBVPH.js +0 -26
- package/dist/cli/skills-SWOSEZLB.js +0 -28
- package/dist/cli/tools-IL2YCDQ6.js +0 -40
- package/dist/cli/update-BERDPEYR.js +0 -28
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
listPlayFileExports,
|
|
14
14
|
parsePlaySourceForAnalysis,
|
|
15
15
|
resolveEnabledExecutionProfile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6I73X254.mjs";
|
|
17
17
|
import {
|
|
18
18
|
parseCsvDataInput
|
|
19
19
|
} from "./chunk-HQXL5526.mjs";
|
|
20
20
|
import {
|
|
21
21
|
registerDeprecatedSearchCommand
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2LGC4EFT.mjs";
|
|
23
23
|
import {
|
|
24
24
|
handleDeploymentGet,
|
|
25
25
|
handleDeploymentsList
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4PT2VA3A.mjs";
|
|
27
27
|
import {
|
|
28
28
|
pinLocalPlayImports,
|
|
29
29
|
planLocalPlayExecution
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
normalizeRunEventOperationRequest,
|
|
43
43
|
parseLogLevel,
|
|
44
44
|
playInputExampleArgs
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-Q26LUSQ2.mjs";
|
|
46
46
|
import {
|
|
47
47
|
CSV_DATA_INPUT_KEY,
|
|
48
48
|
buildNamedPlayRunRequest,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
setDottedInputValue,
|
|
53
53
|
stageFileInputs,
|
|
54
54
|
stagedFileContentType
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-JI2B4RZP.mjs";
|
|
56
56
|
import {
|
|
57
57
|
recordCliTrace,
|
|
58
58
|
traceCliSpan
|
|
@@ -75,10 +75,10 @@ import {
|
|
|
75
75
|
printJsonError,
|
|
76
76
|
renderCommandEnvelopeText,
|
|
77
77
|
shouldEmitJson
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-5PRVMXKB.mjs";
|
|
79
79
|
import {
|
|
80
80
|
fetchWithDeploymentProtection
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-LMMEAMA7.mjs";
|
|
82
82
|
import {
|
|
83
83
|
DeeplineError
|
|
84
84
|
} from "./chunk-NXGCO4JB.mjs";
|
|
@@ -5562,6 +5562,13 @@ function resolveDaytonaSandboxComputeItem(input) {
|
|
|
5562
5562
|
};
|
|
5563
5563
|
}
|
|
5564
5564
|
|
|
5565
|
+
// ../play-runtime/runtime-constants.ts
|
|
5566
|
+
var STANDARD_PLAY_RUNTIME_LIMIT_SECONDS = 30 * 60;
|
|
5567
|
+
var PLAY_RUNNER_TERMINAL_GRACE_SECONDS = 90;
|
|
5568
|
+
var PLAY_RUNNER_STARTUP_GRACE_SECONDS = 4 * 60;
|
|
5569
|
+
var PLAY_RUNNER_TIMEOUT_SECONDS = 40 * 60;
|
|
5570
|
+
var WORKFLOW_EXECUTOR_TOKEN_TTL_SECONDS = MAX_PLAY_SANDBOX_RUNTIME_LIMITS.timeoutSeconds + (PLAY_RUNNER_TIMEOUT_SECONDS - STANDARD_PLAY_RUNTIME_LIMIT_SECONDS);
|
|
5571
|
+
|
|
5565
5572
|
// ../billing/compute-pricing-contract.ts
|
|
5566
5573
|
var COMPUTE_BILLING_MARKUP_MULTIPLIER = 5;
|
|
5567
5574
|
var DEFAULT_USD_PER_CUSTOMER_CREDIT = 0.1;
|
|
@@ -5570,10 +5577,13 @@ function roundUpCredits(value) {
|
|
|
5570
5577
|
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
5571
5578
|
return Math.ceil(value * 100) / 100;
|
|
5572
5579
|
}
|
|
5580
|
+
function maximumPlaySandboxBillingSeconds(limits) {
|
|
5581
|
+
return limits.timeoutSeconds + PLAY_RUNNER_TERMINAL_GRACE_SECONDS;
|
|
5582
|
+
}
|
|
5573
5583
|
function estimateDaytonaMaximumComputeCredits(limits) {
|
|
5574
5584
|
const item = resolveDaytonaSandboxComputeItem({
|
|
5575
5585
|
itemId: "estimate",
|
|
5576
|
-
wallTimeSeconds: limits
|
|
5586
|
+
wallTimeSeconds: maximumPlaySandboxBillingSeconds(limits),
|
|
5577
5587
|
cpu: limits.cpu,
|
|
5578
5588
|
memoryGiB: limits.memoryGiB,
|
|
5579
5589
|
diskGiB: limits.diskGiB
|
|
@@ -7519,6 +7529,8 @@ function parsePlayRunOptions(args, initialInput = null) {
|
|
|
7519
7529
|
let playName = null;
|
|
7520
7530
|
let input = initialInput === null ? null : structuredClone(initialInput);
|
|
7521
7531
|
let revisionId = null;
|
|
7532
|
+
let workflowId = null;
|
|
7533
|
+
let maxTotalCredits = null;
|
|
7522
7534
|
let revisionSelector = null;
|
|
7523
7535
|
const watch = !args.includes("--no-wait");
|
|
7524
7536
|
const dryRun = args.includes("--dry-run");
|
|
@@ -7539,6 +7551,22 @@ function parsePlayRunOptions(args, initialInput = null) {
|
|
|
7539
7551
|
let headers = null;
|
|
7540
7552
|
for (let index = 0; index < args.length; index += 1) {
|
|
7541
7553
|
const arg = args[index];
|
|
7554
|
+
if (arg === "--workflow-id") {
|
|
7555
|
+
const value = args[++index];
|
|
7556
|
+
if (!value || value.startsWith("--"))
|
|
7557
|
+
throw new Error("--workflow-id requires the original caller run ID.");
|
|
7558
|
+
workflowId = value;
|
|
7559
|
+
continue;
|
|
7560
|
+
}
|
|
7561
|
+
if (arg === "--max-total-credits") {
|
|
7562
|
+
const value = args[++index];
|
|
7563
|
+
if (value === void 0 || value.trim() === "" || !Number.isFinite(Number(value)) || Number(value) < 0)
|
|
7564
|
+
throw new Error(
|
|
7565
|
+
"--max-total-credits requires a non-negative number, including zero."
|
|
7566
|
+
);
|
|
7567
|
+
maxTotalCredits = Number(value);
|
|
7568
|
+
continue;
|
|
7569
|
+
}
|
|
7542
7570
|
if (arg === "--header" || arg.startsWith("--header=")) {
|
|
7543
7571
|
const raw = arg === "--header" ? args[index + 1] : arg.slice("--header=".length);
|
|
7544
7572
|
if (raw === void 0 || arg === "--header" && raw.startsWith("--")) {
|
|
@@ -7777,6 +7805,8 @@ function parsePlayRunOptions(args, initialInput = null) {
|
|
|
7777
7805
|
target: filePath ? { kind: "file", path: filePath } : { kind: "name", name: playName },
|
|
7778
7806
|
input,
|
|
7779
7807
|
revisionId,
|
|
7808
|
+
workflowId,
|
|
7809
|
+
maxTotalCredits,
|
|
7780
7810
|
revisionSelector,
|
|
7781
7811
|
watch,
|
|
7782
7812
|
emitLogs,
|
|
@@ -7842,6 +7872,11 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
|
|
|
7842
7872
|
"--live, --latest, and --revision-id only apply to named plays."
|
|
7843
7873
|
);
|
|
7844
7874
|
const dryRun = options.dryRun ?? base.dryRun;
|
|
7875
|
+
const maxTotalCredits = options.maxTotalCredits === void 0 ? base.maxTotalCredits : Number(options.maxTotalCredits);
|
|
7876
|
+
if (maxTotalCredits !== null && (!Number.isFinite(maxTotalCredits) || maxTotalCredits < 0 || options.maxTotalCredits?.trim() === ""))
|
|
7877
|
+
throw new Error(
|
|
7878
|
+
"--max-total-credits requires a non-negative number, including zero."
|
|
7879
|
+
);
|
|
7845
7880
|
if (dryRun && resolvedTarget.kind !== "file")
|
|
7846
7881
|
throw new Error("--dry-run currently requires a local Play file.");
|
|
7847
7882
|
const profile = stringOption(options.profile, "--profile")?.trim() ?? base.profile;
|
|
@@ -7910,6 +7945,8 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
|
|
|
7910
7945
|
dryRun,
|
|
7911
7946
|
input: base.input,
|
|
7912
7947
|
revisionId,
|
|
7948
|
+
workflowId: stringOption(options.workflowId, "--workflow-id") ?? base.workflowId,
|
|
7949
|
+
maxTotalCredits,
|
|
7913
7950
|
revisionSelector: options.live ? "live" : options.latest ? "latest" : base.revisionSelector,
|
|
7914
7951
|
profile,
|
|
7915
7952
|
fixtureBehavior,
|
|
@@ -9628,9 +9665,18 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
9628
9665
|
}
|
|
9629
9666
|
}
|
|
9630
9667
|
async function startAndWaitForPlayCompletionByStream(input) {
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9668
|
+
const prepared = await input.client.preparePlayRunAdmission(input.request, {
|
|
9669
|
+
onSubmission: input.onSubmission
|
|
9670
|
+
});
|
|
9671
|
+
const pinnedInput = {
|
|
9672
|
+
...input,
|
|
9673
|
+
request: prepared.body,
|
|
9674
|
+
startStream: prepared.startStream
|
|
9675
|
+
};
|
|
9676
|
+
const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
|
|
9677
|
+
for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
|
|
9678
|
+
const status = await startAndWaitForPlayCompletionByStreamOnce(pinnedInput);
|
|
9679
|
+
const retryDelayMs = retryDelays[attempt];
|
|
9634
9680
|
if (retryDelayMs === void 0 || !isRetryablePendingStartFailure(status)) {
|
|
9635
9681
|
return status;
|
|
9636
9682
|
}
|
|
@@ -9715,7 +9761,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9715
9761
|
} : null;
|
|
9716
9762
|
};
|
|
9717
9763
|
try {
|
|
9718
|
-
for await (const event of input.
|
|
9764
|
+
for await (const event of input.startStream({
|
|
9719
9765
|
signal: controller.signal
|
|
9720
9766
|
})) {
|
|
9721
9767
|
eventCount += 1;
|
|
@@ -13197,6 +13243,8 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13197
13243
|
...options.debugMapLatency ? { mapLatencyProfile: true } : {}
|
|
13198
13244
|
};
|
|
13199
13245
|
const startRequest = {
|
|
13246
|
+
...options.workflowId ? { workflowId: options.workflowId } : {},
|
|
13247
|
+
...options.maxTotalCredits !== null ? { maxTotalCredits: options.maxTotalCredits } : {},
|
|
13200
13248
|
name: playName,
|
|
13201
13249
|
sourceCode: bundleResult.sourceCode,
|
|
13202
13250
|
sourceFiles: bundleResult.sourceFiles,
|
|
@@ -13234,6 +13282,7 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13234
13282
|
open: options.open,
|
|
13235
13283
|
progress,
|
|
13236
13284
|
onRunStarted: hooks?.onRunStarted,
|
|
13285
|
+
onSubmission: hooks?.onSubmission,
|
|
13237
13286
|
onRunAdmitted: hooks?.onRunAdmitted
|
|
13238
13287
|
}).catch(async (error) => {
|
|
13239
13288
|
throw await normalizePlayStartError(client, error, playName);
|
|
@@ -13271,7 +13320,7 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13271
13320
|
const started = await traceCliSpan(
|
|
13272
13321
|
"cli.play_start_unwatched",
|
|
13273
13322
|
{ targetKind: "file", playName },
|
|
13274
|
-
() => client.startPlayRun(startRequest).catch(async (error) => {
|
|
13323
|
+
() => client.startPlayRun(startRequest, { onSubmission: hooks?.onSubmission }).catch(async (error) => {
|
|
13275
13324
|
throw await normalizePlayStartError(client, error, playName);
|
|
13276
13325
|
})
|
|
13277
13326
|
);
|
|
@@ -13395,6 +13444,8 @@ async function handleNamedRun(options, hooks) {
|
|
|
13395
13444
|
runtimeInput,
|
|
13396
13445
|
stagedFileInputs,
|
|
13397
13446
|
extra: {
|
|
13447
|
+
...options.workflowId ? { workflowId: options.workflowId } : {},
|
|
13448
|
+
...options.maxTotalCredits !== null ? { maxTotalCredits: options.maxTotalCredits } : {},
|
|
13398
13449
|
...options.force ? { force: true } : {},
|
|
13399
13450
|
...options.forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
13400
13451
|
...options.maxConcurrentExternalCalls !== null ? { maxConcurrentExternalCalls: options.maxConcurrentExternalCalls } : {},
|
|
@@ -13423,6 +13474,7 @@ async function handleNamedRun(options, hooks) {
|
|
|
13423
13474
|
open: options.open,
|
|
13424
13475
|
progress,
|
|
13425
13476
|
onRunStarted: hooks?.onRunStarted,
|
|
13477
|
+
onSubmission: hooks?.onSubmission,
|
|
13426
13478
|
onRunAdmitted: hooks?.onRunAdmitted
|
|
13427
13479
|
}).catch(async (error) => {
|
|
13428
13480
|
throw await normalizePlayStartError(client, error, playName, {
|
|
@@ -13463,7 +13515,7 @@ async function handleNamedRun(options, hooks) {
|
|
|
13463
13515
|
const started = await traceCliSpan(
|
|
13464
13516
|
"cli.play_start_unwatched",
|
|
13465
13517
|
{ targetKind: "name", playName },
|
|
13466
|
-
() => client.startPlayRun(startRequest).catch(async (error) => {
|
|
13518
|
+
() => client.startPlayRun(startRequest, { onSubmission: hooks?.onSubmission }).catch(async (error) => {
|
|
13467
13519
|
throw await normalizePlayStartError(client, error, playName, {
|
|
13468
13520
|
suggestMissingPlay: true
|
|
13469
13521
|
});
|
|
@@ -13499,12 +13551,36 @@ async function handlePlayRun(args, hooks) {
|
|
|
13499
13551
|
} : parsedOptions;
|
|
13500
13552
|
const runHooks = options.runIdFile ? {
|
|
13501
13553
|
...hooks,
|
|
13554
|
+
onSubmission: async (intent) => {
|
|
13555
|
+
const destination = `${options.runIdFile}.submission.json`;
|
|
13556
|
+
const tempPath = runIdFileTempPath(destination);
|
|
13557
|
+
try {
|
|
13558
|
+
const handle = await open(tempPath, "wx", 384);
|
|
13559
|
+
try {
|
|
13560
|
+
await handle.writeFile(
|
|
13561
|
+
JSON.stringify({
|
|
13562
|
+
version: 1,
|
|
13563
|
+
admissionState: "submitted_unknown",
|
|
13564
|
+
baseUrl: new DeeplineClient().baseUrl,
|
|
13565
|
+
...intent
|
|
13566
|
+
})
|
|
13567
|
+
);
|
|
13568
|
+
await handle.sync();
|
|
13569
|
+
} finally {
|
|
13570
|
+
await handle.close();
|
|
13571
|
+
}
|
|
13572
|
+
await link(tempPath, destination);
|
|
13573
|
+
} finally {
|
|
13574
|
+
await removeRunIdTempFile(tempPath);
|
|
13575
|
+
}
|
|
13576
|
+
await hooks?.onSubmission?.(intent);
|
|
13577
|
+
},
|
|
13502
13578
|
onRunStarted: async (runId) => {
|
|
13503
13579
|
try {
|
|
13504
13580
|
await writePlayRunIdFile(options.runIdFile, runId);
|
|
13505
13581
|
} catch (error) {
|
|
13506
13582
|
throw new Error(
|
|
13507
|
-
`Run ${runId} was accepted, but its identity could not be persisted to ${options.runIdFile}: ${error instanceof Error ? error.message : String(error)}. Inspect it with 'deepline runs get ${runId} --full'; do not submit a replacement run.`,
|
|
13583
|
+
`Run ${runId} was accepted, but its identity could not be persisted to ${options.runIdFile}: ${error instanceof Error ? error.message : String(error)}. Inspect it with 'deepline runs get ${runId} --full --json'; do not submit a replacement run.`,
|
|
13508
13584
|
{ cause: error }
|
|
13509
13585
|
);
|
|
13510
13586
|
}
|
|
@@ -16136,6 +16212,58 @@ Common commands:
|
|
|
16136
16212
|
deepline plays get prebuilt/person-linkedin-to-email
|
|
16137
16213
|
`
|
|
16138
16214
|
);
|
|
16215
|
+
play.command("resume-submission <path>").description(
|
|
16216
|
+
"Inspect or explicitly resubmit the same saved admission intent, preserving its run ID and original revision."
|
|
16217
|
+
).option(
|
|
16218
|
+
"--inspect",
|
|
16219
|
+
"Read the local submission identity only; no API calls or execution"
|
|
16220
|
+
).option("--json", "Emit the identity or admission response as JSON").action(
|
|
16221
|
+
async (path, options) => {
|
|
16222
|
+
const saved = JSON.parse(
|
|
16223
|
+
await readFileAsync(resolve5(path), "utf8")
|
|
16224
|
+
);
|
|
16225
|
+
const { callerPlayWorkflowIdMatchesRequest } = await import("./run-identity-MRNCEGV2.mjs");
|
|
16226
|
+
if (saved.version !== 1 || typeof saved.workflowId !== "string" || typeof saved.orgId !== "string" || typeof saved.baseUrl !== "string" || !saved.request || saved.request.admissionOrgId !== saved.orgId || saved.request.workflowId !== saved.workflowId || !callerPlayWorkflowIdMatchesRequest(
|
|
16227
|
+
saved.workflowId,
|
|
16228
|
+
saved.request
|
|
16229
|
+
)) {
|
|
16230
|
+
throw new Error(
|
|
16231
|
+
"The submission file does not contain a complete matching immutable admission intent."
|
|
16232
|
+
);
|
|
16233
|
+
}
|
|
16234
|
+
if (options.inspect) {
|
|
16235
|
+
const result2 = {
|
|
16236
|
+
workflowId: saved.workflowId,
|
|
16237
|
+
admissionState: "unknown",
|
|
16238
|
+
next: {
|
|
16239
|
+
inspect: `deepline runs get ${saved.workflowId} --json`,
|
|
16240
|
+
resume: `deepline plays resume-submission ${shellQuote(path)} --json`
|
|
16241
|
+
}
|
|
16242
|
+
};
|
|
16243
|
+
printCommandEnvelope(result2, {
|
|
16244
|
+
json: options.json,
|
|
16245
|
+
text: `Submission ${saved.workflowId}: admission is unknown. ${result2.next.inspect}
|
|
16246
|
+
`
|
|
16247
|
+
});
|
|
16248
|
+
return;
|
|
16249
|
+
}
|
|
16250
|
+
const client = new DeeplineClient();
|
|
16251
|
+
if (new URL(saved.baseUrl).origin !== new URL(client.baseUrl).origin) {
|
|
16252
|
+
throw new Error(
|
|
16253
|
+
"The submission belongs to a different API origin. Select its original host before recovery."
|
|
16254
|
+
);
|
|
16255
|
+
}
|
|
16256
|
+
const result = await client.startPlayRun(saved.request);
|
|
16257
|
+
printCommandEnvelope(
|
|
16258
|
+
{ ...result },
|
|
16259
|
+
{
|
|
16260
|
+
json: options.json,
|
|
16261
|
+
text: `Admission ${result.workflowId}: ${result.status ?? "observed"}.
|
|
16262
|
+
`
|
|
16263
|
+
}
|
|
16264
|
+
);
|
|
16265
|
+
}
|
|
16266
|
+
);
|
|
16139
16267
|
play.command("check <target>").description("Check a local play file or named/prebuilt play contract.").addHelpText(
|
|
16140
16268
|
"after",
|
|
16141
16269
|
`
|
|
@@ -16278,6 +16406,12 @@ Examples:
|
|
|
16278
16406
|
"Compatibility alias; run waits by default"
|
|
16279
16407
|
).hideHelp()
|
|
16280
16408
|
).option("--no-wait", "Start the run and return immediately").option(
|
|
16409
|
+
"--workflow-id <id>",
|
|
16410
|
+
"Reconcile or replay the same immutable request with its original caller run ID"
|
|
16411
|
+
).option(
|
|
16412
|
+
"--max-total-credits <credits>",
|
|
16413
|
+
"Require a strict total spend ceiling including compute; unbounded work is refused before admission"
|
|
16414
|
+
).option(
|
|
16281
16415
|
"--run-id-file <path>",
|
|
16282
16416
|
"Atomically write the accepted run id to a new JSON file"
|
|
16283
16417
|
).addOption(
|
|
@@ -16546,7 +16680,7 @@ Examples:
|
|
|
16546
16680
|
process.exitCode = await ownView();
|
|
16547
16681
|
return;
|
|
16548
16682
|
}
|
|
16549
|
-
const { describeAnything } = await import("./describe-
|
|
16683
|
+
const { describeAnything } = await import("./describe-WT6MM2GO.mjs");
|
|
16550
16684
|
process.exitCode = await describeAnything(
|
|
16551
16685
|
name,
|
|
16552
16686
|
{
|
|
@@ -16789,6 +16923,31 @@ Examples:
|
|
|
16789
16923
|
registerRunChildrenCommand(runs);
|
|
16790
16924
|
registerRunHistoryCommand(runs);
|
|
16791
16925
|
registerRunEventsCommand(runs);
|
|
16926
|
+
runs.command("rows-history <runId>").description(
|
|
16927
|
+
"Read one immutable run-row history page; incomplete historical capture is reported explicitly."
|
|
16928
|
+
).requiredOption("--play <name>", "Play reference owning this dataset").requiredOption(
|
|
16929
|
+
"--dataset <namespace>",
|
|
16930
|
+
"Recorded table namespace from the run dataset metadata"
|
|
16931
|
+
).option("--limit <rows>", "History entries per page (1 to 1000)", "200").option("--cursor <cursor>", "Opaque nextCursor from the previous page").option("--json", "Emit rows and coverage metadata as JSON").action(
|
|
16932
|
+
async (runId, options) => {
|
|
16933
|
+
const limit = Number(options.limit);
|
|
16934
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 1e3)
|
|
16935
|
+
throw new Error("--limit must be an integer from 1 to 1000.");
|
|
16936
|
+
const result = await new DeeplineClient().runs.rowHistory({
|
|
16937
|
+
playName: options.play,
|
|
16938
|
+
runId,
|
|
16939
|
+
tableNamespace: options.dataset,
|
|
16940
|
+
limit,
|
|
16941
|
+
cursor: options.cursor
|
|
16942
|
+
});
|
|
16943
|
+
printCompactJson({
|
|
16944
|
+
...result,
|
|
16945
|
+
...result.nextCursor ? {
|
|
16946
|
+
next: `deepline runs rows-history ${shellQuote(runId)} --play ${shellQuote(options.play)} --dataset ${shellQuote(options.dataset)} --limit ${limit} --cursor ${shellQuote(result.nextCursor)} --json`
|
|
16947
|
+
} : {}
|
|
16948
|
+
});
|
|
16949
|
+
}
|
|
16950
|
+
);
|
|
16792
16951
|
runs.command("status <runId>").description(
|
|
16793
16952
|
"Legacy scalar-only read. Use runs get for canonical status, progress, logs, and results."
|
|
16794
16953
|
).option("--json", "Emit JSON output").action(async (runId, options) => {
|
|
@@ -16988,7 +17147,10 @@ Examples:
|
|
|
16988
17147
|
...options.logLevel ? ["--log-level", options.logLevel] : []
|
|
16989
17148
|
]);
|
|
16990
17149
|
});
|
|
16991
|
-
const runLogsCommand = runs.command("logs [runId]").description("Read a run\u2019s logs or search recent events.").addHelpText("after", renderRunLogsHelp()).option("--limit <count>", "Maximum results: logs 200; events 100, max 200").option("--out <path>", "Save the full available text log").option(
|
|
17150
|
+
const runLogsCommand = runs.command("logs [runId]").description("Read a run\u2019s logs or search recent events.").addHelpText("after", renderRunLogsHelp()).option("--limit <count>", "Maximum results: logs 200; events 100, max 200").option("--out <path>", "Save the full available text log").option(
|
|
17151
|
+
"--failed",
|
|
17152
|
+
"Terminal log tail of an overall failed run; completed runs with failed rows use runs events --kind receipt.failed --payloads"
|
|
17153
|
+
).option("--log-level <level>", "debug (default), info, warn or error").option("--step <id>", "Query structured logs from this authored step").option(
|
|
16992
17154
|
"--level <level>",
|
|
16993
17155
|
"Query structured logs at this severity or above"
|
|
16994
17156
|
).option(
|