@hivelore/mcp 0.37.0 → 0.39.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/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import * as _hivelore_core from '@hivelore/core';
3
- import { HaivePaths, ConfidenceLevel, ImpactTier, SensorTarget, resolveProjectInfo } from '@hivelore/core';
3
+ import { HaivePaths, ConfidenceLevel, ImpactTier, SensorTarget, TestFramework, resolveProjectInfo } from '@hivelore/core';
4
4
  import { z } from 'zod';
5
5
 
6
6
  interface HaiveContext {
@@ -552,7 +552,7 @@ declare const MemTriedInputSchema: {
552
552
  what: z.ZodString;
553
553
  why_failed: z.ZodString;
554
554
  instead: z.ZodOptional<z.ZodString>;
555
- scope: z.ZodDefault<z.ZodEnum<["personal", "team", "module"]>>;
555
+ scope: z.ZodOptional<z.ZodEnum<["personal", "team", "module"]>>;
556
556
  module: z.ZodOptional<z.ZodString>;
557
557
  tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
558
558
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -619,6 +619,62 @@ interface MemTriedOutput {
619
619
  }
620
620
  declare function memTried(input: MemTriedInput, ctx: HaiveContext): Promise<MemTriedOutput>;
621
621
 
622
+ declare function detectTestFrameworkForPaths(root: string, anchorPaths: string[]): Promise<{
623
+ framework: TestFramework;
624
+ baseDir: string;
625
+ }>;
626
+ interface AnchorFrameworkGroup {
627
+ framework: TestFramework;
628
+ baseDir: string;
629
+ /** The anchor paths owned by this package (subset of the lesson's anchors). */
630
+ anchors: string[];
631
+ }
632
+ /**
633
+ * Group a lesson's anchor paths by OWNING package: one entry per distinct enclosing manifest dir,
634
+ * in first-anchor order. A lesson that spans several packages gets one scaffold per package instead
635
+ * of "first anchor wins". Anchors with no enclosing manifest fall back to the repo root + vitest.
636
+ */
637
+ declare function detectTestFrameworksForAnchors(root: string, anchorPaths: string[]): Promise<AnchorFrameworkGroup[]>;
638
+ declare const ScaffoldTestInputSchema: {
639
+ memory_id: z.ZodString;
640
+ framework: z.ZodOptional<z.ZodEnum<["vitest", "jest", "pytest", "gotest"]>>;
641
+ out_path: z.ZodOptional<z.ZodString>;
642
+ write: z.ZodDefault<z.ZodBoolean>;
643
+ };
644
+ type ScaffoldTestInput = {
645
+ [K in keyof typeof ScaffoldTestInputSchema]: z.infer<(typeof ScaffoldTestInputSchema)[K]>;
646
+ };
647
+ interface ScaffoldTestOutput {
648
+ ok: boolean;
649
+ error?: string;
650
+ memory_id: string;
651
+ framework?: TestFramework;
652
+ /** Repo-relative path of the generated (or would-be) test file. */
653
+ path?: string;
654
+ /** Command that runs ONLY this test — becomes the sensor's oracle once the assertion is written. */
655
+ run_command?: string;
656
+ /** The exact `sensors propose --kind test` command to arm it AFTER the assertion is written. */
657
+ propose_command?: string;
658
+ content?: string;
659
+ written?: boolean;
660
+ already_exists?: boolean;
661
+ notice?: string;
662
+ /**
663
+ * One entry per generated test. A lesson whose anchors span several packages scaffolds one test
664
+ * per OWNING package; they share a single propose_command (a memory carries one sensor) whose
665
+ * command chains every run command.
666
+ */
667
+ scaffolds?: Array<{
668
+ framework: TestFramework;
669
+ path: string;
670
+ run_command: string;
671
+ content: string;
672
+ written: boolean;
673
+ already_exists: boolean;
674
+ }>;
675
+ }
676
+ declare function scaffoldTest(input: ScaffoldTestInput, ctx: HaiveContext): Promise<ScaffoldTestOutput>;
677
+
622
678
  /** Input is intentionally minimal — callers may pass cwd for multi-root clients. */
623
679
  declare const MemResolveProjectInputSchema: {
624
680
  cwd: z.ZodOptional<z.ZodString>;
@@ -699,9 +755,9 @@ declare function memConflictCandidates(input: MemConflictCandidatesInput, ctx: H
699
755
  declare const SERVER_NAME = "hivelore";
700
756
  declare const SERVER_VERSION: string;
701
757
  type ToolProfile = "enforcement" | "maintenance" | "experimental" | "full";
702
- 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", "propose_sensor"];
703
- 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", "propose_sensor", "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_feedback", "ingest_findings"];
704
- 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", "propose_sensor", "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_feedback", "ingest_findings"];
758
+ 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", "propose_sensor", "scaffold_test"];
759
+ 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", "propose_sensor", "scaffold_test", "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_feedback", "ingest_findings"];
760
+ 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", "propose_sensor", "scaffold_test", "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_feedback", "ingest_findings"];
705
761
  declare const TOOL_PROFILES: Record<Exclude<ToolProfile, "full">, ReadonlySet<string>>;
706
762
  declare function getAllowedToolsForProfile(profile: ToolProfile): ReadonlySet<string>;
707
763
  declare function createHaiveServer(options?: CreateContextOptions): {
@@ -724,4 +780,4 @@ declare function runHaiveMcpStdio(options: {
724
780
  root?: string;
725
781
  }): Promise<void>;
726
782
 
727
- export { type AntiPatternsCheckInput, type AntiPatternsCheckOutput, type BriefingOutput, type CodeMapInput, type CodeMapToolOutput, type CodeSearchInput, type CodeSearchOutput, ENFORCEMENT_PROFILE_TOOLS, EXPERIMENTAL_PROFILE_TOOLS, type GetBriefingInput, type GetRecapInput, type GetRecapOutput, MAINTENANCE_PROFILE_TOOLS, type MemConflictCandidatesInput, type MemDistillInput, type MemDistillOutput, type MemRelevantToInput, type MemRelevantToOutput, type MemResolveProjectInput, type MemSuggestTopicInput, type MemTimelineInput, type MemTriedOutput, type PreCommitCheckInput, type PreCommitCheckOutput, type ProposeSensorOutput, SERVER_NAME, SERVER_VERSION, TOOL_PROFILES, type ToolProfile, antiPatternsCheck, codeMapTool, codeSearch, createHaiveServer, getAllowedToolsForProfile, getBriefing, getRecap, memConflictCandidates, memDistill, memRelevantTo, memResolveProject, memSuggestTopic, memTimeline, memTried, parseMcpCliArgs, preCommitCheck, printHaiveMcpVersion, proposeSensor, readPresumedCorrectTargets, runHaiveMcpStdio };
783
+ export { type AnchorFrameworkGroup, type AntiPatternsCheckInput, type AntiPatternsCheckOutput, type BriefingOutput, type CodeMapInput, type CodeMapToolOutput, type CodeSearchInput, type CodeSearchOutput, ENFORCEMENT_PROFILE_TOOLS, EXPERIMENTAL_PROFILE_TOOLS, type GetBriefingInput, type GetRecapInput, type GetRecapOutput, MAINTENANCE_PROFILE_TOOLS, type MemConflictCandidatesInput, type MemDistillInput, type MemDistillOutput, type MemRelevantToInput, type MemRelevantToOutput, type MemResolveProjectInput, type MemSuggestTopicInput, type MemTimelineInput, type MemTriedOutput, type PreCommitCheckInput, type PreCommitCheckOutput, type ProposeSensorOutput, SERVER_NAME, SERVER_VERSION, type ScaffoldTestOutput, TOOL_PROFILES, type ToolProfile, antiPatternsCheck, codeMapTool, codeSearch, createHaiveServer, detectTestFrameworkForPaths, detectTestFrameworksForAnchors, getAllowedToolsForProfile, getBriefing, getRecap, memConflictCandidates, memDistill, memRelevantTo, memResolveProject, memSuggestTopic, memTimeline, memTried, parseMcpCliArgs, preCommitCheck, printHaiveMcpVersion, proposeSensor, readPresumedCorrectTargets, runHaiveMcpStdio, scaffoldTest };