@navios/commander-tui 1.0.0
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/CHANGELOG.md +25 -0
- package/README.md +275 -0
- package/coverage/__tests__/utils/factories.ts.html +1147 -0
- package/coverage/__tests__/utils/index.html +131 -0
- package/coverage/__tests__/utils/render-utils.tsx.html +202 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +959 -0
- package/coverage/components/filter/filter_bar.tsx.html +322 -0
- package/coverage/components/filter/index.html +116 -0
- package/coverage/components/log/index.html +131 -0
- package/coverage/components/log/index.ts.html +88 -0
- package/coverage/components/log/log_message.tsx.html +391 -0
- package/coverage/components/prompt/index.html +116 -0
- package/coverage/components/prompt/prompt_renderer.tsx.html +1123 -0
- package/coverage/components/screen/index.html +131 -0
- package/coverage/components/screen/loading_message.tsx.html +217 -0
- package/coverage/components/screen/progress_message.tsx.html +265 -0
- package/coverage/components/sidebar/index.html +146 -0
- package/coverage/components/sidebar/sidebar.tsx.html +391 -0
- package/coverage/components/sidebar/sidebar_item.tsx.html +235 -0
- package/coverage/components/sidebar/sidebar_separator.tsx.html +124 -0
- package/coverage/context/index.html +131 -0
- package/coverage/context/index.ts.html +88 -0
- package/coverage/context/logger_context.tsx.html +412 -0
- package/coverage/coverage-final.json +55 -0
- package/coverage/favicon.png +0 -0
- package/coverage/filter/filter_engine.ts.html +424 -0
- package/coverage/filter/index.html +116 -0
- package/coverage/hooks/index.html +131 -0
- package/coverage/hooks/index.ts.html +88 -0
- package/coverage/hooks/use_theme.ts.html +121 -0
- package/coverage/index.html +356 -0
- package/coverage/keyboard/index.html +116 -0
- package/coverage/keyboard/keyboard_manager.ts.html +784 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/schemas/index.html +161 -0
- package/coverage/schemas/index.ts.html +94 -0
- package/coverage/schemas/logger-options.ts.html +124 -0
- package/coverage/schemas/prompt-options.ts.html +112 -0
- package/coverage/schemas/screen-options.ts.html +127 -0
- package/coverage/services/index.html +146 -0
- package/coverage/services/logger.ts.html +1192 -0
- package/coverage/services/prompt.ts.html +568 -0
- package/coverage/services/screen.ts.html +1804 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/themes/dark.ts.html +604 -0
- package/coverage/themes/high-contrast.ts.html +619 -0
- package/coverage/themes/index.html +176 -0
- package/coverage/themes/index.ts.html +97 -0
- package/coverage/themes/light.ts.html +601 -0
- package/coverage/themes/utils.ts.html +334 -0
- package/coverage/tokens/index.html +161 -0
- package/coverage/tokens/index.ts.html +94 -0
- package/coverage/tokens/logger.ts.html +115 -0
- package/coverage/tokens/prompt.ts.html +115 -0
- package/coverage/tokens/screen.ts.html +115 -0
- package/coverage/types/file.types.ts.html +265 -0
- package/coverage/types/filter.types.ts.html +238 -0
- package/coverage/types/index.html +236 -0
- package/coverage/types/index.ts.html +151 -0
- package/coverage/types/keyboard.types.ts.html +364 -0
- package/coverage/types/log.types.ts.html +268 -0
- package/coverage/types/message.types.ts.html +445 -0
- package/coverage/types/prompt.types.ts.html +403 -0
- package/coverage/types/screen.types.ts.html +451 -0
- package/coverage/types/theme.types.ts.html +841 -0
- package/coverage/utils/colors/file-colors.ts.html +112 -0
- package/coverage/utils/colors/helpers.ts.html +235 -0
- package/coverage/utils/colors/index.html +221 -0
- package/coverage/utils/colors/index.ts.html +145 -0
- package/coverage/utils/colors/log-colors.ts.html +253 -0
- package/coverage/utils/colors/progress-colors.ts.html +160 -0
- package/coverage/utils/colors/prompt-colors.ts.html +175 -0
- package/coverage/utils/colors/sidebar-colors.ts.html +241 -0
- package/coverage/utils/colors/table-colors.ts.html +118 -0
- package/coverage/utils/filetype.ts.html +277 -0
- package/coverage/utils/format.ts.html +241 -0
- package/coverage/utils/index.html +161 -0
- package/coverage/utils/index.ts.html +118 -0
- package/coverage/utils/stdout-printer.ts.html +523 -0
- package/dist/src/components/file/file_log.d.ts +35 -0
- package/dist/src/components/file/file_log.d.ts.map +1 -0
- package/dist/src/components/file/index.d.ts +2 -0
- package/dist/src/components/file/index.d.ts.map +1 -0
- package/dist/src/components/filter/filter_bar.d.ts +10 -0
- package/dist/src/components/filter/filter_bar.d.ts.map +1 -0
- package/dist/src/components/filter/index.d.ts +2 -0
- package/dist/src/components/filter/index.d.ts.map +1 -0
- package/dist/src/components/help/help_overlay.d.ts +10 -0
- package/dist/src/components/help/help_overlay.d.ts.map +1 -0
- package/dist/src/components/help/index.d.ts +2 -0
- package/dist/src/components/help/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +27 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/log/debug_log.d.ts +3 -0
- package/dist/src/components/log/debug_log.d.ts.map +1 -0
- package/dist/src/components/log/error_log.d.ts +3 -0
- package/dist/src/components/log/error_log.d.ts.map +1 -0
- package/dist/src/components/log/fatal_log.d.ts +3 -0
- package/dist/src/components/log/fatal_log.d.ts.map +1 -0
- package/dist/src/components/log/index.d.ts +9 -0
- package/dist/src/components/log/index.d.ts.map +1 -0
- package/dist/src/components/log/info_log.d.ts +3 -0
- package/dist/src/components/log/info_log.d.ts.map +1 -0
- package/dist/src/components/log/log_message.d.ts +33 -0
- package/dist/src/components/log/log_message.d.ts.map +1 -0
- package/dist/src/components/log/success_log.d.ts +3 -0
- package/dist/src/components/log/success_log.d.ts.map +1 -0
- package/dist/src/components/log/trace_log.d.ts +3 -0
- package/dist/src/components/log/trace_log.d.ts.map +1 -0
- package/dist/src/components/log/warning_log.d.ts +3 -0
- package/dist/src/components/log/warning_log.d.ts.map +1 -0
- package/dist/src/components/prompt/index.d.ts +3 -0
- package/dist/src/components/prompt/index.d.ts.map +1 -0
- package/dist/src/components/prompt/prompt_renderer.d.ts +6 -0
- package/dist/src/components/prompt/prompt_renderer.d.ts.map +1 -0
- package/dist/src/components/screen/group_renderer.d.ts +19 -0
- package/dist/src/components/screen/group_renderer.d.ts.map +1 -0
- package/dist/src/components/screen/index.d.ts +13 -0
- package/dist/src/components/screen/index.d.ts.map +1 -0
- package/dist/src/components/screen/loading_message.d.ts +6 -0
- package/dist/src/components/screen/loading_message.d.ts.map +1 -0
- package/dist/src/components/screen/message_renderer.d.ts +8 -0
- package/dist/src/components/screen/message_renderer.d.ts.map +1 -0
- package/dist/src/components/screen/progress_message.d.ts +8 -0
- package/dist/src/components/screen/progress_message.d.ts.map +1 -0
- package/dist/src/components/screen/screen_bridge.d.ts +20 -0
- package/dist/src/components/screen/screen_bridge.d.ts.map +1 -0
- package/dist/src/components/screen/table_message.d.ts +6 -0
- package/dist/src/components/screen/table_message.d.ts.map +1 -0
- package/dist/src/components/screen_manager_bridge.d.ts +11 -0
- package/dist/src/components/screen_manager_bridge.d.ts.map +1 -0
- package/dist/src/components/sidebar/index.d.ts +6 -0
- package/dist/src/components/sidebar/index.d.ts.map +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +18 -0
- package/dist/src/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/src/components/sidebar/sidebar_item.d.ts +14 -0
- package/dist/src/components/sidebar/sidebar_item.d.ts.map +1 -0
- package/dist/src/components/sidebar/sidebar_separator.d.ts +2 -0
- package/dist/src/components/sidebar/sidebar_separator.d.ts.map +1 -0
- package/dist/src/context/logger_context.d.ts +60 -0
- package/dist/src/context/logger_context.d.ts.map +1 -0
- package/dist/src/filter/filter_engine.d.ts +20 -0
- package/dist/src/filter/filter_engine.d.ts.map +1 -0
- package/dist/src/filter/index.d.ts +4 -0
- package/dist/src/filter/index.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/use_theme.d.ts +7 -0
- package/dist/src/hooks/use_theme.d.ts.map +1 -0
- package/dist/src/index.d.ts +88 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/keyboard/create_bindings.d.ts +31 -0
- package/dist/src/keyboard/create_bindings.d.ts.map +1 -0
- package/dist/src/keyboard/index.d.ts +12 -0
- package/dist/src/keyboard/index.d.ts.map +1 -0
- package/dist/src/keyboard/keyboard_manager.d.ts +69 -0
- package/dist/src/keyboard/keyboard_manager.d.ts.map +1 -0
- package/dist/src/services/index.d.ts +5 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/logger.d.ts +61 -0
- package/dist/src/services/logger.d.ts.map +1 -0
- package/dist/src/services/prompt.d.ts +37 -0
- package/dist/src/services/prompt.d.ts.map +1 -0
- package/dist/src/services/screen.d.ts +165 -0
- package/dist/src/services/screen.d.ts.map +1 -0
- package/dist/src/services/screen_manager.d.ts +124 -0
- package/dist/src/services/screen_manager.d.ts.map +1 -0
- package/dist/src/themes/dark.d.ts +7 -0
- package/dist/src/themes/dark.d.ts.map +1 -0
- package/dist/src/themes/high-contrast.d.ts +7 -0
- package/dist/src/themes/high-contrast.d.ts.map +1 -0
- package/dist/src/themes/index.d.ts +18 -0
- package/dist/src/themes/index.d.ts.map +1 -0
- package/dist/src/themes/light.d.ts +6 -0
- package/dist/src/themes/light.d.ts.map +1 -0
- package/dist/src/themes/utils.d.ts +22 -0
- package/dist/src/themes/utils.d.ts.map +1 -0
- package/dist/src/types/file.types.d.ts +40 -0
- package/dist/src/types/file.types.d.ts.map +1 -0
- package/dist/src/types/filter.types.d.ts +31 -0
- package/dist/src/types/filter.types.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +81 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/keyboard.types.d.ts +83 -0
- package/dist/src/types/keyboard.types.d.ts.map +1 -0
- package/dist/src/types/log.types.d.ts +32 -0
- package/dist/src/types/log.types.d.ts.map +1 -0
- package/dist/src/types/message.types.d.ts +91 -0
- package/dist/src/types/message.types.d.ts.map +1 -0
- package/dist/src/types/prompt.types.d.ts +89 -0
- package/dist/src/types/prompt.types.d.ts.map +1 -0
- package/dist/src/types/screen.types.d.ts +85 -0
- package/dist/src/types/screen.types.d.ts.map +1 -0
- package/dist/src/types/theme.types.d.ts +216 -0
- package/dist/src/types/theme.types.d.ts.map +1 -0
- package/dist/src/utils/colors/file-colors.d.ts +10 -0
- package/dist/src/utils/colors/file-colors.d.ts.map +1 -0
- package/dist/src/utils/colors/helpers.d.ts +29 -0
- package/dist/src/utils/colors/helpers.d.ts.map +1 -0
- package/dist/src/utils/colors/index.d.ts +13 -0
- package/dist/src/utils/colors/index.d.ts.map +1 -0
- package/dist/src/utils/colors/log-colors.d.ts +15 -0
- package/dist/src/utils/colors/log-colors.d.ts.map +1 -0
- package/dist/src/utils/colors/progress-colors.d.ts +25 -0
- package/dist/src/utils/colors/progress-colors.d.ts.map +1 -0
- package/dist/src/utils/colors/prompt-colors.d.ts +22 -0
- package/dist/src/utils/colors/prompt-colors.d.ts.map +1 -0
- package/dist/src/utils/colors/sidebar-colors.d.ts +50 -0
- package/dist/src/utils/colors/sidebar-colors.d.ts.map +1 -0
- package/dist/src/utils/colors/table-colors.d.ts +12 -0
- package/dist/src/utils/colors/table-colors.d.ts.map +1 -0
- package/dist/src/utils/filetype.d.ts +19 -0
- package/dist/src/utils/filetype.d.ts.map +1 -0
- package/dist/src/utils/format.d.ts +9 -0
- package/dist/src/utils/format.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +20 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/stdout-printer.d.ts +10 -0
- package/dist/src/utils/stdout-printer.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/tsdown.config.d.mts +5 -0
- package/dist/tsdown.config.d.mts.map +1 -0
- package/dist/vitest.config.d.mts +3 -0
- package/dist/vitest.config.d.mts.map +1 -0
- package/lib/index.cjs +6349 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +1720 -0
- package/lib/index.d.cts.map +1 -0
- package/lib/index.d.mts +1720 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +6264 -0
- package/lib/index.mjs.map +1 -0
- package/lib/screen_manager_bridge-BpDgVu3e.cjs +3357 -0
- package/lib/screen_manager_bridge-BpDgVu3e.cjs.map +1 -0
- package/lib/screen_manager_bridge-CkV7637i.cjs +3 -0
- package/lib/screen_manager_bridge-DN2J6_k1.mjs +3 -0
- package/lib/screen_manager_bridge-Dfg4QUrl.mjs +3034 -0
- package/lib/screen_manager_bridge-Dfg4QUrl.mjs.map +1 -0
- package/package.json +43 -0
- package/project.json +60 -0
- package/src/__tests__/components/__snapshots__/filter_bar.spec.tsx.snap +2245 -0
- package/src/__tests__/components/__snapshots__/loading_message.spec.tsx.snap +1382 -0
- package/src/__tests__/components/__snapshots__/log_message.spec.tsx.snap +3169 -0
- package/src/__tests__/components/__snapshots__/progress_message.spec.tsx.snap +1743 -0
- package/src/__tests__/components/__snapshots__/prompt_renderer.spec.tsx.snap +3135 -0
- package/src/__tests__/components/__snapshots__/sidebar.spec.tsx.snap +2617 -0
- package/src/__tests__/components/filter_bar.spec.tsx +190 -0
- package/src/__tests__/components/loading_message.spec.tsx +110 -0
- package/src/__tests__/components/log_message.spec.tsx +166 -0
- package/src/__tests__/components/progress_message.spec.tsx +147 -0
- package/src/__tests__/components/prompt_renderer.spec.tsx +274 -0
- package/src/__tests__/components/sidebar.spec.tsx +305 -0
- package/src/__tests__/filter/filter_engine.spec.ts +325 -0
- package/src/__tests__/keyboard/keyboard_manager.spec.ts +557 -0
- package/src/__tests__/mocks/scm-mock.ts +5 -0
- package/src/__tests__/services/logger.spec.ts +630 -0
- package/src/__tests__/services/prompt.spec.ts +411 -0
- package/src/__tests__/services/screen.spec.ts +721 -0
- package/src/__tests__/setup.ts +43 -0
- package/src/__tests__/utils/factories.ts +354 -0
- package/src/__tests__/utils/filetype.spec.ts +195 -0
- package/src/__tests__/utils/format.spec.ts +178 -0
- package/src/__tests__/utils/render-utils.tsx +39 -0
- package/src/__tests__/utils/test-container.ts +48 -0
- package/src/components/file/file_log.tsx +241 -0
- package/src/components/file/index.ts +1 -0
- package/src/components/filter/filter_bar.tsx +79 -0
- package/src/components/filter/index.ts +1 -0
- package/src/components/help/help_overlay.tsx +100 -0
- package/src/components/help/index.ts +1 -0
- package/src/components/index.ts +15 -0
- package/src/components/log/index.ts +1 -0
- package/src/components/log/log_message.tsx +102 -0
- package/src/components/prompt/index.ts +2 -0
- package/src/components/prompt/prompt_renderer.tsx +346 -0
- package/src/components/screen/group_renderer.tsx +64 -0
- package/src/components/screen/index.ts +6 -0
- package/src/components/screen/loading_message.tsx +44 -0
- package/src/components/screen/message_renderer.tsx +108 -0
- package/src/components/screen/progress_message.tsx +60 -0
- package/src/components/screen/screen_bridge.tsx +149 -0
- package/src/components/screen/table_message.tsx +57 -0
- package/src/components/screen_manager_bridge.tsx +245 -0
- package/src/components/sidebar/index.ts +3 -0
- package/src/components/sidebar/sidebar.tsx +102 -0
- package/src/components/sidebar/sidebar_item.tsx +50 -0
- package/src/components/sidebar/sidebar_separator.tsx +13 -0
- package/src/context/index.ts +1 -0
- package/src/context/logger_context.tsx +109 -0
- package/src/factories/index.ts +1 -0
- package/src/factories/screen.factory.ts +22 -0
- package/src/filter/filter_engine.ts +113 -0
- package/src/filter/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use_theme.ts +12 -0
- package/src/index.ts +64 -0
- package/src/keyboard/create_bindings.ts +457 -0
- package/src/keyboard/index.ts +2 -0
- package/src/keyboard/keyboard_manager.ts +233 -0
- package/src/overrides/console.logger.override.ts +61 -0
- package/src/overrides/index.ts +1 -0
- package/src/schemas/index.ts +3 -0
- package/src/schemas/logger-options.ts +13 -0
- package/src/schemas/prompt-options.ts +9 -0
- package/src/schemas/screen-options.ts +14 -0
- package/src/services/index.ts +4 -0
- package/src/services/logger.ts +369 -0
- package/src/services/prompt.ts +169 -0
- package/src/services/screen.ts +590 -0
- package/src/services/screen_manager.tsx +390 -0
- package/src/themes/dark.ts +173 -0
- package/src/themes/high-contrast.ts +178 -0
- package/src/themes/index.ts +4 -0
- package/src/themes/light.ts +172 -0
- package/src/themes/utils.ts +83 -0
- package/src/tokens/index.ts +3 -0
- package/src/tokens/logger.ts +10 -0
- package/src/tokens/prompt.ts +10 -0
- package/src/tokens/screen.ts +10 -0
- package/src/types/file.types.ts +60 -0
- package/src/types/filter.types.ts +51 -0
- package/src/types/index.ts +22 -0
- package/src/types/keyboard.types.ts +93 -0
- package/src/types/log.types.ts +61 -0
- package/src/types/message.types.ts +120 -0
- package/src/types/prompt.types.ts +106 -0
- package/src/types/screen.types.ts +124 -0
- package/src/types/theme.types.ts +252 -0
- package/src/utils/colors/file-colors.ts +9 -0
- package/src/utils/colors/helpers.ts +50 -0
- package/src/utils/colors/index.ts +20 -0
- package/src/utils/colors/log-colors.ts +56 -0
- package/src/utils/colors/progress-colors.ts +25 -0
- package/src/utils/colors/prompt-colors.ts +30 -0
- package/src/utils/colors/sidebar-colors.ts +52 -0
- package/src/utils/colors/table-colors.ts +11 -0
- package/src/utils/filetype.ts +64 -0
- package/src/utils/format.ts +52 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/stdout-printer.ts +255 -0
- package/tsconfig.json +14 -0
- package/tsdown.config.mts +34 -0
- package/vitest.config.mts +10 -0
package/lib/index.d.cts
ADDED
|
@@ -0,0 +1,1720 @@
|
|
|
1
|
+
import { ClassTypeWithInstance, FactoryContext, InjectionToken, LogLevel, LoggerService } from "@navios/core";
|
|
2
|
+
import { RGBA, SyntaxStyle, TreeSitterClient } from "@opentui/core";
|
|
3
|
+
import * as react0 from "react";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import * as zod_v418 from "zod/v4";
|
|
6
|
+
import { z } from "zod/v4";
|
|
7
|
+
import * as zod_v4_core1 from "zod/v4/core";
|
|
8
|
+
|
|
9
|
+
//#region src/types/message.types.d.ts
|
|
10
|
+
type MessageType = 'log' | 'file' | 'diff' | 'fileError' | 'loading' | 'progress' | 'group' | 'table';
|
|
11
|
+
interface BaseMessage {
|
|
12
|
+
id: string;
|
|
13
|
+
type: MessageType;
|
|
14
|
+
timestamp: Date;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Semantic variants for log messages that don't map directly to LogLevel.
|
|
18
|
+
* These affect styling but the underlying LogLevel is used for filtering.
|
|
19
|
+
*/
|
|
20
|
+
type LogMessageVariant = 'success' | 'trace';
|
|
21
|
+
interface LogMessageData extends BaseMessage {
|
|
22
|
+
type: 'log';
|
|
23
|
+
level: LogLevel;
|
|
24
|
+
/** Content is always a string - objects are formatted before storage */
|
|
25
|
+
content: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
trace?: string;
|
|
28
|
+
/** Optional semantic variant for styling (e.g., 'success' shows green even though level is 'log') */
|
|
29
|
+
variant?: LogMessageVariant;
|
|
30
|
+
}
|
|
31
|
+
interface FileMessageData extends BaseMessage {
|
|
32
|
+
type: 'file';
|
|
33
|
+
filePath: string;
|
|
34
|
+
content: string;
|
|
35
|
+
}
|
|
36
|
+
interface DiffMessageData extends BaseMessage {
|
|
37
|
+
type: 'diff';
|
|
38
|
+
filePath: string;
|
|
39
|
+
diff: string;
|
|
40
|
+
view?: 'unified' | 'split';
|
|
41
|
+
}
|
|
42
|
+
interface FileErrorMessageData extends BaseMessage {
|
|
43
|
+
type: 'fileError';
|
|
44
|
+
filePath: string;
|
|
45
|
+
content: string;
|
|
46
|
+
errorLines: number[];
|
|
47
|
+
startLine: number;
|
|
48
|
+
}
|
|
49
|
+
interface LoadingMessageData extends BaseMessage {
|
|
50
|
+
type: 'loading';
|
|
51
|
+
content: string;
|
|
52
|
+
status: 'loading' | 'success' | 'fail';
|
|
53
|
+
resolvedContent?: string;
|
|
54
|
+
}
|
|
55
|
+
interface ProgressMessageData extends BaseMessage {
|
|
56
|
+
type: 'progress';
|
|
57
|
+
label: string;
|
|
58
|
+
current: number;
|
|
59
|
+
total: number;
|
|
60
|
+
status: 'active' | 'complete' | 'failed';
|
|
61
|
+
resolvedContent?: string;
|
|
62
|
+
}
|
|
63
|
+
interface GroupMessageData extends BaseMessage {
|
|
64
|
+
type: 'group';
|
|
65
|
+
label: string;
|
|
66
|
+
collapsed: boolean;
|
|
67
|
+
isEnd: boolean;
|
|
68
|
+
}
|
|
69
|
+
interface TableMessageData extends BaseMessage {
|
|
70
|
+
type: 'table';
|
|
71
|
+
headers: string[];
|
|
72
|
+
rows: string[][];
|
|
73
|
+
title?: string;
|
|
74
|
+
}
|
|
75
|
+
type MessageData = LogMessageData | FileMessageData | DiffMessageData | FileErrorMessageData | LoadingMessageData | ProgressMessageData | GroupMessageData | TableMessageData;
|
|
76
|
+
interface PromiseOptions<T> {
|
|
77
|
+
loading: string;
|
|
78
|
+
success: string | ((data: T) => string);
|
|
79
|
+
error: string | ((error: Error) => string);
|
|
80
|
+
}
|
|
81
|
+
interface LoadingHandle {
|
|
82
|
+
success: (message: string) => void;
|
|
83
|
+
fail: (message: string) => void;
|
|
84
|
+
}
|
|
85
|
+
interface ProgressHandle {
|
|
86
|
+
update: (current: number, label?: string) => void;
|
|
87
|
+
complete: (message?: string) => void;
|
|
88
|
+
fail: (message?: string) => void;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/types/log.types.d.ts
|
|
92
|
+
interface LogLevelColors {
|
|
93
|
+
border: string;
|
|
94
|
+
background: string;
|
|
95
|
+
text?: string;
|
|
96
|
+
}
|
|
97
|
+
type LogLevelColorMap = Record<LogLevel, LogLevelColors>;
|
|
98
|
+
/**
|
|
99
|
+
* Color map for semantic variants (success, trace) that override level colors.
|
|
100
|
+
*/
|
|
101
|
+
type VariantColorMap = Record<LogMessageVariant, LogLevelColors>;
|
|
102
|
+
interface LogMessageProps {
|
|
103
|
+
/** Log level determines the color scheme */
|
|
104
|
+
level: LogLevel;
|
|
105
|
+
/** Optional semantic variant for styling (e.g., 'success' shows green even though level is 'log') */
|
|
106
|
+
variant?: LogMessageVariant;
|
|
107
|
+
/** Message content - can be string or React nodes */
|
|
108
|
+
children: ReactNode;
|
|
109
|
+
/** Optional timestamp to display */
|
|
110
|
+
timestamp?: Date | string;
|
|
111
|
+
/** Optional label/prefix (e.g., "API", "Database") */
|
|
112
|
+
label?: string;
|
|
113
|
+
/** Optional stack trace to display (for trace level) */
|
|
114
|
+
trace?: string;
|
|
115
|
+
/** Optional custom border color (overrides level color) */
|
|
116
|
+
borderColor?: string | RGBA;
|
|
117
|
+
/** Optional custom background color (overrides level color) */
|
|
118
|
+
backgroundColor?: string | RGBA;
|
|
119
|
+
/** Border width style - 'thin' uses left border only, 'thick' uses left+top+bottom */
|
|
120
|
+
borderStyle?: 'thin' | 'thick';
|
|
121
|
+
/** Padding inside the message box */
|
|
122
|
+
padding?: number;
|
|
123
|
+
/** Margin around the message */
|
|
124
|
+
margin?: number;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/types/file.types.d.ts
|
|
128
|
+
type FileLogMode = 'full' | 'diff' | 'partial';
|
|
129
|
+
interface FileLogBaseProps {
|
|
130
|
+
/** File path or name to display in header */
|
|
131
|
+
filePath: string;
|
|
132
|
+
/** Override auto-detected filetype for syntax highlighting */
|
|
133
|
+
filetype?: string;
|
|
134
|
+
/** Show line numbers */
|
|
135
|
+
showLineNumbers?: boolean;
|
|
136
|
+
/** Show header with file path */
|
|
137
|
+
showHeader?: boolean;
|
|
138
|
+
/** Custom header background color */
|
|
139
|
+
headerBackgroundColor?: string | RGBA;
|
|
140
|
+
}
|
|
141
|
+
interface FileLogFullProps extends FileLogBaseProps {
|
|
142
|
+
mode: 'full';
|
|
143
|
+
/** The complete file content */
|
|
144
|
+
content: string;
|
|
145
|
+
}
|
|
146
|
+
interface FileLogDiffProps extends FileLogBaseProps {
|
|
147
|
+
mode: 'diff';
|
|
148
|
+
/** Unified diff string */
|
|
149
|
+
diff: string;
|
|
150
|
+
/** Diff view mode */
|
|
151
|
+
view?: 'unified' | 'split';
|
|
152
|
+
}
|
|
153
|
+
interface FileLogPartialProps extends FileLogBaseProps {
|
|
154
|
+
mode: 'partial';
|
|
155
|
+
/** File content (full or partial) */
|
|
156
|
+
content: string;
|
|
157
|
+
/** Starting line number of the content (1-indexed) */
|
|
158
|
+
startLine: number;
|
|
159
|
+
/** Lines to highlight as errors */
|
|
160
|
+
errorLines?: number[];
|
|
161
|
+
/** Error highlighting colors */
|
|
162
|
+
errorLineBackground?: string | RGBA;
|
|
163
|
+
errorLineBorderColor?: string | RGBA;
|
|
164
|
+
}
|
|
165
|
+
type FileLogProps = FileLogFullProps | FileLogDiffProps | FileLogPartialProps;
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/types/theme.types.d.ts
|
|
168
|
+
/**
|
|
169
|
+
* Color scheme for a single log level.
|
|
170
|
+
*/
|
|
171
|
+
interface LogLevelTheme {
|
|
172
|
+
border: string;
|
|
173
|
+
background: string;
|
|
174
|
+
text?: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Sidebar color scheme.
|
|
178
|
+
*/
|
|
179
|
+
interface SidebarTheme {
|
|
180
|
+
background?: string;
|
|
181
|
+
selectedBackground: string;
|
|
182
|
+
hoverBackground: string;
|
|
183
|
+
text: string;
|
|
184
|
+
textDim: string;
|
|
185
|
+
border: string;
|
|
186
|
+
badge: string;
|
|
187
|
+
focusBorder: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Screen header color scheme.
|
|
191
|
+
*/
|
|
192
|
+
interface HeaderTheme {
|
|
193
|
+
background?: string;
|
|
194
|
+
text: string;
|
|
195
|
+
border: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Status indicator with icon and color.
|
|
199
|
+
*/
|
|
200
|
+
interface StatusIndicator {
|
|
201
|
+
icon: string;
|
|
202
|
+
color: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Status indicators for all screen states.
|
|
206
|
+
*/
|
|
207
|
+
interface StatusIndicatorsTheme {
|
|
208
|
+
waiting: StatusIndicator;
|
|
209
|
+
pending: StatusIndicator;
|
|
210
|
+
success: StatusIndicator;
|
|
211
|
+
fail: StatusIndicator;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Separator colors for sidebar sections.
|
|
215
|
+
*/
|
|
216
|
+
interface SeparatorTheme {
|
|
217
|
+
line: string;
|
|
218
|
+
text: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Progress bar and loading indicator colors.
|
|
222
|
+
*/
|
|
223
|
+
interface ProgressTheme {
|
|
224
|
+
border: string;
|
|
225
|
+
background: string;
|
|
226
|
+
barFilled: string;
|
|
227
|
+
barEmpty: string;
|
|
228
|
+
text: string;
|
|
229
|
+
textDim: string;
|
|
230
|
+
complete: string;
|
|
231
|
+
completeBackground: string;
|
|
232
|
+
failed: string;
|
|
233
|
+
failedBackground: string;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Collapsible group colors.
|
|
237
|
+
*/
|
|
238
|
+
interface GroupTheme {
|
|
239
|
+
border: string;
|
|
240
|
+
background: string;
|
|
241
|
+
headerText: string;
|
|
242
|
+
icon: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Table display colors.
|
|
246
|
+
*/
|
|
247
|
+
interface TableTheme {
|
|
248
|
+
border: string;
|
|
249
|
+
background: string;
|
|
250
|
+
headerText: string;
|
|
251
|
+
cellText: string;
|
|
252
|
+
title: string;
|
|
253
|
+
separator: string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* File display colors.
|
|
257
|
+
*/
|
|
258
|
+
interface FileTheme {
|
|
259
|
+
border: string;
|
|
260
|
+
background: string;
|
|
261
|
+
headerText: string;
|
|
262
|
+
headerBackground: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Interactive prompt colors.
|
|
266
|
+
*/
|
|
267
|
+
interface PromptTheme {
|
|
268
|
+
question: string;
|
|
269
|
+
optionText: string;
|
|
270
|
+
optionTextDim: string;
|
|
271
|
+
optionSelected: string;
|
|
272
|
+
optionSelectedBackground: string;
|
|
273
|
+
confirmButton: string;
|
|
274
|
+
cancelButton: string;
|
|
275
|
+
buttonBackground: string;
|
|
276
|
+
buttonSelectedBackground: string;
|
|
277
|
+
inputBorder: string;
|
|
278
|
+
inputBackground: string;
|
|
279
|
+
inputText: string;
|
|
280
|
+
inputPlaceholder: string;
|
|
281
|
+
inputCursor: string;
|
|
282
|
+
border: string;
|
|
283
|
+
focusBorder: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Error highlighting colors for file displays.
|
|
287
|
+
*/
|
|
288
|
+
interface ErrorHighlightTheme {
|
|
289
|
+
background: string;
|
|
290
|
+
border: string;
|
|
291
|
+
gutterBackground: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Filter bar colors.
|
|
295
|
+
*/
|
|
296
|
+
interface FilterTheme {
|
|
297
|
+
background: string;
|
|
298
|
+
border: string;
|
|
299
|
+
text: string;
|
|
300
|
+
textDim: string;
|
|
301
|
+
inputBackground: string;
|
|
302
|
+
inputText: string;
|
|
303
|
+
inputPlaceholder: string;
|
|
304
|
+
cursor: string;
|
|
305
|
+
activeLevel: string;
|
|
306
|
+
inactiveLevel: string;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Help overlay colors.
|
|
310
|
+
*/
|
|
311
|
+
interface HelpTheme {
|
|
312
|
+
background: string;
|
|
313
|
+
border: string;
|
|
314
|
+
title: string;
|
|
315
|
+
category: string;
|
|
316
|
+
key: string;
|
|
317
|
+
description: string;
|
|
318
|
+
hint: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* General semantic colors.
|
|
322
|
+
*/
|
|
323
|
+
interface SemanticColors {
|
|
324
|
+
primary: string;
|
|
325
|
+
secondary: string;
|
|
326
|
+
success: string;
|
|
327
|
+
warning: string;
|
|
328
|
+
error: string;
|
|
329
|
+
muted: string;
|
|
330
|
+
background?: string;
|
|
331
|
+
foreground: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Complete theme definition.
|
|
335
|
+
*/
|
|
336
|
+
interface Theme {
|
|
337
|
+
/** Theme identifier */
|
|
338
|
+
name: string;
|
|
339
|
+
/** Log level color schemes */
|
|
340
|
+
logLevels: Record<LogLevel, LogLevelTheme>;
|
|
341
|
+
/** Sidebar colors */
|
|
342
|
+
sidebar: SidebarTheme;
|
|
343
|
+
/** Screen header colors */
|
|
344
|
+
header: HeaderTheme;
|
|
345
|
+
/** Status indicator colors and icons */
|
|
346
|
+
statusIndicators: StatusIndicatorsTheme;
|
|
347
|
+
/** Separator colors */
|
|
348
|
+
separator: SeparatorTheme;
|
|
349
|
+
/** Progress bar colors */
|
|
350
|
+
progress: ProgressTheme;
|
|
351
|
+
/** Collapsible group colors */
|
|
352
|
+
group: GroupTheme;
|
|
353
|
+
/** Table display colors */
|
|
354
|
+
table: TableTheme;
|
|
355
|
+
/** File display colors */
|
|
356
|
+
file: FileTheme;
|
|
357
|
+
/** Prompt colors */
|
|
358
|
+
prompt: PromptTheme;
|
|
359
|
+
/** Error highlighting colors */
|
|
360
|
+
errorHighlight: ErrorHighlightTheme;
|
|
361
|
+
/** Filter bar colors */
|
|
362
|
+
filter: FilterTheme;
|
|
363
|
+
/** Help overlay colors */
|
|
364
|
+
help: HelpTheme;
|
|
365
|
+
/** General semantic colors */
|
|
366
|
+
colors: SemanticColors;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Theme preset names.
|
|
370
|
+
*/
|
|
371
|
+
type ThemePreset = 'dark' | 'light' | 'high-contrast';
|
|
372
|
+
/**
|
|
373
|
+
* Deep partial type for theme overrides.
|
|
374
|
+
*/
|
|
375
|
+
type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] };
|
|
376
|
+
/**
|
|
377
|
+
* Partial theme for creating custom themes.
|
|
378
|
+
*/
|
|
379
|
+
type PartialTheme = DeepPartial<Theme>;
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/types/screen.types.d.ts
|
|
382
|
+
interface ScreenProps {
|
|
383
|
+
/** Screen title/name displayed in header */
|
|
384
|
+
name: string;
|
|
385
|
+
/** Child log messages/file logs */
|
|
386
|
+
children: ReactNode;
|
|
387
|
+
/** Enable auto-scroll to bottom on new content */
|
|
388
|
+
stickyScroll?: boolean;
|
|
389
|
+
/** Show scroll position indicator */
|
|
390
|
+
showScrollIndicator?: boolean;
|
|
391
|
+
/** Screen header background color */
|
|
392
|
+
headerBackgroundColor?: string | RGBA;
|
|
393
|
+
/** Screen header text color */
|
|
394
|
+
headerTextColor?: string | RGBA;
|
|
395
|
+
/** Whether this screen is currently focused */
|
|
396
|
+
focused?: boolean;
|
|
397
|
+
/** Callback when screen is scrolled */
|
|
398
|
+
onScroll?: (scrollTop: number, scrollHeight: number) => void;
|
|
399
|
+
}
|
|
400
|
+
interface ScreenDefinition {
|
|
401
|
+
/** Unique screen identifier */
|
|
402
|
+
id: string;
|
|
403
|
+
/** Display name for sidebar */
|
|
404
|
+
name: string;
|
|
405
|
+
/** Optional icon/badge character */
|
|
406
|
+
icon?: string;
|
|
407
|
+
/** Unread/notification count */
|
|
408
|
+
badgeCount?: number;
|
|
409
|
+
}
|
|
410
|
+
interface ScreenManagerProps {
|
|
411
|
+
/** Screen definitions for the sidebar */
|
|
412
|
+
screens: ScreenDefinition[];
|
|
413
|
+
/** Currently active screen ID */
|
|
414
|
+
activeScreenId: string;
|
|
415
|
+
/** Callback when screen selection changes */
|
|
416
|
+
onScreenChange?: (screenId: string) => void;
|
|
417
|
+
/** Screen content - should be conditionally rendered based on activeScreenId */
|
|
418
|
+
children: ReactNode;
|
|
419
|
+
/** Force show/hide sidebar (overrides auto behavior) */
|
|
420
|
+
sidebarVisible?: boolean;
|
|
421
|
+
/** Callback when sidebar visibility changes */
|
|
422
|
+
onSidebarVisibilityChange?: (visible: boolean) => void;
|
|
423
|
+
/** Sidebar width (columns) */
|
|
424
|
+
sidebarWidth?: number;
|
|
425
|
+
/** Sidebar position */
|
|
426
|
+
sidebarPosition?: 'left' | 'right';
|
|
427
|
+
/** Key to toggle sidebar visibility */
|
|
428
|
+
toggleSidebarKey?: string;
|
|
429
|
+
/** Sidebar header title */
|
|
430
|
+
sidebarTitle?: string;
|
|
431
|
+
}
|
|
432
|
+
type FocusArea = 'sidebar' | 'content';
|
|
433
|
+
interface LoggerContextValue {
|
|
434
|
+
/** Shared SyntaxStyle instance for code highlighting */
|
|
435
|
+
syntaxStyle?: SyntaxStyle;
|
|
436
|
+
/** Shared TreeSitterClient for parsing */
|
|
437
|
+
treeSitterClient?: TreeSitterClient;
|
|
438
|
+
/** Default colors for log levels (derived from theme for backwards compatibility) */
|
|
439
|
+
levelColors: LogLevelColorMap;
|
|
440
|
+
/** Current theme */
|
|
441
|
+
theme: Theme;
|
|
442
|
+
}
|
|
443
|
+
type ScreenStatus = 'waiting' | 'pending' | 'success' | 'fail';
|
|
444
|
+
interface BindOptions {
|
|
445
|
+
exitOnCtrlC?: boolean;
|
|
446
|
+
sidebarWidth?: number;
|
|
447
|
+
sidebarPosition?: 'left' | 'right';
|
|
448
|
+
sidebarTitle?: string;
|
|
449
|
+
/** Auto close after all screens complete successfully (delay in ms, default 5000) */
|
|
450
|
+
autoClose?: boolean | number;
|
|
451
|
+
/** Theme to use for the TUI (theme object or preset name) */
|
|
452
|
+
theme?: Theme | ThemePreset;
|
|
453
|
+
/** Enable mouse support (default: false) */
|
|
454
|
+
useMouse?: boolean;
|
|
455
|
+
}
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/types/prompt.types.d.ts
|
|
458
|
+
interface ChoiceOption {
|
|
459
|
+
label: string;
|
|
460
|
+
value: string;
|
|
461
|
+
/** If true, this option allows text input */
|
|
462
|
+
input?: boolean;
|
|
463
|
+
}
|
|
464
|
+
interface BasePromptData {
|
|
465
|
+
id: string;
|
|
466
|
+
timestamp: Date;
|
|
467
|
+
resolved: boolean;
|
|
468
|
+
/** Auto-resolve timeout in ms */
|
|
469
|
+
timeout?: number;
|
|
470
|
+
/** Timestamp when timeout started */
|
|
471
|
+
timeoutStarted?: number;
|
|
472
|
+
}
|
|
473
|
+
interface ChoicePromptData extends BasePromptData {
|
|
474
|
+
type: 'choice';
|
|
475
|
+
question: string;
|
|
476
|
+
choices: ChoiceOption[];
|
|
477
|
+
defaultChoice: string;
|
|
478
|
+
selectedIndex: number;
|
|
479
|
+
inputMode: boolean;
|
|
480
|
+
inputValue: string;
|
|
481
|
+
resolvedValue?: string;
|
|
482
|
+
}
|
|
483
|
+
interface ConfirmPromptData extends BasePromptData {
|
|
484
|
+
type: 'confirm';
|
|
485
|
+
question: string;
|
|
486
|
+
confirmText: string;
|
|
487
|
+
cancelText: string;
|
|
488
|
+
defaultValue: boolean;
|
|
489
|
+
selectedValue: boolean;
|
|
490
|
+
resolvedValue?: boolean;
|
|
491
|
+
}
|
|
492
|
+
interface InputPromptData extends BasePromptData {
|
|
493
|
+
type: 'input';
|
|
494
|
+
question: string;
|
|
495
|
+
placeholder: string;
|
|
496
|
+
defaultValue: string;
|
|
497
|
+
value: string;
|
|
498
|
+
resolvedValue?: string;
|
|
499
|
+
}
|
|
500
|
+
interface MultiChoicePromptData extends BasePromptData {
|
|
501
|
+
type: 'multiChoice';
|
|
502
|
+
question: string;
|
|
503
|
+
choices: ChoiceOption[];
|
|
504
|
+
selectedIndices: Set<number>;
|
|
505
|
+
focusedIndex: number;
|
|
506
|
+
minSelect: number;
|
|
507
|
+
maxSelect: number;
|
|
508
|
+
resolvedValues?: string[];
|
|
509
|
+
}
|
|
510
|
+
type PromptData = ChoicePromptData | ConfirmPromptData | InputPromptData | MultiChoicePromptData;
|
|
511
|
+
interface ChoiceOptions {
|
|
512
|
+
question: string;
|
|
513
|
+
choices: ChoiceOption[];
|
|
514
|
+
defaultChoice?: string;
|
|
515
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
516
|
+
timeout?: number;
|
|
517
|
+
}
|
|
518
|
+
interface ConfirmOptions {
|
|
519
|
+
question: string;
|
|
520
|
+
confirmText?: string;
|
|
521
|
+
cancelText?: string;
|
|
522
|
+
defaultValue?: boolean;
|
|
523
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
524
|
+
timeout?: number;
|
|
525
|
+
}
|
|
526
|
+
interface InputOptions {
|
|
527
|
+
question: string;
|
|
528
|
+
placeholder?: string;
|
|
529
|
+
defaultValue?: string;
|
|
530
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
531
|
+
timeout?: number;
|
|
532
|
+
}
|
|
533
|
+
interface MultiChoiceOptions {
|
|
534
|
+
question: string;
|
|
535
|
+
choices: ChoiceOption[];
|
|
536
|
+
defaultChoices?: string[];
|
|
537
|
+
minSelect?: number;
|
|
538
|
+
maxSelect?: number;
|
|
539
|
+
/** Auto-resolve with default after timeout (ms) */
|
|
540
|
+
timeout?: number;
|
|
541
|
+
}
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/types/keyboard.types.d.ts
|
|
544
|
+
/**
|
|
545
|
+
* Key event from the terminal.
|
|
546
|
+
*/
|
|
547
|
+
interface KeyEvent {
|
|
548
|
+
name: string;
|
|
549
|
+
sequence?: string;
|
|
550
|
+
ctrl?: boolean;
|
|
551
|
+
meta?: boolean;
|
|
552
|
+
shift?: boolean;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Context available to keyboard handlers.
|
|
556
|
+
*/
|
|
557
|
+
interface KeyboardContext {
|
|
558
|
+
/** Has multiple screens (sidebar visible) */
|
|
559
|
+
hasSidebar: boolean;
|
|
560
|
+
/** Currently focused area */
|
|
561
|
+
focusArea: FocusArea;
|
|
562
|
+
/** Whether a prompt is active */
|
|
563
|
+
hasPrompt: boolean;
|
|
564
|
+
/** Whether prompt is in text input mode */
|
|
565
|
+
inInputMode: boolean;
|
|
566
|
+
/** Whether filter bar is visible */
|
|
567
|
+
isFilterActive: boolean;
|
|
568
|
+
/** Whether help overlay is visible */
|
|
569
|
+
isHelpVisible: boolean;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Handler function for a key binding.
|
|
573
|
+
* Return true to prevent further processing, false/void to continue.
|
|
574
|
+
*/
|
|
575
|
+
type KeyHandler = (key: KeyEvent, context: KeyboardContext) => boolean | void;
|
|
576
|
+
/**
|
|
577
|
+
* Category for organizing bindings in help overlay.
|
|
578
|
+
*/
|
|
579
|
+
type KeyBindingCategory = 'general' | 'navigation' | 'screen' | 'prompt' | 'filter';
|
|
580
|
+
/**
|
|
581
|
+
* Condition for when a binding is active.
|
|
582
|
+
*/
|
|
583
|
+
interface KeyBindingCondition {
|
|
584
|
+
hasPrompt?: boolean;
|
|
585
|
+
inInputMode?: boolean;
|
|
586
|
+
focusArea?: FocusArea;
|
|
587
|
+
isFilterActive?: boolean;
|
|
588
|
+
isHelpVisible?: boolean;
|
|
589
|
+
hasSidebar?: boolean;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* A single key binding definition.
|
|
593
|
+
*/
|
|
594
|
+
interface KeyBinding {
|
|
595
|
+
/** Key name(s) that trigger this binding */
|
|
596
|
+
key: string | string[];
|
|
597
|
+
/** Require Ctrl modifier */
|
|
598
|
+
ctrl?: boolean;
|
|
599
|
+
/** Require Meta/Cmd modifier */
|
|
600
|
+
meta?: boolean;
|
|
601
|
+
/** Require Shift modifier (for capital letters) */
|
|
602
|
+
shift?: boolean;
|
|
603
|
+
/** Handler function */
|
|
604
|
+
handler: KeyHandler;
|
|
605
|
+
/** Description for help overlay */
|
|
606
|
+
description: string;
|
|
607
|
+
/** Category for grouping in help */
|
|
608
|
+
category: KeyBindingCategory;
|
|
609
|
+
/** Condition when this binding is active */
|
|
610
|
+
when?: KeyBindingCondition;
|
|
611
|
+
/** Priority (higher = checked first, default 0) */
|
|
612
|
+
priority?: number;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Configuration for the keyboard manager.
|
|
616
|
+
*/
|
|
617
|
+
interface KeyBindingsConfig {
|
|
618
|
+
/** Custom bindings (added to defaults) */
|
|
619
|
+
bindings?: KeyBinding[];
|
|
620
|
+
/** Override specific default bindings by key */
|
|
621
|
+
overrides?: Record<string, Partial<KeyBinding>>;
|
|
622
|
+
/** Disable specific keys */
|
|
623
|
+
disabled?: string[];
|
|
624
|
+
}
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region src/types/filter.types.d.ts
|
|
627
|
+
/**
|
|
628
|
+
* Filter state for log filtering.
|
|
629
|
+
*/
|
|
630
|
+
interface FilterState {
|
|
631
|
+
/** Which log levels are enabled (shown) */
|
|
632
|
+
enabledLevels: Set<LogLevel>;
|
|
633
|
+
/** Text search query */
|
|
634
|
+
searchQuery: string;
|
|
635
|
+
/** Whether the filter bar is visible */
|
|
636
|
+
isVisible: boolean;
|
|
637
|
+
/** Which filter field is focused */
|
|
638
|
+
focusedField: 'search' | 'levels';
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* All log levels in order.
|
|
642
|
+
*/
|
|
643
|
+
declare const ALL_LOG_LEVELS: LogLevel[];
|
|
644
|
+
/**
|
|
645
|
+
* Create a default filter state.
|
|
646
|
+
*/
|
|
647
|
+
declare function createDefaultFilterState(): FilterState;
|
|
648
|
+
/**
|
|
649
|
+
* Check if any filtering is active.
|
|
650
|
+
*/
|
|
651
|
+
declare function hasActiveFilter(filter: FilterState): boolean;
|
|
652
|
+
/**
|
|
653
|
+
* Level counts for display.
|
|
654
|
+
*/
|
|
655
|
+
type LevelCounts = Record<LogLevel, number>;
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region src/components/log/log_message.d.ts
|
|
658
|
+
/**
|
|
659
|
+
* LogMessage - A chat-like styled log message with level-based coloring.
|
|
660
|
+
*
|
|
661
|
+
* Features:
|
|
662
|
+
* - Left border with prominent color based on log level
|
|
663
|
+
* - Subtle tinted background matching the log level
|
|
664
|
+
* - Optional timestamp and label display
|
|
665
|
+
* - Supports both simple text and complex React children
|
|
666
|
+
* - Optional variant for semantic styling (e.g., 'success', 'trace')
|
|
667
|
+
*
|
|
668
|
+
* @example
|
|
669
|
+
* <LogMessage level="error">
|
|
670
|
+
* Connection failed: timeout after 30s
|
|
671
|
+
* </LogMessage>
|
|
672
|
+
*
|
|
673
|
+
* @example
|
|
674
|
+
* <LogMessage level="log" timestamp={new Date()} label="API">
|
|
675
|
+
* Request completed successfully
|
|
676
|
+
* </LogMessage>
|
|
677
|
+
*
|
|
678
|
+
* @example
|
|
679
|
+
* <LogMessage level="log" variant="success">
|
|
680
|
+
* Operation completed successfully
|
|
681
|
+
* </LogMessage>
|
|
682
|
+
*/
|
|
683
|
+
declare function LogMessage({
|
|
684
|
+
level,
|
|
685
|
+
variant,
|
|
686
|
+
children,
|
|
687
|
+
timestamp,
|
|
688
|
+
label,
|
|
689
|
+
trace,
|
|
690
|
+
borderColor: customBorderColor,
|
|
691
|
+
backgroundColor: customBackgroundColor,
|
|
692
|
+
borderStyle,
|
|
693
|
+
padding,
|
|
694
|
+
margin
|
|
695
|
+
}: LogMessageProps): react0.ReactNode;
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region src/components/file/file_log.d.ts
|
|
698
|
+
/**
|
|
699
|
+
* FileLog - Displays file content, diffs, or partial files with error highlighting.
|
|
700
|
+
*
|
|
701
|
+
* Three modes:
|
|
702
|
+
* 1. "full" - Display complete file with syntax highlighting
|
|
703
|
+
* 2. "diff" - Display unified diff using <diff> component
|
|
704
|
+
* 3. "partial" - Display file excerpt with optional error line highlighting
|
|
705
|
+
*
|
|
706
|
+
* @example Full file
|
|
707
|
+
* <FileLog
|
|
708
|
+
* mode="full"
|
|
709
|
+
* filePath="src/index.ts"
|
|
710
|
+
* content={fileContent}
|
|
711
|
+
* />
|
|
712
|
+
*
|
|
713
|
+
* @example Diff
|
|
714
|
+
* <FileLog
|
|
715
|
+
* mode="diff"
|
|
716
|
+
* filePath="src/api.ts"
|
|
717
|
+
* diff={unifiedDiff}
|
|
718
|
+
* view="unified"
|
|
719
|
+
* />
|
|
720
|
+
*
|
|
721
|
+
* @example Partial with error
|
|
722
|
+
* <FileLog
|
|
723
|
+
* mode="partial"
|
|
724
|
+
* filePath="src/utils.ts"
|
|
725
|
+
* content={excerpt}
|
|
726
|
+
* startLine={42}
|
|
727
|
+
* errorLines={[45, 46]}
|
|
728
|
+
* />
|
|
729
|
+
*/
|
|
730
|
+
declare function FileLog(props: FileLogProps): react0.ReactNode;
|
|
731
|
+
//#endregion
|
|
732
|
+
//#region src/components/prompt/prompt_renderer.d.ts
|
|
733
|
+
interface PromptRendererProps {
|
|
734
|
+
prompt: PromptData;
|
|
735
|
+
}
|
|
736
|
+
declare function PromptRenderer({
|
|
737
|
+
prompt
|
|
738
|
+
}: PromptRendererProps): react0.ReactNode;
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/schemas/screen-options.d.ts
|
|
741
|
+
declare const ScreenOptionsSchema: z.ZodObject<{
|
|
742
|
+
name: z.ZodString;
|
|
743
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
744
|
+
badgeCount: z.ZodOptional<z.ZodNumber>;
|
|
745
|
+
hidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
746
|
+
}, z.core.$strip>;
|
|
747
|
+
type ScreenOptions = z.infer<typeof ScreenOptionsSchema>;
|
|
748
|
+
//#endregion
|
|
749
|
+
//#region src/schemas/logger-options.d.ts
|
|
750
|
+
declare const LoggerOptionsSchema: z.ZodObject<{
|
|
751
|
+
screen: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
752
|
+
name: z.ZodString;
|
|
753
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
754
|
+
badgeCount: z.ZodOptional<z.ZodNumber>;
|
|
755
|
+
hidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
756
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
757
|
+
context: z.ZodOptional<z.ZodString>;
|
|
758
|
+
enabledLevels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
759
|
+
verbose: "verbose";
|
|
760
|
+
debug: "debug";
|
|
761
|
+
log: "log";
|
|
762
|
+
warn: "warn";
|
|
763
|
+
error: "error";
|
|
764
|
+
fatal: "fatal";
|
|
765
|
+
}>>>;
|
|
766
|
+
}, z.core.$strip>;
|
|
767
|
+
type LoggerOptions = z.infer<typeof LoggerOptionsSchema>;
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/schemas/prompt-options.d.ts
|
|
770
|
+
declare const PromptOptionsSchema: z.ZodObject<{
|
|
771
|
+
screen: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
772
|
+
name: z.ZodString;
|
|
773
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
774
|
+
badgeCount: z.ZodOptional<z.ZodNumber>;
|
|
775
|
+
hidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
776
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
777
|
+
}, z.core.$strip>;
|
|
778
|
+
type PromptOptions = z.infer<typeof PromptOptionsSchema>;
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/services/screen.d.ts
|
|
781
|
+
declare class ScreenInstance {
|
|
782
|
+
private id;
|
|
783
|
+
private name;
|
|
784
|
+
private icon?;
|
|
785
|
+
private badgeCount;
|
|
786
|
+
private status;
|
|
787
|
+
private hidden;
|
|
788
|
+
private messages;
|
|
789
|
+
private manager;
|
|
790
|
+
private changeListeners;
|
|
791
|
+
private printFn;
|
|
792
|
+
private hasPrinted;
|
|
793
|
+
private version;
|
|
794
|
+
private promptQueue;
|
|
795
|
+
private activePrompt;
|
|
796
|
+
constructor(id: string, options: ScreenOptions);
|
|
797
|
+
incrementVersion(): void;
|
|
798
|
+
getVersion(): number;
|
|
799
|
+
/**
|
|
800
|
+
* Internal: Set the manager reference
|
|
801
|
+
*/
|
|
802
|
+
_setManager(manager: ScreenManager): void;
|
|
803
|
+
/**
|
|
804
|
+
* Internal: Set the print function for stdout output
|
|
805
|
+
*/
|
|
806
|
+
_setPrintFn(fn: (messages: MessageData[], name: string, isError: boolean) => void): void;
|
|
807
|
+
getId(): string;
|
|
808
|
+
getName(): string;
|
|
809
|
+
getIcon(): string | undefined;
|
|
810
|
+
getBadgeCount(): number;
|
|
811
|
+
setBadgeCount(count: number): this;
|
|
812
|
+
isHidden(): boolean;
|
|
813
|
+
setHidden(hidden: boolean): this;
|
|
814
|
+
show(): this;
|
|
815
|
+
hide(): this;
|
|
816
|
+
getStatus(): ScreenStatus;
|
|
817
|
+
/**
|
|
818
|
+
* Set screen status. When success/fail and TUI is not bound, prints to stdout/stderr
|
|
819
|
+
*/
|
|
820
|
+
setStatus(status: ScreenStatus): this;
|
|
821
|
+
/**
|
|
822
|
+
* Check if this screen is complete (success or fail)
|
|
823
|
+
*/
|
|
824
|
+
isComplete(): boolean;
|
|
825
|
+
/**
|
|
826
|
+
* Check if this screen has been printed to console
|
|
827
|
+
*/
|
|
828
|
+
hasPrintedToConsole(): boolean;
|
|
829
|
+
/**
|
|
830
|
+
* Force print to console (called when TUI unbinds)
|
|
831
|
+
*/
|
|
832
|
+
_flushToConsole(force?: boolean): void;
|
|
833
|
+
/**
|
|
834
|
+
* Get all messages for rendering
|
|
835
|
+
*/
|
|
836
|
+
getMessages(): MessageData[];
|
|
837
|
+
/**
|
|
838
|
+
* Add a message to the screen (internal use by Logger)
|
|
839
|
+
*/
|
|
840
|
+
addMessage(message: MessageData): void;
|
|
841
|
+
/**
|
|
842
|
+
* Update a loading message (internal use by Logger)
|
|
843
|
+
*/
|
|
844
|
+
updateMessage(id: string, updates: Partial<LoadingMessageData>): void;
|
|
845
|
+
/**
|
|
846
|
+
* Update a progress message (internal use by Logger)
|
|
847
|
+
*/
|
|
848
|
+
updateProgressMessage(id: string, updates: Partial<ProgressMessageData>): void;
|
|
849
|
+
/**
|
|
850
|
+
* Clear all messages
|
|
851
|
+
*/
|
|
852
|
+
clear(): this;
|
|
853
|
+
/**
|
|
854
|
+
* Add a prompt to the queue (internal use by Prompt class)
|
|
855
|
+
* Returns a promise that resolves when the user responds
|
|
856
|
+
*/
|
|
857
|
+
_addPrompt(prompt: PromptData): Promise<string | boolean | string[]>;
|
|
858
|
+
/**
|
|
859
|
+
* Resolve a prompt with its default value
|
|
860
|
+
*/
|
|
861
|
+
private resolvePromptWithDefault;
|
|
862
|
+
/**
|
|
863
|
+
* Get the currently active prompt (for rendering)
|
|
864
|
+
*/
|
|
865
|
+
getActivePrompt(): PromptData | null;
|
|
866
|
+
/**
|
|
867
|
+
* Check if this screen has an active prompt
|
|
868
|
+
*/
|
|
869
|
+
hasActivePrompt(): boolean;
|
|
870
|
+
/**
|
|
871
|
+
* Update prompt selection (for keyboard navigation)
|
|
872
|
+
*/
|
|
873
|
+
updatePromptSelection(index: number): void;
|
|
874
|
+
/**
|
|
875
|
+
* Navigate prompt selection up
|
|
876
|
+
*/
|
|
877
|
+
promptNavigateUp(): void;
|
|
878
|
+
/**
|
|
879
|
+
* Navigate prompt selection down
|
|
880
|
+
*/
|
|
881
|
+
promptNavigateDown(): void;
|
|
882
|
+
/**
|
|
883
|
+
* Toggle left/right for confirm prompts
|
|
884
|
+
*/
|
|
885
|
+
promptNavigateLeft(): void;
|
|
886
|
+
promptNavigateRight(): void;
|
|
887
|
+
/**
|
|
888
|
+
* Toggle selection for multiChoice prompts
|
|
889
|
+
*/
|
|
890
|
+
promptToggleSelection(): void;
|
|
891
|
+
/**
|
|
892
|
+
* Enter input mode for choice prompts (if current selection allows input)
|
|
893
|
+
* or for input prompts (always)
|
|
894
|
+
*/
|
|
895
|
+
promptEnterInputMode(): boolean;
|
|
896
|
+
/**
|
|
897
|
+
* Exit input mode for choice prompts
|
|
898
|
+
*/
|
|
899
|
+
promptExitInputMode(): void;
|
|
900
|
+
/**
|
|
901
|
+
* Check if prompt is in input mode
|
|
902
|
+
*/
|
|
903
|
+
isPromptInInputMode(): boolean;
|
|
904
|
+
/**
|
|
905
|
+
* Update input value for choice prompts
|
|
906
|
+
*/
|
|
907
|
+
promptUpdateInput(value: string): void;
|
|
908
|
+
/**
|
|
909
|
+
* Append character to input
|
|
910
|
+
*/
|
|
911
|
+
promptAppendInput(char: string): void;
|
|
912
|
+
/**
|
|
913
|
+
* Delete last character from input
|
|
914
|
+
*/
|
|
915
|
+
promptDeleteLastChar(): void;
|
|
916
|
+
/**
|
|
917
|
+
* Check if multiChoice prompt can be submitted (meets minSelect requirement)
|
|
918
|
+
*/
|
|
919
|
+
canSubmitPrompt(): boolean;
|
|
920
|
+
/**
|
|
921
|
+
* Submit the current prompt selection
|
|
922
|
+
*/
|
|
923
|
+
promptSubmit(): void;
|
|
924
|
+
/**
|
|
925
|
+
* Activate the next prompt in the queue
|
|
926
|
+
*/
|
|
927
|
+
private activateNextPrompt;
|
|
928
|
+
/**
|
|
929
|
+
* Register a change listener for re-renders
|
|
930
|
+
*/
|
|
931
|
+
onChange(listener: () => void): () => void;
|
|
932
|
+
private notifyChange;
|
|
933
|
+
/**
|
|
934
|
+
* Print all messages to stdout/stderr with ANSI colors
|
|
935
|
+
*/
|
|
936
|
+
private printToConsole;
|
|
937
|
+
}
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region src/services/screen_manager.d.ts
|
|
940
|
+
declare class ScreenManager {
|
|
941
|
+
private screens;
|
|
942
|
+
private screenOrder;
|
|
943
|
+
private activeScreenId;
|
|
944
|
+
private renderer;
|
|
945
|
+
private root;
|
|
946
|
+
private isBound;
|
|
947
|
+
private changeListeners;
|
|
948
|
+
private bindOptions;
|
|
949
|
+
private autoCloseTimer;
|
|
950
|
+
private theme;
|
|
951
|
+
focusArea: FocusArea;
|
|
952
|
+
selectedIndex: number;
|
|
953
|
+
/**
|
|
954
|
+
* Create a new screen and return it
|
|
955
|
+
*/
|
|
956
|
+
createScreen(options: ScreenOptions): ScreenInstance;
|
|
957
|
+
getScreenByName(name: string): ScreenInstance | undefined;
|
|
958
|
+
/**
|
|
959
|
+
* Remove a screen dynamically
|
|
960
|
+
*/
|
|
961
|
+
removeScreen(screen: ScreenInstance): void;
|
|
962
|
+
/**
|
|
963
|
+
* Non-blocking bind - starts TUI rendering in background
|
|
964
|
+
*/
|
|
965
|
+
bind(options?: BindOptions): Promise<void>;
|
|
966
|
+
/**
|
|
967
|
+
* Get the configured theme
|
|
968
|
+
*/
|
|
969
|
+
getTheme(): Theme | undefined;
|
|
970
|
+
/**
|
|
971
|
+
* Stop TUI rendering and cleanup
|
|
972
|
+
* Flushes all completed screens to stdout/stderr
|
|
973
|
+
*/
|
|
974
|
+
unbind(): void;
|
|
975
|
+
/**
|
|
976
|
+
* Print all completed screens that haven't been printed yet
|
|
977
|
+
*/
|
|
978
|
+
private flushCompletedScreens;
|
|
979
|
+
/**
|
|
980
|
+
* Check if TUI is currently bound
|
|
981
|
+
*/
|
|
982
|
+
isTuiBound(): boolean;
|
|
983
|
+
/**
|
|
984
|
+
* Called by Screen when a prompt becomes active
|
|
985
|
+
* Focuses the screen and switches to content area
|
|
986
|
+
*/
|
|
987
|
+
onScreenPromptActivated(screen: ScreenInstance): void;
|
|
988
|
+
/**
|
|
989
|
+
* Check if any screen has an active prompt
|
|
990
|
+
*/
|
|
991
|
+
hasActivePrompt(): boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Get the screen with an active prompt (if any)
|
|
994
|
+
*/
|
|
995
|
+
getScreenWithActivePrompt(): ScreenInstance | null;
|
|
996
|
+
/**
|
|
997
|
+
* Called by Screen when visibility changes
|
|
998
|
+
* Handles switching active screen if needed
|
|
999
|
+
*/
|
|
1000
|
+
onScreenVisibilityChanged(screen: ScreenInstance): void;
|
|
1001
|
+
/**
|
|
1002
|
+
* Called by Screen when status becomes success/fail
|
|
1003
|
+
* Moves completed screens to end of sidebar list
|
|
1004
|
+
*/
|
|
1005
|
+
onScreenCompleted(screen: ScreenInstance): void;
|
|
1006
|
+
/**
|
|
1007
|
+
* Check if all screens are successful and start auto-close timer if enabled
|
|
1008
|
+
*/
|
|
1009
|
+
private checkAutoClose;
|
|
1010
|
+
/**
|
|
1011
|
+
* Get visible screens in display order (excludes hidden screens)
|
|
1012
|
+
*/
|
|
1013
|
+
getScreens(): ScreenInstance[];
|
|
1014
|
+
/**
|
|
1015
|
+
* Get all screens in display order (includes hidden screens)
|
|
1016
|
+
*/
|
|
1017
|
+
getAllScreens(): ScreenInstance[];
|
|
1018
|
+
/**
|
|
1019
|
+
* Get the active screen
|
|
1020
|
+
*/
|
|
1021
|
+
getActiveScreen(): ScreenInstance | null;
|
|
1022
|
+
/**
|
|
1023
|
+
* Set the active screen
|
|
1024
|
+
*/
|
|
1025
|
+
setActiveScreen(screen: ScreenInstance): void;
|
|
1026
|
+
/**
|
|
1027
|
+
* Get bind options
|
|
1028
|
+
*/
|
|
1029
|
+
getBindOptions(): BindOptions;
|
|
1030
|
+
/**
|
|
1031
|
+
* Set focus area (sidebar or content)
|
|
1032
|
+
*/
|
|
1033
|
+
setFocusArea(area: FocusArea): void;
|
|
1034
|
+
/**
|
|
1035
|
+
* Set selected index in sidebar
|
|
1036
|
+
*/
|
|
1037
|
+
setSelectedIndex(index: number): void;
|
|
1038
|
+
/**
|
|
1039
|
+
* Navigate sidebar up
|
|
1040
|
+
*/
|
|
1041
|
+
navigateUp(): void;
|
|
1042
|
+
/**
|
|
1043
|
+
* Navigate sidebar down
|
|
1044
|
+
*/
|
|
1045
|
+
navigateDown(): void;
|
|
1046
|
+
/**
|
|
1047
|
+
* Select the currently highlighted screen
|
|
1048
|
+
*/
|
|
1049
|
+
selectCurrent(): void;
|
|
1050
|
+
/**
|
|
1051
|
+
* Toggle focus between sidebar and content
|
|
1052
|
+
*/
|
|
1053
|
+
toggleFocus(): void;
|
|
1054
|
+
/**
|
|
1055
|
+
* Register a change listener for re-renders
|
|
1056
|
+
*/
|
|
1057
|
+
onChange(listener: () => void): () => void;
|
|
1058
|
+
private notifyChange;
|
|
1059
|
+
private render;
|
|
1060
|
+
}
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/services/logger.d.ts
|
|
1063
|
+
declare class ScreenLoggerInstance implements LoggerService {
|
|
1064
|
+
private screen;
|
|
1065
|
+
private context?;
|
|
1066
|
+
private enabledLevels;
|
|
1067
|
+
constructor(options: LoggerOptions);
|
|
1068
|
+
private isLevelEnabled;
|
|
1069
|
+
verbose(msg: string | object, label?: string): this;
|
|
1070
|
+
setLogLevels(levels: LogLevel[]): this;
|
|
1071
|
+
trace(msg: string | object, label?: string): this;
|
|
1072
|
+
debug(msg: string | object, label?: string): this;
|
|
1073
|
+
log(msg: string | object, label?: string): this;
|
|
1074
|
+
success(msg: string | object, label?: string): this;
|
|
1075
|
+
warn(msg: string | object, label?: string): this;
|
|
1076
|
+
error(msg: string | object, label?: string): this;
|
|
1077
|
+
fatal(msg: string | object, label?: string): this;
|
|
1078
|
+
private write;
|
|
1079
|
+
file(path: string, content: string): this;
|
|
1080
|
+
diff(path: string, diffContent: string, view?: 'unified' | 'split'): this;
|
|
1081
|
+
fileError(path: string, content: string, errorLines: number[], startLine?: number): this;
|
|
1082
|
+
/**
|
|
1083
|
+
* Sonner-like promise handling
|
|
1084
|
+
*/
|
|
1085
|
+
promise<T>(promise: Promise<T>, options: PromiseOptions<T>): Promise<T>;
|
|
1086
|
+
/**
|
|
1087
|
+
* Create a loading message with manual resolution
|
|
1088
|
+
*/
|
|
1089
|
+
loading(message: string): LoadingHandle;
|
|
1090
|
+
/**
|
|
1091
|
+
* Create a progress bar with manual updates
|
|
1092
|
+
*/
|
|
1093
|
+
progress(label: string, options: {
|
|
1094
|
+
total: number;
|
|
1095
|
+
}): ProgressHandle;
|
|
1096
|
+
/**
|
|
1097
|
+
* Start a collapsible log group
|
|
1098
|
+
*/
|
|
1099
|
+
group(label: string): this;
|
|
1100
|
+
/**
|
|
1101
|
+
* End the current log group
|
|
1102
|
+
*/
|
|
1103
|
+
groupEnd(): this;
|
|
1104
|
+
/**
|
|
1105
|
+
* Display tabular data
|
|
1106
|
+
*/
|
|
1107
|
+
table(data: Record<string, unknown>[], options?: {
|
|
1108
|
+
title?: string;
|
|
1109
|
+
}): this;
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region src/services/prompt.d.ts
|
|
1113
|
+
/**
|
|
1114
|
+
* Prompt class for interactive user input.
|
|
1115
|
+
* Similar to Logger, but for prompts that require user interaction.
|
|
1116
|
+
*/
|
|
1117
|
+
declare class PromptInstance {
|
|
1118
|
+
private screen;
|
|
1119
|
+
constructor(options: PromptOptions);
|
|
1120
|
+
/**
|
|
1121
|
+
* Display a choice prompt and wait for user selection.
|
|
1122
|
+
* Returns the selected value (or input text if an input option was selected).
|
|
1123
|
+
*/
|
|
1124
|
+
choice(options: ChoiceOptions): Promise<string>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Display a confirmation prompt and wait for user response.
|
|
1127
|
+
* Returns true for confirm, false for cancel.
|
|
1128
|
+
*/
|
|
1129
|
+
confirm(options: ConfirmOptions): Promise<boolean>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Display a text input prompt and wait for user input.
|
|
1132
|
+
* Returns the entered text.
|
|
1133
|
+
*/
|
|
1134
|
+
input(options: InputOptions): Promise<string>;
|
|
1135
|
+
/**
|
|
1136
|
+
* Display a multi-select choice prompt.
|
|
1137
|
+
* Returns an array of selected values.
|
|
1138
|
+
*/
|
|
1139
|
+
multiChoice(options: MultiChoiceOptions): Promise<string[]>;
|
|
1140
|
+
}
|
|
1141
|
+
//#endregion
|
|
1142
|
+
//#region src/components/screen/screen_bridge.d.ts
|
|
1143
|
+
interface ScreenBridgeProps {
|
|
1144
|
+
screen: ScreenInstance;
|
|
1145
|
+
focused: boolean;
|
|
1146
|
+
/** Pre-filtered messages (if filtering is active) */
|
|
1147
|
+
filteredMessages?: MessageData[];
|
|
1148
|
+
/** Whether any filter is currently active */
|
|
1149
|
+
isFiltering?: boolean;
|
|
1150
|
+
/** Total message count (before filtering) */
|
|
1151
|
+
totalMessages?: number;
|
|
1152
|
+
}
|
|
1153
|
+
declare function ScreenBridge({
|
|
1154
|
+
screen,
|
|
1155
|
+
focused,
|
|
1156
|
+
filteredMessages,
|
|
1157
|
+
isFiltering,
|
|
1158
|
+
totalMessages
|
|
1159
|
+
}: ScreenBridgeProps): react0.ReactNode;
|
|
1160
|
+
//#endregion
|
|
1161
|
+
//#region src/components/screen/message_renderer.d.ts
|
|
1162
|
+
interface MessageRendererProps {
|
|
1163
|
+
message: MessageData;
|
|
1164
|
+
}
|
|
1165
|
+
declare function MessageRenderer({
|
|
1166
|
+
message
|
|
1167
|
+
}: MessageRendererProps): react0.ReactNode;
|
|
1168
|
+
//#endregion
|
|
1169
|
+
//#region src/components/screen/loading_message.d.ts
|
|
1170
|
+
interface LoadingMessageProps {
|
|
1171
|
+
message: LoadingMessageData;
|
|
1172
|
+
}
|
|
1173
|
+
declare function LoadingMessage({
|
|
1174
|
+
message
|
|
1175
|
+
}: LoadingMessageProps): react0.ReactNode;
|
|
1176
|
+
//#endregion
|
|
1177
|
+
//#region src/components/screen/progress_message.d.ts
|
|
1178
|
+
interface ProgressMessageProps {
|
|
1179
|
+
message: ProgressMessageData;
|
|
1180
|
+
}
|
|
1181
|
+
declare function ProgressMessage({
|
|
1182
|
+
message
|
|
1183
|
+
}: ProgressMessageProps): react0.ReactNode;
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region src/components/screen/group_renderer.d.ts
|
|
1186
|
+
interface GroupRendererProps {
|
|
1187
|
+
label: string;
|
|
1188
|
+
messages: MessageData[];
|
|
1189
|
+
}
|
|
1190
|
+
declare function GroupRenderer({
|
|
1191
|
+
label,
|
|
1192
|
+
messages
|
|
1193
|
+
}: GroupRendererProps): react0.ReactNode;
|
|
1194
|
+
interface GroupMessageRendererProps {
|
|
1195
|
+
message: GroupMessageData;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Fallback renderer for group markers (when not processed at higher level)
|
|
1199
|
+
*/
|
|
1200
|
+
declare function GroupMessageRenderer({
|
|
1201
|
+
message
|
|
1202
|
+
}: GroupMessageRendererProps): react0.ReactNode;
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region src/components/screen/table_message.d.ts
|
|
1205
|
+
interface TableMessageProps {
|
|
1206
|
+
message: TableMessageData;
|
|
1207
|
+
}
|
|
1208
|
+
declare function TableMessage({
|
|
1209
|
+
message
|
|
1210
|
+
}: TableMessageProps): react0.ReactNode;
|
|
1211
|
+
//#endregion
|
|
1212
|
+
//#region src/components/sidebar/sidebar.d.ts
|
|
1213
|
+
interface SidebarProps {
|
|
1214
|
+
screens: ScreenInstance[];
|
|
1215
|
+
selectedIndex: number;
|
|
1216
|
+
activeScreenId: string;
|
|
1217
|
+
focused: boolean;
|
|
1218
|
+
width: number;
|
|
1219
|
+
title: string;
|
|
1220
|
+
}
|
|
1221
|
+
declare function Sidebar({
|
|
1222
|
+
screens,
|
|
1223
|
+
selectedIndex,
|
|
1224
|
+
activeScreenId,
|
|
1225
|
+
focused,
|
|
1226
|
+
width,
|
|
1227
|
+
title
|
|
1228
|
+
}: SidebarProps): react0.ReactNode;
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region src/components/sidebar/sidebar_item.d.ts
|
|
1231
|
+
interface SidebarItemProps {
|
|
1232
|
+
screen: ScreenInstance;
|
|
1233
|
+
isSelected: boolean;
|
|
1234
|
+
isActive: boolean;
|
|
1235
|
+
focused: boolean;
|
|
1236
|
+
}
|
|
1237
|
+
declare function SidebarItem({
|
|
1238
|
+
screen,
|
|
1239
|
+
isSelected,
|
|
1240
|
+
isActive,
|
|
1241
|
+
focused
|
|
1242
|
+
}: SidebarItemProps): react0.ReactNode;
|
|
1243
|
+
//#endregion
|
|
1244
|
+
//#region src/components/sidebar/sidebar_separator.d.ts
|
|
1245
|
+
declare function SidebarSeparator(): react0.ReactNode;
|
|
1246
|
+
//#endregion
|
|
1247
|
+
//#region src/components/screen_manager_bridge.d.ts
|
|
1248
|
+
interface ScreenManagerBridgeProps {
|
|
1249
|
+
manager: ScreenManager;
|
|
1250
|
+
theme?: Theme;
|
|
1251
|
+
}
|
|
1252
|
+
declare function ScreenManagerBridge({
|
|
1253
|
+
manager,
|
|
1254
|
+
theme
|
|
1255
|
+
}: ScreenManagerBridgeProps): react0.ReactNode;
|
|
1256
|
+
//#endregion
|
|
1257
|
+
//#region src/context/logger_context.d.ts
|
|
1258
|
+
interface LoggerProviderProps {
|
|
1259
|
+
children: ReactNode;
|
|
1260
|
+
/** Custom syntax style for code highlighting */
|
|
1261
|
+
syntaxStyle?: SyntaxStyle;
|
|
1262
|
+
/** Tree-sitter client for parsing */
|
|
1263
|
+
treeSitterClient?: TreeSitterClient;
|
|
1264
|
+
/**
|
|
1265
|
+
* Theme configuration.
|
|
1266
|
+
* Can be a preset name ("dark", "light", "high-contrast") or a Theme object.
|
|
1267
|
+
* @default "dark"
|
|
1268
|
+
*/
|
|
1269
|
+
theme?: Theme | ThemePreset;
|
|
1270
|
+
/**
|
|
1271
|
+
* @deprecated Use `theme` instead. Custom log level colors.
|
|
1272
|
+
* If both `theme` and `levelColors` are provided, `levelColors` takes precedence.
|
|
1273
|
+
*/
|
|
1274
|
+
levelColors?: Partial<LogLevelColorMap>;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* LoggerProvider - Provides shared context for logger components.
|
|
1278
|
+
*
|
|
1279
|
+
* This context provides:
|
|
1280
|
+
* - Shared SyntaxStyle instance for consistent code highlighting
|
|
1281
|
+
* - Optional TreeSitterClient for advanced parsing
|
|
1282
|
+
* - Theme configuration for consistent styling
|
|
1283
|
+
* - Log level color configuration (for backwards compatibility)
|
|
1284
|
+
*
|
|
1285
|
+
* @example
|
|
1286
|
+
* // Using a preset theme
|
|
1287
|
+
* <LoggerProvider theme="dark">
|
|
1288
|
+
* <ScreenManager screens={screens} activeScreenId={activeId}>
|
|
1289
|
+
* <Screen name="Logs">
|
|
1290
|
+
* <LogMessage level="info">Hello</LogMessage>
|
|
1291
|
+
* </Screen>
|
|
1292
|
+
* </ScreenManager>
|
|
1293
|
+
* </LoggerProvider>
|
|
1294
|
+
*
|
|
1295
|
+
* @example
|
|
1296
|
+
* // Using a custom theme
|
|
1297
|
+
* <LoggerProvider theme={myCustomTheme}>
|
|
1298
|
+
* ...
|
|
1299
|
+
* </LoggerProvider>
|
|
1300
|
+
*/
|
|
1301
|
+
declare function LoggerProvider({
|
|
1302
|
+
children,
|
|
1303
|
+
syntaxStyle: customSyntaxStyle,
|
|
1304
|
+
treeSitterClient,
|
|
1305
|
+
theme: themeProp,
|
|
1306
|
+
levelColors: customLevelColors
|
|
1307
|
+
}: LoggerProviderProps): ReactNode;
|
|
1308
|
+
/**
|
|
1309
|
+
* Hook to access logger context.
|
|
1310
|
+
* Returns default values if used outside LoggerProvider.
|
|
1311
|
+
*/
|
|
1312
|
+
declare function useLoggerContext(): LoggerContextValue;
|
|
1313
|
+
//#endregion
|
|
1314
|
+
//#region src/utils/colors/log-colors.d.ts
|
|
1315
|
+
/**
|
|
1316
|
+
* Default color scheme for all log levels.
|
|
1317
|
+
* Each level has a prominent border color and a subtle background tint.
|
|
1318
|
+
*/
|
|
1319
|
+
declare const DEFAULT_LOG_LEVEL_COLORS: LogLevelColorMap;
|
|
1320
|
+
/**
|
|
1321
|
+
* Colors for semantic variants (override level colors when variant is set).
|
|
1322
|
+
*/
|
|
1323
|
+
declare const VARIANT_COLORS: Record<LogMessageVariant, LogLevelColors>;
|
|
1324
|
+
/**
|
|
1325
|
+
* Error highlighting colors.
|
|
1326
|
+
*/
|
|
1327
|
+
declare const ERROR_HIGHLIGHT_COLORS: {
|
|
1328
|
+
background: string;
|
|
1329
|
+
border: string;
|
|
1330
|
+
gutterBackground: string;
|
|
1331
|
+
};
|
|
1332
|
+
//#endregion
|
|
1333
|
+
//#region src/utils/colors/sidebar-colors.d.ts
|
|
1334
|
+
/**
|
|
1335
|
+
* Sidebar colors.
|
|
1336
|
+
*/
|
|
1337
|
+
declare const SIDEBAR_COLORS: {
|
|
1338
|
+
background: undefined;
|
|
1339
|
+
selectedBackground: string;
|
|
1340
|
+
hoverBackground: string;
|
|
1341
|
+
text: string;
|
|
1342
|
+
textDim: string;
|
|
1343
|
+
border: string;
|
|
1344
|
+
badge: string;
|
|
1345
|
+
focusBorder: string;
|
|
1346
|
+
};
|
|
1347
|
+
/**
|
|
1348
|
+
* Screen header colors.
|
|
1349
|
+
*/
|
|
1350
|
+
declare const HEADER_COLORS: {
|
|
1351
|
+
background: undefined;
|
|
1352
|
+
text: string;
|
|
1353
|
+
border: string;
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* Screen status indicator colors and icons.
|
|
1357
|
+
*/
|
|
1358
|
+
declare const STATUS_INDICATORS: {
|
|
1359
|
+
readonly waiting: {
|
|
1360
|
+
readonly icon: "○";
|
|
1361
|
+
readonly color: "#6B7280";
|
|
1362
|
+
};
|
|
1363
|
+
readonly pending: {
|
|
1364
|
+
readonly icon: "◐";
|
|
1365
|
+
readonly color: "#F59E0B";
|
|
1366
|
+
};
|
|
1367
|
+
readonly success: {
|
|
1368
|
+
readonly icon: "✓";
|
|
1369
|
+
readonly color: "#22C55E";
|
|
1370
|
+
};
|
|
1371
|
+
readonly fail: {
|
|
1372
|
+
readonly icon: "✗";
|
|
1373
|
+
readonly color: "#EF4444";
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1376
|
+
/**
|
|
1377
|
+
* Separator colors for sidebar sections.
|
|
1378
|
+
*/
|
|
1379
|
+
declare const SEPARATOR_COLORS: {
|
|
1380
|
+
line: string;
|
|
1381
|
+
text: string;
|
|
1382
|
+
};
|
|
1383
|
+
//#endregion
|
|
1384
|
+
//#region src/utils/colors/progress-colors.d.ts
|
|
1385
|
+
/**
|
|
1386
|
+
* Progress bar colors.
|
|
1387
|
+
*/
|
|
1388
|
+
declare const PROGRESS_COLORS: {
|
|
1389
|
+
border: string;
|
|
1390
|
+
background: string;
|
|
1391
|
+
barFilled: string;
|
|
1392
|
+
barEmpty: string;
|
|
1393
|
+
text: string;
|
|
1394
|
+
textDim: string;
|
|
1395
|
+
complete: string;
|
|
1396
|
+
completeBackground: string;
|
|
1397
|
+
failed: string;
|
|
1398
|
+
failedBackground: string;
|
|
1399
|
+
};
|
|
1400
|
+
/**
|
|
1401
|
+
* Group colors for collapsible log groups.
|
|
1402
|
+
*/
|
|
1403
|
+
declare const GROUP_COLORS: {
|
|
1404
|
+
border: string;
|
|
1405
|
+
background: string;
|
|
1406
|
+
headerText: string;
|
|
1407
|
+
icon: string;
|
|
1408
|
+
};
|
|
1409
|
+
//#endregion
|
|
1410
|
+
//#region src/utils/colors/table-colors.d.ts
|
|
1411
|
+
/**
|
|
1412
|
+
* Table colors (uses info/blue scheme).
|
|
1413
|
+
*/
|
|
1414
|
+
declare const TABLE_COLORS: {
|
|
1415
|
+
border: string;
|
|
1416
|
+
background: string;
|
|
1417
|
+
headerText: string;
|
|
1418
|
+
cellText: string;
|
|
1419
|
+
title: string;
|
|
1420
|
+
separator: string;
|
|
1421
|
+
};
|
|
1422
|
+
//#endregion
|
|
1423
|
+
//#region src/utils/colors/file-colors.d.ts
|
|
1424
|
+
/**
|
|
1425
|
+
* File display colors (uses info/blue scheme).
|
|
1426
|
+
*/
|
|
1427
|
+
declare const FILE_COLORS: {
|
|
1428
|
+
border: string;
|
|
1429
|
+
background: string;
|
|
1430
|
+
headerText: string;
|
|
1431
|
+
headerBackground: string;
|
|
1432
|
+
};
|
|
1433
|
+
//#endregion
|
|
1434
|
+
//#region src/utils/colors/prompt-colors.d.ts
|
|
1435
|
+
/**
|
|
1436
|
+
* Prompt colors for interactive prompts.
|
|
1437
|
+
*/
|
|
1438
|
+
declare const PROMPT_COLORS: {
|
|
1439
|
+
question: string;
|
|
1440
|
+
optionText: string;
|
|
1441
|
+
optionTextDim: string;
|
|
1442
|
+
optionSelected: string;
|
|
1443
|
+
optionSelectedBackground: string;
|
|
1444
|
+
confirmButton: string;
|
|
1445
|
+
cancelButton: string;
|
|
1446
|
+
buttonBackground: string;
|
|
1447
|
+
buttonSelectedBackground: string;
|
|
1448
|
+
inputBorder: string;
|
|
1449
|
+
inputBackground: string;
|
|
1450
|
+
inputText: string;
|
|
1451
|
+
inputPlaceholder: string;
|
|
1452
|
+
inputCursor: string;
|
|
1453
|
+
border: string;
|
|
1454
|
+
focusBorder: string;
|
|
1455
|
+
};
|
|
1456
|
+
//#endregion
|
|
1457
|
+
//#region src/utils/colors/helpers.d.ts
|
|
1458
|
+
/**
|
|
1459
|
+
* Creates a tinted (subtle) version of a color by setting alpha.
|
|
1460
|
+
*
|
|
1461
|
+
* @param color - The base color (hex string or RGBA)
|
|
1462
|
+
* @param alpha - Target alpha value (0-1), default 0.08 for subtle tinting
|
|
1463
|
+
* @returns New RGBA with adjusted alpha
|
|
1464
|
+
*/
|
|
1465
|
+
declare function createTintedColor(color: string | RGBA, alpha?: number): RGBA;
|
|
1466
|
+
/**
|
|
1467
|
+
* Creates a more prominent version of a color for borders.
|
|
1468
|
+
*
|
|
1469
|
+
* @param color - The base color
|
|
1470
|
+
* @param alpha - Target alpha, default 1.0 for solid borders
|
|
1471
|
+
*/
|
|
1472
|
+
declare function createBorderColor(color: string | RGBA, alpha?: number): RGBA;
|
|
1473
|
+
/**
|
|
1474
|
+
* Gets colors for a specific log level.
|
|
1475
|
+
*
|
|
1476
|
+
* @param level - The log level
|
|
1477
|
+
* @param customColors - Optional custom color map
|
|
1478
|
+
*/
|
|
1479
|
+
declare function getLogLevelColors(level: LogLevel, customColors?: Partial<LogLevelColorMap>): LogLevelColors;
|
|
1480
|
+
//#endregion
|
|
1481
|
+
//#region src/utils/filetype.d.ts
|
|
1482
|
+
/**
|
|
1483
|
+
* Common file extension to filetype mapping for syntax highlighting.
|
|
1484
|
+
*/
|
|
1485
|
+
declare const COMMON_FILETYPES: Record<string, string>;
|
|
1486
|
+
/**
|
|
1487
|
+
* Resolves filetype from file path for syntax highlighting.
|
|
1488
|
+
*
|
|
1489
|
+
* @param filePath - Full file path or just filename
|
|
1490
|
+
* @returns Filetype string for tree-sitter, or undefined
|
|
1491
|
+
*/
|
|
1492
|
+
declare function resolveFiletype(filePath: string): string | undefined;
|
|
1493
|
+
/**
|
|
1494
|
+
* Gets the filename from a full path.
|
|
1495
|
+
*
|
|
1496
|
+
* @param filePath - Full file path
|
|
1497
|
+
* @returns Just the filename
|
|
1498
|
+
*/
|
|
1499
|
+
declare function getFileName(filePath: string): string;
|
|
1500
|
+
//#endregion
|
|
1501
|
+
//#region src/utils/stdout-printer.d.ts
|
|
1502
|
+
/**
|
|
1503
|
+
* Print all messages to stdout (or stderr if isError)
|
|
1504
|
+
*/
|
|
1505
|
+
declare function printMessagesToStdout(messages: MessageData[], screenName: string, isError?: boolean): void;
|
|
1506
|
+
//#endregion
|
|
1507
|
+
//#region src/utils/format.d.ts
|
|
1508
|
+
/**
|
|
1509
|
+
* Format an object for display with configurable depth
|
|
1510
|
+
*/
|
|
1511
|
+
declare function formatObject(obj: unknown, depth?: number, currentDepth?: number): string;
|
|
1512
|
+
/**
|
|
1513
|
+
* Capture a stack trace, filtering out internal frames
|
|
1514
|
+
*/
|
|
1515
|
+
declare function captureTrace(): string;
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region src/tokens/screen.d.ts
|
|
1518
|
+
declare const Screen: InjectionToken<ScreenInstance, zod_v418.ZodObject<{
|
|
1519
|
+
name: zod_v418.ZodString;
|
|
1520
|
+
icon: zod_v418.ZodOptional<zod_v418.ZodString>;
|
|
1521
|
+
badgeCount: zod_v418.ZodOptional<zod_v418.ZodNumber>;
|
|
1522
|
+
hidden: zod_v418.ZodDefault<zod_v418.ZodOptional<zod_v418.ZodBoolean>>;
|
|
1523
|
+
}, zod_v4_core1.$strip>, true>;
|
|
1524
|
+
//#endregion
|
|
1525
|
+
//#region src/tokens/logger.d.ts
|
|
1526
|
+
declare const ScreenLogger: InjectionToken<ScreenLoggerInstance, zod_v418.ZodObject<{
|
|
1527
|
+
screen: zod_v418.ZodDefault<zod_v418.ZodOptional<zod_v418.ZodUnion<[zod_v418.ZodObject<{
|
|
1528
|
+
name: zod_v418.ZodString;
|
|
1529
|
+
icon: zod_v418.ZodOptional<zod_v418.ZodString>;
|
|
1530
|
+
badgeCount: zod_v418.ZodOptional<zod_v418.ZodNumber>;
|
|
1531
|
+
hidden: zod_v418.ZodDefault<zod_v418.ZodOptional<zod_v418.ZodBoolean>>;
|
|
1532
|
+
}, zod_v4_core1.$strip>, zod_v418.ZodString]>>>;
|
|
1533
|
+
context: zod_v418.ZodOptional<zod_v418.ZodString>;
|
|
1534
|
+
enabledLevels: zod_v418.ZodDefault<zod_v418.ZodArray<zod_v418.ZodEnum<{
|
|
1535
|
+
verbose: "verbose";
|
|
1536
|
+
debug: "debug";
|
|
1537
|
+
log: "log";
|
|
1538
|
+
warn: "warn";
|
|
1539
|
+
error: "error";
|
|
1540
|
+
fatal: "fatal";
|
|
1541
|
+
}>>>;
|
|
1542
|
+
}, zod_v4_core1.$strip>, true>;
|
|
1543
|
+
//#endregion
|
|
1544
|
+
//#region src/tokens/prompt.d.ts
|
|
1545
|
+
declare const Prompt: InjectionToken<PromptInstance, zod_v418.ZodObject<{
|
|
1546
|
+
screen: zod_v418.ZodDefault<zod_v418.ZodOptional<zod_v418.ZodUnion<[zod_v418.ZodObject<{
|
|
1547
|
+
name: zod_v418.ZodString;
|
|
1548
|
+
icon: zod_v418.ZodOptional<zod_v418.ZodString>;
|
|
1549
|
+
badgeCount: zod_v418.ZodOptional<zod_v418.ZodNumber>;
|
|
1550
|
+
hidden: zod_v418.ZodDefault<zod_v418.ZodOptional<zod_v418.ZodBoolean>>;
|
|
1551
|
+
}, zod_v4_core1.$strip>, zod_v418.ZodString]>>>;
|
|
1552
|
+
}, zod_v4_core1.$strip>, true>;
|
|
1553
|
+
//#endregion
|
|
1554
|
+
//#region src/factories/screen.factory.d.ts
|
|
1555
|
+
declare class ScreenFactory {
|
|
1556
|
+
private readonly screenManager;
|
|
1557
|
+
create(ctx: FactoryContext, options: ScreenOptions): ScreenInstance;
|
|
1558
|
+
}
|
|
1559
|
+
//#endregion
|
|
1560
|
+
//#region src/overrides/console.logger.override.d.ts
|
|
1561
|
+
declare function overrideConsoleLogger(hidden?: boolean): ClassTypeWithInstance<LoggerService>;
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/themes/dark.d.ts
|
|
1564
|
+
/**
|
|
1565
|
+
* Default dark theme.
|
|
1566
|
+
* Migrated from the scattered color files in utils/colors/.
|
|
1567
|
+
*/
|
|
1568
|
+
declare const darkTheme: Theme;
|
|
1569
|
+
//#endregion
|
|
1570
|
+
//#region src/themes/light.d.ts
|
|
1571
|
+
/**
|
|
1572
|
+
* Light theme for terminals with light backgrounds.
|
|
1573
|
+
*/
|
|
1574
|
+
declare const lightTheme: Theme;
|
|
1575
|
+
//#endregion
|
|
1576
|
+
//#region src/themes/high-contrast.d.ts
|
|
1577
|
+
/**
|
|
1578
|
+
* High contrast theme for accessibility.
|
|
1579
|
+
* Uses pure black/white with saturated colors for maximum visibility.
|
|
1580
|
+
*/
|
|
1581
|
+
declare const highContrastTheme: Theme;
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region src/themes/utils.d.ts
|
|
1584
|
+
/**
|
|
1585
|
+
* Get a theme by preset name.
|
|
1586
|
+
*/
|
|
1587
|
+
declare function getThemePreset(preset: ThemePreset): Theme;
|
|
1588
|
+
/**
|
|
1589
|
+
* Merge a base theme with partial overrides.
|
|
1590
|
+
*/
|
|
1591
|
+
declare function mergeThemes(base: Theme, overrides: PartialTheme): Theme;
|
|
1592
|
+
/**
|
|
1593
|
+
* Create a custom theme by extending the dark theme with overrides.
|
|
1594
|
+
*/
|
|
1595
|
+
declare function createTheme(overrides: PartialTheme): Theme;
|
|
1596
|
+
/**
|
|
1597
|
+
* Create a custom theme by extending a specific base theme.
|
|
1598
|
+
*/
|
|
1599
|
+
declare function createThemeFrom(base: Theme | ThemePreset, overrides: PartialTheme): Theme;
|
|
1600
|
+
/**
|
|
1601
|
+
* Resolve a theme value which can be a Theme object or a preset name.
|
|
1602
|
+
*/
|
|
1603
|
+
declare function resolveTheme(theme: Theme | ThemePreset): Theme;
|
|
1604
|
+
//#endregion
|
|
1605
|
+
//#region src/hooks/use_theme.d.ts
|
|
1606
|
+
/**
|
|
1607
|
+
* Hook to access the current theme.
|
|
1608
|
+
* Returns the theme from LoggerContext.
|
|
1609
|
+
*/
|
|
1610
|
+
declare function useTheme(): Theme;
|
|
1611
|
+
//#endregion
|
|
1612
|
+
//#region src/keyboard/keyboard_manager.d.ts
|
|
1613
|
+
/**
|
|
1614
|
+
* Manages keyboard bindings and dispatches key events to handlers.
|
|
1615
|
+
*/
|
|
1616
|
+
declare class KeyboardManager {
|
|
1617
|
+
private bindings;
|
|
1618
|
+
private disabled;
|
|
1619
|
+
constructor(config?: KeyBindingsConfig);
|
|
1620
|
+
/**
|
|
1621
|
+
* Add bindings to the manager.
|
|
1622
|
+
*/
|
|
1623
|
+
addBindings(bindings: KeyBinding[]): void;
|
|
1624
|
+
/**
|
|
1625
|
+
* Remove a binding by key name.
|
|
1626
|
+
*/
|
|
1627
|
+
removeBinding(key: string): void;
|
|
1628
|
+
/**
|
|
1629
|
+
* Disable a key (prevents it from being matched).
|
|
1630
|
+
*/
|
|
1631
|
+
disableKey(key: string): void;
|
|
1632
|
+
/**
|
|
1633
|
+
* Enable a previously disabled key.
|
|
1634
|
+
*/
|
|
1635
|
+
enableKey(key: string): void;
|
|
1636
|
+
/**
|
|
1637
|
+
* Handle a key event, dispatching to the appropriate handler.
|
|
1638
|
+
* Returns true if a handler consumed the event.
|
|
1639
|
+
*/
|
|
1640
|
+
handleKey(key: KeyEvent, context: KeyboardContext): boolean;
|
|
1641
|
+
/**
|
|
1642
|
+
* Get all bindings for display in help overlay.
|
|
1643
|
+
*/
|
|
1644
|
+
getBindingsForHelp(): KeyBinding[];
|
|
1645
|
+
/**
|
|
1646
|
+
* Get bindings grouped by category.
|
|
1647
|
+
*/
|
|
1648
|
+
getBindingsByCategory(): Record<KeyBindingCategory, KeyBinding[]>;
|
|
1649
|
+
/**
|
|
1650
|
+
* Find a matching binding for the given key and context.
|
|
1651
|
+
*/
|
|
1652
|
+
private findMatchingBinding;
|
|
1653
|
+
/**
|
|
1654
|
+
* Check if a key event matches a binding's key specification.
|
|
1655
|
+
*/
|
|
1656
|
+
private keyMatches;
|
|
1657
|
+
/**
|
|
1658
|
+
* Check if context matches a binding's condition.
|
|
1659
|
+
*/
|
|
1660
|
+
private conditionMatches;
|
|
1661
|
+
/**
|
|
1662
|
+
* Check if a binding is disabled.
|
|
1663
|
+
*/
|
|
1664
|
+
private isDisabled;
|
|
1665
|
+
/**
|
|
1666
|
+
* Sort bindings by priority (higher first).
|
|
1667
|
+
*/
|
|
1668
|
+
private sortBindings;
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Format a key binding for display.
|
|
1672
|
+
*/
|
|
1673
|
+
declare function formatKeyBinding(binding: KeyBinding): string;
|
|
1674
|
+
//#endregion
|
|
1675
|
+
//#region src/keyboard/create_bindings.d.ts
|
|
1676
|
+
/**
|
|
1677
|
+
* Interface for binding handlers that need manager/screen access.
|
|
1678
|
+
*/
|
|
1679
|
+
interface BindingHandlers {
|
|
1680
|
+
manager: ScreenManager;
|
|
1681
|
+
getActiveScreen: () => ScreenInstance | null;
|
|
1682
|
+
toggleHelp: () => void;
|
|
1683
|
+
toggleFilter: () => void;
|
|
1684
|
+
closeFilter: () => void;
|
|
1685
|
+
filterAppendChar: (char: string) => void;
|
|
1686
|
+
filterDeleteChar: () => void;
|
|
1687
|
+
filterToggleLevel: (index: number) => void;
|
|
1688
|
+
filterCycleField: () => void;
|
|
1689
|
+
}
|
|
1690
|
+
/**
|
|
1691
|
+
* Create the default keybindings with access to manager and screens.
|
|
1692
|
+
*/
|
|
1693
|
+
declare function createDefaultBindings(handlers: BindingHandlers): KeyBinding[];
|
|
1694
|
+
/**
|
|
1695
|
+
* Handle printable character input for prompts and filter.
|
|
1696
|
+
* This should be called for any key not handled by bindings.
|
|
1697
|
+
*/
|
|
1698
|
+
declare function handlePrintableInput(key: KeyEvent, context: KeyboardContext, handlers: BindingHandlers): boolean;
|
|
1699
|
+
//#endregion
|
|
1700
|
+
//#region src/filter/filter_engine.d.ts
|
|
1701
|
+
/**
|
|
1702
|
+
* Filter engine for filtering log messages.
|
|
1703
|
+
*/
|
|
1704
|
+
declare class FilterEngine {
|
|
1705
|
+
/**
|
|
1706
|
+
* Apply filter to messages array.
|
|
1707
|
+
*/
|
|
1708
|
+
static filterMessages(messages: MessageData[], filter: FilterState): MessageData[];
|
|
1709
|
+
/**
|
|
1710
|
+
* Check if a message matches the search query.
|
|
1711
|
+
*/
|
|
1712
|
+
private static messageMatchesSearch;
|
|
1713
|
+
/**
|
|
1714
|
+
* Count messages by log level.
|
|
1715
|
+
*/
|
|
1716
|
+
static countByLevel(messages: MessageData[]): LevelCounts;
|
|
1717
|
+
}
|
|
1718
|
+
//#endregion
|
|
1719
|
+
export { ALL_LOG_LEVELS, BaseMessage, BasePromptData, BindOptions, BindingHandlers, COMMON_FILETYPES, ChoiceOption, ChoiceOptions, ChoicePromptData, ConfirmOptions, ConfirmPromptData, DEFAULT_LOG_LEVEL_COLORS, DeepPartial, DiffMessageData, ERROR_HIGHLIGHT_COLORS, ErrorHighlightTheme, FILE_COLORS, FileErrorMessageData, FileLog, FileLogBaseProps, FileLogDiffProps, FileLogFullProps, FileLogMode, FileLogPartialProps, FileLogProps, FileMessageData, FileTheme, FilterEngine, FilterState, FilterTheme, FocusArea, GROUP_COLORS, GroupMessageData, GroupMessageRenderer, GroupMessageRendererProps, GroupRenderer, GroupRendererProps, GroupTheme, HEADER_COLORS, HeaderTheme, HelpTheme, InputOptions, InputPromptData, KeyBinding, KeyBindingCategory, KeyBindingCondition, KeyBindingsConfig, KeyEvent, KeyHandler, KeyboardContext, KeyboardManager, LevelCounts, LoadingHandle, LoadingMessage, LoadingMessageData, LoadingMessageProps, LogLevelColorMap, LogLevelColors, LogLevelTheme, LogMessage, LogMessageData, LogMessageProps, LogMessageVariant, LoggerContextValue, LoggerOptions, LoggerOptionsSchema, LoggerProvider, LoggerProviderProps, MessageData, MessageRenderer, MessageRendererProps, MessageType, MultiChoiceOptions, MultiChoicePromptData, PROGRESS_COLORS, PROMPT_COLORS, PartialTheme, ProgressHandle, ProgressMessage, ProgressMessageData, ProgressMessageProps, ProgressTheme, PromiseOptions, Prompt, PromptData, PromptInstance, PromptOptions, PromptOptionsSchema, PromptRenderer, PromptRendererProps, PromptTheme, SEPARATOR_COLORS, SIDEBAR_COLORS, STATUS_INDICATORS, Screen, ScreenBridge, ScreenBridgeProps, ScreenDefinition, ScreenFactory, ScreenInstance, ScreenLogger, ScreenLoggerInstance, ScreenManager, ScreenManagerBridge, ScreenManagerBridgeProps, ScreenManagerProps, ScreenOptions, ScreenOptionsSchema, ScreenProps, ScreenStatus, SemanticColors, SeparatorTheme, Sidebar, SidebarItem, SidebarItemProps, SidebarProps, SidebarSeparator, SidebarTheme, StatusIndicator, StatusIndicatorsTheme, TABLE_COLORS, TableMessage, TableMessageData, TableMessageProps, TableTheme, Theme, ThemePreset, VARIANT_COLORS, VariantColorMap, captureTrace, createBorderColor, createDefaultBindings, createDefaultFilterState, createTheme, createThemeFrom, createTintedColor, darkTheme, formatKeyBinding, formatObject, getFileName, getLogLevelColors, getThemePreset, handlePrintableInput, hasActiveFilter, highContrastTheme, lightTheme, mergeThemes, overrideConsoleLogger, printMessagesToStdout, resolveFiletype, resolveTheme, useLoggerContext, useTheme };
|
|
1720
|
+
//# sourceMappingURL=index.d.cts.map
|