@decantr/cli 1.6.2 → 1.6.3

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-TL5VMEPJ.js";
3
- import "./chunk-7QOXORFL.js";
2
+ import "./chunk-HWMN432I.js";
3
+ import "./chunk-5MKMLONH.js";
@@ -245,6 +245,7 @@ function generatePersonalityCSS(personality, themeData) {
245
245
  rules.push(`.status-ring[data-status="error"] { border-color: var(--d-error); box-shadow: 0 0 12px color-mix(in srgb, var(--d-error) 25%, transparent); }`);
246
246
  rules.push(`.status-ring[data-status="warning"] { border-color: var(--d-warning); }`);
247
247
  rules.push(`.status-ring[data-status="idle"] { border-color: var(--d-text-muted); }`);
248
+ rules.push(`.status-ring[data-status="processing"] { border-color: var(--d-primary); }`);
248
249
  rules.push(`@keyframes pulse-ring { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }`);
249
250
  rules.push(`.status-ring[data-status="active"]::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--d-success); opacity: 0; animation: pulse-ring 2s ease-out infinite; }`);
250
251
  }
@@ -532,7 +533,7 @@ function generateTokensCSS(themeData, mode, spatialTokens) {
532
533
  return {
533
534
  // Seed colors
534
535
  "--d-primary": seed.primary || "#6366f1",
535
- "--d-secondary": seed.secondary || "#a1a1aa",
536
+ "--d-secondary": palette.secondary?.[tokenMode] || palette.secondary?.dark || seed.secondary || "#A1A1AA",
536
537
  "--d-accent": seed.accent || "#f59e0b",
537
538
  // Palette colors (mode-aware)
538
539
  "--d-bg": palette.background?.[tokenMode] || "#18181b",
@@ -1127,10 +1128,8 @@ function generateDecantrMdV31(params) {
1127
1128
  briefLines.push("## Project Brief");
1128
1129
  briefLines.push("");
1129
1130
  briefLines.push(`- **Blueprint:** ${params.blueprintId || "custom"}`);
1130
- const themeParts = [params.themeName || "default"];
1131
- if (params.themeMode) themeParts.push(`${params.themeMode} mode`);
1132
- if (params.themeShape) themeParts.push(params.themeShape);
1133
- briefLines.push(`- **Theme:** ${themeParts.join(" (").replace(/ \($/, "") + (themeParts.length > 1 ? ")" : "")}`);
1131
+ const themeDesc = `${params.themeName || "default"} (${params.themeMode || "dark"} mode${params.themeShape ? `, ${params.themeShape} shape` : ""})`;
1132
+ briefLines.push(`- **Theme:** ${themeDesc}`);
1134
1133
  if (params.personality && params.personality.length > 0) {
1135
1134
  briefLines.push(`- **Personality:** ${params.personality.join(". ")}`);
1136
1135
  }
@@ -1197,6 +1196,9 @@ function generateProjectJson(detected, options, registrySource) {
1197
1196
  flags: buildFlagsString(options)
1198
1197
  }
1199
1198
  };
1199
+ if (options.blueprint) {
1200
+ data.blueprintId = options.blueprint;
1201
+ }
1200
1202
  return JSON.stringify(data, null, 2);
1201
1203
  }
1202
1204
  function buildFlagsString(options) {
@@ -1209,13 +1211,21 @@ function buildFlagsString(options) {
1209
1211
  }
1210
1212
  function generateTaskContextV3(templateName, essence) {
1211
1213
  const template = loadTemplate(templateName);
1212
- const pages = essence.blueprint.sections && essence.blueprint.sections.length > 0 ? essence.blueprint.sections.flatMap((s) => s.pages) : essence.blueprint.pages || [];
1213
- const defaultShell = essence.blueprint.sections?.[0]?.shell || essence.blueprint.shell || "sidebar-main";
1214
+ const sections = essence.blueprint.sections && essence.blueprint.sections.length > 0 ? essence.blueprint.sections : [];
1215
+ const pages = sections.length > 0 ? sections.flatMap((s) => s.pages) : essence.blueprint.pages || [];
1216
+ const defaultShell = sections[0]?.shell || essence.blueprint.shell || "sidebar-main";
1214
1217
  const layout = pages[0]?.layout?.map(serializeLayoutItem).join(", ") || "none";
1218
+ const pageShellMap = /* @__PURE__ */ new Map();
1219
+ for (const s of sections) {
1220
+ for (const p of s.pages) {
1221
+ pageShellMap.set(p.id, s.shell);
1222
+ }
1223
+ }
1215
1224
  const scaffoldStructure = pages.map((p) => {
1225
+ const shell = pageShellMap.get(p.id) || defaultShell;
1216
1226
  const patterns = p.layout.length > 0 ? `
1217
1227
  - Patterns: ${p.layout.map(serializeLayoutItem).join(", ")}` : "";
1218
- return `- **${p.id}** (${defaultShell})${patterns}`;
1228
+ return `- **${p.id}** (${shell})${patterns}`;
1219
1229
  }).join("\n");
1220
1230
  const densityLevel = essence.dna.spacing?.density || "comfortable";
1221
1231
  const contentGap = essence.dna.spacing?.content_gap || "_gap4";
@@ -1307,7 +1317,12 @@ async function scaffoldProject(projectRoot, options, detected, registry, archety
1307
1317
  const essencePath = join(projectRoot, "decantr.essence.json");
1308
1318
  writeFileSync(essencePath, JSON.stringify(essenceV3, null, 2) + "\n");
1309
1319
  const projectJsonPath = join(decantrDir, "project.json");
1310
- writeFileSync(projectJsonPath, generateProjectJson(detected, options, registrySource));
1320
+ const projectJsonStr = generateProjectJson(detected, options, registrySource);
1321
+ const projectJsonObj = JSON.parse(projectJsonStr);
1322
+ if (blueprintData?.voice) {
1323
+ projectJsonObj.voice = blueprintData.voice;
1324
+ }
1325
+ writeFileSync(projectJsonPath, JSON.stringify(projectJsonObj, null, 2));
1311
1326
  const contextFiles = [];
1312
1327
  const scaffoldPath = join(contextDir, "task-scaffold.md");
1313
1328
  writeFileSync(scaffoldPath, generateTaskContextV3("task-scaffold.md.template", essenceV3));
@@ -1599,6 +1614,15 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
1599
1614
  const decantrDir = join(projectRoot, ".decantr");
1600
1615
  const contextDir = join(decantrDir, "context");
1601
1616
  mkdirSync(contextDir, { recursive: true });
1617
+ let storedBlueprintId;
1618
+ const projectJsonFilePath = join(decantrDir, "project.json");
1619
+ if (existsSync(projectJsonFilePath)) {
1620
+ try {
1621
+ const projData = JSON.parse(readFileSync(projectJsonFilePath, "utf-8"));
1622
+ if (projData.blueprintId) storedBlueprintId = projData.blueprintId;
1623
+ } catch {
1624
+ }
1625
+ }
1602
1626
  const themeName = essence.dna.theme.id || essence.dna.theme.style || "default";
1603
1627
  const mode = essence.dna.theme.mode;
1604
1628
  const guardMode = essence.meta.guard.mode;
@@ -1716,7 +1740,7 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
1716
1740
  writeFileSync(decantrMdPath, generateDecantrMdV31({
1717
1741
  guardMode,
1718
1742
  cssApproach: CSS_APPROACH_CONTENT,
1719
- blueprintId: essence.meta.blueprint || void 0,
1743
+ blueprintId: storedBlueprintId || essence.meta.blueprint || void 0,
1720
1744
  themeName,
1721
1745
  themeMode: mode,
1722
1746
  themeShape: essence.dna.theme.shape || void 0,
@@ -1862,10 +1886,18 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
1862
1886
  writeFileSync(sectionContextPath, contextContent);
1863
1887
  contextFiles.push(sectionContextPath);
1864
1888
  }
1889
+ let projectVoice;
1890
+ if (existsSync(projectJsonFilePath)) {
1891
+ try {
1892
+ const projData = JSON.parse(readFileSync(projectJsonFilePath, "utf-8"));
1893
+ if (projData.voice) projectVoice = projData.voice;
1894
+ } catch {
1895
+ }
1896
+ }
1865
1897
  const routes = blueprint.routes || {};
1866
1898
  const scaffoldContent = generateScaffoldContext({
1867
1899
  appName: essence.meta.archetype || "Application",
1868
- blueprintId: "",
1900
+ blueprintId: storedBlueprintId || essence.meta.blueprint || "",
1869
1901
  themeName,
1870
1902
  personality,
1871
1903
  topologyMarkdown,
@@ -1873,7 +1905,8 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
1873
1905
  routes,
1874
1906
  constraints: essence.dna.constraints,
1875
1907
  seo: essence.meta.seo,
1876
- navigation: essence.meta.navigation
1908
+ navigation: essence.meta.navigation,
1909
+ voice: projectVoice
1877
1910
  });
1878
1911
  const scaffoldMdPath = join(contextDir, "scaffold.md");
1879
1912
  writeFileSync(scaffoldMdPath, scaffoldContent);
@@ -2086,7 +2119,8 @@ function generateSectionContext(input) {
2086
2119
  text: "Body text, headings, primary content",
2087
2120
  "text-muted": "Secondary text, placeholders, labels",
2088
2121
  primary: "Brand color, key interactive, selected states",
2089
- "primary-hover": "Hover state for primary elements"
2122
+ "primary-hover": "Hover state for primary elements",
2123
+ secondary: "Secondary brand color, supporting elements"
2090
2124
  };
2091
2125
  if (input.themeData?.palette) {
2092
2126
  const modeKey = input.themeMode || "dark";
@@ -2097,6 +2131,10 @@ function generateSectionContext(input) {
2097
2131
  }
2098
2132
  if (input.themeData?.seed?.accent) {
2099
2133
  lines.push(`| \`--d-accent\` | \`${input.themeData.seed.accent}\` | CTAs, links, active states, glow effects |`);
2134
+ const accentGlowVal = input.themeData?.palette?.["accent-glow"]?.[input.themeMode || "dark"] || input.themeData?.tokens?.base?.["accent-glow"];
2135
+ if (accentGlowVal) {
2136
+ lines.push(`| \`--d-accent-glow\` | \`${accentGlowVal}\` | Ambient glow effect around accent elements |`);
2137
+ }
2100
2138
  }
2101
2139
  lines.push("");
2102
2140
  lines.push("Full token set: `src/styles/tokens.css`");
@@ -2137,7 +2175,11 @@ function generateSectionContext(input) {
2137
2175
  }
2138
2176
  if (themeHints) {
2139
2177
  if (themeHints.preferred && themeHints.preferred.length > 0) {
2140
- lines.push(`**Preferred:** ${themeHints.preferred.join(", ")}`);
2178
+ const sectionPatterns = new Set(section.pages.flatMap((p) => p.layout.map((l) => typeof l === "string" ? l : l.pattern)));
2179
+ const relevant = themeHints.preferred.filter((p) => sectionPatterns.has(p));
2180
+ if (relevant.length > 0) {
2181
+ lines.push(`**Preferred:** ${relevant.join(", ")}`);
2182
+ }
2141
2183
  }
2142
2184
  if (themeHints.compositions) {
2143
2185
  lines.push(`**Compositions:** ${themeHints.compositions}`);
@@ -9,7 +9,7 @@ import {
9
9
  scaffoldMinimal,
10
10
  scaffoldProject,
11
11
  syncRegistry
12
- } from "./chunk-7QOXORFL.js";
12
+ } from "./chunk-5MKMLONH.js";
13
13
 
14
14
  // src/index.ts
15
15
  import { readFileSync as readFileSync15, existsSync as existsSync23, readdirSync as readdirSync6 } from "fs";
@@ -4332,7 +4332,7 @@ async function main() {
4332
4332
  break;
4333
4333
  }
4334
4334
  case "upgrade": {
4335
- const { cmdUpgrade } = await import("./upgrade-PKKLUMFJ.js");
4335
+ const { cmdUpgrade } = await import("./upgrade-3AAWHJGG.js");
4336
4336
  const applyFlag = args.includes("--apply");
4337
4337
  await cmdUpgrade(process.cwd(), { apply: applyFlag });
4338
4338
  break;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./chunk-TL5VMEPJ.js";
2
- import "./chunk-7QOXORFL.js";
1
+ import "./chunk-HWMN432I.js";
2
+ import "./chunk-5MKMLONH.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegistryClient,
3
3
  refreshDerivedFiles
4
- } from "./chunk-7QOXORFL.js";
4
+ } from "./chunk-5MKMLONH.js";
5
5
 
6
6
  // src/commands/upgrade.ts
7
7
  import { readFileSync, writeFileSync, existsSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decantr/cli",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Decantr CLI — search the registry, validate essence files, and access design intelligence from the terminal",
5
5
  "license": "MIT",
6
6
  "repository": {