memory-journal-mcp 7.5.0 → 7.6.1

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.d.ts CHANGED
@@ -1,3 +1,148 @@
1
+ /** Audit log configuration */
2
+ interface AuditConfig {
3
+ /** Master switch — false means no interceptor is created */
4
+ enabled: boolean;
5
+ /** Absolute path to the JSONL output file, or "stderr" for container mode */
6
+ logPath: string;
7
+ /** When true, tool arguments are omitted from entries */
8
+ redact: boolean;
9
+ /** When true, read-scoped tools are also logged (default: false) */
10
+ auditReads: boolean;
11
+ /** Maximum log file size in bytes before rotation (default: 10MB). 0 = no rotation. */
12
+ maxSizeBytes: number;
13
+ }
14
+
15
+ /**
16
+ * Memory Journal MCP Server - Tool Filtering
17
+ *
18
+ * Configurable tool filtering system with groups and meta-groups.
19
+ * Matches mysql-mcp filtering syntax and patterns.
20
+ */
21
+
22
+ /**
23
+ * Tool group definitions mapping group names to tool names
24
+ *
25
+ * All 70 tools are categorized here for filtering support.
26
+ */
27
+ declare const TOOL_GROUPS: Record<ToolGroup, string[]>;
28
+ /**
29
+ * Meta-group definitions mapping shortcuts to groups
30
+ */
31
+ declare const META_GROUPS: Record<MetaGroup, ToolGroup[]>;
32
+ /**
33
+ * Get all tool names across all groups
34
+ */
35
+ declare function getAllToolNames(): string[];
36
+ /**
37
+ * Get the group for a specific tool
38
+ */
39
+ declare function getToolGroup(toolName: string): ToolGroup | undefined;
40
+ /**
41
+ * Parse a tool filter string into configuration
42
+ *
43
+ * Syntax:
44
+ * - `starter` - Use starter preset (whitelist mode)
45
+ * - `core,search` - Enable specific groups (whitelist mode)
46
+ * - `full,-admin` - All tools except admin group
47
+ * - `starter,-delete_entry` - Starter without specific tool
48
+ * - `+semantic_search` - Add specific tool to current set
49
+ */
50
+ declare function parseToolFilter(filterString: string): ToolFilterConfig;
51
+ /**
52
+ * Check if a tool is enabled based on filter string
53
+ */
54
+ declare function isToolEnabled(toolName: string, filterConfig: ToolFilterConfig): boolean;
55
+ /**
56
+ * Filter tools array based on filter configuration
57
+ */
58
+ declare function filterTools<T extends {
59
+ name: string;
60
+ }>(tools: T[], filterConfig: ToolFilterConfig): T[];
61
+ /**
62
+ * Get tool filter from environment variable
63
+ */
64
+ declare function getToolFilterFromEnv(): ToolFilterConfig | null;
65
+ /**
66
+ * Calculate token savings from filtering
67
+ */
68
+ declare function calculateTokenSavings(totalTools: number, enabledTools: number, avgTokensPerTool?: number): {
69
+ reduction: number;
70
+ savedTokens: number;
71
+ };
72
+ /**
73
+ * Get human-readable filter summary
74
+ */
75
+ declare function getFilterSummary(filterConfig: ToolFilterConfig): string;
76
+
77
+ /**
78
+ * Memory Journal MCP Server - Scheduler
79
+ *
80
+ * Lightweight in-process scheduler for periodic maintenance jobs.
81
+ * Only meaningful for HTTP/SSE transport (long-lived server processes).
82
+ * Uses setInterval for simplicity — no external dependencies.
83
+ */
84
+
85
+ /** Scheduler configuration options */
86
+ interface SchedulerOptions {
87
+ /** Automated backup interval in minutes (0 = disabled) */
88
+ backupIntervalMinutes: number;
89
+ /** Max backups to retain during automated cleanup */
90
+ keepBackups: number;
91
+ /** Database optimize interval in minutes (0 = disabled) */
92
+ vacuumIntervalMinutes: number;
93
+ /** Vector index rebuild interval in minutes (0 = disabled) */
94
+ rebuildIndexIntervalMinutes: number;
95
+ /** Analytics digest interval in minutes (0 = disabled; recommended: 1440 for daily) */
96
+ digestIntervalMinutes: number;
97
+ }
98
+
99
+ /**
100
+ * Memory Journal MCP Server - Resource Shared Types & Helpers
101
+ *
102
+ * Shared types, helpers, and utilities used by all resource group modules.
103
+ */
104
+
105
+ /**
106
+ * Configuration for the memory://briefing resource.
107
+ * All values have sensible defaults — users opt-in via env vars or CLI flags.
108
+ */
109
+ interface BriefingConfig {
110
+ /** Number of recent journal entries to include (default: 3) */
111
+ entryCount: number;
112
+ /** Number of recent session summaries to display (default: 1) */
113
+ summaryCount?: number;
114
+ /** Include team DB entries in briefing preview (default: false) */
115
+ includeTeam: boolean;
116
+ /** Number of open issues to list with titles; 0 = count only (default: 0) */
117
+ issueCount: number;
118
+ /** Number of PRs to list with titles; 0 = count only (default: 0) */
119
+ prCount: number;
120
+ /** Show PR status breakdown (open/merged/closed) instead of simple count (default: false) */
121
+ prStatusBreakdown: boolean;
122
+ /** Number of milestones to list in briefing; 0 = hide (default: 3) */
123
+ milestoneCount?: number;
124
+ /** Path to the user's rules file (e.g., .gemini/GEMINI.md) for awareness in briefing */
125
+ rulesFilePath?: string;
126
+ /** Path to the user's skills directory for awareness in briefing */
127
+ skillsDirPath?: string;
128
+ /** Number of recent workflow runs to list; 0 = latest-only status (default: 0) */
129
+ workflowCount: number;
130
+ /** Show workflow run status breakdown (passing/failing/pending) (default: false) */
131
+ workflowStatusBreakdown: boolean;
132
+ /** Aggregate Copilot review state across recent PRs in briefing (default: false) */
133
+ copilotReviews: boolean;
134
+ /** Workflow summary string for the memory://workflows resource (env: MEMORY_JOURNAL_WORKFLOW_SUMMARY) */
135
+ workflowSummary?: string;
136
+ /** Default GitHub Project number for Kanban resources and issue tools (env: DEFAULT_PROJECT_NUMBER) */
137
+ defaultProjectNumber?: number;
138
+ /** Project registry mapping dynamic repo IDs to local paths and kanban boards */
139
+ projectRegistry?: Record<string, ProjectRegistryEntry>;
140
+ /** Hush Protocol flag vocabulary passed from CLI/env */
141
+ flagVocabulary?: string[];
142
+ /** Allowlisted directory roots for strict filesystem jailing of agent read access */
143
+ allowedIoRoots?: string[];
144
+ }
145
+
1
146
  /**
2
147
  * Memory Journal MCP Server - Tool Filtering Types
3
148
  */
