deepline 0.3.514 → 0.3.516
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/errors.ts +1 -0
- package/dist/bundling-sources/sdk/src/http-core.ts +9 -4
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +30 -15
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +71 -1
- package/dist/bundling-sources/shared_libs/play-runtime/secret-redaction.ts +20 -7
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +3 -1
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +45 -0
- package/dist/bundling-sources/shared_libs/tool-execution-error.ts +45 -0
- package/dist/cli/{artifacts-GNFL5LY4.mjs → artifacts-G56FISIE.mjs} +9 -9
- package/dist/cli/{artifacts-OZRO4LHT.js → artifacts-KMWS32R5.js} +21 -21
- package/dist/cli/auth-6EIEZ3UE.js +43 -0
- package/dist/cli/{auth-53EDAX7Y.mjs → auth-RSS7MOBV.mjs} +7 -7
- package/dist/cli/{billing-ZMX2V5X3.mjs → billing-2ALO3XEG.mjs} +10 -10
- package/dist/cli/{billing-B6V3FELL.js → billing-RCC6WBIZ.js} +93 -93
- package/dist/cli/{chunk-753MZFDF.mjs → chunk-2YEFJHAF.mjs} +3 -3
- package/dist/cli/{chunk-BBDWIUJA.js → chunk-4IIK6GIY.js} +17 -17
- package/dist/cli/{chunk-DMBCJFGY.mjs → chunk-5NU37KME.mjs} +2 -2
- package/dist/cli/{chunk-Z5WO6IBV.mjs → chunk-6ADGVZRX.mjs} +21 -6
- package/dist/cli/{chunk-RNSHCJME.js → chunk-6Y3DDRRN.js} +30 -30
- package/dist/cli/{chunk-NXT52SIV.js → chunk-6ZLL5GDN.js} +2 -2
- package/dist/cli/{chunk-QSFAUGFK.js → chunk-72L5HQ3J.js} +5 -5
- package/dist/cli/{chunk-DLYWOHO4.mjs → chunk-72MFP7V4.mjs} +1 -1
- package/dist/cli/{chunk-MF7ZVWJK.js → chunk-7R2V5Z6O.js} +41 -41
- package/dist/cli/{chunk-W3TN352L.mjs → chunk-C2SR3X7Y.mjs} +4 -4
- package/dist/cli/{chunk-76M3DL5G.mjs → chunk-C72J6JE3.mjs} +1 -1
- package/dist/cli/{chunk-RMRZ4BC4.mjs → chunk-CA24C3XL.mjs} +4 -4
- package/dist/cli/{chunk-2RCZCWPO.js → chunk-CKEZXNMV.js} +6 -6
- package/dist/cli/{chunk-C24VEYSP.js → chunk-D4OZSC3C.js} +8 -4
- package/dist/cli/{chunk-EVTD3ELD.mjs → chunk-E7ZM2ZRD.mjs} +5 -5
- package/dist/cli/{chunk-MJIS4XAZ.mjs → chunk-EYWP5JPU.mjs} +4 -4
- package/dist/cli/{chunk-TG4IMWAL.js → chunk-FIIBDWAO.js} +55 -55
- package/dist/cli/{chunk-7MJYZ33I.mjs → chunk-GJYLC4JB.mjs} +1 -1
- package/dist/cli/{chunk-7MBI2OLW.mjs → chunk-H6BSB2YJ.mjs} +1 -1
- package/dist/cli/{chunk-N4TR6QRI.mjs → chunk-HT675XNR.mjs} +1 -1
- package/dist/cli/{chunk-IZJGOMCW.mjs → chunk-HY6KAW5H.mjs} +5 -5
- package/dist/cli/{chunk-ILITNKGM.mjs → chunk-J4VMWSQK.mjs} +7 -7
- package/dist/cli/{chunk-TZS4G7CS.js → chunk-JB6FEEDQ.js} +2 -2
- package/dist/cli/{chunk-6FYGFIXD.mjs → chunk-JPLEDOEW.mjs} +2 -2
- package/dist/cli/{chunk-7ZCXQDOQ.mjs → chunk-LCKAG5RL.mjs} +2 -2
- package/dist/cli/{chunk-RVMV4MXO.mjs → chunk-LWUFEX26.mjs} +3 -3
- package/dist/cli/{chunk-FPWOEK7G.js → chunk-LZROM6VQ.js} +2 -2
- package/dist/cli/{chunk-RLVSWAWB.js → chunk-N6Q5SDGA.js} +62 -51
- package/dist/cli/{chunk-A6QCMBGL.js → chunk-NRO3NTVO.js} +5 -5
- package/dist/cli/{chunk-VLIDBQYL.js → chunk-P6AADORO.js} +3 -3
- package/dist/cli/{chunk-55WBE4UK.js → chunk-PKKSXXZ5.js} +26 -26
- package/dist/cli/{chunk-G6PUQQJP.js → chunk-PMS3LQ6B.js} +5 -5
- package/dist/cli/{chunk-JC3ABOZP.js → chunk-PPYJXP4Z.js} +38 -23
- package/dist/cli/{chunk-6SSISVXD.mjs → chunk-PVVWKOEB.mjs} +8 -7
- package/dist/cli/{chunk-DBBLPDXK.mjs → chunk-Q47MAAHI.mjs} +1 -1
- package/dist/cli/{chunk-2CTTSNFE.js → chunk-QG3MRMU5.js} +58 -57
- package/dist/cli/{chunk-53F6JDQ3.mjs → chunk-QG4LIOGI.mjs} +2 -2
- package/dist/cli/{chunk-4QF2K7TM.mjs → chunk-QNHHZ63P.mjs} +1 -1
- package/dist/cli/{chunk-A253CMOI.js → chunk-QUSYG3VP.js} +8 -8
- package/dist/cli/{chunk-T4NQ2ZOH.js → chunk-QX7WDG4V.js} +11 -11
- package/dist/cli/{chunk-MQK5SY5N.js → chunk-RB3OR32I.js} +16 -16
- package/dist/cli/{chunk-RFN7OKT2.mjs → chunk-RB5EMAWD.mjs} +1 -1
- package/dist/cli/{chunk-WP3ULMRU.js → chunk-RLI6FDQM.js} +6 -6
- package/dist/cli/{chunk-TMQUMILM.js → chunk-RVHUW4TN.js} +2 -2
- package/dist/cli/{chunk-DIAWYWT5.js → chunk-SQWET4SL.js} +18 -1
- package/dist/cli/{chunk-OZDT2CZW.mjs → chunk-STR5LXK4.mjs} +1 -1
- package/dist/cli/{chunk-ALJJRZNJ.js → chunk-T2N3B7IQ.js} +8 -8
- package/dist/cli/{chunk-OQ4JV3IW.js → chunk-TZNQRKDF.js} +1 -1
- package/dist/cli/{chunk-CUMA6DE2.js → chunk-UW5QWTUG.js} +19 -19
- package/dist/cli/{chunk-G6A7CGFV.mjs → chunk-V46UBZBJ.mjs} +6 -3
- package/dist/cli/{chunk-R5PJ6XZI.js → chunk-VIZJIBI4.js} +10 -10
- package/dist/cli/{chunk-Y2RIMVEM.js → chunk-W5I53WQ4.js} +112 -112
- package/dist/cli/{chunk-H7L5MS5E.mjs → chunk-WCQ7JGDV.mjs} +4 -4
- package/dist/cli/{chunk-7KD4IYLA.js → chunk-WE223LFR.js} +19 -19
- package/dist/cli/{chunk-H53YG6QG.mjs → chunk-X2YP36YP.mjs} +1 -1
- package/dist/cli/{chunk-LV2DGEJ3.js → chunk-XEQBYK4B.js} +16 -13
- package/dist/cli/{chunk-5LBXLQRW.js → chunk-YS7AI7R6.js} +108 -108
- package/dist/cli/{chunk-HJ5B67S3.mjs → chunk-YXGTO5XA.mjs} +8 -4
- package/dist/cli/{chunk-54IH5U3I.mjs → chunk-Z3KLCDCB.mjs} +23 -12
- package/dist/cli/{chunk-6OIRN4PC.mjs → chunk-ZFRN3B2R.mjs} +2 -2
- package/dist/cli/{chunk-EO52BKGA.mjs → chunk-ZMCQP4EU.mjs} +11 -11
- package/dist/cli/{chunk-HBL4PM5Q.mjs → chunk-ZPGGW27Q.mjs} +17 -0
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-2BLYUV2G.js → csv-RPR64UBS.js} +15 -15
- package/dist/cli/{csv-ONKAMLL4.mjs → csv-YXK5TB47.mjs} +6 -6
- package/dist/cli/{db-YKT6LEQ3.js → db-KO3JCGRG.js} +36 -36
- package/dist/cli/{db-4GVSGAXL.mjs → db-UQYILAMF.mjs} +9 -9
- package/dist/cli/describe-BPX3U2BF.js +50 -0
- package/dist/cli/describe-P2OK5X2S.mjs +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +4 -4
- package/dist/cli/describe-core.mjs +3 -3
- package/dist/cli/{executions-VFCU5NGH.js → executions-5Z7H7HV3.js} +11 -11
- package/dist/cli/{executions-7OSL25KJ.mjs → executions-IQCRQXVA.mjs} +9 -9
- package/dist/cli/{feedback-ERTOLEC4.js → feedback-EDZJDARP.js} +12 -12
- package/dist/cli/{feedback-RPZELEA5.mjs → feedback-ZO6A4HTV.mjs} +7 -7
- package/dist/cli/{git-XKRQZ4A6.mjs → git-OBXSILWM.mjs} +7 -7
- package/dist/cli/git-Y34J73QC.js +25 -0
- package/dist/cli/index.js +150 -150
- package/dist/cli/index.mjs +46 -46
- package/dist/cli/{legacy-noops-MZCFS2FQ.mjs → legacy-noops-4UJM3FMN.mjs} +8 -8
- package/dist/cli/{legacy-noops-HG3M5HGZ.js → legacy-noops-HKXU2EU6.js} +11 -11
- package/dist/cli/{monitors-MESMMU5P.js → monitors-7EP3Q2DX.js} +110 -110
- package/dist/cli/{monitors-GBO5XAEZ.mjs → monitors-ZXF2KCW7.mjs} +10 -10
- package/dist/cli/{org-DJRNWIPO.mjs → org-EDHCUR6V.mjs} +9 -9
- package/dist/cli/{org-EZPREEWH.js → org-GFGOTUWP.js} +75 -75
- package/dist/cli/{pages-36BHVOFL.mjs → pages-EGEWMPJN.mjs} +9 -9
- package/dist/cli/{pages-ACI7VV6I.js → pages-TLFQQL5S.js} +21 -21
- package/dist/cli/{play-SUSVQHX5.mjs → play-NBO3MPDL.mjs} +22 -22
- package/dist/cli/{play-KCLLAGWR.js → play-XDHJY5R4.js} +392 -392
- package/dist/cli/{providers-MV2YW3J5.mjs → providers-NXJ7WPNH.mjs} +9 -9
- package/dist/cli/{providers-YFO3EFLK.js → providers-RU6BGEDM.js} +12 -12
- package/dist/cli/{quickstart-MATFTZVQ.js → quickstart-4ZZBMZPF.js} +8 -8
- package/dist/cli/{quickstart-KMXU2T3Z.mjs → quickstart-YBNDPNAR.mjs} +6 -6
- package/dist/cli/{run-UW5FM64G.js → run-374CTJBV.js} +46 -46
- package/dist/cli/{run-YRYVGUCJ.mjs → run-LX52KVZM.mjs} +27 -27
- package/dist/cli/{search-WF3Q3I5X.mjs → search-EH6JPV62.mjs} +11 -11
- package/dist/cli/search-YS4DHSQC.js +33 -0
- package/dist/cli/{search-output-BG743WAM.js → search-output-NATLJOWW.js} +9 -9
- package/dist/cli/{search-output-THOAHTCU.mjs → search-output-XIQERUHF.mjs} +7 -7
- package/dist/cli/{secrets-EOGBWN44.js → secrets-A3UXDE5V.js} +18 -18
- package/dist/cli/{secrets-LM7OTAUE.mjs → secrets-VRJQFUKF.mjs} +9 -9
- package/dist/cli/sessions-5TTH5FGZ.mjs +18 -0
- package/dist/cli/sessions-EXII5VOV.js +18 -0
- package/dist/cli/{settings-OWE3EEG7.js → settings-LX5EGLVT.js} +89 -89
- package/dist/cli/{settings-JXTFX5G2.mjs → settings-VRGFTOTJ.mjs} +16 -16
- package/dist/cli/{setup-FG37SKMB.mjs → setup-FXP5Y3Y6.mjs} +12 -12
- package/dist/cli/{setup-Z5BEQKA7.js → setup-QL4YWKOR.js} +52 -52
- package/dist/cli/skills-5L4CYX3V.js +37 -0
- package/dist/cli/{skills-UGNCBZTJ.mjs → skills-ET4PMBJE.mjs} +10 -10
- package/dist/cli/tools-5V77VIUA.js +57 -0
- package/dist/cli/{tools-J3PKLQSL.mjs → tools-WPL3NZAA.mjs} +20 -20
- package/dist/cli/update-G5RSSWM5.js +35 -0
- package/dist/cli/{update-GGZ2XTMZ.mjs → update-OCAHAKL2.mjs} +12 -12
- package/dist/cli/{workflow-AUZCSCZP.js → workflow-CWO3XL4O.js} +20 -20
- package/dist/cli/{workflow-C66BBXHH.mjs → workflow-NPZ2RLQG.mjs} +10 -10
- package/dist/{client-CmlKSBXd.d.ts → client-CQSPuqxh.d.ts} +1 -1
- package/dist/{client-By7bUS8h.d.mts → client-K1g4ab5Y.d.mts} +1 -1
- package/dist/{client-core-BZ3tpY_J.d.mts → client-core-BksGf5Gd.d.mts} +1 -1
- package/dist/{client-core-BM0mKhgp.d.ts → client-core-BlaqOlQ7.d.ts} +1 -1
- package/dist/{compiler-manifest-BeURaD5Y.d.mts → compiler-manifest-BliMS7ax.d.mts} +14 -1
- package/dist/{compiler-manifest-BeURaD5Y.d.ts → compiler-manifest-BliMS7ax.d.ts} +14 -1
- package/dist/{errors-kBuT4kGK.d.mts → errors-BZ6Zq1cz.d.mts} +1 -1
- package/dist/{errors-BoPXPrSy.d.ts → errors-xfNscfS1.d.ts} +1 -1
- package/dist/{index-DC7oRAAC.d.mts → index-DbvCg4zg.d.mts} +1 -1
- package/dist/{index-D0crdGM1.d.ts → index-FGdQv8J8.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +13 -13
- package/dist/index.mjs +9 -9
- package/dist/install-integrity.json +126 -126
- 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 +1 -1
- 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 +3 -3
- package/dist/plays/run-request.mjs +2 -2
- 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.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +12 -12
- package/dist/server.mjs +6 -6
- package/package.json +1 -1
- package/dist/cli/auth-SM5GLO45.js +0 -43
- package/dist/cli/describe-KPGQP4LH.js +0 -50
- package/dist/cli/describe-PRT2WQMS.mjs +0 -50
- package/dist/cli/git-U353JURQ.js +0 -25
- package/dist/cli/search-4ZQOFG7G.js +0 -33
- package/dist/cli/sessions-GDSJ72XI.js +0 -18
- package/dist/cli/sessions-SP2JL27H.mjs +0 -18
- package/dist/cli/skills-SIX5OTNX.js +0 -37
- package/dist/cli/tools-EZOV37MQ.js +0 -57
- package/dist/cli/update-ISU7YN34.js +0 -35
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkRB3OR32Ijs = require('./chunk-RB3OR32I.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var _chunkRLVSWAWBjs = require('./chunk-RLVSWAWB.js');
|
|
11
10
|
|
|
11
|
+
var _chunkN6Q5SDGAjs = require('./chunk-N6Q5SDGA.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var _chunkLV2DGEJ3js = require('./chunk-LV2DGEJ3.js');
|
|
15
14
|
|
|
15
|
+
var _chunkXEQBYK4Bjs = require('./chunk-XEQBYK4B.js');
|
|
16
16
|
|
|
17
|
-
var _chunkA253CMOIjs = require('./chunk-A253CMOI.js');
|
|
18
17
|
|
|
18
|
+
var _chunkQUSYG3VPjs = require('./chunk-QUSYG3VP.js');
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
var _chunkQG3MRMU5js = require('./chunk-QG3MRMU5.js');
|
|
21
22
|
|
|
22
23
|
// src/cli/compatibility-catalog.ts
|
|
23
24
|
var readers = /* @__PURE__ */ new WeakMap();
|
|
@@ -44,7 +45,7 @@ function trustedAutoUpdateRegistryUrl(baseUrl) {
|
|
|
44
45
|
async function reportAutoUpdateEvent(input) {
|
|
45
46
|
let apiKey = "";
|
|
46
47
|
try {
|
|
47
|
-
apiKey =
|
|
48
|
+
apiKey = _chunkQUSYG3VPjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
|
|
48
49
|
} catch (e2) {
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
@@ -60,15 +61,15 @@ async function reportAutoUpdateEvent(input) {
|
|
|
60
61
|
headers: {
|
|
61
62
|
Authorization: `Bearer ${apiKey}`,
|
|
62
63
|
"Content-Type": "application/json",
|
|
63
|
-
"User-Agent": `deepline-ts-sdk/${
|
|
64
|
+
"User-Agent": `deepline-ts-sdk/${_chunkQG3MRMU5js.SDK_VERSION}`,
|
|
64
65
|
"X-Deepline-Client-Family": "sdk",
|
|
65
66
|
"X-Deepline-CLI-Family": "sdk",
|
|
66
|
-
"X-Deepline-CLI-Version":
|
|
67
|
-
"X-Deepline-SDK-Version":
|
|
67
|
+
"X-Deepline-CLI-Version": _chunkQG3MRMU5js.SDK_VERSION,
|
|
68
|
+
"X-Deepline-SDK-Version": _chunkQG3MRMU5js.SDK_VERSION
|
|
68
69
|
},
|
|
69
70
|
body: JSON.stringify({
|
|
70
71
|
event: input.event,
|
|
71
|
-
current_version: _optionalChain([input, 'access', _4 => _4.response, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) ||
|
|
72
|
+
current_version: _optionalChain([input, 'access', _4 => _4.response, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) || _chunkQG3MRMU5js.SDK_VERSION,
|
|
72
73
|
target_version: input.response.latest,
|
|
73
74
|
reason: _optionalChain([input, 'access', _8 => _8.response, 'access', _9 => _9.auto_update, 'optionalAccess', _10 => _10.reason]),
|
|
74
75
|
command: _nullishCoalesce(input.response.command, () => ( null)),
|
|
@@ -87,13 +88,13 @@ function envTruthy(name) {
|
|
|
87
88
|
return value === "1" || value === "true" || value === "yes";
|
|
88
89
|
}
|
|
89
90
|
function shouldSkipSelfUpdate(policy) {
|
|
90
|
-
return policy === "off" || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !
|
|
91
|
+
return policy === "off" || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !_chunkRB3OR32Ijs.shouldRunCliAutoUpdate.call(void 0, ) || _chunkN6Q5SDGAjs.isCiEnvironment.call(void 0, );
|
|
91
92
|
}
|
|
92
93
|
function isDowngradeAutoUpdateResponse(response) {
|
|
93
94
|
const target = _optionalChain([response, 'optionalAccess', _17 => _17.latest, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]);
|
|
94
|
-
const current = _optionalChain([response, 'optionalAccess', _20 => _20.current, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) ||
|
|
95
|
+
const current = _optionalChain([response, 'optionalAccess', _20 => _20.current, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) || _chunkQG3MRMU5js.SDK_VERSION;
|
|
95
96
|
if (!target) return false;
|
|
96
|
-
return
|
|
97
|
+
return _chunkRB3OR32Ijs.compareUpdateVersions.call(void 0, target, current) < 0;
|
|
97
98
|
}
|
|
98
99
|
function relaunchCurrentCommand(plan, runtime = {}) {
|
|
99
100
|
return new Promise((resolve) => {
|
|
@@ -146,7 +147,7 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
|
|
|
146
147
|
}
|
|
147
148
|
if (isDowngradeAutoUpdateResponse(response)) {
|
|
148
149
|
const target = response.latest;
|
|
149
|
-
const current = _optionalChain([response, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) ||
|
|
150
|
+
const current = _optionalChain([response, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) || _chunkQG3MRMU5js.SDK_VERSION;
|
|
150
151
|
process.stderr.write(
|
|
151
152
|
`Deepline SDK/CLI auto-update refused: server advertised older ${target} than current ${current}. Continuing without mutating the CLI.
|
|
152
153
|
`
|
|
@@ -154,21 +155,21 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
|
|
|
154
155
|
return false;
|
|
155
156
|
}
|
|
156
157
|
const packageSpec = response.latest ? `deepline@${response.latest}` : void 0;
|
|
157
|
-
const plan =
|
|
158
|
+
const plan = _chunkRB3OR32Ijs.resolveUpdatePlan.call(void 0, {
|
|
158
159
|
packageSpec,
|
|
159
160
|
requireVerifiedNpmOwnership: true,
|
|
160
161
|
npmFallbackRegistryUrl: trustedAutoUpdateRegistryUrl(baseUrl)
|
|
161
162
|
});
|
|
162
|
-
if (!
|
|
163
|
+
if (!_chunkRB3OR32Ijs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) {
|
|
163
164
|
return false;
|
|
164
165
|
}
|
|
165
166
|
if (!autoUpdate.required && autoUpdate.reason !== "rollback_forced") {
|
|
166
167
|
deferredAutoUpdate = async () => {
|
|
167
168
|
await applyAutoUpdate(response, baseUrl, plan, "next_command");
|
|
168
169
|
};
|
|
169
|
-
if (
|
|
170
|
+
if (_chunkXEQBYK4Bjs.isJsonOutputMode.call(void 0, )) {
|
|
170
171
|
const target = _optionalChain([response, 'access', _29 => _29.latest, 'optionalAccess', _30 => _30.trim, 'call', _31 => _31()]);
|
|
171
|
-
|
|
172
|
+
_chunkXEQBYK4Bjs.addJsonNotice.call(void 0, {
|
|
172
173
|
code: "sdk_update_queued",
|
|
173
174
|
message: `Deepline SDK/CLI update${target ? ` to ${target}` : ""} is queued after this command; the next command will use it if installation succeeds.`
|
|
174
175
|
});
|
|
@@ -181,7 +182,7 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
|
|
|
181
182
|
return true;
|
|
182
183
|
}
|
|
183
184
|
async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
|
|
184
|
-
if (!
|
|
185
|
+
if (!_chunkRB3OR32Ijs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) return false;
|
|
185
186
|
const autoUpdate = response.auto_update;
|
|
186
187
|
const label = _optionalChain([autoUpdate, 'optionalAccess', _32 => _32.reason]) === "rollback_forced" ? "has a server rollback pending and needs the latest rollback-aware CLI" : _optionalChain([autoUpdate, 'optionalAccess', _33 => _33.reason]) === "deprecated" ? "is deprecated and will update automatically" : _optionalChain([autoUpdate, 'optionalAccess', _34 => _34.required]) ? "requires an update" : "has an update available and will update automatically";
|
|
187
188
|
process.stderr.write(
|
|
@@ -194,7 +195,7 @@ async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
|
|
|
194
195
|
event: "started",
|
|
195
196
|
installKind: plan.kind
|
|
196
197
|
});
|
|
197
|
-
const updateResult = await
|
|
198
|
+
const updateResult = await _chunkRB3OR32Ijs.runAutomaticUpdatePlan.call(void 0, plan);
|
|
198
199
|
if (updateResult.status === "skipped_previous_failure") {
|
|
199
200
|
void reportAutoUpdateEvent({
|
|
200
201
|
baseUrl,
|
|
@@ -231,6 +232,20 @@ async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
|
|
|
231
232
|
installKind: plan.kind,
|
|
232
233
|
exitCode: 0
|
|
233
234
|
});
|
|
235
|
+
try {
|
|
236
|
+
await _chunkN6Q5SDGAjs.syncSdkSkillsIfNeeded.call(void 0, baseUrl, {
|
|
237
|
+
mode: "detached",
|
|
238
|
+
update: _optionalChain([response, 'access', _36 => _36.skills, 'optionalAccess', _37 => _37.requires_cli_update]) ? void 0 : response.skills,
|
|
239
|
+
afterCliUpdate: {
|
|
240
|
+
sidecarPath: plan.kind === "python-sidecar" ? plan.sidecarPath : void 0
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
} catch (error) {
|
|
244
|
+
process.stderr.write(
|
|
245
|
+
`Deepline SDK/CLI updated, but could not start the skills refresh: ${error instanceof Error ? error.message : String(error)}
|
|
246
|
+
`
|
|
247
|
+
);
|
|
248
|
+
}
|
|
234
249
|
const updateSummary = response.update_summary ? `
|
|
235
250
|
What changed in ${response.update_summary.version}: ${response.update_summary.summary}` : "";
|
|
236
251
|
process.stderr.write(
|
|
@@ -245,7 +260,7 @@ var _crypto = require('crypto');
|
|
|
245
260
|
var TOOL_EXECUTE_PROGRESS_INTERVAL_MS = 15e3;
|
|
246
261
|
var activeToolExecuteCommand = null;
|
|
247
262
|
function progressLine(line) {
|
|
248
|
-
if (!
|
|
263
|
+
if (!_chunkXEQBYK4Bjs.isJsonOutputMode.call(void 0, )) console.error(line);
|
|
249
264
|
}
|
|
250
265
|
function beginToolExecuteCommand() {
|
|
251
266
|
if (activeToolExecuteCommand) return activeToolExecuteCommand.invocationId;
|
|
@@ -258,7 +273,7 @@ function beginToolExecuteCommand() {
|
|
|
258
273
|
return invocationId;
|
|
259
274
|
}
|
|
260
275
|
function getToolExecuteInvocationId() {
|
|
261
|
-
return _nullishCoalesce(_optionalChain([activeToolExecuteCommand, 'optionalAccess',
|
|
276
|
+
return _nullishCoalesce(_optionalChain([activeToolExecuteCommand, 'optionalAccess', _38 => _38.invocationId]), () => ( null));
|
|
262
277
|
}
|
|
263
278
|
async function runToolExecuteStage(stage, action) {
|
|
264
279
|
const command = activeToolExecuteCommand;
|
|
@@ -271,7 +286,7 @@ async function runToolExecuteStage(stage, action) {
|
|
|
271
286
|
`[tool call ${command.invocationId}] ${stage} still running (${elapsedMs()}ms)`
|
|
272
287
|
);
|
|
273
288
|
}, TOOL_EXECUTE_PROGRESS_INTERVAL_MS);
|
|
274
|
-
_optionalChain([progressTimer, 'access',
|
|
289
|
+
_optionalChain([progressTimer, 'access', _39 => _39.unref, 'optionalCall', _40 => _40()]);
|
|
275
290
|
try {
|
|
276
291
|
const result = await action();
|
|
277
292
|
if (result === false) {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
AuthError,
|
|
3
3
|
RateLimitError,
|
|
4
4
|
ToolRateLimitError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QNHHZ63P.mjs";
|
|
6
6
|
import {
|
|
7
7
|
apiErrorCodeFromResponse,
|
|
8
8
|
apiErrorMessage
|
|
@@ -11,12 +11,13 @@ import {
|
|
|
11
11
|
DeeplineError,
|
|
12
12
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
13
13
|
ToolExecutionError,
|
|
14
|
+
attachToolUpstreamResponse,
|
|
14
15
|
deserializeToolExecutionFailure,
|
|
15
16
|
serializeToolExecutionFailure
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZPGGW27Q.mjs";
|
|
17
18
|
import {
|
|
18
19
|
SDK_RELEASE
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-C72J6JE3.mjs";
|
|
20
21
|
|
|
21
22
|
// src/version.ts
|
|
22
23
|
var SDK_VERSION = SDK_RELEASE.version;
|
|
@@ -508,9 +509,9 @@ var HttpClient = class {
|
|
|
508
509
|
retryAfterDelayMs = retryAfter;
|
|
509
510
|
break;
|
|
510
511
|
}
|
|
511
|
-
throw lastError;
|
|
512
|
+
throw attachToolUpstreamResponse(lastError, parsed);
|
|
512
513
|
}
|
|
513
|
-
throw structuredToolError;
|
|
514
|
+
throw attachToolUpstreamResponse(structuredToolError, parsed);
|
|
514
515
|
}
|
|
515
516
|
if (response.status === 429) {
|
|
516
517
|
if (options?.preserveRateLimitResponse && isMonitorRateLimitEnvelope(parsed)) {
|
|
@@ -527,7 +528,7 @@ var HttpClient = class {
|
|
|
527
528
|
retryAfterDelayMs = retryAfter;
|
|
528
529
|
break;
|
|
529
530
|
}
|
|
530
|
-
throw lastError;
|
|
531
|
+
throw options?.toolId ? attachToolUpstreamResponse(lastError, parsed) : lastError;
|
|
531
532
|
}
|
|
532
533
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
533
534
|
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
@@ -565,7 +566,7 @@ var HttpClient = class {
|
|
|
565
566
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
566
567
|
break;
|
|
567
568
|
}
|
|
568
|
-
throw lastError;
|
|
569
|
+
throw options?.toolId ? attachToolUpstreamResponse(lastError, parsed) : lastError;
|
|
569
570
|
}
|
|
570
571
|
if (typeof parsed === "string") {
|
|
571
572
|
const interstitial = detectHtmlErrorBody(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkT2N3B7IQjs = require('./chunk-T2N3B7IQ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -13,15 +13,16 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
|
|
17
16
|
|
|
17
|
+
var _chunkSQWET4SLjs = require('./chunk-SQWET4SL.js');
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
var _chunkTZNQRKDFjs = require('./chunk-TZNQRKDF.js');
|
|
20
21
|
|
|
21
22
|
// src/version.ts
|
|
22
|
-
var SDK_VERSION =
|
|
23
|
-
var SDK_API_MAJOR =
|
|
24
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
23
|
+
var SDK_VERSION = _chunkTZNQRKDFjs.SDK_RELEASE.version;
|
|
24
|
+
var SDK_API_MAJOR = _chunkTZNQRKDFjs.SDK_RELEASE.contracts.api.currentMajor;
|
|
25
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunkTZNQRKDFjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
25
26
|
|
|
26
27
|
// src/agent-runtime.ts
|
|
27
28
|
var _os = require('os');
|
|
@@ -491,16 +492,16 @@ var HttpClient = class {
|
|
|
491
492
|
if (_optionalChain([options, 'optionalAccess', _136 => _136.retryFromExecutePolicy]) === true && responseRetryAllowed && options.executePolicyMaxRetries !== void 0) {
|
|
492
493
|
maxRetries = options.executePolicyMaxRetries;
|
|
493
494
|
}
|
|
494
|
-
const structuredToolError = _optionalChain([options, 'optionalAccess', _137 => _137.toolId]) && !response.ok ?
|
|
495
|
+
const structuredToolError = _optionalChain([options, 'optionalAccess', _137 => _137.toolId]) && !response.ok ? _chunkSQWET4SLjs.deserializeToolExecutionFailure.call(void 0,
|
|
495
496
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
496
497
|
isRecord(parsed) ? parsed.tool_error : null,
|
|
497
|
-
|
|
498
|
+
_chunkSQWET4SLjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
498
499
|
) : null;
|
|
499
500
|
if (structuredToolError) {
|
|
500
501
|
if (response.status === 429) {
|
|
501
502
|
const retryAfter = parseRetryAfter(response);
|
|
502
|
-
const failure =
|
|
503
|
-
lastError = failure === null ? structuredToolError : new (0,
|
|
503
|
+
const failure = _chunkSQWET4SLjs.serializeToolExecutionFailure.call(void 0, structuredToolError);
|
|
504
|
+
lastError = failure === null ? structuredToolError : new (0, _chunkT2N3B7IQjs.ToolRateLimitError)(structuredToolError.message, {
|
|
504
505
|
...failure,
|
|
505
506
|
retryAfterMs: _nullishCoalesce(failure.retryAfterMs, () => ( Math.max(0, retryAfter)))
|
|
506
507
|
});
|
|
@@ -508,13 +509,13 @@ var HttpClient = class {
|
|
|
508
509
|
retryAfterDelayMs = retryAfter;
|
|
509
510
|
break;
|
|
510
511
|
}
|
|
511
|
-
throw lastError;
|
|
512
|
+
throw _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, lastError, parsed);
|
|
512
513
|
}
|
|
513
|
-
throw structuredToolError;
|
|
514
|
+
throw _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, structuredToolError, parsed);
|
|
514
515
|
}
|
|
515
516
|
if (response.status === 429) {
|
|
516
517
|
if (_optionalChain([options, 'optionalAccess', _138 => _138.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
|
|
517
|
-
throw new (0,
|
|
518
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
518
519
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
519
520
|
response.status,
|
|
520
521
|
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
@@ -522,24 +523,24 @@ var HttpClient = class {
|
|
|
522
523
|
);
|
|
523
524
|
}
|
|
524
525
|
const retryAfter = parseRetryAfter(response);
|
|
525
|
-
lastError = new (0,
|
|
526
|
+
lastError = new (0, _chunkT2N3B7IQjs.RateLimitError)(retryAfter);
|
|
526
527
|
if (responseRetryAllowed && attempt < maxRetries) {
|
|
527
528
|
retryAfterDelayMs = retryAfter;
|
|
528
529
|
break;
|
|
529
530
|
}
|
|
530
|
-
throw lastError;
|
|
531
|
+
throw _optionalChain([options, 'optionalAccess', _139 => _139.toolId]) ? _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, lastError, parsed) : lastError;
|
|
531
532
|
}
|
|
532
533
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
533
|
-
throw new (0,
|
|
534
|
+
throw new (0, _chunkT2N3B7IQjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
534
535
|
}
|
|
535
536
|
if (!response.ok) {
|
|
536
|
-
const retryableApiError = _optionalChain([options, 'optionalAccess',
|
|
537
|
+
const retryableApiError = _optionalChain([options, 'optionalAccess', _140 => _140.retryApiErrors]) === true && responseRetryAllowed && isRetryableApiErrorResponse(response.status);
|
|
537
538
|
const htmlError = detectHtmlErrorBody(
|
|
538
539
|
body,
|
|
539
540
|
response.headers.get("content-type")
|
|
540
541
|
);
|
|
541
542
|
if (htmlError) {
|
|
542
|
-
lastError = new (0,
|
|
543
|
+
lastError = new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
543
544
|
htmlError.message(response.status),
|
|
544
545
|
response.status,
|
|
545
546
|
"API_ERROR",
|
|
@@ -558,14 +559,14 @@ var HttpClient = class {
|
|
|
558
559
|
const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
|
|
559
560
|
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}`;
|
|
560
561
|
const apiErrorCode = _chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed);
|
|
561
|
-
lastError = new (0,
|
|
562
|
+
lastError = new (0, _chunkSQWET4SLjs.DeeplineError)(msg, response.status, apiErrorCode, {
|
|
562
563
|
response: parsed
|
|
563
564
|
});
|
|
564
565
|
if (retryableApiError && attempt < maxRetries) {
|
|
565
566
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
566
567
|
break;
|
|
567
568
|
}
|
|
568
|
-
throw lastError;
|
|
569
|
+
throw _optionalChain([options, 'optionalAccess', _141 => _141.toolId]) ? _chunkSQWET4SLjs.attachToolUpstreamResponse.call(void 0, lastError, parsed) : lastError;
|
|
569
570
|
}
|
|
570
571
|
if (typeof parsed === "string") {
|
|
571
572
|
const interstitial = detectHtmlErrorBody(
|
|
@@ -573,7 +574,7 @@ var HttpClient = class {
|
|
|
573
574
|
response.headers.get("content-type")
|
|
574
575
|
);
|
|
575
576
|
if (interstitial) {
|
|
576
|
-
throw new (0,
|
|
577
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
577
578
|
`${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.`,
|
|
578
579
|
response.status,
|
|
579
580
|
"DEPLOYMENT_PROTECTED",
|
|
@@ -585,14 +586,14 @@ var HttpClient = class {
|
|
|
585
586
|
} catch (error) {
|
|
586
587
|
clearTimeout(timeoutId);
|
|
587
588
|
networkFailedAt = Date.now();
|
|
588
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
589
|
+
if (_optionalChain([options, 'optionalAccess', _142 => _142.signal, 'optionalAccess', _143 => _143.aborted])) {
|
|
589
590
|
lastError = requestCancelledError(options.signal);
|
|
590
591
|
break requestAttempts;
|
|
591
592
|
}
|
|
592
|
-
if (error instanceof
|
|
593
|
+
if (error instanceof _chunkT2N3B7IQjs.AuthError || error instanceof _chunkSQWET4SLjs.DeeplineError) {
|
|
593
594
|
throw error;
|
|
594
595
|
}
|
|
595
|
-
if (error instanceof
|
|
596
|
+
if (error instanceof _chunkT2N3B7IQjs.RateLimitError) {
|
|
596
597
|
lastError = error;
|
|
597
598
|
break;
|
|
598
599
|
}
|
|
@@ -600,17 +601,17 @@ var HttpClient = class {
|
|
|
600
601
|
timeoutMs,
|
|
601
602
|
timedOut: requestTimedOut
|
|
602
603
|
});
|
|
603
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
604
|
+
if (_optionalChain([options, 'optionalAccess', _144 => _144.retryFromExecutePolicy]) && options.retryAmbiguousDelivery !== true) {
|
|
604
605
|
break requestAttempts;
|
|
605
606
|
}
|
|
606
607
|
} finally {
|
|
607
608
|
clearTimeout(timeoutId);
|
|
608
|
-
_optionalChain([options, 'optionalAccess',
|
|
609
|
+
_optionalChain([options, 'optionalAccess', _145 => _145.signal, 'optionalAccess', _146 => _146.removeEventListener, 'call', _147 => _147("abort", abortRequest)]);
|
|
609
610
|
}
|
|
610
611
|
}
|
|
611
612
|
if (attempt < maxRetries) continue;
|
|
612
613
|
}
|
|
613
|
-
if (lastError instanceof
|
|
614
|
+
if (lastError instanceof _chunkSQWET4SLjs.DeeplineError) {
|
|
614
615
|
throw lastError;
|
|
615
616
|
}
|
|
616
617
|
const mappedNetworkError = mapNetworkError(
|
|
@@ -632,10 +633,10 @@ var HttpClient = class {
|
|
|
632
633
|
phase: networkPhase
|
|
633
634
|
}
|
|
634
635
|
};
|
|
635
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
636
|
+
if (_optionalChain([options, 'optionalAccess', _148 => _148.toolId])) {
|
|
636
637
|
const code = mappedNetworkError.code;
|
|
637
638
|
throw withErrorCause(
|
|
638
|
-
new (0,
|
|
639
|
+
new (0, _chunkSQWET4SLjs.ToolExecutionError)(
|
|
639
640
|
withCoworkNetworkHint(mappedNetworkError.message),
|
|
640
641
|
{
|
|
641
642
|
toolId: options.toolId,
|
|
@@ -660,7 +661,7 @@ var HttpClient = class {
|
|
|
660
661
|
);
|
|
661
662
|
}
|
|
662
663
|
throw withErrorCause(
|
|
663
|
-
new (0,
|
|
664
|
+
new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
664
665
|
withCoworkNetworkHint(mappedNetworkError.message),
|
|
665
666
|
void 0,
|
|
666
667
|
mappedNetworkError.code,
|
|
@@ -684,37 +685,37 @@ var HttpClient = class {
|
|
|
684
685
|
}
|
|
685
686
|
async *streamSse(path, options) {
|
|
686
687
|
const url = `${this.config.baseUrl}${path}`;
|
|
687
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
688
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _149 => _149.method]), () => ( "GET"));
|
|
688
689
|
const headers = this.authHeaders({
|
|
689
690
|
Accept: "text/event-stream",
|
|
690
|
-
..._optionalChain([options, 'optionalAccess',
|
|
691
|
+
..._optionalChain([options, 'optionalAccess', _150 => _150.headers])
|
|
691
692
|
});
|
|
692
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
693
|
+
if (_optionalChain([options, 'optionalAccess', _151 => _151.body]) !== void 0) {
|
|
693
694
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
694
695
|
}
|
|
695
696
|
let lastError = null;
|
|
696
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
697
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _152 => _152.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
697
698
|
for (const candidateUrl of candidateUrls) {
|
|
698
699
|
try {
|
|
699
700
|
const response = await fetch(candidateUrl, {
|
|
700
701
|
method,
|
|
701
702
|
headers,
|
|
702
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
703
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
703
|
+
body: _optionalChain([options, 'optionalAccess', _153 => _153.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
704
|
+
signal: _optionalChain([options, 'optionalAccess', _154 => _154.signal])
|
|
704
705
|
});
|
|
705
|
-
_optionalChain([options, 'optionalAccess',
|
|
706
|
+
_optionalChain([options, 'optionalAccess', _155 => _155.onResponse, 'optionalCall', _156 => _156(response)]);
|
|
706
707
|
if (!response.ok) {
|
|
707
708
|
const body = await response.text();
|
|
708
709
|
const parsed = parseResponseBody(body);
|
|
709
710
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
710
|
-
throw new (0,
|
|
711
|
+
throw new (0, _chunkT2N3B7IQjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
711
712
|
}
|
|
712
713
|
const htmlError = detectHtmlErrorBody(
|
|
713
714
|
body,
|
|
714
715
|
response.headers.get("content-type")
|
|
715
716
|
);
|
|
716
717
|
if (htmlError) {
|
|
717
|
-
throw new (0,
|
|
718
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
718
719
|
htmlError.message(response.status),
|
|
719
720
|
response.status,
|
|
720
721
|
"API_ERROR",
|
|
@@ -725,7 +726,7 @@ var HttpClient = class {
|
|
|
725
726
|
}
|
|
726
727
|
);
|
|
727
728
|
}
|
|
728
|
-
throw new (0,
|
|
729
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
729
730
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
730
731
|
response.status,
|
|
731
732
|
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
@@ -733,17 +734,17 @@ var HttpClient = class {
|
|
|
733
734
|
);
|
|
734
735
|
}
|
|
735
736
|
if (!response.body) {
|
|
736
|
-
throw new (0,
|
|
737
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)("SSE response did not include a body.");
|
|
737
738
|
}
|
|
738
739
|
yield* decodeSseStream(response.body);
|
|
739
740
|
return;
|
|
740
741
|
} catch (error) {
|
|
741
|
-
if (error instanceof
|
|
742
|
+
if (error instanceof _chunkT2N3B7IQjs.AuthError || error instanceof _chunkSQWET4SLjs.DeeplineError) {
|
|
742
743
|
throw error;
|
|
743
744
|
}
|
|
744
745
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
745
|
-
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess',
|
|
746
|
-
throw new (0,
|
|
746
|
+
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _157 => _157.signal, 'optionalAccess', _158 => _158.aborted])) {
|
|
747
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
747
748
|
`Stream from ${this.config.baseUrl} was aborted by the caller.`,
|
|
748
749
|
void 0,
|
|
749
750
|
"ABORTED"
|
|
@@ -753,7 +754,7 @@ var HttpClient = class {
|
|
|
753
754
|
}
|
|
754
755
|
}
|
|
755
756
|
if (lastError && isAbortLikeError(lastError)) {
|
|
756
|
-
throw new (0,
|
|
757
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
757
758
|
withCoworkNetworkHint(
|
|
758
759
|
`Unable to stream from ${this.config.baseUrl}. The remote stream was interrupted.`
|
|
759
760
|
),
|
|
@@ -761,9 +762,9 @@ var HttpClient = class {
|
|
|
761
762
|
"PLAY_STREAM_NETWORK_ABORTED"
|
|
762
763
|
);
|
|
763
764
|
}
|
|
764
|
-
throw new (0,
|
|
765
|
+
throw new (0, _chunkSQWET4SLjs.DeeplineError)(
|
|
765
766
|
withCoworkNetworkHint(
|
|
766
|
-
_optionalChain([lastError, 'optionalAccess',
|
|
767
|
+
_optionalChain([lastError, 'optionalAccess', _159 => _159.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
|
|
767
768
|
)
|
|
768
769
|
);
|
|
769
770
|
}
|
|
@@ -825,15 +826,15 @@ function parseResponseBody(body) {
|
|
|
825
826
|
}
|
|
826
827
|
function isProviderOriginatedHttpError(parsed) {
|
|
827
828
|
const response = asRecord(parsed);
|
|
828
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
829
|
-
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
830
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
829
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _160 => _160.error]));
|
|
830
|
+
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _161 => _161.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _162 => _162.failure_origin])));
|
|
831
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _163 => _163.code]), () => ( _optionalChain([response, 'optionalAccess', _164 => _164.code])));
|
|
831
832
|
return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
|
|
832
833
|
}
|
|
833
834
|
function isMonitorRateLimitEnvelope(parsed) {
|
|
834
835
|
const response = asRecord(parsed);
|
|
835
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
836
|
-
return (_optionalChain([error, 'optionalAccess',
|
|
836
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _165 => _165.error]));
|
|
837
|
+
return (_optionalChain([error, 'optionalAccess', _166 => _166.code]) === "monitor_upstream_rate_limited" || _optionalChain([error, 'optionalAccess', _167 => _167.code]) === "monitor_preview_rate_limited") && typeof error.message === "string";
|
|
837
838
|
}
|
|
838
839
|
function asRecord(value) {
|
|
839
840
|
return typeof value === "object" && value !== null ? value : null;
|
|
@@ -849,7 +850,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
849
850
|
return null;
|
|
850
851
|
}
|
|
851
852
|
const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
852
|
-
const title = _optionalChain([titleMatch, 'optionalAccess',
|
|
853
|
+
const title = _optionalChain([titleMatch, 'optionalAccess', _168 => _168[1], 'optionalAccess', _169 => _169.replace, 'call', _170 => _170(/\s+/g, " "), 'access', _171 => _171.trim, 'call', _172 => _172()]) || void 0;
|
|
853
854
|
const workerThrewException = /worker threw exception/i.test(trimmed);
|
|
854
855
|
return {
|
|
855
856
|
title,
|
|
@@ -933,20 +934,20 @@ function decodeSseFrame(frame) {
|
|
|
933
934
|
}
|
|
934
935
|
function sleep(ms, signal) {
|
|
935
936
|
return new Promise((resolve, reject) => {
|
|
936
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
937
|
+
if (_optionalChain([signal, 'optionalAccess', _173 => _173.aborted])) {
|
|
937
938
|
reject(requestCancelledError(signal));
|
|
938
939
|
return;
|
|
939
940
|
}
|
|
940
941
|
const timeoutId = setTimeout(() => {
|
|
941
|
-
_optionalChain([signal, 'optionalAccess',
|
|
942
|
+
_optionalChain([signal, 'optionalAccess', _174 => _174.removeEventListener, 'call', _175 => _175("abort", abort)]);
|
|
942
943
|
resolve();
|
|
943
944
|
}, ms);
|
|
944
945
|
const abort = () => {
|
|
945
946
|
clearTimeout(timeoutId);
|
|
946
|
-
_optionalChain([signal, 'optionalAccess',
|
|
947
|
+
_optionalChain([signal, 'optionalAccess', _176 => _176.removeEventListener, 'call', _177 => _177("abort", abort)]);
|
|
947
948
|
reject(requestCancelledError(signal));
|
|
948
949
|
};
|
|
949
|
-
_optionalChain([signal, 'optionalAccess',
|
|
950
|
+
_optionalChain([signal, 'optionalAccess', _178 => _178.addEventListener, 'call', _179 => _179("abort", abort, { once: true })]);
|
|
950
951
|
});
|
|
951
952
|
}
|
|
952
953
|
function withCoworkNetworkHint(message) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
traceCliSpan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H6BSB2YJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
checkSdkCompatibility,
|
|
6
6
|
enforceSdkCompatibilityResponse,
|
|
7
7
|
flushDeferredSkillsSyncNotices
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Z3KLCDCB.mjs";
|
|
9
9
|
|
|
10
10
|
// src/cli/play-run-admission.ts
|
|
11
11
|
function usesInlinePlayAdmission(command, args) {
|