@hivelore/mcp 0.47.0 → 0.51.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 +31 -8
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +31 -8
- package/dist/server.js.map +1 -1
- package/package.json +4 -5
package/dist/server.d.ts
CHANGED
|
@@ -695,6 +695,8 @@ declare const ScaffoldTestInputSchema: {
|
|
|
695
695
|
memory_id: z.ZodString;
|
|
696
696
|
framework: z.ZodOptional<z.ZodEnum<["vitest", "jest", "pytest", "gotest"]>>;
|
|
697
697
|
out_path: z.ZodOptional<z.ZodString>;
|
|
698
|
+
style: z.ZodOptional<z.ZodEnum<["example", "property", "differential"]>>;
|
|
699
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
698
700
|
red_ref: z.ZodOptional<z.ZodString>;
|
|
699
701
|
write: z.ZodDefault<z.ZodBoolean>;
|
|
700
702
|
};
|
package/dist/server.js
CHANGED
|
@@ -1865,6 +1865,10 @@ var ScaffoldTestInputSchema = {
|
|
|
1865
1865
|
memory_id: z17.string().min(1).describe("Id of the attempt/gotcha lesson to scaffold a post-incident test from."),
|
|
1866
1866
|
framework: z17.enum(["vitest", "jest", "pytest", "gotest"]).optional().describe("Test framework. Auto-detected from the package that owns the lesson's anchor paths when omitted."),
|
|
1867
1867
|
out_path: z17.string().optional().describe("Override the generated test file path (repo-relative)."),
|
|
1868
|
+
style: z17.enum(["example", "property", "differential"]).optional().describe(
|
|
1869
|
+
"Test shape (default 'example'): 'property' states the invariant once and checks it over many generated inputs (fast-check/Hypothesis); 'differential' asserts the subject agrees with a `reference` implementation for all inputs. Both lower the cost of expressing the invariant."
|
|
1870
|
+
),
|
|
1871
|
+
reference: z17.string().optional().describe("Required for style='differential': import specifier of the reference implementation to compare against."),
|
|
1868
1872
|
red_ref: z17.string().optional().describe(
|
|
1869
1873
|
"Pre-fix incident commit/ref. When set, the scaffold names the symbols the fix (<red_ref>..HEAD) touched within the lesson's anchor scope and pre-fills the example around them, so the assertion is a targeted edit rather than a blank page. A bad ref falls back to the generic template."
|
|
1870
1874
|
),
|
|
@@ -1876,6 +1880,10 @@ async function scaffoldTest(input, ctx) {
|
|
|
1876
1880
|
if (!found) {
|
|
1877
1881
|
return { ok: false, error: `No memory found with id ${input.memory_id}`, memory_id: input.memory_id };
|
|
1878
1882
|
}
|
|
1883
|
+
const style = input.style ?? "example";
|
|
1884
|
+
if (style === "differential" && !input.reference) {
|
|
1885
|
+
return { ok: false, error: "style='differential' requires `reference` (the reference implementation to compare against).", memory_id: input.memory_id };
|
|
1886
|
+
}
|
|
1879
1887
|
const anchorPaths = found.memory.frontmatter.anchor.paths ?? [];
|
|
1880
1888
|
const allGroups = await detectTestFrameworksForAnchors(ctx.paths.root, anchorPaths);
|
|
1881
1889
|
const groups = input.out_path ? allGroups.slice(0, 1) : allGroups;
|
|
@@ -1899,8 +1907,9 @@ async function scaffoldTest(input, ctx) {
|
|
|
1899
1907
|
paths: anchorPaths,
|
|
1900
1908
|
incidentHints
|
|
1901
1909
|
};
|
|
1910
|
+
const styleOpts = { style, reference: input.reference };
|
|
1902
1911
|
let scaffolds = groups.map(
|
|
1903
|
-
(g) => scaffoldPostIncidentTest(lesson, { framework: frameworkFor(g.framework), outPath: input.out_path, baseDir: g.baseDir })
|
|
1912
|
+
(g) => scaffoldPostIncidentTest(lesson, { framework: frameworkFor(g.framework), outPath: input.out_path, baseDir: g.baseDir, ...styleOpts })
|
|
1904
1913
|
);
|
|
1905
1914
|
let proposeCommand = scaffolds[0].proposeCommand;
|
|
1906
1915
|
if (scaffolds.length > 1) {
|
|
@@ -1909,7 +1918,8 @@ async function scaffoldTest(input, ctx) {
|
|
|
1909
1918
|
(g) => scaffoldPostIncidentTest(lesson, {
|
|
1910
1919
|
framework: frameworkFor(g.framework),
|
|
1911
1920
|
baseDir: g.baseDir,
|
|
1912
|
-
proposeCommandOverride: proposeCommand
|
|
1921
|
+
proposeCommandOverride: proposeCommand,
|
|
1922
|
+
...styleOpts
|
|
1913
1923
|
})
|
|
1914
1924
|
);
|
|
1915
1925
|
}
|
|
@@ -3221,7 +3231,7 @@ function oneLine(value) {
|
|
|
3221
3231
|
return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
|
|
3222
3232
|
}
|
|
3223
3233
|
function serverVersion() {
|
|
3224
|
-
return true ? "0.
|
|
3234
|
+
return true ? "0.51.0" : "dev";
|
|
3225
3235
|
}
|
|
3226
3236
|
|
|
3227
3237
|
// src/tools/code-map.ts
|
|
@@ -3533,7 +3543,7 @@ function isHaiveOwnedPath(p) {
|
|
|
3533
3543
|
if (p.startsWith(".ai/")) return true;
|
|
3534
3544
|
if (HAIVE_GENERATED_FILES.has(p)) return true;
|
|
3535
3545
|
if (p.startsWith(".cursor/rules/")) return true;
|
|
3536
|
-
if (/^\.github\/workflows\/haive-.*\.ya?ml$/.test(p)) return true;
|
|
3546
|
+
if (/^\.github\/workflows\/(hivelore|haive)-.*\.ya?ml$/.test(p)) return true;
|
|
3537
3547
|
return false;
|
|
3538
3548
|
}
|
|
3539
3549
|
var MAX_FUZZY_SCAN_LINES = 2e4;
|
|
@@ -4541,13 +4551,25 @@ Examples of things to look for:
|
|
|
4541
4551
|
### 5. Did you find that an existing memory is outdated or wrong?
|
|
4542
4552
|
\u2192 If yes, call **\`mem_update\`** with the correct information, or **\`mem_reject\`** if it's completely wrong
|
|
4543
4553
|
|
|
4554
|
+
## The bar \u2014 capture only what is UNGUESSABLE
|
|
4555
|
+
|
|
4556
|
+
A memory earns its place only if it carries *hard-won, repo-specific knowledge a capable teammate could
|
|
4557
|
+
NOT infer* from the code, the docs, or common practice. A "decision" that merely restates what the
|
|
4558
|
+
implementation already shows, a "convention" that is just standard style, a "gotcha" that is generic
|
|
4559
|
+
best practice \u2014 these are noise, and noise makes every future briefing worse. **For a routine change,
|
|
4560
|
+
capturing nothing is the correct, expected outcome.** Only reach for \`mem_save\` when you can name the
|
|
4561
|
+
arbitrary constraint (an invariant, a tradeoff with a real WHY, a footgun that cost you time) that the
|
|
4562
|
+
next agent would otherwise get wrong.
|
|
4563
|
+
|
|
4544
4564
|
## Rules
|
|
4545
4565
|
|
|
4546
4566
|
- One memory per insight. Don't cram multiple lessons into one body.
|
|
4547
4567
|
- Anchor memories to file paths when possible (the \`paths\` field) \u2014 this enables staleness detection.
|
|
4548
4568
|
- Prefer \`scope="team"\` for anything a teammate or future agent would benefit from.
|
|
4549
|
-
- Skip sections where you genuinely have nothing to add. Don't fabricate memories
|
|
4550
|
-
|
|
4569
|
+
- Skip sections where you genuinely have nothing to add. Don't fabricate memories \u2014 an empty post-task
|
|
4570
|
+
is better than a corpus of restated obvious facts.
|
|
4571
|
+
- Scan your exploration history for genuine code-level discoveries (failed approaches, real footguns),
|
|
4572
|
+
but hold each to the bar above before saving it.
|
|
4551
4573
|
|
|
4552
4574
|
### 6. Close the session \u2014 always
|
|
4553
4575
|
Call **\`mem_session_end\`** with:
|
|
@@ -4674,7 +4696,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4674
4696
|
// src/server.ts
|
|
4675
4697
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hivelore/core";
|
|
4676
4698
|
var SERVER_NAME = "hivelore";
|
|
4677
|
-
var SERVER_VERSION = "0.
|
|
4699
|
+
var SERVER_VERSION = "0.51.0";
|
|
4678
4700
|
function jsonResult(data) {
|
|
4679
4701
|
return {
|
|
4680
4702
|
content: [
|
|
@@ -4751,7 +4773,8 @@ var MUTATING_TOOLS = /* @__PURE__ */ new Set([
|
|
|
4751
4773
|
function createHaiveServer(options = {}) {
|
|
4752
4774
|
const context = createContext(options);
|
|
4753
4775
|
const config = loadConfigSync(context.paths);
|
|
4754
|
-
const toolProfile = options.env?.
|
|
4776
|
+
const toolProfile = options.env?.HIVELORE_TOOL_PROFILE ?? options.env?.HAIVE_TOOL_PROFILE ?? // legacy env name
|
|
4777
|
+
config.enforcement?.toolProfile ?? "enforcement";
|
|
4755
4778
|
const requireBriefingFirst = options.env?.HAIVE_REQUIRE_BRIEFING_FIRST === "0" ? false : config.enforcement?.requireBriefingFirst ?? true;
|
|
4756
4779
|
let briefingLoaded = false;
|
|
4757
4780
|
const tracker = new SessionTracker(context);
|