liteagents 2.4.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 (215) hide show
  1. package/CHANGELOG.md +441 -0
  2. package/LICENSE +21 -0
  3. package/README.md +179 -0
  4. package/cli.js +230 -0
  5. package/docs/.gitkeep +1 -0
  6. package/docs/CONTRIBUTING.md +739 -0
  7. package/docs/DUAL_PUBLISH_SUMMARY.md +177 -0
  8. package/docs/ERROR_HANDLING_IMPLEMENTATION.md +327 -0
  9. package/docs/GITHUB_PACKAGES.md +181 -0
  10. package/docs/GITHUB_SETUP.md +158 -0
  11. package/docs/INSTALLATION_DEMO.md +691 -0
  12. package/docs/INSTALLATION_LOCATIONS.md +299 -0
  13. package/docs/INSTALLER_GUIDE.md +1586 -0
  14. package/docs/INTEGRATION_ISSUES_9.1.md +341 -0
  15. package/docs/KNOWLEDGE_BASE.md +727 -0
  16. package/docs/MIGRATION.md +384 -0
  17. package/docs/PACKAGE_BASELINE.md +557 -0
  18. package/docs/PACKAGE_VALIDATION_REPORT.md +427 -0
  19. package/docs/PASS_INTEGRATION.md +307 -0
  20. package/docs/PASS_QUICK_START.md +150 -0
  21. package/docs/PRIVACY.md +203 -0
  22. package/docs/PUBLISHING.md +494 -0
  23. package/docs/QUICK-START.md +318 -0
  24. package/docs/RELEASE_NOTES_1.2.0.md +323 -0
  25. package/docs/SECURITY.md +317 -0
  26. package/docs/SILENT_MODE_GUIDE.md +526 -0
  27. package/docs/SKILLS_CONVERSION.md +154 -0
  28. package/docs/TESTING.md +582 -0
  29. package/docs/TEST_COVERAGE.md +347 -0
  30. package/docs/TROUBLESHOOTING.md +788 -0
  31. package/docs/UPDATED_VARIANT_CONFIGURATION.md +274 -0
  32. package/docs/VARIANT_CONFIGURATION.md +440 -0
  33. package/installer/cli.js +761 -0
  34. package/installer/installation-engine.js +1536 -0
  35. package/installer/package-manager.js +640 -0
  36. package/installer/path-manager.js +427 -0
  37. package/installer/report-template.js +298 -0
  38. package/installer/verification-system.js +274 -0
  39. package/package.json +83 -0
  40. package/packages/ampcode/AGENT.md +58 -0
  41. package/packages/ampcode/README.md +17 -0
  42. package/packages/ampcode/agents/1-create-prd.md +175 -0
  43. package/packages/ampcode/agents/2-generate-tasks.md +190 -0
  44. package/packages/ampcode/agents/3-process-task-list.md +225 -0
  45. package/packages/ampcode/agents/code-developer.md +198 -0
  46. package/packages/ampcode/agents/context-builder.md +142 -0
  47. package/packages/ampcode/agents/feature-planner.md +199 -0
  48. package/packages/ampcode/agents/market-researcher.md +89 -0
  49. package/packages/ampcode/agents/orchestrator.md +116 -0
  50. package/packages/ampcode/agents/quality-assurance.md +115 -0
  51. package/packages/ampcode/agents/system-architect.md +135 -0
  52. package/packages/ampcode/agents/ui-designer.md +184 -0
  53. package/packages/ampcode/commands/brainstorming.md +56 -0
  54. package/packages/ampcode/commands/code-review.md +107 -0
  55. package/packages/ampcode/commands/condition-based-waiting/example.ts +158 -0
  56. package/packages/ampcode/commands/condition-based-waiting.md +122 -0
  57. package/packages/ampcode/commands/debug.md +20 -0
  58. package/packages/ampcode/commands/docs-builder/templates.md +572 -0
  59. package/packages/ampcode/commands/docs-builder.md +106 -0
  60. package/packages/ampcode/commands/explain.md +18 -0
  61. package/packages/ampcode/commands/git-commit.md +14 -0
  62. package/packages/ampcode/commands/optimize.md +20 -0
  63. package/packages/ampcode/commands/refactor.md +21 -0
  64. package/packages/ampcode/commands/review.md +18 -0
  65. package/packages/ampcode/commands/root-cause-tracing/find-polluter.sh +63 -0
  66. package/packages/ampcode/commands/root-cause-tracing.md +176 -0
  67. package/packages/ampcode/commands/security.md +21 -0
  68. package/packages/ampcode/commands/ship.md +18 -0
  69. package/packages/ampcode/commands/skill-creator/scripts/init_skill.py +303 -0
  70. package/packages/ampcode/commands/skill-creator/scripts/package_skill.py +110 -0
  71. package/packages/ampcode/commands/skill-creator/scripts/quick_validate.py +65 -0
  72. package/packages/ampcode/commands/skill-creator.md +211 -0
  73. package/packages/ampcode/commands/stash.md +45 -0
  74. package/packages/ampcode/commands/systematic-debugging.md +297 -0
  75. package/packages/ampcode/commands/test-driven-development.md +390 -0
  76. package/packages/ampcode/commands/test-generate.md +18 -0
  77. package/packages/ampcode/commands/testing-anti-patterns.md +304 -0
  78. package/packages/ampcode/commands/verification-before-completion.md +152 -0
  79. package/packages/ampcode/settings.json +13 -0
  80. package/packages/ampcode/variants.json +8 -0
  81. package/packages/claude/CLAUDE.md +58 -0
  82. package/packages/claude/README.md +23 -0
  83. package/packages/claude/agents/1-create-prd.md +175 -0
  84. package/packages/claude/agents/2-generate-tasks.md +190 -0
  85. package/packages/claude/agents/3-process-task-list.md +225 -0
  86. package/packages/claude/agents/code-developer.md +198 -0
  87. package/packages/claude/agents/context-builder.md +142 -0
  88. package/packages/claude/agents/feature-planner.md +199 -0
  89. package/packages/claude/agents/market-researcher.md +89 -0
  90. package/packages/claude/agents/orchestrator.md +117 -0
  91. package/packages/claude/agents/quality-assurance.md +115 -0
  92. package/packages/claude/agents/system-architect.md +135 -0
  93. package/packages/claude/agents/ui-designer.md +184 -0
  94. package/packages/claude/commands/debug.md +20 -0
  95. package/packages/claude/commands/explain.md +18 -0
  96. package/packages/claude/commands/git-commit.md +14 -0
  97. package/packages/claude/commands/optimize.md +20 -0
  98. package/packages/claude/commands/refactor.md +21 -0
  99. package/packages/claude/commands/review.md +18 -0
  100. package/packages/claude/commands/security.md +21 -0
  101. package/packages/claude/commands/ship.md +18 -0
  102. package/packages/claude/commands/stash.md +45 -0
  103. package/packages/claude/commands/test-generate.md +18 -0
  104. package/packages/claude/skills/brainstorming/SKILL.md +56 -0
  105. package/packages/claude/skills/code-review/SKILL.md +107 -0
  106. package/packages/claude/skills/code-review/code-reviewer.md +146 -0
  107. package/packages/claude/skills/condition-based-waiting/SKILL.md +122 -0
  108. package/packages/claude/skills/condition-based-waiting/example.ts +158 -0
  109. package/packages/claude/skills/docs-builder/SKILL.md +106 -0
  110. package/packages/claude/skills/docs-builder/references/templates.md +572 -0
  111. package/packages/claude/skills/root-cause-tracing/SKILL.md +176 -0
  112. package/packages/claude/skills/root-cause-tracing/find-polluter.sh +63 -0
  113. package/packages/claude/skills/skill-creator/LICENSE.txt +202 -0
  114. package/packages/claude/skills/skill-creator/SKILL.md +211 -0
  115. package/packages/claude/skills/skill-creator/scripts/init_skill.py +303 -0
  116. package/packages/claude/skills/skill-creator/scripts/package_skill.py +110 -0
  117. package/packages/claude/skills/skill-creator/scripts/quick_validate.py +65 -0
  118. package/packages/claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  119. package/packages/claude/skills/systematic-debugging/SKILL.md +296 -0
  120. package/packages/claude/skills/systematic-debugging/test-academic.md +14 -0
  121. package/packages/claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  122. package/packages/claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  123. package/packages/claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  124. package/packages/claude/skills/test-driven-development/SKILL.md +392 -0
  125. package/packages/claude/skills/testing-anti-patterns/SKILL.md +304 -0
  126. package/packages/claude/skills/verification-before-completion/SKILL.md +152 -0
  127. package/packages/claude/variants.json +9 -0
  128. package/packages/droid/AGENTS.md +52 -0
  129. package/packages/droid/README.md +17 -0
  130. package/packages/droid/change_settings.json +61 -0
  131. package/packages/droid/commands/brainstorming.md +56 -0
  132. package/packages/droid/commands/code-review.md +107 -0
  133. package/packages/droid/commands/condition-based-waiting/example.ts +158 -0
  134. package/packages/droid/commands/condition-based-waiting.md +122 -0
  135. package/packages/droid/commands/debug.md +20 -0
  136. package/packages/droid/commands/docs-builder/templates.md +572 -0
  137. package/packages/droid/commands/docs-builder.md +106 -0
  138. package/packages/droid/commands/explain.md +18 -0
  139. package/packages/droid/commands/git-commit.md +14 -0
  140. package/packages/droid/commands/optimize.md +20 -0
  141. package/packages/droid/commands/refactor.md +21 -0
  142. package/packages/droid/commands/review.md +18 -0
  143. package/packages/droid/commands/root-cause-tracing/find-polluter.sh +63 -0
  144. package/packages/droid/commands/root-cause-tracing.md +176 -0
  145. package/packages/droid/commands/security.md +21 -0
  146. package/packages/droid/commands/ship.md +18 -0
  147. package/packages/droid/commands/skill-creator/scripts/init_skill.py +303 -0
  148. package/packages/droid/commands/skill-creator/scripts/package_skill.py +110 -0
  149. package/packages/droid/commands/skill-creator/scripts/quick_validate.py +65 -0
  150. package/packages/droid/commands/skill-creator.md +211 -0
  151. package/packages/droid/commands/stash.md +45 -0
  152. package/packages/droid/commands/systematic-debugging.md +297 -0
  153. package/packages/droid/commands/test-driven-development.md +390 -0
  154. package/packages/droid/commands/test-generate.md +18 -0
  155. package/packages/droid/commands/testing-anti-patterns.md +304 -0
  156. package/packages/droid/commands/verification-before-completion.md +152 -0
  157. package/packages/droid/droids/1-create-prd.md +170 -0
  158. package/packages/droid/droids/2-generate-tasks.md +190 -0
  159. package/packages/droid/droids/3-process-task-list.md +225 -0
  160. package/packages/droid/droids/code-developer.md +198 -0
  161. package/packages/droid/droids/context-builder.md +142 -0
  162. package/packages/droid/droids/feature-planner.md +199 -0
  163. package/packages/droid/droids/market-researcher.md +89 -0
  164. package/packages/droid/droids/orchestrator.md +116 -0
  165. package/packages/droid/droids/quality-assurance.md +115 -0
  166. package/packages/droid/droids/system-architect.md +135 -0
  167. package/packages/droid/droids/ui-designer.md +184 -0
  168. package/packages/droid/variants.json +8 -0
  169. package/packages/opencode/AGENTS.md +52 -0
  170. package/packages/opencode/README.md +17 -0
  171. package/packages/opencode/agent/1-create-prd.md +179 -0
  172. package/packages/opencode/agent/2-generate-tasks.md +194 -0
  173. package/packages/opencode/agent/3-process-task-list.md +229 -0
  174. package/packages/opencode/agent/code-developer.md +202 -0
  175. package/packages/opencode/agent/context-builder.md +146 -0
  176. package/packages/opencode/agent/feature-planner.md +203 -0
  177. package/packages/opencode/agent/market-researcher.md +93 -0
  178. package/packages/opencode/agent/orchestrator.md +120 -0
  179. package/packages/opencode/agent/quality-assurance.md +119 -0
  180. package/packages/opencode/agent/system-architect.md +139 -0
  181. package/packages/opencode/agent/ui-designer.md +188 -0
  182. package/packages/opencode/command/brainstorming.md +56 -0
  183. package/packages/opencode/command/code-review.md +107 -0
  184. package/packages/opencode/command/condition-based-waiting/example.ts +158 -0
  185. package/packages/opencode/command/condition-based-waiting.md +122 -0
  186. package/packages/opencode/command/debug.md +20 -0
  187. package/packages/opencode/command/docs-builder/templates.md +572 -0
  188. package/packages/opencode/command/docs-builder.md +106 -0
  189. package/packages/opencode/command/explain.md +18 -0
  190. package/packages/opencode/command/git-commit.md +14 -0
  191. package/packages/opencode/command/optimize.md +20 -0
  192. package/packages/opencode/command/refactor.md +21 -0
  193. package/packages/opencode/command/review.md +18 -0
  194. package/packages/opencode/command/root-cause-tracing/find-polluter.sh +63 -0
  195. package/packages/opencode/command/root-cause-tracing.md +176 -0
  196. package/packages/opencode/command/security.md +21 -0
  197. package/packages/opencode/command/ship.md +18 -0
  198. package/packages/opencode/command/skill-creator/scripts/init_skill.py +303 -0
  199. package/packages/opencode/command/skill-creator/scripts/package_skill.py +110 -0
  200. package/packages/opencode/command/skill-creator/scripts/quick_validate.py +65 -0
  201. package/packages/opencode/command/skill-creator.md +211 -0
  202. package/packages/opencode/command/stash.md +45 -0
  203. package/packages/opencode/command/systematic-debugging.md +297 -0
  204. package/packages/opencode/command/test-driven-development.md +390 -0
  205. package/packages/opencode/command/test-generate.md +18 -0
  206. package/packages/opencode/command/testing-anti-patterns.md +304 -0
  207. package/packages/opencode/command/verification-before-completion.md +152 -0
  208. package/packages/opencode/opencode.jsonc +201 -0
  209. package/packages/opencode/variants.json +8 -0
  210. package/packages/subagentic-manual.md +349 -0
  211. package/postinstall.js +21 -0
  212. package/tools/ampcode/manifest-template.json +14 -0
  213. package/tools/claude/manifest-template.json +14 -0
  214. package/tools/droid/manifest-template.json +14 -0
  215. package/tools/opencode/manifest-template.json +14 -0
