deepline 0.3.525 → 0.3.527
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 +98 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +14 -5
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure-class.ts +98 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +24 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +35 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/durable-run-inventory.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/durable-run-sql.ts +39 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +50 -8
- package/dist/cli/auth-C7BBYIQD.js +43 -0
- package/dist/cli/{auth-TH3VGYBK.mjs → auth-LRMMQFJ4.mjs} +5 -5
- package/dist/cli/{billing-TWKVUFU2.js → billing-M76MMWZB.js} +82 -82
- package/dist/cli/{billing-CMHFI2LN.mjs → billing-WZZDXVRJ.mjs} +7 -7
- package/dist/cli/{chunk-CQSANB3V.js → chunk-2A6IRSE6.js} +5 -5
- package/dist/cli/{chunk-CZNEQMJR.mjs → chunk-2L3HVEBM.mjs} +1 -1
- package/dist/cli/{chunk-DYS3KWYF.js → chunk-3L2DNG5X.js} +11 -11
- package/dist/cli/{chunk-2WFVLOB7.js → chunk-3PQDEBO6.js} +1 -1
- package/dist/cli/{chunk-KPINGHIF.mjs → chunk-4YN7DZEA.mjs} +2 -2
- package/dist/cli/{chunk-OXFIJYN3.mjs → chunk-5YR6CDJ2.mjs} +6 -6
- package/dist/cli/{chunk-5JFAQUZS.js → chunk-66YLAQ2X.js} +26 -26
- package/dist/cli/{chunk-U4M32NFS.mjs → chunk-77VNC2KF.mjs} +1 -1
- package/dist/cli/{chunk-TFEGJEYO.js → chunk-7DPWGAOU.js} +3 -3
- package/dist/cli/{chunk-WEYFSBAD.mjs → chunk-7FCD34YS.mjs} +18 -11
- package/dist/cli/{chunk-CLTL7ZJI.mjs → chunk-AXFHQWGA.mjs} +1 -1
- package/dist/cli/{chunk-4UWXFXQF.js → chunk-C7A44BZ7.js} +3 -3
- package/dist/cli/{chunk-LAMGJQDY.mjs → chunk-E4TEZE62.mjs} +2 -2
- package/dist/cli/{chunk-S5LUY3KJ.js → chunk-EOL7PXLW.js} +7 -7
- package/dist/cli/{chunk-N4MMU3QF.js → chunk-ETXQZGQU.js} +16 -16
- package/dist/cli/{chunk-IMO3HXWZ.mjs → chunk-GIRMVMXP.mjs} +1 -1
- package/dist/cli/{chunk-YC7FKAJ4.mjs → chunk-HA2J2OAS.mjs} +10 -10
- package/dist/cli/{chunk-NRBCETWL.js → chunk-HB3YUHEL.js} +44 -44
- package/dist/cli/{chunk-P62LON53.js → chunk-HQZLTK3P.js} +2 -2
- package/dist/cli/{chunk-UQYKSOGO.mjs → chunk-JEIGNX3G.mjs} +5 -5
- package/dist/cli/{chunk-LE537GBC.js → chunk-JSEISVAZ.js} +138 -78
- package/dist/cli/{chunk-GCLNX72G.mjs → chunk-JSVHBJE2.mjs} +2 -2
- package/dist/cli/{chunk-ETHVJ2ZE.mjs → chunk-KDFUQRVU.mjs} +1 -1
- package/dist/cli/{chunk-QR7VYYNM.js → chunk-LHMHUA5D.js} +7 -7
- package/dist/cli/{chunk-ZWFTHEPT.mjs → chunk-M45S7JAY.mjs} +2 -2
- package/dist/cli/{chunk-WGRDOPAK.mjs → chunk-MIL5YDKZ.mjs} +2 -2
- package/dist/cli/{chunk-TXSBPBHB.mjs → chunk-MMM2WMTF.mjs} +5 -5
- package/dist/cli/{chunk-EP6YH6QJ.mjs → chunk-NVII3RWQ.mjs} +2 -2
- package/dist/cli/{chunk-V2GN4PLK.js → chunk-OKRBGXDI.js} +5 -5
- package/dist/cli/{chunk-LXKH4MKH.js → chunk-OLSATEDQ.js} +6 -6
- package/dist/cli/{chunk-V65J64FL.js → chunk-OXHY3LD3.js} +53 -53
- package/dist/cli/{chunk-OWQF6WVH.mjs → chunk-P5ZU5ZHA.mjs} +61 -1
- package/dist/cli/{chunk-RMZ6CISE.mjs → chunk-QKKT5G4K.mjs} +3 -3
- package/dist/cli/{chunk-JVWSIA2V.mjs → chunk-QKY3H3HA.mjs} +4 -4
- package/dist/cli/{chunk-WA3FG7DH.js → chunk-R6IWWPY7.js} +14 -14
- package/dist/cli/{chunk-MRUFGOJR.js → chunk-RGL2YGJZ.js} +2 -2
- package/dist/cli/{chunk-7C4F4TLR.mjs → chunk-RMCKTV4R.mjs} +1 -1
- package/dist/cli/{chunk-NO4URKKT.mjs → chunk-RTPLRMEB.mjs} +5 -5
- package/dist/cli/{chunk-ESWM2JW4.js → chunk-SRQQAUXN.js} +2 -2
- package/dist/cli/{chunk-CKTRQSRA.js → chunk-UAQ7ZWRP.js} +22 -22
- package/dist/cli/{chunk-7OF3A4KJ.mjs → chunk-UJHS2O5O.mjs} +84 -57
- package/dist/cli/{chunk-VYIAWAKJ.mjs → chunk-UKOG6PCB.mjs} +1 -1
- package/dist/cli/{chunk-UXF3ODJJ.mjs → chunk-VTXBV4AX.mjs} +1 -1
- package/dist/cli/{chunk-M43ZYNDA.mjs → chunk-VV2AFJ3I.mjs} +5 -5
- package/dist/cli/{chunk-CWRL6IQP.js → chunk-WL6GAZBD.js} +18 -11
- package/dist/cli/{chunk-NB2ECLQE.js → chunk-XI47UAVU.js} +9 -9
- package/dist/cli/{chunk-AVDEYOVP.js → chunk-XYG4IOJK.js} +98 -98
- package/dist/cli/{chunk-KEZ3KBWW.js → chunk-YJ4YVFXC.js} +97 -70
- package/dist/cli/{chunk-5BSGWIQD.mjs → chunk-YKPMIJJ2.mjs} +2 -2
- package/dist/cli/{chunk-MHBSRNI7.js → chunk-YSDPYQBH.js} +41 -41
- package/dist/cli/{chunk-KBOSALBI.js → chunk-YUYDP2EG.js} +6 -6
- package/dist/cli/{chunk-TO72GW5I.js → chunk-ZHY7AY5V.js} +16 -16
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-OO554TPX.mjs → csv-FEFNXZF7.mjs} +4 -4
- package/dist/cli/{csv-5JHWVJ5N.js → csv-IRP6VT7Q.js} +13 -13
- package/dist/cli/{db-SQKJ6RKU.mjs → db-IHECMWZ3.mjs} +6 -6
- package/dist/cli/{db-CYQJ4OXF.js → db-Y5VNPNRD.js} +27 -27
- package/dist/cli/describe-MNJVJHRE.js +50 -0
- package/dist/cli/{describe-N7AKTUQV.mjs → describe-XCVC2WLL.mjs} +18 -18
- package/dist/cli/{executions-F34DORW6.mjs → executions-3FWZYUJV.mjs} +6 -6
- package/dist/cli/{executions-K7EGCRKX.js → executions-QH3KJ6MA.js} +8 -8
- package/dist/cli/{feedback-NOQVCA3Q.js → feedback-BGHWMOLH.js} +65 -17
- package/dist/cli/{feedback-GQHKCS66.mjs → feedback-F3OZXOPM.mjs} +61 -13
- package/dist/cli/git-MDOHEW5J.js +25 -0
- package/dist/cli/{git-2EEITXDB.mjs → git-RWPH3D75.mjs} +5 -5
- package/dist/cli/index.js +145 -145
- package/dist/cli/index.mjs +44 -44
- package/dist/cli/{legacy-noops-JHMY5XRB.mjs → legacy-noops-5ADSTBJ5.mjs} +6 -6
- package/dist/cli/{legacy-noops-RFNHQ7RG.js → legacy-noops-G6CYD5LM.js} +9 -9
- package/dist/cli/{monitors-RDMP6SPZ.mjs → monitors-AFNAU3A2.mjs} +7 -7
- package/dist/cli/{monitors-UKRZ4BDK.js → monitors-VZCBZO26.js} +100 -100
- package/dist/cli/{org-RF3G4KMB.mjs → org-JVLYTU24.mjs} +6 -6
- package/dist/cli/{org-OX7TYTHV.js → org-X4QRYBC4.js} +86 -86
- package/dist/cli/{pages-FBM3MGSP.mjs → pages-VELKZKBL.mjs} +6 -6
- package/dist/cli/{pages-MKQT5LFV.js → pages-YMM4KBW5.js} +18 -18
- package/dist/cli/{play-OOVX2DMV.js → play-J7DEBHI7.js} +317 -317
- package/dist/cli/{play-YWC2UORM.mjs → play-MIY6BYRB.mjs} +18 -18
- package/dist/cli/{providers-3PEQESIU.mjs → providers-2H3W3W7G.mjs} +6 -6
- package/dist/cli/{providers-2CGZYLER.js → providers-TOUB7Y2A.js} +9 -9
- package/dist/cli/{quickstart-KVB36SOW.mjs → quickstart-GKAS5265.mjs} +4 -4
- package/dist/cli/{quickstart-6AANHKQZ.js → quickstart-LHY2LN3P.js} +6 -6
- package/dist/cli/{run-QC23NRKO.mjs → run-KYGNOWYD.mjs} +23 -23
- package/dist/cli/{run-NJ7WV5TK.js → run-QCAVDPE5.js} +41 -41
- package/dist/cli/search-G67CEHR7.js +33 -0
- package/dist/cli/{search-7BMFFZI2.mjs → search-YPGAIFDX.mjs} +8 -8
- package/dist/cli/{search-output-XC2AVBFX.js → search-output-ASELNQ2U.js} +6 -6
- package/dist/cli/{search-output-CALZ4ZI2.mjs → search-output-OOC3VK4T.mjs} +4 -4
- package/dist/cli/{secrets-VHU4B2D4.js → secrets-KX3TQB4R.js} +15 -15
- package/dist/cli/{secrets-7ZHA57DI.mjs → secrets-VJ4XYSMZ.mjs} +6 -6
- package/dist/cli/sessions-KUN7H7E5.mjs +22 -0
- package/dist/cli/sessions-QILPX4XQ.js +22 -0
- package/dist/cli/{settings-WV77QJGD.js → settings-5NIF4BU7.js} +86 -86
- package/dist/cli/{settings-AVY4NNHI.mjs → settings-JKFYZ2IT.mjs} +13 -13
- package/dist/cli/{setup-AOUJ3RMU.mjs → setup-5AX3TN6G.mjs} +10 -10
- package/dist/cli/{setup-GE5TLTC4.js → setup-MYV3IHPS.js} +50 -50
- package/dist/cli/{skills-FVWO2G66.mjs → skills-JLS4CINQ.mjs} +8 -8
- package/dist/cli/skills-NG32XTZI.js +37 -0
- package/dist/cli/tools-OZG3V77R.js +57 -0
- package/dist/cli/{tools-URE655B4.mjs → tools-VBYKD3MJ.mjs} +17 -17
- package/dist/cli/{update-5B4G4345.mjs → update-QWAIVJRI.mjs} +10 -10
- package/dist/cli/update-YL5WVSKU.js +35 -0
- package/dist/cli/{views-GSECJ5IK.mjs → views-TBWGZAVZ.mjs} +6 -6
- package/dist/cli/{views-IC762HEQ.js → views-ZW56JZB5.js} +18 -18
- package/dist/cli/{workflow-EME7ZEOV.js → workflow-EKSZST6M.js} +17 -17
- package/dist/cli/{workflow-6UQM565I.mjs → workflow-X7UQPJMQ.mjs} +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +107 -106
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-K7PMRXNG.js +0 -43
- package/dist/cli/describe-PASXOL3R.js +0 -50
- package/dist/cli/git-UU4YFJ2Q.js +0 -25
- package/dist/cli/search-NH4DTXUK.js +0 -33
- package/dist/cli/sessions-2TE5JWVP.js +0 -18
- package/dist/cli/sessions-YYULWFZE.mjs +0 -18
- package/dist/cli/skills-OL7LD6QX.js +0 -37
- package/dist/cli/tools-VQ5JO6DI.js +0 -57
- package/dist/cli/update-7ZOIOTZN.js +0 -35
|
@@ -17,15 +17,17 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
17
17
|
var _chunkSQWET4SLjs = require('./chunk-SQWET4SL.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk3PQDEBO6js = require('./chunk-3PQDEBO6.js');
|
|
21
21
|
|
|
22
22
|
// src/version.ts
|
|
23
|
-
var SDK_VERSION =
|
|
24
|
-
var SDK_API_MAJOR =
|
|
25
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
23
|
+
var SDK_VERSION = _chunk3PQDEBO6js.SDK_RELEASE.version;
|
|
24
|
+
var SDK_API_MAJOR = _chunk3PQDEBO6js.SDK_RELEASE.contracts.api.currentMajor;
|
|
25
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunk3PQDEBO6js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
26
26
|
|
|
27
27
|
// src/agent-runtime.ts
|
|
28
|
+
var _fs = require('fs');
|
|
28
29
|
var _os = require('os');
|
|
30
|
+
var _path = require('path');
|
|
29
31
|
var EXPLICIT_AGENT_RUNTIMES = /* @__PURE__ */ new Set([
|
|
30
32
|
"claude_code",
|
|
31
33
|
"claude_cowork",
|
|
@@ -65,12 +67,67 @@ function agentSessionIdFromEnvironment(env = process.env, agentRuntime) {
|
|
|
65
67
|
}
|
|
66
68
|
return null;
|
|
67
69
|
}
|
|
70
|
+
var SESSION_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
71
|
+
function isAgentSessionId(value) {
|
|
72
|
+
return SESSION_UUID_RE.test(value);
|
|
73
|
+
}
|
|
74
|
+
function coworkSessionHome(env = process.env, cwd = process.cwd()) {
|
|
75
|
+
const home = _optionalChain([env, 'access', _16 => _16.HOME, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]) || _os.homedir.call(void 0, );
|
|
76
|
+
const path = home === "/sessions" ? cwd : home;
|
|
77
|
+
return _nullishCoalesce(_optionalChain([path, 'access', _19 => _19.match, 'call', _20 => _20(/^\/sessions\/(?!\.\.?(?:\/|$))[^/]+/), 'optionalAccess', _21 => _21[0]]), () => ( null));
|
|
78
|
+
}
|
|
79
|
+
function claudeProjectsRoots(env = process.env, cwd = process.cwd()) {
|
|
80
|
+
const roots = [];
|
|
81
|
+
const configDir = _optionalChain([env, 'access', _22 => _22.CLAUDE_CONFIG_DIR, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]);
|
|
82
|
+
if (configDir) roots.push(_path.join.call(void 0, configDir, "projects"));
|
|
83
|
+
const coworkHome = coworkSessionHome(env, cwd);
|
|
84
|
+
if (coworkHome) roots.push(coworkProjectsRoot(coworkHome));
|
|
85
|
+
roots.push(_path.join.call(void 0, _optionalChain([env, 'access', _25 => _25.HOME, 'optionalAccess', _26 => _26.trim, 'call', _27 => _27()]) || _os.homedir.call(void 0, ), ".claude", "projects"));
|
|
86
|
+
return [...new Set(roots)];
|
|
87
|
+
}
|
|
88
|
+
function coworkProjectsRoot(coworkHome) {
|
|
89
|
+
return _path.join.call(void 0, coworkHome, "mnt", ".claude", "projects");
|
|
90
|
+
}
|
|
91
|
+
function coworkTranscriptFromEnvironment(env = process.env, cwd = process.cwd()) {
|
|
92
|
+
const coworkHome = coworkSessionHome(env, cwd);
|
|
93
|
+
if (!coworkHome) return null;
|
|
94
|
+
const root = coworkProjectsRoot(coworkHome);
|
|
95
|
+
let newest = null;
|
|
96
|
+
for (const project of readDirectoryNames(root)) {
|
|
97
|
+
for (const fileName of readDirectoryNames(_path.join.call(void 0, root, project))) {
|
|
98
|
+
const sessionId = _path.basename.call(void 0, fileName, ".jsonl");
|
|
99
|
+
if (!fileName.endsWith(".jsonl") || !SESSION_UUID_RE.test(sessionId)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const filePath = _path.join.call(void 0, root, project, fileName);
|
|
103
|
+
let mtimeMs;
|
|
104
|
+
try {
|
|
105
|
+
const stat = _fs.statSync.call(void 0, filePath);
|
|
106
|
+
if (!stat.isFile()) continue;
|
|
107
|
+
mtimeMs = stat.mtimeMs;
|
|
108
|
+
} catch (e) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (!newest || mtimeMs > newest.mtimeMs) {
|
|
112
|
+
newest = { sessionId, filePath, mtimeMs };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return newest ? { sessionId: newest.sessionId, filePath: newest.filePath } : null;
|
|
117
|
+
}
|
|
118
|
+
function readDirectoryNames(dir) {
|
|
119
|
+
try {
|
|
120
|
+
return _fs.readdirSync.call(void 0, dir);
|
|
121
|
+
} catch (e2) {
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
68
125
|
function isCoworkLikeSandbox() {
|
|
69
126
|
const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
70
127
|
const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
|
|
71
|
-
const projectDir = Boolean(_optionalChain([process, 'access',
|
|
72
|
-
const pluginRoot = Boolean(_optionalChain([process, 'access',
|
|
73
|
-
const home = _optionalChain([process, 'access',
|
|
128
|
+
const projectDir = Boolean(_optionalChain([process, 'access', _28 => _28.env, 'access', _29 => _29.CLAUDE_PROJECT_DIR, 'optionalAccess', _30 => _30.trim, 'call', _31 => _31()]));
|
|
129
|
+
const pluginRoot = Boolean(_optionalChain([process, 'access', _32 => _32.env, 'access', _33 => _33.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _34 => _34.trim, 'call', _35 => _35()]));
|
|
130
|
+
const home = _optionalChain([process, 'access', _36 => _36.env, 'access', _37 => _37.HOME, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]) || _os.homedir.call(void 0, );
|
|
74
131
|
const sessionHome = home === "/sessions" || home.startsWith("/sessions/");
|
|
75
132
|
return claudeRemote || sessionHome || (pluginMode || pluginRoot) && projectDir;
|
|
76
133
|
}
|
|
@@ -78,22 +135,22 @@ function detectAgentRuntime(options = {}) {
|
|
|
78
135
|
const env = _nullishCoalesce(options.env, () => ( process.env));
|
|
79
136
|
const explicit = normalizeAgentRuntime(env.DEEPLINE_AGENT_RUNTIME);
|
|
80
137
|
if (explicit) return explicit;
|
|
81
|
-
if (_optionalChain([env, 'access',
|
|
138
|
+
if (_optionalChain([env, 'access', _40 => _40.CODEX_THREAD_ID, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()])) return "codex";
|
|
82
139
|
if (options.detectCowork !== false && isCoworkLikeSandbox()) {
|
|
83
140
|
return "claude_cowork";
|
|
84
141
|
}
|
|
85
|
-
if (_optionalChain([env, 'access',
|
|
86
|
-
if (_optionalChain([env, 'access',
|
|
87
|
-
if (_optionalChain([env, 'access',
|
|
142
|
+
if (_optionalChain([env, 'access', _43 => _43.CLAUDECODE, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]) === "1") return "claude_code";
|
|
143
|
+
if (_optionalChain([env, 'access', _46 => _46.CLINE_ACTIVE, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48(), 'access', _49 => _49.toLowerCase, 'call', _50 => _50()]) === "true") return "cline";
|
|
144
|
+
if (_optionalChain([env, 'access', _51 => _51.CURSOR_TRACE_ID, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]) || _optionalChain([env, 'access', _54 => _54.CURSOR_AGENT, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()])) {
|
|
88
145
|
return "cursor";
|
|
89
146
|
}
|
|
90
|
-
if (_optionalChain([env, 'access',
|
|
147
|
+
if (_optionalChain([env, 'access', _57 => _57.WINDSURF, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]) || _optionalChain([env, 'access', _60 => _60.CASCADE, 'optionalAccess', _61 => _61.trim, 'call', _62 => _62()])) {
|
|
91
148
|
return "windsurf";
|
|
92
149
|
}
|
|
93
|
-
if (_optionalChain([env, 'access',
|
|
150
|
+
if (_optionalChain([env, 'access', _63 => _63.ANTIGRAVITY, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()]) || _optionalChain([env, 'access', _66 => _66.ANTIGRAVITY_CLI, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()]) || _optionalChain([env, 'access', _69 => _69.ANTIGRAVITY_AGENT, 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()]) || _optionalChain([env, 'access', _72 => _72.ANTIGRAVITY_WORKSPACE, 'optionalAccess', _73 => _73.trim, 'call', _74 => _74()])) {
|
|
94
151
|
return "antigravity";
|
|
95
152
|
}
|
|
96
|
-
if (_optionalChain([env, 'access',
|
|
153
|
+
if (_optionalChain([env, 'access', _75 => _75.GEMINI_CLI, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]) || _optionalChain([env, 'access', _78 => _78.GEMINI_CLI_VERSION, 'optionalAccess', _79 => _79.trim, 'call', _80 => _80()]) || _optionalChain([env, 'access', _81 => _81.GEMINI_SANDBOX, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]) || _optionalChain([env, 'access', _84 => _84.GEMINI_CONFIG_DIR, 'optionalAccess', _85 => _85.trim, 'call', _86 => _86()])) {
|
|
97
154
|
return "gemini";
|
|
98
155
|
}
|
|
99
156
|
return _nullishCoalesce(options.defaultRuntime, () => ( "unknown"));
|
|
@@ -108,7 +165,7 @@ var fetchWithDeploymentProtection = (input, init) => {
|
|
|
108
165
|
const headers = new Headers(
|
|
109
166
|
input instanceof Request ? input.headers : void 0
|
|
110
167
|
);
|
|
111
|
-
new Headers(_optionalChain([init, 'optionalAccess',
|
|
168
|
+
new Headers(_optionalChain([init, 'optionalAccess', _87 => _87.headers])).forEach((value, name) => headers.set(name, value));
|
|
112
169
|
for (const [name, value] of Object.entries(deploymentProtectionHeaders())) {
|
|
113
170
|
headers.set(name, value);
|
|
114
171
|
}
|
|
@@ -202,7 +259,7 @@ function withErrorCause(error, cause) {
|
|
|
202
259
|
}
|
|
203
260
|
function mapNetworkError(baseUrl, error, targetLabel) {
|
|
204
261
|
const tagged = error;
|
|
205
|
-
const timeoutMs = _optionalChain([tagged, 'optionalAccess',
|
|
262
|
+
const timeoutMs = _optionalChain([tagged, 'optionalAccess', _88 => _88[REQUEST_TIMEOUT_MARKER]]);
|
|
206
263
|
if (typeof timeoutMs === "number") {
|
|
207
264
|
return {
|
|
208
265
|
message: `Request to ${targetLabel} timed out after ${timeoutMs}ms while waiting for a response.`,
|
|
@@ -210,7 +267,7 @@ function mapNetworkError(baseUrl, error, targetLabel) {
|
|
|
210
267
|
details: { timeoutMs, target: targetLabel }
|
|
211
268
|
};
|
|
212
269
|
}
|
|
213
|
-
if (_optionalChain([tagged, 'optionalAccess',
|
|
270
|
+
if (_optionalChain([tagged, 'optionalAccess', _89 => _89[REQUEST_ABORT_MARKER]])) {
|
|
214
271
|
return {
|
|
215
272
|
message: `Request to ${targetLabel} was aborted before it completed.`,
|
|
216
273
|
code: "NETWORK_ABORTED"
|
|
@@ -252,14 +309,14 @@ function isLoopbackHost(hostname) {
|
|
|
252
309
|
return hostname === "localhost" || hostname === "[::1]" || hostname.startsWith("127.") || hostname.endsWith(".localhost");
|
|
253
310
|
}
|
|
254
311
|
function connectionFailureMessage(baseUrl, error) {
|
|
255
|
-
if (!_optionalChain([error, 'optionalAccess',
|
|
312
|
+
if (!_optionalChain([error, 'optionalAccess', _90 => _90.message])) {
|
|
256
313
|
return `Unable to connect to ${baseUrl}. Is the computer able to access the url?`;
|
|
257
314
|
}
|
|
258
315
|
const causeCode = networkCauseCode(error);
|
|
259
316
|
let hostname = "";
|
|
260
317
|
try {
|
|
261
318
|
hostname = new URL(baseUrl).hostname;
|
|
262
|
-
} catch (
|
|
319
|
+
} catch (e3) {
|
|
263
320
|
}
|
|
264
321
|
const blocked = hostname !== "" && !isLoopbackHost(hostname) && causeCode !== void 0 && (BLOCKED_EGRESS_CAUSE_CODES.has(causeCode) || causeCode === "ECONNREFUSED");
|
|
265
322
|
const causeMessage = error.cause instanceof Error ? error.cause.message.slice(0, 200) : "";
|
|
@@ -285,7 +342,7 @@ function networkDiagnosticUrl(value) {
|
|
|
285
342
|
const url = new URL(value);
|
|
286
343
|
if (url.protocol !== "https:" && url.protocol !== "http:") return void 0;
|
|
287
344
|
return `${url.origin}${url.pathname}`;
|
|
288
|
-
} catch (
|
|
345
|
+
} catch (e4) {
|
|
289
346
|
return void 0;
|
|
290
347
|
}
|
|
291
348
|
}
|
|
@@ -316,9 +373,9 @@ var HttpClient = class {
|
|
|
316
373
|
if (explicit) return explicit;
|
|
317
374
|
try {
|
|
318
375
|
return this.cleanDiagnosticHeader(
|
|
319
|
-
_optionalChain([this, 'access',
|
|
376
|
+
_optionalChain([this, 'access', _91 => _91.readLocalSkillsVersion, 'optionalCall', _92 => _92(this.config.baseUrl)])
|
|
320
377
|
);
|
|
321
|
-
} catch (
|
|
378
|
+
} catch (e5) {
|
|
322
379
|
return null;
|
|
323
380
|
}
|
|
324
381
|
}
|
|
@@ -354,15 +411,15 @@ var HttpClient = class {
|
|
|
354
411
|
const coordinatorInternalToken = env.DEEPLINE_INTERNAL_TOKEN;
|
|
355
412
|
const absurdReleaseOverride = env.DEEPLINE_ABSURD_RELEASE;
|
|
356
413
|
const preferredReceiptGatewayMachineId = env.DEEPLINE_PREFERRED_RECEIPT_GATEWAY_MACHINE_ID;
|
|
357
|
-
if (_optionalChain([coordinatorUrl, 'optionalAccess',
|
|
414
|
+
if (_optionalChain([coordinatorUrl, 'optionalAccess', _93 => _93.trim, 'call', _94 => _94()])) {
|
|
358
415
|
headers[COORDINATOR_URL_OVERRIDE_HEADER] = coordinatorUrl.trim();
|
|
359
416
|
}
|
|
360
417
|
const workerCallbackUrl = env.DEEPLINE_WORKER_CALLBACK_URL;
|
|
361
|
-
if (_optionalChain([workerCallbackUrl, 'optionalAccess',
|
|
418
|
+
if (_optionalChain([workerCallbackUrl, 'optionalAccess', _95 => _95.trim, 'call', _96 => _96()])) {
|
|
362
419
|
headers[WORKER_CALLBACK_URL_OVERRIDE_HEADER] = workerCallbackUrl.trim();
|
|
363
420
|
}
|
|
364
421
|
const runtimeSchedulerSchema = env.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA;
|
|
365
|
-
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess',
|
|
422
|
+
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()])) {
|
|
366
423
|
headers[RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER] = runtimeSchedulerSchema.trim();
|
|
367
424
|
}
|
|
368
425
|
const syntheticRun = env.DEEPLINE_SYNTHETIC_RUN;
|
|
@@ -370,21 +427,21 @@ var HttpClient = class {
|
|
|
370
427
|
headers[SYNTHETIC_RUN_HEADER] = "1";
|
|
371
428
|
}
|
|
372
429
|
const runtimeTestFault = env.DEEPLINE_TEST_RUNTIME_FAULT;
|
|
373
|
-
if (_optionalChain([runtimeTestFault, 'optionalAccess',
|
|
430
|
+
if (_optionalChain([runtimeTestFault, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()])) {
|
|
374
431
|
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
375
432
|
}
|
|
376
|
-
const retainedReceivers = _optionalChain([env, 'access',
|
|
377
|
-
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
433
|
+
const retainedReceivers = _optionalChain([env, 'access', _101 => _101.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()]);
|
|
434
|
+
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()])) {
|
|
378
435
|
headers[RETAINED_PIPELINE_RECEIVERS_HEADER] = retainedReceivers;
|
|
379
436
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
380
437
|
}
|
|
381
|
-
if (_optionalChain([absurdReleaseOverride, 'optionalAccess',
|
|
438
|
+
if (_optionalChain([absurdReleaseOverride, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _108 => _108.trim, 'call', _109 => _109()])) {
|
|
382
439
|
headers[ABSURD_RELEASE_OVERRIDE_HEADER] = absurdReleaseOverride.trim();
|
|
383
440
|
}
|
|
384
|
-
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess',
|
|
441
|
+
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()])) {
|
|
385
442
|
headers[PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER] = preferredReceiptGatewayMachineId.trim();
|
|
386
443
|
}
|
|
387
|
-
if (_optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
444
|
+
if (_optionalChain([coordinatorInternalToken, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()]) && (_optionalChain([coordinatorUrl, 'optionalAccess', _116 => _116.trim, 'call', _117 => _117()]) || _optionalChain([workerCallbackUrl, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]) || _optionalChain([runtimeTestFault, 'optionalAccess', _120 => _120.trim, 'call', _121 => _121()]) || _optionalChain([absurdReleaseOverride, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]) || _optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]))) {
|
|
388
445
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
389
446
|
}
|
|
390
447
|
return applyExplicitHeaders(
|
|
@@ -409,23 +466,23 @@ var HttpClient = class {
|
|
|
409
466
|
async request(path, options) {
|
|
410
467
|
const baseUrl = this.config.baseUrl;
|
|
411
468
|
const url = `${baseUrl}${path}`;
|
|
412
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
469
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _126 => _126.method]), () => ( "GET"));
|
|
413
470
|
const requestStartedAt = Date.now();
|
|
414
471
|
let fetchAttempts = 0;
|
|
415
472
|
let lastRequestUrl = url;
|
|
416
473
|
let networkFailedAt;
|
|
417
474
|
let networkPhase = "before_request";
|
|
418
|
-
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess',
|
|
419
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
475
|
+
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess', _127 => _127.headers]));
|
|
476
|
+
if (_optionalChain([options, 'optionalAccess', _128 => _128.body]) !== void 0) {
|
|
420
477
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
421
478
|
}
|
|
422
479
|
let lastError = null;
|
|
423
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
480
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _129 => _129.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
424
481
|
let retryAfterDelayMs = null;
|
|
425
482
|
let totalRetryWaitMs = 0;
|
|
426
|
-
let maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
483
|
+
let maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _130 => _130.maxRetries]), () => ( this.config.maxRetries));
|
|
427
484
|
requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
428
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
485
|
+
if (_optionalChain([options, 'optionalAccess', _131 => _131.signal, 'optionalAccess', _132 => _132.aborted])) {
|
|
429
486
|
lastError = requestCancelledError(options.signal);
|
|
430
487
|
networkFailedAt = Date.now();
|
|
431
488
|
break;
|
|
@@ -440,7 +497,7 @@ var HttpClient = class {
|
|
|
440
497
|
totalRetryWaitMs += delayMs;
|
|
441
498
|
networkPhase = "retry_wait";
|
|
442
499
|
try {
|
|
443
|
-
await sleep(delayMs, _optionalChain([options, 'optionalAccess',
|
|
500
|
+
await sleep(delayMs, _optionalChain([options, 'optionalAccess', _133 => _133.signal]));
|
|
444
501
|
} catch (error) {
|
|
445
502
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
446
503
|
networkFailedAt = Date.now();
|
|
@@ -448,25 +505,25 @@ var HttpClient = class {
|
|
|
448
505
|
}
|
|
449
506
|
}
|
|
450
507
|
for (const candidateUrl of candidateUrls) {
|
|
451
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
508
|
+
if (_optionalChain([options, 'optionalAccess', _134 => _134.signal, 'optionalAccess', _135 => _135.aborted])) {
|
|
452
509
|
lastError = requestCancelledError(options.signal);
|
|
453
510
|
networkFailedAt = Date.now();
|
|
454
511
|
break requestAttempts;
|
|
455
512
|
}
|
|
456
513
|
const controller = new AbortController();
|
|
457
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
514
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _136 => _136.timeout]), () => ( this.config.timeout));
|
|
458
515
|
let requestTimedOut = false;
|
|
459
516
|
const timeoutId = setTimeout(() => {
|
|
460
517
|
requestTimedOut = true;
|
|
461
518
|
controller.abort();
|
|
462
519
|
}, timeoutMs);
|
|
463
520
|
const abortRequest = () => controller.abort();
|
|
464
|
-
_optionalChain([options, 'optionalAccess',
|
|
521
|
+
_optionalChain([options, 'optionalAccess', _137 => _137.signal, 'optionalAccess', _138 => _138.addEventListener, 'call', _139 => _139("abort", abortRequest, {
|
|
465
522
|
once: true
|
|
466
523
|
})]);
|
|
467
524
|
networkPhase = "before_request";
|
|
468
525
|
try {
|
|
469
|
-
const requestBody = _optionalChain([options, 'optionalAccess',
|
|
526
|
+
const requestBody = _optionalChain([options, 'optionalAccess', _140 => _140.formData]) !== void 0 ? typeof options.formData === "function" ? options.formData() : options.formData : _optionalChain([options, 'optionalAccess', _141 => _141.body]) !== void 0 ? JSON.stringify(options.body) : void 0;
|
|
470
527
|
fetchAttempts += 1;
|
|
471
528
|
lastRequestUrl = candidateUrl;
|
|
472
529
|
networkPhase = "awaiting_headers";
|
|
@@ -478,8 +535,8 @@ var HttpClient = class {
|
|
|
478
535
|
redirect: deploymentProtectionRedirect(headers)
|
|
479
536
|
});
|
|
480
537
|
networkPhase = "reading_body";
|
|
481
|
-
_optionalChain([options, 'optionalAccess',
|
|
482
|
-
if (response.status === 404 && _optionalChain([options, 'optionalAccess',
|
|
538
|
+
_optionalChain([options, 'optionalAccess', _142 => _142.onResponse, 'optionalCall', _143 => _143(response)]);
|
|
539
|
+
if (response.status === 404 && _optionalChain([options, 'optionalAccess', _144 => _144.allowNotFound])) {
|
|
483
540
|
clearTimeout(timeoutId);
|
|
484
541
|
return null;
|
|
485
542
|
}
|
|
@@ -487,18 +544,18 @@ var HttpClient = class {
|
|
|
487
544
|
const receivedAtMs = Date.now();
|
|
488
545
|
clearTimeout(timeoutId);
|
|
489
546
|
const parsed = parseResponseBody(body);
|
|
490
|
-
_optionalChain([options, 'optionalAccess',
|
|
547
|
+
_optionalChain([options, 'optionalAccess', _145 => _145.onResponseBody, 'optionalCall', _146 => _146({
|
|
491
548
|
receivedAtMs,
|
|
492
549
|
httpStatus: response.status,
|
|
493
550
|
body: parsed
|
|
494
551
|
})]);
|
|
495
|
-
const responseRetryAllowed = _optionalChain([options, 'optionalAccess',
|
|
552
|
+
const responseRetryAllowed = _optionalChain([options, 'optionalAccess', _147 => _147.retryFromExecutePolicy]) !== true || parseExecuteRetryPolicy(
|
|
496
553
|
response.headers.get(EXECUTE_RETRY_POLICY_HEADER)
|
|
497
554
|
) === "transient-http-safe";
|
|
498
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
555
|
+
if (_optionalChain([options, 'optionalAccess', _148 => _148.retryFromExecutePolicy]) === true && responseRetryAllowed && options.executePolicyMaxRetries !== void 0) {
|
|
499
556
|
maxRetries = options.executePolicyMaxRetries;
|
|
500
557
|
}
|
|
501
|
-
const structuredToolError = _optionalChain([options, 'optionalAccess',
|
|
558
|
+
const structuredToolError = _optionalChain([options, 'optionalAccess', _149 => _149.toolId]) && !response.ok ? _chunkSQWET4SLjs.deserializeToolExecutionFailure.call(void 0,
|
|
502
559
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
503
560
|
isRecord(parsed) ? parsed.tool_error : null,
|
|
504
561
|
_chunkSQWET4SLjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
@@ -520,7 +577,7 @@ var HttpClient = class {
|
|
|
520
577
|
throw _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, structuredToolError, parsed);
|
|
521
578
|
}
|
|
522
579
|
if (response.status === 429) {
|
|
523
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
580
|
+
if (_optionalChain([options, 'optionalAccess', _150 => _150.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
|
|
524
581
|
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
525
582
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
526
583
|
response.status,
|
|
@@ -534,13 +591,13 @@ var HttpClient = class {
|
|
|
534
591
|
retryAfterDelayMs = retryAfter;
|
|
535
592
|
break;
|
|
536
593
|
}
|
|
537
|
-
throw _optionalChain([options, 'optionalAccess',
|
|
594
|
+
throw _optionalChain([options, 'optionalAccess', _151 => _151.toolId]) ? _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, lastError, parsed) : lastError;
|
|
538
595
|
}
|
|
539
596
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
540
597
|
throw new (0, _chunkT2N3B7IQjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
541
598
|
}
|
|
542
599
|
if (!response.ok) {
|
|
543
|
-
const retryableApiError = _optionalChain([options, 'optionalAccess',
|
|
600
|
+
const retryableApiError = _optionalChain([options, 'optionalAccess', _152 => _152.retryApiErrors]) === true && responseRetryAllowed && isRetryableApiErrorResponse(response.status);
|
|
544
601
|
const htmlError = detectHtmlErrorBody(
|
|
545
602
|
body,
|
|
546
603
|
response.headers.get("content-type")
|
|
@@ -572,7 +629,7 @@ var HttpClient = class {
|
|
|
572
629
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
573
630
|
break;
|
|
574
631
|
}
|
|
575
|
-
throw _optionalChain([options, 'optionalAccess',
|
|
632
|
+
throw _optionalChain([options, 'optionalAccess', _153 => _153.toolId]) ? _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, lastError, parsed) : lastError;
|
|
576
633
|
}
|
|
577
634
|
if (typeof parsed === "string") {
|
|
578
635
|
const interstitial = detectHtmlErrorBody(
|
|
@@ -592,7 +649,7 @@ var HttpClient = class {
|
|
|
592
649
|
} catch (error) {
|
|
593
650
|
clearTimeout(timeoutId);
|
|
594
651
|
networkFailedAt = Date.now();
|
|
595
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
652
|
+
if (_optionalChain([options, 'optionalAccess', _154 => _154.signal, 'optionalAccess', _155 => _155.aborted])) {
|
|
596
653
|
lastError = requestCancelledError(options.signal);
|
|
597
654
|
break requestAttempts;
|
|
598
655
|
}
|
|
@@ -607,12 +664,12 @@ var HttpClient = class {
|
|
|
607
664
|
timeoutMs,
|
|
608
665
|
timedOut: requestTimedOut
|
|
609
666
|
});
|
|
610
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
667
|
+
if (_optionalChain([options, 'optionalAccess', _156 => _156.retryFromExecutePolicy]) && options.retryAmbiguousDelivery !== true) {
|
|
611
668
|
break requestAttempts;
|
|
612
669
|
}
|
|
613
670
|
} finally {
|
|
614
671
|
clearTimeout(timeoutId);
|
|
615
|
-
_optionalChain([options, 'optionalAccess',
|
|
672
|
+
_optionalChain([options, 'optionalAccess', _157 => _157.signal, 'optionalAccess', _158 => _158.removeEventListener, 'call', _159 => _159("abort", abortRequest)]);
|
|
616
673
|
}
|
|
617
674
|
}
|
|
618
675
|
if (attempt < maxRetries) continue;
|
|
@@ -639,7 +696,7 @@ var HttpClient = class {
|
|
|
639
696
|
phase: networkPhase
|
|
640
697
|
}
|
|
641
698
|
};
|
|
642
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
699
|
+
if (_optionalChain([options, 'optionalAccess', _160 => _160.toolId])) {
|
|
643
700
|
const code = mappedNetworkError.code;
|
|
644
701
|
throw withErrorCause(
|
|
645
702
|
new (0, _chunkSQWET4SLjs.ToolExecutionError)(
|
|
@@ -691,26 +748,26 @@ var HttpClient = class {
|
|
|
691
748
|
}
|
|
692
749
|
async *streamSse(path, options) {
|
|
693
750
|
const url = `${this.config.baseUrl}${path}`;
|
|
694
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
751
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _161 => _161.method]), () => ( "GET"));
|
|
695
752
|
const headers = this.authHeaders({
|
|
696
753
|
Accept: "text/event-stream",
|
|
697
|
-
..._optionalChain([options, 'optionalAccess',
|
|
754
|
+
..._optionalChain([options, 'optionalAccess', _162 => _162.headers])
|
|
698
755
|
});
|
|
699
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
756
|
+
if (_optionalChain([options, 'optionalAccess', _163 => _163.body]) !== void 0) {
|
|
700
757
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
701
758
|
}
|
|
702
759
|
let lastError = null;
|
|
703
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
760
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _164 => _164.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
704
761
|
for (const candidateUrl of candidateUrls) {
|
|
705
762
|
try {
|
|
706
763
|
const response = await fetch(candidateUrl, {
|
|
707
764
|
method,
|
|
708
765
|
headers,
|
|
709
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
710
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
766
|
+
body: _optionalChain([options, 'optionalAccess', _165 => _165.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
767
|
+
signal: _optionalChain([options, 'optionalAccess', _166 => _166.signal]),
|
|
711
768
|
redirect: deploymentProtectionRedirect(headers)
|
|
712
769
|
});
|
|
713
|
-
_optionalChain([options, 'optionalAccess',
|
|
770
|
+
_optionalChain([options, 'optionalAccess', _167 => _167.onResponse, 'optionalCall', _168 => _168(response)]);
|
|
714
771
|
if (!response.ok) {
|
|
715
772
|
const body = await response.text();
|
|
716
773
|
const parsed = parseResponseBody(body);
|
|
@@ -750,7 +807,7 @@ var HttpClient = class {
|
|
|
750
807
|
throw error;
|
|
751
808
|
}
|
|
752
809
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
753
|
-
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess',
|
|
810
|
+
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _169 => _169.signal, 'optionalAccess', _170 => _170.aborted])) {
|
|
754
811
|
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
755
812
|
`Stream from ${this.config.baseUrl} was aborted by the caller.`,
|
|
756
813
|
void 0,
|
|
@@ -771,7 +828,7 @@ var HttpClient = class {
|
|
|
771
828
|
}
|
|
772
829
|
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
773
830
|
withCoworkNetworkHint(
|
|
774
|
-
_optionalChain([lastError, 'optionalAccess',
|
|
831
|
+
_optionalChain([lastError, 'optionalAccess', _171 => _171.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
|
|
775
832
|
)
|
|
776
833
|
);
|
|
777
834
|
}
|
|
@@ -827,21 +884,21 @@ var HttpClient = class {
|
|
|
827
884
|
function parseResponseBody(body) {
|
|
828
885
|
try {
|
|
829
886
|
return JSON.parse(body);
|
|
830
|
-
} catch (
|
|
887
|
+
} catch (e6) {
|
|
831
888
|
return body;
|
|
832
889
|
}
|
|
833
890
|
}
|
|
834
891
|
function isProviderOriginatedHttpError(parsed) {
|
|
835
892
|
const response = asRecord(parsed);
|
|
836
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
837
|
-
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
838
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
893
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _172 => _172.error]));
|
|
894
|
+
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _173 => _173.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _174 => _174.failure_origin])));
|
|
895
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _175 => _175.code]), () => ( _optionalChain([response, 'optionalAccess', _176 => _176.code])));
|
|
839
896
|
return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
|
|
840
897
|
}
|
|
841
898
|
function isMonitorRateLimitEnvelope(parsed) {
|
|
842
899
|
const response = asRecord(parsed);
|
|
843
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
844
|
-
return (_optionalChain([error, 'optionalAccess',
|
|
900
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _177 => _177.error]));
|
|
901
|
+
return (_optionalChain([error, 'optionalAccess', _178 => _178.code]) === "monitor_upstream_rate_limited" || _optionalChain([error, 'optionalAccess', _179 => _179.code]) === "monitor_preview_rate_limited") && typeof error.message === "string";
|
|
845
902
|
}
|
|
846
903
|
function asRecord(value) {
|
|
847
904
|
return typeof value === "object" && value !== null ? value : null;
|
|
@@ -857,7 +914,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
857
914
|
return null;
|
|
858
915
|
}
|
|
859
916
|
const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
860
|
-
const title = _optionalChain([titleMatch, 'optionalAccess',
|
|
917
|
+
const title = _optionalChain([titleMatch, 'optionalAccess', _180 => _180[1], 'optionalAccess', _181 => _181.replace, 'call', _182 => _182(/\s+/g, " "), 'access', _183 => _183.trim, 'call', _184 => _184()]) || void 0;
|
|
861
918
|
const workerThrewException = /worker threw exception/i.test(trimmed);
|
|
862
919
|
return {
|
|
863
920
|
title,
|
|
@@ -897,7 +954,7 @@ function buildCandidateUrls(url) {
|
|
|
897
954
|
candidates.push(loopback.toString());
|
|
898
955
|
}
|
|
899
956
|
return [...new Set(candidates)];
|
|
900
|
-
} catch (
|
|
957
|
+
} catch (e7) {
|
|
901
958
|
return [url];
|
|
902
959
|
}
|
|
903
960
|
}
|
|
@@ -941,20 +998,20 @@ function decodeSseFrame(frame) {
|
|
|
941
998
|
}
|
|
942
999
|
function sleep(ms, signal) {
|
|
943
1000
|
return new Promise((resolve, reject) => {
|
|
944
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1001
|
+
if (_optionalChain([signal, 'optionalAccess', _185 => _185.aborted])) {
|
|
945
1002
|
reject(requestCancelledError(signal));
|
|
946
1003
|
return;
|
|
947
1004
|
}
|
|
948
1005
|
const timeoutId = setTimeout(() => {
|
|
949
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1006
|
+
_optionalChain([signal, 'optionalAccess', _186 => _186.removeEventListener, 'call', _187 => _187("abort", abort)]);
|
|
950
1007
|
resolve();
|
|
951
1008
|
}, ms);
|
|
952
1009
|
const abort = () => {
|
|
953
1010
|
clearTimeout(timeoutId);
|
|
954
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1011
|
+
_optionalChain([signal, 'optionalAccess', _188 => _188.removeEventListener, 'call', _189 => _189("abort", abort)]);
|
|
955
1012
|
reject(requestCancelledError(signal));
|
|
956
1013
|
};
|
|
957
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1014
|
+
_optionalChain([signal, 'optionalAccess', _190 => _190.addEventListener, 'call', _191 => _191("abort", abort, { once: true })]);
|
|
958
1015
|
});
|
|
959
1016
|
}
|
|
960
1017
|
function withCoworkNetworkHint(message) {
|
|
@@ -980,4 +1037,7 @@ ${COWORK_NETWORK_HINT}`;
|
|
|
980
1037
|
|
|
981
1038
|
|
|
982
1039
|
|
|
983
|
-
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
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.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.agentSessionIdFromEnvironment = agentSessionIdFromEnvironment; exports.isAgentSessionId = isAgentSessionId; exports.claudeProjectsRoots = claudeProjectsRoots; exports.coworkTranscriptFromEnvironment = coworkTranscriptFromEnvironment; exports.detectAgentRuntime = detectAgentRuntime; exports.deploymentProtectionHeaders = deploymentProtectionHeaders; exports.fetchWithDeploymentProtection = fetchWithDeploymentProtection; exports.networkCauseCode = networkCauseCode; exports.connectionFailureMessage = connectionFailureMessage; exports.HttpClient = HttpClient;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
HttpClient,
|
|
3
3
|
resolveCliCommandContext,
|
|
4
4
|
resolveConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-77VNC2KF.mjs";
|
|
6
6
|
import {
|
|
7
7
|
detectAgentRuntime
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-P5ZU5ZHA.mjs";
|
|
9
9
|
import {
|
|
10
10
|
DeeplineError,
|
|
11
11
|
readToolUpstreamResponse,
|
|
@@ -31,7 +31,7 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkJSEISVAZjs = require('./chunk-JSEISVAZ.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
var _chunkT2N3B7IQjs = require('./chunk-T2N3B7IQ.js');
|
|
@@ -674,7 +674,7 @@ var ToolCalls = class {
|
|
|
674
674
|
idempotencyKey,
|
|
675
675
|
onResponse: (response2) => {
|
|
676
676
|
lastResponse = null;
|
|
677
|
-
atomicToolsSupported = response2.headers.get(
|
|
677
|
+
atomicToolsSupported = response2.headers.get(_chunkJSEISVAZjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
|
|
678
678
|
recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
679
679
|
if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
|
|
680
680
|
try {
|
|
@@ -1060,8 +1060,8 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
const receivers = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
|
|
1062
1062
|
return {
|
|
1063
|
-
[
|
|
1064
|
-
...receivers ? { [
|
|
1063
|
+
[_chunkJSEISVAZjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
1064
|
+
...receivers ? { [_chunkJSEISVAZjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
1067
|
function normalizeTestPolicyOverrides(value, source) {
|
|
@@ -1132,7 +1132,7 @@ var PlayClient = class {
|
|
|
1132
1132
|
return _chunk2KHUFWTKjs.startPlayRun.call(void 0,
|
|
1133
1133
|
this.http,
|
|
1134
1134
|
resolved.request,
|
|
1135
|
-
_optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(
|
|
1135
|
+
_optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkJSEISVAZjs.SDK_API_MAJOR) } : headers,
|
|
1136
1136
|
options
|
|
1137
1137
|
);
|
|
1138
1138
|
}
|
|
@@ -3229,7 +3229,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
3229
3229
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
3230
3230
|
);
|
|
3231
3231
|
}
|
|
3232
|
-
return { [
|
|
3232
|
+
return { [_chunkJSEISVAZjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
3233
3233
|
}
|
|
3234
3234
|
function sleep(ms) {
|
|
3235
3235
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -4156,7 +4156,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4156
4156
|
);
|
|
4157
4157
|
const headers = _optionalChain([options, 'optionalAccess', _188 => _188.cliAdmission]) ? {
|
|
4158
4158
|
...runtimeHeaders,
|
|
4159
|
-
"X-Deepline-API-Major": String(
|
|
4159
|
+
"X-Deepline-API-Major": String(_chunkJSEISVAZjs.SDK_API_MAJOR)
|
|
4160
4160
|
} : runtimeHeaders;
|
|
4161
4161
|
const http = this.http;
|
|
4162
4162
|
let submitted = false;
|