gsd-pi 2.70.0-dev.8f4d92b → 2.70.0-dev.c236ea4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/extensions/gsd/pre-execution-checks.js +3 -1
- package/dist/resources/extensions/gsd/validate-directory.js +30 -12
- package/dist/resources/extensions/slash-commands/audit.js +2 -1
- package/dist/resources/extensions/subagent/isolation.js +4 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +13 -13
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +13 -13
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web-mode.js +4 -0
- package/package.json +11 -11
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +38 -15
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +3 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/src/core/lsp/config.ts +43 -17
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +7 -5
- package/src/resources/extensions/gsd/pre-execution-checks.ts +4 -1
- package/src/resources/extensions/gsd/tests/validate-directory.test.ts +33 -1
- package/src/resources/extensions/gsd/validate-directory.ts +33 -11
- package/src/resources/extensions/slash-commands/audit.ts +2 -1
- package/src/resources/extensions/subagent/isolation.ts +4 -3
- /package/dist/web/standalone/.next/static/{j_Ae_qOKzzIlA6oFOxVx4 → LWbeDf2XwDjfq_mOlqoGf}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{j_Ae_qOKzzIlA6oFOxVx4 → LWbeDf2XwDjfq_mOlqoGf}/_ssgManifest.js +0 -0
|
@@ -61,6 +61,33 @@ const WINDOWS_BLOCKED_PATHS = new Set([
|
|
|
61
61
|
"C:\\Program Files (x86)",
|
|
62
62
|
]);
|
|
63
63
|
|
|
64
|
+
const WINDOWS_BLOCKED_SUFFIXES = new Set([
|
|
65
|
+
"\\",
|
|
66
|
+
"\\windows",
|
|
67
|
+
"\\windows\\system32",
|
|
68
|
+
"\\program files",
|
|
69
|
+
"\\program files (x86)",
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
function normalizePathForComparison(dirPath: string): string {
|
|
73
|
+
let normalized = dirPath.replace(/[/\\]+$/, "");
|
|
74
|
+
if (normalized === "") {
|
|
75
|
+
normalized = "/";
|
|
76
|
+
} else if (/^[A-Za-z]:$/.test(normalized)) {
|
|
77
|
+
normalized += "\\";
|
|
78
|
+
}
|
|
79
|
+
return platform() === "win32" ? normalized.toLowerCase() : normalized;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function isBlockedWindowsPath(normalized: string): boolean {
|
|
83
|
+
if (!/^[a-z]:\\/.test(normalized)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const suffix = normalized.slice(2);
|
|
88
|
+
return WINDOWS_BLOCKED_SUFFIXES.has(suffix);
|
|
89
|
+
}
|
|
90
|
+
|
|
64
91
|
// ─── Core Validation ────────────────────────────────────────────────────────────
|
|
65
92
|
|
|
66
93
|
/**
|
|
@@ -84,16 +111,11 @@ export function validateDirectory(dirPath: string): DirectoryValidationResult {
|
|
|
84
111
|
|
|
85
112
|
// Normalize trailing slashes for consistent comparison.
|
|
86
113
|
// Special cases: "/" → "/" (not ""), "C:\" → "C:\" (not "C:")
|
|
87
|
-
|
|
88
|
-
if (normalized === "") {
|
|
89
|
-
normalized = "/";
|
|
90
|
-
} else if (/^[A-Za-z]:$/.test(normalized)) {
|
|
91
|
-
normalized = normalized + "\\";
|
|
92
|
-
}
|
|
114
|
+
const normalized = normalizePathForComparison(resolved);
|
|
93
115
|
|
|
94
116
|
// ── Check 1: Blocked system paths ──────────────────────────────────────
|
|
95
117
|
const blockedPaths = platform() === "win32" ? WINDOWS_BLOCKED_PATHS : UNIX_BLOCKED_PATHS;
|
|
96
|
-
if (blockedPaths.has(normalized)) {
|
|
118
|
+
if (platform() === "win32" ? isBlockedWindowsPath(normalized) : blockedPaths.has(normalized)) {
|
|
97
119
|
return {
|
|
98
120
|
safe: false,
|
|
99
121
|
severity: "blocked",
|
|
@@ -104,9 +126,9 @@ export function validateDirectory(dirPath: string): DirectoryValidationResult {
|
|
|
104
126
|
// ── Check 2: Home directory itself (not subdirs) ───────────────────────
|
|
105
127
|
let resolvedHome: string;
|
|
106
128
|
try {
|
|
107
|
-
resolvedHome = realpathSync(resolve(homedir()))
|
|
129
|
+
resolvedHome = normalizePathForComparison(realpathSync(resolve(homedir())));
|
|
108
130
|
} catch {
|
|
109
|
-
resolvedHome = resolve(homedir())
|
|
131
|
+
resolvedHome = normalizePathForComparison(resolve(homedir()));
|
|
110
132
|
}
|
|
111
133
|
|
|
112
134
|
if (normalized === resolvedHome) {
|
|
@@ -120,9 +142,9 @@ export function validateDirectory(dirPath: string): DirectoryValidationResult {
|
|
|
120
142
|
// ── Check 3: Temp directory root ───────────────────────────────────────
|
|
121
143
|
let resolvedTmp: string;
|
|
122
144
|
try {
|
|
123
|
-
resolvedTmp = realpathSync(resolve(tmpdir()))
|
|
145
|
+
resolvedTmp = normalizePathForComparison(realpathSync(resolve(tmpdir())));
|
|
124
146
|
} catch {
|
|
125
|
-
resolvedTmp = resolve(tmpdir())
|
|
147
|
+
resolvedTmp = normalizePathForComparison(resolve(tmpdir()));
|
|
126
148
|
}
|
|
127
149
|
|
|
128
150
|
if (normalized === resolvedTmp) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
2
|
+
import { mkdirSync } from "node:fs";
|
|
2
3
|
|
|
3
4
|
export default function auditCommand(pi: ExtensionAPI) {
|
|
4
5
|
pi.registerCommand("audit", {
|
|
@@ -39,7 +40,7 @@ export default function auditCommand(pi: ExtensionAPI) {
|
|
|
39
40
|
|
|
40
41
|
// ── Step 3: Ensure the output directory exists ───────────────────────
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
mkdirSync(".gsd/audits", { recursive: true });
|
|
43
44
|
|
|
44
45
|
// ── Step 4: Send the audit prompt to the agent ───────────────────────
|
|
45
46
|
|
|
@@ -53,8 +53,10 @@ interface Baseline {
|
|
|
53
53
|
// Directory helpers
|
|
54
54
|
// ============================================================================
|
|
55
55
|
|
|
56
|
-
function encodeCwd(cwd: string): string {
|
|
57
|
-
|
|
56
|
+
export function encodeCwd(cwd: string): string {
|
|
57
|
+
// Encode the entire cwd so Windows drive letters, separators, and UNC
|
|
58
|
+
// prefixes cannot leak into the isolation path.
|
|
59
|
+
return Buffer.from(cwd, "utf8").toString("base64url");
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
const gsdHome = process.env.GSD_HOME || path.join(os.homedir(), ".gsd");
|
|
@@ -500,4 +502,3 @@ export function readIsolationMode(): IsolationMode {
|
|
|
500
502
|
return "none";
|
|
501
503
|
}
|
|
502
504
|
}
|
|
503
|
-
|
|
File without changes
|
|
File without changes
|