several changes

This commit is contained in:
2026-02-20 15:36:45 +00:00
parent cb1f893e3d
commit 6a82a3c5d2
7 changed files with 3487 additions and 11 deletions

View File

@@ -8,5 +8,6 @@ mkdir -p "$HOME/.cache"
{ {
ssh mac-attio "mkdir -p ~/.pi/agent/themes" ssh mac-attio "mkdir -p ~/.pi/agent/themes"
scp "$HOME/.pi/agent/themes/matugen.json" \ scp "$HOME/.pi/agent/themes/matugen.json" \
mac-attio:~/.pi/agent/themes/ mac-attio:~/.pi/agent/themes/matugen.json.tmp
ssh mac-attio "mv ~/.pi/agent/themes/matugen.json.tmp ~/.pi/agent/themes/matugen.json"
} >>"$log_file" 2>&1 } >>"$log_file" 2>&1

View File

@@ -0,0 +1 @@
node_modules

View File

@@ -0,0 +1,21 @@
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
export default [
{
files: ["**/*.ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
plugins: {
"@typescript-eslint": tseslint,
},
rules: {
...tseslint.configs.recommended.rules,
},
},
];

View File

@@ -96,7 +96,7 @@ async function loadThemeFromPath(filePath: string): Promise<PiTheme> {
}); });
} }
export default function (pi: ExtensionAPI) { export default function matugenThemeWatch(pi: ExtensionAPI) {
let watcher: fs.StatWatcher | null = null; let watcher: fs.StatWatcher | null = null;
let debounce: NodeJS.Timeout | null = null; let debounce: NodeJS.Timeout | null = null;
@@ -113,14 +113,14 @@ export default function (pi: ExtensionAPI) {
} }
debounce = setTimeout(async () => { debounce = setTimeout(async () => {
try { // i wish this fucking worked
const theme = await loadThemeFromPath(THEME_PATH); // pi.sendUserMessage("/reload", { deliverAs: "followUp" });
const result = ctx.ui.setTheme(theme); const theme = await loadThemeFromPath(THEME_PATH);
if (!result.success && result.error) { const res = ctx.ui.setTheme(theme);
ctx.ui.notify(`Theme reload failed: ${result.error}`, "error"); if (res.success) {
} ctx.ui.notify("Background changed. Colors: ", "info");
} catch (error) { } else {
ctx.ui.notify(`Theme reload failed: ${String(error)}`, "error"); ctx.ui.notify("Theme update failed, fuck", "error");
} }
}, 150); }, 150);
}, },
@@ -132,7 +132,8 @@ export default function (pi: ExtensionAPI) {
pi.on("session_shutdown", () => { pi.on("session_shutdown", () => {
if (watcher) { if (watcher) {
fs.unwatchFile(THEME_PATH, watcher); // eslint-disable-next-line @typescript-eslint/no-explicit-any -- weird types
fs.unwatchFile(THEME_PATH, watcher as any);
watcher = null; watcher = null;
} }
if (debounce) { if (debounce) {

View File

@@ -0,0 +1,13 @@
{
"name": "pi-extensions",
"private": true,
"type": "module",
"devDependencies": {
"@types/node": "^20.11.0",
"@mariozechner/pi-coding-agent": "^0.54.0",
"@sinclair/typebox": "^0.34.0",
"eslint": "^9.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true
},
"include": ["**/*.ts"]
}