mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-23 09:42:53 +00:00
Desktop and CLI helpers imported daemon bootstrap through the server root, while supervisor configuration retained the full wire schema tree. Expose existing capabilities through narrow package entrypoints and share configuration schemas without loading message definitions. Guard the dependency trees without tree-shaking so unused exports cannot hide the runtime cost.
19 lines
674 B
TypeScript
19 lines
674 B
TypeScript
import { z } from "zod";
|
|
|
|
export const PluginIdSchema = z.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
// Semver validation belongs at the manifest/runtime boundary, not on the wire.
|
|
export const PluginRequirementsSchema = z.object({ paseo: z.string().optional() });
|
|
export type PluginRequirements = z.infer<typeof PluginRequirementsSchema>;
|
|
|
|
export const DirectoryPluginSourceSchema = z
|
|
.object({
|
|
source: z.literal("directory"),
|
|
path: z.string().min(1),
|
|
enabled: z.boolean().optional(),
|
|
})
|
|
.strict();
|
|
|
|
export const PluginSourceSchema = z.discriminatedUnion("source", [DirectoryPluginSourceSchema]);
|
|
|
|
export type PluginSource = z.infer<typeof PluginSourceSchema>;
|