deepline 0.3.408 → 0.3.410
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 +212 -334
- 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/play-data-plane/r2.ts +3 -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-UVD3CUBB.mjs → auth-LLXLIILR.mjs} +6 -6
- package/dist/cli/auth-UG4WOYGL.js +40 -0
- package/dist/cli/{billing-BZVTXXLM.mjs → billing-5FVXZYAC.mjs} +8 -8
- package/dist/cli/{billing-BZVYAF6T.js → billing-NFPK7GYP.js} +84 -84
- 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-WTT6CLED.mjs → chunk-2YR7BIIC.mjs} +5 -2
- package/dist/cli/{chunk-3ZB6IIA7.js → chunk-36AHOWVS.js} +26 -26
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-LOYISF7S.mjs → chunk-4XQLVUC7.mjs} +738 -512
- package/dist/cli/{chunk-J5PTX66Y.js → chunk-5MLCBXXU.js} +8 -1
- package/dist/cli/chunk-5TUGWDEB.js +313 -0
- package/dist/cli/{chunk-D6FFBSM5.js → chunk-5UUQAGJS.js} +5 -2
- package/dist/cli/{chunk-4CFULMRB.mjs → chunk-5V5Y37BC.mjs} +2 -2
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/{chunk-AUMD2VXP.js → chunk-63S7X326.js} +1032 -806
- package/dist/cli/{chunk-4QFT5LGV.mjs → chunk-6PGATQ6L.mjs} +6 -3
- 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-4RNDKFNQ.js → chunk-D37FEBES.js} +2 -2
- 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-EQ4Z7RJW.mjs +35 -0
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-QUAQX3FQ.js → chunk-FVLNYDI4.js} +128 -376
- package/dist/cli/{chunk-BRJUESQV.js → chunk-FZJAM576.js} +50 -50
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/{chunk-IOHRWLQE.mjs → chunk-IPG42SD2.mjs} +452 -138
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/{chunk-XXLXOUUU.mjs → chunk-JNXJZ577.mjs} +1 -1
- 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-PYZZMAJQ.mjs → chunk-LFSHGNT2.mjs} +8 -1
- package/dist/cli/{chunk-2XXXFPTD.js → chunk-LTFL4JRN.js} +426 -721
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-URACNNLO.mjs → chunk-MN2OWLFA.mjs} +2 -2
- package/dist/cli/{chunk-Q3PUHXOY.js → chunk-NF4V5DTY.js} +12 -12
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NTVLGHFM.js +501 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-E3PJF6YP.js → chunk-OBB4QXHA.js} +19 -4
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-IWBXJDZA.mjs → chunk-PZSLPBDA.mjs} +2 -2
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-ECVLPS67.js → chunk-QJI5FIOW.js} +170 -49
- package/dist/cli/{chunk-I3DHIXVJ.mjs → chunk-QL22Y56M.mjs} +149 -28
- package/dist/cli/{chunk-SD7MXAJA.mjs → chunk-RFB25DSQ.mjs} +36 -284
- package/dist/cli/chunk-T44IIOT6.mjs +501 -0
- package/dist/cli/chunk-VK2LZ5IP.js +35 -0
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-RWCY6YI2.js → chunk-VYKV5XHL.js} +644 -330
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
- package/dist/cli/{chunk-MJELBQBU.mjs → chunk-XIHWSXSV.mjs} +330 -625
- package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-ZBABPK6Y.js → chunk-ZFZ427HN.js} +11 -8
- package/dist/cli/{chunk-SJVVBWRL.mjs → chunk-ZKYEW55U.mjs} +16 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-XLGLHJ6P.js → csv-7U3FJYKZ.js} +14 -14
- package/dist/cli/{csv-WPSXG6ZZ.mjs → csv-ZWLDMM4A.mjs} +5 -5
- package/dist/cli/{db-5PTNJG4X.js → db-DNCGV5PC.js} +42 -47
- package/dist/cli/{db-ABS57ABJ.mjs → db-IMYXVMGI.mjs} +15 -20
- package/dist/cli/{describe-PVWQJ2PB.mjs → describe-Q23DWJUK.mjs} +20 -15
- package/dist/cli/{describe-EZS6PQXA.js → describe-S34JUX5W.js} +27 -22
- 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-OKJGATQZ.mjs → executions-A73EUGSI.mjs} +8 -8
- package/dist/cli/{executions-FNTAFQ7Y.js → executions-XOMPX2YJ.js} +10 -10
- package/dist/cli/{feedback-W27HDMRR.mjs → feedback-N4GJ2POI.mjs} +11 -7
- package/dist/cli/{feedback-6YBOMSUA.js → feedback-QTCHNJJH.js} +13 -9
- package/dist/cli/{git-YOOUEL6M.mjs → git-4Q3JIQYZ.mjs} +6 -6
- package/dist/cli/git-I6CPBEVG.js +24 -0
- package/dist/cli/index.js +240 -352
- package/dist/cli/index.mjs +163 -275
- package/dist/cli/{legacy-noops-V6OKW7VR.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
- package/dist/cli/{legacy-noops-2VZ7XT6C.js → legacy-noops-4OSHZM34.js} +9 -9
- package/dist/cli/{monitors-FBWGVIUS.js → monitors-LVE2KZNG.js} +94 -94
- package/dist/cli/{monitors-P2YYWTWT.mjs → monitors-QP2XID2B.mjs} +8 -8
- package/dist/cli/{org-DVMG6H3C.mjs → org-IVRETVQA.mjs} +8 -8
- package/dist/cli/{org-3XUSVX5T.js → org-XFLK5IAP.js} +68 -68
- package/dist/cli/{play-GNC5CQAS.mjs → play-DE7VH6NU.mjs} +533 -98
- package/dist/cli/{play-YG5L4BWQ.js → play-XXTPPP23.js} +1067 -632
- package/dist/cli/{providers-7PSWG2OV.js → providers-DLD3I4JF.js} +11 -11
- package/dist/cli/{providers-JR33SLWL.mjs → providers-GX2NIZQQ.mjs} +8 -8
- package/dist/cli/{quickstart-VUOBQYIQ.mjs → quickstart-72B4L4PK.mjs} +5 -5
- package/dist/cli/{quickstart-FDVZ5BL3.js → quickstart-XNS3HSWC.js} +7 -7
- package/dist/cli/search-6NCH4HB5.js +30 -0
- package/dist/cli/{search-JZYLO33K.mjs → search-SUTRANJI.mjs} +9 -9
- package/dist/cli/{secrets-VS266FVA.js → secrets-6OBLOVEV.js} +17 -17
- package/dist/cli/{secrets-3MCYBT4I.mjs → secrets-FPFXXNUH.mjs} +8 -8
- package/dist/cli/sessions-235532DR.js +16 -0
- package/dist/cli/{sessions-ELLLT23E.mjs → sessions-R25I4QKN.mjs} +6 -6
- package/dist/cli/{settings-PZCKAFII.mjs → settings-AOP6F5PZ.mjs} +12 -12
- package/dist/cli/{settings-7364NMMA.js → settings-VL5FOFPN.js} +79 -79
- package/dist/cli/{setup-PMWYLCT6.js → setup-BSC67YT3.js} +45 -44
- package/dist/cli/{setup-A7GQ4KIA.mjs → setup-ZMPHBHVJ.mjs} +11 -10
- package/dist/cli/skills-3IWLYYRL.js +29 -0
- package/dist/cli/{skills-WS6BIFPQ.mjs → skills-KF65TVFO.mjs} +7 -7
- package/dist/cli/tools-LR66SPYU.js +44 -0
- package/dist/cli/{tools-BR4DOZA2.mjs → tools-SX4XIPM7.mjs} +19 -14
- package/dist/cli/{update-D2B7UNFT.mjs → update-QRMFRAQQ.mjs} +11 -9
- package/dist/cli/update-SP7UEO53.js +31 -0
- package/dist/cli/{workflow-PQXC2R47.mjs → workflow-FOEEEB7G.mjs} +44 -20
- package/dist/cli/{workflow-6ODTCYXU.js → workflow-KOCK2FLW.js} +54 -30
- package/dist/{client-Z9Pye1Wm.d.mts → client-74k4IPh6.d.mts} +137 -54
- package/dist/{client-BcvhDfJJ.d.ts → client-C1IK1f8c.d.ts} +137 -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 +120 -104
- 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-3GB2K636.js +0 -40
- package/dist/cli/chunk-67RWR34T.mjs +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-HQY2SG3K.js +0 -83
- package/dist/cli/chunk-OSFWFV72.js +0 -155
- package/dist/cli/chunk-Q3LFI3VH.js +0 -392
- package/dist/cli/chunk-WPAB4DCU.mjs +0 -83
- package/dist/cli/chunk-YMOFWHGO.mjs +0 -392
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-YKUXXJOR.js +0 -24
- package/dist/cli/search-PPPYC5OZ.js +0 -30
- package/dist/cli/sessions-TEHEWW7O.js +0 -16
- package/dist/cli/skills-SYS7VRRK.js +0 -29
- package/dist/cli/tools-KK4BKVQR.js +0 -39
- package/dist/cli/update-2IV5JTX2.js +0 -29
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNPBJI7REjs = require('./chunk-NPBJI7RE.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -14,10 +14,10 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkPPDBRJRWjs = require('./chunk-PPDBRJRW.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk5UUQAGJSjs = require('./chunk-5UUQAGJS.js');
|
|
21
21
|
|
|
22
22
|
// src/config.ts
|
|
23
23
|
|
|
@@ -378,7 +378,7 @@ function resolveBaseUrlOnly(options) {
|
|
|
378
378
|
_optionalChain([options, 'optionalAccess', _32 => _32.baseUrl, 'optionalAccess', _33 => _33.trim, 'call', _34 => _34()]) || autoDetectBaseUrl()
|
|
379
379
|
);
|
|
380
380
|
if (!baseUrl) {
|
|
381
|
-
throw new (0,
|
|
381
|
+
throw new (0, _chunkNPBJI7REjs.ConfigError)(
|
|
382
382
|
`Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`
|
|
383
383
|
);
|
|
384
384
|
}
|
|
@@ -389,13 +389,13 @@ function resolveConfig(options) {
|
|
|
389
389
|
_optionalChain([options, 'optionalAccess', _35 => _35.baseUrl, 'optionalAccess', _36 => _36.trim, 'call', _37 => _37()]) || autoDetectBaseUrl()
|
|
390
390
|
);
|
|
391
391
|
if (!baseUrl) {
|
|
392
|
-
throw new (0,
|
|
392
|
+
throw new (0, _chunkNPBJI7REjs.ConfigError)(
|
|
393
393
|
`Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
396
|
const apiKey = resolveApiKeyForBaseUrl(baseUrl, _optionalChain([options, 'optionalAccess', _38 => _38.apiKey]));
|
|
397
397
|
if (!apiKey) {
|
|
398
|
-
throw new (0,
|
|
398
|
+
throw new (0, _chunkNPBJI7REjs.ConfigError)(
|
|
399
399
|
`No API key found. Set ${API_KEY_ENV}, add it to .env.deepline, or run: deepline auth register`
|
|
400
400
|
);
|
|
401
401
|
}
|
|
@@ -498,7 +498,7 @@ function findNearestGitCommonDir(startDir) {
|
|
|
498
498
|
function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
|
|
499
499
|
const target = resolveProjectPinTarget(startDir);
|
|
500
500
|
if (!target.ok) {
|
|
501
|
-
throw new (0,
|
|
501
|
+
throw new (0, _chunkNPBJI7REjs.ConfigError)(
|
|
502
502
|
`Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
|
|
503
503
|
", "
|
|
504
504
|
)}. Set CLAUDE_PROJECT_DIR or cd into the intended project folder before running this command.`
|
|
@@ -649,9 +649,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
// src/version.ts
|
|
652
|
-
var SDK_VERSION =
|
|
653
|
-
var SDK_API_MAJOR =
|
|
654
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
652
|
+
var SDK_VERSION = _chunk5UUQAGJSjs.SDK_RELEASE.version;
|
|
653
|
+
var SDK_API_MAJOR = _chunk5UUQAGJSjs.SDK_RELEASE.contracts.api.currentMajor;
|
|
654
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunk5UUQAGJSjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
655
655
|
|
|
656
656
|
// src/agent-runtime.ts
|
|
657
657
|
|
|
@@ -682,9 +682,14 @@ var AGENT_SESSION_ID_VARIABLES = [
|
|
|
682
682
|
"CODEX_SESSION_ID",
|
|
683
683
|
"CODEX_THREAD_ID"
|
|
684
684
|
];
|
|
685
|
-
function agentSessionIdFromEnvironment(env = process.env) {
|
|
686
|
-
|
|
687
|
-
|
|
685
|
+
function agentSessionIdFromEnvironment(env = process.env, agentRuntime) {
|
|
686
|
+
const detectedRuntime = normalizeAgentRuntime(
|
|
687
|
+
_nullishCoalesce(agentRuntime, () => ( env.DEEPLINE_AGENT_RUNTIME))
|
|
688
|
+
);
|
|
689
|
+
const runtime = _nullishCoalesce((detectedRuntime === "unknown" ? null : detectedRuntime), () => ( (_optionalChain([env, 'access', _67 => _67.CODEX_SESSION_ID, 'optionalAccess', _68 => _68.trim, 'call', _69 => _69()]) || _optionalChain([env, 'access', _70 => _70.CODEX_THREAD_ID, 'optionalAccess', _71 => _71.trim, 'call', _72 => _72()]) ? "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) {
|
|
692
|
+
const sessionId = _optionalChain([env, 'access', _73 => _73[variable], 'optionalAccess', _74 => _74.trim, 'call', _75 => _75()]);
|
|
688
693
|
if (sessionId) return sessionId;
|
|
689
694
|
}
|
|
690
695
|
return null;
|
|
@@ -692,9 +697,9 @@ function agentSessionIdFromEnvironment(env = process.env) {
|
|
|
692
697
|
function isCoworkLikeSandbox2() {
|
|
693
698
|
const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
694
699
|
const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
|
|
695
|
-
const projectDir = Boolean(_optionalChain([process, 'access',
|
|
696
|
-
const pluginRoot = Boolean(_optionalChain([process, 'access',
|
|
697
|
-
const home = _optionalChain([process, 'access',
|
|
700
|
+
const projectDir = Boolean(_optionalChain([process, 'access', _76 => _76.env, 'access', _77 => _77.CLAUDE_PROJECT_DIR, 'optionalAccess', _78 => _78.trim, 'call', _79 => _79()]));
|
|
701
|
+
const pluginRoot = Boolean(_optionalChain([process, 'access', _80 => _80.env, 'access', _81 => _81.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]));
|
|
702
|
+
const home = _optionalChain([process, 'access', _84 => _84.env, 'access', _85 => _85.HOME, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87()]) || _os.homedir.call(void 0, );
|
|
698
703
|
const sessionHome = home === "/sessions" || home.startsWith("/sessions/");
|
|
699
704
|
return claudeRemote || sessionHome || (pluginMode || pluginRoot) && projectDir;
|
|
700
705
|
}
|
|
@@ -702,22 +707,22 @@ function detectAgentRuntime(options = {}) {
|
|
|
702
707
|
const env = _nullishCoalesce(options.env, () => ( process.env));
|
|
703
708
|
const explicit = normalizeAgentRuntime(env.DEEPLINE_AGENT_RUNTIME);
|
|
704
709
|
if (explicit) return explicit;
|
|
705
|
-
if (_optionalChain([env, 'access',
|
|
710
|
+
if (_optionalChain([env, 'access', _88 => _88.CODEX_THREAD_ID, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()])) return "codex";
|
|
706
711
|
if (options.detectCowork !== false && isCoworkLikeSandbox2()) {
|
|
707
712
|
return "claude_cowork";
|
|
708
713
|
}
|
|
709
|
-
if (_optionalChain([env, 'access',
|
|
710
|
-
if (_optionalChain([env, 'access',
|
|
711
|
-
if (_optionalChain([env, 'access',
|
|
714
|
+
if (_optionalChain([env, 'access', _91 => _91.CLAUDECODE, 'optionalAccess', _92 => _92.trim, 'call', _93 => _93()]) === "1") return "claude_code";
|
|
715
|
+
if (_optionalChain([env, 'access', _94 => _94.CLINE_ACTIVE, 'optionalAccess', _95 => _95.trim, 'call', _96 => _96(), 'access', _97 => _97.toLowerCase, 'call', _98 => _98()]) === "true") return "cline";
|
|
716
|
+
if (_optionalChain([env, 'access', _99 => _99.CURSOR_TRACE_ID, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]) || _optionalChain([env, 'access', _102 => _102.CURSOR_AGENT, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()])) {
|
|
712
717
|
return "cursor";
|
|
713
718
|
}
|
|
714
|
-
if (_optionalChain([env, 'access',
|
|
719
|
+
if (_optionalChain([env, 'access', _105 => _105.WINDSURF, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()]) || _optionalChain([env, 'access', _108 => _108.CASCADE, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()])) {
|
|
715
720
|
return "windsurf";
|
|
716
721
|
}
|
|
717
|
-
if (_optionalChain([env, 'access',
|
|
722
|
+
if (_optionalChain([env, 'access', _111 => _111.ANTIGRAVITY, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]) || _optionalChain([env, 'access', _114 => _114.ANTIGRAVITY_CLI, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()]) || _optionalChain([env, 'access', _117 => _117.ANTIGRAVITY_AGENT, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]) || _optionalChain([env, 'access', _120 => _120.ANTIGRAVITY_WORKSPACE, 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()])) {
|
|
718
723
|
return "antigravity";
|
|
719
724
|
}
|
|
720
|
-
if (_optionalChain([env, 'access',
|
|
725
|
+
if (_optionalChain([env, 'access', _123 => _123.GEMINI_CLI, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]) || _optionalChain([env, 'access', _126 => _126.GEMINI_CLI_VERSION, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()]) || _optionalChain([env, 'access', _129 => _129.GEMINI_SANDBOX, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()]) || _optionalChain([env, 'access', _132 => _132.GEMINI_CONFIG_DIR, 'optionalAccess', _133 => _133.trim, 'call', _134 => _134()])) {
|
|
721
726
|
return "gemini";
|
|
722
727
|
}
|
|
723
728
|
return _nullishCoalesce(options.defaultRuntime, () => ( "unknown"));
|
|
@@ -727,11 +732,11 @@ function detectAgentRuntime(options = {}) {
|
|
|
727
732
|
|
|
728
733
|
|
|
729
734
|
function activePluginSkillsDir() {
|
|
730
|
-
const pluginMode = _optionalChain([process, 'access',
|
|
735
|
+
const pluginMode = _optionalChain([process, 'access', _135 => _135.env, 'access', _136 => _136.DEEPLINE_PLUGIN_MODE, 'optionalAccess', _137 => _137.trim, 'call', _138 => _138(), 'access', _139 => _139.toLowerCase, 'call', _140 => _140()]);
|
|
731
736
|
if (pluginMode !== "true" && pluginMode !== "1" && pluginMode !== "yes" && pluginMode !== "on") {
|
|
732
737
|
return "";
|
|
733
738
|
}
|
|
734
|
-
const dir = _nullishCoalesce(_optionalChain([process, 'access',
|
|
739
|
+
const dir = _nullishCoalesce(_optionalChain([process, 'access', _141 => _141.env, 'access', _142 => _142.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _143 => _143.trim, 'call', _144 => _144()]), () => ( ""));
|
|
735
740
|
return dir && _fs.existsSync.call(void 0, dir) ? dir : "";
|
|
736
741
|
}
|
|
737
742
|
function hasActivePluginSkills() {
|
|
@@ -860,7 +865,7 @@ var fetchWithDeploymentProtection = (input, init) => {
|
|
|
860
865
|
const headers = new Headers(
|
|
861
866
|
input instanceof Request ? input.headers : void 0
|
|
862
867
|
);
|
|
863
|
-
new Headers(_optionalChain([init, 'optionalAccess',
|
|
868
|
+
new Headers(_optionalChain([init, 'optionalAccess', _145 => _145.headers])).forEach((value, name) => headers.set(name, value));
|
|
864
869
|
for (const [name, value] of Object.entries(deploymentProtectionHeaders())) {
|
|
865
870
|
headers.set(name, value);
|
|
866
871
|
}
|
|
@@ -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.";
|
|
@@ -1207,7 +951,7 @@ function withErrorCause(error, cause) {
|
|
|
1207
951
|
}
|
|
1208
952
|
function mapNetworkError(baseUrl, error, targetLabel) {
|
|
1209
953
|
const tagged = error;
|
|
1210
|
-
const timeoutMs = _optionalChain([tagged, 'optionalAccess',
|
|
954
|
+
const timeoutMs = _optionalChain([tagged, 'optionalAccess', _146 => _146[REQUEST_TIMEOUT_MARKER]]);
|
|
1211
955
|
if (typeof timeoutMs === "number") {
|
|
1212
956
|
return {
|
|
1213
957
|
message: `Request to ${targetLabel} timed out after ${timeoutMs}ms while waiting for a response.`,
|
|
@@ -1215,14 +959,14 @@ function mapNetworkError(baseUrl, error, targetLabel) {
|
|
|
1215
959
|
details: { timeoutMs, target: targetLabel }
|
|
1216
960
|
};
|
|
1217
961
|
}
|
|
1218
|
-
if (_optionalChain([tagged, 'optionalAccess',
|
|
962
|
+
if (_optionalChain([tagged, 'optionalAccess', _147 => _147[REQUEST_ABORT_MARKER]])) {
|
|
1219
963
|
return {
|
|
1220
964
|
message: `Request to ${targetLabel} was aborted before it completed.`,
|
|
1221
965
|
code: "NETWORK_ABORTED"
|
|
1222
966
|
};
|
|
1223
967
|
}
|
|
1224
968
|
return {
|
|
1225
|
-
message: _optionalChain([error, 'optionalAccess',
|
|
969
|
+
message: _optionalChain([error, 'optionalAccess', _148 => _148.message]) ? `Unable to connect to ${baseUrl}. ${error.message}` : `Unable to connect to ${baseUrl}. Is the computer able to access the url?`,
|
|
1226
970
|
code: "NETWORK_ERROR"
|
|
1227
971
|
};
|
|
1228
972
|
}
|
|
@@ -1308,15 +1052,15 @@ var HttpClient = class {
|
|
|
1308
1052
|
const coordinatorInternalToken = env.DEEPLINE_INTERNAL_TOKEN;
|
|
1309
1053
|
const absurdReleaseOverride = env.DEEPLINE_ABSURD_RELEASE;
|
|
1310
1054
|
const preferredReceiptGatewayMachineId = env.DEEPLINE_PREFERRED_RECEIPT_GATEWAY_MACHINE_ID;
|
|
1311
|
-
if (_optionalChain([coordinatorUrl, 'optionalAccess',
|
|
1055
|
+
if (_optionalChain([coordinatorUrl, 'optionalAccess', _149 => _149.trim, 'call', _150 => _150()])) {
|
|
1312
1056
|
headers[COORDINATOR_URL_OVERRIDE_HEADER] = coordinatorUrl.trim();
|
|
1313
1057
|
}
|
|
1314
1058
|
const workerCallbackUrl = env.DEEPLINE_WORKER_CALLBACK_URL;
|
|
1315
|
-
if (_optionalChain([workerCallbackUrl, 'optionalAccess',
|
|
1059
|
+
if (_optionalChain([workerCallbackUrl, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) {
|
|
1316
1060
|
headers[WORKER_CALLBACK_URL_OVERRIDE_HEADER] = workerCallbackUrl.trim();
|
|
1317
1061
|
}
|
|
1318
1062
|
const runtimeSchedulerSchema = env.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA;
|
|
1319
|
-
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess',
|
|
1063
|
+
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess', _153 => _153.trim, 'call', _154 => _154()])) {
|
|
1320
1064
|
headers[RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER] = runtimeSchedulerSchema.trim();
|
|
1321
1065
|
}
|
|
1322
1066
|
const syntheticRun = env.DEEPLINE_SYNTHETIC_RUN;
|
|
@@ -1324,21 +1068,21 @@ var HttpClient = class {
|
|
|
1324
1068
|
headers[SYNTHETIC_RUN_HEADER] = "1";
|
|
1325
1069
|
}
|
|
1326
1070
|
const runtimeTestFault = env.DEEPLINE_TEST_RUNTIME_FAULT;
|
|
1327
|
-
if (_optionalChain([runtimeTestFault, 'optionalAccess',
|
|
1071
|
+
if (_optionalChain([runtimeTestFault, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()])) {
|
|
1328
1072
|
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
1329
1073
|
}
|
|
1330
|
-
const retainedReceivers = _optionalChain([env, 'access',
|
|
1331
|
-
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
1074
|
+
const retainedReceivers = _optionalChain([env, 'access', _157 => _157.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]);
|
|
1075
|
+
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess', _160 => _160.trim, 'call', _161 => _161()])) {
|
|
1332
1076
|
headers[RETAINED_PIPELINE_RECEIVERS_HEADER] = retainedReceivers;
|
|
1333
1077
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
1334
1078
|
}
|
|
1335
|
-
if (_optionalChain([absurdReleaseOverride, 'optionalAccess',
|
|
1079
|
+
if (_optionalChain([absurdReleaseOverride, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()])) {
|
|
1336
1080
|
headers[ABSURD_RELEASE_OVERRIDE_HEADER] = absurdReleaseOverride.trim();
|
|
1337
1081
|
}
|
|
1338
|
-
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess',
|
|
1082
|
+
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _166 => _166.trim, 'call', _167 => _167()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _168 => _168.trim, 'call', _169 => _169()])) {
|
|
1339
1083
|
headers[PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER] = preferredReceiptGatewayMachineId.trim();
|
|
1340
1084
|
}
|
|
1341
|
-
if (_optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
1085
|
+
if (_optionalChain([coordinatorInternalToken, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) && (_optionalChain([coordinatorUrl, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]) || _optionalChain([workerCallbackUrl, 'optionalAccess', _174 => _174.trim, 'call', _175 => _175()]) || _optionalChain([runtimeTestFault, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()]) || _optionalChain([absurdReleaseOverride, 'optionalAccess', _178 => _178.trim, 'call', _179 => _179()]) || _optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()]))) {
|
|
1342
1086
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
1343
1087
|
}
|
|
1344
1088
|
return applyExplicitHeaders(
|
|
@@ -1363,23 +1107,23 @@ var HttpClient = class {
|
|
|
1363
1107
|
async request(path, options) {
|
|
1364
1108
|
const baseUrl = this.config.baseUrl;
|
|
1365
1109
|
const url = `${baseUrl}${path}`;
|
|
1366
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1110
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _182 => _182.method]), () => ( "GET"));
|
|
1367
1111
|
const requestStartedAt = Date.now();
|
|
1368
1112
|
let fetchAttempts = 0;
|
|
1369
1113
|
let lastRequestUrl = url;
|
|
1370
1114
|
let networkFailedAt;
|
|
1371
1115
|
let networkPhase = "before_request";
|
|
1372
|
-
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess',
|
|
1373
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1116
|
+
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess', _183 => _183.headers]));
|
|
1117
|
+
if (_optionalChain([options, 'optionalAccess', _184 => _184.body]) !== void 0) {
|
|
1374
1118
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
1375
1119
|
}
|
|
1376
1120
|
let lastError = null;
|
|
1377
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
1121
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _185 => _185.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
1378
1122
|
let retryAfterDelayMs = null;
|
|
1379
1123
|
let totalRetryWaitMs = 0;
|
|
1380
|
-
|
|
1124
|
+
let maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _186 => _186.maxRetries]), () => ( this.config.maxRetries));
|
|
1381
1125
|
requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1382
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1126
|
+
if (_optionalChain([options, 'optionalAccess', _187 => _187.signal, 'optionalAccess', _188 => _188.aborted])) {
|
|
1383
1127
|
lastError = requestCancelledError(options.signal);
|
|
1384
1128
|
networkFailedAt = Date.now();
|
|
1385
1129
|
break;
|
|
@@ -1394,7 +1138,7 @@ var HttpClient = class {
|
|
|
1394
1138
|
totalRetryWaitMs += delayMs;
|
|
1395
1139
|
networkPhase = "retry_wait";
|
|
1396
1140
|
try {
|
|
1397
|
-
await sleep(delayMs, _optionalChain([options, 'optionalAccess',
|
|
1141
|
+
await sleep(delayMs, _optionalChain([options, 'optionalAccess', _189 => _189.signal]));
|
|
1398
1142
|
} catch (error) {
|
|
1399
1143
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
1400
1144
|
networkFailedAt = Date.now();
|
|
@@ -1402,25 +1146,25 @@ var HttpClient = class {
|
|
|
1402
1146
|
}
|
|
1403
1147
|
}
|
|
1404
1148
|
for (const candidateUrl of candidateUrls) {
|
|
1405
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1149
|
+
if (_optionalChain([options, 'optionalAccess', _190 => _190.signal, 'optionalAccess', _191 => _191.aborted])) {
|
|
1406
1150
|
lastError = requestCancelledError(options.signal);
|
|
1407
1151
|
networkFailedAt = Date.now();
|
|
1408
1152
|
break requestAttempts;
|
|
1409
1153
|
}
|
|
1410
1154
|
const controller = new AbortController();
|
|
1411
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1155
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _192 => _192.timeout]), () => ( this.config.timeout));
|
|
1412
1156
|
let requestTimedOut = false;
|
|
1413
1157
|
const timeoutId = setTimeout(() => {
|
|
1414
1158
|
requestTimedOut = true;
|
|
1415
1159
|
controller.abort();
|
|
1416
1160
|
}, timeoutMs);
|
|
1417
1161
|
const abortRequest = () => controller.abort();
|
|
1418
|
-
_optionalChain([options, 'optionalAccess',
|
|
1162
|
+
_optionalChain([options, 'optionalAccess', _193 => _193.signal, 'optionalAccess', _194 => _194.addEventListener, 'call', _195 => _195("abort", abortRequest, {
|
|
1419
1163
|
once: true
|
|
1420
1164
|
})]);
|
|
1421
1165
|
networkPhase = "before_request";
|
|
1422
1166
|
try {
|
|
1423
|
-
const requestBody = _optionalChain([options, 'optionalAccess',
|
|
1167
|
+
const requestBody = _optionalChain([options, 'optionalAccess', _196 => _196.formData]) !== void 0 ? typeof options.formData === "function" ? options.formData() : options.formData : _optionalChain([options, 'optionalAccess', _197 => _197.body]) !== void 0 ? JSON.stringify(options.body) : void 0;
|
|
1424
1168
|
fetchAttempts += 1;
|
|
1425
1169
|
lastRequestUrl = candidateUrl;
|
|
1426
1170
|
networkPhase = "awaiting_headers";
|
|
@@ -1431,8 +1175,8 @@ var HttpClient = class {
|
|
|
1431
1175
|
signal: controller.signal
|
|
1432
1176
|
});
|
|
1433
1177
|
networkPhase = "reading_body";
|
|
1434
|
-
_optionalChain([options, 'optionalAccess',
|
|
1435
|
-
if (response.status === 404 && _optionalChain([options, 'optionalAccess',
|
|
1178
|
+
_optionalChain([options, 'optionalAccess', _198 => _198.onResponse, 'optionalCall', _199 => _199(response)]);
|
|
1179
|
+
if (response.status === 404 && _optionalChain([options, 'optionalAccess', _200 => _200.allowNotFound])) {
|
|
1436
1180
|
clearTimeout(timeoutId);
|
|
1437
1181
|
return null;
|
|
1438
1182
|
}
|
|
@@ -1440,25 +1184,31 @@ var HttpClient = class {
|
|
|
1440
1184
|
const receivedAtMs = Date.now();
|
|
1441
1185
|
clearTimeout(timeoutId);
|
|
1442
1186
|
const parsed = parseResponseBody(body);
|
|
1443
|
-
_optionalChain([options, 'optionalAccess',
|
|
1187
|
+
_optionalChain([options, 'optionalAccess', _201 => _201.onResponseBody, 'optionalCall', _202 => _202({
|
|
1444
1188
|
receivedAtMs,
|
|
1445
1189
|
httpStatus: response.status,
|
|
1446
1190
|
body: parsed
|
|
1447
1191
|
})]);
|
|
1448
|
-
const
|
|
1192
|
+
const responseRetryAllowed = _optionalChain([options, 'optionalAccess', _203 => _203.retryFromExecutePolicy]) !== true || parseExecuteRetryPolicy(
|
|
1193
|
+
response.headers.get(EXECUTE_RETRY_POLICY_HEADER)
|
|
1194
|
+
) === "transient-http-safe";
|
|
1195
|
+
if (_optionalChain([options, 'optionalAccess', _204 => _204.retryFromExecutePolicy]) === true && responseRetryAllowed && options.executePolicyMaxRetries !== void 0) {
|
|
1196
|
+
maxRetries = options.executePolicyMaxRetries;
|
|
1197
|
+
}
|
|
1198
|
+
const structuredToolError = _optionalChain([options, 'optionalAccess', _205 => _205.toolId]) && !response.ok ? _chunkPPDBRJRWjs.deserializeToolExecutionFailure.call(void 0,
|
|
1449
1199
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
1450
1200
|
isRecord(parsed) ? parsed.tool_error : null,
|
|
1451
|
-
|
|
1201
|
+
_chunkPPDBRJRWjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
1452
1202
|
) : null;
|
|
1453
1203
|
if (structuredToolError) {
|
|
1454
1204
|
if (response.status === 429) {
|
|
1455
1205
|
const retryAfter = parseRetryAfter(response);
|
|
1456
|
-
const failure =
|
|
1457
|
-
lastError = failure === null ? structuredToolError : new (0,
|
|
1206
|
+
const failure = _chunkPPDBRJRWjs.serializeToolExecutionFailure.call(void 0, structuredToolError);
|
|
1207
|
+
lastError = failure === null ? structuredToolError : new (0, _chunkNPBJI7REjs.ToolRateLimitError)(structuredToolError.message, {
|
|
1458
1208
|
...failure,
|
|
1459
1209
|
retryAfterMs: _nullishCoalesce(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
|
}
|
|
@@ -1467,8 +1217,8 @@ var HttpClient = class {
|
|
|
1467
1217
|
throw structuredToolError;
|
|
1468
1218
|
}
|
|
1469
1219
|
if (response.status === 429) {
|
|
1470
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1471
|
-
throw new (0,
|
|
1220
|
+
if (_optionalChain([options, 'optionalAccess', _206 => _206.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
|
|
1221
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1472
1222
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
1473
1223
|
response.status,
|
|
1474
1224
|
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
@@ -1476,24 +1226,24 @@ var HttpClient = class {
|
|
|
1476
1226
|
);
|
|
1477
1227
|
}
|
|
1478
1228
|
const retryAfter = parseRetryAfter(response);
|
|
1479
|
-
lastError = new (0,
|
|
1480
|
-
if (attempt < maxRetries) {
|
|
1229
|
+
lastError = new (0, _chunkNPBJI7REjs.RateLimitError)(retryAfter);
|
|
1230
|
+
if (responseRetryAllowed && attempt < maxRetries) {
|
|
1481
1231
|
retryAfterDelayMs = retryAfter;
|
|
1482
1232
|
break;
|
|
1483
1233
|
}
|
|
1484
1234
|
throw lastError;
|
|
1485
1235
|
}
|
|
1486
1236
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1487
|
-
throw new (0,
|
|
1237
|
+
throw new (0, _chunkNPBJI7REjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1488
1238
|
}
|
|
1489
1239
|
if (!response.ok) {
|
|
1490
|
-
const retryableApiError = _optionalChain([options, 'optionalAccess',
|
|
1240
|
+
const retryableApiError = _optionalChain([options, 'optionalAccess', _207 => _207.retryApiErrors]) === true && responseRetryAllowed && isRetryableApiErrorResponse(response.status);
|
|
1491
1241
|
const htmlError = detectHtmlErrorBody(
|
|
1492
1242
|
body,
|
|
1493
1243
|
response.headers.get("content-type")
|
|
1494
1244
|
);
|
|
1495
1245
|
if (htmlError) {
|
|
1496
|
-
lastError = new (0,
|
|
1246
|
+
lastError = new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1497
1247
|
htmlError.message(response.status),
|
|
1498
1248
|
response.status,
|
|
1499
1249
|
"API_ERROR",
|
|
@@ -1512,7 +1262,7 @@ var HttpClient = class {
|
|
|
1512
1262
|
const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
|
|
1513
1263
|
const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
|
|
1514
1264
|
const apiErrorCode = _chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed);
|
|
1515
|
-
lastError = new (0,
|
|
1265
|
+
lastError = new (0, _chunkPPDBRJRWjs.DeeplineError)(msg, response.status, apiErrorCode, {
|
|
1516
1266
|
response: parsed
|
|
1517
1267
|
});
|
|
1518
1268
|
if (retryableApiError && attempt < maxRetries) {
|
|
@@ -1527,7 +1277,7 @@ var HttpClient = class {
|
|
|
1527
1277
|
response.headers.get("content-type")
|
|
1528
1278
|
);
|
|
1529
1279
|
if (interstitial) {
|
|
1530
|
-
throw new (0,
|
|
1280
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1531
1281
|
`${this.config.baseUrl} returned a deployment-protection page instead of JSON. Set VERCEL_PROTECTION_BYPASS_TOKEN, or run \`vercel login\` if the CLI session expired.`,
|
|
1532
1282
|
response.status,
|
|
1533
1283
|
"DEPLOYMENT_PROTECTED",
|
|
@@ -1539,14 +1289,14 @@ var HttpClient = class {
|
|
|
1539
1289
|
} catch (error) {
|
|
1540
1290
|
clearTimeout(timeoutId);
|
|
1541
1291
|
networkFailedAt = Date.now();
|
|
1542
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1292
|
+
if (_optionalChain([options, 'optionalAccess', _208 => _208.signal, 'optionalAccess', _209 => _209.aborted])) {
|
|
1543
1293
|
lastError = requestCancelledError(options.signal);
|
|
1544
1294
|
break requestAttempts;
|
|
1545
1295
|
}
|
|
1546
|
-
if (error instanceof
|
|
1296
|
+
if (error instanceof _chunkNPBJI7REjs.AuthError || error instanceof _chunkPPDBRJRWjs.DeeplineError) {
|
|
1547
1297
|
throw error;
|
|
1548
1298
|
}
|
|
1549
|
-
if (error instanceof
|
|
1299
|
+
if (error instanceof _chunkNPBJI7REjs.RateLimitError) {
|
|
1550
1300
|
lastError = error;
|
|
1551
1301
|
break;
|
|
1552
1302
|
}
|
|
@@ -1554,14 +1304,15 @@ var HttpClient = class {
|
|
|
1554
1304
|
timeoutMs,
|
|
1555
1305
|
timedOut: requestTimedOut
|
|
1556
1306
|
});
|
|
1307
|
+
if (_optionalChain([options, 'optionalAccess', _210 => _210.retryFromExecutePolicy])) break requestAttempts;
|
|
1557
1308
|
} finally {
|
|
1558
1309
|
clearTimeout(timeoutId);
|
|
1559
|
-
_optionalChain([options, 'optionalAccess',
|
|
1310
|
+
_optionalChain([options, 'optionalAccess', _211 => _211.signal, 'optionalAccess', _212 => _212.removeEventListener, 'call', _213 => _213("abort", abortRequest)]);
|
|
1560
1311
|
}
|
|
1561
1312
|
}
|
|
1562
1313
|
if (attempt < maxRetries) continue;
|
|
1563
1314
|
}
|
|
1564
|
-
if (lastError instanceof
|
|
1315
|
+
if (lastError instanceof _chunkPPDBRJRWjs.DeeplineError) {
|
|
1565
1316
|
throw lastError;
|
|
1566
1317
|
}
|
|
1567
1318
|
const mappedNetworkError = mapNetworkError(
|
|
@@ -1583,10 +1334,10 @@ var HttpClient = class {
|
|
|
1583
1334
|
phase: networkPhase
|
|
1584
1335
|
}
|
|
1585
1336
|
};
|
|
1586
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1337
|
+
if (_optionalChain([options, 'optionalAccess', _214 => _214.toolId])) {
|
|
1587
1338
|
const code = mappedNetworkError.code;
|
|
1588
1339
|
throw withErrorCause(
|
|
1589
|
-
new (0,
|
|
1340
|
+
new (0, _chunkPPDBRJRWjs.ToolExecutionError)(
|
|
1590
1341
|
withCoworkNetworkHint(mappedNetworkError.message),
|
|
1591
1342
|
{
|
|
1592
1343
|
toolId: options.toolId,
|
|
@@ -1611,7 +1362,7 @@ var HttpClient = class {
|
|
|
1611
1362
|
);
|
|
1612
1363
|
}
|
|
1613
1364
|
throw withErrorCause(
|
|
1614
|
-
new (0,
|
|
1365
|
+
new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1615
1366
|
withCoworkNetworkHint(mappedNetworkError.message),
|
|
1616
1367
|
void 0,
|
|
1617
1368
|
mappedNetworkError.code,
|
|
@@ -1635,36 +1386,36 @@ var HttpClient = class {
|
|
|
1635
1386
|
}
|
|
1636
1387
|
async *streamSse(path, options) {
|
|
1637
1388
|
const url = `${this.config.baseUrl}${path}`;
|
|
1638
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1389
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _215 => _215.method]), () => ( "GET"));
|
|
1639
1390
|
const headers = this.authHeaders({
|
|
1640
1391
|
Accept: "text/event-stream",
|
|
1641
|
-
..._optionalChain([options, 'optionalAccess',
|
|
1392
|
+
..._optionalChain([options, 'optionalAccess', _216 => _216.headers])
|
|
1642
1393
|
});
|
|
1643
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1394
|
+
if (_optionalChain([options, 'optionalAccess', _217 => _217.body]) !== void 0) {
|
|
1644
1395
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
1645
1396
|
}
|
|
1646
1397
|
let lastError = null;
|
|
1647
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
1398
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _218 => _218.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
1648
1399
|
for (const candidateUrl of candidateUrls) {
|
|
1649
1400
|
try {
|
|
1650
1401
|
const response = await fetch(candidateUrl, {
|
|
1651
1402
|
method,
|
|
1652
1403
|
headers,
|
|
1653
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
1654
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
1404
|
+
body: _optionalChain([options, 'optionalAccess', _219 => _219.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
1405
|
+
signal: _optionalChain([options, 'optionalAccess', _220 => _220.signal])
|
|
1655
1406
|
});
|
|
1656
1407
|
if (!response.ok) {
|
|
1657
1408
|
const body = await response.text();
|
|
1658
1409
|
const parsed = parseResponseBody(body);
|
|
1659
1410
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1660
|
-
throw new (0,
|
|
1411
|
+
throw new (0, _chunkNPBJI7REjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1661
1412
|
}
|
|
1662
1413
|
const htmlError = detectHtmlErrorBody(
|
|
1663
1414
|
body,
|
|
1664
1415
|
response.headers.get("content-type")
|
|
1665
1416
|
);
|
|
1666
1417
|
if (htmlError) {
|
|
1667
|
-
throw new (0,
|
|
1418
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1668
1419
|
htmlError.message(response.status),
|
|
1669
1420
|
response.status,
|
|
1670
1421
|
"API_ERROR",
|
|
@@ -1675,7 +1426,7 @@ var HttpClient = class {
|
|
|
1675
1426
|
}
|
|
1676
1427
|
);
|
|
1677
1428
|
}
|
|
1678
|
-
throw new (0,
|
|
1429
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1679
1430
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
1680
1431
|
response.status,
|
|
1681
1432
|
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
@@ -1683,17 +1434,17 @@ var HttpClient = class {
|
|
|
1683
1434
|
);
|
|
1684
1435
|
}
|
|
1685
1436
|
if (!response.body) {
|
|
1686
|
-
throw new (0,
|
|
1437
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)("SSE response did not include a body.");
|
|
1687
1438
|
}
|
|
1688
1439
|
yield* decodeSseStream(response.body);
|
|
1689
1440
|
return;
|
|
1690
1441
|
} catch (error) {
|
|
1691
|
-
if (error instanceof
|
|
1442
|
+
if (error instanceof _chunkNPBJI7REjs.AuthError || error instanceof _chunkPPDBRJRWjs.DeeplineError) {
|
|
1692
1443
|
throw error;
|
|
1693
1444
|
}
|
|
1694
1445
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
1695
|
-
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess',
|
|
1696
|
-
throw new (0,
|
|
1446
|
+
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _221 => _221.signal, 'optionalAccess', _222 => _222.aborted])) {
|
|
1447
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1697
1448
|
`Stream from ${this.config.baseUrl} was aborted by the caller.`,
|
|
1698
1449
|
void 0,
|
|
1699
1450
|
"ABORTED"
|
|
@@ -1703,7 +1454,7 @@ var HttpClient = class {
|
|
|
1703
1454
|
}
|
|
1704
1455
|
}
|
|
1705
1456
|
if (lastError && isAbortLikeError(lastError)) {
|
|
1706
|
-
throw new (0,
|
|
1457
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1707
1458
|
withCoworkNetworkHint(
|
|
1708
1459
|
`Unable to stream from ${this.config.baseUrl}. The remote stream was interrupted.`
|
|
1709
1460
|
),
|
|
@@ -1711,9 +1462,9 @@ var HttpClient = class {
|
|
|
1711
1462
|
"PLAY_STREAM_NETWORK_ABORTED"
|
|
1712
1463
|
);
|
|
1713
1464
|
}
|
|
1714
|
-
throw new (0,
|
|
1465
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
1715
1466
|
withCoworkNetworkHint(
|
|
1716
|
-
_optionalChain([lastError, 'optionalAccess',
|
|
1467
|
+
_optionalChain([lastError, 'optionalAccess', _223 => _223.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
|
|
1717
1468
|
)
|
|
1718
1469
|
);
|
|
1719
1470
|
}
|
|
@@ -1775,15 +1526,15 @@ function parseResponseBody(body) {
|
|
|
1775
1526
|
}
|
|
1776
1527
|
function isProviderOriginatedHttpError(parsed) {
|
|
1777
1528
|
const response = asRecord(parsed);
|
|
1778
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
1779
|
-
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1780
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1529
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _224 => _224.error]));
|
|
1530
|
+
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _225 => _225.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _226 => _226.failure_origin])));
|
|
1531
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _227 => _227.code]), () => ( _optionalChain([response, 'optionalAccess', _228 => _228.code])));
|
|
1781
1532
|
return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
|
|
1782
1533
|
}
|
|
1783
1534
|
function isMonitorRateLimitEnvelope(parsed) {
|
|
1784
1535
|
const response = asRecord(parsed);
|
|
1785
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
1786
|
-
return _optionalChain([error, 'optionalAccess',
|
|
1536
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _229 => _229.error]));
|
|
1537
|
+
return _optionalChain([error, 'optionalAccess', _230 => _230.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
|
|
1787
1538
|
}
|
|
1788
1539
|
function asRecord(value) {
|
|
1789
1540
|
return typeof value === "object" && value !== null ? value : null;
|
|
@@ -1799,7 +1550,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
1799
1550
|
return null;
|
|
1800
1551
|
}
|
|
1801
1552
|
const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
1802
|
-
const title = _optionalChain([titleMatch, 'optionalAccess',
|
|
1553
|
+
const title = _optionalChain([titleMatch, 'optionalAccess', _231 => _231[1], 'optionalAccess', _232 => _232.replace, 'call', _233 => _233(/\s+/g, " "), 'access', _234 => _234.trim, 'call', _235 => _235()]) || void 0;
|
|
1803
1554
|
const workerThrewException = /worker threw exception/i.test(trimmed);
|
|
1804
1555
|
return {
|
|
1805
1556
|
title,
|
|
@@ -1883,20 +1634,20 @@ function decodeSseFrame(frame) {
|
|
|
1883
1634
|
}
|
|
1884
1635
|
function sleep(ms, signal) {
|
|
1885
1636
|
return new Promise((resolve2, reject) => {
|
|
1886
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1637
|
+
if (_optionalChain([signal, 'optionalAccess', _236 => _236.aborted])) {
|
|
1887
1638
|
reject(requestCancelledError(signal));
|
|
1888
1639
|
return;
|
|
1889
1640
|
}
|
|
1890
1641
|
const timeoutId = setTimeout(() => {
|
|
1891
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1642
|
+
_optionalChain([signal, 'optionalAccess', _237 => _237.removeEventListener, 'call', _238 => _238("abort", abort)]);
|
|
1892
1643
|
resolve2();
|
|
1893
1644
|
}, ms);
|
|
1894
1645
|
const abort = () => {
|
|
1895
1646
|
clearTimeout(timeoutId);
|
|
1896
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1647
|
+
_optionalChain([signal, 'optionalAccess', _239 => _239.removeEventListener, 'call', _240 => _240("abort", abort)]);
|
|
1897
1648
|
reject(requestCancelledError(signal));
|
|
1898
1649
|
};
|
|
1899
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1650
|
+
_optionalChain([signal, 'optionalAccess', _241 => _241.addEventListener, 'call', _242 => _242("abort", abort, { once: true })]);
|
|
1900
1651
|
});
|
|
1901
1652
|
}
|
|
1902
1653
|
function withCoworkNetworkHint(message) {
|
|
@@ -1953,4 +1704,5 @@ ${COWORK_NETWORK_HINT}`;
|
|
|
1953
1704
|
|
|
1954
1705
|
|
|
1955
1706
|
|
|
1956
|
-
|
|
1707
|
+
|
|
1708
|
+
exports.HOST_URL_ENV = HOST_URL_ENV; exports.API_KEY_ENV = API_KEY_ENV; exports.ACTIVE_ORG_ID_ENV = ACTIVE_ORG_ID_ENV; exports.ACTIVE_ORG_NAME_ENV = ACTIVE_ORG_NAME_ENV; exports.FEATURES_ENV = FEATURES_ENV; exports.PROD_URL = PROD_URL; exports.featureEnvValues = featureEnvValues; exports.storedHostApiKey = storedHostApiKey; exports.storedHostFeatures = storedHostFeatures; exports.baseUrlSlug = baseUrlSlug; exports.sdkCliStateDirPath = sdkCliStateDirPath; exports.hostConfigDirPath = hostConfigDirPath; exports.hostEnvFilePath = hostEnvFilePath; exports.saveHostEnvValues = saveHostEnvValues; exports.autoDetectBaseUrl = autoDetectBaseUrl; exports.resolveApiKeyForBaseUrl = resolveApiKeyForBaseUrl; exports.resolveProjectApiKeyForBaseUrl = resolveProjectApiKeyForBaseUrl; exports.resolveGlobalApiKeyForBaseUrl = resolveGlobalApiKeyForBaseUrl; exports.getResolvedProjectAuthSource = getResolvedProjectAuthSource; exports.resolveBaseUrlOnly = resolveBaseUrlOnly; exports.resolveConfig = resolveConfig; exports.ensureProjectPrivatePathsIgnored = ensureProjectPrivatePathsIgnored; exports.saveProjectDeeplineEnvValues = saveProjectDeeplineEnvValues; exports.resolveProjectPinTarget = resolveProjectPinTarget; exports.getActiveProjectAuthSource = getActiveProjectAuthSource; exports.resolveCliAuthProvenance = resolveCliAuthProvenance; exports.resolveCliCommandContext = resolveCliCommandContext; exports.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER = ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER; exports.SDK_VERSION = SDK_VERSION; exports.SDK_API_MAJOR = SDK_API_MAJOR; exports.SDK_API_CONTRACT = SDK_API_CONTRACT; exports.agentSessionIdFromEnvironment = agentSessionIdFromEnvironment; exports.detectAgentRuntime = detectAgentRuntime; exports.hasActivePluginSkills = hasActivePluginSkills; exports.KNOWN_SKILL_AGENTS = KNOWN_SKILL_AGENTS; exports.DEFAULT_SKILL_AGENTS = DEFAULT_SKILL_AGENTS; exports.skillsAgentPathSegment = skillsAgentPathSegment; exports.resolveAutoSyncSkillAgents = resolveAutoSyncSkillAgents; exports.readSdkSkillsLocalVersion = readSdkSkillsLocalVersion; exports.writeSdkSkillsLocalVersion = writeSdkSkillsLocalVersion; exports.deploymentProtectionHeaders = deploymentProtectionHeaders; exports.fetchWithDeploymentProtection = fetchWithDeploymentProtection; exports.COORDINATOR_INTERNAL_TOKEN_HEADER = COORDINATOR_INTERNAL_TOKEN_HEADER; exports.RUNTIME_ENVIRONMENT_TOKEN_HEADER = RUNTIME_ENVIRONMENT_TOKEN_HEADER; exports.RETAINED_PIPELINE_RECEIVERS_HEADER = RETAINED_PIPELINE_RECEIVERS_HEADER; exports.HttpClient = HttpClient;
|