@cpretzinger/boss-claude 1.0.0 → 1.0.2

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 (87) hide show
  1. package/README.md +304 -1
  2. package/bin/boss-claude.js +1138 -0
  3. package/bin/commands/mode.js +250 -0
  4. package/bin/onyx-guard.js +259 -0
  5. package/bin/onyx-guard.sh +251 -0
  6. package/bin/prompts.js +284 -0
  7. package/bin/rollback.js +85 -0
  8. package/bin/setup-wizard.js +492 -0
  9. package/config/.env.example +17 -0
  10. package/lib/README.md +83 -0
  11. package/lib/agent-logger.js +61 -0
  12. package/lib/agents/memory-engineers/github-memory-engineer.js +251 -0
  13. package/lib/agents/memory-engineers/postgres-memory-engineer.js +633 -0
  14. package/lib/agents/memory-engineers/qdrant-memory-engineer.js +358 -0
  15. package/lib/agents/memory-engineers/redis-memory-engineer.js +383 -0
  16. package/lib/agents/memory-supervisor.js +526 -0
  17. package/lib/agents/registry.js +135 -0
  18. package/lib/auto-monitor.js +131 -0
  19. package/lib/checkpoint-hook.js +112 -0
  20. package/lib/checkpoint.js +319 -0
  21. package/lib/commentator.js +213 -0
  22. package/lib/context-scribe.js +120 -0
  23. package/lib/delegation-strategies.js +326 -0
  24. package/lib/hierarchy-validator.js +643 -0
  25. package/lib/index.js +15 -0
  26. package/lib/init-with-mode.js +261 -0
  27. package/lib/init.js +44 -6
  28. package/lib/memory-result-aggregator.js +252 -0
  29. package/lib/memory.js +35 -7
  30. package/lib/mode-enforcer.js +473 -0
  31. package/lib/onyx-banner.js +169 -0
  32. package/lib/onyx-identity.js +214 -0
  33. package/lib/onyx-monitor.js +381 -0
  34. package/lib/onyx-reminder.js +188 -0
  35. package/lib/onyx-tool-interceptor.js +341 -0
  36. package/lib/onyx-wrapper.js +315 -0
  37. package/lib/orchestrator-gate.js +334 -0
  38. package/lib/output-formatter.js +296 -0
  39. package/lib/postgres.js +1 -1
  40. package/lib/prompt-injector.js +220 -0
  41. package/lib/prompts.js +532 -0
  42. package/lib/session.js +153 -6
  43. package/lib/setup/README.md +187 -0
  44. package/lib/setup/env-manager.js +785 -0
  45. package/lib/setup/error-recovery.js +630 -0
  46. package/lib/setup/explain-scopes.js +385 -0
  47. package/lib/setup/github-instructions.js +333 -0
  48. package/lib/setup/github-repo.js +254 -0
  49. package/lib/setup/import-credentials.js +498 -0
  50. package/lib/setup/index.js +62 -0
  51. package/lib/setup/init-postgres.js +785 -0
  52. package/lib/setup/init-redis.js +456 -0
  53. package/lib/setup/integration-test.js +652 -0
  54. package/lib/setup/progress.js +357 -0
  55. package/lib/setup/rollback.js +670 -0
  56. package/lib/setup/rollback.test.js +452 -0
  57. package/lib/setup/setup-with-rollback.example.js +351 -0
  58. package/lib/setup/summary.js +400 -0
  59. package/lib/setup/test-github-setup.js +10 -0
  60. package/lib/setup/test-postgres-init.js +98 -0
  61. package/lib/setup/verify-setup.js +102 -0
  62. package/lib/task-agent-worker.js +235 -0
  63. package/lib/token-monitor.js +466 -0
  64. package/lib/tool-wrapper-integration.js +369 -0
  65. package/lib/tool-wrapper.js +387 -0
  66. package/lib/validators/README.md +497 -0
  67. package/lib/validators/config.js +583 -0
  68. package/lib/validators/config.test.js +175 -0
  69. package/lib/validators/github.js +310 -0
  70. package/lib/validators/github.test.js +61 -0
  71. package/lib/validators/index.js +15 -0
  72. package/lib/validators/postgres.js +525 -0
  73. package/package.json +98 -13
  74. package/scripts/benchmark-memory.js +433 -0
  75. package/scripts/check-secrets.sh +12 -0
  76. package/scripts/fetch-todos.mjs +148 -0
  77. package/scripts/graceful-shutdown.sh +156 -0
  78. package/scripts/install-onyx-hooks.js +373 -0
  79. package/scripts/install.js +119 -18
  80. package/scripts/redis-monitor.js +284 -0
  81. package/scripts/redis-setup.js +412 -0
  82. package/scripts/test-memory-retrieval.js +201 -0
  83. package/scripts/validate-exports.js +68 -0
  84. package/scripts/validate-package.js +120 -0
  85. package/scripts/verify-onyx-deployment.js +309 -0
  86. package/scripts/verify-redis-deployment.js +354 -0
  87. package/scripts/verify-redis-init.js +219 -0