@@ -211,6 +356,7 @@ interface ProjectContext {
211
356
  pullRequests: GitHubPullRequest[];
212
357
  workflowRuns: GitHubWorkflowRun[];
213
358
  milestones: GitHubMilestone[];
359
+ degraded?: string[];
214
360
  }
215
361
 
216
362
  /**
@@ -264,6 +410,12 @@ interface ToolDefinition {
264
410
  outputSchema?: unknown;
265
411
  /** Behavioral hints for AI clients */
266
412
  annotations: ToolAnnotations;
413
+ /** Security capabilities required to execute this tool */
414
+ capabilities?: {
415
+ requiresTeamScope?: boolean;
416
+ requiresAdminScope?: boolean;
417
+ mutatesState?: boolean;
418
+ };
267
419
  /** Tool handler function */
268
420
  handler: (params: unknown) => unknown;
269
421
  }
@@ -271,6 +423,7 @@ interface ProjectRegistryEntry {
271
423
  path: string;
272
424
  project_number?: number;
273
425
  }
426
+
274
427
  /**
275
428
  * Resource definition for MCP
276
429
  */
@@ -287,6 +440,11 @@ interface ResourceDefinition {
287
440
  mimeType: string;
288
441
  /** Resource metadata annotations */
289
442
  annotations?: ResourceAnnotations;
443
+ /** Security capabilities required to read this resource */
444
+ capabilities?: {
445
+ requiresTeamScope?: boolean;
446
+ requiresAdminScope?: boolean;
447
+ };
290
448
  /** Resource handler - NOTE: db is passed at runtime, not in the definition */
291
449
  handler: (uri: string) => Promise<unknown>;
292
450
  }
