@hiveai/mcp 0.10.0 → 0.10.1
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 +10 -3
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +9 -11
- package/dist/server.js +10 -3
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/server.d.ts
CHANGED
|
@@ -349,15 +349,13 @@ interface WhyThisFileOutput {
|
|
|
349
349
|
*/
|
|
350
350
|
declare function whyThisFile(input: WhyThisFileInput, ctx: HaiveContext): Promise<WhyThisFileOutput>;
|
|
351
351
|
|
|
352
|
-
|
|
353
|
-
diff
|
|
354
|
-
paths:
|
|
355
|
-
limit:
|
|
356
|
-
semantic:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
[K in keyof typeof AntiPatternsCheckInputSchema]: z.infer<(typeof AntiPatternsCheckInputSchema)[K]>;
|
|
360
|
-
};
|
|
352
|
+
interface AntiPatternsCheckInput {
|
|
353
|
+
diff?: string;
|
|
354
|
+
paths: string[];
|
|
355
|
+
limit: number;
|
|
356
|
+
semantic: boolean;
|
|
357
|
+
min_semantic_score?: number;
|
|
358
|
+
}
|
|
361
359
|
interface AntiPatternsWarning {
|
|
362
360
|
id: string;
|
|
363
361
|
type: "attempt" | "gotcha";
|
|
@@ -701,8 +699,8 @@ declare const SERVER_NAME = "haive";
|
|
|
701
699
|
declare const SERVER_VERSION: string;
|
|
702
700
|
type ToolProfile = "enforcement" | "maintenance" | "experimental" | "full";
|
|
703
701
|
declare const ENFORCEMENT_PROFILE_TOOLS: readonly ["get_briefing", "mem_save", "mem_tried", "mem_search", "mem_get", "mem_verify", "mem_relevant_to", "code_map", "code_search", "pre_commit_check", "mem_session_end"];
|
|
704
|
-
declare const MAINTENANCE_PROFILE_TOOLS: readonly ["get_briefing", "mem_save", "mem_tried", "mem_search", "mem_get", "mem_verify", "mem_relevant_to", "code_map", "code_search", "pre_commit_check", "mem_session_end", "mem_suggest_topic", "mem_for_files", "mem_list", "get_project_context", "bootstrap_project_save", "mem_resolve_project", "mem_update", "mem_approve", "mem_reject", "mem_pending", "mem_delete", "mem_diff", "get_recap", "
|
|
705
|
-
declare const EXPERIMENTAL_PROFILE_TOOLS: readonly ["get_briefing", "mem_save", "mem_tried", "mem_search", "mem_get", "mem_verify", "mem_relevant_to", "code_map", "code_search", "pre_commit_check", "mem_session_end", "mem_suggest_topic", "mem_for_files", "mem_list", "get_project_context", "bootstrap_project_save", "mem_resolve_project", "mem_update", "mem_approve", "mem_reject", "mem_pending", "mem_delete", "mem_diff", "get_recap", "
|
|
702
|
+
declare const MAINTENANCE_PROFILE_TOOLS: readonly ["get_briefing", "mem_save", "mem_tried", "mem_search", "mem_get", "mem_verify", "mem_relevant_to", "code_map", "code_search", "pre_commit_check", "mem_session_end", "mem_suggest_topic", "mem_for_files", "mem_list", "get_project_context", "bootstrap_project_save", "mem_resolve_project", "mem_update", "mem_approve", "mem_reject", "mem_pending", "mem_delete", "mem_diff", "get_recap", "anti_patterns_check", "mem_distill", "mem_timeline", "mem_conflict_candidates"];
|
|
703
|
+
declare const EXPERIMENTAL_PROFILE_TOOLS: readonly ["get_briefing", "mem_save", "mem_tried", "mem_search", "mem_get", "mem_verify", "mem_relevant_to", "code_map", "code_search", "pre_commit_check", "mem_session_end", "mem_suggest_topic", "mem_for_files", "mem_list", "get_project_context", "bootstrap_project_save", "mem_resolve_project", "mem_update", "mem_approve", "mem_reject", "mem_pending", "mem_delete", "mem_diff", "get_recap", "anti_patterns_check", "mem_distill", "mem_timeline", "mem_conflict_candidates", "mem_observe", "why_this_file", "why_this_decision", "mem_conflicts_with", "pattern_detect", "runtime_journal_append", "runtime_journal_tail"];
|
|
706
704
|
declare const TOOL_PROFILES: Record<Exclude<ToolProfile, "full">, ReadonlySet<string>>;
|
|
707
705
|
declare function getAllowedToolsForProfile(profile: ToolProfile): ReadonlySet<string>;
|
|
708
706
|
declare function createHaiveServer(options?: CreateContextOptions): {
|
package/dist/server.js
CHANGED
|
@@ -1412,6 +1412,7 @@ import {
|
|
|
1412
1412
|
getUsage as getUsage5,
|
|
1413
1413
|
inferModulesFromPaths as inferModulesFromPaths2,
|
|
1414
1414
|
isGlobPath,
|
|
1415
|
+
isRetiredMemory,
|
|
1415
1416
|
isAutoPromoteEligible,
|
|
1416
1417
|
isDecaying,
|
|
1417
1418
|
isStackPackSeed,
|
|
@@ -1498,6 +1499,7 @@ async function getBriefing(input, ctx) {
|
|
|
1498
1499
|
const s = memory.frontmatter.status;
|
|
1499
1500
|
if (s === "rejected" || s === "deprecated") return false;
|
|
1500
1501
|
if (!input.include_stale && s === "stale") return false;
|
|
1502
|
+
if (!input.include_stale && isRetiredMemory(memory.frontmatter, memory.body)) return false;
|
|
1501
1503
|
if (memory.frontmatter.type === "session_recap") return false;
|
|
1502
1504
|
return true;
|
|
1503
1505
|
});
|
|
@@ -2441,6 +2443,7 @@ import { existsSync as existsSync22 } from "fs";
|
|
|
2441
2443
|
import {
|
|
2442
2444
|
deriveConfidence as deriveConfidence6,
|
|
2443
2445
|
getUsage as getUsage7,
|
|
2446
|
+
isRetiredMemory as isRetiredMemory2,
|
|
2444
2447
|
loadMemoriesFromDir as loadMemoriesFromDir17,
|
|
2445
2448
|
loadUsageIndex as loadUsageIndex9,
|
|
2446
2449
|
literalMatchesAnyToken as literalMatchesAnyToken3,
|
|
@@ -2458,6 +2461,9 @@ var AntiPatternsCheckInputSchema = {
|
|
|
2458
2461
|
limit: z24.number().int().positive().max(20).default(8).describe("Cap on returned warnings."),
|
|
2459
2462
|
semantic: z24.boolean().default(true).describe(
|
|
2460
2463
|
"When true, also use semantic search (requires @hiveai/embeddings + memory index) to find related anti-patterns."
|
|
2464
|
+
),
|
|
2465
|
+
min_semantic_score: z24.number().min(0).max(1).default(0.45).describe(
|
|
2466
|
+
"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."
|
|
2461
2467
|
)
|
|
2462
2468
|
};
|
|
2463
2469
|
var CODE_STOPWORDS = /* @__PURE__ */ new Set([
|
|
@@ -2528,11 +2534,12 @@ async function antiPatternsCheck(input, ctx) {
|
|
|
2528
2534
|
return { scanned: 0, warnings: [], notice: "No .ai/memories directory \u2014 nothing to check against." };
|
|
2529
2535
|
}
|
|
2530
2536
|
const all = await loadMemoriesFromDir17(ctx.paths.memoriesDir);
|
|
2537
|
+
const minSemanticScore = input.min_semantic_score ?? 0.45;
|
|
2531
2538
|
const negative = all.filter(({ memory }) => {
|
|
2532
2539
|
const t = memory.frontmatter.type;
|
|
2533
2540
|
if (t !== "attempt" && t !== "gotcha") return false;
|
|
2534
2541
|
const s = memory.frontmatter.status;
|
|
2535
|
-
return s !== "rejected" && s !== "deprecated" && s !== "stale";
|
|
2542
|
+
return s !== "rejected" && s !== "deprecated" && s !== "stale" && !isRetiredMemory2(memory.frontmatter, memory.body);
|
|
2536
2543
|
});
|
|
2537
2544
|
if (negative.length === 0) {
|
|
2538
2545
|
return { scanned: 0, warnings: [], notice: "No attempt/gotcha memories found yet." };
|
|
@@ -2586,6 +2593,7 @@ async function antiPatternsCheck(input, ctx) {
|
|
|
2586
2593
|
const negativeIds = new Set(negative.map(({ memory }) => memory.frontmatter.id));
|
|
2587
2594
|
for (const hit of result.hits) {
|
|
2588
2595
|
if (!negativeIds.has(hit.id)) continue;
|
|
2596
|
+
if (hit.score < minSemanticScore && !seen.has(hit.id)) continue;
|
|
2589
2597
|
const found = negative.find(({ memory }) => memory.frontmatter.id === hit.id);
|
|
2590
2598
|
if (found) upsert(found.memory.frontmatter, found.memory.body, "semantic", hit.score);
|
|
2591
2599
|
}
|
|
@@ -3864,7 +3872,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
3864
3872
|
// src/server.ts
|
|
3865
3873
|
import { loadConfigSync } from "@hiveai/core";
|
|
3866
3874
|
var SERVER_NAME = "haive";
|
|
3867
|
-
var SERVER_VERSION = "0.10.
|
|
3875
|
+
var SERVER_VERSION = "0.10.1";
|
|
3868
3876
|
function jsonResult(data) {
|
|
3869
3877
|
return {
|
|
3870
3878
|
content: [
|
|
@@ -3903,7 +3911,6 @@ var MAINTENANCE_PROFILE_TOOLS = [
|
|
|
3903
3911
|
"mem_delete",
|
|
3904
3912
|
"mem_diff",
|
|
3905
3913
|
"get_recap",
|
|
3906
|
-
"code_search",
|
|
3907
3914
|
"anti_patterns_check",
|
|
3908
3915
|
"mem_distill",
|
|
3909
3916
|
"mem_timeline",
|