@@ -647,6 +647,144 @@ pub struct ProviderInventoryEntryDto {
647647#[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
648648pub struct EmptyResponse { }
649649
650+ /// Resolve the current user's home directory.
651+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
652+ #[ request( method = "_goose/system/home_dir" , response = GetHomeDirResponse ) ]
653+ #[ serde( rename_all = "camelCase" ) ]
654+ pub struct GetHomeDirRequest { }
655+
656+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
657+ #[ serde( rename_all = "camelCase" ) ]
658+ pub struct GetHomeDirResponse {
659+ /// Absolute path to the user's home directory.
660+ pub path : String ,
661+ }
662+
663+ /// Check whether a path exists on disk.
664+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
665+ #[ request( method = "_goose/system/path_exists" , response = PathExistsResponse ) ]
666+ #[ serde( rename_all = "camelCase" ) ]
667+ pub struct PathExistsRequest {
668+ pub path : String ,
669+ }
670+
671+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
672+ #[ serde( rename_all = "camelCase" ) ]
673+ pub struct PathExistsResponse {
674+ pub exists : bool ,
675+ }
676+
677+ /// A single filesystem entry surfaced to the desktop UI.
678+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema ) ]
679+ #[ serde( rename_all = "camelCase" ) ]
680+ pub struct FileTreeEntryDto {
681+ pub name : String ,
682+ pub path : String ,
683+ /// `"file"` or `"directory"`.
684+ pub kind : String ,
685+ }
686+
687+ /// List the immediate children of a directory.
688+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
689+ #[ request(
690+ method = "_goose/system/list_directory_entries" ,
691+ response = ListDirectoryEntriesResponse
692+ ) ]
693+ #[ serde( rename_all = "camelCase" ) ]
694+ pub struct ListDirectoryEntriesRequest {
695+ pub path : String ,
696+ }
697+
698+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
699+ #[ serde( rename_all = "camelCase" ) ]
700+ pub struct ListDirectoryEntriesResponse {
701+ pub entries : Vec < FileTreeEntryDto > ,
702+ }
703+
704+ /// Metadata describing a single attachment path on disk.
705+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema ) ]
706+ #[ serde( rename_all = "camelCase" ) ]
707+ pub struct AttachmentPathInfoDto {
708+ pub name : String ,
709+ pub path : String ,
710+ /// `"file"` or `"directory"`.
711+ pub kind : String ,
712+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
713+ pub mime_type : Option < String > ,
714+ }
715+
716+ /// Inspect a batch of attachment paths. Missing entries are silently skipped.
717+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
718+ #[ request(
719+ method = "_goose/system/inspect_attachment_paths" ,
720+ response = InspectAttachmentPathsResponse
721+ ) ]
722+ #[ serde( rename_all = "camelCase" ) ]
723+ pub struct InspectAttachmentPathsRequest {
724+ pub paths : Vec < String > ,
725+ }
726+
727+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
728+ #[ serde( rename_all = "camelCase" ) ]
729+ pub struct InspectAttachmentPathsResponse {
730+ pub attachments : Vec < AttachmentPathInfoDto > ,
731+ }
732+
733+ /// Walk one or more roots and return a sorted list of file paths suitable for
734+ /// `@`-mention pickers. Honours `.gitignore`, hidden files, and symlink escapes.
735+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
736+ #[ request(
737+ method = "_goose/system/list_files_for_mentions" ,
738+ response = ListFilesForMentionsResponse
739+ ) ]
740+ #[ serde( rename_all = "camelCase" ) ]
741+ pub struct ListFilesForMentionsRequest {
742+ pub roots : Vec < String > ,
743+ /// Maximum number of results to return. Clamped to 1..=5000; defaults to 1500.
744+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
745+ pub max_results : Option < u32 > ,
746+ }
747+
748+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
749+ #[ serde( rename_all = "camelCase" ) ]
750+ pub struct ListFilesForMentionsResponse {
751+ pub files : Vec < String > ,
752+ }
753+
754+ /// Read an image attachment from disk and return it as a base64 payload.
755+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
756+ #[ request(
757+ method = "_goose/system/read_image_attachment" ,
758+ response = ReadImageAttachmentResponse
759+ ) ]
760+ #[ serde( rename_all = "camelCase" ) ]
761+ pub struct ReadImageAttachmentRequest {
762+ pub path : String ,
763+ }
764+
765+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcResponse ) ]
766+ #[ serde( rename_all = "camelCase" ) ]
767+ pub struct ReadImageAttachmentResponse {
768+ /// Base64-encoded image bytes.
769+ pub base64 : String ,
770+ /// MIME type detected from the path's extension (always starts with `image/`).
771+ pub mime_type : String ,
772+ }
773+
774+ /// Write a UTF-8 string to a path on disk, creating any missing parents.
775+ ///
776+ /// The desktop shell uses this to persist content the user has chosen via a
777+ /// native file dialog (e.g. exported sessions). Tauri-backed file dialogs are
778+ /// still owned by the desktop shell; only the actual write is delegated to
779+ /// `goose serve`.
780+ #[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
781+ #[ request( method = "_goose/system/write_file" , response = EmptyResponse ) ]
782+ #[ serde( rename_all = "camelCase" ) ]
783+ pub struct WriteFileRequest {
784+ pub path : String ,
785+ pub contents : String ,
786+ }
787+
650788/// List available local Whisper models with their download status.
651789#[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema , JsonRpcRequest ) ]
652790#[ request(
0 commit comments