@aria-cli/cli 1.0.14
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-dev.js +15 -0
- package/bin/aria.js +366 -0
- package/bin/install-owner-lease.d.ts +8 -0
- package/bin/install-owner-lease.js +53 -0
- package/dist/.aria-build-stamp.json +4 -0
- package/dist/attached-local-control-client.d.ts +90 -0
- package/dist/bootstrap-local-control-client.d.ts +1 -0
- package/dist/capability-aware-method-proxy.d.ts +1 -0
- package/dist/cli-context.d.ts +31 -0
- package/dist/commands/arions.d.ts +14 -0
- package/dist/commands/auth.d.ts +27 -0
- package/dist/commands/daemon.d.ts +31 -0
- package/dist/commands/definitions.d.ts +19 -0
- package/dist/commands/index.d.ts +13 -0
- package/dist/commands/login-handler.d.ts +108 -0
- package/dist/commands/logout-handler.d.ts +24 -0
- package/dist/commands/memory-handlers.d.ts +15 -0
- package/dist/commands/pairing.d.ts +2 -0
- package/dist/commands/peer-message-handler.d.ts +7 -0
- package/dist/commands/runtime-cutover-reset-command.d.ts +2 -0
- package/dist/commands/runtime-cutover-reset.d.ts +26 -0
- package/dist/commands/terminal-setup.d.ts +3 -0
- package/dist/config/aria-config.d.ts +50 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +17 -0
- package/dist/config.d.ts +53 -0
- package/dist/daemon-info.d.ts +17 -0
- package/dist/ensure-daemon.d.ts +21 -0
- package/dist/event-loop-watchdog.d.ts +31 -0
- package/dist/headless/auth-orchestrator.d.ts +19 -0
- package/dist/headless/auth-service.d.ts +15 -0
- package/dist/headless/bootstrap-fast-path.d.ts +12 -0
- package/dist/headless/call-command.d.ts +8 -0
- package/dist/headless/daemon-service.d.ts +14 -0
- package/dist/headless/hook-actions.d.ts +40 -0
- package/dist/headless/hook-service.d.ts +8 -0
- package/dist/headless/kernel-services.d.ts +8 -0
- package/dist/headless/kernel.d.ts +118 -0
- package/dist/headless/operations/arion.d.ts +3 -0
- package/dist/headless/operations/auth.d.ts +4 -0
- package/dist/headless/operations/client.d.ts +2 -0
- package/dist/headless/operations/config.d.ts +3 -0
- package/dist/headless/operations/daemon.d.ts +3 -0
- package/dist/headless/operations/hook.d.ts +3 -0
- package/dist/headless/operations/index.d.ts +10 -0
- package/dist/headless/operations/memory.d.ts +3 -0
- package/dist/headless/operations/message.d.ts +2 -0
- package/dist/headless/operations/model.d.ts +3 -0
- package/dist/headless/operations/peer.d.ts +2 -0
- package/dist/headless/operations/run.d.ts +3 -0
- package/dist/headless/operations/session.d.ts +74 -0
- package/dist/headless/operations/subscription.d.ts +2 -0
- package/dist/headless/operations/system.d.ts +3 -0
- package/dist/headless/operations/utils.d.ts +5 -0
- package/dist/headless/run-orchestrator.d.ts +38 -0
- package/dist/headless/stdio-server.d.ts +4 -0
- package/dist/history/SessionHistory.d.ts +200 -0
- package/dist/history/conversation-message.d.ts +181 -0
- package/dist/history/index.d.ts +8 -0
- package/dist/history/jsonl-replay.d.ts +38 -0
- package/dist/history/repair-tool-pairing.d.ts +14 -0
- package/dist/history/turn-accumulator.d.ts +85 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +505 -0
- package/dist/ink-repl.d.ts +32 -0
- package/dist/local-control-bootstrap.d.ts +5 -0
- package/dist/local-control-client.d.ts +1 -0
- package/dist/local-control-error-reporting.d.ts +6 -0
- package/dist/local-control-http-client.d.ts +9 -0
- package/dist/network-security.d.ts +7 -0
- package/dist/networking-server.d.ts +28 -0
- package/dist/peer-identity.d.ts +3 -0
- package/dist/polling-subscription.d.ts +7 -0
- package/dist/relaunch.d.ts +55 -0
- package/dist/release-notes.d.ts +11 -0
- package/dist/repl-cleanup.d.ts +20 -0
- package/dist/selectable-client.d.ts +7 -0
- package/dist/selectable-peer.d.ts +12 -0
- package/dist/session.d.ts +103 -0
- package/dist/slash-commands.d.ts +34 -0
- package/dist/sounds.d.ts +31 -0
- package/dist/ui/App.d.ts +288 -0
- package/dist/ui/components/AnthropicMethodPicker.d.ts +9 -0
- package/dist/ui/components/ArionPrompt.d.ts +8 -0
- package/dist/ui/components/AutocompleteDropdown.d.ts +9 -0
- package/dist/ui/components/AutonomySelector.d.ts +12 -0
- package/dist/ui/components/Banner.d.ts +9 -0
- package/dist/ui/components/ConversationHistory.d.ts +59 -0
- package/dist/ui/components/CopilotDeviceLoginFlow.d.ts +15 -0
- package/dist/ui/components/CopilotSourcePicker.d.ts +13 -0
- package/dist/ui/components/Cost.d.ts +8 -0
- package/dist/ui/components/CustomSelect/option-map.d.ts +15 -0
- package/dist/ui/components/CustomSelect/select-option.d.ts +20 -0
- package/dist/ui/components/CustomSelect/select.d.ts +55 -0
- package/dist/ui/components/CustomSelect/use-select-state.d.ts +99 -0
- package/dist/ui/components/CustomSelect/use-select.d.ts +14 -0
- package/dist/ui/components/ErrorDisplay.d.ts +26 -0
- package/dist/ui/components/FallbackToolUseRejectedMessage.d.ts +2 -0
- package/dist/ui/components/FileEditToolUpdatedMessage.d.ts +9 -0
- package/dist/ui/components/HandoffMarker.d.ts +17 -0
- package/dist/ui/components/HighlightedCode.d.ts +7 -0
- package/dist/ui/components/InputArea.d.ts +17 -0
- package/dist/ui/components/Message.d.ts +16 -0
- package/dist/ui/components/OAuthLoginFlow.d.ts +25 -0
- package/dist/ui/components/OutputTruncation.d.ts +16 -0
- package/dist/ui/components/PermissionPrompt.d.ts +22 -0
- package/dist/ui/components/PipelineTimingPanel.d.ts +13 -0
- package/dist/ui/components/ProviderMethodPicker.d.ts +16 -0
- package/dist/ui/components/ProviderPicker.d.ts +15 -0
- package/dist/ui/components/RenderItemView.d.ts +18 -0
- package/dist/ui/components/Spinner.d.ts +3 -0
- package/dist/ui/components/StatusBar.d.ts +78 -0
- package/dist/ui/components/StreamingIndicator.d.ts +11 -0
- package/dist/ui/components/StructuredDiff.d.ts +20 -0
- package/dist/ui/components/TextInputOverlay.d.ts +9 -0
- package/dist/ui/components/ThinkingBlock.d.ts +53 -0
- package/dist/ui/components/ToolCost.d.ts +8 -0
- package/dist/ui/components/ToolExecution.d.ts +13 -0
- package/dist/ui/components/ToolHeader.d.ts +10 -0
- package/dist/ui/components/ToolRenderLayoutContext.d.ts +10 -0
- package/dist/ui/components/ToolResultWrapper.d.ts +6 -0
- package/dist/ui/components/ToolUseLoader.d.ts +10 -0
- package/dist/ui/components/TraceWaterfall.d.ts +56 -0
- package/dist/ui/components/index.d.ts +29 -0
- package/dist/ui/components/messages/AssistantTextMessage.d.ts +13 -0
- package/dist/ui/components/messages/UserImageMessage.d.ts +8 -0
- package/dist/ui/components/messages/UserTextMessage.d.ts +13 -0
- package/dist/ui/components/overlays/ArionSelector.d.ts +18 -0
- package/dist/ui/components/overlays/ClientSelector.d.ts +7 -0
- package/dist/ui/components/overlays/CommandPalette.d.ts +14 -0
- package/dist/ui/components/overlays/InviteShareOverlay.d.ts +7 -0
- package/dist/ui/components/overlays/JoinInviteOverlay.d.ts +6 -0
- package/dist/ui/components/overlays/MemoryBrowser.d.ts +17 -0
- package/dist/ui/components/overlays/MessageSelector.d.ts +20 -0
- package/dist/ui/components/overlays/ModelSelector.d.ts +17 -0
- package/dist/ui/components/overlays/PairRequestOverlay.d.ts +19 -0
- package/dist/ui/components/overlays/PeerSelector.d.ts +14 -0
- package/dist/ui/components/overlays/SessionSelector.d.ts +11 -0
- package/dist/ui/components/overlays/ThemeSelector.d.ts +22 -0
- package/dist/ui/components/overlays/index.d.ts +13 -0
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.d.ts +9 -0
- package/dist/ui/components/permissions/FallbackPermissionRequest.d.ts +9 -0
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.d.ts +9 -0
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.d.ts +11 -0
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.d.ts +9 -0
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.d.ts +9 -0
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.d.ts +5 -0
- package/dist/ui/components/permissions/PermissionRequest.d.ts +52 -0
- package/dist/ui/components/permissions/PermissionRequestTitle.d.ts +13 -0
- package/dist/ui/components/permissions/hooks.d.ts +10 -0
- package/dist/ui/components/permissions/toolUseOptions.d.ts +10 -0
- package/dist/ui/components/permissions/utils.d.ts +6 -0
- package/dist/ui/components/text-input/Cursor.d.ts +58 -0
- package/dist/ui/components/text-input/TextInput.d.ts +98 -0
- package/dist/ui/components/text-input/imagePaste.d.ts +2 -0
- package/dist/ui/components/text-input/index.d.ts +6 -0
- package/dist/ui/components/text-input/useDoublePress.d.ts +2 -0
- package/dist/ui/components/text-input/useTextInput.d.ts +34 -0
- package/dist/ui/components/tool-types.d.ts +28 -0
- package/dist/ui/constants/figures.d.ts +1 -0
- package/dist/ui/constants/index.d.ts +1 -0
- package/dist/ui/display-mode.d.ts +62 -0
- package/dist/ui/display-policy.d.ts +3 -0
- package/dist/ui/hooks/index.d.ts +4 -0
- package/dist/ui/hooks/useCommandAutocomplete.d.ts +28 -0
- package/dist/ui/hooks/useDoublePress.d.ts +13 -0
- package/dist/ui/hooks/useIndicatorState.d.ts +3 -0
- package/dist/ui/hooks/useInterval.d.ts +6 -0
- package/dist/ui/hooks/useKeyboardShortcuts.d.ts +17 -0
- package/dist/ui/hooks/usePeerMessages.d.ts +26 -0
- package/dist/ui/hooks/useTerminalSize.d.ts +6 -0
- package/dist/ui/hooks/useUnifiedMessages.d.ts +83 -0
- package/dist/ui/indicator-state.d.ts +46 -0
- package/dist/ui/markdown/highlight.d.ts +8 -0
- package/dist/ui/markdown/index.d.ts +16 -0
- package/dist/ui/markdown/tokenizer.d.ts +17 -0
- package/dist/ui/render-item.d.ts +70 -0
- package/dist/ui/screens/REPL.d.ts +288 -0
- package/dist/ui/status-line.d.ts +32 -0
- package/dist/ui/theme/index.d.ts +8 -0
- package/dist/ui/theme/themes/claude-dark-daltonized.d.ts +2 -0
- package/dist/ui/theme/themes/claude-dark.d.ts +2 -0
- package/dist/ui/theme/themes/claude-light-daltonized.d.ts +2 -0
- package/dist/ui/theme/themes/claude-light.d.ts +2 -0
- package/dist/ui/theme/themes/dark-accessible.d.ts +2 -0
- package/dist/ui/theme/themes/dark.d.ts +2 -0
- package/dist/ui/theme/themes/light-accessible.d.ts +2 -0
- package/dist/ui/theme/themes/light.d.ts +2 -0
- package/dist/ui/theme/types.d.ts +51 -0
- package/dist/ui/theme.d.ts +51 -0
- package/dist/ui/to-render-items.d.ts +7 -0
- package/dist/ui/tools/AgentTool/index.d.ts +8 -0
- package/dist/ui/tools/ArchitectTool/index.d.ts +10 -0
- package/dist/ui/tools/AskUserTool/index.d.ts +19 -0
- package/dist/ui/tools/BashTool/BashToolResultMessage.d.ts +13 -0
- package/dist/ui/tools/BashTool/OutputLine.d.ts +6 -0
- package/dist/ui/tools/BashTool/index.d.ts +8 -0
- package/dist/ui/tools/BrowseTool/index.d.ts +20 -0
- package/dist/ui/tools/BrowserTool/index.d.ts +25 -0
- package/dist/ui/tools/CbmTool/index.d.ts +81 -0
- package/dist/ui/tools/CheckDelegationTool/index.d.ts +23 -0
- package/dist/ui/tools/CheckMessagesTool/index.d.ts +8 -0
- package/dist/ui/tools/CreateQuipTool/index.d.ts +10 -0
- package/dist/ui/tools/CreateSkillTool/index.d.ts +13 -0
- package/dist/ui/tools/CreateToolTool/index.d.ts +10 -0
- package/dist/ui/tools/DelegateRemoteTool/index.d.ts +22 -0
- package/dist/ui/tools/DeployTool/index.d.ts +24 -0
- package/dist/ui/tools/FffTool/index.d.ts +17 -0
- package/dist/ui/tools/FileEditTool/index.d.ts +10 -0
- package/dist/ui/tools/FileReadTool/index.d.ts +10 -0
- package/dist/ui/tools/FileWriteTool/index.d.ts +10 -0
- package/dist/ui/tools/FrgTool/index.d.ts +17 -0
- package/dist/ui/tools/GetThreadTool/index.d.ts +10 -0
- package/dist/ui/tools/GlobTool/index.d.ts +11 -0
- package/dist/ui/tools/GrepTool/index.d.ts +12 -0
- package/dist/ui/tools/HatchArionTool/index.d.ts +20 -0
- package/dist/ui/tools/LearnSkillTool/index.d.ts +13 -0
- package/dist/ui/tools/LearnTool/index.d.ts +15 -0
- package/dist/ui/tools/LearnToolTool/index.d.ts +14 -0
- package/dist/ui/tools/ListClientsTool/index.d.ts +10 -0
- package/dist/ui/tools/LspTool/index.d.ts +11 -0
- package/dist/ui/tools/MCPTool/index.d.ts +11 -0
- package/dist/ui/tools/ManageNetworkTool/index.d.ts +28 -0
- package/dist/ui/tools/MemoryReadTool/index.d.ts +8 -0
- package/dist/ui/tools/MemoryWriteTool/index.d.ts +6 -0
- package/dist/ui/tools/NotebookEditTool/index.d.ts +19 -0
- package/dist/ui/tools/NotebookReadTool/index.d.ts +12 -0
- package/dist/ui/tools/OutlookReadTool/index.d.ts +10 -0
- package/dist/ui/tools/OutlookReplyTool/index.d.ts +10 -0
- package/dist/ui/tools/OutlookSendTool/index.d.ts +10 -0
- package/dist/ui/tools/PauseDelegationTool/index.d.ts +20 -0
- package/dist/ui/tools/ProbeTool/index.d.ts +26 -0
- package/dist/ui/tools/ProcessTool/index.d.ts +29 -0
- package/dist/ui/tools/QuestListTool/index.d.ts +24 -0
- package/dist/ui/tools/QuestReportTool/index.d.ts +27 -0
- package/dist/ui/tools/QuestUpdateTool/index.d.ts +24 -0
- package/dist/ui/tools/QuipCommentTool/index.d.ts +23 -0
- package/dist/ui/tools/QuipReadTool/index.d.ts +26 -0
- package/dist/ui/tools/RestArionTool/index.d.ts +19 -0
- package/dist/ui/tools/RestartTool/index.d.ts +20 -0
- package/dist/ui/tools/ResumeDelegationTool/index.d.ts +21 -0
- package/dist/ui/tools/RetireArionTool/index.d.ts +19 -0
- package/dist/ui/tools/RgTool/index.d.ts +44 -0
- package/dist/ui/tools/SearchKnowledgeTool/index.d.ts +31 -0
- package/dist/ui/tools/SearchMessagesTool/index.d.ts +10 -0
- package/dist/ui/tools/SelfDiagnoseTool/index.d.ts +11 -0
- package/dist/ui/tools/SendMessageTool/index.d.ts +8 -0
- package/dist/ui/tools/SerenaTool/index.d.ts +18 -0
- package/dist/ui/tools/SessionHistoryTool/index.d.ts +32 -0
- package/dist/ui/tools/SgTool/index.d.ts +8 -0
- package/dist/ui/tools/SlackReactTool/index.d.ts +10 -0
- package/dist/ui/tools/SlackReadTool/index.d.ts +10 -0
- package/dist/ui/tools/SlackSendTool/index.d.ts +10 -0
- package/dist/ui/tools/SpawnWorkerTool/index.d.ts +18 -0
- package/dist/ui/tools/StickerRequestTool/index.d.ts +6 -0
- package/dist/ui/tools/ThinkTool/index.d.ts +8 -0
- package/dist/ui/tools/UgTool/index.d.ts +47 -0
- package/dist/ui/tools/UseSkillTool/index.d.ts +17 -0
- package/dist/ui/tools/WakeArionTool/index.d.ts +19 -0
- package/dist/ui/tools/WebFetchTool/index.d.ts +20 -0
- package/dist/ui/tools/WebSearchTool/index.d.ts +21 -0
- package/dist/ui/tools/lsTool/index.d.ts +12 -0
- package/dist/ui/tools/registry.d.ts +15 -0
- package/dist/ui/tools/tool-renderer.d.ts +24 -0
- package/dist/ui/tools/truncation.d.ts +6 -0
- package/dist/ui/types/anthropic.d.ts +19 -0
- package/dist/ui/types/index.d.ts +3 -0
- package/dist/ui/types/message.d.ts +19 -0
- package/dist/ui/types/tool.d.ts +17 -0
- package/dist/ui/utils/array.d.ts +1 -0
- package/dist/ui/utils/cursor.d.ts +28 -0
- package/dist/ui/utils/diff.d.ts +24 -0
- package/dist/ui/utils/format.d.ts +3 -0
- package/dist/ui/utils/fuzzy.d.ts +11 -0
- package/dist/ui/utils/index.d.ts +9 -0
- package/dist/ui/utils/keys.d.ts +6 -0
- package/dist/ui/utils/patch.d.ts +8 -0
- package/dist/ui/utils/risk.d.ts +14 -0
- package/dist/ui/utils/terminal-image.d.ts +18 -0
- package/dist/ui/utils/validation.d.ts +8 -0
- package/dist/ui/verb-pairs.d.ts +20 -0
- package/dist/ui.d.ts +70 -0
- package/package.json +76 -0
package/dist/ui/App.d.ts
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Command, type ArionOption, type ModelOption, type ThemeSelection, type BrowsableMemory, type MemoryBrowserMode, type StatusBarMetrics, type PairRequestInfo } from "./components/index.js";
|
|
3
|
+
import { type ProviderOption } from "./components/ProviderPicker.js";
|
|
4
|
+
import { type CopilotSourcePickerOption } from "./components/CopilotSourcePicker.js";
|
|
5
|
+
import { type ProviderMethodOption } from "./components/ProviderMethodPicker.js";
|
|
6
|
+
import type { AnthropicMethodOption, OpenAIMethodOption, GoogleMethodOption } from "../commands/login-handler.js";
|
|
7
|
+
import type { TraceWaterfallSpan } from "./components/TraceWaterfall.js";
|
|
8
|
+
import type { ArionSession } from "../session.js";
|
|
9
|
+
import type { ConversationMessage } from "../history/conversation-message.js";
|
|
10
|
+
import type { SessionSummary } from "../history/index.js";
|
|
11
|
+
import type { DisplayMode, DisplayConfig } from "./display-mode.js";
|
|
12
|
+
import { type ObservabilityContext } from "@aria-cli/aria";
|
|
13
|
+
import type { EffortLevel } from "@aria-cli/types";
|
|
14
|
+
import type { SelectableClient } from "../selectable-client.js";
|
|
15
|
+
import type { SelectablePeer } from "../selectable-peer.js";
|
|
16
|
+
export type ArionSelectorMode = "become" | "mention" | "rest" | "wake";
|
|
17
|
+
export interface AppProps {
|
|
18
|
+
session: ArionSession;
|
|
19
|
+
model: string;
|
|
20
|
+
/** Max context window tokens for the current model */
|
|
21
|
+
maxContextTokens?: number;
|
|
22
|
+
banner?: React.ReactNode;
|
|
23
|
+
messages?: ConversationMessage[];
|
|
24
|
+
/** Preview messages from TurnAccumulator.snapshot() — rendered in live zone only */
|
|
25
|
+
previewMessages?: ConversationMessage[];
|
|
26
|
+
isStreaming?: boolean;
|
|
27
|
+
queuedMessage?: string | null;
|
|
28
|
+
/** Called when user cancels a queued message (Escape during streaming with queued text).
|
|
29
|
+
* Returns the cancelled text so it can be put back in the input for editing. */
|
|
30
|
+
onCancelQueuedMessage?: () => void;
|
|
31
|
+
responseTime?: number;
|
|
32
|
+
commands?: Command[];
|
|
33
|
+
arions?: ArionOption[];
|
|
34
|
+
models?: ModelOption[];
|
|
35
|
+
memories?: BrowsableMemory[];
|
|
36
|
+
memoryBrowserMode?: MemoryBrowserMode;
|
|
37
|
+
isLoadingMemories?: boolean;
|
|
38
|
+
userName?: string | null;
|
|
39
|
+
/** Total memory count shown in REPL status contexts */
|
|
40
|
+
memoryCount?: number;
|
|
41
|
+
/** Live observability metrics for the StatusBar */
|
|
42
|
+
metrics?: StatusBarMetrics;
|
|
43
|
+
/** Current display mode */
|
|
44
|
+
displayMode?: DisplayMode;
|
|
45
|
+
/** Resolved display config for the current mode */
|
|
46
|
+
displayConfig?: DisplayConfig;
|
|
47
|
+
/** Whether thinking blocks are visible */
|
|
48
|
+
showThinking?: boolean;
|
|
49
|
+
/** Whether cost metrics are visible in the StatusBar */
|
|
50
|
+
showCosts?: boolean;
|
|
51
|
+
/** Whether trace waterfall is visible */
|
|
52
|
+
showTraces?: boolean;
|
|
53
|
+
/** Completed trace spans for waterfall visualization */
|
|
54
|
+
spans?: TraceWaterfallSpan[];
|
|
55
|
+
/** Pipeline timing report for TTFT breakdown display */
|
|
56
|
+
pipelineTiming?: {
|
|
57
|
+
phases: Array<{
|
|
58
|
+
phase: string;
|
|
59
|
+
durationMs: number;
|
|
60
|
+
pct: number;
|
|
61
|
+
}>;
|
|
62
|
+
totalMs: number;
|
|
63
|
+
};
|
|
64
|
+
/** Name of the active/responding arion for the current run */
|
|
65
|
+
activeArion?: string;
|
|
66
|
+
onSubmit: (input: string) => void;
|
|
67
|
+
onCommand: (command: string, args?: string) => void;
|
|
68
|
+
onSelectArion?: (name: string, mode: ArionSelectorMode) => void;
|
|
69
|
+
onSelectModel?: (name: string, effort: EffortLevel) => void;
|
|
70
|
+
onSelectTheme?: (theme: ThemeSelection) => void;
|
|
71
|
+
onSelectMemory?: (memory: BrowsableMemory) => void;
|
|
72
|
+
onOpenMemoryBrowser?: (mode: MemoryBrowserMode) => void;
|
|
73
|
+
/** Callback to toggle thinking block visibility */
|
|
74
|
+
onToggleThinking?: () => void;
|
|
75
|
+
/** Callback to toggle cost display in StatusBar */
|
|
76
|
+
onToggleCosts?: () => void;
|
|
77
|
+
/** Callback to toggle trace waterfall visibility */
|
|
78
|
+
onToggleTraces?: () => void;
|
|
79
|
+
/** Callback to cycle display mode (minimal -> standard -> debug) */
|
|
80
|
+
onCycleDisplayMode?: () => void;
|
|
81
|
+
sessions?: SessionSummary[];
|
|
82
|
+
onSelectSession?: (sessionId: string) => void;
|
|
83
|
+
onLoadSessions?: () => void;
|
|
84
|
+
onSearchSessions?: (query: string) => void;
|
|
85
|
+
onLoadMoreSessions?: (direction: "next" | "prev") => void;
|
|
86
|
+
/** Legacy prop kept for compatibility after Static-based transcript rendering removal */
|
|
87
|
+
staticRenderEpoch?: number;
|
|
88
|
+
/** Incrementing signal to request opening session overlay (e.g. /resume) */
|
|
89
|
+
openSessionOverlaySignal?: number;
|
|
90
|
+
/** Incrementing signal to request opening theme overlay (e.g. /theme) */
|
|
91
|
+
openThemeOverlaySignal?: number;
|
|
92
|
+
inputHistory?: string[];
|
|
93
|
+
onSaveInput?: (input: string) => void;
|
|
94
|
+
/** Live ObservabilityContext for the current run — drives the indicator state machine */
|
|
95
|
+
obsCtx?: ObservabilityContext | null;
|
|
96
|
+
onCancel?: () => void;
|
|
97
|
+
/** Pending tool approval request — shown as a dialog */
|
|
98
|
+
approvalRequest?: {
|
|
99
|
+
id: number;
|
|
100
|
+
toolName: string;
|
|
101
|
+
input: unknown;
|
|
102
|
+
riskLevel: "low" | "moderate" | "high";
|
|
103
|
+
issues?: string[];
|
|
104
|
+
} | null;
|
|
105
|
+
/** Callback when user approves/denies tool execution */
|
|
106
|
+
onApprovalChoice?: (approved: boolean) => void;
|
|
107
|
+
/** Current effort level for the model selector */
|
|
108
|
+
effortLevel?: EffortLevel;
|
|
109
|
+
/** Whether the autonomy selector panel is open */
|
|
110
|
+
showAutonomySelector?: boolean;
|
|
111
|
+
/** Current autonomy level */
|
|
112
|
+
autonomyLevel?: "minimal" | "balanced" | "high" | "full";
|
|
113
|
+
/** Number of unread mesh messages (0 = hidden) */
|
|
114
|
+
meshMessageCount?: number;
|
|
115
|
+
/** Path to daemon's runtime socket for real-time message subscription */
|
|
116
|
+
runtimeSocket?: string | null;
|
|
117
|
+
/** Attached client ID for subscribeDirectClientInbox */
|
|
118
|
+
clientId?: string | null;
|
|
119
|
+
/** Attached client auth token for subscribeDirectClientInbox */
|
|
120
|
+
clientAuthToken?: string | null;
|
|
121
|
+
/** Resolve fresh credentials when existing ones are stale (daemon restarted) */
|
|
122
|
+
resolveCredentials?: () => Promise<{
|
|
123
|
+
clientId: string;
|
|
124
|
+
clientAuthToken: string;
|
|
125
|
+
} | null>;
|
|
126
|
+
/** Callback when user selects a new autonomy level */
|
|
127
|
+
onAutonomySelect?: (level: "minimal" | "balanced" | "high" | "full") => void;
|
|
128
|
+
/** Callback when user cancels the autonomy selector */
|
|
129
|
+
onAutonomyCancel?: () => void;
|
|
130
|
+
/** Callback to cycle autonomy level (Shift+Tab) */
|
|
131
|
+
onCycleAutonomy?: () => void;
|
|
132
|
+
/** Callback to cycle effort level (Ctrl+E) */
|
|
133
|
+
onCycleEffort?: () => void;
|
|
134
|
+
/** Provider list for the login picker (null = hidden) */
|
|
135
|
+
loginPickerProviders?: ProviderOption[] | null;
|
|
136
|
+
/** Callback when user selects a provider in the login picker */
|
|
137
|
+
onLoginProviderSelect?: (provider: ProviderOption) => void;
|
|
138
|
+
/** Callback when user cancels the login picker */
|
|
139
|
+
onLoginPickerCancel?: () => void;
|
|
140
|
+
/** Copilot source picker options (null = hidden) */
|
|
141
|
+
copilotSourceOptions?: CopilotSourcePickerOption[] | null;
|
|
142
|
+
/** Callback when user selects a Copilot source option */
|
|
143
|
+
onCopilotSourceSelect?: (option: CopilotSourcePickerOption) => void;
|
|
144
|
+
/** Callback when user cancels Copilot source picker */
|
|
145
|
+
onCopilotSourceCancel?: () => void;
|
|
146
|
+
/** Provider ID for the active OAuth login flow (null = hidden) */
|
|
147
|
+
oauthProvider?: string | null;
|
|
148
|
+
/** Prebuilt authorize URL for kernel-driven OAuth login */
|
|
149
|
+
oauthAuthorizeUrl?: string | null;
|
|
150
|
+
/** Expected callback state for localhost OAuth callback flows */
|
|
151
|
+
oauthExpectedState?: string | null;
|
|
152
|
+
/** Callback when OAuth login flow completes (success or failure) */
|
|
153
|
+
onOAuthComplete?: (result: {
|
|
154
|
+
success: boolean;
|
|
155
|
+
message: string;
|
|
156
|
+
}) => void;
|
|
157
|
+
/** Callback when kernel-driven OAuth login captures an authorization code */
|
|
158
|
+
onOAuthCodeSubmit?: (code: string) => Promise<void> | void;
|
|
159
|
+
/** Callback when user cancels the OAuth login flow */
|
|
160
|
+
onOAuthCancel?: () => void;
|
|
161
|
+
/** Provider ID for active GitHub Copilot device flow (null = hidden) */
|
|
162
|
+
copilotDeviceProvider?: string | null;
|
|
163
|
+
/** Optional Copilot auth profile label (e.g. personal, work, team-x) */
|
|
164
|
+
copilotDeviceProfileLabel?: string | null;
|
|
165
|
+
/** Verification URL for a kernel-driven GitHub Copilot device flow */
|
|
166
|
+
copilotDeviceVerificationUri?: string | null;
|
|
167
|
+
/** User code for a kernel-driven GitHub Copilot device flow */
|
|
168
|
+
copilotDeviceUserCode?: string | null;
|
|
169
|
+
/** Callback when GitHub Copilot device flow completes */
|
|
170
|
+
onCopilotDeviceComplete?: (result: {
|
|
171
|
+
success: boolean;
|
|
172
|
+
message: string;
|
|
173
|
+
}) => void;
|
|
174
|
+
/** Callback when the user confirms a kernel-driven GitHub Copilot device flow */
|
|
175
|
+
onCopilotDeviceApprove?: () => Promise<void> | void;
|
|
176
|
+
/** Callback when user cancels GitHub Copilot device flow */
|
|
177
|
+
onCopilotDeviceCancel?: () => void;
|
|
178
|
+
/** Anthropic method picker options (null = hidden) */
|
|
179
|
+
anthropicMethodOptions?: AnthropicMethodOption[] | null;
|
|
180
|
+
/** Callback when user selects an Anthropic method */
|
|
181
|
+
onAnthropicMethodSelect?: (option: AnthropicMethodOption) => void;
|
|
182
|
+
/** Callback when user cancels Anthropic method picker */
|
|
183
|
+
onAnthropicMethodCancel?: () => void;
|
|
184
|
+
/** Show API key text input overlay */
|
|
185
|
+
anthropicKeyInputVisible?: boolean;
|
|
186
|
+
/** Callback when user submits an API key */
|
|
187
|
+
onAnthropicKeySubmit?: (apiKey: string) => void;
|
|
188
|
+
/** Callback when user cancels API key input */
|
|
189
|
+
onAnthropicKeyCancel?: () => void;
|
|
190
|
+
/** Show setup-token text input overlay */
|
|
191
|
+
anthropicSetupTokenVisible?: boolean;
|
|
192
|
+
/** Callback when user submits a setup token */
|
|
193
|
+
onAnthropicSetupTokenSubmit?: (token: string) => void;
|
|
194
|
+
/** Callback when user cancels setup token input */
|
|
195
|
+
onAnthropicSetupTokenCancel?: () => void;
|
|
196
|
+
/** OpenAI method picker options (null = hidden) */
|
|
197
|
+
openaiMethodOptions?: OpenAIMethodOption[] | null;
|
|
198
|
+
/** Callback when user selects an OpenAI method */
|
|
199
|
+
onOpenAIMethodSelect?: (option: OpenAIMethodOption) => void;
|
|
200
|
+
/** Callback when user cancels OpenAI method picker */
|
|
201
|
+
onOpenAIMethodCancel?: () => void;
|
|
202
|
+
/** Show OpenAI API key text input overlay */
|
|
203
|
+
openaiKeyInputVisible?: boolean;
|
|
204
|
+
/** Callback when user submits an OpenAI API key */
|
|
205
|
+
onOpenAIKeySubmit?: (apiKey: string) => void;
|
|
206
|
+
/** Callback when user cancels OpenAI key input */
|
|
207
|
+
onOpenAIKeyCancel?: () => void;
|
|
208
|
+
/** Google method picker options (null = hidden) */
|
|
209
|
+
googleMethodOptions?: GoogleMethodOption[] | null;
|
|
210
|
+
/** Callback when user selects a Google method */
|
|
211
|
+
onGoogleMethodSelect?: (option: GoogleMethodOption) => void;
|
|
212
|
+
/** Callback when user cancels Google method picker */
|
|
213
|
+
onGoogleMethodCancel?: () => void;
|
|
214
|
+
/** Show Google API key text input overlay */
|
|
215
|
+
googleKeyInputVisible?: boolean;
|
|
216
|
+
/** Callback when user submits a Google API key */
|
|
217
|
+
onGoogleKeySubmit?: (apiKey: string) => void;
|
|
218
|
+
/** Callback when user cancels Google key input */
|
|
219
|
+
onGoogleKeyCancel?: () => void;
|
|
220
|
+
/** Generic auth selection overlay options (null = hidden) */
|
|
221
|
+
authInteractionOptions?: ProviderMethodOption[] | null;
|
|
222
|
+
/** Generic auth selection overlay title */
|
|
223
|
+
authInteractionTitle?: string | null;
|
|
224
|
+
/** Callback when user selects a generic auth option */
|
|
225
|
+
onAuthInteractionSelect?: (optionId: string) => void;
|
|
226
|
+
/** Callback when user cancels the generic auth selection */
|
|
227
|
+
onAuthInteractionCancel?: () => void;
|
|
228
|
+
/** Generic auth text input overlay (null = hidden) */
|
|
229
|
+
authInteractionInput?: {
|
|
230
|
+
title: string;
|
|
231
|
+
hint?: string;
|
|
232
|
+
} | null;
|
|
233
|
+
/** Callback when user submits the generic auth input */
|
|
234
|
+
onAuthInteractionInputSubmit?: (value: string) => void;
|
|
235
|
+
/** Callback when user cancels the generic auth input */
|
|
236
|
+
onAuthInteractionInputCancel?: () => void;
|
|
237
|
+
/** Nearby peers discovered via mDNS */
|
|
238
|
+
nearbyPeers?: SelectablePeer[];
|
|
239
|
+
/** Same-home attached clients discovered from the runtime */
|
|
240
|
+
localClients?: SelectableClient[];
|
|
241
|
+
/** Callback when user selects a peer to connect to */
|
|
242
|
+
onSelectPeer?: (peer: SelectablePeer) => void;
|
|
243
|
+
/** Callback when user selects a same-home client */
|
|
244
|
+
onSelectClient?: (client: SelectableClient) => void;
|
|
245
|
+
/** Callback when user cancels peer selection */
|
|
246
|
+
onPeerCancel?: () => void;
|
|
247
|
+
/** Callback when user cancels client selection */
|
|
248
|
+
onClientsCancel?: () => void;
|
|
249
|
+
/** Incrementing signal to request opening peers overlay */
|
|
250
|
+
openPeersOverlaySignal?: number;
|
|
251
|
+
/** Incrementing signal to request opening clients overlay */
|
|
252
|
+
openClientsOverlaySignal?: number;
|
|
253
|
+
/** Invite share payload opens the invite share overlay when present */
|
|
254
|
+
inviteShare?: {
|
|
255
|
+
inviteToken: string;
|
|
256
|
+
inviteLabel?: string;
|
|
257
|
+
expiresAt?: string | null;
|
|
258
|
+
} | null;
|
|
259
|
+
/** Callback when user closes the invite share overlay */
|
|
260
|
+
onInviteShareClose?: () => void;
|
|
261
|
+
/** Incrementing signal to request opening the join invite overlay */
|
|
262
|
+
openJoinInviteOverlaySignal?: number;
|
|
263
|
+
/** Callback when user submits an invite token to join */
|
|
264
|
+
onJoinInviteSubmit?: (inviteToken: string) => void;
|
|
265
|
+
/** Callback when user cancels the join invite overlay */
|
|
266
|
+
onJoinInviteCancel?: () => void;
|
|
267
|
+
/** Optional join overlay error message */
|
|
268
|
+
joinInviteError?: string | null;
|
|
269
|
+
/** Incoming pair request from another peer */
|
|
270
|
+
incomingPairRequest?: PairRequestInfo | null;
|
|
271
|
+
/** Callback when user accepts a pair request */
|
|
272
|
+
onAcceptPairRequest?: () => void;
|
|
273
|
+
/** Callback when user rejects a pair request */
|
|
274
|
+
onRejectPairRequest?: () => void;
|
|
275
|
+
/** Callback to cancel an in-flight pairing long-poll (Escape during wait) */
|
|
276
|
+
onCancelPairing?: () => void;
|
|
277
|
+
/** Signal to open the message-edit overlay (increment to trigger) */
|
|
278
|
+
openMessageEditOverlaySignal?: number;
|
|
279
|
+
/** All messages from the current session for the message-edit overlay */
|
|
280
|
+
editableMessages?: import("./components/overlays/MessageSelector.js").MessageSelectorEntry[];
|
|
281
|
+
/** Called when user selects a message to edit (messageIndex, messageText) */
|
|
282
|
+
onEditMessage?: (messageIndex: number, messageText: string) => void;
|
|
283
|
+
/** Prefill text to load into the input box (e.g., after edit-message selection) */
|
|
284
|
+
prefillInput?: string;
|
|
285
|
+
/** Called after the prefill has been consumed */
|
|
286
|
+
onPrefillConsumed?: () => void;
|
|
287
|
+
}
|
|
288
|
+
export declare function App({ session, model, maxContextTokens, banner, messages, previewMessages, isStreaming, queuedMessage, onCancelQueuedMessage, responseTime, commands, arions, models, memories, memoryBrowserMode, isLoadingMemories, userName, metrics, displayMode, displayConfig, showThinking, showCosts, showTraces, spans, pipelineTiming, activeArion, onSubmit, onCommand, onSelectArion, onSelectModel, onSelectTheme, onSelectMemory, onOpenMemoryBrowser, onToggleThinking, onToggleCosts, onToggleTraces, onCycleDisplayMode, sessions, onSelectSession, onLoadSessions, onSearchSessions, onLoadMoreSessions, staticRenderEpoch, openSessionOverlaySignal, openThemeOverlaySignal, 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, runtimeSocket, clientId, clientAuthToken, resolveCredentials, }: AppProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { AnthropicMethodOption } from "../../commands/login-handler.js";
|
|
3
|
+
export interface AnthropicMethodPickerProps {
|
|
4
|
+
options: AnthropicMethodOption[];
|
|
5
|
+
onSelect: (option: AnthropicMethodOption) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function AnthropicMethodPicker({ options, onSelect, onCancel, isActive, }: AnthropicMethodPickerProps): React.ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ArionPromptProps {
|
|
2
|
+
userName?: string | null;
|
|
3
|
+
}
|
|
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 declare function ArionPrompt({ userName }: ArionPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Suggestion } from '../hooks/useCommandAutocomplete.js';
|
|
3
|
+
interface AutocompleteDropdownProps {
|
|
4
|
+
suggestions: Suggestion[];
|
|
5
|
+
selectedIndex: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function AutocompleteDropdown({ suggestions, selectedIndex, width, }: AutocompleteDropdownProps): React.ReactElement | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AUTONOMY_LEVELS } from "@aria-cli/aria";
|
|
3
|
+
type AutonomyLevel = (typeof AUTONOMY_LEVELS)[number];
|
|
4
|
+
export interface AutonomySelectorProps {
|
|
5
|
+
currentLevel: AutonomyLevel;
|
|
6
|
+
onSelect: (level: AutonomyLevel) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
/** When false, the selector stops capturing keystrokes. Defaults to true. */
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function AutonomySelector({ currentLevel, onSelect, onCancel, isActive, }: AutonomySelectorProps): React.ReactElement;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BannerProps {
|
|
3
|
+
onComplete: () => void;
|
|
4
|
+
skipAnimation?: boolean;
|
|
5
|
+
version?: string;
|
|
6
|
+
whatsNew?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function Banner({ onComplete, skipAnimation, version, whatsNew, }: BannerProps): React.ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MessageArion } from "./Message.js";
|
|
3
|
+
import type { ToolExecutionInfo } from "./tool-types.js";
|
|
4
|
+
import type { DisplayConfig } from "../display-mode.js";
|
|
5
|
+
/**
|
|
6
|
+
* HistoryMessage — discriminated union for all items in static conversation history.
|
|
7
|
+
*
|
|
8
|
+
* Text-based variants (user/assistant/system/tool) share a common shape with
|
|
9
|
+
* required `content`. Rich variants (tool_history/thinking_history/handoff_history)
|
|
10
|
+
* carry structured data for component rendering in Static scrollback.
|
|
11
|
+
*/
|
|
12
|
+
type BaseMsg = {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
type TextMessage = BaseMsg & {
|
|
16
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
17
|
+
content: string;
|
|
18
|
+
arion?: MessageArion;
|
|
19
|
+
userName?: string;
|
|
20
|
+
toolStatus?: "complete" | "error";
|
|
21
|
+
};
|
|
22
|
+
type ToolHistoryMessage = BaseMsg & {
|
|
23
|
+
role: "tool_history";
|
|
24
|
+
tool: ToolExecutionInfo;
|
|
25
|
+
};
|
|
26
|
+
type ThinkingHistoryMessage = BaseMsg & {
|
|
27
|
+
role: "thinking_history";
|
|
28
|
+
content: string;
|
|
29
|
+
wordCount: number;
|
|
30
|
+
durationSeconds?: number;
|
|
31
|
+
verb?: string;
|
|
32
|
+
arionName?: string;
|
|
33
|
+
arionEmoji?: string;
|
|
34
|
+
arionColor?: string;
|
|
35
|
+
};
|
|
36
|
+
type ErrorHistoryMessage = BaseMsg & {
|
|
37
|
+
role: "error";
|
|
38
|
+
content: string;
|
|
39
|
+
suggestion?: string;
|
|
40
|
+
level?: "inline" | "boxed";
|
|
41
|
+
};
|
|
42
|
+
type HandoffHistoryMessage = BaseMsg & {
|
|
43
|
+
role: "handoff_history";
|
|
44
|
+
target: string;
|
|
45
|
+
direction: "to" | "from";
|
|
46
|
+
};
|
|
47
|
+
export type HistoryMessage = TextMessage | ToolHistoryMessage | ThinkingHistoryMessage | HandoffHistoryMessage | ErrorHistoryMessage;
|
|
48
|
+
export { type ToolExecutionInfo };
|
|
49
|
+
export interface ConversationHistoryProps {
|
|
50
|
+
messages: HistoryMessage[];
|
|
51
|
+
header?: React.ReactNode;
|
|
52
|
+
displayConfig?: DisplayConfig;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Static conversation history using the new rendering pipeline.
|
|
56
|
+
* Converts HistoryMessage[] → RenderItem[] → RenderItemView.
|
|
57
|
+
* No normalize/reorder — tool use + result already combined.
|
|
58
|
+
*/
|
|
59
|
+
export declare function ConversationHistory({ messages, header, displayConfig }: ConversationHistoryProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CopilotDeviceLoginFlowProps {
|
|
3
|
+
provider: string;
|
|
4
|
+
profileLabel?: string;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
onComplete?: (result: {
|
|
8
|
+
success: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
verificationUri?: string;
|
|
12
|
+
userCode?: string;
|
|
13
|
+
onApprove?: () => Promise<void> | void;
|
|
14
|
+
}
|
|
15
|
+
export declare function CopilotDeviceLoginFlow({ provider, profileLabel, onCancel, isActive, onComplete, verificationUri, userCode, onApprove, }: CopilotDeviceLoginFlowProps): React.ReactElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CopilotSourcePickerOption {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
status: "connected" | "none";
|
|
6
|
+
}
|
|
7
|
+
export interface CopilotSourcePickerProps {
|
|
8
|
+
options: CopilotSourcePickerOption[];
|
|
9
|
+
onSelect: (option: CopilotSourcePickerOption) => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function CopilotSourcePicker({ options, onSelect, onCancel, isActive, }: CopilotSourcePickerProps): React.ReactElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type OptionHeader } from "./select.js";
|
|
2
|
+
export type Option = {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly value: string;
|
|
5
|
+
};
|
|
6
|
+
type OptionMapItem = (Option | OptionHeader) & {
|
|
7
|
+
previous: OptionMapItem | undefined;
|
|
8
|
+
next: OptionMapItem | undefined;
|
|
9
|
+
index: number;
|
|
10
|
+
};
|
|
11
|
+
export default class OptionMap extends Map<string, OptionMapItem> {
|
|
12
|
+
readonly first: OptionMapItem | undefined;
|
|
13
|
+
constructor(options: (Option | OptionHeader)[]);
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type SelectOptionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Determines if option is focused.
|
|
5
|
+
*/
|
|
6
|
+
readonly isFocused: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Determines if option is selected.
|
|
9
|
+
*/
|
|
10
|
+
readonly isSelected: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Determines if pointer is shown when selected
|
|
13
|
+
*/
|
|
14
|
+
readonly smallPointer?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Option label.
|
|
17
|
+
*/
|
|
18
|
+
readonly children: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare function SelectOption({ isFocused, isSelected, smallPointer, children }: SelectOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Option } from "./option-map.js";
|
|
2
|
+
export type OptionSubtree = {
|
|
3
|
+
/**
|
|
4
|
+
* Header to show above sub-options.
|
|
5
|
+
*/
|
|
6
|
+
readonly header?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Options.
|
|
9
|
+
*/
|
|
10
|
+
readonly options: (Option | OptionSubtree)[];
|
|
11
|
+
};
|
|
12
|
+
export type OptionHeader = {
|
|
13
|
+
readonly header: string;
|
|
14
|
+
readonly optionValues: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare const optionHeaderKey: (optionHeader: OptionHeader) => string;
|
|
17
|
+
export type SelectProps = {
|
|
18
|
+
/**
|
|
19
|
+
* When disabled, user input is ignored.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
readonly isDisabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Number of visible options.
|
|
26
|
+
*
|
|
27
|
+
* @default 5
|
|
28
|
+
*/
|
|
29
|
+
readonly visibleOptionCount?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Highlight text in option labels.
|
|
32
|
+
*/
|
|
33
|
+
readonly highlightText?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Options.
|
|
36
|
+
*/
|
|
37
|
+
readonly options: (Option | OptionSubtree)[];
|
|
38
|
+
/**
|
|
39
|
+
* Default value.
|
|
40
|
+
*/
|
|
41
|
+
readonly defaultValue?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Callback when selected option changes.
|
|
44
|
+
*/
|
|
45
|
+
readonly onChange?: (value: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Callback when focused option changes.
|
|
48
|
+
*/
|
|
49
|
+
readonly onFocus?: (value: string) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Value to focus
|
|
52
|
+
*/
|
|
53
|
+
readonly focusValue?: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function Select({ isDisabled, visibleOptionCount, highlightText, options, defaultValue, onChange, onFocus, focusValue, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import OptionMap, { type Option } from "./option-map.js";
|
|
2
|
+
import type { OptionHeader, OptionSubtree } from "./select.js";
|
|
3
|
+
type State = {
|
|
4
|
+
/**
|
|
5
|
+
* Map where key is option's value and value is option's index.
|
|
6
|
+
*/
|
|
7
|
+
optionMap: OptionMap;
|
|
8
|
+
/**
|
|
9
|
+
* Number of visible options.
|
|
10
|
+
*/
|
|
11
|
+
visibleOptionCount: number;
|
|
12
|
+
/**
|
|
13
|
+
* Value of the currently focused option.
|
|
14
|
+
*/
|
|
15
|
+
focusedValue: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Index of the first visible option.
|
|
18
|
+
*/
|
|
19
|
+
visibleFromIndex: number;
|
|
20
|
+
/**
|
|
21
|
+
* Index of the last visible option.
|
|
22
|
+
*/
|
|
23
|
+
visibleToIndex: number;
|
|
24
|
+
/**
|
|
25
|
+
* Value of the previously selected option.
|
|
26
|
+
*/
|
|
27
|
+
previousValue: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Value of the selected option.
|
|
30
|
+
*/
|
|
31
|
+
value: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
export type UseSelectStateProps = {
|
|
34
|
+
/**
|
|
35
|
+
* Number of items to display.
|
|
36
|
+
*
|
|
37
|
+
* @default 5
|
|
38
|
+
*/
|
|
39
|
+
visibleOptionCount?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Options.
|
|
42
|
+
*/
|
|
43
|
+
options: (Option | OptionSubtree)[];
|
|
44
|
+
/**
|
|
45
|
+
* Initially selected option's value.
|
|
46
|
+
*/
|
|
47
|
+
defaultValue?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Callback for selecting an option.
|
|
50
|
+
*/
|
|
51
|
+
onChange?: (value: string) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Callback for focusing an option.
|
|
54
|
+
*/
|
|
55
|
+
onFocus?: (value: string) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Value to focus
|
|
58
|
+
*/
|
|
59
|
+
focusValue?: string;
|
|
60
|
+
};
|
|
61
|
+
export type SelectState = Pick<State, "focusedValue" | "visibleFromIndex" | "visibleToIndex" | "value"> & {
|
|
62
|
+
/**
|
|
63
|
+
* Visible options.
|
|
64
|
+
*/
|
|
65
|
+
visibleOptions: Array<(Option | OptionHeader) & {
|
|
66
|
+
index: number;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Focus next option and scroll the list down, if needed.
|
|
70
|
+
*/
|
|
71
|
+
focusNextOption: () => void;
|
|
72
|
+
/**
|
|
73
|
+
* Focus previous option and scroll the list up, if needed.
|
|
74
|
+
*/
|
|
75
|
+
focusPreviousOption: () => void;
|
|
76
|
+
/**
|
|
77
|
+
* Select currently focused option.
|
|
78
|
+
*/
|
|
79
|
+
selectFocusedOption: () => void;
|
|
80
|
+
};
|
|
81
|
+
export declare const useSelectState: ({ visibleOptionCount, options, defaultValue, onChange, onFocus, focusValue, }: UseSelectStateProps) => {
|
|
82
|
+
focusedValue: string | undefined;
|
|
83
|
+
visibleFromIndex: number;
|
|
84
|
+
visibleToIndex: number;
|
|
85
|
+
value: string | undefined;
|
|
86
|
+
visibleOptions: ({
|
|
87
|
+
index: number;
|
|
88
|
+
label: string;
|
|
89
|
+
value: string;
|
|
90
|
+
} | {
|
|
91
|
+
index: number;
|
|
92
|
+
header: string;
|
|
93
|
+
optionValues: string[];
|
|
94
|
+
})[];
|
|
95
|
+
focusNextOption: () => void;
|
|
96
|
+
focusPreviousOption: () => void;
|
|
97
|
+
selectFocusedOption: () => void;
|
|
98
|
+
};
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SelectState } from "./use-select-state.js";
|
|
2
|
+
export type UseSelectProps = {
|
|
3
|
+
/**
|
|
4
|
+
* When disabled, user input is ignored.
|
|
5
|
+
*
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Select state.
|
|
11
|
+
*/
|
|
12
|
+
state: SelectState;
|
|
13
|
+
};
|
|
14
|
+
export declare const useSelect: ({ isDisabled, state }: UseSelectProps) => void;
|