@agentprojectcontext/apx 1.77.3 → 1.78.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 (293) 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 +13 -48
  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/tools/handlers/call-runtime.js +4 -4
  15. package/src/core/agent/tools/handlers/search-sessions.js +1 -1
  16. package/src/core/agent/tools/handlers/set-permission-mode.js +11 -4
  17. package/src/core/agent/tools/names.js +58 -0
  18. package/src/core/apc/context-copy.js +1 -1
  19. package/src/core/apc/frontmatter.js +85 -0
  20. package/src/core/apc/parser.js +9 -21
  21. package/src/core/apc/paths.js +8 -8
  22. package/src/core/apc/scaffold.js +5 -4
  23. package/src/core/channels/telegram/config.js +201 -0
  24. package/src/core/config/index.js +25 -183
  25. package/src/core/config/paths.js +54 -1
  26. package/src/core/confirmation/adapters/web.js +1 -1
  27. package/src/core/deck/manifest.js +12 -12
  28. package/src/core/desktop/autostart.js +3 -2
  29. package/src/core/desktop/process.js +4 -4
  30. package/src/core/engines/presets.js +2 -2
  31. package/src/core/http-tools/browser.js +1 -1
  32. package/src/core/http-tools/catalog.js +551 -0
  33. package/src/core/http-tools/fetch.js +1 -1
  34. package/src/core/http-tools/glob.js +3 -3
  35. package/src/core/http-tools/grep.js +2 -9
  36. package/src/core/http-tools/inline-handlers.js +59 -0
  37. package/src/core/http-tools/registry.js +31 -615
  38. package/src/core/http-tools/search.js +2 -2
  39. package/src/core/identity/self.js +6 -7
  40. package/src/core/identity/telegram.js +3 -3
  41. package/src/core/logging.js +6 -5
  42. package/src/core/mcp/sources.js +12 -16
  43. package/src/core/memory/indexer.js +2 -5
  44. package/src/core/profiles/lifecycle.js +0 -2
  45. package/src/core/profiles/store.js +2 -7
  46. package/src/core/routines/runner.js +1 -1
  47. package/src/core/runtime-skills/apx-agency-agents/SKILL.md +2 -2
  48. package/src/core/runtime-skills/apx-profile/SKILL.md +3 -3
  49. package/src/core/runtime-skills/apx-project/SKILL.md +1 -1
  50. package/src/core/runtime-skills/apx-task/SKILL.md +8 -8
  51. package/src/core/runtime-skills/apx-telegram/SKILL.md +4 -4
  52. package/src/core/runtime-skills/apx-voice/SKILL.md +4 -4
  53. package/src/core/runtimes/detect.js +2 -2
  54. package/src/core/sessions/index.js +800 -0
  55. package/src/core/stores/code-sessions.js +3 -14
  56. package/src/core/stores/engine-sessions.js +0 -4
  57. package/src/core/stores/messages.js +0 -5
  58. package/src/core/stores/organization.js +9 -11
  59. package/src/core/stores/routines.js +6 -11
  60. package/src/core/stores/runtime-callbacks.js +2 -1
  61. package/src/core/util/json-file.js +128 -0
  62. package/src/core/vars/sources.js +14 -21
  63. package/src/core/voice/stt-models.js +1 -1
  64. package/src/core/voice/tts.js +5 -4
  65. package/src/host/daemon/api/admin-config.js +5 -5
  66. package/src/host/daemon/api/admin.js +8 -7
  67. package/src/host/daemon/api/agents.js +16 -16
  68. package/src/host/daemon/api/artifact-preview.js +8 -8
  69. package/src/host/daemon/api/artifacts.js +7 -7
  70. package/src/host/daemon/api/code.js +8 -8
  71. package/src/host/daemon/api/config.js +6 -6
  72. package/src/host/daemon/api/confirm.js +2 -2
  73. package/src/host/daemon/api/connections.js +2 -2
  74. package/src/host/daemon/api/conversations.js +12 -12
  75. package/src/host/daemon/api/deck.js +6 -6
  76. package/src/host/daemon/api/desktop.js +8 -8
  77. package/src/host/daemon/api/embeddings.js +4 -4
  78. package/src/host/daemon/api/engines.js +8 -7
  79. package/src/host/daemon/api/exec.js +5 -4
  80. package/src/host/daemon/api/files-project.js +6 -6
  81. package/src/host/daemon/api/health.js +2 -2
  82. package/src/host/daemon/api/identity.js +3 -3
  83. package/src/host/daemon/api/inbox.js +2 -2
  84. package/src/host/daemon/api/integrations.js +23 -19
  85. package/src/host/daemon/api/mcps.js +16 -12
  86. package/src/host/daemon/api/messages.js +5 -5
  87. package/src/host/daemon/api/organization.js +8 -8
  88. package/src/host/daemon/api/pairing.js +6 -6
  89. package/src/host/daemon/api/plugins.js +3 -3
  90. package/src/host/daemon/api/prefix.js +20 -0
  91. package/src/host/daemon/api/profiles.js +9 -9
  92. package/src/host/daemon/api/projects.js +5 -5
  93. package/src/host/daemon/api/routines.js +8 -8
  94. package/src/host/daemon/api/run.js +2 -2
  95. package/src/host/daemon/api/runtimes.js +6 -6
  96. package/src/host/daemon/api/sessions-search.js +18 -11
  97. package/src/host/daemon/api/sessions.js +6 -6
  98. package/src/host/daemon/api/shared.js +59 -13
  99. package/src/host/daemon/api/skills.js +12 -12
  100. package/src/host/daemon/api/super-agent.js +4 -4
  101. package/src/host/daemon/api/tasks.js +11 -11
  102. package/src/host/daemon/api/telegram.js +19 -20
  103. package/src/host/daemon/api/tools.js +7 -7
  104. package/src/host/daemon/api/top-level.js +7 -7
  105. package/src/host/daemon/api/transcribe.js +6 -6
  106. package/src/host/daemon/api/tts.js +3 -3
  107. package/src/host/daemon/api/vars.js +11 -8
  108. package/src/host/daemon/api/voice.js +6 -6
  109. package/src/host/daemon/api/web.js +28 -32
  110. package/src/host/daemon/api.js +77 -48
  111. package/src/host/daemon/db.js +1 -1
  112. package/src/host/daemon/desktop-ws.js +7 -3
  113. package/src/host/daemon/index.js +11 -5
  114. package/src/host/daemon/plugins/desktop/index.js +1 -1
  115. package/src/host/daemon/plugins/telegram/index.js +1 -1
  116. package/src/host/daemon/stt-venv.js +20 -81
  117. package/src/host/daemon/wakeup.js +1 -1
  118. package/src/interfaces/acp/index.js +3 -3
  119. package/src/interfaces/acp/session.js +2 -2
  120. package/src/interfaces/cli/commands/a2a.js +2 -2
  121. package/src/interfaces/cli/commands/agent.js +3 -3
  122. package/src/interfaces/cli/commands/artifact.js +13 -13
  123. package/src/interfaces/cli/commands/chat.js +3 -3
  124. package/src/interfaces/cli/commands/command.js +2 -2
  125. package/src/interfaces/cli/commands/config.js +4 -4
  126. package/src/interfaces/cli/commands/daemon.js +17 -18
  127. package/src/interfaces/cli/commands/desktop.js +7 -14
  128. package/src/interfaces/cli/commands/exec.js +2 -2
  129. package/src/interfaces/cli/commands/log.js +3 -4
  130. package/src/interfaces/cli/commands/mcp.js +9 -9
  131. package/src/interfaces/cli/commands/memory.js +2 -2
  132. package/src/interfaces/cli/commands/messages.js +5 -5
  133. package/src/interfaces/cli/commands/model.js +0 -18
  134. package/src/interfaces/cli/commands/obsidian.js +5 -5
  135. package/src/interfaces/cli/commands/org.js +5 -5
  136. package/src/interfaces/cli/commands/pair.js +6 -6
  137. package/src/interfaces/cli/commands/plugins.js +2 -2
  138. package/src/interfaces/cli/commands/profile.js +10 -10
  139. package/src/interfaces/cli/commands/project-config.js +6 -6
  140. package/src/interfaces/cli/commands/project.js +10 -10
  141. package/src/interfaces/cli/commands/routine.js +8 -9
  142. package/src/interfaces/cli/commands/runtime.js +2 -2
  143. package/src/interfaces/cli/commands/search.js +0 -1
  144. package/src/interfaces/cli/commands/session.js +12 -40
  145. package/src/interfaces/cli/commands/sessions.js +21 -798
  146. package/src/interfaces/cli/commands/setup.js +16 -6
  147. package/src/interfaces/cli/commands/skills.js +1 -2
  148. package/src/interfaces/cli/commands/status.js +3 -3
  149. package/src/interfaces/cli/commands/task.js +8 -8
  150. package/src/interfaces/cli/commands/telegram.js +21 -21
  151. package/src/interfaces/cli/commands/voice.js +6 -6
  152. package/src/interfaces/cli/help/index.js +2245 -0
  153. package/src/interfaces/cli/http.js +9 -4
  154. package/src/interfaces/cli/index.js +14 -2857
  155. package/src/interfaces/cli/routes/acp.js +13 -0
  156. package/src/interfaces/cli/routes/agent.js +27 -0
  157. package/src/interfaces/cli/routes/artifact.js +28 -0
  158. package/src/interfaces/cli/routes/chat.js +11 -0
  159. package/src/interfaces/cli/routes/code.js +11 -0
  160. package/src/interfaces/cli/routes/command.js +21 -0
  161. package/src/interfaces/cli/routes/config.js +16 -0
  162. package/src/interfaces/cli/routes/connections.js +11 -0
  163. package/src/interfaces/cli/routes/conversations.js +21 -0
  164. package/src/interfaces/cli/routes/daemon.js +19 -0
  165. package/src/interfaces/cli/routes/desktop.js +20 -0
  166. package/src/interfaces/cli/routes/env.js +13 -0
  167. package/src/interfaces/cli/routes/exec.js +11 -0
  168. package/src/interfaces/cli/routes/identity.js +11 -0
  169. package/src/interfaces/cli/routes/index.js +71 -0
  170. package/src/interfaces/cli/routes/init.js +11 -0
  171. package/src/interfaces/cli/routes/log.js +20 -0
  172. package/src/interfaces/cli/routes/mcp.js +22 -0
  173. package/src/interfaces/cli/routes/memory.js +11 -0
  174. package/src/interfaces/cli/routes/messages.js +16 -0
  175. package/src/interfaces/cli/routes/model.js +11 -0
  176. package/src/interfaces/cli/routes/obsidian.js +17 -0
  177. package/src/interfaces/cli/routes/org.js +34 -0
  178. package/src/interfaces/cli/routes/overlay.js +10 -0
  179. package/src/interfaces/cli/routes/pair.js +17 -0
  180. package/src/interfaces/cli/routes/panel.js +16 -0
  181. package/src/interfaces/cli/routes/permission.js +11 -0
  182. package/src/interfaces/cli/routes/plugins.js +21 -0
  183. package/src/interfaces/cli/routes/profile.js +27 -0
  184. package/src/interfaces/cli/routes/project.js +41 -0
  185. package/src/interfaces/cli/routes/restart.js +15 -0
  186. package/src/interfaces/cli/routes/routine.js +28 -0
  187. package/src/interfaces/cli/routes/run.js +11 -0
  188. package/src/interfaces/cli/routes/search.js +11 -0
  189. package/src/interfaces/cli/routes/send.js +11 -0
  190. package/src/interfaces/cli/routes/session.js +26 -0
  191. package/src/interfaces/cli/routes/sessions.js +15 -0
  192. package/src/interfaces/cli/routes/setup.js +18 -0
  193. package/src/interfaces/cli/routes/skills.js +20 -0
  194. package/src/interfaces/cli/routes/status.js +12 -0
  195. package/src/interfaces/cli/routes/task.js +26 -0
  196. package/src/interfaces/cli/routes/telegram.js +39 -0
  197. package/src/interfaces/cli/routes/update.js +24 -0
  198. package/src/interfaces/cli/routes/voice.js +17 -0
  199. package/src/interfaces/desktop/main.js +6 -7
  200. package/src/interfaces/desktop/renderer.js +0 -5
  201. package/src/interfaces/mcp-server/index.js +15 -14
  202. package/src/interfaces/tui/_shims/globals.d.ts +8 -0
  203. package/src/interfaces/tui/tsconfig.json +4 -1
  204. package/src/interfaces/web/README.md +6 -6
  205. package/src/interfaces/web/dist/assets/{index-BptlbKjU.js → index-CBR_-QyA.js} +52 -52
  206. package/src/interfaces/web/dist/assets/index-CBR_-QyA.js.map +1 -0
  207. package/src/interfaces/web/dist/index.html +1 -1
  208. package/src/interfaces/web/src/components/AddProjectDialog.tsx +1 -1
  209. package/src/interfaces/web/src/components/agents/AgentFormFields.tsx +1 -1
  210. package/src/interfaces/web/src/components/chat/ChatList.tsx +2 -2
  211. package/src/interfaces/web/src/components/chat/SkillPicker.tsx +1 -1
  212. package/src/interfaces/web/src/components/code/CodeFileTree.tsx +1 -1
  213. package/src/interfaces/web/src/components/code/CodeTerminal.tsx +1 -1
  214. package/src/interfaces/web/src/components/desktop/DesktopStatusCard.tsx +1 -1
  215. package/src/interfaces/web/src/components/files/FileBrowser.tsx +2 -2
  216. package/src/interfaces/web/src/components/memory/MemoryBrowser.tsx +2 -2
  217. package/src/interfaces/web/src/components/routines/ExecutionsList.tsx +1 -1
  218. package/src/interfaces/web/src/components/routines/RoutineEditor.tsx +2 -2
  219. package/src/interfaces/web/src/components/settings/DesktopSettingsPanel.tsx +1 -1
  220. package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +1 -1
  221. package/src/interfaces/web/src/components/settings/SkillsInspectorPanel.tsx +1 -1
  222. package/src/interfaces/web/src/components/settings/SkillsManager.tsx +2 -2
  223. package/src/interfaces/web/src/components/tasks/TaskDetailPanel.tsx +1 -1
  224. package/src/interfaces/web/src/hooks/useDaemonStatus.ts +1 -1
  225. package/src/interfaces/web/src/hooks/useDevices.ts +1 -1
  226. package/src/interfaces/web/src/hooks/useEngines.ts +1 -1
  227. package/src/interfaces/web/src/hooks/useGlobalConfig.ts +2 -2
  228. package/src/interfaces/web/src/hooks/useIdentity.ts +1 -1
  229. package/src/interfaces/web/src/hooks/useInbox.ts +1 -1
  230. package/src/interfaces/web/src/hooks/useProfiles.ts +3 -3
  231. package/src/interfaces/web/src/hooks/useProjects.ts +1 -1
  232. package/src/interfaces/web/src/hooks/useTelegram.ts +3 -3
  233. package/src/interfaces/web/src/hooks/useTokenBootstrap.ts +3 -3
  234. package/src/interfaces/web/src/lib/api/admin.ts +11 -11
  235. package/src/interfaces/web/src/lib/api/agents.ts +14 -14
  236. package/src/interfaces/web/src/lib/api/artifacts.ts +11 -11
  237. package/src/interfaces/web/src/lib/api/code.ts +1 -1
  238. package/src/interfaces/web/src/lib/api/conversations.ts +8 -8
  239. package/src/interfaces/web/src/lib/api/deck.ts +3 -3
  240. package/src/interfaces/web/src/lib/api/desktop.ts +8 -8
  241. package/src/interfaces/web/src/lib/api/embeddings.ts +3 -3
  242. package/src/interfaces/web/src/lib/api/engines.ts +3 -3
  243. package/src/interfaces/web/src/lib/api/filesystem.ts +2 -2
  244. package/src/interfaces/web/src/lib/api/health.ts +1 -1
  245. package/src/interfaces/web/src/lib/api/identity.ts +2 -2
  246. package/src/interfaces/web/src/lib/api/inbox.ts +1 -1
  247. package/src/interfaces/web/src/lib/api/integrations.ts +8 -8
  248. package/src/interfaces/web/src/lib/api/mcps.ts +6 -6
  249. package/src/interfaces/web/src/lib/api/messages.ts +3 -3
  250. package/src/interfaces/web/src/lib/api/organization.ts +7 -7
  251. package/src/interfaces/web/src/lib/api/profiles.ts +8 -8
  252. package/src/interfaces/web/src/lib/api/projectFiles.ts +5 -5
  253. package/src/interfaces/web/src/lib/api/projects.ts +12 -12
  254. package/src/interfaces/web/src/lib/api/routines.ts +7 -7
  255. package/src/interfaces/web/src/lib/api/sessions.ts +2 -2
  256. package/src/interfaces/web/src/lib/api/skills.ts +11 -11
  257. package/src/interfaces/web/src/lib/api/super_agent.ts +3 -3
  258. package/src/interfaces/web/src/lib/api/tasks.ts +12 -12
  259. package/src/interfaces/web/src/lib/api/telegram.ts +14 -14
  260. package/src/interfaces/web/src/lib/api/tools.ts +1 -1
  261. package/src/interfaces/web/src/lib/api/vars.ts +4 -4
  262. package/src/interfaces/web/src/lib/api/voice.ts +6 -6
  263. package/src/interfaces/web/src/screens/base/AgentDefaultsTab.tsx +1 -1
  264. package/src/interfaces/web/src/screens/base/GlobalTasksTab.tsx +1 -1
  265. package/src/interfaces/web/src/screens/base/LogsTab.tsx +3 -3
  266. package/src/interfaces/web/src/screens/base/SessionsTab.tsx +1 -1
  267. package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
  268. package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +1 -1
  269. package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +1 -1
  270. package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +1 -1
  271. package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +8 -8
  272. package/src/interfaces/web/src/screens/project/AgentsTab.tsx +2 -2
  273. package/src/interfaces/web/src/screens/project/ChatTab.tsx +3 -3
  274. package/src/interfaces/web/src/screens/project/ConfigTab.tsx +1 -1
  275. package/src/interfaces/web/src/screens/project/McpsTab.tsx +3 -3
  276. package/src/interfaces/web/src/screens/project/Overview.tsx +6 -6
  277. package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +2 -2
  278. package/src/interfaces/web/src/screens/project/StructureTab.tsx +1 -1
  279. package/src/interfaces/web/src/screens/project/TasksTab.tsx +1 -1
  280. package/src/interfaces/web/src/screens/project/VarsTab.tsx +1 -1
  281. package/src/interfaces/web/vite.config.ts +13 -18
  282. package/src/interfaces/web/dist/assets/index-BptlbKjU.js.map +0 -1
  283. package/src/skills/apc-context/SKILL.md +0 -159
  284. /package/src/{host/daemon → core}/runtimes/_spawn.js +0 -0
  285. /package/src/{host/daemon → core}/runtimes/aider.js +0 -0
  286. /package/src/{host/daemon → core}/runtimes/antigravity.js +0 -0
  287. /package/src/{host/daemon → core}/runtimes/claude-code.js +0 -0
  288. /package/src/{host/daemon → core}/runtimes/codex.js +0 -0
  289. /package/src/{host/daemon → core}/runtimes/cursor-agent.js +0 -0
  290. /package/src/{host/daemon → core}/runtimes/gemini-cli.js +0 -0
  291. /package/src/{host/daemon → core}/runtimes/index.js +0 -0
  292. /package/src/{host/daemon → core}/runtimes/opencode.js +0 -0
  293. /package/src/{host/daemon → core}/runtimes/qwen-code.js +0 -0
