@swarmvaultai/engine 0.8.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
@@ -43,10 +43,25 @@ declare const agentTypeSchema: z.ZodEnum<{
43
43
  trae: "trae";
44
44
  claw: "claw";
45
45
  droid: "droid";
46
+ kiro: "kiro";
47
+ hermes: "hermes";
48
+ antigravity: "antigravity";
49
+ vscode: "vscode";
46
50
  }>;
47
51
  type AgentType = z.infer<typeof agentTypeSchema>;
48
52
  type PageKind = "index" | "source" | "module" | "concept" | "entity" | "output" | "insight" | "graph_report" | "community_summary";
49
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";
50
65
  type ClaimStatus = "extracted" | "inferred" | "conflicted" | "stale";
51
66
  type EvidenceClass = "extracted" | "inferred" | "ambiguous";
52
67
  type Polarity = "positive" | "negative" | "neutral";
@@ -113,6 +128,13 @@ interface AudioTranscriptionRequest {
113
128
  bytes: Buffer;
114
129
  fileName?: string;
115
130
  language?: string;
131
+ /**
132
+ * Optional one-sentence domain hint derived from the vault's top god nodes.
133
+ * Providers that accept a prompt (e.g. Whisper) can pass it through to bias
134
+ * transcription toward in-corpus terminology. Providers without prompt
135
+ * support ignore it safely.
136
+ */
137
+ corpusHint?: string;
116
138
  }
