deepline 0.3.504 → 0.3.506
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client-core.ts +121 -5
- package/dist/bundling-sources/sdk/src/index.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +5 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +176 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/overview.ts +118 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +29 -1
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +29 -10
- package/dist/bundling-sources/shared_libs/monitors/package.json +4 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +9 -9
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +52 -5
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +48 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +157 -47
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-egress.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/onboarding-unsubscribe.ts +23 -0
- package/dist/cli/auth-MMHG2OFE.js +43 -0
- package/dist/cli/{auth-3L5AA5AX.mjs → auth-ZHFONT2D.mjs} +5 -5
- package/dist/cli/{billing-HOGXVE2V.js → billing-3Z7N4WTL.js} +101 -91
- package/dist/cli/{billing-E7EASVPO.mjs → billing-B2YEMNHE.mjs} +27 -17
- package/dist/cli/{chunk-UXQQPMYO.js → chunk-26DJ4BDY.js} +2 -2
- package/dist/cli/{chunk-3MLFFWDM.mjs → chunk-2CFTDVEP.mjs} +2 -2
- package/dist/cli/{chunk-QOLX2O2S.mjs → chunk-2IXXB7OA.mjs} +93 -34
- package/dist/cli/{chunk-6JNBMTCZ.js → chunk-2OY5DXTC.js} +1 -1
- package/dist/cli/{chunk-SVFTZTCI.mjs → chunk-3BFZEHBH.mjs} +1 -1
- package/dist/cli/{chunk-67OI26OE.js → chunk-3F676QXJ.js} +96 -37
- package/dist/cli/{chunk-KCKAFTPY.js → chunk-5ARG7J7A.js} +6 -6
- package/dist/cli/{chunk-5CHBIJIM.mjs → chunk-6RYVIZRP.mjs} +2 -2
- package/dist/cli/{chunk-QKKU2FH4.js → chunk-75NAFY36.js} +7 -7
- package/dist/cli/{chunk-7P2QVMBP.js → chunk-AD2WJUZA.js} +91 -48
- package/dist/cli/{chunk-UFYJTRSF.mjs → chunk-AFSYNOG4.mjs} +42 -7
- package/dist/cli/{chunk-VJVJWZ6I.mjs → chunk-BJ5OX62J.mjs} +5 -5
- package/dist/cli/{chunk-HUX5DZO6.mjs → chunk-BQBPVUFJ.mjs} +3 -3
- package/dist/cli/{chunk-MLMWM5DV.mjs → chunk-CHGRURBN.mjs} +5 -5
- package/dist/cli/{chunk-22OCKCYS.mjs → chunk-D7OCORZ7.mjs} +1 -1
- package/dist/cli/{chunk-SMSQVRHE.js → chunk-DB54ROPH.js} +5 -5
- package/dist/cli/{chunk-KGUGNEKL.js → chunk-E554XCJI.js} +96 -96
- package/dist/cli/{chunk-GGBXNQCR.mjs → chunk-EN7GXLFX.mjs} +4 -4
- package/dist/cli/{chunk-2W77YCKH.js → chunk-F53SGS3C.js} +5 -5
- package/dist/cli/{chunk-6SMR7LU7.js → chunk-F7IQQYKV.js} +2 -2
- package/dist/cli/chunk-FFGQR5J3.mjs +405 -0
- package/dist/cli/{chunk-UJMBG5JU.js → chunk-FWSEGIT6.js} +4 -4
- package/dist/cli/{chunk-GJ2DA35C.js → chunk-GDHLL5EQ.js} +42 -7
- package/dist/cli/{chunk-XHZSPMNC.mjs → chunk-GJNIC2CO.mjs} +84 -441
- package/dist/cli/chunk-GRESJ3H3.js +405 -0
- package/dist/cli/{chunk-WZSFIJMG.js → chunk-HINTYT5H.js} +113 -470
- package/dist/cli/{chunk-A6LA42JY.js → chunk-LRSRJJPD.js} +16 -16
- package/dist/cli/{chunk-WBIDPDKJ.js → chunk-MHRR47VQ.js} +3 -3
- package/dist/cli/{chunk-FTRVCIGC.js → chunk-N7G36GXB.js} +26 -26
- package/dist/cli/{chunk-BTWUNKKX.mjs → chunk-ND4WPLTE.mjs} +2 -2
- package/dist/cli/{chunk-NZ7Z7WNM.mjs → chunk-O4DZG4VA.mjs} +2 -2
- package/dist/cli/{chunk-LHXYCZYO.js → chunk-OD6TASBP.js} +8 -8
- package/dist/cli/{chunk-GRAGUYIE.js → chunk-OHNMJ5XQ.js} +41 -41
- package/dist/cli/{chunk-OX2D6BG4.mjs → chunk-ONBXTEFQ.mjs} +46 -3
- package/dist/cli/{chunk-7F4OEHQK.mjs → chunk-OPBXKB57.mjs} +1 -1
- package/dist/cli/{chunk-Y7VEHKID.mjs → chunk-OUGJUM5X.mjs} +6 -6
- package/dist/cli/{chunk-USTJEEND.js → chunk-PRIHD5XS.js} +9 -9
- package/dist/cli/{chunk-IGNQKOWT.mjs → chunk-QAY5AS2H.mjs} +12 -12
- package/dist/cli/{chunk-5Z6EULD5.js → chunk-QP333GFE.js} +7 -7
- package/dist/cli/{chunk-JPR2546F.js → chunk-SUJIVF6L.js} +16 -16
- package/dist/cli/{chunk-DEAJVQEG.mjs → chunk-TEMORCEE.mjs} +1 -1
- package/dist/cli/{chunk-YOQ2NNDO.mjs → chunk-TS4KFQKS.mjs} +1 -1
- package/dist/cli/{chunk-4CC67XH5.mjs → chunk-XUY7WQ2R.mjs} +3 -3
- package/dist/cli/{chunk-Z6FXUDIL.mjs → chunk-YEX6RPUO.mjs} +1 -1
- package/dist/cli/{chunk-MJTK6Q3G.js → chunk-YJKKOSXS.js} +3 -3
- package/dist/cli/{chunk-Y6XKCEPK.mjs → chunk-YVOS5KSG.mjs} +1 -1
- package/dist/cli/{chunk-2ABRDH3B.mjs → chunk-YWZEBPXK.mjs} +2 -2
- package/dist/cli/{chunk-BX45XMXZ.mjs → chunk-Z7EHY2MF.mjs} +2 -2
- package/dist/cli/{chunk-FISP4LCK.js → chunk-ZM5BJ5MP.js} +53 -53
- package/dist/cli/{chunk-IPAMOMGP.js → chunk-ZZDTWVCQ.js} +21 -21
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-2XWGPITO.js → csv-7K7LK63Y.js} +13 -13
- package/dist/cli/{csv-433JEHLQ.mjs → csv-ARHQ54HA.mjs} +4 -4
- package/dist/cli/{db-K747DH43.mjs → db-JBX24NJY.mjs} +6 -6
- package/dist/cli/{db-PJJMD4VH.js → db-V4Z2I6DY.js} +27 -27
- package/dist/cli/describe-AYXVS6DZ.js +50 -0
- package/dist/cli/{describe-VEDDYW4P.mjs → describe-RBDSGSZ7.mjs} +18 -17
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-JWRX3XCT.mjs → executions-BAZEU63W.mjs} +6 -6
- package/dist/cli/{executions-HM5T72H6.js → executions-XEZKV5QU.js} +8 -8
- package/dist/cli/{feedback-34UG4BO3.js → feedback-LOERESRU.js} +8 -8
- package/dist/cli/{feedback-MNSIA63Y.mjs → feedback-YDSWBHCO.mjs} +4 -4
- package/dist/cli/{git-ZKEOXV3A.mjs → git-4Z3W2CQU.mjs} +5 -5
- package/dist/cli/git-T6WKO7EA.js +25 -0
- package/dist/cli/index.js +146 -148
- package/dist/cli/index.mjs +53 -55
- package/dist/cli/{legacy-noops-YXSI4FVU.js → legacy-noops-4QIQPVE5.js} +8 -8
- package/dist/cli/{legacy-noops-5M4T4ZVT.mjs → legacy-noops-E4HH7S5O.mjs} +5 -5
- package/dist/cli/{monitors-C65OC4AW.mjs → monitors-FPDW5DDM.mjs} +305 -8
- package/dist/cli/{monitors-O25GDOYE.js → monitors-QBHDSDA7.js} +423 -126
- package/dist/cli/{org-2GSPLY2A.js → org-JO4GGSAH.js} +72 -72
- package/dist/cli/{org-ZRMG5NS2.mjs → org-UCDHIHAD.mjs} +6 -6
- package/dist/cli/{pages-TZZUFBRO.mjs → pages-6V52IZXY.mjs} +6 -6
- package/dist/cli/{pages-45DPADK6.js → pages-FJAAXAWO.js} +18 -18
- package/dist/cli/{play-RCGMND6X.js → play-F3AENS6W.js} +317 -316
- package/dist/cli/{play-3D7HH273.mjs → play-MF4DWROJ.mjs} +18 -17
- package/dist/cli/{providers-PSAKV6CJ.mjs → providers-NJJLTECA.mjs} +6 -6
- package/dist/cli/{providers-3N3ECMTY.js → providers-XXOQLPX7.js} +9 -9
- package/dist/cli/{quickstart-6R6AIXM6.js → quickstart-JCE3XGQG.js} +6 -6
- package/dist/cli/{quickstart-2A35SMGC.mjs → quickstart-Z5MSMI7S.mjs} +4 -4
- package/dist/cli/{run-F3TLDGUO.mjs → run-56UGPIRL.mjs} +23 -22
- package/dist/cli/{run-F6ZXTASZ.js → run-X2DNIW3F.js} +41 -40
- package/dist/cli/search-B753RTKC.js +33 -0
- package/dist/cli/{search-CZLCY3D2.mjs → search-SZYI4NBB.mjs} +8 -7
- package/dist/cli/{search-output-R5XDNILW.js → search-output-7UNT6EMP.js} +6 -6
- package/dist/cli/{search-output-MQTSTLN5.mjs → search-output-T35QNZUF.mjs} +4 -4
- package/dist/cli/{secrets-DCJYHDSY.js → secrets-JMUAVIVC.js} +15 -15
- package/dist/cli/{secrets-D3GF4B2Z.mjs → secrets-Q36VC35L.mjs} +6 -6
- package/dist/cli/{sessions-QGEQ2UYZ.mjs → sessions-HG6I3HMY.mjs} +5 -5
- package/dist/cli/{sessions-Z4JYJSDP.js → sessions-SUXU7OM7.js} +6 -6
- package/dist/cli/{settings-UVXXAT4A.js → settings-UIELQ5CV.js} +106 -78
- package/dist/cli/{settings-G7QEXA4N.mjs → settings-Z76XW4KF.mjs} +39 -11
- package/dist/cli/{setup-5I42W7D4.js → setup-2L7H5P2O.js} +50 -49
- package/dist/cli/{setup-QHJU3DUI.mjs → setup-OXNYAOQ4.mjs} +10 -9
- package/dist/cli/skills-DEVXYGYH.js +37 -0
- package/dist/cli/{skills-5LRF4UKX.mjs → skills-XSNLXJGI.mjs} +8 -7
- package/dist/cli/tools-SCGHABDL.js +57 -0
- package/dist/cli/{tools-PUT6STVG.mjs → tools-SUSFAYFH.mjs} +17 -16
- package/dist/cli/update-BSIILGO3.js +35 -0
- package/dist/cli/{update-CJ2GA64X.mjs → update-ENSTG3QO.mjs} +10 -9
- package/dist/cli/{workflow-O67MEBCP.js → workflow-FMBZNY4F.js} +17 -17
- package/dist/cli/{workflow-HVEWRTXD.mjs → workflow-Z33QE6VT.mjs} +7 -7
- package/dist/{client-DYAfJpaN.d.mts → client-BDbouy3Y.d.mts} +1 -1
- package/dist/{client-CIwenMFS.d.ts → client-Cx0420fs.d.ts} +1 -1
- package/dist/{client-core-CRjtyMAI.d.ts → client-core-B4hq0-m2.d.ts} +56 -4
- package/dist/{client-core-DlzP8vEs.d.mts → client-core-CwiVaMZ5.d.mts} +56 -4
- package/dist/{compiler-manifest-DaJrA2KV.d.mts → compiler-manifest-BeURaD5Y.d.mts} +2 -0
- package/dist/{compiler-manifest-DaJrA2KV.d.ts → compiler-manifest-BeURaD5Y.d.ts} +2 -0
- package/dist/{errors-KLga4bLr.d.ts → errors-BoPXPrSy.d.ts} +1 -1
- package/dist/{errors-BKnSYueU.d.mts → errors-kBuT4kGK.d.mts} +1 -1
- package/dist/{index-C5nAZ-VS.d.ts → index-D0crdGM1.d.ts} +1 -1
- package/dist/{index-C-8AFpWy.d.mts → index-DC7oRAAC.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -110
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- 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/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 +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UPK4IIIN.js +0 -43
- package/dist/cli/describe-OYS7LZJD.js +0 -49
- package/dist/cli/git-5YQJSJFR.js +0 -25
- package/dist/cli/search-R5VEWJO2.js +0 -32
- package/dist/cli/skills-FB6TV52O.js +0 -36
- package/dist/cli/tools-L2364RPA.js +0 -56
- package/dist/cli/update-ESYJGYVZ.js +0 -34
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYJKKOSXSjs = require('./chunk-YJKKOSXS.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkGRESJ3H3js = require('./chunk-GRESJ3H3.js');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -12,21 +13,18 @@ var _chunkMJTK6Q3Gjs = require('./chunk-MJTK6Q3G.js');
|
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
var _chunkWBIDPDKJjs = require('./chunk-WBIDPDKJ.js');
|
|
16
16
|
|
|
17
|
+
var _chunkMHRR47VQjs = require('./chunk-MHRR47VQ.js');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
var
|
|
24
|
+
var _chunkFWSEGIT6js = require('./chunk-FWSEGIT6.js');
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _chunk6JNBMTCZjs = require('./chunk-6JNBMTCZ.js');
|
|
27
|
+
var _chunk2OY5DXTCjs = require('./chunk-2OY5DXTC.js');
|
|
30
28
|
|
|
31
29
|
// src/compat.ts
|
|
32
30
|
var _crypto = require('crypto');
|
|
@@ -61,7 +59,7 @@ function shouldSkipCompatibilityCheck() {
|
|
|
61
59
|
return value === "1" || value === "true" || value === "yes";
|
|
62
60
|
}
|
|
63
61
|
function sdkCompatibilityCachePath(baseUrl, homeDir = _optionalChain([process, 'access', _7 => _7.env, 'access', _8 => _8.HOME, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]) || _os.homedir.call(void 0, )) {
|
|
64
|
-
return _path.join.call(void 0,
|
|
62
|
+
return _path.join.call(void 0, _chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl, homeDir), "compat-cache.json");
|
|
65
63
|
}
|
|
66
64
|
function legacySdkCompatibilityCachePath(homeDir = _optionalChain([process, 'access', _11 => _11.env, 'access', _12 => _12.HOME, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]) || _os.homedir.call(void 0, )) {
|
|
67
65
|
return _path.join.call(void 0, homeDir, ".cache", "deepline", "sdk-compat-cache.json");
|
|
@@ -69,9 +67,9 @@ function legacySdkCompatibilityCachePath(homeDir = _optionalChain([process, 'acc
|
|
|
69
67
|
function compatibilityCacheKey(baseUrl, command, skillsVersion) {
|
|
70
68
|
return JSON.stringify({
|
|
71
69
|
baseUrl: baseUrl.replace(/\/$/, ""),
|
|
72
|
-
version:
|
|
73
|
-
apiContract:
|
|
74
|
-
apiMajor:
|
|
70
|
+
version: _chunkFWSEGIT6js.SDK_VERSION,
|
|
71
|
+
apiContract: _chunkFWSEGIT6js.SDK_API_CONTRACT,
|
|
72
|
+
apiMajor: _chunkFWSEGIT6js.SDK_API_MAJOR,
|
|
75
73
|
command: _optionalChain([command, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()]) || null,
|
|
76
74
|
skillsVersion: _nullishCoalesce(skillsVersion, () => ( null))
|
|
77
75
|
});
|
|
@@ -79,8 +77,8 @@ function compatibilityCacheKey(baseUrl, command, skillsVersion) {
|
|
|
79
77
|
function legacyCompatibilityCacheKey(baseUrl, command) {
|
|
80
78
|
return JSON.stringify({
|
|
81
79
|
baseUrl: baseUrl.replace(/\/$/, ""),
|
|
82
|
-
version:
|
|
83
|
-
apiContract:
|
|
80
|
+
version: _chunkFWSEGIT6js.SDK_VERSION,
|
|
81
|
+
apiContract: _chunkFWSEGIT6js.SDK_API_CONTRACT,
|
|
84
82
|
command: _optionalChain([command, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]) || null
|
|
85
83
|
});
|
|
86
84
|
}
|
|
@@ -105,7 +103,7 @@ function isSavedWithin(savedAt, windowMs, now) {
|
|
|
105
103
|
}
|
|
106
104
|
var UPDATE_ADVISORY_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
107
105
|
function claimUpdateAdvisory(baseUrl, now = Date.now()) {
|
|
108
|
-
const path = _path.join.call(void 0,
|
|
106
|
+
const path = _path.join.call(void 0, _chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl), "update-advisory.json");
|
|
109
107
|
try {
|
|
110
108
|
const { shownAt } = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
|
|
111
109
|
if (isSavedWithin(shownAt, UPDATE_ADVISORY_INTERVAL_MS, now)) return false;
|
|
@@ -192,7 +190,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
192
190
|
);
|
|
193
191
|
try {
|
|
194
192
|
const url = new URL("/api/v2/sdk/compat", baseUrl);
|
|
195
|
-
url.searchParams.set("version",
|
|
193
|
+
url.searchParams.set("version", _chunkFWSEGIT6js.SDK_VERSION);
|
|
196
194
|
if (_optionalChain([options, 'access', _34 => _34.command, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()])) {
|
|
197
195
|
url.searchParams.set("command", options.command.trim());
|
|
198
196
|
}
|
|
@@ -200,7 +198,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
200
198
|
url.searchParams.set("skills_version", _nullishCoalesce(options.skillsVersion, () => ( "")));
|
|
201
199
|
url.searchParams.set(
|
|
202
200
|
"skills_cli_capability",
|
|
203
|
-
String(
|
|
201
|
+
String(_chunk2OY5DXTCjs.SDK_RELEASE.packageCapabilities.skillsGuidance)
|
|
204
202
|
);
|
|
205
203
|
}
|
|
206
204
|
if (options.catalog) {
|
|
@@ -212,14 +210,14 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
212
210
|
const response = await fetch(url, {
|
|
213
211
|
method: "GET",
|
|
214
212
|
headers: {
|
|
215
|
-
...
|
|
216
|
-
"User-Agent": `deepline-ts-sdk/${
|
|
217
|
-
"X-Deepline-SDK-Version":
|
|
218
|
-
"X-Deepline-API-Major": String(
|
|
219
|
-
"X-Deepline-API-Contract":
|
|
213
|
+
..._chunkFWSEGIT6js.deploymentProtectionHeaders.call(void 0, ),
|
|
214
|
+
"User-Agent": `deepline-ts-sdk/${_chunkFWSEGIT6js.SDK_VERSION}`,
|
|
215
|
+
"X-Deepline-SDK-Version": _chunkFWSEGIT6js.SDK_VERSION,
|
|
216
|
+
"X-Deepline-API-Major": String(_chunkFWSEGIT6js.SDK_API_MAJOR),
|
|
217
|
+
"X-Deepline-API-Contract": _chunkFWSEGIT6js.SDK_API_CONTRACT,
|
|
220
218
|
"X-Deepline-CLI-Update-Preferences": "1",
|
|
221
219
|
"X-Deepline-CLI-Auto-Update-Capability": SDK_CLI_AUTO_UPDATE_CAPABILITY,
|
|
222
|
-
...options.catalog ? { Authorization: `Bearer ${
|
|
220
|
+
...options.catalog ? { Authorization: `Bearer ${_chunkMHRR47VQjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl)}` } : {},
|
|
223
221
|
..._optionalChain([options, 'access', _37 => _37.catalog, 'optionalAccess', _38 => _38.cliInvocationId]) ? { "X-Deepline-CLI-Invocation-ID": options.catalog.cliInvocationId } : {}
|
|
224
222
|
},
|
|
225
223
|
signal: controller.signal
|
|
@@ -294,388 +292,6 @@ function enforceSdkCompatibilityResponse(response, options = {}) {
|
|
|
294
292
|
}
|
|
295
293
|
}
|
|
296
294
|
|
|
297
|
-
// src/cli/failure-reporting.ts
|
|
298
|
-
|
|
299
|
-
var FAILURE_REPORT_DISABLE_ENV = "DEEPLINE_DISABLE_FAILURE_REPORTING";
|
|
300
|
-
var REPORT_FAILURE_TIMEOUT_MS = 1e4;
|
|
301
|
-
var BACKGROUND_REPORT_FAILURE_TIMEOUT_MS = 2e3;
|
|
302
|
-
var MAX_FAILURE_TEXT_CHARS = 4e3;
|
|
303
|
-
var MAX_COMMAND_TOKENS = 3;
|
|
304
|
-
var REPORTABLE_EXIT_CODES = /* @__PURE__ */ new Set([4, 5]);
|
|
305
|
-
var EMAIL_RE = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi;
|
|
306
|
-
var UNIX_PATH_RE = /(?:\/Users\/|\/home\/|\/var\/folders\/|\/tmp\/|\/sessions\/)[^"'\n\r`]+/g;
|
|
307
|
-
var WINDOWS_PATH_RE = /[A-Za-z]:(?:\\{1,2})(?:Users|Temp|tmp)(?:\\{1,2})[^"'\n\r`]+/g;
|
|
308
|
-
var ASSIGNMENT_SECRET_RE = /\b(access[_-]?token|api[_-]?key|apikey|auth(?:orization)?|bearer|password|secret|session)\b(\s*[:=]\s*)(?!Bearer\s+\[redacted-secret\])([^\s,;]+)/gi;
|
|
309
|
-
var BEARER_SECRET_RE = /\b(bearer)\s+([A-Za-z0-9._-]+)/gi;
|
|
310
|
-
var GENERIC_TOKEN_RE = /\b(?:dlp|sk|ghp|xox[baprs])[-_A-Za-z0-9]{8,}\b/g;
|
|
311
|
-
var SECRET_OPTION_RE = /^--?(?:access[-_]?token|api[-_]?key|apikey|auth(?:orization)?|bearer|password|secret|session|token)$/i;
|
|
312
|
-
function truthyEnv(name) {
|
|
313
|
-
return ["1", "true", "yes", "on"].includes(
|
|
314
|
-
String(_nullishCoalesce(process.env[name], () => ( ""))).trim().toLowerCase()
|
|
315
|
-
);
|
|
316
|
-
}
|
|
317
|
-
function isFailureReportingDisabled() {
|
|
318
|
-
return truthyEnv(FAILURE_REPORT_DISABLE_ENV);
|
|
319
|
-
}
|
|
320
|
-
function redactFailureText(value, maxChars = MAX_FAILURE_TEXT_CHARS) {
|
|
321
|
-
const home = _optionalChain([process, 'access', _53 => _53.env, 'access', _54 => _54.HOME, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()]);
|
|
322
|
-
let text = String(_nullishCoalesce(value, () => ( "")));
|
|
323
|
-
if (!text) return "";
|
|
324
|
-
if (home && home !== "/") {
|
|
325
|
-
text = text.split(home).join("~");
|
|
326
|
-
}
|
|
327
|
-
return text.replace(EMAIL_RE, "[redacted-email]").replace(UNIX_PATH_RE, "[redacted-path]").replace(WINDOWS_PATH_RE, "[redacted-path]").replace(BEARER_SECRET_RE, "$1 [redacted-secret]").replace(ASSIGNMENT_SECRET_RE, "$1$2[redacted-secret]").replace(GENERIC_TOKEN_RE, "[redacted-secret]").slice(0, maxChars);
|
|
328
|
-
}
|
|
329
|
-
function sanitizeCommand(argv, prefix = "deepline") {
|
|
330
|
-
const tokens = [];
|
|
331
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
332
|
-
const arg = argv[index];
|
|
333
|
-
const value = String(_nullishCoalesce(arg, () => ( ""))).trim();
|
|
334
|
-
if (!value) continue;
|
|
335
|
-
if (value.startsWith("-")) {
|
|
336
|
-
if (!value.includes("=") && SECRET_OPTION_RE.test(value)) {
|
|
337
|
-
index += 1;
|
|
338
|
-
}
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
341
|
-
tokens.push(redactFailureText(value, 200));
|
|
342
|
-
if (tokens.length >= MAX_COMMAND_TOKENS) break;
|
|
343
|
-
}
|
|
344
|
-
return tokens.length > 0 ? [prefix, ...tokens].join(" ") : prefix;
|
|
345
|
-
}
|
|
346
|
-
function errorMessage(error) {
|
|
347
|
-
if (error instanceof Error) return `${error.name}: ${error.message}`;
|
|
348
|
-
return String(_nullishCoalesce(error, () => ( "")));
|
|
349
|
-
}
|
|
350
|
-
function errorStack(error) {
|
|
351
|
-
if (error instanceof Error && error.stack) {
|
|
352
|
-
return redactFailureText(error.stack);
|
|
353
|
-
}
|
|
354
|
-
return null;
|
|
355
|
-
}
|
|
356
|
-
function classifyNetworkFailure(error) {
|
|
357
|
-
const seen = /* @__PURE__ */ new Set();
|
|
358
|
-
let current = error;
|
|
359
|
-
while (current && !seen.has(current)) {
|
|
360
|
-
seen.add(current);
|
|
361
|
-
const record = typeof current === "object" && current !== null ? current : {};
|
|
362
|
-
const code = String(_nullishCoalesce(record.code, () => ( ""))).toLowerCase();
|
|
363
|
-
const name = current instanceof Error ? current.name.toLowerCase() : "";
|
|
364
|
-
const text = String(
|
|
365
|
-
current instanceof Error ? current.message : current
|
|
366
|
-
).toLowerCase();
|
|
367
|
-
const combined = `${code} ${name} ${text}`;
|
|
368
|
-
if (combined.includes("aborterror") || combined.includes("timeout") || combined.includes("timed out") || combined.includes("etimedout")) {
|
|
369
|
-
return "network_timeout";
|
|
370
|
-
}
|
|
371
|
-
if (combined.includes("enotfound") || combined.includes("eai_again") || combined.includes("getaddrinfo") || combined.includes("name or service not known") || combined.includes("temporary failure in name resolution")) {
|
|
372
|
-
return "network_dns_resolution_failed";
|
|
373
|
-
}
|
|
374
|
-
if (combined.includes("econnrefused") || combined.includes("connection refused")) {
|
|
375
|
-
return "network_connection_refused";
|
|
376
|
-
}
|
|
377
|
-
if (combined.includes("econnreset") || combined.includes("connection reset")) {
|
|
378
|
-
return "network_connection_reset";
|
|
379
|
-
}
|
|
380
|
-
if (combined.includes("incompleteread") || combined.includes("incomplete read")) {
|
|
381
|
-
return "network_incomplete_read";
|
|
382
|
-
}
|
|
383
|
-
if (combined.includes("remotedisconnected") || combined.includes("remote end closed connection") || combined.includes("other side closed") || combined.includes("socket hang up")) {
|
|
384
|
-
return "network_remote_disconnected";
|
|
385
|
-
}
|
|
386
|
-
if (
|
|
387
|
-
// Local filenames and retry commands may contain "ssl" or "tls".
|
|
388
|
-
// Require a transport identifier or protocol failure text instead.
|
|
389
|
-
code.includes("ssl") || code.includes("tls") || name.includes("ssl") || name.includes("tls") || /(?:^|[\s[(:])(?:ssl|tls)[\s:_-]+(?:error|handshake|certificate|routines|connection|failed|failure)(?:$|[\s:_-])/.test(
|
|
390
|
-
text
|
|
391
|
-
) || combined.includes("unexpected_eof_while_reading")
|
|
392
|
-
) {
|
|
393
|
-
return "network_ssl_error";
|
|
394
|
-
}
|
|
395
|
-
current = _nullishCoalesce(record.cause, () => ( record.context));
|
|
396
|
-
}
|
|
397
|
-
return "network_error";
|
|
398
|
-
}
|
|
399
|
-
function classifyNetworkCauseCategory(error) {
|
|
400
|
-
const seen = /* @__PURE__ */ new Set();
|
|
401
|
-
let cause = error;
|
|
402
|
-
while (cause && typeof cause === "object" && !seen.has(cause)) {
|
|
403
|
-
seen.add(cause);
|
|
404
|
-
const record = cause;
|
|
405
|
-
if (record.code === "UND_ERR_CONNECT_TIMEOUT") return "connect_timeout";
|
|
406
|
-
cause = record.cause;
|
|
407
|
-
}
|
|
408
|
-
switch (classifyNetworkFailure(error)) {
|
|
409
|
-
case "network_dns_resolution_failed":
|
|
410
|
-
return "dns";
|
|
411
|
-
case "network_ssl_error":
|
|
412
|
-
return "tls";
|
|
413
|
-
case "network_connection_reset":
|
|
414
|
-
return "reset";
|
|
415
|
-
case "network_timeout":
|
|
416
|
-
return "timeout";
|
|
417
|
-
default:
|
|
418
|
-
return "unknown";
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
function isNetworkFailure(error) {
|
|
422
|
-
if (!(error instanceof Error)) return false;
|
|
423
|
-
if (error instanceof _chunkDIAWYWT5js.DeeplineError && error.statusCode) return false;
|
|
424
|
-
const code = classifyNetworkFailure(error);
|
|
425
|
-
return code !== "network_error" || /unable to connect|unable to stream/i.test(error.message);
|
|
426
|
-
}
|
|
427
|
-
function buildEnvironmentContext() {
|
|
428
|
-
const context = {
|
|
429
|
-
os: _os.platform.call(void 0, ),
|
|
430
|
-
os_release: _os.release.call(void 0, ),
|
|
431
|
-
platform: `${_os.platform.call(void 0, )}-${_os.release.call(void 0, )}-${process.arch}`,
|
|
432
|
-
node_version: process.version,
|
|
433
|
-
runtime: "Node.js",
|
|
434
|
-
hostname: _os.hostname.call(void 0, ),
|
|
435
|
-
agent_runtime: _chunkUJMBG5JUjs.detectAgentRuntime.call(void 0, )
|
|
436
|
-
};
|
|
437
|
-
for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
|
|
438
|
-
const normalized = _optionalChain([process, 'access', _57 => _57.env, 'access', _58 => _58[key], 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]);
|
|
439
|
-
if (normalized) context[key.toLowerCase()] = normalized;
|
|
440
|
-
}
|
|
441
|
-
if (_optionalChain([process, 'access', _61 => _61.env, 'access', _62 => _62.CLAUDE_PROJECT_DIR, 'optionalAccess', _63 => _63.trim, 'call', _64 => _64()])) {
|
|
442
|
-
context.claude_project_dir_present = "true";
|
|
443
|
-
}
|
|
444
|
-
if (_optionalChain([process, 'access', _65 => _65.env, 'access', _66 => _66.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()])) {
|
|
445
|
-
context.deepline_plugin_root_present = "true";
|
|
446
|
-
}
|
|
447
|
-
if (_optionalChain([process, 'access', _69 => _69.env, 'access', _70 => _70.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _71 => _71.trim, 'call', _72 => _72()])) {
|
|
448
|
-
context.deepline_plugin_skills_dir_present = "true";
|
|
449
|
-
}
|
|
450
|
-
if (_optionalChain([process, 'access', _73 => _73.env, 'access', _74 => _74.HOME, 'optionalAccess', _75 => _75.trim, 'call', _76 => _76(), 'access', _77 => _77.startsWith, 'call', _78 => _78("/sessions/")])) {
|
|
451
|
-
context.home_scope = "sessions";
|
|
452
|
-
}
|
|
453
|
-
return context;
|
|
454
|
-
}
|
|
455
|
-
function failureReportHeaders(apiKey) {
|
|
456
|
-
const agentSessionId = _chunkUJMBG5JUjs.agentSessionIdFromEnvironment.call(void 0, );
|
|
457
|
-
return {
|
|
458
|
-
..._chunkUJMBG5JUjs.deploymentProtectionHeaders.call(void 0, ),
|
|
459
|
-
...agentSessionId ? { "X-Deepline-Agent-Session-Id": agentSessionId } : {},
|
|
460
|
-
Authorization: `Bearer ${apiKey}`,
|
|
461
|
-
"Content-Type": "application/json",
|
|
462
|
-
"User-Agent": `deepline-ts-sdk/${_chunkUJMBG5JUjs.SDK_VERSION}`,
|
|
463
|
-
"X-Deepline-Client-Family": "sdk",
|
|
464
|
-
"X-Deepline-CLI-Family": "sdk",
|
|
465
|
-
"X-Deepline-Agent-Runtime": _chunkUJMBG5JUjs.detectAgentRuntime.call(void 0, ),
|
|
466
|
-
"X-Deepline-CLI-Version": _chunkUJMBG5JUjs.SDK_VERSION,
|
|
467
|
-
"X-Deepline-SDK-Version": _chunkUJMBG5JUjs.SDK_VERSION
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
async function postFailureReport(input) {
|
|
471
|
-
const controller = new AbortController();
|
|
472
|
-
const timeout = setTimeout(() => controller.abort(), input.timeoutMs);
|
|
473
|
-
if (input.background) timeout.unref();
|
|
474
|
-
try {
|
|
475
|
-
await fetch(new URL("/api/v2/cli/report-failure", input.baseUrl), {
|
|
476
|
-
method: "POST",
|
|
477
|
-
headers: failureReportHeaders(input.apiKey),
|
|
478
|
-
body: JSON.stringify(input.body),
|
|
479
|
-
signal: controller.signal
|
|
480
|
-
});
|
|
481
|
-
return true;
|
|
482
|
-
} catch (e7) {
|
|
483
|
-
return false;
|
|
484
|
-
} finally {
|
|
485
|
-
clearTimeout(timeout);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
function boundedTelemetryString(value, maxChars) {
|
|
489
|
-
return redactFailureText(value.trim(), maxChars);
|
|
490
|
-
}
|
|
491
|
-
async function maybeReportAutomaticSkillsSyncFailure(input) {
|
|
492
|
-
if (isFailureReportingDisabled()) return false;
|
|
493
|
-
let apiKey = "";
|
|
494
|
-
try {
|
|
495
|
-
apiKey = _chunkWBIDPDKJjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
|
|
496
|
-
} catch (e8) {
|
|
497
|
-
return false;
|
|
498
|
-
}
|
|
499
|
-
if (!apiKey) return false;
|
|
500
|
-
const attempts = input.attempts.slice(0, 2).map((attempt) => ({
|
|
501
|
-
installer: attempt.installer,
|
|
502
|
-
outcome: attempt.outcome,
|
|
503
|
-
exit_code: typeof attempt.exitCode === "number" && Number.isFinite(attempt.exitCode) ? Math.trunc(attempt.exitCode) : null
|
|
504
|
-
}));
|
|
505
|
-
const agents = input.agents.slice(0, 8).map((agent) => boundedTelemetryString(agent, 100)).filter(Boolean);
|
|
506
|
-
const baseUrl = input.baseUrl.replace(/\/$/, "");
|
|
507
|
-
const failureKind = "background_warning";
|
|
508
|
-
const failureCode2 = "SKILLS_AUTO_SYNC_FAILED";
|
|
509
|
-
const failureStage = "skills_install";
|
|
510
|
-
return postFailureReport({
|
|
511
|
-
baseUrl,
|
|
512
|
-
apiKey,
|
|
513
|
-
timeoutMs: BACKGROUND_REPORT_FAILURE_TIMEOUT_MS,
|
|
514
|
-
background: true,
|
|
515
|
-
body: {
|
|
516
|
-
command: "deepline skills",
|
|
517
|
-
subcommand: "skills",
|
|
518
|
-
failure_kind: failureKind,
|
|
519
|
-
failure_code: failureCode2,
|
|
520
|
-
failure_stage: failureStage,
|
|
521
|
-
error_body: "Automatic Deepline skills installation failed.",
|
|
522
|
-
cli_version: _chunkUJMBG5JUjs.SDK_VERSION,
|
|
523
|
-
context: {
|
|
524
|
-
environment: buildEnvironmentContext(),
|
|
525
|
-
skills_sync: {
|
|
526
|
-
skills_package: boundedTelemetryString(input.skillsPackage, 100),
|
|
527
|
-
remote_skills_version: boundedTelemetryString(
|
|
528
|
-
input.remoteSkillsVersion,
|
|
529
|
-
200
|
|
530
|
-
),
|
|
531
|
-
agents,
|
|
532
|
-
target_skill_count: Math.max(
|
|
533
|
-
0,
|
|
534
|
-
Math.trunc(
|
|
535
|
-
Number.isFinite(input.targetSkillCount) ? input.targetSkillCount : 0
|
|
536
|
-
)
|
|
537
|
-
),
|
|
538
|
-
marker_written: input.markerWritten,
|
|
539
|
-
attempts
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
function subcommandFromArgv(argv) {
|
|
546
|
-
return _nullishCoalesce(argv.find((arg) => arg && !arg.startsWith("-")), () => ( null));
|
|
547
|
-
}
|
|
548
|
-
function commandTokens(argv) {
|
|
549
|
-
return argv.map((arg) => String(_nullishCoalesce(arg, () => ( ""))).trim()).filter((arg) => arg && !arg.startsWith("-"));
|
|
550
|
-
}
|
|
551
|
-
function isServerLoggedPlayRunStartFailure(input) {
|
|
552
|
-
const [subcommand, command] = commandTokens(input.argv);
|
|
553
|
-
return subcommand === "plays" && command === "run" && input.error instanceof _chunkDIAWYWT5js.DeeplineError && typeof input.error.statusCode === "number";
|
|
554
|
-
}
|
|
555
|
-
function shouldReport(input) {
|
|
556
|
-
if (input.error !== void 0) return true;
|
|
557
|
-
return input.exitCode !== null && REPORTABLE_EXIT_CODES.has(input.exitCode);
|
|
558
|
-
}
|
|
559
|
-
function failureCode(input) {
|
|
560
|
-
if (input.error !== void 0) {
|
|
561
|
-
if (isNetworkFailure(input.error))
|
|
562
|
-
return classifyNetworkFailure(input.error);
|
|
563
|
-
if (input.error instanceof _chunkDIAWYWT5js.DeeplineError && input.error.code) {
|
|
564
|
-
return input.error.code;
|
|
565
|
-
}
|
|
566
|
-
if (input.error instanceof Error && input.error.name)
|
|
567
|
-
return input.error.name;
|
|
568
|
-
return "CLI_FAILURE";
|
|
569
|
-
}
|
|
570
|
-
return input.exitCode === 4 ? "network_error" : "command_exit";
|
|
571
|
-
}
|
|
572
|
-
function resolvedExitCode(input) {
|
|
573
|
-
if (typeof input.exitCode === "number" && Number.isFinite(input.exitCode)) {
|
|
574
|
-
return Math.trunc(input.exitCode);
|
|
575
|
-
}
|
|
576
|
-
if (input.error === void 0) return null;
|
|
577
|
-
return isNetworkFailure(input.error) ? 4 : 5;
|
|
578
|
-
}
|
|
579
|
-
function resolveSdkCliFailureExitCode(error) {
|
|
580
|
-
return isNetworkFailure(error) ? 4 : 1;
|
|
581
|
-
}
|
|
582
|
-
function resolvedFailureKind(input) {
|
|
583
|
-
return input.error === void 0 ? "command_exit" : "uncaught_exception";
|
|
584
|
-
}
|
|
585
|
-
function safeRequestDiagnostics(error) {
|
|
586
|
-
if (!(error instanceof _chunkDIAWYWT5js.DeeplineError)) return null;
|
|
587
|
-
const request = _optionalChain([error, 'access', _79 => _79.details, 'optionalAccess', _80 => _80.request]);
|
|
588
|
-
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
589
|
-
return null;
|
|
590
|
-
const value = request;
|
|
591
|
-
const result = {};
|
|
592
|
-
if (typeof value.phase === "string" && [
|
|
593
|
-
"before_request",
|
|
594
|
-
"retry_wait",
|
|
595
|
-
"awaiting_headers",
|
|
596
|
-
"reading_body"
|
|
597
|
-
].includes(value.phase))
|
|
598
|
-
result.phase = value.phase;
|
|
599
|
-
if (typeof value.method === "string" && /^(GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS)$/.test(value.method))
|
|
600
|
-
result.method = value.method;
|
|
601
|
-
if (typeof value.url === "string") {
|
|
602
|
-
try {
|
|
603
|
-
const url = new URL(value.url);
|
|
604
|
-
if (url.protocol === "https:" || url.protocol === "http:") {
|
|
605
|
-
result.url = redactFailureText(`${url.origin}${url.pathname}`, 1e3);
|
|
606
|
-
}
|
|
607
|
-
} catch (e9) {
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
if (typeof value.failedAtUtc === "string" && Number.isFinite(Date.parse(value.failedAtUtc))) {
|
|
611
|
-
result.failedAtUtc = new Date(value.failedAtUtc).toISOString();
|
|
612
|
-
}
|
|
613
|
-
for (const key of ["elapsedMs", "attempts"]) {
|
|
614
|
-
const number = value[key];
|
|
615
|
-
if (typeof number === "number" && Number.isSafeInteger(number) && number >= 0)
|
|
616
|
-
result[key] = number;
|
|
617
|
-
}
|
|
618
|
-
return Object.keys(result).length > 0 ? result : null;
|
|
619
|
-
}
|
|
620
|
-
function buildFailureReport(input) {
|
|
621
|
-
const durationMs = Math.max(0, Date.now() - input.startedAtMs);
|
|
622
|
-
const request = safeRequestDiagnostics(input.error);
|
|
623
|
-
const failureKind = resolvedFailureKind({
|
|
624
|
-
exitCode: input.exitCode,
|
|
625
|
-
error: input.error
|
|
626
|
-
});
|
|
627
|
-
const code = failureCode({ exitCode: input.exitCode, error: input.error });
|
|
628
|
-
const errorBody = input.error === void 0 ? `SDK CLI command exited ${_nullishCoalesce(input.exitCode, () => ( "unknown"))}` : errorMessage(input.error);
|
|
629
|
-
const networkCauseCategory = input.error !== void 0 && isNetworkFailure(input.error) ? classifyNetworkCauseCategory(input.error) : null;
|
|
630
|
-
return {
|
|
631
|
-
command: sanitizeCommand(input.argv),
|
|
632
|
-
subcommand: subcommandFromArgv(input.argv),
|
|
633
|
-
error_status: input.exitCode,
|
|
634
|
-
error_body: redactFailureText(errorBody),
|
|
635
|
-
exit_code: input.exitCode,
|
|
636
|
-
duration_ms: durationMs,
|
|
637
|
-
error_class: input.error instanceof Error ? input.error.name : null,
|
|
638
|
-
stack_trace: errorStack(input.error),
|
|
639
|
-
failure_kind: failureKind,
|
|
640
|
-
failure_code: code,
|
|
641
|
-
failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
|
|
642
|
-
cli_version: _chunkUJMBG5JUjs.SDK_VERSION,
|
|
643
|
-
context: {
|
|
644
|
-
base_url: redactFailureText(input.baseUrl, 400),
|
|
645
|
-
command_summary: sanitizeCommand(input.argv),
|
|
646
|
-
environment: buildEnvironmentContext(),
|
|
647
|
-
...request ? { request } : {},
|
|
648
|
-
failure_kind: failureKind,
|
|
649
|
-
failure_code: code,
|
|
650
|
-
failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
|
|
651
|
-
duration_ms: durationMs,
|
|
652
|
-
...input.exitCode !== null ? { exit_code: input.exitCode } : {},
|
|
653
|
-
...networkCauseCategory ? { network_cause_category: networkCauseCategory } : {}
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
}
|
|
657
|
-
async function maybeReportSdkCliFailure(input) {
|
|
658
|
-
if (isFailureReportingDisabled()) return false;
|
|
659
|
-
if (isServerLoggedPlayRunStartFailure(input)) return false;
|
|
660
|
-
const exitCode = resolvedExitCode(input);
|
|
661
|
-
if (!shouldReport({ exitCode, error: input.error })) return false;
|
|
662
|
-
const baseUrl = _chunkWBIDPDKJjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
|
|
663
|
-
const apiKey = _chunkWBIDPDKJjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
|
|
664
|
-
if (!apiKey) return false;
|
|
665
|
-
return postFailureReport({
|
|
666
|
-
baseUrl,
|
|
667
|
-
apiKey,
|
|
668
|
-
timeoutMs: REPORT_FAILURE_TIMEOUT_MS,
|
|
669
|
-
body: buildFailureReport({
|
|
670
|
-
argv: input.argv,
|
|
671
|
-
startedAtMs: input.startedAtMs,
|
|
672
|
-
error: input.error,
|
|
673
|
-
exitCode,
|
|
674
|
-
baseUrl
|
|
675
|
-
})
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
|
|
679
295
|
// contracts/install-commands.json
|
|
680
296
|
var install_commands_default = {
|
|
681
297
|
skills: {
|
|
@@ -770,7 +386,7 @@ function skillsSourceUrl(baseUrl) {
|
|
|
770
386
|
function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
771
387
|
const skillNames = Array.isArray(skillName) ? skillName : [skillName];
|
|
772
388
|
const [firstSkillName, ...extraSkillNames] = skillNames;
|
|
773
|
-
const agents = _nullishCoalesce(options.agents, () => (
|
|
389
|
+
const agents = _nullishCoalesce(options.agents, () => ( _chunkMHRR47VQjs.DEFAULT_SKILL_AGENTS));
|
|
774
390
|
const values = {
|
|
775
391
|
skills_index_url: skillsIndexUrl(baseUrl),
|
|
776
392
|
skills_source_url: skillsSourceUrl(baseUrl),
|
|
@@ -810,8 +426,8 @@ function escapeCmdArgument(arg, forBatchFile = true) {
|
|
|
810
426
|
function escapeCmdCommand(command) {
|
|
811
427
|
return command.replace(CMD_META_CHARS, "^$1");
|
|
812
428
|
}
|
|
813
|
-
function resolveShellSpawn(command, args,
|
|
814
|
-
if (
|
|
429
|
+
function resolveShellSpawn(command, args, platform = process.platform, env = process.env, cwd = process.cwd()) {
|
|
430
|
+
if (platform !== "win32") {
|
|
815
431
|
return { command, args: [...args], shell: false };
|
|
816
432
|
}
|
|
817
433
|
const resolved = resolveWindowsExecutable(command, env, cwd);
|
|
@@ -844,13 +460,39 @@ function resolveWindowsExecutable(command, env, cwd) {
|
|
|
844
460
|
) : _path.win32.resolve(cwd, command + extension);
|
|
845
461
|
try {
|
|
846
462
|
if (_fs.statSync.call(void 0, candidate).isFile()) return candidate;
|
|
847
|
-
} catch (
|
|
463
|
+
} catch (e7) {
|
|
848
464
|
}
|
|
849
465
|
}
|
|
850
466
|
}
|
|
851
467
|
return void 0;
|
|
852
468
|
}
|
|
853
469
|
|
|
470
|
+
// src/cli/skills-sync-preferences.ts
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
function skillsSyncDisabledPath() {
|
|
475
|
+
return _path.join.call(void 0,
|
|
476
|
+
_optionalChain([process, 'access', _53 => _53.env, 'access', _54 => _54.HOME, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()]) || _os.homedir.call(void 0, ),
|
|
477
|
+
".local",
|
|
478
|
+
"deepline",
|
|
479
|
+
"sdk-cli",
|
|
480
|
+
"skills-sync-disabled"
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
function isCliSkillsSyncEnabled() {
|
|
484
|
+
return !_fs.existsSync.call(void 0, skillsSyncDisabledPath());
|
|
485
|
+
}
|
|
486
|
+
function setCliSkillsSyncEnabled(enabled) {
|
|
487
|
+
const path = skillsSyncDisabledPath();
|
|
488
|
+
if (enabled) {
|
|
489
|
+
_fs.rmSync.call(void 0, path, { force: true });
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
|
|
493
|
+
_fs.writeFileSync.call(void 0, path, "", { flag: "a", mode: 384 });
|
|
494
|
+
}
|
|
495
|
+
|
|
854
496
|
// src/cli/skills-sync.ts
|
|
855
497
|
var _child_process = require('child_process');
|
|
856
498
|
|
|
@@ -872,25 +514,25 @@ var CHECK_TIMEOUT_MS2 = 3e3;
|
|
|
872
514
|
var INSTALLER_PROBE_TIMEOUT_MS = 1e3;
|
|
873
515
|
var PUBLISHED_VERIFICATION_RETRY_MS = 5 * 6e4;
|
|
874
516
|
function shouldSkipSkillsSync() {
|
|
875
|
-
if (
|
|
517
|
+
if (_chunkFWSEGIT6js.detectAgentRuntime.call(void 0, ) === "claude_cowork" || isCiEnvironment()) {
|
|
876
518
|
return true;
|
|
877
519
|
}
|
|
878
|
-
const value = _optionalChain([process, 'access',
|
|
879
|
-
return value === "1" || value === "true" || value === "yes" || value === "on";
|
|
520
|
+
const value = _optionalChain([process, 'access', _57 => _57.env, 'access', _58 => _58.DEEPLINE_SKIP_SKILLS_SYNC, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60(), 'access', _61 => _61.toLowerCase, 'call', _62 => _62()]);
|
|
521
|
+
return value === "1" || value === "true" || value === "yes" || value === "on" || !isCliSkillsSyncEnabled();
|
|
880
522
|
}
|
|
881
523
|
function unavailableSkillsNoticePath(baseUrl) {
|
|
882
|
-
return _path.join.call(void 0,
|
|
524
|
+
return _path.join.call(void 0, _chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-sync-unavailable-version");
|
|
883
525
|
}
|
|
884
526
|
var SKILLS_SYNC_IN_PROGRESS_TTL_MS = 10 * 60 * 1e3;
|
|
885
527
|
var SKILLS_SYNC_IN_PROGRESS_PID_CAP_MS = 6 * 60 * 60 * 1e3;
|
|
886
|
-
var agentLeaseSegment =
|
|
528
|
+
var agentLeaseSegment = _chunkMHRR47VQjs.skillsAgentPathSegment;
|
|
887
529
|
function sortedLeaseAgents(agents) {
|
|
888
|
-
const expanded = agents.includes("*") ? [...agents, ...
|
|
530
|
+
const expanded = agents.includes("*") ? [...agents, ..._chunkMHRR47VQjs.KNOWN_SKILL_AGENTS] : agents;
|
|
889
531
|
return [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
|
|
890
532
|
}
|
|
891
533
|
function inProgressSkillsSyncPath(baseUrl, agent) {
|
|
892
534
|
return _path.join.call(void 0,
|
|
893
|
-
|
|
535
|
+
_chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
894
536
|
`skills-sync-in-progress-${agentLeaseSegment(agent)}`
|
|
895
537
|
);
|
|
896
538
|
}
|
|
@@ -950,7 +592,7 @@ function quarantine(path, tag) {
|
|
|
950
592
|
try {
|
|
951
593
|
_fs.renameSync.call(void 0, path, holding);
|
|
952
594
|
return holding;
|
|
953
|
-
} catch (
|
|
595
|
+
} catch (e8) {
|
|
954
596
|
return null;
|
|
955
597
|
}
|
|
956
598
|
}
|
|
@@ -1049,7 +691,7 @@ var SkillsStateUnavailableError = class extends Error {
|
|
|
1049
691
|
constructor(baseUrl, error) {
|
|
1050
692
|
const detail = error instanceof Error ? error.message : String(error);
|
|
1051
693
|
super(
|
|
1052
|
-
`Could not save skills state in ${
|
|
694
|
+
`Could not save skills state in ${_chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl)}: ${detail}`
|
|
1053
695
|
);
|
|
1054
696
|
this.name = "SkillsStateUnavailableError";
|
|
1055
697
|
}
|
|
@@ -1070,7 +712,7 @@ function recordOwnPidOnInProgressSkillsSync(baseUrl, leases) {
|
|
|
1070
712
|
`,
|
|
1071
713
|
"utf-8"
|
|
1072
714
|
);
|
|
1073
|
-
} catch (
|
|
715
|
+
} catch (e9) {
|
|
1074
716
|
}
|
|
1075
717
|
}
|
|
1076
718
|
}
|
|
@@ -1080,7 +722,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
|
|
|
1080
722
|
if (!claimToken) {
|
|
1081
723
|
try {
|
|
1082
724
|
_fs.rmSync.call(void 0, dir, { recursive: true, force: true });
|
|
1083
|
-
} catch (
|
|
725
|
+
} catch (e10) {
|
|
1084
726
|
}
|
|
1085
727
|
continue;
|
|
1086
728
|
}
|
|
@@ -1091,7 +733,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
|
|
|
1091
733
|
_fs.renameSync.call(void 0, tombstone, dir);
|
|
1092
734
|
continue;
|
|
1093
735
|
}
|
|
1094
|
-
} catch (
|
|
736
|
+
} catch (e11) {
|
|
1095
737
|
}
|
|
1096
738
|
_fs.rmSync.call(void 0, tombstone, { recursive: true, force: true });
|
|
1097
739
|
}
|
|
@@ -1124,7 +766,7 @@ async function acquireSkillsInstallLease(baseUrl, agents, version, options = {
|
|
|
1124
766
|
if (Date.now() >= deadline) return null;
|
|
1125
767
|
if (!waited) {
|
|
1126
768
|
waited = true;
|
|
1127
|
-
_optionalChain([options, 'access',
|
|
769
|
+
_optionalChain([options, 'access', _63 => _63.onWait, 'optionalCall', _64 => _64()]);
|
|
1128
770
|
}
|
|
1129
771
|
await new Promise((resolve) => setTimeout(resolve, pollMs));
|
|
1130
772
|
}
|
|
@@ -1134,7 +776,7 @@ function skillsInstallLeasePath(baseUrl, agents) {
|
|
|
1134
776
|
}
|
|
1135
777
|
function deferredSkillsNoticePath(baseUrl, agents) {
|
|
1136
778
|
return _path.join.call(void 0,
|
|
1137
|
-
|
|
779
|
+
_chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
1138
780
|
`skills-sync-notice-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}`
|
|
1139
781
|
);
|
|
1140
782
|
}
|
|
@@ -1145,7 +787,7 @@ function deferSkillsNotice(baseUrl, agents) {
|
|
|
1145
787
|
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
|
|
1146
788
|
_fs.appendFileSync.call(void 0, path, `${text.trimEnd()}
|
|
1147
789
|
`, "utf-8");
|
|
1148
|
-
} catch (
|
|
790
|
+
} catch (e12) {
|
|
1149
791
|
}
|
|
1150
792
|
};
|
|
1151
793
|
}
|
|
@@ -1157,19 +799,19 @@ function flushDeferredSkillsNotices(baseUrl, agents) {
|
|
|
1157
799
|
let text = "";
|
|
1158
800
|
try {
|
|
1159
801
|
text = _fs.readFileSync.call(void 0, tombstone, "utf-8");
|
|
1160
|
-
} catch (
|
|
802
|
+
} catch (e13) {
|
|
1161
803
|
return;
|
|
1162
804
|
} finally {
|
|
1163
805
|
try {
|
|
1164
806
|
_fs.unlinkSync.call(void 0, tombstone);
|
|
1165
|
-
} catch (
|
|
807
|
+
} catch (e14) {
|
|
1166
808
|
}
|
|
1167
809
|
}
|
|
1168
810
|
if (text.trim()) writeSdkSkillsStatusLine(text.trimEnd());
|
|
1169
811
|
}
|
|
1170
812
|
function flushDeferredSkillsSyncNotices(baseUrl) {
|
|
1171
|
-
if (shouldSkipSkillsSync() ||
|
|
1172
|
-
const agents =
|
|
813
|
+
if (shouldSkipSkillsSync() || _chunkMHRR47VQjs.hasActivePluginSkills.call(void 0, )) return;
|
|
814
|
+
const agents = _chunkMHRR47VQjs.resolveAutoSyncSkillAgents.call(void 0, );
|
|
1173
815
|
if (agents.length === 0) return;
|
|
1174
816
|
flushDeferredSkillsNotices(baseUrl, agents);
|
|
1175
817
|
}
|
|
@@ -1180,12 +822,12 @@ function spawnDetachedSkillsSyncChild(argv, onSpawnError) {
|
|
|
1180
822
|
stdio: "ignore",
|
|
1181
823
|
env: process.env
|
|
1182
824
|
});
|
|
1183
|
-
child.on("error", () => _optionalChain([onSpawnError, 'optionalCall',
|
|
825
|
+
child.on("error", () => _optionalChain([onSpawnError, 'optionalCall', _65 => _65()]));
|
|
1184
826
|
child.unref();
|
|
1185
827
|
}
|
|
1186
828
|
function failedSkillsSyncPath(baseUrl, agents) {
|
|
1187
829
|
return _path.join.call(void 0,
|
|
1188
|
-
|
|
830
|
+
_chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
1189
831
|
`skills-sync-failed-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}-version`
|
|
1190
832
|
);
|
|
1191
833
|
}
|
|
@@ -1195,7 +837,7 @@ function hasMarkedSkillsSyncVersion(path, version) {
|
|
|
1195
837
|
function readMarkedSkillsSyncVersion(path) {
|
|
1196
838
|
try {
|
|
1197
839
|
return _fs.existsSync.call(void 0, path) ? _fs.readFileSync.call(void 0, path, "utf-8").trim() : "";
|
|
1198
|
-
} catch (
|
|
840
|
+
} catch (e15) {
|
|
1199
841
|
return "";
|
|
1200
842
|
}
|
|
1201
843
|
}
|
|
@@ -1205,7 +847,7 @@ function writeMarkedSkillsSyncVersion(path, version) {
|
|
|
1205
847
|
_fs.writeFileSync.call(void 0, path, `${version}
|
|
1206
848
|
`, "utf-8");
|
|
1207
849
|
return true;
|
|
1208
|
-
} catch (
|
|
850
|
+
} catch (e16) {
|
|
1209
851
|
return false;
|
|
1210
852
|
}
|
|
1211
853
|
}
|
|
@@ -1214,8 +856,8 @@ function writeUnavailableSkillsNotice(baseUrl, remoteVersion, skillNames, reason
|
|
|
1214
856
|
if (hasMarkedSkillsSyncVersion(path, remoteVersion)) return;
|
|
1215
857
|
writeMarkedSkillsSyncVersion(path, remoteVersion);
|
|
1216
858
|
const probes = reason === "no-installer" ? _nullishCoalesce(knownProbes, () => ( probeInstallers())) : null;
|
|
1217
|
-
const manualCommand = _optionalChain([probes, 'optionalAccess',
|
|
1218
|
-
const explanation = reason === "unsupported-agent" ? "the detected agent has no automatic skills sync target. Automatic sync was skipped." : _optionalChain([probes, 'optionalAccess',
|
|
859
|
+
const manualCommand = _optionalChain([probes, 'optionalAccess', _66 => _66.npx]) === "missing" && probes.bunx !== "missing" ? `bunx ${buildBunxSkillsInstallArgs(baseUrl, skillNames, _chunkMHRR47VQjs.DEFAULT_SKILL_AGENTS).map(shellQuote).join(" ")}` : `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
|
|
860
|
+
const explanation = reason === "unsupported-agent" ? "the detected agent has no automatic skills sync target. Automatic sync was skipped." : _optionalChain([probes, 'optionalAccess', _67 => _67.bunx]) === "missing" && probes.npx === "missing" ? "neither `bunx` nor `npx` was found on PATH. Make one available." : `installer version check failed for ${Object.entries(_nullishCoalesce(probes, () => ( {}))).filter(([, result]) => result === "failed").map(([command]) => `\`${command}\``).join(" and ")}. Check those commands with --version.`;
|
|
1219
861
|
notice(
|
|
1220
862
|
`Deepline agent skills are out of date, but ${explanation} To install manually, run:
|
|
1221
863
|
${manualCommand}`
|
|
@@ -1224,7 +866,7 @@ ${manualCommand}`
|
|
|
1224
866
|
function clearUnavailableSkillsNotice(baseUrl) {
|
|
1225
867
|
try {
|
|
1226
868
|
_fs.unlinkSync.call(void 0, unavailableSkillsNoticePath(baseUrl));
|
|
1227
|
-
} catch (
|
|
869
|
+
} catch (e17) {
|
|
1228
870
|
}
|
|
1229
871
|
}
|
|
1230
872
|
function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
@@ -1236,7 +878,7 @@ function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
|
1236
878
|
const retry = JSON.parse(marked);
|
|
1237
879
|
const now = Date.now();
|
|
1238
880
|
return retry.version === remoteVersion && typeof retry.retryAfter === "number" && retry.retryAfter > now && retry.retryAfter <= now + PUBLISHED_VERIFICATION_RETRY_MS;
|
|
1239
|
-
} catch (
|
|
881
|
+
} catch (e18) {
|
|
1240
882
|
return false;
|
|
1241
883
|
}
|
|
1242
884
|
}
|
|
@@ -1261,7 +903,7 @@ function deferPublishedVerificationRetry(baseUrl, remoteVersion, agents) {
|
|
|
1261
903
|
function clearFailedSkillsSync(baseUrl, agents) {
|
|
1262
904
|
try {
|
|
1263
905
|
_fs.unlinkSync.call(void 0, failedSkillsSyncPath(baseUrl, agents));
|
|
1264
|
-
} catch (
|
|
906
|
+
} catch (e19) {
|
|
1265
907
|
}
|
|
1266
908
|
}
|
|
1267
909
|
function clearFailedAutomaticSkillsSync(baseUrl, agents) {
|
|
@@ -1284,14 +926,14 @@ async function fetchV1SkillIndex(baseUrl) {
|
|
|
1284
926
|
if (!response.ok) return null;
|
|
1285
927
|
const data = await response.json().catch(() => null);
|
|
1286
928
|
return data;
|
|
1287
|
-
} catch (
|
|
929
|
+
} catch (e20) {
|
|
1288
930
|
return null;
|
|
1289
931
|
} finally {
|
|
1290
932
|
clearTimeout(timeout);
|
|
1291
933
|
}
|
|
1292
934
|
}
|
|
1293
935
|
function v1SkillNames(index) {
|
|
1294
|
-
const skills = Array.isArray(_optionalChain([index, 'optionalAccess',
|
|
936
|
+
const skills = Array.isArray(_optionalChain([index, 'optionalAccess', _68 => _68.skills])) ? index.skills : [];
|
|
1295
937
|
return sortedUniqueSkillNames(
|
|
1296
938
|
skills.filter((skill) => skill && skill.install_surface === "v1").map((skill) => skill.name).filter(
|
|
1297
939
|
(name) => typeof name === "string" && name.length > 0
|
|
@@ -1302,7 +944,7 @@ function buildSdkSkillNames(v1SkillNames2) {
|
|
|
1302
944
|
return sortedUniqueSkillNames(v1SkillNames2);
|
|
1303
945
|
}
|
|
1304
946
|
function isDefaultAgentSet(agents) {
|
|
1305
|
-
return agents.length ===
|
|
947
|
+
return agents.length === _chunkMHRR47VQjs.DEFAULT_SKILL_AGENTS.length && agents.every((agent, index) => agent === _chunkMHRR47VQjs.DEFAULT_SKILL_AGENTS[index]);
|
|
1306
948
|
}
|
|
1307
949
|
function safeSkillFilePath(value) {
|
|
1308
950
|
if (typeof value !== "string" || !value) return false;
|
|
@@ -1362,7 +1004,7 @@ function publishedArchiveFiles(bytes, expectedFiles, name) {
|
|
|
1362
1004
|
var PublishedSkillsVerificationError = class extends Error {
|
|
1363
1005
|
};
|
|
1364
1006
|
async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillNames, index) {
|
|
1365
|
-
if (_optionalChain([index, 'optionalAccess',
|
|
1007
|
+
if (_optionalChain([index, 'optionalAccess', _69 => _69.version]) !== remoteVersion) {
|
|
1366
1008
|
throw new PublishedSkillsVerificationError(
|
|
1367
1009
|
"the published skill index version does not match the server version"
|
|
1368
1010
|
);
|
|
@@ -1378,7 +1020,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
|
|
|
1378
1020
|
const entry = entries.find(
|
|
1379
1021
|
(skill) => skill && skill.name === name && skill.install_surface === "v1"
|
|
1380
1022
|
);
|
|
1381
|
-
if (!Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
1023
|
+
if (!Array.isArray(_optionalChain([entry, 'optionalAccess', _70 => _70.files])) || !entry.files.length || !entry.files.every(safeSkillFilePath) || new Set(entry.files).size !== entry.files.length || !entry.files.includes("SKILL.md") || entry.type !== "archive" || entry.url !== `./archives/${name}.tar.gz` || typeof entry.digest !== "string" || !/^sha256:[a-f0-9]{64}$/.test(entry.digest)) {
|
|
1382
1024
|
throw new PublishedSkillsVerificationError(
|
|
1383
1025
|
`invalid published file list for ${name}`
|
|
1384
1026
|
);
|
|
@@ -1432,7 +1074,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
|
|
|
1432
1074
|
controller.abort();
|
|
1433
1075
|
}
|
|
1434
1076
|
const home = _os.homedir.call(void 0, );
|
|
1435
|
-
const claudeConfigDir = _optionalChain([process, 'access',
|
|
1077
|
+
const claudeConfigDir = _optionalChain([process, 'access', _71 => _71.env, 'access', _72 => _72.CLAUDE_CONFIG_DIR, 'optionalAccess', _73 => _73.trim, 'call', _74 => _74()]) || _path.join.call(void 0, home, ".claude");
|
|
1436
1078
|
for (const [name, { files }] of published) {
|
|
1437
1079
|
for (const root of [
|
|
1438
1080
|
_path.join.call(void 0, home, ".agents", "skills", name),
|
|
@@ -1459,23 +1101,23 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
|
|
|
1459
1101
|
method: "POST",
|
|
1460
1102
|
headers: { "Content-Type": "application/json" },
|
|
1461
1103
|
body: JSON.stringify({
|
|
1462
|
-
sdk_cli: { version:
|
|
1104
|
+
sdk_cli: { version: _chunkFWSEGIT6js.SDK_VERSION },
|
|
1463
1105
|
skills: {
|
|
1464
1106
|
version: localVersion,
|
|
1465
|
-
capability:
|
|
1107
|
+
capability: _chunk2OY5DXTCjs.SDK_RELEASE.packageCapabilities.skillsGuidance
|
|
1466
1108
|
}
|
|
1467
1109
|
}),
|
|
1468
1110
|
signal: controller.signal
|
|
1469
1111
|
});
|
|
1470
1112
|
if (!response.ok) return null;
|
|
1471
1113
|
const data = await response.json().catch(() => null);
|
|
1472
|
-
const skills = _optionalChain([data, 'optionalAccess',
|
|
1114
|
+
const skills = _optionalChain([data, 'optionalAccess', _75 => _75.skills]);
|
|
1473
1115
|
if (!skills) return null;
|
|
1474
1116
|
return {
|
|
1475
1117
|
needsUpdate: skills.needs_update === true,
|
|
1476
|
-
remoteVersion: typeof _optionalChain([skills, 'access',
|
|
1118
|
+
remoteVersion: typeof _optionalChain([skills, 'access', _76 => _76.remote, 'optionalAccess', _77 => _77.version]) === "string" ? skills.remote.version.trim() : ""
|
|
1477
1119
|
};
|
|
1478
|
-
} catch (
|
|
1120
|
+
} catch (e21) {
|
|
1479
1121
|
return null;
|
|
1480
1122
|
} finally {
|
|
1481
1123
|
clearTimeout(timeout);
|
|
@@ -1501,7 +1143,7 @@ function probeInstallers(timeoutMs) {
|
|
|
1501
1143
|
}
|
|
1502
1144
|
function noInstallerProbePath(baseUrl) {
|
|
1503
1145
|
return _path.join.call(void 0,
|
|
1504
|
-
|
|
1146
|
+
_chunkMHRR47VQjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
1505
1147
|
"skills-sync-no-installer-unknown.json"
|
|
1506
1148
|
);
|
|
1507
1149
|
}
|
|
@@ -1509,12 +1151,12 @@ function cachedUnavailableInstallerProbes(baseUrl, remoteVersion, allowBoundedFa
|
|
|
1509
1151
|
const path = noInstallerProbePath(baseUrl);
|
|
1510
1152
|
try {
|
|
1511
1153
|
const cached = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
|
|
1512
|
-
if (typeof cached.version === "string" && (!remoteVersion || cached.version === remoteVersion) && typeof cached.checkedAt === "number" && cached.checkedAt <= Date.now() && Date.now() - cached.checkedAt < NEGATIVE_INSTALLER_PROBE_TTL_MS && (_optionalChain([cached, 'access',
|
|
1154
|
+
if (typeof cached.version === "string" && (!remoteVersion || cached.version === remoteVersion) && typeof cached.checkedAt === "number" && cached.checkedAt <= Date.now() && Date.now() - cached.checkedAt < NEGATIVE_INSTALLER_PROBE_TTL_MS && (_optionalChain([cached, 'access', _78 => _78.probes, 'optionalAccess', _79 => _79.bunx]) === "missing" || _optionalChain([cached, 'access', _80 => _80.probes, 'optionalAccess', _81 => _81.bunx]) === "failed") && (_optionalChain([cached, 'access', _82 => _82.probes, 'optionalAccess', _83 => _83.npx]) === "missing" || _optionalChain([cached, 'access', _84 => _84.probes, 'optionalAccess', _85 => _85.npx]) === "failed") && // A terminal timeout is not evidence that the unbounded child probe
|
|
1513
1155
|
// will fail. Older caches without probe provenance are ambiguous too.
|
|
1514
1156
|
(allowBoundedFailures || cached.probeTimeoutMs === null || cached.probes.bunx === "missing" && cached.probes.npx === "missing")) {
|
|
1515
1157
|
return cached.probes;
|
|
1516
1158
|
}
|
|
1517
|
-
} catch (
|
|
1159
|
+
} catch (e22) {
|
|
1518
1160
|
}
|
|
1519
1161
|
return null;
|
|
1520
1162
|
}
|
|
@@ -1533,14 +1175,14 @@ function rememberUnavailableInstallerProbes(baseUrl, remoteVersion, probes, prob
|
|
|
1533
1175
|
}),
|
|
1534
1176
|
"utf-8"
|
|
1535
1177
|
);
|
|
1536
|
-
} catch (
|
|
1178
|
+
} catch (e23) {
|
|
1537
1179
|
}
|
|
1538
1180
|
}
|
|
1539
1181
|
}
|
|
1540
1182
|
function clearUnavailableInstallerProbes(baseUrl) {
|
|
1541
1183
|
try {
|
|
1542
1184
|
_fs.unlinkSync.call(void 0, noInstallerProbePath(baseUrl));
|
|
1543
|
-
} catch (
|
|
1185
|
+
} catch (e24) {
|
|
1544
1186
|
}
|
|
1545
1187
|
}
|
|
1546
1188
|
function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
|
|
@@ -1563,7 +1205,7 @@ function probeCommand(command, timeoutMs) {
|
|
|
1563
1205
|
timeout: timeoutMs
|
|
1564
1206
|
});
|
|
1565
1207
|
if (result.status === 0) return "available";
|
|
1566
|
-
return _optionalChain([result, 'access',
|
|
1208
|
+
return _optionalChain([result, 'access', _86 => _86.error, 'optionalAccess', _87 => _87.code]) === "ENOENT" ? "missing" : "failed";
|
|
1567
1209
|
}
|
|
1568
1210
|
function hasCommand(command) {
|
|
1569
1211
|
return probeCommand(command) === "available";
|
|
@@ -1577,10 +1219,10 @@ function temporarySkillsSyncSkipCommand() {
|
|
|
1577
1219
|
}
|
|
1578
1220
|
return "DEEPLINE_SKIP_SKILLS_SYNC=1 deepline <command>";
|
|
1579
1221
|
}
|
|
1580
|
-
function resolveSkillsInstallSpawn(install,
|
|
1581
|
-
return resolveShellSpawn(install.command, install.args,
|
|
1222
|
+
function resolveSkillsInstallSpawn(install, platform = process.platform) {
|
|
1223
|
+
return resolveShellSpawn(install.command, install.args, platform);
|
|
1582
1224
|
}
|
|
1583
|
-
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents =
|
|
1225
|
+
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = _chunkMHRR47VQjs.DEFAULT_SKILL_AGENTS, knownProbes) {
|
|
1584
1226
|
const commands = [];
|
|
1585
1227
|
const probes = _nullishCoalesce(knownProbes, () => ( probeInstallers()));
|
|
1586
1228
|
if (probes.bunx === "available") {
|
|
@@ -1722,7 +1364,7 @@ function runLegacySkillsCleanup(agents) {
|
|
|
1722
1364
|
}
|
|
1723
1365
|
}
|
|
1724
1366
|
function writeSdkSkillsStatusLine(line) {
|
|
1725
|
-
const progress =
|
|
1367
|
+
const progress = _chunkYJKKOSXSjs.getActiveCliProgress.call(void 0, );
|
|
1726
1368
|
if (progress) {
|
|
1727
1369
|
progress.writeLine(line);
|
|
1728
1370
|
return;
|
|
@@ -1731,12 +1373,13 @@ function writeSdkSkillsStatusLine(line) {
|
|
|
1731
1373
|
`);
|
|
1732
1374
|
}
|
|
1733
1375
|
async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
1734
|
-
|
|
1735
|
-
|
|
1376
|
+
const skip = shouldSkipSkillsSync();
|
|
1377
|
+
if (skip && !options.claim) return;
|
|
1378
|
+
const usingPluginSkills = _chunkMHRR47VQjs.hasActivePluginSkills.call(void 0, );
|
|
1736
1379
|
if (usingPluginSkills) {
|
|
1737
1380
|
return;
|
|
1738
1381
|
}
|
|
1739
|
-
const agents =
|
|
1382
|
+
const agents = _chunkMHRR47VQjs.resolveAutoSyncSkillAgents.call(void 0, );
|
|
1740
1383
|
if (options.mode === "detached" && agents.length > 0) {
|
|
1741
1384
|
flushDeferredSkillsNotices(baseUrl, agents);
|
|
1742
1385
|
}
|
|
@@ -1748,6 +1391,10 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
1748
1391
|
if (leases && [...leases.values()].some((lease) => lease.owner !== options.claim)) {
|
|
1749
1392
|
return;
|
|
1750
1393
|
}
|
|
1394
|
+
if (skip) {
|
|
1395
|
+
if (leases) releaseInProgressSkillsSync(baseUrl, claimTokensOf(leases));
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1751
1398
|
if (leases) recordOwnPidOnInProgressSkillsSync(baseUrl, leases);
|
|
1752
1399
|
const claimedVersion = leases ? claimedSkillsVersion(leases) : "";
|
|
1753
1400
|
if (options.mode === "detached" && agents.length > 0 && options.update === void 0 && !claimedVersion) {
|
|
@@ -1764,12 +1411,12 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
1764
1411
|
return;
|
|
1765
1412
|
}
|
|
1766
1413
|
try {
|
|
1767
|
-
const localVersion =
|
|
1414
|
+
const localVersion = _chunkMHRR47VQjs.readSdkSkillsLocalVersion.call(void 0, baseUrl);
|
|
1768
1415
|
const update = options.update === void 0 ? claimedVersion ? { needsUpdate: true, remoteVersion: claimedVersion } : await fetchSkillsUpdate(baseUrl, localVersion) : options.update ? {
|
|
1769
1416
|
needsUpdate: options.update.needs_update,
|
|
1770
1417
|
remoteVersion: options.update.remote.version
|
|
1771
1418
|
} : null;
|
|
1772
|
-
if (!_optionalChain([update, 'optionalAccess',
|
|
1419
|
+
if (!_optionalChain([update, 'optionalAccess', _88 => _88.needsUpdate]) || !update.remoteVersion) {
|
|
1773
1420
|
return;
|
|
1774
1421
|
}
|
|
1775
1422
|
if (agents.length > 0 && hasFailedSkillsSync(baseUrl, update.remoteVersion, agents)) {
|
|
@@ -1886,7 +1533,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
|
|
|
1886
1533
|
update.remoteVersion,
|
|
1887
1534
|
agents
|
|
1888
1535
|
);
|
|
1889
|
-
void maybeReportAutomaticSkillsSyncFailure({
|
|
1536
|
+
void _chunkGRESJ3H3js.maybeReportAutomaticSkillsSyncFailure.call(void 0, {
|
|
1890
1537
|
baseUrl,
|
|
1891
1538
|
remoteSkillsVersion: update.remoteVersion,
|
|
1892
1539
|
agents,
|
|
@@ -1917,7 +1564,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
|
|
|
1917
1564
|
notice(
|
|
1918
1565
|
publishedFailure ? `Deepline could not verify the published skills: ${detail}. The local version remains stale; it will retry automatically on a later command.` : `Deepline agent-skills refresh could not verify the five installed targets: ${detail}. The local version remains stale. After fixing the install, remove ${failedSkillsSyncPath(baseUrl, agents)} to retry this version automatically.`
|
|
1919
1566
|
);
|
|
1920
|
-
void maybeReportAutomaticSkillsSyncFailure({
|
|
1567
|
+
void _chunkGRESJ3H3js.maybeReportAutomaticSkillsSyncFailure.call(void 0, {
|
|
1921
1568
|
baseUrl,
|
|
1922
1569
|
remoteSkillsVersion: update.remoteVersion,
|
|
1923
1570
|
agents,
|
|
@@ -1930,7 +1577,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
|
|
|
1930
1577
|
}
|
|
1931
1578
|
}
|
|
1932
1579
|
runLegacySkillsCleanup(agents);
|
|
1933
|
-
if (!
|
|
1580
|
+
if (!_chunkMHRR47VQjs.writeSdkSkillsLocalVersion.call(void 0, baseUrl, update.remoteVersion, agents)) {
|
|
1934
1581
|
notice(
|
|
1935
1582
|
"Deepline agent skills installed, but the local skills version could not be recorded. A later command will retry the refresh."
|
|
1936
1583
|
);
|
|
@@ -1965,8 +1612,4 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
|
|
|
1965
1612
|
|
|
1966
1613
|
|
|
1967
1614
|
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
exports.SDK_COMPATIBILITY_FAST_DEADLINE_MS = SDK_COMPATIBILITY_FAST_DEADLINE_MS; exports.readFreshCleanCompatibility = readFreshCleanCompatibility; exports.readTrustedCleanCompatibility = readTrustedCleanCompatibility; exports.claimUpdateAdvisory = claimUpdateAdvisory; exports.checkSdkCompatibility = checkSdkCompatibility; exports.isCiEnvironment = isCiEnvironment; exports.enforceSdkCompatibilityResponse = enforceSdkCompatibilityResponse; exports.isFailureReportingDisabled = isFailureReportingDisabled; exports.redactFailureText = redactFailureText; exports.sanitizeCommand = sanitizeCommand; exports.failureReportHeaders = failureReportHeaders; exports.resolveSdkCliFailureExitCode = resolveSdkCliFailureExitCode; exports.maybeReportSdkCliFailure = maybeReportSdkCliFailure; exports.SKILLS_NPX_PACKAGE = SKILLS_NPX_PACKAGE; exports.DEFAULT_SDK_SKILL_NAMES = DEFAULT_SDK_SKILL_NAMES; exports.LEGACY_SKILL_NAMES_TO_REMOVE = LEGACY_SKILL_NAMES_TO_REMOVE; exports.skillsSourceUrl = skillsSourceUrl; exports.resolveShellSpawn = resolveShellSpawn; exports.SkillsStateUnavailableError = SkillsStateUnavailableError; exports.acquireSkillsInstallLease = acquireSkillsInstallLease; exports.skillsInstallLeasePath = skillsInstallLeasePath; exports.flushDeferredSkillsSyncNotices = flushDeferredSkillsSyncNotices; exports.SKILLS_AUTO_SYNC_COMMAND = SKILLS_AUTO_SYNC_COMMAND; exports.hasFailedAutomaticSkillsSync = hasFailedAutomaticSkillsSync; exports.clearFailedAutomaticSkillsSync = clearFailedAutomaticSkillsSync; exports.syncSdkSkillsIfNeeded = syncSdkSkillsIfNeeded;
|
|
1615
|
+
exports.SDK_COMPATIBILITY_FAST_DEADLINE_MS = SDK_COMPATIBILITY_FAST_DEADLINE_MS; exports.readFreshCleanCompatibility = readFreshCleanCompatibility; exports.readTrustedCleanCompatibility = readTrustedCleanCompatibility; exports.claimUpdateAdvisory = claimUpdateAdvisory; exports.checkSdkCompatibility = checkSdkCompatibility; exports.isCiEnvironment = isCiEnvironment; exports.enforceSdkCompatibilityResponse = enforceSdkCompatibilityResponse; exports.SKILLS_NPX_PACKAGE = SKILLS_NPX_PACKAGE; exports.DEFAULT_SDK_SKILL_NAMES = DEFAULT_SDK_SKILL_NAMES; exports.LEGACY_SKILL_NAMES_TO_REMOVE = LEGACY_SKILL_NAMES_TO_REMOVE; exports.skillsSourceUrl = skillsSourceUrl; exports.resolveShellSpawn = resolveShellSpawn; exports.isCliSkillsSyncEnabled = isCliSkillsSyncEnabled; exports.setCliSkillsSyncEnabled = setCliSkillsSyncEnabled; exports.SkillsStateUnavailableError = SkillsStateUnavailableError; exports.acquireSkillsInstallLease = acquireSkillsInstallLease; exports.skillsInstallLeasePath = skillsInstallLeasePath; exports.flushDeferredSkillsSyncNotices = flushDeferredSkillsSyncNotices; exports.SKILLS_AUTO_SYNC_COMMAND = SKILLS_AUTO_SYNC_COMMAND; exports.hasFailedAutomaticSkillsSync = hasFailedAutomaticSkillsSync; exports.clearFailedAutomaticSkillsSync = clearFailedAutomaticSkillsSync; exports.syncSdkSkillsIfNeeded = syncSdkSkillsIfNeeded;
|