@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.
Files changed (259) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -29
  3. package/dist/annotations/annotation-analyzer.d.ts +17 -0
  4. package/dist/annotations/annotation-analyzer.d.ts.map +1 -0
  5. package/dist/annotations/annotation-analyzer.js +145 -0
  6. package/dist/annotations/annotation-analyzer.js.map +1 -0
  7. package/dist/cli.d.ts +3 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +435 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/commands/add.d.ts +5 -0
  12. package/dist/commands/add.d.ts.map +1 -0
  13. package/dist/commands/add.js +164 -0
  14. package/dist/commands/add.js.map +1 -0
  15. package/dist/commands/annotate.d.ts +2 -0
  16. package/dist/commands/annotate.d.ts.map +1 -0
  17. package/dist/commands/annotate.js +99 -0
  18. package/dist/commands/annotate.js.map +1 -0
  19. package/dist/commands/base-command.d.ts +23 -0
  20. package/dist/commands/base-command.d.ts.map +1 -0
  21. package/dist/commands/base-command.js +41 -0
  22. package/dist/commands/base-command.js.map +1 -0
  23. package/dist/commands/cache.d.ts +9 -0
  24. package/dist/commands/cache.d.ts.map +1 -0
  25. package/dist/commands/cache.js +31 -0
  26. package/dist/commands/cache.js.map +1 -0
  27. package/dist/commands/config.d.ts +8 -0
  28. package/dist/commands/config.d.ts.map +1 -0
  29. package/dist/commands/config.js +93 -0
  30. package/dist/commands/config.js.map +1 -0
  31. package/dist/commands/edit.d.ts +2 -0
  32. package/dist/commands/edit.d.ts.map +1 -0
  33. package/dist/commands/edit.js +35 -0
  34. package/dist/commands/edit.js.map +1 -0
  35. package/dist/commands/help.d.ts +2 -0
  36. package/dist/commands/help.d.ts.map +1 -0
  37. package/dist/commands/help.js +26 -0
  38. package/dist/commands/help.js.map +1 -0
  39. package/dist/commands/history.d.ts +12 -0
  40. package/dist/commands/history.d.ts.map +1 -0
  41. package/dist/commands/history.js +317 -0
  42. package/dist/commands/history.js.map +1 -0
  43. package/dist/commands/init.d.ts +2 -0
  44. package/dist/commands/init.d.ts.map +1 -0
  45. package/dist/commands/init.js +137 -0
  46. package/dist/commands/init.js.map +1 -0
  47. package/dist/commands/install.d.ts +16 -0
  48. package/dist/commands/install.d.ts.map +1 -0
  49. package/dist/commands/install.js +263 -0
  50. package/dist/commands/install.js.map +1 -0
  51. package/dist/commands/review.d.ts +3 -0
  52. package/dist/commands/review.d.ts.map +1 -0
  53. package/dist/commands/review.js +160 -0
  54. package/dist/commands/review.js.map +1 -0
  55. package/dist/commands/run.d.ts +32 -0
  56. package/dist/commands/run.d.ts.map +1 -0
  57. package/dist/commands/run.js +367 -0
  58. package/dist/commands/run.js.map +1 -0
  59. package/dist/commands/uninstall.d.ts +2 -0
  60. package/dist/commands/uninstall.d.ts.map +1 -0
  61. package/dist/commands/uninstall.js +45 -0
  62. package/dist/commands/uninstall.js.map +1 -0
  63. package/dist/commands/update.d.ts +2 -0
  64. package/dist/commands/update.d.ts.map +1 -0
  65. package/dist/commands/update.js +113 -0
  66. package/dist/commands/update.js.map +1 -0
  67. package/dist/config/config-manager.d.ts +19 -0
  68. package/dist/config/config-manager.d.ts.map +1 -0
  69. package/dist/config/config-manager.js +221 -0
  70. package/dist/config/config-manager.js.map +1 -0
  71. package/dist/config/global-paths.d.ts +5 -0
  72. package/dist/config/global-paths.d.ts.map +1 -0
  73. package/dist/config/global-paths.js +16 -0
  74. package/dist/config/global-paths.js.map +1 -0
  75. package/dist/config/migration.d.ts +12 -0
  76. package/dist/config/migration.d.ts.map +1 -0
  77. package/dist/config/migration.js +270 -0
  78. package/dist/config/migration.js.map +1 -0
  79. package/dist/history/enhanced-history-manager.d.ts +27 -0
  80. package/dist/history/enhanced-history-manager.d.ts.map +1 -0
  81. package/dist/history/enhanced-history-manager.js +116 -0
  82. package/dist/history/enhanced-history-manager.js.map +1 -0
  83. package/dist/history/history-manager.d.ts +43 -0
  84. package/dist/history/history-manager.d.ts.map +1 -0
  85. package/dist/history/history-manager.js +229 -0
  86. package/dist/history/history-manager.js.map +1 -0
  87. package/dist/index.d.ts +6 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +6 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/prompts/input-types/file-search-prompt.d.ts +11 -0
  92. package/dist/prompts/input-types/file-search-prompt.d.ts.map +1 -0
  93. package/dist/prompts/input-types/file-search-prompt.js +53 -0
  94. package/dist/prompts/input-types/file-search-prompt.js.map +1 -0
  95. package/dist/prompts/input-types/review-file-prompt.d.ts +3 -0
  96. package/dist/prompts/input-types/review-file-prompt.d.ts.map +1 -0
  97. package/dist/prompts/input-types/review-file-prompt.js +9 -0
  98. package/dist/prompts/input-types/review-file-prompt.js.map +1 -0
  99. package/dist/schemas/config-schema.d.ts +1637 -0
  100. package/dist/schemas/config-schema.d.ts.map +1 -0
  101. package/dist/schemas/config-schema.js +136 -0
  102. package/dist/schemas/config-schema.js.map +1 -0
  103. package/dist/search/search-engine.d.ts +8 -0
  104. package/dist/search/search-engine.d.ts.map +1 -0
  105. package/dist/search/search-engine.js +53 -0
  106. package/dist/search/search-engine.js.map +1 -0
  107. package/dist/services/git-service.d.ts +28 -0
  108. package/dist/services/git-service.d.ts.map +1 -0
  109. package/dist/services/git-service.js +157 -0
  110. package/dist/services/git-service.js.map +1 -0
  111. package/dist/services/input-collector.d.ts +9 -0
  112. package/dist/services/input-collector.d.ts.map +1 -0
  113. package/dist/services/input-collector.js +162 -0
  114. package/dist/services/input-collector.js.map +1 -0
  115. package/dist/services/logging-service.d.ts +49 -0
  116. package/dist/services/logging-service.d.ts.map +1 -0
  117. package/dist/services/logging-service.js +203 -0
  118. package/dist/services/logging-service.js.map +1 -0
  119. package/dist/services/module-cache.d.ts +42 -0
  120. package/dist/services/module-cache.d.ts.map +1 -0
  121. package/dist/services/module-cache.js +205 -0
  122. package/dist/services/module-cache.js.map +1 -0
  123. package/dist/services/module-entry-builder.d.ts +20 -0
  124. package/dist/services/module-entry-builder.d.ts.map +1 -0
  125. package/dist/services/module-entry-builder.js +71 -0
  126. package/dist/services/module-entry-builder.js.map +1 -0
  127. package/dist/services/output-capture-service.d.ts +28 -0
  128. package/dist/services/output-capture-service.d.ts.map +1 -0
  129. package/dist/services/output-capture-service.js +348 -0
  130. package/dist/services/output-capture-service.js.map +1 -0
  131. package/dist/services/package-manager.d.ts +18 -0
  132. package/dist/services/package-manager.d.ts.map +1 -0
  133. package/dist/services/package-manager.js +141 -0
  134. package/dist/services/package-manager.js.map +1 -0
  135. package/dist/services/pattern-detector.d.ts +15 -0
  136. package/dist/services/pattern-detector.d.ts.map +1 -0
  137. package/dist/services/pattern-detector.js +228 -0
  138. package/dist/services/pattern-detector.js.map +1 -0
  139. package/dist/services/prompt-resolver.d.ts +32 -0
  140. package/dist/services/prompt-resolver.d.ts.map +1 -0
  141. package/dist/services/prompt-resolver.js +73 -0
  142. package/dist/services/prompt-resolver.js.map +1 -0
  143. package/dist/services/pupt-prompt-source.d.ts +16 -0
  144. package/dist/services/pupt-prompt-source.d.ts.map +1 -0
  145. package/dist/services/pupt-prompt-source.js +74 -0
  146. package/dist/services/pupt-prompt-source.js.map +1 -0
  147. package/dist/services/pupt-service.d.ts +33 -0
  148. package/dist/services/pupt-service.d.ts.map +1 -0
  149. package/dist/services/pupt-service.js +119 -0
  150. package/dist/services/pupt-service.js.map +1 -0
  151. package/dist/services/review-data-builder.d.ts +25 -0
  152. package/dist/services/review-data-builder.d.ts.map +1 -0
  153. package/dist/services/review-data-builder.js +333 -0
  154. package/dist/services/review-data-builder.js.map +1 -0
  155. package/dist/services/suggestion-generator.d.ts +11 -0
  156. package/dist/services/suggestion-generator.d.ts.map +1 -0
  157. package/dist/services/suggestion-generator.js +158 -0
  158. package/dist/services/suggestion-generator.js.map +1 -0
  159. package/dist/services/ui-service.d.ts +49 -0
  160. package/dist/services/ui-service.d.ts.map +1 -0
  161. package/dist/services/ui-service.js +196 -0
  162. package/dist/services/ui-service.js.map +1 -0
  163. package/dist/types/annotations.d.ts +50 -0
  164. package/dist/types/annotations.d.ts.map +1 -0
  165. package/dist/types/annotations.js +2 -0
  166. package/dist/types/annotations.js.map +1 -0
  167. package/dist/types/config.d.ts +110 -0
  168. package/dist/types/config.d.ts.map +1 -0
  169. package/dist/types/config.js +12 -0
  170. package/dist/types/config.js.map +1 -0
  171. package/dist/types/history.d.ts +36 -0
  172. package/dist/types/history.d.ts.map +1 -0
  173. package/dist/types/history.js +2 -0
  174. package/dist/types/history.js.map +1 -0
  175. package/dist/types/patterns.d.ts +25 -0
  176. package/dist/types/patterns.d.ts.map +1 -0
  177. package/dist/types/patterns.js +2 -0
  178. package/dist/types/patterns.js.map +1 -0
  179. package/dist/types/prompt.d.ts +29 -0
  180. package/dist/types/prompt.d.ts.map +1 -0
  181. package/dist/types/prompt.js +24 -0
  182. package/dist/types/prompt.js.map +1 -0
  183. package/dist/types/review.d.ts +81 -0
  184. package/dist/types/review.d.ts.map +1 -0
  185. package/dist/types/review.js +2 -0
  186. package/dist/types/review.js.map +1 -0
  187. package/dist/ui/console-ui.d.ts +30 -0
  188. package/dist/ui/console-ui.d.ts.map +1 -0
  189. package/dist/ui/console-ui.js +88 -0
  190. package/dist/ui/console-ui.js.map +1 -0
  191. package/dist/ui/interactive-search.d.ts +8 -0
  192. package/dist/ui/interactive-search.d.ts.map +1 -0
  193. package/dist/ui/interactive-search.js +29 -0
  194. package/dist/ui/interactive-search.js.map +1 -0
  195. package/dist/utils/annotation-migration.d.ts +12 -0
  196. package/dist/utils/annotation-migration.d.ts.map +1 -0
  197. package/dist/utils/annotation-migration.js +88 -0
  198. package/dist/utils/annotation-migration.js.map +1 -0
  199. package/dist/utils/date-formatter.d.ts +10 -0
  200. package/dist/utils/date-formatter.d.ts.map +1 -0
  201. package/dist/utils/date-formatter.js +46 -0
  202. package/dist/utils/date-formatter.js.map +1 -0
  203. package/dist/utils/editor.d.ts +14 -0
  204. package/dist/utils/editor.d.ts.map +1 -0
  205. package/dist/utils/editor.js +52 -0
  206. package/dist/utils/editor.js.map +1 -0
  207. package/dist/utils/errors.d.ts +58 -0
  208. package/dist/utils/errors.d.ts.map +1 -0
  209. package/dist/utils/errors.js +275 -0
  210. package/dist/utils/errors.js.map +1 -0
  211. package/dist/utils/git-info.d.ts +10 -0
  212. package/dist/utils/git-info.d.ts.map +1 -0
  213. package/dist/utils/git-info.js +44 -0
  214. package/dist/utils/git-info.js.map +1 -0
  215. package/dist/utils/gitignore.d.ts +10 -0
  216. package/dist/utils/gitignore.d.ts.map +1 -0
  217. package/dist/utils/gitignore.js +72 -0
  218. package/dist/utils/gitignore.js.map +1 -0
  219. package/dist/utils/logger.d.ts +39 -0
  220. package/dist/utils/logger.d.ts.map +1 -0
  221. package/dist/utils/logger.js +143 -0
  222. package/dist/utils/logger.js.map +1 -0
  223. package/dist/utils/platform.d.ts +9 -0
  224. package/dist/utils/platform.d.ts.map +1 -0
  225. package/dist/utils/platform.js +45 -0
  226. package/dist/utils/platform.js.map +1 -0
  227. package/dist/utils/project-root.d.ts +22 -0
  228. package/dist/utils/project-root.d.ts.map +1 -0
  229. package/dist/utils/project-root.js +226 -0
  230. package/dist/utils/project-root.js.map +1 -0
  231. package/dist/utils/prompt-dir-resolver.d.ts +5 -0
  232. package/dist/utils/prompt-dir-resolver.d.ts.map +1 -0
  233. package/dist/utils/prompt-dir-resolver.js +25 -0
  234. package/dist/utils/prompt-dir-resolver.js.map +1 -0
  235. package/dist/utils/security.d.ts +5 -0
  236. package/dist/utils/security.d.ts.map +1 -0
  237. package/dist/utils/security.js +57 -0
  238. package/dist/utils/security.js.map +1 -0
  239. package/dist/utils/tool-detection.d.ts +14 -0
  240. package/dist/utils/tool-detection.d.ts.map +1 -0
  241. package/dist/utils/tool-detection.js +43 -0
  242. package/dist/utils/tool-detection.js.map +1 -0
  243. package/package.json +79 -7
  244. package/prompts/prompts/ad-hoc-long.prompt +60 -0
  245. package/prompts/prompts/ad-hoc.prompt +29 -0
  246. package/prompts/prompts/code-review.prompt +99 -0
  247. package/prompts/prompts/debugging-error-message.prompt +81 -0
  248. package/prompts/prompts/fix-github-actions.prompt +62 -0
  249. package/prompts/prompts/fix-test-errors.prompt +73 -0
  250. package/prompts/prompts/git-commit-comment.prompt +61 -0
  251. package/prompts/prompts/implementation-phase.prompt +53 -0
  252. package/prompts/prompts/implementation-plan.prompt +101 -0
  253. package/prompts/prompts/new-feature.prompt +89 -0
  254. package/prompts/prompts/new-project.prompt +9 -0
  255. package/prompts/prompts/one-shot-change.prompt +79 -0
  256. package/prompts/prompts/pupt-prompt-improvement.prompt +270 -0
  257. package/prompts/prompts/simple-test.prompt +8 -0
  258. package/prompts/prompts/update-design.prompt +71 -0
  259. 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
