@@ -592,11 +592,19 @@ impl LocalClient {
592592 }
593593
594594 pub async fn create_agent ( & self , agent_id : & str ) -> Result < Value > {
595+ self . create_agent_with_template ( agent_id, None ) . await
596+ }
597+
598+ pub async fn create_agent_with_template (
599+ & self ,
600+ agent_id : & str ,
601+ template : Option < String > ,
602+ ) -> Result < Value > {
595603 self . post_control_json (
596604 & format ! ( "/control/agents/{agent_id}/create" ) ,
597605 & CreateAgentRequest {
598606 authority_class : Some ( AuthorityClass :: OperatorInstruction ) ,
599- template : None ,
607+ template,
600608 } ,
601609 )
602610 . await
@@ -701,6 +709,44 @@ impl LocalClient {
701709 . with_context ( || format ! ( "failed to decode response body for GET {}" , path) )
702710 }
703711
712+ pub async fn templates_catalog ( & self ) -> Result < Value > {
713+ let path = api_path ( "/templates/catalog" ) ;
714+ let body = self . send ( RequestSpec :: get ( & path) , false ) . await ?;
715+ serde_json:: from_slice ( & body)
716+ . with_context ( || format ! ( "failed to decode response body for GET {}" , path) )
717+ }
718+
719+ pub async fn install_template ( & self , github_url : impl Into < String > ) -> Result < Value > {
720+ self . post_control_json (
721+ "/control/templates/install" ,
722+ & crate :: types:: InstallTemplateRequest {
723+ github_url : github_url. into ( ) ,
724+ } ,
725+ )
726+ . await
727+ }
728+
729+ pub async fn remove_template ( & self , template_id : & str ) -> Result < Value > {
730+ self . post_control_json (
731+ "/control/templates/remove" ,
732+ & crate :: types:: RemoveTemplateRequest {
733+ template_id : template_id. to_string ( ) ,
734+ } ,
735+ )
736+ . await
737+ }
738+
739+ pub async fn sync_template_remote_sources ( & self ) -> Result < Value > {
740+ self . post_json (
741+ "/templates/remote-sources/sync" ,
742+ & crate :: types:: SyncTemplateRemoteSourcesRequest {
743+ source_id : None ,
744+ force : false ,
745+ } ,
746+ )
747+ . await
748+ }
749+
704750 pub async fn add_skill ( & self , kind : crate :: types:: SkillInstallKind ) -> Result < Value > {
705751 self . post_control_json (
706752 "/skills/catalog/add" ,
0 commit comments