@decantr/cli 2.9.4 → 2.9.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/README.md +2 -0
- package/dist/bin.js +1 -1
- package/dist/{chunk-GDGZFGMK.js → chunk-3KJ46XY7.js} +95 -56
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -189,6 +189,8 @@ decantr workspace health --json --output .decantr/workspace-health.json
|
|
|
189
189
|
decantr verify --workspace --changed --since origin/main
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
+
In observed Brownfield projects, common section shorthands are accepted for page additions when they resolve unambiguously. For example, `decantr add page app/settings --route /settings --project apps/web` resolves `app` to the single primary section, such as `observed-primary`, so docs and LLM prompts do not have to guess generated section IDs first.
|
|
193
|
+
|
|
192
194
|
`decantr studio` starts a local-only dashboard powered by the same report. It uses Node built-ins only and serves `GET /`, `GET /api/health`, and `POST /api/refresh`.
|
|
193
195
|
|
|
194
196
|
```bash
|
package/dist/bin.js
CHANGED
|
@@ -1743,6 +1743,7 @@ import { join as join6 } from "path";
|
|
|
1743
1743
|
import { isV4 as isV42 } from "@decantr/essence-spec";
|
|
1744
1744
|
var GREEN = "\x1B[32m";
|
|
1745
1745
|
var RED = "\x1B[31m";
|
|
1746
|
+
var YELLOW = "\x1B[33m";
|
|
1746
1747
|
var DIM = "\x1B[2m";
|
|
1747
1748
|
var RESET = "\x1B[0m";
|
|
1748
1749
|
function readV4Essence(projectRoot) {
|
|
@@ -1786,6 +1787,36 @@ function normalizeRoute(route) {
|
|
|
1786
1787
|
if (!trimmed || trimmed === "/") return "/";
|
|
1787
1788
|
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
1788
1789
|
}
|
|
1790
|
+
function resolveSectionForPage(sections, requestedSectionId) {
|
|
1791
|
+
const exact = sections.find((section) => section.id === requestedSectionId);
|
|
1792
|
+
if (exact) return { section: exact, resolvedFromAlias: false };
|
|
1793
|
+
const lower = requestedSectionId.toLowerCase();
|
|
1794
|
+
const roleByAlias = {
|
|
1795
|
+
app: "primary",
|
|
1796
|
+
main: "primary",
|
|
1797
|
+
primary: "primary",
|
|
1798
|
+
public: "public",
|
|
1799
|
+
marketing: "public",
|
|
1800
|
+
auth: "gateway",
|
|
1801
|
+
gateway: "gateway",
|
|
1802
|
+
auxiliary: "auxiliary"
|
|
1803
|
+
};
|
|
1804
|
+
const desiredRole = roleByAlias[lower];
|
|
1805
|
+
if (!desiredRole) return null;
|
|
1806
|
+
const roleMatches = sections.filter((section) => section.role === desiredRole);
|
|
1807
|
+
if (roleMatches.length === 1) return { section: roleMatches[0], resolvedFromAlias: true };
|
|
1808
|
+
if (roleMatches.length > 1) return null;
|
|
1809
|
+
const observedMatch = sections.find((section) => section.id === `observed-${desiredRole}`);
|
|
1810
|
+
return observedMatch ? { section: observedMatch, resolvedFromAlias: true } : null;
|
|
1811
|
+
}
|
|
1812
|
+
function printSectionNotFound(sectionId, sections, pageId) {
|
|
1813
|
+
console.error(`${RED}Section "${sectionId}" not found.${RESET}`);
|
|
1814
|
+
console.error(`${DIM}Available sections: ${sections.map((s) => s.id).join(", ")}${RESET}`);
|
|
1815
|
+
if (pageId && sections.length > 0) {
|
|
1816
|
+
const primary = sections.find((section) => section.role === "primary") ?? sections[0];
|
|
1817
|
+
console.error(`${DIM}Try: decantr add page ${primary.id}/${pageId}${RESET}`);
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1789
1820
|
async function cmdAddSection(archetypeId, args, projectRoot = process.cwd()) {
|
|
1790
1821
|
if (!archetypeId) {
|
|
1791
1822
|
console.error(`${RED}Usage: decantr add section <archetypeId>${RESET}`);
|
|
@@ -1849,15 +1880,18 @@ async function cmdAddPage(path, args, projectRoot = process.cwd()) {
|
|
|
1849
1880
|
if (!loaded) return;
|
|
1850
1881
|
const { essence, essencePath } = loaded;
|
|
1851
1882
|
const sections = essence.blueprint.sections;
|
|
1852
|
-
const
|
|
1853
|
-
if (!
|
|
1854
|
-
|
|
1855
|
-
console.error(`${DIM}Available sections: ${sections.map((s) => s.id).join(", ")}${RESET}`);
|
|
1883
|
+
const resolved = resolveSectionForPage(sections, sectionId);
|
|
1884
|
+
if (!resolved) {
|
|
1885
|
+
printSectionNotFound(sectionId, sections, pageId);
|
|
1856
1886
|
process.exitCode = 1;
|
|
1857
1887
|
return;
|
|
1858
1888
|
}
|
|
1889
|
+
const { section } = resolved;
|
|
1890
|
+
const resolvedSectionId = section.id;
|
|
1859
1891
|
if (section.pages.find((p) => p.id === pageId)) {
|
|
1860
|
-
console.error(
|
|
1892
|
+
console.error(
|
|
1893
|
+
`${RED}Page "${pageId}" already exists in section "${resolvedSectionId}".${RESET}`
|
|
1894
|
+
);
|
|
1861
1895
|
process.exitCode = 1;
|
|
1862
1896
|
return;
|
|
1863
1897
|
}
|
|
@@ -1877,10 +1911,15 @@ async function cmdAddPage(path, args, projectRoot = process.cwd()) {
|
|
|
1877
1911
|
route,
|
|
1878
1912
|
layout: ["hero"]
|
|
1879
1913
|
});
|
|
1880
|
-
routes[route] = { section:
|
|
1914
|
+
routes[route] = { section: resolvedSectionId, page: pageId };
|
|
1881
1915
|
writeEssence(essencePath, essence);
|
|
1916
|
+
if (resolved.resolvedFromAlias) {
|
|
1917
|
+
console.log(
|
|
1918
|
+
`${YELLOW}Resolved section alias "${sectionId}" to "${resolvedSectionId}".${RESET}`
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1882
1921
|
console.log(
|
|
1883
|
-
`${GREEN}Added page "${pageId}" to section "${
|
|
1922
|
+
`${GREEN}Added page "${pageId}" to section "${resolvedSectionId}" at route "${route}".${RESET}`
|
|
1884
1923
|
);
|
|
1885
1924
|
const registryClient = new RegistryClient({
|
|
1886
1925
|
cacheDir: join6(projectRoot, ".decantr", "cache")
|
|
@@ -2958,7 +2997,7 @@ var DIM2 = "\x1B[2m";
|
|
|
2958
2997
|
var RESET2 = "\x1B[0m";
|
|
2959
2998
|
var GREEN2 = "\x1B[32m";
|
|
2960
2999
|
var CYAN = "\x1B[36m";
|
|
2961
|
-
var
|
|
3000
|
+
var YELLOW2 = "\x1B[33m";
|
|
2962
3001
|
async function cmdAnalyze(projectRoot = process.cwd(), workspace) {
|
|
2963
3002
|
const startedAt = Date.now();
|
|
2964
3003
|
console.log(`
|
|
@@ -3126,7 +3165,7 @@ ${DIM2}Written to:${RESET2} ${outputPath}`);
|
|
|
3126
3165
|
console.log(`${DIM2}Enrichment backlog:${RESET2} ${intelligenceArtifacts.backlogPath}`);
|
|
3127
3166
|
console.log(
|
|
3128
3167
|
`
|
|
3129
|
-
${
|
|
3168
|
+
${YELLOW2}Next step:${RESET2} Review ${BOLD}${reportDisplayPath}${RESET2}, then run ${BOLD}${recommendedAttachCommand}${RESET2} to attach Decantr using the observed proposal.
|
|
3130
3169
|
`
|
|
3131
3170
|
);
|
|
3132
3171
|
await sendAnalyzeCompletedTelemetry({
|
|
@@ -4257,7 +4296,7 @@ var BOLD3 = "\x1B[1m";
|
|
|
4257
4296
|
var DIM4 = "\x1B[2m";
|
|
4258
4297
|
var GREEN4 = "\x1B[32m";
|
|
4259
4298
|
var RED3 = "\x1B[31m";
|
|
4260
|
-
var
|
|
4299
|
+
var YELLOW3 = "\x1B[33m";
|
|
4261
4300
|
var CYAN2 = "\x1B[36m";
|
|
4262
4301
|
var RESET4 = "\x1B[0m";
|
|
4263
4302
|
function readJson2(path) {
|
|
@@ -4596,7 +4635,7 @@ function buildDoctorReport(root, args) {
|
|
|
4596
4635
|
function colorForStatus(status) {
|
|
4597
4636
|
if (status === "healthy") return GREEN4;
|
|
4598
4637
|
if (status === "needs-setup" || status === "needs-migration") return RED3;
|
|
4599
|
-
return
|
|
4638
|
+
return YELLOW3;
|
|
4600
4639
|
}
|
|
4601
4640
|
function formatDoctorText(report) {
|
|
4602
4641
|
const lines = [
|
|
@@ -4640,7 +4679,7 @@ function formatDoctorText(report) {
|
|
|
4640
4679
|
lines.push(` ${GREEN4}No doctor findings.${RESET4}`);
|
|
4641
4680
|
} else {
|
|
4642
4681
|
for (const issue of report.issues) {
|
|
4643
|
-
const color = issue.severity === "error" ? RED3 : issue.severity === "warn" ?
|
|
4682
|
+
const color = issue.severity === "error" ? RED3 : issue.severity === "warn" ? YELLOW3 : CYAN2;
|
|
4644
4683
|
lines.push(
|
|
4645
4684
|
` ${color}[${issue.severity.toUpperCase()}]${RESET4} ${issue.category}: ${issue.message}`
|
|
4646
4685
|
);
|
|
@@ -4946,7 +4985,7 @@ var DIM6 = "\x1B[2m";
|
|
|
4946
4985
|
var RESET6 = "\x1B[0m";
|
|
4947
4986
|
var GREEN6 = "\x1B[32m";
|
|
4948
4987
|
var CYAN3 = "\x1B[36m";
|
|
4949
|
-
var
|
|
4988
|
+
var YELLOW4 = "\x1B[33m";
|
|
4950
4989
|
var MAGENTA = "\x1B[35m";
|
|
4951
4990
|
function success(text) {
|
|
4952
4991
|
return `${GREEN6}${text}${RESET6}`;
|
|
@@ -5167,7 +5206,7 @@ async function cmdMagic(prompt, projectRoot, options) {
|
|
|
5167
5206
|
const essencePath = join20(projectRoot, "decantr.essence.json");
|
|
5168
5207
|
if (existsSync18(essencePath)) {
|
|
5169
5208
|
const projectFlag = options.projectLabel ? ` --project ${options.projectLabel}` : "";
|
|
5170
|
-
console.log(`${
|
|
5209
|
+
console.log(`${YELLOW4} Decantr is already attached to this project.${RESET6}`);
|
|
5171
5210
|
console.log(
|
|
5172
5211
|
dim(" decantr magic is greenfield-first; use task-time context for existing apps.")
|
|
5173
5212
|
);
|
|
@@ -5180,7 +5219,7 @@ async function cmdMagic(prompt, projectRoot, options) {
|
|
|
5180
5219
|
}
|
|
5181
5220
|
const detected = detectProject(projectRoot);
|
|
5182
5221
|
if (hasExistingProjectFootprint(detected)) {
|
|
5183
|
-
console.log(`${
|
|
5222
|
+
console.log(`${YELLOW4} Existing project detected.${RESET6}`);
|
|
5184
5223
|
console.log(
|
|
5185
5224
|
dim(
|
|
5186
5225
|
" decantr magic stays greenfield-first and will not silently bootstrap over an existing app."
|
|
@@ -5490,7 +5529,7 @@ ${GREEN6}${BOLD4}Quality summary:${RESET6}`);
|
|
|
5490
5529
|
);
|
|
5491
5530
|
console.log(` CSS: tokens.css + treatments.css + global.css`);
|
|
5492
5531
|
console.log(
|
|
5493
|
-
` @layer cascade: ${hasLayers ? GREEN6 + "yes" + RESET6 :
|
|
5532
|
+
` @layer cascade: ${hasLayers ? GREEN6 + "yes" + RESET6 : YELLOW4 + "missing" + RESET6}`
|
|
5494
5533
|
);
|
|
5495
5534
|
console.log("");
|
|
5496
5535
|
console.log(`${BOLD4} Ready!${RESET6} Next steps:`);
|
|
@@ -5519,7 +5558,7 @@ import {
|
|
|
5519
5558
|
} from "@decantr/essence-spec";
|
|
5520
5559
|
var GREEN7 = "\x1B[32m";
|
|
5521
5560
|
var RED5 = "\x1B[31m";
|
|
5522
|
-
var
|
|
5561
|
+
var YELLOW5 = "\x1B[33m";
|
|
5523
5562
|
var RESET7 = "\x1B[0m";
|
|
5524
5563
|
var DIM7 = "\x1B[2m";
|
|
5525
5564
|
function migrateEssenceFile(essencePath) {
|
|
@@ -5619,7 +5658,7 @@ async function cmdMigrate(projectRoot = process.cwd(), args = []) {
|
|
|
5619
5658
|
console.log(`${GREEN7}Derived context and execution packs refreshed.${RESET7}`);
|
|
5620
5659
|
}
|
|
5621
5660
|
console.log("");
|
|
5622
|
-
console.log(`${
|
|
5661
|
+
console.log(`${YELLOW5}Review the migrated file and run \`decantr check\` to verify.${RESET7}`);
|
|
5623
5662
|
}
|
|
5624
5663
|
|
|
5625
5664
|
// src/commands/new-project.ts
|
|
@@ -5686,7 +5725,7 @@ var RESET8 = "\x1B[0m";
|
|
|
5686
5725
|
var RED6 = "\x1B[31m";
|
|
5687
5726
|
var GREEN8 = "\x1B[32m";
|
|
5688
5727
|
var CYAN4 = "\x1B[36m";
|
|
5689
|
-
var
|
|
5728
|
+
var YELLOW6 = "\x1B[33m";
|
|
5690
5729
|
function heading(text) {
|
|
5691
5730
|
return `
|
|
5692
5731
|
${BOLD5}${text}${RESET8}
|
|
@@ -5836,7 +5875,7 @@ async function cmdNewProject(projectName, options) {
|
|
|
5836
5875
|
);
|
|
5837
5876
|
} else {
|
|
5838
5877
|
console.log(
|
|
5839
|
-
`${
|
|
5878
|
+
`${YELLOW6} No greenfield bootstrap adapter is available yet for target "${bootstrapTarget.target}" (${bootstrapTarget.packAdapter}).${RESET8}`
|
|
5840
5879
|
);
|
|
5841
5880
|
console.log(
|
|
5842
5881
|
dim2(
|
|
@@ -5852,7 +5891,7 @@ async function cmdNewProject(projectName, options) {
|
|
|
5852
5891
|
} catch {
|
|
5853
5892
|
console.log(
|
|
5854
5893
|
`
|
|
5855
|
-
${
|
|
5894
|
+
${YELLOW6}Dependency install failed. Run \`${packageManager} install\` manually.${RESET8}`
|
|
5856
5895
|
);
|
|
5857
5896
|
}
|
|
5858
5897
|
}
|
|
@@ -5864,7 +5903,7 @@ ${YELLOW5}Dependency install failed. Run \`${packageManager} install\` manually.
|
|
|
5864
5903
|
console.log(dim2(` Seeded offline registry content from ${seeded.strategy}.`));
|
|
5865
5904
|
} else if (requiresOfflineContent) {
|
|
5866
5905
|
console.log(
|
|
5867
|
-
`${
|
|
5906
|
+
`${YELLOW6} Offline blueprint/archetype resolution requires local registry content.${RESET8}`
|
|
5868
5907
|
);
|
|
5869
5908
|
console.log(
|
|
5870
5909
|
dim2(
|
|
@@ -5894,7 +5933,7 @@ ${YELLOW5}Dependency install failed. Run \`${packageManager} install\` manually.
|
|
|
5894
5933
|
} catch {
|
|
5895
5934
|
console.log(
|
|
5896
5935
|
`
|
|
5897
|
-
${
|
|
5936
|
+
${YELLOW6}Decantr init encountered issues. Run \`decantr init\` manually inside ${projectName}/.${RESET8}`
|
|
5898
5937
|
);
|
|
5899
5938
|
}
|
|
5900
5939
|
console.log(success2(`
|
|
@@ -6237,7 +6276,7 @@ var GREEN10 = "\x1B[32m";
|
|
|
6237
6276
|
var RED8 = "\x1B[31m";
|
|
6238
6277
|
var DIM10 = "\x1B[2m";
|
|
6239
6278
|
var CYAN5 = "\x1B[36m";
|
|
6240
|
-
var
|
|
6279
|
+
var YELLOW7 = "\x1B[33m";
|
|
6241
6280
|
var RESET10 = "\x1B[0m";
|
|
6242
6281
|
var ALL_CONTENT_TYPES = [...API_CONTENT_TYPES];
|
|
6243
6282
|
async function cmdRegistryMirror(projectRoot, options = {}) {
|
|
@@ -6301,7 +6340,7 @@ Mirroring registry content to ${DIM10}.decantr/cache/${RESET10}
|
|
|
6301
6340
|
const totalItems = Object.values(counts).reduce((a, b) => a + b, 0);
|
|
6302
6341
|
console.log("");
|
|
6303
6342
|
if (failed.length > 0) {
|
|
6304
|
-
console.log(`${
|
|
6343
|
+
console.log(`${YELLOW7}Mirrored ${totalItems} items (${failed.length} type(s) failed)${RESET10}`);
|
|
6305
6344
|
} else {
|
|
6306
6345
|
console.log(
|
|
6307
6346
|
`${GREEN10}Mirrored ${totalItems} items across ${Object.keys(counts).length} types${RESET10}`
|
|
@@ -6489,7 +6528,7 @@ import { existsSync as existsSync26, readFileSync as readFileSync19, writeFileSy
|
|
|
6489
6528
|
import { join as join28 } from "path";
|
|
6490
6529
|
var GREEN12 = "\x1B[32m";
|
|
6491
6530
|
var RED10 = "\x1B[31m";
|
|
6492
|
-
var
|
|
6531
|
+
var YELLOW8 = "\x1B[33m";
|
|
6493
6532
|
var RESET12 = "\x1B[0m";
|
|
6494
6533
|
var DIM12 = "\x1B[2m";
|
|
6495
6534
|
var BOLD6 = "\x1B[1m";
|
|
@@ -6530,7 +6569,7 @@ ${BOLD6}Unresolved Drift Entries (${unresolved.length})${RESET12}
|
|
|
6530
6569
|
`);
|
|
6531
6570
|
for (let i = 0; i < unresolved.length; i++) {
|
|
6532
6571
|
const entry = unresolved[i];
|
|
6533
|
-
const severityColor = entry.severity === "error" ? RED10 :
|
|
6572
|
+
const severityColor = entry.severity === "error" ? RED10 : YELLOW8;
|
|
6534
6573
|
const icon = entry.severity === "error" ? "x" : "!";
|
|
6535
6574
|
console.log(
|
|
6536
6575
|
` ${severityColor}${icon}${RESET12} ${BOLD6}#${i + 1}${RESET12} [${entry.rule}] ${entry.message}`
|
|
@@ -6814,7 +6853,7 @@ import { join as join29 } from "path";
|
|
|
6814
6853
|
import { isV4 as isV48 } from "@decantr/essence-spec";
|
|
6815
6854
|
var GREEN14 = "\x1B[32m";
|
|
6816
6855
|
var RED11 = "\x1B[31m";
|
|
6817
|
-
var
|
|
6856
|
+
var YELLOW9 = "\x1B[33m";
|
|
6818
6857
|
var DIM14 = "\x1B[2m";
|
|
6819
6858
|
var RESET14 = "\x1B[0m";
|
|
6820
6859
|
var VALID_THEME_SHAPES = ["sharp", "rounded", "pill"];
|
|
@@ -6909,7 +6948,7 @@ async function cmdThemeSwitch(themeName, args, projectRoot = process.cwd()) {
|
|
|
6909
6948
|
console.log(
|
|
6910
6949
|
`${GREEN14}Derived files refreshed (tokens.css, treatments.css, all contexts).${RESET14}`
|
|
6911
6950
|
);
|
|
6912
|
-
console.log(`${
|
|
6951
|
+
console.log(`${YELLOW9}Guard will flag code using old tokens. Run \`decantr check\`.${RESET14}`);
|
|
6913
6952
|
}
|
|
6914
6953
|
|
|
6915
6954
|
// src/prompts.ts
|
|
@@ -6918,7 +6957,7 @@ var BOLD8 = "\x1B[1m";
|
|
|
6918
6957
|
var DIM15 = "\x1B[2m";
|
|
6919
6958
|
var RESET15 = "\x1B[0m";
|
|
6920
6959
|
var GREEN15 = "\x1B[32m";
|
|
6921
|
-
var
|
|
6960
|
+
var YELLOW10 = "\x1B[33m";
|
|
6922
6961
|
var CYAN8 = "\x1B[36m";
|
|
6923
6962
|
function ask(question, defaultValue) {
|
|
6924
6963
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -6958,7 +6997,7 @@ async function confirm(question, defaultYes = true) {
|
|
|
6958
6997
|
}
|
|
6959
6998
|
function warn(message) {
|
|
6960
6999
|
console.log(`
|
|
6961
|
-
${
|
|
7000
|
+
${YELLOW10} Warning: ${message}${RESET15}`);
|
|
6962
7001
|
}
|
|
6963
7002
|
function showDetection(detected) {
|
|
6964
7003
|
console.log(`
|
|
@@ -6977,7 +7016,7 @@ ${CYAN8}Detected project configuration:${RESET15}`);
|
|
|
6977
7016
|
console.log(` Tailwind CSS: ${GREEN15}yes${RESET15}`);
|
|
6978
7017
|
}
|
|
6979
7018
|
if (detected.existingEssence) {
|
|
6980
|
-
console.log(` Existing essence: ${
|
|
7019
|
+
console.log(` Existing essence: ${YELLOW10}yes${RESET15}`);
|
|
6981
7020
|
}
|
|
6982
7021
|
}
|
|
6983
7022
|
async function runInteractivePrompts(detected, archetypes, blueprints, themes, workflowSeed) {
|
|
@@ -7379,7 +7418,7 @@ var RESET16 = "\x1B[0m";
|
|
|
7379
7418
|
var RED12 = "\x1B[31m";
|
|
7380
7419
|
var GREEN16 = "\x1B[32m";
|
|
7381
7420
|
var CYAN9 = "\x1B[36m";
|
|
7382
|
-
var
|
|
7421
|
+
var YELLOW11 = "\x1B[33m";
|
|
7383
7422
|
function heading2(text) {
|
|
7384
7423
|
return `
|
|
7385
7424
|
${BOLD9}${text}${RESET16}
|
|
@@ -8422,7 +8461,7 @@ function printBlueprintPortfolioNotice(blueprint) {
|
|
|
8422
8461
|
if (!portfolio) return;
|
|
8423
8462
|
if (portfolio.visibility === "hidden" || portfolio.maturity === "fold-candidate") {
|
|
8424
8463
|
console.log(
|
|
8425
|
-
`${
|
|
8464
|
+
`${YELLOW11} Warning:${RESET16} blueprint "${blueprint.id}" is folded out of public browsing.`
|
|
8426
8465
|
);
|
|
8427
8466
|
if (portfolio.recommended_alternative) {
|
|
8428
8467
|
console.log(
|
|
@@ -8435,7 +8474,7 @@ function printBlueprintPortfolioNotice(blueprint) {
|
|
|
8435
8474
|
}
|
|
8436
8475
|
if (portfolio.visibility === "labs") {
|
|
8437
8476
|
console.log(
|
|
8438
|
-
`${
|
|
8477
|
+
`${YELLOW11} Note:${RESET16} blueprint "${blueprint.id}" is a Labs blueprint; direct scaffolding is supported, but it is not a default recommendation yet.`
|
|
8439
8478
|
);
|
|
8440
8479
|
}
|
|
8441
8480
|
}
|
|
@@ -8724,7 +8763,7 @@ async function cmdValidate(path) {
|
|
|
8724
8763
|
console.log(heading2("Guard violations:"));
|
|
8725
8764
|
for (const v of violations) {
|
|
8726
8765
|
const vr = v;
|
|
8727
|
-
console.log(` ${
|
|
8766
|
+
console.log(` ${YELLOW11}[${vr.rule}]${RESET16} ${vr.message}`);
|
|
8728
8767
|
if (vr.suggestion) {
|
|
8729
8768
|
console.log(` ${DIM16}Suggestion: ${vr.suggestion}${RESET16}`);
|
|
8730
8769
|
}
|
|
@@ -9058,7 +9097,7 @@ async function cmdInit(args) {
|
|
|
9058
9097
|
console.log(dim3(" Found .decantr/init-seed.json brownfield guidance."));
|
|
9059
9098
|
}
|
|
9060
9099
|
if (detected.existingEssence && !args.existing) {
|
|
9061
|
-
console.log(`${
|
|
9100
|
+
console.log(`${YELLOW11}Warning: decantr.essence.json already exists.${RESET16}`);
|
|
9062
9101
|
const overwrite = await confirm("Overwrite existing configuration?", false);
|
|
9063
9102
|
if (!overwrite) {
|
|
9064
9103
|
console.log(dim3("Cancelled."));
|
|
@@ -9161,7 +9200,7 @@ async function cmdInit(args) {
|
|
|
9161
9200
|
} else if (shouldUseRegistry && !apiAvailable) {
|
|
9162
9201
|
if (!args.blueprint) {
|
|
9163
9202
|
console.log(`
|
|
9164
|
-
${
|
|
9203
|
+
${YELLOW11}You're offline. Scaffolding minimal Decantr project.${RESET16}`);
|
|
9165
9204
|
console.log(
|
|
9166
9205
|
dim3("Run `decantr sync` or `decantr upgrade` when online to pull full registry content.\n")
|
|
9167
9206
|
);
|
|
@@ -9210,7 +9249,7 @@ ${YELLOW10}You're offline. Scaffolding minimal Decantr project.${RESET16}`);
|
|
|
9210
9249
|
return;
|
|
9211
9250
|
}
|
|
9212
9251
|
console.log(`
|
|
9213
|
-
${
|
|
9252
|
+
${YELLOW11}You're offline. Scaffolding Decantr default.${RESET16}`);
|
|
9214
9253
|
console.log(dim3("Run `decantr upgrade` when online, or visit decantr.ai/registry\n"));
|
|
9215
9254
|
selectedBlueprint = "default";
|
|
9216
9255
|
} else if (shouldUseRegistry) {
|
|
@@ -9392,7 +9431,7 @@ ${YELLOW10}You're offline. Scaffolding Decantr default.${RESET16}`);
|
|
|
9392
9431
|
return;
|
|
9393
9432
|
}
|
|
9394
9433
|
console.log(
|
|
9395
|
-
`${
|
|
9434
|
+
`${YELLOW11} Warning: Could not fetch blueprint "${options.blueprint}". Using defaults.${RESET16}`
|
|
9396
9435
|
);
|
|
9397
9436
|
}
|
|
9398
9437
|
} else if (shouldUseRegistry && options.archetype) {
|
|
@@ -9407,7 +9446,7 @@ ${YELLOW10}You're offline. Scaffolding Decantr default.${RESET16}`);
|
|
|
9407
9446
|
return;
|
|
9408
9447
|
}
|
|
9409
9448
|
console.log(
|
|
9410
|
-
`${
|
|
9449
|
+
`${YELLOW11} Warning: Could not fetch archetype "${options.archetype}". Using defaults.${RESET16}`
|
|
9411
9450
|
);
|
|
9412
9451
|
}
|
|
9413
9452
|
}
|
|
@@ -9424,7 +9463,7 @@ ${YELLOW10}You're offline. Scaffolding Decantr default.${RESET16}`);
|
|
|
9424
9463
|
return;
|
|
9425
9464
|
}
|
|
9426
9465
|
console.log(
|
|
9427
|
-
`${
|
|
9466
|
+
`${YELLOW11} Warning: Could not fetch theme "${options.theme}". Using defaults.${RESET16}`
|
|
9428
9467
|
);
|
|
9429
9468
|
}
|
|
9430
9469
|
}
|
|
@@ -9629,7 +9668,7 @@ async function cmdStatus(projectRoot = process.cwd()) {
|
|
|
9629
9668
|
` Guard: ${v4.meta.guard.mode} (DNA: ${v4.meta.guard.dna_enforcement}, Blueprint: ${v4.meta.guard.blueprint_enforcement})`
|
|
9630
9669
|
);
|
|
9631
9670
|
} else {
|
|
9632
|
-
console.log(` ${
|
|
9671
|
+
console.log(` ${YELLOW11}Run \`decantr migrate --to v4\` to upgrade this project.${RESET16}`);
|
|
9633
9672
|
}
|
|
9634
9673
|
} catch (e) {
|
|
9635
9674
|
console.log(` ${RED12}Error reading essence: ${e.message}${RESET16}`);
|
|
@@ -9642,15 +9681,15 @@ async function cmdStatus(projectRoot = process.cwd()) {
|
|
|
9642
9681
|
const syncStatus = projectJson.sync?.status || "unknown";
|
|
9643
9682
|
const lastSync = projectJson.sync?.lastSync || "never";
|
|
9644
9683
|
const source = projectJson.sync?.registrySource || "unknown";
|
|
9645
|
-
const statusColor = syncStatus === "synced" ? GREEN16 :
|
|
9684
|
+
const statusColor = syncStatus === "synced" ? GREEN16 : YELLOW11;
|
|
9646
9685
|
console.log(` Status: ${statusColor}${syncStatus}${RESET16}`);
|
|
9647
9686
|
console.log(` Last sync: ${dim3(lastSync)}`);
|
|
9648
9687
|
console.log(` Source: ${dim3(source)}`);
|
|
9649
9688
|
} catch {
|
|
9650
|
-
console.log(` ${
|
|
9689
|
+
console.log(` ${YELLOW11}Could not read project.json${RESET16}`);
|
|
9651
9690
|
}
|
|
9652
9691
|
} else {
|
|
9653
|
-
console.log(` ${
|
|
9692
|
+
console.log(` ${YELLOW11}No .decantr/project.json found${RESET16}`);
|
|
9654
9693
|
console.log(dim3(' Run "decantr init" to create project files.'));
|
|
9655
9694
|
}
|
|
9656
9695
|
}
|
|
@@ -9663,12 +9702,12 @@ async function cmdSync() {
|
|
|
9663
9702
|
console.log(success3("Sync completed successfully."));
|
|
9664
9703
|
console.log(` Synced: ${result.synced.join(", ")}`);
|
|
9665
9704
|
if (result.failed.length > 0) {
|
|
9666
|
-
console.log(` ${
|
|
9705
|
+
console.log(` ${YELLOW11}Failed: ${result.failed.join(", ")}${RESET16}`);
|
|
9667
9706
|
}
|
|
9668
9707
|
} else {
|
|
9669
|
-
console.log(`${
|
|
9708
|
+
console.log(`${YELLOW11}Could not sync: API unavailable${RESET16}`);
|
|
9670
9709
|
if (result.failed.length > 0) {
|
|
9671
|
-
console.log(` ${
|
|
9710
|
+
console.log(` ${YELLOW11}Failed: ${result.failed.join(", ")}${RESET16}`);
|
|
9672
9711
|
}
|
|
9673
9712
|
}
|
|
9674
9713
|
}
|
|
@@ -9678,7 +9717,7 @@ function printVerificationFindings(findings) {
|
|
|
9678
9717
|
return;
|
|
9679
9718
|
}
|
|
9680
9719
|
for (const finding of findings) {
|
|
9681
|
-
const color = finding.severity === "error" ? RED12 : finding.severity === "warn" ?
|
|
9720
|
+
const color = finding.severity === "error" ? RED12 : finding.severity === "warn" ? YELLOW11 : CYAN9;
|
|
9682
9721
|
console.log(
|
|
9683
9722
|
` ${color}[${finding.severity.toUpperCase()}]${RESET16} ${finding.category}: ${finding.message}`
|
|
9684
9723
|
);
|
|
@@ -10319,7 +10358,7 @@ async function cmdAdoptWorkflow(args) {
|
|
|
10319
10358
|
)
|
|
10320
10359
|
);
|
|
10321
10360
|
} catch (e) {
|
|
10322
|
-
console.log(`${
|
|
10361
|
+
console.log(`${YELLOW11}Pack hydration skipped:${RESET16} ${e.message}`);
|
|
10323
10362
|
console.log(
|
|
10324
10363
|
dim3(
|
|
10325
10364
|
`Run ${compilePacksCommandForProject(projectArg)} after adoption if you want hosted page/review packs.`
|
|
@@ -10452,7 +10491,7 @@ async function cmdVerifyWorkflow(args) {
|
|
|
10452
10491
|
if (!quietOutput) {
|
|
10453
10492
|
console.log("");
|
|
10454
10493
|
console.log(
|
|
10455
|
-
`${
|
|
10494
|
+
`${YELLOW11}Local pattern pack missing.${RESET16} Run ${cyan3(withProject("decantr codify --from-audit", projectArg))}, review the proposal, then run ${cyan3(withProject("decantr codify --accept", projectArg))}.`
|
|
10456
10495
|
);
|
|
10457
10496
|
}
|
|
10458
10497
|
process.exitCode = process.exitCode || 1;
|
|
@@ -10468,11 +10507,11 @@ async function cmdVerifyWorkflow(args) {
|
|
|
10468
10507
|
console.log(`${GREEN16}Local rule manifest found:${RESET16} ${validation.rulesPath}`);
|
|
10469
10508
|
} else {
|
|
10470
10509
|
console.log(
|
|
10471
|
-
`${
|
|
10510
|
+
`${YELLOW11}Local rule manifest missing.${RESET16} Run ${cyan3("decantr codify --from-audit")} to propose .decantr/rules.json.`
|
|
10472
10511
|
);
|
|
10473
10512
|
}
|
|
10474
10513
|
for (const warning of validation.warnings.slice(0, 8)) {
|
|
10475
|
-
console.log(`${
|
|
10514
|
+
console.log(`${YELLOW11}warn${RESET16} ${warning}`);
|
|
10476
10515
|
}
|
|
10477
10516
|
if (validation.findings.length > 0) {
|
|
10478
10517
|
console.log("");
|
|
@@ -10625,7 +10664,7 @@ async function cmdTaskWorkflow(args) {
|
|
|
10625
10664
|
console.log("");
|
|
10626
10665
|
console.log(`${BOLD9}Project-owned local law:${RESET16}`);
|
|
10627
10666
|
console.log(
|
|
10628
|
-
` ${
|
|
10667
|
+
` ${YELLOW11}Not codified yet.${RESET16} Run ${cyan3(withProject("decantr codify --from-audit", projectArg))} after adoption.`
|
|
10629
10668
|
);
|
|
10630
10669
|
}
|
|
10631
10670
|
if (context.changedFiles.length > 0) {
|
|
@@ -11424,7 +11463,7 @@ async function main() {
|
|
|
11424
11463
|
case "heal": {
|
|
11425
11464
|
if (command === "heal") {
|
|
11426
11465
|
console.log(
|
|
11427
|
-
`${
|
|
11466
|
+
`${YELLOW11}Note: \`decantr heal\` is deprecated. Use \`decantr check\` instead.${RESET16}`
|
|
11428
11467
|
);
|
|
11429
11468
|
}
|
|
11430
11469
|
const { cmdHeal } = await import("./heal-ZQHEHBUJ.js");
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decantr/cli",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.5",
|
|
4
4
|
"description": "Decantr CLI - scaffold, audit, inspect Project Health, and maintain Decantr projects from the terminal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"decantr",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"ajv": "^8.20.0",
|
|
51
51
|
"@decantr/core": "2.1.0",
|
|
52
|
-
"@decantr/essence-spec": "2.0.1",
|
|
53
52
|
"@decantr/registry": "2.2.0",
|
|
54
53
|
"@decantr/telemetry": "2.2.1",
|
|
54
|
+
"@decantr/essence-spec": "2.0.1",
|
|
55
55
|
"@decantr/verifier": "2.3.3"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|