folderblog 0.0.2 → 0.0.3

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 (61) hide show
  1. package/dist/{chunk-24MKFHML.cjs → chunk-2TZSVPNP.cjs} +5 -0
  2. package/dist/{chunk-HMQIQUPB.cjs → chunk-6TFXNIO6.cjs} +108 -0
  3. package/dist/{chunk-ZRUBI3GH.js → chunk-B43UAOPC.js} +106 -1
  4. package/dist/{chunk-XP5J4LFJ.js → chunk-D26H5722.js} +5 -0
  5. package/dist/chunk-E7PYGJA7.cjs +39 -0
  6. package/dist/{chunk-QA4KPPTA.cjs → chunk-J3Y3HEBF.cjs} +84 -13
  7. package/dist/{chunk-PARGDJNY.js → chunk-K76XLEC7.js} +1 -1
  8. package/dist/{chunk-IXP35S24.js → chunk-LPPBVXJ7.js} +83 -12
  9. package/dist/chunk-Q6EXKX6K.js +17 -0
  10. package/dist/{chunk-4ZJGUMHS.cjs → chunk-Q6EYTOTM.cjs} +2 -2
  11. package/dist/chunk-UCXXH2MP.cjs +20 -0
  12. package/dist/chunk-XQD3UUL5.js +34 -0
  13. package/dist/cli/bin.cjs +5 -5
  14. package/dist/cli/bin.js +4 -4
  15. package/dist/cli/index.cjs +5 -5
  16. package/dist/cli/index.js +4 -4
  17. package/dist/config-ADPY6IQS.d.cts +473 -0
  18. package/dist/config-Dctsdeo6.d.ts +473 -0
  19. package/dist/index.cjs +157 -187
  20. package/dist/index.d.cts +4 -3
  21. package/dist/index.d.ts +4 -3
  22. package/dist/index.js +16 -69
  23. package/dist/local/index.cjs +785 -0
  24. package/dist/local/index.d.cts +268 -0
  25. package/dist/local/index.d.ts +268 -0
  26. package/dist/local/index.js +772 -0
  27. package/dist/output-0P0br3Jc.d.cts +452 -0
  28. package/dist/output-0P0br3Jc.d.ts +452 -0
  29. package/dist/plugins/embed-cloudflare-ai.cjs +166 -0
  30. package/dist/plugins/embed-cloudflare-ai.d.cts +73 -0
  31. package/dist/plugins/embed-cloudflare-ai.d.ts +73 -0
  32. package/dist/plugins/embed-cloudflare-ai.js +156 -0
  33. package/dist/plugins/embed-transformers.cjs +121 -0
  34. package/dist/plugins/embed-transformers.d.cts +55 -0
  35. package/dist/plugins/embed-transformers.d.ts +55 -0
  36. package/dist/plugins/embed-transformers.js +113 -0
  37. package/dist/plugins/similarity.cjs +19 -0
  38. package/dist/plugins/similarity.d.cts +41 -0
  39. package/dist/plugins/similarity.d.ts +41 -0
  40. package/dist/plugins/similarity.js +2 -0
  41. package/dist/processor/index.cjs +123 -111
  42. package/dist/processor/index.d.cts +6 -2
  43. package/dist/processor/index.d.ts +6 -2
  44. package/dist/processor/index.js +3 -3
  45. package/dist/processor/plugins.cjs +24 -12
  46. package/dist/processor/plugins.d.cts +4 -2
  47. package/dist/processor/plugins.d.ts +4 -2
  48. package/dist/processor/plugins.js +1 -1
  49. package/dist/processor/types.cjs +16 -16
  50. package/dist/processor/types.d.cts +3 -2
  51. package/dist/processor/types.d.ts +3 -2
  52. package/dist/processor/types.js +1 -1
  53. package/dist/seo/index.cjs +289 -0
  54. package/dist/seo/index.d.cts +95 -0
  55. package/dist/seo/index.d.ts +95 -0
  56. package/dist/seo/index.js +274 -0
  57. package/dist/server/index.cjs +2 -5
  58. package/dist/server/index.js +2 -5
  59. package/package.json +36 -1
  60. package/dist/config-DFr-htlO.d.cts +0 -887
  61. package/dist/config-DFr-htlO.d.ts +0 -887
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQA4KPPTA_cjs = require('./chunk-QA4KPPTA.cjs');
3
+ var chunkJ3Y3HEBF_cjs = require('./chunk-J3Y3HEBF.cjs');
4
4
  var path = require('path');
