@hung319/opencode-hive 1.6.5 → 1.6.6
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.
- package/README.md +6 -13
- package/bin/doctor.ts +35 -18
- package/dist/index.js +12 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -567,28 +567,21 @@ bunx @hung319/opencode-hive doctor --fix # Auto-fix issues
|
|
|
567
567
|
|
|
568
568
|
```
|
|
569
569
|
╔═══════════════════════════════════════════════════════════╗
|
|
570
|
-
║ 🐝 Hive Doctor v1.6.
|
|
570
|
+
║ 🐝 Hive Doctor v1.6.6 - System Check ║
|
|
571
571
|
╚═══════════════════════════════════════════════════════════╝
|
|
572
572
|
|
|
573
|
-
Status:
|
|
574
|
-
|
|
575
|
-
🚀 Agent Tools (0/2)
|
|
576
|
-
○ @sparkleideas/agent-booster not installed
|
|
577
|
-
○ @sparkleideas/memory not installed
|
|
573
|
+
Status: ✅ READY
|
|
578
574
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
✅ auto-cr (check) installed
|
|
582
|
-
...
|
|
575
|
+
🚀 Agent Tools (2/2) ✅
|
|
576
|
+
🔧 CLI Tools (5/5) ✅
|
|
583
577
|
|
|
584
578
|
📦 MCPs: Auto-installed with plugin
|
|
585
579
|
|
|
586
580
|
⚡ C++20 for native modules:
|
|
587
|
-
|
|
581
|
+
✓ Active in session
|
|
588
582
|
|
|
589
583
|
🚀 Quick Install
|
|
590
|
-
|
|
591
|
-
npm install @sparkleideas/agent-booster
|
|
584
|
+
All tools ready!
|
|
592
585
|
```
|
|
593
586
|
|
|
594
587
|
### Auto-fix Mode
|
package/bin/doctor.ts
CHANGED
|
@@ -61,7 +61,7 @@ interface DoctorOutput {
|
|
|
61
61
|
reason: string;
|
|
62
62
|
}[];
|
|
63
63
|
quickInstall: string;
|
|
64
|
-
cxxflagsStatus: '
|
|
64
|
+
cxxflagsStatus: 'ready' | 'in-config' | 'not-set' | 'auto-fixed';
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// ============================================================================
|
|
@@ -168,7 +168,7 @@ function checkCliTool(name: string, command: string, description: string): CliCh
|
|
|
168
168
|
// CXXFLAGS: Check and Auto-fix
|
|
169
169
|
// ============================================================================
|
|
170
170
|
|
|
171
|
-
function checkCxxFlags(): 'set' | 'not-set' {
|
|
171
|
+
function checkCxxFlags(): { inConfig: 'set' | 'not-set'; inSession: boolean } {
|
|
172
172
|
const shellConfigs = [
|
|
173
173
|
path.join(process.env.HOME || '', '.bashrc'),
|
|
174
174
|
path.join(process.env.HOME || '', '.bash_profile'),
|
|
@@ -176,28 +176,39 @@ function checkCxxFlags(): 'set' | 'not-set' {
|
|
|
176
176
|
path.join(process.env.HOME || '', '.profile'),
|
|
177
177
|
];
|
|
178
178
|
|
|
179
|
-
const
|
|
179
|
+
const patterns = ['CXXFLAGS="-std=c++20"', "CXXFLAGS='-std=c++20'"];
|
|
180
180
|
|
|
181
|
+
// Check if set in shell config files
|
|
182
|
+
let inConfig: 'set' | 'not-set' = 'not-set';
|
|
181
183
|
for (const config of shellConfigs) {
|
|
182
184
|
if (fs.existsSync(config)) {
|
|
183
185
|
const content = fs.readFileSync(config, 'utf-8');
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
for (const pattern of patterns) {
|
|
187
|
+
if (content.includes(pattern)) {
|
|
188
|
+
inConfig = 'set';
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
186
191
|
}
|
|
187
192
|
}
|
|
193
|
+
if (inConfig === 'set') break;
|
|
188
194
|
}
|
|
189
195
|
|
|
190
|
-
|
|
196
|
+
// Check if CXXFLAGS is active in current session
|
|
197
|
+
const inSession = !!process.env.CXXFLAGS;
|
|
198
|
+
|
|
199
|
+
return { inConfig, inSession };
|
|
191
200
|
}
|
|
192
201
|
|
|
193
202
|
function autoFixCxxFlags(): boolean {
|
|
194
|
-
|
|
203
|
+
const cxxflags = checkCxxFlags();
|
|
204
|
+
|
|
205
|
+
if (cxxflags.inConfig === 'set') {
|
|
195
206
|
return true;
|
|
196
207
|
}
|
|
197
208
|
|
|
198
209
|
const bashrc = path.join(process.env.HOME || '', '.bashrc');
|
|
199
|
-
const exportLine = '
|
|
200
|
-
const comment = '
|
|
210
|
+
const exportLine = 'export CXXFLAGS="-std=c++20"\n';
|
|
211
|
+
const comment = '# For tree-sitter native modules (e.g., @ast-grep/napi)\n';
|
|
201
212
|
|
|
202
213
|
try {
|
|
203
214
|
// Check if bashrc exists
|
|
@@ -208,12 +219,12 @@ function autoFixCxxFlags(): boolean {
|
|
|
208
219
|
const content = fs.readFileSync(bashrc, 'utf-8');
|
|
209
220
|
|
|
210
221
|
// Check if already set
|
|
211
|
-
if (content.includes('CXXFLAGS')) {
|
|
222
|
+
if (content.includes('CXXFLAGS="-std=c++20"')) {
|
|
212
223
|
return true;
|
|
213
224
|
}
|
|
214
225
|
|
|
215
226
|
// Add to bashrc
|
|
216
|
-
fs.appendFileSync(bashrc,
|
|
227
|
+
fs.appendFileSync(bashrc, `\n${comment}${exportLine}`);
|
|
217
228
|
console.log(c.green(`✓ Added CXXFLAGS to ${bashrc}`));
|
|
218
229
|
return true;
|
|
219
230
|
} catch {
|
|
@@ -268,9 +279,11 @@ function autoInstallCliTools(tools: CliCheck[]): { success: string[]; failed: st
|
|
|
268
279
|
// ============================================================================
|
|
269
280
|
|
|
270
281
|
function runDoctor(autoFix = false): DoctorOutput {
|
|
282
|
+
const cxxflags = checkCxxFlags();
|
|
283
|
+
|
|
271
284
|
const output: DoctorOutput = {
|
|
272
285
|
status: 'ready',
|
|
273
|
-
version: '1.6.
|
|
286
|
+
version: '1.6.6',
|
|
274
287
|
summary: getSystemInfo(),
|
|
275
288
|
checks: {
|
|
276
289
|
agentTools: { total: 0, installed: 0, items: [] },
|
|
@@ -278,7 +291,7 @@ function runDoctor(autoFix = false): DoctorOutput {
|
|
|
278
291
|
},
|
|
279
292
|
actionItems: [],
|
|
280
293
|
quickInstall: '',
|
|
281
|
-
cxxflagsStatus:
|
|
294
|
+
cxxflagsStatus: cxxflags.inSession ? 'ready' : cxxflags.inConfig === 'set' ? 'in-config' : 'not-set',
|
|
282
295
|
};
|
|
283
296
|
|
|
284
297
|
// Auto-fix CXXFLAGS if requested
|
|
@@ -289,7 +302,7 @@ function runDoctor(autoFix = false): DoctorOutput {
|
|
|
289
302
|
setCxxFlagsForCurrentSession();
|
|
290
303
|
|
|
291
304
|
// Add to shell config
|
|
292
|
-
if (
|
|
305
|
+
if (cxxflags.inConfig !== 'set') {
|
|
293
306
|
autoFixCxxFlags();
|
|
294
307
|
output.cxxflagsStatus = 'auto-fixed';
|
|
295
308
|
}
|
|
@@ -422,12 +435,16 @@ function printDoctor(output: DoctorOutput) {
|
|
|
422
435
|
|
|
423
436
|
// C++20 status
|
|
424
437
|
console.log('\n⚡ C++20 for native modules:');
|
|
425
|
-
if (output.cxxflagsStatus === '
|
|
426
|
-
console.log(' ' + c.green('✓
|
|
438
|
+
if (output.cxxflagsStatus === 'ready') {
|
|
439
|
+
console.log(' ' + c.green('✓ Active in session'));
|
|
440
|
+
} else if (output.cxxflagsStatus === 'in-config') {
|
|
441
|
+
console.log(' ' + c.yellow('⚠ Configured but not active in current session'));
|
|
442
|
+
console.log(' ' + c.gray(' Run: source ~/.bashrc'));
|
|
427
443
|
} else if (output.cxxflagsStatus === 'auto-fixed') {
|
|
428
|
-
console.log(' ' + c.green('✓
|
|
444
|
+
console.log(' ' + c.green('✓ Configured!'));
|
|
445
|
+
console.log(' ' + c.gray(' Run: source ~/.bashrc to activate'));
|
|
429
446
|
} else {
|
|
430
|
-
console.log(' ' + c.
|
|
447
|
+
console.log(' ' + c.red('○ Not set (needed for @ast-grep/napi)'));
|
|
431
448
|
console.log(' ' + c.gray(' Run with --fix to auto-configure'));
|
|
432
449
|
}
|
|
433
450
|
|
package/dist/index.js
CHANGED
|
@@ -17850,15 +17850,18 @@ function checkCxxFlags() {
|
|
|
17850
17850
|
path6.join(process.env.HOME || "", ".bashrc"),
|
|
17851
17851
|
path6.join(process.env.HOME || "", ".zshrc")
|
|
17852
17852
|
];
|
|
17853
|
+
let inConfig = false;
|
|
17853
17854
|
for (const config2 of configs) {
|
|
17854
17855
|
if (fs5.existsSync(config2)) {
|
|
17855
17856
|
const content = fs5.readFileSync(config2, "utf-8");
|
|
17856
|
-
if (content.includes(
|
|
17857
|
-
|
|
17857
|
+
if (content.includes("CXXFLAGS")) {
|
|
17858
|
+
inConfig = true;
|
|
17859
|
+
break;
|
|
17858
17860
|
}
|
|
17859
17861
|
}
|
|
17860
17862
|
}
|
|
17861
|
-
|
|
17863
|
+
const inSession = !!process.env.CXXFLAGS;
|
|
17864
|
+
return { inConfig, inSession };
|
|
17862
17865
|
}
|
|
17863
17866
|
var hiveDoctorTool = tool({
|
|
17864
17867
|
description: `Hive Doctor - System health check for Hive plugin.
|
|
@@ -17876,14 +17879,16 @@ var hiveDoctorTool = tool({
|
|
|
17876
17879
|
**Tip:** Run standalone for auto-fix: \`bunx @hung319/opencode-hive doctor --fix\``,
|
|
17877
17880
|
args: {},
|
|
17878
17881
|
async execute() {
|
|
17882
|
+
const cxxflags = checkCxxFlags();
|
|
17879
17883
|
const result = {
|
|
17880
17884
|
status: "ready",
|
|
17881
|
-
version: "1.6.
|
|
17885
|
+
version: "1.6.6",
|
|
17882
17886
|
checks: {
|
|
17883
17887
|
agentTools: { total: 0, installed: 0, items: [] },
|
|
17884
17888
|
cliTools: { total: 0, available: 0, items: [] }
|
|
17885
17889
|
},
|
|
17886
|
-
cxxflagsStatus:
|
|
17890
|
+
cxxflagsStatus: cxxflags.inSession ? "ready" : cxxflags.inConfig ? "in-config" : "not-set",
|
|
17891
|
+
cxxflagsHint: cxxflags.inSession ? "Active in session" : cxxflags.inConfig ? "Run: source ~/.bashrc" : "Run: bunx @hung319/opencode-hive doctor --fix",
|
|
17887
17892
|
actionItems: [],
|
|
17888
17893
|
quickInstall: ""
|
|
17889
17894
|
};
|
|
@@ -17922,11 +17927,11 @@ var hiveDoctorTool = tool({
|
|
|
17922
17927
|
reason: "Agent tools provide faster editing and memory"
|
|
17923
17928
|
});
|
|
17924
17929
|
}
|
|
17925
|
-
if (result.cxxflagsStatus
|
|
17930
|
+
if (result.cxxflagsStatus !== "ready") {
|
|
17926
17931
|
result.actionItems.push({
|
|
17927
17932
|
priority: "low",
|
|
17928
17933
|
action: "Enable C++20 for native modules",
|
|
17929
|
-
command: `
|
|
17934
|
+
command: `bunx @hung319/opencode-hive doctor --fix`,
|
|
17930
17935
|
reason: "Required for @ast-grep/napi tree-sitter build"
|
|
17931
17936
|
});
|
|
17932
17937
|
}
|