@prestyj/cli 5.24.0 → 5.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/assets/skills/evidence-led-ui/SKILL.md +13 -2
  3. package/assets/skills/evidence-led-ui/references/craft-rulings.md +46 -4
  4. package/assets/skills/evidence-led-ui/references/production-contract.md +2 -2
  5. package/assets/skills/evidence-led-ui/references/quality-rubric.md +3 -3
  6. package/assets/skills/evidence-led-ui/references/ui-libraries.md +30 -0
  7. package/dist/app-sidecar.js +1 -1
  8. package/dist/app-sidecar.js.map +1 -1
  9. package/dist/cli.js +8 -8
  10. package/dist/cli.js.map +1 -1
  11. package/dist/core/agent-session.js +4 -4
  12. package/dist/core/agent-session.js.map +1 -1
  13. package/dist/core/auth-providers.js +2 -2
  14. package/dist/core/auth-providers.js.map +1 -1
  15. package/dist/core/compaction/compactor.d.ts +7 -3
  16. package/dist/core/compaction/compactor.js +10 -4
  17. package/dist/core/compaction/compactor.js.map +1 -1
  18. package/dist/core/compaction/policy.d.ts +2 -0
  19. package/dist/core/compaction/policy.js +61 -2
  20. package/dist/core/compaction/policy.js.map +1 -1
  21. package/dist/core/sandbox.js +4 -6
  22. package/dist/core/sandbox.js.map +1 -1
  23. package/dist/core/temp-paths.d.ts +5 -0
  24. package/dist/core/temp-paths.js +50 -0
  25. package/dist/core/temp-paths.js.map +1 -0
  26. package/dist/core/ui-adoption.d.ts +32 -0
  27. package/dist/core/ui-adoption.js +300 -0
  28. package/dist/core/ui-adoption.js.map +1 -0
  29. package/dist/core/ui-compatibility.d.ts +10 -0
  30. package/dist/core/ui-compatibility.js +51 -0
  31. package/dist/core/ui-compatibility.js.map +1 -0
  32. package/dist/core/ui-registry.d.ts +101 -0
  33. package/dist/core/ui-registry.js +291 -0
  34. package/dist/core/ui-registry.js.map +1 -0
  35. package/dist/core/workspace-guard.js +2 -1
  36. package/dist/core/workspace-guard.js.map +1 -1
  37. package/dist/interactive.js +2 -1
  38. package/dist/interactive.js.map +1 -1
  39. package/dist/modes/acp-images.d.ts +10 -0
  40. package/dist/modes/acp-images.js +43 -0
  41. package/dist/modes/acp-images.js.map +1 -0
  42. package/dist/modes/acp-mode.js +8 -3
  43. package/dist/modes/acp-mode.js.map +1 -1
  44. package/dist/tools/index.js +11 -0
  45. package/dist/tools/index.js.map +1 -1
  46. package/dist/tools/path-utils.d.ts +4 -7
  47. package/dist/tools/path-utils.js +12 -7
  48. package/dist/tools/path-utils.js.map +1 -1
  49. package/dist/tools/prompt-hints.js +7 -3
  50. package/dist/tools/prompt-hints.js.map +1 -1
  51. package/dist/tools/steroids.d.ts +1 -1
  52. package/dist/tools/tool-tiers.js +2 -0
  53. package/dist/tools/tool-tiers.js.map +1 -1
  54. package/dist/tools/ui-adopt.d.ts +16 -0
  55. package/dist/tools/ui-adopt.js +64 -0
  56. package/dist/tools/ui-adopt.js.map +1 -0
  57. package/dist/tools/ui-registry.d.ts +15 -0
  58. package/dist/tools/ui-registry.js +39 -0
  59. package/dist/tools/ui-registry.js.map +1 -0
  60. package/dist/ui/components/Footer.js +2 -1
  61. package/dist/ui/components/Footer.js.map +1 -1
  62. package/dist/ui/hooks/useContextCompaction.js +10 -1
  63. package/dist/ui/hooks/useContextCompaction.js.map +1 -1
  64. package/package.json +4 -4
