@swarmvaultai/engine 0.9.0 → 0.10.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.
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
@@ -51,6 +51,17 @@ declare const agentTypeSchema: z.ZodEnum<{
51
51
  type AgentType = z.infer<typeof agentTypeSchema>;
52
52
  type PageKind = "index" | "source" | "module" | "concept" | "entity" | "output" | "insight" | "graph_report" | "community_summary";
53
53
  type Freshness = "fresh" | "stale";
54
+ /**
55
+ * Consolidation tier for insight pages (LLM Wiki v2 memory model).
56
+ * - `working`: raw recent observations from ad-hoc query/explore output.
57
+ * - `episodic`: session-scoped digest rolled up from multiple working pages.
58
+ * - `semantic`: cross-session durable facts repeated across episodic pages.
59
+ * - `procedural`: how-to workflows inferred from repeated sequences.
60
+ * Non-insight pages (sources, modules, concepts, entities, outputs) leave
61
+ * `tier` undefined. Pages without a `tier` field default to `working` when
62
+ * loaded so 0.9.0 vaults require no migration.
63
+ */
64
+ type MemoryTier = "working" | "episodic" | "semantic" | "procedural";
54
65
  type ClaimStatus = "extracted" | "inferred" | "conflicted" | "stale";
55
66
  type EvidenceClass = "extracted" | "inferred" | "ambiguous";
56
67
  type Polarity = "positive" | "negative" | "neutral";
@@ -233,6 +244,8 @@ interface VaultConfig {
233
244
  providers: Record<string, WebSearchProviderConfig>;
234
245
  tasks: {
235
246
  deepLintProvider: string;
247
+ queryProvider?: string;
248
+ exploreProvider?: string;
236
249
  };
237
250
  };
238
251
  search?: {
@@ -243,6 +256,72 @@ interface VaultConfig {
243
256
  candidate?: {
244
257
  autoPromote?: CandidatePromotionConfig;
245
258
  };
259
+ redaction?: RedactionSettings;
260
+ freshness?: FreshnessConfig;
261
+ consolidation?: ConsolidationConfig;
262
+ }
263
+ /**
264
+ * Heuristic configuration for the LLM Wiki v2 consolidation tier rollup.
265
+ *
266
+ * Defaults are baked in so 0.9.0 configs keep working without migration:
267
+ * - enabled: true
268
+ * - workingToEpisodic: { minPages: 3, sessionWindowHours: 24, minSharedNodeRatio: 0.3 }
269
+ * - episodicToSemantic: { minOccurrences: 3 }
270
+ * - semanticToProcedural: { minWorkflowSteps: 3 }
271
+ */
272
+ interface ConsolidationConfig {
273
+ enabled?: boolean;
274
+ workingToEpisodic?: {
275
+ minPages?: number;
276
+ sessionWindowHours?: number;
277
+ minSharedNodeRatio?: number;
278
+ };
279
+ episodicToSemantic?: {
280
+ minOccurrences?: number;
281
+ };
282
+ semanticToProcedural?: {
283
+ minWorkflowSteps?: number;
284
+ };
285
+ }
286
+ interface ConsolidationPromotion {
287
+ pageId: string;
288
+ fromTier: MemoryTier;
289
+ toTier: MemoryTier;
290
+ }
291
+ interface ConsolidationResult {
292
+ promoted: ConsolidationPromotion[];
293
+ newPages: GraphPage[];
294
+ decisions: string[];
295
+ }
296
+ interface FreshnessConfig {
297
+ /** Default half-life in days when the page's source class is unknown. Defaults to 365. */
298
+ defaultHalfLifeDays?: number;
299
+ /** Below this score a page is considered stale. Defaults to 0.3. */
300
+ staleThreshold?: number;
301
+ /** Per-source-class half-life overrides in days. */
302
+ halfLifeDaysBySourceClass?: Partial<Record<SourceClass, number>>;
303
+ }
304
+ interface RedactionPatternConfig {
305
+ id: string;
306
+ pattern: string;
307
+ flags?: string;
308
+ placeholder?: string;
309
+ description?: string;
310
+ }
311
+ interface RedactionSettings {
312
+ enabled?: boolean;
313
+ placeholder?: string;
314
+ useDefaults?: boolean;
315
+ patterns?: RedactionPatternConfig[];
316
+ }
317
+ interface RedactionMatchSummary {
318
+ patternId: string;
319
+ count: number;
320
+ }
321
+ interface RedactionSummary {
322
+ sourceId: string;
323
+ title: string;
324
+ matches: RedactionMatchSummary[];
246
325
  }
247
326
  interface CandidatePromotionConfig {
248
327
  enabled: boolean;
@@ -362,6 +441,13 @@ interface IngestOptions {
362
441
  gitignore?: boolean;
363
442
  extractClasses?: SourceClass[];
364
443
  resume?: string;
444
+ /**
445
+ * Override the config-level redaction flag for this run. Defaults to the
446
+ * effective value in `VaultConfig.redaction.enabled` (which itself defaults
447
+ * to `true` when the config block is absent). Pass `false` to skip
448
+ * redaction entirely for this run.
449
+ */
450
+ redact?: boolean;
365
451
  }
366
452
  interface DirectoryIngestSkip {
367
453
  path: string;
@@ -382,6 +468,11 @@ interface DirectoryIngestResult {
382
468
  failed?: DirectoryIngestFailure[];
383
469
  runId?: string;
384
470
  statePath?: string;
471
+ /**
472
+ * Per-source redaction counts surfaced to CLI/MCP callers. Empty when
473
+ * redaction was disabled or no matches were found on the ingested inputs.
474
+ */
475
+ redactions?: RedactionSummary[];
385
476
  }
386
477
  interface InputIngestResult {
387
478
  input: string;
@@ -391,6 +482,11 @@ interface InputIngestResult {
391
482
  unchanged: SourceManifest[];
392
483
  removed: SourceManifest[];
393
484
  skipped: DirectoryIngestSkip[];
485
+ /**
486
+ * Per-source redaction counts surfaced to CLI/MCP callers. Empty when
487
+ * redaction was disabled or no matches were found on the ingested inputs.
488
+ */
489
+ redactions?: RedactionSummary[];
394
490
  }
395
491
  interface SourceManifest {
396
492
  sourceId: string;
@@ -562,6 +658,17 @@ interface GraphNode {
562
658
  isGodNode?: boolean;
563
659
  tags?: string[];
564
660
  }
661
+ /**
662
+ * Graph edges use an open-string `relation` so new semantics can land
663
+ * without churning every consumer. Commonly produced relations include:
664
+ * - `mentions`, `contains_code`, `defines`, `exports`, `imports`,
665
+ * `contradicts`, `supports`, `builds_on`.
666
+ * - `superseded_by`: the source node/page has been replaced by the
667
+ * target. The older page is expected to carry `freshness: "stale"`
668
+ * and `supersededBy` pointing at the target page id. Compile,
669
+ * ingest, and human review can all produce this relation; lint
670
+ * surfaces broken supersession links.
671
+ */
565
672
  interface GraphEdge {
566
673
  id: string;
567
674
  source: string;
@@ -595,6 +702,26 @@ interface GraphPage {
595
702
  projectIds: string[];
596
703
  nodeIds: string[];
597
704
  freshness: Freshness;
705
+ /**
706
+ * Numeric freshness score in [0, 1] that decays over time based on the
707
+ * source-class half-life. `1` means fully fresh (just confirmed), `0`
708
+ * means fully decayed. Pages that predate decay tracking are treated as
709
+ * `1` so old vaults are not penalized. See `freshness.ts` for the decay
710
+ * function and thresholds.
711
+ */
712
+ decayScore?: number;
713
+ /**
714
+ * ISO timestamp of the last time compile or ingest confirmed this page
715
+ * against a live source/claim. Missing on pages that existed before
716
+ * decay tracking landed.
717
+ */
718
+ lastConfirmedAt?: string;
719
+ /**
720
+ * If set, this page has been superseded by another page. The value is
721
+ * the replacement page id. A matching `superseded_by` relation edge
722
+ * connects the old page's node to the replacement in the graph.
723
+ */
724
+ supersededBy?: string;
598
725
  status: PageStatus;
599
726
  confidence: number;
600
727
  backlinks: string[];
@@ -612,6 +739,24 @@ interface GraphPage {
612
739
  question?: string;
613
740
  outputFormat?: OutputFormat;
614
741
  outputAssets?: OutputAsset[];
742
+ /**
743
+ * Memory-tier assignment for insight pages. Undefined on non-insight
744
+ * pages. When an insight page on disk is missing this field, callers
745
+ * default it to `"working"` in memory; no on-disk migration happens.
746
+ */
747
+ tier?: MemoryTier;
748
+ /**
749
+ * Lower-tier page ids that were rolled up into this page during a
750
+ * consolidation pass. Populated only on pages produced by
751
+ * `runConsolidation` (episodic/semantic/procedural). Empty/undefined on
752
+ * working-tier or non-insight pages.
753
+ */
754
+ consolidatedFromPageIds?: string[];
755
+ /**
756
+ * Heuristic confidence (0..1) that the consolidation rollup is
757
+ * meaningful. Missing when the page was not produced by consolidation.
758
+ */
759
+ consolidationConfidence?: number;
615
760
  }
616
761
  interface GraphArtifact {
617
762
  generatedAt: string;
@@ -860,6 +1005,7 @@ interface QueryOptions {
860
1005
  save?: boolean;
861
1006
  format?: OutputFormat;
862
1007
  review?: boolean;
1008
+ gapFill?: boolean;
863
1009
  }
864
1010
  interface QueryResult {
865
1011
  answer: string;
@@ -1074,12 +1220,24 @@ interface LintOptions {
1074
1220
  deep?: boolean;
1075
1221
  web?: boolean;
1076
1222
  conflicts?: boolean;
1223
+ /**
1224
+ * When true, only decay-related lint rules run
1225
+ * (`decayed-pages`, `broken_supersession`, `inconsistent_decay`).
1226
+ */
1227
+ decay?: boolean;
1228
+ /**
1229
+ * When true, only consolidation-tier lint rules run
1230
+ * (`stale_working_tier`, `broken_consolidation_basis`,
1231
+ * `semantic_without_episodic_basis`).
1232
+ */
1233
+ tiers?: boolean;
1077
1234
  }
1078
1235
  interface ExploreOptions {
1079
1236
  question: string;
1080
1237
  steps?: number;
1081
1238
  format?: OutputFormat;
1082
1239
  review?: boolean;
1240
+ gapFill?: boolean;
1083
1241
  }
1084
1242
  interface ExploreStepResult {
1085
1243
  step: number;
@@ -1386,7 +1544,11 @@ interface ScheduledExploreTask {
1386
1544
  steps?: number;
1387
1545
  format?: OutputFormat;
1388
1546
  }
1389
- type ScheduledTaskConfig = ScheduledCompileTask | ScheduledLintTask | ScheduledQueryTask | ScheduledExploreTask;
1547
+ interface ScheduledConsolidateTask {
1548
+ type: "consolidate";
1549
+ dryRun?: boolean;
1550
+ }
1551
+ type ScheduledTaskConfig = ScheduledCompileTask | ScheduledLintTask | ScheduledQueryTask | ScheduledExploreTask | ScheduledConsolidateTask;
1390
1552
  interface ScheduleTriggerConfig {
1391
1553
  cron?: string;
1392
1554
  every?: string;
@@ -1484,6 +1646,147 @@ declare function initWorkspace(rootDir: string, options?: {
1484
1646
  paths: ResolvedPaths;
1485
1647
  }>;
1486
1648
 
1649
+ /**
1650
+ * LLM Wiki v2 consolidation tiers. This pass is a lightweight deterministic
1651
+ * rollup that groups working-tier insight pages into episodic digests and
1652
+ * episodic pages into semantic/procedural pages. The LLM provider (if any)
1653
+ * is only consulted for nicer titles and summaries — promotion decisions
1654
+ * themselves are heuristic so the pass works without any provider access.
1655
+ *
1656
+ * The function never deletes pages. Lower-tier pages that are rolled up get
1657
+ * a `supersededBy` pointer to the new higher-tier page. Consumers use
1658
+ * `tier` and `consolidatedFromPageIds` on the generated page to trace the
1659
+ * basis of every rollup.
1660
+ */
1661
+ declare const DEFAULT_CONSOLIDATION_CONFIG: Required<{
1662
+ enabled: boolean;
1663
+ workingToEpisodic: Required<NonNullable<ConsolidationConfig["workingToEpisodic"]>>;
1664
+ episodicToSemantic: Required<NonNullable<ConsolidationConfig["episodicToSemantic"]>>;
1665
+ semanticToProcedural: Required<NonNullable<ConsolidationConfig["semanticToProcedural"]>>;
1666
+ }>;
1667
+ interface RunConsolidationOptions {
1668
+ /** When true, compute decisions and return them without writing any files. */
1669
+ dryRun?: boolean;
1670
+ /** Fixed clock for deterministic tests. */
1671
+ now?: Date;
1672
+ }
1673
+ /**
1674
+ * Resolve the default-backed consolidation config. Missing/partial config
1675
+ * objects are treated as "use all defaults".
1676
+ */
1677
+ declare function resolveConsolidationConfig(config?: ConsolidationConfig): {
1678
+ enabled: boolean;
1679
+ workingToEpisodic: Required<NonNullable<ConsolidationConfig["workingToEpisodic"]>>;
1680
+ episodicToSemantic: Required<NonNullable<ConsolidationConfig["episodicToSemantic"]>>;
1681
+ semanticToProcedural: Required<NonNullable<ConsolidationConfig["semanticToProcedural"]>>;
1682
+ };
1683
+ declare function runConsolidation(rootDir: string, config?: ConsolidationConfig, provider?: ProviderAdapter, options?: RunConsolidationOptions): Promise<ConsolidationResult>;
1684
+
1685
+ /**
1686
+ * Decay and supersession helpers for the LLM Wiki v2 lifecycle layer.
1687
+ *
1688
+ * Pages accumulate a numeric `decayScore` (0..1) that ticks down over time
1689
+ * based on the elapsed days since `lastConfirmedAt`, controlled by a
1690
+ * source-class half-life. Decay never deletes or hides pages — it informs
1691
+ * ranking, lint, and UI prioritization. Callers are expected to:
1692
+ *
1693
+ * 1. Call `resetDecay` whenever compile or ingest confirms a page still
1694
+ * matches a live source/claim (e.g. same semantic hash reappears).
1695
+ * 2. Call `applyDecayToPages` at the end of a compile pass to recompute
1696
+ * `decayScore` and downgrade `freshness` below the threshold.
1697
+ * 3. Call `markSuperseded` when a newer page replaces an older one,
1698
+ * emitting a `superseded_by` edge alongside.
1699
+ *
1700
+ * Defaults (matching the A.3 feature spec):
1701
+ * - defaultHalfLifeDays = 365
1702
+ * - staleThreshold = 0.3
1703
+ * - halfLifeDaysBySourceClass = {
1704
+ * first_party: 365 (slow decay)
1705
+ * third_party: 90 (fast — deps churn)
1706
+ * resource: 730 (slowest — assets)
1707
+ * generated: 30 (fastest — build output)
1708
+ * }
1709
+ */
1710
+ declare const DEFAULT_HALF_LIFE_DAYS = 365;
1711
+ declare const DEFAULT_STALE_THRESHOLD = 0.3;
1712
+ declare const DEFAULT_HALF_LIFE_DAYS_BY_SOURCE_CLASS: Record<SourceClass, number>;
1713
+ interface DecayConfig {
1714
+ halfLifeDaysBySourceClass?: Partial<Record<SourceClass, number>>;
1715
+ defaultHalfLifeDays?: number;
1716
+ staleThreshold?: number;
1717
+ }
1718
+ interface ApplyDecayResult {
1719
+ updated: GraphPage[];
1720
+ markedStale: string[];
1721
+ }
1722
+ /**
1723
+ * Compute a numeric decay score using a straight exponential half-life model.
1724
+ *
1725
+ * score = 0.5 ^ (ageDays / halfLifeDays)
1726
+ *
1727
+ * `lastConfirmedAt` missing returns 1 so pages from pre-decay vaults are
1728
+ * not penalized until they are next reconfirmed. Future timestamps (clock
1729
+ * skew) also return 1.
1730
+ */
1731
+ declare function computeDecayScore(lastConfirmedAt: string | undefined, sourceClass: SourceClass | undefined, config: DecayConfig, now?: Date): number;
1732
+ /**
1733
+ * Recompute `decayScore` and `freshness` for the supplied pages. Pure
1734
+ * function: returns a new array and does not mutate the inputs. Pages
1735
+ * with `supersededBy` set stay `"stale"` regardless of score. Pages
1736
+ * above the threshold are upgraded back to `"fresh"` so re-confirmation
1737
+ * outside of compile (e.g. human review) can take effect.
1738
+ */
1739
+ declare function applyDecayToPages(pages: GraphPage[], config: DecayConfig, now?: Date): ApplyDecayResult;
1740
+ /**
1741
+ * Reset decay for a single page. Typically invoked when compile or
1742
+ * ingest observes the same source/claim signature as before, confirming
1743
+ * the page is still anchored in live evidence. Does not touch
1744
+ * `supersededBy`: if the page has been superseded it remains stale.
1745
+ */
1746
+ declare function resetDecay(page: GraphPage, now?: Date): GraphPage;
1747
+ /**
1748
+ * Mark an older page as superseded by a replacement. The caller is
1749
+ * responsible for emitting the `superseded_by` graph edge separately.
1750
+ */
1751
+ declare function markSuperseded(oldPage: GraphPage, newPageId: string, now?: Date): GraphPage;
1752
+ /**
1753
+ * Build a DecayConfig from the user-facing FreshnessConfig. Missing
1754
+ * fields fall back to defaults.
1755
+ */
1756
+ declare function resolveDecayConfig(config?: FreshnessConfig): DecayConfig;
1757
+ /**
1758
+ * Write decay/supersession frontmatter into every page's markdown file
1759
+ * on disk. Pages that do not live under `wikiDir` (e.g. ephemeral or
1760
+ * missing files) are skipped silently.
1761
+ */
1762
+ declare function persistDecayFrontmatter(wikiDir: string, pages: GraphPage[]): Promise<string[]>;
1763
+ /**
1764
+ * Full compile-time decay pass. For each live page:
1765
+ * - If the page was just produced by compile, reset decay to 1 and
1766
+ * stamp `lastConfirmedAt = now` (it has been re-confirmed by a
1767
+ * live analysis).
1768
+ * - Otherwise, recompute decay from the existing `lastConfirmedAt`.
1769
+ * - Downgrade freshness to "stale" when the score falls below the
1770
+ * configured threshold, upgrade it back to "fresh" when the score
1771
+ * recovers and the page is not superseded.
1772
+ *
1773
+ * Returns the updated pages so callers can update `graph.json`, plus
1774
+ * the paths of any page files whose frontmatter was rewritten on disk.
1775
+ */
1776
+ declare function runDecayPass(input: {
1777
+ wikiDir: string;
1778
+ graphPath: string;
1779
+ pages: GraphPage[];
1780
+ /** Pages (by id) that compile confirmed in this run. Their decay resets to 1. */
1781
+ confirmedPageIds: Iterable<string>;
1782
+ config?: FreshnessConfig;
1783
+ now?: Date;
1784
+ }): Promise<{
1785
+ pages: GraphPage[];
1786
+ updatedPaths: string[];
1787
+ markedStale: string[];
1788
+ }>;
1789
+
1487
1790
  declare function exportGraphFormat(rootDir: string, format: Exclude<GraphExportFormat, "html" | "report" | "obsidian" | "canvas">, outputPath: string): Promise<GraphExportResult>;
1488
1791
  declare function exportGraphReportHtml(rootDir: string, outputPath: string): Promise<GraphExportResult>;
1489
1792
  declare function exportObsidianVault(rootDir: string, outputDir: string): Promise<GraphExportResult>;
@@ -1539,6 +1842,70 @@ declare function createProvider(id: string, config: ProviderConfig, rootDir: str
1539
1842
  declare function getProviderForTask(rootDir: string, task: keyof Awaited<ReturnType<typeof loadVaultConfig>>["config"]["tasks"]): Promise<ProviderAdapter>;
1540
1843
  declare function assertProviderCapability(provider: ProviderAdapter, capability: ProviderCapability): void;
1541
1844
 
1845
+ interface RedactionPattern {
1846
+ id: string;
1847
+ pattern: RegExp | string;
1848
+ placeholder?: string;
1849
+ description?: string;
1850
+ }
1851
+ interface RedactionMatch {
1852
+ patternId: string;
1853
+ count: number;
1854
+ }
1855
+ interface Redactor {
1856
+ redact(text: string): {
1857
+ text: string;
1858
+ matches: RedactionMatch[];
1859
+ };
1860
+ }
1861
+ /**
1862
+ * Built-in safety-by-default patterns. These cover common cloud, SaaS, and
1863
+ * cryptographic credentials that should never be captured verbatim into the
1864
+ * immutable `raw/` store or compiled wiki pages. Each pattern is expressed as
1865
+ * a named regex literal so readability is preserved when auditing what gets
1866
+ * scrubbed.
1867
+ */
1868
+ declare const DEFAULT_REDACTION_PATTERNS: RedactionPattern[];
1869
+ /**
1870
+ * Build a redactor from a list of patterns. Callers should construct this
1871
+ * once per ingest run and reuse it across prepared inputs so regex compilation
1872
+ * and global-flag normalization happen only once.
1873
+ */
1874
+ declare function buildRedactor(patterns: RedactionPattern[], defaultPlaceholder?: string): Redactor;
1875
+ interface ConfiguredRedactionPattern {
1876
+ id: string;
1877
+ pattern: string;
1878
+ flags?: string;
1879
+ placeholder?: string;
1880
+ description?: string;
1881
+ }
1882
+ interface RedactionConfig {
1883
+ enabled?: boolean;
1884
+ placeholder?: string;
1885
+ useDefaults?: boolean;
1886
+ patterns?: ConfiguredRedactionPattern[];
1887
+ }
1888
+ /**
1889
+ * Compile a possibly-absent `redaction` config block into a concrete
1890
+ * pattern list. Missing config means "enabled with defaults" — this is
1891
+ * safety-by-default so a fresh 0.9.0 vault upgrades without silently losing
1892
+ * redaction coverage.
1893
+ *
1894
+ * Invalid user-supplied regex sources throw eagerly with a helpful message
1895
+ * so the failure is surfaced at ingest start instead of silently skipped.
1896
+ */
1897
+ declare function resolveRedactionPatterns(config?: RedactionConfig | null): {
1898
+ enabled: boolean;
1899
+ placeholder: string;
1900
+ patterns: RedactionPattern[];
1901
+ };
1902
+ /**
1903
+ * Convenience helper used by the ingest pipeline: build the redactor once
1904
+ * from config, or return `null` if redaction is disabled. Returning `null`
1905
+ * makes the caller's fast-path trivial (skip bytes/string work entirely).
1906
+ */
1907
+ declare function buildConfiguredRedactor(config?: RedactionConfig | null): Redactor | null;
1908
+
1542
1909
  declare function listSchedules(rootDir: string): Promise<ScheduleStateRecord[]>;
1543
1910
  declare function runSchedule(rootDir: string, jobId: string): Promise<ScheduledRunResult>;
1544
1911
  declare function serveSchedules(rootDir: string, pollMs?: number): Promise<ScheduleController>;
@@ -1653,6 +2020,20 @@ declare function runAutoPromotion(rootDir: string, options?: {
1653
2020
  dryRun?: boolean;
1654
2021
  }): Promise<PromotionSession>;
1655
2022
  declare function previewCandidatePromotions(rootDir: string): Promise<PromotionDecision[]>;
2023
+ /**
2024
+ * Human-in-the-loop supersession: wire up a `superseded_by` edge between
2025
+ * two existing pages and flip the older page's frontmatter to stale. The
2026
+ * edge is written into `state/graph.json` and the older page's markdown
2027
+ * file is updated via `markSuperseded`. Caller supplies either page ids
2028
+ * or page paths for resolution convenience.
2029
+ */
2030
+ declare function createSupersessionEdge(rootDir: string, oldPageIdOrPath: string, newPageIdOrPath: string): Promise<{
2031
+ oldPageId: string;
2032
+ newPageId: string;
2033
+ edgeId: string;
2034
+ graphPath: string;
2035
+ updatedPagePath: string;
2036
+ }>;
1656
2037
  declare function archiveCandidate(rootDir: string, target: string): Promise<CandidateRecord>;
1657
2038
  declare function initVault(rootDir: string, options?: InitOptions): Promise<void>;
1658
2039
  declare function compileVault(rootDir: string, options?: CompileOptions): Promise<CompileResult>;
@@ -1696,6 +2077,14 @@ declare function bootstrapDemo(rootDir: string, input?: string): Promise<{
1696
2077
  manifestId?: string;
1697
2078
  compile?: CompileResult;
1698
2079
  }>;
2080
+ /**
2081
+ * Vault-level wrapper around the consolidation engine so the CLI, MCP,
2082
+ * and schedule callers all go through a single entry point. The provider
2083
+ * is optional; the rollup is purely heuristic otherwise.
2084
+ */
2085
+ declare function consolidateVault(rootDir: string, options?: {
2086
+ dryRun?: boolean;
2087
+ }): Promise<ConsolidationResult>;
1699
2088
 
1700
2089
  declare function startGraphServer(rootDir: string, port?: number, options?: {
1701
2090
  full?: boolean;
@@ -1726,6 +2115,7 @@ declare function watchVault(rootDir: string, options?: WatchOptions): Promise<Wa
1726
2115
  declare function getWatchStatus(rootDir: string): Promise<WatchStatusResult>;
1727
2116
 
1728
2117
  declare function createWebSearchAdapter(id: string, config: WebSearchProviderConfig, rootDir: string): Promise<WebSearchAdapter>;
1729
- declare function getWebSearchAdapterForTask(rootDir: string, task: "deepLintProvider"): Promise<WebSearchAdapter>;
2118
+ type WebSearchTaskId = "deepLintProvider" | "queryProvider" | "exploreProvider";
2119
+ declare function getWebSearchAdapterForTask(rootDir: string, task: WebSearchTaskId): Promise<WebSearchAdapter>;
1730
2120
 
1731
- export { type AddOptions, type AddResult, 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 BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type BlastRadiusResult, 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, DEFAULT_PROMOTION_CONFIG, 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 Freshness, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, 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 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, type LintFinding, type LintOptions, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type Neo4jGraphSinkConfig, 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 ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RepoSyncResult, type ResolvedPaths, type ReviewActionResult, type RoleExecutorConfig, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, 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 VaultConfig, type VaultDashboardPack, type VaultProfileConfig, type VaultProfilePreset, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, acceptApproval, addInput, addManagedSource, agentTypeSchema, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, compileVault, createMcpServer, createProvider, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteManagedSource, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, exportGraphReportHtml, exportObsidianCanvas, exportObsidianVault, getGitHookStatus, getProviderForTask, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, graphDiff, guideManagedSource, guideSourceScope, importInbox, ingestDirectory, ingestInput, ingestInputDetailed, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listGodNodes, listGraphHyperedges, listManagedSourceRecords, listManifests, listPages, listSchedules, listTrackedRepoRoots, loadVaultConfig, loadVaultSchema, loadVaultSchemas, pathGraphVault, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, rejectApproval, reloadManagedSources, resolvePaths, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, syncTrackedRepos, syncTrackedReposForWatch, trimToTokenBudget, uninstallGitHooks, watchVault, webSearchProviderTypeSchema };
2121
+ export { type AddOptions, type AddResult, 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 BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type BlastRadiusResult, 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, DEFAULT_CONSOLIDATION_CONFIG, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HALF_LIFE_DAYS_BY_SOURCE_CLASS, DEFAULT_PROMOTION_CONFIG, DEFAULT_REDACTION_PATTERNS, DEFAULT_STALE_THRESHOLD, 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 Freshness, type FreshnessConfig, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, 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 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, type LintFinding, type LintOptions, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type MemoryTier, type Neo4jGraphSinkConfig, 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 ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RedactionMatchSummary, type RedactionPatternConfig, type RedactionSettings, type RedactionSummary, type RepoSyncResult, type ResolvedPaths, 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 VaultConfig, type VaultDashboardPack, type VaultProfileConfig, type VaultProfilePreset, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, acceptApproval, addInput, addManagedSource, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildRedactor, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteManagedSource, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, exportGraphReportHtml, exportObsidianCanvas, exportObsidianVault, getGitHookStatus, getProviderForTask, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, graphDiff, guideManagedSource, guideSourceScope, importInbox, ingestDirectory, ingestInput, ingestInputDetailed, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listGodNodes, listGraphHyperedges, listManagedSourceRecords, listManifests, listPages, listSchedules, listTrackedRepoRoots, loadVaultConfig, loadVaultSchema, loadVaultSchemas, markSuperseded, pathGraphVault, persistDecayFrontmatter, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, rejectApproval, reloadManagedSources, resetDecay, resolveConsolidationConfig, resolveDecayConfig, resolvePaths, resolveRedactionPatterns, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, syncTrackedRepos, syncTrackedReposForWatch, trimToTokenBudget, uninstallGitHooks, watchVault, webSearchProviderTypeSchema };