feat(coding-agent): added self-update command with bundled templates

- Added `pi update` command for checking and installing CLI updates from GitHub releases or bun.
- Added cross-platform installer scripts (shell and PowerShell) with automatic PATH configuration.
- Changed HTML export to use compile-time bundled templates via Bun macros.
- Changed `exportToHtml` and `exportFromFile` functions to async operations.
This commit is contained in:
can1357
2026-01-03 14:17:28 +01:00
parent a6715fb8f0
commit a42061d9ee
17 changed files with 475 additions and 157 deletions
@@ -2130,7 +2130,7 @@ export class InteractiveMode {
// HTML file export
try {
const filePath = this.session.exportToHtml(arg);
const filePath = await this.session.exportToHtml(arg);
this.showStatus(`Session exported to: ${filePath}`);
} catch (error: unknown) {
this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
@@ -2153,7 +2153,7 @@ export class InteractiveMode {
// Export to a temp file
const tmpFile = path.join(os.tmpdir(), "session.html");
try {
this.session.exportToHtml(tmpFile);
await this.session.exportToHtml(tmpFile);
} catch (error: unknown) {
this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
return;
@@ -401,7 +401,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
}
case "export_html": {
const path = session.exportToHtml(command.outputPath);
const path = await session.exportToHtml(command.outputPath);
return success(id, "export_html", { path });
}