@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/server.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ interface BriefingOutput {
|
|
|
91
91
|
truncated: boolean;
|
|
92
92
|
is_template?: boolean;
|
|
93
93
|
auto_generated?: boolean;
|
|
94
|
+
omitted_recent?: boolean;
|
|
94
95
|
} | null;
|
|
95
96
|
module_contexts: Array<{
|
|
96
97
|
name: string;
|
|
@@ -143,6 +144,7 @@ declare const GetBriefingZod: z.ZodObject<{
|
|
|
143
144
|
max_tokens: z.ZodDefault<z.ZodNumber>;
|
|
144
145
|
max_memories: z.ZodDefault<z.ZodNumber>;
|
|
145
146
|
include_project_context: z.ZodDefault<z.ZodBoolean>;
|
|
147
|
+
dedupe_project_context: z.ZodOptional<z.ZodBoolean>;
|
|
146
148
|
include_module_contexts: z.ZodDefault<z.ZodBoolean>;
|
|
147
149
|
semantic: z.ZodDefault<z.ZodBoolean>;
|
|
148
150
|
include_stale: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -164,6 +166,7 @@ declare const GetBriefingZod: z.ZodObject<{
|
|
|
164
166
|
track: boolean;
|
|
165
167
|
min_semantic_score: number;
|
|
166
168
|
task?: string | undefined;
|
|
169
|
+
dedupe_project_context?: boolean | undefined;
|
|
167
170
|
budget_preset?: "quick" | "balanced" | "deep" | undefined;
|
|
168
171
|
}, {
|
|
169
172
|
symbols?: string[] | undefined;
|
|
@@ -173,6 +176,7 @@ declare const GetBriefingZod: z.ZodObject<{
|
|
|
173
176
|
max_tokens?: number | undefined;
|
|
174
177
|
max_memories?: number | undefined;
|
|
175
178
|
include_project_context?: boolean | undefined;
|
|
179
|
+
dedupe_project_context?: boolean | undefined;
|
|
176
180
|
include_module_contexts?: boolean | undefined;
|
|
177
181
|
semantic?: boolean | undefined;
|
|
178
182
|
include_stale?: boolean | undefined;
|
package/dist/server.js
CHANGED
|
@@ -1583,10 +1583,13 @@ import {
|
|
|
1583
1583
|
literalMatchesAnyToken as literalMatchesAnyToken2,
|
|
1584
1584
|
loadCodeMap,
|
|
1585
1585
|
loadConfig as loadConfig3,
|
|
1586
|
+
hashProjectContext,
|
|
1586
1587
|
loadMemoriesFromDir as loadMemoriesFromDir15,
|
|
1587
1588
|
loadUsageIndex as loadUsageIndex8,
|
|
1588
1589
|
memoryMatchesAnchorPaths as memoryMatchesAnchorPaths2,
|
|
1590
|
+
projectContextRecentlyEmitted,
|
|
1589
1591
|
rankMemoriesLexical as rankMemoriesLexical2,
|
|
1592
|
+
recordProjectContextEmission,
|
|
1590
1593
|
queryCodeMap,
|
|
1591
1594
|
resolveBriefingBudget,
|
|
1592
1595
|
serializeMemory as serializeMemory10,
|
|
@@ -1754,6 +1757,9 @@ var GetBriefingInputSchema = {
|
|
|
1754
1757
|
),
|
|
1755
1758
|
max_memories: z19.number().int().positive().default(8).describe("Cap on memories surfaced regardless of token budget"),
|
|
1756
1759
|
include_project_context: z19.boolean().default(true),
|
|
1760
|
+
dedupe_project_context: z19.boolean().optional().describe(
|
|
1761
|
+
"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."
|
|
1762
|
+
),
|
|
1757
1763
|
include_module_contexts: z19.boolean().default(true),
|
|
1758
1764
|
semantic: z19.boolean().default(true).describe(
|
|
1759
1765
|
"Use semantic ranking when a task is provided (requires `haive embeddings index`)."
|
|
@@ -1961,7 +1967,17 @@ async function getBriefing(input, ctx) {
|
|
|
1961
1967
|
}
|
|
1962
1968
|
}
|
|
1963
1969
|
}
|
|
1964
|
-
|
|
1970
|
+
let projectContextRaw = input.include_project_context && existsSync21(ctx.paths.projectContext) ? await readFile5(ctx.paths.projectContext, "utf8") : "";
|
|
1971
|
+
let contextOmittedRecent = false;
|
|
1972
|
+
if (projectContextRaw && input.dedupe_project_context !== false) {
|
|
1973
|
+
const ctxHash = hashProjectContext(projectContextRaw);
|
|
1974
|
+
if (await projectContextRecentlyEmitted(ctx.paths, ctxHash)) {
|
|
1975
|
+
contextOmittedRecent = true;
|
|
1976
|
+
projectContextRaw = "";
|
|
1977
|
+
} else {
|
|
1978
|
+
await recordProjectContextEmission(ctx.paths, ctxHash);
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1965
1981
|
const isTemplateContext = projectContextRaw.includes("TODO \u2014 high-level overview") || projectContextRaw.includes("Generated by `haive init`");
|
|
1966
1982
|
const setupWarnings = [];
|
|
1967
1983
|
let autoContextGenerated = false;
|
|
@@ -2229,7 +2245,11 @@ When done, call \`mem_session_end\` to acknowledge \u2014 this clears the pendin
|
|
|
2229
2245
|
search_mode: searchMode,
|
|
2230
2246
|
inferred_modules: inferred,
|
|
2231
2247
|
...lastSession ? { last_session: lastSession } : {},
|
|
2232
|
-
project_context:
|
|
2248
|
+
project_context: contextOmittedRecent ? {
|
|
2249
|
+
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.)",
|
|
2250
|
+
truncated: false,
|
|
2251
|
+
omitted_recent: true
|
|
2252
|
+
} : adaptiveTrim ? {
|
|
2233
2253
|
content: "(adaptive briefing: auto-generated context omitted \u2014 no team-specific policy matched, so a capable model needs nothing extra here)",
|
|
2234
2254
|
truncated: false,
|
|
2235
2255
|
...isTemplateContext && !autoContextGenerated ? { is_template: true } : {},
|
|
@@ -4128,7 +4148,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4128
4148
|
// src/server.ts
|
|
4129
4149
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hiveai/core";
|
|
4130
4150
|
var SERVER_NAME = "haive";
|
|
4131
|
-
var SERVER_VERSION = "0.
|
|
4151
|
+
var SERVER_VERSION = "0.15.0";
|
|
4132
4152
|
function jsonResult(data) {
|
|
4133
4153
|
return {
|
|
4134
4154
|
content: [
|
|
@@ -4877,6 +4897,7 @@ function createHaiveServer(options = {}) {
|
|
|
4877
4897
|
"anti_patterns_check",
|
|
4878
4898
|
[
|
|
4879
4899
|
"Scan a diff (or set of paths) against documented attempt/gotcha memories.",
|
|
4900
|
+
"[Diff-scan layer: the MEMORY-MATCH component. `pre_commit_check` combines this with sensors + stale checks; `haive enforce check` is the gate.]",
|
|
4880
4901
|
"Surfaces 'you are about to repeat a known mistake' warnings BEFORE you commit.",
|
|
4881
4902
|
"",
|
|
4882
4903
|
"USE BEFORE finalizing a non-trivial change. Cheap and high-signal: the only",
|
|
@@ -5020,6 +5041,7 @@ function createHaiveServer(options = {}) {
|
|
|
5020
5041
|
"pre_commit_check",
|
|
5021
5042
|
[
|
|
5022
5043
|
"One-shot 'should I block this commit?' check. Combines three signals:",
|
|
5044
|
+
"[Diff-scan layer: the COMBINED check (sensors + anti-patterns + stale). `haive enforce check` is the gate that runs this at commit time.]",
|
|
5023
5045
|
"",
|
|
5024
5046
|
" 1. anti_patterns_check \u2014 known gotchas/attempts that match the diff",
|
|
5025
5047
|
" 2. mem_for_files \u2014 conventions/decisions anchored to touched files",
|