import { z } from 'zod'; import { type RegistryShapeDrift } from './registry-drift.js'; export type { RegistryShapeDrift } from './registry-drift.js'; /** * `installed_plugins.json` is written and owned by Claude Code — VAT only reads it. * Per VAT's Postel's Law rule (CLAUDE.md: "Reading outside world → liberal"), these * schemas `.passthrough()` and keep `scope` open: an unrecognized field or install * scope is drift in someone else's file, not an error in the user's setup. * * Modelling it strictly turned every shape Claude Code added — the `project` scope, * its `projectPath` companion, the removal of `isLocal` — into a wall of false errors. * * Liberality alone would be blindness, so it is paired with * {@link detectInstalledPluginsRegistryDrift}: what passthrough absorbs still gets * reported, at `info`, as `REGISTRY_SHAPE_DRIFT`. */ /** * Install scopes VAT's model knows about. Not enforced by the schema — a scope * outside this list parses fine and is reported as drift instead. */ export declare const KNOWN_INSTALLATION_SCOPES: readonly ["user", "system", "project", "local"]; /** * Single plugin installation entry */ declare const PluginInstallationSchema: z.ZodObject<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; /** * Schema for installed_plugins.json registry * Tracks all installed plugins with version and path info * * Format: { "plugin-name@marketplace-name": [installation entries] } * * A single plugin can have multiple installations (e.g., both user and project scope). */ export declare const InstalledPluginsRegistrySchema: z.ZodObject<{ version: z.ZodLiteral<2>; plugins: z.ZodRecord; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodLiteral<2>; plugins: z.ZodRecord; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodLiteral<2>; plugins: z.ZodRecord; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ scope: z.ZodString; projectPath: z.ZodOptional; installPath: z.ZodString; version: z.ZodString; installedAt: z.ZodString; lastUpdated: z.ZodString; gitCommitSha: z.ZodOptional; isLocal: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">>; }, z.ZodTypeAny, "passthrough">>; export type InstalledPluginsRegistry = z.infer; export type PluginInstallation = z.infer; export declare const InstalledPluginsRegistryJsonSchema: import("zod-to-json-schema").JsonSchema7Type & { $schema?: string | undefined; definitions?: { [key: string]: import("zod-to-json-schema").JsonSchema7Type; } | undefined; }; /** * Report what `.passthrough()` absorbed: fields and scope values in an * installed-plugins registry that VAT's model does not recognize. * * Deduplicated by message — the point is "Claude Code writes something new", * not "it wrote it 28 times". * * @param data - Parsed registry JSON (any shape; non-objects yield no drift) * @returns One observation per distinct unrecognized field or scope value */ export declare function detectInstalledPluginsRegistryDrift(data: unknown): RegistryShapeDrift[]; //# sourceMappingURL=installed-plugins-registry.d.ts.map