@renxqoo/renx-code 0.0.1 → 0.0.2

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.
Files changed (62) hide show
  1. package/dist/App.js +13 -13
  2. package/dist/agent/runtime/event-format.d.ts +1 -1
  3. package/dist/agent/runtime/runtime.d.ts +4 -4
  4. package/dist/agent/runtime/runtime.js +6 -6
  5. package/dist/agent/runtime/source-modules.d.ts +1 -1
  6. package/dist/agent/runtime/tool-call-buffer.d.ts +1 -1
  7. package/dist/agent/runtime/tool-confirmation.d.ts +1 -1
  8. package/dist/cli.js +5 -5
  9. package/dist/components/chat/assistant-reply.d.ts +2 -2
  10. package/dist/components/chat/assistant-reply.js +4 -4
  11. package/dist/components/chat/assistant-segment.d.ts +2 -2
  12. package/dist/components/chat/assistant-segment.js +3 -3
  13. package/dist/components/chat/assistant-tool-group.d.ts +2 -2
  14. package/dist/components/chat/assistant-tool-group.js +3 -3
  15. package/dist/components/chat/code-block.js +2 -2
  16. package/dist/components/chat/prompt-card.js +2 -2
  17. package/dist/components/chat/segment-groups.d.ts +1 -1
  18. package/dist/components/chat/turn-item.d.ts +2 -2
  19. package/dist/components/chat/turn-item.js +3 -3
  20. package/dist/components/conversation-panel.d.ts +2 -2
  21. package/dist/components/conversation-panel.js +2 -2
  22. package/dist/components/file-mention-menu.d.ts +2 -2
  23. package/dist/components/file-mention-menu.js +1 -1
  24. package/dist/components/file-picker-dialog.d.ts +2 -2
  25. package/dist/components/file-picker-dialog.js +1 -1
  26. package/dist/components/footer-hints.js +1 -1
  27. package/dist/components/model-picker-dialog.d.ts +2 -2
  28. package/dist/components/model-picker-dialog.js +1 -1
  29. package/dist/components/prompt.d.ts +3 -3
  30. package/dist/components/prompt.js +7 -7
  31. package/dist/components/slash-command-menu.d.ts +2 -2
  32. package/dist/components/slash-command-menu.js +1 -1
  33. package/dist/components/tool-confirm-dialog-content.d.ts +1 -1
  34. package/dist/components/tool-confirm-dialog-content.js +1 -1
  35. package/dist/components/tool-confirm-dialog.d.ts +2 -2
  36. package/dist/components/tool-confirm-dialog.js +2 -2
  37. package/dist/files/attachment-capabilities.d.ts +1 -1
  38. package/dist/files/attachment-content.d.ts +3 -3
  39. package/dist/files/attachment-content.js +1 -1
  40. package/dist/files/prompt-display.d.ts +1 -1
  41. package/dist/files/workspace-files.d.ts +1 -1
  42. package/dist/files/workspace-files.js +1 -1
  43. package/dist/hooks/agent-event-handlers.d.ts +2 -2
  44. package/dist/hooks/agent-event-handlers.js +1 -1
  45. package/dist/hooks/turn-updater.d.ts +1 -1
  46. package/dist/hooks/use-agent-chat.d.ts +3 -3
  47. package/dist/hooks/use-agent-chat.js +9 -9
  48. package/dist/hooks/use-file-mention-menu.d.ts +1 -1
  49. package/dist/hooks/use-file-mention-menu.js +3 -3
  50. package/dist/hooks/use-file-picker.d.ts +1 -1
  51. package/dist/hooks/use-file-picker.js +1 -1
  52. package/dist/hooks/use-model-picker.d.ts +1 -1
  53. package/dist/hooks/use-model-picker.js +1 -1
  54. package/dist/hooks/use-slash-command-menu.d.ts +1 -1
  55. package/dist/hooks/use-slash-command-menu.js +1 -1
  56. package/dist/index.js +5 -5
  57. package/dist/runtime/exit.js +1 -1
  58. package/dist/ui/opencode-markdown.d.ts +2 -2
  59. package/dist/ui/opencode-markdown.js +1 -1
  60. package/dist/ui/theme.d.ts +1 -1
  61. package/dist/ui/theme.js +1 -1
  62. package/package.json +3 -3
package/dist/App.js CHANGED
@@ -2,19 +2,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
3
  import { useKeyboard, useRenderer, useTerminalDimensions } from '@opentui/react';
4
4
  import { useEffect, useRef, useState } from 'react';