5
5
  var url = require('url');
6
6
  var fs = require('fs');
@@ -58,7 +58,7 @@ async function build(options = {}) {
58
58
  }
59
59
  }
60
60
  console.log(`Processing: ${path.resolve(config.dir.input)}`);
61
- const result = await chunkQA4KPPTA_cjs.processFolder(config);
61
+ const result = await chunkJ3Y3HEBF_cjs.processFolder(config);
62
62
  const errorCount = result.issues.summary?.errorCount ?? 0;
63
63
  const warningCount = result.issues.summary?.warningCount ?? 0;
64
64
  console.log(`
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs');
4
+
5
+ // src/utils.ts
6
+ function loadJsonFile(path, fallback) {
7
+ if (!fs.existsSync(path)) return fallback;
8
+ return JSON.parse(fs.readFileSync(path, "utf-8"));
9
+ }
10
+ function normalizeBaseUrl(domain) {
11
+ let url = domain.trim();
12
+ if (url.endsWith("/")) url = url.slice(0, -1);
13
+ if (!url.startsWith("http://") && !url.startsWith("https://")) {
14
+ url = `https://${url}`;
15
+ }
16
+ return url;
17
+ }
18
+
19
+ exports.loadJsonFile = loadJsonFile;
20
+ exports.normalizeBaseUrl = normalizeBaseUrl;
@@ -0,0 +1,34 @@
1
+ // src/errors.ts
2
+ var FolderBlogError = class extends Error {
3
+ /** HTTP status code if applicable */
4
+ status;
5
+ /** The URL that was requested */
6
+ url;
7
+ constructor(message, options) {
8
+ super(message);
9
+ this.name = "FolderBlogError";
10
+ this.status = options?.status;
11
+ this.url = options?.url;
12
+ }
13
+ };
14
+ var NotFoundError = class extends FolderBlogError {
15
+ constructor(resource, identifier, url) {
16
+ super(`${resource} not found: ${identifier}`, { status: 404, url });
17
+ this.name = "NotFoundError";
18
+ }
19
+ };
20
+ var ApiError = class extends FolderBlogError {
21
+ constructor(message, status, url) {
22
+ super(message, { status, url });
23
+ this.name = "ApiError";
24
+ }
25
+ };
26
+ var NetworkError = class extends FolderBlogError {
27
+ constructor(message, cause) {
28
+ super(message);
29
+ this.name = "NetworkError";
30
+ if (cause) this.cause = cause;
31
+ }
32
+ };
33
+
34
+ export { ApiError, FolderBlogError, NetworkError, NotFoundError };
package/dist/cli/bin.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunk4ZJGUMHS_cjs = require('../chunk-4ZJGUMHS.cjs');
5
- require('../chunk-QA4KPPTA.cjs');
6
- require('../chunk-HMQIQUPB.cjs');
7
- require('../chunk-24MKFHML.cjs');
4
+ var chunkQ6EYTOTM_cjs = require('../chunk-Q6EYTOTM.cjs');
5
+ require('../chunk-J3Y3HEBF.cjs');
6
+ require('../chunk-2TZSVPNP.cjs');
7
+ require('../chunk-6TFXNIO6.cjs');
8
8
  require('../chunk-OBGZSXTJ.cjs');
9
9
  var commander = require('commander');
10
10
 
@@ -12,7 +12,7 @@ var program = new commander.Command();
12
12
  program.name("folderblog").description("Folderblog CLI \u2014 process markdown content").version("0.0.1");
