1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! HTTP handlers for the subagent-profile catalogue.
//!
//! Exposes the same registry consulted by `SubSession.action=list_profiles`
//! over a plain REST endpoint so the frontend can populate role pickers
//! without going through the tool-call surface.
use ;
use json;
use crateAppState;
use crateAppError;
/// `GET /subagent_profiles`
///
/// Returns every registered subagent profile (built-ins plus any
/// user/project overrides) in the registry's stable insertion order.
///
/// Response shape (kept identical to the `list_profiles` tool action so
/// the frontend can consume either surface uniformly):
///
/// ```jsonc
/// {
/// "profiles": [
/// {
/// "id": "researcher",
/// "display_name": "Researcher",
/// "description": "...",
/// "tools": { "mode": "allowlist", "allow": ["Read", "Grep"] },
/// "model_hint": null,
/// "default_responsibility": null,
/// "ui": { "icon": "🔎", "color": "blue" }
/// }
/// ],
/// "fallback_id": "general-purpose",
/// "count": 6
/// }
/// ```
///
/// `system_prompt` is intentionally omitted (can be lengthy; UI does
/// not need it for role selection).
pub async