@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,385 @@
1
+ /**
2
+ * BOSS CLAUDE - GitHub Permission Explanations
3
+ *
4
+ * This module provides clear, trust-building explanations for why
5
+ * each GitHub permission is needed. Transparency builds confidence.
6
+ */
7
+
8
+ import chalk from 'chalk';
9
+
10
+ /**
11
+ * Permission categories with detailed explanations
12
+ */
13
+ export const PERMISSION_CATEGORIES = {
14
+ core: {
15
+ title: '🎯 Core Functionality (Required)',
16
+ permissions: {
17
+ 'repo (Issues)': {
18
+ why: 'Store your Boss Claude progress, XP, and session history',
19
+ whatWeStore: [
20
+ 'Session summaries and achievements',
21
+ 'XP progression and level-ups',
22
+ 'Task completion history',
23
+ 'Efficiency metrics and token savings'
24
+ ],
25
+ whatWeNeverTouch: [
26
+ 'Your actual code',
27
+ 'Repository settings',
28
+ 'Collaborator access',
29
+ 'Branch protection rules'
30
+ ],
31
+ technical: 'Uses GitHub Issues API as a free, version-controlled database',
32
+ privacy: 'All data stays in YOUR private repo. We never access other repos.'
33
+ }
34
+ }
35
+ },
36
+
37
+ optional: {
38
+ title: '🔧 Optional Features (Enhance Experience)',
39
+ permissions: {
40
+ 'repo (Contents - Read)': {
41
+ why: 'Enable AI coding assistants to read your project context',
42
+ whatWeUse: [
43
+ 'Read file structure for better context',
44
+ 'Analyze dependencies and configs',
45
+ 'Provide smarter code suggestions',
46
+ 'Understand your project architecture'
47
+ ],
48
+ whatWeNeverDo: [
49
+ 'Modify your code without explicit commands',
50
+ 'Push changes automatically',
51
+ 'Share your code externally',
52
+ 'Access private data'
53
+ ],
54
+ technical: 'Read-only access for AI context enhancement',
55
+ canSkip: true,
56
+ skipImpact: 'AI assistants will have less context about your project'
57
+ },
58
+
59
+ 'workflow': {
60
+ why: 'Automate GitHub Actions for CI/CD integration',
61
+ whatWeEnable: [
62
+ 'Auto-update Boss Claude stats after CI runs',
63
+ 'Track deployment success metrics',
64
+ 'Integration with GitHub Actions workflows',
65
+ 'Automated progress tracking'
66
+ ],
67
+ whatWeNeverDo: [
68
+ 'Create workflows without your approval',
69
+ 'Modify existing workflows',
70
+ 'Run actions on your behalf',
71
+ 'Access workflow secrets'
72
+ ],
73
+ technical: 'Trigger workflow_dispatch events for automation',
74
+ canSkip: true,
75
+ skipImpact: 'Manual progress updates only, no CI/CD integration'
76
+ }
77
+ }
78
+ },
79
+
80
+ security: {
81
+ title: '🔒 Security & Privacy Guarantees',
82
+ promises: [
83
+ {
84
+ icon: '🛡️',
85
+ title: 'Data Ownership',
86
+ description: 'All your data stays in YOUR GitHub repo. We never store it elsewhere.'
87
+ },
88
+ {
89
+ icon: '🔐',
90
+ title: 'Token Security',
91
+ description: 'OAuth token stored locally (~/.boss-claude/config.json). Never transmitted to third parties.'
92
+ },
93
+ {
94
+ icon: '👁️',
95
+ title: 'Transparency',
96
+ description: 'Open source code. Audit exactly what we do with permissions.'
97
+ },
98
+ {
99
+ icon: '🚫',
100
+ title: 'No Third-Party Sharing',
101
+ description: 'Your data never leaves the GitHub ecosystem. Period.'
102
+ },
103
+ {
104
+ icon: '♻️',
105
+ title: 'Revocable Anytime',
106
+ description: 'Revoke access at github.com/settings/tokens. Instant effect.'
107
+ },
108
+ {
109
+ icon: '📖',
110
+ title: 'Audit Trail',
111
+ description: 'Every API call is traceable via GitHub Issues. See exactly what we store.'
112
+ }
113
+ ]
114
+ }
115
+ };
116
+
117
+ /**
118
+ * Display detailed permission explanations
119
+ */
120
+ export function explainPermissions(options = {}) {
121
+ const { minimal = false, category = null } = options;
122
+
123
+ console.log('\n' + chalk.bold.cyan('═'.repeat(70)));
124
+ console.log(chalk.bold.cyan(' BOSS CLAUDE - GitHub Permission Transparency'));
125
+ console.log(chalk.bold.cyan('═'.repeat(70)) + '\n');
126
+
127
+ // Core permissions
128
+ if (!category || category === 'core') {
129
+ displayCategory(PERMISSION_CATEGORIES.core);
130
+ }
131
+
132
+ // Optional permissions
133
+ if (!category || category === 'optional') {
134
+ displayCategory(PERMISSION_CATEGORIES.optional);
135
+ }
136
+
137
+ // Security guarantees
138
+ if (!category || category === 'security') {
139
+ displaySecurityGuarantees();
140
+ }
141
+
142
+ if (!minimal) {
143
+ displayQuickFAQ();
144
+ }
145
+
146
+ console.log(chalk.dim('\n' + '─'.repeat(70)));
147
+ console.log(chalk.bold.green(' Building trust through transparency.'));
148
+ console.log(chalk.dim('─'.repeat(70) + '\n'));
149
+ }
150
+
151
+ /**
152
+ * Display a permission category
153
+ */
154
+ function displayCategory(category) {
155
+ console.log(chalk.bold.white(category.title));
156
+ console.log(chalk.dim('─'.repeat(70)) + '\n');
157
+
158
+ for (const [permName, details] of Object.entries(category.permissions)) {
159
+ console.log(chalk.bold.yellow(` ${permName}`));
160
+ console.log(chalk.white(` Why: ${details.why}\n`));
161
+
162
+ if (details.whatWeStore) {
163
+ console.log(chalk.green(' ✅ What we store:'));
164
+ details.whatWeStore.forEach(item => {
165
+ console.log(chalk.dim(` • ${item}`));
166
+ });
167
+ console.log();
168
+ }
169
+
170
+ if (details.whatWeUse) {
171
+ console.log(chalk.green(' ✅ What we use it for:'));
172
+ details.whatWeUse.forEach(item => {
173
+ console.log(chalk.dim(` • ${item}`));
174
+ });
175
+ console.log();
176
+ }
177
+
178
+ if (details.whatWeNeverTouch) {
179
+ console.log(chalk.red(' ❌ What we NEVER touch:'));
180
+ details.whatWeNeverTouch.forEach(item => {
181
+ console.log(chalk.dim(` • ${item}`));
182
+ });
183
+ console.log();
184
+ }
185
+
186
+ if (details.whatWeNeverDo) {
187
+ console.log(chalk.red(' ❌ What we NEVER do:'));
188
+ details.whatWeNeverDo.forEach(item => {
189
+ console.log(chalk.dim(` • ${item}`));
190
+ });
191
+ console.log();
192
+ }
193
+
194
+ console.log(chalk.cyan(` 🔧 Technical: ${details.technical}`));
195
+
196
+ if (details.privacy) {
197
+ console.log(chalk.magenta(` 🔒 Privacy: ${details.privacy}`));
198
+ }
199
+
200
+ if (details.canSkip) {
201
+ console.log(chalk.yellow(` ⚠️ Optional: ${details.skipImpact}`));
202
+ }
203
+
204
+ console.log();
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Display security guarantees
210
+ */
211
+ function displaySecurityGuarantees() {
212
+ console.log(chalk.bold.white(PERMISSION_CATEGORIES.security.title));
213
+ console.log(chalk.dim('─'.repeat(70)) + '\n');
214
+
215
+ PERMISSION_CATEGORIES.security.promises.forEach(promise => {
216
+ console.log(chalk.bold(` ${promise.icon} ${promise.title}`));
217
+ console.log(chalk.dim(` ${promise.description}\n`));
218
+ });
219
+ }
220
+
221
+ /**
222
+ * Display quick FAQ
223
+ */
224
+ function displayQuickFAQ() {
225
+ console.log(chalk.bold.white('❓ Quick FAQ'));
226
+ console.log(chalk.dim('─'.repeat(70)) + '\n');
227
+
228
+ const faqs = [
229
+ {
230
+ q: 'Can Boss Claude access my private repositories?',
231
+ a: 'Only the ONE repo you choose for Boss Claude storage. Never others.'
232
+ },
233
+ {
234
+ q: 'Can Boss Claude modify my code?',
235
+ a: 'No. We only write to GitHub Issues (for stats). Code is read-only and optional.'
236
+ },
237
+ {
238
+ q: 'Where is my OAuth token stored?',
239
+ a: '~/.boss-claude/config.json on your machine. Never sent to external servers.'
240
+ },
241
+ {
242
+ q: 'What if I revoke access?',
243
+ a: 'Boss Claude switches to offline mode. Your local data remains intact.'
244
+ },
245
+ {
246
+ q: 'Can I audit what data is stored?',
247
+ a: 'Yes! Check your repo Issues. Every stat is visible and version-controlled.'
248
+ },
249
+ {
250
+ q: 'Do you sell my data?',
251
+ a: 'No. We never collect it in the first place. It stays in YOUR GitHub.'
252
+ }
253
+ ];
254
+
255
+ faqs.forEach(faq => {
256
+ console.log(chalk.bold.cyan(` Q: ${faq.q}`));
257
+ console.log(chalk.white(` A: ${faq.a}\n`));
258
+ });
259
+ }
260
+
261
+ /**
262
+ * Get permission scope explanation for specific scope
263
+ */
264
+ export function explainScope(scope) {
265
+ const scopeMap = {
266
+ 'repo': 'Full repository access (needed for Issues API to store progress)',
267
+ 'repo:status': 'Commit status access (not used by Boss Claude)',
268
+ 'public_repo': 'Public repository access only (insufficient - we need private repo for security)',
269
+ 'user:email': 'Access to user email (for identification only)',
270
+ 'workflow': 'GitHub Actions workflow management (optional, for CI/CD integration)',
271
+ 'read:org': 'Organization read access (not used by Boss Claude)'
272
+ };
273
+
274
+ return scopeMap[scope] || 'Unknown scope';
275
+ }
276
+
277
+ /**
278
+ * Interactive permission selection
279
+ */
280
+ export function promptPermissionChoices() {
281
+ console.log(chalk.bold.cyan('\n🔐 Choose Your Permission Level:\n'));
282
+
283
+ console.log(chalk.bold.green('1. Core Only (Recommended for first-time users)'));
284
+ console.log(chalk.dim(' ✅ Session tracking & progress'));
285
+ console.log(chalk.dim(' ✅ XP system & achievements'));
286
+ console.log(chalk.dim(' ❌ No code reading'));
287
+ console.log(chalk.dim(' ❌ No CI/CD integration\n'));
288
+
289
+ console.log(chalk.bold.yellow('2. Enhanced (Better AI context)'));
290
+ console.log(chalk.dim(' ✅ Everything in Core'));
291
+ console.log(chalk.dim(' ✅ Read code for better suggestions'));
292
+ console.log(chalk.dim(' ✅ Project structure awareness'));
293
+ console.log(chalk.dim(' ❌ No CI/CD integration\n'));
294
+
295
+ console.log(chalk.bold.magenta('3. Full (Maximum automation)'));
296
+ console.log(chalk.dim(' ✅ Everything in Enhanced'));
297
+ console.log(chalk.dim(' ✅ GitHub Actions integration'));
298
+ console.log(chalk.dim(' ✅ Automated progress tracking'));
299
+ console.log(chalk.dim(' ✅ CI/CD workflow triggers\n'));
300
+
301
+ console.log(chalk.dim('You can always change this later in ~/.boss-claude/config.json\n'));
302
+ }
303
+
304
+ /**
305
+ * Get scopes for permission level
306
+ */
307
+ export function getScopesForLevel(level) {
308
+ const scopeLevels = {
309
+ 'core': ['repo'], // Issues API needs full repo scope (GitHub limitation)
310
+ 'enhanced': ['repo'], // Same as core (read-only enforced in code)
311
+ 'full': ['repo', 'workflow']
312
+ };
313
+
314
+ return scopeLevels[level] || scopeLevels.core;
315
+ }
316
+
317
+ /**
318
+ * Display what changed after permission update
319
+ */
320
+ export function explainPermissionChange(oldLevel, newLevel) {
321
+ console.log(chalk.bold.cyan('\n📝 Permission Level Changed\n'));
322
+ console.log(chalk.dim(` Old: ${oldLevel} → New: ${newLevel}\n`));
323
+
324
+ const changes = {
325
+ 'core→enhanced': {
326
+ added: ['Read code for AI context', 'Project structure analysis'],
327
+ removed: []
328
+ },
329
+ 'enhanced→full': {
330
+ added: ['GitHub Actions integration', 'Automated CI/CD tracking'],
331
+ removed: []
332
+ },
333
+ 'full→enhanced': {
334
+ added: [],
335
+ removed: ['GitHub Actions integration', 'Automated CI/CD tracking']
336
+ },
337
+ 'enhanced→core': {
338
+ added: [],
339
+ removed: ['Code reading', 'Project structure analysis']
340
+ },
341
+ 'full→core': {
342
+ added: [],
343
+ removed: ['Code reading', 'Project analysis', 'GitHub Actions', 'CI/CD automation']
344
+ }
345
+ };
346
+
347
+ const changeKey = `${oldLevel}→${newLevel}`;
348
+ const change = changes[changeKey];
349
+
350
+ if (change) {
351
+ if (change.added.length > 0) {
352
+ console.log(chalk.bold.green(' ✅ Now enabled:'));
353
+ change.added.forEach(item => console.log(chalk.dim(` • ${item}`)));
354
+ console.log();
355
+ }
356
+
357
+ if (change.removed.length > 0) {
358
+ console.log(chalk.bold.red(' ❌ Now disabled:'));
359
+ change.removed.forEach(item => console.log(chalk.dim(` • ${item}`)));
360
+ console.log();
361
+ }
362
+ }
363
+
364
+ console.log(chalk.dim(' Update takes effect immediately.\n'));
365
+ }
366
+
367
+ /**
368
+ * Show minimal trust statement (for setup flow)
369
+ */
370
+ export function showTrustStatement() {
371
+ console.log(chalk.bold.cyan('\n🛡️ Trust & Transparency\n'));
372
+ console.log(chalk.white(' Boss Claude stores progress in YOUR GitHub repo.'));
373
+ console.log(chalk.white(' Your data never leaves GitHub. Open source. Auditable.'));
374
+ console.log(chalk.dim('\n Run "boss-claude explain-permissions" for full details.\n'));
375
+ }
376
+
377
+ export default {
378
+ explainPermissions,
379
+ explainScope,
380
+ promptPermissionChoices,
381
+ getScopesForLevel,
382
+ explainPermissionChange,
383
+ showTrustStatement,
384
+ PERMISSION_CATEGORIES
385
+ };