iclavue 10.4.13 → 10.4.15
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 +5 -5
- package/dist/clavue.js +1 -1
- package/dist/cli.js +140 -105
- package/dist/mao-command.js +1 -1
- package/dist/native/clavue-pager +0 -0
- package/dist/native/clavue-pager-darwin-arm64 +0 -0
- package/dist/native/manifest.json +2 -2
- package/dist/openai-responses-adapter.js +1 -1
- package/dist/provider-setup.js +1 -1
- package/docs/clavue-pager-content-doctrine.md +131 -0
- package/docs/clavue-pager-interaction-contract.md +199 -0
- package/docs/clavue-pager-parity-checklist.md +68 -0
- package/docs/clavue-pager-ux-principles.md +3 -1
- package/docs/clavue-vs-grokcli-architecture-alignment.md +151 -0
- package/docs/evals/world-class/weekly-flywheel.tsv +6 -0
- package/docs/system-shell-engine-contract.md +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Clavue Pager Content Doctrine
|
|
2
|
+
|
|
3
|
+
> How journal content is **seen** — not just which keys exist.
|
|
4
|
+
> Complements `clavue-pager-interaction-contract.md` (hands) with **eyes**.
|
|
5
|
+
> Clavue ≠ Grok clone: we keep **execution / verify / multi-route** advantages.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Visual priority (top → bottom attention)
|
|
10
|
+
|
|
11
|
+
| Rank | Content | Why (Clavue) |
|
|
12
|
+
|------|---------|----------------|
|
|
13
|
+
| **1** | Outcome **FAILED** / blockers | Delivery truth — Grok is calmer; we stay loud on fail |
|
|
14
|
+
| **2** | Edit/Write **red/green bands** | Code change is the product unit |
|
|
15
|
+
| **3** | Permission modal · Needs Input | Safety / multi-worker unblock |
|
|
16
|
+
| **4** | Tool heads `Edit path · −n +m` | Scan without expand |
|
|
17
|
+
| **5** | Assistant final text | Answer, not process |
|
|
18
|
+
| **6** | Bash/Task (collapsed) | Process — expand on demand |
|
|
19
|
+
| **7** | Thought / explore groups | Noise by default |
|
|
20
|
+
| **8** | Tokens/cost meta in Outcome | Secondary telemetry |
|
|
21
|
+
|
|
22
|
+
**Rule:** If everything is bright, nothing is important. Dim by default; paint signal.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. Line roles (already partially shipped)
|
|
27
|
+
|
|
28
|
+
| Role | Paint |
|
|
29
|
+
|------|--------|
|
|
30
|
+
| Diff add / del | Full-line green / red **band** |
|
|
31
|
+
| Diff context / `… more` | Dim gray |
|
|
32
|
+
| Path-only | Bold tool color |
|
|
33
|
+
| Outcome fail header | Red band + bold |
|
|
34
|
+
| Outcome blockers fail | Red band |
|
|
35
|
+
| tokens/cost/turns | Dim |
|
|
36
|
+
| Thought | Think muted |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 3. Clavue-native “perfect” upgrades (roadmap)
|
|
41
|
+
|
|
42
|
+
### A. **Delivery ribbon** (unique — not Grok)
|
|
43
|
+
|
|
44
|
+
After each turn, one sticky strip (battlefield, ≤3 lines):
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
■ Outcome · ok · −12 +8 across 3 files
|
|
48
|
+
□ verify pass · next: continue
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
or fail:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
■ Outcome · FAILED · blockers: typecheck
|
|
55
|
+
□ Edit a.ts · −2 +5 · verify fail
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Advantage:** multi-file turn summary Grok often underplays; we already have Outcome — make it the **always-on scan target**.
|
|
59
|
+
|
|
60
|
+
### B. **Route identity in journal, not only header**
|
|
61
|
+
|
|
62
|
+
When model/provider changes mid-session:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
◇ route · providerX · modelY · (session kept)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Advantage:** multi-provider product; header flash alone is easy to miss.
|
|
69
|
+
|
|
70
|
+
### C. **Parallel Needs Input as first-class card**
|
|
71
|
+
|
|
72
|
+
Same visual weight as permission modal:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
⚠ Needs Input · worker-2 · question…
|
|
76
|
+
[Enter panel] [y/a/n if perm]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Advantage:** multi-agent is our wedge; gray it and users miss it.
|
|
80
|
+
|
|
81
|
+
### D. **Edit fold math always visible**
|
|
82
|
+
|
|
83
|
+
Collapsed: `◆ Edit path · −3 +5`
|
|
84
|
+
Expanded: red/green body
|
|
85
|
+
|
|
86
|
+
Never collapse Edit to bare `ok`.
|
|
87
|
+
|
|
88
|
+
### E. **Combo model line only when hybrid**
|
|
89
|
+
|
|
90
|
+
Header: `primary · light · agent` when slots differ; else single model.
|
|
91
|
+
(Already partial — keep honest, no spam.)
|
|
92
|
+
|
|
93
|
+
### F. **Optional later**
|
|
94
|
+
|
|
95
|
+
| Item | ROI | Note |
|
|
96
|
+
|------|-----|------|
|
|
97
|
+
| Real file line numbers | Med | Needs disk read of file for Edit |
|
|
98
|
+
| Full syntax theme | Low | Band + strings enough for scan |
|
|
99
|
+
| Block fullscreen | Med | Grok Ctrl+F — nice, not daily |
|
|
100
|
+
| Vim | Low | Ink by design |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 4. What not to chase
|
|
105
|
+
|
|
106
|
+
- Pixel clone of Grok chrome (we have dragon · Outcome · multi-route)
|
|
107
|
+
- Ink-deep wizards in pager (capabilitySurface stubs)
|
|
108
|
+
- Bright-every-line “pretty terminal” that kills density
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 5. Implementation map
|
|
113
|
+
|
|
114
|
+
| Concern | Code |
|
|
115
|
+
|---------|------|
|
|
116
|
+
| Diff bands + string tint | `pager/src/render.rs` · `theme.rs` |
|
|
117
|
+
| Edit body markers | `fromStreamJson.formatEditDiffBody` |
|
|
118
|
+
| Edit head −n +m | `toolSummary` · `toolResultSummary` |
|
|
119
|
+
| Outcome fields | `render.rs` Outcome branch · duplex `outcome.turn` |
|
|
120
|
+
| Sticky delivery | `rebuild_battlefield_chrome` · last_outcome |
|
|
121
|
+
| Interaction keys | `keys.rs` · interaction-contract |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 6. Next three builds (recommended order)
|
|
126
|
+
|
|
127
|
+
1. **Ship**: Edit −n+m on fold + red/green bands *(done / hardening)*
|
|
128
|
+
2. **Delivery ribbon**: battlefield always shows last Outcome in ≤2 lines with edit aggregate
|
|
129
|
+
3. **Needs Input card**: same visual tier as permission
|
|
130
|
+
|
|
131
|
+
Then stop painting and measure: time-to-spot “what changed / did it pass verify?”
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Clavue Pager Interaction Contract
|
|
2
|
+
|
|
3
|
+
> **Stable product contract** — not a patch log.
|
|
4
|
+
> All session key behavior is defined here. Code must match this table.
|
|
5
|
+
> Last updated: 2026-07-11 (line-edit + Ctrl+C ladder)
|
|
6
|
+
|
|
7
|
+
## Design rules
|
|
8
|
+
|
|
9
|
+
1. **One ladder per gesture** — Esc, Ctrl+C, Tab have ordered steps; never silent no-ops without status.
|
|
10
|
+
2. **Draft before destroy** — clear input before cancel/quit when draft is non-empty.
|
|
11
|
+
3. **Prompt is home** — typing always returns focus to prompt; scrollback is view-only until Tab.
|
|
12
|
+
4. **Completions steal only when active** — `/…` or live `@token`; otherwise ↑↓ = history.
|
|
13
|
+
5. **Stay in session** — empty Esc never opens home; use `/home` or `/exit`.
|
|
14
|
+
6. **Journal visual hierarchy (Grok Edit card)** — full-line green/red bands for `+ `/`- ` diffs; dim context; bold path; noise folded.
|
|
15
|
+
|
|
16
|
+
## Journal line roles (content display)
|
|
17
|
+
|
|
18
|
+
| Role | Marker / cue | Style |
|
|
19
|
+
|------|----------------|-------|
|
|
20
|
+
| **Add** | `+ ` / `+ N\| code` | Full-line **green band** + string highlight |
|
|
21
|
+
| **Del** | `- ` / `- N\| code` | Full-line **red band** + string highlight |
|
|
22
|
+
| **Context** | `N\| code` · `… more` | **Dim gray** (skip when scanning) |
|
|
23
|
+
| **Path** | `…/file.rs` alone | Bold tool color |
|
|
24
|
+
| **Tool head** | `◆ Edit path · −n +m` | Tool green · fail red · counts on fold |
|
|
25
|
+
| **Thought** | `Thought` | Think muted |
|
|
26
|
+
| **Outcome fail** | Outcome failed | Highest contrast |
|
|
27
|
+
|
|
28
|
+
Render: `pager/src/render.rs` · tokens: `theme.rs` `diff_*` · body: `formatEditDiffBody`.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Session · Ctrl+C ladder
|
|
33
|
+
|
|
34
|
+
| State | Effect |
|
|
35
|
+
|-------|--------|
|
|
36
|
+
| Draft non-empty (or history browse) | **Clear draft** · status tip · **do not** cancel/quit |
|
|
37
|
+
| Running + empty draft | **Cancel turn** · tip: Ctrl+C again to quit |
|
|
38
|
+
| Idle + empty draft · first press | Tip: Ctrl+C again to quit |
|
|
39
|
+
| Idle + empty · second within 2s | **Quit** |
|
|
40
|
+
|
|
41
|
+
Also: **Ctrl+U** clears draft anytime (kill line).
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Session · Esc ladder
|
|
46
|
+
|
|
47
|
+
| Order | Condition | Effect |
|
|
48
|
+
|-------|-----------|--------|
|
|
49
|
+
| 1 | Running | Cancel turn |
|
|
50
|
+
| 2 | Completions open | Close menu |
|
|
51
|
+
| 3 | History browse | Restore live buffer |
|
|
52
|
+
| 4 | Text selection | Clear selection |
|
|
53
|
+
| 5 | Scrollback focus | Focus prompt |
|
|
54
|
+
| 6 | Draft non-empty | Clear draft |
|
|
55
|
+
| 7 | Idle empty | Stay · tip `/home` · `/exit` |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Session · Prompt (draft editing)
|
|
60
|
+
|
|
61
|
+
| Key | Effect |
|
|
62
|
+
|-----|--------|
|
|
63
|
+
| Printable | Insert at caret |
|
|
64
|
+
| Backspace / Delete | Delete before / after caret |
|
|
65
|
+
| ← → Home End | Move caret |
|
|
66
|
+
| Ctrl+A / Ctrl+E | Line start / end |
|
|
67
|
+
| Ctrl+U | Clear entire draft |
|
|
68
|
+
| Ctrl+K | Kill caret → end |
|
|
69
|
+
| Ctrl+W | Kill word before caret |
|
|
70
|
+
| Ctrl+D | Delete forward |
|
|
71
|
+
| Shift/Alt+Enter | Newline (no send) |
|
|
72
|
+
| Enter | Send (or run local `/`) |
|
|
73
|
+
| ↑ ↓ | Prompt history (if not in `/` menu) |
|
|
74
|
+
| Ctrl+P / Ctrl+N | Prompt history (always) |
|
|
75
|
+
| Ctrl+R | Reverse history search (match draft · again = older) |
|
|
76
|
+
| Ctrl+S | Resume session picker |
|
|
77
|
+
| Paste / drag path | Insert at caret · file/folder/image/doc path → `@path` (multi → `@a @b `) |
|
|
78
|
+
| Paste image *data* | Honest notice: save file then `@path` (no binary upload in pager) |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Session · Completions (`/` or `@`)
|
|
83
|
+
|
|
84
|
+
| Key | Effect |
|
|
85
|
+
|-----|--------|
|
|
86
|
+
| ↑ ↓ Tab Shift+Tab | Move selection |
|
|
87
|
+
| Enter | Apply · if `/cmd` open surface |
|
|
88
|
+
| Esc | Close menu |
|
|
89
|
+
| Type / Backspace | Refine filter |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Session · Scrollback
|
|
94
|
+
|
|
95
|
+
| Key | Effect |
|
|
96
|
+
|-----|--------|
|
|
97
|
+
| Tab | Toggle focus prompt ↔ scrollback |
|
|
98
|
+
| ↑ ↓ j k PageUp/Down | Select entry |
|
|
99
|
+
| ← → h l Space | Fold / expand |
|
|
100
|
+
| Shift+↑ / Shift+↓ | Jump prev/next **user** turn |
|
|
101
|
+
| y | Copy selected block body |
|
|
102
|
+
| Y | Copy selected block summary |
|
|
103
|
+
| Type / Backspace | Return to prompt + edit |
|
|
104
|
+
| Alt+↑↓ | From prompt: enter scrollback (one step) |
|
|
105
|
+
| Shift+↑↓ (from prompt) | Enter scrollback + jump user turn |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Session · History search (Ctrl+R)
|
|
110
|
+
|
|
111
|
+
| Key | Effect |
|
|
112
|
+
|-----|--------|
|
|
113
|
+
| Ctrl+R | Enter reverse search · needle = draft (empty = any) · again = older match |
|
|
114
|
+
| Printable (in search) | Append to needle · re-search from newest |
|
|
115
|
+
| Backspace (in search) | Pop needle · re-search |
|
|
116
|
+
| Esc | Restore draft · leave search |
|
|
117
|
+
| Enter | Accept match as prompt (send if non-empty) |
|
|
118
|
+
| Ctrl+S | Resume session picker (lightweight await · not turn busy) |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Session · Global chords
|
|
123
|
+
|
|
124
|
+
| Key | Effect |
|
|
125
|
+
|-----|--------|
|
|
126
|
+
| Shift+Tab | Cycle permission mode |
|
|
127
|
+
| y / a / n | Permission modal |
|
|
128
|
+
| Ctrl+O | Verbose toggle |
|
|
129
|
+
| Ctrl+, | Settings panel |
|
|
130
|
+
| Alt+T | Thinking toggle |
|
|
131
|
+
| Alt+O | Fast model toggle |
|
|
132
|
+
| Ctrl+L | Collapse last tool group |
|
|
133
|
+
| Mouse drag | Select → copy |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Paste / drag-drop contract
|
|
138
|
+
|
|
139
|
+
Terminals deliver **bracketed paste** (not true HTML drag events). Finder/Explorer
|
|
140
|
+
drag into the terminal usually becomes a paste of path(s) or `file://` URIs.
|
|
141
|
+
|
|
142
|
+
### Paths & files
|
|
143
|
+
|
|
144
|
+
| Input | Result |
|
|
145
|
+
|-------|--------|
|
|
146
|
+
| Image path / `file://…png` | `@/abs/path ` |
|
|
147
|
+
| Folder path | `@/abs/dir ` (agent Glob/Read) |
|
|
148
|
+
| Doc `.md/.pdf/.docx/…` | `@/path ` |
|
|
149
|
+
| Multi-line paths | `@a @b @c ` |
|
|
150
|
+
| `data:image…` / binary clipboard | Status tip only — save to disk first |
|
|
151
|
+
|
|
152
|
+
### Plain text / long content (tiered)
|
|
153
|
+
|
|
154
|
+
| Size | Policy |
|
|
155
|
+
|------|--------|
|
|
156
|
+
| **Short** (≲4k chars and ≲60 lines) | Insert into draft at caret |
|
|
157
|
+
| **Medium** (above short, below file floor) | Insert into draft; dock shows **last 8 lines** + `… +N lines above` |
|
|
158
|
+
| **Long** (≥12k chars **or** ≥200 lines **or** draft+paste >24k) | Write `<cwd>/.clavue/pastes/paste-*.{txt,md}` → insert `@/abs/path ` · agent **Read** |
|
|
159
|
+
| File save fails | Inline first 4k with truncation notice |
|
|
160
|
+
|
|
161
|
+
Why file spill: keeps prompt scannable, avoids TUI jank, matches agent tools (`@path` → Read).
|
|
162
|
+
|
|
163
|
+
Constants: `PASTE_INLINE_MAX_*` · `PASTE_FILE_MIN_*` · `PROMPT_TOTAL_MAX_CHARS` in `pager/src/main.rs`.
|
|
164
|
+
|
|
165
|
+
Implementation: `handle_paste` · `should_spill_paste` · `spill_paste_to_file` · `extract_path_tokens`.
|
|
166
|
+
|
|
167
|
+
## Two shells · one engine
|
|
168
|
+
|
|
169
|
+
| Term | Meaning |
|
|
170
|
+
|------|---------|
|
|
171
|
+
| **Native pager** | Default UI (Rust/ratatui). Insert-mode line edit. Catalog kinds · local / → agent. |
|
|
172
|
+
| **Ink** | Classic Clavue terminal UI built with React + npm package **ink**. Launch: `clavue --ui=ink`. |
|
|
173
|
+
| **Vim** | Modal keybindings (Normal/Insert like the **vim editor**). **Not** “window”. Only in Ink shell. |
|
|
174
|
+
| **◇ ink commands** | `/vim` · `/hooks` · `/skills` · `/agents` — multi-step wizards; pager shows honest deep-link only. |
|
|
175
|
+
|
|
176
|
+
Shell paints; engine executes. Switching shell does not change tools/models/routes.
|
|
177
|
+
|
|
178
|
+
## Out of scope (honest)
|
|
179
|
+
|
|
180
|
+
| Item | Path |
|
|
181
|
+
|------|------|
|
|
182
|
+
| Full vim mode in native pager | `/ink` → classic shell · or future opt-in |
|
|
183
|
+
| Fullscreen block viewer | Later |
|
|
184
|
+
| Multi-cursor / selection in prompt | Not supported |
|
|
185
|
+
| True binary image paste without path | OS/terminal limited; use file + `@path` |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Implementation map
|
|
190
|
+
|
|
191
|
+
| Concern | File |
|
|
192
|
+
|---------|------|
|
|
193
|
+
| Key ladders + chords | `pager/src/main.rs` `handle_key` |
|
|
194
|
+
| Line buffer + caret | `pager/src/model.rs` `input` / `input_cursor` / `insert_*` / `kill_*` |
|
|
195
|
+
| History | `history_prev` / `history_next` / `history_search_*` / `wants_prompt_history_keys` |
|
|
196
|
+
| Footer tips | `grok_footer_spans` |
|
|
197
|
+
| Local slash wait | `awaiting_slash` · `begin_awaiting_slash` (not `running`) |
|
|
198
|
+
|
|
199
|
+
When adding a key: **update this doc first**, then code, then `/keys` help text.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Clavue Pager Parity Checklist
|
|
2
|
+
|
|
3
|
+
Living checklist vs Claude Code / Codex daily path · historic Clavue · Grok CLI.
|
|
4
|
+
**Not a marketing claim** — mark honesty. Update when keys/features change.
|
|
5
|
+
|
|
6
|
+
Legend: ✅ full · ⚠️ partial · ❌ missing/by-design · 🔧 this wave
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## P0 — daily path (must stay green)
|
|
11
|
+
|
|
12
|
+
| Item | Status |
|
|
13
|
+
|------|--------|
|
|
14
|
+
| Send / multi-turn | ✅ |
|
|
15
|
+
| Esc cancel turn | ✅ |
|
|
16
|
+
| Ctrl+C clear → cancel → quit | ✅ |
|
|
17
|
+
| Permission y/a/n + Shift+Tab mode | ✅ |
|
|
18
|
+
| /model · session kept | ✅ |
|
|
19
|
+
| /clear · /resume | ✅ |
|
|
20
|
+
| /compact · /plan (agent) | ✅ |
|
|
21
|
+
| /cost · /context · /diff | ✅ |
|
|
22
|
+
| @path · paste file · long paste file | ✅ |
|
|
23
|
+
| Ctrl+, settings | ✅ |
|
|
24
|
+
| Provider batch form | ✅ |
|
|
25
|
+
| Outcome / verify chrome | ✅ |
|
|
26
|
+
|
|
27
|
+
## P2 — power UX (Grok/Claude muscle)
|
|
28
|
+
|
|
29
|
+
| Item | Status |
|
|
30
|
+
|------|--------|
|
|
31
|
+
| ↑↓ · Ctrl+P/N history | ✅ |
|
|
32
|
+
| Ctrl+R reverse history search | ✅ |
|
|
33
|
+
| Ctrl+S resume | ✅ |
|
|
34
|
+
| Scrollback y/Y copy block | ✅ |
|
|
35
|
+
| Shift+↑↓ user-turn jump | ✅ |
|
|
36
|
+
| Line edit caret · Ctrl+U/K/W | ✅ |
|
|
37
|
+
| /keys single map | ✅ |
|
|
38
|
+
| Ctrl+R type-while-search (refine needle) | ✅ |
|
|
39
|
+
| Block fullscreen viewer | ❌ later |
|
|
40
|
+
| Vim mode | ❌ ink by design |
|
|
41
|
+
| Grok Esc≠cancel | ❌ Clavue keeps Esc=cancel |
|
|
42
|
+
|
|
43
|
+
## Settings surface
|
|
44
|
+
|
|
45
|
+
| Item | Status |
|
|
46
|
+
|------|--------|
|
|
47
|
+
| Compact / verbose / thinking / theme / locale | ✅ |
|
|
48
|
+
| Always-allow list | ✅ |
|
|
49
|
+
| Editor/vim (modal keys) | ❌ ink-only by design · `/vim` honest deep-link |
|
|
50
|
+
| MCP list/toggle/add | ⚠️ list full · OAuth ink |
|
|
51
|
+
| Hooks/skills/agents wizards | ❌ ink by design |
|
|
52
|
+
|
|
53
|
+
## Engine (historic Clavue)
|
|
54
|
+
|
|
55
|
+
| Item | Status |
|
|
56
|
+
|------|--------|
|
|
57
|
+
| Tools · routes · plan/verify · goal/loop · parallel | ✅ L2 unchanged |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Definition of done
|
|
62
|
+
|
|
63
|
+
- **Daily ship**: all P0 ✅
|
|
64
|
+
- **Power parity**: P2 daily keys ✅ · remaining ❌ are by-design / later
|
|
65
|
+
|
|
66
|
+
- **Deep wizard**: not required for pager GA
|
|
67
|
+
|
|
68
|
+
Keys source: `pager/src/keys.rs` · contract: `clavue-pager-interaction-contract.md`
|
|
@@ -23,7 +23,9 @@ See also: `docs/clavue-pager-visual-doctrine.md`, `pager/src/theme.rs`.
|
|
|
23
23
|
| Browse journal | Tab or ↑ from empty prompt |
|
|
24
24
|
| Fold tools | Scrollback focus · ←/→ |
|
|
25
25
|
| Language | Home · Language · or `/language` |
|
|
26
|
-
| Escape | Esc: cancel →
|
|
26
|
+
| Escape | Esc: cancel → menu → history → clear draft · **stay in session** (`/home` to leave) |
|
|
27
|
+
| Clear draft | Ctrl+C (first) · Ctrl+U · Esc on empty menu |
|
|
28
|
+
| History | ↑/↓ or Ctrl+P/N in prompt |
|
|
27
29
|
|
|
28
30
|
## Visual hierarchy (Clavue Night)
|
|
29
31
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Clavue vs Grok Build CLI — 架构差异与对齐路线
|
|
2
|
+
|
|
3
|
+
> 2026-07-11 · 对照本机 Grok 0.2.93 文档/二进制 + Clavue native pager
|
|
4
|
+
> 目的:**解释为什么我们问题多**,以及**如何按 Grok 正确姿势对齐**(不是像素复刻)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 0. 一句话结论
|
|
9
|
+
|
|
10
|
+
| | **Grok Build** | **Clavue v10 pager** |
|
|
11
|
+
|--|----------------|----------------------|
|
|
12
|
+
| 形态 | **同栈共设计**:`xai-grok-pager` + `xai-grok-shell` 从第一天就分工清晰 | **引擎先成熟,壳后换**:Node 引擎 + 后装 Rust pager + NDJSON 桥 |
|
|
13
|
+
| 会话真理 | **`updates.jsonl` 权威 UI 流** → resume = 回放 | 长期靠 **agent jsonl 反向 hydrate**(有损) |
|
|
14
|
+
| Slash | **Pager builtins / Shell builtins** 两源,目录合一 | complete.rs 静态 + slashBridge + Ink 三源易漂移 |
|
|
15
|
+
| 产品范围 | 单厂商 · 单 runtime 体验 | 多 provider · 组合模型 · plan/verify · 并行 |
|
|
16
|
+
|
|
17
|
+
**问题多的根因不是「前端写得差」,而是:Grok 的 UI 事件流与会话存储是一等公民;我们曾用「引擎 transcript 反推 UI」补洞。**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Grok 如何实现(本机文档/二进制证据)
|
|
22
|
+
|
|
23
|
+
### 1.1 双组件、同一产品契约
|
|
24
|
+
|
|
25
|
+
Grok slash 文档原文:
|
|
26
|
+
|
|
27
|
+
- **Shell builtins** → agent backend (`xai-grok-shell`)
|
|
28
|
+
- **Pager builtins** → TUI frontend (`xai-grok-pager`)
|
|
29
|
+
- 自动补全目录合并两套
|
|
30
|
+
|
|
31
|
+
二进制侧可见:`xai_grok_shell::session::storage`、ACP `session/prompt`、`updates.jsonl` 回放逻辑。
|
|
32
|
+
|
|
33
|
+
### 1.2 会话是权威存储,不是「事后猜」
|
|
34
|
+
|
|
35
|
+
`~/.grok/sessions/<cwd>/<session-id>/`:
|
|
36
|
+
|
|
37
|
+
| 文件 | 角色 |
|
|
38
|
+
|------|------|
|
|
39
|
+
| **`updates.jsonl`** | **UI/对话权威流**(resume 回放源) |
|
|
40
|
+
| `chat_history.jsonl` | 发给模型的原始消息 |
|
|
41
|
+
| `summary.json` | 索引元数据 |
|
|
42
|
+
| `plan.json` / `signals.json` | 任务与计数 |
|
|
43
|
+
|
|
44
|
+
**Resume = 回放 updates,不是从 chat_history 猜 UI 行。**
|
|
45
|
+
|
|
46
|
+
### 1.3 键位语义产品化(稳定契约)
|
|
47
|
+
|
|
48
|
+
- Esc:**不**取消 running turn(Ctrl+C 取消)— 2026-07 明确变更
|
|
49
|
+
- Esc:清输入 / rewind 用 **双击** 防误触
|
|
50
|
+
- Prompt 与 Scrollback 焦点分离,字母键回 prompt
|
|
51
|
+
|
|
52
|
+
### 1.4 密度来自「块模型 + 折叠」,不是 React 树
|
|
53
|
+
|
|
54
|
+
Scrollback 是 entry 选择/折叠模型;thinking / tool / user 都是块级操作。
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 2. Clavue 为何问题多(差异清单)
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Grok: [Pager] ←── updates.jsonl ──→ [Shell/Agent] 同栈、同事件方言
|
|
62
|
+
Clavue: [Pager] ←── a2p NDJSON ──→ [duplex] ←── stream-json ──→ [Agent]
|
|
63
|
+
↑ 展示层 ↑ 引擎层
|
|
64
|
+
曾无权威落盘 Claude 兼容 jsonl
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| # | 差异 | 症状 |
|
|
68
|
+
|---|------|------|
|
|
69
|
+
| 1 | **无权威 UI 事件日志**(直到 journal.a2p) | resume 丢 thinking/outcome;hydrate 永远追不上 live |
|
|
70
|
+
| 2 | **双 session id**(pending + agent UUID) | 模型切换/重启丢对话 |
|
|
71
|
+
| 3 | **Slash 三源**(complete.rs / slashBridge / Ink) | `/status` 本地 stub、catalog 撒谎 |
|
|
72
|
+
| 4 | **模型显示多表面** | header 对了、面板/`/status` 读 profile |
|
|
73
|
+
| 5 | **Ink 全量能力期望迁移** | MCP OAuth 等被当成 pager bug,实为深度边界 |
|
|
74
|
+
| 6 | **Paint 未虚化** | 长会话 `entry_lines` 全量展开卡顿 |
|
|
75
|
+
|
|
76
|
+
**后端(L2)成熟** → 换壳后暴露的是 **L0/L1 契约缺失**,不是 QueryEngine 坏了。
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 3. 对齐原则(最佳实践 · 禁止再犯)
|
|
81
|
+
|
|
82
|
+
### 3.1 必须像 Grok 的
|
|
83
|
+
|
|
84
|
+
1. **UI 事件流权威**
|
|
85
|
+
Live a2p → 落盘 `journal.a2p.jsonl` → resume **优先回放**;agent jsonl hydrate 仅 fallback。
|
|
86
|
+
|
|
87
|
+
2. **Slash 单源深度**
|
|
88
|
+
`capabilitySurface.ts` = 唯一 `local|agent|ink`;`/wizard` 从此生成。
|
|
89
|
+
|
|
90
|
+
3. **Session UUID 连续**
|
|
91
|
+
换 model/mode → `--resume` 同 UUID;仅 `/clear` 新会话。
|
|
92
|
+
|
|
93
|
+
4. **壳不重写引擎**
|
|
94
|
+
Deep wizard 诚实 `ink`/`stub`,禁止假面板。
|
|
95
|
+
|
|
96
|
+
5. **Paint 虚化**
|
|
97
|
+
`MAX_JOURNAL_BLOCKS` + 近焦点 body 展开。
|
|
98
|
+
|
|
99
|
+
### 3.2 不必抄 Grok 的
|
|
100
|
+
|
|
101
|
+
| Grok | Clavue 保持差异(优势) |
|
|
102
|
+
|------|-------------------------|
|
|
103
|
+
| 单 provider 身份 | **Provider-as-route · 组合模型** |
|
|
104
|
+
| Esc 不取消 turn | **Esc 取消 turn**(Clavue 肌肉记忆;Ctrl+C 二次退出) |
|
|
105
|
+
| 单 monorepo Rust 二进制 | **Node 引擎 + 可选 native pager**(npm/-p/CI) |
|
|
106
|
+
| 无 verify Outcome 产品形态 | **Outcome/verify Tier-0** |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 4. 落地状态(本轮)
|
|
111
|
+
|
|
112
|
+
| 项 | 状态 |
|
|
113
|
+
|----|------|
|
|
114
|
+
| `capabilitySurface.ts` 单源 | ✅ |
|
|
115
|
+
| Hydrate 同 live 投影(thinking/outcome) | ✅ |
|
|
116
|
+
| Paint 虚化 + block 预算 | ✅ |
|
|
117
|
+
| **`journalEventLog.ts` 权威 a2p 日志** | ✅ 本轮 |
|
|
118
|
+
| Resume 优先回放 a2p log | ✅ 本轮 |
|
|
119
|
+
| agent jsonl hydrate fallback | ✅ |
|
|
120
|
+
| complete.rs 由 SURFACE 生成 | 📋 下一步(构建时 codegen) |
|
|
121
|
+
| Esc 与 Grok 完全同语义 | ❌ 故意保留 Clavue 取消语义 |
|
|
122
|
+
|
|
123
|
+
### 存储布局(对齐 updates.jsonl 思想)
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
<project>/.clavue/journal/<sessionId>.a2p.jsonl
|
|
127
|
+
{"type":"user.message","payload":{...},"ts":...}
|
|
128
|
+
{"type":"tool.start",...}
|
|
129
|
+
{"type":"assistant.final",...}
|
|
130
|
+
{"type":"outcome.turn",...}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
`/clear` → archive 旧 log;新 UUID 新文件。
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 5. 以后改 shell 的检查清单
|
|
138
|
+
|
|
139
|
+
- [ ] 新 journal 行是否写入 **a2p 类型** 且进 `JOURNAL_LOG_TYPES`?
|
|
140
|
+
- [ ] 新 slash 是否先改 **capabilitySurface**?
|
|
141
|
+
- [ ] resume 路径是否 **log 优先**,jsonl 仅 fallback?
|
|
142
|
+
- [ ] 是否在 pager 里重做了 L2 逻辑?(禁止)
|
|
143
|
+
- [ ] 长会话是否只展开 **near-focus** body?
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 6. 对用户可说的诚实表述
|
|
148
|
+
|
|
149
|
+
**对齐 Grok 的是:信息架构与会话事件真理(journal 块、回放、slash 深度、密度)。**
|
|
150
|
+
**不对齐的是:产品深度(多路由/验证/并行)与部分键位语义(Esc 取消)。**
|
|
151
|
+
**问题多是因为先有引擎后接壳;对齐后用「权威 UI 日志」消掉 hydrate 类复发。**
|
|
@@ -26,3 +26,9 @@ date version clavue_measured_pct clavue_total_pct claim_ok provider_matrix eval_
|
|
|
26
26
|
2026-07-10 10.4.13 96.7 94.3 1 - - - - - clavue
|
|
27
27
|
2026-07-10 10.4.13 96.7 94.3 1 - - - - - clavue
|
|
28
28
|
2026-07-10 10.4.13 96.7 94.3 1 - - - - - clavue
|
|
29
|
+
2026-07-10 10.4.14 96.7 94.3 1 - - - - - clavue
|
|
30
|
+
2026-07-10 10.4.14 96.7 94.3 1 - - - - - clavue
|
|
31
|
+
2026-07-10 10.4.14 96.7 94.3 1 - - - - - clavue
|
|
32
|
+
2026-07-11 10.4.15 96.7 94.3 1 - - - - - clavue
|
|
33
|
+
2026-07-11 10.4.15 96.7 94.3 1 - - - - - clavue
|
|
34
|
+
2026-07-11 10.4.15 96.7 94.3 1 - - - - - clavue
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
| `CLAVUE_UI=ink` | Classic shell |
|
|
46
46
|
| `CLAVUE_LOCALE_PROMPT=1` | Force full locale model-adaptation block |
|
|
47
47
|
| `CLAVUE_PAGER_PARTIALS=0` | Disable stream partials on duplex agent |
|
|
48
|
-
| `CLAVUE_PAGER_COMPACT=
|
|
48
|
+
| `CLAVUE_PAGER_COMPACT=0` | Disable compact journal fold (default is ON) |
|
|
49
49
|
| `CLAVUE_PAGER_BIN` | Pin pager binary path |
|
|
50
50
|
| `CLAVUE_PAGER_OSC8=1` | Opt-in OSC 8 path hyperlinks (default off — layout purity) |
|
|
51
51
|
| `CLAVUE_PAGER_MOUSE=0` | Disable pager mouse capture |
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
7. **Free-form `overview.snapshot` is ephemeral** — never durable wipe of goal / last outcome / workers; use for resume tips only.
|
|
62
62
|
8. **Fail > decoration** — FAILED / Needs Input / route error paint before marketing or empty ready lines.
|
|
63
63
|
9. **Header = identity; sticky = execution** — no model/mode parade duplicated into journal sticky.
|
|
64
|
+
10. **Hydrate = live projection** — resume journal uses the same a2p kinds as live (`user.message` · `assistant.final` · `tool.*` · `thinking.*` · `outcome.turn`). Never a second transcript dialect.
|
|
65
|
+
11. **Paint virtualization** — pager may retain many blocks but must not fully expand off-screen bodies every frame; bound with `MAX_JOURNAL_BLOCKS` + near-focus body expand.
|
|
66
|
+
12. **Capability surface single source** — catalog kinds (`local|agent|ink`) and `/wizard` map come from `capabilitySurface.ts` only. Do not hand-edit parallel lists in slashBridge/complete.rs.
|
|
67
|
+
13. **Authoritative UI event log (Grok updates.jsonl pattern)** — live a2p journal events append to `<cwd>/.clavue/journal/<sessionId>.a2p.jsonl`. Resume **replays this log first**; reverse-parse of agent jsonl is fallback only. See `docs/clavue-vs-grokcli-architecture-alignment.md`.
|
|
64
68
|
|
|
65
69
|
## Tests
|
|
66
70
|
|
package/package.json
CHANGED