forked from farhoodlabs/paperclip
5890b318c4
Persist canonical namespaced skill keys, split adapter runtime names from skill keys, and update portability/import flows to carry the canonical identity end-to-end. Co-Authored-By: Paperclip <noreply@paperclip.ing>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { z } from "zod";
|
|
|
|
export const agentSkillStateSchema = z.enum([
|
|
"available",
|
|
"configured",
|
|
"installed",
|
|
"missing",
|
|
"stale",
|
|
"external",
|
|
]);
|
|
|
|
export const agentSkillSyncModeSchema = z.enum([
|
|
"unsupported",
|
|
"persistent",
|
|
"ephemeral",
|
|
]);
|
|
|
|
export const agentSkillEntrySchema = z.object({
|
|
key: z.string().min(1),
|
|
runtimeName: z.string().min(1).nullable(),
|
|
desired: z.boolean(),
|
|
managed: z.boolean(),
|
|
required: z.boolean().optional(),
|
|
requiredReason: z.string().nullable().optional(),
|
|
state: agentSkillStateSchema,
|
|
sourcePath: z.string().nullable().optional(),
|
|
targetPath: z.string().nullable().optional(),
|
|
detail: z.string().nullable().optional(),
|
|
});
|
|
|
|
export const agentSkillSnapshotSchema = z.object({
|
|
adapterType: z.string().min(1),
|
|
supported: z.boolean(),
|
|
mode: agentSkillSyncModeSchema,
|
|
desiredSkills: z.array(z.string().min(1)),
|
|
entries: z.array(agentSkillEntrySchema),
|
|
warnings: z.array(z.string()),
|
|
});
|
|
|
|
export const agentSkillSyncSchema = z.object({
|
|
desiredSkills: z.array(z.string().min(1)),
|
|
});
|
|
|
|
export type AgentSkillSync = z.infer<typeof agentSkillSyncSchema>;
|