@nexus-cortex/tui 4.47.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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +13 -0
- package/bin/cli-full.js +23 -0
- package/bin/cortex-ui.js +26 -0
- package/bin/ink-ui.js +108 -0
- package/bin/launcher-dev.js +266 -0
- package/bin/launcher.js +516 -0
- package/dist/commands/agent/InteractiveAgentMenu.d.ts +100 -0
- package/dist/commands/agent/InteractiveAgentMenu.d.ts.map +1 -0
- package/dist/commands/agent/InteractiveAgentMenu.js +909 -0
- package/dist/commands/agent/InteractiveAgentMenu.js.map +1 -0
- package/dist/commands/agent/index.d.ts +55 -0
- package/dist/commands/agent/index.d.ts.map +1 -0
- package/dist/commands/agent/index.js +714 -0
- package/dist/commands/agent/index.js.map +1 -0
- package/dist/commands/chat/interactive.d.ts +13 -0
- package/dist/commands/chat/interactive.d.ts.map +1 -0
- package/dist/commands/chat/interactive.js +2055 -0
- package/dist/commands/chat/interactive.js.map +1 -0
- package/dist/commands/system-message/EditorLauncher.d.ts +65 -0
- package/dist/commands/system-message/EditorLauncher.d.ts.map +1 -0
- package/dist/commands/system-message/EditorLauncher.js +143 -0
- package/dist/commands/system-message/EditorLauncher.js.map +1 -0
- package/dist/commands/system-message/InlineEditor.d.ts +23 -0
- package/dist/commands/system-message/InlineEditor.d.ts.map +1 -0
- package/dist/commands/system-message/InlineEditor.js +225 -0
- package/dist/commands/system-message/InlineEditor.js.map +1 -0
- package/dist/commands/system-message/InteractiveMenu.d.ts +76 -0
- package/dist/commands/system-message/InteractiveMenu.d.ts.map +1 -0
- package/dist/commands/system-message/InteractiveMenu.js +979 -0
- package/dist/commands/system-message/InteractiveMenu.js.map +1 -0
- package/dist/commands/system-message/index.d.ts +56 -0
- package/dist/commands/system-message/index.d.ts.map +1 -0
- package/dist/commands/system-message/index.js +694 -0
- package/dist/commands/system-message/index.js.map +1 -0
- package/dist/commands/ui/artifacts.d.ts +14 -0
- package/dist/commands/ui/artifacts.d.ts.map +1 -0
- package/dist/commands/ui/artifacts.js +22 -0
- package/dist/commands/ui/artifacts.js.map +1 -0
- package/dist/commands/ui/config.d.ts +12 -0
- package/dist/commands/ui/config.d.ts.map +1 -0
- package/dist/commands/ui/config.js +26 -0
- package/dist/commands/ui/config.js.map +1 -0
- package/dist/commands/ui/context.d.ts +16 -0
- package/dist/commands/ui/context.d.ts.map +1 -0
- package/dist/commands/ui/context.js +28 -0
- package/dist/commands/ui/context.js.map +1 -0
- package/dist/commands/ui/middleware.d.ts +14 -0
- package/dist/commands/ui/middleware.d.ts.map +1 -0
- package/dist/commands/ui/middleware.js +22 -0
- package/dist/commands/ui/middleware.js.map +1 -0
- package/dist/commands/ui/models.d.ts +14 -0
- package/dist/commands/ui/models.d.ts.map +1 -0
- package/dist/commands/ui/models.js +50 -0
- package/dist/commands/ui/models.js.map +1 -0
- package/dist/commands/ui/permissions.d.ts +14 -0
- package/dist/commands/ui/permissions.d.ts.map +1 -0
- package/dist/commands/ui/permissions.js +22 -0
- package/dist/commands/ui/permissions.js.map +1 -0
- package/dist/commands/ui/sessions.d.ts +13 -0
- package/dist/commands/ui/sessions.d.ts.map +1 -0
- package/dist/commands/ui/sessions.js +45 -0
- package/dist/commands/ui/sessions.js.map +1 -0
- package/dist/commands/ui/system-messages.d.ts +5 -0
- package/dist/commands/ui/system-messages.d.ts.map +1 -0
- package/dist/commands/ui/system-messages.js +19 -0
- package/dist/commands/ui/system-messages.js.map +1 -0
- package/dist/commands/ui/themes.d.ts +12 -0
- package/dist/commands/ui/themes.d.ts.map +1 -0
- package/dist/commands/ui/themes.js +40 -0
- package/dist/commands/ui/themes.js.map +1 -0
- package/dist/commands/ui/tmux.d.ts +5 -0
- package/dist/commands/ui/tmux.d.ts.map +1 -0
- package/dist/commands/ui/tmux.js +19 -0
- package/dist/commands/ui/tmux.js.map +1 -0
- package/dist/cortex.d.ts +12 -0
- package/dist/cortex.d.ts.map +1 -0
- package/dist/cortex.js +320 -0
- package/dist/cortex.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/ink-ui/CortexApp.d.ts +28 -0
- package/dist/ink-ui/CortexApp.d.ts.map +1 -0
- package/dist/ink-ui/CortexApp.js +2291 -0
- package/dist/ink-ui/CortexApp.js.map +1 -0
- package/dist/ink-ui/SimpleInputBuffer.d.ts +63 -0
- package/dist/ink-ui/SimpleInputBuffer.d.ts.map +1 -0
- package/dist/ink-ui/SimpleInputBuffer.js +369 -0
- package/dist/ink-ui/SimpleInputBuffer.js.map +1 -0
- package/dist/ink-ui/commands/slashCommands.d.ts +40 -0
- package/dist/ink-ui/commands/slashCommands.d.ts.map +1 -0
- package/dist/ink-ui/commands/slashCommands.js +111 -0
- package/dist/ink-ui/commands/slashCommands.js.map +1 -0
- package/dist/ink-ui/commands/types.d.ts +161 -0
- package/dist/ink-ui/commands/types.d.ts.map +1 -0
- package/dist/ink-ui/commands/types.js +12 -0
- package/dist/ink-ui/commands/types.js.map +1 -0
- package/dist/ink-ui/components/ApprovalDialog.d.ts +21 -0
- package/dist/ink-ui/components/ApprovalDialog.d.ts.map +1 -0
- package/dist/ink-ui/components/ApprovalDialog.js +81 -0
- package/dist/ink-ui/components/ApprovalDialog.js.map +1 -0
- package/dist/ink-ui/components/CommandSuggestions.d.ts +19 -0
- package/dist/ink-ui/components/CommandSuggestions.d.ts.map +1 -0
- package/dist/ink-ui/components/CommandSuggestions.js +36 -0
- package/dist/ink-ui/components/CommandSuggestions.js.map +1 -0
- package/dist/ink-ui/components/DiffPreview.d.ts +60 -0
- package/dist/ink-ui/components/DiffPreview.d.ts.map +1 -0
- package/dist/ink-ui/components/DiffPreview.js +195 -0
- package/dist/ink-ui/components/DiffPreview.js.map +1 -0
- package/dist/ink-ui/components/DocumentPreview.d.ts +50 -0
- package/dist/ink-ui/components/DocumentPreview.d.ts.map +1 -0
- package/dist/ink-ui/components/DocumentPreview.js +92 -0
- package/dist/ink-ui/components/DocumentPreview.js.map +1 -0
- package/dist/ink-ui/components/MarkdownText.d.ts +27 -0
- package/dist/ink-ui/components/MarkdownText.d.ts.map +1 -0
- package/dist/ink-ui/components/MarkdownText.js +342 -0
- package/dist/ink-ui/components/MarkdownText.js.map +1 -0
- package/dist/ink-ui/components/MenuRenderer.d.ts +26 -0
- package/dist/ink-ui/components/MenuRenderer.d.ts.map +1 -0
- package/dist/ink-ui/components/MenuRenderer.js +264 -0
- package/dist/ink-ui/components/MenuRenderer.js.map +1 -0
- package/dist/ink-ui/components/ModelPickerDialog.d.ts +33 -0
- package/dist/ink-ui/components/ModelPickerDialog.d.ts.map +1 -0
- package/dist/ink-ui/components/ModelPickerDialog.js +98 -0
- package/dist/ink-ui/components/ModelPickerDialog.js.map +1 -0
- package/dist/ink-ui/components/StreamDisplay.d.ts +31 -0
- package/dist/ink-ui/components/StreamDisplay.d.ts.map +1 -0
- package/dist/ink-ui/components/StreamDisplay.js +573 -0
- package/dist/ink-ui/components/StreamDisplay.js.map +1 -0
- package/dist/ink-ui/components/SubAgentPanel.d.ts +98 -0
- package/dist/ink-ui/components/SubAgentPanel.d.ts.map +1 -0
- package/dist/ink-ui/components/SubAgentPanel.js +155 -0
- package/dist/ink-ui/components/SubAgentPanel.js.map +1 -0
- package/dist/ink-ui/components/ThinkingDisplay.d.ts +46 -0
- package/dist/ink-ui/components/ThinkingDisplay.d.ts.map +1 -0
- package/dist/ink-ui/components/ThinkingDisplay.js +176 -0
- package/dist/ink-ui/components/ThinkingDisplay.js.map +1 -0
- package/dist/ink-ui/components/ToolCallDisplay.d.ts +51 -0
- package/dist/ink-ui/components/ToolCallDisplay.d.ts.map +1 -0
- package/dist/ink-ui/components/ToolCallDisplay.js +378 -0
- package/dist/ink-ui/components/ToolCallDisplay.js.map +1 -0
- package/dist/ink-ui/components/WritePreview.d.ts +42 -0
- package/dist/ink-ui/components/WritePreview.d.ts.map +1 -0
- package/dist/ink-ui/components/WritePreview.js +100 -0
- package/dist/ink-ui/components/WritePreview.js.map +1 -0
- package/dist/ink-ui/contexts/KeypressContext.d.ts +32 -0
- package/dist/ink-ui/contexts/KeypressContext.d.ts.map +1 -0
- package/dist/ink-ui/contexts/KeypressContext.js +529 -0
- package/dist/ink-ui/contexts/KeypressContext.js.map +1 -0
- package/dist/ink-ui/contexts/SessionContext.d.ts +46 -0
- package/dist/ink-ui/contexts/SessionContext.d.ts.map +1 -0
- package/dist/ink-ui/contexts/SessionContext.js +162 -0
- package/dist/ink-ui/contexts/SessionContext.js.map +1 -0
- package/dist/ink-ui/core-stubs.d.ts +270 -0
- package/dist/ink-ui/core-stubs.d.ts.map +1 -0
- package/dist/ink-ui/core-stubs.js +276 -0
- package/dist/ink-ui/core-stubs.js.map +1 -0
- package/dist/ink-ui/cortex-types.d.ts +214 -0
- package/dist/ink-ui/cortex-types.d.ts.map +1 -0
- package/dist/ink-ui/cortex-types.js +52 -0
- package/dist/ink-ui/cortex-types.js.map +1 -0
- package/dist/ink-ui/hooks/useCortexStream.d.ts +75 -0
- package/dist/ink-ui/hooks/useCortexStream.d.ts.map +1 -0
- package/dist/ink-ui/hooks/useCortexStream.js +518 -0
- package/dist/ink-ui/hooks/useCortexStream.js.map +1 -0
- package/dist/ink-ui/hooks/useFocus.d.ts +11 -0
- package/dist/ink-ui/hooks/useFocus.d.ts.map +1 -0
- package/dist/ink-ui/hooks/useFocus.js +51 -0
- package/dist/ink-ui/hooks/useFocus.js.map +1 -0
- package/dist/ink-ui/hooks/useHistoryManager.d.ts +23 -0
- package/dist/ink-ui/hooks/useHistoryManager.d.ts.map +1 -0
- package/dist/ink-ui/hooks/useHistoryManager.js +63 -0
- package/dist/ink-ui/hooks/useHistoryManager.js.map +1 -0
- package/dist/ink-ui/hooks/useKeypress.d.ts +18 -0
- package/dist/ink-ui/hooks/useKeypress.d.ts.map +1 -0
- package/dist/ink-ui/hooks/useKeypress.js +27 -0
- package/dist/ink-ui/hooks/useKeypress.js.map +1 -0
- package/dist/ink-ui/hooks/useReactApprovalHandler.d.ts +74 -0
- package/dist/ink-ui/hooks/useReactApprovalHandler.d.ts.map +1 -0
- package/dist/ink-ui/hooks/useReactApprovalHandler.js +83 -0
- package/dist/ink-ui/hooks/useReactApprovalHandler.js.map +1 -0
- package/dist/ink-ui/hooks/useTerminalSize.d.ts +10 -0
- package/dist/ink-ui/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/ink-ui/hooks/useTerminalSize.js +28 -0
- package/dist/ink-ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/ink-ui/semantic-colors.d.ts +8 -0
- package/dist/ink-ui/semantic-colors.d.ts.map +1 -0
- package/dist/ink-ui/semantic-colors.js +24 -0
- package/dist/ink-ui/semantic-colors.js.map +1 -0
- package/dist/ink-ui/state/extensions.d.ts +68 -0
- package/dist/ink-ui/state/extensions.d.ts.map +1 -0
- package/dist/ink-ui/state/extensions.js +97 -0
- package/dist/ink-ui/state/extensions.js.map +1 -0
- package/dist/ink-ui/themes/ansi-light.d.ts +8 -0
- package/dist/ink-ui/themes/ansi-light.d.ts.map +1 -0
- package/dist/ink-ui/themes/ansi-light.js +143 -0
- package/dist/ink-ui/themes/ansi-light.js.map +1 -0
- package/dist/ink-ui/themes/ansi.d.ts +8 -0
- package/dist/ink-ui/themes/ansi.d.ts.map +1 -0
- package/dist/ink-ui/themes/ansi.js +153 -0
- package/dist/ink-ui/themes/ansi.js.map +1 -0
- package/dist/ink-ui/themes/atom-one-dark.d.ts +8 -0
- package/dist/ink-ui/themes/atom-one-dark.d.ts.map +1 -0
- package/dist/ink-ui/themes/atom-one-dark.js +140 -0
- package/dist/ink-ui/themes/atom-one-dark.js.map +1 -0
- package/dist/ink-ui/themes/ayu-light.d.ts +8 -0
- package/dist/ink-ui/themes/ayu-light.d.ts.map +1 -0
- package/dist/ink-ui/themes/ayu-light.js +132 -0
- package/dist/ink-ui/themes/ayu-light.js.map +1 -0
- package/dist/ink-ui/themes/ayu.d.ts +8 -0
- package/dist/ink-ui/themes/ayu.d.ts.map +1 -0
- package/dist/ink-ui/themes/ayu.js +106 -0
- package/dist/ink-ui/themes/ayu.js.map +1 -0
- package/dist/ink-ui/themes/color-utils.d.ts +23 -0
- package/dist/ink-ui/themes/color-utils.d.ts.map +1 -0
- package/dist/ink-ui/themes/color-utils.js +237 -0
- package/dist/ink-ui/themes/color-utils.js.map +1 -0
- package/dist/ink-ui/themes/default-light.d.ts +8 -0
- package/dist/ink-ui/themes/default-light.d.ts.map +1 -0
- package/dist/ink-ui/themes/default-light.js +100 -0
- package/dist/ink-ui/themes/default-light.js.map +1 -0
- package/dist/ink-ui/themes/default.d.ts +8 -0
- package/dist/ink-ui/themes/default.d.ts.map +1 -0
- package/dist/ink-ui/themes/default.js +143 -0
- package/dist/ink-ui/themes/default.js.map +1 -0
- package/dist/ink-ui/themes/dracula.d.ts +8 -0
- package/dist/ink-ui/themes/dracula.d.ts.map +1 -0
- package/dist/ink-ui/themes/dracula.js +117 -0
- package/dist/ink-ui/themes/dracula.js.map +1 -0
- package/dist/ink-ui/themes/github-dark.d.ts +8 -0
- package/dist/ink-ui/themes/github-dark.d.ts.map +1 -0
- package/dist/ink-ui/themes/github-dark.js +140 -0
- package/dist/ink-ui/themes/github-dark.js.map +1 -0
- package/dist/ink-ui/themes/github-light.d.ts +8 -0
- package/dist/ink-ui/themes/github-light.d.ts.map +1 -0
- package/dist/ink-ui/themes/github-light.js +142 -0
- package/dist/ink-ui/themes/github-light.js.map +1 -0
- package/dist/ink-ui/themes/googlecode.d.ts +8 -0
- package/dist/ink-ui/themes/googlecode.d.ts.map +1 -0
- package/dist/ink-ui/themes/googlecode.js +139 -0
- package/dist/ink-ui/themes/googlecode.js.map +1 -0
- package/dist/ink-ui/themes/no-color.d.ts +8 -0
- package/dist/ink-ui/themes/no-color.d.ts.map +1 -0
- package/dist/ink-ui/themes/no-color.js +118 -0
- package/dist/ink-ui/themes/no-color.js.map +1 -0
- package/dist/ink-ui/themes/semantic-tokens.d.ts +40 -0
- package/dist/ink-ui/themes/semantic-tokens.d.ts.map +1 -0
- package/dist/ink-ui/themes/semantic-tokens.js +100 -0
- package/dist/ink-ui/themes/semantic-tokens.js.map +1 -0
- package/dist/ink-ui/themes/shades-of-purple.d.ts +12 -0
- package/dist/ink-ui/themes/shades-of-purple.d.ts.map +1 -0
- package/dist/ink-ui/themes/shades-of-purple.js +306 -0
- package/dist/ink-ui/themes/shades-of-purple.js.map +1 -0
- package/dist/ink-ui/themes/theme-manager.d.ts +67 -0
- package/dist/ink-ui/themes/theme-manager.d.ts.map +1 -0
- package/dist/ink-ui/themes/theme-manager.js +263 -0
- package/dist/ink-ui/themes/theme-manager.js.map +1 -0
- package/dist/ink-ui/themes/theme.d.ts +134 -0
- package/dist/ink-ui/themes/theme.d.ts.map +1 -0
- package/dist/ink-ui/themes/theme.js +390 -0
- package/dist/ink-ui/themes/theme.js.map +1 -0
- package/dist/ink-ui/themes/xcode.d.ts +8 -0
- package/dist/ink-ui/themes/xcode.d.ts.map +1 -0
- package/dist/ink-ui/themes/xcode.js +147 -0
- package/dist/ink-ui/themes/xcode.js.map +1 -0
- package/dist/ink-ui/types.d.ts +306 -0
- package/dist/ink-ui/types.d.ts.map +1 -0
- package/dist/ink-ui/types.js +65 -0
- package/dist/ink-ui/types.js.map +1 -0
- package/dist/ink-ui/utils/input.d.ts +18 -0
- package/dist/ink-ui/utils/input.d.ts.map +1 -0
- package/dist/ink-ui/utils/input.js +51 -0
- package/dist/ink-ui/utils/input.js.map +1 -0
- package/dist/ink-ui/utils/mouse.d.ts +33 -0
- package/dist/ink-ui/utils/mouse.d.ts.map +1 -0
- package/dist/ink-ui/utils/mouse.js +182 -0
- package/dist/ink-ui/utils/mouse.js.map +1 -0
- package/dist/services/BuiltinCommandLoader.d.ts +21 -0
- package/dist/services/BuiltinCommandLoader.d.ts.map +1 -0
- package/dist/services/BuiltinCommandLoader.js +182 -0
- package/dist/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/services/CommandService.d.ts +39 -0
- package/dist/services/CommandService.d.ts.map +1 -0
- package/dist/services/CommandService.js +49 -0
- package/dist/services/CommandService.js.map +1 -0
- package/dist/services/FileCommandLoader.d.ts +16 -0
- package/dist/services/FileCommandLoader.d.ts.map +1 -0
- package/dist/services/FileCommandLoader.js +19 -0
- package/dist/services/FileCommandLoader.js.map +1 -0
- package/dist/services/McpPromptLoader.d.ts +16 -0
- package/dist/services/McpPromptLoader.d.ts.map +1 -0
- package/dist/services/McpPromptLoader.js +19 -0
- package/dist/services/McpPromptLoader.js.map +1 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +8 -0
- package/dist/services/index.js.map +1 -0
- package/dist/ui/ChalkMenuRenderer.d.ts +22 -0
- package/dist/ui/ChalkMenuRenderer.d.ts.map +1 -0
- package/dist/ui/ChalkMenuRenderer.js +478 -0
- package/dist/ui/ChalkMenuRenderer.js.map +1 -0
- package/dist/ui/ChalkModelPicker.d.ts +20 -0
- package/dist/ui/ChalkModelPicker.d.ts.map +1 -0
- package/dist/ui/ChalkModelPicker.js +363 -0
- package/dist/ui/ChalkModelPicker.js.map +1 -0
- package/dist/ui/ChalkThemePicker.d.ts +20 -0
- package/dist/ui/ChalkThemePicker.d.ts.map +1 -0
- package/dist/ui/ChalkThemePicker.js +370 -0
- package/dist/ui/ChalkThemePicker.js.map +1 -0
- package/dist/ui/InkApprovalDialog.d.ts +8 -0
- package/dist/ui/InkApprovalDialog.d.ts.map +1 -0
- package/dist/ui/InkApprovalDialog.js +25 -0
- package/dist/ui/InkApprovalDialog.js.map +1 -0
- package/dist/ui/InkCommandPalette.d.ts +43 -0
- package/dist/ui/InkCommandPalette.d.ts.map +1 -0
- package/dist/ui/InkCommandPalette.js +105 -0
- package/dist/ui/InkCommandPalette.js.map +1 -0
- package/dist/ui/InkConfigMenu.d.ts +24 -0
- package/dist/ui/InkConfigMenu.d.ts.map +1 -0
- package/dist/ui/InkConfigMenu.js +259 -0
- package/dist/ui/InkConfigMenu.js.map +1 -0
- package/dist/ui/InkHelp.d.ts +25 -0
- package/dist/ui/InkHelp.d.ts.map +1 -0
- package/dist/ui/InkHelp.js +55 -0
- package/dist/ui/InkHelp.js.map +1 -0
- package/dist/ui/InkMenuPicker.d.ts +19 -0
- package/dist/ui/InkMenuPicker.d.ts.map +1 -0
- package/dist/ui/InkMenuPicker.js +33 -0
- package/dist/ui/InkMenuPicker.js.map +1 -0
- package/dist/ui/InkModelPicker.d.ts +23 -0
- package/dist/ui/InkModelPicker.d.ts.map +1 -0
- package/dist/ui/InkModelPicker.js +53 -0
- package/dist/ui/InkModelPicker.js.map +1 -0
- package/dist/ui/PersistentInput.d.ts +91 -0
- package/dist/ui/PersistentInput.d.ts.map +1 -0
- package/dist/ui/PersistentInput.js +283 -0
- package/dist/ui/PersistentInput.js.map +1 -0
- package/dist/ui/RawInput.d.ts +27 -0
- package/dist/ui/RawInput.d.ts.map +1 -0
- package/dist/ui/RawInput.js +731 -0
- package/dist/ui/RawInput.js.map +1 -0
- package/dist/ui/SlashCommandAutocomplete.d.ts +94 -0
- package/dist/ui/SlashCommandAutocomplete.d.ts.map +1 -0
- package/dist/ui/SlashCommandAutocomplete.js +274 -0
- package/dist/ui/SlashCommandAutocomplete.js.map +1 -0
- package/dist/ui/SplashScreen.d.ts +76 -0
- package/dist/ui/SplashScreen.d.ts.map +1 -0
- package/dist/ui/SplashScreen.js +316 -0
- package/dist/ui/SplashScreen.js.map +1 -0
- package/dist/ui/components/ArtifactDashboard.d.ts +16 -0
- package/dist/ui/components/ArtifactDashboard.d.ts.map +1 -0
- package/dist/ui/components/ArtifactDashboard.js +102 -0
- package/dist/ui/components/ArtifactDashboard.js.map +1 -0
- package/dist/ui/components/ChatInput.d.ts +36 -0
- package/dist/ui/components/ChatInput.d.ts.map +1 -0
- package/dist/ui/components/ChatInput.js +11 -0
- package/dist/ui/components/ChatInput.js.map +1 -0
- package/dist/ui/components/ConfigWizard.d.ts +17 -0
- package/dist/ui/components/ConfigWizard.d.ts.map +1 -0
- package/dist/ui/components/ConfigWizard.js +134 -0
- package/dist/ui/components/ConfigWizard.js.map +1 -0
- package/dist/ui/components/ContextViewer.d.ts +18 -0
- package/dist/ui/components/ContextViewer.d.ts.map +1 -0
- package/dist/ui/components/ContextViewer.js +85 -0
- package/dist/ui/components/ContextViewer.js.map +1 -0
- package/dist/ui/components/MiddlewareDashboard.d.ts +16 -0
- package/dist/ui/components/MiddlewareDashboard.d.ts.map +1 -0
- package/dist/ui/components/MiddlewareDashboard.js +98 -0
- package/dist/ui/components/MiddlewareDashboard.js.map +1 -0
- package/dist/ui/components/ModelPicker.d.ts +24 -0
- package/dist/ui/components/ModelPicker.d.ts.map +1 -0
- package/dist/ui/components/ModelPicker.js +96 -0
- package/dist/ui/components/ModelPicker.js.map +1 -0
- package/dist/ui/components/MultiLineInput.d.ts +27 -0
- package/dist/ui/components/MultiLineInput.d.ts.map +1 -0
- package/dist/ui/components/MultiLineInput.js +182 -0
- package/dist/ui/components/MultiLineInput.js.map +1 -0
- package/dist/ui/components/PermissionsBrowser.d.ts +16 -0
- package/dist/ui/components/PermissionsBrowser.d.ts.map +1 -0
- package/dist/ui/components/PermissionsBrowser.js +110 -0
- package/dist/ui/components/PermissionsBrowser.js.map +1 -0
- package/dist/ui/components/SessionBrowser.d.ts +19 -0
- package/dist/ui/components/SessionBrowser.d.ts.map +1 -0
- package/dist/ui/components/SessionBrowser.js +66 -0
- package/dist/ui/components/SessionBrowser.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +32 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +27 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/SystemMessageBrowser.d.ts +11 -0
- package/dist/ui/components/SystemMessageBrowser.d.ts.map +1 -0
- package/dist/ui/components/SystemMessageBrowser.js +106 -0
- package/dist/ui/components/SystemMessageBrowser.js.map +1 -0
- package/dist/ui/components/ThemePicker.d.ts +11 -0
- package/dist/ui/components/ThemePicker.d.ts.map +1 -0
- package/dist/ui/components/ThemePicker.js +62 -0
- package/dist/ui/components/ThemePicker.js.map +1 -0
- package/dist/ui/components/TmuxBrowser.d.ts +11 -0
- package/dist/ui/components/TmuxBrowser.d.ts.map +1 -0
- package/dist/ui/components/TmuxBrowser.js +85 -0
- package/dist/ui/components/TmuxBrowser.js.map +1 -0
- package/dist/ui/components/index.d.ts +22 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +21 -0
- package/dist/ui/components/index.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { Colors } from '@nexus-cortex/cli/dist/themes/colors.js';
|
|
4
|
+
import { ToolCallStatus } from '../cortex-types.js';
|
|
5
|
+
import { DiffPreview, InlineDiffSummary, UnifiedDiffDisplay } from './DiffPreview.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get icon for tool type
|
|
8
|
+
*/
|
|
9
|
+
function getToolIcon(toolName) {
|
|
10
|
+
const iconMap = {
|
|
11
|
+
// File operations
|
|
12
|
+
Read: '',
|
|
13
|
+
Write: '',
|
|
14
|
+
Edit: '✏',
|
|
15
|
+
Glob: '',
|
|
16
|
+
Grep: '',
|
|
17
|
+
// Shell
|
|
18
|
+
Bash: '',
|
|
19
|
+
BashOutput: '',
|
|
20
|
+
KillShell: '',
|
|
21
|
+
// Web
|
|
22
|
+
WebFetch: '',
|
|
23
|
+
WebSearch: '',
|
|
24
|
+
// Tasks
|
|
25
|
+
Task: '',
|
|
26
|
+
TodoWrite: '',
|
|
27
|
+
// Planning
|
|
28
|
+
AskUserQuestion: '❓',
|
|
29
|
+
ExitPlanMode: '',
|
|
30
|
+
EnterPlanMode: '',
|
|
31
|
+
// Session
|
|
32
|
+
SearchConversationHistory: '',
|
|
33
|
+
ListSessions: '',
|
|
34
|
+
LoadSession: '',
|
|
35
|
+
// MCP
|
|
36
|
+
InitMcpConfig: '',
|
|
37
|
+
EnableMcpServer: '',
|
|
38
|
+
DisableMcpServer: '',
|
|
39
|
+
// Notebooks
|
|
40
|
+
NotebookEdit: '',
|
|
41
|
+
};
|
|
42
|
+
return iconMap[toolName] ?? '';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get status color
|
|
46
|
+
*/
|
|
47
|
+
function getStatusColor(status) {
|
|
48
|
+
switch (status) {
|
|
49
|
+
case ToolCallStatus.Pending:
|
|
50
|
+
return Colors.AccentYellow;
|
|
51
|
+
case ToolCallStatus.Executing:
|
|
52
|
+
return Colors.AccentCyan;
|
|
53
|
+
case ToolCallStatus.Success:
|
|
54
|
+
return Colors.AccentGreen;
|
|
55
|
+
case ToolCallStatus.Error:
|
|
56
|
+
return Colors.AccentRed;
|
|
57
|
+
case ToolCallStatus.Canceled:
|
|
58
|
+
return Colors.Gray;
|
|
59
|
+
case ToolCallStatus.Confirming:
|
|
60
|
+
return Colors.AccentYellow;
|
|
61
|
+
default:
|
|
62
|
+
return Colors.White;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get status icon
|
|
67
|
+
*/
|
|
68
|
+
function getStatusIcon(status) {
|
|
69
|
+
switch (status) {
|
|
70
|
+
case ToolCallStatus.Pending:
|
|
71
|
+
return '○';
|
|
72
|
+
case ToolCallStatus.Executing:
|
|
73
|
+
return '●';
|
|
74
|
+
case ToolCallStatus.Success:
|
|
75
|
+
return '✓';
|
|
76
|
+
case ToolCallStatus.Error:
|
|
77
|
+
return '✗';
|
|
78
|
+
case ToolCallStatus.Canceled:
|
|
79
|
+
return '⊘';
|
|
80
|
+
case ToolCallStatus.Confirming:
|
|
81
|
+
return '?';
|
|
82
|
+
default:
|
|
83
|
+
return '•';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Format tool input for display
|
|
88
|
+
*/
|
|
89
|
+
function formatToolInput(toolName, args) {
|
|
90
|
+
switch (toolName) {
|
|
91
|
+
case 'Read':
|
|
92
|
+
const readFilename = args.file_path?.split('/').pop() || args.file_path;
|
|
93
|
+
const readPath = args.file_path?.slice(0, -(readFilename?.length || 0) - 1) || '';
|
|
94
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [readPath && _jsxs(Text, { dimColor: true, children: [readPath, "/"] }), _jsx(Text, { color: Colors.AccentBlue, children: readFilename })] }), (args.offset || args.limit) && (_jsxs(Text, { dimColor: true, children: ["Lines ", args.offset || 1, "-", (args.offset || 1) + (args.limit || 100) - 1] }))] }));
|
|
95
|
+
case 'Write':
|
|
96
|
+
const writeFilename = args.file_path?.split('/').pop() || args.file_path;
|
|
97
|
+
const writePath = args.file_path?.slice(0, -(writeFilename?.length || 0) - 1) || '';
|
|
98
|
+
const writeContent = args.content || '';
|
|
99
|
+
const writeLines = writeContent.split('\n');
|
|
100
|
+
const previewLines = writeLines.slice(0, 3);
|
|
101
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [writePath && _jsxs(Text, { dimColor: true, children: [writePath, "/"] }), _jsx(Text, { color: Colors.AccentGreen, children: writeFilename }), _jsxs(Text, { dimColor: true, children: [" (", writeLines.length, " lines)"] })] }), previewLines.length > 0 && (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [previewLines.map((line, i) => (_jsx(Text, { dimColor: true, wrap: "truncate", children: truncate(line, 50) }, i))), writeLines.length > 3 && _jsx(Text, { dimColor: true, children: "..." })] }))] }));
|
|
102
|
+
case 'Glob':
|
|
103
|
+
return (_jsxs(Text, { dimColor: true, children: [args.pattern, args.path && ` in ${args.path}`] }));
|
|
104
|
+
case 'Grep':
|
|
105
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { dimColor: true, children: ["/", args.pattern, "/"] }), args.path && _jsxs(Text, { dimColor: true, children: ["in ", args.path] }), args.glob && _jsxs(Text, { dimColor: true, children: ["files: ", args.glob] })] }));
|
|
106
|
+
case 'Bash':
|
|
107
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: Colors.AccentCyan, children: ["$ ", truncateCommand(args.command, 60)] }), args.description && _jsx(Text, { dimColor: true, children: args.description })] }));
|
|
108
|
+
case 'WebFetch':
|
|
109
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: args.url }), args.prompt && _jsxs(Text, { dimColor: true, italic: true, children: ["\"", truncate(args.prompt, 40), "\""] })] }));
|
|
110
|
+
case 'WebSearch':
|
|
111
|
+
return _jsxs(Text, { dimColor: true, children: ["\"", args.query, "\""] });
|
|
112
|
+
case 'Task':
|
|
113
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { dimColor: true, children: ["Agent: ", args.subagent_type || 'general'] }), args.description && _jsx(Text, { dimColor: true, children: args.description })] }));
|
|
114
|
+
case 'TodoWrite':
|
|
115
|
+
const todos = args.todos;
|
|
116
|
+
if (todos && todos.length > 0) {
|
|
117
|
+
return (_jsx(Box, { flexDirection: "column", children: _jsxs(Text, { dimColor: true, children: [todos.length, " task(s)"] }) }));
|
|
118
|
+
}
|
|
119
|
+
return _jsx(Text, { dimColor: true, children: "Update tasks" });
|
|
120
|
+
case 'AskUserQuestion':
|
|
121
|
+
const questions = args.questions;
|
|
122
|
+
const firstQuestion = questions?.[0];
|
|
123
|
+
if (firstQuestion) {
|
|
124
|
+
return _jsxs(Text, { dimColor: true, children: ["\"", truncate(firstQuestion.question, 50), "\""] });
|
|
125
|
+
}
|
|
126
|
+
return _jsx(Text, { dimColor: true, children: "Asking user..." });
|
|
127
|
+
default:
|
|
128
|
+
// Generic: show first few key-value pairs
|
|
129
|
+
const entries = Object.entries(args).slice(0, 3);
|
|
130
|
+
if (entries.length === 0) {
|
|
131
|
+
return _jsx(Text, { dimColor: true, children: "(no args)" });
|
|
132
|
+
}
|
|
133
|
+
return (_jsxs(Box, { flexDirection: "column", children: [entries.map(([key, value]) => (_jsxs(Text, { dimColor: true, children: [key, ": ", truncate(String(value), 40)] }, key))), Object.keys(args).length > 3 && (_jsxs(Text, { dimColor: true, children: ["... +", Object.keys(args).length - 3, " more"] }))] }));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Truncate string
|
|
138
|
+
*/
|
|
139
|
+
function truncate(str, maxLength) {
|
|
140
|
+
if (str.length <= maxLength)
|
|
141
|
+
return str;
|
|
142
|
+
return str.slice(0, maxLength - 3) + '...';
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Format Bash output with syntax highlighting
|
|
146
|
+
*/
|
|
147
|
+
function formatBashOutput(output) {
|
|
148
|
+
const lines = output.split('\n');
|
|
149
|
+
const totalLines = lines.length;
|
|
150
|
+
const maxLines = 15;
|
|
151
|
+
const displayLines = lines.slice(0, maxLines);
|
|
152
|
+
/**
|
|
153
|
+
* Classify a line for coloring
|
|
154
|
+
*/
|
|
155
|
+
function classifyLine(line) {
|
|
156
|
+
const lower = line.toLowerCase();
|
|
157
|
+
// Errors
|
|
158
|
+
if (lower.includes('error') || lower.includes('failed') ||
|
|
159
|
+
lower.includes('fatal') || lower.includes('exception') ||
|
|
160
|
+
lower.startsWith('e ') || line.startsWith('✗')) {
|
|
161
|
+
return 'error';
|
|
162
|
+
}
|
|
163
|
+
// Warnings
|
|
164
|
+
if (lower.includes('warning') || lower.includes('warn') ||
|
|
165
|
+
lower.includes('deprecated') || line.startsWith('⚠')) {
|
|
166
|
+
return 'warning';
|
|
167
|
+
}
|
|
168
|
+
// Success
|
|
169
|
+
if (lower.includes('success') || lower.includes('passed') ||
|
|
170
|
+
lower.includes('done') || lower.includes('completed') ||
|
|
171
|
+
line.startsWith('✓') || line.startsWith('✔')) {
|
|
172
|
+
return 'success';
|
|
173
|
+
}
|
|
174
|
+
// Info (headers, separators)
|
|
175
|
+
if (line.startsWith('>') || line.startsWith('$') ||
|
|
176
|
+
line.match(/^[=\-─]{3,}/) || line.match(/^\s*\d+\s+(passing|failing)/)) {
|
|
177
|
+
return 'info';
|
|
178
|
+
}
|
|
179
|
+
return 'normal';
|
|
180
|
+
}
|
|
181
|
+
return (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: Colors.Gray, paddingX: 1, flexDirection: "column", children: displayLines.map((line, i) => {
|
|
182
|
+
const lineType = classifyLine(line);
|
|
183
|
+
const color = lineType === 'error' ? Colors.AccentRed
|
|
184
|
+
: lineType === 'warning' ? Colors.AccentYellow
|
|
185
|
+
: lineType === 'success' ? Colors.AccentGreen
|
|
186
|
+
: lineType === 'info' ? Colors.AccentCyan
|
|
187
|
+
: undefined;
|
|
188
|
+
return (_jsx(Text, { color: color, dimColor: !color, wrap: "truncate", children: line || ' ' }, i));
|
|
189
|
+
}) }), totalLines > maxLines && (_jsxs(Text, { dimColor: true, children: [" ... (", totalLines - maxLines, " more lines)"] }))] }));
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Truncate command, preserving important parts
|
|
193
|
+
*/
|
|
194
|
+
function truncateCommand(cmd, maxLength) {
|
|
195
|
+
if (cmd.length <= maxLength)
|
|
196
|
+
return cmd;
|
|
197
|
+
// Try to show the command name and some args
|
|
198
|
+
const parts = cmd.split(' ');
|
|
199
|
+
const command = parts[0] || '';
|
|
200
|
+
if (command.length >= maxLength - 3) {
|
|
201
|
+
return truncate(cmd, maxLength);
|
|
202
|
+
}
|
|
203
|
+
const remaining = maxLength - command.length - 4; // 4 for " ..."
|
|
204
|
+
const args = parts.slice(1).join(' ');
|
|
205
|
+
if (args.length <= remaining) {
|
|
206
|
+
return cmd;
|
|
207
|
+
}
|
|
208
|
+
return command + ' ' + args.slice(0, remaining) + '...';
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Format tool result for display
|
|
212
|
+
*/
|
|
213
|
+
function formatToolResult(toolName, result) {
|
|
214
|
+
if (!result)
|
|
215
|
+
return null;
|
|
216
|
+
if (result.isError || result.error) {
|
|
217
|
+
return (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: Colors.AccentRed, children: ["Error: ", truncate(result.error || 'Unknown error', 60)] }) }));
|
|
218
|
+
}
|
|
219
|
+
if (!result.output)
|
|
220
|
+
return null;
|
|
221
|
+
// Tool-specific result formatting
|
|
222
|
+
switch (toolName) {
|
|
223
|
+
case 'Glob':
|
|
224
|
+
const files = result.output.split('\n').filter(Boolean);
|
|
225
|
+
return (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { dimColor: true, children: [files.length, " file(s) found"] }), files.slice(0, 5).map((file, i) => (_jsxs(Text, { dimColor: true, children: [" ", file] }, i))), files.length > 5 && _jsxs(Text, { dimColor: true, children: [" ... +", files.length - 5, " more"] })] }));
|
|
226
|
+
case 'Grep':
|
|
227
|
+
const matches = result.output.split('\n').filter(Boolean);
|
|
228
|
+
return (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: [matches.length, " match(es)"] }) }));
|
|
229
|
+
case 'Bash':
|
|
230
|
+
case 'BashOutput':
|
|
231
|
+
return formatBashOutput(result.output);
|
|
232
|
+
default:
|
|
233
|
+
return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate", children: truncate(result.output, 100) }) }));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Main ToolCallDisplay component
|
|
238
|
+
*/
|
|
239
|
+
export const ToolCallDisplay = ({ toolCall, terminalWidth = 80, compact = false, inputArgs, }) => {
|
|
240
|
+
const icon = getToolIcon(toolCall.name);
|
|
241
|
+
const statusIcon = getStatusIcon(toolCall.status);
|
|
242
|
+
const statusColor = getStatusColor(toolCall.status);
|
|
243
|
+
// Special case for Edit tool - show diff preview or result
|
|
244
|
+
if (toolCall.name === 'Edit') {
|
|
245
|
+
const filePath = inputArgs?.file_path || toolCall.resultDisplay?.metadata?.fileStats?.path || 'unknown';
|
|
246
|
+
const hasDiffResult = toolCall.resultDisplay?.metadata?.diff;
|
|
247
|
+
const isComplete = toolCall.status === ToolCallStatus.Success;
|
|
248
|
+
const isError = toolCall.status === ToolCallStatus.Error;
|
|
249
|
+
// If we have a completed diff result, show that instead of the input preview
|
|
250
|
+
if (hasDiffResult && isComplete) {
|
|
251
|
+
if (compact) {
|
|
252
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsx(UnifiedDiffDisplay, { diffString: toolCall.resultDisplay.metadata.diff, filePath: filePath, terminalWidth: terminalWidth, compact: true, fileStats: toolCall.resultDisplay?.metadata?.fileStats })] }));
|
|
253
|
+
}
|
|
254
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { children: [icon, " "] }), _jsx(Text, { bold: true, children: "Edit" }), _jsx(Text, { dimColor: true, children: " [Completed]" })] }), _jsx(UnifiedDiffDisplay, { diffString: toolCall.resultDisplay.metadata.diff, filePath: filePath, terminalWidth: terminalWidth, compact: false, fileStats: toolCall.resultDisplay?.metadata?.fileStats })] }));
|
|
255
|
+
}
|
|
256
|
+
// If error, show error message
|
|
257
|
+
if (isError && toolCall.resultDisplay?.error) {
|
|
258
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { children: [icon, " "] }), _jsx(Text, { bold: true, children: "Edit" }), _jsx(Text, { dimColor: true, children: " [Error]" })] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: Colors.AccentRed, children: ["Error: ", truncate(toolCall.resultDisplay.error, 200)] }) })] }));
|
|
259
|
+
}
|
|
260
|
+
// Show input preview while executing or if no result yet
|
|
261
|
+
if (inputArgs?.old_string && inputArgs?.new_string) {
|
|
262
|
+
if (compact) {
|
|
263
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsx(InlineDiffSummary, { filePath: filePath, oldString: inputArgs.old_string, newString: inputArgs.new_string })] }));
|
|
264
|
+
}
|
|
265
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { children: [icon, " "] }), _jsx(Text, { bold: true, children: "Edit" }), toolCall.status === ToolCallStatus.Executing && (_jsx(Text, { dimColor: true, children: " [Executing...]" }))] }), _jsx(DiffPreview, { filePath: filePath, oldString: inputArgs.old_string, newString: inputArgs.new_string, terminalWidth: terminalWidth, compact: false })] }));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Compact mode
|
|
269
|
+
if (compact) {
|
|
270
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { children: [icon, " "] }), _jsx(Text, { bold: true, children: toolCall.name }), toolCall.description && (_jsxs(Text, { dimColor: true, children: [" - ", truncate(toolCall.description, 40)] }))] }));
|
|
271
|
+
}
|
|
272
|
+
// Full display
|
|
273
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: Colors.Gray, paddingX: 1, marginY: 1, width: Math.min(terminalWidth - 4, 80), children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { children: [icon, " "] }), _jsx(Text, { bold: true, children: toolCall.name }), _jsxs(Text, { dimColor: true, children: [" [", toolCall.status, "]"] })] }), toolCall.description && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: toolCall.description }) })), inputArgs && (_jsx(Box, { marginTop: 1, flexDirection: "column", children: formatToolInput(toolCall.name, inputArgs) })), toolCall.resultDisplay && formatToolResult(toolCall.name, toolCall.resultDisplay)] }));
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Tool group display - shows multiple tool calls
|
|
277
|
+
*/
|
|
278
|
+
export const ToolGroupDisplay = ({ tools, terminalWidth = 80, inputArgsMap }) => {
|
|
279
|
+
if (tools.length === 0)
|
|
280
|
+
return null;
|
|
281
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { dimColor: true, bold: true, children: ["Tool Calls (", tools.length, ")"] }), tools.map((tool) => (_jsx(ToolCallDisplay, { toolCall: tool, terminalWidth: terminalWidth, compact: tools.length > 3, inputArgs: inputArgsMap?.get(tool.callId) }, tool.callId)))] }));
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Get a brief summary of tool input for inline display
|
|
285
|
+
*/
|
|
286
|
+
function getToolInputSummary(toolName, args) {
|
|
287
|
+
switch (toolName) {
|
|
288
|
+
case 'Read':
|
|
289
|
+
return args.file_path || 'file';
|
|
290
|
+
case 'Write':
|
|
291
|
+
return args.file_path || 'file';
|
|
292
|
+
case 'Edit':
|
|
293
|
+
return args.file_path || 'file';
|
|
294
|
+
case 'Glob':
|
|
295
|
+
return args.pattern || 'pattern';
|
|
296
|
+
case 'Grep':
|
|
297
|
+
return args.pattern || 'pattern';
|
|
298
|
+
case 'Bash':
|
|
299
|
+
const cmd = args.command || '';
|
|
300
|
+
// Get first word of command
|
|
301
|
+
const firstWord = cmd.split(' ')[0] || 'command';
|
|
302
|
+
return truncate(firstWord + (cmd.includes(' ') ? '...' : ''), 30);
|
|
303
|
+
case 'WebFetch':
|
|
304
|
+
return truncate(args.url || 'url', 40);
|
|
305
|
+
case 'WebSearch':
|
|
306
|
+
return `"${truncate(args.query || '', 30)}"`;
|
|
307
|
+
case 'Task':
|
|
308
|
+
return args.description || args.subagent_type || 'task';
|
|
309
|
+
case 'TodoWrite':
|
|
310
|
+
const todos = args.todos;
|
|
311
|
+
return `${todos?.length || 0} task(s)`;
|
|
312
|
+
default:
|
|
313
|
+
// Return first string arg or empty
|
|
314
|
+
const firstArg = Object.values(args).find(v => typeof v === 'string');
|
|
315
|
+
return firstArg ? truncate(String(firstArg), 30) : '';
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Get brief result summary for inline display
|
|
320
|
+
*/
|
|
321
|
+
function getToolResultSummary(toolName, result) {
|
|
322
|
+
if (!result)
|
|
323
|
+
return '';
|
|
324
|
+
if (result.isError || result.error) {
|
|
325
|
+
return `Error: ${truncate(result.error || 'failed', 30)}`;
|
|
326
|
+
}
|
|
327
|
+
if (!result.output)
|
|
328
|
+
return 'Done';
|
|
329
|
+
switch (toolName) {
|
|
330
|
+
case 'Read':
|
|
331
|
+
const lines = result.output.split('\n').length;
|
|
332
|
+
return `Read ${lines} lines`;
|
|
333
|
+
case 'Write':
|
|
334
|
+
return 'Written';
|
|
335
|
+
case 'Edit':
|
|
336
|
+
return 'Updated';
|
|
337
|
+
case 'Glob':
|
|
338
|
+
const files = result.output.split('\n').filter(Boolean).length;
|
|
339
|
+
return `${files} file(s)`;
|
|
340
|
+
case 'Grep':
|
|
341
|
+
const matches = result.output.split('\n').filter(Boolean).length;
|
|
342
|
+
return `${matches} match(es)`;
|
|
343
|
+
case 'Bash':
|
|
344
|
+
const outputLines = result.output.split('\n').length;
|
|
345
|
+
return outputLines > 1 ? `${outputLines} lines` : truncate(result.output, 30);
|
|
346
|
+
case 'WebFetch':
|
|
347
|
+
return 'Fetched';
|
|
348
|
+
case 'WebSearch':
|
|
349
|
+
return 'Results';
|
|
350
|
+
case 'Task':
|
|
351
|
+
return 'Completed';
|
|
352
|
+
default:
|
|
353
|
+
return truncate(result.output, 30);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Claude Code style inline tool call
|
|
358
|
+
* Format: ● ToolName(args)
|
|
359
|
+
* ⎿ Result summary
|
|
360
|
+
*/
|
|
361
|
+
export const InlineToolCall = ({ toolCall, inputArgs }) => {
|
|
362
|
+
const statusColor = getStatusColor(toolCall.status);
|
|
363
|
+
const isExecuting = toolCall.status === ToolCallStatus.Executing || toolCall.status === ToolCallStatus.Pending;
|
|
364
|
+
const isError = toolCall.status === ToolCallStatus.Error;
|
|
365
|
+
const inputSummary = inputArgs ? getToolInputSummary(toolCall.name, inputArgs) : '';
|
|
366
|
+
const resultSummary = toolCall.resultDisplay ? getToolResultSummary(toolCall.name, toolCall.resultDisplay) : '';
|
|
367
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: statusColor, children: "\u25CF " }), _jsx(Text, { bold: true, children: toolCall.name }), inputSummary && (_jsxs(Text, { dimColor: true, children: ["(", inputSummary, ")"] })), isExecuting && _jsx(Text, { color: Colors.AccentCyan, children: " ..." })] }), (resultSummary || isError) && (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { color: isError ? Colors.AccentRed : Colors.AccentGreen, children: resultSummary })] }))] }));
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Inline tool group - shows tool calls in message stream style
|
|
371
|
+
*/
|
|
372
|
+
export const InlineToolGroup = ({ tools, inputArgsMap }) => {
|
|
373
|
+
if (tools.length === 0)
|
|
374
|
+
return null;
|
|
375
|
+
return (_jsx(Box, { flexDirection: "column", children: tools.map((tool) => (_jsx(InlineToolCall, { toolCall: tool, inputArgs: inputArgsMap?.get(tool.callId) }, tool.callId))) }));
|
|
376
|
+
};
|
|
377
|
+
export default ToolCallDisplay;
|
|
378
|
+
//# sourceMappingURL=ToolCallDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCallDisplay.js","sourceRoot":"","sources":["../../../src/ink-ui/components/ToolCallDisplay.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,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AC,QAAQ,wBAAG,YAAY,SAAS,CACvC,EACA,WAAW,IAAI,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,qBAAa,IACvD,EAGL,CAAC,aAAa,IAAI,OAAO,CAAC,IAAI,CAC7B,MAAC,GAAG,IAAC,UAAU,EAAE,CAAC,aAChB,KAAC,IAAI,IAAC,QAAQ,+BAAW,EACzB,KAAC,IAAI,IAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,YACzD,aAAa,GACT,IACH,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAGvB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,KAAC,cAAc,IAEb,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,YAAY,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAFpC,IAAI,CAAC,MAAM,CAGhB,CACH,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WritePreview - File content preview component for Write tool results
|
|
3
|
+
*
|
|
4
|
+
* Displays the content of newly created or updated files with line numbers.
|
|
5
|
+
* Used for persisted preview in session history.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Props for WritePreview component
|
|
10
|
+
*/
|
|
11
|
+
export interface WritePreviewProps {
|
|
12
|
+
/** Path to the file that was written */
|
|
13
|
+
filePath: string;
|
|
14
|
+
/** Full file content */
|
|
15
|
+
content: string;
|
|
16
|
+
/** Number of lines in the file */
|
|
17
|
+
lineCount: number;
|
|
18
|
+
/** File size in bytes */
|
|
19
|
+
byteSize: number;
|
|
20
|
+
/** Programming language for syntax hints */
|
|
21
|
+
language?: string;
|
|
22
|
+
/** Maximum lines to display before truncating */
|
|
23
|
+
maxLines?: number;
|
|
24
|
+
/** Whether to show in compact mode */
|
|
25
|
+
compact?: boolean;
|
|
26
|
+
/** Terminal width for proper wrapping */
|
|
27
|
+
terminalWidth?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* WritePreview component - displays file content with line numbers
|
|
31
|
+
*/
|
|
32
|
+
export declare const WritePreview: React.FC<WritePreviewProps>;
|
|
33
|
+
/**
|
|
34
|
+
* Compact inline summary for tool call display
|
|
35
|
+
*/
|
|
36
|
+
export declare const InlineWriteSummary: React.FC<{
|
|
37
|
+
filePath: string;
|
|
38
|
+
lineCount: number;
|
|
39
|
+
byteSize: number;
|
|
40
|
+
}>;
|
|
41
|
+
export default WritePreview;
|
|
42
|
+
//# sourceMappingURL=WritePreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WritePreview.d.ts","sourceRoot":"","sources":["../../../src/ink-ui/components/WritePreview.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAyCvC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA6BD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqEpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAQA,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* WritePreview - File content preview component for Write tool results
|
|
4
|
+
*
|
|
5
|
+
* Displays the content of newly created or updated files with line numbers.
|
|
6
|
+
* Used for persisted preview in session history.
|
|
7
|
+
*/
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import { Box, Text } from 'ink';
|
|
10
|
+
import { Colors } from '@nexus-cortex/cli/dist/themes/colors.js';
|
|
11
|
+
/**
|
|
12
|
+
* Word-wrap text to a specific width, breaking at word boundaries.
|
|
13
|
+
* For code, we try to preserve logical breaks (at operators, commas, etc.)
|
|
14
|
+
*/
|
|
15
|
+
function wrapCodeLine(text, width) {
|
|
16
|
+
if (width <= 0 || !text || text.length <= width)
|
|
17
|
+
return [text];
|
|
18
|
+
const result = [];
|
|
19
|
+
let remaining = text;
|
|
20
|
+
while (remaining.length > width) {
|
|
21
|
+
// Find a good break point
|
|
22
|
+
let breakPoint = width;
|
|
23
|
+
// Look for logical break points (in order of preference)
|
|
24
|
+
const breakChars = [' ', ',', '(', ')', '{', '}', '[', ']', '+', '-', '=', '/', '|', '&'];
|
|
25
|
+
for (const char of breakChars) {
|
|
26
|
+
const lastIndex = remaining.lastIndexOf(char, width);
|
|
27
|
+
if (lastIndex > width * 0.4) {
|
|
28
|
+
// Found a reasonable break point (at least 40% into the line)
|
|
29
|
+
breakPoint = lastIndex + 1;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// If no good break point found, just break at width
|
|
34
|
+
result.push(remaining.slice(0, breakPoint));
|
|
35
|
+
remaining = remaining.slice(breakPoint);
|
|
36
|
+
}
|
|
37
|
+
if (remaining) {
|
|
38
|
+
result.push(remaining);
|
|
39
|
+
}
|
|
40
|
+
return result.length > 0 ? result : [''];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Format bytes to human readable size
|
|
44
|
+
*/
|
|
45
|
+
function formatBytes(bytes) {
|
|
46
|
+
if (bytes < 1024)
|
|
47
|
+
return `${bytes} B`;
|
|
48
|
+
if (bytes < 1024 * 1024)
|
|
49
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
50
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Truncate path for display
|
|
54
|
+
*/
|
|
55
|
+
function truncatePath(path, maxLength) {
|
|
56
|
+
if (path.length <= maxLength)
|
|
57
|
+
return path;
|
|
58
|
+
const parts = path.split('/');
|
|
59
|
+
if (parts.length <= 2)
|
|
60
|
+
return '...' + path.slice(-maxLength + 3);
|
|
61
|
+
const lastTwo = parts.slice(-2).join('/');
|
|
62
|
+
if (lastTwo.length + 4 <= maxLength) {
|
|
63
|
+
return '.../' + lastTwo;
|
|
64
|
+
}
|
|
65
|
+
const lastPart = parts[parts.length - 1] || path;
|
|
66
|
+
return '...' + lastPart.slice(-maxLength + 3);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* WritePreview component - displays file content with line numbers
|
|
70
|
+
*/
|
|
71
|
+
export const WritePreview = ({ filePath, content, lineCount, byteSize, language, maxLines = 50, compact = false, terminalWidth = 80, }) => {
|
|
72
|
+
const lines = useMemo(() => content.split('\n'), [content]);
|
|
73
|
+
const displayLines = useMemo(() => lines.slice(0, maxLines), [lines, maxLines]);
|
|
74
|
+
const truncated = lines.length > maxLines;
|
|
75
|
+
const contentWidth = Math.max(terminalWidth - 8, 40);
|
|
76
|
+
const displayPath = truncatePath(filePath, contentWidth - 10);
|
|
77
|
+
// For compact mode, just show summary
|
|
78
|
+
if (compact) {
|
|
79
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: Colors.AccentGreen, children: "+ " }), _jsx(Text, { color: Colors.White, children: displayPath }), _jsxs(Text, { dimColor: true, children: [" (", lineCount, " lines, ", formatBytes(byteSize), ")"] })] }));
|
|
80
|
+
}
|
|
81
|
+
return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [_jsxs(Box, { children: [_jsx(Text, { color: Colors.AccentGreen, children: "+ Created " }), _jsx(Text, { color: Colors.White, bold: true, children: displayPath }), _jsxs(Text, { dimColor: true, children: [" (", lineCount, " lines, ", formatBytes(byteSize), ")"] }), language && _jsxs(Text, { dimColor: true, children: [" [", language, "]"] })] }), _jsxs(Box, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: [displayLines.map((line, lineIndex) => {
|
|
82
|
+
// Calculate width for code content: total - marginLeft(2) - lineNum(4) - " │ "(3) - some margin
|
|
83
|
+
const lineNumWidth = 7; // " 1 │ "
|
|
84
|
+
const codeWidth = Math.max(contentWidth - lineNumWidth, 30);
|
|
85
|
+
const wrappedLines = wrapCodeLine(line, codeWidth);
|
|
86
|
+
return (_jsx(Box, { flexDirection: "column", children: wrappedLines.map((wrappedLine, wrapIndex) => (_jsxs(Box, { children: [wrapIndex === 0 ? (
|
|
87
|
+
// First line shows the line number
|
|
88
|
+
_jsxs(Text, { dimColor: true, children: [String(lineIndex + 1).padStart(4, ' '), " \u2502 "] })) : (
|
|
89
|
+
// Continuation lines show padding to align with code
|
|
90
|
+
_jsx(Text, { dimColor: true, children: ' │ ' })), _jsx(Text, { children: wrappedLine })] }, wrapIndex))) }, lineIndex));
|
|
91
|
+
}), truncated && (_jsxs(Text, { dimColor: true, children: [" ... ", lines.length - maxLines, " more lines"] }))] })] }));
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Compact inline summary for tool call display
|
|
95
|
+
*/
|
|
96
|
+
export const InlineWriteSummary = ({ filePath, lineCount, byteSize }) => {
|
|
97
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: Colors.AccentGreen, children: "Write " }), _jsx(Text, { dimColor: true, children: truncatePath(filePath, 40) }), _jsxs(Text, { dimColor: true, children: [" (", lineCount, " lines, ", formatBytes(byteSize), ")"] })] }));
|
|
98
|
+
};
|
|
99
|
+
export default WritePreview;
|
|
100
|
+
//# sourceMappingURL=WritePreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WritePreview.js","sourceRoot":"","sources":["../../../src/ink-ui/components/WritePreview.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AAEjE;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAY,EAAE,KAAa;IAC/C,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,OAAO,SAAS,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;QAChC,0BAA0B;QAC1B,IAAI,UAAU,GAAG,KAAK,CAAC;QAEvB,yDAAyD;QACzD,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,G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/
|
|
6
|
+
import { type Config } from '../core-stubs.js';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export declare const BACKSLASH_ENTER_TIMEOUT = 5;
|
|
9
|
+
export declare const ESC_TIMEOUT = 50;
|
|
10
|
+
export declare const PASTE_TIMEOUT = 30000;
|
|
11
|
+
export interface Key {
|
|
12
|
+
name: string;
|
|
13
|
+
ctrl: boolean;
|
|
14
|
+
meta: boolean;
|
|
15
|
+
shift: boolean;
|
|
16
|
+
paste: boolean;
|
|
17
|
+
insertable: boolean;
|
|
18
|
+
sequence: string;
|
|
19
|
+
}
|
|
20
|
+
export type KeypressHandler = (key: Key) => void;
|
|
21
|
+
interface KeypressContextValue {
|
|
22
|
+
subscribe: (handler: KeypressHandler) => void;
|
|
23
|
+
unsubscribe: (handler: KeypressHandler) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useKeypressContext(): KeypressContextValue;
|
|
26
|
+
export declare function KeypressProvider({ children, config, debugKeystrokeLogging, }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
config?: Config;
|
|
29
|
+
debugKeystrokeLogging?: boolean;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=KeypressContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeypressContext.d.ts","sourceRoot":"","sources":["../../../src/ink-ui/contexts/KeypressContext.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAMN,MAAM,OAAO,CAAC;AAOf,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,aAAa,QAAS,CAAC;AA0fpC,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;AAEjD,UAAU,oBAAoB;IAC5B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CACjD;AAMD,wBAAgB,kBAAkB,yBAQjC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,qBAAqB,GACtB,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,2CAsDA"}
|