@hiveai/mcp 0.13.9 → 0.15.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/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.js +25 -3
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1585,10 +1585,13 @@ import {
|
|
|
1585
1585
|
literalMatchesAnyToken as literalMatchesAnyToken2,
|
|
1586
1586
|
loadCodeMap,
|
|
1587
1587
|
loadConfig as loadConfig3,
|
|
1588
|
+
hashProjectContext,
|
|
1588
1589
|
loadMemoriesFromDir as loadMemoriesFromDir15,
|
|
1589
1590
|
loadUsageIndex as loadUsageIndex8,
|
|
1590
1591
|
memoryMatchesAnchorPaths as memoryMatchesAnchorPaths2,
|
|
1592
|
+
projectContextRecentlyEmitted,
|
|
1591
1593
|
rankMemoriesLexical as rankMemoriesLexical2,
|
|
1594
|
+
recordProjectContextEmission,
|
|
1592
1595
|
queryCodeMap,
|
|
1593
1596
|
resolveBriefingBudget,
|
|
1594
1597
|
serializeMemory as serializeMemory10,
|
|
@@ -1756,6 +1759,9 @@ var GetBriefingInputSchema = {
|
|
|
1756
1759
|
),
|
|
1757
1760
|
max_memories: z19.number().int().positive().default(8).describe("Cap on memories surfaced regardless of token budget"),
|
|
1758
1761
|
include_project_context: z19.boolean().default(true),
|
|
1762
|
+
dedupe_project_context: z19.boolean().optional().describe(
|
|
1763
|
+
"Token saver (default ON): skip re-emitting the project-context body if an identical copy was already sent within the last few minutes this session (the agent still has it). Set false to always include it."
|
|
1764
|
+
),
|
|
1759
1765
|
include_module_contexts: z19.boolean().default(true),
|
|
1760
1766
|
semantic: z19.boolean().default(true).describe(
|
|
1761
1767
|
"Use semantic ranking when a task is provided (requires `haive embeddings index`)."
|
|
@@ -1963,7 +1969,17 @@ async function getBriefing(input, ctx) {
|
|
|
1963
1969
|
}
|
|
1964
1970
|
}
|
|
1965
1971
|
}
|
|
1966
|
-
|
|
1972
|
+
let projectContextRaw = input.include_project_context && existsSync21(ctx.paths.projectContext) ? await readFile5(ctx.paths.projectContext, "utf8") : "";
|
|
1973
|
+
let contextOmittedRecent = false;
|
|
1974
|
+
if (projectContextRaw && input.dedupe_project_context !== false) {
|
|
1975
|
+
const ctxHash = hashProjectContext(projectContextRaw);
|
|
1976
|
+
if (await projectContextRecentlyEmitted(ctx.paths, ctxHash)) {
|
|
1977
|
+
contextOmittedRecent = true;
|
|
1978
|
+
projectContextRaw = "";
|
|
1979
|
+
} else {
|
|
1980
|
+
await recordProjectContextEmission(ctx.paths, ctxHash);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1967
1983
|
const isTemplateContext = projectContextRaw.includes("TODO \u2014 high-level overview") || projectContextRaw.includes("Generated by `haive init`");
|
|
1968
1984
|
const setupWarnings = [];
|
|
1969
1985
|
let autoContextGenerated = false;
|
|
@@ -2231,7 +2247,11 @@ When done, call \`mem_session_end\` to acknowledge \u2014 this clears the pendin
|
|
|
2231
2247
|
search_mode: searchMode,
|
|
2232
2248
|
inferred_modules: inferred,
|
|
2233
2249
|
...lastSession ? { last_session: lastSession } : {},
|
|
2234
|
-
project_context:
|
|
2250
|
+
project_context: contextOmittedRecent ? {
|
|
2251
|
+
content: "(project context unchanged \u2014 omitted to save tokens; it was provided earlier this session. Pass dedupe_project_context:false to force a full copy.)",
|
|
2252
|
+
truncated: false,
|
|
2253
|
+
omitted_recent: true
|
|
2254
|
+
} : adaptiveTrim ? {
|
|
2235
2255
|
content: "(adaptive briefing: auto-generated context omitted \u2014 no team-specific policy matched, so a capable model needs nothing extra here)",
|
|
2236
2256
|
truncated: false,
|
|
2237
2257
|
...isTemplateContext && !autoContextGenerated ? { is_template: true } : {},
|
|
@@ -4130,7 +4150,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4130
4150
|
// src/server.ts
|
|
4131
4151
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hiveai/core";
|
|
4132
4152
|
var SERVER_NAME = "haive";
|
|
4133
|
-
var SERVER_VERSION = "0.
|
|
4153
|
+
var SERVER_VERSION = "0.15.0";
|
|
4134
4154
|
function jsonResult(data) {
|
|
4135
4155
|
return {
|
|
4136
4156
|
content: [
|
|
@@ -4879,6 +4899,7 @@ function createHaiveServer(options = {}) {
|
|
|
4879
4899
|
"anti_patterns_check",
|
|
4880
4900
|
[
|
|
4881
4901
|
"Scan a diff (or set of paths) against documented attempt/gotcha memories.",
|
|
4902
|
+
"[Diff-scan layer: the MEMORY-MATCH component. `pre_commit_check` combines this with sensors + stale checks; `haive enforce check` is the gate.]",
|
|
4882
4903
|
"Surfaces 'you are about to repeat a known mistake' warnings BEFORE you commit.",
|
|
4883
4904
|
"",
|
|
4884
4905
|
"USE BEFORE finalizing a non-trivial change. Cheap and high-signal: the only",
|
|
@@ -5022,6 +5043,7 @@ function createHaiveServer(options = {}) {
|
|
|
5022
5043
|
"pre_commit_check",
|
|
5023
5044
|
[
|
|
5024
5045
|
"One-shot 'should I block this commit?' check. Combines three signals:",
|
|
5046
|
+
"[Diff-scan layer: the COMBINED check (sensors + anti-patterns + stale). `haive enforce check` is the gate that runs this at commit time.]",
|
|
5025
5047
|
"",
|
|
5026
5048
|
" 1. anti_patterns_check \u2014 known gotchas/attempts that match the diff",
|
|
5027
5049
|
" 2. mem_for_files \u2014 conventions/decisions anchored to touched files",
|