@hiveai/cli 0.9.23 → 0.9.24
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.js +48 -11
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -715,6 +715,7 @@ function registerIndexCode(program2) {
|
|
|
715
715
|
const extraExcludes = (opts.exclude ?? "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
716
716
|
ui.info(`Indexing source files in ${root}\u2026`);
|
|
717
717
|
const map = await buildCodeMap(root, {
|
|
718
|
+
includeUntracked: true,
|
|
718
719
|
excludeDirs: [
|
|
719
720
|
"node_modules",
|
|
720
721
|
"dist",
|
|
@@ -1625,11 +1626,10 @@ async function projectContextVersionStatus(root, paths) {
|
|
|
1625
1626
|
};
|
|
1626
1627
|
}
|
|
1627
1628
|
async function refreshCodeMap(root, paths, force) {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
if (existing) return false;
|
|
1631
|
-
}
|
|
1629
|
+
const existing = await loadCodeMap3(paths);
|
|
1630
|
+
if (existing && !force) return false;
|
|
1632
1631
|
const map = await buildCodeMap2(root, {
|
|
1632
|
+
includeUntracked: true,
|
|
1633
1633
|
excludeDirs: [
|
|
1634
1634
|
"node_modules",
|
|
1635
1635
|
"dist",
|
|
@@ -1642,6 +1642,9 @@ async function refreshCodeMap(root, paths, force) {
|
|
|
1642
1642
|
"coverage"
|
|
1643
1643
|
]
|
|
1644
1644
|
});
|
|
1645
|
+
if (existing && existing.root === map.root && JSON.stringify(existing.files) === JSON.stringify(map.files)) {
|
|
1646
|
+
return false;
|
|
1647
|
+
}
|
|
1645
1648
|
await saveCodeMap2(paths, map);
|
|
1646
1649
|
return true;
|
|
1647
1650
|
}
|
|
@@ -2934,7 +2937,7 @@ function registerInit(program2) {
|
|
|
2934
2937
|
}
|
|
2935
2938
|
try {
|
|
2936
2939
|
ui.info("Building code-map\u2026");
|
|
2937
|
-
const map = await buildCodeMap3(root);
|
|
2940
|
+
const map = await buildCodeMap3(root, { includeUntracked: true });
|
|
2938
2941
|
await saveCodeMap3(paths, map);
|
|
2939
2942
|
ui.success(`Code-map built (${Object.keys(map.files).length} files)`);
|
|
2940
2943
|
} catch {
|
|
@@ -7059,7 +7062,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
7059
7062
|
};
|
|
7060
7063
|
}
|
|
7061
7064
|
var SERVER_NAME = "haive";
|
|
7062
|
-
var SERVER_VERSION = "0.9.
|
|
7065
|
+
var SERVER_VERSION = "0.9.24";
|
|
7063
7066
|
function jsonResult(data) {
|
|
7064
7067
|
return {
|
|
7065
7068
|
content: [
|
|
@@ -8657,6 +8660,7 @@ TODO \u2014 write the memory body.
|
|
|
8657
8660
|
await writeFile14(topicMatch.filePath, serializeMemory12({ frontmatter: newFrontmatter, body }), "utf8");
|
|
8658
8661
|
ui.success(`Updated (topic upsert) ${path16.relative(root, topicMatch.filePath)}`);
|
|
8659
8662
|
ui.info(`id=${fm.id} revision=${revisionCount}`);
|
|
8663
|
+
await runPostMemoryAutopilot(root, paths, config);
|
|
8660
8664
|
return;
|
|
8661
8665
|
}
|
|
8662
8666
|
}
|
|
@@ -8696,6 +8700,7 @@ TODO \u2014 write the memory body.
|
|
|
8696
8700
|
await writeFile14(file, serializeMemory12({ frontmatter, body }), "utf8");
|
|
8697
8701
|
ui.success(`Created ${path16.relative(root, file)}`);
|
|
8698
8702
|
ui.info(`id=${frontmatter.id} scope=${frontmatter.scope} status=${frontmatter.status}`);
|
|
8703
|
+
await runPostMemoryAutopilot(root, paths, config);
|
|
8699
8704
|
if (inferredTags.length > 0) {
|
|
8700
8705
|
ui.info(`auto-tagged: ${inferredTags.join(", ")} (use --no-auto-tag to disable)`);
|
|
8701
8706
|
}
|
|
@@ -8721,6 +8726,19 @@ TODO \u2014 write the memory body.
|
|
|
8721
8726
|
}
|
|
8722
8727
|
});
|
|
8723
8728
|
}
|
|
8729
|
+
async function runPostMemoryAutopilot(root, paths, config) {
|
|
8730
|
+
if (!config.autopilot && config.autoRepair?.corpus !== true) return;
|
|
8731
|
+
const repairs = await applyAutopilotRepairs(root, paths, {
|
|
8732
|
+
applyConfig: false,
|
|
8733
|
+
applyContext: false,
|
|
8734
|
+
applyCorpus: true,
|
|
8735
|
+
applyCodeMap: false,
|
|
8736
|
+
applyCodeSearch: false
|
|
8737
|
+
});
|
|
8738
|
+
for (const repair of repairs) {
|
|
8739
|
+
ui.info(repair.message);
|
|
8740
|
+
}
|
|
8741
|
+
}
|
|
8724
8742
|
function parseCsv2(value) {
|
|
8725
8743
|
if (!value) return [];
|
|
8726
8744
|
return value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
@@ -11627,7 +11645,8 @@ function registerDoctor(program2) {
|
|
|
11627
11645
|
applyContext: true,
|
|
11628
11646
|
applyCorpus: true,
|
|
11629
11647
|
applyCodeMap: true,
|
|
11630
|
-
applyCodeSearch: true
|
|
11648
|
+
applyCodeSearch: true,
|
|
11649
|
+
forceCodeMap: true
|
|
11631
11650
|
})
|
|
11632
11651
|
);
|
|
11633
11652
|
}
|
|
@@ -11813,14 +11832,14 @@ function registerDoctor(program2) {
|
|
|
11813
11832
|
fix: "Edit .ai/haive.config.json: set autoSessionEnd: true (or re-run `haive init` without --manual)."
|
|
11814
11833
|
});
|
|
11815
11834
|
}
|
|
11816
|
-
findings.push(...await collectInstallFindings(root, "0.9.
|
|
11835
|
+
findings.push(...await collectInstallFindings(root, "0.9.24"));
|
|
11817
11836
|
try {
|
|
11818
11837
|
const legacyRaw = execSync3("haive-mcp --version", {
|
|
11819
11838
|
encoding: "utf8",
|
|
11820
11839
|
timeout: 3e3,
|
|
11821
11840
|
stdio: ["ignore", "pipe", "ignore"]
|
|
11822
11841
|
}).trim();
|
|
11823
|
-
const cliVersion = "0.9.
|
|
11842
|
+
const cliVersion = "0.9.24";
|
|
11824
11843
|
if (legacyRaw && legacyRaw !== cliVersion) {
|
|
11825
11844
|
findings.push({
|
|
11826
11845
|
severity: "warn",
|
|
@@ -12361,6 +12380,24 @@ function registerPrecommit(program2) {
|
|
|
12361
12380
|
try {
|
|
12362
12381
|
diff = await runCommand3("git", ["diff", "--cached"], root);
|
|
12363
12382
|
if (!diff.trim()) {
|
|
12383
|
+
if (opts.json) {
|
|
12384
|
+
console.log(JSON.stringify({
|
|
12385
|
+
should_block: false,
|
|
12386
|
+
summary: {
|
|
12387
|
+
anti_patterns: 0,
|
|
12388
|
+
blocking_warnings: 0,
|
|
12389
|
+
review_warnings: 0,
|
|
12390
|
+
info_warnings: 0,
|
|
12391
|
+
relevant_memories: 0,
|
|
12392
|
+
stale_anchors: 0
|
|
12393
|
+
},
|
|
12394
|
+
warnings: [],
|
|
12395
|
+
relevant_memories: [],
|
|
12396
|
+
stale_anchors: [],
|
|
12397
|
+
notice: "No staged changes \u2014 nothing to check."
|
|
12398
|
+
}, null, 2));
|
|
12399
|
+
return;
|
|
12400
|
+
}
|
|
12364
12401
|
ui.warn("No staged changes \u2014 nothing to check. Stage with `git add` first.");
|
|
12365
12402
|
return;
|
|
12366
12403
|
}
|
|
@@ -13007,7 +13044,7 @@ async function buildEnforcementReport(dir, stage, sessionId) {
|
|
|
13007
13044
|
findings: [{ severity: "info", code: "enforcement-off", message: "hAIve enforcement is disabled." }]
|
|
13008
13045
|
});
|
|
13009
13046
|
}
|
|
13010
|
-
findings.push(...await inspectIntegrationVersions(root, "0.9.
|
|
13047
|
+
findings.push(...await inspectIntegrationVersions(root, "0.9.24"));
|
|
13011
13048
|
if (config.enforcement?.requireBriefingFirst !== false && stage !== "ci") {
|
|
13012
13049
|
const hasBriefing = await hasRecentBriefingMarker(paths, sessionId);
|
|
13013
13050
|
findings.push(hasBriefing ? { severity: "ok", code: "briefing-loaded", message: "A recent hAIve briefing marker exists." } : {
|
|
@@ -13547,7 +13584,7 @@ function registerRun(program2) {
|
|
|
13547
13584
|
|
|
13548
13585
|
// src/index.ts
|
|
13549
13586
|
var program = new Command51();
|
|
13550
|
-
program.name("haive").description("hAIve \u2014 the memory and enforcement layer of your agent harness").version("0.9.
|
|
13587
|
+
program.name("haive").description("hAIve \u2014 the memory and enforcement layer of your agent harness").version("0.9.24").option("--advanced", "show maintenance and experimental commands in help");
|
|
13551
13588
|
registerInit(program);
|
|
13552
13589
|
registerWelcome(program);
|
|
13553
13590
|
registerResolveProject(program);
|