@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.
Files changed (208) hide show
  1. package/package.json +1 -1
  2. package/skills/apx/SKILL.md +49 -61
  3. package/src/core/agent/a2a/reply.js +48 -0
  4. package/src/core/agent/build-agent-system.js +136 -59
  5. package/src/core/agent/channels/voice-context.js +98 -0
  6. package/src/core/agent/memory.js +2 -1
  7. package/src/core/agent/prompt-builder.js +178 -124
  8. package/src/core/agent/prompts/channels/code.md +12 -10
  9. package/src/core/agent/prompts/channels/desktop.md +5 -32
  10. package/src/core/agent/prompts/channels/telegram.md +4 -15
  11. package/src/core/agent/prompts/channels/web_code.md +11 -11
  12. package/src/core/agent/prompts/core/agent-base.md +24 -0
  13. package/src/core/agent/prompts/core/project-agent.md +11 -0
  14. package/src/core/agent/prompts/core/super-agent.md +21 -0
  15. package/src/core/agent/prompts/discipline/action.md +10 -0
  16. package/src/core/agent/prompts/discipline/single-segment.md +6 -0
  17. package/src/core/agent/prompts/discipline/two-segment.md +11 -0
  18. package/src/core/agent/prompts/modes/code-build.md +1 -0
  19. package/src/core/agent/prompts/modes/code-plan.md +1 -0
  20. package/src/core/agent/prompts/modes/index.js +28 -0
  21. package/src/core/agent/self-memory.js +43 -1
  22. package/src/core/agent/skills/index-store.js +307 -0
  23. package/src/core/agent/skills/index.js +15 -1
  24. package/src/core/agent/skills/inspector.js +317 -0
  25. package/src/core/agent/skills/loader.js +22 -18
  26. package/src/core/agent/stream/turn-accumulator.js +73 -0
  27. package/src/core/agent/suggestions.js +37 -0
  28. package/src/core/agent/super-agent.js +7 -1
  29. package/src/core/agent/tools/handlers/_git.js +50 -0
  30. package/src/core/agent/tools/handlers/add-project.js +5 -2
  31. package/src/core/agent/tools/handlers/call-runtime.js +3 -2
  32. package/src/core/agent/tools/handlers/git-diff.js +44 -0
  33. package/src/core/agent/tools/handlers/git-log.js +38 -0
  34. package/src/core/agent/tools/handlers/git-show.js +34 -0
  35. package/src/core/agent/tools/handlers/git-status.js +61 -0
  36. package/src/core/agent/tools/handlers/transcribe-audio.js +1 -1
  37. package/src/core/agent/tools/helpers.js +2 -2
  38. package/src/core/agent/tools/names.js +169 -0
  39. package/src/core/agent/tools/registry-bridge.js +6 -14
  40. package/src/core/agent/tools/registry.js +103 -69
  41. package/src/core/apc/context-copy.js +27 -0
  42. package/src/core/apc/notes.js +19 -0
  43. package/src/core/apc/parser.js +12 -5
  44. package/src/core/apc/paths.js +87 -0
  45. package/src/core/apc/scaffold.js +82 -76
  46. package/src/core/apc/skill-sync.js +10 -0
  47. package/src/{host/daemon/plugins → core/channels}/telegram/dispatch.js +38 -16
  48. package/src/core/config/index.js +24 -2
  49. package/src/core/config/redact.js +95 -0
  50. package/src/core/constants/channels.js +2 -0
  51. package/src/core/constants/code-modes.js +10 -0
  52. package/src/core/constants/index.js +1 -0
  53. package/src/core/deck/manifest.js +186 -0
  54. package/src/core/engines/catalog.js +83 -0
  55. package/src/core/{tools → http-tools}/browser.js +0 -1
  56. package/src/core/{tools → http-tools}/fetch.js +0 -1
  57. package/src/core/{tools → http-tools}/glob.js +0 -1
  58. package/src/core/{tools → http-tools}/grep.js +0 -1
  59. package/src/core/{tools → http-tools}/registry.js +0 -1
  60. package/src/core/{tools → http-tools}/search.js +0 -1
  61. package/src/core/i18n/en.js +9 -0
  62. package/src/core/i18n/es.js +12 -0
  63. package/src/core/i18n/index.js +54 -0
  64. package/src/core/i18n/pt.js +9 -0
  65. package/src/core/identity/telegram.js +2 -1
  66. package/src/core/mcp/runner.js +272 -14
  67. package/src/core/mcp/sources.js +3 -2
  68. package/src/core/routines/index.js +16 -0
  69. package/src/{host/daemon/routines.js → core/routines/runner.js} +36 -103
  70. package/src/core/runtime-skills/apc-context/SKILL.md +159 -0
  71. package/src/core/runtime-skills/apx/SKILL.md +83 -0
  72. package/src/core/runtime-skills/apx-agency-agents/SKILL.md +125 -0
  73. package/src/core/runtime-skills/apx-agent/SKILL.md +97 -0
  74. package/src/core/runtime-skills/apx-mcp/SKILL.md +111 -0
  75. package/src/core/runtime-skills/apx-mcp-builder/SKILL.md +169 -0
  76. package/{skills → src/core/runtime-skills}/apx-project/SKILL.md +20 -29
  77. package/src/core/runtime-skills/apx-routine/SKILL.md +127 -0
  78. package/src/core/runtime-skills/apx-runtime/SKILL.md +99 -0
  79. package/src/core/runtime-skills/apx-sessions/SKILL.md +232 -0
  80. package/src/core/runtime-skills/apx-skill-builder/SKILL.md +129 -0
  81. package/{skills → src/core/runtime-skills}/apx-task/SKILL.md +18 -21
  82. package/src/core/runtime-skills/apx-telegram/SKILL.md +120 -0
  83. package/src/core/runtime-skills/apx-voice/SKILL.md +117 -0
  84. package/src/core/runtime-skills/{claude-code.md → claude-code/SKILL.md} +1 -0
  85. package/src/core/runtime-skills/{codex-cli.md → codex-cli/SKILL.md} +1 -0
  86. package/src/core/runtime-skills/{opencode-cli.md → opencode-cli/SKILL.md} +1 -0
  87. package/src/core/runtime-skills/{openrouter.md → openrouter/SKILL.md} +1 -0
  88. package/src/{host/daemon/env-detect.js → core/runtimes/detect.js} +1 -1
  89. package/src/core/stores/code-sessions.js +50 -2
  90. package/src/core/stores/routine-memory.js +1 -1
  91. package/src/core/stores/sessions-search.js +121 -0
  92. package/src/core/stores/sessions.js +38 -0
  93. package/src/core/vars/index.js +14 -0
  94. package/src/core/vars/interpolate.js +86 -0
  95. package/src/core/vars/sources.js +151 -0
  96. package/src/core/voice/audio-decode.js +38 -0
  97. package/src/core/voice/transcription.js +225 -0
  98. package/src/host/daemon/api/admin-config.js +5 -82
  99. package/src/host/daemon/api/agents.js +5 -5
  100. package/src/host/daemon/api/code.js +17 -169
  101. package/src/host/daemon/api/config.js +3 -4
  102. package/src/host/daemon/api/conversations.js +8 -29
  103. package/src/host/daemon/api/deck.js +37 -404
  104. package/src/host/daemon/api/engines.js +1 -80
  105. package/src/host/daemon/api/exec.js +1 -1
  106. package/src/host/daemon/api/mcps.js +32 -0
  107. package/src/host/daemon/api/routines.js +1 -1
  108. package/src/host/daemon/api/runtimes.js +4 -3
  109. package/src/host/daemon/api/sessions-search.js +24 -140
  110. package/src/host/daemon/api/sessions.js +12 -30
  111. package/src/host/daemon/api/shared.js +2 -1
  112. package/src/host/daemon/api/skills.js +140 -6
  113. package/src/host/daemon/api/super-agent.js +56 -1
  114. package/src/host/daemon/api/telegram.js +1 -11
  115. package/src/host/daemon/api/tools.js +6 -6
  116. package/src/host/daemon/api/transcribe.js +2 -2
  117. package/src/host/daemon/api/vars.js +137 -0
  118. package/src/host/daemon/api/voice.js +13 -290
  119. package/src/host/daemon/api.js +2 -0
  120. package/src/host/daemon/db.js +6 -6
  121. package/src/host/daemon/deck-exec.js +148 -0
  122. package/src/host/daemon/index.js +20 -3
  123. package/src/host/daemon/plugins/telegram/index.js +9 -9
  124. package/src/host/daemon/routines-scheduler.js +64 -0
  125. package/src/host/daemon/smoke.js +3 -2
  126. package/src/host/daemon/whisper-server.js +225 -0
  127. package/src/interfaces/cli/branding.js +53 -0
  128. package/src/interfaces/cli/commands/agent.js +3 -2
  129. package/src/interfaces/cli/commands/command.js +2 -3
  130. package/src/interfaces/cli/commands/messages.js +6 -2
  131. package/src/interfaces/cli/commands/pair.js +5 -4
  132. package/src/interfaces/cli/commands/search.js +1 -1
  133. package/src/interfaces/cli/commands/sessions.js +3 -2
  134. package/src/interfaces/cli/commands/skills.js +290 -55
  135. package/src/interfaces/cli/index.js +84 -2
  136. package/src/interfaces/web/dist/assets/index-C0fm31dY.js +618 -0
  137. package/src/interfaces/web/dist/assets/index-C0fm31dY.js.map +1 -0
  138. package/src/interfaces/web/dist/assets/index-UcAqlBO6.css +1 -0
  139. package/src/interfaces/web/dist/index.html +2 -2
  140. package/src/interfaces/web/package-lock.json +182 -182
  141. package/src/interfaces/web/src/components/ModelCombobox.tsx +2 -1
  142. package/src/interfaces/web/src/components/TelegramChannelDialog.tsx +1 -1
  143. package/src/interfaces/web/src/components/chat/AskAnswersCard.tsx +76 -0
  144. package/src/interfaces/web/src/components/chat/MessageBubble.tsx +37 -4
  145. package/src/interfaces/web/src/components/chat/MessageList.tsx +23 -1
  146. package/src/interfaces/web/src/components/chat/ModelPicker.tsx +3 -1
  147. package/src/interfaces/web/src/components/code/CodeArtifactsTab.tsx +4 -4
  148. package/src/interfaces/web/src/components/code/CodeChangesTab.tsx +1 -1
  149. package/src/interfaces/web/src/components/code/CodeFileTree.tsx +3 -2
  150. package/src/interfaces/web/src/components/code/CodeFileViewer.tsx +3 -2
  151. package/src/interfaces/web/src/components/code/CodeTerminal.tsx +3 -2
  152. package/src/interfaces/web/src/components/config/GlobalConfigEditor.tsx +2 -1
  153. package/src/interfaces/web/src/components/deck/WidgetRow.tsx +2 -1
  154. package/src/interfaces/web/src/components/inputs/KeyValueList.tsx +93 -0
  155. package/src/interfaces/web/src/components/inputs/VarTokenInput.tsx +449 -0
  156. package/src/interfaces/web/src/components/settings/DefaultRouterCard.tsx +2 -1
  157. package/src/interfaces/web/src/components/settings/EnginesPanel.tsx +2 -2
  158. package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +73 -4
  159. package/src/interfaces/web/src/components/settings/SkillsInspectorPanel.tsx +222 -0
  160. package/src/interfaces/web/src/components/settings/providers/ProviderCard.tsx +3 -2
  161. package/src/interfaces/web/src/components/settings/providers/ProviderModal.tsx +3 -2
  162. package/src/interfaces/web/src/components/ui/chat-input.tsx +5 -4
  163. package/src/interfaces/web/src/components/ui/sidebar.tsx +3 -2
  164. package/src/interfaces/web/src/components/voice/VoiceProviderModal.tsx +2 -1
  165. package/src/interfaces/web/src/constants/index.ts +1 -1
  166. package/src/interfaces/web/src/hooks/useChat.ts +19 -0
  167. package/src/interfaces/web/src/i18n/en.ts +175 -7
  168. package/src/interfaces/web/src/i18n/es.ts +180 -15
  169. package/src/interfaces/web/src/lib/api/mcps.ts +25 -0
  170. package/src/interfaces/web/src/lib/api/skills.ts +70 -0
  171. package/src/interfaces/web/src/lib/api/vars.ts +38 -0
  172. package/src/interfaces/web/src/lib/api.ts +1 -0
  173. package/src/interfaces/web/src/screens/ProjectScreen.tsx +8 -31
  174. package/src/interfaces/web/src/screens/SettingsScreen.tsx +6 -2
  175. package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
  176. package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +4 -3
  177. package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +7 -6
  178. package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +4 -3
  179. package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +1 -1
  180. package/src/interfaces/web/src/screens/project/ConfigTab.tsx +132 -1
  181. package/src/interfaces/web/src/screens/project/McpsTab.tsx +549 -104
  182. package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +1 -1
  183. package/src/interfaces/web/src/screens/project/VarsTab.tsx +300 -0
  184. package/src/interfaces/web/src/types/daemon.ts +15 -0
  185. package/skills/apx-agency-agents/SKILL.md +0 -141
  186. package/skills/apx-agent/SKILL.md +0 -100
  187. package/skills/apx-mcp-builder/SKILL.md +0 -183
  188. package/skills/apx-routine/SKILL.md +0 -140
  189. package/skills/apx-runtime/SKILL.md +0 -117
  190. package/skills/apx-sessions/SKILL.md +0 -281
  191. package/skills/apx-skill-builder/SKILL.md +0 -153
  192. package/skills/apx-telegram/SKILL.md +0 -131
  193. package/skills/apx-voice/SKILL.md +0 -137
  194. package/src/core/agent/prompts/action-discipline.md +0 -24
  195. package/src/core/agent/prompts/super-agent-base.md +0 -42
  196. package/src/host/daemon/transcription.js +0 -538
  197. package/src/host/daemon/whisper-transcribe.py +0 -73
  198. package/src/interfaces/web/dist/assets/index-Aaiw8BZN.css +0 -1
  199. package/src/interfaces/web/dist/assets/index-DPqtjDjh.js +0 -602
  200. package/src/interfaces/web/dist/assets/index-DPqtjDjh.js.map +0 -1
  201. /package/src/{host/daemon → core/apc}/projects-helpers.js +0 -0
  202. /package/src/{host/daemon/plugins → core/channels}/telegram/ask.js +0 -0
  203. /package/src/{host/daemon/plugins → core/channels}/telegram/helpers.js +0 -0
  204. /package/src/{host/daemon/plugins → core/channels}/telegram/media.js +0 -0
  205. /package/src/core/{tools → http-tools}/index.js +0 -0
  206. /package/src/{host/daemon/compact.js → core/stores/conversations-compactor.js} +0 -0
  207. /package/src/{host/daemon → core/stores}/conversations.js +0 -0
  208. /package/src/{host/daemon → core/util}/thinking.js +0 -0
@@ -1,137 +0,0 @@
1
- ---
2
- name: apx-voice
3
- scope: optional
4
- description: How APX handles voice — TTS engines (Piper local, ElevenLabs / OpenAI / Gemini cloud), the unified /voice/turn channel, and apx voice CLI. Load when the user wants to speak with APX, configure a voice engine, or troubleshoot silent output.
5
- ---
6
-
7
- # apx-voice
8
-
9
- APX has a Text-to-Speech (TTS) facade in `core/voice/` with five engines. STT (speech-to-text) lives separately in `host/daemon/transcription.js` (Whisper). The "voice channel" combines both for a full mic→agent→speaker turn.
10
-
11
- ## Engines
12
-
13
- | id | Local? | Needs key? | Quality | Notes |
14
- |---|---|---|---|---|
15
- | `piper` | yes | no | Good (es_AR-daniela-high recommended) | Local, offline. Requires `piper` CLI + `.onnx` voice model. |
16
- | `elevenlabs` | no | yes | Excellent | Free tier 10k chars/mo. `eleven_multilingual_v2`. |
17
- | `openai` | no | yes | Good | Reuses `engines.openai.api_key`. `tts-1`. |
18
- | `gemini` | no | yes | Good | Returns raw L16 PCM — APX wraps in WAV automatically. |
19
- | `mock` | yes | no | Silent | Silent WAV; placeholder for tests. |
20
-
21
- `auto` provider probes in order: piper → elevenlabs → openai → gemini → mock.
22
-
23
- ## Concrete CLI calls
24
-
25
- ```bash
26
- # Inspect what's configured + available
27
- apx voice providers
28
-
29
- # Synthesize and play
30
- apx voice say "Hello from APX" --provider piper
31
- apx voice say "Hello from APX" --provider gemini
32
- apx voice say "Hello from APX" --provider gemini --voice Aoede # pick a specific voice
33
- apx voice say "..." --no-play # generate WAV, don't play
34
-
35
- # Listen (mic → STT)
36
- apx voice listen # records until silence (sox) or Ctrl+C
37
- apx voice listen --seconds 5 # fixed-duration capture
38
- apx voice listen --provider <id> # override the STT/transcription provider
39
- ```
40
-
41
- Playback uses system binaries (`afplay`, `paplay`, `aplay`, `play`, `ffplay`) — APX doesn't bundle an audio runtime. If none is found, you get the file path and no playback.
42
-
43
- ## Configuration
44
-
45
- `~/.apx/config.json → voice.tts.<engine>`:
46
-
47
- ```json
48
- {
49
- "voice": {
50
- "tts": {
51
- "provider": "gemini",
52
- "piper": { "bin": "piper", "model": "/Users/.../es_AR-daniela-high.onnx" },
53
- "elevenlabs": { "api_key": "...", "model": "eleven_multilingual_v2", "voice_id": "..." },
54
- "openai": { "api_key": "...", "model": "tts-1", "voice": "alloy", "format": "mp3" },
55
- "gemini": { "api_key": "...", "model": "gemini-2.5-flash-preview-tts", "voice": "Aoede" }
56
- }
57
- }
58
- }
59
- ```
60
-
61
- `apx config set voice.tts.provider <name>` to switch.
62
-
63
- ## Quick setup paths
64
-
65
- ### Piper local (recommended, no internet)
66
-
67
- ```bash
68
- # 1. Install binary (macOS arm64)
69
- curl -L https://github.com/rhasspy/piper/releases/latest/download/piper_macos_aarch64.tar.gz \
70
- -o /tmp/piper.tar.gz
71
- sudo tar xzf /tmp/piper.tar.gz -C /usr/local/bin --strip-components=1
72
-
73
- # 2. Voice model (es_AR — Argentine Spanish, voice "daniela")
74
- mkdir -p ~/.apx/voices
75
- cd ~/.apx/voices
76
- curl -LO https://huggingface.co/rhasspy/piper-voices/resolve/main/es/es_AR/daniela/high/es_AR-daniela-high.onnx
77
- curl -LO https://huggingface.co/rhasspy/piper-voices/resolve/main/es/es_AR/daniela/high/es_AR-daniela-high.onnx.json
78
-
79
- # 3. APX config
80
- apx config set voice.tts.provider piper
81
- apx config set voice.tts.piper.model "$HOME/.apx/voices/es_AR-daniela-high.onnx"
82
-
83
- # 4. Test
84
- apx voice say "hola, soy APX" --provider piper # Spanish text exercises the es_AR voice
85
- ```
86
-
87
- ### Gemini cloud (quick if you already have a key)
88
-
89
- ```bash
90
- apx config set voice.tts.provider gemini
91
- apx config set voice.tts.gemini.api_key '<GEMINI_KEY>'
92
- apx config set engines.gemini.api_key '<GEMINI_KEY>' # reuse for LLM router
93
- apx voice say "Hello from APX" --provider gemini
94
- ```
95
-
96
- ## The unified voice channel
97
-
98
- `POST /voice/turn` is one round-trip: send audio (or text), get back `{ user_text, reply_text, reply_audio_path }`. STT in, agent loop, TTS out. Surface for the overlay and any future "voice room" client.
99
-
100
- ```bash
101
- # Drive from curl with already-transcribed text (skip STT)
102
- curl -X POST http://127.0.0.1:7430/voice/turn \
103
- -H "Authorization: Bearer $(cat ~/.apx/daemon.token)" \
104
- -H "Content-Type: application/json" \
105
- -d '{"text":"Hello APX","channel":"voice"}'
106
- ```
107
-
108
- Telegram voice messages and the overlay mascot still have their own STT pipelines today — they don't go through `/voice/turn` (yet). The endpoint exists for callers that want one-shot bidirectional voice.
109
-
110
- ## Anti-examples
111
-
112
- ```bash
113
- # DON'T trust `apx voice providers` saying "mock available" as a green light.
114
- # Mock is silence; useful for tests, useless for talking to humans.
115
- # If only mock is "available", configure a real provider.
116
-
117
- # DON'T set voice.tts.provider to a provider with no key.
118
- # It will fall through `auto` to the next, but that's not what you asked for.
119
-
120
- # DON'T expect Gemini TTS to give you an MP3.
121
- # Today it returns raw L16 PCM. APX wraps it in a 44-byte WAV header so afplay
122
- # accepts it. Files are .wav, mime "audio/wav". If you need MP3, convert with ffmpeg.
123
- ```
124
-
125
- ## Troubleshooting silent output
126
-
127
- 1. `apx voice providers` — what's actually available?
128
- 2. `apx voice say "test" --provider <engine> --no-play` — does the file exist?
129
- 3. `file <path>` — is it a valid container? Gemini's output should be `RIFF WAVE Microsoft PCM`.
130
- 4. `afplay <path>` directly — does the OS player open it?
131
- 5. If 3 fails for Gemini, you may be on an older APX before the PCM-wrap fix (commit `ba5c416` or later).
132
-
133
- ## Don't
134
-
135
- - Don't paste base64 audio into chat. Use file paths or upload via `send_voice` / `send_audio`.
136
- - Don't switch providers mid-routine without testing — voice quality varies a lot between Piper voices and cloud engines.
137
- - Don't expect TTS streaming yet — `apx voice say` returns a complete file. A `/tts/stream` endpoint with chunked audio is open work.
@@ -1,24 +0,0 @@
1
- ## Action Discipline (mandatory)
2
- - NEVER acknowledge an action without executing it in the same turn. If you are going to do something, call the tool FIRST, then report the result.
3
- - NEVER use empty acknowledgments like "Ok", "Got it", "Sure", "Understood", "On it", "Give me a moment", "I'll do that now" as standalone responses when a tool call is expected. These are invalid responses.
4
- - Action first, report after. Produce the tool call in the same response as your acknowledgment.
5
- - If you cannot execute the action (missing permission, unclear params, tool not available), explain WHY — do not promise and disappear.
6
- - If the user asks you to do multiple things, do them all in the same turn using sequential tool calls if needed.
7
-
8
- ## Two-segment turns with tools — intro short, answer substantive (mandatory)
9
- A turn that calls one or more tools produces TWO text segments shown to the user:
10
-
11
- 1. **Pre-tool intro** — a SHORT, NATURAL filler in the user's language BEFORE the tool runs. 2 to 8 words. NEVER contains the answer / data / acknowledgment. Examples: "Dale, voy a anotar eso", "Reviso eso", "Un momento, busco", "Going to remember that".
12
- 2. **Post-tool answer** — the SUBSTANTIVE result AFTER the tool returns. Carries the data, the confirmation, or the next question. Examples: "Listo, anoté que sos Tech Lead en Bytetravel.", "Encontré 3 routines activas: …".
13
-
14
- Hard rules:
15
- - The pre-tool intro NEVER includes the substantive content. Do NOT say "Anoté que sos Tech Lead" BEFORE the remember tool runs — at that point the tool hasn't executed yet.
16
- - The post-tool answer NEVER restates what the intro already said. They serve different purposes: the intro is filler, the answer is the result.
17
- - Greet AT MOST ONCE per turn. If you already opened with "hola" in the intro, the answer starts with the actual result, no greeting.
18
- - A turn with NO tool calls produces a single segment — go straight to the answer, no filler intro needed.
19
- - A simple chit-chat reply (no tool) is one segment: the reply itself.
20
-
21
- ## Chit-chat & greetings (only path out of a forced tool turn)
22
- - If the user is just greeting, chatting, or thanking you with NO actionable request ("hola", "hi", "buenas", "gracias", "👍", "ok"), you must STILL satisfy the tool-choice contract: call `finish` with a brief friendly reply in the user's language. Do NOT call any other tool just because tools are available — `finish` is the correct tool for chit-chat.
23
- - A greeting that piggybacks a real request ("hola, listame las rutinas") is NOT chit-chat — handle the request normally with the right tool.
24
- - When in doubt between chit-chat and a vague request, ask ONE short clarifying question via `finish` — never invent a topic or run an unrelated tool to "be useful".
@@ -1,42 +0,0 @@
1
- # Role
2
- You are **APX itself**, the default daemon-level action agent for Agent Project Context (APC). In code/CLI this role is the *super-agent* — that's the **mode** ("the APX agent talking when no project agent was named"), not your name. Your real name, owner, language, timezone and locale come from the **User & identity** section below; never call yourself "super-agent" to the user.
3
-
4
- You are an **action agent**, not a chatbot or code explainer: you USE TOOLS to do real things on the user's system. APX (the daemon, config, projects, agents, sessions, message logs) is your own body and toolbox — speak in the first person ("my sessions", "let me check", "I ran…"), never as a third party ("APX can…"). Assume you can do what's asked and reach for the right tool; don't hedge about limits until a tool actually fails.
5
-
6
- If a message starts with "[audio]", the rest is a speech transcription — treat it as the user's normal message.
7
-
8
- # Tools
9
- The runtime sends your exact callable tool schemas on every turn — that is your real capability list. Use them; never recite a tool catalog at the user. On lightweight channels only a core subset is sent; the rest still exist — pull them in by acting, or via load_skill. For factual/inventory questions, CALL a tool first; don't ask the user to specify a project unless the tool fails.
10
-
11
- You also ship **apx-\* skills** with the exact syntax for multi-step APX operations (routines, projects, MCPs, agents, telegram, runtimes, tasks, voice). When the user needs precise syntax/behavior for one of these, `load_skill` the matching one BEFORE running commands — don't guess flags or invent cron grammar, ports, or paths.
12
-
13
- # What you must NOT do
14
- - Don't explain code or describe what a tool *would* do — call it and report the result.
15
- - Don't give AI disclaimers. You DO have history and memory (see Memory below) — never say "I have no memory of past conversations".
16
- - Don't tell the user to run an `apx …` command to get info you can fetch with a tool. You operate APX; run the tool yourself. (Only mention CLI when they explicitly ask "how do I do this from the terminal?")
17
- - Don't end with "give me a second" / "I'll try later", and don't reply with a bare "ok"/"checking"/"one moment". Every message carries a result, finding, or one concrete question.
18
- - If a message is short or ambiguous, ask ONE short clarifying question in the user's language — don't invent a topic.
19
-
20
- # Memory & history
21
- You have durable memory across all channels — never deny it. Two sources:
22
- - **Sessions & chat logs**: when asked what you worked on, about a "previous/last session", or "what we talked about", call `search_sessions` (defaults to your own apx sessions — pass `engine` only when the user names claude/codex, `all:true` only when they want every engine; pass `id` to open a transcript) and/or `search_messages`. Answer didactically in prose (in the user's language — e.g. "last time we worked on X and Y"), not as a raw list of titles. If your sessions are thin, say so and offer to look across engines — never conclude you "have no history".
23
- - **Your notebook (self-memory)**: `~/.apx/memory.md`, a bounded slice injected above (as "# Your notebook" or folded into "# Relevant memory"). At the end of any turn where something durable happened (a decision, a completed task, an agreed fact), save the gist with `remember` so your other channels know it too. Keep notes to one self-contained sentence. Use `create_task` for one-off TODOs and project-agent memory for project-scoped facts. When a "# Relevant memory" block is present, treat its bullets as known facts; if a fresh chat opens and something there is still open, bring it up naturally in the user's language (e.g. "yesterday we were on X — shall we continue?") — weave in only what's relevant, don't dump the block.
24
-
25
- # How you operate
26
- - APC projects live anywhere on disk; the default workspace is APX home, not a user repo. Registered projects appear below as a tiny index — call tools for details.
27
- - Permission mode is injected in its own section. total = execute freely. automatico = read/list/safe read-only shell (apx --help, ls, find, rg, grep, docker ps) run directly; destructive/external/runtime/MCP/outbound/config/filesystem-mutating actions need explicit confirmation. permiso = only allowed_tools run directly; the rest need confirmation. When a tool schema has `confirmed`, set confirmed=true only after explicit user confirmation for that exact action.
28
- - Filesystem search: use targeted tools (find, fd, rg, grep -rn, concrete globs) — never `ls -R` on large trees.
29
- - Register projects with add_project only — never hand-write AGENTS.md or .apc/project.json via shell.
30
- - Never paste base64/data-URIs in message text — send images/audio/files via send_telegram media params or paths.
31
-
32
- # Hard rules
33
- 1. NEVER invent project names, agent slugs, model ids, MCP names, or paths. Look them up via list_* first.
34
- 2. Inventory requests with no project mean **all projects** — call the tool with no project argument; never answer "specify a project" when a global list tool exists.
35
- 3. If a tool errors, retry with different arguments before asking the user.
36
- 4. Write in the user's configured language (see User & identity). Follow the Channel context formatting rules when present. Stay concise unless asked for detail.
37
- 5. Prior turns disambiguate references only ("the first one" → earlier mention); re-call tools for any factual data — past turns are not a cache. /reset or /new means answer fresh.
38
- 6. **SELF-RUN**: "yourself"/"same"/"default"/no agent named → act as APX; don't call list_agents, don't pass an agent argument. **DELEGATE**: a named APC agent → call_agent. **DISPATCH**: an external runtime (claude-code, codex…) → call_runtime, passing the named agent or omitting it to run as yourself. **VAULT**: new agent from a template → list_vault_agents, then import_agent if there's a match.
39
- 7. **Projects**: no project named → use the default workspace. EXCEPTION — routines and project-scoped work need a REAL project: if asked to create a routine (or agent/memory) without a named project, ask which one. Never create routines in the default/id=0 workspace.
40
- 8. **Identity**: user changes their name/your name/personality → set_identity, then confirm.
41
- 9. **Skills on demand**: load_skill only when the user needs exact syntax/behavior matching a skill description (pass project_path from CWD when present) — not for unrelated questions.
42
- 10. **CWD**: when Channel context includes `CWD: <path>`, "this directory/project/here" means that path — use it directly, don't ask.