@@ -5,7 +5,7 @@ import { http } from "../http";
5
5
  //
6
6
  // The desktop window is an Electron app spawned by the CLI (`apx desktop start`),
7
7
  // NOT by the daemon — so the daemon can only report how many windows are
8
- // currently connected over the /desktop/ws WebSocket. The web admin shows that
8
+ // currently connected over the /api/desktop/ws WebSocket. The web admin shows that
9
9
  // status, edits persisted config (desktop.shortcut, desktop.enabled,
10
10
  // desktop.theme, desktop.position), and toggles login-item autostart via the
11
11
  // shared autostart helpers (core/desktop/autostart.js).
@@ -43,23 +43,23 @@ export interface AutostartStatus {
43
43
 
44
44
  export const Desktop = {
45
45
  /** GET /desktop/status — connected window count + running flag (live probe). */
46
- status: () => http.get<DesktopStatus>("/desktop/status"),
46
+ status: () => http.get<DesktopStatus>("/api/desktop/status"),
47
47
 
48
48
  /** POST /desktop/start — launch the floating window (detached Electron). */
49
- start: () => http.post<DesktopStartResult>("/desktop/start", {}),
49
+ start: () => http.post<DesktopStartResult>("/api/desktop/start", {}),
50
50
 
51
51
  /** POST /desktop/stop — terminate the running window. */
52
- stop: () => http.post<DesktopStopResult>("/desktop/stop", {}),
52
+ stop: () => http.post<DesktopStopResult>("/api/desktop/stop", {}),
53
53
 
54
54
  /** POST /desktop/restart — tell every live window to reload + re-read config. */
55
- restart: () => http.post<DesktopRestartResult>("/desktop/restart", {}),
55
+ restart: () => http.post<DesktopRestartResult>("/api/desktop/restart", {}),
56
56
 
57
57
  /** GET /desktop/autostart — current login-item state for this platform. */
58
- autostartGet: () => http.get<AutostartStatus>("/desktop/autostart"),
58
+ autostartGet: () => http.get<AutostartStatus>("/api/desktop/autostart"),
59
59
 
60
60
  /** POST /desktop/autostart {enable} — toggle the login-item on or off. */
61
61
  autostartSet: (enable: boolean) =>
62
- http.post<AutostartStatus>("/desktop/autostart", { enable }),
62
+ http.post<AutostartStatus>("/api/desktop/autostart", { enable }),
63
63
  };
64
64
 
65
65
  // Last-N messages for the "desktop" global channel (preview the latest
@@ -78,5 +78,5 @@ export interface GlobalMessage {
78
78
  }
79
79
 
80
80
  export function fetchDesktopMessages(limit = 30) {
81
- return http.get<GlobalMessage[]>(`/messages/global?channel=desktop&limit=${limit}`);
81
+ return http.get<GlobalMessage[]>(`/api/messages/global?channel=desktop&limit=${limit}`);
82
82
  }
@@ -37,8 +37,8 @@ export interface EmbedReindexResult {
37
37
  }
38
38
 
39
39
  export const Embeddings = {
40
- providers: () => http.get<EmbedProvidersResponse>("/embeddings/providers"),
40
+ providers: () => http.get<EmbedProvidersResponse>("/api/embeddings/providers"),
41
41
  test: (body: { text?: string; provider?: string } = {}) =>
42
- http.post<EmbedTestResult>("/embeddings/test", body),
43
- reindex: () => http.post<EmbedReindexResult>("/embeddings/reindex", {}),
42
+ http.post<EmbedTestResult>("/api/embeddings/test", body),
43
+ reindex: () => http.post<EmbedReindexResult>("/api/embeddings/reindex", {}),
44
44
  };
@@ -20,12 +20,12 @@ export interface EnginePresets {
20
20
  }
21
21
 
22
22
  export const Engines = {
23
- list: () => http.get<EngineSummary>("/engines"),
23
+ list: () => http.get<EngineSummary>("/api/engines"),
24
24
  // Curated catalog (known models + defaults) shared with the CLI wizard. The
25
25
  // source of truth is src/core/engines/presets.js.
26
- presets: () => http.get<EnginePresets>("/engines/presets"),
26
+ presets: () => http.get<EnginePresets>("/api/engines/presets"),
27
27
  // Live model catalog. api_key optional: falls back to the stored secret for
28
28
  // the provider slug (so editing an existing provider works without retyping).
29
29
  models: (body: { engine: string; slug?: string; base_url?: string; api_key?: string }) =>
30
- http.post<EngineModels>("/engines/models", body),
30
+ http.post<EngineModels>("/api/engines/models", body),
31
31
  };
@@ -10,9 +10,9 @@ export type PickDirResult = { path: string } | { cancelled: true };
10
10
 
11
11
  export const Filesystem = {
12
12
  dirs: (path: string) =>
13
- http.get<DirectoryList>(`/admin/fs/dirs?path=${encodeURIComponent(path)}`),
13
+ http.get<DirectoryList>(`/api/admin/fs/dirs?path=${encodeURIComponent(path)}`),
14
14
  pickDir: (prompt?: string) =>
15
15
  http.get<PickDirResult>(
16
- `/admin/fs/pick-dir${prompt ? `?prompt=${encodeURIComponent(prompt)}` : ""}`,
16
+ `/api/admin/fs/pick-dir${prompt ? `?prompt=${encodeURIComponent(prompt)}` : ""}`,
17
17
  ),
18
18
  };
@@ -2,5 +2,5 @@ import { http } from "../http";
2
2
  import type { HealthSummary } from "../../types/daemon";
3
3
 
4
4
  export const Health = {
5
- get: () => http.get<HealthSummary>("/health"),
5
+ get: () => http.get<HealthSummary>("/api/health"),
6
6
  };
@@ -2,6 +2,6 @@ import { http } from "../http";
2
2
  import type { Identity } from "../../types/daemon";
3
3
 
4
4
  export const IdentityApi = {
5
- get: () => http.get<Identity>("/identity"),
6
- patch: (body: Partial<Identity>) => http.patch<Identity>("/identity", body),
5
+ get: () => http.get<Identity>("/api/identity"),
6
+ patch: (body: Partial<Identity>) => http.patch<Identity>("/api/identity", body),
7
7
  };
@@ -21,6 +21,6 @@ export interface InboxRow {
21
21
  export const Inbox = {
22
22
  list: (includeEmpty = false) =>
23
23
  http
24
- .get<unknown>(`/inbox${includeEmpty ? "?include_empty=1" : ""}`)
24
+ .get<unknown>(`/api/inbox${includeEmpty ? "?include_empty=1" : ""}`)
25
25
  .then((b) => unwrapPage<InboxRow>(b).items),
26
26
  };
@@ -103,28 +103,28 @@ const q = (scope: IntegrationScope) => `?scope=${scope}`;
103
103
 
104
104
  export const Integrations = {
105
105
  catalog: (pid: string) =>
106
- http.get<CatalogEntry[]>(`/projects/${pid}/integrations/catalog`),
106
+ http.get<CatalogEntry[]>(`/api/projects/${pid}/integrations/catalog`),
107
107
 
108
108
  list: (pid: string, scope: IntegrationScope = "project") =>
109
- http.get<IntegrationRecord[]>(`/projects/${pid}/integrations${q(scope)}`),
109
+ http.get<IntegrationRecord[]>(`/api/projects/${pid}/integrations${q(scope)}`),
110
110
 
111
111
  status: (pid: string, slug: string, scope: IntegrationScope = "project") =>
112
- http.get<IntegrationStatus>(`/projects/${pid}/integrations/${slug}${q(scope)}`),
112
+ http.get<IntegrationStatus>(`/api/projects/${pid}/integrations/${slug}${q(scope)}`),
113
113
 
114
114
  configure: (pid: string, slug: string, scope: IntegrationScope, body: Record<string, unknown>) =>
115
- http.post<IntegrationRecord>(`/projects/${pid}/integrations/${slug}/configure${q(scope)}`, body),
115
+ http.post<IntegrationRecord>(`/api/projects/${pid}/integrations/${slug}/configure${q(scope)}`, body),
116
116
 
117
117
  validate: (pid: string, slug: string, scope: IntegrationScope = "project") =>
118
- http.post<AsanaValidateResult>(`/projects/${pid}/integrations/${slug}/validate${q(scope)}`, {}),
118
+ http.post<AsanaValidateResult>(`/api/projects/${pid}/integrations/${slug}/validate${q(scope)}`, {}),
119
119
 
120
120
  deactivate: (pid: string, slug: string, scope: IntegrationScope = "project") =>
121
- http.post<IntegrationStatus>(`/projects/${pid}/integrations/${slug}/deactivate${q(scope)}`, {}),
121
+ http.post<IntegrationStatus>(`/api/projects/${pid}/integrations/${slug}/deactivate${q(scope)}`, {}),
122
122
 
123
123
  action: <T>(pid: string, slug: string, action: string, scope: IntegrationScope = "project") =>
124
- http.post<T>(`/projects/${pid}/integrations/${slug}/action/${action}${q(scope)}`, {}),
124
+ http.post<T>(`/api/projects/${pid}/integrations/${slug}/action/${action}${q(scope)}`, {}),
125
125
 
126
126
  remove: (pid: string, slug: string, scope: IntegrationScope = "project") =>
127
- http.del<void>(`/projects/${pid}/integrations/${slug}${q(scope)}`),
127
+ http.del<void>(`/api/projects/${pid}/integrations/${slug}${q(scope)}`),
128
128
 
129
129
  // ── Asana convenience wrappers ──────────────────────────────────────────────
130
130
  asanaConfigure: (pid: string, scope: IntegrationScope, body: AsanaConfigureBody) =>
@@ -41,14 +41,14 @@ export interface McpLogsResult {
41
41
  }
42
42
 
43
43
  export const Mcps = {
44
- list: (pid: string) => http.get<McpEntry[]>(`/projects/${pid}/mcps`),
45
- check: (pid: string) => http.get<McpCheck>(`/projects/${pid}/mcps/check`),
44
+ list: (pid: string) => http.get<McpEntry[]>(`/api/projects/${pid}/mcps`),
45
+ check: (pid: string) => http.get<McpCheck>(`/api/projects/${pid}/mcps/check`),
46
46
  add: (pid: string, scope: McpScope, body: McpAddBody) =>
47
- http.post<{ ok: true; name: string }>(`/projects/${pid}/mcps?scope=${scope}`, body),
47
+ http.post<{ ok: true; name: string }>(`/api/projects/${pid}/mcps?scope=${scope}`, body),
48
48
  remove: (pid: string, name: string, scope: McpScope = "shared") =>
49
- http.del<void>(`/projects/${pid}/mcps/${encodeURIComponent(name)}?scope=${scope}`),
49
+ http.del<void>(`/api/projects/${pid}/mcps/${encodeURIComponent(name)}?scope=${scope}`),
50
50
  test: (pid: string, name: string) =>
51
- http.post<McpTestResult>(`/projects/${pid}/mcps/${encodeURIComponent(name)}/test`, {}),
51
+ http.post<McpTestResult>(`/api/projects/${pid}/mcps/${encodeURIComponent(name)}/test`, {}),
52
52
  logs: (pid: string, name: string) =>
53
- http.get<McpLogsResult>(`/projects/${pid}/mcps/${encodeURIComponent(name)}/logs`),
53
+ http.get<McpLogsResult>(`/api/projects/${pid}/mcps/${encodeURIComponent(name)}/logs`),
54
54
  };
@@ -13,12 +13,12 @@ const qs = (params: Record<string, string | number | undefined>) => {
13
13
  export const Messages = {
14
14
  // Cross-project channels (telegram, direct, …) — ~/.apx/messages/<channel>/*.jsonl
15
15
  global: (opts: { channel?: string; limit?: number; since?: string } = {}) =>
16
- http.get<MessageEntry[]>(`/messages/global${qs(opts)}`),
16
+ http.get<MessageEntry[]>(`/api/messages/global${qs(opts)}`),
17
17
 
18
18
  // Per-project activity — ~/.apx/projects/<id>/messages/*.jsonl
19
19
  project: (pid: string, opts: { channel?: string; agent?: string; limit?: number; since?: string } = {}) =>
20
- http.get<MessageEntry[]>(`/projects/${pid}/messages${qs(opts)}`),
20
+ http.get<MessageEntry[]>(`/api/projects/${pid}/messages${qs(opts)}`),
21
21
 
22
22
  search: (pid: string, q: string, limit = 50) =>
23
- http.get<MessageEntry[]>(`/projects/${pid}/messages/search${qs({ q, limit })}`),
23
+ http.get<MessageEntry[]>(`/api/projects/${pid}/messages/search${qs({ q, limit })}`),
24
24
  };
@@ -2,17 +2,17 @@ import { http } from "../http";
2
2
  import type { Organization, OrgArea, OrgRole } from "../../types/daemon";
3
3
 
4
4
  export const Org = {
5
- get: (pid: string) => http.get<Organization>(`/projects/${pid}/organization`),
5
+ get: (pid: string) => http.get<Organization>(`/api/projects/${pid}/organization`),
6
6
  createArea: (pid: string, body: { name: string; slug?: string; goal?: string | null }) =>
7
- http.post<OrgArea>(`/projects/${pid}/organization/areas`, body),
7
+ http.post<OrgArea>(`/api/projects/${pid}/organization/areas`, body),
8
8
  updateArea: (pid: string, slug: string, patch: { name?: string; goal?: string | null }) =>
9
- http.patch<OrgArea>(`/projects/${pid}/organization/areas/${encodeURIComponent(slug)}`, patch),
9
+ http.patch<OrgArea>(`/api/projects/${pid}/organization/areas/${encodeURIComponent(slug)}`, patch),
10
10
  removeArea: (pid: string, slug: string) =>
11
- http.del<{ ok: boolean }>(`/projects/${pid}/organization/areas/${encodeURIComponent(slug)}`),
11
+ http.del<{ ok: boolean }>(`/api/projects/${pid}/organization/areas/${encodeURIComponent(slug)}`),
12
12
  createRole: (pid: string, body: { name: string; slug?: string; area?: string | null; description?: string | null }) =>
13
- http.post<OrgRole>(`/projects/${pid}/organization/roles`, body),
13
+ http.post<OrgRole>(`/api/projects/${pid}/organization/roles`, body),
14
14
  updateRole: (pid: string, slug: string, patch: { name?: string; area?: string | null; description?: string | null }) =>
15
- http.patch<OrgRole>(`/projects/${pid}/organization/roles/${encodeURIComponent(slug)}`, patch),
15
+ http.patch<OrgRole>(`/api/projects/${pid}/organization/roles/${encodeURIComponent(slug)}`, patch),
16
16
  removeRole: (pid: string, slug: string) =>
17
- http.del<{ ok: boolean }>(`/projects/${pid}/organization/roles/${encodeURIComponent(slug)}`),
17
+ http.del<{ ok: boolean }>(`/api/projects/${pid}/organization/roles/${encodeURIComponent(slug)}`),
18
18
  };
@@ -61,26 +61,26 @@ export type ProfileRoutineSync = {
61
61
  };
62
62
 
63
63
  export const ProfilesApi = {
64
- list: () => http.get<{ active: string | null; profiles: ProfileSummary[] }>("/profiles"),
65
- get: (id: string) => http.get<ProfileDetail>(`/profiles/${encodeURIComponent(id)}`),
64
+ list: () => http.get<{ active: string | null; profiles: ProfileSummary[] }>("/api/profiles"),
65
+ get: (id: string) => http.get<ProfileDetail>(`/api/profiles/${encodeURIComponent(id)}`),
66
66
  doctor: (id?: string) =>
67
- http.get<ProfileDoctor>(`/profiles/doctor${id ? `?id=${encodeURIComponent(id)}` : ""}`),
67
+ http.get<ProfileDoctor>(`/api/profiles/doctor${id ? `?id=${encodeURIComponent(id)}` : ""}`),
68
68
  install: (source: string, force = false) =>
69
69
  http.post<{ ok: true; profile: ProfileDetail; warnings: string[]; tokens: number }>(
70
- "/profiles/install",
70
+ "/api/profiles/install",
71
71
  { source, force }
72
72
  ),
73
73
  use: (id: string, force = false) =>
74
74
  http.post<{ ok: true; profile: ProfileDetail; routines: ProfileRoutineSync; warnings: string[] }>(
75
- "/profiles/use",
75
+ "/api/profiles/use",
76
76
  { id, force }
77
77
  ),
78
- off: () => http.post<{ ok: true; was: string | null; routines: string[] }>("/profiles/off", {}),
78
+ off: () => http.post<{ ok: true; was: string | null; routines: string[] }>("/api/profiles/off", {}),
79
79
  setConfig: (values: Record<string, unknown>, id?: string) =>
80
80
  http.patch<{ ok: true; config: Record<string, unknown>; changed: string[]; routines: ProfileRoutineSync }>(
81
- "/profiles/config",
81
+ "/api/profiles/config",
82
82
  { values, id }
83
83
  ),
84
84
  uninstall: (id: string) =>
85
- http.del<{ ok: true; id: string; source: string }>(`/profiles/${encodeURIComponent(id)}`),
85
+ http.del<{ ok: true; id: string; source: string }>(`/api/profiles/${encodeURIComponent(id)}`),
86
86
  };
@@ -7,13 +7,13 @@ export type FileScope = "project" | "docs";
7
7
  // repo ("project") or the docs subfolder ("docs"). Same store, different root.
8
8
  export const ProjectFiles = {
9
9
  tree: (pid: string, scope: FileScope = "project") =>
10
- http.get<FileTreeResponse>(`/projects/${pid}/fs/tree?scope=${scope}`),
10
+ http.get<FileTreeResponse>(`/api/projects/${pid}/fs/tree?scope=${scope}`),
11
11
  read: (pid: string, path: string, scope: FileScope = "project") =>
12
- http.get<FileContent>(`/projects/${pid}/fs/file?scope=${scope}&path=${encodeURIComponent(path)}`),
12
+ http.get<FileContent>(`/api/projects/${pid}/fs/file?scope=${scope}&path=${encodeURIComponent(path)}`),
13
13
  write: (pid: string, path: string, content: string, scope: FileScope = "project") =>
14
- http.put<{ ok: boolean; path: string; bytes: number }>(`/projects/${pid}/fs/file`, { scope, path, content }),
14
+ http.put<{ ok: boolean; path: string; bytes: number }>(`/api/projects/${pid}/fs/file`, { scope, path, content }),
15
15
  mkdir: (pid: string, path: string, scope: FileScope = "project") =>
16
- http.post<{ ok: boolean; path: string }>(`/projects/${pid}/fs/dir`, { scope, path }),
16
+ http.post<{ ok: boolean; path: string }>(`/api/projects/${pid}/fs/dir`, { scope, path }),
17
17
  remove: (pid: string, path: string, scope: FileScope = "project") =>
18
- http.del<{ ok: boolean }>(`/projects/${pid}/fs/entry?scope=${scope}&path=${encodeURIComponent(path)}`),
18
+ http.del<{ ok: boolean }>(`/api/projects/${pid}/fs/entry?scope=${scope}&path=${encodeURIComponent(path)}`),
19
19
  };
@@ -2,28 +2,28 @@ import { http } from "../http";
2
2
  import type { ProjectConfig, ProjectEntry } from "../../types/daemon";
3
3
 
4
4
  export const Projects = {
5
- list: () => http.get<ProjectEntry[]>("/projects"),
6
- register:(path: string) => http.post<{ id: number; path: string }>("/projects", { path }),
7
- remove: (id: string) => http.del<void>(`/projects/${encodeURIComponent(id)}`),
8
- rebuild: (id: string) => http.post<{ ok: true }>(`/projects/${encodeURIComponent(id)}/rebuild`),
5
+ list: () => http.get<ProjectEntry[]>("/api/projects"),
6
+ register:(path: string) => http.post<{ id: number; path: string }>("/api/projects", { path }),
7
+ remove: (id: string) => http.del<void>(`/api/projects/${encodeURIComponent(id)}`),
8
+ rebuild: (id: string) => http.post<{ ok: true }>(`/api/projects/${encodeURIComponent(id)}/rebuild`),
9
9
  config: {
10
- show: (id: string) => http.get<ProjectConfig>(`/projects/${id}/config`),
10
+ show: (id: string) => http.get<ProjectConfig>(`/api/projects/${id}/config`),
11
11
  set: (id: string, set: Record<string, unknown>) =>
12
- http.patch<{ ok: true }>(`/projects/${id}/config`, { set }),
12
+ http.patch<{ ok: true }>(`/api/projects/${id}/config`, { set }),
13
13
  unset: (id: string, keys: string[]) =>
14
- http.patch<{ ok: true }>(`/projects/${id}/config`, { unset: keys }),
14
+ http.patch<{ ok: true }>(`/api/projects/${id}/config`, { unset: keys }),
15
15
  put: (id: string, full: Record<string, unknown>) =>
16
- http.put<{ ok: true }>(`/projects/${id}/config`, full),
16
+ http.put<{ ok: true }>(`/api/projects/${id}/config`, full),
17
17
  },
18
18
  apcProject: {
19
19
  set: (id: string, set: Record<string, unknown>, unset?: string[]) =>
20
- http.patch<{ ok: true; apc_project: Record<string, unknown> }>(`/projects/${id}/apc-project`, { set, unset }),
20
+ http.patch<{ ok: true; apc_project: Record<string, unknown> }>(`/api/projects/${id}/apc-project`, { set, unset }),
21
21
  put: (id: string, full: Record<string, unknown>) =>
22
- http.put<{ ok: true; apc_project: Record<string, unknown> }>(`/projects/${id}/apc-project`, full),
22
+ http.put<{ ok: true; apc_project: Record<string, unknown> }>(`/api/projects/${id}/apc-project`, full),
23
23
  },
24
24
  // Project-level memory (.apc/memory.md). Per-agent memory lives in Agents.memory.
25
25
  memory: {
26
- get: (id: string) => http.get<{ body: string; path: string }>(`/projects/${id}/memory`),
27
- put: (id: string, body: string) => http.put<{ ok: boolean; bytes: number }>(`/projects/${id}/memory`, { body }),
26
+ get: (id: string) => http.get<{ body: string; path: string }>(`/api/projects/${id}/memory`),
27
+ put: (id: string, body: string) => http.put<{ ok: boolean; bytes: number }>(`/api/projects/${id}/memory`, { body }),
28
28
  },
29
29
  };
@@ -2,13 +2,13 @@ import { http } from "../http";
2
2
  import type { RoutineEntry } from "../../types/daemon";
3
3
 
4
4
  export const Routines = {
5
- list: (pid: string) => http.get<RoutineEntry[]>(`/projects/${pid}/routines`),
6
- get: (pid: string, name: string) => http.get<RoutineEntry>(`/projects/${pid}/routines/${name}`),
7
- run: (pid: string, name: string) => http.post<unknown>(`/projects/${pid}/routines/${name}/run`),
8
- enable: (pid: string, name: string) => http.post<unknown>(`/projects/${pid}/routines/${name}/enable`),
9
- disable: (pid: string, name: string) => http.post<unknown>(`/projects/${pid}/routines/${name}/disable`),
5
+ list: (pid: string) => http.get<RoutineEntry[]>(`/api/projects/${pid}/routines`),
6
+ get: (pid: string, name: string) => http.get<RoutineEntry>(`/api/projects/${pid}/routines/${name}`),
7
+ run: (pid: string, name: string) => http.post<unknown>(`/api/projects/${pid}/routines/${name}/run`),
8
+ enable: (pid: string, name: string) => http.post<unknown>(`/api/projects/${pid}/routines/${name}/enable`),
9
+ disable: (pid: string, name: string) => http.post<unknown>(`/api/projects/${pid}/routines/${name}/disable`),
10
10
  upsert: (pid: string, body: Partial<RoutineEntry>) =>
11
- http.post<RoutineEntry>(`/projects/${pid}/routines`, body),
11
+ http.post<RoutineEntry>(`/api/projects/${pid}/routines`, body),
12
12
  remove: (pid: string, name: string) =>
13
- http.del<void>(`/projects/${pid}/routines/${encodeURIComponent(name)}`),
13
+ http.del<void>(`/api/projects/${pid}/routines/${encodeURIComponent(name)}`),
14
14
  };
@@ -15,7 +15,7 @@ export const Sessions = {
15
15
  // Cross-engine sessions (apx · claude · codex), newest first — full set.
16
16
  global: (engine?: string) =>
17
17
  http
18
- .get<unknown>(`/sessions${engine ? `?engine=${encodeURIComponent(engine)}` : ""}`)
18
+ .get<unknown>(`/api/sessions${engine ? `?engine=${encodeURIComponent(engine)}` : ""}`)
19
19
  .then((b) => ({ sessions: unwrapPage<SessionRow>(b).items })),
20
20
  // Server-paginated page. Optional `q` runs the same search core as
21
21
  // `apx session find` (title; + transcript content when `deep`).
@@ -25,6 +25,6 @@ export const Sessions = {
25
25
  if (q?.trim()) params.set("q", q.trim());
26
26
  if (deep) params.set("deep", "1");
27
27
  if (cwd?.trim()) params.set("cwd", cwd.trim());
28
- return http.get<unknown>(`/sessions?${params.toString()}`).then((b) => unwrapPage<SessionRow>(b));
28
+ return http.get<unknown>(`/api/sessions?${params.toString()}`).then((b) => unwrapPage<SessionRow>(b));
29
29
  },
30
30
  };
@@ -102,13 +102,13 @@ export const Skills = {
102
102
  qs.set("scope", projectPath);
103
103
  }
104
104
  const q = qs.toString();
105
- return http.get<SkillsList>(q ? `/skills?${q}` : "/skills");
105
+ return http.get<SkillsList>(q ? `/api/skills?${q}` : "/api/skills");
106
106
  },
107
107
 
108
108
  /** Full body + frontmatter of a skill, for the viewer. */
109
109
  detail: (slug: string, projectPath?: string) => {
110
110
  const qs = projectPath ? `?project_path=${encodeURIComponent(projectPath)}` : "";
111
- return http.get<SkillDetail>(`/skills/${encodeURIComponent(slug)}/detail${qs}`);
111
+ return http.get<SkillDetail>(`/api/skills/${encodeURIComponent(slug)}/detail${qs}`);
112
112
  },
113
113
 
114
114
  /**
@@ -118,7 +118,7 @@ export const Skills = {
118
118
  */
119
119
  setEnabled: (body: { slug: string; enabled: boolean | null; scope?: string }) =>
120
120
  http.put<{ ok: boolean; slug: string; scope: string; enabled: boolean | null }>(
121
- "/skills/enabled",
121
+ "/api/skills/enabled",
122
122
  body,
123
123
  ),
124
124
 
@@ -127,39 +127,39 @@ export const Skills = {
127
127
  * that project's .apc/skills/; otherwise in ~/.apx/skills/.
128
128
  */
129
129
  create: (body: { slug: string; description?: string; body?: string; project_path?: string }) =>
130
- http.post<CreateResult>("/skills", body),
130
+ http.post<CreateResult>("/api/skills", body),
131
131
 
132
132
  /** Import a skill from an uploaded .zip (base64-encoded). */
133
133
  importZip: (body: { data: string; project_path?: string }) =>
134
- http.post<CreateResult>("/skills/import/zip", body),
134
+ http.post<CreateResult>("/api/skills/import/zip", body),
135
135
 
136
136
  /** Import a skill by cloning a git repo. */
137
137
  importRepo: (body: { url: string; project_path?: string }) =>
138
- http.post<CreateResult>("/skills/import/repo", body),
138
+ http.post<CreateResult>("/api/skills/import/repo", body),
139
139
 
140
140
  /** Delete a user skill (global or project-scoped). */
141
141
  remove: (slug: string, projectPath?: string) => {
142
142
  const qs = projectPath ? `?project_path=${encodeURIComponent(projectPath)}` : "";
143
- return http.del<{ ok: boolean; slug: string }>(`/skills/${encodeURIComponent(slug)}${qs}`);
143
+ return http.del<{ ok: boolean; slug: string }>(`/api/skills/${encodeURIComponent(slug)}${qs}`);
144
144
  },
145
145
 
146
146
  /** Skill Inspector config + index status. */
147
- inspector: () => http.get<InspectorState>("/skills/inspector"),
147
+ inspector: () => http.get<InspectorState>("/api/skills/inspector"),
148
148
 
149
149
  /** Patch inspector config (toggle / tune thresholds). */
150
150
  updateInspector: (patch: Partial<InspectorConfig>) =>
151
151
  http.put<{ ok: boolean; config: InspectorConfig; index: IndexStatus }>(
152
- "/skills/inspector",
152
+ "/api/skills/inspector",
153
153
  patch,
154
154
  ),
155
155
 
156
156
  /** (Re)build the inspector vector index. */
157
157
  index: (body: { project_path?: string; force?: boolean } = {}) =>
158
- http.post<IndexResult>("/skills/index", body),
158
+ http.post<IndexResult>("/api/skills/index", body),
159
159
 
160
160
  /** Dry-run the inspector for a prompt (forces enabled). */
161
161
  inspect: (prompt: string, projectPath?: string) =>
162
- http.post<InspectResult>("/skills/inspect", {
162
+ http.post<InspectResult>("/api/skills/inspect", {
163
163
  prompt,
164
164
  project_path: projectPath,
165
165
  }),
@@ -14,7 +14,7 @@ export interface SuperAgentSendBody {
14
14
  export const SuperAgent = {
15
15
  send: (pid: string | number, body: SuperAgentSendBody) =>
16
16
  http.post<{ text: string; usage?: unknown; name?: string }>(
17
- `/projects/${pid}/super-agent/chat`,
17
+ `/api/projects/${pid}/super-agent/chat`,
18
18
  body,
19
19
  ),
20
20
  stream: (
@@ -22,8 +22,8 @@ export const SuperAgent = {
22
22
  body: SuperAgentSendBody,
23
23
  onEvent: (ev: ChatStreamEvent) => void,
24
24
  signal?: AbortSignal,
25
- ) => streamNdjson<ChatStreamEvent>(`/projects/${pid}/super-agent/chat/stream`, body, onEvent, signal),
25
+ ) => streamNdjson<ChatStreamEvent>(`/api/projects/${pid}/super-agent/chat/stream`, body, onEvent, signal),
26
26
 
27
27
  summarize: (body: { prompt: string; context_note?: string; model?: string }) =>
28
- http.post<{ text: string; usage?: unknown; name?: string }>("/super-agent/summarize", body),
28
+ http.post<{ text: string; usage?: unknown; name?: string }>("/api/super-agent/summarize", body),
29
29
  };
@@ -18,28 +18,28 @@ export interface TaskSummary {
18
18
  export const Tasks = {
19
19
  // Full sets (no pagination) — unwrapped to plain arrays for non-paged callers.
20
20
  list: (pid: string, state: TaskEntry["state"] | "all" = "open") =>
21
- http.get<unknown>(`/projects/${pid}/tasks?state=${state}`).then((b) => unwrapPage<TaskEntry>(b).items),
21
+ http.get<unknown>(`/api/projects/${pid}/tasks?state=${state}`).then((b) => unwrapPage<TaskEntry>(b).items),
22
22
  global: (state: TaskEntry["state"] | "all" = "open") =>
23
- http.get<unknown>(`/tasks?state=${state}`).then((b) => unwrapPage<GlobalTaskEntry>(b).items),
23
+ http.get<unknown>(`/api/tasks?state=${state}`).then((b) => unwrapPage<GlobalTaskEntry>(b).items),
24
24
  // Server-paginated variants: one project (listPage) or all projects
25
25
  // (globalPage). Each returns the requested window plus the full total.
26
26
  listPage: (pid: string, { state, limit, offset }: { state: TaskEntry["state"] | "all"; limit: number; offset: number }) =>
27
- http.get<unknown>(`/projects/${pid}/tasks?state=${state}&limit=${limit}&offset=${offset}`).then((b) => unwrapPage<TaskEntry>(b)),
27
+ http.get<unknown>(`/api/projects/${pid}/tasks?state=${state}&limit=${limit}&offset=${offset}`).then((b) => unwrapPage<TaskEntry>(b)),
28
28
  globalPage: ({ state, limit, offset, status }: { state: TaskEntry["state"] | "all"; limit: number; offset: number; status?: TaskStatus | "" }) =>
29
29
  http
30
30
  .get<unknown>(
31
- `/tasks?state=${state}&limit=${limit}&offset=${offset}` + (status ? `&status=${status}` : ""),
31
+ `/api/tasks?state=${state}&limit=${limit}&offset=${offset}` + (status ? `&status=${status}` : ""),
32
32
  )
33
33
  .then((b) => unwrapPage<GlobalTaskEntry>(b)),
34
- get: (pid: string, id: string) => http.get<TaskEntry>(`/projects/${pid}/tasks/${id}`),
34
+ get: (pid: string, id: string) => http.get<TaskEntry>(`/api/projects/${pid}/tasks/${id}`),
35
35
  add: (pid: string, body: Partial<TaskEntry>) =>
36
- http.post<TaskEntry>(`/projects/${pid}/tasks`, body),
36
+ http.post<TaskEntry>(`/api/projects/${pid}/tasks`, body),
37
37
  patch: (pid: string, id: string, patch: Partial<TaskEntry>) =>
38
- http.patch<TaskEntry>(`/projects/${pid}/tasks/${id}`, { patch }),
38
+ http.patch<TaskEntry>(`/api/projects/${pid}/tasks/${id}`, { patch }),
39
39
  status: (pid: string, id: string, status: TaskStatus) =>
40
- http.post<TaskEntry>(`/projects/${pid}/tasks/${id}/status`, { status }),
41
- done: (pid: string, id: string) => http.post<TaskEntry>(`/projects/${pid}/tasks/${id}/done`),
42
- drop: (pid: string, id: string) => http.post<TaskEntry>(`/projects/${pid}/tasks/${id}/drop`),
43
- reopen: (pid: string, id: string) => http.post<TaskEntry>(`/projects/${pid}/tasks/${id}/reopen`),
44
- summary: (pid: string) => http.get<TaskSummary>(`/projects/${pid}/tasks-summary`),
40
+ http.post<TaskEntry>(`/api/projects/${pid}/tasks/${id}/status`, { status }),
41
+ done: (pid: string, id: string) => http.post<TaskEntry>(`/api/projects/${pid}/tasks/${id}/done`),
42
+ drop: (pid: string, id: string) => http.post<TaskEntry>(`/api/projects/${pid}/tasks/${id}/drop`),
43
+ reopen: (pid: string, id: string) => http.post<TaskEntry>(`/api/projects/${pid}/tasks/${id}/reopen`),
44
+ summary: (pid: string) => http.get<TaskSummary>(`/api/projects/${pid}/tasks-summary`),
45
45
  };
@@ -21,37 +21,37 @@ export interface TelegramSendBody {
21
21
 
22
22
  export const Telegram = {
23
23
  channels: {
24
- list: () => http.get<TelegramChannelsResponse>("/telegram/channels"),
24
+ list: () => http.get<TelegramChannelsResponse>("/api/telegram/channels"),
25
25
  upsert: (ch: TelegramChannel) =>
26
- http.post<{ channel: TelegramChannel; created: boolean }>("/telegram/channels", ch),
26
+ http.post<{ channel: TelegramChannel; created: boolean }>("/api/telegram/channels", ch),
27
27
  patch: (name: string, body: Partial<TelegramChannel>) =>
28
- http.patch<{ ok: true; channel: TelegramChannel }>(`/telegram/channels/${name}`, body),
28
+ http.patch<{ ok: true; channel: TelegramChannel }>(`/api/telegram/channels/${name}`, body),
29
29
  remove: (name: string) =>
30
- http.del<void>(`/telegram/channels/${encodeURIComponent(name)}`),
30
+ http.del<void>(`/api/telegram/channels/${encodeURIComponent(name)}`),
31
31
  },
32
32
  contacts: {
33
- list: () => http.get<TelegramContactsResponse>("/telegram/contacts"),
33
+ list: () => http.get<TelegramContactsResponse>("/api/telegram/contacts"),
34
34
  patch: (userId: number | string, body: Partial<TelegramContact>) =>
35
35
  http.patch<{ ok: true; contact: TelegramContact }>(
36
- `/telegram/contacts/${encodeURIComponent(String(userId))}`,
36
+ `/api/telegram/contacts/${encodeURIComponent(String(userId))}`,
37
37
  body,
38
38
  ),
39
39
  remove: (userId: number | string) =>
40
- http.del<void>(`/telegram/contacts/${encodeURIComponent(String(userId))}`),
40
+ http.del<void>(`/api/telegram/contacts/${encodeURIComponent(String(userId))}`),
41
41
  },
42
42
  roles: {
43
- list: () => http.get<{ roles: Record<string, TelegramRole> }>("/telegram/roles"),
43
+ list: () => http.get<{ roles: Record<string, TelegramRole> }>("/api/telegram/roles"),
44
44
  set: (name: string, tools: "*" | string[]) =>
45
45
  http.put<{ ok: true; name: string; role: TelegramRole }>(
46
- `/telegram/roles/${encodeURIComponent(name)}`,
46
+ `/api/telegram/roles/${encodeURIComponent(name)}`,
47
47
  { tools },
48
48
  ),
49
49
  remove: (name: string) =>
50
- http.del<void>(`/telegram/roles/${encodeURIComponent(name)}`),
50
+ http.del<void>(`/api/telegram/roles/${encodeURIComponent(name)}`),
51
51
  },
52
- status: () => http.get<TelegramStatus>("/telegram/status"),
53
- start: () => http.post<{ ok: true; status: TelegramStatus }>("/telegram/start"),
54
- stop: () => http.post<{ ok: true; status: TelegramStatus }>("/telegram/stop"),
52
+ status: () => http.get<TelegramStatus>("/api/telegram/status"),
53
+ start: () => http.post<{ ok: true; status: TelegramStatus }>("/api/telegram/start"),
54
+ stop: () => http.post<{ ok: true; status: TelegramStatus }>("/api/telegram/stop"),
55
55
  send: (body: TelegramSendBody) =>
56
- http.post<{ ok: true; message_id: number }>("/telegram/send", body),
56
+ http.post<{ ok: true; message_id: number }>("/api/telegram/send", body),
57
57
  };
@@ -9,5 +9,5 @@ export interface ToolInfo {
9
9
 
10
10
  export const Tools = {
11
11
  // Registry of built-in tools the daemon exposes.
12
- list: () => http.get<ToolInfo[]>("/tools"),
12
+ list: () => http.get<ToolInfo[]>("/api/tools"),
13
13
  };
@@ -20,19 +20,19 @@ export interface VarDetail {
20
20
  export const Vars = {
21
21
  list: (pid: string, opts: { reveal?: boolean } = {}) =>
22
22
  http.get<VarsList>(
23
- `/projects/${pid}/vars${opts.reveal ? "?reveal=1" : ""}`,
23
+ `/api/projects/${pid}/vars${opts.reveal ? "?reveal=1" : ""}`,
24
24
  ),
25
25
  get: (pid: string, name: string, opts: { reveal?: boolean } = {}) =>
26
26
  http.get<VarDetail>(
27
- `/projects/${pid}/vars/${encodeURIComponent(name)}${opts.reveal ? "?reveal=1" : ""}`,
27
+ `/api/projects/${pid}/vars/${encodeURIComponent(name)}${opts.reveal ? "?reveal=1" : ""}`,
28
28
  ),
29
29
  upsert: (pid: string, body: { name: string; value: string; scope?: VarScope }) =>
30
30
  http.post<{ ok: true; name: string; scope: VarScope }>(
31
- `/projects/${pid}/vars`,
31
+ `/api/projects/${pid}/vars`,
32
32
  body,
33
33
  ),
34
34
  remove: (pid: string, name: string, scope: VarScope = "project") =>
35
35
  http.del<void>(
36
- `/projects/${pid}/vars/${encodeURIComponent(name)}?scope=${scope}`,
36
+ `/api/projects/${pid}/vars/${encodeURIComponent(name)}?scope=${scope}`,
37
37
  ),
38
38
  };