erosolar-cli 1.7.369 → 1.7.371
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/dist/contracts/agent-schemas.json +11 -1
- package/dist/shell/interactiveShell.d.ts +7 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +155 -3
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +1 -0
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +35 -10
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/tools/localExplore.d.ts.map +1 -1
- package/dist/tools/localExplore.js +8 -12
- package/dist/tools/localExplore.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +9 -3
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +202 -46
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/shortcutsHelp.d.ts.map +1 -1
- package/dist/ui/shortcutsHelp.js +19 -14
- package/dist/ui/shortcutsHelp.js.map +1 -1
- package/package.json +1 -1
|
@@ -303,6 +303,11 @@
|
|
|
303
303
|
],
|
|
304
304
|
|
|
305
305
|
"slashCommands": [
|
|
306
|
+
{
|
|
307
|
+
"command": "/help",
|
|
308
|
+
"description": "Show all available commands and keyboard shortcuts",
|
|
309
|
+
"category": "other"
|
|
310
|
+
},
|
|
306
311
|
{
|
|
307
312
|
"command": "/model",
|
|
308
313
|
"description": "Choose what model to use",
|
|
@@ -320,7 +325,12 @@
|
|
|
320
325
|
},
|
|
321
326
|
{
|
|
322
327
|
"command": "/tools",
|
|
323
|
-
"description": "Enable or disable CLI tools",
|
|
328
|
+
"description": "Enable or disable CLI tools and MCP servers",
|
|
329
|
+
"category": "configuration"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"command": "/mcp",
|
|
333
|
+
"description": "Manage MCP (Model Context Protocol) server connections",
|
|
324
334
|
"category": "configuration"
|
|
325
335
|
},
|
|
326
336
|
{
|
|
@@ -89,6 +89,7 @@ export declare class InteractiveShell {
|
|
|
89
89
|
private streamingHeartbeatStart;
|
|
90
90
|
private streamingHeartbeatFrame;
|
|
91
91
|
private streamingStatusLabel;
|
|
92
|
+
private lastStreamingElapsedSeconds;
|
|
92
93
|
private statusLineState;
|
|
93
94
|
private statusMessageOverride;
|
|
94
95
|
private promptRefreshTimer;
|
|
@@ -266,6 +267,7 @@ export declare class InteractiveShell {
|
|
|
266
267
|
private showToolsMenu;
|
|
267
268
|
private renderToolMenu;
|
|
268
269
|
private formatToolOptionLine;
|
|
270
|
+
private showMcpStatus;
|
|
269
271
|
private showAgentsMenu;
|
|
270
272
|
private formatAgentOptionLine;
|
|
271
273
|
private handleModelProviderSelection;
|
|
@@ -324,6 +326,11 @@ export declare class InteractiveShell {
|
|
|
324
326
|
* Ensures the input area is visible and ready for input, just like on startup.
|
|
325
327
|
*/
|
|
326
328
|
private resetChatBoxAfterModelSwap;
|
|
329
|
+
/**
|
|
330
|
+
* Register a global AI enhancer for the explore tool.
|
|
331
|
+
* This enables AI-enhanced codebase exploration using the active model.
|
|
332
|
+
*/
|
|
333
|
+
private registerExploreAIEnhancer;
|
|
327
334
|
private buildSystemPrompt;
|
|
328
335
|
private buildThinkingDirective;
|
|
329
336
|
private buildDisplayMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactiveShell.d.ts","sourceRoot":"","sources":["../../src/shell/interactiveShell.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAiCtE,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAyB,KAAK,uBA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,KAAK,CAAC;QACjC,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,GAAG,IAAI;IAIT;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAG7B"}
|
|
@@ -13,6 +13,7 @@ import { buildInteractiveSystemPrompt } from './systemPrompt.js';
|
|
|
13
13
|
import { getTaskCompletionDetector, resetTaskCompletionDetector, } from './taskCompletionDetector.js';
|
|
14
14
|
import { discoverAllModels, quickCheckProviders, getCachedDiscoveredModels, sortModelsByPriority } from '../core/modelDiscovery.js';
|
|
15
15
|
import { getModels, getSlashCommands, getProviders } from '../core/agentSchemaLoader.js';
|
|
16
|
+
import { loadMcpServers } from '../mcp/config.js';
|
|
16
17
|
import { clearAutosaveSnapshot, deleteSession, listSessions, loadAutosaveSnapshot, loadSessionById, saveAutosaveSnapshot, saveSessionSnapshot, } from '../core/sessionStore.js';
|
|
17
18
|
import { buildCustomCommandPrompt, loadCustomSlashCommands, } from '../core/customCommands.js';
|
|
18
19
|
import { SkillRepository } from '../skills/skillRepository.js';
|
|
@@ -26,6 +27,8 @@ import { renderSessionFrame } from '../ui/unified/layout.js';
|
|
|
26
27
|
import { isUpdateInProgress, maybeOfferCliUpdate } from './updateManager.js';
|
|
27
28
|
import { writeLock } from '../ui/writeLock.js';
|
|
28
29
|
import { enterStreamingMode, exitStreamingMode } from '../ui/globalWriteLock.js';
|
|
30
|
+
import { setGlobalAIEnhancer } from '../tools/localExplore.js';
|
|
31
|
+
import { createProvider } from '../providers/providerFactory.js';
|
|
29
32
|
const execAsync = promisify(exec);
|
|
30
33
|
const DROPDOWN_COLORS = [
|
|
31
34
|
theme.primary,
|
|
@@ -130,6 +133,7 @@ export class InteractiveShell {
|
|
|
130
133
|
streamingHeartbeatStart = null;
|
|
131
134
|
streamingHeartbeatFrame = 0;
|
|
132
135
|
streamingStatusLabel = null;
|
|
136
|
+
lastStreamingElapsedSeconds = null; // Preserve final elapsed time
|
|
133
137
|
statusLineState = null;
|
|
134
138
|
statusMessageOverride = null;
|
|
135
139
|
promptRefreshTimer = null;
|
|
@@ -587,6 +591,8 @@ export class InteractiveShell {
|
|
|
587
591
|
this.uiUpdates.dispose();
|
|
588
592
|
this.clearPromptRefreshTimer();
|
|
589
593
|
this.teardownStatusTracking();
|
|
594
|
+
// Clear global AI enhancer (explore tool will work offline after this)
|
|
595
|
+
setGlobalAIEnhancer(null);
|
|
590
596
|
// Clear any pending cleanup to prevent hanging
|
|
591
597
|
this.pendingCleanup = null;
|
|
592
598
|
// Reset terminal state before disposing adapters
|
|
@@ -857,9 +863,20 @@ export class InteractiveShell {
|
|
|
857
863
|
const statusText = this.formatStatusLine(this.statusLineState);
|
|
858
864
|
this.terminalInput.setStatusMessage(statusText);
|
|
859
865
|
// Surface meta header (elapsed + context usage) above the divider
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
866
|
+
// Use streaming elapsed time if available, otherwise fall back to status line state
|
|
867
|
+
let elapsedSeconds = null;
|
|
868
|
+
if (this.streamingHeartbeatStart) {
|
|
869
|
+
// Actively streaming - compute live elapsed
|
|
870
|
+
elapsedSeconds = Math.max(0, Math.floor((Date.now() - this.streamingHeartbeatStart) / 1000));
|
|
871
|
+
}
|
|
872
|
+
else if (this.lastStreamingElapsedSeconds !== null) {
|
|
873
|
+
// Just finished streaming - use preserved final time
|
|
874
|
+
elapsedSeconds = this.lastStreamingElapsedSeconds;
|
|
875
|
+
}
|
|
876
|
+
else if (this.statusLineState) {
|
|
877
|
+
// Fallback to status line state elapsed
|
|
878
|
+
elapsedSeconds = Math.max(0, Math.floor((Date.now() - this.statusLineState.startedAt) / 1000));
|
|
879
|
+
}
|
|
863
880
|
const thinkingMs = display.isSpinnerActive() ? display.getThinkingElapsedMs() : null;
|
|
864
881
|
const tokensUsed = this.latestTokenUsage.used;
|
|
865
882
|
const tokenLimit = this.latestTokenUsage.limit ?? this.activeContextWindowTokens;
|
|
@@ -998,6 +1015,10 @@ export class InteractiveShell {
|
|
|
998
1015
|
stopStreamingHeartbeat() {
|
|
999
1016
|
// Exit global streaming mode - allows UI to render again
|
|
1000
1017
|
exitStreamingMode();
|
|
1018
|
+
// Preserve final elapsed time before clearing heartbeat start
|
|
1019
|
+
if (this.streamingHeartbeatStart) {
|
|
1020
|
+
this.lastStreamingElapsedSeconds = Math.max(0, Math.floor((Date.now() - this.streamingHeartbeatStart) / 1000));
|
|
1021
|
+
}
|
|
1001
1022
|
// Exit scroll region mode
|
|
1002
1023
|
this.terminalInput.exitStreamingScrollRegion();
|
|
1003
1024
|
this.uiUpdates.stopHeartbeat('streaming');
|
|
@@ -1210,6 +1231,10 @@ export class InteractiveShell {
|
|
|
1210
1231
|
return;
|
|
1211
1232
|
}
|
|
1212
1233
|
switch (command) {
|
|
1234
|
+
case '/help':
|
|
1235
|
+
case '/?':
|
|
1236
|
+
this.showHelp();
|
|
1237
|
+
break;
|
|
1213
1238
|
case '/model':
|
|
1214
1239
|
this.showModelMenu();
|
|
1215
1240
|
break;
|
|
@@ -1224,6 +1249,9 @@ export class InteractiveShell {
|
|
|
1224
1249
|
case '/tools':
|
|
1225
1250
|
this.showToolsMenu();
|
|
1226
1251
|
break;
|
|
1252
|
+
case '/mcp':
|
|
1253
|
+
await this.showMcpStatus();
|
|
1254
|
+
break;
|
|
1227
1255
|
case '/doctor':
|
|
1228
1256
|
this.runDoctor();
|
|
1229
1257
|
break;
|
|
@@ -1316,6 +1344,30 @@ export class InteractiveShell {
|
|
|
1316
1344
|
const info = [
|
|
1317
1345
|
this.buildSlashCommandList('Available Commands:'),
|
|
1318
1346
|
'',
|
|
1347
|
+
theme.gradient.primary('Keyboard Shortcuts:'),
|
|
1348
|
+
'',
|
|
1349
|
+
theme.bold(' Mode Toggles'),
|
|
1350
|
+
` ${theme.info('Shift+Tab')} ${theme.ui.muted('Toggle edit mode (auto/ask)')}`,
|
|
1351
|
+
` ${theme.info('Option+V')} ${theme.ui.muted('Toggle verification')}`,
|
|
1352
|
+
` ${theme.info('Option+C')} ${theme.ui.muted('Toggle auto-continue')}`,
|
|
1353
|
+
` ${theme.info('Option+T')} ${theme.ui.muted('Cycle thinking mode')}`,
|
|
1354
|
+
` ${theme.info('Option+E')} ${theme.ui.muted('Toggle edit permission mode')}`,
|
|
1355
|
+
` ${theme.info('Option+X')} ${theme.ui.muted('Clear/compact context')}`,
|
|
1356
|
+
'',
|
|
1357
|
+
theme.bold(' Navigation'),
|
|
1358
|
+
` ${theme.info('PageUp/PageDown')} ${theme.ui.muted('Scroll through output')}`,
|
|
1359
|
+
` ${theme.info('Escape')} ${theme.ui.muted('Stop streaming')}`,
|
|
1360
|
+
` ${theme.info('Ctrl+C')} ${theme.ui.muted('Clear input or interrupt')}`,
|
|
1361
|
+
` ${theme.info('Up/Down')} ${theme.ui.muted('Navigate command history')}`,
|
|
1362
|
+
'',
|
|
1363
|
+
theme.bold(' Editing'),
|
|
1364
|
+
` ${theme.info('Ctrl+A')} ${theme.ui.muted('Move to start of line')}`,
|
|
1365
|
+
` ${theme.info('Ctrl+E')} ${theme.ui.muted('Move to end of line')}`,
|
|
1366
|
+
` ${theme.info('Ctrl+K')} ${theme.ui.muted('Delete to end of line')}`,
|
|
1367
|
+
` ${theme.info('Ctrl+U')} ${theme.ui.muted('Delete to start of line')}`,
|
|
1368
|
+
` ${theme.info('Ctrl+W')} ${theme.ui.muted('Delete previous word')}`,
|
|
1369
|
+
` ${theme.info('Shift+Enter')} ${theme.ui.muted('Insert newline (multi-line input)')}`,
|
|
1370
|
+
'',
|
|
1319
1371
|
'Type your request in natural language and press Enter.',
|
|
1320
1372
|
];
|
|
1321
1373
|
display.showSystemMessage(info.join('\n'));
|
|
@@ -2230,6 +2282,69 @@ export class InteractiveShell {
|
|
|
2230
2282
|
const detailLine = this.colorizeDropdownLine(` ${details.join(' • ')}`, index);
|
|
2231
2283
|
return `${numberLabel} ${checkbox} ${optionLabel}\n${detailLine}`;
|
|
2232
2284
|
}
|
|
2285
|
+
async showMcpStatus() {
|
|
2286
|
+
const lines = [];
|
|
2287
|
+
lines.push(theme.gradient.primary('MCP (Model Context Protocol) Status'));
|
|
2288
|
+
lines.push('');
|
|
2289
|
+
// Load MCP server configurations
|
|
2290
|
+
const servers = await loadMcpServers({
|
|
2291
|
+
workingDir: this.workingDir,
|
|
2292
|
+
env: process.env,
|
|
2293
|
+
});
|
|
2294
|
+
if (servers.length === 0) {
|
|
2295
|
+
lines.push(theme.ui.muted('No MCP servers configured.'));
|
|
2296
|
+
lines.push('');
|
|
2297
|
+
lines.push(theme.bold('Configuration files:'));
|
|
2298
|
+
lines.push(` ${theme.info('.mcp.json')} - Project-local MCP configuration`);
|
|
2299
|
+
lines.push(` ${theme.info('.erosolar/mcp.json')} - Project-local alternate location`);
|
|
2300
|
+
lines.push(` ${theme.info('~/.mcp.json')} - Global MCP configuration`);
|
|
2301
|
+
lines.push(` ${theme.info('~/.erosolar/mcp.d/*.json')} - Global MCP server files`);
|
|
2302
|
+
lines.push('');
|
|
2303
|
+
lines.push('Example .mcp.json:');
|
|
2304
|
+
lines.push(theme.ui.muted(`{
|
|
2305
|
+
"my-server": {
|
|
2306
|
+
"type": "stdio",
|
|
2307
|
+
"command": "npx",
|
|
2308
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "\${WORKSPACE_ROOT}"]
|
|
2309
|
+
}
|
|
2310
|
+
}`));
|
|
2311
|
+
}
|
|
2312
|
+
else {
|
|
2313
|
+
lines.push(theme.bold(`Configured MCP Servers (${servers.length}):`));
|
|
2314
|
+
lines.push('');
|
|
2315
|
+
for (const server of servers) {
|
|
2316
|
+
const typeIcon = server.type === 'stdio' ? '⚙' : '🌐';
|
|
2317
|
+
const serverLine = ` ${typeIcon} ${theme.primary(server.id)}`;
|
|
2318
|
+
lines.push(serverLine);
|
|
2319
|
+
if (server.type === 'stdio') {
|
|
2320
|
+
lines.push(` ${theme.ui.muted('Command:')} ${server.command} ${server.args?.join(' ') ?? ''}`);
|
|
2321
|
+
}
|
|
2322
|
+
else if (server.type === 'sse') {
|
|
2323
|
+
lines.push(` ${theme.ui.muted('URL:')} ${server.url}`);
|
|
2324
|
+
}
|
|
2325
|
+
if (server.description) {
|
|
2326
|
+
lines.push(` ${theme.ui.muted('Description:')} ${server.description}`);
|
|
2327
|
+
}
|
|
2328
|
+
lines.push(` ${theme.ui.muted('Source:')} ${server.source}`);
|
|
2329
|
+
lines.push('');
|
|
2330
|
+
}
|
|
2331
|
+
// Show MCP tools from runtime
|
|
2332
|
+
const providerTools = this.runtimeSession.toolRuntime.listProviderTools();
|
|
2333
|
+
const mcpTools = providerTools.filter(t => t.name.startsWith('mcp__'));
|
|
2334
|
+
if (mcpTools.length > 0) {
|
|
2335
|
+
lines.push(theme.bold(`Active MCP Tools (${mcpTools.length}):`));
|
|
2336
|
+
for (const tool of mcpTools.slice(0, 20)) {
|
|
2337
|
+
lines.push(` ${theme.info('•')} ${theme.ui.muted(tool.name)}`);
|
|
2338
|
+
}
|
|
2339
|
+
if (mcpTools.length > 20) {
|
|
2340
|
+
lines.push(` ${theme.ui.muted(`... and ${mcpTools.length - 20} more`)}`);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
lines.push('');
|
|
2345
|
+
lines.push(theme.ui.muted('Use /tools to enable/disable MCP servers.'));
|
|
2346
|
+
display.showSystemMessage(lines.join('\n'));
|
|
2347
|
+
}
|
|
2233
2348
|
showAgentsMenu() {
|
|
2234
2349
|
if (!this.agentMenu) {
|
|
2235
2350
|
display.showWarning('Agent selection is not available in this CLI.');
|
|
@@ -3202,6 +3317,8 @@ What's the next action?`;
|
|
|
3202
3317
|
void this.enforceAutoTests('verification');
|
|
3203
3318
|
},
|
|
3204
3319
|
});
|
|
3320
|
+
// Register global AI enhancer for explore tool - uses active model by default
|
|
3321
|
+
this.registerExploreAIEnhancer();
|
|
3205
3322
|
const historyToLoad = (this.pendingHistoryLoad && this.pendingHistoryLoad.length
|
|
3206
3323
|
? this.pendingHistoryLoad
|
|
3207
3324
|
: previousHistory && previousHistory.length
|
|
@@ -3234,6 +3351,41 @@ What's the next action?`;
|
|
|
3234
3351
|
this.terminalInput.render();
|
|
3235
3352
|
this.ensureReadlineReady();
|
|
3236
3353
|
}
|
|
3354
|
+
/**
|
|
3355
|
+
* Register a global AI enhancer for the explore tool.
|
|
3356
|
+
* This enables AI-enhanced codebase exploration using the active model.
|
|
3357
|
+
*/
|
|
3358
|
+
registerExploreAIEnhancer() {
|
|
3359
|
+
try {
|
|
3360
|
+
// Create a provider instance for simple completions
|
|
3361
|
+
const provider = createProvider({
|
|
3362
|
+
provider: this.sessionState.provider,
|
|
3363
|
+
model: this.sessionState.model,
|
|
3364
|
+
temperature: 0.3, // Lower temperature for more focused exploration responses
|
|
3365
|
+
maxTokens: 1024, // Limit response size for exploration queries
|
|
3366
|
+
});
|
|
3367
|
+
// Create AI enhancer that uses the provider directly (no tool calling)
|
|
3368
|
+
const aiEnhancer = async (prompt) => {
|
|
3369
|
+
try {
|
|
3370
|
+
const response = await provider.generate([{ role: 'user', content: prompt }], [] // No tools - simple completion only
|
|
3371
|
+
);
|
|
3372
|
+
if (response.type === 'message') {
|
|
3373
|
+
return response.content;
|
|
3374
|
+
}
|
|
3375
|
+
return '';
|
|
3376
|
+
}
|
|
3377
|
+
catch {
|
|
3378
|
+
// Silently fail - exploration will fall back to offline mode
|
|
3379
|
+
return '';
|
|
3380
|
+
}
|
|
3381
|
+
};
|
|
3382
|
+
setGlobalAIEnhancer(aiEnhancer);
|
|
3383
|
+
}
|
|
3384
|
+
catch {
|
|
3385
|
+
// If provider creation fails, exploration works offline
|
|
3386
|
+
setGlobalAIEnhancer(null);
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3237
3389
|
buildSystemPrompt() {
|
|
3238
3390
|
const providerLabel = this.providerLabel(this.sessionState.provider);
|
|
3239
3391
|
const lines = [
|