@renxqoo/renx-code 0.0.2 → 0.0.4
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 +59 -223
- package/bin/renx.cjs +34 -0
- package/package.json +27 -83
- package/src/App.tsx +297 -0
- package/src/agent/runtime/event-format.ts +258 -0
- package/src/agent/runtime/model-types.ts +13 -0
- package/src/agent/runtime/runtime.context-usage.test.ts +193 -0
- package/src/agent/runtime/runtime.error-handling.test.ts +236 -0
- package/src/agent/runtime/runtime.simple.test.ts +16 -0
- package/src/agent/runtime/runtime.test.ts +293 -0
- package/src/agent/runtime/runtime.ts +881 -0
- package/src/agent/runtime/runtime.usage-forwarding.test.ts +229 -0
- package/src/agent/runtime/source-modules.test.ts +57 -0
- package/src/agent/runtime/source-modules.ts +353 -0
- package/src/agent/runtime/tool-call-buffer.test.ts +65 -0
- package/src/agent/runtime/tool-call-buffer.ts +60 -0
- package/src/agent/runtime/tool-confirmation.test.ts +56 -0
- package/src/agent/runtime/tool-confirmation.ts +15 -0
- package/src/agent/runtime/types.ts +99 -0
- package/src/commands/slash-commands.test.ts +216 -0
- package/src/commands/slash-commands.ts +64 -0
- package/src/components/chat/assistant-reply.test.tsx +47 -0
- package/src/components/chat/assistant-reply.tsx +136 -0
- package/src/components/chat/assistant-segment.test.ts +99 -0
- package/src/components/chat/assistant-segment.tsx +125 -0
- package/src/components/chat/assistant-tool-group.tsx +900 -0
- package/src/components/chat/code-block.test.tsx +206 -0
- package/src/components/chat/code-block.tsx +313 -0
- package/src/components/chat/prompt-card.tsx +81 -0
- package/src/components/chat/segment-groups.test.ts +52 -0
- package/src/components/chat/segment-groups.ts +106 -0
- package/src/components/chat/turn-item.tsx +39 -0
- package/src/components/conversation-panel.tsx +43 -0
- package/src/components/file-mention-menu.tsx +77 -0
- package/src/components/file-picker-dialog.tsx +206 -0
- package/src/components/footer-hints.tsx +75 -0
- package/src/components/model-picker-dialog.tsx +248 -0
- package/src/components/prompt.tsx +233 -0
- package/src/components/slash-command-menu.tsx +65 -0
- package/src/components/tool-confirm-dialog-content.test.ts +103 -0
- package/src/components/tool-confirm-dialog-content.ts +186 -0
- package/src/components/tool-confirm-dialog.tsx +187 -0
- package/src/components/tool-display-config.ts +119 -0
- package/src/context-usage-regressions.test.ts +26 -0
- package/src/files/attachment-capabilities.test.ts +30 -0
- package/src/files/attachment-capabilities.ts +50 -0
- package/src/files/attachment-content.ts +153 -0
- package/src/files/file-mention-query.test.ts +34 -0
- package/src/files/file-mention-query.ts +32 -0
- package/src/files/prompt-display.ts +13 -0
- package/src/files/types.ts +5 -0
- package/src/files/workspace-files.ts +63 -0
- package/src/hooks/agent-event-handlers.test.ts +207 -0
- package/src/hooks/agent-event-handlers.ts +196 -0
- package/src/hooks/chat-local-replies.fixed.test.ts +119 -0
- package/src/hooks/chat-local-replies.test.ts +153 -0
- package/src/hooks/chat-local-replies.ts +63 -0
- package/src/hooks/turn-updater.test.ts +70 -0
- package/src/hooks/turn-updater.ts +166 -0
- package/src/hooks/use-agent-chat.context.test.ts +10 -0
- package/src/hooks/use-agent-chat.status.test.ts +14 -0
- package/src/hooks/use-agent-chat.test.ts +80 -0
- package/src/hooks/use-agent-chat.ts +621 -0
- package/src/hooks/use-file-mention-menu.ts +196 -0
- package/src/hooks/use-file-picker.ts +185 -0
- package/src/hooks/use-model-picker.ts +196 -0
- package/src/hooks/use-slash-command-menu.ts +154 -0
- package/src/index.tsx +55 -0
- package/src/runtime/clipboard.test.ts +43 -0
- package/src/runtime/clipboard.ts +89 -0
- package/src/runtime/exit.test.ts +177 -0
- package/src/runtime/exit.ts +98 -0
- package/src/runtime/runtime-support.test.ts +31 -0
- package/src/runtime/terminal-theme.test.ts +55 -0
- package/src/runtime/terminal-theme.ts +196 -0
- package/src/types/chat.ts +32 -0
- package/src/types/message-content.ts +48 -0
- package/src/ui/open-code-theme.ts +176 -0
- package/src/ui/opencode-markdown.ts +211 -0
- package/src/ui/theme.simple.test.ts +52 -0
- package/src/ui/theme.test.ts +151 -0
- package/src/ui/theme.ts +152 -0
- package/src/utils/time.test.ts +144 -0
- package/src/utils/time.ts +7 -0
- package/tsconfig.json +30 -0
- package/LICENSE +0 -21
- package/dist/App.d.ts +0 -2
- package/dist/App.d.ts.map +0 -1
- package/dist/App.js +0 -170
- package/dist/App.js.map +0 -1
- package/dist/agent/prompts/system.d.ts +0 -24
- package/dist/agent/prompts/system.d.ts.map +0 -1
- package/dist/agent/prompts/system.js +0 -222
- package/dist/agent/prompts/system.js.map +0 -1
- package/dist/agent/runtime/event-format.d.ts +0 -17
- package/dist/agent/runtime/event-format.d.ts.map +0 -1
- package/dist/agent/runtime/event-format.js +0 -194
- package/dist/agent/runtime/event-format.js.map +0 -1
- package/dist/agent/runtime/model-types.d.ts +0 -13
- package/dist/agent/runtime/model-types.d.ts.map +0 -1
- package/dist/agent/runtime/model-types.js +0 -1
- package/dist/agent/runtime/model-types.js.map +0 -1
- package/dist/agent/runtime/runtime.d.ts +0 -16
- package/dist/agent/runtime/runtime.d.ts.map +0 -1
- package/dist/agent/runtime/runtime.js +0 -691
- package/dist/agent/runtime/runtime.js.map +0 -1
- package/dist/agent/runtime/source-modules.d.ts +0 -176
- package/dist/agent/runtime/source-modules.d.ts.map +0 -1
- package/dist/agent/runtime/source-modules.js +0 -110
- package/dist/agent/runtime/source-modules.js.map +0 -1
- package/dist/agent/runtime/tool-call-buffer.d.ts +0 -12
- package/dist/agent/runtime/tool-call-buffer.d.ts.map +0 -1
- package/dist/agent/runtime/tool-call-buffer.js +0 -48
- package/dist/agent/runtime/tool-call-buffer.js.map +0 -1
- package/dist/agent/runtime/tool-confirmation.d.ts +0 -3
- package/dist/agent/runtime/tool-confirmation.d.ts.map +0 -1
- package/dist/agent/runtime/tool-confirmation.js +0 -9
- package/dist/agent/runtime/tool-confirmation.js.map +0 -1
- package/dist/agent/runtime/types.d.ts +0 -86
- package/dist/agent/runtime/types.d.ts.map +0 -1
- package/dist/agent/runtime/types.js +0 -1
- package/dist/agent/runtime/types.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -43
- package/dist/cli.js.map +0 -1
- package/dist/commands/slash-commands.d.ts +0 -11
- package/dist/commands/slash-commands.d.ts.map +0 -1
- package/dist/commands/slash-commands.js +0 -48
- package/dist/commands/slash-commands.js.map +0 -1
- package/dist/components/chat/assistant-reply.d.ts +0 -13
- package/dist/components/chat/assistant-reply.d.ts.map +0 -1
- package/dist/components/chat/assistant-reply.js +0 -78
- package/dist/components/chat/assistant-reply.js.map +0 -1
- package/dist/components/chat/assistant-segment.d.ts +0 -8
- package/dist/components/chat/assistant-segment.d.ts.map +0 -1
- package/dist/components/chat/assistant-segment.js +0 -54
- package/dist/components/chat/assistant-segment.js.map +0 -1
- package/dist/components/chat/assistant-tool-group.d.ts +0 -7
- package/dist/components/chat/assistant-tool-group.d.ts.map +0 -1
- package/dist/components/chat/assistant-tool-group.js +0 -695
- package/dist/components/chat/assistant-tool-group.js.map +0 -1
- package/dist/components/chat/code-block.d.ts +0 -16
- package/dist/components/chat/code-block.d.ts.map +0 -1
- package/dist/components/chat/code-block.js +0 -194
- package/dist/components/chat/code-block.js.map +0 -1
- package/dist/components/chat/prompt-card.d.ts +0 -9
- package/dist/components/chat/prompt-card.d.ts.map +0 -1
- package/dist/components/chat/prompt-card.js +0 -18
- package/dist/components/chat/prompt-card.js.map +0 -1
- package/dist/components/chat/segment-groups.d.ts +0 -24
- package/dist/components/chat/segment-groups.d.ts.map +0 -1
- package/dist/components/chat/segment-groups.js +0 -69
- package/dist/components/chat/segment-groups.js.map +0 -1
- package/dist/components/chat/turn-item.d.ts +0 -9
- package/dist/components/chat/turn-item.d.ts.map +0 -1
- package/dist/components/chat/turn-item.js +0 -11
- package/dist/components/chat/turn-item.js.map +0 -1
- package/dist/components/conversation-panel.d.ts +0 -8
- package/dist/components/conversation-panel.d.ts.map +0 -1
- package/dist/components/conversation-panel.js +0 -8
- package/dist/components/conversation-panel.js.map +0 -1
- package/dist/components/file-mention-menu.d.ts +0 -11
- package/dist/components/file-mention-menu.d.ts.map +0 -1
- package/dist/components/file-mention-menu.js +0 -15
- package/dist/components/file-mention-menu.js.map +0 -1
- package/dist/components/file-picker-dialog.d.ts +0 -21
- package/dist/components/file-picker-dialog.d.ts.map +0 -1
- package/dist/components/file-picker-dialog.js +0 -48
- package/dist/components/file-picker-dialog.js.map +0 -1
- package/dist/components/footer-hints.d.ts +0 -7
- package/dist/components/footer-hints.d.ts.map +0 -1
- package/dist/components/footer-hints.js +0 -29
- package/dist/components/footer-hints.js.map +0 -1
- package/dist/components/model-picker-dialog.d.ts +0 -20
- package/dist/components/model-picker-dialog.d.ts.map +0 -1
- package/dist/components/model-picker-dialog.js +0 -72
- package/dist/components/model-picker-dialog.js.map +0 -1
- package/dist/components/prompt.d.ts +0 -18
- package/dist/components/prompt.d.ts.map +0 -1
- package/dist/components/prompt.js +0 -96
- package/dist/components/prompt.js.map +0 -1
- package/dist/components/slash-command-menu.d.ts +0 -9
- package/dist/components/slash-command-menu.d.ts.map +0 -1
- package/dist/components/slash-command-menu.js +0 -20
- package/dist/components/slash-command-menu.js.map +0 -1
- package/dist/components/tool-confirm-dialog-content.d.ts +0 -15
- package/dist/components/tool-confirm-dialog-content.d.ts.map +0 -1
- package/dist/components/tool-confirm-dialog-content.js +0 -143
- package/dist/components/tool-confirm-dialog-content.js.map +0 -1
- package/dist/components/tool-confirm-dialog.d.ts +0 -12
- package/dist/components/tool-confirm-dialog.d.ts.map +0 -1
- package/dist/components/tool-confirm-dialog.js +0 -21
- package/dist/components/tool-confirm-dialog.js.map +0 -1
- package/dist/components/tool-display-config.d.ts +0 -11
- package/dist/components/tool-display-config.d.ts.map +0 -1
- package/dist/components/tool-display-config.js +0 -94
- package/dist/components/tool-display-config.js.map +0 -1
- package/dist/config/paths.d.ts +0 -7
- package/dist/config/paths.d.ts.map +0 -1
- package/dist/config/paths.js +0 -24
- package/dist/config/paths.js.map +0 -1
- package/dist/files/attachment-capabilities.d.ts +0 -19
- package/dist/files/attachment-capabilities.d.ts.map +0 -1
- package/dist/files/attachment-capabilities.js +0 -26
- package/dist/files/attachment-capabilities.js.map +0 -1
- package/dist/files/attachment-content.d.ts +0 -5
- package/dist/files/attachment-content.d.ts.map +0 -1
- package/dist/files/attachment-content.js +0 -117
- package/dist/files/attachment-content.js.map +0 -1
- package/dist/files/file-mention-query.d.ts +0 -9
- package/dist/files/file-mention-query.d.ts.map +0 -1
- package/dist/files/file-mention-query.js +0 -23
- package/dist/files/file-mention-query.js.map +0 -1
- package/dist/files/prompt-display.d.ts +0 -3
- package/dist/files/prompt-display.d.ts.map +0 -1
- package/dist/files/prompt-display.js +0 -11
- package/dist/files/prompt-display.js.map +0 -1
- package/dist/files/types.d.ts +0 -6
- package/dist/files/types.d.ts.map +0 -1
- package/dist/files/types.js +0 -1
- package/dist/files/types.js.map +0 -1
- package/dist/files/workspace-files.d.ts +0 -3
- package/dist/files/workspace-files.d.ts.map +0 -1
- package/dist/files/workspace-files.js +0 -50
- package/dist/files/workspace-files.js.map +0 -1
- package/dist/hooks/agent-event-handlers.d.ts +0 -11
- package/dist/hooks/agent-event-handlers.d.ts.map +0 -1
- package/dist/hooks/agent-event-handlers.js +0 -137
- package/dist/hooks/agent-event-handlers.js.map +0 -1
- package/dist/hooks/chat-local-replies.d.ts +0 -9
- package/dist/hooks/chat-local-replies.d.ts.map +0 -1
- package/dist/hooks/chat-local-replies.js +0 -54
- package/dist/hooks/chat-local-replies.js.map +0 -1
- package/dist/hooks/turn-updater.d.ts +0 -9
- package/dist/hooks/turn-updater.d.ts.map +0 -1
- package/dist/hooks/turn-updater.js +0 -103
- package/dist/hooks/turn-updater.js.map +0 -1
- package/dist/hooks/use-agent-chat.d.ts +0 -29
- package/dist/hooks/use-agent-chat.d.ts.map +0 -1
- package/dist/hooks/use-agent-chat.js +0 -455
- package/dist/hooks/use-agent-chat.js.map +0 -1
- package/dist/hooks/use-file-mention-menu.d.ts +0 -22
- package/dist/hooks/use-file-mention-menu.d.ts.map +0 -1
- package/dist/hooks/use-file-mention-menu.js +0 -137
- package/dist/hooks/use-file-mention-menu.js.map +0 -1
- package/dist/hooks/use-file-picker.d.ts +0 -21
- package/dist/hooks/use-file-picker.d.ts.map +0 -1
- package/dist/hooks/use-file-picker.js +0 -145
- package/dist/hooks/use-file-picker.js.map +0 -1
- package/dist/hooks/use-model-picker.d.ts +0 -23
- package/dist/hooks/use-model-picker.d.ts.map +0 -1
- package/dist/hooks/use-model-picker.js +0 -151
- package/dist/hooks/use-model-picker.js.map +0 -1
- package/dist/hooks/use-slash-command-menu.d.ts +0 -19
- package/dist/hooks/use-slash-command-menu.d.ts.map +0 -1
- package/dist/hooks/use-slash-command-menu.js +0 -101
- package/dist/hooks/use-slash-command-menu.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -39
- package/dist/index.js.map +0 -1
- package/dist/runtime/clipboard.d.ts +0 -10
- package/dist/runtime/clipboard.d.ts.map +0 -1
- package/dist/runtime/clipboard.js +0 -64
- package/dist/runtime/clipboard.js.map +0 -1
- package/dist/runtime/exit.d.ts +0 -7
- package/dist/runtime/exit.d.ts.map +0 -1
- package/dist/runtime/exit.js +0 -85
- package/dist/runtime/exit.js.map +0 -1
- package/dist/runtime/terminal-theme.d.ts +0 -25
- package/dist/runtime/terminal-theme.d.ts.map +0 -1
- package/dist/runtime/terminal-theme.js +0 -148
- package/dist/runtime/terminal-theme.js.map +0 -1
- package/dist/types/chat.d.ts +0 -29
- package/dist/types/chat.d.ts.map +0 -1
- package/dist/types/chat.js +0 -1
- package/dist/types/chat.js.map +0 -1
- package/dist/types/message-content.d.ts +0 -38
- package/dist/types/message-content.d.ts.map +0 -1
- package/dist/types/message-content.js +0 -1
- package/dist/types/message-content.js.map +0 -1
- package/dist/ui/open-code-theme.d.ts +0 -58
- package/dist/ui/open-code-theme.d.ts.map +0 -1
- package/dist/ui/open-code-theme.js +0 -113
- package/dist/ui/open-code-theme.js.map +0 -1
- package/dist/ui/opencode-markdown.d.ts +0 -7
- package/dist/ui/opencode-markdown.d.ts.map +0 -1
- package/dist/ui/opencode-markdown.js +0 -169
- package/dist/ui/opencode-markdown.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -68
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -80
- package/dist/ui/theme.js.map +0 -1
- package/dist/utils/time.d.ts +0 -2
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js +0 -7
- package/dist/utils/time.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,145 +1,97 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenTUI Agent CLI (React + Bun)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://nodejs.org/)
|
|
6
|
-
[](https://www.typescriptlang.org/)
|
|
7
|
-
[](https://react.dev/)
|
|
8
|
-
[](https://github.com/opentui/opentui)
|
|
9
|
-
|
|
10
|
-
Enterprise-grade AI coding assistant CLI tool with interactive terminal UI, built with React and OpenTUI.
|
|
11
|
-
|
|
12
|
-
## ✨ Features
|
|
13
|
-
|
|
14
|
-
- **Interactive Terminal UI**: Beautiful, responsive terminal interface built with React and OpenTUI
|
|
15
|
-
- **AI-Powered Assistance**: Intelligent code suggestions and completions
|
|
16
|
-
- **Slash Commands**: Built-in commands for common operations (`/help`, `/clear`, `/exit`, `/models`, `/files`)
|
|
17
|
-
- **Keyboard Shortcuts**: Efficient navigation and control
|
|
18
|
-
- **Configurable**: Extensive configuration options via environment variables and config files
|
|
19
|
-
- **Cross-Platform**: Works on Windows, macOS, and Linux
|
|
20
|
-
- **TypeScript**: Full type safety and excellent developer experience
|
|
21
|
-
- **Real-time Updates**: Live terminal updates with smooth animations
|
|
22
|
-
- **Theme Support**: Customizable UI themes and markdown rendering
|
|
23
|
-
|
|
24
|
-
## 🚀 Quick Start
|
|
25
|
-
|
|
26
|
-
### Installation
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# Install globally
|
|
30
|
-
npm install -g @renxqoo/renx-code
|
|
31
|
-
|
|
32
|
-
# Or use npx
|
|
33
|
-
npx @renxqoo/renx-code
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Basic Usage
|
|
3
|
+
Initialized from the latest OpenTUI React template:
|
|
37
4
|
|
|
38
5
|
```bash
|
|
39
|
-
|
|
40
|
-
renx
|
|
41
|
-
|
|
42
|
-
# Or run directly with npx
|
|
43
|
-
npx @renxqoo/renx-code
|
|
6
|
+
bun create tui --template react opentui-agent-cli
|
|
44
7
|
```
|
|
45
8
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Prerequisites
|
|
9
|
+
Current package versions:
|
|
49
10
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
11
|
+
- `@opentui/core`: `0.1.84`
|
|
12
|
+
- `@opentui/react`: `0.1.84`
|
|
13
|
+
- `react`: `19.2.4`
|
|
52
14
|
|
|
53
|
-
|
|
15
|
+
## Run
|
|
54
16
|
|
|
55
17
|
```bash
|
|
56
|
-
|
|
18
|
+
bun dev
|
|
57
19
|
```
|
|
58
20
|
|
|
59
|
-
|
|
21
|
+
Optional hot reload (less stable for interactive TUI signal handling):
|
|
60
22
|
|
|
61
23
|
```bash
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
npm init -y
|
|
24
|
+
bun run dev:watch
|
|
25
|
+
```
|
|
65
26
|
|
|
66
|
-
|
|
67
|
-
npm install @renxqoo/renx-code
|
|
27
|
+
## What is implemented
|
|
68
28
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
29
|
+
- Agent-style CLI chat layout (header, conversation panel, prompt input)
|
|
30
|
+
- Built-in commands: `/help`, `/clear`, `/exit`
|
|
31
|
+
- Keyboard shortcuts: `Esc` (stop current response when thinking, otherwise clear input), `Ctrl+L` (clear conversation)
|
|
32
|
+
- Simulated async agent reply flow
|
|
76
33
|
|
|
77
|
-
##
|
|
34
|
+
## Main file
|
|
78
35
|
|
|
79
|
-
|
|
36
|
+
- `src/index.tsx`
|
|
80
37
|
|
|
81
|
-
|
|
82
|
-
renx
|
|
83
|
-
```
|
|
38
|
+
## Configuration
|
|
84
39
|
|
|
85
|
-
|
|
86
|
-
- Type natural language queries
|
|
87
|
-
- Use slash commands (`/help`, `/clear`, `/exit`)
|
|
88
|
-
- Navigate with keyboard shortcuts
|
|
89
|
-
- View real-time AI responses
|
|
40
|
+
OpenTUI Agent CLI uses the shared Renx config system.
|
|
90
41
|
|
|
91
|
-
|
|
42
|
+
Effective precedence is:
|
|
92
43
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
| `Ctrl+C` | Exit application |
|
|
98
|
-
| `↑/↓` | Navigate command history |
|
|
99
|
-
| `Tab` | Auto-complete commands |
|
|
100
|
-
| `Enter` | Submit input |
|
|
44
|
+
1. Existing process environment variables plus values loaded from `.env` / `.env.development`
|
|
45
|
+
2. Project config: `<workspace>/.renx/config.json`
|
|
46
|
+
3. Global config: `RENX_HOME/config.json`
|
|
47
|
+
4. Built-in defaults
|
|
101
48
|
|
|
102
|
-
|
|
49
|
+
Directory-related state is managed from a single root:
|
|
103
50
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
| `/files` | Show file browser |
|
|
111
|
-
| `/config` | Show current configuration |
|
|
112
|
-
| `/status` | Show system status |
|
|
51
|
+
- `RENX_HOME` defaults to `~/.renx`
|
|
52
|
+
- `RENX_HOME/config.json` for global config
|
|
53
|
+
- `RENX_HOME/logs/` for log files
|
|
54
|
+
- `RENX_HOME/storage/` for file-history storage
|
|
55
|
+
- `RENX_HOME/task/` for task data
|
|
56
|
+
- `RENX_HOME/data.db` for the shared SQLite database
|
|
113
57
|
|
|
114
|
-
##
|
|
58
|
+
## Supported Environment Variables
|
|
115
59
|
|
|
116
|
-
|
|
60
|
+
Application/runtime variables:
|
|
117
61
|
|
|
118
|
-
|
|
62
|
+
- `RENX_HOME`: overrides the user-level Renx home directory
|
|
63
|
+
- `AGENT_MODEL`: default model id
|
|
64
|
+
- `AGENT_MAX_STEPS`: max steps per run
|
|
65
|
+
- `AGENT_MAX_RETRY_COUNT`: agent retry count
|
|
66
|
+
- `AGENT_TOOL_CONFIRMATION_MODE`: `manual`, `auto-approve`, or `auto-deny`
|
|
67
|
+
- `AGENT_CONVERSATION_ID`: fixed conversation id for the CLI runtime
|
|
68
|
+
- `AGENT_SESSION_ID`: fallback session id when `AGENT_CONVERSATION_ID` is unset
|
|
119
69
|
|
|
120
|
-
|
|
121
|
-
# Set the AI model
|
|
122
|
-
export AGENT_MODEL="gpt-4"
|
|
70
|
+
Logging variables:
|
|
123
71
|
|
|
124
|
-
|
|
125
|
-
|
|
72
|
+
- `AGENT_LOG_LEVEL`: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, or `FATAL`
|
|
73
|
+
- `AGENT_LOG_FORMAT`: `pretty` or `json`
|
|
74
|
+
- `AGENT_LOG_CONSOLE`: enable/disable console logging
|
|
75
|
+
- `AGENT_LOG_FILE_ENABLED`: enable/disable file logging
|
|
126
76
|
|
|
127
|
-
|
|
128
|
-
export AGENT_TOOL_CONFIRMATION_MODE="manual"
|
|
77
|
+
File history variables:
|
|
129
78
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
79
|
+
- `AGENT_FILE_HISTORY_ENABLED`
|
|
80
|
+
- `AGENT_FILE_HISTORY_MAX_PER_FILE`
|
|
81
|
+
- `AGENT_FILE_HISTORY_MAX_AGE_DAYS`
|
|
82
|
+
- `AGENT_FILE_HISTORY_MAX_TOTAL_MB`
|
|
83
|
+
|
|
84
|
+
Model provider API keys are still provided through their own env vars such as `GLM_API_KEY`.
|
|
133
85
|
|
|
134
|
-
|
|
86
|
+
## Config File Shape
|
|
135
87
|
|
|
136
|
-
|
|
88
|
+
Global and project config files use the same JSON structure:
|
|
137
89
|
|
|
138
90
|
```json
|
|
139
91
|
{
|
|
140
92
|
"agent": {
|
|
141
|
-
"defaultModel": "
|
|
142
|
-
"maxSteps":
|
|
93
|
+
"defaultModel": "qwen3.5-plus",
|
|
94
|
+
"maxSteps": 10000,
|
|
143
95
|
"confirmationMode": "manual"
|
|
144
96
|
},
|
|
145
97
|
"log": {
|
|
@@ -159,120 +111,4 @@ Create a configuration file at `~/.renx/config.json`:
|
|
|
159
111
|
}
|
|
160
112
|
```
|
|
161
113
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Create a project-specific config at `.renx/config.json` in your project root.
|
|
165
|
-
|
|
166
|
-
## 🔧 Development
|
|
167
|
-
|
|
168
|
-
### Setup
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Clone the repository
|
|
172
|
-
git clone https://github.com/renxqoo/renx-code.git
|
|
173
|
-
cd renx-code
|
|
174
|
-
|
|
175
|
-
# Install dependencies
|
|
176
|
-
npm install
|
|
177
|
-
|
|
178
|
-
# Start development server
|
|
179
|
-
npm run dev
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Build
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
# Build for production
|
|
186
|
-
npm run build
|
|
187
|
-
|
|
188
|
-
# Build CLI executable
|
|
189
|
-
npm run build:cli
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Testing
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
# Run tests
|
|
196
|
-
npm test
|
|
197
|
-
|
|
198
|
-
# Run tests with coverage
|
|
199
|
-
npm run test:coverage
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Linting and Formatting
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
# Fix linting issues
|
|
206
|
-
npm run lint:fix
|
|
207
|
-
|
|
208
|
-
# Format code
|
|
209
|
-
npm run format
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## 📁 Project Structure
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
@renxqoo/renx-code/
|
|
216
|
-
├── src/
|
|
217
|
-
│ ├── agent/ # AI agent logic
|
|
218
|
-
│ ├── commands/ # Slash commands
|
|
219
|
-
│ ├── components/ # React components
|
|
220
|
-
│ ├── runtime/ # Runtime utilities
|
|
221
|
-
│ ├── ui/ # UI themes and styling
|
|
222
|
-
│ ├── utils/ # Utility functions
|
|
223
|
-
│ ├── App.tsx # Main application component
|
|
224
|
-
│ ├── cli.tsx # CLI entry point
|
|
225
|
-
│ └── index.tsx # Library entry point
|
|
226
|
-
├── dist/ # Compiled output
|
|
227
|
-
├── package.json # Package configuration
|
|
228
|
-
├── tsconfig.json # TypeScript configuration
|
|
229
|
-
├── tsconfig.build.json # Build TypeScript configuration
|
|
230
|
-
└── README.md # This file
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## 🤝 Contributing
|
|
234
|
-
|
|
235
|
-
1. Fork the repository
|
|
236
|
-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
237
|
-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
238
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
239
|
-
5. Open a Pull Request
|
|
240
|
-
|
|
241
|
-
### Development Guidelines
|
|
242
|
-
|
|
243
|
-
- Follow TypeScript best practices
|
|
244
|
-
- Write tests for new features
|
|
245
|
-
- Update documentation as needed
|
|
246
|
-
- Follow the existing code style
|
|
247
|
-
|
|
248
|
-
## 📄 License
|
|
249
|
-
|
|
250
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
251
|
-
|
|
252
|
-
## 🙏 Acknowledgments
|
|
253
|
-
|
|
254
|
-
- [OpenTUI](https://github.com/opentui/opentui) - Terminal UI framework
|
|
255
|
-
- [React](https://react.dev/) - UI library
|
|
256
|
-
- [TypeScript](https://www.typescriptlang.org/) - Type safety
|
|
257
|
-
- [Vitest](https://vitest.dev/) - Testing framework
|
|
258
|
-
|
|
259
|
-
## 📞 Support
|
|
260
|
-
|
|
261
|
-
- **Issues**: [GitHub Issues](https://github.com/renxqoo/renx-code/issues)
|
|
262
|
-
- **Discussions**: [GitHub Discussions](https://github.com/renxqoo/renx-code/discussions)
|
|
263
|
-
- **Documentation**: [Wiki](https://github.com/renxqoo/renx-code/wiki)
|
|
264
|
-
|
|
265
|
-
## 🚀 Roadmap
|
|
266
|
-
|
|
267
|
-
- [ ] Plugin system for custom commands
|
|
268
|
-
- [ ] Multi-model support
|
|
269
|
-
- [ ] Codebase analysis features
|
|
270
|
-
- [ ] Integration with popular IDEs
|
|
271
|
-
- [ ] Cloud sync for configurations
|
|
272
|
-
- [ ] Team collaboration features
|
|
273
|
-
- [ ] Performance optimizations
|
|
274
|
-
- [ ] Enhanced error handling and recovery
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
**Note**: This is an enterprise-grade tool designed for professional developers. Please ensure you have appropriate API keys and permissions for the AI models you intend to use.
|
|
114
|
+
There are no per-directory config fields anymore. All user-level paths are derived from `RENX_HOME`.
|
package/bin/renx.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const childProcess = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
8
|
+
const entryPath = path.join(packageRoot, "src", "index.tsx");
|
|
9
|
+
const bunExecutable = process.env.RENX_BUN_PATH || "bun";
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(entryPath)) {
|
|
12
|
+
console.error(`Could not find CLI entrypoint: ${entryPath}`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const result = childProcess.spawnSync(bunExecutable, [entryPath, ...process.argv.slice(2)], {
|
|
17
|
+
cwd: process.cwd(),
|
|
18
|
+
stdio: "inherit",
|
|
19
|
+
env: {
|
|
20
|
+
...process.env,
|
|
21
|
+
AGENT_WORKDIR: process.env.AGENT_WORKDIR || process.cwd(),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (result.error) {
|
|
26
|
+
if (result.error.code === "ENOENT") {
|
|
27
|
+
console.error("Bun is required to run renx. Install Bun first: https://bun.sh");
|
|
28
|
+
} else {
|
|
29
|
+
console.error(result.error.message);
|
|
30
|
+
}
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
process.exit(typeof result.status === "number" ? result.status : 0);
|
package/package.json
CHANGED
|
@@ -1,71 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@renxqoo/renx-code",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"module": "src/index.tsx",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"private": false,
|
|
8
7
|
"bin": {
|
|
9
|
-
"renx": "./
|
|
10
|
-
},
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
15
|
-
},
|
|
16
|
-
"./cli": {
|
|
17
|
-
"import": "./dist/cli.js"
|
|
18
|
-
}
|
|
8
|
+
"renx": "./bin/renx.cjs"
|
|
19
9
|
},
|
|
20
10
|
"files": [
|
|
21
|
-
"
|
|
11
|
+
"bin",
|
|
12
|
+
"src",
|
|
22
13
|
"README.md",
|
|
23
|
-
"
|
|
14
|
+
"tsconfig.json"
|
|
24
15
|
],
|
|
25
16
|
"scripts": {
|
|
26
17
|
"dev": "bun run src/index.tsx",
|
|
27
18
|
"dev:watch": "bun run --watch src/index.tsx",
|
|
28
|
-
"build": "tsc -p tsconfig.build.json && node ./scripts/fix-esm-imports.mjs",
|
|
29
|
-
"build:cli": "npm run build && node -e \"require('fs').chmodSync('dist/cli.js', 0o755)\"",
|
|
30
|
-
"start": "node dist/index.js",
|
|
31
|
-
"test": "vitest",
|
|
32
|
-
"test:coverage": "vitest run --coverage",
|
|
33
19
|
"lint": "eslint . --ext .ts,.tsx",
|
|
34
20
|
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
35
21
|
"format": "prettier --write .",
|
|
36
22
|
"format:check": "prettier --check .",
|
|
23
|
+
"test:run": "bun test src/context-usage-regressions.test.ts src/ui/theme.simple.test.ts src/ui/theme.test.ts src/runtime/exit.test.ts src/runtime/clipboard.test.ts src/runtime/terminal-theme.test.ts src/utils/time.test.ts src/components/tool-confirm-dialog-content.test.ts src/hooks/chat-local-replies.fixed.test.ts src/hooks/chat-local-replies.test.ts src/hooks/turn-updater.test.ts src/hooks/agent-event-handlers.test.ts src/hooks/use-agent-chat.status.test.ts src/files/attachment-capabilities.test.ts src/files/file-mention-query.test.ts src/commands/slash-commands.test.ts src/agent/runtime/runtime.simple.test.ts src/agent/runtime/tool-call-buffer.test.ts src/components/chat/assistant-reply.test.tsx src/components/chat/assistant-segment.test.ts src/components/chat/code-block.test.tsx src/components/chat/segment-groups.test.ts",
|
|
37
24
|
"type-check": "tsc --noEmit",
|
|
38
25
|
"check": "bun run type-check && bun run lint && bun run format:check",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"publish:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"react",
|
|
54
|
-
"assistant",
|
|
55
|
-
"developer-tools",
|
|
56
|
-
"productivity",
|
|
57
|
-
"opentui"
|
|
58
|
-
],
|
|
59
|
-
"author": "",
|
|
60
|
-
"license": "MIT",
|
|
61
|
-
"repository": {
|
|
62
|
-
"type": "git",
|
|
63
|
-
"url": "https://github.com/renxqoo/renx-code.git"
|
|
26
|
+
"pack:dry": "npm pack --dry-run",
|
|
27
|
+
"pack:tgz": "npm pack",
|
|
28
|
+
"version:fix": "npm version patch",
|
|
29
|
+
"version:feature": "npm version minor",
|
|
30
|
+
"version:breaking": "npm version major",
|
|
31
|
+
"publish:fix": "npm run version:fix && npm publish",
|
|
32
|
+
"publish:feature": "npm run version:feature && npm publish",
|
|
33
|
+
"publish:breaking": "npm run version:breaking && npm publish",
|
|
34
|
+
"publish:patch": "npm run publish:fix",
|
|
35
|
+
"publish:minor": "npm run publish:feature",
|
|
36
|
+
"publish:major": "npm run publish:breaking",
|
|
37
|
+
"proxy": "w2 start",
|
|
38
|
+
"proxy:stop": "w2 stop",
|
|
39
|
+
"proxy:restart": "w2 restart"
|
|
64
40
|
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=20.0.0",
|
|
43
|
+
"bun": ">=1.1.0"
|
|
67
44
|
},
|
|
68
|
-
"homepage": "https://github.com/renxqoo/renx-code#readme",
|
|
69
45
|
"devDependencies": {
|
|
70
46
|
"@eslint/js": "^10.0.1",
|
|
71
47
|
"@testing-library/react": "^16.3.2",
|
|
@@ -83,11 +59,7 @@
|
|
|
83
59
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
84
60
|
"globals": "^17.4.0",
|
|
85
61
|
"prettier": "^3.8.1",
|
|
86
|
-
"whistle": "^2.10.1"
|
|
87
|
-
"husky": "^8.0.3",
|
|
88
|
-
"lint-staged": "^16.3.2",
|
|
89
|
-
"typescript": "^5.9.3",
|
|
90
|
-
"vitest": "^1.1.0"
|
|
62
|
+
"whistle": "^2.10.1"
|
|
91
63
|
},
|
|
92
64
|
"peerDependencies": {
|
|
93
65
|
"typescript": "^5.9.3"
|
|
@@ -95,34 +67,6 @@
|
|
|
95
67
|
"dependencies": {
|
|
96
68
|
"@opentui/core": "^0.1.84",
|
|
97
69
|
"@opentui/react": "^0.1.84",
|
|
98
|
-
"react": "^19.2.4"
|
|
99
|
-
"@vscode/ripgrep": "^1.17.0",
|
|
100
|
-
"diff": "^8.0.3",
|
|
101
|
-
"dotenv": "^17.3.1",
|
|
102
|
-
"js-tiktoken": "^1.0.21",
|
|
103
|
-
"log-update": "^6.1.0",
|
|
104
|
-
"marked": "^15.0.12",
|
|
105
|
-
"marked-terminal": "^7.3.0",
|
|
106
|
-
"minimatch": "^10.2.4",
|
|
107
|
-
"shell-quote": "^1.8.3",
|
|
108
|
-
"strip-ansi": "^7.2.0",
|
|
109
|
-
"uuid": "^13.0.0",
|
|
110
|
-
"zod": "^4.3.6"
|
|
111
|
-
},
|
|
112
|
-
"engines": {
|
|
113
|
-
"node": ">=20.0.0"
|
|
114
|
-
},
|
|
115
|
-
"lint-staged": {
|
|
116
|
-
"*.ts": [
|
|
117
|
-
"prettier --write",
|
|
118
|
-
"eslint --fix"
|
|
119
|
-
],
|
|
120
|
-
"*.tsx": [
|
|
121
|
-
"prettier --write",
|
|
122
|
-
"eslint --fix"
|
|
123
|
-
],
|
|
124
|
-
"*.{json,md}": [
|
|
125
|
-
"prettier --write"
|
|
126
|
-
]
|
|
70
|
+
"react": "^19.2.4"
|
|
127
71
|
}
|
|
128
72
|
}
|