feat: implement getSelectedFinderItems functionality

Added schemas and message handling for the new get-selected-finder-items command. Implemented the logic to retrieve selected items from the Finder on macOS, Windows, and Linux, enhancing the application's ability to interact with the file system.
This commit is contained in:
ByteAtATime 2025-06-17 14:28:51 -07:00
parent a3c2929e1c
commit 0c94e973a0
No known key found for this signature in database
8 changed files with 357 additions and 9 deletions

View file

@ -140,6 +140,14 @@ const GetSelectedTextMessageSchema = z.object({
payload: GetSelectedTextPayloadSchema
});
const GetSelectedFinderItemsPayloadSchema = z.object({
requestId: z.string()
});
const GetSelectedFinderItemsMessageSchema = z.object({
type: z.literal('get-selected-finder-items'),
payload: GetSelectedFinderItemsPayloadSchema
});
export const SidecarMessageWithPluginsSchema = z.union([
BatchUpdateSchema,
CommandSchema,
@ -148,6 +156,7 @@ export const SidecarMessageWithPluginsSchema = z.union([
PreferenceValuesSchema,
GoBackToPluginListSchema,
OpenMessageSchema,
GetSelectedTextMessageSchema
GetSelectedTextMessageSchema,
GetSelectedFinderItemsMessageSchema
]);
export type SidecarMessageWithPlugins = z.infer<typeof SidecarMessageWithPluginsSchema>;