@decantr/cli 1.5.3 → 1.5.5

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/bin.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-QZVA3PFR.js";
3
- import "./chunk-B5OX2EXL.js";
2
+ import "./chunk-4KKFOXBB.js";
3
+ import "./chunk-MU3657R7.js";
@@ -9,7 +9,7 @@ import {
9
9
  scaffoldMinimal,
10
10
  scaffoldProject,
11
11
  syncRegistry
12
- } from "./chunk-B5OX2EXL.js";
12
+ } from "./chunk-MU3657R7.js";
13
13
 
14
14
  // src/index.ts
15
15
  import { readFileSync as readFileSync15, existsSync as existsSync23, readdirSync as readdirSync6 } from "fs";
@@ -284,7 +284,7 @@ async function runInteractivePrompts(detected, archetypes, blueprints, themes) {
284
284
  "Guard enforcement level",
285
285
  [
286
286
  { value: "creative", label: "creative", description: "Advisory only (new projects)" },
287
- { value: "guided", label: "guided", description: "Style, structure, recipe enforced" },
287
+ { value: "guided", label: "guided", description: "Style, structure, density enforced" },
288
288
  { value: "strict", label: "strict", description: "All 5 rules enforced exactly" }
289
289
  ],
290
290
  detected.existingEssence ? 1 : 2
@@ -649,7 +649,6 @@ import { join as join4 } from "path";
649
649
  import { RegistryAPIClient } from "@decantr/registry";
650
650
  var PLURAL_TO_SINGULAR = {
651
651
  patterns: "pattern",
652
- recipes: "recipe",
653
652
  themes: "theme",
654
653
  blueprints: "blueprint",
655
654
  archetypes: "archetype",
@@ -657,7 +656,6 @@ var PLURAL_TO_SINGULAR = {
657
656
  };
658
657
  var SINGULAR_TO_PLURAL = {
659
658
  pattern: "patterns",
660
- recipe: "recipes",
661
659
  theme: "themes",
662
660
  blueprint: "blueprints",
663
661
  archetype: "archetypes",
@@ -710,10 +708,9 @@ async function cmdPublish(type, name, projectRoot = process.cwd()) {
710
708
  // src/commands/create.ts
711
709
  import { existsSync as existsSync5, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
712
710
  import { join as join5 } from "path";
713
- var CONTENT_TYPES = ["pattern", "recipe", "theme", "blueprint", "archetype", "shell"];
711
+ var CONTENT_TYPES = ["pattern", "theme", "blueprint", "archetype", "shell"];
714
712
  var PLURAL = {
715
713
  pattern: "patterns",
716
- recipe: "recipes",
717
714
  theme: "themes",
718
715
  blueprint: "blueprints",
719
716
  archetype: "archetypes",
@@ -730,8 +727,6 @@ function getSkeleton(type, id, name) {
730
727
  switch (type) {
731
728
  case "pattern":
732
729
  return { ...base, components: [], presets: {}, layout: {} };
733
- case "recipe":
734
- return { ...base, shell: {}, spatial: {}, effects: {} };
735
730
  case "theme":
736
731
  return { ...base, seed: { primary: "#6500C6", secondary: "#0AF3EB", accent: "#F58882", background: "#0D0D1A" }, modes: ["dark"], shapes: ["rounded"] };
737
732
  case "blueprint":
@@ -1339,7 +1334,7 @@ var DIM7 = "\x1B[2m";
1339
1334
  var RESET7 = "\x1B[0m";
1340
1335
  async function cmdThemeSwitch(themeName, args, projectRoot = process.cwd()) {
1341
1336
  if (!themeName) {
1342
- console.error(`${RED6}Usage: decantr theme switch <themeName> [--recipe <r>] [--shape <s>] [--mode <m>]${RESET7}`);
1337
+ console.error(`${RED6}Usage: decantr theme switch <themeName> [--shape <s>] [--mode <m>]${RESET7}`);
1343
1338
  process.exitCode = 1;
1344
1339
  return;
1345
1340
  }
@@ -1363,16 +1358,11 @@ async function cmdThemeSwitch(themeName, args, projectRoot = process.cwd()) {
1363
1358
  return;
1364
1359
  }
1365
1360
  const essence = migrateV30ToV313(parsed);
1366
- let recipe;
1367
1361
  let shape;
1368
1362
  let mode;
1369
1363
  for (let i = 0; i < args.length; i++) {
1370
1364
  const arg = args[i];
1371
- if (arg.startsWith("--recipe=")) {
1372
- recipe = arg.split("=")[1];
1373
- } else if (arg === "--recipe" && args[i + 1] && !args[i + 1].startsWith("-")) {
1374
- recipe = args[++i];
1375
- } else if (arg.startsWith("--shape=")) {
1365
+ if (arg.startsWith("--shape=")) {
1376
1366
  shape = arg.split("=")[1];
1377
1367
  } else if (arg === "--shape" && args[i + 1] && !args[i + 1].startsWith("-")) {
1378
1368
  shape = args[++i];
@@ -1382,13 +1372,10 @@ async function cmdThemeSwitch(themeName, args, projectRoot = process.cwd()) {
1382
1372
  mode = args[++i];
1383
1373
  }
1384
1374
  }
1385
- const oldStyle = essence.dna.theme.style;
1386
- essence.dna.theme.style = themeName;
1387
- if (recipe) {
1388
- essence.dna.theme.recipe = recipe;
1389
- } else {
1390
- essence.dna.theme.recipe = themeName;
1391
- }
1375
+ const oldThemeId = essence.dna.theme.id || essence.dna.theme.style;
1376
+ essence.dna.theme.id = themeName;
1377
+ delete essence.dna.theme.style;
1378
+ delete essence.dna.theme.recipe;
1392
1379
  if (shape) {
1393
1380
  essence.dna.theme.shape = shape;
1394
1381
  }
@@ -1398,29 +1385,27 @@ async function cmdThemeSwitch(themeName, args, projectRoot = process.cwd()) {
1398
1385
  const registryClient = new RegistryClient({
1399
1386
  cacheDir: join11(projectRoot, ".decantr", "cache")
1400
1387
  });
1401
- const recipeName = essence.dna.theme.recipe;
1402
1388
  try {
1403
- const recipeResult = await registryClient.fetchRecipe(recipeName);
1404
- if (recipeResult?.data) {
1405
- const raw = recipeResult.data;
1389
+ const themeResult = await registryClient.fetchTheme(themeName);
1390
+ if (themeResult?.data) {
1391
+ const raw = themeResult.data;
1406
1392
  const inner = raw.data ?? raw;
1407
- if (inner.radius_hints) {
1393
+ if (inner.radius) {
1408
1394
  essence.dna.radius = {
1409
1395
  ...essence.dna.radius,
1410
- philosophy: inner.radius_hints.philosophy || essence.dna.radius.philosophy,
1411
- base: inner.radius_hints.base ?? essence.dna.radius.base
1396
+ philosophy: inner.radius.philosophy || essence.dna.radius.philosophy,
1397
+ base: inner.radius.base ?? essence.dna.radius.base
1412
1398
  };
1413
1399
  }
1414
1400
  }
1415
1401
  } catch {
1416
1402
  }
1417
1403
  writeFileSync8(essencePath, JSON.stringify(essence, null, 2) + "\n");
1418
- console.log(`${GREEN7}Switched theme: ${oldStyle} \u2192 ${themeName}${RESET7}`);
1419
- if (recipe) console.log(` ${DIM7}Recipe: ${recipe}${RESET7}`);
1404
+ console.log(`${GREEN7}Switched theme: ${oldThemeId} \u2192 ${themeName}${RESET7}`);
1420
1405
  if (shape) console.log(` ${DIM7}Shape: ${shape}${RESET7}`);
1421
1406
  if (mode) console.log(` ${DIM7}Mode: ${mode}${RESET7}`);
1422
1407
  await refreshDerivedFiles(projectRoot, essence, registryClient);
1423
- console.log(`${GREEN7}Derived files refreshed (tokens.css, decorators.css, all contexts).${RESET7}`);
1408
+ console.log(`${GREEN7}Derived files refreshed (tokens.css, treatments.css, all contexts).${RESET7}`);
1424
1409
  console.log(`${YELLOW4}Guard will flag code using old tokens. Run \`decantr check\`.${RESET7}`);
1425
1410
  }
1426
1411
 
@@ -2467,7 +2452,7 @@ async function cmdMagic(prompt, projectRoot, options) {
2467
2452
  existing: false
2468
2453
  };
2469
2454
  if (blueprintData) {
2470
- if (blueprintData.theme?.style) initOptions.theme = blueprintData.theme.style;
2455
+ if (blueprintData.theme?.id || blueprintData.theme?.style) initOptions.theme = blueprintData.theme.id || blueprintData.theme.style;
2471
2456
  if (blueprintData.theme?.mode) initOptions.mode = blueprintData.theme.mode;
2472
2457
  if (blueprintData.theme?.shape) initOptions.shape = blueprintData.theme.shape;
2473
2458
  if (blueprintData.personality) {
@@ -2499,8 +2484,6 @@ async function cmdMagic(prompt, projectRoot, options) {
2499
2484
  let patternSpecs;
2500
2485
  let topologyMarkdown = "";
2501
2486
  let themeData;
2502
- let recipeData;
2503
- let blueprintRecipeName;
2504
2487
  let registrySource = apiAvailable ? "api" : "cache";
2505
2488
  if (blueprintData?.compose && blueprintData.compose.length > 0) {
2506
2489
  const entries = blueprintData.compose;
@@ -2604,7 +2587,6 @@ async function cmdMagic(prompt, projectRoot, options) {
2604
2587
  initOptions.personality
2605
2588
  );
2606
2589
  }
2607
- blueprintRecipeName = blueprintData.theme?.recipe;
2608
2590
  console.log(`${BOLD4} Composition:${RESET9}`);
2609
2591
  console.log(` Sections: ${composedSections.sections.length} (${composedSections.sections.map((s) => s.id).join(", ")})`);
2610
2592
  const totalRoutes = Object.keys(routeMap).length;
@@ -2630,23 +2612,16 @@ async function cmdMagic(prompt, projectRoot, options) {
2630
2612
  palette: theme.palette,
2631
2613
  tokens: theme.tokens,
2632
2614
  cvd_support: theme.cvd_support,
2633
- typography_hints: theme.typography_hints,
2634
- motion_hints: theme.motion_hints
2635
- };
2636
- if (theme.decorators) {
2637
- recipeData = { decorators: theme.decorators };
2638
- }
2639
- }
2640
- const recipeName = blueprintRecipeName || initOptions.theme;
2641
- const recipeResult = await registryClient.fetchRecipe(recipeName);
2642
- if (recipeResult) {
2643
- const rawRecipe = recipeResult.data;
2644
- const recipe = rawRecipe.data ?? rawRecipe;
2645
- recipeData = {
2646
- decorators: recipe.decorators || recipeData?.decorators,
2647
- spatial_hints: recipe.spatial_hints,
2648
- radius_hints: recipe.radius_hints,
2649
- treatment_overrides: recipe.treatment_overrides
2615
+ typography: theme.typography,
2616
+ motion: theme.motion,
2617
+ decorators: theme.decorators,
2618
+ treatments: theme.treatments,
2619
+ spatial: theme.spatial,
2620
+ radius: theme.radius,
2621
+ shell: theme.shell,
2622
+ effects: theme.effects,
2623
+ compositions: theme.compositions,
2624
+ pattern_preferences: theme.pattern_preferences
2650
2625
  };
2651
2626
  }
2652
2627
  }
@@ -2659,7 +2634,6 @@ async function cmdMagic(prompt, projectRoot, options) {
2659
2634
  archetypeData,
2660
2635
  registrySource,
2661
2636
  themeData,
2662
- recipeData,
2663
2637
  topologyMarkdown,
2664
2638
  composedSections,
2665
2639
  routeMap,
@@ -2916,7 +2890,6 @@ var ALL_CONTENT_TYPES = [
2916
2890
  "patterns",
2917
2891
  "archetypes",
2918
2892
  "themes",
2919
- "recipes",
2920
2893
  "blueprints",
2921
2894
  "shells"
2922
2895
  ];
@@ -3359,7 +3332,7 @@ async function cmdSuggest(query, type) {
3359
3332
  }
3360
3333
  }
3361
3334
  async function cmdGet(type, id) {
3362
- const validTypes = ["pattern", "archetype", "recipe", "theme", "blueprint", "shell"];
3335
+ const validTypes = ["pattern", "archetype", "theme", "blueprint", "shell"];
3363
3336
  if (!validTypes.includes(type)) {
3364
3337
  console.error(error3(`Invalid type "${type}". Must be one of: ${validTypes.join(", ")}`));
3365
3338
  process.exitCode = 1;
@@ -3368,7 +3341,6 @@ async function cmdGet(type, id) {
3368
3341
  const typeMap = {
3369
3342
  pattern: "patterns",
3370
3343
  archetype: "archetypes",
3371
- recipe: "recipes",
3372
3344
  theme: "themes",
3373
3345
  blueprint: "blueprints",
3374
3346
  shell: "shells"
@@ -3497,7 +3469,7 @@ async function cmdValidate(path) {
3497
3469
  }
3498
3470
  }
3499
3471
  async function cmdList(type) {
3500
- const validTypes = ["patterns", "archetypes", "recipes", "themes", "blueprints", "shells"];
3472
+ const validTypes = ["patterns", "archetypes", "themes", "blueprints", "shells"];
3501
3473
  if (!validTypes.includes(type)) {
3502
3474
  console.error(error3(`Invalid type "${type}". Must be one of: ${validTypes.join(", ")}`));
3503
3475
  process.exitCode = 1;
@@ -3611,7 +3583,6 @@ ${YELLOW9}You're offline. Scaffolding Decantr default.${RESET13}`);
3611
3583
  } else {
3612
3584
  options = await runInteractivePrompts(detected, archetypes, blueprints, themes);
3613
3585
  }
3614
- let blueprintRecipeName;
3615
3586
  let topologyMarkdown = "";
3616
3587
  let archetypeData;
3617
3588
  let composedSections;
@@ -3624,8 +3595,8 @@ ${YELLOW9}You're offline. Scaffolding Decantr default.${RESET13}`);
3624
3595
  const rawBlueprint = blueprintResult.data;
3625
3596
  const blueprint = rawBlueprint.data ?? rawBlueprint;
3626
3597
  if (blueprint.theme) {
3627
- if (blueprint.theme.style && options.theme === "luminarum") {
3628
- options.theme = blueprint.theme.style;
3598
+ if ((blueprint.theme.id || blueprint.theme.style) && options.theme === "luminarum") {
3599
+ options.theme = blueprint.theme.id || blueprint.theme.style;
3629
3600
  }
3630
3601
  if (blueprint.theme.mode && options.mode === "dark") {
3631
3602
  options.mode = blueprint.theme.mode;
@@ -3637,7 +3608,6 @@ ${YELLOW9}You're offline. Scaffolding Decantr default.${RESET13}`);
3637
3608
  if (blueprint.personality && (!options.personality || options.personality.length === 0 || options.personality.length === 1 && options.personality[0] === "professional")) {
3638
3609
  options.personality = typeof blueprint.personality === "string" ? [blueprint.personality] : blueprint.personality;
3639
3610
  }
3640
- blueprintRecipeName = blueprint.theme?.recipe;
3641
3611
  if (blueprint.compose && blueprint.compose.length > 0) {
3642
3612
  const entries = blueprint.compose;
3643
3613
  const results = [];
@@ -3754,7 +3724,6 @@ ${YELLOW9}You're offline. Scaffolding Decantr default.${RESET13}`);
3754
3724
  }
3755
3725
  }
3756
3726
  let themeData;
3757
- let recipeData;
3758
3727
  if (options.theme) {
3759
3728
  const themeResult = await registryClient.fetchTheme(options.theme);
3760
3729
  if (themeResult) {
@@ -3765,31 +3734,20 @@ ${YELLOW9}You're offline. Scaffolding Decantr default.${RESET13}`);
3765
3734
  palette: theme.palette,
3766
3735
  tokens: theme.tokens,
3767
3736
  cvd_support: theme.cvd_support,
3768
- typography_hints: theme.typography_hints,
3769
- motion_hints: theme.motion_hints
3737
+ typography: theme.typography,
3738
+ motion: theme.motion,
3739
+ decorators: theme.decorators,
3740
+ treatments: theme.treatments,
3741
+ spatial: theme.spatial,
3742
+ radius: theme.radius,
3743
+ shell: theme.shell,
3744
+ effects: theme.effects,
3745
+ compositions: theme.compositions,
3746
+ pattern_preferences: theme.pattern_preferences
3770
3747
  };
3771
- if (theme.decorators) {
3772
- recipeData = { decorators: theme.decorators };
3773
- }
3774
3748
  } else {
3775
3749
  console.log(`${YELLOW9} Warning: Could not fetch theme "${options.theme}". Using defaults.${RESET13}`);
3776
3750
  }
3777
- const recipeName = blueprintRecipeName || options.theme;
3778
- const recipeResult = await registryClient.fetchRecipe(recipeName);
3779
- if (process.env.DECANTR_DEBUG && recipeResult) {
3780
- const dbg = recipeResult.data;
3781
- console.error(` [debug] recipe source: ${recipeResult.source.type}, keys: ${Object.keys(dbg).join(",")}, has .data: ${"data" in dbg}, has .decorators: ${"decorators" in dbg}, inner.decorators: ${!!dbg.data?.decorators}`);
3782
- }
3783
- if (recipeResult) {
3784
- const rawRecipe = recipeResult.data;
3785
- const recipe = rawRecipe.data ?? rawRecipe;
3786
- recipeData = {
3787
- decorators: recipe.decorators || recipeData?.decorators,
3788
- spatial_hints: recipe.spatial_hints,
3789
- radius_hints: recipe.radius_hints,
3790
- treatment_overrides: recipe.treatment_overrides
3791
- };
3792
- }
3793
3751
  }
3794
3752
  console.log(heading2("Scaffolding project..."));
3795
3753
  const result = await scaffoldProject(
@@ -3800,7 +3758,6 @@ ${YELLOW9}You're offline. Scaffolding Decantr default.${RESET13}`);
3800
3758
  archetypeData,
3801
3759
  registrySource,
3802
3760
  themeData,
3803
- recipeData,
3804
3761
  topologyMarkdown,
3805
3762
  // V3.1 composition data:
3806
3763
  composedSections,
@@ -4130,7 +4087,7 @@ ${BOLD6}Examples:${RESET13}
4130
4087
  case "switch": {
4131
4088
  const name = args[1];
4132
4089
  if (!name) {
4133
- console.error(error3("Usage: decantr theme switch <themeName> [--recipe <r>] [--shape <s>] [--mode <m>]"));
4090
+ console.error(error3("Usage: decantr theme switch <themeName> [--shape <s>] [--mode <m>]"));
4134
4091
  process.exitCode = 1;
4135
4092
  return;
4136
4093
  }
@@ -4199,7 +4156,7 @@ ${BOLD6}Commands:${RESET13}
4199
4156
  ${cyan3("list")} List items by type
4200
4157
  ${cyan3("validate")} Validate essence file (v2 and v3)
4201
4158
  ${cyan3("theme")} Manage custom themes (create, list, validate, delete, import)
4202
- ${cyan3("create")} Create a custom content item (pattern, recipe, theme, etc.)
4159
+ ${cyan3("create")} Create a custom content item (pattern, theme, blueprint, etc.)
4203
4160
  ${cyan3("publish")} Publish a custom content item to the community registry
4204
4161
  ${cyan3("login")} Authenticate with the Decantr registry
4205
4162
  ${cyan3("logout")} Remove stored credentials
@@ -4299,7 +4256,7 @@ async function main() {
4299
4256
  break;
4300
4257
  }
4301
4258
  case "upgrade": {
4302
- const { cmdUpgrade } = await import("./upgrade-LTLUPBZQ.js");
4259
+ const { cmdUpgrade } = await import("./upgrade-T3FNFFIH.js");
4303
4260
  const applyFlag = args.includes("--apply");
4304
4261
  await cmdUpgrade(process.cwd(), { apply: applyFlag });
4305
4262
  break;
@@ -4309,7 +4266,7 @@ async function main() {
4309
4266
  if (command === "heal") {
4310
4267
  console.log(`${YELLOW9}Note: \`decantr heal\` is deprecated. Use \`decantr check\` instead.${RESET13}`);
4311
4268
  }
4312
- const { cmdHeal } = await import("./heal-54MKDDSQ.js");
4269
+ const { cmdHeal } = await import("./heal-VYEGIUAS.js");
4313
4270
  const telemetryFlag = args.includes("--telemetry");
4314
4271
  await cmdHeal(process.cwd(), { telemetry: telemetryFlag });
4315
4272
  break;
@@ -4432,7 +4389,7 @@ async function main() {
4432
4389
  const name = args[2];
4433
4390
  if (!type || !name) {
4434
4391
  console.error(error3("Usage: decantr create <type> <name>"));
4435
- console.error(dim3("Types: pattern, recipe, theme, blueprint, archetype, shell"));
4392
+ console.error(dim3("Types: pattern, theme, blueprint, archetype, shell"));
4436
4393
  process.exitCode = 1;
4437
4394
  break;
4438
4395
  }
@@ -4444,7 +4401,7 @@ async function main() {
4444
4401
  const name = args[2];
4445
4402
  if (!type || !name) {
4446
4403
  console.error(error3("Usage: decantr publish <type> <name>"));
4447
- console.error(dim3("Types: pattern, recipe, theme, blueprint, archetype, shell"));
4404
+ console.error(dim3("Types: pattern, theme, blueprint, archetype, shell"));
4448
4405
  process.exitCode = 1;
4449
4406
  break;
4450
4407
  }