@qwen-code/qwen-code 0.18.4 → 0.18.5
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/bundled/qc-helper/docs/configuration/auth.md +7 -6
- package/bundled/qc-helper/docs/configuration/model-providers.md +16 -2
- package/bundled/qc-helper/docs/configuration/settings.md +26 -26
- package/bundled/qc-helper/docs/features/approval-mode.md +2 -0
- package/bundled/qc-helper/docs/features/mcp.md +49 -0
- package/chunks/{agent-LYTC56HT.js → agent-2TEY55UD.js} +21 -21
- package/chunks/{agent-headless-FPUP5WHP.js → agent-headless-SCUAXEEE.js} +21 -21
- package/chunks/{anthropicContentGenerator-OLOGBVLP.js → anthropicContentGenerator-5S4OMMNL.js} +9 -7
- package/chunks/{askUserQuestion-ANRVSBIJ.js → askUserQuestion-WHVYL2S2.js} +2 -2
- package/chunks/{ca-K6MD665I.js → ca-7WC7ELX6.js} +1 -0
- package/chunks/{chunk-M5VYHAHT.js → chunk-26ZYKTYZ.js} +2 -2
- package/chunks/{chunk-6Z2MVJIJ.js → chunk-2CNO5W47.js} +14 -14
- package/chunks/{chunk-7OCZ77KA.js → chunk-2O3NAOJG.js} +1 -1
- package/chunks/{chunk-HU3RKEK2.js → chunk-42HGOMED.js} +1 -1
- package/chunks/{chunk-WWU2KUSR.js → chunk-AE6RQU6F.js} +1 -1
- package/chunks/{chunk-F6FP3URI.js → chunk-ATLUHLZE.js} +1 -1
- package/chunks/{chunk-4HMWGHPP.js → chunk-C6MI2ASN.js} +2 -2
- package/chunks/{chunk-SZWDOOGV.js → chunk-C7JA3XCX.js} +11 -11
- package/chunks/{chunk-VWPDSQZY.js → chunk-CTHZVIMD.js} +2 -2
- package/chunks/{chunk-IUEQOXOI.js → chunk-CX3SGIPK.js} +2 -2
- package/chunks/{chunk-GBTJHKQ6.js → chunk-F5E6IKYN.js} +7 -7
- package/chunks/{chunk-FPZF3BNV.js → chunk-FH4P6RQA.js} +1 -1
- package/chunks/{chunk-PTGKSUUJ.js → chunk-G4BUMVEY.js} +11 -1
- package/chunks/{chunk-JN6FVOPP.js → chunk-GBN55AWZ.js} +2 -2
- package/chunks/{chunk-JJHY7NAD.js → chunk-GOMVJKBL.js} +1 -1
- package/chunks/{chunk-JIJBNW4A.js → chunk-ID533GA3.js} +1 -1
- package/chunks/{chunk-E5SRTXRG.js → chunk-KGV3F6UF.js} +1 -1
- package/chunks/{chunk-LXUQBWQA.js → chunk-KZGQ3G3Q.js} +62 -11
- package/chunks/{chunk-4TW2JM5Q.js → chunk-LF6BKGZT.js} +3 -3
- package/chunks/{chunk-N5QHMPZU.js → chunk-LTN3VYMZ.js} +1 -1
- package/chunks/{chunk-DZCZZPCY.js → chunk-MSJ2MXJ6.js} +3 -3
- package/chunks/{chunk-5RVEAAD2.js → chunk-SIJKWK35.js} +6 -6
- package/chunks/{chunk-32SSXBMG.js → chunk-VECKCOH6.js} +3202 -2678
- package/chunks/{chunk-AQDPHFDZ.js → chunk-VKILGMZQ.js} +1 -1
- package/chunks/{chunk-IKOWINH4.js → chunk-WE6TNQJU.js} +6 -2
- package/chunks/{chunk-2ES3D3TW.js → chunk-XGU3ETVO.js} +3 -3
- package/chunks/{chunk-7GX7XYZU.js → chunk-XU7BKR3B.js} +3 -3
- package/chunks/{computer-use-P4WQBATW.js → computer-use-OB3C5QG2.js} +23 -22
- package/chunks/{contextCommand-POQ6GYN3.js → contextCommand-3327KUC4.js} +23 -23
- package/chunks/{cron-create-OKGQO6GX.js → cron-create-THNDTYXU.js} +4 -4
- package/chunks/{cron-delete-DTJP7L6O.js → cron-delete-BS5H6TFJ.js} +4 -4
- package/chunks/{cron-list-VKZUASFG.js → cron-list-7OBVHT7K.js} +4 -4
- package/chunks/{de-K2F3T3TR.js → de-ACHALDED.js} +1 -0
- package/chunks/{dist-OLC6NBSB.js → dist-DZ6AJDX4.js} +1 -1
- package/chunks/{dist-QUSDBLAK.js → dist-GKRNVFBH.js} +4 -0
- package/chunks/{edit-CS7DSS4Z.js → edit-GNCLIF67.js} +21 -21
- package/chunks/{en-KGSAKBJP.js → en-S3OQBISC.js} +1 -0
- package/chunks/{enter-worktree-PA4HPHJK.js → enter-worktree-E7BNZOGT.js} +21 -21
- package/chunks/{enterPlanMode-SFE5AFKZ.js → enterPlanMode-IA42A5EU.js} +26 -26
- package/chunks/{exit-worktree-FR3AZTC6.js → exit-worktree-QJ2K74UT.js} +21 -21
- package/chunks/{exitPlanMode-AHOUO44D.js → exitPlanMode-UKKHBUYJ.js} +21 -21
- package/chunks/{fr-2CAQEOK6.js → fr-GVKZ27MF.js} +1 -0
- package/chunks/{geminiContentGenerator-AXCVDKGI.js → geminiContentGenerator-ICSDM37U.js} +4 -4
- package/chunks/{glob-BQPAW3IW.js → glob-IGD7LWYX.js} +21 -21
- package/chunks/{grep-2F7BL5TQ.js → grep-IZM3IVND.js} +21 -21
- package/chunks/{ja-QWL7V6OJ.js → ja-FKZ2WZ4D.js} +1 -0
- package/chunks/{keychain-token-storage-ALKQXYJQ.js → keychain-token-storage-YHXIWXIB.js} +2 -2
- package/chunks/{loop-wakeup-RX6YIUSG.js → loop-wakeup-SSBWZ64K.js} +5 -5
- package/chunks/{ls-6PLNWHMU.js → ls-YPFUHZRQ.js} +3 -3
- package/chunks/{lsp-3HFQU4OF.js → lsp-FD6DNVAF.js} +2 -2
- package/chunks/{monitor-YTTMDFW2.js → monitor-ALJNE3R4.js} +21 -21
- package/chunks/{notebook-edit-7TNZMTBR.js → notebook-edit-7XRZX55T.js} +21 -21
- package/chunks/{openaiContentGenerator-JA6YXXPI.js → openaiContentGenerator-FWKITDFJ.js} +13 -11
- package/chunks/{pt-2SPOLMAY.js → pt-SY5NCFGR.js} +1 -0
- package/chunks/{qwenContentGenerator-NBOVGW7B.js → qwenContentGenerator-5RPGQZ63.js} +24 -24
- package/chunks/{qwenOAuth2-XWC5SU63.js → qwenOAuth2-WZ54YZ4J.js} +4 -4
- package/chunks/{read-file-RUBU3KUA.js → read-file-4WN2DT5N.js} +8 -8
- package/chunks/{ripGrep-TPFC7KZF.js → ripGrep-4ZKT6KBQ.js} +21 -21
- package/chunks/{ru-35IVJTEH.js → ru-FWNXJG4F.js} +1 -0
- package/chunks/{scheduler-NTVF45LR.js → scheduler-O2E65VDK.js} +21 -21
- package/chunks/{send-message-IIT3SHA7.js → send-message-FWFTX62Q.js} +2 -2
- package/chunks/{serve-J6VG37OX.js → serve-3DM6CRGD.js} +6942 -6809
- package/chunks/{shell-EQQEHEFI.js → shell-ARVZK6RF.js} +21 -21
- package/chunks/{skill-QWRWJCQJ.js → skill-BFUBGA4I.js} +10 -10
- package/chunks/{src-LNADIG5P.js → src-5YMCDSII.js} +47 -21
- package/chunks/{syntheticOutput-H67FYXU7.js → syntheticOutput-JY5NEDTV.js} +3 -3
- package/chunks/{task-create-OVXHSHAI.js → task-create-IGILDV25.js} +6 -6
- package/chunks/{task-list-QUUCQJ3U.js → task-list-KBEJVAAG.js} +5 -5
- package/chunks/{task-stop-WA5DMTKK.js → task-stop-WFTMQ6AC.js} +2 -2
- package/chunks/{task-update-PC5427TI.js → task-update-UIVX7ZEV.js} +6 -6
- package/chunks/{team-create-TXWQL777.js → team-create-HRBV5ATK.js} +21 -21
- package/chunks/{team-delete-ZTEMYRJ3.js → team-delete-LPOXDPVB.js} +5 -5
- package/chunks/{todoWrite-J6L6ELD6.js → todoWrite-R4RIJKOD.js} +4 -4
- package/chunks/{tool-search-JAVM7ABF.js → tool-search-67HI54YA.js} +8 -8
- package/chunks/{web-fetch-6XLPPTP7.js → web-fetch-JU7SS6KE.js} +4 -4
- package/chunks/{workflow-7LN3L6KK.js → workflow-W4SCLWLU.js} +22 -22
- package/chunks/{write-file-DAKE7YKB.js → write-file-TLNXC2NR.js} +21 -21
- package/chunks/{zh-X4KM6MTW.js → zh-QXLZV2PX.js} +1 -0
- package/chunks/{zh-TW-BSG6BUWK.js → zh-TW-3OKU7LDA.js} +1 -0
- package/cli.js +956 -636
- package/locales/ca.js +2 -1
- package/locales/de.js +1 -0
- package/locales/en.js +1 -0
- package/locales/fr.js +1 -0
- package/locales/ja.js +1 -0
- package/locales/pt.js +1 -0
- package/locales/ru.js +1 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
updateOutputLanguageFile,
|
|
97
97
|
validateCustomTheme,
|
|
98
98
|
writeOutputLanguageAndRegisterPath
|
|
99
|
-
} from "./chunks/chunk-
|
|
99
|
+
} from "./chunks/chunk-F5E6IKYN.js";
|
|
100
100
|
import {
|
|
101
101
|
AgentSideConnection,
|
|
102
102
|
PROTOCOL_VERSION,
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
formatContextUsageText,
|
|
110
110
|
isTerminalGoalStatusKind,
|
|
111
111
|
require_react
|
|
112
|
-
} from "./chunks/chunk-
|
|
112
|
+
} from "./chunks/chunk-SIJKWK35.js";
|
|
113
113
|
import {
|
|
114
114
|
SUPPORTED_LANGUAGES,
|
|
115
115
|
clearScreen,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
ta,
|
|
126
126
|
writeStderrLine,
|
|
127
127
|
writeStdoutLine
|
|
128
|
-
} from "./chunks/chunk-
|
|
128
|
+
} from "./chunks/chunk-C7JA3XCX.js";
|
|
129
129
|
import {
|
|
130
130
|
ALIBABA_PROVIDERS,
|
|
131
131
|
ALL_PROVIDERS,
|
|
@@ -221,7 +221,6 @@ import {
|
|
|
221
221
|
escapeShellArg,
|
|
222
222
|
evaluateAutoMode,
|
|
223
223
|
evaluatePermissionFlow,
|
|
224
|
-
execCommand,
|
|
225
224
|
executeToolCall,
|
|
226
225
|
extract,
|
|
227
226
|
fetchGitDiff,
|
|
@@ -275,7 +274,6 @@ import {
|
|
|
275
274
|
isApproveOutcome,
|
|
276
275
|
isBareMode,
|
|
277
276
|
isBinary,
|
|
278
|
-
isCommandAvailable,
|
|
279
277
|
isDenialFallbackReason,
|
|
280
278
|
isEditorAvailable,
|
|
281
279
|
isGatedMcpScope,
|
|
@@ -300,6 +298,7 @@ import {
|
|
|
300
298
|
parse,
|
|
301
299
|
parseAndFormatApiError,
|
|
302
300
|
parseInstallSource,
|
|
301
|
+
parsePositiveIntegerEnv,
|
|
303
302
|
parseRule,
|
|
304
303
|
partToString,
|
|
305
304
|
persistPermissionOutcome,
|
|
@@ -318,6 +317,7 @@ import {
|
|
|
318
317
|
require_shell_quote,
|
|
319
318
|
require_toml,
|
|
320
319
|
resolveBaseUrl,
|
|
320
|
+
resolveBranchName,
|
|
321
321
|
resolveBundleDir,
|
|
322
322
|
resolveMetadataKey,
|
|
323
323
|
resolveModelConfig,
|
|
@@ -345,40 +345,41 @@ import {
|
|
|
345
345
|
unregisterGoalHook,
|
|
346
346
|
updateSetting,
|
|
347
347
|
watch,
|
|
348
|
+
watchRepoBranch,
|
|
348
349
|
worktreeBranchForSlug,
|
|
349
350
|
writeRuntimeStatus,
|
|
350
351
|
writeWorktreeSession,
|
|
351
352
|
writeWorktreeSessionMarker
|
|
352
|
-
} from "./chunks/chunk-
|
|
353
|
+
} from "./chunks/chunk-VECKCOH6.js";
|
|
353
354
|
import {
|
|
354
355
|
external_exports
|
|
355
356
|
} from "./chunks/chunk-K5PGHDBN.js";
|
|
356
|
-
import "./chunks/chunk-
|
|
357
|
+
import "./chunks/chunk-XU7BKR3B.js";
|
|
357
358
|
import {
|
|
358
359
|
runSideQuery
|
|
359
|
-
} from "./chunks/chunk-
|
|
360
|
-
import "./chunks/chunk-
|
|
360
|
+
} from "./chunks/chunk-2O3NAOJG.js";
|
|
361
|
+
import "./chunks/chunk-XGU3ETVO.js";
|
|
361
362
|
import "./chunks/chunk-2MPVVENX.js";
|
|
362
363
|
import "./chunks/chunk-ZTQ26VBE.js";
|
|
363
|
-
import "./chunks/chunk-
|
|
364
|
-
import "./chunks/chunk-
|
|
364
|
+
import "./chunks/chunk-C6MI2ASN.js";
|
|
365
|
+
import "./chunks/chunk-LF6BKGZT.js";
|
|
365
366
|
import {
|
|
366
367
|
require_graceful_fs
|
|
367
|
-
} from "./chunks/chunk-
|
|
368
|
+
} from "./chunks/chunk-26ZYKTYZ.js";
|
|
368
369
|
import "./chunks/chunk-MLZQVCF3.js";
|
|
369
370
|
import "./chunks/chunk-LD2XBG6Z.js";
|
|
370
371
|
import {
|
|
371
372
|
applySkillAllowedTools,
|
|
372
373
|
buildSkillLlmContent
|
|
373
|
-
} from "./chunks/chunk-
|
|
374
|
+
} from "./chunks/chunk-ID533GA3.js";
|
|
374
375
|
import {
|
|
375
376
|
HOOKS_CONFIG_FIELDS,
|
|
376
377
|
HookEventName,
|
|
377
378
|
createHookOutput,
|
|
378
379
|
sanitizeUserPromptExpansionAdditionalContext
|
|
379
|
-
} from "./chunks/chunk-
|
|
380
|
+
} from "./chunks/chunk-KGV3F6UF.js";
|
|
380
381
|
import "./chunks/chunk-77WXWU44.js";
|
|
381
|
-
import "./chunks/chunk-
|
|
382
|
+
import "./chunks/chunk-AE6RQU6F.js";
|
|
382
383
|
import {
|
|
383
384
|
ApiCancelEvent,
|
|
384
385
|
AuthEvent,
|
|
@@ -434,7 +435,7 @@ import {
|
|
|
434
435
|
stripRuntimeSnapshotPrefix,
|
|
435
436
|
uiTelemetryService,
|
|
436
437
|
withInteractionSpan
|
|
437
|
-
} from "./chunks/chunk-
|
|
438
|
+
} from "./chunks/chunk-2CNO5W47.js";
|
|
438
439
|
import "./chunks/chunk-3PJXIDKI.js";
|
|
439
440
|
import "./chunks/chunk-UWCTAVOD.js";
|
|
440
441
|
import {
|
|
@@ -447,38 +448,38 @@ import {
|
|
|
447
448
|
getAutoMemoryRoot,
|
|
448
449
|
getUserAutoMemoryRoot,
|
|
449
450
|
isAnyAutoMemPath
|
|
450
|
-
} from "./chunks/chunk-
|
|
451
|
-
import "./chunks/chunk-
|
|
452
|
-
import "./chunks/chunk-
|
|
451
|
+
} from "./chunks/chunk-FH4P6RQA.js";
|
|
452
|
+
import "./chunks/chunk-CTHZVIMD.js";
|
|
453
|
+
import "./chunks/chunk-VKILGMZQ.js";
|
|
453
454
|
import {
|
|
454
455
|
SchemaValidator,
|
|
455
456
|
ToolConfirmationOutcome,
|
|
456
457
|
ToolDisplayNames,
|
|
457
458
|
ToolNames
|
|
458
|
-
} from "./chunks/chunk-
|
|
459
|
+
} from "./chunks/chunk-GOMVJKBL.js";
|
|
459
460
|
import {
|
|
460
461
|
clearCachedCredentialFile,
|
|
461
462
|
openBrowserSecurely,
|
|
462
463
|
qwenOAuth2Events,
|
|
463
464
|
shouldLaunchBrowser
|
|
464
|
-
} from "./chunks/chunk-
|
|
465
|
-
import "./chunks/chunk-
|
|
465
|
+
} from "./chunks/chunk-MSJ2MXJ6.js";
|
|
466
|
+
import "./chunks/chunk-ATLUHLZE.js";
|
|
466
467
|
import "./chunks/chunk-64WXLC72.js";
|
|
467
468
|
import {
|
|
468
469
|
atomicWriteFile,
|
|
469
470
|
atomicWriteFileSync
|
|
470
|
-
} from "./chunks/chunk-
|
|
471
|
+
} from "./chunks/chunk-LTN3VYMZ.js";
|
|
471
472
|
import {
|
|
472
473
|
detectRuntime,
|
|
473
474
|
getOrCreateSharedDispatcher,
|
|
474
475
|
getUnsupportedImageFormatWarning,
|
|
475
476
|
isSupportedImageMimeType,
|
|
476
477
|
redactProxyCredentials
|
|
477
|
-
} from "./chunks/chunk-
|
|
478
|
+
} from "./chunks/chunk-42HGOMED.js";
|
|
478
479
|
import {
|
|
479
480
|
DEFAULT_TOKEN_LIMIT,
|
|
480
481
|
tokenLimit
|
|
481
|
-
} from "./chunks/chunk-
|
|
482
|
+
} from "./chunks/chunk-G4BUMVEY.js";
|
|
482
483
|
import {
|
|
483
484
|
FinishReason
|
|
484
485
|
} from "./chunks/chunk-55ZMG67I.js";
|
|
@@ -505,7 +506,7 @@ import {
|
|
|
505
506
|
tildeifyPath,
|
|
506
507
|
unescapePath,
|
|
507
508
|
updateSymlink
|
|
508
|
-
} from "./chunks/chunk-
|
|
509
|
+
} from "./chunks/chunk-WE6TNQJU.js";
|
|
509
510
|
import "./chunks/chunk-ZERZSAZL.js";
|
|
510
511
|
import "./chunks/chunk-QN5NZ3UQ.js";
|
|
511
512
|
import "./chunks/chunk-BR4QREVK.js";
|
|
@@ -10996,15 +10997,15 @@ var require_route = __commonJS({
|
|
|
10996
10997
|
}
|
|
10997
10998
|
__name(link2, "link");
|
|
10998
10999
|
function wrapConversion(toModel, graph) {
|
|
10999
|
-
const
|
|
11000
|
+
const path63 = [graph[toModel].parent, toModel];
|
|
11000
11001
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
11001
11002
|
let cur = graph[toModel].parent;
|
|
11002
11003
|
while (graph[cur].parent) {
|
|
11003
|
-
|
|
11004
|
+
path63.unshift(graph[cur].parent);
|
|
11004
11005
|
fn = link2(conversions[graph[cur].parent][cur], fn);
|
|
11005
11006
|
cur = graph[cur].parent;
|
|
11006
11007
|
}
|
|
11007
|
-
fn.conversion =
|
|
11008
|
+
fn.conversion = path63;
|
|
11008
11009
|
return fn;
|
|
11009
11010
|
}
|
|
11010
11011
|
__name(wrapConversion, "wrapConversion");
|
|
@@ -11702,11 +11703,11 @@ var require_command_exists = __commonJS({
|
|
|
11702
11703
|
init_esbuild_shims();
|
|
11703
11704
|
var exec8 = __require("child_process").exec;
|
|
11704
11705
|
var execSync6 = __require("child_process").execSync;
|
|
11705
|
-
var
|
|
11706
|
-
var
|
|
11707
|
-
var access3 =
|
|
11708
|
-
var accessSync2 =
|
|
11709
|
-
var constants5 =
|
|
11706
|
+
var fs56 = __require("fs");
|
|
11707
|
+
var path63 = __require("path");
|
|
11708
|
+
var access3 = fs56.access;
|
|
11709
|
+
var accessSync2 = fs56.accessSync;
|
|
11710
|
+
var constants5 = fs56.constants || fs56;
|
|
11710
11711
|
var isUsingWindows = process.platform == "win32";
|
|
11711
11712
|
var fileNotExists = /* @__PURE__ */ __name(function(commandName, callback) {
|
|
11712
11713
|
access3(
|
|
@@ -11807,8 +11808,8 @@ var require_command_exists = __commonJS({
|
|
|
11807
11808
|
cleanInput = /* @__PURE__ */ __name(function(s) {
|
|
11808
11809
|
var isPathName = /[\\]/.test(s);
|
|
11809
11810
|
if (isPathName) {
|
|
11810
|
-
var dirname21 = '"' +
|
|
11811
|
-
var basename15 = '"' +
|
|
11811
|
+
var dirname21 = '"' + path63.dirname(s) + '"';
|
|
11812
|
+
var basename15 = '"' + path63.basename(s) + '"';
|
|
11812
11813
|
return dirname21 + ":" + basename15;
|
|
11813
11814
|
}
|
|
11814
11815
|
return '"' + s + '"';
|
|
@@ -12728,14 +12729,14 @@ var require_util2 = __commonJS({
|
|
|
12728
12729
|
}
|
|
12729
12730
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
12730
12731
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
12731
|
-
let
|
|
12732
|
+
let path63 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
12732
12733
|
if (origin[origin.length - 1] === "/") {
|
|
12733
12734
|
origin = origin.slice(0, origin.length - 1);
|
|
12734
12735
|
}
|
|
12735
|
-
if (
|
|
12736
|
-
|
|
12736
|
+
if (path63 && path63[0] !== "/") {
|
|
12737
|
+
path63 = `/${path63}`;
|
|
12737
12738
|
}
|
|
12738
|
-
return new URL(`${origin}${
|
|
12739
|
+
return new URL(`${origin}${path63}`);
|
|
12739
12740
|
}
|
|
12740
12741
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
12741
12742
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -13220,39 +13221,39 @@ var require_diagnostics = __commonJS({
|
|
|
13220
13221
|
});
|
|
13221
13222
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
|
13222
13223
|
const {
|
|
13223
|
-
request: { method, path:
|
|
13224
|
+
request: { method, path: path63, origin }
|
|
13224
13225
|
} = evt;
|
|
13225
|
-
debuglog("sending request to %s %s/%s", method, origin,
|
|
13226
|
+
debuglog("sending request to %s %s/%s", method, origin, path63);
|
|
13226
13227
|
});
|
|
13227
13228
|
diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => {
|
|
13228
13229
|
const {
|
|
13229
|
-
request: { method, path:
|
|
13230
|
+
request: { method, path: path63, origin },
|
|
13230
13231
|
response: { statusCode }
|
|
13231
13232
|
} = evt;
|
|
13232
13233
|
debuglog(
|
|
13233
13234
|
"received response to %s %s/%s - HTTP %d",
|
|
13234
13235
|
method,
|
|
13235
13236
|
origin,
|
|
13236
|
-
|
|
13237
|
+
path63,
|
|
13237
13238
|
statusCode
|
|
13238
13239
|
);
|
|
13239
13240
|
});
|
|
13240
13241
|
diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => {
|
|
13241
13242
|
const {
|
|
13242
|
-
request: { method, path:
|
|
13243
|
+
request: { method, path: path63, origin }
|
|
13243
13244
|
} = evt;
|
|
13244
|
-
debuglog("trailers received from %s %s/%s", method, origin,
|
|
13245
|
+
debuglog("trailers received from %s %s/%s", method, origin, path63);
|
|
13245
13246
|
});
|
|
13246
13247
|
diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
|
|
13247
13248
|
const {
|
|
13248
|
-
request: { method, path:
|
|
13249
|
+
request: { method, path: path63, origin },
|
|
13249
13250
|
error
|
|
13250
13251
|
} = evt;
|
|
13251
13252
|
debuglog(
|
|
13252
13253
|
"request to %s %s/%s errored - %s",
|
|
13253
13254
|
method,
|
|
13254
13255
|
origin,
|
|
13255
|
-
|
|
13256
|
+
path63,
|
|
13256
13257
|
error.message
|
|
13257
13258
|
);
|
|
13258
13259
|
});
|
|
@@ -13301,9 +13302,9 @@ var require_diagnostics = __commonJS({
|
|
|
13301
13302
|
});
|
|
13302
13303
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
|
13303
13304
|
const {
|
|
13304
|
-
request: { method, path:
|
|
13305
|
+
request: { method, path: path63, origin }
|
|
13305
13306
|
} = evt;
|
|
13306
|
-
debuglog("sending request to %s %s/%s", method, origin,
|
|
13307
|
+
debuglog("sending request to %s %s/%s", method, origin, path63);
|
|
13307
13308
|
});
|
|
13308
13309
|
}
|
|
13309
13310
|
diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => {
|
|
@@ -13370,7 +13371,7 @@ var require_request = __commonJS({
|
|
|
13370
13371
|
__name(this, "Request");
|
|
13371
13372
|
}
|
|
13372
13373
|
constructor(origin, {
|
|
13373
|
-
path:
|
|
13374
|
+
path: path63,
|
|
13374
13375
|
method,
|
|
13375
13376
|
body,
|
|
13376
13377
|
headers,
|
|
@@ -13385,11 +13386,11 @@ var require_request = __commonJS({
|
|
|
13385
13386
|
expectContinue,
|
|
13386
13387
|
servername
|
|
13387
13388
|
}, handler) {
|
|
13388
|
-
if (typeof
|
|
13389
|
+
if (typeof path63 !== "string") {
|
|
13389
13390
|
throw new InvalidArgumentError("path must be a string");
|
|
13390
|
-
} else if (
|
|
13391
|
+
} else if (path63[0] !== "/" && !(path63.startsWith("http://") || path63.startsWith("https://")) && method !== "CONNECT") {
|
|
13391
13392
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
13392
|
-
} else if (invalidPathRegex.test(
|
|
13393
|
+
} else if (invalidPathRegex.test(path63)) {
|
|
13393
13394
|
throw new InvalidArgumentError("invalid request path");
|
|
13394
13395
|
}
|
|
13395
13396
|
if (typeof method !== "string") {
|
|
@@ -13452,7 +13453,7 @@ var require_request = __commonJS({
|
|
|
13452
13453
|
this.completed = false;
|
|
13453
13454
|
this.aborted = false;
|
|
13454
13455
|
this.upgrade = upgrade || null;
|
|
13455
|
-
this.path = query ? buildURL(
|
|
13456
|
+
this.path = query ? buildURL(path63, query) : path63;
|
|
13456
13457
|
this.origin = origin;
|
|
13457
13458
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
13458
13459
|
this.blocking = blocking == null ? false : blocking;
|
|
@@ -18131,7 +18132,7 @@ var require_client_h1 = __commonJS({
|
|
|
18131
18132
|
}
|
|
18132
18133
|
__name(shouldSendContentLength, "shouldSendContentLength");
|
|
18133
18134
|
function writeH1(client, request) {
|
|
18134
|
-
const { method, path:
|
|
18135
|
+
const { method, path: path63, host, upgrade, blocking, reset } = request;
|
|
18135
18136
|
let { body, headers, contentLength } = request;
|
|
18136
18137
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
18137
18138
|
if (util.isFormDataLike(body)) {
|
|
@@ -18197,7 +18198,7 @@ var require_client_h1 = __commonJS({
|
|
|
18197
18198
|
if (blocking) {
|
|
18198
18199
|
socket[kBlocking] = true;
|
|
18199
18200
|
}
|
|
18200
|
-
let header = `${method} ${
|
|
18201
|
+
let header = `${method} ${path63} HTTP/1.1\r
|
|
18201
18202
|
`;
|
|
18202
18203
|
if (typeof host === "string") {
|
|
18203
18204
|
header += `host: ${host}\r
|
|
@@ -18741,7 +18742,7 @@ var require_client_h2 = __commonJS({
|
|
|
18741
18742
|
__name(shouldSendContentLength, "shouldSendContentLength");
|
|
18742
18743
|
function writeH2(client, request) {
|
|
18743
18744
|
const session2 = client[kHTTP2Session];
|
|
18744
|
-
const { method, path:
|
|
18745
|
+
const { method, path: path63, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
|
|
18745
18746
|
let { body } = request;
|
|
18746
18747
|
if (upgrade) {
|
|
18747
18748
|
util.errorRequest(client, request, new Error("Upgrade not supported for H2"));
|
|
@@ -18808,7 +18809,7 @@ var require_client_h2 = __commonJS({
|
|
|
18808
18809
|
});
|
|
18809
18810
|
return true;
|
|
18810
18811
|
}
|
|
18811
|
-
headers[HTTP2_HEADER_PATH] =
|
|
18812
|
+
headers[HTTP2_HEADER_PATH] = path63;
|
|
18812
18813
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
18813
18814
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
18814
18815
|
if (body && typeof body.read === "function") {
|
|
@@ -19176,9 +19177,9 @@ var require_redirect_handler = __commonJS({
|
|
|
19176
19177
|
return this.handler.onHeaders(statusCode, headers, resume, statusText);
|
|
19177
19178
|
}
|
|
19178
19179
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
19179
|
-
const
|
|
19180
|
+
const path63 = search ? `${pathname}${search}` : pathname;
|
|
19180
19181
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
19181
|
-
this.opts.path =
|
|
19182
|
+
this.opts.path = path63;
|
|
19182
19183
|
this.opts.origin = origin;
|
|
19183
19184
|
this.opts.maxRedirections = 0;
|
|
19184
19185
|
this.opts.query = null;
|
|
@@ -20465,10 +20466,10 @@ var require_proxy_agent = __commonJS({
|
|
|
20465
20466
|
};
|
|
20466
20467
|
const {
|
|
20467
20468
|
origin,
|
|
20468
|
-
path:
|
|
20469
|
+
path: path63 = "/",
|
|
20469
20470
|
headers = {}
|
|
20470
20471
|
} = opts;
|
|
20471
|
-
opts.path = origin +
|
|
20472
|
+
opts.path = origin + path63;
|
|
20472
20473
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
20473
20474
|
const { host } = new URL2(origin);
|
|
20474
20475
|
headers.host = host;
|
|
@@ -22470,21 +22471,21 @@ var require_mock_utils = __commonJS({
|
|
|
22470
22471
|
return true;
|
|
22471
22472
|
}
|
|
22472
22473
|
__name(matchHeaders, "matchHeaders");
|
|
22473
|
-
function safeUrl(
|
|
22474
|
-
if (typeof
|
|
22475
|
-
return
|
|
22474
|
+
function safeUrl(path63) {
|
|
22475
|
+
if (typeof path63 !== "string") {
|
|
22476
|
+
return path63;
|
|
22476
22477
|
}
|
|
22477
|
-
const pathSegments =
|
|
22478
|
+
const pathSegments = path63.split("?");
|
|
22478
22479
|
if (pathSegments.length !== 2) {
|
|
22479
|
-
return
|
|
22480
|
+
return path63;
|
|
22480
22481
|
}
|
|
22481
22482
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
22482
22483
|
qp.sort();
|
|
22483
22484
|
return [...pathSegments, qp.toString()].join("?");
|
|
22484
22485
|
}
|
|
22485
22486
|
__name(safeUrl, "safeUrl");
|
|
22486
|
-
function matchKey(mockDispatch2, { path:
|
|
22487
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
22487
|
+
function matchKey(mockDispatch2, { path: path63, method, body, headers }) {
|
|
22488
|
+
const pathMatch = matchValue(mockDispatch2.path, path63);
|
|
22488
22489
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
22489
22490
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
22490
22491
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -22508,7 +22509,7 @@ var require_mock_utils = __commonJS({
|
|
|
22508
22509
|
function getMockDispatch(mockDispatches, key) {
|
|
22509
22510
|
const basePath = key.query ? buildURL(key.path, key.query) : key.path;
|
|
22510
22511
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
22511
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
22512
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path63 }) => matchValue(safeUrl(path63), resolvedPath));
|
|
22512
22513
|
if (matchedMockDispatches.length === 0) {
|
|
22513
22514
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
22514
22515
|
}
|
|
@@ -22549,9 +22550,9 @@ var require_mock_utils = __commonJS({
|
|
|
22549
22550
|
}
|
|
22550
22551
|
__name(deleteMockDispatch, "deleteMockDispatch");
|
|
22551
22552
|
function buildKey(opts) {
|
|
22552
|
-
const { path:
|
|
22553
|
+
const { path: path63, method, body, headers, query } = opts;
|
|
22553
22554
|
return {
|
|
22554
|
-
path:
|
|
22555
|
+
path: path63,
|
|
22555
22556
|
method,
|
|
22556
22557
|
body,
|
|
22557
22558
|
headers,
|
|
@@ -23047,10 +23048,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
23047
23048
|
}
|
|
23048
23049
|
format(pendingInterceptors) {
|
|
23049
23050
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
23050
|
-
({ method, path:
|
|
23051
|
+
({ method, path: path63, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
23051
23052
|
Method: method,
|
|
23052
23053
|
Origin: origin,
|
|
23053
|
-
Path:
|
|
23054
|
+
Path: path63,
|
|
23054
23055
|
"Status code": statusCode,
|
|
23055
23056
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
23056
23057
|
Invocations: timesInvoked,
|
|
@@ -28049,9 +28050,9 @@ var require_util7 = __commonJS({
|
|
|
28049
28050
|
}
|
|
28050
28051
|
}
|
|
28051
28052
|
__name(validateCookieValue, "validateCookieValue");
|
|
28052
|
-
function validateCookiePath(
|
|
28053
|
-
for (let i = 0; i <
|
|
28054
|
-
const code =
|
|
28053
|
+
function validateCookiePath(path63) {
|
|
28054
|
+
for (let i = 0; i < path63.length; ++i) {
|
|
28055
|
+
const code = path63.charCodeAt(i);
|
|
28055
28056
|
if (code < 32 || // exclude CTLs (0-31)
|
|
28056
28057
|
code === 127 || // DEL
|
|
28057
28058
|
code === 59) {
|
|
@@ -30731,11 +30732,11 @@ var require_undici = __commonJS({
|
|
|
30731
30732
|
if (typeof opts.path !== "string") {
|
|
30732
30733
|
throw new InvalidArgumentError("invalid opts.path");
|
|
30733
30734
|
}
|
|
30734
|
-
let
|
|
30735
|
+
let path63 = opts.path;
|
|
30735
30736
|
if (!opts.path.startsWith("/")) {
|
|
30736
|
-
|
|
30737
|
+
path63 = `/${path63}`;
|
|
30737
30738
|
}
|
|
30738
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
30739
|
+
url = new URL(util.parseOrigin(url).origin + path63);
|
|
30739
30740
|
} else {
|
|
30740
30741
|
if (!opts) {
|
|
30741
30742
|
opts = typeof url === "object" ? url : {};
|
|
@@ -34500,9 +34501,9 @@ var require_utils2 = __commonJS({
|
|
|
34500
34501
|
"node_modules/rc/lib/utils.js"(exports) {
|
|
34501
34502
|
"use strict";
|
|
34502
34503
|
init_esbuild_shims();
|
|
34503
|
-
var
|
|
34504
|
+
var fs56 = __require("fs");
|
|
34504
34505
|
var ini2 = require_ini();
|
|
34505
|
-
var
|
|
34506
|
+
var path63 = __require("path");
|
|
34506
34507
|
var stripJsonComments7 = require_strip_json_comments2();
|
|
34507
34508
|
var parse4 = exports.parse = function(content) {
|
|
34508
34509
|
if (/^\s*{/.test(content))
|
|
@@ -34516,10 +34517,10 @@ var require_utils2 = __commonJS({
|
|
|
34516
34517
|
for (var i in args)
|
|
34517
34518
|
if ("string" !== typeof args[i])
|
|
34518
34519
|
return;
|
|
34519
|
-
var file2 =
|
|
34520
|
+
var file2 = path63.join.apply(null, args);
|
|
34520
34521
|
var content;
|
|
34521
34522
|
try {
|
|
34522
|
-
return
|
|
34523
|
+
return fs56.readFileSync(file2, "utf-8");
|
|
34523
34524
|
} catch (err) {
|
|
34524
34525
|
return;
|
|
34525
34526
|
}
|
|
@@ -34554,15 +34555,15 @@ var require_utils2 = __commonJS({
|
|
|
34554
34555
|
return obj;
|
|
34555
34556
|
};
|
|
34556
34557
|
var find = exports.find = function() {
|
|
34557
|
-
var rel =
|
|
34558
|
+
var rel = path63.join.apply(null, [].slice.call(arguments));
|
|
34558
34559
|
function find2(start, rel2) {
|
|
34559
|
-
var file2 =
|
|
34560
|
+
var file2 = path63.join(start, rel2);
|
|
34560
34561
|
try {
|
|
34561
|
-
|
|
34562
|
+
fs56.statSync(file2);
|
|
34562
34563
|
return file2;
|
|
34563
34564
|
} catch (err) {
|
|
34564
|
-
if (
|
|
34565
|
-
return find2(
|
|
34565
|
+
if (path63.dirname(start) !== start)
|
|
34566
|
+
return find2(path63.dirname(start), rel2);
|
|
34566
34567
|
}
|
|
34567
34568
|
}
|
|
34568
34569
|
__name(find2, "find");
|
|
@@ -34968,54 +34969,54 @@ var require_polyfills = __commonJS({
|
|
|
34968
34969
|
}
|
|
34969
34970
|
var chdir;
|
|
34970
34971
|
module.exports = patch;
|
|
34971
|
-
function patch(
|
|
34972
|
+
function patch(fs56) {
|
|
34972
34973
|
if (constants5.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
34973
|
-
patchLchmod(
|
|
34974
|
-
}
|
|
34975
|
-
if (!
|
|
34976
|
-
patchLutimes(
|
|
34977
|
-
}
|
|
34978
|
-
|
|
34979
|
-
|
|
34980
|
-
|
|
34981
|
-
|
|
34982
|
-
|
|
34983
|
-
|
|
34984
|
-
|
|
34985
|
-
|
|
34986
|
-
|
|
34987
|
-
|
|
34988
|
-
|
|
34989
|
-
|
|
34990
|
-
|
|
34991
|
-
|
|
34992
|
-
|
|
34993
|
-
|
|
34994
|
-
|
|
34995
|
-
|
|
34996
|
-
if (
|
|
34997
|
-
|
|
34974
|
+
patchLchmod(fs56);
|
|
34975
|
+
}
|
|
34976
|
+
if (!fs56.lutimes) {
|
|
34977
|
+
patchLutimes(fs56);
|
|
34978
|
+
}
|
|
34979
|
+
fs56.chown = chownFix(fs56.chown);
|
|
34980
|
+
fs56.fchown = chownFix(fs56.fchown);
|
|
34981
|
+
fs56.lchown = chownFix(fs56.lchown);
|
|
34982
|
+
fs56.chmod = chmodFix(fs56.chmod);
|
|
34983
|
+
fs56.fchmod = chmodFix(fs56.fchmod);
|
|
34984
|
+
fs56.lchmod = chmodFix(fs56.lchmod);
|
|
34985
|
+
fs56.chownSync = chownFixSync(fs56.chownSync);
|
|
34986
|
+
fs56.fchownSync = chownFixSync(fs56.fchownSync);
|
|
34987
|
+
fs56.lchownSync = chownFixSync(fs56.lchownSync);
|
|
34988
|
+
fs56.chmodSync = chmodFixSync(fs56.chmodSync);
|
|
34989
|
+
fs56.fchmodSync = chmodFixSync(fs56.fchmodSync);
|
|
34990
|
+
fs56.lchmodSync = chmodFixSync(fs56.lchmodSync);
|
|
34991
|
+
fs56.stat = statFix(fs56.stat);
|
|
34992
|
+
fs56.fstat = statFix(fs56.fstat);
|
|
34993
|
+
fs56.lstat = statFix(fs56.lstat);
|
|
34994
|
+
fs56.statSync = statFixSync(fs56.statSync);
|
|
34995
|
+
fs56.fstatSync = statFixSync(fs56.fstatSync);
|
|
34996
|
+
fs56.lstatSync = statFixSync(fs56.lstatSync);
|
|
34997
|
+
if (fs56.chmod && !fs56.lchmod) {
|
|
34998
|
+
fs56.lchmod = function(path63, mode, cb) {
|
|
34998
34999
|
if (cb) process.nextTick(cb);
|
|
34999
35000
|
};
|
|
35000
|
-
|
|
35001
|
+
fs56.lchmodSync = function() {
|
|
35001
35002
|
};
|
|
35002
35003
|
}
|
|
35003
|
-
if (
|
|
35004
|
-
|
|
35004
|
+
if (fs56.chown && !fs56.lchown) {
|
|
35005
|
+
fs56.lchown = function(path63, uid, gid, cb) {
|
|
35005
35006
|
if (cb) process.nextTick(cb);
|
|
35006
35007
|
};
|
|
35007
|
-
|
|
35008
|
+
fs56.lchownSync = function() {
|
|
35008
35009
|
};
|
|
35009
35010
|
}
|
|
35010
35011
|
if (platform6 === "win32") {
|
|
35011
|
-
|
|
35012
|
+
fs56.rename = typeof fs56.rename !== "function" ? fs56.rename : function(fs$rename) {
|
|
35012
35013
|
function rename3(from, to, cb) {
|
|
35013
35014
|
var start = Date.now();
|
|
35014
35015
|
var backoff = 0;
|
|
35015
35016
|
fs$rename(from, to, /* @__PURE__ */ __name(function CB(er) {
|
|
35016
35017
|
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
|
|
35017
35018
|
setTimeout(function() {
|
|
35018
|
-
|
|
35019
|
+
fs56.stat(to, function(stater, st) {
|
|
35019
35020
|
if (stater && stater.code === "ENOENT")
|
|
35020
35021
|
fs$rename(from, to, CB);
|
|
35021
35022
|
else
|
|
@@ -35032,9 +35033,9 @@ var require_polyfills = __commonJS({
|
|
|
35032
35033
|
__name(rename3, "rename");
|
|
35033
35034
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename3, fs$rename);
|
|
35034
35035
|
return rename3;
|
|
35035
|
-
}(
|
|
35036
|
+
}(fs56.rename);
|
|
35036
35037
|
}
|
|
35037
|
-
|
|
35038
|
+
fs56.read = typeof fs56.read !== "function" ? fs56.read : function(fs$read) {
|
|
35038
35039
|
function read2(fd, buffer, offset, length, position, callback_) {
|
|
35039
35040
|
var callback;
|
|
35040
35041
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -35042,23 +35043,23 @@ var require_polyfills = __commonJS({
|
|
|
35042
35043
|
callback = /* @__PURE__ */ __name(function(er, _, __) {
|
|
35043
35044
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
35044
35045
|
eagCounter++;
|
|
35045
|
-
return fs$read.call(
|
|
35046
|
+
return fs$read.call(fs56, fd, buffer, offset, length, position, callback);
|
|
35046
35047
|
}
|
|
35047
35048
|
callback_.apply(this, arguments);
|
|
35048
35049
|
}, "callback");
|
|
35049
35050
|
}
|
|
35050
|
-
return fs$read.call(
|
|
35051
|
+
return fs$read.call(fs56, fd, buffer, offset, length, position, callback);
|
|
35051
35052
|
}
|
|
35052
35053
|
__name(read2, "read");
|
|
35053
35054
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read2, fs$read);
|
|
35054
35055
|
return read2;
|
|
35055
|
-
}(
|
|
35056
|
-
|
|
35056
|
+
}(fs56.read);
|
|
35057
|
+
fs56.readSync = typeof fs56.readSync !== "function" ? fs56.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
35057
35058
|
return function(fd, buffer, offset, length, position) {
|
|
35058
35059
|
var eagCounter = 0;
|
|
35059
35060
|
while (true) {
|
|
35060
35061
|
try {
|
|
35061
|
-
return fs$readSync.call(
|
|
35062
|
+
return fs$readSync.call(fs56, fd, buffer, offset, length, position);
|
|
35062
35063
|
} catch (er) {
|
|
35063
35064
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
35064
35065
|
eagCounter++;
|
|
@@ -35068,11 +35069,11 @@ var require_polyfills = __commonJS({
|
|
|
35068
35069
|
}
|
|
35069
35070
|
}
|
|
35070
35071
|
};
|
|
35071
|
-
}(
|
|
35072
|
-
function patchLchmod(
|
|
35073
|
-
|
|
35074
|
-
|
|
35075
|
-
|
|
35072
|
+
}(fs56.readSync);
|
|
35073
|
+
function patchLchmod(fs57) {
|
|
35074
|
+
fs57.lchmod = function(path63, mode, callback) {
|
|
35075
|
+
fs57.open(
|
|
35076
|
+
path63,
|
|
35076
35077
|
constants5.O_WRONLY | constants5.O_SYMLINK,
|
|
35077
35078
|
mode,
|
|
35078
35079
|
function(err, fd) {
|
|
@@ -35080,74 +35081,74 @@ var require_polyfills = __commonJS({
|
|
|
35080
35081
|
if (callback) callback(err);
|
|
35081
35082
|
return;
|
|
35082
35083
|
}
|
|
35083
|
-
|
|
35084
|
-
|
|
35084
|
+
fs57.fchmod(fd, mode, function(err2) {
|
|
35085
|
+
fs57.close(fd, function(err22) {
|
|
35085
35086
|
if (callback) callback(err2 || err22);
|
|
35086
35087
|
});
|
|
35087
35088
|
});
|
|
35088
35089
|
}
|
|
35089
35090
|
);
|
|
35090
35091
|
};
|
|
35091
|
-
|
|
35092
|
-
var fd =
|
|
35092
|
+
fs57.lchmodSync = function(path63, mode) {
|
|
35093
|
+
var fd = fs57.openSync(path63, constants5.O_WRONLY | constants5.O_SYMLINK, mode);
|
|
35093
35094
|
var threw = true;
|
|
35094
35095
|
var ret;
|
|
35095
35096
|
try {
|
|
35096
|
-
ret =
|
|
35097
|
+
ret = fs57.fchmodSync(fd, mode);
|
|
35097
35098
|
threw = false;
|
|
35098
35099
|
} finally {
|
|
35099
35100
|
if (threw) {
|
|
35100
35101
|
try {
|
|
35101
|
-
|
|
35102
|
+
fs57.closeSync(fd);
|
|
35102
35103
|
} catch (er) {
|
|
35103
35104
|
}
|
|
35104
35105
|
} else {
|
|
35105
|
-
|
|
35106
|
+
fs57.closeSync(fd);
|
|
35106
35107
|
}
|
|
35107
35108
|
}
|
|
35108
35109
|
return ret;
|
|
35109
35110
|
};
|
|
35110
35111
|
}
|
|
35111
35112
|
__name(patchLchmod, "patchLchmod");
|
|
35112
|
-
function patchLutimes(
|
|
35113
|
-
if (constants5.hasOwnProperty("O_SYMLINK") &&
|
|
35114
|
-
|
|
35115
|
-
|
|
35113
|
+
function patchLutimes(fs57) {
|
|
35114
|
+
if (constants5.hasOwnProperty("O_SYMLINK") && fs57.futimes) {
|
|
35115
|
+
fs57.lutimes = function(path63, at, mt, cb) {
|
|
35116
|
+
fs57.open(path63, constants5.O_SYMLINK, function(er, fd) {
|
|
35116
35117
|
if (er) {
|
|
35117
35118
|
if (cb) cb(er);
|
|
35118
35119
|
return;
|
|
35119
35120
|
}
|
|
35120
|
-
|
|
35121
|
-
|
|
35121
|
+
fs57.futimes(fd, at, mt, function(er2) {
|
|
35122
|
+
fs57.close(fd, function(er22) {
|
|
35122
35123
|
if (cb) cb(er2 || er22);
|
|
35123
35124
|
});
|
|
35124
35125
|
});
|
|
35125
35126
|
});
|
|
35126
35127
|
};
|
|
35127
|
-
|
|
35128
|
-
var fd =
|
|
35128
|
+
fs57.lutimesSync = function(path63, at, mt) {
|
|
35129
|
+
var fd = fs57.openSync(path63, constants5.O_SYMLINK);
|
|
35129
35130
|
var ret;
|
|
35130
35131
|
var threw = true;
|
|
35131
35132
|
try {
|
|
35132
|
-
ret =
|
|
35133
|
+
ret = fs57.futimesSync(fd, at, mt);
|
|
35133
35134
|
threw = false;
|
|
35134
35135
|
} finally {
|
|
35135
35136
|
if (threw) {
|
|
35136
35137
|
try {
|
|
35137
|
-
|
|
35138
|
+
fs57.closeSync(fd);
|
|
35138
35139
|
} catch (er) {
|
|
35139
35140
|
}
|
|
35140
35141
|
} else {
|
|
35141
|
-
|
|
35142
|
+
fs57.closeSync(fd);
|
|
35142
35143
|
}
|
|
35143
35144
|
}
|
|
35144
35145
|
return ret;
|
|
35145
35146
|
};
|
|
35146
|
-
} else if (
|
|
35147
|
-
|
|
35147
|
+
} else if (fs57.futimes) {
|
|
35148
|
+
fs57.lutimes = function(_a2, _b2, _c2, cb) {
|
|
35148
35149
|
if (cb) process.nextTick(cb);
|
|
35149
35150
|
};
|
|
35150
|
-
|
|
35151
|
+
fs57.lutimesSync = function() {
|
|
35151
35152
|
};
|
|
35152
35153
|
}
|
|
35153
35154
|
}
|
|
@@ -35155,7 +35156,7 @@ var require_polyfills = __commonJS({
|
|
|
35155
35156
|
function chmodFix(orig) {
|
|
35156
35157
|
if (!orig) return orig;
|
|
35157
35158
|
return function(target, mode, cb) {
|
|
35158
|
-
return orig.call(
|
|
35159
|
+
return orig.call(fs56, target, mode, function(er) {
|
|
35159
35160
|
if (chownErOk(er)) er = null;
|
|
35160
35161
|
if (cb) cb.apply(this, arguments);
|
|
35161
35162
|
});
|
|
@@ -35166,7 +35167,7 @@ var require_polyfills = __commonJS({
|
|
|
35166
35167
|
if (!orig) return orig;
|
|
35167
35168
|
return function(target, mode) {
|
|
35168
35169
|
try {
|
|
35169
|
-
return orig.call(
|
|
35170
|
+
return orig.call(fs56, target, mode);
|
|
35170
35171
|
} catch (er) {
|
|
35171
35172
|
if (!chownErOk(er)) throw er;
|
|
35172
35173
|
}
|
|
@@ -35176,7 +35177,7 @@ var require_polyfills = __commonJS({
|
|
|
35176
35177
|
function chownFix(orig) {
|
|
35177
35178
|
if (!orig) return orig;
|
|
35178
35179
|
return function(target, uid, gid, cb) {
|
|
35179
|
-
return orig.call(
|
|
35180
|
+
return orig.call(fs56, target, uid, gid, function(er) {
|
|
35180
35181
|
if (chownErOk(er)) er = null;
|
|
35181
35182
|
if (cb) cb.apply(this, arguments);
|
|
35182
35183
|
});
|
|
@@ -35187,7 +35188,7 @@ var require_polyfills = __commonJS({
|
|
|
35187
35188
|
if (!orig) return orig;
|
|
35188
35189
|
return function(target, uid, gid) {
|
|
35189
35190
|
try {
|
|
35190
|
-
return orig.call(
|
|
35191
|
+
return orig.call(fs56, target, uid, gid);
|
|
35191
35192
|
} catch (er) {
|
|
35192
35193
|
if (!chownErOk(er)) throw er;
|
|
35193
35194
|
}
|
|
@@ -35209,14 +35210,14 @@ var require_polyfills = __commonJS({
|
|
|
35209
35210
|
if (cb) cb.apply(this, arguments);
|
|
35210
35211
|
}
|
|
35211
35212
|
__name(callback, "callback");
|
|
35212
|
-
return options ? orig.call(
|
|
35213
|
+
return options ? orig.call(fs56, target, options, callback) : orig.call(fs56, target, callback);
|
|
35213
35214
|
};
|
|
35214
35215
|
}
|
|
35215
35216
|
__name(statFix, "statFix");
|
|
35216
35217
|
function statFixSync(orig) {
|
|
35217
35218
|
if (!orig) return orig;
|
|
35218
35219
|
return function(target, options) {
|
|
35219
|
-
var stats = options ? orig.call(
|
|
35220
|
+
var stats = options ? orig.call(fs56, target, options) : orig.call(fs56, target);
|
|
35220
35221
|
if (stats) {
|
|
35221
35222
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
35222
35223
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -35249,16 +35250,16 @@ var require_legacy_streams = __commonJS({
|
|
|
35249
35250
|
init_esbuild_shims();
|
|
35250
35251
|
var Stream2 = __require("stream").Stream;
|
|
35251
35252
|
module.exports = legacy;
|
|
35252
|
-
function legacy(
|
|
35253
|
+
function legacy(fs56) {
|
|
35253
35254
|
return {
|
|
35254
35255
|
ReadStream,
|
|
35255
35256
|
WriteStream
|
|
35256
35257
|
};
|
|
35257
|
-
function ReadStream(
|
|
35258
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
35258
|
+
function ReadStream(path63, options) {
|
|
35259
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path63, options);
|
|
35259
35260
|
Stream2.call(this);
|
|
35260
35261
|
var self2 = this;
|
|
35261
|
-
this.path =
|
|
35262
|
+
this.path = path63;
|
|
35262
35263
|
this.fd = null;
|
|
35263
35264
|
this.readable = true;
|
|
35264
35265
|
this.paused = false;
|
|
@@ -35292,7 +35293,7 @@ var require_legacy_streams = __commonJS({
|
|
|
35292
35293
|
});
|
|
35293
35294
|
return;
|
|
35294
35295
|
}
|
|
35295
|
-
|
|
35296
|
+
fs56.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
35296
35297
|
if (err) {
|
|
35297
35298
|
self2.emit("error", err);
|
|
35298
35299
|
self2.readable = false;
|
|
@@ -35304,10 +35305,10 @@ var require_legacy_streams = __commonJS({
|
|
|
35304
35305
|
});
|
|
35305
35306
|
}
|
|
35306
35307
|
__name(ReadStream, "ReadStream");
|
|
35307
|
-
function WriteStream(
|
|
35308
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
35308
|
+
function WriteStream(path63, options) {
|
|
35309
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path63, options);
|
|
35309
35310
|
Stream2.call(this);
|
|
35310
|
-
this.path =
|
|
35311
|
+
this.path = path63;
|
|
35311
35312
|
this.fd = null;
|
|
35312
35313
|
this.writable = true;
|
|
35313
35314
|
this.flags = "w";
|
|
@@ -35332,7 +35333,7 @@ var require_legacy_streams = __commonJS({
|
|
|
35332
35333
|
this.busy = false;
|
|
35333
35334
|
this._queue = [];
|
|
35334
35335
|
if (this.fd === null) {
|
|
35335
|
-
this._open =
|
|
35336
|
+
this._open = fs56.open;
|
|
35336
35337
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
35337
35338
|
this.flush();
|
|
35338
35339
|
}
|
|
@@ -35372,7 +35373,7 @@ var require_clone = __commonJS({
|
|
|
35372
35373
|
var require_graceful_fs2 = __commonJS({
|
|
35373
35374
|
"node_modules/@pnpm/network.ca-file/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
35374
35375
|
init_esbuild_shims();
|
|
35375
|
-
var
|
|
35376
|
+
var fs56 = __require("fs");
|
|
35376
35377
|
var polyfills = require_polyfills();
|
|
35377
35378
|
var legacy = require_legacy_streams();
|
|
35378
35379
|
var clone = require_clone();
|
|
@@ -35406,12 +35407,12 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35406
35407
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
35407
35408
|
console.error(m);
|
|
35408
35409
|
}, "debug");
|
|
35409
|
-
if (!
|
|
35410
|
+
if (!fs56[gracefulQueue]) {
|
|
35410
35411
|
queue = globalThis[gracefulQueue] || [];
|
|
35411
|
-
publishQueue(
|
|
35412
|
-
|
|
35412
|
+
publishQueue(fs56, queue);
|
|
35413
|
+
fs56.close = function(fs$close) {
|
|
35413
35414
|
function close(fd, cb) {
|
|
35414
|
-
return fs$close.call(
|
|
35415
|
+
return fs$close.call(fs56, fd, function(err) {
|
|
35415
35416
|
if (!err) {
|
|
35416
35417
|
resetQueue();
|
|
35417
35418
|
}
|
|
@@ -35424,49 +35425,49 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35424
35425
|
value: fs$close
|
|
35425
35426
|
});
|
|
35426
35427
|
return close;
|
|
35427
|
-
}(
|
|
35428
|
-
|
|
35429
|
-
function
|
|
35430
|
-
fs$closeSync.apply(
|
|
35428
|
+
}(fs56.close);
|
|
35429
|
+
fs56.closeSync = function(fs$closeSync) {
|
|
35430
|
+
function closeSync3(fd) {
|
|
35431
|
+
fs$closeSync.apply(fs56, arguments);
|
|
35431
35432
|
resetQueue();
|
|
35432
35433
|
}
|
|
35433
|
-
__name(
|
|
35434
|
-
Object.defineProperty(
|
|
35434
|
+
__name(closeSync3, "closeSync");
|
|
35435
|
+
Object.defineProperty(closeSync3, previousSymbol, {
|
|
35435
35436
|
value: fs$closeSync
|
|
35436
35437
|
});
|
|
35437
|
-
return
|
|
35438
|
-
}(
|
|
35438
|
+
return closeSync3;
|
|
35439
|
+
}(fs56.closeSync);
|
|
35439
35440
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
35440
35441
|
process.on("exit", function() {
|
|
35441
|
-
debug(
|
|
35442
|
-
__require("assert").equal(
|
|
35442
|
+
debug(fs56[gracefulQueue]);
|
|
35443
|
+
__require("assert").equal(fs56[gracefulQueue].length, 0);
|
|
35443
35444
|
});
|
|
35444
35445
|
}
|
|
35445
35446
|
}
|
|
35446
35447
|
var queue;
|
|
35447
35448
|
if (!globalThis[gracefulQueue]) {
|
|
35448
|
-
publishQueue(globalThis,
|
|
35449
|
-
}
|
|
35450
|
-
module.exports = patch(clone(
|
|
35451
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
35452
|
-
module.exports = patch(
|
|
35453
|
-
|
|
35454
|
-
}
|
|
35455
|
-
function patch(
|
|
35456
|
-
polyfills(
|
|
35457
|
-
|
|
35458
|
-
|
|
35459
|
-
|
|
35460
|
-
var fs$readFile =
|
|
35461
|
-
|
|
35462
|
-
function readFile4(
|
|
35449
|
+
publishQueue(globalThis, fs56[gracefulQueue]);
|
|
35450
|
+
}
|
|
35451
|
+
module.exports = patch(clone(fs56));
|
|
35452
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs56.__patched) {
|
|
35453
|
+
module.exports = patch(fs56);
|
|
35454
|
+
fs56.__patched = true;
|
|
35455
|
+
}
|
|
35456
|
+
function patch(fs57) {
|
|
35457
|
+
polyfills(fs57);
|
|
35458
|
+
fs57.gracefulify = patch;
|
|
35459
|
+
fs57.createReadStream = createReadStream2;
|
|
35460
|
+
fs57.createWriteStream = createWriteStream4;
|
|
35461
|
+
var fs$readFile = fs57.readFile;
|
|
35462
|
+
fs57.readFile = readFile4;
|
|
35463
|
+
function readFile4(path63, options, cb) {
|
|
35463
35464
|
if (typeof options === "function")
|
|
35464
35465
|
cb = options, options = null;
|
|
35465
|
-
return go$readFile(
|
|
35466
|
-
function go$readFile(
|
|
35467
|
-
return fs$readFile(
|
|
35466
|
+
return go$readFile(path63, options, cb);
|
|
35467
|
+
function go$readFile(path64, options2, cb2, startTime) {
|
|
35468
|
+
return fs$readFile(path64, options2, function(err) {
|
|
35468
35469
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
35469
|
-
enqueue([go$readFile, [
|
|
35470
|
+
enqueue([go$readFile, [path64, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
35470
35471
|
else {
|
|
35471
35472
|
if (typeof cb2 === "function")
|
|
35472
35473
|
cb2.apply(this, arguments);
|
|
@@ -35476,16 +35477,16 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35476
35477
|
__name(go$readFile, "go$readFile");
|
|
35477
35478
|
}
|
|
35478
35479
|
__name(readFile4, "readFile");
|
|
35479
|
-
var fs$writeFile =
|
|
35480
|
-
|
|
35481
|
-
function writeFile8(
|
|
35480
|
+
var fs$writeFile = fs57.writeFile;
|
|
35481
|
+
fs57.writeFile = writeFile8;
|
|
35482
|
+
function writeFile8(path63, data, options, cb) {
|
|
35482
35483
|
if (typeof options === "function")
|
|
35483
35484
|
cb = options, options = null;
|
|
35484
|
-
return go$writeFile(
|
|
35485
|
-
function go$writeFile(
|
|
35486
|
-
return fs$writeFile(
|
|
35485
|
+
return go$writeFile(path63, data, options, cb);
|
|
35486
|
+
function go$writeFile(path64, data2, options2, cb2, startTime) {
|
|
35487
|
+
return fs$writeFile(path64, data2, options2, function(err) {
|
|
35487
35488
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
35488
|
-
enqueue([go$writeFile, [
|
|
35489
|
+
enqueue([go$writeFile, [path64, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
35489
35490
|
else {
|
|
35490
35491
|
if (typeof cb2 === "function")
|
|
35491
35492
|
cb2.apply(this, arguments);
|
|
@@ -35495,17 +35496,17 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35495
35496
|
__name(go$writeFile, "go$writeFile");
|
|
35496
35497
|
}
|
|
35497
35498
|
__name(writeFile8, "writeFile");
|
|
35498
|
-
var fs$appendFile =
|
|
35499
|
+
var fs$appendFile = fs57.appendFile;
|
|
35499
35500
|
if (fs$appendFile)
|
|
35500
|
-
|
|
35501
|
-
function appendFile(
|
|
35501
|
+
fs57.appendFile = appendFile;
|
|
35502
|
+
function appendFile(path63, data, options, cb) {
|
|
35502
35503
|
if (typeof options === "function")
|
|
35503
35504
|
cb = options, options = null;
|
|
35504
|
-
return go$appendFile(
|
|
35505
|
-
function go$appendFile(
|
|
35506
|
-
return fs$appendFile(
|
|
35505
|
+
return go$appendFile(path63, data, options, cb);
|
|
35506
|
+
function go$appendFile(path64, data2, options2, cb2, startTime) {
|
|
35507
|
+
return fs$appendFile(path64, data2, options2, function(err) {
|
|
35507
35508
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
35508
|
-
enqueue([go$appendFile, [
|
|
35509
|
+
enqueue([go$appendFile, [path64, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
35509
35510
|
else {
|
|
35510
35511
|
if (typeof cb2 === "function")
|
|
35511
35512
|
cb2.apply(this, arguments);
|
|
@@ -35515,9 +35516,9 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35515
35516
|
__name(go$appendFile, "go$appendFile");
|
|
35516
35517
|
}
|
|
35517
35518
|
__name(appendFile, "appendFile");
|
|
35518
|
-
var fs$copyFile =
|
|
35519
|
+
var fs$copyFile = fs57.copyFile;
|
|
35519
35520
|
if (fs$copyFile)
|
|
35520
|
-
|
|
35521
|
+
fs57.copyFile = copyFile;
|
|
35521
35522
|
function copyFile(src, dest, flags, cb) {
|
|
35522
35523
|
if (typeof flags === "function") {
|
|
35523
35524
|
cb = flags;
|
|
@@ -35537,34 +35538,34 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35537
35538
|
__name(go$copyFile, "go$copyFile");
|
|
35538
35539
|
}
|
|
35539
35540
|
__name(copyFile, "copyFile");
|
|
35540
|
-
var fs$readdir =
|
|
35541
|
-
|
|
35541
|
+
var fs$readdir = fs57.readdir;
|
|
35542
|
+
fs57.readdir = readdir4;
|
|
35542
35543
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
35543
|
-
function readdir4(
|
|
35544
|
+
function readdir4(path63, options, cb) {
|
|
35544
35545
|
if (typeof options === "function")
|
|
35545
35546
|
cb = options, options = null;
|
|
35546
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(
|
|
35547
|
-
return fs$readdir(
|
|
35548
|
-
|
|
35547
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(path64, options2, cb2, startTime) {
|
|
35548
|
+
return fs$readdir(path64, fs$readdirCallback(
|
|
35549
|
+
path64,
|
|
35549
35550
|
options2,
|
|
35550
35551
|
cb2,
|
|
35551
35552
|
startTime
|
|
35552
35553
|
));
|
|
35553
|
-
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(
|
|
35554
|
-
return fs$readdir(
|
|
35555
|
-
|
|
35554
|
+
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(path64, options2, cb2, startTime) {
|
|
35555
|
+
return fs$readdir(path64, options2, fs$readdirCallback(
|
|
35556
|
+
path64,
|
|
35556
35557
|
options2,
|
|
35557
35558
|
cb2,
|
|
35558
35559
|
startTime
|
|
35559
35560
|
));
|
|
35560
35561
|
}, "go$readdir");
|
|
35561
|
-
return go$readdir(
|
|
35562
|
-
function fs$readdirCallback(
|
|
35562
|
+
return go$readdir(path63, options, cb);
|
|
35563
|
+
function fs$readdirCallback(path64, options2, cb2, startTime) {
|
|
35563
35564
|
return function(err, files) {
|
|
35564
35565
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
35565
35566
|
enqueue([
|
|
35566
35567
|
go$readdir,
|
|
35567
|
-
[
|
|
35568
|
+
[path64, options2, cb2],
|
|
35568
35569
|
err,
|
|
35569
35570
|
startTime || Date.now(),
|
|
35570
35571
|
Date.now()
|
|
@@ -35581,21 +35582,21 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35581
35582
|
}
|
|
35582
35583
|
__name(readdir4, "readdir");
|
|
35583
35584
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
35584
|
-
var legStreams = legacy(
|
|
35585
|
+
var legStreams = legacy(fs57);
|
|
35585
35586
|
ReadStream = legStreams.ReadStream;
|
|
35586
35587
|
WriteStream = legStreams.WriteStream;
|
|
35587
35588
|
}
|
|
35588
|
-
var fs$ReadStream =
|
|
35589
|
+
var fs$ReadStream = fs57.ReadStream;
|
|
35589
35590
|
if (fs$ReadStream) {
|
|
35590
35591
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
35591
35592
|
ReadStream.prototype.open = ReadStream$open;
|
|
35592
35593
|
}
|
|
35593
|
-
var fs$WriteStream =
|
|
35594
|
+
var fs$WriteStream = fs57.WriteStream;
|
|
35594
35595
|
if (fs$WriteStream) {
|
|
35595
35596
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
35596
35597
|
WriteStream.prototype.open = WriteStream$open;
|
|
35597
35598
|
}
|
|
35598
|
-
Object.defineProperty(
|
|
35599
|
+
Object.defineProperty(fs57, "ReadStream", {
|
|
35599
35600
|
get: /* @__PURE__ */ __name(function() {
|
|
35600
35601
|
return ReadStream;
|
|
35601
35602
|
}, "get"),
|
|
@@ -35605,7 +35606,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35605
35606
|
enumerable: true,
|
|
35606
35607
|
configurable: true
|
|
35607
35608
|
});
|
|
35608
|
-
Object.defineProperty(
|
|
35609
|
+
Object.defineProperty(fs57, "WriteStream", {
|
|
35609
35610
|
get: /* @__PURE__ */ __name(function() {
|
|
35610
35611
|
return WriteStream;
|
|
35611
35612
|
}, "get"),
|
|
@@ -35616,7 +35617,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35616
35617
|
configurable: true
|
|
35617
35618
|
});
|
|
35618
35619
|
var FileReadStream = ReadStream;
|
|
35619
|
-
Object.defineProperty(
|
|
35620
|
+
Object.defineProperty(fs57, "FileReadStream", {
|
|
35620
35621
|
get: /* @__PURE__ */ __name(function() {
|
|
35621
35622
|
return FileReadStream;
|
|
35622
35623
|
}, "get"),
|
|
@@ -35627,7 +35628,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35627
35628
|
configurable: true
|
|
35628
35629
|
});
|
|
35629
35630
|
var FileWriteStream = WriteStream;
|
|
35630
|
-
Object.defineProperty(
|
|
35631
|
+
Object.defineProperty(fs57, "FileWriteStream", {
|
|
35631
35632
|
get: /* @__PURE__ */ __name(function() {
|
|
35632
35633
|
return FileWriteStream;
|
|
35633
35634
|
}, "get"),
|
|
@@ -35637,7 +35638,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35637
35638
|
enumerable: true,
|
|
35638
35639
|
configurable: true
|
|
35639
35640
|
});
|
|
35640
|
-
function ReadStream(
|
|
35641
|
+
function ReadStream(path63, options) {
|
|
35641
35642
|
if (this instanceof ReadStream)
|
|
35642
35643
|
return fs$ReadStream.apply(this, arguments), this;
|
|
35643
35644
|
else
|
|
@@ -35659,7 +35660,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35659
35660
|
});
|
|
35660
35661
|
}
|
|
35661
35662
|
__name(ReadStream$open, "ReadStream$open");
|
|
35662
|
-
function WriteStream(
|
|
35663
|
+
function WriteStream(path63, options) {
|
|
35663
35664
|
if (this instanceof WriteStream)
|
|
35664
35665
|
return fs$WriteStream.apply(this, arguments), this;
|
|
35665
35666
|
else
|
|
@@ -35679,24 +35680,24 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35679
35680
|
});
|
|
35680
35681
|
}
|
|
35681
35682
|
__name(WriteStream$open, "WriteStream$open");
|
|
35682
|
-
function createReadStream2(
|
|
35683
|
-
return new
|
|
35683
|
+
function createReadStream2(path63, options) {
|
|
35684
|
+
return new fs57.ReadStream(path63, options);
|
|
35684
35685
|
}
|
|
35685
35686
|
__name(createReadStream2, "createReadStream");
|
|
35686
|
-
function createWriteStream4(
|
|
35687
|
-
return new
|
|
35687
|
+
function createWriteStream4(path63, options) {
|
|
35688
|
+
return new fs57.WriteStream(path63, options);
|
|
35688
35689
|
}
|
|
35689
35690
|
__name(createWriteStream4, "createWriteStream");
|
|
35690
|
-
var fs$open =
|
|
35691
|
-
|
|
35692
|
-
function open4(
|
|
35691
|
+
var fs$open = fs57.open;
|
|
35692
|
+
fs57.open = open4;
|
|
35693
|
+
function open4(path63, flags, mode, cb) {
|
|
35693
35694
|
if (typeof mode === "function")
|
|
35694
35695
|
cb = mode, mode = null;
|
|
35695
|
-
return go$open(
|
|
35696
|
-
function go$open(
|
|
35697
|
-
return fs$open(
|
|
35696
|
+
return go$open(path63, flags, mode, cb);
|
|
35697
|
+
function go$open(path64, flags2, mode2, cb2, startTime) {
|
|
35698
|
+
return fs$open(path64, flags2, mode2, function(err, fd) {
|
|
35698
35699
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
35699
|
-
enqueue([go$open, [
|
|
35700
|
+
enqueue([go$open, [path64, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
35700
35701
|
else {
|
|
35701
35702
|
if (typeof cb2 === "function")
|
|
35702
35703
|
cb2.apply(this, arguments);
|
|
@@ -35706,22 +35707,22 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35706
35707
|
__name(go$open, "go$open");
|
|
35707
35708
|
}
|
|
35708
35709
|
__name(open4, "open");
|
|
35709
|
-
return
|
|
35710
|
+
return fs57;
|
|
35710
35711
|
}
|
|
35711
35712
|
__name(patch, "patch");
|
|
35712
35713
|
function enqueue(elem) {
|
|
35713
35714
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
35714
|
-
|
|
35715
|
+
fs56[gracefulQueue].push(elem);
|
|
35715
35716
|
retry();
|
|
35716
35717
|
}
|
|
35717
35718
|
__name(enqueue, "enqueue");
|
|
35718
35719
|
var retryTimer;
|
|
35719
35720
|
function resetQueue() {
|
|
35720
35721
|
var now = Date.now();
|
|
35721
|
-
for (var i = 0; i <
|
|
35722
|
-
if (
|
|
35723
|
-
|
|
35724
|
-
|
|
35722
|
+
for (var i = 0; i < fs56[gracefulQueue].length; ++i) {
|
|
35723
|
+
if (fs56[gracefulQueue][i].length > 2) {
|
|
35724
|
+
fs56[gracefulQueue][i][3] = now;
|
|
35725
|
+
fs56[gracefulQueue][i][4] = now;
|
|
35725
35726
|
}
|
|
35726
35727
|
}
|
|
35727
35728
|
retry();
|
|
@@ -35730,9 +35731,9 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35730
35731
|
function retry() {
|
|
35731
35732
|
clearTimeout(retryTimer);
|
|
35732
35733
|
retryTimer = void 0;
|
|
35733
|
-
if (
|
|
35734
|
+
if (fs56[gracefulQueue].length === 0)
|
|
35734
35735
|
return;
|
|
35735
|
-
var elem =
|
|
35736
|
+
var elem = fs56[gracefulQueue].shift();
|
|
35736
35737
|
var fn = elem[0];
|
|
35737
35738
|
var args = elem[1];
|
|
35738
35739
|
var err = elem[2];
|
|
@@ -35754,7 +35755,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
35754
35755
|
debug("RETRY", fn.name, args);
|
|
35755
35756
|
fn.apply(null, args.concat([startTime]));
|
|
35756
35757
|
} else {
|
|
35757
|
-
|
|
35758
|
+
fs56[gracefulQueue].push(elem);
|
|
35758
35759
|
}
|
|
35759
35760
|
}
|
|
35760
35761
|
if (retryTimer === void 0) {
|
|
@@ -36091,8 +36092,8 @@ var require_config_chain = __commonJS({
|
|
|
36091
36092
|
"node_modules/config-chain/index.js"(exports, module) {
|
|
36092
36093
|
init_esbuild_shims();
|
|
36093
36094
|
var ProtoList = require_proto_list();
|
|
36094
|
-
var
|
|
36095
|
-
var
|
|
36095
|
+
var path63 = __require("path");
|
|
36096
|
+
var fs56 = __require("fs");
|
|
36096
36097
|
var ini2 = require_ini2();
|
|
36097
36098
|
var EE = __require("events").EventEmitter;
|
|
36098
36099
|
var url = __require("url");
|
|
@@ -36106,15 +36107,15 @@ var require_config_chain = __commonJS({
|
|
|
36106
36107
|
return conf;
|
|
36107
36108
|
};
|
|
36108
36109
|
var find = exports.find = function() {
|
|
36109
|
-
var rel =
|
|
36110
|
+
var rel = path63.join.apply(null, [].slice.call(arguments));
|
|
36110
36111
|
function find2(start, rel2) {
|
|
36111
|
-
var file =
|
|
36112
|
+
var file = path63.join(start, rel2);
|
|
36112
36113
|
try {
|
|
36113
|
-
|
|
36114
|
+
fs56.statSync(file);
|
|
36114
36115
|
return file;
|
|
36115
36116
|
} catch (err) {
|
|
36116
|
-
if (
|
|
36117
|
-
return find2(
|
|
36117
|
+
if (path63.dirname(start) !== start)
|
|
36118
|
+
return find2(path63.dirname(start), rel2);
|
|
36118
36119
|
}
|
|
36119
36120
|
}
|
|
36120
36121
|
__name(find2, "find");
|
|
@@ -36146,10 +36147,10 @@ var require_config_chain = __commonJS({
|
|
|
36146
36147
|
var args = [].slice.call(arguments).filter(function(arg) {
|
|
36147
36148
|
return arg != null;
|
|
36148
36149
|
});
|
|
36149
|
-
var file =
|
|
36150
|
+
var file = path63.join.apply(null, args);
|
|
36150
36151
|
var content;
|
|
36151
36152
|
try {
|
|
36152
|
-
content =
|
|
36153
|
+
content = fs56.readFileSync(file, "utf-8");
|
|
36153
36154
|
} catch (err) {
|
|
36154
36155
|
return;
|
|
36155
36156
|
}
|
|
@@ -36243,7 +36244,7 @@ var require_config_chain = __commonJS({
|
|
|
36243
36244
|
data = ini2.stringify(data);
|
|
36244
36245
|
}
|
|
36245
36246
|
this._saving++;
|
|
36246
|
-
|
|
36247
|
+
fs56.writeFile(target.path, data, "utf8", function(er) {
|
|
36247
36248
|
this._saving--;
|
|
36248
36249
|
if (er) {
|
|
36249
36250
|
if (cb) return cb(er);
|
|
@@ -36262,7 +36263,7 @@ var require_config_chain = __commonJS({
|
|
|
36262
36263
|
this.sources[name] = { path: file, type };
|
|
36263
36264
|
this.push(marker);
|
|
36264
36265
|
this._await();
|
|
36265
|
-
|
|
36266
|
+
fs56.readFile(file, "utf8", function(er, data) {
|
|
36266
36267
|
if (er) this.emit("error", er);
|
|
36267
36268
|
this.addString(data, file, type, marker);
|
|
36268
36269
|
}.bind(this));
|
|
@@ -36416,8 +36417,8 @@ var require_util10 = __commonJS({
|
|
|
36416
36417
|
"node_modules/@pnpm/npm-conf/lib/util.js"(exports) {
|
|
36417
36418
|
"use strict";
|
|
36418
36419
|
init_esbuild_shims();
|
|
36419
|
-
var
|
|
36420
|
-
var
|
|
36420
|
+
var fs56 = __require("fs");
|
|
36421
|
+
var path63 = __require("path");
|
|
36421
36422
|
var { envReplace } = require_dist2();
|
|
36422
36423
|
var parseKey = /* @__PURE__ */ __name((key) => {
|
|
36423
36424
|
if (typeof key !== "string") {
|
|
@@ -36430,7 +36431,7 @@ var require_util10 = __commonJS({
|
|
|
36430
36431
|
return field;
|
|
36431
36432
|
}
|
|
36432
36433
|
const typeList = [].concat(types[key]);
|
|
36433
|
-
const isPath = typeList.indexOf(
|
|
36434
|
+
const isPath = typeList.indexOf(path63) !== -1;
|
|
36434
36435
|
const isBool = typeList.indexOf(Boolean) !== -1;
|
|
36435
36436
|
const isString2 = typeList.indexOf(String) !== -1;
|
|
36436
36437
|
const isNumber = typeList.indexOf(Number) !== -1;
|
|
@@ -36464,9 +36465,9 @@ var require_util10 = __commonJS({
|
|
|
36464
36465
|
if (isPath) {
|
|
36465
36466
|
const regex2 = process.platform === "win32" ? /^~(\/|\\)/ : /^~\//;
|
|
36466
36467
|
if (regex2.test(field) && process.env.HOME) {
|
|
36467
|
-
field =
|
|
36468
|
+
field = path63.resolve(process.env.HOME, field.substr(2));
|
|
36468
36469
|
}
|
|
36469
|
-
field =
|
|
36470
|
+
field = path63.resolve(field);
|
|
36470
36471
|
}
|
|
36471
36472
|
if (isNumber && !isNaN(field)) {
|
|
36472
36473
|
field = Number(field);
|
|
@@ -36474,10 +36475,10 @@ var require_util10 = __commonJS({
|
|
|
36474
36475
|
return field;
|
|
36475
36476
|
}, "parseField");
|
|
36476
36477
|
var findPrefix = /* @__PURE__ */ __name((name) => {
|
|
36477
|
-
name =
|
|
36478
|
+
name = path63.resolve(name);
|
|
36478
36479
|
let walkedUp = false;
|
|
36479
|
-
while (
|
|
36480
|
-
name =
|
|
36480
|
+
while (path63.basename(name) === "node_modules") {
|
|
36481
|
+
name = path63.dirname(name);
|
|
36481
36482
|
walkedUp = true;
|
|
36482
36483
|
}
|
|
36483
36484
|
if (walkedUp) {
|
|
@@ -36489,11 +36490,11 @@ var require_util10 = __commonJS({
|
|
|
36489
36490
|
return original;
|
|
36490
36491
|
}
|
|
36491
36492
|
try {
|
|
36492
|
-
const files =
|
|
36493
|
+
const files = fs56.readdirSync(name2);
|
|
36493
36494
|
if (files.includes("node_modules") || files.includes("package.json") || files.includes("package.json5") || files.includes("package.yaml") || files.includes("pnpm-workspace.yaml")) {
|
|
36494
36495
|
return name2;
|
|
36495
36496
|
}
|
|
36496
|
-
const dirname21 =
|
|
36497
|
+
const dirname21 = path63.dirname(name2);
|
|
36497
36498
|
if (dirname21 === name2) {
|
|
36498
36499
|
return original;
|
|
36499
36500
|
}
|
|
@@ -36522,7 +36523,7 @@ var require_types = __commonJS({
|
|
|
36522
36523
|
"node_modules/@pnpm/npm-conf/lib/types.js"(exports) {
|
|
36523
36524
|
"use strict";
|
|
36524
36525
|
init_esbuild_shims();
|
|
36525
|
-
var
|
|
36526
|
+
var path63 = __require("path");
|
|
36526
36527
|
var Stream2 = __require("stream").Stream;
|
|
36527
36528
|
var url = __require("url");
|
|
36528
36529
|
var Umask = /* @__PURE__ */ __name(() => {
|
|
@@ -36540,8 +36541,8 @@ var require_types = __commonJS({
|
|
|
36540
36541
|
"bin-links": Boolean,
|
|
36541
36542
|
browser: [null, String],
|
|
36542
36543
|
ca: [null, String, Array],
|
|
36543
|
-
cafile:
|
|
36544
|
-
cache:
|
|
36544
|
+
cafile: path63,
|
|
36545
|
+
cache: path63,
|
|
36545
36546
|
"cache-lock-stale": Number,
|
|
36546
36547
|
"cache-lock-retries": Number,
|
|
36547
36548
|
"cache-lock-wait": Number,
|
|
@@ -36565,7 +36566,7 @@ var require_types = __commonJS({
|
|
|
36565
36566
|
"git-tag-version": Boolean,
|
|
36566
36567
|
"commit-hooks": Boolean,
|
|
36567
36568
|
global: Boolean,
|
|
36568
|
-
globalconfig:
|
|
36569
|
+
globalconfig: path63,
|
|
36569
36570
|
"global-style": Boolean,
|
|
36570
36571
|
group: [Number, String],
|
|
36571
36572
|
"https-proxy": [null, url],
|
|
@@ -36575,7 +36576,7 @@ var require_types = __commonJS({
|
|
|
36575
36576
|
"if-present": Boolean,
|
|
36576
36577
|
"ignore-prepublish": Boolean,
|
|
36577
36578
|
"ignore-scripts": Boolean,
|
|
36578
|
-
"init-module":
|
|
36579
|
+
"init-module": path63,
|
|
36579
36580
|
"init-author-name": String,
|
|
36580
36581
|
"init-author-email": String,
|
|
36581
36582
|
"init-author-url": ["", url],
|
|
@@ -36608,7 +36609,7 @@ var require_types = __commonJS({
|
|
|
36608
36609
|
parseable: Boolean,
|
|
36609
36610
|
"prefer-offline": Boolean,
|
|
36610
36611
|
"prefer-online": Boolean,
|
|
36611
|
-
prefix:
|
|
36612
|
+
prefix: path63,
|
|
36612
36613
|
production: Boolean,
|
|
36613
36614
|
progress: Boolean,
|
|
36614
36615
|
proxy: [null, false, url],
|
|
@@ -36641,12 +36642,12 @@ var require_types = __commonJS({
|
|
|
36641
36642
|
"strict-ssl": Boolean,
|
|
36642
36643
|
tag: String,
|
|
36643
36644
|
timing: Boolean,
|
|
36644
|
-
tmp:
|
|
36645
|
+
tmp: path63,
|
|
36645
36646
|
unicode: Boolean,
|
|
36646
36647
|
"unsafe-perm": Boolean,
|
|
36647
36648
|
usage: Boolean,
|
|
36648
36649
|
user: [Number, String],
|
|
36649
|
-
userconfig:
|
|
36650
|
+
userconfig: path63,
|
|
36650
36651
|
umask: Umask,
|
|
36651
36652
|
version: Boolean,
|
|
36652
36653
|
"tag-version-prefix": String,
|
|
@@ -36663,8 +36664,8 @@ var require_conf = __commonJS({
|
|
|
36663
36664
|
"use strict";
|
|
36664
36665
|
init_esbuild_shims();
|
|
36665
36666
|
var { readCAFileSync } = require_dist();
|
|
36666
|
-
var
|
|
36667
|
-
var
|
|
36667
|
+
var fs56 = __require("fs");
|
|
36668
|
+
var path63 = __require("path");
|
|
36668
36669
|
var { ConfigChain } = require_config_chain();
|
|
36669
36670
|
var envKeyToSetting = require_envKeyToSetting();
|
|
36670
36671
|
var util = require_util10();
|
|
@@ -36701,7 +36702,7 @@ var require_conf = __commonJS({
|
|
|
36701
36702
|
this.push(marker);
|
|
36702
36703
|
this._await();
|
|
36703
36704
|
try {
|
|
36704
|
-
const contents =
|
|
36705
|
+
const contents = fs56.readFileSync(file, "utf8");
|
|
36705
36706
|
this.addString(contents, file, "ini", marker);
|
|
36706
36707
|
} catch (error) {
|
|
36707
36708
|
if (error.code === "ENOENT") {
|
|
@@ -36745,7 +36746,7 @@ var require_conf = __commonJS({
|
|
|
36745
36746
|
this.set("prefix", prefix);
|
|
36746
36747
|
}, "set"),
|
|
36747
36748
|
get: /* @__PURE__ */ __name(() => {
|
|
36748
|
-
return
|
|
36749
|
+
return path63.resolve(this.get("prefix"));
|
|
36749
36750
|
}, "get")
|
|
36750
36751
|
});
|
|
36751
36752
|
let p;
|
|
@@ -36759,7 +36760,7 @@ var require_conf = __commonJS({
|
|
|
36759
36760
|
}, "get")
|
|
36760
36761
|
});
|
|
36761
36762
|
if (Object.prototype.hasOwnProperty.call(cli, "prefix")) {
|
|
36762
|
-
p =
|
|
36763
|
+
p = path63.resolve(cli.prefix);
|
|
36763
36764
|
} else {
|
|
36764
36765
|
try {
|
|
36765
36766
|
const prefix = util.findPrefix(process.cwd());
|
|
@@ -36790,9 +36791,9 @@ var require_conf = __commonJS({
|
|
|
36790
36791
|
defConf.user = Number(process.env.SUDO_UID);
|
|
36791
36792
|
return;
|
|
36792
36793
|
}
|
|
36793
|
-
const prefix =
|
|
36794
|
+
const prefix = path63.resolve(this.get("prefix"));
|
|
36794
36795
|
try {
|
|
36795
|
-
const stats =
|
|
36796
|
+
const stats = fs56.statSync(prefix);
|
|
36796
36797
|
defConf.user = stats.uid;
|
|
36797
36798
|
} catch (error) {
|
|
36798
36799
|
if (error.code === "ENOENT") {
|
|
@@ -36829,7 +36830,7 @@ var require_defaults = __commonJS({
|
|
|
36829
36830
|
"use strict";
|
|
36830
36831
|
init_esbuild_shims();
|
|
36831
36832
|
var os34 = __require("os");
|
|
36832
|
-
var
|
|
36833
|
+
var path63 = __require("path");
|
|
36833
36834
|
var temp = os34.tmpdir();
|
|
36834
36835
|
var uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
36835
36836
|
var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
|
|
@@ -36845,11 +36846,11 @@ var require_defaults = __commonJS({
|
|
|
36845
36846
|
if (home) {
|
|
36846
36847
|
process.env.HOME = home;
|
|
36847
36848
|
} else {
|
|
36848
|
-
home =
|
|
36849
|
+
home = path63.resolve(temp, "npm-" + uidOrPid);
|
|
36849
36850
|
}
|
|
36850
36851
|
var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm";
|
|
36851
36852
|
var cacheRoot = process.platform === "win32" && process.env.APPDATA || home;
|
|
36852
|
-
var cache3 =
|
|
36853
|
+
var cache3 = path63.resolve(cacheRoot, cacheExtra);
|
|
36853
36854
|
var defaults;
|
|
36854
36855
|
var globalPrefix;
|
|
36855
36856
|
Object.defineProperty(exports, "defaults", {
|
|
@@ -36858,11 +36859,11 @@ var require_defaults = __commonJS({
|
|
|
36858
36859
|
if (process.env.PREFIX) {
|
|
36859
36860
|
globalPrefix = process.env.PREFIX;
|
|
36860
36861
|
} else if (process.platform === "win32") {
|
|
36861
|
-
globalPrefix =
|
|
36862
|
+
globalPrefix = path63.dirname(process.execPath);
|
|
36862
36863
|
} else {
|
|
36863
|
-
globalPrefix =
|
|
36864
|
+
globalPrefix = path63.dirname(path63.dirname(process.execPath));
|
|
36864
36865
|
if (process.env.DESTDIR) {
|
|
36865
|
-
globalPrefix =
|
|
36866
|
+
globalPrefix = path63.join(process.env.DESTDIR, globalPrefix);
|
|
36866
36867
|
}
|
|
36867
36868
|
}
|
|
36868
36869
|
defaults = {
|
|
@@ -36900,7 +36901,7 @@ var require_defaults = __commonJS({
|
|
|
36900
36901
|
"git-tag-version": true,
|
|
36901
36902
|
"commit-hooks": true,
|
|
36902
36903
|
global: false,
|
|
36903
|
-
globalconfig:
|
|
36904
|
+
globalconfig: path63.resolve(globalPrefix, "etc", "npmrc"),
|
|
36904
36905
|
"global-style": false,
|
|
36905
36906
|
group: process.platform === "win32" ? 0 : process.env.SUDO_GID || process.getgid && process.getgid(),
|
|
36906
36907
|
"ham-it-up": false,
|
|
@@ -36908,7 +36909,7 @@ var require_defaults = __commonJS({
|
|
|
36908
36909
|
"if-present": false,
|
|
36909
36910
|
"ignore-prepublish": false,
|
|
36910
36911
|
"ignore-scripts": false,
|
|
36911
|
-
"init-module":
|
|
36912
|
+
"init-module": path63.resolve(home, ".npm-init.js"),
|
|
36912
36913
|
"init-author-name": "",
|
|
36913
36914
|
"init-author-email": "",
|
|
36914
36915
|
"init-author-url": "",
|
|
@@ -36979,7 +36980,7 @@ var require_defaults = __commonJS({
|
|
|
36979
36980
|
"unsafe-perm": process.platform === "win32" || process.platform === "cygwin" || !(process.getuid && process.setuid && process.getgid && process.setgid) || process.getuid() !== 0,
|
|
36980
36981
|
usage: false,
|
|
36981
36982
|
user: process.platform === "win32" ? 0 : "nobody",
|
|
36982
|
-
userconfig:
|
|
36983
|
+
userconfig: path63.resolve(home, ".npmrc"),
|
|
36983
36984
|
umask: process.umask ? process.umask() : umask.fromString("022"),
|
|
36984
36985
|
version: false,
|
|
36985
36986
|
versions: false,
|
|
@@ -36997,7 +36998,7 @@ var require_npm_conf = __commonJS({
|
|
|
36997
36998
|
"node_modules/@pnpm/npm-conf/index.js"(exports, module) {
|
|
36998
36999
|
"use strict";
|
|
36999
37000
|
init_esbuild_shims();
|
|
37000
|
-
var
|
|
37001
|
+
var path63 = __require("path");
|
|
37001
37002
|
var Conf = require_conf();
|
|
37002
37003
|
var _defaults = require_defaults();
|
|
37003
37004
|
module.exports = (opts, types, defaults) => {
|
|
@@ -37014,12 +37015,12 @@ var require_npm_conf = __commonJS({
|
|
|
37014
37015
|
failedToLoadBuiltInConfig = true;
|
|
37015
37016
|
}
|
|
37016
37017
|
if (npmPath) {
|
|
37017
|
-
warnings.push(conf.addFile(
|
|
37018
|
+
warnings.push(conf.addFile(path63.resolve(path63.dirname(npmPath), "..", "npmrc"), "builtin"));
|
|
37018
37019
|
}
|
|
37019
37020
|
}
|
|
37020
37021
|
conf.addEnv();
|
|
37021
37022
|
conf.loadPrefix();
|
|
37022
|
-
const projectConf =
|
|
37023
|
+
const projectConf = path63.resolve(conf.localPrefix, ".npmrc");
|
|
37023
37024
|
const userConf = conf.get("userconfig");
|
|
37024
37025
|
if (!conf.get("global") && projectConf !== userConf) {
|
|
37025
37026
|
warnings.push(conf.addFile(projectConf, "project"));
|
|
@@ -37027,14 +37028,14 @@ var require_npm_conf = __commonJS({
|
|
|
37027
37028
|
conf.add({}, "project");
|
|
37028
37029
|
}
|
|
37029
37030
|
if (conf.get("workspace-prefix") && conf.get("workspace-prefix") !== projectConf) {
|
|
37030
|
-
const workspaceConf =
|
|
37031
|
+
const workspaceConf = path63.resolve(conf.get("workspace-prefix"), ".npmrc");
|
|
37031
37032
|
warnings.push(conf.addFile(workspaceConf, "workspace"));
|
|
37032
37033
|
}
|
|
37033
37034
|
warnings.push(conf.addFile(conf.get("userconfig"), "user"));
|
|
37034
37035
|
if (conf.get("prefix")) {
|
|
37035
|
-
const etc =
|
|
37036
|
-
conf.root.globalconfig =
|
|
37037
|
-
conf.root.globalignorefile =
|
|
37036
|
+
const etc = path63.resolve(conf.get("prefix"), "etc");
|
|
37037
|
+
conf.root.globalconfig = path63.resolve(etc, "npmrc");
|
|
37038
|
+
conf.root.globalignorefile = path63.resolve(etc, "npmignore");
|
|
37038
37039
|
}
|
|
37039
37040
|
warnings.push(conf.addFile(conf.get("globalconfig"), "global"));
|
|
37040
37041
|
conf.loadUser();
|
|
@@ -37122,8 +37123,8 @@ var require_registry_auth_token = __commonJS({
|
|
|
37122
37123
|
return { token, type: "Basic" };
|
|
37123
37124
|
}
|
|
37124
37125
|
__name(getLegacyAuthInfo, "getLegacyAuthInfo");
|
|
37125
|
-
function normalizePath2(
|
|
37126
|
-
return
|
|
37126
|
+
function normalizePath2(path63) {
|
|
37127
|
+
return path63[path63.length - 1] === "/" ? path63 : path63 + "/";
|
|
37127
37128
|
}
|
|
37128
37129
|
__name(normalizePath2, "normalizePath");
|
|
37129
37130
|
function getAuthInfoForUrl(regUrl, npmrc) {
|
|
@@ -44516,8 +44517,8 @@ var cleanupYogaNode = /* @__PURE__ */ __name((node) => {
|
|
|
44516
44517
|
var currentUpdatePriority = import_constants.NoEventPriority;
|
|
44517
44518
|
var currentRootNode;
|
|
44518
44519
|
async function loadPackageJson() {
|
|
44519
|
-
const
|
|
44520
|
-
const content =
|
|
44520
|
+
const fs56 = await import("node:fs");
|
|
44521
|
+
const content = fs56.readFileSync(new URL("../package.json", import.meta.url), "utf8");
|
|
44521
44522
|
const parsedContent = JSON.parse(content);
|
|
44522
44523
|
return {
|
|
44523
44524
|
name: parsedContent?.name,
|
|
@@ -47204,8 +47205,8 @@ function Text({ color: color2, backgroundColor, dimColor = false, bold = false,
|
|
|
47204
47205
|
__name(Text, "Text");
|
|
47205
47206
|
|
|
47206
47207
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
47207
|
-
var cleanupPath = /* @__PURE__ */ __name((
|
|
47208
|
-
return
|
|
47208
|
+
var cleanupPath = /* @__PURE__ */ __name((path63) => {
|
|
47209
|
+
return path63?.replace(`file://${cwd()}/`, "");
|
|
47209
47210
|
}, "cleanupPath");
|
|
47210
47211
|
var stackUtils = new import_stack_utils.default({
|
|
47211
47212
|
cwd: cwd(),
|
|
@@ -49262,7 +49263,7 @@ var measure_element_default = measureElement;
|
|
|
49262
49263
|
var import_react237 = __toESM(require_react(), 1);
|
|
49263
49264
|
import dns from "node:dns";
|
|
49264
49265
|
import os33 from "node:os";
|
|
49265
|
-
import
|
|
49266
|
+
import path62, { basename as basename14 } from "node:path";
|
|
49266
49267
|
import v83 from "node:v8";
|
|
49267
49268
|
|
|
49268
49269
|
// packages/cli/src/config/auth.ts
|
|
@@ -51657,11 +51658,11 @@ var parser = new YargsParser({
|
|
|
51657
51658
|
resolve: resolve3,
|
|
51658
51659
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
51659
51660
|
// we can exercise all the lines below:
|
|
51660
|
-
require: /* @__PURE__ */ __name((
|
|
51661
|
+
require: /* @__PURE__ */ __name((path63) => {
|
|
51661
51662
|
if (typeof __require !== "undefined") {
|
|
51662
|
-
return __require(
|
|
51663
|
-
} else if (
|
|
51664
|
-
return JSON.parse(readFileSync2(
|
|
51663
|
+
return __require(path63);
|
|
51664
|
+
} else if (path63.match(/\.json$/)) {
|
|
51665
|
+
return JSON.parse(readFileSync2(path63, "utf8"));
|
|
51665
51666
|
} else {
|
|
51666
51667
|
throw Error("only .json config files are supported in ESM");
|
|
51667
51668
|
}
|
|
@@ -53077,13 +53078,13 @@ function usage(yargs, shim3) {
|
|
|
53077
53078
|
};
|
|
53078
53079
|
self2.stringifiedValues = /* @__PURE__ */ __name(function stringifiedValues(values, separator) {
|
|
53079
53080
|
let string = "";
|
|
53080
|
-
const
|
|
53081
|
+
const sep6 = separator || ", ";
|
|
53081
53082
|
const array = [].concat(values);
|
|
53082
53083
|
if (!values || !array.length)
|
|
53083
53084
|
return string;
|
|
53084
53085
|
array.forEach((value) => {
|
|
53085
53086
|
if (string.length)
|
|
53086
|
-
string +=
|
|
53087
|
+
string += sep6;
|
|
53087
53088
|
string += JSON.stringify(value);
|
|
53088
53089
|
});
|
|
53089
53090
|
return string;
|
|
@@ -55497,29 +55498,29 @@ init_esbuild_shims();
|
|
|
55497
55498
|
import { access, cp, mkdir, readdir, writeFile as writeFile2 } from "node:fs/promises";
|
|
55498
55499
|
import { join as join4, basename as basename3 } from "node:path";
|
|
55499
55500
|
var EXAMPLES_PATH = join4(resolveBundleDir(import.meta.url), "examples");
|
|
55500
|
-
async function pathExists(
|
|
55501
|
+
async function pathExists(path63) {
|
|
55501
55502
|
try {
|
|
55502
|
-
await access(
|
|
55503
|
+
await access(path63);
|
|
55503
55504
|
return true;
|
|
55504
55505
|
} catch (_e) {
|
|
55505
55506
|
return false;
|
|
55506
55507
|
}
|
|
55507
55508
|
}
|
|
55508
55509
|
__name(pathExists, "pathExists");
|
|
55509
|
-
async function createDirectory(
|
|
55510
|
-
if (await pathExists(
|
|
55511
|
-
throw new Error(`Path already exists: ${
|
|
55510
|
+
async function createDirectory(path63) {
|
|
55511
|
+
if (await pathExists(path63)) {
|
|
55512
|
+
throw new Error(`Path already exists: ${path63}`);
|
|
55512
55513
|
}
|
|
55513
|
-
await mkdir(
|
|
55514
|
+
await mkdir(path63, { recursive: true });
|
|
55514
55515
|
}
|
|
55515
55516
|
__name(createDirectory, "createDirectory");
|
|
55516
|
-
async function copyDirectory(template,
|
|
55517
|
-
await createDirectory(
|
|
55517
|
+
async function copyDirectory(template, path63) {
|
|
55518
|
+
await createDirectory(path63);
|
|
55518
55519
|
const examplePath = join4(EXAMPLES_PATH, template);
|
|
55519
55520
|
const entries = await readdir(examplePath, { withFileTypes: true });
|
|
55520
55521
|
for (const entry of entries) {
|
|
55521
55522
|
const srcPath = join4(examplePath, entry.name);
|
|
55522
|
-
const destPath = join4(
|
|
55523
|
+
const destPath = join4(path63, entry.name);
|
|
55523
55524
|
await cp(srcPath, destPath, { recursive: true });
|
|
55524
55525
|
}
|
|
55525
55526
|
}
|
|
@@ -57034,9 +57035,9 @@ function ensureBuiltins() {
|
|
|
57034
57035
|
if (!builtinsPromise) {
|
|
57035
57036
|
builtinsPromise = (async () => {
|
|
57036
57037
|
const labelled = [
|
|
57037
|
-
{ name: "telegram", promise: import("./chunks/dist-
|
|
57038
|
+
{ name: "telegram", promise: import("./chunks/dist-GKRNVFBH.js") },
|
|
57038
57039
|
{ name: "weixin", promise: import("./chunks/dist-BD27IA3L.js") },
|
|
57039
|
-
{ name: "dingtalk", promise: import("./chunks/dist-
|
|
57040
|
+
{ name: "dingtalk", promise: import("./chunks/dist-DZ6AJDX4.js") },
|
|
57040
57041
|
{ name: "feishu", promise: import("./chunks/dist-KIYB7DQW.js") },
|
|
57041
57042
|
{ name: "qqbot", promise: import("./chunks/dist-QFFZWACU.js") }
|
|
57042
57043
|
];
|
|
@@ -57958,6 +57959,7 @@ var buildRemovalNotice = /* @__PURE__ */ __name(() => [
|
|
|
57958
57959
|
` ${t("China: https://coding.dashscope.aliyuncs.com/v1")}`,
|
|
57959
57960
|
` ${t("International: https://coding-intl.dashscope.aliyuncs.com/v1")}`,
|
|
57960
57961
|
` ${cyan(t("OpenRouter"))} \u2192 ${t("set OPENROUTER_API_KEY and OPENAI_BASE_URL=https://openrouter.ai/api/v1")}`,
|
|
57962
|
+
` ${cyan(t("Requesty"))} \u2192 ${t("set REQUESTY_API_KEY and OPENAI_BASE_URL=https://router.requesty.ai/v1")}`,
|
|
57961
57963
|
` ${cyan(t("Qwen OAuth"))} \u2192 ${t("run qwen interactively and use /auth; OAuth cannot be configured with env vars alone")}`,
|
|
57962
57964
|
` ${cyan(t("Scripted"))} \u2192 ${t("edit ~/.qwen/settings.json, or run qwen interactively once")}`,
|
|
57963
57965
|
"",
|
|
@@ -57971,6 +57973,7 @@ var legacySubcommands = [
|
|
|
57971
57973
|
"status",
|
|
57972
57974
|
"coding-plan",
|
|
57973
57975
|
"openrouter",
|
|
57976
|
+
"requesty",
|
|
57974
57977
|
"api-key",
|
|
57975
57978
|
"qwen-oauth"
|
|
57976
57979
|
];
|
|
@@ -58008,15 +58011,15 @@ function gh(...args) {
|
|
|
58008
58011
|
return execFileSync2("gh", args, { encoding: "utf8" }).replace(/\r\n/g, "\n").trim();
|
|
58009
58012
|
}
|
|
58010
58013
|
__name(gh, "gh");
|
|
58011
|
-
function ghApi(
|
|
58012
|
-
const args = ["api",
|
|
58014
|
+
function ghApi(path63, jq) {
|
|
58015
|
+
const args = ["api", path63];
|
|
58013
58016
|
if (jq) args.push("--jq", jq);
|
|
58014
58017
|
const out = gh(...args);
|
|
58015
58018
|
return out ? JSON.parse(out) : null;
|
|
58016
58019
|
}
|
|
58017
58020
|
__name(ghApi, "ghApi");
|
|
58018
|
-
function ghApiAll(
|
|
58019
|
-
const out = gh("api", "--paginate",
|
|
58021
|
+
function ghApiAll(path63) {
|
|
58022
|
+
const out = gh("api", "--paginate", path63);
|
|
58020
58023
|
if (!out) return [];
|
|
58021
58024
|
const parsed = JSON.parse(out);
|
|
58022
58025
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -58405,8 +58408,8 @@ var prContextCommand = {
|
|
|
58405
58408
|
init_esbuild_shims();
|
|
58406
58409
|
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync6 } from "node:fs";
|
|
58407
58410
|
import { dirname as dirname7 } from "node:path";
|
|
58408
|
-
function showFile(baseRef,
|
|
58409
|
-
return gitOpt("show", `${baseRef}:${
|
|
58411
|
+
function showFile(baseRef, path63) {
|
|
58412
|
+
return gitOpt("show", `${baseRef}:${path63}`);
|
|
58410
58413
|
}
|
|
58411
58414
|
__name(showFile, "showFile");
|
|
58412
58415
|
function extractCodeReviewSection(content) {
|
|
@@ -59514,7 +59517,7 @@ var serveCommand = {
|
|
|
59514
59517
|
process.exit(1);
|
|
59515
59518
|
}
|
|
59516
59519
|
}
|
|
59517
|
-
const { runQwenServe } = await import("./chunks/serve-
|
|
59520
|
+
const { runQwenServe } = await import("./chunks/serve-3DM6CRGD.js");
|
|
59518
59521
|
try {
|
|
59519
59522
|
const handle = await runQwenServe({
|
|
59520
59523
|
port: argv.port,
|
|
@@ -64019,6 +64022,11 @@ __name(detectTerminalThemeAsync, "detectTerminalThemeAsync");
|
|
|
64019
64022
|
var debugLogger6 = createDebugLogger("THEME_MANAGER");
|
|
64020
64023
|
var DEFAULT_THEME = QwenDark;
|
|
64021
64024
|
var AUTO_THEME_NAME = "auto";
|
|
64025
|
+
function isPathWithinDirectory(parent, child) {
|
|
64026
|
+
const relativePath = path12.relative(parent, child);
|
|
64027
|
+
return relativePath === "" || !relativePath.startsWith(`..${path12.sep}`) && relativePath !== ".." && !path12.isAbsolute(relativePath);
|
|
64028
|
+
}
|
|
64029
|
+
__name(isPathWithinDirectory, "isPathWithinDirectory");
|
|
64022
64030
|
var ThemeManager = class {
|
|
64023
64031
|
static {
|
|
64024
64032
|
__name(this, "ThemeManager");
|
|
@@ -64243,7 +64251,7 @@ var ThemeManager = class {
|
|
|
64243
64251
|
return this.customThemes.get(canonicalPath);
|
|
64244
64252
|
}
|
|
64245
64253
|
const homeDir = path12.resolve(os8.homedir());
|
|
64246
|
-
if (!
|
|
64254
|
+
if (!isPathWithinDirectory(homeDir, canonicalPath)) {
|
|
64247
64255
|
debugLogger6.warn(
|
|
64248
64256
|
`Theme file at "${themePath}" is outside your home directory. Only load themes from trusted sources.`
|
|
64249
64257
|
);
|
|
@@ -70277,6 +70285,14 @@ function validateExtractedPaths(resolvedDest) {
|
|
|
70277
70285
|
}
|
|
70278
70286
|
}
|
|
70279
70287
|
__name(validateExtractedPaths, "validateExtractedPaths");
|
|
70288
|
+
function isSafeTarEntryPath(entryPath) {
|
|
70289
|
+
if (entryPath.length === 0) return false;
|
|
70290
|
+
if (path18.posix.isAbsolute(entryPath) || path18.win32.isAbsolute(entryPath)) {
|
|
70291
|
+
return false;
|
|
70292
|
+
}
|
|
70293
|
+
return !entryPath.split(/[\\/]+/).includes("..");
|
|
70294
|
+
}
|
|
70295
|
+
__name(isSafeTarEntryPath, "isSafeTarEntryPath");
|
|
70280
70296
|
async function extractArchive(archivePath, destDir, target) {
|
|
70281
70297
|
fs16.mkdirSync(destDir, { recursive: true });
|
|
70282
70298
|
if (target.startsWith("win")) {
|
|
@@ -70305,7 +70321,7 @@ async function extractArchive(archivePath, destDir, target) {
|
|
|
70305
70321
|
cwd: destDir,
|
|
70306
70322
|
preservePaths: false,
|
|
70307
70323
|
filter: /* @__PURE__ */ __name((p, entry) => {
|
|
70308
|
-
if (
|
|
70324
|
+
if (!isSafeTarEntryPath(p)) return false;
|
|
70309
70325
|
if ("type" in entry && entry.type === "SymbolicLink" && "linkpath" in entry) {
|
|
70310
70326
|
const linkTarget = path18.resolve(
|
|
70311
70327
|
resolvedDest,
|
|
@@ -70795,7 +70811,7 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
|
|
|
70795
70811
|
const realPath = fs17.realpathSync(cliPath).replace(/\\/g, "/");
|
|
70796
70812
|
const normalizedProjectRoot = projectRoot?.replace(/\\/g, "/");
|
|
70797
70813
|
const isGit = isGitRepository(process.cwd());
|
|
70798
|
-
if (isGit && normalizedProjectRoot && realPath
|
|
70814
|
+
if (isGit && normalizedProjectRoot && isSamePathOrInside(realPath, normalizedProjectRoot) && !realPath.includes("/node_modules/")) {
|
|
70799
70815
|
return {
|
|
70800
70816
|
packageManager: "unknown" /* UNKNOWN */,
|
|
70801
70817
|
// Not managed by a package manager in this sense
|
|
@@ -70871,7 +70887,7 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
|
|
|
70871
70887
|
updateMessage: isAutoUpdateEnabled ? "Installed with bun. Attempting to automatically update now..." : `Please run ${updateCommand4} to update`
|
|
70872
70888
|
};
|
|
70873
70889
|
}
|
|
70874
|
-
if (normalizedProjectRoot && realPath
|
|
70890
|
+
if (normalizedProjectRoot && isSamePathOrInside(realPath, `${normalizedProjectRoot}/node_modules`)) {
|
|
70875
70891
|
let pm = "npm" /* NPM */;
|
|
70876
70892
|
if (fs17.existsSync(path19.join(projectRoot, "yarn.lock"))) {
|
|
70877
70893
|
pm = "yarn" /* YARN */;
|
|
@@ -70913,6 +70929,19 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
|
|
|
70913
70929
|
}
|
|
70914
70930
|
}
|
|
70915
70931
|
__name(getInstallationInfo, "getInstallationInfo");
|
|
70932
|
+
function stripTrailingSlashes(value) {
|
|
70933
|
+
return value.replace(/\/+$/, "") || "/";
|
|
70934
|
+
}
|
|
70935
|
+
__name(stripTrailingSlashes, "stripTrailingSlashes");
|
|
70936
|
+
function isSamePathOrInside(candidate, parent) {
|
|
70937
|
+
const normalizedCandidate = stripTrailingSlashes(candidate);
|
|
70938
|
+
const normalizedParent = stripTrailingSlashes(parent);
|
|
70939
|
+
if (normalizedParent === "/") {
|
|
70940
|
+
return normalizedCandidate === "/" || normalizedCandidate.startsWith("/");
|
|
70941
|
+
}
|
|
70942
|
+
return normalizedCandidate === normalizedParent || normalizedCandidate.startsWith(`${normalizedParent}/`);
|
|
70943
|
+
}
|
|
70944
|
+
__name(isSamePathOrInside, "isSamePathOrInside");
|
|
70916
70945
|
function getStandaloneInstallInfo(realPath, isAutoUpdateEnabled) {
|
|
70917
70946
|
const installDir = standaloneInstallDirForCliPath(realPath);
|
|
70918
70947
|
if (!installDir || !isStandaloneInstallDir(installDir)) {
|
|
@@ -71329,6 +71358,13 @@ __name(formatCoreDiagnostics, "formatCoreDiagnostics");
|
|
|
71329
71358
|
var CPU_PROFILE_USAGE_HINT = "/doctor cpu-profile [--duration <seconds>]";
|
|
71330
71359
|
var DEFAULT_CPU_PROFILE_DURATION_SEC = 30;
|
|
71331
71360
|
var MAX_CPU_PROFILE_DURATION_SEC = 300;
|
|
71361
|
+
function parseCpuProfileDuration(raw) {
|
|
71362
|
+
if (!raw || !/^\d+$/.test(raw)) {
|
|
71363
|
+
return NaN;
|
|
71364
|
+
}
|
|
71365
|
+
return Number(raw);
|
|
71366
|
+
}
|
|
71367
|
+
__name(parseCpuProfileDuration, "parseCpuProfileDuration");
|
|
71332
71368
|
async function cpuProfileDoctorAction(context, args = "") {
|
|
71333
71369
|
const executionMode = context.executionMode ?? "interactive";
|
|
71334
71370
|
const abortSignal = context.abortSignal;
|
|
@@ -71338,7 +71374,7 @@ async function cpuProfileDoctorAction(context, args = "") {
|
|
|
71338
71374
|
const durationIdx = tokens.indexOf("--duration");
|
|
71339
71375
|
if (durationIdx !== -1) {
|
|
71340
71376
|
const rawVal = tokens[durationIdx + 1];
|
|
71341
|
-
const val =
|
|
71377
|
+
const val = parseCpuProfileDuration(rawVal);
|
|
71342
71378
|
if (!Number.isFinite(val) || val < 1 || val > MAX_CPU_PROFILE_DURATION_SEC) {
|
|
71343
71379
|
const errorMsg = `${t("Duration must be between 1 and {max} seconds", { max: String(MAX_CPU_PROFILE_DURATION_SEC) })}. ${t("Usage")}: ${CPU_PROFILE_USAGE_HINT}`;
|
|
71344
71380
|
if (executionMode === "interactive") {
|
|
@@ -72710,7 +72746,7 @@ async function extractMetadata(conversation, config) {
|
|
|
72710
72746
|
const gitBranch = firstRecord?.gitBranch;
|
|
72711
72747
|
let gitRepo;
|
|
72712
72748
|
if (cwd5) {
|
|
72713
|
-
const { getGitRepoName } = await import("./chunks/src-
|
|
72749
|
+
const { getGitRepoName } = await import("./chunks/src-5YMCDSII.js");
|
|
72714
72750
|
gitRepo = getGitRepoName(cwd5);
|
|
72715
72751
|
}
|
|
72716
72752
|
let model;
|
|
@@ -73304,10 +73340,10 @@ function formatToolCall(message) {
|
|
|
73304
73340
|
lines.push(createCodeBlock(contentData.text, language));
|
|
73305
73341
|
}
|
|
73306
73342
|
} else if (item.type === "diff") {
|
|
73307
|
-
const
|
|
73343
|
+
const path63 = item["path"];
|
|
73308
73344
|
const diffText = item["newText"];
|
|
73309
73345
|
lines.push(`
|
|
73310
|
-
*Diff for \`${sanitizeText(
|
|
73346
|
+
*Diff for \`${sanitizeText(path63)}\`:*`);
|
|
73311
73347
|
lines.push(createCodeBlock(diffText, "diff"));
|
|
73312
73348
|
}
|
|
73313
73349
|
}
|
|
@@ -73344,8 +73380,8 @@ function buildFence(value) {
|
|
|
73344
73380
|
return "`".repeat(fenceLength);
|
|
73345
73381
|
}
|
|
73346
73382
|
__name(buildFence, "buildFence");
|
|
73347
|
-
function getLanguageFromPath(
|
|
73348
|
-
const ext =
|
|
73383
|
+
function getLanguageFromPath(path63) {
|
|
73384
|
+
const ext = path63.split(".").pop()?.toLowerCase();
|
|
73349
73385
|
switch (ext) {
|
|
73350
73386
|
case "ts":
|
|
73351
73387
|
case "tsx":
|
|
@@ -76940,8 +76976,8 @@ __name(parseAcpModelOption, "parseAcpModelOption");
|
|
|
76940
76976
|
// packages/cli/src/ui/commands/modelCommand.ts
|
|
76941
76977
|
var MAIN_MODEL_CONFIGURATION_HINT = "Configure models in settings.modelProviders and ensure the required environment variables are set. In interactive mode, run /auth to configure or switch providers, or run /model without arguments to choose from configured models.";
|
|
76942
76978
|
var FAST_MODEL_CONFIGURATION_HINT = "Configure models in settings.modelProviders and ensure the required environment variables are set. In interactive mode, run /auth to configure or switch providers, or run /model --fast without a model to choose from configured models.";
|
|
76943
|
-
function persistSetting(settings,
|
|
76944
|
-
settings.setValue(getPersistScopeForModelSelection(settings),
|
|
76979
|
+
function persistSetting(settings, path63, value) {
|
|
76980
|
+
settings.setValue(getPersistScopeForModelSelection(settings), path63, value);
|
|
76945
76981
|
}
|
|
76946
76982
|
__name(persistSetting, "persistSetting");
|
|
76947
76983
|
async function switchMainModel(config, settings, currentAuthType, modelArg) {
|
|
@@ -82632,32 +82668,10 @@ async function fireUserPromptExpansionHook(config, commandName, commandArgs, con
|
|
|
82632
82668
|
};
|
|
82633
82669
|
}
|
|
82634
82670
|
__name(fireUserPromptExpansionHook, "fireUserPromptExpansionHook");
|
|
82635
|
-
|
|
82636
|
-
|
|
82637
|
-
|
|
82638
|
-
return { type: "no_command" };
|
|
82639
|
-
}
|
|
82640
|
-
const isAcpMode = config.getExperimentalZedIntegration();
|
|
82641
|
-
const isInteractive = config.isInteractive();
|
|
82642
|
-
const executionMode = isAcpMode ? "acp" : isInteractive ? "interactive" : "non_interactive";
|
|
82643
|
-
const allLoaders = [
|
|
82644
|
-
new McpPromptLoader(config),
|
|
82645
|
-
new BuiltinCommandLoader(config),
|
|
82646
|
-
new BundledSkillLoader(config),
|
|
82647
|
-
new SkillCommandLoader(config),
|
|
82648
|
-
new FileCommandLoader(config)
|
|
82649
|
-
];
|
|
82650
|
-
const disabledSlashCommandsRaw = config.getDisabledSlashCommands();
|
|
82651
|
-
const disabledNameSet = /* @__PURE__ */ new Set();
|
|
82652
|
-
for (const name of disabledSlashCommandsRaw) {
|
|
82653
|
-
const trimmed2 = name.trim();
|
|
82654
|
-
if (trimmed2) disabledNameSet.add(trimmed2.toLowerCase());
|
|
82671
|
+
async function registerModelInvocableCommands(commandService, config, executionMode, settings) {
|
|
82672
|
+
if (!settings) {
|
|
82673
|
+
return;
|
|
82655
82674
|
}
|
|
82656
|
-
const isDisabled = /* @__PURE__ */ __name((cmd) => disabledNameSet.has(cmd.name.toLowerCase()) || (cmd.altNames ?? []).some((a) => disabledNameSet.has(a.toLowerCase())), "isDisabled");
|
|
82657
|
-
const commandService = await CommandService.create(
|
|
82658
|
-
allLoaders,
|
|
82659
|
-
abortController.signal
|
|
82660
|
-
);
|
|
82661
82675
|
config.setModelInvocableCommandsProvider(
|
|
82662
82676
|
() => commandService.getModelInvocableCommands().map((cmd) => ({
|
|
82663
82677
|
name: cmd.name,
|
|
@@ -82665,27 +82679,28 @@ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController
|
|
|
82665
82679
|
}))
|
|
82666
82680
|
);
|
|
82667
82681
|
config.setModelInvocableCommandsExecutor(
|
|
82668
|
-
async (name,
|
|
82682
|
+
async (name, args = "") => {
|
|
82669
82683
|
const commands = commandService.getModelInvocableCommands();
|
|
82670
82684
|
const cmd = commands.find((c) => c.name === name);
|
|
82671
82685
|
if (!cmd?.action) return null;
|
|
82672
82686
|
const minimalContext = {
|
|
82673
82687
|
executionMode,
|
|
82674
82688
|
invocation: {
|
|
82675
|
-
raw:
|
|
82689
|
+
raw: args ? `/${name} ${args}` : `/${name}`,
|
|
82676
82690
|
name,
|
|
82677
|
-
args
|
|
82691
|
+
args
|
|
82678
82692
|
},
|
|
82679
82693
|
services: { config, settings, logger: null }
|
|
82680
82694
|
};
|
|
82681
|
-
const
|
|
82682
|
-
if (!
|
|
82695
|
+
const result = await cmd.action(minimalContext, args);
|
|
82696
|
+
if (!result || result.type !== "submit_prompt") return null;
|
|
82697
|
+
const hookSignal = new AbortController().signal;
|
|
82683
82698
|
const hookResult = await fireUserPromptExpansionHook(
|
|
82684
82699
|
config,
|
|
82685
82700
|
name,
|
|
82686
|
-
|
|
82687
|
-
|
|
82688
|
-
|
|
82701
|
+
args,
|
|
82702
|
+
result.content,
|
|
82703
|
+
hookSignal
|
|
82689
82704
|
);
|
|
82690
82705
|
if (hookResult.blockedResult) {
|
|
82691
82706
|
return hookResult.blockedResult.type === "message" ? { error: hookResult.blockedResult.content } : null;
|
|
@@ -82700,7 +82715,48 @@ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController
|
|
|
82700
82715
|
return null;
|
|
82701
82716
|
}
|
|
82702
82717
|
);
|
|
82703
|
-
const
|
|
82718
|
+
const skillManager = typeof config.getSkillManager === "function" ? config.getSkillManager() : null;
|
|
82719
|
+
await skillManager?.notifyConfigChanged();
|
|
82720
|
+
}
|
|
82721
|
+
__name(registerModelInvocableCommands, "registerModelInvocableCommands");
|
|
82722
|
+
var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController, config, settings) => {
|
|
82723
|
+
const trimmed = rawQuery.trim();
|
|
82724
|
+
if (!trimmed.startsWith("/")) {
|
|
82725
|
+
return { type: "no_command" };
|
|
82726
|
+
}
|
|
82727
|
+
const isAcpMode = config.getExperimentalZedIntegration();
|
|
82728
|
+
const isInteractive = config.isInteractive();
|
|
82729
|
+
const executionMode = isAcpMode ? "acp" : isInteractive ? "interactive" : "non_interactive";
|
|
82730
|
+
const allLoaders = [
|
|
82731
|
+
new McpPromptLoader(config),
|
|
82732
|
+
new BuiltinCommandLoader(config),
|
|
82733
|
+
new BundledSkillLoader(config),
|
|
82734
|
+
new SkillCommandLoader(config),
|
|
82735
|
+
new FileCommandLoader(config)
|
|
82736
|
+
];
|
|
82737
|
+
const disabledSlashCommandsRaw = config.getDisabledSlashCommands();
|
|
82738
|
+
const disabledNameSet = /* @__PURE__ */ new Set();
|
|
82739
|
+
for (const name of disabledSlashCommandsRaw) {
|
|
82740
|
+
const trimmed2 = name.trim();
|
|
82741
|
+
if (trimmed2) disabledNameSet.add(trimmed2.toLowerCase());
|
|
82742
|
+
}
|
|
82743
|
+
const isDisabled = /* @__PURE__ */ __name((cmd) => disabledNameSet.has(cmd.name.toLowerCase()) || (cmd.altNames ?? []).some((a) => disabledNameSet.has(a.toLowerCase())), "isDisabled");
|
|
82744
|
+
const allCommandService = await CommandService.create(
|
|
82745
|
+
allLoaders,
|
|
82746
|
+
abortController.signal
|
|
82747
|
+
);
|
|
82748
|
+
const commandService = disabledNameSet.size > 0 ? await CommandService.create(
|
|
82749
|
+
allLoaders,
|
|
82750
|
+
abortController.signal,
|
|
82751
|
+
disabledNameSet
|
|
82752
|
+
) : allCommandService;
|
|
82753
|
+
await registerModelInvocableCommands(
|
|
82754
|
+
commandService,
|
|
82755
|
+
config,
|
|
82756
|
+
executionMode,
|
|
82757
|
+
settings
|
|
82758
|
+
);
|
|
82759
|
+
const allCommands = allCommandService.getCommands();
|
|
82704
82760
|
const filteredCommands = commandService.getCommandsForMode(executionMode).filter((cmd) => !isDisabled(cmd));
|
|
82705
82761
|
const { commandToExecute, args } = parseSlashCommand(
|
|
82706
82762
|
rawQuery,
|
|
@@ -82794,7 +82850,7 @@ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController
|
|
|
82794
82850
|
}
|
|
82795
82851
|
return handleCommandResult(result, outputHistoryItems);
|
|
82796
82852
|
}, "handleSlashCommand");
|
|
82797
|
-
var getAvailableCommands = /* @__PURE__ */ __name(async (config, abortSignal, mode = "acp") => {
|
|
82853
|
+
var getAvailableCommands = /* @__PURE__ */ __name(async (config, abortSignal, mode = "acp", settings) => {
|
|
82798
82854
|
try {
|
|
82799
82855
|
const loaders = [
|
|
82800
82856
|
new McpPromptLoader(config),
|
|
@@ -82809,6 +82865,12 @@ var getAvailableCommands = /* @__PURE__ */ __name(async (config, abortSignal, mo
|
|
|
82809
82865
|
abortSignal,
|
|
82810
82866
|
disabledSlashCommands.length > 0 ? new Set(disabledSlashCommands) : void 0
|
|
82811
82867
|
);
|
|
82868
|
+
await registerModelInvocableCommands(
|
|
82869
|
+
commandService,
|
|
82870
|
+
config,
|
|
82871
|
+
mode,
|
|
82872
|
+
settings
|
|
82873
|
+
);
|
|
82812
82874
|
return commandService.getCommandsForMode(mode);
|
|
82813
82875
|
} catch (error) {
|
|
82814
82876
|
debugLogger28.error("Error loading available commands:", error);
|
|
@@ -84302,6 +84364,24 @@ var StreamJsonOutputAdapter = class extends BaseJsonOutputAdapter {
|
|
|
84302
84364
|
init_esbuild_shims();
|
|
84303
84365
|
import * as fs28 from "node:fs/promises";
|
|
84304
84366
|
import * as path35 from "node:path";
|
|
84367
|
+
|
|
84368
|
+
// packages/cli/src/ui/hooks/mcpResourceRef.ts
|
|
84369
|
+
init_esbuild_shims();
|
|
84370
|
+
function matchMcpServerPrefix(input, serverNames) {
|
|
84371
|
+
let serverName = null;
|
|
84372
|
+
for (const name of serverNames) {
|
|
84373
|
+
if (input.startsWith(`${name}:`) && (serverName === null || name.length > serverName.length)) {
|
|
84374
|
+
serverName = name;
|
|
84375
|
+
}
|
|
84376
|
+
}
|
|
84377
|
+
if (serverName === null) return null;
|
|
84378
|
+
return { serverName, rest: input.slice(serverName.length + 1) };
|
|
84379
|
+
}
|
|
84380
|
+
__name(matchMcpServerPrefix, "matchMcpServerPrefix");
|
|
84381
|
+
|
|
84382
|
+
// packages/cli/src/ui/hooks/atCommandProcessor.ts
|
|
84383
|
+
var MAX_MCP_RESOURCE_TEXT_CHARS = 1e5;
|
|
84384
|
+
var MAX_MCP_RESOURCE_BLOB_CHARS = 8e6;
|
|
84305
84385
|
function parseAllAtCommands(query) {
|
|
84306
84386
|
const parts = [];
|
|
84307
84387
|
let currentIndex = 0;
|
|
@@ -84355,6 +84435,12 @@ function parseAllAtCommands(query) {
|
|
|
84355
84435
|
);
|
|
84356
84436
|
}
|
|
84357
84437
|
__name(parseAllAtCommands, "parseAllAtCommands");
|
|
84438
|
+
function parseMcpResourceRef(pathName, mcpServerNames) {
|
|
84439
|
+
const match = matchMcpServerPrefix(pathName, mcpServerNames);
|
|
84440
|
+
if (!match || !match.rest) return null;
|
|
84441
|
+
return { serverName: match.serverName, uri: match.rest };
|
|
84442
|
+
}
|
|
84443
|
+
__name(parseMcpResourceRef, "parseMcpResourceRef");
|
|
84358
84444
|
async function resolveAtCommandQuery({
|
|
84359
84445
|
query,
|
|
84360
84446
|
config,
|
|
@@ -84379,6 +84465,8 @@ async function resolveAtCommandQuery({
|
|
|
84379
84465
|
qwen: [],
|
|
84380
84466
|
both: []
|
|
84381
84467
|
};
|
|
84468
|
+
const mcpServerNames = new Set(Object.keys(config.getMcpServers() || {}));
|
|
84469
|
+
const mcpResourceRefs = [];
|
|
84382
84470
|
for (const atPathPart of atPathCommandParts) {
|
|
84383
84471
|
const originalAtPath = atPathPart.content;
|
|
84384
84472
|
if (originalAtPath === "@") {
|
|
@@ -84388,10 +84476,16 @@ async function resolveAtCommandQuery({
|
|
|
84388
84476
|
continue;
|
|
84389
84477
|
}
|
|
84390
84478
|
const pathName = originalAtPath.substring(1);
|
|
84479
|
+
const resourceRef = parseMcpResourceRef(pathName, mcpServerNames);
|
|
84480
|
+
if (resourceRef) {
|
|
84481
|
+
mcpResourceRefs.push({ originalAtPath, ...resourceRef });
|
|
84482
|
+
atPathToResolvedSpecMap.set(originalAtPath, pathName);
|
|
84483
|
+
continue;
|
|
84484
|
+
}
|
|
84391
84485
|
const workspaceContext = config.getWorkspaceContext();
|
|
84392
84486
|
const projectTempDir = Storage.getGlobalTempDir();
|
|
84393
84487
|
const absolutePathName = path35.isAbsolute(pathName) ? pathName : path35.resolve(workspaceContext.getDirectories()[0] || "", pathName);
|
|
84394
|
-
if (!
|
|
84488
|
+
if (!isSubpath(projectTempDir, absolutePathName) && !workspaceContext.isPathWithinWorkspace(pathName)) {
|
|
84395
84489
|
onDebugMessage(
|
|
84396
84490
|
`Path ${pathName} is not in the workspace and will be skipped.`
|
|
84397
84491
|
);
|
|
@@ -84489,7 +84583,97 @@ async function resolveAtCommandQuery({
|
|
|
84489
84583
|
${messages.join("\n")}`;
|
|
84490
84584
|
onDebugMessage(message);
|
|
84491
84585
|
}
|
|
84492
|
-
|
|
84586
|
+
const resourceReads = await Promise.allSettled(
|
|
84587
|
+
mcpResourceRefs.map(
|
|
84588
|
+
(ref) => config.getToolRegistry().readMcpResource(ref.serverName, ref.uri, { signal })
|
|
84589
|
+
)
|
|
84590
|
+
);
|
|
84591
|
+
const resourceParts = [];
|
|
84592
|
+
const resourceDisplays = [];
|
|
84593
|
+
const resourceLabels = [];
|
|
84594
|
+
for (let i = 0; i < mcpResourceRefs.length; i++) {
|
|
84595
|
+
const ref = mcpResourceRefs[i];
|
|
84596
|
+
const label = `${ref.serverName}:${ref.uri}`;
|
|
84597
|
+
const callId = `client-mcp-resource-${userMessageTimestamp}-${i}`;
|
|
84598
|
+
const outcome = resourceReads[i];
|
|
84599
|
+
if (outcome.status === "rejected") {
|
|
84600
|
+
onDebugMessage(
|
|
84601
|
+
`Failed to read MCP resource ${label}: ${getErrorMessage(outcome.reason)}`
|
|
84602
|
+
);
|
|
84603
|
+
resourceDisplays.push({
|
|
84604
|
+
callId,
|
|
84605
|
+
name: "Read MCP Resource",
|
|
84606
|
+
description: `Read resource ${label}`,
|
|
84607
|
+
status: "Error" /* Error */,
|
|
84608
|
+
resultDisplay: `Failed to read resource ${label}: ${getErrorMessage(outcome.reason)}`,
|
|
84609
|
+
confirmationDetails: void 0
|
|
84610
|
+
});
|
|
84611
|
+
continue;
|
|
84612
|
+
}
|
|
84613
|
+
const contentParts = [];
|
|
84614
|
+
let textChars = 0;
|
|
84615
|
+
let blobChars = 0;
|
|
84616
|
+
let blobCount = 0;
|
|
84617
|
+
let truncated = false;
|
|
84618
|
+
for (const content of outcome.value.contents ?? []) {
|
|
84619
|
+
if ("text" in content && typeof content.text === "string") {
|
|
84620
|
+
const remaining = MAX_MCP_RESOURCE_TEXT_CHARS - textChars;
|
|
84621
|
+
if (remaining <= 0) {
|
|
84622
|
+
truncated = content.text.length > 0 || truncated;
|
|
84623
|
+
continue;
|
|
84624
|
+
}
|
|
84625
|
+
const text = content.text.length > remaining ? content.text.slice(0, remaining) : content.text;
|
|
84626
|
+
if (text.length < content.text.length) {
|
|
84627
|
+
truncated = true;
|
|
84628
|
+
}
|
|
84629
|
+
if (text.length > 0) {
|
|
84630
|
+
contentParts.push({ text });
|
|
84631
|
+
textChars += text.length;
|
|
84632
|
+
}
|
|
84633
|
+
} else if ("blob" in content && typeof content.blob === "string") {
|
|
84634
|
+
if (blobChars + content.blob.length > MAX_MCP_RESOURCE_BLOB_CHARS) {
|
|
84635
|
+
truncated = true;
|
|
84636
|
+
continue;
|
|
84637
|
+
}
|
|
84638
|
+
blobChars += content.blob.length;
|
|
84639
|
+
contentParts.push({
|
|
84640
|
+
inlineData: {
|
|
84641
|
+
mimeType: typeof content.mimeType === "string" ? content.mimeType : "application/octet-stream",
|
|
84642
|
+
data: content.blob
|
|
84643
|
+
}
|
|
84644
|
+
});
|
|
84645
|
+
blobCount += 1;
|
|
84646
|
+
}
|
|
84647
|
+
}
|
|
84648
|
+
if (contentParts.length > 0) {
|
|
84649
|
+
resourceParts.push({
|
|
84650
|
+
text: `
|
|
84651
|
+
--- Content from MCP resource ${label} ---
|
|
84652
|
+
`
|
|
84653
|
+
});
|
|
84654
|
+
resourceParts.push(...contentParts);
|
|
84655
|
+
resourceParts.push({ text: `
|
|
84656
|
+
--- End of MCP resource ${label} ---
|
|
84657
|
+
` });
|
|
84658
|
+
}
|
|
84659
|
+
resourceLabels.push(label);
|
|
84660
|
+
const summary = [];
|
|
84661
|
+
if (textChars > 0) {
|
|
84662
|
+
summary.push(`${textChars} chars`);
|
|
84663
|
+
}
|
|
84664
|
+
if (blobCount > 0) {
|
|
84665
|
+
summary.push(`${blobCount} attachment${blobCount === 1 ? "" : "s"}`);
|
|
84666
|
+
}
|
|
84667
|
+
resourceDisplays.push({
|
|
84668
|
+
callId,
|
|
84669
|
+
name: "Read MCP Resource",
|
|
84670
|
+
description: `Read resource ${label}`,
|
|
84671
|
+
status: "Success" /* Success */,
|
|
84672
|
+
resultDisplay: summary.length > 0 ? `Injected ${summary.join(" + ")}${truncated ? " (truncated)" : ""}` : truncated ? "(content too large \u2014 skipped)" : "(no readable content)",
|
|
84673
|
+
confirmationDetails: void 0
|
|
84674
|
+
});
|
|
84675
|
+
}
|
|
84676
|
+
if (pathSpecsToRead.length === 0 && mcpResourceRefs.length === 0) {
|
|
84493
84677
|
onDebugMessage("No valid file paths found in @ commands to read.");
|
|
84494
84678
|
if (initialQueryText === "@" && query.trim() === "@") {
|
|
84495
84679
|
return { processedQuery: [{ text: query }], shouldProceed: true };
|
|
@@ -84501,69 +84685,70 @@ ${messages.join("\n")}`;
|
|
|
84501
84685
|
shouldProceed: true
|
|
84502
84686
|
};
|
|
84503
84687
|
}
|
|
84504
|
-
|
|
84505
|
-
|
|
84506
|
-
|
|
84507
|
-
|
|
84508
|
-
|
|
84509
|
-
|
|
84510
|
-
|
|
84511
|
-
|
|
84688
|
+
const fileParts = [];
|
|
84689
|
+
let fileDisplays = [];
|
|
84690
|
+
if (pathSpecsToRead.length > 0) {
|
|
84691
|
+
try {
|
|
84692
|
+
const result = await readManyFiles(config, {
|
|
84693
|
+
paths: pathSpecsToRead,
|
|
84694
|
+
signal
|
|
84695
|
+
});
|
|
84696
|
+
const parts = Array.isArray(result.contentParts) ? result.contentParts : [result.contentParts];
|
|
84697
|
+
fileDisplays = result.files.map((file, index) => ({
|
|
84512
84698
|
callId: `client-read-${userMessageTimestamp}-${index}`,
|
|
84513
84699
|
name: file.isDirectory ? "Read Directory" : "Read File",
|
|
84514
84700
|
description: file.isDirectory ? `Read directory ${path35.basename(file.filePath)}` : `Read file ${path35.basename(file.filePath)}`,
|
|
84515
84701
|
status: file.error ? "Error" /* Error */ : "Success" /* Success */,
|
|
84516
84702
|
resultDisplay: file.error ? `Failed to read ${path35.basename(file.filePath)}: ${file.error}` : void 0,
|
|
84517
84703
|
confirmationDetails: void 0
|
|
84518
|
-
})
|
|
84519
|
-
|
|
84520
|
-
|
|
84521
|
-
|
|
84522
|
-
for (const part of parts) {
|
|
84523
|
-
if (typeof part === "string") {
|
|
84524
|
-
processedQueryParts.push({ text: part });
|
|
84525
|
-
} else {
|
|
84526
|
-
processedQueryParts.push(part);
|
|
84704
|
+
}));
|
|
84705
|
+
if (parts.length > 0 && !result.error) {
|
|
84706
|
+
for (const part of parts) {
|
|
84707
|
+
fileParts.push(typeof part === "string" ? { text: part } : part);
|
|
84527
84708
|
}
|
|
84709
|
+
} else {
|
|
84710
|
+
onDebugMessage("readManyFiles returned no content or empty content.");
|
|
84528
84711
|
}
|
|
84529
|
-
}
|
|
84530
|
-
|
|
84712
|
+
} catch (error) {
|
|
84713
|
+
const errorToolCallDisplay = {
|
|
84714
|
+
callId: `client-read-${userMessageTimestamp}`,
|
|
84715
|
+
name: "Read File(s)",
|
|
84716
|
+
description: "Error attempting to read files",
|
|
84717
|
+
status: "Error" /* Error */,
|
|
84718
|
+
resultDisplay: `Error reading files (${contentLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
84719
|
+
confirmationDetails: void 0
|
|
84720
|
+
};
|
|
84721
|
+
const errorMessage2 = typeof errorToolCallDisplay.resultDisplay === "string" ? errorToolCallDisplay.resultDisplay : void 0;
|
|
84722
|
+
const labelsOnError = [...contentLabelsForDisplay, ...resourceLabels];
|
|
84723
|
+
return {
|
|
84724
|
+
processedQuery: null,
|
|
84725
|
+
shouldProceed: false,
|
|
84726
|
+
toolDisplays: [...resourceDisplays, errorToolCallDisplay],
|
|
84727
|
+
filesRead: labelsOnError,
|
|
84728
|
+
recording: {
|
|
84729
|
+
filesRead: labelsOnError,
|
|
84730
|
+
status: "error",
|
|
84731
|
+
message: errorMessage2
|
|
84732
|
+
}
|
|
84733
|
+
};
|
|
84531
84734
|
}
|
|
84532
|
-
const processedResult = {
|
|
84533
|
-
processedQuery: processedQueryParts,
|
|
84534
|
-
shouldProceed: true,
|
|
84535
|
-
toolDisplays: toolCallDisplays,
|
|
84536
|
-
filesRead: contentLabelsForDisplay
|
|
84537
|
-
};
|
|
84538
|
-
return {
|
|
84539
|
-
...processedResult,
|
|
84540
|
-
recording: {
|
|
84541
|
-
filesRead: contentLabelsForDisplay,
|
|
84542
|
-
status: "success"
|
|
84543
|
-
}
|
|
84544
|
-
};
|
|
84545
|
-
} catch (error) {
|
|
84546
|
-
const errorToolCallDisplay = {
|
|
84547
|
-
callId: `client-read-${userMessageTimestamp}`,
|
|
84548
|
-
name: "Read File(s)",
|
|
84549
|
-
description: "Error attempting to read files",
|
|
84550
|
-
status: "Error" /* Error */,
|
|
84551
|
-
resultDisplay: `Error reading files (${contentLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
84552
|
-
confirmationDetails: void 0
|
|
84553
|
-
};
|
|
84554
|
-
const errorMessage2 = typeof errorToolCallDisplay.resultDisplay === "string" ? errorToolCallDisplay.resultDisplay : void 0;
|
|
84555
|
-
return {
|
|
84556
|
-
processedQuery: null,
|
|
84557
|
-
shouldProceed: false,
|
|
84558
|
-
toolDisplays: [errorToolCallDisplay],
|
|
84559
|
-
filesRead: contentLabelsForDisplay,
|
|
84560
|
-
recording: {
|
|
84561
|
-
filesRead: contentLabelsForDisplay,
|
|
84562
|
-
status: "error",
|
|
84563
|
-
message: errorMessage2
|
|
84564
|
-
}
|
|
84565
|
-
};
|
|
84566
84735
|
}
|
|
84736
|
+
const processedQueryParts = [
|
|
84737
|
+
{ text: initialQueryText },
|
|
84738
|
+
...fileParts,
|
|
84739
|
+
...resourceParts
|
|
84740
|
+
];
|
|
84741
|
+
const allLabels = [...contentLabelsForDisplay, ...resourceLabels];
|
|
84742
|
+
return {
|
|
84743
|
+
processedQuery: processedQueryParts,
|
|
84744
|
+
shouldProceed: true,
|
|
84745
|
+
toolDisplays: [...fileDisplays, ...resourceDisplays],
|
|
84746
|
+
filesRead: allLabels,
|
|
84747
|
+
recording: {
|
|
84748
|
+
filesRead: allLabels,
|
|
84749
|
+
status: "success"
|
|
84750
|
+
}
|
|
84751
|
+
};
|
|
84567
84752
|
}
|
|
84568
84753
|
__name(resolveAtCommandQuery, "resolveAtCommandQuery");
|
|
84569
84754
|
async function handleAtCommand(params) {
|
|
@@ -85999,7 +86184,7 @@ var SystemController = class extends BaseController {
|
|
|
85999
86184
|
throw new Error("Request aborted");
|
|
86000
86185
|
}
|
|
86001
86186
|
try {
|
|
86002
|
-
const mod = await import("./chunks/contextCommand-
|
|
86187
|
+
const mod = await import("./chunks/contextCommand-3327KUC4.js");
|
|
86003
86188
|
if (signal.aborted) {
|
|
86004
86189
|
throw new Error("Request aborted");
|
|
86005
86190
|
}
|
|
@@ -90925,6 +91110,13 @@ function isSafeOscScheme(url) {
|
|
|
90925
91110
|
return SAFE_OSC8_SCHEMES.has(match[1].toLowerCase());
|
|
90926
91111
|
}
|
|
90927
91112
|
__name(isSafeOscScheme, "isSafeOscScheme");
|
|
91113
|
+
function shouldForceHyperlinks(value) {
|
|
91114
|
+
if (value.length === 0) return true;
|
|
91115
|
+
const trimmed = value.trim();
|
|
91116
|
+
if (!/^[+-]?\d+$/.test(trimmed)) return false;
|
|
91117
|
+
return Number(trimmed) !== 0;
|
|
91118
|
+
}
|
|
91119
|
+
__name(shouldForceHyperlinks, "shouldForceHyperlinks");
|
|
90928
91120
|
function parseVersion(versionString) {
|
|
90929
91121
|
if (!versionString) return { major: 0, minor: 0, patch: 0 };
|
|
90930
91122
|
if (/^\d{3,4}$/.test(versionString)) {
|
|
@@ -90945,8 +91137,7 @@ function supportsHyperlinks(stream = process.stdout) {
|
|
|
90945
91137
|
if (!stream || !stream.isTTY) return false;
|
|
90946
91138
|
const force = env5["FORCE_HYPERLINK"];
|
|
90947
91139
|
if (force !== void 0) {
|
|
90948
|
-
|
|
90949
|
-
return parseInt(force, 10) !== 0;
|
|
91140
|
+
return shouldForceHyperlinks(force);
|
|
90950
91141
|
}
|
|
90951
91142
|
if (env5["CI"]) return false;
|
|
90952
91143
|
if (env5["TEAMCITY_VERSION"]) return false;
|
|
@@ -107433,8 +107624,8 @@ function SettingsDialog({
|
|
|
107433
107624
|
}
|
|
107434
107625
|
} else if (item.type === "number" || item.type === "string") {
|
|
107435
107626
|
const isSubDialogSetting = item.value === "ui.theme" || item.value === "general.preferredEditor" || item.value === "fastModel";
|
|
107436
|
-
const
|
|
107437
|
-
const currentValue = getNestedValue(pendingSettings,
|
|
107627
|
+
const path63 = item.value.split(".");
|
|
107628
|
+
const currentValue = getNestedValue(pendingSettings, path63);
|
|
107438
107629
|
const defaultValue2 = getDefaultValue(item.value);
|
|
107439
107630
|
if (currentValue !== void 0 && currentValue !== null) {
|
|
107440
107631
|
displayValue = String(currentValue);
|
|
@@ -111005,11 +111196,11 @@ function buildModelSelectionKey(authType, modelId, baseUrl) {
|
|
|
111005
111196
|
}
|
|
111006
111197
|
__name(buildModelSelectionKey, "buildModelSelectionKey");
|
|
111007
111198
|
function parseModelSelectionKey(key) {
|
|
111008
|
-
const
|
|
111009
|
-
const idx = key.indexOf(
|
|
111199
|
+
const sep6 = "::";
|
|
111200
|
+
const idx = key.indexOf(sep6);
|
|
111010
111201
|
if (idx < 0) return { authType: "", modelId: key };
|
|
111011
111202
|
const authType = key.slice(0, idx);
|
|
111012
|
-
const rest = key.slice(idx +
|
|
111203
|
+
const rest = key.slice(idx + sep6.length);
|
|
111013
111204
|
const nullIdx = rest.indexOf("\0");
|
|
111014
111205
|
if (nullIdx >= 0) {
|
|
111015
111206
|
return {
|
|
@@ -116307,6 +116498,14 @@ var ServerDetailStep = /* @__PURE__ */ __name(({
|
|
|
116307
116498
|
] })
|
|
116308
116499
|
] }) })
|
|
116309
116500
|
] }),
|
|
116501
|
+
!server.isDisabled && server.promptCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
116502
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { width: LABEL_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, children: t("Prompts:") }) }),
|
|
116503
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { children: server.promptCount }) })
|
|
116504
|
+
] }),
|
|
116505
|
+
!server.isDisabled && server.resourceCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
116506
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { width: LABEL_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, children: t("Resources:") }) }),
|
|
116507
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { children: server.resourceCount }) })
|
|
116508
|
+
] }),
|
|
116310
116509
|
server.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
116311
116510
|
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { width: LABEL_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.status.error, children: t("Error:") }) }),
|
|
116312
116511
|
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.status.error, wrap: "wrap", children: server.errorMessage }) })
|
|
@@ -116727,6 +116926,7 @@ var McpServerActionsView = /* @__PURE__ */ __name(({
|
|
|
116727
116926
|
const serverPrompts = (promptRegistry?.getAllPrompts() || []).filter(
|
|
116728
116927
|
(p) => "serverName" in p && p.serverName === serverName
|
|
116729
116928
|
);
|
|
116929
|
+
const serverResources = config.getResourceRegistry()?.getResourcesByServer(serverName) || [];
|
|
116730
116930
|
let source = "user";
|
|
116731
116931
|
if (serverConfig.extensionName) {
|
|
116732
116932
|
source = "extension";
|
|
@@ -116752,6 +116952,7 @@ var McpServerActionsView = /* @__PURE__ */ __name(({
|
|
|
116752
116952
|
toolCount: serverTools.length,
|
|
116753
116953
|
invalidToolCount: serverTools.filter((x) => !x.name || !x.description).length,
|
|
116754
116954
|
promptCount: serverPrompts.length,
|
|
116955
|
+
resourceCount: serverResources.length,
|
|
116755
116956
|
isDisabled: config.isMcpServerDisabled(serverName),
|
|
116756
116957
|
hasOAuthTokens,
|
|
116757
116958
|
// Needs (re-)authentication: a 401 during connect, or OAuth declared
|
|
@@ -118853,6 +119054,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
|
|
|
118853
119054
|
const mcpServers = config.getMcpServers() || {};
|
|
118854
119055
|
const toolRegistry = config.getToolRegistry();
|
|
118855
119056
|
const promptRegistry = config.getPromptRegistry();
|
|
119057
|
+
const resourceRegistry = config.getResourceRegistry();
|
|
118856
119058
|
const serverInfos = [];
|
|
118857
119059
|
for (const [name, serverConfig] of Object.entries(mcpServers)) {
|
|
118858
119060
|
const status = getMCPServerStatus(name);
|
|
@@ -118864,6 +119066,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
|
|
|
118864
119066
|
const serverPrompts = allPrompts.filter(
|
|
118865
119067
|
(p) => "serverName" in p && p.serverName === name
|
|
118866
119068
|
);
|
|
119069
|
+
const serverResources = resourceRegistry?.getResourcesByServer(name) || [];
|
|
118867
119070
|
let source = "user";
|
|
118868
119071
|
if (serverConfig.extensionName) {
|
|
118869
119072
|
source = "extension";
|
|
@@ -118894,6 +119097,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
|
|
|
118894
119097
|
toolCount: serverTools.length,
|
|
118895
119098
|
invalidToolCount,
|
|
118896
119099
|
promptCount: serverPrompts.length,
|
|
119100
|
+
resourceCount: serverResources.length,
|
|
118897
119101
|
isDisabled,
|
|
118898
119102
|
hasOAuthTokens,
|
|
118899
119103
|
requiresAuth
|
|
@@ -123438,7 +123642,7 @@ function FileRow({
|
|
|
123438
123642
|
}) {
|
|
123439
123643
|
const pointer = selected ? "\u203A " : " ";
|
|
123440
123644
|
const tag = file.isDeleted ? t(" (deleted)") : file.isUntracked ? t(" (untracked)") : file.oversized ? t(" (oversized \u2014 diff omitted)") : file.isNewFile ? t(" (new)") : file.truncated ? t(" (truncated)") : "";
|
|
123441
|
-
const
|
|
123645
|
+
const path63 = truncatePathStart(file.displayPath, maxPathChars);
|
|
123442
123646
|
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
123443
123647
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
123444
123648
|
Text,
|
|
@@ -123447,7 +123651,7 @@ function FileRow({
|
|
|
123447
123651
|
bold: selected,
|
|
123448
123652
|
children: [
|
|
123449
123653
|
pointer,
|
|
123450
|
-
|
|
123654
|
+
path63
|
|
123451
123655
|
]
|
|
123452
123656
|
}
|
|
123453
123657
|
),
|
|
@@ -123512,11 +123716,11 @@ function FileDetail({
|
|
|
123512
123716
|
] });
|
|
123513
123717
|
}
|
|
123514
123718
|
__name(FileDetail, "FileDetail");
|
|
123515
|
-
function truncatePathStart(
|
|
123719
|
+
function truncatePathStart(path63, maxChars) {
|
|
123516
123720
|
if (maxChars <= 0) return "";
|
|
123517
|
-
if (
|
|
123518
|
-
if (maxChars <= 1) return
|
|
123519
|
-
return "\u2026" +
|
|
123721
|
+
if (path63.length <= maxChars) return path63;
|
|
123722
|
+
if (maxChars <= 1) return path63.slice(-maxChars);
|
|
123723
|
+
return "\u2026" + path63.slice(-(maxChars - 1));
|
|
123520
123724
|
}
|
|
123521
123725
|
__name(truncatePathStart, "truncatePathStart");
|
|
123522
123726
|
function useVisibleWindow(total, selectedIndex, windowSize) {
|
|
@@ -123533,18 +123737,18 @@ __name(useVisibleWindow, "useVisibleWindow");
|
|
|
123533
123737
|
function currentToFiles(result, hunks) {
|
|
123534
123738
|
if (!result) return [];
|
|
123535
123739
|
const out = [];
|
|
123536
|
-
for (const [
|
|
123537
|
-
out.push(perFileToUnified(
|
|
123740
|
+
for (const [path63, s] of result.perFileStats) {
|
|
123741
|
+
out.push(perFileToUnified(path63, s, hunks));
|
|
123538
123742
|
}
|
|
123539
123743
|
out.sort((a, b) => a.path.localeCompare(b.path));
|
|
123540
123744
|
return out;
|
|
123541
123745
|
}
|
|
123542
123746
|
__name(currentToFiles, "currentToFiles");
|
|
123543
|
-
function perFileToUnified(
|
|
123544
|
-
const fileHunks = hunks.get(
|
|
123747
|
+
function perFileToUnified(path63, s, hunks) {
|
|
123748
|
+
const fileHunks = hunks.get(path63);
|
|
123545
123749
|
return {
|
|
123546
|
-
path:
|
|
123547
|
-
displayPath: sanitizeFilenameForDisplay(
|
|
123750
|
+
path: path63,
|
|
123751
|
+
displayPath: sanitizeFilenameForDisplay(path63),
|
|
123548
123752
|
added: s.added ?? 0,
|
|
123549
123753
|
removed: s.isUntracked ? 0 : s.removed ?? 0,
|
|
123550
123754
|
isBinary: !!s.isBinary,
|
|
@@ -126391,6 +126595,27 @@ var import_react163 = __toESM(require_react(), 1);
|
|
|
126391
126595
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
126392
126596
|
init_esbuild_shims();
|
|
126393
126597
|
var import_react161 = __toESM(require_react(), 1);
|
|
126598
|
+
function getMcpResourceSuggestions(config, pattern) {
|
|
126599
|
+
if (!config) return null;
|
|
126600
|
+
if (config.isTrustedFolder?.() === false) return null;
|
|
126601
|
+
const mcpServers = config.getMcpServers?.() || {};
|
|
126602
|
+
const match = matchMcpServerPrefix(pattern, Object.keys(mcpServers));
|
|
126603
|
+
if (!match) return null;
|
|
126604
|
+
const serverName = match.serverName;
|
|
126605
|
+
const partialUri = match.rest;
|
|
126606
|
+
const resources = config.getResourceRegistry?.()?.getResourcesByServer(serverName) ?? [];
|
|
126607
|
+
const matches = resources.filter((r) => r.uri.includes(partialUri)).sort((a, b) => {
|
|
126608
|
+
const aPrefix = a.uri.startsWith(partialUri) ? 0 : 1;
|
|
126609
|
+
const bPrefix = b.uri.startsWith(partialUri) ? 0 : 1;
|
|
126610
|
+
return aPrefix - bPrefix || a.uri.localeCompare(b.uri);
|
|
126611
|
+
});
|
|
126612
|
+
return matches.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3).map((r) => ({
|
|
126613
|
+
label: `${serverName}:${r.uri}`,
|
|
126614
|
+
value: `${serverName}:${r.uri}`,
|
|
126615
|
+
isDirectory: false
|
|
126616
|
+
}));
|
|
126617
|
+
}
|
|
126618
|
+
__name(getMcpResourceSuggestions, "getMcpResourceSuggestions");
|
|
126394
126619
|
var initialState = {
|
|
126395
126620
|
status: "idle" /* IDLE */,
|
|
126396
126621
|
suggestions: [],
|
|
@@ -126517,7 +126742,21 @@ function useAtCompletion(props) {
|
|
|
126517
126742
|
}
|
|
126518
126743
|
}, "initialize");
|
|
126519
126744
|
const search = /* @__PURE__ */ __name(async () => {
|
|
126520
|
-
if (
|
|
126745
|
+
if (state2.pattern === null) {
|
|
126746
|
+
return;
|
|
126747
|
+
}
|
|
126748
|
+
const resourceSuggestions = getMcpResourceSuggestions(
|
|
126749
|
+
config,
|
|
126750
|
+
state2.pattern
|
|
126751
|
+
);
|
|
126752
|
+
if (resourceSuggestions !== null) {
|
|
126753
|
+
if (slowSearchTimer.current) {
|
|
126754
|
+
clearTimeout(slowSearchTimer.current);
|
|
126755
|
+
}
|
|
126756
|
+
dispatch({ type: "SEARCH_SUCCESS", payload: resourceSuggestions });
|
|
126757
|
+
return;
|
|
126758
|
+
}
|
|
126759
|
+
if (!fileSearch.current) {
|
|
126521
126760
|
return;
|
|
126522
126761
|
}
|
|
126523
126762
|
if (slowSearchTimer.current) {
|
|
@@ -133132,6 +133371,31 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
133132
133371
|
})();
|
|
133133
133372
|
};
|
|
133134
133373
|
}, [config, reloadCommands]);
|
|
133374
|
+
(0, import_react199.useEffect)(() => {
|
|
133375
|
+
if (!config) {
|
|
133376
|
+
return;
|
|
133377
|
+
}
|
|
133378
|
+
let timer = null;
|
|
133379
|
+
const listener = /* @__PURE__ */ __name((_serverName, status) => {
|
|
133380
|
+
if (status !== "connected" /* CONNECTED */) {
|
|
133381
|
+
return;
|
|
133382
|
+
}
|
|
133383
|
+
if (timer) {
|
|
133384
|
+
clearTimeout(timer);
|
|
133385
|
+
}
|
|
133386
|
+
timer = setTimeout(() => {
|
|
133387
|
+
timer = null;
|
|
133388
|
+
reloadCommands();
|
|
133389
|
+
}, 250);
|
|
133390
|
+
}, "listener");
|
|
133391
|
+
addMCPStatusChangeListener(listener);
|
|
133392
|
+
return () => {
|
|
133393
|
+
removeMCPStatusChangeListener(listener);
|
|
133394
|
+
if (timer) {
|
|
133395
|
+
clearTimeout(timer);
|
|
133396
|
+
}
|
|
133397
|
+
};
|
|
133398
|
+
}, [config, reloadCommands]);
|
|
133135
133399
|
(0, import_react199.useEffect)(() => {
|
|
133136
133400
|
if (!isConfigInitialized) {
|
|
133137
133401
|
return;
|
|
@@ -133731,7 +133995,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
133731
133995
|
__name(useDoublePress, "useDoublePress");
|
|
133732
133996
|
|
|
133733
133997
|
// packages/cli/src/ui/AppContainer.tsx
|
|
133734
|
-
import * as
|
|
133998
|
+
import * as fs51 from "node:fs";
|
|
133735
133999
|
import { basename as basename12 } from "node:path";
|
|
133736
134000
|
|
|
133737
134001
|
// packages/cli/src/utils/windowTitle.ts
|
|
@@ -139213,12 +139477,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
|
|
|
139213
139477
|
"constructor"
|
|
139214
139478
|
]);
|
|
139215
139479
|
var digits = new Set("0123456789");
|
|
139216
|
-
function getPathSegments(
|
|
139480
|
+
function getPathSegments(path63) {
|
|
139217
139481
|
const parts = [];
|
|
139218
139482
|
let currentSegment = "";
|
|
139219
139483
|
let currentPart = "start";
|
|
139220
139484
|
let isIgnoring = false;
|
|
139221
|
-
for (const character of
|
|
139485
|
+
for (const character of path63) {
|
|
139222
139486
|
switch (character) {
|
|
139223
139487
|
case "\\": {
|
|
139224
139488
|
if (currentPart === "index") {
|
|
@@ -139343,11 +139607,11 @@ function assertNotStringIndex(object, key) {
|
|
|
139343
139607
|
}
|
|
139344
139608
|
}
|
|
139345
139609
|
__name(assertNotStringIndex, "assertNotStringIndex");
|
|
139346
|
-
function getProperty(object,
|
|
139347
|
-
if (!isObject(object) || typeof
|
|
139610
|
+
function getProperty(object, path63, value) {
|
|
139611
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139348
139612
|
return value === void 0 ? object : value;
|
|
139349
139613
|
}
|
|
139350
|
-
const pathArray = getPathSegments(
|
|
139614
|
+
const pathArray = getPathSegments(path63);
|
|
139351
139615
|
if (pathArray.length === 0) {
|
|
139352
139616
|
return value;
|
|
139353
139617
|
}
|
|
@@ -139368,12 +139632,12 @@ function getProperty(object, path64, value) {
|
|
|
139368
139632
|
return object === void 0 ? value : object;
|
|
139369
139633
|
}
|
|
139370
139634
|
__name(getProperty, "getProperty");
|
|
139371
|
-
function setProperty(object,
|
|
139372
|
-
if (!isObject(object) || typeof
|
|
139635
|
+
function setProperty(object, path63, value) {
|
|
139636
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139373
139637
|
return object;
|
|
139374
139638
|
}
|
|
139375
139639
|
const root = object;
|
|
139376
|
-
const pathArray = getPathSegments(
|
|
139640
|
+
const pathArray = getPathSegments(path63);
|
|
139377
139641
|
for (let index = 0; index < pathArray.length; index++) {
|
|
139378
139642
|
const key = pathArray[index];
|
|
139379
139643
|
assertNotStringIndex(object, key);
|
|
@@ -139387,11 +139651,11 @@ function setProperty(object, path64, value) {
|
|
|
139387
139651
|
return root;
|
|
139388
139652
|
}
|
|
139389
139653
|
__name(setProperty, "setProperty");
|
|
139390
|
-
function deleteProperty(object,
|
|
139391
|
-
if (!isObject(object) || typeof
|
|
139654
|
+
function deleteProperty(object, path63) {
|
|
139655
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139392
139656
|
return false;
|
|
139393
139657
|
}
|
|
139394
|
-
const pathArray = getPathSegments(
|
|
139658
|
+
const pathArray = getPathSegments(path63);
|
|
139395
139659
|
for (let index = 0; index < pathArray.length; index++) {
|
|
139396
139660
|
const key = pathArray[index];
|
|
139397
139661
|
assertNotStringIndex(object, key);
|
|
@@ -139406,11 +139670,11 @@ function deleteProperty(object, path64) {
|
|
|
139406
139670
|
}
|
|
139407
139671
|
}
|
|
139408
139672
|
__name(deleteProperty, "deleteProperty");
|
|
139409
|
-
function hasProperty(object,
|
|
139410
|
-
if (!isObject(object) || typeof
|
|
139673
|
+
function hasProperty(object, path63) {
|
|
139674
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139411
139675
|
return false;
|
|
139412
139676
|
}
|
|
139413
|
-
const pathArray = getPathSegments(
|
|
139677
|
+
const pathArray = getPathSegments(path63);
|
|
139414
139678
|
if (pathArray.length === 0) {
|
|
139415
139679
|
return false;
|
|
139416
139680
|
}
|
|
@@ -142166,60 +142430,33 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
142166
142430
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
142167
142431
|
init_esbuild_shims();
|
|
142168
142432
|
var import_react217 = __toESM(require_react(), 1);
|
|
142169
|
-
import fs50 from "node:fs";
|
|
142170
|
-
import fsPromises2 from "node:fs/promises";
|
|
142171
|
-
import path57 from "node:path";
|
|
142172
142433
|
function useGitBranchName(cwd5) {
|
|
142173
142434
|
const [branchName, setBranchName] = (0, import_react217.useState)(void 0);
|
|
142174
142435
|
(0, import_react217.useEffect)(() => {
|
|
142175
142436
|
let cancelled = false;
|
|
142176
|
-
|
|
142177
|
-
|
|
142178
|
-
|
|
142179
|
-
|
|
142180
|
-
|
|
142181
|
-
|
|
142182
|
-
|
|
142183
|
-
|
|
142184
|
-
|
|
142185
|
-
)
|
|
142186
|
-
if (cancelled) return;
|
|
142187
|
-
const branch = stdout.toString().trim();
|
|
142188
|
-
if (branch && branch !== "HEAD") {
|
|
142189
|
-
setBranchName(branch);
|
|
142190
|
-
} else {
|
|
142191
|
-
const { stdout: hashStdout } = await execCommand(
|
|
142192
|
-
"git",
|
|
142193
|
-
["rev-parse", "--short", "HEAD"],
|
|
142194
|
-
{ cwd: cwd5 }
|
|
142195
|
-
);
|
|
142196
|
-
if (!cancelled) {
|
|
142197
|
-
setBranchName(hashStdout.toString().trim());
|
|
142198
|
-
}
|
|
142199
|
-
}
|
|
142200
|
-
} catch {
|
|
142201
|
-
if (!cancelled) setBranchName(void 0);
|
|
142202
|
-
}
|
|
142203
|
-
}, "fetchWithGuard");
|
|
142204
|
-
fetchWithGuard();
|
|
142205
|
-
const gitLogsHeadPath = path57.join(cwd5, ".git", "logs", "HEAD");
|
|
142206
|
-
let watcher;
|
|
142207
|
-
const setupWatcher = /* @__PURE__ */ __name(async () => {
|
|
142208
|
-
try {
|
|
142209
|
-
await fsPromises2.access(gitLogsHeadPath, fs50.constants.F_OK);
|
|
142210
|
-
if (cancelled) return;
|
|
142211
|
-
watcher = fs50.watch(gitLogsHeadPath, (eventType) => {
|
|
142212
|
-
if (eventType === "change" || eventType === "rename") {
|
|
142213
|
-
if (!cancelled) fetchWithGuard();
|
|
142214
|
-
}
|
|
142437
|
+
let dispose;
|
|
142438
|
+
const refresh = /* @__PURE__ */ __name(async () => {
|
|
142439
|
+
const name = await resolveBranchName(cwd5);
|
|
142440
|
+
if (!cancelled) setBranchName(name);
|
|
142441
|
+
}, "refresh");
|
|
142442
|
+
const init = /* @__PURE__ */ __name(async () => {
|
|
142443
|
+
await refresh();
|
|
142444
|
+
if (cancelled) return;
|
|
142445
|
+
const disposer = await watchRepoBranch(cwd5, () => {
|
|
142446
|
+
void refresh().catch(() => {
|
|
142215
142447
|
});
|
|
142216
|
-
}
|
|
142448
|
+
});
|
|
142449
|
+
if (cancelled) {
|
|
142450
|
+
disposer();
|
|
142451
|
+
} else {
|
|
142452
|
+
dispose = disposer;
|
|
142217
142453
|
}
|
|
142218
|
-
}, "
|
|
142219
|
-
|
|
142454
|
+
}, "init");
|
|
142455
|
+
void init().catch(() => {
|
|
142456
|
+
});
|
|
142220
142457
|
return () => {
|
|
142221
142458
|
cancelled = true;
|
|
142222
|
-
|
|
142459
|
+
dispose?.();
|
|
142223
142460
|
};
|
|
142224
142461
|
}, [cwd5]);
|
|
142225
142462
|
return branchName;
|
|
@@ -142229,9 +142466,9 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
142229
142466
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
142230
142467
|
init_esbuild_shims();
|
|
142231
142468
|
var import_react218 = __toESM(require_react(), 1);
|
|
142232
|
-
import
|
|
142233
|
-
import
|
|
142234
|
-
import
|
|
142469
|
+
import fs50 from "node:fs";
|
|
142470
|
+
import fsPromises2 from "node:fs/promises";
|
|
142471
|
+
import path57 from "node:path";
|
|
142235
142472
|
function useWorktreeSession(config) {
|
|
142236
142473
|
const [session2, setSession] = (0, import_react218.useState)(null);
|
|
142237
142474
|
(0, import_react218.useEffect)(() => {
|
|
@@ -142247,14 +142484,14 @@ function useWorktreeSession(config) {
|
|
|
142247
142484
|
}, "safeLoad");
|
|
142248
142485
|
void safeLoad();
|
|
142249
142486
|
const filePath = config.getSessionService().getWorktreeSessionPath(config.getSessionId());
|
|
142250
|
-
const dirPath =
|
|
142251
|
-
const fileName =
|
|
142487
|
+
const dirPath = path57.dirname(filePath);
|
|
142488
|
+
const fileName = path57.basename(filePath);
|
|
142252
142489
|
let watcher;
|
|
142253
142490
|
const setupWatcher = /* @__PURE__ */ __name(async () => {
|
|
142254
142491
|
try {
|
|
142255
|
-
await
|
|
142492
|
+
await fsPromises2.mkdir(dirPath, { recursive: true });
|
|
142256
142493
|
if (cancelled) return;
|
|
142257
|
-
watcher =
|
|
142494
|
+
watcher = fs50.watch(dirPath, (_eventType, filename) => {
|
|
142258
142495
|
if (filename === null || filename.toString() === fileName) {
|
|
142259
142496
|
void safeLoad();
|
|
142260
142497
|
}
|
|
@@ -143608,7 +143845,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
143608
143845
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
143609
143846
|
const isValidPath = (0, import_react234.useCallback)((filePath) => {
|
|
143610
143847
|
try {
|
|
143611
|
-
return
|
|
143848
|
+
return fs51.existsSync(filePath) && fs51.statSync(filePath).isFile();
|
|
143612
143849
|
} catch (_e) {
|
|
143613
143850
|
return false;
|
|
143614
143851
|
}
|
|
@@ -145961,8 +146198,8 @@ init_esbuild_shims();
|
|
|
145961
146198
|
var import_shell_quote = __toESM(require_shell_quote(), 1);
|
|
145962
146199
|
import { exec as exec7, execSync as execSync5, spawn as spawn8 } from "node:child_process";
|
|
145963
146200
|
import os30 from "node:os";
|
|
145964
|
-
import
|
|
145965
|
-
import
|
|
146201
|
+
import path59 from "node:path";
|
|
146202
|
+
import fs52 from "node:fs";
|
|
145966
146203
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
145967
146204
|
import { promisify as promisify8 } from "node:util";
|
|
145968
146205
|
import { randomBytes } from "node:crypto";
|
|
@@ -145983,10 +146220,10 @@ __name(parseSandboxImageName, "parseSandboxImageName");
|
|
|
145983
146220
|
|
|
145984
146221
|
// packages/cli/src/utils/sandbox-path.ts
|
|
145985
146222
|
init_esbuild_shims();
|
|
145986
|
-
import
|
|
146223
|
+
import path58 from "node:path";
|
|
145987
146224
|
function isContainerPathWithinWorkdir(containerWorkdir, containerPath) {
|
|
145988
146225
|
const normalize5 = /* @__PURE__ */ __name((value) => {
|
|
145989
|
-
const normalized =
|
|
146226
|
+
const normalized = path58.posix.normalize(value.replace(/\\/g, "/")).replace(/\/+$/, "").toLowerCase();
|
|
145990
146227
|
return normalized || "/";
|
|
145991
146228
|
}, "normalize");
|
|
145992
146229
|
const normalizedWorkdir = normalize5(containerWorkdir);
|
|
@@ -146030,10 +146267,10 @@ function getContainerPath(hostPath) {
|
|
|
146030
146267
|
}
|
|
146031
146268
|
__name(getContainerPath, "getContainerPath");
|
|
146032
146269
|
function ensureDirectoryAndGetRealPath(dir) {
|
|
146033
|
-
if (!
|
|
146034
|
-
|
|
146270
|
+
if (!fs52.existsSync(dir)) {
|
|
146271
|
+
fs52.mkdirSync(dir, { recursive: true });
|
|
146035
146272
|
}
|
|
146036
|
-
return
|
|
146273
|
+
return fs52.realpathSync(dir);
|
|
146037
146274
|
}
|
|
146038
146275
|
__name(ensureDirectoryAndGetRealPath, "ensureDirectoryAndGetRealPath");
|
|
146039
146276
|
var LOCAL_DEV_SANDBOX_IMAGE_NAME = "qwen-code-sandbox";
|
|
@@ -146104,11 +146341,11 @@ function entrypoint(workdir, cliArgs) {
|
|
|
146104
146341
|
if (pythonPathSuffix) {
|
|
146105
146342
|
shellCmds.push(`export PYTHONPATH="$PYTHONPATH${pythonPathSuffix}";`);
|
|
146106
146343
|
}
|
|
146107
|
-
const projectSandboxBashrc =
|
|
146344
|
+
const projectSandboxBashrc = path59.join(
|
|
146108
146345
|
SETTINGS_DIRECTORY_NAME,
|
|
146109
146346
|
"sandbox.bashrc"
|
|
146110
146347
|
);
|
|
146111
|
-
if (
|
|
146348
|
+
if (fs52.existsSync(projectSandboxBashrc)) {
|
|
146112
146349
|
shellCmds.push(`source ${getContainerPath(projectSandboxBashrc)};`);
|
|
146113
146350
|
}
|
|
146114
146351
|
ports().forEach(
|
|
@@ -146134,12 +146371,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146134
146371
|
new URL(`sandbox-macos-${profile}.sb`, import.meta.url)
|
|
146135
146372
|
);
|
|
146136
146373
|
if (!BUILTIN_SEATBELT_PROFILES.includes(profile)) {
|
|
146137
|
-
profileFile =
|
|
146374
|
+
profileFile = path59.join(
|
|
146138
146375
|
SETTINGS_DIRECTORY_NAME,
|
|
146139
146376
|
`sandbox-macos-${profile}.sb`
|
|
146140
146377
|
);
|
|
146141
146378
|
}
|
|
146142
|
-
if (!
|
|
146379
|
+
if (!fs52.existsSync(profileFile)) {
|
|
146143
146380
|
throw new FatalSandboxError(
|
|
146144
146381
|
`Missing macos seatbelt profile file '${profileFile}'`
|
|
146145
146382
|
);
|
|
@@ -146151,30 +146388,30 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146151
146388
|
].join(" ");
|
|
146152
146389
|
const qwenDir = Storage.getGlobalQwenDir();
|
|
146153
146390
|
const runtimeDir = Storage.getRuntimeBaseDir();
|
|
146154
|
-
|
|
146155
|
-
|
|
146391
|
+
fs52.mkdirSync(qwenDir, { recursive: true });
|
|
146392
|
+
fs52.mkdirSync(runtimeDir, { recursive: true });
|
|
146156
146393
|
const args2 = [
|
|
146157
146394
|
"-D",
|
|
146158
|
-
`TARGET_DIR=${
|
|
146395
|
+
`TARGET_DIR=${fs52.realpathSync(process.cwd())}`,
|
|
146159
146396
|
"-D",
|
|
146160
|
-
`TMP_DIR=${
|
|
146397
|
+
`TMP_DIR=${fs52.realpathSync(os30.tmpdir())}`,
|
|
146161
146398
|
"-D",
|
|
146162
|
-
`HOME_DIR=${
|
|
146399
|
+
`HOME_DIR=${fs52.realpathSync(os30.homedir())}`,
|
|
146163
146400
|
"-D",
|
|
146164
|
-
`CACHE_DIR=${
|
|
146401
|
+
`CACHE_DIR=${fs52.realpathSync(execSync5(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`,
|
|
146165
146402
|
"-D",
|
|
146166
|
-
`QWEN_DIR=${
|
|
146403
|
+
`QWEN_DIR=${fs52.realpathSync(qwenDir)}`,
|
|
146167
146404
|
"-D",
|
|
146168
|
-
`RUNTIME_DIR=${
|
|
146405
|
+
`RUNTIME_DIR=${fs52.realpathSync(runtimeDir)}`
|
|
146169
146406
|
];
|
|
146170
146407
|
const MAX_INCLUDE_DIRS = 5;
|
|
146171
|
-
const targetDir =
|
|
146408
|
+
const targetDir = fs52.realpathSync(cliConfig?.getTargetDir() || "");
|
|
146172
146409
|
const includedDirs = [];
|
|
146173
146410
|
if (cliConfig) {
|
|
146174
146411
|
const workspaceContext = cliConfig.getWorkspaceContext();
|
|
146175
146412
|
const directories = workspaceContext.getDirectories();
|
|
146176
146413
|
for (const dir of directories) {
|
|
146177
|
-
const realDir =
|
|
146414
|
+
const realDir = fs52.realpathSync(dir);
|
|
146178
146415
|
if (realDir !== targetDir) {
|
|
146179
146416
|
includedDirs.push(realDir);
|
|
146180
146417
|
}
|
|
@@ -146256,14 +146493,14 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146256
146493
|
});
|
|
146257
146494
|
}
|
|
146258
146495
|
writeStderrLine(`hopping into sandbox (command: ${config.command}) ...`);
|
|
146259
|
-
const gcPath =
|
|
146260
|
-
const projectSandboxDockerfile =
|
|
146496
|
+
const gcPath = fs52.realpathSync(process.argv[1]);
|
|
146497
|
+
const projectSandboxDockerfile = path59.join(
|
|
146261
146498
|
SETTINGS_DIRECTORY_NAME,
|
|
146262
146499
|
"sandbox.Dockerfile"
|
|
146263
146500
|
);
|
|
146264
|
-
const isCustomProjectSandbox =
|
|
146501
|
+
const isCustomProjectSandbox = fs52.existsSync(projectSandboxDockerfile);
|
|
146265
146502
|
const image2 = config.image;
|
|
146266
|
-
const workdir =
|
|
146503
|
+
const workdir = path59.resolve(process.cwd());
|
|
146267
146504
|
const containerWorkdir = getContainerPath(workdir);
|
|
146268
146505
|
if (process.env["BUILD_SANDBOX"]) {
|
|
146269
146506
|
if (!gcPath.includes("qwen-code/packages/")) {
|
|
@@ -146274,13 +146511,13 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146274
146511
|
writeStderrLine("building sandbox ...");
|
|
146275
146512
|
const gcRoot = gcPath.split("/packages/")[0];
|
|
146276
146513
|
let buildArgs = "";
|
|
146277
|
-
const projectSandboxDockerfile2 =
|
|
146514
|
+
const projectSandboxDockerfile2 = path59.join(
|
|
146278
146515
|
SETTINGS_DIRECTORY_NAME,
|
|
146279
146516
|
"sandbox.Dockerfile"
|
|
146280
146517
|
);
|
|
146281
146518
|
if (isCustomProjectSandbox) {
|
|
146282
146519
|
writeStderrLine(`using ${projectSandboxDockerfile2} for sandbox`);
|
|
146283
|
-
buildArgs += `-f ${
|
|
146520
|
+
buildArgs += `-f ${path59.resolve(projectSandboxDockerfile2)} -i ${image2}`;
|
|
146284
146521
|
}
|
|
146285
146522
|
execSync5(
|
|
146286
146523
|
`cd ${gcRoot} && node scripts/build_sandbox.js -s ${buildArgs}`,
|
|
@@ -146356,8 +146593,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146356
146593
|
args.push("--env", `QWEN_RUNTIME_DIR=${runtimeBaseDirContainerPath}`);
|
|
146357
146594
|
}
|
|
146358
146595
|
args.push("--volume", `${os30.tmpdir()}:${getContainerPath(os30.tmpdir())}`);
|
|
146359
|
-
const gcloudConfigDir =
|
|
146360
|
-
if (
|
|
146596
|
+
const gcloudConfigDir = path59.join(os30.homedir(), ".config", "gcloud");
|
|
146597
|
+
if (fs52.existsSync(gcloudConfigDir)) {
|
|
146361
146598
|
args.push(
|
|
146362
146599
|
"--volume",
|
|
146363
146600
|
`${gcloudConfigDir}:${getContainerPath(gcloudConfigDir)}:ro`
|
|
@@ -146365,7 +146602,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146365
146602
|
}
|
|
146366
146603
|
if (process.env["GOOGLE_APPLICATION_CREDENTIALS"]) {
|
|
146367
146604
|
const adcFile = process.env["GOOGLE_APPLICATION_CREDENTIALS"];
|
|
146368
|
-
if (
|
|
146605
|
+
if (fs52.existsSync(adcFile)) {
|
|
146369
146606
|
args.push("--volume", `${adcFile}:${getContainerPath(adcFile)}:ro`);
|
|
146370
146607
|
args.push(
|
|
146371
146608
|
"--env",
|
|
@@ -146378,12 +146615,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146378
146615
|
if (mount.trim()) {
|
|
146379
146616
|
const { from, to, opts } = parseSandboxMountSpec(mount);
|
|
146380
146617
|
mount = `${from}:${to}:${opts}`;
|
|
146381
|
-
if (!
|
|
146618
|
+
if (!path59.isAbsolute(from)) {
|
|
146382
146619
|
throw new FatalSandboxError(
|
|
146383
146620
|
`Path '${from}' listed in SANDBOX_MOUNTS must be absolute`
|
|
146384
146621
|
);
|
|
146385
146622
|
}
|
|
146386
|
-
if (!
|
|
146623
|
+
if (!fs52.existsSync(from)) {
|
|
146387
146624
|
throw new FatalSandboxError(
|
|
146388
146625
|
`Missing mount path '${from}' listed in SANDBOX_MOUNTS`
|
|
146389
146626
|
);
|
|
@@ -146529,12 +146766,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146529
146766
|
getContainerPath(workdir),
|
|
146530
146767
|
getContainerPath(virtualEnv)
|
|
146531
146768
|
)) {
|
|
146532
|
-
const sandboxVenvPath =
|
|
146769
|
+
const sandboxVenvPath = path59.resolve(
|
|
146533
146770
|
SETTINGS_DIRECTORY_NAME,
|
|
146534
146771
|
"sandbox.venv"
|
|
146535
146772
|
);
|
|
146536
|
-
if (!
|
|
146537
|
-
|
|
146773
|
+
if (!fs52.existsSync(sandboxVenvPath)) {
|
|
146774
|
+
fs52.mkdirSync(sandboxVenvPath, { recursive: true });
|
|
146538
146775
|
}
|
|
146539
146776
|
args.push("--volume", `${sandboxVenvPath}:${getContainerPath(virtualEnv)}`);
|
|
146540
146777
|
args.push("--env", `VIRTUAL_ENV=${getContainerPath(virtualEnv)}`);
|
|
@@ -146563,8 +146800,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146563
146800
|
}
|
|
146564
146801
|
args.push("--env", `SANDBOX=${containerName}`);
|
|
146565
146802
|
if (config.command === "podman") {
|
|
146566
|
-
const emptyAuthFilePath =
|
|
146567
|
-
|
|
146803
|
+
const emptyAuthFilePath = path59.join(os30.tmpdir(), "empty_auth.json");
|
|
146804
|
+
fs52.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
|
|
146568
146805
|
args.push("--authfile", emptyAuthFilePath);
|
|
146569
146806
|
}
|
|
146570
146807
|
let userFlag = "";
|
|
@@ -146763,17 +147000,17 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
|
|
|
146763
147000
|
|
|
146764
147001
|
// packages/cli/src/utils/startupWarnings.ts
|
|
146765
147002
|
init_esbuild_shims();
|
|
146766
|
-
import
|
|
147003
|
+
import fs53 from "node:fs/promises";
|
|
146767
147004
|
import os31 from "node:os";
|
|
146768
147005
|
import { join as pathJoin } from "node:path";
|
|
146769
147006
|
var warningsFilePath = pathJoin(os31.tmpdir(), "qwen-code-warnings.txt");
|
|
146770
147007
|
async function getStartupWarnings() {
|
|
146771
147008
|
try {
|
|
146772
|
-
await
|
|
146773
|
-
const warningsContent = await
|
|
147009
|
+
await fs53.access(warningsFilePath);
|
|
147010
|
+
const warningsContent = await fs53.readFile(warningsFilePath, "utf-8");
|
|
146774
147011
|
const warnings = warningsContent.split("\n").filter((line) => line.trim() !== "");
|
|
146775
147012
|
try {
|
|
146776
|
-
await
|
|
147013
|
+
await fs53.unlink(warningsFilePath);
|
|
146777
147014
|
} catch {
|
|
146778
147015
|
warnings.push("Warning: Could not delete temporary warnings file.");
|
|
146779
147016
|
}
|
|
@@ -146789,16 +147026,16 @@ __name(getStartupWarnings, "getStartupWarnings");
|
|
|
146789
147026
|
|
|
146790
147027
|
// packages/cli/src/utils/userStartupWarnings.ts
|
|
146791
147028
|
init_esbuild_shims();
|
|
146792
|
-
import
|
|
147029
|
+
import fs54 from "node:fs/promises";
|
|
146793
147030
|
import * as os32 from "node:os";
|
|
146794
|
-
import
|
|
147031
|
+
import path60 from "node:path";
|
|
146795
147032
|
var homeDirectoryCheck = {
|
|
146796
147033
|
id: "home-directory",
|
|
146797
147034
|
check: /* @__PURE__ */ __name(async (options) => {
|
|
146798
147035
|
try {
|
|
146799
147036
|
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
|
146800
|
-
|
|
146801
|
-
|
|
147037
|
+
fs54.realpath(options.workspaceRoot),
|
|
147038
|
+
fs54.realpath(os32.homedir())
|
|
146802
147039
|
]);
|
|
146803
147040
|
if (workspaceRealPath === homeRealPath) {
|
|
146804
147041
|
return "You are running Qwen Code in your home directory. It is recommended to run in a project-specific directory.";
|
|
@@ -146813,9 +147050,9 @@ var rootDirectoryCheck = {
|
|
|
146813
147050
|
id: "root-directory",
|
|
146814
147051
|
check: /* @__PURE__ */ __name(async (options) => {
|
|
146815
147052
|
try {
|
|
146816
|
-
const workspaceRealPath = await
|
|
147053
|
+
const workspaceRealPath = await fs54.realpath(options.workspaceRoot);
|
|
146817
147054
|
const errorMessage2 = "Warning: You are running Qwen Code in the root directory. Your entire folder structure will be used for context. It is strongly recommended to run in a project-specific directory.";
|
|
146818
|
-
if (
|
|
147055
|
+
if (path60.dirname(workspaceRealPath) === workspaceRealPath) {
|
|
146819
147056
|
return errorMessage2;
|
|
146820
147057
|
}
|
|
146821
147058
|
return null;
|
|
@@ -147669,7 +147906,16 @@ var DualOutputBridge = class {
|
|
|
147669
147906
|
|
|
147670
147907
|
// packages/cli/src/remoteInput/RemoteInputWatcher.ts
|
|
147671
147908
|
init_esbuild_shims();
|
|
147672
|
-
import {
|
|
147909
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
147910
|
+
import {
|
|
147911
|
+
closeSync as closeSync2,
|
|
147912
|
+
createReadStream,
|
|
147913
|
+
openSync as openSync3,
|
|
147914
|
+
readSync as readSync2,
|
|
147915
|
+
statSync as statSync6,
|
|
147916
|
+
unwatchFile,
|
|
147917
|
+
watchFile
|
|
147918
|
+
} from "node:fs";
|
|
147673
147919
|
import { createInterface as createInterface2 } from "node:readline";
|
|
147674
147920
|
var debugLogger78 = createDebugLogger("REMOTE_INPUT");
|
|
147675
147921
|
var RemoteInputWatcher = class {
|
|
@@ -147682,6 +147928,7 @@ var RemoteInputWatcher = class {
|
|
|
147682
147928
|
processing = false;
|
|
147683
147929
|
active = true;
|
|
147684
147930
|
bytesRead = 0;
|
|
147931
|
+
consumedPrefixHash = null;
|
|
147685
147932
|
reading = false;
|
|
147686
147933
|
filePath;
|
|
147687
147934
|
retryTimer = null;
|
|
@@ -147721,8 +147968,10 @@ var RemoteInputWatcher = class {
|
|
|
147721
147968
|
try {
|
|
147722
147969
|
const stat4 = statSync6(this.filePath);
|
|
147723
147970
|
this.bytesRead = stat4.size;
|
|
147971
|
+
this.consumedPrefixHash = this.hashFilePrefix(this.bytesRead);
|
|
147724
147972
|
} catch {
|
|
147725
147973
|
this.bytesRead = 0;
|
|
147974
|
+
this.consumedPrefixHash = null;
|
|
147726
147975
|
}
|
|
147727
147976
|
watchFile(this.filePath, { interval: this.pollIntervalMs }, () => {
|
|
147728
147977
|
if (!this.active) return;
|
|
@@ -147748,7 +147997,21 @@ var RemoteInputWatcher = class {
|
|
|
147748
147997
|
} catch {
|
|
147749
147998
|
return Promise.resolve();
|
|
147750
147999
|
}
|
|
148000
|
+
if (currentSize < this.bytesRead) {
|
|
148001
|
+
debugLogger78.debug(
|
|
148002
|
+
"RemoteInput: input file shrank, resetting read offset"
|
|
148003
|
+
);
|
|
148004
|
+
this.bytesRead = 0;
|
|
148005
|
+
this.consumedPrefixHash = null;
|
|
148006
|
+
} else if (this.hasConsumedPrefixChanged()) {
|
|
148007
|
+
debugLogger78.debug(
|
|
148008
|
+
"RemoteInput: input file prefix changed, resetting read offset"
|
|
148009
|
+
);
|
|
148010
|
+
this.bytesRead = 0;
|
|
148011
|
+
this.consumedPrefixHash = null;
|
|
148012
|
+
}
|
|
147751
148013
|
if (currentSize <= this.bytesRead) return Promise.resolve();
|
|
148014
|
+
const nextConsumedPrefixHash = this.hashFilePrefix(currentSize);
|
|
147752
148015
|
this.reading = true;
|
|
147753
148016
|
const stream = createReadStream(this.filePath, {
|
|
147754
148017
|
start: this.bytesRead,
|
|
@@ -147784,12 +148047,61 @@ var RemoteInputWatcher = class {
|
|
|
147784
148047
|
return new Promise((resolve23) => {
|
|
147785
148048
|
rl.on("close", () => {
|
|
147786
148049
|
this.bytesRead = currentSize;
|
|
148050
|
+
if (nextConsumedPrefixHash !== null) {
|
|
148051
|
+
this.consumedPrefixHash = nextConsumedPrefixHash;
|
|
148052
|
+
}
|
|
147787
148053
|
this.reading = false;
|
|
147788
148054
|
this.processQueue();
|
|
147789
148055
|
resolve23();
|
|
147790
148056
|
});
|
|
147791
148057
|
});
|
|
147792
148058
|
}
|
|
148059
|
+
hasConsumedPrefixChanged() {
|
|
148060
|
+
if (this.bytesRead === 0) {
|
|
148061
|
+
return false;
|
|
148062
|
+
}
|
|
148063
|
+
if (this.consumedPrefixHash === null) {
|
|
148064
|
+
debugLogger78.warn(
|
|
148065
|
+
"RemoteInput: missing consumed prefix hash, resetting read offset"
|
|
148066
|
+
);
|
|
148067
|
+
return true;
|
|
148068
|
+
}
|
|
148069
|
+
const currentHash = this.hashFilePrefix(this.bytesRead);
|
|
148070
|
+
if (currentHash === null) {
|
|
148071
|
+
debugLogger78.warn(
|
|
148072
|
+
"RemoteInput: failed to hash consumed prefix, resetting read offset"
|
|
148073
|
+
);
|
|
148074
|
+
return true;
|
|
148075
|
+
}
|
|
148076
|
+
return currentHash !== this.consumedPrefixHash;
|
|
148077
|
+
}
|
|
148078
|
+
hashFilePrefix(size) {
|
|
148079
|
+
if (size <= 0) return null;
|
|
148080
|
+
let fd = null;
|
|
148081
|
+
try {
|
|
148082
|
+
fd = openSync3(this.filePath, "r");
|
|
148083
|
+
const hash = createHash2("sha256");
|
|
148084
|
+
const buffer = Buffer.allocUnsafe(Math.min(64 * 1024, size));
|
|
148085
|
+
let remaining = size;
|
|
148086
|
+
let position = 0;
|
|
148087
|
+
while (remaining > 0) {
|
|
148088
|
+
const bytesToRead = Math.min(buffer.length, remaining);
|
|
148089
|
+
const bytesRead = readSync2(fd, buffer, 0, bytesToRead, position);
|
|
148090
|
+
if (bytesRead <= 0) return null;
|
|
148091
|
+
hash.update(buffer.subarray(0, bytesRead));
|
|
148092
|
+
remaining -= bytesRead;
|
|
148093
|
+
position += bytesRead;
|
|
148094
|
+
}
|
|
148095
|
+
return hash.digest("base64");
|
|
148096
|
+
} catch (err) {
|
|
148097
|
+
debugLogger78.warn("RemoteInput: failed to hash file prefix:", err);
|
|
148098
|
+
return null;
|
|
148099
|
+
} finally {
|
|
148100
|
+
if (fd !== null) {
|
|
148101
|
+
closeSync2(fd);
|
|
148102
|
+
}
|
|
148103
|
+
}
|
|
148104
|
+
}
|
|
147793
148105
|
async processQueue() {
|
|
147794
148106
|
if (this.processing || !this.submitFn || this.queue.length === 0) return;
|
|
147795
148107
|
this.processing = true;
|
|
@@ -148129,8 +148441,8 @@ var AcpFileSystemService = class {
|
|
|
148129
148441
|
// packages/cli/src/acp-integration/acpAgent.ts
|
|
148130
148442
|
import { Readable as Readable2, Writable as Writable2 } from "node:stream";
|
|
148131
148443
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
148132
|
-
import * as
|
|
148133
|
-
import * as
|
|
148444
|
+
import * as fs55 from "node:fs/promises";
|
|
148445
|
+
import * as path61 from "node:path";
|
|
148134
148446
|
import { createGunzip } from "node:zlib";
|
|
148135
148447
|
|
|
148136
148448
|
// packages/cli/src/acp-integration/session/Session.ts
|
|
@@ -149067,8 +149379,13 @@ function isUserPromptRecord(record) {
|
|
|
149067
149379
|
) ?? false;
|
|
149068
149380
|
}
|
|
149069
149381
|
__name(isUserPromptRecord, "isUserPromptRecord");
|
|
149070
|
-
async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4)) {
|
|
149071
|
-
const slashCommands = await getAvailableCommands(
|
|
149382
|
+
async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings) {
|
|
149383
|
+
const slashCommands = await getAvailableCommands(
|
|
149384
|
+
config,
|
|
149385
|
+
abortSignal,
|
|
149386
|
+
"acp",
|
|
149387
|
+
settings
|
|
149388
|
+
);
|
|
149072
149389
|
const availableCommands = slashCommands.map((cmd) => {
|
|
149073
149390
|
const acceptsInput = cmd.acceptsInput ?? (cmd.kind !== "built-in" /* BUILT_IN */ || cmd.completion != null || cmd.argumentHint != null || cmd.subCommands != null && cmd.subCommands.length > 0);
|
|
149074
149391
|
return {
|
|
@@ -150832,7 +151149,11 @@ ${this.pendingWorktreeNotice}
|
|
|
150832
151149
|
}
|
|
150833
151150
|
async sendAvailableCommandsUpdate() {
|
|
150834
151151
|
try {
|
|
150835
|
-
const { availableCommands, availableSkills, availableSkillDetails } = await buildAvailableCommandsSnapshot(
|
|
151152
|
+
const { availableCommands, availableSkills, availableSkillDetails } = await buildAvailableCommandsSnapshot(
|
|
151153
|
+
this.config,
|
|
151154
|
+
void 0,
|
|
151155
|
+
this.settings
|
|
151156
|
+
);
|
|
150836
151157
|
const update = {
|
|
150837
151158
|
sessionUpdate: "available_commands_update",
|
|
150838
151159
|
availableCommands,
|
|
@@ -151100,11 +151421,10 @@ ${this.pendingWorktreeNotice}
|
|
|
151100
151421
|
}
|
|
151101
151422
|
}, "appendSkippedAfter");
|
|
151102
151423
|
const runBounded = /* @__PURE__ */ __name(async (calls, runAbortSignal, onStopAfterPermissionCancel, shouldSkipUnstarted) => {
|
|
151103
|
-
const
|
|
151104
|
-
process.env["QWEN_CODE_MAX_TOOL_CONCURRENCY"]
|
|
151424
|
+
const maxConcurrency = parsePositiveIntegerEnv(
|
|
151425
|
+
process.env["QWEN_CODE_MAX_TOOL_CONCURRENCY"],
|
|
151105
151426
|
10
|
|
151106
151427
|
);
|
|
151107
|
-
const maxConcurrency = Number.isFinite(parsed) && parsed >= 1 ? parsed : 10;
|
|
151108
151428
|
const results = new Array(calls.length);
|
|
151109
151429
|
const executing = /* @__PURE__ */ new Set();
|
|
151110
151430
|
for (let i = 0; i < calls.length; i++) {
|
|
@@ -152322,7 +152642,7 @@ function readRequiredString(value, fieldName) {
|
|
|
152322
152642
|
}
|
|
152323
152643
|
__name(readRequiredString, "readRequiredString");
|
|
152324
152644
|
function validateSkillSlug(slug) {
|
|
152325
|
-
if (!slug || slug === "." || slug === ".." || slug.includes("/") || slug.includes(
|
|
152645
|
+
if (!slug || slug === "." || slug === ".." || slug.includes("/") || slug.includes(path61.sep) || !/^[a-zA-Z0-9._-]+$/.test(slug)) {
|
|
152326
152646
|
throw RequestError.invalidParams(void 0, "Invalid skill.slug");
|
|
152327
152647
|
}
|
|
152328
152648
|
}
|
|
@@ -152791,7 +153111,7 @@ async function downloadGitHubSkillDirectoryFromApi(githubUrl, directoryPath, rel
|
|
|
152791
153111
|
const name = readRequiredString(record["name"], "github.name");
|
|
152792
153112
|
const itemPath = readRequiredString(record["path"], "github.path");
|
|
152793
153113
|
const type = readRequiredString(record["type"], "github.type");
|
|
152794
|
-
const relativePath = relativeRoot ?
|
|
153114
|
+
const relativePath = relativeRoot ? path61.posix.join(relativeRoot, name) : name;
|
|
152795
153115
|
if (type === "dir") {
|
|
152796
153116
|
files.push(
|
|
152797
153117
|
...await downloadGitHubSkillDirectoryFromApi(
|
|
@@ -152851,10 +153171,10 @@ __name(downloadGitHubSkillDirectory, "downloadGitHubSkillDirectory");
|
|
|
152851
153171
|
async function downloadSkill(sourceUrl) {
|
|
152852
153172
|
assertAllowedSkillSourceUrl(sourceUrl);
|
|
152853
153173
|
const githubUrl = parseGitHubBlobSkillUrl(sourceUrl);
|
|
152854
|
-
if (!githubUrl ||
|
|
153174
|
+
if (!githubUrl || path61.posix.basename(githubUrl.filePath) !== "SKILL.md") {
|
|
152855
153175
|
return downloadSingleSkillFile(sourceUrl);
|
|
152856
153176
|
}
|
|
152857
|
-
const skillDirectory =
|
|
153177
|
+
const skillDirectory = path61.posix.dirname(githubUrl.filePath);
|
|
152858
153178
|
const files = await downloadGitHubSkillDirectory(githubUrl, skillDirectory);
|
|
152859
153179
|
const skillFile = files.find((file) => file.relativePath === "SKILL.md");
|
|
152860
153180
|
if (!skillFile) {
|
|
@@ -152870,9 +153190,9 @@ async function downloadSkill(sourceUrl) {
|
|
|
152870
153190
|
}
|
|
152871
153191
|
__name(downloadSkill, "downloadSkill");
|
|
152872
153192
|
function resolveSkillInstallPath(skillDir, relativePath) {
|
|
152873
|
-
const root =
|
|
152874
|
-
const target =
|
|
152875
|
-
if (target !== root && !target.startsWith(root +
|
|
153193
|
+
const root = path61.resolve(skillDir);
|
|
153194
|
+
const target = path61.resolve(skillDir, relativePath);
|
|
153195
|
+
if (target !== root && !target.startsWith(root + path61.sep)) {
|
|
152876
153196
|
throw RequestError.invalidParams(
|
|
152877
153197
|
void 0,
|
|
152878
153198
|
`Invalid skill file path: ${relativePath}`
|
|
@@ -152882,9 +153202,9 @@ function resolveSkillInstallPath(skillDir, relativePath) {
|
|
|
152882
153202
|
}
|
|
152883
153203
|
__name(resolveSkillInstallPath, "resolveSkillInstallPath");
|
|
152884
153204
|
function resolveManagedSkillDir(skillsBaseDir, slug) {
|
|
152885
|
-
const root =
|
|
152886
|
-
const skillDir =
|
|
152887
|
-
if (!skillDir.startsWith(root +
|
|
153205
|
+
const root = path61.resolve(skillsBaseDir);
|
|
153206
|
+
const skillDir = path61.resolve(skillsBaseDir, slug);
|
|
153207
|
+
if (!skillDir.startsWith(root + path61.sep)) {
|
|
152888
153208
|
throw RequestError.invalidParams(void 0, "Invalid skill.slug");
|
|
152889
153209
|
}
|
|
152890
153210
|
return skillDir;
|
|
@@ -153582,14 +153902,14 @@ function readScopeSettings(settings, scope) {
|
|
|
153582
153902
|
__name(readScopeSettings, "readScopeSettings");
|
|
153583
153903
|
async function resolvePreferredMemoryFile2(dir, fallbackFilename) {
|
|
153584
153904
|
for (const filename of getAllGeminiMdFilenames()) {
|
|
153585
|
-
const filePath =
|
|
153905
|
+
const filePath = path61.join(dir, filename);
|
|
153586
153906
|
try {
|
|
153587
|
-
await
|
|
153907
|
+
await fs55.access(filePath);
|
|
153588
153908
|
return filePath;
|
|
153589
153909
|
} catch {
|
|
153590
153910
|
}
|
|
153591
153911
|
}
|
|
153592
|
-
return
|
|
153912
|
+
return path61.join(dir, fallbackFilename);
|
|
153593
153913
|
}
|
|
153594
153914
|
__name(resolvePreferredMemoryFile2, "resolvePreferredMemoryFile");
|
|
153595
153915
|
async function resolveQwenMemoryPaths(params) {
|
|
@@ -153905,7 +154225,7 @@ var QwenAgent = class {
|
|
|
153905
154225
|
async initialize(args) {
|
|
153906
154226
|
this.clientCapabilities = args.clientCapabilities;
|
|
153907
154227
|
const authMethods = buildAuthMethods();
|
|
153908
|
-
const version = "0.18.
|
|
154228
|
+
const version = "0.18.5";
|
|
153909
154229
|
return {
|
|
153910
154230
|
protocolVersion: PROTOCOL_VERSION,
|
|
153911
154231
|
agentInfo: {
|
|
@@ -155441,9 +155761,9 @@ var QwenAgent = class {
|
|
|
155441
155761
|
);
|
|
155442
155762
|
}
|
|
155443
155763
|
const download = await downloadSkill(request.sourceUrl);
|
|
155444
|
-
const skillsBaseDir =
|
|
155764
|
+
const skillsBaseDir = path61.join(Storage.getGlobalQwenDir(), "skills");
|
|
155445
155765
|
const skillDir = resolveManagedSkillDir(skillsBaseDir, request.slug);
|
|
155446
|
-
const skillFile =
|
|
155766
|
+
const skillFile = path61.join(skillDir, "SKILL.md");
|
|
155447
155767
|
const parsed = skillManager.parseSkillContent(
|
|
155448
155768
|
download.skillContent,
|
|
155449
155769
|
skillFile,
|
|
@@ -155457,19 +155777,19 @@ var QwenAgent = class {
|
|
|
155457
155777
|
}
|
|
155458
155778
|
const stagingDir = `${skillDir}.installing-${process.pid}-${Date.now()}`;
|
|
155459
155779
|
try {
|
|
155460
|
-
await
|
|
155780
|
+
await fs55.rm(stagingDir, { recursive: true, force: true });
|
|
155461
155781
|
for (const file of download.files) {
|
|
155462
155782
|
const targetPath = resolveSkillInstallPath(
|
|
155463
155783
|
stagingDir,
|
|
155464
155784
|
file.relativePath
|
|
155465
155785
|
);
|
|
155466
|
-
await
|
|
155467
|
-
await
|
|
155786
|
+
await fs55.mkdir(path61.dirname(targetPath), { recursive: true });
|
|
155787
|
+
await fs55.writeFile(targetPath, file.content);
|
|
155468
155788
|
}
|
|
155469
|
-
await
|
|
155470
|
-
await
|
|
155789
|
+
await fs55.rm(skillDir, { recursive: true, force: true });
|
|
155790
|
+
await fs55.rename(stagingDir, skillDir);
|
|
155471
155791
|
} catch (error) {
|
|
155472
|
-
await
|
|
155792
|
+
await fs55.rm(stagingDir, { recursive: true, force: true }).catch(() => {
|
|
155473
155793
|
});
|
|
155474
155794
|
throw error;
|
|
155475
155795
|
}
|
|
@@ -155502,17 +155822,17 @@ var QwenAgent = class {
|
|
|
155502
155822
|
`Skill name "${parsed.name}" does not match requested slug "${request.slug}"`
|
|
155503
155823
|
);
|
|
155504
155824
|
}
|
|
155505
|
-
const resolvedSkillDir =
|
|
155506
|
-
const resolvedSkillFile =
|
|
155507
|
-
const globalDir =
|
|
155508
|
-
const isDedicatedSkillDir = resolvedSkillFile ===
|
|
155509
|
-
if (!isDedicatedSkillDir || resolvedSkillDir ===
|
|
155825
|
+
const resolvedSkillDir = path61.resolve(skillDir);
|
|
155826
|
+
const resolvedSkillFile = path61.resolve(skillFile);
|
|
155827
|
+
const globalDir = path61.resolve(Storage.getGlobalQwenDir());
|
|
155828
|
+
const isDedicatedSkillDir = resolvedSkillFile === path61.join(resolvedSkillDir, "SKILL.md");
|
|
155829
|
+
if (!isDedicatedSkillDir || resolvedSkillDir === path61.parse(resolvedSkillDir).root || resolvedSkillDir === globalDir) {
|
|
155510
155830
|
throw RequestError.invalidParams(
|
|
155511
155831
|
void 0,
|
|
155512
155832
|
`Refusing to delete unexpected skill directory: ${skillDir}`
|
|
155513
155833
|
);
|
|
155514
155834
|
}
|
|
155515
|
-
await
|
|
155835
|
+
await fs55.rm(skillDir, { recursive: true, force: true });
|
|
155516
155836
|
await skillManager.refreshCache();
|
|
155517
155837
|
return {
|
|
155518
155838
|
slug: request.slug,
|
|
@@ -155522,11 +155842,11 @@ var QwenAgent = class {
|
|
|
155522
155842
|
async readManagedSkillFile(slug, scope, skillManager, cwd5) {
|
|
155523
155843
|
if (scope === "global") {
|
|
155524
155844
|
const qwenSkillDir = resolveManagedSkillDir(
|
|
155525
|
-
|
|
155845
|
+
path61.join(Storage.getGlobalQwenDir(), "skills"),
|
|
155526
155846
|
slug
|
|
155527
155847
|
);
|
|
155528
|
-
const qwenSkillFile =
|
|
155529
|
-
const qwenContent = await
|
|
155848
|
+
const qwenSkillFile = path61.join(qwenSkillDir, "SKILL.md");
|
|
155849
|
+
const qwenContent = await fs55.readFile(qwenSkillFile, "utf8").catch(() => void 0);
|
|
155530
155850
|
if (qwenContent !== void 0) {
|
|
155531
155851
|
return {
|
|
155532
155852
|
skillDir: qwenSkillDir,
|
|
@@ -155554,34 +155874,34 @@ var QwenAgent = class {
|
|
|
155554
155874
|
`${scope === "project" ? "Project" : "Global"} skill not found: ${slug}`
|
|
155555
155875
|
);
|
|
155556
155876
|
}
|
|
155557
|
-
const content = await
|
|
155877
|
+
const content = await fs55.readFile(skillFile, "utf8").catch(() => {
|
|
155558
155878
|
throw RequestError.invalidParams(
|
|
155559
155879
|
void 0,
|
|
155560
155880
|
`${scope === "project" ? "Project" : "Global"} skill not found: ${slug}`
|
|
155561
155881
|
);
|
|
155562
155882
|
});
|
|
155563
155883
|
return {
|
|
155564
|
-
skillDir:
|
|
155884
|
+
skillDir: path61.dirname(skillFile),
|
|
155565
155885
|
skillFile,
|
|
155566
155886
|
content
|
|
155567
155887
|
};
|
|
155568
155888
|
}
|
|
155569
155889
|
async findProjectSkillFileFromCwd(slug, cwd5, skillManager) {
|
|
155570
|
-
const projectRoot =
|
|
155890
|
+
const projectRoot = path61.resolve(cwd5);
|
|
155571
155891
|
for (const configDir of PROJECT_SKILL_DIRS) {
|
|
155572
|
-
const baseDir =
|
|
155892
|
+
const baseDir = path61.join(projectRoot, configDir, SKILLS_DIR);
|
|
155573
155893
|
const skills = await skillManager.loadSkillsFromDir(baseDir, "project");
|
|
155574
155894
|
const skill = skills.find((candidate) => candidate.name === slug);
|
|
155575
155895
|
const skillFile = skill?.filePath;
|
|
155576
155896
|
if (!skillFile) continue;
|
|
155577
|
-
const content = await
|
|
155897
|
+
const content = await fs55.readFile(skillFile, "utf8").catch(() => {
|
|
155578
155898
|
throw RequestError.invalidParams(
|
|
155579
155899
|
void 0,
|
|
155580
155900
|
`Project skill not found: ${slug}`
|
|
155581
155901
|
);
|
|
155582
155902
|
});
|
|
155583
155903
|
return {
|
|
155584
|
-
skillDir:
|
|
155904
|
+
skillDir: path61.dirname(skillFile),
|
|
155585
155905
|
skillFile,
|
|
155586
155906
|
content
|
|
155587
155907
|
};
|
|
@@ -155612,13 +155932,13 @@ var QwenAgent = class {
|
|
|
155612
155932
|
}
|
|
155613
155933
|
const nextContent = setSkillFrontmatterEnabled(content, request.enabled);
|
|
155614
155934
|
skillManager.parseSkillContent(nextContent, skillFile, level);
|
|
155615
|
-
if (
|
|
155935
|
+
if (path61.basename(skillFile) !== "SKILL.md") {
|
|
155616
155936
|
throw RequestError.invalidParams(
|
|
155617
155937
|
void 0,
|
|
155618
155938
|
`Refusing to write to unexpected skill file: ${skillFile}`
|
|
155619
155939
|
);
|
|
155620
155940
|
}
|
|
155621
|
-
await
|
|
155941
|
+
await fs55.writeFile(skillFile, nextContent, "utf8");
|
|
155622
155942
|
await skillManager.refreshCache();
|
|
155623
155943
|
return {
|
|
155624
155944
|
slug: request.slug,
|
|
@@ -157897,7 +158217,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
157897
158217
|
const resolveIfPath = /* @__PURE__ */ __name((v) => {
|
|
157898
158218
|
if (typeof v !== "string" || v.length === 0) return v;
|
|
157899
158219
|
if (looksLikeInlineJson(v)) return v;
|
|
157900
|
-
return
|
|
158220
|
+
return path62.resolve(launchCwdForPaths, v);
|
|
157901
158221
|
}, "resolveIfPath");
|
|
157902
158222
|
argv.mcpConfig = resolveIfPath(argv.mcpConfig);
|
|
157903
158223
|
argv.openaiLoggingDir = resolveIfPath(argv.openaiLoggingDir);
|
|
@@ -157906,15 +158226,15 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
157906
158226
|
argv.telemetryOutfile = resolveIfPath(argv.telemetryOutfile);
|
|
157907
158227
|
if (Array.isArray(argv.includeDirectories)) {
|
|
157908
158228
|
argv.includeDirectories = argv.includeDirectories.map(
|
|
157909
|
-
(d) => typeof d === "string" && d.length > 0 ?
|
|
158229
|
+
(d) => typeof d === "string" && d.length > 0 ? path62.resolve(launchCwdForPaths, d) : d
|
|
157910
158230
|
);
|
|
157911
158231
|
}
|
|
157912
158232
|
if (typeof argv.jsonSchema === "string") {
|
|
157913
158233
|
const trimmedSchema = argv.jsonSchema.trim();
|
|
157914
158234
|
if (trimmedSchema.startsWith("@")) {
|
|
157915
158235
|
const rel = trimmedSchema.slice(1);
|
|
157916
|
-
if (rel.length > 0 && !
|
|
157917
|
-
argv.jsonSchema = "@" +
|
|
158236
|
+
if (rel.length > 0 && !path62.isAbsolute(rel)) {
|
|
158237
|
+
argv.jsonSchema = "@" + path62.resolve(launchCwdForPaths, rel);
|
|
157918
158238
|
}
|
|
157919
158239
|
}
|
|
157920
158240
|
}
|
|
@@ -158076,7 +158396,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
158076
158396
|
process.exit(0);
|
|
158077
158397
|
}
|
|
158078
158398
|
if (config.isInteractive()) {
|
|
158079
|
-
void import("./chunks/scheduler-
|
|
158399
|
+
void import("./chunks/scheduler-O2E65VDK.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
|
|
158080
158400
|
debugLogger84.warn("failed to start background housekeeping:", err);
|
|
158081
158401
|
});
|
|
158082
158402
|
}
|