@teamix-evo/registry 0.2.0 → 0.5.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.
- package/dist/index.cjs +370 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1077 -106
- package/dist/index.d.ts +1077 -106
- package/dist/index.js +356 -51
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/dist/index.cjs
CHANGED
|
@@ -40,8 +40,14 @@ __export(index_exports, {
|
|
|
40
40
|
SkillEntrySchema: () => SkillEntrySchema,
|
|
41
41
|
SkillIdeSchema: () => SkillIdeSchema,
|
|
42
42
|
SkillScopeSchema: () => SkillScopeSchema,
|
|
43
|
+
SkillsLockEntrySchema: () => SkillsLockEntrySchema,
|
|
44
|
+
SkillsLockSchema: () => SkillsLockSchema,
|
|
43
45
|
SkillsPackageManifestSchema: () => SkillsPackageManifestSchema,
|
|
44
46
|
TailwindVersionSchema: () => TailwindVersionSchema,
|
|
47
|
+
TokensPackLinkedSchema: () => TokensPackLinkedSchema,
|
|
48
|
+
TokensPackLockSchema: () => TokensPackLockSchema,
|
|
49
|
+
TokensPackageManifestSchema: () => TokensPackageManifestSchema,
|
|
50
|
+
TokensVariantEntrySchema: () => TokensVariantEntrySchema,
|
|
45
51
|
UiAliasSchema: () => UiAliasSchema,
|
|
46
52
|
UiAliasesSchema: () => UiAliasesSchema,
|
|
47
53
|
UiEntryFileSchema: () => UiEntryFileSchema,
|
|
@@ -50,11 +56,18 @@ __export(index_exports, {
|
|
|
50
56
|
UiPackageManifestSchema: () => UiPackageManifestSchema,
|
|
51
57
|
UpdateStrategySchema: () => UpdateStrategySchema,
|
|
52
58
|
VariantManifestSchema: () => VariantManifestSchema,
|
|
59
|
+
VariantUiPackageCatalogSchema: () => VariantUiPackageCatalogSchema,
|
|
60
|
+
VariantUiPackageManifestSchema: () => VariantUiPackageManifestSchema,
|
|
61
|
+
VariantUiPackageNameSchema: () => VariantUiPackageNameSchema,
|
|
53
62
|
getUpdateAction: () => getUpdateAction,
|
|
63
|
+
getVariantEntry: () => getVariantEntry,
|
|
54
64
|
hasManagedRegion: () => hasManagedRegion,
|
|
55
65
|
loadSkillsPackageManifest: () => loadSkillsPackageManifest,
|
|
66
|
+
loadTokensPackageManifest: () => loadTokensPackageManifest,
|
|
56
67
|
loadUiPackageManifest: () => loadUiPackageManifest,
|
|
57
68
|
loadVariantManifest: () => loadVariantManifest,
|
|
69
|
+
loadVariantUiPackageCatalog: () => loadVariantUiPackageCatalog,
|
|
70
|
+
loadVariantUiPackageManifest: () => loadVariantUiPackageManifest,
|
|
58
71
|
parseManagedRegions: () => parseManagedRegions,
|
|
59
72
|
replaceManagedRegion: () => replaceManagedRegion,
|
|
60
73
|
resolveUiEntryOrder: () => resolveUiEntryOrder,
|
|
@@ -62,6 +75,7 @@ __export(index_exports, {
|
|
|
62
75
|
validateConfig: () => validateConfig,
|
|
63
76
|
validateInstalled: () => validateInstalled,
|
|
64
77
|
validateManifest: () => validateManifest,
|
|
78
|
+
validateSkillsLock: () => validateSkillsLock,
|
|
65
79
|
validateSkillsPackage: () => validateSkillsPackage,
|
|
66
80
|
validateUiDependencyGraph: () => validateUiDependencyGraph,
|
|
67
81
|
validateUiPackage: () => validateUiPackage
|
|
@@ -152,7 +166,20 @@ var SkillEntrySchema = import_zod.z.object({
|
|
|
152
166
|
/** Managed region IDs to maintain on update */
|
|
153
167
|
managedRegions: import_zod.z.array(import_zod.z.string()).optional(),
|
|
154
168
|
/** Whether the source is a Handlebars template */
|
|
155
|
-
template: import_zod.z.boolean().optional()
|
|
169
|
+
template: import_zod.z.boolean().optional(),
|
|
170
|
+
/**
|
|
171
|
+
* Variant identifier when this skill is bound to a specific design variant
|
|
172
|
+
* (e.g. `"opentrek"`, `"uni-manager"`). Optional — neutral skills (manage,
|
|
173
|
+
* coding-conventions, baseline design-rules) leave it unset.
|
|
174
|
+
*
|
|
175
|
+
* When present, the CLI installs this skill ONLY if the consumer's
|
|
176
|
+
* `.teamix-evo/tokens-lock.json` records the same variant. MUST equal
|
|
177
|
+
* the variant directory name in `@teamix-evo/tokens/variants/<name>/`.
|
|
178
|
+
*
|
|
179
|
+
* Mirrors `UiEntrySchema.variant` semantics in @teamix-evo/biz-ui &
|
|
180
|
+
* @teamix-evo/templates per ADR 0014.
|
|
181
|
+
*/
|
|
182
|
+
variant: import_zod.z.string().optional()
|
|
156
183
|
});
|
|
157
184
|
var SkillsPackageManifestSchema = import_zod.z.object({
|
|
158
185
|
$schema: import_zod.z.string().optional(),
|
|
@@ -172,9 +199,17 @@ var UiEntryTypeSchema = import_zod.z.enum([
|
|
|
172
199
|
"component",
|
|
173
200
|
"hook",
|
|
174
201
|
"util",
|
|
175
|
-
"block"
|
|
202
|
+
"block",
|
|
203
|
+
"template"
|
|
204
|
+
]);
|
|
205
|
+
var UiAliasSchema = import_zod.z.enum([
|
|
206
|
+
"components",
|
|
207
|
+
"hooks",
|
|
208
|
+
"utils",
|
|
209
|
+
"lib",
|
|
210
|
+
"business",
|
|
211
|
+
"templates"
|
|
176
212
|
]);
|
|
177
|
-
var UiAliasSchema = import_zod.z.enum(["components", "hooks", "utils", "lib"]);
|
|
178
213
|
var UiEntryStatusSchema = import_zod.z.enum([
|
|
179
214
|
"stable",
|
|
180
215
|
"experimental",
|
|
@@ -204,8 +239,8 @@ var UiEntrySchema = import_zod.z.object({
|
|
|
204
239
|
files: import_zod.z.array(UiEntryFileSchema).min(1),
|
|
205
240
|
/**
|
|
206
241
|
* Optional path to an AI-readable meta document (frontmatter + Markdown).
|
|
207
|
-
*
|
|
208
|
-
*
|
|
242
|
+
* Read directly from `@teamix-evo/ui` by MCP at runtime — no consumer-side
|
|
243
|
+
* copy is written (per ADR 0020 §3).
|
|
209
244
|
*/
|
|
210
245
|
meta: import_zod.z.string().optional(),
|
|
211
246
|
/** Other UI entries this one depends on (e.g. "button" depends on "cn") */
|
|
@@ -237,7 +272,14 @@ var UiEntrySchema = import_zod.z.object({
|
|
|
237
272
|
* If this entry is `deprecated`, the id of the entry that supersedes it.
|
|
238
273
|
* Consumers (and AI) should migrate to `replacedBy` rather than this entry.
|
|
239
274
|
*/
|
|
240
|
-
replacedBy: import_zod.z.string().optional()
|
|
275
|
+
replacedBy: import_zod.z.string().optional(),
|
|
276
|
+
/**
|
|
277
|
+
* Variant identifier when this entry is shipped from a variant-aware
|
|
278
|
+
* package (`@teamix-evo/biz-ui` or `@teamix-evo/templates` per ADR 0014).
|
|
279
|
+
* Optional — entries from `@teamix-evo/ui` (variant-agnostic) leave it unset.
|
|
280
|
+
* MUST equal the variant directory name when present.
|
|
281
|
+
*/
|
|
282
|
+
variant: import_zod.z.string().optional()
|
|
241
283
|
});
|
|
242
284
|
var UiPackageManifestSchema = import_zod.z.object({
|
|
243
285
|
$schema: import_zod.z.string().optional(),
|
|
@@ -250,28 +292,160 @@ var UiPackageManifestSchema = import_zod.z.object({
|
|
|
250
292
|
engines: import_zod.z.object({
|
|
251
293
|
"teamix-evo": import_zod.z.string().min(1)
|
|
252
294
|
}),
|
|
253
|
-
/**
|
|
254
|
-
entries: import_zod.z.array(UiEntrySchema)
|
|
295
|
+
/** Active list of entries shipped (and exposed) by this package. */
|
|
296
|
+
entries: import_zod.z.array(UiEntrySchema),
|
|
297
|
+
/**
|
|
298
|
+
* Archived entries that are kept in source for Storybook documentation only
|
|
299
|
+
* and are NOT exposed through the active distribution chain. Per ADR 0028:
|
|
300
|
+
* - `teamix-evo ui add <id>` rejects ids found here unless `--include-deprecated` is passed
|
|
301
|
+
* - MCP `list_components` / `find_components` exclude these by default
|
|
302
|
+
* - Storybook keeps the story under `废弃 · Deprecated/` with a banner
|
|
303
|
+
* Optional for backwards compatibility — older manifests without this field
|
|
304
|
+
* still validate.
|
|
305
|
+
*/
|
|
306
|
+
deprecatedEntries: import_zod.z.array(UiEntrySchema).optional()
|
|
255
307
|
});
|
|
256
308
|
|
|
257
|
-
// src/schema/
|
|
309
|
+
// src/schema/tokens-pack.ts
|
|
258
310
|
var import_zod2 = require("zod");
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
311
|
+
var VARIANT_NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
312
|
+
var SEMVER_RE = /^\d+\.\d+\.\d+/;
|
|
313
|
+
var TokensPackLinkedSchema = import_zod2.z.object({
|
|
314
|
+
"biz-ui": import_zod2.z.string().optional(),
|
|
315
|
+
templates: import_zod2.z.string().optional()
|
|
316
|
+
});
|
|
317
|
+
var TokensVariantEntrySchema = import_zod2.z.object({
|
|
318
|
+
/** Variant id — lowercase kebab-case. */
|
|
319
|
+
name: import_zod2.z.string().min(1).regex(
|
|
320
|
+
VARIANT_NAME_RE,
|
|
321
|
+
"Variant name must be lowercase letters/digits/hyphens (no leading hyphen)."
|
|
322
|
+
),
|
|
323
|
+
/** Human-readable display name (e.g. "OpenTrek" for variant id "opentrek"). */
|
|
324
|
+
displayName: import_zod2.z.string().min(1),
|
|
325
|
+
/** Variant version — semver. May trail the package version when only a subset of variants change. */
|
|
326
|
+
version: import_zod2.z.string().regex(SEMVER_RE, "Invalid semver version"),
|
|
327
|
+
/** Optional one-liner description; surfaced in `tokens list-variants` output. */
|
|
328
|
+
description: import_zod2.z.string().optional(),
|
|
329
|
+
/**
|
|
330
|
+
* Files this variant advertises, paths relative to the tokens package root
|
|
331
|
+
* (e.g. `variants/opentrek/theme.css`). The validator walks these to
|
|
332
|
+
* confirm presence; the CLI consumes them at install time.
|
|
333
|
+
*/
|
|
334
|
+
files: import_zod2.z.array(import_zod2.z.string().min(1)).min(1),
|
|
335
|
+
/** Soft cross-package links (biz-ui / templates with the same variant name). */
|
|
336
|
+
linked: TokensPackLinkedSchema.optional()
|
|
337
|
+
});
|
|
338
|
+
var TokensPackageManifestSchema = import_zod2.z.object({
|
|
339
|
+
$schema: import_zod2.z.string().optional(),
|
|
340
|
+
schemaVersion: import_zod2.z.literal(1),
|
|
341
|
+
/** Always `"tokens"` — disambiguates from other teamix-evo package manifests. */
|
|
342
|
+
package: import_zod2.z.literal("tokens"),
|
|
343
|
+
/** Semver of the entire tokens package. */
|
|
344
|
+
version: import_zod2.z.string().regex(SEMVER_RE, "Invalid semver version"),
|
|
345
|
+
/** Engine compatibility. */
|
|
346
|
+
engines: import_zod2.z.object({ "teamix-evo": import_zod2.z.string().min(1) }),
|
|
347
|
+
/** Optional package-level description. */
|
|
348
|
+
description: import_zod2.z.string().optional(),
|
|
349
|
+
/** All shipped variants (excluding scaffold dirs that begin with `_`). */
|
|
350
|
+
variants: import_zod2.z.array(TokensVariantEntrySchema),
|
|
351
|
+
/**
|
|
352
|
+
* Reserved for future shared assets that span variants (e.g. browser
|
|
353
|
+
* quirks resets co-shipped at the package root). Empty array today.
|
|
354
|
+
*/
|
|
355
|
+
shared: import_zod2.z.array(import_zod2.z.string()).optional()
|
|
356
|
+
});
|
|
357
|
+
var TokensPackLockSchema = import_zod2.z.object({
|
|
358
|
+
$schema: import_zod2.z.string().optional(),
|
|
359
|
+
schemaVersion: import_zod2.z.literal(1),
|
|
360
|
+
variant: import_zod2.z.object({
|
|
361
|
+
name: import_zod2.z.string().min(1),
|
|
362
|
+
displayName: import_zod2.z.string().min(1),
|
|
363
|
+
version: import_zod2.z.string().regex(SEMVER_RE),
|
|
364
|
+
from: import_zod2.z.string().min(1)
|
|
365
|
+
// e.g. "@teamix-evo/tokens"
|
|
366
|
+
}),
|
|
367
|
+
/** Tokens package version — useful when variant version trails the package. */
|
|
368
|
+
packageVersion: import_zod2.z.string().regex(SEMVER_RE),
|
|
369
|
+
linked: TokensPackLinkedSchema.optional(),
|
|
370
|
+
installedAt: import_zod2.z.string().datetime()
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// src/schema/variant-ui-pack.ts
|
|
374
|
+
var import_zod3 = require("zod");
|
|
375
|
+
var SEMVER_RE2 = /^\d+\.\d+\.\d+/;
|
|
376
|
+
var VARIANT_NAME_RE2 = /^[a-z][a-z0-9-]*$/;
|
|
377
|
+
var VariantUiPackageNameSchema = import_zod3.z.enum(["biz-ui", "templates"]);
|
|
378
|
+
var VariantUiPackageManifestSchema = import_zod3.z.object({
|
|
379
|
+
$schema: import_zod3.z.string().optional(),
|
|
380
|
+
schemaVersion: import_zod3.z.literal(1),
|
|
381
|
+
/** Discriminator. */
|
|
382
|
+
package: VariantUiPackageNameSchema,
|
|
383
|
+
/**
|
|
384
|
+
* Variant identifier — lowercase kebab-case, MUST match the parent
|
|
385
|
+
* directory name (e.g. `opentrek` for `variants/opentrek/manifest.json`).
|
|
386
|
+
* `_template` is also accepted for the variant scaffold.
|
|
387
|
+
*/
|
|
388
|
+
variant: import_zod3.z.string().min(1).regex(
|
|
389
|
+
VARIANT_NAME_RE2,
|
|
390
|
+
'Variant id must be lowercase letters/digits/hyphens (no leading hyphen). Special: "_template" allowed.'
|
|
391
|
+
).or(import_zod3.z.literal("_template")),
|
|
392
|
+
/** Semver of this variant. */
|
|
393
|
+
version: import_zod3.z.string().regex(SEMVER_RE2, "Invalid semver version"),
|
|
394
|
+
/** Engine compatibility. */
|
|
395
|
+
engines: import_zod3.z.object({ "teamix-evo": import_zod3.z.string().min(1) }),
|
|
396
|
+
/** Flat list of entries shipped by this variant. */
|
|
397
|
+
entries: import_zod3.z.array(UiEntrySchema)
|
|
398
|
+
}).superRefine((data, ctx) => {
|
|
399
|
+
for (const [i, entry] of data.entries.entries()) {
|
|
400
|
+
if (entry.variant !== void 0 && entry.variant !== data.variant) {
|
|
401
|
+
ctx.addIssue({
|
|
402
|
+
code: import_zod3.z.ZodIssueCode.custom,
|
|
403
|
+
path: ["entries", i, "variant"],
|
|
404
|
+
message: `Entry "${entry.id}" declares variant "${entry.variant}" but lives in manifest of variant "${data.variant}".`
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
265
408
|
});
|
|
266
|
-
var
|
|
409
|
+
var VariantUiPackageCatalogSchema = import_zod3.z.object({
|
|
410
|
+
$schema: import_zod3.z.string().optional(),
|
|
411
|
+
schemaVersion: import_zod3.z.literal(1),
|
|
412
|
+
package: VariantUiPackageNameSchema,
|
|
413
|
+
/** Semver of the entire package. */
|
|
414
|
+
version: import_zod3.z.string().regex(SEMVER_RE2, "Invalid semver version"),
|
|
415
|
+
engines: import_zod3.z.object({ "teamix-evo": import_zod3.z.string().min(1) }),
|
|
416
|
+
/** Variants this package ships (excluding `_template`). */
|
|
417
|
+
variants: import_zod3.z.array(
|
|
418
|
+
import_zod3.z.object({
|
|
419
|
+
name: import_zod3.z.string().min(1).regex(VARIANT_NAME_RE2),
|
|
420
|
+
displayName: import_zod3.z.string().min(1),
|
|
421
|
+
version: import_zod3.z.string().regex(SEMVER_RE2),
|
|
422
|
+
description: import_zod3.z.string().optional()
|
|
423
|
+
})
|
|
424
|
+
)
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
// src/schema/config.ts
|
|
428
|
+
var import_zod4 = require("zod");
|
|
429
|
+
var TailwindVersionSchema = import_zod4.z.literal("v4");
|
|
430
|
+
var UiAliasesSchema = import_zod4.z.object({
|
|
431
|
+
components: import_zod4.z.string().min(1),
|
|
432
|
+
hooks: import_zod4.z.string().min(1),
|
|
433
|
+
utils: import_zod4.z.string().min(1),
|
|
434
|
+
lib: import_zod4.z.string().min(1),
|
|
435
|
+
/** Biz-ui components (variant-bound). Defaults to `src/components/business/`. */
|
|
436
|
+
business: import_zod4.z.string().min(1).default("src/components/business"),
|
|
437
|
+
/** Page templates (variant-bound). Defaults to `src/templates/`. */
|
|
438
|
+
templates: import_zod4.z.string().min(1).default("src/templates")
|
|
439
|
+
});
|
|
440
|
+
var PackageEntrySchema = import_zod4.z.object({
|
|
267
441
|
/** Variant identifier (e.g. "opentrek"; use "_flat" for skills/ui) */
|
|
268
|
-
variant:
|
|
442
|
+
variant: import_zod4.z.string().min(1),
|
|
269
443
|
/** Semver version string */
|
|
270
|
-
version:
|
|
444
|
+
version: import_zod4.z.string().min(1),
|
|
271
445
|
/** Tailwind CSS version this project uses (only meaningful for design package). */
|
|
272
446
|
tailwind: TailwindVersionSchema.optional(),
|
|
273
447
|
/** IDEs this package was installed for (only meaningful for skills package). */
|
|
274
|
-
ides:
|
|
448
|
+
ides: import_zod4.z.array(SkillIdeSchema).optional(),
|
|
275
449
|
/** Install scope (only meaningful for skills package). */
|
|
276
450
|
scope: SkillScopeSchema.optional(),
|
|
277
451
|
/** Path aliases for ui entry installation (only meaningful for ui package). */
|
|
@@ -280,53 +454,79 @@ var PackageEntrySchema = import_zod2.z.object({
|
|
|
280
454
|
* Default icon library declared by the project (only meaningful for ui).
|
|
281
455
|
* Declarative only — does NOT trigger code rewrites; ui entries hardcode imports.
|
|
282
456
|
*/
|
|
283
|
-
iconLibrary:
|
|
457
|
+
iconLibrary: import_zod4.z.string().min(1).optional(),
|
|
284
458
|
/** Whether the project uses TSX (true) or JSX (false). ui-specific. */
|
|
285
|
-
tsx:
|
|
459
|
+
tsx: import_zod4.z.boolean().optional(),
|
|
286
460
|
/** Whether to emit React Server Components markers (`"use client"`). ui-specific. */
|
|
287
|
-
rsc:
|
|
461
|
+
rsc: import_zod4.z.boolean().optional()
|
|
288
462
|
});
|
|
289
|
-
var ProjectConfigSchema =
|
|
290
|
-
$schema:
|
|
291
|
-
schemaVersion:
|
|
463
|
+
var ProjectConfigSchema = import_zod4.z.object({
|
|
464
|
+
$schema: import_zod4.z.string().optional(),
|
|
465
|
+
schemaVersion: import_zod4.z.literal(1),
|
|
292
466
|
/** IDE identifier */
|
|
293
|
-
ide:
|
|
467
|
+
ide: import_zod4.z.string().min(1),
|
|
294
468
|
/** Installed packages keyed by package name */
|
|
295
|
-
packages:
|
|
469
|
+
packages: import_zod4.z.record(import_zod4.z.string(), PackageEntrySchema)
|
|
296
470
|
});
|
|
297
471
|
|
|
298
472
|
// src/schema/installed.ts
|
|
299
|
-
var
|
|
300
|
-
var InstalledResourceSchema =
|
|
473
|
+
var import_zod5 = require("zod");
|
|
474
|
+
var InstalledResourceSchema = import_zod5.z.object({
|
|
301
475
|
/** Resource identifier matching the variant manifest */
|
|
302
|
-
id:
|
|
476
|
+
id: import_zod5.z.string().min(1),
|
|
303
477
|
/** Target path where the resource was installed (absolute or project-relative) */
|
|
304
|
-
target:
|
|
478
|
+
target: import_zod5.z.string().min(1),
|
|
305
479
|
/** Content hash for change detection (e.g. "sha256:...") */
|
|
306
|
-
hash:
|
|
480
|
+
hash: import_zod5.z.string().min(1),
|
|
307
481
|
/** Update strategy that was applied */
|
|
308
|
-
strategy:
|
|
482
|
+
strategy: import_zod5.z.enum(["frozen", "regenerable", "managed"]),
|
|
309
483
|
/** IDE this resource was installed for (skill resources only) */
|
|
310
484
|
ide: SkillIdeSchema.optional(),
|
|
311
485
|
/** Install scope (skill resources only) */
|
|
312
486
|
scope: SkillScopeSchema.optional()
|
|
313
487
|
});
|
|
314
|
-
var InstalledPackageSchema =
|
|
315
|
-
/** Full package name (e.g. "@teamix-evo/
|
|
316
|
-
package:
|
|
488
|
+
var InstalledPackageSchema = import_zod5.z.object({
|
|
489
|
+
/** Full package name (e.g. "@teamix-evo/tokens") */
|
|
490
|
+
package: import_zod5.z.string().min(1),
|
|
317
491
|
/** Variant identifier (use "_flat" for non-variant packages such as skills) */
|
|
318
|
-
variant:
|
|
492
|
+
variant: import_zod5.z.string().min(1),
|
|
319
493
|
/** Installed version */
|
|
320
|
-
version:
|
|
494
|
+
version: import_zod5.z.string().min(1),
|
|
321
495
|
/** ISO 8601 timestamp of installation */
|
|
322
|
-
installedAt:
|
|
496
|
+
installedAt: import_zod5.z.string().min(1),
|
|
323
497
|
/** List of installed resources */
|
|
324
|
-
resources:
|
|
498
|
+
resources: import_zod5.z.array(InstalledResourceSchema)
|
|
325
499
|
});
|
|
326
|
-
var InstalledManifestSchema =
|
|
327
|
-
schemaVersion:
|
|
500
|
+
var InstalledManifestSchema = import_zod5.z.object({
|
|
501
|
+
schemaVersion: import_zod5.z.literal(1),
|
|
328
502
|
/** List of installed packages */
|
|
329
|
-
installed:
|
|
503
|
+
installed: import_zod5.z.array(InstalledPackageSchema)
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
// src/schema/skills-lock.ts
|
|
507
|
+
var import_zod6 = require("zod");
|
|
508
|
+
var SkillsLockEntrySchema = import_zod6.z.object({
|
|
509
|
+
/** Semver version installed from upstream */
|
|
510
|
+
version: import_zod6.z.string().min(1),
|
|
511
|
+
/** Upstream package name (typically `@teamix-evo/skills`) */
|
|
512
|
+
from: import_zod6.z.string().min(1),
|
|
513
|
+
/** ISO 8601 install / last-sync timestamp */
|
|
514
|
+
installedAt: import_zod6.z.string().min(1),
|
|
515
|
+
/** Install scope at time of mirror */
|
|
516
|
+
scope: SkillScopeSchema,
|
|
517
|
+
/**
|
|
518
|
+
* IDEs this skill was mirrored to. Each ide ↔ a mirror path under
|
|
519
|
+
* `<projectRoot>/.<ide>/skills/<id>/` (project) or `~/.<ide>/skills/<id>/`
|
|
520
|
+
* (global). The path itself is reconstructed from `scope` + adapter; we
|
|
521
|
+
* record the ide identifier rather than the full path to keep the lock
|
|
522
|
+
* portable across machines.
|
|
523
|
+
*/
|
|
524
|
+
mirroredTo: import_zod6.z.array(SkillIdeSchema)
|
|
525
|
+
});
|
|
526
|
+
var SkillsLockSchema = import_zod6.z.object({
|
|
527
|
+
schemaVersion: import_zod6.z.literal(1),
|
|
528
|
+
/** Map of skill id → lock entry */
|
|
529
|
+
skills: import_zod6.z.record(import_zod6.z.string().min(1), SkillsLockEntrySchema)
|
|
330
530
|
});
|
|
331
531
|
|
|
332
532
|
// src/loader.ts
|
|
@@ -336,8 +536,8 @@ var path = __toESM(require("path"), 1);
|
|
|
336
536
|
// src/validator.ts
|
|
337
537
|
function formatZodError(error) {
|
|
338
538
|
return error.issues.map((issue) => {
|
|
339
|
-
const
|
|
340
|
-
return ` - ${
|
|
539
|
+
const path4 = issue.path.length > 0 ? issue.path.join(".") : "(root)";
|
|
540
|
+
return ` - ${path4}: ${issue.message}`;
|
|
341
541
|
}).join("\n");
|
|
342
542
|
}
|
|
343
543
|
function validateManifest(data) {
|
|
@@ -373,6 +573,17 @@ function validateInstalled(data) {
|
|
|
373
573
|
${formatZodError(result.error)}`
|
|
374
574
|
};
|
|
375
575
|
}
|
|
576
|
+
function validateSkillsLock(data) {
|
|
577
|
+
const result = SkillsLockSchema.safeParse(data);
|
|
578
|
+
if (result.success) {
|
|
579
|
+
return { success: true, data: result.data };
|
|
580
|
+
}
|
|
581
|
+
return {
|
|
582
|
+
success: false,
|
|
583
|
+
error: `Invalid skills lock:
|
|
584
|
+
${formatZodError(result.error)}`
|
|
585
|
+
};
|
|
586
|
+
}
|
|
376
587
|
function validateSkillsPackage(data) {
|
|
377
588
|
const result = SkillsPackageManifestSchema.safeParse(data);
|
|
378
589
|
if (result.success) {
|
|
@@ -429,22 +640,22 @@ function validateUiDependencyGraph(entries) {
|
|
|
429
640
|
const color = /* @__PURE__ */ new Map();
|
|
430
641
|
for (const id of idToEntry.keys()) color.set(id, WHITE);
|
|
431
642
|
const cycles = [];
|
|
432
|
-
function dfs(id,
|
|
643
|
+
function dfs(id, path4) {
|
|
433
644
|
color.set(id, GRAY);
|
|
434
|
-
|
|
645
|
+
path4.push(id);
|
|
435
646
|
const entry = idToEntry.get(id);
|
|
436
647
|
const deps = entry?.registryDependencies ?? [];
|
|
437
648
|
for (const dep of deps) {
|
|
438
649
|
if (!idToEntry.has(dep)) continue;
|
|
439
650
|
const c = color.get(dep);
|
|
440
651
|
if (c === GRAY) {
|
|
441
|
-
const startIdx =
|
|
442
|
-
cycles.push([...
|
|
652
|
+
const startIdx = path4.indexOf(dep);
|
|
653
|
+
cycles.push([...path4.slice(startIdx), dep]);
|
|
443
654
|
} else if (c === WHITE) {
|
|
444
|
-
dfs(dep,
|
|
655
|
+
dfs(dep, path4);
|
|
445
656
|
}
|
|
446
657
|
}
|
|
447
|
-
|
|
658
|
+
path4.pop();
|
|
448
659
|
color.set(id, BLACK);
|
|
449
660
|
}
|
|
450
661
|
for (const id of idToEntry.keys()) {
|
|
@@ -566,6 +777,100 @@ async function loadUiPackageManifest(packageDir) {
|
|
|
566
777
|
return result.data;
|
|
567
778
|
}
|
|
568
779
|
|
|
780
|
+
// src/tokens-pack-loader.ts
|
|
781
|
+
var fs2 = __toESM(require("fs/promises"), 1);
|
|
782
|
+
var path2 = __toESM(require("path"), 1);
|
|
783
|
+
async function loadTokensPackageManifest(packageDir) {
|
|
784
|
+
const manifestPath = path2.join(packageDir, "manifest.json");
|
|
785
|
+
let raw;
|
|
786
|
+
try {
|
|
787
|
+
raw = await fs2.readFile(manifestPath, "utf-8");
|
|
788
|
+
} catch (err) {
|
|
789
|
+
const code = err.code;
|
|
790
|
+
if (code === "ENOENT") {
|
|
791
|
+
throw new Error(`Tokens package manifest not found: ${manifestPath}`);
|
|
792
|
+
}
|
|
793
|
+
throw new Error(
|
|
794
|
+
`Failed to read tokens package manifest at ${manifestPath}: ${err.message}`
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
let parsed;
|
|
798
|
+
try {
|
|
799
|
+
parsed = JSON.parse(raw);
|
|
800
|
+
} catch {
|
|
801
|
+
throw new Error(
|
|
802
|
+
`Invalid JSON in tokens package manifest at ${manifestPath}`
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
const result = TokensPackageManifestSchema.safeParse(parsed);
|
|
806
|
+
if (!result.success) {
|
|
807
|
+
throw new Error(
|
|
808
|
+
`Invalid tokens package manifest:
|
|
809
|
+
${result.error.message}
|
|
810
|
+
File: ${manifestPath}`
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
return result.data;
|
|
814
|
+
}
|
|
815
|
+
function getVariantEntry(catalog, variantName) {
|
|
816
|
+
return catalog.variants.find((v) => v.name === variantName);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// src/variant-ui-pack-loader.ts
|
|
820
|
+
var fs3 = __toESM(require("fs/promises"), 1);
|
|
821
|
+
var path3 = __toESM(require("path"), 1);
|
|
822
|
+
async function readJson(filePath, kind) {
|
|
823
|
+
let raw;
|
|
824
|
+
try {
|
|
825
|
+
raw = await fs3.readFile(filePath, "utf-8");
|
|
826
|
+
} catch (err) {
|
|
827
|
+
const code = err.code;
|
|
828
|
+
if (code === "ENOENT") {
|
|
829
|
+
throw new Error(`${kind} not found: ${filePath}`);
|
|
830
|
+
}
|
|
831
|
+
throw new Error(
|
|
832
|
+
`Failed to read ${kind} at ${filePath}: ${err.message}`
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
try {
|
|
836
|
+
return JSON.parse(raw);
|
|
837
|
+
} catch {
|
|
838
|
+
throw new Error(`Invalid JSON in ${kind} at ${filePath}`);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
async function loadVariantUiPackageCatalog(packageDir) {
|
|
842
|
+
const manifestPath = path3.join(packageDir, "manifest.json");
|
|
843
|
+
const data = await readJson(manifestPath, "variant-ui catalog");
|
|
844
|
+
const result = VariantUiPackageCatalogSchema.safeParse(data);
|
|
845
|
+
if (!result.success) {
|
|
846
|
+
throw new Error(
|
|
847
|
+
`Invalid catalog:
|
|
848
|
+
${result.error.message}
|
|
849
|
+
File: ${manifestPath}`
|
|
850
|
+
);
|
|
851
|
+
}
|
|
852
|
+
return result.data;
|
|
853
|
+
}
|
|
854
|
+
async function loadVariantUiPackageManifest(variantDir) {
|
|
855
|
+
const manifestPath = path3.join(variantDir, "manifest.json");
|
|
856
|
+
const data = await readJson(manifestPath, "variant-ui manifest");
|
|
857
|
+
const result = VariantUiPackageManifestSchema.safeParse(data);
|
|
858
|
+
if (!result.success) {
|
|
859
|
+
throw new Error(
|
|
860
|
+
`Invalid variant manifest:
|
|
861
|
+
${result.error.message}
|
|
862
|
+
File: ${manifestPath}`
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
const dirName = path3.basename(variantDir);
|
|
866
|
+
if (result.data.variant !== dirName) {
|
|
867
|
+
throw new Error(
|
|
868
|
+
`Variant manifest mismatch: variants/${dirName}/manifest.json declares variant="${result.data.variant}". Names must match.`
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
return result.data;
|
|
872
|
+
}
|
|
873
|
+
|
|
569
874
|
// src/managed-regions.ts
|
|
570
875
|
var REGION_PATTERN = /<!-- teamix-evo:managed:start id="([^"]+)" -->([\s\S]*?)<!-- teamix-evo:managed:end id="\1" -->/g;
|
|
571
876
|
var START_MARKER_PATTERN = /<!-- teamix-evo:managed:start id="([^"]+)" -->/g;
|
|
@@ -698,8 +1003,14 @@ function getUpdateAction(strategy, options) {
|
|
|
698
1003
|
SkillEntrySchema,
|
|
699
1004
|
SkillIdeSchema,
|
|
700
1005
|
SkillScopeSchema,
|
|
1006
|
+
SkillsLockEntrySchema,
|
|
1007
|
+
SkillsLockSchema,
|
|
701
1008
|
SkillsPackageManifestSchema,
|
|
702
1009
|
TailwindVersionSchema,
|
|
1010
|
+
TokensPackLinkedSchema,
|
|
1011
|
+
TokensPackLockSchema,
|
|
1012
|
+
TokensPackageManifestSchema,
|
|
1013
|
+
TokensVariantEntrySchema,
|
|
703
1014
|
UiAliasSchema,
|
|
704
1015
|
UiAliasesSchema,
|
|
705
1016
|
UiEntryFileSchema,
|
|
@@ -708,11 +1019,18 @@ function getUpdateAction(strategy, options) {
|
|
|
708
1019
|
UiPackageManifestSchema,
|
|
709
1020
|
UpdateStrategySchema,
|
|
710
1021
|
VariantManifestSchema,
|
|
1022
|
+
VariantUiPackageCatalogSchema,
|
|
1023
|
+
VariantUiPackageManifestSchema,
|
|
1024
|
+
VariantUiPackageNameSchema,
|
|
711
1025
|
getUpdateAction,
|
|
1026
|
+
getVariantEntry,
|
|
712
1027
|
hasManagedRegion,
|
|
713
1028
|
loadSkillsPackageManifest,
|
|
1029
|
+
loadTokensPackageManifest,
|
|
714
1030
|
loadUiPackageManifest,
|
|
715
1031
|
loadVariantManifest,
|
|
1032
|
+
loadVariantUiPackageCatalog,
|
|
1033
|
+
loadVariantUiPackageManifest,
|
|
716
1034
|
parseManagedRegions,
|
|
717
1035
|
replaceManagedRegion,
|
|
718
1036
|
resolveUiEntryOrder,
|
|
@@ -720,6 +1038,7 @@ function getUpdateAction(strategy, options) {
|
|
|
720
1038
|
validateConfig,
|
|
721
1039
|
validateInstalled,
|
|
722
1040
|
validateManifest,
|
|
1041
|
+
validateSkillsLock,
|
|
723
1042
|
validateSkillsPackage,
|
|
724
1043
|
validateUiDependencyGraph,
|
|
725
1044
|
validateUiPackage
|