@aria-cli/cli 1.0.57 → 1.0.59
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 +799 -668
- package/package.json +17 -76
- package/dist/.tsbuildinfo +0 -1
- package/dist/attached-local-control-client.js +0 -826
- package/dist/bootstrap-local-control-client.js +0 -2
- package/dist/capability-aware-method-proxy.js +0 -42
- package/dist/cli-context.js +0 -160
- package/dist/commands/arions.js +0 -174
- package/dist/commands/auth.js +0 -123
- package/dist/commands/daemon.js +0 -367
- package/dist/commands/definitions.js +0 -176
- package/dist/commands/index.js +0 -80
- package/dist/commands/login-handler.js +0 -1108
- package/dist/commands/logout-handler.js +0 -92
- package/dist/commands/memory-handlers.js +0 -89
- package/dist/commands/pairing.js +0 -60
- package/dist/commands/runtime-cutover-reset-command.js +0 -12
- package/dist/commands/runtime-cutover-reset.js +0 -265
- package/dist/commands/terminal-setup.js +0 -84
- package/dist/config/aria-config.js +0 -238
- package/dist/config/index.js +0 -3
- package/dist/config/loader.js +0 -97
- package/dist/config.js +0 -142
- package/dist/daemon-info.js +0 -10
- package/dist/ensure-daemon.js +0 -128
- package/dist/entrypoints/command-mode.js +0 -5
- package/dist/entrypoints/daemon.js +0 -50
- package/dist/entrypoints/headless-stdio.js +0 -25
- package/dist/entrypoints/interactive.js +0 -80
- package/dist/event-loop-watchdog.js +0 -73
- package/dist/headless/auth-orchestrator.js +0 -508
- package/dist/headless/auth-service.js +0 -43
- package/dist/headless/bootstrap-fast-path.js +0 -112
- package/dist/headless/call-command.js +0 -143
- package/dist/headless/daemon-service.js +0 -318
- package/dist/headless/hook-actions.js +0 -235
- package/dist/headless/hook-service.js +0 -42
- package/dist/headless/kernel-services.js +0 -216
- package/dist/headless/kernel.js +0 -785
- package/dist/headless/operations/arion.js +0 -119
- package/dist/headless/operations/auth.js +0 -45
- package/dist/headless/operations/client.js +0 -31
- package/dist/headless/operations/config.js +0 -69
- package/dist/headless/operations/daemon.js +0 -47
- package/dist/headless/operations/hook.js +0 -56
- package/dist/headless/operations/index.js +0 -11
- package/dist/headless/operations/memory.js +0 -102
- package/dist/headless/operations/message.js +0 -279
- package/dist/headless/operations/model.js +0 -100
- package/dist/headless/operations/peer.js +0 -56
- package/dist/headless/operations/run.js +0 -24
- package/dist/headless/operations/session.js +0 -90
- package/dist/headless/operations/system.js +0 -19
- package/dist/headless/operations/utils.js +0 -35
- package/dist/headless/run-orchestrator.js +0 -703
- package/dist/headless/stdio-server.js +0 -439
- package/dist/history/SessionHistory.js +0 -8
- package/dist/history/SessionHistoryClient.js +0 -186
- package/dist/history/conversation-message.js +0 -112
- package/dist/history/index.js +0 -8
- package/dist/history/jsonl-replay.js +0 -154
- package/dist/history/repair-tool-pairing.js +0 -84
- package/dist/history/stall-phase-bridge.js +0 -11
- package/dist/history/turn-accumulator.js +0 -427
- package/dist/index.js +0 -7
- package/dist/ink-repl.js +0 -4183
- package/dist/local-control-bootstrap.js +0 -26
- package/dist/local-control-client.js +0 -2
- package/dist/local-control-error-reporting.js +0 -34
- package/dist/local-control-http-client.js +0 -362
- package/dist/local-control-lazy-wrapper.js +0 -363
- package/dist/local-control-manager.js +0 -146
- package/dist/main.js +0 -62
- package/dist/network-security.js +0 -62
- package/dist/networking-server.js +0 -38
- package/dist/peer-identity.js +0 -23
- package/dist/polling-subscription.js +0 -34
- package/dist/relaunch.js +0 -617
- package/dist/release-notes.js +0 -35
- package/dist/repl-cleanup.js +0 -47
- package/dist/runtime/configure-bun-sqlite.js +0 -3
- package/dist/runtime/crash-handlers.js +0 -111
- package/dist/runtime/interactive-invocation.js +0 -39
- package/dist/runtime/internal-mode.js +0 -14
- package/dist/runtime/launch-spec.js +0 -64
- package/dist/runtime/owner-lease.js +0 -44
- package/dist/runtime/public-mode.js +0 -20
- package/dist/runtime/run-internal-mode.js +0 -18
- package/dist/runtime/runtime-kind.js +0 -32
- package/dist/runtime/spawn-aria.js +0 -38
- package/dist/selectable-client.js +0 -2
- package/dist/selectable-peer.js +0 -2
- package/dist/session.js +0 -203
- package/dist/slash-commands.js +0 -80
- package/dist/sounds.js +0 -210
- package/dist/ui/App.js +0 -526
- package/dist/ui/components/AnthropicMethodPicker.js +0 -6
- package/dist/ui/components/ArionPrompt.js +0 -15
- package/dist/ui/components/AutocompleteDropdown.js +0 -23
- package/dist/ui/components/AutonomySelector.js +0 -55
- package/dist/ui/components/Banner.js +0 -98
- package/dist/ui/components/ConversationHistory.js +0 -175
- package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
- package/dist/ui/components/CopilotSourcePicker.js +0 -50
- package/dist/ui/components/Cost.js +0 -10
- package/dist/ui/components/CustomSelect/option-map.js +0 -30
- package/dist/ui/components/CustomSelect/select-option.js +0 -13
- package/dist/ui/components/CustomSelect/select.js +0 -42
- package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
- package/dist/ui/components/CustomSelect/use-select.js +0 -15
- package/dist/ui/components/ErrorDisplay.js +0 -35
- package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
- package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
- package/dist/ui/components/HandoffMarker.js +0 -18
- package/dist/ui/components/HighlightedCode.js +0 -21
- package/dist/ui/components/InputArea.js +0 -187
- package/dist/ui/components/Message.js +0 -25
- package/dist/ui/components/OAuthLoginFlow.js +0 -113
- package/dist/ui/components/OutputTruncation.js +0 -35
- package/dist/ui/components/PermissionPrompt.js +0 -79
- package/dist/ui/components/PipelineTimingPanel.js +0 -15
- package/dist/ui/components/ProviderMethodPicker.js +0 -61
- package/dist/ui/components/ProviderPicker.js +0 -63
- package/dist/ui/components/RenderItemView.js +0 -71
- package/dist/ui/components/Spinner.js +0 -46
- package/dist/ui/components/StatusBar.js +0 -95
- package/dist/ui/components/StreamingIndicator.js +0 -55
- package/dist/ui/components/StructuredDiff.js +0 -168
- package/dist/ui/components/TextInputOverlay.js +0 -43
- package/dist/ui/components/ThinkingBlock.js +0 -82
- package/dist/ui/components/ToolCost.js +0 -17
- package/dist/ui/components/ToolExecution.js +0 -61
- package/dist/ui/components/ToolHeader.js +0 -51
- package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
- package/dist/ui/components/ToolResultWrapper.js +0 -6
- package/dist/ui/components/ToolUseLoader.js +0 -35
- package/dist/ui/components/TraceWaterfall.js +0 -91
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
- package/dist/ui/components/messages/UserImageMessage.js +0 -12
- package/dist/ui/components/messages/UserTextMessage.js +0 -12
- package/dist/ui/components/overlays/ArionSelector.js +0 -68
- package/dist/ui/components/overlays/ClientSelector.js +0 -62
- package/dist/ui/components/overlays/CommandPalette.js +0 -67
- package/dist/ui/components/overlays/DaemonControl.js +0 -87
- package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
- package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
- package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
- package/dist/ui/components/overlays/MessageSelector.js +0 -123
- package/dist/ui/components/overlays/ModelSelector.js +0 -211
- package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
- package/dist/ui/components/overlays/PeerSelector.js +0 -84
- package/dist/ui/components/overlays/SessionSelector.js +0 -102
- package/dist/ui/components/overlays/SoundSelector.js +0 -86
- package/dist/ui/components/overlays/ThemeSelector.js +0 -139
- package/dist/ui/components/overlays/index.js +0 -15
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
- package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
- package/dist/ui/components/permissions/PermissionRequest.js +0 -70
- package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
- package/dist/ui/components/permissions/hooks.js +0 -10
- package/dist/ui/components/permissions/toolUseOptions.js +0 -68
- package/dist/ui/components/permissions/utils.js +0 -10
- package/dist/ui/components/text-input/Cursor.js +0 -326
- package/dist/ui/components/text-input/TextInput.js +0 -231
- package/dist/ui/components/text-input/imagePaste.js +0 -28
- package/dist/ui/components/text-input/index.js +0 -6
- package/dist/ui/components/text-input/useDoublePress.js +0 -30
- package/dist/ui/components/text-input/useTextInput.js +0 -245
- package/dist/ui/components/tool-types.js +0 -9
- package/dist/ui/constants/figures.js +0 -4
- package/dist/ui/constants/index.js +0 -3
- package/dist/ui/display-mode.js +0 -93
- package/dist/ui/display-policy.js +0 -19
- package/dist/ui/hooks/index.js +0 -6
- package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
- package/dist/ui/hooks/useDoublePress.js +0 -37
- package/dist/ui/hooks/useIndicatorState.js +0 -55
- package/dist/ui/hooks/useInterval.js +0 -23
- package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
- package/dist/ui/hooks/useTerminalSize.js +0 -55
- package/dist/ui/hooks/useUnifiedMessages.js +0 -117
- package/dist/ui/indicator-state.js +0 -44
- package/dist/ui/markdown/highlight.js +0 -44
- package/dist/ui/markdown/index.js +0 -1460
- package/dist/ui/markdown/tokenizer.js +0 -24
- package/dist/ui/render-item.js +0 -5
- package/dist/ui/screens/REPL.js +0 -119
- package/dist/ui/screens/approval-lifecycle.js +0 -38
- package/dist/ui/status-line.js +0 -72
- package/dist/ui/theme/index.js +0 -51
- package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-dark.js +0 -50
- package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-light.js +0 -50
- package/dist/ui/theme/themes/dark-accessible.js +0 -18
- package/dist/ui/theme/themes/dark.js +0 -49
- package/dist/ui/theme/themes/light-accessible.js +0 -18
- package/dist/ui/theme/themes/light.js +0 -49
- package/dist/ui/theme/types.js +0 -3
- package/dist/ui/theme.js +0 -142
- package/dist/ui/to-render-items.js +0 -145
- package/dist/ui/tools/AgentTool/index.js +0 -30
- package/dist/ui/tools/ArchitectTool/index.js +0 -31
- package/dist/ui/tools/AskUserTool/index.js +0 -46
- package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
- package/dist/ui/tools/BashTool/OutputLine.js +0 -21
- package/dist/ui/tools/BashTool/index.js +0 -91
- package/dist/ui/tools/BrowseTool/index.js +0 -43
- package/dist/ui/tools/BrowserTool/index.js +0 -47
- package/dist/ui/tools/CbmTool/index.js +0 -188
- package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
- package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
- package/dist/ui/tools/CreateQuipTool/index.js +0 -30
- package/dist/ui/tools/CreateSkillTool/index.js +0 -22
- package/dist/ui/tools/CreateToolTool/index.js +0 -31
- package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
- package/dist/ui/tools/DeployTool/index.js +0 -47
- package/dist/ui/tools/FffTool/index.js +0 -103
- package/dist/ui/tools/FileEditTool/index.js +0 -67
- package/dist/ui/tools/FileReadTool/index.js +0 -68
- package/dist/ui/tools/FileWriteTool/index.js +0 -61
- package/dist/ui/tools/ForkTool/index.js +0 -47
- package/dist/ui/tools/FrgTool/index.js +0 -96
- package/dist/ui/tools/GetThreadTool/index.js +0 -39
- package/dist/ui/tools/GlobTool/index.js +0 -50
- package/dist/ui/tools/GrepTool/index.js +0 -84
- package/dist/ui/tools/HatchArionTool/index.js +0 -36
- package/dist/ui/tools/LearnSkillTool/index.js +0 -22
- package/dist/ui/tools/LearnTool/index.js +0 -43
- package/dist/ui/tools/LearnToolTool/index.js +0 -22
- package/dist/ui/tools/ListClientsTool/index.js +0 -39
- package/dist/ui/tools/LspTool/index.js +0 -261
- package/dist/ui/tools/MCPTool/index.js +0 -33
- package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
- package/dist/ui/tools/MemoryReadTool/index.js +0 -64
- package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
- package/dist/ui/tools/NotebookEditTool/index.js +0 -33
- package/dist/ui/tools/NotebookReadTool/index.js +0 -25
- package/dist/ui/tools/OutlookReadTool/index.js +0 -66
- package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
- package/dist/ui/tools/OutlookSendTool/index.js +0 -49
- package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
- package/dist/ui/tools/ProbeTool/index.js +0 -121
- package/dist/ui/tools/ProcessTool/index.js +0 -66
- package/dist/ui/tools/QuestListTool/index.js +0 -46
- package/dist/ui/tools/QuestReportTool/index.js +0 -49
- package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
- package/dist/ui/tools/QuipCommentTool/index.js +0 -69
- package/dist/ui/tools/QuipReadTool/index.js +0 -71
- package/dist/ui/tools/RestArionTool/index.js +0 -32
- package/dist/ui/tools/RestartTool/index.js +0 -35
- package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
- package/dist/ui/tools/RetireArionTool/index.js +0 -32
- package/dist/ui/tools/RgTool/index.js +0 -73
- package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
- package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
- package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
- package/dist/ui/tools/SendMessageTool/index.js +0 -45
- package/dist/ui/tools/SerenaTool/index.js +0 -124
- package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
- package/dist/ui/tools/SgTool/index.js +0 -80
- package/dist/ui/tools/SlackReactTool/index.js +0 -41
- package/dist/ui/tools/SlackReadTool/index.js +0 -48
- package/dist/ui/tools/SlackSendTool/index.js +0 -45
- package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
- package/dist/ui/tools/StickerRequestTool/index.js +0 -19
- package/dist/ui/tools/ThinkTool/index.js +0 -17
- package/dist/ui/tools/UgTool/index.js +0 -108
- package/dist/ui/tools/UseSkillTool/index.js +0 -22
- package/dist/ui/tools/WakeArionTool/index.js +0 -32
- package/dist/ui/tools/WebFetchTool/index.js +0 -56
- package/dist/ui/tools/WebSearchTool/index.js +0 -44
- package/dist/ui/tools/lsTool/index.js +0 -58
- package/dist/ui/tools/registry.js +0 -197
- package/dist/ui/tools/tool-renderer.js +0 -11
- package/dist/ui/tools/truncation.js +0 -35
- package/dist/ui/types/anthropic.js +0 -4
- package/dist/ui/types/index.js +0 -2
- package/dist/ui/types/message.js +0 -3
- package/dist/ui/types/tool.js +0 -4
- package/dist/ui/utils/array.js +0 -4
- package/dist/ui/utils/cursor.js +0 -131
- package/dist/ui/utils/diff.js +0 -120
- package/dist/ui/utils/format.js +0 -42
- package/dist/ui/utils/fuzzy.js +0 -59
- package/dist/ui/utils/index.js +0 -11
- package/dist/ui/utils/keys.js +0 -8
- package/dist/ui/utils/patch.js +0 -17
- package/dist/ui/utils/risk.js +0 -114
- package/dist/ui/utils/terminal-image.js +0 -70
- package/dist/ui/utils/validation.js +0 -48
- package/dist/ui/verb-pairs.js +0 -248
- package/dist/ui.js +0 -131
- 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
package/dist/ui/App.js
DELETED
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback, useMemo, useEffect } from "react";
|
|
3
|
-
import { Box, Static, Text, useApp, useInput } from "ink";
|
|
4
|
-
import { StatusBar, InputArea, StreamingIndicator, CommandPalette, ArionSelector, ModelSelector, MemoryBrowser, PeerSelector, ClientSelector, InviteShareOverlay, JoinInviteOverlay, PairRequestOverlay, SessionSelector, MessageSelector, ThemeSelector, SoundSelector, DaemonControl, TraceWaterfall, PipelineTimingPanel, AutonomySelector, } from "./components/index.js";
|
|
5
|
-
import { ProviderPicker } from "./components/ProviderPicker.js";
|
|
6
|
-
import { CopilotSourcePicker, } from "./components/CopilotSourcePicker.js";
|
|
7
|
-
import { OAuthLoginFlow } from "./components/OAuthLoginFlow.js";
|
|
8
|
-
import { CopilotDeviceLoginFlow } from "./components/CopilotDeviceLoginFlow.js";
|
|
9
|
-
import { AnthropicMethodPicker } from "./components/AnthropicMethodPicker.js";
|
|
10
|
-
import { ProviderMethodPicker, } from "./components/ProviderMethodPicker.js";
|
|
11
|
-
import { TextInputOverlay } from "./components/TextInputOverlay.js";
|
|
12
|
-
import { RenderItemView } from "./components/RenderItemView.js";
|
|
13
|
-
import { UserTextMessage } from "./components/messages/UserTextMessage.js";
|
|
14
|
-
import { useTerminalSize } from "./hooks/useTerminalSize.js";
|
|
15
|
-
import { toRenderItems } from "./to-render-items.js";
|
|
16
|
-
import { applyDisplayPolicy } from "./display-policy.js";
|
|
17
|
-
import { applyMarkdown } from "./markdown/index.js";
|
|
18
|
-
import { DEFAULT_SAFETY_CONFIG } from "@aria-cli/aria";
|
|
19
|
-
import { useIndicatorState } from "./hooks/useIndicatorState.js";
|
|
20
|
-
import { isEscapeInput } from "./utils/keys.js";
|
|
21
|
-
import { discoveredPeerIdentityKey } from "../peer-identity.js";
|
|
22
|
-
const EMPTY_MESSAGES = [];
|
|
23
|
-
// formatApprovalDescription removed — PermissionPrompt rendering moved to REPL.tsx (C2 fix)
|
|
24
|
-
export function App({ session, model, maxContextTokens, banner, messages = [], previewMessages = [], isStreaming = false, queuedMessage, onCancelQueuedMessage, responseTime, commands = [], arions = [], models = [], memories = [], memoryBrowserMode = "browse", isLoadingMemories = false, userName, metrics, displayMode = "standard", displayConfig, showThinking = true, showCosts = true, showTraces = false, spans = [], pipelineTiming, activeArion, onSubmit, onCommand, onSelectArion, onSelectModel, onSelectTheme, onSelectMemory, onOpenMemoryBrowser, onToggleThinking, onToggleCosts, onToggleTraces, onCycleDisplayMode, sessions = [], onSelectSession, onLoadSessions, onSearchSessions, onLoadMoreSessions, staticRenderEpoch, openSessionOverlaySignal, openThemeOverlaySignal, openSoundOverlaySignal, openDaemonOverlaySignal, daemonStatus, daemonActionStatus, onDaemonAction, connectionState = "connected", inputHistory = [], onSaveInput, obsCtx, onCancel, approvalRequest, onApprovalChoice, effortLevel, showAutonomySelector, autonomyLevel, onAutonomySelect, onAutonomyCancel, onCycleAutonomy, onCycleEffort, loginPickerProviders, onLoginProviderSelect, onLoginPickerCancel, copilotSourceOptions, onCopilotSourceSelect, onCopilotSourceCancel, oauthProvider, oauthAuthorizeUrl, oauthExpectedState, onOAuthComplete, onOAuthCodeSubmit, onOAuthCancel, copilotDeviceProvider, copilotDeviceProfileLabel, copilotDeviceVerificationUri, copilotDeviceUserCode, onCopilotDeviceComplete, onCopilotDeviceApprove, onCopilotDeviceCancel, anthropicMethodOptions, onAnthropicMethodSelect, onAnthropicMethodCancel, anthropicKeyInputVisible, onAnthropicKeySubmit, onAnthropicKeyCancel, anthropicSetupTokenVisible, onAnthropicSetupTokenSubmit, onAnthropicSetupTokenCancel, openaiMethodOptions, onOpenAIMethodSelect, onOpenAIMethodCancel, openaiKeyInputVisible, onOpenAIKeySubmit, onOpenAIKeyCancel, googleMethodOptions, onGoogleMethodSelect, onGoogleMethodCancel, googleKeyInputVisible, onGoogleKeySubmit, onGoogleKeyCancel, authInteractionOptions, authInteractionTitle, onAuthInteractionSelect, onAuthInteractionCancel, authInteractionInput, onAuthInteractionInputSubmit, onAuthInteractionInputCancel, nearbyPeers = [], localClients = [], onSelectPeer, onSelectClient, onPeerCancel, onClientsCancel, openPeersOverlaySignal, openClientsOverlaySignal, inviteShare, onInviteShareClose, openJoinInviteOverlaySignal, onJoinInviteSubmit, onJoinInviteCancel, joinInviteError, incomingPairRequest, onAcceptPairRequest, onRejectPairRequest, onCancelPairing, openMessageEditOverlaySignal, editableMessages, onEditMessage, prefillInput, onPrefillConsumed, meshMessageCount = 0, runtimeSocket = null, clientId = null, clientAuthToken = null, resolveCredentials, }) {
|
|
25
|
-
const { exit } = useApp();
|
|
26
|
-
const { columns, rows } = useTerminalSize();
|
|
27
|
-
const [input, setInput] = useState("");
|
|
28
|
-
const [overlay, setOverlay] = useState("none");
|
|
29
|
-
const [commandFilter, setCommandFilter] = useState("");
|
|
30
|
-
const [arionFilter, setArionFilter] = useState("");
|
|
31
|
-
const [arionSelectorMode, setArionSelectorMode] = useState("become");
|
|
32
|
-
const [arionStatusFilter, setArionStatusFilter] = useState("all");
|
|
33
|
-
// Help overlay shown with Ctrl+/ hotkey
|
|
34
|
-
const [showHelp, setShowHelp] = useState(false);
|
|
35
|
-
// Sync overlay state for login flows.
|
|
36
|
-
// These flows are managed by their own state props but need to block InputArea
|
|
37
|
-
// so keyboard input doesn't leak through to the chat.
|
|
38
|
-
const hasLoginMethodPicker = Boolean(authInteractionOptions || anthropicMethodOptions || openaiMethodOptions || googleMethodOptions);
|
|
39
|
-
const hasLoginTextInput = Boolean(authInteractionInput ||
|
|
40
|
-
anthropicKeyInputVisible ||
|
|
41
|
-
anthropicSetupTokenVisible ||
|
|
42
|
-
openaiKeyInputVisible ||
|
|
43
|
-
googleKeyInputVisible);
|
|
44
|
-
const hasLoginOverlay = Boolean(oauthProvider || copilotDeviceProvider || loginPickerProviders || copilotSourceOptions);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
if (hasLoginMethodPicker) {
|
|
47
|
-
setOverlay("login-method");
|
|
48
|
-
}
|
|
49
|
-
else if (hasLoginTextInput) {
|
|
50
|
-
setOverlay("login-input");
|
|
51
|
-
}
|
|
52
|
-
else if (hasLoginOverlay) {
|
|
53
|
-
setOverlay("login");
|
|
54
|
-
}
|
|
55
|
-
else if (overlay === "login" || overlay === "login-method" || overlay === "login-input") {
|
|
56
|
-
setOverlay("none");
|
|
57
|
-
}
|
|
58
|
-
}, [hasLoginMethodPicker, hasLoginTextInput, hasLoginOverlay]);
|
|
59
|
-
const openSessionOverlay = useCallback(() => {
|
|
60
|
-
setOverlay("session");
|
|
61
|
-
// Let overlay render first so open feels instant, then load data.
|
|
62
|
-
setTimeout(() => onLoadSessions?.(), 0);
|
|
63
|
-
}, [onLoadSessions]);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (openSessionOverlaySignal === undefined)
|
|
66
|
-
return;
|
|
67
|
-
openSessionOverlay();
|
|
68
|
-
}, [openSessionOverlaySignal, openSessionOverlay]);
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (openThemeOverlaySignal === undefined)
|
|
71
|
-
return;
|
|
72
|
-
setOverlay("theme");
|
|
73
|
-
}, [openThemeOverlaySignal]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (openSoundOverlaySignal === undefined)
|
|
76
|
-
return;
|
|
77
|
-
setOverlay("sound");
|
|
78
|
-
}, [openSoundOverlaySignal]);
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
if (openDaemonOverlaySignal === undefined)
|
|
81
|
-
return;
|
|
82
|
-
setOverlay("daemon");
|
|
83
|
-
}, [openDaemonOverlaySignal]);
|
|
84
|
-
// Frozen peer list — snapshot when overlay opens, immune to background updates.
|
|
85
|
-
// Updated ONLY when new peers appear (never shrinks while overlay is open).
|
|
86
|
-
const [frozenPeers, setFrozenPeers] = useState([]);
|
|
87
|
-
// Open peers overlay when signal changes
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
if (openPeersOverlaySignal === undefined)
|
|
90
|
-
return;
|
|
91
|
-
setFrozenPeers([...nearbyPeers]);
|
|
92
|
-
setOverlay("peers");
|
|
93
|
-
}, [openPeersOverlaySignal]);
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
if (openClientsOverlaySignal === undefined)
|
|
96
|
-
return;
|
|
97
|
-
setOverlay("clients");
|
|
98
|
-
}, [openClientsOverlaySignal]);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (inviteShare) {
|
|
101
|
-
setOverlay("invite-share");
|
|
102
|
-
}
|
|
103
|
-
else if (overlay === "invite-share") {
|
|
104
|
-
setOverlay("none");
|
|
105
|
-
}
|
|
106
|
-
}, [inviteShare, overlay]);
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
if (openJoinInviteOverlaySignal === undefined)
|
|
109
|
-
return;
|
|
110
|
-
setOverlay("join-invite");
|
|
111
|
-
}, [openJoinInviteOverlaySignal]);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
if (openMessageEditOverlaySignal === undefined)
|
|
114
|
-
return;
|
|
115
|
-
if (editableMessages && editableMessages.length > 0) {
|
|
116
|
-
setOverlay("message-edit");
|
|
117
|
-
}
|
|
118
|
-
}, [openMessageEditOverlaySignal]);
|
|
119
|
-
// Prefill input text (e.g., after message-edit selection)
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
if (prefillInput !== undefined) {
|
|
122
|
-
setInput(prefillInput);
|
|
123
|
-
onPrefillConsumed?.();
|
|
124
|
-
}
|
|
125
|
-
}, [prefillInput]);
|
|
126
|
-
// When overlay is open, append newly discovered peers (never remove)
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
if (overlay !== "peers")
|
|
129
|
-
return;
|
|
130
|
-
setFrozenPeers((prev) => {
|
|
131
|
-
const existingPeerIds = new Set(prev.map(discoveredPeerIdentityKey));
|
|
132
|
-
const newPeers = nearbyPeers.filter((peer) => !existingPeerIds.has(discoveredPeerIdentityKey(peer)));
|
|
133
|
-
return newPeers.length > 0 ? [...prev, ...newPeers] : prev;
|
|
134
|
-
});
|
|
135
|
-
}, [overlay, nearbyPeers]);
|
|
136
|
-
// Show pair request overlay only when idle (not streaming, no other overlay).
|
|
137
|
-
// If we're busy, the request stays queued until conditions are met.
|
|
138
|
-
useEffect(() => {
|
|
139
|
-
if (incomingPairRequest && overlay === "none" && !isStreaming) {
|
|
140
|
-
setOverlay("pair-request");
|
|
141
|
-
}
|
|
142
|
-
else if (!incomingPairRequest && overlay === "pair-request") {
|
|
143
|
-
setOverlay("none");
|
|
144
|
-
}
|
|
145
|
-
}, [incomingPairRequest, overlay, isStreaming]);
|
|
146
|
-
// Handle Ctrl+C to exit (since we disabled exitOnCtrlC in render options)
|
|
147
|
-
const isRawModeSupported = process.stdin.isTTY ?? false;
|
|
148
|
-
useInput((input, key) => {
|
|
149
|
-
// Ctrl+C: let the approval dialog own cancellation semantics while it is open.
|
|
150
|
-
if (input === "\x03" || (key.ctrl && input === "c")) {
|
|
151
|
-
if (approvalRequest) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (isStreaming && onCancel) {
|
|
155
|
-
// First Ctrl+C during streaming: cancel and return to prompt.
|
|
156
|
-
// Don't call exit() — let the abort propagate through the runner
|
|
157
|
-
// and return control to the input area. This prevents the
|
|
158
|
-
// "double Ctrl+C" problem where the user force-kills the process
|
|
159
|
-
// because the first Ctrl+C was slow (HTTP stream still draining).
|
|
160
|
-
onCancel();
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
// Not streaming (idle at prompt): exit the app
|
|
164
|
-
exit();
|
|
165
|
-
}
|
|
166
|
-
// Escape key handling
|
|
167
|
-
if (isEscapeInput(input, key)) {
|
|
168
|
-
if (approvalRequest) {
|
|
169
|
-
// Let approval dialog own cancellation semantics.
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (overlay !== "none") {
|
|
173
|
-
handleCancel();
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
if (onCancelPairing) {
|
|
177
|
-
// Cancel in-flight pairing long-poll
|
|
178
|
-
onCancelPairing();
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (isStreaming && queuedMessage && onCancelQueuedMessage) {
|
|
182
|
-
// First Escape during streaming with a queued message: cancel the queued
|
|
183
|
-
// message and put its text back in the input for editing (like Up-arrow undo).
|
|
184
|
-
onCancelQueuedMessage();
|
|
185
|
-
}
|
|
186
|
-
else if (isStreaming && onCancel) {
|
|
187
|
-
// Cancel streaming if active (no queued message, or already cancelled)
|
|
188
|
-
onCancel();
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
// Clear input when no overlay open and not streaming
|
|
192
|
-
setInput("");
|
|
193
|
-
}
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
// Up arrow: cancel queued message and put it back in input for editing
|
|
197
|
-
if (key.upArrow && isStreaming && queuedMessage && onCancelQueuedMessage) {
|
|
198
|
-
onCancelQueuedMessage();
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
// Ctrl+\: cycle display mode
|
|
202
|
-
if (key.ctrl && input === "\x1c" && overlay === "none") {
|
|
203
|
-
onCycleDisplayMode?.();
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
// Ctrl+t: toggle thinking block visibility
|
|
207
|
-
if (key.ctrl && input === "t" && overlay === "none") {
|
|
208
|
-
onToggleThinking?.();
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
// Ctrl+g: toggle cost display (Ctrl+4 sends byte outside Ink's range)
|
|
212
|
-
if (key.ctrl && input === "g" && overlay === "none") {
|
|
213
|
-
onToggleCosts?.();
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
// Ctrl+s: toggle trace spans
|
|
217
|
-
// NOTE: Some terminals intercept Ctrl+S as XOFF (flow control freeze).
|
|
218
|
-
// If terminal freezes, press Ctrl+Q to resume. Most modern terminals
|
|
219
|
-
// (iTerm2, VS Code) disable flow control by default.
|
|
220
|
-
if (key.ctrl && input === "s" && overlay === "none") {
|
|
221
|
-
onToggleTraces?.();
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
// Shift+Tab: cycle autonomy level
|
|
225
|
-
if (key.tab && input !== "\t" && overlay === "none") {
|
|
226
|
-
onCycleAutonomy?.();
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
// Ctrl+E: cycle effort level
|
|
230
|
-
if (key.ctrl && input === "\x05" && overlay === "none") {
|
|
231
|
-
onCycleEffort?.();
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
// Ctrl+/: show/hide hotkey help
|
|
235
|
-
if (key.ctrl && input === "\x1f" && overlay === "none") {
|
|
236
|
-
setShowHelp((prev) => !prev);
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
}, { isActive: isRawModeSupported });
|
|
240
|
-
const primary = session.getPrimary();
|
|
241
|
-
const arionName = primary?.name || "ARIA";
|
|
242
|
-
const arionColor = primary?.color || "cyan";
|
|
243
|
-
const arionEmoji = primary?.emoji || "🦋";
|
|
244
|
-
// Indicator state machine — driven by ObservabilityContext events via the hook.
|
|
245
|
-
// Replaces the old data-derived verb/state logic with explicit state transitions.
|
|
246
|
-
const indicatorState = useIndicatorState(obsCtx ?? null, isStreaming ?? false);
|
|
247
|
-
const footerRows = (overlay === "none" && !approvalRequest ? 4 : 0) +
|
|
248
|
-
(!displayConfig || displayConfig.showStatusBar ? 1 : 0);
|
|
249
|
-
const topViewportRows = Math.max(rows - footerRows, 1);
|
|
250
|
-
const handleTrigger = useCallback((type, filter) => {
|
|
251
|
-
if (type === "command") {
|
|
252
|
-
setOverlay("command");
|
|
253
|
-
setCommandFilter(filter);
|
|
254
|
-
}
|
|
255
|
-
else if (type === "mention") {
|
|
256
|
-
setOverlay("arion");
|
|
257
|
-
setArionFilter(filter);
|
|
258
|
-
setArionSelectorMode("mention");
|
|
259
|
-
}
|
|
260
|
-
}, []);
|
|
261
|
-
const handleCommandSelect = useCallback((cmd) => {
|
|
262
|
-
setOverlay("none");
|
|
263
|
-
setInput("");
|
|
264
|
-
const requiresArguments = cmd.requiresArgs === true || (cmd.args?.length ?? 0) > 0;
|
|
265
|
-
if (cmd.name === "become") {
|
|
266
|
-
setOverlay("arion");
|
|
267
|
-
setArionSelectorMode("become");
|
|
268
|
-
setArionStatusFilter("all");
|
|
269
|
-
}
|
|
270
|
-
else if (cmd.name === "rest") {
|
|
271
|
-
setOverlay("arion");
|
|
272
|
-
setArionSelectorMode("rest");
|
|
273
|
-
setArionStatusFilter("active");
|
|
274
|
-
}
|
|
275
|
-
else if (cmd.name === "wake") {
|
|
276
|
-
setOverlay("arion");
|
|
277
|
-
setArionSelectorMode("wake");
|
|
278
|
-
setArionStatusFilter("resting");
|
|
279
|
-
}
|
|
280
|
-
else if (cmd.name === "model") {
|
|
281
|
-
setOverlay("model");
|
|
282
|
-
}
|
|
283
|
-
else if (cmd.name === "theme") {
|
|
284
|
-
setOverlay("theme");
|
|
285
|
-
}
|
|
286
|
-
else if (cmd.name === "sound") {
|
|
287
|
-
setOverlay("sound");
|
|
288
|
-
}
|
|
289
|
-
else if (cmd.name === "daemon") {
|
|
290
|
-
onCommand(cmd.name);
|
|
291
|
-
}
|
|
292
|
-
else if (cmd.name === "memories") {
|
|
293
|
-
onOpenMemoryBrowser?.("browse");
|
|
294
|
-
setOverlay("memory");
|
|
295
|
-
}
|
|
296
|
-
else if (cmd.name === "forget") {
|
|
297
|
-
onOpenMemoryBrowser?.("forget");
|
|
298
|
-
setOverlay("memory");
|
|
299
|
-
}
|
|
300
|
-
else if (cmd.name === "resume") {
|
|
301
|
-
openSessionOverlay();
|
|
302
|
-
}
|
|
303
|
-
else if (cmd.name === "exit") {
|
|
304
|
-
exit();
|
|
305
|
-
}
|
|
306
|
-
else if (requiresArguments) {
|
|
307
|
-
// Commands with argument metadata should always hand control back to the
|
|
308
|
-
// input field so the slash command line keeps a single authoritative state.
|
|
309
|
-
setInput(`/${cmd.name} `);
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
// Skills and other commands that don't need overlay/prefill
|
|
314
|
-
onCommand(cmd.name);
|
|
315
|
-
}
|
|
316
|
-
}, [onCommand, onOpenMemoryBrowser, exit]);
|
|
317
|
-
const handleArionSelect = useCallback((arion) => {
|
|
318
|
-
setOverlay("none");
|
|
319
|
-
if (arionSelectorMode === "mention") {
|
|
320
|
-
// Insert @name into the input field (Slack-style mention)
|
|
321
|
-
// Remove any partial @mention at the end, then insert @name
|
|
322
|
-
const cleanedInput = input.replace(/@\w*$/, "");
|
|
323
|
-
setInput(cleanedInput + "@" + arion.name + " ");
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
// become/rest/wake modes - delegate to parent
|
|
327
|
-
onSelectArion?.(arion.name, arionSelectorMode);
|
|
328
|
-
}
|
|
329
|
-
}, [arionSelectorMode, input, onSelectArion]);
|
|
330
|
-
const handleModelSelect = useCallback((m, effort) => {
|
|
331
|
-
setOverlay("none");
|
|
332
|
-
onSelectModel?.(m.value ?? m.name, effort);
|
|
333
|
-
}, [onSelectModel]);
|
|
334
|
-
const handleThemeSelect = useCallback((theme) => {
|
|
335
|
-
setOverlay("none");
|
|
336
|
-
onSelectTheme?.(theme);
|
|
337
|
-
}, [onSelectTheme]);
|
|
338
|
-
const handleMemorySelect = useCallback((memory) => {
|
|
339
|
-
setOverlay("none");
|
|
340
|
-
onSelectMemory?.(memory);
|
|
341
|
-
}, [onSelectMemory]);
|
|
342
|
-
const handleCancel = useCallback(() => {
|
|
343
|
-
setOverlay("none");
|
|
344
|
-
// Don't clear input when canceling mention - user may want to continue typing
|
|
345
|
-
if (arionSelectorMode !== "mention") {
|
|
346
|
-
setInput("");
|
|
347
|
-
}
|
|
348
|
-
setCommandFilter("");
|
|
349
|
-
setArionFilter("");
|
|
350
|
-
}, [arionSelectorMode]);
|
|
351
|
-
const handleCommandInputHandoff = useCallback((value) => {
|
|
352
|
-
setOverlay("none");
|
|
353
|
-
setInput(value);
|
|
354
|
-
setCommandFilter("");
|
|
355
|
-
}, []);
|
|
356
|
-
// === NEW RENDERING PIPELINE ===
|
|
357
|
-
// ConversationMessage[] → toRenderItems() → applyDisplayPolicy() → RenderItemView
|
|
358
|
-
// No normalize. No reorder. Tool use + result combined in ToolExecutionItem.
|
|
359
|
-
// Static/Live split via committed field (no position-based slicing).
|
|
360
|
-
// Convert messages to flat RenderItem[] (committed=true for history, false for preview)
|
|
361
|
-
const renderItems = useMemo(() => toRenderItems(messages, previewMessages, { userName }), [messages, previewMessages, userName]);
|
|
362
|
-
// Apply display policy (collapse thinking in standard mode, hide in minimal)
|
|
363
|
-
const policyItems = useMemo(() => applyDisplayPolicy(renderItems, displayMode), [renderItems, displayMode]);
|
|
364
|
-
// Static/Live split via committed field — no position guessing
|
|
365
|
-
const staticRenderItems = useMemo(() => policyItems.filter((item) => item.committed), [policyItems]);
|
|
366
|
-
const liveRenderItems = useMemo(() => policyItems.filter((item) => !item.committed), [policyItems]);
|
|
367
|
-
const queuedMessageText = isStreaming && queuedMessage ? queuedMessage : null;
|
|
368
|
-
const showQueuedMessage = queuedMessageText !== null;
|
|
369
|
-
const showIndicator = indicatorState.kind !== "idle";
|
|
370
|
-
const queuedContentWidth = Math.max(columns - 4, 20);
|
|
371
|
-
const queuedMessageContentRows = useMemo(() => {
|
|
372
|
-
if (!queuedMessageText)
|
|
373
|
-
return 0;
|
|
374
|
-
return Math.max(applyMarkdown(queuedMessageText, { width: queuedContentWidth }).split("\n").length, 1);
|
|
375
|
-
}, [queuedContentWidth, queuedMessageText]);
|
|
376
|
-
const reservedBottomRows = (showQueuedMessage ? 4 + queuedMessageContentRows : 0) + (showIndicator ? 2 : 0);
|
|
377
|
-
const previewViewportRows = Math.max(topViewportRows - reservedBottomRows, 1);
|
|
378
|
-
// Prefix logic: show sender prefix once for consecutive messages
|
|
379
|
-
const showPrefixMap = useMemo(() => {
|
|
380
|
-
const map = new Map();
|
|
381
|
-
let lastSenderKey = "";
|
|
382
|
-
for (const item of policyItems) {
|
|
383
|
-
const key = item.kind === "user-message" || item.kind === "user-image"
|
|
384
|
-
? `user:${item.userName}`
|
|
385
|
-
: item.kind === "assistant-text"
|
|
386
|
-
? `assistant:${item.arion?.name ?? "ARIA"}`
|
|
387
|
-
: item.kind === "thinking"
|
|
388
|
-
? `assistant:${item.arion?.name ?? "ARIA"}`
|
|
389
|
-
: item.kind === "tool-execution"
|
|
390
|
-
? "tool"
|
|
391
|
-
: item.kind;
|
|
392
|
-
// Only show prefix for user/assistant conversational items, not tool-execution
|
|
393
|
-
const showable = item.kind === "user-message" ||
|
|
394
|
-
item.kind === "user-image" ||
|
|
395
|
-
item.kind === "assistant-text" ||
|
|
396
|
-
item.kind === "thinking";
|
|
397
|
-
map.set(item.id, showable && key !== lastSenderKey);
|
|
398
|
-
if (showable)
|
|
399
|
-
lastSenderKey = key;
|
|
400
|
-
}
|
|
401
|
-
return map;
|
|
402
|
-
}, [policyItems]);
|
|
403
|
-
// Margin logic: no gap between consecutive tool-execution items
|
|
404
|
-
const marginTopMap = useMemo(() => {
|
|
405
|
-
const map = new Map();
|
|
406
|
-
for (let i = 0; i < policyItems.length; i++) {
|
|
407
|
-
const item = policyItems[i];
|
|
408
|
-
const prev = i > 0 ? policyItems[i - 1] : undefined;
|
|
409
|
-
const isConsecutiveToolExecution = item.kind === "tool-execution" && prev?.kind === "tool-execution";
|
|
410
|
-
map.set(item.id, i > 0 && !isConsecutiveToolExecution);
|
|
411
|
-
}
|
|
412
|
-
return map;
|
|
413
|
-
}, [policyItems]);
|
|
414
|
-
const staticEntries = useMemo(() => {
|
|
415
|
-
const items = [];
|
|
416
|
-
if (banner) {
|
|
417
|
-
items.push({ id: "header", _kind: "banner" });
|
|
418
|
-
}
|
|
419
|
-
for (const item of staticRenderItems) {
|
|
420
|
-
items.push({ ...item, _kind: "item" });
|
|
421
|
-
}
|
|
422
|
-
return items;
|
|
423
|
-
}, [banner, staticRenderItems]);
|
|
424
|
-
// Layout: <Static> renders committed history to terminal scrollback (written once,
|
|
425
|
-
// never redrawn). Only live streaming items + input live in Ink's dynamic zone,
|
|
426
|
-
// so keystrokes only redraw a few lines instead of the entire transcript.
|
|
427
|
-
return (_jsxs(_Fragment, { children: [_jsx(Static, { items: staticEntries, children: (entry) => {
|
|
428
|
-
if (entry._kind === "banner") {
|
|
429
|
-
return (_jsx(Box, { width: "100%", justifyContent: "center", children: banner }, entry.id));
|
|
430
|
-
}
|
|
431
|
-
return (_jsx(Box, { flexDirection: "column", marginTop: marginTopMap.get(entry.id) ? 1 : 0, children: _jsx(RenderItemView, { item: entry, displayMode: displayMode, showPrefix: showPrefixMap.get(entry.id) ?? false }) }, entry.id));
|
|
432
|
-
} }, `static-${staticRenderEpoch}`), _jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsxs(Box, { flexDirection: "column", maxHeight: topViewportRows, justifyContent: "flex-end", overflowY: "hidden", children: [liveRenderItems.length > 0 && (_jsx(Box, { flexDirection: "column", maxHeight: previewViewportRows, overflowY: "hidden", children: liveRenderItems.map((item) => (_jsx(Box, { flexDirection: "column", marginTop: marginTopMap.get(item.id) ? 1 : 0, children: _jsx(RenderItemView, { item: item, displayMode: displayMode, showPrefix: showPrefixMap.get(item.id) ?? false, previewTailLines: previewViewportRows }) }, item.id))) })), showQueuedMessage && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(UserTextMessage, { param: { type: "text", text: queuedMessageText ?? "" }, userName: userName ?? "User", columns: columns, showPrefix: true, addMargin: false }), _jsx(Text, { dimColor: true, children: " \u2191 queued \u2014 press esc or \u2191 to cancel and edit" })] })), showTraces && spans.length > 0 && _jsx(TraceWaterfall, { spans: spans }), displayConfig?.showPipelineTiming &&
|
|
433
|
-
pipelineTiming &&
|
|
434
|
-
pipelineTiming.phases.length > 0 && _jsx(PipelineTimingPanel, { report: pipelineTiming }), showHelp && (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, marginY: 1, children: [_jsx(Text, { bold: true, dimColor: true, children: "Hotkeys" }), _jsx(Text, { dimColor: true, children: " Ctrl+\\ \u2014 cycle display mode" }), _jsx(Text, { dimColor: true, children: " Ctrl+t \u2014 toggle thinking blocks" }), _jsx(Text, { dimColor: true, children: " Ctrl+g \u2014 toggle cost display" }), _jsx(Text, { dimColor: true, children: " Ctrl+e \u2014 cycle effort level" }), _jsx(Text, { dimColor: true, children: " Ctrl+s \u2014 toggle trace waterfall" }), _jsx(Text, { dimColor: true, children: " Escape \u2014 cancel streaming / close overlay / clear input" }), _jsx(Text, { dimColor: true, children: " Ctrl+/ \u2014 toggle this help" })] })), showIndicator && (_jsx(StreamingIndicator, { state: indicatorState.kind === "thinking" ? "thinking" : "composing", elapsedSeconds: Math.floor(metrics?.wallTimeSeconds ?? 0), totalTokens: metrics?.totalTokens ?? 0, thoughtForSeconds: indicatorState.kind === "composing" ? indicatorState.thoughtForSeconds : undefined, currentVerb: indicatorState.kind === "tool_running"
|
|
435
|
-
? [...new Set(indicatorState.tools.values())].join(" · ")
|
|
436
|
-
: indicatorState.verb.present }))] }), _jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [showAutonomySelector && onAutonomySelect && onAutonomyCancel && (_jsx(AutonomySelector, { currentLevel: autonomyLevel ?? DEFAULT_SAFETY_CONFIG.autonomy, onSelect: onAutonomySelect, onCancel: onAutonomyCancel })), loginPickerProviders && onLoginProviderSelect && onLoginPickerCancel && (_jsx(ProviderPicker, { providers: loginPickerProviders, onSelect: onLoginProviderSelect, onCancel: onLoginPickerCancel })), copilotSourceOptions && onCopilotSourceSelect && onCopilotSourceCancel && (_jsx(CopilotSourcePicker, { options: copilotSourceOptions, onSelect: onCopilotSourceSelect, onCancel: onCopilotSourceCancel })), overlay === "login-method" &&
|
|
437
|
-
authInteractionOptions &&
|
|
438
|
-
onAuthInteractionSelect &&
|
|
439
|
-
onAuthInteractionCancel && (_jsx(ProviderMethodPicker, { options: authInteractionOptions, onSelect: (option) => onAuthInteractionSelect(option.id), onCancel: onAuthInteractionCancel, title: authInteractionTitle ?? "Choose an option:", isActive: overlay === "login-method" })), overlay === "login-method" &&
|
|
440
|
-
anthropicMethodOptions &&
|
|
441
|
-
onAnthropicMethodSelect &&
|
|
442
|
-
onAnthropicMethodCancel && (_jsx(AnthropicMethodPicker, { options: anthropicMethodOptions, onSelect: onAnthropicMethodSelect, onCancel: onAnthropicMethodCancel, isActive: overlay === "login-method" })), overlay === "login-input" &&
|
|
443
|
-
authInteractionInput &&
|
|
444
|
-
onAuthInteractionInputSubmit &&
|
|
445
|
-
onAuthInteractionInputCancel && (_jsx(TextInputOverlay, { title: authInteractionInput.title, hint: authInteractionInput.hint, onSubmit: onAuthInteractionInputSubmit, onCancel: onAuthInteractionInputCancel, isActive: overlay === "login-input" })), overlay === "login-input" &&
|
|
446
|
-
anthropicKeyInputVisible &&
|
|
447
|
-
onAnthropicKeySubmit &&
|
|
448
|
-
onAnthropicKeyCancel && (_jsx(TextInputOverlay, { title: "Enter Anthropic API key", hint: "Paste your sk-ant-api03-* key", onSubmit: onAnthropicKeySubmit, onCancel: onAnthropicKeyCancel, isActive: overlay === "login-input" })), overlay === "login-input" &&
|
|
449
|
-
anthropicSetupTokenVisible &&
|
|
450
|
-
onAnthropicSetupTokenSubmit &&
|
|
451
|
-
onAnthropicSetupTokenCancel && (_jsx(TextInputOverlay, { title: "Enter setup token", hint: "From `claude setup-token` or admin provisioning", onSubmit: onAnthropicSetupTokenSubmit, onCancel: onAnthropicSetupTokenCancel, isActive: overlay === "login-input" })), overlay === "login-method" &&
|
|
452
|
-
openaiMethodOptions &&
|
|
453
|
-
onOpenAIMethodSelect &&
|
|
454
|
-
onOpenAIMethodCancel && (_jsx(ProviderMethodPicker, { options: openaiMethodOptions, onSelect: onOpenAIMethodSelect, onCancel: onOpenAIMethodCancel, title: "Select OpenAI login method:", isActive: overlay === "login-method" })), overlay === "login-input" &&
|
|
455
|
-
openaiKeyInputVisible &&
|
|
456
|
-
onOpenAIKeySubmit &&
|
|
457
|
-
onOpenAIKeyCancel && (_jsx(TextInputOverlay, { title: "Enter OpenAI API key", hint: "Paste your sk-* key", onSubmit: onOpenAIKeySubmit, onCancel: onOpenAIKeyCancel, isActive: overlay === "login-input" })), overlay === "login-method" &&
|
|
458
|
-
googleMethodOptions &&
|
|
459
|
-
onGoogleMethodSelect &&
|
|
460
|
-
onGoogleMethodCancel && (_jsx(ProviderMethodPicker, { options: googleMethodOptions, onSelect: onGoogleMethodSelect, onCancel: onGoogleMethodCancel, title: "Select Google login method:", isActive: overlay === "login-method" })), overlay === "login-input" &&
|
|
461
|
-
googleKeyInputVisible &&
|
|
462
|
-
onGoogleKeySubmit &&
|
|
463
|
-
onGoogleKeyCancel && (_jsx(TextInputOverlay, { title: "Enter Google API key", hint: "Paste your AIza* key", onSubmit: onGoogleKeySubmit, onCancel: onGoogleKeyCancel, isActive: overlay === "login-input" })), overlay === "login" && oauthProvider && onOAuthComplete && onOAuthCancel && (_jsx(OAuthLoginFlow, { provider: oauthProvider, onCancel: onOAuthCancel, ...(oauthAuthorizeUrl && onOAuthCodeSubmit
|
|
464
|
-
? {
|
|
465
|
-
authorizeUrl: oauthAuthorizeUrl,
|
|
466
|
-
expectedState: oauthExpectedState ?? undefined,
|
|
467
|
-
onCodeSubmit: onOAuthCodeSubmit,
|
|
468
|
-
}
|
|
469
|
-
: {
|
|
470
|
-
onComplete: onOAuthComplete,
|
|
471
|
-
}), isActive: overlay === "login" })), overlay === "login" &&
|
|
472
|
-
copilotDeviceProvider &&
|
|
473
|
-
onCopilotDeviceComplete &&
|
|
474
|
-
onCopilotDeviceCancel && (_jsx(CopilotDeviceLoginFlow, { provider: copilotDeviceProvider, profileLabel: copilotDeviceProfileLabel ?? undefined, ...(copilotDeviceVerificationUri && copilotDeviceUserCode && onCopilotDeviceApprove
|
|
475
|
-
? {
|
|
476
|
-
verificationUri: copilotDeviceVerificationUri,
|
|
477
|
-
userCode: copilotDeviceUserCode,
|
|
478
|
-
onApprove: onCopilotDeviceApprove,
|
|
479
|
-
}
|
|
480
|
-
: {
|
|
481
|
-
onComplete: onCopilotDeviceComplete,
|
|
482
|
-
}), onCancel: onCopilotDeviceCancel })), _jsxs(Box, { flexDirection: "column", children: [overlay === "command" && (_jsx(CommandPalette, { commands: commands, initialFilter: commandFilter, onSelect: handleCommandSelect, onHandOffInput: handleCommandInputHandoff, onCancel: handleCancel })), overlay === "arion" && (_jsx(ArionSelector, { arions: arions, initialFilter: arionFilter, statusFilter: arionStatusFilter, onSelect: handleArionSelect, onCancel: handleCancel })), overlay === "model" && (_jsx(ModelSelector, { models: models, effortLevel: effortLevel, onSelect: handleModelSelect, onCancel: handleCancel })), overlay === "theme" && (_jsx(ThemeSelector, { onSelect: handleThemeSelect, onCancel: handleCancel })), overlay === "sound" && _jsx(SoundSelector, { onClose: () => setOverlay("none") }), overlay === "daemon" && (_jsx(DaemonControl, { status: daemonStatus ?? { running: false }, actionStatus: daemonActionStatus, onAction: (action) => onDaemonAction?.(action), onClose: () => setOverlay("none") })), overlay === "invite-share" && inviteShare && (_jsx(InviteShareOverlay, { inviteToken: inviteShare.inviteToken, inviteLabel: inviteShare.inviteLabel, expiresAt: inviteShare.expiresAt, onClose: () => {
|
|
483
|
-
setOverlay("none");
|
|
484
|
-
onInviteShareClose?.();
|
|
485
|
-
} })), overlay === "join-invite" && (_jsx(JoinInviteOverlay, { error: joinInviteError, onSubmit: (inviteToken) => {
|
|
486
|
-
setOverlay("none");
|
|
487
|
-
onJoinInviteSubmit?.(inviteToken);
|
|
488
|
-
}, onCancel: () => {
|
|
489
|
-
setOverlay("none");
|
|
490
|
-
onJoinInviteCancel?.();
|
|
491
|
-
} })), overlay === "memory" && (_jsx(MemoryBrowser, { memories: memories, mode: memoryBrowserMode, isLoading: isLoadingMemories, onSelect: handleMemorySelect, onCancel: handleCancel })), overlay === "peers" && (_jsx(PeerSelector, { peers: frozenPeers.length > 0 ? frozenPeers : nearbyPeers, sameHomeClientsAvailable: localClients.length > 0, onSelect: (peer) => {
|
|
492
|
-
setOverlay("none");
|
|
493
|
-
onSelectPeer?.(peer);
|
|
494
|
-
}, onCancel: handleCancel })), overlay === "clients" && (_jsx(ClientSelector, { clients: localClients, onSelect: (client) => {
|
|
495
|
-
setOverlay("none");
|
|
496
|
-
setInput(`/send ${client.clientId} `);
|
|
497
|
-
onSelectClient?.(client);
|
|
498
|
-
}, onCancel: () => {
|
|
499
|
-
setOverlay("none");
|
|
500
|
-
onClientsCancel?.();
|
|
501
|
-
} })), overlay === "pair-request" && incomingPairRequest && (_jsx(PairRequestOverlay, { request: incomingPairRequest, onAccept: () => {
|
|
502
|
-
setOverlay("none");
|
|
503
|
-
onAcceptPairRequest?.();
|
|
504
|
-
}, onReject: () => {
|
|
505
|
-
setOverlay("none");
|
|
506
|
-
onRejectPairRequest?.();
|
|
507
|
-
} })), overlay === "session" && (_jsx(SessionSelector, { sessions: sessions, onSelect: (id) => {
|
|
508
|
-
setOverlay("none");
|
|
509
|
-
onSelectSession?.(id);
|
|
510
|
-
}, onCancel: handleCancel, onSearch: (query) => onSearchSessions?.(query), onPageChange: (direction) => onLoadMoreSessions?.(direction) })), overlay === "message-edit" && editableMessages && (_jsx(MessageSelector, { messages: editableMessages, onSelect: (messageIndex, messageText) => {
|
|
511
|
-
setOverlay("none");
|
|
512
|
-
onEditMessage?.(messageIndex, messageText);
|
|
513
|
-
}, onCancel: handleCancel })), overlay === "none" && !approvalRequest && (_jsx(InputArea, { userName: userName, value: input, onChange: setInput, onSubmit: onSubmit, onTrigger: handleTrigger, onExit: () => exit(), history: inputHistory, onSaveInput: onSaveInput, focus: overlay === "none", isStreaming: isStreaming, onDoubleEscape: () => {
|
|
514
|
-
if (editableMessages && editableMessages.length > 0) {
|
|
515
|
-
setOverlay("message-edit");
|
|
516
|
-
return true;
|
|
517
|
-
}
|
|
518
|
-
return false;
|
|
519
|
-
} }))] }), (!displayConfig || displayConfig.showStatusBar) && (_jsx(StatusBar, { arion: {
|
|
520
|
-
name: arionName,
|
|
521
|
-
emoji: arionEmoji,
|
|
522
|
-
color: arionColor,
|
|
523
|
-
traits: primary?.personality?.traits?.slice(0, 2),
|
|
524
|
-
}, model: model, maxContextTokens: maxContextTokens, responseTime: responseTime, metrics: metrics, displayMode: displayMode, showCosts: showCosts, activeArion: activeArion, effortLevel: effortLevel, autonomyLevel: autonomyLevel, meshMessageCount: meshMessageCount, connectionState: connectionState }))] })] })] }));
|
|
525
|
-
}
|
|
526
|
-
//# sourceMappingURL=App.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ProviderMethodPicker } from "./ProviderMethodPicker.js";
|
|
3
|
-
export function AnthropicMethodPicker({ options, onSelect, onCancel, isActive = true, }) {
|
|
4
|
-
return (_jsx(ProviderMethodPicker, { options: options, onSelect: onSelect, onCancel: onCancel, title: "Select Anthropic login method:", isActive: isActive }));
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=AnthropicMethodPicker.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { theme } from "../theme.js";
|
|
4
|
-
/**
|
|
5
|
-
* User prompt component - shows userName in cyan like the REPL's formatPrompt
|
|
6
|
-
* Design: "userName ❯ " or just "❯ " if no user name
|
|
7
|
-
*/
|
|
8
|
-
export function ArionPrompt({ userName }) {
|
|
9
|
-
// Match REPL's formatPrompt - show user name in cyan
|
|
10
|
-
if (userName) {
|
|
11
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: theme.colors.cyan, children: userName }), _jsxs(Text, { children: [" ", theme.prompt.symbol, " "] })] }));
|
|
12
|
-
}
|
|
13
|
-
return (_jsx(Box, { children: _jsxs(Text, { color: theme.colors.cyan, children: [theme.prompt.symbol, " "] }) }));
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ArionPrompt.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { getTheme } from "../theme/index.js";
|
|
4
|
-
export function AutocompleteDropdown({ suggestions, selectedIndex, width = 60, }) {
|
|
5
|
-
const theme = getTheme();
|
|
6
|
-
if (suggestions.length === 0)
|
|
7
|
-
return null;
|
|
8
|
-
// Calculate column widths
|
|
9
|
-
const maxCommandWidth = Math.max(...suggestions.map((s) => {
|
|
10
|
-
const argsStr = s.args.length > 0 ? " " + s.args.join(" ") : "";
|
|
11
|
-
return s.command.length + argsStr.length + 1; // +1 for /
|
|
12
|
-
}));
|
|
13
|
-
const commandWidth = Math.min(maxCommandWidth + 2, 25);
|
|
14
|
-
const descWidth = width - commandWidth - 4; // borders + padding
|
|
15
|
-
return (_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.colors.secondary, width: width, children: suggestions.map((suggestion, index) => {
|
|
16
|
-
const isSelected = index === selectedIndex;
|
|
17
|
-
const argsStr = suggestion.args.length > 0 ? " " + suggestion.args.join(" ") : "";
|
|
18
|
-
const commandStr = `/${suggestion.command}${argsStr}`;
|
|
19
|
-
const descStr = suggestion.description.slice(0, descWidth);
|
|
20
|
-
return (_jsxs(Box, { paddingX: 1, children: [_jsx(Box, { width: commandWidth, children: _jsx(Text, { color: isSelected ? theme.colors.primary : theme.colors.text, bold: isSelected, inverse: isSelected, children: commandStr.padEnd(commandWidth - 1) }) }), _jsx(Text, { color: theme.colors.textMuted, children: descStr })] }, suggestion.command));
|
|
21
|
-
}) }));
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=AutocompleteDropdown.js.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// packages/cli/src/ui/components/AutonomySelector.tsx
|
|
3
|
-
import { useState, useRef } from "react";
|
|
4
|
-
import { Box, Text, useInput } from "ink";
|
|
5
|
-
import { getTheme } from "../theme/index.js";
|
|
6
|
-
import { AUTONOMY_LEVELS } from "@aria-cli/aria";
|
|
7
|
-
import { isEscapeInput } from "../utils/keys.js";
|
|
8
|
-
const LEVEL_DESCRIPTIONS = {
|
|
9
|
-
minimal: "Confirm all tool calls",
|
|
10
|
-
balanced: "Confirm dangerous only",
|
|
11
|
-
high: "Auto-approve everything",
|
|
12
|
-
full: "Auto-approve everything",
|
|
13
|
-
};
|
|
14
|
-
export function AutonomySelector({ currentLevel, onSelect, onCancel, isActive = true, }) {
|
|
15
|
-
const theme = getTheme();
|
|
16
|
-
const initialIndex = AUTONOMY_LEVELS.indexOf(currentLevel);
|
|
17
|
-
const initialSelected = initialIndex >= 0 ? initialIndex : 0;
|
|
18
|
-
const [selected, setSelectedState] = useState(initialSelected);
|
|
19
|
-
const selectedRef = useRef(initialSelected);
|
|
20
|
-
const submittedRef = useRef(false);
|
|
21
|
-
const setSelected = (update) => {
|
|
22
|
-
setSelectedState((current) => {
|
|
23
|
-
const next = update(current);
|
|
24
|
-
selectedRef.current = next;
|
|
25
|
-
return next;
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
// Only use input handling when stdin supports raw mode
|
|
29
|
-
const isRawModeSupported = process.stdin.isTTY ?? false;
|
|
30
|
-
useInput((input, key) => {
|
|
31
|
-
if (submittedRef.current)
|
|
32
|
-
return;
|
|
33
|
-
if (key.upArrow) {
|
|
34
|
-
setSelected((s) => Math.max(0, s - 1));
|
|
35
|
-
}
|
|
36
|
-
else if (key.downArrow) {
|
|
37
|
-
setSelected((s) => Math.min(AUTONOMY_LEVELS.length - 1, s + 1));
|
|
38
|
-
}
|
|
39
|
-
else if (key.return) {
|
|
40
|
-
submittedRef.current = true;
|
|
41
|
-
onSelect(AUTONOMY_LEVELS[selectedRef.current]);
|
|
42
|
-
}
|
|
43
|
-
else if (isEscapeInput(input, key)) {
|
|
44
|
-
submittedRef.current = true;
|
|
45
|
-
onCancel();
|
|
46
|
-
}
|
|
47
|
-
}, { isActive: isActive && isRawModeSupported });
|
|
48
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.colors.secondary, paddingX: 1, paddingY: 1, width: 48, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Autonomy Level" }) }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: ["Current: ", _jsx(Text, { bold: true, children: currentLevel })] }) }), AUTONOMY_LEVELS.map((level, index) => {
|
|
49
|
-
const isHovered = index === selected;
|
|
50
|
-
const marker = isHovered ? "\u25cf" : "\u25cb";
|
|
51
|
-
const isWarning = level === "high" || level === "full";
|
|
52
|
-
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: isHovered ? theme.colors.primary : undefined, children: marker }), _jsx(Text, { color: isHovered ? theme.colors.primary : isWarning ? theme.colors.warning : undefined, bold: isHovered, children: level.padEnd(10) }), _jsx(Text, { color: theme.colors.textMuted, children: LEVEL_DESCRIPTIONS[level] })] }, level));
|
|
53
|
-
}), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.colors.textMuted, children: ["\u2191\u2193", " Navigate Enter Select Esc Cancel"] }) })] }));
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=AutonomySelector.js.map
|