Commit 406db90
Evals TUI tree traversal (#2100)
# why
# what changed
# test plan
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Unifies the Evals TUI/CLI behind a shared command tree with path-style
traversal and contextual help. Supports Linear STG-1880 and fixes root
fallback parsing by stripping a leading `evals` sigil to improve
onboarding and command discovery.
- **New Features**
- Single `buildCommandTree` powers both REPL and argv dispatch.
- `>` works as a path separator in REPL and argv; REPL preserves quoted
`>`, argv re-splits any arg containing `>`.
- Context navigation and prompt: `..` goes up; bare `evals` jumps to
root; invoking a node with children auto-enters that context in REPL;
prompt shows the current path; banner mentions `..`.
- Help routing: `--help` after a leaf calls that node’s help; `help`
shows help for the current context.
- Root fallback: unknown tokens at root call `run` and now strip a
leading `evals` before forwarding (e.g., `evals act`); unknown at depth
errors for clarity.
- REPL quality of life: Esc pops context when idle; Esc still aborts
in-flight runs (cooperative/double-press aggressive).
- **Refactors**
- `cli.ts` and `repl.ts` now resolve and execute via `dispatch` from the
shared command tree; added `tokenizeArgv` for argv `>` splitting and
`renderPrompt` for context-aware prompts.
- Moved line tokenization to `tui/tokenize.ts`; added
`tui/commandTree.ts` with resolution, prompt rendering, and argv
tokenization.
- Kept command handlers lazy-loaded; added focused tests for the tree,
`>` chaining, argv sigil handling, and CLI edge cases.
<sup>Written for commit 2f5c929.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Chromie <miguel@browserbase.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent ffb9b20 commit 406db90
7 files changed
Lines changed: 1244 additions & 248 deletions
File tree
- packages/evals
- tests
- tui
- tui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 64 | | |
71 | 65 | | |
72 | 66 | | |
| |||
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | 120 | | |
153 | 121 | | |
154 | 122 | | |
155 | 123 | | |
156 | 124 | | |
157 | 125 | | |
158 | 126 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
177 | 130 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
187 | 134 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 135 | + | |
192 | 136 | | |
| 137 | + | |
| 138 | + | |
193 | 139 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
230 | 152 | | |
231 | 153 | | |
232 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
242 | 265 | | |
243 | 266 | | |
244 | 267 | | |
| |||
0 commit comments