midas-mcp 3.2.0 → 3.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 (48) hide show
  1. package/dist/analyzer.d.ts.map +1 -1
  2. package/dist/analyzer.js +93 -49
  3. package/dist/analyzer.js.map +1 -1
  4. package/dist/docs/DEPLOYMENT.md +190 -0
  5. package/dist/index.js +4 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/monitoring.d.ts +97 -0
  8. package/dist/monitoring.d.ts.map +1 -0
  9. package/dist/monitoring.js +258 -0
  10. package/dist/monitoring.js.map +1 -0
  11. package/dist/prompts/grow.d.ts.map +1 -1
  12. package/dist/prompts/grow.js +155 -47
  13. package/dist/prompts/grow.js.map +1 -1
  14. package/dist/providers.d.ts.map +1 -1
  15. package/dist/providers.js +77 -15
  16. package/dist/providers.js.map +1 -1
  17. package/dist/server.d.ts.map +1 -1
  18. package/dist/server.js +21 -3
  19. package/dist/server.js.map +1 -1
  20. package/dist/state/phase.d.ts +19 -4
  21. package/dist/state/phase.d.ts.map +1 -1
  22. package/dist/state/phase.js +19 -10
  23. package/dist/state/phase.js.map +1 -1
  24. package/dist/tools/analyze.d.ts.map +1 -1
  25. package/dist/tools/analyze.js +21 -9
  26. package/dist/tools/analyze.js.map +1 -1
  27. package/dist/tools/completeness.d.ts +36 -0
  28. package/dist/tools/completeness.d.ts.map +1 -0
  29. package/dist/tools/completeness.js +838 -0
  30. package/dist/tools/completeness.js.map +1 -0
  31. package/dist/tools/grow.d.ts +157 -0
  32. package/dist/tools/grow.d.ts.map +1 -0
  33. package/dist/tools/grow.js +532 -0
  34. package/dist/tools/grow.js.map +1 -0
  35. package/dist/tools/index.d.ts +3 -0
  36. package/dist/tools/index.d.ts.map +1 -1
  37. package/dist/tools/index.js +6 -0
  38. package/dist/tools/index.js.map +1 -1
  39. package/dist/tools/validate.d.ts +60 -0
  40. package/dist/tools/validate.d.ts.map +1 -0
  41. package/dist/tools/validate.js +234 -0
  42. package/dist/tools/validate.js.map +1 -0
  43. package/dist/tools/verify.d.ts +4 -4
  44. package/dist/tui.d.ts.map +1 -1
  45. package/dist/tui.js +66 -12
  46. package/dist/tui.js.map +1 -1
  47. package/docs/DEPLOYMENT.md +190 -0
  48. package/package.json +1 -1
