@pupt/cli 0.0.1 → 2.3.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 +54 -29
- package/dist/annotations/annotation-analyzer.d.ts +17 -0
- package/dist/annotations/annotation-analyzer.d.ts.map +1 -0
- package/dist/annotations/annotation-analyzer.js +145 -0
- package/dist/annotations/annotation-analyzer.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +435 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +5 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +164 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/annotate.d.ts +2 -0
- package/dist/commands/annotate.d.ts.map +1 -0
- package/dist/commands/annotate.js +99 -0
- package/dist/commands/annotate.js.map +1 -0
- package/dist/commands/base-command.d.ts +23 -0
- package/dist/commands/base-command.d.ts.map +1 -0
- package/dist/commands/base-command.js +41 -0
- package/dist/commands/base-command.js.map +1 -0
- package/dist/commands/cache.d.ts +9 -0
- package/dist/commands/cache.d.ts.map +1 -0
- package/dist/commands/cache.js +31 -0
- package/dist/commands/cache.js.map +1 -0
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +93 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/edit.d.ts +2 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +35 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/help.d.ts +2 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +26 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/history.d.ts +12 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +317 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +137 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/install.d.ts +16 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +263 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/review.d.ts +3 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +160 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/run.d.ts +32 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +367 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/uninstall.d.ts +2 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +45 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +113 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/config/config-manager.d.ts +19 -0
- package/dist/config/config-manager.d.ts.map +1 -0
- package/dist/config/config-manager.js +221 -0
- package/dist/config/config-manager.js.map +1 -0
- package/dist/config/global-paths.d.ts +5 -0
- package/dist/config/global-paths.d.ts.map +1 -0
- package/dist/config/global-paths.js +16 -0
- package/dist/config/global-paths.js.map +1 -0
- package/dist/config/migration.d.ts +12 -0
- package/dist/config/migration.d.ts.map +1 -0
- package/dist/config/migration.js +270 -0
- package/dist/config/migration.js.map +1 -0
- package/dist/history/enhanced-history-manager.d.ts +27 -0
- package/dist/history/enhanced-history-manager.d.ts.map +1 -0
- package/dist/history/enhanced-history-manager.js +116 -0
- package/dist/history/enhanced-history-manager.js.map +1 -0
- package/dist/history/history-manager.d.ts +43 -0
- package/dist/history/history-manager.d.ts.map +1 -0
- package/dist/history/history-manager.js +229 -0
- package/dist/history/history-manager.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/input-types/file-search-prompt.d.ts +11 -0
- package/dist/prompts/input-types/file-search-prompt.d.ts.map +1 -0
- package/dist/prompts/input-types/file-search-prompt.js +53 -0
- package/dist/prompts/input-types/file-search-prompt.js.map +1 -0
- package/dist/prompts/input-types/review-file-prompt.d.ts +3 -0
- package/dist/prompts/input-types/review-file-prompt.d.ts.map +1 -0
- package/dist/prompts/input-types/review-file-prompt.js +9 -0
- package/dist/prompts/input-types/review-file-prompt.js.map +1 -0
- package/dist/schemas/config-schema.d.ts +1637 -0
- package/dist/schemas/config-schema.d.ts.map +1 -0
- package/dist/schemas/config-schema.js +136 -0
- package/dist/schemas/config-schema.js.map +1 -0
- package/dist/search/search-engine.d.ts +8 -0
- package/dist/search/search-engine.d.ts.map +1 -0
- package/dist/search/search-engine.js +53 -0
- package/dist/search/search-engine.js.map +1 -0
- package/dist/services/git-service.d.ts +28 -0
- package/dist/services/git-service.d.ts.map +1 -0
- package/dist/services/git-service.js +157 -0
- package/dist/services/git-service.js.map +1 -0
- package/dist/services/input-collector.d.ts +9 -0
- package/dist/services/input-collector.d.ts.map +1 -0
- package/dist/services/input-collector.js +162 -0
- package/dist/services/input-collector.js.map +1 -0
- package/dist/services/logging-service.d.ts +49 -0
- package/dist/services/logging-service.d.ts.map +1 -0
- package/dist/services/logging-service.js +203 -0
- package/dist/services/logging-service.js.map +1 -0
- package/dist/services/module-cache.d.ts +42 -0
- package/dist/services/module-cache.d.ts.map +1 -0
- package/dist/services/module-cache.js +205 -0
- package/dist/services/module-cache.js.map +1 -0
- package/dist/services/module-entry-builder.d.ts +20 -0
- package/dist/services/module-entry-builder.d.ts.map +1 -0
- package/dist/services/module-entry-builder.js +71 -0
- package/dist/services/module-entry-builder.js.map +1 -0
- package/dist/services/output-capture-service.d.ts +28 -0
- package/dist/services/output-capture-service.d.ts.map +1 -0
- package/dist/services/output-capture-service.js +348 -0
- package/dist/services/output-capture-service.js.map +1 -0
- package/dist/services/package-manager.d.ts +18 -0
- package/dist/services/package-manager.d.ts.map +1 -0
- package/dist/services/package-manager.js +141 -0
- package/dist/services/package-manager.js.map +1 -0
- package/dist/services/pattern-detector.d.ts +15 -0
- package/dist/services/pattern-detector.d.ts.map +1 -0
- package/dist/services/pattern-detector.js +228 -0
- package/dist/services/pattern-detector.js.map +1 -0
- package/dist/services/prompt-resolver.d.ts +32 -0
- package/dist/services/prompt-resolver.d.ts.map +1 -0
- package/dist/services/prompt-resolver.js +73 -0
- package/dist/services/prompt-resolver.js.map +1 -0
- package/dist/services/pupt-prompt-source.d.ts +16 -0
- package/dist/services/pupt-prompt-source.d.ts.map +1 -0
- package/dist/services/pupt-prompt-source.js +74 -0
- package/dist/services/pupt-prompt-source.js.map +1 -0
- package/dist/services/pupt-service.d.ts +33 -0
- package/dist/services/pupt-service.d.ts.map +1 -0
- package/dist/services/pupt-service.js +119 -0
- package/dist/services/pupt-service.js.map +1 -0
- package/dist/services/review-data-builder.d.ts +25 -0
- package/dist/services/review-data-builder.d.ts.map +1 -0
- package/dist/services/review-data-builder.js +333 -0
- package/dist/services/review-data-builder.js.map +1 -0
- package/dist/services/suggestion-generator.d.ts +11 -0
- package/dist/services/suggestion-generator.d.ts.map +1 -0
- package/dist/services/suggestion-generator.js +158 -0
- package/dist/services/suggestion-generator.js.map +1 -0
- package/dist/services/ui-service.d.ts +49 -0
- package/dist/services/ui-service.d.ts.map +1 -0
- package/dist/services/ui-service.js +196 -0
- package/dist/services/ui-service.js.map +1 -0
- package/dist/types/annotations.d.ts +50 -0
- package/dist/types/annotations.d.ts.map +1 -0
- package/dist/types/annotations.js +2 -0
- package/dist/types/annotations.js.map +1 -0
- package/dist/types/config.d.ts +110 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +12 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/history.d.ts +36 -0
- package/dist/types/history.d.ts.map +1 -0
- package/dist/types/history.js +2 -0
- package/dist/types/history.js.map +1 -0
- package/dist/types/patterns.d.ts +25 -0
- package/dist/types/patterns.d.ts.map +1 -0
- package/dist/types/patterns.js +2 -0
- package/dist/types/patterns.js.map +1 -0
- package/dist/types/prompt.d.ts +29 -0
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/types/prompt.js +24 -0
- package/dist/types/prompt.js.map +1 -0
- package/dist/types/review.d.ts +81 -0
- package/dist/types/review.d.ts.map +1 -0
- package/dist/types/review.js +2 -0
- package/dist/types/review.js.map +1 -0
- package/dist/ui/console-ui.d.ts +30 -0
- package/dist/ui/console-ui.d.ts.map +1 -0
- package/dist/ui/console-ui.js +88 -0
- package/dist/ui/console-ui.js.map +1 -0
- package/dist/ui/interactive-search.d.ts +8 -0
- package/dist/ui/interactive-search.d.ts.map +1 -0
- package/dist/ui/interactive-search.js +29 -0
- package/dist/ui/interactive-search.js.map +1 -0
- package/dist/utils/annotation-migration.d.ts +12 -0
- package/dist/utils/annotation-migration.d.ts.map +1 -0
- package/dist/utils/annotation-migration.js +88 -0
- package/dist/utils/annotation-migration.js.map +1 -0
- package/dist/utils/date-formatter.d.ts +10 -0
- package/dist/utils/date-formatter.d.ts.map +1 -0
- package/dist/utils/date-formatter.js +46 -0
- package/dist/utils/date-formatter.js.map +1 -0
- package/dist/utils/editor.d.ts +14 -0
- package/dist/utils/editor.d.ts.map +1 -0
- package/dist/utils/editor.js +52 -0
- package/dist/utils/editor.js.map +1 -0
- package/dist/utils/errors.d.ts +58 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +275 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/git-info.d.ts +10 -0
- package/dist/utils/git-info.d.ts.map +1 -0
- package/dist/utils/git-info.js +44 -0
- package/dist/utils/git-info.js.map +1 -0
- package/dist/utils/gitignore.d.ts +10 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +72 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/dist/utils/logger.d.ts +39 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +143 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/platform.d.ts +9 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +45 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/project-root.d.ts +22 -0
- package/dist/utils/project-root.d.ts.map +1 -0
- package/dist/utils/project-root.js +226 -0
- package/dist/utils/project-root.js.map +1 -0
- package/dist/utils/prompt-dir-resolver.d.ts +5 -0
- package/dist/utils/prompt-dir-resolver.d.ts.map +1 -0
- package/dist/utils/prompt-dir-resolver.js +25 -0
- package/dist/utils/prompt-dir-resolver.js.map +1 -0
- package/dist/utils/security.d.ts +5 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +57 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/tool-detection.d.ts +14 -0
- package/dist/utils/tool-detection.d.ts.map +1 -0
- package/dist/utils/tool-detection.js +43 -0
- package/dist/utils/tool-detection.js.map +1 -0
- package/package.json +79 -7
- package/prompts/prompts/ad-hoc-long.prompt +60 -0
- package/prompts/prompts/ad-hoc.prompt +29 -0
- package/prompts/prompts/code-review.prompt +99 -0
- package/prompts/prompts/debugging-error-message.prompt +81 -0
- package/prompts/prompts/fix-github-actions.prompt +62 -0
- package/prompts/prompts/fix-test-errors.prompt +73 -0
- package/prompts/prompts/git-commit-comment.prompt +61 -0
- package/prompts/prompts/implementation-phase.prompt +53 -0
- package/prompts/prompts/implementation-plan.prompt +101 -0
- package/prompts/prompts/new-feature.prompt +89 -0
- package/prompts/prompts/new-project.prompt +9 -0
- package/prompts/prompts/one-shot-change.prompt +79 -0
- package/prompts/prompts/pupt-prompt-improvement.prompt +270 -0
- package/prompts/prompts/simple-test.prompt +8 -0
- package/prompts/prompts/update-design.prompt +71 -0
- package/prompts/prompts/update-documentation.prompt +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Adam Powers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://github.com/apowers313/pupt/actions)
|
|
2
|
+
[](https://www.npmjs.com/package/pupt)
|
|
3
|
+
[](https://apowers313.github.io/pupt/)
|
|
4
|
+
[](https://coveralls.io/github/apowers313/pupt?branch=master)
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# PUPT (Powerful Universal Prompt Tool)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
<div align="center">
|
|
9
|
+
<img src="./assets/pupt.png" alt="PUPT Logo" width="200">
|
|
10
|
+
|
|
11
|
+
# PUPT
|
|
12
|
+
**Your Faithful Prompt Companion**
|
|
13
|
+
</div>
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
A powerful CLI tool for managing and using AI prompts with template support, designed to be your faithful prompt companion.
|
|
8
16
|
|
|
9
|
-
##
|
|
17
|
+
## Features
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
- ✏️ **Prompt Management** - Create, edit, and organize prompts easily
|
|
20
|
+
- 📝 **Template Support** - Use Handlebars templates with user input
|
|
21
|
+
- 🔍 **Interactive Search** - Quickly find prompts with fuzzy search
|
|
22
|
+
- 🔧 **Cross-platform** - Works on Windows, macOS, and Linux
|
|
23
|
+
- 🚀 **Tool Integration** - Run prompts with Claude Code, Kiro, or any command line tool
|
|
24
|
+
- 📊 **History Tracking** - Keep track of generated prompts and re-run them
|
|
25
|
+
- 📊 **Output Capture** - Capture and save command outputs (configurable)
|
|
26
|
+
- 🏷️ **Annotations** - Add notes and tags to your prompt history
|
|
27
|
+
- 🤖 **Auto-annotation** - Automatically analyze and annotate prompt executions
|
|
28
|
+
- 📋 **Review Command** - Analyze prompt usage patterns and generate improvement suggestions
|
|
29
|
+
- 📦 **Install Prompts** - Install and share prompts from git or npm
|
|
15
30
|
|
|
16
|
-
##
|
|
31
|
+
## Quick Start
|
|
17
32
|
|
|
18
|
-
|
|
33
|
+
```bash
|
|
34
|
+
# Install globally
|
|
35
|
+
npm install -g pupt
|
|
19
36
|
|
|
20
|
-
|
|
37
|
+
# Initialize configuration
|
|
38
|
+
pt init
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
# Create your first prompt
|
|
41
|
+
pt add
|
|
23
42
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
43
|
+
# Run the tool
|
|
44
|
+
pt
|
|
45
|
+
```
|
|
28
46
|
|
|
29
|
-
##
|
|
47
|
+
## Documentation
|
|
30
48
|
|
|
31
|
-
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
49
|
+
For comprehensive documentation, tutorials, and examples, visit our documentation site:
|
|
36
50
|
|
|
37
|
-
|
|
51
|
+
**📚 [View Full Documentation](https://apowers313.github.io/pupt/)**
|
|
38
52
|
|
|
39
|
-
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
53
|
+
The documentation includes:
|
|
54
|
+
- **[Getting Started Guide](https://apowers313.github.io/pupt/guide/getting-started)** - Installation and first steps
|
|
55
|
+
- **[Prompt Templates](https://apowers313.github.io/pupt/guide/prompt-templates)** - Learn how to create dynamic prompts
|
|
56
|
+
- **[Command Reference](https://apowers313.github.io/pupt/commands/)** - Detailed information on all commands
|
|
57
|
+
- **[Configuration Guide](https://apowers313.github.io/pupt/guide/configuration)** - Customize PUPT to your needs
|
|
58
|
+
- **[Available Prompts](https://apowers313.github.io/pupt/prompts)** - Browse built-in prompt templates
|
|
59
|
+
- **[Troubleshooting](https://apowers313.github.io/pupt/guide/troubleshooting)** - Solutions to common issues
|
|
60
|
+
- **[Development Guide](https://apowers313.github.io/pupt/guide/development)** - Contributing and building from source
|
|
42
61
|
|
|
43
|
-
|
|
62
|
+
## Repository
|
|
44
63
|
|
|
45
|
-
**
|
|
64
|
+
- **GitHub**: [https://github.com/apowers313/pupt](https://github.com/apowers313/pupt)
|
|
65
|
+
- **Issues**: [https://github.com/apowers313/pupt/issues](https://github.com/apowers313/pupt/issues)
|
|
66
|
+
- **Author**: Adam Powers <apowers@ato.ms>
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnnotationAnalysisSummary, AnnotationMetadata, IssueIdentified, ParsedAnnotation } from '../types/annotations.js';
|
|
2
|
+
interface RawAnnotation extends AnnotationMetadata {
|
|
3
|
+
notes?: string;
|
|
4
|
+
annotationPath?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class AnnotationAnalyzer {
|
|
7
|
+
private patternRules;
|
|
8
|
+
parseAnnotations(annotations: RawAnnotation[]): ParsedAnnotation[];
|
|
9
|
+
extractPatterns(annotations: ParsedAnnotation[]): string[];
|
|
10
|
+
categorizeIssues(annotations: ParsedAnnotation[]): Record<string, IssueIdentified[]>;
|
|
11
|
+
calculatePatternFrequency(annotations: ParsedAnnotation[]): Record<string, number>;
|
|
12
|
+
getAnalysisSummary(annotations: ParsedAnnotation[]): AnnotationAnalysisSummary;
|
|
13
|
+
private detectPatternsInText;
|
|
14
|
+
private extractPromptName;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=annotation-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-analyzer.d.ts","sourceRoot":"","sources":["../../src/annotations/annotation-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAEnD,UAAU,aAAc,SAAQ,kBAAkB;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,YAAY,CAiClB;IAEF,gBAAgB,CAAC,WAAW,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAE;IA4BlE,eAAe,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE;IAmB1D,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC;IAiBpF,yBAAyB,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAqBlF,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,yBAAyB;IA8B9E,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,iBAAiB;CAM1B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export class AnnotationAnalyzer {
|
|
2
|
+
patternRules = {
|
|
3
|
+
verification_gap: [
|
|
4
|
+
/test.*fail.*(?:after|despite).*(?:claim|said).*(?:success|complete|done)/i,
|
|
5
|
+
/(?:claim|said).*(?:success|complete|done).*but.*test.*fail/i,
|
|
6
|
+
/test.*still.*fail/i,
|
|
7
|
+
/AI.*(?:said|claimed).*(?:success|complete|done).*but.*(?:test|build).*fail/i,
|
|
8
|
+
/(?:claim|said).*complet.*but.*error.*remain/i,
|
|
9
|
+
/test.*(?:were|was).*fail.*despite.*(?:success|completion).*claim/i,
|
|
10
|
+
/test.*fail.*despite.*complet.*claim/i
|
|
11
|
+
],
|
|
12
|
+
incomplete_task: [
|
|
13
|
+
/stopped?\s+at\s+first\s+error/i,
|
|
14
|
+
/only\s+(?:fixed|completed|did)\s+(?:one|1|part)/i,
|
|
15
|
+
/incomplete\s+implementation/i,
|
|
16
|
+
/partial(?:ly)?\s+complet/i,
|
|
17
|
+
/did\s+not\s+finish\s+all/i,
|
|
18
|
+
/(?:fixed|completed)\s+\d+\s+(?:of|out\s+of)\s+\d+/i,
|
|
19
|
+
/left\s+(?:some|other)\s+(?:error|issue|task)/i
|
|
20
|
+
],
|
|
21
|
+
ambiguous_instruction: [
|
|
22
|
+
/unclear\s+(?:what|requirement|instruction|expectation)/i,
|
|
23
|
+
/ambiguous\s+(?:requirement|instruction|prompt)/i,
|
|
24
|
+
/prompt\s+(?:was|is)\s+(?:not\s+)?(?:specific|clear)/i,
|
|
25
|
+
/instruction.*vague/i,
|
|
26
|
+
/confusing\s+prompt/i,
|
|
27
|
+
/(?:not|wasn't)\s+(?:sure|clear)\s+what\s+(?:to|was\s+expected)/i
|
|
28
|
+
],
|
|
29
|
+
missing_constraint: [
|
|
30
|
+
/(?:no|missing)\s+(?:requirement|constraint|specification)\s+(?:for|about)/i,
|
|
31
|
+
/(?:didn't|did\s+not)\s+(?:specify|mention)\s+(?:requirement|constraint)/i,
|
|
32
|
+
/(?:forgot|missed)\s+to\s+(?:include|specify|mention)/i,
|
|
33
|
+
/(?:performance|security|error\s+handling).*(?:not\s+specified|missing)/i
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
parseAnnotations(annotations) {
|
|
37
|
+
return annotations.map(ann => {
|
|
38
|
+
const parsed = {
|
|
39
|
+
historyFile: ann.historyFile,
|
|
40
|
+
timestamp: ann.timestamp,
|
|
41
|
+
status: ann.status,
|
|
42
|
+
tags: ann.tags || [],
|
|
43
|
+
notes: ann.notes || '',
|
|
44
|
+
promptName: this.extractPromptName(ann.historyFile),
|
|
45
|
+
annotationPath: ann.annotationPath || ''
|
|
46
|
+
};
|
|
47
|
+
if (ann.structured_outcome) {
|
|
48
|
+
parsed.structured_outcome = ann.structured_outcome;
|
|
49
|
+
}
|
|
50
|
+
if (ann.issues_identified) {
|
|
51
|
+
parsed.issues_identified = ann.issues_identified;
|
|
52
|
+
}
|
|
53
|
+
if (ann.auto_detected !== undefined) {
|
|
54
|
+
parsed.auto_detected = ann.auto_detected;
|
|
55
|
+
}
|
|
56
|
+
return parsed;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
extractPatterns(annotations) {
|
|
60
|
+
const patterns = new Set();
|
|
61
|
+
annotations.forEach(ann => {
|
|
62
|
+
// Extract from structured issues
|
|
63
|
+
if (ann.issues_identified) {
|
|
64
|
+
ann.issues_identified.forEach(issue => {
|
|
65
|
+
patterns.add(issue.category);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// Extract from notes text
|
|
69
|
+
const textPatterns = this.detectPatternsInText(ann.notes);
|
|
70
|
+
textPatterns.forEach(p => patterns.add(p));
|
|
71
|
+
});
|
|
72
|
+
return Array.from(patterns);
|
|
73
|
+
}
|
|
74
|
+
categorizeIssues(annotations) {
|
|
75
|
+
const categorized = {};
|
|
76
|
+
annotations.forEach(ann => {
|
|
77
|
+
if (ann.issues_identified) {
|
|
78
|
+
ann.issues_identified.forEach(issue => {
|
|
79
|
+
if (!categorized[issue.category]) {
|
|
80
|
+
categorized[issue.category] = [];
|
|
81
|
+
}
|
|
82
|
+
categorized[issue.category].push(issue);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return categorized;
|
|
87
|
+
}
|
|
88
|
+
calculatePatternFrequency(annotations) {
|
|
89
|
+
const frequency = {};
|
|
90
|
+
annotations.forEach(ann => {
|
|
91
|
+
// Count from structured issues
|
|
92
|
+
if (ann.issues_identified) {
|
|
93
|
+
ann.issues_identified.forEach(issue => {
|
|
94
|
+
frequency[issue.category] = (frequency[issue.category] || 0) + 1;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Count from text patterns
|
|
98
|
+
const textPatterns = this.detectPatternsInText(ann.notes);
|
|
99
|
+
textPatterns.forEach(pattern => {
|
|
100
|
+
frequency[pattern] = (frequency[pattern] || 0) + 1;
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
return frequency;
|
|
104
|
+
}
|
|
105
|
+
getAnalysisSummary(annotations) {
|
|
106
|
+
const statusDistribution = {
|
|
107
|
+
success: 0,
|
|
108
|
+
partial: 0,
|
|
109
|
+
failure: 0
|
|
110
|
+
};
|
|
111
|
+
const tagCounts = {};
|
|
112
|
+
annotations.forEach(ann => {
|
|
113
|
+
statusDistribution[ann.status]++;
|
|
114
|
+
ann.tags.forEach(tag => {
|
|
115
|
+
tagCounts[tag] = (tagCounts[tag] || 0) + 1;
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
const commonTags = Object.entries(tagCounts)
|
|
119
|
+
.sort((a, b) => b[1] - a[1])
|
|
120
|
+
.map(([tag]) => tag);
|
|
121
|
+
return {
|
|
122
|
+
totalAnnotations: annotations.length,
|
|
123
|
+
statusDistribution,
|
|
124
|
+
patternFrequency: this.calculatePatternFrequency(annotations),
|
|
125
|
+
commonTags,
|
|
126
|
+
issuesByCategory: this.categorizeIssues(annotations)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
detectPatternsInText(text) {
|
|
130
|
+
const detected = [];
|
|
131
|
+
Object.entries(this.patternRules).forEach(([pattern, rules]) => {
|
|
132
|
+
if (rules.some(rule => rule.test(text))) {
|
|
133
|
+
detected.push(pattern);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return detected;
|
|
137
|
+
}
|
|
138
|
+
extractPromptName(_historyFile) {
|
|
139
|
+
// For the current filename format (YYYYMMDD-HHMMSS-randomhex.json),
|
|
140
|
+
// we can't extract the prompt name from the filename alone.
|
|
141
|
+
// This should be handled by the caller using the actual history entry data.
|
|
142
|
+
return 'unknown';
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=annotation-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-analyzer.js","sourceRoot":"","sources":["../../src/annotations/annotation-analyzer.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,kBAAkB;IACrB,YAAY,GAAG;QACrB,gBAAgB,EAAE;YAChB,2EAA2E;YAC3E,6DAA6D;YAC7D,oBAAoB;YACpB,6EAA6E;YAC7E,8CAA8C;YAC9C,mEAAmE;YACnE,sCAAsC;SACvC;QACD,eAAe,EAAE;YACf,gCAAgC;YAChC,kDAAkD;YAClD,8BAA8B;YAC9B,2BAA2B;YAC3B,2BAA2B;YAC3B,oDAAoD;YACpD,+CAA+C;SAChD;QACD,qBAAqB,EAAE;YACrB,yDAAyD;YACzD,iDAAiD;YACjD,sDAAsD;YACtD,qBAAqB;YACrB,qBAAqB;YACrB,iEAAiE;SAClE;QACD,kBAAkB,EAAE;YAClB,4EAA4E;YAC5E,0EAA0E;YAC1E,uDAAuD;YACvD,yEAAyE;SAC1E;KACF,CAAC;IAEF,gBAAgB,CAAC,WAA4B;QAC3C,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,MAAM,GAAqB;gBAC/B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