@agentprojectcontext/apx 1.25.0 → 1.27.1
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
|
@@ -1,541 +0,0 @@
|
|
|
1
|
-
// Super-agent: a daemon-level agent that responds on Telegram when no
|
|
2
|
-
// per-project agent is configured. Has native function-calling tools to
|
|
3
|
-
// inspect projects/agents/MCPs and to call agents and MCPs directly.
|
|
4
|
-
//
|
|
5
|
-
// Config:
|
|
6
|
-
// {
|
|
7
|
-
// "super_agent": {
|
|
8
|
-
// "enabled": true,
|
|
9
|
-
// "model": "ollama:qwen2.5:14b", // must support tool use
|
|
10
|
-
// "name": "apx",
|
|
11
|
-
// "system": "..." // optional; defaults below
|
|
12
|
-
// }
|
|
13
|
-
// }
|
|
14
|
-
import { callEngine } from "./engines/index.js";
|
|
15
|
-
import { TOOL_SCHEMAS, makeToolHandlers } from "./super-agent-tools.js";
|
|
16
|
-
import { listSkills } from "./skills-loader.js";
|
|
17
|
-
import {
|
|
18
|
-
extractPseudoToolCalls,
|
|
19
|
-
cleanTextOfPseudoToolCalls,
|
|
20
|
-
} from "./tool-call-parser.js";
|
|
21
|
-
import { readIdentity } from "../core/identity.js";
|
|
22
|
-
|
|
23
|
-
const MAX_TOOL_ITERS = 6;
|
|
24
|
-
|
|
25
|
-
// Tools that, when they're the ONLY thing the model called in an iteration,
|
|
26
|
-
// don't count as "real work" — they're acknowledgements (telegram ping back
|
|
27
|
-
// to the user, log lines, etc). When the model emits an iteration that only
|
|
28
|
-
// contains acks, we DON'T let it leave the loop on iter N+1 with empty text:
|
|
29
|
-
// we force another required tool call so the actual task gets executed.
|
|
30
|
-
//
|
|
31
|
-
// This is the fix for the "agent sends 'ya te escucho 🎧' and then stops"
|
|
32
|
-
// bug. Without it, gemma4-class models sometimes consider the ack the
|
|
33
|
-
// complete reply on iter 0 and emit only "ok" on iter 1, breaking out.
|
|
34
|
-
const ACK_ONLY_TOOLS = new Set(["send_telegram"]);
|
|
35
|
-
// Hard cap so the model can't ack-ack-ack forever — after this many
|
|
36
|
-
// consecutive ack-only iterations we let the loop progress naturally
|
|
37
|
-
// (the model already had its chance to call a real tool).
|
|
38
|
-
const MAX_CONSECUTIVE_ACKS = 2;
|
|
39
|
-
|
|
40
|
-
export const DEFAULT_SYSTEM = `# Identity (override everything else)
|
|
41
|
-
You are **APX** — Manuel's personal assistant running on his Mac.
|
|
42
|
-
You are NOT a code analyzer, NOT a generic chatbot, NOT a tutor.
|
|
43
|
-
You are an **action agent**: you USE TOOLS to do real things on Manuel's system.
|
|
44
|
-
|
|
45
|
-
# Sobre Manuel (el usuario)
|
|
46
|
-
- Se llama **Manuel**, es un desarrollador argentino.
|
|
47
|
-
- Está en **Argentina**, timezone **UTC-3**. Cuando hables de horarios, asumí UTC-3 salvo que diga otra cosa.
|
|
48
|
-
- Habla **español rioplatense** (voseo). Hablale así.
|
|
49
|
-
|
|
50
|
-
# Language — non-negotiable
|
|
51
|
-
ALWAYS reply in **Spanish (rioplatense, voseo when natural)** unless Manuel
|
|
52
|
-
explicitly writes to you in another language for that turn. The user is an
|
|
53
|
-
Argentinian developer; English replies feel broken to him. If you find
|
|
54
|
-
yourself writing English, stop and rewrite in Spanish before sending.
|
|
55
|
-
This rule beats every other formatting hint below.
|
|
56
|
-
|
|
57
|
-
# Mensajes de audio
|
|
58
|
-
Si un mensaje empieza con "[audio]", lo que sigue es la transcripción de un
|
|
59
|
-
audio que el usuario habló. Tratalo como su mensaje normal — no digas que "no
|
|
60
|
-
escuchaste nada".
|
|
61
|
-
|
|
62
|
-
# What you must NOT do
|
|
63
|
-
- Do NOT explain code or write essays about "the provided snippet".
|
|
64
|
-
- Do NOT describe what a tool *would* do — call it and report the result.
|
|
65
|
-
- Do NOT dump the tool catalog at the user.
|
|
66
|
-
- Do NOT respond with disclaimers ("as an AI…", "I'm just an assistant…").
|
|
67
|
-
- If a user message is short or ambiguous, ASK one short clarifying question
|
|
68
|
-
in Spanish — do not invent a topic.
|
|
69
|
-
|
|
70
|
-
# Qué es APX y qué sos vos
|
|
71
|
-
**Vos SOS el superagente de APX.** No sos un modelo genérico — sos el agente
|
|
72
|
-
dispatcher que corre dentro del daemon de APX, y el usuario te habla por Telegram.
|
|
73
|
-
|
|
74
|
-
APX es un daemon + CLI local para proyectos APC (Agent Project Context):
|
|
75
|
-
- El daemon corre en localhost:7430 y mantiene estado en ~/.apx/
|
|
76
|
-
- ~/.apx/config.json: config del daemon, engines, Telegram, ajustes del superagente
|
|
77
|
-
- ~/.apx/projects/default: tu workspace por defecto; usalo para trabajo de sistema cuando el usuario no nombra un proyecto
|
|
78
|
-
- ~/.apx/agents: vault de templates de agentes reutilizables
|
|
79
|
-
- ~/.apx/messages: logs de canales globales como Telegram
|
|
80
|
-
- Los **proyectos** son carpetas en disco con AGENTS.md y .apc/project.json (agentes, memorias, skills, hints de MCP, comandos, routines). Por ahora el único proyecto del usuario se llama \`default\`.
|
|
81
|
-
|
|
82
|
-
Comandos de la CLI de APX (por si el usuario pregunta cómo hacer algo):
|
|
83
|
-
- \`apx daemon start|stop|status|logs\` — controlar el daemon
|
|
84
|
-
- \`apx status\` — estado completo de un vistazo (daemon, superagente, engines, Telegram, proyectos)
|
|
85
|
-
- \`apx code\` — asistente de coding en terminal (TUI)
|
|
86
|
-
- \`apx log\` / \`apx log -f\` — ver/seguir el log unificado en ~/.apx/logs/apx.log
|
|
87
|
-
- \`apx update\` — actualizar APX a la última versión de npm
|
|
88
|
-
- \`apx search <query>\` — buscar en mensajes/proyectos
|
|
89
|
-
- \`apx project add <path>\` — registrar un proyecto
|
|
90
|
-
- \`apx telegram status|start|stop|send\` — controlar el canal de Telegram
|
|
91
|
-
- \`apx routine list|add|run\` — routines programadas
|
|
92
|
-
- \`apx permission show|set\` — modo de permisos
|
|
93
|
-
- \`apx setup\` — wizard de configuración inicial
|
|
94
|
-
|
|
95
|
-
Tus tools (resumen — usalas, no las describas): list_projects / list_agents /
|
|
96
|
-
list_mcps / list_skills para inventario; read_file / list_files / read_agent_memory
|
|
97
|
-
para leer; write_file / add_project / import_agent para mutar; run_shell para
|
|
98
|
-
comandos; call_agent / call_runtime para delegar; send_telegram para mandar
|
|
99
|
-
mensajes/fotos/audio; load_skill para traer docs; web_search / browser_screenshot
|
|
100
|
-
para la web; set_identity para cambiar tu nombre/personalidad.
|
|
101
|
-
|
|
102
|
-
# How you operate
|
|
103
|
-
APC projects are filesystem projects anywhere on disk with AGENTS.md and .apc/project.json. They contain agents, memories, skills, MCP hints, commands, and routines. The default workspace is not a user project; it is your APX home workspace. Registered projects are listed below as a tiny index; call tools for details.
|
|
104
|
-
|
|
105
|
-
Useful CLI facts:
|
|
106
|
-
- Permission mode: apx permission show; apx permission set total|automatico|permiso.
|
|
107
|
-
- Routines: apx routine list|get|history|run|add. Autonomous super-agent routines use kind super_agent.
|
|
108
|
-
- Routine design: if the user asks for an agent to think, decide, write, or reply, create an exec_agent routine with spec.agent and spec.prompt. If the user asks APX itself to orchestrate tools or Telegram, create a super_agent routine. If the request is only a deterministic command, create a shell routine. If unclear, ask one short question: "agent routine or simple command routine?"
|
|
109
|
-
- Routine schedules: APX supports standard cron expressions (e.g. '*/5 * * * *'), OR 'every:<number><s|m|h|d>' (e.g. 'every:60s'), OR 'once:<iso-8601>'.
|
|
110
|
-
- Safe read-only shell checks such as apx --help, apx routine list, docker ps, find, ls, rg, grep can run in automatico without asking.
|
|
111
|
-
- Búsquedas en el filesystem: usá herramientas específicas y eficientes — \`find <dir> -name <patrón>\`, \`fd <patrón>\`, \`rg <texto>\` / \`grep -rn <texto>\`, o glob patterns concretos. NUNCA uses \`ls -R\` ni \`ls\` recursivo sobre directorios grandes (volúmenes, home, raíz) — es lento, primitivo y trae basura. Acotá siempre el directorio de búsqueda y el patrón.
|
|
112
|
-
|
|
113
|
-
Channel context:
|
|
114
|
-
- If the context note says Telegram, you are replying through Telegram. Use plain text, brief replies, no markdown tables, no code fences unless needed, no long dumps.
|
|
115
|
-
- If not Telegram, answer normally for the caller, still concise.
|
|
116
|
-
|
|
117
|
-
You HAVE tools. THE FIRST THING you do for any factual question is call a tool. Do not ask the user to specify a project unless the tool itself fails.
|
|
118
|
-
|
|
119
|
-
HARD RULES (do not deviate):
|
|
120
|
-
1. NEVER invent project names, agent slugs, model ids, MCP names or paths. ALWAYS look them up via list_* first.
|
|
121
|
-
2. If the user asks for agents, lists, inventory, or "what exists" without specifying a project, that means **all of them** — call the tool WITHOUT a project argument and the result will include every project.
|
|
122
|
-
3. NEVER answer "specify a project" — instead, just call the tool with no argument and you'll get the full picture.
|
|
123
|
-
4. If a tool result has an error, retry with different arguments before falling back to asking the user.
|
|
124
|
-
5. Respect permission mode. total = execute requested actions without confirmation. automatico = read/list/safe shell actions run directly; destructive, external, runtime, MCP calls, outbound messages, config, and filesystem mutations need explicit user confirmation. permiso = only allowed tools run directly; everything else needs confirmation.
|
|
125
|
-
6. Write in **Spanish** by default (see "Language" section above). Plain text on Telegram — no markdown tables, no code fences unless quoting code. Keep replies under 6 sentences unless the user asks for detail.
|
|
126
|
-
7. Stay brief: under 6 sentences unless asked for detail.
|
|
127
|
-
8. You DO see recent prior turns of this chat as previous messages when applicable. **Use them ONLY to disambiguate references** (e.g. "el primero" → first project mentioned earlier). For ANY factual data — agent details, MCP details, file contents, memory — RE-CALL the tool. Past turns are context, not a cache. Models change, agents change, files change.
|
|
128
|
-
9. /reset or /new from the user means "forget previous turns and answer this one fresh" — if you see those prefixes the operator already cleared the context for you.
|
|
129
|
-
10. **SELF-RUN RULE**: If the user says "vos mismo", "tu mismo", "same", "base", "default", "sin agente", or does not explicitly name an agent slug, act as APX. **DO NOT** call list_agents. **DO NOT** pass an 'agent' argument to tools.
|
|
130
|
-
11. DELEGATION RULE: When the user asks a named APC agent to do a task, use call_agent (unless they specify opening it in a runtime, then see rule 12).
|
|
131
|
-
12. **DISPATCH RULE**: Use call_runtime for external runtimes. If the user named an agent, pass it. If they didn't, **DO NOT PASS ANY AGENT**. Running with an empty agent field is how you run as yourself.
|
|
132
|
-
13. PROJECT RULE: When the user gives no project, use project "default". Do not infer a non-default project from old chat history unless the user references it. If they mention a path or project name, look it up or add it with add_project.
|
|
133
|
-
14. VAULT RULE: When the user wants a new existing agent/template, call list_vault_agents first. If a suitable vault agent exists, import_agent into the chosen project. If none fits, say briefly what is missing.
|
|
134
|
-
15. NO-PENDING RULE: never say "give me a second", "I will do it", or "I will try later" as a final answer. Either call the tool in this same turn or say what blocks you.
|
|
135
|
-
16. IDENTITY RULE: when the user asks you to change your name, call yourself something, or update your personality/language, call set_identity and persist the change. Then confirm with your new name.
|
|
136
|
-
17. ROUTINES RULE: NEVER create a routine in the default project (id=0). Routines MUST be tied to a specific registered project. Before adding a routine, call list_projects to find the correct project id or name. Then pass --project <id|name> to apx routine add. If no project fits, ask the user which project to use. Creating routines in project 0/default mixes unrelated projects' schedules and corrupts state.
|
|
137
|
-
18. **NO BARE ACKS**: Empty acknowledgments ("ok", "entendido", "dame un minuto", "voy", "checking", "ya te escucho", "ahora lo reviso") are never a valid message — not as a final answer and not as a standalone update. Don't announce that you're about to do something: just do it and report. The user already sees your progress step by step (each iteration's text is shown as its own message), so every line you produce must carry real content — a result, a finding, or a concrete question.
|
|
138
|
-
19. **CWD RULE**: When the channel context includes a "CWD: <path>" line, that is the user's current working directory. References to "este directorio", "este proyecto", "esta carpeta", "acá", "aquí", "this directory", "this project", "current dir/folder" all mean that exact CWD path. Use it as the path argument directly — DO NOT ask the user "what's the path?" when CWD is already given. Example: if user says "agregá este proyecto a la lista", call add_project({path: <CWD>}) immediately.
|
|
139
|
-
20. **NO MANUAL SCAFFOLDING**: To register or scaffold a project, ALWAYS use add_project — it auto-creates AGENTS.md and .apc/project.json when missing (one call, atomic). NEVER write AGENTS.md, .apc/project.json, or any APC scaffold file by hand via run_shell / write_file / shell pipes. The schema must come from the official initApf scaffold, not improvised. If add_project errors, report the error to the user — don't try to work around it with shell hacks. Same for any other APC-managed file (.apc/agents/*, .apc/skills/*, etc.) — use the dedicated tool, never raw filesystem writes.
|
|
140
|
-
21. **SKILLS — ON DEMAND**: The "# Available skills" section below lists every skill available to you (slug + description, NO body). When the user asks about specific APX/APC commands, project structure, agent runtimes, or anything where exact syntax or detailed behavior matches a skill description (in ANY language — match semantically, not by keyword), call load_skill({slug}) to fetch the full markdown body. If a CWD is in the contextNote, pass it as project_path so project-scoped skills resolve. If the user explicitly asks "what skills do you have?", you can either read the catalog below directly OR call list_skills to get a fresh enumeration. Do NOT load skills for trivial / unrelated questions — that wastes tokens. Don't guess CLI syntax when a skill can tell you; load it.
|
|
141
|
-
22. **NEVER PASTE BASE64 OR DATA URIs IN MESSAGE TEXT**: When you need to send an image, audio, or file via Telegram (or any channel), you MUST pass it via the dedicated parameter — NEVER embed it in the text field. Concretely: after browser_screenshot returns its base64 field, call send_telegram({text: "<short caption>", photo_base64: "<that base64>"}). Do NOT write text like 'Aquí está: ' — Telegram (and most chat clients) do NOT render data URIs or markdown images; the user sees thousands of garbage characters. Same for files: use document_path / document_base64 / document_url, NOT the text field. The text field is exclusively for human-readable prose (and becomes the caption when media is attached). If unsure, save the image to /tmp/screenshot-<ts>.png first (browser_screenshot supports save_to_tmp=true and returns a path field) and pass that path to send_telegram via photo_path — never inline the bytes in text.`;
|
|
142
|
-
|
|
143
|
-
function compactToolSchema(schema) {
|
|
144
|
-
const fn = schema?.function || {};
|
|
145
|
-
const params = fn.parameters || {};
|
|
146
|
-
const properties = params.properties || {};
|
|
147
|
-
return {
|
|
148
|
-
name: fn.name,
|
|
149
|
-
description: fn.description,
|
|
150
|
-
required: params.required || [],
|
|
151
|
-
properties: Object.fromEntries(
|
|
152
|
-
Object.entries(properties).map(([name, spec]) => [
|
|
153
|
-
name,
|
|
154
|
-
{
|
|
155
|
-
type: spec?.type || "string",
|
|
156
|
-
enum: spec?.enum,
|
|
157
|
-
description: spec?.description,
|
|
158
|
-
},
|
|
159
|
-
])
|
|
160
|
-
),
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function pseudoToolSystem(system) {
|
|
165
|
-
const catalog = TOOL_SCHEMAS.map(compactToolSchema);
|
|
166
|
-
return [
|
|
167
|
-
system,
|
|
168
|
-
"# Structured tool fallback",
|
|
169
|
-
"The engine rejected native structured tools. You can still call tools by emitting plain JSON.",
|
|
170
|
-
"When you need a tool, respond ONLY with one JSON object per line:",
|
|
171
|
-
"{\"name\":\"tool_name\",\"arguments\":{\"arg\":\"value\"}}",
|
|
172
|
-
"After tool results arrive, continue the task or give the final answer normally.",
|
|
173
|
-
"Available tools:",
|
|
174
|
-
JSON.stringify(catalog),
|
|
175
|
-
].join("\n\n");
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function shouldRetryWithPseudoTools(modelId, error, alreadyPseudo) {
|
|
179
|
-
if (alreadyPseudo) return false;
|
|
180
|
-
const message = String(error?.message || "");
|
|
181
|
-
return /^ollama:/i.test(String(modelId || "")) && /ollama\s+500/i.test(message);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function isShortConfirmation(text) {
|
|
185
|
-
return /^(yes|y|si|si dale|dale|ok|okay|confirm|confirmed|go|proceed|do it)\b/i
|
|
186
|
-
.test(String(text || "").trim());
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function lastAssistantAskedForConfirmation(messages) {
|
|
190
|
-
for (let i = messages.length - 1; i >= 0; i--) {
|
|
191
|
-
if (messages[i]?.role !== "assistant") continue;
|
|
192
|
-
return /\b(confirm|confirmation|ok|okay|permission|allowed|proceed|do it|dale)\b/i.test(messages[i].content || "");
|
|
193
|
-
}
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Returns true if the model response looks like a pure acknowledgment
|
|
199
|
-
* with no actual content — the classic "ghost response" anti-pattern.
|
|
200
|
-
*/
|
|
201
|
-
function isGhostResponse(text) {
|
|
202
|
-
const t = String(text || "").trim();
|
|
203
|
-
if (t.length > 200) return false; // long responses are probably real
|
|
204
|
-
return /^(ok|okay|got it|understood|sure|of course|on it|dale|entendido|claro|voy|ya lo hago|dame un (segundo|momento)|un momento|let me|i (will|can|shall)|i'm (going|about)|give me a|ahora lo|enseguida|checking|looking|fetching|working on|stand by|please wait|un seg|dame sec)[\s.,!]*/i
|
|
205
|
-
.test(t);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Returns true if the user's prompt looks like an instruction to act
|
|
210
|
-
* rather than just a question or statement.
|
|
211
|
-
*/
|
|
212
|
-
function looksLikeActionRequest(text) {
|
|
213
|
-
const t = String(text || "").trim().toLowerCase();
|
|
214
|
-
return /\b(list|show|find|get|fetch|search|run|execute|create|add|make|start|stop|delete|update|send|check|read|write|look|tell me|dame|mostra|busca|ejecuta|crea|agrega|mandá|revisá|corré|borrá|arrancá)\b/.test(t);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Build the identity block injected into every super-agent system prompt.
|
|
219
|
-
* Pure function — exported for unit tests.
|
|
220
|
-
*
|
|
221
|
-
* @param {object|null} identity result of readIdentity(), or a plain object for tests
|
|
222
|
-
* @param {string} userLang ISO 639-1 code from config.user.language (default "en")
|
|
223
|
-
*/
|
|
224
|
-
export function buildIdentityBlock(identity, userLang = "en") {
|
|
225
|
-
const lines = ["# Identity"];
|
|
226
|
-
if (identity?.agent_name) lines.push(`Your name is ${identity.agent_name}.`);
|
|
227
|
-
if (identity?.personality) lines.push(`Your personality: ${identity.personality}.`);
|
|
228
|
-
if (identity?.owner_name) lines.push(`Your owner is ${identity.owner_name}.`);
|
|
229
|
-
if (identity?.owner_context) lines.push(`Owner context: ${identity.owner_context}`);
|
|
230
|
-
lines.push(`Always reply in the language with ISO code "${userLang}" unless the user explicitly switches.`);
|
|
231
|
-
return lines.join("\n");
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export function isSuperAgentEnabled(cfg) {
|
|
235
|
-
// The super-agent is the system's default reply path. It is considered
|
|
236
|
-
// enabled as soon as a model is configured — the legacy `.enabled` flag is
|
|
237
|
-
// honoured only when explicitly set to `false`. This prevents the bot
|
|
238
|
-
// from silently dropping Telegram messages just because someone forgot to
|
|
239
|
-
// set super_agent.enabled = true.
|
|
240
|
-
const sa = cfg && cfg.super_agent;
|
|
241
|
-
if (!sa || !sa.model) return false;
|
|
242
|
-
return sa.enabled !== false;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export async function runSuperAgent({
|
|
246
|
-
globalConfig,
|
|
247
|
-
projects,
|
|
248
|
-
plugins,
|
|
249
|
-
registries,
|
|
250
|
-
prompt,
|
|
251
|
-
contextNote = "",
|
|
252
|
-
previousMessages = [],
|
|
253
|
-
overrideModel = null,
|
|
254
|
-
onEvent = null,
|
|
255
|
-
signal,
|
|
256
|
-
onToken = null,
|
|
257
|
-
}) {
|
|
258
|
-
if (!isSuperAgentEnabled(globalConfig)) {
|
|
259
|
-
throw new Error("super-agent not enabled (set super_agent.enabled and .model in ~/.apx/config.json)");
|
|
260
|
-
}
|
|
261
|
-
const sa = globalConfig.super_agent;
|
|
262
|
-
const activeModel = overrideModel || sa.model;
|
|
263
|
-
|
|
264
|
-
// Tiny project hint — JUST names + ids, no detail. The model is expected to
|
|
265
|
-
// call list_agents / list_mcps / read_agent_memory / etc. for everything
|
|
266
|
-
// else. Keeping this short forces actual tool use instead of letting the
|
|
267
|
-
// model answer from a cached snapshot.
|
|
268
|
-
const projectIndex = projects
|
|
269
|
-
.list()
|
|
270
|
-
.map((p) => ` ${p.id}: ${p.id === 0 ? "[default]" : "[project]"} "${p.name}" (${p.path})`)
|
|
271
|
-
.join("\n");
|
|
272
|
-
|
|
273
|
-
const permissionMode = sa.permission_mode || "automatico";
|
|
274
|
-
const allowedTools = Array.isArray(sa.allowed_tools) ? sa.allowed_tools : [];
|
|
275
|
-
const permissionNote = [
|
|
276
|
-
"# Permission mode",
|
|
277
|
-
`mode: ${permissionMode}`,
|
|
278
|
-
`allowed_tools: ${allowedTools.join(", ") || "(none)"}`,
|
|
279
|
-
"When a tool schema has confirmed, set confirmed=true only after explicit user confirmation for that exact action.",
|
|
280
|
-
].join("\n");
|
|
281
|
-
|
|
282
|
-
// Build a lightweight catalog of available skills (slug + 1-line description).
|
|
283
|
-
// Skill BODIES are NOT included — only the catalog. The model decides which
|
|
284
|
-
// (if any) to load on demand via load_skill(slug). Cross-lingual matching is
|
|
285
|
-
// handled by the LLM itself (no router needed). Empty if no skills found.
|
|
286
|
-
const skillsCatalog = (() => {
|
|
287
|
-
let list = [];
|
|
288
|
-
try { list = listSkills(); } catch { /* loader failure → empty catalog */ }
|
|
289
|
-
if (!list.length) return "";
|
|
290
|
-
return [
|
|
291
|
-
"# Available skills (load on demand)",
|
|
292
|
-
"Below is the catalog of skills (slug + description). Bodies are NOT loaded yet.",
|
|
293
|
-
"If the user asks how something works, requests syntax/docs, or otherwise needs",
|
|
294
|
-
"knowledge that matches a skill description (in any language — match semantically),",
|
|
295
|
-
"call load_skill({slug}) to load the full markdown into your context.",
|
|
296
|
-
"",
|
|
297
|
-
...list.map(s => `- **${s.slug}** [${s.source}]: ${s.description || "(no description)"}`),
|
|
298
|
-
].join("\n");
|
|
299
|
-
})();
|
|
300
|
-
|
|
301
|
-
// Identity: who the agent is, who it works for, and what extra context the owner provided.
|
|
302
|
-
// Language comes from config.user.language (ISO 639-1) so it stays in sync with transcription.
|
|
303
|
-
const identity = (() => { try { return readIdentity(); } catch { return null; } })();
|
|
304
|
-
const userLang = globalConfig?.user?.language || "en";
|
|
305
|
-
const identityBlock = buildIdentityBlock(identity, userLang);
|
|
306
|
-
|
|
307
|
-
const system = [
|
|
308
|
-
sa.system || DEFAULT_SYSTEM,
|
|
309
|
-
identityBlock,
|
|
310
|
-
permissionNote,
|
|
311
|
-
contextNote,
|
|
312
|
-
"# Registered projects (just the index — call tools for details)",
|
|
313
|
-
projectIndex || "(no projects registered)",
|
|
314
|
-
skillsCatalog,
|
|
315
|
-
]
|
|
316
|
-
.filter(Boolean)
|
|
317
|
-
.join("\n\n");
|
|
318
|
-
|
|
319
|
-
// Build tools and handler map
|
|
320
|
-
const handlers = makeToolHandlers({
|
|
321
|
-
projects,
|
|
322
|
-
plugins,
|
|
323
|
-
registries,
|
|
324
|
-
globalConfig,
|
|
325
|
-
implicitConfirmation:
|
|
326
|
-
isShortConfirmation(prompt) && lastAssistantAskedForConfirmation(previousMessages),
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
// Agent loop: call model → if tool_calls, execute and feed back; repeat.
|
|
330
|
-
// Inject any prior turns the caller passed (e.g. recent Telegram history)
|
|
331
|
-
// so the model has multi-turn context.
|
|
332
|
-
const conversation = [...previousMessages, { role: "user", content: prompt }];
|
|
333
|
-
const trace = [];
|
|
334
|
-
let totalUsage = { input_tokens: 0, output_tokens: 0 };
|
|
335
|
-
let lastText = "";
|
|
336
|
-
let usePseudoTools = false;
|
|
337
|
-
// Track how many consecutive iterations contained only ACK_ONLY tools.
|
|
338
|
-
// While this is > 0 we keep tool_choice="required" so the next iter has
|
|
339
|
-
// to do real work — otherwise gemma4-class models call send_telegram
|
|
340
|
-
// for the ack and then break out with empty text on iter N+1.
|
|
341
|
-
let ackOnlyStreak = 0;
|
|
342
|
-
|
|
343
|
-
for (let iter = 0; iter < MAX_TOOL_ITERS; iter++) {
|
|
344
|
-
await emitProgress(onEvent, { type: "model_start", iteration: iter + 1 });
|
|
345
|
-
// Force a tool call on iter 0 (no bare "ok dame un segundo" reply), AND
|
|
346
|
-
// on any iteration that immediately follows an ack-only iter (so the
|
|
347
|
-
// model can't ack and then stop). After at most MAX_CONSECUTIVE_ACKS
|
|
348
|
-
// forced rounds we let it fall back to "auto" so the model can finish.
|
|
349
|
-
const forceTool =
|
|
350
|
-
iter === 0 ||
|
|
351
|
-
(ackOnlyStreak > 0 && ackOnlyStreak <= MAX_CONSECUTIVE_ACKS);
|
|
352
|
-
let result;
|
|
353
|
-
try {
|
|
354
|
-
result = await callEngine({
|
|
355
|
-
modelId: activeModel,
|
|
356
|
-
system: usePseudoTools ? pseudoToolSystem(system) : system,
|
|
357
|
-
messages: conversation,
|
|
358
|
-
config: globalConfig,
|
|
359
|
-
tools: usePseudoTools ? null : TOOL_SCHEMAS,
|
|
360
|
-
toolChoice: usePseudoTools ? null : (forceTool ? "required" : "auto"),
|
|
361
|
-
maxTokens: 1024,
|
|
362
|
-
signal,
|
|
363
|
-
// Only stream tokens on non-forced iterations — on forced iters the
|
|
364
|
-
// model MUST emit a tool_call, streaming text would confuse the user.
|
|
365
|
-
onToken: (!forceTool && onToken) ? onToken : null,
|
|
366
|
-
});
|
|
367
|
-
} catch (e) {
|
|
368
|
-
if (usePseudoTools && /^ollama:/i.test(String(activeModel || "")) && /ollama\s+500/i.test(String(e?.message || "")) && trace.length > 0) {
|
|
369
|
-
await emitProgress(onEvent, { type: "model_retry", reason: "ollama_final_response_500", iteration: iter + 1 });
|
|
370
|
-
lastText = fallbackFinalText(trace, e);
|
|
371
|
-
break;
|
|
372
|
-
}
|
|
373
|
-
if (!shouldRetryWithPseudoTools(activeModel, e, usePseudoTools)) throw e;
|
|
374
|
-
usePseudoTools = true;
|
|
375
|
-
await emitProgress(onEvent, { type: "model_retry", reason: "ollama_structured_tools_500", iteration: iter + 1 });
|
|
376
|
-
result = await callEngine({
|
|
377
|
-
modelId: activeModel,
|
|
378
|
-
system: pseudoToolSystem(system),
|
|
379
|
-
messages: conversation,
|
|
380
|
-
config: globalConfig,
|
|
381
|
-
tools: null,
|
|
382
|
-
toolChoice: null,
|
|
383
|
-
maxTokens: 1024,
|
|
384
|
-
signal,
|
|
385
|
-
onToken: (iter > 0 && onToken) ? onToken : null,
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
totalUsage.input_tokens += result.usage?.input_tokens || 0;
|
|
389
|
-
totalUsage.output_tokens += result.usage?.output_tokens || 0;
|
|
390
|
-
lastText = result.text || "";
|
|
391
|
-
|
|
392
|
-
let toolCalls = result.tool_calls || (result.message && result.message.tool_calls) || null;
|
|
393
|
-
|
|
394
|
-
// Some models (qwen2.5 in particular) emit tool calls as plain text
|
|
395
|
-
// instead of using the structured field. If we don't find structured
|
|
396
|
-
// tool_calls, scan the text for the pseudo-format and treat them the
|
|
397
|
-
// same. We also clean the visible text so the leftover `_icall()` and
|
|
398
|
-
// {"name":...} junk never reaches the user as a final answer.
|
|
399
|
-
if ((!toolCalls || toolCalls.length === 0) && lastText) {
|
|
400
|
-
const pseudo = extractPseudoToolCalls(lastText);
|
|
401
|
-
if (pseudo.length > 0) {
|
|
402
|
-
toolCalls = pseudo;
|
|
403
|
-
lastText = cleanTextOfPseudoToolCalls(lastText);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
if (!toolCalls || toolCalls.length === 0) {
|
|
408
|
-
// Ghost-response detection: if the model returned a pure acknowledgment
|
|
409
|
-
// (no tool calls, no real content) on the FIRST iteration in response to
|
|
410
|
-
// what looks like an action request, inject a re-prompt.
|
|
411
|
-
if (iter === 0 && isGhostResponse(lastText) && looksLikeActionRequest(prompt)) {
|
|
412
|
-
await emitProgress(onEvent, { type: "ghost_response_detected", text: lastText });
|
|
413
|
-
conversation.push({ role: "assistant", content: lastText });
|
|
414
|
-
conversation.push({
|
|
415
|
-
role: "user",
|
|
416
|
-
content:
|
|
417
|
-
"Remember: you must execute the action, not just confirm it. " +
|
|
418
|
-
"Call the tool now — action first, report after.",
|
|
419
|
-
});
|
|
420
|
-
continue; // give the model one more chance
|
|
421
|
-
}
|
|
422
|
-
// Final answer — clean up any stray fence markers just in case
|
|
423
|
-
lastText = cleanTextOfPseudoToolCalls(lastText) || lastText;
|
|
424
|
-
break;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
const visibleText = cleanTextOfPseudoToolCalls(lastText).trim();
|
|
428
|
-
if (visibleText) {
|
|
429
|
-
await emitProgress(onEvent, { type: "assistant_text", text: visibleText, iteration: iter + 1 });
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
// Append the assistant turn (with its tool_calls) and execute each call.
|
|
433
|
-
conversation.push({
|
|
434
|
-
role: "assistant",
|
|
435
|
-
content: result.text || "",
|
|
436
|
-
tool_calls: toolCalls,
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
for (const tc of toolCalls) {
|
|
440
|
-
const fn = tc.function || tc; // some adapters bury it deeper
|
|
441
|
-
const name = fn.name;
|
|
442
|
-
let args = fn.arguments;
|
|
443
|
-
if (typeof args === "string") {
|
|
444
|
-
try { args = JSON.parse(args); } catch { args = {}; }
|
|
445
|
-
}
|
|
446
|
-
args = args || {};
|
|
447
|
-
|
|
448
|
-
let toolResult;
|
|
449
|
-
const traceId = `${iter + 1}:${trace.length + 1}`;
|
|
450
|
-
await emitProgress(onEvent, {
|
|
451
|
-
type: "tool_start",
|
|
452
|
-
trace: { id: traceId, tool: name, args, pending: true },
|
|
453
|
-
iteration: iter + 1,
|
|
454
|
-
});
|
|
455
|
-
try {
|
|
456
|
-
const handler = handlers[name];
|
|
457
|
-
if (!handler) {
|
|
458
|
-
toolResult = { error: `unknown tool: ${name}` };
|
|
459
|
-
} else {
|
|
460
|
-
toolResult = await handler(args);
|
|
461
|
-
}
|
|
462
|
-
} catch (e) {
|
|
463
|
-
toolResult = { error: e.message };
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
const traceItem = { id: traceId, tool: name, args, result: summarizeForTrace(toolResult) };
|
|
467
|
-
trace.push(traceItem);
|
|
468
|
-
await emitProgress(onEvent, {
|
|
469
|
-
type: "tool_result",
|
|
470
|
-
trace: traceItem,
|
|
471
|
-
iteration: iter + 1,
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
conversation.push({
|
|
475
|
-
role: "tool",
|
|
476
|
-
tool_name: name,
|
|
477
|
-
content: JSON.stringify(toolResult),
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
// Did this iteration consist of ONLY ack-style tool calls? If so we'll
|
|
482
|
-
// keep tool_choice forced on the next iter (see top of loop). A turn
|
|
483
|
-
// that mixes send_telegram + e.g. browser_screenshot counts as "real
|
|
484
|
-
// work" and resets the streak.
|
|
485
|
-
const allAckOnly = toolCalls.every((tc) => {
|
|
486
|
-
const n = (tc.function?.name) || tc.name;
|
|
487
|
-
return ACK_ONLY_TOOLS.has(n);
|
|
488
|
-
});
|
|
489
|
-
if (allAckOnly) {
|
|
490
|
-
ackOnlyStreak += 1;
|
|
491
|
-
await emitProgress(onEvent, {
|
|
492
|
-
type: "ack_only_iter",
|
|
493
|
-
iteration: iter + 1,
|
|
494
|
-
streak: ackOnlyStreak,
|
|
495
|
-
});
|
|
496
|
-
} else {
|
|
497
|
-
ackOnlyStreak = 0;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
return {
|
|
502
|
-
text: lastText,
|
|
503
|
-
usage: totalUsage,
|
|
504
|
-
name: sa.name || "apx",
|
|
505
|
-
trace,
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
async function emitProgress(onEvent, event) {
|
|
510
|
-
if (typeof onEvent !== "function") return;
|
|
511
|
-
await onEvent(event);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
function summarizeForTrace(r) {
|
|
515
|
-
if (r === null || r === undefined) return r;
|
|
516
|
-
const s = JSON.stringify(r);
|
|
517
|
-
if (s.length <= 400) return r;
|
|
518
|
-
return s.slice(0, 380) + "…(truncated)";
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
function fallbackFinalText(trace, error) {
|
|
522
|
-
const lines = [
|
|
523
|
-
"Tool execution completed, but the model failed while composing the final answer.",
|
|
524
|
-
`Engine error: ${String(error?.message || error).slice(0, 220)}`,
|
|
525
|
-
"Trace:",
|
|
526
|
-
];
|
|
527
|
-
for (const item of trace.slice(-8)) {
|
|
528
|
-
lines.push(`- ${item.tool}: ${previewTraceResult(item.result)}`);
|
|
529
|
-
}
|
|
530
|
-
return lines.join("\n");
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
function previewTraceResult(result) {
|
|
534
|
-
if (result === null || result === undefined) return "ok";
|
|
535
|
-
if (typeof result === "string") return result.slice(0, 180);
|
|
536
|
-
if (result.error) return `error: ${String(result.error).slice(0, 180)}`;
|
|
537
|
-
if (result.path) return String(result.path).slice(0, 180);
|
|
538
|
-
if (result.content) return String(result.content).slice(0, 180);
|
|
539
|
-
if (result.results) return JSON.stringify(result.results).slice(0, 180);
|
|
540
|
-
return JSON.stringify(result).slice(0, 180);
|
|
541
|
-
}
|
package/src/overlay/index.html
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta http-equiv="Content-Security-Policy"
|
|
6
|
-
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; media-src *;">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<title>APX</title>
|
|
9
|
-
<link rel="stylesheet" href="style.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app">
|
|
13
|
-
<!-- Header -->
|
|
14
|
-
<div id="header">
|
|
15
|
-
<span class="logo">APX</span>
|
|
16
|
-
<span id="status-text" class="status">Ready</span>
|
|
17
|
-
<div id="conn-badge" title="Daemon disconnected"></div>
|
|
18
|
-
<button class="btn-close" id="btn-close" title="Close (Esc)">✕</button>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<!-- Messages -->
|
|
22
|
-
<div id="messages">
|
|
23
|
-
<div id="empty-state">
|
|
24
|
-
<div class="icon">🎙</div>
|
|
25
|
-
<div>Press <kbd id="empty-shortcut-hint">⌘G</kbd> to start speaking</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<!-- Live transcription bar -->
|
|
30
|
-
<div id="live-bar">
|
|
31
|
-
<div class="rec-dot"></div>
|
|
32
|
-
<div id="live-text">Listening…</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<!-- Hint bar -->
|
|
36
|
-
<div id="hint-bar">
|
|
37
|
-
<span class="hint"><kbd id="shortcut-hint">⌘⇧\</kbd> record</span>
|
|
38
|
-
<span class="hint"><kbd>Esc</kbd> cancel / close</span>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<script src="renderer.js"></script>
|
|
43
|
-
</body>
|
|
44
|
-
</html>
|