mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 07:04:34 +00:00
Release v0.11.5
This commit is contained in:
parent
cdc64c7569
commit
7a1884f85c
14 changed files with 341 additions and 40 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue