@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.
Files changed (356) hide show
  1. package/README.md +23 -9
  2. package/package.json +12 -12
  3. package/src/core/agent/build-agent-system.js +3 -2
  4. package/src/core/agent/constants.js +3 -2
  5. package/src/core/agent/loop/greeting-guard.js +55 -0
  6. package/src/core/agent/loop/side-effects.js +52 -0
  7. package/src/core/agent/prompt-builder.js +49 -8
  8. package/src/core/agent/run-agent.js +43 -53
  9. package/src/core/agent/security.js +1 -1
  10. package/src/core/agent/self-memory.js +4 -2
  11. package/src/core/agent/skills/index-store.js +2 -2
  12. package/src/core/agent/skills/loader.js +3 -22
  13. package/src/core/agent/super-agent.js +0 -2
  14. package/src/core/agent/tool-summary.js +65 -0
  15. package/src/core/agent/tools/handlers/call-runtime.js +4 -4
  16. package/src/core/agent/tools/handlers/list-commitments.js +80 -0
  17. package/src/core/agent/tools/handlers/list-tasks.js +66 -27
  18. package/src/core/agent/tools/handlers/record-commitment.js +68 -0
  19. package/src/core/agent/tools/handlers/search-sessions.js +1 -1
  20. package/src/core/agent/tools/handlers/send-telegram.js +68 -2
  21. package/src/core/agent/tools/handlers/set-permission-mode.js +11 -4
  22. package/src/core/agent/tools/names.js +64 -0
  23. package/src/core/agent/tools/registry.js +9 -0
  24. package/src/core/agent/tools/tool-call-parser.js +70 -1
  25. package/src/core/apc/context-copy.js +1 -1
  26. package/src/core/apc/frontmatter.js +85 -0
  27. package/src/core/apc/parser.js +9 -21
  28. package/src/core/apc/paths.js +8 -8
  29. package/src/core/apc/scaffold.js +5 -4
  30. package/src/core/channels/telegram/ask-callbacks.js +35 -0
  31. package/src/core/channels/telegram/config.js +201 -0
  32. package/src/core/channels/telegram/dispatch.js +3 -0
  33. package/src/core/channels/telegram/reply.js +30 -5
  34. package/src/core/config/index.js +25 -183
  35. package/src/core/config/paths.js +57 -1
  36. package/src/core/config/redact.js +22 -0
  37. package/src/core/confirmation/adapters/web.js +1 -1
  38. package/src/core/daemon/service.js +238 -0
  39. package/src/core/deck/manifest.js +12 -12
  40. package/src/core/desktop/autostart.js +3 -2
  41. package/src/core/desktop/process.js +4 -4
  42. package/src/core/engines/gemini.js +322 -60
  43. package/src/core/engines/openai-compatible.js +21 -2
  44. package/src/core/engines/presets.js +2 -2
  45. package/src/core/http-tools/browser.js +1 -1
  46. package/src/core/http-tools/catalog.js +551 -0
  47. package/src/core/http-tools/fetch.js +1 -1
  48. package/src/core/http-tools/glob.js +3 -3
  49. package/src/core/http-tools/grep.js +2 -9
  50. package/src/core/http-tools/inline-handlers.js +59 -0
  51. package/src/core/http-tools/registry.js +31 -615
  52. package/src/core/http-tools/search.js +2 -2
  53. package/src/core/identity/self.js +6 -7
  54. package/src/core/identity/telegram.js +3 -3
  55. package/src/core/logging.js +6 -5
  56. package/src/core/mcp/sources.js +12 -16
  57. package/src/core/memory/consolidate.js +225 -0
  58. package/src/core/memory/indexer.js +2 -5
  59. package/src/core/nudge/index.js +192 -0
  60. package/src/core/nudge/policy.js +143 -0
  61. package/src/core/nudge/store.js +141 -0
  62. package/src/core/profiles/bundled/secretary/PROFILE.md +8 -9
  63. package/src/core/profiles/bundled/secretary/config.schema.json +33 -3
  64. package/src/core/profiles/bundled/secretary/routines/day-close.json +7 -3
  65. package/src/core/profiles/bundled/secretary/routines/day-open.json +7 -3
  66. package/src/core/profiles/bundled/secretary/routines/watch.json +13 -0
  67. package/src/core/profiles/lifecycle.js +0 -2
  68. package/src/core/profiles/store.js +2 -7
  69. package/src/core/routines/runner.js +103 -4
  70. package/src/core/routines/signals.js +270 -0
  71. package/src/core/runtime-skills/apx-agency-agents/SKILL.md +2 -2
  72. package/src/core/runtime-skills/apx-profile/SKILL.md +3 -3
  73. package/src/core/runtime-skills/apx-project/SKILL.md +1 -1
  74. package/src/core/runtime-skills/apx-task/SKILL.md +8 -8
  75. package/src/core/runtime-skills/apx-telegram/SKILL.md +4 -4
  76. package/src/core/runtime-skills/apx-voice/SKILL.md +4 -4
  77. package/src/core/runtimes/detect.js +2 -2
  78. package/src/core/sessions/index.js +800 -0
  79. package/src/core/stores/code-sessions.js +3 -14
  80. package/src/core/stores/commitments.js +331 -0
  81. package/src/core/stores/engine-sessions.js +0 -4
  82. package/src/core/stores/messages.js +4 -5
  83. package/src/core/stores/organization.js +9 -11
  84. package/src/core/stores/routines.js +23 -14
  85. package/src/core/stores/runtime-callbacks.js +2 -1
  86. package/src/core/util/json-file.js +128 -0
  87. package/src/core/util/thinking.js +51 -0
  88. package/src/core/vars/sources.js +14 -21
  89. package/src/core/voice/stt-models.js +1 -1
  90. package/src/core/voice/tts.js +5 -4
  91. package/src/host/daemon/api/admin-config.js +5 -5
  92. package/src/host/daemon/api/admin.js +8 -7
  93. package/src/host/daemon/api/agents.js +16 -16
  94. package/src/host/daemon/api/artifact-preview.js +8 -8
  95. package/src/host/daemon/api/artifacts.js +7 -7
  96. package/src/host/daemon/api/code.js +8 -8
  97. package/src/host/daemon/api/commitments.js +135 -0
  98. package/src/host/daemon/api/config.js +6 -6
  99. package/src/host/daemon/api/confirm.js +2 -2
  100. package/src/host/daemon/api/connections.js +2 -2
  101. package/src/host/daemon/api/conversations.js +12 -12
  102. package/src/host/daemon/api/deck.js +6 -6
  103. package/src/host/daemon/api/desktop.js +8 -8
  104. package/src/host/daemon/api/embeddings.js +4 -4
  105. package/src/host/daemon/api/engines.js +8 -7
  106. package/src/host/daemon/api/exec.js +5 -4
  107. package/src/host/daemon/api/files-project.js +6 -6
  108. package/src/host/daemon/api/health.js +2 -2
  109. package/src/host/daemon/api/identity.js +3 -3
  110. package/src/host/daemon/api/inbox.js +2 -2
  111. package/src/host/daemon/api/integrations.js +23 -19
  112. package/src/host/daemon/api/mcps.js +16 -12
  113. package/src/host/daemon/api/messages.js +5 -5
  114. package/src/host/daemon/api/nudges.js +112 -0
  115. package/src/host/daemon/api/organization.js +8 -8
  116. package/src/host/daemon/api/pairing.js +6 -6
  117. package/src/host/daemon/api/plugins.js +3 -3
  118. package/src/host/daemon/api/prefix.js +20 -0
  119. package/src/host/daemon/api/profiles.js +9 -9
  120. package/src/host/daemon/api/projects.js +5 -5
  121. package/src/host/daemon/api/routines.js +32 -8
  122. package/src/host/daemon/api/run.js +2 -2
  123. package/src/host/daemon/api/runtimes.js +6 -6
  124. package/src/host/daemon/api/self-memory.js +50 -0
  125. package/src/host/daemon/api/sessions-search.js +18 -11
  126. package/src/host/daemon/api/sessions.js +6 -6
  127. package/src/host/daemon/api/shared.js +59 -13
  128. package/src/host/daemon/api/skills.js +12 -12
  129. package/src/host/daemon/api/super-agent.js +4 -4
  130. package/src/host/daemon/api/tasks.js +11 -11
  131. package/src/host/daemon/api/telegram.js +61 -24
  132. package/src/host/daemon/api/tools.js +7 -7
  133. package/src/host/daemon/api/top-level.js +7 -7
  134. package/src/host/daemon/api/transcribe.js +6 -6
  135. package/src/host/daemon/api/tts.js +3 -3
  136. package/src/host/daemon/api/vars.js +11 -8
  137. package/src/host/daemon/api/voice.js +9 -7
  138. package/src/host/daemon/api/web.js +28 -32
  139. package/src/host/daemon/api.js +83 -48
  140. package/src/host/daemon/callback-reconciler.js +16 -0
  141. package/src/host/daemon/db.js +1 -1
  142. package/src/host/daemon/desktop-ws.js +7 -3
  143. package/src/host/daemon/index.js +11 -5
  144. package/src/host/daemon/plugins/desktop/index.js +8 -2
  145. package/src/host/daemon/plugins/telegram/index.js +7 -2
  146. package/src/host/daemon/stt-venv.js +20 -81
  147. package/src/host/daemon/wakeup.js +18 -4
  148. package/src/interfaces/acp/index.js +3 -3
  149. package/src/interfaces/acp/session.js +2 -2
  150. package/src/interfaces/cli/commands/a2a.js +2 -2
  151. package/src/interfaces/cli/commands/agent.js +3 -3
  152. package/src/interfaces/cli/commands/artifact.js +13 -13
  153. package/src/interfaces/cli/commands/chat.js +3 -3
  154. package/src/interfaces/cli/commands/command.js +2 -2
  155. package/src/interfaces/cli/commands/commitment.js +154 -0
  156. package/src/interfaces/cli/commands/config.js +4 -4
  157. package/src/interfaces/cli/commands/daemon.js +74 -18
  158. package/src/interfaces/cli/commands/desktop.js +7 -14
  159. package/src/interfaces/cli/commands/exec.js +2 -2
  160. package/src/interfaces/cli/commands/log.js +3 -4
  161. package/src/interfaces/cli/commands/mcp.js +9 -9
  162. package/src/interfaces/cli/commands/memory.js +75 -2
  163. package/src/interfaces/cli/commands/messages.js +5 -5
  164. package/src/interfaces/cli/commands/model.js +0 -18
  165. package/src/interfaces/cli/commands/nudge.js +130 -0
  166. package/src/interfaces/cli/commands/obsidian.js +5 -5
  167. package/src/interfaces/cli/commands/org.js +5 -5
  168. package/src/interfaces/cli/commands/pair.js +6 -6
  169. package/src/interfaces/cli/commands/plugins.js +2 -2
  170. package/src/interfaces/cli/commands/profile.js +10 -10
  171. package/src/interfaces/cli/commands/project-config.js +6 -6
  172. package/src/interfaces/cli/commands/project.js +10 -10
  173. package/src/interfaces/cli/commands/routine.js +8 -9
  174. package/src/interfaces/cli/commands/runtime.js +2 -2
  175. package/src/interfaces/cli/commands/search.js +0 -1
  176. package/src/interfaces/cli/commands/session.js +12 -40
  177. package/src/interfaces/cli/commands/sessions.js +21 -798
  178. package/src/interfaces/cli/commands/setup.js +16 -6
  179. package/src/interfaces/cli/commands/skills.js +1 -2
  180. package/src/interfaces/cli/commands/status.js +3 -3
  181. package/src/interfaces/cli/commands/task.js +8 -8
  182. package/src/interfaces/cli/commands/telegram.js +21 -21
  183. package/src/interfaces/cli/commands/voice.js +6 -6
  184. package/src/interfaces/cli/help/index.js +2245 -0
  185. package/src/interfaces/cli/http.js +9 -4
  186. package/src/interfaces/cli/index.js +14 -2857
  187. package/src/interfaces/cli/routes/acp.js +13 -0
  188. package/src/interfaces/cli/routes/agent.js +27 -0
  189. package/src/interfaces/cli/routes/artifact.js +28 -0
  190. package/src/interfaces/cli/routes/chat.js +11 -0
  191. package/src/interfaces/cli/routes/code.js +11 -0
  192. package/src/interfaces/cli/routes/command.js +21 -0
  193. package/src/interfaces/cli/routes/commitment.js +19 -0
  194. package/src/interfaces/cli/routes/config.js +16 -0
  195. package/src/interfaces/cli/routes/connections.js +11 -0
  196. package/src/interfaces/cli/routes/conversations.js +21 -0
  197. package/src/interfaces/cli/routes/daemon.js +25 -0
  198. package/src/interfaces/cli/routes/desktop.js +20 -0
  199. package/src/interfaces/cli/routes/env.js +13 -0
  200. package/src/interfaces/cli/routes/exec.js +11 -0
  201. package/src/interfaces/cli/routes/identity.js +11 -0
  202. package/src/interfaces/cli/routes/index.js +75 -0
  203. package/src/interfaces/cli/routes/init.js +11 -0
  204. package/src/interfaces/cli/routes/log.js +20 -0
  205. package/src/interfaces/cli/routes/mcp.js +22 -0
  206. package/src/interfaces/cli/routes/memory.js +19 -0
  207. package/src/interfaces/cli/routes/messages.js +16 -0
  208. package/src/interfaces/cli/routes/model.js +11 -0
  209. package/src/interfaces/cli/routes/nudge.js +17 -0
  210. package/src/interfaces/cli/routes/obsidian.js +17 -0
  211. package/src/interfaces/cli/routes/org.js +34 -0
  212. package/src/interfaces/cli/routes/overlay.js +10 -0
  213. package/src/interfaces/cli/routes/pair.js +17 -0
  214. package/src/interfaces/cli/routes/panel.js +16 -0
  215. package/src/interfaces/cli/routes/permission.js +11 -0
  216. package/src/interfaces/cli/routes/plugins.js +21 -0
  217. package/src/interfaces/cli/routes/profile.js +27 -0
  218. package/src/interfaces/cli/routes/project.js +41 -0
  219. package/src/interfaces/cli/routes/restart.js +15 -0
  220. package/src/interfaces/cli/routes/routine.js +28 -0
  221. package/src/interfaces/cli/routes/run.js +11 -0
  222. package/src/interfaces/cli/routes/search.js +11 -0
  223. package/src/interfaces/cli/routes/send.js +11 -0
  224. package/src/interfaces/cli/routes/session.js +26 -0
  225. package/src/interfaces/cli/routes/sessions.js +15 -0
  226. package/src/interfaces/cli/routes/setup.js +18 -0
  227. package/src/interfaces/cli/routes/skills.js +20 -0
  228. package/src/interfaces/cli/routes/status.js +12 -0
  229. package/src/interfaces/cli/routes/task.js +26 -0
  230. package/src/interfaces/cli/routes/telegram.js +39 -0
  231. package/src/interfaces/cli/routes/update.js +24 -0
  232. package/src/interfaces/cli/routes/voice.js +17 -0
  233. package/src/interfaces/desktop/main.js +6 -7
  234. package/src/interfaces/desktop/renderer.js +0 -5
  235. package/src/interfaces/mcp-server/index.js +15 -14
  236. package/src/interfaces/tui/_shims/globals.d.ts +8 -0
  237. package/src/interfaces/tui/tsconfig.json +4 -1
  238. package/src/interfaces/web/README.md +6 -6
  239. package/src/interfaces/web/dist/assets/index-CvEoGtTf.js +849 -0
  240. package/src/interfaces/web/dist/assets/index-CvEoGtTf.js.map +1 -0
  241. package/src/interfaces/web/dist/assets/index-DzBBXFaO.css +1 -0
  242. package/src/interfaces/web/dist/index.html +2 -2
  243. package/src/interfaces/web/package-lock.json +11 -10
  244. package/src/interfaces/web/src/components/AddProjectDialog.tsx +1 -1
  245. package/src/interfaces/web/src/components/Section.tsx +18 -3
  246. package/src/interfaces/web/src/components/agents/AgentFormFields.tsx +1 -1
  247. package/src/interfaces/web/src/components/chat/ChatList.tsx +2 -2
  248. package/src/interfaces/web/src/components/chat/MessageBubble.tsx +13 -0
  249. package/src/interfaces/web/src/components/chat/SkillPicker.tsx +1 -1
  250. package/src/interfaces/web/src/components/code/CodeFileTree.tsx +1 -1
  251. package/src/interfaces/web/src/components/code/CodeTerminal.tsx +1 -1
  252. package/src/interfaces/web/src/components/cron/CronPicker.tsx +196 -0
  253. package/src/interfaces/web/src/components/desktop/DesktopStatusCard.tsx +1 -1
  254. package/src/interfaces/web/src/components/files/FileBrowser.tsx +2 -2
  255. package/src/interfaces/web/src/components/inbox/InboxList.tsx +145 -0
  256. package/src/interfaces/web/src/components/memory/MemoryBrowser.tsx +36 -6
  257. package/src/interfaces/web/src/components/routines/ExecutionsList.tsx +1 -1
  258. package/src/interfaces/web/src/components/routines/RoutineDetail.tsx +16 -4
  259. package/src/interfaces/web/src/components/routines/RoutineEditor.tsx +14 -4
  260. package/src/interfaces/web/src/components/routines/shared.ts +14 -5
  261. package/src/interfaces/web/src/components/settings/DesktopSettingsPanel.tsx +1 -1
  262. package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +1 -1
  263. package/src/interfaces/web/src/components/settings/NudgePanel.tsx +183 -0
  264. package/src/interfaces/web/src/components/settings/ProfilePanel.tsx +36 -12
  265. package/src/interfaces/web/src/components/settings/SkillsInspectorPanel.tsx +1 -1
  266. package/src/interfaces/web/src/components/settings/SkillsManager.tsx +2 -2
  267. package/src/interfaces/web/src/components/tasks/TaskDetailPanel.tsx +1 -1
  268. package/src/interfaces/web/src/components/ui/filter-chips.tsx +47 -0
  269. package/src/interfaces/web/src/components/ui.tsx +1 -0
  270. package/src/interfaces/web/src/constants/index.ts +1 -0
  271. package/src/interfaces/web/src/hooks/useChat.ts +5 -1
  272. package/src/interfaces/web/src/hooks/useDaemonStatus.ts +1 -1
  273. package/src/interfaces/web/src/hooks/useDevices.ts +1 -1
  274. package/src/interfaces/web/src/hooks/useEngines.ts +1 -1
  275. package/src/interfaces/web/src/hooks/useGlobalConfig.ts +2 -2
  276. package/src/interfaces/web/src/hooks/useIdentity.ts +1 -1
  277. package/src/interfaces/web/src/hooks/useInbox.ts +1 -1
  278. package/src/interfaces/web/src/hooks/useNudges.ts +38 -0
  279. package/src/interfaces/web/src/hooks/useProfiles.ts +3 -3
  280. package/src/interfaces/web/src/hooks/useProjects.ts +1 -1
  281. package/src/interfaces/web/src/hooks/useTelegram.ts +3 -3
  282. package/src/interfaces/web/src/hooks/useTokenBootstrap.ts +3 -3
  283. package/src/interfaces/web/src/i18n/en.ts +127 -0
  284. package/src/interfaces/web/src/i18n/es.ts +127 -0
  285. package/src/interfaces/web/src/lib/api/admin.ts +11 -11
  286. package/src/interfaces/web/src/lib/api/agents.ts +14 -14
  287. package/src/interfaces/web/src/lib/api/artifacts.ts +11 -11
  288. package/src/interfaces/web/src/lib/api/code.ts +1 -1
  289. package/src/interfaces/web/src/lib/api/commitments.ts +57 -0
  290. package/src/interfaces/web/src/lib/api/conversations.ts +8 -8
  291. package/src/interfaces/web/src/lib/api/deck.ts +3 -3
  292. package/src/interfaces/web/src/lib/api/desktop.ts +8 -8
  293. package/src/interfaces/web/src/lib/api/embeddings.ts +3 -3
  294. package/src/interfaces/web/src/lib/api/engines.ts +3 -3
  295. package/src/interfaces/web/src/lib/api/filesystem.ts +2 -2
  296. package/src/interfaces/web/src/lib/api/health.ts +1 -1
  297. package/src/interfaces/web/src/lib/api/identity.ts +2 -2
  298. package/src/interfaces/web/src/lib/api/inbox.ts +1 -1
  299. package/src/interfaces/web/src/lib/api/integrations.ts +8 -8
  300. package/src/interfaces/web/src/lib/api/mcps.ts +6 -6
  301. package/src/interfaces/web/src/lib/api/messages.ts +3 -3
  302. package/src/interfaces/web/src/lib/api/notebook.ts +23 -0
  303. package/src/interfaces/web/src/lib/api/nudges.ts +53 -0
  304. package/src/interfaces/web/src/lib/api/organization.ts +7 -7
  305. package/src/interfaces/web/src/lib/api/profiles.ts +8 -8
  306. package/src/interfaces/web/src/lib/api/projectFiles.ts +5 -5
  307. package/src/interfaces/web/src/lib/api/projects.ts +12 -12
  308. package/src/interfaces/web/src/lib/api/routines.ts +7 -7
  309. package/src/interfaces/web/src/lib/api/sessions.ts +2 -2
  310. package/src/interfaces/web/src/lib/api/skills.ts +11 -11
  311. package/src/interfaces/web/src/lib/api/super_agent.ts +3 -3
  312. package/src/interfaces/web/src/lib/api/tasks.ts +12 -12
  313. package/src/interfaces/web/src/lib/api/telegram.ts +14 -14
  314. package/src/interfaces/web/src/lib/api/tools.ts +1 -1
  315. package/src/interfaces/web/src/lib/api/vars.ts +4 -4
  316. package/src/interfaces/web/src/lib/api/voice.ts +6 -6
  317. package/src/interfaces/web/src/lib/cron.ts +196 -0
  318. package/src/interfaces/web/src/lib/when.ts +32 -0
  319. package/src/interfaces/web/src/screens/InboxScreen.tsx +107 -77
  320. package/src/interfaces/web/src/screens/ProjectScreen.tsx +5 -2
  321. package/src/interfaces/web/src/screens/SettingsScreen.tsx +17 -3
  322. package/src/interfaces/web/src/screens/base/AgentDefaultsTab.tsx +1 -1
  323. package/src/interfaces/web/src/screens/base/CommitmentsTab.tsx +239 -0
  324. package/src/interfaces/web/src/screens/base/GlobalTasksTab.tsx +103 -20
  325. package/src/interfaces/web/src/screens/base/LogsTab.tsx +18 -3
  326. package/src/interfaces/web/src/screens/base/SessionsTab.tsx +1 -1
  327. package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
  328. package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +1 -1
  329. package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +1 -1
  330. package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +1 -1
  331. package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +8 -8
  332. package/src/interfaces/web/src/screens/project/AgentsTab.tsx +2 -2
  333. package/src/interfaces/web/src/screens/project/ChatTab.tsx +24 -6
  334. package/src/interfaces/web/src/screens/project/ConfigTab.tsx +1 -1
  335. package/src/interfaces/web/src/screens/project/McpsTab.tsx +3 -3
  336. package/src/interfaces/web/src/screens/project/Overview.tsx +6 -6
  337. package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +15 -13
  338. package/src/interfaces/web/src/screens/project/StructureTab.tsx +1 -1
  339. package/src/interfaces/web/src/screens/project/TasksTab.tsx +1 -1
  340. package/src/interfaces/web/src/screens/project/VarsTab.tsx +1 -1
  341. package/src/interfaces/web/src/types/daemon.ts +10 -1
  342. package/src/interfaces/web/vite.config.ts +13 -18
  343. package/src/interfaces/web/dist/assets/index-BptlbKjU.js +0 -824
  344. package/src/interfaces/web/dist/assets/index-BptlbKjU.js.map +0 -1
  345. package/src/interfaces/web/dist/assets/index-D_EJEA1n.css +0 -1
  346. package/src/skills/apc-context/SKILL.md +0 -159
  347. /package/src/{host/daemon → core}/runtimes/_spawn.js +0 -0
  348. /package/src/{host/daemon → core}/runtimes/aider.js +0 -0
  349. /package/src/{host/daemon → core}/runtimes/antigravity.js +0 -0
  350. /package/src/{host/daemon → core}/runtimes/claude-code.js +0 -0
  351. /package/src/{host/daemon → core}/runtimes/codex.js +0 -0
  352. /package/src/{host/daemon → core}/runtimes/cursor-agent.js +0 -0
  353. /package/src/{host/daemon → core}/runtimes/gemini-cli.js +0 -0
  354. /package/src/{host/daemon → core}/runtimes/index.js +0 -0
  355. /package/src/{host/daemon → core}/runtimes/opencode.js +0 -0
  356. /package/src/{host/daemon → core}/runtimes/qwen-code.js +0 -0
