update pi defaults
This commit is contained in:
@@ -8,23 +8,23 @@
|
|||||||
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||||
|
|
||||||
export default function (pi: ExtensionAPI) {
|
export default function (pi: ExtensionAPI) {
|
||||||
const protectedPaths = [".env", ".git/", "node_modules/"];
|
const protectedPaths = [".git/", "node_modules/"];
|
||||||
|
|
||||||
pi.on("tool_call", async (event, ctx) => {
|
pi.on("tool_call", async (event, ctx) => {
|
||||||
if (event.toolName !== "write" && event.toolName !== "edit") {
|
if (event.toolName !== "write" && event.toolName !== "edit") {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = event.input.path as string;
|
const path = event.input.path as string;
|
||||||
const isProtected = protectedPaths.some((p) => path.includes(p));
|
const isProtected = protectedPaths.some((p) => path.includes(p));
|
||||||
|
|
||||||
if (isProtected) {
|
if (isProtected) {
|
||||||
if (ctx.hasUI) {
|
if (ctx.hasUI) {
|
||||||
ctx.ui.notify(`Blocked write to protected path: ${path}`, "warning");
|
ctx.ui.notify(`Blocked write to protected path: ${path}`, "warning");
|
||||||
}
|
}
|
||||||
return { block: true, reason: `Path "${path}" is protected` };
|
return { block: true, reason: `Path "${path}" is protected` };
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"lastChangelogVersion": "0.56.1",
|
"lastChangelogVersion": "0.56.1",
|
||||||
"defaultProvider": "openrouter",
|
"defaultProvider": "openrouter",
|
||||||
"defaultModel": "openai/gpt-5.3-codex",
|
"defaultModel": "openai/gpt-5.3-codex",
|
||||||
"defaultThinkingLevel": "medium",
|
"defaultThinkingLevel": "high",
|
||||||
"theme": "matugen",
|
"theme": "matugen",
|
||||||
"lsp": {
|
"lsp": {
|
||||||
"hookMode": "edit_write"
|
"hookMode": "edit_write"
|
||||||
|
|||||||
Reference in New Issue
Block a user