How hallofcodes/acode-ai-agent-plugin works
Rutex is an Acode mobile-editor plugin that lets a user chat with an AI agent to inspect and modify the active project. The principal flow runs from the chat panel through agent orchestration and a configured model provider, then uses file tools to carry out requested operations; results and edit previews return to the panel. Chat and edit histories persist locally. The README also documents terminal integration, but no implementation path for it appears in the supplied tree. Provider dispatch details are unsampled, so that link is shown as unverified.
Main entry points: panel.ts Chat panel · providers Provider adapters · functions File operation tools · chatHistory.ts Chat and edit history
Components 21
Plugin interface
- Plugin lifecycle
src/main.ts - Sidebar entry
src/sidebar.ts - Chat panel
src/panel.ts - Message rendering
src/panel/markdown.ts - Tool preview rendering
src/panel/commandParser.ts - History navigation
src/panel/historyContainer.ts - Settings UI
src/panel/settingsContainer.ts - Edit review dialog
src/panel/renderEditedFilesDialog.ts
Agent and models
- Agent loop
src/chats/handleAgents.ts - Provider adapters
src/chats/providers - Model catalogs
src/chats/models
Project operations
- Tool definitions
src/chats/tools/ollama_tools.ts - File operation tools
src/chats/tools/functions - Workspace context
src/helpers/workspace.ts
Settings and history
- AI settings
src/chats/settings.ts - Plugin credentials
src/helpers/pluginSettings.ts - Chat and edit history
src/chats/history/chatHistory.ts
Other components
- Acode user
- Acode APIs
- AI provider services
- Project filesystem
Connections 23
- Acode user → Sidebar entry: opens
src/sidebar.ts - Plugin lifecycle → Sidebar entry: registers
src/main.ts - Sidebar entry → Chat panel: opens
src/sidebar.ts - Chat panel → Agent loop: submits tasks
src/panel.ts - Agent loop → Provider adapters: dispatches requests
- Provider adapters → AI provider services: sends prompts
- Provider adapters → Model catalogs: uses model catalogs
- Provider adapters → Tool definitions: offers tools
src/chats/providers/openrouter.ts - Agent loop → File operation tools: executes tools
- File operation tools → Project filesystem: reads and writes
src/chats/tools/functions/edit_file.ts - Chat panel → Workspace context: gets active files
src/panel.ts - Chat panel → Chat and edit history: loads and saves
src/panel.ts - File operation tools → Chat and edit history: records edits
src/chats/tools/functions/edit_file.ts - Chat and edit history → Tool preview rendering: supplies edit history
src/panel/commandParser.ts - File operation tools → Edit review dialog: opens review
src/chats/tools/functions/edit_file.ts - Chat panel → Message rendering: renders messages
src/panel.ts - Chat panel → History navigation: shows history
src/panel.ts - Chat panel → Settings UI: shows settings
src/panel.ts - Settings UI → AI settings: configures
src/panel/settingsContainer.ts - AI settings → Plugin credentials: loads credentials
src/helpers/pluginSettings.ts - Plugin credentials → Acode APIs: registers plugin settings
- Plugin lifecycle → AI settings: loads configuration
src/main.ts - Plugin lifecycle → Chat and edit history: clears on teardown
src/main.ts