deepline 0.3.392 → 0.3.394
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 +895 -54
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +41 -4
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-policy.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +251 -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 +30 -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 +168 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +252 -10
- 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 +32 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +103 -23
- package/dist/bundling-sources/shared_libs/plays/core.ts +1 -1
- 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/bundling-sources/shared_libs/plays/tool-result-types.ts +18 -0
- package/dist/cli/auth-IHKISLJQ.js +39 -0
- package/dist/cli/{auth-6JSA2ZCW.mjs → auth-OSXDAVCF.mjs} +4 -4
- package/dist/cli/{billing-Q5BLQHIU.js → billing-EKLYOXUY.js} +101 -74
- package/dist/cli/{billing-MRRO643H.mjs → billing-ZNNKX3UR.mjs} +32 -5
- package/dist/cli/{chunk-4SFPVW7A.js → chunk-2MDDA7A4.js} +26 -26
- package/dist/cli/{chunk-JOFPQGXW.js → chunk-354JCXA2.js} +50 -50
- package/dist/cli/{chunk-7E66A24V.mjs → chunk-3HU47EGZ.mjs} +71 -9
- package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-3HWALOL2.mjs} +1 -1
- package/dist/cli/{chunk-T7OKJ2T6.js → chunk-4P27AXEA.js} +73 -63
- package/dist/cli/{chunk-24VEN5PQ.mjs → chunk-5BB2RGAX.mjs} +190 -18
- package/dist/cli/{chunk-JSLPHFP7.js → chunk-6YAUMG27.js} +3 -2
- package/dist/cli/{chunk-MU6M3URX.mjs → chunk-BP33SIZF.mjs} +1 -1
- package/dist/cli/{chunk-WMS5U6YB.js → chunk-CS6RAIVY.js} +20 -19
- package/dist/cli/{chunk-CVLM3WMJ.js → chunk-E23BQ5SC.js} +242 -183
- package/dist/cli/{chunk-2GAHHSLB.mjs → chunk-FJGW5GXU.mjs} +3 -2
- package/dist/cli/{chunk-YN6YA7ZZ.mjs → chunk-JHIJIHFB.mjs} +79 -20
- package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
- package/dist/cli/{chunk-5O4B6AUN.js → chunk-KB4SDX5S.js} +71 -9
- package/dist/cli/{chunk-RV6ALZIX.js → chunk-KGNTKMRG.js} +32 -7
- package/dist/cli/{chunk-6DBOU7UH.js → chunk-KI635JN4.js} +176 -87
- package/dist/cli/{chunk-2FQG2HU4.js → chunk-KIUMEOM5.js} +8 -8
- package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
- package/dist/cli/{chunk-2Q3GEFL4.mjs → chunk-M57J2SK4.mjs} +2 -2
- package/dist/cli/{chunk-R3O2CZ4H.mjs → chunk-MFB2VKBO.mjs} +2 -2
- package/dist/cli/{chunk-QGKPTBRR.js → chunk-MH73HMPV.js} +3 -3
- package/dist/cli/{chunk-BB3FNYFY.js → chunk-MLPU5SMZ.js} +2 -2
- package/dist/cli/{chunk-2G7DXFHI.mjs → chunk-NR3DFKNF.mjs} +27 -2
- package/dist/cli/{chunk-EY7RFC6A.js → chunk-QIQBYKLB.js} +15 -15
- package/dist/cli/{chunk-RIV2GS5E.js → chunk-RBJYWRCF.js} +638 -466
- package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
- package/dist/cli/{chunk-YAZCDBXX.mjs → chunk-TJI2EN6K.mjs} +3 -2
- package/dist/cli/chunk-UBKA33KY.mjs +310 -0
- package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
- package/dist/cli/{chunk-4TCT77UF.js → chunk-URWF7NGQ.js} +6 -1
- package/dist/cli/{chunk-2QLML6G4.mjs → chunk-UXFSWG3Q.mjs} +4 -4
- package/dist/cli/{chunk-UCKJQG25.js → chunk-VK6FYZLP.js} +8 -8
- package/dist/cli/{chunk-ZTACINO5.mjs → chunk-X63FDZJZ.mjs} +13 -3
- package/dist/cli/chunk-XDVT3GOM.js +310 -0
- package/dist/cli/{chunk-A3APGZFP.mjs → chunk-XRQ2AQL7.mjs} +2 -2
- package/dist/cli/{chunk-3FV4GBRK.mjs → chunk-XXUDVEXK.mjs} +97 -8
- package/dist/cli/{chunk-PQSA443V.mjs → chunk-ZI2ZNDJK.mjs} +6 -1
- package/dist/cli/{chunk-HGYBEAQP.mjs → chunk-ZYBGA4AR.mjs} +3 -3
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-E4QGUIGI.mjs → csv-5AXRB35H.mjs} +3 -3
- package/dist/cli/{csv-26U5T24Z.js → csv-LU7O75WE.js} +12 -12
- package/dist/cli/{db-JTRJIAQW.mjs → db-7XP5UWEW.mjs} +6 -5
- package/dist/cli/{db-QHBFLMVL.js → db-F7YTFKVM.js} +31 -30
- package/dist/cli/{describe-FDV2V74F.js → describe-FRH32RDV.js} +24 -23
- package/dist/cli/{describe-E3DE3ZK3.mjs → describe-K4ES5LIL.mjs} +17 -16
- package/dist/cli/{executions-B3GTNPRE.mjs → executions-IEHEHJUO.mjs} +6 -5
- package/dist/cli/{executions-VZYOGVQY.js → executions-RZV5XPT2.js} +8 -7
- package/dist/cli/{feedback-CR55FJA2.js → feedback-3P65QTX3.js} +7 -7
- package/dist/cli/{feedback-4CEBR3OV.mjs → feedback-FPUVZBAN.mjs} +3 -3
- package/dist/cli/{git-NM2PHHZ4.mjs → git-GLVVP7TY.mjs} +4 -4
- package/dist/cli/git-MFFAWVVX.js +23 -0
- package/dist/cli/index.js +100 -96
- package/dist/cli/index.mjs +47 -43
- package/dist/cli/{legacy-noops-A7MSW5ND.mjs → legacy-noops-3MOI6NBM.mjs} +4 -4
- package/dist/cli/{legacy-noops-ZUA4YFIH.js → legacy-noops-XKSGZR7Q.js} +7 -7
- package/dist/cli/{monitors-NVPRQYP3.mjs → monitors-FTBGNEFG.mjs} +6 -5
- package/dist/cli/{monitors-ZE3TLZ4H.js → monitors-NZ2DYNST.js} +87 -86
- package/dist/cli/{org-U7A6DV5D.js → org-MCKDQXIV.js} +66 -65
- package/dist/cli/{org-KUBILNQV.mjs → org-V2J5RBCN.mjs} +6 -5
- package/dist/cli/{play-HRDXQ4QE.mjs → play-AJFGME3B.mjs} +11 -10
- package/dist/cli/play-WLSN2EO2.js +158 -0
- package/dist/cli/{providers-VD6YTVQZ.js → providers-2JEZ2264.js} +9 -8
- package/dist/cli/{providers-OHIWI453.mjs → providers-I6RQJZFZ.mjs} +6 -5
- package/dist/cli/{quickstart-UBV2FONF.mjs → quickstart-BIDQDMO4.mjs} +3 -3
- package/dist/cli/{quickstart-ETTCWPA4.js → quickstart-GJ2RPDU3.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-5VN4YD4I.js +27 -0
- package/dist/cli/{search-F44IZRT7.mjs → search-ELRXFWG5.mjs} +7 -6
- package/dist/cli/{secrets-CAEMRORF.js → secrets-53IT6VXD.js} +15 -14
- package/dist/cli/{secrets-R6XOJZKU.mjs → secrets-SQXGZXIC.mjs} +6 -5
- package/dist/cli/{sessions-RLN6UQS3.mjs → sessions-2X5QF7SL.mjs} +4 -4
- package/dist/cli/{sessions-6GC7OFTT.js → sessions-CAV5M77Y.js} +5 -5
- package/dist/cli/{settings-DPNVUAV2.js → settings-532WNAZO.js} +76 -75
- package/dist/cli/{settings-KIPAMRPP.mjs → settings-7P67VGCJ.mjs} +9 -8
- package/dist/cli/{setup-DTL3L5SG.js → setup-6L2VSUWJ.js} +41 -41
- package/dist/cli/{setup-TU2F7PU5.mjs → setup-QGGBV2LE.mjs} +6 -6
- package/dist/cli/{skills-UV5MYJ46.mjs → skills-3FE62WBG.mjs} +4 -4
- package/dist/cli/skills-S6NPZAN7.js +28 -0
- package/dist/cli/tools-647RLXQS.js +41 -0
- package/dist/cli/{tools-QRRNDCQ7.mjs → tools-DMR25DEF.mjs} +10 -9
- package/dist/cli/{update-4426TF35.mjs → update-6RZMHJZP.mjs} +6 -6
- package/dist/cli/update-WVTSC3EM.js +28 -0
- package/dist/cli/{workflow-N4U5VLZ3.mjs → workflow-L2DQRE6R.mjs} +7 -6
- package/dist/cli/{workflow-HNLOVISB.js → workflow-TX4F2PIX.js} +17 -16
- package/dist/{client-e6Qh5ZIg.d.mts → client-BktIPdIj.d.mts} +153 -4
- package/dist/{client-Uxuy-xQ2.d.ts → client-C3O1Ipf3.d.ts} +153 -4
- package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DLxUY5kI.d.mts} +124 -10
- package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DLxUY5kI.d.ts} +124 -10
- package/dist/{index-BZ6uzZJl.d.ts → index-B_GM9E3q.d.ts} +1 -1
- package/dist/{index-B9fBZH1g.d.mts → index-SCb0NvDb.d.mts} +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 +94 -88
- 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-3HWALOL2.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-ZYBGA4AR.mjs";
|
|
23
23
|
import {
|
|
24
24
|
handleDeploymentGet,
|
|
25
25
|
handleDeploymentsList
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XRQ2AQL7.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-JHIJIHFB.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-NR3DFKNF.mjs";
|
|
79
79
|
import {
|
|
80
80
|
fetchWithDeploymentProtection
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-FJGW5GXU.mjs";
|
|
82
82
|
import {
|
|
83
83
|
DeeplineError
|
|
84
84
|
} from "./chunk-NXGCO4JB.mjs";
|
|
@@ -5352,7 +5352,7 @@ function stringValue(value) {
|
|
|
5352
5352
|
var EXTRACTED_GETTER_ERROR_HINT = "Deepline hint: extractedValues/extractedLists .get() only works for declared Deepline getters listed by `deepline describe <tool>`. Read tool-specific fields from `toolExecutionResult.toolResponse.rawV2` using the nesting shown in the response example, and use `toolExecutionResult.extractedLists.<name>.get()` for declared row/list outputs.";
|
|
5353
5353
|
var DATASET_API_HINT = "Deepline hint: PlayDataset is lazy, durable, and async-only. Use `.count()`, `.first()`, `.at(index)`, `.peek(n)`, `.materialize(limit)`, or async iteration; do not use `.length`, numeric indexing, spread, synchronous iteration, `.rows`, or `.toArray()`.";
|
|
5354
5354
|
var ROW_PROPERTY_HINT = "Deepline hint: this row type only contains fields produced by the CSV/schema and previous map steps. Check source column casing and the exact output field names from earlier steps before scaling.";
|
|
5355
|
-
var TOOLS_EXECUTE_SIGNATURE_HINT = "Deepline hint: ctx.tools.execute requires a request object: `ctx.tools.execute({ id, tool, input, description })`. The stable `id` is required for logs, metadata, and result-cache identity; terminal cache reuse is based on play, tool, semantic input, auth scope, provider action version, and cache policy.";
|
|
5355
|
+
var TOOLS_EXECUTE_SIGNATURE_HINT = "Deepline hint: ctx.tools.execute requires a request object: `ctx.tools.execute({ id, tool, input, description })`. The stable `id` is required for logs, metadata, and result-cache identity; terminal cache reuse is based on play, tool, semantic input, auth scope, provider action version, and cache policy. In authoring edition 11, also choose `staleAfterSeconds`: `0` for fresh logical work, a positive integer for the maximum reusable result age in seconds, or `null` for indefinite result reuse.";
|
|
5356
5356
|
var RUN_PLAY_SIGNATURE_HINT = "Deepline hint: ctx.runPlay uses a stable key plus a composable child play reference. Direct-run-only or dataset-backed batch plays must be run directly, exported, then consumed by a separate play.";
|
|
5357
5357
|
var MAP_BACKED_CHILD_HINT = "Deepline hint: dataset-backed child plays own durable table state and cannot be called from another play. Run that play directly, export its dataset, then pass the CSV to the next play.";
|
|
5358
5358
|
function sourceLineForError(sourceCode, error) {
|
|
@@ -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
|
}
|
|
@@ -16083,6 +16159,11 @@ function registerPlayCommands(program) {
|
|
|
16083
16159
|
Concepts:
|
|
16084
16160
|
Plays are durable cloud workflows.
|
|
16085
16161
|
Stable ctx.tools.execute({ id, tool, input, staleAfterSeconds: 0 }) requests fresh work.
|
|
16162
|
+
In authoring edition 11, choose freshness explicitly: 0 for fresh logical
|
|
16163
|
+
work, a positive integer for the maximum reusable result age in seconds, or
|
|
16164
|
+
null for indefinite result reuse. A matching completed operation receipt can
|
|
16165
|
+
still recover that operation after resume; older authored editions retain
|
|
16166
|
+
omitted-value behavior.
|
|
16086
16167
|
Completed calls are replay-safe during recovery of the same run; unfinished calls may execute again.
|
|
16087
16168
|
A stable id recovers a completed call; repeating plays run starts new work.
|
|
16088
16169
|
ctx.dataset adds row keys and row progress.
|
|
@@ -16136,6 +16217,58 @@ Common commands:
|
|
|
16136
16217
|
deepline plays get prebuilt/person-linkedin-to-email
|
|
16137
16218
|
`
|
|
16138
16219
|
);
|
|
16220
|
+
play.command("resume-submission <path>").description(
|
|
16221
|
+
"Inspect or explicitly resubmit the same saved admission intent, preserving its run ID and original revision."
|
|
16222
|
+
).option(
|
|
16223
|
+
"--inspect",
|
|
16224
|
+
"Read the local submission identity only; no API calls or execution"
|
|
16225
|
+
).option("--json", "Emit the identity or admission response as JSON").action(
|
|
16226
|
+
async (path, options) => {
|
|
16227
|
+
const saved = JSON.parse(
|
|
16228
|
+
await readFileAsync(resolve5(path), "utf8")
|
|
16229
|
+
);
|
|
16230
|
+
const { callerPlayWorkflowIdMatchesRequest } = await import("./run-identity-MRNCEGV2.mjs");
|
|
16231
|
+
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(
|
|
16232
|
+
saved.workflowId,
|
|
16233
|
+
saved.request
|
|
16234
|
+
)) {
|
|
16235
|
+
throw new Error(
|
|
16236
|
+
"The submission file does not contain a complete matching immutable admission intent."
|
|
16237
|
+
);
|
|
16238
|
+
}
|
|
16239
|
+
if (options.inspect) {
|
|
16240
|
+
const result2 = {
|
|
16241
|
+
workflowId: saved.workflowId,
|
|
16242
|
+
admissionState: "unknown",
|
|
16243
|
+
next: {
|
|
16244
|
+
inspect: `deepline runs get ${saved.workflowId} --json`,
|
|
16245
|
+
resume: `deepline plays resume-submission ${shellQuote(path)} --json`
|
|
16246
|
+
}
|
|
16247
|
+
};
|
|
16248
|
+
printCommandEnvelope(result2, {
|
|
16249
|
+
json: options.json,
|
|
16250
|
+
text: `Submission ${saved.workflowId}: admission is unknown. ${result2.next.inspect}
|
|
16251
|
+
`
|
|
16252
|
+
});
|
|
16253
|
+
return;
|
|
16254
|
+
}
|
|
16255
|
+
const client = new DeeplineClient();
|
|
16256
|
+
if (new URL(saved.baseUrl).origin !== new URL(client.baseUrl).origin) {
|
|
16257
|
+
throw new Error(
|
|
16258
|
+
"The submission belongs to a different API origin. Select its original host before recovery."
|
|
16259
|
+
);
|
|
16260
|
+
}
|
|
16261
|
+
const result = await client.startPlayRun(saved.request);
|
|
16262
|
+
printCommandEnvelope(
|
|
16263
|
+
{ ...result },
|
|
16264
|
+
{
|
|
16265
|
+
json: options.json,
|
|
16266
|
+
text: `Admission ${result.workflowId}: ${result.status ?? "observed"}.
|
|
16267
|
+
`
|
|
16268
|
+
}
|
|
16269
|
+
);
|
|
16270
|
+
}
|
|
16271
|
+
);
|
|
16139
16272
|
play.command("check <target>").description("Check a local play file or named/prebuilt play contract.").addHelpText(
|
|
16140
16273
|
"after",
|
|
16141
16274
|
`
|
|
@@ -16214,6 +16347,11 @@ Idempotent execution:
|
|
|
16214
16347
|
Durable tool-call reuse is based on the actual external call identity:
|
|
16215
16348
|
same play, tool, semantic input, auth scope, provider action version, and
|
|
16216
16349
|
cache policy.
|
|
16350
|
+
In authoring edition 11, choose freshness explicitly: 0 for fresh logical
|
|
16351
|
+
work, a positive integer for the maximum reusable result age in seconds, or
|
|
16352
|
+
null for indefinite result reuse. A matching completed operation receipt can
|
|
16353
|
+
still recover that operation after resume. Older authored editions keep their
|
|
16354
|
+
existing omitted-value behavior.
|
|
16217
16355
|
|
|
16218
16356
|
await ctx.tools.execute({ id: 'company_lookup', tool, input, staleAfterSeconds: 86400 });
|
|
16219
16357
|
|
|
@@ -16278,6 +16416,12 @@ Examples:
|
|
|
16278
16416
|
"Compatibility alias; run waits by default"
|
|
16279
16417
|
).hideHelp()
|
|
16280
16418
|
).option("--no-wait", "Start the run and return immediately").option(
|
|
16419
|
+
"--workflow-id <id>",
|
|
16420
|
+
"Reconcile or replay the same immutable request with its original caller run ID"
|
|
16421
|
+
).option(
|
|
16422
|
+
"--max-total-credits <credits>",
|
|
16423
|
+
"Require a strict total spend ceiling including compute; unbounded work is refused before admission"
|
|
16424
|
+
).option(
|
|
16281
16425
|
"--run-id-file <path>",
|
|
16282
16426
|
"Atomically write the accepted run id to a new JSON file"
|
|
16283
16427
|
).addOption(
|
|
@@ -16546,7 +16690,7 @@ Examples:
|
|
|
16546
16690
|
process.exitCode = await ownView();
|
|
16547
16691
|
return;
|
|
16548
16692
|
}
|
|
16549
|
-
const { describeAnything } = await import("./describe-
|
|
16693
|
+
const { describeAnything } = await import("./describe-K4ES5LIL.mjs");
|
|
16550
16694
|
process.exitCode = await describeAnything(
|
|
16551
16695
|
name,
|
|
16552
16696
|
{
|
|
@@ -16789,6 +16933,31 @@ Examples:
|
|
|
16789
16933
|
registerRunChildrenCommand(runs);
|
|
16790
16934
|
registerRunHistoryCommand(runs);
|
|
16791
16935
|
registerRunEventsCommand(runs);
|
|
16936
|
+
runs.command("rows-history <runId>").description(
|
|
16937
|
+
"Read one immutable run-row history page; incomplete historical capture is reported explicitly."
|
|
16938
|
+
).requiredOption("--play <name>", "Play reference owning this dataset").requiredOption(
|
|
16939
|
+
"--dataset <namespace>",
|
|
16940
|
+
"Recorded table namespace from the run dataset metadata"
|
|
16941
|
+
).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(
|
|
16942
|
+
async (runId, options) => {
|
|
16943
|
+
const limit = Number(options.limit);
|
|
16944
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 1e3)
|
|
16945
|
+
throw new Error("--limit must be an integer from 1 to 1000.");
|
|
16946
|
+
const result = await new DeeplineClient().runs.rowHistory({
|
|
16947
|
+
playName: options.play,
|
|
16948
|
+
runId,
|
|
16949
|
+
tableNamespace: options.dataset,
|
|
16950
|
+
limit,
|
|
16951
|
+
cursor: options.cursor
|
|
16952
|
+
});
|
|
16953
|
+
printCompactJson({
|
|
16954
|
+
...result,
|
|
16955
|
+
...result.nextCursor ? {
|
|
16956
|
+
next: `deepline runs rows-history ${shellQuote(runId)} --play ${shellQuote(options.play)} --dataset ${shellQuote(options.dataset)} --limit ${limit} --cursor ${shellQuote(result.nextCursor)} --json`
|
|
16957
|
+
} : {}
|
|
16958
|
+
});
|
|
16959
|
+
}
|
|
16960
|
+
);
|
|
16792
16961
|
runs.command("status <runId>").description(
|
|
16793
16962
|
"Legacy scalar-only read. Use runs get for canonical status, progress, logs, and results."
|
|
16794
16963
|
).option("--json", "Emit JSON output").action(async (runId, options) => {
|
|
@@ -16988,7 +17157,10 @@ Examples:
|
|
|
16988
17157
|
...options.logLevel ? ["--log-level", options.logLevel] : []
|
|
16989
17158
|
]);
|
|
16990
17159
|
});
|
|
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(
|
|
17160
|
+
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(
|
|
17161
|
+
"--failed",
|
|
17162
|
+
"Terminal log tail of an overall failed run; completed runs with failed rows use runs events --kind receipt.failed --payloads"
|
|
17163
|
+
).option("--log-level <level>", "debug (default), info, warn or error").option("--step <id>", "Query structured logs from this authored step").option(
|
|
16992
17164
|
"--level <level>",
|
|
16993
17165
|
"Query structured logs at this severity or above"
|
|
16994
17166
|
).option(
|
|
@@ -49,10 +49,11 @@ var SDK_RELEASE = {
|
|
|
49
49
|
// getters keep their established compatibility behavior.
|
|
50
50
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
51
51
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
52
|
-
version: "0.3.
|
|
52
|
+
version: "0.3.394",
|
|
53
53
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
54
54
|
packageCapabilities: {
|
|
55
|
-
updatePreferences: 1
|
|
55
|
+
updatePreferences: 1,
|
|
56
|
+
skillsGuidance: 1
|
|
56
57
|
},
|
|
57
58
|
contracts: {
|
|
58
59
|
api: {
|
|
@@ -14,7 +14,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
14
14
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk6YAUMG27js = require('./chunk-6YAUMG27.js');
|
|
18
18
|
|
|
19
19
|
// src/errors.ts
|
|
20
20
|
var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
@@ -744,9 +744,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
|
|
|
744
744
|
}
|
|
745
745
|
|
|
746
746
|
// src/version.ts
|
|
747
|
-
var SDK_VERSION =
|
|
748
|
-
var SDK_API_MAJOR =
|
|
749
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
747
|
+
var SDK_VERSION = _chunk6YAUMG27js.SDK_RELEASE.version;
|
|
748
|
+
var SDK_API_MAJOR = _chunk6YAUMG27js.SDK_RELEASE.contracts.api.currentMajor;
|
|
749
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunk6YAUMG27js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
750
750
|
|
|
751
751
|
// src/agent-runtime.ts
|
|
752
752
|
|
|
@@ -1739,13 +1739,14 @@ var HttpClient = class {
|
|
|
1739
1739
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
1740
1740
|
}
|
|
1741
1741
|
let lastError = null;
|
|
1742
|
-
|
|
1742
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _209 => _209.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
1743
|
+
for (const candidateUrl of candidateUrls) {
|
|
1743
1744
|
try {
|
|
1744
1745
|
const response = await fetch(candidateUrl, {
|
|
1745
1746
|
method,
|
|
1746
1747
|
headers,
|
|
1747
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
1748
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
1748
|
+
body: _optionalChain([options, 'optionalAccess', _210 => _210.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
1749
|
+
signal: _optionalChain([options, 'optionalAccess', _211 => _211.signal])
|
|
1749
1750
|
});
|
|
1750
1751
|
if (!response.ok) {
|
|
1751
1752
|
const body = await response.text();
|
|
@@ -1786,7 +1787,7 @@ var HttpClient = class {
|
|
|
1786
1787
|
throw error;
|
|
1787
1788
|
}
|
|
1788
1789
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
1789
|
-
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess',
|
|
1790
|
+
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _212 => _212.signal, 'optionalAccess', _213 => _213.aborted])) {
|
|
1790
1791
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
1791
1792
|
`Stream from ${this.config.baseUrl} was aborted by the caller.`,
|
|
1792
1793
|
void 0,
|
|
@@ -1807,7 +1808,7 @@ var HttpClient = class {
|
|
|
1807
1808
|
}
|
|
1808
1809
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
1809
1810
|
withCoworkNetworkHint(
|
|
1810
|
-
_optionalChain([lastError, 'optionalAccess',
|
|
1811
|
+
_optionalChain([lastError, 'optionalAccess', _214 => _214.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
|
|
1811
1812
|
)
|
|
1812
1813
|
);
|
|
1813
1814
|
}
|
|
@@ -1869,15 +1870,15 @@ function parseResponseBody(body) {
|
|
|
1869
1870
|
}
|
|
1870
1871
|
function isProviderOriginatedHttpError(parsed) {
|
|
1871
1872
|
const response = asRecord(parsed);
|
|
1872
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
1873
|
-
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1874
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1873
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _215 => _215.error]));
|
|
1874
|
+
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _216 => _216.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _217 => _217.failure_origin])));
|
|
1875
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _218 => _218.code]), () => ( _optionalChain([response, 'optionalAccess', _219 => _219.code])));
|
|
1875
1876
|
return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
|
|
1876
1877
|
}
|
|
1877
1878
|
function isMonitorRateLimitEnvelope(parsed) {
|
|
1878
1879
|
const response = asRecord(parsed);
|
|
1879
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
1880
|
-
return _optionalChain([error, 'optionalAccess',
|
|
1880
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _220 => _220.error]));
|
|
1881
|
+
return _optionalChain([error, 'optionalAccess', _221 => _221.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
|
|
1881
1882
|
}
|
|
1882
1883
|
function asRecord(value) {
|
|
1883
1884
|
return typeof value === "object" && value !== null ? value : null;
|
|
@@ -1893,7 +1894,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
1893
1894
|
return null;
|
|
1894
1895
|
}
|
|
1895
1896
|
const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
1896
|
-
const title = _optionalChain([titleMatch, 'optionalAccess',
|
|
1897
|
+
const title = _optionalChain([titleMatch, 'optionalAccess', _222 => _222[1], 'optionalAccess', _223 => _223.replace, 'call', _224 => _224(/\s+/g, " "), 'access', _225 => _225.trim, 'call', _226 => _226()]) || void 0;
|
|
1897
1898
|
const workerThrewException = /worker threw exception/i.test(trimmed);
|
|
1898
1899
|
return {
|
|
1899
1900
|
title,
|
|
@@ -1977,20 +1978,20 @@ function decodeSseFrame(frame) {
|
|
|
1977
1978
|
}
|
|
1978
1979
|
function sleep(ms, signal) {
|
|
1979
1980
|
return new Promise((resolve2, reject) => {
|
|
1980
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1981
|
+
if (_optionalChain([signal, 'optionalAccess', _227 => _227.aborted])) {
|
|
1981
1982
|
reject(requestCancelledError(signal));
|
|
1982
1983
|
return;
|
|
1983
1984
|
}
|
|
1984
1985
|
const timeoutId = setTimeout(() => {
|
|
1985
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1986
|
+
_optionalChain([signal, 'optionalAccess', _228 => _228.removeEventListener, 'call', _229 => _229("abort", abort)]);
|
|
1986
1987
|
resolve2();
|
|
1987
1988
|
}, ms);
|
|
1988
1989
|
const abort = () => {
|
|
1989
1990
|
clearTimeout(timeoutId);
|
|
1990
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1991
|
+
_optionalChain([signal, 'optionalAccess', _230 => _230.removeEventListener, 'call', _231 => _231("abort", abort)]);
|
|
1991
1992
|
reject(requestCancelledError(signal));
|
|
1992
1993
|
};
|
|
1993
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1994
|
+
_optionalChain([signal, 'optionalAccess', _232 => _232.addEventListener, 'call', _233 => _233("abort", abort, { once: true })]);
|
|
1994
1995
|
});
|
|
1995
1996
|
}
|
|
1996
1997
|
function withCoworkNetworkHint(message) {
|