- # @pupt/cli
1
+ [![Build Status](https://github.com/apowers313/pupt/workflows/CI/badge.svg)](https://github.com/apowers313/pupt/actions)
2
+ [![npm version](https://badge.fury.io/js/pupt.svg)](https://www.npmjs.com/package/pupt)
3
+ [![Documentation](https://img.shields.io/badge/docs-view-blue)](https://apowers313.github.io/pupt/)
4
+ [![Coverage Status](https://coveralls.io/repos/github/apowers313/pupt/badge.svg?branch=master)](https://coveralls.io/github/apowers313/pupt?branch=master)
2
5
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
6
+ # PUPT (Powerful Universal Prompt Tool)
4
7
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
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
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
15
+ A powerful CLI tool for managing and using AI prompts with template support, designed to be your faithful prompt companion.
8
16
 
9
- ## Purpose
17
+ ## Features
10
18
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@pupt/cli`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
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
- ## What is OIDC Trusted Publishing?
31
+ ## Quick Start
17
32
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
33
+ ```bash
34
+ # Install globally
35
+ npm install -g pupt
19
36
 
20
- ## Setup Instructions
37
+ # Initialize configuration
38
+ pt init
21
39
 
22
- To properly configure OIDC trusted publishing for this package:
40
+ # Create your first prompt
41
+ pt add
23
42
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
43
+ # Run the tool
44
+ pt
45
+ ```
28
46
 
29
- ## DO NOT USE THIS PACKAGE
47
+ ## Documentation
30
48
 
31
- This package is a placeholder for OIDC configuration only. It:
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
- ## More Information
51
+ **📚 [View Full Documentation](https://apowers313.github.io/pupt/)**
38
52
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
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
- **Maintained for OIDC setup purposes only**
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":["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