erosolar-cli 1.7.14 ā 1.7.16
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/core/responseVerifier.d.ts +79 -0
- package/dist/core/responseVerifier.d.ts.map +1 -0
- package/dist/core/responseVerifier.js +443 -0
- package/dist/core/responseVerifier.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +10 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +80 -0
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +3 -0
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +4 -10
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/persistentPrompt.d.ts +4 -0
- package/dist/ui/persistentPrompt.d.ts.map +1 -1
- package/dist/ui/persistentPrompt.js +10 -11
- package/dist/ui/persistentPrompt.js.map +1 -1
- package/package.json +1 -1
- package/dist/bin/core/agent.js +0 -362
- package/dist/bin/core/agentProfileManifest.js +0 -187
- package/dist/bin/core/agentProfiles.js +0 -34
- package/dist/bin/core/agentRulebook.js +0 -135
- package/dist/bin/core/agentSchemaLoader.js +0 -233
- package/dist/bin/core/contextManager.js +0 -412
- package/dist/bin/core/contextWindow.js +0 -122
- package/dist/bin/core/customCommands.js +0 -80
- package/dist/bin/core/errors/apiKeyErrors.js +0 -114
- package/dist/bin/core/errors/errorTypes.js +0 -340
- package/dist/bin/core/errors/safetyValidator.js +0 -304
- package/dist/bin/core/errors.js +0 -32
- package/dist/bin/core/modelDiscovery.js +0 -755
- package/dist/bin/core/preferences.js +0 -224
- package/dist/bin/core/schemaValidator.js +0 -92
- package/dist/bin/core/secretStore.js +0 -199
- package/dist/bin/core/sessionStore.js +0 -187
- package/dist/bin/core/toolRuntime.js +0 -290
- package/dist/bin/core/types.js +0 -1
- package/dist/bin/shell/bracketedPasteManager.js +0 -350
- package/dist/bin/shell/fileChangeTracker.js +0 -65
- package/dist/bin/shell/interactiveShell.js +0 -2908
- package/dist/bin/shell/liveStatus.js +0 -78
- package/dist/bin/shell/shellApp.js +0 -290
- package/dist/bin/shell/systemPrompt.js +0 -60
- package/dist/bin/shell/updateManager.js +0 -108
- package/dist/bin/ui/ShellUIAdapter.js +0 -459
- package/dist/bin/ui/UnifiedUIController.js +0 -183
- package/dist/bin/ui/animation/AnimationScheduler.js +0 -430
- package/dist/bin/ui/codeHighlighter.js +0 -854
- package/dist/bin/ui/designSystem.js +0 -121
- package/dist/bin/ui/display.js +0 -1222
- package/dist/bin/ui/interrupts/InterruptManager.js +0 -437
- package/dist/bin/ui/layout.js +0 -139
- package/dist/bin/ui/orchestration/StatusOrchestrator.js +0 -403
- package/dist/bin/ui/outputMode.js +0 -38
- package/dist/bin/ui/persistentPrompt.js +0 -183
- package/dist/bin/ui/richText.js +0 -338
- package/dist/bin/ui/shortcutsHelp.js +0 -87
- package/dist/bin/ui/telemetry/UITelemetry.js +0 -443
- package/dist/bin/ui/textHighlighter.js +0 -210
- package/dist/bin/ui/theme.js +0 -116
- package/dist/bin/ui/toolDisplay.js +0 -423
- package/dist/bin/ui/toolDisplayAdapter.js +0 -357
|
@@ -24,6 +24,7 @@ import { PersistentPrompt, PinnedChatBox } from '../ui/persistentPrompt.js';
|
|
|
24
24
|
import { formatShortcutsHelp } from '../ui/shortcutsHelp.js';
|
|
25
25
|
import { MetricsTracker } from '../alpha-zero/index.js';
|
|
26
26
|
import { listAvailablePlugins } from '../plugins/index.js';
|
|
27
|
+
import { verifyResponse, formatVerificationReport, extractClaims, } from '../core/responseVerifier.js';
|
|
27
28
|
const DROPDOWN_COLORS = [
|
|
28
29
|
theme.primary,
|
|
29
30
|
theme.info,
|
|
@@ -110,6 +111,7 @@ export class InteractiveShell {
|
|
|
110
111
|
sessionStartTime = Date.now();
|
|
111
112
|
activeSessionTitle = null;
|
|
112
113
|
sessionResumeNotice = null;
|
|
114
|
+
lastAssistantResponse = null;
|
|
113
115
|
customCommands;
|
|
114
116
|
customCommandMap;
|
|
115
117
|
sessionRestoreConfig;
|
|
@@ -1185,6 +1187,9 @@ export class InteractiveShell {
|
|
|
1185
1187
|
case '/discover':
|
|
1186
1188
|
await this.discoverModelsCommand();
|
|
1187
1189
|
break;
|
|
1190
|
+
case '/verify':
|
|
1191
|
+
await this.handleVerifyCommand();
|
|
1192
|
+
break;
|
|
1188
1193
|
default:
|
|
1189
1194
|
if (!(await this.tryCustomSlashCommand(command, input))) {
|
|
1190
1195
|
display.showWarning(`Unknown command "${command}".`);
|
|
@@ -1535,6 +1540,77 @@ export class InteractiveShell {
|
|
|
1535
1540
|
const summary = this.alphaZeroMetrics.getPerformanceSummary();
|
|
1536
1541
|
display.showSystemMessage(summary);
|
|
1537
1542
|
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Handle /verify command - verify the last assistant response
|
|
1545
|
+
*/
|
|
1546
|
+
async handleVerifyCommand() {
|
|
1547
|
+
if (!this.lastAssistantResponse) {
|
|
1548
|
+
display.showWarning('No assistant response to verify. Send a message first.');
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
display.showSystemMessage('Verifying last response...\n');
|
|
1552
|
+
try {
|
|
1553
|
+
const report = await verifyResponse(this.lastAssistantResponse);
|
|
1554
|
+
const formattedReport = formatVerificationReport(report);
|
|
1555
|
+
display.showSystemMessage(formattedReport);
|
|
1556
|
+
// Show actionable summary
|
|
1557
|
+
if (report.overallVerdict === 'contradicted') {
|
|
1558
|
+
display.showError('Some claims in the response could not be verified!');
|
|
1559
|
+
}
|
|
1560
|
+
else if (report.overallVerdict === 'verified') {
|
|
1561
|
+
display.showInfo('All verifiable claims in the response were verified.');
|
|
1562
|
+
}
|
|
1563
|
+
else if (report.overallVerdict === 'partially_verified') {
|
|
1564
|
+
display.showWarning('Some claims were verified, but not all.');
|
|
1565
|
+
}
|
|
1566
|
+
else {
|
|
1567
|
+
display.showInfo('No verifiable claims found in the response.');
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
catch (err) {
|
|
1571
|
+
display.showError(`Verification failed: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
/**
|
|
1575
|
+
* Schedule auto-verification after assistant response if it contains verifiable claims.
|
|
1576
|
+
* Runs asynchronously to not block the UI.
|
|
1577
|
+
*/
|
|
1578
|
+
scheduleAutoVerification(response) {
|
|
1579
|
+
// Extract claims to see if verification is needed
|
|
1580
|
+
const claims = extractClaims(response);
|
|
1581
|
+
if (claims.length === 0) {
|
|
1582
|
+
// No verifiable claims - skip verification
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
// Run verification asynchronously after a short delay
|
|
1586
|
+
// This allows the UI to update first
|
|
1587
|
+
setTimeout(async () => {
|
|
1588
|
+
try {
|
|
1589
|
+
display.showSystemMessage(`\nš Auto-verifying ${claims.length} claim${claims.length > 1 ? 's' : ''}...`);
|
|
1590
|
+
const report = await verifyResponse(response);
|
|
1591
|
+
const formattedReport = formatVerificationReport(report);
|
|
1592
|
+
// Show compact result
|
|
1593
|
+
if (report.overallVerdict === 'verified') {
|
|
1594
|
+
display.showInfo(`ā
Verified: ${report.summary.verified}/${report.summary.total} claims confirmed`);
|
|
1595
|
+
}
|
|
1596
|
+
else if (report.overallVerdict === 'contradicted') {
|
|
1597
|
+
display.showError(`ā Verification failed: ${report.summary.failed} claim${report.summary.failed > 1 ? 's' : ''} could not be verified`);
|
|
1598
|
+
// Show full report for failures
|
|
1599
|
+
display.showSystemMessage(formattedReport);
|
|
1600
|
+
}
|
|
1601
|
+
else if (report.overallVerdict === 'partially_verified') {
|
|
1602
|
+
display.showWarning(`ā ļø Partial: ${report.summary.verified}/${report.summary.total} verified, ${report.summary.failed} failed`);
|
|
1603
|
+
// Show details for partial verification
|
|
1604
|
+
display.showSystemMessage(formattedReport);
|
|
1605
|
+
}
|
|
1606
|
+
// For 'unverified' (no claims found), we already skipped above
|
|
1607
|
+
}
|
|
1608
|
+
catch (err) {
|
|
1609
|
+
// Silently ignore verification errors to not disrupt the flow
|
|
1610
|
+
// User can always run /verify manually
|
|
1611
|
+
}
|
|
1612
|
+
}, 500);
|
|
1613
|
+
}
|
|
1538
1614
|
showImprovementSuggestions() {
|
|
1539
1615
|
const suggestions = this.alphaZeroMetrics.getImprovementSuggestions();
|
|
1540
1616
|
if (suggestions.length === 0) {
|
|
@@ -2723,6 +2799,10 @@ What's the next action?`;
|
|
|
2723
2799
|
if (finalContent) {
|
|
2724
2800
|
display.showAssistantMessage(finalContent, enriched);
|
|
2725
2801
|
}
|
|
2802
|
+
// Store last response for verification
|
|
2803
|
+
this.lastAssistantResponse = content;
|
|
2804
|
+
// Auto-verify if response contains verifiable claims
|
|
2805
|
+
this.scheduleAutoVerification(content);
|
|
2726
2806
|
// Show status line at end (Claude Code style: "Session 5m ⢠Context X% used ⢠Ready for prompts (2s)")
|
|
2727
2807
|
display.stopThinking();
|
|
2728
2808
|
// Calculate context usage and session time
|