@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 +40 -45
- package/bin/renx.cjs +12 -7
- package/package.json +16 -4
- package/src/files/workspace-files.ts +4 -6
- package/vendor/agent-root/src/agent/tool/base-tool.ts +1 -1
- package/vendor/agent-root/src/agent/tool/bash.ts +1 -1
- package/vendor/agent-root/src/agent/tool/file-edit-tool.ts +1 -1
- package/vendor/agent-root/src/agent/tool/file-history-list.ts +1 -1
- package/vendor/agent-root/src/agent/tool/file-history-restore.ts +1 -1
- package/vendor/agent-root/src/agent/tool/file-read-tool.ts +1 -1
- package/vendor/agent-root/src/agent/tool/glob.ts +1 -1
- package/vendor/agent-root/src/agent/tool/grep.ts +2 -2
- package/vendor/agent-root/src/agent/tool/lsp.ts +1 -1
- package/vendor/agent-root/src/agent/tool/skill-tool.ts +1 -1
- package/vendor/agent-root/src/agent/tool/tool-manager.ts +8 -9
- package/vendor/agent-root/src/agent/tool/web-fetch.ts +1 -1
- package/vendor/agent-root/src/agent/tool/web-search.ts +1 -1
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
|
-
|
|
10
|
+
Requirements:
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
bun --version
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
如果还没有安装 Bun,请先安装:
|
|
12
|
+
- Node.js `20+`
|
|
17
13
|
|
|
18
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
58
|
+
Configuration priority:
|
|
62
59
|
|
|
63
|
-
1.
|
|
64
|
-
2.
|
|
65
|
-
3.
|
|
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
|
-
|
|
65
|
+
Default user data locations:
|
|
69
66
|
|
|
70
|
-
- `RENX_HOME
|
|
71
|
-
- `RENX_HOME/config.json
|
|
72
|
-
- `RENX_HOME/logs
|
|
73
|
-
- `RENX_HOME/storage
|
|
74
|
-
- `RENX_HOME/task
|
|
75
|
-
- `RENX_HOME/data.db
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
"
|
|
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
|
|
44
|
-
|
|
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:
|
|
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,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';
|