@@ -0,0 +1,298 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const os = require('os');
4
+
5
+ /**
6
+ * Report Template Generator
7
+ *
8
+ * Generates detailed installation reports with summary and per-tool details.
9
+ * Reports are saved to ~/.agentflow-install.log after each installation.
10
+ */
11
+ class ReportTemplate {
12
+ constructor() {
13
+ this.reportPath = path.join(os.homedir(), '.agentflow-install.log');
14
+ }
15
+
16
+ /**
17
+ * Generate a comprehensive installation report
18
+ *
19
+ * @param {Object} installationData - Complete installation data
20
+ * @param {string} installationData.variant - Selected variant (lite, standard, pro)
21
+ * @param {Array} installationData.tools - Array of tool installation objects
22
+ * @param {number} installationData.startTime - Installation start timestamp (ms)
23
+ * @param {number} installationData.endTime - Installation end timestamp (ms)
24
+ * @param {boolean} installationData.success - Overall installation success status
25
+ * @param {Array} installationData.errors - Array of error messages
26
+ * @param {Array} installationData.warnings - Array of warning messages
27
+ * @returns {string} Formatted report text
28
+ */
29
+ generateReport(installationData) {
30
+ const {
31
+ variant,
32
+ tools = [],
33
+ startTime,
34
+ endTime,
35
+ success,
36
+ errors = [],
37
+ warnings = []
38
+ } = installationData;
39
+
40
+ const duration = this._formatDuration(endTime - startTime);
41
+ const totalFiles = tools.reduce((sum, tool) => sum + (tool.filesInstalled || 0), 0);
42
+ const totalSize = tools.reduce((sum, tool) => sum + (tool.sizeBytes || 0), 0);
43
+ const formattedSize = this._formatSize(totalSize);
44
+
45
+ let report = '';
46
+
47
+ // Header
48
+ report += this._generateHeader();
49
+
50
+ // Summary Section
51
+ report += this._generateSummary({
52
+ success,
53
+ variant,
54
+ toolCount: tools.length,
55
+ totalFiles,
56
+ totalSize: formattedSize,
57
+ duration,
58
+ errors,
59
+ warnings
60
+ });
61
+
62
+ // Tool Details Section
63
+ if (tools.length > 0) {
64
+ report += this._generateToolDetails(tools);
65
+ }
66
+
67
+ // System Information Section
68
+ report += this._generateSystemInfo();
69
+
70
+ // Errors Section (if any)
71
+ if (errors.length > 0) {
72
+ report += this._generateErrorsSection(errors);
73
+ }
74
+
75
+ // Warnings Section (if any)
76
+ if (warnings.length > 0) {
77
+ report += this._generateWarningsSection(warnings);
78
+ }
79
+
80
+ // Footer
81
+ report += this._generateFooter();
82
+
83
+ return report;
84
+ }
85
+
86
+ /**
87
+ * Save report to file
88
+ *
89
+ * @param {string} reportContent - Generated report content
90
+ * @returns {Promise<string>} Path where report was saved
91
+ */
92
+ async saveReport(reportContent) {
93
+ try {
94
+ await fs.promises.writeFile(this.reportPath, reportContent, 'utf8');
95
+ return this.reportPath;
96
+ } catch (error) {
97
+ throw new Error(`Failed to save report to ${this.reportPath}: ${error.message}`);
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Generate and save installation report
103
+ *
104
+ * @param {Object} installationData - Complete installation data
105
+ * @returns {Promise<string>} Path where report was saved
106
+ */
107
+ async createAndSaveReport(installationData) {
108
+ const reportContent = this.generateReport(installationData);
109
+ const reportPath = await this.saveReport(reportContent);
110
+ return reportPath;
111
+ }
112
+
113
+ /**
114
+ * Get report file path
115
+ *
116
+ * @returns {string} Path to report file
117
+ */
118
+ getReportPath() {
119
+ return this.reportPath;
120
+ }
121
+
122
+ // Private helper methods
123
+
124
+ _generateHeader() {
125
+ const timestamp = new Date().toISOString();
126
+ return `
127
+ ╔════════════════════════════════════════════════════════════════╗
128
+ ║ AGENTIC-KIT INSTALLATION REPORT ║
129
+ ╚════════════════════════════════════════════════════════════════╝
130
+
131
+ Generated: ${timestamp}
132
+
133
+ `;
134
+ }
135
+
136
+ _generateSummary(summary) {
137
+ const {
138
+ success,
139
+ variant,
140
+ toolCount,
141
+ totalFiles,
142
+ totalSize,
143
+ duration,
144
+ errors,
145
+ warnings
146
+ } = summary;
147
+
148
+ const statusIcon = success ? '✓' : '✗';
149
+ const statusText = success ? 'SUCCESS' : 'FAILED';
150
+ const statusLine = `${statusIcon} Installation Status: ${statusText}`;
151
+
152
+ return `
153
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
154
+ SUMMARY
155
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
156
+
157
+ ${statusLine}
158
+
159
+ Package Variant: ${variant || 'N/A'}
160
+ Tools Installed: ${toolCount}
161
+ Total Files: ${totalFiles}
162
+ Total Size: ${totalSize}
163
+ Installation Time: ${duration}
164
+ Errors: ${errors.length}
165
+ Warnings: ${warnings.length}
166
+
167
+ `;
168
+ }
169
+
170
+ _generateToolDetails(tools) {
171
+ let section = `
172
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
173
+ TOOL DETAILS
174
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
175
+
176
+ `;
177
+
178
+ tools.forEach((tool, index) => {
179
+ const {
180
+ toolId,
181
+ path: toolPath,
182
+ filesInstalled,
183
+ sizeBytes,
184
+ components = {},
185
+ verified,
186
+ verificationStatus,
187
+ manifestPath
188
+ } = tool;
189
+
190
+ const formattedSize = this._formatSize(sizeBytes || 0);
191
+ const verificationIcon = verified ? '✓' : '✗';
192
+ const verificationText = verified ? 'VERIFIED' : 'VERIFICATION FAILED';
193
+
194
+ section += `
195
+ ${index + 1}. ${toolId.toUpperCase()}
196
+ ├─ Installation Path: ${toolPath}
197
+ ├─ Files Installed: ${filesInstalled || 0}
198
+ ├─ Size: ${formattedSize}
199
+ ├─ Components:
200
+ │ ├─ Agents: ${components.agents || 0}
201
+ │ ├─ Skills: ${components.skills || 0}
202
+ │ ├─ Resources: ${components.resources || 0}
203
+ │ └─ Hooks: ${components.hooks || 0}
204
+ ├─ Verification: ${verificationIcon} ${verificationText}`;
205
+
206
+ if (verificationStatus) {
207
+ section += `
208
+ │ └─ Details: ${verificationStatus}`;
209
+ }
210
+
211
+ section += `
212
+ └─ Manifest: ${manifestPath || 'N/A'}
213
+ `;
214
+ });
215
+
216
+ return section;
217
+ }
218
+
219
+ _generateSystemInfo() {
220
+ return `
221
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
222
+ SYSTEM INFORMATION
223
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
224
+
225
+ Node.js Version: ${process.version}
226
+ Platform: ${process.platform}
227
+ Architecture: ${process.arch}
228
+ Operating System: ${os.type()} ${os.release()}
229
+ Home Directory: ${os.homedir()}
230
+
231
+ `;
232
+ }
233
+
234
+ _generateErrorsSection(errors) {
235
+ let section = `
236
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
237
+ ERRORS
238
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
239
+
240
+ `;
241
+
242
+ errors.forEach((error, index) => {
243
+ section += `${index + 1}. ${error}\n`;
244
+ });
245
+
246
+ section += '\n';
247
+ return section;
248
+ }
249
+
250
+ _generateWarningsSection(warnings) {
251
+ let section = `
252
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
253
+ WARNINGS
254
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
255
+
256
+ `;
257
+
258
+ warnings.forEach((warning, index) => {
259
+ section += `${index + 1}. ${warning}\n`;
260
+ });
261
+
262
+ section += '\n';
263
+ return section;
264
+ }
265
+
266
+ _generateFooter() {
267
+ return `
268
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
269
+
270
+ For support and documentation, visit:
271
+ https://github.com/amrhas82/agentflow
272
+
273
+ Report saved to: ${this.reportPath}
274
+
275
+ `;
276
+ }
277
+
278
+ _formatDuration(milliseconds) {
279
+ const seconds = Math.floor(milliseconds / 1000);
280
+ const minutes = Math.floor(seconds / 60);
281
+ const remainingSeconds = seconds % 60;
282
+
283
+ if (minutes > 0) {
284
+ return `${minutes}m ${remainingSeconds}s`;
285
+ }
286
+ return `${seconds}s`;
287
+ }
288
+
289
+ _formatSize(bytes) {
290
+ if (bytes === 0) return '0 B';
291
+ if (bytes < 1024) return `${bytes} B`;
292
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(2)} KB`;
293
+ if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;
294
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
295
+ }
296
+ }
297
+
298
+ module.exports = ReportTemplate;
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Verification System for Agentic Kit Installer
3
+ *
4
+ * Validates installations, checks dependencies, and ensures system integrity
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ class VerificationSystem {
11
+ constructor(pathManager, packageManager) {
12
+ this.pathManager = pathManager;
13
+ this.packageManager = packageManager;
14
+ this.verificationResults = [];
15
+ }
16
+
17
+ /**
18
+ * Verify complete installation
19
+ */
20
+ async verifyInstallation(toolId, variant, targetPath) {
21
+ const result = {
22
+ tool: toolId,
23
+ variant,
24
+ targetPath,
25
+ valid: true,
26
+ errors: [],
27
+ warnings: [],
28
+ checks: {}
29
+ };
30
+
31
+ try {
32
+ // Check manifest exists and is valid
33
+ result.checks.manifest = await this.verifyManifest(targetPath);
34
+ if (!result.checks.manifest.valid) {
35
+ result.valid = false;
36
+ result.errors.push(`Manifest: ${result.checks.manifest.error}`);
37
+ }
38
+
39
+ // Check directory structure
40
+ result.checks.structure = await this.verifyDirectoryStructure(targetPath);
41
+ if (!result.checks.structure.valid) {
42
+ result.valid = false;
43
+ result.errors.push(`Structure: ${result.checks.structure.error}`);
44
+ }
45
+
46
+ // Check file integrity
47
+ result.checks.files = await this.verifyFileIntegrity(toolId, variant, targetPath);
48
+ if (!result.checks.files.valid) {
49
+ result.valid = false;
50
+ result.errors.push(`Files: ${result.checks.files.error}`);
51
+ }
52
+
53
+ // Check permissions
54
+ result.checks.permissions = await this.verifyPermissions(targetPath);
55
+ if (!result.checks.permissions.valid) {
56
+ result.warnings.push(`Permissions: ${result.checks.permissions.error}`);
57
+ }
58
+
59
+ // Check tool compatibility
60
+ result.checks.compatibility = await this.verifyToolCompatibility(toolId, targetPath);
61
+ if (!result.checks.compatibility.valid) {
62
+ result.warnings.push(`Compatibility: ${result.checks.compatibility.error}`);
63
+ }
64
+
65
+ } catch (error) {
66
+ result.valid = false;
67
+ result.errors.push(`Verification error: ${error.message}`);
68
+ }
69
+
70
+ this.verificationResults.push(result);
71
+ return result;
72
+ }
73
+
74
+ /**
75
+ * Verify manifest file
76
+ */
77
+ async verifyManifest(targetPath) {
78
+ const manifestPath = path.join(targetPath, 'manifest.json');
79
+
80
+ try {
81
+ if (!fs.existsSync(manifestPath)) {
82
+ return { valid: false, error: 'Manifest file not found' };
83
+ }
84
+
85
+ const manifest = JSON.parse(await fs.promises.readFile(manifestPath, 'utf8'));
86
+
87
+ // Required fields
88
+ const requiredFields = ['tool', 'variant', 'version', 'installed_at', 'components'];
89
+ for (const field of requiredFields) {
90
+ if (!manifest[field]) {
91
+ return { valid: false, error: `Missing required field: ${field}` };
92
+ }
93
+ }
94
+
95
+ // Validate components
96
+ if (typeof manifest.components !== 'object') {
97
+ return { valid: false, error: 'Invalid components format' };
98
+ }
99
+
100
+ return { valid: true, manifest };
101
+
102
+ } catch (error) {
103
+ return { valid: false, error: `Manifest parsing error: ${error.message}` };
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Verify directory structure
109
+ */
110
+ async verifyDirectoryStructure(targetPath) {
111
+ const requiredDirs = ['agents'];
112
+ const optionalDirs = ['skills', 'resources', 'hooks'];
113
+
114
+ try {
115
+ // Check target directory exists
116
+ if (!fs.existsSync(targetPath)) {
117
+ return { valid: false, error: 'Target directory not found' };
118
+ }
119
+
120
+ // Check required directories
121
+ for (const dir of requiredDirs) {
122
+ const dirPath = path.join(targetPath, dir);
123
+ if (!fs.existsSync(dirPath)) {
124
+ return { valid: false, error: `Required directory missing: ${dir}` };
125
+ }
126
+ }
127
+
128
+ // Check agents directory has content
129
+ const agentsDir = path.join(targetPath, 'agents');
130
+ const agentFiles = await fs.promises.readdir(agentsDir);
131
+
132
+ if (agentFiles.length === 0) {
133
+ return { valid: false, error: 'Agents directory is empty' };
134
+ }
135
+
136
+ return { valid: true };
137
+
138
+ } catch (error) {
139
+ return { valid: false, error: `Structure check error: ${error.message}` };
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Verify file integrity
145
+ */
146
+ async verifyFileIntegrity(toolId, variant, targetPath) {
147
+ try {
148
+ const expectedContents = await this.packageManager.getPackageContents(toolId, variant);
149
+ const actualContents = await this.countFilesInDirectory(targetPath);
150
+
151
+ // Check if we have approximately the right number of files
152
+ const tolerance = 5; // Allow some variance for manifest files
153
+ if (Math.abs(actualContents.total - expectedContents.totalFiles) > tolerance) {
154
+ return {
155
+ valid: false,
156
+ error: `File count mismatch: expected ~${expectedContents.totalFiles}, found ${actualContents.total}`
157
+ };
158
+ }
159
+
160
+ return { valid: true };
161
+
162
+ } catch (error) {
163
+ return { valid: false, error: `File integrity error: ${error.message}` };
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Verify file permissions
169
+ */
170
+ async verifyPermissions(targetPath) {
171
+ try {
172
+ // Test read access
173
+ await fs.promises.access(targetPath, fs.constants.R_OK);
174
+
175
+ // Test write access
176
+ await fs.promises.access(targetPath, fs.constants.W_OK);
177
+
178
+ // Test file creation in target directory
179
+ const testFile = path.join(targetPath, '.permission-test');
180
+ await fs.promises.writeFile(testFile, 'test');
181
+ await fs.promises.unlink(testFile);
182
+
183
+ return { valid: true };
184
+
185
+ } catch (error) {
186
+ return { valid: false, error: `Permission error: ${error.message}` };
187
+ }
188
+ }
189
+
190
+ /**
191
+ * Verify tool compatibility
192
+ */
193
+ async verifyToolCompatibility(toolId, targetPath) {
194
+ try {
195
+ const manifestPath = path.join(targetPath, 'manifest.json');
196
+ const manifest = JSON.parse(await fs.promises.readFile(manifestPath, 'utf8'));
197
+
198
+ // Check if manifest tool matches expected tool
199
+ if (manifest.tool !== toolId) {
200
+ return {
201
+ valid: false,
202
+ error: `Tool mismatch: expected ${toolId}, found ${manifest.tool}`
203
+ };
204
+ }
205
+
206
+ // Check optimization settings
207
+ if (!manifest.optimization) {
208
+ return {
209
+ valid: false,
210
+ error: 'Missing optimization settings'
211
+ };
212
+ }
213
+
214
+ return { valid: true };
215
+
216
+ } catch (error) {
217
+ return { valid: false, error: `Compatibility check error: ${error.message}` };
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Count files in directory recursively
223
+ */
224
+ async countFilesInDirectory(dir) {
225
+ let total = 0;
226
+
227
+ async function traverse(currentDir) {
228
+ const items = await fs.promises.readdir(currentDir);
229
+
230
+ for (const item of items) {
231
+ const itemPath = path.join(currentDir, item);
232
+ const stat = await fs.promises.stat(itemPath);
233
+
234
+ if (stat.isDirectory()) {
235
+ await traverse(itemPath);
236
+ } else {
237
+ total++;
238
+ }
239
+ }
240
+ }
241
+
242
+ await traverse(dir);
243
+ return { total };
244
+ }
245
+
246
+ /**
247
+ * Generate verification report
248
+ */
249
+ generateReport() {
250
+ const valid = this.verificationResults.every(r => r.valid);
251
+ const totalErrors = this.verificationResults.reduce((sum, r) => sum + r.errors.length, 0);
252
+ const totalWarnings = this.verificationResults.reduce((sum, r) => sum + r.warnings.length, 0);
253
+
254
+ return {
255
+ valid,
256
+ summary: {
257
+ totalInstallations: this.verificationResults.length,
258
+ validInstallations: this.verificationResults.filter(r => r.valid).length,
259
+ totalErrors,
260
+ totalWarnings
261
+ },
262
+ details: this.verificationResults
263
+ };
264
+ }
265
+
266
+ /**
267
+ * Clear verification results
268
+ */
269
+ clearResults() {
270
+ this.verificationResults = [];
271
+ }
272
+ }
273
+
274
+ module.exports = VerificationSystem;
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "liteagents",
3
+ "version": "2.4.0",
4
+ "description": "AI development toolkit with 11 specialized agents and 20 commands. Simple one-question installer for Claude, Opencode, Ampcode, and Droid.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "agentflow": "./installer/cli.js",
8
+ "agflow": "./cli.js"
9
+ },
10
+ "scripts": {
11
+ "test": "node tests/run-all-tests.js",
12
+ "test-installer": "node tests/installer/integration.test.js",
13
+ "install-interactive": "node installer/cli.js",
14
+ "uninstall-tool": "node installer/cli.js --uninstall",
15
+ "clean": "rm -rf tests/tmp/ && echo 'Cleaned test artifacts'",
16
+ "clean:git": "git clean -fdx tests/tmp/",
17
+ "validate": "node ./scripts/validate-package.js",
18
+ "validate-packages": "node scripts/validate-all-packages.js",
19
+ "prepublishOnly": "npm run clean && npm run validate",
20
+ "publish:npm": "npm publish --registry https://registry.npmjs.org --access public",
21
+ "publish:github": "npm publish --registry https://npm.pkg.github.com",
22
+ "publish:both": "npm run publish:npm && npm run publish:github",
23
+ "postinstall": "node postinstall.js"
24
+ },
25
+ "keywords": [
26
+ "claude",
27
+ "claude-code",
28
+ "opencode",
29
+ "ampcode",
30
+ "droid",
31
+ "plugin",
32
+ "installer",
33
+ "interactive-installer",
34
+ "multi-tool",
35
+ "ai-agents",
36
+ "software-development",
37
+ "agile",
38
+ "scrum",
39
+ "product-management",
40
+ "development-tools",
41
+ "workflow-automation",
42
+ "pdf",
43
+ "docx",
44
+ "xlsx",
45
+ "pptx",
46
+ "document-generation",
47
+ "cli",
48
+ "variant-system"
49
+ ],
50
+ "author": "amrhas82 <avoidaccess@msn.com>",
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/amrhas82/agentflow.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/amrhas82/agentflow/issues"
58
+ },
59
+ "homepage": "https://github.com/amrhas82/agentflow#readme",
60
+ "publishConfig": {
61
+ "registry": "https://registry.npmjs.org",
62
+ "access": "public"
63
+ },
64
+ "engines": {
65
+ "node": ">=14.0.0"
66
+ },
67
+ "files": [
68
+ "installer/",
69
+ "packages/",
70
+ "tools/",
71
+ "docs/",
72
+ "cli.js",
73
+ "index.js",
74
+ "postinstall.js",
75
+ "README.md",
76
+ "QUICK-START.md",
77
+ "TROUBLESHOOTING.md",
78
+ "CHANGELOG.md",
79
+ "LICENSE"
80
+ ],
81
+ "dependencies": {},
82
+ "devDependencies": {}
83
+ }