@@ -0,0 +1,27 @@
1
+ // apx profile — 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 { cmdProfileConfig, cmdProfileDoctor, cmdProfileInstall, cmdProfileList, cmdProfileOff, cmdProfileShow, cmdProfileUninstall, cmdProfileUse } from "../commands/profile.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 = ["profiles"];
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 cmdProfileList(a);
19
+ else if (sub === "show" || sub === "get") await cmdProfileShow(a);
20
+ else if (sub === "install" || sub === "add") await cmdProfileInstall(a);
21
+ else if (sub === "use" || sub === "activate") await cmdProfileUse(a);
22
+ else if (sub === "off" || sub === "deactivate") await cmdProfileOff(a);
23
+ else if (sub === "config") await cmdProfileConfig(a);
24
+ else if (sub === "doctor") await cmdProfileDoctor(a);
25
+ else if (sub === "uninstall" || sub === "remove" || sub === "rm") await cmdProfileUninstall(a);
26
+ else die(`unknown profile subcommand: ${sub}\nUsage: apx profile <list|show|install|use|off|config|doctor|uninstall>`);
27
+ }
@@ -0,0 +1,41 @@
1
+ // apx project — 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 { cmdProjectConfigEdit, cmdProjectConfigSet, cmdProjectConfigShow, cmdProjectConfigUnset } from "../commands/project-config.js";
8
+ import { cmdProjectAdd, cmdProjectList, cmdProjectRebuild, cmdProjectRemove } from "../commands/project.js";
9
+
10
+ export default async function route(rest, { parseArgs, die, dispatch }) {
11
+ const sub = rest[0];
12
+ const a = parseArgs(rest.slice(1));
13
+ const PROJECT_SUBCOMMANDS = new Set([
14
+ "add", "list", "ls", "remove", "rm", "rebuild", "config",
15
+ ]);
16
+ if (sub === "add") await cmdProjectAdd(a);
17
+ else if (sub === "list" || sub === "ls") await cmdProjectList();
18
+ else if (sub === "remove" || sub === "rm") await cmdProjectRemove(a);
19
+ else if (sub === "rebuild") await cmdProjectRebuild(a);
20
+ else if (sub === "config") {
21
+ // apx project config <show|set|unset|edit> <project> ...
22
+ const csub = rest[1];
23
+ const ca = parseArgs(rest.slice(2));
24
+ if (csub === "show" || csub === "get") await cmdProjectConfigShow(ca);
25
+ else if (csub === "set") await cmdProjectConfigSet(ca);
26
+ else if (csub === "unset" || csub === "rm") await cmdProjectConfigUnset(ca);
27
+ else if (csub === "edit") await cmdProjectConfigEdit(ca);
28
+ else die(`unknown project config subcommand: ${csub || "(none)"} — try: show, set, unset, edit`);
29
+ }
30
+ else if (sub && !PROJECT_SUBCOMMANDS.has(sub)) {
31
+ // Sugar: `apx project <name|id> <subcommand...>` runs the inner
32
+ // subcommand with --project=<name|id> appended.
33
+ // apx project testing mcp list → apx mcp list --project testing
34
+ // apx project 2 routine list → apx routine list --project 2
35
+ const innerCmd = rest[1];
36
+ if (!innerCmd) die(`apx project ${sub}: missing subcommand`);
37
+ const innerRest = [...rest.slice(2), "--project", sub];
38
+ await dispatch(innerCmd, innerRest);
39
+ }
40
+ else die(`unknown project subcommand: ${sub || "(none)"}`);
41
+ }
@@ -0,0 +1,15 @@
1
+ // apx restart — 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 { cmdDaemonRestart } from "../commands/daemon.js";
8
+ import { cmdDesktopRestart, desktopRunning } from "../commands/desktop.js";
9
+
10
+ export default async function route(rest, { parseArgs }) {
11
+ const a = parseArgs(rest);
12
+ await cmdDaemonRestart(a);
13
+ if (desktopRunning()) await cmdDesktopRestart(a);
14
+ return;
15
+ }
@@ -0,0 +1,28 @@
1
+ // apx routine — 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 { cmdRoutineAdd, cmdRoutineDisable, cmdRoutineEnable, cmdRoutineGet, cmdRoutineHistory, cmdRoutineList, cmdRoutineMemory, cmdRoutineRemove, cmdRoutineRun } from "../commands/routine.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 = ["routines"];
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 cmdRoutineList(a);
19
+ else if (sub === "get" || sub === "show") await cmdRoutineGet(a);
20
+ else if (sub === "add" || sub === "new") await cmdRoutineAdd(a);
21
+ else if (sub === "remove" || sub === "rm") await cmdRoutineRemove(a);
22
+ else if (sub === "enable") await cmdRoutineEnable(a);
23
+ else if (sub === "disable") await cmdRoutineDisable(a);
24
+ else if (sub === "run") await cmdRoutineRun(a);
25
+ else if (sub === "history" || sub === "hist") await cmdRoutineHistory(a);
26
+ else if (sub === "memory" || sub === "mem") await cmdRoutineMemory(a);
27
+ else die(`unknown routine subcommand: ${sub}`);
28
+ }
@@ -0,0 +1,11 @@
1
+ // apx run — 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 { cmdRun } from "../commands/runtime.js";
8
+
9
+ export default async function route(rest, { parseArgs }) {
10
+ await cmdRun(parseArgs(rest));
11
+ }
@@ -0,0 +1,11 @@
1
+ // apx search — 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 { cmdSearch } from "../commands/search.js";
8
+
9
+ export default async function route(rest, { parseArgs }) {
10
+ await cmdSearch(parseArgs(rest));
11
+ }
@@ -0,0 +1,11 @@
1
+ // apx send — 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 { cmdSend } from "../commands/a2a.js";
8
+
9
+ export default async function route(rest, { parseArgs }) {
10
+ await cmdSend(parseArgs(rest));
11
+ }
@@ -0,0 +1,26 @@
1
+ // apx session — 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 { cmdSessionAsk, cmdSessionCheck, cmdSessionClose, cmdSessionCloseStale, cmdSessionCompact, cmdSessionGet, cmdSessionList, cmdSessionNew, cmdSessionResume, cmdSessionSummary, cmdSessionUpdate } from "../commands/session.js";
8
+ import { cmdSessionFind } from "../commands/sessions.js";
9
+
10
+ export default async function route(rest, { parseArgs, die }) {
11
+ const sub = rest[0];
12
+ const a = parseArgs(rest.slice(1));
13
+ if (sub === "new") cmdSessionNew(a);
14
+ else if (sub === "list" || sub === "ls") cmdSessionList(a);
15
+ else if (sub === "get" || sub === "show") cmdSessionGet(a);
16
+ else if (sub === "update") cmdSessionUpdate(a);
17
+ else if (sub === "close") cmdSessionClose(a);
18
+ else if (sub === "check") cmdSessionCheck();
19
+ else if (sub === "close-stale") cmdSessionCloseStale();
20
+ else if (sub === "resume") await cmdSessionResume(a);
21
+ else if (sub === "compact") await cmdSessionCompact(a);
22
+ else if (sub === "find" || sub === "search") cmdSessionFind(a);
23
+ else if (sub === "summary") await cmdSessionSummary(a);
24
+ else if (sub === "ask") await cmdSessionAsk(a);
25
+ else die(`unknown session subcommand: ${sub || "(none)"}`);
26
+ }
@@ -0,0 +1,15 @@
1
+ // apx sessions — 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 { cmdSessionsList } from "../commands/sessions.js";
8
+
9
+ export default async function route(rest, { parseArgs, die }) {
10
+ const sub = rest[0];
11
+ const isListSub = sub === "list" || sub === "ls";
12
+ const a = parseArgs(isListSub ? rest.slice(1) : rest);
13
+ if (!sub || isListSub || sub.startsWith("--")) cmdSessionsList(a);
14
+ else die(`unknown sessions subcommand: ${sub} — try: list`);
15
+ }
@@ -0,0 +1,18 @@
1
+ // apx setup — 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 { cmdSetup } from "../commands/setup.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 = ["install"];
14
+
15
+ export default async function route(_rest, _ctx) {
16
+ await cmdSetup();
17
+ return;
18
+ }
@@ -0,0 +1,20 @@
1
+ // apx skills — 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 { cmdSkillsAdd, cmdSkillsIndex, cmdSkillsInspect, cmdSkillsInspector, cmdSkillsList, cmdSkillsStatus, cmdSkillsSync } from "../commands/skills.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 === "add") await cmdSkillsAdd(a);
13
+ else if (sub === "list" || sub === "ls") await cmdSkillsList(a);
14
+ else if (sub === "status") await cmdSkillsStatus();
15
+ else if (sub === "sync" || sub === "refresh") await cmdSkillsSync(a);
16
+ else if (sub === "index") await cmdSkillsIndex(a);
17
+ else if (sub === "inspect") await cmdSkillsInspect(a);
18
+ else if (sub === "inspector") await cmdSkillsInspector(a);
19
+ else die(`unknown skills subcommand: ${sub}`);
20
+ }
@@ -0,0 +1,12 @@
1
+ // apx status — 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 { cmdStatus } from "../commands/status.js";
8
+
9
+ export default async function route(_rest, _ctx) {
10
+ await cmdStatus();
11
+ return; // skip checkForUpdate after status (avoid noise)
12
+ }
@@ -0,0 +1,26 @@
1
+ // apx task — 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 { cmdTaskAdd, cmdTaskDone, cmdTaskDrop, cmdTaskList, cmdTaskPatch, cmdTaskReopen, cmdTaskShow } from "../commands/task.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 = ["tasks"];
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 cmdTaskList(a);
19
+ else if (sub === "add" || sub === "new" || sub === "create") await cmdTaskAdd(a);
20
+ else if (sub === "show" || sub === "get") await cmdTaskShow(a);
21
+ else if (sub === "done" || sub === "complete") await cmdTaskDone(a);
22
+ else if (sub === "drop" || sub === "archive") await cmdTaskDrop(a);
23
+ else if (sub === "reopen") await cmdTaskReopen(a);
24
+ else if (sub === "patch" || sub === "edit") await cmdTaskPatch(a);
25
+ else die(`unknown task subcommand: ${sub}\nUsage: apx task <list|add|show|done|drop|reopen|patch>`);
26
+ }
@@ -0,0 +1,39 @@
1
+ // apx telegram — 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 { cmdTelegramChannelAdd, cmdTelegramChannelList, cmdTelegramChannelRemove, cmdTelegramChannelSet, cmdTelegramChannelShow, cmdTelegramChannelUnset, cmdTelegramContactRemove, cmdTelegramContacts, cmdTelegramOwner, cmdTelegramRole, cmdTelegramRoles, cmdTelegramSend, cmdTelegramSetup, cmdTelegramStart, cmdTelegramStatus, cmdTelegramStop } from "../commands/telegram.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 === "send") await cmdTelegramSend(a);
13
+ else if (sub === "status") await cmdTelegramStatus();
14
+ else if (sub === "start") await cmdTelegramStart();
15
+ else if (sub === "stop") await cmdTelegramStop();
16
+ else if (sub === "setup") cmdTelegramSetup();
17
+ else if (sub === "channel" || sub === "channels") {
18
+ const csub = rest[1];
19
+ const ca = parseArgs(rest.slice(2));
20
+ if (csub === "add") await cmdTelegramChannelAdd(ca);
21
+ else if (csub === "list" || csub === "ls" || !csub) await cmdTelegramChannelList();
22
+ else if (csub === "show" || csub === "get") await cmdTelegramChannelShow(ca);
23
+ else if (csub === "set") await cmdTelegramChannelSet(ca);
24
+ else if (csub === "unset") await cmdTelegramChannelUnset(ca);
25
+ else if (csub === "remove" || csub === "rm") await cmdTelegramChannelRemove(ca);
26
+ else die(`unknown telegram channel subcommand: ${csub} — try: add, list, show, set, unset, remove`);
27
+ }
28
+ else if (sub === "contacts" || sub === "contact") {
29
+ const csub = rest[1];
30
+ const ca = parseArgs(rest.slice(2));
31
+ if (csub === "rm" || csub === "remove") await cmdTelegramContactRemove(ca);
32
+ else if (!csub || csub === "list" || csub === "ls") await cmdTelegramContacts();
33
+ else die(`unknown telegram contacts subcommand: ${csub} — try: list, rm`);
34
+ }
35
+ else if (sub === "role") await cmdTelegramRole(parseArgs(rest.slice(1)));
36
+ else if (sub === "roles") await cmdTelegramRoles(parseArgs(rest.slice(1)));
37
+ else if (sub === "owner") await cmdTelegramOwner(parseArgs(rest.slice(1)));
38
+ else die(`unknown telegram subcommand: ${sub || "(none)"}`);
39
+ }
@@ -0,0 +1,24 @@
1
+ // apx update — 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 { cmdUpdate } from "../commands/update.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 = ["upgrade"];
14
+
15
+ export default async function route(rest, { parseArgs, VERSION }) {
16
+ await cmdUpdate(parseArgs(rest), VERSION);
17
+ return; // skip checkForUpdate after an update
18
+
19
+ // Refresh everything held in memory after a code change (e.g. a `git
20
+ // pull` in a dev checkout): restart the daemon, and restart the desktop
21
+ // too if it was running. The daemon picks up new code/prompts; the
22
+ // desktop picks up its new renderer/main.js. Token re-sync is automatic
23
+ // (the desktop WS re-reads daemon.token on reconnect).
24
+ }
@@ -0,0 +1,17 @@
1
+ // apx voice — 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 { cmdVoiceListen, cmdVoiceProviders, cmdVoiceSay } from "../commands/voice.js";
8
+
9
+ export default async function route(rest, { parseArgs, die }) {
10
+ const [sub, ...vRest] = rest;
11
+ const vArgs = parseArgs(vRest);
12
+ if (sub === "say") { await cmdVoiceSay(vArgs); return; }
13
+ if (sub === "listen") { await cmdVoiceListen(vArgs); return; }
14
+ if (sub === "providers" || sub === "list") { await cmdVoiceProviders(); return; }
15
+ die(`unknown voice sub-command: ${sub || "(missing)"}\nUsage: apx voice <say|listen|providers>`);
16
+ return;
17
+ }
@@ -124,7 +124,7 @@ function getAgentName() {
124
124
  return "Superagente";
125
125
  }