13
13
  program.command("build").description("Process markdown files into JSON output").option("-i, --input <dir>", "Input directory").option("-o, --output <dir>", "Output directory").option("-c, --config <path>", "Config file path (auto-detects folderblog.config.{js,mjs,ts})").action(async (opts) => {
14
14
  try {
15
- await chunk4ZJGUMHS_cjs.build({
15
+ await chunkQ6EYTOTM_cjs.build({
16
16
  input: opts.input,
17
17
  output: opts.output,
18
18
  config: opts.config
package/dist/cli/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { build } from '../chunk-PARGDJNY.js';
3
- import '../chunk-IXP35S24.js';
4
- import '../chunk-ZRUBI3GH.js';
5
- import '../chunk-XP5J4LFJ.js';
2
+ import { build } from '../chunk-K76XLEC7.js';
3
+ import '../chunk-LPPBVXJ7.js';
4
+ import '../chunk-D26H5722.js';
5
+ import '../chunk-B43UAOPC.js';
6
6
  import '../chunk-3RG5ZIWI.js';
7
7
  import { Command } from 'commander';
8
8
 
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk4ZJGUMHS_cjs = require('../chunk-4ZJGUMHS.cjs');
4
- require('../chunk-QA4KPPTA.cjs');
5
- require('../chunk-HMQIQUPB.cjs');
6
- require('../chunk-24MKFHML.cjs');
3
+ var chunkQ6EYTOTM_cjs = require('../chunk-Q6EYTOTM.cjs');
4
+ require('../chunk-J3Y3HEBF.cjs');
5
+ require('../chunk-2TZSVPNP.cjs');
6
+ require('../chunk-6TFXNIO6.cjs');
7
7
  require('../chunk-OBGZSXTJ.cjs');
8
8
 
9
9
  // src/cli/index.ts
@@ -16,7 +16,7 @@ async function importWp(_options) {
16
16
 
17
17
  Object.defineProperty(exports, "build", {
18
18
  enumerable: true,
19
- get: function () { return chunk4ZJGUMHS_cjs.build; }
19
+ get: function () { return chunkQ6EYTOTM_cjs.build; }
20
20
  });
21
21
  exports.importWp = importWp;
22
22
  exports.init = init;
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { build } from '../chunk-PARGDJNY.js';
2
- import '../chunk-IXP35S24.js';
3
- import '../chunk-ZRUBI3GH.js';
4
- import '../chunk-XP5J4LFJ.js';
1
+ export { build } from '../chunk-K76XLEC7.js';
2
+ import '../chunk-LPPBVXJ7.js';
3
+ import '../chunk-D26H5722.js';
4
+ import '../chunk-B43UAOPC.js';
5
5
  import '../chunk-3RG5ZIWI.js';
6
6
 
7
7
  // src/cli/index.ts
@@ -0,0 +1,473 @@
1
+ import { P as ProcessingIssue, I as IssueFilterOptions, a as IssueSeverity, b as IssueReport, c as IssueSummary, d as ProcessedPost, e as ProcessedMedia, C as CacheContext } from './output-0P0br3Jc.cjs';
2
+
3
+ /**
4
+ * Issue Collector Service
5
+ *
6
+ * Functional service for collecting and managing processing issues.
7
+ * Uses immutable patterns - returns new state rather than mutating.
8
+ */
9
+
10
+ interface IssueCollectorState {
11
+ readonly issues: readonly ProcessingIssue[];
12
+ readonly startTime: string;
13
+ }
14
+ /**
15
+ * Service for collecting and managing processing issues.
16
+ * Provides both mutable (class-based) and functional interfaces.
17
+ */
18
+ declare class IssueCollector {
19
+ private issues;
20
+ private readonly startTime;
21
+ constructor();
22
+ /**
23
+ * Add a generic issue
24
+ */
25
+ addIssue(issue: Omit<ProcessingIssue, 'timestamp'>): void;
26
+ /**
27
+ * Add a broken link issue
28
+ */
29
+ addBrokenLink(params: {
30
+ filePath: string;
31
+ lineNumber?: number;
32
+ linkText: string;
33
+ linkTarget: string;
34
+ linkType: 'wiki' | 'markdown' | 'frontmatter';
35
+ suggestions?: readonly string[];
36
+ }): void;
37
+ /**
38
+ * Add a missing media issue
39
+ */
40
+ addMissingMedia(params: {
41
+ filePath: string;
42
+ lineNumber?: number;
43
+ mediaPath: string;
44
+ referencedFrom: 'content' | 'frontmatter' | 'embed';
45
+ originalReference?: string;
46
+ module?: 'embed-media' | 'image-processor';
47
+ }): void;
48
+ /**
49
+ * Add a media processing error
50
+ */
51
+ addMediaProcessingError(params: {
52
+ filePath: string;
53
+ mediaPath: string;
54
+ operation: 'read' | 'optimize' | 'resize' | 'hash' | 'copy';
55
+ errorMessage: string;
56
+ errorCode?: string;
57
+ }): void;
58
+ /**
59
+ * Add a slug conflict warning
60
+ */
61
+ addSlugConflict(params: {
62
+ filePath: string;
63
+ originalSlug: string;
64
+ finalSlug: string;
65
+ conflictingFiles: readonly string[];
66
+ }): void;
67
+ /**
68
+ * Add a mermaid error
69
+ */
70
+ addMermaidError(params: {
71
+ filePath: string;
72
+ lineNumber?: number;
73
+ errorType: 'plugin-load' | 'render-fail' | 'missing-deps';
74
+ message: string;
75
+ diagramContent?: string;
76
+ fallback: string;
77
+ }): void;
78
+ /**
79
+ * Add an embedding error
80
+ */
81
+ addEmbeddingError(params: {
82
+ filePath?: string;
83
+ embeddingType: 'text' | 'image';
84
+ operation: 'initialize' | 'embed' | 'batch';
85
+ errorMessage: string;
86
+ }): void;
87
+ /**
88
+ * Add a plugin error
89
+ */
90
+ addPluginError(params: {
91
+ pluginName: string;
92
+ operation: 'initialize' | 'process' | 'dispose';
93
+ errorMessage: string;
94
+ }): void;
95
+ /**
96
+ * Get all issues
97
+ */
98
+ getIssues(): readonly ProcessingIssue[];
99
+ /**
100
+ * Filter issues
101
+ */
102
+ filterIssues(options: IssueFilterOptions): readonly ProcessingIssue[];
103
+ /**
104
+ * Get issue count by severity
105
+ */
106
+ getCountBySeverity(severity: IssueSeverity): number;
107
+ /**
108
+ * Check if there are any errors
109
+ */
110
+ hasErrors(): boolean;
111
+ /**
112
+ * Get summary string for console output
113
+ */
114
+ getSummaryString(): string;
115
+ /**
116
+ * Generate the final report
117
+ */
118
+ generateReport(): IssueReport;
119
+ /**
120
+ * Clear all issues (for testing)
121
+ */
122
+ clear(): void;
123
+ }
124
+ /**
125
+ * Filter issues based on criteria
126
+ */
127
+ declare const filterIssues: (issues: readonly ProcessingIssue[], options: IssueFilterOptions) => readonly ProcessingIssue[];
128
+ /**
129
+ * Calculate issue summary
130
+ */
131
+ declare const calculateSummary: (issues: readonly ProcessingIssue[]) => IssueSummary;
132
+ /**
133
+ * Generate issue report
134
+ */
135
+ declare const generateIssueReport: (issues: readonly ProcessingIssue[], startTime: string, endTime: string) => IssueReport;
136
+
137
+ /**
138
+ * Plugin system types for @repo-md/processor-core
139
+ *
140
+ * Plugins extend the processor with optional functionality like:
141
+ * - Image optimization (Sharp, Jimp, etc.)
142
+ * - Text embeddings (HuggingFace, OpenAI, Cloudflare)
143
+ * - Image embeddings (CLIP)
144
+ * - Database generation (SQLite)
145
+ * - Diagram rendering (Mermaid)
146
+ */
147
+
148
+ /**
149
+ * Context provided to plugins during initialization
150
+ */
151
+ interface PluginContext {
152
+ /** Output directory for generated files */
153
+ readonly outputDir: string;
154
+ /** Issue collector for reporting problems */
155
+ readonly issues: IssueCollector;
156
+ /** Logger function */
157
+ readonly log: (message: string, level?: LogLevel) => void;
158
+ /** Access to other initialized plugins */
159
+ readonly getPlugin: <T extends Plugin>(name: string) => T | undefined;
160
+ /** Current processor configuration */
161
+ readonly config: ProcessConfig;
162
+ }
163
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error';
164
+ /**
165
+ * Base interface for all plugins
166
+ */
167
+ interface Plugin {
168
+ /** Unique plugin identifier */
169
+ readonly name: string;
170
+ /**
171
+ * Names of plugins this plugin depends on.
172
+ * Dependencies are initialized before this plugin.
173
+ */
174
+ readonly requires?: readonly string[];
175
+ /** Initialize the plugin with context */
176
+ initialize(context: PluginContext): Promise<void>;
177
+ /** Check if plugin is ready to use */
178
+ isReady(): boolean;
179
+ /** Optional cleanup method */
180
+ dispose?(): Promise<void>;
181
+ }
182
+ interface ImageMetadata {
183
+ readonly width: number;
184
+ readonly height: number;
185
+ readonly format: string;
186
+ }
187
+ interface ImageProcessOptions {
188
+ readonly width?: number;
189
+ readonly height?: number;
190
+ readonly format: 'webp' | 'avif' | 'jpeg' | 'png';
191
+ readonly quality?: number;
192
+ }
193
+ interface ImageProcessResult {
194
+ readonly outputPath: string;
195
+ readonly width: number;
196
+ readonly height: number;
197
+ readonly format: string;
198
+ readonly size: number;
199
+ }
200
+ /**
201
+ * Plugin for processing and optimizing images
202
+ */
203
+ interface ImageProcessorPlugin extends Plugin {
204
+ readonly name: 'imageProcessor';
205
+ /** Check if this processor can handle the file type */
206
+ canProcess(filePath: string): boolean;
207
+ /** Get image metadata without processing */
208
+ getMetadata(filePath: string): Promise<ImageMetadata>;
209
+ /** Process/optimize an image */
210
+ process(inputPath: string, outputPath: string, options: ImageProcessOptions): Promise<ImageProcessResult>;
211
+ /** Copy file without processing */
212
+ copy(inputPath: string, outputPath: string): Promise<void>;
213
+ }
214
+ /**
215
+ * Plugin for generating text embeddings
216
+ */
217
+ interface TextEmbeddingPlugin extends Plugin {
218
+ readonly name: 'textEmbedder';
219
+ /** Model identifier (e.g., "Xenova/all-MiniLM-L6-v2") */
220
+ readonly model: string;
221
+ /** Embedding vector dimensions */
222
+ readonly dimensions: number;
223
+ /** Generate embedding for a single text */
224
+ embed(text: string): Promise<readonly number[]>;
225
+ /** Generate embeddings for multiple texts */
226
+ batchEmbed(texts: readonly string[]): Promise<readonly (readonly number[])[]>;
227
+ }
228
+ /**
229
+ * Plugin for generating image embeddings (e.g., CLIP)
230
+ */
231
+ interface ImageEmbeddingPlugin extends Plugin {
232
+ readonly name: 'imageEmbedder';
233
+ /** Model identifier */
234
+ readonly model: string;
235
+ /** Embedding vector dimensions */
236
+ readonly dimensions: number;
237
+ /** Generate embedding from image file path */
238
+ embedFile(filePath: string): Promise<readonly number[]>;
239
+ /** Generate embedding from image buffer */
240
+ embedBuffer(buffer: Buffer, mimeType: string): Promise<readonly number[]>;
241
+ }
242
+ interface SimilarityResult {
243
+ /** Map of "hash1-hash2" -> similarity score */
244
+ readonly pairwiseScores: ReadonlyMap<string, number>;
245
+ /** Map of hash -> array of similar hashes (sorted by similarity) */
246
+ readonly similarPosts: ReadonlyMap<string, readonly string[]>;
247
+ /** Metadata about the computation */
248
+ readonly metadata: {
249
+ readonly computedAt: string;
250
+ readonly postCount: number;
251
+ readonly pairCount: number;
252
+ };
253
+ }
254
+ /**
255
+ * Plugin for computing post similarity
256
+ * Requires: textEmbedder
257
+ */
258
+ interface SimilarityPlugin extends Plugin {
259
+ readonly name: 'similarity';
260
+ readonly requires: readonly ['textEmbedder'];
261
+ /** Compute cosine similarity between two embedding vectors */
262
+ computeSimilarity(a: readonly number[], b: readonly number[]): number;
263
+ /** Generate similarity data for all posts */
264
+ generateSimilarityMap(posts: readonly ProcessedPost[]): Promise<SimilarityResult>;
265
+ }
266
+ interface DatabaseBuildInput {
267
+ readonly posts: readonly ProcessedPost[];
268
+ readonly media: readonly ProcessedMedia[];
269
+ readonly embeddings?: ReadonlyMap<string, readonly number[]>;
270
+ readonly imageEmbeddings?: ReadonlyMap<string, readonly number[]>;
271
+ }
272
+ interface DatabaseResult {
273
+ readonly databasePath: string;
274
+ readonly tables: readonly string[];
275
+ readonly rowCounts: Readonly<Record<string, number>>;
276
+ readonly hasVectorSearch: boolean;
277
+ }
278
+ /**
279
+ * Plugin for building a database from processed content
280
+ */
281
+ interface DatabasePlugin extends Plugin {
282
+ readonly name: 'database';
283
+ /** Build database from processed data */
284
+ build(input: DatabaseBuildInput): Promise<DatabaseResult>;
285
+ }
286
+ type MermaidStrategy = 'img-png' | 'img-svg' | 'inline-svg' | 'pre-mermaid';
287
+ interface MermaidRenderOptions {
288
+ readonly strategy: MermaidStrategy;
289
+ readonly dark?: boolean;
290
+ }
291
+ interface MermaidResult {
292
+ /** Rendered output (SVG string, base64 PNG, or original code) */
293
+ readonly output: string;
294
+ /** Strategy that was actually used */
295
+ readonly strategy: MermaidStrategy;
296
+ }
297
+ /**
298
+ * Plugin for rendering Mermaid diagrams
299
+ */
300
+ interface MermaidRendererPlugin extends Plugin {
301
+ readonly name: 'mermaidRenderer';
302
+ /** Render mermaid code to specified format */
303
+ render(code: string, options: MermaidRenderOptions): Promise<MermaidResult>;
304
+ /** Check if renderer is available (e.g., has browser) */
305
+ isAvailable(): Promise<boolean>;
306
+ }
307
+ /**
308
+ * Type-safe plugin configuration for ProcessConfig
309
+ */
310
+ interface PluginConfig {
311
+ /** Image processor plugin */
312
+ imageProcessor?: ImageProcessorPlugin;
313
+ /** Text embedding plugin */
314
+ textEmbedder?: TextEmbeddingPlugin;
315
+ /** Image embedding plugin */
316
+ imageEmbedder?: ImageEmbeddingPlugin;
317
+ /** Similarity computation plugin */
318
+ similarity?: SimilarityPlugin;
319
+ /** Database generation plugin */
320
+ database?: DatabasePlugin;
321
+ /** Mermaid rendering plugin */
322
+ mermaidRenderer?: MermaidRendererPlugin;
323
+ }
324
+ /**
325
+ * Union type of all plugin names
326
+ */
327
+ type PluginName = keyof PluginConfig;
328
+ /**
329
+ * Get plugin type by name
330
+ */
331
+ type PluginByName<N extends PluginName> = NonNullable<PluginConfig[N]>;
332
+
333
+ /**
334
+ * Configuration types for @repo-md/processor-core
335
+ */
336
+
337
+ interface ImageSizeConfig {
338
+ readonly width: number | null;
339
+ readonly height: number | null;
340
+ readonly suffix: string;
341
+ }
342
+ /** Default image sizes for responsive images */
343
+ declare const DEFAULT_IMAGE_SIZES: readonly ImageSizeConfig[];
344
+ interface DirectoryConfig {
345
+ /** Base directory for resolving relative paths (default: cwd) */
346
+ readonly base?: string;
347
+ /** Input directory */
348
+ readonly input: string;
349
+ /** Output directory for generated files (default: input + '/dist') */
350
+ readonly output?: string;
351
+ /** Media output subdirectory (default: '_media') */
352
+ readonly mediaOutput?: string;
353
+ /** Posts output subdirectory for individual post JSON files */
354
+ readonly postsOutput?: string;
355
+ }
356
+ interface MediaConfig {
357
+ /** Skip media processing entirely */
358
+ readonly skip?: boolean;
359
+ /** Whether to optimize images (default: true if imageProcessor plugin available) */
360
+ readonly optimize?: boolean;
361
+ /** Image sizes to generate */
362
+ readonly sizes?: readonly ImageSizeConfig[];
363
+ /** Output format for optimized images (default: 'webp') */
364
+ readonly format?: 'webp' | 'avif' | 'jpeg' | 'png';
365
+ /** Quality for lossy formats (default: 80) */
366
+ readonly quality?: number;
367
+ /** Whether to use content hash for filenames (default: true) */
368
+ readonly useHash?: boolean;
369
+ /** Whether to shard hashed files by first 2 chars (default: false) */
370
+ readonly useSharding?: boolean;
371
+ /** Domain for absolute URLs */
372
+ readonly domain?: string;
373
+ /** Asset path prefix (default: '/_media') */
374
+ readonly pathPrefix?: string;
375
+ }
376
+ interface ContentConfig {
377
+ /** URL prefix for notes (default: '/content') */
378
+ readonly notePathPrefix?: string;
379
+ /** Whether to process all files regardless of 'public' frontmatter */
380
+ readonly processAllFiles?: boolean;
381
+ /** Files to ignore during processing */
382
+ readonly ignoreFiles?: readonly string[];
383
+ /** Whether to export individual post JSON files */
384
+ readonly exportPosts?: boolean;
385
+ /** Whether to track relationships between posts */
386
+ readonly trackRelationships?: boolean;
387
+ /** Include slug tracking information in output */
388
+ readonly includeSlugTracking?: boolean;
389
+ /** Strategy for resolving slug conflicts */
390
+ readonly slugConflictStrategy?: 'number' | 'hash';
391
+ /** Scope for slug deduplication: 'global' (default) or 'top-folder' (per top-level directory) */
392
+ readonly slugScope?: 'global' | 'top-folder';
393
+ }
394
+ interface MermaidConfig {
395
+ /** Whether mermaid rendering is enabled (default: true) */
396
+ readonly enabled?: boolean;
397
+ /** Rendering strategy (default: 'inline-svg') */
398
+ readonly strategy?: 'img-png' | 'img-svg' | 'inline-svg' | 'pre-mermaid';
399
+ /** Enable dark mode support */
400
+ readonly dark?: boolean;
401
+ /** Custom mermaid configuration */
402
+ readonly mermaidConfig?: Readonly<Record<string, unknown>>;
403
+ }
404
+ interface PipelineConfig {
405
+ /** Enable GitHub Flavored Markdown (default: true) */
406
+ readonly gfm?: boolean;
407
+ /** Allow raw HTML in markdown (default: true) */
408
+ readonly allowRawHtml?: boolean;
409
+ /** Enable syntax highlighting for code blocks (default: true) */
410
+ readonly syntaxHighlighting?: boolean;
411
+ /** Enable LaTeX formula parsing (default: false) */
412
+ readonly parseFormulas?: boolean;
413
+ /** Remove broken/dead links instead of keeping them (default: false) */
414
+ readonly removeDeadLinks?: boolean;
415
+ /** Enable wiki-link resolution ([[Page Name]] → <a href="/slug">) (default: true) */
416
+ readonly wikiLinks?: boolean;
417
+ }
418
+ interface SimilarityConfig {
419
+ /** Number of similar posts to return per post (default: 5) */
420
+ readonly topN?: number;
421
+ /** Minimum similarity score threshold (default: 0) */
422
+ readonly threshold?: number;
423
+ }
424
+ interface DebugConfig {
425
+ /** Debug level (0=off, 1=basic, 2=verbose) */
426
+ readonly level?: number;
427
+ /** Log timing information */
428
+ readonly timing?: boolean;
429
+ }
430
+ interface ProcessConfig {
431
+ /** Directory configuration */
432
+ readonly dir: DirectoryConfig;
433
+ /** Plugin configuration */
434
+ readonly plugins?: PluginConfig;
435
+ /** Media processing configuration */
436
+ readonly media?: MediaConfig;
437
+ /** Content processing configuration */
438
+ readonly content?: ContentConfig;
439
+ /** Mermaid rendering configuration */
440
+ readonly mermaid?: MermaidConfig;
441
+ /** Markdown pipeline configuration */
442
+ readonly pipeline?: PipelineConfig;
443
+ /** Similarity computation configuration */
444
+ readonly similarity?: SimilarityConfig;
445
+ /** Debug configuration */
446
+ readonly debug?: DebugConfig;
447
+ /**
448
+ * Cache context for incremental builds.
449
+ * When provided, the processor will skip processing files
450
+ * whose content hash matches a cached entry and use cached metadata instead.
451
+ */
452
+ readonly cache?: CacheContext;
453
+ }
454
+ /**
455
+ * ProcessConfig with all fields required except cache (which remains optional)
456
+ */
457
+ type ProcessConfigWithDefaults = Required<Omit<ProcessConfig, 'cache'>> & {
458
+ cache?: CacheContext;
459
+ };
460
+ /**
461
+ * Merge configuration with defaults
462
+ */
463
+ declare const withDefaults: (config: ProcessConfig) => ProcessConfigWithDefaults;
464
+ /**
465
+ * Get output directory from config
466
+ */
467
+ declare const getOutputDir: (config: ProcessConfig) => string;
468
+ /**
469
+ * Get media output directory from config
470
+ */
471
+ declare const getMediaOutputDir: (config: ProcessConfig) => string;
472
+
473
+ export { calculateSummary as A, filterIssues as B, type ContentConfig as C, DEFAULT_IMAGE_SIZES as D, generateIssueReport as E, getMediaOutputDir as F, getOutputDir as G, withDefaults as H, type ImageEmbeddingPlugin as I, type LogLevel as L, type MediaConfig as M, type PluginContext as P, type SimilarityConfig as S, type TextEmbeddingPlugin as T, type DatabaseBuildInput as a, type DatabasePlugin as b, type DatabaseResult as c, type DebugConfig as d, type DirectoryConfig as e, type ImageMetadata as f, type ImageProcessOptions as g, type ImageProcessResult as h, type ImageProcessorPlugin as i, type ImageSizeConfig as j, IssueCollector as k, type IssueCollectorState as l, type MermaidConfig as m, type MermaidRenderOptions as n, type MermaidRendererPlugin as o, type MermaidResult as p, type MermaidStrategy as q, type PipelineConfig as r, type Plugin as s, type PluginByName as t, type PluginConfig as u, type PluginName as v, type ProcessConfig as w, type ProcessConfigWithDefaults as x, type SimilarityPlugin as y, type SimilarityResult as z };