dexto 1.5.6 → 1.5.8
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 +13 -0
- package/dist/agents/coding-agent/coding-agent.yml +17 -0
- package/dist/agents/coding-agent/skills/code-review.md +46 -0
- package/dist/agents/explore-agent/explore-agent.yml +2 -0
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.d.ts.map +1 -1
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +55 -10
- package/dist/cli/assets/dexto-logo.svg +31 -0
- package/dist/cli/auth/api-client.d.ts +49 -0
- package/dist/cli/auth/api-client.d.ts.map +1 -0
- package/dist/cli/auth/api-client.js +127 -0
- package/dist/cli/auth/constants.d.ts +27 -0
- package/dist/cli/auth/constants.d.ts.map +1 -0
- package/dist/cli/auth/constants.js +28 -0
- package/dist/cli/auth/index.d.ts +5 -0
- package/dist/cli/auth/index.d.ts.map +1 -0
- package/dist/cli/auth/index.js +6 -0
- package/dist/cli/auth/oauth.d.ts +26 -0
- package/dist/cli/auth/oauth.d.ts.map +1 -0
- package/dist/cli/auth/oauth.js +327 -0
- package/dist/cli/auth/service.d.ts +20 -0
- package/dist/cli/auth/service.d.ts.map +1 -0
- package/dist/cli/auth/service.js +147 -0
- package/dist/cli/commands/auth/index.d.ts +4 -0
- package/dist/cli/commands/auth/index.d.ts.map +1 -0
- package/dist/cli/commands/auth/index.js +4 -0
- package/dist/cli/commands/auth/login.d.ts +9 -0
- package/dist/cli/commands/auth/login.d.ts.map +1 -0
- package/dist/cli/commands/auth/login.js +255 -0
- package/dist/cli/commands/auth/logout.d.ts +5 -0
- package/dist/cli/commands/auth/logout.d.ts.map +1 -0
- package/dist/cli/commands/auth/logout.js +51 -0
- package/dist/cli/commands/auth/status.d.ts +2 -0
- package/dist/cli/commands/auth/status.d.ts.map +1 -0
- package/dist/cli/commands/auth/status.js +22 -0
- package/dist/cli/commands/billing/index.d.ts +2 -0
- package/dist/cli/commands/billing/index.d.ts.map +1 -0
- package/dist/cli/commands/billing/index.js +2 -0
- package/dist/cli/commands/billing/status.d.ts +8 -0
- package/dist/cli/commands/billing/status.d.ts.map +1 -0
- package/dist/cli/commands/billing/status.js +82 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +8 -0
- package/dist/cli/commands/interactive-commands/auth/index.d.ts +12 -0
- package/dist/cli/commands/interactive-commands/auth/index.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/auth/index.js +20 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +5 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +6 -0
- package/dist/cli/commands/interactive-commands/commands.d.ts +1 -0
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +8 -0
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +4 -7
- package/dist/cli/commands/interactive-commands/model/index.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/model/index.js +4 -7
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts +13 -0
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/plugin/index.js +18 -0
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +88 -36
- package/dist/cli/commands/list-agents.d.ts.map +1 -1
- package/dist/cli/commands/list-agents.js +3 -2
- package/dist/cli/commands/plugin.d.ts +161 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +376 -0
- package/dist/cli/commands/setup.d.ts +9 -9
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +944 -176
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +13 -2
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +80 -12
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.d.ts +18 -0
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +48 -0
- package/dist/cli/ink-cli/components/ErrorBoundary.js +1 -1
- package/dist/cli/ink-cli/components/Footer.d.ts +2 -1
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/Footer.js +6 -2
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +150 -41
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +15 -7
- package/dist/cli/ink-cli/components/StatusBar.d.ts +7 -1
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +18 -2
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +23 -6
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +5 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +5 -1
- package/dist/cli/ink-cli/components/overlays/ContextStatsOverlay.js +1 -1
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +8 -4
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +1 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +31 -20
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts +20 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.js +81 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts +31 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.js +297 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +8 -2
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +9 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +9 -2
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +1 -0
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +150 -34
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts +27 -0
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginActions.js +66 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.js +70 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.js +63 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +4 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +1 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +281 -39
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +10 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +87 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +4 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +4 -4
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +32 -5
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +384 -28
- package/dist/cli/ink-cli/hooks/index.d.ts +1 -0
- package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/index.js +1 -0
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +61 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +5 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts +13 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.js +35 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +53 -6
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/processStream.js +92 -12
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +5 -0
- package/dist/cli/ink-cli/state/types.d.ts +12 -1
- 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/llm-provider-display.d.ts +3 -0
- package/dist/cli/ink-cli/utils/llm-provider-display.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/llm-provider-display.js +22 -0
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +18 -7
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +143 -15
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +11 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +17 -0
- package/dist/cli/mcp/index.d.ts +8 -0
- package/dist/cli/mcp/index.d.ts.map +1 -0
- package/dist/cli/mcp/index.js +7 -0
- package/dist/cli/mcp/oauth-factory.d.ts +6 -0
- package/dist/cli/mcp/oauth-factory.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-factory.js +25 -0
- package/dist/cli/mcp/oauth-provider.d.ts +10 -0
- package/dist/cli/mcp/oauth-provider.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-provider.js +77 -0
- package/dist/cli/mcp/oauth-redirect.d.ts +3 -0
- package/dist/cli/mcp/oauth-redirect.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-redirect.js +4 -0
- package/dist/cli/mcp/oauth-server.d.ts +2 -0
- package/dist/cli/mcp/oauth-server.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-server.js +70 -0
- package/dist/cli/mcp/oauth-store.d.ts +10 -0
- package/dist/cli/mcp/oauth-store.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-store.js +27 -0
- package/dist/cli/mcp/oauth-ui.d.ts +2 -0
- package/dist/cli/mcp/oauth-ui.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-ui.js +12 -0
- package/dist/cli/mcp/oauth-utils.d.ts +2 -0
- package/dist/cli/mcp/oauth-utils.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-utils.js +17 -0
- package/dist/cli/utils/api-key-verification.d.ts.map +1 -1
- package/dist/cli/utils/api-key-verification.js +36 -0
- package/dist/cli/utils/config-validation.d.ts +3 -1
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +42 -19
- package/dist/cli/utils/dexto-auth-check.d.ts +53 -0
- package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -0
- package/dist/cli/utils/dexto-auth-check.js +104 -0
- package/dist/cli/utils/dexto-setup.d.ts +8 -0
- package/dist/cli/utils/dexto-setup.d.ts.map +1 -0
- package/dist/cli/utils/dexto-setup.js +17 -0
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +5 -1
- package/dist/cli/utils/provider-setup.d.ts +5 -1
- package/dist/cli/utils/provider-setup.d.ts.map +1 -1
- package/dist/cli/utils/provider-setup.js +29 -1
- package/dist/config/cli-overrides.d.ts +17 -8
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +36 -22
- package/dist/config/effective-llm.d.ts +123 -0
- package/dist/config/effective-llm.d.ts.map +1 -0
- package/dist/config/effective-llm.js +171 -0
- package/dist/index.js +404 -99
- package/dist/webui/assets/index-C9JXwpvo.css +1 -0
- package/dist/webui/assets/{index-DVQWNLpT.js → index-Cz2z7NQ8.js} +218 -218
- package/dist/webui/index.html +2 -2
- package/package.json +9 -8
- package/dist/webui/assets/index-BglIVTSG.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAiB7E,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACjD;AA6CD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC7B,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,YAAY,GACf,EAAE,WAAW,2CAgBb;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,kDAAkD;IAClD,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACpF,wEAAwE;IACxE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACxC;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,OAAO,GAAE,aAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAiB7E,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACjD;AA6CD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC7B,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,YAAY,GACf,EAAE,WAAW,2CAgBb;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,kDAAkD;IAClD,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACpF,wEAAwE;IACxE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACxC;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,OAAO,GAAE,aAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAsFf"}
|
|
@@ -61,7 +61,8 @@ export async function startInkCliRefactored(agent, initialSessionId, options = {
|
|
|
61
61
|
// Enable bracketed paste mode so we can detect pasted text
|
|
62
62
|
// This wraps pastes with escape sequences that our KeypressContext handles
|
|
63
63
|
enableBracketedPaste();
|
|
64
|
-
|
|
64
|
+
// The UI can render before any session is created.
|
|
65
|
+
const baseStartupInfo = await getStartupInfo(agent, initialSessionId);
|
|
65
66
|
const startupInfo = {
|
|
66
67
|
...baseStartupInfo,
|
|
67
68
|
updateInfo: options.updateInfo,
|
|
@@ -69,7 +70,7 @@ export async function startInkCliRefactored(agent, initialSessionId, options = {
|
|
|
69
70
|
};
|
|
70
71
|
// Initialize sound service from preferences
|
|
71
72
|
const { SoundNotificationService } = await import('./utils/soundNotification.js');
|
|
72
|
-
const { globalPreferencesExist, loadGlobalPreferences } = await import('@dexto/agent-management');
|
|
73
|
+
const { globalPreferencesExist, loadGlobalPreferences, agentPreferencesExist, loadAgentPreferences, } = await import('@dexto/agent-management');
|
|
73
74
|
let soundService = null;
|
|
74
75
|
// Initialize sound config with defaults (enabled by default even without preferences file)
|
|
75
76
|
let soundConfig = {
|
|
@@ -96,6 +97,16 @@ export async function startInkCliRefactored(agent, initialSessionId, options = {
|
|
|
96
97
|
if (soundConfig.enabled) {
|
|
97
98
|
soundService = new SoundNotificationService(soundConfig);
|
|
98
99
|
}
|
|
100
|
+
// Initialize tool preferences (per-agent)
|
|
101
|
+
if (agentPreferencesExist(agent.config.agentId)) {
|
|
102
|
+
try {
|
|
103
|
+
const preferences = await loadAgentPreferences(agent.config.agentId);
|
|
104
|
+
agent.setGlobalDisabledTools(preferences.tools?.disabled ?? []);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
agent.logger.debug(`Agent tool preferences could not be loaded: ${error instanceof Error ? error.message : String(error)}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
99
110
|
const inkApp = render(_jsx(InkCLIRefactored, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo, soundService: soundService }), {
|
|
100
111
|
exitOnCtrlC: false,
|
|
101
112
|
alternateBuffer: USE_ALTERNATE_BUFFER,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAM5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAM5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAgBD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kGAkY1B,CAAC"}
|
|
@@ -16,12 +16,17 @@ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCance
|
|
|
16
16
|
const isCommandConfirmation = approval.type === 'command_confirmation';
|
|
17
17
|
const isElicitation = approval.type === 'elicitation';
|
|
18
18
|
const isDirectoryAccess = approval.type === 'directory_access';
|
|
19
|
+
// Extract tool metadata
|
|
20
|
+
const toolName = approval.metadata.toolName;
|
|
21
|
+
const toolArgs = approval.metadata.args || {};
|
|
22
|
+
// Check if this is a plan_review tool (shows custom approval options)
|
|
23
|
+
const isPlanReview = toolName === 'custom--plan_review' ||
|
|
24
|
+
toolName === 'internal--plan_review' ||
|
|
25
|
+
toolName === 'plan_review';
|
|
19
26
|
// Extract suggested patterns for bash tools
|
|
20
27
|
const suggestedPatterns = approval.metadata.suggestedPatterns ?? [];
|
|
21
28
|
const hasBashPatterns = suggestedPatterns.length > 0;
|
|
22
29
|
// Check if this is an edit/write file tool
|
|
23
|
-
const toolName = approval.metadata.toolName;
|
|
24
|
-
const toolArgs = approval.metadata.args || {};
|
|
25
30
|
const isEditOrWriteTool = isEditWriteTool(toolName);
|
|
26
31
|
// Format tool header using shared utility (same format as tool messages)
|
|
27
32
|
const formattedTool = useMemo(() => {
|
|
@@ -30,13 +35,22 @@ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCance
|
|
|
30
35
|
return formatToolHeader(toolName, toolArgs);
|
|
31
36
|
}, [toolName, toolArgs]);
|
|
32
37
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
38
|
+
// State for plan review feedback input
|
|
39
|
+
const [showFeedbackInput, setShowFeedbackInput] = useState(false);
|
|
40
|
+
const [feedbackText, setFeedbackText] = useState('');
|
|
33
41
|
// Ref for elicitation form
|
|
34
42
|
const elicitationFormRef = useRef(null);
|
|
35
43
|
// Use ref to avoid stale closure issues in handleInput
|
|
36
44
|
const selectedIndexRef = useRef(0);
|
|
37
45
|
// Build the list of options based on approval type
|
|
38
46
|
const options = [];
|
|
39
|
-
if (
|
|
47
|
+
if (isPlanReview) {
|
|
48
|
+
// Plan review - show plan-specific options (2 options + feedback input)
|
|
49
|
+
options.push({ id: 'plan-approve', label: 'Approve' });
|
|
50
|
+
options.push({ id: 'plan-approve-accept-edits', label: 'Approve + Accept All Edits' });
|
|
51
|
+
// Third "option" is the feedback input (handled specially in render)
|
|
52
|
+
}
|
|
53
|
+
else if (hasBashPatterns) {
|
|
40
54
|
// Bash tool with pattern suggestions
|
|
41
55
|
options.push({ id: 'yes', label: 'Yes (once)' });
|
|
42
56
|
suggestedPatterns.forEach((pattern, i) => {
|
|
@@ -86,19 +100,61 @@ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCance
|
|
|
86
100
|
if (isElicitation && elicitationFormRef.current) {
|
|
87
101
|
return elicitationFormRef.current.handleInput(input, key);
|
|
88
102
|
}
|
|
103
|
+
// For plan review, calculate total options including feedback input
|
|
104
|
+
const totalOptions = isPlanReview ? options.length + 1 : options.length;
|
|
105
|
+
const isFeedbackSelected = isPlanReview && selectedIndexRef.current === options.length;
|
|
106
|
+
// Handle typing when feedback input is selected
|
|
107
|
+
if (isFeedbackSelected) {
|
|
108
|
+
if (key.return) {
|
|
109
|
+
// Submit rejection with feedback
|
|
110
|
+
onDeny(feedbackText || undefined);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
else if (key.backspace || key.delete) {
|
|
114
|
+
setFeedbackText((prev) => prev.slice(0, -1));
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
else if (key.upArrow) {
|
|
118
|
+
// Navigate up from feedback input
|
|
119
|
+
setSelectedIndex(options.length - 1);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
else if (key.downArrow) {
|
|
123
|
+
// Wrap to first option
|
|
124
|
+
setSelectedIndex(0);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
else if (key.escape) {
|
|
128
|
+
onCancel();
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
else if (input && !key.ctrl && !key.meta) {
|
|
132
|
+
// Add typed character to feedback
|
|
133
|
+
setFeedbackText((prev) => prev + input);
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
return true; // Consume all input when feedback is selected
|
|
137
|
+
}
|
|
89
138
|
if (key.upArrow) {
|
|
90
|
-
setSelectedIndex((current) => current === 0 ?
|
|
139
|
+
setSelectedIndex((current) => current === 0 ? totalOptions - 1 : current - 1);
|
|
91
140
|
return true;
|
|
92
141
|
}
|
|
93
142
|
else if (key.downArrow) {
|
|
94
|
-
setSelectedIndex((current) => current ===
|
|
143
|
+
setSelectedIndex((current) => current === totalOptions - 1 ? 0 : current + 1);
|
|
95
144
|
return true;
|
|
96
145
|
}
|
|
97
146
|
else if (key.return) {
|
|
98
147
|
const option = getCurrentOption();
|
|
99
148
|
if (!option)
|
|
100
149
|
return false;
|
|
101
|
-
|
|
150
|
+
// Plan review options
|
|
151
|
+
if (option.id === 'plan-approve') {
|
|
152
|
+
onApprove({});
|
|
153
|
+
}
|
|
154
|
+
else if (option.id === 'plan-approve-accept-edits') {
|
|
155
|
+
onApprove({ enableAcceptEditsMode: true });
|
|
156
|
+
}
|
|
157
|
+
else if (option.id === 'yes') {
|
|
102
158
|
onApprove({});
|
|
103
159
|
}
|
|
104
160
|
else if (option.id === 'yes-session') {
|
|
@@ -145,11 +201,13 @@ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCance
|
|
|
145
201
|
isElicitation,
|
|
146
202
|
isEditOrWriteTool,
|
|
147
203
|
isDirectoryAccess,
|
|
204
|
+
isPlanReview,
|
|
148
205
|
options,
|
|
149
206
|
suggestedPatterns,
|
|
150
207
|
onApprove,
|
|
151
208
|
onDeny,
|
|
152
209
|
onCancel,
|
|
210
|
+
feedbackText,
|
|
153
211
|
]);
|
|
154
212
|
// For elicitation, render the form
|
|
155
213
|
if (isElicitation) {
|
|
@@ -174,10 +232,16 @@ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCance
|
|
|
174
232
|
// For shell preview, just show the command (no output yet)
|
|
175
233
|
return (_jsxs(Box, { marginBottom: 1, flexDirection: "row", children: [_jsx(Text, { color: "gray", children: "$ " }), _jsx(Text, { color: "yellowBright", children: displayPreview.command }), displayPreview.isBackground && _jsx(Text, { color: "gray", children: " (background)" })] }));
|
|
176
234
|
case 'file':
|
|
177
|
-
// Use enhanced file preview with full content for
|
|
235
|
+
// Use enhanced file preview with full content for file creation
|
|
178
236
|
if (displayPreview.operation === 'create' && displayPreview.content) {
|
|
179
237
|
return _jsx(CreateFilePreview, { data: displayPreview });
|
|
180
238
|
}
|
|
239
|
+
// For plan_review (read operation with content), show full content for review
|
|
240
|
+
if (displayPreview.operation === 'read' &&
|
|
241
|
+
displayPreview.content &&
|
|
242
|
+
isPlanReview) {
|
|
243
|
+
return _jsx(CreateFilePreview, { data: displayPreview, header: "Review plan" });
|
|
244
|
+
}
|
|
181
245
|
// Fallback for other file operations
|
|
182
246
|
return (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "gray", children: [displayPreview.operation === 'read' &&
|
|
183
247
|
`Read ${displayPreview.lineCount ?? 'file'} lines`, displayPreview.operation === 'write' &&
|
|
@@ -191,10 +255,14 @@ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCance
|
|
|
191
255
|
const directoryPath = approval.metadata.path;
|
|
192
256
|
const parentDir = approval.metadata.parentDir;
|
|
193
257
|
const operation = approval.metadata.operation;
|
|
194
|
-
return (_jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [_jsx(Box, { flexDirection: "column", marginBottom: 0, children: isDirectoryAccess ? (_jsxs(_Fragment, { children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellowBright", bold: true, children: ["\uD83D\uDD10 Directory Access:", ' '] }), _jsx(Text, { color: "cyan", children: parentDir || directoryPath })] }), _jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' ' }), _jsxs(Text, { color: "gray", children: [formattedTool ? `"${formattedTool.displayName}"` : 'Tool', ' ', "wants to ", operation || 'access', " files outside working directory"] })] })] })) : (_jsxs(_Fragment, { children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellowBright", bold: true, children: ["\uD83D\uDD10 Approval:", ' '] }), formattedTool && _jsx(Text, { color: "cyan", children: formattedTool.header })] }), isCommandConfirmation && command && (_jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' Command: ' }), _jsx(Text, { color: "red", children: command })] }))] })) }), renderPreview(),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
258
|
+
return (_jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [_jsx(Box, { flexDirection: "column", marginBottom: 0, children: isDirectoryAccess ? (_jsxs(_Fragment, { children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellowBright", bold: true, children: ["\uD83D\uDD10 Directory Access:", ' '] }), _jsx(Text, { color: "cyan", children: parentDir || directoryPath })] }), _jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' ' }), _jsxs(Text, { color: "gray", children: [formattedTool ? `"${formattedTool.displayName}"` : 'Tool', ' ', "wants to ", operation || 'access', " files outside working directory"] })] })] })) : (_jsxs(_Fragment, { children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellowBright", bold: true, children: ["\uD83D\uDD10 Approval:", ' '] }), formattedTool && _jsx(Text, { color: "cyan", children: formattedTool.header })] }), isCommandConfirmation && command && (_jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' Command: ' }), _jsx(Text, { color: "red", children: command })] }))] })) }), renderPreview(), _jsxs(Box, { flexDirection: "column", marginTop: 0, children: [options.map((option, index) => {
|
|
259
|
+
const isSelected = index === selectedIndex;
|
|
260
|
+
const isNo = option.id === 'no';
|
|
261
|
+
return (_jsx(Box, { children: isSelected ? (_jsxs(Text, { color: isNo ? 'red' : 'green', bold: true, children: [' ▶ ', option.label] })) : (_jsxs(Text, { color: "gray", children: [' ', option.label] })) }, option.id));
|
|
262
|
+
}), isPlanReview && (_jsx(Box, { children: selectedIndex === options.length ? (
|
|
263
|
+
// Selected - show editable input
|
|
264
|
+
_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: "red", bold: true, children: ' ▶ ' }), feedbackText ? (_jsxs(Text, { color: "white", children: [feedbackText, _jsx(Text, { color: "cyan", children: "\u258B" })] })) : (_jsxs(Text, { color: "gray", children: ["What changes would you like?", _jsx(Text, { color: "cyan", children: "\u258B" })] }))] })) : (
|
|
265
|
+
// Not selected - show placeholder
|
|
266
|
+
_jsxs(Text, { color: "gray", children: [' ', feedbackText || 'What changes would you like?'] })) }))] }), _jsx(Box, { marginTop: 0, children: _jsxs(Text, { color: "gray", children: [' ', "\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"] }) })] }));
|
|
199
267
|
});
|
|
200
268
|
ApprovalPrompt.displayName = 'ApprovalPrompt';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BackgroundTasksPanel Component
|
|
3
|
+
*
|
|
4
|
+
* Displays background task status in a compact table.
|
|
5
|
+
*/
|
|
6
|
+
interface BackgroundTaskItem {
|
|
7
|
+
taskId: string;
|
|
8
|
+
status: 'running' | 'completed' | 'failed' | 'cancelled';
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
interface BackgroundTasksPanelProps {
|
|
12
|
+
tasks: BackgroundTaskItem[];
|
|
13
|
+
isExpanded: boolean;
|
|
14
|
+
isProcessing?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function BackgroundTasksPanel({ tasks, isExpanded, isProcessing, }: BackgroundTasksPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=BackgroundTasksPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackgroundTasksPanel.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/BackgroundTasksPanel.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,UAAU,kBAAkB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,yBAAyB;IAC/B,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAsBD,wBAAgB,oBAAoB,CAAC,EACjC,KAAK,EACL,UAAU,EACV,YAAoB,GACvB,EAAE,yBAAyB,kDA+E3B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
function padText(value, width) {
|
|
4
|
+
if (value.length >= width)
|
|
5
|
+
return value.slice(0, width - 1) + '…';
|
|
6
|
+
return value.padEnd(width, ' ');
|
|
7
|
+
}
|
|
8
|
+
function formatStatus(status) {
|
|
9
|
+
switch (status) {
|
|
10
|
+
case 'running':
|
|
11
|
+
return 'running';
|
|
12
|
+
case 'completed':
|
|
13
|
+
return 'done';
|
|
14
|
+
case 'failed':
|
|
15
|
+
return 'failed';
|
|
16
|
+
case 'cancelled':
|
|
17
|
+
return 'cancelled';
|
|
18
|
+
default:
|
|
19
|
+
return status;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function BackgroundTasksPanel({ tasks, isExpanded, isProcessing = false, }) {
|
|
23
|
+
if (!isExpanded)
|
|
24
|
+
return null;
|
|
25
|
+
const sortedTasks = [...tasks].sort((a, b) => {
|
|
26
|
+
if (a.status === b.status)
|
|
27
|
+
return 0;
|
|
28
|
+
if (a.status === 'running')
|
|
29
|
+
return -1;
|
|
30
|
+
if (b.status === 'running')
|
|
31
|
+
return 1;
|
|
32
|
+
return a.status.localeCompare(b.status);
|
|
33
|
+
});
|
|
34
|
+
const runningCount = tasks.filter((task) => task.status === 'running').length;
|
|
35
|
+
const totalCount = tasks.length;
|
|
36
|
+
const headerText = `🧵 Background Tasks (${runningCount}/${totalCount} running)`;
|
|
37
|
+
if (totalCount === 0) {
|
|
38
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: isProcessing ? undefined : 'round', borderColor: "gray", paddingX: 1, marginX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: headerText }), _jsx(Text, { color: "gray", dimColor: true, children: "No background tasks" })] }));
|
|
39
|
+
}
|
|
40
|
+
const statusWidth = 10;
|
|
41
|
+
const idWidth = 14;
|
|
42
|
+
const descWidth = 48;
|
|
43
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: isProcessing ? undefined : 'round', borderColor: "gray", paddingX: 1, marginX: 1, marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: "cyan", children: headerText }), _jsxs(Text, { color: "gray", dimColor: true, children: [' ', "\u00B7 ctrl+b to hide tasks"] })] }), _jsx(Box, { children: _jsxs(Text, { color: "gray", children: [padText('status', statusWidth), padText('task id', idWidth), padText('description', descWidth)] }) }), sortedTasks.map((task) => {
|
|
44
|
+
const status = formatStatus(task.status);
|
|
45
|
+
const desc = task.description ?? '';
|
|
46
|
+
return (_jsx(Box, { children: _jsxs(Text, { color: task.status === 'running' ? 'yellow' : 'gray', children: [padText(status, statusWidth), padText(task.taskId, idWidth), padText(desc, descWidth)] }) }, task.taskId));
|
|
47
|
+
})] }));
|
|
48
|
+
}
|
|
@@ -22,7 +22,7 @@ export class ErrorBoundary extends React.Component {
|
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
24
|
if (this.state.hasError) {
|
|
25
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [_jsx(Text, { color: "red", bold: true, children: "
|
|
25
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [_jsx(Text, { color: "red", bold: true, children: "CLI Error" }), _jsx(Text, { color: "red", children: this.state.error?.message || 'Unknown error' }), _jsx(Text, { color: "yellowBright", children: "Press Ctrl+C to exit" })] }));
|
|
26
26
|
}
|
|
27
27
|
return this.props.children;
|
|
28
28
|
}
|
|
@@ -10,12 +10,13 @@ interface FooterProps {
|
|
|
10
10
|
cwd?: string;
|
|
11
11
|
branchName?: string;
|
|
12
12
|
autoApproveEdits?: boolean;
|
|
13
|
+
planModeActive?: boolean;
|
|
13
14
|
/** Whether user is in shell command mode (input starts with !) */
|
|
14
15
|
isShellMode?: boolean;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Pure presentational component for footer status line
|
|
18
19
|
*/
|
|
19
|
-
export declare function Footer({ agent, sessionId, modelName, cwd, branchName, autoApproveEdits, isShellMode, }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function Footer({ agent, sessionId, modelName, cwd, branchName, autoApproveEdits, planModeActive, isShellMode, }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
21
22
|
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/Footer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/Footer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGnE,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,SAAS,EACT,SAAS,EACT,GAAG,EACH,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,GACd,EAAE,WAAW,2CAiHb"}
|
|
@@ -7,6 +7,7 @@ import { useEffect, useState } from 'react';
|
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { Box, Text } from 'ink';
|
|
9
9
|
import { getModelDisplayName } from '@dexto/core';
|
|
10
|
+
import { getLLMProviderDisplayName } from '../utils/llm-provider-display.js';
|
|
10
11
|
function getDirectoryName(cwd) {
|
|
11
12
|
const base = path.basename(cwd);
|
|
12
13
|
return base || cwd;
|
|
@@ -14,10 +15,13 @@ function getDirectoryName(cwd) {
|
|
|
14
15
|
/**
|
|
15
16
|
* Pure presentational component for footer status line
|
|
16
17
|
*/
|
|
17
|
-
export function Footer({ agent, sessionId, modelName, cwd, branchName, autoApproveEdits, isShellMode, }) {
|
|
18
|
+
export function Footer({ agent, sessionId, modelName, cwd, branchName, autoApproveEdits, planModeActive, isShellMode, }) {
|
|
18
19
|
const displayPath = cwd ? getDirectoryName(cwd) : '';
|
|
19
20
|
const displayModelName = getModelDisplayName(modelName);
|
|
20
21
|
const [contextLeft, setContextLeft] = useState(null);
|
|
22
|
+
// Provider is session-scoped because /model can switch LLM per session.
|
|
23
|
+
const provider = sessionId ? agent.getCurrentLLMConfig(sessionId).provider : null;
|
|
24
|
+
const providerLabel = provider ? getLLMProviderDisplayName(provider) : null;
|
|
21
25
|
useEffect(() => {
|
|
22
26
|
if (!sessionId) {
|
|
23
27
|
setContextLeft(null);
|
|
@@ -69,5 +73,5 @@ export function Footer({ agent, sessionId, modelName, cwd, branchName, autoAppro
|
|
|
69
73
|
}, [agent, sessionId]);
|
|
70
74
|
// Shell mode changes the path color to yellow as indicator
|
|
71
75
|
const pathColor = isShellMode ? 'yellow' : 'blue';
|
|
72
|
-
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: pathColor, children: displayPath }), branchName && _jsxs(Text, { color: "gray", children: [" (", branchName, ")"] })] }), _jsx(Text, { color: "cyan", children: displayModelName })] }), contextLeft && (_jsx(Box, { children: _jsxs(Text, { color: "gray", children: [contextLeft.percentLeft, "% context left"] }) })), isShellMode && (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", bold: true, children: "!" }), _jsx(Text, { color: "gray", children: " for shell mode" })] })), autoApproveEdits && !isShellMode && (_jsxs(Box, { children: [_jsx(Text, { color: "yellowBright", children: "accept edits" }), _jsx(Text, { color: "gray", children: " (shift + tab to
|
|
76
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: pathColor, children: displayPath }), branchName && _jsxs(Text, { color: "gray", children: [" (", branchName, ")"] })] }), _jsxs(Box, { children: [_jsx(Text, { color: "cyan", children: displayModelName }), providerLabel && _jsxs(Text, { color: "gray", children: [" (", providerLabel, ")"] })] })] }), contextLeft && (_jsx(Box, { children: _jsxs(Text, { color: "gray", children: [contextLeft.percentLeft, "% context left"] }) })), isShellMode && (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", bold: true, children: "!" }), _jsx(Text, { color: "gray", children: " for shell mode" })] })), planModeActive && !isShellMode && (_jsxs(Box, { children: [_jsx(Text, { color: "magentaBright", children: "plan mode" }), _jsx(Text, { color: "gray", children: " (shift + tab to cycle)" })] })), autoApproveEdits && !planModeActive && !isShellMode && (_jsxs(Box, { children: [_jsx(Text, { color: "yellowBright", children: "accept edits" }), _jsx(Text, { color: "gray", children: " (shift + tab to cycle)" })] }))] }));
|
|
73
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceAutocomplete.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ResourceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceAutocomplete.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ResourceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED,UAAU,yBAAyB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACvD,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;CACrB;AAsFD;;GAEG;AACH,QAAA,MAAM,yBAAyB,8GA6W9B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,oBAAoB,EAErB,OAAO,yBAAyB,CAAC;AAEtC,eAAe,oBAAoB,CAAC"}
|