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,177 @@
1
+ # Dual Publishing Setup Complete ✅
2
+
3
+ Your Agentic Kit package is now configured to publish to **both npm.js and GitHub Packages** with every update!
4
+
5
+ ---
6
+
7
+ ## ✅ What Was Configured
8
+
9
+ ### 1. Package Configuration (`package.json`)
10
+ - Default registry set to npm.js (easier for users)
11
+ - Added publishing scripts:
12
+ - `npm run publish:npm` - Publish to npm.js only
13
+ - `npm run publish:github` - Publish to GitHub Packages only
14
+ - `npm run publish:both` - **Publish to BOTH** (recommended)
15
+
16
+ ### 2. Authentication (`.npmrc`)
17
+ - GitHub Packages authentication ready
18
+ - Uses `GITHUB_TOKEN` environment variable
19
+
20
+ ### 3. Publishing Script (`publish.sh`)
21
+ - Automated script that validates and publishes to both registries
22
+ - Handles missing GitHub token gracefully
23
+
24
+ ### 4. Documentation
25
+ - **`docs/PUBLISHING.md`** - Complete merged guide for all publishing
26
+ - **`docs/GITHUB_SETUP.md`** - First-time GitHub Packages setup
27
+ - **Deleted:** `docs/GITHUB_PACKAGES.md` (merged into PUBLISHING.md)
28
+
29
+ ---
30
+
31
+ ## 🚀 Quick Start - Publish to Both Registries
32
+
33
+ ### First Time Only: Setup GitHub Packages
34
+
35
+ 1. **Create GitHub Token:**
36
+ - Visit: https://github.com/settings/tokens
37
+ - Click "Generate new token (classic)"
38
+ - Select scopes: `write:packages`, `read:packages`
39
+ - Copy token (starts with `ghp_`)
40
+
41
+ 2. **Set Environment Variable:**
42
+ ```bash
43
+ export GITHUB_TOKEN=ghp_your_token_here
44
+
45
+ # Make it permanent (add to ~/.bashrc or ~/.zshrc)
46
+ echo 'export GITHUB_TOKEN=ghp_your_token_here' >> ~/.bashrc
47
+ source ~/.bashrc
48
+ ```
49
+
50
+ 3. **Verify:**
51
+ ```bash
52
+ echo $GITHUB_TOKEN # Should show your token
53
+ ```
54
+
55
+ **See full setup guide:** [`docs/GITHUB_SETUP.md`](docs/GITHUB_SETUP.md)
56
+
57
+ ---
58
+
59
+ ## 📦 Publishing Workflow
60
+
61
+ ### Option 1: Use the Script (Easiest)
62
+
63
+ ```bash
64
+ cd /home/hamr/PycharmProjects/agentflow
65
+ ./publish.sh
66
+ ```
67
+
68
+ ### Option 2: Use npm Scripts
69
+
70
+ ```bash
71
+ # Publish to both registries
72
+ npm run publish:both
73
+
74
+ # Or publish individually
75
+ npm run publish:npm # npm.js only
76
+ npm run publish:github # GitHub Packages only
77
+ ```
78
+
79
+ ### Complete Release Process
80
+
81
+ ```bash
82
+ # 1. Update version
83
+ ./UPDATE_VERSION.sh 1.2.0
84
+
85
+ # 2. Update CHANGELOG.md
86
+ # (Add your release notes)
87
+
88
+ # 3. Commit and tag
89
+ git add .
90
+ git commit -m "Bump version to 1.2.0"
91
+ git tag v1.2.0
92
+ git push origin main --tags
93
+
94
+ # 4. Publish to both registries
95
+ npm run publish:both
96
+
97
+ # 5. Verify
98
+ # - npm.js: https://www.npmjs.com/package/agentflow
99
+ # - GitHub: https://github.com/amrhas82/agentflow/packages
100
+ ```
101
+
102
+ ---
103
+
104
+ ## 📋 Files Modified/Created
105
+
106
+ ### Modified:
107
+ - ✅ `package.json` - Added publish scripts, set npm.js as default
108
+ - ✅ `.npmrc` - GitHub Packages authentication
109
+ - ✅ `docs/PUBLISHING.md` - Merged and updated complete guide
110
+
111
+ ### Created:
112
+ - ✅ `publish.sh` - Automated dual publishing script
113
+ - ✅ `docs/GITHUB_SETUP.md` - First-time setup guide
114
+ - ✅ `.gitignore` - Prevents committing sensitive/backup files
115
+
116
+ ### Deleted:
117
+ - ✅ `docs/GITHUB_PACKAGES.md` - Merged into PUBLISHING.md
118
+
119
+ ---
120
+
121
+ ## 🔍 Verification After Publishing
122
+
123
+ ### npm.js
124
+ - **Page:** https://www.npmjs.com/package/agentflow
125
+ - **Test:** `npx agentflow --help`
126
+
127
+ ### GitHub Packages
128
+ - **Page:** https://github.com/amrhas82/agentflow (click "Packages" on right)
129
+ - **Direct:** https://github.com/amrhas82/agentflow/packages
130
+
131
+ ---
132
+
133
+ ## ❓ Common Questions
134
+
135
+ ### Q: Do I need to publish to both every time?
136
+ **A:** Yes, each registry is separate. Use `npm run publish:both` to publish everywhere with one command.
137
+
138
+ ### Q: What if I only want to publish to npm.js?
139
+ **A:** Just use `npm run publish:npm` or regular `npm publish --access public`
140
+
141
+ ### Q: What if my GitHub token expires?
142
+ **A:** Generate a new token at https://github.com/settings/tokens and update your `GITHUB_TOKEN` variable.
143
+
144
+ ### Q: Can users install from either registry?
145
+ **A:** Yes! npm.js is easier (no token required). GitHub Packages requires users to set up `.npmrc` with their own GitHub token.
146
+
147
+ ---
148
+
149
+ ## 📚 Full Documentation
150
+
151
+ - **Publishing Guide:** [`docs/PUBLISHING.md`](PUBLISHING.md)
152
+ - **GitHub Setup:** [`docs/GITHUB_SETUP.md`](docs/GITHUB_SETUP.md)
153
+ - **Version Management:** Use `./UPDATE_VERSION.sh`
154
+
155
+ ---
156
+
157
+ ## 🎯 Next Steps
158
+
159
+ 1. **Setup GitHub Token** (if not done yet)
160
+ - Follow: [`docs/GITHUB_SETUP.md`](docs/GITHUB_SETUP.md)
161
+
162
+ 2. **Test Publishing**
163
+ ```bash
164
+ npm run publish:both
165
+ ```
166
+
167
+ 3. **Verify Both Registries**
168
+ - Check npm.js and GitHub Packages pages
169
+
170
+ ---
171
+
172
+ **You're all set! 🎉**
173
+
174
+ Every time you want to publish an update, just run:
175
+ ```bash
176
+ npm run publish:both
177
+ ```
@@ -0,0 +1,327 @@
1
+ # Error Handling and Rollback Implementation
2
+
3
+ **Status:** ✓ Complete
4
+ **Subtask:** 4.6 - Comprehensive error handling and rollback options
5
+ **Date:** 2025-11-03
6
+
7
+ ## Overview
8
+
9
+ Implemented comprehensive error handling and rollback functionality for the Interactive CLI Installer, ensuring the system never leaves installations in an inconsistent state and provides clear, actionable guidance for all error scenarios.
10
+
11
+ ## Implementation Summary
12
+
13
+ ### 1. Error Categorization System
14
+
15
+ **Location:** `installer/cli.js` (lines 146-259)
16
+
17
+ Implemented `categorizeError()` method that identifies and categorizes errors into 7+ distinct types:
18
+
19
+ 1. **Permission Errors** (EACCES, EPERM)
20
+ - Suggests using sudo or alternative paths
21
+ - Provides directory permission check commands
22
+
23
+ 2. **Disk Space Errors** (ENOSPC)
24
+ - Shows disk space check commands (df -h)
25
+ - Suggests cleanup and alternative locations
26
+ - Notes 50MB minimum requirement
27
+
28
+ 3. **Network Errors** (ENOTFOUND, ETIMEDOUT)
29
+ - Suggests checking connection
30
+ - Mentions proxy settings for corporate environments
31
+ - Recommends offline mode if available
32
+
33
+ 4. **Missing Package Errors** (ENOENT)
34
+ - Suggests reinstalling agentflow
35
+ - Provides npm commands for reinstallation
36
+ - Verifies package directory existence
37
+
38
+ 5. **Path Validation Errors**
39
+ - Explains absolute path requirement
40
+ - Checks parent directory existence
41
+ - Validates write permissions
42
+
43
+ 6. **Invalid Input Errors**
44
+ - Reviews required selections
45
+ - Validates tool selection (minimum 1)
46
+ - Checks path format requirements
47
+
48
+ 7. **Installation Errors**
49
+ - Checks disk space and permissions
50
+ - Suggests alternative locations
51
+ - References installation log
52
+
53
+ 8. **Unknown Errors**
54
+ - Suggests retry
55
+ - Provides issue reporting link
56
+ - Requests system information
57
+
58
+ Each error category provides:
59
+ - **Error Type:** Clear categorization
60
+ - **Actionable Advice:** 3-5 specific steps to resolve
61
+ - **Technical Details:** Error codes and debugging information
62
+
63
+ ### 2. Fatal Error Handler
64
+
65
+ **Location:** `installer/cli.js` (lines 110-138)
66
+
67
+ Implemented `handleFatalError()` method that:
68
+ - Catches all top-level errors in the run() method
69
+ - Categorizes errors using categorizeError()
70
+ - Displays formatted error information:
71
+ - Error type with color coding
72
+ - Original error message
73
+ - Numbered list of actionable advice
74
+ - Technical details for debugging
75
+ - Exits with proper error code (1)
76
+
77
+ ### 3. Pre-Installation Validation
78
+
79
+ **Location:** `installer/cli.js` (lines 705-826)
80
+
81
+ Implemented `performPreInstallationChecks()` method that validates:
82
+
83
+ **Environment Checks:**
84
+ - Node.js version (requires 14+)
85
+ - Package validity for all selected tools
86
+ - Variants.json existence and validity
87
+
88
+ **Path Validation:**
89
+ - Parent directory existence and write permissions
90
+ - Grandparent directory for non-existent parents
91
+ - Existing installation detection with backup warnings
92
+ - Conflicting installations (different tool in same path)
93
+
94
+ **Resource Checks:**
95
+ - Available disk space calculation
96
+ - 50% buffer requirement (1.5x package size)
97
+ - Low disk space warnings (< 2x package size)
98
+ - Platform-specific disk space checking
99
+
100
+ **Results:**
101
+ - Returns `{success, errors[], warnings[]}`
102
+ - Blocks installation if errors present
103
+ - Prompts user confirmation for warnings
104
+ - Displays all issues before installation starts
105
+
106
+ ### 4. Recovery Options
107
+
108
+ **Location:** `installer/cli.js` (lines 270-304)
109
+
110
+ Implemented `offerRecoveryOptions()` method for multi-tool installations:
111
+
112
+ **When Triggered:**
113
+ - Installation fails for one tool in multi-tool installation
114
+ - Remaining tools still need installation
115
+
116
+ **Options Provided:**
117
+ - **Continue (C):** Proceed with remaining tools (default)
118
+ - **Quit (Q):** Stop installation, keep successful installations
119
+
120
+ **Display:**
121
+ - Failed tool name
122
+ - Remaining tool count
123
+ - Automatic rollback confirmation
124
+ - No partial installations guarantee
125
+ - Input validation with retry
126
+
127
+ ### 5. Enhanced Error Display
128
+
129
+ **Location:** `installer/cli.js` (lines 787-825, 947-959)
130
+
131
+ **During Installation:**
132
+ - Categorizes each installation error
133
+ - Displays error type prominently
134
+ - Shows top 3 actionable advice items
135
+ - Tracks error type in failed installations array
136
+
137
+ **Post-Installation Summary:**
138
+ - Lists failed installations with error types
139
+ - Confirms automatic rollback completion
140
+ - Guarantees no partial installations
141
+ - Suggests retry for failed tools (if partial success)
142
+
143
+ ### 6. Automatic Rollback
144
+
145
+ **Integration:** Leverages existing InstallationEngine rollback
146
+
147
+ **Features:**
148
+ - Triggered automatically on any installation failure
149
+ - Uses session log for file-granular rollback
150
+ - Removes all installed files
151
+ - Cleans up empty directories
152
+ - Preserves user-created files
153
+ - Never leaves partial installations
154
+
155
+ **Rollback Log:**
156
+ - Tracks all removed files
157
+ - Records any errors during rollback
158
+ - Available via getRollbackLog()
159
+
160
+ ## Testing
161
+
162
+ ### Test Coverage
163
+
164
+ **test-error-handling.js** - 17 tests, all passing:
165
+
166
+ 1. Error Categorization (8 tests)
167
+ - Permission errors (EACCES/EPERM)
168
+ - Disk space errors (ENOSPC)
169
+ - Network errors (ETIMEDOUT/ENOTFOUND)
170
+ - Missing package errors (ENOENT)
171
+ - Invalid input errors
172
+ - Path validation errors
173
+ - Installation errors
174
+ - Unknown errors
175
+
176
+ 2. Pre-Installation Checks (6 tests)
177
+ - Valid setup passes
178
+ - Invalid tool detection
179
+ - Invalid path detection
180
+ - Existing installation warnings
181
+ - Node version validation
182
+ - Comprehensive result structure
183
+
184
+ 3. Error Handling Integration (3 tests)
185
+ - handleFatalError includes error type
186
+ - Actionable advice validation
187
+ - Distinct advice per error type
188
+
189
+ ### Demo Script
190
+
191
+ **demo-error-handling.js:**
192
+ - Showcases 7 error scenarios
193
+ - Demonstrates categorization for each
194
+ - Shows actionable advice
195
+ - Displays technical details
196
+ - Color-coded output
197
+
198
+ ### Integration Tests
199
+
200
+ All existing tests pass:
201
+ - **41/41** installation-engine tests
202
+ - **27/27** integration tests
203
+ - **44/44** package-manager tests
204
+ - **17/17** error handling tests
205
+
206
+ **Total:** 129/129 tests passing
207
+
208
+ ## User Experience Improvements
209
+
210
+ ### Before Installation
211
+ - Pre-flight checks catch issues early
212
+ - Clear validation results
213
+ - Warning prompts with continue/cancel
214
+ - No surprises during installation
215
+
216
+ ### During Installation
217
+ - Categorized error messages
218
+ - Actionable advice for each error
219
+ - Recovery options for partial failures
220
+ - Automatic rollback confirmation
221
+
222
+ ### After Failure
223
+ - Clear error type identification
224
+ - Specific resolution steps
225
+ - No cleanup required (automatic rollback)
226
+ - Retry guidance
227
+
228
+ ### Error Message Quality
229
+ - User-friendly language
230
+ - Specific commands to run
231
+ - Platform-appropriate suggestions
232
+ - Links to documentation/support
233
+
234
+ ## Error Scenarios Handled
235
+
236
+ ### Common User Errors
237
+ - ✓ Wrong directory selection
238
+ - ✓ Missing permissions
239
+ - ✓ Insufficient disk space
240
+ - ✓ Invalid tool names
241
+ - ✓ Relative paths instead of absolute
242
+
243
+ ### System Issues
244
+ - ✓ Missing packages
245
+ - ✓ Corrupted installations
246
+ - ✓ Permission restrictions
247
+ - ✓ Disk full
248
+ - ✓ Platform incompatibilities
249
+
250
+ ### Network Issues (Future)
251
+ - ✓ Connection timeouts
252
+ - ✓ Download failures
253
+ - ✓ Proxy problems
254
+
255
+ ### Unexpected Errors
256
+ - ✓ Unknown errors with issue reporting
257
+ - ✓ Stack traces for debugging
258
+ - ✓ System information requests
259
+
260
+ ## System Guarantees
261
+
262
+ ### Consistency
263
+ 1. **Never partial installations:** All failures trigger immediate rollback
264
+ 2. **Clean state:** No orphaned files or directories
265
+ 3. **User files preserved:** Only installed files removed
266
+ 4. **Atomic operations:** All-or-nothing per tool
267
+
268
+ ### User Guidance
269
+ 1. **Every error categorized:** No generic "Error" messages
270
+ 2. **Actionable advice:** Specific steps to resolve
271
+ 3. **Technical details:** Enough info for debugging
272
+ 4. **Recovery options:** Continue or quit for multi-tool
273
+
274
+ ### Reliability
275
+ 1. **Pre-flight checks:** Catch issues before starting
276
+ 2. **Validation at each step:** Path, package, permissions
277
+ 3. **Automatic rollback:** No manual cleanup needed
278
+ 4. **Comprehensive logging:** All actions recorded
279
+
280
+ ## Code Quality
281
+
282
+ ### Maintainability
283
+ - Clear method names (categorizeError, handleFatalError)
284
+ - Comprehensive inline documentation
285
+ - Consistent error structure
286
+ - Reusable error categorization
287
+
288
+ ### Extensibility
289
+ - Easy to add new error types
290
+ - Centralized error handling
291
+ - Consistent advice format
292
+ - Pluggable validation checks
293
+
294
+ ### Testing
295
+ - 100% test coverage for error handling
296
+ - Unit tests for each error type
297
+ - Integration tests for full flows
298
+ - Demo scripts for visual validation
299
+
300
+ ## Future Enhancements
301
+
302
+ ### Potential Improvements
303
+ 1. **Telemetry:** Track common error types (opt-in)
304
+ 2. **Auto-retry:** Retry failed operations automatically
305
+ 3. **Detailed logs:** Save full error context to log file
306
+ 4. **Platform detection:** Platform-specific advice
307
+ 5. **Context-aware suggestions:** Based on system state
308
+
309
+ ### Error Type Additions
310
+ 1. **Concurrent installations:** Detect multiple installers
311
+ 2. **Version conflicts:** Incompatible Node/package versions
312
+ 3. **File locks:** Handle locked files/directories
313
+ 4. **Symbolic links:** Handle symlink errors
314
+
315
+ ## Summary
316
+
317
+ The error handling implementation provides:
318
+ - ✓ Comprehensive error categorization (7+ types)
319
+ - ✓ Actionable advice for every error
320
+ - ✓ Pre-installation validation
321
+ - ✓ Automatic rollback on failures
322
+ - ✓ Recovery options for partial failures
323
+ - ✓ Clear, user-friendly error messages
324
+ - ✓ Complete test coverage (17/17 tests)
325
+ - ✓ System consistency guarantees
326
+
327
+ **Result:** Installation system never leaves users with partial installations or unclear error messages. Every error provides specific guidance for resolution.
@@ -0,0 +1,181 @@
1
+ # Publishing to GitHub Packages
2
+
3
+ This guide shows how to publish `agentflow` to GitHub Packages npm registry.
4
+
5
+ ## Prerequisites
6
+
7
+ - GitHub account with access to `amrhas82/agentic-kit` repository
8
+ - npm installed locally
9
+ - Git repository already pushed to GitHub
10
+
11
+ ## Setup Steps
12
+
13
+ ### 1. Create GitHub Personal Access Token
14
+
15
+ 1. Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
16
+ - Direct link: https://github.com/settings/tokens
17
+ 2. Click **"Generate new token"** → **"Generate new token (classic)"**
18
+ 3. Configure token:
19
+ - **Note**: `Publish agentic-kit to GitHub Packages`
20
+ - **Expiration**: Choose your preference (90 days recommended)
21
+ - **Scopes**: Select these permissions:
22
+ - ✅ `write:packages` - Upload packages to GitHub Package Registry
23
+ - ✅ `read:packages` - Download packages from GitHub Package Registry
24
+ - ✅ `delete:packages` - Delete packages from GitHub Package Registry (optional)
25
+ 4. Click **"Generate token"**
26
+ 5. **IMPORTANT**: Copy the token immediately (you won't see it again)
27
+
28
+ ### 2. Configure Authentication
29
+
30
+ Set your GitHub token as an environment variable:
31
+
32
+ ```bash
33
+ # On Linux/macOS (add to ~/.bashrc or ~/.zshrc for persistence)
34
+ export GITHUB_TOKEN=ghp_your_token_here
35
+
36
+ # On Windows (Command Prompt)
37
+ set GITHUB_TOKEN=ghp_your_token_here
38
+
39
+ # On Windows (PowerShell)
40
+ $env:GITHUB_TOKEN="ghp_your_token_here"
41
+ ```
42
+
43
+ **Verify it's set:**
44
+ ```bash
45
+ echo $GITHUB_TOKEN # Linux/macOS
46
+ echo %GITHUB_TOKEN% # Windows CMD
47
+ echo $env:GITHUB_TOKEN # Windows PowerShell
48
+ ```
49
+
50
+ ### 3. Publish to GitHub Packages
51
+
52
+ ```bash
53
+ cd /home/hamr/PycharmProjects/agentflow
54
+
55
+ # Ensure you're on the right version
56
+ npm version # Should show 1.1.0
57
+
58
+ # Publish to GitHub Packages
59
+ npm publish
60
+ ```
61
+
62
+ ### 4. Verify Publication
63
+
64
+ 1. Go to your GitHub repository: https://github.com/amrhas82/agentflow
65
+ 2. Click on **"Packages"** on the right sidebar
66
+ 3. You should see `agentflow` listed
67
+
68
+ ## Installing from GitHub Packages
69
+
70
+ Users can install your package from GitHub Packages:
71
+
72
+ ### For Users
73
+
74
+ Create `.npmrc` in their project or home directory:
75
+
76
+ ```
77
+ @amrhas82:registry=https://npm.pkg.github.com
78
+ //npm.pkg.github.com/:_authToken=THEIR_GITHUB_TOKEN
79
+ ```
80
+
81
+ Then install:
82
+ ```bash
83
+ npm install agentflow
84
+ ```
85
+
86
+ ## Publishing to Both Registries
87
+
88
+ You can publish to **both** npm registry AND GitHub Packages:
89
+
90
+ ### Option 1: Publish to npm.js (public registry)
91
+
92
+ ```bash
93
+ # Remove or comment out publishConfig in package.json
94
+ # Then publish
95
+ npm publish --registry https://registry.npmjs.org --access public
96
+ ```
97
+
98
+ ### Option 2: Publish to GitHub Packages
99
+
100
+ ```bash
101
+ # Keep publishConfig in package.json pointing to GitHub
102
+ npm publish
103
+ ```
104
+
105
+ ### Option 3: Publish to Both (Recommended)
106
+
107
+ ```bash
108
+ # 1. Publish to npm.js first
109
+ npm publish --registry https://registry.npmjs.org --access public
110
+
111
+ # 2. Then publish to GitHub Packages
112
+ npm publish --registry https://npm.pkg.github.com
113
+ ```
114
+
115
+ ## Updating Package.json for Dual Publishing
116
+
117
+ If you want to make npm.js the default and GitHub Packages optional:
118
+
119
+ **package.json:**
120
+ ```json
121
+ {
122
+ "name": "agentflow",
123
+ "version": "1.1.0",
124
+ "publishConfig": {
125
+ "registry": "https://registry.npmjs.org",
126
+ "access": "public"
127
+ }
128
+ }
129
+ ```
130
+
131
+ Then to publish to GitHub Packages specifically:
132
+ ```bash
133
+ npm publish --registry https://npm.pkg.github.com
134
+ ```
135
+
136
+ ## Current Configuration
137
+
138
+ Your package is currently configured to publish to **GitHub Packages by default**.
139
+
140
+ **package.json** has:
141
+ ```json
142
+ "publishConfig": {
143
+ "registry": "https://npm.pkg.github.com"
144
+ }
145
+ ```
146
+
147
+ **.npmrc** contains:
148
+ ```
149
+ @amrhas82:registry=https://npm.pkg.github.com
150
+ //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
151
+ ```
152
+
153
+ ## Troubleshooting
154
+
155
+ ### Error: 401 Unauthorized
156
+
157
+ - Verify your `GITHUB_TOKEN` is set correctly
158
+ - Ensure token has `write:packages` scope
159
+ - Check token hasn't expired
160
+
161
+ ### Error: 404 Not Found
162
+
163
+ - Verify repository exists: https://github.com/amrhas82/agentflow
164
+ - Ensure package name matches repository owner: `agentflow`
165
+
166
+ ### Error: 403 Forbidden
167
+
168
+ - Verify you have write access to the repository
169
+ - Check repository visibility settings (public/private)
170
+
171
+ ### Package Not Showing Up
172
+
173
+ - Wait a few minutes (can take 5-10 minutes)
174
+ - Check GitHub repository → Packages tab
175
+ - Verify publish command succeeded without errors
176
+
177
+ ## Links
178
+
179
+ - **GitHub Packages Documentation**: https://docs.github.com/en/packages
180
+ - **npm Registry Documentation**: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
181
+ - **Package URL (after publishing)**: https://github.com/amrhas82/agentflow/packages