@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,386 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import useSWR from "swr";
|
|
3
|
+
import { ArrowRight, Bot, Crown, Heart, Play, Plus, Send, Terminal, Trash2, Zap } from "lucide-react";
|
|
4
|
+
import { Routines, Agents, type RoutineEntry } from "../../lib/api";
|
|
5
|
+
import { Section } from "../../components/Section";
|
|
6
|
+
import { Badge, Button, Dialog, Empty, Field, Input, Loading, Switch, Textarea } from "../../components/ui";
|
|
7
|
+
import { UiSelect } from "../../components/UiSelect";
|
|
8
|
+
import { useToast } from "../../components/Toast";
|
|
9
|
+
import { cn } from "../../lib/cn";
|
|
10
|
+
import { t } from "../../i18n";
|
|
11
|
+
|
|
12
|
+
function splitLines(v: string): string[] {
|
|
13
|
+
return v.split("\n").map((s) => s.trim()).filter(Boolean);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type Kind = RoutineEntry["kind"];
|
|
17
|
+
|
|
18
|
+
// Friendly action types (maps to routines.js kinds).
|
|
19
|
+
const KIND_META: Record<Kind, { label: string; desc: string; icon: typeof Bot }> = {
|
|
20
|
+
exec_agent: { label: "Agente del proyecto", desc: "Ejecuta un agente del proyecto con un prompt. Elegís cuál.", icon: Bot },
|
|
21
|
+
super_agent: { label: "Super-agente", desc: "Llama al super-agente de APX con un prompt.", icon: Crown },
|
|
22
|
+
telegram: { label: "Telegram", desc: "Manda un mensaje fijo a un canal de Telegram. No usa modelo ni agente.", icon: Send },
|
|
23
|
+
shell: { label: "Shell", desc: "Corre un comando de shell. Sin prompt ni pre/post — el comando es la acción.", icon: Terminal },
|
|
24
|
+
heartbeat: { label: "Latido (heartbeat)", desc: "No hace nada salvo escribir una línea en los logs cada vez que corre. Sirve para confirmar que el scheduler está vivo. Si no sabés si lo necesitás, no lo uses.", icon: Heart },
|
|
25
|
+
};
|
|
26
|
+
const KIND_OPTIONS = (Object.keys(KIND_META) as Kind[]).map((k) => ({ value: k, label: KIND_META[k].label, description: KIND_META[k].desc, icon: KIND_META[k].icon }));
|
|
27
|
+
|
|
28
|
+
// "every:10m" → "cada 10 minutos", cron/once → legible.
|
|
29
|
+
function scheduleHuman(s?: string): string {
|
|
30
|
+
if (!s) return "—";
|
|
31
|
+
if (s.startsWith("every:")) {
|
|
32
|
+
const v = s.slice(6);
|
|
33
|
+
const m = v.match(/^(\d+)(s|m|h|d)$/);
|
|
34
|
+
if (m) {
|
|
35
|
+
const n = m[1];
|
|
36
|
+
const unit = { s: "segundos", m: "minutos", h: "horas", d: "días" }[m[2]] || m[2];
|
|
37
|
+
return `cada ${n} ${unit}`;
|
|
38
|
+
}
|
|
39
|
+
return `cada ${v}`;
|
|
40
|
+
}
|
|
41
|
+
if (s.startsWith("once:")) return `una vez · ${new Date(s.slice(5)).toLocaleString()}`;
|
|
42
|
+
if (s.startsWith("cron ")) return `cron · ${s.slice(5)}`;
|
|
43
|
+
return s;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const SCHED_PRESETS = [
|
|
47
|
+
{ label: "cada 10 min", value: "every:10m" },
|
|
48
|
+
{ label: "cada hora", value: "every:1h" },
|
|
49
|
+
{ label: "diario 9am", value: "cron 0 9 * * *" },
|
|
50
|
+
{ label: "días hábiles 9am", value: "cron 0 9 * * 1-5" },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
// Template/env vars the routine runner exposes (src/host/daemon/routines.js).
|
|
54
|
+
const VARS = [
|
|
55
|
+
{ v: "{{pre_output}}", where: "prompt", desc: "Salida de los pre-commands, inyectada en el prompt." },
|
|
56
|
+
{ v: "$APX_LLM_OUTPUT", where: "post", desc: "Respuesta del agente / super-agente." },
|
|
57
|
+
{ v: "$APX_STATUS", where: "post", desc: "ok | error." },
|
|
58
|
+
{ v: "$APX_SKIPPED", where: "post", desc: "1 si la acción se salteó." },
|
|
59
|
+
{ v: "$APX_PRE_OUTPUT", where: "post", desc: "Salida de los pre-commands." },
|
|
60
|
+
{ v: "$APX_PRE_OUTPUT_FILE", where: "post", desc: "Archivo con la salida de pre (para outputs grandes)." },
|
|
61
|
+
{ v: "$APX_PRE_EXIT", where: "post", desc: "Exit code de los pre-commands." },
|
|
62
|
+
{ v: "$APX_ROUTINE", where: "pre/post", desc: "Nombre de la rutina." },
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
function actionSummary(kind: Kind, spec: Record<string, unknown>): string {
|
|
66
|
+
switch (kind) {
|
|
67
|
+
case "exec_agent": return spec.agent ? `Ejecuta el agente "${spec.agent}"` : "Ejecuta un agente (falta elegir)";
|
|
68
|
+
case "super_agent": return "Llama al super-agente";
|
|
69
|
+
case "telegram": return `Envía Telegram a "${spec.channel || "default"}"`;
|
|
70
|
+
case "shell": return spec.command ? `Corre: ${String(spec.command).slice(0, 40)}` : "Corre un comando shell";
|
|
71
|
+
case "heartbeat": return "Deja un latido en logs";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function RoutinesTab({ pid }: { pid: string }) {
|
|
76
|
+
const toast = useToast();
|
|
77
|
+
const list = useSWR(`/projects/${pid}/routines`, () => Routines.list(pid));
|
|
78
|
+
const [editing, setEditing] = useState<Partial<RoutineEntry> | null>(null);
|
|
79
|
+
|
|
80
|
+
const toggle = async (r: RoutineEntry) => {
|
|
81
|
+
try { await (r.enabled ? Routines.disable : Routines.enable)(pid, r.name); list.mutate(); }
|
|
82
|
+
catch (e: any) { toast.error(e?.message || t("project.routines.toggle_error")); }
|
|
83
|
+
};
|
|
84
|
+
const runNow = async (r: RoutineEntry) => {
|
|
85
|
+
try { await Routines.run(pid, r.name); toast.success(t("project.routines.run_success", { name: r.name })); }
|
|
86
|
+
catch (e: any) { toast.error(e?.message || t("project.routines.run_error")); }
|
|
87
|
+
};
|
|
88
|
+
const remove = async (r: RoutineEntry) => {
|
|
89
|
+
if (!confirm(t("project.routines.delete_confirm", { name: r.name }))) return;
|
|
90
|
+
try { await Routines.remove(pid, r.name); toast.success(t("project.routines.delete_success")); list.mutate(); }
|
|
91
|
+
catch (e: any) { toast.error(e?.message || t("project.routines.delete_error")); }
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Section
|
|
96
|
+
title={t("project.routines.title")}
|
|
97
|
+
description={t("project.routines.subtitle")}
|
|
98
|
+
action={<Button size="sm" variant="primary" onClick={() => setEditing({ kind: "super_agent", schedule: "every:10m", enabled: true })}>
|
|
99
|
+
<Plus size={14} /> {t("project.routines.new_btn")}
|
|
100
|
+
</Button>}
|
|
101
|
+
>
|
|
102
|
+
{list.isLoading && <Loading />}
|
|
103
|
+
{!list.isLoading && (list.data?.length ?? 0) === 0 && <Empty>{t("project.routines.empty")}</Empty>}
|
|
104
|
+
<ul className="space-y-2 text-sm">
|
|
105
|
+
{(list.data || []).map((row) => {
|
|
106
|
+
const meta = KIND_META[row.kind];
|
|
107
|
+
const Icon = meta?.icon || Zap;
|
|
108
|
+
const err = row.last_status === "error";
|
|
109
|
+
return (
|
|
110
|
+
<li
|
|
111
|
+
key={row.name}
|
|
112
|
+
className="cursor-pointer rounded-xl border border-border bg-muted/30 p-3 hover:border-muted-fg/50"
|
|
113
|
+
onClick={() => setEditing({ ...row })}
|
|
114
|
+
>
|
|
115
|
+
<div className="flex items-center justify-between gap-3">
|
|
116
|
+
<div className="flex items-center gap-2">
|
|
117
|
+
<span className={cn("flex size-7 items-center justify-center rounded-lg", row.enabled ? "bg-emerald-500/15 text-emerald-400" : "bg-muted text-muted-fg")}>
|
|
118
|
+
<Icon size={14} />
|
|
119
|
+
</span>
|
|
120
|
+
<span className="font-medium">{row.name}</span>
|
|
121
|
+
<Badge tone={row.kind === "shell" ? "warning" : "info"}>{meta?.label || row.kind}</Badge>
|
|
122
|
+
{!row.enabled && <Badge tone="muted">{t("project.routines.paused")}</Badge>}
|
|
123
|
+
</div>
|
|
124
|
+
<div className="flex items-center gap-2" onClick={(e) => e.stopPropagation()}>
|
|
125
|
+
<Switch checked={row.enabled} onChange={() => toggle(row)} />
|
|
126
|
+
<Button size="sm" variant="secondary" onClick={() => runNow(row)}><Play size={13} /> Run</Button>
|
|
127
|
+
<Button size="sm" variant="destructive" onClick={() => remove(row)}><Trash2 size={13} /></Button>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div className="mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-fg">
|
|
131
|
+
<span>⏱ {scheduleHuman(row.schedule)}</span>
|
|
132
|
+
<span>{actionSummary(row.kind, row.spec || {})}</span>
|
|
133
|
+
{row.next_run_at && <span>{t("project.routines.next_run")} {new Date(row.next_run_at).toLocaleString()}</span>}
|
|
134
|
+
<span className={cn(row.last_status === "ok" && "text-emerald-500", err && "text-destructive")}>
|
|
135
|
+
última: {row.last_status || "—"}
|
|
136
|
+
</span>
|
|
137
|
+
</div>
|
|
138
|
+
{row.last_error && <div className="mt-2 rounded-md bg-destructive/10 px-2 py-1 text-xs text-destructive">{row.last_error}</div>}
|
|
139
|
+
</li>
|
|
140
|
+
);
|
|
141
|
+
})}
|
|
142
|
+
</ul>
|
|
143
|
+
|
|
144
|
+
<RoutineEditor
|
|
145
|
+
draft={editing}
|
|
146
|
+
onClose={() => setEditing(null)}
|
|
147
|
+
onSaved={() => { setEditing(null); list.mutate(); }}
|
|
148
|
+
pid={pid}
|
|
149
|
+
/>
|
|
150
|
+
</Section>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function RoutineEditor({
|
|
155
|
+
draft, onClose, onSaved, pid,
|
|
156
|
+
}: { draft: Partial<RoutineEntry> | null; onClose: () => void; onSaved: () => void; pid: string }) {
|
|
157
|
+
const toast = useToast();
|
|
158
|
+
const agentsList = useSWR(draft ? `/projects/${pid}/agents` : null, () => Agents.list(pid));
|
|
159
|
+
const [busy, setBusy] = useState(false);
|
|
160
|
+
|
|
161
|
+
const [name, setName] = useState("");
|
|
162
|
+
const [kind, setKind] = useState<Kind>("super_agent");
|
|
163
|
+
const [schedule, setSchedule] = useState("every:10m");
|
|
164
|
+
const [enabled, setEnabled] = useState(true);
|
|
165
|
+
// Per-kind fields
|
|
166
|
+
const [agent, setAgent] = useState("");
|
|
167
|
+
const [prompt, setPrompt] = useState("");
|
|
168
|
+
const [tgChannel, setTgChannel] = useState("default");
|
|
169
|
+
const [tgChatId, setTgChatId] = useState("");
|
|
170
|
+
const [tgText, setTgText] = useState("");
|
|
171
|
+
const [command, setCommand] = useState("");
|
|
172
|
+
const [hbChannel, setHbChannel] = useState("heartbeat");
|
|
173
|
+
const [hbMessage, setHbMessage] = useState("");
|
|
174
|
+
const [pre, setPre] = useState("");
|
|
175
|
+
const [post, setPost] = useState("");
|
|
176
|
+
|
|
177
|
+
// Load draft → fields.
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (!draft) return;
|
|
180
|
+
const spec = (draft.spec && typeof draft.spec === "object" ? draft.spec : {}) as Record<string, any>;
|
|
181
|
+
setName(draft.name || "");
|
|
182
|
+
setKind((draft.kind as Kind) || "super_agent");
|
|
183
|
+
setSchedule(draft.schedule || "every:10m");
|
|
184
|
+
setEnabled(draft.enabled ?? true);
|
|
185
|
+
setAgent(spec.agent || "");
|
|
186
|
+
setPrompt(spec.prompt || "");
|
|
187
|
+
setTgChannel(spec.channel || "default");
|
|
188
|
+
setTgChatId(spec.chat_id ? String(spec.chat_id) : "");
|
|
189
|
+
setTgText(spec.text || "");
|
|
190
|
+
setCommand(spec.command || "");
|
|
191
|
+
setHbChannel(spec.channel || "heartbeat");
|
|
192
|
+
setHbMessage(spec.message || "");
|
|
193
|
+
setPre((draft.pre_commands || []).join("\n"));
|
|
194
|
+
setPost((draft.post_commands || []).join("\n"));
|
|
195
|
+
}, [draft]);
|
|
196
|
+
|
|
197
|
+
const buildSpec = (): Record<string, unknown> => {
|
|
198
|
+
switch (kind) {
|
|
199
|
+
case "exec_agent": return { agent, prompt };
|
|
200
|
+
case "super_agent": return { prompt };
|
|
201
|
+
case "telegram": return { channel: tgChannel, ...(tgChatId ? { chat_id: tgChatId } : {}), text: tgText };
|
|
202
|
+
case "shell": return { command };
|
|
203
|
+
case "heartbeat": return { channel: hbChannel, message: hbMessage };
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const submit = async () => {
|
|
208
|
+
if (!name) { toast.error(t("project.routines.name_required")); return; }
|
|
209
|
+
setBusy(true);
|
|
210
|
+
try {
|
|
211
|
+
const usePP = kind === "exec_agent" || kind === "super_agent";
|
|
212
|
+
await Routines.upsert(pid, {
|
|
213
|
+
name, kind, schedule, enabled,
|
|
214
|
+
spec: buildSpec(),
|
|
215
|
+
pre_commands: usePP ? splitLines(pre) : [],
|
|
216
|
+
post_commands: usePP ? splitLines(post) : [],
|
|
217
|
+
});
|
|
218
|
+
toast.success(t("project.routines.saved"));
|
|
219
|
+
onSaved();
|
|
220
|
+
} catch (e: any) { toast.error(e?.message || t("project.routines.save_error")); }
|
|
221
|
+
finally { setBusy(false); }
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// Only the LLM kinds wrap the action with pre/post shell commands.
|
|
225
|
+
const usesPrePost = kind === "exec_agent" || kind === "super_agent";
|
|
226
|
+
// Timeline steps (pre → action → post).
|
|
227
|
+
const preSteps = usesPrePost ? splitLines(pre) : [];
|
|
228
|
+
const postSteps = usesPrePost ? splitLines(post) : [];
|
|
229
|
+
const actionLabel = (() => {
|
|
230
|
+
switch (kind) {
|
|
231
|
+
case "exec_agent": return agent ? `Agente "${agent}" responde el prompt` : "Agente (elegí cuál) responde el prompt";
|
|
232
|
+
case "super_agent": return "El super-agente responde el prompt";
|
|
233
|
+
case "telegram": return `Manda Telegram al canal "${tgChannel}"`;
|
|
234
|
+
case "shell": return command ? `Corre: ${command.slice(0, 48)}` : "Corre el comando shell";
|
|
235
|
+
case "heartbeat": return "Deja un latido en logs";
|
|
236
|
+
}
|
|
237
|
+
})();
|
|
238
|
+
const usesPrompt = usesPrePost;
|
|
239
|
+
|
|
240
|
+
const ActionIcon = KIND_META[kind].icon;
|
|
241
|
+
const steps = [
|
|
242
|
+
...preSteps.map((c, i) => ({ id: `pre-${i}`, icon: Terminal, label: "Pre", detail: c, action: false })),
|
|
243
|
+
{ id: "action", icon: ActionIcon, label: actionLabel, detail: usesPrompt && prompt ? prompt.slice(0, 90) : undefined, action: true },
|
|
244
|
+
...postSteps.map((c, i) => ({ id: `post-${i}`, icon: Terminal, label: "Post", detail: c, action: false })),
|
|
245
|
+
];
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<Dialog
|
|
249
|
+
open={!!draft}
|
|
250
|
+
onClose={onClose}
|
|
251
|
+
title={draft?.name ? t("project.routines.edit_title", { name: draft.name }) : t("project.routines.new_title")}
|
|
252
|
+
description={t("project.routines.dialog_desc")}
|
|
253
|
+
size="xl"
|
|
254
|
+
footer={
|
|
255
|
+
<>
|
|
256
|
+
<Button variant="ghost" onClick={onClose} disabled={busy}>{t("common.cancel")}</Button>
|
|
257
|
+
<Button variant="primary" onClick={submit} loading={busy}>{t("common.save")}</Button>
|
|
258
|
+
</>
|
|
259
|
+
}
|
|
260
|
+
>
|
|
261
|
+
<div className="space-y-4">
|
|
262
|
+
{/* status */}
|
|
263
|
+
<div className="flex items-center justify-between rounded-lg border border-border bg-muted/20 px-3 py-2">
|
|
264
|
+
<Switch checked={enabled} onChange={setEnabled} label={t("project.routines.enabled_label")} />
|
|
265
|
+
<span className="text-[11px] text-muted-fg">{enabled ? t("project.routines.enabled_hint") : t("project.routines.disabled_hint")}</span>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<div className="grid gap-6 md:grid-cols-2">
|
|
269
|
+
{/* LEFT — qué y cuándo */}
|
|
270
|
+
<div className="space-y-3">
|
|
271
|
+
<Field label={t("project.routines.name_field")} hint={draft?.name ? t("project.routines.name_no_edit") : undefined}>
|
|
272
|
+
<Input value={name} disabled={!!draft?.name} onChange={(e) => setName(e.target.value)} placeholder="resumen-diario" />
|
|
273
|
+
</Field>
|
|
274
|
+
<Field label={t("project.routines.kind_field")}>
|
|
275
|
+
<UiSelect value={kind} onChange={(v) => setKind(v as Kind)} options={KIND_OPTIONS} />
|
|
276
|
+
</Field>
|
|
277
|
+
<p className="-mt-1 text-[11px] text-muted-fg">{KIND_META[kind].desc}</p>
|
|
278
|
+
{kind === "exec_agent" && (
|
|
279
|
+
<Field label={t("project.routines.agent_field")} hint={t("project.routines.agent_hint")}>
|
|
280
|
+
<UiSelect value={agent} onChange={setAgent} placeholder={agentsList.isLoading ? t("project.routines.agent_loading") : t("project.routines.agent_pick")}
|
|
281
|
+
options={(agentsList.data || []).map((a) => ({ value: a.slug, label: a.slug, description: [a.role, a.model].filter(Boolean).join(" · ") || undefined }))} />
|
|
282
|
+
</Field>
|
|
283
|
+
)}
|
|
284
|
+
<Field label={t("project.routines.schedule_field")} hint={t("project.routines.schedule_hint")}>
|
|
285
|
+
<div className="space-y-2">
|
|
286
|
+
<div className="flex flex-wrap gap-1">
|
|
287
|
+
{SCHED_PRESETS.map((s) => (
|
|
288
|
+
<button key={s.value} type="button" onClick={() => setSchedule(s.value)}
|
|
289
|
+
className={cn("rounded-md border px-2 py-0.5 text-[11px]", schedule === s.value ? "border-emerald-500/50 text-emerald-400" : "border-border text-muted-fg hover:text-foreground")}>
|
|
290
|
+
{s.label}
|
|
291
|
+
</button>
|
|
292
|
+
))}
|
|
293
|
+
<button type="button" onClick={() => setSchedule("manual")}
|
|
294
|
+
className={cn("rounded-md border px-2 py-0.5 text-[11px]", schedule === "manual" ? "border-emerald-500/50 text-emerald-400" : "border-border text-muted-fg hover:text-foreground")}>
|
|
295
|
+
Manual
|
|
296
|
+
</button>
|
|
297
|
+
</div>
|
|
298
|
+
<Input value={schedule} onChange={(e) => setSchedule(e.target.value)} placeholder="every:10m · cron 0 9 * * 1-5 · once:ISO · manual" />
|
|
299
|
+
</div>
|
|
300
|
+
</Field>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
{/* RIGHT — lo que ejecuta, según el tipo */}
|
|
304
|
+
<div className="space-y-3">
|
|
305
|
+
{/* LLM: pre → prompt → post */}
|
|
306
|
+
{usesPrePost && (
|
|
307
|
+
<Field label={t("project.routines.pre_field")} hint={t("project.routines.pre_hint")}>
|
|
308
|
+
<Textarea rows={2} className="font-mono text-xs" value={pre} onChange={(e) => setPre(e.target.value)} placeholder="curl -s https://wttr.in/Bariloche" />
|
|
309
|
+
</Field>
|
|
310
|
+
)}
|
|
311
|
+
{kind === "exec_agent" && (
|
|
312
|
+
<Field label={t("project.routines.prompt_exec")}><Textarea rows={4} value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder={t("project.routines.prompt_exec_ph")} /></Field>
|
|
313
|
+
)}
|
|
314
|
+
{kind === "super_agent" && (
|
|
315
|
+
<Field label={t("project.routines.prompt_super")}><Textarea rows={4} value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder={t("project.routines.prompt_super_ph")} /></Field>
|
|
316
|
+
)}
|
|
317
|
+
|
|
318
|
+
{/* Telegram: solo manda un mensaje (sin LLM) */}
|
|
319
|
+
{kind === "telegram" && (
|
|
320
|
+
<>
|
|
321
|
+
<div className="grid grid-cols-2 gap-3">
|
|
322
|
+
<Field label={t("project.routines.tg_channel")}><Input value={tgChannel} onChange={(e) => setTgChannel(e.target.value)} placeholder="default" /></Field>
|
|
323
|
+
<Field label={t("project.routines.tg_chat_id")}><Input value={tgChatId} onChange={(e) => setTgChatId(e.target.value)} placeholder="(usa el del canal)" /></Field>
|
|
324
|
+
</div>
|
|
325
|
+
<Field label={t("project.routines.tg_text")} hint={t("project.routines.tg_text_hint")}>
|
|
326
|
+
<Textarea rows={8} value={tgText} onChange={(e) => setTgText(e.target.value)} placeholder="mensaje a enviar" />
|
|
327
|
+
</Field>
|
|
328
|
+
</>
|
|
329
|
+
)}
|
|
330
|
+
|
|
331
|
+
{/* Shell: un comando, ocupando todo */}
|
|
332
|
+
{kind === "shell" && (
|
|
333
|
+
<Field label={t("project.routines.shell_field")} hint={t("project.routines.shell_hint")}>
|
|
334
|
+
<Textarea rows={11} className="font-mono text-xs" value={command} onChange={(e) => setCommand(e.target.value)} placeholder="cd /repo && git pull && npm test" />
|
|
335
|
+
</Field>
|
|
336
|
+
)}
|
|
337
|
+
|
|
338
|
+
{/* Heartbeat: solo loguea */}
|
|
339
|
+
{kind === "heartbeat" && (
|
|
340
|
+
<div className="grid grid-cols-2 gap-3">
|
|
341
|
+
<Field label={t("project.routines.hb_channel")}><Input value={hbChannel} onChange={(e) => setHbChannel(e.target.value)} placeholder="heartbeat" /></Field>
|
|
342
|
+
<Field label={t("project.routines.hb_message")}><Input value={hbMessage} onChange={(e) => setHbMessage(e.target.value)} placeholder="sigo vivo" /></Field>
|
|
343
|
+
</div>
|
|
344
|
+
)}
|
|
345
|
+
|
|
346
|
+
{usesPrePost && (
|
|
347
|
+
<Field label={t("project.routines.post_field")} hint={t("project.routines.post_hint")}>
|
|
348
|
+
<Textarea rows={2} className="font-mono text-xs" value={post} onChange={(e) => setPost(e.target.value)} placeholder={'apx telegram send "$APX_LLM_OUTPUT"'} />
|
|
349
|
+
</Field>
|
|
350
|
+
)}
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
{/* Variables disponibles */}
|
|
355
|
+
<div className="rounded-lg border border-border bg-muted/10 p-3">
|
|
356
|
+
<div className="mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-fg">{t("project.routines.vars_title")}</div>
|
|
357
|
+
<div className="flex flex-wrap gap-1.5">
|
|
358
|
+
{VARS.map((v) => (
|
|
359
|
+
<span key={v.v} title={v.desc} className="inline-flex items-center gap-1 rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[10px]">
|
|
360
|
+
{v.v}<span className="not-italic text-muted-fg">· {v.where}</span>
|
|
361
|
+
</span>
|
|
362
|
+
))}
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
{/* Qué va a pasar — full width */}
|
|
367
|
+
<div className="rounded-lg border border-border bg-muted/20 p-3">
|
|
368
|
+
<div className="mb-2 text-xs font-semibold text-muted-fg">{t("project.routines.what_happens")} <span className="font-normal text-muted-fg">· ⏱ {scheduleHuman(schedule)}</span></div>
|
|
369
|
+
<div className="flex flex-wrap items-stretch gap-2">
|
|
370
|
+
{steps.map((s, i) => (
|
|
371
|
+
<div key={s.id} className="flex items-stretch gap-2">
|
|
372
|
+
<div className={cn("flex max-w-[240px] flex-col gap-1 rounded-lg border px-2.5 py-2", s.action ? "border-emerald-500/40 bg-emerald-500/5" : "border-border bg-card")}>
|
|
373
|
+
<div className={cn("flex items-center gap-1.5 text-[11px] font-medium", s.action ? "text-emerald-400" : "text-muted-fg")}>
|
|
374
|
+
<s.icon size={12} /> {s.label}
|
|
375
|
+
</div>
|
|
376
|
+
{s.detail && <div className="line-clamp-2 font-mono text-[10px] text-muted-fg">{s.detail}</div>}
|
|
377
|
+
</div>
|
|
378
|
+
{i < steps.length - 1 && <ArrowRight size={14} className="shrink-0 self-center text-muted-fg" />}
|
|
379
|
+
</div>
|
|
380
|
+
))}
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
</Dialog>
|
|
385
|
+
);
|
|
386
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import useSWR from "swr";
|
|
3
|
+
import { Check, Plus, RotateCcw, Trash2 } from "lucide-react";
|
|
4
|
+
import { Tasks } from "../../lib/api";
|
|
5
|
+
import { Section } from "../../components/Section";
|
|
6
|
+
import { Badge, Button, Empty, Field, Input, Loading } from "../../components/ui";
|
|
7
|
+
import { useToast } from "../../components/Toast";
|
|
8
|
+
import { t } from "../../i18n";
|
|
9
|
+
|
|
10
|
+
export function TasksTab({ pid }: { pid: string }) {
|
|
11
|
+
const [state, setState] = useState<"open" | "done" | "dropped">("open");
|
|
12
|
+
const toast = useToast();
|
|
13
|
+
// dedupingInterval:0 so switching the state filter always revalidates the
|
|
14
|
+
// target list instead of showing the stale cached page from a prior switch.
|
|
15
|
+
const list = useSWR(
|
|
16
|
+
`/projects/${pid}/tasks?state=${state}`,
|
|
17
|
+
() => Tasks.list(pid, state),
|
|
18
|
+
{ dedupingInterval: 0, revalidateOnFocus: true },
|
|
19
|
+
);
|
|
20
|
+
const [draft, setDraft] = useState("");
|
|
21
|
+
const [busy, setBusy] = useState(false);
|
|
22
|
+
|
|
23
|
+
const add = async () => {
|
|
24
|
+
if (!draft.trim()) return;
|
|
25
|
+
setBusy(true);
|
|
26
|
+
try {
|
|
27
|
+
await Tasks.add(pid, { title: draft.trim() });
|
|
28
|
+
setDraft("");
|
|
29
|
+
toast.success(t("project.tasks.created"));
|
|
30
|
+
list.mutate();
|
|
31
|
+
} catch (e: any) {
|
|
32
|
+
toast.error(e?.message || t("project.tasks.create_error"));
|
|
33
|
+
} finally {
|
|
34
|
+
setBusy(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const mark = async (fn: () => Promise<unknown>, label: string) => {
|
|
38
|
+
try { await fn(); toast.success(label); list.mutate(); }
|
|
39
|
+
catch (e: any) { toast.error(e?.message || t("common.error_generic")); }
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Section
|
|
44
|
+
title={t("project.tasks.title")}
|
|
45
|
+
description={t("project.tasks.subtitle")}
|
|
46
|
+
action={
|
|
47
|
+
<div className="flex gap-1">
|
|
48
|
+
{(["open", "done", "dropped"] as const).map((s) => (
|
|
49
|
+
<Button key={s} size="sm" data-testid={`task-filter-${s}`} variant={state === s ? "primary" : "ghost"} onClick={() => setState(s)}>
|
|
50
|
+
{s}
|
|
51
|
+
</Button>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
}
|
|
55
|
+
>
|
|
56
|
+
<div className="mb-4 flex items-end gap-2">
|
|
57
|
+
<Field label={t("project.tasks.add_label")}>
|
|
58
|
+
<Input
|
|
59
|
+
data-testid="task-input"
|
|
60
|
+
placeholder={t("project.tasks.add_placeholder")}
|
|
61
|
+
value={draft}
|
|
62
|
+
onChange={(e) => setDraft(e.target.value)}
|
|
63
|
+
onKeyDown={(e) => { if (e.key === "Enter") add(); }}
|
|
64
|
+
/>
|
|
65
|
+
</Field>
|
|
66
|
+
<Button variant="primary" data-testid="task-add" onClick={add} loading={busy}>
|
|
67
|
+
<Plus size={14} /> {t("project.tasks.add")}
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
{list.isLoading && <Loading />}
|
|
72
|
+
{!list.isLoading && (list.data?.length ?? 0) === 0 && (
|
|
73
|
+
<Empty>
|
|
74
|
+
{state === "open"
|
|
75
|
+
? t("project.tasks.empty_open")
|
|
76
|
+
: t("project.tasks.empty", { state })}
|
|
77
|
+
{" "}<code>apx task add "…"</code>
|
|
78
|
+
</Empty>
|
|
79
|
+
)}
|
|
80
|
+
|
|
81
|
+
<ul className="space-y-2 text-sm" data-testid="task-list">
|
|
82
|
+
{(list.data || []).map((task) => (
|
|
83
|
+
<li key={task.id} data-testid={`task-${task.id}`} className="flex items-start gap-3 rounded-md border border-border bg-muted/30 px-3 py-2">
|
|
84
|
+
<span className="mt-0.5 font-mono text-[10px] text-muted-fg">{task.id}</span>
|
|
85
|
+
<div className="flex-1">
|
|
86
|
+
<div className="font-medium">{task.title}</div>
|
|
87
|
+
<div className="mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-fg">
|
|
88
|
+
{task.tags?.map((tag) => <Badge key={tag}>#{tag}</Badge>)}
|
|
89
|
+
{task.agent && <Badge tone="info">@{task.agent}</Badge>}
|
|
90
|
+
{task.source && <span>{t("project.tasks.via")} {task.source}</span>}
|
|
91
|
+
{task.due && <span>{t("project.tasks.due")} {task.due}</span>}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div className="flex gap-1">
|
|
95
|
+
{state === "open" && (
|
|
96
|
+
<>
|
|
97
|
+
<Button size="sm" variant="secondary" aria-label={t("project.tasks.aria_done")} data-testid={`task-done-${task.id}`} onClick={() => mark(() => Tasks.done(pid, task.id), t("project.tasks.done"))}>
|
|
98
|
+
<Check size={13} />
|
|
99
|
+
</Button>
|
|
100
|
+
<Button size="sm" variant="destructive" aria-label={t("project.tasks.aria_drop")} data-testid={`task-drop-${task.id}`} onClick={() => mark(() => Tasks.drop(pid, task.id), t("project.tasks.drop"))}>
|
|
101
|
+
<Trash2 size={13} />
|
|
102
|
+
</Button>
|
|
103
|
+
</>
|
|
104
|
+
)}
|
|
105
|
+
{state !== "open" && (
|
|
106
|
+
<Button size="sm" variant="ghost" aria-label={t("project.tasks.aria_reopen")} data-testid={`task-reopen-${task.id}`} onClick={() => mark(() => Tasks.reopen(pid, task.id), t("project.tasks.reopen"))}>
|
|
107
|
+
<RotateCcw size={13} />
|
|
108
|
+
</Button>
|
|
109
|
+
)}
|
|
110
|
+
</div>
|
|
111
|
+
</li>
|
|
112
|
+
))}
|
|
113
|
+
</ul>
|
|
114
|
+
</Section>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { Section } from "../../components/Section";
|
|
3
|
+
import { Badge, Button, Empty, Field, Input, Loading, Switch } from "../../components/ui";
|
|
4
|
+
import { useToast } from "../../components/Toast";
|
|
5
|
+
import { useTelegramChannels } from "../../hooks/useTelegram";
|
|
6
|
+
import { Telegram } from "../../lib/api";
|
|
7
|
+
import { useProject } from "../../hooks/useProjects";
|
|
8
|
+
import { t } from "../../i18n";
|
|
9
|
+
import { secretHint } from "../../lib/secrets";
|
|
10
|
+
import type { TelegramChannel } from "../../types/daemon";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Per-project Telegram override. The daemon's channel registry already
|
|
14
|
+
* supports pinning a channel to a project via the `project` field; we just
|
|
15
|
+
* surface the slot here. If the project has no pinned channel, all messages
|
|
16
|
+
* sent from this project fall back to the global default.
|
|
17
|
+
*/
|
|
18
|
+
export function TelegramTab({ pid }: { pid: string }) {
|
|
19
|
+
const toast = useToast();
|
|
20
|
+
const { project } = useProject(pid);
|
|
21
|
+
const { channels, isLoading, mutate } = useTelegramChannels();
|
|
22
|
+
|
|
23
|
+
// Channel that has this project pinned.
|
|
24
|
+
const projectRef = String(pid);
|
|
25
|
+
const projectName = project?.name || project?.path?.split("/").pop() || projectRef;
|
|
26
|
+
const channelName = `proj-${projectRef}`;
|
|
27
|
+
const existing = channels.find(
|
|
28
|
+
(c) => c.project === projectRef || c.project === projectName || c.name === channelName,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const [enabled, setEnabled] = useState(!!existing);
|
|
32
|
+
const [botToken, setBotToken] = useState("");
|
|
33
|
+
const [chatId, setChatId] = useState("");
|
|
34
|
+
const [routeAgent, setRouteAgent] = useState("");
|
|
35
|
+
const [respondWithEngine, setRespondWithEngine] = useState(true);
|
|
36
|
+
const [busy, setBusy] = useState(false);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (existing) {
|
|
40
|
+
setEnabled(true);
|
|
41
|
+
setBotToken("");
|
|
42
|
+
setChatId(existing.chat_id || "");
|
|
43
|
+
setRouteAgent(existing.route_to_agent || "");
|
|
44
|
+
setRespondWithEngine(existing.respond_with_engine ?? true);
|
|
45
|
+
} else {
|
|
46
|
+
setEnabled(false);
|
|
47
|
+
setBotToken(""); setChatId(""); setRouteAgent(""); setRespondWithEngine(true);
|
|
48
|
+
}
|
|
49
|
+
}, [existing?.name, existing?.chat_id, existing?.route_to_agent]);
|
|
50
|
+
|
|
51
|
+
if (isLoading) return <Loading />;
|
|
52
|
+
|
|
53
|
+
const save = async () => {
|
|
54
|
+
setBusy(true);
|
|
55
|
+
try {
|
|
56
|
+
if (!enabled) {
|
|
57
|
+
if (existing) {
|
|
58
|
+
await Telegram.channels.remove(existing.name);
|
|
59
|
+
toast.success(t("project.telegram.cleared"));
|
|
60
|
+
}
|
|
61
|
+
await mutate();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const body: TelegramChannel = {
|
|
65
|
+
name: existing?.name || channelName,
|
|
66
|
+
project: projectRef,
|
|
67
|
+
chat_id: chatId,
|
|
68
|
+
route_to_agent: routeAgent,
|
|
69
|
+
respond_with_engine: respondWithEngine,
|
|
70
|
+
// Only set bot_token if the user typed one. Empty = keep existing.
|
|
71
|
+
...(botToken ? { bot_token: botToken } : {}),
|
|
72
|
+
};
|
|
73
|
+
if (existing) {
|
|
74
|
+
await Telegram.channels.patch(existing.name, body);
|
|
75
|
+
} else {
|
|
76
|
+
await Telegram.channels.upsert(body);
|
|
77
|
+
}
|
|
78
|
+
toast.success(t("project.telegram.saved"));
|
|
79
|
+
await mutate();
|
|
80
|
+
setBotToken("");
|
|
81
|
+
} catch (e) {
|
|
82
|
+
toast.error((e as Error).message);
|
|
83
|
+
} finally { setBusy(false); }
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<Section title={t("project.telegram.title")} description={t("project.telegram.subtitle")}>
|
|
88
|
+
<div className="space-y-3">
|
|
89
|
+
<div className="flex items-center gap-3">
|
|
90
|
+
<Switch
|
|
91
|
+
checked={enabled}
|
|
92
|
+
onChange={setEnabled}
|
|
93
|
+
label={enabled ? t("project.telegram.override_active") : t("project.telegram.use_default")}
|
|
94
|
+
/>
|
|
95
|
+
{existing && <Badge tone="success">{t("project.telegram.channel_badge", { name: existing.name })}</Badge>}
|
|
96
|
+
</div>
|
|
97
|
+
{enabled && (
|
|
98
|
+
<>
|
|
99
|
+
<div className="grid grid-cols-2 gap-3">
|
|
100
|
+
<Field label={t("project.telegram.bot_token")} hint={existing?.bot_token ? `${secretHint(existing.bot_token)} — vacío = mantener` : t("project.telegram.bot_hint_none")}>
|
|
101
|
+
<Input type="password" value={botToken} onChange={(e) => setBotToken(e.target.value)} placeholder={existing?.bot_token ? secretHint(existing.bot_token) : ""} />
|
|
102
|
+
</Field>
|
|
103
|
+
<Field label={t("project.telegram.chat_id")}>
|
|
104
|
+
<Input value={chatId} onChange={(e) => setChatId(e.target.value)} />
|
|
105
|
+
</Field>
|
|
106
|
+
<Field label={t("project.telegram.route_agent")} hint={t("project.telegram.route_hint")}>
|
|
107
|
+
<Input value={routeAgent} onChange={(e) => setRouteAgent(e.target.value)} />
|
|
108
|
+
</Field>
|
|
109
|
+
</div>
|
|
110
|
+
<Switch
|
|
111
|
+
checked={respondWithEngine}
|
|
112
|
+
onChange={setRespondWithEngine}
|
|
113
|
+
label={t("project.telegram.respond_engine")}
|
|
114
|
+
/>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
<div className="pt-2">
|
|
118
|
+
<Button variant="primary" loading={busy} onClick={save}>{t("common.save")}</Button>
|
|
119
|
+
</div>
|
|
120
|
+
{!enabled && !existing && (
|
|
121
|
+
<Empty>{t("project.telegram.no_override")}</Empty>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
</Section>
|
|
125
|
+
);
|
|
126
|
+
}
|