@aria-cli/cli 1.0.51 → 1.0.54
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/package.json +14 -73
- package/dist/.tsbuildinfo +0 -1
- package/dist/attached-local-control-client.js +0 -826
- package/dist/bootstrap-local-control-client.js +0 -2
- package/dist/capability-aware-method-proxy.js +0 -42
- package/dist/cli-context.js +0 -160
- package/dist/commands/arions.js +0 -174
- package/dist/commands/auth.js +0 -123
- package/dist/commands/daemon.js +0 -245
- package/dist/commands/definitions.js +0 -176
- package/dist/commands/index.js +0 -74
- package/dist/commands/login-handler.js +0 -1108
- package/dist/commands/logout-handler.js +0 -92
- package/dist/commands/memory-handlers.js +0 -89
- package/dist/commands/pairing.js +0 -60
- package/dist/commands/runtime-cutover-reset-command.js +0 -12
- package/dist/commands/runtime-cutover-reset.js +0 -265
- package/dist/commands/terminal-setup.js +0 -84
- package/dist/config/aria-config.js +0 -238
- package/dist/config/index.js +0 -3
- package/dist/config/loader.js +0 -97
- package/dist/config.js +0 -142
- package/dist/daemon-info.js +0 -10
- package/dist/ensure-daemon.js +0 -128
- package/dist/entrypoints/command-mode.js +0 -5
- package/dist/entrypoints/daemon.js +0 -50
- package/dist/entrypoints/headless-stdio.js +0 -25
- package/dist/entrypoints/interactive.js +0 -80
- package/dist/event-loop-watchdog.js +0 -73
- package/dist/headless/auth-orchestrator.js +0 -508
- package/dist/headless/auth-service.js +0 -43
- package/dist/headless/bootstrap-fast-path.js +0 -112
- package/dist/headless/call-command.js +0 -143
- package/dist/headless/daemon-service.js +0 -318
- package/dist/headless/hook-actions.js +0 -235
- package/dist/headless/hook-service.js +0 -42
- package/dist/headless/kernel-services.js +0 -216
- package/dist/headless/kernel.js +0 -785
- package/dist/headless/operations/arion.js +0 -119
- package/dist/headless/operations/auth.js +0 -45
- package/dist/headless/operations/client.js +0 -31
- package/dist/headless/operations/config.js +0 -69
- package/dist/headless/operations/daemon.js +0 -47
- package/dist/headless/operations/hook.js +0 -56
- package/dist/headless/operations/index.js +0 -11
- package/dist/headless/operations/memory.js +0 -102
- package/dist/headless/operations/message.js +0 -279
- package/dist/headless/operations/model.js +0 -100
- package/dist/headless/operations/peer.js +0 -56
- package/dist/headless/operations/run.js +0 -24
- package/dist/headless/operations/session.js +0 -90
- package/dist/headless/operations/system.js +0 -19
- package/dist/headless/operations/utils.js +0 -35
- package/dist/headless/run-orchestrator.js +0 -703
- package/dist/headless/stdio-server.js +0 -439
- package/dist/history/SessionHistory.js +0 -8
- package/dist/history/SessionHistoryClient.js +0 -186
- package/dist/history/conversation-message.js +0 -112
- package/dist/history/index.js +0 -8
- package/dist/history/jsonl-replay.js +0 -154
- package/dist/history/repair-tool-pairing.js +0 -84
- package/dist/history/stall-phase-bridge.js +0 -11
- package/dist/history/turn-accumulator.js +0 -427
- package/dist/index.js +0 -7
- package/dist/ink-repl.js +0 -4183
- package/dist/local-control-bootstrap.js +0 -26
- package/dist/local-control-client.js +0 -2
- package/dist/local-control-error-reporting.js +0 -34
- package/dist/local-control-http-client.js +0 -362
- package/dist/local-control-lazy-wrapper.js +0 -363
- package/dist/local-control-manager.js +0 -146
- package/dist/main.js +0 -38
- package/dist/network-security.js +0 -62
- package/dist/networking-server.js +0 -38
- package/dist/peer-identity.js +0 -23
- package/dist/polling-subscription.js +0 -34
- package/dist/relaunch.js +0 -588
- package/dist/release-notes.js +0 -35
- package/dist/repl-cleanup.js +0 -47
- package/dist/runtime/configure-bun-sqlite.js +0 -3
- package/dist/runtime/crash-handlers.js +0 -111
- package/dist/runtime/interactive-invocation.js +0 -39
- package/dist/runtime/internal-mode.js +0 -14
- package/dist/runtime/launch-spec.js +0 -64
- package/dist/runtime/owner-lease.js +0 -44
- package/dist/runtime/public-mode.js +0 -20
- package/dist/runtime/run-internal-mode.js +0 -18
- package/dist/runtime/runtime-kind.js +0 -32
- package/dist/runtime/spawn-aria.js +0 -38
- package/dist/selectable-client.js +0 -2
- package/dist/selectable-peer.js +0 -2
- package/dist/session.js +0 -203
- package/dist/slash-commands.js +0 -80
- package/dist/sounds.js +0 -210
- package/dist/ui/App.js +0 -526
- package/dist/ui/components/AnthropicMethodPicker.js +0 -6
- package/dist/ui/components/ArionPrompt.js +0 -15
- package/dist/ui/components/AutocompleteDropdown.js +0 -23
- package/dist/ui/components/AutonomySelector.js +0 -55
- package/dist/ui/components/Banner.js +0 -98
- package/dist/ui/components/ConversationHistory.js +0 -175
- package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
- package/dist/ui/components/CopilotSourcePicker.js +0 -50
- package/dist/ui/components/Cost.js +0 -10
- package/dist/ui/components/CustomSelect/option-map.js +0 -30
- package/dist/ui/components/CustomSelect/select-option.js +0 -13
- package/dist/ui/components/CustomSelect/select.js +0 -42
- package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
- package/dist/ui/components/CustomSelect/use-select.js +0 -15
- package/dist/ui/components/ErrorDisplay.js +0 -35
- package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
- package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
- package/dist/ui/components/HandoffMarker.js +0 -18
- package/dist/ui/components/HighlightedCode.js +0 -21
- package/dist/ui/components/InputArea.js +0 -187
- package/dist/ui/components/Message.js +0 -25
- package/dist/ui/components/OAuthLoginFlow.js +0 -113
- package/dist/ui/components/OutputTruncation.js +0 -35
- package/dist/ui/components/PermissionPrompt.js +0 -79
- package/dist/ui/components/PipelineTimingPanel.js +0 -15
- package/dist/ui/components/ProviderMethodPicker.js +0 -61
- package/dist/ui/components/ProviderPicker.js +0 -63
- package/dist/ui/components/RenderItemView.js +0 -71
- package/dist/ui/components/Spinner.js +0 -46
- package/dist/ui/components/StatusBar.js +0 -95
- package/dist/ui/components/StreamingIndicator.js +0 -55
- package/dist/ui/components/StructuredDiff.js +0 -168
- package/dist/ui/components/TextInputOverlay.js +0 -43
- package/dist/ui/components/ThinkingBlock.js +0 -82
- package/dist/ui/components/ToolCost.js +0 -17
- package/dist/ui/components/ToolExecution.js +0 -61
- package/dist/ui/components/ToolHeader.js +0 -51
- package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
- package/dist/ui/components/ToolResultWrapper.js +0 -6
- package/dist/ui/components/ToolUseLoader.js +0 -35
- package/dist/ui/components/TraceWaterfall.js +0 -91
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
- package/dist/ui/components/messages/UserImageMessage.js +0 -12
- package/dist/ui/components/messages/UserTextMessage.js +0 -12
- package/dist/ui/components/overlays/ArionSelector.js +0 -68
- package/dist/ui/components/overlays/ClientSelector.js +0 -62
- package/dist/ui/components/overlays/CommandPalette.js +0 -67
- package/dist/ui/components/overlays/DaemonControl.js +0 -87
- package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
- package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
- package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
- package/dist/ui/components/overlays/MessageSelector.js +0 -123
- package/dist/ui/components/overlays/ModelSelector.js +0 -211
- package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
- package/dist/ui/components/overlays/PeerSelector.js +0 -84
- package/dist/ui/components/overlays/SessionSelector.js +0 -102
- package/dist/ui/components/overlays/SoundSelector.js +0 -86
- package/dist/ui/components/overlays/ThemeSelector.js +0 -139
- package/dist/ui/components/overlays/index.js +0 -15
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
- package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
- package/dist/ui/components/permissions/PermissionRequest.js +0 -70
- package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
- package/dist/ui/components/permissions/hooks.js +0 -10
- package/dist/ui/components/permissions/toolUseOptions.js +0 -68
- package/dist/ui/components/permissions/utils.js +0 -10
- package/dist/ui/components/text-input/Cursor.js +0 -326
- package/dist/ui/components/text-input/TextInput.js +0 -231
- package/dist/ui/components/text-input/imagePaste.js +0 -28
- package/dist/ui/components/text-input/index.js +0 -6
- package/dist/ui/components/text-input/useDoublePress.js +0 -30
- package/dist/ui/components/text-input/useTextInput.js +0 -245
- package/dist/ui/components/tool-types.js +0 -9
- package/dist/ui/constants/figures.js +0 -4
- package/dist/ui/constants/index.js +0 -3
- package/dist/ui/display-mode.js +0 -93
- package/dist/ui/display-policy.js +0 -19
- package/dist/ui/hooks/index.js +0 -6
- package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
- package/dist/ui/hooks/useDoublePress.js +0 -37
- package/dist/ui/hooks/useIndicatorState.js +0 -55
- package/dist/ui/hooks/useInterval.js +0 -23
- package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
- package/dist/ui/hooks/useTerminalSize.js +0 -55
- package/dist/ui/hooks/useUnifiedMessages.js +0 -117
- package/dist/ui/indicator-state.js +0 -44
- package/dist/ui/markdown/highlight.js +0 -44
- package/dist/ui/markdown/index.js +0 -1460
- package/dist/ui/markdown/tokenizer.js +0 -24
- package/dist/ui/render-item.js +0 -5
- package/dist/ui/screens/REPL.js +0 -119
- package/dist/ui/screens/approval-lifecycle.js +0 -38
- package/dist/ui/status-line.js +0 -72
- package/dist/ui/theme/index.js +0 -51
- package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-dark.js +0 -50
- package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-light.js +0 -50
- package/dist/ui/theme/themes/dark-accessible.js +0 -18
- package/dist/ui/theme/themes/dark.js +0 -49
- package/dist/ui/theme/themes/light-accessible.js +0 -18
- package/dist/ui/theme/themes/light.js +0 -49
- package/dist/ui/theme/types.js +0 -3
- package/dist/ui/theme.js +0 -142
- package/dist/ui/to-render-items.js +0 -145
- package/dist/ui/tools/AgentTool/index.js +0 -30
- package/dist/ui/tools/ArchitectTool/index.js +0 -31
- package/dist/ui/tools/AskUserTool/index.js +0 -46
- package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
- package/dist/ui/tools/BashTool/OutputLine.js +0 -21
- package/dist/ui/tools/BashTool/index.js +0 -91
- package/dist/ui/tools/BrowseTool/index.js +0 -43
- package/dist/ui/tools/BrowserTool/index.js +0 -47
- package/dist/ui/tools/CbmTool/index.js +0 -188
- package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
- package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
- package/dist/ui/tools/CreateQuipTool/index.js +0 -30
- package/dist/ui/tools/CreateSkillTool/index.js +0 -22
- package/dist/ui/tools/CreateToolTool/index.js +0 -31
- package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
- package/dist/ui/tools/DeployTool/index.js +0 -47
- package/dist/ui/tools/FffTool/index.js +0 -103
- package/dist/ui/tools/FileEditTool/index.js +0 -67
- package/dist/ui/tools/FileReadTool/index.js +0 -68
- package/dist/ui/tools/FileWriteTool/index.js +0 -61
- package/dist/ui/tools/ForkTool/index.js +0 -47
- package/dist/ui/tools/FrgTool/index.js +0 -96
- package/dist/ui/tools/GetThreadTool/index.js +0 -39
- package/dist/ui/tools/GlobTool/index.js +0 -50
- package/dist/ui/tools/GrepTool/index.js +0 -84
- package/dist/ui/tools/HatchArionTool/index.js +0 -36
- package/dist/ui/tools/LearnSkillTool/index.js +0 -22
- package/dist/ui/tools/LearnTool/index.js +0 -43
- package/dist/ui/tools/LearnToolTool/index.js +0 -22
- package/dist/ui/tools/ListClientsTool/index.js +0 -39
- package/dist/ui/tools/LspTool/index.js +0 -261
- package/dist/ui/tools/MCPTool/index.js +0 -33
- package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
- package/dist/ui/tools/MemoryReadTool/index.js +0 -64
- package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
- package/dist/ui/tools/NotebookEditTool/index.js +0 -33
- package/dist/ui/tools/NotebookReadTool/index.js +0 -25
- package/dist/ui/tools/OutlookReadTool/index.js +0 -66
- package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
- package/dist/ui/tools/OutlookSendTool/index.js +0 -49
- package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
- package/dist/ui/tools/ProbeTool/index.js +0 -121
- package/dist/ui/tools/ProcessTool/index.js +0 -66
- package/dist/ui/tools/QuestListTool/index.js +0 -46
- package/dist/ui/tools/QuestReportTool/index.js +0 -49
- package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
- package/dist/ui/tools/QuipCommentTool/index.js +0 -69
- package/dist/ui/tools/QuipReadTool/index.js +0 -71
- package/dist/ui/tools/RestArionTool/index.js +0 -32
- package/dist/ui/tools/RestartTool/index.js +0 -35
- package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
- package/dist/ui/tools/RetireArionTool/index.js +0 -32
- package/dist/ui/tools/RgTool/index.js +0 -73
- package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
- package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
- package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
- package/dist/ui/tools/SendMessageTool/index.js +0 -45
- package/dist/ui/tools/SerenaTool/index.js +0 -124
- package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
- package/dist/ui/tools/SgTool/index.js +0 -80
- package/dist/ui/tools/SlackReactTool/index.js +0 -41
- package/dist/ui/tools/SlackReadTool/index.js +0 -48
- package/dist/ui/tools/SlackSendTool/index.js +0 -45
- package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
- package/dist/ui/tools/StickerRequestTool/index.js +0 -19
- package/dist/ui/tools/ThinkTool/index.js +0 -17
- package/dist/ui/tools/UgTool/index.js +0 -108
- package/dist/ui/tools/UseSkillTool/index.js +0 -22
- package/dist/ui/tools/WakeArionTool/index.js +0 -32
- package/dist/ui/tools/WebFetchTool/index.js +0 -56
- package/dist/ui/tools/WebSearchTool/index.js +0 -44
- package/dist/ui/tools/lsTool/index.js +0 -58
- package/dist/ui/tools/registry.js +0 -197
- package/dist/ui/tools/tool-renderer.js +0 -11
- package/dist/ui/tools/truncation.js +0 -35
- package/dist/ui/types/anthropic.js +0 -4
- package/dist/ui/types/index.js +0 -2
- package/dist/ui/types/message.js +0 -3
- package/dist/ui/types/tool.js +0 -4
- package/dist/ui/utils/array.js +0 -4
- package/dist/ui/utils/cursor.js +0 -131
- package/dist/ui/utils/diff.js +0 -120
- package/dist/ui/utils/format.js +0 -42
- package/dist/ui/utils/fuzzy.js +0 -59
- package/dist/ui/utils/index.js +0 -11
- package/dist/ui/utils/keys.js +0 -8
- package/dist/ui/utils/patch.js +0 -17
- package/dist/ui/utils/risk.js +0 -114
- package/dist/ui/utils/terminal-image.js +0 -70
- package/dist/ui/utils/validation.js +0 -48
- package/dist/ui/verb-pairs.js +0 -248
- package/dist/ui.js +0 -131
- package/src/entrypoints/command-mode.ts +0 -5
- package/src/entrypoints/daemon.ts +0 -54
- package/src/entrypoints/headless-stdio.ts +0 -27
- package/src/entrypoints/interactive.ts +0 -112
- package/src/main.ts +0 -44
- package/src/runtime/configure-bun-sqlite.ts +0 -3
- package/src/runtime/crash-handlers.ts +0 -128
- package/src/runtime/interactive-invocation.test.ts +0 -42
- package/src/runtime/interactive-invocation.ts +0 -51
- package/src/runtime/internal-mode.test.ts +0 -19
- package/src/runtime/internal-mode.ts +0 -24
- package/src/runtime/launch-spec.test.ts +0 -26
- package/src/runtime/launch-spec.ts +0 -84
- package/src/runtime/owner-lease.ts +0 -52
- package/src/runtime/public-mode.test.ts +0 -18
- package/src/runtime/public-mode.ts +0 -19
- package/src/runtime/run-internal-mode.ts +0 -19
- package/src/runtime/runtime-kind.test.ts +0 -23
- package/src/runtime/runtime-kind.ts +0 -41
- package/src/runtime/spawn-aria.ts +0 -62
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
import { getTheme } from "../../theme/index.js";
|
|
5
|
-
export const ListClientsToolRenderers = {
|
|
6
|
-
displayName() {
|
|
7
|
-
return "Clients";
|
|
8
|
-
},
|
|
9
|
-
renderInput(input, { verbose } = {}) {
|
|
10
|
-
// No input parameters for this tool
|
|
11
|
-
return "List clients";
|
|
12
|
-
},
|
|
13
|
-
renderRejection() {
|
|
14
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
15
|
-
},
|
|
16
|
-
renderOutput(output, { verbose } = {}) {
|
|
17
|
-
const theme = getTheme();
|
|
18
|
-
if (output == null) {
|
|
19
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: "No clients connected" }) }));
|
|
20
|
-
}
|
|
21
|
-
const obj = (output ?? {});
|
|
22
|
-
// Extract clients from output.data
|
|
23
|
-
const data = (obj.data ?? obj);
|
|
24
|
-
const clients = (Array.isArray(data.clients) ? data.clients : []);
|
|
25
|
-
if (!clients || clients.length === 0) {
|
|
26
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: "No clients connected" }) }));
|
|
27
|
-
}
|
|
28
|
-
const count = clients.length;
|
|
29
|
-
// Match /clients overlay: show displayLabel + clientId + self indicator
|
|
30
|
-
const visible = clients.slice(0, 10);
|
|
31
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [count, " client", count !== 1 ? "s" : "", " connected"] }), _jsx(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, children: visible.map((client, idx) => {
|
|
32
|
-
const label = String(client.displayLabel ?? client.name ?? client.displayName ?? "Unknown");
|
|
33
|
-
const id = client.clientId ?? client.id;
|
|
34
|
-
const isSelf = client.self === true;
|
|
35
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: isSelf ? theme.colors.textMuted : undefined, children: ["\u2022 ", label, isSelf ? _jsx(Text, { dimColor: true, children: " (self)" }) : null] }), id && (_jsxs(Text, { dimColor: true, children: [" ", id] }))] }, idx));
|
|
36
|
-
}) }), clients.length > 10 && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsxs(Text, { color: theme.colors.textMuted, children: ["... and ", clients.length - 10, " more"] }) }))] }));
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { relative } from "path";
|
|
4
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
5
|
-
import { getTheme } from "../../theme/index.js";
|
|
6
|
-
import { safeFallbackText } from "../truncation.js";
|
|
7
|
-
/**
|
|
8
|
-
* Symbol kind icons for LSP results
|
|
9
|
-
*/
|
|
10
|
-
const SYMBOL_ICONS = {
|
|
11
|
-
File: "📄",
|
|
12
|
-
Module: "📦",
|
|
13
|
-
Namespace: "📦",
|
|
14
|
-
Package: "📦",
|
|
15
|
-
Class: "𝐶",
|
|
16
|
-
Method: "𝑚",
|
|
17
|
-
Property: "🔹",
|
|
18
|
-
Field: "🔹",
|
|
19
|
-
Constructor: "⚙",
|
|
20
|
-
Enum: "📋",
|
|
21
|
-
Interface: "𝐼",
|
|
22
|
-
Function: "𝑓",
|
|
23
|
-
Variable: "𝑣",
|
|
24
|
-
Constant: "🔒",
|
|
25
|
-
String: '"',
|
|
26
|
-
Number: "#",
|
|
27
|
-
Boolean: "✓",
|
|
28
|
-
Array: "[]",
|
|
29
|
-
Object: "{}",
|
|
30
|
-
Key: "🔑",
|
|
31
|
-
Null: "∅",
|
|
32
|
-
EnumMember: "📋",
|
|
33
|
-
Struct: "📦",
|
|
34
|
-
Event: "⚡",
|
|
35
|
-
Operator: "⊕",
|
|
36
|
-
TypeParameter: "T",
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Extracts and normalizes URI to relative path
|
|
40
|
-
*/
|
|
41
|
-
function normalizeUri(uri) {
|
|
42
|
-
if (uri.startsWith("file://")) {
|
|
43
|
-
return uri.slice(7);
|
|
44
|
-
}
|
|
45
|
-
return uri;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Formats a location as file:line:character
|
|
49
|
-
*/
|
|
50
|
-
function formatLocation(uri, line, character) {
|
|
51
|
-
const file = relative(process.cwd(), normalizeUri(uri));
|
|
52
|
-
if (line !== undefined && character !== undefined) {
|
|
53
|
-
return `${file}:${line + 1}:${character + 1}`;
|
|
54
|
-
}
|
|
55
|
-
else if (line !== undefined) {
|
|
56
|
-
return `${file}:${line + 1}`;
|
|
57
|
-
}
|
|
58
|
-
return file;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Extracts first line from markdown/plaintext content
|
|
62
|
-
*/
|
|
63
|
-
function extractFirstLine(content) {
|
|
64
|
-
let text = "";
|
|
65
|
-
if (typeof content === "string") {
|
|
66
|
-
text = content;
|
|
67
|
-
}
|
|
68
|
-
else if (content && typeof content === "object") {
|
|
69
|
-
const obj = content;
|
|
70
|
-
if (typeof obj.value === "string") {
|
|
71
|
-
text = obj.value;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const lines = text.split("\n");
|
|
75
|
-
return lines.length > 0 ? lines[0].trim() : "";
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Truncates text to max length, adding ellipsis if needed
|
|
79
|
-
*/
|
|
80
|
-
function truncate(text, maxLen = 80) {
|
|
81
|
-
return text.length > maxLen ? text.slice(0, maxLen - 1) + "…" : text;
|
|
82
|
-
}
|
|
83
|
-
export const LspToolRenderers = {
|
|
84
|
-
displayName() {
|
|
85
|
-
return "LSP";
|
|
86
|
-
},
|
|
87
|
-
renderInput(input, { verbose }) {
|
|
88
|
-
const action = String(input?.action ?? "");
|
|
89
|
-
const file = String(input?.file ?? "");
|
|
90
|
-
const line = typeof input?.line === "number" ? input.line : undefined;
|
|
91
|
-
const character = typeof input?.character === "number" ? input.character : undefined;
|
|
92
|
-
const newName = input?.new_name ? String(input.new_name) : "";
|
|
93
|
-
const fileDisplay = file ? (verbose ? file : relative(process.cwd(), file)) : "";
|
|
94
|
-
if (action === "rename" && line !== undefined && character !== undefined && newName) {
|
|
95
|
-
return `${action} ${fileDisplay}:${line + 1}:${character + 1} → ${newName}`;
|
|
96
|
-
}
|
|
97
|
-
else if (line !== undefined && character !== undefined && fileDisplay) {
|
|
98
|
-
return `${action} ${fileDisplay}:${line + 1}:${character + 1}`;
|
|
99
|
-
}
|
|
100
|
-
else if (fileDisplay) {
|
|
101
|
-
return `${action} ${fileDisplay}`;
|
|
102
|
-
}
|
|
103
|
-
return action;
|
|
104
|
-
},
|
|
105
|
-
renderOutput(output, { verbose } = {}, input) {
|
|
106
|
-
const inputObj = (input ?? {});
|
|
107
|
-
const action = String(inputObj?.action ?? "");
|
|
108
|
-
// Handle null/undefined
|
|
109
|
-
if (output == null) {
|
|
110
|
-
return (_jsx(Box, { children: _jsx(Text, { color: getTheme().colors.textMuted, children: "(No result)" }) }));
|
|
111
|
-
}
|
|
112
|
-
// ============================================
|
|
113
|
-
// definition: { uri, range: { start, end } } or array of locations
|
|
114
|
-
// ============================================
|
|
115
|
-
if (action === "definition" || action === "references") {
|
|
116
|
-
let locations = [];
|
|
117
|
-
// Single location object
|
|
118
|
-
if (output != null && typeof output === "object" && !Array.isArray(output)) {
|
|
119
|
-
const obj = output;
|
|
120
|
-
if (typeof obj.uri === "string") {
|
|
121
|
-
locations = [obj];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
// Array of locations
|
|
125
|
-
else if (Array.isArray(output)) {
|
|
126
|
-
locations = output.map((loc) => loc != null && typeof loc === "object" ? loc : {});
|
|
127
|
-
}
|
|
128
|
-
if (locations.length === 0) {
|
|
129
|
-
return (_jsx(Box, { children: _jsx(Text, { color: getTheme().colors.textMuted, children: "(No result)" }) }));
|
|
130
|
-
}
|
|
131
|
-
// For definition, show first result
|
|
132
|
-
if (action === "definition") {
|
|
133
|
-
const loc = locations[0];
|
|
134
|
-
if (!loc) {
|
|
135
|
-
return (_jsx(Box, { children: _jsx(Text, { color: getTheme().colors.textMuted, children: "(No result)" }) }));
|
|
136
|
-
}
|
|
137
|
-
const uri = typeof loc.uri === "string" ? loc.uri : "";
|
|
138
|
-
const line = typeof loc.range?.start?.line === "number" ? loc.range.start.line : undefined;
|
|
139
|
-
const char = typeof loc.range?.start?.character === "number" ? loc.range.start.character : undefined;
|
|
140
|
-
return (_jsx(Box, { children: _jsxs(Text, { children: ["\u2192 ", _jsx(Text, { bold: true, children: formatLocation(uri, line, char) })] }) }));
|
|
141
|
-
}
|
|
142
|
-
// For references, show count + list
|
|
143
|
-
const numRefs = locations.length;
|
|
144
|
-
const displayLimit = verbose ? locations.length : Math.min(5, locations.length);
|
|
145
|
-
const displayedLocs = locations.slice(0, displayLimit);
|
|
146
|
-
const hasMore = numRefs > displayLimit;
|
|
147
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { bold: true, children: numRefs }), " reference", numRefs !== 1 ? "s" : ""] }) }), displayedLocs.length > 0 && (_jsx(Box, { flexDirection: "column", marginLeft: 2, children: displayedLocs.map((loc, i) => {
|
|
148
|
-
if (!loc)
|
|
149
|
-
return null;
|
|
150
|
-
const uri = typeof loc.uri === "string" ? loc.uri : "";
|
|
151
|
-
const line = typeof loc.range?.start?.line === "number" ? loc.range.start.line : undefined;
|
|
152
|
-
const char = typeof loc.range?.start?.character === "number"
|
|
153
|
-
? loc.range.start.character
|
|
154
|
-
: undefined;
|
|
155
|
-
return (_jsx(Text, { color: getTheme().colors.textMuted, children: formatLocation(uri, line, char) }, i));
|
|
156
|
-
}) })), hasMore && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: getTheme().colors.textMuted, children: ["+", numRefs - displayLimit, " more"] }) }))] }));
|
|
157
|
-
}
|
|
158
|
-
// ============================================
|
|
159
|
-
// hover: { contents: string } or { contents: { kind, value } }
|
|
160
|
-
// ============================================
|
|
161
|
-
if (action === "hover") {
|
|
162
|
-
if (output != null && typeof output === "object") {
|
|
163
|
-
const obj = output;
|
|
164
|
-
const contents = obj.contents;
|
|
165
|
-
if (contents) {
|
|
166
|
-
const firstLine = extractFirstLine(contents);
|
|
167
|
-
const truncated = truncate(firstLine);
|
|
168
|
-
return (_jsx(Box, { children: _jsx(Text, { children: _jsx(Text, { bold: true, children: truncated }) }) }));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return (_jsx(Box, { children: _jsx(Text, { color: getTheme().colors.textMuted, children: "(No hover info)" }) }));
|
|
172
|
-
}
|
|
173
|
-
// ============================================
|
|
174
|
-
// symbols: array of { name, kind, range, children? }
|
|
175
|
-
// ============================================
|
|
176
|
-
if (action === "symbols") {
|
|
177
|
-
let symbols = [];
|
|
178
|
-
if (Array.isArray(output)) {
|
|
179
|
-
symbols = output.map((sym) => sym != null && typeof sym === "object" ? sym : {});
|
|
180
|
-
}
|
|
181
|
-
if (symbols.length === 0) {
|
|
182
|
-
return (_jsx(Box, { children: _jsx(Text, { color: getTheme().colors.textMuted, children: "(No symbols)" }) }));
|
|
183
|
-
}
|
|
184
|
-
const numSymbols = symbols.length;
|
|
185
|
-
const displayLimit = verbose ? symbols.length : Math.min(5, symbols.length);
|
|
186
|
-
const displayedSyms = symbols.slice(0, displayLimit);
|
|
187
|
-
const hasMore = numSymbols > displayLimit;
|
|
188
|
-
// Helper to get kind label
|
|
189
|
-
const getKindLabel = (kind) => {
|
|
190
|
-
if (typeof kind === "string") {
|
|
191
|
-
const iconStr = SYMBOL_ICONS[kind];
|
|
192
|
-
return iconStr || "•";
|
|
193
|
-
}
|
|
194
|
-
else if (typeof kind === "number") {
|
|
195
|
-
// LSP SymbolKind enum: 1=File, 2=Module, 3=Namespace, 4=Package, 5=Class, etc.
|
|
196
|
-
const kindMap = {
|
|
197
|
-
"1": SYMBOL_ICONS.File || "•",
|
|
198
|
-
"2": SYMBOL_ICONS.Module || "•",
|
|
199
|
-
"3": SYMBOL_ICONS.Namespace || "•",
|
|
200
|
-
"4": SYMBOL_ICONS.Package || "•",
|
|
201
|
-
"5": SYMBOL_ICONS.Class || "•",
|
|
202
|
-
"6": SYMBOL_ICONS.Method || "•",
|
|
203
|
-
"7": SYMBOL_ICONS.Property || "•",
|
|
204
|
-
"8": SYMBOL_ICONS.Field || "•",
|
|
205
|
-
"9": SYMBOL_ICONS.Constructor || "•",
|
|
206
|
-
"10": SYMBOL_ICONS.Enum || "•",
|
|
207
|
-
"11": SYMBOL_ICONS.Interface || "•",
|
|
208
|
-
"12": SYMBOL_ICONS.Function || "•",
|
|
209
|
-
"13": SYMBOL_ICONS.Variable || "•",
|
|
210
|
-
"14": SYMBOL_ICONS.Constant || "•",
|
|
211
|
-
"15": SYMBOL_ICONS.String || "•",
|
|
212
|
-
"16": SYMBOL_ICONS.Number || "•",
|
|
213
|
-
"17": SYMBOL_ICONS.Boolean || "•",
|
|
214
|
-
"18": SYMBOL_ICONS.Array || "•",
|
|
215
|
-
"19": SYMBOL_ICONS.Object || "•",
|
|
216
|
-
"20": SYMBOL_ICONS.Key || "•",
|
|
217
|
-
"21": SYMBOL_ICONS.Null || "•",
|
|
218
|
-
"22": SYMBOL_ICONS.EnumMember || "•",
|
|
219
|
-
"23": SYMBOL_ICONS.Struct || "•",
|
|
220
|
-
"24": SYMBOL_ICONS.Event || "•",
|
|
221
|
-
"25": SYMBOL_ICONS.Operator || "•",
|
|
222
|
-
"26": SYMBOL_ICONS.TypeParameter || "•",
|
|
223
|
-
};
|
|
224
|
-
return kindMap[String(kind)] || "•";
|
|
225
|
-
}
|
|
226
|
-
return "•";
|
|
227
|
-
};
|
|
228
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { bold: true, children: numSymbols }), " symbol", numSymbols !== 1 ? "s" : ""] }) }), displayedSyms.length > 0 && (_jsx(Box, { flexDirection: "column", marginLeft: 2, children: displayedSyms.map((sym, i) => {
|
|
229
|
-
const icon = getKindLabel(sym.kind);
|
|
230
|
-
const name = String(sym.name ?? "");
|
|
231
|
-
return (_jsxs(Text, { children: [icon, " ", name] }, i));
|
|
232
|
-
}) })), hasMore && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: getTheme().colors.textMuted, children: ["+", numSymbols - displayLimit, " more"] }) }))] }));
|
|
233
|
-
}
|
|
234
|
-
// ============================================
|
|
235
|
-
// rename: { changes: { [uri]: [{ range, newText }] } }
|
|
236
|
-
// ============================================
|
|
237
|
-
if (action === "rename") {
|
|
238
|
-
if (output != null && typeof output === "object") {
|
|
239
|
-
const obj = output;
|
|
240
|
-
const changes = obj.changes;
|
|
241
|
-
if (changes != null && typeof changes === "object") {
|
|
242
|
-
const fileCount = Object.keys(changes).length;
|
|
243
|
-
let editCount = 0;
|
|
244
|
-
for (const edits of Object.values(changes)) {
|
|
245
|
-
if (Array.isArray(edits)) {
|
|
246
|
-
editCount += edits.length;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return (_jsx(Box, { children: _jsxs(Text, { children: ["Renamed in ", _jsx(Text, { bold: true, children: fileCount }), " file", fileCount !== 1 ? "s" : "", " (", _jsx(Text, { bold: true, children: editCount }), " edit", editCount !== 1 ? "s" : "", ")"] }) }));
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return (_jsx(Box, { children: _jsx(Text, { color: getTheme().colors.textMuted, children: "(Rename failed)" }) }));
|
|
253
|
-
}
|
|
254
|
-
// Default fallback
|
|
255
|
-
return (_jsx(Box, { children: _jsx(Text, { children: safeFallbackText(output) }) }));
|
|
256
|
-
},
|
|
257
|
-
renderRejection() {
|
|
258
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
import { getTheme } from "../../theme/index.js";
|
|
5
|
-
import { OutputLine } from "../BashTool/OutputLine.js";
|
|
6
|
-
export const MCPToolRenderers = {
|
|
7
|
-
displayName: () => "mcp",
|
|
8
|
-
renderInput(input) {
|
|
9
|
-
return Object.entries(input)
|
|
10
|
-
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
11
|
-
.join(", ");
|
|
12
|
-
},
|
|
13
|
-
renderRejection() {
|
|
14
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
15
|
-
},
|
|
16
|
-
renderOutput(output, { verbose }) {
|
|
17
|
-
if (Array.isArray(output)) {
|
|
18
|
-
return (_jsx(Box, { flexDirection: "column", children: output.map((item, i) => {
|
|
19
|
-
if (item.type === "image") {
|
|
20
|
-
return _jsx(Text, { children: "[Image]" }, i);
|
|
21
|
-
}
|
|
22
|
-
const lines = (item.text || "").split("\n").length;
|
|
23
|
-
return _jsx(OutputLine, { content: item.text || "", lines: lines, verbose: verbose }, i);
|
|
24
|
-
}) }));
|
|
25
|
-
}
|
|
26
|
-
if (!output) {
|
|
27
|
-
return _jsx(Text, { color: getTheme().colors.textMuted, children: "(No content)" });
|
|
28
|
-
}
|
|
29
|
-
const lines = output.split("\n").length;
|
|
30
|
-
return _jsx(OutputLine, { content: output, lines: lines, verbose: verbose });
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
import { getTheme } from "../../theme/index.js";
|
|
5
|
-
import { safeFallbackText } from "../truncation.js";
|
|
6
|
-
export const ManageNetworkToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Network";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, _opts = {}) {
|
|
11
|
-
if (input.action) {
|
|
12
|
-
return input.action;
|
|
13
|
-
}
|
|
14
|
-
return Object.entries(input)
|
|
15
|
-
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
16
|
-
.join(", ");
|
|
17
|
-
},
|
|
18
|
-
renderRejection() {
|
|
19
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
20
|
-
},
|
|
21
|
-
renderOutput(output, _opts = {}) {
|
|
22
|
-
const theme = getTheme();
|
|
23
|
-
if (!output) {
|
|
24
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.textMuted, children: "(No content)" }) }) }));
|
|
25
|
-
}
|
|
26
|
-
if (typeof output === "string") {
|
|
27
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output) }) }) }));
|
|
28
|
-
}
|
|
29
|
-
if (output.error) {
|
|
30
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.error, children: output.error }) }) }));
|
|
31
|
-
}
|
|
32
|
-
// Handle invite action
|
|
33
|
-
if (output.inviteToken) {
|
|
34
|
-
const tokenPreview = output.inviteToken.length > 20
|
|
35
|
-
? `${output.inviteToken.slice(0, 20)}...`
|
|
36
|
-
: output.inviteToken;
|
|
37
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.success, children: tokenPreview }) }) }));
|
|
38
|
-
}
|
|
39
|
-
// Handle list_peers action
|
|
40
|
-
if (output.peers && Array.isArray(output.peers)) {
|
|
41
|
-
const peerNames = output.peers
|
|
42
|
-
.map((peer) => peer.displayName || peer.nodeId || "unknown")
|
|
43
|
-
.slice(0, 3);
|
|
44
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: [output.peers.length, " peer", output.peers.length !== 1 ? "s" : ""] }) }), peerNames.length > 0 && (_jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.textMuted, children: peerNames.join(", ") }) }))] }));
|
|
45
|
-
}
|
|
46
|
-
// Handle status or default message
|
|
47
|
-
if (output.message) {
|
|
48
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: output.message }) }) }));
|
|
49
|
-
}
|
|
50
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.success, children: "Success" }) }) }));
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
import { useToolRenderLayout } from "../../components/ToolRenderLayoutContext.js";
|
|
5
|
-
import { getTheme } from "../../theme/index.js";
|
|
6
|
-
import { applyMarkdown } from "../../markdown/index.js";
|
|
7
|
-
import { capLines } from "../truncation.js";
|
|
8
|
-
function extractContent(output) {
|
|
9
|
-
if (output == null)
|
|
10
|
-
return "(No content)";
|
|
11
|
-
if (typeof output === "string")
|
|
12
|
-
return output || "(No content)";
|
|
13
|
-
if (typeof output === "object") {
|
|
14
|
-
const obj = output;
|
|
15
|
-
if (typeof obj.formattedContext === "string" && obj.formattedContext) {
|
|
16
|
-
return obj.formattedContext;
|
|
17
|
-
}
|
|
18
|
-
if (typeof obj.content === "string")
|
|
19
|
-
return obj.content || "(No content)";
|
|
20
|
-
if (Array.isArray(obj.memories)) {
|
|
21
|
-
const memories = obj.memories;
|
|
22
|
-
if (memories.length === 0)
|
|
23
|
-
return "(No memories found)";
|
|
24
|
-
const count = typeof obj.count === "number" ? obj.count : memories.length;
|
|
25
|
-
const lines = memories.map((m) => {
|
|
26
|
-
const content = typeof m.content === "string" ? m.content : JSON.stringify(m.content);
|
|
27
|
-
const network = typeof m.network === "string" ? ` [${m.network}]` : "";
|
|
28
|
-
return `• ${content}${network}`;
|
|
29
|
-
});
|
|
30
|
-
return `${count} memories:\n${lines.join("\n")}`;
|
|
31
|
-
}
|
|
32
|
-
return JSON.stringify(output);
|
|
33
|
-
}
|
|
34
|
-
return String(output);
|
|
35
|
-
}
|
|
36
|
-
function MemoryReadOutput({ content, isEmpty, }) {
|
|
37
|
-
const { contentWidth } = useToolRenderLayout();
|
|
38
|
-
return (_jsx(Box, { flexDirection: "column", width: "100%", children: _jsx(Text, { color: isEmpty ? getTheme().colors.textMuted : undefined, children: isEmpty ? content : applyMarkdown(content, { width: contentWidth }) }) }));
|
|
39
|
-
}
|
|
40
|
-
export const MemoryReadToolRenderers = {
|
|
41
|
-
displayName() {
|
|
42
|
-
return "Read Memory";
|
|
43
|
-
},
|
|
44
|
-
renderInput(input) {
|
|
45
|
-
return Object.entries(input)
|
|
46
|
-
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
47
|
-
.join(", ");
|
|
48
|
-
},
|
|
49
|
-
renderRejection() {
|
|
50
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
51
|
-
},
|
|
52
|
-
renderOutput(output, { verbose } = { verbose: false }) {
|
|
53
|
-
const content = extractContent(output);
|
|
54
|
-
const MAX_LINES = 3;
|
|
55
|
-
const lines = content.split("\n");
|
|
56
|
-
const truncated = !verbose && lines.length > MAX_LINES;
|
|
57
|
-
const visible = capLines(truncated
|
|
58
|
-
? [...lines.slice(0, MAX_LINES), `… +${lines.length - MAX_LINES} lines`].join("\n")
|
|
59
|
-
: content);
|
|
60
|
-
const isEmpty = content === "(No content)";
|
|
61
|
-
return _jsx(MemoryReadOutput, { content: visible, isEmpty: isEmpty });
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
export const MemoryWriteToolRenderers = {
|
|
5
|
-
displayName() {
|
|
6
|
-
return "Write Memory";
|
|
7
|
-
},
|
|
8
|
-
renderInput(input) {
|
|
9
|
-
return Object.entries(input)
|
|
10
|
-
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
11
|
-
.join(", ");
|
|
12
|
-
},
|
|
13
|
-
renderRejection() {
|
|
14
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
15
|
-
},
|
|
16
|
-
renderOutput() {
|
|
17
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "Updated memory" }) }) }));
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { relative } from "path";
|
|
4
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
5
|
-
import { HighlightedCode } from "../../components/HighlightedCode.js";
|
|
6
|
-
export const NotebookEditToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Edit Notebook";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, { verbose }) {
|
|
11
|
-
const path = verbose ? input.notebook_path : relative(process.cwd(), input.notebook_path ?? "");
|
|
12
|
-
const source = input.new_source ? input.new_source.slice(0, 30) + "\u2026" : "";
|
|
13
|
-
return `${path} cell:${input.cell_number ?? "?"}${source ? ` "${source}"` : ""}`;
|
|
14
|
-
},
|
|
15
|
-
renderRejection() {
|
|
16
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
17
|
-
},
|
|
18
|
-
renderOutput(output) {
|
|
19
|
-
if (!output || typeof output !== "object") {
|
|
20
|
-
return _jsx(Text, { children: "(No content)" });
|
|
21
|
-
}
|
|
22
|
-
const { cell_number, new_source, language, error } = output;
|
|
23
|
-
if (error) {
|
|
24
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: "red", children: error }) }));
|
|
25
|
-
}
|
|
26
|
-
const MAX_LINES = 2; // 1 header + 2 code lines = 3 lines
|
|
27
|
-
const sourceLines = new_source.split("\n");
|
|
28
|
-
const truncated = sourceLines.length > MAX_LINES;
|
|
29
|
-
const displaySource = truncated ? sourceLines.slice(0, MAX_LINES).join("\n") : new_source;
|
|
30
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: ["Updated cell ", cell_number, ":"] }), _jsx(Box, { marginLeft: 2, children: _jsx(HighlightedCode, { code: displaySource, language: language }) }), truncated && _jsxs(Text, { color: "gray", children: ["... (+", sourceLines.length - MAX_LINES, " lines)"] })] }));
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from "ink";
|
|
3
|
-
import { relative } from "path";
|
|
4
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
5
|
-
export const NotebookReadToolRenderers = {
|
|
6
|
-
displayName() {
|
|
7
|
-
return "Read Notebook";
|
|
8
|
-
},
|
|
9
|
-
renderInput(input, { verbose }) {
|
|
10
|
-
return `notebook_path: ${verbose ? input.notebook_path : relative(process.cwd(), input.notebook_path)}`;
|
|
11
|
-
},
|
|
12
|
-
renderRejection() {
|
|
13
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
14
|
-
},
|
|
15
|
-
renderOutput(content) {
|
|
16
|
-
if (!content) {
|
|
17
|
-
return _jsx(Text, { children: "No cells found in notebook" });
|
|
18
|
-
}
|
|
19
|
-
if (content.length < 1 || !content[0]) {
|
|
20
|
-
return _jsx(Text, { children: "No cells found in notebook" });
|
|
21
|
-
}
|
|
22
|
-
return _jsxs(Text, { children: ["Read ", content.length, " cells"] });
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
import { getTheme } from "../../theme/index.js";
|
|
5
|
-
import { safeFallbackText } from "../truncation.js";
|
|
6
|
-
export const OutlookReadToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Outlook Read";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, { verbose } = {}) {
|
|
11
|
-
const theme = getTheme();
|
|
12
|
-
const folder = String(input?.folder ?? "");
|
|
13
|
-
const search = input?.search ?? input?.search_query;
|
|
14
|
-
const filter = input?.filter;
|
|
15
|
-
const parts = [];
|
|
16
|
-
if (folder) {
|
|
17
|
-
parts.push(`folder: ${folder}`);
|
|
18
|
-
}
|
|
19
|
-
if (search) {
|
|
20
|
-
parts.push(`search: ${String(search)}`);
|
|
21
|
-
}
|
|
22
|
-
if (filter) {
|
|
23
|
-
parts.push(`filter: ${String(filter)}`);
|
|
24
|
-
}
|
|
25
|
-
return (_jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: parts.length > 0 ? parts.join(", ") : "Reading emails..." }) }));
|
|
26
|
-
},
|
|
27
|
-
renderRejection() {
|
|
28
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
29
|
-
},
|
|
30
|
-
renderOutput(output, { verbose } = {}) {
|
|
31
|
-
const theme = getTheme();
|
|
32
|
-
if (output == null) {
|
|
33
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: "(No emails found)" }) }));
|
|
34
|
-
}
|
|
35
|
-
const obj = output;
|
|
36
|
-
// Handle error case: { success: false, message: "..." }
|
|
37
|
-
if (obj.success === false) {
|
|
38
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: theme.colors.error, children: String(obj.message ?? "Error reading emails") }) }));
|
|
39
|
-
}
|
|
40
|
-
// Handle success case
|
|
41
|
-
if (obj.success === true) {
|
|
42
|
-
const data = (obj.data ?? {});
|
|
43
|
-
// Multiple emails: data.messages is an array
|
|
44
|
-
if (Array.isArray(data?.messages)) {
|
|
45
|
-
const messages = data.messages;
|
|
46
|
-
if (messages.length === 0) {
|
|
47
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: "(No emails)" }) }));
|
|
48
|
-
}
|
|
49
|
-
const count = messages.length;
|
|
50
|
-
const displayMessages = messages.slice(0, 3);
|
|
51
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [count, " email", count !== 1 ? "s" : ""] }), displayMessages.map((msg, idx) => (_jsx(Box, { flexDirection: "row", marginTop: idx === 0 ? 0 : 0, children: _jsxs(Box, { children: [_jsx(Text, { bold: true, children: msg.subject || "(No subject)" }), msg.from && _jsxs(Text, { color: theme.colors.textMuted, children: [" from ", msg.from] })] }) }, idx))), count > 3 && _jsxs(Text, { color: theme.colors.textMuted, children: ["... and ", count - 3, " more"] })] }));
|
|
52
|
-
}
|
|
53
|
-
// Single email detail: data has id, subject, from, etc.
|
|
54
|
-
if (data?.subject) {
|
|
55
|
-
const subject = data.subject;
|
|
56
|
-
const from = data?.from;
|
|
57
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { flexDirection: "row", children: _jsx(Text, { bold: true, children: String(subject) }) }), from && (_jsx(Box, { flexDirection: "row", children: _jsxs(Text, { color: theme.colors.textMuted, children: ["from ", String(from)] }) }))] }));
|
|
58
|
-
}
|
|
59
|
-
// Generic data display
|
|
60
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: safeFallbackText(obj.data) }) }));
|
|
61
|
-
}
|
|
62
|
-
// Fallback for unexpected shapes
|
|
63
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: safeFallbackText(output) }) }));
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
4
|
-
import { getTheme } from "../../theme/index.js";
|
|
5
|
-
import { safeFallbackText } from "../truncation.js";
|
|
6
|
-
export const OutlookReplyToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Outlook Reply";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, { verbose } = {}) {
|
|
11
|
-
const theme = getTheme();
|
|
12
|
-
const messageId = String(input?.messageId ?? input?.message_id ?? "");
|
|
13
|
-
const replyAll = Boolean(input?.replyAll ?? input?.reply_all ?? false);
|
|
14
|
-
// Truncate messageId if too long
|
|
15
|
-
const displayId = messageId.length > 20 ? messageId.substring(0, 20) + "..." : messageId;
|
|
16
|
-
return (_jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: [displayId, replyAll && _jsx(Text, { color: theme.colors.textMuted, children: " [reply-all]" })] }) }));
|
|
17
|
-
},
|
|
18
|
-
renderRejection() {
|
|
19
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
20
|
-
},
|
|
21
|
-
renderOutput(output, { verbose } = {}) {
|
|
22
|
-
const theme = getTheme();
|
|
23
|
-
if (output == null) {
|
|
24
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: theme.colors.error, children: "Failed to send reply" }) }));
|
|
25
|
-
}
|
|
26
|
-
const obj = output;
|
|
27
|
-
// Handle error case: { success: false, message: "..." }
|
|
28
|
-
if (obj.success === false) {
|
|
29
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: theme.colors.error, children: String(obj.message ?? "Failed to send reply") }) }));
|
|
30
|
-
}
|
|
31
|
-
// Handle success case: { success: true, message: "Reply sent" }
|
|
32
|
-
if (obj.success === true) {
|
|
33
|
-
const message = String(obj.message ?? "Reply sent");
|
|
34
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: theme.colors.success, children: message }) }));
|
|
35
|
-
}
|
|
36
|
-
// String output (likely success message or error)
|
|
37
|
-
if (typeof output === "string") {
|
|
38
|
-
if (output.toLowerCase().includes("sent") ||
|
|
39
|
-
output.toLowerCase().includes("success") ||
|
|
40
|
-
output.toLowerCase().includes("reply")) {
|
|
41
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: theme.colors.success, children: output }) }));
|
|
42
|
-
}
|
|
43
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: theme.colors.error, children: output }) }));
|
|
44
|
-
}
|
|
45
|
-
// Fallback for unexpected shapes
|
|
46
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: safeFallbackText(output) }) }));
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=index.js.map
|