5
- import { resolveSlashCommand } from './commands/slash-commands';
6
- import { ConversationPanel } from './components/conversation-panel';
7
- import { FilePickerDialog } from './components/file-picker-dialog';
8
- import { ModelPickerDialog } from './components/model-picker-dialog';
9
- import { Prompt } from './components/prompt';
10
- import { ToolConfirmDialog } from './components/tool-confirm-dialog';
11
- import { isMediaSelection } from './files/attachment-capabilities';
12
- import { useAgentChat } from './hooks/use-agent-chat';
13
- import { useFilePicker } from './hooks/use-file-picker';
14
- import { useModelPicker } from './hooks/use-model-picker';
15
- import { requestExit } from './runtime/exit';
16
- import { copyTextToClipboard } from './runtime/clipboard';
17
- import { uiTheme } from './ui/theme';
5
+ import { resolveSlashCommand } from './commands/slash-commands.js';
6
+ import { ConversationPanel } from './components/conversation-panel.js';
7
+ import { FilePickerDialog } from './components/file-picker-dialog.js';
8
+ import { ModelPickerDialog } from './components/model-picker-dialog.js';
9
+ import { Prompt } from './components/prompt.js';
10
+ import { ToolConfirmDialog } from './components/tool-confirm-dialog.js';
11
+ import { isMediaSelection } from './files/attachment-capabilities.js';
12
+ import { useAgentChat } from './hooks/use-agent-chat.js';
13
+ import { useFilePicker } from './hooks/use-file-picker.js';
14
+ import { useModelPicker } from './hooks/use-model-picker.js';
15
+ import { requestExit } from './runtime/exit.js';
16
+ import { copyTextToClipboard } from './runtime/clipboard.js';
17
+ import { uiTheme } from './ui/theme.js';
18
18
  const appendFileTokens = (currentValue, files) => {
19
19
  if (files.length === 0) {
20
20
  return currentValue;
@@ -1,4 +1,4 @@
1
- import type { AgentLoopEvent, AgentStepEvent, AgentStopEvent, AgentToolConfirmEvent, AgentToolResultEvent, AgentToolStreamEvent, AgentToolUseEvent } from './types';
1
+ import type { AgentLoopEvent, AgentStepEvent, AgentStopEvent, AgentToolConfirmEvent, AgentToolResultEvent, AgentToolStreamEvent, AgentToolUseEvent } from './types.js';
2
2
  export declare const formatToolConfirmEvent: (event: AgentToolConfirmEvent) => string;
3
3
  export declare const formatToolUseEvent: (event: AgentToolUseEvent) => string;
4
4
  export declare const formatToolUseEventCode: (event: AgentToolUseEvent) => string;
@@ -1,7 +1,7 @@
1
- import type { AgentEventHandlers, AgentRunResult } from './types';
2
- import type { AgentModelOption, AgentModelSwitchResult } from './model-types';
3
- import type { AttachmentModelCapabilities } from '../../files/attachment-capabilities';
4
- import type { MessageContent } from '../../types/message-content';
1
+ import type { AgentEventHandlers, AgentRunResult } from './types.js';
2
+ import type { AgentModelOption, AgentModelSwitchResult } from './model-types.js';
3
+ import type { AttachmentModelCapabilities } from '../../files/attachment-capabilities.js';
4
+ import type { MessageContent } from '../../types/message-content.js';
5
5
  type RunAgentPromptOptions = {
6
6
  abortSignal?: AbortSignal;
7
7
  };
@@ -1,10 +1,10 @@
1
1
  import { resolve as resolvePath } from 'node:path';
2
- import { resolveToolConfirmDecision } from './tool-confirmation';
3
- import { getSourceModules, resolveWorkspaceRoot, } from './source-modules';
4
- import { ToolCallBuffer } from './tool-call-buffer';
5
- import { buildSystemPrompt } from '../../agent/prompts/system';
6
- import { resolveRenxDatabasePath, resolveRenxTaskDir } from '../../config/paths';
7
- import { resolveAttachmentModelCapabilities } from '../../files/attachment-capabilities';
2
+ import { resolveToolConfirmDecision } from './tool-confirmation.js';
3
+ import { getSourceModules, resolveWorkspaceRoot, } from './source-modules.js';
4
+ import { ToolCallBuffer } from './tool-call-buffer.js';
5
+ import { buildSystemPrompt } from '../../agent/prompts/system.js';
6
+ import { resolveRenxDatabasePath, resolveRenxTaskDir } from '../../config/paths.js';
7
+ import { resolveAttachmentModelCapabilities } from '../../files/attachment-capabilities.js';
8
8
  let runtimePromise = null;
9
9
  let initializing = false;
10
10
  const readPreferredModelIdFromEnv = () => {
@@ -1,4 +1,4 @@
1
- import type { MessageContent } from '../../types/message-content';
1
+ import type { MessageContent } from '../../types/message-content.js';
2
2
  type ProviderModelConfig = {
3
3
  name: string;
4
4
  envApiKey: string;
@@ -1,4 +1,4 @@
1
- import type { AgentToolUseEvent } from './types';
1
+ import type { AgentToolUseEvent } from './types.js';
2
2
  export declare class ToolCallBuffer {
3
3
  private readonly plannedOrder;
4
4
  private readonly plannedIds;
@@ -1,3 +1,3 @@
1
- import type { AgentEventHandlers, AgentToolConfirmDecision, AgentToolConfirmEvent } from './types';
1
+ import type { AgentEventHandlers, AgentToolConfirmDecision, AgentToolConfirmEvent } from './types.js';
2
2
  export declare const resolveToolConfirmDecision: (event: AgentToolConfirmEvent, handlers: AgentEventHandlers) => Promise<AgentToolConfirmDecision>;
3
3
  //# sourceMappingURL=tool-confirmation.d.ts.map
package/dist/cli.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import { jsx as _jsx } from "@opentui/react/jsx-runtime";
3
3
  import { createCliRenderer } from '@opentui/core';
4
4
  import { createRoot } from '@opentui/react';
5
- import { App } from './App';
6
- import { bindExitGuards, hardResetTerminal, initExitRuntime, registerTerminalBackgroundRestore, } from './runtime/exit';
7
- import { probeTerminalColors, setTerminalWindowBackground, setTerminalWindowForeground, } from './runtime/terminal-theme';
8
- import { applyMarkdownThemeMode } from './ui/opencode-markdown';
9
- import { applyUiThemeMode, uiTheme } from './ui/theme';
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';
10
10
  async function main() {
11
11
  bindExitGuards();
12
12
  // OpenTUI exposes OPENTUI_FORCE_WCWIDTH for terminals where CJK width handling
@@ -1,4 +1,4 @@
1
- import type { AssistantReply as AssistantReplyType } from '../../types/chat';
1
+ import type { AssistantReply as AssistantReplyType } from '../../types/chat.js';
2
2
  type AssistantReplyProps = {
3
3
  reply: AssistantReplyType;
4
4
  };
@@ -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").ReactNode;
11
+ export declare const AssistantReply: ({ reply }: AssistantReplyProps) => import("react"").ReactNode;
12
12
  export {};
13
13
  //# sourceMappingURL=assistant-reply.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import { uiTheme } from '../../ui/theme';
4
- import { AssistantSegment } from './assistant-segment';
5
- import { AssistantToolGroup } from './assistant-tool-group';
6
- import { buildReplyRenderItems } from './segment-groups';
3
+ import { uiTheme } from '../../ui/theme.js';
4
+ import { AssistantSegment } from './assistant-segment.js';
5
+ import { AssistantToolGroup } from './assistant-tool-group.js';
6
+ import { buildReplyRenderItems } from './segment-groups.js';
7
7
  const renderStatus = (status) => {
8
8
  if (status === 'streaming') {
9
9
  return 'streaming';
@@ -1,8 +1,8 @@
1
- import type { ReplySegment } from '../../types/chat';
1
+ import type { ReplySegment } from '../../types/chat.js';
2
2
  type AssistantSegmentProps = {
3
3
  segment: ReplySegment;
4
4
  streaming: boolean;
5
5
  };
6
- export declare const AssistantSegment: ({ segment, streaming }: AssistantSegmentProps) => import("react").ReactNode;
6
+ export declare const AssistantSegment: ({ segment, streaming }: AssistantSegmentProps) => import("react"").ReactNode;
7
7
  export {};
8
8
  //# sourceMappingURL=assistant-segment.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
- import { opencodeMarkdownSyntax, opencodeSubtleMarkdownSyntax } from '../../ui/opencode-markdown';
3
- import { uiTheme } from '../../ui/theme';
4
- import { CodeBlock } from './code-block';
2
+ import { opencodeMarkdownSyntax, opencodeSubtleMarkdownSyntax } from '../../ui/opencode-markdown.js';
3
+ import { uiTheme } from '../../ui/theme.js';
4
+ import { CodeBlock } from './code-block.js';
5
5
  const markdownTableOptions = {
6
6
  widthMode: 'full',
7
7
  wrapMode: 'word',
@@ -1,7 +1,7 @@
1
- import type { ToolSegmentGroup } from './segment-groups';
1
+ 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").ReactNode;
5
+ export declare const AssistantToolGroup: ({ group }: AssistantToolGroupProps) => import("react"").ReactNode;
6
6
  export {};
7
7
  //# sourceMappingURL=assistant-tool-group.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import { uiTheme } from '../../ui/theme';
4
- import { getToolDisplayIcon, getToolDisplayName } from '../tool-display-config';
5
- import { CodeBlock } from './code-block';
3
+ import { uiTheme } from '../../ui/theme.js';
4
+ import { getToolDisplayIcon, getToolDisplayName } from '../tool-display-config.js';
5
+ import { CodeBlock } from './code-block.js';
6
6
  const COLLAPSIBLE_OUTPUT_LINES = 16;
7
7
  const COLLAPSIBLE_OUTPUT_LABELS = new Set(['output', 'error', 'result', 'details']);
8
8
  const asObjectLike = (value) => {
@@ -1,6 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "@opentui/react/jsx-runtime";
2
- import { opencodeMarkdownSyntax } from '../../ui/opencode-markdown';
3
- import { uiTheme } from '../../ui/theme';
2
+ import { opencodeMarkdownSyntax } from '../../ui/opencode-markdown.js';
3
+ import { uiTheme } from '../../ui/theme.js';
4
4
  const FILETYPE_BY_EXTENSION = {
5
5
  bash: 'bash',
6
6
  cjs: 'javascript',
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
- import { isAudioSelection, isImageSelection, isVideoSelection, } from '../../files/attachment-capabilities';
3
- import { uiTheme } from '../../ui/theme';
2
+ import { isAudioSelection, isImageSelection, isVideoSelection, } from '../../files/attachment-capabilities.js';
3
+ import { uiTheme } from '../../ui/theme.js';
4
4
  const formatTime = (timestamp) => {
5
5
  return new Date(timestamp).toLocaleTimeString('en-US', {
6
6
  hour: '2-digit',
@@ -1,4 +1,4 @@
1
- import type { ReplySegment } from '../../types/chat';
1
+ import type { ReplySegment } from '../../types/chat.js';
2
2
  type ToolSegmentKind = 'use' | 'stream' | 'result';
3
3
  export type ToolSegmentMeta = {
4
4
  kind: ToolSegmentKind;
@@ -1,9 +1,9 @@
1
- import type { ChatTurn } from '../../types/chat';
1
+ import type { ChatTurn } from '../../types/chat.js';
2
2
  type TurnItemProps = {
3
3
  turn: ChatTurn;
4
4
  index: number;
5
5
  isPending?: boolean;
6
6
  };
7
- export declare const TurnItem: ({ turn, index, isPending }: TurnItemProps) => import("react").ReactNode;
7
+ export declare const TurnItem: ({ turn, index, isPending }: TurnItemProps) => import("react"").ReactNode;
8
8
  export {};
9
9
  //# sourceMappingURL=turn-item.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
- import { uiTheme } from '../../ui/theme';
3
- import { AssistantReply } from './assistant-reply';
4
- import { PromptCard } from './prompt-card';
2
+ import { uiTheme } from '../../ui/theme.js';
3
+ import { AssistantReply } from './assistant-reply.js';
4
+ import { PromptCard } from './prompt-card.js';
5
5
  const PendingReply = () => {
6
6
  return (_jsxs("box", { flexDirection: "row", children: [_jsx("box", { width: 1, backgroundColor: uiTheme.divider }), _jsx("box", { flexGrow: 1, paddingLeft: 2, children: _jsxs("text", { attributes: uiTheme.typography.body, selectable: true, children: [_jsx("i", { fg: uiTheme.thinking, children: "Thinking:" }), _jsx("span", { fg: uiTheme.muted, children: " preparing response..." })] }) })] }));
7
7
  };
@@ -1,8 +1,8 @@
1
- import type { ChatTurn } from '../types/chat';
1
+ import type { ChatTurn } from '../types/chat.js';
2
2
  type ConversationPanelProps = {
3
3
  turns: ChatTurn[];
4
4
  isThinking: boolean;
5
5
  };
6
- export declare const ConversationPanel: ({ turns, isThinking }: ConversationPanelProps) => import("react").ReactNode;
6
+ export declare const ConversationPanel: ({ turns, isThinking }: ConversationPanelProps) => import("react"").ReactNode;
7
7
  export {};
8
8
  //# sourceMappingURL=conversation-panel.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "@opentui/react/jsx-runtime";
2
- import { uiTheme } from '../ui/theme';
3
- import { TurnItem } from './chat/turn-item';
2
+ import { uiTheme } from '../ui/theme.js';
3
+ import { TurnItem } from './chat/turn-item.js';
4
4
  export const ConversationPanel = ({ turns, isThinking }) => {
5
5
  const pendingTurnId = turns.at(-1)?.id;
6
6
  return (_jsx("scrollbox", { flexGrow: 1, scrollY: true, stickyScroll: true, stickyStart: "bottom", paddingX: uiTheme.layout.conversationPaddingX, paddingY: uiTheme.layout.conversationPaddingY, viewportOptions: { backgroundColor: uiTheme.bg }, contentOptions: { backgroundColor: uiTheme.bg }, marginBottom: 1, children: _jsx("box", { flexDirection: "column", gap: 0, paddingX: uiTheme.layout.conversationContentPaddingX, paddingY: uiTheme.layout.conversationContentPaddingY, backgroundColor: uiTheme.bg, children: turns.map((turn, index) => (_jsx(TurnItem, { turn: turn, index: index, isPending: isThinking && turn.id === pendingTurnId }, turn.id))) }) }));
@@ -1,4 +1,4 @@
1
- import type { PromptFileSelection } from '../files/types';
1
+ import type { PromptFileSelection } from '../files/types.js';
2
2
  type FileMentionMenuProps = {
3
3
  visible: boolean;
4
4
  loading: boolean;
@@ -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").ReactNode;
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
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
- import { uiTheme } from '../ui/theme';
3
+ import { uiTheme } from '../ui/theme.js';
4
4
  const selectedBackground = '#f4b183';
5
5
  const selectedForeground = '#050608';
6
6
  export const FileMentionMenu = ({ visible, loading, error, options, selectedIndex, }) => {
@@ -1,5 +1,5 @@
1
1
  import type { KeyEvent } from '@opentui/core';
2
- import type { PromptFileSelection } from '../files/types';
2
+ import type { PromptFileSelection } from '../files/types.js';
3
3
  type FilePickerDialogProps = {
4
4
  visible: boolean;
5
5
  viewportWidth: number;
@@ -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").ReactNode;
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
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
3
  import { useEffect, useRef } from 'react';
4
- import { uiTheme } from '../ui/theme';
4
+ import { uiTheme } from '../ui/theme.js';
5
5
  const selectedBackground = '#f4b183';
6
6
  const selectedForeground = '#050608';
7
7
  const formatSize = (size) => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
3
  import { useEffect, useState } from 'react';
4
- import { uiTheme } from '../ui/theme';
4
+ import { uiTheme } from '../ui/theme.js';
5
5
  const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
6
6
  const SPINNER_INTERVAL_MS = 80;
7
7
  export const FooterHints = ({ isThinking, contextUsagePercent }) => {
@@ -1,5 +1,5 @@
1
1
  import type { KeyEvent } from '@opentui/core';
2
- import type { AgentModelOption } from '../agent/runtime/model-types';
2
+ import type { AgentModelOption } from '../agent/runtime/model-types.js';
3
3
  type ModelPickerDialogProps = {
4
4
  visible: boolean;
5
5
  viewportWidth: number;
@@ -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").ReactNode;
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
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
3
  import { useEffect, useMemo, useRef } from 'react';
4
- import { uiTheme } from '../ui/theme';
4
+ import { uiTheme } from '../ui/theme.js';
5
5
  const selectedBackground = '#f4b183';
6
6
  const selectedForeground = '#050608';
7
7
  const toProviderLabel = (provider) => {
@@ -1,5 +1,5 @@
1
- import type { SlashCommandDefinition } from '../commands/slash-commands';
2
- import type { PromptFileSelection } from '../files/types';
1
+ import type { SlashCommandDefinition } from '../commands/slash-commands.js';
2
+ import type { PromptFileSelection } from '../files/types.js';
3
3
  type PromptProps = {
4
4
  isThinking: boolean;
5
5
  disabled?: boolean;
@@ -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").ReactNode;
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
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef } from 'react';
3
- import { FileMentionMenu } from './file-mention-menu';
4
- import { FooterHints } from './footer-hints';
5
- import { SlashCommandMenu } from './slash-command-menu';
6
- import { isAudioSelection, isImageSelection, isVideoSelection, } from '../files/attachment-capabilities';
7
- import { useFileMentionMenu } from '../hooks/use-file-mention-menu';
8
- import { useSlashCommandMenu } from '../hooks/use-slash-command-menu';
9
- import { uiTheme } from '../ui/theme';
3
+ import { FileMentionMenu } from './file-mention-menu.js';
4
+ import { FooterHints } from './footer-hints.js';
5
+ import { SlashCommandMenu } from './slash-command-menu.js';
6
+ import { isAudioSelection, isImageSelection, isVideoSelection, } from '../files/attachment-capabilities.js';
7
+ import { useFileMentionMenu } from '../hooks/use-file-mention-menu.js';
8
+ import { useSlashCommandMenu } from '../hooks/use-slash-command-menu.js';
9
+ import { uiTheme } from '../ui/theme.js';
10
10
  export const Prompt = ({ isThinking, disabled = false, modelLabel, contextUsagePercent, value, selectedFiles, onAddSelectedFiles, onValueChange, onSlashCommandSelect, onSlashMenuVisibilityChange, onSubmit, }) => {
11
11
  const textareaRef = useRef(null);
12
12
  const mediaFiles = useMemo(() => selectedFiles.filter(file => isImageSelection(file) || isAudioSelection(file) || isVideoSelection(file)), [selectedFiles]);
@@ -1,9 +1,9 @@
1
- import type { SlashCommandDefinition } from '../commands/slash-commands';
1
+ import type { SlashCommandDefinition } from '../commands/slash-commands.js';
2
2
  type SlashCommandMenuProps = {
3
3
  visible: boolean;
4
4
  options: SlashCommandDefinition[];
5
5
  selectedIndex: number;
6
6
  };
7
- export declare const SlashCommandMenu: ({ visible, options, selectedIndex }: SlashCommandMenuProps) => import("react").ReactNode;
7
+ export declare const SlashCommandMenu: ({ visible, options, selectedIndex }: SlashCommandMenuProps) => import("react"").ReactNode;
8
8
  export {};
9
9
  //# sourceMappingURL=slash-command-menu.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
- import { uiTheme } from '../ui/theme';
3
+ import { uiTheme } from '../ui/theme.js';
4
4
  const selectedBackground = '#f4b183';
5
5
  const selectedForeground = '#050608';
6
6
  export const SlashCommandMenu = ({ visible, options, selectedIndex }) => {
@@ -1,4 +1,4 @@
1
- import type { AgentToolConfirmEvent } from '../agent/runtime/types';
1
+ import type { AgentToolConfirmEvent } from '../agent/runtime/types.js';
2
2
  export type ToolConfirmDialogContent = {
3
3
  summary: string;
4
4
  detail?: string;
@@ -1,4 +1,4 @@
1
- import { getToolHiddenArgumentKeys, getToolDisplayName } from './tool-display-config';
1
+ import { getToolHiddenArgumentKeys, getToolDisplayName } from './tool-display-config.js';
2
2
  const asRecord = (value) => {
3
3
  return value && typeof value === 'object' ? value : {};
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { AgentToolConfirmEvent } from '../agent/runtime/types';
1
+ import type { AgentToolConfirmEvent } from '../agent/runtime/types.js';
2
2
  type ToolConfirmDialogProps = {
3
3
  visible: boolean;
4
4
  viewportWidth: number;
@@ -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").ReactNode;
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,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
2
  import { TextAttributes } from '@opentui/core';
3
- import { uiTheme } from '../ui/theme';
4
- import { buildToolConfirmDialogContent } from './tool-confirm-dialog-content';
3
+ import { uiTheme } from '../ui/theme.js';
4
+ import { buildToolConfirmDialogContent } from './tool-confirm-dialog-content.js';
5
5
  const selectedForeground = '#050608';
6
6
  const renderButton = (label, selected) => {
7
7
  return (_jsx("box", { paddingLeft: 1, paddingRight: 1, backgroundColor: selected ? uiTheme.accent : uiTheme.surface, border: ['top', 'bottom', 'left', 'right'], borderColor: selected ? uiTheme.accent : uiTheme.divider, children: _jsx("text", { fg: selected ? selectedForeground : uiTheme.text, attributes: TextAttributes.BOLD, children: label }) }));
@@ -1,4 +1,4 @@
1
- import type { PromptFileSelection } from './types';
1
+ import type { PromptFileSelection } from './types.js';
2
2
  export type AttachmentModelCapabilities = {
3
3
  image: boolean;
4
4
  audio: boolean;
@@ -1,5 +1,5 @@
1
- import type { MessageContent } from '../types/message-content';
2
- import type { PromptFileSelection } from './types';
3
- import { type AttachmentModelCapabilities } from './attachment-capabilities';
1
+ import type { MessageContent } from '../types/message-content.js';
2
+ import type { PromptFileSelection } from './types.js';
3
+ import { type AttachmentModelCapabilities } from './attachment-capabilities.js';
4
4
  export declare const buildPromptContent: (prompt: string, files: PromptFileSelection[], capabilities: AttachmentModelCapabilities) => Promise<MessageContent>;
5
5
  //# sourceMappingURL=attachment-content.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { extname } from 'node:path';
3
- import { isAudioSelection, isImageSelection, isVideoSelection, } from './attachment-capabilities';
3
+ import { isAudioSelection, isImageSelection, isVideoSelection, } from './attachment-capabilities.js';
4
4
  const IMAGE_MIME_BY_EXTENSION = {
5
5
  '.gif': 'image/gif',
6
6
  '.jpeg': 'image/jpeg',
@@ -1,3 +1,3 @@
1
- import type { PromptFileSelection } from './types';
1
+ import type { PromptFileSelection } from './types.js';
2
2
  export declare const buildPromptDisplay: (prompt: string, files: PromptFileSelection[]) => string;
3
3
  //# sourceMappingURL=prompt-display.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { PromptFileSelection } from './types';
1
+ import type { PromptFileSelection } from './types.js';
2
2
  export declare const listWorkspaceFiles: () => Promise<PromptFileSelection[]>;
3
3
  //# sourceMappingURL=workspace-files.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { readdir } from 'node:fs/promises';
2
2
  import { join, relative } from 'node:path';
3
- import { resolveWorkspaceRoot } from '../agent/runtime/source-modules';
3
+ import { resolveWorkspaceRoot } from '../agent/runtime/source-modules.js';
4
4
  const IGNORED_DIR_NAMES = new Set([
5
5
  '.git',
6
6
  'node_modules',
@@ -1,5 +1,5 @@
1
- import type { AgentEventHandlers } from '../agent/runtime/types';
2
- import type { ReplySegmentType } from '../types/chat';
1
+ import type { AgentEventHandlers } from '../agent/runtime/types.js';
2
+ import type { ReplySegmentType } from '../types/chat.js';
3
3
  type BuildAgentEventHandlersParams = {
4
4
  turnId: number;
5
5
  isCurrentRequest: () => boolean;
@@ -1,4 +1,4 @@
1
- import { formatLoopEvent, formatStepEvent, formatStopEvent, formatToolConfirmEvent, formatToolResultEvent, formatToolResultEventCode, formatToolStreamEvent, formatToolUseEvent, formatToolUseEventCode, } from '../agent/runtime/event-format';
1
+ import { formatLoopEvent, formatStepEvent, formatStopEvent, formatToolConfirmEvent, formatToolResultEvent, formatToolResultEventCode, formatToolStreamEvent, formatToolUseEvent, formatToolUseEventCode, } from '../agent/runtime/event-format.js';
2
2
  const shouldShowEventLog = () => {
3
3
  const value = process.env.AGENT_SHOW_EVENTS?.trim().toLowerCase();
4
4
  return value === '1' || value === 'true' || value === 'yes' || value === 'on';
@@ -1,4 +1,4 @@
1
- import type { AssistantReply, ChatTurn, ReplySegment, ReplySegmentType, ReplyStatus } from '../types/chat';
1
+ import type { AssistantReply, ChatTurn, ReplySegment, ReplySegmentType, ReplyStatus } from '../types/chat.js';
2
2
  export declare const createStreamingReply: (modelLabel: string) => AssistantReply;
3
3
  export declare const patchTurn: (turns: ChatTurn[], turnId: number, patch: (turn: ChatTurn) => ChatTurn) => ChatTurn[];
4
4
  export declare const ensureSegment: (segments: ReplySegment[], segmentId: string, type: ReplySegmentType, data?: unknown) => ReplySegment[];
@@ -1,6 +1,6 @@
1
- import type { AgentToolConfirmEvent } from '../agent/runtime/types';
2
- import type { ChatTurn } from '../types/chat';
3
- import type { PromptFileSelection } from '../files/types';
1
+ import type { AgentToolConfirmEvent } from '../agent/runtime/types.js';
2
+ import type { ChatTurn } from '../types/chat.js';
3
+ import type { PromptFileSelection } from '../files/types.js';
4
4
  export type UseAgentChatResult = {
5
5
  turns: ChatTurn[];
6
6
  inputValue: string;
@@ -1,13 +1,13 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
- import { resolveSlashCommand } from '../commands/slash-commands';
3
- import { getAgentModelAttachmentCapabilities, getAgentModelLabel, runAgentPrompt, } from '../agent/runtime/runtime';
4
- import { requestExit } from '../runtime/exit';
5
- import { buildAgentEventHandlers } from './agent-event-handlers';
6
- import { buildHelpSegments, buildUnsupportedSegments, extractErrorMessage, } from './chat-local-replies';
7
- import { appendNoteLine, appendToSegment, createStreamingReply, orderReplySegments, patchTurn, setReplyStatus, } from './turn-updater';
8
- import { DEFAULT_ATTACHMENT_MODEL_CAPABILITIES, } from '../files/attachment-capabilities';
9
- import { buildPromptContent } from '../files/attachment-content';
10
- import { buildPromptDisplay } from '../files/prompt-display';
2
+ import { resolveSlashCommand } from '../commands/slash-commands.js';
3
+ import { getAgentModelAttachmentCapabilities, getAgentModelLabel, runAgentPrompt, } from '../agent/runtime/runtime.js';
4
+ import { requestExit } from '../runtime/exit.js';
5
+ import { buildAgentEventHandlers } from './agent-event-handlers.js';
6
+ import { buildHelpSegments, buildUnsupportedSegments, extractErrorMessage, } from './chat-local-replies.js';
7
+ import { appendNoteLine, appendToSegment, createStreamingReply, orderReplySegments, patchTurn, setReplyStatus, } from './turn-updater.js';
8
+ import { DEFAULT_ATTACHMENT_MODEL_CAPABILITIES, } from '../files/attachment-capabilities.js';
9
+ import { buildPromptContent } from '../files/attachment-content.js';
10
+ import { buildPromptDisplay } from '../files/prompt-display.js';
11
11
  const INITIAL_MODEL_LABEL = process.env.AGENT_MODEL?.trim() || '';
12
12
  const normalizeTokenCount = (value) => {
13
13
  if (typeof value !== 'number' || !Number.isFinite(value)) {
@@ -1,6 +1,6 @@
1
1
  import type { KeyEvent, TextareaRenderable } from '@opentui/core';
2
2
  import { type RefObject } from 'react';
3
- import type { PromptFileSelection } from '../files/types';
3
+ import type { PromptFileSelection } from '../files/types.js';
4
4
  type UseFileMentionMenuParams = {
5
5
  value: string;
6
6
  textareaRef: RefObject<TextareaRenderable | null>;
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { findTrailingFileMention } from '../files/file-mention-query';
3
- import { isMediaSelection } from '../files/attachment-capabilities';
4
- import { listWorkspaceFiles } from '../files/workspace-files';
2
+ import { findTrailingFileMention } from '../files/file-mention-query.js';
3
+ import { isMediaSelection } from '../files/attachment-capabilities.js';
4
+ import { listWorkspaceFiles } from '../files/workspace-files.js';
5
5
  const normalize = (value) => value.trim().toLowerCase();
6
6
  export const useFileMentionMenu = ({ value, textareaRef, selectedFiles, onFilesSelected, onValueChange, disabled = false, }) => {
7
7
  const [selectedIndex, setSelectedIndex] = useState(0);
@@ -1,5 +1,5 @@
1
1
  import type { KeyEvent } from '@opentui/core';
2
- import type { PromptFileSelection } from '../files/types';
2
+ import type { PromptFileSelection } from '../files/types.js';
3
3
  type UseFilePickerResult = {
4
4
  visible: boolean;
5
5
  loading: boolean;
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { listWorkspaceFiles } from '../files/workspace-files';
2
+ import { listWorkspaceFiles } from '../files/workspace-files.js';
3
3
  const normalize = (value) => value.trim().toLowerCase();
4
4
  export const useFilePicker = () => {
5
5
  const [visible, setVisible] = useState(false);
@@ -1,5 +1,5 @@
1
1
  import type { KeyEvent } from '@opentui/core';
2
- import type { AgentModelOption } from '../agent/runtime/model-types';
2
+ import type { AgentModelOption } from '../agent/runtime/model-types.js';
3
3
  type UseModelPickerParams = {
4
4
  onModelChanged: (label: string) => void;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { listAgentModels, switchAgentModel } from '../agent/runtime/runtime';
2
+ import { listAgentModels, switchAgentModel } from '../agent/runtime/runtime.js';
3
3
  const normalize = (value) => value.trim().toLowerCase();
4
4
  export const useModelPicker = ({ onModelChanged }) => {
5
5
  const [visible, setVisible] = useState(false);
@@ -1,6 +1,6 @@
1
1
  import type { KeyEvent, TextareaRenderable } from '@opentui/core';
2
2
  import { type RefObject } from 'react';
3
- import { type SlashCommandDefinition } from '../commands/slash-commands';
3
+ import { type SlashCommandDefinition } from '../commands/slash-commands.js';
4
4
  type UseSlashCommandMenuParams = {
5
5
  value: string;
6
6
  onValueChange: (value: string) => void;
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useMemo, useState } from 'react';
2
- import { filterSlashCommands } from '../commands/slash-commands';
2
+ import { filterSlashCommands } from '../commands/slash-commands.js';
3
3
  const getSlashQuery = (value) => {
4
4
  if (!/^\/[^\s]*$/.test(value)) {
5
5
  return null;
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx } from "@opentui/react/jsx-runtime";
2
2
  import { createCliRenderer } from '@opentui/core';
3
3
  import { createRoot } from '@opentui/react';
4
- import { App } from './App';
5
- import { bindExitGuards, hardResetTerminal, initExitRuntime, registerTerminalBackgroundRestore, } from './runtime/exit';
6
- import { probeTerminalColors, setTerminalWindowBackground, setTerminalWindowForeground, } from './runtime/terminal-theme';
7
- import { applyMarkdownThemeMode } from './ui/opencode-markdown';
8
- import { applyUiThemeMode, uiTheme } from './ui/theme';
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
9
  bindExitGuards();
10
10
  // OpenTUI exposes OPENTUI_FORCE_WCWIDTH for terminals where CJK width handling
11
11
  // is more accurate with wcwidth than the default Unicode capability probe.
@@ -1,4 +1,4 @@
1
- import { disposeAgentRuntime } from '../agent/runtime/runtime';
1
+ import { disposeAgentRuntime } from '../agent/runtime/runtime.js';
2
2
  const TERMINAL_RESET_SEQUENCE = [
3
3
  '\u001b[0m',
4
4
  '\u001b[?25h',
@@ -1,6 +1,6 @@
1
1
  import { SyntaxStyle } from '@opentui/core';
2
- import { type MarkdownThemePlatform } from './open-code-theme';
3
- import type { UiThemeMode } from './theme';
2
+ import { type MarkdownThemePlatform } from './open-code-theme.js';
3
+ import type { UiThemeMode } from './theme.js';
4
4
  export declare let opencodeMarkdownSyntax: SyntaxStyle;
5
5
  export declare let opencodeSubtleMarkdownSyntax: SyntaxStyle;
6
6
  export declare const applyMarkdownThemeMode: (mode: UiThemeMode, platform?: MarkdownThemePlatform) => void;
@@ -1,5 +1,5 @@
1
1
  import { RGBA, SyntaxStyle } from '@opentui/core';
2
- import { resolveOpenCodeTheme, } from './open-code-theme';
2
+ import { resolveOpenCodeTheme, } from './open-code-theme.js';
3
3
  const getSyntaxRules = (theme, options) => {
4
4
  const useItalic = options.platform !== 'darwin';
5
5
  const useUnderline = options.platform !== 'darwin';
@@ -1,5 +1,5 @@
1
1
  import { TextAttributes } from '@opentui/core';
2
- import { type OpenCodeThemeMode } from './open-code-theme';
2
+ import { type OpenCodeThemeMode } from './open-code-theme.js';
3
3
  export type UiThemeMode = OpenCodeThemeMode;
4
4
  type TextAttributeValue = (typeof TextAttributes)[keyof typeof TextAttributes];
5
5
  export type UiTheme = {
package/dist/ui/theme.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TextAttributes, rgbToHex } from '@opentui/core';
2
- import { resolveOpenCodeTheme } from './open-code-theme';
2
+ import { resolveOpenCodeTheme } from './open-code-theme.js';
3
3
  const baseLayout = {
4
4
  appPaddingTop: 0,
5
5
  appPaddingBottom: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renxqoo/renx-code",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Enterprise-grade AI coding assistant CLI tool with interactive terminal UI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,8 +25,8 @@
25
25
  "scripts": {
26
26
  "dev": "bun run src/index.tsx",
27
27
  "dev:watch": "bun run --watch src/index.tsx",
28
- "build": "tsc -p tsconfig.build.json",
29
- "build:cli": "tsc -p tsconfig.build.json && node -e \"require('fs').chmodSync('dist/cli.js', 0o755)\"",
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
30
  "start": "node dist/index.js",
31
31
  "test": "vitest",
32
32
  "test:coverage": "vitest run --coverage",