@esthernandez/vibe-doc 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/checker/index.d.ts +34 -0
  2. package/dist/checker/index.d.ts.map +1 -0
  3. package/dist/checker/index.js +154 -0
  4. package/dist/checker/staleness.d.ts +26 -0
  5. package/dist/checker/staleness.d.ts.map +1 -0
  6. package/dist/checker/staleness.js +56 -0
  7. package/dist/classifier/index.d.ts +26 -0
  8. package/dist/classifier/index.d.ts.map +1 -0
  9. package/dist/classifier/index.js +146 -0
  10. package/dist/classifier/llm-prompt.d.ts +12 -0
  11. package/dist/classifier/llm-prompt.d.ts.map +1 -0
  12. package/dist/classifier/llm-prompt.js +123 -0
  13. package/dist/classifier/scoring-engine.d.ts +41 -0
  14. package/dist/classifier/scoring-engine.d.ts.map +1 -0
  15. package/dist/classifier/scoring-engine.js +197 -0
  16. package/dist/classifier/signals.d.ts +16 -0
  17. package/dist/classifier/signals.d.ts.map +1 -0
  18. package/dist/classifier/signals.js +305 -0
  19. package/dist/gap-analyzer/breadcrumbs.d.ts +18 -0
  20. package/dist/gap-analyzer/breadcrumbs.d.ts.map +1 -0
  21. package/dist/gap-analyzer/breadcrumbs.js +314 -0
  22. package/dist/gap-analyzer/index.d.ts +13 -0
  23. package/dist/gap-analyzer/index.d.ts.map +1 -0
  24. package/dist/gap-analyzer/index.js +88 -0
  25. package/dist/gap-analyzer/matrix.d.ts +29 -0
  26. package/dist/gap-analyzer/matrix.d.ts.map +1 -0
  27. package/dist/gap-analyzer/matrix.js +137 -0
  28. package/dist/gap-analyzer/tier-assigner.d.ts +22 -0
  29. package/dist/gap-analyzer/tier-assigner.d.ts.map +1 -0
  30. package/dist/gap-analyzer/tier-assigner.js +112 -0
  31. package/dist/generator/docx-writer.d.ts +15 -0
  32. package/dist/generator/docx-writer.d.ts.map +1 -0
  33. package/dist/generator/docx-writer.js +271 -0
  34. package/dist/generator/extractor.d.ts +11 -0
  35. package/dist/generator/extractor.d.ts.map +1 -0
  36. package/dist/generator/extractor.js +459 -0
  37. package/dist/generator/index.d.ts +25 -0
  38. package/dist/generator/index.d.ts.map +1 -0
  39. package/dist/generator/index.js +106 -0
  40. package/dist/generator/markdown-writer.d.ts +27 -0
  41. package/dist/generator/markdown-writer.d.ts.map +1 -0
  42. package/dist/generator/markdown-writer.js +85 -0
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +372 -0
  46. package/dist/scanner/artifact-scanner.d.ts +16 -0
  47. package/dist/scanner/artifact-scanner.d.ts.map +1 -0
  48. package/dist/scanner/artifact-scanner.js +189 -0
  49. package/dist/scanner/code-scanner.d.ts +17 -0
  50. package/dist/scanner/code-scanner.d.ts.map +1 -0
  51. package/dist/scanner/code-scanner.js +69 -0
  52. package/dist/scanner/file-scanner.d.ts +16 -0
  53. package/dist/scanner/file-scanner.d.ts.map +1 -0
  54. package/dist/scanner/file-scanner.js +119 -0
  55. package/dist/scanner/git-scanner.d.ts +10 -0
  56. package/dist/scanner/git-scanner.d.ts.map +1 -0
  57. package/dist/scanner/git-scanner.js +120 -0
  58. package/dist/scanner/index.d.ts +15 -0
  59. package/dist/scanner/index.d.ts.map +1 -0
  60. package/dist/scanner/index.js +106 -0
  61. package/dist/state/index.d.ts +20 -0
  62. package/dist/state/index.d.ts.map +1 -0
  63. package/dist/state/index.js +141 -0
  64. package/dist/state/schema.d.ts +101 -0
  65. package/dist/state/schema.d.ts.map +1 -0
  66. package/dist/state/schema.js +6 -0
  67. package/dist/templates/embedded/adr.md +45 -0
  68. package/dist/templates/embedded/api-spec.md +55 -0
  69. package/dist/templates/embedded/data-model.md +55 -0
  70. package/dist/templates/embedded/deployment-procedure.md +63 -0
  71. package/dist/templates/embedded/runbook.md +55 -0
  72. package/dist/templates/embedded/test-plan.md +55 -0
  73. package/dist/templates/embedded/threat-model.md +47 -0
  74. package/dist/templates/index.d.ts +20 -0
  75. package/dist/templates/index.d.ts.map +1 -0
  76. package/dist/templates/index.js +106 -0
  77. package/dist/templates/registry.d.ts +31 -0
  78. package/dist/templates/registry.d.ts.map +1 -0
  79. package/dist/templates/registry.js +172 -0
  80. package/dist/templates/renderer.d.ts +26 -0
  81. package/dist/templates/renderer.d.ts.map +1 -0
  82. package/dist/templates/renderer.js +145 -0
  83. package/dist/utils/language-detect.d.ts +14 -0
  84. package/dist/utils/language-detect.d.ts.map +1 -0
  85. package/dist/utils/language-detect.js +58 -0
  86. package/dist/utils/logger.d.ts +16 -0
  87. package/dist/utils/logger.d.ts.map +1 -0
  88. package/dist/utils/logger.js +35 -0
  89. package/dist/versioning/differ.d.ts +20 -0
  90. package/dist/versioning/differ.d.ts.map +1 -0
  91. package/dist/versioning/differ.js +160 -0
  92. package/dist/versioning/index.d.ts +44 -0
  93. package/dist/versioning/index.d.ts.map +1 -0
  94. package/dist/versioning/index.js +165 -0
  95. package/package.json +40 -0
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Vibe Doc State Schema
3
+ * Defines the complete state shape for the documentation generation pipeline
4
+ */
5
+ export interface InterviewAnswers {
6
+ projectName: string;
7
+ projectDescription: string;
8
+ mainPurpose: string;
9
+ primaryUsers: string;
10
+ coreFeatures: string[];
11
+ technologies: string[];
12
+ deploymentModel: string;
13
+ architectureStyle: string;
14
+ }
15
+ export interface ProjectProfile {
16
+ interviewAnswers: InterviewAnswers;
17
+ providedContext: string;
18
+ }
19
+ export interface ArtifactsByType {
20
+ files: string[];
21
+ count: number;
22
+ }
23
+ export interface GitStats {
24
+ totalCommits: number;
25
+ contributors: number;
26
+ lastCommitDate: string;
27
+ mainLanguages: string[];
28
+ }
29
+ export interface ArtifactInventory {
30
+ totalArtifacts: number;
31
+ categories: {
32
+ sourceCode: ArtifactsByType;
33
+ configuration: ArtifactsByType;
34
+ documentation: ArtifactsByType;
35
+ tests: ArtifactsByType;
36
+ architecture: ArtifactsByType;
37
+ infrastructure: ArtifactsByType;
38
+ };
39
+ gitStats: GitStats;
40
+ }
41
+ export interface DeploymentContext {
42
+ platform: string;
43
+ environment: string;
44
+ scale: string;
45
+ }
46
+ export interface Classification {
47
+ primaryCategory: string;
48
+ secondaryCategory: string;
49
+ deploymentContext: DeploymentContext[];
50
+ contextModifiers: string[];
51
+ confidence: number;
52
+ rationale: string;
53
+ userConfirmed: boolean;
54
+ }
55
+ export interface GapItem {
56
+ docType: string;
57
+ tier: string;
58
+ domain: string;
59
+ artifactsScanned: number;
60
+ found: number;
61
+ missing: number;
62
+ rationale: string;
63
+ }
64
+ export interface GapReportSummary {
65
+ totalArtifacts: number;
66
+ docsCovered: number;
67
+ docsPartial: number;
68
+ docsMissing: number;
69
+ coveragePercent: number;
70
+ }
71
+ export interface GapReport {
72
+ summary: GapReportSummary;
73
+ gaps: GapItem[];
74
+ }
75
+ export interface GeneratedDoc {
76
+ docType: string;
77
+ generatedAt: string;
78
+ paths: string[];
79
+ sourceArtifacts: string[];
80
+ confidenceSections: {
81
+ [section: string]: number;
82
+ };
83
+ stateHash: string;
84
+ }
85
+ export interface HistoryEntry {
86
+ docType: string;
87
+ version: string;
88
+ generatedAt: string;
89
+ path: string;
90
+ }
91
+ export interface VibedocState {
92
+ version: string;
93
+ lastScan: string;
94
+ projectProfile: ProjectProfile;
95
+ artifactInventory: ArtifactInventory;
96
+ classification: Classification;
97
+ gapReport: GapReport;
98
+ generatedDocs: GeneratedDoc[];
99
+ history: HistoryEntry[];
100
+ }
101
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/state/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;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entation generation pipeline
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,45 @@
1
+ ---
2
+ docType: adr
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # Architecture Decision Record
8
+
9
+ ## Status
10
+
11
+ {{user.status}}
12
+
13
+ <!-- NEEDS INPUT: What is the status of this decision? (Proposed, Accepted, Deprecated, Superseded) -->
14
+
15
+ ## Context
16
+
17
+ {{extracted.context}}
18
+
19
+ {{user.context}}
20
+
21
+ <!-- NEEDS INPUT: What is the issue that motivated this decision or any context you should record here? -->
22
+
23
+ ## Decision
24
+
25
+ {{extracted.decision}}
26
+
27
+ {{user.decision}}
28
+
29
+ <!-- NEEDS INPUT: What is the change that we're proposing or have agreed to do? -->
30
+
31
+ ## Consequences
32
+
33
+ {{extracted.consequences}}
34
+
35
+ {{user.consequences}}
36
+
37
+ <!-- NEEDS INPUT: What becomes easier or more difficult to do because of this change? Include positive and negative consequences. -->
38
+
39
+ ## Alternatives
40
+
41
+ {{extracted.alternatives}}
42
+
43
+ {{user.alternatives}}
44
+
45
+ <!-- NEEDS INPUT: What other options did you consider and why were they rejected? -->
@@ -0,0 +1,55 @@
1
+ ---
2
+ docType: api-spec
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # API Specification
8
+
9
+ ## Base URL
10
+
11
+ {{extracted.base-url}}
12
+
13
+ {{user.base-url}}
14
+
15
+ <!-- NEEDS INPUT: What is the base URL for your API? Include protocol, hostname, and port. -->
16
+
17
+ ## Endpoints
18
+
19
+ {{extracted.endpoints}}
20
+
21
+ {{user.endpoints}}
22
+
23
+ <!-- NEEDS INPUT: List your primary endpoints. Include HTTP method, path, and brief description. -->
24
+
25
+ ## Request Format
26
+
27
+ {{extracted.request-format}}
28
+
29
+ {{user.request-format}}
30
+
31
+ <!-- NEEDS INPUT: Describe the request format. Include content-type, headers, body structure, and examples. -->
32
+
33
+ ## Response Format
34
+
35
+ {{extracted.response-format}}
36
+
37
+ {{user.response-format}}
38
+
39
+ <!-- NEEDS INPUT: Describe the response format. Include status codes, body structure, headers, and examples. -->
40
+
41
+ ## Error Handling
42
+
43
+ {{extracted.error-handling}}
44
+
45
+ {{user.error-handling}}
46
+
47
+ <!-- NEEDS INPUT: How do you handle errors? Include error codes, error message format, and common errors. -->
48
+
49
+ ## Authentication
50
+
51
+ {{extracted.authentication}}
52
+
53
+ {{user.authentication}}
54
+
55
+ <!-- NEEDS INPUT: How do clients authenticate? Include auth mechanisms, required headers, and token formats. -->
@@ -0,0 +1,55 @@
1
+ ---
2
+ docType: data-model
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # Data Model
8
+
9
+ ## Entity Overview
10
+
11
+ {{extracted.entity-overview}}
12
+
13
+ {{user.entity-overview}}
14
+
15
+ <!-- NEEDS INPUT: What are the main entities/tables in your data model? Include brief descriptions of each. -->
16
+
17
+ ## Table Schemas
18
+
19
+ {{extracted.table-schemas}}
20
+
21
+ {{user.table-schemas}}
22
+
23
+ <!-- NEEDS INPUT: Describe the schema for each table. Include column names, types, and descriptions. -->
24
+
25
+ ## Relationships
26
+
27
+ {{extracted.relationships}}
28
+
29
+ {{user.relationships}}
30
+
31
+ <!-- NEEDS INPUT: What are the relationships between tables? Include foreign keys and cardinality. -->
32
+
33
+ ## Constraints
34
+
35
+ {{extracted.constraints}}
36
+
37
+ {{user.constraints}}
38
+
39
+ <!-- NEEDS INPUT: What constraints and validation rules exist? Include unique constraints, check constraints, and business rules. -->
40
+
41
+ ## Indexes
42
+
43
+ {{extracted.indexes}}
44
+
45
+ {{user.indexes}}
46
+
47
+ <!-- NEEDS INPUT: What indexes exist and why? Include primary keys, unique indexes, and performance indexes. -->
48
+
49
+ ## Migration Strategy
50
+
51
+ {{extracted.migration-strategy}}
52
+
53
+ {{user.migration-strategy}}
54
+
55
+ <!-- NEEDS INPUT: How do you handle schema migrations? Include versioning, rollback strategy, and zero-downtime deployment. -->
@@ -0,0 +1,63 @@
1
+ ---
2
+ docType: deployment-procedure
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # Deployment Procedure
8
+
9
+ ## Prerequisites
10
+
11
+ {{extracted.prerequisites}}
12
+
13
+ {{user.prerequisites}}
14
+
15
+ <!-- NEEDS INPUT: What prerequisites must be met before deployment? Include access, tools, accounts, and configurations. -->
16
+
17
+ ## Build Process
18
+
19
+ {{extracted.build-process}}
20
+
21
+ {{user.build-process}}
22
+
23
+ <!-- NEEDS INPUT: What are the steps to build the application? Include compilation, dependency installation, and artifact generation. -->
24
+
25
+ ## Environment Setup
26
+
27
+ {{extracted.environment-setup}}
28
+
29
+ {{user.environment-setup}}
30
+
31
+ <!-- NEEDS INPUT: What environment variables, secrets, and configurations are required for each environment? -->
32
+
33
+ ## Testing Before Deploy
34
+
35
+ {{extracted.testing-before-deploy}}
36
+
37
+ {{user.testing-before-deploy}}
38
+
39
+ <!-- NEEDS INPUT: What tests and validations run before deployment? Include smoke tests, integration tests, and health checks. -->
40
+
41
+ ## Deployment Steps
42
+
43
+ {{extracted.deployment-steps}}
44
+
45
+ {{user.deployment-steps}}
46
+
47
+ <!-- NEEDS INPUT: What are the step-by-step deployment instructions? Include database migrations, service restarts, and traffic shifting. -->
48
+
49
+ ## Post-Deployment Checks
50
+
51
+ {{extracted.post-deployment-checks}}
52
+
53
+ {{user.post-deployment-checks}}
54
+
55
+ <!-- NEEDS INPUT: What checks verify the deployment was successful? Include health checks, endpoint tests, and monitoring. -->
56
+
57
+ ## Rollback Procedure
58
+
59
+ {{extracted.rollback-procedure}}
60
+
61
+ {{user.rollback-procedure}}
62
+
63
+ <!-- NEEDS INPUT: How do you rollback to the previous version? Include steps, data rollback, and communication plan. -->
@@ -0,0 +1,55 @@
1
+ ---
2
+ docType: runbook
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # Runbook
8
+
9
+ ## Service Overview
10
+
11
+ {{extracted.service-overview}}
12
+
13
+ {{user.service-overview}}
14
+
15
+ <!-- NEEDS INPUT: What does this service do? What is its primary responsibility? -->
16
+
17
+ ## Startup Procedure
18
+
19
+ {{extracted.startup-procedure}}
20
+
21
+ {{user.startup-procedure}}
22
+
23
+ <!-- NEEDS INPUT: What are the steps to start the service? Include environment setup, dependencies, configuration. -->
24
+
25
+ ## Health Checks
26
+
27
+ {{extracted.health-checks}}
28
+
29
+ {{user.health-checks}}
30
+
31
+ <!-- NEEDS INPUT: How do you verify the service is healthy? What are the key metrics or checks? -->
32
+
33
+ ## Common Issues
34
+
35
+ {{extracted.common-issues}}
36
+
37
+ {{user.common-issues}}
38
+
39
+ <!-- NEEDS INPUT: What are the most common problems and their solutions? -->
40
+
41
+ ## Rollback Procedure
42
+
43
+ {{extracted.rollback-procedure}}
44
+
45
+ {{user.rollback-procedure}}
46
+
47
+ <!-- NEEDS INPUT: How do you roll back to a previous version? What steps are required? -->
48
+
49
+ ## Escalation Path
50
+
51
+ {{extracted.escalation-path}}
52
+
53
+ {{user.escalation-path}}
54
+
55
+ <!-- NEEDS INPUT: Who should be contacted for different severity levels? What is the on-call process? -->
@@ -0,0 +1,55 @@
1
+ ---
2
+ docType: test-plan
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # Test Plan
8
+
9
+ ## Test Strategy
10
+
11
+ {{extracted.test-strategy}}
12
+
13
+ {{user.test-strategy}}
14
+
15
+ <!-- NEEDS INPUT: What is your overall testing strategy? Include testing levels, approach, and priorities. -->
16
+
17
+ ## Unit Tests
18
+
19
+ {{extracted.unit-tests}}
20
+
21
+ {{user.unit-tests}}
22
+
23
+ <!-- NEEDS INPUT: What components and functions are covered by unit tests? Include test coverage goals. -->
24
+
25
+ ## Integration Tests
26
+
27
+ {{extracted.integration-tests}}
28
+
29
+ {{user.integration-tests}}
30
+
31
+ <!-- NEEDS INPUT: What system interactions are tested? Include database, APIs, and third-party services. -->
32
+
33
+ ## E2E Tests
34
+
35
+ {{extracted.e2e-tests}}
36
+
37
+ {{user.e2e-tests}}
38
+
39
+ <!-- NEEDS INPUT: What critical user workflows are tested end-to-end? Include scenarios and acceptance criteria. -->
40
+
41
+ ## Performance Tests
42
+
43
+ {{extracted.performance-tests}}
44
+
45
+ {{user.performance-tests}}
46
+
47
+ <!-- NEEDS INPUT: What performance characteristics are tested? Include load tests, latency targets, and throughput. -->
48
+
49
+ ## Coverage Targets
50
+
51
+ {{extracted.coverage-targets}}
52
+
53
+ {{user.coverage-targets}}
54
+
55
+ <!-- NEEDS INPUT: What are your code coverage targets? Include overall target and critical areas. -->
@@ -0,0 +1,47 @@
1
+ ---
2
+ docType: threat-model
3
+ version: 1.0
4
+ templateVersion: 1
5
+ ---
6
+
7
+ # Threat Model
8
+
9
+ ## Asset Scope
10
+
11
+ {{extracted.asset-scope}}
12
+
13
+ {{user.asset-scope}}
14
+
15
+ <!-- NEEDS INPUT: What are the valuable assets you need to protect? Include data, infrastructure, and systems. -->
16
+
17
+ ## Threat Actors
18
+
19
+ {{extracted.threat-actors}}
20
+
21
+ {{user.threat-actors}}
22
+
23
+ <!-- NEEDS INPUT: Who are the potential threat actors? (e.g., external attackers, malicious insiders, nation-states) -->
24
+
25
+ ## Threat Scenarios
26
+
27
+ {{extracted.threat-scenarios}}
28
+
29
+ {{user.threat-scenarios}}
30
+
31
+ <!-- NEEDS INPUT: What are the specific threat scenarios you are concerned about? How might they compromise your assets? -->
32
+
33
+ ## Mitigations
34
+
35
+ {{extracted.mitigations}}
36
+
37
+ {{user.mitigations}}
38
+
39
+ <!-- NEEDS INPUT: What controls do you have in place to mitigate these threats? Include technical, process, and organizational controls. -->
40
+
41
+ ## Residual Risks
42
+
43
+ {{extracted.residual-risks}}
44
+
45
+ {{user.residual-risks}}
46
+
47
+ <!-- NEEDS INPUT: What risks remain after implementing mitigations? What is your risk tolerance? -->
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Template Loader Module
3
+ * Loads embedded templates with support for local cache overrides
4
+ */
5
+ /**
6
+ * Load a template by doc type
7
+ * Checks for local cache override in .vibe-doc/templates/<docType>.md first,
8
+ * falls back to embedded template
9
+ */
10
+ export declare function loadTemplate(docType: string, cacheDir?: string): string;
11
+ /**
12
+ * Get path to the embedded template file
13
+ */
14
+ export declare function getTemplatePath(docType: string): string;
15
+ /**
16
+ * List all available template names
17
+ */
18
+ export declare function listTemplates(): string[];
19
+ export { RenderData, renderTemplate } from './renderer';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAuBvE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAYxC;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ /**
3
+ * Template Loader Module
4
+ * Loads embedded templates with support for local cache overrides
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.renderTemplate = void 0;
41
+ exports.loadTemplate = loadTemplate;
42
+ exports.getTemplatePath = getTemplatePath;
43
+ exports.listTemplates = listTemplates;
44
+ const path = __importStar(require("path"));
45
+ const fs = __importStar(require("fs"));
46
+ const logger_1 = require("../utils/logger");
47
+ /**
48
+ * Load a template by doc type
49
+ * Checks for local cache override in .vibe-doc/templates/<docType>.md first,
50
+ * falls back to embedded template
51
+ */
52
+ function loadTemplate(docType, cacheDir) {
53
+ // Try local cache override first
54
+ if (cacheDir) {
55
+ const localCachePath = path.join(cacheDir, 'templates', `${docType}.md`);
56
+ try {
57
+ if (fs.existsSync(localCachePath)) {
58
+ logger_1.logger.debug('Loading template from local cache', { docType, path: localCachePath });
59
+ return fs.readFileSync(localCachePath, 'utf-8');
60
+ }
61
+ }
62
+ catch (error) {
63
+ logger_1.logger.warn('Failed to read local template cache', { docType, error: String(error) });
64
+ }
65
+ }
66
+ // Fall back to embedded template
67
+ const embeddedPath = getTemplatePath(docType);
68
+ try {
69
+ logger_1.logger.debug('Loading embedded template', { docType, path: embeddedPath });
70
+ return fs.readFileSync(embeddedPath, 'utf-8');
71
+ }
72
+ catch (error) {
73
+ logger_1.logger.error('Failed to load template', { docType, error: String(error) });
74
+ throw new Error(`Template not found for doc type: ${docType}`);
75
+ }
76
+ }
77
+ /**
78
+ * Get path to the embedded template file
79
+ */
80
+ function getTemplatePath(docType) {
81
+ // __dirname is the dist directory at runtime
82
+ // Look for templates in both src (dev) and dist (prod) locations
83
+ let templatesDir = path.join(__dirname, 'templates', 'embedded');
84
+ // In development, __dirname points to src/templates, so adjust
85
+ if (!fs.existsSync(templatesDir)) {
86
+ templatesDir = path.join(__dirname, '..', '..', 'src', 'templates', 'embedded');
87
+ }
88
+ return path.join(templatesDir, `${docType}.md`);
89
+ }
90
+ /**
91
+ * List all available template names
92
+ */
93
+ function listTemplates() {
94
+ const templates = [
95
+ 'adr',
96
+ 'runbook',
97
+ 'threat-model',
98
+ 'api-spec',
99
+ 'deployment-procedure',
100
+ 'test-plan',
101
+ 'data-model',
102
+ ];
103
+ return templates;
104
+ }
105
+ var renderer_1 = require("./renderer");
106
+ Object.defineProperty(exports, "renderTemplate", { enumerable: true, get: function () { return renderer_1.renderTemplate; } });
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Remote Template Registry Module
3
+ * Handles checking for and downloading remote template updates
4
+ */
5
+ /**
6
+ * Result of checking for template updates
7
+ */
8
+ export interface UpdateResult {
9
+ hasUpdates: boolean;
10
+ availableUpdates: TemplateUpdate[];
11
+ timestamp: string;
12
+ }
13
+ /**
14
+ * Information about an available template update
15
+ */
16
+ export interface TemplateUpdate {
17
+ docType: string;
18
+ url: string;
19
+ hash: string;
20
+ version: string;
21
+ }
22
+ /**
23
+ * Check for template updates by fetching the manifest
24
+ * Falls back gracefully when offline
25
+ */
26
+ export declare function checkForUpdates(manifestUrl: string, cacheDir: string): Promise<UpdateResult>;
27
+ /**
28
+ * Download a template and cache it
29
+ */
30
+ export declare function downloadTemplate(docType: string, url: string, cacheDir: string): Promise<void>;
31
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAeD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CAuBvB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkBf"}