@vybestack/llxprt-ui 0.7.0-nightly.251211.5750c518a
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/PLAN-messages.md +681 -0
- package/PLAN.md +47 -0
- package/README.md +25 -0
- package/bun.lock +1024 -0
- package/dev-docs/ARCHITECTURE.md +178 -0
- package/dev-docs/CODE_ORGANIZATION.md +232 -0
- package/dev-docs/STANDARDS.md +235 -0
- package/dev-docs/UI_DESIGN.md +425 -0
- package/eslint.config.cjs +194 -0
- package/images/nui.png +0 -0
- package/llxprt.png +0 -0
- package/llxprt.svg +128 -0
- package/package.json +66 -0
- package/scripts/check-limits.ts +177 -0
- package/scripts/start.js +71 -0
- package/src/app.tsx +599 -0
- package/src/bootstrap.tsx +23 -0
- package/src/commands/AuthCommand.tsx +80 -0
- package/src/commands/ModelCommand.tsx +102 -0
- package/src/commands/ProviderCommand.tsx +103 -0
- package/src/commands/ThemeCommand.tsx +71 -0
- package/src/features/chat/history.ts +178 -0
- package/src/features/chat/index.ts +3 -0
- package/src/features/chat/persistentHistory.ts +102 -0
- package/src/features/chat/responder.ts +217 -0
- package/src/features/completion/completions.ts +161 -0
- package/src/features/completion/index.ts +3 -0
- package/src/features/completion/slash.test.ts +82 -0
- package/src/features/completion/slash.ts +248 -0
- package/src/features/completion/suggestions.test.ts +51 -0
- package/src/features/completion/suggestions.ts +112 -0
- package/src/features/config/configSession.test.ts +189 -0
- package/src/features/config/configSession.ts +179 -0
- package/src/features/config/index.ts +4 -0
- package/src/features/config/llxprtAdapter.integration.test.ts +202 -0
- package/src/features/config/llxprtAdapter.test.ts +139 -0
- package/src/features/config/llxprtAdapter.ts +257 -0
- package/src/features/config/llxprtCommands.test.ts +40 -0
- package/src/features/config/llxprtCommands.ts +35 -0
- package/src/features/config/llxprtConfig.test.ts +261 -0
- package/src/features/config/llxprtConfig.ts +418 -0
- package/src/features/theme/index.ts +2 -0
- package/src/features/theme/theme.test.ts +51 -0
- package/src/features/theme/theme.ts +105 -0
- package/src/features/theme/themeManager.ts +84 -0
- package/src/hooks/useAppCommands.ts +129 -0
- package/src/hooks/useApprovalKeyboard.ts +156 -0
- package/src/hooks/useChatStore.test.ts +112 -0
- package/src/hooks/useChatStore.ts +252 -0
- package/src/hooks/useInputManager.ts +99 -0
- package/src/hooks/useKeyboardHandlers.ts +130 -0
- package/src/hooks/useListNavigation.test.ts +166 -0
- package/src/hooks/useListNavigation.ts +62 -0
- package/src/hooks/usePersistentHistory.ts +94 -0
- package/src/hooks/useScrollManagement.ts +107 -0
- package/src/hooks/useSelectionClipboard.ts +48 -0
- package/src/hooks/useSessionManager.test.ts +85 -0
- package/src/hooks/useSessionManager.ts +101 -0
- package/src/hooks/useStreamingLifecycle.ts +71 -0
- package/src/hooks/useStreamingResponder.ts +401 -0
- package/src/hooks/useSuggestionSetup.ts +23 -0
- package/src/hooks/useToolApproval.test.ts +140 -0
- package/src/hooks/useToolApproval.ts +264 -0
- package/src/hooks/useToolScheduler.ts +432 -0
- package/src/index.ts +3 -0
- package/src/jsx.d.ts +11 -0
- package/src/lib/clipboard.ts +18 -0
- package/src/lib/logger.ts +107 -0
- package/src/lib/random.ts +5 -0
- package/src/main.tsx +13 -0
- package/src/test/mockTheme.ts +51 -0
- package/src/types/events.ts +87 -0
- package/src/types.ts +13 -0
- package/src/ui/components/ChatLayout.tsx +694 -0
- package/src/ui/components/CommandComponents.tsx +74 -0
- package/src/ui/components/DiffViewer.tsx +306 -0
- package/src/ui/components/FilterInput.test.ts +69 -0
- package/src/ui/components/FilterInput.tsx +62 -0
- package/src/ui/components/HeaderBar.tsx +137 -0
- package/src/ui/components/RadioSelect.test.ts +140 -0
- package/src/ui/components/RadioSelect.tsx +88 -0
- package/src/ui/components/SelectableList.test.ts +83 -0
- package/src/ui/components/SelectableList.tsx +35 -0
- package/src/ui/components/StatusBar.tsx +45 -0
- package/src/ui/components/SuggestionPanel.tsx +102 -0
- package/src/ui/components/messages/ModelMessage.tsx +14 -0
- package/src/ui/components/messages/SystemMessage.tsx +29 -0
- package/src/ui/components/messages/ThinkingMessage.tsx +14 -0
- package/src/ui/components/messages/UserMessage.tsx +26 -0
- package/src/ui/components/messages/index.ts +15 -0
- package/src/ui/components/messages/renderMessage.test.ts +49 -0
- package/src/ui/components/messages/renderMessage.tsx +43 -0
- package/src/ui/components/messages/types.test.ts +24 -0
- package/src/ui/components/messages/types.ts +36 -0
- package/src/ui/modals/AuthModal.tsx +106 -0
- package/src/ui/modals/ModalShell.tsx +60 -0
- package/src/ui/modals/SearchSelectModal.tsx +236 -0
- package/src/ui/modals/ThemeModal.tsx +204 -0
- package/src/ui/modals/ToolApprovalModal.test.ts +206 -0
- package/src/ui/modals/ToolApprovalModal.tsx +282 -0
- package/src/ui/modals/index.ts +20 -0
- package/src/ui/modals/modals.test.ts +26 -0
- package/src/ui/modals/types.ts +19 -0
- package/src/uicontext/Command.tsx +102 -0
- package/src/uicontext/Dialog.tsx +65 -0
- package/src/uicontext/index.ts +2 -0
- package/themes/ansi-light.json +59 -0
- package/themes/ansi.json +59 -0
- package/themes/atom-one-dark.json +59 -0
- package/themes/ayu-light.json +59 -0
- package/themes/ayu.json +59 -0
- package/themes/default-light.json +59 -0
- package/themes/default.json +59 -0
- package/themes/dracula.json +59 -0
- package/themes/github-dark.json +59 -0
- package/themes/github-light.json +59 -0
- package/themes/googlecode.json +59 -0
- package/themes/green-screen.json +59 -0
- package/themes/no-color.json +59 -0
- package/themes/shades-of-purple.json +59 -0
- package/themes/xcode.json +59 -0
- package/tsconfig.json +28 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event types for the adapter layer between llxprt-code-core and nui UI.
|
|
3
|
+
* These represent the streaming events that the UI understands.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface TextDeltaEvent {
|
|
7
|
+
readonly type: 'text_delta';
|
|
8
|
+
readonly text: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ThinkingDeltaEvent {
|
|
12
|
+
readonly type: 'thinking_delta';
|
|
13
|
+
readonly text: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ToolStatus =
|
|
17
|
+
| 'pending'
|
|
18
|
+
| 'executing'
|
|
19
|
+
| 'complete'
|
|
20
|
+
| 'error'
|
|
21
|
+
| 'confirming'
|
|
22
|
+
| 'cancelled';
|
|
23
|
+
|
|
24
|
+
export interface ToolPendingEvent {
|
|
25
|
+
readonly type: 'tool_pending';
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly params: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ToolConfirmationType = 'edit' | 'exec' | 'mcp' | 'info';
|
|
32
|
+
|
|
33
|
+
export interface ToolConfirmationEvent {
|
|
34
|
+
readonly type: 'tool_confirmation';
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly params: Record<string, unknown>;
|
|
38
|
+
readonly confirmationType: ToolConfirmationType;
|
|
39
|
+
/** Human-readable question for the user */
|
|
40
|
+
readonly question: string;
|
|
41
|
+
/** Preview content (command, file diff, etc.) */
|
|
42
|
+
readonly preview: string;
|
|
43
|
+
/** Whether "always allow" options should be shown */
|
|
44
|
+
readonly canAllowAlways: boolean;
|
|
45
|
+
/** Correlation ID for MessageBus response */
|
|
46
|
+
readonly correlationId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ToolResultEvent {
|
|
50
|
+
readonly type: 'tool_result';
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly success: boolean;
|
|
53
|
+
/** Display output from the tool */
|
|
54
|
+
readonly output: string;
|
|
55
|
+
/** Error message if failed */
|
|
56
|
+
readonly errorMessage?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ToolCancelledEvent {
|
|
60
|
+
readonly type: 'tool_cancelled';
|
|
61
|
+
readonly id: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CompleteEvent {
|
|
65
|
+
readonly type: 'complete';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ErrorEvent {
|
|
69
|
+
readonly type: 'error';
|
|
70
|
+
readonly message: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface UnknownEvent {
|
|
74
|
+
readonly type: 'unknown';
|
|
75
|
+
readonly raw: unknown;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type AdapterEvent =
|
|
79
|
+
| TextDeltaEvent
|
|
80
|
+
| ThinkingDeltaEvent
|
|
81
|
+
| ToolPendingEvent
|
|
82
|
+
| ToolConfirmationEvent
|
|
83
|
+
| ToolResultEvent
|
|
84
|
+
| ToolCancelledEvent
|
|
85
|
+
| CompleteEvent
|
|
86
|
+
| ErrorEvent
|
|
87
|
+
| UnknownEvent;
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for launching the NUI
|
|
3
|
+
*/
|
|
4
|
+
export interface UILaunchConfig {
|
|
5
|
+
/** Pre-loaded profile name */
|
|
6
|
+
profile?: string;
|
|
7
|
+
/** Pre-built config from CLI bootstrap */
|
|
8
|
+
sessionConfig?: Record<string, unknown>;
|
|
9
|
+
/** Working directory */
|
|
10
|
+
workingDir: string;
|
|
11
|
+
/** Pass-through command line arguments */
|
|
12
|
+
args: string[];
|
|
13
|
+
}
|