@aria-cli/cli 1.0.50 → 1.0.52
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 +569 -569
- package/dist/.tsbuildinfo +1 -0
- package/dist/attached-local-control-client.d.ts.map +1 -0
- package/dist/attached-local-control-client.js +826 -0
- package/dist/attached-local-control-client.js.map +1 -0
- package/dist/bootstrap-local-control-client.d.ts.map +1 -0
- package/dist/bootstrap-local-control-client.js +2 -0
- package/dist/bootstrap-local-control-client.js.map +1 -0
- package/dist/capability-aware-method-proxy.js +42 -0
- package/dist/capability-aware-method-proxy.js.map +1 -0
- package/dist/cli-context.d.ts.map +1 -0
- package/dist/cli-context.js +160 -0
- package/dist/cli-context.js.map +1 -0
- package/dist/commands/arions.d.ts.map +1 -0
- package/dist/commands/arions.js +174 -0
- package/dist/commands/arions.js.map +1 -0
- package/dist/commands/auth.js +123 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/daemon.d.ts.map +1 -0
- package/dist/commands/daemon.js +245 -0
- package/dist/commands/daemon.js.map +1 -0
- package/dist/commands/definitions.js +176 -0
- package/dist/commands/definitions.js.map +1 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +74 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/login-handler.js +1108 -0
- package/dist/commands/login-handler.js.map +1 -0
- package/dist/commands/logout-handler.js +92 -0
- package/dist/commands/logout-handler.js.map +1 -0
- package/dist/commands/memory-handlers.js +89 -0
- package/dist/commands/memory-handlers.js.map +1 -0
- package/dist/commands/pairing.d.ts.map +1 -0
- package/dist/commands/pairing.js +60 -0
- package/dist/commands/pairing.js.map +1 -0
- package/dist/commands/runtime-cutover-reset-command.d.ts.map +1 -0
- package/dist/commands/runtime-cutover-reset-command.js +12 -0
- package/dist/commands/runtime-cutover-reset-command.js.map +1 -0
- package/dist/commands/runtime-cutover-reset.d.ts.map +1 -0
- package/dist/commands/runtime-cutover-reset.js +265 -0
- package/dist/commands/runtime-cutover-reset.js.map +1 -0
- package/dist/commands/terminal-setup.js +84 -0
- package/dist/commands/terminal-setup.js.map +1 -0
- package/dist/config/aria-config.js +238 -0
- package/dist/config/aria-config.js.map +1 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +97 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config.js +142 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon-info.d.ts.map +1 -0
- package/dist/daemon-info.js +10 -0
- package/dist/daemon-info.js.map +1 -0
- package/dist/ensure-daemon.d.ts.map +1 -0
- package/dist/ensure-daemon.js +128 -0
- package/dist/ensure-daemon.js.map +1 -0
- package/dist/entrypoints/command-mode.d.ts.map +1 -0
- package/dist/entrypoints/command-mode.js +5 -0
- package/dist/entrypoints/command-mode.js.map +1 -0
- package/dist/entrypoints/daemon.d.ts.map +1 -0
- package/dist/entrypoints/daemon.js +50 -0
- package/dist/entrypoints/daemon.js.map +1 -0
- package/dist/entrypoints/headless-stdio.d.ts.map +1 -0
- package/dist/entrypoints/headless-stdio.js +25 -0
- package/dist/entrypoints/headless-stdio.js.map +1 -0
- package/dist/entrypoints/interactive.d.ts.map +1 -0
- package/dist/entrypoints/interactive.js +80 -0
- package/dist/entrypoints/interactive.js.map +1 -0
- package/dist/event-loop-watchdog.js +73 -0
- package/dist/event-loop-watchdog.js.map +1 -0
- package/dist/headless/auth-orchestrator.d.ts.map +1 -0
- package/dist/headless/auth-orchestrator.js +508 -0
- package/dist/headless/auth-orchestrator.js.map +1 -0
- package/dist/headless/auth-service.js +43 -0
- package/dist/headless/auth-service.js.map +1 -0
- package/dist/headless/bootstrap-fast-path.d.ts.map +1 -0
- package/dist/headless/bootstrap-fast-path.js +112 -0
- package/dist/headless/bootstrap-fast-path.js.map +1 -0
- package/dist/headless/call-command.d.ts.map +1 -0
- package/dist/headless/call-command.js +143 -0
- package/dist/headless/call-command.js.map +1 -0
- package/dist/headless/daemon-service.d.ts.map +1 -0
- package/dist/headless/daemon-service.js +318 -0
- package/dist/headless/daemon-service.js.map +1 -0
- package/dist/headless/hook-actions.d.ts.map +1 -0
- package/dist/headless/hook-actions.js +235 -0
- package/dist/headless/hook-actions.js.map +1 -0
- package/dist/headless/hook-service.d.ts.map +1 -0
- package/dist/headless/hook-service.js +42 -0
- package/dist/headless/hook-service.js.map +1 -0
- package/dist/headless/kernel-services.d.ts.map +1 -0
- package/dist/headless/kernel-services.js +216 -0
- package/dist/headless/kernel-services.js.map +1 -0
- package/dist/headless/kernel.d.ts.map +1 -0
- package/dist/headless/kernel.js +785 -0
- package/dist/headless/kernel.js.map +1 -0
- package/dist/headless/operations/arion.d.ts.map +1 -0
- package/dist/headless/operations/arion.js +119 -0
- package/dist/headless/operations/arion.js.map +1 -0
- package/dist/headless/operations/auth.d.ts.map +1 -0
- package/dist/headless/operations/auth.js +45 -0
- package/dist/headless/operations/auth.js.map +1 -0
- package/dist/headless/operations/client.d.ts.map +1 -0
- package/dist/headless/operations/client.js +31 -0
- package/dist/headless/operations/client.js.map +1 -0
- package/dist/headless/operations/config.d.ts.map +1 -0
- package/dist/headless/operations/config.js +69 -0
- package/dist/headless/operations/config.js.map +1 -0
- package/dist/headless/operations/daemon.d.ts.map +1 -0
- package/dist/headless/operations/daemon.js +47 -0
- package/dist/headless/operations/daemon.js.map +1 -0
- package/dist/headless/operations/hook.d.ts.map +1 -0
- package/dist/headless/operations/hook.js +56 -0
- package/dist/headless/operations/hook.js.map +1 -0
- package/dist/headless/operations/index.d.ts.map +1 -0
- package/dist/headless/operations/index.js +11 -0
- package/dist/headless/operations/index.js.map +1 -0
- package/dist/headless/operations/memory.d.ts.map +1 -0
- package/dist/headless/operations/memory.js +102 -0
- package/dist/headless/operations/memory.js.map +1 -0
- package/dist/headless/operations/message.d.ts.map +1 -0
- package/dist/headless/operations/message.js +279 -0
- package/dist/headless/operations/message.js.map +1 -0
- package/dist/headless/operations/model.d.ts.map +1 -0
- package/dist/headless/operations/model.js +100 -0
- package/dist/headless/operations/model.js.map +1 -0
- package/dist/headless/operations/peer.d.ts.map +1 -0
- package/dist/headless/operations/peer.js +56 -0
- package/dist/headless/operations/peer.js.map +1 -0
- package/dist/headless/operations/run.d.ts.map +1 -0
- package/dist/headless/operations/run.js +24 -0
- package/dist/headless/operations/run.js.map +1 -0
- package/dist/headless/operations/session.d.ts.map +1 -0
- package/dist/headless/operations/session.js +90 -0
- package/dist/headless/operations/session.js.map +1 -0
- package/dist/headless/operations/system.d.ts.map +1 -0
- package/dist/headless/operations/system.js +19 -0
- package/dist/headless/operations/system.js.map +1 -0
- package/dist/headless/operations/utils.d.ts.map +1 -0
- package/dist/headless/operations/utils.js +35 -0
- package/dist/headless/operations/utils.js.map +1 -0
- package/dist/headless/run-orchestrator.d.ts.map +1 -0
- package/dist/headless/run-orchestrator.js +703 -0
- package/dist/headless/run-orchestrator.js.map +1 -0
- package/dist/headless/stdio-server.d.ts.map +1 -0
- package/dist/headless/stdio-server.js +439 -0
- package/dist/headless/stdio-server.js.map +1 -0
- package/dist/history/SessionHistory.js +8 -0
- package/dist/history/SessionHistory.js.map +1 -0
- package/dist/history/SessionHistoryClient.js +186 -0
- package/dist/history/SessionHistoryClient.js.map +1 -0
- package/dist/history/conversation-message.js +112 -0
- package/dist/history/conversation-message.js.map +1 -0
- package/dist/history/index.d.ts.map +1 -0
- package/dist/history/index.js +8 -0
- package/dist/history/index.js.map +1 -0
- package/dist/history/jsonl-replay.d.ts.map +1 -0
- package/dist/history/jsonl-replay.js +154 -0
- package/dist/history/jsonl-replay.js.map +1 -0
- package/dist/history/repair-tool-pairing.js +84 -0
- package/dist/history/repair-tool-pairing.js.map +1 -0
- package/dist/history/stall-phase-bridge.js +11 -0
- package/dist/history/stall-phase-bridge.js.map +1 -0
- package/dist/history/turn-accumulator.d.ts.map +1 -0
- package/dist/history/turn-accumulator.js +427 -0
- package/dist/history/turn-accumulator.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/ink-repl.d.ts.map +1 -0
- package/dist/ink-repl.js +4183 -0
- package/dist/ink-repl.js.map +1 -0
- package/dist/local-control-bootstrap.d.ts.map +1 -0
- package/dist/local-control-bootstrap.js +26 -0
- package/dist/local-control-bootstrap.js.map +1 -0
- package/dist/local-control-client.d.ts.map +1 -0
- package/dist/local-control-client.js +2 -0
- package/dist/local-control-client.js.map +1 -0
- package/dist/local-control-error-reporting.js +34 -0
- package/dist/local-control-error-reporting.js.map +1 -0
- package/dist/local-control-http-client.d.ts.map +1 -0
- package/dist/local-control-http-client.js +362 -0
- package/dist/local-control-http-client.js.map +1 -0
- package/dist/local-control-lazy-wrapper.d.ts.map +1 -0
- package/dist/local-control-lazy-wrapper.js +363 -0
- package/dist/local-control-lazy-wrapper.js.map +1 -0
- package/dist/local-control-manager.d.ts.map +1 -0
- package/dist/local-control-manager.js +146 -0
- package/dist/local-control-manager.js.map +1 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +38 -0
- package/dist/main.js.map +1 -0
- package/dist/network-security.js +62 -0
- package/dist/network-security.js.map +1 -0
- package/dist/networking-server.d.ts.map +1 -0
- package/dist/networking-server.js +38 -0
- package/dist/networking-server.js.map +1 -0
- package/dist/peer-identity.d.ts.map +1 -0
- package/dist/peer-identity.js +23 -0
- package/dist/peer-identity.js.map +1 -0
- package/dist/polling-subscription.js +34 -0
- package/dist/polling-subscription.js.map +1 -0
- package/dist/relaunch.d.ts.map +1 -0
- package/dist/relaunch.js +588 -0
- package/dist/relaunch.js.map +1 -0
- package/dist/release-notes.js +35 -0
- package/dist/release-notes.js.map +1 -0
- package/dist/repl-cleanup.js +47 -0
- package/dist/repl-cleanup.js.map +1 -0
- package/dist/runtime/configure-bun-sqlite.d.ts.map +1 -0
- package/dist/runtime/configure-bun-sqlite.js +3 -0
- package/dist/runtime/configure-bun-sqlite.js.map +1 -0
- package/dist/runtime/crash-handlers.js +111 -0
- package/dist/runtime/crash-handlers.js.map +1 -0
- package/dist/runtime/interactive-invocation.js +39 -0
- package/dist/runtime/interactive-invocation.js.map +1 -0
- package/dist/runtime/internal-mode.js +14 -0
- package/dist/runtime/internal-mode.js.map +1 -0
- package/dist/runtime/launch-spec.js +64 -0
- package/dist/runtime/launch-spec.js.map +1 -0
- package/dist/runtime/owner-lease.js +44 -0
- package/dist/runtime/owner-lease.js.map +1 -0
- package/dist/runtime/public-mode.js +20 -0
- package/dist/runtime/public-mode.js.map +1 -0
- package/dist/runtime/run-internal-mode.d.ts.map +1 -0
- package/dist/runtime/run-internal-mode.js +18 -0
- package/dist/runtime/run-internal-mode.js.map +1 -0
- package/dist/runtime/runtime-kind.js +32 -0
- package/dist/runtime/runtime-kind.js.map +1 -0
- package/dist/runtime/spawn-aria.js +38 -0
- package/dist/runtime/spawn-aria.js.map +1 -0
- package/dist/selectable-client.d.ts.map +1 -0
- package/dist/selectable-client.js +2 -0
- package/dist/selectable-client.js.map +1 -0
- package/dist/selectable-peer.d.ts.map +1 -0
- package/dist/selectable-peer.js +2 -0
- package/dist/selectable-peer.js.map +1 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +203 -0
- package/dist/session.js.map +1 -0
- package/dist/slash-commands.js +80 -0
- package/dist/slash-commands.js.map +1 -0
- package/dist/sounds.js +210 -0
- package/dist/sounds.js.map +1 -0
- package/dist/ui/App.d.ts.map +1 -0
- package/dist/ui/App.js +526 -0
- package/dist/ui/App.js.map +1 -0
- package/dist/ui/components/AnthropicMethodPicker.js +6 -0
- package/dist/ui/components/AnthropicMethodPicker.js.map +1 -0
- package/dist/ui/components/ArionPrompt.js +15 -0
- package/dist/ui/components/ArionPrompt.js.map +1 -0
- package/dist/ui/components/AutocompleteDropdown.js +23 -0
- package/dist/ui/components/AutocompleteDropdown.js.map +1 -0
- package/dist/ui/components/AutonomySelector.d.ts.map +1 -0
- package/dist/ui/components/AutonomySelector.js +55 -0
- package/dist/ui/components/AutonomySelector.js.map +1 -0
- package/dist/ui/components/Banner.js +98 -0
- package/dist/ui/components/Banner.js.map +1 -0
- package/dist/ui/components/ConversationHistory.js +175 -0
- package/dist/ui/components/ConversationHistory.js.map +1 -0
- package/dist/ui/components/CopilotDeviceLoginFlow.js +88 -0
- package/dist/ui/components/CopilotDeviceLoginFlow.js.map +1 -0
- package/dist/ui/components/CopilotSourcePicker.js +50 -0
- package/dist/ui/components/CopilotSourcePicker.js.map +1 -0
- package/dist/ui/components/Cost.js +10 -0
- package/dist/ui/components/Cost.js.map +1 -0
- package/dist/ui/components/CustomSelect/option-map.js +30 -0
- package/dist/ui/components/CustomSelect/option-map.js.map +1 -0
- package/dist/ui/components/CustomSelect/select-option.js +13 -0
- package/dist/ui/components/CustomSelect/select-option.js.map +1 -0
- package/dist/ui/components/CustomSelect/select.js +42 -0
- package/dist/ui/components/CustomSelect/select.js.map +1 -0
- package/dist/ui/components/CustomSelect/use-select-state.js +179 -0
- package/dist/ui/components/CustomSelect/use-select-state.js.map +1 -0
- package/dist/ui/components/CustomSelect/use-select.js +15 -0
- package/dist/ui/components/CustomSelect/use-select.js.map +1 -0
- package/dist/ui/components/ErrorDisplay.js +35 -0
- package/dist/ui/components/ErrorDisplay.js.map +1 -0
- package/dist/ui/components/FallbackToolUseRejectedMessage.js +7 -0
- package/dist/ui/components/FallbackToolUseRejectedMessage.js.map +1 -0
- package/dist/ui/components/FileEditToolUpdatedMessage.js +57 -0
- package/dist/ui/components/FileEditToolUpdatedMessage.js.map +1 -0
- package/dist/ui/components/HandoffMarker.js +18 -0
- package/dist/ui/components/HandoffMarker.js.map +1 -0
- package/dist/ui/components/HighlightedCode.js +21 -0
- package/dist/ui/components/HighlightedCode.js.map +1 -0
- package/dist/ui/components/InputArea.js +187 -0
- package/dist/ui/components/InputArea.js.map +1 -0
- package/dist/ui/components/Message.js +25 -0
- package/dist/ui/components/Message.js.map +1 -0
- package/dist/ui/components/OAuthLoginFlow.js +113 -0
- package/dist/ui/components/OAuthLoginFlow.js.map +1 -0
- package/dist/ui/components/OutputTruncation.js +35 -0
- package/dist/ui/components/OutputTruncation.js.map +1 -0
- package/dist/ui/components/PermissionPrompt.js +79 -0
- package/dist/ui/components/PermissionPrompt.js.map +1 -0
- package/dist/ui/components/PipelineTimingPanel.js +15 -0
- package/dist/ui/components/PipelineTimingPanel.js.map +1 -0
- package/dist/ui/components/ProviderMethodPicker.js +61 -0
- package/dist/ui/components/ProviderMethodPicker.js.map +1 -0
- package/dist/ui/components/ProviderPicker.js +63 -0
- package/dist/ui/components/ProviderPicker.js.map +1 -0
- package/dist/ui/components/RenderItemView.js +71 -0
- package/dist/ui/components/RenderItemView.js.map +1 -0
- package/dist/ui/components/Spinner.js +46 -0
- package/dist/ui/components/Spinner.js.map +1 -0
- package/dist/ui/components/StatusBar.js +95 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/StreamingIndicator.js +55 -0
- package/dist/ui/components/StreamingIndicator.js.map +1 -0
- package/dist/ui/components/StructuredDiff.js +168 -0
- package/dist/ui/components/StructuredDiff.js.map +1 -0
- package/dist/ui/components/TextInputOverlay.js +43 -0
- package/dist/ui/components/TextInputOverlay.js.map +1 -0
- package/dist/ui/components/ThinkingBlock.js +82 -0
- package/dist/ui/components/ThinkingBlock.js.map +1 -0
- package/dist/ui/components/ToolCost.js +17 -0
- package/dist/ui/components/ToolCost.js.map +1 -0
- package/dist/ui/components/ToolExecution.js +61 -0
- package/dist/ui/components/ToolExecution.js.map +1 -0
- package/dist/ui/components/ToolHeader.js +51 -0
- package/dist/ui/components/ToolHeader.js.map +1 -0
- package/dist/ui/components/ToolRenderLayoutContext.js +14 -0
- package/dist/ui/components/ToolRenderLayoutContext.js.map +1 -0
- package/dist/ui/components/ToolResultWrapper.js +6 -0
- package/dist/ui/components/ToolResultWrapper.js.map +1 -0
- package/dist/ui/components/ToolUseLoader.js +35 -0
- package/dist/ui/components/ToolUseLoader.js.map +1 -0
- package/dist/ui/components/TraceWaterfall.js +91 -0
- package/dist/ui/components/TraceWaterfall.js.map +1 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +33 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/messages/AssistantTextMessage.js +25 -0
- package/dist/ui/components/messages/AssistantTextMessage.js.map +1 -0
- package/dist/ui/components/messages/UserImageMessage.js +12 -0
- package/dist/ui/components/messages/UserImageMessage.js.map +1 -0
- package/dist/ui/components/messages/UserTextMessage.js +12 -0
- package/dist/ui/components/messages/UserTextMessage.js.map +1 -0
- package/dist/ui/components/overlays/ArionSelector.js +68 -0
- package/dist/ui/components/overlays/ArionSelector.js.map +1 -0
- package/dist/ui/components/overlays/ClientSelector.d.ts.map +1 -0
- package/dist/ui/components/overlays/ClientSelector.js +62 -0
- package/dist/ui/components/overlays/ClientSelector.js.map +1 -0
- package/dist/ui/components/overlays/CommandPalette.js +67 -0
- package/dist/ui/components/overlays/CommandPalette.js.map +1 -0
- package/dist/ui/components/overlays/DaemonControl.js +87 -0
- package/dist/ui/components/overlays/DaemonControl.js.map +1 -0
- package/dist/ui/components/overlays/InviteShareOverlay.js +15 -0
- package/dist/ui/components/overlays/InviteShareOverlay.js.map +1 -0
- package/dist/ui/components/overlays/JoinInviteOverlay.js +32 -0
- package/dist/ui/components/overlays/JoinInviteOverlay.js.map +1 -0
- package/dist/ui/components/overlays/MemoryBrowser.js +100 -0
- package/dist/ui/components/overlays/MemoryBrowser.js.map +1 -0
- package/dist/ui/components/overlays/MessageSelector.js +123 -0
- package/dist/ui/components/overlays/MessageSelector.js.map +1 -0
- package/dist/ui/components/overlays/ModelSelector.js +211 -0
- package/dist/ui/components/overlays/ModelSelector.js.map +1 -0
- package/dist/ui/components/overlays/PairRequestOverlay.d.ts.map +1 -0
- package/dist/ui/components/overlays/PairRequestOverlay.js +42 -0
- package/dist/ui/components/overlays/PairRequestOverlay.js.map +1 -0
- package/dist/ui/components/overlays/PeerSelector.d.ts.map +1 -0
- package/dist/ui/components/overlays/PeerSelector.js +84 -0
- package/dist/ui/components/overlays/PeerSelector.js.map +1 -0
- package/dist/ui/components/overlays/SessionSelector.d.ts.map +1 -0
- package/dist/ui/components/overlays/SessionSelector.js +102 -0
- package/dist/ui/components/overlays/SessionSelector.js.map +1 -0
- package/dist/ui/components/overlays/SoundSelector.js +86 -0
- package/dist/ui/components/overlays/SoundSelector.js.map +1 -0
- package/dist/ui/components/overlays/ThemeSelector.js +139 -0
- package/dist/ui/components/overlays/ThemeSelector.js.map +1 -0
- package/dist/ui/components/overlays/index.d.ts.map +1 -0
- package/dist/ui/components/overlays/index.js +15 -0
- package/dist/ui/components/overlays/index.js.map +1 -0
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +53 -0
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js.map +1 -0
- package/dist/ui/components/permissions/FallbackPermissionRequest.js +56 -0
- package/dist/ui/components/permissions/FallbackPermissionRequest.js.map +1 -0
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +76 -0
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js.map +1 -0
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +18 -0
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js.map +1 -0
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +64 -0
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js.map +1 -0
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +26 -0
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js.map +1 -0
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +141 -0
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +1 -0
- package/dist/ui/components/permissions/PermissionRequest.js +70 -0
- package/dist/ui/components/permissions/PermissionRequest.js.map +1 -0
- package/dist/ui/components/permissions/PermissionRequestTitle.js +41 -0
- package/dist/ui/components/permissions/PermissionRequestTitle.js.map +1 -0
- package/dist/ui/components/permissions/hooks.js +10 -0
- package/dist/ui/components/permissions/hooks.js.map +1 -0
- package/dist/ui/components/permissions/toolUseOptions.js +68 -0
- package/dist/ui/components/permissions/toolUseOptions.js.map +1 -0
- package/dist/ui/components/permissions/utils.js +10 -0
- package/dist/ui/components/permissions/utils.js.map +1 -0
- package/dist/ui/components/text-input/Cursor.js +326 -0
- package/dist/ui/components/text-input/Cursor.js.map +1 -0
- package/dist/ui/components/text-input/TextInput.js +231 -0
- package/dist/ui/components/text-input/TextInput.js.map +1 -0
- package/dist/ui/components/text-input/imagePaste.js +28 -0
- package/dist/ui/components/text-input/imagePaste.js.map +1 -0
- package/dist/ui/components/text-input/index.js +6 -0
- package/dist/ui/components/text-input/index.js.map +1 -0
- package/dist/ui/components/text-input/useDoublePress.js +30 -0
- package/dist/ui/components/text-input/useDoublePress.js.map +1 -0
- package/dist/ui/components/text-input/useTextInput.js +245 -0
- package/dist/ui/components/text-input/useTextInput.js.map +1 -0
- package/dist/ui/components/tool-types.js +9 -0
- package/dist/ui/components/tool-types.js.map +1 -0
- package/dist/ui/constants/figures.js +4 -0
- package/dist/ui/constants/figures.js.map +1 -0
- package/dist/ui/constants/index.js +3 -0
- package/dist/ui/constants/index.js.map +1 -0
- package/dist/ui/display-mode.js +93 -0
- package/dist/ui/display-mode.js.map +1 -0
- package/dist/ui/display-policy.js +19 -0
- package/dist/ui/display-policy.js.map +1 -0
- package/dist/ui/hooks/index.js +6 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/useCommandAutocomplete.js +93 -0
- package/dist/ui/hooks/useCommandAutocomplete.js.map +1 -0
- package/dist/ui/hooks/useDoublePress.js +37 -0
- package/dist/ui/hooks/useDoublePress.js.map +1 -0
- package/dist/ui/hooks/useIndicatorState.d.ts.map +1 -0
- package/dist/ui/hooks/useIndicatorState.js +55 -0
- package/dist/ui/hooks/useIndicatorState.js.map +1 -0
- package/dist/ui/hooks/useInterval.js +23 -0
- package/dist/ui/hooks/useInterval.js.map +1 -0
- package/dist/ui/hooks/useKeyboardShortcuts.js +127 -0
- package/dist/ui/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/ui/hooks/useTerminalSize.js +55 -0
- package/dist/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/ui/hooks/useUnifiedMessages.js +117 -0
- package/dist/ui/hooks/useUnifiedMessages.js.map +1 -0
- package/dist/ui/indicator-state.js +44 -0
- package/dist/ui/indicator-state.js.map +1 -0
- package/dist/ui/markdown/highlight.js +44 -0
- package/dist/ui/markdown/highlight.js.map +1 -0
- package/dist/ui/markdown/index.js +1460 -0
- package/dist/ui/markdown/index.js.map +1 -0
- package/dist/ui/markdown/tokenizer.js +24 -0
- package/dist/ui/markdown/tokenizer.js.map +1 -0
- package/dist/ui/render-item.js +5 -0
- package/dist/ui/render-item.js.map +1 -0
- package/dist/ui/screens/REPL.d.ts.map +1 -0
- package/dist/ui/screens/REPL.js +119 -0
- package/dist/ui/screens/REPL.js.map +1 -0
- package/dist/ui/screens/approval-lifecycle.js +38 -0
- package/dist/ui/screens/approval-lifecycle.js.map +1 -0
- package/dist/ui/status-line.d.ts.map +1 -0
- package/dist/ui/status-line.js +72 -0
- package/dist/ui/status-line.js.map +1 -0
- package/dist/ui/theme/index.js +51 -0
- package/dist/ui/theme/index.js.map +1 -0
- package/dist/ui/theme/themes/claude-dark-daltonized.js +51 -0
- package/dist/ui/theme/themes/claude-dark-daltonized.js.map +1 -0
- package/dist/ui/theme/themes/claude-dark.js +50 -0
- package/dist/ui/theme/themes/claude-dark.js.map +1 -0
- package/dist/ui/theme/themes/claude-light-daltonized.js +51 -0
- package/dist/ui/theme/themes/claude-light-daltonized.js.map +1 -0
- package/dist/ui/theme/themes/claude-light.js +50 -0
- package/dist/ui/theme/themes/claude-light.js.map +1 -0
- package/dist/ui/theme/themes/dark-accessible.js +18 -0
- package/dist/ui/theme/themes/dark-accessible.js.map +1 -0
- package/dist/ui/theme/themes/dark.js +49 -0
- package/dist/ui/theme/themes/dark.js.map +1 -0
- package/dist/ui/theme/themes/light-accessible.js +18 -0
- package/dist/ui/theme/themes/light-accessible.js.map +1 -0
- package/dist/ui/theme/themes/light.js +49 -0
- package/dist/ui/theme/themes/light.js.map +1 -0
- package/dist/ui/theme/types.js +3 -0
- package/dist/ui/theme/types.js.map +1 -0
- package/dist/ui/theme.js +142 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/to-render-items.js +145 -0
- package/dist/ui/to-render-items.js.map +1 -0
- package/dist/ui/tools/AgentTool/index.js +30 -0
- package/dist/ui/tools/AgentTool/index.js.map +1 -0
- package/dist/ui/tools/ArchitectTool/index.js +31 -0
- package/dist/ui/tools/ArchitectTool/index.js.map +1 -0
- package/dist/ui/tools/AskUserTool/index.js +46 -0
- package/dist/ui/tools/AskUserTool/index.js.map +1 -0
- package/dist/ui/tools/BashTool/BashToolResultMessage.js +11 -0
- package/dist/ui/tools/BashTool/BashToolResultMessage.js.map +1 -0
- package/dist/ui/tools/BashTool/OutputLine.js +21 -0
- package/dist/ui/tools/BashTool/OutputLine.js.map +1 -0
- package/dist/ui/tools/BashTool/index.js +91 -0
- package/dist/ui/tools/BashTool/index.js.map +1 -0
- package/dist/ui/tools/BrowseTool/index.js +43 -0
- package/dist/ui/tools/BrowseTool/index.js.map +1 -0
- package/dist/ui/tools/BrowserTool/index.js +47 -0
- package/dist/ui/tools/BrowserTool/index.js.map +1 -0
- package/dist/ui/tools/CbmTool/index.js +188 -0
- package/dist/ui/tools/CbmTool/index.js.map +1 -0
- package/dist/ui/tools/CheckDelegationTool/index.js +46 -0
- package/dist/ui/tools/CheckDelegationTool/index.js.map +1 -0
- package/dist/ui/tools/CheckMessagesTool/index.js +85 -0
- package/dist/ui/tools/CheckMessagesTool/index.js.map +1 -0
- package/dist/ui/tools/CreateQuipTool/index.js +30 -0
- package/dist/ui/tools/CreateQuipTool/index.js.map +1 -0
- package/dist/ui/tools/CreateSkillTool/index.js +22 -0
- package/dist/ui/tools/CreateSkillTool/index.js.map +1 -0
- package/dist/ui/tools/CreateToolTool/index.js +31 -0
- package/dist/ui/tools/CreateToolTool/index.js.map +1 -0
- package/dist/ui/tools/DelegateRemoteTool/index.js +42 -0
- package/dist/ui/tools/DelegateRemoteTool/index.js.map +1 -0
- package/dist/ui/tools/DeployTool/index.js +47 -0
- package/dist/ui/tools/DeployTool/index.js.map +1 -0
- package/dist/ui/tools/FffTool/index.js +103 -0
- package/dist/ui/tools/FffTool/index.js.map +1 -0
- package/dist/ui/tools/FileEditTool/index.js +67 -0
- package/dist/ui/tools/FileEditTool/index.js.map +1 -0
- package/dist/ui/tools/FileReadTool/index.js +68 -0
- package/dist/ui/tools/FileReadTool/index.js.map +1 -0
- package/dist/ui/tools/FileWriteTool/index.js +61 -0
- package/dist/ui/tools/FileWriteTool/index.js.map +1 -0
- package/dist/ui/tools/ForkTool/index.js +47 -0
- package/dist/ui/tools/ForkTool/index.js.map +1 -0
- package/dist/ui/tools/FrgTool/index.js +96 -0
- package/dist/ui/tools/FrgTool/index.js.map +1 -0
- package/dist/ui/tools/GetThreadTool/index.js +39 -0
- package/dist/ui/tools/GetThreadTool/index.js.map +1 -0
- package/dist/ui/tools/GlobTool/index.js +50 -0
- package/dist/ui/tools/GlobTool/index.js.map +1 -0
- package/dist/ui/tools/GrepTool/index.js +84 -0
- package/dist/ui/tools/GrepTool/index.js.map +1 -0
- package/dist/ui/tools/HatchArionTool/index.js +36 -0
- package/dist/ui/tools/HatchArionTool/index.js.map +1 -0
- package/dist/ui/tools/LearnSkillTool/index.js +22 -0
- package/dist/ui/tools/LearnSkillTool/index.js.map +1 -0
- package/dist/ui/tools/LearnTool/index.js +43 -0
- package/dist/ui/tools/LearnTool/index.js.map +1 -0
- package/dist/ui/tools/LearnToolTool/index.js +22 -0
- package/dist/ui/tools/LearnToolTool/index.js.map +1 -0
- package/dist/ui/tools/ListClientsTool/index.js +39 -0
- package/dist/ui/tools/ListClientsTool/index.js.map +1 -0
- package/dist/ui/tools/LspTool/index.js +261 -0
- package/dist/ui/tools/LspTool/index.js.map +1 -0
- package/dist/ui/tools/MCPTool/index.js +33 -0
- package/dist/ui/tools/MCPTool/index.js.map +1 -0
- package/dist/ui/tools/ManageNetworkTool/index.js +53 -0
- package/dist/ui/tools/ManageNetworkTool/index.js.map +1 -0
- package/dist/ui/tools/MemoryReadTool/index.js +64 -0
- package/dist/ui/tools/MemoryReadTool/index.js.map +1 -0
- package/dist/ui/tools/MemoryWriteTool/index.js +20 -0
- package/dist/ui/tools/MemoryWriteTool/index.js.map +1 -0
- package/dist/ui/tools/NotebookEditTool/index.js +33 -0
- package/dist/ui/tools/NotebookEditTool/index.js.map +1 -0
- package/dist/ui/tools/NotebookReadTool/index.js +25 -0
- package/dist/ui/tools/NotebookReadTool/index.js.map +1 -0
- package/dist/ui/tools/OutlookReadTool/index.js +66 -0
- package/dist/ui/tools/OutlookReadTool/index.js.map +1 -0
- package/dist/ui/tools/OutlookReplyTool/index.js +49 -0
- package/dist/ui/tools/OutlookReplyTool/index.js.map +1 -0
- package/dist/ui/tools/OutlookSendTool/index.js +49 -0
- package/dist/ui/tools/OutlookSendTool/index.js.map +1 -0
- package/dist/ui/tools/PauseDelegationTool/index.js +35 -0
- package/dist/ui/tools/PauseDelegationTool/index.js.map +1 -0
- package/dist/ui/tools/ProbeTool/index.js +121 -0
- package/dist/ui/tools/ProbeTool/index.js.map +1 -0
- package/dist/ui/tools/ProcessTool/index.js +66 -0
- package/dist/ui/tools/ProcessTool/index.js.map +1 -0
- package/dist/ui/tools/QuestListTool/index.js +46 -0
- package/dist/ui/tools/QuestListTool/index.js.map +1 -0
- package/dist/ui/tools/QuestReportTool/index.js +49 -0
- package/dist/ui/tools/QuestReportTool/index.js.map +1 -0
- package/dist/ui/tools/QuestUpdateTool/index.js +87 -0
- package/dist/ui/tools/QuestUpdateTool/index.js.map +1 -0
- package/dist/ui/tools/QuipCommentTool/index.js +69 -0
- package/dist/ui/tools/QuipCommentTool/index.js.map +1 -0
- package/dist/ui/tools/QuipReadTool/index.js +71 -0
- package/dist/ui/tools/QuipReadTool/index.js.map +1 -0
- package/dist/ui/tools/RestArionTool/index.js +32 -0
- package/dist/ui/tools/RestArionTool/index.js.map +1 -0
- package/dist/ui/tools/RestartTool/index.js +35 -0
- package/dist/ui/tools/RestartTool/index.js.map +1 -0
- package/dist/ui/tools/ResumeDelegationTool/index.js +35 -0
- package/dist/ui/tools/ResumeDelegationTool/index.js.map +1 -0
- package/dist/ui/tools/RetireArionTool/index.js +32 -0
- package/dist/ui/tools/RetireArionTool/index.js.map +1 -0
- package/dist/ui/tools/RgTool/index.js +73 -0
- package/dist/ui/tools/RgTool/index.js.map +1 -0
- package/dist/ui/tools/SearchKnowledgeTool/index.js +43 -0
- package/dist/ui/tools/SearchKnowledgeTool/index.js.map +1 -0
- package/dist/ui/tools/SearchMessagesTool/index.js +43 -0
- package/dist/ui/tools/SearchMessagesTool/index.js.map +1 -0
- package/dist/ui/tools/SelfDiagnoseTool/index.js +61 -0
- package/dist/ui/tools/SelfDiagnoseTool/index.js.map +1 -0
- package/dist/ui/tools/SendMessageTool/index.js +45 -0
- package/dist/ui/tools/SendMessageTool/index.js.map +1 -0
- package/dist/ui/tools/SerenaTool/index.js +124 -0
- package/dist/ui/tools/SerenaTool/index.js.map +1 -0
- package/dist/ui/tools/SessionHistoryTool/index.js +52 -0
- package/dist/ui/tools/SessionHistoryTool/index.js.map +1 -0
- package/dist/ui/tools/SgTool/index.js +80 -0
- package/dist/ui/tools/SgTool/index.js.map +1 -0
- package/dist/ui/tools/SlackReactTool/index.js +41 -0
- package/dist/ui/tools/SlackReactTool/index.js.map +1 -0
- package/dist/ui/tools/SlackReadTool/index.js +48 -0
- package/dist/ui/tools/SlackReadTool/index.js.map +1 -0
- package/dist/ui/tools/SlackSendTool/index.js +45 -0
- package/dist/ui/tools/SlackSendTool/index.js.map +1 -0
- package/dist/ui/tools/SpawnWorkerTool/index.js +33 -0
- package/dist/ui/tools/SpawnWorkerTool/index.js.map +1 -0
- package/dist/ui/tools/StickerRequestTool/index.js +19 -0
- package/dist/ui/tools/StickerRequestTool/index.js.map +1 -0
- package/dist/ui/tools/ThinkTool/index.js +17 -0
- package/dist/ui/tools/ThinkTool/index.js.map +1 -0
- package/dist/ui/tools/UgTool/index.js +108 -0
- package/dist/ui/tools/UgTool/index.js.map +1 -0
- package/dist/ui/tools/UseSkillTool/index.js +22 -0
- package/dist/ui/tools/UseSkillTool/index.js.map +1 -0
- package/dist/ui/tools/WakeArionTool/index.js +32 -0
- package/dist/ui/tools/WakeArionTool/index.js.map +1 -0
- package/dist/ui/tools/WebFetchTool/index.js +56 -0
- package/dist/ui/tools/WebFetchTool/index.js.map +1 -0
- package/dist/ui/tools/WebSearchTool/index.js +44 -0
- package/dist/ui/tools/WebSearchTool/index.js.map +1 -0
- package/dist/ui/tools/lsTool/index.js +58 -0
- package/dist/ui/tools/lsTool/index.js.map +1 -0
- package/dist/ui/tools/registry.js +197 -0
- package/dist/ui/tools/registry.js.map +1 -0
- package/dist/ui/tools/tool-renderer.js +11 -0
- package/dist/ui/tools/tool-renderer.js.map +1 -0
- package/dist/ui/tools/truncation.js +35 -0
- package/dist/ui/tools/truncation.js.map +1 -0
- package/dist/ui/types/anthropic.js +4 -0
- package/dist/ui/types/anthropic.js.map +1 -0
- package/dist/ui/types/index.js +2 -0
- package/dist/ui/types/index.js.map +1 -0
- package/dist/ui/types/message.js +3 -0
- package/dist/ui/types/message.js.map +1 -0
- package/dist/ui/types/tool.js +4 -0
- package/dist/ui/types/tool.js.map +1 -0
- package/dist/ui/utils/array.js +4 -0
- package/dist/ui/utils/array.js.map +1 -0
- package/dist/ui/utils/cursor.js +131 -0
- package/dist/ui/utils/cursor.js.map +1 -0
- package/dist/ui/utils/diff.js +120 -0
- package/dist/ui/utils/diff.js.map +1 -0
- package/dist/ui/utils/format.js +42 -0
- package/dist/ui/utils/format.js.map +1 -0
- package/dist/ui/utils/fuzzy.js +59 -0
- package/dist/ui/utils/fuzzy.js.map +1 -0
- package/dist/ui/utils/index.js +11 -0
- package/dist/ui/utils/index.js.map +1 -0
- package/dist/ui/utils/keys.js +8 -0
- package/dist/ui/utils/keys.js.map +1 -0
- package/dist/ui/utils/patch.js +17 -0
- package/dist/ui/utils/patch.js.map +1 -0
- package/dist/ui/utils/risk.js +114 -0
- package/dist/ui/utils/risk.js.map +1 -0
- package/dist/ui/utils/terminal-image.js +70 -0
- package/dist/ui/utils/terminal-image.js.map +1 -0
- package/dist/ui/utils/validation.js +48 -0
- package/dist/ui/utils/validation.js.map +1 -0
- package/dist/ui/verb-pairs.js +248 -0
- package/dist/ui/verb-pairs.js.map +1 -0
- package/dist/ui.js +131 -0
- package/dist/ui.js.map +1 -0
- package/package.json +73 -14
- package/src/entrypoints/command-mode.ts +5 -0
- package/src/entrypoints/daemon.ts +54 -0
- package/src/entrypoints/headless-stdio.ts +27 -0
- package/src/entrypoints/interactive.ts +112 -0
- package/src/main.ts +44 -0
- package/src/runtime/configure-bun-sqlite.ts +3 -0
- package/src/runtime/crash-handlers.ts +128 -0
- package/src/runtime/interactive-invocation.test.ts +42 -0
- package/src/runtime/interactive-invocation.ts +51 -0
- package/src/runtime/internal-mode.test.ts +19 -0
- package/src/runtime/internal-mode.ts +24 -0
- package/src/runtime/launch-spec.test.ts +26 -0
- package/src/runtime/launch-spec.ts +84 -0
- package/src/runtime/owner-lease.ts +52 -0
- package/src/runtime/public-mode.test.ts +18 -0
- package/src/runtime/public-mode.ts +19 -0
- package/src/runtime/run-internal-mode.ts +19 -0
- package/src/runtime/runtime-kind.test.ts +23 -0
- package/src/runtime/runtime-kind.ts +41 -0
- package/src/runtime/spawn-aria.ts +62 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TOOL_RENDERERS — canonical map from tool name → ToolRenderer.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth. Consumed by ToolExecution.tsx and REPL.tsx.
|
|
5
|
+
* Each renderer implements the ToolRenderer interface (see tool-renderer.ts).
|
|
6
|
+
*/
|
|
7
|
+
import { BashToolRenderers } from "./BashTool/index.js";
|
|
8
|
+
import { FileEditToolRenderers } from "./FileEditTool/index.js";
|
|
9
|
+
import { FileReadToolRenderers } from "./FileReadTool/index.js";
|
|
10
|
+
import { FileWriteToolRenderers } from "./FileWriteTool/index.js";
|
|
11
|
+
import { GrepToolRenderers } from "./GrepTool/index.js";
|
|
12
|
+
import { GlobToolRenderers } from "./GlobTool/index.js";
|
|
13
|
+
import { LsToolRenderers } from "./lsTool/index.js";
|
|
14
|
+
import { MCPToolRenderers } from "./MCPTool/index.js";
|
|
15
|
+
import { ThinkToolRenderers } from "./ThinkTool/index.js";
|
|
16
|
+
import { MemoryReadToolRenderers } from "./MemoryReadTool/index.js";
|
|
17
|
+
import { MemoryWriteToolRenderers } from "./MemoryWriteTool/index.js";
|
|
18
|
+
import { AgentToolRenderers } from "./AgentTool/index.js";
|
|
19
|
+
import { NotebookReadToolRenderers } from "./NotebookReadTool/index.js";
|
|
20
|
+
import { NotebookEditToolRenderers } from "./NotebookEditTool/index.js";
|
|
21
|
+
import { ArchitectToolRenderers } from "./ArchitectTool/index.js";
|
|
22
|
+
import { StickerRequestToolRenderers } from "./StickerRequestTool/index.js";
|
|
23
|
+
import { WebFetchToolRenderers } from "./WebFetchTool/index.js";
|
|
24
|
+
import { BrowseToolRenderers } from "./BrowseTool/index.js";
|
|
25
|
+
import { WebSearchToolRenderers } from "./WebSearchTool/index.js";
|
|
26
|
+
import { LearnToolRenderers } from "./LearnTool/index.js";
|
|
27
|
+
import { LearnToolToolRenderers } from "./LearnToolTool/index.js";
|
|
28
|
+
import { LearnSkillToolRenderers } from "./LearnSkillTool/index.js";
|
|
29
|
+
import { CreateToolToolRenderers } from "./CreateToolTool/index.js";
|
|
30
|
+
import { CreateSkillToolRenderers } from "./CreateSkillTool/index.js";
|
|
31
|
+
import { UseSkillToolRenderers } from "./UseSkillTool/index.js";
|
|
32
|
+
import { QuestListToolRenderers } from "./QuestListTool/index.js";
|
|
33
|
+
import { QuestUpdateToolRenderers } from "./QuestUpdateTool/index.js";
|
|
34
|
+
import { AskUserToolRenderers } from "./AskUserTool/index.js";
|
|
35
|
+
import { HatchArionToolRenderers } from "./HatchArionTool/index.js";
|
|
36
|
+
import { RestArionToolRenderers } from "./RestArionTool/index.js";
|
|
37
|
+
import { WakeArionToolRenderers } from "./WakeArionTool/index.js";
|
|
38
|
+
import { RetireArionToolRenderers } from "./RetireArionTool/index.js";
|
|
39
|
+
import { SpawnWorkerToolRenderers } from "./SpawnWorkerTool/index.js";
|
|
40
|
+
import { ForkToolRenderers } from "./ForkTool/index.js";
|
|
41
|
+
import { CheckDelegationToolRenderers } from "./CheckDelegationTool/index.js";
|
|
42
|
+
import { BrowserToolRenderers } from "./BrowserTool/index.js";
|
|
43
|
+
import { ProcessToolRenderers } from "./ProcessTool/index.js";
|
|
44
|
+
import { SearchKnowledgeToolRenderers } from "./SearchKnowledgeTool/index.js";
|
|
45
|
+
import { SelfDiagnoseToolRenderers } from "./SelfDiagnoseTool/index.js";
|
|
46
|
+
// Code search & intelligence tools
|
|
47
|
+
import { RgToolRenderers } from "./RgTool/index.js";
|
|
48
|
+
import { UgToolRenderers } from "./UgTool/index.js";
|
|
49
|
+
import { ProbeToolRenderers } from "./ProbeTool/index.js";
|
|
50
|
+
import { SgToolRenderers } from "./SgTool/index.js";
|
|
51
|
+
import { CbmToolRenderers } from "./CbmTool/index.js";
|
|
52
|
+
import { LspToolRenderers } from "./LspTool/index.js";
|
|
53
|
+
import { FrgToolRenderers } from "./FrgTool/index.js";
|
|
54
|
+
import { FffToolRenderers } from "./FffTool/index.js";
|
|
55
|
+
import { SerenaToolRenderers } from "./SerenaTool/index.js";
|
|
56
|
+
import { QuipReadToolRenderers } from "./QuipReadTool/index.js";
|
|
57
|
+
import { QuipCommentToolRenderers } from "./QuipCommentTool/index.js";
|
|
58
|
+
import { CreateQuipToolRenderers } from "./CreateQuipTool/index.js";
|
|
59
|
+
// Slack tools
|
|
60
|
+
import { SlackReadToolRenderers } from "./SlackReadTool/index.js";
|
|
61
|
+
import { SlackSendToolRenderers } from "./SlackSendTool/index.js";
|
|
62
|
+
import { SlackReactToolRenderers } from "./SlackReactTool/index.js";
|
|
63
|
+
// Outlook tools
|
|
64
|
+
import { OutlookReadToolRenderers } from "./OutlookReadTool/index.js";
|
|
65
|
+
import { OutlookSendToolRenderers } from "./OutlookSendTool/index.js";
|
|
66
|
+
import { OutlookReplyToolRenderers } from "./OutlookReplyTool/index.js";
|
|
67
|
+
// Messaging tools
|
|
68
|
+
import { SendMessageToolRenderers } from "./SendMessageTool/index.js";
|
|
69
|
+
import { CheckMessagesToolRenderers } from "./CheckMessagesTool/index.js";
|
|
70
|
+
import { SearchMessagesToolRenderers } from "./SearchMessagesTool/index.js";
|
|
71
|
+
import { GetThreadToolRenderers } from "./GetThreadTool/index.js";
|
|
72
|
+
import { ListClientsToolRenderers } from "./ListClientsTool/index.js";
|
|
73
|
+
// Delegation/network/deploy/misc tools
|
|
74
|
+
import { DelegateRemoteToolRenderers } from "./DelegateRemoteTool/index.js";
|
|
75
|
+
import { PauseDelegationToolRenderers } from "./PauseDelegationTool/index.js";
|
|
76
|
+
import { ResumeDelegationToolRenderers } from "./ResumeDelegationTool/index.js";
|
|
77
|
+
import { QuestReportToolRenderers } from "./QuestReportTool/index.js";
|
|
78
|
+
import { ManageNetworkToolRenderers } from "./ManageNetworkTool/index.js";
|
|
79
|
+
import { DeployToolRenderers } from "./DeployTool/index.js";
|
|
80
|
+
import { SessionHistoryToolRenderers } from "./SessionHistoryTool/index.js";
|
|
81
|
+
import { RestartToolRenderers } from "./RestartTool/index.js";
|
|
82
|
+
/**
|
|
83
|
+
* Maps tool names (lowercase) to ToolRenderer instances.
|
|
84
|
+
*
|
|
85
|
+
* Each renderer implements: displayName, renderInput, renderOutput, renderRejection?
|
|
86
|
+
* See tool-renderer.ts for the interface definition.
|
|
87
|
+
*/
|
|
88
|
+
export const TOOL_RENDERERS = {
|
|
89
|
+
// Shell tools
|
|
90
|
+
bash: BashToolRenderers,
|
|
91
|
+
exec: BashToolRenderers,
|
|
92
|
+
spawn: BashToolRenderers,
|
|
93
|
+
execute_command: BashToolRenderers,
|
|
94
|
+
// File tools
|
|
95
|
+
file_edit: FileEditToolRenderers,
|
|
96
|
+
edit_file: FileEditToolRenderers,
|
|
97
|
+
file_read: FileReadToolRenderers,
|
|
98
|
+
read_file: FileReadToolRenderers,
|
|
99
|
+
file_write: FileWriteToolRenderers,
|
|
100
|
+
write_file: FileWriteToolRenderers,
|
|
101
|
+
// Search tools
|
|
102
|
+
grep: GrepToolRenderers,
|
|
103
|
+
search: SearchKnowledgeToolRenderers,
|
|
104
|
+
glob: GlobToolRenderers,
|
|
105
|
+
web_search: WebSearchToolRenderers,
|
|
106
|
+
rg: RgToolRenderers,
|
|
107
|
+
ug: UgToolRenderers,
|
|
108
|
+
frg: FrgToolRenderers,
|
|
109
|
+
fff: FffToolRenderers,
|
|
110
|
+
probe: ProbeToolRenderers,
|
|
111
|
+
sg: SgToolRenderers,
|
|
112
|
+
// Code intelligence tools
|
|
113
|
+
lsp: LspToolRenderers,
|
|
114
|
+
cbm: CbmToolRenderers,
|
|
115
|
+
serena: SerenaToolRenderers,
|
|
116
|
+
// Filesystem tools
|
|
117
|
+
list_dir: LsToolRenderers,
|
|
118
|
+
ls: LsToolRenderers,
|
|
119
|
+
// Web tools
|
|
120
|
+
web_fetch: WebFetchToolRenderers,
|
|
121
|
+
browse: BrowseToolRenderers,
|
|
122
|
+
// Memory tools (ARIA-specific)
|
|
123
|
+
recall: MemoryReadToolRenderers,
|
|
124
|
+
recall_knowledge: MemoryReadToolRenderers,
|
|
125
|
+
remember: MemoryWriteToolRenderers,
|
|
126
|
+
forget: MemoryWriteToolRenderers,
|
|
127
|
+
reflect: MemoryWriteToolRenderers,
|
|
128
|
+
memory_read: MemoryReadToolRenderers,
|
|
129
|
+
memory_write: MemoryWriteToolRenderers,
|
|
130
|
+
// Meta/learning tools (ARIA-specific)
|
|
131
|
+
learn: LearnToolRenderers,
|
|
132
|
+
learn_tool: LearnToolToolRenderers,
|
|
133
|
+
learn_skill: LearnSkillToolRenderers,
|
|
134
|
+
create_tool: CreateToolToolRenderers,
|
|
135
|
+
create_skill: CreateSkillToolRenderers,
|
|
136
|
+
use_skill: UseSkillToolRenderers,
|
|
137
|
+
ask_user: AskUserToolRenderers,
|
|
138
|
+
// Quest tools (ARIA-specific)
|
|
139
|
+
quest_list: QuestListToolRenderers,
|
|
140
|
+
quest_update: QuestUpdateToolRenderers,
|
|
141
|
+
// Process tools
|
|
142
|
+
kill: BashToolRenderers,
|
|
143
|
+
write_stdin: BashToolRenderers,
|
|
144
|
+
list_processes: LsToolRenderers,
|
|
145
|
+
wait_process: BashToolRenderers,
|
|
146
|
+
spawn_worker: SpawnWorkerToolRenderers,
|
|
147
|
+
fork: ForkToolRenderers,
|
|
148
|
+
// Patch tools
|
|
149
|
+
apply_patch: FileEditToolRenderers,
|
|
150
|
+
// Agent/delegation tools (ARIA-specific)
|
|
151
|
+
delegate_arion: AgentToolRenderers,
|
|
152
|
+
check_delegation: CheckDelegationToolRenderers,
|
|
153
|
+
hatch_arion: HatchArionToolRenderers,
|
|
154
|
+
rest_arion: RestArionToolRenderers,
|
|
155
|
+
wake_arion: WakeArionToolRenderers,
|
|
156
|
+
retire_arion: RetireArionToolRenderers,
|
|
157
|
+
// Other
|
|
158
|
+
mcp: MCPToolRenderers,
|
|
159
|
+
think: ThinkToolRenderers,
|
|
160
|
+
agent: AgentToolRenderers,
|
|
161
|
+
notebook_read: NotebookReadToolRenderers,
|
|
162
|
+
notebook_edit: NotebookEditToolRenderers,
|
|
163
|
+
architect: ArchitectToolRenderers,
|
|
164
|
+
sticker_request: StickerRequestToolRenderers,
|
|
165
|
+
browser: BrowserToolRenderers,
|
|
166
|
+
process: ProcessToolRenderers,
|
|
167
|
+
// Diagnostic tools (ARIA-specific)
|
|
168
|
+
self_diagnose: SelfDiagnoseToolRenderers,
|
|
169
|
+
// Quip tools
|
|
170
|
+
check_quip_documents: QuipReadToolRenderers,
|
|
171
|
+
send_quip_comment: QuipCommentToolRenderers,
|
|
172
|
+
create_quip_document: CreateQuipToolRenderers,
|
|
173
|
+
// Slack tools
|
|
174
|
+
check_slack_messages: SlackReadToolRenderers,
|
|
175
|
+
send_slack_message: SlackSendToolRenderers,
|
|
176
|
+
react_slack_message: SlackReactToolRenderers,
|
|
177
|
+
// Outlook tools
|
|
178
|
+
check_outlook_messages: OutlookReadToolRenderers,
|
|
179
|
+
send_outlook_message: OutlookSendToolRenderers,
|
|
180
|
+
reply_outlook_message: OutlookReplyToolRenderers,
|
|
181
|
+
// Messaging tools
|
|
182
|
+
send_message: SendMessageToolRenderers,
|
|
183
|
+
check_messages: CheckMessagesToolRenderers,
|
|
184
|
+
search_messages: SearchMessagesToolRenderers,
|
|
185
|
+
get_thread: GetThreadToolRenderers,
|
|
186
|
+
list_clients: ListClientsToolRenderers,
|
|
187
|
+
// Delegation/network/deploy tools
|
|
188
|
+
delegate_remote: DelegateRemoteToolRenderers,
|
|
189
|
+
pause_delegation: PauseDelegationToolRenderers,
|
|
190
|
+
resume_delegation: ResumeDelegationToolRenderers,
|
|
191
|
+
quest_report: QuestReportToolRenderers,
|
|
192
|
+
manage_network: ManageNetworkToolRenderers,
|
|
193
|
+
deploy: DeployToolRenderers,
|
|
194
|
+
session_history: SessionHistoryToolRenderers,
|
|
195
|
+
restart: RestartToolRenderers,
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/ui/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;GA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AC1C,eAAe,EAAE,2BAA2B;IAC5C,UAAU,EAAE,sBAAsB;IAClC,YAAY,EAAE,wBAAwB;IACtC,kCAAkC;IAClC,eAAe,EAAE,2BAA2B;IAC5C,gBAAgB,EAAE,4BAA4B;IAC9C,iBAAiB,EAAE,6BAA6B;IAChD,YAAY,EAAE,wBAAwB;IACtC,cAAc,EAAE,0BAA0B;IAC1C,MAAM,EAAE,mBAAmB;IAC3B,eAAe,EAAE,2BAA2B;IAC5C,OAAO,EAAE,oBAAoB;CAC9B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolRenderer — the single canonical interface for tool UI rendering.
|
|
3
|
+
*
|
|
4
|
+
* Every tool gets one renderer. No adapters, no legacy shims.
|
|
5
|
+
*
|
|
6
|
+
* Generic type params enable compile-time shape checking between
|
|
7
|
+
* executor output → renderer input. When TInput/TOutput are specified,
|
|
8
|
+
* TypeScript will catch field-name drift (e.g. `filePath` vs `file`).
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=tool-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-renderer.js","sourceRoot":"","sources":["../../../src/ui/tools/tool-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Shared truncation constants for all tool renderers. */
|
|
2
|
+
export const MAX_LINE_CHARS = 80;
|
|
3
|
+
export const MAX_OUTPUT_LINES = 6;
|
|
4
|
+
export const MAX_VERBOSE_LINES = 50;
|
|
5
|
+
/** Cap a single line to MAX_LINE_CHARS, appending "…" if truncated. */
|
|
6
|
+
export function capLine(line) {
|
|
7
|
+
return line.length > MAX_LINE_CHARS ? line.slice(0, MAX_LINE_CHARS) + "…" : line;
|
|
8
|
+
}
|
|
9
|
+
/** Cap every line in a multi-line string. */
|
|
10
|
+
export function capLines(text) {
|
|
11
|
+
return text.split("\n").map(capLine).join("\n");
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Truncate multi-line output to a safe number of lines.
|
|
15
|
+
* In verbose mode, allows more lines but still caps to prevent flooding.
|
|
16
|
+
* Returns [truncatedText, wasOverLimit].
|
|
17
|
+
*/
|
|
18
|
+
export function truncateOutput(text, verbose = false) {
|
|
19
|
+
const maxLines = verbose ? MAX_VERBOSE_LINES : MAX_OUTPUT_LINES;
|
|
20
|
+
const lines = text.split("\n");
|
|
21
|
+
if (lines.length <= maxLines) {
|
|
22
|
+
return [text, false];
|
|
23
|
+
}
|
|
24
|
+
return [lines.slice(0, maxLines).join("\n") + `\n… (+${lines.length - maxLines} lines)`, true];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Truncate a raw string or JSON.stringify fallback to safe terminal limits.
|
|
28
|
+
* Used as a safety net for renderers that dump unknown output shapes.
|
|
29
|
+
*/
|
|
30
|
+
export function safeFallbackText(output, verbose = false) {
|
|
31
|
+
const str = typeof output === "string" ? output : JSON.stringify(output);
|
|
32
|
+
const [truncated] = truncateOutput(str, verbose);
|
|
33
|
+
return capLines(truncated);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=truncation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncation.js","sourceRoot":"","sources":["../../../src/ui/tools/truncation.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,uEAAuE;AACvE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;A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|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/ui/types/message.ts"],"names":[],"mappings":"AAAA,0CAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/ui/types/tool.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,mEAAmE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/ui/utils/array.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAI,EAAO,EAAE,SAA+B;IACrE,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// packages/cli/src/ui/utils/cursor.ts
|
|
2
|
+
/**
|
|
3
|
+
* Immutable cursor for text manipulation
|
|
4
|
+
* All operations return new Cursor instances
|
|
5
|
+
*/
|
|
6
|
+
export class Cursor {
|
|
7
|
+
text;
|
|
8
|
+
position;
|
|
9
|
+
constructor(text, position) {
|
|
10
|
+
this.text = text;
|
|
11
|
+
// Clamp position to valid range
|
|
12
|
+
this.position = Math.max(0, Math.min(position, text.length));
|
|
13
|
+
}
|
|
14
|
+
// ─────────────────────────────────────────────────
|
|
15
|
+
// Navigation
|
|
16
|
+
// ─────────────────────────────────────────────────
|
|
17
|
+
moveToStart() {
|
|
18
|
+
return new Cursor(this.text, 0);
|
|
19
|
+
}
|
|
20
|
+
moveToEnd() {
|
|
21
|
+
return new Cursor(this.text, this.text.length);
|
|
22
|
+
}
|
|
23
|
+
moveLeft(count = 1) {
|
|
24
|
+
return new Cursor(this.text, this.position - count);
|
|
25
|
+
}
|
|
26
|
+
moveRight(count = 1) {
|
|
27
|
+
return new Cursor(this.text, this.position + count);
|
|
28
|
+
}
|
|
29
|
+
moveToPrevWord() {
|
|
30
|
+
if (this.position === 0)
|
|
31
|
+
return this;
|
|
32
|
+
const before = this.text.slice(0, this.position);
|
|
33
|
+
// Skip trailing whitespace
|
|
34
|
+
const trimmed = before.trimEnd();
|
|
35
|
+
if (trimmed.length === 0)
|
|
36
|
+
return new Cursor(this.text, 0);
|
|
37
|
+
// Find start of previous word (search for last whitespace in trimmed text)
|
|
38
|
+
const lastWsMatch = trimmed.match(/[\s\S]*\s(\S+)$/);
|
|
39
|
+
const newPos = lastWsMatch ? trimmed.length - lastWsMatch[1].length : 0;
|
|
40
|
+
return new Cursor(this.text, newPos);
|
|
41
|
+
}
|
|
42
|
+
moveToNextWord() {
|
|
43
|
+
if (this.position >= this.text.length)
|
|
44
|
+
return this;
|
|
45
|
+
const after = this.text.slice(this.position);
|
|
46
|
+
// Skip current word
|
|
47
|
+
const match = after.match(/^\S*\s*/);
|
|
48
|
+
if (!match)
|
|
49
|
+
return new Cursor(this.text, this.text.length);
|
|
50
|
+
return new Cursor(this.text, this.position + match[0].length);
|
|
51
|
+
}
|
|
52
|
+
// ─────────────────────────────────────────────────
|
|
53
|
+
// Deletion
|
|
54
|
+
// ─────────────────────────────────────────────────
|
|
55
|
+
deleteToEnd() {
|
|
56
|
+
const newText = this.text.slice(0, this.position);
|
|
57
|
+
return new Cursor(newText, this.position);
|
|
58
|
+
}
|
|
59
|
+
deleteToStart() {
|
|
60
|
+
const newText = this.text.slice(this.position);
|
|
61
|
+
return new Cursor(newText, 0);
|
|
62
|
+
}
|
|
63
|
+
deleteLeft(count = 1) {
|
|
64
|
+
if (this.position === 0)
|
|
65
|
+
return this;
|
|
66
|
+
const deleteCount = Math.min(count, this.position);
|
|
67
|
+
const newText = this.text.slice(0, this.position - deleteCount) + this.text.slice(this.position);
|
|
68
|
+
return new Cursor(newText, this.position - deleteCount);
|
|
69
|
+
}
|
|
70
|
+
deleteRight(count = 1) {
|
|
71
|
+
if (this.position >= this.text.length)
|
|
72
|
+
return this;
|
|
73
|
+
const deleteCount = Math.min(count, this.text.length - this.position);
|
|
74
|
+
const newText = this.text.slice(0, this.position) + this.text.slice(this.position + deleteCount);
|
|
75
|
+
return new Cursor(newText, this.position);
|
|
76
|
+
}
|
|
77
|
+
deletePrevWord() {
|
|
78
|
+
if (this.position === 0)
|
|
79
|
+
return this;
|
|
80
|
+
const before = this.text.slice(0, this.position);
|
|
81
|
+
const after = this.text.slice(this.position);
|
|
82
|
+
// Find word boundary
|
|
83
|
+
const match = before.match(/\S*\s*$/);
|
|
84
|
+
if (!match)
|
|
85
|
+
return this;
|
|
86
|
+
const deleteLength = match[0].length;
|
|
87
|
+
const newText = before.slice(0, -deleteLength) + after;
|
|
88
|
+
return new Cursor(newText, this.position - deleteLength);
|
|
89
|
+
}
|
|
90
|
+
deleteNextWord() {
|
|
91
|
+
if (this.position >= this.text.length)
|
|
92
|
+
return this;
|
|
93
|
+
const before = this.text.slice(0, this.position);
|
|
94
|
+
const after = this.text.slice(this.position);
|
|
95
|
+
// Find word boundary
|
|
96
|
+
const match = after.match(/^\s*\S*/);
|
|
97
|
+
if (!match)
|
|
98
|
+
return this;
|
|
99
|
+
const newText = before + after.slice(match[0].length);
|
|
100
|
+
return new Cursor(newText, this.position);
|
|
101
|
+
}
|
|
102
|
+
// ─────────────────────────────────────────────────
|
|
103
|
+
// Insertion
|
|
104
|
+
// ─────────────────────────────────────────────────
|
|
105
|
+
insert(chars) {
|
|
106
|
+
const newText = this.text.slice(0, this.position) + chars + this.text.slice(this.position);
|
|
107
|
+
return new Cursor(newText, this.position + chars.length);
|
|
108
|
+
}
|
|
109
|
+
clear() {
|
|
110
|
+
return new Cursor("", 0);
|
|
111
|
+
}
|
|
112
|
+
// ─────────────────────────────────────────────────
|
|
113
|
+
// State
|
|
114
|
+
// ─────────────────────────────────────────────────
|
|
115
|
+
get beforeCursor() {
|
|
116
|
+
return this.text.slice(0, this.position);
|
|
117
|
+
}
|
|
118
|
+
get afterCursor() {
|
|
119
|
+
return this.text.slice(this.position);
|
|
120
|
+
}
|
|
121
|
+
get isEmpty() {
|
|
122
|
+
return this.text.length === 0;
|
|
123
|
+
}
|
|
124
|
+
get isAtStart() {
|
|
125
|
+
return this.position === 0;
|
|
126
|
+
}
|
|
127
|
+
get isAtEnd() {
|
|
128
|
+
return this.position >= this.text.length;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/ui/utils/cursor.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;GAGG;AACH,MAAM,OAAO,MAAM;IAIC;IAHF,QAAQ,CAAS;IAEjC,YACkB,IAAY,EAC5B,QAAgB;QADA,SAAI,GAAJ,IAAI,CAAQ;QAG5B,gCAAgC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,oDAAoD;IACpD,aAAa;IACb,oDAAoD;IAEpD,WAAW;QACT,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ,CAAC,KAAK,GAAG,CAAC;QAChB,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG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CAAC,QAAQ,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// packages/cli/src/ui/utils/diff.ts
|
|
2
|
+
import { structuredPatch } from "diff";
|
|
3
|
+
export function generateDiff(filePath, oldContent, newContent, contextLines = 3) {
|
|
4
|
+
const patch = structuredPatch(filePath, filePath, oldContent, newContent, "", "", {
|
|
5
|
+
context: contextLines,
|
|
6
|
+
});
|
|
7
|
+
let additions = 0;
|
|
8
|
+
let deletions = 0;
|
|
9
|
+
const hunks = patch.hunks.map((hunk) => {
|
|
10
|
+
const lines = [];
|
|
11
|
+
let oldLineNo = hunk.oldStart;
|
|
12
|
+
let newLineNo = hunk.newStart;
|
|
13
|
+
for (const line of hunk.lines) {
|
|
14
|
+
const content = line.slice(1); // Remove +/- prefix
|
|
15
|
+
if (line.startsWith("+")) {
|
|
16
|
+
lines.push({
|
|
17
|
+
type: "added",
|
|
18
|
+
content,
|
|
19
|
+
newLineNo: newLineNo++,
|
|
20
|
+
});
|
|
21
|
+
additions++;
|
|
22
|
+
}
|
|
23
|
+
else if (line.startsWith("-")) {
|
|
24
|
+
lines.push({
|
|
25
|
+
type: "removed",
|
|
26
|
+
content,
|
|
27
|
+
oldLineNo: oldLineNo++,
|
|
28
|
+
});
|
|
29
|
+
deletions++;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
lines.push({
|
|
33
|
+
type: "unchanged",
|
|
34
|
+
content,
|
|
35
|
+
oldLineNo: oldLineNo++,
|
|
36
|
+
newLineNo: newLineNo++,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
oldStart: hunk.oldStart,
|
|
42
|
+
oldLines: hunk.oldLines,
|
|
43
|
+
newStart: hunk.newStart,
|
|
44
|
+
newLines: hunk.newLines,
|
|
45
|
+
lines,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
filePath,
|
|
50
|
+
hunks,
|
|
51
|
+
additions,
|
|
52
|
+
deletions,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function splitContentLines(content) {
|
|
56
|
+
if (content === "")
|
|
57
|
+
return [];
|
|
58
|
+
const lines = content.split("\n");
|
|
59
|
+
if (lines[lines.length - 1] === "") {
|
|
60
|
+
lines.pop();
|
|
61
|
+
}
|
|
62
|
+
return lines;
|
|
63
|
+
}
|
|
64
|
+
export function generateNewFileDiff(filePath, content) {
|
|
65
|
+
const lines = splitContentLines(content);
|
|
66
|
+
return {
|
|
67
|
+
filePath,
|
|
68
|
+
hunks: [
|
|
69
|
+
{
|
|
70
|
+
oldStart: 0,
|
|
71
|
+
oldLines: 0,
|
|
72
|
+
newStart: 1,
|
|
73
|
+
newLines: lines.length,
|
|
74
|
+
lines: lines.map((line, index) => ({
|
|
75
|
+
type: "added",
|
|
76
|
+
content: line,
|
|
77
|
+
newLineNo: index + 1,
|
|
78
|
+
})),
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
additions: lines.length,
|
|
82
|
+
deletions: 0,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function generateDeletedFileDiff(filePath, content) {
|
|
86
|
+
const lines = splitContentLines(content);
|
|
87
|
+
return {
|
|
88
|
+
filePath,
|
|
89
|
+
hunks: [
|
|
90
|
+
{
|
|
91
|
+
oldStart: 1,
|
|
92
|
+
oldLines: lines.length,
|
|
93
|
+
newStart: 0,
|
|
94
|
+
newLines: 0,
|
|
95
|
+
lines: lines.map((line, index) => ({
|
|
96
|
+
type: "removed",
|
|
97
|
+
content: line,
|
|
98
|
+
oldLineNo: index + 1,
|
|
99
|
+
})),
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
additions: 0,
|
|
103
|
+
deletions: lines.length,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export function formatLineNumber(lineNo, width) {
|
|
107
|
+
if (lineNo === undefined)
|
|
108
|
+
return " ".repeat(width);
|
|
109
|
+
return String(lineNo).padStart(width, " ");
|
|
110
|
+
}
|
|
111
|
+
export function calculateLineNumberWidth(diff) {
|
|
112
|
+
let maxLine = 0;
|
|
113
|
+
for (const hunk of diff.hunks) {
|
|
114
|
+
const lastOldLine = hunk.oldStart + hunk.oldLines;
|
|
115
|
+
const lastNewLine = hunk.newStart + hunk.newLines;
|
|
116
|
+
maxLine = Math.max(maxLine, lastOldLine, lastNewLine);
|
|
117
|
+
}
|
|
118
|
+
return Math.max(3, String(maxLine).length);
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/ui/utils/diff.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAwBvC,MAAM,UAAU,YAAY,CAC1B,QAAgB,EAChB,UAAkB,EAClB,UAAkB,EAClB,YAAY,GAAG,CAAC;IAEhB,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE;QAChF,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;IAEH,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,MAAM,KAAK,GAAe,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACjD,MAAM,KAAK,GAAe,EAAE,CAAC;QAC7B,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE9B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,E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,EAAE,KAAa;IACxE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAc;IACrD,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Change: renamed .tsx to .ts (no JSX in this file)
|
|
2
|
+
export function wrapText(text, width) {
|
|
3
|
+
const lines = [];
|
|
4
|
+
let currentLine = "";
|
|
5
|
+
for (const char of text) {
|
|
6
|
+
// Important: we need the spread to properly count multi-plane UTF-8 characters (eg. \u{11696})
|
|
7
|
+
if ([...currentLine].length < width) {
|
|
8
|
+
currentLine += char;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
lines.push(currentLine);
|
|
12
|
+
currentLine = char;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (currentLine)
|
|
16
|
+
lines.push(currentLine);
|
|
17
|
+
return lines;
|
|
18
|
+
}
|
|
19
|
+
export function formatDuration(ms) {
|
|
20
|
+
if (ms < 60000) {
|
|
21
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
22
|
+
}
|
|
23
|
+
const hours = Math.floor(ms / 3600000);
|
|
24
|
+
const minutes = Math.floor((ms % 3600000) / 60000);
|
|
25
|
+
const seconds = ((ms % 60000) / 1000).toFixed(1);
|
|
26
|
+
if (hours > 0) {
|
|
27
|
+
return `${hours}h ${minutes}m ${seconds}s`;
|
|
28
|
+
}
|
|
29
|
+
if (minutes > 0) {
|
|
30
|
+
return `${minutes}m ${seconds}s`;
|
|
31
|
+
}
|
|
32
|
+
return `${seconds}s`;
|
|
33
|
+
}
|
|
34
|
+
export function formatNumber(number) {
|
|
35
|
+
return new Intl.NumberFormat("en", {
|
|
36
|
+
notation: "compact",
|
|
37
|
+
maximumFractionDigits: 1,
|
|
38
|
+
})
|
|
39
|
+
.format(number) // eg. "1321" => "1.3K"
|
|
40
|
+
.toLowerCase(); // eg. "1.3K" => "1.3k"
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/ui/utils/format.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAa;IAClD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,WAAW,GAAG,EAAE,CAAC;IAErB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,+FAA+F;QAC/F,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;YACpC,WAAW,IAAI,IAAI,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACxB,WAAW,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;IAED,IAAI,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU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