@aria-cli/cli 1.0.56 → 1.0.58
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/bin/aria.mjs +2 -2
- package/package.json +17 -76
- package/dist/.tsbuildinfo +0 -1
- package/dist/attached-local-control-client.js +0 -826
- package/dist/attached-local-control-client.js.map +0 -1
- package/dist/bootstrap-local-control-client.js +0 -2
- package/dist/bootstrap-local-control-client.js.map +0 -1
- package/dist/capability-aware-method-proxy.js +0 -42
- package/dist/capability-aware-method-proxy.js.map +0 -1
- package/dist/cli-context.js +0 -160
- package/dist/cli-context.js.map +0 -1
- package/dist/commands/arions.js +0 -174
- package/dist/commands/arions.js.map +0 -1
- package/dist/commands/auth.js +0 -123
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/daemon.js +0 -367
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/definitions.js +0 -176
- package/dist/commands/definitions.js.map +0 -1
- package/dist/commands/index.js +0 -80
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/login-handler.js +0 -1108
- package/dist/commands/login-handler.js.map +0 -1
- package/dist/commands/logout-handler.js +0 -92
- package/dist/commands/logout-handler.js.map +0 -1
- package/dist/commands/memory-handlers.js +0 -89
- package/dist/commands/memory-handlers.js.map +0 -1
- package/dist/commands/pairing.js +0 -60
- package/dist/commands/pairing.js.map +0 -1
- package/dist/commands/runtime-cutover-reset-command.js +0 -12
- package/dist/commands/runtime-cutover-reset-command.js.map +0 -1
- package/dist/commands/runtime-cutover-reset.js +0 -265
- package/dist/commands/runtime-cutover-reset.js.map +0 -1
- package/dist/commands/terminal-setup.js +0 -84
- package/dist/commands/terminal-setup.js.map +0 -1
- package/dist/config/aria-config.js +0 -238
- package/dist/config/aria-config.js.map +0 -1
- package/dist/config/index.js +0 -3
- package/dist/config/index.js.map +0 -1
- package/dist/config/loader.js +0 -97
- package/dist/config/loader.js.map +0 -1
- package/dist/config.js +0 -142
- package/dist/config.js.map +0 -1
- package/dist/daemon-info.js +0 -10
- package/dist/daemon-info.js.map +0 -1
- package/dist/ensure-daemon.js +0 -128
- package/dist/ensure-daemon.js.map +0 -1
- package/dist/entrypoints/command-mode.js +0 -5
- package/dist/entrypoints/command-mode.js.map +0 -1
- package/dist/entrypoints/daemon.js +0 -50
- package/dist/entrypoints/daemon.js.map +0 -1
- package/dist/entrypoints/headless-stdio.js +0 -25
- package/dist/entrypoints/headless-stdio.js.map +0 -1
- package/dist/entrypoints/interactive.d.ts.map +0 -1
- package/dist/entrypoints/interactive.js +0 -80
- package/dist/entrypoints/interactive.js.map +0 -1
- package/dist/event-loop-watchdog.js +0 -73
- package/dist/event-loop-watchdog.js.map +0 -1
- package/dist/headless/auth-orchestrator.js +0 -508
- package/dist/headless/auth-orchestrator.js.map +0 -1
- package/dist/headless/auth-service.js +0 -43
- package/dist/headless/auth-service.js.map +0 -1
- package/dist/headless/bootstrap-fast-path.js +0 -112
- package/dist/headless/bootstrap-fast-path.js.map +0 -1
- package/dist/headless/call-command.js +0 -143
- package/dist/headless/call-command.js.map +0 -1
- package/dist/headless/daemon-service.js +0 -318
- package/dist/headless/daemon-service.js.map +0 -1
- package/dist/headless/hook-actions.js +0 -235
- package/dist/headless/hook-actions.js.map +0 -1
- package/dist/headless/hook-service.js +0 -42
- package/dist/headless/hook-service.js.map +0 -1
- package/dist/headless/kernel-services.js +0 -216
- package/dist/headless/kernel-services.js.map +0 -1
- package/dist/headless/kernel.js +0 -785
- package/dist/headless/kernel.js.map +0 -1
- package/dist/headless/operations/arion.js +0 -119
- package/dist/headless/operations/arion.js.map +0 -1
- package/dist/headless/operations/auth.js +0 -45
- package/dist/headless/operations/auth.js.map +0 -1
- package/dist/headless/operations/client.js +0 -31
- package/dist/headless/operations/client.js.map +0 -1
- package/dist/headless/operations/config.js +0 -69
- package/dist/headless/operations/config.js.map +0 -1
- package/dist/headless/operations/daemon.js +0 -47
- package/dist/headless/operations/daemon.js.map +0 -1
- package/dist/headless/operations/hook.js +0 -56
- package/dist/headless/operations/hook.js.map +0 -1
- package/dist/headless/operations/index.js +0 -11
- package/dist/headless/operations/index.js.map +0 -1
- package/dist/headless/operations/memory.js +0 -102
- package/dist/headless/operations/memory.js.map +0 -1
- package/dist/headless/operations/message.js +0 -279
- package/dist/headless/operations/message.js.map +0 -1
- package/dist/headless/operations/model.js +0 -100
- package/dist/headless/operations/model.js.map +0 -1
- package/dist/headless/operations/peer.js +0 -56
- package/dist/headless/operations/peer.js.map +0 -1
- package/dist/headless/operations/run.js +0 -24
- package/dist/headless/operations/run.js.map +0 -1
- package/dist/headless/operations/session.js +0 -90
- package/dist/headless/operations/session.js.map +0 -1
- package/dist/headless/operations/system.js +0 -19
- package/dist/headless/operations/system.js.map +0 -1
- package/dist/headless/operations/utils.js +0 -35
- package/dist/headless/operations/utils.js.map +0 -1
- package/dist/headless/run-orchestrator.js +0 -703
- package/dist/headless/run-orchestrator.js.map +0 -1
- package/dist/headless/stdio-server.js +0 -439
- package/dist/headless/stdio-server.js.map +0 -1
- package/dist/history/SessionHistory.js +0 -8
- package/dist/history/SessionHistory.js.map +0 -1
- package/dist/history/SessionHistoryClient.js +0 -186
- package/dist/history/SessionHistoryClient.js.map +0 -1
- package/dist/history/conversation-message.js +0 -112
- package/dist/history/conversation-message.js.map +0 -1
- package/dist/history/index.js +0 -8
- package/dist/history/index.js.map +0 -1
- package/dist/history/jsonl-replay.js +0 -154
- package/dist/history/jsonl-replay.js.map +0 -1
- package/dist/history/repair-tool-pairing.js +0 -84
- package/dist/history/repair-tool-pairing.js.map +0 -1
- package/dist/history/stall-phase-bridge.js +0 -11
- package/dist/history/stall-phase-bridge.js.map +0 -1
- package/dist/history/turn-accumulator.js +0 -427
- package/dist/history/turn-accumulator.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/ink-repl.d.ts.map +0 -1
- package/dist/ink-repl.js +0 -4183
- package/dist/ink-repl.js.map +0 -1
- package/dist/local-control-bootstrap.js +0 -26
- package/dist/local-control-bootstrap.js.map +0 -1
- package/dist/local-control-client.js +0 -2
- package/dist/local-control-client.js.map +0 -1
- package/dist/local-control-error-reporting.js +0 -34
- package/dist/local-control-error-reporting.js.map +0 -1
- package/dist/local-control-http-client.js +0 -362
- package/dist/local-control-http-client.js.map +0 -1
- package/dist/local-control-lazy-wrapper.js +0 -363
- package/dist/local-control-lazy-wrapper.js.map +0 -1
- package/dist/local-control-manager.js +0 -146
- package/dist/local-control-manager.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -62
- package/dist/main.js.map +0 -1
- package/dist/network-security.js +0 -62
- package/dist/network-security.js.map +0 -1
- package/dist/networking-server.js +0 -38
- package/dist/networking-server.js.map +0 -1
- package/dist/peer-identity.js +0 -23
- package/dist/peer-identity.js.map +0 -1
- package/dist/polling-subscription.js +0 -34
- package/dist/polling-subscription.js.map +0 -1
- package/dist/relaunch.d.ts +0 -63
- package/dist/relaunch.d.ts.map +0 -1
- package/dist/relaunch.js +0 -617
- package/dist/relaunch.js.map +0 -1
- package/dist/release-notes.js +0 -35
- package/dist/release-notes.js.map +0 -1
- package/dist/repl-cleanup.js +0 -47
- package/dist/repl-cleanup.js.map +0 -1
- package/dist/runtime/configure-bun-sqlite.js +0 -3
- package/dist/runtime/configure-bun-sqlite.js.map +0 -1
- package/dist/runtime/crash-handlers.js +0 -111
- package/dist/runtime/crash-handlers.js.map +0 -1
- package/dist/runtime/interactive-invocation.js +0 -39
- package/dist/runtime/interactive-invocation.js.map +0 -1
- package/dist/runtime/internal-mode.js +0 -14
- package/dist/runtime/internal-mode.js.map +0 -1
- package/dist/runtime/launch-spec.js +0 -64
- package/dist/runtime/launch-spec.js.map +0 -1
- package/dist/runtime/owner-lease.js +0 -44
- package/dist/runtime/owner-lease.js.map +0 -1
- package/dist/runtime/public-mode.js +0 -20
- package/dist/runtime/public-mode.js.map +0 -1
- package/dist/runtime/run-internal-mode.d.ts.map +0 -1
- package/dist/runtime/run-internal-mode.js +0 -18
- package/dist/runtime/run-internal-mode.js.map +0 -1
- package/dist/runtime/runtime-kind.js +0 -32
- package/dist/runtime/runtime-kind.js.map +0 -1
- package/dist/runtime/spawn-aria.js +0 -38
- package/dist/runtime/spawn-aria.js.map +0 -1
- package/dist/selectable-client.js +0 -2
- package/dist/selectable-client.js.map +0 -1
- package/dist/selectable-peer.js +0 -2
- package/dist/selectable-peer.js.map +0 -1
- package/dist/session.js +0 -203
- package/dist/session.js.map +0 -1
- package/dist/slash-commands.js +0 -80
- package/dist/slash-commands.js.map +0 -1
- package/dist/sounds.js +0 -210
- package/dist/sounds.js.map +0 -1
- package/dist/ui/App.js +0 -526
- package/dist/ui/App.js.map +0 -1
- package/dist/ui/components/AnthropicMethodPicker.js +0 -6
- package/dist/ui/components/AnthropicMethodPicker.js.map +0 -1
- package/dist/ui/components/ArionPrompt.js +0 -15
- package/dist/ui/components/ArionPrompt.js.map +0 -1
- package/dist/ui/components/AutocompleteDropdown.js +0 -23
- package/dist/ui/components/AutocompleteDropdown.js.map +0 -1
- package/dist/ui/components/AutonomySelector.js +0 -55
- package/dist/ui/components/AutonomySelector.js.map +0 -1
- package/dist/ui/components/Banner.js +0 -98
- package/dist/ui/components/Banner.js.map +0 -1
- package/dist/ui/components/ConversationHistory.js +0 -175
- package/dist/ui/components/ConversationHistory.js.map +0 -1
- package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
- package/dist/ui/components/CopilotDeviceLoginFlow.js.map +0 -1
- package/dist/ui/components/CopilotSourcePicker.js +0 -50
- package/dist/ui/components/CopilotSourcePicker.js.map +0 -1
- package/dist/ui/components/Cost.js +0 -10
- package/dist/ui/components/Cost.js.map +0 -1
- package/dist/ui/components/CustomSelect/option-map.js +0 -30
- package/dist/ui/components/CustomSelect/option-map.js.map +0 -1
- package/dist/ui/components/CustomSelect/select-option.js +0 -13
- package/dist/ui/components/CustomSelect/select-option.js.map +0 -1
- package/dist/ui/components/CustomSelect/select.js +0 -42
- package/dist/ui/components/CustomSelect/select.js.map +0 -1
- package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
- package/dist/ui/components/CustomSelect/use-select-state.js.map +0 -1
- package/dist/ui/components/CustomSelect/use-select.js +0 -15
- package/dist/ui/components/CustomSelect/use-select.js.map +0 -1
- package/dist/ui/components/ErrorDisplay.js +0 -35
- package/dist/ui/components/ErrorDisplay.js.map +0 -1
- package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
- package/dist/ui/components/FallbackToolUseRejectedMessage.js.map +0 -1
- package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
- package/dist/ui/components/FileEditToolUpdatedMessage.js.map +0 -1
- package/dist/ui/components/HandoffMarker.js +0 -18
- package/dist/ui/components/HandoffMarker.js.map +0 -1
- package/dist/ui/components/HighlightedCode.js +0 -21
- package/dist/ui/components/HighlightedCode.js.map +0 -1
- package/dist/ui/components/InputArea.js +0 -187
- package/dist/ui/components/InputArea.js.map +0 -1
- package/dist/ui/components/Message.js +0 -25
- package/dist/ui/components/Message.js.map +0 -1
- package/dist/ui/components/OAuthLoginFlow.js +0 -113
- package/dist/ui/components/OAuthLoginFlow.js.map +0 -1
- package/dist/ui/components/OutputTruncation.js +0 -35
- package/dist/ui/components/OutputTruncation.js.map +0 -1
- package/dist/ui/components/PermissionPrompt.js +0 -79
- package/dist/ui/components/PermissionPrompt.js.map +0 -1
- package/dist/ui/components/PipelineTimingPanel.js +0 -15
- package/dist/ui/components/PipelineTimingPanel.js.map +0 -1
- package/dist/ui/components/ProviderMethodPicker.js +0 -61
- package/dist/ui/components/ProviderMethodPicker.js.map +0 -1
- package/dist/ui/components/ProviderPicker.js +0 -63
- package/dist/ui/components/ProviderPicker.js.map +0 -1
- package/dist/ui/components/RenderItemView.js +0 -71
- package/dist/ui/components/RenderItemView.js.map +0 -1
- package/dist/ui/components/Spinner.js +0 -46
- package/dist/ui/components/Spinner.js.map +0 -1
- package/dist/ui/components/StatusBar.js +0 -95
- package/dist/ui/components/StatusBar.js.map +0 -1
- package/dist/ui/components/StreamingIndicator.js +0 -55
- package/dist/ui/components/StreamingIndicator.js.map +0 -1
- package/dist/ui/components/StructuredDiff.js +0 -168
- package/dist/ui/components/StructuredDiff.js.map +0 -1
- package/dist/ui/components/TextInputOverlay.js +0 -43
- package/dist/ui/components/TextInputOverlay.js.map +0 -1
- package/dist/ui/components/ThinkingBlock.js +0 -82
- package/dist/ui/components/ThinkingBlock.js.map +0 -1
- package/dist/ui/components/ToolCost.js +0 -17
- package/dist/ui/components/ToolCost.js.map +0 -1
- package/dist/ui/components/ToolExecution.js +0 -61
- package/dist/ui/components/ToolExecution.js.map +0 -1
- package/dist/ui/components/ToolHeader.js +0 -51
- package/dist/ui/components/ToolHeader.js.map +0 -1
- package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
- package/dist/ui/components/ToolRenderLayoutContext.js.map +0 -1
- package/dist/ui/components/ToolResultWrapper.js +0 -6
- package/dist/ui/components/ToolResultWrapper.js.map +0 -1
- package/dist/ui/components/ToolUseLoader.js +0 -35
- package/dist/ui/components/ToolUseLoader.js.map +0 -1
- package/dist/ui/components/TraceWaterfall.js +0 -91
- package/dist/ui/components/TraceWaterfall.js.map +0 -1
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
- package/dist/ui/components/messages/AssistantTextMessage.js.map +0 -1
- package/dist/ui/components/messages/UserImageMessage.js +0 -12
- package/dist/ui/components/messages/UserImageMessage.js.map +0 -1
- package/dist/ui/components/messages/UserTextMessage.js +0 -12
- package/dist/ui/components/messages/UserTextMessage.js.map +0 -1
- package/dist/ui/components/overlays/ArionSelector.js +0 -68
- package/dist/ui/components/overlays/ArionSelector.js.map +0 -1
- package/dist/ui/components/overlays/ClientSelector.js +0 -62
- package/dist/ui/components/overlays/ClientSelector.js.map +0 -1
- package/dist/ui/components/overlays/CommandPalette.js +0 -67
- package/dist/ui/components/overlays/CommandPalette.js.map +0 -1
- package/dist/ui/components/overlays/DaemonControl.js +0 -87
- package/dist/ui/components/overlays/DaemonControl.js.map +0 -1
- package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
- package/dist/ui/components/overlays/InviteShareOverlay.js.map +0 -1
- package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
- package/dist/ui/components/overlays/JoinInviteOverlay.js.map +0 -1
- package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
- package/dist/ui/components/overlays/MemoryBrowser.js.map +0 -1
- package/dist/ui/components/overlays/MessageSelector.js +0 -123
- package/dist/ui/components/overlays/MessageSelector.js.map +0 -1
- package/dist/ui/components/overlays/ModelSelector.js +0 -211
- package/dist/ui/components/overlays/ModelSelector.js.map +0 -1
- package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
- package/dist/ui/components/overlays/PairRequestOverlay.js.map +0 -1
- package/dist/ui/components/overlays/PeerSelector.js +0 -84
- package/dist/ui/components/overlays/PeerSelector.js.map +0 -1
- package/dist/ui/components/overlays/SessionSelector.js +0 -102
- package/dist/ui/components/overlays/SessionSelector.js.map +0 -1
- package/dist/ui/components/overlays/SoundSelector.js +0 -86
- package/dist/ui/components/overlays/SoundSelector.js.map +0 -1
- package/dist/ui/components/overlays/ThemeSelector.js +0 -139
- package/dist/ui/components/overlays/ThemeSelector.js.map +0 -1
- package/dist/ui/components/overlays/index.js +0 -15
- package/dist/ui/components/overlays/index.js.map +0 -1
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js.map +0 -1
- package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
- package/dist/ui/components/permissions/FallbackPermissionRequest.js.map +0 -1
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js.map +0 -1
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js.map +0 -1
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js.map +0 -1
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js.map +0 -1
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +0 -1
- package/dist/ui/components/permissions/PermissionRequest.js +0 -70
- package/dist/ui/components/permissions/PermissionRequest.js.map +0 -1
- package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
- package/dist/ui/components/permissions/PermissionRequestTitle.js.map +0 -1
- package/dist/ui/components/permissions/hooks.js +0 -10
- package/dist/ui/components/permissions/hooks.js.map +0 -1
- package/dist/ui/components/permissions/toolUseOptions.js +0 -68
- package/dist/ui/components/permissions/toolUseOptions.js.map +0 -1
- package/dist/ui/components/permissions/utils.js +0 -10
- package/dist/ui/components/permissions/utils.js.map +0 -1
- package/dist/ui/components/text-input/Cursor.js +0 -326
- package/dist/ui/components/text-input/Cursor.js.map +0 -1
- package/dist/ui/components/text-input/TextInput.js +0 -231
- package/dist/ui/components/text-input/TextInput.js.map +0 -1
- package/dist/ui/components/text-input/imagePaste.js +0 -28
- package/dist/ui/components/text-input/imagePaste.js.map +0 -1
- package/dist/ui/components/text-input/index.js +0 -6
- package/dist/ui/components/text-input/index.js.map +0 -1
- package/dist/ui/components/text-input/useDoublePress.js +0 -30
- package/dist/ui/components/text-input/useDoublePress.js.map +0 -1
- package/dist/ui/components/text-input/useTextInput.js +0 -245
- package/dist/ui/components/text-input/useTextInput.js.map +0 -1
- package/dist/ui/components/tool-types.js +0 -9
- package/dist/ui/components/tool-types.js.map +0 -1
- package/dist/ui/constants/figures.js +0 -4
- package/dist/ui/constants/figures.js.map +0 -1
- package/dist/ui/constants/index.js +0 -3
- package/dist/ui/constants/index.js.map +0 -1
- package/dist/ui/display-mode.js +0 -93
- package/dist/ui/display-mode.js.map +0 -1
- package/dist/ui/display-policy.js +0 -19
- package/dist/ui/display-policy.js.map +0 -1
- package/dist/ui/hooks/index.js +0 -6
- package/dist/ui/hooks/index.js.map +0 -1
- package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
- package/dist/ui/hooks/useCommandAutocomplete.js.map +0 -1
- package/dist/ui/hooks/useDoublePress.js +0 -37
- package/dist/ui/hooks/useDoublePress.js.map +0 -1
- package/dist/ui/hooks/useIndicatorState.js +0 -55
- package/dist/ui/hooks/useIndicatorState.js.map +0 -1
- package/dist/ui/hooks/useInterval.js +0 -23
- package/dist/ui/hooks/useInterval.js.map +0 -1
- package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
- package/dist/ui/hooks/useKeyboardShortcuts.js.map +0 -1
- package/dist/ui/hooks/useTerminalSize.js +0 -55
- package/dist/ui/hooks/useTerminalSize.js.map +0 -1
- package/dist/ui/hooks/useUnifiedMessages.js +0 -117
- package/dist/ui/hooks/useUnifiedMessages.js.map +0 -1
- package/dist/ui/indicator-state.js +0 -44
- package/dist/ui/indicator-state.js.map +0 -1
- package/dist/ui/markdown/highlight.js +0 -44
- package/dist/ui/markdown/highlight.js.map +0 -1
- package/dist/ui/markdown/index.js +0 -1460
- package/dist/ui/markdown/index.js.map +0 -1
- package/dist/ui/markdown/tokenizer.js +0 -24
- package/dist/ui/markdown/tokenizer.js.map +0 -1
- package/dist/ui/render-item.js +0 -5
- package/dist/ui/render-item.js.map +0 -1
- package/dist/ui/screens/REPL.js +0 -119
- package/dist/ui/screens/REPL.js.map +0 -1
- package/dist/ui/screens/approval-lifecycle.js +0 -38
- package/dist/ui/screens/approval-lifecycle.js.map +0 -1
- package/dist/ui/status-line.js +0 -72
- package/dist/ui/status-line.js.map +0 -1
- package/dist/ui/theme/index.js +0 -51
- package/dist/ui/theme/index.js.map +0 -1
- package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-dark-daltonized.js.map +0 -1
- package/dist/ui/theme/themes/claude-dark.js +0 -50
- package/dist/ui/theme/themes/claude-dark.js.map +0 -1
- package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-light-daltonized.js.map +0 -1
- package/dist/ui/theme/themes/claude-light.js +0 -50
- package/dist/ui/theme/themes/claude-light.js.map +0 -1
- package/dist/ui/theme/themes/dark-accessible.js +0 -18
- package/dist/ui/theme/themes/dark-accessible.js.map +0 -1
- package/dist/ui/theme/themes/dark.js +0 -49
- package/dist/ui/theme/themes/dark.js.map +0 -1
- package/dist/ui/theme/themes/light-accessible.js +0 -18
- package/dist/ui/theme/themes/light-accessible.js.map +0 -1
- package/dist/ui/theme/themes/light.js +0 -49
- package/dist/ui/theme/themes/light.js.map +0 -1
- package/dist/ui/theme/types.js +0 -3
- package/dist/ui/theme/types.js.map +0 -1
- package/dist/ui/theme.js +0 -142
- package/dist/ui/theme.js.map +0 -1
- package/dist/ui/to-render-items.js +0 -145
- package/dist/ui/to-render-items.js.map +0 -1
- package/dist/ui/tools/AgentTool/index.js +0 -30
- package/dist/ui/tools/AgentTool/index.js.map +0 -1
- package/dist/ui/tools/ArchitectTool/index.js +0 -31
- package/dist/ui/tools/ArchitectTool/index.js.map +0 -1
- package/dist/ui/tools/AskUserTool/index.js +0 -46
- package/dist/ui/tools/AskUserTool/index.js.map +0 -1
- package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
- package/dist/ui/tools/BashTool/BashToolResultMessage.js.map +0 -1
- package/dist/ui/tools/BashTool/OutputLine.js +0 -21
- package/dist/ui/tools/BashTool/OutputLine.js.map +0 -1
- package/dist/ui/tools/BashTool/index.js +0 -91
- package/dist/ui/tools/BashTool/index.js.map +0 -1
- package/dist/ui/tools/BrowseTool/index.js +0 -43
- package/dist/ui/tools/BrowseTool/index.js.map +0 -1
- package/dist/ui/tools/BrowserTool/index.js +0 -47
- package/dist/ui/tools/BrowserTool/index.js.map +0 -1
- package/dist/ui/tools/CbmTool/index.js +0 -188
- package/dist/ui/tools/CbmTool/index.js.map +0 -1
- package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
- package/dist/ui/tools/CheckDelegationTool/index.js.map +0 -1
- package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
- package/dist/ui/tools/CheckMessagesTool/index.js.map +0 -1
- package/dist/ui/tools/CreateQuipTool/index.js +0 -30
- package/dist/ui/tools/CreateQuipTool/index.js.map +0 -1
- package/dist/ui/tools/CreateSkillTool/index.js +0 -22
- package/dist/ui/tools/CreateSkillTool/index.js.map +0 -1
- package/dist/ui/tools/CreateToolTool/index.js +0 -31
- package/dist/ui/tools/CreateToolTool/index.js.map +0 -1
- package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
- package/dist/ui/tools/DelegateRemoteTool/index.js.map +0 -1
- package/dist/ui/tools/DeployTool/index.js +0 -47
- package/dist/ui/tools/DeployTool/index.js.map +0 -1
- package/dist/ui/tools/FffTool/index.js +0 -103
- package/dist/ui/tools/FffTool/index.js.map +0 -1
- package/dist/ui/tools/FileEditTool/index.js +0 -67
- package/dist/ui/tools/FileEditTool/index.js.map +0 -1
- package/dist/ui/tools/FileReadTool/index.js +0 -68
- package/dist/ui/tools/FileReadTool/index.js.map +0 -1
- package/dist/ui/tools/FileWriteTool/index.js +0 -61
- package/dist/ui/tools/FileWriteTool/index.js.map +0 -1
- package/dist/ui/tools/ForkTool/index.js +0 -47
- package/dist/ui/tools/ForkTool/index.js.map +0 -1
- package/dist/ui/tools/FrgTool/index.js +0 -96
- package/dist/ui/tools/FrgTool/index.js.map +0 -1
- package/dist/ui/tools/GetThreadTool/index.js +0 -39
- package/dist/ui/tools/GetThreadTool/index.js.map +0 -1
- package/dist/ui/tools/GlobTool/index.js +0 -50
- package/dist/ui/tools/GlobTool/index.js.map +0 -1
- package/dist/ui/tools/GrepTool/index.js +0 -84
- package/dist/ui/tools/GrepTool/index.js.map +0 -1
- package/dist/ui/tools/HatchArionTool/index.js +0 -36
- package/dist/ui/tools/HatchArionTool/index.js.map +0 -1
- package/dist/ui/tools/LearnSkillTool/index.js +0 -22
- package/dist/ui/tools/LearnSkillTool/index.js.map +0 -1
- package/dist/ui/tools/LearnTool/index.js +0 -43
- package/dist/ui/tools/LearnTool/index.js.map +0 -1
- package/dist/ui/tools/LearnToolTool/index.js +0 -22
- package/dist/ui/tools/LearnToolTool/index.js.map +0 -1
- package/dist/ui/tools/ListClientsTool/index.js +0 -39
- package/dist/ui/tools/ListClientsTool/index.js.map +0 -1
- package/dist/ui/tools/LspTool/index.js +0 -261
- package/dist/ui/tools/LspTool/index.js.map +0 -1
- package/dist/ui/tools/MCPTool/index.js +0 -33
- package/dist/ui/tools/MCPTool/index.js.map +0 -1
- package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
- package/dist/ui/tools/ManageNetworkTool/index.js.map +0 -1
- package/dist/ui/tools/MemoryReadTool/index.js +0 -64
- package/dist/ui/tools/MemoryReadTool/index.js.map +0 -1
- package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
- package/dist/ui/tools/MemoryWriteTool/index.js.map +0 -1
- package/dist/ui/tools/NotebookEditTool/index.js +0 -33
- package/dist/ui/tools/NotebookEditTool/index.js.map +0 -1
- package/dist/ui/tools/NotebookReadTool/index.js +0 -25
- package/dist/ui/tools/NotebookReadTool/index.js.map +0 -1
- package/dist/ui/tools/OutlookReadTool/index.js +0 -66
- package/dist/ui/tools/OutlookReadTool/index.js.map +0 -1
- package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
- package/dist/ui/tools/OutlookReplyTool/index.js.map +0 -1
- package/dist/ui/tools/OutlookSendTool/index.js +0 -49
- package/dist/ui/tools/OutlookSendTool/index.js.map +0 -1
- package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
- package/dist/ui/tools/PauseDelegationTool/index.js.map +0 -1
- package/dist/ui/tools/ProbeTool/index.js +0 -121
- package/dist/ui/tools/ProbeTool/index.js.map +0 -1
- package/dist/ui/tools/ProcessTool/index.js +0 -66
- package/dist/ui/tools/ProcessTool/index.js.map +0 -1
- package/dist/ui/tools/QuestListTool/index.js +0 -46
- package/dist/ui/tools/QuestListTool/index.js.map +0 -1
- package/dist/ui/tools/QuestReportTool/index.js +0 -49
- package/dist/ui/tools/QuestReportTool/index.js.map +0 -1
- package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
- package/dist/ui/tools/QuestUpdateTool/index.js.map +0 -1
- package/dist/ui/tools/QuipCommentTool/index.js +0 -69
- package/dist/ui/tools/QuipCommentTool/index.js.map +0 -1
- package/dist/ui/tools/QuipReadTool/index.js +0 -71
- package/dist/ui/tools/QuipReadTool/index.js.map +0 -1
- package/dist/ui/tools/RestArionTool/index.js +0 -32
- package/dist/ui/tools/RestArionTool/index.js.map +0 -1
- package/dist/ui/tools/RestartTool/index.js +0 -35
- package/dist/ui/tools/RestartTool/index.js.map +0 -1
- package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
- package/dist/ui/tools/ResumeDelegationTool/index.js.map +0 -1
- package/dist/ui/tools/RetireArionTool/index.js +0 -32
- package/dist/ui/tools/RetireArionTool/index.js.map +0 -1
- package/dist/ui/tools/RgTool/index.js +0 -73
- package/dist/ui/tools/RgTool/index.js.map +0 -1
- package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
- package/dist/ui/tools/SearchKnowledgeTool/index.js.map +0 -1
- package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
- package/dist/ui/tools/SearchMessagesTool/index.js.map +0 -1
- package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
- package/dist/ui/tools/SelfDiagnoseTool/index.js.map +0 -1
- package/dist/ui/tools/SendMessageTool/index.js +0 -45
- package/dist/ui/tools/SendMessageTool/index.js.map +0 -1
- package/dist/ui/tools/SerenaTool/index.js +0 -124
- package/dist/ui/tools/SerenaTool/index.js.map +0 -1
- package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
- package/dist/ui/tools/SessionHistoryTool/index.js.map +0 -1
- package/dist/ui/tools/SgTool/index.js +0 -80
- package/dist/ui/tools/SgTool/index.js.map +0 -1
- package/dist/ui/tools/SlackReactTool/index.js +0 -41
- package/dist/ui/tools/SlackReactTool/index.js.map +0 -1
- package/dist/ui/tools/SlackReadTool/index.js +0 -48
- package/dist/ui/tools/SlackReadTool/index.js.map +0 -1
- package/dist/ui/tools/SlackSendTool/index.js +0 -45
- package/dist/ui/tools/SlackSendTool/index.js.map +0 -1
- package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
- package/dist/ui/tools/SpawnWorkerTool/index.js.map +0 -1
- package/dist/ui/tools/StickerRequestTool/index.js +0 -19
- package/dist/ui/tools/StickerRequestTool/index.js.map +0 -1
- package/dist/ui/tools/ThinkTool/index.js +0 -17
- package/dist/ui/tools/ThinkTool/index.js.map +0 -1
- package/dist/ui/tools/UgTool/index.js +0 -108
- package/dist/ui/tools/UgTool/index.js.map +0 -1
- package/dist/ui/tools/UseSkillTool/index.js +0 -22
- package/dist/ui/tools/UseSkillTool/index.js.map +0 -1
- package/dist/ui/tools/WakeArionTool/index.js +0 -32
- package/dist/ui/tools/WakeArionTool/index.js.map +0 -1
- package/dist/ui/tools/WebFetchTool/index.js +0 -56
- package/dist/ui/tools/WebFetchTool/index.js.map +0 -1
- package/dist/ui/tools/WebSearchTool/index.js +0 -44
- package/dist/ui/tools/WebSearchTool/index.js.map +0 -1
- package/dist/ui/tools/lsTool/index.js +0 -58
- package/dist/ui/tools/lsTool/index.js.map +0 -1
- package/dist/ui/tools/registry.js +0 -197
- package/dist/ui/tools/registry.js.map +0 -1
- package/dist/ui/tools/tool-renderer.js +0 -11
- package/dist/ui/tools/tool-renderer.js.map +0 -1
- package/dist/ui/tools/truncation.js +0 -35
- package/dist/ui/tools/truncation.js.map +0 -1
- package/dist/ui/types/anthropic.js +0 -4
- package/dist/ui/types/anthropic.js.map +0 -1
- package/dist/ui/types/index.js +0 -2
- package/dist/ui/types/index.js.map +0 -1
- package/dist/ui/types/message.js +0 -3
- package/dist/ui/types/message.js.map +0 -1
- package/dist/ui/types/tool.js +0 -4
- package/dist/ui/types/tool.js.map +0 -1
- package/dist/ui/utils/array.js +0 -4
- package/dist/ui/utils/array.js.map +0 -1
- package/dist/ui/utils/cursor.js +0 -131
- package/dist/ui/utils/cursor.js.map +0 -1
- package/dist/ui/utils/diff.js +0 -120
- package/dist/ui/utils/diff.js.map +0 -1
- package/dist/ui/utils/format.js +0 -42
- package/dist/ui/utils/format.js.map +0 -1
- package/dist/ui/utils/fuzzy.js +0 -59
- package/dist/ui/utils/fuzzy.js.map +0 -1
- package/dist/ui/utils/index.js +0 -11
- package/dist/ui/utils/index.js.map +0 -1
- package/dist/ui/utils/keys.js +0 -8
- package/dist/ui/utils/keys.js.map +0 -1
- package/dist/ui/utils/patch.js +0 -17
- package/dist/ui/utils/patch.js.map +0 -1
- package/dist/ui/utils/risk.js +0 -114
- package/dist/ui/utils/risk.js.map +0 -1
- package/dist/ui/utils/terminal-image.js +0 -70
- package/dist/ui/utils/terminal-image.js.map +0 -1
- package/dist/ui/utils/validation.js +0 -48
- package/dist/ui/utils/validation.js.map +0 -1
- package/dist/ui/verb-pairs.js +0 -248
- package/dist/ui/verb-pairs.js.map +0 -1
- package/dist/ui.js +0 -131
- package/dist/ui.js.map +0 -1
- package/src/entrypoints/command-mode.ts +0 -5
- package/src/entrypoints/daemon.ts +0 -54
- package/src/entrypoints/headless-stdio.ts +0 -27
- package/src/entrypoints/interactive.ts +0 -112
- package/src/main.ts +0 -72
- package/src/runtime/configure-bun-sqlite.ts +0 -3
- package/src/runtime/crash-handlers.ts +0 -128
- package/src/runtime/interactive-invocation.test.ts +0 -42
- package/src/runtime/interactive-invocation.ts +0 -51
- package/src/runtime/internal-mode.test.ts +0 -19
- package/src/runtime/internal-mode.ts +0 -24
- package/src/runtime/launch-spec.test.ts +0 -26
- package/src/runtime/launch-spec.ts +0 -84
- package/src/runtime/owner-lease.ts +0 -52
- package/src/runtime/public-mode.test.ts +0 -18
- package/src/runtime/public-mode.ts +0 -19
- package/src/runtime/run-internal-mode.ts +0 -19
- package/src/runtime/runtime-kind.test.ts +0 -23
- package/src/runtime/runtime-kind.ts +0 -41
- package/src/runtime/spawn-aria.ts +0 -62
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// Change: replaced @inkjs/ui useComponentTheme with inline styles using ARIA's theme
|
|
3
|
-
// Change: Option type from @inkjs/ui → imported from ./option-map.js
|
|
4
|
-
import { Box, Text } from "ink";
|
|
5
|
-
import { SelectOption } from "./select-option.js";
|
|
6
|
-
import { useSelectState } from "./use-select-state.js";
|
|
7
|
-
import { useSelect } from "./use-select.js";
|
|
8
|
-
import { getTheme } from "../../theme/index.js";
|
|
9
|
-
export const optionHeaderKey = (optionHeader) => `HEADER-${optionHeader.optionValues.join(",")}`;
|
|
10
|
-
export function Select({ isDisabled = false, visibleOptionCount = 5, highlightText, options, defaultValue, onChange, onFocus, focusValue, }) {
|
|
11
|
-
const state = useSelectState({
|
|
12
|
-
visibleOptionCount,
|
|
13
|
-
options,
|
|
14
|
-
defaultValue,
|
|
15
|
-
onChange,
|
|
16
|
-
onFocus,
|
|
17
|
-
focusValue,
|
|
18
|
-
});
|
|
19
|
-
useSelect({ isDisabled, state });
|
|
20
|
-
const theme = getTheme();
|
|
21
|
-
return (_jsx(Box, { flexDirection: "column", children: state.visibleOptions.map((option) => {
|
|
22
|
-
const key = "value" in option ? option.value : optionHeaderKey(option);
|
|
23
|
-
const isFocused = !isDisabled &&
|
|
24
|
-
state.focusedValue !== undefined &&
|
|
25
|
-
("value" in option
|
|
26
|
-
? state.focusedValue === option.value
|
|
27
|
-
: option.optionValues.includes(state.focusedValue));
|
|
28
|
-
const isSelected = !!state.value &&
|
|
29
|
-
("value" in option
|
|
30
|
-
? state.value === option.value
|
|
31
|
-
: option.optionValues.includes(state.value));
|
|
32
|
-
const smallPointer = "header" in option;
|
|
33
|
-
const labelText = "label" in option ? option.label : option.header;
|
|
34
|
-
let label = labelText;
|
|
35
|
-
if (highlightText && labelText.includes(highlightText)) {
|
|
36
|
-
const index = labelText.indexOf(highlightText);
|
|
37
|
-
label = (_jsxs(_Fragment, { children: [labelText.slice(0, index), _jsx(Text, { color: theme.colors.primary, bold: true, children: highlightText }), labelText.slice(index + highlightText.length)] }));
|
|
38
|
-
}
|
|
39
|
-
return (_jsx(SelectOption, { isFocused: isFocused, isSelected: isSelected, smallPointer: smallPointer, children: label }, key));
|
|
40
|
-
}) }));
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/ui/components/CustomSelect/select.tsx"],"names":[],"mappings":";AAAA,qFAAqF;AACrF,qEAAqE;AAErE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAoBhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,YAA0B,EAAU,EAAE,CACpE,UAAU,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAgDlD,MAAM,UAAU,MAAM,CAAC,EACrB,UAAU,GAAG,KAAK,EAClB,kBAAkB,GAAG,CAAC,EACtB,aAAa,EACb,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,UAAU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AC,aAAa,CAAC,EAAE,CAAC;gBACvD,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;gBAE/C,KAAK,GAAG,CACN,8BACG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAC1B,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,kBACpC,aAAa,GACT,EACN,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,IAC7C,CACJ,CAAC;YACJ,CAAC;YAED,OAAO,CACL,KAAC,YAAY,IAEX,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,YAEzB,KAAK,IALD,GAAG,CAMK,CAChB,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// Change: Option type from @inkjs/ui → imported from ./option-map.js
|
|
2
|
-
import { isDeepStrictEqual } from "node:util";
|
|
3
|
-
import { useReducer, useCallback, useMemo, useState, useEffect } from "react";
|
|
4
|
-
import OptionMap from "./option-map.js";
|
|
5
|
-
const reducer = (state, action) => {
|
|
6
|
-
switch (action.type) {
|
|
7
|
-
case "focus-next-option": {
|
|
8
|
-
if (!state.focusedValue) {
|
|
9
|
-
return state;
|
|
10
|
-
}
|
|
11
|
-
const item = state.optionMap.get(state.focusedValue);
|
|
12
|
-
if (!item) {
|
|
13
|
-
return state;
|
|
14
|
-
}
|
|
15
|
-
let next = item.next;
|
|
16
|
-
while (next && !("value" in next)) {
|
|
17
|
-
// Skip headers
|
|
18
|
-
next = next.next;
|
|
19
|
-
}
|
|
20
|
-
if (!next) {
|
|
21
|
-
return state;
|
|
22
|
-
}
|
|
23
|
-
const needsToScroll = next.index >= state.visibleToIndex;
|
|
24
|
-
if (!needsToScroll) {
|
|
25
|
-
return {
|
|
26
|
-
...state,
|
|
27
|
-
focusedValue: next.value,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const nextVisibleToIndex = Math.min(state.optionMap.size, state.visibleToIndex + 1);
|
|
31
|
-
const nextVisibleFromIndex = nextVisibleToIndex - state.visibleOptionCount;
|
|
32
|
-
return {
|
|
33
|
-
...state,
|
|
34
|
-
focusedValue: next.value,
|
|
35
|
-
visibleFromIndex: nextVisibleFromIndex,
|
|
36
|
-
visibleToIndex: nextVisibleToIndex,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
case "focus-previous-option": {
|
|
40
|
-
if (!state.focusedValue) {
|
|
41
|
-
return state;
|
|
42
|
-
}
|
|
43
|
-
const item = state.optionMap.get(state.focusedValue);
|
|
44
|
-
if (!item) {
|
|
45
|
-
return state;
|
|
46
|
-
}
|
|
47
|
-
let previous = item.previous;
|
|
48
|
-
while (previous && !("value" in previous)) {
|
|
49
|
-
// Skip headers
|
|
50
|
-
previous = previous.previous;
|
|
51
|
-
}
|
|
52
|
-
if (!previous) {
|
|
53
|
-
return state;
|
|
54
|
-
}
|
|
55
|
-
const needsToScroll = previous.index <= state.visibleFromIndex;
|
|
56
|
-
if (!needsToScroll) {
|
|
57
|
-
return {
|
|
58
|
-
...state,
|
|
59
|
-
focusedValue: previous.value,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const nextVisibleFromIndex = Math.max(0, state.visibleFromIndex - 1);
|
|
63
|
-
const nextVisibleToIndex = nextVisibleFromIndex + state.visibleOptionCount;
|
|
64
|
-
return {
|
|
65
|
-
...state,
|
|
66
|
-
focusedValue: previous.value,
|
|
67
|
-
visibleFromIndex: nextVisibleFromIndex,
|
|
68
|
-
visibleToIndex: nextVisibleToIndex,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
case "select-focused-option": {
|
|
72
|
-
return {
|
|
73
|
-
...state,
|
|
74
|
-
previousValue: state.value,
|
|
75
|
-
value: state.focusedValue,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
case "reset": {
|
|
79
|
-
return action.state;
|
|
80
|
-
}
|
|
81
|
-
case "set-focus": {
|
|
82
|
-
return {
|
|
83
|
-
...state,
|
|
84
|
-
focusedValue: action.value,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const flattenOptions = (options) => options.flatMap((option) => {
|
|
90
|
-
if ("options" in option) {
|
|
91
|
-
const flatSubtree = flattenOptions(option.options);
|
|
92
|
-
const optionValues = flatSubtree.flatMap((o) => ("value" in o ? o.value : []));
|
|
93
|
-
const header = option.header !== undefined ? [{ header: option.header, optionValues }] : [];
|
|
94
|
-
return [...header, ...flatSubtree];
|
|
95
|
-
}
|
|
96
|
-
return option;
|
|
97
|
-
});
|
|
98
|
-
const createDefaultState = ({ visibleOptionCount: customVisibleOptionCount, defaultValue, options, }) => {
|
|
99
|
-
const flatOptions = flattenOptions(options);
|
|
100
|
-
const visibleOptionCount = typeof customVisibleOptionCount === "number"
|
|
101
|
-
? Math.min(customVisibleOptionCount, flatOptions.length)
|
|
102
|
-
: flatOptions.length;
|
|
103
|
-
const optionMap = new OptionMap(flatOptions);
|
|
104
|
-
const firstOption = optionMap.first;
|
|
105
|
-
const focusedValue = firstOption && "value" in firstOption ? firstOption.value : undefined;
|
|
106
|
-
return {
|
|
107
|
-
optionMap,
|
|
108
|
-
visibleOptionCount,
|
|
109
|
-
focusedValue,
|
|
110
|
-
visibleFromIndex: 0,
|
|
111
|
-
visibleToIndex: visibleOptionCount,
|
|
112
|
-
previousValue: defaultValue,
|
|
113
|
-
value: defaultValue,
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
export const useSelectState = ({ visibleOptionCount = 5, options, defaultValue, onChange, onFocus, focusValue, }) => {
|
|
117
|
-
const flatOptions = flattenOptions(options);
|
|
118
|
-
const [state, dispatch] = useReducer(reducer, { visibleOptionCount, defaultValue, options }, createDefaultState);
|
|
119
|
-
const [lastOptions, setLastOptions] = useState(flatOptions);
|
|
120
|
-
if (flatOptions !== lastOptions && !isDeepStrictEqual(flatOptions, lastOptions)) {
|
|
121
|
-
dispatch({
|
|
122
|
-
type: "reset",
|
|
123
|
-
state: createDefaultState({ visibleOptionCount, defaultValue, options }),
|
|
124
|
-
});
|
|
125
|
-
setLastOptions(flatOptions);
|
|
126
|
-
}
|
|
127
|
-
const focusNextOption = useCallback(() => {
|
|
128
|
-
dispatch({
|
|
129
|
-
type: "focus-next-option",
|
|
130
|
-
});
|
|
131
|
-
}, []);
|
|
132
|
-
const focusPreviousOption = useCallback(() => {
|
|
133
|
-
dispatch({
|
|
134
|
-
type: "focus-previous-option",
|
|
135
|
-
});
|
|
136
|
-
}, []);
|
|
137
|
-
const selectFocusedOption = useCallback(() => {
|
|
138
|
-
dispatch({
|
|
139
|
-
type: "select-focused-option",
|
|
140
|
-
});
|
|
141
|
-
}, []);
|
|
142
|
-
const visibleOptions = useMemo(() => {
|
|
143
|
-
return flatOptions
|
|
144
|
-
.map((option, index) => ({
|
|
145
|
-
...option,
|
|
146
|
-
index,
|
|
147
|
-
}))
|
|
148
|
-
.slice(state.visibleFromIndex, state.visibleToIndex);
|
|
149
|
-
}, [flatOptions, state.visibleFromIndex, state.visibleToIndex]);
|
|
150
|
-
useEffect(() => {
|
|
151
|
-
if (state.value && state.previousValue !== state.value) {
|
|
152
|
-
onChange?.(state.value);
|
|
153
|
-
}
|
|
154
|
-
}, [state.previousValue, state.value, options, onChange]);
|
|
155
|
-
useEffect(() => {
|
|
156
|
-
if (state.focusedValue) {
|
|
157
|
-
onFocus?.(state.focusedValue);
|
|
158
|
-
}
|
|
159
|
-
}, [state.focusedValue, onFocus]);
|
|
160
|
-
useEffect(() => {
|
|
161
|
-
if (focusValue) {
|
|
162
|
-
dispatch({
|
|
163
|
-
type: "set-focus",
|
|
164
|
-
value: focusValue,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}, [focusValue]);
|
|
168
|
-
return {
|
|
169
|
-
focusedValue: state.focusedValue,
|
|
170
|
-
visibleFromIndex: state.visibleFromIndex,
|
|
171
|
-
visibleToIndex: state.visibleToIndex,
|
|
172
|
-
value: state.value,
|
|
173
|
-
visibleOptions,
|
|
174
|
-
focusNextOption,
|
|
175
|
-
focusPreviousOption,
|
|
176
|
-
selectFocusedOption,
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
//# sourceMappingURL=use-select-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-select-state.js","sourceRoot":"","sources":["../../../../src/ui/components/CustomSelect/use-select-state.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAgB,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,SAA0B,MAAM,iBAAiB,CAAC;AAqEzD,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;IACxD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAC;YACf,CAAC;YAED,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAErD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;YAED,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACrB,OAAO,IAAI,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC;gBAClC,eAAe;gBACf,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACnB,CAAC;YAED,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC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AAgB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,aAAa,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;YACvD,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE1D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAElC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,CAAC;gBACP,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,UAAU;aAClB,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,cAAc;QACd,eAAe;QACf,mBAAmB;QACnB,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useInput } from "ink";
|
|
2
|
-
export const useSelect = ({ isDisabled = false, state }) => {
|
|
3
|
-
useInput((_input, key) => {
|
|
4
|
-
if (key.downArrow) {
|
|
5
|
-
state.focusNextOption();
|
|
6
|
-
}
|
|
7
|
-
if (key.upArrow) {
|
|
8
|
-
state.focusPreviousOption();
|
|
9
|
-
}
|
|
10
|
-
if (key.return) {
|
|
11
|
-
state.selectFocusedOption();
|
|
12
|
-
}
|
|
13
|
-
}, { isActive: !isDisabled });
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=use-select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-select.js","sourceRoot":"","sources":["../../../../src/ui/components/CustomSelect/use-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAiB/B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,EAAE,KAAK,EAAkB,EAAQ,EAAE;IAC/E,QAAQ,CACN,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACd,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;YAClB,KAAK,CAAC,eAAe,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAChB,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC9B,CAAC;QAED,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC,EACD,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,CAC1B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text, useStdout } from "ink";
|
|
3
|
-
import { getTheme } from "../theme/index.js";
|
|
4
|
-
export function ErrorDisplay({ level, message, suggestion, title = "Error", }) {
|
|
5
|
-
const theme = getTheme();
|
|
6
|
-
const symbols = theme.symbols;
|
|
7
|
-
const colors = theme.colors;
|
|
8
|
-
const { stdout } = useStdout();
|
|
9
|
-
const width = stdout?.columns ?? 80;
|
|
10
|
-
switch (level) {
|
|
11
|
-
case "inline":
|
|
12
|
-
return (_jsxs(Text, { color: colors.error, children: [symbols.error, " ", message] }));
|
|
13
|
-
case "suggestion":
|
|
14
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: colors.error, children: [symbols.error, " ", message] }), suggestion && (_jsxs(Text, { color: colors.textMuted, children: [" ", symbols.arrow, " Did you mean \"", suggestion, "\"?"] }))] }));
|
|
15
|
-
case "boxed":
|
|
16
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: colors.error, paddingX: 1, width: width, children: [_jsxs(Text, { color: colors.error, bold: true, wrap: "wrap", children: [symbols.warning, " ", title] }), _jsx(Text, { wrap: "wrap", children: message }), suggestion && (_jsxs(Text, { color: colors.textMuted, wrap: "wrap", children: [symbols.arrow, " ", suggestion] }))] }));
|
|
17
|
-
case "fatal": {
|
|
18
|
-
const lineWidth = Math.max(1, width);
|
|
19
|
-
return (_jsxs(Box, { flexDirection: "column", width: width, children: [_jsx(Text, { color: colors.error, children: "═".repeat(lineWidth) }), _jsxs(Text, { color: colors.error, bold: true, wrap: "wrap", children: [" ", "\u26D4 FATAL: ", message] }), suggestion && (_jsxs(Text, { color: colors.textMuted, wrap: "wrap", children: [" ", suggestion] })), _jsx(Text, { color: colors.error, children: "═".repeat(lineWidth) })] }));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export function InlineError({ message }) {
|
|
24
|
-
return _jsx(ErrorDisplay, { level: "inline", message: message });
|
|
25
|
-
}
|
|
26
|
-
export function SuggestionError({ message, suggestion, }) {
|
|
27
|
-
return _jsx(ErrorDisplay, { level: "suggestion", message: message, suggestion: suggestion });
|
|
28
|
-
}
|
|
29
|
-
export function BoxedError({ message, title, suggestion, }) {
|
|
30
|
-
return _jsx(ErrorDisplay, { level: "boxed", message: message, title: title, suggestion: suggestion });
|
|
31
|
-
}
|
|
32
|
-
export function FatalError({ message, suggestion, }) {
|
|
33
|
-
return _jsx(ErrorDisplay, { level: "fatal", message: message, suggestion: suggestion });
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=ErrorDisplay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDisplay.js","sourceRoot":"","sources":["../../../src/ui/components/ErrorDisplay.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAW7C,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,GAAG,OAAO,GACG;IAClB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;IAEpC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,aACtB,OAAO,CAAC,KAAK,OAAG,OAAO,IACnB,CACR,CAAC;QAEJ,KAAK,YAAY;YACf,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,aACtB,OAAO,CAAC,KAAK,OAAG,OAAO,IACnB,EACN,UAAU,IAAI,CACb,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,aAC1B,IAAI,EACJ,OAAO,CAAC,KAAK,sBAAiB,UAAU,WACpC,CACR,IACG,CACP,CAAC;QAEJ,KAAK,OAAO;YACV,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO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EAAC,OAAO,EAAE,OAAO,GAAI,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,GAIX;IACC,OAAO,KAAC,YAAY,IAAC,KAAK,EAAC,YAAY,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,UAAU,GAKX;IACC,OAAO,KAAC,YAAY,IAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,UAAU,GAIX;IACC,OAAO,KAAC,YAAY,IAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC;AAClF,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getTheme } from "../theme/index.js";
|
|
3
|
-
import { Text } from "ink";
|
|
4
|
-
export function FallbackToolUseRejectedMessage() {
|
|
5
|
-
return (_jsxs(Text, { children: ["\u00A0\u00A0", "\u23BF", " \u00A0", _jsx(Text, { color: getTheme().colors.error, children: "No (tell ARIA what to do differently)" })] }));
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=FallbackToolUseRejectedMessage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackToolUseRejectedMessage.js","sourceRoot":"","sources":["../../../src/ui/components/FallbackToolUseRejectedMessage.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,MAAM,UAAU,8BAA8B;IAC5C,OAAO,CACL,MAAC,IAAI,+BACU,QAAQ,aACrB,KAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,KAAK,sDAA8C,IAC7E,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { StructuredDiff } from "./StructuredDiff.js";
|
|
4
|
-
import { getTheme } from "../theme/index.js";
|
|
5
|
-
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
6
|
-
function intersperse(as, separator) {
|
|
7
|
-
return as.flatMap((a, i) => (i ? [separator(i), a] : [a]));
|
|
8
|
-
}
|
|
9
|
-
const getCwd = () => process.cwd();
|
|
10
|
-
/** Convert a Hunk (from `diff` package) to ARIA's FileDiff format */
|
|
11
|
-
function hunkToFileDiff(hunk, filePath) {
|
|
12
|
-
const lines = [];
|
|
13
|
-
let oldLineNo = hunk.oldStart;
|
|
14
|
-
let newLineNo = hunk.newStart;
|
|
15
|
-
let additions = 0;
|
|
16
|
-
let deletions = 0;
|
|
17
|
-
for (const line of hunk.lines) {
|
|
18
|
-
const content = line.slice(1); // Remove +/- prefix
|
|
19
|
-
if (line.startsWith("+")) {
|
|
20
|
-
lines.push({ type: "added", content, newLineNo: newLineNo++ });
|
|
21
|
-
additions++;
|
|
22
|
-
}
|
|
23
|
-
else if (line.startsWith("-")) {
|
|
24
|
-
lines.push({ type: "removed", content, oldLineNo: oldLineNo++ });
|
|
25
|
-
deletions++;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
lines.push({ type: "unchanged", content, oldLineNo: oldLineNo++, newLineNo: newLineNo++ });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
filePath,
|
|
33
|
-
hunks: [
|
|
34
|
-
{
|
|
35
|
-
oldStart: hunk.oldStart,
|
|
36
|
-
oldLines: hunk.oldLines,
|
|
37
|
-
newStart: hunk.newStart,
|
|
38
|
-
newLines: hunk.newLines,
|
|
39
|
-
lines,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
additions,
|
|
43
|
-
deletions,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export function FileEditToolUpdatedMessage({ filePath, structuredPatch, verbose, }) {
|
|
47
|
-
const { columns } = useTerminalSize();
|
|
48
|
-
const numAdditions = structuredPatch.reduce((count, hunk) => count + hunk.lines.filter((_) => _.startsWith("+")).length, 0);
|
|
49
|
-
const numRemovals = structuredPatch.reduce((count, hunk) => count + hunk.lines.filter((_) => _.startsWith("-")).length, 0);
|
|
50
|
-
// Collect all diff lines across hunks to enforce a 3-line collapsed view
|
|
51
|
-
const allDiffLines = structuredPatch.flatMap((hunk) => hunk.lines.filter((l) => l.startsWith("+") || l.startsWith("-")));
|
|
52
|
-
const MAX_DIFF_LINES = 2; // 1 summary + 2 diff lines = 3 lines total
|
|
53
|
-
const showDiff = verbose || allDiffLines.length <= MAX_DIFF_LINES;
|
|
54
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [numAdditions > 0 ? (_jsxs(_Fragment, { children: ["Added ", _jsx(Text, { bold: true, children: numAdditions }), " ", numAdditions > 1 ? "lines" : "line"] })) : null, numAdditions > 0 && numRemovals > 0 ? ", " : null, numRemovals > 0 ? (_jsxs(_Fragment, { children: ["removed ", _jsx(Text, { bold: true, children: numRemovals }), " ", numRemovals > 1 ? "lines" : "line"] })) : null, !showDiff ? (_jsxs(Text, { color: getTheme().colors.textMuted, children: [" (", allDiffLines.length, " diff lines)"] })) : null] }), showDiff &&
|
|
55
|
-
intersperse(structuredPatch.map((_) => (_jsx(Box, { flexDirection: "column", paddingLeft: 5, children: _jsx(StructuredDiff, { diff: hunkToFileDiff(_, filePath), showHeader: false, dim: false, width: columns - 12 }) }, _.newStart))), (i) => (_jsx(Box, { paddingLeft: 5, children: _jsx(Text, { color: getTheme().colors.textMuted, children: "..." }) }, `ellipsis-${i}`)))] }));
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=FileEditToolUpdatedMessage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileEditToolUpdatedMessage.js","sourceRoot":"","sources":["../../../src/ui/components/FileEditToolUpdatedMessage.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,SAAS,WAAW,CAAI,EAAO,EAAE,SAA+B;IAC9D,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;AAEnC,qEAAqE;AACrE,SAAS,cAAc,CAAC,IAAyB,EAAE,QAAgB;IACjE,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC9B,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC9B,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,oBAA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AQ,CAAC,CAAC,CAAC,CACX,MAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,SAAS,mBAAK,YAAY,CAAC,MAAM,oBAAoB,CACrF,CAAC,CAAC,CAAC,IAAI,IACH,EACN,QAAQ;gBACP,WAAW,CACT,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACzB,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,YACxC,KAAC,cAAc,IACb,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,EACjC,UAAU,EAAE,KAAK,EACjB,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,OAAO,GAAG,EAAE,GACnB,IAN6C,CAAC,CAAC,QAAQ,CAOrD,CACP,CAAC,EACF,CAAC,CAAC,EAAE,EAAE,CAAC,CACL,KAAC,GAAG,IAAC,WAAW,EAAE,CAAC,YACjB,KAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,SAAS,oBAAY,IAD5B,YAAY,CAAC,EAAE,CAEnC,CACP,CACF,IACC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { getTheme } from "../theme/index.js";
|
|
4
|
-
/**
|
|
5
|
-
* HandoffMarker displays a visual separator for arion handoff transitions.
|
|
6
|
-
*
|
|
7
|
-
* Outgoing:
|
|
8
|
-
* \u2192 Researcher
|
|
9
|
-
*
|
|
10
|
-
* Returning:
|
|
11
|
-
* \u2190 Researcher
|
|
12
|
-
*/
|
|
13
|
-
export function HandoffMarker({ target, direction }) {
|
|
14
|
-
const theme = getTheme();
|
|
15
|
-
const arrow = direction === "to" ? "\u2192" : "\u2190";
|
|
16
|
-
return (_jsx(Box, { children: _jsxs(Text, { color: theme.colors.warning, children: [arrow, " ", target] }) }));
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=HandoffMarker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HandoffMarker.js","sourceRoot":"","sources":["../../../src/ui/components/HandoffMarker.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAS7C;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAsB;IACrE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvD,OAAO,CACL,KAAC,GAAG,cACF,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,aAC9B,KAAK,OAAG,MAAM,IACV,GACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Substitution: logError → console.error
|
|
3
|
-
import { highlight, supportsLanguage } from "cli-highlight";
|
|
4
|
-
import { Text } from "ink";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
|
-
export function HighlightedCode({ code, language }) {
|
|
7
|
-
const highlightedCode = useMemo(() => {
|
|
8
|
-
try {
|
|
9
|
-
if (language && supportsLanguage(language)) {
|
|
10
|
-
return highlight(code, { language });
|
|
11
|
-
}
|
|
12
|
-
// Silent fallback — no console.error (was leaking into terminal output)
|
|
13
|
-
return highlight(code, { language: "markdown" });
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return code;
|
|
17
|
-
}
|
|
18
|
-
}, [code, language]);
|
|
19
|
-
return _jsx(Text, { children: highlightedCode });
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=HighlightedCode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedCode.js","sourceRoot":"","sources":["../../../src/ui/components/HighlightedCode.tsx"],"names":[],"mappings":";AAAA,yCAAyC;AAEzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAOvC,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAS;IACvD,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,IAAI,CAAC;YACH,IAAI,QAAQ,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC3C,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;YACvC,CAAC;YACD,wEAAwE;YACxE,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAErB,OAAO,KAAC,IAAI,cAAE,eAAe,GAAQ,CAAC;AACxC,CAAC"}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Box, Text } from "ink";
|
|
4
|
-
import { TextInput } from "./text-input/index.js";
|
|
5
|
-
import { ArionPrompt } from "./ArionPrompt.js";
|
|
6
|
-
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
7
|
-
import { isShiftEnterKeyBindingInstalled, isTerminalSetupSupported, } from "../../commands/terminal-setup.js";
|
|
8
|
-
const PASTED_IMAGE_MIME_TYPE = "image/png";
|
|
9
|
-
const IMAGE_PLACEHOLDER = "[Image pasted]";
|
|
10
|
-
function toImageDataUri(base64Image) {
|
|
11
|
-
return `data:${PASTED_IMAGE_MIME_TYPE};base64,${base64Image}`;
|
|
12
|
-
}
|
|
13
|
-
export function InputArea({ userName, value, onChange, onSubmit, onTrigger, onExit, isStreaming = false, isDisabled = false, focus, history = [], onSaveInput, onDoubleEscape, }) {
|
|
14
|
-
const { columns } = useTerminalSize();
|
|
15
|
-
const textInputColumns = columns - 6; // 3 (prompt) + 2 (border) + 1 (padding)
|
|
16
|
-
const showShiftEnterHint = isTerminalSetupSupported() && isShiftEnterKeyBindingInstalled();
|
|
17
|
-
// History navigation state
|
|
18
|
-
const [historyIndex, setHistoryIndex] = useState(-1);
|
|
19
|
-
const [savedInput, setSavedInput] = useState("");
|
|
20
|
-
// Local history (session-scoped, most recent first)
|
|
21
|
-
const [localHistory, setLocalHistory] = useState(history);
|
|
22
|
-
// Cursor and paste state (matching PromptInput pattern)
|
|
23
|
-
const [cursorOffset, setCursorOffset] = useState(value.length);
|
|
24
|
-
const [pastedText, setPastedText] = useState(null);
|
|
25
|
-
const [pastedImage, setPastedImage] = useState(null);
|
|
26
|
-
const [exitMessage, setExitMessage] = useState({ show: false });
|
|
27
|
-
const [message, setMessage] = useState({ show: false });
|
|
28
|
-
// Refs for value/cursorOffset so that handleTextPaste (called asynchronously
|
|
29
|
-
// from a setTimeout+microtask) always reads the CURRENT state, not stale
|
|
30
|
-
// closure values from the render when the paste timer was scheduled.
|
|
31
|
-
const valueRef = useRef(value);
|
|
32
|
-
const cursorOffsetRef = useRef(cursorOffset);
|
|
33
|
-
const pastedTextRef = useRef(pastedText);
|
|
34
|
-
const pastedImageRef = useRef(pastedImage);
|
|
35
|
-
valueRef.current = value;
|
|
36
|
-
cursorOffsetRef.current = cursorOffset;
|
|
37
|
-
pastedTextRef.current = pastedText;
|
|
38
|
-
pastedImageRef.current = pastedImage;
|
|
39
|
-
// NOTE: Do not auto-sync cursorOffset with value.length!
|
|
40
|
-
// The TextInput component manages cursor position via onChangeCursorOffset.
|
|
41
|
-
// Auto-syncing here causes the cursor to jump to the end on every keystroke.
|
|
42
|
-
// Sync localHistory with incoming persistent history
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (history.length > 0) {
|
|
45
|
-
setLocalHistory((prev) => {
|
|
46
|
-
// Merge: persistent history items not already in local
|
|
47
|
-
const merged = [...prev];
|
|
48
|
-
for (const item of history) {
|
|
49
|
-
if (!merged.includes(item)) {
|
|
50
|
-
merged.push(item);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return merged.slice(0, 100);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}, [history]);
|
|
57
|
-
// Reset historyIndex when history becomes empty
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (localHistory.length === 0 && historyIndex >= 0) {
|
|
60
|
-
setHistoryIndex(-1);
|
|
61
|
-
}
|
|
62
|
-
}, [localHistory.length]);
|
|
63
|
-
// --- History navigation handlers (for TextInput callbacks) ---
|
|
64
|
-
const handleHistoryUp = useCallback(() => {
|
|
65
|
-
if (localHistory.length === 0)
|
|
66
|
-
return;
|
|
67
|
-
if (historyIndex === -1) {
|
|
68
|
-
setSavedInput(value);
|
|
69
|
-
}
|
|
70
|
-
const newIndex = Math.min(historyIndex + 1, localHistory.length - 1);
|
|
71
|
-
setHistoryIndex(newIndex);
|
|
72
|
-
if (newIndex >= 0 && newIndex < localHistory.length) {
|
|
73
|
-
const entry = localHistory[newIndex];
|
|
74
|
-
onChange(entry);
|
|
75
|
-
setCursorOffset(entry.length);
|
|
76
|
-
}
|
|
77
|
-
}, [localHistory, historyIndex, value, onChange]);
|
|
78
|
-
const handleHistoryDown = useCallback(() => {
|
|
79
|
-
if (historyIndex < 0)
|
|
80
|
-
return;
|
|
81
|
-
const newIndex = historyIndex - 1;
|
|
82
|
-
setHistoryIndex(newIndex);
|
|
83
|
-
if (newIndex === -1) {
|
|
84
|
-
onChange(savedInput);
|
|
85
|
-
setCursorOffset(savedInput.length);
|
|
86
|
-
}
|
|
87
|
-
else if (newIndex >= 0 && newIndex < localHistory.length) {
|
|
88
|
-
const entry = localHistory[newIndex];
|
|
89
|
-
onChange(entry);
|
|
90
|
-
setCursorOffset(entry.length);
|
|
91
|
-
}
|
|
92
|
-
else if (newIndex >= localHistory.length) {
|
|
93
|
-
// History shrank, reset to saved input
|
|
94
|
-
setHistoryIndex(-1);
|
|
95
|
-
onChange(savedInput);
|
|
96
|
-
setCursorOffset(savedInput.length);
|
|
97
|
-
}
|
|
98
|
-
}, [historyIndex, savedInput, localHistory, onChange]);
|
|
99
|
-
// --- Change handler with trigger detection ---
|
|
100
|
-
const handleChange = useCallback((newValue) => {
|
|
101
|
-
// Reset history navigation when user types
|
|
102
|
-
setHistoryIndex(-1);
|
|
103
|
-
// Detect triggers - always update value, then fire trigger
|
|
104
|
-
const isNewCommand = newValue === "/" || (newValue.startsWith("/") && !value.startsWith("/"));
|
|
105
|
-
// Detect @mention using the same Unicode/hyphen-safe name class as arion mention parsing.
|
|
106
|
-
const mentionMatch = newValue.match(/@([\p{L}\p{N}_-]*)$/u);
|
|
107
|
-
const wasAlreadyMention = value.match(/@[\p{L}\p{N}_-]*$/u);
|
|
108
|
-
const isNewMention = mentionMatch && !wasAlreadyMention;
|
|
109
|
-
// Always update the value first
|
|
110
|
-
onChange(newValue);
|
|
111
|
-
// Then fire triggers
|
|
112
|
-
if (isNewCommand) {
|
|
113
|
-
onTrigger("command", newValue.slice(1));
|
|
114
|
-
}
|
|
115
|
-
else if (isNewMention) {
|
|
116
|
-
// Extract filter text after the @
|
|
117
|
-
onTrigger("mention", mentionMatch[1]);
|
|
118
|
-
}
|
|
119
|
-
}, [value, onChange, onTrigger]);
|
|
120
|
-
// --- Submit handler (moved from App.tsx) ---
|
|
121
|
-
const handleInternalSubmit = useCallback((submittedValue) => {
|
|
122
|
-
const latestValue = valueRef.current;
|
|
123
|
-
const latestPastedText = pastedTextRef.current;
|
|
124
|
-
const latestPastedImage = pastedImageRef.current;
|
|
125
|
-
let finalInput = submittedValue !== latestValue && (latestPastedText !== null || latestPastedImage !== null)
|
|
126
|
-
? latestValue
|
|
127
|
-
: submittedValue;
|
|
128
|
-
// If there's pasted text, expand the placeholder back to the real pasted content
|
|
129
|
-
if (latestPastedText) {
|
|
130
|
-
const newlineCount = (latestPastedText.match(/\r\n|\r|\n/g) || []).length;
|
|
131
|
-
const pastedPrompt = `[Pasted text +${newlineCount} lines] `;
|
|
132
|
-
if (finalInput.includes(pastedPrompt)) {
|
|
133
|
-
finalInput = finalInput.replaceAll(pastedPrompt, latestPastedText);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (latestPastedImage && finalInput.includes(IMAGE_PLACEHOLDER)) {
|
|
137
|
-
finalInput = finalInput.replaceAll(IMAGE_PLACEHOLDER, "");
|
|
138
|
-
}
|
|
139
|
-
const hasImageAttachment = latestPastedImage !== null;
|
|
140
|
-
const trimmedForHistory = finalInput.trim();
|
|
141
|
-
if (!trimmedForHistory && !hasImageAttachment)
|
|
142
|
-
return;
|
|
143
|
-
if (hasImageAttachment) {
|
|
144
|
-
const imageDataUri = toImageDataUri(latestPastedImage);
|
|
145
|
-
finalInput = trimmedForHistory ? `${finalInput}\n\n${imageDataUri}` : imageDataUri;
|
|
146
|
-
}
|
|
147
|
-
if (trimmedForHistory) {
|
|
148
|
-
onSaveInput?.(trimmedForHistory); // Save text prompt history without large data URIs
|
|
149
|
-
// Update local history (most recent first, no duplicates)
|
|
150
|
-
setLocalHistory((prev) => [trimmedForHistory, ...prev.filter((h) => h !== trimmedForHistory)].slice(0, 100));
|
|
151
|
-
}
|
|
152
|
-
valueRef.current = "";
|
|
153
|
-
cursorOffsetRef.current = 0;
|
|
154
|
-
pastedTextRef.current = null;
|
|
155
|
-
pastedImageRef.current = null;
|
|
156
|
-
onChange(""); // Clear input
|
|
157
|
-
setPastedText(null);
|
|
158
|
-
setPastedImage(null);
|
|
159
|
-
setMessage({ show: false });
|
|
160
|
-
onSubmit(finalInput);
|
|
161
|
-
}, [onSubmit, onSaveInput, onChange]);
|
|
162
|
-
// --- Paste handlers (matching PromptInput pattern) ---
|
|
163
|
-
function handleImagePaste(image) {
|
|
164
|
-
pastedImageRef.current = image;
|
|
165
|
-
setPastedImage(image);
|
|
166
|
-
setMessage({ show: true, text: "Image attached. Press Enter to send." });
|
|
167
|
-
}
|
|
168
|
-
function handleTextPaste(rawText) {
|
|
169
|
-
// Read current state from refs — this function is called asynchronously
|
|
170
|
-
// (setTimeout + microtask) so closure values may be stale.
|
|
171
|
-
const currentValue = valueRef.current;
|
|
172
|
-
const currentOffset = cursorOffsetRef.current;
|
|
173
|
-
const text = rawText.replace(/\r/g, "\n");
|
|
174
|
-
const newlineCount = (text.match(/\r\n|\r|\n/g) || []).length;
|
|
175
|
-
const pastedPrompt = `[Pasted text +${newlineCount} lines] `;
|
|
176
|
-
const newInput = currentValue.slice(0, currentOffset) + pastedPrompt + currentValue.slice(currentOffset);
|
|
177
|
-
valueRef.current = newInput;
|
|
178
|
-
onChange(newInput);
|
|
179
|
-
const nextCursorOffset = currentOffset + pastedPrompt.length;
|
|
180
|
-
cursorOffsetRef.current = nextCursorOffset;
|
|
181
|
-
setCursorOffset(currentOffset + pastedPrompt.length);
|
|
182
|
-
pastedTextRef.current = text;
|
|
183
|
-
setPastedText(text);
|
|
184
|
-
}
|
|
185
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderLeft: false, borderRight: false, borderDimColor: true, width: "100%", children: _jsxs(Box, { children: [_jsx(ArionPrompt, { userName: userName }), _jsx(TextInput, { multiline: true, value: value, onChange: handleChange, onSubmit: handleInternalSubmit, onHistoryUp: handleHistoryUp, onHistoryDown: handleHistoryDown, onHistoryReset: () => setHistoryIndex(-1), onDoubleEscape: onDoubleEscape, onExit: onExit, onExitMessage: (show, key) => setExitMessage({ show, key }), onMessage: (show, text) => setMessage({ show, text }), onImagePaste: handleImagePaste, onPaste: handleTextPaste, columns: textInputColumns, isDimmed: isDisabled, focus: focus !== false, showCursor: true, cursorOffset: cursorOffset, onChangeCursorOffset: setCursorOffset })] }) }), _jsx(Box, { flexDirection: "row", justifyContent: "space-between", paddingX: 2, children: _jsx(Box, { justifyContent: "flex-start", gap: 1, children: exitMessage.show ? (_jsxs(Text, { dimColor: true, children: ["Press ", exitMessage.key, " again to exit"] })) : message.show ? (_jsx(Text, { dimColor: true, children: message.text })) : (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: "/ for commands \u00B7 @ to mention \u00B7 esc to undo" }), _jsx(Text, { dimColor: true, children: showShiftEnterHint ? "shift + ⏎ for newline" : "\\⏎ for newline" })] })) }) })] }));
|
|
186
|
-
}
|
|
187
|
-
//# sourceMappingURL=InputArea.js.map
|