@agentprojectcontext/apx 1.33.1 → 1.35.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/package.json +1 -1
- package/skills/apx/SKILL.md +49 -61
- package/src/core/agent/a2a/reply.js +48 -0
- package/src/core/agent/build-agent-system.js +136 -59
- package/src/core/agent/channels/voice-context.js +98 -0
- package/src/core/agent/memory.js +2 -1
- package/src/core/agent/prompt-builder.js +178 -124
- package/src/core/agent/prompts/channels/code.md +12 -10
- package/src/core/agent/prompts/channels/desktop.md +5 -32
- package/src/core/agent/prompts/channels/telegram.md +4 -15
- package/src/core/agent/prompts/channels/web_code.md +11 -11
- package/src/core/agent/prompts/core/agent-base.md +24 -0
- package/src/core/agent/prompts/core/project-agent.md +11 -0
- package/src/core/agent/prompts/core/super-agent.md +21 -0
- package/src/core/agent/prompts/discipline/action.md +10 -0
- package/src/core/agent/prompts/discipline/single-segment.md +6 -0
- package/src/core/agent/prompts/discipline/two-segment.md +11 -0
- package/src/core/agent/prompts/modes/code-build.md +1 -0
- package/src/core/agent/prompts/modes/code-plan.md +1 -0
- package/src/core/agent/prompts/modes/index.js +28 -0
- package/src/core/agent/self-memory.js +43 -1
- package/src/core/agent/skills/index-store.js +307 -0
- package/src/core/agent/skills/index.js +15 -1
- package/src/core/agent/skills/inspector.js +317 -0
- package/src/core/agent/skills/loader.js +22 -18
- package/src/core/agent/stream/turn-accumulator.js +73 -0
- package/src/core/agent/suggestions.js +37 -0
- package/src/core/agent/super-agent.js +7 -1
- package/src/core/agent/tools/handlers/_git.js +50 -0
- package/src/core/agent/tools/handlers/add-project.js +5 -2
- package/src/core/agent/tools/handlers/call-runtime.js +3 -2
- package/src/core/agent/tools/handlers/git-diff.js +44 -0
- package/src/core/agent/tools/handlers/git-log.js +38 -0
- package/src/core/agent/tools/handlers/git-show.js +34 -0
- package/src/core/agent/tools/handlers/git-status.js +61 -0
- package/src/core/agent/tools/handlers/transcribe-audio.js +1 -1
- package/src/core/agent/tools/helpers.js +2 -2
- package/src/core/agent/tools/names.js +169 -0
- package/src/core/agent/tools/registry-bridge.js +6 -14
- package/src/core/agent/tools/registry.js +103 -69
- package/src/core/apc/context-copy.js +27 -0
- package/src/core/apc/notes.js +19 -0
- package/src/core/apc/parser.js +12 -5
- package/src/core/apc/paths.js +87 -0
- package/src/core/apc/scaffold.js +82 -76
- package/src/core/apc/skill-sync.js +10 -0
- package/src/{host/daemon/plugins → core/channels}/telegram/dispatch.js +38 -16
- package/src/core/config/index.js +24 -2
- package/src/core/config/redact.js +95 -0
- package/src/core/constants/channels.js +2 -0
- package/src/core/constants/code-modes.js +10 -0
- package/src/core/constants/index.js +1 -0
- package/src/core/deck/manifest.js +186 -0
- package/src/core/engines/catalog.js +83 -0
- package/src/core/{tools → http-tools}/browser.js +0 -1
- package/src/core/{tools → http-tools}/fetch.js +0 -1
- package/src/core/{tools → http-tools}/glob.js +0 -1
- package/src/core/{tools → http-tools}/grep.js +0 -1
- package/src/core/{tools → http-tools}/registry.js +0 -1
- package/src/core/{tools → http-tools}/search.js +0 -1
- package/src/core/i18n/en.js +9 -0
- package/src/core/i18n/es.js +12 -0
- package/src/core/i18n/index.js +54 -0
- package/src/core/i18n/pt.js +9 -0
- package/src/core/identity/telegram.js +2 -1
- package/src/core/mcp/runner.js +272 -14
- package/src/core/mcp/sources.js +3 -2
- package/src/core/routines/index.js +16 -0
- package/src/{host/daemon/routines.js → core/routines/runner.js} +36 -103
- package/src/core/runtime-skills/apc-context/SKILL.md +159 -0
- package/src/core/runtime-skills/apx/SKILL.md +83 -0
- package/src/core/runtime-skills/apx-agency-agents/SKILL.md +125 -0
- package/src/core/runtime-skills/apx-agent/SKILL.md +97 -0
- package/src/core/runtime-skills/apx-mcp/SKILL.md +111 -0
- package/src/core/runtime-skills/apx-mcp-builder/SKILL.md +169 -0
- package/{skills → src/core/runtime-skills}/apx-project/SKILL.md +20 -29
- package/src/core/runtime-skills/apx-routine/SKILL.md +127 -0
- package/src/core/runtime-skills/apx-runtime/SKILL.md +99 -0
- package/src/core/runtime-skills/apx-sessions/SKILL.md +232 -0
- package/src/core/runtime-skills/apx-skill-builder/SKILL.md +129 -0
- package/{skills → src/core/runtime-skills}/apx-task/SKILL.md +18 -21
- package/src/core/runtime-skills/apx-telegram/SKILL.md +120 -0
- package/src/core/runtime-skills/apx-voice/SKILL.md +117 -0
- package/src/core/runtime-skills/{claude-code.md → claude-code/SKILL.md} +1 -0
- package/src/core/runtime-skills/{codex-cli.md → codex-cli/SKILL.md} +1 -0
- package/src/core/runtime-skills/{opencode-cli.md → opencode-cli/SKILL.md} +1 -0
- package/src/core/runtime-skills/{openrouter.md → openrouter/SKILL.md} +1 -0
- package/src/{host/daemon/env-detect.js → core/runtimes/detect.js} +1 -1
- package/src/core/stores/code-sessions.js +50 -2
- package/src/core/stores/routine-memory.js +1 -1
- package/src/core/stores/sessions-search.js +121 -0
- package/src/core/stores/sessions.js +38 -0
- package/src/core/vars/index.js +14 -0
- package/src/core/vars/interpolate.js +86 -0
- package/src/core/vars/sources.js +151 -0
- package/src/core/voice/audio-decode.js +38 -0
- package/src/core/voice/transcription.js +225 -0
- package/src/host/daemon/api/admin-config.js +5 -82
- package/src/host/daemon/api/agents.js +5 -5
- package/src/host/daemon/api/code.js +17 -169
- package/src/host/daemon/api/config.js +3 -4
- package/src/host/daemon/api/conversations.js +8 -29
- package/src/host/daemon/api/deck.js +37 -404
- package/src/host/daemon/api/engines.js +1 -80
- package/src/host/daemon/api/exec.js +1 -1
- package/src/host/daemon/api/mcps.js +32 -0
- package/src/host/daemon/api/routines.js +1 -1
- package/src/host/daemon/api/runtimes.js +4 -3
- package/src/host/daemon/api/sessions-search.js +24 -140
- package/src/host/daemon/api/sessions.js +12 -30
- package/src/host/daemon/api/shared.js +2 -1
- package/src/host/daemon/api/skills.js +140 -6
- package/src/host/daemon/api/super-agent.js +56 -1
- package/src/host/daemon/api/telegram.js +1 -11
- package/src/host/daemon/api/tools.js +6 -6
- package/src/host/daemon/api/transcribe.js +2 -2
- package/src/host/daemon/api/vars.js +137 -0
- package/src/host/daemon/api/voice.js +13 -290
- package/src/host/daemon/api.js +2 -0
- package/src/host/daemon/db.js +6 -6
- package/src/host/daemon/deck-exec.js +148 -0
- package/src/host/daemon/index.js +20 -3
- package/src/host/daemon/plugins/telegram/index.js +9 -9
- package/src/host/daemon/routines-scheduler.js +64 -0
- package/src/host/daemon/smoke.js +3 -2
- package/src/host/daemon/whisper-server.js +225 -0
- package/src/interfaces/cli/branding.js +53 -0
- package/src/interfaces/cli/commands/agent.js +3 -2
- package/src/interfaces/cli/commands/command.js +2 -3
- package/src/interfaces/cli/commands/messages.js +6 -2
- package/src/interfaces/cli/commands/pair.js +5 -4
- package/src/interfaces/cli/commands/search.js +1 -1
- package/src/interfaces/cli/commands/sessions.js +3 -2
- package/src/interfaces/cli/commands/skills.js +290 -55
- package/src/interfaces/cli/index.js +84 -2
- package/src/interfaces/web/dist/assets/index-C0fm31dY.js +618 -0
- package/src/interfaces/web/dist/assets/index-C0fm31dY.js.map +1 -0
- package/src/interfaces/web/dist/assets/index-UcAqlBO6.css +1 -0
- package/src/interfaces/web/dist/index.html +2 -2
- package/src/interfaces/web/package-lock.json +182 -182
- package/src/interfaces/web/src/components/ModelCombobox.tsx +2 -1
- package/src/interfaces/web/src/components/TelegramChannelDialog.tsx +1 -1
- package/src/interfaces/web/src/components/chat/AskAnswersCard.tsx +76 -0
- package/src/interfaces/web/src/components/chat/MessageBubble.tsx +37 -4
- package/src/interfaces/web/src/components/chat/MessageList.tsx +23 -1
- package/src/interfaces/web/src/components/chat/ModelPicker.tsx +3 -1
- package/src/interfaces/web/src/components/code/CodeArtifactsTab.tsx +4 -4
- package/src/interfaces/web/src/components/code/CodeChangesTab.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeFileTree.tsx +3 -2
- package/src/interfaces/web/src/components/code/CodeFileViewer.tsx +3 -2
- package/src/interfaces/web/src/components/code/CodeTerminal.tsx +3 -2
- package/src/interfaces/web/src/components/config/GlobalConfigEditor.tsx +2 -1
- package/src/interfaces/web/src/components/deck/WidgetRow.tsx +2 -1
- package/src/interfaces/web/src/components/inputs/KeyValueList.tsx +93 -0
- package/src/interfaces/web/src/components/inputs/VarTokenInput.tsx +449 -0
- package/src/interfaces/web/src/components/settings/DefaultRouterCard.tsx +2 -1
- package/src/interfaces/web/src/components/settings/EnginesPanel.tsx +2 -2
- package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +73 -4
- package/src/interfaces/web/src/components/settings/SkillsInspectorPanel.tsx +222 -0
- package/src/interfaces/web/src/components/settings/providers/ProviderCard.tsx +3 -2
- package/src/interfaces/web/src/components/settings/providers/ProviderModal.tsx +3 -2
- package/src/interfaces/web/src/components/ui/chat-input.tsx +5 -4
- package/src/interfaces/web/src/components/ui/sidebar.tsx +3 -2
- package/src/interfaces/web/src/components/voice/VoiceProviderModal.tsx +2 -1
- package/src/interfaces/web/src/constants/index.ts +1 -1
- package/src/interfaces/web/src/hooks/useChat.ts +19 -0
- package/src/interfaces/web/src/i18n/en.ts +175 -7
- package/src/interfaces/web/src/i18n/es.ts +180 -15
- package/src/interfaces/web/src/lib/api/mcps.ts +25 -0
- package/src/interfaces/web/src/lib/api/skills.ts +70 -0
- package/src/interfaces/web/src/lib/api/vars.ts +38 -0
- package/src/interfaces/web/src/lib/api.ts +1 -0
- package/src/interfaces/web/src/screens/ProjectScreen.tsx +8 -31
- package/src/interfaces/web/src/screens/SettingsScreen.tsx +6 -2
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +4 -3
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +7 -6
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +4 -3
- package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/project/ConfigTab.tsx +132 -1
- package/src/interfaces/web/src/screens/project/McpsTab.tsx +549 -104
- package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/VarsTab.tsx +300 -0
- package/src/interfaces/web/src/types/daemon.ts +15 -0
- package/skills/apx-agency-agents/SKILL.md +0 -141
- package/skills/apx-agent/SKILL.md +0 -100
- package/skills/apx-mcp-builder/SKILL.md +0 -183
- package/skills/apx-routine/SKILL.md +0 -140
- package/skills/apx-runtime/SKILL.md +0 -117
- package/skills/apx-sessions/SKILL.md +0 -281
- package/skills/apx-skill-builder/SKILL.md +0 -153
- package/skills/apx-telegram/SKILL.md +0 -131
- package/skills/apx-voice/SKILL.md +0 -137
- package/src/core/agent/prompts/action-discipline.md +0 -24
- package/src/core/agent/prompts/super-agent-base.md +0 -42
- package/src/host/daemon/transcription.js +0 -538
- package/src/host/daemon/whisper-transcribe.py +0 -73
- package/src/interfaces/web/dist/assets/index-Aaiw8BZN.css +0 -1
- package/src/interfaces/web/dist/assets/index-DPqtjDjh.js +0 -602
- package/src/interfaces/web/dist/assets/index-DPqtjDjh.js.map +0 -1
- /package/src/{host/daemon → core/apc}/projects-helpers.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/ask.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/helpers.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/media.js +0 -0
- /package/src/core/{tools → http-tools}/index.js +0 -0
- /package/src/{host/daemon/compact.js → core/stores/conversations-compactor.js} +0 -0
- /package/src/{host/daemon → core/stores}/conversations.js +0 -0
- /package/src/{host/daemon → core/util}/thinking.js +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apc-context
|
|
3
|
+
description: "ALWAYS activate when the project has a .apc/ directory or AGENTS.md file. Do not wait to be asked. Read .apc/ before making any assumption about agents, memory, or project structure. Activate on: .apc/, AGENTS.md, 'which agents', 'list agents', 'agent context', 'who are the agents', any question about agents or memory in this project. IMPORTANT: if .apc/migrate.md exists, open the conversation with a migration offer before answering anything else. If the user declines, delete .apc/migrate.md immediately so it is not shown again."
|
|
4
|
+
homepage: https://github.com/agentprojectcontext/agentprojectcontext
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Project Context
|
|
8
|
+
|
|
9
|
+
This project uses APC. APC stores portable project context in `.apc/` and `AGENTS.md`.
|
|
10
|
+
|
|
11
|
+
APC does not store raw runtime sessions. Sessions, conversations, messages, caches, provider
|
|
12
|
+
threads, and private runtime memory stay in the IDE, CLI, daemon, or user-level store that created
|
|
13
|
+
them.
|
|
14
|
+
|
|
15
|
+
## FIRST: check for pending migration
|
|
16
|
+
|
|
17
|
+
Before doing anything else, check if `.apc/migrate.md` exists:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cat .apc/migrate.md 2>/dev/null
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If it exists, open with this offer before answering anything else:
|
|
24
|
+
|
|
25
|
+
> I see this project was initialized with Agent Project Context (APC).
|
|
26
|
+
>
|
|
27
|
+
> I found context files that may need migration:
|
|
28
|
+
> [list files from .apc/migrate.md]
|
|
29
|
+
>
|
|
30
|
+
> I can read them, separate durable project context from runtime/private state, and migrate only
|
|
31
|
+
> what belongs in APC.
|
|
32
|
+
>
|
|
33
|
+
> Want me to start?
|
|
34
|
+
|
|
35
|
+
If the user says no or later, delete `.apc/migrate.md` so the offer is not repeated.
|
|
36
|
+
|
|
37
|
+
## Migration rule: think, do not copy
|
|
38
|
+
|
|
39
|
+
Read detected files first. Also read `AGENTS.md` if it exists.
|
|
40
|
+
|
|
41
|
+
Classify content:
|
|
42
|
+
|
|
43
|
+
| Content | Action |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Agent definitions: name, model, description | Put in `.apc/agents/<name>.md` and/or `AGENTS.md` |
|
|
46
|
+
| Shared project rules, stack notes, commands, testing policy | Keep in `AGENTS.md` |
|
|
47
|
+
| Reusable instruction blocks | Move to `.apc/skills/<name>.md` |
|
|
48
|
+
| Durable safe facts useful to all contributors | Add to `.apc/agents/<name>/memory.md` only after curation |
|
|
49
|
+
| MCP expectations without secrets | Add to `.apc/mcps.json` |
|
|
50
|
+
| Raw sessions, transcripts, conversations, messages, tool logs | Do not move into `.apc/`; leave with source runtime |
|
|
51
|
+
| Secrets, tokens, credentials, private headers | Do not store in repository |
|
|
52
|
+
| IDE UI settings or personal aliases | Leave in IDE/user config |
|
|
53
|
+
| Instructions to store sessions under `.apc/` | Drop as obsolete |
|
|
54
|
+
|
|
55
|
+
After migration:
|
|
56
|
+
|
|
57
|
+
1. Update `AGENTS.md` as the root project contract.
|
|
58
|
+
2. Create or update `.apc/agents/`, `.apc/skills/`, `.apc/mcps.json` as needed.
|
|
59
|
+
3. Do not create `.apc/**/sessions`, `.apc/messages`, or `.apc/conversations`.
|
|
60
|
+
4. Delete obsolete source files only when their useful project context was migrated or intentionally dropped.
|
|
61
|
+
5. Delete `.apc/migrate.md`.
|
|
62
|
+
6. Summarize what moved, what stayed local, and what was dropped.
|
|
63
|
+
|
|
64
|
+
## APC structure
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
AGENTS.md ← root project contract
|
|
68
|
+
.apc/
|
|
69
|
+
project.json ← project metadata
|
|
70
|
+
.gitignore ← safety guard
|
|
71
|
+
agents/<name>.md ← agent definition
|
|
72
|
+
agents/<name>/memory.md ← optional curated project memory
|
|
73
|
+
skills/<name>.md ← reusable project instructions
|
|
74
|
+
mcps.json ← MCP hints without secrets
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Do not store:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
.apc/agents/<name>/sessions/
|
|
81
|
+
.apc/sessions/
|
|
82
|
+
.apc/conversations/
|
|
83
|
+
.apc/messages/
|
|
84
|
+
.apc/cache/
|
|
85
|
+
.apc/tmp/
|
|
86
|
+
.apc/private/
|
|
87
|
+
.apc/secrets/
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Visibility rules
|
|
91
|
+
|
|
92
|
+
| Data | Visibility | Commit? |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| Agent definitions, skills, project rules | `stable` / `project` | Yes |
|
|
95
|
+
| Curated safe `memory.md` | `project` | Yes, if team-safe |
|
|
96
|
+
| MCP hints without secrets | `project` | Yes |
|
|
97
|
+
| Sessions, conversations, messages | `local` | No; runtime-owned |
|
|
98
|
+
| Secrets, tokens, `*.secret.json`, `*.env` | `private` | Never |
|
|
99
|
+
| Caches, temp files, databases | `ephemeral` | No |
|
|
100
|
+
|
|
101
|
+
## Operating rules
|
|
102
|
+
|
|
103
|
+
1. Read `AGENTS.md` and relevant `.apc/` files before assuming project context.
|
|
104
|
+
2. Read agent definitions from `.apc/agents/<name>.md` when present.
|
|
105
|
+
3. Read curated project memory from `.apc/agents/<name>/memory.md` when present.
|
|
106
|
+
4. Write only durable, safe, curated facts to APC memory.
|
|
107
|
+
5. Never write raw sessions, transcripts, messages, conversations, or tool logs into `.apc/`.
|
|
108
|
+
6. Keep secrets out of APC and out of git.
|
|
109
|
+
7. Treat `.apc/mcps.json` as MCP configuration hints, not as an MCP implementation.
|
|
110
|
+
|
|
111
|
+
## Normalization
|
|
112
|
+
|
|
113
|
+
If agent formats are broken or use legacy fields (role, skills in YAML), offer to normalize:
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
---
|
|
117
|
+
name: agent-name
|
|
118
|
+
model: inherit
|
|
119
|
+
description: Semantic activation trigger
|
|
120
|
+
---
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Identify and fix inconsistencies in `model` (use technical IDs or `inherit`) and ensure `description` is present for semantic activation.
|
|
124
|
+
|
|
125
|
+
## Sessions
|
|
126
|
+
|
|
127
|
+
Sessions belong to the runtime that created them.
|
|
128
|
+
|
|
129
|
+
Examples:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
Codex runtime storage
|
|
133
|
+
Claude Code runtime storage
|
|
134
|
+
OpenCode runtime storage
|
|
135
|
+
~/.apx/projects/<project-id>/agents/<name>/sessions/
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
At task end, provide the user a concise result. If project memory should be updated, write a short
|
|
139
|
+
sanitized fact to `.apc/agents/<name>/memory.md` only when useful and safe.
|
|
140
|
+
|
|
141
|
+
## APX
|
|
142
|
+
|
|
143
|
+
Read `.apc/project.json` if present. It may contain an `apx` field:
|
|
144
|
+
|
|
145
|
+
- `"installed"`: APX is available; use `apx` commands when useful.
|
|
146
|
+
- `"declined"`: user chose not to install; do not suggest or run APX.
|
|
147
|
+
- missing or `null`: unknown; do not assume APX is available.
|
|
148
|
+
|
|
149
|
+
If APX is installed, it may manage runtime state outside the repository:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
~/.apx/projects/<project-id>/
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
APX can provide a local daemon, MCP management, Telegram bridge, routines, and runtime dispatch
|
|
156
|
+
across Codex, Claude Code, OpenCode, Aider, or direct LLM engines. Those are APX runtime features,
|
|
157
|
+
not APC portable-core requirements.
|
|
158
|
+
|
|
159
|
+
Never use APX to write secrets or raw sessions into `.apc/`.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apx
|
|
3
|
+
description: "APX CLI umbrella — routes operations to sub-skills (sessions, MCPs, routines, tasks, telegram, projects, agents, runtimes). Activate on `apx`, the APX daemon, or coordinating/running/delegating agents. Not for `.apc/` alone (use apc-context). Triggers: 'apx', 'apx run', 'apx daemon', 'coordinate agents'."
|
|
4
|
+
homepage: https://github.com/agentprojectcontext/apx
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# APX — Agent Project Context Runtime
|
|
8
|
+
|
|
9
|
+
APX is a daemon (`127.0.0.1:7430`, auto-starts on first call) that turns external coding CLIs (Claude Code, Codex, OpenCode, Aider, …) and configurable agents into a unified orchestration surface. It reads APC project context from `.apc/` (committed) but keeps runtime state outside the repo under `~/.apx/projects/<project-id>/`. Super-agent has a default workspace at `~/.apx/projects/default` for system-level work.
|
|
10
|
+
|
|
11
|
+
## When to use APX (vs. native subagent)
|
|
12
|
+
|
|
13
|
+
If you can spawn a subagent natively in the current IDE (Claude Code, Cursor, …) — **do that**. No APX needed. Use APX when:
|
|
14
|
+
- User explicitly asks for a specific external runtime ("run this in Codex", "delegate to OpenCode").
|
|
15
|
+
- You need an agent in a runtime different from the one you're in.
|
|
16
|
+
- Orchestrating from outside any IDE (script, Telegram bot, CI, routine).
|
|
17
|
+
|
|
18
|
+
## Sub-skill index
|
|
19
|
+
|
|
20
|
+
| Topic | Sub-skill | When |
|
|
21
|
+
|-------|-----------|------|
|
|
22
|
+
| Delegate to external coding CLI | **apx-runtime** | `apx run <agent> --runtime claude-code\|codex\|...` |
|
|
23
|
+
| List/read/resume/summarise/continue sessions | **apx-sessions** | `apx session resume`, `apx sessions list`, "import a codex session" |
|
|
24
|
+
| Use a registered MCP tool | **apx-mcp** | `apx mcp run`, "call MCP filesystem", "MCP failing" |
|
|
25
|
+
| Add/configure/use a project agent | **apx-agent** | "add an agent", vault import, per-agent model, agent memory |
|
|
26
|
+
| Register/list/configure a project | **apx-project** | "register this project", `apx project list`, per-project config |
|
|
27
|
+
| Per-project TODO list | **apx-task** | "add a task", "remind me to…", "what's pending" |
|
|
28
|
+
| Scheduled/recurring agents | **apx-routine** | `apx routine add`, every-5m, cron-like jobs |
|
|
29
|
+
| Telegram I/O | **apx-telegram** | configure bot, channels, send a message |
|
|
30
|
+
| Voice channel (TTS, speech) — *optional* | **apx-voice** | only if voice is being set up |
|
|
31
|
+
| Build a new MCP server — *internal/dev* | **apx-mcp-builder** | authoring a brand-new MCP from scratch |
|
|
32
|
+
| Author a new APX skill — *internal/dev* | **apx-skill-builder** | adding to APX itself |
|
|
33
|
+
|
|
34
|
+
> *internal/dev* sub-skills aren't pushed to IDE skill dirs by default. They live in the APX repo; install to IDE with `apx skills add <slug> --global`.
|
|
35
|
+
|
|
36
|
+
## Generic patterns (apply to every sub-skill)
|
|
37
|
+
|
|
38
|
+
### Verify commands before recommending
|
|
39
|
+
|
|
40
|
+
Don't invent APX subcommands. Confirm exact form with `apx --help` or `apx <command> --help` before telling another runtime to invoke APX. Avoid guessed aliases (e.g. `apx send-telegram` is not a thing — see apx-telegram).
|
|
41
|
+
|
|
42
|
+
### `APC_RESULT` contract
|
|
43
|
+
|
|
44
|
+
When you want APX to capture a structured value from an agent (any runtime), instruct the agent to print on its last meaningful line:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
APC_RESULT: <one-line value>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
APX's `extractApfResult()` parses that and stores it as the session's `result` field. Useful for automation, routines, CI.
|
|
51
|
+
|
|
52
|
+
### Tool permissions
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
apx permission show
|
|
56
|
+
apx permission set automatico # total | automatico | permiso
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`automatico` runs read/list/safe shell checks directly; asks before destructive shell, MCP, runtime, outbound, config, or filesystem mutation.
|
|
60
|
+
|
|
61
|
+
### Memory
|
|
62
|
+
|
|
63
|
+
Write memory only for durable, safe project facts. No raw transcripts or secrets.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
apx memory <slug> # read agent's memory.md
|
|
67
|
+
apx memory <slug> --append "<fact>" # append durable note
|
|
68
|
+
apx memory <slug> --replace < file.md # replace entire memory from stdin
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Observe activity
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
apx messages tail # last 50 messages, all channels
|
|
75
|
+
apx messages chat --channel telegram -n 20 # readable chat view
|
|
76
|
+
apx messages tail --channel runtime --agent <slug> -n 20
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Anti-patterns
|
|
80
|
+
|
|
81
|
+
- Don't activate apx-sessions inside a request that's purely about `apx run` orchestration — use apx-runtime.
|
|
82
|
+
- Don't activate apx-mcp-builder unless the user is actually authoring a new MCP server (deep dev guide, not usage).
|
|
83
|
+
- Don't push state to `.apc/` that belongs in `~/.apx/projects/<id>/` (sessions, conversations, runtime logs).
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apx-agency-agents
|
|
3
|
+
description: "APX agent vault — reusable templates (Roby, Cody, Rocky, Tessa, Max, Arch, Sid, Vera, Finn + generic dev/marketing/ops/qa/support). Spawn a specialist, list, import into a project, create, or hide/restore a bundled default. Triggers: 'spawn agent', 'use Cody/Rocky/Tessa', 'list agents', 'agent vault', 'import agent', 'new agent'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# apx-agency-agents — the APX agent vault
|
|
7
|
+
|
|
8
|
+
Global, project-agnostic library of agent templates. Two layers, deduped per-slug, user wins:
|
|
9
|
+
|
|
10
|
+
| Layer | Where | Mutability |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| **Bundled** | `<repo>/assets/agent-vault-defaults/<slug>.md` | Read-only. Visible unless tombstoned. |
|
|
13
|
+
| **User** | `~/.apx/agents/<slug>.md` | Read-write. Overrides bundled with same slug. |
|
|
14
|
+
| **Tombstones** | `~/.apx/agents/.removed.json` | Bundled slugs the user hid. |
|
|
15
|
+
|
|
16
|
+
Listing returns `bundled ∪ user`, with `source: "bundled" | "user" | "user-override"`. Editing a bundled entry is **copy-on-write** (materializes into user layer on save). Deleting bundled **tombstones** (restorable); deleting user-only removes the file.
|
|
17
|
+
|
|
18
|
+
## Bundled starter pack (14 templates)
|
|
19
|
+
|
|
20
|
+
### Named team (from nicho-apps)
|
|
21
|
+
|
|
22
|
+
| Slug | Role | Strength |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `roby-orchestrator` | Pipeline orchestrator | Autonomous task routing, multi-agent coordination |
|
|
25
|
+
| `arch-architect` | Software architect | System design, tradeoffs, ADRs |
|
|
26
|
+
| `cody-developer` | Senior Laravel dev | Code, refactors, technical leadership |
|
|
27
|
+
| `tessa-qa` | QA / beta tester | Reality checks, test plans, real-user empathy |
|
|
28
|
+
| `max-marketing` | Growth hacker | Content, campaigns, SEO, copy |
|
|
29
|
+
| `sid-security` | Security specialist | Audits, threat models, hardening |
|
|
30
|
+
| `rocky-pm` | Senior PM | Tasklists, roadmaps, stakeholder comms |
|
|
31
|
+
| `vera-ui` | UI/UX reviewer | Visual audits, usability (uses browser-use) |
|
|
32
|
+
| `finn-billing` | Billing / commercial ops | Stripe, invoicing, plan logic |
|
|
33
|
+
|
|
34
|
+
### Generic specialists (from PandaProject)
|
|
35
|
+
|
|
36
|
+
`development`, `marketing`, `ops`, `qa`, `support` — plain functional roles without a persona.
|
|
37
|
+
|
|
38
|
+
Bundled templates ship with `language: es` and **no `model:`** — they inherit the project/global default. Set a model on import or by editing the vault file.
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# List (bundled + overrides, tagged [bundled]/[user]/[override])
|
|
44
|
+
apx agent vault list
|
|
45
|
+
apx agent vault list --all # include tombstoned
|
|
46
|
+
|
|
47
|
+
# Create (writes ~/.apx/agents/<slug>.md)
|
|
48
|
+
apx agent vault add reviewer \
|
|
49
|
+
--role "Code reviewer" \
|
|
50
|
+
--model ollama:llama3.2:3b \
|
|
51
|
+
--language es \
|
|
52
|
+
--skills code-review,git \
|
|
53
|
+
--description "Reviews PRs and pushes back on hand-wavy diffs."
|
|
54
|
+
|
|
55
|
+
# Delete: user-only → physical delete; bundled → tombstone
|
|
56
|
+
apx agent vault rm tessa-qa
|
|
57
|
+
apx agent vault restore tessa-qa # un-tombstone
|
|
58
|
+
|
|
59
|
+
# Import into current project
|
|
60
|
+
apx agent import cody-developer
|
|
61
|
+
apx agent import tessa-qa --copy # copy into .apc/agents/ for local edits
|
|
62
|
+
apx agent import roby-orchestrator --force
|
|
63
|
+
|
|
64
|
+
# Daemon tool API equivalents:
|
|
65
|
+
list_vault_agents()
|
|
66
|
+
import_agent({ slug: "cody-developer", project: "<name-or-path>" })
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Web equivalents
|
|
70
|
+
|
|
71
|
+
Agent defaults tab (`/p/0/agent-defaults`): same CRUD — "New" (POST `/agents/vault`), per-card "Edit" (PATCH `/agents/vault/:slug`, copy-on-write for bundled), "Delete"/"Hide" (DELETE), "Show removed" toggle with "Restore" button.
|
|
72
|
+
|
|
73
|
+
## Which agent to use
|
|
74
|
+
|
|
75
|
+
- User says **"spawn/use Cody/Rocky/Tessa/Max/Arch/Sid/Vera/Roby/Finn"** → import that exact slug from named team.
|
|
76
|
+
- User wants **"developer"/"QA"/"marketing" without a persona** → use generics (`development`, `qa`, `marketing`, …).
|
|
77
|
+
- **Not in vault** → `apx agent vault add <slug>` for a new template, or `apx agent add <slug>` directly in a project for a one-off.
|
|
78
|
+
- **Fresh install** → bundled defaults are always present (no sync step); appear in `apx agent vault list` immediately.
|
|
79
|
+
|
|
80
|
+
## File locations
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
<APX repo>/assets/agent-vault-defaults/<slug>.md ← canonical bundle (committed)
|
|
84
|
+
~/.apx/agents/<slug>.md ← user vault (sync target)
|
|
85
|
+
<project>/.apc/agents/<slug>.md ← project-local copy (after import --copy)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Vault format = project agent format:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
---
|
|
92
|
+
role: <human-readable role>
|
|
93
|
+
model: <provider:model>
|
|
94
|
+
description: <short description shown in UI grid>
|
|
95
|
+
language: es
|
|
96
|
+
skills: a, b, c
|
|
97
|
+
tools: x, y
|
|
98
|
+
is_master: false
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
<markdown body — system prompt extension>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Frontmatter fields the runtime reads
|
|
105
|
+
|
|
106
|
+
| Field | Effect |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `role` | Shown in CLI/web; appears as "Role: …" in prompt. |
|
|
109
|
+
| `model` | Default model for engine routing. |
|
|
110
|
+
| `description` | Shown in `/agents/vault` and AgentDefaultsTab cards. |
|
|
111
|
+
| `language` | Adds "Default language: <code>" to system prompt. |
|
|
112
|
+
| `skills` | Per-agent skill names; bodies loaded by skill resolution. |
|
|
113
|
+
| `tools` | Tool hints; actual callable tools depend on invocation surface. |
|
|
114
|
+
| `is_master` | If true, marked master in project (badge + ordering). |
|
|
115
|
+
|
|
116
|
+
## Related skills
|
|
117
|
+
|
|
118
|
+
- **[apx-agent](../apx-agent/SKILL.md)** — per-project agent CRUD. Vault = library; this = workshop.
|
|
119
|
+
- **[apx-runtime](../apx-runtime/SKILL.md)** — delegating to external coding CLIs from inside an agent.
|
|
120
|
+
|
|
121
|
+
## Gotchas
|
|
122
|
+
|
|
123
|
+
- **Bundled defaults are always present** — no sync step. Removing tombstones; editing copies to user layer.
|
|
124
|
+
- Slug is `roby-orchestrator`, **not** `roby` — the APX super-agent persona is "Roby" via `~/.apx/identity.json`. A project agent called `roby` would shadow it.
|
|
125
|
+
- The `agency-agents` skill in `~/.claude/skills/` pulls from `msitarzewski/agency-agents` on GitHub. APX bundles a snapshot in `assets/agent-vault-defaults/` so installs are offline-first. To refresh upstream, edit the bundle and re-commit; user overrides are untouched.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apx-agent
|
|
3
|
+
description: Create, configure, use project agents in APX. Load when user wants to add an agent, import from vault, set a per-agent model, or write agent memory. Triggers: 'add agent', 'new agent', 'import agent', 'agent memory', 'per-agent model'.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# apx-agent
|
|
7
|
+
|
|
8
|
+
A project agent is a named persona inside an APC project. Definition: `.apc/agents/<slug>.md` (flat); `AGENTS.md` auto-regenerated for discovery. Runtime data (memory, conversations, sessions) under `~/.apx/projects/<apx_id>/agents/<slug>/`, never committed. Legacy `.apc/agents/<slug>/memory.md` still read as migration fallback.
|
|
9
|
+
|
|
10
|
+
## Concrete CLI calls
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# List (agent commands are cwd-scoped — run from project root)
|
|
14
|
+
apx agent list
|
|
15
|
+
|
|
16
|
+
# Create (writes .apc/agents/<slug>.md, creates runtime dir, regenerates AGENTS.md)
|
|
17
|
+
apx agent add reviewer \
|
|
18
|
+
--role "Code reviewer" \
|
|
19
|
+
--model ollama:llama3.2:3b \
|
|
20
|
+
--language es \
|
|
21
|
+
--description "Reviews PRs and pushes back on hand-wavy diffs." \
|
|
22
|
+
--tools read,write,run \
|
|
23
|
+
--skills code-review,git
|
|
24
|
+
|
|
25
|
+
# Import from global vault (~/.apx/agents/)
|
|
26
|
+
apx agent vault list # see what's available
|
|
27
|
+
apx agent import <slug> # register vault slug in this project
|
|
28
|
+
apx agent import <slug> --copy # copy vault .md into .apc/agents/ for local edits
|
|
29
|
+
apx agent import <slug> --force # overwrite existing local definition
|
|
30
|
+
|
|
31
|
+
# Show details (config + memory)
|
|
32
|
+
apx agent get <slug> # alias: apx agent show <slug>
|
|
33
|
+
|
|
34
|
+
# Per-agent memory (drives system prompt; cwd-scoped)
|
|
35
|
+
apx memory <slug> # read
|
|
36
|
+
apx memory <slug> --append "fact" # append under "## Recent context"
|
|
37
|
+
apx memory <slug> --replace < file.md # full replace from stdin
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Agent system prompt composition
|
|
41
|
+
|
|
42
|
+
`buildAgentSystem()` (`src/core/agent-system.js`) composes:
|
|
43
|
+
|
|
44
|
+
1. Identity: `You are <slug>` + project name.
|
|
45
|
+
2. Description (from AGENTS.md).
|
|
46
|
+
3. Role + Language fields.
|
|
47
|
+
4. Invocation context: `engine | telegram | routine | runtime` — the channel calling.
|
|
48
|
+
5. Memory: `~/.apx/projects/<apx_id>/agents/<slug>/memory.md` (legacy `.apc/agents/<slug>/memory.md` fallback).
|
|
49
|
+
6. Skills from agent's `Skills:` field, loaded from `.apc/skills/<slug>.md` or bundled set.
|
|
50
|
+
7. The `apx` meta-skill (so agent knows how to operate APX).
|
|
51
|
+
8. ACTION_DISCIPLINE_RULES (fixed footer — anti-ghost, anti-disclaimer, action-first).
|
|
52
|
+
|
|
53
|
+
That's the prompt on every `apx exec <agent>` / `apx chat <agent>`. The super-agent (default APX mode) uses a *different* prompt — see `apx-routine` for super-agent vs exec_agent.
|
|
54
|
+
|
|
55
|
+
## Per-agent models
|
|
56
|
+
|
|
57
|
+
Set `Model:` in `.apc/agents/<slug>.md` to override the global super-agent model. Leave empty to follow project/global default.
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# .apc/agents/reviewer.md
|
|
61
|
+
---
|
|
62
|
+
Role: Code reviewer
|
|
63
|
+
Model: ollama:llama3.2:3b ← independent of super_agent.model
|
|
64
|
+
Language: es
|
|
65
|
+
---
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A routine `kind: exec_agent` with `spec.agent: reviewer` uses that model.
|
|
69
|
+
|
|
70
|
+
## Anti-examples
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# DON'T hand-write .apc/agents/<slug>.md without regenerating AGENTS.md.
|
|
74
|
+
echo "..." > /path/.apc/agents/reviewer.md
|
|
75
|
+
# ↑ Use `apx agent add` or `apx agent import` so AGENTS.md stays consistent.
|
|
76
|
+
|
|
77
|
+
# DON'T set Model: to a provider without keys — fails on first call.
|
|
78
|
+
# DON'T put long-running context in `Description` (one line). Put it in memory.md.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Super-agent vs project agent
|
|
82
|
+
|
|
83
|
+
| Aspect | Super-agent (default APX) | Project agent |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| Has tools? | Yes (full registry) | No (text-in/text-out via callEngine) |
|
|
86
|
+
| Loop? | Multi-iteration tool loop | Single call |
|
|
87
|
+
| System prompt | `super-agent-base.md` + channel template + identity | `buildAgentSystem()` per-agent |
|
|
88
|
+
| Conversation in | super-agent surfaces | `<storagePath>/agents/<slug>/conversations/*.md` |
|
|
89
|
+
| Configured via | `super_agent.*` in config | `AGENTS.md` + per-agent files |
|
|
90
|
+
|
|
91
|
+
When in doubt: super-agent is APX itself; agents are personas inside a project.
|
|
92
|
+
|
|
93
|
+
## Don't
|
|
94
|
+
|
|
95
|
+
- Don't expect a project agent to call tools. It can't. For tools, use super-agent or call MCPs from a routine `kind: shell`.
|
|
96
|
+
- Don't overwrite `AGENTS.md` manually — `apx agent add/remove` regenerates it. Hand edits get clobbered.
|
|
97
|
+
- Don't use the same slug across projects expecting shared memory. Memory is per-project.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apx-mcp
|
|
3
|
+
description: Register, list, debug, scope MCP servers in APX. Load BEFORE adding any MCP — three scopes (shared/runtime/global) with different commit and secrecy semantics. Triggers: 'add MCP', 'apx mcp', 'MCP scope', 'MCP failing', 'list MCPs'.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# apx-mcp
|
|
7
|
+
|
|
8
|
+
APX exposes MCP servers via three scopes; resolution priority **runtime > shared > global**, conflicts via `apx mcp check`:
|
|
9
|
+
|
|
10
|
+
| Scope | File | Committed? | Secrets OK? | When |
|
|
11
|
+
|---|---|---|---|---|
|
|
12
|
+
| `shared` | `<repo>/.apc/mcps.json` | yes | **no** | Team-wide (filesystem, brave, github public) |
|
|
13
|
+
| `runtime` | `~/.apx/projects/<apxId>/mcps.json` (chmod 0600) | no | yes | Per-project — tokens, machine-specific endpoints |
|
|
14
|
+
| `global` | `~/.apx/mcps.json` | n/a | yes | Machine-wide, not tied to a project |
|
|
15
|
+
|
|
16
|
+
## Concrete CLI calls
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# List (defaults to all scopes)
|
|
20
|
+
apx mcp list --project iacrmar
|
|
21
|
+
apx mcp list --scope runtime --project iacrmar
|
|
22
|
+
apx mcp list --scope shared --project iacrmar
|
|
23
|
+
apx mcp list --scope global
|
|
24
|
+
|
|
25
|
+
# Inspect sources and conflicts
|
|
26
|
+
apx mcp check --project iacrmar
|
|
27
|
+
|
|
28
|
+
# Add — shared (commit to repo)
|
|
29
|
+
apx mcp add filesystem --command npx --project iacrmar \
|
|
30
|
+
-- -y @modelcontextprotocol/server-filesystem .
|
|
31
|
+
|
|
32
|
+
# Add — runtime (per-project, local, secrets safe)
|
|
33
|
+
apx mcp add github --scope runtime --project iacrmar \
|
|
34
|
+
--command npx --env GITHUB_TOKEN=ghp_xxx \
|
|
35
|
+
-- -y @modelcontextprotocol/server-github
|
|
36
|
+
|
|
37
|
+
# Add — global (machine-wide)
|
|
38
|
+
apx mcp add brave --scope global \
|
|
39
|
+
--command npx --env BRAVE_API_KEY=BSAxxx \
|
|
40
|
+
-- -y @modelcontextprotocol/server-brave-search
|
|
41
|
+
|
|
42
|
+
# Remove (pass --scope when not in default: shared inside APC project, else global)
|
|
43
|
+
apx mcp remove filesystem --project iacrmar
|
|
44
|
+
apx mcp remove github --scope runtime --project iacrmar
|
|
45
|
+
|
|
46
|
+
# Toggle (defaults to owning scope)
|
|
47
|
+
apx mcp enable filesystem --project iacrmar
|
|
48
|
+
apx mcp disable filesystem --project iacrmar
|
|
49
|
+
|
|
50
|
+
# Call a tool through the daemon (debugging)
|
|
51
|
+
apx mcp run filesystem read_file '{"path":"README.md"}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Scope decision tree
|
|
55
|
+
|
|
56
|
+
1. **Has secrets/tokens?** → `runtime`. Always.
|
|
57
|
+
2. **Part of project's shared dev environment?** → `shared` (committed).
|
|
58
|
+
3. **Used across all your projects?** → `global`.
|
|
59
|
+
|
|
60
|
+
Default if unclear: `shared` inside an APC project, `global` outside.
|
|
61
|
+
|
|
62
|
+
## Command shapes by transport
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# stdio MCP (most common — npx, uvx, node, python)
|
|
66
|
+
apx mcp add <name> --command npx -- -y <package-or-flag-list>
|
|
67
|
+
apx mcp add <name> --command uvx -- <python-cli-name>
|
|
68
|
+
apx mcp add <name> --command python -- /abs/path/to/server.py
|
|
69
|
+
|
|
70
|
+
# Env vars (one --env per var)
|
|
71
|
+
apx mcp add <name> --command npx \
|
|
72
|
+
--env GITHUB_TOKEN=ghp_xxx \
|
|
73
|
+
--env GITHUB_OWNER=manuel \
|
|
74
|
+
-- -y @modelcontextprotocol/server-github
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Everything after `--` is forwarded verbatim as args. Quote carefully.
|
|
78
|
+
|
|
79
|
+
## Anti-examples
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# DON'T put tokens in shared scope — it commits.
|
|
83
|
+
apx mcp add github --scope shared --env GITHUB_TOKEN=ghp_xxx ...
|
|
84
|
+
# ↑ Token ends up in .apc/mcps.json in your repo. Use --scope runtime.
|
|
85
|
+
|
|
86
|
+
# DON'T remove from the wrong scope — daemon returns 409 with the right scope.
|
|
87
|
+
apx mcp remove github # errors if github lives in runtime
|
|
88
|
+
|
|
89
|
+
# DON'T expect IDE-foreign configs (~/.cursor/mcps.json, ~/.claude/mcps.json)
|
|
90
|
+
# to be removable via apx mcp remove. APX reads them advisory (source=cursor/claude)
|
|
91
|
+
# but won't write them. Edit the IDE config directly.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Debugging
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
apx mcp check --project iacrmar # scopes seen + which files exist
|
|
98
|
+
apx mcp run <name> <tool> '{...}' # spawn server, call a tool
|
|
99
|
+
apx log -f # tail unified log for spawn errors
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
"Doesn't show tools" = command failed to start (missing env vars, package not found) or crashed during initialize. Unified log holds the stderr buffer.
|
|
103
|
+
|
|
104
|
+
> `apx mcp tools <name>` is a placeholder stub ("coming in v0.2"). Use `apx mcp run` to verify spawn.
|
|
105
|
+
|
|
106
|
+
## Don't
|
|
107
|
+
|
|
108
|
+
- Don't mix scopes for the same MCP name unless you want shadowing — highest priority wins, others stay invisible.
|
|
109
|
+
- Don't edit `~/.apx/projects/<id>/mcps.json` by hand; use `apx mcp add --scope runtime` (the file is chmod 0600 — CLI preserves it).
|
|
110
|
+
- Don't put tokens via `--env KEY=` inline if shell history is public. Set them in your shell first, then `--env KEY=$KEY`.
|
|
111
|
+
- Don't forget to `apx daemon reload` after hand-editing JSON. `apx mcp` does this for you.
|