mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-31 11:17:27 +00:00
feat: implement plugin management
Added a request-plugin-list action to the sidecar, which sends plugins to the frontend. Implemented plugin list as a separate view. Plugins now interoperable with Raycast (by copying the `dist` folder). Command discovery implemented by reading `package.json`.
This commit is contained in:
parent
4315e864c0
commit
b4b6ea231f
6 changed files with 322 additions and 53 deletions
|
@ -71,3 +71,34 @@ const LogMessageSchema = z.object({
|
|||
|
||||
export const SidecarMessageSchema = z.union([BatchUpdateSchema, CommandSchema, LogMessageSchema]);
|
||||
export type SidecarMessage = z.infer<typeof SidecarMessageSchema>;
|
||||
|
||||
export const PluginInfoSchema = z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional(),
|
||||
pluginName: z.string(),
|
||||
commandName: z.string(),
|
||||
pluginPath: z.string(),
|
||||
icon: z.string().optional()
|
||||
});
|
||||
export type PluginInfo = z.infer<typeof PluginInfoSchema>;
|
||||
|
||||
export const PluginListSchema = z.object({
|
||||
type: z.literal('plugin-list'),
|
||||
payload: z.array(PluginInfoSchema)
|
||||
});
|
||||
export type PluginList = z.infer<typeof PluginListSchema>;
|
||||
|
||||
export const GoBackToPluginListSchema = z.object({
|
||||
type: z.literal('go-back-to-plugin-list'),
|
||||
payload: z.object({})
|
||||
});
|
||||
export type GoBackToPluginList = z.infer<typeof GoBackToPluginListSchema>;
|
||||
|
||||
export const SidecarMessageWithPluginsSchema = z.union([
|
||||
BatchUpdateSchema,
|
||||
CommandSchema,
|
||||
LogMessageSchema,
|
||||
PluginListSchema,
|
||||
GoBackToPluginListSchema
|
||||
]);
|
||||
export type SidecarMessageWithPlugins = z.infer<typeof SidecarMessageWithPluginsSchema>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue