@hivelore/mcp 0.31.0 → 0.33.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, readRuntimeJournalTail } from '@hivelore/core';
3
+ import { HaivePaths, ConfidenceLevel, ImpactTier, SensorTarget, resolveProjectInfo } from '@hivelore/core';
4
4
  import { z } from 'zod';
5
5
 
6
6
  interface HaiveContext {
@@ -353,49 +353,6 @@ interface CodeSearchOutput {
353
353
  }
354
354
  declare function codeSearch(input: CodeSearchInput, ctx: HaiveContext): Promise<CodeSearchOutput>;
355
355
 
356
- declare const WhyThisFileInputSchema: {
357
- path: z.ZodString;
358
- git_log_limit: z.ZodDefault<z.ZodNumber>;
359
- memory_limit: z.ZodDefault<z.ZodNumber>;
360
- };
361
- type WhyThisFileInput = {
362
- [K in keyof typeof WhyThisFileInputSchema]: z.infer<(typeof WhyThisFileInputSchema)[K]>;
363
- };
364
- interface WhyThisFileOutput {
365
- file: string;
366
- exists: boolean;
367
- recent_commits: Array<{
368
- sha: string;
369
- author: string;
370
- relative_date: string;
371
- subject: string;
372
- }>;
373
- memories: Array<{
374
- id: string;
375
- type: string;
376
- scope: string;
377
- confidence: string;
378
- body_preview: string;
379
- }>;
380
- code_map_entry: {
381
- summary?: string;
382
- loc: number;
383
- exports: Array<{
384
- name: string;
385
- kind: string;
386
- line: number;
387
- description?: string;
388
- }>;
389
- } | null;
390
- hints?: string[];
391
- }
392
- /**
393
- * One-shot file-context lookup: combines recent git history, memories anchored
394
- * to the path, and the code-map entry. Designed to answer "why is this file
395
- * the way it is?" in a single call instead of 3-4 manual ones.
396
- */
397
- declare function whyThisFile(input: WhyThisFileInput, ctx: HaiveContext): Promise<WhyThisFileOutput>;
398
-
399
356
  interface AntiPatternsCheckInput {
400
357
  diff?: string;
401
358
  paths: string[];
@@ -485,106 +442,6 @@ interface MemDistillOutput {
485
442
  */
486
443
  declare function memDistill(input: MemDistillInput, ctx: HaiveContext): Promise<MemDistillOutput>;
487
444
 
488
- declare const WhyThisDecisionInputSchema: {
489
- id: z.ZodString;
490
- git_log_limit: z.ZodDefault<z.ZodNumber>;
491
- };
492
- type WhyThisDecisionInput = {
493
- [K in keyof typeof WhyThisDecisionInputSchema]: z.infer<(typeof WhyThisDecisionInputSchema)[K]>;
494
- };
495
- interface WhyThisDecisionOutput {
496
- found: boolean;
497
- decision?: {
498
- id: string;
499
- type: string;
500
- scope: string;
501
- status: string;
502
- confidence: string;
503
- body: string;
504
- created_at: string;
505
- };
506
- /** Memories explicitly linked via related_ids on the decision (or vice versa). */
507
- related: Array<{
508
- id: string;
509
- type: string;
510
- scope: string;
511
- confidence: string;
512
- body_preview: string;
513
- relation: "explicit" | "back-link";
514
- }>;
515
- /** Other memories anchored to overlapping paths — implicit context. */
516
- path_neighbors: Array<{
517
- id: string;
518
- type: string;
519
- scope: string;
520
- confidence: string;
521
- overlap: string[];
522
- body_preview: string;
523
- }>;
524
- /** Recent git commits touching any of the decision's anchored paths. */
525
- recent_commits: Array<{
526
- path: string;
527
- sha: string;
528
- author: string;
529
- relative_date: string;
530
- subject: string;
531
- }>;
532
- hints?: string[];
533
- notice?: string;
534
- }
535
- /**
536
- * Trace the genealogy of a `decision` memory: the decision itself + memories
537
- * explicitly linked to it + memories anchored to overlapping paths + recent
538
- * commits touching those paths. One call instead of 4-5 manual lookups.
539
- *
540
- * Works on any memory type, but is optimized for `decision` and `architecture`.
541
- */
542
- declare function whyThisDecision(input: WhyThisDecisionInput, ctx: HaiveContext): Promise<WhyThisDecisionOutput>;
543
-
544
- declare const MemConflictsInputSchema: {
545
- id: z.ZodString;
546
- min_score: z.ZodDefault<z.ZodNumber>;
547
- semantic: z.ZodDefault<z.ZodBoolean>;
548
- };
549
- type MemConflictsInput = {
550
- [K in keyof typeof MemConflictsInputSchema]: z.infer<(typeof MemConflictsInputSchema)[K]>;
551
- };
552
- type ConflictReason = "opposite-status" | "attempt-vs-convention-same-paths" | "polarity-keywords" | "explicit-contradiction-tag";
553
- interface ConflictHit {
554
- id: string;
555
- type: string;
556
- scope: string;
557
- status: string;
558
- confidence: string;
559
- body_preview: string;
560
- similarity: number | null;
561
- reasons: ConflictReason[];
562
- shared_paths: string[];
563
- }
564
- interface MemConflictsOutput {
565
- found: boolean;
566
- target?: {
567
- id: string;
568
- type: string;
569
- status: string;
570
- };
571
- scanned: number;
572
- conflicts: ConflictHit[];
573
- notice?: string;
574
- }
575
- /**
576
- * Find memories that potentially CONTRADICT the given memory. Useful before
577
- * relying on a memory's advice — surfaces "another memory says the opposite".
578
- *
579
- * Detection layers (any of these triggers a hit):
580
- * - Opposite status: target is validated, neighbor is rejected — for the same topic
581
- * - Type mismatch on overlapping paths: an `attempt` (don't do X) coexists with
582
- * a `convention` (do X) anchored to overlapping paths
583
- * - Polarity keywords: target says "use X" while a semantic neighbor says "don't use X"
584
- * - Explicit contradiction tag (#contradicts:<id>) in either body
585
- */
586
- declare function memConflicts(input: MemConflictsInput, ctx: HaiveContext): Promise<MemConflictsOutput>;
587
-
588
445
  declare const PreCommitCheckInputSchema: {
589
446
  diff: z.ZodOptional<z.ZodString>;
590
447
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -648,6 +505,36 @@ interface ClassifiedAntiPatternsWarning extends AntiPatternsWarning {
648
505
  */
649
506
  declare function preCommitCheck(input: PreCommitCheckInput, ctx: HaiveContext): Promise<PreCommitCheckOutput>;
650
507
 
508
+ declare const ProposeSensorInputSchema: {
509
+ memory_id: z.ZodString;
510
+ kind: z.ZodDefault<z.ZodEnum<["regex", "shell", "test"]>>;
511
+ pattern: z.ZodOptional<z.ZodString>;
512
+ command: z.ZodOptional<z.ZodString>;
513
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
514
+ absent: z.ZodOptional<z.ZodString>;
515
+ bad_example: z.ZodOptional<z.ZodString>;
516
+ severity: z.ZodDefault<z.ZodEnum<["warn", "block"]>>;
517
+ message: z.ZodOptional<z.ZodString>;
518
+ flags: z.ZodOptional<z.ZodString>;
519
+ paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
520
+ };
521
+ type ProposeSensorInput = {
522
+ [K in keyof typeof ProposeSensorInputSchema]: z.infer<(typeof ProposeSensorInputSchema)[K]>;
523
+ };
524
+ interface ProposeSensorOutput {
525
+ accepted: boolean;
526
+ memory_id: string;
527
+ severity: "warn" | "block";
528
+ /** Set when rejected — why, and how to revise. */
529
+ reason?: string;
530
+ guidance?: string;
531
+ self_check: {
532
+ silent_on_current: boolean;
533
+ fires_on_bad: boolean | null;
534
+ fired_on: string[];
535
+ };
536
+ file_path?: string;
537
+ }
651
538
  /**
652
539
  * Read the PRESUMED-CORRECT contents of anchored files for sensor self-checks.
653
540
  *
@@ -658,6 +545,7 @@ declare function preCommitCheck(input: PreCommitCheckInput, ctx: HaiveContext):
658
545
  * presumed-correct baseline; fall back to the working tree for files not yet in git.
659
546
  */
660
547
  declare function readPresumedCorrectTargets(root: string, relPaths: string[]): Promise<SensorTarget[]>;
548
+ declare function proposeSensor(input: ProposeSensorInput, ctx: HaiveContext): Promise<ProposeSensorOutput>;
661
549
 
662
550
  declare const MemTriedInputSchema: {
663
551
  what: z.ZodString;
@@ -669,20 +557,29 @@ declare const MemTriedInputSchema: {
669
557
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
670
558
  author: z.ZodOptional<z.ZodString>;
671
559
  sensor: z.ZodOptional<z.ZodObject<{
672
- pattern: z.ZodString;
560
+ kind: z.ZodDefault<z.ZodEnum<["regex", "shell", "test"]>>;
561
+ pattern: z.ZodOptional<z.ZodString>;
562
+ command: z.ZodOptional<z.ZodString>;
563
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
673
564
  absent: z.ZodOptional<z.ZodString>;
674
565
  severity: z.ZodDefault<z.ZodEnum<["warn", "block"]>>;
675
566
  message: z.ZodOptional<z.ZodString>;
676
567
  bad_example: z.ZodOptional<z.ZodString>;
677
568
  }, "strip", z.ZodTypeAny, {
678
- pattern: string;
569
+ kind: "regex" | "shell" | "test";
679
570
  severity: "warn" | "block";
571
+ pattern?: string | undefined;
680
572
  message?: string | undefined;
573
+ command?: string | undefined;
574
+ timeout_ms?: number | undefined;
681
575
  absent?: string | undefined;
682
576
  bad_example?: string | undefined;
683
577
  }, {
684
- pattern: string;
578
+ pattern?: string | undefined;
685
579
  message?: string | undefined;
580
+ kind?: "regex" | "shell" | "test" | undefined;
581
+ command?: string | undefined;
582
+ timeout_ms?: number | undefined;
686
583
  absent?: string | undefined;
687
584
  severity?: "warn" | "block" | undefined;
688
585
  bad_example?: string | undefined;
@@ -718,34 +615,6 @@ interface MemTriedOutput {
718
615
  }
719
616
  declare function memTried(input: MemTriedInput, ctx: HaiveContext): Promise<MemTriedOutput>;
720
617
 
721
- declare const PatternDetectInputSchema: {
722
- since_days: z.ZodDefault<z.ZodNumber>;
723
- dry_run: z.ZodDefault<z.ZodBoolean>;
724
- scope: z.ZodDefault<z.ZodEnum<["personal", "team"]>>;
725
- };
726
- type PatternDetectInput = {
727
- [K in keyof typeof PatternDetectInputSchema]: z.infer<(typeof PatternDetectInputSchema)[K]>;
728
- };
729
- type PatternKind = "config_change" | "repeated_path" | "hot_file";
730
- interface PatternMatch {
731
- kind: PatternKind;
732
- signal: string;
733
- proposed_type: "convention" | "gotcha";
734
- proposed_slug: string;
735
- proposed_body: string;
736
- anchor_paths: string[];
737
- }
738
- interface PatternDetectOutput {
739
- scanned_events: number;
740
- matches: PatternMatch[];
741
- /** Number of proposed memories saved (0 if dry_run). */
742
- saved: number;
743
- /** IDs of saved memories. */
744
- saved_ids: string[];
745
- notice?: string;
746
- }
747
- declare function patternDetect(input: PatternDetectInput, ctx: HaiveContext): Promise<PatternDetectOutput>;
748
-
749
618
  /** Input is intentionally minimal — callers may pass cwd for multi-root clients. */
750
619
  declare const MemResolveProjectInputSchema: {
751
620
  cwd: z.ZodOptional<z.ZodString>;
@@ -823,36 +692,12 @@ declare function memConflictCandidates(input: MemConflictCandidatesInput, ctx: H
823
692
  notice: string | undefined;
824
693
  }>;
825
694
 
826
- declare const RuntimeJournalAppendInputSchema: {
827
- message: z.ZodString;
828
- kind: z.ZodDefault<z.ZodEnum<["note", "session_end", "mcp"]>>;
829
- tool: z.ZodOptional<z.ZodString>;
830
- };
831
- type RuntimeJournalAppendInput = {
832
- [K in keyof typeof RuntimeJournalAppendInputSchema]: z.infer<(typeof RuntimeJournalAppendInputSchema)[K]>;
833
- };
834
- declare function runtimeJournalAppend(input: RuntimeJournalAppendInput, ctx: HaiveContext): Promise<{
835
- ok: true;
836
- path_hint: string;
837
- }>;
838
-
839
- declare const RuntimeJournalTailInputSchema: {
840
- limit: z.ZodDefault<z.ZodNumber>;
841
- };
842
- type RuntimeJournalTailInput = {
843
- [K in keyof typeof RuntimeJournalTailInputSchema]: z.infer<(typeof RuntimeJournalTailInputSchema)[K]>;
844
- };
845
- declare function runtimeJournalTail(input: RuntimeJournalTailInput, ctx: HaiveContext): Promise<{
846
- entries: Awaited<ReturnType<typeof readRuntimeJournalTail>>;
847
- empty?: boolean;
848
- }>;
849
-
850
695
  declare const SERVER_NAME = "hivelore";
851
696
  declare const SERVER_VERSION: string;
852
697
  type ToolProfile = "enforcement" | "maintenance" | "experimental" | "full";
853
698
  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"];
854
699
  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"];
855
- 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", "mem_observe", "why_this_file", "why_this_decision", "mem_conflicts_with", "pattern_detect", "runtime_journal_append", "runtime_journal_tail"];
700
+ 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"];
856
701
  declare const TOOL_PROFILES: Record<Exclude<ToolProfile, "full">, ReadonlySet<string>>;
857
702
  declare function getAllowedToolsForProfile(profile: ToolProfile): ReadonlySet<string>;
858
703
  declare function createHaiveServer(options?: CreateContextOptions): {
@@ -875,4 +720,4 @@ declare function runHaiveMcpStdio(options: {
875
720
  root?: string;
876
721
  }): Promise<void>;
877
722
 
878
- 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 MemConflictsInput, type MemConflictsOutput, type MemDistillInput, type MemDistillOutput, type MemRelevantToInput, type MemRelevantToOutput, type MemResolveProjectInput, type MemSuggestTopicInput, type MemTimelineInput, type MemTriedOutput, type PatternDetectInput, type PatternDetectOutput, type PreCommitCheckInput, type PreCommitCheckOutput, type RuntimeJournalAppendInput, type RuntimeJournalTailInput, SERVER_NAME, SERVER_VERSION, TOOL_PROFILES, type ToolProfile, type WhyThisDecisionInput, type WhyThisDecisionOutput, type WhyThisFileInput, type WhyThisFileOutput, antiPatternsCheck, codeMapTool, codeSearch, createHaiveServer, getAllowedToolsForProfile, getBriefing, getRecap, memConflictCandidates, memConflicts, memDistill, memRelevantTo, memResolveProject, memSuggestTopic, memTimeline, memTried, parseMcpCliArgs, patternDetect, preCommitCheck, printHaiveMcpVersion, readPresumedCorrectTargets, runHaiveMcpStdio, runtimeJournalAppend, runtimeJournalTail, whyThisDecision, whyThisFile };
723
+ 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 };