folderblog 0.0.1 → 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.
- package/README.md +109 -48
- package/dist/chunk-2TZSVPNP.cjs +148 -0
- package/dist/chunk-3RG5ZIWI.js +8 -0
- package/dist/chunk-6TFXNIO6.cjs +495 -0
- package/dist/chunk-B43UAOPC.js +475 -0
- package/dist/chunk-D26H5722.js +132 -0
- package/dist/chunk-E7PYGJA7.cjs +39 -0
- package/dist/chunk-J3Y3HEBF.cjs +1858 -0
- package/dist/chunk-K76XLEC7.js +76 -0
- package/dist/chunk-LPPBVXJ7.js +1786 -0
- package/dist/chunk-OBGZSXTJ.cjs +10 -0
- package/dist/chunk-Q6EXKX6K.js +17 -0
- package/dist/chunk-Q6EYTOTM.cjs +78 -0
- package/dist/chunk-UCXXH2MP.cjs +20 -0
- package/dist/chunk-XQD3UUL5.js +34 -0
- package/dist/cli/bin.cjs +25 -0
- package/dist/cli/bin.d.cts +1 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +23 -0
- package/dist/cli/index.cjs +22 -0
- package/dist/cli/index.d.cts +39 -0
- package/dist/cli/index.d.ts +39 -0
- package/dist/cli/index.js +15 -0
- package/dist/config-ADPY6IQS.d.cts +473 -0
- package/dist/config-Dctsdeo6.d.ts +473 -0
- package/dist/index.cjs +458 -1
- package/dist/index.d.cts +78 -9
- package/dist/index.d.ts +78 -9
- package/dist/index.js +100 -1
- package/dist/local/index.cjs +785 -0
- package/dist/local/index.d.cts +268 -0
- package/dist/local/index.d.ts +268 -0
- package/dist/local/index.js +772 -0
- package/dist/output-0P0br3Jc.d.cts +452 -0
- package/dist/output-0P0br3Jc.d.ts +452 -0
- package/dist/plugins/embed-cloudflare-ai.cjs +166 -0
- package/dist/plugins/embed-cloudflare-ai.d.cts +73 -0
- package/dist/plugins/embed-cloudflare-ai.d.ts +73 -0
- package/dist/plugins/embed-cloudflare-ai.js +156 -0
- package/dist/plugins/embed-transformers.cjs +121 -0
- package/dist/plugins/embed-transformers.d.cts +55 -0
- package/dist/plugins/embed-transformers.d.ts +55 -0
- package/dist/plugins/embed-transformers.js +113 -0
- package/dist/plugins/similarity.cjs +19 -0
- package/dist/plugins/similarity.d.cts +41 -0
- package/dist/plugins/similarity.d.ts +41 -0
- package/dist/plugins/similarity.js +2 -0
- package/dist/processor/index.cjs +349 -0
- package/dist/processor/index.d.cts +495 -0
- package/dist/processor/index.d.ts +495 -0
- package/dist/processor/index.js +4 -0
- package/dist/processor/plugins.cjs +63 -0
- package/dist/processor/plugins.d.cts +176 -0
- package/dist/processor/plugins.d.ts +176 -0
- package/dist/processor/plugins.js +2 -0
- package/dist/processor/types.cjs +67 -0
- package/dist/processor/types.d.cts +48 -0
- package/dist/processor/types.d.ts +48 -0
- package/dist/processor/types.js +2 -0
- package/dist/seo/index.cjs +289 -0
- package/dist/seo/index.d.cts +95 -0
- package/dist/seo/index.d.ts +95 -0
- package/dist/seo/index.js +274 -0
- package/dist/server/index.cjs +33 -0
- package/dist/server/index.d.cts +56 -0
- package/dist/server/index.d.ts +56 -0
- package/dist/server/index.js +31 -0
- package/package.json +98 -11
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { w as ProcessConfig, L as LogLevel, k as IssueCollector } from '../config-Dctsdeo6.js';
|
|
2
|
+
export { C as ContentConfig, D as DEFAULT_IMAGE_SIZES, a as DatabaseBuildInput, b as DatabasePlugin, c as DatabaseResult, d as DebugConfig, e as DirectoryConfig, I as ImageEmbeddingPlugin, f as ImageMetadata, g as ImageProcessOptions, h as ImageProcessResult, i as ImageProcessorPlugin, j as ImageSizeConfig, l as IssueCollectorState, M as MediaConfig, m as MermaidConfig, n as MermaidRenderOptions, o as MermaidRendererPlugin, p as MermaidResult, q as MermaidStrategy, r as PipelineConfig, s as Plugin, t as PluginByName, u as PluginConfig, P as PluginContext, v as PluginName, x as ProcessConfigWithDefaults, S as SimilarityConfig, y as SimilarityPlugin, z as SimilarityResult, T as TextEmbeddingPlugin, A as calculateSummary, B as filterIssues, E as generateIssueReport, F as getMediaOutputDir, G as getOutputDir, H as withDefaults } from '../config-Dctsdeo6.js';
|
|
3
|
+
import { A as ProcessResult, d as ProcessedPost } from '../output-0P0br3Jc.js';
|
|
4
|
+
export { B as BrokenLinkIssue, f as BuildReport, C as CacheContext, g as CacheStats, h as CachedMediaMetadata, i as CachedMediaSizeVariant, E as EmbeddingErrorIssue, j as EmbeddingMap, G as GraphData, k as GraphEdge, l as GraphNode, m as IssueCategory, I as IssueFilterOptions, n as IssueModule, b as IssueReport, a as IssueSeverity, c as IssueSummary, M as MediaMetadata, o as MediaPathMap, p as MediaProcessingIssue, q as MediaSizeVariant, r as MermaidErrorIssue, s as MissingMediaIssue, O as OUTPUT_FILES, t as OutputFiles, u as PathHashMap, v as PluginErrorIssue, w as PostCover, x as PostCoverError, y as PostCoverSize, z as PostMetadata, e as ProcessedMedia, P as ProcessingIssue, R as RelationshipType, S as SlugConflictIssue, D as SlugHashMap, T as TocItem, F as buildEmbeddingCacheFromManifest, H as buildMediaCacheFromManifest, J as createEmptyCacheStats, K as isBrokenLinkIssue, L as isEmbeddingErrorIssue, N as isMediaProcessingIssue, Q as isMermaidErrorIssue, U as isMissingMediaIssue, V as isPluginErrorIssue, W as isSlugConflictIssue } from '../output-0P0br3Jc.js';
|
|
5
|
+
import { FileMap, LinkResolverOptions, ObsidianLink } from './types.js';
|
|
6
|
+
export { BlockOnly, HeaderOnly, PageAndBlock, PageAndHeader, PageOnly } from './types.js';
|
|
7
|
+
export { CopyOnlyImageProcessor, NoOpDatabase, NoOpImageEmbedder, NoOpSimilarity, NoOpTextEmbedder, PassthroughMermaidRenderer, PluginManager, PluginManagerConfig, createAllNoOpPlugins, createDefaultPlugins, createPluginManager, topologicalSort } from './plugins.js';
|
|
8
|
+
export { CosineSimilarityPlugin, SimilarityPluginOptions, cosineSimilarity, createSimilarityPlugin } from '../plugins/similarity.js';
|
|
9
|
+
import { Root } from 'mdast';
|
|
10
|
+
import { Root as Root$1 } from 'hast';
|
|
11
|
+
import { ToLink, WikiLink } from 'remark-obsidian-link';
|
|
12
|
+
import { Plugin } from 'unified';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Core Processor
|
|
16
|
+
*
|
|
17
|
+
* Main processor class that orchestrates markdown processing with plugins.
|
|
18
|
+
* This is the primary entry point for processing markdown folders.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Options for creating a processor
|
|
23
|
+
*/
|
|
24
|
+
interface ProcessorOptions {
|
|
25
|
+
readonly config: ProcessConfig;
|
|
26
|
+
readonly log?: (message: string, level?: LogLevel) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Core Processor for markdown folders
|
|
30
|
+
*
|
|
31
|
+
* Processes markdown files and media, generating structured JSON output.
|
|
32
|
+
* Uses a plugin architecture for extensibility.
|
|
33
|
+
*/
|
|
34
|
+
declare class Processor {
|
|
35
|
+
private readonly config;
|
|
36
|
+
private readonly pluginManager;
|
|
37
|
+
private readonly issues;
|
|
38
|
+
private readonly log;
|
|
39
|
+
private initialized;
|
|
40
|
+
constructor(options: ProcessorOptions);
|
|
41
|
+
/**
|
|
42
|
+
* Initialize the processor and plugins
|
|
43
|
+
*/
|
|
44
|
+
initialize(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Dispose the processor and cleanup resources
|
|
47
|
+
*/
|
|
48
|
+
dispose(): Promise<void>;
|
|
49
|
+
private resolveInputDir;
|
|
50
|
+
private resolveOutputDir;
|
|
51
|
+
/**
|
|
52
|
+
* Process the folder and generate output
|
|
53
|
+
*/
|
|
54
|
+
process(): Promise<ProcessResult>;
|
|
55
|
+
private timed;
|
|
56
|
+
private processMedia;
|
|
57
|
+
private processMarkdownFiles;
|
|
58
|
+
/**
|
|
59
|
+
* Phase 1: Parse a markdown file — extract all metadata but use basic HTML.
|
|
60
|
+
* The markdown source is stored for Phase 2 re-rendering.
|
|
61
|
+
*/
|
|
62
|
+
private parseMarkdownFile;
|
|
63
|
+
/**
|
|
64
|
+
* Phase 2: Build file maps from all parsed posts, then re-render each
|
|
65
|
+
* file's markdown through a pipeline that includes wiki-link resolution.
|
|
66
|
+
*/
|
|
67
|
+
private renderPostsWithLinks;
|
|
68
|
+
/**
|
|
69
|
+
* Build absolute URL from relative path using domain config
|
|
70
|
+
* URL structure: {domain}/_shared/medias/{filename}
|
|
71
|
+
*/
|
|
72
|
+
private buildAbsoluteUrl;
|
|
73
|
+
/**
|
|
74
|
+
* Resolve cover image from frontmatter
|
|
75
|
+
* Returns PostCover if found, PostCoverError if specified but not found, undefined if not specified
|
|
76
|
+
*/
|
|
77
|
+
private resolveCover;
|
|
78
|
+
private generateEmbeddings;
|
|
79
|
+
private generateSimilarity;
|
|
80
|
+
private buildDatabase;
|
|
81
|
+
private writeOutput;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Create and initialize a processor
|
|
85
|
+
*/
|
|
86
|
+
declare const createProcessor: (config: ProcessConfig) => Promise<Processor>;
|
|
87
|
+
/**
|
|
88
|
+
* Process a folder with the given configuration
|
|
89
|
+
* Convenience function that creates, processes, and disposes a processor
|
|
90
|
+
*/
|
|
91
|
+
declare const processFolder: (config: ProcessConfig) => Promise<ProcessResult>;
|
|
92
|
+
/** @deprecated Use `processFolder` instead */
|
|
93
|
+
declare const processVault: (config: ProcessConfig) => Promise<ProcessResult>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Markdown Processing Pipeline
|
|
97
|
+
*
|
|
98
|
+
* Core unified pipeline for converting markdown to HTML.
|
|
99
|
+
* Extensible through plugins and options.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Options for the markdown pipeline
|
|
104
|
+
*/
|
|
105
|
+
interface PipelineOptions {
|
|
106
|
+
/** Enable GitHub Flavored Markdown */
|
|
107
|
+
readonly gfm?: boolean;
|
|
108
|
+
/** Allow raw HTML in markdown */
|
|
109
|
+
readonly allowRawHtml?: boolean;
|
|
110
|
+
/** Custom remark plugins to add */
|
|
111
|
+
readonly remarkPlugins?: readonly RemarkPlugin[];
|
|
112
|
+
/** Custom rehype plugins to add */
|
|
113
|
+
readonly rehypePlugins?: readonly RehypePlugin[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A remark plugin with optional options
|
|
117
|
+
*/
|
|
118
|
+
interface RemarkPlugin {
|
|
119
|
+
readonly plugin: unknown;
|
|
120
|
+
readonly options?: unknown;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A rehype plugin with optional options
|
|
124
|
+
*/
|
|
125
|
+
interface RehypePlugin {
|
|
126
|
+
readonly plugin: unknown;
|
|
127
|
+
readonly options?: unknown;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Result of parsing frontmatter
|
|
131
|
+
*/
|
|
132
|
+
interface FrontmatterResult {
|
|
133
|
+
readonly content: string;
|
|
134
|
+
readonly data: Readonly<Record<string, unknown>>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Result of processing markdown
|
|
138
|
+
*/
|
|
139
|
+
interface MarkdownResult {
|
|
140
|
+
/** Processed HTML content */
|
|
141
|
+
readonly html: string;
|
|
142
|
+
/** Original markdown (without frontmatter) */
|
|
143
|
+
readonly markdown: string;
|
|
144
|
+
/** Parsed frontmatter data */
|
|
145
|
+
readonly frontmatter: Readonly<Record<string, unknown>>;
|
|
146
|
+
/** MDAST root node */
|
|
147
|
+
readonly mdast: Root;
|
|
148
|
+
/** HAST root node */
|
|
149
|
+
readonly hast: Root$1;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Parse frontmatter from markdown content
|
|
153
|
+
*/
|
|
154
|
+
declare const parseFrontmatter: (content: string) => FrontmatterResult;
|
|
155
|
+
/**
|
|
156
|
+
* Default pipeline options
|
|
157
|
+
*/
|
|
158
|
+
declare const DEFAULT_PIPELINE_OPTIONS: PipelineOptions;
|
|
159
|
+
/**
|
|
160
|
+
* Create a basic markdown to HTML processor
|
|
161
|
+
* Uses 'any' for processor type to avoid complex unified generic constraints
|
|
162
|
+
*/
|
|
163
|
+
declare const createBasePipeline: (options?: PipelineOptions) => any;
|
|
164
|
+
/**
|
|
165
|
+
* Parse markdown to MDAST
|
|
166
|
+
*/
|
|
167
|
+
declare const parseToMdast: (markdown: string) => Root;
|
|
168
|
+
/**
|
|
169
|
+
* Convert MDAST to HAST
|
|
170
|
+
*/
|
|
171
|
+
declare const mdastToHast: (mdast: Root, options?: {
|
|
172
|
+
allowDangerousHtml?: boolean;
|
|
173
|
+
}) => Promise<Root$1>;
|
|
174
|
+
/**
|
|
175
|
+
* Convert HAST to HTML string
|
|
176
|
+
*/
|
|
177
|
+
declare const hastToHtml: (hast: Root$1) => string;
|
|
178
|
+
/**
|
|
179
|
+
* Process markdown content to HTML with full metadata
|
|
180
|
+
*/
|
|
181
|
+
declare const processMarkdown: (content: string, options?: PipelineOptions) => Promise<MarkdownResult>;
|
|
182
|
+
/**
|
|
183
|
+
* Extract text content from MDAST
|
|
184
|
+
*/
|
|
185
|
+
declare const mdastToText: (node: Root) => string;
|
|
186
|
+
/**
|
|
187
|
+
* Extract first paragraph text from MDAST
|
|
188
|
+
*/
|
|
189
|
+
declare const extractFirstParagraph: (mdast: Root) => string;
|
|
190
|
+
/**
|
|
191
|
+
* Extract headings from MDAST
|
|
192
|
+
*/
|
|
193
|
+
declare const extractHeadings: (mdast: Root) => readonly {
|
|
194
|
+
depth: number;
|
|
195
|
+
text: string;
|
|
196
|
+
}[];
|
|
197
|
+
/**
|
|
198
|
+
* Build table of contents from headings
|
|
199
|
+
*/
|
|
200
|
+
declare const buildToc: (headings: readonly {
|
|
201
|
+
depth: number;
|
|
202
|
+
text: string;
|
|
203
|
+
}[]) => readonly {
|
|
204
|
+
depth: number;
|
|
205
|
+
text: string;
|
|
206
|
+
slug: string;
|
|
207
|
+
}[];
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Word Count Utilities
|
|
211
|
+
*
|
|
212
|
+
* Functions for counting words in text content.
|
|
213
|
+
*/
|
|
214
|
+
/**
|
|
215
|
+
* Count words in a text string
|
|
216
|
+
* Handles multiple languages and common edge cases
|
|
217
|
+
*/
|
|
218
|
+
declare const countWords: (text: string) => number;
|
|
219
|
+
/**
|
|
220
|
+
* Estimate reading time in minutes
|
|
221
|
+
* Uses average reading speed of 200 words per minute
|
|
222
|
+
*/
|
|
223
|
+
declare const estimateReadingTime: (wordCount: number, wordsPerMinute?: number) => number;
|
|
224
|
+
/**
|
|
225
|
+
* Get word count and reading time for content
|
|
226
|
+
*/
|
|
227
|
+
declare const getContentStats: (text: string) => {
|
|
228
|
+
readonly wordCount: number;
|
|
229
|
+
readonly readingTimeMinutes: number;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Path resolution utilities for file lookups.
|
|
234
|
+
* Ported from @repo-md/repo-processor.
|
|
235
|
+
*/
|
|
236
|
+
interface FileItem {
|
|
237
|
+
originalPath: string;
|
|
238
|
+
fileName: string;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Find files by filename with case-insensitive matching
|
|
242
|
+
*/
|
|
243
|
+
declare function findByFileNameCaseInsensitive<T extends FileItem>(fileName: string, fileMap: Map<string, T[]>): T[];
|
|
244
|
+
/**
|
|
245
|
+
* Resolve from multiple candidates, preferring files in the same directory
|
|
246
|
+
*/
|
|
247
|
+
declare function resolveFromCandidates<T extends FileItem>(candidates: T[], currentFilePath?: string): T | null;
|
|
248
|
+
/**
|
|
249
|
+
* Create path variations for flexible matching
|
|
250
|
+
*/
|
|
251
|
+
declare function createPathVariations(targetPath: string, currentFilePath?: string): string[];
|
|
252
|
+
/**
|
|
253
|
+
* Universal file resolver combining path and name lookups
|
|
254
|
+
*/
|
|
255
|
+
declare function resolveFile<T extends FileItem>(targetPath: string, options: {
|
|
256
|
+
byPath: Map<string, T>;
|
|
257
|
+
byName?: Map<string, T[]>;
|
|
258
|
+
currentFilePath?: string;
|
|
259
|
+
extensions?: string[];
|
|
260
|
+
}): T | null;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Link resolver — builds file maps and resolves wiki/markdown links.
|
|
264
|
+
* Ported from @repo-md/repo-processor, adapted for ProcessedPost.
|
|
265
|
+
*/
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Build maps for efficient file lookups
|
|
269
|
+
*/
|
|
270
|
+
declare function buildFileMaps(posts: ProcessedPost[]): FileMap;
|
|
271
|
+
/**
|
|
272
|
+
* Resolve a wikilink to a specific post
|
|
273
|
+
*/
|
|
274
|
+
declare function resolveWikilink(wikilink: string, fileMap: FileMap, currentFilePath: string): ProcessedPost | null;
|
|
275
|
+
/**
|
|
276
|
+
* Convert a wikilink to a markdown link format
|
|
277
|
+
*/
|
|
278
|
+
declare function wikilinkToMarkdownLink(wikilink: string, alias: string | undefined, targetFile: ProcessedPost, options: LinkResolverOptions): {
|
|
279
|
+
url: string;
|
|
280
|
+
text: string;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Resolve markdown links to final URLs
|
|
284
|
+
*/
|
|
285
|
+
declare function resolveMarkdownLink(href: string, fileMap: FileMap, currentFilePath: string, options: LinkResolverOptions): string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Wiki-link remark plugin — parses [[wiki]] syntax and resolves to URLs.
|
|
289
|
+
* Combined from repo-processor's toLinkBuilder.ts + customToLink.ts.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
declare function wikiToObsidian(wikiLink: WikiLink): ObsidianLink;
|
|
293
|
+
interface CustomToLinkOptions {
|
|
294
|
+
filesBySlug: Map<string, ProcessedPost>;
|
|
295
|
+
filesByName: Map<string, ProcessedPost>;
|
|
296
|
+
filesByPath: Map<string, ProcessedPost>;
|
|
297
|
+
filesByAlias: Map<string, ProcessedPost[]>;
|
|
298
|
+
urlPrefix: string;
|
|
299
|
+
currentFile?: ProcessedPost;
|
|
300
|
+
issueCollector?: IssueCollector;
|
|
301
|
+
}
|
|
302
|
+
declare function createCustomToLink(options: CustomToLinkOptions): ToLink;
|
|
303
|
+
/**
|
|
304
|
+
* Resolve a markdown link path relative to the current file
|
|
305
|
+
*/
|
|
306
|
+
declare function resolveMarkdownLinkPath(linkPath: string, currentFilePath: string, filesByPath: Map<string, ProcessedPost>): ProcessedPost | null;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Remark plugin to resolve markdown links with relative path resolution.
|
|
310
|
+
* Ported from @repo-md/repo-processor remarkMarkdownLinkResolver.
|
|
311
|
+
*/
|
|
312
|
+
|
|
313
|
+
interface RemarkMarkdownLinkResolverOptions {
|
|
314
|
+
filesByPath: Map<string, ProcessedPost>;
|
|
315
|
+
urlPrefix: string;
|
|
316
|
+
currentFilePath: string;
|
|
317
|
+
}
|
|
318
|
+
declare const remarkMarkdownLinkResolver: Plugin<[
|
|
319
|
+
RemarkMarkdownLinkResolverOptions
|
|
320
|
+
], Root>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Slug Utilities
|
|
324
|
+
*
|
|
325
|
+
* Functions for generating and managing URL-friendly slugs.
|
|
326
|
+
*/
|
|
327
|
+
/**
|
|
328
|
+
* Convert a string to a URL-friendly slug
|
|
329
|
+
*/
|
|
330
|
+
declare const toSlug: (s: string) => string;
|
|
331
|
+
/**
|
|
332
|
+
* Information about a generated slug
|
|
333
|
+
*/
|
|
334
|
+
interface SlugInfo {
|
|
335
|
+
readonly slug: string;
|
|
336
|
+
readonly originalSlug: string;
|
|
337
|
+
readonly source: 'frontmatter' | 'filename' | 'folder';
|
|
338
|
+
readonly wasModified: boolean;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Configuration for slug generation
|
|
342
|
+
*/
|
|
343
|
+
interface SlugConfig {
|
|
344
|
+
readonly conflictStrategy: 'number' | 'hash';
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Result of slug assignment
|
|
348
|
+
*/
|
|
349
|
+
interface SlugAssignment {
|
|
350
|
+
readonly filePath: string;
|
|
351
|
+
readonly slug: string;
|
|
352
|
+
readonly info: SlugInfo;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Options for generating a base slug
|
|
356
|
+
*/
|
|
357
|
+
interface BaseSlugOptions {
|
|
358
|
+
readonly fileName: string;
|
|
359
|
+
readonly parentFolder?: string;
|
|
360
|
+
readonly siblingCount?: number;
|
|
361
|
+
readonly frontmatterSlug?: string;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Generate a base slug from file info
|
|
365
|
+
* Uses file name by default, parent folder for index.md without siblings
|
|
366
|
+
*/
|
|
367
|
+
declare const generateBaseSlug: (options: BaseSlugOptions) => {
|
|
368
|
+
slug: string;
|
|
369
|
+
source: SlugInfo["source"];
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Resolve a slug conflict by adding a numeric suffix
|
|
373
|
+
*/
|
|
374
|
+
declare const resolveSlugConflict: (baseSlug: string, usedSlugs: ReadonlySet<string>, strategy?: "number" | "hash") => string;
|
|
375
|
+
/**
|
|
376
|
+
* Immutable slug manager for tracking used slugs
|
|
377
|
+
*/
|
|
378
|
+
declare class SlugManager {
|
|
379
|
+
private readonly usedSlugs;
|
|
380
|
+
private readonly scopedSlugs;
|
|
381
|
+
private readonly fileSlugs;
|
|
382
|
+
private readonly strategy;
|
|
383
|
+
constructor(strategy?: 'number' | 'hash');
|
|
384
|
+
/**
|
|
385
|
+
* Check if a slug is already used
|
|
386
|
+
*/
|
|
387
|
+
isUsed(slug: string): boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Get slug info for a file path
|
|
390
|
+
*/
|
|
391
|
+
getSlugInfo(filePath: string): SlugInfo | undefined;
|
|
392
|
+
/**
|
|
393
|
+
* Get the slug map for a given scope, creating it if needed
|
|
394
|
+
*/
|
|
395
|
+
private getScopeMap;
|
|
396
|
+
/**
|
|
397
|
+
* Reserve a slug for a file
|
|
398
|
+
* @param scope - Optional scope for slug deduplication (e.g. top-level folder)
|
|
399
|
+
*/
|
|
400
|
+
reserve(filePath: string, options: BaseSlugOptions, scope?: string): SlugInfo;
|
|
401
|
+
/**
|
|
402
|
+
* Get all assigned slugs
|
|
403
|
+
*/
|
|
404
|
+
getAllSlugs(): ReadonlyMap<string, SlugInfo>;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Hash Utilities
|
|
409
|
+
*
|
|
410
|
+
* Functions for generating content hashes.
|
|
411
|
+
*/
|
|
412
|
+
/**
|
|
413
|
+
* Calculate SHA-256 hash of a content string
|
|
414
|
+
*/
|
|
415
|
+
declare const hashContent: (content: string) => string;
|
|
416
|
+
/**
|
|
417
|
+
* Calculate SHA-256 hash of a buffer
|
|
418
|
+
*/
|
|
419
|
+
declare const hashBuffer: (buffer: Buffer) => string;
|
|
420
|
+
/**
|
|
421
|
+
* Calculate a short hash (first N characters)
|
|
422
|
+
*/
|
|
423
|
+
declare const shortHash: (content: string, length?: number) => string;
|
|
424
|
+
/**
|
|
425
|
+
* Create a deterministic hash from multiple values
|
|
426
|
+
*/
|
|
427
|
+
declare const combineHashes: (...values: readonly string[]) => string;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* File Utilities
|
|
431
|
+
*
|
|
432
|
+
* Functions for file system operations.
|
|
433
|
+
*/
|
|
434
|
+
/**
|
|
435
|
+
* Get file name without extension
|
|
436
|
+
*/
|
|
437
|
+
declare const getFileName: (filePath: string) => string;
|
|
438
|
+
/**
|
|
439
|
+
* Get file extension without dot
|
|
440
|
+
*/
|
|
441
|
+
declare const getExtension: (filePath: string) => string;
|
|
442
|
+
/**
|
|
443
|
+
* Check if a file exists
|
|
444
|
+
*/
|
|
445
|
+
declare const fileExists: (filePath: string) => Promise<boolean>;
|
|
446
|
+
/**
|
|
447
|
+
* Ensure a directory exists
|
|
448
|
+
*/
|
|
449
|
+
declare const ensureDir: (dirPath: string) => Promise<void>;
|
|
450
|
+
/**
|
|
451
|
+
* Write JSON to a file
|
|
452
|
+
*/
|
|
453
|
+
declare const writeJson: (filePath: string, data: unknown) => Promise<void>;
|
|
454
|
+
/**
|
|
455
|
+
* Read JSON from a file
|
|
456
|
+
*/
|
|
457
|
+
declare const readJson: <T = unknown>(filePath: string) => Promise<T>;
|
|
458
|
+
/**
|
|
459
|
+
* Write text to a file
|
|
460
|
+
*/
|
|
461
|
+
declare const writeText: (filePath: string, content: string) => Promise<void>;
|
|
462
|
+
/**
|
|
463
|
+
* Read text from a file
|
|
464
|
+
*/
|
|
465
|
+
declare const readText: (filePath: string) => Promise<string>;
|
|
466
|
+
/**
|
|
467
|
+
* Copy a file
|
|
468
|
+
*/
|
|
469
|
+
declare const copyFile: (src: string, dest: string) => Promise<void>;
|
|
470
|
+
/**
|
|
471
|
+
* Get file stats
|
|
472
|
+
*/
|
|
473
|
+
declare const getStats: (filePath: string) => Promise<{
|
|
474
|
+
size: number;
|
|
475
|
+
created: Date;
|
|
476
|
+
modified: Date;
|
|
477
|
+
}>;
|
|
478
|
+
/**
|
|
479
|
+
* Find files matching a pattern in a directory
|
|
480
|
+
*/
|
|
481
|
+
declare const findFiles: (dir: string, predicate: (name: string) => boolean, recursive?: boolean) => Promise<readonly string[]>;
|
|
482
|
+
/**
|
|
483
|
+
* Find markdown files in a directory
|
|
484
|
+
*/
|
|
485
|
+
declare const findMarkdownFiles: (dir: string, recursive?: boolean) => Promise<readonly string[]>;
|
|
486
|
+
/**
|
|
487
|
+
* Get relative path from a base directory
|
|
488
|
+
*/
|
|
489
|
+
declare const relativePath: (from: string, to: string) => string;
|
|
490
|
+
/**
|
|
491
|
+
* Normalize a path to use forward slashes
|
|
492
|
+
*/
|
|
493
|
+
declare const normalizePath: (p: string) => string;
|
|
494
|
+
|
|
495
|
+
export { type BaseSlugOptions, type CustomToLinkOptions, DEFAULT_PIPELINE_OPTIONS, type FileItem, FileMap, type FrontmatterResult, IssueCollector, LinkResolverOptions, LogLevel, type MarkdownResult, ObsidianLink, type PipelineOptions, ProcessConfig, ProcessResult, ProcessedPost, Processor, type ProcessorOptions, type RehypePlugin, type RemarkPlugin, type SlugAssignment, type SlugConfig, SlugManager, buildFileMaps, buildToc, combineHashes, copyFile, countWords, createBasePipeline, createCustomToLink, createPathVariations, createProcessor, ensureDir, estimateReadingTime, extractFirstParagraph, extractHeadings, fileExists, findByFileNameCaseInsensitive, findFiles, findMarkdownFiles, generateBaseSlug, getContentStats, getExtension, getFileName, getStats, hashBuffer, hashContent, hastToHtml, mdastToHast, mdastToText, normalizePath, parseFrontmatter, parseToMdast, processFolder, processMarkdown, processVault, readJson, readText, relativePath, remarkMarkdownLinkResolver, resolveFile, resolveFromCandidates, resolveMarkdownLink, resolveMarkdownLinkPath, resolveSlugConflict, resolveWikilink, shortHash, toSlug, wikiToObsidian, wikilinkToMarkdownLink, writeJson, writeText };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DEFAULT_PIPELINE_OPTIONS, IssueCollector, Processor, SlugManager, buildFileMaps, buildToc, calculateSummary, combineHashes, copyFile, countWords, createBasePipeline, createCustomToLink, createPathVariations, createProcessor, ensureDir, estimateReadingTime, extractFirstParagraph, extractHeadings, fileExists, filterIssues, findByFileNameCaseInsensitive, findFiles, findMarkdownFiles, generateBaseSlug, generateIssueReport, getContentStats, getExtension, getFileName, getStats, hashBuffer, hashContent, hastToHtml, mdastToHast, mdastToText, normalizePath, parseFrontmatter, parseToMdast, processFolder, processMarkdown, processVault, readJson, readText, relativePath, remarkMarkdownLinkResolver, resolveFile, resolveFromCandidates, resolveMarkdownLink, resolveMarkdownLinkPath, resolveSlugConflict, resolveWikilink, shortHash, toSlug, wikiToObsidian, wikilinkToMarkdownLink, writeJson, writeText } from '../chunk-LPPBVXJ7.js';
|
|
2
|
+
export { DEFAULT_IMAGE_SIZES, OUTPUT_FILES, buildEmbeddingCacheFromManifest, buildMediaCacheFromManifest, createEmptyCacheStats, getMediaOutputDir, getOutputDir, isBrokenLinkIssue, isEmbeddingErrorIssue, isMediaProcessingIssue, isMermaidErrorIssue, isMissingMediaIssue, isPluginErrorIssue, isSlugConflictIssue, withDefaults } from '../chunk-D26H5722.js';
|
|
3
|
+
export { CopyOnlyImageProcessor, CosineSimilarityPlugin, NoOpDatabase, NoOpImageEmbedder, NoOpSimilarity, NoOpTextEmbedder, PassthroughMermaidRenderer, PluginManager, cosineSimilarity, createAllNoOpPlugins, createDefaultPlugins, createPluginManager, createSimilarityPlugin, topologicalSort } from '../chunk-B43UAOPC.js';
|
|
4
|
+
import '../chunk-3RG5ZIWI.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk6TFXNIO6_cjs = require('../chunk-6TFXNIO6.cjs');
|
|
4
|
+
require('../chunk-OBGZSXTJ.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "CopyOnlyImageProcessor", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk6TFXNIO6_cjs.CopyOnlyImageProcessor; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CosineSimilarityPlugin", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunk6TFXNIO6_cjs.CosineSimilarityPlugin; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "NoOpDatabase", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunk6TFXNIO6_cjs.NoOpDatabase; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "NoOpImageEmbedder", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunk6TFXNIO6_cjs.NoOpImageEmbedder; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "NoOpSimilarity", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunk6TFXNIO6_cjs.NoOpSimilarity; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "NoOpTextEmbedder", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunk6TFXNIO6_cjs.NoOpTextEmbedder; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "PassthroughMermaidRenderer", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return chunk6TFXNIO6_cjs.PassthroughMermaidRenderer; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "PluginManager", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return chunk6TFXNIO6_cjs.PluginManager; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "cosineSimilarity", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return chunk6TFXNIO6_cjs.cosineSimilarity; }
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "createAllNoOpPlugins", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return chunk6TFXNIO6_cjs.createAllNoOpPlugins; }
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "createDefaultPlugins", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () { return chunk6TFXNIO6_cjs.createDefaultPlugins; }
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "createPluginManager", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return chunk6TFXNIO6_cjs.createPluginManager; }
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "createSimilarityPlugin", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () { return chunk6TFXNIO6_cjs.createSimilarityPlugin; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "topologicalSort", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunk6TFXNIO6_cjs.topologicalSort; }
|
|
63
|
+
});
|