@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,187 @@
1
+ # Boss Claude Setup Utilities
2
+
3
+ Automated setup and configuration utilities for Boss Claude infrastructure.
4
+
5
+ ## GitHub Repository Setup
6
+
7
+ **File:** `lib/setup/github-repo.js`
8
+
9
+ Automatically creates and configures the `boss-claude-memory` private repository for storing Boss Claude persistent data.
10
+
11
+ ### Features
12
+
13
+ - ✅ **Auto-detection**: Checks if repository exists before creating
14
+ - ✅ **Private by default**: Creates PRIVATE repository for security
15
+ - ✅ **Error handling**: Comprehensive error messages for all failure cases
16
+ - ✅ **Access verification**: Ensures write permissions are available
17
+ - ✅ **Token flexibility**: Supports GITHUB_TOKEN env var or git config
18
+ - ✅ **Idempotent**: Safe to run multiple times
19
+ - ✅ **Auto-update**: Updates description and settings if repo exists
20
+
21
+ ### Usage
22
+
23
+ #### Programmatic
24
+
25
+ ```javascript
26
+ import { setupGitHubRepo } from './lib/setup/github-repo.js';
27
+
28
+ const result = await setupGitHubRepo({ verbose: true });
29
+
30
+ if (result.success) {
31
+ console.log('Repository ready:', result.url);
32
+ console.log('Clone URL:', result.cloneUrl);
33
+ console.log('Private:', result.isPrivate);
34
+ console.log('Created:', result.created);
35
+ } else {
36
+ console.error('Setup failed:', result.error);
37
+ }
38
+ ```
39
+
40
+ #### CLI
41
+
42
+ ```bash
43
+ # Run the test script
44
+ node lib/setup/test-github-setup.js
45
+ ```
46
+
47
+ ### Configuration
48
+
49
+ The module looks for GitHub token in this order:
50
+
51
+ 1. `GITHUB_TOKEN` environment variable
52
+ 2. `git config --global github.token`
53
+
54
+ **Set token via environment:**
55
+ ```bash
56
+ export GITHUB_TOKEN=ghp_your_token_here
57
+ ```
58
+
59
+ **Set token via git config:**
60
+ ```bash
61
+ git config --global github.token ghp_your_token_here
62
+ ```
63
+
64
+ ### Return Object
65
+
66
+ ```typescript
67
+ {
68
+ success: boolean; // Overall success status
69
+ owner: string | null; // GitHub username
70
+ repo: string; // Repository name (boss-claude-memory)
71
+ url: string | null; // Repository web URL
72
+ cloneUrl: string | null; // Git clone URL
73
+ isPrivate: boolean; // Privacy status
74
+ created: boolean; // True if newly created, false if updated
75
+ error?: string; // Error message (only if success=false)
76
+ }
77
+ ```
78
+
79
+ ### Error Cases Handled
80
+
81
+ | Error | Handling |
82
+ |-------|----------|
83
+ | **No GitHub token** | Clear instructions on how to set token |
84
+ | **Invalid token** | Authentication failure message |
85
+ | **Repository exists** | Updates settings instead of creating |
86
+ | **No write access** | Permission denied error |
87
+ | **Network failure** | Connection error with retry suggestion |
88
+ | **Name conflict** | Repository name already taken |
89
+ | **Public repo** | Warning message (allows continuation) |
90
+
91
+ ### Example Output
92
+
93
+ **Creating new repository:**
94
+ ```
95
+ 🔧 Boss Claude GitHub Repository Setup
96
+
97
+ ℹ GitHub token found
98
+ ℹ Authenticated with GitHub
99
+ ℹ GitHub user: cpretzinger
100
+ ℹ Checking for existing repository...
101
+ ℹ Creating private repository "boss-claude-memory"...
102
+ ✓ Repository created: https://github.com/cpretzinger/boss-claude-memory
103
+ ℹ Verifying repository access...
104
+ ✓ Repository access verified
105
+
106
+ ✓ Setup Complete!
107
+
108
+ Repository Details:
109
+ Owner: cpretzinger
110
+ Name: boss-claude-memory
111
+ URL: https://github.com/cpretzinger/boss-claude-memory
112
+ Private: Yes
113
+ Status: Created
114
+ ```
115
+
116
+ **Updating existing repository:**
117
+ ```
118
+ 🔧 Boss Claude GitHub Repository Setup
119
+
120
+ ℹ GitHub token found
121
+ ℹ Authenticated with GitHub
122
+ ℹ GitHub user: cpretzinger
123
+ ℹ Checking for existing repository...
124
+ ℹ Repository "boss-claude-memory" already exists
125
+ ℹ Updating repository settings...
126
+ ℹ Repository settings updated
127
+ ℹ Verifying repository access...
128
+ ✓ Repository access verified
129
+
130
+ ✓ Setup Complete!
131
+
132
+ Repository Details:
133
+ Owner: cpretzinger
134
+ Name: boss-claude-memory
135
+ URL: https://github.com/cpretzinger/boss-claude-memory
136
+ Private: Yes
137
+ Status: Updated
138
+ ```
139
+
140
+ ### Integration
141
+
142
+ This module will be integrated into the Boss Claude installation process:
143
+
144
+ ```javascript
145
+ // In scripts/install.js
146
+ import { setupGitHubRepo } from '../lib/setup/github-repo.js';
147
+
148
+ // During installation
149
+ const repoSetup = await setupGitHubRepo({ verbose: false });
150
+ if (!repoSetup.success) {
151
+ console.warn('GitHub repository setup skipped. Run manually later.');
152
+ }
153
+ ```
154
+
155
+ ### Security
156
+
157
+ - Repository is created as **PRIVATE by default**
158
+ - Token is never logged or exposed
159
+ - No sensitive data written to repository (handled separately)
160
+ - Write access verified before proceeding
161
+
162
+ ### Testing
163
+
164
+ ```bash
165
+ # Test with environment variable
166
+ GITHUB_TOKEN=ghp_your_token node lib/setup/test-github-setup.js
167
+
168
+ # Test with git config
169
+ git config --global github.token ghp_your_token
170
+ node lib/setup/test-github-setup.js
171
+ ```
172
+
173
+ ### Exported Functions
174
+
175
+ ```javascript
176
+ // Main setup function
177
+ setupGitHubRepo(options)
178
+
179
+ // CLI command wrapper
180
+ setupGitHubRepoCommand()
181
+
182
+ // Helper functions (exported for testing)
183
+ getGitHubToken()
184
+ getGitHubUsername(octokit)
185
+ repositoryExists(octokit, owner, repo)
186
+ createRepository(octokit, repo)
187
+ ```