From d9464383eca7f9c5cca1008f2c947ced0abad544 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Fri, 16 Jan 2026 04:14:26 +0100 Subject: [PATCH] chore: remove test extension load-file.ts --- .../examples/extensions/load-file.ts | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 packages/coding-agent/examples/extensions/load-file.ts diff --git a/packages/coding-agent/examples/extensions/load-file.ts b/packages/coding-agent/examples/extensions/load-file.ts deleted file mode 100644 index 80dcfc23..00000000 --- a/packages/coding-agent/examples/extensions/load-file.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Load file into editor - for testing editor scrolling - * - * Usage: pi --extension ./examples/extensions/load-file.ts - * - * Commands: - * /load [path] - Load file into editor (defaults to README.md) - */ - -import * as fs from "node:fs"; -import * as path from "node:path"; -import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; - -export default function (pi: ExtensionAPI) { - pi.registerCommand("load", { - description: "Load file into editor (defaults to README.md)", - handler: async (args, ctx) => { - const filePath = args.trim() || "README.md"; - const fullPath = path.resolve(filePath); - - if (!fs.existsSync(fullPath)) { - ctx.ui.notify(`File not found: ${fullPath}`, "error"); - return; - } - - try { - const content = fs.readFileSync(fullPath, "utf-8"); - ctx.ui.setEditorText(content); - ctx.ui.notify(`Loaded ${filePath} (${content.split("\n").length} lines)`); - } catch (err) { - ctx.ui.notify(`Failed to read file: ${err}`, "error"); - } - }, - }); -}