okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
78011da
main
1package tui 2 3import ( 4"albedo/cli/internal/daemon" 5 6 tea"charm.land/bubbletea/v2" 7) 8 9// agentsShotModel is agentsFixture's tree without a *testing.T, for the gallery. 10func agentsShotModel (width ,height int )AgentsViewModel { 11m := NewAgentsViewModel (nil ,"lead" ) 12m .Gen = 1 13m .streamReady = true 14m .SetSize (width ,height ) 15lead ,coder := "lead" ,"coder" 16m ,_ = m .Update (agentsSnapshotMsg {Gen :1 ,Root :"lead" ,Nodes : []daemon.AgentNode { 17 {Session : daemon.Session {ID :"lead" ,Title :"lead" ,Model :"gpt-6-luna" },Name :"lead" ,Running :true }, 18 {Session : daemon.Session {ID :"scout" ,Model :"gpt-6-luna" },Parent :& lead ,Name :"scout" ,Depth :1 }, 19 {Session : daemon.Session {ID :"coder" ,Model :"gpt-6-luna" },Parent :& lead ,Name :"coder" ,Depth :1 ,Running :true }, 20 {Session : daemon.Session {ID :"tests" ,Model :"gpt-6-luna" },Parent :& coder ,Name :"tests" ,Depth :2 }, 21 }}) 22return m 23} 24 25// agentsDeleteShot opens the delete question on an agent, then presses keys. 26func agentsDeleteShot (id string ,keys ... tea.KeyPressMsg )func (width ,height int )string { 27return func (width ,height int )string { 28m := agentsShotModel (width ,height ) 29m .selected = id 30m ,_ = m .key (tea.KeyPressMsg {Code :'x' ,Mod :tea .ModCtrl }) 31for _ ,key := range keys { 32m ,_ = m .key (key ) 33 } 34return m .View () 35 } 36} 37 38func init () { 39registerShots ("agents" , 40shotState {"delete-confirm" ,agentsDeleteShot ("coder" )}, 41shotState {"delete-leaf-confirm" ,agentsDeleteShot ("scout" )}, 42shotState {"delete-kept" ,agentsDeleteShot ("coder" , tea.KeyPressMsg {Code :tea .KeyEscape })}, 43 ) 44}