erosolar-cli 2.1.151 → 2.1.152
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 +5 -0
- package/dist/core/agent.d.ts +22 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +195 -36
- package/dist/core/agent.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +1 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +72 -0
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/tools/bashTools.d.ts.map +1 -1
- package/dist/tools/bashTools.js +101 -8
- package/dist/tools/bashTools.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +5 -0
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +13 -0
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/package.json +1 -1
|
@@ -281,6 +281,10 @@ export class InteractiveShell {
|
|
|
281
281
|
this.uiAdapter.setToolStatusCallback((status) => {
|
|
282
282
|
this.updateStatusMessage(status ?? null);
|
|
283
283
|
});
|
|
284
|
+
// Set up activity callback to update activity line with streaming bash output
|
|
285
|
+
this.uiAdapter.setActivityCallback((activity) => {
|
|
286
|
+
this.renderer?.setActivity(activity);
|
|
287
|
+
});
|
|
284
288
|
this.skillRepository = new SkillRepository({
|
|
285
289
|
workingDir: this.workingDir,
|
|
286
290
|
env: process.env,
|
|
@@ -2546,6 +2550,9 @@ export class InteractiveShell {
|
|
|
2546
2550
|
case '/permissions':
|
|
2547
2551
|
this.handlePermissionsCommand();
|
|
2548
2552
|
break;
|
|
2553
|
+
case '/update':
|
|
2554
|
+
await this.handleUpdateCommand(input);
|
|
2555
|
+
break;
|
|
2549
2556
|
case '/init':
|
|
2550
2557
|
this.handleInitCommand(input);
|
|
2551
2558
|
break;
|
|
@@ -4718,6 +4725,71 @@ export class InteractiveShell {
|
|
|
4718
4725
|
lines.push(theme.ui.muted('Use /tools to manage which tool suites are enabled.'));
|
|
4719
4726
|
display.showSystemMessage(lines.join('\n'));
|
|
4720
4727
|
}
|
|
4728
|
+
async handleUpdateCommand(input) {
|
|
4729
|
+
const tokens = input.split(/\s+/).slice(1);
|
|
4730
|
+
const subcommand = tokens[0]?.toLowerCase();
|
|
4731
|
+
const prefs = loadSessionPreferences();
|
|
4732
|
+
const currentPref = prefs.autoUpdate;
|
|
4733
|
+
const prefLabel = currentPref === true ? 'always update' : currentPref === false ? 'always skip' : 'ask each time';
|
|
4734
|
+
// Show status or help
|
|
4735
|
+
if (!subcommand || subcommand === 'status') {
|
|
4736
|
+
const lines = [];
|
|
4737
|
+
lines.push(theme.bold('Update Settings'));
|
|
4738
|
+
lines.push('');
|
|
4739
|
+
lines.push(`Current preference: ${theme.info(prefLabel)}`);
|
|
4740
|
+
lines.push('');
|
|
4741
|
+
lines.push(theme.secondary('Commands:'));
|
|
4742
|
+
lines.push(' /update check - Check for updates now');
|
|
4743
|
+
lines.push(' /update auto - Always auto-update');
|
|
4744
|
+
lines.push(' /update skip - Never auto-update');
|
|
4745
|
+
lines.push(' /update ask - Prompt each time (reset preference)');
|
|
4746
|
+
display.showSystemMessage(lines.join('\n'));
|
|
4747
|
+
return;
|
|
4748
|
+
}
|
|
4749
|
+
if (subcommand === 'check') {
|
|
4750
|
+
// Force check and show prompt
|
|
4751
|
+
try {
|
|
4752
|
+
const { checkForUpdates, promptForUpdate, performUpdate } = await import('../core/updateChecker.js');
|
|
4753
|
+
const currentVersion = this.version || this.getPackageInfo().version || '1.7.458';
|
|
4754
|
+
const updateInfo = await checkForUpdates(currentVersion);
|
|
4755
|
+
if (!updateInfo) {
|
|
4756
|
+
display.showWarning('Unable to check for updates (network issue or timeout).');
|
|
4757
|
+
return;
|
|
4758
|
+
}
|
|
4759
|
+
if (!updateInfo.updateAvailable) {
|
|
4760
|
+
display.showSuccess(`You're on the latest version (v${updateInfo.current}).`);
|
|
4761
|
+
return;
|
|
4762
|
+
}
|
|
4763
|
+
const result = await promptForUpdate(updateInfo);
|
|
4764
|
+
if (result.rememberChoice) {
|
|
4765
|
+
saveSessionPreferences({ autoUpdate: result.choice === 'update' });
|
|
4766
|
+
}
|
|
4767
|
+
if (result.choice === 'update') {
|
|
4768
|
+
await performUpdate(updateInfo, (msg) => this.streamEventBlock(msg));
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
catch (error) {
|
|
4772
|
+
display.showError(`Update check failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
4773
|
+
}
|
|
4774
|
+
return;
|
|
4775
|
+
}
|
|
4776
|
+
if (subcommand === 'auto' || subcommand === 'always') {
|
|
4777
|
+
saveSessionPreferences({ autoUpdate: true });
|
|
4778
|
+
display.showSuccess('Auto-update enabled. Updates will install automatically.');
|
|
4779
|
+
return;
|
|
4780
|
+
}
|
|
4781
|
+
if (subcommand === 'skip' || subcommand === 'never' || subcommand === 'off') {
|
|
4782
|
+
saveSessionPreferences({ autoUpdate: false });
|
|
4783
|
+
display.showInfo('Auto-update disabled. Updates will be skipped silently.');
|
|
4784
|
+
return;
|
|
4785
|
+
}
|
|
4786
|
+
if (subcommand === 'ask' || subcommand === 'prompt' || subcommand === 'reset') {
|
|
4787
|
+
saveSessionPreferences({ autoUpdate: null });
|
|
4788
|
+
display.showInfo('Update preference reset. You will be prompted when updates are available.');
|
|
4789
|
+
return;
|
|
4790
|
+
}
|
|
4791
|
+
display.showWarning('Usage: /update [check|auto|skip|ask|status]');
|
|
4792
|
+
}
|
|
4721
4793
|
handleInitCommand(input) {
|
|
4722
4794
|
const tokens = input.split(/\s+/).slice(1);
|
|
4723
4795
|
const confirm = tokens[0]?.toLowerCase() === 'confirm';
|