@wudao-org/web 0.4.20 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -85
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,88 +1,7 @@
|
|
|
1
|
-
# @wudao-org/web
|
|
1
|
+
# @wudao-org/web
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
protocol — a pure protocol consumer with zero agent logic. The contract is
|
|
5
|
-
[`packages/server/PROTOCOL.md`](../server/PROTOCOL.md); its types are
|
|
6
|
-
hand-mirrored into [`src/protocol.ts`](src/protocol.ts), the only file that
|
|
7
|
-
knows the server exists.
|
|
3
|
+
The web frontend of [wudao-harness](https://github.com/feiniaojin/wudao-harness) — `wudao ui`: chat with your agent, browse files, manage sessions and memory, and watch the monitoring dashboard (model calls, tool traffic, thinking, token flow).
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
A prebuilt static bundle, served by `@wudao-org/server`. You don't install this directly — install the app: `npm install -g wudao-harness`, then run `wudao ui`.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
pnpm --filter @wudao-org/web build # → dist/ (also part of the root build chain)
|
|
13
|
-
wudao ui # serves dist/ at the printed loopback URL
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
`wudao ui` prints `http://127.0.0.1:<port>/#<token>`; the token rides the URL
|
|
17
|
-
fragment (never a request line) and is sent as the first WS frame. Dev loop:
|
|
18
|
-
`pnpm --filter @wudao-org/web dev` (vite on :5173) against a running server.
|
|
19
|
-
|
|
20
|
-
## Surface (the TUI parity checklist)
|
|
21
|
-
|
|
22
|
-
- **Conversation** — streaming markdown (the TUI's block/inline grammar) with
|
|
23
|
-
a zero-dep per-line code highlighter, collapsible reasoning (head-of-thought
|
|
24
|
-
summary), ⏺/↳ tool cards (⏹ + `[error]` on failures), ✏️ red/green inline
|
|
25
|
-
diffs (context runs collapse), 📋 todo board (☑/◐/☐), `── dividers ──`,
|
|
26
|
-
resume history, warn notices, err errors.
|
|
27
|
-
- **Input** — multi-line (Enter send · Shift+Enter newline · `\`+Enter
|
|
28
|
-
continuation), ↑/↓ submitted-prompt history at the buffer's first/last line,
|
|
29
|
-
`/` suggestion menu (live `listSlashCommands` data, ≤7-row scrolled window,
|
|
30
|
-
Tab/Enter complete, Esc dismisses per token), `@` mention hint.
|
|
31
|
-
- **Controls** — steering (submit while busy → ⏳ queue), interrupt (Esc /
|
|
32
|
-
button), mode cycling (shift+tab / chip: ask → auto → read-only, live in
|
|
33
|
-
the status bar), permission modal (y/a/N + typed deny reason; policy-file
|
|
34
|
-
asks degrade to y/N; git-risk warning + sidecar reason render), plan review
|
|
35
|
-
(ok / 改 …), `/resume` picker, `/rewind` (text-routed, list lands as a
|
|
36
|
-
notice), `/clear` confirm, `/help` from the live command list.
|
|
37
|
-
- **Status bar** — `wudao · <session8> │ mode │ ctx N/M ⚠ │ cache % │ ▣ d/t │
|
|
38
|
-
bg n/m │ sidecar N │ 🛡✕` (absent segments omitted). The server-side
|
|
39
|
-
shutdown path terminates sockets and aborts the in-flight run, so Ctrl+C
|
|
40
|
-
exits `wudao ui` promptly even with a connected tab and a live run (the
|
|
41
|
-
browser then shows the reconnect flow instead of a hung 1006).
|
|
42
|
-
- **Connection** — reconnect banner with capped backoff (1s → 2s → 4s → 8s →
|
|
43
|
-
16s → 30s, **8 attempts max**); the re-run auth replays the full history
|
|
44
|
-
(`reset:true`) and restores the surface. 4401 stops (bad token); 4000
|
|
45
|
-
retries (the other tab may close). Past the cap the banner turns terminal —
|
|
46
|
-
`连接已断开 — server 可能已退出,重启 wudao ui 后点击重连` — with a manual
|
|
47
|
-
重连 button. While offline the send control disables (the draft is kept)
|
|
48
|
-
and mode clicks queue client-side (latest wins) and flush on reconnect — a
|
|
49
|
-
click on a dead socket never surfaces an error toast.
|
|
50
|
-
|
|
51
|
-
Terminal-dark theme keyed by the TUI's ink names (`cli/src/tui/theme.ts`),
|
|
52
|
-
monospace, responsive (hints/status shrink under 640px).
|
|
53
|
-
|
|
54
|
-
## Layout
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
src/
|
|
58
|
-
protocol.ts PROTOCOL.md mirror + WudaoClient (store + reconnect)
|
|
59
|
-
use-ui.ts useSyncExternalStore adapter
|
|
60
|
-
input-state.ts the reused M44 input-machine rules (history, Enter, caret)
|
|
61
|
-
slash.ts slash menu + /help rules (TUI mirror)
|
|
62
|
-
frontend-commands.ts the frontend-owned command router (exit/clear/help/resume)
|
|
63
|
-
markdown.tsx block/inline grammar + fenced-code render
|
|
64
|
-
highlight.ts zero-dep per-line tokenizer (why: highlight.js ~1MB vs a
|
|
65
|
-
fenced-code contract the TUI itself serves per-line)
|
|
66
|
-
diff.ts / board.ts / log.ts hunk math, ☑◐☐ marks, display helpers
|
|
67
|
-
components/ App, HistoryList, LiveArea, StatusBar, InputBox,
|
|
68
|
-
PermissionModal, AskUserCards, PlanReview, ResumePicker,
|
|
69
|
-
ClearConfirm
|
|
70
|
-
tests/ fake-WS protocol round-trips, input-machine/slash rules,
|
|
71
|
-
jsdom component + App interaction suites
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Known v1 gaps (protocol, not UI)
|
|
75
|
-
|
|
76
|
-
- **No model label** — the state snapshot has no model field, so the status
|
|
77
|
-
head is `wudao · <session8>` (the TUI shows the provider label).
|
|
78
|
-
- **`/clear` is view-level** — protocol v1 has no driver-clear op; the saved
|
|
79
|
-
session persists (a reconnect replay or `/resume` restores it).
|
|
80
|
-
- **`a` (allow-this-session) answers allow-once** — answerPermission carries
|
|
81
|
-
only `{allow, reason}`; the TUI's client-side session-allowlist rule has no
|
|
82
|
-
op counterpart.
|
|
83
|
-
- **ask_user has no trigger** — `wudao ui` leaves the tool fail-closed
|
|
84
|
-
unwired and the protocol has no ask frame; `AskUserCards` is component-
|
|
85
|
-
complete and tested for the v1.1 seam.
|
|
86
|
-
- **Plugin/extension commands** — a `"frontend"` submit outcome (their
|
|
87
|
-
execution is caller-owned) shows an honest notice; the templates cannot be
|
|
88
|
-
expanded over v1.
|
|
7
|
+
- MIT license.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wudao-org/web",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "wudao ui — the web frontend (M43-B): a pure WS-protocol consumer (PROTOCOL.md) with TUI-full-parity surface, served statically by @wudao-org/server.",
|
|
6
6
|
"devDependencies": {
|