@@ -0,0 +1,300 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import ts from "typescript";
4
+ import { compatibilityPatch } from "./ui-compatibility.js";
5
+ import { localOperations, readFileBounded } from "../tools/operations.js";
6
+ import { registryPath, payloadHash } from "./ui-registry.js";
7
+ async function contained(root, target) {
8
+ if (path.isAbsolute(target) || target.includes("\\"))
9
+ throw new Error("Absolute adoption target refused");
10
+ const safe = registryPath(target);
11
+ if (safe !== target ||
12
+ safe
13
+ .split("/")
14
+ .some((p) => p.startsWith(".") ||
15
+ /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(?:\.|$)/i.test(p) ||
16
+ /[. ]$/.test(p)))
17
+ throw new Error("Reserved adoption path");
18
+ const resolved = path.resolve(root, safe);
19
+ if (!path.relative(root, resolved) || path.relative(root, resolved).startsWith(".."))
20
+ throw new Error("Target escapes workspace");
21
+ let current = root;
22
+ for (const part of safe.split("/")) {
23
+ current = path.join(current, part);
24
+ try {
25
+ const stat = await fs.lstat(current);
26
+ if (stat.isSymbolicLink())
27
+ throw new Error("Symlink adoption path refused");
28
+ }
29
+ catch (error) {
30
+ if (error.code !== "ENOENT")
31
+ throw error;
32
+ }
33
+ }
34
+ return resolved;
35
+ }
36
+ async function readOptional(root, target) {
37
+ try {
38
+ return (await readFileBounded(await contained(root, target), 1000000)).toString("utf8");
39
+ }
40
+ catch (error) {
41
+ if (error.code === "ENOENT")
42
+ return undefined;
43
+ throw error;
44
+ }
45
+ }
46
+ export function moduleSpecifiers(content) {
47
+ const source = ts.createSourceFile("component.tsx", content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
48
+ const specs = [];
49
+ const visit = (node) => {
50
+ let spec;
51
+ if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node))
52
+ spec = node.moduleSpecifier;
53
+ if (ts.isCallExpression(node) &&
54
+ (node.expression.kind === ts.SyntaxKind.ImportKeyword ||
55
+ (ts.isIdentifier(node.expression) && node.expression.text === "require")))
56
+ spec = node.arguments[0];
57
+ if (spec && ts.isStringLiteralLike(spec))
58
+ specs.push({ start: spec.getStart(source) + 1, end: spec.getEnd() - 1, value: spec.text });
59
+ ts.forEachChild(node, visit);
60
+ };
61
+ visit(source);
62
+ return specs;
63
+ }
64
+ const withoutExtension = (value) => value.replace(/\.(tsx?|jsx?)$/, "");
65
+ export function relocateImports(content, resolve) {
66
+ for (const spec of moduleSpecifiers(content).reverse()) {
67
+ const relocated = resolve(spec.value);
68
+ content = content.slice(0, spec.start) + relocated + content.slice(spec.end);
69
+ }
70
+ return content;
71
+ }
72
+ export async function planAdoption(cwd, registry, entry, signal) {
73
+ const root = await fs.realpath(cwd);
74
+ const pkg = JSON.parse((await readOptional(root, "package.json")) ?? "{}");
75
+ const installed = { ...pkg.dependencies, ...pkg.devDependencies };
76
+ const framework = installed.next
77
+ ? "next"
78
+ : installed.vite && installed.react
79
+ ? "vite-react"
80
+ : "unsupported";
81
+ const blockers = framework === "unsupported"
82
+ ? ["Only existing React Vite and Next projects are supported."]
83
+ : [];
84
+ const packageManager = (await readOptional(root, "pnpm-lock.yaml")) !== undefined
85
+ ? "pnpm"
86
+ : (await readOptional(root, "yarn.lock")) !== undefined
87
+ ? "yarn"
88
+ : (await readOptional(root, "bun.lock")) !== undefined
89
+ ? "bun"
90
+ : "npm";
91
+ const components = JSON.parse((await readOptional(root, "components.json")) ?? "{}");
92
+ const configText = (await readOptional(root, "tsconfig.json")) ??
93
+ (await readOptional(root, "jsconfig.json")) ??
94
+ "{}";
95
+ const parsed = ts.parseConfigFileTextToJson("tsconfig.json", configText);
96
+ if (parsed.error)
97
+ throw new Error("Cannot parse project aliases");
98
+ const config = parsed.config;
99
+ const paths = config.compilerOptions?.paths ?? {};
100
+ const baseUrl = config.compilerOptions?.baseUrl ?? ".";
101
+ const hasSrc = await fs.stat(path.join(root, "src")).then((s) => s.isDirectory(), () => false);
102
+ const defaultRoot = hasSrc ? "src" : "";
103
+ const aliasTarget = (alias) => {
104
+ const matches = Object.entries(paths).flatMap(([pattern, targets]) => {
105
+ const prefix = pattern.replace(/\*$/, "");
106
+ if (alias === pattern || (pattern.endsWith("*") && alias.startsWith(prefix))) {
107
+ return targets.map((target) => path.posix.join(baseUrl, target.replace(/\*$/, "") + alias.slice(prefix.length)));
108
+ }
109
+ return [];
110
+ });
111
+ if (matches.length > 1)
112
+ throw new Error(`Ambiguous alias: ${alias}`);
113
+ if (matches.length === 1)
114
+ return registryPath(matches[0]);
115
+ if (alias.startsWith("@/"))
116
+ return path.posix.join(defaultRoot, alias.slice(2));
117
+ throw new Error(`Unresolved alias: ${alias}. Configure project paths first.`);
118
+ };
119
+ const aliases = {
120
+ ui: "@/components/ui",
121
+ components: "@/components",
122
+ hooks: "@/hooks",
123
+ lib: "@/lib",
124
+ utils: "@/lib/utils",
125
+ ...components.aliases,
126
+ };
127
+ const sources = await registry.closure(entry, signal);
128
+ const files = [];
129
+ const targetSet = new Set();
130
+ const styles = [];
131
+ const compatibility = [];
132
+ const missing = new Set();
133
+ for (const source of sources) {
134
+ for (const dep of [
135
+ ...(source.item.dependencies ?? []),
136
+ ...(source.item.devDependencies ?? []),
137
+ ]) {
138
+ if (!/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+(?:@[a-zA-Z0-9.^~<>=|*+ -]+)?$/.test(dep))
139
+ throw new Error(`Unsupported package specifier: ${dep}`);
140
+ const name = dep.replace(/(?<!^)@[^/]*$/, "");
141
+ if (!installed[name])
142
+ missing.add(dep);
143
+ if (/iconist/i.test(name))
144
+ blockers.push(`Review nonstandard/unknown license for ${name} before production use.`);
145
+ }
146
+ if (source.item.css || source.item.cssVars || source.item.tailwind)
147
+ styles.push({
148
+ id: source.id,
149
+ css: source.item.css,
150
+ cssVars: source.item.cssVars,
151
+ tailwind: source.item.tailwind,
152
+ });
153
+ for (const [index, file] of source.item.files.entries()) {
154
+ const sourcePath = registryPath(file.path);
155
+ let target;
156
+ if (file.target) {
157
+ if (file.target.startsWith("/"))
158
+ throw new Error("Absolute installation target refused");
159
+ target = file.target.replace(/^~\//, `${defaultRoot ? `${defaultRoot}/` : ""}`);
160
+ }
161
+ else {
162
+ const type = file.type ?? source.item.type;
163
+ const directory = type === "registry:hook"
164
+ ? aliases.hooks
165
+ : type === "registry:lib"
166
+ ? aliases.lib
167
+ : type === "registry:ui"
168
+ ? aliases.ui
169
+ : aliases.components;
170
+ target = path.posix.join(aliasTarget(directory), path.posix.basename(sourcePath));
171
+ }
172
+ if (!/\.(tsx?|jsx?|css)$/.test(target) ||
173
+ /(?:^|\/)(?:page|layout|route|middleware|instrumentation|.*\.config)\.[^.]+$/.test(target) ||
174
+ /(?:^|\/)(?:node_modules|public|dist|scripts|app|pages)(?:\/|$)/.test(target))
175
+ throw new Error(`Reserved or non-component target: ${target}`);
176
+ await contained(root, target);
177
+ if (targetSet.has(target.toLowerCase()))
178
+ throw new Error(`Ambiguous installation target: ${target}`);
179
+ targetSet.add(target.toLowerCase());
180
+ const patched = compatibilityPatch(source.id, sourcePath, file.content);
181
+ if (patched.notice)
182
+ compatibility.push(patched.notice);
183
+ files.push({
184
+ sourceId: `${source.id}#${index}`,
185
+ sourcePath,
186
+ target,
187
+ content: patched.content,
188
+ status: "new",
189
+ });
190
+ }
191
+ }
192
+ for (const file of files) {
193
+ file.content = relocateImports(file.content, (specifier) => {
194
+ if (!specifier.startsWith(".") && !specifier.startsWith("@/")) {
195
+ if (specifier.startsWith("next/") && framework !== "next")
196
+ blockers.push(`${file.sourceId} requires Next.js (${specifier}); no framework shims are installed.`);
197
+ return specifier;
198
+ }
199
+ const candidate = specifier.startsWith(".")
200
+ ? path.posix.normalize(path.posix.join(path.posix.dirname(file.sourcePath), specifier))
201
+ : specifier.slice(2);
202
+ const matches = files.filter((f) => withoutExtension(f.sourcePath) === withoutExtension(candidate) ||
203
+ withoutExtension(f.sourcePath).endsWith(`/${withoutExtension(candidate)}`));
204
+ if (matches.length > 1)
205
+ throw new Error(`Ambiguous source import: ${specifier}`);
206
+ let destination = matches[0]?.target;
207
+ if (!destination && specifier === "@/lib/utils")
208
+ destination = aliasTarget(aliases.utils) + ".ts";
209
+ if (!destination && specifier.startsWith("@/"))
210
+ destination = aliasTarget(specifier);
211
+ if (!destination)
212
+ return specifier;
213
+ let relative = path.posix.relative(path.posix.dirname(file.target), withoutExtension(destination));
214
+ if (!relative.startsWith("."))
215
+ relative = `./${relative}`;
216
+ return relative;
217
+ });
218
+ const existing = await readOptional(root, file.target);
219
+ if (existing !== undefined) {
220
+ // Existing shadcn primitives are authoritative, not silently replaced.
221
+ file.status =
222
+ existing === file.content || file.sourceId.startsWith("shadcn:") ? "reuse" : "conflict";
223
+ }
224
+ }
225
+ for (const file of files) {
226
+ for (const spec of moduleSpecifiers(file.content)) {
227
+ if (!spec.value.startsWith("."))
228
+ continue;
229
+ const target = path.posix.normalize(path.posix.join(path.posix.dirname(file.target), spec.value));
230
+ const available = files.some((f) => withoutExtension(f.target) === withoutExtension(target));
231
+ if (!available) {
232
+ const candidates = [
233
+ target,
234
+ `${target}.ts`,
235
+ `${target}.tsx`,
236
+ `${target}.js`,
237
+ `${target}.jsx`,
238
+ `${target}/index.ts`,
239
+ `${target}/index.tsx`,
240
+ ];
241
+ let exists = false;
242
+ for (const candidate of candidates)
243
+ if ((await readOptional(root, candidate)) !== undefined) {
244
+ exists = true;
245
+ break;
246
+ }
247
+ if (!exists)
248
+ blockers.push(`Missing local prerequisite: ${spec.value} consumed by ${file.target}. Resolve it before adoption.`);
249
+ }
250
+ }
251
+ }
252
+ const plan = {
253
+ entry,
254
+ framework,
255
+ packageManager,
256
+ tailwind: installed.tailwindcss ?? null,
257
+ files,
258
+ missingPackages: [...missing].sort(),
259
+ blockers: [...new Set(blockers)],
260
+ styles,
261
+ attribution: [
262
+ ...sources.map((s) => `${s.id}: ${s.attribution} Hosted SHA256 ${s.payloadHash}; inventory revision ${s.inventoryRevision ?? "unknown"}; equivalence not verified.`),
263
+ ...compatibility,
264
+ ],
265
+ instructions: [
266
+ "Install missing packages only through normal authorized dependency changes; this tool never runs install scripts.",
267
+ "Review required CSS/providers against existing theme tokens. Preserve notices and library styling. Build a real consumer and verify callbacks, keyboard behavior, reduced motion and repeated cleanup.",
268
+ "Existing shadcn primitives take precedence. Reused files may have different contracts: inspect their exports before integrating.",
269
+ ],
270
+ };
271
+ return { ...plan, hash: payloadHash(JSON.stringify(plan)) };
272
+ }
273
+ /** Same write tool pipeline, but the final filesystem operation exclusively creates new files. */
274
+ export function adoptionOperations(cwd) {
275
+ return {
276
+ ...localOperations,
277
+ writeFile: async (target, content) => {
278
+ const root = await fs.realpath(cwd);
279
+ const relative = path.relative(path.resolve(cwd), target).split(path.sep).join("/");
280
+ const resolved = await contained(root, relative);
281
+ await fs.mkdir(path.dirname(resolved), { recursive: true });
282
+ await contained(root, relative);
283
+ await fs.writeFile(resolved, content, { encoding: "utf8", flag: "wx" });
284
+ },
285
+ };
286
+ }
287
+ export async function preflightAdoption(cwd, plan) {
288
+ if (plan.blockers.length || plan.files.some((f) => f.status === "conflict"))
289
+ throw new Error("Adoption blocked: resolve prerequisites and file conflicts first");
290
+ const root = await fs.realpath(cwd);
291
+ for (const file of plan.files) {
292
+ await contained(root, file.target);
293
+ const existing = await readOptional(root, file.target);
294
+ if (file.status === "new" && existing !== undefined)
295
+ throw new Error(`File appeared after planning: ${file.target}`);
296
+ if (file.status === "reuse" && existing === undefined)
297
+ throw new Error(`Reused file disappeared: ${file.target}`);
298
+ }
299
+ }
300
+ //# sourceMappingURL=ui-adoption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-adoption.js","sourceRoot":"","sources":["../../src/core/ui-adoption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAuB,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAmB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAuB9E,KAAK,UAAU,SAAS,CAAC,IAAY,EAAE,MAAc;IACnD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,IACE,IAAI,KAAK,MAAM;QACf,IAAI;aACD,KAAK,CAAC,GAAG,C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Q,CAAC,GAAG,CAAC,CAAC;IACpC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACvD,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS;YACjD,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,QAAQ,KAAK,SAAS;YACnD,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const MOUSE_CARD_SOURCE_HASH = "3a1a1c3308214e69a6a1129e2d1191cae87b6d071b70a8a1ded0253b263d7483";
2
+ /** Reviewed cleanup recipe: retain the repeating animation's own cancellation handle. */
3
+ export declare function patchMouseCard(source: string): string;
4
+ export declare function compatibilityPatch(id: string, sourcePath: string, content: string): {
5
+ content: string;
6
+ notice?: undefined;
7
+ } | {
8
+ content: string;
9
+ notice: string;
10
+ };
@@ -0,0 +1,51 @@
1
+ import { payloadHash } from "./ui-registry.js";
2
+ export const MOUSE_CARD_SOURCE_HASH = "3a1a1c3308214e69a6a1129e2d1191cae87b6d071b70a8a1ded0253b263d7483";
3
+ /** Reviewed cleanup recipe: retain the repeating animation's own cancellation handle. */
4
+ export function patchMouseCard(source) {
5
+ if (payloadHash(source) !== MOUSE_CARD_SOURCE_HASH)
6
+ throw new Error("Mouse Effect Card source differs from reviewed snapshot; review before patching");
7
+ const replace = (from, to) => {
8
+ if (source.split(from).length !== 2)
9
+ throw new Error("Ambiguous Mouse Effect Card cleanup patch");
10
+ source = source.replace(from, to);
11
+ };
12
+ replace('import { motion, useMotionValue, useSpring, useTransform } from "motion/react";', 'import { animate, motion, useMotionValue, useSpring, useTransform } from "motion/react";');
13
+ replace(" const delay = (index * OPACITY_DELAY_STEP) % OPACITY_DELAY_CYCLE;", ` const delay = (index * OPACITY_DELAY_STEP) % OPACITY_DELAY_CYCLE;
14
+ const opacity = useSpring(minOpacityWithBoost, {
15
+ stiffness: 150,
16
+ damping: 25,
17
+ });
18
+
19
+ useEffect(() => {
20
+ // A following spring can replace MotionValue.animation. Keep a separate
21
+ // handle for the repeating pulse so unmount always stops its frame driver.
22
+ const pulse = animate(opacity, [baseMinOpacity, baseMaxOpacity, baseMinOpacity], {
23
+ duration: OPACITY_DURATION_BASE + (index % 4) * OPACITY_DURATION_VARIATION,
24
+ repeat: Number.POSITIVE_INFINITY,
25
+ ease: OPACITY_EASE,
26
+ delay,
27
+ times: [0, 0.5, 1],
28
+ });
29
+ return () => pulse.stop();
30
+ }, [opacity, baseMinOpacity, baseMaxOpacity, index, delay]);`);
31
+ replace(" animate={{\n opacity: [baseMinOpacity, baseMaxOpacity, baseMinOpacity],\n }}\n", "");
32
+ replace(" opacity: useSpring(minOpacityWithBoost, {\n stiffness: 150,\n damping: 25,\n }),", " opacity,");
33
+ replace(" transition={{\n opacity: {\n duration:\n OPACITY_DURATION_BASE + (index % 4) * OPACITY_DURATION_VARIATION,\n repeat: Number.POSITIVE_INFINITY,\n ease: OPACITY_EASE,\n delay,\n times: [0, 0.5, 1],\n },\n }}\n", "");
34
+ return source;
35
+ }
36
+ export function compatibilityPatch(id, sourcePath, content) {
37
+ if (id !== "kokonut:mouse-effect-card" || !sourcePath.endsWith("/mouse-effect-card.tsx"))
38
+ return { content };
39
+ const originalHash = payloadHash(content);
40
+ if (originalHash !== MOUSE_CARD_SOURCE_HASH)
41
+ return {
42
+ content,
43
+ notice: "Mouse Effect Card cleanup recipe not applied: unreviewed source hash. Verify animation teardown independently.",
44
+ };
45
+ const patched = patchMouseCard(content);
46
+ return {
47
+ content: patched,
48
+ notice: `Mouse Effect Card owned-animation cleanup: original SHA256 ${originalHash}; patched SHA256 ${payloadHash(patched)}. Import relocation is a separate subsequent transformation.`,
49
+ };
50
+ }
51
+ //# sourceMappingURL=ui-compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-compatibility.js","sourceRoot":"","sources":["../../src/core/ui-compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GACjC,kEAAkE,CAAC;AAErE,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,sBAAsB;QAChD,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAU,EAAQ,EAAE;QACjD,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC;IACF,OAAO,CACL,iFAAiF,EACjF,0FAA0F,CAC3F,CAAC;IACF,OAAO,CACL,qEAAqE,EACrE;;;;;;;;;;;;;;;;;+DAiB2D,CAC5D,CAAC;IACF,OAAO,CACL,kGAAkG,EAClG,EAAE,CACH,CAAC;IACF,OAAO,CACL,mHAAmH,EACnH,kBAAkB,CACnB,CAAC;IACF,OAAO,CACL,kSAAkS,EAClS,EAAE,CACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAU,EAAE,UAAkB,EAAE,OAAe;IAChF,IAAI,EAAE,KAAK,2BAA2B,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACtF,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,YAAY,KAAK,sBAAsB;QACzC,OAAO;YACL,OAAO;YACP,MAAM,EACJ,gHAAgH;SACnH,CAAC;IACJ,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,8DAA8D,YAAY,oBAAoB,WAAW,CAAC,OAAO,CAAC,8DAA8D;KACzL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { z } from "zod";
2
+ import { type GetNetworkPolicy } from "./network-guard.js";
3
+ export declare const UI_PROVIDERS: {
4
+ readonly bklit: {
5
+ readonly repo: "bklit/bklit-ui";
6
+ readonly revision: "0dfdfc57ca068470ccfb93c4501cebc555c9054d";
7
+ readonly manifest: "packages/ui/registry.json";
8
+ readonly root: "https://ui.bklit.com/r/";
9
+ };
10
+ readonly kokonut: {
11
+ readonly repo: "kokonut-labs/kokonutui";
12
+ readonly revision: "83eec6d982d400a18438001a8efdbac1f159dd43";
13
+ readonly manifest: "registry.json";
14
+ readonly root: "https://kokonutui.com/r/";
15
+ };
16
+ };
17
+ declare const itemSchema: z.ZodObject<{
18
+ name: z.ZodString;
19
+ type: z.ZodEnum<{
20
+ "registry:component": "registry:component";
21
+ "registry:block": "registry:block";
22
+ "registry:example": "registry:example";
23
+ "registry:hook": "registry:hook";
24
+ "registry:lib": "registry:lib";
25
+ "registry:ui": "registry:ui";
26
+ "registry:style": "registry:style";
27
+ "registry:theme": "registry:theme";
28
+ "registry:file": "registry:file";
29
+ }>;
30
+ title: z.ZodOptional<z.ZodString>;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ files: z.ZodArray<z.ZodObject<{
33
+ path: z.ZodString;
34
+ type: z.ZodOptional<z.ZodString>;
35
+ target: z.ZodOptional<z.ZodString>;
36
+ content: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strict>>;
38
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
39
+ devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
+ registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ css: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42
+ cssVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
43
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
+ categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
+ docs: z.ZodOptional<z.ZodString>;
46
+ author: z.ZodOptional<z.ZodString>;
47
+ $schema: z.ZodOptional<z.ZodString>;
48
+ tailwind: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
49
+ }, z.core.$strict>;
50
+ export type RegistryItem = z.infer<typeof itemSchema>;
51
+ export interface RegistrySource {
52
+ id: string;
53
+ item: RegistryItem;
54
+ url: string;
55
+ payloadHash: string;
56
+ inventoryRevision?: string;
57
+ hostedMatchesRevision: "not-verified";
58
+ dependencies: string[];
59
+ attribution: string;
60
+ }
61
+ export declare const payloadHash: (text: string) => string;
62
+ export declare function registryPath(value: string): string;
63
+ export declare function registryUrl(value: string): URL;
64
+ export declare function registryKey(value: string): string;
65
+ export declare function validateRegistryItem(input: unknown, source?: boolean): RegistryItem;
66
+ export declare function resolveRegistryFile(source: RegistrySource, selector: string): {
67
+ path: string;
68
+ type?: string | undefined;
69
+ target?: string | undefined;
70
+ content?: string | undefined;
71
+ };
72
+ export declare const MOTION_GUIDANCE: {
73
+ kind: string;
74
+ package: string;
75
+ import: string;
76
+ documentation: string;
77
+ guidance: string;
78
+ families: string[];
79
+ };
80
+ /** Lazy, bounded per-session cache; every fetch and redirect respects current network policy. */
81
+ export declare class UiRegistry {
82
+ private getNetworkPolicy?;
83
+ private fetcher;
84
+ private cache;
85
+ private cacheBytes;
86
+ constructor(getNetworkPolicy?: GetNetworkPolicy | undefined, fetcher?: typeof fetch);
87
+ fetchText(value: string, signal?: AbortSignal): Promise<{
88
+ text: string;
89
+ url: string;
90
+ hash: string;
91
+ }>;
92
+ search(query?: string, signal?: AbortSignal): Promise<{
93
+ id: string;
94
+ name: string;
95
+ description?: string;
96
+ type: string;
97
+ }[]>;
98
+ inspect(value: string, signal?: AbortSignal): Promise<RegistrySource>;
99
+ closure(value: string, signal?: AbortSignal): Promise<RegistrySource[]>;
100
+ }
101
+ export {};