@renxqoo/renx-code 0.0.2 → 0.0.3
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 +12 -11
- package/dist/cli.js +6 -37
- package/dist/cli.js.map +1 -1
- package/dist/components/chat/assistant-reply.d.ts +1 -1
- package/dist/components/chat/assistant-segment.d.ts +1 -1
- package/dist/components/chat/assistant-tool-group.d.ts +1 -1
- package/dist/components/chat/turn-item.d.ts +1 -1
- package/dist/components/conversation-panel.d.ts +1 -1
- package/dist/components/file-mention-menu.d.ts +1 -1
- package/dist/components/file-picker-dialog.d.ts +1 -1
- package/dist/components/model-picker-dialog.d.ts +1 -1
- package/dist/components/prompt.d.ts +1 -1
- package/dist/components/slash-command-menu.d.ts +1 -1
- package/dist/components/tool-confirm-dialog.d.ts +1 -1
- package/dist/files/workspace-files.d.ts.map +1 -1
- package/dist/files/workspace-files.js +4 -6
- package/dist/files/workspace-files.js.map +1 -1
- package/dist/index.js +4 -37
- package/dist/index.js.map +1 -1
- package/dist/run-cli-app.d.ts +2 -0
- package/dist/run-cli-app.d.ts.map +1 -0
- package/dist/run-cli-app.js +41 -0
- package/dist/run-cli-app.js.map +1 -0
- package/dist/runtime/runtime-support.d.ts +4 -0
- package/dist/runtime/runtime-support.d.ts.map +1 -0
- package/dist/runtime/runtime-support.js +19 -0
- package/dist/runtime/runtime-support.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@renxqoo/renx-code)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://bun.sh/)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](https://react.dev/)
|
|
8
8
|
[](https://github.com/opentui/opentui)
|
|
@@ -26,11 +26,13 @@ Enterprise-grade AI coding assistant CLI tool with interactive terminal UI, buil
|
|
|
26
26
|
### Installation
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
#
|
|
30
|
-
|
|
29
|
+
# Run directly with Bun
|
|
30
|
+
bunx @renxqoo/renx-code
|
|
31
31
|
|
|
32
|
-
# Or
|
|
33
|
-
|
|
32
|
+
# Or install globally with Bun
|
|
33
|
+
bun install -g @renxqoo/renx-code
|
|
34
|
+
|
|
35
|
+
# npm install is not supported for running this CLI because OpenTUI currently depends on Bun runtime APIs.
|
|
34
36
|
```
|
|
35
37
|
|
|
36
38
|
### Basic Usage
|
|
@@ -39,21 +41,20 @@ npx @renxqoo/renx-code
|
|
|
39
41
|
# Start the interactive CLI
|
|
40
42
|
renx
|
|
41
43
|
|
|
42
|
-
# Or run directly with
|
|
43
|
-
|
|
44
|
+
# Or run directly with bunx
|
|
45
|
+
bunx @renxqoo/renx-code
|
|
44
46
|
```
|
|
45
47
|
|
|
46
48
|
## 📦 Installation
|
|
47
49
|
|
|
48
50
|
### Prerequisites
|
|
49
51
|
|
|
50
|
-
-
|
|
51
|
-
- npm, yarn, or pnpm
|
|
52
|
+
- Bun 1.1.0 or higher
|
|
52
53
|
|
|
53
54
|
### Global Installation
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
|
-
|
|
57
|
+
bun install -g @renxqoo/renx-code
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
### Local Installation
|
|
@@ -275,4 +276,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
275
276
|
|
|
276
277
|
---
|
|
277
278
|
|
|
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.
|
|
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.
|
package/dist/cli.js
CHANGED
|
@@ -1,43 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { createCliRenderer } from '@opentui/core';
|
|
4
|
-
import { createRoot } from '@opentui/react';
|
|
5
|
-
import { App } from './App.js';
|
|
6
|
-
import { bindExitGuards, hardResetTerminal, initExitRuntime, registerTerminalBackgroundRestore, } from './runtime/exit.js';
|
|
7
|
-
import { probeTerminalColors, setTerminalWindowBackground, setTerminalWindowForeground, } from './runtime/terminal-theme.js';
|
|
8
|
-
import { applyMarkdownThemeMode } from './ui/opencode-markdown.js';
|
|
9
|
-
import { applyUiThemeMode, uiTheme } from './ui/theme.js';
|
|
2
|
+
import { ensureSupportedRuntime } from './runtime/runtime-support.js';
|
|
10
3
|
async function main() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
process.env.OPENTUI_FORCE_WCWIDTH ??= '1';
|
|
15
|
-
const terminalColors = await probeTerminalColors();
|
|
16
|
-
applyUiThemeMode(terminalColors.mode);
|
|
17
|
-
applyMarkdownThemeMode(terminalColors.mode, process.platform);
|
|
18
|
-
if (terminalColors.rawBackgroundColor &&
|
|
19
|
-
terminalColors.rawBackgroundColor.toLowerCase() !== uiTheme.bg.toLowerCase()) {
|
|
20
|
-
const originalBackground = terminalColors.rawBackgroundColor;
|
|
21
|
-
setTerminalWindowBackground(uiTheme.bg);
|
|
22
|
-
registerTerminalBackgroundRestore(() => {
|
|
23
|
-
setTerminalWindowBackground(originalBackground);
|
|
24
|
-
});
|
|
4
|
+
if (!ensureSupportedRuntime()) {
|
|
5
|
+
process.exitCode = 1;
|
|
6
|
+
return;
|
|
25
7
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const originalForeground = terminalColors.rawForegroundColor;
|
|
29
|
-
setTerminalWindowForeground(uiTheme.userPromptText);
|
|
30
|
-
registerTerminalBackgroundRestore(() => {
|
|
31
|
-
setTerminalWindowForeground(originalForeground);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const renderer = await createCliRenderer({
|
|
35
|
-
exitOnCtrlC: false,
|
|
36
|
-
onDestroy: hardResetTerminal,
|
|
37
|
-
backgroundColor: uiTheme.bg,
|
|
38
|
-
});
|
|
39
|
-
initExitRuntime(renderer);
|
|
40
|
-
createRoot(renderer).render(_jsx(App, {}));
|
|
8
|
+
const { runCliApp } = await import('./run-cli-app.js');
|
|
9
|
+
await runCliApp();
|
|
41
10
|
}
|
|
42
11
|
main().catch(console.error);
|
|
43
12
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC,sBAAsB,EAAE,EAAE,CAAC;QAC9B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACvD,MAAM,SAAS,EAAE,CAAC;AACpB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -8,6 +8,6 @@ export type AssistantReplyUsageItem = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const buildUsageItems: (reply: Pick<AssistantReplyType, "usagePromptTokens" | "usageCompletionTokens">) => AssistantReplyUsageItem[];
|
|
10
10
|
export declare const getCompletionErrorMessage: (reply: AssistantReplyType) => string | undefined;
|
|
11
|
-
export declare const AssistantReply: ({ reply }: AssistantReplyProps) => import("react"
|
|
11
|
+
export declare const AssistantReply: ({ reply }: AssistantReplyProps) => import("react").ReactNode;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=assistant-reply.d.ts.map
|
|
@@ -3,6 +3,6 @@ type AssistantSegmentProps = {
|
|
|
3
3
|
segment: ReplySegment;
|
|
4
4
|
streaming: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare const AssistantSegment: ({ segment, streaming }: AssistantSegmentProps) => import("react"
|
|
6
|
+
export declare const AssistantSegment: ({ segment, streaming }: AssistantSegmentProps) => import("react").ReactNode;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=assistant-segment.d.ts.map
|
|
@@ -2,6 +2,6 @@ import type { ToolSegmentGroup } from './segment-groups.js';
|
|
|
2
2
|
type AssistantToolGroupProps = {
|
|
3
3
|
group: ToolSegmentGroup;
|
|
4
4
|
};
|
|
5
|
-
export declare const AssistantToolGroup: ({ group }: AssistantToolGroupProps) => import("react"
|
|
5
|
+
export declare const AssistantToolGroup: ({ group }: AssistantToolGroupProps) => import("react").ReactNode;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=assistant-tool-group.d.ts.map
|
|
@@ -4,6 +4,6 @@ type TurnItemProps = {
|
|
|
4
4
|
index: number;
|
|
5
5
|
isPending?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const TurnItem: ({ turn, index, isPending }: TurnItemProps) => import("react"
|
|
7
|
+
export declare const TurnItem: ({ turn, index, isPending }: TurnItemProps) => import("react").ReactNode;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=turn-item.d.ts.map
|
|
@@ -3,6 +3,6 @@ type ConversationPanelProps = {
|
|
|
3
3
|
turns: ChatTurn[];
|
|
4
4
|
isThinking: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare const ConversationPanel: ({ turns, isThinking }: ConversationPanelProps) => import("react"
|
|
6
|
+
export declare const ConversationPanel: ({ turns, isThinking }: ConversationPanelProps) => import("react").ReactNode;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=conversation-panel.d.ts.map
|
|
@@ -6,6 +6,6 @@ type FileMentionMenuProps = {
|
|
|
6
6
|
options: PromptFileSelection[];
|
|
7
7
|
selectedIndex: number;
|
|
8
8
|
};
|
|
9
|
-
export declare const FileMentionMenu: ({ visible, loading, error, options, selectedIndex, }: FileMentionMenuProps) => import("react"
|
|
9
|
+
export declare const FileMentionMenu: ({ visible, loading, error, options, selectedIndex, }: FileMentionMenuProps) => import("react").ReactNode;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=file-mention-menu.d.ts.map
|
|
@@ -16,6 +16,6 @@ type FilePickerDialogProps = {
|
|
|
16
16
|
onConfirm: () => void;
|
|
17
17
|
onListKeyDown: (event: KeyEvent) => boolean;
|
|
18
18
|
};
|
|
19
|
-
export declare const FilePickerDialog: ({ visible, viewportWidth, viewportHeight, loading, error, search, options, selectedIndex, selectedPaths, onSearchChange, onSelectIndex, onToggleSelected, onConfirm, onListKeyDown, }: FilePickerDialogProps) => import("react"
|
|
19
|
+
export declare const FilePickerDialog: ({ visible, viewportWidth, viewportHeight, loading, error, search, options, selectedIndex, selectedPaths, onSearchChange, onSelectIndex, onToggleSelected, onConfirm, onListKeyDown, }: FilePickerDialogProps) => import("react").ReactNode;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=file-picker-dialog.d.ts.map
|
|
@@ -15,6 +15,6 @@ type ModelPickerDialogProps = {
|
|
|
15
15
|
onConfirm: () => void;
|
|
16
16
|
onListKeyDown: (event: KeyEvent) => boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare const ModelPickerDialog: ({ visible, viewportWidth, viewportHeight, loading, switching, error, search, options, selectedIndex, onSearchChange, onSelectIndex, onConfirm, onListKeyDown, }: ModelPickerDialogProps) => import("react"
|
|
18
|
+
export declare const ModelPickerDialog: ({ visible, viewportWidth, viewportHeight, loading, switching, error, search, options, selectedIndex, onSearchChange, onSelectIndex, onConfirm, onListKeyDown, }: ModelPickerDialogProps) => import("react").ReactNode;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=model-picker-dialog.d.ts.map
|
|
@@ -13,6 +13,6 @@ type PromptProps = {
|
|
|
13
13
|
onSlashMenuVisibilityChange?: (visible: boolean) => void;
|
|
14
14
|
onSubmit: () => void;
|
|
15
15
|
};
|
|
16
|
-
export declare const Prompt: ({ isThinking, disabled, modelLabel, contextUsagePercent, value, selectedFiles, onAddSelectedFiles, onValueChange, onSlashCommandSelect, onSlashMenuVisibilityChange, onSubmit, }: PromptProps) => import("react"
|
|
16
|
+
export declare const Prompt: ({ isThinking, disabled, modelLabel, contextUsagePercent, value, selectedFiles, onAddSelectedFiles, onValueChange, onSlashCommandSelect, onSlashMenuVisibilityChange, onSubmit, }: PromptProps) => import("react").ReactNode;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -4,6 +4,6 @@ type SlashCommandMenuProps = {
|
|
|
4
4
|
options: SlashCommandDefinition[];
|
|
5
5
|
selectedIndex: number;
|
|
6
6
|
};
|
|
7
|
-
export declare const SlashCommandMenu: ({ visible, options, selectedIndex }: SlashCommandMenuProps) => import("react"
|
|
7
|
+
export declare const SlashCommandMenu: ({ visible, options, selectedIndex }: SlashCommandMenuProps) => import("react").ReactNode;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=slash-command-menu.d.ts.map
|
|
@@ -7,6 +7,6 @@ type ToolConfirmDialogProps = {
|
|
|
7
7
|
selectedAction: 'approve' | 'deny';
|
|
8
8
|
}) | null;
|
|
9
9
|
};
|
|
10
|
-
export declare const ToolConfirmDialog: ({ visible, viewportWidth, viewportHeight, request, }: ToolConfirmDialogProps) => import("react"
|
|
10
|
+
export declare const ToolConfirmDialog: ({ visible, viewportWidth, viewportHeight, request, }: ToolConfirmDialogProps) => import("react").ReactNode;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=tool-confirm-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-files.d.ts","sourceRoot":"","sources":["../../src/files/workspace-files.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace-files.d.ts","sourceRoot":"","sources":["../../src/files/workspace-files.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmDnD,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,mBAAmB,EAAE,CAKxE,CAAC"}
|
|
@@ -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
|
import { resolveWorkspaceRoot } from '../agent/runtime/source-modules.js';
|
|
4
4
|
const IGNORED_DIR_NAMES = new Set([
|
|
@@ -28,16 +28,14 @@ const visitDirectory = async (root, directory, output) => {
|
|
|
28
28
|
if (!entry.isFile()) {
|
|
29
29
|
continue;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
.catch(() => undefined);
|
|
34
|
-
if (!stat || !stat.isFile()) {
|
|
31
|
+
const fileStat = await stat(absolutePath).catch(() => undefined);
|
|
32
|
+
if (!fileStat || !fileStat.isFile()) {
|
|
35
33
|
continue;
|
|
36
34
|
}
|
|
37
35
|
output.push({
|
|
38
36
|
relativePath: relative(root, absolutePath),
|
|
39
37
|
absolutePath,
|
|
40
|
-
size:
|
|
38
|
+
size: fileStat.size,
|
|
41
39
|
});
|
|
42
40
|
}
|
|
43
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-files.js","sourceRoot":"","sources":["../../src/files/workspace-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace-files.js","sourceRoot":"","sources":["../../src/files/workspace-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;A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AAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACjE,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YACpC,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;YACV,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;YAC1C,YAAY;YACZ,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAAoC,EAAE;IAC3E,MAAM,aAAa,GAAG,oBAAoB,EAAE,CAAC;IAC7C,MAAM,KAAK,GAA0B,EAAE,CAAC;IACxC,MAAM,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { bindExitGuards, hardResetTerminal, initExitRuntime, registerTerminalBackgroundRestore, } from './runtime/exit.js';
|
|
6
|
-
import { probeTerminalColors, setTerminalWindowBackground, setTerminalWindowForeground, } from './runtime/terminal-theme.js';
|
|
7
|
-
import { applyMarkdownThemeMode } from './ui/opencode-markdown.js';
|
|
8
|
-
import { applyUiThemeMode, uiTheme } from './ui/theme.js';
|
|
9
|
-
bindExitGuards();
|
|
10
|
-
// OpenTUI exposes OPENTUI_FORCE_WCWIDTH for terminals where CJK width handling
|
|
11
|
-
// is more accurate with wcwidth than the default Unicode capability probe.
|
|
12
|
-
process.env.OPENTUI_FORCE_WCWIDTH ??= '1';
|
|
13
|
-
const terminalColors = await probeTerminalColors();
|
|
14
|
-
applyUiThemeMode(terminalColors.mode);
|
|
15
|
-
applyMarkdownThemeMode(terminalColors.mode, process.platform);
|
|
16
|
-
if (terminalColors.rawBackgroundColor &&
|
|
17
|
-
terminalColors.rawBackgroundColor.toLowerCase() !== uiTheme.bg.toLowerCase()) {
|
|
18
|
-
const originalBackground = terminalColors.rawBackgroundColor;
|
|
19
|
-
setTerminalWindowBackground(uiTheme.bg);
|
|
20
|
-
registerTerminalBackgroundRestore(() => {
|
|
21
|
-
setTerminalWindowBackground(originalBackground);
|
|
22
|
-
});
|
|
1
|
+
import { ensureSupportedRuntime } from './runtime/runtime-support.js';
|
|
2
|
+
if (ensureSupportedRuntime()) {
|
|
3
|
+
const { runCliApp } = await import('./run-cli-app.js');
|
|
4
|
+
await runCliApp();
|
|
23
5
|
}
|
|
24
|
-
if (terminalColors.rawForegroundColor &&
|
|
25
|
-
terminalColors.rawForegroundColor.toLowerCase() !== uiTheme.userPromptText.toLowerCase()) {
|
|
26
|
-
const originalForeground = terminalColors.rawForegroundColor;
|
|
27
|
-
setTerminalWindowForeground(uiTheme.userPromptText);
|
|
28
|
-
registerTerminalBackgroundRestore(() => {
|
|
29
|
-
setTerminalWindowForeground(originalForeground);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
const renderer = await createCliRenderer({
|
|
33
|
-
exitOnCtrlC: false,
|
|
34
|
-
onDestroy: hardResetTerminal,
|
|
35
|
-
backgroundColor: uiTheme.bg,
|
|
36
|
-
});
|
|
37
|
-
initExitRuntime(renderer);
|
|
38
|
-
createRoot(renderer).render(_jsx(App, {}));
|
|
39
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,IAAI,sBAAsB,EAAE,EAAE,CAAC;IAC7B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACvD,MAAM,SAAS,EAAE,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-cli-app.d.ts","sourceRoot":"","sources":["../src/run-cli-app.tsx"],"names":[],"mappings":"AAkBA,wBAAsB,SAAS,kBAsC9B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { createCliRenderer } from '@opentui/core';
|
|
3
|
+
import { createRoot } from '@opentui/react';
|
|
4
|
+
import { App } from './App.js';
|
|
5
|
+
import { bindExitGuards, hardResetTerminal, initExitRuntime, registerTerminalBackgroundRestore, } from './runtime/exit.js';
|
|
6
|
+
import { probeTerminalColors, setTerminalWindowBackground, setTerminalWindowForeground, } from './runtime/terminal-theme.js';
|
|
7
|
+
import { applyMarkdownThemeMode } from './ui/opencode-markdown.js';
|
|
8
|
+
import { applyUiThemeMode, uiTheme } from './ui/theme.js';
|
|
9
|
+
export async function runCliApp() {
|
|
10
|
+
bindExitGuards();
|
|
11
|
+
// OpenTUI exposes OPENTUI_FORCE_WCWIDTH for terminals where CJK width handling
|
|
12
|
+
// is more accurate with wcwidth than the default Unicode capability probe.
|
|
13
|
+
process.env.OPENTUI_FORCE_WCWIDTH ??= '1';
|
|
14
|
+
const terminalColors = await probeTerminalColors();
|
|
15
|
+
applyUiThemeMode(terminalColors.mode);
|
|
16
|
+
applyMarkdownThemeMode(terminalColors.mode, process.platform);
|
|
17
|
+
if (terminalColors.rawBackgroundColor &&
|
|
18
|
+
terminalColors.rawBackgroundColor.toLowerCase() !== uiTheme.bg.toLowerCase()) {
|
|
19
|
+
const originalBackground = terminalColors.rawBackgroundColor;
|
|
20
|
+
setTerminalWindowBackground(uiTheme.bg);
|
|
21
|
+
registerTerminalBackgroundRestore(() => {
|
|
22
|
+
setTerminalWindowBackground(originalBackground);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (terminalColors.rawForegroundColor &&
|
|
26
|
+
terminalColors.rawForegroundColor.toLowerCase() !== uiTheme.userPromptText.toLowerCase()) {
|
|
27
|
+
const originalForeground = terminalColors.rawForegroundColor;
|
|
28
|
+
setTerminalWindowForeground(uiTheme.userPromptText);
|
|
29
|
+
registerTerminalBackgroundRestore(() => {
|
|
30
|
+
setTerminalWindowForeground(originalForeground);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const renderer = await createCliRenderer({
|
|
34
|
+
exitOnCtrlC: false,
|
|
35
|
+
onDestroy: hardResetTerminal,
|
|
36
|
+
backgroundColor: uiTheme.bg,
|
|
37
|
+
});
|
|
38
|
+
initExitRuntime(renderer);
|
|
39
|
+
createRoot(renderer).render(_jsx(App, {}));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=run-cli-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-cli-app.js","sourceRoot":"","sources":["../src/run-cli-app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,iCAAiC,GAClC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,cAAc,EAAE,CAAC;IACjB,+EAA+E;IAC/E,2EAA2E;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1
|
+
{"version":3,"file":"runtime-support.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime-support.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,eAAoE,CAAC;AAE9F,eAAO,MAAM,4BAA4B,cAS3B,CAAC;AAEf,eAAO,MAAM,sBAAsB,eAOlC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const BUN_INSTALL_URL = 'https://bun.sh';
|
|
2
|
+
export const isBunRuntime = () => typeof Bun !== 'undefined' || Boolean(process.versions.bun);
|
|
3
|
+
export const getUnsupportedRuntimeMessage = () => [
|
|
4
|
+
'renx currently requires the Bun runtime because OpenTUI depends on Bun FFI APIs.',
|
|
5
|
+
'',
|
|
6
|
+
'Use one of these commands instead:',
|
|
7
|
+
' bunx @renxqoo/renx-code',
|
|
8
|
+
' bun install -g @renxqoo/renx-code',
|
|
9
|
+
'',
|
|
10
|
+
`Install Bun: ${BUN_INSTALL_URL}`,
|
|
11
|
+
].join('\n');
|
|
12
|
+
export const ensureSupportedRuntime = () => {
|
|
13
|
+
if (isBunRuntime()) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
console.error(getUnsupportedRuntimeMessage());
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=runtime-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-support.js","sourceRoot":"","sources":["../../src/runtime/runtime-support.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,OAAO,GAAG,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAE9F,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE,CAC/C;IACE,kFAAkF;IAClF,EAAE;IACF,oCAAoC;IACpC,2BAA2B;IAC3B,qCAAqC;IACrC,EAAE;IACF,gBAAgB,eAAe,EAAE;CAClC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEf,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,IAAI,YAAY,EAAE,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@renxqoo/renx-code",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Enterprise-grade AI coding assistant CLI tool with interactive terminal UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"zod": "^4.3.6"
|
|
111
111
|
},
|
|
112
112
|
"engines": {
|
|
113
|
-
"
|
|
113
|
+
"bun": ">=1.1.0"
|
|
114
114
|
},
|
|
115
115
|
"lint-staged": {
|
|
116
116
|
"*.ts": [
|