@@ -885,6 +885,40 @@ enum SurfaceCommand {
885885 #[ arg( long) ]
886886 surface : SurfaceId ,
887887 } ,
888+ AgentStart {
889+ #[ arg( long) ]
890+ socket : Option < PathBuf > ,
891+ #[ arg( long) ]
892+ workspace : WorkspaceId ,
893+ #[ arg( long) ]
894+ pane : PaneId ,
895+ #[ arg( long) ]
896+ surface : SurfaceId ,
897+ #[ arg( long) ]
898+ agent : String ,
899+ } ,
900+ AgentStop {
901+ #[ arg( long) ]
902+ socket : Option < PathBuf > ,
903+ #[ arg( long) ]
904+ workspace : WorkspaceId ,
905+ #[ arg( long) ]
906+ pane : PaneId ,
907+ #[ arg( long) ]
908+ surface : SurfaceId ,
909+ #[ arg( long = "exit-status" ) ]
910+ exit_status : i32 ,
911+ } ,
912+ DismissAlert {
913+ #[ arg( long) ]
914+ socket : Option < PathBuf > ,
915+ #[ arg( long) ]
916+ workspace : WorkspaceId ,
917+ #[ arg( long) ]
918+ pane : PaneId ,
919+ #[ arg( long) ]
920+ surface : SurfaceId ,
921+ } ,
888922 Close {
889923 #[ arg( long) ]
890924 socket : Option < PathBuf > ,
@@ -1885,6 +1919,58 @@ async fn main() -> anyhow::Result<()> {
18851919 . await ?;
18861920 println ! ( "{}" , serde_json:: to_string_pretty( & response) ?) ;
18871921 }
1922+ SurfaceCommand :: AgentStart {
1923+ socket,
1924+ workspace,
1925+ pane,
1926+ surface,
1927+ agent,
1928+ } => {
1929+ let client = ControlClient :: new ( resolve_socket_path ( socket) ) ;
1930+ let response = client
1931+ . send ( ControlCommand :: StartSurfaceAgentSession {
1932+ workspace_id : workspace,
1933+ pane_id : pane,
1934+ surface_id : surface,
1935+ agent_kind : agent,
1936+ } )
1937+ . await ?;
1938+ println ! ( "{}" , serde_json:: to_string_pretty( & response) ?) ;
1939+ }
1940+ SurfaceCommand :: AgentStop {
1941+ socket,
1942+ workspace,
1943+ pane,
1944+ surface,
1945+ exit_status,
1946+ } => {
1947+ let client = ControlClient :: new ( resolve_socket_path ( socket) ) ;
1948+ let response = client
1949+ . send ( ControlCommand :: StopSurfaceAgentSession {
1950+ workspace_id : workspace,
1951+ pane_id : pane,
1952+ surface_id : surface,
1953+ exit_status,
1954+ } )
1955+ . await ?;
1956+ println ! ( "{}" , serde_json:: to_string_pretty( & response) ?) ;
1957+ }
1958+ SurfaceCommand :: DismissAlert {
1959+ socket,
1960+ workspace,
1961+ pane,
1962+ surface,
1963+ } => {
1964+ let client = ControlClient :: new ( resolve_socket_path ( socket) ) ;
1965+ let response = client
1966+ . send ( ControlCommand :: DismissSurfaceAlert {
1967+ workspace_id : workspace,
1968+ pane_id : pane,
1969+ surface_id : surface,
1970+ } )
1971+ . await ?;
1972+ println ! ( "{}" , serde_json:: to_string_pretty( & response) ?) ;
1973+ }
18881974 SurfaceCommand :: Close {
18891975 socket,
18901976 workspace,
@@ -3010,7 +3096,7 @@ mod tests {
30103096 "TASKERS_SURFACE_ID" ,
30113097 "TASKERS_TTY_NAME" ,
30123098 "tty 2>/dev/null" ,
3013- "agent-hook notification " ,
3099+ "agent-hook stop " ,
30143100 "--workspace \" $TASKERS_WORKSPACE_ID\" " ,
30153101 "--pane \" $TASKERS_PANE_ID\" " ,
30163102 "--surface \" $TASKERS_SURFACE_ID\" " ,
0 commit comments