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
//! Built-in profile handlers for `ilink-hub-bridge profile <type>`.
//!
//! Each handler reads the P0 env vars injected by the bridge and writes to stdout:
//! - Optional first line: `AGENT_SESSION:<uuid>`
//! - Remaining lines: reply text for the WeChat user
//!
//! All built-ins follow the same P0 exec protocol as external scripts/SDKs.
//!
//! ## Supported built-in types
//!
//! | `type:` value | CLI tool | Session resume | Notes |
//! |--------------------|---------------|----------------|-------------------------------------------|
//! | `claude-code` | `claude` | ✓ (`--resume`) | Anthropic Claude Code CLI |
//! | `codebuddy-code` | `codebuddy` | ✓ (`--resume`) | CodeBuddy Code CLI (stream-json compat) |
//! | `codex` | `codex` | ✗ | OpenAI Codex CLI (`@openai/codex`) |
//! | `cursor` | `cursor` | ✓ (optional) | Cursor background agent CLI |
//! | `agy` | `agy` | ✓ (`--conversation`) | Google Antigravity CLI |
//! | `recursive` | `recursive` | ✓ (`-r`) | Recursive agent CLI (session UUID from stderr) |
/// Dispatch to a built-in profile handler by type name.
///
/// Called from `ilink-hub-bridge profile <type>`.
pub async