Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions app/.changes/260730-2204.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
section: Changed
---
ACP agent отримує типи й model tiers з backend-конфігурацій.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:all": "bun run test && bun run test:rust"
},
"dependencies": {
"@7n/tauri-components": "^0.13.9",
"@7n/tauri-components": "^0.16.2",
"@quasar/extras": "^2.0.2",
"@tauri-apps/api": "^2.11.1",
"@tauri-apps/plugin-dialog": "^2.7.2",
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tauri-plugin-dialog = "2"
# mlmail/myshare/mikrotik apps use. Pinned to a specific rev (not floating) so
# a future push to the package repo can't silently change this app's Rust
# surface underneath it.
tauri-plugin-agent = { git = "https://github.com/nitra/tauri-components", rev = "87f87e74ab56358746e75af8904abec96f4648d1" }
tauri-plugin-agent = { git = "https://github.com/nitra/tauri-components", rev = "8da8063e7b449ec9c87969046ba722ab0a8714ed" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "1", features = ["v4"] }
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions app/src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@
"description": "Permission identifier",
"oneOf": [
{
"description": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`",
"description": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-list-tiers`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`",
"type": "string",
"const": "agent:default",
"markdownDescription": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`"
"markdownDescription": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-list-tiers`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`"
},
{
"description": "Enables the acp_cancel command without any pre-configured scope.",
Expand All @@ -500,6 +500,12 @@
"const": "agent:allow-acp-config",
"markdownDescription": "Enables the acp_config command without any pre-configured scope."
},
{
"description": "Enables the acp_list_tiers command without any pre-configured scope.",
"type": "string",
"const": "agent:allow-acp-list-tiers",
"markdownDescription": "Enables the acp_list_tiers command without any pre-configured scope."
},
{
"description": "Enables the acp_mcp_tool_result command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -572,6 +578,12 @@
"const": "agent:deny-acp-config",
"markdownDescription": "Denies the acp_config command without any pre-configured scope."
},
{
"description": "Denies the acp_list_tiers command without any pre-configured scope.",
"type": "string",
"const": "agent:deny-acp-list-tiers",
"markdownDescription": "Denies the acp_list_tiers command without any pre-configured scope."
},
{
"description": "Denies the acp_mcp_tool_result command without any pre-configured scope.",
"type": "string",
Expand Down
16 changes: 14 additions & 2 deletions app/src-tauri/gen/schemas/macOS-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@
"description": "Permission identifier",
"oneOf": [
{
"description": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`",
"description": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-list-tiers`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`",
"type": "string",
"const": "agent:default",
"markdownDescription": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`"
"markdownDescription": "Allow all agent commands: request journal (create/load/update/list) and the ACP client (spawn/prompt/cancel, permission responses, domain MCP bridge).\n#### This default permission set includes:\n\n- `allow-journal-create`\n- `allow-journal-load`\n- `allow-journal-update`\n- `allow-journal-list`\n- `allow-acp-spawn-agent`\n- `allow-acp-prompt`\n- `allow-acp-cancel`\n- `allow-acp-respond-permission`\n- `allow-acp-config`\n- `allow-acp-list-tiers`\n- `allow-acp-register-catalog`\n- `allow-acp-mcp-tool-result`\n- `allow-acp-start-mcp-bridge`"
},
{
"description": "Enables the acp_cancel command without any pre-configured scope.",
Expand All @@ -500,6 +500,12 @@
"const": "agent:allow-acp-config",
"markdownDescription": "Enables the acp_config command without any pre-configured scope."
},
{
"description": "Enables the acp_list_tiers command without any pre-configured scope.",
"type": "string",
"const": "agent:allow-acp-list-tiers",
"markdownDescription": "Enables the acp_list_tiers command without any pre-configured scope."
},
{
"description": "Enables the acp_mcp_tool_result command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -572,6 +578,12 @@
"const": "agent:deny-acp-config",
"markdownDescription": "Denies the acp_config command without any pre-configured scope."
},
{
"description": "Denies the acp_list_tiers command without any pre-configured scope.",
"type": "string",
"const": "agent:deny-acp-list-tiers",
"markdownDescription": "Denies the acp_list_tiers command without any pre-configured scope."
},
{
"description": "Denies the acp_mcp_tool_result command without any pre-configured scope.",
"type": "string",
Expand Down
24 changes: 8 additions & 16 deletions app/src/composables/docs/use-acp-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,25 @@ type: JS Module
title: use-acp-agent.js
resource: app/src/composables/use-acp-agent.js
docgen:
crc: e2987279
crc: fa450390
model: openai-codex/gpt-5.4-mini
tier: cloud-min
score: 100
issues: judge-refine:kept-original,judge:inaccurate:0.98
judgeModel: openai-codex/gpt-5.4-mini
---

## Огляд

Єдина точка входу для in-app ACP-agent gateway, що збирає готовий агентський контур для роботи з каталогом інструментів і сценаріями керування задачами.

Працює як fail-safe адаптер: не кидає винятків назовні й не ламає користувацький потік під час помилок.

Передбачає локальний fallback поза реальним Tauri-runtime, щоб агентський контур лишався доступним у середовищах без повноцінного застосункового runtime.
`useAcpAgent` надає вбудований ACP agent gateway для роботи з tier/model-налаштуваннями в межах застосунку. Він задає межу інтеграції для агентного доступу до проєктного контексту та доступних інструментів, не розкриваючи внутрішню реалізацію. Локальні fail-safe гілки зменшують ризик зупинки на окремих збоях, але інші помилки можуть поширюватися назовні.

## Поведінка

1. useAcpAgent піднімає єдину точку входу для in-app ACP-agent gateway і повертає готовий до роботи агентський контур для взаємодії з каталогом інструментів та сценаріями керування задачами.
2. Якщо застосунок працює поза реальним Tauri-runtime, useAcpAgent безпечно переходить на локальний fallback, щоб відсутність домашньої теки не зупинила весь модульний граф.
3. useAcpAgent обирає базовий контекст запуску для агента з поточного середовища, а не з нав’язаного system prompt, щоб агент сам зчитував робочий контекст проєкту з наявних файлів у cwd.
4. useAcpAgent передає агенту набір доступних дій і тримає в центрі сценарій роботи з кількома незалежно виявленими робочими просторами, де фактичний tasksDir визначається з вхідних даних і резолвиться через workspace-інструменти.
5. useAcpAgent підбирає конфігурацію для різних агентських бекендів, включно з Codex, Cursor і pi, щоб інтерфейс застосунку міг працювати з кількома провайдерами без окремої логіки виклику.
6. useAcpAgent для pi покладається на власні налаштування агента з settings.json, тому рівень моделі тут не перевизначається з боку застосунку.
7. useAcpAgent працює fail-safe: помилки на старті або під час підготовки контексту не пробиваються назовні, щоб користувацький потік не ламався через технічний збій ініціалізації.
1. useAcpAgent надає вбудований ACP agent gateway для роботи з tier/model-налаштуваннями в межах застосунку.
2. Визначає робочий контекст із домашньої теки користувача; якщо це недоступно поза Tauri runtime, переходить на безпечний резервний шлях і використовує поточну теку.
3. Передає до базового gateway каталог доступних інструментів разом із визначеним робочим контекстом.
4. Делегує подальшу поведінку базовому ACP інтеграційному шару, який отримує контекст про проєкт самостійно, а не через ін’єктований system prompt.
5. Повертає готовий gateway для запитів, відповідей, погодження дій і завантаження середовища.

## Гарантії поведінки

- Власних операцій запису (ФС/БД) у файлі немає; виклики імпортованих модулів можуть писати.
- Перехоплює помилки і не пропускає винятків назовні (fail-safe).
- Локальні fail-safe гілки зменшують ризик зупинки на окремих збоях; інші помилки можуть поширюватися назовні.
31 changes: 7 additions & 24 deletions app/src/composables/use-acp-agent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CODEX_ACP_AGENT_PRESET } from '@7n/tauri-components'
import { useAcpAgent as useAcpAgentBase } from '@7n/tauri-components/vue'
import { homeDir } from '@tauri-apps/api/path'
import { TOOLS } from '../tool/catalog.js'
Expand All @@ -9,6 +8,12 @@ import { TOOLS } from '../tool/catalog.js'
// CLAUDE.md under cwd, plus the "workspaces" tool via the domain MCP bridge)
// instead of an injected system prompt — see npm/SPEC.md §3.2 of the package.
//
// Agent kinds, model tiers, and UI labels all come from the backend
// (`acp_list_tiers`, i.e. the Rust configurations in llm-lib) since
// @7n/tauri-components 0.16 — the app configures no agent configuration itself;
// the tier picker (including pi's, applied via a post-session
// `session/set_config_option` call) renders whatever the backend returns.
//
// task manages mt task graphs across multiple, independently-discovered
// workspaces (see TOOLS' "workspaces" tool) — there's no single "project
// root" the way a normal repo-scoped app has one, so cwd is just a sane
Expand All @@ -29,27 +34,5 @@ try {
* @returns {object} the in-app ACP agent gateway (agentKind/modelTier refs, journal, loadEnv/request/respond/approve)
*/
export function useAcpAgent() {
return useAcpAgentBase({
catalog: TOOLS,
cwd,
agents: {
codex: CODEX_ACP_AGENT_PRESET,
cursor: {
command: 'cursor',
args: ['agent', 'acp'],
tiers: {
MIN: { label: 'GPT-5 Mini', args: ['--model', 'gpt-5-mini'] },
AVG: { label: 'Grok 4.5', args: ['--model', 'cursor-grok-4.5-high'] },
MAX: { label: 'Auto', args: ['--model', 'auto'] }
}
},
pi: {
// pi-acp hardcodes its own spawn args (`pi --mode rpc --no-themes`) and
// has no model/provider passthrough — model comes from pi's own
// ~/.pi/agent/settings.json, so no per-tier override is possible here.
command: 'npx',
args: ['-y', 'pi-acp']
}
}
})
return useAcpAgentBase({ catalog: TOOLS, cwd })
}
Loading
Loading