solvdex 1.0.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.
- package/LICENSE +21 -0
- package/README.md +274 -0
- package/dist/hooks/error-lookup.d.ts +4 -0
- package/dist/hooks/error-lookup.d.ts.map +1 -0
- package/dist/hooks/error-lookup.js +92 -0
- package/dist/hooks/error-lookup.js.map +1 -0
- package/dist/hooks/post-task.d.ts +15 -0
- package/dist/hooks/post-task.d.ts.map +1 -0
- package/dist/hooks/post-task.js +246 -0
- package/dist/hooks/post-task.js.map +1 -0
- package/dist/hooks/prompt-enrich.d.ts +16 -0
- package/dist/hooks/prompt-enrich.d.ts.map +1 -0
- package/dist/hooks/prompt-enrich.js +141 -0
- package/dist/hooks/prompt-enrich.js.map +1 -0
- package/dist/hooks/session-start-cli.d.ts +3 -0
- package/dist/hooks/session-start-cli.d.ts.map +1 -0
- package/dist/hooks/session-start-cli.js +81 -0
- package/dist/hooks/session-start-cli.js.map +1 -0
- package/dist/hooks/session-start.d.ts +4 -0
- package/dist/hooks/session-start.d.ts.map +1 -0
- package/dist/hooks/session-start.js +134 -0
- package/dist/hooks/session-start.js.map +1 -0
- package/dist/src/audit.d.ts +63 -0
- package/dist/src/audit.d.ts.map +1 -0
- package/dist/src/audit.js +229 -0
- package/dist/src/audit.js.map +1 -0
- package/dist/src/cache.d.ts +54 -0
- package/dist/src/cache.d.ts.map +1 -0
- package/dist/src/cache.js +167 -0
- package/dist/src/cache.js.map +1 -0
- package/dist/src/config.d.ts +52 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +175 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/entry.d.ts +154 -0
- package/dist/src/entry.d.ts.map +1 -0
- package/dist/src/entry.js +469 -0
- package/dist/src/entry.js.map +1 -0
- package/dist/src/errors.d.ts +65 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +121 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/frontmatter.d.ts +28 -0
- package/dist/src/frontmatter.d.ts.map +1 -0
- package/dist/src/frontmatter.js +111 -0
- package/dist/src/frontmatter.js.map +1 -0
- package/dist/src/index.d.ts +35 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +188 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/maturity.d.ts +31 -0
- package/dist/src/maturity.d.ts.map +1 -0
- package/dist/src/maturity.js +96 -0
- package/dist/src/maturity.js.map +1 -0
- package/dist/src/quality.d.ts +23 -0
- package/dist/src/quality.d.ts.map +1 -0
- package/dist/src/quality.js +236 -0
- package/dist/src/quality.js.map +1 -0
- package/dist/src/search.d.ts +35 -0
- package/dist/src/search.d.ts.map +1 -0
- package/dist/src/search.js +263 -0
- package/dist/src/search.js.map +1 -0
- package/dist/src/similarity.d.ts +42 -0
- package/dist/src/similarity.d.ts.map +1 -0
- package/dist/src/similarity.js +111 -0
- package/dist/src/similarity.js.map +1 -0
- package/dist/src/stats.d.ts +56 -0
- package/dist/src/stats.d.ts.map +1 -0
- package/dist/src/stats.js +198 -0
- package/dist/src/stats.js.map +1 -0
- package/dist/src/templates.d.ts +63 -0
- package/dist/src/templates.d.ts.map +1 -0
- package/dist/src/templates.js +347 -0
- package/dist/src/templates.js.map +1 -0
- package/dist/src/transfer.d.ts +92 -0
- package/dist/src/transfer.d.ts.map +1 -0
- package/dist/src/transfer.js +215 -0
- package/dist/src/transfer.js.map +1 -0
- package/dist/src/types.d.ts +270 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +153 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/validate.d.ts +90 -0
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +295 -0
- package/dist/src/validate.js.map +1 -0
- package/hooks/error-lookup.ts +110 -0
- package/hooks/hooks.json +49 -0
- package/hooks/post-task.ts +309 -0
- package/hooks/prompt-enrich.ts +162 -0
- package/hooks/session-start-cli.ts +96 -0
- package/hooks/session-start.ts +159 -0
- package/package.json +40 -0
- package/scripts/error-lookup.py +64 -0
- package/scripts/post-task.py +60 -0
- package/scripts/prompt-enrich.py +64 -0
- package/scripts/session-start.py +64 -0
- package/skills/wiki/SKILL.md +61 -0
- package/skills/wiki-add/SKILL.md +90 -0
- package/skills/wiki-browse/SKILL.md +108 -0
- package/skills/wiki-capture/SKILL.md +265 -0
- package/skills/wiki-explorer/SKILL.md +223 -0
- package/skills/wiki-export/SKILL.md +101 -0
- package/skills/wiki-fix/SKILL.md +86 -0
- package/skills/wiki-flag/SKILL.md +47 -0
- package/skills/wiki-import/SKILL.md +128 -0
- package/skills/wiki-init/SKILL.md +72 -0
- package/skills/wiki-scan/SKILL.md +98 -0
- package/skills/wiki-search/SKILL.md +86 -0
- package/skills/wiki-stats/SKILL.md +129 -0
- package/skills/wiki-status/SKILL.md +78 -0
- package/skills/wiki-test-trigger/SKILL.md +173 -0
- package/skills/wiki-validate/SKILL.md +62 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
export type EntryStatus = 'active' | 'flagged' | 'deprecated';
|
|
2
|
+
export type EntryMaturity = 'captured' | 'verified' | 'validated';
|
|
3
|
+
export type Confidence = number;
|
|
4
|
+
export type AuditAction = 'created' | 'updated' | 'validated' | 'flagged' | 'deprecated' | 'maturity_promoted';
|
|
5
|
+
/**
|
|
6
|
+
* Confidence level constants for the 0-100 scale.
|
|
7
|
+
* HIGH: Verified solution, used multiple times
|
|
8
|
+
* MEDIUM: Worked once or partially verified
|
|
9
|
+
* LOW: Stub or unverified
|
|
10
|
+
* THRESHOLD: Minimum confidence for auto-lookup
|
|
11
|
+
*/
|
|
12
|
+
export declare const CONFIDENCE: {
|
|
13
|
+
readonly HIGH: 80;
|
|
14
|
+
readonly MEDIUM: 50;
|
|
15
|
+
readonly LOW: 20;
|
|
16
|
+
readonly THRESHOLD: 40;
|
|
17
|
+
readonly MAX: 100;
|
|
18
|
+
readonly MIN: 0;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Maturity progression rules.
|
|
22
|
+
* Entries automatically advance through maturity phases based on usage.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MATURITY_RULES: {
|
|
25
|
+
readonly captured: {
|
|
26
|
+
readonly min_uses: 0;
|
|
27
|
+
};
|
|
28
|
+
readonly verified: {
|
|
29
|
+
readonly min_uses: 3;
|
|
30
|
+
readonly min_days: 0;
|
|
31
|
+
};
|
|
32
|
+
readonly validated: {
|
|
33
|
+
readonly min_uses: 10;
|
|
34
|
+
readonly min_days: 30;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Confidence levels automatically set based on maturity phase.
|
|
39
|
+
*/
|
|
40
|
+
export declare const CONFIDENCE_BY_MATURITY: Record<EntryMaturity, number>;
|
|
41
|
+
export interface AuditEntry {
|
|
42
|
+
date: string;
|
|
43
|
+
action: AuditAction;
|
|
44
|
+
by: string;
|
|
45
|
+
context?: string;
|
|
46
|
+
reason?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface EntryFrontmatter {
|
|
49
|
+
title: string;
|
|
50
|
+
created: string;
|
|
51
|
+
updated: string;
|
|
52
|
+
status: EntryStatus;
|
|
53
|
+
confidence: Confidence;
|
|
54
|
+
maturity?: EntryMaturity;
|
|
55
|
+
tags: string[];
|
|
56
|
+
trigger?: string;
|
|
57
|
+
project?: string;
|
|
58
|
+
auto_captured?: boolean;
|
|
59
|
+
stub?: boolean;
|
|
60
|
+
source?: string;
|
|
61
|
+
audit: AuditEntry[];
|
|
62
|
+
last_used?: string;
|
|
63
|
+
use_count?: number;
|
|
64
|
+
related_entries?: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface WikiEntry {
|
|
67
|
+
path: string;
|
|
68
|
+
category: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
frontmatter: EntryFrontmatter;
|
|
71
|
+
content: string;
|
|
72
|
+
}
|
|
73
|
+
export interface WikiConfig {
|
|
74
|
+
version: number;
|
|
75
|
+
project: string;
|
|
76
|
+
categories: string[];
|
|
77
|
+
auto_capture: {
|
|
78
|
+
enabled: boolean;
|
|
79
|
+
signals: string[];
|
|
80
|
+
};
|
|
81
|
+
auto_lookup: {
|
|
82
|
+
on_task_start: boolean;
|
|
83
|
+
on_uncertainty: boolean;
|
|
84
|
+
on_error: boolean;
|
|
85
|
+
confidence_threshold: number;
|
|
86
|
+
};
|
|
87
|
+
validation: {
|
|
88
|
+
auto_flag_broken_refs: boolean;
|
|
89
|
+
auto_flag_failed_solutions: boolean;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface SearchResult {
|
|
93
|
+
entry: WikiEntry;
|
|
94
|
+
score: number;
|
|
95
|
+
matchedOn: ('title' | 'tags' | 'trigger' | 'content')[];
|
|
96
|
+
}
|
|
97
|
+
export interface ScanCandidate {
|
|
98
|
+
title: string;
|
|
99
|
+
category: string;
|
|
100
|
+
source: string;
|
|
101
|
+
sourceType: 'git' | 'file' | 'comment';
|
|
102
|
+
tags: string[];
|
|
103
|
+
files?: string[];
|
|
104
|
+
externalDocs?: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface WikiStats {
|
|
107
|
+
total: number;
|
|
108
|
+
active: number;
|
|
109
|
+
flagged: number;
|
|
110
|
+
deprecated: number;
|
|
111
|
+
stubs: number;
|
|
112
|
+
byCategory: Record<string, number>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Default wiki categories covering the full development lifecycle.
|
|
116
|
+
* - issues: Bug fixes, error solutions, troubleshooting
|
|
117
|
+
* - patterns: Reusable code patterns, templates, approaches
|
|
118
|
+
* - gotchas: Pitfalls, traps, things to avoid
|
|
119
|
+
* - testing: Test strategies, mocks, fixtures, test patterns
|
|
120
|
+
* - docs: Documentation templates, guides, API docs
|
|
121
|
+
* - security: Auth patterns, vulnerabilities, CSRF/XSS/injection prevention
|
|
122
|
+
* - performance: Optimizations, profiling, benchmarks
|
|
123
|
+
*/
|
|
124
|
+
export declare const DEFAULT_CATEGORIES: readonly ["issues", "patterns", "gotchas", "testing", "docs", "security", "performance"];
|
|
125
|
+
export type DefaultCategory = typeof DEFAULT_CATEGORIES[number];
|
|
126
|
+
/**
|
|
127
|
+
* Base hook output structure for Claude Code integration.
|
|
128
|
+
*/
|
|
129
|
+
export interface HookOutput {
|
|
130
|
+
continue: boolean;
|
|
131
|
+
hookSpecificOutput?: Record<string, unknown>;
|
|
132
|
+
additionalContext?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Output for session-start hook.
|
|
136
|
+
* Includes both old format (for backward compatibility) and new Claude Code format.
|
|
137
|
+
*/
|
|
138
|
+
export interface SessionStartOutput extends HookOutput {
|
|
139
|
+
type: 'wiki_context';
|
|
140
|
+
message: string;
|
|
141
|
+
categories: string[];
|
|
142
|
+
entries?: Array<{
|
|
143
|
+
title: string;
|
|
144
|
+
category: string;
|
|
145
|
+
path: string;
|
|
146
|
+
}>;
|
|
147
|
+
hookSpecificOutput?: {
|
|
148
|
+
type: 'wiki_context';
|
|
149
|
+
message: string;
|
|
150
|
+
categories: string[];
|
|
151
|
+
entries?: Array<{
|
|
152
|
+
title: string;
|
|
153
|
+
category: string;
|
|
154
|
+
path: string;
|
|
155
|
+
}>;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Output for error-lookup hook.
|
|
160
|
+
* Includes both old format (for backward compatibility) and new Claude Code format.
|
|
161
|
+
*/
|
|
162
|
+
export interface ErrorLookupOutput extends HookOutput {
|
|
163
|
+
type: 'wiki_solution';
|
|
164
|
+
message: string;
|
|
165
|
+
entry: WikiEntry;
|
|
166
|
+
hookSpecificOutput?: {
|
|
167
|
+
type: 'solution_found';
|
|
168
|
+
message: string;
|
|
169
|
+
entries?: Array<{
|
|
170
|
+
title: string;
|
|
171
|
+
category: string;
|
|
172
|
+
path: string;
|
|
173
|
+
confidence: number;
|
|
174
|
+
}>;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Output for prompt-enrich hook.
|
|
179
|
+
* Includes both old format (for backward compatibility) and new Claude Code format.
|
|
180
|
+
*/
|
|
181
|
+
export interface PromptEnrichOutput extends HookOutput {
|
|
182
|
+
type: 'wiki_context';
|
|
183
|
+
message: string;
|
|
184
|
+
entries: Array<{
|
|
185
|
+
title: string;
|
|
186
|
+
category: string;
|
|
187
|
+
path: string;
|
|
188
|
+
confidence: number;
|
|
189
|
+
}>;
|
|
190
|
+
hookSpecificOutput?: {
|
|
191
|
+
type: 'context_added';
|
|
192
|
+
message: string;
|
|
193
|
+
entryCount: number;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Output for post-task hook.
|
|
198
|
+
* Includes both old format (for backward compatibility) and new Claude Code format.
|
|
199
|
+
*/
|
|
200
|
+
export interface PostTaskOutput extends HookOutput {
|
|
201
|
+
type: 'wiki_captured';
|
|
202
|
+
message: string;
|
|
203
|
+
entry: WikiEntry;
|
|
204
|
+
signal: string;
|
|
205
|
+
hookSpecificOutput?: {
|
|
206
|
+
type: 'entry_captured';
|
|
207
|
+
message: string;
|
|
208
|
+
entryPath?: string;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Context for session-start hook.
|
|
213
|
+
*/
|
|
214
|
+
export interface SessionStartContext {
|
|
215
|
+
projectRoot: string;
|
|
216
|
+
taskDescription?: string;
|
|
217
|
+
filePaths?: string[];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Context for error-lookup hook.
|
|
221
|
+
*/
|
|
222
|
+
export interface ErrorLookupContext {
|
|
223
|
+
projectRoot: string;
|
|
224
|
+
errorText?: string;
|
|
225
|
+
errorContext?: string;
|
|
226
|
+
toolResult?: {
|
|
227
|
+
stderr?: string;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Context for prompt-enrich hook.
|
|
232
|
+
*/
|
|
233
|
+
export interface PromptEnrichContext {
|
|
234
|
+
projectRoot: string;
|
|
235
|
+
prompt: string;
|
|
236
|
+
context?: string;
|
|
237
|
+
filePaths?: string[];
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Context for post-task hook.
|
|
241
|
+
*/
|
|
242
|
+
export interface PostTaskContext {
|
|
243
|
+
projectRoot: string;
|
|
244
|
+
taskDescription?: string;
|
|
245
|
+
outcome?: 'success' | 'failure';
|
|
246
|
+
errorEncountered?: string;
|
|
247
|
+
errorResolved?: boolean;
|
|
248
|
+
filesModified?: string[];
|
|
249
|
+
userConfirmation?: string;
|
|
250
|
+
codeChanges?: string;
|
|
251
|
+
actionHistory?: string[];
|
|
252
|
+
success?: boolean;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Validates session-start hook input.
|
|
256
|
+
*/
|
|
257
|
+
export declare function validateSessionStartInput(data: unknown): SessionStartContext;
|
|
258
|
+
/**
|
|
259
|
+
* Validates error-lookup hook input.
|
|
260
|
+
*/
|
|
261
|
+
export declare function validateErrorLookupInput(data: unknown): ErrorLookupContext;
|
|
262
|
+
/**
|
|
263
|
+
* Validates prompt-enrich hook input.
|
|
264
|
+
*/
|
|
265
|
+
export declare function validatePromptEnrichInput(data: unknown): PromptEnrichContext;
|
|
266
|
+
/**
|
|
267
|
+
* Validates post-task hook input.
|
|
268
|
+
*/
|
|
269
|
+
export declare function validatePostTaskInput(data: unknown): PostTaskContext;
|
|
270
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,WAAW,GAAG,SAAS,GAA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AO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAKD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB,CAgB5E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,CAoB1E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB,CAqB5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAuBpE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/types.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DEFAULT_CATEGORIES = exports.CONFIDENCE_BY_MATURITY = exports.MATURITY_RULES = exports.CONFIDENCE = void 0;
|
|
5
|
+
exports.validateSessionStartInput = validateSessionStartInput;
|
|
6
|
+
exports.validateErrorLookupInput = validateErrorLookupInput;
|
|
7
|
+
exports.validatePromptEnrichInput = validatePromptEnrichInput;
|
|
8
|
+
exports.validatePostTaskInput = validatePostTaskInput;
|
|
9
|
+
/**
|
|
10
|
+
* Confidence level constants for the 0-100 scale.
|
|
11
|
+
* HIGH: Verified solution, used multiple times
|
|
12
|
+
* MEDIUM: Worked once or partially verified
|
|
13
|
+
* LOW: Stub or unverified
|
|
14
|
+
* THRESHOLD: Minimum confidence for auto-lookup
|
|
15
|
+
*/
|
|
16
|
+
exports.CONFIDENCE = {
|
|
17
|
+
HIGH: 80,
|
|
18
|
+
MEDIUM: 50,
|
|
19
|
+
LOW: 20,
|
|
20
|
+
THRESHOLD: 40,
|
|
21
|
+
MAX: 100,
|
|
22
|
+
MIN: 0
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Maturity progression rules.
|
|
26
|
+
* Entries automatically advance through maturity phases based on usage.
|
|
27
|
+
*/
|
|
28
|
+
exports.MATURITY_RULES = {
|
|
29
|
+
captured: {
|
|
30
|
+
min_uses: 0
|
|
31
|
+
},
|
|
32
|
+
verified: {
|
|
33
|
+
min_uses: 3,
|
|
34
|
+
min_days: 0
|
|
35
|
+
},
|
|
36
|
+
validated: {
|
|
37
|
+
min_uses: 10,
|
|
38
|
+
min_days: 30
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Confidence levels automatically set based on maturity phase.
|
|
43
|
+
*/
|
|
44
|
+
exports.CONFIDENCE_BY_MATURITY = {
|
|
45
|
+
captured: 40,
|
|
46
|
+
verified: 70,
|
|
47
|
+
validated: 90
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Default wiki categories covering the full development lifecycle.
|
|
51
|
+
* - issues: Bug fixes, error solutions, troubleshooting
|
|
52
|
+
* - patterns: Reusable code patterns, templates, approaches
|
|
53
|
+
* - gotchas: Pitfalls, traps, things to avoid
|
|
54
|
+
* - testing: Test strategies, mocks, fixtures, test patterns
|
|
55
|
+
* - docs: Documentation templates, guides, API docs
|
|
56
|
+
* - security: Auth patterns, vulnerabilities, CSRF/XSS/injection prevention
|
|
57
|
+
* - performance: Optimizations, profiling, benchmarks
|
|
58
|
+
*/
|
|
59
|
+
exports.DEFAULT_CATEGORIES = [
|
|
60
|
+
'issues',
|
|
61
|
+
'patterns',
|
|
62
|
+
'gotchas',
|
|
63
|
+
'testing',
|
|
64
|
+
'docs',
|
|
65
|
+
'security',
|
|
66
|
+
'performance'
|
|
67
|
+
];
|
|
68
|
+
// Validation functions - Import ValidationError from errors.ts
|
|
69
|
+
const errors_js_1 = require("./errors.js");
|
|
70
|
+
/**
|
|
71
|
+
* Validates session-start hook input.
|
|
72
|
+
*/
|
|
73
|
+
function validateSessionStartInput(data) {
|
|
74
|
+
if (!data || typeof data !== 'object') {
|
|
75
|
+
throw new errors_js_1.ValidationError('Invalid hook input: not an object', []);
|
|
76
|
+
}
|
|
77
|
+
const input = data;
|
|
78
|
+
if (!input.projectRoot || typeof input.projectRoot !== 'string') {
|
|
79
|
+
throw new errors_js_1.ValidationError('Invalid hook input: projectRoot required', []);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
projectRoot: input.projectRoot,
|
|
83
|
+
taskDescription: typeof input.taskDescription === 'string' ? input.taskDescription : undefined,
|
|
84
|
+
filePaths: Array.isArray(input.filePaths) ? input.filePaths : undefined
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Validates error-lookup hook input.
|
|
89
|
+
*/
|
|
90
|
+
function validateErrorLookupInput(data) {
|
|
91
|
+
if (!data || typeof data !== 'object') {
|
|
92
|
+
throw new errors_js_1.ValidationError('Invalid hook input: not an object', []);
|
|
93
|
+
}
|
|
94
|
+
const input = data;
|
|
95
|
+
if (!input.projectRoot || typeof input.projectRoot !== 'string') {
|
|
96
|
+
throw new errors_js_1.ValidationError('Invalid hook input: projectRoot required', []);
|
|
97
|
+
}
|
|
98
|
+
// errorText is optional because it can come from toolResult.stderr
|
|
99
|
+
return {
|
|
100
|
+
projectRoot: input.projectRoot,
|
|
101
|
+
errorText: typeof input.errorText === 'string' ? input.errorText : undefined,
|
|
102
|
+
errorContext: typeof input.errorContext === 'string' ? input.errorContext : undefined,
|
|
103
|
+
toolResult: input.toolResult && typeof input.toolResult === 'object'
|
|
104
|
+
? input.toolResult
|
|
105
|
+
: undefined
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Validates prompt-enrich hook input.
|
|
110
|
+
*/
|
|
111
|
+
function validatePromptEnrichInput(data) {
|
|
112
|
+
if (!data || typeof data !== 'object') {
|
|
113
|
+
throw new errors_js_1.ValidationError('Invalid hook input: not an object', []);
|
|
114
|
+
}
|
|
115
|
+
const input = data;
|
|
116
|
+
if (!input.projectRoot || typeof input.projectRoot !== 'string') {
|
|
117
|
+
throw new errors_js_1.ValidationError('Invalid hook input: projectRoot required', []);
|
|
118
|
+
}
|
|
119
|
+
if (!input.prompt || typeof input.prompt !== 'string') {
|
|
120
|
+
throw new errors_js_1.ValidationError('Invalid hook input: prompt required', []);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
projectRoot: input.projectRoot,
|
|
124
|
+
prompt: input.prompt,
|
|
125
|
+
context: typeof input.context === 'string' ? input.context : undefined,
|
|
126
|
+
filePaths: Array.isArray(input.filePaths) ? input.filePaths : undefined
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Validates post-task hook input.
|
|
131
|
+
*/
|
|
132
|
+
function validatePostTaskInput(data) {
|
|
133
|
+
if (!data || typeof data !== 'object') {
|
|
134
|
+
throw new errors_js_1.ValidationError('Invalid hook input: not an object', []);
|
|
135
|
+
}
|
|
136
|
+
const input = data;
|
|
137
|
+
if (!input.projectRoot || typeof input.projectRoot !== 'string') {
|
|
138
|
+
throw new errors_js_1.ValidationError('Invalid hook input: projectRoot required', []);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
projectRoot: input.projectRoot,
|
|
142
|
+
taskDescription: typeof input.taskDescription === 'string' ? input.taskDescription : undefined,
|
|
143
|
+
outcome: input.outcome === 'success' || input.outcome === 'failure' ? input.outcome : undefined,
|
|
144
|
+
errorEncountered: typeof input.errorEncountered === 'string' ? input.errorEncountered : undefined,
|
|
145
|
+
errorResolved: typeof input.errorResolved === 'boolean' ? input.errorResolved : undefined,
|
|
146
|
+
filesModified: Array.isArray(input.filesModified) ? input.filesModified : undefined,
|
|
147
|
+
userConfirmation: typeof input.userConfirmation === 'string' ? input.userConfirmation : undefined,
|
|
148
|
+
codeChanges: typeof input.codeChanges === 'string' ? input.codeChanges : undefined,
|
|
149
|
+
actionHistory: Array.isArray(input.actionHistory) ? input.actionHistory : undefined,
|
|
150
|
+
success: typeof input.success === 'boolean' ? input.success : undefined
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA,eAAe;;;AA6Rf,8DAgBC;AAKD,4DAoBC;AAKD,8DAqBC;AAKD,sDAuBC;AArXD;;;;;;GAMG;AACU,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;IACP,SAAS,EAAE,EAAE;IACb,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,CAAC;CACE,CAAC;AAEX;;;GAGG;AACU,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;KACZ;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;KACZ;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;KACb;CACO,CAAC;AAEX;;GAEG;AACU,QAAA,sBAAsB,GAAkC;IACnE,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,EAAE;CACd,CAAC;AAmFF;;;;;;;;;GASG;AACU,QAAA,kBAAkB,GAAG;IAChC,QAAQ;I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K,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;QACjG,WAAW,EAAE,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;QAClF,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAyB,CAAC,CAAC,CAAC,SAAS;QAC/F,OAAO,EAAE,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { WikiEntry } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Types of validation issues that can be detected.
|
|
4
|
+
*/
|
|
5
|
+
export type ValidationIssueType = 'broken_reference' | 'missing_c3' | 'flagged' | 'stub';
|
|
6
|
+
/**
|
|
7
|
+
* Represents a single validation issue found in an entry.
|
|
8
|
+
*/
|
|
9
|
+
export interface ValidationIssue {
|
|
10
|
+
type: ValidationIssueType;
|
|
11
|
+
message: string;
|
|
12
|
+
entryPath: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Report containing validation results for the entire wiki.
|
|
16
|
+
*/
|
|
17
|
+
export interface ValidationReport {
|
|
18
|
+
total: number;
|
|
19
|
+
active: number;
|
|
20
|
+
flagged: number;
|
|
21
|
+
deprecated: number;
|
|
22
|
+
issues: ValidationIssue[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Direction for confidence adjustment.
|
|
26
|
+
*/
|
|
27
|
+
export type ConfidenceDirection = 'up' | 'down';
|
|
28
|
+
/**
|
|
29
|
+
* Validates a single wiki entry for issues.
|
|
30
|
+
*
|
|
31
|
+
* @param projectRoot - The root directory of the project
|
|
32
|
+
* @param entryPath - Relative path to the entry from the wiki directory
|
|
33
|
+
* @returns Array of validation issues found
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateEntry(projectRoot: string, entryPath: string): ValidationIssue[];
|
|
36
|
+
/**
|
|
37
|
+
* Validates the entire wiki and returns a comprehensive report.
|
|
38
|
+
*
|
|
39
|
+
* @param projectRoot - The root directory of the project
|
|
40
|
+
* @returns Validation report with counts and issues
|
|
41
|
+
*/
|
|
42
|
+
export declare function validateWiki(projectRoot: string): Promise<ValidationReport>;
|
|
43
|
+
/**
|
|
44
|
+
* Marks an entry as flagged with the given reason.
|
|
45
|
+
*
|
|
46
|
+
* @param projectRoot - The root directory of the project
|
|
47
|
+
* @param entryPath - Relative path to the entry from the wiki directory
|
|
48
|
+
* @param reason - The reason for flagging the entry
|
|
49
|
+
* @returns The updated WikiEntry
|
|
50
|
+
*/
|
|
51
|
+
export declare function flagEntry(projectRoot: string, entryPath: string, reason: string): WikiEntry;
|
|
52
|
+
/**
|
|
53
|
+
* Marks an entry as deprecated with the given reason.
|
|
54
|
+
*
|
|
55
|
+
* @param projectRoot - The root directory of the project
|
|
56
|
+
* @param entryPath - Relative path to the entry from the wiki directory
|
|
57
|
+
* @param reason - The reason for deprecating the entry
|
|
58
|
+
* @returns The updated WikiEntry
|
|
59
|
+
*/
|
|
60
|
+
export declare function deprecateEntry(projectRoot: string, entryPath: string, reason: string): WikiEntry;
|
|
61
|
+
/**
|
|
62
|
+
* Adjusts the confidence level of an entry up or down.
|
|
63
|
+
* Up: +20 points (capped at 100)
|
|
64
|
+
* Down: -30 points (auto-flag if result < 40)
|
|
65
|
+
*
|
|
66
|
+
* @param projectRoot - The root directory of the project
|
|
67
|
+
* @param entryPath - Relative path to the entry from the wiki directory
|
|
68
|
+
* @param direction - 'up' to increase confidence, 'down' to decrease
|
|
69
|
+
* @returns The updated WikiEntry
|
|
70
|
+
* @throws Error if entry not found
|
|
71
|
+
*/
|
|
72
|
+
export declare function adjustConfidence(projectRoot: string, entryPath: string, direction: ConfidenceDirection): WikiEntry;
|
|
73
|
+
/**
|
|
74
|
+
* Marks that a solution from an entry worked, increasing its confidence.
|
|
75
|
+
*
|
|
76
|
+
* @param projectRoot - The root directory of the project
|
|
77
|
+
* @param entryPath - Relative path to the entry from the wiki directory
|
|
78
|
+
* @returns The updated WikiEntry
|
|
79
|
+
*/
|
|
80
|
+
export declare function markSolutionWorked(projectRoot: string, entryPath: string): WikiEntry;
|
|
81
|
+
/**
|
|
82
|
+
* Marks that a solution from an entry failed, decreasing its confidence.
|
|
83
|
+
* Auto-flags if confidence drops below threshold (handled by adjustConfidence).
|
|
84
|
+
*
|
|
85
|
+
* @param projectRoot - The root directory of the project
|
|
86
|
+
* @param entryPath - Relative path to the entry from the wiki directory
|
|
87
|
+
* @returns The updated WikiEntry
|
|
88
|
+
*/
|
|
89
|
+
export declare function markSolutionFailed(projectRoot: string, entryPath: string): WikiEntry;
|
|
90
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,SAAS,EAAE,MAAM,YAAY,CAAC;AAGnD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GA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