@riebeckite/core 0.0.13 → 0.0.15

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.
Files changed (35) hide show
  1. package/README.md +6 -5
  2. package/README_ja.md +9 -8
  3. package/dist/client.d.ts +2 -2
  4. package/dist/client.js +142 -1
  5. package/dist/index.d.ts +15 -6
  6. package/dist/index.js +2086 -406
  7. package/dist/src/config_deprecations.d.ts +8 -0
  8. package/dist/src/content/affected_content.d.ts +1 -1
  9. package/dist/src/content/content_build_coordinator.d.ts +11 -3
  10. package/dist/src/content/content_build_state.d.ts +13 -2
  11. package/dist/src/content/content_dependency_tracker.d.ts +18 -0
  12. package/dist/src/content/content_entry_reader.d.ts +2 -0
  13. package/dist/src/content/content_index_builder.d.ts +2 -0
  14. package/dist/src/content/content_location_resolver.d.ts +7 -0
  15. package/dist/src/content/content_manager.d.ts +21 -0
  16. package/dist/src/content/content_persistent_cache.d.ts +43 -0
  17. package/dist/src/content/file_system_content_source.d.ts +2 -0
  18. package/dist/src/content/folder_entry.d.ts +35 -0
  19. package/dist/src/content/graph_layout.d.ts +20 -0
  20. package/dist/src/content/manifest_builder.d.ts +2 -1
  21. package/dist/src/content/output_dependency.d.ts +34 -0
  22. package/dist/src/content/publishing.d.ts +15 -0
  23. package/dist/src/deprecation.d.ts +14 -0
  24. package/dist/src/pipeline.d.ts +10 -0
  25. package/dist/src/plugin/plugin_runtime.d.ts +7 -1
  26. package/dist/src/types/content_manifest.d.ts +18 -1
  27. package/dist/src/types/generated_output.d.ts +9 -0
  28. package/dist/src/types/output_dependency.d.ts +14 -0
  29. package/dist/src/types/plugin.d.ts +19 -0
  30. package/dist/src/types/plugin_page.d.ts +6 -0
  31. package/dist/src/types/plugin_pipeline.d.ts +1 -0
  32. package/dist/src/types/post_content.d.ts +2 -0
  33. package/dist/src/types/resolved_riebeckite_config.d.ts +4 -0
  34. package/dist/src/types/riebeckite_config.d.ts +4 -0
  35. package/package.json +2 -2
@@ -0,0 +1,8 @@
1
+ import { type DeprecationNotice } from "./deprecation.js";
2
+ import type { Diagnostic } from "./types/diagnostic.js";
3
+ import type { RiebeckiteConfig } from "./types/riebeckite_config.js";
4
+ export type ConfigDeprecationNotice = DeprecationNotice & {
5
+ readonly kind: "config";
6
+ readonly path: string;
7
+ };
8
+ export declare function collectConfigDeprecationDiagnostics(config: RiebeckiteConfig, notices?: readonly ConfigDeprecationNotice[]): Diagnostic[];
@@ -4,4 +4,4 @@ export type AffectedContent = {
4
4
  readonly direct: ReadonlySet<string>;
5
5
  readonly dependent: ReadonlySet<string>;
6
6
  };
7
- export declare function determineAffectedContent(changeSet: ContentChangeSet, previousState: ContentBuildState | undefined, currentPaths: readonly string[]): AffectedContent;
7
+ export declare function determineAffectedContent(changeSet: ContentChangeSet, previousState: ContentBuildState | undefined, currentPaths: readonly string[], currentContentIndex: ReadonlyMap<string, string>): AffectedContent;
@@ -1,12 +1,19 @@
1
1
  import type { Observability } from "../observability.js";
2
- import type { ContentManifest } from "../types/content_manifest.js";
2
+ import type { ContentManifest, ContentManifestEntry } from "../types/content_manifest.js";
3
+ import { determineAffectedContent } from "./affected_content.js";
3
4
  import { type ContentBuildState, type FingerprintedContentEntry } from "./content_build_state.js";
4
5
  import { type ContentChangeSet } from "./content_change_set.js";
6
+ import type { CachedContentDependency } from "./content_dependency_tracker.js";
5
7
  import type { ContentSourceEntry } from "./content_source.js";
8
+ import type { OutputDescriptor } from "./output_dependency.js";
6
9
  export type ContentBuildPreparation = {
7
10
  readonly previousState: ContentBuildState | undefined;
11
+ readonly previousManifestEntriesBySlug: ReadonlyMap<string, ContentManifestEntry>;
8
12
  readonly currentEntries: readonly FingerprintedContentEntry[];
13
+ readonly currentContentAliases: ReadonlyMap<string, readonly string[]>;
14
+ readonly currentContentIndex: Map<string, string>;
9
15
  readonly changeSet: ContentChangeSet;
16
+ readonly affectedContent: ReturnType<typeof determineAffectedContent>;
10
17
  };
