import { z } from 'zod';
const PromptInvocationTokenV1Schema = z
    .string()
    .min(2)
    // Single-segment invocation tokens only (no nested slashes), and disallow obvious absolute paths.
    .regex(/^\/[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/);
export const PromptInvocationBehaviorV1Schema = z.enum(['insert', 'insert_and_send']);
export const PromptInvocationAvailabilityV1Schema = z.enum(['global', 'session_only']);
export const PromptInvocationTargetV1Schema = z.object({
    kind: z.literal('doc'),
    artifactId: z.string().min(1),
});
export const PromptInvocationEntryV1Schema = z.object({
    id: z.string().min(1),
    token: PromptInvocationTokenV1Schema,
    title: z.string().min(1),
    target: PromptInvocationTargetV1Schema,
    behavior: PromptInvocationBehaviorV1Schema.default('insert'),
    allowArgs: z.boolean().default(false),
    availableIn: PromptInvocationAvailabilityV1Schema.default('global'),
});
export const PromptInvocationsV1Schema = z
    .object({
    v: z.literal(1).default(1),
    entries: z.array(PromptInvocationEntryV1Schema).default([]),
})
    .catch({ v: 1, entries: [] });
export function normalizePromptInvocationTokenV1(token) {
    return String(token ?? '').trim().toLowerCase();
}
//# sourceMappingURL=promptInvocationsV1.js.map