@agentprojectcontext/apx 1.77.3 → 1.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +43 -53
- 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/tool-summary.js +65 -0
- package/src/core/agent/tools/handlers/call-runtime.js +4 -4
- package/src/core/agent/tools/handlers/list-commitments.js +80 -0
- package/src/core/agent/tools/handlers/list-tasks.js +66 -27
- package/src/core/agent/tools/handlers/record-commitment.js +68 -0
- package/src/core/agent/tools/handlers/search-sessions.js +1 -1
- package/src/core/agent/tools/handlers/send-telegram.js +68 -2
- package/src/core/agent/tools/handlers/set-permission-mode.js +11 -4
- package/src/core/agent/tools/names.js +64 -0
- package/src/core/agent/tools/registry.js +9 -0
- package/src/core/agent/tools/tool-call-parser.js +70 -1
- 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/ask-callbacks.js +35 -0
- package/src/core/channels/telegram/config.js +201 -0
- package/src/core/channels/telegram/dispatch.js +3 -0
- package/src/core/channels/telegram/reply.js +30 -5
- package/src/core/config/index.js +25 -183
- package/src/core/config/paths.js +57 -1
- package/src/core/config/redact.js +22 -0
- package/src/core/confirmation/adapters/web.js +1 -1
- package/src/core/daemon/service.js +238 -0
- 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/gemini.js +322 -60
- package/src/core/engines/openai-compatible.js +21 -2
- 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/consolidate.js +225 -0
- package/src/core/memory/indexer.js +2 -5
- package/src/core/nudge/index.js +192 -0
- package/src/core/nudge/policy.js +143 -0
- package/src/core/nudge/store.js +141 -0
- package/src/core/profiles/bundled/secretary/PROFILE.md +8 -9
- package/src/core/profiles/bundled/secretary/config.schema.json +33 -3
- package/src/core/profiles/bundled/secretary/routines/day-close.json +7 -3
- package/src/core/profiles/bundled/secretary/routines/day-open.json +7 -3
- package/src/core/profiles/bundled/secretary/routines/watch.json +13 -0
- package/src/core/profiles/lifecycle.js +0 -2
- package/src/core/profiles/store.js +2 -7
- package/src/core/routines/runner.js +103 -4
- package/src/core/routines/signals.js +270 -0
- 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/commitments.js +331 -0
- package/src/core/stores/engine-sessions.js +0 -4
- package/src/core/stores/messages.js +4 -5
- package/src/core/stores/organization.js +9 -11
- package/src/core/stores/routines.js +23 -14
- package/src/core/stores/runtime-callbacks.js +2 -1
- package/src/core/util/json-file.js +128 -0
- package/src/core/util/thinking.js +51 -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/commitments.js +135 -0
- 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/nudges.js +112 -0
- package/src/host/daemon/api/organization.js +8 -8
- package/src/host/daemon/api/pairing.js +6 -6
- 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 +32 -8
- package/src/host/daemon/api/run.js +2 -2
- package/src/host/daemon/api/runtimes.js +6 -6
- package/src/host/daemon/api/self-memory.js +50 -0
- 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 +61 -24
- 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 +9 -7
- package/src/host/daemon/api/web.js +28 -32
- package/src/host/daemon/api.js +83 -48
- package/src/host/daemon/callback-reconciler.js +16 -0
- 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 +8 -2
- package/src/host/daemon/plugins/telegram/index.js +7 -2
- package/src/host/daemon/stt-venv.js +20 -81
- package/src/host/daemon/wakeup.js +18 -4
- 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/commitment.js +154 -0
- package/src/interfaces/cli/commands/config.js +4 -4
- package/src/interfaces/cli/commands/daemon.js +74 -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 +75 -2
- package/src/interfaces/cli/commands/messages.js +5 -5
- package/src/interfaces/cli/commands/model.js +0 -18
- package/src/interfaces/cli/commands/nudge.js +130 -0
- 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/commitment.js +19 -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 +25 -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 +75 -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 +19 -0
- package/src/interfaces/cli/routes/messages.js +16 -0
- package/src/interfaces/cli/routes/model.js +11 -0
- package/src/interfaces/cli/routes/nudge.js +17 -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-CvEoGtTf.js +849 -0
- package/src/interfaces/web/dist/assets/index-CvEoGtTf.js.map +1 -0
- package/src/interfaces/web/dist/assets/index-DzBBXFaO.css +1 -0
- package/src/interfaces/web/dist/index.html +2 -2
- package/src/interfaces/web/package-lock.json +11 -10
- package/src/interfaces/web/src/components/AddProjectDialog.tsx +1 -1
- package/src/interfaces/web/src/components/Section.tsx +18 -3
- 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/MessageBubble.tsx +13 -0
- 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/cron/CronPicker.tsx +196 -0
- 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/inbox/InboxList.tsx +145 -0
- package/src/interfaces/web/src/components/memory/MemoryBrowser.tsx +36 -6
- package/src/interfaces/web/src/components/routines/ExecutionsList.tsx +1 -1
- package/src/interfaces/web/src/components/routines/RoutineDetail.tsx +16 -4
- package/src/interfaces/web/src/components/routines/RoutineEditor.tsx +14 -4
- package/src/interfaces/web/src/components/routines/shared.ts +14 -5
- 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/NudgePanel.tsx +183 -0
- package/src/interfaces/web/src/components/settings/ProfilePanel.tsx +36 -12
- 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/components/ui/filter-chips.tsx +47 -0
- package/src/interfaces/web/src/components/ui.tsx +1 -0
- package/src/interfaces/web/src/constants/index.ts +1 -0
- package/src/interfaces/web/src/hooks/useChat.ts +5 -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/useNudges.ts +38 -0
- 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 +3 -3
- package/src/interfaces/web/src/i18n/en.ts +127 -0
- package/src/interfaces/web/src/i18n/es.ts +127 -0
- 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/commitments.ts +57 -0
- 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/notebook.ts +23 -0
- package/src/interfaces/web/src/lib/api/nudges.ts +53 -0
- 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/lib/cron.ts +196 -0
- package/src/interfaces/web/src/lib/when.ts +32 -0
- package/src/interfaces/web/src/screens/InboxScreen.tsx +107 -77
- package/src/interfaces/web/src/screens/ProjectScreen.tsx +5 -2
- package/src/interfaces/web/src/screens/SettingsScreen.tsx +17 -3
- package/src/interfaces/web/src/screens/base/AgentDefaultsTab.tsx +1 -1
- package/src/interfaces/web/src/screens/base/CommitmentsTab.tsx +239 -0
- package/src/interfaces/web/src/screens/base/GlobalTasksTab.tsx +103 -20
- package/src/interfaces/web/src/screens/base/LogsTab.tsx +18 -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 +24 -6
- 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 +15 -13
- 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/src/types/daemon.ts +10 -1
- package/src/interfaces/web/vite.config.ts +13 -18
- package/src/interfaces/web/dist/assets/index-BptlbKjU.js +0 -824
- package/src/interfaces/web/dist/assets/index-BptlbKjU.js.map +0 -1
- package/src/interfaces/web/dist/assets/index-D_EJEA1n.css +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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { http, unwrapPage } from "../http";
|
|
2
|
+
|
|
3
|
+
export type CommitmentState = "open" | "kept" | "missed";
|
|
4
|
+
|
|
5
|
+
export type CommitmentEntry = {
|
|
6
|
+
id: string;
|
|
7
|
+
created_at: string;
|
|
8
|
+
updated_at: string;
|
|
9
|
+
state: CommitmentState;
|
|
10
|
+
counterparty: string;
|
|
11
|
+
body: string;
|
|
12
|
+
promised_at: string;
|
|
13
|
+
due: string | null;
|
|
14
|
+
origin_channel: string | null;
|
|
15
|
+
origin_message_ref: string | null;
|
|
16
|
+
note?: string | null;
|
|
17
|
+
renegotiated_count?: number;
|
|
18
|
+
history: { due: string | null; moved_at: string; note: string | null }[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type GlobalCommitmentEntry = CommitmentEntry & {
|
|
22
|
+
project_id: string | number;
|
|
23
|
+
project_name: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type ListOpts = {
|
|
27
|
+
state?: CommitmentState | "all";
|
|
28
|
+
counterparty?: string;
|
|
29
|
+
overdue?: boolean;
|
|
30
|
+
limit: number;
|
|
31
|
+
offset: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function qs(o: ListOpts): string {
|
|
35
|
+
const p = new URLSearchParams();
|
|
36
|
+
if (o.state) p.set("state", o.state);
|
|
37
|
+
if (o.counterparty) p.set("counterparty", o.counterparty);
|
|
38
|
+
if (o.overdue) p.set("overdue", "1");
|
|
39
|
+
p.set("limit", String(o.limit));
|
|
40
|
+
p.set("offset", String(o.offset));
|
|
41
|
+
return p.toString();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const Commitments = {
|
|
45
|
+
globalPage: (o: ListOpts) =>
|
|
46
|
+
http.get<unknown>(`/api/commitments?${qs(o)}`).then((b) => unwrapPage<GlobalCommitmentEntry>(b)),
|
|
47
|
+
listPage: (pid: string, o: ListOpts) =>
|
|
48
|
+
http.get<unknown>(`/api/projects/${pid}/commitments?${qs(o)}`).then((b) => unwrapPage<CommitmentEntry>(b)),
|
|
49
|
+
add: (pid: string, body: { counterparty: string; body: string; due?: string | null }) =>
|
|
50
|
+
http.post<CommitmentEntry>(`/api/projects/${pid}/commitments`, body),
|
|
51
|
+
kept: (pid: string, id: string, note?: string) =>
|
|
52
|
+
http.post<CommitmentEntry>(`/api/projects/${pid}/commitments/${id}/kept`, { note }),
|
|
53
|
+
missed: (pid: string, id: string, note?: string) =>
|
|
54
|
+
http.post<CommitmentEntry>(`/api/projects/${pid}/commitments/${id}/missed`, { note }),
|
|
55
|
+
renegotiate: (pid: string, id: string, due: string, note?: string) =>
|
|
56
|
+
http.post<CommitmentEntry>(`/api/projects/${pid}/commitments/${id}/renegotiate`, { due, note }),
|
|
57
|
+
};
|
|
@@ -3,26 +3,26 @@ import type { ConversationDetail, ConversationListEntry, ThreadListEntry, Thread
|
|
|
3
3
|
|
|
4
4
|
export const Conversations = {
|
|
5
5
|
list: (pid: string, slug: string) =>
|
|
6
|
-
http.get<ConversationListEntry[]>(`/projects/${pid}/agents/${slug}/conversations`),
|
|
6
|
+
http.get<ConversationListEntry[]>(`/api/projects/${pid}/agents/${slug}/conversations`),
|
|
7
7
|
get: (pid: string, slug: string, id: string) =>
|
|
8
|
-
http.get<ConversationDetail>(`/projects/${pid}/agents/${slug}/conversations/${id}`),
|
|
8
|
+
http.get<ConversationDetail>(`/api/projects/${pid}/agents/${slug}/conversations/${id}`),
|
|
9
9
|
// Super-agent channel threads (telegram, web quick-chat, desktop …) derived
|
|
10
10
|
// from the global message ledger — one thread per channel+day.
|
|
11
11
|
threads: (pid: string) =>
|
|
12
|
-
http.get<ThreadListEntry[]>(`/projects/${pid}/super-agent/threads`),
|
|
12
|
+
http.get<ThreadListEntry[]>(`/api/projects/${pid}/super-agent/threads`),
|
|
13
13
|
thread: (pid: string, channel: string, id: string) =>
|
|
14
|
-
http.get<ThreadDetail>(`/projects/${pid}/super-agent/threads/${channel}/${id}`),
|
|
14
|
+
http.get<ThreadDetail>(`/api/projects/${pid}/super-agent/threads/${channel}/${id}`),
|
|
15
15
|
// Delete a persisted agent conversation (its `.md` file).
|
|
16
16
|
remove: (pid: string, slug: string, id: string) =>
|
|
17
|
-
http.del<{ ok: boolean }>(`/projects/${pid}/agents/${slug}/conversations/${id}`),
|
|
17
|
+
http.del<{ ok: boolean }>(`/api/projects/${pid}/agents/${slug}/conversations/${id}`),
|
|
18
18
|
// Delete a super-agent channel thread (its channel+day ledger file).
|
|
19
19
|
removeThread: (pid: string, channel: string, id: string) =>
|
|
20
|
-
http.del<{ ok: boolean }>(`/projects/${pid}/super-agent/threads/${channel}/${id}`),
|
|
20
|
+
http.del<{ ok: boolean }>(`/api/projects/${pid}/super-agent/threads/${channel}/${id}`),
|
|
21
21
|
compact: (pid: string, slug: string, id?: string) =>
|
|
22
22
|
http.post<{ ok?: boolean }>(
|
|
23
23
|
id
|
|
24
|
-
? `/projects/${pid}/agents/${slug}/conversations/${id}/compact`
|
|
25
|
-
: `/projects/${pid}/agents/${slug}/compact`,
|
|
24
|
+
? `/api/projects/${pid}/agents/${slug}/conversations/${id}/compact`
|
|
25
|
+
: `/api/projects/${pid}/agents/${slug}/compact`,
|
|
26
26
|
{}
|
|
27
27
|
),
|
|
28
28
|
};
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { http } from "../http";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The super-agent's own notebook (~/.apx/memory.md).
|
|
5
|
+
*
|
|
6
|
+
* Distinct from project memory (.apc/memory.md) and from each agent's memory.
|
|
7
|
+
* This is the one that ships in EVERY prompt on every channel, which is why it
|
|
8
|
+
* reports its own token cost.
|
|
9
|
+
*/
|
|
10
|
+
export interface NotebookInfo {
|
|
11
|
+
body: string;
|
|
12
|
+
path: string;
|
|
13
|
+
chars: number;
|
|
14
|
+
approx_tokens: number;
|
|
15
|
+
entries: number;
|
|
16
|
+
/** How many entries were written by memory consolidation rather than by hand. */
|
|
17
|
+
consolidated: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Notebook = {
|
|
21
|
+
get: () => http.get<NotebookInfo>("/api/notebook"),
|
|
22
|
+
put: (body: string) => http.put<{ ok: true } & Omit<NotebookInfo, "body">>("/api/notebook", { body }),
|
|
23
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { http } from "../http";
|
|
2
|
+
|
|
3
|
+
export type NudgePolicy = {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
daily_max: number;
|
|
6
|
+
quiet_hours: string;
|
|
7
|
+
cooldown_minutes: number;
|
|
8
|
+
project_cooldown_minutes: number;
|
|
9
|
+
kind_cooldown_minutes: number;
|
|
10
|
+
critical_bypasses_budget: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type NudgeEntry = {
|
|
14
|
+
id: string;
|
|
15
|
+
at: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
project_id: string | null;
|
|
18
|
+
severity: string;
|
|
19
|
+
channel: string;
|
|
20
|
+
chat_id: string | null;
|
|
21
|
+
preview: string;
|
|
22
|
+
bypassed_budget: boolean;
|
|
23
|
+
feedback: { useful: boolean; note: string; at: string } | null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type NudgeStats = {
|
|
27
|
+
total: number;
|
|
28
|
+
today: number;
|
|
29
|
+
rated: number;
|
|
30
|
+
by_kind: { kind: string; sent: number; useful: number; noise: number }[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const NudgesApi = {
|
|
34
|
+
list: (limit = 50) =>
|
|
35
|
+
http.get<{ data: NudgeEntry[]; meta: { total: number; stats: NudgeStats } }>(
|
|
36
|
+
`/api/nudges?limit=${limit}`,
|
|
37
|
+
),
|
|
38
|
+
policy: () =>
|
|
39
|
+
http.get<{
|
|
40
|
+
policy: NudgePolicy;
|
|
41
|
+
/** Which layers contributed: defaults → profile → user. */
|
|
42
|
+
source: string[];
|
|
43
|
+
defaults: NudgePolicy;
|
|
44
|
+
user_overrides: Partial<NudgePolicy>;
|
|
45
|
+
}>("/api/nudges/policy"),
|
|
46
|
+
setPolicy: (values: Partial<NudgePolicy>) =>
|
|
47
|
+
http.put<{ ok: true; policy: NudgePolicy; source: string[] }>("/api/nudges/policy", values),
|
|
48
|
+
feedback: (id: string, useful: boolean, note = "") =>
|
|
49
|
+
http.post<{ ok: true; entry: NudgeEntry }>(
|
|
50
|
+
`/api/nudges/${encodeURIComponent(id)}/feedback`,
|
|
51
|
+
{ useful, note },
|
|
52
|
+
),
|
|
53
|
+
};
|
|
@@ -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
|
};
|