@@ -367,12 +525,9 @@ interface CreateEntryInput {
367
525
  workflowRunId?: number;
368
526
  workflowName?: string;
369
527
  workflowStatus?: 'queued' | 'in_progress' | 'completed';
528
+ author?: string;
370
529
  }
371
530
 
372
- interface QueryResult {
373
- columns: string[];
374
- values: unknown[][];
375
- }
376
531
  /**
377
532
  * The public facade representing the capabilities of any memory-journal DB adapter
378
533
  */
@@ -385,6 +540,10 @@ interface IDatabaseAdapter {
385
540
  getEntryById(id: number): JournalEntry | null;
386
541
  getEntryByIdIncludeDeleted(id: number): JournalEntry | null;
387
542
  getEntriesByIds(ids: number[]): Map<number, JournalEntry>;
543
+ getEntriesByIdsWithImportance(ids: number[]): Map<number, {
544
+ entry: JournalEntry;
545
+ importance: ImportanceResult;
546
+ }>;
388
547
  calculateImportance(entryId: number): ImportanceResult;
389
548
  getRecentEntries(limit?: number, isPersonal?: boolean, sortBy?: 'timestamp' | 'importance'): JournalEntry[];
390
549
  getEntriesPage(offset: number, limit: number): JournalEntry[];
@@ -394,6 +553,18 @@ interface IDatabaseAdapter {
394
553
  entryType?: EntryType;
395
554
  tags?: string[];
396
555
  isPersonal?: boolean;
556
+ significanceType?: string;
557
+ autoContext?: string | null;
558
+ projectNumber?: number;
559
+ projectOwner?: string;
560
+ issueNumber?: number;
561
+ issueUrl?: string;
562
+ prNumber?: number;
563
+ prUrl?: string;
564
+ prStatus?: string;
565
+ workflowRunId?: number;
566
+ workflowName?: string;
567
+ workflowStatus?: string;
397
568
  }): JournalEntry | null;
398
569
  deleteEntry(id: number, permanent?: boolean): boolean;
