forgehive 1.0.7 → 1.0.9
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/cli.js +32 -22
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9738,6 +9738,16 @@ var CAP_CATEGORIES = [
|
|
|
9738
9738
|
["Messaging", ["rabbitmq", "kafka", "nats", "masstransit", "oban", "broadway", "sidekiq", "celery", "hangfire", "task-queue", "messaging"]],
|
|
9739
9739
|
["Observ.", ["opentelemetry", "prometheus", "sentry", "datadog", "logging", "serilog", "nlog", "logrus", "zap", "pino", "winston", "loguru"]]
|
|
9740
9740
|
];
|
|
9741
|
+
var brand = `${ANSI.orange}${ANSI.bold}Forge${ANSI.reset}${ANSI.bold}Hive${ANSI.reset}${ANSI.orange}\u1D2C\u1D35${ANSI.reset}`;
|
|
9742
|
+
function printScanHeader(projectName, signals, caps) {
|
|
9743
|
+
const cols = process.stdout.columns ?? 60;
|
|
9744
|
+
const sep = ANSI.dim + "\u2500".repeat(cols) + ANSI.reset;
|
|
9745
|
+
console.log(`
|
|
9746
|
+
\u{1F50D} ${brand} ${ANSI.dim}\xB7${ANSI.reset} Stack Intelligence`);
|
|
9747
|
+
console.log(` ${ANSI.green}${projectName} \xB7 ${signals} Signale \xB7 ${caps} Capabilities${ANSI.reset}`);
|
|
9748
|
+
console.log(sep);
|
|
9749
|
+
console.log();
|
|
9750
|
+
}
|
|
9741
9751
|
function buildCapabilitySummary(ids) {
|
|
9742
9752
|
if (ids.length === 0) return " (keine Capabilities erkannt)";
|
|
9743
9753
|
const set2 = new Set(ids);
|
|
@@ -9782,14 +9792,7 @@ if (command === "init") {
|
|
|
9782
9792
|
const capMap = mapSignalsToCapabilities(scanResult);
|
|
9783
9793
|
const totalSignals = scanResult.signals.length;
|
|
9784
9794
|
const totalCaps = capMap.confirmed.length;
|
|
9785
|
-
|
|
9786
|
-
const sep51 = ANSI.dim + "\u2500".repeat(51) + ANSI.reset;
|
|
9787
|
-
const brand = `${ANSI.orange}${ANSI.bold}Forge${ANSI.reset}${ANSI.bold}Hive${ANSI.reset}${ANSI.orange}\u1D2C\u1D35${ANSI.reset}`;
|
|
9788
|
-
console.log(`
|
|
9789
|
-
\u{1F50D} ${brand} ${ANSI.dim}\xB7${ANSI.reset} Stack Intelligence`);
|
|
9790
|
-
console.log(` ${ANSI.green}${projectName} \xB7 ${totalSignals} Signale \xB7 ${totalCaps} Capabilities${ANSI.reset}`);
|
|
9791
|
-
console.log(sep51);
|
|
9792
|
-
console.log();
|
|
9795
|
+
printScanHeader(path40.basename(projectRoot), totalSignals, totalCaps);
|
|
9793
9796
|
const block = loadClaudeMdBlock();
|
|
9794
9797
|
writeForgehiveDir(projectRoot, scanResult, capMap, block);
|
|
9795
9798
|
const hash = computeHash(projectRoot);
|
|
@@ -9804,14 +9807,19 @@ if (command === "init") {
|
|
|
9804
9807
|
console.log();
|
|
9805
9808
|
if (subcommand === "--yes" || rest.includes("--yes")) {
|
|
9806
9809
|
confirm(projectRoot);
|
|
9807
|
-
console.log(
|
|
9810
|
+
console.log(`${ANSI.green}\u2713${ANSI.reset} ${brand} bereit
|
|
9811
|
+
`);
|
|
9808
9812
|
} else {
|
|
9809
|
-
const ok = await promptConfirm(
|
|
9813
|
+
const ok = await promptConfirm(` Best\xE4tigen und loslegen? ${ANSI.dim}[Y/n]${ANSI.reset} `);
|
|
9810
9814
|
if (ok) {
|
|
9811
9815
|
confirm(projectRoot);
|
|
9812
|
-
console.log(
|
|
9816
|
+
console.log(`
|
|
9817
|
+
${ANSI.green}\u2713${ANSI.reset} ${brand} bereit \u2014 \xF6ffne Claude Code in diesem Projekt.
|
|
9818
|
+
`);
|
|
9813
9819
|
} else {
|
|
9814
|
-
console.log(
|
|
9820
|
+
console.log(`
|
|
9821
|
+
\xDCberpr\xFCfe .forgehive/capabilities.yaml, dann: ${ANSI.bold}fh confirm${ANSI.reset}
|
|
9822
|
+
`);
|
|
9815
9823
|
}
|
|
9816
9824
|
}
|
|
9817
9825
|
})().catch((err) => {
|
|
@@ -9821,8 +9829,9 @@ if (command === "init") {
|
|
|
9821
9829
|
} else if (command === "confirm") {
|
|
9822
9830
|
try {
|
|
9823
9831
|
confirm(projectRoot);
|
|
9824
|
-
console.log(
|
|
9825
|
-
|
|
9832
|
+
console.log(`
|
|
9833
|
+
${ANSI.green}\u2713${ANSI.reset} ${brand} bereit \u2014 \xF6ffne Claude Code in diesem Projekt.
|
|
9834
|
+
`);
|
|
9826
9835
|
} catch (err) {
|
|
9827
9836
|
console.error(`Fehler: ${err.message}`);
|
|
9828
9837
|
process.exit(1);
|
|
@@ -9943,7 +9952,6 @@ Ausf\xFChren mit --remove um zu l\xF6schen: fh memory prune ${days} --remove`);
|
|
|
9943
9952
|
console.log("\u2713 Keine \xC4nderungen erkannt \u2014 capabilities.yaml ist aktuell");
|
|
9944
9953
|
process.exit(0);
|
|
9945
9954
|
}
|
|
9946
|
-
console.log("\u{1F50D} \xC4nderungen erkannt \u2014 scanne erneut...\n");
|
|
9947
9955
|
const oldDoc = jsYaml.load(
|
|
9948
9956
|
fs39.readFileSync(path40.join(forgehiveDir, "capabilities.yaml"), "utf8")
|
|
9949
9957
|
);
|
|
@@ -9951,23 +9959,25 @@ Ausf\xFChren mit --remove um zu l\xF6schen: fh memory prune ${days} --remove`);
|
|
|
9951
9959
|
const scanResult = scan(projectRoot);
|
|
9952
9960
|
const newMap = mapSignalsToCapabilities(scanResult);
|
|
9953
9961
|
const diff = scanDiff(oldMap, newMap);
|
|
9962
|
+
printScanHeader(path40.basename(projectRoot), scanResult.signals.length, newMap.confirmed.length);
|
|
9963
|
+
console.log(buildCapabilitySummary(newMap.confirmed.map((c) => c.id)));
|
|
9964
|
+
console.log();
|
|
9954
9965
|
if (diff.added.length === 0 && diff.removed.length === 0) {
|
|
9955
|
-
console.log(
|
|
9966
|
+
console.log(`${ANSI.green}\u2713${ANSI.reset} ${brand} \u2014 keine \xC4nderungen
|
|
9967
|
+
`);
|
|
9956
9968
|
} else {
|
|
9957
9969
|
if (diff.added.length > 0) {
|
|
9958
|
-
console.log(
|
|
9959
|
-
for (const c of diff.added) console.log(` + ${c.id} (aus ${c.source})`);
|
|
9970
|
+
for (const c of diff.added) console.log(` ${ANSI.green}+${ANSI.reset} ${CAP_DISPLAY[c.id] ?? c.id}`);
|
|
9960
9971
|
}
|
|
9961
9972
|
if (diff.removed.length > 0) {
|
|
9962
|
-
console.log(
|
|
9963
|
-
for (const c of diff.removed) console.log(` - ${c.id}`);
|
|
9973
|
+
for (const c of diff.removed) console.log(` ${ANSI.dim}- ${CAP_DISPLAY[c.id] ?? c.id}${ANSI.reset}`);
|
|
9964
9974
|
}
|
|
9965
9975
|
console.log();
|
|
9966
9976
|
const block = loadClaudeMdBlock();
|
|
9967
9977
|
writeForgehiveDir(projectRoot, scanResult, newMap, block);
|
|
9968
9978
|
fs39.writeFileSync(path40.join(forgehiveDir, ".scan-hash"), currentHash, "utf8");
|
|
9969
|
-
console.log(
|
|
9970
|
-
|
|
9979
|
+
console.log(`${ANSI.green}\u2713${ANSI.reset} ${brand} \u2014 capabilities.yaml aktualisiert ${ANSI.dim}\xB7${ANSI.reset} ${ANSI.bold}fh confirm${ANSI.reset} zum Best\xE4tigen
|
|
9980
|
+
`);
|
|
9971
9981
|
}
|
|
9972
9982
|
} else if (command === "scan" && subcommand === "--check") {
|
|
9973
9983
|
if (!fs39.existsSync(path40.join(forgehiveDir, ".scan-hash"))) {
|