@renxqoo/renx-code 0.0.3 → 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 +58 -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 -12
- 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 -48
- 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 -6
- package/dist/index.js.map +0 -1
- package/dist/run-cli-app.d.ts +0 -2
- package/dist/run-cli-app.d.ts.map +0 -1
- package/dist/run-cli-app.js +0 -41
- package/dist/run-cli-app.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/runtime-support.d.ts +0 -4
- package/dist/runtime/runtime-support.d.ts.map +0 -1
- package/dist/runtime/runtime-support.js +0 -19
- package/dist/runtime/runtime-support.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,146 +1,97 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenTUI Agent CLI (React + Bun)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://bun.sh/)
|
|
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
|
|
3
|
+
Initialized from the latest OpenTUI React template:
|
|
27
4
|
|
|
28
5
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
bun create tui --template react opentui-agent-cli
|
|
7
|
+
```
|
|
31
8
|
|
|
32
|
-
|
|
33
|
-
bun install -g @renxqoo/renx-code
|
|
9
|
+
Current package versions:
|
|
34
10
|
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
- `@opentui/core`: `0.1.84`
|
|
12
|
+
- `@opentui/react`: `0.1.84`
|
|
13
|
+
- `react`: `19.2.4`
|
|
37
14
|
|
|
38
|
-
|
|
15
|
+
## Run
|
|
39
16
|
|
|
40
17
|
```bash
|
|
41
|
-
|
|
42
|
-
renx
|
|
43
|
-
|
|
44
|
-
# Or run directly with bunx
|
|
45
|
-
bunx @renxqoo/renx-code
|
|
18
|
+
bun dev
|
|
46
19
|
```
|
|
47
20
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
### Prerequisites
|
|
51
|
-
|
|
52
|
-
- Bun 1.1.0 or higher
|
|
53
|
-
|
|
54
|
-
### Global Installation
|
|
21
|
+
Optional hot reload (less stable for interactive TUI signal handling):
|
|
55
22
|
|
|
56
23
|
```bash
|
|
57
|
-
bun
|
|
24
|
+
bun run dev:watch
|
|
58
25
|
```
|
|
59
26
|
|
|
60
|
-
|
|
27
|
+
## What is implemented
|
|
61
28
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
66
33
|
|
|
67
|
-
|
|
68
|
-
npm install @renxqoo/renx-code
|
|
34
|
+
## Main file
|
|
69
35
|
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
"scripts": {
|
|
73
|
-
"agent": "renx"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
36
|
+
- `src/index.tsx`
|
|
77
37
|
|
|
78
|
-
##
|
|
38
|
+
## Configuration
|
|
79
39
|
|
|
80
|
-
|
|
40
|
+
OpenTUI Agent CLI uses the shared Renx config system.
|
|
81
41
|
|
|
82
|
-
|
|
83
|
-
renx
|
|
84
|
-
```
|
|
42
|
+
Effective precedence is:
|
|
85
43
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
- View real-time AI responses
|
|
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
|
|
91
48
|
|
|
92
|
-
|
|
49
|
+
Directory-related state is managed from a single root:
|
|
93
50
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
| `Tab` | Auto-complete commands |
|
|
101
|
-
| `Enter` | Submit input |
|
|
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
|
|
102
57
|
|
|
103
|
-
|
|
58
|
+
## Supported Environment Variables
|
|
104
59
|
|
|
105
|
-
|
|
106
|
-
|---------|-------------|
|
|
107
|
-
| `/help` | Show available commands and shortcuts |
|
|
108
|
-
| `/clear` | Clear the conversation history |
|
|
109
|
-
| `/exit` | Exit the application |
|
|
110
|
-
| `/models` | List available AI models |
|
|
111
|
-
| `/files` | Show file browser |
|
|
112
|
-
| `/config` | Show current configuration |
|
|
113
|
-
| `/status` | Show system status |
|
|
60
|
+
Application/runtime variables:
|
|
114
61
|
|
|
115
|
-
|
|
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
|
|
116
69
|
|
|
117
|
-
|
|
70
|
+
Logging variables:
|
|
118
71
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
export AGENT_MODEL="gpt-4"
|
|
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
|
|
124
76
|
|
|
125
|
-
|
|
126
|
-
export AGENT_MAX_STEPS=1000
|
|
77
|
+
File history variables:
|
|
127
78
|
|
|
128
|
-
|
|
129
|
-
|
|
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`
|
|
130
83
|
|
|
131
|
-
|
|
132
|
-
export AGENT_LOG_LEVEL="INFO"
|
|
133
|
-
```
|
|
84
|
+
Model provider API keys are still provided through their own env vars such as `GLM_API_KEY`.
|
|
134
85
|
|
|
135
|
-
|
|
86
|
+
## Config File Shape
|
|
136
87
|
|
|
137
|
-
|
|
88
|
+
Global and project config files use the same JSON structure:
|
|
138
89
|
|
|
139
90
|
```json
|
|
140
91
|
{
|
|
141
92
|
"agent": {
|
|
142
|
-
"defaultModel": "
|
|
143
|
-
"maxSteps":
|
|
93
|
+
"defaultModel": "qwen3.5-plus",
|
|
94
|
+
"maxSteps": 10000,
|
|
144
95
|
"confirmationMode": "manual"
|
|
145
96
|
},
|
|
146
97
|
"log": {
|
|
@@ -160,120 +111,4 @@ Create a configuration file at `~/.renx/config.json`:
|
|
|
160
111
|
}
|
|
161
112
|
```
|
|
162
113
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
Create a project-specific config at `.renx/config.json` in your project root.
|
|
166
|
-
|
|
167
|
-
## 🔧 Development
|
|
168
|
-
|
|
169
|
-
### Setup
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
# Clone the repository
|
|
173
|
-
git clone https://github.com/renxqoo/renx-code.git
|
|
174
|
-
cd renx-code
|
|
175
|
-
|
|
176
|
-
# Install dependencies
|
|
177
|
-
npm install
|
|
178
|
-
|
|
179
|
-
# Start development server
|
|
180
|
-
npm run dev
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Build
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
# Build for production
|
|
187
|
-
npm run build
|
|
188
|
-
|
|
189
|
-
# Build CLI executable
|
|
190
|
-
npm run build:cli
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Testing
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Run tests
|
|
197
|
-
npm test
|
|
198
|
-
|
|
199
|
-
# Run tests with coverage
|
|
200
|
-
npm run test:coverage
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Linting and Formatting
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
# Fix linting issues
|
|
207
|
-
npm run lint:fix
|
|
208
|
-
|
|
209
|
-
# Format code
|
|
210
|
-
npm run format
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## 📁 Project Structure
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
@renxqoo/renx-code/
|
|
217
|
-
├── src/
|
|
218
|
-
│ ├── agent/ # AI agent logic
|
|
219
|
-
│ ├── commands/ # Slash commands
|
|
220
|
-
│ ├── components/ # React components
|
|
221
|
-
│ ├── runtime/ # Runtime utilities
|
|
222
|
-
│ ├── ui/ # UI themes and styling
|
|
223
|
-
│ ├── utils/ # Utility functions
|
|
224
|
-
│ ├── App.tsx # Main application component
|
|
225
|
-
│ ├── cli.tsx # CLI entry point
|
|
226
|
-
│ └── index.tsx # Library entry point
|
|
227
|
-
├── dist/ # Compiled output
|
|
228
|
-
├── package.json # Package configuration
|
|
229
|
-
├── tsconfig.json # TypeScript configuration
|
|
230
|
-
├── tsconfig.build.json # Build TypeScript configuration
|
|
231
|
-
└── README.md # This file
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
## 🤝 Contributing
|
|
235
|
-
|
|
236
|
-
1. Fork the repository
|
|
237
|
-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
238
|
-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
239
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
240
|
-
5. Open a Pull Request
|
|
241
|
-
|
|
242
|
-
### Development Guidelines
|
|
243
|
-
|
|
244
|
-
- Follow TypeScript best practices
|
|
245
|
-
- Write tests for new features
|
|
246
|
-
- Update documentation as needed
|
|
247
|
-
- Follow the existing code style
|
|
248
|
-
|
|
249
|
-
## 📄 License
|
|
250
|
-
|
|
251
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
252
|
-
|
|
253
|
-
## 🙏 Acknowledgments
|
|
254
|
-
|
|
255
|
-
- [OpenTUI](https://github.com/opentui/opentui) - Terminal UI framework
|
|
256
|
-
- [React](https://react.dev/) - UI library
|
|
257
|
-
- [TypeScript](https://www.typescriptlang.org/) - Type safety
|
|
258
|
-
- [Vitest](https://vitest.dev/) - Testing framework
|
|
259
|
-
|
|
260
|
-
## 📞 Support
|
|
261
|
-
|
|
262
|
-
- **Issues**: [GitHub Issues](https://github.com/renxqoo/renx-code/issues)
|
|
263
|
-
- **Discussions**: [GitHub Discussions](https://github.com/renxqoo/renx-code/discussions)
|
|
264
|
-
- **Documentation**: [Wiki](https://github.com/renxqoo/renx-code/wiki)
|
|
265
|
-
|
|
266
|
-
## 🚀 Roadmap
|
|
267
|
-
|
|
268
|
-
- [ ] Plugin system for custom commands
|
|
269
|
-
- [ ] Multi-model support
|
|
270
|
-
- [ ] Codebase analysis features
|
|
271
|
-
- [ ] Integration with popular IDEs
|
|
272
|
-
- [ ] Cloud sync for configurations
|
|
273
|
-
- [ ] Team collaboration features
|
|
274
|
-
- [ ] Performance optimizations
|
|
275
|
-
- [ ] Enhanced error handling and recovery
|
|
276
|
-
|
|
277
|
-
---
|
|
278
|
-
|
|
279
|
-
**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
|
-
"bun": ">=1.1.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
|
}
|