399
570
  searchEntries(query: string, options?: {
@@ -422,7 +593,13 @@ interface IDatabaseAdapter {
422
593
  sortBy?: 'timestamp' | 'importance';
423
594
  }): JournalEntry[];
424
595
  getStatistics(groupBy?: 'day' | 'week' | 'month' | 'year', startDate?: string, endDate?: string, projectBreakdown?: boolean): Record<string, unknown>;
596
+ getAuthorStatistics(): {
597
+ author: string;
598
+ count: number;
599
+ }[];
600
+ getAuthorsForEntries(entryIds: number[]): Map<number, string | null>;
425
601
  getTagsForEntry(entryId: number): string[];
602
+ getTagsForEntries(entryIds: number[]): Map<number, string[]>;
426
603
  listTags(): Tag[];
427
604
  mergeTags(sourceTag: string, targetTag: string): {
428
605
  entriesUpdated: number;
@@ -430,6 +607,7 @@ interface IDatabaseAdapter {
430
607
  };
431
608
  linkEntries(fromEntryId: number, toEntryId: number, relationshipType: RelationshipType, description?: string): Relationship;
432
609
  getRelationships(entryId: number): Relationship[];
610
+ getRelationshipsForEntries(entryIds: number[]): Map<number, Relationship[]>;
433
611
  getBackupsDir(): string;
434
612
  exportToFile(backupName?: string): Promise<{
435
613
  filename: string;
@@ -446,7 +624,7 @@ interface IDatabaseAdapter {
446
624
  deleted: string[];
447
625
  kept: number;
448
626
  };
449
- restoreFromFile(filename: string): Promise<{
627
+ restoreFromFile(filename: string, runtime?: unknown): Promise<{
450
628
  restoredFrom: string;
451
629
  previousEntryCount: number;
452
630
  newEntryCount: number;
@@ -470,9 +648,6 @@ interface IDatabaseAdapter {
470
648
  } | null;
471
649
  };
472
650
  };
473
- getRawDb(): unknown;
474
- pragma(command: string): void;
475
- executeRawQuery(sql: string, params?: unknown[]): QueryResult[];
476
651
  saveAnalyticsSnapshot(type: string, data: Record<string, unknown>): number;
477
652
  getLatestAnalyticsSnapshot(type: string): {
478
653
  id: number;
@@ -484,159 +659,85 @@ interface IDatabaseAdapter {
484
659
  createdAt: string;
485
660
  data: Record<string, unknown>;
486
661
  }[];
487
- }
488
-
489
- /**
490
- * Memory Journal MCP Server - Scheduler
491
- *
492
- * Lightweight in-process scheduler for periodic maintenance jobs.
493
- * Only meaningful for HTTP/SSE transport (long-lived server processes).
494
- * Uses setInterval for simplicity — no external dependencies.
495
- */
496
-
497
- /** Scheduler configuration options */
498
- interface SchedulerOptions {
499
- /** Automated backup interval in minutes (0 = disabled) */
500
- backupIntervalMinutes: number;
501
- /** Max backups to retain during automated cleanup */
502
- keepBackups: number;
503
- /** Database optimize interval in minutes (0 = disabled) */
504
- vacuumIntervalMinutes: number;
505
- /** Vector index rebuild interval in minutes (0 = disabled) */
506
- rebuildIndexIntervalMinutes: number;
507
- /** Analytics digest interval in minutes (0 = disabled; recommended: 1440 for daily) */
508
- digestIntervalMinutes: number;
509
- }
510
-
511
- /**
512
- * memory-journal-mcp - Sandbox Factory
513
- *
514
- * Mode selection factory for choosing between VM and Worker sandboxes.
515
- * Allows runtime configuration of the sandbox mode.
516
- */
517
-
518
- /** Available sandbox modes */
519
- type SandboxMode = 'vm' | 'worker';
520
-
521
- /**
522
- * Memory Journal MCP Server - Tool Filtering
523
- *
524
- * Configurable tool filtering system with groups and meta-groups.
525
- * Matches mysql-mcp filtering syntax and patterns.
526
- */
527
-
528
- /**
529
- * Tool group definitions mapping group names to tool names
530
- *
531
- * All 70 tools are categorized here for filtering support.
532
- */
533
- declare const TOOL_GROUPS: Record<ToolGroup, string[]>;
534
- /**
535
- * Meta-group definitions mapping shortcuts to groups
536
- */
537
- declare const META_GROUPS: Record<MetaGroup, ToolGroup[]>;
538
- /**
539
- * Get all tool names across all groups
540
- */
541
- declare function getAllToolNames(): string[];
542
- /**
543
- * Get the group for a specific tool
544
- */
545
- declare function getToolGroup(toolName: string): ToolGroup | undefined;
546
- /**
547
- * Parse a tool filter string into configuration
548
- *
549
- * Syntax:
550
- * - `starter` - Use starter preset (whitelist mode)
551
- * - `core,search` - Enable specific groups (whitelist mode)
552
- * - `full,-admin` - All tools except admin group
553
- * - `starter,-delete_entry` - Starter without specific tool
554
- * - `+semantic_search` - Add specific tool to current set
555
- */
556
- declare function parseToolFilter(filterString: string): ToolFilterConfig;
557
- /**
558
- * Check if a tool is enabled based on filter string
559
- */
560
- declare function isToolEnabled(toolName: string, filterConfig: ToolFilterConfig): boolean;
561
- /**
562
- * Filter tools array based on filter configuration
563
- */
564
- declare function filterTools<T extends {
565
- name: string;
566
- }>(tools: T[], filterConfig: ToolFilterConfig): T[];
567
- /**
568
- * Get tool filter from environment variable
569
- */
570
- declare function getToolFilterFromEnv(): ToolFilterConfig | null;
571
- /**
572
- * Calculate token savings from filtering
573
- */
574
- declare function calculateTokenSavings(totalTools: number, enabledTools: number, avgTokensPerTool?: number): {
575
- reduction: number;
576
- savedTokens: number;
577
- };
578
- /**
579
- * Get human-readable filter summary
580
- */
581
- declare function getFilterSummary(filterConfig: ToolFilterConfig): string;
582
-
583
- /**
584
- * Memory Journal MCP Server - Resource Shared Types & Helpers
585
- *
586
- * Shared types, helpers, and utilities used by all resource group modules.
587
- */
588
-
589
- /**
590
- * Configuration for the memory://briefing resource.
591
- * All values have sensible defaults — users opt-in via env vars or CLI flags.
592
- */
593
- interface BriefingConfig {
594
- /** Number of recent journal entries to include (default: 3) */
595
- entryCount: number;
596
- /** Number of recent session summaries to display (default: 1) */
597
- summaryCount?: number;
598
- /** Include team DB entries in briefing preview (default: false) */
599
- includeTeam: boolean;
600
- /** Number of open issues to list with titles; 0 = count only (default: 0) */
601
- issueCount: number;
602
- /** Number of PRs to list with titles; 0 = count only (default: 0) */
603
- prCount: number;
604
- /** Show PR status breakdown (open/merged/closed) instead of simple count (default: false) */
605
- prStatusBreakdown: boolean;
606
- /** Number of milestones to list in briefing; 0 = hide (default: 3) */
607
- milestoneCount?: number;
608
- /** Path to the user's rules file (e.g., .gemini/GEMINI.md) for awareness in briefing */
609
- rulesFilePath?: string;
610
- /** Path to the user's skills directory for awareness in briefing */
611
- skillsDirPath?: string;
612
- /** Number of recent workflow runs to list; 0 = latest-only status (default: 0) */
613
- workflowCount: number;
614
- /** Show workflow run status breakdown (passing/failing/pending) (default: false) */
615
- workflowStatusBreakdown: boolean;
616
- /** Aggregate Copilot review state across recent PRs in briefing (default: false) */
617
- copilotReviews: boolean;
618
- /** Workflow summary string for the memory://workflows resource (env: MEMORY_JOURNAL_WORKFLOW_SUMMARY) */
619
- workflowSummary?: string;
620
- /** Default GitHub Project number for Kanban resources and issue tools (env: DEFAULT_PROJECT_NUMBER) */
621
- defaultProjectNumber?: number;
622
- /** Project registry mapping dynamic repo IDs to local paths and kanban boards */
623
- projectRegistry?: Record<string, ProjectRegistryEntry>;
624
- /** Hush Protocol flag vocabulary passed from CLI/env */
625
- flagVocabulary?: string[];
626
- }
627
-
628
- /** Audit log configuration */
629
- interface AuditConfig {
630
- /** Master switch — false means no interceptor is created */
631
- enabled: boolean;
632
- /** Absolute path to the JSONL output file, or "stderr" for container mode */
633
- logPath: string;
634
- /** When true, tool arguments are omitted from entries */
635
- redact: boolean;
636
- /** When true, read-scoped tools are also logged (default: false) */
637
- auditReads: boolean;
638
- /** Maximum log file size in bytes before rotation (default: 10MB). 0 = no rotation. */
639
- maxSizeBytes: number;
662
+ computeDigest(): Record<string, unknown>;
663
+ pragma(command: string): void;
664
+ getCrossProjectInsights(options: {
665
+ startDate?: string;
666
+ endDate?: string;
667
+ minEntries: number;
668
+ inactiveThresholdDays: number;
669
+ }): {
670
+ projects: Record<string, unknown>[];
671
+ inactiveProjects: {
672
+ project_number: number;
673
+ last_entry_date: string;
674
+ }[];
675
+ };
676
+ visualizeRelationships(options: {
677
+ entryId?: number;
678
+ tags?: string[];
679
+ relationshipType?: string;
680
+ depth: number;
681
+ limit: number;
682
+ }): {
683
+ nodes: {
684
+ id: string | number;
685
+ label: string;
686
+ group: string;
687
+ metadata?: Record<string, unknown>;
688
+ }[];
689
+ edges: {
690
+ from: string | number;
691
+ to: string | number;
692
+ label: string;
693
+ type: string;
694
+ }[];
695
+ };
696
+ getTeamCollaborationMatrix(options: {
697
+ period: string;
698
+ limit: number;
699
+ }): {
700
+ totalAuthors: number;
701
+ totalEntries: number;
702
+ authorActivity: {
703
+ author: string;
704
+ period: string;
705
+ entryCount: number;
706
+ }[];
707
+ crossAuthorLinks: {
708
+ fromAuthor: string;
709
+ toAuthor: string;
710
+ linkCount: number;
711
+ }[];
712
+ impactFactor: {
713
+ author: string;
714
+ inboundLinks: number;
715
+ }[];
716
+ };
717
+ getWorkflowActionEntries(limit: number): JournalEntry[];
718
+ getSignificantEntries(limit: number, projectNumber?: number): JournalEntry[];
719
+ getRecentGraphRelationships(limit: number): {
720
+ from_entry_id: number;
721
+ to_entry_id: number;
722
+ relationship_type: string;
723
+ from_content: string;
724
+ to_content: string;
725
+ }[];
726
+ upsertVector(entryId: number, embedding: Float32Array): void;
727
+ upsertVectors(vectors: {
728
+ entryId: number;
729
+ embedding: Float32Array;
730
+ }[]): void;
731
+ searchVectors(embedding: Float32Array, limit: number): {
732
+ entry_id: number;
733
+ distance: number;
734
+ }[];
735
+ getVector(entryId: number): Float32Array | null;
736
+ deleteVector(entryId: number): void;
737
+ clearVectors(): void;
738
+ getVectorCount(): number;
739
+ cleanupStaleVectors(): void;
740
+ executeInTransaction<T>(cb: () => T): T;
640
741
  }
641
742
 
642
743
  /**
@@ -659,17 +760,21 @@ interface ServerOptions {
659
760
  authToken?: string;
660
761
  enableHSTS?: boolean;
661
762
  scheduler?: SchedulerOptions;
662
- sandboxMode?: SandboxMode;
663
763
  oauthEnabled?: boolean;
664
764
  oauthIssuer?: string;
665
765
  oauthAudience?: string;
666
766
  oauthJwksUri?: string;
667
767
  oauthClockTolerance?: number;
768
+ allowPlaintextLoopbackOAuth?: boolean;
769
+ trustProxy?: boolean;
770
+ publicOrigin?: string;
668
771
  briefingConfig?: BriefingConfig;
669
772
  projectRegistry?: Record<string, ProjectRegistryEntry>;
670
773
  instructionLevel?: 'essential' | 'standard' | 'full';
671
774
  auditConfig?: AuditConfig;
672
775
  flagVocabulary?: string[];
776
+ allowedIoRoots?: string[];
777
+ codemodeInternalFullAccess?: boolean;
673
778
  }
674
779
  /**
675
780
  * Create and start the MCP server
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
- export { VERSION, createServer } from './chunk-XNOUTCRV.js';
2
- export { META_GROUPS, TOOL_GROUPS, calculateTokenSavings, filterTools, getAllToolNames, getFilterSummary, getToolFilterFromEnv, getToolGroup, isToolEnabled, parseToolFilter } from './chunk-VHA46GLM.js';
3
- import './chunk-OKOVZ5QE.js';
4
- export { logger } from './chunk-WXDEVIFL.js';
1
+ export { VERSION, createServer } from './chunk-DFQG7UR5.js';
2
+ export { META_GROUPS, TOOL_GROUPS, calculateTokenSavings, filterTools, getAllToolNames, getFilterSummary, getToolFilterFromEnv, getToolGroup, isToolEnabled, logger, parseToolFilter } from './chunk-SYTB5YNH.js';
5
3
 
6
4
  // src/types/index.ts
7
5
  var DEFAULT_CONFIG = {
@@ -0,0 +1 @@
1
+ export { callTool, getTools } from './chunk-SYTB5YNH.js';