@qwen-code/qwen-code 0.18.4 → 0.18.5-nightly.20260622.6bc3f853e
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-WFLPE5MW.js} +21 -21
- package/chunks/{agent-headless-FPUP5WHP.js → agent-headless-Q27MG73I.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-7OCZ77KA.js → chunk-2O3NAOJG.js} +1 -1
- package/chunks/{chunk-HU3RKEK2.js → chunk-42HGOMED.js} +1 -1
- package/chunks/{chunk-GBTJHKQ6.js → chunk-7Z2O7IBO.js} +7 -7
- 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-VWPDSQZY.js → chunk-CTHZVIMD.js} +2 -2
- package/chunks/{chunk-IUEQOXOI.js → chunk-CX3SGIPK.js} +2 -2
- package/chunks/{chunk-32SSXBMG.js → chunk-CXZV4Q4J.js} +3202 -2678
- package/chunks/{chunk-SZWDOOGV.js → chunk-EJ6NFQ2L.js} +11 -11
- 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-6Z2MVJIJ.js → chunk-GM3LTU6K.js} +15 -15
- 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-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-QBUR6J4B.js} +6 -6
- package/chunks/{chunk-LXUQBWQA.js → chunk-SWGPABMH.js} +62 -11
- 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-F5O56FVW.js} +23 -22
- package/chunks/{contextCommand-POQ6GYN3.js → contextCommand-WBVNKL2C.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-UV7MBOJU.js} +21 -21
- package/chunks/{en-KGSAKBJP.js → en-S3OQBISC.js} +1 -0
- package/chunks/{enter-worktree-PA4HPHJK.js → enter-worktree-TSCHZMJ3.js} +21 -21
- package/chunks/{enterPlanMode-SFE5AFKZ.js → enterPlanMode-LKS7VIUG.js} +26 -26
- package/chunks/{exit-worktree-FR3AZTC6.js → exit-worktree-Q6EWFLZU.js} +21 -21
- package/chunks/{exitPlanMode-AHOUO44D.js → exitPlanMode-HS6I4D2O.js} +21 -21
- package/chunks/{fr-2CAQEOK6.js → fr-GVKZ27MF.js} +1 -0
- package/chunks/{geminiContentGenerator-AXCVDKGI.js → geminiContentGenerator-GEZ63VSW.js} +4 -4
- package/chunks/{glob-BQPAW3IW.js → glob-ZN5LKB7E.js} +21 -21
- package/chunks/{grep-2F7BL5TQ.js → grep-NIKBBYBU.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-A25XKPU5.js} +21 -21
- package/chunks/{notebook-edit-7TNZMTBR.js → notebook-edit-E72AIOUS.js} +21 -21
- package/chunks/{openaiContentGenerator-JA6YXXPI.js → openaiContentGenerator-ZDLZDXLU.js} +13 -11
- package/chunks/{pt-2SPOLMAY.js → pt-SY5NCFGR.js} +1 -0
- package/chunks/{qwenContentGenerator-NBOVGW7B.js → qwenContentGenerator-HVJPPMTT.js} +24 -24
- package/chunks/{qwenOAuth2-XWC5SU63.js → qwenOAuth2-WZ54YZ4J.js} +4 -4
- package/chunks/{read-file-RUBU3KUA.js → read-file-L6FM3KUX.js} +8 -8
- package/chunks/{ripGrep-TPFC7KZF.js → ripGrep-YRJCUISE.js} +21 -21
- package/chunks/{ru-35IVJTEH.js → ru-FWNXJG4F.js} +1 -0
- package/chunks/{scheduler-NTVF45LR.js → scheduler-M3742P2I.js} +21 -21
- package/chunks/{send-message-IIT3SHA7.js → send-message-FWFTX62Q.js} +2 -2
- package/chunks/{serve-J6VG37OX.js → serve-ZIP2GDFY.js} +6942 -6809
- package/chunks/{shell-EQQEHEFI.js → shell-T5VSPJLU.js} +21 -21
- package/chunks/{skill-QWRWJCQJ.js → skill-ETTFYDOV.js} +10 -10
- package/chunks/{src-LNADIG5P.js → src-UKOPSYDK.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-DRKUVGBN.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-EIIK27ON.js} +8 -8
- package/chunks/{web-fetch-6XLPPTP7.js → web-fetch-JU7SS6KE.js} +4 -4
- package/chunks/{workflow-7LN3L6KK.js → workflow-4RGAYFSJ.js} +22 -22
- package/chunks/{write-file-DAKE7YKB.js → write-file-GLQYJFEZ.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 +1054 -657
- 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-7Z2O7IBO.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-QBUR6J4B.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-EJ6NFQ2L.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-CXZV4Q4J.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-GM3LTU6K.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-ZIP2GDFY.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-UKOPSYDK.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) {
|
|
@@ -84612,15 +84797,21 @@ var LOOP_TYPE_LABELS = {
|
|
|
84612
84797
|
["alternating_tool_call_pattern" /* ALTERNATING_TOOL_CALL_PATTERN */]: "the model alternated between the same two tool calls in a repeating pattern",
|
|
84613
84798
|
["turn_tool_call_cap" /* TURN_TOOL_CALL_CAP */]: "the model exceeded the maximum number of tool calls allowed in a single turn"
|
|
84614
84799
|
};
|
|
84615
|
-
function
|
|
84616
|
-
if (config.getOutputFormat() !== "text" /* TEXT */) {
|
|
84617
|
-
return;
|
|
84618
|
-
}
|
|
84800
|
+
function formatLoopDetectedMessage(loopType) {
|
|
84619
84801
|
const reason = loopType ? LOOP_TYPE_LABELS[loopType] : void 0;
|
|
84620
84802
|
const detail = reason ? ` (${loopType}: ${reason})` : "";
|
|
84621
84803
|
const hint = loopType === "turn_tool_call_cap" /* TURN_TOOL_CALL_CAP */ ? " This is an always-on per-turn tool-call cap and cannot be disabled via `model.skipLoopDetection`." : " Set the `model.skipLoopDetection` setting to true to disable.";
|
|
84622
|
-
|
|
84804
|
+
return `Loop detection halted the run${detail}.${hint}`;
|
|
84805
|
+
}
|
|
84806
|
+
__name(formatLoopDetectedMessage, "formatLoopDetectedMessage");
|
|
84807
|
+
function emitLoopDetectedMessage(config, loopType) {
|
|
84808
|
+
const message = formatLoopDetectedMessage(loopType);
|
|
84809
|
+
if (config.getOutputFormat() !== "text" /* TEXT */) {
|
|
84810
|
+
return message;
|
|
84811
|
+
}
|
|
84812
|
+
process.stderr.write(`${message}
|
|
84623
84813
|
`);
|
|
84814
|
+
return message;
|
|
84624
84815
|
}
|
|
84625
84816
|
__name(emitLoopDetectedMessage, "emitLoopDetectedMessage");
|
|
84626
84817
|
async function emitNonInteractiveFinalMessage(params) {
|
|
@@ -84967,6 +85158,8 @@ ${text}
|
|
|
84967
85158
|
let structuredSubmission = void 0;
|
|
84968
85159
|
let plainTextPreview = "";
|
|
84969
85160
|
const PLAIN_TEXT_PREVIEW_LIMIT = 200;
|
|
85161
|
+
let loopDetected = false;
|
|
85162
|
+
let loopDetectedMessage = formatLoopDetectedMessage(void 0);
|
|
84970
85163
|
const emitStructuredSuccess = /* @__PURE__ */ __name(async () => {
|
|
84971
85164
|
registry2.abortAll();
|
|
84972
85165
|
const holdbackDeadline = Date.now() + STRUCTURED_SHUTDOWN_HOLDBACK_MS;
|
|
@@ -84989,6 +85182,27 @@ ${text}
|
|
|
84989
85182
|
});
|
|
84990
85183
|
return 0;
|
|
84991
85184
|
}, "emitStructuredSuccess");
|
|
85185
|
+
const emitLoopDetectedResult = /* @__PURE__ */ __name(() => {
|
|
85186
|
+
registry2.abortAll();
|
|
85187
|
+
flushQueuedNotificationsToSdk(localQueue);
|
|
85188
|
+
finalizeOneShotMonitors();
|
|
85189
|
+
if (outputFormat === "text" /* TEXT */) {
|
|
85190
|
+
return 1;
|
|
85191
|
+
}
|
|
85192
|
+
const metrics = uiTelemetryService.getMetrics();
|
|
85193
|
+
const usage3 = computeUsageFromMetrics(metrics);
|
|
85194
|
+
const stats = outputFormat === "json" /* JSON */ ? uiTelemetryService.getMetrics() : void 0;
|
|
85195
|
+
adapter.emitResult({
|
|
85196
|
+
isError: true,
|
|
85197
|
+
durationMs: Date.now() - startTime,
|
|
85198
|
+
apiDurationMs: totalApiDurationMs,
|
|
85199
|
+
numTurns: turnCount,
|
|
85200
|
+
errorMessage: loopDetectedMessage,
|
|
85201
|
+
usage: usage3,
|
|
85202
|
+
stats
|
|
85203
|
+
});
|
|
85204
|
+
return 1;
|
|
85205
|
+
}, "emitLoopDetectedResult");
|
|
84992
85206
|
const handledProviderToolCallIds = geminiClient.getHistoryFunctionResponseIds();
|
|
84993
85207
|
const processToolCallBatch = /* @__PURE__ */ __name(async (batchRequests, setModelOverride) => {
|
|
84994
85208
|
const toolResponseParts = [];
|
|
@@ -85185,7 +85399,13 @@ ${text}
|
|
|
85185
85399
|
plainTextPreview += String(event.value).slice(0, remaining);
|
|
85186
85400
|
}
|
|
85187
85401
|
if (event.type === "loop_detected" /* LoopDetected */) {
|
|
85188
|
-
|
|
85402
|
+
if (!loopDetected) {
|
|
85403
|
+
loopDetectedMessage = emitLoopDetectedMessage(
|
|
85404
|
+
config,
|
|
85405
|
+
event.value?.loopType
|
|
85406
|
+
);
|
|
85407
|
+
}
|
|
85408
|
+
loopDetected = true;
|
|
85189
85409
|
}
|
|
85190
85410
|
if (outputFormat === "text" /* TEXT */ && event.type === "error" /* Error */) {
|
|
85191
85411
|
const errorText = parseAndFormatApiError(
|
|
@@ -85199,6 +85419,9 @@ ${text}
|
|
|
85199
85419
|
}
|
|
85200
85420
|
adapter.finalizeAssistantMessage();
|
|
85201
85421
|
totalApiDurationMs += Date.now() - apiStartTime;
|
|
85422
|
+
if (loopDetected) {
|
|
85423
|
+
return emitLoopDetectedResult();
|
|
85424
|
+
}
|
|
85202
85425
|
if (toolCallRequests.length > 0) {
|
|
85203
85426
|
const toolResponseParts = await processToolCallBatch(
|
|
85204
85427
|
toolCallRequests,
|
|
@@ -85310,7 +85533,13 @@ ${text}
|
|
|
85310
85533
|
itemToolCallRequests.push(event.value);
|
|
85311
85534
|
}
|
|
85312
85535
|
if (event.type === "loop_detected" /* LoopDetected */) {
|
|
85313
|
-
|
|
85536
|
+
if (!loopDetected) {
|
|
85537
|
+
loopDetectedMessage = emitLoopDetectedMessage(
|
|
85538
|
+
config,
|
|
85539
|
+
event.value?.loopType
|
|
85540
|
+
);
|
|
85541
|
+
}
|
|
85542
|
+
loopDetected = true;
|
|
85314
85543
|
}
|
|
85315
85544
|
if (outputFormat === "text" /* TEXT */ && event.type === "error" /* Error */) {
|
|
85316
85545
|
const errorText = parseAndFormatApiError(
|
|
@@ -85324,6 +85553,9 @@ ${text}
|
|
|
85324
85553
|
}
|
|
85325
85554
|
adapter.finalizeAssistantMessage();
|
|
85326
85555
|
totalApiDurationMs += Date.now() - itemApiStartTime;
|
|
85556
|
+
if (loopDetected) {
|
|
85557
|
+
return;
|
|
85558
|
+
}
|
|
85327
85559
|
if (itemToolCallRequests.length > 0) {
|
|
85328
85560
|
const itemToolResponseParts = await processToolCallBatch(
|
|
85329
85561
|
itemToolCallRequests,
|
|
@@ -85345,6 +85577,7 @@ ${text}
|
|
|
85345
85577
|
if (drainPromise) return drainPromise;
|
|
85346
85578
|
const p = (async () => {
|
|
85347
85579
|
while (localQueue.length > 0) {
|
|
85580
|
+
if (loopDetected) return;
|
|
85348
85581
|
if (structuredSubmission !== void 0) return;
|
|
85349
85582
|
await drainBatch();
|
|
85350
85583
|
}
|
|
@@ -85375,6 +85608,12 @@ ${text}
|
|
|
85375
85608
|
once: true
|
|
85376
85609
|
});
|
|
85377
85610
|
const checkCronDone = /* @__PURE__ */ __name(() => {
|
|
85611
|
+
if (loopDetected) {
|
|
85612
|
+
abortController.signal.removeEventListener("abort", onAbort);
|
|
85613
|
+
scheduler.stop();
|
|
85614
|
+
resolve23();
|
|
85615
|
+
return;
|
|
85616
|
+
}
|
|
85378
85617
|
if (structuredSubmission !== void 0) {
|
|
85379
85618
|
abortController.signal.removeEventListener("abort", onAbort);
|
|
85380
85619
|
scheduler.stop();
|
|
@@ -85413,6 +85652,7 @@ ${text}
|
|
|
85413
85652
|
}
|
|
85414
85653
|
captureMonitorTurnsInLocalQueue = false;
|
|
85415
85654
|
await drainLocalQueue();
|
|
85655
|
+
if (loopDetected) return emitLoopDetectedResult();
|
|
85416
85656
|
if (structuredSubmission !== void 0) break;
|
|
85417
85657
|
if (!registry2.hasUnfinalizedTasks() && localQueue.length === 0)
|
|
85418
85658
|
break;
|
|
@@ -85999,7 +86239,7 @@ var SystemController = class extends BaseController {
|
|
|
85999
86239
|
throw new Error("Request aborted");
|
|
86000
86240
|
}
|
|
86001
86241
|
try {
|
|
86002
|
-
const mod = await import("./chunks/contextCommand-
|
|
86242
|
+
const mod = await import("./chunks/contextCommand-WBVNKL2C.js");
|
|
86003
86243
|
if (signal.aborted) {
|
|
86004
86244
|
throw new Error("Request aborted");
|
|
86005
86245
|
}
|
|
@@ -90925,6 +91165,13 @@ function isSafeOscScheme(url) {
|
|
|
90925
91165
|
return SAFE_OSC8_SCHEMES.has(match[1].toLowerCase());
|
|
90926
91166
|
}
|
|
90927
91167
|
__name(isSafeOscScheme, "isSafeOscScheme");
|
|
91168
|
+
function shouldForceHyperlinks(value) {
|
|
91169
|
+
if (value.length === 0) return true;
|
|
91170
|
+
const trimmed = value.trim();
|
|
91171
|
+
if (!/^[+-]?\d+$/.test(trimmed)) return false;
|
|
91172
|
+
return Number(trimmed) !== 0;
|
|
91173
|
+
}
|
|
91174
|
+
__name(shouldForceHyperlinks, "shouldForceHyperlinks");
|
|
90928
91175
|
function parseVersion(versionString) {
|
|
90929
91176
|
if (!versionString) return { major: 0, minor: 0, patch: 0 };
|
|
90930
91177
|
if (/^\d{3,4}$/.test(versionString)) {
|
|
@@ -90945,8 +91192,7 @@ function supportsHyperlinks(stream = process.stdout) {
|
|
|
90945
91192
|
if (!stream || !stream.isTTY) return false;
|
|
90946
91193
|
const force = env5["FORCE_HYPERLINK"];
|
|
90947
91194
|
if (force !== void 0) {
|
|
90948
|
-
|
|
90949
|
-
return parseInt(force, 10) !== 0;
|
|
91195
|
+
return shouldForceHyperlinks(force);
|
|
90950
91196
|
}
|
|
90951
91197
|
if (env5["CI"]) return false;
|
|
90952
91198
|
if (env5["TEAMCITY_VERSION"]) return false;
|
|
@@ -107433,8 +107679,8 @@ function SettingsDialog({
|
|
|
107433
107679
|
}
|
|
107434
107680
|
} else if (item.type === "number" || item.type === "string") {
|
|
107435
107681
|
const isSubDialogSetting = item.value === "ui.theme" || item.value === "general.preferredEditor" || item.value === "fastModel";
|
|
107436
|
-
const
|
|
107437
|
-
const currentValue = getNestedValue(pendingSettings,
|
|
107682
|
+
const path63 = item.value.split(".");
|
|
107683
|
+
const currentValue = getNestedValue(pendingSettings, path63);
|
|
107438
107684
|
const defaultValue2 = getDefaultValue(item.value);
|
|
107439
107685
|
if (currentValue !== void 0 && currentValue !== null) {
|
|
107440
107686
|
displayValue = String(currentValue);
|
|
@@ -111005,11 +111251,11 @@ function buildModelSelectionKey(authType, modelId, baseUrl) {
|
|
|
111005
111251
|
}
|
|
111006
111252
|
__name(buildModelSelectionKey, "buildModelSelectionKey");
|
|
111007
111253
|
function parseModelSelectionKey(key) {
|
|
111008
|
-
const
|
|
111009
|
-
const idx = key.indexOf(
|
|
111254
|
+
const sep6 = "::";
|
|
111255
|
+
const idx = key.indexOf(sep6);
|
|
111010
111256
|
if (idx < 0) return { authType: "", modelId: key };
|
|
111011
111257
|
const authType = key.slice(0, idx);
|
|
111012
|
-
const rest = key.slice(idx +
|
|
111258
|
+
const rest = key.slice(idx + sep6.length);
|
|
111013
111259
|
const nullIdx = rest.indexOf("\0");
|
|
111014
111260
|
if (nullIdx >= 0) {
|
|
111015
111261
|
return {
|
|
@@ -116307,6 +116553,14 @@ var ServerDetailStep = /* @__PURE__ */ __name(({
|
|
|
116307
116553
|
] })
|
|
116308
116554
|
] }) })
|
|
116309
116555
|
] }),
|
|
116556
|
+
!server.isDisabled && server.promptCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
116557
|
+
/* @__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:") }) }),
|
|
116558
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { children: server.promptCount }) })
|
|
116559
|
+
] }),
|
|
116560
|
+
!server.isDisabled && server.resourceCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
116561
|
+
/* @__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:") }) }),
|
|
116562
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { children: server.resourceCount }) })
|
|
116563
|
+
] }),
|
|
116310
116564
|
server.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
116311
116565
|
/* @__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
116566
|
/* @__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 +116981,7 @@ var McpServerActionsView = /* @__PURE__ */ __name(({
|
|
|
116727
116981
|
const serverPrompts = (promptRegistry?.getAllPrompts() || []).filter(
|
|
116728
116982
|
(p) => "serverName" in p && p.serverName === serverName
|
|
116729
116983
|
);
|
|
116984
|
+
const serverResources = config.getResourceRegistry()?.getResourcesByServer(serverName) || [];
|
|
116730
116985
|
let source = "user";
|
|
116731
116986
|
if (serverConfig.extensionName) {
|
|
116732
116987
|
source = "extension";
|
|
@@ -116752,6 +117007,7 @@ var McpServerActionsView = /* @__PURE__ */ __name(({
|
|
|
116752
117007
|
toolCount: serverTools.length,
|
|
116753
117008
|
invalidToolCount: serverTools.filter((x) => !x.name || !x.description).length,
|
|
116754
117009
|
promptCount: serverPrompts.length,
|
|
117010
|
+
resourceCount: serverResources.length,
|
|
116755
117011
|
isDisabled: config.isMcpServerDisabled(serverName),
|
|
116756
117012
|
hasOAuthTokens,
|
|
116757
117013
|
// Needs (re-)authentication: a 401 during connect, or OAuth declared
|
|
@@ -118853,6 +119109,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
|
|
|
118853
119109
|
const mcpServers = config.getMcpServers() || {};
|
|
118854
119110
|
const toolRegistry = config.getToolRegistry();
|
|
118855
119111
|
const promptRegistry = config.getPromptRegistry();
|
|
119112
|
+
const resourceRegistry = config.getResourceRegistry();
|
|
118856
119113
|
const serverInfos = [];
|
|
118857
119114
|
for (const [name, serverConfig] of Object.entries(mcpServers)) {
|
|
118858
119115
|
const status = getMCPServerStatus(name);
|
|
@@ -118864,6 +119121,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
|
|
|
118864
119121
|
const serverPrompts = allPrompts.filter(
|
|
118865
119122
|
(p) => "serverName" in p && p.serverName === name
|
|
118866
119123
|
);
|
|
119124
|
+
const serverResources = resourceRegistry?.getResourcesByServer(name) || [];
|
|
118867
119125
|
let source = "user";
|
|
118868
119126
|
if (serverConfig.extensionName) {
|
|
118869
119127
|
source = "extension";
|
|
@@ -118894,6 +119152,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
|
|
|
118894
119152
|
toolCount: serverTools.length,
|
|
118895
119153
|
invalidToolCount,
|
|
118896
119154
|
promptCount: serverPrompts.length,
|
|
119155
|
+
resourceCount: serverResources.length,
|
|
118897
119156
|
isDisabled,
|
|
118898
119157
|
hasOAuthTokens,
|
|
118899
119158
|
requiresAuth
|
|
@@ -122335,21 +122594,43 @@ function SessionPreview(props) {
|
|
|
122335
122594
|
metaParts.push(gitBranch);
|
|
122336
122595
|
}
|
|
122337
122596
|
const metaLine = metaParts.join(" \xB7 ");
|
|
122338
|
-
|
|
122339
|
-
|
|
122340
|
-
|
|
122341
|
-
|
|
122342
|
-
|
|
122597
|
+
const header = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { bold: true, color: theme.text.primary, children: sessionTitle ?? t("Session Preview") }) }, "header");
|
|
122598
|
+
const topSeparator = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { color: theme.border.default, children: "\u2500".repeat(separatorWidth) }) }, "top-separator");
|
|
122599
|
+
const footerSeparator = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { color: theme.border.default, children: "\u2500".repeat(separatorWidth) }) }, "footer-separator");
|
|
122600
|
+
const meta = metaLine ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { color: theme.text.secondary, children: metaLine }) }, "meta") : null;
|
|
122601
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { color: theme.text.secondary, children: t("Enter to resume \xB7 Esc to back") }) }, "footer");
|
|
122602
|
+
if (data && !error) {
|
|
122603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { flexDirection: "column", width: boxWidth, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
122604
|
+
Static,
|
|
122343
122605
|
{
|
|
122344
|
-
|
|
122345
|
-
|
|
122346
|
-
|
|
122606
|
+
items: [
|
|
122607
|
+
header,
|
|
122608
|
+
topSeparator,
|
|
122609
|
+
...items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
122610
|
+
HistoryItemDisplayComponent,
|
|
122611
|
+
{
|
|
122612
|
+
item,
|
|
122613
|
+
terminalWidth: boxWidth,
|
|
122614
|
+
isPending: false
|
|
122615
|
+
},
|
|
122616
|
+
item.id
|
|
122617
|
+
)),
|
|
122618
|
+
footerSeparator,
|
|
122619
|
+
...meta ? [meta] : [],
|
|
122620
|
+
footer
|
|
122621
|
+
],
|
|
122622
|
+
children: (item) => item
|
|
122347
122623
|
},
|
|
122348
|
-
|
|
122349
|
-
)
|
|
122350
|
-
|
|
122351
|
-
|
|
122352
|
-
|
|
122624
|
+
sessionId
|
|
122625
|
+
) });
|
|
122626
|
+
}
|
|
122627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(Box_default, { flexDirection: "column", width: boxWidth, children: [
|
|
122628
|
+
header,
|
|
122629
|
+
topSeparator,
|
|
122630
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { paddingY: 1, justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { color: theme.status.error, children: error }) }) : /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Box_default, { paddingY: 1, justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Text, { color: theme.text.secondary, children: t("Loading session preview...") }) }),
|
|
122631
|
+
footerSeparator,
|
|
122632
|
+
meta,
|
|
122633
|
+
footer
|
|
122353
122634
|
] });
|
|
122354
122635
|
}
|
|
122355
122636
|
__name(SessionPreview, "SessionPreview");
|
|
@@ -123438,7 +123719,7 @@ function FileRow({
|
|
|
123438
123719
|
}) {
|
|
123439
123720
|
const pointer = selected ? "\u203A " : " ";
|
|
123440
123721
|
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
|
|
123722
|
+
const path63 = truncatePathStart(file.displayPath, maxPathChars);
|
|
123442
123723
|
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
123443
123724
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
123444
123725
|
Text,
|
|
@@ -123447,7 +123728,7 @@ function FileRow({
|
|
|
123447
123728
|
bold: selected,
|
|
123448
123729
|
children: [
|
|
123449
123730
|
pointer,
|
|
123450
|
-
|
|
123731
|
+
path63
|
|
123451
123732
|
]
|
|
123452
123733
|
}
|
|
123453
123734
|
),
|
|
@@ -123512,11 +123793,11 @@ function FileDetail({
|
|
|
123512
123793
|
] });
|
|
123513
123794
|
}
|
|
123514
123795
|
__name(FileDetail, "FileDetail");
|
|
123515
|
-
function truncatePathStart(
|
|
123796
|
+
function truncatePathStart(path63, maxChars) {
|
|
123516
123797
|
if (maxChars <= 0) return "";
|
|
123517
|
-
if (
|
|
123518
|
-
if (maxChars <= 1) return
|
|
123519
|
-
return "\u2026" +
|
|
123798
|
+
if (path63.length <= maxChars) return path63;
|
|
123799
|
+
if (maxChars <= 1) return path63.slice(-maxChars);
|
|
123800
|
+
return "\u2026" + path63.slice(-(maxChars - 1));
|
|
123520
123801
|
}
|
|
123521
123802
|
__name(truncatePathStart, "truncatePathStart");
|
|
123522
123803
|
function useVisibleWindow(total, selectedIndex, windowSize) {
|
|
@@ -123533,18 +123814,18 @@ __name(useVisibleWindow, "useVisibleWindow");
|
|
|
123533
123814
|
function currentToFiles(result, hunks) {
|
|
123534
123815
|
if (!result) return [];
|
|
123535
123816
|
const out = [];
|
|
123536
|
-
for (const [
|
|
123537
|
-
out.push(perFileToUnified(
|
|
123817
|
+
for (const [path63, s] of result.perFileStats) {
|
|
123818
|
+
out.push(perFileToUnified(path63, s, hunks));
|
|
123538
123819
|
}
|
|
123539
123820
|
out.sort((a, b) => a.path.localeCompare(b.path));
|
|
123540
123821
|
return out;
|
|
123541
123822
|
}
|
|
123542
123823
|
__name(currentToFiles, "currentToFiles");
|
|
123543
|
-
function perFileToUnified(
|
|
123544
|
-
const fileHunks = hunks.get(
|
|
123824
|
+
function perFileToUnified(path63, s, hunks) {
|
|
123825
|
+
const fileHunks = hunks.get(path63);
|
|
123545
123826
|
return {
|
|
123546
|
-
path:
|
|
123547
|
-
displayPath: sanitizeFilenameForDisplay(
|
|
123827
|
+
path: path63,
|
|
123828
|
+
displayPath: sanitizeFilenameForDisplay(path63),
|
|
123548
123829
|
added: s.added ?? 0,
|
|
123549
123830
|
removed: s.isUntracked ? 0 : s.removed ?? 0,
|
|
123550
123831
|
isBinary: !!s.isBinary,
|
|
@@ -126391,6 +126672,27 @@ var import_react163 = __toESM(require_react(), 1);
|
|
|
126391
126672
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
126392
126673
|
init_esbuild_shims();
|
|
126393
126674
|
var import_react161 = __toESM(require_react(), 1);
|
|
126675
|
+
function getMcpResourceSuggestions(config, pattern) {
|
|
126676
|
+
if (!config) return null;
|
|
126677
|
+
if (config.isTrustedFolder?.() === false) return null;
|
|
126678
|
+
const mcpServers = config.getMcpServers?.() || {};
|
|
126679
|
+
const match = matchMcpServerPrefix(pattern, Object.keys(mcpServers));
|
|
126680
|
+
if (!match) return null;
|
|
126681
|
+
const serverName = match.serverName;
|
|
126682
|
+
const partialUri = match.rest;
|
|
126683
|
+
const resources = config.getResourceRegistry?.()?.getResourcesByServer(serverName) ?? [];
|
|
126684
|
+
const matches = resources.filter((r) => r.uri.includes(partialUri)).sort((a, b) => {
|
|
126685
|
+
const aPrefix = a.uri.startsWith(partialUri) ? 0 : 1;
|
|
126686
|
+
const bPrefix = b.uri.startsWith(partialUri) ? 0 : 1;
|
|
126687
|
+
return aPrefix - bPrefix || a.uri.localeCompare(b.uri);
|
|
126688
|
+
});
|
|
126689
|
+
return matches.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3).map((r) => ({
|
|
126690
|
+
label: `${serverName}:${r.uri}`,
|
|
126691
|
+
value: `${serverName}:${r.uri}`,
|
|
126692
|
+
isDirectory: false
|
|
126693
|
+
}));
|
|
126694
|
+
}
|
|
126695
|
+
__name(getMcpResourceSuggestions, "getMcpResourceSuggestions");
|
|
126394
126696
|
var initialState = {
|
|
126395
126697
|
status: "idle" /* IDLE */,
|
|
126396
126698
|
suggestions: [],
|
|
@@ -126517,7 +126819,21 @@ function useAtCompletion(props) {
|
|
|
126517
126819
|
}
|
|
126518
126820
|
}, "initialize");
|
|
126519
126821
|
const search = /* @__PURE__ */ __name(async () => {
|
|
126520
|
-
if (
|
|
126822
|
+
if (state2.pattern === null) {
|
|
126823
|
+
return;
|
|
126824
|
+
}
|
|
126825
|
+
const resourceSuggestions = getMcpResourceSuggestions(
|
|
126826
|
+
config,
|
|
126827
|
+
state2.pattern
|
|
126828
|
+
);
|
|
126829
|
+
if (resourceSuggestions !== null) {
|
|
126830
|
+
if (slowSearchTimer.current) {
|
|
126831
|
+
clearTimeout(slowSearchTimer.current);
|
|
126832
|
+
}
|
|
126833
|
+
dispatch({ type: "SEARCH_SUCCESS", payload: resourceSuggestions });
|
|
126834
|
+
return;
|
|
126835
|
+
}
|
|
126836
|
+
if (!fileSearch.current) {
|
|
126521
126837
|
return;
|
|
126522
126838
|
}
|
|
126523
126839
|
if (slowSearchTimer.current) {
|
|
@@ -128354,7 +128670,7 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
128354
128670
|
borderColor: resolvedBorderColor,
|
|
128355
128671
|
children: [
|
|
128356
128672
|
resolvedPrefix,
|
|
128357
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Box_default, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(Text, { children: [
|
|
128673
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Box_default, { flexGrow: 1, flexDirection: "column", backgroundColor: theme.background.primary, children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(Text, { children: [
|
|
128358
128674
|
import_chalk9.default.inverse(placeholder.slice(0, 1)),
|
|
128359
128675
|
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Text, { color: theme.text.secondary, children: placeholder.slice(1) })
|
|
128360
128676
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Text, { color: theme.text.secondary, children: placeholder }) : linesToRender.map((lineText, idx) => {
|
|
@@ -133132,6 +133448,31 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, history
|
|
|
133132
133448
|
})();
|
|
133133
133449
|
};
|
|
133134
133450
|
}, [config, reloadCommands]);
|
|
133451
|
+
(0, import_react199.useEffect)(() => {
|
|
133452
|
+
if (!config) {
|
|
133453
|
+
return;
|
|
133454
|
+
}
|
|
133455
|
+
let timer = null;
|
|
133456
|
+
const listener = /* @__PURE__ */ __name((_serverName, status) => {
|
|
133457
|
+
if (status !== "connected" /* CONNECTED */) {
|
|
133458
|
+
return;
|
|
133459
|
+
}
|
|
133460
|
+
if (timer) {
|
|
133461
|
+
clearTimeout(timer);
|
|
133462
|
+
}
|
|
133463
|
+
timer = setTimeout(() => {
|
|
133464
|
+
timer = null;
|
|
133465
|
+
reloadCommands();
|
|
133466
|
+
}, 250);
|
|
133467
|
+
}, "listener");
|
|
133468
|
+
addMCPStatusChangeListener(listener);
|
|
133469
|
+
return () => {
|
|
133470
|
+
removeMCPStatusChangeListener(listener);
|
|
133471
|
+
if (timer) {
|
|
133472
|
+
clearTimeout(timer);
|
|
133473
|
+
}
|
|
133474
|
+
};
|
|
133475
|
+
}, [config, reloadCommands]);
|
|
133135
133476
|
(0, import_react199.useEffect)(() => {
|
|
133136
133477
|
if (!isConfigInitialized) {
|
|
133137
133478
|
return;
|
|
@@ -133731,7 +134072,7 @@ function useDoublePress(onDoublePress, onPending) {
|
|
|
133731
134072
|
__name(useDoublePress, "useDoublePress");
|
|
133732
134073
|
|
|
133733
134074
|
// packages/cli/src/ui/AppContainer.tsx
|
|
133734
|
-
import * as
|
|
134075
|
+
import * as fs51 from "node:fs";
|
|
133735
134076
|
import { basename as basename12 } from "node:path";
|
|
133736
134077
|
|
|
133737
134078
|
// packages/cli/src/utils/windowTitle.ts
|
|
@@ -139213,12 +139554,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
|
|
|
139213
139554
|
"constructor"
|
|
139214
139555
|
]);
|
|
139215
139556
|
var digits = new Set("0123456789");
|
|
139216
|
-
function getPathSegments(
|
|
139557
|
+
function getPathSegments(path63) {
|
|
139217
139558
|
const parts = [];
|
|
139218
139559
|
let currentSegment = "";
|
|
139219
139560
|
let currentPart = "start";
|
|
139220
139561
|
let isIgnoring = false;
|
|
139221
|
-
for (const character of
|
|
139562
|
+
for (const character of path63) {
|
|
139222
139563
|
switch (character) {
|
|
139223
139564
|
case "\\": {
|
|
139224
139565
|
if (currentPart === "index") {
|
|
@@ -139343,11 +139684,11 @@ function assertNotStringIndex(object, key) {
|
|
|
139343
139684
|
}
|
|
139344
139685
|
}
|
|
139345
139686
|
__name(assertNotStringIndex, "assertNotStringIndex");
|
|
139346
|
-
function getProperty(object,
|
|
139347
|
-
if (!isObject(object) || typeof
|
|
139687
|
+
function getProperty(object, path63, value) {
|
|
139688
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139348
139689
|
return value === void 0 ? object : value;
|
|
139349
139690
|
}
|
|
139350
|
-
const pathArray = getPathSegments(
|
|
139691
|
+
const pathArray = getPathSegments(path63);
|
|
139351
139692
|
if (pathArray.length === 0) {
|
|
139352
139693
|
return value;
|
|
139353
139694
|
}
|
|
@@ -139368,12 +139709,12 @@ function getProperty(object, path64, value) {
|
|
|
139368
139709
|
return object === void 0 ? value : object;
|
|
139369
139710
|
}
|
|
139370
139711
|
__name(getProperty, "getProperty");
|
|
139371
|
-
function setProperty(object,
|
|
139372
|
-
if (!isObject(object) || typeof
|
|
139712
|
+
function setProperty(object, path63, value) {
|
|
139713
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139373
139714
|
return object;
|
|
139374
139715
|
}
|
|
139375
139716
|
const root = object;
|
|
139376
|
-
const pathArray = getPathSegments(
|
|
139717
|
+
const pathArray = getPathSegments(path63);
|
|
139377
139718
|
for (let index = 0; index < pathArray.length; index++) {
|
|
139378
139719
|
const key = pathArray[index];
|
|
139379
139720
|
assertNotStringIndex(object, key);
|
|
@@ -139387,11 +139728,11 @@ function setProperty(object, path64, value) {
|
|
|
139387
139728
|
return root;
|
|
139388
139729
|
}
|
|
139389
139730
|
__name(setProperty, "setProperty");
|
|
139390
|
-
function deleteProperty(object,
|
|
139391
|
-
if (!isObject(object) || typeof
|
|
139731
|
+
function deleteProperty(object, path63) {
|
|
139732
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139392
139733
|
return false;
|
|
139393
139734
|
}
|
|
139394
|
-
const pathArray = getPathSegments(
|
|
139735
|
+
const pathArray = getPathSegments(path63);
|
|
139395
139736
|
for (let index = 0; index < pathArray.length; index++) {
|
|
139396
139737
|
const key = pathArray[index];
|
|
139397
139738
|
assertNotStringIndex(object, key);
|
|
@@ -139406,11 +139747,11 @@ function deleteProperty(object, path64) {
|
|
|
139406
139747
|
}
|
|
139407
139748
|
}
|
|
139408
139749
|
__name(deleteProperty, "deleteProperty");
|
|
139409
|
-
function hasProperty(object,
|
|
139410
|
-
if (!isObject(object) || typeof
|
|
139750
|
+
function hasProperty(object, path63) {
|
|
139751
|
+
if (!isObject(object) || typeof path63 !== "string") {
|
|
139411
139752
|
return false;
|
|
139412
139753
|
}
|
|
139413
|
-
const pathArray = getPathSegments(
|
|
139754
|
+
const pathArray = getPathSegments(path63);
|
|
139414
139755
|
if (pathArray.length === 0) {
|
|
139415
139756
|
return false;
|
|
139416
139757
|
}
|
|
@@ -142166,60 +142507,33 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
142166
142507
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
142167
142508
|
init_esbuild_shims();
|
|
142168
142509
|
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
142510
|
function useGitBranchName(cwd5) {
|
|
142173
142511
|
const [branchName, setBranchName] = (0, import_react217.useState)(void 0);
|
|
142174
142512
|
(0, import_react217.useEffect)(() => {
|
|
142175
142513
|
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
|
-
}
|
|
142514
|
+
let dispose;
|
|
142515
|
+
const refresh = /* @__PURE__ */ __name(async () => {
|
|
142516
|
+
const name = await resolveBranchName(cwd5);
|
|
142517
|
+
if (!cancelled) setBranchName(name);
|
|
142518
|
+
}, "refresh");
|
|
142519
|
+
const init = /* @__PURE__ */ __name(async () => {
|
|
142520
|
+
await refresh();
|
|
142521
|
+
if (cancelled) return;
|
|
142522
|
+
const disposer = await watchRepoBranch(cwd5, () => {
|
|
142523
|
+
void refresh().catch(() => {
|
|
142215
142524
|
});
|
|
142216
|
-
}
|
|
142525
|
+
});
|
|
142526
|
+
if (cancelled) {
|
|
142527
|
+
disposer();
|
|
142528
|
+
} else {
|
|
142529
|
+
dispose = disposer;
|
|
142217
142530
|
}
|
|
142218
|
-
}, "
|
|
142219
|
-
|
|
142531
|
+
}, "init");
|
|
142532
|
+
void init().catch(() => {
|
|
142533
|
+
});
|
|
142220
142534
|
return () => {
|
|
142221
142535
|
cancelled = true;
|
|
142222
|
-
|
|
142536
|
+
dispose?.();
|
|
142223
142537
|
};
|
|
142224
142538
|
}, [cwd5]);
|
|
142225
142539
|
return branchName;
|
|
@@ -142229,9 +142543,9 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
142229
142543
|
// packages/cli/src/ui/hooks/useWorktreeSession.ts
|
|
142230
142544
|
init_esbuild_shims();
|
|
142231
142545
|
var import_react218 = __toESM(require_react(), 1);
|
|
142232
|
-
import
|
|
142233
|
-
import
|
|
142234
|
-
import
|
|
142546
|
+
import fs50 from "node:fs";
|
|
142547
|
+
import fsPromises2 from "node:fs/promises";
|
|
142548
|
+
import path57 from "node:path";
|
|
142235
142549
|
function useWorktreeSession(config) {
|
|
142236
142550
|
const [session2, setSession] = (0, import_react218.useState)(null);
|
|
142237
142551
|
(0, import_react218.useEffect)(() => {
|
|
@@ -142247,14 +142561,14 @@ function useWorktreeSession(config) {
|
|
|
142247
142561
|
}, "safeLoad");
|
|
142248
142562
|
void safeLoad();
|
|
142249
142563
|
const filePath = config.getSessionService().getWorktreeSessionPath(config.getSessionId());
|
|
142250
|
-
const dirPath =
|
|
142251
|
-
const fileName =
|
|
142564
|
+
const dirPath = path57.dirname(filePath);
|
|
142565
|
+
const fileName = path57.basename(filePath);
|
|
142252
142566
|
let watcher;
|
|
142253
142567
|
const setupWatcher = /* @__PURE__ */ __name(async () => {
|
|
142254
142568
|
try {
|
|
142255
|
-
await
|
|
142569
|
+
await fsPromises2.mkdir(dirPath, { recursive: true });
|
|
142256
142570
|
if (cancelled) return;
|
|
142257
|
-
watcher =
|
|
142571
|
+
watcher = fs50.watch(dirPath, (_eventType, filename) => {
|
|
142258
142572
|
if (filename === null || filename.toString() === fileName) {
|
|
142259
142573
|
void safeLoad();
|
|
142260
142574
|
}
|
|
@@ -143608,7 +143922,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
143608
143922
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
143609
143923
|
const isValidPath = (0, import_react234.useCallback)((filePath) => {
|
|
143610
143924
|
try {
|
|
143611
|
-
return
|
|
143925
|
+
return fs51.existsSync(filePath) && fs51.statSync(filePath).isFile();
|
|
143612
143926
|
} catch (_e) {
|
|
143613
143927
|
return false;
|
|
143614
143928
|
}
|
|
@@ -145961,8 +146275,8 @@ init_esbuild_shims();
|
|
|
145961
146275
|
var import_shell_quote = __toESM(require_shell_quote(), 1);
|
|
145962
146276
|
import { exec as exec7, execSync as execSync5, spawn as spawn8 } from "node:child_process";
|
|
145963
146277
|
import os30 from "node:os";
|
|
145964
|
-
import
|
|
145965
|
-
import
|
|
146278
|
+
import path59 from "node:path";
|
|
146279
|
+
import fs52 from "node:fs";
|
|
145966
146280
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
145967
146281
|
import { promisify as promisify8 } from "node:util";
|
|
145968
146282
|
import { randomBytes } from "node:crypto";
|
|
@@ -145983,10 +146297,10 @@ __name(parseSandboxImageName, "parseSandboxImageName");
|
|
|
145983
146297
|
|
|
145984
146298
|
// packages/cli/src/utils/sandbox-path.ts
|
|
145985
146299
|
init_esbuild_shims();
|
|
145986
|
-
import
|
|
146300
|
+
import path58 from "node:path";
|
|
145987
146301
|
function isContainerPathWithinWorkdir(containerWorkdir, containerPath) {
|
|
145988
146302
|
const normalize5 = /* @__PURE__ */ __name((value) => {
|
|
145989
|
-
const normalized =
|
|
146303
|
+
const normalized = path58.posix.normalize(value.replace(/\\/g, "/")).replace(/\/+$/, "").toLowerCase();
|
|
145990
146304
|
return normalized || "/";
|
|
145991
146305
|
}, "normalize");
|
|
145992
146306
|
const normalizedWorkdir = normalize5(containerWorkdir);
|
|
@@ -146030,10 +146344,10 @@ function getContainerPath(hostPath) {
|
|
|
146030
146344
|
}
|
|
146031
146345
|
__name(getContainerPath, "getContainerPath");
|
|
146032
146346
|
function ensureDirectoryAndGetRealPath(dir) {
|
|
146033
|
-
if (!
|
|
146034
|
-
|
|
146347
|
+
if (!fs52.existsSync(dir)) {
|
|
146348
|
+
fs52.mkdirSync(dir, { recursive: true });
|
|
146035
146349
|
}
|
|
146036
|
-
return
|
|
146350
|
+
return fs52.realpathSync(dir);
|
|
146037
146351
|
}
|
|
146038
146352
|
__name(ensureDirectoryAndGetRealPath, "ensureDirectoryAndGetRealPath");
|
|
146039
146353
|
var LOCAL_DEV_SANDBOX_IMAGE_NAME = "qwen-code-sandbox";
|
|
@@ -146104,11 +146418,11 @@ function entrypoint(workdir, cliArgs) {
|
|
|
146104
146418
|
if (pythonPathSuffix) {
|
|
146105
146419
|
shellCmds.push(`export PYTHONPATH="$PYTHONPATH${pythonPathSuffix}";`);
|
|
146106
146420
|
}
|
|
146107
|
-
const projectSandboxBashrc =
|
|
146421
|
+
const projectSandboxBashrc = path59.join(
|
|
146108
146422
|
SETTINGS_DIRECTORY_NAME,
|
|
146109
146423
|
"sandbox.bashrc"
|
|
146110
146424
|
);
|
|
146111
|
-
if (
|
|
146425
|
+
if (fs52.existsSync(projectSandboxBashrc)) {
|
|
146112
146426
|
shellCmds.push(`source ${getContainerPath(projectSandboxBashrc)};`);
|
|
146113
146427
|
}
|
|
146114
146428
|
ports().forEach(
|
|
@@ -146134,12 +146448,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146134
146448
|
new URL(`sandbox-macos-${profile}.sb`, import.meta.url)
|
|
146135
146449
|
);
|
|
146136
146450
|
if (!BUILTIN_SEATBELT_PROFILES.includes(profile)) {
|
|
146137
|
-
profileFile =
|
|
146451
|
+
profileFile = path59.join(
|
|
146138
146452
|
SETTINGS_DIRECTORY_NAME,
|
|
146139
146453
|
`sandbox-macos-${profile}.sb`
|
|
146140
146454
|
);
|
|
146141
146455
|
}
|
|
146142
|
-
if (!
|
|
146456
|
+
if (!fs52.existsSync(profileFile)) {
|
|
146143
146457
|
throw new FatalSandboxError(
|
|
146144
146458
|
`Missing macos seatbelt profile file '${profileFile}'`
|
|
146145
146459
|
);
|
|
@@ -146151,30 +146465,30 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146151
146465
|
].join(" ");
|
|
146152
146466
|
const qwenDir = Storage.getGlobalQwenDir();
|
|
146153
146467
|
const runtimeDir = Storage.getRuntimeBaseDir();
|
|
146154
|
-
|
|
146155
|
-
|
|
146468
|
+
fs52.mkdirSync(qwenDir, { recursive: true });
|
|
146469
|
+
fs52.mkdirSync(runtimeDir, { recursive: true });
|
|
146156
146470
|
const args2 = [
|
|
146157
146471
|
"-D",
|
|
146158
|
-
`TARGET_DIR=${
|
|
146472
|
+
`TARGET_DIR=${fs52.realpathSync(process.cwd())}`,
|
|
146159
146473
|
"-D",
|
|
146160
|
-
`TMP_DIR=${
|
|
146474
|
+
`TMP_DIR=${fs52.realpathSync(os30.tmpdir())}`,
|
|
146161
146475
|
"-D",
|
|
146162
|
-
`HOME_DIR=${
|
|
146476
|
+
`HOME_DIR=${fs52.realpathSync(os30.homedir())}`,
|
|
146163
146477
|
"-D",
|
|
146164
|
-
`CACHE_DIR=${
|
|
146478
|
+
`CACHE_DIR=${fs52.realpathSync(execSync5(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`,
|
|
146165
146479
|
"-D",
|
|
146166
|
-
`QWEN_DIR=${
|
|
146480
|
+
`QWEN_DIR=${fs52.realpathSync(qwenDir)}`,
|
|
146167
146481
|
"-D",
|
|
146168
|
-
`RUNTIME_DIR=${
|
|
146482
|
+
`RUNTIME_DIR=${fs52.realpathSync(runtimeDir)}`
|
|
146169
146483
|
];
|
|
146170
146484
|
const MAX_INCLUDE_DIRS = 5;
|
|
146171
|
-
const targetDir =
|
|
146485
|
+
const targetDir = fs52.realpathSync(cliConfig?.getTargetDir() || "");
|
|
146172
146486
|
const includedDirs = [];
|
|
146173
146487
|
if (cliConfig) {
|
|
146174
146488
|
const workspaceContext = cliConfig.getWorkspaceContext();
|
|
146175
146489
|
const directories = workspaceContext.getDirectories();
|
|
146176
146490
|
for (const dir of directories) {
|
|
146177
|
-
const realDir =
|
|
146491
|
+
const realDir = fs52.realpathSync(dir);
|
|
146178
146492
|
if (realDir !== targetDir) {
|
|
146179
146493
|
includedDirs.push(realDir);
|
|
146180
146494
|
}
|
|
@@ -146256,14 +146570,14 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146256
146570
|
});
|
|
146257
146571
|
}
|
|
146258
146572
|
writeStderrLine(`hopping into sandbox (command: ${config.command}) ...`);
|
|
146259
|
-
const gcPath =
|
|
146260
|
-
const projectSandboxDockerfile =
|
|
146573
|
+
const gcPath = fs52.realpathSync(process.argv[1]);
|
|
146574
|
+
const projectSandboxDockerfile = path59.join(
|
|
146261
146575
|
SETTINGS_DIRECTORY_NAME,
|
|
146262
146576
|
"sandbox.Dockerfile"
|
|
146263
146577
|
);
|
|
146264
|
-
const isCustomProjectSandbox =
|
|
146578
|
+
const isCustomProjectSandbox = fs52.existsSync(projectSandboxDockerfile);
|
|
146265
146579
|
const image2 = config.image;
|
|
146266
|
-
const workdir =
|
|
146580
|
+
const workdir = path59.resolve(process.cwd());
|
|
146267
146581
|
const containerWorkdir = getContainerPath(workdir);
|
|
146268
146582
|
if (process.env["BUILD_SANDBOX"]) {
|
|
146269
146583
|
if (!gcPath.includes("qwen-code/packages/")) {
|
|
@@ -146274,13 +146588,13 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146274
146588
|
writeStderrLine("building sandbox ...");
|
|
146275
146589
|
const gcRoot = gcPath.split("/packages/")[0];
|
|
146276
146590
|
let buildArgs = "";
|
|
146277
|
-
const projectSandboxDockerfile2 =
|
|
146591
|
+
const projectSandboxDockerfile2 = path59.join(
|
|
146278
146592
|
SETTINGS_DIRECTORY_NAME,
|
|
146279
146593
|
"sandbox.Dockerfile"
|
|
146280
146594
|
);
|
|
146281
146595
|
if (isCustomProjectSandbox) {
|
|
146282
146596
|
writeStderrLine(`using ${projectSandboxDockerfile2} for sandbox`);
|
|
146283
|
-
buildArgs += `-f ${
|
|
146597
|
+
buildArgs += `-f ${path59.resolve(projectSandboxDockerfile2)} -i ${image2}`;
|
|
146284
146598
|
}
|
|
146285
146599
|
execSync5(
|
|
146286
146600
|
`cd ${gcRoot} && node scripts/build_sandbox.js -s ${buildArgs}`,
|
|
@@ -146356,8 +146670,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146356
146670
|
args.push("--env", `QWEN_RUNTIME_DIR=${runtimeBaseDirContainerPath}`);
|
|
146357
146671
|
}
|
|
146358
146672
|
args.push("--volume", `${os30.tmpdir()}:${getContainerPath(os30.tmpdir())}`);
|
|
146359
|
-
const gcloudConfigDir =
|
|
146360
|
-
if (
|
|
146673
|
+
const gcloudConfigDir = path59.join(os30.homedir(), ".config", "gcloud");
|
|
146674
|
+
if (fs52.existsSync(gcloudConfigDir)) {
|
|
146361
146675
|
args.push(
|
|
146362
146676
|
"--volume",
|
|
146363
146677
|
`${gcloudConfigDir}:${getContainerPath(gcloudConfigDir)}:ro`
|
|
@@ -146365,7 +146679,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146365
146679
|
}
|
|
146366
146680
|
if (process.env["GOOGLE_APPLICATION_CREDENTIALS"]) {
|
|
146367
146681
|
const adcFile = process.env["GOOGLE_APPLICATION_CREDENTIALS"];
|
|
146368
|
-
if (
|
|
146682
|
+
if (fs52.existsSync(adcFile)) {
|
|
146369
146683
|
args.push("--volume", `${adcFile}:${getContainerPath(adcFile)}:ro`);
|
|
146370
146684
|
args.push(
|
|
146371
146685
|
"--env",
|
|
@@ -146378,12 +146692,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146378
146692
|
if (mount.trim()) {
|
|
146379
146693
|
const { from, to, opts } = parseSandboxMountSpec(mount);
|
|
146380
146694
|
mount = `${from}:${to}:${opts}`;
|
|
146381
|
-
if (!
|
|
146695
|
+
if (!path59.isAbsolute(from)) {
|
|
146382
146696
|
throw new FatalSandboxError(
|
|
146383
146697
|
`Path '${from}' listed in SANDBOX_MOUNTS must be absolute`
|
|
146384
146698
|
);
|
|
146385
146699
|
}
|
|
146386
|
-
if (!
|
|
146700
|
+
if (!fs52.existsSync(from)) {
|
|
146387
146701
|
throw new FatalSandboxError(
|
|
146388
146702
|
`Missing mount path '${from}' listed in SANDBOX_MOUNTS`
|
|
146389
146703
|
);
|
|
@@ -146529,12 +146843,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146529
146843
|
getContainerPath(workdir),
|
|
146530
146844
|
getContainerPath(virtualEnv)
|
|
146531
146845
|
)) {
|
|
146532
|
-
const sandboxVenvPath =
|
|
146846
|
+
const sandboxVenvPath = path59.resolve(
|
|
146533
146847
|
SETTINGS_DIRECTORY_NAME,
|
|
146534
146848
|
"sandbox.venv"
|
|
146535
146849
|
);
|
|
146536
|
-
if (!
|
|
146537
|
-
|
|
146850
|
+
if (!fs52.existsSync(sandboxVenvPath)) {
|
|
146851
|
+
fs52.mkdirSync(sandboxVenvPath, { recursive: true });
|
|
146538
146852
|
}
|
|
146539
146853
|
args.push("--volume", `${sandboxVenvPath}:${getContainerPath(virtualEnv)}`);
|
|
146540
146854
|
args.push("--env", `VIRTUAL_ENV=${getContainerPath(virtualEnv)}`);
|
|
@@ -146563,8 +146877,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
146563
146877
|
}
|
|
146564
146878
|
args.push("--env", `SANDBOX=${containerName}`);
|
|
146565
146879
|
if (config.command === "podman") {
|
|
146566
|
-
const emptyAuthFilePath =
|
|
146567
|
-
|
|
146880
|
+
const emptyAuthFilePath = path59.join(os30.tmpdir(), "empty_auth.json");
|
|
146881
|
+
fs52.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
|
|
146568
146882
|
args.push("--authfile", emptyAuthFilePath);
|
|
146569
146883
|
}
|
|
146570
146884
|
let userFlag = "";
|
|
@@ -146763,17 +147077,17 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
|
|
|
146763
147077
|
|
|
146764
147078
|
// packages/cli/src/utils/startupWarnings.ts
|
|
146765
147079
|
init_esbuild_shims();
|
|
146766
|
-
import
|
|
147080
|
+
import fs53 from "node:fs/promises";
|
|
146767
147081
|
import os31 from "node:os";
|
|
146768
147082
|
import { join as pathJoin } from "node:path";
|
|
146769
147083
|
var warningsFilePath = pathJoin(os31.tmpdir(), "qwen-code-warnings.txt");
|
|
146770
147084
|
async function getStartupWarnings() {
|
|
146771
147085
|
try {
|
|
146772
|
-
await
|
|
146773
|
-
const warningsContent = await
|
|
147086
|
+
await fs53.access(warningsFilePath);
|
|
147087
|
+
const warningsContent = await fs53.readFile(warningsFilePath, "utf-8");
|
|
146774
147088
|
const warnings = warningsContent.split("\n").filter((line) => line.trim() !== "");
|
|
146775
147089
|
try {
|
|
146776
|
-
await
|
|
147090
|
+
await fs53.unlink(warningsFilePath);
|
|
146777
147091
|
} catch {
|
|
146778
147092
|
warnings.push("Warning: Could not delete temporary warnings file.");
|
|
146779
147093
|
}
|
|
@@ -146789,16 +147103,16 @@ __name(getStartupWarnings, "getStartupWarnings");
|
|
|
146789
147103
|
|
|
146790
147104
|
// packages/cli/src/utils/userStartupWarnings.ts
|
|
146791
147105
|
init_esbuild_shims();
|
|
146792
|
-
import
|
|
147106
|
+
import fs54 from "node:fs/promises";
|
|
146793
147107
|
import * as os32 from "node:os";
|
|
146794
|
-
import
|
|
147108
|
+
import path60 from "node:path";
|
|
146795
147109
|
var homeDirectoryCheck = {
|
|
146796
147110
|
id: "home-directory",
|
|
146797
147111
|
check: /* @__PURE__ */ __name(async (options) => {
|
|
146798
147112
|
try {
|
|
146799
147113
|
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
|
146800
|
-
|
|
146801
|
-
|
|
147114
|
+
fs54.realpath(options.workspaceRoot),
|
|
147115
|
+
fs54.realpath(os32.homedir())
|
|
146802
147116
|
]);
|
|
146803
147117
|
if (workspaceRealPath === homeRealPath) {
|
|
146804
147118
|
return "You are running Qwen Code in your home directory. It is recommended to run in a project-specific directory.";
|
|
@@ -146813,9 +147127,9 @@ var rootDirectoryCheck = {
|
|
|
146813
147127
|
id: "root-directory",
|
|
146814
147128
|
check: /* @__PURE__ */ __name(async (options) => {
|
|
146815
147129
|
try {
|
|
146816
|
-
const workspaceRealPath = await
|
|
147130
|
+
const workspaceRealPath = await fs54.realpath(options.workspaceRoot);
|
|
146817
147131
|
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 (
|
|
147132
|
+
if (path60.dirname(workspaceRealPath) === workspaceRealPath) {
|
|
146819
147133
|
return errorMessage2;
|
|
146820
147134
|
}
|
|
146821
147135
|
return null;
|
|
@@ -147669,7 +147983,16 @@ var DualOutputBridge = class {
|
|
|
147669
147983
|
|
|
147670
147984
|
// packages/cli/src/remoteInput/RemoteInputWatcher.ts
|
|
147671
147985
|
init_esbuild_shims();
|
|
147672
|
-
import {
|
|
147986
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
147987
|
+
import {
|
|
147988
|
+
closeSync as closeSync2,
|
|
147989
|
+
createReadStream,
|
|
147990
|
+
openSync as openSync3,
|
|
147991
|
+
readSync as readSync2,
|
|
147992
|
+
statSync as statSync6,
|
|
147993
|
+
unwatchFile,
|
|
147994
|
+
watchFile
|
|
147995
|
+
} from "node:fs";
|
|
147673
147996
|
import { createInterface as createInterface2 } from "node:readline";
|
|
147674
147997
|
var debugLogger78 = createDebugLogger("REMOTE_INPUT");
|
|
147675
147998
|
var RemoteInputWatcher = class {
|
|
@@ -147682,6 +148005,7 @@ var RemoteInputWatcher = class {
|
|
|
147682
148005
|
processing = false;
|
|
147683
148006
|
active = true;
|
|
147684
148007
|
bytesRead = 0;
|
|
148008
|
+
consumedPrefixHash = null;
|
|
147685
148009
|
reading = false;
|
|
147686
148010
|
filePath;
|
|
147687
148011
|
retryTimer = null;
|
|
@@ -147721,8 +148045,10 @@ var RemoteInputWatcher = class {
|
|
|
147721
148045
|
try {
|
|
147722
148046
|
const stat4 = statSync6(this.filePath);
|
|
147723
148047
|
this.bytesRead = stat4.size;
|
|
148048
|
+
this.consumedPrefixHash = this.hashFilePrefix(this.bytesRead);
|
|
147724
148049
|
} catch {
|
|
147725
148050
|
this.bytesRead = 0;
|
|
148051
|
+
this.consumedPrefixHash = null;
|
|
147726
148052
|
}
|
|
147727
148053
|
watchFile(this.filePath, { interval: this.pollIntervalMs }, () => {
|
|
147728
148054
|
if (!this.active) return;
|
|
@@ -147748,7 +148074,21 @@ var RemoteInputWatcher = class {
|
|
|
147748
148074
|
} catch {
|
|
147749
148075
|
return Promise.resolve();
|
|
147750
148076
|
}
|
|
148077
|
+
if (currentSize < this.bytesRead) {
|
|
148078
|
+
debugLogger78.debug(
|
|
148079
|
+
"RemoteInput: input file shrank, resetting read offset"
|
|
148080
|
+
);
|
|
148081
|
+
this.bytesRead = 0;
|
|
148082
|
+
this.consumedPrefixHash = null;
|
|
148083
|
+
} else if (this.hasConsumedPrefixChanged()) {
|
|
148084
|
+
debugLogger78.debug(
|
|
148085
|
+
"RemoteInput: input file prefix changed, resetting read offset"
|
|
148086
|
+
);
|
|
148087
|
+
this.bytesRead = 0;
|
|
148088
|
+
this.consumedPrefixHash = null;
|
|
148089
|
+
}
|
|
147751
148090
|
if (currentSize <= this.bytesRead) return Promise.resolve();
|
|
148091
|
+
const nextConsumedPrefixHash = this.hashFilePrefix(currentSize);
|
|
147752
148092
|
this.reading = true;
|
|
147753
148093
|
const stream = createReadStream(this.filePath, {
|
|
147754
148094
|
start: this.bytesRead,
|
|
@@ -147784,12 +148124,61 @@ var RemoteInputWatcher = class {
|
|
|
147784
148124
|
return new Promise((resolve23) => {
|
|
147785
148125
|
rl.on("close", () => {
|
|
147786
148126
|
this.bytesRead = currentSize;
|
|
148127
|
+
if (nextConsumedPrefixHash !== null) {
|
|
148128
|
+
this.consumedPrefixHash = nextConsumedPrefixHash;
|
|
148129
|
+
}
|
|
147787
148130
|
this.reading = false;
|
|
147788
148131
|
this.processQueue();
|
|
147789
148132
|
resolve23();
|
|
147790
148133
|
});
|
|
147791
148134
|
});
|
|
147792
148135
|
}
|
|
148136
|
+
hasConsumedPrefixChanged() {
|
|
148137
|
+
if (this.bytesRead === 0) {
|
|
148138
|
+
return false;
|
|
148139
|
+
}
|
|
148140
|
+
if (this.consumedPrefixHash === null) {
|
|
148141
|
+
debugLogger78.warn(
|
|
148142
|
+
"RemoteInput: missing consumed prefix hash, resetting read offset"
|
|
148143
|
+
);
|
|
148144
|
+
return true;
|
|
148145
|
+
}
|
|
148146
|
+
const currentHash = this.hashFilePrefix(this.bytesRead);
|
|
148147
|
+
if (currentHash === null) {
|
|
148148
|
+
debugLogger78.warn(
|
|
148149
|
+
"RemoteInput: failed to hash consumed prefix, resetting read offset"
|
|
148150
|
+
);
|
|
148151
|
+
return true;
|
|
148152
|
+
}
|
|
148153
|
+
return currentHash !== this.consumedPrefixHash;
|
|
148154
|
+
}
|
|
148155
|
+
hashFilePrefix(size) {
|
|
148156
|
+
if (size <= 0) return null;
|
|
148157
|
+
let fd = null;
|
|
148158
|
+
try {
|
|
148159
|
+
fd = openSync3(this.filePath, "r");
|
|
148160
|
+
const hash = createHash2("sha256");
|
|
148161
|
+
const buffer = Buffer.allocUnsafe(Math.min(64 * 1024, size));
|
|
148162
|
+
let remaining = size;
|
|
148163
|
+
let position = 0;
|
|
148164
|
+
while (remaining > 0) {
|
|
148165
|
+
const bytesToRead = Math.min(buffer.length, remaining);
|
|
148166
|
+
const bytesRead = readSync2(fd, buffer, 0, bytesToRead, position);
|
|
148167
|
+
if (bytesRead <= 0) return null;
|
|
148168
|
+
hash.update(buffer.subarray(0, bytesRead));
|
|
148169
|
+
remaining -= bytesRead;
|
|
148170
|
+
position += bytesRead;
|
|
148171
|
+
}
|
|
148172
|
+
return hash.digest("base64");
|
|
148173
|
+
} catch (err) {
|
|
148174
|
+
debugLogger78.warn("RemoteInput: failed to hash file prefix:", err);
|
|
148175
|
+
return null;
|
|
148176
|
+
} finally {
|
|
148177
|
+
if (fd !== null) {
|
|
148178
|
+
closeSync2(fd);
|
|
148179
|
+
}
|
|
148180
|
+
}
|
|
148181
|
+
}
|
|
147793
148182
|
async processQueue() {
|
|
147794
148183
|
if (this.processing || !this.submitFn || this.queue.length === 0) return;
|
|
147795
148184
|
this.processing = true;
|
|
@@ -148129,8 +148518,8 @@ var AcpFileSystemService = class {
|
|
|
148129
148518
|
// packages/cli/src/acp-integration/acpAgent.ts
|
|
148130
148519
|
import { Readable as Readable2, Writable as Writable2 } from "node:stream";
|
|
148131
148520
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
148132
|
-
import * as
|
|
148133
|
-
import * as
|
|
148521
|
+
import * as fs55 from "node:fs/promises";
|
|
148522
|
+
import * as path61 from "node:path";
|
|
148134
148523
|
import { createGunzip } from "node:zlib";
|
|
148135
148524
|
|
|
148136
148525
|
// packages/cli/src/acp-integration/session/Session.ts
|
|
@@ -149067,8 +149456,13 @@ function isUserPromptRecord(record) {
|
|
|
149067
149456
|
) ?? false;
|
|
149068
149457
|
}
|
|
149069
149458
|
__name(isUserPromptRecord, "isUserPromptRecord");
|
|
149070
|
-
async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4)) {
|
|
149071
|
-
const slashCommands = await getAvailableCommands(
|
|
149459
|
+
async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings) {
|
|
149460
|
+
const slashCommands = await getAvailableCommands(
|
|
149461
|
+
config,
|
|
149462
|
+
abortSignal,
|
|
149463
|
+
"acp",
|
|
149464
|
+
settings
|
|
149465
|
+
);
|
|
149072
149466
|
const availableCommands = slashCommands.map((cmd) => {
|
|
149073
149467
|
const acceptsInput = cmd.acceptsInput ?? (cmd.kind !== "built-in" /* BUILT_IN */ || cmd.completion != null || cmd.argumentHint != null || cmd.subCommands != null && cmd.subCommands.length > 0);
|
|
149074
149468
|
return {
|
|
@@ -150832,7 +151226,11 @@ ${this.pendingWorktreeNotice}
|
|
|
150832
151226
|
}
|
|
150833
151227
|
async sendAvailableCommandsUpdate() {
|
|
150834
151228
|
try {
|
|
150835
|
-
const { availableCommands, availableSkills, availableSkillDetails } = await buildAvailableCommandsSnapshot(
|
|
151229
|
+
const { availableCommands, availableSkills, availableSkillDetails } = await buildAvailableCommandsSnapshot(
|
|
151230
|
+
this.config,
|
|
151231
|
+
void 0,
|
|
151232
|
+
this.settings
|
|
151233
|
+
);
|
|
150836
151234
|
const update = {
|
|
150837
151235
|
sessionUpdate: "available_commands_update",
|
|
150838
151236
|
availableCommands,
|
|
@@ -151100,11 +151498,10 @@ ${this.pendingWorktreeNotice}
|
|
|
151100
151498
|
}
|
|
151101
151499
|
}, "appendSkippedAfter");
|
|
151102
151500
|
const runBounded = /* @__PURE__ */ __name(async (calls, runAbortSignal, onStopAfterPermissionCancel, shouldSkipUnstarted) => {
|
|
151103
|
-
const
|
|
151104
|
-
process.env["QWEN_CODE_MAX_TOOL_CONCURRENCY"]
|
|
151501
|
+
const maxConcurrency = parsePositiveIntegerEnv(
|
|
151502
|
+
process.env["QWEN_CODE_MAX_TOOL_CONCURRENCY"],
|
|
151105
151503
|
10
|
|
151106
151504
|
);
|
|
151107
|
-
const maxConcurrency = Number.isFinite(parsed) && parsed >= 1 ? parsed : 10;
|
|
151108
151505
|
const results = new Array(calls.length);
|
|
151109
151506
|
const executing = /* @__PURE__ */ new Set();
|
|
151110
151507
|
for (let i = 0; i < calls.length; i++) {
|
|
@@ -152322,7 +152719,7 @@ function readRequiredString(value, fieldName) {
|
|
|
152322
152719
|
}
|
|
152323
152720
|
__name(readRequiredString, "readRequiredString");
|
|
152324
152721
|
function validateSkillSlug(slug) {
|
|
152325
|
-
if (!slug || slug === "." || slug === ".." || slug.includes("/") || slug.includes(
|
|
152722
|
+
if (!slug || slug === "." || slug === ".." || slug.includes("/") || slug.includes(path61.sep) || !/^[a-zA-Z0-9._-]+$/.test(slug)) {
|
|
152326
152723
|
throw RequestError.invalidParams(void 0, "Invalid skill.slug");
|
|
152327
152724
|
}
|
|
152328
152725
|
}
|
|
@@ -152791,7 +153188,7 @@ async function downloadGitHubSkillDirectoryFromApi(githubUrl, directoryPath, rel
|
|
|
152791
153188
|
const name = readRequiredString(record["name"], "github.name");
|
|
152792
153189
|
const itemPath = readRequiredString(record["path"], "github.path");
|
|
152793
153190
|
const type = readRequiredString(record["type"], "github.type");
|
|
152794
|
-
const relativePath = relativeRoot ?
|
|
153191
|
+
const relativePath = relativeRoot ? path61.posix.join(relativeRoot, name) : name;
|
|
152795
153192
|
if (type === "dir") {
|
|
152796
153193
|
files.push(
|
|
152797
153194
|
...await downloadGitHubSkillDirectoryFromApi(
|
|
@@ -152851,10 +153248,10 @@ __name(downloadGitHubSkillDirectory, "downloadGitHubSkillDirectory");
|
|
|
152851
153248
|
async function downloadSkill(sourceUrl) {
|
|
152852
153249
|
assertAllowedSkillSourceUrl(sourceUrl);
|
|
152853
153250
|
const githubUrl = parseGitHubBlobSkillUrl(sourceUrl);
|
|
152854
|
-
if (!githubUrl ||
|
|
153251
|
+
if (!githubUrl || path61.posix.basename(githubUrl.filePath) !== "SKILL.md") {
|
|
152855
153252
|
return downloadSingleSkillFile(sourceUrl);
|
|
152856
153253
|
}
|
|
152857
|
-
const skillDirectory =
|
|
153254
|
+
const skillDirectory = path61.posix.dirname(githubUrl.filePath);
|
|
152858
153255
|
const files = await downloadGitHubSkillDirectory(githubUrl, skillDirectory);
|
|
152859
153256
|
const skillFile = files.find((file) => file.relativePath === "SKILL.md");
|
|
152860
153257
|
if (!skillFile) {
|
|
@@ -152870,9 +153267,9 @@ async function downloadSkill(sourceUrl) {
|
|
|
152870
153267
|
}
|
|
152871
153268
|
__name(downloadSkill, "downloadSkill");
|
|
152872
153269
|
function resolveSkillInstallPath(skillDir, relativePath) {
|
|
152873
|
-
const root =
|
|
152874
|
-
const target =
|
|
152875
|
-
if (target !== root && !target.startsWith(root +
|
|
153270
|
+
const root = path61.resolve(skillDir);
|
|
153271
|
+
const target = path61.resolve(skillDir, relativePath);
|
|
153272
|
+
if (target !== root && !target.startsWith(root + path61.sep)) {
|
|
152876
153273
|
throw RequestError.invalidParams(
|
|
152877
153274
|
void 0,
|
|
152878
153275
|
`Invalid skill file path: ${relativePath}`
|
|
@@ -152882,9 +153279,9 @@ function resolveSkillInstallPath(skillDir, relativePath) {
|
|
|
152882
153279
|
}
|
|
152883
153280
|
__name(resolveSkillInstallPath, "resolveSkillInstallPath");
|
|
152884
153281
|
function resolveManagedSkillDir(skillsBaseDir, slug) {
|
|
152885
|
-
const root =
|
|
152886
|
-
const skillDir =
|
|
152887
|
-
if (!skillDir.startsWith(root +
|
|
153282
|
+
const root = path61.resolve(skillsBaseDir);
|
|
153283
|
+
const skillDir = path61.resolve(skillsBaseDir, slug);
|
|
153284
|
+
if (!skillDir.startsWith(root + path61.sep)) {
|
|
152888
153285
|
throw RequestError.invalidParams(void 0, "Invalid skill.slug");
|
|
152889
153286
|
}
|
|
152890
153287
|
return skillDir;
|
|
@@ -153582,14 +153979,14 @@ function readScopeSettings(settings, scope) {
|
|
|
153582
153979
|
__name(readScopeSettings, "readScopeSettings");
|
|
153583
153980
|
async function resolvePreferredMemoryFile2(dir, fallbackFilename) {
|
|
153584
153981
|
for (const filename of getAllGeminiMdFilenames()) {
|
|
153585
|
-
const filePath =
|
|
153982
|
+
const filePath = path61.join(dir, filename);
|
|
153586
153983
|
try {
|
|
153587
|
-
await
|
|
153984
|
+
await fs55.access(filePath);
|
|
153588
153985
|
return filePath;
|
|
153589
153986
|
} catch {
|
|
153590
153987
|
}
|
|
153591
153988
|
}
|
|
153592
|
-
return
|
|
153989
|
+
return path61.join(dir, fallbackFilename);
|
|
153593
153990
|
}
|
|
153594
153991
|
__name(resolvePreferredMemoryFile2, "resolvePreferredMemoryFile");
|
|
153595
153992
|
async function resolveQwenMemoryPaths(params) {
|
|
@@ -153905,7 +154302,7 @@ var QwenAgent = class {
|
|
|
153905
154302
|
async initialize(args) {
|
|
153906
154303
|
this.clientCapabilities = args.clientCapabilities;
|
|
153907
154304
|
const authMethods = buildAuthMethods();
|
|
153908
|
-
const version = "0.18.
|
|
154305
|
+
const version = "0.18.5-nightly.20260622.6bc3f853e";
|
|
153909
154306
|
return {
|
|
153910
154307
|
protocolVersion: PROTOCOL_VERSION,
|
|
153911
154308
|
agentInfo: {
|
|
@@ -155441,9 +155838,9 @@ var QwenAgent = class {
|
|
|
155441
155838
|
);
|
|
155442
155839
|
}
|
|
155443
155840
|
const download = await downloadSkill(request.sourceUrl);
|
|
155444
|
-
const skillsBaseDir =
|
|
155841
|
+
const skillsBaseDir = path61.join(Storage.getGlobalQwenDir(), "skills");
|
|
155445
155842
|
const skillDir = resolveManagedSkillDir(skillsBaseDir, request.slug);
|
|
155446
|
-
const skillFile =
|
|
155843
|
+
const skillFile = path61.join(skillDir, "SKILL.md");
|
|
155447
155844
|
const parsed = skillManager.parseSkillContent(
|
|
155448
155845
|
download.skillContent,
|
|
155449
155846
|
skillFile,
|
|
@@ -155457,19 +155854,19 @@ var QwenAgent = class {
|
|
|
155457
155854
|
}
|
|
155458
155855
|
const stagingDir = `${skillDir}.installing-${process.pid}-${Date.now()}`;
|
|
155459
155856
|
try {
|
|
155460
|
-
await
|
|
155857
|
+
await fs55.rm(stagingDir, { recursive: true, force: true });
|
|
155461
155858
|
for (const file of download.files) {
|
|
155462
155859
|
const targetPath = resolveSkillInstallPath(
|
|
155463
155860
|
stagingDir,
|
|
155464
155861
|
file.relativePath
|
|
155465
155862
|
);
|
|
155466
|
-
await
|
|
155467
|
-
await
|
|
155863
|
+
await fs55.mkdir(path61.dirname(targetPath), { recursive: true });
|
|
155864
|
+
await fs55.writeFile(targetPath, file.content);
|
|
155468
155865
|
}
|
|
155469
|
-
await
|
|
155470
|
-
await
|
|
155866
|
+
await fs55.rm(skillDir, { recursive: true, force: true });
|
|
155867
|
+
await fs55.rename(stagingDir, skillDir);
|
|
155471
155868
|
} catch (error) {
|
|
155472
|
-
await
|
|
155869
|
+
await fs55.rm(stagingDir, { recursive: true, force: true }).catch(() => {
|
|
155473
155870
|
});
|
|
155474
155871
|
throw error;
|
|
155475
155872
|
}
|
|
@@ -155502,17 +155899,17 @@ var QwenAgent = class {
|
|
|
155502
155899
|
`Skill name "${parsed.name}" does not match requested slug "${request.slug}"`
|
|
155503
155900
|
);
|
|
155504
155901
|
}
|
|
155505
|
-
const resolvedSkillDir =
|
|
155506
|
-
const resolvedSkillFile =
|
|
155507
|
-
const globalDir =
|
|
155508
|
-
const isDedicatedSkillDir = resolvedSkillFile ===
|
|
155509
|
-
if (!isDedicatedSkillDir || resolvedSkillDir ===
|
|
155902
|
+
const resolvedSkillDir = path61.resolve(skillDir);
|
|
155903
|
+
const resolvedSkillFile = path61.resolve(skillFile);
|
|
155904
|
+
const globalDir = path61.resolve(Storage.getGlobalQwenDir());
|
|
155905
|
+
const isDedicatedSkillDir = resolvedSkillFile === path61.join(resolvedSkillDir, "SKILL.md");
|
|
155906
|
+
if (!isDedicatedSkillDir || resolvedSkillDir === path61.parse(resolvedSkillDir).root || resolvedSkillDir === globalDir) {
|
|
155510
155907
|
throw RequestError.invalidParams(
|
|
155511
155908
|
void 0,
|
|
155512
155909
|
`Refusing to delete unexpected skill directory: ${skillDir}`
|
|
155513
155910
|
);
|
|
155514
155911
|
}
|
|
155515
|
-
await
|
|
155912
|
+
await fs55.rm(skillDir, { recursive: true, force: true });
|
|
155516
155913
|
await skillManager.refreshCache();
|
|
155517
155914
|
return {
|
|
155518
155915
|
slug: request.slug,
|
|
@@ -155522,11 +155919,11 @@ var QwenAgent = class {
|
|
|
155522
155919
|
async readManagedSkillFile(slug, scope, skillManager, cwd5) {
|
|
155523
155920
|
if (scope === "global") {
|
|
155524
155921
|
const qwenSkillDir = resolveManagedSkillDir(
|
|
155525
|
-
|
|
155922
|
+
path61.join(Storage.getGlobalQwenDir(), "skills"),
|
|
155526
155923
|
slug
|
|
155527
155924
|
);
|
|
155528
|
-
const qwenSkillFile =
|
|
155529
|
-
const qwenContent = await
|
|
155925
|
+
const qwenSkillFile = path61.join(qwenSkillDir, "SKILL.md");
|
|
155926
|
+
const qwenContent = await fs55.readFile(qwenSkillFile, "utf8").catch(() => void 0);
|
|
155530
155927
|
if (qwenContent !== void 0) {
|
|
155531
155928
|
return {
|
|
155532
155929
|
skillDir: qwenSkillDir,
|
|
@@ -155554,34 +155951,34 @@ var QwenAgent = class {
|
|
|
155554
155951
|
`${scope === "project" ? "Project" : "Global"} skill not found: ${slug}`
|
|
155555
155952
|
);
|
|
155556
155953
|
}
|
|
155557
|
-
const content = await
|
|
155954
|
+
const content = await fs55.readFile(skillFile, "utf8").catch(() => {
|
|
155558
155955
|
throw RequestError.invalidParams(
|
|
155559
155956
|
void 0,
|
|
155560
155957
|
`${scope === "project" ? "Project" : "Global"} skill not found: ${slug}`
|
|
155561
155958
|
);
|
|
155562
155959
|
});
|
|
155563
155960
|
return {
|
|
155564
|
-
skillDir:
|
|
155961
|
+
skillDir: path61.dirname(skillFile),
|
|
155565
155962
|
skillFile,
|
|
155566
155963
|
content
|
|
155567
155964
|
};
|
|
155568
155965
|
}
|
|
155569
155966
|
async findProjectSkillFileFromCwd(slug, cwd5, skillManager) {
|
|
155570
|
-
const projectRoot =
|
|
155967
|
+
const projectRoot = path61.resolve(cwd5);
|
|
155571
155968
|
for (const configDir of PROJECT_SKILL_DIRS) {
|
|
155572
|
-
const baseDir =
|
|
155969
|
+
const baseDir = path61.join(projectRoot, configDir, SKILLS_DIR);
|
|
155573
155970
|
const skills = await skillManager.loadSkillsFromDir(baseDir, "project");
|
|
155574
155971
|
const skill = skills.find((candidate) => candidate.name === slug);
|
|
155575
155972
|
const skillFile = skill?.filePath;
|
|
155576
155973
|
if (!skillFile) continue;
|
|
155577
|
-
const content = await
|
|
155974
|
+
const content = await fs55.readFile(skillFile, "utf8").catch(() => {
|
|
155578
155975
|
throw RequestError.invalidParams(
|
|
155579
155976
|
void 0,
|
|
155580
155977
|
`Project skill not found: ${slug}`
|
|
155581
155978
|
);
|
|
155582
155979
|
});
|
|
155583
155980
|
return {
|
|
155584
|
-
skillDir:
|
|
155981
|
+
skillDir: path61.dirname(skillFile),
|
|
155585
155982
|
skillFile,
|
|
155586
155983
|
content
|
|
155587
155984
|
};
|
|
@@ -155612,13 +156009,13 @@ var QwenAgent = class {
|
|
|
155612
156009
|
}
|
|
155613
156010
|
const nextContent = setSkillFrontmatterEnabled(content, request.enabled);
|
|
155614
156011
|
skillManager.parseSkillContent(nextContent, skillFile, level);
|
|
155615
|
-
if (
|
|
156012
|
+
if (path61.basename(skillFile) !== "SKILL.md") {
|
|
155616
156013
|
throw RequestError.invalidParams(
|
|
155617
156014
|
void 0,
|
|
155618
156015
|
`Refusing to write to unexpected skill file: ${skillFile}`
|
|
155619
156016
|
);
|
|
155620
156017
|
}
|
|
155621
|
-
await
|
|
156018
|
+
await fs55.writeFile(skillFile, nextContent, "utf8");
|
|
155622
156019
|
await skillManager.refreshCache();
|
|
155623
156020
|
return {
|
|
155624
156021
|
slug: request.slug,
|
|
@@ -157897,7 +158294,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
157897
158294
|
const resolveIfPath = /* @__PURE__ */ __name((v) => {
|
|
157898
158295
|
if (typeof v !== "string" || v.length === 0) return v;
|
|
157899
158296
|
if (looksLikeInlineJson(v)) return v;
|
|
157900
|
-
return
|
|
158297
|
+
return path62.resolve(launchCwdForPaths, v);
|
|
157901
158298
|
}, "resolveIfPath");
|
|
157902
158299
|
argv.mcpConfig = resolveIfPath(argv.mcpConfig);
|
|
157903
158300
|
argv.openaiLoggingDir = resolveIfPath(argv.openaiLoggingDir);
|
|
@@ -157906,15 +158303,15 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
157906
158303
|
argv.telemetryOutfile = resolveIfPath(argv.telemetryOutfile);
|
|
157907
158304
|
if (Array.isArray(argv.includeDirectories)) {
|
|
157908
158305
|
argv.includeDirectories = argv.includeDirectories.map(
|
|
157909
|
-
(d) => typeof d === "string" && d.length > 0 ?
|
|
158306
|
+
(d) => typeof d === "string" && d.length > 0 ? path62.resolve(launchCwdForPaths, d) : d
|
|
157910
158307
|
);
|
|
157911
158308
|
}
|
|
157912
158309
|
if (typeof argv.jsonSchema === "string") {
|
|
157913
158310
|
const trimmedSchema = argv.jsonSchema.trim();
|
|
157914
158311
|
if (trimmedSchema.startsWith("@")) {
|
|
157915
158312
|
const rel = trimmedSchema.slice(1);
|
|
157916
|
-
if (rel.length > 0 && !
|
|
157917
|
-
argv.jsonSchema = "@" +
|
|
158313
|
+
if (rel.length > 0 && !path62.isAbsolute(rel)) {
|
|
158314
|
+
argv.jsonSchema = "@" + path62.resolve(launchCwdForPaths, rel);
|
|
157918
158315
|
}
|
|
157919
158316
|
}
|
|
157920
158317
|
}
|
|
@@ -158076,7 +158473,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
158076
158473
|
process.exit(0);
|
|
158077
158474
|
}
|
|
158078
158475
|
if (config.isInteractive()) {
|
|
158079
|
-
void import("./chunks/scheduler-
|
|
158476
|
+
void import("./chunks/scheduler-M3742P2I.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
|
|
158080
158477
|
debugLogger84.warn("failed to start background housekeeping:", err);
|
|
158081
158478
|
});
|
|
158082
158479
|
}
|