pikiclaw 0.3.56 → 0.3.57
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.v2.md +287 -0
- package/dashboard/dist/assets/AgentTab-CZ1gGYu5.js +1 -0
- package/dashboard/dist/assets/{BrandIcon-B2Ot9CVT.js → BrandIcon-BxcpAQmx.js} +1 -1
- package/dashboard/dist/assets/{DirBrowser-CmhpaGgd.js → DirBrowser-DMyk9B98.js} +1 -1
- package/dashboard/dist/assets/{ExtensionsTab-DLPveNeG.js → ExtensionsTab-DB0hO07B.js} +1 -1
- package/dashboard/dist/assets/{IMAccessTab-tMmBcAVN.js → IMAccessTab-JFmVCevA.js} +1 -1
- package/dashboard/dist/assets/{Modal-Dced25AE.js → Modal-wa5aS7lI.js} +1 -1
- package/dashboard/dist/assets/{Modals-BvuyBnHD.js → Modals-BHS9Pt7Z.js} +1 -1
- package/dashboard/dist/assets/{Select-C3kFfeDn.js → Select-B_4nrLCw.js} +1 -1
- package/dashboard/dist/assets/SessionPanel-CzQW7Ja4.js +1 -0
- package/dashboard/dist/assets/{SystemTab-D2ogXGEO.js → SystemTab-CHntFp7S.js} +1 -1
- package/dashboard/dist/assets/index-B992WRW4.js +22 -0
- package/dashboard/dist/assets/{index-De6pU4tv.js → index-BVWQelWc.js} +2 -2
- package/dashboard/dist/assets/{shared-DqK1Dmei.js → shared-CIz7DeCY.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/agent/driver.js +1 -1
- package/dist/agent/drivers/claude-tui.js +82 -15
- package/dist/agent/drivers/claude.js +9 -1
- package/dist/agent/drivers/hermes.js +1 -1
- package/dist/agent/utils.js +3 -1
- package/dist/bot/bot.js +62 -3
- package/dist/bot/command-ui.js +58 -11
- package/dist/bot/render-shared.js +4 -1
- package/dist/channels/feishu/render.js +7 -1
- package/dist/channels/telegram/render.js +7 -1
- package/dist/core/config/runtime-config.js +47 -0
- package/dist/dashboard/routes/agents.js +18 -0
- package/dist/dashboard/routes/sessions.js +4 -1
- package/dist/dashboard/runtime.js +17 -2
- package/dist/dashboard/session-control.js +3 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/AgentTab-nevenxki.js +0 -1
- package/dashboard/dist/assets/SessionPanel-CgkVpiSS.js +0 -1
- package/dashboard/dist/assets/index-CaY-2ocn.js +0 -22
package/README.v2.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🐾 pikiclaw
|
|
4
|
+
|
|
5
|
+
### Put the world's smartest AI agents in your pocket.
|
|
6
|
+
|
|
7
|
+
**The open orchestrator for driving a _swarm_ of coding agents — any agent, any model, any tool — from whatever screen is closest: your IM, your browser, your phone.**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx pikiclaw@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<a href="https://www.npmjs.com/package/pikiclaw"><img src="https://img.shields.io/npm/v/pikiclaw?label=npm&color=cb3837" alt="npm"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/pikiclaw"><img src="https://img.shields.io/npm/dm/pikiclaw?label=downloads&color=success" alt="npm downloads"></a>
|
|
16
|
+
<a href="https://github.com/xiaotonng/pikiclaw/stargazers"><img src="https://img.shields.io/github/stars/xiaotonng/pikiclaw?style=flat&color=yellow" alt="GitHub stars"></a>
|
|
17
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
18
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%E2%89%A520-green.svg" alt="Node 20+"></a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p>
|
|
22
|
+
<b>English</b> | <a href="README.zh-CN.md">简体中文</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<img src="docs/promo-orchestrator.png" alt="pikiclaw — the open Agent orchestrator" width="820">
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Drive your agents from your phone
|
|
32
|
+
|
|
33
|
+
> Ask from Telegram. The agent works on your machine. Results come back to the chat.
|
|
34
|
+
|
|
35
|
+
<p align="center"><img src="docs/promo-demo.gif" alt="Ask from Telegram, agent works locally, result returns to chat" width="780"></p>
|
|
36
|
+
|
|
37
|
+
pikiclaw turns **whatever messenger you already have open** into a control surface for the agents running on your own computer. Kick off a refactor, close the laptop, steer it from a coffee shop. Same agents, same files, streamed to your pocket.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## What is pikiclaw?
|
|
42
|
+
|
|
43
|
+
The agents themselves are becoming extraordinary — they plan, spawn sub-agents, run their own workflows. **pikiclaw doesn't try to out-think them. It sets them free.**
|
|
44
|
+
|
|
45
|
+
It's a deliberately thin layer that wraps best-in-class agents (Claude Code · Codex · Gemini · Hermes · …) and gives them the three things they can't give themselves:
|
|
46
|
+
|
|
47
|
+
- **Reach** — drive them from any messenger or browser, not just a terminal on one machine.
|
|
48
|
+
- **Freedom** — run them on any model: frontier, Chinese domestic, or fully local.
|
|
49
|
+
- **Parallelism** — a whole swarm at once, each on its own workspace, steered by one operator.
|
|
50
|
+
|
|
51
|
+
We never rewrite the brain. When an agent ships a new capability — a workflow engine, a sharper planner, a new tool — your pikiclaw sessions inherit it **the same day, for free**. Our job is everything *around* the agent: the terminals, the models, the tools, and the orchestration across them. The orchestrator is the product — and it's **built with itself**.
|
|
52
|
+
|
|
53
|
+
> **Thin on purpose.** As the frontier agents get smarter, pikiclaw gets stronger — for free. We never race the brain; we widen its reach.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
┌─────────────────────────────────────────────┐
|
|
57
|
+
Terminals │ Telegram · Feishu · WeChat · Slack · Discord │ ← drive from anywhere
|
|
58
|
+
│ DingTalk · WeCom · Web Dashboard · CLI │
|
|
59
|
+
├─────────────────────────────────────────────┤
|
|
60
|
+
Agents │ Claude Code · Codex · Gemini · Hermes (ACP) │ ← swap the brain
|
|
61
|
+
├─────────────────────────────────────────────┤
|
|
62
|
+
Models │ Frontier · Chinese domestic · local · proxy │ ← run it on anything
|
|
63
|
+
├─────────────────────────────────────────────┤
|
|
64
|
+
Tools │ Skills · MCP · CLIs · browser · macOS GUI │ ← merged into every session
|
|
65
|
+
└─────────────────────────────────────────────┘
|
|
66
|
+
▲ one orchestrator core routes it all ▲
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Why people use it
|
|
72
|
+
|
|
73
|
+
🐝 **A swarm of _different_ agents.** A single agent already fans out its own sub-agents inside one task — pikiclaw runs _different_ agents across _different_ tasks. Claude in pane 1, Codex in pane 2, Gemini in pane 3, each on its own workspace, one operator steering them all.
|
|
74
|
+
|
|
75
|
+
📱 **Walk-away coding.** Start a long task, then watch and steer it from your phone over Telegram/Feishu/Slack. It runs locally and streams back.
|
|
76
|
+
|
|
77
|
+
🧠 **Bring your own brain.** Frontier (Claude · GPT · Gemini), Chinese domestic (DeepSeek · Doubao · MiMo · MiniMax · Qwen), local (Ollama / mlx-lm), or any OpenAI-compatible proxy. Run Claude Code *on top of DeepSeek or a local model* without touching its config.
|
|
78
|
+
|
|
79
|
+
🖥️ **Computer use, controlled by you.** Hand the agent a real browser (Playwright) and the macOS desktop (Peekaboo) — it can see the screen, click, type, and drive apps while you watch from your phone.
|
|
80
|
+
|
|
81
|
+
🧩 **One toolkit, everywhere.** Skills, MCP servers, and CLIs configured once, auto-injected into every session, across every terminal.
|
|
82
|
+
|
|
83
|
+
♻️ **Self-bootstrapped.** The most honest test of an orchestrator is whether it can build itself. This one does — every commit and release.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Quick Start
|
|
88
|
+
|
|
89
|
+
**Prerequisites:** Node.js 20+, and at least one agent CLI installed & authenticated — [`claude`](https://docs.anthropic.com/en/docs/claude-code), [`codex`](https://github.com/openai/codex), [`gemini`](https://github.com/google-gemini/gemini-cli), or `hermes`.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
cd your-workspace
|
|
93
|
+
npx pikiclaw@latest
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
That's it — the **Web Dashboard** opens at `http://localhost:3939`. From there you drive sessions, connect IM channels, pick agents and models, and install skills & MCP servers. Everything is one click away.
|
|
97
|
+
|
|
98
|
+
<details>
|
|
99
|
+
<summary><b>Prefer the terminal, or running on a server?</b></summary>
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx pikiclaw@latest --setup # interactive terminal setup wizard
|
|
103
|
+
npx pikiclaw@latest --doctor # environment health check
|
|
104
|
+
|
|
105
|
+
# Docker (multi-arch, bakes in claude-code + codex + gemini-cli)
|
|
106
|
+
docker run -d --name pikiclaw -p 3939:3939 \
|
|
107
|
+
-e TELEGRAM_BOT_TOKEN=... \
|
|
108
|
+
-e ANTHROPIC_API_KEY=sk-ant-... \
|
|
109
|
+
-v pikiclaw-config:/home/piki/.pikiclaw \
|
|
110
|
+
-v pikiclaw-workspace:/workspace \
|
|
111
|
+
ghcr.io/xiaotonng/pikiclaw:latest
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
On a headless box you can also point the agent at a **remote browser** over CDP (`PIKICLAW_BROWSER_CDP_URL`) instead of a local Chrome. Full reference: [docs/DOCKER.md](docs/DOCKER.md).
|
|
115
|
+
|
|
116
|
+
</details>
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## How is this different?
|
|
121
|
+
|
|
122
|
+
A small, healthy ecosystem now connects coding agents to your chat apps — [cc-connect](https://github.com/chenhg5/cc-connect) is the closest peer, and it's genuinely good. We're not here to win a feature-checklist war: most of these tools (pikiclaw included) already do multi-agent, multi-channel, parallel sessions, a web dashboard, and model switching. That's table stakes now — and we'd rather be honest about it than invent a column where we win.
|
|
123
|
+
|
|
124
|
+
| | **pikiclaw** | **cc-connect & peers** |
|
|
125
|
+
|---|:---:|:---:|
|
|
126
|
+
| Multiple agents (Claude · Codex · Gemini · …) | ✅ | ✅ |
|
|
127
|
+
| Many IM channels **+** Web Dashboard | ✅ | ✅ |
|
|
128
|
+
| Parallel sessions | ✅ | ✅ |
|
|
129
|
+
| Model / provider switching | ✅ | ✅ |
|
|
130
|
+
| Skills & MCP | ✅ | ✅ |
|
|
131
|
+
| **Computer-use — a real browser _and_ the macOS desktop** | ✅ | ❌ |
|
|
132
|
+
|
|
133
|
+
Two things we actually bet on, neither of which a checklist can capture:
|
|
134
|
+
|
|
135
|
+
- **We hand the agent a body.** Built-in computer-use lets it drive a real browser (Playwright) and the macOS desktop (Peekaboo) — see the screen, click, type, run apps — not just read and write files.
|
|
136
|
+
- **Execution is the moat.** How the swarm *feels* in one cockpit, how cleanly it streams and lets you steer mid-task, how little it makes you think about plumbing. That's why we lead with the demo, not the table — and why pikiclaw is built with itself, every commit and release.
|
|
137
|
+
|
|
138
|
+
Everything else, we don't fight for — we inherit it. As the agents and the chat platforms get better, so does pikiclaw, for free.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## The Web Dashboard
|
|
143
|
+
|
|
144
|
+
> Multi-pane workspace — session list, live conversation, tool-use traces, file/image attachments, queued-task chips, one unified composer. 1 / 2 / 3 / 6 pane layouts · light & dark · EN / 中文.
|
|
145
|
+
|
|
146
|
+
<p align="center"><img src="docs/promo-dashboard-workspace.png" alt="Web Dashboard workspace" width="780"></p>
|
|
147
|
+
|
|
148
|
+
<details>
|
|
149
|
+
<summary><b>More screens: IM · Agents · Models · Extensions · Permissions · System</b></summary>
|
|
150
|
+
|
|
151
|
+
> **IM** — connection status & setup for Telegram, Feishu, WeChat, Slack, Discord, DingTalk, WeCom.
|
|
152
|
+
|
|
153
|
+
<img src="docs/promo-dashboard-im.png" alt="IM Access" width="780">
|
|
154
|
+
|
|
155
|
+
> **Agents** — manage agent CLIs, set the default, configure per-agent model & reasoning effort, bind a Profile to run an agent on a non-native model.
|
|
156
|
+
|
|
157
|
+
<img src="docs/promo-dashboard-agents.png" alt="Agents" width="780">
|
|
158
|
+
|
|
159
|
+
> **Extensions** — global MCP servers, community skills, and built-in computer-use (headless browser + macOS Peekaboo). Add servers via stdio, HTTP, or OAuth 2.1 with Dynamic Client Registration.
|
|
160
|
+
|
|
161
|
+
<img src="docs/promo-dashboard-extensions.png" alt="Extensions" width="780">
|
|
162
|
+
|
|
163
|
+
> **Permissions** — macOS Accessibility, Screen Recording & Disk Access, handled inline.
|
|
164
|
+
|
|
165
|
+
<img src="docs/promo-dashboard-permissions.png" alt="Permissions" width="780">
|
|
166
|
+
|
|
167
|
+
> **System** — working directory plus real-time CPU, memory & disk.
|
|
168
|
+
|
|
169
|
+
<img src="docs/promo-dashboard-system.png" alt="System Info" width="780">
|
|
170
|
+
|
|
171
|
+
</details>
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
<details>
|
|
176
|
+
<summary><b>📋 Full feature list (Terminal · Agent · Model · Tool)</b></summary>
|
|
177
|
+
|
|
178
|
+
### Terminal Layer
|
|
179
|
+
- **7 native IM channels** — Telegram, Feishu, WeChat, Slack, Discord, DingTalk, WeCom. Run one or all; each is code-isolated, so adding a new one touches nothing else.
|
|
180
|
+
- **Web Dashboard** — same conversational flow, tool-use tracing, and streaming as IM. Multi-pane (1/2/3/6), light/dark, full EN/中文.
|
|
181
|
+
- **Live streaming** — messages update in place; thinking traces, tool calls, and plans surface as collapsible cards; images & files stream back in real time.
|
|
182
|
+
- **Queue & steer from one composer** — send while a stream runs; new messages line up as chips you can preview, recall, or hand-steer; one click stops the turn and drains the queue.
|
|
183
|
+
|
|
184
|
+
### Agent Layer
|
|
185
|
+
- **Official CLIs as drivers** — Claude Code, Codex, Gemini, Hermes (via ACP). We don't rewrite the agent core, so you inherit upstream capabilities and Day-0 updates.
|
|
186
|
+
- **Pluggable registry** — the only contract is `src/agent/driver.ts`; any CLI- or ACP-based agent drops in.
|
|
187
|
+
- **Per-session switching** — swap the brain mid-task; the same history follows you.
|
|
188
|
+
- **Steer & interrupt** — jump a queued message to the front, or stop everything in one click.
|
|
189
|
+
- **Codex human-in-the-loop** — when Codex asks a question, it's forwarded to your terminal; reply inline and it resumes.
|
|
190
|
+
- **Persistent goals** — `/goal <objective>` keeps a session working until it self-audits completion (Codex native budget/pause-resume · Claude Stop-hook with a Haiku judge · portable loop for others).
|
|
191
|
+
- **Image generation, surfaced end-to-end** — generated images arrive as real attachments, not base64, with a click-to-reveal prompt.
|
|
192
|
+
|
|
193
|
+
### Model Layer
|
|
194
|
+
- **Frontier + domestic + local + proxies** — Claude · GPT/Codex · Gemini · DeepSeek · Doubao · MiMo · MiniMax · Qwen · Ollama · mlx-lm · OpenRouter · any OpenAI-compatible endpoint.
|
|
195
|
+
- **Providers & Profiles vault** — API keys are sealed into the OS keychain (with a sealed-inline / env / shell-command fallback chain), validated against a read-only `models.dev` catalog, and injected per-agent at spawn time.
|
|
196
|
+
- **Local models, zero-config** — detected Ollama / mlx-lm backends auto-attach, with install hints and RAM-headroom warnings.
|
|
197
|
+
- **Per-session model & effort** — switch live via Dashboard, `/models`, or `/mode`.
|
|
198
|
+
- **Deep injection** — run Claude Code on DeepSeek, Doubao, or a local model without editing the upstream client's config.
|
|
199
|
+
|
|
200
|
+
### Tool Layer
|
|
201
|
+
- **Skills** — project skills in `.pikiclaw/skills/*/SKILL.md` (legacy `.claude/commands/*.md` still works); one-click install from any GitHub `owner/repo` or a curated set. Trigger anywhere with `/skills` and `/sk_<name>`.
|
|
202
|
+
- **MCP ecosystem** — browse the MCP Registry; add stdio/HTTP servers; OAuth 2.1 + Dynamic Client Registration; real-handshake health checks. Plus two built-in computer-use servers: `pikiclaw-browser` (Chrome via Playwright) and `peekaboo` (macOS GUI).
|
|
203
|
+
- **CLI tools** — auto-detects versions & auth for gh, brew, npm, uv, …; OAuth-web login routes through the agent's normal tool surface.
|
|
204
|
+
- **Session-scoped bridge** — `im_*`, `goal_*`, and computer-use tools auto-injected into every session.
|
|
205
|
+
- **Three-way merge** — `global < workspace < built-in`, resolved silently per session.
|
|
206
|
+
|
|
207
|
+
### Runtime
|
|
208
|
+
- **Dedicated session workspaces** — each session gets an isolated dir; uploads & generated assets land there.
|
|
209
|
+
- **Computer-use (browser)** — `pikiclaw-browser` wraps `@playwright/mcp` with a process-level supervisor and a shared, persistent Chrome profile; can also attach to a **remote browser over CDP** for servers/Docker.
|
|
210
|
+
- **Computer-use (macOS)** — `peekaboo` exposes `see`/`click`/`type`/`window`/`menu`/`app`/`dock` plus a goal-directed sub-agent (needs Accessibility + Screen Recording).
|
|
211
|
+
- **Hardened for long tasks** — sleep prevention, watchdog, auto-restart, daemon mode, channel supervisor; restart is blocked while tasks run, so a hot reload never kills a marathon job.
|
|
212
|
+
|
|
213
|
+
</details>
|
|
214
|
+
|
|
215
|
+
<details>
|
|
216
|
+
<summary><b>⌨️ Command reference</b></summary>
|
|
217
|
+
|
|
218
|
+
| Command | Description |
|
|
219
|
+
|---|---|
|
|
220
|
+
| `/start` | Entry info, active agent, working directory |
|
|
221
|
+
| `/sessions` | View, switch, or create sessions |
|
|
222
|
+
| `/agents` | Switch the active agent |
|
|
223
|
+
| `/models` | Switch model or reasoning effort |
|
|
224
|
+
| `/mode` | Toggle plan mode / reasoning effort |
|
|
225
|
+
| `/switch` · `/workspaces` | Change or pick a working directory |
|
|
226
|
+
| `/goal` | Set or inspect a long-running, self-terminating goal |
|
|
227
|
+
| `/stop` | Force-stop the current session |
|
|
228
|
+
| `/status` · `/host` | Runtime status / host CPU·memory·disk·battery |
|
|
229
|
+
| `/skills` · `/sk_<name>` | Browse / run a project skill |
|
|
230
|
+
| `/ext` | Extensions overview |
|
|
231
|
+
| `/restart` | Restart the bot service |
|
|
232
|
+
|
|
233
|
+
*Plain text without a slash goes straight to the current agent.*
|
|
234
|
+
|
|
235
|
+
</details>
|
|
236
|
+
|
|
237
|
+
<details>
|
|
238
|
+
<summary><b>⚙️ Configuration</b></summary>
|
|
239
|
+
|
|
240
|
+
- **Persistent config:** `~/.pikiclaw/setting.json` (channels, agents, workspaces, MCP extensions, Profiles). **API keys are not stored here** — they're sealed into the OS keychain when available.
|
|
241
|
+
- The **Dashboard** is the primary config UI; `--setup` and `--doctor` cover headless/CLI-first users.
|
|
242
|
+
- Global MCP extensions live under `extensions.mcp`; workspace MCP follows `.mcp.json` in the project root.
|
|
243
|
+
- Project skills load from `.pikiclaw/skills/*/SKILL.md` (legacy `.claude/commands/*.md` supported).
|
|
244
|
+
- **Computer-use toggles** (Extensions dashboard): `browserEnabled` (managed Chrome), `peekabooEnabled` (macOS desktop — requires Accessibility + Screen Recording).
|
|
245
|
+
|
|
246
|
+
</details>
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Roadmap
|
|
251
|
+
|
|
252
|
+
**SupporterAgent** — a meta-agent layered on top of the stack that owns a complex objective end-to-end: decompose, schedule the right sub-agents on the right models with the right tools, watch their streams, and step in when one stalls or drifts — so pikiclaw can drive long-horizon, multi-agent work without a human babysitting every turn.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Development & Contributing
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
git clone https://github.com/xiaotonng/pikiclaw.git
|
|
260
|
+
cd pikiclaw && npm install && npm run build && npm test
|
|
261
|
+
npm run dev # local dev server (logs to ~/.pikiclaw/dev/dev.log)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Every layer is built to be extended — a new terminal, agent driver, model wrapper, or MCP tool is a first-class contribution. Start with the **[Contributing Guide](CONTRIBUTING.md)** and the [`good first issue`](https://github.com/xiaotonng/pikiclaw/labels/good%20first%20issue) label. Deep dives: [ARCHITECTURE.md](ARCHITECTURE.md) · [INTEGRATION.md](INTEGRATION.md) · [TESTING.md](TESTING.md).
|
|
265
|
+
|
|
266
|
+
| Extend | Where |
|
|
267
|
+
|---|---|
|
|
268
|
+
| A new agent driver (CLI or ACP) | `src/agent/driver.ts`, `src/agent/drivers/*.ts`, `src/agent/acp-client.ts` |
|
|
269
|
+
| A new terminal / IM channel | `src/channels/base.ts`, `src/channels/*/` |
|
|
270
|
+
| A new model provider / injection rule | `src/model/`, `src/model/injector.ts` |
|
|
271
|
+
| Dashboard backend API | `src/dashboard/routes/*.ts` |
|
|
272
|
+
| Session-scoped MCP tools | `src/agent/mcp/tools/*.ts`, `src/agent/mcp/bridge.ts` |
|
|
273
|
+
| Recommended MCP / CLI / skills | `src/catalog/*.ts` |
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Star History
|
|
278
|
+
|
|
279
|
+
<a href="https://www.star-history.com/#xiaotonng/pikiclaw&Date">
|
|
280
|
+
<img src="https://api.star-history.com/svg?repos=xiaotonng/pikiclaw&type=Date" alt="Star History" width="640">
|
|
281
|
+
</a>
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## License
|
|
286
|
+
|
|
287
|
+
[MIT](LICENSE) — Built in the open. Use it, fork it, plug in your own layers.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as e,b as He}from"./react-vendor-DTcmqLiz.js";import{c as F,u as $,L as T,I as V,a as K,B as _,S as G,k as O,b as De,g as Q,E as he,A as Be}from"./index-BVWQelWc.js";import{B as W}from"./BrandIcon-BxcpAQmx.js";import{S as q}from"./Select-B_4nrLCw.js";import{M as ee,a as te}from"./Modal-wa5aS7lI.js";import{A as ce,S as Ue}from"./shared-CIz7DeCY.js";import"./router-Cav8lq-m.js";function xe(n,t){return!!(n&&t instanceof Node&&n.contains(t))}function _e(n,t){if(t.length===0)return!0;const l=`${n.label} ${n.description||""} ${n.meta||""}`.toLowerCase();return t.every(s=>l.includes(s))}function ke({value:n,options:t,onChange:l,className:s,placeholder:d="—",disabled:a=!1,searchPlaceholder:o="Search models...",noMatchesText:k="No matches",currentLabel:u="Current"}){const i=t.find(m=>m.value===n),b=t.length<=1,[p,g]=r.useState(!1),[f,M]=r.useState(""),[E,S]=r.useState(null),L=r.useRef(null),C=r.useRef(null),x=r.useRef(null);r.useEffect(()=>{if(!p)return;const m=c=>{xe(L.current,c.target)||xe(C.current,c.target)||g(!1)},v=c=>{c.key==="Escape"&&g(!1)};return document.addEventListener("mousedown",m),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",v)}},[p]),r.useEffect(()=>{p||M("")},[p]),r.useEffect(()=>{if(p){const m=window.setTimeout(()=>x.current?.focus(),0);return()=>window.clearTimeout(m)}},[p]),r.useLayoutEffect(()=>{if(!p)return;const m=()=>{const v=L.current;if(!v)return;const c=v.getBoundingClientRect(),A=window.innerHeight-c.bottom-12,P=c.top-12,D=A<280&&P>A,U=Math.max(220,Math.min(360,D?P:A));S({left:c.left,top:D?Math.max(12,c.top-U-8):c.bottom+8,width:c.width,maxHeight:U})};return m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[p]);const w=r.useMemo(()=>f.trim().toLowerCase().split(/\s+/).filter(Boolean),[f]),R=r.useMemo(()=>t.filter(m=>m.value!==n&&_e(m,w)),[t,n,w]);if(b)return e.jsx("div",{className:F("flex h-9 w-full items-center rounded-md border border-edge bg-panel-alt px-3 text-[13px] text-fg-5 shadow-none",a&&"cursor-not-allowed",s),children:e.jsx("span",{className:F("truncate",!i&&"text-fg-6"),children:i?.label||d})});const y=m=>{a||(l(m),g(!1))},h=(m,v)=>e.jsxs("button",{type:"button",role:"option","aria-selected":v,onClick:()=>y(m.value),className:F("flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-[13px] transition-colors duration-200",v?"bg-panel text-fg shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]":"text-fg-3 hover:bg-panel-alt hover:text-fg-2"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m.label}),m.meta&&e.jsx("span",{className:"shrink-0 font-mono text-[10px] text-fg-5",children:m.meta})]}),m.description&&e.jsx("div",{className:"mt-0.5 truncate text-[11px] leading-relaxed text-fg-5",children:m.description})]}),v&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"mt-0.5 shrink-0 text-fg-4",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})]},m.value),B=m=>{const v=[];let c;for(const j of m)j.group&&j.group!==c?(v.push(e.jsx("div",{className:"px-3 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wide text-fg-5",children:j.group},`__group:${j.group}`)),c=j.group):j.group||(c=void 0),v.push(h(j,!1));return v},z=p&&E?He.createPortal(e.jsxs("div",{ref:C,role:"listbox",className:"fixed z-[220] flex flex-col overflow-hidden rounded-xl border border-edge-h bg-[var(--th-dropdown)] p-1.5 shadow-[0_24px_64px_rgba(2,6,23,0.22)] backdrop-blur-xl",style:{left:E.left,top:E.top,width:E.width,maxHeight:E.maxHeight},children:[e.jsxs("div",{className:"relative px-1.5 pt-1 pb-2",children:[e.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-3.5 flex items-center text-fg-5",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("input",{ref:x,type:"text",value:f,onChange:m=>M(m.target.value),placeholder:o,spellCheck:!1,autoComplete:"off",className:F("h-8 w-full rounded-md border border-control-border bg-control pl-7 pr-2 text-[12px] text-fg shadow-sm","transition-[border-color,box-shadow,background] duration-200 outline-none","placeholder:text-fg-5","focus:border-control-border-h focus:bg-control-h focus:shadow-[0_0_0_4px_var(--th-glow-a)]")})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[i&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-5",children:u}),h(i,!0),e.jsx("div",{className:"my-1.5 border-t border-edge"})]}),R.length>0?B(R):e.jsx("div",{className:"px-3 py-3 text-center text-[12px] text-fg-5",children:k})]})]}),document.body):null;return e.jsxs("div",{ref:L,className:F("relative",s),children:[e.jsxs("button",{type:"button",disabled:a,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>g(m=>!m),className:F("flex h-9 w-full items-center rounded-md border border-control-border bg-control px-3 pr-8 text-left text-[13px] text-fg shadow-sm","transition-[border-color,box-shadow,background] duration-200 outline-none","hover:border-control-border-h hover:bg-control-h","focus-visible:border-control-border-h focus-visible:shadow-[0_0_0_4px_var(--th-glow-a)]","disabled:cursor-not-allowed disabled:bg-panel-alt disabled:border-edge disabled:text-fg-5","disabled:shadow-none disabled:hover:border-edge disabled:hover:bg-panel-alt",p&&"border-control-border-h bg-control-h shadow-[0_0_0_4px_var(--th-glow-a)]"),children:[e.jsx("span",{className:F("min-w-0 flex-1 truncate",!i&&"text-fg-5"),children:i?.label||d}),e.jsx("span",{className:F("pointer-events-none absolute inset-y-0 right-3 flex items-center text-fg-4 transition-transform duration-200",p&&"rotate-180"),children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),z]})}const J=[{id:"openrouter",kind:"openai-compatible",name:{zh:"OpenRouter",en:"OpenRouter"},blurb:{zh:"一个 key 通行 300+ 模型",en:"One key, 300+ models"},baseURL:"https://openrouter.ai/api/v1",envVar:"OPENROUTER_API_KEY",defaultModel:"anthropic/claude-sonnet-4"},{id:"qwen",kind:"openai-compatible",name:{zh:"通义千问 Qwen",en:"Alibaba Qwen"},blurb:{zh:"阿里云 DashScope",en:"Alibaba DashScope"},baseURL:"https://dashscope.aliyuncs.com/compatible-mode/v1",envVar:"DASHSCOPE_API_KEY",defaultModel:"qwen3-max"},{id:"doubao",kind:"openai-compatible",name:{zh:"豆包 Seed",en:"Doubao Seed"},blurb:{zh:"字节跳动 · 火山方舟",en:"ByteDance Volcengine Ark"},baseURL:"https://ark.cn-beijing.volces.com/api/v3",envVar:"ARK_API_KEY",defaultModel:"doubao-seed-1-6-250615"},{id:"glm",kind:"openai-compatible",name:{zh:"智谱 GLM",en:"Zhipu GLM"},blurb:{zh:"GLM-4.6 / Z.AI",en:"GLM-4.6 / Z.AI"},baseURL:"https://open.bigmodel.cn/api/paas/v4",envVar:"ZAI_API_KEY",defaultModel:"glm-4.6"},{id:"minimax",kind:"openai-compatible",name:{zh:"MiniMax",en:"MiniMax"},blurb:{zh:"M2 / abab",en:"M2 / abab"},baseURL:"https://api.minimax.chat/v1",envVar:"MINIMAX_API_KEY",defaultModel:"MiniMax-M2"},{id:"deepseek",kind:"openai-compatible",name:{zh:"DeepSeek",en:"DeepSeek"},blurb:{zh:"深度求索官方 API",en:"DeepSeek official API"},baseURL:"https://api.deepseek.com",envVar:"DEEPSEEK_API_KEY",defaultModel:"deepseek-chat"},{id:"anthropic",kind:"anthropic",name:{zh:"Anthropic 直连",en:"Anthropic Direct"},blurb:{zh:"Claude 官方 API",en:"Official Claude API"},baseURL:"https://api.anthropic.com",envVar:"ANTHROPIC_API_KEY",defaultModel:"claude-sonnet-4-5"},{id:"google",kind:"google",name:{zh:"Google AI Studio",en:"Google AI Studio"},blurb:{zh:"Gemini 官方 API",en:"Official Gemini API"},baseURL:"https://generativelanguage.googleapis.com/v1beta",envVar:"GEMINI_API_KEY",defaultModel:"gemini-2.5-pro"},{id:"openai",kind:"openai",name:{zh:"OpenAI 直连",en:"OpenAI Direct"},blurb:{zh:"gpt-5 / o-系列",en:"gpt-5 / o-series"},baseURL:"https://api.openai.com/v1",envVar:"OPENAI_API_KEY",defaultModel:"gpt-5"},{id:"custom",kind:"openai-compatible",name:{zh:"自定义端点",en:"Custom"},blurb:{zh:"其他 OpenAI 兼容端点",en:"Other OpenAI-compatible endpoint"},baseURL:"",envVar:""}];function $e(n){return n==="zh-CN"?{sectionTitle:"模型供应商",sectionHint:"连接你自己的模型供应商,凭据加密存入系统 Keychain,可绑定到任意一个智能体。",addLabel:"接入新供应商",validate:"校验",validating:"校验中",edit:"编辑",remove:"删除",removeConfirm:"删除该供应商?已绑定的智能体会自动恢复为官方 Auth。",unbound:"尚未被任何智能体使用",boundOne:"已绑定",boundN:t=>`${t} 个智能体在用`,notConnected:"未接入",modalAddTitle:"接入模型供应商",modalAddHint:t=>t?`已套用 ${t} 模板,仅需粘贴 API Key。`:"填入端点和凭据,保存后即可在智能体卡片上选用。",modalEditTitle:"编辑供应商配置",modalEditHint:"修改端点、凭据或模型参数。修改凭据会清空已校验状态。",fieldName:"配置名称",fieldNamePlaceholder:"例如:OpenRouter · 个人",fieldKind:"API 类型",fieldBaseURL:"Base URL",fieldCredentialSource:"凭据来源",fieldApiKey:"API Key",fieldApiKeyHint:"通过 @napi-rs/keyring 写入系统 Keychain,setting.json 仅保存引用。",fieldEnvVar:"环境变量名",fieldCommand:"获取命令(执行结果作为 key)",fieldModelId:"模型 ID",fieldEffort:"推理强度",fieldEffortHelp:"可用范围由模型决定,留空表示沿用模型默认值。",effortHermesNote:"Hermes 当前从 ~/.hermes/config.yaml 读取推理强度,Profile 上的 effort 暂仅做记录。",credPaste:"粘贴 API Key(推荐,写入系统 Keychain)",credEnv:"从环境变量读取",credCommand:"运行命令获取(1Password / pass / gh 等)",effortDefault:"(沿用默认)",cancel:"取消",save:"保存",saving:"保存中",validationReady:"已就绪",validationInvalid:"凭据无效",validationError:"网络/服务错误",validationUnvalidated:"未校验",providerOnlyHint:"保存后回到智能体卡片,点击「BYOK」选择具体的模型与推理强度。",credentialLabel:"凭据",modelsAvailable:t=>`可用 ${t} 个模型`}:{sectionTitle:"Model Providers",sectionHint:"Connect your own model providers. Keys are encrypted in the OS keychain and can be bound to any agent.",addLabel:"Add provider",validate:"Validate",validating:"Validating",edit:"Edit",remove:"Remove",removeConfirm:"Remove this provider? Bound agents will fall back to native auth.",unbound:"Not used by any agent yet",boundOne:"Bound to",boundN:t=>`${t} agents in use`,notConnected:"Not connected",modalAddTitle:"Connect Model Provider",modalAddHint:t=>t?`Pre-filled from the ${t} template — just paste your API key.`:"Enter endpoint and credential. After saving, choose models on the agent cards above.",modalEditTitle:"Edit Provider",modalEditHint:"Update the endpoint, credential, or model. Changing the credential clears the validated state.",fieldName:"Display name",fieldNamePlaceholder:"e.g. OpenRouter · Personal",fieldKind:"API kind",fieldBaseURL:"Base URL",fieldCredentialSource:"Credential source",fieldApiKey:"API key",fieldApiKeyHint:"Stored in the OS keychain via @napi-rs/keyring; setting.json keeps only a reference.",fieldEnvVar:"Environment variable name",fieldCommand:"Command (stdout becomes the key)",fieldModelId:"Model ID",fieldEffort:"Reasoning effort",fieldEffortHelp:"Available values depend on the chosen model; leave blank to use the default.",effortHermesNote:"Hermes currently reads reasoning_effort from ~/.hermes/config.yaml; Profile.effort is recorded only for now.",credPaste:"Paste API key (recommended — stored in OS keychain)",credEnv:"Read from environment variable",credCommand:"Run a command (1Password / pass / gh, …)",effortDefault:"(default)",cancel:"Cancel",save:"Save",saving:"Saving",validationReady:"Ready",validationInvalid:"Invalid",validationError:"Error",validationUnvalidated:"Not validated",providerOnlyHint:'After saving, head back to an agent card and click "BYOK" to choose the model and effort.',credentialLabel:"Credential",modelsAvailable:t=>`${t} models available`}}const se={anthropic:{zh:"Anthropic 原生",en:"Anthropic native"},openai:{zh:"OpenAI 原生",en:"OpenAI native"},"openai-compatible":{zh:"OpenAI 兼容",en:"OpenAI-compatible"},google:{zh:"Google AI Studio",en:"Google AI Studio"}};function ge(n,t){return t==="zh-CN"?se[n].zh:se[n].en}async function ae(n){return(await fetch(n)).json()}async function X(n,t,l){return(await fetch(t,{method:n,headers:{"Content-Type":"application/json"},body:l?JSON.stringify(l):void 0})).json()}function Ie(n){const t=(()=>{try{return new URL(n.baseURL)}catch{return null}})(),l=t?.host.toLowerCase()??"",s=t?.port??"";return(l.startsWith("127.0.0.1")||l.startsWith("localhost"))&&s==="11434"?"ollama":(l.startsWith("127.0.0.1")||l.startsWith("localhost"))&&s==="8080"?"mlx":l.includes("openrouter")?"openrouter":l.includes("anthropic")?"anthropic":l.includes("deepseek")?"deepseek":l.includes("googleapis")||l.includes("vertex")?"google":l.includes("openai.com")?"openai":l.includes("dashscope")||l.includes("qwen")||l.includes("aliyun")?"qwen":l.includes("volces")||l.includes("volcengine")||l.includes("doubao")?"doubao":l.includes("bigmodel")||l.includes("zhipu")||l.includes("z.ai")?"glm":l.includes("minimax")?"minimax":n.kind==="anthropic"?"anthropic":n.kind==="google"?"google":n.kind==="openai"?"openai":"custom"}function ze({desc:n,copy:t,locale:l,onPick:s}){const{provider:d,template:a}=n,o=!!d,k=d?Ie(d):a?.id??"custom",u=d?.name??(a?l==="zh-CN"?a.name.zh:a.name.en:""),i=a?l==="zh-CN"?a.blurb.zh:a.blurb.en:"",b=d?.validation?.state??null,p=d?.validation?.modelCount;let g=null,f="";d&&(b==="ready"?(g="bg-emerald-500",f=p!=null?t.modelsAvailable(p):t.validationReady):b==="invalid"?(g="bg-rose-500",f=t.validationInvalid):b==="error"?(g="bg-amber-500",f=t.validationError):(g="bg-fg-6",f=t.validationUnvalidated));const M=o&&d.validation?.detail&&b!=="ready"?d.validation.detail:i;return e.jsxs("button",{type:"button",onClick:()=>s(n),className:"group relative flex h-[68px] items-center gap-2.5 rounded-lg border border-edge bg-panel-alt px-3 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:border-edge-strong hover:bg-panel hover:shadow-[0_4px_16px_rgba(15,23,42,0.06)]",children:[e.jsx(W,{brand:k,size:26}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[g&&e.jsx("span",{className:F("inline-block h-[6px] w-[6px] shrink-0 rounded-full",g),title:f}),e.jsx("span",{className:"truncate text-[13px] font-semibold tracking-tight text-fg",children:u})]}),M&&e.jsx("div",{className:"truncate text-[11px] leading-snug text-fg-5",title:M,children:M})]}),b==="ready"&&p!=null&&e.jsx("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",title:t.modelsAvailable(p),children:p})]})}function ie(n,t){return{name:t==="zh-CN"?`${n.name.zh}`:`${n.name.en}`,kind:n.kind,baseURL:n.baseURL,credMode:"paste",apiKey:"",envVar:n.envVar||"API_KEY",cmdLine:"op read op://Personal/Provider/key"}}function Fe({open:n,copy:t,locale:l,initial:s,initialTemplateName:d,existingProvider:a,onClose:o,onSaved:k,onRemove:u}){const[i,b]=r.useState(()=>s||ie(J[0],l)),[p,g]=r.useState(!1),[f,M]=r.useState(null);r.useEffect(()=>{n&&(b(s||ie(J[0],l)),M(null))},[n,s,l]);const E=!!a,S=!!d||E,L=r.useCallback(async()=>{M(null),g(!0);try{const x=i.credMode==="env"?{source:"env",varName:i.envVar.trim()}:i.credMode==="command"?{source:"command",argv:i.cmdLine.trim().split(/\s+/).filter(Boolean)}:null;let w;if(E&&a){const y={name:i.name.trim()||a.name,baseURL:i.baseURL.trim()};i.credMode==="paste"&&i.apiKey?y.apiKey=i.apiKey:x&&(y.credentialRef=x);const h=await X("PATCH",`/api/models/providers/${a.id}`,y);if(!h.ok){M(h.error||"Failed to update provider");return}w=a.id}else{const y={kind:i.kind,name:i.name.trim()||`${ge(i.kind,l)}`,baseURL:i.baseURL.trim()};i.credMode==="paste"?y.apiKey=i.apiKey:x&&(y.credentialRef=x);const h=await X("POST","/api/models/providers",y);if(!h.ok||!h.provider){M(h.error||"Failed to create provider");return}w=h.provider.id}const R=await X("POST",`/api/models/providers/${w}/validate`);if(k(),R.validation&&R.validation.state!=="ready"){M(`${t.validationInvalid}: ${R.validation.detail}`);return}o()}catch(x){M(x?.message||String(x))}finally{g(!1)}},[i,E,a,l,k,o,t.validationInvalid]),C=!p&&i.name.trim().length>0&&i.baseURL.trim().length>0&&(i.credMode!=="paste"||(E?!0:i.apiKey.length>0))&&(i.credMode!=="env"||i.envVar.trim().length>0)&&(i.credMode!=="command"||i.cmdLine.trim().length>0);return e.jsxs(ee,{open:n,onClose:o,children:[e.jsx(te,{title:E?t.modalEditTitle:t.modalAddTitle,description:E?t.modalEditHint:t.modalAddHint(d||null),onClose:o}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(T,{children:t.fieldName}),e.jsx(V,{value:i.name,onChange:x=>b(w=>({...w,name:x.target.value})),placeholder:t.fieldNamePlaceholder})]}),S?e.jsxs("div",{children:[e.jsx(T,{children:t.fieldBaseURL}),e.jsx(V,{value:i.baseURL,onChange:x=>b(w=>({...w,baseURL:x.target.value})),placeholder:"https://…"})]}):e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(T,{children:t.fieldKind}),e.jsx(q,{value:i.kind,options:Object.keys(se).map(x=>({value:x,label:ge(x,l)})),onChange:x=>b(w=>({...w,kind:x}))})]}),e.jsxs("div",{children:[e.jsx(T,{children:t.fieldBaseURL}),e.jsx(V,{value:i.baseURL,onChange:x=>b(w=>({...w,baseURL:x.target.value})),placeholder:"https://…"})]})]}),e.jsxs("div",{children:[e.jsx(T,{children:t.fieldCredentialSource}),e.jsx(q,{value:i.credMode,options:[{value:"paste",label:t.credPaste},{value:"env",label:t.credEnv},{value:"command",label:t.credCommand}],onChange:x=>b(w=>({...w,credMode:x}))})]}),i.credMode==="paste"&&e.jsxs("div",{children:[e.jsx(T,{children:t.fieldApiKey}),e.jsx(V,{type:"password",value:i.apiKey,onChange:x=>b(w=>({...w,apiKey:x.target.value})),placeholder:E?"••••••••":"sk-…"}),e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:t.fieldApiKeyHint})]}),i.credMode==="env"&&e.jsxs("div",{children:[e.jsx(T,{children:t.fieldEnvVar}),e.jsx(V,{value:i.envVar,onChange:x=>b(w=>({...w,envVar:x.target.value})),placeholder:"OPENROUTER_API_KEY"})]}),i.credMode==="command"&&e.jsxs("div",{children:[e.jsx(T,{children:t.fieldCommand}),e.jsx(V,{value:i.cmdLine,onChange:x=>b(w=>({...w,cmdLine:x.target.value})),placeholder:"op read op://Personal/OpenRouter/key"})]}),f&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:f})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-2 border-t border-edge pt-4",children:[e.jsx("div",{children:E&&u&&e.jsx("button",{type:"button",onClick:()=>{u()},className:"text-[12px] text-fg-5 transition hover:text-[var(--th-err)]",children:t.remove})}),e.jsx(ce,{primary:{label:p?t.saving:t.save,onClick:L,disabled:!C},secondary:{label:t.cancel,onClick:o}})]})]})}function Ce(){const[n,t]=r.useState([]),[l,s]=r.useState([]),[d,a]=r.useState({}),o=r.useCallback(async()=>{const[u,i,b]=await Promise.all([ae("/api/models/providers"),ae("/api/models/profiles"),ae("/api/models/agents")]);t(u.providers||[]),s(i.profiles||[]);const p={};for(const g of b.bindings||[])p[g.agent]=g.activeProfileId;a(p)},[]),k=r.useCallback(async(u,i)=>{await X("POST",`/api/models/agents/${u}/active`,{profileId:i}),await o()},[o]);return r.useEffect(()=>{o()},[o]),{providers:n,profiles:l,bindings:d,reload:o,setActiveProfile:k}}function ve(n){return n.replace(/\/+$/,"").replace(/^http:\/\/localhost(?=[:/]|$)/i,"http://127.0.0.1").replace(/^https:\/\/localhost(?=[:/]|$)/i,"https://127.0.0.1")}function be(n,t){const l=ve(n.baseURL);return t.some(s=>ve(s.openAIBaseURL)===l)}function Ke({snapshot:n,localBackends:t}={}){const l=Ce(),s=n??l,{providers:d,reload:a}=s,o=t??[],k=$(C=>C.locale),u=r.useMemo(()=>$e(k),[k]);$(C=>C.toast);const[i,b]=r.useState(null),p=r.useCallback(async C=>{confirm(u.removeConfirm)&&(await X("DELETE",`/api/models/providers/${C.id}`),await a())},[u,a]),g=r.useMemo(()=>{if(!i||i.kind!=="edit")return null;const{provider:C}=i;return{name:C.name,kind:C.kind,baseURL:C.baseURL,credMode:"paste",apiKey:"",envVar:J.find(x=>x.kind===C.kind)?.envVar||"API_KEY",cmdLine:"op read op://Personal/Provider/key"}},[i]),f=r.useMemo(()=>!i||i.kind!=="add"?null:ie(i.template,k),[i,k]),M=i&&i.kind==="add"&&i.template.id!=="custom"?k==="zh-CN"?i.template.name.zh:i.template.name.en:null,E=r.useMemo(()=>{const C=new Map;for(const x of d){const w=Ie(x);C.has(w)||C.set(w,x)}return C},[d]),S=r.useMemo(()=>{const C=d.filter(y=>!be(y,o)),x=new Set,w=[];for(const y of J){if(y.id==="custom")continue;const h=E.get(y.id);h&&!be(h,o)?(x.add(h.id),w.push({template:y,provider:h})):w.push({template:y})}for(const y of C)x.has(y.id)||w.push({provider:y});const R=J.find(y=>y.id==="custom");return R&&w.push({template:R}),w},[d,E,o]),L=r.useCallback(C=>{if(C.provider){b({kind:"edit",provider:C.provider});return}C.template&&b({kind:"add",template:C.template})},[]);return e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:S.map((C,x)=>e.jsx(ze,{desc:C,copy:u,locale:k,onPick:L},C.provider?.id??`tpl-${C.template?.id??x}`))}),i&&e.jsx(Fe,{open:!0,copy:u,locale:k,initial:i.kind==="edit"?g:f,initialTemplateName:M,existingProvider:i.kind==="edit"?i.provider:void 0,onClose:()=>b(null),onSaved:a,onRemove:i.kind==="edit"?async()=>{await p(i.provider),b(null)}:void 0})]})}const Ve=4;function Ge(n){return n==="zh-CN"?{sectionLabel:"本地后端",hostLabel:"本机",hostUnknown:"检测中…",refresh:"刷新",refreshing:"刷新中…",loadFailed:"加载失败",tileStatusDetected:"已运行",tileStatusNotDetected:"未检测到",tileStatusUnsupported:"不支持当前系统",tileBadgeReady:t=>`${t} 个模型已就绪`,tileBlurbOllama:"跨平台默认,CLI 友好,模型下载到本地后常驻",tileBlurbMlx:"Apple Silicon 原生,性能压榨极限,按需启动",tileInstalledModels:t=>`${t} 个模型`,modalTitle:t=>`准备 ${t}`,modalDescription:t=>`安装 ${t}、下载所需模型、核对运行状态——本地模型的全部配置都在这里完成。`,stepStatus:"后端状态",stepModels:"模型",statusRunning:"已运行",statusNotRunning:"未在本机检测到此后端",statusUnsupportedDesc:t=>`${t} 不支持当前系统。`,statusRecheck:"重新检测",statusRechecking:"检测中…",statusInstallHeader:"安装命令",statusInstallDocs:"官方安装文档",statusRunHint:"启动服务(安装后)",statusHomepageCta:"官网",statusAutoAttachedHint:t=>`本地 ${t} 已在运行;继续在下方下载并核对所需模型。`,modelsInstalledHeader:t=>`已就绪(${t})`,modelsInstalledEmpty:"后端在线,但尚未加载任何模型。在终端按下方命令准备一个。",modelsRecommendedHeader:"推荐模型 · 在终端执行以下命令准备",modelsBackendOffline:"启动后端后再返回此处准备模型。",fitOk:"推荐",fitTight:"勉强可跑",fitNoGo:"内存不足",modelInstalledBadge:"已就绪",pullPrefix:"终端执行",copyCommand:"复制",copied:"已复制",closeBtn:"完成"}:{sectionLabel:"Local backends",hostLabel:"This machine",hostUnknown:"Detecting…",refresh:"Refresh",refreshing:"Refreshing…",loadFailed:"Failed to load local backends",tileStatusDetected:"Running",tileStatusNotDetected:"Not detected",tileStatusUnsupported:"Not supported on this OS",tileBadgeReady:t=>`${t} models ready`,tileBlurbOllama:"Cross-platform default, CLI-friendly, models persist on disk",tileBlurbMlx:"Apple Silicon native, peak performance, on-demand launch",tileInstalledModels:t=>`${t} models`,modalTitle:t=>`Prepare ${t}`,modalDescription:t=>`Install ${t}, download the models you want, and verify they're running — all the local-model configuration lives in this panel.`,stepStatus:"Backend status",stepModels:"Models",statusRunning:"Running",statusNotRunning:"Backend not detected on this machine",statusUnsupportedDesc:t=>`${t} does not run on this OS.`,statusRecheck:"Re-check",statusRechecking:"Checking…",statusInstallHeader:"Install commands",statusInstallDocs:"Official install docs",statusRunHint:"Start the server (after install)",statusHomepageCta:"Homepage",statusAutoAttachedHint:t=>`Local ${t} is running. Continue below to download and verify the models you need.`,modelsInstalledHeader:t=>`Ready (${t})`,modelsInstalledEmpty:"Backend is up but no model is loaded. Use the command below to prepare one.",modelsRecommendedHeader:"Recommended models — run these in your terminal",modelsBackendOffline:"Start the backend first, then come back to prepare models.",fitOk:"Recommended",fitTight:"Tight fit",fitNoGo:"Not enough RAM",modelInstalledBadge:"Ready",pullPrefix:"Run in terminal",copyCommand:"Copy",copied:"Copied",closeBtn:"Done"}}function re(n,t){return n===null?"tight":n>=t+Ve?"ok":n>=t?"tight":"no-go"}function We(n,t){const l=n.id==="ollama"?t.ollamaTag:t.mlxModel;return l?n.pullCommandTemplate.replace("${model}",l):null}function Ye(n){return!n||!Number.isFinite(n)?"—":`${(n/1024**3).toFixed(0)} GB`}function qe(n){if(!n||!Number.isFinite(n))return"";const t=n/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(n/1024**2).toFixed(0)} MB`}function Ze(n,t){return t.filter(l=>n.id==="ollama"?!!l.ollamaTag:!!l.mlxModel)}function oe(n,t){const l=t.id==="ollama"?n.ollamaTag:n.mlxModel;if(!l)return null;const s=l.split(":")[0].toLowerCase();for(const d of t.models)if(d.id.toLowerCase().startsWith(s))return d.id;return null}function Me(){const[n,t]=r.useState([]),[l,s]=r.useState([]),[d,a]=r.useState(null),[o,k]=r.useState(!0),[u,i]=r.useState(null),b=r.useCallback(async()=>{k(!0),i(null);try{const p=await K.probeLocalModels();if(!p.ok)throw new Error(p.error||"Failed to load local backends");return t(p.backends||[]),s(p.catalog||[]),a(p.currentOs??null),{addedProviderIds:p.addedProviderIds??[]}}catch(p){return i(p?.message||String(p)),{addedProviderIds:[]}}finally{k(!1)}},[]);return r.useEffect(()=>{b()},[b]),{backends:n,catalog:l,currentOs:d,loading:o,error:u,refresh:b}}function Qe({backend:n,copy:t,onClick:l}){const s=!n.supportedOnThisOs,d=n.id==="ollama"?t.tileBlurbOllama:t.tileBlurbMlx,a=s?e.jsx(O,{variant:"muted",children:t.tileStatusUnsupported}):n.detected?e.jsx(O,{variant:"ok",children:t.tileBadgeReady(n.models.length)}):null,o=n.detected?`${n.version?`v${n.version} · `:""}${t.tileInstalledModels(n.models.length)}`:d;return e.jsxs("button",{type:"button",onClick:l,className:"group relative flex h-[104px] flex-col rounded-lg border border-edge bg-panel-alt px-4 py-3.5 text-left transition-all duration-200 hover:-translate-y-0.5 hover:border-edge-strong hover:bg-panel hover:shadow-[0_4px_16px_rgba(15,23,42,0.06)]",children:[e.jsxs("div",{className:"flex w-full items-start justify-between gap-2",children:[e.jsx(W,{brand:n.id,size:32}),a]}),e.jsxs("div",{className:"mt-auto min-w-0",children:[e.jsx("div",{className:"truncate text-[14px] font-semibold tracking-tight text-fg group-hover:text-fg",children:n.label}),e.jsx("div",{className:"mt-1 truncate text-[11.5px] leading-relaxed text-fg-5",title:o,children:o})]})]})}function je({index:n,label:t,done:l}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border text-[10px] font-semibold ${l?"border-transparent bg-[var(--th-badge-accent-bg)] text-[var(--th-badge-accent-text)]":"border-edge bg-panel-alt text-fg-4"}`,children:l?"✓":n}),e.jsx("span",{className:"text-[12px] font-semibold uppercase tracking-[0.16em] text-fg-3",children:t})]})}function Je({name:n,sizeBytes:t}){return e.jsxs("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-edge bg-panel-alt px-2 py-0.5 text-[11px] text-fg-3",children:[e.jsx("span",{className:"truncate font-mono",children:n}),t?e.jsx("span",{className:"shrink-0 text-fg-5",children:qe(t)}):null]})}function de({label:n,cmd:t,copy:l,onCopy:s}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"flex-1 truncate rounded-md border border-edge bg-panel px-2.5 py-1.5 font-mono text-[12px] text-fg-3",title:t,children:[n&&e.jsx("span",{className:"mr-2 text-fg-5",children:n}),t]}),e.jsx("button",{type:"button",onClick:()=>s(t),className:"shrink-0 rounded-md border border-edge bg-panel-alt px-2 py-1 text-[11px] text-fg-3 transition hover:border-edge-strong hover:bg-panel",children:l.copyCommand})]})}function Xe({entry:n,backend:t,totalRamGb:l,copy:s,locale:d,onCopy:a}){const o=re(l,n.minRamGb),k=d==="zh-CN"?n.descriptionZh:n.description,u=oe(n,t),i=We(t,n);return e.jsx("div",{className:"rounded-md border border-edge bg-panel-alt px-3 py-2.5",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-[13px] font-semibold text-fg",children:n.name}),e.jsx("span",{className:"text-[11px] text-fg-5",children:n.publisher}),o==="ok"&&e.jsx(O,{variant:"ok",children:s.fitOk}),o==="tight"&&e.jsx(O,{variant:"warn",children:s.fitTight}),o==="no-go"&&e.jsx(O,{variant:"err",children:s.fitNoGo}),u&&e.jsx(O,{variant:"accent",children:s.modelInstalledBadge})]}),e.jsx("div",{className:"text-[12px] leading-relaxed text-fg-4",children:k}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-fg-5",children:[e.jsxs("span",{children:[n.paramsB,"B params"]}),e.jsxs("span",{children:[n.sizeGb," GB on disk"]}),e.jsxs("span",{children:["≥ ",n.minRamGb," GB RAM"]}),n.homepage&&e.jsx("a",{href:n.homepage,target:"_blank",rel:"noreferrer",className:"text-accent underline-offset-2 hover:underline",children:d==="zh-CN"?"模型主页":"Model card"})]}),!u&&o!=="no-go"&&i&&e.jsx(de,{label:s.pullPrefix,cmd:i,copy:s,onCopy:a})]})})}function et({open:n,backend:t,catalog:l,totalRamGb:s,currentOs:d,copy:a,locale:o,onClose:k,onRefresh:u,onCopy:i}){const[b,p]=r.useState(!1);r.useEffect(()=>{p(!1)},[t?.detected,t?.id]);const g=r.useMemo(()=>t?Ze(t,l).sort((S,L)=>{const C=re(s,S.minRamGb),x=re(s,L.minRamGb),w=h=>h==="ok"?0:h==="tight"?1:2,R=oe(S,t)?0:1,y=oe(L,t)?0:1;return R!==y?R-y:w(C)-w(x)}):[],[t,l,s]);if(!t)return null;const f=!t.supportedOnThisOs,M=d?t.install[d]||[]:[],E=async()=>{p(!0);try{await u()}finally{p(!1)}};return e.jsxs(ee,{open:n,onClose:k,wide:!0,children:[e.jsx(te,{title:a.modalTitle(t.label),description:a.modalDescription(t.label),onClose:k}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsx(je,{index:1,label:a.stepStatus,done:t.detected}),e.jsxs("div",{className:"space-y-2 rounded-md border border-edge bg-panel-alt px-3.5 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-edge bg-panel",children:e.jsx(W,{brand:t.id,size:20})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-fg",children:t.label}),f?e.jsx(O,{variant:"muted",children:a.tileStatusUnsupported}):t.detected?e.jsx(O,{variant:"ok",children:a.statusRunning}):e.jsx(O,{variant:"muted",children:a.tileStatusNotDetected})]}),e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:f?e.jsx(e.Fragment,{children:a.statusUnsupportedDesc(t.label)}):t.detected?e.jsxs(e.Fragment,{children:[t.version&&e.jsxs(e.Fragment,{children:["v",t.version," · "]}),e.jsx("span",{className:"font-mono",children:t.baseURL})]}):e.jsx(e.Fragment,{children:a.statusNotRunning})})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("a",{href:t.homepage,target:"_blank",rel:"noreferrer",className:"text-[12px] text-accent underline-offset-2 hover:underline",children:a.statusHomepageCta}),!f&&e.jsx(_,{variant:"outline",size:"sm",disabled:b,onClick:()=>{E()},children:b?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-3 w-3"})," ",a.statusRechecking]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"↻"})," ",a.statusRecheck]})})]})]}),!f&&t.detected&&t.existingProviderId&&e.jsx("div",{className:"rounded-md border border-emerald-700/20 bg-emerald-700/5 px-2.5 py-1.5 text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-300",children:a.statusAutoAttachedHint(t.label)}),!f&&!t.detected&&e.jsxs("div",{className:"space-y-2 pt-1",children:[M.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-fg-5",children:a.statusInstallHeader}),M.map((S,L)=>e.jsx(de,{label:S.label,cmd:S.cmd,copy:a,onCopy:i},L)),t.install.docs&&e.jsxs("a",{href:t.install.docs,target:"_blank",rel:"noreferrer",className:"text-[11px] text-accent underline-offset-2 hover:underline",children:[a.statusInstallDocs," →"]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-fg-5",children:a.statusRunHint}),e.jsx(de,{label:t.runHint.label,cmd:t.runHint.cmd,copy:a,onCopy:i})]})]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(je,{index:2,label:a.stepModels,done:t.detected&&t.models.length>0}),t.detected?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-md border border-edge bg-panel-alt px-3.5 py-3",children:[e.jsx("div",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-fg-5",children:a.modelsInstalledHeader(t.models.length)}),t.models.length===0?e.jsx("div",{className:"text-[12px] text-fg-5",children:a.modelsInstalledEmpty}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(S=>e.jsx(Je,{name:S.id,sizeBytes:S.sizeBytes},S.id))})]}),g.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-fg-5",children:a.modelsRecommendedHeader}),e.jsx("div",{className:"space-y-1.5",children:g.map(S=>e.jsx(Xe,{entry:S,backend:t,totalRamGb:s,copy:a,locale:o,onCopy:i},S.id))})]})]}):e.jsx("div",{className:"rounded-md border border-edge bg-panel-alt px-3.5 py-3 text-[12px] text-fg-5",children:a.modelsBackendOffline})]})]}),e.jsx("div",{className:"mt-6 border-t border-edge pt-4",children:e.jsx(ce,{primary:{label:a.closeBtn,onClick:k}})})]})}function tt({snapshot:n,onConnected:t}){const l=$(h=>h.locale),s=$(h=>h.host),d=$(h=>h.toast),a=r.useMemo(()=>Ge(l),[l]),o=Me(),k=n??o,{backends:u,catalog:i,currentOs:b,loading:p,error:g,refresh:f}=k,[M,E]=r.useState(null),S=r.useMemo(()=>u.find(h=>h.id===M)??null,[u,M]),L=r.useRef("");r.useEffect(()=>{const h=u.map(B=>B.existingProviderId||"").join(",");h!==L.current&&(L.current=h,t&&u.some(B=>B.existingProviderId)&&t())},[u,t]);const C=r.useCallback(async()=>{const h=await f();return t&&h.addedProviderIds.length>0&&await t(),h},[f,t]),x=r.useCallback(h=>{navigator.clipboard?.writeText(h),d(a.copied)},[a.copied,d]),w=s?.totalMem?s.totalMem/1024**3:null,R=s?`${s.cpuModel||s.arch} · ${Ye(s.totalMem)} RAM`:a.hostUnknown,y=u.length>0?u:[{id:"ollama",label:"Ollama",detected:!1,baseURL:"http://127.0.0.1:11434",openAIBaseURL:"http://127.0.0.1:11434/v1",models:[],existingProviderId:null,homepage:"https://ollama.com/",install:{},runHint:{cmd:"ollama serve"},pullCommandTemplate:"ollama pull ${model}",supportedOnThisOs:!0},{id:"mlx",label:"mlx-lm",detected:!1,baseURL:"http://127.0.0.1:8080",openAIBaseURL:"http://127.0.0.1:8080/v1",models:[],existingProviderId:null,homepage:"https://github.com/ml-explore/mlx-lm",install:{},runHint:{cmd:"mlx_lm.server --port 8080"},pullCommandTemplate:"mlx_lm.server --model ${model} --port 8080",supportedOnThisOs:!0}];return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"text-[12px] text-fg-5",children:[e.jsx("span",{className:"font-semibold uppercase tracking-[0.14em] text-fg-5",children:a.hostLabel}),e.jsx("span",{className:"mx-2 text-fg-6",children:"·"}),e.jsx("span",{className:"text-fg-3",children:R})]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>{C()},disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-3 w-3"})," ",a.refreshing]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"↻"})," ",a.refresh]})})]}),e.jsxs("div",{className:"space-y-1.5 pt-1",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-fg-5",children:a.sectionLabel}),e.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:y.map(h=>e.jsx(Qe,{backend:h,copy:a,locale:l,onClick:()=>E(h.id)},h.id))})]}),g&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:g}),e.jsx(et,{open:M!==null,backend:S,catalog:i,totalRamGb:w,currentOs:b,copy:a,locale:l,onClose:()=>E(null),onRefresh:C,onCopy:x})]})}function nt(n){return!n||!Number.isFinite(n)?null:n>=1e6?`${Math.round(n/1e5)/10}M ctx`:n>=1e3?`${Math.round(n/1e3)}K ctx`:`${n} ctx`}function ye(n){const t=(()=>{try{return new URL(n.baseURL)}catch{return null}})(),l=t?.host.toLowerCase()??"",s=t?.port??"";return(l.startsWith("127.0.0.1")||l.startsWith("localhost"))&&s==="11434"?"ollama":(l.startsWith("127.0.0.1")||l.startsWith("localhost"))&&s==="8080"?"mlx":l.includes("openrouter")?"openrouter":l.includes("anthropic")?"anthropic":l.includes("deepseek")?"deepseek":l.includes("googleapis")||l.includes("vertex")?"google":l.includes("openai.com")?"openai":l.includes("dashscope")||l.includes("qwen")||l.includes("aliyun")?"qwen":l.includes("volces")||l.includes("volcengine")||l.includes("doubao")?"doubao":l.includes("bigmodel")||l.includes("zhipu")||l.includes("z.ai")?"glm":l.includes("minimax")?"minimax":n.kind==="anthropic"?"anthropic":n.kind==="google"?"google":n.kind==="openai"?"openai":"custom"}function lt(n){return n==="zh-CN"?{sectionTitle:"我的模型",sectionHint:"把你常用的模型登记成一条条快捷方式,自由起别名。这是一份纯粹的选择列表——智能体会从这里挑模型,但谁选了什么不会反向显示在这里。",addLabel:"添加模型",empty:"还没有登记任何模型",emptyHint:'先在下方"模型供应商"里接入一个供应商,再点上方"添加模型"把常用的几个固定下来。',addModalTitle:"添加模型",editModalTitle:"编辑模型",fieldName:"显示名",fieldNameHint:"智能体卡片和 IM 选择菜单里会看到的名称;留空则直接用模型 ID。",fieldProvider:"供应商",fieldProviderEmpty:'没有可用的供应商;请先在下方"模型供应商"里接入一个。',fieldProviderLockedHint:'想换别的供应商?关闭这个窗口,先到下方"模型供应商"里接入。',fieldModelId:"模型",fieldModelIdHint:"从供应商 /v1/models 拉到的真实模型列表中挑选。",fieldModelIdLoading:"正在拉取该供应商的模型列表…",fieldModelIdEmpty:"该供应商没有返回模型列表(或还未校验),可手动输入模型 ID。",fieldModelIdToggleManual:"改为手动输入",fieldModelIdToggleList:"从列表选择",fieldModelIdSearchPlaceholder:"搜索模型",fieldModelIdSearchEmpty:"没有匹配的模型",fieldModelIdCurrentLabel:"当前",fieldEffort:"推理强度",effortDefault:"(沿用默认)",cancel:"取消",save:"保存",saving:"保存中",remove:"删除",removeConfirm:"删除这个模型条目?已经选择它的智能体会自动回退到官方认证。",via:"经由"}:{sectionTitle:"My Models",sectionHint:"Register the models you actually use as named shortcuts. A pure selection list — agents pick from here, but who picks what does not bubble back into this view.",addLabel:"Add model",empty:"No models registered yet",emptyHint:"Connect a provider below first, then come back here to pin the few you actually use.",addModalTitle:"Add Model",editModalTitle:"Edit Model",fieldName:"Display name",fieldNameHint:"Shown in agent cards and the IM model picker. Leave empty to use the model id as-is.",fieldProvider:"Provider",fieldProviderEmpty:'No providers configured yet; add one in "Model Providers" below first.',fieldProviderLockedHint:'Want a different provider? Close this dialog and connect one in "Model Providers" below.',fieldModelId:"Model",fieldModelIdHint:"Picked from the provider's live /v1/models list.",fieldModelIdLoading:"Loading the provider's model list…",fieldModelIdEmpty:"This provider returned no model list (or has not been validated yet). Enter a model ID manually.",fieldModelIdToggleManual:"Enter manually",fieldModelIdToggleList:"Pick from list",fieldModelIdSearchPlaceholder:"Search models",fieldModelIdSearchEmpty:"No matching models",fieldModelIdCurrentLabel:"Current",fieldEffort:"Reasoning effort",effortDefault:"(default)",cancel:"Cancel",save:"Save",saving:"Saving",remove:"Remove",removeConfirm:"Remove this model entry? Agents that picked it will fall back to native auth.",via:"via"}}async function Ee(n,t,l){return(await fetch(t,{method:n,headers:{"Content-Type":"application/json"},body:l?JSON.stringify(l):void 0})).json()}const at=["","low","medium","high","xhigh","max"];function st({open:n,copy:t,providers:l,initial:s,existing:d,onClose:a,onSaved:o,onRemove:k}){const[u,i]=r.useState(s),[b,p]=r.useState(!1),[g,f]=r.useState(null),[M,E]=r.useState(()=>new Map),[S,L]=r.useState(!1),[C,x]=r.useState(null),[w,R]=r.useState(!1);r.useEffect(()=>{n&&(i(s),f(null),R(!1),E(new Map))},[n,s]),r.useEffect(()=>{if(!n)return;const m=u.providerId;if(!m||M.has(m))return;let v=!1;return L(!0),x(null),(async()=>{try{const j=await(await fetch(`/api/models/providers/${m}/models`)).json();if(v)return;const A=j.modelInfos&&j.modelInfos.length>0?j.modelInfos:(j.models||[]).map(P=>({id:P}));E(P=>{const D=new Map(P);return D.set(m,A),D}),!j.ok&&j.error&&x(j.error)}catch(c){v||x(c?.message||String(c))}finally{v||L(!1)}})(),()=>{v=!0}},[n,u.providerId,M]);const y=!!d,h=M.get(u.providerId)??null,B=r.useCallback(async()=>{f(null),p(!0);try{const m={name:u.name.trim()||void 0,providerId:u.providerId,modelId:u.modelId.trim(),effort:u.effort||null},v=y&&d?`/api/models/profiles/${d.id}`:"/api/models/profiles",j=await Ee(y?"PATCH":"POST",v,m);if(!j.ok){f(j.error||"Failed to save");return}o(),a()}catch(m){f(m?.message||String(m))}finally{p(!1)}},[u,y,d,o,a]),z=!b&&!!u.providerId&&u.modelId.trim().length>0;return e.jsxs(ee,{open:n,onClose:a,children:[e.jsx(te,{title:y?t.editModalTitle:t.addModalTitle,description:t.sectionHint,onClose:a}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(T,{children:t.fieldProvider}),l.length===0?e.jsx("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700",children:t.fieldProviderEmpty}):(()=>{const m=y||l.length<=1,v=l.find(c=>c.id===u.providerId)??l[0];return m?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-10 w-full items-center gap-2.5 rounded-md border border-edge bg-panel-alt px-3",children:[e.jsx(W,{brand:ye(v),size:20}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-medium text-fg-2",children:v.name}),e.jsx("div",{className:"truncate font-mono text-[10.5px] leading-tight text-fg-5",children:v.baseURL})]})]}),!y&&e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:t.fieldProviderLockedHint})]}):e.jsx(q,{value:u.providerId,options:l.map(c=>({value:c.id,label:`${c.name} · ${c.baseURL}`})),onChange:c=>i(j=>({...j,providerId:c}))})})()]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-baseline justify-between gap-2",children:[e.jsx(T,{className:"mb-0",children:t.fieldModelId}),h&&h.length>0&&e.jsx("button",{type:"button",onClick:()=>R(m=>!m),className:"text-[11px] text-fg-5 transition hover:text-fg-3",children:w?t.fieldModelIdToggleList:t.fieldModelIdToggleManual})]}),S&&e.jsxs("div",{className:"flex h-9 items-center gap-2 rounded-md border border-edge bg-panel-alt px-3 text-[12px] text-fg-5",children:[e.jsx(G,{}),t.fieldModelIdLoading]}),!S&&!w&&h&&h.length>0&&(()=>{const v=[...!h.some(c=>c.id===u.modelId)&&u.modelId?[{value:u.modelId,label:u.modelId,description:t.fieldModelIdCurrentLabel}]:[],...h.map(c=>({value:c.id,label:c.id,description:c.name&&c.name.toLowerCase()!==c.id.toLowerCase()?c.name:void 0,meta:c.contextLength?nt(c.contextLength):void 0}))];return e.jsx(ke,{value:u.modelId,options:v,onChange:c=>i(j=>({...j,modelId:c})),searchPlaceholder:t.fieldModelIdSearchPlaceholder,noMatchesText:t.fieldModelIdSearchEmpty,currentLabel:t.fieldModelIdCurrentLabel})})(),!S&&(w||!h||h.length===0)&&e.jsxs(e.Fragment,{children:[e.jsx(V,{value:u.modelId,onChange:m=>i(v=>({...v,modelId:m.target.value})),placeholder:"anthropic/claude-sonnet-4"}),(!h||h.length===0)&&!C&&e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:t.fieldModelIdEmpty})]}),C&&e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-amber-700",children:C}),!w&&h&&h.length>0&&e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:t.fieldModelIdHint})]}),e.jsxs("div",{children:[e.jsx(T,{children:t.fieldName}),e.jsx(V,{value:u.name,onChange:m=>i(v=>({...v,name:m.target.value})),placeholder:u.modelId||"anthropic/claude-sonnet-4"}),e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:t.fieldNameHint})]}),e.jsxs("div",{children:[e.jsx(T,{children:t.fieldEffort}),e.jsx(q,{value:u.effort,options:at.map(m=>({value:m,label:m||t.effortDefault})),onChange:m=>i(v=>({...v,effort:m}))})]}),g&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:g})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-2 border-t border-edge pt-4",children:[e.jsx("div",{children:y&&k&&e.jsx("button",{type:"button",onClick:()=>{k()},className:"text-[12px] text-fg-5 transition hover:text-[var(--th-err)]",children:t.remove})}),e.jsx(ce,{primary:{label:b?t.saving:t.save,onClick:B,disabled:!z},secondary:{label:t.cancel,onClick:a}})]})]})}function it({profile:n,provider:t,copy:l,onPick:s}){const d=t?ye(t):"custom";return e.jsxs("button",{type:"button",onClick:s,className:"group relative flex h-[120px] flex-col rounded-lg border border-edge bg-panel-alt px-4 py-3.5 text-left transition-all duration-200 hover:-translate-y-0.5 hover:border-edge-strong hover:bg-panel hover:shadow-[0_4px_16px_rgba(15,23,42,0.06)]",children:[e.jsxs("div",{className:"flex w-full items-start justify-between gap-2",children:[e.jsx(W,{brand:d,size:28}),n.effort&&e.jsx(O,{variant:"muted",children:n.effort})]}),e.jsxs("div",{className:"mt-auto min-w-0",children:[e.jsx("div",{className:"truncate text-[14px] font-semibold tracking-tight text-fg",children:n.name}),e.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] leading-relaxed text-fg-4",children:n.modelId}),e.jsxs("div",{className:"mt-1 truncate text-[11.5px] text-fg-5",children:[l.via," ",t?.name??"?"]})]})]})}function rt({onClick:n,label:t}){return e.jsxs("button",{type:"button",onClick:n,className:"flex h-[120px] flex-col items-center justify-center rounded-lg border border-dashed border-edge bg-panel-alt text-fg-4 transition hover:border-edge-strong hover:bg-panel hover:text-fg-2",children:[e.jsx("div",{className:"text-2xl leading-none",children:"+"}),e.jsx("div",{className:"mt-1 text-[12.5px] font-medium tracking-tight",children:t})]})}function ot({snapshot:n}){const{providers:t,profiles:l,reload:s}=n,d=$(f=>f.locale),a=r.useMemo(()=>lt(d),[d]),[o,k]=r.useState(null),u=r.useMemo(()=>new Map(t.map(f=>[f.id,f])),[t]),i=r.useCallback(async f=>{confirm(a.removeConfirm)&&(await Ee("DELETE",`/api/models/profiles/${f.id}`),await s())},[a,s]),b=r.useMemo(()=>({name:"",providerId:t[0]?.id??"",modelId:"",effort:""}),[t]),p=r.useMemo(()=>{if(!o||o.kind!=="edit")return null;const f=o.profile;return{name:f.name,providerId:f.providerId,modelId:f.modelId,effort:f.effort||""}},[o]),g=l.length===0;return e.jsxs("div",{className:"space-y-2",children:[g&&e.jsxs("div",{className:"rounded-lg border border-dashed border-edge bg-panel-alt px-4 py-6 text-center",children:[e.jsx("div",{className:"text-[13.5px] font-semibold text-fg-2",children:a.empty}),e.jsx("div",{className:"mx-auto mt-1 max-w-md text-[12px] leading-relaxed text-fg-5",children:a.emptyHint}),t.length>0&&e.jsx("div",{className:"mt-3",children:e.jsx(_,{variant:"primary",size:"sm",onClick:()=>k({kind:"add"}),children:a.addLabel})})]}),!g&&e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:[l.map(f=>e.jsx(it,{profile:f,provider:u.get(f.providerId)??null,copy:a,onPick:()=>k({kind:"edit",profile:f})},f.id)),t.length>0&&e.jsx(rt,{label:a.addLabel,onClick:()=>k({kind:"add"})})]}),o&&e.jsx(st,{open:!0,copy:a,providers:t,initial:o.kind==="edit"?p:b,existing:o.kind==="edit"?o.profile:null,onClose:()=>k(null),onSaved:s,onRemove:o.kind==="edit"?async()=>{await i(o.profile),k(null)}:void 0})]})}const dt=["claude","codex","gemini","hermes"];function ct(n){return n==="hermes"}function ut(n){const t=(n||"").toLowerCase().trim();return t==="openrouter"?"openrouter":t==="anthropic"?"anthropic":t==="openai"?"openai":t==="google"||t==="gemini"?"google":t==="deepseek"?"deepseek":t==="qwen"||t==="dashscope"?"qwen":t==="doubao"||t==="volces"||t==="volcengine"?"doubao":t==="glm"||t==="zhipu"||t==="bigmodel"?"glm":t==="minimax"?"minimax":"custom"}function mt(n){const t=(()=>{try{return new URL(n.baseURL).host.toLowerCase()}catch{return""}})();return t.includes("openrouter")?"openrouter":t.includes("anthropic")?"anthropic":t.includes("deepseek")?"deepseek":t.includes("googleapis")||t.includes("vertex")?"google":t.includes("openai.com")?"openai":t.includes("dashscope")||t.includes("qwen")||t.includes("aliyun")?"qwen":t.includes("volces")||t.includes("volcengine")||t.includes("doubao")?"doubao":t.includes("bigmodel")||t.includes("zhipu")||t.includes("z.ai")?"glm":t.includes("minimax")?"minimax":n.kind==="anthropic"?"anthropic":n.kind==="google"?"google":n.kind==="openai"?"openai":"custom"}function we(n,t){const l=n.bindings[t];if(!l)return null;const s=n.profiles.find(a=>a.id===l);if(!s)return null;const d=n.providers.find(a=>a.id===s.providerId);return d?{profileId:s.id,providerId:d.id,providerName:d.name,providerBrand:mt(d),modelId:s.modelId,effort:s.effort||null}:null}function ft(n){return n==="zh-CN"?{defaultsTitle:"新会话默认值",defaultsHint:"决定新建对话默认走哪个智能体。具体模型与推理强度由该智能体卡片下的「供应商 / 模型 / 推理强度」决定。",defaultsEditTitle:"修改默认智能体",defaultsEditHint:"选择新建对话默认走哪个智能体。",defaultsSaved:"默认智能体已更新",editDefaults:"修改默认",agentsTitle:"可用智能体",defaultAgent:"默认智能体",installLabel:"安装状态",versionLabel:"版本",defaultBadge:"默认",installed:"已安装",notInstalled:"未安装",notInstalledHint:"安装该智能体的本地 CLI 后即可在此配置供应商与模型。",noModel:"未设置",noVersion:"版本未知",loadFailed:"无法加载智能体状态",updateAvailable:"有新版本",updateSkipped:"自动更新已跳过",updateFailed:"自动更新失败",update:"升级",updating:"升级中…",checkUpdate:"检查更新",checking:"检查中…",upToDate:"已是最新",install:"安装",installing:"安装中…",profilesHint:"把你常用的模型登记成一条条快捷方式,自由起别名。这是一份纯粹的选择列表——智能体(包括 Hermes)会从这里挑模型,但选了谁不会反向显示在这里。",profilesTitle:"我的模型",modelsTitle:"模型供应商",modelsHint:'接入 BYOK 供应商;接入后可在上方"我的模型"里挑选具体模型并固定下来。',localTitle:"本地模型",localHint:"在本机检测 Ollama / mlx-lm 并按内存推荐合适的开源模型;接入后会作为一个供应商出现在智能体卡片中。",rowProvider:"供应商",rowModel:"模型",rowEffort:"推理强度",rowWorkflow:"多智能体编排",workflowOn:"开启",workflowOff:"关闭(默认)",workflowHint:"开启后,遇到大型多步任务(广度调研、大规模重构 / 审计、跨多文件评审)智能体可自行编排多个子智能体并行处理。关闭时彻底禁用 Workflow 工具,普通对话不受影响。",providerNative:"官方(CLI 内置认证)",providerNativeFromAgent:"智能体自身配置",effortDefault:"默认",modelLoading:"正在拉取模型列表…",modelEmpty:"该供应商未返回模型列表,请使用自定义输入。",modelCustomToggle:"改为自定义输入",modelListToggle:"从列表选择",modelCustomPlaceholder:"anthropic/claude-sonnet-4",modelSearchPlaceholder:"搜索模型",modelSearchEmpty:"没有匹配的模型",modelCurrentLabel:"当前",modelGroupNative:"官方",modelGroupProfiles:"我的模型",modelPickerEmpty:"没有可选模型",modelPickerEmptyHint:'该智能体的官方模型列表为空,且你还没有登记任何"我的模型"。',saveChanges:"保存",saving:"保存中…",saved:"已保存",configError:"保存失败",externalNativeNote:t=>`Hermes 当前从 ${t||"~/.hermes/config.yaml"} 读取这些值;切换为某个 BYOK 供应商可由 pikiclaw 接管。`,configure:"配置",configModalTitle:t=>`配置 ${t}`,rowSummaryNative:"官方认证",rowSummaryNoModel:"未选模型",rowSummaryNoEffort:"默认强度",rowWorkflowChipOn:"编排开",rowWorkflowChipOff:"编排关"}:{defaultsTitle:"New Session Defaults",defaultsHint:"Pick which agent new sessions use by default. Provider / Model / Effort live on each agent card below.",defaultsEditTitle:"Change Default Agent",defaultsEditHint:"Which agent should new sessions use by default?",defaultsSaved:"Default agent updated",editDefaults:"Change default",agentsTitle:"Available Agents",defaultAgent:"Default Agent",installLabel:"Install",versionLabel:"Version",defaultBadge:"Default",installed:"Installed",notInstalled:"Not installed",notInstalledHint:"Install the local CLI for this agent to configure its provider and model.",noModel:"Not set",noVersion:"Version unavailable",loadFailed:"Failed to load agent status",updateAvailable:"Update available",updateSkipped:"Auto-update skipped",updateFailed:"Auto-update failed",update:"Update",updating:"Updating…",checkUpdate:"Check update",checking:"Checking…",upToDate:"Up to date",install:"Install",installing:"Installing…",profilesTitle:"My Models",profilesHint:"Register the models you actually use as named shortcuts. A pure selection list — agents (including Hermes) pick from here, but who picks what does not bubble back into this view.",modelsTitle:"Model Providers",modelsHint:'Connect BYOK providers; pin specific models above in "My Models".',localTitle:"Local Models",localHint:"Detect Ollama / mlx-lm on this machine and surface coding models that fit your RAM. Connected backends show up as a provider on the agent cards.",rowProvider:"Provider",rowModel:"Model",rowEffort:"Effort",rowWorkflow:"Multi-agent Workflow",workflowOn:"On",workflowOff:"Off (default)",workflowHint:"When on, the agent may orchestrate multiple sub-agents in parallel for large multi-step work (broad research, big refactors/audits, cross-file reviews). Off fully disables the Workflow tool; ordinary chat is unaffected.",providerNative:"Native (CLI auth)",providerNativeFromAgent:"agent's own config",effortDefault:"default",modelLoading:"Loading model list…",modelEmpty:"Provider returned no model list — use custom input.",modelCustomToggle:"Use custom input",modelListToggle:"Pick from list",modelCustomPlaceholder:"anthropic/claude-sonnet-4",modelSearchPlaceholder:"Search models",modelSearchEmpty:"No matching models",modelCurrentLabel:"Current",modelGroupNative:"Native",modelGroupProfiles:"My Models",modelPickerEmpty:"No models available",modelPickerEmptyHint:'This agent has no native model list, and no "My Models" entries are registered.',saveChanges:"Save",saving:"Saving…",saved:"Saved",configError:"Save failed",externalNativeNote:t=>`Hermes reads these values from ${t||"~/.hermes/config.yaml"}; pick a BYOK provider to let pikiclaw take over.`,configure:"Configure",configModalTitle:t=>`Configure ${t}`,rowSummaryNative:"Native auth",rowSummaryNoModel:"No model",rowSummaryNoEffort:"Default effort",rowWorkflowChipOn:"Workflow on",rowWorkflowChipOff:"Workflow off"}}function pt(n,t){const l=n.filter(d=>d.installed);return(l.length?l:n).map(d=>({value:d.agent,label:`${Q(d.agent).label} · ${d.installed?d.version||t.installed:t.notInstalled}`}))}function Ne(n,t){n({defaultAgent:t.defaultAgent,agents:t.agents})}function ht(n,t,l){if(l)return{kind:"profile",modelId:l.modelId,profileId:l.profileId,effort:l.effort||"",workflow:!!t?.workflowEnabled};const s=t?.nativeConfig||null;return{kind:"native",modelId:s?.model||t?.selectedModel||"",profileId:null,effort:s?.effort||t?.selectedEffort||"",workflow:!!t?.workflowEnabled}}function xt(n,t){return n.kind===t.kind&&(n.profileId||"")===(t.profileId||"")&&n.modelId.trim()===t.modelId.trim()&&(n.effort||"")===(t.effort||"")&&n.workflow===t.workflow}function gt(n){return n.kind==="profile"&&n.profileId?`p:${n.profileId}`:`n:${n.modelId}`}function vt(n){return n.startsWith("n:")?{kind:"native",modelId:n.slice(2)}:n.startsWith("p:")?{kind:"profile",profileId:n.slice(2)}:null}function bt({agentId:n,agentStatus:t,boundInfo:l,copy:s,layer:d,toast:a,onSaved:o,onCancel:k,t:u}){const i=ct(n),b=t.nativeConfig||null,p=r.useMemo(()=>ht(n,t,l),[n,t,l]),[g,f]=r.useState(p),[M,E]=r.useState(!1),[S,L]=r.useState(null);r.useEffect(()=>{f(p),L(null)},[p]);const x=g.kind==="native"&&i,w=r.useMemo(()=>{const v=he[n]||he.claude;return[{value:"",label:s.effortDefault},...v.map(c=>({value:c,label:c}))]},[n,s.effortDefault]),R=r.useMemo(()=>{const v=[];if(!i)for(const j of t.models){const A=j.alias?.toLowerCase().replace(/[\s_-]/g,""),P=j.id.toLowerCase().replace(/[\s_-]/g,""),D=j.alias&&A!==P;v.push({value:`n:${j.id}`,label:j.id,description:D?j.alias:void 0,group:s.modelGroupNative})}const c=new Set(Be[n]||[]);for(const j of d.profiles){const A=d.providers.find(Z=>Z.id===j.providerId);if(!A||!c.has(A.kind))continue;const P=A.name,U=j.name.trim().toLowerCase()!==j.modelId.trim().toLowerCase()?`${P} · ${j.modelId}`:P;v.push({value:`p:${j.id}`,label:j.name,description:U,group:s.modelGroupProfiles})}return v},[n,t.models,d.profiles,d.providers,s.modelGroupNative,s.modelGroupProfiles,i]),y=gt(g),h=r.useCallback(v=>{const c=vt(v);if(c)if(c.kind==="native")f(j=>({...j,kind:"native",modelId:c.modelId,profileId:null,effort:j.kind==="profile"?t.nativeSelectedEffort||t.nativeConfig?.effort||"":j.effort}));else{const j=d.profiles.find(A=>A.id===c.profileId);f(A=>({...A,kind:"profile",profileId:c.profileId,modelId:j?.modelId||A.modelId,effort:j?.effort||A.effort}))}},[d.profiles,t.nativeSelectedEffort,t.nativeConfig]),B=!xt(g,p),z=!M&&B&&(x||!!g.modelId.trim()||g.kind==="profile"),m=r.useCallback(async()=>{L(null),E(!0);try{const v=g.effort||null;if(g.kind==="native"){if(d.bindings[n]&&await d.setActiveProfile(n,null),!i){const c={agent:n},j=g.modelId.trim();if(j&&j!==(t.nativeSelectedModel||"")&&(c.model=j),v!==(t.nativeSelectedEffort||null)&&(c.effort=v),Object.keys(c).length>1){const A=await K.updateRuntimeAgent(c);if(!A.ok)throw new Error(A.error||"Failed to update agent")}}}else{if(!g.profileId)throw new Error("No profile selected");if(await d.setActiveProfile(n,g.profileId),v!==(t.selectedEffort||null)){const c=await K.updateRuntimeAgent({agent:n,effort:v});if(!c.ok)throw new Error(c.error||"Failed to update agent")}}if(t.capabilities?.workflow&&g.workflow!==!!t.workflowEnabled){const c=await K.updateRuntimeAgent({agent:n,workflow:g.workflow});if(!c.ok)throw new Error(c.error||"Failed to update agent")}await Promise.resolve(o()),a(s.saved)}catch(v){const c=v?.message||String(v);L(c),a(`${s.configError}: ${c}`,!1)}finally{E(!1)}},[n,t,s,g,i,d,o,a]);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[e.jsxs("div",{children:[e.jsx(T,{className:"!mb-1 text-[11px]",children:s.rowModel}),x?e.jsx("div",{className:"flex h-9 items-center rounded-md border border-control-border bg-control px-3 text-[13px] text-fg-3",children:e.jsx("span",{className:"truncate font-mono",children:b?.model||s.noModel})}):R.length===0?e.jsxs("div",{className:"rounded-md border border-edge bg-panel-alt px-3 py-3",children:[e.jsx("div",{className:"text-[12px] font-medium text-fg-3",children:s.modelPickerEmpty}),e.jsx("div",{className:"mt-0.5 text-[11px] leading-relaxed text-fg-5",children:s.modelPickerEmptyHint})]}):e.jsx(ke,{value:y,options:R,onChange:h,placeholder:"—",searchPlaceholder:s.modelSearchPlaceholder,noMatchesText:s.modelSearchEmpty,currentLabel:s.modelCurrentLabel})]}),e.jsxs("div",{children:[e.jsx(T,{className:"!mb-1 text-[11px]",children:s.rowEffort}),x?e.jsx("div",{className:"flex h-9 items-center rounded-md border border-control-border bg-control px-3 text-[13px] text-fg-3",children:e.jsx("span",{className:"font-mono",children:b?.effort||s.effortDefault})}):e.jsx(q,{value:g.effort,options:w,onChange:v=>f(c=>({...c,effort:v}))})]})]}),t.capabilities?.workflow&&e.jsxs("div",{children:[e.jsx(T,{className:"!mb-1 text-[11px]",children:s.rowWorkflow}),e.jsx(q,{value:g.workflow?"on":"off",options:[{value:"off",label:s.workflowOff},{value:"on",label:s.workflowOn}],onChange:v=>f(c=>({...c,workflow:v==="on"}))}),e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:s.workflowHint})]}),x&&e.jsx("div",{className:"text-[11px] leading-relaxed text-fg-5",children:s.externalNativeNote(b?.configPath||"")}),S&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:S}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(_,{variant:"ghost",size:"sm",onClick:k,disabled:M,children:u("modal.cancel")}),e.jsxs(_,{variant:"primary",size:"sm",disabled:!z,onClick:()=>{m()},children:[M&&e.jsx(G,{className:"h-3 w-3"}),M?s.saving:s.saveChanges]})]})]})}function jt(n,t,l){if(t)return{providerBrand:t.providerBrand,providerLabel:t.providerName,modelText:t.modelId||l.rowSummaryNoModel,effortText:t.effort||l.rowSummaryNoEffort};const s=n.nativeConfig||null,d=s?.provider||null;return{providerBrand:ut(d),providerLabel:l.rowSummaryNative,modelText:n.nativeSelectedModel||s?.model||n.selectedModel||l.rowSummaryNoModel,effortText:n.nativeSelectedEffort||s?.effort||n.selectedEffort||l.rowSummaryNoEffort}}function wt({agent:n,copy:t,t:l,installing:s,onInstall:d,updatingAgent:a,checkingAgent:o,onUpdate:k,onCheckUpdate:u,onEdit:i,loading:b=!1,boundInfo:p}){const g=Q(n.agent),f=g.advantageKey?l(g.advantageKey):"",M=n.installed?jt(n,p,t):null;return e.jsxs("div",{className:"glass rounded-md border border-edge px-3.5 py-2.5 shadow-[0_1px_0_rgba(255,255,255,0.02),0_4px_12px_rgba(15,23,42,0.05)]",title:f||void 0,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-edge bg-panel-alt",children:e.jsx(W,{brand:n.agent,size:20})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-[14px] font-semibold tracking-tight text-fg",children:g.label}),n.isDefault&&e.jsx(O,{variant:"accent",children:t.defaultBadge}),b?e.jsxs(O,{variant:"muted",children:[e.jsx(G,{className:"h-3 w-3"})," ",l("status.loading")]}):n.installed?e.jsx(O,{variant:"ok",children:t.installed}):e.jsx(O,{variant:"muted",children:t.notInstalled}),n.installed&&n.updateAvailable&&e.jsx(O,{variant:"warn",children:t.updateAvailable}),n.installed&&n.version&&e.jsxs("span",{className:"text-[11px] font-mono text-fg-5",children:["v",n.version]}),n.latestVersion&&n.updateAvailable&&e.jsxs("span",{className:"text-[11px] text-amber-400",children:["→ ",n.latestVersion]})]}),M?e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-fg-4",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{brand:M.providerBrand,size:11}),e.jsx("span",{className:"text-fg-3",children:M.providerLabel})]}),e.jsx("span",{className:"text-fg-6","aria-hidden":"true",children:"·"}),e.jsx("span",{className:"font-mono text-fg-3",children:M.modelText}),e.jsx("span",{className:"text-fg-6","aria-hidden":"true",children:"·"}),e.jsx("span",{children:M.effortText}),n.capabilities?.workflow&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-fg-6","aria-hidden":"true",children:"·"}),n.workflowEnabled?e.jsx(O,{variant:"accent",children:t.rowWorkflowChipOn}):e.jsx("span",{className:"text-fg-5",children:t.rowWorkflowChipOff})]})]}):f?e.jsx("div",{className:"mt-0.5 truncate text-[11px] text-fg-5",children:f}):null]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[b&&e.jsx("div",{className:"inline-flex h-7 items-center gap-2 px-2 text-[11px] text-fg-5",children:e.jsx(G,{className:"h-3 w-3"})}),!b&&!n.installed&&e.jsx(_,{variant:"primary",size:"sm",disabled:s,onClick:()=>d(n),children:s?t.installing:t.install}),!b&&n.installed&&n.updateAvailable&&e.jsx(_,{variant:"outline",size:"sm",disabled:a,onClick:()=>k(n),children:a?t.updating:t.update}),!b&&n.installed&&!n.updateAvailable&&e.jsx(_,{variant:"ghost",size:"icon",disabled:o,onClick:()=>u(n),title:t.checkUpdate,"aria-label":t.checkUpdate,className:"h-7 w-7",children:o?e.jsx(G,{className:"h-3 w-3"}):e.jsx("span",{"aria-hidden":"true",children:"↻"})}),!b&&n.installed&&e.jsx(_,{variant:"outline",size:"sm",onClick:()=>i(n),children:t.configure})]})]}),!b&&n.installed&&n.updateAvailable&&n.updateStatus==="skipped"&&n.updateDetail&&e.jsxs("div",{className:"mt-1.5 text-[11px] leading-relaxed",style:{color:"var(--th-badge-warn-text)"},children:[t.updateSkipped,": ",n.updateDetail]}),!b&&n.installed&&n.updateStatus==="failed"&&n.updateDetail&&e.jsxs("div",{className:"mt-1.5 text-[11px] leading-relaxed",style:{color:"var(--th-badge-err-text)"},children:[t.updateFailed,": ",n.updateDetail]})]})}function St(){const n=$(N=>N.locale),t=$(N=>N.toast),l=$(N=>N.agentStatus),s=$(N=>N.setAgentStatus),d=$(N=>N.refreshAgentStatus),a=r.useMemo(()=>De(n),[n]),o=r.useMemo(()=>ft(n),[n]),k=Ce(),u=Me(),[i,b]=r.useState(l?{defaultAgent:l.defaultAgent,agents:l.agents}:null),[p,g]=r.useState(!l),[f,M]=r.useState(null),[E,S]=r.useState(!1),[L,C]=r.useState(null),[x,w]=r.useState(!1),[R,y]=r.useState("codex"),[h,B]=r.useState(null),[z,m]=r.useState(null),[v,c]=r.useState(null),j=r.useRef(!!l);r.useEffect(()=>{l&&(Ne(b,l),j.current||(j.current=!0,g(!1)))},[l]);const A=r.useCallback(N=>{Ne(b,N),s(N)},[s]),P=r.useCallback(async()=>{j.current||g(!0);try{const N=await K.getAgentStatus();return A(N),M(null),j.current=!0,N}catch(N){const I=N instanceof Error?N.message:o.loadFailed;return M(I),j.current||t(I,!1),null}finally{g(!1)}},[A,o.loadFailed,t]);r.useEffect(()=>{l?d():P()},[]);const D=r.useMemo(()=>{const N=i?.agents||[],I=new Map(N.map(H=>[H.agent,H]));return dt.map(H=>{const pe=I.get(H);if(pe)return pe;const Oe=Q(H);return{agent:H,label:Oe.label,installed:!1,version:void 0,installCommand:void 0,selectedModel:null,selectedEffort:null,isDefault:i?.defaultAgent===H,models:[],usage:null}})},[i]),U=i?.defaultAgent||"codex",Z=D.find(N=>N.agent===U)||null,ue=D.filter(N=>N.installed).length>0,Ae=pt(D,o),me=r.useCallback(async N=>{S(!0);try{const I=await K.updateRuntimeAgent(N);if(!I.ok)throw new Error(I.error||a("config.applyFailed"));return A(I),I}catch(I){const H=I instanceof Error?I.message:a("config.applyFailed");return t(H,!1),P(),null}finally{S(!1)}},[A,P,a,t]);r.useEffect(()=>{x&&y(U)},[U,x]);const Se=r.useCallback(async()=>{if(R===U){w(!1);return}await me({defaultAgent:R})&&(t(o.defaultsSaved),w(!1))},[o.defaultsSaved,U,R,t,me]),Le=r.useCallback(async N=>{if(!L){C(N.agent);try{const I=await K.installAgent(N.agent);if(!I.ok)throw new Error(I.error||a("config.agentInstallFailed"));A(I),t(a("config.agentInstalled"))}catch(I){const H=I instanceof Error?I.message:a("config.agentInstallFailed");t(H,!1),P()}finally{C(I=>I===N.agent?null:I)}}},[A,L,P,a,t]),Re=r.useCallback(async N=>{if(!h){B(N.agent);try{const I=await K.updateAgent(N.agent);if(!I.ok)throw new Error(I.error||a("config.agentInstallFailed"));A(I),t(o.upToDate)}catch(I){const H=I instanceof Error?I.message:o.updateFailed;t(H,!1),P()}finally{B(I=>I===N.agent?null:I)}}},[A,o.updateFailed,o.upToDate,P,a,t,h]),Pe=r.useCallback(async N=>{if(!z){m(N.agent);try{const I=await K.checkAgentUpdate(N.agent);if(!I.ok)throw new Error(I.error||o.loadFailed);A(I)}catch(I){const H=I instanceof Error?I.message:o.loadFailed;t(H,!1),P()}finally{m(I=>I===N.agent?null:I)}}},[A,z,o.loadFailed,P,t]),ne=p&&!i,Te=ne?a("status.loading"):Z?Q(Z.agent).label:o.notInstalled;ne?a("status.loading"):Z?.installed?o.installed:o.notInstalled;const fe=r.useCallback(async()=>{await k.reload(),await P()},[k,P]),Y=v?D.find(N=>N.agent===v)??null:null,le=Y?Q(Y.agent):null;return e.jsxs("div",{className:"animate-in space-y-4",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-fg-5",children:o.agentsTitle}),ne?e.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-fg-5",children:[e.jsx(G,{className:"h-3 w-3"}),e.jsx("span",{children:o.defaultAgent})]}):e.jsxs("button",{type:"button",onClick:()=>w(!0),disabled:E||!ue,title:o.editDefaults,className:"group inline-flex items-center gap-1.5 rounded-full border border-edge bg-panel-alt px-3 py-1 text-[12px] transition hover:border-edge-strong hover:bg-panel disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx("span",{className:"text-fg-5 group-hover:text-fg-4",children:o.defaultAgent}),e.jsx(W,{brand:U,size:14}),e.jsx("span",{className:"font-semibold text-fg-2",children:Te}),e.jsx("svg",{className:"text-fg-6 transition group-hover:text-fg-3",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 lg:grid-cols-2",children:D.map(N=>e.jsx(wt,{agent:N,copy:o,t:a,installing:L===N.agent,loading:ne,onInstall:Le,updatingAgent:h===N.agent,checkingAgent:z===N.agent,onUpdate:Re,onCheckUpdate:Pe,onEdit:I=>c(I.agent),boundInfo:we(k,N.agent)},N.agent))})]}),f&&e.jsx(Ue,{className:"border-amber-500/20 bg-amber-500/5",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"text-[13px] text-fg-2",children:f}),e.jsx(_,{variant:"outline",size:"sm",onClick:()=>{P()},children:a("sessions.retry")})]})}),e.jsxs("section",{className:"space-y-3 pt-4",children:[e.jsx("div",{className:"flex items-baseline justify-between border-t border-edge pt-4",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight text-fg",children:o.profilesTitle}),e.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:o.profilesHint})]})}),e.jsx(ot,{snapshot:k})]}),e.jsxs("section",{className:"space-y-3 pt-4",children:[e.jsx("div",{className:"flex items-baseline justify-between border-t border-edge pt-4",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight text-fg",children:o.modelsTitle}),e.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:o.modelsHint})]})}),e.jsx(Ke,{snapshot:k,localBackends:u.backends})]}),e.jsxs("section",{className:"space-y-3 pt-4",children:[e.jsx("div",{className:"flex items-baseline justify-between border-t border-edge pt-4",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight text-fg",children:o.localTitle}),e.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:o.localHint})]})}),e.jsx(tt,{snapshot:u,onConnected:fe})]}),e.jsx(ee,{open:!!Y,onClose:()=>c(null),wide:!0,children:Y&&le&&e.jsxs(e.Fragment,{children:[e.jsx(te,{title:o.configModalTitle(le.label),description:le.advantageKey?a(le.advantageKey):void 0,onClose:()=>c(null)}),e.jsx(bt,{agentId:Y.agent,agentStatus:Y,boundInfo:we(k,Y.agent),copy:o,layer:k,toast:t,t:a,onSaved:async()=>{await fe(),c(null)},onCancel:()=>c(null)})]})}),e.jsxs(ee,{open:x,onClose:()=>w(!1),children:[e.jsx(te,{title:o.defaultsEditTitle,description:o.defaultsEditHint,onClose:()=>w(!1)}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(T,{children:o.defaultAgent}),e.jsx(q,{value:R,options:Ae,onChange:N=>y(N),disabled:E||!ue,placeholder:o.notInstalled})]})}),e.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[e.jsx(_,{variant:"ghost",onClick:()=>w(!1),children:a("modal.cancel")}),e.jsx(_,{variant:"primary",disabled:E||R===U,onClick:()=>{Se()},children:a(E?"config.validating":"modal.save")})]})]})]})}export{St as AgentTab,St as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./react-vendor-DTcmqLiz.js";import{c as g}from"./index-De6pU4tv.js";const a="data:image/png;base64,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",h="/assets/codex-DYadqqp0.png",n="/assets/feishu-C4OMrjCW.ico",r="/assets/gemini-BYkEpiWr.svg",A="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient%20x1='50%25'%20y1='0%25'%20x2='50%25'%20y2='100%25'%20id='linearGradient-1'%3e%3cstop%20stop-color='%2338AEEB'%20offset='0%25'%3e%3c/stop%3e%3cstop%20stop-color='%23279AD1'%20offset='100%25'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='Artboard'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20id='Oval'%20fill='url(%23linearGradient-1)'%20cx='8'%20cy='8'%20r='8'%3e%3c/circle%3e%3cpath%20d='M3.17026167,7.83635602%20C5.78750201,6.74265999%207.53273882,6.02162863%208.40597211,5.67326193%20C10.8992306,4.67860423%2011.2454541,4.53439191%2011.5831299,4.52864956%20C11.6573986,4.52743168%2011.8385417,4.55776042%2011.9798438,4.67645833%20C12.1211458,4.79515625%2012.1635786,4.87206678%2012.1755371,4.93908691%20C12.1874957,5.00610705%2012.1862759,5.21456762%2012.1744385,5.3338623%20C12.0393279,6.69547283%2011.5259342,9.83829771%2011.2285121,11.3633248%20C11.1026617,12.008621%2010.8548582,12.2249854%2010.6149558,12.2461596%20C10.0935924,12.2921758%209.69769267,11.9156852%209.19272668,11.5981993%20C8.40255458,11.1013965%208.13911734,10.9180161%207.3721185,10.4332283%20C6.48571864,9.87297217%206.85080034,9.6784879%207.35595703,9.17524981%20C7.48815894,9.04355001%209.67825076,7.04590073%209.71077046,6.86250183%20C9.7391276,6.70257812%209.7494847,6.68189389%209.67664063,6.60973958%20C9.60379655,6.53758527%209.51674192,6.54658941%209.46083149,6.55876051%20C9.38158015,6.57601267%208.17521836,7.33962686%205.84174612,8.84960308%20C5.48344358,9.08558775%205.15890428,9.20056741%204.86812819,9.19454205%20C4.54757089,9.18789957%203.93094724,9.02070014%203.47255094,8.87778221%20C2.91030922,8.70248755%202.46345069,8.609808%202.50236203,8.31210343%20C2.52262946,8.15704047%202.74526267,7.998458%203.17026167,7.83635602%20Z'%20id='Path-3'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",w="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20d='M42%2033c-16.569%200-30%2011.64-30%2026%200%208.084%204.283%2015.306%2011.008%2020.073L18%2095l20.832-8.102A37.33%2037.33%200%200%200%2042%2087c16.569%200%2030-11.64%2030-26S58.569%2033%2042%2033Z'%20fill='%23fff'/%3e%3cpath%20d='M85%2048c-13.807%200-25%209.402-25%2021%200%2011.598%2011.193%2021%2025%2021%202.545%200%205-.319%207.29-.91L109%2095l-4.772-12.27C109.078%2079.05%20112%2074.232%20112%2069c0-11.598-12.193-21-27-21Z'%20fill='%23fff'%20opacity='.95'/%3e%3ccircle%20cx='33'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='50'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='77'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='92'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3c/svg%3e",x="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%234A154B'/%3e%3crect%20x='50'%20y='14'%20width='28'%20height='44'%20rx='14'%20fill='%232EB67D'/%3e%3crect%20x='70'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%23ECB22E'/%3e%3crect%20x='50'%20y='70'%20width='28'%20height='44'%20rx='14'%20fill='%23E01E5A'/%3e%3crect%20x='14'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%2336C5F0'/%3e%3c/svg%3e",d="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%235865F2'/%3e%3cpath%20fill='%23fff'%20d='M89.4%2036.9c-5.6-2.6-11.6-4.4-17.9-5.5l-.8%201.6c5.9%201%2011.2%202.6%2016.1%205-6-3-12.7-5-19.8-6-1.5-.2-2.9-.3-4.4-.4-.5%200-1%200-1.5%200s-1%200-1.5%200c-1.5%200-2.9.2-4.4.4-7.1%201-13.8%203-19.8%206%204.9-2.4%2010.2-4%2016.1-5l-.8-1.6C44.2%2032.5%2038.2%2034.3%2032.6%2036.9%2022%2053%2019%2068.7%2020.5%2084.3c8.1%206%2016%209.6%2023.7%2012%201.5-2.1%202.9-4.3%204.1-6.6-2.4-.9-4.6-2-6.8-3.3.6-.4%201.1-.9%201.7-1.3%2013.5%206.3%2028%206.3%2041.4%200%20.6.4%201.1.9%201.7%201.3-2.1%201.3-4.4%202.4-6.8%203.3%201.2%202.3%202.6%204.5%204.1%206.6%207.7-2.4%2015.6-6%2023.7-12%201.7-18.1-2.9-33.7-12.9-47.4ZM52.3%2074.8c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.6%209.1-8%209.1Zm23.5%200c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.5%209.1-8%209.1Z'/%3e%3c/svg%3e",f="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%231989FA'/%3e%3cpath%20fill='%23fff'%20d='M64.6%2026.5c-21%200-38%2017-38%2038%200%2021%2017%2038%2038%2038%206%200%2011.7-1.4%2016.7-3.9l21.3%204.6-7.6-19c4.6-5.7%207.4-12.9%207.4-20.7%200-21-17.1-37.9-37.8-37.9Zm-1.2%2053.8%205.5-13.6c-3.8.2-7.5.4-11.3.5L70.4%2049c-3.4%200-6.5.1-9.4.3l3.9-13.5h11.7l-3.8%2013.4c2.4-.1%204.6-.3%206.7-.5l-9.8%2017.6c4.6-.1%208.8-.3%2012.5-.6L63.4%2080.3Z'/%3e%3c/svg%3e",m="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20fill='%23fff'%20d='M32%2030h36c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H56l-14%2012%204-12h-14c-8%200-14-6-14-14V44c0-8%206-14%2014-14Z'/%3e%3cpath%20fill='%23fff'%20opacity='.55'%20d='M56%2054h32c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H80l-14%2012%204-12h-14c-8%200-14-6-14-14V68c0-8%206-14%2014-14Z'/%3e%3ccircle%20cx='44'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='60'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='72'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3ccircle%20cx='86'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3c/svg%3e",v="/assets/playwright-BldPFZgC.ico",C="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M23.15%202.587L18.21.21a1.494%201.494%200%200%200-1.705.29l-9.46%208.63-4.12-3.128a.999.999%200%200%200-1.276.057L.327%207.261A1%201%200%200%200%20.326%208.74L3.899%2012%20.326%2015.26a1%201%200%200%200%20.001%201.479L1.65%2017.94a.999.999%200%200%200%201.276.057l4.12-3.128%209.46%208.63a1.492%201.492%200%200%200%201.704.29l4.942-2.377A1.5%201.5%200%200%200%2024%2020.06V3.939a1.5%201.5%200%200%200-.85-1.352zm-5.146%2014.861L10.826%2012l7.178-5.448v10.896z'%20fill='%23007ACC'/%3e%3c/svg%3e",L="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%2319191C'/%3e%3cpath%20d='M7%205l10%207-4.5%201.5L15.5%2019l-2.2.8-3-5.5L7%2017z'%20fill='%23fff'/%3e%3c/svg%3e",p="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%230BA48A'/%3e%3cpath%20d='M8%2018l2-12h2.5l-1.2%205h4.2L10%2018H8zm3.5-3.5l3-7.5'%20fill='%23fff'%20fill-rule='evenodd'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%234A90D9'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='12'%20rx='1.5'%20fill='%236DB3F2'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='3.5'%20rx='1.5'%20fill='%233D7ABF'/%3e%3ccircle%20cx='8.5'%20cy='6.8'%20r='.8'%20fill='%23FF5F57'/%3e%3ccircle%20cx='11'%20cy='6.8'%20r='.8'%20fill='%23FEBC2E'/%3e%3ccircle%20cx='13.5'%20cy='6.8'%20r='.8'%20fill='%2328C840'/%3e%3crect%20x='7'%20y='10.5'%20width='10'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.7'/%3e%3crect%20x='7'%20y='13'%20width='7'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.5'/%3e%3c/svg%3e",y="/assets/hermes-BAarh-tH.png",u="/assets/openrouter-CsJ_bD5Q.ico",D="/assets/anthropic-BAdojD7P.ico",E="/assets/deepseek-BeYNZEk0.ico",F="/assets/qwen-xykkX0_y.png",b="/assets/doubao-DloFDuFR.png",z="data:image/png;base64,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",J="/assets/minimax-PuEGTfrF.ico",k="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-label='OpenAI'%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.677l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v3l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e",I="/assets/ollama-Bt9O-2K_.png",Q="/assets/mlx-DhWwjtMw.png",P={claude:a,codex:h,gemini:r,telegram:A,feishu:n,weixin:w,slack:x,discord:d,dingtalk:f,wecom:m,playwright:v,vscode:C,cursor:L,windsurf:p,finder:B,hermes:y,openrouter:u,anthropic:D,deepseek:E,google:r,qwen:F,doubao:b,glm:z,minimax:J,openai:k,ollama:I,mlx:Q},R={custom:{letter:"+",color:"#94a3b8",bg:"rgba(148,163,184,0.12)"}};function Z({brand:t,size:e=18,className:l}){const i=P[t];if(i)return s.jsx("img",{src:i,alt:"","aria-hidden":"true",draggable:!1,className:g("shrink-0 object-contain select-none",l),style:{width:e,height:e}});const c=R[t];if(!c)return null;const o=c.letter.length>1;return s.jsx("span",{"aria-hidden":"true",className:g("inline-flex shrink-0 items-center justify-center rounded-md font-semibold tracking-tight select-none",l),style:{width:e,height:e,background:c.bg,color:c.color,fontSize:Math.round(e*(o?.42:.55)),lineHeight:1,letterSpacing:o?"-0.02em":"normal"},children:c.letter})}export{Z as B};
|
|
1
|
+
import{j as s}from"./react-vendor-DTcmqLiz.js";import{c as g}from"./index-BVWQelWc.js";const a="data:image/png;base64,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",h="/assets/codex-DYadqqp0.png",n="/assets/feishu-C4OMrjCW.ico",r="/assets/gemini-BYkEpiWr.svg",A="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient%20x1='50%25'%20y1='0%25'%20x2='50%25'%20y2='100%25'%20id='linearGradient-1'%3e%3cstop%20stop-color='%2338AEEB'%20offset='0%25'%3e%3c/stop%3e%3cstop%20stop-color='%23279AD1'%20offset='100%25'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='Artboard'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20id='Oval'%20fill='url(%23linearGradient-1)'%20cx='8'%20cy='8'%20r='8'%3e%3c/circle%3e%3cpath%20d='M3.17026167,7.83635602%20C5.78750201,6.74265999%207.53273882,6.02162863%208.40597211,5.67326193%20C10.8992306,4.67860423%2011.2454541,4.53439191%2011.5831299,4.52864956%20C11.6573986,4.52743168%2011.8385417,4.55776042%2011.9798438,4.67645833%20C12.1211458,4.79515625%2012.1635786,4.87206678%2012.1755371,4.93908691%20C12.1874957,5.00610705%2012.1862759,5.21456762%2012.1744385,5.3338623%20C12.0393279,6.69547283%2011.5259342,9.83829771%2011.2285121,11.3633248%20C11.1026617,12.008621%2010.8548582,12.2249854%2010.6149558,12.2461596%20C10.0935924,12.2921758%209.69769267,11.9156852%209.19272668,11.5981993%20C8.40255458,11.1013965%208.13911734,10.9180161%207.3721185,10.4332283%20C6.48571864,9.87297217%206.85080034,9.6784879%207.35595703,9.17524981%20C7.48815894,9.04355001%209.67825076,7.04590073%209.71077046,6.86250183%20C9.7391276,6.70257812%209.7494847,6.68189389%209.67664063,6.60973958%20C9.60379655,6.53758527%209.51674192,6.54658941%209.46083149,6.55876051%20C9.38158015,6.57601267%208.17521836,7.33962686%205.84174612,8.84960308%20C5.48344358,9.08558775%205.15890428,9.20056741%204.86812819,9.19454205%20C4.54757089,9.18789957%203.93094724,9.02070014%203.47255094,8.87778221%20C2.91030922,8.70248755%202.46345069,8.609808%202.50236203,8.31210343%20C2.52262946,8.15704047%202.74526267,7.998458%203.17026167,7.83635602%20Z'%20id='Path-3'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",w="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20d='M42%2033c-16.569%200-30%2011.64-30%2026%200%208.084%204.283%2015.306%2011.008%2020.073L18%2095l20.832-8.102A37.33%2037.33%200%200%200%2042%2087c16.569%200%2030-11.64%2030-26S58.569%2033%2042%2033Z'%20fill='%23fff'/%3e%3cpath%20d='M85%2048c-13.807%200-25%209.402-25%2021%200%2011.598%2011.193%2021%2025%2021%202.545%200%205-.319%207.29-.91L109%2095l-4.772-12.27C109.078%2079.05%20112%2074.232%20112%2069c0-11.598-12.193-21-27-21Z'%20fill='%23fff'%20opacity='.95'/%3e%3ccircle%20cx='33'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='50'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='77'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='92'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3c/svg%3e",x="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%234A154B'/%3e%3crect%20x='50'%20y='14'%20width='28'%20height='44'%20rx='14'%20fill='%232EB67D'/%3e%3crect%20x='70'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%23ECB22E'/%3e%3crect%20x='50'%20y='70'%20width='28'%20height='44'%20rx='14'%20fill='%23E01E5A'/%3e%3crect%20x='14'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%2336C5F0'/%3e%3c/svg%3e",d="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%235865F2'/%3e%3cpath%20fill='%23fff'%20d='M89.4%2036.9c-5.6-2.6-11.6-4.4-17.9-5.5l-.8%201.6c5.9%201%2011.2%202.6%2016.1%205-6-3-12.7-5-19.8-6-1.5-.2-2.9-.3-4.4-.4-.5%200-1%200-1.5%200s-1%200-1.5%200c-1.5%200-2.9.2-4.4.4-7.1%201-13.8%203-19.8%206%204.9-2.4%2010.2-4%2016.1-5l-.8-1.6C44.2%2032.5%2038.2%2034.3%2032.6%2036.9%2022%2053%2019%2068.7%2020.5%2084.3c8.1%206%2016%209.6%2023.7%2012%201.5-2.1%202.9-4.3%204.1-6.6-2.4-.9-4.6-2-6.8-3.3.6-.4%201.1-.9%201.7-1.3%2013.5%206.3%2028%206.3%2041.4%200%20.6.4%201.1.9%201.7%201.3-2.1%201.3-4.4%202.4-6.8%203.3%201.2%202.3%202.6%204.5%204.1%206.6%207.7-2.4%2015.6-6%2023.7-12%201.7-18.1-2.9-33.7-12.9-47.4ZM52.3%2074.8c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.6%209.1-8%209.1Zm23.5%200c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.5%209.1-8%209.1Z'/%3e%3c/svg%3e",f="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%231989FA'/%3e%3cpath%20fill='%23fff'%20d='M64.6%2026.5c-21%200-38%2017-38%2038%200%2021%2017%2038%2038%2038%206%200%2011.7-1.4%2016.7-3.9l21.3%204.6-7.6-19c4.6-5.7%207.4-12.9%207.4-20.7%200-21-17.1-37.9-37.8-37.9Zm-1.2%2053.8%205.5-13.6c-3.8.2-7.5.4-11.3.5L70.4%2049c-3.4%200-6.5.1-9.4.3l3.9-13.5h11.7l-3.8%2013.4c2.4-.1%204.6-.3%206.7-.5l-9.8%2017.6c4.6-.1%208.8-.3%2012.5-.6L63.4%2080.3Z'/%3e%3c/svg%3e",m="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20fill='%23fff'%20d='M32%2030h36c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H56l-14%2012%204-12h-14c-8%200-14-6-14-14V44c0-8%206-14%2014-14Z'/%3e%3cpath%20fill='%23fff'%20opacity='.55'%20d='M56%2054h32c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H80l-14%2012%204-12h-14c-8%200-14-6-14-14V68c0-8%206-14%2014-14Z'/%3e%3ccircle%20cx='44'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='60'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='72'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3ccircle%20cx='86'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3c/svg%3e",v="/assets/playwright-BldPFZgC.ico",C="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M23.15%202.587L18.21.21a1.494%201.494%200%200%200-1.705.29l-9.46%208.63-4.12-3.128a.999.999%200%200%200-1.276.057L.327%207.261A1%201%200%200%200%20.326%208.74L3.899%2012%20.326%2015.26a1%201%200%200%200%20.001%201.479L1.65%2017.94a.999.999%200%200%200%201.276.057l4.12-3.128%209.46%208.63a1.492%201.492%200%200%200%201.704.29l4.942-2.377A1.5%201.5%200%200%200%2024%2020.06V3.939a1.5%201.5%200%200%200-.85-1.352zm-5.146%2014.861L10.826%2012l7.178-5.448v10.896z'%20fill='%23007ACC'/%3e%3c/svg%3e",L="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%2319191C'/%3e%3cpath%20d='M7%205l10%207-4.5%201.5L15.5%2019l-2.2.8-3-5.5L7%2017z'%20fill='%23fff'/%3e%3c/svg%3e",p="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%230BA48A'/%3e%3cpath%20d='M8%2018l2-12h2.5l-1.2%205h4.2L10%2018H8zm3.5-3.5l3-7.5'%20fill='%23fff'%20fill-rule='evenodd'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%234A90D9'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='12'%20rx='1.5'%20fill='%236DB3F2'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='3.5'%20rx='1.5'%20fill='%233D7ABF'/%3e%3ccircle%20cx='8.5'%20cy='6.8'%20r='.8'%20fill='%23FF5F57'/%3e%3ccircle%20cx='11'%20cy='6.8'%20r='.8'%20fill='%23FEBC2E'/%3e%3ccircle%20cx='13.5'%20cy='6.8'%20r='.8'%20fill='%2328C840'/%3e%3crect%20x='7'%20y='10.5'%20width='10'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.7'/%3e%3crect%20x='7'%20y='13'%20width='7'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.5'/%3e%3c/svg%3e",y="/assets/hermes-BAarh-tH.png",u="/assets/openrouter-CsJ_bD5Q.ico",D="/assets/anthropic-BAdojD7P.ico",E="/assets/deepseek-BeYNZEk0.ico",F="/assets/qwen-xykkX0_y.png",b="/assets/doubao-DloFDuFR.png",z="data:image/png;base64,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",J="/assets/minimax-PuEGTfrF.ico",k="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-label='OpenAI'%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.677l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v3l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e",I="/assets/ollama-Bt9O-2K_.png",Q="/assets/mlx-DhWwjtMw.png",P={claude:a,codex:h,gemini:r,telegram:A,feishu:n,weixin:w,slack:x,discord:d,dingtalk:f,wecom:m,playwright:v,vscode:C,cursor:L,windsurf:p,finder:B,hermes:y,openrouter:u,anthropic:D,deepseek:E,google:r,qwen:F,doubao:b,glm:z,minimax:J,openai:k,ollama:I,mlx:Q},R={custom:{letter:"+",color:"#94a3b8",bg:"rgba(148,163,184,0.12)"}};function Z({brand:t,size:e=18,className:l}){const i=P[t];if(i)return s.jsx("img",{src:i,alt:"","aria-hidden":"true",draggable:!1,className:g("shrink-0 object-contain select-none",l),style:{width:e,height:e}});const c=R[t];if(!c)return null;const o=c.letter.length>1;return s.jsx("span",{"aria-hidden":"true",className:g("inline-flex shrink-0 items-center justify-center rounded-md font-semibold tracking-tight select-none",l),style:{width:e,height:e,background:c.bg,color:c.color,fontSize:Math.round(e*(o?.42:.55)),lineHeight:1,letterSpacing:o?"-0.02em":"normal"},children:c.letter})}export{Z as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e}from"./react-vendor-DTcmqLiz.js";import{a as I,k as P,S as z}from"./index-
|
|
1
|
+
import{r,j as e}from"./react-vendor-DTcmqLiz.js";import{a as I,k as P,S as z}from"./index-BVWQelWc.js";function W({initialPath:x,maxHeight:j=420,minHeight:N=200,onSelect:p,compact:l,t:o}){const[y,k]=r.useState(""),[h,m]=r.useState(""),[g,w]=r.useState([]),[i,S]=r.useState(""),[C,$]=r.useState(!1),[D,B]=r.useState([]),[E,c]=r.useState(!1),[u,d]=r.useState(""),a=r.useCallback(async t=>{c(!0),d("");try{const s=await I.lsDir(t);if(!s.ok){d(s.error||o("modal.cannotRead")),c(!1);return}k(s.path),m(s.path),w(s.dirs),S(s.parent),$(s.isGit);const G=s.path.split("/").filter(Boolean);let v="";B(G.map(b=>(v+="/"+b,{label:b,path:v}))),p?.(s.path,s.isGit)}catch{d(o("modal.loadFailed"))}finally{c(!1)}},[o,p]);r.useEffect(()=>{x!==void 0&&a(x||void 0)},[]);const n=l?"text-[11px]":"text-xs",f=l?"py-[5px]":"py-[7px]";return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-1 ${l?"text-[10px]":"text-[11px]"} font-mono text-fg-4 mb-2 flex-wrap`,children:[e.jsx("span",{className:"cursor-pointer hover:text-fg-2 transition-colors",onClick:()=>a("/"),children:"~"}),D.map((t,s)=>e.jsxs("span",{children:[e.jsx("span",{className:"text-fg-6",children:"/"}),e.jsx("span",{className:"cursor-pointer hover:text-fg-2 transition-colors",onClick:()=>a(t.path),children:t.label})]},s)),C&&e.jsx(P,{variant:"accent",className:"ml-1 !text-[9px] !py-0 !px-1.5",children:"git"})]}),e.jsxs("div",{className:"relative",children:[!l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 h-5 rounded-t-lg",style:{background:"linear-gradient(to bottom, var(--th-panel-alt), rgba(0, 0, 0, 0))"}}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-5 rounded-b-lg",style:{background:"linear-gradient(to top, var(--th-panel-alt), rgba(0, 0, 0, 0))"}})]}),e.jsx("div",{className:"border border-edge rounded-lg overflow-y-auto overscroll-contain scroll-smooth bg-panel-alt",style:{maxHeight:j,minHeight:N,scrollbarGutter:"stable"},children:E?e.jsx("div",{className:`${n} text-fg-5 p-4 text-center flex items-center justify-center gap-2`,children:e.jsx(z,{className:"h-3 w-3 text-fg-5"})}):u?e.jsx("div",{className:`${n} text-red-500/70 p-4`,children:u}):e.jsxs(e.Fragment,{children:[i&&i!==y&&e.jsxs("div",{className:`flex items-center gap-2 px-3 ${f} cursor-pointer hover:bg-panel transition-colors border-b border-edge`,onClick:()=>a(i),children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"text-fg-5 shrink-0",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}),e.jsx("span",{className:`${n} text-fg-4`,children:".."})]}),g.length===0&&!i&&e.jsx("div",{className:`${n} text-fg-5 p-4 text-center`,children:o("modal.emptyDir")}),g.map(t=>e.jsxs("div",{className:`flex items-center gap-2 px-3 ${f} cursor-pointer hover:bg-panel transition-colors`,onClick:()=>a(t.path),children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:t.name===".git"?"var(--th-primary)":"currentColor",strokeWidth:"1.8",className:"text-fg-5 shrink-0",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),e.jsx("span",{className:`${n} text-fg-3`,children:t.name})]},t.path))]})})]}),e.jsx("div",{className:"mt-2",children:e.jsx("input",{className:`w-full rounded-lg border border-edge bg-inset px-2.5 py-1.5 ${n} font-mono text-fg outline-none placeholder:text-fg-5 focus:border-edge-h transition-colors`,placeholder:o("modal.manualInput"),value:h,onChange:t=>m(t.target.value),onKeyDown:t=>{t.key==="Enter"&&a(h)}})})]})}export{W as D};
|