@aria-cli/cli 1.0.57 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aria.mjs +799 -668
- package/package.json +17 -76
- package/dist/.tsbuildinfo +0 -1
- package/dist/attached-local-control-client.js +0 -826
- package/dist/bootstrap-local-control-client.js +0 -2
- package/dist/capability-aware-method-proxy.js +0 -42
- package/dist/cli-context.js +0 -160
- package/dist/commands/arions.js +0 -174
- package/dist/commands/auth.js +0 -123
- package/dist/commands/daemon.js +0 -367
- package/dist/commands/definitions.js +0 -176
- package/dist/commands/index.js +0 -80
- package/dist/commands/login-handler.js +0 -1108
- package/dist/commands/logout-handler.js +0 -92
- package/dist/commands/memory-handlers.js +0 -89
- package/dist/commands/pairing.js +0 -60
- package/dist/commands/runtime-cutover-reset-command.js +0 -12
- package/dist/commands/runtime-cutover-reset.js +0 -265
- package/dist/commands/terminal-setup.js +0 -84
- package/dist/config/aria-config.js +0 -238
- package/dist/config/index.js +0 -3
- package/dist/config/loader.js +0 -97
- package/dist/config.js +0 -142
- package/dist/daemon-info.js +0 -10
- package/dist/ensure-daemon.js +0 -128
- package/dist/entrypoints/command-mode.js +0 -5
- package/dist/entrypoints/daemon.js +0 -50
- package/dist/entrypoints/headless-stdio.js +0 -25
- package/dist/entrypoints/interactive.js +0 -80
- package/dist/event-loop-watchdog.js +0 -73
- package/dist/headless/auth-orchestrator.js +0 -508
- package/dist/headless/auth-service.js +0 -43
- package/dist/headless/bootstrap-fast-path.js +0 -112
- package/dist/headless/call-command.js +0 -143
- package/dist/headless/daemon-service.js +0 -318
- package/dist/headless/hook-actions.js +0 -235
- package/dist/headless/hook-service.js +0 -42
- package/dist/headless/kernel-services.js +0 -216
- package/dist/headless/kernel.js +0 -785
- package/dist/headless/operations/arion.js +0 -119
- package/dist/headless/operations/auth.js +0 -45
- package/dist/headless/operations/client.js +0 -31
- package/dist/headless/operations/config.js +0 -69
- package/dist/headless/operations/daemon.js +0 -47
- package/dist/headless/operations/hook.js +0 -56
- package/dist/headless/operations/index.js +0 -11
- package/dist/headless/operations/memory.js +0 -102
- package/dist/headless/operations/message.js +0 -279
- package/dist/headless/operations/model.js +0 -100
- package/dist/headless/operations/peer.js +0 -56
- package/dist/headless/operations/run.js +0 -24
- package/dist/headless/operations/session.js +0 -90
- package/dist/headless/operations/system.js +0 -19
- package/dist/headless/operations/utils.js +0 -35
- package/dist/headless/run-orchestrator.js +0 -703
- package/dist/headless/stdio-server.js +0 -439
- package/dist/history/SessionHistory.js +0 -8
- package/dist/history/SessionHistoryClient.js +0 -186
- package/dist/history/conversation-message.js +0 -112
- package/dist/history/index.js +0 -8
- package/dist/history/jsonl-replay.js +0 -154
- package/dist/history/repair-tool-pairing.js +0 -84
- package/dist/history/stall-phase-bridge.js +0 -11
- package/dist/history/turn-accumulator.js +0 -427
- package/dist/index.js +0 -7
- package/dist/ink-repl.js +0 -4183
- package/dist/local-control-bootstrap.js +0 -26
- package/dist/local-control-client.js +0 -2
- package/dist/local-control-error-reporting.js +0 -34
- package/dist/local-control-http-client.js +0 -362
- package/dist/local-control-lazy-wrapper.js +0 -363
- package/dist/local-control-manager.js +0 -146
- package/dist/main.js +0 -62
- package/dist/network-security.js +0 -62
- package/dist/networking-server.js +0 -38
- package/dist/peer-identity.js +0 -23
- package/dist/polling-subscription.js +0 -34
- package/dist/relaunch.js +0 -617
- package/dist/release-notes.js +0 -35
- package/dist/repl-cleanup.js +0 -47
- package/dist/runtime/configure-bun-sqlite.js +0 -3
- package/dist/runtime/crash-handlers.js +0 -111
- package/dist/runtime/interactive-invocation.js +0 -39
- package/dist/runtime/internal-mode.js +0 -14
- package/dist/runtime/launch-spec.js +0 -64
- package/dist/runtime/owner-lease.js +0 -44
- package/dist/runtime/public-mode.js +0 -20
- package/dist/runtime/run-internal-mode.js +0 -18
- package/dist/runtime/runtime-kind.js +0 -32
- package/dist/runtime/spawn-aria.js +0 -38
- package/dist/selectable-client.js +0 -2
- package/dist/selectable-peer.js +0 -2
- package/dist/session.js +0 -203
- package/dist/slash-commands.js +0 -80
- package/dist/sounds.js +0 -210
- package/dist/ui/App.js +0 -526
- package/dist/ui/components/AnthropicMethodPicker.js +0 -6
- package/dist/ui/components/ArionPrompt.js +0 -15
- package/dist/ui/components/AutocompleteDropdown.js +0 -23
- package/dist/ui/components/AutonomySelector.js +0 -55
- package/dist/ui/components/Banner.js +0 -98
- package/dist/ui/components/ConversationHistory.js +0 -175
- package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
- package/dist/ui/components/CopilotSourcePicker.js +0 -50
- package/dist/ui/components/Cost.js +0 -10
- package/dist/ui/components/CustomSelect/option-map.js +0 -30
- package/dist/ui/components/CustomSelect/select-option.js +0 -13
- package/dist/ui/components/CustomSelect/select.js +0 -42
- package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
- package/dist/ui/components/CustomSelect/use-select.js +0 -15
- package/dist/ui/components/ErrorDisplay.js +0 -35
- package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
- package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
- package/dist/ui/components/HandoffMarker.js +0 -18
- package/dist/ui/components/HighlightedCode.js +0 -21
- package/dist/ui/components/InputArea.js +0 -187
- package/dist/ui/components/Message.js +0 -25
- package/dist/ui/components/OAuthLoginFlow.js +0 -113
- package/dist/ui/components/OutputTruncation.js +0 -35
- package/dist/ui/components/PermissionPrompt.js +0 -79
- package/dist/ui/components/PipelineTimingPanel.js +0 -15
- package/dist/ui/components/ProviderMethodPicker.js +0 -61
- package/dist/ui/components/ProviderPicker.js +0 -63
- package/dist/ui/components/RenderItemView.js +0 -71
- package/dist/ui/components/Spinner.js +0 -46
- package/dist/ui/components/StatusBar.js +0 -95
- package/dist/ui/components/StreamingIndicator.js +0 -55
- package/dist/ui/components/StructuredDiff.js +0 -168
- package/dist/ui/components/TextInputOverlay.js +0 -43
- package/dist/ui/components/ThinkingBlock.js +0 -82
- package/dist/ui/components/ToolCost.js +0 -17
- package/dist/ui/components/ToolExecution.js +0 -61
- package/dist/ui/components/ToolHeader.js +0 -51
- package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
- package/dist/ui/components/ToolResultWrapper.js +0 -6
- package/dist/ui/components/ToolUseLoader.js +0 -35
- package/dist/ui/components/TraceWaterfall.js +0 -91
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
- package/dist/ui/components/messages/UserImageMessage.js +0 -12
- package/dist/ui/components/messages/UserTextMessage.js +0 -12
- package/dist/ui/components/overlays/ArionSelector.js +0 -68
- package/dist/ui/components/overlays/ClientSelector.js +0 -62
- package/dist/ui/components/overlays/CommandPalette.js +0 -67
- package/dist/ui/components/overlays/DaemonControl.js +0 -87
- package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
- package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
- package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
- package/dist/ui/components/overlays/MessageSelector.js +0 -123
- package/dist/ui/components/overlays/ModelSelector.js +0 -211
- package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
- package/dist/ui/components/overlays/PeerSelector.js +0 -84
- package/dist/ui/components/overlays/SessionSelector.js +0 -102
- package/dist/ui/components/overlays/SoundSelector.js +0 -86
- package/dist/ui/components/overlays/ThemeSelector.js +0 -139
- package/dist/ui/components/overlays/index.js +0 -15
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
- package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
- package/dist/ui/components/permissions/PermissionRequest.js +0 -70
- package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
- package/dist/ui/components/permissions/hooks.js +0 -10
- package/dist/ui/components/permissions/toolUseOptions.js +0 -68
- package/dist/ui/components/permissions/utils.js +0 -10
- package/dist/ui/components/text-input/Cursor.js +0 -326
- package/dist/ui/components/text-input/TextInput.js +0 -231
- package/dist/ui/components/text-input/imagePaste.js +0 -28
- package/dist/ui/components/text-input/index.js +0 -6
- package/dist/ui/components/text-input/useDoublePress.js +0 -30
- package/dist/ui/components/text-input/useTextInput.js +0 -245
- package/dist/ui/components/tool-types.js +0 -9
- package/dist/ui/constants/figures.js +0 -4
- package/dist/ui/constants/index.js +0 -3
- package/dist/ui/display-mode.js +0 -93
- package/dist/ui/display-policy.js +0 -19
- package/dist/ui/hooks/index.js +0 -6
- package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
- package/dist/ui/hooks/useDoublePress.js +0 -37
- package/dist/ui/hooks/useIndicatorState.js +0 -55
- package/dist/ui/hooks/useInterval.js +0 -23
- package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
- package/dist/ui/hooks/useTerminalSize.js +0 -55
- package/dist/ui/hooks/useUnifiedMessages.js +0 -117
- package/dist/ui/indicator-state.js +0 -44
- package/dist/ui/markdown/highlight.js +0 -44
- package/dist/ui/markdown/index.js +0 -1460
- package/dist/ui/markdown/tokenizer.js +0 -24
- package/dist/ui/render-item.js +0 -5
- package/dist/ui/screens/REPL.js +0 -119
- package/dist/ui/screens/approval-lifecycle.js +0 -38
- package/dist/ui/status-line.js +0 -72
- package/dist/ui/theme/index.js +0 -51
- package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-dark.js +0 -50
- package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-light.js +0 -50
- package/dist/ui/theme/themes/dark-accessible.js +0 -18
- package/dist/ui/theme/themes/dark.js +0 -49
- package/dist/ui/theme/themes/light-accessible.js +0 -18
- package/dist/ui/theme/themes/light.js +0 -49
- package/dist/ui/theme/types.js +0 -3
- package/dist/ui/theme.js +0 -142
- package/dist/ui/to-render-items.js +0 -145
- package/dist/ui/tools/AgentTool/index.js +0 -30
- package/dist/ui/tools/ArchitectTool/index.js +0 -31
- package/dist/ui/tools/AskUserTool/index.js +0 -46
- package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
- package/dist/ui/tools/BashTool/OutputLine.js +0 -21
- package/dist/ui/tools/BashTool/index.js +0 -91
- package/dist/ui/tools/BrowseTool/index.js +0 -43
- package/dist/ui/tools/BrowserTool/index.js +0 -47
- package/dist/ui/tools/CbmTool/index.js +0 -188
- package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
- package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
- package/dist/ui/tools/CreateQuipTool/index.js +0 -30
- package/dist/ui/tools/CreateSkillTool/index.js +0 -22
- package/dist/ui/tools/CreateToolTool/index.js +0 -31
- package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
- package/dist/ui/tools/DeployTool/index.js +0 -47
- package/dist/ui/tools/FffTool/index.js +0 -103
- package/dist/ui/tools/FileEditTool/index.js +0 -67
- package/dist/ui/tools/FileReadTool/index.js +0 -68
- package/dist/ui/tools/FileWriteTool/index.js +0 -61
- package/dist/ui/tools/ForkTool/index.js +0 -47
- package/dist/ui/tools/FrgTool/index.js +0 -96
- package/dist/ui/tools/GetThreadTool/index.js +0 -39
- package/dist/ui/tools/GlobTool/index.js +0 -50
- package/dist/ui/tools/GrepTool/index.js +0 -84
- package/dist/ui/tools/HatchArionTool/index.js +0 -36
- package/dist/ui/tools/LearnSkillTool/index.js +0 -22
- package/dist/ui/tools/LearnTool/index.js +0 -43
- package/dist/ui/tools/LearnToolTool/index.js +0 -22
- package/dist/ui/tools/ListClientsTool/index.js +0 -39
- package/dist/ui/tools/LspTool/index.js +0 -261
- package/dist/ui/tools/MCPTool/index.js +0 -33
- package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
- package/dist/ui/tools/MemoryReadTool/index.js +0 -64
- package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
- package/dist/ui/tools/NotebookEditTool/index.js +0 -33
- package/dist/ui/tools/NotebookReadTool/index.js +0 -25
- package/dist/ui/tools/OutlookReadTool/index.js +0 -66
- package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
- package/dist/ui/tools/OutlookSendTool/index.js +0 -49
- package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
- package/dist/ui/tools/ProbeTool/index.js +0 -121
- package/dist/ui/tools/ProcessTool/index.js +0 -66
- package/dist/ui/tools/QuestListTool/index.js +0 -46
- package/dist/ui/tools/QuestReportTool/index.js +0 -49
- package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
- package/dist/ui/tools/QuipCommentTool/index.js +0 -69
- package/dist/ui/tools/QuipReadTool/index.js +0 -71
- package/dist/ui/tools/RestArionTool/index.js +0 -32
- package/dist/ui/tools/RestartTool/index.js +0 -35
- package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
- package/dist/ui/tools/RetireArionTool/index.js +0 -32
- package/dist/ui/tools/RgTool/index.js +0 -73
- package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
- package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
- package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
- package/dist/ui/tools/SendMessageTool/index.js +0 -45
- package/dist/ui/tools/SerenaTool/index.js +0 -124
- package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
- package/dist/ui/tools/SgTool/index.js +0 -80
- package/dist/ui/tools/SlackReactTool/index.js +0 -41
- package/dist/ui/tools/SlackReadTool/index.js +0 -48
- package/dist/ui/tools/SlackSendTool/index.js +0 -45
- package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
- package/dist/ui/tools/StickerRequestTool/index.js +0 -19
- package/dist/ui/tools/ThinkTool/index.js +0 -17
- package/dist/ui/tools/UgTool/index.js +0 -108
- package/dist/ui/tools/UseSkillTool/index.js +0 -22
- package/dist/ui/tools/WakeArionTool/index.js +0 -32
- package/dist/ui/tools/WebFetchTool/index.js +0 -56
- package/dist/ui/tools/WebSearchTool/index.js +0 -44
- package/dist/ui/tools/lsTool/index.js +0 -58
- package/dist/ui/tools/registry.js +0 -197
- package/dist/ui/tools/tool-renderer.js +0 -11
- package/dist/ui/tools/truncation.js +0 -35
- package/dist/ui/types/anthropic.js +0 -4
- package/dist/ui/types/index.js +0 -2
- package/dist/ui/types/message.js +0 -3
- package/dist/ui/types/tool.js +0 -4
- package/dist/ui/utils/array.js +0 -4
- package/dist/ui/utils/cursor.js +0 -131
- package/dist/ui/utils/diff.js +0 -120
- package/dist/ui/utils/format.js +0 -42
- package/dist/ui/utils/fuzzy.js +0 -59
- package/dist/ui/utils/index.js +0 -11
- package/dist/ui/utils/keys.js +0 -8
- package/dist/ui/utils/patch.js +0 -17
- package/dist/ui/utils/risk.js +0 -114
- package/dist/ui/utils/terminal-image.js +0 -70
- package/dist/ui/utils/validation.js +0 -48
- package/dist/ui/verb-pairs.js +0 -248
- package/dist/ui.js +0 -131
- package/src/entrypoints/command-mode.ts +0 -5
- package/src/entrypoints/daemon.ts +0 -54
- package/src/entrypoints/headless-stdio.ts +0 -27
- package/src/entrypoints/interactive.ts +0 -112
- package/src/main.ts +0 -72
- package/src/runtime/configure-bun-sqlite.ts +0 -3
- package/src/runtime/crash-handlers.ts +0 -128
- package/src/runtime/interactive-invocation.test.ts +0 -42
- package/src/runtime/interactive-invocation.ts +0 -51
- package/src/runtime/internal-mode.test.ts +0 -19
- package/src/runtime/internal-mode.ts +0 -24
- package/src/runtime/launch-spec.test.ts +0 -26
- package/src/runtime/launch-spec.ts +0 -84
- package/src/runtime/owner-lease.ts +0 -52
- package/src/runtime/public-mode.test.ts +0 -18
- package/src/runtime/public-mode.ts +0 -19
- package/src/runtime/run-internal-mode.ts +0 -19
- package/src/runtime/runtime-kind.test.ts +0 -23
- package/src/runtime/runtime-kind.ts +0 -41
- package/src/runtime/spawn-aria.ts +0 -62
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
3
|
-
import { Box, Text } from "ink";
|
|
4
|
-
import { relative } from "path";
|
|
5
|
-
import { FileEditToolUpdatedMessage } from "../../components/FileEditToolUpdatedMessage.js";
|
|
6
|
-
import { safeFallbackText } from "../truncation.js";
|
|
7
|
-
export const FileEditToolRenderers = {
|
|
8
|
-
displayName(input) {
|
|
9
|
-
const oldStr = (input?.old_string ?? input?.oldText ?? "");
|
|
10
|
-
const newStr = (input?.new_string ?? input?.newText ?? "");
|
|
11
|
-
if (oldStr === "")
|
|
12
|
-
return "Create";
|
|
13
|
-
if (newStr === "")
|
|
14
|
-
return "Delete";
|
|
15
|
-
return "Edit";
|
|
16
|
-
},
|
|
17
|
-
renderInput(input, { verbose }) {
|
|
18
|
-
// edit_file / file_edit: { path, oldText, newText }
|
|
19
|
-
const filePath = String(input?.file_path ?? input?.path ?? "");
|
|
20
|
-
if (filePath) {
|
|
21
|
-
return verbose ? filePath : relative(process.cwd(), filePath);
|
|
22
|
-
}
|
|
23
|
-
// apply_patch: { patch, cwd? }
|
|
24
|
-
if (typeof input?.patch === "string") {
|
|
25
|
-
const patch = input.patch;
|
|
26
|
-
// Extract file names from patch header lines like "*** Update path/to/file"
|
|
27
|
-
const files = [...patch.matchAll(/^\*\*\*\s+(?:Update|Add|Delete|Rename)\s+(.+)$/gm)]
|
|
28
|
-
.map((m) => m[1] ?? "")
|
|
29
|
-
.filter(Boolean)
|
|
30
|
-
.slice(0, 3);
|
|
31
|
-
if (files.length > 0) {
|
|
32
|
-
return files.map((f) => (verbose ? f : relative(process.cwd(), f))).join(", ");
|
|
33
|
-
}
|
|
34
|
-
return "patch";
|
|
35
|
-
}
|
|
36
|
-
return "";
|
|
37
|
-
},
|
|
38
|
-
renderOutput(output, { verbose }) {
|
|
39
|
-
if (output == null) {
|
|
40
|
-
return _jsx(Text, { children: "(No content)" });
|
|
41
|
-
}
|
|
42
|
-
// Handle string output (typically error messages) — truncate to avoid flooding
|
|
43
|
-
if (typeof output === "string") {
|
|
44
|
-
return _jsx(Text, { children: safeFallbackText(output, verbose) });
|
|
45
|
-
}
|
|
46
|
-
const obj = output;
|
|
47
|
-
// Structured diff shape: { filePath|path, structuredPatch }
|
|
48
|
-
if (obj.structuredPatch) {
|
|
49
|
-
return (_jsx(FileEditToolUpdatedMessage, { filePath: (obj.filePath ?? obj.path), structuredPatch: obj.structuredPatch, verbose: verbose }));
|
|
50
|
-
}
|
|
51
|
-
// ARIA shape: { path, strategy, matchesFound, replacements, replaceAll, previousHash, currentHash }
|
|
52
|
-
if (obj.path != null) {
|
|
53
|
-
const filePath = verbose ? String(obj.path) : relative(process.cwd(), String(obj.path));
|
|
54
|
-
const replacements = obj.replacements != null ? Number(obj.replacements) : undefined;
|
|
55
|
-
const suffix = replacements != null
|
|
56
|
-
? ` (${replacements} replacement${replacements !== 1 ? "s" : ""})`
|
|
57
|
-
: "";
|
|
58
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Edited ", _jsx(Text, { bold: true, children: filePath }), suffix] }) }) }));
|
|
59
|
-
}
|
|
60
|
-
// Default fallback
|
|
61
|
-
return _jsx(Text, { children: safeFallbackText(output, verbose) });
|
|
62
|
-
},
|
|
63
|
-
renderRejection() {
|
|
64
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { extname, relative } from "path";
|
|
4
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
5
|
-
import { HighlightedCode } from "../../components/HighlightedCode.js";
|
|
6
|
-
import { getTheme } from "../../theme/index.js";
|
|
7
|
-
import { capLines, safeFallbackText, MAX_VERBOSE_LINES } from "../truncation.js";
|
|
8
|
-
const MAX_LINES_TO_RENDER = 3;
|
|
9
|
-
export const FileReadToolRenderers = {
|
|
10
|
-
displayName() {
|
|
11
|
-
return "Read";
|
|
12
|
-
},
|
|
13
|
-
renderInput(input, { verbose }) {
|
|
14
|
-
const filePath = String(input?.file_path ?? input?.path ?? "");
|
|
15
|
-
const { file_path: _fp, path: _p, ...rest } = input;
|
|
16
|
-
const entries = [
|
|
17
|
-
["path", verbose ? filePath : relative(process.cwd(), filePath)],
|
|
18
|
-
...Object.entries(rest).filter(([k]) => k !== "file_path" && k !== "path"),
|
|
19
|
-
];
|
|
20
|
-
return entries.map(([key, value]) => `${key}: ${JSON.stringify(value)}`).join(", ");
|
|
21
|
-
},
|
|
22
|
-
renderOutput(output, { verbose }, input) {
|
|
23
|
-
// ARIA's read_file returns a plain string (file content) for text files,
|
|
24
|
-
// or { type: "media", ... } for images. Legacy shape:
|
|
25
|
-
// { type: "text"|"image", file: { filePath, content, numLines } }.
|
|
26
|
-
const inputObj = (input ?? {});
|
|
27
|
-
const inputPath = String(inputObj.file_path ?? inputObj.path ?? "");
|
|
28
|
-
const langFromInput = inputPath ? extname(inputPath).slice(1) : "";
|
|
29
|
-
if (output == null) {
|
|
30
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "(No content)" }) }) }));
|
|
31
|
-
}
|
|
32
|
-
// ARIA shape: plain string (file content)
|
|
33
|
-
if (typeof output === "string") {
|
|
34
|
-
const contentWithFallback = output || "(No content)";
|
|
35
|
-
const lines = contentWithFallback.split("\n");
|
|
36
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(HighlightedCode, { code: verbose
|
|
37
|
-
? capLines(lines.slice(0, MAX_VERBOSE_LINES).join("\n"))
|
|
38
|
-
: capLines(lines
|
|
39
|
-
.slice(0, MAX_LINES_TO_RENDER)
|
|
40
|
-
.filter((_) => _.trim() !== "")
|
|
41
|
-
.join("\n")), language: langFromInput }), lines.length > (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER) && (_jsxs(Text, { color: getTheme().colors.textMuted, children: ["... (+", lines.length - (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER), " lines)"] }))] }) }) }));
|
|
42
|
-
}
|
|
43
|
-
// Object shapes
|
|
44
|
-
const obj = output;
|
|
45
|
-
// ARIA shape: { type: "media", ... } for images
|
|
46
|
-
if (obj.type === "media" || obj.type === "image") {
|
|
47
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "Read image" }) }) }));
|
|
48
|
-
}
|
|
49
|
-
// Legacy shape: { type: "text", file: { filePath, content, numLines } }
|
|
50
|
-
if (obj.type === "text" && obj.file) {
|
|
51
|
-
const file = obj.file;
|
|
52
|
-
const contentWithFallback = file.content || "(No content)";
|
|
53
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(HighlightedCode, { code: verbose
|
|
54
|
-
? contentWithFallback
|
|
55
|
-
: capLines(contentWithFallback
|
|
56
|
-
.split("\n")
|
|
57
|
-
.slice(0, MAX_LINES_TO_RENDER)
|
|
58
|
-
.filter((_) => _.trim() !== "")
|
|
59
|
-
.join("\n")), language: extname(file.filePath).slice(1) }), !verbose && file.numLines > MAX_LINES_TO_RENDER && (_jsxs(Text, { color: getTheme().colors.textMuted, children: ["... (+", file.numLines - MAX_LINES_TO_RENDER, " lines)"] }))] }) }) }));
|
|
60
|
-
}
|
|
61
|
-
// Default fallback: JSON.stringify
|
|
62
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output, verbose) }) }) }));
|
|
63
|
-
},
|
|
64
|
-
renderRejection() {
|
|
65
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
3
|
-
import { Box, Text } from "ink";
|
|
4
|
-
import { EOL } from "os";
|
|
5
|
-
import { extname, relative } from "path";
|
|
6
|
-
import { FileEditToolUpdatedMessage } from "../../components/FileEditToolUpdatedMessage.js";
|
|
7
|
-
import { HighlightedCode } from "../../components/HighlightedCode.js";
|
|
8
|
-
import { getTheme } from "../../theme/index.js";
|
|
9
|
-
import { capLines, safeFallbackText, MAX_VERBOSE_LINES } from "../truncation.js";
|
|
10
|
-
const MAX_LINES_TO_RENDER = 3;
|
|
11
|
-
export const FileWriteToolRenderers = {
|
|
12
|
-
displayName: () => "Write",
|
|
13
|
-
renderInput(input, { verbose }) {
|
|
14
|
-
const filePath = String(input?.file_path ?? input?.path ?? "");
|
|
15
|
-
if (!filePath)
|
|
16
|
-
return "";
|
|
17
|
-
const display = verbose ? filePath : relative(process.cwd(), filePath);
|
|
18
|
-
const bytes = typeof input?.content === "string" ? ` (${input.content.length} bytes)` : "";
|
|
19
|
-
return display + bytes;
|
|
20
|
-
},
|
|
21
|
-
renderRejection() {
|
|
22
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
23
|
-
},
|
|
24
|
-
renderOutput(output, { verbose }) {
|
|
25
|
-
if (output == null) {
|
|
26
|
-
return _jsx(Text, { children: "(No content)" });
|
|
27
|
-
}
|
|
28
|
-
// Handle string output
|
|
29
|
-
if (typeof output === "string") {
|
|
30
|
-
return _jsx(Text, { children: safeFallbackText(output, verbose) });
|
|
31
|
-
}
|
|
32
|
-
const obj = output;
|
|
33
|
-
// Structured diff shape: overwrites/appends include structuredPatch from executor
|
|
34
|
-
if (obj.structuredPatch) {
|
|
35
|
-
return (_jsx(FileEditToolUpdatedMessage, { filePath: (obj.filePath ?? obj.path), structuredPatch: obj.structuredPatch, verbose: verbose }));
|
|
36
|
-
}
|
|
37
|
-
// ARIA shape without diff: new files { path, action: "created", bytesWritten }
|
|
38
|
-
if (obj.path != null && obj.action != null) {
|
|
39
|
-
const filePath = verbose ? String(obj.path) : relative(process.cwd(), String(obj.path));
|
|
40
|
-
const bytesWritten = obj.bytesWritten != null ? Number(obj.bytesWritten) : undefined;
|
|
41
|
-
const action = String(obj.action);
|
|
42
|
-
const sizeStr = bytesWritten != null ? `${bytesWritten} bytes to ` : "";
|
|
43
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Wrote ", sizeStr, _jsx(Text, { bold: true, children: filePath }), " (", action, ")"] }) }) }));
|
|
44
|
-
}
|
|
45
|
-
if (obj.type === "create" && obj.filePath != null) {
|
|
46
|
-
const content = obj.content || "";
|
|
47
|
-
const contentWithFallback = content || "(No content)";
|
|
48
|
-
const numLines = content.split(EOL).length;
|
|
49
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: ["Wrote ", numLines, " lines to", " ", _jsx(Text, { bold: true, children: verbose ? obj.filePath : relative(process.cwd(), obj.filePath) })] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 5, children: [_jsx(HighlightedCode, { code: verbose
|
|
50
|
-
? capLines(contentWithFallback.split("\n").slice(0, MAX_VERBOSE_LINES).join("\n"))
|
|
51
|
-
: capLines(contentWithFallback
|
|
52
|
-
.split("\n")
|
|
53
|
-
.slice(0, MAX_LINES_TO_RENDER)
|
|
54
|
-
.filter((_) => _.trim() !== "")
|
|
55
|
-
.join("\n")), language: extname(obj.filePath).slice(1) }), numLines > (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER) && (_jsxs(Text, { color: getTheme().colors.textMuted, children: ["... (+", numLines - (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER), " lines)"] }))] })] }));
|
|
56
|
-
}
|
|
57
|
-
// Default fallback
|
|
58
|
-
return _jsx(Text, { children: safeFallbackText(output, verbose) });
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,47 +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 ForkToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Fork";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, _opts) {
|
|
11
|
-
const parts = [];
|
|
12
|
-
if (input.quests && input.quests.length > 0) {
|
|
13
|
-
parts.push(input.quests.join(", "));
|
|
14
|
-
}
|
|
15
|
-
if (input.mode) {
|
|
16
|
-
parts.push(`mode=${input.mode}`);
|
|
17
|
-
}
|
|
18
|
-
if (input.tier) {
|
|
19
|
-
parts.push(`tier=${input.tier}`);
|
|
20
|
-
}
|
|
21
|
-
if (input.maxCostPerSession !== undefined) {
|
|
22
|
-
parts.push(`budget=$${input.maxCostPerSession}`);
|
|
23
|
-
}
|
|
24
|
-
return parts.length > 0
|
|
25
|
-
? parts.join(" · ")
|
|
26
|
-
: Object.entries(input)
|
|
27
|
-
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
28
|
-
.join(", ");
|
|
29
|
-
},
|
|
30
|
-
renderRejection() {
|
|
31
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
32
|
-
},
|
|
33
|
-
renderOutput(output, _opts) {
|
|
34
|
-
const theme = getTheme();
|
|
35
|
-
if (!output) {
|
|
36
|
-
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)" }) }) }));
|
|
37
|
-
}
|
|
38
|
-
if (typeof output === "string") {
|
|
39
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output) }) }) }));
|
|
40
|
-
}
|
|
41
|
-
const { id, quests, mode } = output;
|
|
42
|
-
const modeLabel = mode === "fork" ? "forked history" : "clean";
|
|
43
|
-
const questCount = quests?.length ?? 0;
|
|
44
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: theme.colors.info, children: "\u2442" }), _jsx(Text, { children: "Forked clone " }), _jsx(Text, { bold: true, children: id || "unknown" })] }), _jsx(Box, { flexDirection: "row", paddingLeft: 4, gap: 1, children: _jsxs(Text, { color: theme.colors.textMuted, children: [questCount, " quest", questCount !== 1 ? "s" : "", " \u00B7 ", modeLabel] }) }), quests && quests.length > 0 && (_jsx(Box, { flexDirection: "row", paddingLeft: 4, children: _jsx(Text, { color: theme.colors.textMuted, children: quests.join(", ") }) }))] }));
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,96 +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
|
-
export const FrgToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "FastRipgrep";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, { verbose }) {
|
|
11
|
-
const { command, pattern, path } = input;
|
|
12
|
-
if (command === "search" && pattern) {
|
|
13
|
-
const relativePath = path ? relative(process.cwd(), path) : undefined;
|
|
14
|
-
return `search "${pattern}"${relativePath || verbose ? ` in ${verbose && path ? path : relativePath || "."}` : ""}`;
|
|
15
|
-
}
|
|
16
|
-
if (command === "status") {
|
|
17
|
-
const relativePath = path ? relative(process.cwd(), path) : undefined;
|
|
18
|
-
return `status${relativePath || verbose ? ` for ${verbose && path ? path : relativePath || "."}` : ""}`;
|
|
19
|
-
}
|
|
20
|
-
if (command === "index" || command === "init") {
|
|
21
|
-
const relativePath = path ? relative(process.cwd(), path) : undefined;
|
|
22
|
-
return `${command}${relativePath || verbose ? ` at ${verbose && path ? path : relativePath || "."}` : ""}`;
|
|
23
|
-
}
|
|
24
|
-
if (command === "update") {
|
|
25
|
-
return `update index${path ? ` at ${verbose ? path : relative(process.cwd(), path)}` : ""}`;
|
|
26
|
-
}
|
|
27
|
-
return command;
|
|
28
|
-
},
|
|
29
|
-
renderRejection() {
|
|
30
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
31
|
-
},
|
|
32
|
-
renderOutput(output) {
|
|
33
|
-
const theme = getTheme();
|
|
34
|
-
// Handle null/undefined
|
|
35
|
-
if (output == null) {
|
|
36
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "No output" });
|
|
37
|
-
}
|
|
38
|
-
// Handle string output
|
|
39
|
-
if (typeof output === "string") {
|
|
40
|
-
const lines = output.trim().split("\n");
|
|
41
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: lines[0] });
|
|
42
|
-
}
|
|
43
|
-
// Handle object output
|
|
44
|
-
if (typeof output === "object" && !Array.isArray(output)) {
|
|
45
|
-
const obj = output;
|
|
46
|
-
// Search results: matches like rg (check BEFORE status — search responses also have `indexed` field)
|
|
47
|
-
if (Array.isArray(obj.matches)) {
|
|
48
|
-
const matches = obj.matches;
|
|
49
|
-
const files = new Set();
|
|
50
|
-
let totalMatches = 0;
|
|
51
|
-
for (const match of matches) {
|
|
52
|
-
if (typeof match.file === "string")
|
|
53
|
-
files.add(match.file);
|
|
54
|
-
else if (typeof match.path === "string")
|
|
55
|
-
files.add(match.path);
|
|
56
|
-
totalMatches++;
|
|
57
|
-
}
|
|
58
|
-
const numFiles = files.size;
|
|
59
|
-
if (numFiles === 0) {
|
|
60
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "No matches" });
|
|
61
|
-
}
|
|
62
|
-
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Found " }), _jsx(Text, { bold: true, children: totalMatches }), _jsxs(Text, { children: [" ", totalMatches === 1 ? "match" : "matches", " in "] }), _jsx(Text, { bold: true, children: numFiles }), _jsxs(Text, { children: [" ", numFiles === 1 ? "file" : "files"] })] }));
|
|
63
|
-
}
|
|
64
|
-
// Count results: { counts: [...], total }
|
|
65
|
-
if (Array.isArray(obj.counts) && typeof obj.total === "number") {
|
|
66
|
-
const counts = obj.counts;
|
|
67
|
-
const total = obj.total;
|
|
68
|
-
const numFiles = counts.length;
|
|
69
|
-
if (numFiles === 0) {
|
|
70
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "No matches" });
|
|
71
|
-
}
|
|
72
|
-
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Found " }), _jsx(Text, { bold: true, children: total }), _jsxs(Text, { children: [" ", total === 1 ? "match" : "matches", " in "] }), _jsx(Text, { bold: true, children: numFiles }), _jsxs(Text, { children: [" ", numFiles === 1 ? "file" : "files"] })] }));
|
|
73
|
-
}
|
|
74
|
-
// Status command: show index info (checked after matches/counts to avoid false hits)
|
|
75
|
-
if (typeof obj.indexed === "boolean" || typeof obj.files === "number") {
|
|
76
|
-
const indexed = obj.indexed === true;
|
|
77
|
-
const files = typeof obj.files === "number" ? obj.files : 0;
|
|
78
|
-
if (indexed) {
|
|
79
|
-
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Index: " }), _jsx(Text, { bold: true, children: files }), _jsx(Text, { children: " files indexed" })] }));
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "Not indexed" });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Generic success/message response
|
|
86
|
-
if (typeof obj.message === "string") {
|
|
87
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: obj.message });
|
|
88
|
-
}
|
|
89
|
-
// Fallback
|
|
90
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "Command completed" });
|
|
91
|
-
}
|
|
92
|
-
// Fallback for arrays or other types
|
|
93
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "Done" });
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -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 GetThreadToolRenderers = {
|
|
6
|
-
displayName() {
|
|
7
|
-
return "Thread";
|
|
8
|
-
},
|
|
9
|
-
renderInput(input, { verbose } = {}) {
|
|
10
|
-
const messageId = String(input?.messageId ?? input?.message_id ?? "");
|
|
11
|
-
return messageId ? `messageId: ${messageId}` : "Get thread";
|
|
12
|
-
},
|
|
13
|
-
renderRejection() {
|
|
14
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
15
|
-
},
|
|
16
|
-
renderOutput(output, { verbose } = {}) {
|
|
17
|
-
const theme = getTheme();
|
|
18
|
-
if (output == null) {
|
|
19
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "No messages in thread" });
|
|
20
|
-
}
|
|
21
|
-
const obj = (output ?? {});
|
|
22
|
-
// Extract messages from output.data
|
|
23
|
-
const data = (obj.data ?? obj);
|
|
24
|
-
const messages = Array.isArray(data.messages) ? data.messages : [];
|
|
25
|
-
if (!messages || messages.length === 0) {
|
|
26
|
-
return _jsx(Text, { color: theme.colors.textMuted, children: "No messages in thread" });
|
|
27
|
-
}
|
|
28
|
-
const count = messages.length;
|
|
29
|
-
const previewCount = Math.min(3, messages.length);
|
|
30
|
-
const previews = messages.slice(0, previewCount);
|
|
31
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [count, " message", count !== 1 ? "s" : "", " in thread"] }), previews.length > 0 && (_jsx(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, children: previews.map((msg, idx) => {
|
|
32
|
-
const from = String(msg.from ?? msg.sender ?? "Unknown");
|
|
33
|
-
const content = String(msg.content ?? msg.text ?? "");
|
|
34
|
-
const truncated = content.length > 40 ? content.substring(0, 40) + "…" : content;
|
|
35
|
-
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { bold: true, children: from }), _jsx(Text, { children: " " }), _jsx(Text, { color: theme.colors.textMuted, children: truncated })] }, idx));
|
|
36
|
-
}) })), messages.length > previewCount && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsxs(Text, { color: theme.colors.textMuted, children: ["... and ", messages.length - previewCount, " more"] }) }))] }));
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { isAbsolute, relative, resolve } from "path";
|
|
4
|
-
import { Cost } from "../../components/Cost.js";
|
|
5
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
6
|
-
export const GlobToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Search";
|
|
9
|
-
},
|
|
10
|
-
renderInput({ pattern, path }, { verbose }) {
|
|
11
|
-
const absolutePath = path
|
|
12
|
-
? isAbsolute(path)
|
|
13
|
-
? path
|
|
14
|
-
: resolve(process.cwd(), path)
|
|
15
|
-
: undefined;
|
|
16
|
-
const relativePath = absolutePath ? relative(process.cwd(), absolutePath) : undefined;
|
|
17
|
-
return `pattern: "${pattern}"${relativePath || verbose ? `, path: "${verbose ? absolutePath : relativePath}"` : ""}`;
|
|
18
|
-
},
|
|
19
|
-
renderRejection() {
|
|
20
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
21
|
-
},
|
|
22
|
-
renderOutput(output) {
|
|
23
|
-
// ARIA's glob returns string[] (file path array).
|
|
24
|
-
// Legacy shape: { numFiles, filenames, durationMs, truncated }.
|
|
25
|
-
// Also handle raw string for backward compatibility.
|
|
26
|
-
let numFiles = 0;
|
|
27
|
-
let durationMs = 0;
|
|
28
|
-
if (Array.isArray(output)) {
|
|
29
|
-
// ARIA shape: string[]
|
|
30
|
-
numFiles = output.length;
|
|
31
|
-
}
|
|
32
|
-
else if (typeof output === "string") {
|
|
33
|
-
try {
|
|
34
|
-
const parsed = JSON.parse(output);
|
|
35
|
-
numFiles = parsed.numFiles ?? 0;
|
|
36
|
-
durationMs = parsed.durationMs ?? 0;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
numFiles = 0;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else if (output != null && typeof output === "object") {
|
|
43
|
-
const obj = output;
|
|
44
|
-
numFiles = typeof obj.numFiles === "number" ? obj.numFiles : 0;
|
|
45
|
-
durationMs = typeof obj.durationMs === "number" ? obj.durationMs : 0;
|
|
46
|
-
}
|
|
47
|
-
return (_jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Found " }), _jsxs(Text, { bold: true, children: [numFiles, " "] }), _jsx(Text, { children: numFiles === 0 || numFiles > 1 ? "files" : "file" })] }), durationMs > 0 && _jsx(Cost, { costUSD: 0, durationMs: durationMs, debug: false })] }));
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { isAbsolute, relative, resolve } from "path";
|
|
4
|
-
import { Cost } from "../../components/Cost.js";
|
|
5
|
-
import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
|
|
6
|
-
export const GrepToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Grep";
|
|
9
|
-
},
|
|
10
|
-
renderInput({ pattern, path, include }, { verbose }) {
|
|
11
|
-
const absolutePath = path
|
|
12
|
-
? isAbsolute(path)
|
|
13
|
-
? path
|
|
14
|
-
: resolve(process.cwd(), path)
|
|
15
|
-
: undefined;
|
|
16
|
-
const relativePath = absolutePath ? relative(process.cwd(), absolutePath) : undefined;
|
|
17
|
-
return `pattern: "${pattern}"${relativePath || verbose ? `, path: "${verbose ? absolutePath : relativePath}"` : ""}${include ? `, include: "${include}"` : ""}`;
|
|
18
|
-
},
|
|
19
|
-
renderRejection() {
|
|
20
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
21
|
-
},
|
|
22
|
-
renderOutput(output) {
|
|
23
|
-
// ARIA's grep returns { matches: GrepMatch[], truncated? } where each match has a `file` field.
|
|
24
|
-
// Legacy shape: { numFiles, durationMs }.
|
|
25
|
-
// Also handle array output or string.
|
|
26
|
-
let numMatches = 0;
|
|
27
|
-
let numFiles = 0;
|
|
28
|
-
let durationMs = 0;
|
|
29
|
-
let truncated = false;
|
|
30
|
-
const fileNames = [];
|
|
31
|
-
if (output != null && typeof output === "object" && !Array.isArray(output)) {
|
|
32
|
-
const obj = output;
|
|
33
|
-
if (Array.isArray(obj.matches)) {
|
|
34
|
-
// ARIA shape: { matches: [...], truncated? }
|
|
35
|
-
const files = new Set();
|
|
36
|
-
for (const match of obj.matches) {
|
|
37
|
-
const m = match;
|
|
38
|
-
const f = typeof m.filePath === "string"
|
|
39
|
-
? m.filePath
|
|
40
|
-
: typeof m.file === "string"
|
|
41
|
-
? m.file
|
|
42
|
-
: typeof m.path === "string"
|
|
43
|
-
? m.path
|
|
44
|
-
: undefined;
|
|
45
|
-
if (f)
|
|
46
|
-
files.add(f);
|
|
47
|
-
}
|
|
48
|
-
numMatches = obj.matches.length;
|
|
49
|
-
numFiles = files.size;
|
|
50
|
-
truncated = !!obj.truncated;
|
|
51
|
-
for (const f of files)
|
|
52
|
-
fileNames.push(relative(process.cwd(), f));
|
|
53
|
-
}
|
|
54
|
-
else if (typeof obj.numFiles === "number") {
|
|
55
|
-
numFiles = obj.numFiles;
|
|
56
|
-
durationMs = typeof obj.durationMs === "number" ? obj.durationMs : 0;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else if (Array.isArray(output)) {
|
|
60
|
-
const files = new Set();
|
|
61
|
-
for (const match of output) {
|
|
62
|
-
if (match != null && typeof match === "object") {
|
|
63
|
-
const m = match;
|
|
64
|
-
const f = typeof m.filePath === "string"
|
|
65
|
-
? m.filePath
|
|
66
|
-
: typeof m.file === "string"
|
|
67
|
-
? m.file
|
|
68
|
-
: typeof m.path === "string"
|
|
69
|
-
? m.path
|
|
70
|
-
: undefined;
|
|
71
|
-
if (f)
|
|
72
|
-
files.add(f);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
numMatches = output.length;
|
|
76
|
-
numFiles = files.size || output.length;
|
|
77
|
-
for (const f of files)
|
|
78
|
-
fileNames.push(relative(process.cwd(), f));
|
|
79
|
-
}
|
|
80
|
-
const MAX_FILES = 4;
|
|
81
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { bold: true, children: [numMatches, " "] }), _jsxs(Text, { children: [numMatches === 1 ? "match" : "matches", " in "] }), _jsxs(Text, { bold: true, children: [numFiles, " "] }), _jsx(Text, { children: numFiles === 1 ? "file" : "files" }), truncated && _jsx(Text, { color: "yellow", children: " (truncated)" }), durationMs > 0 && _jsx(Cost, { costUSD: 0, durationMs: durationMs, debug: false })] }), fileNames.slice(0, MAX_FILES).map((f, i) => (_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { dimColor: true, children: f }) }, i))), fileNames.length > MAX_FILES && (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["+", fileNames.length - MAX_FILES, " more files"] }) }))] }));
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,36 +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 HatchArionToolRenderers = {
|
|
7
|
-
displayName() {
|
|
8
|
-
return "Hatch Arion";
|
|
9
|
-
},
|
|
10
|
-
renderInput(input, _opts) {
|
|
11
|
-
if (input.name) {
|
|
12
|
-
return `${input.name}`;
|
|
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, { color: theme.colors.success, children: output.includes("hatched")
|
|
28
|
-
? safeFallbackText(output)
|
|
29
|
-
: `${safeFallbackText(output)} has hatched!` }) }) }));
|
|
30
|
-
}
|
|
31
|
-
const emoji = output.emoji || "";
|
|
32
|
-
const name = output.name || "Arion";
|
|
33
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { color: theme.colors.success, children: [emoji, emoji ? " " : "", name, " has hatched!"] }) }) }));
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +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
|
-
export const LearnSkillToolRenderers = {
|
|
5
|
-
displayName() {
|
|
6
|
-
return "Learn Skill";
|
|
7
|
-
},
|
|
8
|
-
renderInput(input, _opts) {
|
|
9
|
-
return input.name ?? "skill";
|
|
10
|
-
},
|
|
11
|
-
renderRejection() {
|
|
12
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
13
|
-
},
|
|
14
|
-
renderOutput(output) {
|
|
15
|
-
if (!output || typeof output !== "object") {
|
|
16
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "(No content)" }) }) }));
|
|
17
|
-
}
|
|
18
|
-
const name = output.name ?? "unknown";
|
|
19
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Learned skill ", name] }) }) }));
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,43 +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 { safeFallbackText } from "../truncation.js";
|
|
5
|
-
export const LearnToolRenderers = {
|
|
6
|
-
displayName() {
|
|
7
|
-
return "Learn";
|
|
8
|
-
},
|
|
9
|
-
renderInput(input, _opts) {
|
|
10
|
-
// Handle source as string or object { type, command/path }
|
|
11
|
-
let sourceStr;
|
|
12
|
-
if (typeof input.source === "string") {
|
|
13
|
-
sourceStr = input.source;
|
|
14
|
-
}
|
|
15
|
-
else if (input.source && typeof input.source === "object") {
|
|
16
|
-
sourceStr = input.source.type || input.source.command || input.source.path || "unknown";
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
sourceStr = "unknown";
|
|
20
|
-
}
|
|
21
|
-
const name = input.name ?? "";
|
|
22
|
-
return name ? `${sourceStr}: ${name}` : sourceStr;
|
|
23
|
-
},
|
|
24
|
-
renderRejection() {
|
|
25
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
26
|
-
},
|
|
27
|
-
renderOutput(output) {
|
|
28
|
-
// Handle null/undefined
|
|
29
|
-
if (output == null) {
|
|
30
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "Learned" }) }) }));
|
|
31
|
-
}
|
|
32
|
-
// Handle string
|
|
33
|
-
if (typeof output === "string") {
|
|
34
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output) }) }) }));
|
|
35
|
-
}
|
|
36
|
-
const obj = output;
|
|
37
|
-
const name = obj.name ?? "unknown";
|
|
38
|
-
const type = obj.type ?? "";
|
|
39
|
-
const suffix = type ? ` ${type}` : "";
|
|
40
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Learned", suffix, " ", name] }) }) }));
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +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
|
-
export const LearnToolToolRenderers = {
|
|
5
|
-
displayName() {
|
|
6
|
-
return "Learn Tool";
|
|
7
|
-
},
|
|
8
|
-
renderInput(input, _opts) {
|
|
9
|
-
return input.name ?? "tool";
|
|
10
|
-
},
|
|
11
|
-
renderRejection() {
|
|
12
|
-
return _jsx(FallbackToolUseRejectedMessage, {});
|
|
13
|
-
},
|
|
14
|
-
renderOutput(output) {
|
|
15
|
-
if (!output || typeof output !== "object") {
|
|
16
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "(No content)" }) }) }));
|
|
17
|
-
}
|
|
18
|
-
const name = output.name ?? "unknown";
|
|
19
|
-
return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Learned tool ", name] }) }) }));
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=index.js.map
|