117
139
  interface AudioTranscriptionResponse {
118
140
  text: string;
@@ -222,6 +244,8 @@ interface VaultConfig {
222
244
  providers: Record<string, WebSearchProviderConfig>;
223
245
  tasks: {
224
246
  deepLintProvider: string;
247
+ queryProvider?: string;
248
+ exploreProvider?: string;
225
249
  };
226
250
  };
227
251
  search?: {
@@ -232,6 +256,72 @@ interface VaultConfig {
232
256
  candidate?: {
233
257
  autoPromote?: CandidatePromotionConfig;
234
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[];
235
325
  }
236
326
  interface CandidatePromotionConfig {
237
327
  enabled: boolean;
@@ -351,6 +441,13 @@ interface IngestOptions {
351
441
  gitignore?: boolean;
352
442
  extractClasses?: SourceClass[];
353
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;
354
451
  }
355
452
  interface DirectoryIngestSkip {
356
453
  path: string;
@@ -371,6 +468,11 @@ interface DirectoryIngestResult {
371
468
  failed?: DirectoryIngestFailure[];
372
469
  runId?: string;
373
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[];
374
476
  }
375
477
  interface InputIngestResult {
376
478
  input: string;
@@ -380,6 +482,11 @@ interface InputIngestResult {
380
482
  unchanged: SourceManifest[];
381
483
  removed: SourceManifest[];
382
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[];
383
490
  }
384
491
  interface SourceManifest {
385
492
  sourceId: string;
@@ -534,6 +641,8 @@ interface GraphNode {
534
641
  id: string;
535
642
  type: "source" | "concept" | "entity" | "module" | "symbol" | "rationale";
536
643
  label: string;
644
+ /** Lowercased NFKD-normalized label (diacritic-insensitive) for lexical matching. */
645
+ normLabel?: string;
537
646
  pageId?: string;
538
647
  freshness?: Freshness;
539
648
  confidence?: number;
@@ -549,6 +658,17 @@ interface GraphNode {
549
658
  isGodNode?: boolean;
550
659
  tags?: string[];
551
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
+ */
552
672
  interface GraphEdge {
553
673
  id: string;
554
674
  source: string;
@@ -582,6 +702,26 @@ interface GraphPage {
582
702
  projectIds: string[];
583
703
  nodeIds: string[];
584
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;
585
725
  status: PageStatus;
586
726
  confidence: number;
587
727
  backlinks: string[];
@@ -599,6 +739,24 @@ interface GraphPage {
599
739
  question?: string;
600
740
  outputFormat?: OutputFormat;
601
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;
602
760
  }
603
761
  interface GraphArtifact {
604
762
  generatedAt: string;
@@ -803,6 +961,7 @@ interface CompileOptions {
803
961
  interface InitOptions {
804
962
  obsidian?: boolean;
805
963
  profile?: string;
964
+ lite?: boolean;
806
965
  }
807
966
  interface CompileResult {
808
967
  graphPath: string;
@@ -846,6 +1005,7 @@ interface QueryOptions {
846
1005
  save?: boolean;
847
1006
  format?: OutputFormat;
848
1007
  review?: boolean;
1008
+ gapFill?: boolean;
849
1009
  }
850
1010
  interface QueryResult {
851
1011
  answer: string;
@@ -1060,12 +1220,24 @@ interface LintOptions {
1060
1220
  deep?: boolean;
1061
1221
  web?: boolean;
1062
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;
1063
1234
  }
1064
1235
  interface ExploreOptions {
1065
1236
  question: string;
1066
1237
  steps?: number;
1067
1238
  format?: OutputFormat;
1068
1239
  review?: boolean;
1240
+ gapFill?: boolean;
1069
1241
  }
1070
1242
  interface ExploreStepResult {
1071
1243
  step: number;
@@ -1372,7 +1544,11 @@ interface ScheduledExploreTask {
1372
1544
  steps?: number;
1373
1545
  format?: OutputFormat;
1374
1546
  }
1375
- type ScheduledTaskConfig = ScheduledCompileTask | ScheduledLintTask | ScheduledQueryTask | ScheduledExploreTask;
1547
+ interface ScheduledConsolidateTask {
1548
+ type: "consolidate";
1549
+ dryRun?: boolean;
1550
+ }
1551
+ type ScheduledTaskConfig = ScheduledCompileTask | ScheduledLintTask | ScheduledQueryTask | ScheduledExploreTask | ScheduledConsolidateTask;
1376
1552
  interface ScheduleTriggerConfig {
1377
1553
  cron?: string;
1378
1554
  every?: string;
@@ -1470,6 +1646,147 @@ declare function initWorkspace(rootDir: string, options?: {
1470
1646
  paths: ResolvedPaths;
1471
1647
  }>;
1472
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
+
1473
1790
  declare function exportGraphFormat(rootDir: string, format: Exclude<GraphExportFormat, "html" | "report" | "obsidian" | "canvas">, outputPath: string): Promise<GraphExportResult>;
1474
1791
  declare function exportGraphReportHtml(rootDir: string, outputPath: string): Promise<GraphExportResult>;
1475
1792
  declare function exportObsidianVault(rootDir: string, outputDir: string): Promise<GraphExportResult>;
@@ -1525,6 +1842,70 @@ declare function createProvider(id: string, config: ProviderConfig, rootDir: str
1525
1842
  declare function getProviderForTask(rootDir: string, task: keyof Awaited<ReturnType<typeof loadVaultConfig>>["config"]["tasks"]): Promise<ProviderAdapter>;
1526
1843
  declare function assertProviderCapability(provider: ProviderAdapter, capability: ProviderCapability): void;
1527
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
+
1528
1909
  declare function listSchedules(rootDir: string): Promise<ScheduleStateRecord[]>;
1529
1910
  declare function runSchedule(rootDir: string, jobId: string): Promise<ScheduledRunResult>;
1530
1911
  declare function serveSchedules(rootDir: string, pollMs?: number): Promise<ScheduleController>;
@@ -1639,6 +2020,20 @@ declare function runAutoPromotion(rootDir: string, options?: {
1639
2020
  dryRun?: boolean;
1640
2021
  }): Promise<PromotionSession>;
1641
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
+ }>;
1642
2037
  declare function archiveCandidate(rootDir: string, target: string): Promise<CandidateRecord>;
1643
2038
  declare function initVault(rootDir: string, options?: InitOptions): Promise<void>;
1644
2039
  declare function compileVault(rootDir: string, options?: CompileOptions): Promise<CompileResult>;
@@ -1682,6 +2077,14 @@ declare function bootstrapDemo(rootDir: string, input?: string): Promise<{
1682
2077
  manifestId?: string;
1683
2078
  compile?: CompileResult;
1684
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>;
1685
2088
 
1686
2089
  declare function startGraphServer(rootDir: string, port?: number, options?: {
1687
2090
  full?: boolean;
@@ -1712,6 +2115,7 @@ declare function watchVault(rootDir: string, options?: WatchOptions): Promise<Wa
1712
2115
  declare function getWatchStatus(rootDir: string): Promise<WatchStatusResult>;
1713
2116
 
1714
2117
  declare function createWebSearchAdapter(id: string, config: WebSearchProviderConfig, rootDir: string): Promise<WebSearchAdapter>;
1715
- 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>;
1716
2120
 
1717
- 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 };