@yahyahammad/venastine 0.1.0 → 0.3.8
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/.env.example +19 -14
- package/CONFIG_ARCHITECTURE.md +2002 -0
- package/NOTICE +1 -1
- package/README.md +249 -93
- package/agents/builtin/build.md +73 -0
- package/agents/builtin/general.md +80 -0
- package/agents/builtin/plan.md +23 -5
- package/agents/builtin/test.md +65 -0
- package/agents/builtin/writer.md +67 -0
- package/agents/manager.py +261 -195
- package/agents/subagent_tool.py +280 -23
- package/agents/tui_commands.py +31 -21
- package/bin/venastine.mjs +528 -382
- package/bin/venastine.py +71 -0
- package/cli_commands.py +835 -0
- package/config.py +95 -1198
- package/config.yaml +1090 -0
- package/config_edit.py +1301 -0
- package/config_schema.py +966 -0
- package/config_update.py +749 -0
- package/core/agent_activity.py +256 -0
- package/core/ansi.py +452 -0
- package/core/approval.py +27 -5
- package/core/call_view.py +364 -0
- package/core/cancel.py +121 -0
- package/core/chatgpt_auth.py +747 -0
- package/core/claims_view.py +107 -0
- package/core/client.py +1249 -82
- package/core/commands.py +454 -0
- package/core/compaction.py +1735 -959
- package/core/config_loader.py +516 -97
- package/core/connect.py +686 -0
- package/core/events.py +68 -6
- package/core/file_mentions.py +280 -0
- package/core/interaction.py +87 -4
- package/core/line_pattern.py +128 -0
- package/core/loop.py +2566 -1353
- package/core/memory.py +482 -370
- package/core/pipeline_models.py +23 -9
- package/core/provider_errors.py +234 -0
- package/core/reasoning/confidence_scoring.py +70 -54
- package/core/reasoning/json_retry.py +19 -1
- package/core/reasoning/orchestrator.py +232 -53
- package/core/reasoning/output_writer.py +90 -31
- package/core/reasoning/payload_validation.py +133 -7
- package/core/reasoning/pipeline_storage.py +427 -361
- package/core/reasoning/review.py +659 -615
- package/core/reasoning/scholar.py +38 -14
- package/core/reasoning/source_corpus.py +110 -4
- package/core/replay.py +315 -167
- package/core/session.py +36 -12
- package/core/session_view.py +259 -0
- package/core/session_wake.py +259 -0
- package/core/shell_sessions.py +1553 -0
- package/core/workspace_trust.py +1 -1
- package/credentials.py +308 -180
- package/database.py +82 -1
- package/{PRIVACY.md → docs/PRIVACY.md} +19 -7
- package/docs/SECURITY.md +108 -0
- package/docs/THIRD_PARTY_NOTICES.md +148 -0
- package/env_secrets.py +118 -77
- package/json_store.py +236 -16
- package/logging_setup.py +121 -11
- package/main.py +1672 -198
- package/mcp_client/client.py +257 -23
- package/mcp_client/config.py +484 -379
- package/mcp_client/registration.py +163 -2
- package/memories/manager.py +15 -0
- package/memories/tui_commands.py +21 -14
- package/package.json +303 -73
- package/project_init/config_files.py +4 -0
- package/project_init/generator.py +201 -37
- package/project_init/manifest.py +418 -406
- package/project_init/tui_commands.py +7 -4
- package/prompts/revalidate.md +1 -1
- package/prompts/revise.md +17 -15
- package/prompts/system_prompts.py +64 -10
- package/providers.json.example +94 -92
- package/pyproject.toml +149 -100
- package/requirements.txt +252 -29
- package/safety/policy_enforcement.py +1082 -682
- package/security/askpass.py +419 -0
- package/security/capability.py +37 -7
- package/security/confine.py +484 -0
- package/security/hosted.py +182 -0
- package/security/permissions.py +54 -7
- package/security/posture.py +124 -12
- package/security/protected_paths.py +198 -6
- package/security/sandbox.py +3262 -139
- package/security/secrets.py +855 -0
- package/skills/tui_commands.py +3 -4
- package/storage.py +1338 -1005
- package/tools/base.py +465 -305
- package/tools/builtin/_math_common.py +306 -16
- package/tools/builtin/_net_common.py +267 -61
- package/tools/builtin/arxiv.py +681 -223
- package/tools/builtin/ask_user.py +231 -213
- package/tools/builtin/discrete_math.py +35 -4
- package/tools/builtin/fetch_url.py +239 -21
- package/tools/builtin/file_ops.py +341 -33
- package/tools/builtin/geometry.py +184 -148
- package/tools/builtin/get_time.py +2 -2
- package/tools/builtin/linear_algebra.py +66 -23
- package/tools/builtin/load_skill.py +10 -0
- package/tools/builtin/logic.py +171 -12
- package/tools/builtin/pin.py +46 -12
- package/tools/builtin/probability_stats.py +224 -228
- package/tools/builtin/project_docs.py +80 -21
- package/tools/builtin/remember.py +21 -4
- package/tools/builtin/shell.py +586 -67
- package/tools/builtin/shell_sessions.py +613 -0
- package/tools/builtin/symbolic_math.py +80 -10
- package/tools/builtin/todo.py +5 -3
- package/tools/builtin/web_search.py +329 -151
- package/tools/context.py +23 -0
- package/tools/isolation.py +387 -314
- package/tools/registry.py +374 -29
- package/tui/app.py +5281 -397
- package/tui/app.tcss +290 -9
- package/tui/commands.py +26 -61
- package/tui/diffs.py +286 -265
- package/tui/history.py +128 -0
- package/tui/hosted_driver.py +102 -0
- package/tui/markdown.py +1329 -0
- package/tui/meters.py +364 -0
- package/tui/screens.py +346 -92
- package/tui/themes.py +599 -366
- package/tui/widgets.py +2673 -116
- package/SECURITY.md +0 -88
- package/THIRD_PARTY_NOTICES.md +0 -100
package/tui/app.tcss
CHANGED
|
@@ -5,10 +5,40 @@
|
|
|
5
5
|
width: 1fr;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/* IT SCROLLS, because a Vertical does not (batch 59). Textual's Vertical
|
|
9
|
+
is `overflow: hidden hidden`, so the sidebar silently dropped whatever
|
|
10
|
+
did not fit. Measured at the 24-row floor with a todo list and a
|
|
11
|
+
research run both live: `max_scroll_y` was 11 -- eleven rows the
|
|
12
|
+
container had already computed and clipped anyway -- #todo-panel lost
|
|
13
|
+
three rows and #research-progress was ENTIRELY off screen, its header
|
|
14
|
+
drawn on the last visible row with its whole body gone.
|
|
15
|
+
|
|
16
|
+
`overflow-y` on the CONTAINER, not a swap to VerticalScroll. That class
|
|
17
|
+
is `can_focus=True` and binds up/down/home/end/pageup/pagedown, which
|
|
18
|
+
would add a tab stop and take the arrows batch 55 gave the suggestion
|
|
19
|
+
panel. The trade, named rather than discovered later: this scrolls by
|
|
20
|
+
wheel and not by keyboard. EP3's sibling rule (a consent surface must
|
|
21
|
+
not be mouse-only) does not reach here -- no decision is made in the
|
|
22
|
+
sidebar, and every figure in it is also said in the transcript.
|
|
23
|
+
|
|
24
|
+
`scrollbar-size-vertical: 1` because the budget is tiny. Measured: 19
|
|
25
|
+
usable columns when everything fits, 18 while the bar is up, against 17
|
|
26
|
+
at textual's default 2. The width is CONDITIONAL either way -- widgets
|
|
27
|
+
reflow by a column when the bar appears. */
|
|
8
28
|
#sidebar {
|
|
9
29
|
width: 22;
|
|
10
30
|
border-left: solid $panel;
|
|
11
31
|
padding: 1;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
scrollbar-size-vertical: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Section 47. The switcher holding the live transcript and the read-only
|
|
37
|
+
view. Both children stay mounted; only `current` changes -- which is what
|
|
38
|
+
lets a running turn keep writing to the live pane while a stored thread is
|
|
39
|
+
on screen, with nothing to buffer and nothing to flush on the way back. */
|
|
40
|
+
#pane {
|
|
41
|
+
height: 1fr;
|
|
12
42
|
}
|
|
13
43
|
|
|
14
44
|
#transcript {
|
|
@@ -17,9 +47,118 @@
|
|
|
17
47
|
padding: 0 1;
|
|
18
48
|
}
|
|
19
49
|
|
|
50
|
+
/* The accent border is the whole affordance: at a glance this is not the
|
|
51
|
+
conversation you are having. The prompt is disabled underneath it, so the
|
|
52
|
+
read-only rule is visible rather than merely true. */
|
|
53
|
+
#thread-view {
|
|
54
|
+
height: 1fr;
|
|
55
|
+
border: solid $accent;
|
|
56
|
+
padding: 0 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* The lineage trail. `height: auto` and hidden until the viewer opens, so
|
|
60
|
+
the live conversation costs no row for a trail it does not need -- the
|
|
61
|
+
GoalBanner rule, which every conditional row in #main follows. */
|
|
62
|
+
/* ROADMAP_v3 §49 (SS14). THE SAME BOX as #transcript and #thread-view --
|
|
63
|
+
`border: solid` and `padding: 0 1` -- and that is load-bearing rather
|
|
64
|
+
than tidy: a hidden pane measures 0 and borrows the on-screen pane's
|
|
65
|
+
width (Transcript._region_width), so four panes that are not the same
|
|
66
|
+
box would each write at another one's width. The accent border is
|
|
67
|
+
#thread-view's affordance, for #thread-view's reason: at a glance this
|
|
68
|
+
is not the conversation you are having. */
|
|
69
|
+
#session-view {
|
|
70
|
+
height: 1fr;
|
|
71
|
+
border: solid $accent;
|
|
72
|
+
padding: 0 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ROADMAP_v3 §55 (TR10). One tool call: the whole command and what it
|
|
76
|
+
printed. The FOURTH pane, and the same box for the paragraph above --
|
|
77
|
+
`test_the_panes_measure_the_same_width_when_shown` holds that, and a
|
|
78
|
+
different gutter here would silently rewrap every row the live
|
|
79
|
+
transcript wrote while this one was up. Accent border, same reason:
|
|
80
|
+
this is not the conversation you are having. */
|
|
81
|
+
#call-view {
|
|
82
|
+
height: 1fr;
|
|
83
|
+
border: solid $accent;
|
|
84
|
+
padding: 0 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#thread-crumb {
|
|
88
|
+
height: auto;
|
|
89
|
+
padding: 0 1;
|
|
90
|
+
/* One line, elided rather than wrapped: a trail that reflowed
|
|
91
|
+
would take a second row from the transcript below it. The
|
|
92
|
+
ellipsis is the point -- the segment you are standing on is
|
|
93
|
+
the last one, so the cut belongs at the far end. Moved off
|
|
94
|
+
the Rich Text for `#agent-panel`'s reason. */
|
|
95
|
+
text-wrap: nowrap;
|
|
96
|
+
text-overflow: ellipsis;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Batch 55, the slash-command suggestions. Directly above the prompt
|
|
100
|
+
because it is the last child in #main's flow and #prompt is docked out
|
|
101
|
+
of that flow -- so it opens UPWARDS with no layer and no offset.
|
|
102
|
+
|
|
103
|
+
`height: auto` with a `max-height` again, and the cap is arithmetic:
|
|
104
|
+
SUGGEST_MAX_ROWS is 8, plus two border rows is 10, which at the 24-row
|
|
105
|
+
floor leaves the transcript nine rows while the panel is up. The widget
|
|
106
|
+
budgets itself to those 8 rows, so the cap is a backstop rather than a
|
|
107
|
+
clip -- if it ever clips, the budget is wrong.
|
|
108
|
+
|
|
109
|
+
No `overflow-y`. A panel that scrolled would be a second thing to
|
|
110
|
+
navigate inside a thing being navigated. */
|
|
111
|
+
#slash-suggest {
|
|
112
|
+
height: auto;
|
|
113
|
+
max-height: 10;
|
|
114
|
+
border: solid $primary;
|
|
115
|
+
padding: 0 1;
|
|
116
|
+
/* The count, `4 of 26 - /help for all`. Muted for #prompt's reason:
|
|
117
|
+
it is a hint about the list, not a heading over it. */
|
|
118
|
+
border-title-color: $text-muted;
|
|
119
|
+
/* Batch 62's key hints, on the bottom border. STATED, and measured
|
|
120
|
+
rather than assumed: an unstyled subtitle renders in $primary --
|
|
121
|
+
the border's own green -- so without this the hint would be
|
|
122
|
+
brighter than the count above it on the same box, and the less
|
|
123
|
+
important of the two labels would be the louder one. No
|
|
124
|
+
`border-subtitle-align`: textual already defaults a subtitle to
|
|
125
|
+
the right, which is the corner #prompt's meter uses one box
|
|
126
|
+
down, so titles sit left and status sits right throughout. */
|
|
127
|
+
border-subtitle-color: $text-muted;
|
|
128
|
+
/* `render()` pads every row to the panel width itself, and the
|
|
129
|
+
pin on that arithmetic is a test that no drawn row is wider
|
|
130
|
+
than the panel. This is the net under it, moved off the Rich
|
|
131
|
+
Text for `#agent-panel`'s reason: a row that ever does
|
|
132
|
+
overrun clips visibly instead of reflowing into a height the
|
|
133
|
+
budget did not count. */
|
|
134
|
+
text-wrap: nowrap;
|
|
135
|
+
text-overflow: clip;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Batch 54. `height: auto` with a `max-height` -- batch 49's shape, for
|
|
139
|
+
batch 49's reason. A definite height would reserve four rows whether or
|
|
140
|
+
not anything is typed, and this box's whole point is that it is one row
|
|
141
|
+
until it isn't; auto also means the transcript gets those rows back the
|
|
142
|
+
moment a turn is submitted. The cap is what stops a pasted essay from
|
|
143
|
+
eating the transcript: 6 is the border plus four text rows, so a fully
|
|
144
|
+
extended prompt still leaves 18 of the 24-row floor above it, and past
|
|
145
|
+
four rows the box scrolls instead of growing.
|
|
146
|
+
|
|
147
|
+
`padding: 0 1` is stated rather than inherited. TextArea's own default
|
|
148
|
+
is `0 1` and the Input this replaced was `0 2`; naming it is what keeps
|
|
149
|
+
the typed text's left edge where a reader already has it. */
|
|
20
150
|
#prompt {
|
|
21
151
|
dock: bottom;
|
|
22
152
|
border: solid $primary;
|
|
153
|
+
height: auto;
|
|
154
|
+
max-height: 6;
|
|
155
|
+
padding: 0 1;
|
|
156
|
+
/* The placeholder, carried by the border title rather than TextArea's
|
|
157
|
+
native in-box one (assigning both drew it twice). Muted
|
|
158
|
+
is already this sheet's vocabulary for a hint (#usage-line,
|
|
159
|
+
#todo-panel, #research-progress), so it reads as one rather than
|
|
160
|
+
as a heading. */
|
|
161
|
+
border-title-color: $text-muted;
|
|
23
162
|
}
|
|
24
163
|
|
|
25
164
|
#raven {
|
|
@@ -38,6 +177,37 @@
|
|
|
38
177
|
padding: 1 0 0 0;
|
|
39
178
|
}
|
|
40
179
|
|
|
180
|
+
/* Batch 59's agent stack. Auto height and hidden until there is an active
|
|
181
|
+
agent or a running spawn, so it costs no rows in the ordinary case --
|
|
182
|
+
the same shape #posture-badge and #usage-line already use. No colours
|
|
183
|
+
here: the panel renders through Rich styles resolved per draw
|
|
184
|
+
(role_styles), which is what makes /theme reach it. */
|
|
185
|
+
#agent-panel {
|
|
186
|
+
height: auto;
|
|
187
|
+
padding-top: 1;
|
|
188
|
+
/* The rows are sized by the widget (AgentPanel.WIDTH lays out
|
|
189
|
+
against 18) and must not be re-wrapped underneath it: a
|
|
190
|
+
miscalculation should clip where it can be seen rather than
|
|
191
|
+
reflow where it cannot. This used to be `no_wrap` /
|
|
192
|
+
`overflow` on the Rich Text itself, which stopped meaning
|
|
193
|
+
anything when the textual pin moved -- a Content carries
|
|
194
|
+
neither flag and the conversion drops both. See
|
|
195
|
+
`widgets.as_content`. */
|
|
196
|
+
text-wrap: nowrap;
|
|
197
|
+
text-overflow: clip;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* ROADMAP_v3 §49 (SS14). The same box as #agent-panel above, because it is
|
|
201
|
+
the same kind of widget in the same twenty columns: rows sized by the
|
|
202
|
+
widget (SessionPanel.WIDTH, which is AgentPanel.WIDTH) and clipped rather
|
|
203
|
+
than reflowed, for that block's reason. */
|
|
204
|
+
#session-panel {
|
|
205
|
+
height: auto;
|
|
206
|
+
padding-top: 1;
|
|
207
|
+
text-wrap: nowrap;
|
|
208
|
+
text-overflow: clip;
|
|
209
|
+
}
|
|
210
|
+
|
|
41
211
|
#effort-raven {
|
|
42
212
|
height: 2;
|
|
43
213
|
color: $secondary;
|
|
@@ -52,13 +222,24 @@
|
|
|
52
222
|
color: $text-muted;
|
|
53
223
|
}
|
|
54
224
|
|
|
55
|
-
/* §22 live research view. Auto height so it takes no sidebar space
|
|
56
|
-
|
|
57
|
-
|
|
225
|
+
/* §22 live research view. Auto height so it takes no sidebar space until
|
|
226
|
+
a run starts.
|
|
227
|
+
|
|
228
|
+
THE CAP AND THE OVERFLOW ARE GONE (batch 59), and they were EP3's trap
|
|
229
|
+
a second time. `Static` + `max-height` + `overflow-y: auto` reads as
|
|
230
|
+
"clip it and let them scroll" and does neither: a Static's
|
|
231
|
+
`virtual_size` follows its clamped box rather than its text, so
|
|
232
|
+
`max_scroll_y` was 0 and the rows past the bound were not below the
|
|
233
|
+
fold, they were gone. Measured here at one lost row with twenty passes
|
|
234
|
+
and twelve claims; measured in tui/screens.py at nine lines in a
|
|
235
|
+
seven-row block, which is the ScrollBox that fixed it there.
|
|
236
|
+
|
|
237
|
+
The fix is the same shape: the bound belongs on a real scroll
|
|
238
|
+
container, and #sidebar is now one. What still bounds this panel is
|
|
239
|
+
ResearchProgress.ROWS -- a window over the passes, which is the half of
|
|
240
|
+
that comment that was always true. */
|
|
58
241
|
#research-progress {
|
|
59
242
|
height: auto;
|
|
60
|
-
max-height: 20;
|
|
61
|
-
overflow-y: auto;
|
|
62
243
|
padding-top: 1;
|
|
63
244
|
color: $text-muted;
|
|
64
245
|
}
|
|
@@ -71,12 +252,23 @@ PermissionScreen {
|
|
|
71
252
|
screen had both a type selector and an id block for its dialog, and
|
|
72
253
|
five of nine never got the first -- they measured at x=0, y=0, pinned
|
|
73
254
|
to the top-left corner of an 80x24 terminal. The viewport test in
|
|
74
|
-
tests/test_tui.py pushes
|
|
255
|
+
tests/test_tui.py pushes every modal the app defines; until batch 179
|
|
256
|
+
it pushed only the ones its table listed, and SecretScreen, which came
|
|
257
|
+
later and missed both the row and this rule, opened every masked
|
|
258
|
+
prompt in the corner. */
|
|
75
259
|
|
|
76
260
|
GrantPickerScreen {
|
|
77
261
|
align: center middle;
|
|
78
262
|
}
|
|
79
263
|
|
|
264
|
+
SecretScreen {
|
|
265
|
+
align: center middle;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
NoticeScreen {
|
|
269
|
+
align: center middle;
|
|
270
|
+
}
|
|
271
|
+
|
|
80
272
|
SubagentSignoffScreen {
|
|
81
273
|
align: center middle;
|
|
82
274
|
}
|
|
@@ -136,6 +328,25 @@ ReviewScreen {
|
|
|
136
328
|
margin-bottom: 1;
|
|
137
329
|
}
|
|
138
330
|
|
|
331
|
+
/* Section 47. Which run raised the question, when it was not the
|
|
332
|
+
conversation itself. Muted and unbold: it qualifies the title rather
|
|
333
|
+
than competing with it, and it sits directly under it because RA6
|
|
334
|
+
reads a harness fact before anything the agent wrote.
|
|
335
|
+
|
|
336
|
+
It eats the title's margin, so the pair reads as one heading rather
|
|
337
|
+
than as two blocks -- which is what the margin exists to separate.
|
|
338
|
+
|
|
339
|
+
ONE ID ACROSS THE THREE MODALS that can be asked from inside a run
|
|
340
|
+
(batch 75: the sign-off and the model's own question joined the
|
|
341
|
+
permission prompt). Ids are per-screen, so one rule styles all three
|
|
342
|
+
and there is nothing to keep in step -- the same reason
|
|
343
|
+
`screens.asker_label` is one function. */
|
|
344
|
+
#permission-asker {
|
|
345
|
+
color: $text-muted;
|
|
346
|
+
margin-top: -1;
|
|
347
|
+
margin-bottom: 1;
|
|
348
|
+
}
|
|
349
|
+
|
|
139
350
|
/* The pinned subject of the question (§46, EP1), and the split
|
|
140
351
|
favours it deliberately: the payload below repeats the notice, the
|
|
141
352
|
reason and the command itself, so rows spent here buy the one thing
|
|
@@ -308,6 +519,72 @@ ClaimsScreen {
|
|
|
308
519
|
margin-bottom: 1;
|
|
309
520
|
}
|
|
310
521
|
|
|
522
|
+
/* Section 47's run picker, the keyboard route to what the sidebar
|
|
523
|
+
offers on a click. Narrower than the thread picker because its rows
|
|
524
|
+
are agent names and an indent rather than a uuid plus a preview,
|
|
525
|
+
and it takes the accent border the read-only pane takes: both say
|
|
526
|
+
the same thing, that what you are about to look at is not the
|
|
527
|
+
conversation you are having. */
|
|
528
|
+
#agent-picker-dialog {
|
|
529
|
+
width: 48;
|
|
530
|
+
height: auto;
|
|
531
|
+
max-height: 20;
|
|
532
|
+
padding: 1 2;
|
|
533
|
+
border: thick $accent;
|
|
534
|
+
background: $surface;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
#agent-picker-title {
|
|
538
|
+
text-style: bold;
|
|
539
|
+
padding-bottom: 1;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
#agent-picker-list {
|
|
543
|
+
height: auto;
|
|
544
|
+
max-height: 14;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/* Finished runs read muted. They open like any other row, so this is
|
|
548
|
+
de-emphasis rather than a warning -- and a muted hue rather than the
|
|
549
|
+
`dim` attribute, which is the transcript's vocabulary (test_themes
|
|
550
|
+
pins it to the system role) while this list is a modal, where
|
|
551
|
+
UNVERIFIED_COVERAGE already set the precedent that quiet names a
|
|
552
|
+
different state rather than a broken one. */
|
|
553
|
+
#agent-picker-list .finished {
|
|
554
|
+
color: $text-muted;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
AgentPickerScreen {
|
|
558
|
+
align: center middle;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/* ROADMAP_v3 §49 (SS2): the kill picker. Wider than the run picker
|
|
562
|
+
because its rows carry a command as well as a name, and a command cut
|
|
563
|
+
at 48 columns is exactly the "which one is this?" the picker exists to
|
|
564
|
+
answer. */
|
|
565
|
+
#session-kill-dialog {
|
|
566
|
+
width: 72;
|
|
567
|
+
height: auto;
|
|
568
|
+
max-height: 20;
|
|
569
|
+
padding: 1 2;
|
|
570
|
+
border: thick $accent;
|
|
571
|
+
background: $surface;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
#session-kill-title {
|
|
575
|
+
text-style: bold;
|
|
576
|
+
padding-bottom: 1;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
#session-kill-list {
|
|
580
|
+
height: auto;
|
|
581
|
+
max-height: 14;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
SessionKillScreen {
|
|
585
|
+
align: center middle;
|
|
586
|
+
}
|
|
587
|
+
|
|
311
588
|
#thread-dialog {
|
|
312
589
|
width: 70;
|
|
313
590
|
height: auto;
|
|
@@ -448,11 +725,15 @@ QuestionScreen {
|
|
|
448
725
|
|
|
449
726
|
/* §23 slice 2's checklist. `height: auto` so an empty list costs no rows in
|
|
450
727
|
whichever slot tui.todo_position put it in -- the widget hides itself, and
|
|
451
|
-
this is what makes the unused slots free.
|
|
728
|
+
this is what makes the unused slots free.
|
|
729
|
+
|
|
730
|
+
No `max-height`, no `overflow-y`: see #research-progress for why that
|
|
731
|
+
pairing on a Static clips rather than scrolls (batch 59, EP3's trap).
|
|
732
|
+
TodoPanel.ROWS is the bound. This panel also sits in the `top` and
|
|
733
|
+
`bottom` slots inside #main, where nothing scrolls at all -- one more
|
|
734
|
+
reason its own height must be honest rather than clamped. */
|
|
452
735
|
#todo-panel {
|
|
453
736
|
height: auto;
|
|
454
|
-
max-height: 14;
|
|
455
|
-
overflow-y: auto;
|
|
456
737
|
padding: 0 1;
|
|
457
738
|
color: $text-muted;
|
|
458
739
|
}
|
package/tui/commands.py
CHANGED
|
@@ -1,61 +1,26 @@
|
|
|
1
|
-
"""
|
|
2
|
-
tui/commands.py
|
|
3
|
-
|
|
4
|
-
ROADMAP_v2 §16 slash-command registry.
|
|
5
|
-
|
|
6
|
-
The registry is §16's; the commands registered into it are not all §16's.
|
|
7
|
-
D7 assigns `/skill <name>` to §19, and §18/§21 add their own -- each
|
|
8
|
-
registers here rather than editing a match statement in the app, which is
|
|
9
|
-
the same mechanism-vs-policy split tools/registry.py already uses for
|
|
10
|
-
tools.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class CommandRegistry:
|
|
29
|
-
def __init__(self) -> None:
|
|
30
|
-
self._commands: dict[str, SlashCommand] = {}
|
|
31
|
-
|
|
32
|
-
def register(self, command: SlashCommand) -> None:
|
|
33
|
-
self._commands[command.name] = command
|
|
34
|
-
|
|
35
|
-
def get(self, name: str) -> Optional[SlashCommand]:
|
|
36
|
-
return self._commands.get(name)
|
|
37
|
-
|
|
38
|
-
def names(self) -> list[str]:
|
|
39
|
-
return sorted(self._commands)
|
|
40
|
-
|
|
41
|
-
def all(self) -> list[SlashCommand]:
|
|
42
|
-
return [self._commands[n] for n in self.names()]
|
|
43
|
-
|
|
44
|
-
def dispatch(self, app, raw: str) -> bool:
|
|
45
|
-
"""Run the command in `raw` (a line starting with '/').
|
|
46
|
-
|
|
47
|
-
Returns True if a command handled the line, False if the name is
|
|
48
|
-
unknown -- the caller decides what to do about it. Unknown names are
|
|
49
|
-
NOT sent to the model: a mistyped slash command should say so, not
|
|
50
|
-
silently become a chat turn that burns a request.
|
|
51
|
-
"""
|
|
52
|
-
stripped = raw[1:].strip()
|
|
53
|
-
name, _, args = stripped.partition(" ")
|
|
54
|
-
command = self.get(name.lower())
|
|
55
|
-
if command is None:
|
|
56
|
-
return False
|
|
57
|
-
command.handler(app, args.strip())
|
|
58
|
-
return True
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
registry = CommandRegistry()
|
|
1
|
+
"""
|
|
2
|
+
tui/commands.py
|
|
3
|
+
|
|
4
|
+
ROADMAP_v2 §16 slash-command registry -- the TUI's.
|
|
5
|
+
|
|
6
|
+
The registry is §16's; the commands registered into it are not all §16's.
|
|
7
|
+
D7 assigns `/skill <name>` to §19, and §18/§21 add their own -- each
|
|
8
|
+
registers here rather than editing a match statement in the app, which is
|
|
9
|
+
the same mechanism-vs-policy split tools/registry.py already uses for
|
|
10
|
+
tools.
|
|
11
|
+
|
|
12
|
+
Since ROADMAP_v3 §89 (#8) the MECHANISM lives in `core/commands.py`, beside
|
|
13
|
+
the catalog both shells bind to, because the CLI binds to it too and must
|
|
14
|
+
not import from `tui/` to do so. This module is the TUI's registry
|
|
15
|
+
instance: it takes only what the catalog declares for the TUI, built with
|
|
16
|
+
`bind()`.
|
|
17
|
+
|
|
18
|
+
A handler takes (app, argument_string) and returns None. It runs on the UI
|
|
19
|
+
thread, so anything slow belongs in a worker.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from core.commands import TUI, CommandRegistry, SlashCommand, bind
|
|
23
|
+
|
|
24
|
+
__all__ = ["CommandRegistry", "SlashCommand", "bind", "registry"]
|
|
25
|
+
|
|
26
|
+
registry = CommandRegistry(TUI)
|