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
package/dist/api/server-hono.js
CHANGED
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
|
-
import {
|
|
3
|
-
import { loadAgentConfig,
|
|
2
|
+
import { createAgentCard, logger, AgentError } from '@dexto/core';
|
|
3
|
+
import { loadAgentConfig, deriveDisplayName, getAgentRegistry, AgentFactory, globalPreferencesExist, loadGlobalPreferences, createDextoAgentFromConfig, } from '@dexto/agent-management';
|
|
4
4
|
import { applyUserPreferences } from '../config/cli-overrides.js';
|
|
5
|
+
import { createFileSessionLoggerFactory } from '../utils/session-logger-factory.js';
|
|
5
6
|
import { createDextoApp, createNodeServer, createMcpTransport as createServerMcpTransport, createMcpHttpHandlers, initializeMcpServer as initializeServerMcpServer, createManualApprovalHandler, WebhookEventSubscriber, A2ASseEventSubscriber, ApprovalCoordinator, } from '@dexto/server';
|
|
6
7
|
import { registerGracefulShutdown } from '../utils/graceful-shutdown.js';
|
|
7
8
|
const DEFAULT_AGENT_VERSION = '1.0.0';
|
|
8
|
-
|
|
9
|
-
* Load image dynamically based on config and environment
|
|
10
|
-
* Priority: Config image field > Environment variable > Default
|
|
11
|
-
* Images are optional, but default to image-local for convenience
|
|
12
|
-
*
|
|
13
|
-
* @returns Image metadata including bundled plugins, or null if image has no metadata export
|
|
14
|
-
*/
|
|
15
|
-
async function loadImageForConfig(config) {
|
|
16
|
-
const imageName = config.image || process.env.DEXTO_IMAGE || '@dexto/image-local';
|
|
17
|
-
try {
|
|
18
|
-
const imageModule = await import(imageName);
|
|
19
|
-
logger.debug(`Loaded image: ${imageName}`);
|
|
20
|
-
// Extract metadata if available (built images export imageMetadata)
|
|
21
|
-
if (imageModule.imageMetadata) {
|
|
22
|
-
return imageModule.imageMetadata;
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
const errorMsg = `Failed to load image '${imageName}': ${err instanceof Error ? err.message : String(err)}`;
|
|
28
|
-
logger.error(errorMsg);
|
|
29
|
-
throw new Error(errorMsg);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
9
|
+
const sessionLoggerFactory = createFileSessionLoggerFactory();
|
|
32
10
|
/**
|
|
33
11
|
* List all agents (installed and available)
|
|
34
12
|
* Replacement for old Dexto.listAgents()
|
|
@@ -71,16 +49,13 @@ async function createAgentFromId(agentId) {
|
|
|
71
49
|
logger.debug('Could not load preferences, using bundled config');
|
|
72
50
|
}
|
|
73
51
|
}
|
|
74
|
-
// Load image to get bundled plugins
|
|
75
|
-
const imageMetadata = await loadImageForConfig(config);
|
|
76
|
-
// Enrich config with per-agent paths and bundled plugins
|
|
77
|
-
const enrichedConfig = enrichAgentConfig(config, agentPath, {
|
|
78
|
-
logLevel: 'info', // Server uses info-level logging for visibility
|
|
79
|
-
bundledPlugins: imageMetadata?.bundledPlugins || [],
|
|
80
|
-
});
|
|
81
|
-
// Create agent instance
|
|
82
52
|
logger.info(`Creating agent: ${agentId} from ${agentPath}`);
|
|
83
|
-
return
|
|
53
|
+
return await createDextoAgentFromConfig({
|
|
54
|
+
config,
|
|
55
|
+
configPath: agentPath,
|
|
56
|
+
enrichOptions: { logLevel: 'info' },
|
|
57
|
+
overrides: { sessionLoggerFactory },
|
|
58
|
+
});
|
|
84
59
|
}
|
|
85
60
|
catch (error) {
|
|
86
61
|
throw new Error(`Failed to create agent '${agentId}': ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -97,10 +72,11 @@ function resolveBaseUrl(port) {
|
|
|
97
72
|
return process.env.DEXTO_BASE_URL ?? `http://localhost:${port}`;
|
|
98
73
|
}
|
|
99
74
|
//TODO (migration): consider moving this to the server package
|
|
100
|
-
export async function initializeHonoApi(agent, agentCardOverride, listenPort, agentId, webRoot, webUIConfig) {
|
|
75
|
+
export async function initializeHonoApi(agent, agentCardOverride, listenPort, agentId, configFilePath, webRoot, webUIConfig) {
|
|
101
76
|
// Declare before registering shutdown hook to avoid TDZ on signals
|
|
102
77
|
let activeAgent = agent;
|
|
103
78
|
let activeAgentId = agentId || 'coding-agent';
|
|
79
|
+
let activeAgentConfigPath = configFilePath;
|
|
104
80
|
let isSwitchingAgent = false;
|
|
105
81
|
registerGracefulShutdown(() => activeAgent);
|
|
106
82
|
const resolvedPort = resolvePort(listenPort);
|
|
@@ -123,9 +99,9 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
123
99
|
*/
|
|
124
100
|
async function wireServicesToAgent(agent) {
|
|
125
101
|
logger.debug('Wiring services to agent...');
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
102
|
+
// Register subscribers (DextoAgent handles (re-)subscription on start/restart)
|
|
103
|
+
agent.registerSubscriber(webhookSubscriber);
|
|
104
|
+
agent.registerSubscriber(sseSubscriber);
|
|
129
105
|
// Note: ApprovalCoordinator doesn't subscribe to agent event bus
|
|
130
106
|
// It's a separate coordination channel between handler and server
|
|
131
107
|
}
|
|
@@ -161,7 +137,7 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
161
137
|
/**
|
|
162
138
|
* Common agent switching logic shared by switchAgentById and switchAgentByPath.
|
|
163
139
|
*/
|
|
164
|
-
async function performAgentSwitch(newAgent, agentId, bridge) {
|
|
140
|
+
async function performAgentSwitch(newAgent, agentId, agentConfigPath, bridge) {
|
|
165
141
|
logger.info('Preparing new agent for switch...');
|
|
166
142
|
// Register webhook subscriber for LLM streaming events
|
|
167
143
|
if (bridge.webhookSubscriber) {
|
|
@@ -171,9 +147,9 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
171
147
|
const previousAgent = activeAgent;
|
|
172
148
|
activeAgent = newAgent;
|
|
173
149
|
activeAgentId = agentId;
|
|
150
|
+
activeAgentConfigPath = agentConfigPath;
|
|
174
151
|
// Set approval handler if manual mode OR elicitation enabled (before start() for validation)
|
|
175
|
-
const needsHandler = newAgent.config.
|
|
176
|
-
newAgent.config.elicitation.enabled;
|
|
152
|
+
const needsHandler = newAgent.config.permissions.mode === 'manual' || newAgent.config.elicitation.enabled;
|
|
177
153
|
if (needsHandler) {
|
|
178
154
|
logger.debug('Setting up manual approval handler for new agent...');
|
|
179
155
|
const handler = createManualApprovalHandler(approvalCoordinator);
|
|
@@ -210,15 +186,18 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
210
186
|
}
|
|
211
187
|
isSwitchingAgent = true;
|
|
212
188
|
let newAgent;
|
|
189
|
+
let newAgentConfigPath;
|
|
213
190
|
try {
|
|
214
191
|
// 1. SHUTDOWN OLD TELEMETRY FIRST (before creating new agent)
|
|
215
192
|
logger.info('Shutting down telemetry for agent switch...');
|
|
216
193
|
const { Telemetry } = await import('@dexto/core');
|
|
217
194
|
await Telemetry.shutdownGlobal();
|
|
218
195
|
// 2. Create new agent from registry (will initialize fresh telemetry in createAgentServices)
|
|
196
|
+
const registry = getAgentRegistry();
|
|
197
|
+
newAgentConfigPath = await registry.resolveAgent(agentId, true);
|
|
219
198
|
newAgent = await createAgentFromId(agentId);
|
|
220
199
|
// 3. Use common switch logic (register subscribers, start agent, stop previous)
|
|
221
|
-
return await performAgentSwitch(newAgent, agentId, bridge);
|
|
200
|
+
return await performAgentSwitch(newAgent, agentId, newAgentConfigPath, bridge);
|
|
222
201
|
}
|
|
223
202
|
catch (error) {
|
|
224
203
|
logger.error(`Failed to switch to agent '${agentId}': ${error instanceof Error ? error.message : String(error)}`, { error });
|
|
@@ -264,20 +243,17 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
264
243
|
logger.debug('Could not load preferences, using bundled config');
|
|
265
244
|
}
|
|
266
245
|
}
|
|
267
|
-
// 3.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
logLevel: 'info',
|
|
272
|
-
|
|
246
|
+
// 3. Create new agent instance (will initialize fresh telemetry in createAgentServices)
|
|
247
|
+
newAgent = await createDextoAgentFromConfig({
|
|
248
|
+
config,
|
|
249
|
+
configPath: filePath,
|
|
250
|
+
enrichOptions: { logLevel: 'info' },
|
|
251
|
+
overrides: { sessionLoggerFactory },
|
|
273
252
|
});
|
|
274
|
-
// 4.
|
|
275
|
-
|
|
276
|
-
// 5. Use
|
|
277
|
-
|
|
278
|
-
const agentId = enrichedConfig.agentId;
|
|
279
|
-
// 6. Use common switch logic (register subscribers, start agent, stop previous)
|
|
280
|
-
return await performAgentSwitch(newAgent, agentId, bridge);
|
|
253
|
+
// 4. Use enriched agentId (derived from config or filename during enrichment)
|
|
254
|
+
const agentId = newAgent.config.agentId;
|
|
255
|
+
// 5. Use common switch logic (register subscribers, start agent, stop previous)
|
|
256
|
+
return await performAgentSwitch(newAgent, agentId, filePath, bridge);
|
|
281
257
|
}
|
|
282
258
|
catch (error) {
|
|
283
259
|
logger.error(`Failed to switch to agent from path '${filePath}': ${error instanceof Error ? error.message : String(error)}`, { error });
|
|
@@ -306,12 +282,14 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
306
282
|
return activeAgent;
|
|
307
283
|
};
|
|
308
284
|
const getAgentCard = () => agentCardData;
|
|
285
|
+
const getAgentConfigPath = (_ctx) => activeAgentConfigPath;
|
|
309
286
|
// Declare bridge variable that will be set later
|
|
310
287
|
let bridgeRef = null;
|
|
311
288
|
// Create app with agentsContext using closure
|
|
312
289
|
const app = createDextoApp({
|
|
313
290
|
apiPrefix: '/api',
|
|
314
291
|
getAgent,
|
|
292
|
+
getAgentConfigPath,
|
|
315
293
|
getAgentCard,
|
|
316
294
|
approvalCoordinator,
|
|
317
295
|
webhookSubscriber,
|
|
@@ -361,8 +339,7 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
361
339
|
defaultBaseUrl: baseApiUrl,
|
|
362
340
|
}, overrides);
|
|
363
341
|
// Set approval handler for initial agent if manual mode OR elicitation enabled (before start() for validation)
|
|
364
|
-
const needsHandler = activeAgent.config.
|
|
365
|
-
activeAgent.config.elicitation.enabled;
|
|
342
|
+
const needsHandler = activeAgent.config.permissions.mode === 'manual' || activeAgent.config.elicitation.enabled;
|
|
366
343
|
if (needsHandler) {
|
|
367
344
|
logger.debug('Setting up manual approval handler for initial agent...');
|
|
368
345
|
const handler = createManualApprovalHandler(approvalCoordinator);
|
|
@@ -399,8 +376,8 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
399
376
|
getActiveAgentId: () => activeAgentId,
|
|
400
377
|
};
|
|
401
378
|
}
|
|
402
|
-
export async function startHonoApiServer(agent, port = 3000, agentCardOverride, agentId, webRoot, webUIConfig) {
|
|
403
|
-
const { server, webhookSubscriber } = await initializeHonoApi(agent, agentCardOverride, port, agentId, webRoot, webUIConfig);
|
|
379
|
+
export async function startHonoApiServer(agent, port = 3000, agentCardOverride, agentId, configFilePath, webRoot, webUIConfig) {
|
|
380
|
+
const { server, webhookSubscriber } = await initializeHonoApi(agent, agentCardOverride, port, agentId, configFilePath, webRoot, webUIConfig);
|
|
404
381
|
server.listen(port, '0.0.0.0', () => {
|
|
405
382
|
const networkInterfaces = os.networkInterfaces();
|
|
406
383
|
let localIp = 'localhost';
|
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
* 2. User responds in TUI → EventBus emits 'approval:response' → Handler resolves
|
|
12
12
|
* 3. For auto-approvals (parallel tools), handler emits 'approval:response' → TUI dismisses
|
|
13
13
|
*/
|
|
14
|
-
import type { ApprovalHandler,
|
|
14
|
+
import type { ApprovalHandler, AgentEventMap } from '@dexto/core';
|
|
15
|
+
type ApprovalEventBus = {
|
|
16
|
+
on: <K extends keyof AgentEventMap>(event: K, listener: AgentEventMap[K] extends void ? () => void : (payload: AgentEventMap[K]) => void, options?: {
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}) => void;
|
|
19
|
+
emit: <K extends keyof AgentEventMap>(event: K, ...args: AgentEventMap[K] extends void ? [] : [AgentEventMap[K]]) => boolean;
|
|
20
|
+
};
|
|
15
21
|
/**
|
|
16
22
|
* Creates a manual approval handler for CLI mode that uses AgentEventBus directly.
|
|
17
23
|
*
|
|
@@ -20,9 +26,10 @@ import type { ApprovalHandler, AgentEventBus } from '@dexto/core';
|
|
|
20
26
|
*
|
|
21
27
|
* @example
|
|
22
28
|
* ```typescript
|
|
23
|
-
* const handler = createCLIApprovalHandler(agent
|
|
29
|
+
* const handler = createCLIApprovalHandler(agent);
|
|
24
30
|
* agent.setApprovalHandler(handler);
|
|
25
31
|
* ```
|
|
26
32
|
*/
|
|
27
|
-
export declare function createCLIApprovalHandler(eventBus:
|
|
33
|
+
export declare function createCLIApprovalHandler(eventBus: ApprovalEventBus): ApprovalHandler;
|
|
34
|
+
export {};
|
|
28
35
|
//# sourceMappingURL=cli-approval-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-approval-handler.d.ts","sourceRoot":"","sources":["../../../src/cli/approval/cli-approval-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACR,eAAe,EAGf,aAAa,EAChB,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"cli-approval-handler.d.ts","sourceRoot":"","sources":["../../../src/cli/approval/cli-approval-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACR,eAAe,EAGf,aAAa,EAChB,MAAM,aAAa,CAAC;AAGrB,KAAK,gBAAgB,GAAG;IACpB,EAAE,EAAE,CAAC,CAAC,SAAS,MAAM,aAAa,EAC9B,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,EAC1F,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KACjC,IAAI,CAAC;IACV,IAAI,EAAE,CAAC,CAAC,SAAS,MAAM,aAAa,EAChC,KAAK,EAAE,CAAC,EACR,GAAG,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAC/D,OAAO,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,eAAe,CAyJpF"}
|
|
@@ -20,7 +20,7 @@ import { ApprovalStatus, DenialReason } from '@dexto/core';
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* const handler = createCLIApprovalHandler(agent
|
|
23
|
+
* const handler = createCLIApprovalHandler(agent);
|
|
24
24
|
* agent.setApprovalHandler(handler);
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Sound sources / licensing
|
|
2
|
+
|
|
3
|
+
This folder contains built-in sounds shipped with the Dexto CLI.
|
|
4
|
+
|
|
5
|
+
Note: Some defaults are provided by the OS (e.g., macOS system sounds) and are not included here.
|
|
6
|
+
|
|
7
|
+
## Third-party sources
|
|
8
|
+
|
|
9
|
+
### `coin.wav`
|
|
10
|
+
|
|
11
|
+
- Source: “Coins 1” by AceOfSpadesProduc100 (Freesound sound ID `341695`)
|
|
12
|
+
- License: Creative Commons Attribution 4.0 (CC BY 4.0)
|
|
13
|
+
- URL: https://freesound.org/s/341695/
|
|
14
|
+
- Changes: none
|
|
15
|
+
|
|
16
|
+
### `startup.wav`
|
|
17
|
+
|
|
18
|
+
- Source: “Game Boy Classic - Startup Sound” by toumas (Freesound sound ID `610484`)
|
|
19
|
+
- License: Creative Commons 0 (CC0)
|
|
20
|
+
- URL: https://freesound.org/s/610484/
|
|
21
|
+
- Changes: trimmed/processed for CLI use
|
|
22
|
+
|
|
23
|
+
### `boot.wav`, `ping.wav`, `win.wav`
|
|
24
|
+
|
|
25
|
+
- Source pack: “Game Audio - UI SFX” by GameAudio (Freesound pack ID `13940`)
|
|
26
|
+
- License: Creative Commons 0 (CC0)
|
|
27
|
+
- Pack URL: https://freesound.org/people/GameAudio/packs/13940/
|
|
28
|
+
- Original sound IDs:
|
|
29
|
+
- `boot.wav`: `220207`
|
|
30
|
+
- `ping.wav`: `220212`
|
|
31
|
+
- `win.wav`: `220184`
|
|
32
|
+
|
|
33
|
+
## First-party
|
|
34
|
+
|
|
35
|
+
Other sounds in this folder were created for Dexto.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
type AppType = 'script' | 'webapp';
|
|
2
2
|
export interface CreateAppOptions {
|
|
3
|
-
fromImage?: string;
|
|
4
|
-
fromCore?: boolean;
|
|
5
3
|
type?: AppType;
|
|
6
4
|
}
|
|
7
5
|
/**
|
|
8
|
-
* Creates a Dexto application
|
|
9
|
-
* - from-image: Use existing image (recommended)
|
|
10
|
-
* - from-core: Build from @dexto/core with custom providers (advanced)
|
|
11
|
-
*
|
|
12
|
-
* Note: To create a new image that extends another image, use `dexto create-image` instead.
|
|
13
|
-
*
|
|
14
|
-
* @param name - Optional name of the app project
|
|
15
|
-
* @param options - Optional flags to specify mode and base image
|
|
16
|
-
* @returns The absolute path to the created project directory
|
|
6
|
+
* Creates a Dexto application that runs an agent using programmatic configuration.
|
|
17
7
|
*/
|
|
18
8
|
export declare function createDextoProject(name?: string, options?: CreateAppOptions): Promise<string>;
|
|
19
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/create-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/create-app.ts"],"names":[],"mappings":"AA2BA,KAAK,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACpC,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,gBAAgB,GAC3B,OAAO,CAAC,MAAM,CAAC,CA6DjB"}
|