@@ -653,31 +653,77 @@ const home = (api: TuiPluginApi, input: Cfg) => ({
653653 const skin = look ( ctx . theme . current )
654654 type Prompt = ( props : {
655655 workspaceID ?: string
656+ visible ?: boolean
657+ disabled ?: boolean
658+ onSubmit ?: ( ) => void
656659 hint ?: JSX . Element
660+ right ?: JSX . Element
661+ showPlaceholder ?: boolean
657662 placeholders ?: {
658663 normal ?: string [ ]
659664 shell ?: string [ ]
660665 }
661666 } ) => JSX . Element
662- if ( ! ( "Prompt" in api . ui ) ) return null
663- const view = api . ui . Prompt
664- if ( typeof view !== "function" ) return null
665- const Prompt = view as Prompt
667+ type Slot = (
668+ props : { name : string ; mode ?: unknown ; children ?: JSX . Element } & Record < string , unknown > ,
669+ ) => JSX . Element | null
670+ const ui = api . ui as TuiPluginApi [ "ui" ] & { Prompt : Prompt ; Slot : Slot }
671+ const Prompt = ui . Prompt
672+ const Slot = ui . Slot
666673 const normal = [
667674 `[SMOKE] route check for ${ input . label } ` ,
668675 "[SMOKE] confirm home_prompt slot override" ,
669- "[SMOKE] verify api.ui.Prompt rendering " ,
676+ "[SMOKE] verify prompt-right slot passthrough " ,
670677 ]
671678 const shell = [ "printf '[SMOKE] home prompt\n'" , "git status --short" , "bun --version" ]
672- const Hint = (
679+ const hint = (
673680 < box flexShrink = { 0 } flexDirection = "row" gap = { 1 } >
674681 < text fg = { skin . muted } >
675682 < span style = { { fg : skin . accent } } > •</ span > smoke home prompt
676683 </ text >
677684 </ box >
678685 )
679686
680- return < Prompt workspaceID = { value . workspace_id } hint = { Hint } placeholders = { { normal, shell } } />
687+ return (
688+ < Prompt
689+ workspaceID = { value . workspace_id }
690+ hint = { hint }
691+ right = {
692+ < box flexDirection = "row" gap = { 1 } >
693+ < Slot name = "home_prompt_right" workspace_id = { value . workspace_id } />
694+ < Slot name = "smoke_prompt_right" workspace_id = { value . workspace_id } label = { input . label } />
695+ </ box >
696+ }
697+ placeholders = { { normal, shell } }
698+ />
699+ )
700+ } ,
701+ home_prompt_right ( ctx , value ) {
702+ const skin = look ( ctx . theme . current )
703+ const id = value . workspace_id ?. slice ( 0 , 8 ) ?? "none"
704+ return (
705+ < text fg = { skin . muted } >
706+ < span style = { { fg : skin . accent } } > { input . label } </ span > home:{ id }
707+ </ text >
708+ )
709+ } ,
710+ session_prompt_right ( ctx , value ) {
711+ const skin = look ( ctx . theme . current )
712+ return (
713+ < text fg = { skin . muted } >
714+ < span style = { { fg : skin . accent } } > { input . label } </ span > session:{ value . session_id . slice ( 0 , 8 ) }
715+ </ text >
716+ )
717+ } ,
718+ smoke_prompt_right ( ctx , value ) {
719+ const skin = look ( ctx . theme . current )
720+ const id = typeof value . workspace_id === "string" ? value . workspace_id . slice ( 0 , 8 ) : "none"
721+ const label = typeof value . label === "string" ? value . label : input . label
722+ return (
723+ < text fg = { skin . muted } >
724+ < span style = { { fg : skin . accent } } > { label } </ span > custom:{ id }
725+ </ text >
726+ )
681727 } ,
682728 home_bottom ( ctx ) {
683729 const skin = look ( ctx . theme . current )
0 commit comments