Release v0.11.5

This commit is contained in:
Mario Zechner 2025-12-01 20:22:14 +01:00
parent cdc64c7569
commit 7a1884f85c
14 changed files with 341 additions and 40 deletions

View file

@ -21,6 +21,7 @@ import { getApiKeyForModel, getAvailableModels } from "../model-config.js";
import { listOAuthProviders, login, logout } from "../oauth/index.js";
import type { SessionManager } from "../session-manager.js";
import type { SettingsManager } from "../settings-manager.js";
import { expandSlashCommand, type FileSlashCommand, loadSlashCommands } from "../slash-commands.js";
import { getEditorTheme, getMarkdownTheme, onThemeChange, setTheme, theme } from "../theme/theme.js";
import { AssistantMessageComponent } from "./assistant-message.js";
import { CustomEditor } from "./custom-editor.js";
@ -97,6 +98,9 @@ export class TuiRenderer {
// Agent subscription unsubscribe function
private unsubscribe?: () => void;
// File-based slash commands
private fileCommands: FileSlashCommand[] = [];
constructor(
agent: Agent,
sessionManager: SessionManager,
@ -179,6 +183,15 @@ export class TuiRenderer {
description: "Clear context and start a fresh session",
};
// Load file-based slash commands
this.fileCommands = loadSlashCommands();
// Convert file commands to SlashCommand format
const fileSlashCommands: SlashCommand[] = this.fileCommands.map((cmd) => ({
name: cmd.name,
description: cmd.description,
}));
// Setup autocomplete for file paths and slash commands
const autocompleteProvider = new CombinedAutocompleteProvider(
[
@ -193,6 +206,7 @@ export class TuiRenderer {
logoutCommand,
queueCommand,
clearCommand,
...fileSlashCommands,
],
process.cwd(),
fdPath,
@ -401,6 +415,9 @@ export class TuiRenderer {
return;
}
// Check for file-based slash commands
text = expandSlashCommand(text, this.fileCommands);
// Normal message submission - validate model and API key first
const currentModel = this.agent.state.model;
if (!currentModel) {