dexto 1.5.8 → 1.6.1
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/README.md +3 -3
- package/dist/agents/agent-template.yml +2 -2
- package/dist/agents/coding-agent/README.md +10 -10
- package/dist/agents/coding-agent/coding-agent.yml +84 -83
- package/dist/agents/default-agent.yml +32 -47
- package/dist/agents/explore-agent/explore-agent.yml +3 -6
- package/dist/agents/image-editor-agent/image-editor-agent.yml +1 -1
- package/dist/agents/nano-banana-agent/nano-banana-agent.yml +1 -1
- package/dist/agents/podcast-agent/podcast-agent.yml +1 -1
- package/dist/agents/product-name-researcher/product-name-researcher.yml +1 -1
- package/dist/agents/sora-video-agent/sora-video-agent.yml +4 -6
- package/dist/agents/triage-demo/triage-agent.yml +1 -1
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.d.ts.map +1 -1
- package/dist/api/mcp/tool-aggregation-handler.d.ts +2 -2
- package/dist/api/server-hono.d.ts +2 -2
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +37 -60
- package/dist/cli/approval/cli-approval-handler.d.ts +10 -3
- package/dist/cli/approval/cli-approval-handler.d.ts.map +1 -1
- package/dist/cli/approval/cli-approval-handler.js +1 -1
- package/dist/cli/assets/sounds/SOURCES.md +35 -0
- package/dist/cli/assets/sounds/boot.wav +0 -0
- package/dist/cli/assets/sounds/chime.wav +0 -0
- package/dist/cli/assets/sounds/coin.wav +0 -0
- package/dist/cli/assets/sounds/confirm.wav +0 -0
- package/dist/cli/assets/sounds/levelup.wav +0 -0
- package/dist/cli/assets/sounds/ping.wav +0 -0
- package/dist/cli/assets/sounds/powerup.wav +0 -0
- package/dist/cli/assets/sounds/startup.wav +0 -0
- package/dist/cli/assets/sounds/success.wav +0 -0
- package/dist/cli/assets/sounds/treasure.wav +0 -0
- package/dist/cli/assets/sounds/win.wav +0 -0
- package/dist/cli/commands/create-app.d.ts +1 -11
- package/dist/cli/commands/create-app.d.ts.map +1 -1
- package/dist/cli/commands/create-app.js +21 -545
- package/dist/cli/commands/create-image.d.ts.map +1 -1
- package/dist/cli/commands/create-image.js +54 -53
- package/dist/cli/commands/image.d.ts +52 -0
- package/dist/cli/commands/image.d.ts.map +1 -0
- package/dist/cli/commands/image.js +118 -0
- package/dist/cli/commands/index.d.ts +2 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +3 -1
- package/dist/cli/commands/init-app.d.ts +4 -8
- package/dist/cli/commands/init-app.d.ts.map +1 -1
- package/dist/cli/commands/init-app.js +37 -161
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +2 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.d.ts +1 -1
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +2 -2
- package/dist/cli/commands/interactive-commands/exit-handler.d.ts +12 -0
- package/dist/cli/commands/interactive-commands/exit-handler.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/exit-handler.js +20 -0
- package/dist/cli/commands/interactive-commands/exit-stats.d.ts +24 -0
- package/dist/cli/commands/interactive-commands/exit-stats.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/exit-stats.js +17 -0
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +55 -5
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +14 -74
- package/dist/cli/commands/interactive-commands/session/index.d.ts +2 -1
- package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/index.js +2 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.js +2 -4
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -13
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +52 -83
- package/dist/cli/commands/plugin.d.ts +4 -4
- package/dist/cli/commands/sync-agents.d.ts +2 -12
- package/dist/cli/commands/sync-agents.d.ts.map +1 -1
- package/dist/cli/commands/sync-agents.js +2 -50
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts +7 -1
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +138 -27
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +2 -2
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +85 -30
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +1 -1
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts +5 -3
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ElicitationForm.js +414 -180
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/Footer.js +1 -2
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +20 -11
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +47 -67
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +20 -10
- package/dist/cli/ink-cli/components/TodoPanel.js +1 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +2 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +37 -27
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/Header.js +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +3 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +5 -15
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +3 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +5 -3
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +3 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +10 -3
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts +13 -0
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.js +60 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +213 -100
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +12 -16
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.js +566 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +1 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +100 -45
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +8 -13
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +3 -3
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +6 -5
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +3 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +18 -7
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +7 -17
- package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/index.js +1 -1
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts +7 -0
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.js +8 -0
- package/dist/cli/ink-cli/components/shared/HintBar.d.ts +6 -0
- package/dist/cli/ink-cli/components/shared/HintBar.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/HintBar.js +6 -0
- package/dist/cli/ink-cli/constants/spinnerFrames.d.ts +2 -0
- package/dist/cli/ink-cli/constants/spinnerFrames.d.ts.map +1 -0
- package/dist/cli/ink-cli/constants/spinnerFrames.js +1 -0
- package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -1
- package/dist/cli/ink-cli/constants/tips.js +2 -1
- package/dist/cli/ink-cli/containers/InputContainer.d.ts +4 -0
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +47 -21
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +2 -0
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +101 -40
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +15 -16
- package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts +11 -0
- package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useAnimationTick.js +54 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +1 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +7 -4
- package/dist/cli/ink-cli/services/CommandService.d.ts +1 -1
- package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/CommandService.js +2 -2
- package/dist/cli/ink-cli/services/processStream.d.ts +2 -2
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/processStream.js +27 -19
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +1 -0
- package/dist/cli/ink-cli/state/types.d.ts +15 -3
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.js +1 -0
- package/dist/cli/ink-cli/utils/elicitationSchema.d.ts +11 -0
- package/dist/cli/ink-cli/utils/elicitationSchema.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/elicitationSchema.js +80 -0
- package/dist/cli/ink-cli/utils/index.d.ts +1 -1
- package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/index.js +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +10 -19
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +43 -262
- package/dist/cli/ink-cli/utils/overlayPresentation.d.ts +19 -0
- package/dist/cli/ink-cli/utils/overlayPresentation.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/overlayPresentation.js +33 -0
- package/dist/cli/ink-cli/utils/overlaySizing.d.ts +19 -0
- package/dist/cli/ink-cli/utils/overlaySizing.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/overlaySizing.js +11 -0
- package/dist/cli/ink-cli/utils/soundNotification.d.ts +19 -13
- package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/soundNotification.js +120 -97
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +2 -9
- package/dist/cli/utils/config-validation.d.ts +11 -11
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +56 -290
- package/dist/cli/utils/image-store.d.ts +16 -0
- package/dist/cli/utils/image-store.d.ts.map +1 -0
- package/dist/cli/utils/image-store.js +289 -0
- package/dist/cli/utils/scaffolding-utils.d.ts +5 -0
- package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
- package/dist/cli/utils/scaffolding-utils.js +46 -4
- package/dist/cli/utils/template-engine.d.ts +28 -16
- package/dist/cli/utils/template-engine.d.ts.map +1 -1
- package/dist/cli/utils/template-engine.js +339 -479
- package/dist/config/cli-overrides.d.ts +4 -3
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +7 -9
- package/dist/index-main.d.ts +2 -0
- package/dist/index-main.d.ts.map +1 -0
- package/dist/index-main.js +1554 -0
- package/dist/index.js +2 -1589
- package/dist/utils/session-logger-factory.d.ts +3 -0
- package/dist/utils/session-logger-factory.d.ts.map +1 -0
- package/dist/utils/session-logger-factory.js +34 -0
- package/dist/webui/assets/{index-Cz2z7NQ8.js → index-CKhumsZA.js} +231 -231
- package/dist/webui/index.html +1 -1
- package/package.json +11 -8
- package/dist/cli/cli-subscriber.d.ts +0 -45
- package/dist/cli/cli-subscriber.d.ts.map +0 -1
- package/dist/cli/cli-subscriber.js +0 -204
|
@@ -5,5 +5,5 @@ export { type AutocompleteType, detectAutocompleteType, extractSlashQuery, extra
|
|
|
5
5
|
export { getCommandOverlay, getCommandOverlayForSelect, isInteractiveCommand, } from './commandOverlays.js';
|
|
6
6
|
export { createUserMessage, createSystemMessage, createErrorMessage, createToolMessage, createStreamingMessage, convertHistoryToUIMessages, getStartupInfo, } from './messageFormatting.js';
|
|
7
7
|
export { generateMessageId } from './idGenerator.js';
|
|
8
|
-
export { playNotificationSound, SoundNotificationService,
|
|
8
|
+
export { playNotificationSound, SoundNotificationService, type SoundType, type SoundConfig, } from './soundNotification.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACH,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACH,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,GACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EACH,qBAAqB,EACrB,wBAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACH,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACH,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,GACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EACH,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,SAAS,EACd,KAAK,WAAW,GACnB,MAAM,wBAAwB,CAAC"}
|
|
@@ -10,4 +10,4 @@ export { createUserMessage, createSystemMessage, createErrorMessage, createToolM
|
|
|
10
10
|
// ID generation
|
|
11
11
|
export { generateMessageId } from './idGenerator.js';
|
|
12
12
|
// Sound notifications
|
|
13
|
-
export { playNotificationSound, SoundNotificationService,
|
|
13
|
+
export { playNotificationSound, SoundNotificationService, } from './soundNotification.js';
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Message formatting utilities
|
|
3
3
|
* Helpers for creating and formatting messages
|
|
4
4
|
*/
|
|
5
|
-
import type { DextoAgent, InternalMessage } from '@dexto/core';
|
|
5
|
+
import type { DextoAgent, InternalMessage, ToolPresentationSnapshotV1 } from '@dexto/core';
|
|
6
6
|
import type { Message } from '../state/types.js';
|
|
7
|
+
export declare function normalizeToolName(toolName: string): string;
|
|
8
|
+
export declare function shouldHideTool(toolName: string | undefined): boolean;
|
|
7
9
|
/**
|
|
8
10
|
* Formats a skill invocation message for clean display.
|
|
9
11
|
* Converts verbose <skill-invocation> blocks to clean /skill-name format.
|
|
@@ -45,7 +47,7 @@ export declare function centerTruncatePath(filePath: string, maxWidth: number):
|
|
|
45
47
|
export declare function getToolDisplayName(toolName: string): string;
|
|
46
48
|
/**
|
|
47
49
|
* Gets the tool type badge for display.
|
|
48
|
-
* Returns: '
|
|
50
|
+
* Returns: 'local' or MCP server name.
|
|
49
51
|
*/
|
|
50
52
|
export declare function getToolTypeBadge(toolName: string): string;
|
|
51
53
|
/**
|
|
@@ -67,26 +69,15 @@ export interface FormattedToolHeader {
|
|
|
67
69
|
*
|
|
68
70
|
* Handles special cases like spawn_agent (uses agentId as display name).
|
|
69
71
|
*
|
|
70
|
-
* @param toolName -
|
|
72
|
+
* @param toolName - Tool name (local tool id or `mcp--...`)
|
|
71
73
|
* @param args - Tool arguments object
|
|
72
74
|
* @returns Formatted header components and full string
|
|
73
75
|
*/
|
|
74
|
-
export declare function formatToolHeader(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* Uses tool-specific config to determine which args to show.
|
|
80
|
-
* - File paths: converted to relative paths, center-truncated if needed
|
|
81
|
-
* - Commands/URLs: shown in full (never truncated)
|
|
82
|
-
* - Other args: truncated at 40 chars
|
|
83
|
-
*/
|
|
84
|
-
export declare function formatToolArgsForDisplay(toolName: string, args: Record<string, unknown>): string;
|
|
85
|
-
/**
|
|
86
|
-
* Formats tool arguments for display (compact preview).
|
|
87
|
-
* @deprecated Use formatToolArgsForDisplay instead
|
|
88
|
-
*/
|
|
89
|
-
export declare function formatToolArgsPreview(args: Record<string, unknown>, maxLength?: number): string;
|
|
76
|
+
export declare function formatToolHeader(options: {
|
|
77
|
+
toolName: string;
|
|
78
|
+
args: Record<string, unknown>;
|
|
79
|
+
presentationSnapshot?: ToolPresentationSnapshotV1;
|
|
80
|
+
}): FormattedToolHeader;
|
|
90
81
|
/**
|
|
91
82
|
* Creates a user message
|
|
92
83
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatting.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/messageFormatting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"messageFormatting.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/messageFormatting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EACR,UAAU,EACV,eAAe,EAGf,0BAA0B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAO1D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAMpE;AAiBD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAYpE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,CAmB1F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAChC,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE,MAAW,EACrB,GAAG,GAAE,MAAsB,GAC5B,MAAM,CAWR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiC7E;AAgBD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWzD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;CACrD,GAAG,mBAAmB,CAuBtB;AAqBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAO1D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CASvF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAO5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAQjE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAO3D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAQhD;AAgBD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAkC9D;AA+CD;;GAEG;AACH,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,eAAe,EAAE,EAC1B,SAAS,EAAE,MAAM,GAClB,OAAO,EAAE,CAgHX;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;;;;;;;;GAmB/E"}
|
|
@@ -6,12 +6,20 @@ import path from 'path';
|
|
|
6
6
|
import os from 'os';
|
|
7
7
|
import { isTextPart, isAssistantMessage, isToolMessage } from '@dexto/core';
|
|
8
8
|
const HIDDEN_TOOL_NAMES = new Set(['wait_for']);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export function normalizeToolName(toolName) {
|
|
10
|
+
if (toolName.startsWith('mcp--')) {
|
|
11
|
+
const trimmed = toolName.substring('mcp--'.length);
|
|
12
|
+
const parts = trimmed.split('--');
|
|
13
|
+
return parts.length >= 2 ? parts.slice(1).join('--') : trimmed;
|
|
14
|
+
}
|
|
15
|
+
return toolName;
|
|
16
|
+
}
|
|
17
|
+
export function shouldHideTool(toolName) {
|
|
18
|
+
if (!toolName) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return HIDDEN_TOOL_NAMES.has(normalizeToolName(toolName));
|
|
22
|
+
}
|
|
15
23
|
const backgroundCompletionRegex = /<background-task-completion>[\s\S]*?<\/background-task-completion>/g;
|
|
16
24
|
const stripBackgroundCompletion = (text) => text.replace(backgroundCompletionRegex, '').replace('<background-task-completion>', '').trim();
|
|
17
25
|
import { generateMessageId } from './idGenerator.js';
|
|
@@ -123,75 +131,10 @@ export function centerTruncatePath(filePath, maxWidth) {
|
|
|
123
131
|
// Filename itself is too long, end-truncate it
|
|
124
132
|
return filename.slice(0, maxWidth - 1) + '…';
|
|
125
133
|
}
|
|
126
|
-
/**
|
|
127
|
-
* Per-tool display configurations.
|
|
128
|
-
* Each tool specifies exactly which arguments to show and how.
|
|
129
|
-
*/
|
|
130
|
-
const TOOL_CONFIGS = {
|
|
131
|
-
// File tools - show file_path as primary
|
|
132
|
-
read_file: { displayName: 'Read', argsToShow: ['file_path'], primaryArg: 'file_path' },
|
|
133
|
-
write_file: { displayName: 'Write', argsToShow: ['file_path'], primaryArg: 'file_path' },
|
|
134
|
-
edit_file: { displayName: 'Update', argsToShow: ['file_path'], primaryArg: 'file_path' },
|
|
135
|
-
// Search tools - show pattern as primary, path as secondary
|
|
136
|
-
glob_files: {
|
|
137
|
-
displayName: 'Find files',
|
|
138
|
-
argsToShow: ['pattern', 'path'],
|
|
139
|
-
primaryArg: 'pattern',
|
|
140
|
-
},
|
|
141
|
-
grep_content: {
|
|
142
|
-
displayName: 'Search files',
|
|
143
|
-
argsToShow: ['pattern', 'path'],
|
|
144
|
-
primaryArg: 'pattern',
|
|
145
|
-
},
|
|
146
|
-
// Bash - show command only, skip description
|
|
147
|
-
bash_exec: { displayName: 'Bash', argsToShow: ['command'], primaryArg: 'command' },
|
|
148
|
-
bash_output: {
|
|
149
|
-
displayName: 'BashOutput',
|
|
150
|
-
argsToShow: ['process_id'],
|
|
151
|
-
primaryArg: 'process_id',
|
|
152
|
-
},
|
|
153
|
-
kill_process: { displayName: 'Kill', argsToShow: ['process_id'], primaryArg: 'process_id' },
|
|
154
|
-
// User interaction
|
|
155
|
-
ask_user: { displayName: 'Ask', argsToShow: ['question'], primaryArg: 'question' },
|
|
156
|
-
// Agent spawning - handled specially in formatToolHeader for dynamic agentId
|
|
157
|
-
spawn_agent: { displayName: 'Agent', argsToShow: ['task'], primaryArg: 'task' },
|
|
158
|
-
// Skill invocation - handled specially in formatToolHeader to show clean skill name
|
|
159
|
-
invoke_skill: { displayName: 'Skill', argsToShow: ['skill'], primaryArg: 'skill' },
|
|
160
|
-
plan_create: { displayName: 'Plan', argsToShow: [] },
|
|
161
|
-
plan_read: { displayName: 'Plan', argsToShow: [] },
|
|
162
|
-
plan_update: { displayName: 'Plan', argsToShow: [] },
|
|
163
|
-
plan_review: { displayName: 'Plan', argsToShow: [] },
|
|
164
|
-
wait_for: { displayName: 'Wait', argsToShow: ['taskId', 'taskIds', 'mode'] },
|
|
165
|
-
check_task: { displayName: 'CheckTask', argsToShow: ['taskId'] },
|
|
166
|
-
list_tasks: { displayName: 'ListTasks', argsToShow: ['status', 'type'] },
|
|
167
|
-
todo_write: { displayName: 'UpdateTasks', argsToShow: [] },
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Gets the display config for a tool.
|
|
171
|
-
* Handles internal-- prefix by stripping it before lookup.
|
|
172
|
-
*/
|
|
173
|
-
function getToolConfig(toolName) {
|
|
174
|
-
// Try direct lookup first
|
|
175
|
-
if (TOOL_CONFIGS[toolName]) {
|
|
176
|
-
return TOOL_CONFIGS[toolName];
|
|
177
|
-
}
|
|
178
|
-
// Strip internal-- prefix and try again
|
|
179
|
-
if (toolName.startsWith('internal--')) {
|
|
180
|
-
const baseName = toolName.replace('internal--', '');
|
|
181
|
-
return TOOL_CONFIGS[baseName];
|
|
182
|
-
}
|
|
183
|
-
// Strip "custom--" prefix and try again
|
|
184
|
-
if (toolName.startsWith('custom--')) {
|
|
185
|
-
const baseName = toolName.replace('custom--', '');
|
|
186
|
-
return TOOL_CONFIGS[baseName];
|
|
187
|
-
}
|
|
188
|
-
return undefined;
|
|
189
|
-
}
|
|
190
134
|
/**
|
|
191
135
|
* Gets a user-friendly display name for a tool.
|
|
192
|
-
* Returns the friendly name if known, otherwise returns
|
|
193
|
-
*
|
|
194
|
-
* MCP tools keep their server prefix for clarity (e.g., "mcp_server__tool").
|
|
136
|
+
* Returns the friendly name if known, otherwise returns a title-cased version.
|
|
137
|
+
* MCP tools keep their server prefix for clarity (e.g., "mcp--filesystem--read_file").
|
|
195
138
|
*/
|
|
196
139
|
function toTitleCase(name) {
|
|
197
140
|
return name
|
|
@@ -202,19 +145,7 @@ function toTitleCase(name) {
|
|
|
202
145
|
.join(' ');
|
|
203
146
|
}
|
|
204
147
|
export function getToolDisplayName(toolName) {
|
|
205
|
-
|
|
206
|
-
if (config) {
|
|
207
|
-
return config.displayName;
|
|
208
|
-
}
|
|
209
|
-
// Strip "internal--" prefix for unknown internal tools
|
|
210
|
-
if (toolName.startsWith('internal--')) {
|
|
211
|
-
return toTitleCase(toolName.replace('internal--', ''));
|
|
212
|
-
}
|
|
213
|
-
// Strip "custom--" prefix for custom tools
|
|
214
|
-
if (toolName.startsWith('custom--')) {
|
|
215
|
-
return toTitleCase(toolName.replace('custom--', ''));
|
|
216
|
-
}
|
|
217
|
-
// MCP tools: strip mcp-- or mcp__ prefix and server name for clean display
|
|
148
|
+
// MCP tools: strip `mcp--` prefix and server name for clean display
|
|
218
149
|
if (toolName.startsWith('mcp--')) {
|
|
219
150
|
const parts = toolName.split('--');
|
|
220
151
|
if (parts.length >= 3) {
|
|
@@ -222,24 +153,13 @@ export function getToolDisplayName(toolName) {
|
|
|
222
153
|
}
|
|
223
154
|
return toTitleCase(toolName.substring(5));
|
|
224
155
|
}
|
|
225
|
-
if (toolName.startsWith('mcp__')) {
|
|
226
|
-
const parts = toolName.substring(5).split('__');
|
|
227
|
-
if (parts.length >= 2) {
|
|
228
|
-
return toTitleCase(parts.slice(1).join('__'));
|
|
229
|
-
}
|
|
230
|
-
return toTitleCase(toolName.substring(5));
|
|
231
|
-
}
|
|
232
156
|
return toTitleCase(toolName);
|
|
233
157
|
}
|
|
234
158
|
/**
|
|
235
159
|
* Gets the tool type badge for display.
|
|
236
|
-
* Returns: '
|
|
160
|
+
* Returns: 'local' or MCP server name.
|
|
237
161
|
*/
|
|
238
162
|
export function getToolTypeBadge(toolName) {
|
|
239
|
-
// Internal tools
|
|
240
|
-
if (toolName.startsWith('internal--') || toolName.startsWith('internal__')) {
|
|
241
|
-
return 'internal';
|
|
242
|
-
}
|
|
243
163
|
// MCP tools with server name
|
|
244
164
|
if (toolName.startsWith('mcp--')) {
|
|
245
165
|
const parts = toolName.split('--');
|
|
@@ -248,19 +168,7 @@ export function getToolTypeBadge(toolName) {
|
|
|
248
168
|
}
|
|
249
169
|
return 'MCP';
|
|
250
170
|
}
|
|
251
|
-
|
|
252
|
-
const parts = toolName.substring(5).split('__');
|
|
253
|
-
if (parts.length >= 2 && parts[0]) {
|
|
254
|
-
return `MCP: ${parts[0]}`; // Format: 'MCP: servername'
|
|
255
|
-
}
|
|
256
|
-
return 'MCP';
|
|
257
|
-
}
|
|
258
|
-
// Custom tools
|
|
259
|
-
if (toolName.startsWith('custom--')) {
|
|
260
|
-
return 'custom';
|
|
261
|
-
}
|
|
262
|
-
// Unknown - likely custom
|
|
263
|
-
return 'custom';
|
|
171
|
+
return 'local';
|
|
264
172
|
}
|
|
265
173
|
/**
|
|
266
174
|
* Formats a tool call header for consistent display across CLI.
|
|
@@ -268,38 +176,16 @@ export function getToolTypeBadge(toolName) {
|
|
|
268
176
|
*
|
|
269
177
|
* Handles special cases like spawn_agent (uses agentId as display name).
|
|
270
178
|
*
|
|
271
|
-
* @param toolName -
|
|
179
|
+
* @param toolName - Tool name (local tool id or `mcp--...`)
|
|
272
180
|
* @param args - Tool arguments object
|
|
273
181
|
* @returns Formatted header components and full string
|
|
274
182
|
*/
|
|
275
|
-
export function formatToolHeader(
|
|
276
|
-
|
|
277
|
-
const
|
|
183
|
+
export function formatToolHeader(options) {
|
|
184
|
+
const { toolName, args, presentationSnapshot } = options;
|
|
185
|
+
const snapshotHeader = presentationSnapshot?.header;
|
|
186
|
+
const displayName = snapshotHeader?.title ?? getToolDisplayName(toolName);
|
|
187
|
+
const argsFormatted = snapshotHeader?.argsText ?? formatArgsFallback(args);
|
|
278
188
|
const badge = getToolTypeBadge(toolName);
|
|
279
|
-
// Normalize tool name to handle all prefixes (internal--, custom--)
|
|
280
|
-
const normalizedToolName = toolName.replace(/^(?:internal--|custom--)/, '');
|
|
281
|
-
// Special handling for spawn_agent: use agentId as display name
|
|
282
|
-
const isSpawnAgent = normalizedToolName === 'spawn_agent';
|
|
283
|
-
if (isSpawnAgent && args.agentId) {
|
|
284
|
-
const agentId = String(args.agentId);
|
|
285
|
-
const agentLabel = agentId.replace(/-agent$/, '');
|
|
286
|
-
displayName = agentLabel.charAt(0).toUpperCase() + agentLabel.slice(1);
|
|
287
|
-
}
|
|
288
|
-
// Special handling for invoke_skill: show skill as /skill-name
|
|
289
|
-
const isInvokeSkill = normalizedToolName === 'invoke_skill';
|
|
290
|
-
if (isInvokeSkill && args.skill) {
|
|
291
|
-
const skillName = String(args.skill);
|
|
292
|
-
// Extract display name from skill identifier (e.g., "config:test-fork" -> "test-fork")
|
|
293
|
-
const colonIndex = skillName.indexOf(':');
|
|
294
|
-
const displaySkillName = colonIndex >= 0 ? skillName.slice(colonIndex + 1) : skillName;
|
|
295
|
-
// Override args display to show clean slash command format
|
|
296
|
-
return {
|
|
297
|
-
displayName: 'Skill',
|
|
298
|
-
argsFormatted: `/${displaySkillName}`,
|
|
299
|
-
badge,
|
|
300
|
-
header: `Skill(/${displaySkillName})`,
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
189
|
// Only show badge for MCP tools (external tools worth distinguishing)
|
|
304
190
|
const isMcpTool = badge.startsWith('MCP');
|
|
305
191
|
const badgeSuffix = isMcpTool ? ` [${badge}]` : '';
|
|
@@ -315,129 +201,20 @@ export function formatToolHeader(toolName, args = {}) {
|
|
|
315
201
|
};
|
|
316
202
|
}
|
|
317
203
|
/**
|
|
318
|
-
*
|
|
319
|
-
* Used
|
|
204
|
+
* Simple fallback for formatting tool args when no snapshot is provided.
|
|
205
|
+
* Used for MCP tools that don't implement tool header snapshots.
|
|
320
206
|
*/
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
]);
|
|
330
|
-
/**
|
|
331
|
-
* Arguments that are file paths and should use relative path formatting.
|
|
332
|
-
* These get converted to relative paths and center-truncated if needed.
|
|
333
|
-
*/
|
|
334
|
-
const PATH_ARGS = new Set(['file_path', 'path']);
|
|
335
|
-
/**
|
|
336
|
-
* Arguments that should never be truncated (urls, task descriptions, etc.)
|
|
337
|
-
* These provide important context that users need to see in full.
|
|
338
|
-
* Note: 'command' is handled specially - single-line commands are not truncated,
|
|
339
|
-
* but multi-line commands (heredocs) are truncated to first line only.
|
|
340
|
-
*/
|
|
341
|
-
const NEVER_TRUNCATE_ARGS = new Set(['url', 'task', 'pattern', 'question']);
|
|
342
|
-
/**
|
|
343
|
-
* Formats tool arguments for display.
|
|
344
|
-
* Format: ToolName(primary_arg) or ToolName(primary_arg, key: value)
|
|
345
|
-
*
|
|
346
|
-
* Uses tool-specific config to determine which args to show.
|
|
347
|
-
* - File paths: converted to relative paths, center-truncated if needed
|
|
348
|
-
* - Commands/URLs: shown in full (never truncated)
|
|
349
|
-
* - Other args: truncated at 40 chars
|
|
350
|
-
*/
|
|
351
|
-
export function formatToolArgsForDisplay(toolName, args) {
|
|
352
|
-
const entries = Object.entries(args);
|
|
353
|
-
if (entries.length === 0)
|
|
354
|
-
return '';
|
|
355
|
-
const config = getToolConfig(toolName);
|
|
356
|
-
const parts = [];
|
|
357
|
-
/**
|
|
358
|
-
* Format a single argument value for display
|
|
359
|
-
*/
|
|
360
|
-
const formatArgValue = (argName, value) => {
|
|
361
|
-
const strValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
362
|
-
// File paths: use relative path (no truncation)
|
|
363
|
-
if (PATH_ARGS.has(argName)) {
|
|
364
|
-
return makeRelativePath(strValue);
|
|
365
|
-
}
|
|
366
|
-
// Commands: show single-line in full, truncate multi-line (heredocs) to first line
|
|
367
|
-
if (argName === 'command') {
|
|
368
|
-
const newlineIndex = strValue.indexOf('\n');
|
|
369
|
-
if (newlineIndex === -1) {
|
|
370
|
-
// Single-line command: show in full (useful for complex pipes)
|
|
371
|
-
return strValue;
|
|
372
|
-
}
|
|
373
|
-
// Multi-line command (heredoc): show first line only
|
|
374
|
-
return strValue.slice(0, newlineIndex) + '...';
|
|
375
|
-
}
|
|
376
|
-
// URLs: never truncate
|
|
377
|
-
if (NEVER_TRUNCATE_ARGS.has(argName)) {
|
|
378
|
-
return strValue;
|
|
379
|
-
}
|
|
380
|
-
// Other args: simple truncation
|
|
381
|
-
return strValue.length > 40 ? strValue.slice(0, 37) + '...' : strValue;
|
|
382
|
-
};
|
|
383
|
-
if (config) {
|
|
384
|
-
// Use tool-specific config
|
|
385
|
-
for (const argName of config.argsToShow) {
|
|
386
|
-
if (!(argName in args))
|
|
387
|
-
continue;
|
|
388
|
-
if (argName === 'description')
|
|
389
|
-
continue; // Skip description field
|
|
390
|
-
if (parts.length >= 3)
|
|
391
|
-
break;
|
|
392
|
-
const formattedValue = formatArgValue(argName, args[argName]);
|
|
393
|
-
if (argName === config.primaryArg) {
|
|
394
|
-
// Primary arg without key name
|
|
395
|
-
parts.unshift(formattedValue);
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
// Secondary args with key name
|
|
399
|
-
parts.push(`${argName}: ${formattedValue}`);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
// Fallback for unknown tools (MCP, etc.)
|
|
405
|
-
for (const [key, value] of entries) {
|
|
406
|
-
if (key === 'description')
|
|
407
|
-
continue; // Skip description field
|
|
408
|
-
if (parts.length >= 3)
|
|
409
|
-
break;
|
|
410
|
-
const formattedValue = formatArgValue(key, value);
|
|
411
|
-
if (FALLBACK_PRIMARY_ARGS.has(key) || PATH_ARGS.has(key)) {
|
|
412
|
-
// Primary arg without key name
|
|
413
|
-
parts.unshift(formattedValue);
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
// Other args with key name
|
|
417
|
-
parts.push(`${key}: ${formattedValue}`);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return parts.join(', ');
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Formats tool arguments for display (compact preview).
|
|
425
|
-
* @deprecated Use formatToolArgsForDisplay instead
|
|
426
|
-
*/
|
|
427
|
-
export function formatToolArgsPreview(args, maxLength = 60) {
|
|
428
|
-
const entries = Object.entries(args);
|
|
429
|
-
if (entries.length === 0)
|
|
430
|
-
return '';
|
|
431
|
-
// Show key parameters in a compact format
|
|
432
|
-
const preview = entries
|
|
433
|
-
.slice(0, 3) // Max 3 params
|
|
434
|
-
.map(([key, value]) => {
|
|
435
|
-
const strValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
436
|
-
const truncated = strValue.length > 30 ? strValue.slice(0, 27) + '...' : strValue;
|
|
437
|
-
return `${key}: "${truncated}"`;
|
|
207
|
+
function formatArgsFallback(args) {
|
|
208
|
+
const entries = Object.entries(args)
|
|
209
|
+
.filter(([k]) => !['__meta', 'description'].includes(k))
|
|
210
|
+
.slice(0, 4);
|
|
211
|
+
const str = entries
|
|
212
|
+
.map(([k, v]) => {
|
|
213
|
+
const val = typeof v === 'string' ? v : JSON.stringify(v);
|
|
214
|
+
return val.length > 50 ? `${k}=${val.slice(0, 47)}...` : `${k}=${val}`;
|
|
438
215
|
})
|
|
439
216
|
.join(', ');
|
|
440
|
-
return
|
|
217
|
+
return str.length > 150 ? str.slice(0, 147) + '...' : str;
|
|
441
218
|
}
|
|
442
219
|
/**
|
|
443
220
|
* Creates a user message
|
|
@@ -607,13 +384,17 @@ export function convertHistoryToUIMessages(history, sessionId) {
|
|
|
607
384
|
// Look up the original tool call to get args
|
|
608
385
|
const toolCall = toolCallMap.get(msg.toolCallId);
|
|
609
386
|
// Format tool name
|
|
610
|
-
const displayName = getToolDisplayName(msg.name);
|
|
387
|
+
const displayName = msg.presentationSnapshot?.header?.title ?? getToolDisplayName(msg.name);
|
|
611
388
|
// Format args if we have them
|
|
612
389
|
let toolContent = displayName;
|
|
613
|
-
|
|
390
|
+
const snapshotArgsText = msg.presentationSnapshot?.header?.argsText;
|
|
391
|
+
if (typeof snapshotArgsText === 'string' && snapshotArgsText.length > 0) {
|
|
392
|
+
toolContent = `${displayName}(${snapshotArgsText})`;
|
|
393
|
+
}
|
|
394
|
+
if (!snapshotArgsText && toolCall) {
|
|
614
395
|
try {
|
|
615
396
|
const args = JSON.parse(toolCall.function.arguments || '{}');
|
|
616
|
-
const argsFormatted =
|
|
397
|
+
const argsFormatted = formatArgsFallback(args);
|
|
617
398
|
if (argsFormatted) {
|
|
618
399
|
toolContent = `${displayName}(${argsFormatted})`;
|
|
619
400
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OverlayType } from '../state/types.js';
|
|
2
|
+
import type { ApprovalRequest } from '../components/ApprovalPrompt.js';
|
|
3
|
+
export type OverlayPresentation = 'none' | 'inline' | 'focus';
|
|
4
|
+
/**
|
|
5
|
+
* Determine how an overlay/approval should be presented in the CLI.
|
|
6
|
+
*
|
|
7
|
+
* - `inline`: small overlays that keep the main input visible (e.g. autocomplete)
|
|
8
|
+
* - `focus`: overlays/approvals that should take focus and hide UI chrome (input + footer)
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOverlayPresentation(activeOverlay: OverlayType, approval: ApprovalRequest | null): OverlayPresentation;
|
|
11
|
+
export declare function shouldHideCliChrome(activeOverlay: OverlayType, approval: ApprovalRequest | null): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Hide "always-on" chrome (status bar, panels, footer) whenever any overlay is visible.
|
|
14
|
+
*
|
|
15
|
+
* This keeps inline overlays (like slash/resource autocomplete) from competing for scarce
|
|
16
|
+
* terminal rows, and reduces flicker by keeping the total rendered height stable.
|
|
17
|
+
*/
|
|
18
|
+
export declare function shouldHideStatusChrome(activeOverlay: OverlayType, approval: ApprovalRequest | null): boolean;
|
|
19
|
+
//# sourceMappingURL=overlayPresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlayPresentation.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/overlayPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAO9D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAClC,aAAa,EAAE,WAAW,EAC1B,QAAQ,EAAE,eAAe,GAAG,IAAI,GACjC,mBAAmB,CAMrB;AAED,wBAAgB,mBAAmB,CAC/B,aAAa,EAAE,WAAW,EAC1B,QAAQ,EAAE,eAAe,GAAG,IAAI,GACjC,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAClC,aAAa,EAAE,WAAW,EAC1B,QAAQ,EAAE,eAAe,GAAG,IAAI,GACjC,OAAO,CAGT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const INLINE_OVERLAYS = new Set([
|
|
2
|
+
'slash-autocomplete',
|
|
3
|
+
'resource-autocomplete',
|
|
4
|
+
]);
|
|
5
|
+
/**
|
|
6
|
+
* Determine how an overlay/approval should be presented in the CLI.
|
|
7
|
+
*
|
|
8
|
+
* - `inline`: small overlays that keep the main input visible (e.g. autocomplete)
|
|
9
|
+
* - `focus`: overlays/approvals that should take focus and hide UI chrome (input + footer)
|
|
10
|
+
*/
|
|
11
|
+
export function getOverlayPresentation(activeOverlay, approval) {
|
|
12
|
+
if (approval)
|
|
13
|
+
return 'focus';
|
|
14
|
+
if (activeOverlay === 'none')
|
|
15
|
+
return 'none';
|
|
16
|
+
if (INLINE_OVERLAYS.has(activeOverlay))
|
|
17
|
+
return 'inline';
|
|
18
|
+
return 'focus';
|
|
19
|
+
}
|
|
20
|
+
export function shouldHideCliChrome(activeOverlay, approval) {
|
|
21
|
+
return getOverlayPresentation(activeOverlay, approval) === 'focus';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Hide "always-on" chrome (status bar, panels, footer) whenever any overlay is visible.
|
|
25
|
+
*
|
|
26
|
+
* This keeps inline overlays (like slash/resource autocomplete) from competing for scarce
|
|
27
|
+
* terminal rows, and reduces flicker by keeping the total rendered height stable.
|
|
28
|
+
*/
|
|
29
|
+
export function shouldHideStatusChrome(activeOverlay, approval) {
|
|
30
|
+
if (approval)
|
|
31
|
+
return true;
|
|
32
|
+
return activeOverlay !== 'none';
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ListViewportSizingOptions {
|
|
2
|
+
/** Total terminal rows. */
|
|
3
|
+
rows: number;
|
|
4
|
+
/** Maximum number of rows/items to ever render for the list. */
|
|
5
|
+
hardCap: number;
|
|
6
|
+
/**
|
|
7
|
+
* Rows to keep free for surrounding UI/chrome.
|
|
8
|
+
* Claude Code commonly uses ~6 rows of slack to avoid Ink hitting the clear+redraw path.
|
|
9
|
+
*/
|
|
10
|
+
reservedRows?: number;
|
|
11
|
+
/** Minimum rows/items to render when possible. */
|
|
12
|
+
minVisibleItems?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Compute a safe "max visible items" count for list UIs so we don't render content that
|
|
16
|
+
* approaches/exceeds the terminal height (which can cause Ink to clear + redraw, i.e. flicker).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getMaxVisibleItemsForTerminalRows({ rows, hardCap, reservedRows, minVisibleItems, }: ListViewportSizingOptions): number;
|
|
19
|
+
//# sourceMappingURL=overlaySizing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlaySizing.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/overlaySizing.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACtC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,EAC9C,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,eAAmB,GACtB,EAAE,yBAAyB,GAAG,MAAM,CAOpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute a safe "max visible items" count for list UIs so we don't render content that
|
|
3
|
+
* approaches/exceeds the terminal height (which can cause Ink to clear + redraw, i.e. flicker).
|
|
4
|
+
*/
|
|
5
|
+
export function getMaxVisibleItemsForTerminalRows({ rows, hardCap, reservedRows = 6, minVisibleItems = 1, }) {
|
|
6
|
+
const available = Math.max(0, rows - reservedRows);
|
|
7
|
+
if (available <= 0) {
|
|
8
|
+
return 1;
|
|
9
|
+
}
|
|
10
|
+
return Math.max(minVisibleItems, Math.min(hardCap, available));
|
|
11
|
+
}
|
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
* Plays system sounds for CLI notifications like approval requests and task completion.
|
|
5
5
|
* Uses platform-specific commands with fallback to terminal bell.
|
|
6
6
|
*
|
|
7
|
-
* Sound files should be placed in ~/.dexto/sounds/
|
|
7
|
+
* Sound files should be placed in the Dexto sounds directory (typically ~/.dexto/sounds/).
|
|
8
|
+
* In dexto source + DEXTO_DEV_MODE=true, this uses <repo>/.dexto/sounds/ for isolated dev.
|
|
8
9
|
*/
|
|
9
|
-
export type SoundType = 'approval' | 'complete';
|
|
10
|
+
export type SoundType = 'startup' | 'approval' | 'complete';
|
|
11
|
+
export declare const CUSTOM_SOUND_EXTENSIONS: readonly [".wav", ".mp3", ".ogg", ".oga", ".aiff", ".m4a"];
|
|
12
|
+
export declare function getDefaultSoundSpec(soundType: SoundType): string | null;
|
|
13
|
+
export declare function playSoundFile(soundPath: string): void;
|
|
10
14
|
/**
|
|
11
15
|
* Play a notification sound
|
|
12
16
|
*
|
|
13
|
-
* @param soundType - Type of sound to play ('approval' or 'complete')
|
|
17
|
+
* @param soundType - Type of sound to play ('startup', 'approval', or 'complete')
|
|
14
18
|
*
|
|
15
19
|
* @example
|
|
16
20
|
* ```typescript
|
|
@@ -19,9 +23,12 @@ export type SoundType = 'approval' | 'complete';
|
|
|
19
23
|
*
|
|
20
24
|
* // Play task complete sound
|
|
21
25
|
* playNotificationSound('complete');
|
|
26
|
+
*
|
|
27
|
+
* // Play startup sound
|
|
28
|
+
* playNotificationSound('startup');
|
|
22
29
|
* ```
|
|
23
30
|
*/
|
|
24
|
-
export declare function playNotificationSound(soundType: SoundType): void;
|
|
31
|
+
export declare function playNotificationSound(soundType: SoundType, config?: SoundConfig): void;
|
|
25
32
|
/**
|
|
26
33
|
* Sound configuration interface
|
|
27
34
|
*
|
|
@@ -30,8 +37,12 @@ export declare function playNotificationSound(soundType: SoundType): void;
|
|
|
30
37
|
*/
|
|
31
38
|
export interface SoundConfig {
|
|
32
39
|
enabled: boolean;
|
|
40
|
+
onStartup: boolean;
|
|
41
|
+
startupSoundFile?: string | undefined;
|
|
33
42
|
onApprovalRequired: boolean;
|
|
43
|
+
approvalSoundFile?: string | undefined;
|
|
34
44
|
onTaskComplete: boolean;
|
|
45
|
+
completeSoundFile?: string | undefined;
|
|
35
46
|
}
|
|
36
47
|
/**
|
|
37
48
|
* Sound notification service that respects configuration
|
|
@@ -50,6 +61,10 @@ export declare class SoundNotificationService {
|
|
|
50
61
|
* Get current configuration
|
|
51
62
|
*/
|
|
52
63
|
getConfig(): SoundConfig;
|
|
64
|
+
/**
|
|
65
|
+
* Play CLI startup sound if enabled
|
|
66
|
+
*/
|
|
67
|
+
playStartupSound(): void;
|
|
53
68
|
/**
|
|
54
69
|
* Play approval required sound if enabled
|
|
55
70
|
*/
|
|
@@ -59,13 +74,4 @@ export declare class SoundNotificationService {
|
|
|
59
74
|
*/
|
|
60
75
|
playCompleteSound(): void;
|
|
61
76
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Get the global sound notification service
|
|
64
|
-
* @returns The global service, or null if not initialized
|
|
65
|
-
*/
|
|
66
|
-
export declare function getSoundService(): SoundNotificationService | null;
|
|
67
|
-
/**
|
|
68
|
-
* Initialize the global sound service with configuration
|
|
69
|
-
*/
|
|
70
|
-
export declare function initializeSoundService(config: SoundConfig): SoundNotificationService;
|
|
71
77
|
//# sourceMappingURL=soundNotification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soundNotification.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/soundNotification.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"soundNotification.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/soundNotification.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D,eAAO,MAAM,uBAAuB,4DAA6D,CAAC;AAsDlG,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAOvE;AA2ED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAErD;AA4BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAQtF;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;GAKG;AACH,qBAAa,wBAAwB;IACjC,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,EAAE,WAAW;IAI/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAI7C;;OAEG;IACH,SAAS,IAAI,WAAW;IAIxB;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAMxB;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAMzB;;OAEG;IACH,iBAAiB,IAAI,IAAI;CAK5B"}
|