@agentprojectcontext/apx 1.25.0 → 1.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +42 -12
- package/skills/apx/SKILL.md +50 -119
- package/skills/apx-agency-agents/SKILL.md +141 -0
- package/skills/apx-agent/SKILL.md +100 -0
- package/skills/apx-mcp/SKILL.md +114 -0
- package/skills/apx-mcp-builder/SKILL.md +186 -0
- package/skills/apx-project/SKILL.md +100 -0
- package/skills/apx-routine/SKILL.md +138 -0
- package/skills/apx-runtime/SKILL.md +115 -0
- package/skills/apx-sessions/SKILL.md +281 -0
- package/skills/apx-skill-builder/SKILL.md +149 -0
- package/skills/apx-task/SKILL.md +95 -0
- package/skills/apx-telegram/SKILL.md +115 -0
- package/skills/apx-voice/SKILL.md +135 -0
- package/src/core/agent/constants.js +3 -0
- package/src/core/agent/ghost-guard.js +24 -0
- package/src/core/agent/index.js +35 -0
- package/src/core/agent/model-router.js +257 -0
- package/src/core/agent/prompt-builder.js +313 -0
- package/src/core/agent/prompts/channels/api.md +7 -0
- package/src/core/agent/prompts/channels/cli.md +6 -0
- package/src/core/agent/prompts/channels/code.md +20 -0
- package/src/core/agent/prompts/channels/deck.md +6 -0
- package/src/core/agent/prompts/channels/desktop.md +24 -0
- package/src/core/agent/prompts/channels/routine.md +9 -0
- package/src/core/agent/prompts/channels/telegram.md +9 -0
- package/src/core/agent/prompts/channels/terminal.md +16 -0
- package/src/core/agent/prompts/channels/web.md +7 -0
- package/src/core/agent/prompts/channels/web_sidebar.md +7 -0
- package/src/core/agent/prompts/modes/voice.md +4 -0
- package/src/core/agent/prompts/super-agent-base.md +42 -0
- package/src/core/agent/pseudo-tools.js +40 -0
- package/src/core/agent/retry.js +85 -0
- package/src/core/agent/run-agent.js +423 -0
- package/src/core/agent/self-memory.js +155 -0
- package/src/{daemon → core/agent}/tool-call-parser.js +83 -10
- package/src/core/agent/tools-overlap.js +66 -0
- package/src/core/apc-skill-sync.js +97 -0
- package/src/core/code-sessions-store.js +150 -0
- package/src/core/config.js +473 -11
- package/src/core/desktop/autostart.js +162 -0
- package/src/core/engines/_health.js +63 -0
- package/src/{daemon → core}/engines/anthropic.js +16 -0
- package/src/core/engines/gemini.js +168 -0
- package/src/core/engines/groq.js +8 -0
- package/src/{daemon → core}/engines/index.js +3 -1
- package/src/{daemon → core}/engines/mock.js +22 -0
- package/src/{daemon → core}/engines/ollama.js +35 -0
- package/src/core/engines/openai-compatible.js +145 -0
- package/src/core/engines/openai.js +8 -0
- package/src/core/engines/openrouter.js +8 -0
- package/src/core/git-baseline.js +147 -0
- package/src/core/identity.js +21 -0
- package/src/core/logging.js +1 -1
- package/src/core/mcp/index.js +14 -0
- package/src/{daemon/mcp-runner.js → core/mcp/runner.js} +18 -6
- package/src/core/mcp/sources.js +246 -0
- package/src/core/memory/active-threads.js +124 -0
- package/src/core/memory/broker.js +144 -0
- package/src/core/memory/compactor.js +186 -0
- package/src/core/memory/embed-engines/gemini.js +62 -0
- package/src/core/memory/embed-engines/index.js +148 -0
- package/src/core/memory/embed-engines/ollama.js +55 -0
- package/src/core/memory/embed-engines/openai.js +64 -0
- package/src/core/memory/embed-engines/tf.js +20 -0
- package/src/core/memory/embeddings.js +132 -0
- package/src/core/memory/index.js +161 -0
- package/src/core/memory/indexer.js +257 -0
- package/src/core/memory/store.js +231 -0
- package/src/core/messages-store.js +143 -25
- package/src/core/parser.js +78 -16
- package/src/core/scaffold.js +175 -79
- package/src/core/tasks-store.js +264 -0
- package/src/core/telegram-identity.js +126 -0
- package/src/core/tools/index.js +6 -0
- package/src/core/voice/engines/elevenlabs.js +96 -0
- package/src/core/voice/engines/gemini.js +148 -0
- package/src/core/voice/engines/index.js +144 -0
- package/src/core/voice/engines/mock.js +59 -0
- package/src/core/voice/engines/openai.js +82 -0
- package/src/core/voice/engines/piper.js +93 -0
- package/src/core/voice/index.js +3 -0
- package/src/core/voice/tts.js +89 -0
- package/src/{daemon → host/daemon}/apc-runtime-context.js +1 -1
- package/src/host/daemon/api/admin-config.js +159 -0
- package/src/host/daemon/api/admin.js +72 -0
- package/src/host/daemon/api/agents.js +284 -0
- package/src/host/daemon/api/artifacts.js +52 -0
- package/src/host/daemon/api/code.js +351 -0
- package/src/host/daemon/api/config.js +104 -0
- package/src/host/daemon/api/connections.js +42 -0
- package/src/host/daemon/api/conversations.js +161 -0
- package/src/host/daemon/api/deck.js +511 -0
- package/src/host/daemon/api/desktop.js +71 -0
- package/src/host/daemon/api/embeddings.js +65 -0
- package/src/host/daemon/api/engines.js +80 -0
- package/src/host/daemon/api/exec.js +193 -0
- package/src/host/daemon/api/health.js +10 -0
- package/src/host/daemon/api/identity.js +36 -0
- package/src/host/daemon/api/mcps.js +205 -0
- package/src/host/daemon/api/messages.js +83 -0
- package/src/host/daemon/api/pairing.js +194 -0
- package/src/host/daemon/api/plugins.js +19 -0
- package/src/host/daemon/api/projects.js +35 -0
- package/src/host/daemon/api/routines.js +84 -0
- package/src/host/daemon/api/run.js +55 -0
- package/src/host/daemon/api/runtimes.js +219 -0
- package/src/host/daemon/api/sessions-search.js +177 -0
- package/src/host/daemon/api/sessions.js +115 -0
- package/src/host/daemon/api/shared.js +217 -0
- package/src/host/daemon/api/super-agent.js +208 -0
- package/src/host/daemon/api/tasks.js +118 -0
- package/src/host/daemon/api/telegram.js +325 -0
- package/src/host/daemon/api/tools.js +21 -0
- package/src/host/daemon/api/top-level.js +131 -0
- package/src/host/daemon/api/transcribe.js +35 -0
- package/src/host/daemon/api/tts.js +44 -0
- package/src/host/daemon/api/voice.js +519 -0
- package/src/host/daemon/api/web.js +123 -0
- package/src/host/daemon/api.js +152 -0
- package/src/{daemon → host/daemon}/compact.js +1 -1
- package/src/{daemon → host/daemon}/db.js +19 -5
- package/src/{daemon/overlay-ws.js → host/daemon/desktop-ws.js} +7 -7
- package/src/host/daemon/engine-sessions.js +245 -0
- package/src/{daemon → host/daemon}/index.js +27 -10
- package/src/{daemon/plugins/overlay.js → host/daemon/plugins/desktop.js} +36 -28
- package/src/{daemon → host/daemon}/plugins/index.js +2 -2
- package/src/{daemon → host/daemon}/plugins/telegram.js +165 -33
- package/src/{daemon → host/daemon}/project-config.js +31 -7
- package/src/{daemon → host/daemon}/routines.js +27 -8
- package/src/{daemon → host/daemon}/skills-loader.js +4 -2
- package/src/{daemon → host/daemon}/smoke.js +9 -5
- package/src/{daemon → host/daemon}/super-agent-tools/helpers.js +1 -1
- package/src/host/daemon/super-agent-tools/index.js +157 -0
- package/src/{daemon → host/daemon}/super-agent-tools/registry-bridge.js +1 -1
- package/src/{daemon → host/daemon}/super-agent-tools/tools/add-project.js +2 -2
- package/src/{daemon → host/daemon}/super-agent-tools/tools/ask-questions.js +4 -0
- package/src/{daemon → host/daemon}/super-agent-tools/tools/call-agent.js +5 -2
- package/src/{daemon → host/daemon}/super-agent-tools/tools/call-runtime.js +117 -8
- package/src/host/daemon/super-agent-tools/tools/create-task.js +52 -0
- package/src/{daemon → host/daemon}/super-agent-tools/tools/import-agent.js +2 -3
- package/src/{daemon → host/daemon}/super-agent-tools/tools/list-agents.js +1 -1
- package/src/host/daemon/super-agent-tools/tools/list-tasks.js +52 -0
- package/src/{daemon → host/daemon}/super-agent-tools/tools/list-vault-agents.js +1 -1
- package/src/host/daemon/super-agent-tools/tools/read-self-memory.js +21 -0
- package/src/host/daemon/super-agent-tools/tools/remember.js +40 -0
- package/src/{daemon → host/daemon}/super-agent-tools/tools/search-messages.js +1 -1
- package/src/host/daemon/super-agent-tools/tools/search-sessions.js +134 -0
- package/src/{daemon → host/daemon}/super-agent-tools/tools/send-telegram.js +2 -2
- package/src/{daemon → host/daemon}/super-agent-tools/tools/set-identity.js +1 -1
- package/src/{daemon → host/daemon}/super-agent-tools/tools/set-permission-mode.js +1 -1
- package/src/{daemon → host/daemon}/super-agent-tools/tools/tail-messages.js +1 -1
- package/src/host/daemon/super-agent.js +129 -0
- package/src/host/daemon/token-store.js +118 -0
- package/src/host/daemon/tool-call-parser.js +2 -0
- package/src/{daemon → host/daemon}/transcription.js +1 -1
- package/src/{daemon → host/daemon}/wakeup.js +2 -2
- package/src/interfaces/cli/claude-permissions.js +33 -0
- package/src/{cli → interfaces/cli}/commands/agent.js +43 -8
- package/src/{cli → interfaces/cli}/commands/command.js +1 -1
- package/src/{cli → interfaces/cli}/commands/config.js +1 -1
- package/src/{cli → interfaces/cli}/commands/daemon.js +67 -0
- package/src/interfaces/cli/commands/desktop.js +335 -0
- package/src/interfaces/cli/commands/exec.js +92 -0
- package/src/{cli → interfaces/cli}/commands/identity.js +6 -63
- package/src/{cli → interfaces/cli}/commands/init.js +1 -1
- package/src/{cli → interfaces/cli}/commands/mcp.js +69 -10
- package/src/{cli → interfaces/cli}/commands/memory.js +2 -2
- package/src/interfaces/cli/commands/model.js +136 -0
- package/src/interfaces/cli/commands/pair.js +170 -0
- package/src/interfaces/cli/commands/project-config.js +131 -0
- package/src/{cli → interfaces/cli}/commands/project.js +1 -1
- package/src/{cli → interfaces/cli}/commands/search.js +1 -1
- package/src/interfaces/cli/commands/session.js +892 -0
- package/src/interfaces/cli/commands/sessions.js +997 -0
- package/src/{cli → interfaces/cli}/commands/setup.js +98 -4
- package/src/{cli → interfaces/cli}/commands/skills.js +117 -9
- package/src/{cli → interfaces/cli}/commands/status.js +9 -1
- package/src/{cli → interfaces/cli}/commands/sys.js +96 -17
- package/src/interfaces/cli/commands/task.js +179 -0
- package/src/interfaces/cli/commands/telegram.js +366 -0
- package/src/{cli → interfaces/cli}/commands/update.js +1 -1
- package/src/interfaces/cli/commands/voice.js +258 -0
- package/src/{cli → interfaces/cli}/http.js +6 -2
- package/src/{cli → interfaces/cli}/index.js +955 -63
- package/src/interfaces/cli/postinstall.js +34 -0
- package/src/interfaces/desktop/assets/app-icon-180.png +0 -0
- package/src/interfaces/desktop/assets/app-icon-32.png +0 -0
- package/src/interfaces/desktop/assets/app-icon.png +0 -0
- package/src/interfaces/desktop/assets/apx-logo.png +0 -0
- package/src/interfaces/desktop/assets/superagent.png +0 -0
- package/src/interfaces/desktop/assets/tray-icon.png +0 -0
- package/src/interfaces/desktop/index.html +18 -0
- package/src/interfaces/desktop/main.js +652 -0
- package/src/interfaces/desktop/preload.js +48 -0
- package/src/interfaces/desktop/renderer.js +1006 -0
- package/src/interfaces/desktop/style.css +400 -0
- package/src/{mcp → interfaces/mcp-server}/index.js +2 -2
- package/src/interfaces/tui/_shims/util-which.ts +53 -0
- package/src/{tui → interfaces/tui}/app.tsx +2 -2
- package/src/{tui → interfaces/tui}/component/prompt/index.tsx +4 -1
- package/src/{tui → interfaces/tui}/context/sdk-apx.tsx +84 -16
- package/src/interfaces/tui/context/sync-apx.tsx +398 -0
- package/src/interfaces/tui/routes/session/index.tsx +368 -0
- package/src/interfaces/tui/routes/session/message-actions.tsx +58 -0
- package/src/interfaces/tui/routes/session/sidebar-apx.tsx +114 -0
- package/src/{tui → interfaces/tui}/tsconfig.json +1 -0
- package/src/{tui → interfaces/tui}/util/clipboard.ts +1 -1
- package/src/interfaces/web/README.md +102 -0
- package/src/interfaces/web/coming-soon.html +65 -0
- package/src/interfaces/web/components.json +25 -0
- package/src/interfaces/web/dist/assets/index-BDUsA6L6.css +1 -0
- package/src/interfaces/web/dist/assets/index-CfWyjPBa.js +548 -0
- package/src/interfaces/web/dist/assets/index-CfWyjPBa.js.map +1 -0
- package/src/interfaces/web/dist/favicon/dark/android-chrome-192x192.png +0 -0
- package/src/interfaces/web/dist/favicon/dark/android-chrome-512x512.png +0 -0
- package/src/interfaces/web/dist/favicon/dark/apple-touch-icon.png +0 -0
- package/src/interfaces/web/dist/favicon/dark/favicon-16x16.png +0 -0
- package/src/interfaces/web/dist/favicon/dark/favicon-32x32.png +0 -0
- package/src/interfaces/web/dist/favicon/dark/favicon-48x48.png +0 -0
- package/src/interfaces/web/dist/favicon/dark/favicon.ico +0 -0
- package/src/interfaces/web/dist/favicon/dark/favicon.webp +0 -0
- package/src/interfaces/web/dist/favicon/dark/site.webmanifest +18 -0
- package/src/interfaces/web/dist/favicon/white/android-chrome-192x192.png +0 -0
- package/src/interfaces/web/dist/favicon/white/android-chrome-512x512.png +0 -0
- package/src/interfaces/web/dist/favicon/white/apple-touch-icon.png +0 -0
- package/src/interfaces/web/dist/favicon/white/favicon-16x16.png +0 -0
- package/src/interfaces/web/dist/favicon/white/favicon-32x32.png +0 -0
- package/src/interfaces/web/dist/favicon/white/favicon-48x48.png +0 -0
- package/src/interfaces/web/dist/favicon/white/favicon.ico +0 -0
- package/src/interfaces/web/dist/favicon/white/favicon.webp +0 -0
- package/src/interfaces/web/dist/favicon/white/site.webmanifest +18 -0
- package/src/interfaces/web/dist/index.html +27 -0
- package/src/interfaces/web/dist/logo/logo_dark.webp +0 -0
- package/src/interfaces/web/dist/logo/logo_only_dark.webp +0 -0
- package/src/interfaces/web/dist/logo/logo_only_white.webp +0 -0
- package/src/interfaces/web/dist/logo/logo_vertical_dark.webp +0 -0
- package/src/interfaces/web/dist/logo/logo_vertical_white.webp +0 -0
- package/src/interfaces/web/dist/logo/logo_white.webp +0 -0
- package/src/interfaces/web/dist/modules/superagent.png +0 -0
- package/src/interfaces/web/index.html +26 -0
- package/src/interfaces/web/package-lock.json +4253 -0
- package/src/interfaces/web/package.json +55 -0
- package/src/interfaces/web/playwright.config.ts +45 -0
- package/src/interfaces/web/pnpm-lock.yaml +2946 -0
- package/src/interfaces/web/public/favicon/dark/android-chrome-192x192.png +0 -0
- package/src/interfaces/web/public/favicon/dark/android-chrome-512x512.png +0 -0
- package/src/interfaces/web/public/favicon/dark/apple-touch-icon.png +0 -0
- package/src/interfaces/web/public/favicon/dark/favicon-16x16.png +0 -0
- package/src/interfaces/web/public/favicon/dark/favicon-32x32.png +0 -0
- package/src/interfaces/web/public/favicon/dark/favicon-48x48.png +0 -0
- package/src/interfaces/web/public/favicon/dark/favicon.ico +0 -0
- package/src/interfaces/web/public/favicon/dark/favicon.webp +0 -0
- package/src/interfaces/web/public/favicon/dark/site.webmanifest +18 -0
- package/src/interfaces/web/public/favicon/white/android-chrome-192x192.png +0 -0
- package/src/interfaces/web/public/favicon/white/android-chrome-512x512.png +0 -0
- package/src/interfaces/web/public/favicon/white/apple-touch-icon.png +0 -0
- package/src/interfaces/web/public/favicon/white/favicon-16x16.png +0 -0
- package/src/interfaces/web/public/favicon/white/favicon-32x32.png +0 -0
- package/src/interfaces/web/public/favicon/white/favicon-48x48.png +0 -0
- package/src/interfaces/web/public/favicon/white/favicon.ico +0 -0
- package/src/interfaces/web/public/favicon/white/favicon.webp +0 -0
- package/src/interfaces/web/public/favicon/white/site.webmanifest +18 -0
- package/src/interfaces/web/public/logo/logo_dark.webp +0 -0
- package/src/interfaces/web/public/logo/logo_only_dark.webp +0 -0
- package/src/interfaces/web/public/logo/logo_only_white.webp +0 -0
- package/src/interfaces/web/public/logo/logo_vertical_dark.webp +0 -0
- package/src/interfaces/web/public/logo/logo_vertical_white.webp +0 -0
- package/src/interfaces/web/public/logo/logo_white.webp +0 -0
- package/src/interfaces/web/public/modules/superagent.png +0 -0
- package/src/interfaces/web/src/App.tsx +199 -0
- package/src/interfaces/web/src/components/AddProjectDialog.tsx +121 -0
- package/src/interfaces/web/src/components/ModelCombobox.tsx +96 -0
- package/src/interfaces/web/src/components/RobyBubble.tsx +213 -0
- package/src/interfaces/web/src/components/Section.tsx +44 -0
- package/src/interfaces/web/src/components/TelegramChannelDialog.tsx +97 -0
- package/src/interfaces/web/src/components/TelegramSendDialog.tsx +48 -0
- package/src/interfaces/web/src/components/Toast.tsx +84 -0
- package/src/interfaces/web/src/components/UiSelect.tsx +74 -0
- package/src/interfaces/web/src/components/chat/Composer.tsx +43 -0
- package/src/interfaces/web/src/components/chat/ContextBar.tsx +111 -0
- package/src/interfaces/web/src/components/chat/MessageBubble.tsx +95 -0
- package/src/interfaces/web/src/components/chat/MessageList.tsx +35 -0
- package/src/interfaces/web/src/components/chat/ModelPicker.tsx +145 -0
- package/src/interfaces/web/src/components/chat/ToolCall.tsx +141 -0
- package/src/interfaces/web/src/components/code/CodeChangesTab.tsx +87 -0
- package/src/interfaces/web/src/components/code/CodeComposer.tsx +87 -0
- package/src/interfaces/web/src/components/code/CodeContextTab.tsx +83 -0
- package/src/interfaces/web/src/components/code/CodeProjectPicker.tsx +39 -0
- package/src/interfaces/web/src/components/code/CodeSessionList.tsx +97 -0
- package/src/interfaces/web/src/components/code/CodeSidePanel.tsx +44 -0
- package/src/interfaces/web/src/components/code/CodeToolTrail.tsx +29 -0
- package/src/interfaces/web/src/components/code/DiffView.tsx +67 -0
- package/src/interfaces/web/src/components/common/Qr.tsx +27 -0
- package/src/interfaces/web/src/components/common/TabLayout.tsx +46 -0
- package/src/interfaces/web/src/components/common/TabNav.tsx +113 -0
- package/src/interfaces/web/src/components/config/ConfigTabsEditor.tsx +202 -0
- package/src/interfaces/web/src/components/config/GlobalConfigEditor.tsx +42 -0
- package/src/interfaces/web/src/components/config/global-config-sections.ts +60 -0
- package/src/interfaces/web/src/components/config/project-config-sections.ts +58 -0
- package/src/interfaces/web/src/components/deck/DaemonCard.tsx +58 -0
- package/src/interfaces/web/src/components/deck/DesktopGroup.tsx +33 -0
- package/src/interfaces/web/src/components/deck/WidgetRow.tsx +100 -0
- package/src/interfaces/web/src/components/layout/Logo.tsx +59 -0
- package/src/interfaces/web/src/components/layout/ProjectAvatar.tsx +116 -0
- package/src/interfaces/web/src/components/layout/ProjectSidebar.tsx +151 -0
- package/src/interfaces/web/src/components/settings/AdvancedPanel.tsx +45 -0
- package/src/interfaces/web/src/components/settings/AppearancePanel.tsx +72 -0
- package/src/interfaces/web/src/components/settings/DefaultRouterCard.tsx +232 -0
- package/src/interfaces/web/src/components/settings/DevicesPanel.tsx +60 -0
- package/src/interfaces/web/src/components/settings/EnginesPanel.tsx +127 -0
- package/src/interfaces/web/src/components/settings/IdentityPanel.tsx +69 -0
- package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +226 -0
- package/src/interfaces/web/src/components/settings/PairDeviceDialog.tsx +175 -0
- package/src/interfaces/web/src/components/settings/SuperAgentPanel.tsx +93 -0
- package/src/interfaces/web/src/components/settings/TelegramChannelsPanel.tsx +90 -0
- package/src/interfaces/web/src/components/settings/TelegramContactsPanel.tsx +101 -0
- package/src/interfaces/web/src/components/settings/TelegramGlobalPanel.tsx +100 -0
- package/src/interfaces/web/src/components/settings/TelegramRolesPanel.tsx +108 -0
- package/src/interfaces/web/src/components/settings/TelegramSettingsTabs.tsx +55 -0
- package/src/interfaces/web/src/components/settings/providers/ProviderCard.tsx +95 -0
- package/src/interfaces/web/src/components/settings/providers/ProviderModal.tsx +405 -0
- package/src/interfaces/web/src/components/settings/providers/typeStyles.ts +155 -0
- package/src/interfaces/web/src/components/settings/providers/types.ts +26 -0
- package/src/interfaces/web/src/components/ui/accordion.tsx +72 -0
- package/src/interfaces/web/src/components/ui/alert-dialog.tsx +187 -0
- package/src/interfaces/web/src/components/ui/alert.tsx +76 -0
- package/src/interfaces/web/src/components/ui/aspect-ratio.tsx +22 -0
- package/src/interfaces/web/src/components/ui/avatar.tsx +107 -0
- package/src/interfaces/web/src/components/ui/badge.tsx +52 -0
- package/src/interfaces/web/src/components/ui/breadcrumb.tsx +125 -0
- package/src/interfaces/web/src/components/ui/button-group.tsx +87 -0
- package/src/interfaces/web/src/components/ui/button.tsx +58 -0
- package/src/interfaces/web/src/components/ui/calendar.tsx +221 -0
- package/src/interfaces/web/src/components/ui/card.tsx +103 -0
- package/src/interfaces/web/src/components/ui/carousel.tsx +242 -0
- package/src/interfaces/web/src/components/ui/chart.tsx +371 -0
- package/src/interfaces/web/src/components/ui/chat-input.tsx +122 -0
- package/src/interfaces/web/src/components/ui/checkbox.tsx +29 -0
- package/src/interfaces/web/src/components/ui/collapsible.tsx +19 -0
- package/src/interfaces/web/src/components/ui/combobox.tsx +295 -0
- package/src/interfaces/web/src/components/ui/command.tsx +196 -0
- package/src/interfaces/web/src/components/ui/context-menu.tsx +271 -0
- package/src/interfaces/web/src/components/ui/dialog.tsx +158 -0
- package/src/interfaces/web/src/components/ui/direction.tsx +4 -0
- package/src/interfaces/web/src/components/ui/drawer.tsx +134 -0
- package/src/interfaces/web/src/components/ui/dropdown-menu.tsx +266 -0
- package/src/interfaces/web/src/components/ui/empty.tsx +104 -0
- package/src/interfaces/web/src/components/ui/field.tsx +236 -0
- package/src/interfaces/web/src/components/ui/hover-card.tsx +51 -0
- package/src/interfaces/web/src/components/ui/input-group.tsx +158 -0
- package/src/interfaces/web/src/components/ui/input-otp.tsx +85 -0
- package/src/interfaces/web/src/components/ui/input.tsx +20 -0
- package/src/interfaces/web/src/components/ui/item.tsx +201 -0
- package/src/interfaces/web/src/components/ui/kbd.tsx +26 -0
- package/src/interfaces/web/src/components/ui/label.tsx +20 -0
- package/src/interfaces/web/src/components/ui/menubar.tsx +280 -0
- package/src/interfaces/web/src/components/ui/native-select.tsx +61 -0
- package/src/interfaces/web/src/components/ui/navigation-menu.tsx +168 -0
- package/src/interfaces/web/src/components/ui/pagination.tsx +130 -0
- package/src/interfaces/web/src/components/ui/popover.tsx +88 -0
- package/src/interfaces/web/src/components/ui/progress.tsx +83 -0
- package/src/interfaces/web/src/components/ui/radio-group.tsx +36 -0
- package/src/interfaces/web/src/components/ui/resizable.tsx +50 -0
- package/src/interfaces/web/src/components/ui/scroll-area.tsx +53 -0
- package/src/interfaces/web/src/components/ui/select.tsx +201 -0
- package/src/interfaces/web/src/components/ui/separator.tsx +23 -0
- package/src/interfaces/web/src/components/ui/sheet.tsx +138 -0
- package/src/interfaces/web/src/components/ui/sidebar.tsx +723 -0
- package/src/interfaces/web/src/components/ui/skeleton.tsx +13 -0
- package/src/interfaces/web/src/components/ui/slider.tsx +52 -0
- package/src/interfaces/web/src/components/ui/sonner.tsx +49 -0
- package/src/interfaces/web/src/components/ui/spinner.tsx +10 -0
- package/src/interfaces/web/src/components/ui/switch.tsx +30 -0
- package/src/interfaces/web/src/components/ui/table.tsx +116 -0
- package/src/interfaces/web/src/components/ui/tabs.tsx +72 -0
- package/src/interfaces/web/src/components/ui/textarea.tsx +18 -0
- package/src/interfaces/web/src/components/ui/tip.tsx +21 -0
- package/src/interfaces/web/src/components/ui/toggle-group.tsx +87 -0
- package/src/interfaces/web/src/components/ui/toggle.tsx +45 -0
- package/src/interfaces/web/src/components/ui/tooltip.tsx +64 -0
- package/src/interfaces/web/src/components/ui.tsx +211 -0
- package/src/interfaces/web/src/components/voice/VoiceProviderList.tsx +197 -0
- package/src/interfaces/web/src/components/voice/VoiceProviderModal.tsx +213 -0
- package/src/interfaces/web/src/components/voice/VoiceSttCard.tsx +72 -0
- package/src/interfaces/web/src/components/voice/VoiceTestCard.tsx +112 -0
- package/src/interfaces/web/src/components/voice/useTtsPlayer.ts +59 -0
- package/src/interfaces/web/src/constants/index.ts +91 -0
- package/src/interfaces/web/src/hooks/use-mobile.ts +19 -0
- package/src/interfaces/web/src/hooks/useChat.ts +276 -0
- package/src/interfaces/web/src/hooks/useDaemonStatus.ts +12 -0
- package/src/interfaces/web/src/hooks/useDevices.ts +12 -0
- package/src/interfaces/web/src/hooks/useEngines.ts +10 -0
- package/src/interfaces/web/src/hooks/useGlobalConfig.ts +24 -0
- package/src/interfaces/web/src/hooks/useIdentity.ts +16 -0
- package/src/interfaces/web/src/hooks/useProjects.ts +27 -0
- package/src/interfaces/web/src/hooks/useTelegram.ts +35 -0
- package/src/interfaces/web/src/hooks/useTheme.tsx +57 -0
- package/src/interfaces/web/src/hooks/useTokenBootstrap.ts +122 -0
- package/src/interfaces/web/src/i18n/en.ts +767 -0
- package/src/interfaces/web/src/i18n/es.ts +770 -0
- package/src/interfaces/web/src/i18n/index.ts +86 -0
- package/src/interfaces/web/src/lib/api/admin.ts +30 -0
- package/src/interfaces/web/src/lib/api/agents.ts +46 -0
- package/src/interfaces/web/src/lib/api/code.ts +122 -0
- package/src/interfaces/web/src/lib/api/conversations.ts +16 -0
- package/src/interfaces/web/src/lib/api/deck.ts +106 -0
- package/src/interfaces/web/src/lib/api/desktop.ts +54 -0
- package/src/interfaces/web/src/lib/api/embeddings.ts +44 -0
- package/src/interfaces/web/src/lib/api/engines.ts +17 -0
- package/src/interfaces/web/src/lib/api/filesystem.ts +12 -0
- package/src/interfaces/web/src/lib/api/health.ts +6 -0
- package/src/interfaces/web/src/lib/api/identity.ts +7 -0
- package/src/interfaces/web/src/lib/api/mcps.ts +29 -0
- package/src/interfaces/web/src/lib/api/messages.ts +24 -0
- package/src/interfaces/web/src/lib/api/projects.ts +29 -0
- package/src/interfaces/web/src/lib/api/routines.ts +14 -0
- package/src/interfaces/web/src/lib/api/sessions.ts +16 -0
- package/src/interfaces/web/src/lib/api/super_agent.ts +29 -0
- package/src/interfaces/web/src/lib/api/tasks.ts +19 -0
- package/src/interfaces/web/src/lib/api/telegram.ts +57 -0
- package/src/interfaces/web/src/lib/api/tools.ts +13 -0
- package/src/interfaces/web/src/lib/api/voice.ts +169 -0
- package/src/interfaces/web/src/lib/api.ts +48 -0
- package/src/interfaces/web/src/lib/cn.ts +6 -0
- package/src/interfaces/web/src/lib/code-context.ts +83 -0
- package/src/interfaces/web/src/lib/config-values.ts +29 -0
- package/src/interfaces/web/src/lib/device.ts +10 -0
- package/src/interfaces/web/src/lib/http.ts +104 -0
- package/src/interfaces/web/src/lib/secrets.ts +15 -0
- package/src/interfaces/web/src/lib/utils.ts +6 -0
- package/src/interfaces/web/src/main.tsx +16 -0
- package/src/interfaces/web/src/screens/ApxAdminScreen.tsx +174 -0
- package/src/interfaces/web/src/screens/PairingScreen.tsx +105 -0
- package/src/interfaces/web/src/screens/ProjectScreen.tsx +178 -0
- package/src/interfaces/web/src/screens/SettingsScreen.tsx +111 -0
- package/src/interfaces/web/src/screens/base/AgentDefaultsTab.tsx +274 -0
- package/src/interfaces/web/src/screens/base/ComingSoon.tsx +16 -0
- package/src/interfaces/web/src/screens/base/GlobalTasksTab.tsx +53 -0
- package/src/interfaces/web/src/screens/base/LogsTab.tsx +188 -0
- package/src/interfaces/web/src/screens/base/ModelsTab.tsx +13 -0
- package/src/interfaces/web/src/screens/base/SessionsTab.tsx +58 -0
- package/src/interfaces/web/src/screens/base/WorkspacesTab.tsx +49 -0
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +295 -0
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +173 -0
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +304 -0
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +174 -0
- package/src/interfaces/web/src/screens/project/AgentBrainGraph.tsx +152 -0
- package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +455 -0
- package/src/interfaces/web/src/screens/project/AgentsTab.tsx +364 -0
- package/src/interfaces/web/src/screens/project/ChatTab.tsx +198 -0
- package/src/interfaces/web/src/screens/project/ConfigTab.tsx +94 -0
- package/src/interfaces/web/src/screens/project/McpsTab.tsx +149 -0
- package/src/interfaces/web/src/screens/project/MemoriesTab.tsx +134 -0
- package/src/interfaces/web/src/screens/project/Overview.tsx +37 -0
- package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +386 -0
- package/src/interfaces/web/src/screens/project/TasksTab.tsx +116 -0
- package/src/interfaces/web/src/screens/project/TelegramTab.tsx +126 -0
- package/src/interfaces/web/src/screens/project/ThreadsTab.tsx +100 -0
- package/src/interfaces/web/src/styles.css +128 -0
- package/src/interfaces/web/src/types/daemon.ts +289 -0
- package/src/interfaces/web/tailwind.config.js +53 -0
- package/src/interfaces/web/tsconfig.json +24 -0
- package/src/interfaces/web/vite.config.ts +50 -0
- package/src/cli/commands/exec.js +0 -56
- package/src/cli/commands/overlay.js +0 -253
- package/src/cli/commands/session.js +0 -395
- package/src/cli/commands/sessions.js +0 -517
- package/src/cli/commands/telegram.js +0 -77
- package/src/cli/postinstall.js +0 -75
- package/src/cli-ts/commands/agent.ts +0 -173
- package/src/cli-ts/commands/chat.ts +0 -119
- package/src/cli-ts/commands/daemon.ts +0 -112
- package/src/cli-ts/commands/exec.ts +0 -109
- package/src/cli-ts/commands/mcp.ts +0 -235
- package/src/cli-ts/commands/session.ts +0 -224
- package/src/cli-ts/commands/status.ts +0 -61
- package/src/cli-ts/http.ts +0 -36
- package/src/cli-ts/index.ts +0 -73
- package/src/cli-ts/ui.ts +0 -107
- package/src/daemon/api.js +0 -1558
- package/src/daemon/engines/gemini.js +0 -56
- package/src/daemon/engines/openai.js +0 -79
- package/src/daemon/mcp-sources.js +0 -114
- package/src/daemon/super-agent-tools/index.js +0 -84
- package/src/daemon/super-agent-tools.js +0 -1
- package/src/daemon/super-agent.js +0 -541
- package/src/overlay/index.html +0 -44
- package/src/overlay/main.js +0 -480
- package/src/overlay/preload.js +0 -34
- package/src/overlay/renderer.js +0 -371
- package/src/overlay/style.css +0 -250
- package/src/tui/context/sync-apx.tsx +0 -284
- package/src/tui/routes/session/index.tsx +0 -274
- package/src/tui/routes/session/sidebar-apx.tsx +0 -90
- /package/src/{daemon → core}/tools/browser.js +0 -0
- /package/src/{daemon → core}/tools/fetch.js +0 -0
- /package/src/{daemon → core}/tools/glob.js +0 -0
- /package/src/{daemon → core}/tools/grep.js +0 -0
- /package/src/{daemon → core}/tools/registry.js +0 -0
- /package/src/{daemon → core}/tools/search.js +0 -0
- /package/src/{daemon → host/daemon}/conversations.js +0 -0
- /package/src/{daemon → host/daemon}/env-detect.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/_spawn.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/aider.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/claude-code.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/codex.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/cursor-agent.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/gemini-cli.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/index.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/opencode.js +0 -0
- /package/src/{daemon → host/daemon}/runtimes/qwen-code.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/call-mcp.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/edit-file.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/list-files.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/list-mcps.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/list-projects.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/list-skills.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/load-skill.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/read-agent-memory.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/read-file.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/run-shell.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/search-files.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/transcribe-audio.js +0 -0
- /package/src/{daemon → host/daemon}/super-agent-tools/tools/write-file.js +0 -0
- /package/src/{daemon → host/daemon}/thinking.js +0 -0
- /package/src/{daemon → host/daemon}/whisper-server.py +0 -0
- /package/src/{daemon → host/daemon}/whisper-transcribe.py +0 -0
- /package/src/{cli → interfaces/cli}/commands/a2a.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/artifact.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/chat.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/log.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/messages.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/plugins.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/routine.js +0 -0
- /package/src/{cli → interfaces/cli}/commands/runtime.js +0 -0
- /package/src/{cli → interfaces/cli}/terminal-chat/renderer.js +0 -0
- /package/src/{overlay → interfaces/desktop}/package.json +0 -0
- /package/src/{tui → interfaces/tui}/_shims/cli-error.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/cli-logo.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/cli-ui.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/config-console-state.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/core-any.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/core-binary.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/core-flag.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/core-log.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/lsp-language.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/opencode-any.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/opencode-sdk-v2.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/plugin-tui.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/prompt-display.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/provider-provider.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/session-retry.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/session-schema.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/session-session.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/snapshot.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/tool-any.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/util-error.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/util-filesystem.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/util-format.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/util-iife.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/util-locale.ts +0 -0
- /package/src/{tui → interfaces/tui}/_shims/util-process.ts +0 -0
- /package/src/{tui → interfaces/tui}/asset/charge.wav +0 -0
- /package/src/{tui → interfaces/tui}/asset/pulse-a.wav +0 -0
- /package/src/{tui → interfaces/tui}/asset/pulse-b.wav +0 -0
- /package/src/{tui → interfaces/tui}/asset/pulse-c.wav +0 -0
- /package/src/{tui → interfaces/tui}/attach.ts +0 -0
- /package/src/{tui → interfaces/tui}/component/bg-pulse-render.ts +0 -0
- /package/src/{tui → interfaces/tui}/component/bg-pulse.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/border.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-agent.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-console-org.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-mcp.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-model.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-provider.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-retry-action.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-session-delete-failed.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-session-list.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-session-rename.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-skill.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-stash.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-status.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-tag.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-theme-list.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-variant.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-workspace-create.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-workspace-file-changes.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/dialog-workspace-unavailable.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/error-component.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/logo.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/plugin-route-missing.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/autocomplete.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/cwd.ts +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/frecency.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/history.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/part.ts +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/stash.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/prompt/traits.ts +0 -0
- /package/src/{tui → interfaces/tui}/component/spinner.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/startup-loading.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/todo-item.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/use-connected.tsx +0 -0
- /package/src/{tui → interfaces/tui}/component/workspace-label.tsx +0 -0
- /package/src/{tui → interfaces/tui}/config/cwd.ts +0 -0
- /package/src/{tui → interfaces/tui}/config/keybind.ts +0 -0
- /package/src/{tui → interfaces/tui}/config/tui-migrate.ts +0 -0
- /package/src/{tui → interfaces/tui}/config/tui-schema.ts +0 -0
- /package/src/{tui → interfaces/tui}/config/tui.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/aggregate-failures.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/args.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/command-palette.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/directory.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/editor-zed.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/editor.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/event-apx.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/event.ts +0 -0
- /package/src/{tui → interfaces/tui}/context/exit.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/helper.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/kv.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/local.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/path-format.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/project-apx.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/project.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/prompt.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/route.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/sdk.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/sync-v2.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/sync.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/aura.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/ayu.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/carbonfox.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/catppuccin-frappe.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/catppuccin-macchiato.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/catppuccin.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/cobalt2.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/cursor.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/dracula.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/everforest.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/flexoki.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/github.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/gruvbox.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/kanagawa.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/lucent-orng.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/material.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/matrix.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/mercury.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/monokai.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/nightowl.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/nord.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/one-dark.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/opencode.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/orng.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/osaka-jade.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/palenight.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/rosepine.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/solarized.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/synthwave84.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/tokyonight.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/vercel.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/vesper.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme/zenburn.json +0 -0
- /package/src/{tui → interfaces/tui}/context/theme.tsx +0 -0
- /package/src/{tui → interfaces/tui}/context/tui-config.tsx +0 -0
- /package/src/{tui → interfaces/tui}/event.ts +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/home/footer.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/home/tips-view.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/home/tips.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/sidebar/context.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/sidebar/files.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/sidebar/footer.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/sidebar/lsp.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/sidebar/mcp.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/sidebar/todo.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/system/plugins.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/system/session-v2.tsx +0 -0
- /package/src/{tui → interfaces/tui}/feature-plugins/system/which-key.tsx +0 -0
- /package/src/{tui → interfaces/tui}/keymap.tsx +0 -0
- /package/src/{tui → interfaces/tui}/layer.ts +0 -0
- /package/src/{tui → interfaces/tui}/plugin/api.tsx +0 -0
- /package/src/{tui → interfaces/tui}/plugin/command-shim.ts +0 -0
- /package/src/{tui → interfaces/tui}/plugin/internal.ts +0 -0
- /package/src/{tui → interfaces/tui}/plugin/runtime.ts +0 -0
- /package/src/{tui → interfaces/tui}/plugin/slots.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/home.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/dialog-fork-from-timeline.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/dialog-message.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/dialog-subagent.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/dialog-timeline.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/footer.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/permission.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/question.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/sidebar.tsx +0 -0
- /package/src/{tui → interfaces/tui}/routes/session/subagent-footer.tsx +0 -0
- /package/src/{tui → interfaces/tui}/run.ts +0 -0
- /package/src/{tui → interfaces/tui}/thread.ts +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog-alert.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog-confirm.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog-export-options.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog-help.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog-prompt.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog-select.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/dialog.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/link.tsx +0 -0
- /package/src/{tui → interfaces/tui}/ui/spinner.ts +0 -0
- /package/src/{tui → interfaces/tui}/ui/toast.tsx +0 -0
- /package/src/{tui → interfaces/tui}/util/editor.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/model.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/provider-origin.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/revert-diff.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/scroll.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/selection.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/signal.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/sound.ts +0 -0
- /package/src/{tui → interfaces/tui}/util/transcript.ts +0 -0
- /package/src/{tui → interfaces/tui}/validate-session.ts +0 -0
- /package/src/{tui → interfaces/tui}/win32.ts +0 -0
- /package/src/{tui → interfaces/tui}/worker.ts +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
import { ChevronDown, FilePen, Gauge, Wrench } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/cn";
|
|
4
|
+
import { FILE_TOOLS } from "./ToolCall";
|
|
5
|
+
import type { ChatMsg, ToolPart } from "../../hooks/useChat";
|
|
6
|
+
|
|
7
|
+
interface ChangedFile {
|
|
8
|
+
path: string;
|
|
9
|
+
tool: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Pull the file path out of a write_file/edit_file invocation's args.
|
|
13
|
+
function filePathOf(args?: Record<string, unknown>): string | undefined {
|
|
14
|
+
if (!args) return undefined;
|
|
15
|
+
const p = args.path ?? args.file ?? args.filename;
|
|
16
|
+
return typeof p === "string" ? p : undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Compact, opencode-style strip summarising the conversation: token usage,
|
|
21
|
+
* tool count, and an expandable list of files the agent wrote or edited.
|
|
22
|
+
* Renders nothing until the agent has actually done something.
|
|
23
|
+
*/
|
|
24
|
+
export function ContextBar({ msgs }: { msgs: ChatMsg[] }) {
|
|
25
|
+
const [open, setOpen] = useState(false);
|
|
26
|
+
|
|
27
|
+
const { inTok, outTok, toolCount, changed, model } = useMemo(() => {
|
|
28
|
+
let inTok = 0;
|
|
29
|
+
let outTok = 0;
|
|
30
|
+
let toolCount = 0;
|
|
31
|
+
let model: string | undefined;
|
|
32
|
+
const seen = new Set<string>();
|
|
33
|
+
const changed: ChangedFile[] = [];
|
|
34
|
+
for (const m of msgs) {
|
|
35
|
+
if (m.role !== "assistant") continue;
|
|
36
|
+
if (m.usage) {
|
|
37
|
+
inTok += m.usage.input_tokens || 0;
|
|
38
|
+
outTok += m.usage.output_tokens || 0;
|
|
39
|
+
}
|
|
40
|
+
if (m.model) model = m.model;
|
|
41
|
+
for (const part of m.parts) {
|
|
42
|
+
if (part.kind !== "tool") continue;
|
|
43
|
+
toolCount += 1;
|
|
44
|
+
if (FILE_TOOLS.has(part.tool) && (part as ToolPart).status !== "error") {
|
|
45
|
+
const path = filePathOf(part.args);
|
|
46
|
+
if (path && !seen.has(path)) {
|
|
47
|
+
seen.add(path);
|
|
48
|
+
changed.push({ path, tool: part.tool });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { inTok, outTok, toolCount, changed, model };
|
|
54
|
+
}, [msgs]);
|
|
55
|
+
|
|
56
|
+
const totalTok = inTok + outTok;
|
|
57
|
+
if (totalTok === 0 && toolCount === 0) return null;
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div className="shrink-0 border-t border-border bg-card/40 text-[11px]">
|
|
61
|
+
<button
|
|
62
|
+
type="button"
|
|
63
|
+
onClick={() => changed.length > 0 && setOpen((v) => !v)}
|
|
64
|
+
className={cn(
|
|
65
|
+
"flex w-full items-center gap-3 px-4 py-1.5 text-muted-foreground",
|
|
66
|
+
changed.length > 0 && "hover:text-foreground",
|
|
67
|
+
)}
|
|
68
|
+
>
|
|
69
|
+
<span className="flex items-center gap-1">
|
|
70
|
+
<Gauge size={12} /> {fmt(totalTok)} tok
|
|
71
|
+
<span className="text-muted-foreground/60">
|
|
72
|
+
({fmt(inTok)}↑ / {fmt(outTok)}↓)
|
|
73
|
+
</span>
|
|
74
|
+
</span>
|
|
75
|
+
{toolCount > 0 && (
|
|
76
|
+
<span className="flex items-center gap-1">
|
|
77
|
+
<Wrench size={12} /> {toolCount} tools
|
|
78
|
+
</span>
|
|
79
|
+
)}
|
|
80
|
+
{changed.length > 0 && (
|
|
81
|
+
<span className="flex items-center gap-1 text-violet-400">
|
|
82
|
+
<FilePen size={12} /> {changed.length} archivos
|
|
83
|
+
</span>
|
|
84
|
+
)}
|
|
85
|
+
{model && <span className="ml-auto font-mono text-muted-foreground/70">{model}</span>}
|
|
86
|
+
{changed.length > 0 && (
|
|
87
|
+
<ChevronDown className={cn("size-3 shrink-0 transition-transform", open && "rotate-180")} />
|
|
88
|
+
)}
|
|
89
|
+
</button>
|
|
90
|
+
|
|
91
|
+
{open && changed.length > 0 && (
|
|
92
|
+
<ul className="max-h-40 space-y-0.5 overflow-y-auto border-t border-border/60 px-4 py-2">
|
|
93
|
+
{changed.map((f) => (
|
|
94
|
+
<li key={f.path} className="flex items-center gap-2 font-mono text-[11px]">
|
|
95
|
+
<FilePen size={11} className="shrink-0 text-violet-400" />
|
|
96
|
+
<span className="truncate">{f.path}</span>
|
|
97
|
+
<span className="ml-auto shrink-0 text-[10px] text-muted-foreground/60">
|
|
98
|
+
{f.tool === "write_file" ? "write" : "edit"}
|
|
99
|
+
</span>
|
|
100
|
+
</li>
|
|
101
|
+
))}
|
|
102
|
+
</ul>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function fmt(n: number): string {
|
|
109
|
+
if (n >= 1000) return `${(n / 1000).toFixed(1)}k`;
|
|
110
|
+
return String(n);
|
|
111
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Bot, Copy, User, Info } from "lucide-react";
|
|
2
|
+
import { cn } from "../../lib/cn";
|
|
3
|
+
import { ToolCall } from "./ToolCall";
|
|
4
|
+
import { textOf, type ChatMsg } from "../../hooks/useChat";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
msg: ChatMsg;
|
|
8
|
+
onCopy?: (text: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function MessageBubble({ msg, onCopy }: Props) {
|
|
12
|
+
const mine = msg.role === "user";
|
|
13
|
+
const copyText = textOf(msg);
|
|
14
|
+
const hasTools = msg.parts.some((p) => p.kind === "tool");
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className={cn("group flex items-start gap-2", mine ? "justify-end" : "justify-start")}>
|
|
18
|
+
{!mine && (
|
|
19
|
+
<span className="mt-0.5 grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground">
|
|
20
|
+
<Bot size={14} />
|
|
21
|
+
</span>
|
|
22
|
+
)}
|
|
23
|
+
<div className={cn("flex min-w-0 flex-col gap-1.5", mine ? "items-end" : "w-full max-w-[85%]")}>
|
|
24
|
+
{/* Operational notes (engine fallbacks, retries, suppressed tools). */}
|
|
25
|
+
{!mine && msg.notes && msg.notes.length > 0 && (
|
|
26
|
+
<div className="flex flex-col gap-0.5">
|
|
27
|
+
{msg.notes.map((n, i) => (
|
|
28
|
+
<span key={i} className="flex items-center gap-1 text-[10px] text-amber-400/80">
|
|
29
|
+
<Info size={10} /> {n}
|
|
30
|
+
</span>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
)}
|
|
34
|
+
|
|
35
|
+
{/* Ordered parts: interleaved assistant text + tool calls. */}
|
|
36
|
+
{msg.parts.map((part, i) =>
|
|
37
|
+
part.kind === "tool" ? (
|
|
38
|
+
<ToolCall key={`${part.id}-${i}`} part={part} />
|
|
39
|
+
) : part.text ? (
|
|
40
|
+
<div
|
|
41
|
+
key={i}
|
|
42
|
+
className={cn(
|
|
43
|
+
"whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed shadow-sm",
|
|
44
|
+
mine
|
|
45
|
+
? "rounded-br-sm bg-primary text-primary-fg"
|
|
46
|
+
: "w-full rounded-bl-sm border border-border bg-card text-foreground",
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
{part.text}
|
|
50
|
+
</div>
|
|
51
|
+
) : null,
|
|
52
|
+
)}
|
|
53
|
+
|
|
54
|
+
{/* Pending placeholder before any part has arrived. */}
|
|
55
|
+
{!mine && msg.pending && msg.parts.length === 0 && (
|
|
56
|
+
<div className="rounded-2xl rounded-bl-sm border border-border bg-card px-3 py-2 text-sm text-muted-foreground">
|
|
57
|
+
…
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
<div className="flex items-center gap-2 text-[10px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100">
|
|
62
|
+
<span>{formatTs(msg.ts)}</span>
|
|
63
|
+
{!mine && msg.model && <span className="font-mono">· {msg.model}</span>}
|
|
64
|
+
{!mine && hasTools && (
|
|
65
|
+
<span>· {msg.parts.filter((p) => p.kind === "tool").length} tools</span>
|
|
66
|
+
)}
|
|
67
|
+
{onCopy && copyText && (
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
onClick={() => onCopy(copyText)}
|
|
71
|
+
className="inline-flex items-center gap-1 hover:text-foreground"
|
|
72
|
+
title="Copiar"
|
|
73
|
+
>
|
|
74
|
+
<Copy size={10} /> copiar
|
|
75
|
+
</button>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
{mine && (
|
|
80
|
+
<span className="mt-0.5 grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground">
|
|
81
|
+
<User size={14} />
|
|
82
|
+
</span>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function formatTs(iso: string): string {
|
|
89
|
+
try {
|
|
90
|
+
const d = new Date(iso);
|
|
91
|
+
return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
92
|
+
} catch {
|
|
93
|
+
return iso;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { MessageBubble } from "./MessageBubble";
|
|
3
|
+
import { Empty } from "../ui";
|
|
4
|
+
import { t } from "../../i18n";
|
|
5
|
+
import type { ChatMsg } from "../../hooks/useChat";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
msgs: ChatMsg[];
|
|
9
|
+
onCopy: (text: string) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function MessageList({ msgs, onCopy }: Props) {
|
|
13
|
+
const bottomRef = useRef<HTMLDivElement | null>(null);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
bottomRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
17
|
+
}, [msgs]);
|
|
18
|
+
|
|
19
|
+
if (msgs.length === 0) {
|
|
20
|
+
return (
|
|
21
|
+
<div className="grid h-full place-items-center p-6">
|
|
22
|
+
<Empty>{t("project.chat.empty")}</Empty>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className="space-y-4 px-3 py-4">
|
|
29
|
+
{msgs.map((m, i) => (
|
|
30
|
+
<MessageBubble key={i} msg={m} onCopy={onCopy} />
|
|
31
|
+
))}
|
|
32
|
+
<div ref={bottomRef} />
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { Server, ChevronDown, X, Check } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/cn";
|
|
4
|
+
import { Engines } from "../../lib/api";
|
|
5
|
+
|
|
6
|
+
// Compact model picker for the chat composer (the panda.project pattern): a
|
|
7
|
+
// small "Server · <model>" button that opens a dropdown to pick a model
|
|
8
|
+
// override, or fall back to "Auto" (the daemon's fallback router decides).
|
|
9
|
+
//
|
|
10
|
+
// Options are the live model catalogs of the configured engines, aggregated as
|
|
11
|
+
// `engine:model` (best-effort — engines that fail to list are skipped). Empty
|
|
12
|
+
// value = Auto.
|
|
13
|
+
export function ModelPicker({
|
|
14
|
+
value,
|
|
15
|
+
onChange,
|
|
16
|
+
disabled,
|
|
17
|
+
}: {
|
|
18
|
+
value: string;
|
|
19
|
+
onChange: (v: string) => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}) {
|
|
22
|
+
const [open, setOpen] = useState(false);
|
|
23
|
+
const [query, setQuery] = useState("");
|
|
24
|
+
const [options, setOptions] = useState<string[]>([]);
|
|
25
|
+
const [loaded, setLoaded] = useState(false);
|
|
26
|
+
const wrapRef = useRef<HTMLDivElement | null>(null);
|
|
27
|
+
|
|
28
|
+
// Close on outside click.
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!open) return;
|
|
31
|
+
const onDoc = (e: MouseEvent) => {
|
|
32
|
+
if (wrapRef.current && !wrapRef.current.contains(e.target as Node)) setOpen(false);
|
|
33
|
+
};
|
|
34
|
+
document.addEventListener("mousedown", onDoc);
|
|
35
|
+
return () => document.removeEventListener("mousedown", onDoc);
|
|
36
|
+
}, [open]);
|
|
37
|
+
|
|
38
|
+
// Lazily load the aggregated model catalog the first time the picker opens.
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!open || loaded) return;
|
|
41
|
+
let cancelled = false;
|
|
42
|
+
(async () => {
|
|
43
|
+
try {
|
|
44
|
+
const { engines } = await Engines.list();
|
|
45
|
+
const lists = await Promise.all(
|
|
46
|
+
engines.map((e) =>
|
|
47
|
+
Engines.models({ engine: e })
|
|
48
|
+
.then((r) => (r.models || []).map((m) => (m.includes(":") ? m : `${e}:${m}`)))
|
|
49
|
+
.catch(() => [] as string[]),
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
if (!cancelled) {
|
|
53
|
+
const flat = Array.from(new Set(lists.flat())).sort();
|
|
54
|
+
setOptions(flat);
|
|
55
|
+
setLoaded(true);
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
if (!cancelled) setLoaded(true);
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
return () => { cancelled = true; };
|
|
62
|
+
}, [open, loaded]);
|
|
63
|
+
|
|
64
|
+
const q = query.trim().toLowerCase();
|
|
65
|
+
const filtered = q ? options.filter((o) => o.toLowerCase().includes(q)) : options;
|
|
66
|
+
const label = value || "Auto";
|
|
67
|
+
|
|
68
|
+
const pick = (m: string) => { onChange(m); setOpen(false); setQuery(""); };
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div ref={wrapRef} className="relative">
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
disabled={disabled}
|
|
75
|
+
onClick={() => setOpen((v) => !v)}
|
|
76
|
+
data-testid="chat-model-picker"
|
|
77
|
+
className={cn(
|
|
78
|
+
"flex max-w-[200px] items-center gap-1 rounded-md border border-transparent px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors",
|
|
79
|
+
"hover:bg-accent/60 hover:text-foreground",
|
|
80
|
+
value && "text-foreground",
|
|
81
|
+
)}
|
|
82
|
+
title="Elegir modelo (o Auto)"
|
|
83
|
+
>
|
|
84
|
+
<Server className="size-3 shrink-0" />
|
|
85
|
+
<span className="truncate font-mono">{label}</span>
|
|
86
|
+
<ChevronDown className="size-3 shrink-0 opacity-60" />
|
|
87
|
+
</button>
|
|
88
|
+
|
|
89
|
+
{open && (
|
|
90
|
+
<div className="absolute bottom-full left-0 z-50 mb-1.5 w-64 rounded-lg border border-border bg-popover p-1.5 shadow-md ring-1 ring-foreground/10">
|
|
91
|
+
<input
|
|
92
|
+
autoFocus
|
|
93
|
+
value={query}
|
|
94
|
+
placeholder="filtrar o escribir modelo…"
|
|
95
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
96
|
+
onKeyDown={(e) => { if (e.key === "Enter" && query.trim()) pick(query.trim()); }}
|
|
97
|
+
className="mb-1 w-full rounded-md border border-border bg-background px-2 py-1 text-xs outline-none focus:border-foreground/30"
|
|
98
|
+
/>
|
|
99
|
+
<ul className="max-h-56 overflow-y-auto">
|
|
100
|
+
<li>
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
onMouseDown={(e) => { e.preventDefault(); pick(""); }}
|
|
104
|
+
className={cn(
|
|
105
|
+
"flex w-full items-center justify-between rounded-md px-2 py-1 text-left text-xs hover:bg-accent hover:text-accent-fg",
|
|
106
|
+
!value && "bg-accent/50",
|
|
107
|
+
)}
|
|
108
|
+
>
|
|
109
|
+
<span className="flex items-center gap-1.5"><X className="size-3" /> Auto (router decide)</span>
|
|
110
|
+
{!value && <Check className="size-3" />}
|
|
111
|
+
</button>
|
|
112
|
+
</li>
|
|
113
|
+
{!loaded && <li className="px-2 py-1 text-[11px] text-muted-fg">cargando modelos…</li>}
|
|
114
|
+
{loaded && filtered.length === 0 && query.trim() && (
|
|
115
|
+
<li>
|
|
116
|
+
<button
|
|
117
|
+
type="button"
|
|
118
|
+
onMouseDown={(e) => { e.preventDefault(); pick(query.trim()); }}
|
|
119
|
+
className="w-full rounded-md px-2 py-1 text-left font-mono text-xs hover:bg-accent hover:text-accent-fg"
|
|
120
|
+
>
|
|
121
|
+
usar “{query.trim()}”
|
|
122
|
+
</button>
|
|
123
|
+
</li>
|
|
124
|
+
)}
|
|
125
|
+
{filtered.map((m) => (
|
|
126
|
+
<li key={m}>
|
|
127
|
+
<button
|
|
128
|
+
type="button"
|
|
129
|
+
onMouseDown={(e) => { e.preventDefault(); pick(m); }}
|
|
130
|
+
className={cn(
|
|
131
|
+
"flex w-full items-center justify-between rounded-md px-2 py-1 text-left font-mono text-xs hover:bg-accent hover:text-accent-fg",
|
|
132
|
+
m === value && "bg-accent/50",
|
|
133
|
+
)}
|
|
134
|
+
>
|
|
135
|
+
<span className="truncate">{m}</span>
|
|
136
|
+
{m === value && <Check className="size-3 shrink-0" />}
|
|
137
|
+
</button>
|
|
138
|
+
</li>
|
|
139
|
+
))}
|
|
140
|
+
</ul>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
ChevronRight,
|
|
4
|
+
FileText,
|
|
5
|
+
FilePen,
|
|
6
|
+
FilePlus,
|
|
7
|
+
Search,
|
|
8
|
+
FolderTree,
|
|
9
|
+
Terminal,
|
|
10
|
+
Send,
|
|
11
|
+
Bot,
|
|
12
|
+
Plug,
|
|
13
|
+
ListTodo,
|
|
14
|
+
Wrench,
|
|
15
|
+
Loader2,
|
|
16
|
+
Check,
|
|
17
|
+
X,
|
|
18
|
+
CornerDownRight,
|
|
19
|
+
} from "lucide-react";
|
|
20
|
+
import { cn } from "../../lib/cn";
|
|
21
|
+
import type { ToolPart } from "../../hooks/useChat";
|
|
22
|
+
|
|
23
|
+
// Map registered tool names (core/agent tools) to an icon + friendly label.
|
|
24
|
+
const TOOL_META: Record<string, { icon: typeof Wrench; label: string }> = {
|
|
25
|
+
read_file: { icon: FileText, label: "Leer archivo" },
|
|
26
|
+
write_file: { icon: FilePlus, label: "Escribir archivo" },
|
|
27
|
+
edit_file: { icon: FilePen, label: "Editar archivo" },
|
|
28
|
+
list_files: { icon: FolderTree, label: "Listar archivos" },
|
|
29
|
+
search_files: { icon: Search, label: "Buscar en archivos" },
|
|
30
|
+
search_messages: { icon: Search, label: "Buscar mensajes" },
|
|
31
|
+
tail_messages: { icon: Search, label: "Últimos mensajes" },
|
|
32
|
+
run_shell: { icon: Terminal, label: "Ejecutar shell" },
|
|
33
|
+
send_telegram: { icon: Send, label: "Enviar Telegram" },
|
|
34
|
+
call_agent: { icon: Bot, label: "Llamar agente" },
|
|
35
|
+
call_mcp: { icon: Plug, label: "Llamar MCP" },
|
|
36
|
+
call_runtime: { icon: Bot, label: "Llamar runtime" },
|
|
37
|
+
create_task: { icon: ListTodo, label: "Crear tarea" },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const FILE_TOOLS = new Set(["write_file", "edit_file"]);
|
|
41
|
+
|
|
42
|
+
function metaFor(tool: string) {
|
|
43
|
+
return TOOL_META[tool] || { icon: Wrench, label: tool };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Best-effort one-line argument summary shown next to the tool title.
|
|
47
|
+
function argSummary(tool: string, args?: Record<string, unknown>): string {
|
|
48
|
+
if (!args) return "";
|
|
49
|
+
const pick = (k: string) => (typeof args[k] === "string" ? (args[k] as string) : undefined);
|
|
50
|
+
const first =
|
|
51
|
+
pick("path") ||
|
|
52
|
+
pick("file") ||
|
|
53
|
+
pick("pattern") ||
|
|
54
|
+
pick("query") ||
|
|
55
|
+
pick("command") ||
|
|
56
|
+
pick("slug") ||
|
|
57
|
+
pick("name") ||
|
|
58
|
+
pick("agent");
|
|
59
|
+
return first ? String(first) : "";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function pretty(value: unknown): string {
|
|
63
|
+
if (value == null) return "";
|
|
64
|
+
if (typeof value === "string") return value;
|
|
65
|
+
try {
|
|
66
|
+
return JSON.stringify(value, null, 2);
|
|
67
|
+
} catch {
|
|
68
|
+
return String(value);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function StatusIcon({ status }: { status: ToolPart["status"] }) {
|
|
73
|
+
if (status === "running") return <Loader2 className="size-3 shrink-0 animate-spin text-sky-400" />;
|
|
74
|
+
if (status === "error") return <X className="size-3 shrink-0 text-rose-400" />;
|
|
75
|
+
if (status === "deduped") return <CornerDownRight className="size-3 shrink-0 text-amber-400" />;
|
|
76
|
+
return <Check className="size-3 shrink-0 text-emerald-400" />;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function ToolCall({ part }: { part: ToolPart }) {
|
|
80
|
+
const [open, setOpen] = useState(false);
|
|
81
|
+
const { icon: Icon, label } = metaFor(part.tool);
|
|
82
|
+
const summary = argSummary(part.tool, part.args);
|
|
83
|
+
const isFile = FILE_TOOLS.has(part.tool);
|
|
84
|
+
const hasBody = !!part.args || part.result !== undefined;
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
className={cn(
|
|
89
|
+
"rounded-lg border bg-muted/30 text-[12px]",
|
|
90
|
+
part.status === "error" ? "border-rose-500/30" : "border-border",
|
|
91
|
+
)}
|
|
92
|
+
>
|
|
93
|
+
<button
|
|
94
|
+
type="button"
|
|
95
|
+
onClick={() => hasBody && setOpen((v) => !v)}
|
|
96
|
+
className="flex w-full items-center gap-2 px-2.5 py-1.5 text-left"
|
|
97
|
+
>
|
|
98
|
+
{hasBody ? (
|
|
99
|
+
<ChevronRight className={cn("size-3 shrink-0 text-muted-foreground transition-transform", open && "rotate-90")} />
|
|
100
|
+
) : (
|
|
101
|
+
<span className="size-3 shrink-0" />
|
|
102
|
+
)}
|
|
103
|
+
<Icon className={cn("size-3.5 shrink-0", isFile ? "text-violet-400" : "text-muted-foreground")} />
|
|
104
|
+
<span className="shrink-0 font-medium">{label}</span>
|
|
105
|
+
{summary && <span className="truncate font-mono text-muted-foreground">{summary}</span>}
|
|
106
|
+
<span className="ml-auto flex items-center gap-1">
|
|
107
|
+
{part.status === "deduped" && <span className="text-[10px] text-amber-400">dedup</span>}
|
|
108
|
+
<StatusIcon status={part.status} />
|
|
109
|
+
</span>
|
|
110
|
+
</button>
|
|
111
|
+
|
|
112
|
+
{open && hasBody && (
|
|
113
|
+
<div className="space-y-2 border-t border-border/60 px-2.5 py-2">
|
|
114
|
+
{part.args && Object.keys(part.args).length > 0 && (
|
|
115
|
+
<div>
|
|
116
|
+
<div className="mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70">args</div>
|
|
117
|
+
<pre className="max-h-48 overflow-auto rounded-md bg-background/60 p-2 font-mono text-[11px] leading-relaxed text-foreground">
|
|
118
|
+
{pretty(part.args)}
|
|
119
|
+
</pre>
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
{part.result !== undefined && (
|
|
123
|
+
<div>
|
|
124
|
+
<div className="mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70">result</div>
|
|
125
|
+
<pre
|
|
126
|
+
className={cn(
|
|
127
|
+
"max-h-64 overflow-auto rounded-md bg-background/60 p-2 font-mono text-[11px] leading-relaxed",
|
|
128
|
+
part.status === "error" ? "text-rose-300" : "text-foreground",
|
|
129
|
+
)}
|
|
130
|
+
>
|
|
131
|
+
{pretty(part.result)}
|
|
132
|
+
</pre>
|
|
133
|
+
</div>
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { FILE_TOOLS };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { ChevronRight, FilePlus2, FilePen, FileX2, RefreshCw } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/cn";
|
|
4
|
+
import { t } from "../../i18n";
|
|
5
|
+
import { Empty, Spinner } from "../ui";
|
|
6
|
+
import { DiffView } from "./DiffView";
|
|
7
|
+
import type { CodeChanges, CodeFileChange } from "../../lib/api/code";
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
changes: CodeChanges | undefined;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
onRefresh: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const STATUS_ICON = {
|
|
16
|
+
added: FilePlus2,
|
|
17
|
+
modified: FilePen,
|
|
18
|
+
deleted: FileX2,
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
const STATUS_COLOR = {
|
|
22
|
+
added: "text-emerald-600 dark:text-emerald-400",
|
|
23
|
+
modified: "text-amber-600 dark:text-amber-400",
|
|
24
|
+
deleted: "text-rose-600 dark:text-rose-400",
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
function FileRow({ file }: { file: CodeFileChange }) {
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
const Icon = STATUS_ICON[file.status];
|
|
30
|
+
return (
|
|
31
|
+
<li className="rounded-md border border-border">
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
onClick={() => setOpen((v) => !v)}
|
|
35
|
+
className="flex w-full items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-accent/40"
|
|
36
|
+
>
|
|
37
|
+
<ChevronRight className={cn("size-3 shrink-0 transition-transform", open && "rotate-90")} />
|
|
38
|
+
<Icon className={cn("size-3.5 shrink-0", STATUS_COLOR[file.status])} />
|
|
39
|
+
<span className="min-w-0 flex-1 truncate font-mono">{file.path}</span>
|
|
40
|
+
<span className="shrink-0 font-mono text-[10px] text-muted-foreground">
|
|
41
|
+
{file.additions != null && <span className="text-emerald-600 dark:text-emerald-400">+{file.additions}</span>}
|
|
42
|
+
{file.deletions != null && <span className="ml-1 text-rose-600 dark:text-rose-400">-{file.deletions}</span>}
|
|
43
|
+
</span>
|
|
44
|
+
</button>
|
|
45
|
+
{open && (
|
|
46
|
+
<div className="border-t border-border p-1.5">
|
|
47
|
+
<DiffView patch={file.patch} />
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
</li>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Changes tab: file diffs of the working tree vs the session's git baseline.
|
|
55
|
+
export function CodeChangesTab({ changes, loading, onRefresh }: Props) {
|
|
56
|
+
const files = changes?.files || [];
|
|
57
|
+
return (
|
|
58
|
+
<div className="flex h-full flex-col" data-testid="code-changes-tab">
|
|
59
|
+
<div className="flex shrink-0 items-center justify-between px-3 py-2">
|
|
60
|
+
<span className="text-[11px] text-muted-foreground">
|
|
61
|
+
{files.length > 0 ? t("code_module.changes_files", { n: files.length }) : ""}
|
|
62
|
+
</span>
|
|
63
|
+
<button
|
|
64
|
+
type="button"
|
|
65
|
+
onClick={onRefresh}
|
|
66
|
+
title="↻"
|
|
67
|
+
className="rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
68
|
+
>
|
|
69
|
+
{loading ? <Spinner size={12} /> : <RefreshCw className="size-3" />}
|
|
70
|
+
</button>
|
|
71
|
+
</div>
|
|
72
|
+
<div className="min-h-0 flex-1 overflow-y-auto px-3 pb-3">
|
|
73
|
+
{changes && !changes.git ? (
|
|
74
|
+
<Empty>{t("code_module.changes_no_git")}</Empty>
|
|
75
|
+
) : files.length === 0 ? (
|
|
76
|
+
<Empty>{t("code_module.changes_none")}</Empty>
|
|
77
|
+
) : (
|
|
78
|
+
<ul className="space-y-1.5">
|
|
79
|
+
{files.map((f) => (
|
|
80
|
+
<FileRow key={f.path} file={f} />
|
|
81
|
+
))}
|
|
82
|
+
</ul>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|