@hung319/opencode-hive 1.6.5 → 1.6.7

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 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.5 - System Check ║
570
+ ║ 🐝 Hive Doctor v1.6.6 - System Check ║
571
571
  ╚═══════════════════════════════════════════════════════════╝
572
572
 
573
- Status: ⚠️ NEEDS SETUP
574
-
575
- 🚀 Agent Tools (0/2)
576
- ○ @sparkleideas/agent-booster not installed
577
- ○ @sparkleideas/memory not installed
573
+ Status: READY
578
574
 
579
- 🔧 CLI Tools (4/5)
580
- dora (via npx)
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
- Already configured
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: 'set' | 'not-set' | 'auto-fixed';
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 pattern = 'CXXFLAGS="-std=c++20"';
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
- if (content.includes(pattern)) {
185
- return 'set';
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
- return 'not-set';
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
- if (checkCxxFlags() === 'set') {
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 = '\nexport CXXFLAGS="-std=c++20"\nexport CXXFLAGS="std=c++20"\n';
200
- const comment = '\n# For tree-sitter native modules (e.g., @ast-grep/napi)\n';
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, `${comment}${exportLine}`);
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.5',
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: checkCxxFlags(),
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 (output.cxxflagsStatus === 'not-set') {
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 === 'set') {
426
- console.log(' ' + c.green('✓ Already configured in shell'));
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('✓ Auto-configured! (run "source ~/.bashrc" or restart terminal)'));
444
+ console.log(' ' + c.green('✓ Configured!'));
445
+ console.log(' ' + c.gray(' Run: source ~/.bashrc to activate'));
429
446
  } else {
430
- console.log(' ' + c.yellow('○ Not set (needed for @ast-grep/napi)'));
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
 
@@ -468,8 +485,14 @@ function printDoctor(output: DoctorOutput) {
468
485
 
469
486
  const args = process.argv.slice(2);
470
487
  const autoFix = args.includes('--fix') || args.includes('-f');
488
+ const ciMode = process.env.CI === 'true' || args.includes('--ci');
471
489
 
472
490
  const output = runDoctor(autoFix);
473
491
  printDoctor(output);
474
492
 
493
+ // In CI mode, only fail on critical errors, not on missing optional tools
494
+ if (ciMode) {
495
+ process.exit(0);
496
+ }
497
+
475
498
  process.exit(output.status === 'ready' ? 0 : 1);
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('CXXFLAGS="-std=c++20"')) {
17857
- return "set";
17857
+ if (content.includes("CXXFLAGS")) {
17858
+ inConfig = true;
17859
+ break;
17858
17860
  }
17859
17861
  }
17860
17862
  }
17861
- return "not-set";
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.4",
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: checkCxxFlags(),
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 === "not-set") {
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: `echo 'export CXXFLAGS="-std=c++20"' >> ~/.bashrc`,
17934
+ command: `bunx @hung319/opencode-hive doctor --fix`,
17930
17935
  reason: "Required for @ast-grep/napi tree-sitter build"
17931
17936
  });
17932
17937
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hung319/opencode-hive",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Agent Hive - from vibe coding to hive coding",
6
6
  "license": "MIT WITH Commons-Clause",
@@ -31,7 +31,7 @@
31
31
  "scripts": {
32
32
  "clean": "rm -rf dist",
33
33
  "generate-skills": "bun run scripts/generate-skills.ts",
34
- "build": "npm run clean && npm run generate-skills && bun build src/index.ts --outdir dist --target node --format esm --packages=bundle --external @ast-grep/napi && tsc --emitDeclarationOnly",
34
+ "build": "npm run clean && npm run generate-skills && bun build src/index.ts --outdir dist --target node --format esm --packages=bundle && tsc --emitDeclarationOnly",
35
35
  "dev": "opencode plugin dev",
36
36
  "test": "bun test"
37
37
  },
@@ -39,10 +39,10 @@
39
39
  "@opencode-ai/plugin": ">=0.13.7"
40
40
  },
41
41
  "dependencies": {
42
- "@ast-grep/napi": "^0.41.1",
43
42
  "simple-git": "^3.27.0"
44
43
  },
45
44
  "optionalDependencies": {
45
+ "@ast-grep/napi": "^0.41.1",
46
46
  "grep-mcp": "^1.1.0",
47
47
  "@upstash/context7-mcp": "^2.1.0",
48
48
  "exa-mcp-server": "^3.1.5",