deepline 0.3.409 → 0.3.411
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/agent-runtime.ts +18 -1
- package/dist/bundling-sources/sdk/src/client.ts +206 -333
- package/dist/bundling-sources/sdk/src/compat.ts +45 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
- package/dist/bundling-sources/sdk/src/http.ts +38 -20
- package/dist/bundling-sources/sdk/src/index.ts +4 -5
- package/dist/bundling-sources/sdk/src/play.ts +10 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
- package/dist/bundling-sources/sdk/src/release.ts +13 -7
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
- package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
- package/dist/bundling-sources/sdk/src/types.ts +18 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
- package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
- package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/cli/auth-M7TBLW55.js +40 -0
- package/dist/cli/{auth-5HIIACF7.mjs → auth-YD6ZTMB2.mjs} +6 -6
- package/dist/cli/{billing-4275N7FL.js → billing-2L3MOB42.js} +84 -84
- package/dist/cli/{billing-EVZ3ZWKC.mjs → billing-ZT46GV4C.mjs} +8 -8
- package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
- package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
- package/dist/cli/{chunk-GAICVLKL.js → chunk-2NI6DHN7.js} +2 -2
- package/dist/cli/{chunk-JGHG4NBA.js → chunk-2WUY3VNK.js} +19 -4
- package/dist/cli/{chunk-FHPCKULR.mjs → chunk-4BA6ATHA.mjs} +2 -2
- package/dist/cli/{chunk-RTCDW2GU.js → chunk-4O4WNFFC.js} +170 -49
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-AU4OFDFX.js → chunk-5IGDNBG7.js} +26 -26
- package/dist/cli/{chunk-WYQO2CBS.mjs → chunk-5LRWWMRV.mjs} +149 -28
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/chunk-6AUE6JXY.js +35 -0
- package/dist/cli/chunk-7DSMMCXP.js +501 -0
- package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
- package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
- package/dist/cli/{chunk-J6DCKJNM.mjs → chunk-BJV3VSKE.mjs} +16 -1
- package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
- package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
- package/dist/cli/{chunk-BEVLCKXG.mjs → chunk-E4KBNNNB.mjs} +1 -1
- package/dist/cli/{chunk-2PRO2JTX.mjs → chunk-E52TKKVI.mjs} +36 -284
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-2GI3QD3L.js → chunk-FRVPOXGB.js} +644 -330
- package/dist/cli/chunk-G43JLBDE.mjs +501 -0
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/chunk-IPGV6VFA.mjs +6084 -0
- package/dist/cli/{chunk-IT3XBJQR.mjs → chunk-IR3AKJAY.mjs} +330 -625
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/chunk-JQMZUWNM.mjs +35 -0
- package/dist/cli/chunk-JYHSEGRM.js +6084 -0
- package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
- package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
- package/dist/cli/{chunk-O3VSXP2F.js → chunk-LWBM5FFL.js} +50 -50
- package/dist/cli/{chunk-VWBTTJYQ.mjs → chunk-M6OASCVL.mjs} +6 -3
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NQWIZ5PZ.js +313 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-TQNHMWUR.mjs → chunk-OGSXENOF.mjs} +5 -2
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/{chunk-FJCIUF34.js → chunk-OZSC6CEW.js} +128 -376
- package/dist/cli/{chunk-NZSF57UO.mjs → chunk-PO2VU6WV.mjs} +2 -2
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-N44JHMKY.mjs → chunk-RFES6Q2J.mjs} +452 -138
- package/dist/cli/{chunk-DEC3JECC.js → chunk-RMINBDYY.js} +5 -2
- package/dist/cli/{chunk-WLOCMJWV.js → chunk-TPFD4F5S.js} +426 -721
- package/dist/cli/{chunk-V76R6HMV.js → chunk-U5AQKE3T.js} +1029 -806
- package/dist/cli/{chunk-PBZYY7VZ.mjs → chunk-UAEVKAUR.mjs} +734 -511
- package/dist/cli/{chunk-WHG43Z67.js → chunk-VGHWJL4W.js} +11 -8
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XAB47ZRV.mjs +313 -0
- package/dist/cli/{chunk-JRAVVJ3T.mjs → chunk-XJD6LZCO.mjs} +2 -2
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-YD7B53RW.js → chunk-ZHWBU36H.js} +12 -12
- package/dist/cli/{csv-A2MP6EFV.mjs → csv-BKNRRW7D.mjs} +5 -5
- package/dist/cli/{csv-BBOTCGQY.js → csv-SVDP2EU7.js} +14 -14
- package/dist/cli/{db-3W5DMTUX.mjs → db-LU4KLRM6.mjs} +15 -20
- package/dist/cli/{db-G4CODDCA.js → db-OQ6S7TTZ.js} +42 -47
- package/dist/cli/{describe-PQTQ5B6F.js → describe-45TGETKR.js} +27 -22
- package/dist/cli/{describe-XYJ2ZT4M.mjs → describe-U4KOGDRA.mjs} +20 -15
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-UR67CA5H.mjs → executions-2GAAUXLA.mjs} +8 -8
- package/dist/cli/{executions-TLANVR7Y.js → executions-VZN56VRC.js} +10 -10
- package/dist/cli/{feedback-6C2YTRJL.js → feedback-NS76B5GU.js} +13 -9
- package/dist/cli/{feedback-WHCMGEIL.mjs → feedback-XW5IWA5R.mjs} +11 -7
- package/dist/cli/{git-GWLB6VSA.mjs → git-CLI66XP6.mjs} +6 -6
- package/dist/cli/git-VGYRGFEN.js +24 -0
- package/dist/cli/index.js +236 -348
- package/dist/cli/index.mjs +162 -274
- package/dist/cli/{legacy-noops-ZUFA7RWI.js → legacy-noops-HCFB3ZOV.js} +9 -9
- package/dist/cli/{legacy-noops-KF4XIFEF.mjs → legacy-noops-ODDOMLBL.mjs} +6 -6
- package/dist/cli/{monitors-TB3K2IVE.js → monitors-7WXQ7JFT.js} +94 -94
- package/dist/cli/{monitors-6UOIDIMB.mjs → monitors-ZXX456TE.mjs} +8 -8
- package/dist/cli/{org-CKWMBPIR.js → org-YLX5PHBQ.js} +68 -68
- package/dist/cli/{org-WGHHMVDZ.mjs → org-YUN3TLNP.mjs} +8 -8
- package/dist/cli/{play-LYPAXCLD.mjs → play-LL73A7EP.mjs} +533 -98
- package/dist/cli/{play-N2B3KAVS.js → play-YGOXL52D.js} +1067 -632
- package/dist/cli/{providers-6DI5BVZJ.mjs → providers-35QSAUHL.mjs} +8 -8
- package/dist/cli/{providers-UR42MD6Z.js → providers-RHCIU2PX.js} +11 -11
- package/dist/cli/{quickstart-MNA2S6PO.mjs → quickstart-6BN3LCZH.mjs} +5 -5
- package/dist/cli/{quickstart-FCJG4XGB.js → quickstart-ORMM4NRK.js} +7 -7
- package/dist/cli/search-EWDMUPHR.js +30 -0
- package/dist/cli/{search-VPPYUJ2M.mjs → search-GAERWLSE.mjs} +9 -9
- package/dist/cli/{secrets-QOSMVO36.js → secrets-3AFCTGT7.js} +17 -17
- package/dist/cli/{secrets-DRI4W7Z5.mjs → secrets-FCL5PALY.mjs} +8 -8
- package/dist/cli/sessions-3OEHEQG7.js +16 -0
- package/dist/cli/{sessions-DQNUKP43.mjs → sessions-RSSL7I7O.mjs} +6 -6
- package/dist/cli/{settings-DWDK3Y2R.mjs → settings-GE4NRE7Y.mjs} +12 -12
- package/dist/cli/{settings-JUGGCOPS.js → settings-RX5K4I7H.js} +79 -79
- package/dist/cli/{setup-AWBHNYXK.js → setup-N3ZNAEL5.js} +45 -44
- package/dist/cli/{setup-D5DWVNY4.mjs → setup-X3RXGG4F.mjs} +11 -10
- package/dist/cli/{skills-YV2XR35J.mjs → skills-5JEAJBDE.mjs} +7 -7
- package/dist/cli/skills-VAAQVEQC.js +29 -0
- package/dist/cli/tools-BYYOT2DU.js +44 -0
- package/dist/cli/{tools-VFJYHNV2.mjs → tools-JOKUWEBZ.mjs} +19 -14
- package/dist/cli/update-36G4ZD7B.js +31 -0
- package/dist/cli/{update-IM6VOTGL.mjs → update-UBHEVFR3.mjs} +11 -9
- package/dist/cli/{workflow-26URBWPV.mjs → workflow-FR6EXAXF.mjs} +44 -20
- package/dist/cli/{workflow-3BS6U6SL.js → workflow-SZAVOHN6.js} +54 -30
- package/dist/{client-BfInrZPB.d.mts → client-74k4IPh6.d.mts} +135 -54
- package/dist/{client-BMjJFpan.d.ts → client-C1IK1f8c.d.ts} +135 -54
- package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
- package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
- package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
- package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
- package/dist/index.d.mts +47 -9
- package/dist/index.d.ts +47 -9
- package/dist/index.js +17 -14
- package/dist/index.mjs +13 -10
- package/dist/install-integrity.json +118 -102
- 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 +5 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +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 +11 -3
- package/dist/plays/run-request.mjs +10 -2
- package/dist/release.d.mts +15 -6
- package/dist/release.d.ts +15 -6
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli/auth-F6BX32XZ.js +0 -40
- package/dist/cli/chunk-264PC2RN.mjs +0 -83
- package/dist/cli/chunk-44ZTYHMQ.mjs +0 -155
- package/dist/cli/chunk-53HN7WZN.js +0 -392
- package/dist/cli/chunk-7AALNGTA.mjs +0 -392
- package/dist/cli/chunk-ALD4COBH.js +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-WNUR6VP5.js +0 -83
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-VQFF6D7C.js +0 -24
- package/dist/cli/search-NCEEONMQ.js +0 -30
- package/dist/cli/sessions-3WYKQABW.js +0 -16
- package/dist/cli/skills-AKPAJVSO.js +0 -29
- package/dist/cli/tools-RBKEK6PM.js +0 -39
- package/dist/cli/update-VFNUBLDA.js +0 -29
|
@@ -9,13 +9,13 @@ var _chunkBQR6UN3Cjs = require('./chunk-BQR6UN3C.js');
|
|
|
9
9
|
var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkJ33TSWO5js = require('./chunk-J33TSWO5.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
var _chunkNA4T3B62js = require('./chunk-NA4T3B62.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkNA4T3B62js = require('./chunk-NA4T3B62.js');
|
|
19
19
|
|
|
20
20
|
// ../plays/field-catalog.ts
|
|
21
21
|
var value = (description) => ({ type: "string", description });
|
|
@@ -240,8 +240,8 @@ function toolContractJsonForDescribe(tool, requestedToolId, authoringContractEdi
|
|
|
240
240
|
arrayField(toolExecutionResult, "extractedLists", "extracted_lists")
|
|
241
241
|
).map((entry) => ({
|
|
242
242
|
...entry,
|
|
243
|
-
returnType:
|
|
244
|
-
rowsExpression:
|
|
243
|
+
returnType: _chunkJ33TSWO5js.playToolListGetterMode.call(void 0, authoringContractEdition) === "array" ? "Array" : "PlayDataset",
|
|
244
|
+
rowsExpression: _chunkJ33TSWO5js.playToolListGetterMode.call(void 0, authoringContractEdition) === "array" ? entry.expression : `await ${entry.expression}.materialize()`
|
|
245
245
|
}));
|
|
246
246
|
const extractedValues = extractionContractEntries(
|
|
247
247
|
arrayField(toolExecutionResult, "extractedValues", "extracted_values")
|
|
@@ -618,7 +618,7 @@ function usageGuidanceWithAccessDefaults(usageGuidance) {
|
|
|
618
618
|
extractedLists: {
|
|
619
619
|
...recordField(existingAccess, "extractedLists"),
|
|
620
620
|
expression: "toolExecutionResult.extractedLists.<name>.get()",
|
|
621
|
-
meaning:
|
|
621
|
+
meaning: _chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array" ? "Returns an ordinary array from this response. Use array methods directly or pass it to ctx.dataset to persist row work. Lazy or incomplete lists throw; use readList for an explicit dataset read. It does not fetch provider pages." : "Returns a PlayDataset, not a JavaScript array. Pass the handle to ctx.dataset, use first(), async iteration, or await handle.materialize() for the complete current list within the memory cap. materialize(n) and peek(n) return a prefix; none fetch additional provider pages. A missing getter is not an empty list."
|
|
622
622
|
},
|
|
623
623
|
rawToolResponse: {
|
|
624
624
|
expression: "toolExecutionResult.toolResponse.rawV2",
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writeRawStderr
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XJD6LZCO.mjs";
|
|
4
|
+
|
|
5
|
+
// src/cli/maintenance-policy.ts
|
|
6
|
+
import { InvalidArgumentError } from "commander";
|
|
7
|
+
function parseCliMaintenancePolicy(value) {
|
|
8
|
+
if (value === "configured" || value === "off") return value;
|
|
9
|
+
throw new InvalidArgumentError(
|
|
10
|
+
"Maintenance policy must be configured or off."
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function resolveCliMaintenancePolicy(input) {
|
|
14
|
+
return input.dryRun ? "off" : input.maintenance ?? "configured";
|
|
15
|
+
}
|
|
4
16
|
|
|
5
17
|
// src/cli/trace.ts
|
|
6
18
|
var cliTraceStartedAt = Date.now();
|
|
@@ -51,6 +63,9 @@ async function traceCliSpan(phase, fields, run) {
|
|
|
51
63
|
}
|
|
52
64
|
|
|
53
65
|
export {
|
|
66
|
+
parseCliMaintenancePolicy,
|
|
67
|
+
resolveCliMaintenancePolicy,
|
|
68
|
+
isCliTraceEnabled,
|
|
54
69
|
recordCliTrace,
|
|
55
70
|
traceCliSpan
|
|
56
71
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// ../plays/artifact-types.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// ../plays/artifact-types.ts
|
|
2
2
|
var PLAY_ARTIFACT_KINDS = {
|
|
3
3
|
cjsNode20: "cjs_node20"
|
|
4
4
|
};
|
|
@@ -28,9 +28,26 @@ var PLAY_BACKEND_DESCRIPTORS = {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
// ../plays/tool-response-contract.ts
|
|
31
|
+
var V2_TOOL_RESPONSE_CONTRACT = "v2-tool-response";
|
|
31
32
|
var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
|
|
32
33
|
var RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION = "raw-v2-receipt-v1";
|
|
33
34
|
var TOOL_RESPONSE_RECEIPT_REVISION_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,63})$/;
|
|
35
|
+
function isToolResponseContract(value) {
|
|
36
|
+
return value === V2_TOOL_RESPONSE_CONTRACT || value === RAW_V2_TOOL_RESPONSE_CONTRACT;
|
|
37
|
+
}
|
|
38
|
+
function declaredToolResponseContract(value) {
|
|
39
|
+
if (value == null) return void 0;
|
|
40
|
+
if (isToolResponseContract(value)) return value;
|
|
41
|
+
throw new UnsupportedToolResponseContractError(value);
|
|
42
|
+
}
|
|
43
|
+
var UnsupportedToolResponseContractError = class extends Error {
|
|
44
|
+
constructor(value) {
|
|
45
|
+
super(
|
|
46
|
+
`Unsupported tool response contract ${String(value)}. Supported contracts: ${V2_TOOL_RESPONSE_CONTRACT}, ${RAW_V2_TOOL_RESPONSE_CONTRACT}.`
|
|
47
|
+
);
|
|
48
|
+
this.name = "UnsupportedToolResponseContractError";
|
|
49
|
+
}
|
|
50
|
+
};
|
|
34
51
|
var InvalidToolResponseReceiptRevisionError = class extends Error {
|
|
35
52
|
constructor(value) {
|
|
36
53
|
super(
|
|
@@ -46,6 +63,9 @@ function normalizeToolResponseReceiptRevision(value) {
|
|
|
46
63
|
}
|
|
47
64
|
throw new InvalidToolResponseReceiptRevisionError(value);
|
|
48
65
|
}
|
|
66
|
+
function normalizeToolResponseContract(value) {
|
|
67
|
+
return _nullishCoalesce(declaredToolResponseContract(value), () => ( V2_TOOL_RESPONSE_CONTRACT));
|
|
68
|
+
}
|
|
49
69
|
function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
|
|
50
70
|
const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
|
|
51
71
|
const deeplineBilling = _optionalChain([responseMeta, 'optionalAccess', _ => _.deepline_billing]);
|
|
@@ -73,4 +93,7 @@ function providerMetaFromToolResponseRawV2(rawV2, view) {
|
|
|
73
93
|
|
|
74
94
|
|
|
75
95
|
|
|
76
|
-
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
exports.RAW_V2_TOOL_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT; exports.RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION = RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION; exports.UnsupportedToolResponseContractError = UnsupportedToolResponseContractError; exports.InvalidToolResponseReceiptRevisionError = InvalidToolResponseReceiptRevisionError; exports.normalizeToolResponseReceiptRevision = normalizeToolResponseReceiptRevision; exports.normalizeToolResponseContract = normalizeToolResponseContract; exports.legacyRawFromToolResponseRawV2 = legacyRawFromToolResponseRawV2; exports.providerMetaFromToolResponseRawV2 = providerMetaFromToolResponseRawV2; exports.PLAY_ARTIFACT_KINDS = PLAY_ARTIFACT_KINDS; exports.PLAY_RUNTIME_BACKENDS = PLAY_RUNTIME_BACKENDS;
|
|
@@ -8,6 +8,10 @@ var PROVIDER_TRANSIENT_ERROR_BRAND = Symbol.for(
|
|
|
8
8
|
);
|
|
9
9
|
var LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION = 0;
|
|
10
10
|
var TOOL_EXECUTION_ERROR_SCHEMA_VERSION = 1;
|
|
11
|
+
var SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS = [
|
|
12
|
+
LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
13
|
+
TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
14
|
+
];
|
|
11
15
|
var TOOL_EXECUTION_ERROR_SCHEMA_HEADER = "x-deepline-tool-error-schema";
|
|
12
16
|
var MAX_IDENTIFIER_LENGTH = 200;
|
|
13
17
|
var MAX_CODE_LENGTH = 160;
|
|
@@ -329,6 +333,7 @@ function deserializeToolExecutionFailure(message, value, acceptedSchemaVersion)
|
|
|
329
333
|
|
|
330
334
|
export {
|
|
331
335
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
336
|
+
SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS,
|
|
332
337
|
TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
|
|
333
338
|
DeeplineError,
|
|
334
339
|
ToolExecutionError,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ConfigError,
|
|
4
4
|
RateLimitError,
|
|
5
5
|
ToolRateLimitError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MAMVGOSC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
apiErrorCodeFromResponse,
|
|
9
9
|
apiErrorMessage
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
ToolExecutionError,
|
|
15
15
|
deserializeToolExecutionFailure,
|
|
16
16
|
serializeToolExecutionFailure
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-E4IXDAZI.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SDK_RELEASE
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OGSXENOF.mjs";
|
|
21
21
|
|
|
22
22
|
// src/config.ts
|
|
23
23
|
import {
|
|
@@ -682,8 +682,13 @@ var AGENT_SESSION_ID_VARIABLES = [
|
|
|
682
682
|
"CODEX_SESSION_ID",
|
|
683
683
|
"CODEX_THREAD_ID"
|
|
684
684
|
];
|
|
685
|
-
function agentSessionIdFromEnvironment(env = process.env) {
|
|
686
|
-
|
|
685
|
+
function agentSessionIdFromEnvironment(env = process.env, agentRuntime) {
|
|
686
|
+
const detectedRuntime = normalizeAgentRuntime(
|
|
687
|
+
agentRuntime ?? env.DEEPLINE_AGENT_RUNTIME
|
|
688
|
+
);
|
|
689
|
+
const runtime = (detectedRuntime === "unknown" ? null : detectedRuntime) ?? (env.CODEX_SESSION_ID?.trim() || env.CODEX_THREAD_ID?.trim() ? "codex" : null);
|
|
690
|
+
const variables = runtime === "codex" ? ["CODEX_SESSION_ID", "CODEX_THREAD_ID"] : runtime === "claude_code" || runtime === "claude_cowork" ? ["CLAUDE_CODE_SESSION_ID"] : runtime === null ? AGENT_SESSION_ID_VARIABLES : [];
|
|
691
|
+
for (const variable of variables) {
|
|
687
692
|
const sessionId = env[variable]?.trim();
|
|
688
693
|
if (sessionId) return sessionId;
|
|
689
694
|
}
|
|
@@ -878,285 +883,24 @@ var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
|
|
|
878
883
|
var PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER = "x-deepline-preferred-receipt-gateway-machine-id";
|
|
879
884
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
880
885
|
|
|
881
|
-
// ../play-runtime/runtime-incident-drills.ts
|
|
882
|
-
var RUNTIME_TEST_FAULT_IDS = [
|
|
883
|
-
"receipt_complete_write_fail",
|
|
884
|
-
"receipt_fail_write_fail",
|
|
885
|
-
"worker_receipt_complete_write_fail",
|
|
886
|
-
"invocation_response_delivery_abort",
|
|
887
|
-
"execution_upstream_response_loss",
|
|
888
|
-
"receipt_gateway_hold_ms",
|
|
889
|
-
"receipt_claim_query_hold_once_ms",
|
|
890
|
-
"receipt_claim_response_timeout",
|
|
891
|
-
"modal_sandbox_create_resource_exhausted",
|
|
892
|
-
"runtime_sheet_page_tail_hold_ms"
|
|
893
|
-
];
|
|
894
|
-
var LOCAL_TOPOLOGY = ["local_daytona"];
|
|
895
|
-
var LOCAL_AND_PREVIEW_TOPOLOGIES = [
|
|
896
|
-
"local_daytona",
|
|
897
|
-
"preview_fly",
|
|
898
|
-
"preview_direct_modal"
|
|
899
|
-
];
|
|
900
|
-
var MODAL_PREVIEW_TOPOLOGY = ["preview_direct_modal"];
|
|
901
|
-
var RUNTIME_INCIDENT_DRILL_CATALOG = [
|
|
902
|
-
{
|
|
903
|
-
id: "local_worker_process_outage",
|
|
904
|
-
description: "Interrupt the scheduler worker in the selected non-production runtime topology.",
|
|
905
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
906
|
-
control: {
|
|
907
|
-
kind: "process",
|
|
908
|
-
component: "worker",
|
|
909
|
-
modes: ["pause", "crash"]
|
|
910
|
-
},
|
|
911
|
-
expected: {
|
|
912
|
-
outcome: "The same logical run stays durable through the worker outage and completes after the selected topology recovers.",
|
|
913
|
-
safetyFacts: ["same_logical_run", "no_false_success"]
|
|
914
|
-
},
|
|
915
|
-
verification: {
|
|
916
|
-
kind: "local_black_box",
|
|
917
|
-
target: "local-component-outage-recovery-e2e"
|
|
918
|
-
}
|
|
919
|
-
},
|
|
920
|
-
{
|
|
921
|
-
id: "local_gateway_process_outage",
|
|
922
|
-
description: "Interrupt the receipt gateway in the selected non-production runtime topology.",
|
|
923
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
924
|
-
control: {
|
|
925
|
-
kind: "process",
|
|
926
|
-
component: "gateway",
|
|
927
|
-
modes: ["pause", "crash"]
|
|
928
|
-
},
|
|
929
|
-
expected: {
|
|
930
|
-
outcome: "In-flight work recovers only at a safe receipt boundary and the same logical run completes after the gateway recovers.",
|
|
931
|
-
safetyFacts: [
|
|
932
|
-
"same_logical_run",
|
|
933
|
-
"no_false_success",
|
|
934
|
-
"bounded_provider_execution"
|
|
935
|
-
]
|
|
936
|
-
},
|
|
937
|
-
verification: {
|
|
938
|
-
kind: "local_black_box",
|
|
939
|
-
target: "local-component-outage-recovery-e2e"
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
id: "local_runtime_process_outage",
|
|
944
|
-
description: "Interrupt both runtime components in the selected non-production topology.",
|
|
945
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
946
|
-
control: { kind: "process", component: "all", modes: ["pause", "crash"] },
|
|
947
|
-
expected: {
|
|
948
|
-
outcome: "Durable work waits through the combined outage; it never becomes a false success or creates a second logical run.",
|
|
949
|
-
safetyFacts: ["same_logical_run", "no_false_success"]
|
|
950
|
-
},
|
|
951
|
-
verification: {
|
|
952
|
-
kind: "local_black_box",
|
|
953
|
-
target: "local-component-outage-recovery-e2e"
|
|
954
|
-
}
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
id: "receipt_complete_write_fail",
|
|
958
|
-
description: "Fail the next durable receipt-completion write.",
|
|
959
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
960
|
-
control: {
|
|
961
|
-
kind: "runtime_test_fault",
|
|
962
|
-
defaultValue: 1,
|
|
963
|
-
valueMeaning: "occurrence"
|
|
964
|
-
},
|
|
965
|
-
expected: {
|
|
966
|
-
outcome: "The failed run is loud, and a later bounded recovery may repeat the affected provider operation if its prior completion was not durable.",
|
|
967
|
-
safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
|
|
968
|
-
},
|
|
969
|
-
verification: {
|
|
970
|
-
kind: "local_black_box",
|
|
971
|
-
target: "receipt-persist-failure-run-fatal-e2e"
|
|
972
|
-
}
|
|
973
|
-
},
|
|
974
|
-
{
|
|
975
|
-
id: "receipt_fail_write_fail",
|
|
976
|
-
description: "Fail the next durable receipt-failure write.",
|
|
977
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
978
|
-
control: {
|
|
979
|
-
kind: "runtime_test_fault",
|
|
980
|
-
defaultValue: 1,
|
|
981
|
-
valueMeaning: "occurrence"
|
|
982
|
-
},
|
|
983
|
-
expected: {
|
|
984
|
-
outcome: "The failure is loud; recovery remains bounded and may repeat an operation whose prior outcome was not durably recorded.",
|
|
985
|
-
safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
|
|
986
|
-
},
|
|
987
|
-
verification: {
|
|
988
|
-
kind: "focused_regression",
|
|
989
|
-
target: "tests/lib/plays/runtime-test-fault-registry.test.ts"
|
|
990
|
-
}
|
|
991
|
-
},
|
|
992
|
-
{
|
|
993
|
-
id: "worker_receipt_complete_write_fail",
|
|
994
|
-
description: "Fail the worker-side receipt-completion write once.",
|
|
995
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
996
|
-
control: {
|
|
997
|
-
kind: "runtime_test_fault",
|
|
998
|
-
defaultValue: 1,
|
|
999
|
-
valueMeaning: "occurrence"
|
|
1000
|
-
},
|
|
1001
|
-
expected: {
|
|
1002
|
-
outcome: "The worker reports the persistence failure loudly; bounded recovery may repeat work whose completion was not durable.",
|
|
1003
|
-
safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
|
|
1004
|
-
},
|
|
1005
|
-
verification: {
|
|
1006
|
-
kind: "focused_regression",
|
|
1007
|
-
target: "tests/lib/plays/runtime-test-fault-registry.test.ts"
|
|
1008
|
-
}
|
|
1009
|
-
},
|
|
1010
|
-
{
|
|
1011
|
-
id: "invocation_response_delivery_abort",
|
|
1012
|
-
description: "Abort one receipt-gateway response after invocation delivery.",
|
|
1013
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
1014
|
-
control: {
|
|
1015
|
-
kind: "runtime_test_fault",
|
|
1016
|
-
defaultValue: 1,
|
|
1017
|
-
valueMeaning: "occurrence"
|
|
1018
|
-
},
|
|
1019
|
-
expected: {
|
|
1020
|
-
outcome: "The same logical run completes through terminal-cache replay; any provider retry is governed by its separate operation policy.",
|
|
1021
|
-
safetyFacts: ["same_logical_run", "bounded_provider_execution"]
|
|
1022
|
-
},
|
|
1023
|
-
verification: {
|
|
1024
|
-
kind: "local_black_box",
|
|
1025
|
-
target: "invocation-delivery-replay-e2e"
|
|
1026
|
-
}
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
id: "execution_upstream_response_loss",
|
|
1030
|
-
description: "Lose the first response of each keyed execution after the upstream app durably stores it.",
|
|
1031
|
-
topologies: ["preview_fly"],
|
|
1032
|
-
control: {
|
|
1033
|
-
kind: "runtime_test_fault",
|
|
1034
|
-
defaultValue: 1,
|
|
1035
|
-
valueMeaning: "occurrence"
|
|
1036
|
-
},
|
|
1037
|
-
expected: {
|
|
1038
|
-
outcome: "The same invocation recovers the stored response without repeating provider work or customer charges, and every row retains its usable result.",
|
|
1039
|
-
safetyFacts: [
|
|
1040
|
-
"same_logical_run",
|
|
1041
|
-
"bounded_provider_execution",
|
|
1042
|
-
"all_rows_settle_once",
|
|
1043
|
-
"no_false_success"
|
|
1044
|
-
]
|
|
1045
|
-
},
|
|
1046
|
-
verification: {
|
|
1047
|
-
kind: "preview_black_box",
|
|
1048
|
-
target: "101-agent-heavy-gateway-load-e2e"
|
|
1049
|
-
}
|
|
1050
|
-
},
|
|
1051
|
-
{
|
|
1052
|
-
id: "receipt_gateway_hold_ms",
|
|
1053
|
-
description: "Hold one checked-out receipt-gateway scheduler client.",
|
|
1054
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
1055
|
-
control: {
|
|
1056
|
-
kind: "runtime_test_fault",
|
|
1057
|
-
defaultValue: 500,
|
|
1058
|
-
valueMeaning: "milliseconds"
|
|
1059
|
-
},
|
|
1060
|
-
expected: {
|
|
1061
|
-
outcome: "The request is delayed inside the real gateway pool and either completes within its deadline or follows bounded transport recovery.",
|
|
1062
|
-
safetyFacts: ["bounded_provider_execution"]
|
|
1063
|
-
},
|
|
1064
|
-
verification: {
|
|
1065
|
-
kind: "local_black_box",
|
|
1066
|
-
target: "agent-heavy-gateway-load-e2e"
|
|
1067
|
-
}
|
|
1068
|
-
},
|
|
1069
|
-
{
|
|
1070
|
-
id: "receipt_claim_query_hold_once_ms",
|
|
1071
|
-
description: "Hold one physical receipt-claim query.",
|
|
1072
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
1073
|
-
control: {
|
|
1074
|
-
kind: "runtime_test_fault",
|
|
1075
|
-
defaultValue: 500,
|
|
1076
|
-
valueMeaning: "milliseconds"
|
|
1077
|
-
},
|
|
1078
|
-
expected: {
|
|
1079
|
-
outcome: "The checked-out claim either completes or times out through bounded recovery; an ambiguous outcome may be retried within its budget.",
|
|
1080
|
-
safetyFacts: ["bounded_provider_execution"]
|
|
1081
|
-
},
|
|
1082
|
-
verification: {
|
|
1083
|
-
kind: "local_black_box",
|
|
1084
|
-
target: "receipt-claim-deadline-recovery-e2e"
|
|
1085
|
-
}
|
|
1086
|
-
},
|
|
1087
|
-
{
|
|
1088
|
-
id: "receipt_claim_response_timeout",
|
|
1089
|
-
description: "Report one fully received receipt-claim response as timed out.",
|
|
1090
|
-
topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
|
|
1091
|
-
control: {
|
|
1092
|
-
kind: "runtime_test_fault",
|
|
1093
|
-
defaultValue: 1,
|
|
1094
|
-
valueMeaning: "occurrence"
|
|
1095
|
-
},
|
|
1096
|
-
expected: {
|
|
1097
|
-
outcome: "The same logical run completes by replaying the committed receipt response or uses bounded recovery if that response is unavailable.",
|
|
1098
|
-
safetyFacts: ["same_logical_run", "bounded_provider_execution"]
|
|
1099
|
-
},
|
|
1100
|
-
verification: {
|
|
1101
|
-
kind: "local_black_box",
|
|
1102
|
-
target: "receipt-ambiguous-response-recovery-e2e"
|
|
1103
|
-
}
|
|
1104
|
-
},
|
|
1105
|
-
{
|
|
1106
|
-
id: "modal_sandbox_create_resource_exhausted",
|
|
1107
|
-
description: "Make Modal sandbox creation return RESOURCE_EXHAUSTED before user code.",
|
|
1108
|
-
topologies: MODAL_PREVIEW_TOPOLOGY,
|
|
1109
|
-
control: {
|
|
1110
|
-
kind: "runtime_test_fault",
|
|
1111
|
-
defaultValue: 1,
|
|
1112
|
-
valueMeaning: "occurrence"
|
|
1113
|
-
},
|
|
1114
|
-
expected: {
|
|
1115
|
-
outcome: "The same logical run enters bounded pre-code defer/recovery and later retries sandbox startup; no user code or provider call precedes the retry.",
|
|
1116
|
-
safetyFacts: [
|
|
1117
|
-
"same_logical_run",
|
|
1118
|
-
"no_user_code_before_recovery",
|
|
1119
|
-
"bounded_provider_execution"
|
|
1120
|
-
]
|
|
1121
|
-
},
|
|
1122
|
-
verification: {
|
|
1123
|
-
kind: "preview_black_box",
|
|
1124
|
-
target: "modal-sandbox-recovery-e2e"
|
|
1125
|
-
}
|
|
1126
|
-
},
|
|
1127
|
-
{
|
|
1128
|
-
id: "runtime_sheet_page_tail_hold_ms",
|
|
1129
|
-
description: "Hold one runtime-sheet tail-page operation.",
|
|
1130
|
-
topologies: LOCAL_TOPOLOGY,
|
|
1131
|
-
control: {
|
|
1132
|
-
kind: "runtime_test_fault",
|
|
1133
|
-
defaultValue: 500,
|
|
1134
|
-
valueMeaning: "milliseconds"
|
|
1135
|
-
},
|
|
1136
|
-
expected: {
|
|
1137
|
-
outcome: "Page-tail work stays pending during the bounded hold, then completes without losing or duplicating rows.",
|
|
1138
|
-
safetyFacts: ["all_rows_settle_once"]
|
|
1139
|
-
},
|
|
1140
|
-
verification: {
|
|
1141
|
-
kind: "local_black_box",
|
|
1142
|
-
target: "page-tail-sheet-write-hold-e2e"
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
];
|
|
1146
|
-
function isRuntimeTestFaultDrill(drill) {
|
|
1147
|
-
return drill.control.kind === "runtime_test_fault" && RUNTIME_TEST_FAULT_IDS.some((faultId) => faultId === drill.id);
|
|
1148
|
-
}
|
|
1149
|
-
function runtimeTestFaultDrills() {
|
|
1150
|
-
return RUNTIME_INCIDENT_DRILL_CATALOG.filter(isRuntimeTestFaultDrill);
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
886
|
// ../play-runtime/test-runtime-seams.ts
|
|
1154
887
|
var PLAY_RUNTIME_TEST_FAULT_HEADER = "x-deepline-test-fault";
|
|
1155
|
-
var SUPPORTED_RUNTIME_TEST_FAULTS = new Set(
|
|
1156
|
-
runtimeTestFaultDrills().map(({ id }) => id)
|
|
1157
|
-
);
|
|
1158
888
|
var MAX_RUNTIME_TEST_POLICY_MS = 10 * 6e4;
|
|
1159
889
|
|
|
890
|
+
// ../integration-contracts/execute-retry-contract.ts
|
|
891
|
+
var EXECUTE_RETRY_POLICY_HEADER = "x-deepline-execute-retry-policy";
|
|
892
|
+
var EXECUTE_RETRY_POLICY_VERSION = 1;
|
|
893
|
+
function parseExecuteRetryPolicy(value) {
|
|
894
|
+
if (value === `v${EXECUTE_RETRY_POLICY_VERSION}:transient-http-safe`) {
|
|
895
|
+
return "transient-http-safe";
|
|
896
|
+
}
|
|
897
|
+
if (value === `v${EXECUTE_RETRY_POLICY_VERSION}:transient-http-unsafe`) {
|
|
898
|
+
return "transient-http-unsafe";
|
|
899
|
+
}
|
|
900
|
+
return null;
|
|
901
|
+
}
|
|
902
|
+
var ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER = "x-deepline-atomic-tool-supported";
|
|
903
|
+
|
|
1160
904
|
// src/http.ts
|
|
1161
905
|
var MAX_DIAGNOSTIC_HEADER_LENGTH = 120;
|
|
1162
906
|
var COWORK_NETWORK_HINT = "Claude Cowork appears to be running Deepline in a network-restricted sandbox. In Claude Desktop, open Settings > Capabilities, turn on Allow network egress, and set Domain allowlist to All domains for the Cowork session.";
|
|
@@ -1377,7 +1121,7 @@ var HttpClient = class {
|
|
|
1377
1121
|
const candidateUrls = options?.exactUrlOnly ? [url] : buildCandidateUrls(url);
|
|
1378
1122
|
let retryAfterDelayMs = null;
|
|
1379
1123
|
let totalRetryWaitMs = 0;
|
|
1380
|
-
|
|
1124
|
+
let maxRetries = options?.maxRetries ?? this.config.maxRetries;
|
|
1381
1125
|
requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1382
1126
|
if (options?.signal?.aborted) {
|
|
1383
1127
|
lastError = requestCancelledError(options.signal);
|
|
@@ -1445,6 +1189,12 @@ var HttpClient = class {
|
|
|
1445
1189
|
httpStatus: response.status,
|
|
1446
1190
|
body: parsed
|
|
1447
1191
|
});
|
|
1192
|
+
const responseRetryAllowed = options?.retryFromExecutePolicy !== true || parseExecuteRetryPolicy(
|
|
1193
|
+
response.headers.get(EXECUTE_RETRY_POLICY_HEADER)
|
|
1194
|
+
) === "transient-http-safe";
|
|
1195
|
+
if (options?.retryFromExecutePolicy === true && responseRetryAllowed && options.executePolicyMaxRetries !== void 0) {
|
|
1196
|
+
maxRetries = options.executePolicyMaxRetries;
|
|
1197
|
+
}
|
|
1448
1198
|
const structuredToolError = options?.toolId && !response.ok ? deserializeToolExecutionFailure(
|
|
1449
1199
|
apiErrorMessage(parsed, response.status),
|
|
1450
1200
|
isRecord(parsed) ? parsed.tool_error : null,
|
|
@@ -1458,7 +1208,7 @@ var HttpClient = class {
|
|
|
1458
1208
|
...failure,
|
|
1459
1209
|
retryAfterMs: failure.retryAfterMs ?? Math.max(0, retryAfter)
|
|
1460
1210
|
});
|
|
1461
|
-
if (attempt < maxRetries) {
|
|
1211
|
+
if (responseRetryAllowed && attempt < maxRetries) {
|
|
1462
1212
|
retryAfterDelayMs = retryAfter;
|
|
1463
1213
|
break;
|
|
1464
1214
|
}
|
|
@@ -1477,7 +1227,7 @@ var HttpClient = class {
|
|
|
1477
1227
|
}
|
|
1478
1228
|
const retryAfter = parseRetryAfter(response);
|
|
1479
1229
|
lastError = new RateLimitError(retryAfter);
|
|
1480
|
-
if (attempt < maxRetries) {
|
|
1230
|
+
if (responseRetryAllowed && attempt < maxRetries) {
|
|
1481
1231
|
retryAfterDelayMs = retryAfter;
|
|
1482
1232
|
break;
|
|
1483
1233
|
}
|
|
@@ -1487,7 +1237,7 @@ var HttpClient = class {
|
|
|
1487
1237
|
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1488
1238
|
}
|
|
1489
1239
|
if (!response.ok) {
|
|
1490
|
-
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
1240
|
+
const retryableApiError = options?.retryApiErrors === true && responseRetryAllowed && isRetryableApiErrorResponse(response.status);
|
|
1491
1241
|
const htmlError = detectHtmlErrorBody(
|
|
1492
1242
|
body,
|
|
1493
1243
|
response.headers.get("content-type")
|
|
@@ -1554,6 +1304,7 @@ var HttpClient = class {
|
|
|
1554
1304
|
timeoutMs,
|
|
1555
1305
|
timedOut: requestTimedOut
|
|
1556
1306
|
});
|
|
1307
|
+
if (options?.retryFromExecutePolicy) break requestAttempts;
|
|
1557
1308
|
} finally {
|
|
1558
1309
|
clearTimeout(timeoutId);
|
|
1559
1310
|
options?.signal?.removeEventListener("abort", abortRequest);
|
|
@@ -1935,6 +1686,7 @@ export {
|
|
|
1935
1686
|
getActiveProjectAuthSource,
|
|
1936
1687
|
resolveCliAuthProvenance,
|
|
1937
1688
|
resolveCliCommandContext,
|
|
1689
|
+
ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER,
|
|
1938
1690
|
SDK_VERSION,
|
|
1939
1691
|
SDK_API_MAJOR,
|
|
1940
1692
|
SDK_API_CONTRACT,
|