e9888367d1
- Implemented in-house, zero-dependency utility modules in `pi-utils` covering DOM manipulation, markdown parsing, templating, browser automation helpers, and terminal buffers. - Migrated packages across the repository to consume the new internal utilities and `omptype` schema validators instead of external dependencies. - Removed multiple external runtime and development dependencies including Zod, Marked, LRU cache, Turndown, and Puppeteer browser packages.
26 lines
839 B
TypeScript
26 lines
839 B
TypeScript
/**
|
|
* Example extension that uses a 3rd party dependency (chalk).
|
|
* Tests that jiti can resolve npm modules correctly.
|
|
*/
|
|
import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
|
|
import chalk from "@oh-my-pi/pi-utils/chalk";
|
|
|
|
export default function (pi: ExtensionAPI) {
|
|
// Log with colors using chalk
|
|
console.log(`${chalk.green("✓")} ${chalk.bold("chalk-logger extension loaded")}`);
|
|
|
|
pi.on("agent_start", async () => {
|
|
console.log(`${chalk.blue("[chalk-logger]")} Agent starting`);
|
|
});
|
|
|
|
pi.on("tool_call", async event => {
|
|
console.log(`${chalk.yellow("[chalk-logger]")} Tool: ${chalk.cyan(event.toolName)}`);
|
|
return undefined;
|
|
});
|
|
|
|
pi.on("agent_end", async event => {
|
|
const count = event.messages.length;
|
|
console.log(`${chalk.green("[chalk-logger]")} Done with ${chalk.bold(String(count))} messages`);
|
|
});
|
|
}
|