@renxqoo/renx-code 0.0.6 → 0.0.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
@@ -5,78 +5,75 @@
5
5
  - npm package: `@renxqoo/renx-code`
6
6
  - command: `renx`
7
7
 
8
- ## 安装
8
+ ## Install
9
9
 
10
- 先确认已经安装 `Bun`,因为当前 CLI 运行时依赖 `Bun`:
10
+ Requirements:
11
11
 
12
- ```bash
13
- bun --version
14
- ```
15
-
16
- 如果还没有安装 Bun,请先安装:
12
+ - Node.js `20+`
17
13
 
18
- - [https://bun.sh](https://bun.sh)
19
-
20
- 然后全局安装 `renx`:
14
+ Install globally:
21
15
 
22
16
  ```bash
23
17
  npm i -g @renxqoo/renx-code --registry=https://registry.npmjs.org
24
18
  ```
25
19
 
26
- 安装完成后,直接运行:
20
+ Start:
27
21
 
28
22
  ```bash
29
23
  renx
30
24
  ```
31
25
 
32
- ## 如何使用
26
+ No separate Bun installation is required for published npm installs.
27
+
28
+ ## Basic Usage
33
29
 
34
- 在任意项目目录打开终端后执行:
30
+ Run `renx` inside any project directory:
35
31
 
36
32
  ```bash
37
33
  renx
38
34
  ```
39
35
 
40
- `renx` 会默认把当前终端所在目录当作工作目录。
36
+ `renx` uses the current terminal directory as the workspace by default.
41
37
 
42
- 常见使用方式:
38
+ Common things you can do:
43
39
 
44
- - 在项目目录中直接运行 `renx`
45
- - 让它阅读代码、解释代码、修改文件、排查错误
46
- - 在当前工作目录下执行开发任务
40
+ - read and explain code
41
+ - modify files
42
+ - investigate errors
43
+ - work inside the current project directory
47
44
 
48
- 内置命令:
45
+ Built-in commands:
49
46
 
50
47
  - `/help`
51
48
  - `/clear`
52
49
  - `/exit`
53
50
 
54
- 常用快捷键:
51
+ Keyboard shortcuts:
55
52
 
56
- - `Esc`:正在生成时停止响应,否则清空当前输入
57
- - `Ctrl + L`:清空当前会话内容
53
+ - `Esc`: stop the current response, or clear the current input
54
+ - `Ctrl + L`: clear the current conversation
58
55
 
59
- ## 配置说明
56
+ ## Configuration
60
57
 
61
- `renx` 使用统一配置系统,优先级如下:
58
+ Configuration priority:
62
59
 
63
- 1. 当前进程环境变量,以及 `.env` / `.env.development`
64
- 2. 项目配置:`<workspace>/.renx/config.json`
65
- 3. 全局配置:`RENX_HOME/config.json`
66
- 4. 内置默认值
60
+ 1. process environment variables and `.env` / `.env.development`
61
+ 2. project config: `<workspace>/.renx/config.json`
62
+ 3. global config: `RENX_HOME/config.json`
63
+ 4. built-in defaults
67
64
 
68
- 默认情况下,`renx` 会把用户级数据放到:
65
+ Default user data locations:
69
66
 
70
- - `RENX_HOME`,默认是 `~/.renx`
71
- - `RENX_HOME/config.json`:全局配置
72
- - `RENX_HOME/logs/`:日志目录
73
- - `RENX_HOME/storage/`:文件历史存储
74
- - `RENX_HOME/task/`:任务数据
75
- - `RENX_HOME/data.db`:SQLite 数据库
67
+ - `RENX_HOME`, default: `~/.renx`
68
+ - `RENX_HOME/config.json`
69
+ - `RENX_HOME/logs/`
70
+ - `RENX_HOME/storage/`
71
+ - `RENX_HOME/task/`
72
+ - `RENX_HOME/data.db`
76
73
 
77
- ## 环境变量
74
+ ## Environment Variables
78
75
 
79
- 运行相关:
76
+ Runtime:
80
77
 
81
78
  - `RENX_HOME`
82
79
  - `AGENT_MODEL`
@@ -86,27 +83,25 @@ renx
86
83
  - `AGENT_CONVERSATION_ID`
87
84
  - `AGENT_SESSION_ID`
88
85
 
89
- 日志相关:
86
+ Logging:
90
87
 
91
88
  - `AGENT_LOG_LEVEL`
92
89
  - `AGENT_LOG_FORMAT`
93
90
  - `AGENT_LOG_CONSOLE`
94
91
  - `AGENT_LOG_FILE_ENABLED`
95
92
 
96
- 文件历史相关:
93
+ File history:
97
94
 
98
95
  - `AGENT_FILE_HISTORY_ENABLED`
99
96
  - `AGENT_FILE_HISTORY_MAX_PER_FILE`
100
97
  - `AGENT_FILE_HISTORY_MAX_AGE_DAYS`
101
98
  - `AGENT_FILE_HISTORY_MAX_TOTAL_MB`
102
99
 
103
- 模型供应商 API Key 仍然通过各自环境变量提供,例如:
100
+ Provider API keys are still passed through their own environment variables, for example:
104
101
 
105
102
  - `GLM_API_KEY`
106
103
 
107
- ## 配置文件示例
108
-
109
- 项目级或全局配置都使用相同 JSON 结构:
104
+ ## Config Example
110
105
 
111
106
  ```json
112
107
  {
@@ -132,13 +127,13 @@ renx
132
127
  }
133
128
  ```
134
129
 
135
- 项目配置示例路径:
130
+ Project config example:
136
131
 
137
132
  ```text
138
133
  your-project/.renx/config.json
139
134
  ```
140
135
 
141
- 全局配置示例路径:
136
+ Global config example:
142
137
 
143
138
  ```text
144
139
  ~/.renx/config.json
package/bin/renx.cjs CHANGED
@@ -8,7 +8,7 @@ const packageRoot = path.resolve(__dirname, "..");
8
8
  const entryPath = path.join(packageRoot, "src", "index.tsx");
9
9
  const packagedRepoRoot = path.join(packageRoot, "vendor", "agent-root");
10
10
  const localRepoRoot = path.resolve(packageRoot, "..");
11
- const bunExecutable = process.env.RENX_BUN_PATH || "bun";
11
+ const nodeExecutable = process.env.RENX_NODE_PATH || process.execPath;
12
12
 
13
13
  const hasAgentSourceRoot = root =>
14
14
  fs.existsSync(path.join(root, "src", "providers", "index.ts")) &&
@@ -28,7 +28,16 @@ if (!fs.existsSync(entryPath)) {
28
28
  process.exit(1);
29
29
  }
30
30
 
31
- const result = childProcess.spawnSync(bunExecutable, [entryPath, ...process.argv.slice(2)], {
31
+ let tsxCliPath;
32
+ try {
33
+ tsxCliPath = require.resolve("tsx/cli", { paths: [packageRoot] });
34
+ } catch (error) {
35
+ const message = error instanceof Error ? error.message : String(error);
36
+ console.error(`Could not resolve tsx runtime from this installation: ${message}`);
37
+ process.exit(1);
38
+ }
39
+
40
+ const result = childProcess.spawnSync(nodeExecutable, [tsxCliPath, entryPath, ...process.argv.slice(2)], {
32
41
  cwd: process.cwd(),
33
42
  stdio: "inherit",
34
43
  env: {
@@ -39,11 +48,7 @@ const result = childProcess.spawnSync(bunExecutable, [entryPath, ...process.argv
39
48
  });
40
49
 
41
50
  if (result.error) {
42
- if (result.error.code === "ENOENT") {
43
- console.error("Bun is required to run renx. Install Bun first: https://bun.sh");
44
- } else {
45
- console.error(result.error.message);
46
- }
51
+ console.error(result.error.message);
47
52
  process.exit(1);
48
53
  }
49
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renxqoo/renx-code",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "module": "src/index.tsx",
5
5
  "type": "module",
6
6
  "private": false,
@@ -15,8 +15,7 @@
15
15
  "tsconfig.json"
16
16
  ],
17
17
  "engines": {
18
- "node": ">=20.0.0",
19
- "bun": ">=1.1.0"
18
+ "node": ">=20.0.0"
20
19
  },
21
20
  "peerDependencies": {
22
21
  "typescript": "^5.9.3"
@@ -24,6 +23,19 @@
24
23
  "dependencies": {
25
24
  "@opentui/core": "^0.1.84",
26
25
  "@opentui/react": "^0.1.84",
27
- "react": "^19.2.4"
26
+ "@vscode/ripgrep": "^1.17.0",
27
+ "diff": "^8.0.3",
28
+ "dotenv": "^17.3.1",
29
+ "js-tiktoken": "^1.0.21",
30
+ "log-update": "^6.1.0",
31
+ "marked": "^15.0.12",
32
+ "marked-terminal": "^7.3.0",
33
+ "minimatch": "^10.2.4",
34
+ "react": "^19.2.4",
35
+ "shell-quote": "^1.8.3",
36
+ "strip-ansi": "^7.2.0",
37
+ "uuid": "^13.0.0",
38
+ "zod": "^4.3.6",
39
+ "tsx": "^4.21.0"
28
40
  }
29
41
  }
@@ -1,4 +1,4 @@
1
- import { readdir } from 'node:fs/promises';
1
+ import { readdir, stat } from 'node:fs/promises';
2
2
  import { join, relative } from 'node:path';
3
3
 
4
4
  import { resolveWorkspaceRoot } from '../agent/runtime/source-modules';
@@ -40,17 +40,15 @@ const visitDirectory = async (
40
40
  continue;
41
41
  }
42
42
 
43
- const stat = await Bun.file(absolutePath)
44
- .stat()
45
- .catch(() => undefined);
46
- if (!stat || !stat.isFile()) {
43
+ const fileStat = await stat(absolutePath).catch(() => undefined);
44
+ if (!fileStat || !fileStat.isFile()) {
47
45
  continue;
48
46
  }
49
47
 
50
48
  output.push({
51
49
  relativePath: relative(root, absolutePath),
52
50
  absolutePath,
53
- size: stat.size,
51
+ size: fileStat.size,
54
52
  });
55
53
  }
56
54
  };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { LLMTool, ToolConcurrencyMode, ToolExecutionContext } from './types';
2
+ import type { LLMTool, ToolConcurrencyMode, ToolExecutionContext } from './types';
3
3
  import { ToolExecutionError } from './error';
4
4
 
5
5
  export type ToolParameterSchema = z.ZodType;
@@ -6,7 +6,7 @@ import * as os from 'node:os';
6
6
  import * as path from 'node:path';
7
7
  import stripAnsi from 'strip-ansi';
8
8
  import { z } from 'zod';
9
- import { BaseTool, ToolResult } from './base-tool';
9
+ import { BaseTool, type ToolResult } from './base-tool';
10
10
  import { ToolExecutionError } from './error';
11
11
  import { evaluateBashPolicy, type BashPolicyEffect, type BashPolicyMode } from './bash-policy';
12
12
  import type { ToolExecutionContext } from './types';
@@ -2,7 +2,7 @@ import * as fs from 'node:fs/promises';
2
2
  import { createHash } from 'node:crypto';
3
3
  import { createTwoFilesPatch } from 'diff';
4
4
  import { z } from 'zod';
5
- import { BaseTool, ToolConfirmDetails, ToolResult } from './base-tool';
5
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
6
6
  import { ToolExecutionError } from './error';
7
7
  import {
8
8
  assessPathAccess,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BaseTool, ToolConfirmDetails, ToolResult } from './base-tool';
2
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
3
3
  import { ToolExecutionError } from './error';
4
4
  import {
5
5
  assessPathAccess,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BaseTool, ToolConfirmDetails, ToolResult } from './base-tool';
2
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
3
3
  import { ToolExecutionError } from './error';
4
4
  import {
5
5
  assessPathAccess,
@@ -1,7 +1,7 @@
1
1
  import * as fs from 'node:fs/promises';
2
2
  import { createHash } from 'node:crypto';
3
3
  import { z } from 'zod';
4
- import { BaseTool, ToolConfirmDetails, ToolResult } from './base-tool';
4
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
5
5
  import { ToolExecutionError } from './error';
6
6
  import {
7
7
  assessPathAccess,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BaseTool, ToolConfirmDetails, ToolResult } from './base-tool';
2
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
3
3
  import { ToolExecutionError } from './error';
4
4
  import { collectFilesByGlob, DEFAULT_IGNORE_GLOBS, resolveSearchRoot } from './search/common';
5
5
  import {
@@ -3,9 +3,9 @@ import * as path from 'node:path';
3
3
  import * as readline from 'node:readline';
4
4
  import { rgPath as vscodeRgPath } from '@vscode/ripgrep';
5
5
  import { z } from 'zod';
6
- import { BaseTool, ToolConfirmDetails, ToolResult } from './base-tool';
6
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
7
7
  import { ToolExecutionError } from './error';
8
- import { ToolExecutionContext } from './types';
8
+ import type { ToolExecutionContext } from './types';
9
9
  import { DEFAULT_IGNORE_GLOBS, resolveSearchRoot } from './search/common';
10
10
  import {
11
11
  assessPathAccess,
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import * as ts from 'typescript';
3
3
  import * as path from 'node:path';
4
4
  import * as fs from 'node:fs';
5
- import { BaseTool, ToolResult } from './base-tool';
5
+ import { BaseTool, type ToolResult } from './base-tool';
6
6
  import { ToolExecutionError } from './error';
7
7
  import { ensurePathWithinAllowed, normalizeAllowedDirectories } from './path-security';
8
8
  import { LSP_TOOL_DESCRIPTION } from './tool-prompts';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BaseTool, ToolResult } from './base-tool';
2
+ import { BaseTool, type ToolResult } from './base-tool';
3
3
  import { ToolExecutionError } from './error';
4
4
  import { formatSkillForContext } from './skill/parser';
5
5
  import { getSkillLoader, initializeSkillLoader } from './skill/loader';
@@ -4,16 +4,15 @@
4
4
  */
5
5
 
6
6
  import {
7
- LLMTool,
8
- ToolCall,
9
- ToolConcurrencyPolicy,
10
- ToolConfirmInfo,
11
- ToolPolicyCheckInfo,
12
- ToolPolicyDecision,
13
- ToolExecutionContext,
7
+ type LLMTool,
8
+ type ToolCall,
9
+ type ToolConcurrencyPolicy,
10
+ type ToolConfirmInfo,
11
+ type ToolPolicyCheckInfo,
12
+ type ToolPolicyDecision,
13
+ type ToolExecutionContext,
14
14
  } from './types';
15
- import { BaseTool, ToolConfirmDetails } from './base-tool';
16
- import { ToolResult } from './base-tool';
15
+ import { BaseTool, type ToolConfirmDetails, type ToolResult } from './base-tool';
17
16
  import {
18
17
  EmptyToolNameError,
19
18
  InvalidArgumentsError,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BaseTool, ToolResult } from './base-tool';
2
+ import { BaseTool, type ToolResult } from './base-tool';
3
3
  import { ToolExecutionError } from './error';
4
4
  import { WEB_FETCH_TOOL_DESCRIPTION } from './tool-prompts';
5
5
  import type { ToolExecutionContext } from './types';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BaseTool, ToolResult } from './base-tool';
2
+ import { BaseTool, type ToolResult } from './base-tool';
3
3
  import { ToolExecutionError } from './error';
4
4
  import { WEB_SEARCH_TOOL_DESCRIPTION } from './tool-prompts';
5
5
  import type { ToolExecutionContext } from './types';