11
18
  type ContentBuildCoordinatorDependencies = {
12
19
  readonly buildStatePath: string;
@@ -18,8 +25,9 @@ export declare class ContentBuildCoordinator {
18
25
  private readonly dependencies;
19
26
  private preparation;
20
27
  constructor(dependencies: ContentBuildCoordinatorDependencies);
21
- getPreparation(incremental: boolean | undefined): Promise<ContentBuildPreparation>;
22
- commit(preparation: ContentBuildPreparation, manifest: ContentManifest): Promise<void>;
28
+ getPreparation(incremental: boolean | undefined, pipelineFingerprint: string | undefined, fullContentRegenerationRequired?: boolean): Promise<ContentBuildPreparation>;
29
+ commit(preparation: ContentBuildPreparation, manifest: ContentManifest, pipelineFingerprint: string | undefined, outputs?: readonly OutputDescriptor[], manifestEntries?: readonly ContentManifestEntry[], trackedDependencies?: ReadonlyMap<string, readonly CachedContentDependency[]>): Promise<void>;
23
30
  private prepare;
31
+ private getContentAliases;
24
32
  }
25
33
  export {};
@@ -1,5 +1,7 @@
1
+ import type { ContentManifestEntry } from "../types/content_manifest.js";
1
2
  import type { ContentSourceEntry } from "./content_source.js";
2
- export declare const CONTENT_BUILD_STATE_VERSION = 2;
3
+ import type { OutputDescriptor } from "./output_dependency.js";
4
+ export declare const CONTENT_BUILD_STATE_VERSION = 6;
3
5
  /**
4
6
  * Build state lives under `<content directory>/.riebeckite`. That directory is
5
7
  * build-time state, not content, so content sources must exclude it from scans
@@ -9,12 +11,21 @@ export declare const CONTENT_BUILD_STATE_DIRECTORY = ".riebeckite";
9
11
  export declare const CONTENT_BUILD_STATE_EXCLUDE = ".riebeckite/**";
10
12
  export type ContentBuildEntry = {
11
13
  readonly fingerprint: string;
12
- readonly dependencies: readonly string[];
14
+ readonly aliases: readonly string[];
15
+ readonly dependencies: readonly ContentBuildDependency[];
16
+ readonly linkTargets?: readonly string[];
17
+ };
18
+ export type ContentBuildDependency = {
19
+ readonly kind: "content" | "file";
20
+ readonly id: string;
13
21
  };
14
22
  export type ContentBuildState = {
15
23
  readonly version: number;
16
24
  readonly entries: Readonly<Record<string, ContentBuildEntry>>;
17
25
  readonly contentIndex: Readonly<Record<string, string>>;
26
+ readonly pipelineFingerprint?: string;
27
+ readonly manifestEntries?: readonly ContentManifestEntry[];
28
+ readonly outputs?: readonly OutputDescriptor[];
18
29
  };
19
30
  export type FingerprintedContentEntry = {
20
31
  readonly entry: ContentSourceEntry;
@@ -0,0 +1,18 @@
1
+ import type { ContentSource, ContentSourceContent } from "./content_source.js";
2
+ export type CachedContentDependency = {
3
+ readonly kind: "content" | "file" | "link";
4
+ readonly id: string;
5
+ readonly fingerprint: string;
6
+ };
7
+ type DependencyIdentity = Pick<CachedContentDependency, "kind" | "id">;
8
+ export type ContentDependencyTracker = {
9
+ readonly contentSource: ContentSource;
10
+ readContent(slug: string, read: () => Promise<string>): Promise<string>;
11
+ recordLinkResolution(id: string, value: string): void;
12
+ dependencies(): readonly CachedContentDependency[];
13
+ };
14
+ export declare function createContentDependencyTracker(source: ContentSource): ContentDependencyTracker;
15
+ export declare function fingerprintContent(content: ContentSourceContent): string;
16
+ export declare function normalizeDependencyIdentity<T extends DependencyIdentity>(dependency: T): T;
17
+ export declare function dependencyKey(dependency: DependencyIdentity): string;
18
+ export {};
@@ -4,6 +4,8 @@ export declare class ContentEntryReader {
4
4
  private readonly source;
5
5
  private readonly observability;
6
6
  private entries;
7
+ private entriesPromise;
8
+ private entriesByPath;
7
9
  private texts;
8
10
  constructor(source: ContentSource, observability: Observability);
9
11
  getEntries(): Promise<readonly ContentSourceEntry[]>;
@@ -3,5 +3,7 @@ export declare class ContentIndexBuilder {
3
3
  private source;
4
4
  constructor(source: ContentSource);
5
5
  build(contentEntries: readonly ContentSourceEntry[], read?: (entry: ContentSourceEntry) => Promise<import("./content_source.js").ContentSourceContent>): Promise<Map<string, string>>;
6
+ static buildFromAliases(contentEntries: readonly ContentSourceEntry[], aliasesByPath: ReadonlyMap<string, readonly string[]>): Map<string, string>;
6
7
  private indexContentEntry;
8
+ private static indexContentEntryFromAliases;
7
9
  }
@@ -1,3 +1,4 @@
1
+ import type { Observability } from "../observability.js";
1
2
  import type { PluginRuntime } from "../plugin/plugin_runtime.js";
2
3
  import type { ContentManifest, ContentPublicLocation } from "../types/content_manifest.js";
3
4
  import type { ContentSourceEntry } from "./content_source.js";
@@ -6,13 +7,19 @@ type ContentLocationResolverDependencies = {
6
7
  readonly readEntry: (entry: ContentSourceEntry) => Promise<string>;
7
8
  readonly getContentIndex: () => Promise<Map<string, string>>;
8
9
  readonly pluginRuntime: PluginRuntime;
10
+ readonly observability: Observability;
9
11
  };
10
12
  export declare class ContentLocationResolver {
11
13
  private readonly dependencies;
12
14
  private locations;
15
+ private locationsPromise;
16
+ private permalinks;
17
+ private permalinksPromise;
13
18
  constructor(dependencies: ContentLocationResolverDependencies);
14
19
  getLocations(): Promise<ReadonlyMap<string, ContentPublicLocation>>;
20
+ private resolveLocations;
15
21
  getPermalinks(): Promise<Map<string, string>>;
22
+ private createPermalinks;
16
23
  populateRedirects(manifest: ContentManifest, locations: ReadonlyMap<string, ContentPublicLocation>): void;
17
24
  }
18
25
  export {};
@@ -7,6 +7,7 @@ import type { ResolvedRiebeckiteConfig } from "../types/resolved_riebeckite_conf
7
7
  import { type ContentBuildPreparation } from "./content_build_coordinator.js";
8
8
  import type { ContentGraph } from "./content_graph.js";
9
9
  import type { ContentSource, ContentSourceEntry } from "./content_source.js";
10
+ import { type OutputChangeSet } from "./output_dependency.js";
10
11
  export type Backlink = {
11
12
  slug: string;
12
13
  };
@@ -28,13 +29,22 @@ export declare class ContentManager {
28
29
  private manifestBuilder;
29
30
  private pluginRuntime;
30
31
  private contentIndex;
32
+ private contentIndexPromise;
31
33
  private contentCache;
32
34
  private manifest;
35
+ private manifestPromise;
36
+ private pipelineFingerprint;
33
37
  private pipeline;
34
38
  private entryReader;
35
39
  private locationResolver;
36
40
  private buildCoordinator;
37
41
  private isBuildTime;
42
+ private publishingBuildTime;
43
+ private routableSlugs;
44
+ private routableSlugsPromise;
45
+ private processedContentCount;
46
+ private outputChangeSet;
47
+ private trackedContentDependencies;
38
48
  constructor(content: string | ContentSource, exclude?: string[], pipelineOptions?: PipelineOptions);
39
49
  getAllPosts(): Promise<ContentPostReference[]>;
40
50
  scan(): Promise<readonly ContentSourceEntry[]>;
@@ -42,7 +52,9 @@ export declare class ContentManager {
42
52
  getContentIndex(preparation?: ContentBuildPreparation): Promise<Map<string, string>>;
43
53
  getProcessedContent(slug: string): Promise<PostContent>;
44
54
  getManifest(options?: ContentBuildOptions): Promise<ContentManifest>;
55
+ private buildManifest;
45
56
  build(options?: ContentBuildOptions): Promise<ContentManifest>;
57
+ getOutputChangeSet(options?: ContentBuildOptions): Promise<OutputChangeSet>;
46
58
  getBacklinks(targetSlug: string): Promise<Backlink[]>;
47
59
  getContentGraph(): Promise<ContentGraph>;
48
60
  getDiagnostics(): Promise<Diagnostic[]>;
@@ -54,11 +66,20 @@ export declare class ContentManager {
54
66
  dispose(): Promise<void>;
55
67
  getContentLocations(): Promise<ReadonlyMap<string, ContentPublicLocation>>;
56
68
  private applyPublicView;
69
+ private synchronizeManifestHtml;
70
+ private publishStrategy;
71
+ private reuseManifestEntry;
72
+ private getPipelineFingerprint;
73
+ private requiresFullContentRegeneration;
74
+ private isRoutable;
75
+ private ensureRoutableSlugs;
76
+ private resolveRoutableSlugs;
57
77
  private enableBuildTime;
58
78
  private observability;
59
79
  }
60
80
  declare module "../pipeline" {
61
81
  interface PipelineOptions {
62
82
  config?: ResolvedRiebeckiteConfig;
83
+ publishingBuildTime?: Date | string;
63
84
  }
64
85
  }
@@ -0,0 +1,43 @@
1
+ import type { Logger, Tracer } from "../observability.js";
2
+ import type { PostContent } from "../types/post_content.js";
3
+ import type { ResolvedRiebeckiteConfig } from "../types/resolved_riebeckite_config.js";
4
+ import type { CachedContentDependency } from "./content_dependency_tracker.js";
5
+ export type PersistentContentCacheEntry = {
6
+ schemaVersion: number;
7
+ key: string;
8
+ dependencies: readonly CachedContentDependency[];
9
+ value: {
10
+ frontmatter: PostContent["frontmatter"];
11
+ html: string;
12
+ };
13
+ };
14
+ export type PersistentContentCacheOptions = {
15
+ config: ResolvedRiebeckiteConfig;
16
+ logger?: Logger;
17
+ tracer?: Tracer;
18
+ };
19
+ export declare const CONTENT_CACHE_SCHEMA_VERSION = 3;
20
+ export declare const CONTENT_CACHE_COMPATIBILITY_VERSION = 1;
21
+ export type PersistentContentCache = {
22
+ get(key: string): Promise<PersistentContentCacheEntry | undefined>;
23
+ set(key: string, value: PersistentContentCacheEntry): Promise<void>;
24
+ clear(): Promise<void>;
25
+ };
26
+ export declare function createPersistentContentCache(options: PersistentContentCacheOptions): {
27
+ get(key: string): Promise<PersistentContentCacheEntry | undefined>;
28
+ set(key: string, value: PersistentContentCacheEntry): Promise<void>;
29
+ clear(): Promise<void>;
30
+ };
31
+ export type CacheKeyInputs = {
32
+ slug: string;
33
+ source: string;
34
+ frontmatter: PostContent["frontmatter"];
35
+ pipelineFingerprint: string;
36
+ };
37
+ export declare function computeContentCacheKey(inputs: CacheKeyInputs): string;
38
+ export declare function computePipelineFingerprint(config: ResolvedRiebeckiteConfig): string;
39
+ export declare function isPersistentlyCacheable(_slug: string, config: ResolvedRiebeckiteConfig): {
40
+ cacheable: boolean;
41
+ reason?: string;
42
+ };
43
+ export declare function extractFrontmatter(markdown: string): PostContent["frontmatter"];
@@ -1,4 +1,5 @@
1
1
  import type { ContentSource, ContentSourceContent, ContentSourceEntry } from "./content_source.js";
2
+ export declare const INTERNAL_CONTENT_IGNORE_PATTERNS: readonly [".git", ".git/**", ".github", ".github/**", ".obsidian", ".obsidian/**", "node_modules", "node_modules/**", "**/.DS_Store", "**/Thumbs.db", "**/desktop.ini"];
2
3
  export declare class FileSystemContentSource implements ContentSource {
3
4
  private contentDirectory;
4
5
  private exclude;
@@ -9,3 +10,4 @@ export declare class FileSystemContentSource implements ContentSource {
9
10
  private isExcluded;
10
11
  private resolveFilePath;
11
12
  }
13
+ export declare function isIgnoredContentPath(logicalPath: string, exclude?: readonly string[]): boolean;
@@ -0,0 +1,35 @@
1
+ import type { ContentManifest, ContentManifestEntry } from "../types/content_manifest.js";
2
+ export type FolderEntryKind = "readme" | "index" | "folder";
3
+ export type FolderEntryScope = "routable" | "discoverable" | "all";
4
+ export type FolderEntryCandidate = {
5
+ readonly kind: FolderEntryKind;
6
+ readonly entry: ContentManifestEntry;
7
+ };
8
+ export type FolderEntryResolution = {
9
+ readonly type: "none";
10
+ } | {
11
+ readonly type: "resolved";
12
+ readonly kind: FolderEntryKind;
13
+ readonly entry: ContentManifestEntry;
14
+ } | {
15
+ readonly type: "ambiguous";
16
+ readonly candidates: readonly FolderEntryCandidate[];
17
+ };
18
+ export type ResolveFolderEntryOptions = {
19
+ readonly scope?: FolderEntryScope;
20
+ };
21
+ export type FolderLocationResolution = {
22
+ readonly type: "none";
23
+ } | {
24
+ readonly type: "content";
25
+ readonly entry: ContentManifestEntry;
26
+ } | {
27
+ readonly type: "generated";
28
+ readonly pathname: string;
29
+ } | {
30
+ readonly type: "ambiguous";
31
+ readonly candidates: readonly FolderEntryCandidate[];
32
+ };
33
+ export declare function resolveFolderEntry(manifest: ContentManifest, folder: string, options?: ResolveFolderEntryOptions): FolderEntryResolution;
34
+ export declare function resolveFolderLocation(manifest: ContentManifest, folder: string): FolderLocationResolution;
35
+ export declare function resolveGeneratedFolderLocation(manifest: ContentManifest, folder: string): string | null;
@@ -12,6 +12,25 @@ export type GraphLayoutNode = {
12
12
  y: number;
13
13
  radius: number;
14
14
  };
15
+ export type ForceGraphLayoutOptions = {
16
+ width: number;
17
+ height: number;
18
+ centerSlug?: string;
19
+ linkDistance?: number;
20
+ repulsion?: number;
21
+ iterations?: number;
22
+ damping?: number;
23
+ minNodeRadius?: number;
24
+ maxNodeRadius?: number;
25
+ };
26
+ export type ForceLayoutGuardOptions = {
27
+ layout: "force" | "radial";
28
+ mode: "local" | "global";
29
+ nodeCount: number;
30
+ approved: boolean;
31
+ };
32
+ export declare const FORCE_LAYOUT_CONFIRM_NODE_COUNT = 500;
33
+ export declare function shouldGuardForceLayout(options: ForceLayoutGuardOptions): boolean;
15
34
  export type RadialGraphLayoutOptions = {
16
35
  width: number;
17
36
  height: number;
@@ -22,3 +41,4 @@ export type RadialGraphLayoutOptions = {
22
41
  };
23
42
  export declare function buildGraphEdges<T extends LinkableGraphNode>(nodes: T[], visibleSlugs?: Set<string>): GraphEdge[];
24
43
  export declare function layoutRadialGraph<T extends LinkableGraphNode>(nodes: T[], options: RadialGraphLayoutOptions): Map<string, GraphLayoutNode>;
44
+ export declare function layoutForceGraph<T extends LinkableGraphNode>(nodes: T[], options: ForceGraphLayoutOptions): Map<string, GraphLayoutNode>;
@@ -1,6 +1,7 @@
1
1
  import type { ContentManifest, ContentManifestEntry, ContentPublicLocation } from "../types/content_manifest.js";
2
2
  import type { PostContent } from "../types/post_content.js";
3
+ import type { ResolvedPublishingState } from "./publishing.js";
3
4
  export declare class ManifestBuilder {
4
- createEntry(slug: string, markdown: string, processed: PostContent, contentIndex: Map<string, string>, location: ContentPublicLocation): ContentManifestEntry;
5
+ createEntry(slug: string, markdown: string, processed: PostContent, contentIndex: Map<string, string>, location: ContentPublicLocation, publishing: ResolvedPublishingState): ContentManifestEntry;
5
6
  build(entries: ContentManifestEntry[], contentIndex: Map<string, string>): ContentManifest;
6
7
  }
@@ -0,0 +1,34 @@
1
+ import type { ContentManifest } from "../types/content_manifest.js";
2
+ import type { OutputDependency } from "../types/output_dependency.js";
3
+ import type { ContentBuildState } from "./content_build_state.js";
4
+ import type { ContentChangeSet } from "./content_change_set.js";
5
+ export type OutputKind = "content" | "redirect" | "plugin-page" | "generated";
6
+ export type OutputDescriptor = {
7
+ readonly kind: OutputKind;
8
+ readonly path: string;
9
+ readonly producer: string;
10
+ readonly dependencies: readonly OutputDependency[];
11
+ };
12
+ export type OutputChangeSet = {
13
+ readonly affected: readonly OutputDescriptor[];
14
+ readonly removed: readonly OutputDescriptor[];
15
+ readonly unchanged: readonly OutputDescriptor[];
16
+ readonly fullRegenerationRequired: boolean;
17
+ readonly candidateOutputCount: number;
18
+ readonly affectedOutputCount: number;
19
+ readonly removedOutputCount: number;
20
+ readonly unchangedOutputCount: number;
21
+ };
22
+ export declare function determineOutputChanges(input: {
23
+ readonly manifest: ContentManifest;
24
+ readonly previousState: ContentBuildState | undefined;
25
+ readonly changeSet: ContentChangeSet;
26
+ readonly affectedContent: {
27
+ readonly direct: ReadonlySet<string>;
28
+ readonly dependent: ReadonlySet<string>;
29
+ };
30
+ readonly pluginPageOutputs?: readonly OutputDescriptor[];
31
+ readonly contentOutputDependencies?: readonly OutputDependency[];
32
+ }): OutputChangeSet;
33
+ export declare function buildOutputInventory(manifest: ContentManifest, pluginPageOutputs?: readonly OutputDescriptor[], contentOutputDependencies?: readonly OutputDependency[]): readonly OutputDescriptor[];
34
+ export declare function htmlOutputPath(pathname: string): string;
@@ -0,0 +1,15 @@
1
+ import type { PostFrontmatter } from "../types/post_content.js";
2
+ import { type PublishStrategy } from "../types/publish_strategy.js";
3
+ export type PublishingVisibility = "public" | "unlisted" | "draft" | "scheduled";
4
+ export type ResolvedPublishingState = {
5
+ visibility: PublishingVisibility;
6
+ routable: boolean;
7
+ discoverable: boolean;
8
+ publishAt?: Date;
9
+ };
10
+ export type PublishingResolutionOptions = {
11
+ strategy: PublishStrategy;
12
+ buildTime: Date;
13
+ };
14
+ export declare function resolvePublishingState(frontmatter: PostFrontmatter | undefined, options: PublishingResolutionOptions): ResolvedPublishingState;
15
+ export declare function resolvePublishingBuildTime(input: Date | string | undefined): Date;
@@ -0,0 +1,14 @@
1
+ import type { Diagnostic } from "./types/diagnostic.js";
2
+ export type DeprecationKind = "config" | "plugin-api" | "theme-api" | "cli" | "scaffold" | "package";
3
+ export type DeprecationNotice = {
4
+ readonly kind: DeprecationKind;
5
+ readonly id: string;
6
+ readonly target: string;
7
+ readonly deprecatedSince: string;
8
+ readonly action: string;
9
+ readonly replacement?: string;
10
+ readonly documentationUrl?: string;
11
+ readonly removedIn?: string;
12
+ };
13
+ export declare function createDeprecationDiagnostic(notice: DeprecationNotice): Diagnostic;
14
+ export declare function formatDeprecationMessage(notice: DeprecationNotice): string;
@@ -1,3 +1,4 @@
1
+ import { type CachedContentDependency } from "./content/content_dependency_tracker.js";
1
2
  import type { ContentSource } from "./content/content_source.js";
2
3
  import type { Observability } from "./observability.js";
3
4
  import type { RiebeckitePlugin } from "./types/plugin.js";
@@ -8,6 +9,9 @@ export interface PipelineOptions {
8
9
  observability?: Observability;
9
10
  config?: import("./types/resolved_riebeckite_config.js").ResolvedRiebeckiteConfig;
10
11
  contentSource?: ContentSource;
12
+ isRoutable?: (slug: string) => boolean;
13
+ onContentDependencies?(slug: string, dependencies: readonly CachedContentDependency[]): void;
14
+ onPersistentContentCacheResult?(result: "hit" | "miss" | "bypass"): void;
11
15
  }
12
16
  export declare class Pipeline {
13
17
  private contentIndex;
@@ -16,12 +20,18 @@ export declare class Pipeline {
16
20
  private options;
17
21
  private isBuildTime;
18
22
  private pluginCaches;
23
+ private persistentCache;
24
+ private pipelineFingerprint;
25
+ private resolvedPlugins;
19
26
  constructor(contentIndex: Map<string, string>, permalinks: ReadonlyMap<string, string>, getMarkdownBySlug?: (slug: string) => Promise<string>, options?: PipelineOptions, isBuildTime?: boolean);
20
27
  execute(markDownContent: string, context?: MarkdownExecutionContext): Promise<PostContent>;
21
28
  private executeWithEmbedState;
29
+ private reportContentDependencies;
22
30
  private getPermalink;
31
+ private resolveLinkDependency;
23
32
  private use;
24
33
  private createNoteEmbedRenderer;
34
+ private resolvePlugins;
25
35
  private createContentRenderer;
26
36
  private cacheFor;
27
37
  }
@@ -1,7 +1,9 @@
1
+ import type { OutputDescriptor } from "../content/output_dependency.js";
1
2
  import type { PipelineOptions } from "../pipeline.js";
2
- import type { ContentLocationInput, ContentManifest, ContentManifestEntry, ContentPublicLocation } from "../types/content_manifest.js";
3
+ import type { ContentLocationInput, ContentManifest, ContentManifestEntry, ContentPublicLocation, PluginPageRoute } from "../types/content_manifest.js";
3
4
  import type { Diagnostic } from "../types/diagnostic.js";
4
5
  import type { GeneratedOutput } from "../types/generated_output.js";
6
+ import type { OutputDependency } from "../types/output_dependency.js";
5
7
  import { type PluginClientEntry } from "../types/plugin_asset.js";
6
8
  import type { ResolvedPluginPage } from "../types/plugin_page.js";
7
9
  import type { PostContent } from "../types/post_content.js";
@@ -20,6 +22,7 @@ export declare class PluginRuntime {
20
22
  private pluginCaches;
21
23
  private generatedOutputs;
22
24
  private isBuildTime;
25
+ private resolvedPlugins;
23
26
  constructor(pipelineOptions?: PipelineOptions);
24
27
  getDiagnostics(): Diagnostic[];
25
28
  getBuildStage(): PluginBuildStage;
@@ -56,6 +59,9 @@ export declare class PluginRuntime {
56
59
  collectGeneratedOutputs(): GeneratedOutput[];
57
60
  resolvePage(pathname: string, manifest: ContentManifest, contentIndex: Map<string, string>): Promise<ResolvedPluginPage | null>;
58
61
  getPagePaths(manifest: ContentManifest, contentIndex: Map<string, string>): Promise<readonly string[]>;
62
+ getPageRoutes(manifest: ContentManifest, contentIndex: Map<string, string>): Promise<readonly PluginPageRoute[]>;
63
+ getPageOutputs(manifest: ContentManifest, contentIndex: Map<string, string>): Promise<readonly OutputDescriptor[]>;
64
+ getContentOutputDependencies(): readonly OutputDependency[];
59
65
  collectDiagnostics(contentIndex: Map<string, string>): Promise<Diagnostic[]>;
60
66
  private runBuildLifecycle;
61
67
  private createContext;
@@ -1,4 +1,5 @@
1
1
  import type { ContentGraph } from "../content/content_graph.js";
2
+ import type { ResolvedPublishingState } from "../content/publishing.js";
2
3
  import type { Diagnostic } from "./diagnostic.js";
3
4
  import type { GeneratedOutput } from "./generated_output.js";
4
5
  import type { PluginAsset, PluginClientEntry } from "./plugin_asset.js";
@@ -23,7 +24,7 @@ export type ContentManifestPluginAsset = PluginAsset & {
23
24
  * The standard article consumer recognizes the `article.*` positions below.
24
25
  * Other names remain valid so a custom Site can define its own layout slots.
25
26
  */
26
- export type ContentBodySlot = "article.after-header" | "article.after-meta" | "article.before-content" | "article.after-content" | "article.footer" | (string & {});
27
+ export type ContentBodySlot = "article.after-header" | "article.after-meta" | "article.aside" | "article.before-content" | "article.after-content" | "article.footer" | (string & {});
27
28
  /** Client entries and their explicitly public configuration. */
28
29
  export type ContentManifestPluginClientEntry = PluginClientEntry;
29
30
  export type ContentManifestEntry = {
@@ -37,6 +38,7 @@ export type ContentManifestEntry = {
37
38
  publicLocation: ContentPublicLocation;
38
39
  title: string;
39
40
  frontmatter: PostFrontmatter;
41
+ publishing: ResolvedPublishingState;
40
42
  html: string;
41
43
  /**
42
44
  * Head tags a plugin wants the Site shell to render for this entry.
@@ -71,6 +73,14 @@ export type ContentPublicLocation = {
71
73
  redirects?: readonly ContentRedirect[];
72
74
  metadata?: Readonly<Record<string, string>>;
73
75
  };
76
+ export type FolderLocation = {
77
+ pathname: string;
78
+ };
79
+ export type PluginPageRoute = {
80
+ pathname: string;
81
+ pluginName: string;
82
+ pageType: string;
83
+ };
74
84
  export type ContentLocationInput = {
75
85
  slug: string;
76
86
  path: string;
@@ -84,10 +94,14 @@ export type ContentManifest = {
84
94
  * this view so unpublished notes never reach generated output.
85
95
  */
86
96
  publicEntries: ContentManifestEntry[];
97
+ /** Entries that may appear on discovery surfaces such as navigation, search, feeds, taxonomy, and public graphs. */
98
+ discoverableEntries: ContentManifestEntry[];
87
99
  bySlug: Map<string, ContentManifestEntry>;
88
100
  /** Contains only entries with an explicit source-authored content ID. */
89
101
  byContentId: Map<string, ContentManifestEntry>;
90
102
  byPermalink: Map<string, ContentManifestEntry>;
103
+ /** Contains only routable entries: public and unlisted, excluding draft and scheduled-before entries. */
104
+ byRoutablePermalink: Map<string, ContentManifestEntry>;
91
105
  redirects: Map<string, ContentRedirect & {
92
106
  slug: string;
93
107
  }>;
@@ -112,4 +126,7 @@ export type ContentManifest = {
112
126
  clientEntries: ContentManifestPluginClientEntry[];
113
127
  diagnostics: Diagnostic[];
114
128
  generatedOutputs: GeneratedOutput[];
129
+ folderLocations: Map<string, FolderLocation>;
130
+ pageRoutes: PluginPageRoute[];
131
+ pagePaths: string[];
115
132
  };
@@ -1,3 +1,4 @@
1
+ import type { OutputDependency } from "./output_dependency.js";
1
2
  export type GeneratedOutputContent = string | Uint8Array;
2
3
  /**
3
4
  * A file a plugin wants written to the build output directory. Content is kept
@@ -11,13 +12,20 @@ export type GeneratedOutputInput = {
11
12
  */
12
13
  path: string;
13
14
  content: GeneratedOutputContent;
15
+ dependencies?: readonly OutputDependency[];
14
16
  };
15
17
  export type GeneratedOutput = GeneratedOutputInput & {
16
18
  /** Name of the plugin that registered the output. */
17
19
  owner: string;
18
20
  };
21
+ export type ContentAssetOutputInput = {
22
+ path: string;
23
+ content: GeneratedOutputContent;
24
+ dependencies?: readonly OutputDependency[];
25
+ };
19
26
  export type GeneratedOutputSink = {
20
27
  emit(output: GeneratedOutputInput): void;
28
+ emitAsset(output: ContentAssetOutputInput): void;
21
29
  };
22
30
  export declare function createUnavailableGeneratedOutputSink(): GeneratedOutputSink;
23
31
  /**
@@ -26,3 +34,4 @@ export declare function createUnavailableGeneratedOutputSink(): GeneratedOutputS
26
34
  * (rather than silently rewriting) keeps `..` traversal from being laundered.
27
35
  */
28
36
  export declare function normalizeGeneratedOutputPath(input: string): string;
37
+ export declare function normalizeContentAssetOutputPath(input: string): string;
@@ -0,0 +1,14 @@
1
+ export type OutputDependency = {
2
+ readonly type: "content";
3
+ readonly slug: string;
4
+ } | {
5
+ readonly type: "tag";
6
+ readonly tag: string;
7
+ } | {
8
+ readonly type: "folder";
9
+ readonly folder: string;
10
+ } | {
11
+ readonly type: "global";
12
+ } | {
13
+ readonly type: "unknown";
14
+ };
@@ -1,5 +1,6 @@
1
1
  import type { PluginOptionsValidator } from "./config_validation.js";
2
2
  import type { Diagnostic } from "./diagnostic.js";
3
+ import type { OutputDependency } from "./output_dependency.js";
3
4
  import type { PluginAsset, PluginClientEntry } from "./plugin_asset.js";
4
5
  import type { PluginContentContext, PluginContentLocationAugmentContext, PluginContentLocationResolver, PluginContentRenderer, PluginContext, PluginGeneratedHtmlInspector, PluginGraphContext, PluginLifecycleContext, PluginManifestContext, PluginPostContext } from "./plugin_context.js";
5
6
  import type { PluginEndpoint } from "./plugin_endpoint.js";
@@ -27,6 +28,23 @@ export type RiebeckitePlugin<TOptions = unknown> = {
27
28
  */
28
29
  optional?: string[];
29
30
  cacheVersion?: string;
31
+ /**
32
+ * Explicit contract for the persistent processed-content cache.
33
+ *
34
+ * This is intentionally separate from `cacheVersion`, which versions the
35
+ * plugin-local cache storage. Content-transforming plugins without this
36
+ * contract are treated as unsafe for persistent `PostContent` reuse.
37
+ *
38
+ * - `none`: processed HTML depends only on the current content source,
39
+ * frontmatter, plugin options, and this contract version.
40
+ * - `tracked`: external content/file inputs are read only through
41
+ * framework-owned APIs that record dependency fingerprints.
42
+ * - `unsafe`: persistent processed-content cache must bypass this plugin.
43
+ */
44
+ processedContentCache?: {
45
+ version: string;
46
+ dependencyMode: "none" | "tracked" | "unsafe";
47
+ };
30
48
  validateOptions?: PluginOptionsValidator<TOptions>;
31
49
  remarkPlugins?: PipelinePlugin[];
32
50
  rehypePlugins?: PipelinePlugin[];
@@ -58,6 +76,7 @@ export type RiebeckitePlugin<TOptions = unknown> = {
58
76
  seo?: PluginSeoExtension;
59
77
  extendContentGraph?(context: PluginGraphContext): void | Promise<void>;
60
78
  renderers?: PluginContentRenderer[];
79
+ outputDependencies?: readonly OutputDependency[];
61
80
  /** Framework-independent page types contributed by this plugin. */
62
81
  pageTypes?: PluginPageType[];
63
82
  };
@@ -1,4 +1,5 @@
1
1
  import type { ContentManifest } from "./content_manifest.js";
2
+ import type { OutputDependency } from "./output_dependency.js";
2
3
  import type { PluginContext } from "./plugin_context.js";
3
4
  import type { PluginHeadTag } from "./plugin_head.js";
4
5
  /** A framework-independent page supplied by a Riebeckite plugin. */
@@ -29,6 +30,11 @@ export type PluginPageType = {
29
30
  }) => readonly string[] | Promise<readonly string[]>);
30
31
  /** Higher values win when more than one type matches a request. */
31
32
  priority?: number;
33
+ directoryIndex?: boolean;
34
+ outputDependencies?: readonly OutputDependency[] | ((context: PluginContext & {
35
+ manifest: ContentManifest;
36
+ pathname: string;
37
+ }) => readonly OutputDependency[] | Promise<readonly OutputDependency[]>);
32
38
  resolve(context: PluginPageContext): PluginPage | null | Promise<PluginPage | null>;
33
39
  };
34
40
  export type ResolvedPluginPage = PluginPage & {
@@ -16,6 +16,7 @@ export type MarkdownPipelineContext = {
16
16
  sourceSlug?: MarkdownExecutionContext["sourceSlug"];
17
17
  contentIndex: Map<string, string>;
18
18
  resolvePermalink: (slug: string) => string;
19
+ isRoutable?: (slug: string) => boolean;
19
20
  renderNoteEmbed?: (slug: string, fragment: MarkdownEmbedFragment | null) => Promise<string | null>;
20
21
  renderContent?: (input: PluginRenderInput) => Promise<string | null>;
21
22
  contentSource?: ContentSource;