clavix 4.12.0 → 5.0.1

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 (163) hide show
  1. package/README.md +69 -61
  2. package/dist/cli/commands/init.js +54 -153
  3. package/dist/cli/commands/update.js +19 -21
  4. package/dist/templates/agents/agents.md +28 -26
  5. package/dist/templates/agents/copilot-instructions.md +42 -36
  6. package/dist/templates/agents/octo.md +41 -36
  7. package/dist/templates/agents/warp.md +24 -24
  8. package/dist/templates/instructions/README.md +8 -5
  9. package/dist/templates/slash-commands/_canonical/archive.md +83 -121
  10. package/dist/templates/slash-commands/_canonical/execute.md +32 -42
  11. package/dist/templates/slash-commands/_canonical/implement.md +32 -44
  12. package/dist/templates/slash-commands/_canonical/improve.md +13 -52
  13. package/dist/templates/slash-commands/_canonical/plan.md +8 -20
  14. package/dist/templates/slash-commands/_canonical/verify.md +9 -9
  15. package/dist/templates/slash-commands/_components/agent-protocols/assertion-checkpoints.md +1 -1
  16. package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +84 -180
  17. package/dist/templates/slash-commands/_components/agent-protocols/decision-rules.md +5 -6
  18. package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +2 -2
  19. package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +41 -59
  20. package/dist/templates/slash-commands/_components/agent-protocols/state-awareness.md +5 -7
  21. package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +20 -27
  22. package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +4 -5
  23. package/dist/templates/slash-commands/_components/troubleshooting/vibecoder-recovery.md +2 -2
  24. package/dist/utils/agent-error-messages.js +13 -12
  25. package/package.json +2 -2
  26. package/dist/cli/commands/analyze.d.ts +0 -17
  27. package/dist/cli/commands/analyze.js +0 -133
  28. package/dist/cli/commands/archive.d.ts +0 -36
  29. package/dist/cli/commands/archive.js +0 -266
  30. package/dist/cli/commands/deep.d.ts +0 -17
  31. package/dist/cli/commands/deep.js +0 -170
  32. package/dist/cli/commands/execute.d.ts +0 -15
  33. package/dist/cli/commands/execute.js +0 -168
  34. package/dist/cli/commands/fast.d.ts +0 -18
  35. package/dist/cli/commands/fast.js +0 -219
  36. package/dist/cli/commands/implement.d.ts +0 -24
  37. package/dist/cli/commands/implement.js +0 -289
  38. package/dist/cli/commands/improve.d.ts +0 -32
  39. package/dist/cli/commands/improve.js +0 -250
  40. package/dist/cli/commands/list.d.ts +0 -17
  41. package/dist/cli/commands/list.js +0 -217
  42. package/dist/cli/commands/plan.d.ts +0 -21
  43. package/dist/cli/commands/plan.js +0 -297
  44. package/dist/cli/commands/prd.d.ts +0 -24
  45. package/dist/cli/commands/prd.js +0 -321
  46. package/dist/cli/commands/prompts/clear.d.ts +0 -16
  47. package/dist/cli/commands/prompts/clear.js +0 -222
  48. package/dist/cli/commands/prompts/list.d.ts +0 -8
  49. package/dist/cli/commands/prompts/list.js +0 -88
  50. package/dist/cli/commands/show.d.ts +0 -21
  51. package/dist/cli/commands/show.js +0 -191
  52. package/dist/cli/commands/start.d.ts +0 -40
  53. package/dist/cli/commands/start.js +0 -210
  54. package/dist/cli/commands/summarize.d.ts +0 -17
  55. package/dist/cli/commands/summarize.js +0 -196
  56. package/dist/cli/commands/task-complete.d.ts +0 -27
  57. package/dist/cli/commands/task-complete.js +0 -269
  58. package/dist/cli/commands/verify.d.ts +0 -28
  59. package/dist/cli/commands/verify.js +0 -349
  60. package/dist/core/archive-manager.d.ts +0 -100
  61. package/dist/core/archive-manager.js +0 -302
  62. package/dist/core/basic-checklist-generator.d.ts +0 -35
  63. package/dist/core/basic-checklist-generator.js +0 -344
  64. package/dist/core/checklist-parser.d.ts +0 -48
  65. package/dist/core/checklist-parser.js +0 -238
  66. package/dist/core/config-manager.d.ts +0 -149
  67. package/dist/core/config-manager.js +0 -230
  68. package/dist/core/conversation-analyzer.d.ts +0 -86
  69. package/dist/core/conversation-analyzer.js +0 -387
  70. package/dist/core/conversation-quality-tracker.d.ts +0 -81
  71. package/dist/core/conversation-quality-tracker.js +0 -195
  72. package/dist/core/git-manager.d.ts +0 -126
  73. package/dist/core/git-manager.js +0 -282
  74. package/dist/core/intelligence/confidence-calculator.d.ts +0 -93
  75. package/dist/core/intelligence/confidence-calculator.js +0 -124
  76. package/dist/core/intelligence/index.d.ts +0 -11
  77. package/dist/core/intelligence/index.js +0 -15
  78. package/dist/core/intelligence/intent-detector.d.ts +0 -54
  79. package/dist/core/intelligence/intent-detector.js +0 -723
  80. package/dist/core/intelligence/pattern-library.d.ts +0 -104
  81. package/dist/core/intelligence/pattern-library.js +0 -330
  82. package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +0 -27
  83. package/dist/core/intelligence/patterns/actionability-enhancer.js +0 -192
  84. package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +0 -29
  85. package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +0 -239
  86. package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +0 -22
  87. package/dist/core/intelligence/patterns/ambiguity-detector.js +0 -196
  88. package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +0 -30
  89. package/dist/core/intelligence/patterns/assumption-explicitizer.js +0 -296
  90. package/dist/core/intelligence/patterns/base-pattern.d.ts +0 -192
  91. package/dist/core/intelligence/patterns/base-pattern.js +0 -103
  92. package/dist/core/intelligence/patterns/completeness-validator.d.ts +0 -27
  93. package/dist/core/intelligence/patterns/completeness-validator.js +0 -221
  94. package/dist/core/intelligence/patterns/conciseness-filter.d.ts +0 -20
  95. package/dist/core/intelligence/patterns/conciseness-filter.js +0 -92
  96. package/dist/core/intelligence/patterns/context-precision.d.ts +0 -32
  97. package/dist/core/intelligence/patterns/context-precision.js +0 -389
  98. package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +0 -30
  99. package/dist/core/intelligence/patterns/conversation-summarizer.js +0 -277
  100. package/dist/core/intelligence/patterns/dependency-identifier.d.ts +0 -23
  101. package/dist/core/intelligence/patterns/dependency-identifier.js +0 -166
  102. package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +0 -21
  103. package/dist/core/intelligence/patterns/domain-context-enricher.js +0 -198
  104. package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +0 -30
  105. package/dist/core/intelligence/patterns/edge-case-identifier.js +0 -269
  106. package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +0 -22
  107. package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +0 -179
  108. package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +0 -24
  109. package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +0 -259
  110. package/dist/core/intelligence/patterns/objective-clarifier.d.ts +0 -22
  111. package/dist/core/intelligence/patterns/objective-clarifier.js +0 -126
  112. package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +0 -22
  113. package/dist/core/intelligence/patterns/output-format-enforcer.js +0 -151
  114. package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +0 -23
  115. package/dist/core/intelligence/patterns/prd-structure-enforcer.js +0 -183
  116. package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +0 -23
  117. package/dist/core/intelligence/patterns/prerequisite-identifier.js +0 -221
  118. package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +0 -24
  119. package/dist/core/intelligence/patterns/requirement-prioritizer.js +0 -134
  120. package/dist/core/intelligence/patterns/scope-definer.d.ts +0 -26
  121. package/dist/core/intelligence/patterns/scope-definer.js +0 -236
  122. package/dist/core/intelligence/patterns/step-decomposer.d.ts +0 -31
  123. package/dist/core/intelligence/patterns/step-decomposer.js +0 -242
  124. package/dist/core/intelligence/patterns/structure-organizer.d.ts +0 -31
  125. package/dist/core/intelligence/patterns/structure-organizer.js +0 -218
  126. package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +0 -22
  127. package/dist/core/intelligence/patterns/success-criteria-enforcer.js +0 -165
  128. package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +0 -24
  129. package/dist/core/intelligence/patterns/success-metrics-enforcer.js +0 -165
  130. package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +0 -25
  131. package/dist/core/intelligence/patterns/technical-context-enricher.js +0 -165
  132. package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +0 -26
  133. package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +0 -300
  134. package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +0 -24
  135. package/dist/core/intelligence/patterns/user-persona-enricher.js +0 -141
  136. package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +0 -31
  137. package/dist/core/intelligence/patterns/validation-checklist-creator.js +0 -242
  138. package/dist/core/intelligence/quality-assessor.d.ts +0 -71
  139. package/dist/core/intelligence/quality-assessor.js +0 -525
  140. package/dist/core/intelligence/types.d.ts +0 -111
  141. package/dist/core/intelligence/types.js +0 -3
  142. package/dist/core/intelligence/universal-optimizer.d.ts +0 -91
  143. package/dist/core/intelligence/universal-optimizer.js +0 -399
  144. package/dist/core/prd-generator.d.ts +0 -76
  145. package/dist/core/prd-generator.js +0 -173
  146. package/dist/core/prompt-manager.d.ts +0 -110
  147. package/dist/core/prompt-manager.js +0 -274
  148. package/dist/core/prompt-optimizer.d.ts +0 -268
  149. package/dist/core/prompt-optimizer.js +0 -959
  150. package/dist/core/question-engine.d.ts +0 -167
  151. package/dist/core/question-engine.js +0 -356
  152. package/dist/core/session-manager.d.ts +0 -139
  153. package/dist/core/session-manager.js +0 -365
  154. package/dist/core/task-manager.d.ts +0 -211
  155. package/dist/core/task-manager.js +0 -981
  156. package/dist/core/verification-hooks.d.ts +0 -67
  157. package/dist/core/verification-hooks.js +0 -309
  158. package/dist/core/verification-manager.d.ts +0 -107
  159. package/dist/core/verification-manager.js +0 -415
  160. package/dist/types/session.d.ts +0 -78
  161. package/dist/types/session.js +0 -8
  162. package/dist/types/verification.d.ts +0 -205
  163. package/dist/types/verification.js +0 -9
