@agentprojectcontext/apx 1.77.2 → 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.
- package/README.md +23 -9
- package/package.json +12 -12
- package/src/core/agent/build-agent-system.js +3 -2
- package/src/core/agent/constants.js +3 -2
- package/src/core/agent/loop/greeting-guard.js +55 -0
- package/src/core/agent/loop/side-effects.js +52 -0
- package/src/core/agent/prompt-builder.js +49 -8
- package/src/core/agent/run-agent.js +13 -48
- package/src/core/agent/security.js +1 -1
- package/src/core/agent/self-memory.js +4 -2
- package/src/core/agent/skills/index-store.js +2 -2
- package/src/core/agent/skills/loader.js +3 -22
- package/src/core/agent/super-agent.js +0 -2
- package/src/core/agent/tools/handlers/call-runtime.js +4 -4
- package/src/core/agent/tools/handlers/search-sessions.js +1 -1
- package/src/core/agent/tools/handlers/set-permission-mode.js +11 -4
- package/src/core/agent/tools/names.js +58 -0
- package/src/core/apc/context-copy.js +1 -1
- package/src/core/apc/frontmatter.js +85 -0
- package/src/core/apc/parser.js +9 -21
- package/src/core/apc/paths.js +8 -8
- package/src/core/apc/scaffold.js +5 -4
- package/src/core/channels/telegram/config.js +201 -0
- package/src/core/config/index.js +25 -183
- package/src/core/config/paths.js +54 -1
- package/src/core/confirmation/adapters/web.js +1 -1
- package/src/core/deck/manifest.js +12 -12
- package/src/core/desktop/autostart.js +3 -2
- package/src/core/desktop/process.js +4 -4
- package/src/core/engines/presets.js +2 -2
- package/src/core/http-tools/browser.js +1 -1
- package/src/core/http-tools/catalog.js +551 -0
- package/src/core/http-tools/fetch.js +1 -1
- package/src/core/http-tools/glob.js +3 -3
- package/src/core/http-tools/grep.js +2 -9
- package/src/core/http-tools/inline-handlers.js +59 -0
- package/src/core/http-tools/registry.js +31 -615
- package/src/core/http-tools/search.js +2 -2
- package/src/core/identity/self.js +6 -7
- package/src/core/identity/telegram.js +3 -3
- package/src/core/logging.js +6 -5
- package/src/core/mcp/sources.js +12 -16
- package/src/core/memory/indexer.js +2 -5
- package/src/core/profiles/lifecycle.js +0 -2
- package/src/core/profiles/store.js +2 -7
- package/src/core/routines/runner.js +1 -1
- package/src/core/runtime-skills/apx-agency-agents/SKILL.md +2 -2
- package/src/core/runtime-skills/apx-profile/SKILL.md +3 -3
- package/src/core/runtime-skills/apx-project/SKILL.md +1 -1
- package/src/core/runtime-skills/apx-task/SKILL.md +8 -8
- package/src/core/runtime-skills/apx-telegram/SKILL.md +4 -4
- package/src/core/runtime-skills/apx-voice/SKILL.md +4 -4
- package/src/core/runtimes/detect.js +2 -2
- package/src/core/sessions/index.js +800 -0
- package/src/core/stores/code-sessions.js +3 -14
- package/src/core/stores/engine-sessions.js +0 -4
- package/src/core/stores/messages.js +0 -5
- package/src/core/stores/organization.js +9 -11
- package/src/core/stores/routines.js +6 -11
- package/src/core/stores/runtime-callbacks.js +2 -1
- package/src/core/util/json-file.js +128 -0
- package/src/core/vars/sources.js +14 -21
- package/src/core/voice/stt-models.js +1 -1
- package/src/core/voice/tts.js +5 -4
- package/src/host/daemon/api/admin-config.js +5 -5
- package/src/host/daemon/api/admin.js +8 -7
- package/src/host/daemon/api/agents.js +16 -16
- package/src/host/daemon/api/artifact-preview.js +8 -8
- package/src/host/daemon/api/artifacts.js +7 -7
- package/src/host/daemon/api/code.js +8 -8
- package/src/host/daemon/api/config.js +6 -6
- package/src/host/daemon/api/confirm.js +2 -2
- package/src/host/daemon/api/connections.js +2 -2
- package/src/host/daemon/api/conversations.js +12 -12
- package/src/host/daemon/api/deck.js +6 -6
- package/src/host/daemon/api/desktop.js +8 -8
- package/src/host/daemon/api/embeddings.js +4 -4
- package/src/host/daemon/api/engines.js +8 -7
- package/src/host/daemon/api/exec.js +5 -4
- package/src/host/daemon/api/files-project.js +6 -6
- package/src/host/daemon/api/health.js +2 -2
- package/src/host/daemon/api/identity.js +3 -3
- package/src/host/daemon/api/inbox.js +2 -2
- package/src/host/daemon/api/integrations.js +23 -19
- package/src/host/daemon/api/mcps.js +16 -12
- package/src/host/daemon/api/messages.js +5 -5
- package/src/host/daemon/api/organization.js +8 -8
- package/src/host/daemon/api/pairing.js +10 -7
- package/src/host/daemon/api/plugins.js +3 -3
- package/src/host/daemon/api/prefix.js +20 -0
- package/src/host/daemon/api/profiles.js +9 -9
- package/src/host/daemon/api/projects.js +5 -5
- package/src/host/daemon/api/routines.js +8 -8
- package/src/host/daemon/api/run.js +2 -2
- package/src/host/daemon/api/runtimes.js +6 -6
- package/src/host/daemon/api/sessions-search.js +18 -11
- package/src/host/daemon/api/sessions.js +6 -6
- package/src/host/daemon/api/shared.js +59 -13
- package/src/host/daemon/api/skills.js +12 -12
- package/src/host/daemon/api/super-agent.js +4 -4
- package/src/host/daemon/api/tasks.js +11 -11
- package/src/host/daemon/api/telegram.js +19 -20
- package/src/host/daemon/api/tools.js +7 -7
- package/src/host/daemon/api/top-level.js +7 -7
- package/src/host/daemon/api/transcribe.js +6 -6
- package/src/host/daemon/api/tts.js +3 -3
- package/src/host/daemon/api/vars.js +11 -8
- package/src/host/daemon/api/voice.js +6 -6
- package/src/host/daemon/api/web.js +28 -32
- package/src/host/daemon/api.js +77 -48
- package/src/host/daemon/db.js +1 -1
- package/src/host/daemon/desktop-ws.js +7 -3
- package/src/host/daemon/index.js +11 -5
- package/src/host/daemon/plugins/desktop/index.js +1 -1
- package/src/host/daemon/plugins/telegram/index.js +1 -1
- package/src/host/daemon/stt-venv.js +20 -81
- package/src/host/daemon/wakeup.js +1 -1
- package/src/interfaces/acp/index.js +3 -3
- package/src/interfaces/acp/session.js +2 -2
- package/src/interfaces/cli/commands/a2a.js +2 -2
- package/src/interfaces/cli/commands/agent.js +3 -3
- package/src/interfaces/cli/commands/artifact.js +13 -13
- package/src/interfaces/cli/commands/chat.js +3 -3
- package/src/interfaces/cli/commands/command.js +2 -2
- package/src/interfaces/cli/commands/config.js +4 -4
- package/src/interfaces/cli/commands/daemon.js +17 -18
- package/src/interfaces/cli/commands/desktop.js +7 -14
- package/src/interfaces/cli/commands/exec.js +2 -2
- package/src/interfaces/cli/commands/log.js +3 -4
- package/src/interfaces/cli/commands/mcp.js +9 -9
- package/src/interfaces/cli/commands/memory.js +2 -2
- package/src/interfaces/cli/commands/messages.js +5 -5
- package/src/interfaces/cli/commands/model.js +0 -18
- package/src/interfaces/cli/commands/obsidian.js +5 -5
- package/src/interfaces/cli/commands/org.js +5 -5
- package/src/interfaces/cli/commands/pair.js +6 -6
- package/src/interfaces/cli/commands/plugins.js +2 -2
- package/src/interfaces/cli/commands/profile.js +10 -10
- package/src/interfaces/cli/commands/project-config.js +6 -6
- package/src/interfaces/cli/commands/project.js +10 -10
- package/src/interfaces/cli/commands/routine.js +8 -9
- package/src/interfaces/cli/commands/runtime.js +2 -2
- package/src/interfaces/cli/commands/search.js +0 -1
- package/src/interfaces/cli/commands/session.js +12 -40
- package/src/interfaces/cli/commands/sessions.js +21 -798
- package/src/interfaces/cli/commands/setup.js +16 -6
- package/src/interfaces/cli/commands/skills.js +1 -2
- package/src/interfaces/cli/commands/status.js +3 -3
- package/src/interfaces/cli/commands/task.js +8 -8
- package/src/interfaces/cli/commands/telegram.js +21 -21
- package/src/interfaces/cli/commands/voice.js +6 -6
- package/src/interfaces/cli/help/index.js +2245 -0
- package/src/interfaces/cli/http.js +9 -4
- package/src/interfaces/cli/index.js +14 -2857
- package/src/interfaces/cli/routes/acp.js +13 -0
- package/src/interfaces/cli/routes/agent.js +27 -0
- package/src/interfaces/cli/routes/artifact.js +28 -0
- package/src/interfaces/cli/routes/chat.js +11 -0
- package/src/interfaces/cli/routes/code.js +11 -0
- package/src/interfaces/cli/routes/command.js +21 -0
- package/src/interfaces/cli/routes/config.js +16 -0
- package/src/interfaces/cli/routes/connections.js +11 -0
- package/src/interfaces/cli/routes/conversations.js +21 -0
- package/src/interfaces/cli/routes/daemon.js +19 -0
- package/src/interfaces/cli/routes/desktop.js +20 -0
- package/src/interfaces/cli/routes/env.js +13 -0
- package/src/interfaces/cli/routes/exec.js +11 -0
- package/src/interfaces/cli/routes/identity.js +11 -0
- package/src/interfaces/cli/routes/index.js +71 -0
- package/src/interfaces/cli/routes/init.js +11 -0
- package/src/interfaces/cli/routes/log.js +20 -0
- package/src/interfaces/cli/routes/mcp.js +22 -0
- package/src/interfaces/cli/routes/memory.js +11 -0
- package/src/interfaces/cli/routes/messages.js +16 -0
- package/src/interfaces/cli/routes/model.js +11 -0
- package/src/interfaces/cli/routes/obsidian.js +17 -0
- package/src/interfaces/cli/routes/org.js +34 -0
- package/src/interfaces/cli/routes/overlay.js +10 -0
- package/src/interfaces/cli/routes/pair.js +17 -0
- package/src/interfaces/cli/routes/panel.js +16 -0
- package/src/interfaces/cli/routes/permission.js +11 -0
- package/src/interfaces/cli/routes/plugins.js +21 -0
- package/src/interfaces/cli/routes/profile.js +27 -0
- package/src/interfaces/cli/routes/project.js +41 -0
- package/src/interfaces/cli/routes/restart.js +15 -0
- package/src/interfaces/cli/routes/routine.js +28 -0
- package/src/interfaces/cli/routes/run.js +11 -0
- package/src/interfaces/cli/routes/search.js +11 -0
- package/src/interfaces/cli/routes/send.js +11 -0
- package/src/interfaces/cli/routes/session.js +26 -0
- package/src/interfaces/cli/routes/sessions.js +15 -0
- package/src/interfaces/cli/routes/setup.js +18 -0
- package/src/interfaces/cli/routes/skills.js +20 -0
- package/src/interfaces/cli/routes/status.js +12 -0
- package/src/interfaces/cli/routes/task.js +26 -0
- package/src/interfaces/cli/routes/telegram.js +39 -0
- package/src/interfaces/cli/routes/update.js +24 -0
- package/src/interfaces/cli/routes/voice.js +17 -0
- package/src/interfaces/desktop/main.js +6 -7
- package/src/interfaces/desktop/renderer.js +0 -5
- package/src/interfaces/mcp-server/index.js +15 -14
- package/src/interfaces/tui/_shims/globals.d.ts +8 -0
- package/src/interfaces/tui/tsconfig.json +4 -1
- package/src/interfaces/web/README.md +6 -6
- package/src/interfaces/web/dist/assets/index-CBR_-QyA.js +824 -0
- package/src/interfaces/web/dist/assets/index-CBR_-QyA.js.map +1 -0
- package/src/interfaces/web/dist/index.html +1 -1
- package/src/interfaces/web/src/components/AddProjectDialog.tsx +1 -1
- package/src/interfaces/web/src/components/agents/AgentFormFields.tsx +1 -1
- package/src/interfaces/web/src/components/chat/ChatList.tsx +2 -2
- package/src/interfaces/web/src/components/chat/SkillPicker.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeFileTree.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeTerminal.tsx +1 -1
- package/src/interfaces/web/src/components/desktop/DesktopStatusCard.tsx +1 -1
- package/src/interfaces/web/src/components/files/FileBrowser.tsx +2 -2
- package/src/interfaces/web/src/components/memory/MemoryBrowser.tsx +2 -2
- package/src/interfaces/web/src/components/routines/ExecutionsList.tsx +1 -1
- package/src/interfaces/web/src/components/routines/RoutineEditor.tsx +2 -2
- package/src/interfaces/web/src/components/settings/DesktopSettingsPanel.tsx +1 -1
- package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +1 -1
- package/src/interfaces/web/src/components/settings/SkillsInspectorPanel.tsx +1 -1
- package/src/interfaces/web/src/components/settings/SkillsManager.tsx +2 -2
- package/src/interfaces/web/src/components/tasks/TaskDetailPanel.tsx +1 -1
- package/src/interfaces/web/src/hooks/useDaemonStatus.ts +1 -1
- package/src/interfaces/web/src/hooks/useDevices.ts +1 -1
- package/src/interfaces/web/src/hooks/useEngines.ts +1 -1
- package/src/interfaces/web/src/hooks/useGlobalConfig.ts +2 -2
- package/src/interfaces/web/src/hooks/useIdentity.ts +1 -1
- package/src/interfaces/web/src/hooks/useInbox.ts +1 -1
- package/src/interfaces/web/src/hooks/useProfiles.ts +3 -3
- package/src/interfaces/web/src/hooks/useProjects.ts +1 -1
- package/src/interfaces/web/src/hooks/useTelegram.ts +3 -3
- package/src/interfaces/web/src/hooks/useTokenBootstrap.ts +30 -7
- package/src/interfaces/web/src/lib/api/admin.ts +11 -11
- package/src/interfaces/web/src/lib/api/agents.ts +14 -14
- package/src/interfaces/web/src/lib/api/artifacts.ts +11 -11
- package/src/interfaces/web/src/lib/api/code.ts +1 -1
- package/src/interfaces/web/src/lib/api/conversations.ts +8 -8
- package/src/interfaces/web/src/lib/api/deck.ts +3 -3
- package/src/interfaces/web/src/lib/api/desktop.ts +8 -8
- package/src/interfaces/web/src/lib/api/embeddings.ts +3 -3
- package/src/interfaces/web/src/lib/api/engines.ts +3 -3
- package/src/interfaces/web/src/lib/api/filesystem.ts +2 -2
- package/src/interfaces/web/src/lib/api/health.ts +1 -1
- package/src/interfaces/web/src/lib/api/identity.ts +2 -2
- package/src/interfaces/web/src/lib/api/inbox.ts +1 -1
- package/src/interfaces/web/src/lib/api/integrations.ts +8 -8
- package/src/interfaces/web/src/lib/api/mcps.ts +6 -6
- package/src/interfaces/web/src/lib/api/messages.ts +3 -3
- package/src/interfaces/web/src/lib/api/organization.ts +7 -7
- package/src/interfaces/web/src/lib/api/profiles.ts +8 -8
- package/src/interfaces/web/src/lib/api/projectFiles.ts +5 -5
- package/src/interfaces/web/src/lib/api/projects.ts +12 -12
- package/src/interfaces/web/src/lib/api/routines.ts +7 -7
- package/src/interfaces/web/src/lib/api/sessions.ts +2 -2
- package/src/interfaces/web/src/lib/api/skills.ts +11 -11
- package/src/interfaces/web/src/lib/api/super_agent.ts +3 -3
- package/src/interfaces/web/src/lib/api/tasks.ts +12 -12
- package/src/interfaces/web/src/lib/api/telegram.ts +14 -14
- package/src/interfaces/web/src/lib/api/tools.ts +1 -1
- package/src/interfaces/web/src/lib/api/vars.ts +4 -4
- package/src/interfaces/web/src/lib/api/voice.ts +6 -6
- package/src/interfaces/web/src/screens/base/AgentDefaultsTab.tsx +1 -1
- package/src/interfaces/web/src/screens/base/GlobalTasksTab.tsx +1 -1
- package/src/interfaces/web/src/screens/base/LogsTab.tsx +3 -3
- package/src/interfaces/web/src/screens/base/SessionsTab.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +8 -8
- package/src/interfaces/web/src/screens/project/AgentsTab.tsx +2 -2
- package/src/interfaces/web/src/screens/project/ChatTab.tsx +3 -3
- package/src/interfaces/web/src/screens/project/ConfigTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/McpsTab.tsx +3 -3
- package/src/interfaces/web/src/screens/project/Overview.tsx +6 -6
- package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +2 -2
- package/src/interfaces/web/src/screens/project/StructureTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/TasksTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/VarsTab.tsx +1 -1
- package/src/interfaces/web/vite.config.ts +13 -18
- package/src/interfaces/web/dist/assets/index-BWWpTTSd.js +0 -824
- package/src/interfaces/web/dist/assets/index-BWWpTTSd.js.map +0 -1
- package/src/skills/apc-context/SKILL.md +0 -159
- /package/src/{host/daemon → core}/runtimes/_spawn.js +0 -0
- /package/src/{host/daemon → core}/runtimes/aider.js +0 -0
- /package/src/{host/daemon → core}/runtimes/antigravity.js +0 -0
- /package/src/{host/daemon → core}/runtimes/claude-code.js +0 -0
- /package/src/{host/daemon → core}/runtimes/codex.js +0 -0
- /package/src/{host/daemon → core}/runtimes/cursor-agent.js +0 -0
- /package/src/{host/daemon → core}/runtimes/gemini-cli.js +0 -0
- /package/src/{host/daemon → core}/runtimes/index.js +0 -0
- /package/src/{host/daemon → core}/runtimes/opencode.js +0 -0
- /package/src/{host/daemon → core}/runtimes/qwen-code.js +0 -0
|
@@ -83,7 +83,7 @@ export interface WidgetPatchResult {
|
|
|
83
83
|
|
|
84
84
|
export const Deck = {
|
|
85
85
|
/** GET /deck/manifest — full companion manifest. */
|
|
86
|
-
manifest: () => http.get<DeckManifest>("/deck/manifest"),
|
|
86
|
+
manifest: () => http.get<DeckManifest>("/api/deck/manifest"),
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* PATCH /deck/widgets/:id { enabled: boolean }
|
|
@@ -91,7 +91,7 @@ export const Deck = {
|
|
|
91
91
|
* Core (source="apx") widgets return 404.
|
|
92
92
|
*/
|
|
93
93
|
setWidget: (id: string, body: { enabled: boolean }) =>
|
|
94
|
-
http.patch<WidgetPatchResult>(`/deck/widgets/${encodeURIComponent(id)}`, body),
|
|
94
|
+
http.patch<WidgetPatchResult>(`/api/deck/widgets/${encodeURIComponent(id)}`, body),
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* POST /deck/exec
|
|
@@ -102,5 +102,5 @@ export const Deck = {
|
|
|
102
102
|
target?: string;
|
|
103
103
|
app?: string;
|
|
104
104
|
text?: string;
|
|
105
|
-
}) => http.post<{ ok: boolean; kind: string; [k: string]: unknown }>("/deck/exec", body),
|
|
105
|
+
}) => http.post<{ ok: boolean; kind: string; [k: string]: unknown }>("/api/deck/exec", body),
|
|
106
106
|
};
|
|
@@ -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,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
|
};
|
|
@@ -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
|
};
|