@weavelogic/knowledge-graph-agent 0.8.3 → 0.8.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"docs-init.d.ts","sourceRoot":"","sources":["../../src/generators/docs-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,kBAAkB,CAAC;AA2X1B;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA6FhF;AAmPD;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,SAAS,GAAG,OAAO,CAEzE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW9D"}
1
+ {"version":3,"file":"docs-init.d.ts","sourceRoot":"","sources":["../../src/generators/docs-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAukB1B;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA6FhF;AAmPD;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,SAAS,GAAG,OAAO,CAEzE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW9D"}
@@ -44,9 +44,20 @@ const DEFAULT_STRUCTURE = {
44
44
  "_attachments"
45
45
  ],
46
46
  files: {
47
+ // Root files
47
48
  "README.md": "readme",
48
49
  "PRIMITIVES.md": "primitives",
49
50
  "MOC.md": "moc",
51
+ // Directory index files (_MOC.md is the local map of content)
52
+ "concepts/_MOC.md": "moc-concepts",
53
+ "components/_MOC.md": "moc-components",
54
+ "services/_MOC.md": "moc-services",
55
+ "features/_MOC.md": "moc-features",
56
+ "integrations/_MOC.md": "moc-integrations",
57
+ "standards/_MOC.md": "moc-standards",
58
+ "guides/_MOC.md": "moc-guides",
59
+ "references/_MOC.md": "moc-references",
60
+ // Templates
50
61
  "_templates/concept.md": "template-concept",
51
62
  "_templates/technical.md": "template-technical",
52
63
  "_templates/feature.md": "template-feature",
@@ -130,48 +141,231 @@ Primitives are the foundational technologies that power this project. Each primi
130
141
  Central navigation hub for {{projectName}} documentation.
131
142
 
132
143
  ## Core Concepts
133
- {{#each concepts}}
134
- - [[concepts/{{this}}]]
135
- {{/each}}
136
- {{#unless concepts}}
137
- - *No concepts documented yet*
138
- {{/unless}}
144
+ - [[concepts/_MOC|Concepts Index]]
139
145
 
140
146
  ## Components
141
- {{#each components}}
142
- - [[components/{{this}}]]
143
- {{/each}}
144
- {{#unless components}}
145
- - *No components documented yet*
146
- {{/unless}}
147
+ - [[components/_MOC|Components Index]]
147
148
 
148
149
  ## Services
149
- {{#each services}}
150
- - [[services/{{this}}]]
151
- {{/each}}
152
- {{#unless services}}
153
- - *No services documented yet*
154
- {{/unless}}
150
+ - [[services/_MOC|Services Index]]
155
151
 
156
152
  ## Features
157
- {{#each features}}
158
- - [[features/{{this}}]]
159
- {{/each}}
160
- {{#unless features}}
161
- - *No features documented yet*
162
- {{/unless}}
153
+ - [[features/_MOC|Features Index]]
154
+
155
+ ## Integrations
156
+ - [[integrations/_MOC|Integrations Index]]
157
+
158
+ ## Standards
159
+ - [[standards/_MOC|Standards Index]]
163
160
 
164
161
  ## Guides
165
- - [[guides/getting-started/index|Getting Started]]
166
- - [[guides/testing/index|Testing Guide]]
167
- - [[guides/deployment/index|Deployment Guide]]
162
+ - [[guides/_MOC|Guides Index]]
168
163
 
169
164
  ## References
170
- - [[references/api/index|API Reference]]
171
- - [[references/cli/index|CLI Reference]]
165
+ - [[references/_MOC|References Index]]
172
166
 
173
167
  ---
174
168
  *Last updated: {{date}}*
169
+ `,
170
+ "moc-concepts": `---
171
+ title: Concepts
172
+ type: concept
173
+ status: active
174
+ tags: [moc, concepts]
175
+ created: {{date}}
176
+ ---
177
+
178
+ # Concepts
179
+
180
+ Abstract concepts and architectural patterns for {{projectName}}.
181
+
182
+ ## Architecture
183
+ - [[concepts/architecture/index|Architecture Overview]]
184
+
185
+ ## Patterns
186
+ *Add design patterns and abstractions here*
187
+
188
+ ## Mental Models
189
+ *Add key mental models for understanding the system*
190
+
191
+ ---
192
+ > Use template: [[_templates/concept|Concept Template]]
193
+ `,
194
+ "moc-components": `---
195
+ title: Components
196
+ type: technical
197
+ status: active
198
+ tags: [moc, components]
199
+ created: {{date}}
200
+ ---
201
+
202
+ # Components
203
+
204
+ Reusable components and utilities for {{projectName}}.
205
+
206
+ ## UI Components
207
+ *Add UI components here*
208
+
209
+ ## Utilities
210
+ *Add utility functions and helpers*
211
+
212
+ ## Shared Libraries
213
+ *Add shared code libraries*
214
+
215
+ ---
216
+ > Use template: [[_templates/technical|Technical Template]]
217
+ `,
218
+ "moc-services": `---
219
+ title: Services
220
+ type: service
221
+ status: active
222
+ tags: [moc, services]
223
+ created: {{date}}
224
+ ---
225
+
226
+ # Services
227
+
228
+ Backend services and APIs for {{projectName}}.
229
+
230
+ ## API Services
231
+ *Add API service documentation*
232
+
233
+ ## Background Workers
234
+ *Add worker/job documentation*
235
+
236
+ ## External Services
237
+ *Add third-party service integrations*
238
+
239
+ ---
240
+ > Use template: [[_templates/service|Service Template]]
241
+ `,
242
+ "moc-features": `---
243
+ title: Features
244
+ type: feature
245
+ status: active
246
+ tags: [moc, features]
247
+ created: {{date}}
248
+ ---
249
+
250
+ # Features
251
+
252
+ Product features and capabilities for {{projectName}}.
253
+
254
+ ## Core Features
255
+ *Add core feature documentation*
256
+
257
+ ## Advanced Features
258
+ *Add advanced feature documentation*
259
+
260
+ ## Upcoming Features
261
+ *Add planned features*
262
+
263
+ ---
264
+ > Use template: [[_templates/feature|Feature Template]]
265
+ `,
266
+ "moc-integrations": `---
267
+ title: Integrations
268
+ type: integration
269
+ status: active
270
+ tags: [moc, integrations]
271
+ created: {{date}}
272
+ ---
273
+
274
+ # Integrations
275
+
276
+ External integrations and third-party services for {{projectName}}.
277
+
278
+ ## Databases
279
+ *Add database integrations*
280
+
281
+ ## Authentication
282
+ *Add auth provider integrations*
283
+
284
+ ## Storage
285
+ *Add storage integrations*
286
+
287
+ ## Monitoring
288
+ *Add monitoring/observability integrations*
289
+
290
+ ---
291
+ > Use template: [[_templates/technical|Technical Template]]
292
+ `,
293
+ "moc-standards": `---
294
+ title: Standards
295
+ type: standard
296
+ status: active
297
+ tags: [moc, standards]
298
+ created: {{date}}
299
+ ---
300
+
301
+ # Standards
302
+
303
+ Coding standards and conventions for {{projectName}}.
304
+
305
+ ## Coding Standards
306
+ *Add coding style guides*
307
+
308
+ ## Programming Languages
309
+ {{#each languages}}
310
+ - [[standards/programming-languages/{{this}}|{{this}}]]
311
+ {{/each}}
312
+
313
+ ## Build Tools
314
+ *Add build tool documentation*
315
+
316
+ ---
317
+ > See also: [[PRIMITIVES|Technology Primitives]]
318
+ `,
319
+ "moc-guides": `---
320
+ title: Guides
321
+ type: guide
322
+ status: active
323
+ tags: [moc, guides]
324
+ created: {{date}}
325
+ ---
326
+
327
+ # Guides
328
+
329
+ How-to guides and tutorials for {{projectName}}.
330
+
331
+ ## Getting Started
332
+ - [[guides/getting-started/index|Getting Started Guide]]
333
+
334
+ ## Testing
335
+ *Add testing guides*
336
+
337
+ ## Deployment
338
+ *Add deployment guides*
339
+
340
+ ## Troubleshooting
341
+ *Add troubleshooting guides*
342
+
343
+ ---
344
+ > Use template: [[_templates/guide|Guide Template]]
345
+ `,
346
+ "moc-references": `---
347
+ title: References
348
+ type: technical
349
+ status: active
350
+ tags: [moc, references]
351
+ created: {{date}}
352
+ ---
353
+
354
+ # References
355
+
356
+ API and CLI references for {{projectName}}.
357
+
358
+ ## API Reference
359
+ *Add API documentation*
360
+
361
+ ## CLI Reference
362
+ *Add CLI documentation*
363
+
364
+ ## Configuration Reference
365
+ *Add configuration options*
366
+
367
+ ---
368
+ > See also: [[PRIMITIVES|Technology Primitives]]
175
369
  `,
176
370
  "template-concept": `---
177
371
  title: {{title}}
@@ -1 +1 @@
1
- {"version":3,"file":"docs-init.js","sources":["../../src/generators/docs-init.ts"],"sourcesContent":["/**\n * Docs Directory Initializer\n *\n * Creates the initial docs directory structure following the weave-nn\n * methodology with proper PRIMITIVES.md taxonomy.\n *\n * SECURITY NOTES (Handlebars Templates):\n * - All templates use double-braces {{}} which HTML-escapes output\n * - Triple-braces {{{raw}}} are NOT used, preventing injection attacks\n * - Template variables come from internal sources (project analysis), not direct user input\n * - See: https://handlebarsjs.com/guide/#html-escaping\n */\n\nimport { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';\nimport { join, basename } from 'path';\nimport fg from 'fast-glob';\nimport Handlebars from 'handlebars';\nimport type {\n DocsInitOptions,\n DocsInitResult,\n NodeType,\n} from '../core/types.js';\n\n/**\n * Default docs structure based on PRIMITIVES.md taxonomy\n */\nconst DEFAULT_STRUCTURE = {\n directories: [\n // Core concepts\n 'concepts',\n 'concepts/architecture',\n 'concepts/patterns',\n\n // Components\n 'components',\n 'components/ui',\n 'components/utilities',\n\n // Services\n 'services',\n 'services/api',\n 'services/workers',\n\n // Features\n 'features',\n 'features/core',\n 'features/advanced',\n\n // Integrations\n 'integrations',\n 'integrations/databases',\n 'integrations/auth-providers',\n 'integrations/storage',\n 'integrations/monitoring',\n\n // Standards\n 'standards',\n 'standards/coding-standards',\n 'standards/programming-languages',\n 'standards/build-tools',\n\n // Guides\n 'guides',\n 'guides/getting-started',\n 'guides/testing',\n 'guides/deployment',\n\n // References\n 'references',\n 'references/api',\n 'references/cli',\n\n // Meta\n '_templates',\n '_attachments',\n ],\n files: {\n 'README.md': 'readme',\n 'PRIMITIVES.md': 'primitives',\n 'MOC.md': 'moc',\n '_templates/concept.md': 'template-concept',\n '_templates/technical.md': 'template-technical',\n '_templates/feature.md': 'template-feature',\n '_templates/service.md': 'template-service',\n '_templates/guide.md': 'template-guide',\n },\n};\n\n/**\n * Template content for docs files\n */\nconst TEMPLATES: Record<string, string> = {\n readme: `# {{projectName}} Documentation\n\nWelcome to the {{projectName}} knowledge base.\n\n## Quick Navigation\n\n- [[MOC|Map of Content]] - Overview of all documentation\n- [[PRIMITIVES|Primitives]] - Core building blocks and technologies\n\n## Structure\n\nThis documentation follows the Weave-NN knowledge graph methodology:\n\n\\`\\`\\`\ndocs/\n├── concepts/ # Abstract concepts and ideas\n├── components/ # Reusable components and utilities\n├── services/ # Backend services and APIs\n├── features/ # Product features and capabilities\n├── integrations/ # External integrations\n├── standards/ # Coding standards and conventions\n├── guides/ # How-to guides and tutorials\n└── references/ # API and CLI references\n\\`\\`\\`\n\n## Getting Started\n\n1. Browse the [[MOC|Map of Content]] for an overview\n2. Check [[PRIMITIVES]] for technology decisions\n3. Read [[guides/getting-started/index|Getting Started Guide]]\n\n---\n*Generated by @weave-nn/knowledge-graph-agent*\n`,\n\n primitives: `# Primitives\n\nCore building blocks and technology decisions for {{projectName}}.\n\n## Overview\n\nPrimitives are the foundational technologies that power this project. Each primitive represents a key technology choice with its rationale and usage patterns.\n\n## Categories\n\n### Languages\n{{#each languages}}\n- [[standards/programming-languages/{{this}}|{{this}}]]\n{{/each}}\n\n### Frameworks\n{{#each frameworks}}\n- [[{{category}}/{{slug}}|{{name}}]]\n{{/each}}\n\n### Key Dependencies\n{{#each dependencies}}\n- [[{{category}}/{{slug}}|{{name}}]] - {{description}}\n{{/each}}\n\n## Technology Decisions\n\n| Category | Choice | Rationale |\n|----------|--------|-----------|\n| Runtime | Node.js | Modern JavaScript runtime |\n| Language | TypeScript | Type safety and DX |\n| Package Manager | npm/bun | Fast, reliable |\n\n---\n*Generated by @weave-nn/knowledge-graph-agent*\n`,\n\n moc: `# Map of Content\n\nCentral navigation hub for {{projectName}} documentation.\n\n## Core Concepts\n{{#each concepts}}\n- [[concepts/{{this}}]]\n{{/each}}\n{{#unless concepts}}\n- *No concepts documented yet*\n{{/unless}}\n\n## Components\n{{#each components}}\n- [[components/{{this}}]]\n{{/each}}\n{{#unless components}}\n- *No components documented yet*\n{{/unless}}\n\n## Services\n{{#each services}}\n- [[services/{{this}}]]\n{{/each}}\n{{#unless services}}\n- *No services documented yet*\n{{/unless}}\n\n## Features\n{{#each features}}\n- [[features/{{this}}]]\n{{/each}}\n{{#unless features}}\n- *No features documented yet*\n{{/unless}}\n\n## Guides\n- [[guides/getting-started/index|Getting Started]]\n- [[guides/testing/index|Testing Guide]]\n- [[guides/deployment/index|Deployment Guide]]\n\n## References\n- [[references/api/index|API Reference]]\n- [[references/cli/index|CLI Reference]]\n\n---\n*Last updated: {{date}}*\n`,\n\n 'template-concept': `---\ntitle: {{title}}\ntype: concept\nstatus: draft\ntags: [concept]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this concept.\n\n## Key Ideas\n\n- Point 1\n- Point 2\n- Point 3\n\n## Related Concepts\n\n- [[related-concept-1]]\n- [[related-concept-2]]\n\n## References\n\n- External reference 1\n- External reference 2\n`,\n\n 'template-technical': `---\ntitle: {{title}}\ntype: technical\nstatus: draft\ntags: [technical]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this technical component.\n\n## Implementation\n\n\\`\\`\\`typescript\n// Code example\n\\`\\`\\`\n\n## Usage\n\nHow to use this component.\n\n## Configuration\n\nAvailable configuration options.\n\n## Related\n\n- [[related-technical-1]]\n`,\n\n 'template-feature': `---\ntitle: {{title}}\ntype: feature\nstatus: draft\ntags: [feature]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this feature.\n\n## User Story\n\nAs a [user type], I want [goal] so that [benefit].\n\n## Acceptance Criteria\n\n- [ ] Criterion 1\n- [ ] Criterion 2\n- [ ] Criterion 3\n\n## Technical Implementation\n\nHow this feature is implemented.\n\n## Related Features\n\n- [[related-feature-1]]\n`,\n\n 'template-service': `---\ntitle: {{title}}\ntype: service\nstatus: draft\ntags: [service, api]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this service.\n\n## Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /api/... | Description |\n| POST | /api/... | Description |\n\n## Configuration\n\nEnvironment variables and configuration options.\n\n## Dependencies\n\n- [[dependency-1]]\n- [[dependency-2]]\n\n## Deployment\n\nDeployment instructions.\n`,\n\n 'template-guide': `---\ntitle: {{title}}\ntype: guide\nstatus: draft\ntags: [guide, tutorial]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Prerequisites\n\n- Prerequisite 1\n- Prerequisite 2\n\n## Steps\n\n### Step 1: Title\n\nInstructions for step 1.\n\n### Step 2: Title\n\nInstructions for step 2.\n\n### Step 3: Title\n\nInstructions for step 3.\n\n## Troubleshooting\n\nCommon issues and solutions.\n\n## Next Steps\n\n- [[next-guide-1]]\n- [[next-guide-2]]\n`,\n};\n\n/**\n * Framework detection result\n */\ninterface FrameworkInfo {\n name: string;\n slug: string;\n category: string;\n version?: string;\n}\n\n/**\n * Initialize docs directory\n */\nexport async function initDocs(options: DocsInitOptions): Promise<DocsInitResult> {\n const result: DocsInitResult = {\n success: true,\n docsPath: '',\n filesCreated: [],\n errors: [],\n };\n\n try {\n const { projectRoot, docsPath = 'docs', includeExamples = true, detectFramework = true } = options;\n const fullDocsPath = join(projectRoot, docsPath);\n result.docsPath = fullDocsPath;\n\n // Detect project information\n const projectName = await detectProjectName(projectRoot);\n const frameworks = detectFramework ? await detectFrameworks(projectRoot) : [];\n const languages = detectFramework ? await detectLanguages(projectRoot) : [];\n const dependencies = detectFramework ? await detectDependencies(projectRoot) : [];\n\n // Create template context\n const context = {\n projectName,\n date: new Date().toISOString().split('T')[0],\n frameworks,\n languages,\n dependencies,\n concepts: [],\n components: [],\n services: [],\n features: [],\n };\n\n // Create directories\n for (const dir of DEFAULT_STRUCTURE.directories) {\n const dirPath = join(fullDocsPath, dir);\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n result.filesCreated.push(dirPath);\n }\n }\n\n // Create files from templates\n for (const [filePath, templateName] of Object.entries(DEFAULT_STRUCTURE.files)) {\n const fullPath = join(fullDocsPath, filePath);\n\n // Skip if file exists\n if (existsSync(fullPath)) {\n continue;\n }\n\n // Get template and compile\n const template = TEMPLATES[templateName];\n if (!template) {\n result.errors.push(`Template not found: ${templateName}`);\n continue;\n }\n\n try {\n const compiled = Handlebars.compile(template);\n const content = compiled(context);\n writeFileSync(fullPath, content, 'utf-8');\n result.filesCreated.push(fullPath);\n } catch (error) {\n result.errors.push(`Failed to create ${filePath}: ${error}`);\n }\n }\n\n // Create example files if requested\n if (includeExamples) {\n await createExampleFiles(fullDocsPath, context, result);\n }\n\n // Create .obsidian folder for vault detection\n const obsidianPath = join(fullDocsPath, '.obsidian');\n if (!existsSync(obsidianPath)) {\n mkdirSync(obsidianPath, { recursive: true });\n\n // Create minimal app.json for Obsidian\n const appJson = {\n \"legacyEditor\": false,\n \"livePreview\": true,\n };\n writeFileSync(join(obsidianPath, 'app.json'), JSON.stringify(appJson, null, 2));\n result.filesCreated.push(obsidianPath);\n }\n\n result.success = result.errors.length === 0;\n } catch (error) {\n result.success = false;\n result.errors.push(`Init failed: ${error}`);\n }\n\n return result;\n}\n\n/**\n * Detect project name from package.json or directory\n */\nasync function detectProjectName(projectRoot: string): Promise<string> {\n try {\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.name) {\n // Remove scope if present\n return pkg.name.replace(/^@[^/]+\\//, '');\n }\n }\n } catch {\n // Ignore errors\n }\n\n // Fall back to directory name\n return basename(projectRoot);\n}\n\n/**\n * Detect frameworks from project files\n */\nasync function detectFrameworks(projectRoot: string): Promise<FrameworkInfo[]> {\n const frameworks: FrameworkInfo[] = [];\n\n try {\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const deps = { ...pkg.dependencies, ...pkg.devDependencies };\n\n // Framework detection patterns\n const patterns: Array<{ name: string; packages: string[]; category: string }> = [\n { name: 'React', packages: ['react'], category: 'components/ui' },\n { name: 'Next.js', packages: ['next'], category: 'services/api' },\n { name: 'Vue', packages: ['vue'], category: 'components/ui' },\n { name: 'Express', packages: ['express'], category: 'services/api' },\n { name: 'Fastify', packages: ['fastify'], category: 'services/api' },\n { name: 'Prisma', packages: ['@prisma/client', 'prisma'], category: 'integrations/databases' },\n { name: 'TypeORM', packages: ['typeorm'], category: 'integrations/databases' },\n { name: 'Jest', packages: ['jest'], category: 'guides/testing' },\n { name: 'Vitest', packages: ['vitest'], category: 'guides/testing' },\n { name: 'Vite', packages: ['vite'], category: 'standards/build-tools' },\n { name: 'Webpack', packages: ['webpack'], category: 'standards/build-tools' },\n ];\n\n for (const pattern of patterns) {\n for (const pkg of pattern.packages) {\n if (deps[pkg]) {\n frameworks.push({\n name: pattern.name,\n slug: pattern.name.toLowerCase().replace(/[^a-z0-9]+/g, '-'),\n category: pattern.category,\n version: deps[pkg],\n });\n break;\n }\n }\n }\n }\n } catch {\n // Ignore errors\n }\n\n return frameworks;\n}\n\n/**\n * Detect programming languages used\n */\nasync function detectLanguages(projectRoot: string): Promise<string[]> {\n const languages: Set<string> = new Set();\n\n try {\n // Check for TypeScript\n if (existsSync(join(projectRoot, 'tsconfig.json'))) {\n languages.add('typescript');\n }\n\n // Check for package.json (JavaScript/Node.js)\n if (existsSync(join(projectRoot, 'package.json'))) {\n languages.add('javascript');\n }\n\n // Check for Python\n if (existsSync(join(projectRoot, 'requirements.txt')) ||\n existsSync(join(projectRoot, 'pyproject.toml'))) {\n languages.add('python');\n }\n\n // Check for Rust\n if (existsSync(join(projectRoot, 'Cargo.toml'))) {\n languages.add('rust');\n }\n\n // Check for Go\n if (existsSync(join(projectRoot, 'go.mod'))) {\n languages.add('go');\n }\n } catch {\n // Ignore errors\n }\n\n return Array.from(languages);\n}\n\n/**\n * Detect major dependencies\n */\nasync function detectDependencies(projectRoot: string): Promise<Array<{ name: string; slug: string; category: string; description: string }>> {\n const deps: Array<{ name: string; slug: string; category: string; description: string }> = [];\n\n try {\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const allDeps = { ...pkg.dependencies };\n\n // Top dependencies to document\n const topDeps = Object.keys(allDeps).slice(0, 10);\n\n for (const dep of topDeps) {\n deps.push({\n name: dep,\n slug: dep.replace(/^@/, '').replace(/[^a-z0-9]+/g, '-'),\n category: 'components/utilities',\n description: `Version ${allDeps[dep]}`,\n });\n }\n }\n } catch {\n // Ignore errors\n }\n\n return deps;\n}\n\n/**\n * Create example documentation files\n */\nasync function createExampleFiles(\n docsPath: string,\n context: Record<string, unknown>,\n result: DocsInitResult\n): Promise<void> {\n const examples = [\n {\n path: 'guides/getting-started/index.md',\n content: `---\ntitle: Getting Started\ntype: guide\nstatus: active\ntags: [guide, getting-started]\ncreated: ${context.date}\nupdated: ${context.date}\n---\n\n# Getting Started with ${context.projectName}\n\nWelcome! This guide will help you get up and running.\n\n## Prerequisites\n\n- Node.js 20+\n- npm or bun\n\n## Installation\n\n\\`\\`\\`bash\nnpm install\n\\`\\`\\`\n\n## Quick Start\n\n1. Clone the repository\n2. Install dependencies\n3. Run the development server\n\n## Next Steps\n\n- Explore the [[MOC|Map of Content]]\n- Review [[PRIMITIVES|Technology Primitives]]\n`,\n },\n {\n path: 'concepts/architecture/index.md',\n content: `---\ntitle: Architecture Overview\ntype: concept\nstatus: active\ntags: [architecture, concept]\ncreated: ${context.date}\nupdated: ${context.date}\n---\n\n# Architecture Overview\n\nHigh-level architecture of ${context.projectName}.\n\n## System Diagram\n\n\\`\\`\\`\n┌──────────────┐ ┌──────────────┐\n│ Frontend │────▶│ Backend │\n└──────────────┘ └──────────────┘\n │\n ┌──────▼──────┐\n │ Database │\n └─────────────┘\n\\`\\`\\`\n\n## Key Components\n\n- **Frontend**: User interface\n- **Backend**: API and business logic\n- **Database**: Data persistence\n\n## Design Principles\n\n1. Separation of concerns\n2. Single responsibility\n3. Dependency injection\n`,\n },\n ];\n\n for (const example of examples) {\n const fullPath = join(docsPath, example.path);\n if (!existsSync(fullPath)) {\n const dir = join(fullPath, '..');\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n writeFileSync(fullPath, example.content, 'utf-8');\n result.filesCreated.push(fullPath);\n }\n }\n}\n\n/**\n * Check if docs directory exists\n */\nexport function docsExist(projectRoot: string, docsPath = 'docs'): boolean {\n return existsSync(join(projectRoot, docsPath));\n}\n\n/**\n * Get docs path for a project\n */\nexport function getDocsPath(projectRoot: string): string | null {\n const possiblePaths = ['docs', 'documentation', 'doc', 'wiki'];\n\n for (const path of possiblePaths) {\n const fullPath = join(projectRoot, path);\n if (existsSync(fullPath)) {\n return fullPath;\n }\n }\n\n return null;\n}\n"],"names":["pkg"],"mappings":";;;AA0BA,MAAM,oBAAoB;AAAA,EACxB,aAAa;AAAA;AAAA,IAEX;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA,IAC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IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,6BAKM,QAAQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA;AAAA,EA0B5C;AAGF,aAAW,WAAW,UAAU;AAC9B,UAAM,WAAW,KAAK,UAAU,QAAQ,IAAI;AAC5C,QAAI,CAAC,WAAW,QAAQ,GAAG;AACzB,YAAM,MAAM,KAAK,UAAU,IAAI;AAC/B,UAAI,CAAC,WAAW,GAAG,GAAG;AACpB,kBAAU,KAAK,EAAE,WAAW,KAAA,CAAM;AAAA,MACpC;AACA,oBAAc,UAAU,QAAQ,SAAS,OAAO;AAChD,aAAO,aAAa,KAAK,QAAQ;AAAA,IACnC;AAAA,EACF;AACF;AAKO,SAAS,UAAU,aAAqB,WAAW,QAAiB;AACzE,SAAO,WAAW,KAAK,aAAa,QAAQ,CAAC;AAC/C;AAKO,SAAS,YAAY,aAAoC;AAC9D,QAAM,gBAAgB,CAAC,QAAQ,iBAAiB,OAAO,MAAM;AAE7D,aAAW,QAAQ,eAAe;AAChC,UAAM,WAAW,KAAK,aAAa,IAAI;AACvC,QAAI,WAAW,QAAQ,GAAG;AACxB,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;"}
1
+ {"version":3,"file":"docs-init.js","sources":["../../src/generators/docs-init.ts"],"sourcesContent":["/**\n * Docs Directory Initializer\n *\n * Creates the initial docs directory structure following the weave-nn\n * methodology with proper PRIMITIVES.md taxonomy.\n *\n * SECURITY NOTES (Handlebars Templates):\n * - All templates use double-braces {{}} which HTML-escapes output\n * - Triple-braces {{{raw}}} are NOT used, preventing injection attacks\n * - Template variables come from internal sources (project analysis), not direct user input\n * - See: https://handlebarsjs.com/guide/#html-escaping\n */\n\nimport { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';\nimport { join, basename } from 'path';\nimport fg from 'fast-glob';\nimport Handlebars from 'handlebars';\nimport type {\n DocsInitOptions,\n DocsInitResult,\n NodeType,\n} from '../core/types.js';\n\n/**\n * Default docs structure based on PRIMITIVES.md taxonomy\n */\nconst DEFAULT_STRUCTURE = {\n directories: [\n // Core concepts\n 'concepts',\n 'concepts/architecture',\n 'concepts/patterns',\n\n // Components\n 'components',\n 'components/ui',\n 'components/utilities',\n\n // Services\n 'services',\n 'services/api',\n 'services/workers',\n\n // Features\n 'features',\n 'features/core',\n 'features/advanced',\n\n // Integrations\n 'integrations',\n 'integrations/databases',\n 'integrations/auth-providers',\n 'integrations/storage',\n 'integrations/monitoring',\n\n // Standards\n 'standards',\n 'standards/coding-standards',\n 'standards/programming-languages',\n 'standards/build-tools',\n\n // Guides\n 'guides',\n 'guides/getting-started',\n 'guides/testing',\n 'guides/deployment',\n\n // References\n 'references',\n 'references/api',\n 'references/cli',\n\n // Meta\n '_templates',\n '_attachments',\n ],\n files: {\n // Root files\n 'README.md': 'readme',\n 'PRIMITIVES.md': 'primitives',\n 'MOC.md': 'moc',\n\n // Directory index files (_MOC.md is the local map of content)\n 'concepts/_MOC.md': 'moc-concepts',\n 'components/_MOC.md': 'moc-components',\n 'services/_MOC.md': 'moc-services',\n 'features/_MOC.md': 'moc-features',\n 'integrations/_MOC.md': 'moc-integrations',\n 'standards/_MOC.md': 'moc-standards',\n 'guides/_MOC.md': 'moc-guides',\n 'references/_MOC.md': 'moc-references',\n\n // Templates\n '_templates/concept.md': 'template-concept',\n '_templates/technical.md': 'template-technical',\n '_templates/feature.md': 'template-feature',\n '_templates/service.md': 'template-service',\n '_templates/guide.md': 'template-guide',\n },\n};\n\n/**\n * Template content for docs files\n */\nconst TEMPLATES: Record<string, string> = {\n readme: `# {{projectName}} Documentation\n\nWelcome to the {{projectName}} knowledge base.\n\n## Quick Navigation\n\n- [[MOC|Map of Content]] - Overview of all documentation\n- [[PRIMITIVES|Primitives]] - Core building blocks and technologies\n\n## Structure\n\nThis documentation follows the Weave-NN knowledge graph methodology:\n\n\\`\\`\\`\ndocs/\n├── concepts/ # Abstract concepts and ideas\n├── components/ # Reusable components and utilities\n├── services/ # Backend services and APIs\n├── features/ # Product features and capabilities\n├── integrations/ # External integrations\n├── standards/ # Coding standards and conventions\n├── guides/ # How-to guides and tutorials\n└── references/ # API and CLI references\n\\`\\`\\`\n\n## Getting Started\n\n1. Browse the [[MOC|Map of Content]] for an overview\n2. Check [[PRIMITIVES]] for technology decisions\n3. Read [[guides/getting-started/index|Getting Started Guide]]\n\n---\n*Generated by @weave-nn/knowledge-graph-agent*\n`,\n\n primitives: `# Primitives\n\nCore building blocks and technology decisions for {{projectName}}.\n\n## Overview\n\nPrimitives are the foundational technologies that power this project. Each primitive represents a key technology choice with its rationale and usage patterns.\n\n## Categories\n\n### Languages\n{{#each languages}}\n- [[standards/programming-languages/{{this}}|{{this}}]]\n{{/each}}\n\n### Frameworks\n{{#each frameworks}}\n- [[{{category}}/{{slug}}|{{name}}]]\n{{/each}}\n\n### Key Dependencies\n{{#each dependencies}}\n- [[{{category}}/{{slug}}|{{name}}]] - {{description}}\n{{/each}}\n\n## Technology Decisions\n\n| Category | Choice | Rationale |\n|----------|--------|-----------|\n| Runtime | Node.js | Modern JavaScript runtime |\n| Language | TypeScript | Type safety and DX |\n| Package Manager | npm/bun | Fast, reliable |\n\n---\n*Generated by @weave-nn/knowledge-graph-agent*\n`,\n\n moc: `# Map of Content\n\nCentral navigation hub for {{projectName}} documentation.\n\n## Core Concepts\n- [[concepts/_MOC|Concepts Index]]\n\n## Components\n- [[components/_MOC|Components Index]]\n\n## Services\n- [[services/_MOC|Services Index]]\n\n## Features\n- [[features/_MOC|Features Index]]\n\n## Integrations\n- [[integrations/_MOC|Integrations Index]]\n\n## Standards\n- [[standards/_MOC|Standards Index]]\n\n## Guides\n- [[guides/_MOC|Guides Index]]\n\n## References\n- [[references/_MOC|References Index]]\n\n---\n*Last updated: {{date}}*\n`,\n\n 'moc-concepts': `---\ntitle: Concepts\ntype: concept\nstatus: active\ntags: [moc, concepts]\ncreated: {{date}}\n---\n\n# Concepts\n\nAbstract concepts and architectural patterns for {{projectName}}.\n\n## Architecture\n- [[concepts/architecture/index|Architecture Overview]]\n\n## Patterns\n*Add design patterns and abstractions here*\n\n## Mental Models\n*Add key mental models for understanding the system*\n\n---\n> Use template: [[_templates/concept|Concept Template]]\n`,\n\n 'moc-components': `---\ntitle: Components\ntype: technical\nstatus: active\ntags: [moc, components]\ncreated: {{date}}\n---\n\n# Components\n\nReusable components and utilities for {{projectName}}.\n\n## UI Components\n*Add UI components here*\n\n## Utilities\n*Add utility functions and helpers*\n\n## Shared Libraries\n*Add shared code libraries*\n\n---\n> Use template: [[_templates/technical|Technical Template]]\n`,\n\n 'moc-services': `---\ntitle: Services\ntype: service\nstatus: active\ntags: [moc, services]\ncreated: {{date}}\n---\n\n# Services\n\nBackend services and APIs for {{projectName}}.\n\n## API Services\n*Add API service documentation*\n\n## Background Workers\n*Add worker/job documentation*\n\n## External Services\n*Add third-party service integrations*\n\n---\n> Use template: [[_templates/service|Service Template]]\n`,\n\n 'moc-features': `---\ntitle: Features\ntype: feature\nstatus: active\ntags: [moc, features]\ncreated: {{date}}\n---\n\n# Features\n\nProduct features and capabilities for {{projectName}}.\n\n## Core Features\n*Add core feature documentation*\n\n## Advanced Features\n*Add advanced feature documentation*\n\n## Upcoming Features\n*Add planned features*\n\n---\n> Use template: [[_templates/feature|Feature Template]]\n`,\n\n 'moc-integrations': `---\ntitle: Integrations\ntype: integration\nstatus: active\ntags: [moc, integrations]\ncreated: {{date}}\n---\n\n# Integrations\n\nExternal integrations and third-party services for {{projectName}}.\n\n## Databases\n*Add database integrations*\n\n## Authentication\n*Add auth provider integrations*\n\n## Storage\n*Add storage integrations*\n\n## Monitoring\n*Add monitoring/observability integrations*\n\n---\n> Use template: [[_templates/technical|Technical Template]]\n`,\n\n 'moc-standards': `---\ntitle: Standards\ntype: standard\nstatus: active\ntags: [moc, standards]\ncreated: {{date}}\n---\n\n# Standards\n\nCoding standards and conventions for {{projectName}}.\n\n## Coding Standards\n*Add coding style guides*\n\n## Programming Languages\n{{#each languages}}\n- [[standards/programming-languages/{{this}}|{{this}}]]\n{{/each}}\n\n## Build Tools\n*Add build tool documentation*\n\n---\n> See also: [[PRIMITIVES|Technology Primitives]]\n`,\n\n 'moc-guides': `---\ntitle: Guides\ntype: guide\nstatus: active\ntags: [moc, guides]\ncreated: {{date}}\n---\n\n# Guides\n\nHow-to guides and tutorials for {{projectName}}.\n\n## Getting Started\n- [[guides/getting-started/index|Getting Started Guide]]\n\n## Testing\n*Add testing guides*\n\n## Deployment\n*Add deployment guides*\n\n## Troubleshooting\n*Add troubleshooting guides*\n\n---\n> Use template: [[_templates/guide|Guide Template]]\n`,\n\n 'moc-references': `---\ntitle: References\ntype: technical\nstatus: active\ntags: [moc, references]\ncreated: {{date}}\n---\n\n# References\n\nAPI and CLI references for {{projectName}}.\n\n## API Reference\n*Add API documentation*\n\n## CLI Reference\n*Add CLI documentation*\n\n## Configuration Reference\n*Add configuration options*\n\n---\n> See also: [[PRIMITIVES|Technology Primitives]]\n`,\n\n 'template-concept': `---\ntitle: {{title}}\ntype: concept\nstatus: draft\ntags: [concept]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this concept.\n\n## Key Ideas\n\n- Point 1\n- Point 2\n- Point 3\n\n## Related Concepts\n\n- [[related-concept-1]]\n- [[related-concept-2]]\n\n## References\n\n- External reference 1\n- External reference 2\n`,\n\n 'template-technical': `---\ntitle: {{title}}\ntype: technical\nstatus: draft\ntags: [technical]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this technical component.\n\n## Implementation\n\n\\`\\`\\`typescript\n// Code example\n\\`\\`\\`\n\n## Usage\n\nHow to use this component.\n\n## Configuration\n\nAvailable configuration options.\n\n## Related\n\n- [[related-technical-1]]\n`,\n\n 'template-feature': `---\ntitle: {{title}}\ntype: feature\nstatus: draft\ntags: [feature]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this feature.\n\n## User Story\n\nAs a [user type], I want [goal] so that [benefit].\n\n## Acceptance Criteria\n\n- [ ] Criterion 1\n- [ ] Criterion 2\n- [ ] Criterion 3\n\n## Technical Implementation\n\nHow this feature is implemented.\n\n## Related Features\n\n- [[related-feature-1]]\n`,\n\n 'template-service': `---\ntitle: {{title}}\ntype: service\nstatus: draft\ntags: [service, api]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Overview\n\nBrief description of this service.\n\n## Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /api/... | Description |\n| POST | /api/... | Description |\n\n## Configuration\n\nEnvironment variables and configuration options.\n\n## Dependencies\n\n- [[dependency-1]]\n- [[dependency-2]]\n\n## Deployment\n\nDeployment instructions.\n`,\n\n 'template-guide': `---\ntitle: {{title}}\ntype: guide\nstatus: draft\ntags: [guide, tutorial]\ncreated: {{date}}\nupdated: {{date}}\n---\n\n# {{title}}\n\n## Prerequisites\n\n- Prerequisite 1\n- Prerequisite 2\n\n## Steps\n\n### Step 1: Title\n\nInstructions for step 1.\n\n### Step 2: Title\n\nInstructions for step 2.\n\n### Step 3: Title\n\nInstructions for step 3.\n\n## Troubleshooting\n\nCommon issues and solutions.\n\n## Next Steps\n\n- [[next-guide-1]]\n- [[next-guide-2]]\n`,\n};\n\n/**\n * Framework detection result\n */\ninterface FrameworkInfo {\n name: string;\n slug: string;\n category: string;\n version?: string;\n}\n\n/**\n * Initialize docs directory\n */\nexport async function initDocs(options: DocsInitOptions): Promise<DocsInitResult> {\n const result: DocsInitResult = {\n success: true,\n docsPath: '',\n filesCreated: [],\n errors: [],\n };\n\n try {\n const { projectRoot, docsPath = 'docs', includeExamples = true, detectFramework = true } = options;\n const fullDocsPath = join(projectRoot, docsPath);\n result.docsPath = fullDocsPath;\n\n // Detect project information\n const projectName = await detectProjectName(projectRoot);\n const frameworks = detectFramework ? await detectFrameworks(projectRoot) : [];\n const languages = detectFramework ? await detectLanguages(projectRoot) : [];\n const dependencies = detectFramework ? await detectDependencies(projectRoot) : [];\n\n // Create template context\n const context = {\n projectName,\n date: new Date().toISOString().split('T')[0],\n frameworks,\n languages,\n dependencies,\n concepts: [],\n components: [],\n services: [],\n features: [],\n };\n\n // Create directories\n for (const dir of DEFAULT_STRUCTURE.directories) {\n const dirPath = join(fullDocsPath, dir);\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n result.filesCreated.push(dirPath);\n }\n }\n\n // Create files from templates\n for (const [filePath, templateName] of Object.entries(DEFAULT_STRUCTURE.files)) {\n const fullPath = join(fullDocsPath, filePath);\n\n // Skip if file exists\n if (existsSync(fullPath)) {\n continue;\n }\n\n // Get template and compile\n const template = TEMPLATES[templateName];\n if (!template) {\n result.errors.push(`Template not found: ${templateName}`);\n continue;\n }\n\n try {\n const compiled = Handlebars.compile(template);\n const content = compiled(context);\n writeFileSync(fullPath, content, 'utf-8');\n result.filesCreated.push(fullPath);\n } catch (error) {\n result.errors.push(`Failed to create ${filePath}: ${error}`);\n }\n }\n\n // Create example files if requested\n if (includeExamples) {\n await createExampleFiles(fullDocsPath, context, result);\n }\n\n // Create .obsidian folder for vault detection\n const obsidianPath = join(fullDocsPath, '.obsidian');\n if (!existsSync(obsidianPath)) {\n mkdirSync(obsidianPath, { recursive: true });\n\n // Create minimal app.json for Obsidian\n const appJson = {\n \"legacyEditor\": false,\n \"livePreview\": true,\n };\n writeFileSync(join(obsidianPath, 'app.json'), JSON.stringify(appJson, null, 2));\n result.filesCreated.push(obsidianPath);\n }\n\n result.success = result.errors.length === 0;\n } catch (error) {\n result.success = false;\n result.errors.push(`Init failed: ${error}`);\n }\n\n return result;\n}\n\n/**\n * Detect project name from package.json or directory\n */\nasync function detectProjectName(projectRoot: string): Promise<string> {\n try {\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.name) {\n // Remove scope if present\n return pkg.name.replace(/^@[^/]+\\//, '');\n }\n }\n } catch {\n // Ignore errors\n }\n\n // Fall back to directory name\n return basename(projectRoot);\n}\n\n/**\n * Detect frameworks from project files\n */\nasync function detectFrameworks(projectRoot: string): Promise<FrameworkInfo[]> {\n const frameworks: FrameworkInfo[] = [];\n\n try {\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const deps = { ...pkg.dependencies, ...pkg.devDependencies };\n\n // Framework detection patterns\n const patterns: Array<{ name: string; packages: string[]; category: string }> = [\n { name: 'React', packages: ['react'], category: 'components/ui' },\n { name: 'Next.js', packages: ['next'], category: 'services/api' },\n { name: 'Vue', packages: ['vue'], category: 'components/ui' },\n { name: 'Express', packages: ['express'], category: 'services/api' },\n { name: 'Fastify', packages: ['fastify'], category: 'services/api' },\n { name: 'Prisma', packages: ['@prisma/client', 'prisma'], category: 'integrations/databases' },\n { name: 'TypeORM', packages: ['typeorm'], category: 'integrations/databases' },\n { name: 'Jest', packages: ['jest'], category: 'guides/testing' },\n { name: 'Vitest', packages: ['vitest'], category: 'guides/testing' },\n { name: 'Vite', packages: ['vite'], category: 'standards/build-tools' },\n { name: 'Webpack', packages: ['webpack'], category: 'standards/build-tools' },\n ];\n\n for (const pattern of patterns) {\n for (const pkg of pattern.packages) {\n if (deps[pkg]) {\n frameworks.push({\n name: pattern.name,\n slug: pattern.name.toLowerCase().replace(/[^a-z0-9]+/g, '-'),\n category: pattern.category,\n version: deps[pkg],\n });\n break;\n }\n }\n }\n }\n } catch {\n // Ignore errors\n }\n\n return frameworks;\n}\n\n/**\n * Detect programming languages used\n */\nasync function detectLanguages(projectRoot: string): Promise<string[]> {\n const languages: Set<string> = new Set();\n\n try {\n // Check for TypeScript\n if (existsSync(join(projectRoot, 'tsconfig.json'))) {\n languages.add('typescript');\n }\n\n // Check for package.json (JavaScript/Node.js)\n if (existsSync(join(projectRoot, 'package.json'))) {\n languages.add('javascript');\n }\n\n // Check for Python\n if (existsSync(join(projectRoot, 'requirements.txt')) ||\n existsSync(join(projectRoot, 'pyproject.toml'))) {\n languages.add('python');\n }\n\n // Check for Rust\n if (existsSync(join(projectRoot, 'Cargo.toml'))) {\n languages.add('rust');\n }\n\n // Check for Go\n if (existsSync(join(projectRoot, 'go.mod'))) {\n languages.add('go');\n }\n } catch {\n // Ignore errors\n }\n\n return Array.from(languages);\n}\n\n/**\n * Detect major dependencies\n */\nasync function detectDependencies(projectRoot: string): Promise<Array<{ name: string; slug: string; category: string; description: string }>> {\n const deps: Array<{ name: string; slug: string; category: string; description: string }> = [];\n\n try {\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const allDeps = { ...pkg.dependencies };\n\n // Top dependencies to document\n const topDeps = Object.keys(allDeps).slice(0, 10);\n\n for (const dep of topDeps) {\n deps.push({\n name: dep,\n slug: dep.replace(/^@/, '').replace(/[^a-z0-9]+/g, '-'),\n category: 'components/utilities',\n description: `Version ${allDeps[dep]}`,\n });\n }\n }\n } catch {\n // Ignore errors\n }\n\n return deps;\n}\n\n/**\n * Create example documentation files\n */\nasync function createExampleFiles(\n docsPath: string,\n context: Record<string, unknown>,\n result: DocsInitResult\n): Promise<void> {\n const examples = [\n {\n path: 'guides/getting-started/index.md',\n content: `---\ntitle: Getting Started\ntype: guide\nstatus: active\ntags: [guide, getting-started]\ncreated: ${context.date}\nupdated: ${context.date}\n---\n\n# Getting Started with ${context.projectName}\n\nWelcome! This guide will help you get up and running.\n\n## Prerequisites\n\n- Node.js 20+\n- npm or bun\n\n## Installation\n\n\\`\\`\\`bash\nnpm install\n\\`\\`\\`\n\n## Quick Start\n\n1. Clone the repository\n2. Install dependencies\n3. Run the development server\n\n## Next Steps\n\n- Explore the [[MOC|Map of Content]]\n- Review [[PRIMITIVES|Technology Primitives]]\n`,\n },\n {\n path: 'concepts/architecture/index.md',\n content: `---\ntitle: Architecture Overview\ntype: concept\nstatus: active\ntags: [architecture, concept]\ncreated: ${context.date}\nupdated: ${context.date}\n---\n\n# Architecture Overview\n\nHigh-level architecture of ${context.projectName}.\n\n## System Diagram\n\n\\`\\`\\`\n┌──────────────┐ ┌──────────────┐\n│ Frontend │────▶│ Backend │\n└──────────────┘ └──────────────┘\n │\n ┌──────▼──────┐\n │ Database │\n └─────────────┘\n\\`\\`\\`\n\n## Key Components\n\n- **Frontend**: User interface\n- **Backend**: API and business logic\n- **Database**: Data persistence\n\n## Design Principles\n\n1. Separation of concerns\n2. Single responsibility\n3. Dependency injection\n`,\n },\n ];\n\n for (const example of examples) {\n const fullPath = join(docsPath, example.path);\n if (!existsSync(fullPath)) {\n const dir = join(fullPath, '..');\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n writeFileSync(fullPath, example.content, 'utf-8');\n result.filesCreated.push(fullPath);\n }\n }\n}\n\n/**\n * Check if docs directory exists\n */\nexport function docsExist(projectRoot: string, docsPath = 'docs'): boolean {\n return existsSync(join(projectRoot, docsPath));\n}\n\n/**\n * Get docs path for a project\n */\nexport function getDocsPath(projectRoot: string): string | null {\n const possiblePaths = ['docs', 'documentation', 'doc', 'wiki'];\n\n for (const path of possiblePaths) {\n const fullPath = join(projectRoot, path);\n if (existsSync(fullPath)) {\n return fullPath;\n }\n }\n\n return null;\n}\n"],"names":["pkg"],"mappings":";;;AA0BA,MAAM,oBAAoB;AAAA,EACxB,aAAa;AAAA;AAAA,IAEX;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AA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;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;"}
@@ -1,4 +1,4 @@
1
- import { __exports as dist } from "../../../../_virtual/index5.js";
1
+ import { __exports as dist } from "../../../../_virtual/index6.js";
2
2
  import { __require as requireAstSpec } from "./generated/ast-spec.js";
3
3
  import { __require as requireLib } from "./lib.js";
4
4
  import { __require as requireParserOptions } from "./parser-options.js";
@@ -1,4 +1,4 @@
1
- import { __exports as dist } from "../../../../_virtual/index6.js";
1
+ import { __exports as dist } from "../../../../_virtual/index5.js";
2
2
  import { __require as requireGetKeys } from "./get-keys.js";
3
3
  import { __require as requireVisitorKeys } from "./visitor-keys.js";
4
4
  var hasRequiredDist;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weavelogic/knowledge-graph-agent",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Knowledge graph agent for Claude Code - generates knowledge graphs, initializes docs, and integrates with claude-flow",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",