@hivelore/mcp 0.43.2 → 0.44.0
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 +1 -1
- package/dist/index.js +38 -7
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +40 -8
- package/dist/server.js.map +1 -1
- package/package.json +16 -3
package/README.md
CHANGED
|
@@ -420,7 +420,7 @@ Post-task reflection checklist. Guides the AI through capturing failed approache
|
|
|
420
420
|
```
|
|
421
421
|
Use the post_task prompt with:
|
|
422
422
|
task_summary: "Added Stripe payment integration"
|
|
423
|
-
files_touched: ["src/payments/StripeService.ts", "src/payments/PaymentController.ts"]
|
|
423
|
+
files_touched: '["src/payments/StripeService.ts", "src/payments/PaymentController.ts"]'
|
|
424
424
|
```
|
|
425
425
|
|
|
426
426
|
### `bootstrap_project`
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// src/server.ts
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { mkdir as mkdir8, writeFile as writeFile15 } from "fs/promises";
|
|
7
|
+
import path15 from "path";
|
|
6
8
|
|
|
7
9
|
// src/context.ts
|
|
8
10
|
import { findProjectRoot, resolveHaivePaths } from "@hivelore/core";
|
|
@@ -3191,7 +3193,7 @@ function oneLine(value) {
|
|
|
3191
3193
|
return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
|
|
3192
3194
|
}
|
|
3193
3195
|
function serverVersion() {
|
|
3194
|
-
return true ? "0.
|
|
3196
|
+
return true ? "0.44.0" : "dev";
|
|
3195
3197
|
}
|
|
3196
3198
|
|
|
3197
3199
|
// src/tools/code-map.ts
|
|
@@ -3477,7 +3479,8 @@ var AntiPatternsCheckInputSchema = {
|
|
|
3477
3479
|
),
|
|
3478
3480
|
min_semantic_score: z26.number().min(0).max(1).default(0.45).describe(
|
|
3479
3481
|
"Minimum cosine score for semantic-only anti-pattern hits. Anchor/literal matches still surface. Default 0.45 keeps broad, weakly-related memories out of review noise."
|
|
3480
|
-
)
|
|
3482
|
+
),
|
|
3483
|
+
track: z26.boolean().default(true).describe("Record real prevention outcomes. Set false for eval/selftest probes so synthetic cases never inflate ROI.")
|
|
3481
3484
|
};
|
|
3482
3485
|
function tokenizeDiffForLiteral(diff) {
|
|
3483
3486
|
const lines = diff.split("\n");
|
|
@@ -3670,7 +3673,9 @@ async function antiPatternsCheck(input, ctx) {
|
|
|
3670
3673
|
}).slice(0, input.limit);
|
|
3671
3674
|
const isHardBlockCatch = (w) => w.reasons.includes("sensor");
|
|
3672
3675
|
const strongCatches = warnings.filter(isHardBlockCatch);
|
|
3673
|
-
|
|
3676
|
+
if (input.track !== false) {
|
|
3677
|
+
await recordPreventionHits(ctx.paths, strongCatches.map((w) => w.id), "anti-pattern");
|
|
3678
|
+
}
|
|
3674
3679
|
return {
|
|
3675
3680
|
scanned: negative.length,
|
|
3676
3681
|
warnings
|
|
@@ -4452,13 +4457,14 @@ Main code areas detected: ${areas}
|
|
|
4452
4457
|
import { z as z35 } from "zod";
|
|
4453
4458
|
var PostTaskArgsSchema = {
|
|
4454
4459
|
task_summary: z35.string().optional().describe("One sentence describing what you just did"),
|
|
4455
|
-
files_touched: z35.
|
|
4460
|
+
files_touched: z35.string().optional().describe("Files you created or modified during the task, as CSV or a JSON array string")
|
|
4456
4461
|
};
|
|
4457
4462
|
function postTaskPrompt(args, ctx) {
|
|
4458
4463
|
const taskLine = args.task_summary ? `
|
|
4459
4464
|
Task just completed: **${args.task_summary}**` : "";
|
|
4460
|
-
const
|
|
4461
|
-
|
|
4465
|
+
const filesTouched = parsePromptFilesTouched(args.files_touched);
|
|
4466
|
+
const filesLine = filesTouched.length > 0 ? `
|
|
4467
|
+
Files touched: ${filesTouched.map((f) => `\`${f}\``).join(", ")}` : "";
|
|
4462
4468
|
const text = `You have just finished a task. Before closing this session, take 60 seconds to capture what you learned.
|
|
4463
4469
|
${taskLine}${filesLine}
|
|
4464
4470
|
|
|
@@ -4547,6 +4553,20 @@ When done, respond with a brief summary: "Saved N memories: [list of IDs]. Sessi
|
|
|
4547
4553
|
]
|
|
4548
4554
|
};
|
|
4549
4555
|
}
|
|
4556
|
+
function parsePromptFilesTouched(input) {
|
|
4557
|
+
const raw = input?.trim();
|
|
4558
|
+
if (!raw) return [];
|
|
4559
|
+
if (raw.startsWith("[")) {
|
|
4560
|
+
try {
|
|
4561
|
+
const parsed2 = JSON.parse(raw);
|
|
4562
|
+
if (Array.isArray(parsed2)) {
|
|
4563
|
+
return parsed2.filter((value) => typeof value === "string").map((value) => value.trim()).filter(Boolean);
|
|
4564
|
+
}
|
|
4565
|
+
} catch {
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
return raw.split(",").map((value) => value.trim()).filter(Boolean);
|
|
4569
|
+
}
|
|
4550
4570
|
|
|
4551
4571
|
// src/prompts/import-docs.ts
|
|
4552
4572
|
import { z as z36 } from "zod";
|
|
@@ -4620,7 +4640,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4620
4640
|
// src/server.ts
|
|
4621
4641
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hivelore/core";
|
|
4622
4642
|
var SERVER_NAME = "hivelore";
|
|
4623
|
-
var SERVER_VERSION = "0.
|
|
4643
|
+
var SERVER_VERSION = "0.44.0";
|
|
4624
4644
|
function jsonResult(data) {
|
|
4625
4645
|
return {
|
|
4626
4646
|
content: [
|
|
@@ -5559,11 +5579,22 @@ function printHaiveMcpVersion() {
|
|
|
5559
5579
|
}
|
|
5560
5580
|
async function runHaiveMcpStdio(options) {
|
|
5561
5581
|
const { server, context } = createHaiveServer({ root: options.root, env: process.env });
|
|
5582
|
+
await writeMcpRuntimeMarker(context).catch(() => {
|
|
5583
|
+
});
|
|
5562
5584
|
console.error(
|
|
5563
5585
|
`[haive-mcp] starting server v${SERVER_VERSION} (project root: ${context.paths.root})`
|
|
5564
5586
|
);
|
|
5565
5587
|
await server.connect(new StdioServerTransport());
|
|
5566
5588
|
}
|
|
5589
|
+
async function writeMcpRuntimeMarker(context) {
|
|
5590
|
+
await mkdir8(context.paths.runtimeDir, { recursive: true });
|
|
5591
|
+
await writeFile15(path15.join(context.paths.runtimeDir, "mcp-server.json"), JSON.stringify({
|
|
5592
|
+
version: SERVER_VERSION,
|
|
5593
|
+
pid: process.pid,
|
|
5594
|
+
started_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5595
|
+
command: "hivelore mcp --stdio"
|
|
5596
|
+
}, null, 2), "utf8");
|
|
5597
|
+
}
|
|
5567
5598
|
|
|
5568
5599
|
// src/index.ts
|
|
5569
5600
|
var parsed = parseMcpCliArgs(process.argv);
|