@@ -1,126 +0,0 @@
1
- /**
2
- * GitManager - Manages git auto-commit functionality for task implementation
3
- *
4
- * This class handles:
5
- * - Checking git repository status
6
- * - Creating commits based on user preferences
7
- * - Generating commit messages
8
- * - Handling commit strategies (per task, per phase, per N tasks)
9
- */
10
- /**
11
- * Git commit strategy options
12
- */
13
- export type CommitStrategy = 'per-phase' | 'per-5-tasks' | 'per-task' | 'none';
14
- /**
15
- * Options for creating a commit
16
- */
17
- export interface CommitOptions {
18
- message?: string;
19
- description?: string;
20
- tasks?: string[];
21
- phase?: string;
22
- projectName?: string;
23
- }
24
- /**
25
- * GitManager class
26
- *
27
- * Handles git operations for the implement command
28
- */
29
- export declare class GitManager {
30
- /**
31
- * Check if current directory is a git repository
32
- */
33
- isGitRepository(): Promise<boolean>;
34
- /**
35
- * Check if there are uncommitted changes
36
- */
37
- hasUncommittedChanges(): Promise<boolean>;
38
- /**
39
- * Create a commit with the given tasks
40
- */
41
- createCommit(options: CommitOptions): Promise<boolean>;
42
- /**
43
- * Generate commit message from tasks
44
- */
45
- private generateCommitMessage;
46
- /**
47
- * Validate that tasks are marked before committing
48
- * This ensures the tasks.md file matches what we expect to commit
49
- * @param tasksPath - Path to tasks.md file
50
- * @param completedTaskIds - Array of task IDs that should be completed
51
- * @returns Validation result with any errors
52
- */
53
- validateBeforeCommit(tasksPath: string, completedTaskIds: string[]): Promise<{
54
- valid: boolean;
55
- errors?: string[];
56
- }>;
57
- /**
58
- * Create commit with validation
59
- * Validates that tasks are marked before committing
60
- * @param options - Commit options
61
- * @param tasksPath - Path to tasks.md file
62
- * @param completedTaskIds - Array of task IDs that should be completed
63
- * @returns Commit result with validation status
64
- */
65
- createCommitWithValidation(options: CommitOptions, tasksPath?: string, completedTaskIds?: string[]): Promise<{
66
- success: boolean;
67
- validated: boolean;
68
- errors?: string[];
69
- }>;
70
- /**
71
- * Escape commit message for shell
72
- */
73
- private escapeCommitMessage;
74
- /**
75
- * Get the current branch name
76
- */
77
- getCurrentBranch(): Promise<string>;
78
- /**
79
- * Check if working directory is clean
80
- */
81
- isWorkingDirectoryClean(): Promise<boolean>;
82
- /**
83
- * Get short status for display
84
- */
85
- getStatus(): Promise<string>;
86
- /**
87
- * Validate git setup before implementing
88
- */
89
- validateGitSetup(): Promise<{
90
- isRepo: boolean;
91
- hasChanges: boolean;
92
- currentBranch: string;
93
- }>;
94
- }
95
- /**
96
- * Helper class to track when to commit based on strategy
97
- */
98
- export declare class CommitScheduler {
99
- private strategy;
100
- private completedTasksInPhase;
101
- private completedTasksTotal;
102
- private completedTasksSinceLastCommit;
103
- private currentPhase;
104
- constructor(strategy: CommitStrategy);
105
- /**
106
- * Mark a task as completed and check if commit should be made
107
- */
108
- taskCompleted(taskPhase: string): boolean;
109
- /**
110
- * Mark a phase as completed
111
- */
112
- phaseCompleted(): boolean;
113
- /**
114
- * Check if a commit should be made now
115
- */
116
- private shouldCommit;
117
- /**
118
- * Reset commit counter (after a commit is made)
119
- */
120
- resetCommitCounter(): void;
121
- /**
122
- * Get accumulated task count for commit message
123
- */
124
- getTaskCountSinceLastCommit(): number;
125
- }
126
- //# sourceMappingURL=git-manager.d.ts.map
@@ -1,282 +0,0 @@
1
- /**
2
- * GitManager - Manages git auto-commit functionality for task implementation
3
- *
4
- * This class handles:
5
- * - Checking git repository status
6
- * - Creating commits based on user preferences
7
- * - Generating commit messages
8
- * - Handling commit strategies (per task, per phase, per N tasks)
9
- */
10
- import { exec } from 'child_process';
11
- import { promisify } from 'util';
12
- const execAsync = promisify(exec);
13
- /**
14
- * GitManager class
15
- *
16
- * Handles git operations for the implement command
17
- */
18
- export class GitManager {
19
- /**
20
- * Check if current directory is a git repository
21
- */
22
- async isGitRepository() {
23
- try {
24
- await execAsync('git rev-parse --git-dir');
25
- return true;
26
- }
27
- catch {
28
- return false;
29
- }
30
- }
31
- /**
32
- * Check if there are uncommitted changes
33
- */
34
- async hasUncommittedChanges() {
35
- try {
36
- const { stdout } = await execAsync('git status --porcelain');
37
- return stdout.trim().length > 0;
38
- }
39
- catch {
40
- return false;
41
- }
42
- }
43
- /**
44
- * Create a commit with the given tasks
45
- */
46
- async createCommit(options) {
47
- try {
48
- // Check for changes first
49
- if (!(await this.hasUncommittedChanges())) {
50
- return false; // No changes to commit
51
- }
52
- // Stage all changes
53
- await execAsync('git add .');
54
- // Use provided message or generate one
55
- const message = options.message ?? this.generateCommitMessage(options);
56
- // Create commit
57
- await execAsync(`git commit -m "${this.escapeCommitMessage(message)}"`);
58
- return true;
59
- }
60
- catch (error) {
61
- // If commit fails, log but don't throw
62
- console.error('Git commit failed:', error);
63
- return false;
64
- }
65
- }
66
- /**
67
- * Generate commit message from tasks
68
- */
69
- generateCommitMessage(options) {
70
- const { description, tasks = [], phase, projectName } = options;
71
- let message = '';
72
- // Header
73
- if (phase) {
74
- message += `clavix: ${phase}\n\n`;
75
- }
76
- else if (description) {
77
- message += `clavix: ${description}\n\n`;
78
- }
79
- else if (tasks.length === 1) {
80
- message += `clavix: ${tasks[0]}\n\n`;
81
- }
82
- else if (tasks.length > 1) {
83
- message += `clavix: implement ${tasks.length} tasks\n\n`;
84
- }
85
- else {
86
- message += `clavix: task completed\n\n`;
87
- }
88
- // Task list (if provided)
89
- if (tasks.length > 0) {
90
- message += 'Completed tasks:\n';
91
- tasks.forEach((task) => {
92
- message += `- ${task}\n`;
93
- });
94
- message += '\n';
95
- }
96
- // Footer
97
- if (projectName) {
98
- message += `Project: ${projectName}\n`;
99
- }
100
- message += 'Generated by Clavix /clavix:implement';
101
- return message;
102
- }
103
- /**
104
- * Validate that tasks are marked before committing
105
- * This ensures the tasks.md file matches what we expect to commit
106
- * @param tasksPath - Path to tasks.md file
107
- * @param completedTaskIds - Array of task IDs that should be completed
108
- * @returns Validation result with any errors
109
- */
110
- async validateBeforeCommit(tasksPath, completedTaskIds) {
111
- const errors = [];
112
- try {
113
- // Read tasks.md file
114
- const fsExtra = await import('fs-extra');
115
- const fs = fsExtra.default || fsExtra;
116
- if (!(await fs.pathExists(tasksPath))) {
117
- errors.push(`Tasks file not found: ${tasksPath}`);
118
- return { valid: false, errors };
119
- }
120
- const content = await fs.readFile(tasksPath, 'utf-8');
121
- // Check each task ID is marked as complete in the file
122
- for (const taskId of completedTaskIds) {
123
- // Look for the task in the file (should have [x] checkbox)
124
- const hasCompleteCheckbox = content.includes(`[x]`) && content.includes(taskId);
125
- if (!hasCompleteCheckbox) {
126
- errors.push(`Task ${taskId} not marked as completed in tasks.md`);
127
- }
128
- }
129
- return {
130
- valid: errors.length === 0,
131
- errors: errors.length > 0 ? errors : undefined,
132
- };
133
- }
134
- catch (error) {
135
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
136
- errors.push(`Validation failed: ${errorMessage}`);
137
- return { valid: false, errors };
138
- }
139
- }
140
- /**
141
- * Create commit with validation
142
- * Validates that tasks are marked before committing
143
- * @param options - Commit options
144
- * @param tasksPath - Path to tasks.md file
145
- * @param completedTaskIds - Array of task IDs that should be completed
146
- * @returns Commit result with validation status
147
- */
148
- async createCommitWithValidation(options, tasksPath, completedTaskIds) {
149
- // If validation info provided, validate first
150
- if (tasksPath && completedTaskIds) {
151
- const validation = await this.validateBeforeCommit(tasksPath, completedTaskIds);
152
- if (!validation.valid) {
153
- return {
154
- success: false,
155
- validated: false,
156
- errors: validation.errors,
157
- };
158
- }
159
- }
160
- // Create commit
161
- const success = await this.createCommit(options);
162
- return {
163
- success,
164
- validated: tasksPath !== undefined && completedTaskIds !== undefined,
165
- };
166
- }
167
- /**
168
- * Escape commit message for shell
169
- */
170
- escapeCommitMessage(message) {
171
- return message.replace(/"/g, '\\"').replace(/\n/g, '\\n');
172
- }
173
- /**
174
- * Get the current branch name
175
- */
176
- async getCurrentBranch() {
177
- try {
178
- const { stdout } = await execAsync('git rev-parse --abbrev-ref HEAD');
179
- return stdout.trim();
180
- }
181
- catch {
182
- return 'unknown';
183
- }
184
- }
185
- /**
186
- * Check if working directory is clean
187
- */
188
- async isWorkingDirectoryClean() {
189
- return !(await this.hasUncommittedChanges());
190
- }
191
- /**
192
- * Get short status for display
193
- */
194
- async getStatus() {
195
- try {
196
- const { stdout } = await execAsync('git status --short');
197
- return stdout.trim();
198
- }
199
- catch {
200
- return 'Unable to get git status';
201
- }
202
- }
203
- /**
204
- * Validate git setup before implementing
205
- */
206
- async validateGitSetup() {
207
- const isRepo = await this.isGitRepository();
208
- const hasChanges = await this.hasUncommittedChanges();
209
- const currentBranch = isRepo ? await this.getCurrentBranch() : '';
210
- return {
211
- isRepo,
212
- hasChanges,
213
- currentBranch,
214
- };
215
- }
216
- }
217
- /**
218
- * Helper class to track when to commit based on strategy
219
- */
220
- export class CommitScheduler {
221
- strategy;
222
- completedTasksInPhase = 0;
223
- completedTasksTotal = 0;
224
- completedTasksSinceLastCommit = 0;
225
- currentPhase = '';
226
- constructor(strategy) {
227
- this.strategy = strategy;
228
- }
229
- /**
230
- * Mark a task as completed and check if commit should be made
231
- */
232
- taskCompleted(taskPhase) {
233
- this.completedTasksTotal++;
234
- this.completedTasksSinceLastCommit++;
235
- if (taskPhase !== this.currentPhase) {
236
- this.completedTasksInPhase = 0;
237
- this.currentPhase = taskPhase;
238
- }
239
- this.completedTasksInPhase++;
240
- return this.shouldCommit();
241
- }
242
- /**
243
- * Mark a phase as completed
244
- */
245
- phaseCompleted() {
246
- // Reset phase counter
247
- this.completedTasksInPhase = 0;
248
- // If strategy is per-phase, we should commit
249
- return this.strategy === 'per-phase';
250
- }
251
- /**
252
- * Check if a commit should be made now
253
- */
254
- shouldCommit() {
255
- switch (this.strategy) {
256
- case 'per-task':
257
- return true;
258
- case 'per-5-tasks':
259
- return this.completedTasksSinceLastCommit >= 5;
260
- case 'per-phase':
261
- // Will be handled by phaseCompleted()
262
- return false;
263
- case 'none':
264
- return false;
265
- default:
266
- return false;
267
- }
268
- }
269
- /**
270
- * Reset commit counter (after a commit is made)
271
- */
272
- resetCommitCounter() {
273
- this.completedTasksSinceLastCommit = 0;
274
- }
275
- /**
276
- * Get accumulated task count for commit message
277
- */
278
- getTaskCountSinceLastCommit() {
279
- return this.completedTasksSinceLastCommit;
280
- }
281
- }
282
- //# sourceMappingURL=git-manager.js.map
@@ -1,93 +0,0 @@
1
- /**
2
- * v4.5 Confidence Calculator Utilities
3
- *
4
- * Shared utilities for calculating confidence scores across the intelligence system.
5
- * Provides type-safe confidence values and common calculation patterns.
6
- */
7
- /**
8
- * Confidence level as a percentage (0-100).
9
- * - 0-49: Low confidence
10
- * - 50-69: Medium confidence
11
- * - 70-84: High confidence
12
- * - 85-100: Very high confidence
13
- */
14
- export type ConfidenceLevel = number;
15
- /**
16
- * Confidence category for display purposes
17
- */
18
- export type ConfidenceCategory = 'low' | 'medium' | 'high' | 'very-high';
19
- /**
20
- * Confidence result with category and percentage
21
- */
22
- export interface ConfidenceResult {
23
- percentage: ConfidenceLevel;
24
- category: ConfidenceCategory;
25
- }
26
- export declare const CONFIDENCE_THRESHOLDS: {
27
- readonly LOW_MAX: 49;
28
- readonly MEDIUM_MAX: 69;
29
- readonly HIGH_MAX: 84;
30
- readonly VERY_HIGH_MIN: 85;
31
- };
32
- /**
33
- * Clamp a confidence value to valid range (0-100)
34
- */
35
- export declare function clampConfidence(value: number): ConfidenceLevel;
36
- /**
37
- * Get confidence category from percentage
38
- */
39
- export declare function getConfidenceCategory(percentage: ConfidenceLevel): ConfidenceCategory;
40
- /**
41
- * Create a confidence result from a percentage
42
- */
43
- export declare function createConfidenceResult(percentage: number): ConfidenceResult;
44
- /**
45
- * Calculate additive confidence based on presence of elements.
46
- * Common pattern: base + bonus for each element present.
47
- *
48
- * @example
49
- * calculateAdditiveConfidence(50, [
50
- * [hasRequirements, 20],
51
- * [hasGoals, 15],
52
- * [hasConstraints, 15],
53
- * ]);
54
- */
55
- export declare function calculateAdditiveConfidence(baseConfidence: number, bonuses: Array<[boolean, number]>): ConfidenceLevel;
56
- /**
57
- * Calculate ratio-based confidence.
58
- * Common pattern: primary score as percentage of total score.
59
- *
60
- * @example
61
- * calculateRatioConfidence(primaryScore, totalScore);
62
- */
63
- export declare function calculateRatioConfidence(primaryScore: number, totalScore: number, options?: {
64
- minConfidence?: number;
65
- fallbackConfidence?: number;
66
- }): ConfidenceLevel;
67
- /**
68
- * Apply confidence penalty when competing scores are close.
69
- * Common pattern: reduce confidence when there's ambiguity.
70
- *
71
- * @example
72
- * applyCompetitionPenalty(confidence, primaryScore, secondaryScore, {
73
- * threshold: 0.15,
74
- * penalty: 15,
75
- * minConfidence: 60,
76
- * });
77
- */
78
- export declare function applyCompetitionPenalty(confidence: number, primaryScore: number, secondaryScore: number, options?: {
79
- threshold?: number;
80
- penalty?: number;
81
- minConfidence?: number;
82
- }): ConfidenceLevel;
83
- /**
84
- * Calculate weighted average confidence from multiple sources.
85
- *
86
- * @example
87
- * calculateWeightedConfidence([
88
- * [intentConfidence, 0.6],
89
- * [qualityConfidence, 0.4],
90
- * ]);
91
- */
92
- export declare function calculateWeightedConfidence(scores: Array<[number, number]>): ConfidenceLevel;
93
- //# sourceMappingURL=confidence-calculator.d.ts.map
@@ -1,124 +0,0 @@
1
- /**
2
- * v4.5 Confidence Calculator Utilities
3
- *
4
- * Shared utilities for calculating confidence scores across the intelligence system.
5
- * Provides type-safe confidence values and common calculation patterns.
6
- */
7
- // ============================================================================
8
- // Thresholds
9
- // ============================================================================
10
- export const CONFIDENCE_THRESHOLDS = {
11
- LOW_MAX: 49,
12
- MEDIUM_MAX: 69,
13
- HIGH_MAX: 84,
14
- VERY_HIGH_MIN: 85,
15
- };
16
- // ============================================================================
17
- // Utility Functions
18
- // ============================================================================
19
- /**
20
- * Clamp a confidence value to valid range (0-100)
21
- */
22
- export function clampConfidence(value) {
23
- return Math.min(100, Math.max(0, Math.round(value)));
24
- }
25
- /**
26
- * Get confidence category from percentage
27
- */
28
- export function getConfidenceCategory(percentage) {
29
- if (percentage <= CONFIDENCE_THRESHOLDS.LOW_MAX)
30
- return 'low';
31
- if (percentage <= CONFIDENCE_THRESHOLDS.MEDIUM_MAX)
32
- return 'medium';
33
- if (percentage <= CONFIDENCE_THRESHOLDS.HIGH_MAX)
34
- return 'high';
35
- return 'very-high';
36
- }
37
- /**
38
- * Create a confidence result from a percentage
39
- */
40
- export function createConfidenceResult(percentage) {
41
- const clamped = clampConfidence(percentage);
42
- return {
43
- percentage: clamped,
44
- category: getConfidenceCategory(clamped),
45
- };
46
- }
47
- // ============================================================================
48
- // Calculation Patterns
49
- // ============================================================================
50
- /**
51
- * Calculate additive confidence based on presence of elements.
52
- * Common pattern: base + bonus for each element present.
53
- *
54
- * @example
55
- * calculateAdditiveConfidence(50, [
56
- * [hasRequirements, 20],
57
- * [hasGoals, 15],
58
- * [hasConstraints, 15],
59
- * ]);
60
- */
61
- export function calculateAdditiveConfidence(baseConfidence, bonuses) {
62
- let total = baseConfidence;
63
- for (const [condition, bonus] of bonuses) {
64
- if (condition) {
65
- total += bonus;
66
- }
67
- }
68
- return clampConfidence(total);
69
- }
70
- /**
71
- * Calculate ratio-based confidence.
72
- * Common pattern: primary score as percentage of total score.
73
- *
74
- * @example
75
- * calculateRatioConfidence(primaryScore, totalScore);
76
- */
77
- export function calculateRatioConfidence(primaryScore, totalScore, options = {}) {
78
- const { minConfidence = 0, fallbackConfidence = 50 } = options;
79
- if (totalScore === 0) {
80
- return fallbackConfidence;
81
- }
82
- const ratio = primaryScore / totalScore;
83
- const percentage = Math.round(ratio * 100);
84
- return clampConfidence(Math.max(minConfidence, percentage));
85
- }
86
- /**
87
- * Apply confidence penalty when competing scores are close.
88
- * Common pattern: reduce confidence when there's ambiguity.
89
- *
90
- * @example
91
- * applyCompetitionPenalty(confidence, primaryScore, secondaryScore, {
92
- * threshold: 0.15,
93
- * penalty: 15,
94
- * minConfidence: 60,
95
- * });
96
- */
97
- export function applyCompetitionPenalty(confidence, primaryScore, secondaryScore, options = {}) {
98
- const { threshold = 0.15, penalty = 15, minConfidence = 60 } = options;
99
- const difference = primaryScore - secondaryScore;
100
- // If scores are within threshold, apply penalty
101
- if (primaryScore > 0 && difference < primaryScore * threshold) {
102
- return clampConfidence(Math.max(minConfidence, confidence - penalty));
103
- }
104
- return clampConfidence(confidence);
105
- }
106
- /**
107
- * Calculate weighted average confidence from multiple sources.
108
- *
109
- * @example
110
- * calculateWeightedConfidence([
111
- * [intentConfidence, 0.6],
112
- * [qualityConfidence, 0.4],
113
- * ]);
114
- */
115
- export function calculateWeightedConfidence(scores // [confidence, weight]
116
- ) {
117
- const totalWeight = scores.reduce((sum, [, weight]) => sum + weight, 0);
118
- if (totalWeight === 0) {
119
- return 50;
120
- }
121
- const weightedSum = scores.reduce((sum, [confidence, weight]) => sum + confidence * weight, 0);
122
- return clampConfidence(weightedSum / totalWeight);
123
- }
124
- //# sourceMappingURL=confidence-calculator.js.map
@@ -1,11 +0,0 @@
1
- export { UniversalOptimizer } from './universal-optimizer.js';
2
- export { IntentDetector } from './intent-detector.js';
3
- export { PatternLibrary } from './pattern-library.js';
4
- export { QualityAssessor } from './quality-assessor.js';
5
- export * from './types.js';
6
- export * from './confidence-calculator.js';
7
- export { BasePattern } from './patterns/base-pattern.js';
8
- export { ConcisenessFilter } from './patterns/conciseness-filter.js';
9
- export { ObjectiveClarifier } from './patterns/objective-clarifier.js';
10
- export { TechnicalContextEnricher } from './patterns/technical-context-enricher.js';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,15 +0,0 @@
1
- // Main exports for the Clavix Intelligence system
2
- export { UniversalOptimizer } from './universal-optimizer.js';
3
- export { IntentDetector } from './intent-detector.js';
4
- export { PatternLibrary } from './pattern-library.js';
5
- export { QualityAssessor } from './quality-assessor.js';
6
- // Type exports
7
- export * from './types.js';
8
- // v4.5: Confidence calculation utilities
9
- export * from './confidence-calculator.js';
10
- // Pattern exports
11
- export { BasePattern } from './patterns/base-pattern.js';
12
- export { ConcisenessFilter } from './patterns/conciseness-filter.js';
13
- export { ObjectiveClarifier } from './patterns/objective-clarifier.js';
14
- export { TechnicalContextEnricher } from './patterns/technical-context-enricher.js';
15
- //# sourceMappingURL=index.js.map