@@ -20,7 +20,7 @@ import {
2020 attachSessionBridge ,
2121 createRecordingPort ,
2222} from "./runtime-bridge.js"
23- import { makeObserveFixture } from "./residuals.js"
23+ import type { ObserveSession } from "./residuals.js"
2424import {
2525 openModelPickerOverlay ,
2626 openOperatorOverlay ,
@@ -32,15 +32,55 @@ import {
3232 createAppShell ,
3333 enterSubagentObserve ,
3434 openHelpOverlay ,
35+ openListOverlay ,
3536 openMentionsOverlay ,
36- openPluginsOverlay ,
37- openResumeOverlay ,
3837 openSettingsOverlay ,
3938 paintChrome ,
4039 setChromeZones ,
4140 setShellRunState ,
4241} from "./shell.js"
4342
43+ /** Demo-only rows: never shipped, just something to look at in `s`/`l`/`e`/`n`. */
44+ const DEMO_SETTINGS_ITEMS : readonly string [ ] = [
45+ "Permissions — revoke remembered approvals" ,
46+ "Compaction — summarize vs drop" ,
47+ "Session mode — auto / ask / plan" ,
48+ "Close settings" ,
49+ ]
50+
51+ const DEMO_PLUGINS_ITEMS : readonly string [ ] = [
52+ "plugin:linear — enabled" ,
53+ "plugin:github — needs trust" ,
54+ "Close plugins" ,
55+ ]
56+
57+ const DEMO_RESUME_ITEMS : readonly string [ ] = [
58+ "Fix permissions overflow · 2h ago · idle" ,
59+ "Wave 6 palette work · yesterday · done" ,
60+ "Close resume" ,
61+ ]
62+
63+ const DEMO_MENTION_ITEMS : readonly string [ ] = [
64+ "@src/tui-opentui/shell.ts" ,
65+ "@AGENTS.md" ,
66+ "Close mentions" ,
67+ ]
68+
69+ function demoObserveSession ( ) : ObserveSession {
70+ return {
71+ sessionId : "child-1" ,
72+ agentId : "explore" ,
73+ description : "map callers of openListOverlay" ,
74+ lines : [
75+ { role : "system" , text : "— child session explore —" } ,
76+ { role : "user" , text : "find every openListOverlay caller" } ,
77+ { role : "assistant" , text : "Searching src/tui-opentui…" } ,
78+ { role : "tool" , text : "grep openListOverlay → 6 hits" , meta : "tool.done" } ,
79+ { role : "assistant" , text : "Report ready for parent." } ,
80+ ] ,
81+ }
82+ }
83+
4484if ( ! process . stdout . isTTY ) {
4585 console . error ( "demo requires a TTY (stdout is not a terminal)" )
4686 process . exit ( 1 )
@@ -163,7 +203,7 @@ renderer.keyInput.on("keypress", (key: KeyEvent) => {
163203 ! key . meta &&
164204 shell . prompt . value . length === 0
165205 ) {
166- openSettingsOverlay ( shell )
206+ openSettingsOverlay ( shell , { items : DEMO_SETTINGS_ITEMS } )
167207 return
168208 }
169209
@@ -183,7 +223,12 @@ renderer.keyInput.on("keypress", (key: KeyEvent) => {
183223 ! key . meta &&
184224 shell . prompt . value . length === 0
185225 ) {
186- openPluginsOverlay ( shell )
226+ openListOverlay ( shell , {
227+ kind : "plugins" ,
228+ title : "plugins" ,
229+ items : DEMO_PLUGINS_ITEMS ,
230+ frameId : "overlay-plugins" ,
231+ } )
187232 return
188233 }
189234
@@ -193,7 +238,12 @@ renderer.keyInput.on("keypress", (key: KeyEvent) => {
193238 ! key . meta &&
194239 shell . prompt . value . length === 0
195240 ) {
196- openResumeOverlay ( shell )
241+ openListOverlay ( shell , {
242+ kind : "resume" ,
243+ title : "resume session" ,
244+ items : DEMO_RESUME_ITEMS ,
245+ frameId : "overlay-resume" ,
246+ } )
197247 return
198248 }
199249
@@ -203,7 +253,7 @@ renderer.keyInput.on("keypress", (key: KeyEvent) => {
203253 ! key . meta &&
204254 shell . prompt . value . length === 0
205255 ) {
206- openMentionsOverlay ( shell )
256+ openMentionsOverlay ( shell , { items : DEMO_MENTION_ITEMS } )
207257 return
208258 }
209259
@@ -213,7 +263,7 @@ renderer.keyInput.on("keypress", (key: KeyEvent) => {
213263 ! key . meta &&
214264 shell . prompt . value . length === 0
215265 ) {
216- enterSubagentObserve ( shell , makeObserveFixture ( ) )
266+ enterSubagentObserve ( shell , demoObserveSession ( ) )
217267 return
218268 }
219269
0 commit comments