chore: version up to 2.80.34 and package

This commit is contained in:
g1nation
2026-05-12 22:54:21 +09:00
parent 148bfb070b
commit 065e598cca
26 changed files with 2023 additions and 139 deletions
+16 -11
View File
@@ -82,19 +82,20 @@ export function resolveBrainDirFromConfig(): string {
* `_sendAgentsList` and `_createAgent` operate on).
*
* Resolution order:
* 1. The first VS Code workspace folder + `/.agent/skills/` (creating the
* 1. VS Code config `g1nation.agentSkillsPath` (after `~` + abs-path normalization),
* if the user explicitly pointed at a folder.
* 2. The first VS Code workspace folder + `/.agent/skills/` (creating the
* folder is the caller's responsibility).
* 2. Empty string when no workspace is open — callers must short-circuit.
* 3. Empty string when no workspace is open — callers must short-circuit.
*
* The legacy default `E:\Wiki\Agent\.agent\skills` from sidebarProvider.ts is
* preserved as a fall-through hint for the original author's machine.
* Note: a previous version hard-coded `E:\Wiki\Agent\.agent\skills` as a
* fall-through for the original author's Windows machine. That made behavior
* differ between machines (and never matched anything on macOS/Linux), so it
* was removed — use `g1nation.agentSkillsPath` for a non-workspace location.
*/
export function resolveAgentSkillsDir(): string {
const legacy = 'E:\\Wiki\\Agent\\.agent\\skills';
try {
const fs = require('fs') as typeof import('fs');
if (fs.existsSync(legacy)) return legacy;
} catch { /* fs unavailable in some isolated tests */ }
const configured = resolvePathInput(_safeGetConfigString('g1nation', 'agentSkillsPath'));
if (configured) return configured;
const folders = vscode.workspace.workspaceFolders;
if (folders && folders.length > 0) {
@@ -111,8 +112,12 @@ export function resolveAgentSkillsDir(): string {
*/
export function isInside(parent: string, child: string): boolean {
if (!parent || !child) return false;
const p = path.resolve(parent);
const c = path.resolve(child);
// Windows file systems are case-insensitive and path.resolve may emit a
// mixed-case drive letter, so normalize case there before comparing —
// otherwise legitimate writes get rejected just because of casing.
const norm = (p: string) => (process.platform === 'win32' ? path.resolve(p).toLowerCase() : path.resolve(p));
const p = norm(parent);
const c = norm(child);
if (c === p) return true;
return c.startsWith(p + path.sep);
}