@hivelore/cli 0.53.0 → 0.53.2
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 +7 -5
- package/dist/{chunk-OYJKHD22.js → chunk-2NKLKUKP.js} +2 -2
- package/dist/chunk-2NKLKUKP.js.map +1 -0
- package/dist/{chunk-JHHU64YA.js → chunk-RL6BYWOY.js} +4 -4
- package/dist/chunk-RL6BYWOY.js.map +1 -0
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/{memory-pending-GKZE3IYA.js → memory-pending-DSE4RQBB.js} +2 -2
- package/dist/{server-CZQE6B4I.js → server-YARY25H4.js} +2 -2
- package/package.json +4 -4
- package/dist/chunk-JHHU64YA.js.map +0 -1
- package/dist/chunk-OYJKHD22.js.map +0 -1
- /package/dist/{memory-pending-GKZE3IYA.js.map → memory-pending-DSE4RQBB.js.map} +0 -0
- /package/dist/{server-CZQE6B4I.js.map → server-YARY25H4.js.map} +0 -0
package/README.md
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
# @hivelore/cli
|
|
8
8
|
|
|
9
|
-
> **
|
|
9
|
+
> **The deterministic policy gate for agent-written code** — it refuses the commit that repeats a mistake your team already paid for.
|
|
10
10
|
|
|
11
|
-
Hivelore
|
|
11
|
+
Hivelore is the **enforcement layer** inside an AI coding-agent harness. A failed approach or gotcha captured via MCP (`mem_tried`) becomes a **validated guard** — a regex, an [ast-grep](https://ast-grep.github.io) structural pattern, or a command/test oracle routing your own test — trusted to block only after it is proven silent on the correct code and firing on the mistake. Git hooks and a CI entrypoint then refuse any diff that reintroduces the documented mistake — **same diff, same verdict, on every machine**. The knowledge lives as repo-native Markdown in `.ai/`, versioned with your code and briefed to any agent over MCP; it complements tests, linters, and evals rather than replacing them.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="https://raw.githubusercontent.com/Doucs91/hivelore/main/docs/demo/hivelore-demo.gif" alt="A captured lesson attaches a validated guard; the commit that reintroduces the mistake is refused — same diff, same verdict on every machine" width="720" />
|
|
15
|
+
</p>
|
|
14
16
|
|
|
15
17
|
---
|
|
16
18
|
|
|
@@ -20,11 +22,11 @@ The memory system is the mechanism. The CLI is the control plane: initialize con
|
|
|
20
22
|
npm install -g @hivelore/cli
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
This installs the `
|
|
25
|
+
This installs the `hivelore` command globally. **The MCP server is bundled** — use `hivelore mcp --stdio` in your AI client (no separate `@hivelore/mcp` install required for normal use).
|
|
24
26
|
|
|
25
27
|
> **Semantic search** (optional): install `@hivelore/embeddings` for local embedding-based search (no data leaves your machine).
|
|
26
28
|
|
|
27
|
-
>
|
|
29
|
+
> Repos installed before the `haive`→`hivelore` rename are migrated automatically on the next `hivelore init` / `hivelore enforce install`; if an old git hook still calls the removed `haive` binary, `hivelore doctor --fix` regenerates it.
|
|
28
30
|
|
|
29
31
|
---
|
|
30
32
|
|
|
@@ -58,7 +58,7 @@ async function runPending(opts) {
|
|
|
58
58
|
);
|
|
59
59
|
console.log(` ${ui.dim(path.relative(root, filePath))}`);
|
|
60
60
|
}
|
|
61
|
-
if (proposed.length > 0) console.log(ui.dim(` \u2192 hivelore memory approve <id> or hivelore memory
|
|
61
|
+
if (proposed.length > 0) console.log(ui.dim(` \u2192 hivelore memory approve <id> or hivelore memory approve --all`));
|
|
62
62
|
console.log();
|
|
63
63
|
}
|
|
64
64
|
if (drafts.length > 0) {
|
|
@@ -82,4 +82,4 @@ export {
|
|
|
82
82
|
registerMemoryPending,
|
|
83
83
|
runPending
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-2NKLKUKP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory-pending.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { Command } from \"commander\";\nimport {\n findProjectRoot,\n getUsage,\n loadUsageIndex,\n resolveHaivePaths,\n} from \"@hivelore/core\";\nimport { loadMemoriesFromDir } from \"../utils/fs.js\";\nimport { ui } from \"../utils/ui.js\";\n\nexport interface PendingOptions {\n scope?: \"personal\" | \"team\" | \"module\";\n dir?: string;\n}\n\nexport function registerMemoryPending(memory: Command): void {\n memory\n .command(\"pending\", { hidden: true })\n .description(\"List draft and proposed memories awaiting review (sorted by reads desc).\\n\\n draft = created but not yet activated · proposed = promoted, awaiting team validation\")\n .option(\"--scope <scope>\", \"filter by scope (personal | team | module)\")\n .option(\"-d, --dir <dir>\", \"project root\")\n .action(async (opts: PendingOptions) => runPending(opts));\n}\n\nexport async function runPending(opts: PendingOptions): Promise<void> {\n const root = findProjectRoot(opts.dir);\n const paths = resolveHaivePaths(root);\n if (!existsSync(paths.memoriesDir)) {\n ui.error(`No .ai/memories at ${root}.`);\n process.exitCode = 1;\n return;\n }\n\n const all = await loadMemoriesFromDir(paths.memoriesDir);\n const usage = await loadUsageIndex(paths);\n\n const filterFn = ({ memory: mem }: { memory: { frontmatter: { status: string; scope: string } } }) => {\n if (mem.frontmatter.status !== \"proposed\" && mem.frontmatter.status !== \"draft\") return false;\n if (opts.scope && mem.frontmatter.scope !== opts.scope) return false;\n return true;\n };\n const pending = all.filter(filterFn);\n\n if (pending.length === 0) {\n ui.info(\"No draft or proposed memories awaiting review.\");\n ui.info(\"Drafts are created by `hivelore memory save` without `--status validated`.\");\n return;\n }\n\n pending.sort(\n (a, b) =>\n getUsage(usage, b.memory.frontmatter.id).read_count -\n getUsage(usage, a.memory.frontmatter.id).read_count,\n );\n\n const now = Date.now();\n const drafts = pending.filter((m) => m.memory.frontmatter.status === \"draft\");\n const proposed = pending.filter((m) => m.memory.frontmatter.status === \"proposed\");\n\n if (proposed.length > 0) {\n console.log(ui.bold(`Proposed (${proposed.length}) — awaiting team validation`));\n for (const { memory: mem, filePath } of proposed) {\n const fm = mem.frontmatter;\n const u = getUsage(usage, fm.id);\n const ageDays = Math.floor((now - new Date(fm.created_at).getTime()) / 86_400_000);\n const ageStr = ageDays === 0 ? \"today\" : `${ageDays}d`;\n console.log(\n ` ${ui.bold(fm.id)} ${ui.dim(`${fm.scope}/${fm.type}`)} ${ui.dim(`age=${ageStr} reads=${u.read_count}`)}`,\n );\n console.log(` ${ui.dim(path.relative(root, filePath))}`);\n }\n if (proposed.length > 0) console.log(ui.dim(` → hivelore memory approve <id> or hivelore memory approve --all`));\n console.log();\n }\n\n if (drafts.length > 0) {\n console.log(ui.bold(`Draft (${drafts.length}) — created but not yet activated`));\n for (const { memory: mem, filePath } of drafts) {\n const fm = mem.frontmatter;\n const u = getUsage(usage, fm.id);\n const ageDays = Math.floor((now - new Date(fm.created_at).getTime()) / 86_400_000);\n const ageStr = ageDays === 0 ? \"today\" : `${ageDays}d`;\n console.log(\n ` ${ui.bold(fm.id)} ${ui.dim(`${fm.scope}/${fm.type}`)} ${ui.dim(`age=${ageStr} reads=${u.read_count}`)}`,\n );\n console.log(` ${ui.dim(path.relative(root, filePath))}`);\n }\n console.log(ui.dim(` → hivelore memory approve <id> (activate) | hivelore memory promote <id> (share with team)`));\n }\n\n ui.info(`${pending.length} total pending (${proposed.length} proposed · ${drafts.length} draft)`);\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AACjB,OAAwB;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,SAAS,sBAAsB,QAAuB;AAC3D,SACG,QAAQ,WAAW,EAAE,QAAQ,KAAK,CAAC,EACnC,YAAY,wKAAqK,EACjL,OAAO,mBAAmB,4CAA4C,EACtE,OAAO,mBAAmB,cAAc,EACxC,OAAO,OAAO,SAAyB,WAAW,IAAI,CAAC;AAC5D;AAEA,eAAsB,WAAW,MAAqC;AAChE,QAAM,OAAO,gBAAgB,KAAK,GAAG;AACrC,QAAM,QAAQ,kBAAkB,IAAI;AACpC,MA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, '\\"').trim().slice(0, 120);
|
|
3258
3258
|
}
|
|
3259
3259
|
function serverVersion() {
|
|
3260
|
-
return true ? "0.53.
|
|
3260
|
+
return true ? "0.53.2" : "dev";
|
|
3261
3261
|
}
|
|
3262
3262
|
var CodeMapInputSchema = {
|
|
3263
3263
|
file: z21.string().optional().describe("Filter to files whose path contains this substring"),
|
|
@@ -4620,7 +4620,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4620
4620
|
};
|
|
4621
4621
|
}
|
|
4622
4622
|
var SERVER_NAME = "hivelore";
|
|
4623
|
-
var SERVER_VERSION = "0.53.
|
|
4623
|
+
var SERVER_VERSION = "0.53.2";
|
|
4624
4624
|
function jsonResult(data) {
|
|
4625
4625
|
return {
|
|
4626
4626
|
content: [
|
|
@@ -5563,7 +5563,7 @@ async function runHaiveMcpStdio(options) {
|
|
|
5563
5563
|
await writeMcpRuntimeMarker(context).catch(() => {
|
|
5564
5564
|
});
|
|
5565
5565
|
console.error(
|
|
5566
|
-
`[
|
|
5566
|
+
`[hivelore-mcp] starting server v${SERVER_VERSION} (project root: ${context.paths.root})`
|
|
5567
5567
|
);
|
|
5568
5568
|
await server.connect(new StdioServerTransport());
|
|
5569
5569
|
}
|
|
@@ -5613,4 +5613,4 @@ export {
|
|
|
5613
5613
|
runHaiveMcpStdio,
|
|
5614
5614
|
writeMcpRuntimeMarker
|
|
5615
5615
|
};
|
|
5616
|
-
//# sourceMappingURL=chunk-
|
|
5616
|
+
//# sourceMappingURL=chunk-RL6BYWOY.js.map
|