@velvetmonkey/vault-core 2.0.30 → 2.0.31
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/dist/src/entities.d.ts +50 -0
- package/dist/src/entities.d.ts.map +1 -0
- package/dist/src/entities.js +499 -0
- package/dist/src/entities.js.map +1 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +23 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/logging/index.d.ts +7 -0
- package/dist/src/logging/index.d.ts.map +1 -0
- package/dist/src/logging/index.js +7 -0
- package/dist/src/logging/index.js.map +1 -0
- package/dist/src/logging/operationLogger.d.ts +59 -0
- package/dist/src/logging/operationLogger.d.ts.map +1 -0
- package/dist/src/logging/operationLogger.js +282 -0
- package/dist/src/logging/operationLogger.js.map +1 -0
- package/dist/src/logging/sessionManager.d.ts +35 -0
- package/dist/src/logging/sessionManager.d.ts.map +1 -0
- package/dist/src/logging/sessionManager.js +68 -0
- package/dist/src/logging/sessionManager.js.map +1 -0
- package/dist/src/logging/types.d.ts +123 -0
- package/dist/src/logging/types.d.ts.map +1 -0
- package/dist/src/logging/types.js +23 -0
- package/dist/src/logging/types.js.map +1 -0
- package/dist/src/protectedZones.d.ts +36 -0
- package/dist/src/protectedZones.d.ts.map +1 -0
- package/dist/src/protectedZones.js +114 -0
- package/dist/src/protectedZones.js.map +1 -0
- package/dist/src/sqlite.d.ts +273 -0
- package/dist/src/sqlite.d.ts.map +1 -0
- package/dist/src/sqlite.js +959 -0
- package/dist/src/sqlite.js.map +1 -0
- package/dist/src/types.d.ts +171 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +5 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/wikilinks.d.ts +76 -0
- package/dist/src/wikilinks.d.ts.map +1 -0
- package/dist/src/wikilinks.js +681 -0
- package/dist/src/wikilinks.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity scanning and discovery for vault wikilinks
|
|
3
|
+
*
|
|
4
|
+
* Scans vault for .md files and extracts valid entities (file stems)
|
|
5
|
+
* that can be wikilinked. Filters out periodic notes and categorizes
|
|
6
|
+
* entities by type.
|
|
7
|
+
*/
|
|
8
|
+
import type { EntityIndex, ScanOptions, Entity, EntityWithType } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Current cache version - bump when schema changes
|
|
11
|
+
*/
|
|
12
|
+
export declare const ENTITY_CACHE_VERSION = 3;
|
|
13
|
+
/**
|
|
14
|
+
* Scan vault for entities (markdown file stems) that can be wikilinked
|
|
15
|
+
*/
|
|
16
|
+
export declare function scanVaultEntities(vaultPath: string, options?: ScanOptions): Promise<EntityIndex>;
|
|
17
|
+
export declare function getAllEntities(index: EntityIndex): Entity[];
|
|
18
|
+
/**
|
|
19
|
+
* Get all entities with their category type preserved
|
|
20
|
+
* Used for scoring algorithms that need type-based boosts
|
|
21
|
+
*
|
|
22
|
+
* Unlike getAllEntities() which flattens entities into a single array,
|
|
23
|
+
* this function preserves the category information for each entity.
|
|
24
|
+
*
|
|
25
|
+
* @param index - The entity index to extract from
|
|
26
|
+
* @returns Array of EntityWithType objects preserving category info
|
|
27
|
+
*/
|
|
28
|
+
export declare function getAllEntitiesWithTypes(index: EntityIndex): EntityWithType[];
|
|
29
|
+
/**
|
|
30
|
+
* Get entity name from an Entity (handles both string and object formats)
|
|
31
|
+
*/
|
|
32
|
+
export declare function getEntityName(entity: Entity): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get entity aliases from an Entity (returns empty array for strings)
|
|
35
|
+
*/
|
|
36
|
+
export declare function getEntityAliases(entity: Entity): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Filter periodic notes from a list of entities
|
|
39
|
+
* Useful when loading from external sources
|
|
40
|
+
*/
|
|
41
|
+
export declare function filterPeriodicNotes(entities: string[]): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Load entity index from a cache file (JSON format)
|
|
44
|
+
*/
|
|
45
|
+
export declare function loadEntityCache(cachePath: string): Promise<EntityIndex | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Save entity index to a cache file
|
|
48
|
+
*/
|
|
49
|
+
export declare function saveEntityCache(cachePath: string, index: EntityIndex): Promise<void>;
|
|
50
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/src/entities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAkB,WAAW,EAAqB,MAAM,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtH;;GAEG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AA2YtC;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,WAAW,CAAC,CAkFtB;AAaD,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,CAM3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc,EAAE,CAoB5E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEhE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAOpF;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity scanning and discovery for vault wikilinks
|
|
3
|
+
*
|
|
4
|
+
* Scans vault for .md files and extracts valid entities (file stems)
|
|
5
|
+
* that can be wikilinked. Filters out periodic notes and categorizes
|
|
6
|
+
* entities by type.
|
|
7
|
+
*/
|
|
8
|
+
import fs from 'fs/promises';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
/**
|
|
11
|
+
* Current cache version - bump when schema changes
|
|
12
|
+
*/
|
|
13
|
+
export const ENTITY_CACHE_VERSION = 3;
|
|
14
|
+
/**
|
|
15
|
+
* Maximum entity name/alias length for suggestions
|
|
16
|
+
* Filters out article titles, clippings, and other long names
|
|
17
|
+
*/
|
|
18
|
+
const MAX_ENTITY_LENGTH = 25;
|
|
19
|
+
/**
|
|
20
|
+
* Maximum word count for entity names/aliases
|
|
21
|
+
* Concepts are typically 1-3 words; longer names are article titles
|
|
22
|
+
*/
|
|
23
|
+
const MAX_ENTITY_WORDS = 3;
|
|
24
|
+
/**
|
|
25
|
+
* Default patterns for filtering out periodic notes and system files
|
|
26
|
+
*/
|
|
27
|
+
const DEFAULT_EXCLUDE_PATTERNS = [
|
|
28
|
+
/^\d{4}-\d{2}-\d{2}$/, // ISO dates: 2025-01-01
|
|
29
|
+
/^\d{1,2}\/\d{1,2}\/\d{4}$/, // UK dates: 1/10/2024
|
|
30
|
+
/^\d{4}-W\d{2}$/, // Week dates: 2025-W17
|
|
31
|
+
/^\d{4}-\d{2}$/, // Month format: 2025-01
|
|
32
|
+
/^\d{4}-Q\d$/, // Quarter dates: 2025-Q4
|
|
33
|
+
/^\d+$/, // Pure numbers
|
|
34
|
+
/^@/, // Twitter handles
|
|
35
|
+
/^</, // XML/HTML tags
|
|
36
|
+
/^\{\{/, // Template placeholders
|
|
37
|
+
/\\$/, // Paths ending in backslash
|
|
38
|
+
/\.(?:md|js|py|json|jpg|png|pdf|csv)$/i, // File extensions
|
|
39
|
+
/^[a-z0-9_-]+\.[a-z]+$/i, // File names with extensions
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Default tech keywords for categorization
|
|
43
|
+
*/
|
|
44
|
+
const DEFAULT_TECH_KEYWORDS = [
|
|
45
|
+
// Core technologies (28 original)
|
|
46
|
+
'databricks', 'api', 'code', 'azure', 'sql', 'git',
|
|
47
|
+
'node', 'react', 'powerbi', 'excel', 'copilot',
|
|
48
|
+
'fabric', 'apim', 'endpoint', 'synology', 'tailscale',
|
|
49
|
+
'obsidian', 'claude', 'powershell', 'mcp', 'typescript',
|
|
50
|
+
'javascript', 'python', 'docker', 'kubernetes',
|
|
51
|
+
'adf', 'adb', 'net', 'aws', 'gcp', 'terraform',
|
|
52
|
+
// AI/ML (16 new - target audience)
|
|
53
|
+
'chatgpt', 'langchain', 'openai', 'huggingface', 'pytorch', 'tensorflow',
|
|
54
|
+
'anthropic', 'llm', 'embedding', 'vector', 'rag', 'prompt', 'agent',
|
|
55
|
+
'transformer', 'ollama', 'gemini',
|
|
56
|
+
// Languages (10 new)
|
|
57
|
+
'swift', 'kotlin', 'rust', 'golang', 'elixir', 'scala', 'julia',
|
|
58
|
+
'ruby', 'php', 'csharp',
|
|
59
|
+
// Infrastructure (8 new)
|
|
60
|
+
'ansible', 'nginx', 'redis', 'postgres', 'mongodb', 'graphql', 'grpc', 'kafka',
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* Check if an alias passes the length and word count filters
|
|
64
|
+
* Uses same rules as entity names: ≤25 chars, ≤3 words
|
|
65
|
+
*/
|
|
66
|
+
function isValidAlias(alias) {
|
|
67
|
+
if (typeof alias !== 'string' || alias.length === 0) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
// Length filter
|
|
71
|
+
if (alias.length > MAX_ENTITY_LENGTH) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
// Word count filter
|
|
75
|
+
const words = alias.split(/\s+/).filter(w => w.length > 0);
|
|
76
|
+
if (words.length > MAX_ENTITY_WORDS) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Parse frontmatter from markdown content and extract aliases and type
|
|
83
|
+
* Handles YAML array format: aliases: [Alias1, Alias2]
|
|
84
|
+
* And YAML list format:
|
|
85
|
+
* aliases:
|
|
86
|
+
* - Alias1
|
|
87
|
+
* - Alias2
|
|
88
|
+
*/
|
|
89
|
+
function extractFrontmatterFields(content) {
|
|
90
|
+
// Check for frontmatter delimiter
|
|
91
|
+
if (!content.startsWith('---')) {
|
|
92
|
+
return { aliases: [] };
|
|
93
|
+
}
|
|
94
|
+
// Find end of frontmatter
|
|
95
|
+
const endIndex = content.indexOf('\n---', 3);
|
|
96
|
+
if (endIndex === -1) {
|
|
97
|
+
return { aliases: [] };
|
|
98
|
+
}
|
|
99
|
+
const frontmatter = content.substring(4, endIndex);
|
|
100
|
+
// Extract type field
|
|
101
|
+
const typeMatch = frontmatter.match(/^type:\s*["']?([^"'\n]+?)["']?\s*$/m);
|
|
102
|
+
const type = typeMatch ? typeMatch[1].trim() : undefined;
|
|
103
|
+
// Try inline array format: aliases: [Alias1, Alias2]
|
|
104
|
+
const inlineMatch = frontmatter.match(/^aliases:\s*\[([^\]]*)\]/m);
|
|
105
|
+
if (inlineMatch) {
|
|
106
|
+
return {
|
|
107
|
+
aliases: inlineMatch[1]
|
|
108
|
+
.split(',')
|
|
109
|
+
.map(s => s.trim().replace(/^["']|["']$/g, '')) // Remove quotes
|
|
110
|
+
.filter(s => s.length > 0 && isValidAlias(s)),
|
|
111
|
+
type,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
// Try multiline list format
|
|
115
|
+
const lines = frontmatter.split('\n');
|
|
116
|
+
const aliasIdx = lines.findIndex(line => /^aliases:\s*$/.test(line));
|
|
117
|
+
if (aliasIdx === -1) {
|
|
118
|
+
// Check for single value format: aliases: SingleAlias
|
|
119
|
+
const singleMatch = frontmatter.match(/^aliases:\s+(.+)$/m);
|
|
120
|
+
if (singleMatch && !singleMatch[1].startsWith('[')) {
|
|
121
|
+
const alias = singleMatch[1].trim().replace(/^["']|["']$/g, '');
|
|
122
|
+
return { aliases: isValidAlias(alias) ? [alias] : [], type };
|
|
123
|
+
}
|
|
124
|
+
return { aliases: [], type };
|
|
125
|
+
}
|
|
126
|
+
// Parse list items following "aliases:"
|
|
127
|
+
const aliases = [];
|
|
128
|
+
for (let i = aliasIdx + 1; i < lines.length; i++) {
|
|
129
|
+
const line = lines[i];
|
|
130
|
+
// Stop at next top-level key (letter/underscore at start of line followed by colon)
|
|
131
|
+
if (/^[a-z_]+:/i.test(line)) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
// Skip empty lines but continue parsing (YAML lists can have blank lines)
|
|
135
|
+
if (line.trim() === '') {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
// Match list item: - Alias or - "Alias"
|
|
139
|
+
const listMatch = line.match(/^\s*-\s*["']?(.+?)["']?\s*$/);
|
|
140
|
+
if (listMatch) {
|
|
141
|
+
const alias = listMatch[1].trim();
|
|
142
|
+
if (isValidAlias(alias)) {
|
|
143
|
+
aliases.push(alias);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { aliases, type };
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Check if a file/folder name should be skipped (dot-prefixed)
|
|
151
|
+
*/
|
|
152
|
+
function isDotPath(pathStr) {
|
|
153
|
+
return path.basename(pathStr).startsWith('.');
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Check if entity name matches any exclude pattern
|
|
157
|
+
*/
|
|
158
|
+
function matchesExcludePattern(name) {
|
|
159
|
+
return DEFAULT_EXCLUDE_PATTERNS.some(pattern => pattern.test(name));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Organization suffixes for company/team detection
|
|
163
|
+
*/
|
|
164
|
+
const ORG_SUFFIXES = ['inc', 'corp', 'llc', 'ltd', 'team', 'group', 'co', 'company'];
|
|
165
|
+
/**
|
|
166
|
+
* Location keywords for place detection
|
|
167
|
+
*/
|
|
168
|
+
const LOCATION_KEYWORDS = ['city', 'county', 'region', 'district', 'province'];
|
|
169
|
+
/**
|
|
170
|
+
* Known region patterns (geographic regions)
|
|
171
|
+
*/
|
|
172
|
+
const REGION_PATTERNS = ['eu', 'apac', 'emea', 'latam', 'amer'];
|
|
173
|
+
/**
|
|
174
|
+
* Map frontmatter `type` values to EntityCategory
|
|
175
|
+
* Returns undefined if the type doesn't map to a known category
|
|
176
|
+
*/
|
|
177
|
+
const FRONTMATTER_TYPE_MAP = {
|
|
178
|
+
// animals
|
|
179
|
+
animal: 'animals', pet: 'animals', horse: 'animals', dog: 'animals',
|
|
180
|
+
cat: 'animals', bird: 'animals', fish: 'animals',
|
|
181
|
+
// people
|
|
182
|
+
person: 'people', contact: 'people', friend: 'people',
|
|
183
|
+
colleague: 'people', family: 'people',
|
|
184
|
+
// media
|
|
185
|
+
movie: 'media', book: 'media', show: 'media', game: 'media',
|
|
186
|
+
music: 'media', album: 'media', film: 'media', podcast: 'media', series: 'media',
|
|
187
|
+
// events
|
|
188
|
+
event: 'events', meeting: 'events', conference: 'events',
|
|
189
|
+
trip: 'events', holiday: 'events', milestone: 'events',
|
|
190
|
+
// documents
|
|
191
|
+
document: 'documents', report: 'documents', guide: 'documents',
|
|
192
|
+
reference: 'documents', template: 'documents', note: 'documents',
|
|
193
|
+
// vehicles
|
|
194
|
+
vehicle: 'vehicles', car: 'vehicles', bike: 'vehicles',
|
|
195
|
+
boat: 'vehicles', motorcycle: 'vehicles',
|
|
196
|
+
// health
|
|
197
|
+
health: 'health', medical: 'health', fitness: 'health',
|
|
198
|
+
condition: 'health', wellness: 'health', exercise: 'health',
|
|
199
|
+
// finance
|
|
200
|
+
finance: 'finance', account: 'finance', investment: 'finance',
|
|
201
|
+
budget: 'finance', transaction: 'finance', bank: 'finance',
|
|
202
|
+
// food
|
|
203
|
+
food: 'food', recipe: 'food', restaurant: 'food',
|
|
204
|
+
meal: 'food', ingredient: 'food', drink: 'food',
|
|
205
|
+
// hobbies
|
|
206
|
+
hobby: 'hobbies', sport: 'hobbies', craft: 'hobbies',
|
|
207
|
+
activity: 'hobbies', collection: 'hobbies',
|
|
208
|
+
// identity categories (for reverse-mapping)
|
|
209
|
+
acronym: 'acronyms',
|
|
210
|
+
media: 'media',
|
|
211
|
+
other: 'other',
|
|
212
|
+
// existing categories
|
|
213
|
+
project: 'projects',
|
|
214
|
+
tool: 'technologies', technology: 'technologies', framework: 'technologies',
|
|
215
|
+
library: 'technologies', language: 'technologies',
|
|
216
|
+
company: 'organizations', organization: 'organizations', org: 'organizations', team: 'organizations',
|
|
217
|
+
place: 'locations', location: 'locations', city: 'locations',
|
|
218
|
+
country: 'locations', region: 'locations',
|
|
219
|
+
concept: 'concepts', idea: 'concepts', topic: 'concepts',
|
|
220
|
+
};
|
|
221
|
+
function mapFrontmatterType(type) {
|
|
222
|
+
return FRONTMATTER_TYPE_MAP[type.toLowerCase()];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Categorize an entity based on its name and optional frontmatter type
|
|
226
|
+
*
|
|
227
|
+
* Detection order (most specific first):
|
|
228
|
+
* 0. Frontmatter type - explicit declaration takes priority
|
|
229
|
+
* 1. Technologies - matches tech keyword
|
|
230
|
+
* 2. Acronyms - all uppercase 2-6 chars
|
|
231
|
+
* 3. Organizations - ends with company/team suffixes
|
|
232
|
+
* 4. Locations - city/country patterns or known regions
|
|
233
|
+
* 5. People - exactly 2 capitalized words
|
|
234
|
+
* 6. Concepts - multi-word lowercase patterns
|
|
235
|
+
* 7. Projects - multi-word (fallback)
|
|
236
|
+
* 8. Other - single word default
|
|
237
|
+
*/
|
|
238
|
+
function categorizeEntity(name, techKeywords, frontmatterType) {
|
|
239
|
+
// 0. Frontmatter type takes priority
|
|
240
|
+
if (frontmatterType) {
|
|
241
|
+
const mapped = mapFrontmatterType(frontmatterType);
|
|
242
|
+
if (mapped)
|
|
243
|
+
return mapped;
|
|
244
|
+
}
|
|
245
|
+
const nameLower = name.toLowerCase();
|
|
246
|
+
const words = name.split(/\s+/);
|
|
247
|
+
// 1. Technology check (keyword match)
|
|
248
|
+
if (techKeywords.some(tech => nameLower.includes(tech))) {
|
|
249
|
+
return 'technologies';
|
|
250
|
+
}
|
|
251
|
+
// 2. Acronym check (all uppercase, 2-6 chars)
|
|
252
|
+
if (name === name.toUpperCase() && name.length >= 2 && name.length <= 6) {
|
|
253
|
+
return 'acronyms';
|
|
254
|
+
}
|
|
255
|
+
// 3. Organization check (company/team suffixes)
|
|
256
|
+
if (words.length >= 2 && ORG_SUFFIXES.includes(words[words.length - 1].toLowerCase())) {
|
|
257
|
+
return 'organizations';
|
|
258
|
+
}
|
|
259
|
+
// 4. Location check (city/country patterns or known regions)
|
|
260
|
+
if (words.length >= 2 && LOCATION_KEYWORDS.includes(words[words.length - 1].toLowerCase())) {
|
|
261
|
+
return 'locations';
|
|
262
|
+
}
|
|
263
|
+
if (REGION_PATTERNS.includes(nameLower)) {
|
|
264
|
+
return 'locations';
|
|
265
|
+
}
|
|
266
|
+
// 5. People check (exactly 2 words, both capitalized)
|
|
267
|
+
if (words.length === 2) {
|
|
268
|
+
const [first, last] = words;
|
|
269
|
+
if (first[0] === first[0].toUpperCase() && last[0] === last[0].toUpperCase()) {
|
|
270
|
+
return 'people';
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// 6. Concepts check (multi-word lowercase patterns like "machine learning")
|
|
274
|
+
if (words.length >= 2 && name === name.toLowerCase()) {
|
|
275
|
+
return 'concepts';
|
|
276
|
+
}
|
|
277
|
+
// 7. Projects (multi-word, capitalized, not people)
|
|
278
|
+
if (name.includes(' ')) {
|
|
279
|
+
return 'projects';
|
|
280
|
+
}
|
|
281
|
+
return 'other';
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Recursively scan a directory for markdown files
|
|
285
|
+
* @param dirPath - Absolute path to scan
|
|
286
|
+
* @param basePath - Vault root path (for relative path calculation)
|
|
287
|
+
* @param excludeFolders - Folders to skip
|
|
288
|
+
*/
|
|
289
|
+
async function scanDirectory(dirPath, basePath, excludeFolders) {
|
|
290
|
+
const entities = [];
|
|
291
|
+
try {
|
|
292
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
293
|
+
for (const entry of entries) {
|
|
294
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
295
|
+
// Skip dot directories
|
|
296
|
+
if (entry.isDirectory() && isDotPath(entry.name)) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
// Skip excluded folders
|
|
300
|
+
if (entry.isDirectory() && excludeFolders.some(f => entry.name.toLowerCase() === f.toLowerCase())) {
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (entry.isDirectory()) {
|
|
304
|
+
// Recurse into subdirectory
|
|
305
|
+
const subEntities = await scanDirectory(fullPath, basePath, excludeFolders);
|
|
306
|
+
entities.push(...subEntities);
|
|
307
|
+
}
|
|
308
|
+
else if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
309
|
+
// Extract file stem (without .md extension)
|
|
310
|
+
const stem = path.basename(entry.name, '.md');
|
|
311
|
+
const relativePath = path.relative(basePath, fullPath);
|
|
312
|
+
// Read file content to extract aliases and type
|
|
313
|
+
let aliases = [];
|
|
314
|
+
let frontmatterType;
|
|
315
|
+
try {
|
|
316
|
+
const content = await fs.readFile(fullPath, 'utf-8');
|
|
317
|
+
const fields = extractFrontmatterFields(content);
|
|
318
|
+
aliases = fields.aliases;
|
|
319
|
+
frontmatterType = fields.type;
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
// Skip if can't read file - just use empty aliases
|
|
323
|
+
}
|
|
324
|
+
entities.push({
|
|
325
|
+
name: stem,
|
|
326
|
+
relativePath,
|
|
327
|
+
aliases,
|
|
328
|
+
frontmatterType,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
// Skip directories we can't read
|
|
335
|
+
console.error(`[vault-core] Error scanning ${dirPath}:`, error);
|
|
336
|
+
}
|
|
337
|
+
return entities;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Scan vault for entities (markdown file stems) that can be wikilinked
|
|
341
|
+
*/
|
|
342
|
+
export async function scanVaultEntities(vaultPath, options = {}) {
|
|
343
|
+
const excludeFolders = options.excludeFolders ?? [];
|
|
344
|
+
const techKeywords = options.techKeywords ?? DEFAULT_TECH_KEYWORDS;
|
|
345
|
+
// Scan vault for all markdown files
|
|
346
|
+
const allEntities = await scanDirectory(vaultPath, vaultPath, excludeFolders);
|
|
347
|
+
// Filter out periodic notes and invalid entries
|
|
348
|
+
const validEntities = allEntities.filter(entity => entity.name.length >= 2 && !matchesExcludePattern(entity.name));
|
|
349
|
+
// Remove duplicates by name (keep first occurrence)
|
|
350
|
+
const seenNames = new Set();
|
|
351
|
+
const uniqueEntities = validEntities.filter(entity => {
|
|
352
|
+
if (seenNames.has(entity.name.toLowerCase())) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
seenNames.add(entity.name.toLowerCase());
|
|
356
|
+
return true;
|
|
357
|
+
});
|
|
358
|
+
// Categorize entities
|
|
359
|
+
const index = {
|
|
360
|
+
technologies: [],
|
|
361
|
+
acronyms: [],
|
|
362
|
+
people: [],
|
|
363
|
+
projects: [],
|
|
364
|
+
organizations: [],
|
|
365
|
+
locations: [],
|
|
366
|
+
concepts: [],
|
|
367
|
+
animals: [],
|
|
368
|
+
media: [],
|
|
369
|
+
events: [],
|
|
370
|
+
documents: [],
|
|
371
|
+
vehicles: [],
|
|
372
|
+
health: [],
|
|
373
|
+
finance: [],
|
|
374
|
+
food: [],
|
|
375
|
+
hobbies: [],
|
|
376
|
+
other: [],
|
|
377
|
+
_metadata: {
|
|
378
|
+
total_entities: 0,
|
|
379
|
+
generated_at: new Date().toISOString(),
|
|
380
|
+
vault_path: vaultPath,
|
|
381
|
+
source: 'vault-core scanVaultEntities',
|
|
382
|
+
version: ENTITY_CACHE_VERSION,
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
for (const entity of uniqueEntities) {
|
|
386
|
+
const category = categorizeEntity(entity.name, techKeywords, entity.frontmatterType);
|
|
387
|
+
// Store as EntityWithAliases object
|
|
388
|
+
const entityObj = {
|
|
389
|
+
name: entity.name,
|
|
390
|
+
path: entity.relativePath,
|
|
391
|
+
aliases: entity.aliases,
|
|
392
|
+
};
|
|
393
|
+
index[category].push(entityObj);
|
|
394
|
+
}
|
|
395
|
+
// Sort each category by name
|
|
396
|
+
const sortByName = (a, b) => {
|
|
397
|
+
const nameA = typeof a === 'string' ? a : a.name;
|
|
398
|
+
const nameB = typeof b === 'string' ? b : b.name;
|
|
399
|
+
return nameA.localeCompare(nameB);
|
|
400
|
+
};
|
|
401
|
+
const allCategories = [
|
|
402
|
+
'technologies', 'acronyms', 'people', 'projects', 'organizations',
|
|
403
|
+
'locations', 'concepts', 'animals', 'media', 'events', 'documents',
|
|
404
|
+
'vehicles', 'health', 'finance', 'food', 'hobbies', 'other',
|
|
405
|
+
];
|
|
406
|
+
for (const cat of allCategories) {
|
|
407
|
+
index[cat].sort(sortByName);
|
|
408
|
+
}
|
|
409
|
+
// Update metadata
|
|
410
|
+
index._metadata.total_entities = allCategories.reduce((sum, cat) => sum + index[cat].length, 0);
|
|
411
|
+
return index;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Get all entities as a flat array (for wikilink matching)
|
|
415
|
+
* Handles both legacy string format and new EntityWithAliases format
|
|
416
|
+
*/
|
|
417
|
+
/** All entity category keys (excludes _metadata) */
|
|
418
|
+
const ALL_ENTITY_CATEGORIES = [
|
|
419
|
+
'technologies', 'acronyms', 'people', 'projects', 'organizations',
|
|
420
|
+
'locations', 'concepts', 'animals', 'media', 'events', 'documents',
|
|
421
|
+
'vehicles', 'health', 'finance', 'food', 'hobbies', 'other',
|
|
422
|
+
];
|
|
423
|
+
export function getAllEntities(index) {
|
|
424
|
+
const result = [];
|
|
425
|
+
for (const cat of ALL_ENTITY_CATEGORIES) {
|
|
426
|
+
if (index[cat])
|
|
427
|
+
result.push(...index[cat]);
|
|
428
|
+
}
|
|
429
|
+
return result;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Get all entities with their category type preserved
|
|
433
|
+
* Used for scoring algorithms that need type-based boosts
|
|
434
|
+
*
|
|
435
|
+
* Unlike getAllEntities() which flattens entities into a single array,
|
|
436
|
+
* this function preserves the category information for each entity.
|
|
437
|
+
*
|
|
438
|
+
* @param index - The entity index to extract from
|
|
439
|
+
* @returns Array of EntityWithType objects preserving category info
|
|
440
|
+
*/
|
|
441
|
+
export function getAllEntitiesWithTypes(index) {
|
|
442
|
+
const result = [];
|
|
443
|
+
const categories = ALL_ENTITY_CATEGORIES;
|
|
444
|
+
for (const category of categories) {
|
|
445
|
+
const entities = index[category];
|
|
446
|
+
// Skip undefined or empty categories
|
|
447
|
+
if (!entities || !Array.isArray(entities)) {
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
for (const entity of entities) {
|
|
451
|
+
// Convert legacy string format to EntityWithAliases
|
|
452
|
+
const entityObj = typeof entity === 'string'
|
|
453
|
+
? { name: entity, path: '', aliases: [] }
|
|
454
|
+
: entity;
|
|
455
|
+
result.push({ entity: entityObj, category });
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return result;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Get entity name from an Entity (handles both string and object formats)
|
|
462
|
+
*/
|
|
463
|
+
export function getEntityName(entity) {
|
|
464
|
+
return typeof entity === 'string' ? entity : entity.name;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Get entity aliases from an Entity (returns empty array for strings)
|
|
468
|
+
*/
|
|
469
|
+
export function getEntityAliases(entity) {
|
|
470
|
+
return typeof entity === 'string' ? [] : entity.aliases;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Filter periodic notes from a list of entities
|
|
474
|
+
* Useful when loading from external sources
|
|
475
|
+
*/
|
|
476
|
+
export function filterPeriodicNotes(entities) {
|
|
477
|
+
return entities.filter(entity => !matchesExcludePattern(entity));
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Load entity index from a cache file (JSON format)
|
|
481
|
+
*/
|
|
482
|
+
export async function loadEntityCache(cachePath) {
|
|
483
|
+
try {
|
|
484
|
+
const content = await fs.readFile(cachePath, 'utf-8');
|
|
485
|
+
return JSON.parse(content);
|
|
486
|
+
}
|
|
487
|
+
catch {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Save entity index to a cache file
|
|
493
|
+
*/
|
|
494
|
+
export async function saveEntityCache(cachePath, index) {
|
|
495
|
+
const dir = path.dirname(cachePath);
|
|
496
|
+
await fs.mkdir(dir, { recursive: true });
|
|
497
|
+
await fs.writeFile(cachePath, JSON.stringify(index, null, 2), 'utf-8');
|
|
498
|
+
}
|
|
499
|
+
//# sourceMappingURL=entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/src/entities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B;;GAEG;AACH,MAAM,wBAAwB,GAAG;IAC/B,qBAAqB,EAAY,wBAA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;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB;IACrD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAgB,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,SAAiB,EACjB,KAAkB;IAElB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @velvetmonkey/vault-core
|
|
3
|
+
*
|
|
4
|
+
* Shared vault utilities for the Flywheel ecosystem.
|
|
5
|
+
* Used by both Flywheel (read) and Flywheel Memory (write).
|
|
6
|
+
*/
|
|
7
|
+
export type { EntityIndex, EntityCategory, EntityWithAliases, Entity, EntityWithType, ScanOptions, WikilinkOptions, WikilinkResult, ImplicitEntityConfig, ExtendedWikilinkOptions, ImplicitEntityMatch, ResolveAliasOptions, ProtectedZone, ProtectedZoneType, } from './types.js';
|
|
8
|
+
export { scanVaultEntities, getAllEntities, getAllEntitiesWithTypes, getEntityName, getEntityAliases, loadEntityCache, saveEntityCache, ENTITY_CACHE_VERSION, } from './entities.js';
|
|
9
|
+
export { applyWikilinks, processWikilinks, resolveAliasWikilinks, suggestWikilinks, } from './wikilinks.js';
|
|
10
|
+
export { getProtectedZones, isInProtectedZone, rangeOverlapsProtectedZone, } from './protectedZones.js';
|
|
11
|
+
export { OperationLogger, createLoggerFromConfig, generateSessionId, getSessionId, setSessionId, } from './logging/index.js';
|
|
12
|
+
export type { OperationLogEntry, SessionMetrics, AggregatedMetrics, LoggingConfig, ProductId, } from './logging/index.js';
|
|
13
|
+
export { openStateDb, deleteStateDb, stateDbExists, searchEntities, searchEntitiesPrefix, getEntityByName, getEntitiesByAlias, getAllEntitiesFromDb, getEntityIndexFromDb, recordEntityMention, getEntityRecency, getAllRecency, setWriteState, getWriteState, deleteWriteState, setFlywheelConfig, getFlywheelConfig, getAllFlywheelConfig, saveFlywheelConfigToDb, loadFlywheelConfigFromDb, getStateDbMetadata, recordMergeDismissal, getDismissedMergePairs, saveVaultIndexCache, loadVaultIndexCache, getVaultIndexCacheInfo, SCHEMA_VERSION, STATE_DB_FILENAME, FLYWHEEL_DIR, } from './sqlite.js';
|
|
14
|
+
export type { StateDb, EntitySearchResult, RecencyRow, StateDbMetadata, VaultIndexCacheData, VaultIndexCacheInfo, FlywheelConfigRow, } from './sqlite.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,WAAW,EACX,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB,EAEhB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAElB,oBAAoB,EACpB,sBAAsB,EAEtB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @velvetmonkey/vault-core
|
|
3
|
+
*
|
|
4
|
+
* Shared vault utilities for the Flywheel ecosystem.
|
|
5
|
+
* Used by both Flywheel (read) and Flywheel Memory (write).
|
|
6
|
+
*/
|
|
7
|
+
// Entity scanning
|
|
8
|
+
export { scanVaultEntities, getAllEntities, getAllEntitiesWithTypes, getEntityName, getEntityAliases, loadEntityCache, saveEntityCache, ENTITY_CACHE_VERSION, } from './entities.js';
|
|
9
|
+
// Wikilinks
|
|
10
|
+
export { applyWikilinks, processWikilinks, resolveAliasWikilinks, suggestWikilinks, } from './wikilinks.js';
|
|
11
|
+
// Protected zones
|
|
12
|
+
export { getProtectedZones, isInProtectedZone, rangeOverlapsProtectedZone, } from './protectedZones.js';
|
|
13
|
+
// Logging (unified cross-product logging)
|
|
14
|
+
export { OperationLogger, createLoggerFromConfig, generateSessionId, getSessionId, setSessionId, } from './logging/index.js';
|
|
15
|
+
// SQLite State Database
|
|
16
|
+
export { openStateDb, deleteStateDb, stateDbExists, searchEntities, searchEntitiesPrefix, getEntityByName, getEntitiesByAlias, getAllEntitiesFromDb, getEntityIndexFromDb, recordEntityMention, getEntityRecency, getAllRecency, setWriteState, getWriteState, deleteWriteState,
|
|
17
|
+
// Flywheel Config
|
|
18
|
+
setFlywheelConfig, getFlywheelConfig, getAllFlywheelConfig, saveFlywheelConfigToDb, loadFlywheelConfigFromDb, getStateDbMetadata,
|
|
19
|
+
// Merge Dismissals
|
|
20
|
+
recordMergeDismissal, getDismissedMergePairs,
|
|
21
|
+
// Vault Index Cache
|
|
22
|
+
saveVaultIndexCache, loadVaultIndexCache, getVaultIndexCacheInfo, SCHEMA_VERSION, STATE_DB_FILENAME, FLYWHEEL_DIR, } from './sqlite.js';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,kBAAkB;AAClB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAEvB,YAAY;AACZ,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,kBAAkB;AAClB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,0CAA0C;AAC1C,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,oBAAoB,CAAC;AAU5B,wBAAwB;AACxB,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB;AAChB,kBAAkB;AAClB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB;AAClB,mBAAmB;AACnB,oBAAoB,EACpB,sBAAsB;AACtB,oBAAoB;AACpB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging module exports
|
|
3
|
+
*/
|
|
4
|
+
export { OperationLogger, createLoggerFromConfig } from './operationLogger.js';
|
|
5
|
+
export { generateSessionId, getSessionId, setSessionId, clearSession, createChildSession, getParentSession, isChildSession, } from './sessionManager.js';
|
|
6
|
+
export { DEFAULT_LOGGING_CONFIG, type OperationLogEntry, type SessionMetrics, type AggregatedMetrics, type LoggingConfig, type ProductId, } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/logging/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging module exports
|
|
3
|
+
*/
|
|
4
|
+
export { OperationLogger, createLoggerFromConfig } from './operationLogger.js';
|
|
5
|
+
export { generateSessionId, getSessionId, setSessionId, clearSession, createChildSession, getParentSession, isChildSession, } from './sessionManager.js';
|
|
6
|
+
export { DEFAULT_LOGGING_CONFIG, } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/src/logging/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,GAMvB,MAAM,YAAY,CAAC"}
|