126
126
 
127
- function getWindowOrigin(height) {
127
+ function getWindowOrigin(_height) {
128
128
  const display = screen.getPrimaryDisplay();
129
129
  const { workArea } = display;
130
130
  const pos = getPosition();
@@ -151,7 +151,6 @@ let overlayVisible = false;
151
151
  // Asset paths — real PNG logos (apx/assets/favicon/dark/*) copied to
152
152
  // src/interfaces/desktop/assets/ at install time.
153
153
  const TRAY_ICON_PATH = path.join(__dirname, "assets", "tray-icon.png"); // 180×180 apple-touch
154
- const TRAY_ICON_REC_PATH = path.join(__dirname, "assets", "tray-icon.png"); // same; tinted in JS
155
154
  const APP_ICON_PATH = path.join(__dirname, "assets", "app-icon-180.png"); // dock / window icon
156
155
 
157
156
  // On macOS, hide from the dock AND from Cmd+Tab. "accessory" is the modern
@@ -510,7 +509,7 @@ ipcMain.handle("warmup-stt", async () => {
510
509
  const options = {
511
510
  hostname: DAEMON_HOST,
512
511
  port: DAEMON_PORT,
513
- path: "/transcribe/warmup",
512
+ path: "/api/transcribe/warmup",
514
513
  method: "GET",
515
514
  headers: { ...(token ? { "Authorization": `Bearer ${token}` } : {}) },
516
515
  };
@@ -542,7 +541,7 @@ function transcribeChunk(buf, format, language) {
542
541
  const options = {
543
542
  hostname: DAEMON_HOST,
544
543
  port: DAEMON_PORT,
545
- path: "/transcribe/chunk",
544
+ path: "/api/transcribe/chunk",
546
545
  method: "POST",
547
546
  headers: {
548
547
  "Content-Type": "application/octet-stream",
@@ -585,7 +584,7 @@ function connectDaemon() {
585
584
  return;
586
585
  }
587
586
 
588
- const url = `ws://${DAEMON_HOST}:${DAEMON_PORT}/desktop/ws`;
587
+ const url = `ws://${DAEMON_HOST}:${DAEMON_PORT}/api/desktop/ws`;
589
588
 
590
589
  function connect() {
591
590
  // Re-read the token on EVERY attempt — the daemon regenerates
@@ -652,7 +651,7 @@ async function sendMessageToDaemon(text, previousMessages) {
652
651
  const options = {
653
652
  hostname: DAEMON_HOST,
654
653
  port: DAEMON_PORT,
655
- path: "/desktop/message",
654
+ path: "/api/desktop/message",
656
655
  method: "POST",
657
656
  headers: {
658
657
  "Content-Type": "application/json",
@@ -699,7 +698,7 @@ function _ttsRequest(text, explicitProvider) {
699
698
  const options = {
700
699
  hostname: DAEMON_HOST,
701
700
  port: DAEMON_PORT,
702
- path: "/tts/say",
701
+ path: "/api/tts/say",
703
702
  method: "POST",
704
703
  headers: {
705
704
  "Content-Type": "application/json",
@@ -92,10 +92,6 @@
92
92
  // requestTts / second finalize on the same in-flight bubble.
93
93
  let doneHandled = false;
94
94
  let ttsTimer = null;
95
- // Which agent turn (by message id) is waiting for its TTS audio to attach.
96
- // We finalize the bubble immediately on `done`, then post-attach the
97
- // scrubber when (or if) tts-ready arrives.
98
- let pendingTtsTurnId = null;
99
95
 
100
96
  // ── Inline SVG icons (mirrors the design's I.* set) ──────────────────────
101
97
  const SVG = (path, attrs = {}) => {
@@ -727,7 +723,6 @@
727
723
  currentTurn++;
728
724
  resetTurnAudio();
729
725
  doneHandled = false;
730
- pendingTtsTurnId = null;
731
726
  if (ttsTimer) { clearTimeout(ttsTimer); ttsTimer = null; }
732
727
  }
733
728
  function resetTurnAudio() {
@@ -19,13 +19,14 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
19
19
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
20
20
  import { z } from "zod";
21
21
  import { findApfRoot } from "#core/apc/parser.js";
22
- import { ensureDaemon, http } from "../../cli/http.js";
22
+ // Was "../../cli/http.js", which resolves to src/cli/http.js — a path that
23
+ // does not exist, so this binary could not load at all. Use the alias
24
+ // (AGENTS.md rule 7) so the same mistake cannot recur silently.
25
+ import { ensureDaemon, http } from "#interfaces/cli/http.js";
23
26
 
24
27
  const __filename = fileURLToPath(import.meta.url);
25
28
  const __dirname = path.dirname(__filename);
26
29
 
27
- const PORT = parseInt(process.env.APX_PORT || "7430", 10);
28
-
29
30
  // ---------------------------------------------------------------------------
30
31
  // Resolve current project
31
32
  // ---------------------------------------------------------------------------
@@ -37,12 +38,12 @@ async function resolveProject() {
37
38
 
38
39
  // Ensure daemon is running and project is registered.
39
40
  await ensureDaemon({ silent: true });
40
- const projects = await http.get("/projects");
41
+ const projects = await http.get("/api/projects");
41
42
  const match = projects.find((p) => path.resolve(p.path) === path.resolve(root));
42
43
  if (match) return match;
43
44
 
44
45
  // Register if not yet known.
45
- const created = await http.post("/projects", { path: root });
46
+ const created = await http.post("/api/projects", { path: root });
46
47
  return created;
47
48
  }
48
49
 
@@ -62,7 +63,7 @@ server.tool(
62
63
  {},
63
64
  async () => {
64
65
  const proj = await resolveProject();
65
- const agents = await http.get(`/projects/${proj.id}/agents`);
66
+ const agents = await http.get(`/api/projects/${proj.id}/agents`);
66
67
  const rows = agents.map(
67
68
  (a) => `${a.slug} role=${a.role || "—"} model=${a.model || "—"}`
68
69
  );
@@ -83,7 +84,7 @@ server.tool(
83
84
  const proj = await resolveProject();
84
85
  const body = { prompt };
85
86
  if (engine) body.engine = engine;
86
- const result = await http.post(`/projects/${proj.id}/agents/${slug}/exec`, body);
87
+ const result = await http.post(`/api/projects/${proj.id}/agents/${slug}/exec`, body);
87
88
  return { content: [{ type: "text", text: result.output || JSON.stringify(result) }] };
88
89
  }
89
90
  );
@@ -100,7 +101,7 @@ server.tool(
100
101
  async ({ slug, prompt, runtime }) => {
101
102
  const proj = await resolveProject();
102
103
  const body = { prompt, runtime: runtime || "claude-code" };
103
- const result = await http.post(`/projects/${proj.id}/agents/${slug}/runtime`, body);
104
+ const result = await http.post(`/api/projects/${proj.id}/agents/${slug}/runtime`, body);
104
105
  return { content: [{ type: "text", text: result.output || JSON.stringify(result) }] };
105
106
  }
106
107
  );
@@ -114,7 +115,7 @@ server.tool(
114
115
  },
115
116
  async ({ slug }) => {
116
117
  const proj = await resolveProject();
117
- const mem = await http.get(`/projects/${proj.id}/agents/${slug}/memory`);
118
+ const mem = await http.get(`/api/projects/${proj.id}/agents/${slug}/memory`);
118
119
  return { content: [{ type: "text", text: mem.body_md || "(empty)" }] };
119
120
  }
120
121
  );
@@ -129,7 +130,7 @@ server.tool(
129
130
  },
130
131
  async ({ slug, fact }) => {
131
132
  const proj = await resolveProject();
132
- await http.put(`/projects/${proj.id}/agents/${slug}/memory`, { append: fact });
133
+ await http.put(`/api/projects/${proj.id}/agents/${slug}/memory`, { append: fact });
133
134
  return { content: [{ type: "text", text: "OK" }] };
134
135
  }
135
136
  );
@@ -149,7 +150,7 @@ server.tool(
149
150
  if (channel) qs.set("channel", channel);
150
151
  if (agent) qs.set("agent", agent);
151
152
  if (limit) qs.set("limit", String(limit));
152
- const msgs = await http.get(`/projects/${proj.id}/messages?${qs}`);
153
+ const msgs = await http.get(`/api/projects/${proj.id}/messages?${qs}`);
153
154
  const rows = (msgs.messages || msgs).map(
154
155
  (m) => `[${m.ts}] ${m.channel}/${m.direction} ${m.author || ""}: ${m.body}`
155
156
  );
@@ -168,7 +169,7 @@ server.tool(
168
169
  async ({ slug, limit }) => {
169
170
  const proj = await resolveProject();
170
171
  const qs = limit ? `?limit=${limit}` : "";
171
- const sessions = await http.get(`/projects/${proj.id}/agents/${slug}/sessions${qs}`);
172
+ const sessions = await http.get(`/api/projects/${proj.id}/agents/${slug}/sessions${qs}`);
172
173
  const rows = (sessions.sessions || sessions).map(
173
174
  (s) => `${s.filename} started=${s.started_at || "—"} title=${s.title || "—"}`
174
175
  );
@@ -183,7 +184,7 @@ server.tool(
183
184
  {},
184
185
  async () => {
185
186
  const proj = await resolveProject();
186
- const mcps = await http.get(`/projects/${proj.id}/mcps`);
187
+ const mcps = await http.get(`/api/projects/${proj.id}/mcps`);
187
188
  const rows = (mcps.mcps || mcps).map(
188
189
  (m) => `${m.name} source=${m.source} transport=${m.transport} enabled=${m.enabled}`
189
190
  );
@@ -203,7 +204,7 @@ server.tool(
203
204
  async ({ server: serverName, tool, args }) => {
204
205
  const proj = await resolveProject();
205
206
  const result = await http.post(
206
- `/projects/${proj.id}/mcps/${encodeURIComponent(serverName)}/call`,
207
+ `/api/projects/${proj.id}/mcps/${encodeURIComponent(serverName)}/call`,
207
208
  { tool, args: args || {} }
208
209
  );
209
210
  return {
@@ -0,0 +1,8 @@
1
+ // Ambient globals for the vendored OpenCode TUI.
2
+ //
3
+ // The fork was written against Bun and still calls a few Bun APIs inside
4
+ // `_shims/`. We run it on Node, so `Bun` has no type — which produced 13
5
+ // TS2868 errors the moment the (previously broken) tsconfig started loading.
6
+ // Declaring it loosely keeps the typecheck honest about everything else
7
+ // without pulling @types/bun into a Node-only install.
8
+ declare const Bun: any;
@@ -5,7 +5,10 @@
5
5
  "jsxImportSource": "@opentui/solid",
6
6
  "lib": ["ESNext", "DOM", "DOM.Iterable"],
7
7
  "noEmit": true,
8
- "types": [],
8
+ // `types: []` used to be here; combined with the missing base config it
9
+ // stripped node globals and flooded the check with TS2591.
10
+ // TS 6 deprecated `baseUrl`; `paths` below resolve relative to this file.
11
+ "types": ["node"],
9
12
  "paths": {
10
13
  "@tui/*": ["./*"],
11
14
  "@/cli/cmd/tui/*": ["./*"],
@@ -27,7 +27,7 @@ src/
27
27
  │ ├── api.ts ← typed daemon client (Bearer auth)
28
28
  │ └── cn.ts ← clsx + tailwind-merge
29
29
  ├── hooks/
30
- │ └── useTokenBootstrap.ts ← reads /admin/web-token on first paint
30
+ │ └── useTokenBootstrap.ts ← reads /api/admin/web-token on first paint
31
31
  ├── components/
32
32
  │ ├── ProjectSidebar.tsx ← rail of avatars (APX + projects)
33
33
  │ └── Section.tsx ← card primitive + small UI atoms
@@ -44,11 +44,11 @@ Nothing new server-side. Mounting is done by `src/host/daemon/api/web.js`:
44
44
  - **Same origin / same port** as the daemon (default `127.0.0.1:7430`).
45
45
  - The daemon serves `dist/` from `/` and does an SPA fallback for unknown
46
46
  GETs that aren't an API prefix.
47
- - `GET /admin/web-token` returns the bearer for loopback callers, so the
47
+ - `GET /api/admin/web-token` returns the bearer for loopback callers, so the
48
48
  panel can authenticate every subsequent request.
49
49
 
50
- In development, `pnpm dev` boots Vite on `:7431` and proxies `/projects`,
51
- `/telegram`, `/admin`, etc. → `127.0.0.1:7430`. Hot reload, real daemon.
50
+ In development, `pnpm dev` boots Vite on `:7431` and proxies `/api` (the whole
51
+ daemon surface, WebSocket included) → `127.0.0.1:7430`. Hot reload, real daemon.
52
52
 
53
53
  ## Project typology
54
54
 
@@ -95,8 +95,8 @@ read-only:
95
95
  - [ ] Edit per-project config inline (today: JSON viewer; needs form).
96
96
  - [ ] Create / edit telegram channels from the panel (today: list-only).
97
97
  - [ ] Run / enable / disable a routine from the panel (today: list).
98
- - [ ] Threads view: render `/projects/:pid/agents/:slug/conversations`.
99
- - [ ] APX self-chat surface (call /super-agent/chat/stream).
98
+ - [ ] Threads view: render `/api/projects/:pid/agents/:slug/conversations`.
99
+ - [ ] APX self-chat surface (call /api/super-agent/chat/stream).
100
100
  - [ ] Light theme toggle (tokens are there; missing the button).
101
101
 
102
102
  Adding any of these is a single screen edit + an existing daemon endpoint.