@swarmvaultai/engine 3.5.0 → 3.7.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.
@@ -23,7 +23,7 @@ function isReportPath(value, cwd) {
23
23
  if (normalized.endsWith(reportNormalized)) {
24
24
  return true;
25
25
  }
26
- return path.resolve(cwd, value) === path.resolve(cwd, reportSuffix);
26
+ return path.resolve(cwd, value) === reportPath(cwd);
27
27
  }
28
28
  function collectCandidatePaths(node, acc = []) {
29
29
  if (typeof node === "string") {
@@ -59,12 +59,22 @@ function resolveToolName(input) {
59
59
  }
60
60
  async function hasReport(cwd) {
61
61
  try {
62
- await fs.access(path.join(cwd, "wiki", "graph", "report.md"));
62
+ await fs.access(reportPath(cwd));
63
63
  return true;
64
64
  } catch {
65
65
  return false;
66
66
  }
67
67
  }
68
+ function artifactRootDir(cwd) {
69
+ const override = process.env.SWARMVAULT_OUT?.trim();
70
+ if (!override) {
71
+ return path.resolve(cwd);
72
+ }
73
+ return path.isAbsolute(override) ? path.resolve(override) : path.resolve(cwd, override);
74
+ }
75
+ function reportPath(cwd) {
76
+ return path.join(artifactRootDir(cwd), "wiki", "graph", "report.md");
77
+ }
68
78
  async function markReportRead(cwd, agentKey) {
69
79
  const state = markerState(cwd, agentKey);
70
80
  await fs.mkdir(state.dir, { recursive: true });
@@ -86,6 +96,45 @@ async function resetSession(cwd, agentKey) {
86
96
  function isBroadSearchTool(toolName) {
87
97
  return /grep|glob|search|find/i.test(toolName);
88
98
  }
99
+ function collectCommandCandidates(node, acc = []) {
100
+ if (!node || typeof node !== "object") {
101
+ return acc;
102
+ }
103
+ if (Array.isArray(node)) {
104
+ for (const item of node) {
105
+ collectCommandCandidates(item, acc);
106
+ }
107
+ return acc;
108
+ }
109
+ for (const [key, value] of Object.entries(node)) {
110
+ if (["command", "cmd", "script", "bash", "shell"].includes(key) && typeof value === "string") {
111
+ acc.push(value);
112
+ continue;
113
+ }
114
+ collectCommandCandidates(value, acc);
115
+ }
116
+ return acc;
117
+ }
118
+ function commandLooksLikeBroadSearch(command) {
119
+ const tokens = command.replace(/[;&|()]/g, " ").split(/\s+/).map((token) => path.basename(token.replace(/^['"]|['"]$/g, ""))).filter(Boolean);
120
+ for (let index = 0; index < tokens.length; index += 1) {
121
+ const token = tokens[index];
122
+ if (["rg", "grep", "find", "fd", "ag", "ack"].includes(token)) {
123
+ return true;
124
+ }
125
+ if (token === "git" && tokens[index + 1] === "grep") {
126
+ return true;
127
+ }
128
+ }
129
+ return false;
130
+ }
131
+ function isBroadSearchInput(input) {
132
+ const toolName = resolveToolName(input);
133
+ if (isBroadSearchTool(toolName)) {
134
+ return true;
135
+ }
136
+ return collectCommandCandidates(input).some(commandLooksLikeBroadSearch);
137
+ }
89
138
  async function readHookInput() {
90
139
  let body = "";
91
140
  for await (const chunk of process.stdin) {
@@ -100,7 +149,7 @@ async function readHookInput() {
100
149
  return {};
101
150
  }
102
151
  }
103
- var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md. Read it before broad grep/glob searching.";
152
+ var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md, or at $SWARMVAULT_OUT/wiki/graph/report.md when SWARMVAULT_OUT is set. Read it before broad grep/glob searching.";
104
153
 
105
154
  // src/hooks/claude.ts
106
155
  var AGENT_KEY = "claude";
@@ -126,13 +175,12 @@ async function main() {
126
175
  });
127
176
  process.exit(0);
128
177
  }
129
- const toolName = resolveToolName(input);
130
178
  if (collectCandidatePaths(input).some((value) => isReportPath(value, cwd))) {
131
179
  await markReportRead(cwd, AGENT_KEY);
132
180
  emit({});
133
181
  process.exit(0);
134
182
  }
135
- if (isBroadSearchTool(toolName) && !await hasSeenReport(cwd, AGENT_KEY)) {
183
+ if (isBroadSearchInput(input) && !await hasSeenReport(cwd, AGENT_KEY)) {
136
184
  emit({
137
185
  hookSpecificOutput: {
138
186
  hookEventName: "PreToolUse",
@@ -23,7 +23,7 @@ function isReportPath(value, cwd) {
23
23
  if (normalized.endsWith(reportNormalized)) {
24
24
  return true;
25
25
  }
26
- return path.resolve(cwd, value) === path.resolve(cwd, reportSuffix);
26
+ return path.resolve(cwd, value) === reportPath(cwd);
27
27
  }
28
28
  function collectCandidatePaths(node, acc = []) {
29
29
  if (typeof node === "string") {
@@ -59,12 +59,22 @@ function resolveToolName(input) {
59
59
  }
60
60
  async function hasReport(cwd) {
61
61
  try {
62
- await fs.access(path.join(cwd, "wiki", "graph", "report.md"));
62
+ await fs.access(reportPath(cwd));
63
63
  return true;
64
64
  } catch {
65
65
  return false;
66
66
  }
67
67
  }
68
+ function artifactRootDir(cwd) {
69
+ const override = process.env.SWARMVAULT_OUT?.trim();
70
+ if (!override) {
71
+ return path.resolve(cwd);
72
+ }
73
+ return path.isAbsolute(override) ? path.resolve(override) : path.resolve(cwd, override);
74
+ }
75
+ function reportPath(cwd) {
76
+ return path.join(artifactRootDir(cwd), "wiki", "graph", "report.md");
77
+ }
68
78
  async function markReportRead(cwd, agentKey) {
69
79
  const state = markerState(cwd, agentKey);
70
80
  await fs.mkdir(state.dir, { recursive: true });
@@ -139,7 +149,7 @@ async function readHookInput() {
139
149
  return {};
140
150
  }
141
151
  }
142
- var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md. Read it before broad grep/glob searching.";
152
+ var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md, or at $SWARMVAULT_OUT/wiki/graph/report.md when SWARMVAULT_OUT is set. Read it before broad grep/glob searching.";
143
153
 
144
154
  // src/hooks/codex.ts
145
155
  var AGENT_KEY = "codex";
@@ -23,7 +23,7 @@ function isReportPath(value, cwd) {
23
23
  if (normalized.endsWith(reportNormalized)) {
24
24
  return true;
25
25
  }
26
- return path.resolve(cwd, value) === path.resolve(cwd, reportSuffix);
26
+ return path.resolve(cwd, value) === reportPath(cwd);
27
27
  }
28
28
  function collectCandidatePaths(node, acc = []) {
29
29
  if (typeof node === "string") {
@@ -59,12 +59,22 @@ function resolveToolName(input) {
59
59
  }
60
60
  async function hasReport(cwd) {
61
61
  try {
62
- await fs.access(path.join(cwd, "wiki", "graph", "report.md"));
62
+ await fs.access(reportPath(cwd));
63
63
  return true;
64
64
  } catch {
65
65
  return false;
66
66
  }
67
67
  }
68
+ function artifactRootDir(cwd) {
69
+ const override = process.env.SWARMVAULT_OUT?.trim();
70
+ if (!override) {
71
+ return path.resolve(cwd);
72
+ }
73
+ return path.isAbsolute(override) ? path.resolve(override) : path.resolve(cwd, override);
74
+ }
75
+ function reportPath(cwd) {
76
+ return path.join(artifactRootDir(cwd), "wiki", "graph", "report.md");
77
+ }
68
78
  async function markReportRead(cwd, agentKey) {
69
79
  const state = markerState(cwd, agentKey);
70
80
  await fs.mkdir(state.dir, { recursive: true });
@@ -100,7 +110,7 @@ async function readHookInput() {
100
110
  return {};
101
111
  }
102
112
  }
103
- var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md. Read it before broad grep/glob searching.";
113
+ var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md, or at $SWARMVAULT_OUT/wiki/graph/report.md when SWARMVAULT_OUT is set. Read it before broad grep/glob searching.";
104
114
 
105
115
  // src/hooks/copilot.ts
106
116
  var AGENT_KEY = "copilot";
@@ -23,7 +23,7 @@ function isReportPath(value, cwd) {
23
23
  if (normalized.endsWith(reportNormalized)) {
24
24
  return true;
25
25
  }
26
- return path.resolve(cwd, value) === path.resolve(cwd, reportSuffix);
26
+ return path.resolve(cwd, value) === reportPath(cwd);
27
27
  }
28
28
  function collectCandidatePaths(node, acc = []) {
29
29
  if (typeof node === "string") {
@@ -59,12 +59,22 @@ function resolveToolName(input) {
59
59
  }
60
60
  async function hasReport(cwd) {
61
61
  try {
62
- await fs.access(path.join(cwd, "wiki", "graph", "report.md"));
62
+ await fs.access(reportPath(cwd));
63
63
  return true;
64
64
  } catch {
65
65
  return false;
66
66
  }
67
67
  }
68
+ function artifactRootDir(cwd) {
69
+ const override = process.env.SWARMVAULT_OUT?.trim();
70
+ if (!override) {
71
+ return path.resolve(cwd);
72
+ }
73
+ return path.isAbsolute(override) ? path.resolve(override) : path.resolve(cwd, override);
74
+ }
75
+ function reportPath(cwd) {
76
+ return path.join(artifactRootDir(cwd), "wiki", "graph", "report.md");
77
+ }
68
78
  async function markReportRead(cwd, agentKey) {
69
79
  const state = markerState(cwd, agentKey);
70
80
  await fs.mkdir(state.dir, { recursive: true });
@@ -100,7 +110,7 @@ async function readHookInput() {
100
110
  return {};
101
111
  }
102
112
  }
103
- var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md. Read it before broad grep/glob searching.";
113
+ var REPORT_NOTE = "SwarmVault graph report exists at wiki/graph/report.md, or at $SWARMVAULT_OUT/wiki/graph/report.md when SWARMVAULT_OUT is set. Read it before broad grep/glob searching.";
104
114
 
105
115
  // src/hooks/gemini.ts
106
116
  var AGENT_KEY = "gemini";
package/dist/index.d.ts CHANGED
@@ -116,13 +116,13 @@ type GuidedSourceSessionStatus = "awaiting_input" | "ready_to_stage" | "staged"
116
116
  type VaultProfilePreset = "reader" | "timeline" | "diligence" | "thesis";
117
117
  type VaultDashboardPack = "default" | "reader" | "diligence";
118
118
  type GuidedSessionMode = "insights_only" | "canonical_review";
119
- type SourceKind = "markdown" | "text" | "pdf" | "image" | "html" | "docx" | "epub" | "csv" | "xlsx" | "pptx" | "odt" | "odp" | "ods" | "jupyter" | "data" | "bibtex" | "rtf" | "org" | "asciidoc" | "transcript" | "chat_export" | "email" | "calendar" | "audio" | "youtube" | "binary" | "code";
119
+ type SourceKind = "markdown" | "text" | "pdf" | "image" | "html" | "docx" | "epub" | "csv" | "xlsx" | "pptx" | "odt" | "odp" | "ods" | "jupyter" | "data" | "bibtex" | "rtf" | "org" | "asciidoc" | "transcript" | "chat_export" | "email" | "calendar" | "audio" | "video" | "youtube" | "binary" | "code";
120
120
  type SourceCaptureType = "arxiv" | "doi" | "tweet" | "article" | "url";
121
121
  type SourceClass = "first_party" | "third_party" | "resource" | "generated";
122
122
  type ManagedSourceKind = "directory" | "file" | "github_repo" | "crawl_url";
123
123
  type ManagedSourceStatus = "ready" | "missing" | "error";
124
- type CodeLanguage = "javascript" | "jsx" | "typescript" | "tsx" | "bash" | "python" | "go" | "rust" | "java" | "kotlin" | "scala" | "dart" | "lua" | "zig" | "csharp" | "c" | "cpp" | "php" | "ruby" | "powershell" | "swift" | "elixir" | "ocaml" | "objc" | "rescript" | "solidity" | "html" | "css" | "vue";
125
- type CodeSymbolKind = "function" | "class" | "interface" | "type_alias" | "enum" | "variable" | "struct" | "trait";
124
+ type CodeLanguage = "javascript" | "jsx" | "typescript" | "tsx" | "bash" | "python" | "go" | "rust" | "java" | "kotlin" | "scala" | "dart" | "lua" | "zig" | "csharp" | "c" | "cpp" | "php" | "ruby" | "powershell" | "swift" | "elixir" | "ocaml" | "objc" | "rescript" | "solidity" | "html" | "css" | "vue" | "svelte" | "julia" | "verilog" | "systemverilog" | "r" | "sql";
125
+ type CodeSymbolKind = "function" | "class" | "interface" | "type_alias" | "enum" | "variable" | "struct" | "trait" | "table" | "view";
126
126
  type OrchestrationRole = "research" | "audit" | "context" | "safety";
127
127
  declare const webSearchProviderTypeSchema: z.ZodEnum<{
128
128
  custom: "custom";
@@ -447,6 +447,7 @@ interface PromotionSession {
447
447
  }
448
448
  interface ResolvedPaths {
449
449
  rootDir: string;
450
+ artifactRootDir: string;
450
451
  schemaPath: string;
451
452
  rawDir: string;
452
453
  rawSourcesDir: string;
@@ -489,7 +490,7 @@ interface SourceAttachment {
489
490
  mimeType: string;
490
491
  originalPath?: string;
491
492
  }
492
- type ExtractionKind = "plain_text" | "html_readability" | "pdf_text" | "docx_text" | "epub_text" | "csv_text" | "xlsx_text" | "pptx_text" | "odt_text" | "odp_text" | "ods_text" | "jupyter_text" | "structured_data" | "bibtex_text" | "rtf_text" | "org_text" | "asciidoc_text" | "transcript_text" | "chat_export_text" | "email_text" | "calendar_text" | "image_vision" | "audio_transcription" | "youtube_transcript";
493
+ type ExtractionKind = "plain_text" | "html_readability" | "pdf_text" | "docx_text" | "epub_text" | "csv_text" | "xlsx_text" | "pptx_text" | "odt_text" | "odp_text" | "ods_text" | "jupyter_text" | "structured_data" | "bibtex_text" | "rtf_text" | "org_text" | "asciidoc_text" | "transcript_text" | "chat_export_text" | "email_text" | "calendar_text" | "image_vision" | "audio_transcription" | "video_transcription" | "youtube_transcript";
493
494
  interface ExtractionTerm {
494
495
  name: string;
495
496
  description: string;
@@ -528,6 +529,8 @@ interface IngestOptions {
528
529
  exclude?: string[];
529
530
  maxFiles?: number;
530
531
  gitignore?: boolean;
532
+ swarmvaultignore?: boolean;
533
+ video?: boolean;
531
534
  extractClasses?: SourceClass[];
532
535
  resume?: string;
533
536
  /**
@@ -620,6 +623,9 @@ interface ManagedSourceRecord {
620
623
  path?: string;
621
624
  repoRoot?: string;
622
625
  url?: string;
626
+ branch?: string;
627
+ ref?: string;
628
+ checkoutDir?: string;
623
629
  createdAt: string;
624
630
  updatedAt: string;
625
631
  status: ManagedSourceStatus;
@@ -676,6 +682,12 @@ interface CodeSymbol {
676
682
  extends: string[];
677
683
  implements: string[];
678
684
  }
685
+ interface CodeRelation {
686
+ sourceName?: string;
687
+ targetName: string;
688
+ relation: string;
689
+ confidence?: number;
690
+ }
679
691
  interface CodeAnalysis {
680
692
  moduleId: string;
681
693
  language: CodeLanguage;
@@ -686,6 +698,7 @@ interface CodeAnalysis {
686
698
  symbols: CodeSymbol[];
687
699
  exports: string[];
688
700
  diagnostics: CodeDiagnostic[];
701
+ relations?: CodeRelation[];
689
702
  }
690
703
  interface SourceRationale {
691
704
  id: string;
@@ -892,6 +905,14 @@ interface GraphStatsResult {
892
905
  edgeRelations: Record<string, number>;
893
906
  hyperedgeRelations: Record<string, number>;
894
907
  }
908
+ interface GraphClusterRefreshResult {
909
+ graphPath: string;
910
+ nodeCount: number;
911
+ edgeCount: number;
912
+ communityCount: number;
913
+ changedPages: string[];
914
+ reportPath: string;
915
+ }
895
916
  interface GraphCommunityResult {
896
917
  generatedAt: string;
897
918
  id: string;
@@ -1453,6 +1474,21 @@ interface WatchOptions {
1453
1474
  repo?: boolean;
1454
1475
  codeOnly?: boolean;
1455
1476
  overrideRoots?: string[];
1477
+ force?: boolean;
1478
+ maxGraphShrinkRatio?: number;
1479
+ }
1480
+ interface GraphShrinkDimension {
1481
+ before: number;
1482
+ after: number;
1483
+ dropped: number;
1484
+ dropRatio: number;
1485
+ }
1486
+ interface GraphShrinkGuardResult {
1487
+ blocked: boolean;
1488
+ threshold: number;
1489
+ nodes: GraphShrinkDimension;
1490
+ edges: GraphShrinkDimension;
1491
+ message?: string;
1456
1492
  }
1457
1493
  interface PendingSemanticRefreshEntry {
1458
1494
  id: string;
@@ -1501,6 +1537,28 @@ interface WatchStatusResult {
1501
1537
  lastRun?: WatchRunRecord;
1502
1538
  pendingSemanticRefresh: PendingSemanticRefreshEntry[];
1503
1539
  }
1540
+ interface GraphStatusChange {
1541
+ path: string;
1542
+ repoRoot: string;
1543
+ changeType: "added" | "modified" | "removed";
1544
+ sourceId?: string;
1545
+ sourceKind?: SourceKind;
1546
+ refreshType: "code" | "semantic";
1547
+ }
1548
+ interface GraphStatusResult {
1549
+ generatedAt: string;
1550
+ graphExists: boolean;
1551
+ graphPath: string;
1552
+ reportExists: boolean;
1553
+ reportPath: string;
1554
+ trackedRepoRoots: string[];
1555
+ codeChangeCount: number;
1556
+ semanticChangeCount: number;
1557
+ pendingSemanticRefresh: PendingSemanticRefreshEntry[];
1558
+ stale: boolean;
1559
+ recommendedCommand: string | null;
1560
+ changes: GraphStatusChange[];
1561
+ }
1504
1562
  interface WatchController {
1505
1563
  close(): Promise<void>;
1506
1564
  }
@@ -1521,6 +1579,9 @@ interface ManagedSourceAddOptions {
1521
1579
  guideAnswers?: GuidedSourceSessionAnswers;
1522
1580
  maxPages?: number;
1523
1581
  maxDepth?: number;
1582
+ branch?: string;
1583
+ ref?: string;
1584
+ checkoutDir?: string;
1524
1585
  }
1525
1586
  interface ManagedSourceReloadOptions extends ManagedSourceAddOptions {
1526
1587
  id?: string;
@@ -2127,9 +2188,11 @@ declare function autoCommitWikiChanges(rootDir: string, operation: string, detai
2127
2188
  declare const DEFAULT_PROMOTION_CONFIG: CandidatePromotionConfig;
2128
2189
  declare function evaluateCandidateForPromotion(page: GraphPage, graph: GraphArtifact, history: CompileState["candidateHistory"] | undefined, config: CandidatePromotionConfig, now?: number): PromotionDecision;
2129
2190
 
2191
+ declare const SWARMVAULT_OUT_ENV = "SWARMVAULT_OUT";
2130
2192
  declare function defaultVaultConfig(profile?: VaultProfileConfig): VaultConfig;
2131
2193
  declare function defaultVaultSchema(profile?: string | VaultProfileConfig): string;
2132
2194
  declare function resolvePaths(rootDir: string, config?: VaultConfig, configPath?: string, schemaPath?: string): ResolvedPaths;
2195
+ declare function resolveArtifactRootDir(rootDir: string): string;
2133
2196
  declare function loadVaultConfig(rootDir: string): Promise<{
2134
2197
  config: VaultConfig;
2135
2198
  paths: ResolvedPaths;
@@ -2354,6 +2417,24 @@ declare function exportGraphReportHtml(rootDir: string, outputPath: string): Pro
2354
2417
  declare function exportObsidianVault(rootDir: string, outputDir: string): Promise<GraphExportResult>;
2355
2418
  declare function exportObsidianCanvas(rootDir: string, outputPath: string): Promise<GraphExportResult>;
2356
2419
 
2420
+ interface GraphMergeInputSummary {
2421
+ path: string;
2422
+ label: string;
2423
+ format: "swarmvault" | "node-link";
2424
+ nodeCount: number;
2425
+ edgeCount: number;
2426
+ }
2427
+ interface GraphMergeOptions {
2428
+ label?: string;
2429
+ }
2430
+ interface GraphMergeResult {
2431
+ outputPath: string;
2432
+ graph: GraphArtifact;
2433
+ inputGraphs: GraphMergeInputSummary[];
2434
+ warnings: string[];
2435
+ }
2436
+ declare function mergeGraphFiles(inputPaths: string[], outputPath: string, options?: GraphMergeOptions): Promise<GraphMergeResult>;
2437
+
2357
2438
  type PushDriverLike = {
2358
2439
  session(options: {
2359
2440
  database: string;
@@ -2381,6 +2462,10 @@ declare function renderGraphShareSvg(artifact: GraphShareArtifact): string;
2381
2462
  declare function renderGraphSharePreviewHtml(artifact: GraphShareArtifact): string;
2382
2463
  declare function renderGraphShareBundleFiles(artifact: GraphShareArtifact): GraphShareBundleFile[];
2383
2464
 
2465
+ declare function getGraphStatus(rootDir: string, options?: {
2466
+ repoRoots?: string[];
2467
+ }): Promise<GraphStatusResult>;
2468
+
2384
2469
  declare function graphDiff(oldGraph: GraphArtifact, newGraph: GraphArtifact): GraphDiffResult;
2385
2470
  /**
2386
2471
  * Compute the blast radius of changing a file/module by tracing reverse import
@@ -2390,11 +2475,42 @@ declare function blastRadius(graph: GraphArtifact, target: string, options?: {
2390
2475
  maxDepth?: number;
2391
2476
  }): BlastRadiusResult;
2392
2477
 
2478
+ type GraphTreeNodeKind = "root" | "directory" | "source" | "module" | "symbol" | "rationale" | "node" | "more";
2479
+ interface GraphTreeNode {
2480
+ id: string;
2481
+ label: string;
2482
+ kind: GraphTreeNodeKind;
2483
+ count: number;
2484
+ children: GraphTreeNode[];
2485
+ path?: string;
2486
+ sourceId?: string;
2487
+ nodeId?: string;
2488
+ language?: string;
2489
+ symbolKind?: CodeSymbolKind;
2490
+ hiddenChildren?: number;
2491
+ }
2492
+ interface GraphTreeOptions {
2493
+ label?: string;
2494
+ maxChildren?: number;
2495
+ }
2496
+ interface GraphTreeExportResult {
2497
+ outputPath: string;
2498
+ sourceCount: number;
2499
+ nodeCount: number;
2500
+ tree: GraphTreeNode;
2501
+ }
2502
+ declare function buildGraphTree(graph: GraphArtifact, options?: GraphTreeOptions & {
2503
+ rootDir?: string;
2504
+ }): GraphTreeNode;
2505
+ declare function renderGraphTreeHtml(tree: GraphTreeNode, graph: GraphArtifact): string;
2506
+ declare function exportGraphTree(rootDir: string, outputPath?: string, options?: GraphTreeOptions): Promise<GraphTreeExportResult>;
2507
+
2393
2508
  declare function getGitHookStatus(rootDir: string): Promise<GitHookStatus>;
2394
2509
  declare function installGitHooks(rootDir: string): Promise<GitHookStatus>;
2395
2510
  declare function uninstallGitHooks(rootDir: string): Promise<GitHookStatus>;
2396
2511
 
2397
2512
  declare function listTrackedRepoRoots(rootDir: string): Promise<string[]>;
2513
+ declare function checkTrackedRepoChanges(rootDir: string, repoRoots?: string[]): Promise<GraphStatusChange[]>;
2398
2514
  declare function syncTrackedRepos(rootDir: string, options?: IngestOptions, repoRoots?: string[]): Promise<RepoSyncResult>;
2399
2515
  declare function syncTrackedReposForWatch(rootDir: string, options?: IngestOptions, repoRoots?: string[]): Promise<WatchRepoSyncResult>;
2400
2516
  declare function ingestInputDetailed(rootDir: string, input: string, options?: IngestOptions): Promise<InputIngestResult>;
@@ -2917,6 +3033,9 @@ declare function pathGraphVault(rootDir: string, from: string, to: string): Prom
2917
3033
  declare function explainGraphVault(rootDir: string, target: string): Promise<GraphExplainResult>;
2918
3034
  declare function listGraphHyperedges(rootDir: string, target?: string, limit?: number): Promise<GraphHyperedge[]>;
2919
3035
  declare function graphStatsVault(rootDir: string): Promise<GraphStatsResult>;
3036
+ declare function refreshGraphClusters(rootDir: string, options?: {
3037
+ resolution?: number;
3038
+ }): Promise<GraphClusterRefreshResult>;
2920
3039
  declare function getGraphCommunityVault(rootDir: string, target: string, limit?: number): Promise<GraphCommunityResult>;
2921
3040
  declare function readGraphReport(rootDir: string): Promise<GraphReportArtifact | null>;
2922
3041
  declare function listGodNodes(rootDir: string, limit?: number): Promise<GraphNode[]>;
@@ -2966,6 +3085,9 @@ declare function exportGraphHtml(rootDir: string, outputPath: string, options?:
2966
3085
  full?: boolean;
2967
3086
  }): Promise<string>;
2968
3087
 
3088
+ declare function evaluateGraphShrinkGuard(previousGraph: GraphArtifact | null | undefined, nextGraph: GraphArtifact | null | undefined, options?: {
3089
+ threshold?: number;
3090
+ }): GraphShrinkGuardResult;
2969
3091
  type WatchCycleResult = {
2970
3092
  watchedRepoRoots: string[];
2971
3093
  importedCount: number;
@@ -3017,4 +3139,4 @@ declare function createWebSearchAdapter(id: string, config: WebSearchProviderCon
3017
3139
  type WebSearchTaskId = "deepLintProvider" | "queryProvider" | "exploreProvider";
3018
3140
  declare function getWebSearchAdapterForTask(rootDir: string, task: WebSearchTaskId): Promise<WebSearchAdapter>;
3019
3141
 
3020
- export { ALL_MIGRATIONS, type AddOptions, type AddResult, type AgentMemoryDecision, type AgentMemoryNote, type AgentMemoryResumeFormat, type AgentMemoryTask, type AgentMemoryTaskResult, type AgentMemoryTaskStatus, type AgentMemoryTaskSummary, type AgentType, type AnalyzedTerm, type ApprovalBundleType, type ApprovalChangeType, type ApprovalDetail, type ApprovalDiffHunk, type ApprovalDiffLine, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryLabel, type ApprovalEntryStatus, type ApprovalFrontmatterChange, type ApprovalManifest, type ApprovalStructuredDiff, type ApprovalSummary, type AudioTranscriptionRequest, type AudioTranscriptionResponse, type BenchmarkArtifact, type BenchmarkByClassEntry, type BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type BlastRadiusResult, type BuildContextPackOptions, type BuildContextPackResult, type CandidatePromotionConfig, type CandidateRecord, type ChartDatum, type ChartSpec, type ClaimStatus, type CodeAnalysis, type CodeDiagnostic, type CodeImport, type CodeIndexArtifact, type CodeIndexEntry, type CodeLanguage, type CodeSymbol, type CodeSymbolKind, type CommandRoleExecutorConfig, type CompileOptions, type CompileResult, type CompileState, type ConsolidationConfig, type ConsolidationPromotion, type ConsolidationResult, type ContextPack, type ContextPackFormat, type ContextPackItem, type ContextPackItemKind, type ContextPackOmittedItem, type ContextPackSummary, DEFAULT_CONSOLIDATION_CONFIG, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HALF_LIFE_DAYS_BY_SOURCE_CLASS, DEFAULT_PROMOTION_CONFIG, DEFAULT_REDACTION_PATTERNS, DEFAULT_STALE_THRESHOLD, type DegradationOutcome, type DirectoryIngestFailure, type DirectoryIngestResult, type DirectoryIngestSkip, type EmbeddingCacheArtifact, type EmbeddingCacheEntry, type EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type ExtractionClaim, type ExtractionKind, type ExtractionTerm, type FinishMemoryTaskOptions, type Freshness, type FreshnessConfig, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, type GraphCommunityResult, type GraphDiffResult, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphExportFormat, type GraphExportResult, type GraphHyperedge, type GraphNode, type GraphPage, type GraphPathResult, type GraphPushCounts, type GraphPushNeo4jOptions, type GraphPushResult, type GraphQueryMatch, type GraphQueryResult, type GraphReportArtifact, type GraphShareArtifact, type GraphShareBundleFile, type GraphStatsResult, type GuidedSessionMode, type GuidedSourceSessionAnswers, type GuidedSourceSessionQuestion, type GuidedSourceSessionRecord, type GuidedSourceSessionStatus, type ImageGenerationRequest, type ImageGenerationResponse, type ImageVisionExtraction, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, type InputIngestResult, type InstallAgentOptions, type InstallAgentResult, LARGE_REPO_NODE_THRESHOLD, LOCAL_WHISPER_MODEL_SIZES, type LintFinding, type LintOptions, type LocalWhisperAdapterOptions, type LocalWhisperBinaryDiscovery, LocalWhisperProviderAdapter, type LocalWhisperSetupStatus, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type MemoryTier, type MigrationPlan, type MigrationResult, type MigrationStep, type Neo4jGraphSinkConfig, OPENAI_COMPATIBLE_CAPABILITY_MATRIX, type OpenAiCompatiblePresetId, type OrchestrationConfig, type OrchestrationFinding, type OrchestrationProposal, type OrchestrationRole, type OrchestrationRoleConfig, type OrchestrationRoleResult, type OutputAsset, type OutputAssetRole, type OutputFormat, type OutputOrigin, type PageKind, type PageManager, type PageStatus, type PendingSemanticRefreshEntry, type Polarity, type PromotionDecision, type PromotionGateKind, type PromotionGateResult, type PromotionSession, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderPresetCapability, type ProviderRegistrationOptions, type ProviderRegistrationResult, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RedactionMatchSummary, type RedactionPatternConfig, type RedactionSettings, type RedactionSummary, type RepoSyncResult, type ResolvedLargeRepoDefaults, type ResolvedPaths, type ResumeMemoryTaskOptions, type ResumeMemoryTaskResult, type RetrievalConfig, type RetrievalDoctorResult, type RetrievalManifest, type RetrievalStatus, type ReviewActionResult, type RoleExecutorConfig, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, type ScheduledConsolidateTask, type ScheduledExploreTask, type ScheduledLintTask, type ScheduledQueryTask, type ScheduledRunResult, type ScheduledTaskConfig, type SearchResult, type SourceAnalysis, type SourceAttachment, type SourceCaptureType, type SourceClaim, type SourceClass, type SourceExtractionArtifact, type SourceGuideResult, type SourceKind, type SourceManifest, type SourceRationale, type SourceReviewResult, type StartMemoryTaskOptions, type SynthesizedHubEdge, type SynthesizedHubNode, type SynthesizedHyperedgeHubs, type UpdateMemoryTaskOptions, type VaultConfig, type VaultDashboardPack, type VaultDoctorAction, type VaultDoctorCheck, type VaultDoctorCounts, type VaultDoctorRecommendation, type VaultDoctorRecommendationPriority, type VaultDoctorReport, type VaultDoctorSafeAction, type VaultDoctorStatus, type VaultProfileConfig, type VaultProfilePreset, type VaultVersionRecord, type WatchConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, type WhisperRunResult, type WhisperRunner, acceptApproval, addInput, addManagedSource, addWatchedRoot, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildContextPack, buildGraphShareArtifact, buildMemoryGraphElements, buildRedactor, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteContextPack, deleteManagedSource, detectVaultVersion, discoverLocalWhisperBinary, doctorRetrieval, doctorVault, downloadWhisperModel, ensureMemoryLedger, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, expectedModelPath, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, exportGraphReportHtml, exportObsidianCanvas, exportObsidianVault, finishMemoryTask, getGitHookStatus, getGraphCommunityVault, getProviderForTask, getRetrievalStatus, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, graphDiff, graphStatsVault, guideManagedSource, guideSourceScope, importInbox, ingestDirectory, ingestInput, ingestInputDetailed, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listContextPacks, listGodNodes, listGraphHyperedges, listManagedSourceRecords, listManifests, listMemoryTasks, listPages, listSchedules, listTrackedRepoRoots, listWatchedRoots, loadMemoryTaskPages, loadVaultConfig, loadVaultSchema, loadVaultSchemas, lookupPresetCapabilities, markSuperseded, memoryTaskHashes, modelDownloadUrl, pathGraphVault, persistDecayFrontmatter, planMigration, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readContextPack, readExtractedText, readGraphReport, readMemoryTask, readPage, rebuildRetrievalIndex, registerLocalWhisperProvider, rejectApproval, reloadManagedSources, removeWatchedRoot, renderContextPackLlms, renderContextPackMarkdown, renderGraphShareBundleFiles, renderGraphShareMarkdown, renderGraphSharePreviewHtml, renderGraphShareSvg, renderMemoryTaskMarkdown, resetDecay, resolveConsolidationConfig, resolveDecayConfig, resolveLargeRepoDefaults, resolvePaths, resolveRedactionPatterns, resolveRetrievalConfig, resolveWatchedRepoRoots, resumeMemoryTask, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runMigration, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, startMemoryTask, summarizeLocalWhisperSetup, syncTrackedRepos, syncTrackedReposForWatch, synthesizeHyperedgeHubs, trimToTokenBudget, uninstallGitHooks, updateMemoryTask, watchVault, webSearchProviderTypeSchema, withCapabilityFallback, writeRetrievalManifest };
3142
+ export { ALL_MIGRATIONS, type AddOptions, type AddResult, type AgentMemoryDecision, type AgentMemoryNote, type AgentMemoryResumeFormat, type AgentMemoryTask, type AgentMemoryTaskResult, type AgentMemoryTaskStatus, type AgentMemoryTaskSummary, type AgentType, type AnalyzedTerm, type ApprovalBundleType, type ApprovalChangeType, type ApprovalDetail, type ApprovalDiffHunk, type ApprovalDiffLine, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryLabel, type ApprovalEntryStatus, type ApprovalFrontmatterChange, type ApprovalManifest, type ApprovalStructuredDiff, type ApprovalSummary, type AudioTranscriptionRequest, type AudioTranscriptionResponse, type BenchmarkArtifact, type BenchmarkByClassEntry, type BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type BlastRadiusResult, type BuildContextPackOptions, type BuildContextPackResult, type CandidatePromotionConfig, type CandidateRecord, type ChartDatum, type ChartSpec, type ClaimStatus, type CodeAnalysis, type CodeDiagnostic, type CodeImport, type CodeIndexArtifact, type CodeIndexEntry, type CodeLanguage, type CodeRelation, type CodeSymbol, type CodeSymbolKind, type CommandRoleExecutorConfig, type CompileOptions, type CompileResult, type CompileState, type ConsolidationConfig, type ConsolidationPromotion, type ConsolidationResult, type ContextPack, type ContextPackFormat, type ContextPackItem, type ContextPackItemKind, type ContextPackOmittedItem, type ContextPackSummary, DEFAULT_CONSOLIDATION_CONFIG, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HALF_LIFE_DAYS_BY_SOURCE_CLASS, DEFAULT_PROMOTION_CONFIG, DEFAULT_REDACTION_PATTERNS, DEFAULT_STALE_THRESHOLD, type DegradationOutcome, type DirectoryIngestFailure, type DirectoryIngestResult, type DirectoryIngestSkip, type EmbeddingCacheArtifact, type EmbeddingCacheEntry, type EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type ExtractionClaim, type ExtractionKind, type ExtractionTerm, type FinishMemoryTaskOptions, type Freshness, type FreshnessConfig, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, type GraphClusterRefreshResult, type GraphCommunityResult, type GraphDiffResult, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphExportFormat, type GraphExportResult, type GraphHyperedge, type GraphNode, type GraphPage, type GraphPathResult, type GraphPushCounts, type GraphPushNeo4jOptions, type GraphPushResult, type GraphQueryMatch, type GraphQueryResult, type GraphReportArtifact, type GraphShareArtifact, type GraphShareBundleFile, type GraphShrinkDimension, type GraphShrinkGuardResult, type GraphStatsResult, type GraphStatusChange, type GraphStatusResult, type GuidedSessionMode, type GuidedSourceSessionAnswers, type GuidedSourceSessionQuestion, type GuidedSourceSessionRecord, type GuidedSourceSessionStatus, type ImageGenerationRequest, type ImageGenerationResponse, type ImageVisionExtraction, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, type InputIngestResult, type InstallAgentOptions, type InstallAgentResult, LARGE_REPO_NODE_THRESHOLD, LOCAL_WHISPER_MODEL_SIZES, type LintFinding, type LintOptions, type LocalWhisperAdapterOptions, type LocalWhisperBinaryDiscovery, LocalWhisperProviderAdapter, type LocalWhisperSetupStatus, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type MemoryTier, type MigrationPlan, type MigrationResult, type MigrationStep, type Neo4jGraphSinkConfig, OPENAI_COMPATIBLE_CAPABILITY_MATRIX, type OpenAiCompatiblePresetId, type OrchestrationConfig, type OrchestrationFinding, type OrchestrationProposal, type OrchestrationRole, type OrchestrationRoleConfig, type OrchestrationRoleResult, type OutputAsset, type OutputAssetRole, type OutputFormat, type OutputOrigin, type PageKind, type PageManager, type PageStatus, type PendingSemanticRefreshEntry, type Polarity, type PromotionDecision, type PromotionGateKind, type PromotionGateResult, type PromotionSession, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderPresetCapability, type ProviderRegistrationOptions, type ProviderRegistrationResult, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RedactionMatchSummary, type RedactionPatternConfig, type RedactionSettings, type RedactionSummary, type RepoSyncResult, type ResolvedLargeRepoDefaults, type ResolvedPaths, type ResumeMemoryTaskOptions, type ResumeMemoryTaskResult, type RetrievalConfig, type RetrievalDoctorResult, type RetrievalManifest, type RetrievalStatus, type ReviewActionResult, type RoleExecutorConfig, SWARMVAULT_OUT_ENV, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, type ScheduledConsolidateTask, type ScheduledExploreTask, type ScheduledLintTask, type ScheduledQueryTask, type ScheduledRunResult, type ScheduledTaskConfig, type SearchResult, type SourceAnalysis, type SourceAttachment, type SourceCaptureType, type SourceClaim, type SourceClass, type SourceExtractionArtifact, type SourceGuideResult, type SourceKind, type SourceManifest, type SourceRationale, type SourceReviewResult, type StartMemoryTaskOptions, type SynthesizedHubEdge, type SynthesizedHubNode, type SynthesizedHyperedgeHubs, type UpdateMemoryTaskOptions, type VaultConfig, type VaultDashboardPack, type VaultDoctorAction, type VaultDoctorCheck, type VaultDoctorCounts, type VaultDoctorRecommendation, type VaultDoctorRecommendationPriority, type VaultDoctorReport, type VaultDoctorSafeAction, type VaultDoctorStatus, type VaultProfileConfig, type VaultProfilePreset, type VaultVersionRecord, type WatchConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, type WhisperRunResult, type WhisperRunner, acceptApproval, addInput, addManagedSource, addWatchedRoot, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildContextPack, buildGraphShareArtifact, buildGraphTree, buildMemoryGraphElements, buildRedactor, checkTrackedRepoChanges, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteContextPack, deleteManagedSource, detectVaultVersion, discoverLocalWhisperBinary, doctorRetrieval, doctorVault, downloadWhisperModel, ensureMemoryLedger, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, evaluateGraphShrinkGuard, expectedModelPath, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, exportGraphReportHtml, exportGraphTree, exportObsidianCanvas, exportObsidianVault, finishMemoryTask, getGitHookStatus, getGraphCommunityVault, getGraphStatus, getProviderForTask, getRetrievalStatus, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, graphDiff, graphStatsVault, guideManagedSource, guideSourceScope, importInbox, ingestDirectory, ingestInput, ingestInputDetailed, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listContextPacks, listGodNodes, listGraphHyperedges, listManagedSourceRecords, listManifests, listMemoryTasks, listPages, listSchedules, listTrackedRepoRoots, listWatchedRoots, loadMemoryTaskPages, loadVaultConfig, loadVaultSchema, loadVaultSchemas, lookupPresetCapabilities, markSuperseded, memoryTaskHashes, mergeGraphFiles, modelDownloadUrl, pathGraphVault, persistDecayFrontmatter, planMigration, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readContextPack, readExtractedText, readGraphReport, readMemoryTask, readPage, rebuildRetrievalIndex, refreshGraphClusters, registerLocalWhisperProvider, rejectApproval, reloadManagedSources, removeWatchedRoot, renderContextPackLlms, renderContextPackMarkdown, renderGraphShareBundleFiles, renderGraphShareMarkdown, renderGraphSharePreviewHtml, renderGraphShareSvg, renderGraphTreeHtml, renderMemoryTaskMarkdown, resetDecay, resolveArtifactRootDir, resolveConsolidationConfig, resolveDecayConfig, resolveLargeRepoDefaults, resolvePaths, resolveRedactionPatterns, resolveRetrievalConfig, resolveWatchedRepoRoots, resumeMemoryTask, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runMigration, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, startMemoryTask, summarizeLocalWhisperSetup, syncTrackedRepos, syncTrackedReposForWatch, synthesizeHyperedgeHubs, trimToTokenBudget, uninstallGitHooks, updateMemoryTask, watchVault, webSearchProviderTypeSchema, withCapabilityFallback, writeRetrievalManifest };