@google/gemini-cli 0.48.0-nightly.20260612.g4e10a34be → 0.48.0-preview.0
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/bundle/{chunk-ZT5PXPGC.js → chunk-32OC6X7M.js} +2 -2
- package/bundle/{chunk-GWB6WHVI.js → chunk-4D6ZATMR.js} +125 -83
- package/bundle/{chunk-RWG2IKXK.js → chunk-4JHCXKYF.js} +3 -3
- package/bundle/{chunk-4FWMMTHD.js → chunk-76ONBIQT.js} +1 -1
- package/bundle/{chunk-25ZW2ZOF.js → chunk-7BRNIWQY.js} +1 -1
- package/bundle/{chunk-FFKNXGOH.js → chunk-BPCFUG3V.js} +66 -33
- package/bundle/{chunk-DV5H7HVO.js → chunk-C5HEG6L3.js} +1 -1
- package/bundle/{chunk-DR6M2CVX.js → chunk-F643LQAW.js} +2 -2
- package/bundle/{chunk-BG23KJOF.js → chunk-F754PAF2.js} +1 -1
- package/bundle/{chunk-57QJRHS6.js → chunk-FKMHT24L.js} +1 -1
- package/bundle/{chunk-5TAF74A7.js → chunk-FOP27KUG.js} +66 -33
- package/bundle/{chunk-HEBKVYVW.js → chunk-GOJGZJTT.js} +1 -1
- package/bundle/{chunk-GSKH763B.js → chunk-JFJQ6J4C.js} +123 -81
- package/bundle/{chunk-5OGSMQN5.js → chunk-KRCY6JZY.js} +5 -8
- package/bundle/{chunk-3P56CQDW.js → chunk-KXJA2W44.js} +113 -93
- package/bundle/{chunk-3BHPNRR5.js → chunk-LHJYE2I2.js} +1 -1
- package/bundle/{chunk-TRKBNK3S.js → chunk-MGTB4OGF.js} +3 -3
- package/bundle/{chunk-PD2ER6QH.js → chunk-NELP7HPM.js} +14221 -7634
- package/bundle/{chunk-FSFSH7N4.js → chunk-OAXLII52.js} +2 -2
- package/bundle/{chunk-NWC2JNOB.js → chunk-PIL3VMYY.js} +1 -1
- package/bundle/{chunk-RJVA7TEL.js → chunk-REQG2CDI.js} +1 -1
- package/bundle/{chunk-JQBYCLEO.js → chunk-WBAIIKUA.js} +3 -3
- package/bundle/{chunk-ERRTQLZ3.js → chunk-WLIX7UZL.js} +1 -1
- package/bundle/{chunk-ZACXIEK6.js → chunk-ZMBUTQOC.js} +8 -9
- package/bundle/{cleanup-EMSFFQXH.js → cleanup-HQASY4ZZ.js} +2 -2
- package/bundle/{cleanup-JUEQXYLN.js → cleanup-PIKPOR36.js} +2 -2
- package/bundle/{cleanup-OQN4S6N7.js → cleanup-TFU4O2QF.js} +2 -2
- package/bundle/{core-SBDR7NMV.js → core-2HID3ALL.js} +1 -1
- package/bundle/{dist-C77MM5UI.js → core-6YK2A6I7.js} +1 -1
- package/bundle/{devtoolsService-Q6RR5ONV.js → devtoolsService-IJQN3MM5.js} +2 -2
- package/bundle/{devtoolsService-6XIZFA3V.js → devtoolsService-UOC3OTQO.js} +3 -4
- package/bundle/{devtoolsService-4K4TUJGT.js → devtoolsService-VVO37S2U.js} +2 -2
- package/bundle/{dist-IZL4IUFR.js → dist-XJ5HWKG4.js} +1 -1
- package/bundle/docs/cli/enterprise.md +1 -1
- package/bundle/{gemini-22IJYAAK.js → gemini-FNT3QJRS.js} +15 -15
- package/bundle/{gemini-BU4XIO7C.js → gemini-K7TA557G.js} +197 -213
- package/bundle/{gemini-EXF7WM5I.js → gemini-KE6MEJUV.js} +14 -14
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-WP4PF4B4.js → interactiveCli-42SRPV5K.js} +8 -8
- package/bundle/{interactiveCli-AYRCP2YE.js → interactiveCli-KHHF6YZS.js} +295 -314
- package/bundle/{interactiveCli-3XP7ZWTR.js → interactiveCli-LXYWEYTS.js} +8 -8
- package/bundle/{liteRtServerManager-BKMP23GM.js → liteRtServerManager-4P66NNGG.js} +4 -4
- package/bundle/{liteRtServerManager-BRKTTSTY.js → liteRtServerManager-MMZKQRWI.js} +4 -4
- package/bundle/{liteRtServerManager-EXA5HOJY.js → liteRtServerManager-OBHUWV37.js} +4 -4
- package/bundle/{oauth2-provider-R3XNUJCY.js → oauth2-provider-OJZ3YJZH.js} +1 -1
- package/bundle/{oauth2-provider-AOLL6E73.js → oauth2-provider-TBT32VYL.js} +1 -1
- package/bundle/{oauth2-provider-J7GSQ3D3.js → oauth2-provider-YIPV4CI4.js} +72 -38
- package/bundle/{start-FAIQQIZB.js → start-QX77TWOS.js} +6 -6
- package/bundle/{start-T37M4GQC.js → start-RF5733GP.js} +6 -6
- package/bundle/{start-UEM457EB.js → start-SYDDMBXA.js} +6 -6
- package/package.json +1 -1
- package/bundle/chunk-47O5POZQ.js +0 -394678
- package/bundle/chunk-GUFPYIHD.js +0 -512
- package/bundle/chunk-I4UV4KA4.js +0 -398
- package/bundle/chunk-JNJOXQYJ.js +0 -1571
- package/bundle/chunk-M54YU4D6.js +0 -118
- package/bundle/chunk-OZYTM77K.js +0 -81736
- package/bundle/chunk-TMB2KDVR.js +0 -154
- package/bundle/chunk-WEPCSQ47.js +0 -17320
- package/bundle/cleanup-VI4MGW6W.js +0 -32
- package/bundle/devtoolsService-P7V47Y6U.js +0 -856
- package/bundle/dist-PNS3BBFZ.js +0 -2150
- package/bundle/gemini-GA3BOQUA.js +0 -16409
- package/bundle/interactiveCli-IK5ZIGXI.js +0 -34766
- package/bundle/liteRtServerManager-NPAIRQRP.js +0 -65
- package/bundle/oauth2-provider-O3JJBAIN.js +0 -235
- package/bundle/start-VUNII4BV.js +0 -18
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-F754PAF2.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_PORT,
|
|
8
8
|
SERVER_START_WAIT_MS,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
isServerRunning,
|
|
15
15
|
resolveGemmaConfig,
|
|
16
16
|
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FKMHT24L.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4D6ZATMR.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
checkExhaustive
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NELP7HPM.js";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__toESM
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
exitCli,
|
|
8
8
|
require_source
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LHJYE2I2.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_BACKGROUND_OPACITY,
|
|
12
12
|
DEFAULT_BORDER_OPACITY,
|
|
@@ -58,14 +58,14 @@ import {
|
|
|
58
58
|
stripUnsafeCharacters,
|
|
59
59
|
toCodePoints,
|
|
60
60
|
validateCustomTheme
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-KRCY6JZY.js";
|
|
62
62
|
import {
|
|
63
63
|
isDevelopment
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-F643LQAW.js";
|
|
65
65
|
import {
|
|
66
66
|
emptyIcon,
|
|
67
67
|
require_react
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-7BRNIWQY.js";
|
|
69
69
|
import {
|
|
70
70
|
ALL_EDITORS,
|
|
71
71
|
ApprovalMode,
|
|
@@ -230,7 +230,7 @@ import {
|
|
|
230
230
|
tokenLimit,
|
|
231
231
|
uiTelemetryService,
|
|
232
232
|
unescapePath
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-NELP7HPM.js";
|
|
234
234
|
import {
|
|
235
235
|
require_src
|
|
236
236
|
} from "./chunk-TUDYL3X4.js";
|
|
@@ -11695,9 +11695,9 @@ var require_prompts = __commonJS({
|
|
|
11695
11695
|
$3.date = (args) => toPrompt("DatePrompt", args);
|
|
11696
11696
|
$3.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
11697
11697
|
$3.list = (args) => {
|
|
11698
|
-
const
|
|
11698
|
+
const sep5 = args.separator || ",";
|
|
11699
11699
|
return toPrompt("TextPrompt", args, {
|
|
11700
|
-
onSubmit: (str) => str.split(
|
|
11700
|
+
onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
|
|
11701
11701
|
});
|
|
11702
11702
|
};
|
|
11703
11703
|
$3.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -13985,9 +13985,9 @@ var require_prompts2 = __commonJS({
|
|
|
13985
13985
|
$3.date = (args) => toPrompt("DatePrompt", args);
|
|
13986
13986
|
$3.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
13987
13987
|
$3.list = (args) => {
|
|
13988
|
-
const
|
|
13988
|
+
const sep5 = args.separator || ",";
|
|
13989
13989
|
return toPrompt("TextPrompt", args, {
|
|
13990
|
-
onSubmit: (str) => str.split(
|
|
13990
|
+
onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
|
|
13991
13991
|
});
|
|
13992
13992
|
};
|
|
13993
13993
|
$3.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -34585,9 +34585,16 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
|
|
|
34585
34585
|
match[2],
|
|
34586
34586
|
match[3]
|
|
34587
34587
|
);
|
|
34588
|
-
|
|
34589
|
-
|
|
34590
|
-
|
|
34588
|
+
if (this.terminalBackgroundColor === "#ffffff" && this.isTmux()) {
|
|
34589
|
+
debugLogger.log(
|
|
34590
|
+
"Ignored #ffffff background in tmux (common false positive over mosh)."
|
|
34591
|
+
);
|
|
34592
|
+
this.terminalBackgroundColor = void 0;
|
|
34593
|
+
} else {
|
|
34594
|
+
debugLogger.log(
|
|
34595
|
+
`Detected terminal background color: ${this.terminalBackgroundColor}`
|
|
34596
|
+
);
|
|
34597
|
+
}
|
|
34591
34598
|
}
|
|
34592
34599
|
}
|
|
34593
34600
|
if (!kittyKeyboardReceived && _TerminalCapabilityManager.KITTY_REGEX.test(buffer)) {
|
|
@@ -40564,8 +40571,8 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
|
|
|
40564
40571
|
}
|
|
40565
40572
|
const envContent = formatEnvContent(nonSensitiveSettings);
|
|
40566
40573
|
if (fsSync.existsSync(envFilePath)) {
|
|
40567
|
-
const
|
|
40568
|
-
if (
|
|
40574
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40575
|
+
if (stat7.isDirectory()) {
|
|
40569
40576
|
throw new Error(
|
|
40570
40577
|
`Cannot write extension settings to ${envFilePath} because it is a directory.`
|
|
40571
40578
|
);
|
|
@@ -40609,8 +40616,8 @@ async function getScopedEnvContents(extensionConfig, extensionId, scope, workspa
|
|
|
40609
40616
|
const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
|
|
40610
40617
|
let customEnv = {};
|
|
40611
40618
|
if (fsSync.existsSync(envFilePath)) {
|
|
40612
|
-
const
|
|
40613
|
-
if (!
|
|
40619
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40620
|
+
if (!stat7.isDirectory()) {
|
|
40614
40621
|
const envFile = fsSync.readFileSync(envFilePath, "utf-8");
|
|
40615
40622
|
customEnv = dotenv.parse(envFile);
|
|
40616
40623
|
}
|
|
@@ -40678,8 +40685,8 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40678
40685
|
const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
|
|
40679
40686
|
let envContent = "";
|
|
40680
40687
|
if (fsSync.existsSync(envFilePath)) {
|
|
40681
|
-
const
|
|
40682
|
-
if (
|
|
40688
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40689
|
+
if (stat7.isDirectory()) {
|
|
40683
40690
|
throw new Error(
|
|
40684
40691
|
`Cannot write extension settings to ${envFilePath} because it is a directory.`
|
|
40685
40692
|
);
|
|
@@ -40727,8 +40734,8 @@ function getSettingsChanges(settings, oldSettings) {
|
|
|
40727
40734
|
}
|
|
40728
40735
|
async function clearSettings(envFilePath, keychain) {
|
|
40729
40736
|
if (fsSync.existsSync(envFilePath)) {
|
|
40730
|
-
const
|
|
40731
|
-
if (!
|
|
40737
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40738
|
+
if (!stat7.isDirectory()) {
|
|
40732
40739
|
await fs11.writeFile(envFilePath, "");
|
|
40733
40740
|
}
|
|
40734
40741
|
}
|
|
@@ -56531,7 +56538,7 @@ var authCommand = {
|
|
|
56531
56538
|
import process29 from "node:process";
|
|
56532
56539
|
|
|
56533
56540
|
// packages/cli/src/generated/git-commit.ts
|
|
56534
|
-
var GIT_COMMIT_INFO = "
|
|
56541
|
+
var GIT_COMMIT_INFO = "4d3dcdce1";
|
|
56535
56542
|
|
|
56536
56543
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
56537
56544
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -62312,7 +62319,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
62312
62319
|
type: "info",
|
|
62313
62320
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
62314
62321
|
});
|
|
62315
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
62322
|
+
const { MCPOAuthProvider } = await import("./core-2HID3ALL.js");
|
|
62316
62323
|
let oauthConfig = server.oauth;
|
|
62317
62324
|
if (!oauthConfig) {
|
|
62318
62325
|
oauthConfig = { enabled: false };
|
|
@@ -80153,6 +80160,12 @@ function renderSkillActionFeedback(result, formatScope) {
|
|
|
80153
80160
|
const s3 = formatScopeItem(totalAffectedScopes[0]);
|
|
80154
80161
|
return `Skill "${skillName}" ${actionVerb} ${preposition} ${s3} settings.`;
|
|
80155
80162
|
}
|
|
80163
|
+
function isPathTraversal(relative3) {
|
|
80164
|
+
return relative3 === ".." || relative3.startsWith(".." + path36.sep) || path36.isAbsolute(relative3);
|
|
80165
|
+
}
|
|
80166
|
+
function isInvalidSubpath(relative3) {
|
|
80167
|
+
return relative3 === "" || isPathTraversal(relative3);
|
|
80168
|
+
}
|
|
80156
80169
|
async function installSkill(source2, scope, subpath, onLog, requestConsent = () => Promise.resolve(true)) {
|
|
80157
80170
|
let sourcePath = source2;
|
|
80158
80171
|
let tempDirToClean = void 0;
|
|
@@ -80184,8 +80197,12 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
80184
80197
|
sourcePath = path36.join(sourcePath, subpath);
|
|
80185
80198
|
}
|
|
80186
80199
|
sourcePath = path36.resolve(sourcePath);
|
|
80187
|
-
if (tempDirToClean
|
|
80188
|
-
|
|
80200
|
+
if (tempDirToClean) {
|
|
80201
|
+
const resolvedTemp = path36.resolve(tempDirToClean);
|
|
80202
|
+
const relative3 = path36.relative(resolvedTemp, sourcePath);
|
|
80203
|
+
if (isPathTraversal(relative3)) {
|
|
80204
|
+
throw new Error("Invalid path: Directory traversal not allowed.");
|
|
80205
|
+
}
|
|
80189
80206
|
}
|
|
80190
80207
|
onLog(`Searching for skills in ${sourcePath}...`);
|
|
80191
80208
|
const skills = await loadSkillsFromDir(sourcePath);
|
|
@@ -80200,13 +80217,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
80200
80217
|
if (!await requestConsent(skills, targetDir)) {
|
|
80201
80218
|
throw new Error("Skill installation cancelled by user.");
|
|
80202
80219
|
}
|
|
80203
|
-
|
|
80220
|
+
const resolvedTarget = path36.resolve(targetDir);
|
|
80221
|
+
await fs36.mkdir(resolvedTarget, { recursive: true });
|
|
80204
80222
|
const installedSkills = [];
|
|
80205
80223
|
for (const skill of skills) {
|
|
80206
80224
|
const skillName = skill.name;
|
|
80207
80225
|
const skillDir = path36.dirname(skill.location);
|
|
80208
|
-
const destPath = path36.
|
|
80209
|
-
const
|
|
80226
|
+
const destPath = path36.resolve(resolvedTarget, skillName);
|
|
80227
|
+
const relative3 = path36.relative(resolvedTarget, destPath);
|
|
80228
|
+
if (isInvalidSubpath(relative3)) {
|
|
80229
|
+
throw new Error("Invalid skill name: Path traversal detected.");
|
|
80230
|
+
}
|
|
80231
|
+
const exists = await fs36.lstat(destPath).catch(() => null);
|
|
80210
80232
|
if (exists) {
|
|
80211
80233
|
onLog(`Skill "${skillName}" already exists. Overwriting...`);
|
|
80212
80234
|
await fs36.rm(destPath, { recursive: true, force: true });
|
|
@@ -80247,12 +80269,17 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
|
|
|
80247
80269
|
if (!await requestConsent(skills, targetDir)) {
|
|
80248
80270
|
throw new Error("Skill linking cancelled by user.");
|
|
80249
80271
|
}
|
|
80250
|
-
|
|
80272
|
+
const resolvedTarget = path36.resolve(targetDir);
|
|
80273
|
+
await fs36.mkdir(resolvedTarget, { recursive: true });
|
|
80251
80274
|
const linkedSkills = [];
|
|
80252
80275
|
for (const skill of skills) {
|
|
80253
80276
|
const skillName = skill.name;
|
|
80254
80277
|
const skillSourceDir = path36.dirname(skill.location);
|
|
80255
|
-
const destPath = path36.
|
|
80278
|
+
const destPath = path36.resolve(resolvedTarget, skillName);
|
|
80279
|
+
const relative3 = path36.relative(resolvedTarget, destPath);
|
|
80280
|
+
if (isInvalidSubpath(relative3)) {
|
|
80281
|
+
throw new Error("Invalid skill name: Path traversal detected.");
|
|
80282
|
+
}
|
|
80256
80283
|
const exists = await fs36.lstat(destPath).catch(() => null);
|
|
80257
80284
|
if (exists) {
|
|
80258
80285
|
onLog(
|
|
@@ -80273,11 +80300,13 @@ async function uninstallSkill(name, scope) {
|
|
|
80273
80300
|
const workspaceDir = process.cwd();
|
|
80274
80301
|
const storage = new Storage(workspaceDir);
|
|
80275
80302
|
const targetDir = scope === "workspace" ? storage.getProjectSkillsDir() : Storage.getUserSkillsDir();
|
|
80276
|
-
const
|
|
80303
|
+
const resolvedTarget = path36.resolve(targetDir);
|
|
80304
|
+
const discoveredSkills = await loadSkillsFromDir(resolvedTarget);
|
|
80277
80305
|
const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
|
|
80278
80306
|
if (!skillToUninstall) {
|
|
80279
|
-
const skillPath = path36.resolve(
|
|
80280
|
-
|
|
80307
|
+
const skillPath = path36.resolve(resolvedTarget, name);
|
|
80308
|
+
const relative4 = path36.relative(resolvedTarget, skillPath);
|
|
80309
|
+
if (isInvalidSubpath(relative4)) {
|
|
80281
80310
|
return null;
|
|
80282
80311
|
}
|
|
80283
80312
|
const exists = await fs36.lstat(skillPath).catch(() => null);
|
|
@@ -80287,7 +80316,11 @@ async function uninstallSkill(name, scope) {
|
|
|
80287
80316
|
await fs36.rm(skillPath, { recursive: true, force: true });
|
|
80288
80317
|
return { location: skillPath };
|
|
80289
80318
|
}
|
|
80290
|
-
const skillDir = path36.dirname(skillToUninstall.location);
|
|
80319
|
+
const skillDir = path36.resolve(path36.dirname(skillToUninstall.location));
|
|
80320
|
+
const relative3 = path36.relative(resolvedTarget, skillDir);
|
|
80321
|
+
if (isInvalidSubpath(relative3)) {
|
|
80322
|
+
return null;
|
|
80323
|
+
}
|
|
80291
80324
|
await fs36.rm(skillDir, { recursive: true, force: true });
|
|
80292
80325
|
return { location: skillDir };
|
|
80293
80326
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GOJGZJTT.js";
|
|
5
5
|
import {
|
|
6
6
|
RELEASE_CHANNEL_STABILITY,
|
|
7
7
|
debugLogger,
|
|
8
8
|
getChannelFromVersion,
|
|
9
9
|
isGitRepository
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NELP7HPM.js";
|
|
11
11
|
|
|
12
12
|
// packages/cli/src/utils/installationInfo.ts
|
|
13
13
|
import * as fs from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C5HEG6L3.js";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__require
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
exitCli,
|
|
8
8
|
require_source
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F754PAF2.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_BACKGROUND_OPACITY,
|
|
12
12
|
DEFAULT_BORDER_OPACITY,
|
|
@@ -58,14 +58,14 @@ import {
|
|
|
58
58
|
stripUnsafeCharacters,
|
|
59
59
|
toCodePoints,
|
|
60
60
|
validateCustomTheme
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-FKMHT24L.js";
|
|
62
62
|
import {
|
|
63
63
|
isDevelopment
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-32OC6X7M.js";
|
|
65
65
|
import {
|
|
66
66
|
emptyIcon,
|
|
67
67
|
require_react
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-PIL3VMYY.js";
|
|
69
69
|
import {
|
|
70
70
|
ALL_EDITORS,
|
|
71
71
|
ApprovalMode,
|
|
@@ -243,7 +243,7 @@ import {
|
|
|
243
243
|
tokenLimit,
|
|
244
244
|
uiTelemetryService,
|
|
245
245
|
unescapePath
|
|
246
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-4D6ZATMR.js";
|
|
247
247
|
import {
|
|
248
248
|
require_src
|
|
249
249
|
} from "./chunk-TUDYL3X4.js";
|
|
@@ -11708,9 +11708,9 @@ var require_prompts = __commonJS({
|
|
|
11708
11708
|
$3.date = (args) => toPrompt("DatePrompt", args);
|
|
11709
11709
|
$3.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
11710
11710
|
$3.list = (args) => {
|
|
11711
|
-
const
|
|
11711
|
+
const sep5 = args.separator || ",";
|
|
11712
11712
|
return toPrompt("TextPrompt", args, {
|
|
11713
|
-
onSubmit: (str) => str.split(
|
|
11713
|
+
onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
|
|
11714
11714
|
});
|
|
11715
11715
|
};
|
|
11716
11716
|
$3.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -13998,9 +13998,9 @@ var require_prompts2 = __commonJS({
|
|
|
13998
13998
|
$3.date = (args) => toPrompt("DatePrompt", args);
|
|
13999
13999
|
$3.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
14000
14000
|
$3.list = (args) => {
|
|
14001
|
-
const
|
|
14001
|
+
const sep5 = args.separator || ",";
|
|
14002
14002
|
return toPrompt("TextPrompt", args, {
|
|
14003
|
-
onSubmit: (str) => str.split(
|
|
14003
|
+
onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
|
|
14004
14004
|
});
|
|
14005
14005
|
};
|
|
14006
14006
|
$3.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -34598,9 +34598,16 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
|
|
|
34598
34598
|
match[2],
|
|
34599
34599
|
match[3]
|
|
34600
34600
|
);
|
|
34601
|
-
|
|
34602
|
-
|
|
34603
|
-
|
|
34601
|
+
if (this.terminalBackgroundColor === "#ffffff" && this.isTmux()) {
|
|
34602
|
+
debugLogger.log(
|
|
34603
|
+
"Ignored #ffffff background in tmux (common false positive over mosh)."
|
|
34604
|
+
);
|
|
34605
|
+
this.terminalBackgroundColor = void 0;
|
|
34606
|
+
} else {
|
|
34607
|
+
debugLogger.log(
|
|
34608
|
+
`Detected terminal background color: ${this.terminalBackgroundColor}`
|
|
34609
|
+
);
|
|
34610
|
+
}
|
|
34604
34611
|
}
|
|
34605
34612
|
}
|
|
34606
34613
|
if (!kittyKeyboardReceived && _TerminalCapabilityManager.KITTY_REGEX.test(buffer)) {
|
|
@@ -40577,8 +40584,8 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
|
|
|
40577
40584
|
}
|
|
40578
40585
|
const envContent = formatEnvContent(nonSensitiveSettings);
|
|
40579
40586
|
if (fsSync.existsSync(envFilePath)) {
|
|
40580
|
-
const
|
|
40581
|
-
if (
|
|
40587
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40588
|
+
if (stat7.isDirectory()) {
|
|
40582
40589
|
throw new Error(
|
|
40583
40590
|
`Cannot write extension settings to ${envFilePath} because it is a directory.`
|
|
40584
40591
|
);
|
|
@@ -40622,8 +40629,8 @@ async function getScopedEnvContents(extensionConfig, extensionId, scope, workspa
|
|
|
40622
40629
|
const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
|
|
40623
40630
|
let customEnv = {};
|
|
40624
40631
|
if (fsSync.existsSync(envFilePath)) {
|
|
40625
|
-
const
|
|
40626
|
-
if (!
|
|
40632
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40633
|
+
if (!stat7.isDirectory()) {
|
|
40627
40634
|
const envFile = fsSync.readFileSync(envFilePath, "utf-8");
|
|
40628
40635
|
customEnv = dotenv.parse(envFile);
|
|
40629
40636
|
}
|
|
@@ -40691,8 +40698,8 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40691
40698
|
const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
|
|
40692
40699
|
let envContent = "";
|
|
40693
40700
|
if (fsSync.existsSync(envFilePath)) {
|
|
40694
|
-
const
|
|
40695
|
-
if (
|
|
40701
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40702
|
+
if (stat7.isDirectory()) {
|
|
40696
40703
|
throw new Error(
|
|
40697
40704
|
`Cannot write extension settings to ${envFilePath} because it is a directory.`
|
|
40698
40705
|
);
|
|
@@ -40740,8 +40747,8 @@ function getSettingsChanges(settings, oldSettings) {
|
|
|
40740
40747
|
}
|
|
40741
40748
|
async function clearSettings(envFilePath, keychain) {
|
|
40742
40749
|
if (fsSync.existsSync(envFilePath)) {
|
|
40743
|
-
const
|
|
40744
|
-
if (!
|
|
40750
|
+
const stat7 = fsSync.statSync(envFilePath);
|
|
40751
|
+
if (!stat7.isDirectory()) {
|
|
40745
40752
|
await fs11.writeFile(envFilePath, "");
|
|
40746
40753
|
}
|
|
40747
40754
|
}
|
|
@@ -56544,7 +56551,7 @@ var authCommand = {
|
|
|
56544
56551
|
import process29 from "node:process";
|
|
56545
56552
|
|
|
56546
56553
|
// packages/cli/src/generated/git-commit.ts
|
|
56547
|
-
var GIT_COMMIT_INFO = "
|
|
56554
|
+
var GIT_COMMIT_INFO = "35b1f0211";
|
|
56548
56555
|
|
|
56549
56556
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
56550
56557
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -62325,7 +62332,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
62325
62332
|
type: "info",
|
|
62326
62333
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
62327
62334
|
});
|
|
62328
|
-
const { MCPOAuthProvider } = await import("./dist-
|
|
62335
|
+
const { MCPOAuthProvider } = await import("./dist-XJ5HWKG4.js");
|
|
62329
62336
|
let oauthConfig = server.oauth;
|
|
62330
62337
|
if (!oauthConfig) {
|
|
62331
62338
|
oauthConfig = { enabled: false };
|
|
@@ -80166,6 +80173,12 @@ function renderSkillActionFeedback(result, formatScope) {
|
|
|
80166
80173
|
const s3 = formatScopeItem(totalAffectedScopes[0]);
|
|
80167
80174
|
return `Skill "${skillName}" ${actionVerb} ${preposition} ${s3} settings.`;
|
|
80168
80175
|
}
|
|
80176
|
+
function isPathTraversal(relative3) {
|
|
80177
|
+
return relative3 === ".." || relative3.startsWith(".." + path36.sep) || path36.isAbsolute(relative3);
|
|
80178
|
+
}
|
|
80179
|
+
function isInvalidSubpath(relative3) {
|
|
80180
|
+
return relative3 === "" || isPathTraversal(relative3);
|
|
80181
|
+
}
|
|
80169
80182
|
async function installSkill(source2, scope, subpath, onLog, requestConsent = () => Promise.resolve(true)) {
|
|
80170
80183
|
let sourcePath = source2;
|
|
80171
80184
|
let tempDirToClean = void 0;
|
|
@@ -80197,8 +80210,12 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
80197
80210
|
sourcePath = path36.join(sourcePath, subpath);
|
|
80198
80211
|
}
|
|
80199
80212
|
sourcePath = path36.resolve(sourcePath);
|
|
80200
|
-
if (tempDirToClean
|
|
80201
|
-
|
|
80213
|
+
if (tempDirToClean) {
|
|
80214
|
+
const resolvedTemp = path36.resolve(tempDirToClean);
|
|
80215
|
+
const relative3 = path36.relative(resolvedTemp, sourcePath);
|
|
80216
|
+
if (isPathTraversal(relative3)) {
|
|
80217
|
+
throw new Error("Invalid path: Directory traversal not allowed.");
|
|
80218
|
+
}
|
|
80202
80219
|
}
|
|
80203
80220
|
onLog(`Searching for skills in ${sourcePath}...`);
|
|
80204
80221
|
const skills = await loadSkillsFromDir(sourcePath);
|
|
@@ -80213,13 +80230,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
80213
80230
|
if (!await requestConsent(skills, targetDir)) {
|
|
80214
80231
|
throw new Error("Skill installation cancelled by user.");
|
|
80215
80232
|
}
|
|
80216
|
-
|
|
80233
|
+
const resolvedTarget = path36.resolve(targetDir);
|
|
80234
|
+
await fs36.mkdir(resolvedTarget, { recursive: true });
|
|
80217
80235
|
const installedSkills = [];
|
|
80218
80236
|
for (const skill of skills) {
|
|
80219
80237
|
const skillName = skill.name;
|
|
80220
80238
|
const skillDir = path36.dirname(skill.location);
|
|
80221
|
-
const destPath = path36.
|
|
80222
|
-
const
|
|
80239
|
+
const destPath = path36.resolve(resolvedTarget, skillName);
|
|
80240
|
+
const relative3 = path36.relative(resolvedTarget, destPath);
|
|
80241
|
+
if (isInvalidSubpath(relative3)) {
|
|
80242
|
+
throw new Error("Invalid skill name: Path traversal detected.");
|
|
80243
|
+
}
|
|
80244
|
+
const exists = await fs36.lstat(destPath).catch(() => null);
|
|
80223
80245
|
if (exists) {
|
|
80224
80246
|
onLog(`Skill "${skillName}" already exists. Overwriting...`);
|
|
80225
80247
|
await fs36.rm(destPath, { recursive: true, force: true });
|
|
@@ -80260,12 +80282,17 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
|
|
|
80260
80282
|
if (!await requestConsent(skills, targetDir)) {
|
|
80261
80283
|
throw new Error("Skill linking cancelled by user.");
|
|
80262
80284
|
}
|
|
80263
|
-
|
|
80285
|
+
const resolvedTarget = path36.resolve(targetDir);
|
|
80286
|
+
await fs36.mkdir(resolvedTarget, { recursive: true });
|
|
80264
80287
|
const linkedSkills = [];
|
|
80265
80288
|
for (const skill of skills) {
|
|
80266
80289
|
const skillName = skill.name;
|
|
80267
80290
|
const skillSourceDir = path36.dirname(skill.location);
|
|
80268
|
-
const destPath = path36.
|
|
80291
|
+
const destPath = path36.resolve(resolvedTarget, skillName);
|
|
80292
|
+
const relative3 = path36.relative(resolvedTarget, destPath);
|
|
80293
|
+
if (isInvalidSubpath(relative3)) {
|
|
80294
|
+
throw new Error("Invalid skill name: Path traversal detected.");
|
|
80295
|
+
}
|
|
80269
80296
|
const exists = await fs36.lstat(destPath).catch(() => null);
|
|
80270
80297
|
if (exists) {
|
|
80271
80298
|
onLog(
|
|
@@ -80286,11 +80313,13 @@ async function uninstallSkill(name, scope) {
|
|
|
80286
80313
|
const workspaceDir = process.cwd();
|
|
80287
80314
|
const storage = new Storage(workspaceDir);
|
|
80288
80315
|
const targetDir = scope === "workspace" ? storage.getProjectSkillsDir() : Storage.getUserSkillsDir();
|
|
80289
|
-
const
|
|
80316
|
+
const resolvedTarget = path36.resolve(targetDir);
|
|
80317
|
+
const discoveredSkills = await loadSkillsFromDir(resolvedTarget);
|
|
80290
80318
|
const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
|
|
80291
80319
|
if (!skillToUninstall) {
|
|
80292
|
-
const skillPath = path36.resolve(
|
|
80293
|
-
|
|
80320
|
+
const skillPath = path36.resolve(resolvedTarget, name);
|
|
80321
|
+
const relative4 = path36.relative(resolvedTarget, skillPath);
|
|
80322
|
+
if (isInvalidSubpath(relative4)) {
|
|
80294
80323
|
return null;
|
|
80295
80324
|
}
|
|
80296
80325
|
const exists = await fs36.lstat(skillPath).catch(() => null);
|
|
@@ -80300,7 +80329,11 @@ async function uninstallSkill(name, scope) {
|
|
|
80300
80329
|
await fs36.rm(skillPath, { recursive: true, force: true });
|
|
80301
80330
|
return { location: skillPath };
|
|
80302
80331
|
}
|
|
80303
|
-
const skillDir = path36.dirname(skillToUninstall.location);
|
|
80332
|
+
const skillDir = path36.resolve(path36.dirname(skillToUninstall.location));
|
|
80333
|
+
const relative3 = path36.relative(resolvedTarget, skillDir);
|
|
80334
|
+
if (isInvalidSubpath(relative3)) {
|
|
80335
|
+
return null;
|
|
80336
|
+
}
|
|
80304
80337
|
await fs36.rm(skillDir, { recursive: true, force: true });
|
|
80305
80338
|
return { location: skillDir };
|
|
80306
80339
|
}
|