@@ -0,0 +1,190 @@
1
+ # Deployment Checklist
2
+
3
+ Pre-flight checks, environment validation, and rollback procedures.
4
+
5
+ ## Pre-Flight Checklist
6
+
7
+ Before every deployment, verify:
8
+
9
+ ### 1. Code Quality Gates
10
+
11
+ ```bash
12
+ # All must pass before deploy
13
+ npm run build # TypeScript compiles
14
+ npm run test # Tests pass
15
+ npm run lint # No lint errors
16
+ ```
17
+
18
+ ### 2. Security Audit
19
+
20
+ - [ ] No API keys in code (`git log -p | grep -i "api_key\|secret\|password"`)
21
+ - [ ] Dependencies checked (`npm audit`)
22
+ - [ ] Sensitive files in `.gitignore`
23
+ - [ ] Rate limiting configured
24
+ - [ ] Input validation on all endpoints
25
+
26
+ ### 3. Environment Variables
27
+
28
+ Required for production:
29
+
30
+ ```bash
31
+ # Core
32
+ ANTHROPIC_API_KEY= # Required for AI features
33
+ NODE_ENV=production # Must be 'production'
34
+
35
+ # Optional providers
36
+ OPENAI_API_KEY= # If using OpenAI
37
+ GOOGLE_API_KEY= # If using Gemini
38
+ XAI_API_KEY= # If using Grok
39
+ ```
40
+
41
+ Verify with:
42
+
43
+ ```bash
44
+ node -e "require('./dist/config.js').getApiKey() ? console.log('OK') : console.error('MISSING')"
45
+ ```
46
+
47
+ ### 4. Version Bump
48
+
49
+ ```bash
50
+ # Bump version appropriately
51
+ npm version patch # Bug fixes
52
+ npm version minor # New features
53
+ npm version major # Breaking changes
54
+
55
+ # Verify
56
+ cat package.json | grep version
57
+ ```
58
+
59
+ ### 5. Changelog Updated
60
+
61
+ Ensure `CHANGELOG.md` reflects:
62
+
63
+ - What changed
64
+ - Breaking changes (if any)
65
+ - Migration steps (if needed)
66
+
67
+ ## Deployment Steps
68
+
69
+ ### NPM Publish
70
+
71
+ ```bash
72
+ # 1. Verify you're logged in
73
+ npm whoami
74
+
75
+ # 2. Dry run first
76
+ npm publish --dry-run
77
+
78
+ # 3. Publish
79
+ npm publish
80
+
81
+ # 4. Verify on npm
82
+ npm view midas-mcp
83
+ ```
84
+
85
+ ### Post-Deploy Verification
86
+
87
+ ```bash
88
+ # Install fresh and test
89
+ npm install -g midas-mcp@latest
90
+ midas-mcp --version
91
+ midas-mcp status
92
+ ```
93
+
94
+ ## Rollback Procedures
95
+
96
+ ### NPM Rollback
97
+
98
+ ```bash
99
+ # Unpublish broken version (within 72 hours only)
100
+ npm unpublish midas-mcp@x.y.z
101
+
102
+ # Or deprecate
103
+ npm deprecate midas-mcp@x.y.z "Critical bug, use x.y.z-1"
104
+ ```
105
+
106
+ ### Git Rollback
107
+
108
+ ```bash
109
+ # Revert to last known good
110
+ git revert HEAD
111
+ git push
112
+
113
+ # Or hard reset (destructive)
114
+ git reset --hard <last-good-commit>
115
+ git push --force
116
+ ```
117
+
118
+ ## Health Checks
119
+
120
+ ### Local Validation
121
+
122
+ ```bash
123
+ # Check MCP server starts
124
+ node dist/index.js &
125
+ PID=$!
126
+ sleep 2
127
+ kill $PID 2>/dev/null && echo "Server started OK" || echo "FAILED"
128
+ ```
129
+
130
+ ### TUI Validation
131
+
132
+ ```bash
133
+ # Check TUI renders
134
+ echo 'q' | timeout 5 midas-mcp tui && echo "TUI OK" || echo "TUI FAILED"
135
+ ```
136
+
137
+ ## Monitoring Integration
138
+
139
+ ### Error Tracking (Sentry)
140
+
141
+ If configured:
142
+
143
+ ```typescript
144
+ import * as Sentry from '@sentry/node';
145
+
146
+ Sentry.init({
147
+ dsn: process.env.SENTRY_DSN,
148
+ environment: process.env.NODE_ENV,
149
+ release: require('../package.json').version,
150
+ });
151
+ ```
152
+
153
+ ### Metrics Export (OpenTelemetry)
154
+
155
+ ```typescript
156
+ import { metrics } from '@opentelemetry/api';
157
+
158
+ const meter = metrics.getMeter('midas-mcp');
159
+ const analysisCounter = meter.createCounter('midas.analysis.count');
160
+ const analysisLatency = meter.createHistogram('midas.analysis.latency');
161
+ ```
162
+
163
+ ## Canary Deployment
164
+
165
+ For critical updates:
166
+
167
+ 1. Publish as `next` tag: `npm publish --tag next`
168
+ 2. Test on staging projects
169
+ 3. Monitor for 24 hours
170
+ 4. Promote: `npm dist-tag add midas-mcp@x.y.z latest`
171
+
172
+ ## Emergency Procedures
173
+
174
+ ### Critical Bug in Production
175
+
176
+ 1. **Stop the bleeding**: Deprecate broken version immediately
177
+ 2. **Communicate**: Update README with known issue
178
+ 3. **Fix**: Create hotfix branch, minimal change only
179
+ 4. **Test**: Full test suite + manual verification
180
+ 5. **Deploy**: Publish patch version
181
+ 6. **Verify**: Monitor for 1 hour post-deploy
182
+ 7. **Retrospect**: Document what went wrong
183
+
184
+ ### API Key Leaked
185
+
186
+ 1. Immediately rotate the key at provider dashboard
187
+ 2. Update `~/.midas/config.json` with new key
188
+ 3. Audit git history: `git filter-branch` or BFG
189
+ 4. Force push cleaned history
190
+ 5. Notify affected users if applicable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midas-mcp",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "MCP server for Golden Code methodology - everything you vibecode turns to gold",
5
5
  "main": "dist/index.js",
6
6
  "bin": {