Add BRAIN_DISABLED flag and fix Ollama tool call formatting
Features: - Add BRAIN_DISABLED feature flag to hide all Brain functionality - When enabled, hides Brain banner, status indicator, menu, and commands - Flag location: src/constants/brain.ts Fixes: - Fix Ollama 400 error by properly formatting tool_calls in messages - Update OllamaMessage type to include tool_calls field - Fix Brain menu keyboard not working (add missing modes to isMenuOpen) UI Changes: - Remove "^Tab toggle mode" hint from status bar - Remove "ctrl+t to hide todos" hint from status bar Files modified: - src/constants/brain.ts (add BRAIN_DISABLED flag) - src/types/ollama.ts (add tool_calls to OllamaMessage) - src/providers/ollama/chat.ts (format tool_calls in messages) - src/tui-solid/components/header.tsx (hide Brain UI when disabled) - src/tui-solid/components/status-bar.tsx (remove hints) - src/tui-solid/components/command-menu.tsx (filter brain command) - src/tui-solid/components/input-area.tsx (fix isMenuOpen modes) - src/tui-solid/routes/session.tsx (skip brain menu when disabled) - src/services/brain.ts (early return when disabled) - src/services/chat-tui/initialize.ts (skip brain init when disabled)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import type { ProviderModel } from "@/types/providers";
|
||||
import type { BrainConnectionStatus, BrainUser } from "@/types/brain";
|
||||
|
||||
// ============================================================================
|
||||
// App Mode Types
|
||||
@@ -28,7 +29,9 @@ export type AppMode =
|
||||
| "provider_select"
|
||||
| "learning_prompt"
|
||||
| "help_menu"
|
||||
| "help_detail";
|
||||
| "help_detail"
|
||||
| "brain_menu"
|
||||
| "brain_login";
|
||||
|
||||
/** Screen mode for determining which view to show */
|
||||
export type ScreenMode = "home" | "session";
|
||||
@@ -230,6 +233,7 @@ export interface SessionStats {
|
||||
outputTokens: number;
|
||||
thinkingStartTime: number | null;
|
||||
lastThinkingDuration: number;
|
||||
contextMaxTokens: number;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -270,6 +274,9 @@ export interface AppState {
|
||||
// Screen mode (home vs session)
|
||||
screenMode: ScreenMode;
|
||||
|
||||
// Interaction mode (agent, ask, code-review)
|
||||
interactionMode: InteractionMode;
|
||||
|
||||
// Input state
|
||||
inputBuffer: string;
|
||||
inputCursorPosition: number;
|
||||
@@ -318,9 +325,20 @@ export interface AppState {
|
||||
// Suggestion prompts state
|
||||
suggestions: SuggestionState;
|
||||
|
||||
// Brain state
|
||||
brain: {
|
||||
status: BrainConnectionStatus;
|
||||
user: BrainUser | null;
|
||||
knowledgeCount: number;
|
||||
memoryCount: number;
|
||||
showBanner: boolean;
|
||||
};
|
||||
|
||||
// Actions
|
||||
setMode: (mode: AppMode) => void;
|
||||
setScreenMode: (screenMode: ScreenMode) => void;
|
||||
setInteractionMode: (mode: InteractionMode) => void;
|
||||
toggleInteractionMode: () => void;
|
||||
setInputBuffer: (buffer: string) => void;
|
||||
setInputCursorPosition: (position: number) => void;
|
||||
appendToInput: (text: string) => void;
|
||||
@@ -389,6 +407,13 @@ export interface AppState {
|
||||
hideSuggestions: () => void;
|
||||
showSuggestions: () => void;
|
||||
|
||||
// Brain actions
|
||||
setBrainStatus: (status: BrainConnectionStatus) => void;
|
||||
setBrainUser: (user: BrainUser | null) => void;
|
||||
setBrainCounts: (knowledge: number, memory: number) => void;
|
||||
setBrainShowBanner: (show: boolean) => void;
|
||||
dismissBrainBanner: () => void;
|
||||
|
||||
// Computed
|
||||
isInputLocked: () => boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user