@ia-ccun/code-agent-cli 0.0.52-beta.1 → 0.0.52-beta.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.
@@ -10,7 +10,7 @@ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-a
10
10
 
11
11
  const AICODE_TIPS = [
12
12
  "@ 快速搜索项目文件",
13
- "Ctrl+L 快速切换备选模型,
13
+ "Ctrl+L 快速切换备选模型",
14
14
  "Ctrl+P/Shift+Ctrl+P 切换范围模型",
15
15
  "Shift+Tab 切换思考级别( 需 models.json配置 reasoning 启用)",
16
16
  "Ctrl+O 展开/折叠工具输出",
@@ -107,7 +107,7 @@ const AICODE_TIPS = [
107
107
  "计划模式自动生成 Todo 列表,跟踪实施步骤和完成进度",
108
108
  "/goal 设置长期目标,跟踪进度、时间和 token 消耗",
109
109
  "/goal --tokens=50K 设置带 token 预算限制的目标",
110
- "Goal 扩展支持 paused/resumed 状态,方便暂停和恢复长期任务 (推荐使用)",,
110
+ "Goal 扩展支持 paused/resumed 状态,方便暂停和恢复长期任务 (推荐使用)",
111
111
  "Goal 扩展显示实时进度:已完成百分比、已用时间和 token 消耗 (推荐使用)",
112
112
  "⚠️ 使用 advisor 获取第二视角评估,避免决策盲点",
113
113
  "⚠️ 使用 plan 模式强制分析流程,避免冲动式编码(推荐使用)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ia-ccun/code-agent-cli",
3
- "version": "0.0.52-beta.1",
3
+ "version": "0.0.52-beta.2",
4
4
  "description": "AI Coding Agent CLI - 基于OpenClaw🦞底层Agent原理封装的编码智能体(供学习使用)。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -6,6 +6,7 @@ import { symlink as fsSymlink } from 'fs/promises';
6
6
  import { join, dirname, relative } from 'path';
7
7
  import { homedir } from 'os';
8
8
  import { fileURLToPath } from 'url';
9
+ import { spawn } from 'child_process';
9
10
 
10
11
  // Get __dirname equivalent for ES modules
11
12
  const __filename = fileURLToPath(import.meta.url);
@@ -463,6 +464,63 @@ logSecurity('install_complete', {
463
464
  piDir,
464
465
  });
465
466
 
467
+ // ============================================================================
468
+ // Auto-install codegraph (optional dependency)
469
+ // ============================================================================
470
+
471
+ const CODEGRAPH_PKG = '@colbymchenry/codegraph@0.9.7';
472
+
473
+ async function installCodegraph() {
474
+ return new Promise((resolve) => {
475
+ const child = spawn('npm', ['i', '-g', CODEGRAPH_PKG], {
476
+ stdio: 'pipe',
477
+ shell: process.platform === 'win32',
478
+ });
479
+
480
+ let stderr = '';
481
+
482
+ child.stderr.on('data', (data) => {
483
+ stderr += data.toString();
484
+ });
485
+
486
+ child.on('close', (code) => {
487
+ if (code === 0) {
488
+ console.log('✓ Installed codegraph globally,See UniDoc《2026.5 aicode+codegraph 安装与使用》');
489
+ logSecurity('codegraph_install', {
490
+ package: CODEGRAPH_PKG,
491
+ success: true
492
+ });
493
+ } else {
494
+ // 静默失败,不中断主流程
495
+ if (process.env.DEBUG) {
496
+ console.log(`⚠ Could not install codegraph: ${stderr.slice(0, 100)}`);
497
+ }
498
+ logSecurity('codegraph_install', {
499
+ package: CODEGRAPH_PKG,
500
+ success: false,
501
+ error: stderr.slice(0, 200)
502
+ }, 'warn');
503
+ }
504
+ resolve();
505
+ });
506
+
507
+ child.on('error', (err) => {
508
+ if (process.env.DEBUG) {
509
+ console.log(`⚠ Could not install codegraph: ${err.message}`);
510
+ }
511
+ logSecurity('codegraph_install', {
512
+ package: CODEGRAPH_PKG,
513
+ success: false,
514
+ error: err.message
515
+ }, 'warn');
516
+ resolve();
517
+ });
518
+ });
519
+ }
520
+
521
+ // Execute codegraph installation
522
+ await installCodegraph();
523
+
466
524
  console.log('\n✨ Setup complete!');
467
525
  console.log('📝 Configuration files are in ~/.aicode-cli/');
468
526
  console.log('🔗 ~/.pi is linked to ~/.aicode-cli (ensuring model configs work)');