@@ -0,0 +1,357 @@
1
+ import chalk from 'chalk';
2
+ import ora from 'ora';
3
+
4
+ /**
5
+ * Setup Progress Tracker
6
+ * Visual, real-time progress display for Boss Claude setup
7
+ */
8
+
9
+ const STEPS = {
10
+ GITHUB: {
11
+ name: 'GitHub Authentication',
12
+ icon: '🔐',
13
+ description: 'Connecting to GitHub API'
14
+ },
15
+ REDIS: {
16
+ name: 'Redis Connection',
17
+ icon: '⚡',
18
+ description: 'Establishing Redis connection'
19
+ },
20
+ POSTGRES: {
21
+ name: 'PostgreSQL Setup',
22
+ icon: '🗄️',
23
+ description: 'Creating database tables'
24
+ },
25
+ FINALIZE: {
26
+ name: 'Finalizing Setup',
27
+ icon: '✨',
28
+ description: 'Completing configuration'
29
+ }
30
+ };
31
+
32
+ const STATUS = {
33
+ PENDING: 'pending',
34
+ IN_PROGRESS: 'in_progress',
35
+ COMPLETED: 'completed',
36
+ FAILED: 'failed',
37
+ SKIPPED: 'skipped'
38
+ };
39
+
40
+ class SetupProgress {
41
+ constructor() {
42
+ this.steps = new Map();
43
+ this.currentSpinner = null;
44
+ this.startTime = Date.now();
45
+
46
+ // Initialize all steps as pending
47
+ Object.keys(STEPS).forEach(key => {
48
+ this.steps.set(key, {
49
+ ...STEPS[key],
50
+ status: STATUS.PENDING,
51
+ startTime: null,
52
+ endTime: null,
53
+ error: null
54
+ });
55
+ });
56
+ }
57
+
58
+ /**
59
+ * Display welcome banner
60
+ */
61
+ showWelcome() {
62
+ console.log('\n');
63
+ console.log(chalk.bold.cyan('╔═══════════════════════════════════════════════════════════╗'));
64
+ console.log(chalk.bold.cyan('║') + ' ' + chalk.bold.cyan('║'));
65
+ console.log(chalk.bold.cyan('║') + chalk.bold.white(' 🤖 BOSS CLAUDE SETUP WIZARD 🤖 ') + chalk.bold.cyan('║'));
66
+ console.log(chalk.bold.cyan('║') + ' ' + chalk.bold.cyan('║'));
67
+ console.log(chalk.bold.cyan('╚═══════════════════════════════════════════════════════════╝'));
68
+ console.log('\n');
69
+ console.log(chalk.gray(' Let\'s get you leveled up! This will only take a moment...\n'));
70
+ }
71
+
72
+ /**
73
+ * Start a setup step
74
+ */
75
+ startStep(stepKey) {
76
+ const step = this.steps.get(stepKey);
77
+ if (!step) return;
78
+
79
+ step.status = STATUS.IN_PROGRESS;
80
+ step.startTime = Date.now();
81
+
82
+ // Stop current spinner if exists
83
+ if (this.currentSpinner) {
84
+ this.currentSpinner.stop();
85
+ }
86
+
87
+ // Start new spinner
88
+ this.currentSpinner = ora({
89
+ text: chalk.cyan(`${step.icon} ${step.description}...`),
90
+ color: 'cyan'
91
+ }).start();
92
+ }
93
+
94
+ /**
95
+ * Complete a setup step
96
+ */
97
+ completeStep(stepKey, message = null) {
98
+ const step = this.steps.get(stepKey);
99
+ if (!step) return;
100
+
101
+ step.status = STATUS.COMPLETED;
102
+ step.endTime = Date.now();
103
+
104
+ if (this.currentSpinner) {
105
+ this.currentSpinner.succeed(
106
+ chalk.green(`${step.icon} ${step.name}`) +
107
+ (message ? chalk.gray(` - ${message}`) : '')
108
+ );
109
+ this.currentSpinner = null;
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Mark step as failed
115
+ */
116
+ failStep(stepKey, error) {
117
+ const step = this.steps.get(stepKey);
118
+ if (!step) return;
119
+
120
+ step.status = STATUS.FAILED;
121
+ step.endTime = Date.now();
122
+ step.error = error;
123
+
124
+ if (this.currentSpinner) {
125
+ this.currentSpinner.fail(
126
+ chalk.red(`${step.icon} ${step.name}`) +
127
+ chalk.gray(` - ${error}`)
128
+ );
129
+ this.currentSpinner = null;
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Skip a step
135
+ */
136
+ skipStep(stepKey, reason = null) {
137
+ const step = this.steps.get(stepKey);
138
+ if (!step) return;
139
+
140
+ step.status = STATUS.SKIPPED;
141
+ step.endTime = Date.now();
142
+
143
+ if (this.currentSpinner) {
144
+ this.currentSpinner.stop();
145
+ this.currentSpinner = null;
146
+ }
147
+
148
+ console.log(
149
+ chalk.yellow(`⊘ ${step.name}`) +
150
+ (reason ? chalk.gray(` - ${reason}`) : chalk.gray(' - skipped'))
151
+ );
152
+ }
153
+
154
+ /**
155
+ * Display current progress
156
+ */
157
+ displayProgress() {
158
+ console.log('\n' + chalk.bold.white('Setup Progress:'));
159
+ console.log(chalk.gray('━'.repeat(60)) + '\n');
160
+
161
+ this.steps.forEach((step, key) => {
162
+ const symbol = this.getStatusSymbol(step.status);
163
+ const statusText = this.getStatusText(step.status);
164
+ const duration = step.endTime ?
165
+ chalk.gray(` (${this.formatDuration(step.endTime - step.startTime)})`) : '';
166
+
167
+ console.log(
168
+ `${symbol} ${step.icon} ${chalk.white(step.name)} ${statusText}${duration}`
169
+ );
170
+ });
171
+
172
+ console.log('\n' + chalk.gray('━'.repeat(60)));
173
+ }
174
+
175
+ /**
176
+ * Get status symbol
177
+ */
178
+ getStatusSymbol(status) {
179
+ switch (status) {
180
+ case STATUS.COMPLETED:
181
+ return chalk.green('✓');
182
+ case STATUS.IN_PROGRESS:
183
+ return chalk.cyan('⏳');
184
+ case STATUS.FAILED:
185
+ return chalk.red('✗');
186
+ case STATUS.SKIPPED:
187
+ return chalk.yellow('⊘');
188
+ default:
189
+ return chalk.gray('○');
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Get status text
195
+ */
196
+ getStatusText(status) {
197
+ switch (status) {
198
+ case STATUS.COMPLETED:
199
+ return chalk.green('completed');
200
+ case STATUS.IN_PROGRESS:
201
+ return chalk.cyan('in progress...');
202
+ case STATUS.FAILED:
203
+ return chalk.red('failed');
204
+ case STATUS.SKIPPED:
205
+ return chalk.yellow('skipped');
206
+ default:
207
+ return chalk.gray('pending');
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Format duration
213
+ */
214
+ formatDuration(ms) {
215
+ if (ms < 1000) return `${ms}ms`;
216
+ return `${(ms / 1000).toFixed(1)}s`;
217
+ }
218
+
219
+ /**
220
+ * Display completion summary
221
+ */
222
+ showSummary(success = true) {
223
+ const totalTime = Date.now() - this.startTime;
224
+ const completed = Array.from(this.steps.values()).filter(s => s.status === STATUS.COMPLETED).length;
225
+ const failed = Array.from(this.steps.values()).filter(s => s.status === STATUS.FAILED).length;
226
+ const skipped = Array.from(this.steps.values()).filter(s => s.status === STATUS.SKIPPED).length;
227
+
228
+ console.log('\n');
229
+ console.log(chalk.bold.cyan('━'.repeat(60)));
230
+
231
+ if (success) {
232
+ console.log('\n' + chalk.bold.green(' 🎉 SETUP COMPLETE! 🎉'));
233
+ console.log('\n' + chalk.white(' Boss Claude is now ready to level up your workflow!\n'));
234
+ console.log(chalk.gray(` Total time: ${this.formatDuration(totalTime)}`));
235
+ console.log(chalk.gray(` Steps completed: ${chalk.green(completed)} | Skipped: ${chalk.yellow(skipped)}`));
236
+ console.log('\n' + chalk.bold.white(' Next steps:'));
237
+ console.log(chalk.cyan(' • Run') + chalk.white(' boss-claude status') + chalk.cyan(' to view your progress'));
238
+ console.log(chalk.cyan(' • Start working and earn XP!'));
239
+ console.log(chalk.cyan(' • Level up by completing tasks efficiently\n'));
240
+ } else {
241
+ console.log('\n' + chalk.bold.yellow(' ⚠️ SETUP INCOMPLETE'));
242
+ console.log('\n' + chalk.white(' Some steps need attention:\n'));
243
+ console.log(chalk.gray(` Completed: ${chalk.green(completed)} | Failed: ${chalk.red(failed)} | Skipped: ${chalk.yellow(skipped)}`));
244
+
245
+ // Show failed steps
246
+ const failedSteps = Array.from(this.steps.entries()).filter(([_, step]) => step.status === STATUS.FAILED);
247
+ if (failedSteps.length > 0) {
248
+ console.log('\n' + chalk.bold.red(' Failed steps:'));
249
+ failedSteps.forEach(([key, step]) => {
250
+ console.log(chalk.red(` • ${step.name}`));
251
+ if (step.error) {
252
+ console.log(chalk.gray(` ${step.error}`));
253
+ }
254
+ });
255
+ }
256
+
257
+ console.log('\n' + chalk.yellow(' You can continue with limited functionality or re-run setup.\n'));
258
+ }
259
+
260
+ console.log(chalk.bold.cyan('━'.repeat(60)));
261
+ console.log('\n');
262
+ }
263
+
264
+ /**
265
+ * Show error with suggestions
266
+ */
267
+ showError(stepKey, error, suggestions = []) {
268
+ console.log('\n');
269
+ console.log(chalk.bold.red('━'.repeat(60)));
270
+ console.log(chalk.bold.red('\n ⚠️ SETUP ERROR\n'));
271
+ console.log(chalk.white(` Step: ${this.steps.get(stepKey)?.name || stepKey}`));
272
+ console.log(chalk.red(` Error: ${error}\n`));
273
+
274
+ if (suggestions.length > 0) {
275
+ console.log(chalk.bold.white(' Suggestions:'));
276
+ suggestions.forEach(suggestion => {
277
+ console.log(chalk.cyan(` • ${suggestion}`));
278
+ });
279
+ console.log('');
280
+ }
281
+
282
+ console.log(chalk.bold.red('━'.repeat(60)));
283
+ console.log('\n');
284
+ }
285
+
286
+ /**
287
+ * Show encouraging message
288
+ */
289
+ showEncouragement() {
290
+ const messages = [
291
+ '🚀 Almost there! Just a few more steps...',
292
+ '💪 You\'re doing great! Setup is progressing smoothly...',
293
+ '⚡ Blazing through setup like a pro!',
294
+ '🎯 On track for a perfect setup!',
295
+ '✨ Boss Claude is getting excited to work with you!'
296
+ ];
297
+
298
+ const message = messages[Math.floor(Math.random() * messages.length)];
299
+ console.log('\n' + chalk.gray(' ' + message) + '\n');
300
+ }
301
+
302
+ /**
303
+ * Get completion percentage
304
+ */
305
+ getCompletionPercentage() {
306
+ const total = this.steps.size;
307
+ const completed = Array.from(this.steps.values()).filter(
308
+ s => s.status === STATUS.COMPLETED || s.status === STATUS.SKIPPED
309
+ ).length;
310
+
311
+ return Math.round((completed / total) * 100);
312
+ }
313
+
314
+ /**
315
+ * Display progress bar
316
+ */
317
+ showProgressBar() {
318
+ const percentage = this.getCompletionPercentage();
319
+ const barLength = 40;
320
+ const filled = Math.round((percentage / 100) * barLength);
321
+ const empty = barLength - filled;
322
+
323
+ const bar = chalk.green('█'.repeat(filled)) + chalk.gray('░'.repeat(empty));
324
+ console.log(`\n ${bar} ${chalk.bold.white(percentage + '%')}\n`);
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Create a new progress tracker
330
+ */
331
+ export function createProgressTracker() {
332
+ return new SetupProgress();
333
+ }
334
+
335
+ /**
336
+ * Quick progress display for simple operations
337
+ */
338
+ export function quickProgress(steps, options = {}) {
339
+ const tracker = new SetupProgress();
340
+
341
+ if (options.showWelcome !== false) {
342
+ tracker.showWelcome();
343
+ }
344
+
345
+ return {
346
+ start: (step) => tracker.startStep(step),
347
+ complete: (step, message) => tracker.completeStep(step, message),
348
+ fail: (step, error) => tracker.failStep(step, error),
349
+ skip: (step, reason) => tracker.skipStep(step, reason),
350
+ finish: (success = true) => tracker.showSummary(success),
351
+ encourage: () => tracker.showEncouragement(),
352
+ showProgress: () => tracker.displayProgress(),
353
+ showBar: () => tracker.showProgressBar()
354
+ };
355
+ }
356
+
357
+ export default SetupProgress;