Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,254 changes: 1,254 additions & 0 deletions src/proxy_app/ai_assistant/DESIGN.md

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions src/proxy_app/ai_assistant/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""
AI Assistant System for GUI Windows.

A reusable AI assistant that can be integrated into any GUI tool window.
Provides full context awareness, tool execution, checkpoints for undo,
and streaming responses with thinking visibility.

Main Components:
- AIAssistantCore: Main orchestration class
- WindowContextAdapter: Abstract base for window integration
- LLMBridge: Async LLM communication bridge
- CheckpointManager: Undo/rollback capability
- Tool system: @assistant_tool decorator and execution

Usage:
from proxy_app.ai_assistant import AIAssistantCore, WindowContextAdapter

class MyWindowAdapter(WindowContextAdapter):
# Implement abstract methods
...

core = AIAssistantCore(
window_adapter=my_adapter,
schedule_on_gui=lambda fn: window.after(0, fn),
)
"""

from .assistant_logger import AssistantLogger
from .bridge import LLMBridge, StreamCallbacks
from .checkpoint import Checkpoint, CheckpointManager
from .context import (
WindowContextAdapter,
apply_delta,
compute_context_diff,
compute_delta,
)
from .core import AIAssistantCore, ChatSession, Message
from .prompts import BASE_ASSISTANT_PROMPT, MODEL_FILTER_SYSTEM_PROMPT
from .tools import (
ToolCall,
ToolCallSummary,
ToolDefinition,
ToolExecutor,
ToolResult,
assistant_tool,
)

__all__ = [
# Core
"AIAssistantCore",
"ChatSession",
"Message",
# Bridge
"LLMBridge",
"StreamCallbacks",
# Checkpoint
"CheckpointManager",
"Checkpoint",
# Context
"WindowContextAdapter",
"compute_context_diff",
"compute_delta",
"apply_delta",
# Tools
"assistant_tool",
"ToolDefinition",
"ToolResult",
"ToolCall",
"ToolCallSummary",
"ToolExecutor",
# Prompts
"BASE_ASSISTANT_PROMPT",
"MODEL_FILTER_SYSTEM_PROMPT",
# Logging
"AssistantLogger",
]
11 changes: 11 additions & 0 deletions src/proxy_app/ai_assistant/adapters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
Window Context Adapters for the AI Assistant.

Each adapter connects a specific GUI window to the AI assistant system.
"""

from .model_filter import ModelFilterWindowContext

__all__ = [
"ModelFilterWindowContext",
]
Loading
Loading