@agentprojectcontext/apx 1.77.3 → 1.79.0
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/README.md +23 -9
- package/package.json +12 -12
- package/src/core/agent/build-agent-system.js +3 -2
- package/src/core/agent/constants.js +3 -2
- package/src/core/agent/loop/greeting-guard.js +55 -0
- package/src/core/agent/loop/side-effects.js +52 -0
- package/src/core/agent/prompt-builder.js +49 -8
- package/src/core/agent/run-agent.js +43 -53
- package/src/core/agent/security.js +1 -1
- package/src/core/agent/self-memory.js +4 -2
- package/src/core/agent/skills/index-store.js +2 -2
- package/src/core/agent/skills/loader.js +3 -22
- package/src/core/agent/super-agent.js +0 -2
- package/src/core/agent/tool-summary.js +65 -0
- package/src/core/agent/tools/handlers/call-runtime.js +4 -4
- package/src/core/agent/tools/handlers/list-commitments.js +80 -0
- package/src/core/agent/tools/handlers/list-tasks.js +66 -27
- package/src/core/agent/tools/handlers/record-commitment.js +68 -0
- package/src/core/agent/tools/handlers/search-sessions.js +1 -1
- package/src/core/agent/tools/handlers/send-telegram.js +68 -2
- package/src/core/agent/tools/handlers/set-permission-mode.js +11 -4
- package/src/core/agent/tools/names.js +64 -0
- package/src/core/agent/tools/registry.js +9 -0
- package/src/core/agent/tools/tool-call-parser.js +70 -1
- package/src/core/apc/context-copy.js +1 -1
- package/src/core/apc/frontmatter.js +85 -0
- package/src/core/apc/parser.js +9 -21
- package/src/core/apc/paths.js +8 -8
- package/src/core/apc/scaffold.js +5 -4
- package/src/core/channels/telegram/ask-callbacks.js +35 -0
- package/src/core/channels/telegram/config.js +201 -0
- package/src/core/channels/telegram/dispatch.js +3 -0
- package/src/core/channels/telegram/reply.js +30 -5
- package/src/core/config/index.js +25 -183
- package/src/core/config/paths.js +57 -1
- package/src/core/config/redact.js +22 -0
- package/src/core/confirmation/adapters/web.js +1 -1
- package/src/core/daemon/service.js +238 -0
- package/src/core/deck/manifest.js +12 -12
- package/src/core/desktop/autostart.js +3 -2
- package/src/core/desktop/process.js +4 -4
- package/src/core/engines/gemini.js +322 -60
- package/src/core/engines/openai-compatible.js +21 -2
- package/src/core/engines/presets.js +2 -2
- package/src/core/http-tools/browser.js +1 -1
- package/src/core/http-tools/catalog.js +551 -0
- package/src/core/http-tools/fetch.js +1 -1
- package/src/core/http-tools/glob.js +3 -3
- package/src/core/http-tools/grep.js +2 -9
- package/src/core/http-tools/inline-handlers.js +59 -0
- package/src/core/http-tools/registry.js +31 -615
- package/src/core/http-tools/search.js +2 -2
- package/src/core/identity/self.js +6 -7
- package/src/core/identity/telegram.js +3 -3
- package/src/core/logging.js +6 -5
- package/src/core/mcp/sources.js +12 -16
- package/src/core/memory/consolidate.js +225 -0
- package/src/core/memory/indexer.js +2 -5
- package/src/core/nudge/index.js +192 -0
- package/src/core/nudge/policy.js +143 -0
- package/src/core/nudge/store.js +141 -0
- package/src/core/profiles/bundled/secretary/PROFILE.md +8 -9
- package/src/core/profiles/bundled/secretary/config.schema.json +33 -3
- package/src/core/profiles/bundled/secretary/routines/day-close.json +7 -3
- package/src/core/profiles/bundled/secretary/routines/day-open.json +7 -3
- package/src/core/profiles/bundled/secretary/routines/watch.json +13 -0
- package/src/core/profiles/lifecycle.js +0 -2
- package/src/core/profiles/store.js +2 -7
- package/src/core/routines/runner.js +103 -4
- package/src/core/routines/signals.js +270 -0
- package/src/core/runtime-skills/apx-agency-agents/SKILL.md +2 -2
- package/src/core/runtime-skills/apx-profile/SKILL.md +3 -3
- package/src/core/runtime-skills/apx-project/SKILL.md +1 -1
- package/src/core/runtime-skills/apx-task/SKILL.md +8 -8
- package/src/core/runtime-skills/apx-telegram/SKILL.md +4 -4
- package/src/core/runtime-skills/apx-voice/SKILL.md +4 -4
- package/src/core/runtimes/detect.js +2 -2
- package/src/core/sessions/index.js +800 -0
- package/src/core/stores/code-sessions.js +3 -14
- package/src/core/stores/commitments.js +331 -0
- package/src/core/stores/engine-sessions.js +0 -4
- package/src/core/stores/messages.js +4 -5
- package/src/core/stores/organization.js +9 -11
- package/src/core/stores/routines.js +23 -14
- package/src/core/stores/runtime-callbacks.js +2 -1
- package/src/core/util/json-file.js +128 -0
- package/src/core/util/thinking.js +51 -0
- package/src/core/vars/sources.js +14 -21
- package/src/core/voice/stt-models.js +1 -1
- package/src/core/voice/tts.js +5 -4
- package/src/host/daemon/api/admin-config.js +5 -5
- package/src/host/daemon/api/admin.js +8 -7
- package/src/host/daemon/api/agents.js +16 -16
- package/src/host/daemon/api/artifact-preview.js +8 -8
- package/src/host/daemon/api/artifacts.js +7 -7
- package/src/host/daemon/api/code.js +8 -8
- package/src/host/daemon/api/commitments.js +135 -0
- package/src/host/daemon/api/config.js +6 -6
- package/src/host/daemon/api/confirm.js +2 -2
- package/src/host/daemon/api/connections.js +2 -2
- package/src/host/daemon/api/conversations.js +12 -12
- package/src/host/daemon/api/deck.js +6 -6
- package/src/host/daemon/api/desktop.js +8 -8
- package/src/host/daemon/api/embeddings.js +4 -4
- package/src/host/daemon/api/engines.js +8 -7
- package/src/host/daemon/api/exec.js +5 -4
- package/src/host/daemon/api/files-project.js +6 -6
- package/src/host/daemon/api/health.js +2 -2
- package/src/host/daemon/api/identity.js +3 -3
- package/src/host/daemon/api/inbox.js +2 -2
- package/src/host/daemon/api/integrations.js +23 -19
- package/src/host/daemon/api/mcps.js +16 -12
- package/src/host/daemon/api/messages.js +5 -5
- package/src/host/daemon/api/nudges.js +112 -0
- package/src/host/daemon/api/organization.js +8 -8
- package/src/host/daemon/api/pairing.js +6 -6
- package/src/host/daemon/api/plugins.js +3 -3
- package/src/host/daemon/api/prefix.js +20 -0
- package/src/host/daemon/api/profiles.js +9 -9
- package/src/host/daemon/api/projects.js +5 -5
- package/src/host/daemon/api/routines.js +32 -8
- package/src/host/daemon/api/run.js +2 -2
- package/src/host/daemon/api/runtimes.js +6 -6
- package/src/host/daemon/api/self-memory.js +50 -0
- package/src/host/daemon/api/sessions-search.js +18 -11
- package/src/host/daemon/api/sessions.js +6 -6
- package/src/host/daemon/api/shared.js +59 -13
- package/src/host/daemon/api/skills.js +12 -12
- package/src/host/daemon/api/super-agent.js +4 -4
- package/src/host/daemon/api/tasks.js +11 -11
- package/src/host/daemon/api/telegram.js +61 -24
- package/src/host/daemon/api/tools.js +7 -7
- package/src/host/daemon/api/top-level.js +7 -7
- package/src/host/daemon/api/transcribe.js +6 -6
- package/src/host/daemon/api/tts.js +3 -3
- package/src/host/daemon/api/vars.js +11 -8
- package/src/host/daemon/api/voice.js +9 -7
- package/src/host/daemon/api/web.js +28 -32
- package/src/host/daemon/api.js +83 -48
- package/src/host/daemon/callback-reconciler.js +16 -0
- package/src/host/daemon/db.js +1 -1
- package/src/host/daemon/desktop-ws.js +7 -3
- package/src/host/daemon/index.js +11 -5
- package/src/host/daemon/plugins/desktop/index.js +8 -2
- package/src/host/daemon/plugins/telegram/index.js +7 -2
- package/src/host/daemon/stt-venv.js +20 -81
- package/src/host/daemon/wakeup.js +18 -4
- package/src/interfaces/acp/index.js +3 -3
- package/src/interfaces/acp/session.js +2 -2
- package/src/interfaces/cli/commands/a2a.js +2 -2
- package/src/interfaces/cli/commands/agent.js +3 -3
- package/src/interfaces/cli/commands/artifact.js +13 -13
- package/src/interfaces/cli/commands/chat.js +3 -3
- package/src/interfaces/cli/commands/command.js +2 -2
- package/src/interfaces/cli/commands/commitment.js +154 -0
- package/src/interfaces/cli/commands/config.js +4 -4
- package/src/interfaces/cli/commands/daemon.js +74 -18
- package/src/interfaces/cli/commands/desktop.js +7 -14
- package/src/interfaces/cli/commands/exec.js +2 -2
- package/src/interfaces/cli/commands/log.js +3 -4
- package/src/interfaces/cli/commands/mcp.js +9 -9
- package/src/interfaces/cli/commands/memory.js +75 -2
- package/src/interfaces/cli/commands/messages.js +5 -5
- package/src/interfaces/cli/commands/model.js +0 -18
- package/src/interfaces/cli/commands/nudge.js +130 -0
- package/src/interfaces/cli/commands/obsidian.js +5 -5
- package/src/interfaces/cli/commands/org.js +5 -5
- package/src/interfaces/cli/commands/pair.js +6 -6
- package/src/interfaces/cli/commands/plugins.js +2 -2
- package/src/interfaces/cli/commands/profile.js +10 -10
- package/src/interfaces/cli/commands/project-config.js +6 -6
- package/src/interfaces/cli/commands/project.js +10 -10
- package/src/interfaces/cli/commands/routine.js +8 -9
- package/src/interfaces/cli/commands/runtime.js +2 -2
- package/src/interfaces/cli/commands/search.js +0 -1
- package/src/interfaces/cli/commands/session.js +12 -40
- package/src/interfaces/cli/commands/sessions.js +21 -798
- package/src/interfaces/cli/commands/setup.js +16 -6
- package/src/interfaces/cli/commands/skills.js +1 -2
- package/src/interfaces/cli/commands/status.js +3 -3
- package/src/interfaces/cli/commands/task.js +8 -8
- package/src/interfaces/cli/commands/telegram.js +21 -21
- package/src/interfaces/cli/commands/voice.js +6 -6
- package/src/interfaces/cli/help/index.js +2245 -0
- package/src/interfaces/cli/http.js +9 -4
- package/src/interfaces/cli/index.js +14 -2857
- package/src/interfaces/cli/routes/acp.js +13 -0
- package/src/interfaces/cli/routes/agent.js +27 -0
- package/src/interfaces/cli/routes/artifact.js +28 -0
- package/src/interfaces/cli/routes/chat.js +11 -0
- package/src/interfaces/cli/routes/code.js +11 -0
- package/src/interfaces/cli/routes/command.js +21 -0
- package/src/interfaces/cli/routes/commitment.js +19 -0
- package/src/interfaces/cli/routes/config.js +16 -0
- package/src/interfaces/cli/routes/connections.js +11 -0
- package/src/interfaces/cli/routes/conversations.js +21 -0
- package/src/interfaces/cli/routes/daemon.js +25 -0
- package/src/interfaces/cli/routes/desktop.js +20 -0
- package/src/interfaces/cli/routes/env.js +13 -0
- package/src/interfaces/cli/routes/exec.js +11 -0
- package/src/interfaces/cli/routes/identity.js +11 -0
- package/src/interfaces/cli/routes/index.js +75 -0
- package/src/interfaces/cli/routes/init.js +11 -0
- package/src/interfaces/cli/routes/log.js +20 -0
- package/src/interfaces/cli/routes/mcp.js +22 -0
- package/src/interfaces/cli/routes/memory.js +19 -0
- package/src/interfaces/cli/routes/messages.js +16 -0
- package/src/interfaces/cli/routes/model.js +11 -0
- package/src/interfaces/cli/routes/nudge.js +17 -0
- package/src/interfaces/cli/routes/obsidian.js +17 -0
- package/src/interfaces/cli/routes/org.js +34 -0
- package/src/interfaces/cli/routes/overlay.js +10 -0
- package/src/interfaces/cli/routes/pair.js +17 -0
- package/src/interfaces/cli/routes/panel.js +16 -0
- package/src/interfaces/cli/routes/permission.js +11 -0
- package/src/interfaces/cli/routes/plugins.js +21 -0
- package/src/interfaces/cli/routes/profile.js +27 -0
- package/src/interfaces/cli/routes/project.js +41 -0
- package/src/interfaces/cli/routes/restart.js +15 -0
- package/src/interfaces/cli/routes/routine.js +28 -0
- package/src/interfaces/cli/routes/run.js +11 -0
- package/src/interfaces/cli/routes/search.js +11 -0
- package/src/interfaces/cli/routes/send.js +11 -0
- package/src/interfaces/cli/routes/session.js +26 -0
- package/src/interfaces/cli/routes/sessions.js +15 -0
- package/src/interfaces/cli/routes/setup.js +18 -0
- package/src/interfaces/cli/routes/skills.js +20 -0
- package/src/interfaces/cli/routes/status.js +12 -0
- package/src/interfaces/cli/routes/task.js +26 -0
- package/src/interfaces/cli/routes/telegram.js +39 -0
- package/src/interfaces/cli/routes/update.js +24 -0
- package/src/interfaces/cli/routes/voice.js +17 -0
- package/src/interfaces/desktop/main.js +6 -7
- package/src/interfaces/desktop/renderer.js +0 -5
- package/src/interfaces/mcp-server/index.js +15 -14
- package/src/interfaces/tui/_shims/globals.d.ts +8 -0
- package/src/interfaces/tui/tsconfig.json +4 -1
- package/src/interfaces/web/README.md +6 -6
- package/src/interfaces/web/dist/assets/index-CvEoGtTf.js +849 -0
- package/src/interfaces/web/dist/assets/index-CvEoGtTf.js.map +1 -0
- package/src/interfaces/web/dist/assets/index-DzBBXFaO.css +1 -0
- package/src/interfaces/web/dist/index.html +2 -2
- package/src/interfaces/web/package-lock.json +11 -10
- package/src/interfaces/web/src/components/AddProjectDialog.tsx +1 -1
- package/src/interfaces/web/src/components/Section.tsx +18 -3
- package/src/interfaces/web/src/components/agents/AgentFormFields.tsx +1 -1
- package/src/interfaces/web/src/components/chat/ChatList.tsx +2 -2
- package/src/interfaces/web/src/components/chat/MessageBubble.tsx +13 -0
- package/src/interfaces/web/src/components/chat/SkillPicker.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeFileTree.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeTerminal.tsx +1 -1
- package/src/interfaces/web/src/components/cron/CronPicker.tsx +196 -0
- package/src/interfaces/web/src/components/desktop/DesktopStatusCard.tsx +1 -1
- package/src/interfaces/web/src/components/files/FileBrowser.tsx +2 -2
- package/src/interfaces/web/src/components/inbox/InboxList.tsx +145 -0
- package/src/interfaces/web/src/components/memory/MemoryBrowser.tsx +36 -6
- package/src/interfaces/web/src/components/routines/ExecutionsList.tsx +1 -1
- package/src/interfaces/web/src/components/routines/RoutineDetail.tsx +16 -4
- package/src/interfaces/web/src/components/routines/RoutineEditor.tsx +14 -4
- package/src/interfaces/web/src/components/routines/shared.ts +14 -5
- package/src/interfaces/web/src/components/settings/DesktopSettingsPanel.tsx +1 -1
- package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +1 -1
- package/src/interfaces/web/src/components/settings/NudgePanel.tsx +183 -0
- package/src/interfaces/web/src/components/settings/ProfilePanel.tsx +36 -12
- package/src/interfaces/web/src/components/settings/SkillsInspectorPanel.tsx +1 -1
- package/src/interfaces/web/src/components/settings/SkillsManager.tsx +2 -2
- package/src/interfaces/web/src/components/tasks/TaskDetailPanel.tsx +1 -1
- package/src/interfaces/web/src/components/ui/filter-chips.tsx +47 -0
- package/src/interfaces/web/src/components/ui.tsx +1 -0
- package/src/interfaces/web/src/constants/index.ts +1 -0
- package/src/interfaces/web/src/hooks/useChat.ts +5 -1
- package/src/interfaces/web/src/hooks/useDaemonStatus.ts +1 -1
- package/src/interfaces/web/src/hooks/useDevices.ts +1 -1
- package/src/interfaces/web/src/hooks/useEngines.ts +1 -1
- package/src/interfaces/web/src/hooks/useGlobalConfig.ts +2 -2
- package/src/interfaces/web/src/hooks/useIdentity.ts +1 -1
- package/src/interfaces/web/src/hooks/useInbox.ts +1 -1
- package/src/interfaces/web/src/hooks/useNudges.ts +38 -0
- package/src/interfaces/web/src/hooks/useProfiles.ts +3 -3
- package/src/interfaces/web/src/hooks/useProjects.ts +1 -1
- package/src/interfaces/web/src/hooks/useTelegram.ts +3 -3
- package/src/interfaces/web/src/hooks/useTokenBootstrap.ts +3 -3
- package/src/interfaces/web/src/i18n/en.ts +127 -0
- package/src/interfaces/web/src/i18n/es.ts +127 -0
- package/src/interfaces/web/src/lib/api/admin.ts +11 -11
- package/src/interfaces/web/src/lib/api/agents.ts +14 -14
- package/src/interfaces/web/src/lib/api/artifacts.ts +11 -11
- package/src/interfaces/web/src/lib/api/code.ts +1 -1
- package/src/interfaces/web/src/lib/api/commitments.ts +57 -0
- package/src/interfaces/web/src/lib/api/conversations.ts +8 -8
- package/src/interfaces/web/src/lib/api/deck.ts +3 -3
- package/src/interfaces/web/src/lib/api/desktop.ts +8 -8
- package/src/interfaces/web/src/lib/api/embeddings.ts +3 -3
- package/src/interfaces/web/src/lib/api/engines.ts +3 -3
- package/src/interfaces/web/src/lib/api/filesystem.ts +2 -2
- package/src/interfaces/web/src/lib/api/health.ts +1 -1
- package/src/interfaces/web/src/lib/api/identity.ts +2 -2
- package/src/interfaces/web/src/lib/api/inbox.ts +1 -1
- package/src/interfaces/web/src/lib/api/integrations.ts +8 -8
- package/src/interfaces/web/src/lib/api/mcps.ts +6 -6
- package/src/interfaces/web/src/lib/api/messages.ts +3 -3
- package/src/interfaces/web/src/lib/api/notebook.ts +23 -0
- package/src/interfaces/web/src/lib/api/nudges.ts +53 -0
- package/src/interfaces/web/src/lib/api/organization.ts +7 -7
- package/src/interfaces/web/src/lib/api/profiles.ts +8 -8
- package/src/interfaces/web/src/lib/api/projectFiles.ts +5 -5
- package/src/interfaces/web/src/lib/api/projects.ts +12 -12
- package/src/interfaces/web/src/lib/api/routines.ts +7 -7
- package/src/interfaces/web/src/lib/api/sessions.ts +2 -2
- package/src/interfaces/web/src/lib/api/skills.ts +11 -11
- package/src/interfaces/web/src/lib/api/super_agent.ts +3 -3
- package/src/interfaces/web/src/lib/api/tasks.ts +12 -12
- package/src/interfaces/web/src/lib/api/telegram.ts +14 -14
- package/src/interfaces/web/src/lib/api/tools.ts +1 -1
- package/src/interfaces/web/src/lib/api/vars.ts +4 -4
- package/src/interfaces/web/src/lib/api/voice.ts +6 -6
- package/src/interfaces/web/src/lib/cron.ts +196 -0
- package/src/interfaces/web/src/lib/when.ts +32 -0
- package/src/interfaces/web/src/screens/InboxScreen.tsx +107 -77
- package/src/interfaces/web/src/screens/ProjectScreen.tsx +5 -2
- package/src/interfaces/web/src/screens/SettingsScreen.tsx +17 -3
- package/src/interfaces/web/src/screens/base/AgentDefaultsTab.tsx +1 -1
- package/src/interfaces/web/src/screens/base/CommitmentsTab.tsx +239 -0
- package/src/interfaces/web/src/screens/base/GlobalTasksTab.tsx +103 -20
- package/src/interfaces/web/src/screens/base/LogsTab.tsx +18 -3
- package/src/interfaces/web/src/screens/base/SessionsTab.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +8 -8
- package/src/interfaces/web/src/screens/project/AgentsTab.tsx +2 -2
- package/src/interfaces/web/src/screens/project/ChatTab.tsx +24 -6
- package/src/interfaces/web/src/screens/project/ConfigTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/McpsTab.tsx +3 -3
- package/src/interfaces/web/src/screens/project/Overview.tsx +6 -6
- package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +15 -13
- package/src/interfaces/web/src/screens/project/StructureTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/TasksTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/VarsTab.tsx +1 -1
- package/src/interfaces/web/src/types/daemon.ts +10 -1
- package/src/interfaces/web/vite.config.ts +13 -18
- package/src/interfaces/web/dist/assets/index-BptlbKjU.js +0 -824
- package/src/interfaces/web/dist/assets/index-BptlbKjU.js.map +0 -1
- package/src/interfaces/web/dist/assets/index-D_EJEA1n.css +0 -1
- package/src/skills/apc-context/SKILL.md +0 -159
- /package/src/{host/daemon → core}/runtimes/_spawn.js +0 -0
- /package/src/{host/daemon → core}/runtimes/aider.js +0 -0
- /package/src/{host/daemon → core}/runtimes/antigravity.js +0 -0
- /package/src/{host/daemon → core}/runtimes/claude-code.js +0 -0
- /package/src/{host/daemon → core}/runtimes/codex.js +0 -0
- /package/src/{host/daemon → core}/runtimes/cursor-agent.js +0 -0
- /package/src/{host/daemon → core}/runtimes/gemini-cli.js +0 -0
- /package/src/{host/daemon → core}/runtimes/index.js +0 -0
- /package/src/{host/daemon → core}/runtimes/opencode.js +0 -0
- /package/src/{host/daemon → core}/runtimes/qwen-code.js +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// apx acp — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdAcp } from "../commands/acp.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
// ACP server owns stdio until the client closes the pipe.
|
|
11
|
+
await cmdAcp(parseArgs(rest));
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// apx agent — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdAgentAdd, cmdAgentGet, cmdAgentImport, cmdAgentList, cmdAgentRemove, cmdAgentVaultAdd, cmdAgentVaultList, cmdAgentVaultRestore, cmdAgentVaultRm } from "../commands/agent.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (sub === "add") await cmdAgentAdd(a);
|
|
13
|
+
else if (sub === "list" || sub === "ls") cmdAgentList();
|
|
14
|
+
else if (sub === "get" || sub === "show") cmdAgentGet(a);
|
|
15
|
+
else if (sub === "remove" || sub === "rm" || sub === "delete") await cmdAgentRemove(a);
|
|
16
|
+
else if (sub === "import") await cmdAgentImport(a);
|
|
17
|
+
else if (sub === "vault") {
|
|
18
|
+
const vsub = a._[0];
|
|
19
|
+
const va = { ...a, _: a._.slice(1) };
|
|
20
|
+
if (vsub === "list" || vsub === "ls") cmdAgentVaultList(va);
|
|
21
|
+
else if (vsub === "add") await cmdAgentVaultAdd(va);
|
|
22
|
+
else if (vsub === "rm" || vsub === "remove") cmdAgentVaultRm(va);
|
|
23
|
+
else if (vsub === "restore") cmdAgentVaultRestore(va);
|
|
24
|
+
else die(`unknown vault subcommand: ${vsub || "(none)"} — try: list, add, rm, restore`);
|
|
25
|
+
}
|
|
26
|
+
else die(`unknown agent subcommand: ${sub || "(none)"}`);
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// apx artifact — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdArtifactCreate, cmdArtifactList, cmdArtifactPreview, cmdArtifactPreviews, cmdArtifactRemove, cmdArtifactRun, cmdArtifactShare, cmdArtifactShow, cmdArtifactStop } from "../commands/artifact.js";
|
|
8
|
+
|
|
9
|
+
// Aliases accepted for this command. Declared here, next to the command
|
|
10
|
+
// itself — a global alias table would be wrong, since the same word means
|
|
11
|
+
// different things under different commands ("rm" is remove under `agent`,
|
|
12
|
+
// unset under `project config`, revoke under `pair`).
|
|
13
|
+
export const aliases = ["artifacts"];
|
|
14
|
+
|
|
15
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
16
|
+
const sub = rest[0];
|
|
17
|
+
const a = parseArgs(rest.slice(1));
|
|
18
|
+
if (!sub || sub === "list" || sub === "ls") await cmdArtifactList(a);
|
|
19
|
+
else if (sub === "create" || sub === "new") await cmdArtifactCreate(a);
|
|
20
|
+
else if (sub === "show" || sub === "get") await cmdArtifactShow(a);
|
|
21
|
+
else if (sub === "remove" || sub === "rm") await cmdArtifactRemove(a);
|
|
22
|
+
else if (sub === "run") await cmdArtifactRun(a);
|
|
23
|
+
else if (sub === "preview" || sub === "serve") await cmdArtifactPreview(a);
|
|
24
|
+
else if (sub === "share") await cmdArtifactShare(a);
|
|
25
|
+
else if (sub === "previews") await cmdArtifactPreviews(a);
|
|
26
|
+
else if (sub === "stop") await cmdArtifactStop(a);
|
|
27
|
+
else die(`unknown artifact subcommand: ${sub}`);
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx chat — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdChat } from "../commands/chat.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdChat(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx code — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdCode } from "../commands/code.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdCode(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// apx command — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdCommandList, cmdCommandShow } from "../commands/command.js";
|
|
8
|
+
|
|
9
|
+
// Aliases accepted for this command. Declared here, next to the command
|
|
10
|
+
// itself — a global alias table would be wrong, since the same word means
|
|
11
|
+
// different things under different commands ("rm" is remove under `agent`,
|
|
12
|
+
// unset under `project config`, revoke under `pair`).
|
|
13
|
+
export const aliases = ["commands"];
|
|
14
|
+
|
|
15
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
16
|
+
const sub = rest[0];
|
|
17
|
+
const a = parseArgs(rest.slice(1));
|
|
18
|
+
if (!sub || sub === "list" || sub === "ls") await cmdCommandList(a);
|
|
19
|
+
else if (sub === "show" || sub === "get") await cmdCommandShow(a);
|
|
20
|
+
else die(`unknown command subcommand: ${sub}`);
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// apx commitment — argument routing.
|
|
2
|
+
import {
|
|
3
|
+
cmdCommitmentAdd, cmdCommitmentList, cmdCommitmentShow,
|
|
4
|
+
cmdCommitmentKept, cmdCommitmentMissed, cmdCommitmentRenegotiate,
|
|
5
|
+
} from "../commands/commitment.js";
|
|
6
|
+
|
|
7
|
+
export const aliases = ["commitments"];
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (!sub || sub === "list" || sub === "ls") await cmdCommitmentList(a);
|
|
13
|
+
else if (sub === "add" || sub === "new") await cmdCommitmentAdd(a);
|
|
14
|
+
else if (sub === "show" || sub === "get") await cmdCommitmentShow(a);
|
|
15
|
+
else if (sub === "kept" || sub === "done") await cmdCommitmentKept(a);
|
|
16
|
+
else if (sub === "missed") await cmdCommitmentMissed(a);
|
|
17
|
+
else if (sub === "renegotiate" || sub === "move") await cmdCommitmentRenegotiate(a);
|
|
18
|
+
else die(`unknown commitment subcommand: ${sub}\nUsage: apx commitment <list|add|show|kept|missed|renegotiate>`);
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// apx config — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdConfigSet, cmdConfigShow, cmdConfigUnset } from "../commands/config.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (sub === "show" || sub === "ls" || sub === undefined) await cmdConfigShow(a);
|
|
13
|
+
else if (sub === "set") await cmdConfigSet(a);
|
|
14
|
+
else if (sub === "unset" || sub === "rm") await cmdConfigUnset(a);
|
|
15
|
+
else die(`unknown config subcommand: ${sub}`);
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx connections — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdConnections } from "../commands/a2a.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdConnections(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// apx conversations — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdConversationsGet, cmdConversationsList } from "../commands/chat.js";
|
|
8
|
+
|
|
9
|
+
// Aliases accepted for this command. Declared here, next to the command
|
|
10
|
+
// itself — a global alias table would be wrong, since the same word means
|
|
11
|
+
// different things under different commands ("rm" is remove under `agent`,
|
|
12
|
+
// unset under `project config`, revoke under `pair`).
|
|
13
|
+
export const aliases = ["conv"];
|
|
14
|
+
|
|
15
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
16
|
+
const sub = rest[0];
|
|
17
|
+
const a = parseArgs(rest.slice(1));
|
|
18
|
+
if (sub === "list" || sub === "ls") await cmdConversationsList(a);
|
|
19
|
+
else if (sub === "get" || sub === "show") await cmdConversationsGet(a);
|
|
20
|
+
else die(`unknown conversations subcommand: ${sub || "(none)"}`);
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// apx daemon — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
cmdDaemonLogs, cmdDaemonReload, cmdDaemonRestart, cmdDaemonStart, cmdDaemonStatus, cmdDaemonStop,
|
|
9
|
+
cmdDaemonInstallService, cmdDaemonUninstallService, cmdDaemonServiceStatus,
|
|
10
|
+
} from "../commands/daemon.js";
|
|
11
|
+
|
|
12
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
13
|
+
const sub = rest[0];
|
|
14
|
+
const a = parseArgs(rest.slice(1));
|
|
15
|
+
if (sub === "start") await cmdDaemonStart(a);
|
|
16
|
+
else if (sub === "stop") await cmdDaemonStop(a);
|
|
17
|
+
else if (sub === "restart") await cmdDaemonRestart(a);
|
|
18
|
+
else if (sub === "reload") await cmdDaemonReload(a);
|
|
19
|
+
else if (sub === "status") await cmdDaemonStatus(a);
|
|
20
|
+
else if (sub === "logs") cmdDaemonLogs(a);
|
|
21
|
+
else if (sub === "install-service") await cmdDaemonInstallService(a);
|
|
22
|
+
else if (sub === "uninstall-service") await cmdDaemonUninstallService(a);
|
|
23
|
+
else if (sub === "service-status") await cmdDaemonServiceStatus(a);
|
|
24
|
+
else die(`unknown daemon subcommand: ${sub || "(none)"}`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// apx desktop — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdDesktopInstall, cmdDesktopRestart, cmdDesktopStart, cmdDesktopStatus, cmdDesktopStop, cmdDesktopUninstall } from "../commands/desktop.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const [sub, ...oRest] = rest;
|
|
11
|
+
const oArgs = parseArgs(oRest);
|
|
12
|
+
if (!sub || sub === "start") { await cmdDesktopStart(oArgs); return; }
|
|
13
|
+
if (sub === "stop") { await cmdDesktopStop(oArgs); return; }
|
|
14
|
+
if (sub === "restart") { await cmdDesktopRestart(oArgs); return; }
|
|
15
|
+
if (sub === "status") { await cmdDesktopStatus(oArgs);return; }
|
|
16
|
+
if (sub === "install") { await cmdDesktopInstall(oArgs); return; }
|
|
17
|
+
if (sub === "uninstall") { await cmdDesktopUninstall(oArgs);return; }
|
|
18
|
+
die(`unknown desktop sub-command: ${sub}\nUsage: apx desktop <start|stop|restart|status|install|uninstall>`);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// apx env — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdEnvDetect } from "../commands/runtime.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
if (sub === "detect" || sub === "list") await cmdEnvDetect();
|
|
12
|
+
else die(`unknown env subcommand: ${sub || "(none)"}`);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx exec — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdExec } from "../commands/exec.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdExec(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx identity — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdIdentity } from "../commands/identity.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdIdentity(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Command registry: name (and alias) -> lazy loader for its route module.
|
|
2
|
+
//
|
|
3
|
+
// Lazy on purpose. cli/index.js used to eagerly import 165 symbols from 38
|
|
4
|
+
// command modules just to reach a 457-line switch, so `apx status` paid to
|
|
5
|
+
// load the Electron desktop wiring, the MCP runner and the session scanner.
|
|
6
|
+
// Now one command loads one module.
|
|
7
|
+
//
|
|
8
|
+
// Aliases live next to their command (see the `aliases` export in each route
|
|
9
|
+
// module); this map is generated from them.
|
|
10
|
+
export const ROUTES = Object.freeze({
|
|
11
|
+
"init": () => import("./init.js"),
|
|
12
|
+
"project": () => import("./project.js"),
|
|
13
|
+
"agent": () => import("./agent.js"),
|
|
14
|
+
"memory": () => import("./memory.js"),
|
|
15
|
+
"session": () => import("./session.js"),
|
|
16
|
+
"sessions": () => import("./sessions.js"),
|
|
17
|
+
"mcp": () => import("./mcp.js"),
|
|
18
|
+
"obsidian": () => import("./obsidian.js"),
|
|
19
|
+
"daemon": () => import("./daemon.js"),
|
|
20
|
+
"pair": () => import("./pair.js"),
|
|
21
|
+
"telegram": () => import("./telegram.js"),
|
|
22
|
+
"messages": () => import("./messages.js"),
|
|
23
|
+
"log": () => import("./log.js"),
|
|
24
|
+
"logs": () => import("./log.js"),
|
|
25
|
+
"exec": () => import("./exec.js"),
|
|
26
|
+
"acp": () => import("./acp.js"),
|
|
27
|
+
"search": () => import("./search.js"),
|
|
28
|
+
"chat": () => import("./chat.js"),
|
|
29
|
+
"code": () => import("./code.js"),
|
|
30
|
+
"conversations": () => import("./conversations.js"),
|
|
31
|
+
"conv": () => import("./conversations.js"),
|
|
32
|
+
"run": () => import("./run.js"),
|
|
33
|
+
"env": () => import("./env.js"),
|
|
34
|
+
"send": () => import("./send.js"),
|
|
35
|
+
"connections": () => import("./connections.js"),
|
|
36
|
+
"config": () => import("./config.js"),
|
|
37
|
+
"permission": () => import("./permission.js"),
|
|
38
|
+
"model": () => import("./model.js"),
|
|
39
|
+
"plugins": () => import("./plugins.js"),
|
|
40
|
+
"plugin": () => import("./plugins.js"),
|
|
41
|
+
"routine": () => import("./routine.js"),
|
|
42
|
+
"routines": () => import("./routine.js"),
|
|
43
|
+
"artifact": () => import("./artifact.js"),
|
|
44
|
+
"artifacts": () => import("./artifact.js"),
|
|
45
|
+
"task": () => import("./task.js"),
|
|
46
|
+
"tasks": () => import("./task.js"),
|
|
47
|
+
"commitment": () => import("./commitment.js"),
|
|
48
|
+
"commitments": () => import("./commitment.js"),
|
|
49
|
+
"panel": () => import("./panel.js"),
|
|
50
|
+
"profile": () => import("./profile.js"),
|
|
51
|
+
"profiles": () => import("./profile.js"),
|
|
52
|
+
"nudge": () => import("./nudge.js"),
|
|
53
|
+
"nudges": () => import("./nudge.js"),
|
|
54
|
+
"command": () => import("./command.js"),
|
|
55
|
+
"commands": () => import("./command.js"),
|
|
56
|
+
"org": () => import("./org.js"),
|
|
57
|
+
"organization": () => import("./org.js"),
|
|
58
|
+
"skills": () => import("./skills.js"),
|
|
59
|
+
"identity": () => import("./identity.js"),
|
|
60
|
+
"status": () => import("./status.js"),
|
|
61
|
+
"setup": () => import("./setup.js"),
|
|
62
|
+
"install": () => import("./setup.js"),
|
|
63
|
+
"update": () => import("./update.js"),
|
|
64
|
+
"upgrade": () => import("./update.js"),
|
|
65
|
+
"restart": () => import("./restart.js"),
|
|
66
|
+
"overlay": () => import("./overlay.js"),
|
|
67
|
+
"desktop": () => import("./desktop.js"),
|
|
68
|
+
"voice": () => import("./voice.js"),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function resolveRoute(cmd) {
|
|
72
|
+
return ROUTES[cmd] || null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const COMMAND_NAMES = Object.freeze(Object.keys(ROUTES));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx init — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdInit } from "../commands/init.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
cmdInit(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// apx log — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdLog } from "../commands/log.js";
|
|
8
|
+
|
|
9
|
+
// Aliases accepted for this command. Declared here, next to the command
|
|
10
|
+
// itself — a global alias table would be wrong, since the same word means
|
|
11
|
+
// different things under different commands ("rm" is remove under `agent`,
|
|
12
|
+
// unset under `project config`, revoke under `pair`).
|
|
13
|
+
export const aliases = ["logs"];
|
|
14
|
+
|
|
15
|
+
export default async function route(rest, { parseArgs }) {
|
|
16
|
+
// `apx log` is the unified daemon log (everything: telegram, whisper,
|
|
17
|
+
// super-agent, tools, desktop). For just the legacy stdout sink,
|
|
18
|
+
// use `apx daemon logs`. `apx log -f` follows; `--errors` filters.
|
|
19
|
+
await cmdLog(parseArgs(rest));
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// apx mcp — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdMcpAdd, cmdMcpCheck, cmdMcpDisable, cmdMcpEnable, cmdMcpList, cmdMcpLogs, cmdMcpRemove, cmdMcpRun, cmdMcpTools } from "../commands/mcp.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (sub === "list" || sub === "ls") await cmdMcpList(a);
|
|
13
|
+
else if (sub === "add") await cmdMcpAdd(a);
|
|
14
|
+
else if (sub === "remove" || sub === "rm") await cmdMcpRemove(a);
|
|
15
|
+
else if (sub === "enable") await cmdMcpEnable(a);
|
|
16
|
+
else if (sub === "disable") await cmdMcpDisable(a);
|
|
17
|
+
else if (sub === "run") await cmdMcpRun(a);
|
|
18
|
+
else if (sub === "tools") await cmdMcpTools(a);
|
|
19
|
+
else if (sub === "logs") await cmdMcpLogs(a);
|
|
20
|
+
else if (sub === "check") await cmdMcpCheck(a);
|
|
21
|
+
else die(`unknown mcp subcommand: ${sub || "(none)"}`);
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// apx memory — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdMemory, cmdMemoryNotebook, cmdMemoryConsolidate, cmdMemoryRevert } from "../commands/memory.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
// `apx memory <agent-slug>` is the original form and stays the default, so
|
|
11
|
+
// these three names are reserved. An agent literally called "notebook" would
|
|
12
|
+
// be shadowed; that is a trade worth making for a readable command.
|
|
13
|
+
const sub = rest[0];
|
|
14
|
+
const a = parseArgs(rest.slice(1));
|
|
15
|
+
if (sub === "notebook") return cmdMemoryNotebook(a);
|
|
16
|
+
if (sub === "consolidate") return cmdMemoryConsolidate(a);
|
|
17
|
+
if (sub === "revert") return cmdMemoryRevert(a);
|
|
18
|
+
return cmdMemory(parseArgs(rest));
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// apx messages — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdMessagesChat, cmdMessagesSearch, cmdMessagesTail } from "../commands/messages.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (sub === "tail") await cmdMessagesTail(a);
|
|
13
|
+
else if (sub === "chat") await cmdMessagesChat(a);
|
|
14
|
+
else if (sub === "search") await cmdMessagesSearch(a);
|
|
15
|
+
else die(`unknown messages subcommand: ${sub || "(none)"}`);
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx model — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdModel } from "../commands/model.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdModel(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// apx nudge — argument routing for the interruption budget.
|
|
2
|
+
import {
|
|
3
|
+
cmdNudgeStatus, cmdNudgeList, cmdNudgeSet, cmdNudgeCheck, cmdNudgeFeedback,
|
|
4
|
+
} from "../commands/nudge.js";
|
|
5
|
+
|
|
6
|
+
export const aliases = ["nudges"];
|
|
7
|
+
|
|
8
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
9
|
+
const sub = rest[0];
|
|
10
|
+
const a = parseArgs(rest.slice(1));
|
|
11
|
+
if (!sub || sub === "status") await cmdNudgeStatus(a);
|
|
12
|
+
else if (sub === "list" || sub === "ls") await cmdNudgeList(a);
|
|
13
|
+
else if (sub === "set" || sub === "config") await cmdNudgeSet(a);
|
|
14
|
+
else if (sub === "check") await cmdNudgeCheck(a);
|
|
15
|
+
else if (sub === "feedback") await cmdNudgeFeedback(a);
|
|
16
|
+
else die(`unknown nudge subcommand: ${sub}\nUsage: apx nudge <status|list|set|check|feedback>`);
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// apx obsidian — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdObsidianRemove, cmdObsidianSet, cmdObsidianStatus, cmdObsidianSync } from "../commands/obsidian.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (!sub || sub === "status" || sub === "show") await cmdObsidianStatus(a);
|
|
13
|
+
else if (sub === "set" || sub === "connect" || sub === "add") await cmdObsidianSet(a);
|
|
14
|
+
else if (sub === "sync") await cmdObsidianSync(a);
|
|
15
|
+
else if (sub === "remove" || sub === "rm" || sub === "disconnect") await cmdObsidianRemove(a);
|
|
16
|
+
else die(`unknown obsidian subcommand: ${sub}\nUsage: apx obsidian <set|status|sync|remove> [--global|--project <p>]`);
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// apx org — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdOrgAreaAdd, cmdOrgAreaRm, cmdOrgRoleAdd, cmdOrgRoleRm, cmdOrgShow } from "../commands/org.js";
|
|
8
|
+
|
|
9
|
+
// Aliases accepted for this command. Declared here, next to the command
|
|
10
|
+
// itself — a global alias table would be wrong, since the same word means
|
|
11
|
+
// different things under different commands ("rm" is remove under `agent`,
|
|
12
|
+
// unset under `project config`, revoke under `pair`).
|
|
13
|
+
export const aliases = ["organization"];
|
|
14
|
+
|
|
15
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
16
|
+
const sub = rest[0];
|
|
17
|
+
const a = parseArgs(rest.slice(1));
|
|
18
|
+
// `apx org area add ...` / `apx org role rm ...` — the resource verb is
|
|
19
|
+
// the first positional, the action the second.
|
|
20
|
+
if (!sub || sub === "show" || sub === "list") await cmdOrgShow(a);
|
|
21
|
+
else if (sub === "area") {
|
|
22
|
+
const action = rest[1];
|
|
23
|
+
const aa = parseArgs(rest.slice(1)); // keep `area` as _[0] for name parsing
|
|
24
|
+
if (action === "add" || action === "new") await cmdOrgAreaAdd(aa);
|
|
25
|
+
else if (action === "rm" || action === "remove" || action === "delete") await cmdOrgAreaRm(aa);
|
|
26
|
+
else die("usage: apx org area <add|rm> ...");
|
|
27
|
+
} else if (sub === "role") {
|
|
28
|
+
const action = rest[1];
|
|
29
|
+
const ra = parseArgs(rest.slice(1));
|
|
30
|
+
if (action === "add" || action === "new") await cmdOrgRoleAdd(ra);
|
|
31
|
+
else if (action === "rm" || action === "remove" || action === "delete") await cmdOrgRoleRm(ra);
|
|
32
|
+
else die("usage: apx org role <add|rm> ...");
|
|
33
|
+
} else die(`unknown org subcommand: ${sub}\nUsage: apx org <show|area|role> ...`);
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// apx overlay — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
export default async function route(_rest, _ctx) {
|
|
8
|
+
console.error(" apx overlay has been renamed to apx desktop — forwarding.");
|
|
9
|
+
/* falls through */
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// apx pair — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdPair, cmdPairList, cmdPairRevoke, cmdPairWeb } from "../commands/pair.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (!sub || sub === "new" || sub === "device" || sub === "deck") await cmdPair(a);
|
|
13
|
+
else if (sub === "web") await cmdPairWeb(a);
|
|
14
|
+
else if (sub === "list" || sub === "ls") await cmdPairList();
|
|
15
|
+
else if (sub === "revoke" || sub === "rm") await cmdPairRevoke(a);
|
|
16
|
+
else die(`unknown pair subcommand: ${sub} — try: (no arg)/deck, web, list, revoke <id>`);
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// apx panel — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdPanelShare, cmdPanelStatus, cmdPanelUnshare } from "../commands/panel.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
10
|
+
const sub = rest[0];
|
|
11
|
+
const a = parseArgs(rest.slice(1));
|
|
12
|
+
if (!sub || sub === "status") await cmdPanelStatus(a);
|
|
13
|
+
else if (sub === "share") await cmdPanelShare(a);
|
|
14
|
+
else if (sub === "unshare") await cmdPanelUnshare(a);
|
|
15
|
+
else die(`unknown panel subcommand: ${sub}\nUsage: apx panel <status|share|unshare>`);
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// apx permission — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdPermission } from "../commands/config.js";
|
|
8
|
+
|
|
9
|
+
export default async function route(rest, { parseArgs }) {
|
|
10
|
+
await cmdPermission(parseArgs(rest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// apx plugins — argument routing.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the 457-line dispatch() switch in cli/index.js. Each command
|
|
4
|
+
// owns its own routing and imports only the command functions it calls, so the
|
|
5
|
+
// CLI no longer loads all 38 command modules to run one of them.
|
|
6
|
+
|
|
7
|
+
import { cmdPluginStatus, cmdPluginsList } from "../commands/plugins.js";
|
|
8
|
+
|
|
9
|
+
// Aliases accepted for this command. Declared here, next to the command
|
|
10
|
+
// itself — a global alias table would be wrong, since the same word means
|
|
11
|
+
// different things under different commands ("rm" is remove under `agent`,
|
|
12
|
+
// unset under `project config`, revoke under `pair`).
|
|
13
|
+
export const aliases = ["plugin"];
|
|
14
|
+
|
|
15
|
+
export default async function route(rest, { parseArgs, die }) {
|
|
16
|
+
const sub = rest[0];
|
|
17
|
+
const a = parseArgs(rest.slice(1));
|
|
18
|
+
if (sub === "list" || sub === "ls" || sub === undefined) await cmdPluginsList();
|
|
19
|
+
else if (sub === "status") await cmdPluginStatus(a);
|
|
20
|
+
else die(`unknown plugins subcommand: ${sub}`);
|
|
21
|
+
}
|