@hiveai/mcp 0.4.0 → 0.4.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/dist/index.js +42 -1
- package/dist/index.js.map +1 -1
- package/dist/server.js +42 -1
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -1464,6 +1464,38 @@ ${m.content}`).join("\n\n---\n\n"),
|
|
|
1464
1464
|
if (symbolLocations.length === 0) symbolLocations = void 0;
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
+
const actionRequired = [];
|
|
1468
|
+
for (const m of outputMemories) {
|
|
1469
|
+
const loaded = byId.get(m.id);
|
|
1470
|
+
if (!loaded?.memory.frontmatter.requires_human_approval) continue;
|
|
1471
|
+
const bodyLines = loaded.memory.body.split("\n");
|
|
1472
|
+
const quoteBlock = bodyLines.filter((l) => l.startsWith("> ")).map((l) => l.slice(2)).join(" ").replace(/^\*«\s*/, "").replace(/\s*»\*$/, "").trim();
|
|
1473
|
+
const headingLine = bodyLines.find((l) => l.startsWith("## "));
|
|
1474
|
+
const summary = headingLine?.replace(/^##\s*/, "").trim() ?? m.id;
|
|
1475
|
+
actionRequired.push({
|
|
1476
|
+
id: m.id,
|
|
1477
|
+
summary,
|
|
1478
|
+
developer_message: quoteBlock || `Une modification externe potentiellement incompatible a \xE9t\xE9 d\xE9tect\xE9e (${m.id}). Veux-tu que j'analyse l'impact et que je propose des mises \xE0 jour ?`
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
if (existsSync17(ctx.paths.memoriesDir)) {
|
|
1482
|
+
const allMems = await loadMemoriesFromDir13(ctx.paths.memoriesDir);
|
|
1483
|
+
for (const { memory } of allMems) {
|
|
1484
|
+
const fm = memory.frontmatter;
|
|
1485
|
+
if (!fm.requires_human_approval) continue;
|
|
1486
|
+
if (fm.status === "rejected" || fm.status === "deprecated") continue;
|
|
1487
|
+
if (actionRequired.some((a) => a.id === fm.id)) continue;
|
|
1488
|
+
const bodyLines = memory.body.split("\n");
|
|
1489
|
+
const quoteBlock = bodyLines.filter((l) => l.startsWith("> ")).map((l) => l.slice(2)).join(" ").replace(/^\*«\s*/, "").replace(/\s*»\*$/, "").trim();
|
|
1490
|
+
const headingLine = bodyLines.find((l) => l.startsWith("## "));
|
|
1491
|
+
const summary = headingLine?.replace(/^##\s*/, "").trim() ?? fm.id;
|
|
1492
|
+
actionRequired.push({
|
|
1493
|
+
id: fm.id,
|
|
1494
|
+
summary,
|
|
1495
|
+
developer_message: quoteBlock || `Une modification externe potentiellement incompatible a \xE9t\xE9 d\xE9tect\xE9e (${fm.id}). Veux-tu que j'analyse l'impact et que je propose des mises \xE0 jour ?`
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1467
1499
|
return {
|
|
1468
1500
|
...input.task ? { task: input.task } : {},
|
|
1469
1501
|
search_mode: searchMode,
|
|
@@ -1478,6 +1510,7 @@ ${m.content}`).join("\n\n---\n\n"),
|
|
|
1478
1510
|
module_contexts: trimmedModules,
|
|
1479
1511
|
memories: outputMemories,
|
|
1480
1512
|
...symbolLocations ? { symbol_locations: symbolLocations } : {},
|
|
1513
|
+
action_required: actionRequired,
|
|
1481
1514
|
decay_warnings: decayWarnings,
|
|
1482
1515
|
setup_warnings: setupWarnings,
|
|
1483
1516
|
estimated_tokens: totalTokens,
|
|
@@ -1914,7 +1947,7 @@ function summarizeTools(events) {
|
|
|
1914
1947
|
|
|
1915
1948
|
// src/server.ts
|
|
1916
1949
|
var SERVER_NAME = "haive";
|
|
1917
|
-
var SERVER_VERSION = "0.
|
|
1950
|
+
var SERVER_VERSION = "0.4.2";
|
|
1918
1951
|
function jsonResult(data) {
|
|
1919
1952
|
return {
|
|
1920
1953
|
content: [
|
|
@@ -2060,6 +2093,7 @@ function createHaiveServer(options = {}) {
|
|
|
2060
2093
|
"everything relevant in a single call under a token budget.",
|
|
2061
2094
|
"",
|
|
2062
2095
|
"RETURNS (in order of priority):",
|
|
2096
|
+
" 0. action_required \u2014 \u26A0\uFE0F HANDLE THIS FIRST if non-empty (see protocol below)",
|
|
2063
2097
|
" 1. last_session \u2014 recap of the previous session (goal, what was done, next steps)",
|
|
2064
2098
|
" 2. project_context \u2014 .ai/project-context.md (auto-generated from code-map if template)",
|
|
2065
2099
|
" 3. module_contexts \u2014 relevant .ai/modules/<name>/context.md based on files being edited",
|
|
@@ -2068,6 +2102,13 @@ function createHaiveServer(options = {}) {
|
|
|
2068
2102
|
" 6. setup_warnings \u2014 actionable warnings if setup is incomplete",
|
|
2069
2103
|
" 7. decay_warnings \u2014 memories not read in >90 days (consider reviewing)",
|
|
2070
2104
|
"",
|
|
2105
|
+
"\u26A0\uFE0F ACTION_REQUIRED PROTOCOL \u2014 MANDATORY:",
|
|
2106
|
+
" If action_required[] is non-empty, STOP and for each item:",
|
|
2107
|
+
" 1. Show the developer the exact developer_message field verbatim",
|
|
2108
|
+
" 2. Wait for explicit human confirmation ('yes', 'go ahead', 'oui', etc.)",
|
|
2109
|
+
" 3. Only then proceed with any code changes",
|
|
2110
|
+
" NEVER act autonomously on cross-repo breaking changes, dep bumps, or contract diffs.",
|
|
2111
|
+
"",
|
|
2071
2112
|
"KEY PARAMETERS:",
|
|
2072
2113
|
" task \u2014 what you are about to do (1\u20132 sentences) \u2014 ALWAYS provide this",
|
|
2073
2114
|
" files \u2014 files you are about to edit \u2014 surfaces anchored memories",
|