mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 06:02:42 +00:00
Merge pull request #510 from mitsuhiko/annotate-bridge-prompt
Annotate bridge prompt
This commit is contained in:
commit
03e3f0d801
9 changed files with 116 additions and 13 deletions
|
|
@ -1051,7 +1051,7 @@ export class InteractiveMode {
|
|||
return;
|
||||
}
|
||||
if (text.startsWith("/export")) {
|
||||
this.handleExportCommand(text);
|
||||
await this.handleExportCommand(text);
|
||||
this.editor.setText("");
|
||||
return;
|
||||
}
|
||||
|
|
@ -2453,12 +2453,12 @@ export class InteractiveMode {
|
|||
// Command handlers
|
||||
// =========================================================================
|
||||
|
||||
private handleExportCommand(text: string): void {
|
||||
private async handleExportCommand(text: string): Promise<void> {
|
||||
const parts = text.split(/\s+/);
|
||||
const outputPath = parts.length > 1 ? parts[1] : undefined;
|
||||
|
||||
try {
|
||||
const filePath = this.session.exportToHtml(outputPath);
|
||||
const filePath = await this.session.exportToHtml(outputPath);
|
||||
this.showStatus(`Session exported to: ${filePath}`);
|
||||
} catch (error: unknown) {
|
||||
this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
|
||||
|
|
@ -2481,7 +2481,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;
|
||||
|
|
|
|||
|
|
@ -443,7 +443,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 });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue