@elyracode/coding-agent 0.5.6 → 0.5.7

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.
@@ -54,6 +54,7 @@ import { SessionSelectorComponent } from "./components/session-selector.js";
54
54
  import { SettingsSelectorComponent } from "./components/settings-selector.js";
55
55
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
56
56
  import { StartupAnimation } from "./components/startup-animation.js";
57
+ import { ThemeSelectorComponent } from "./components/theme-selector.js";
57
58
  import { ToolExecutionComponent } from "./components/tool-execution.js";
58
59
  import { TreeSelectorComponent } from "./components/tree-selector.js";
59
60
  import { UserMessageComponent } from "./components/user-message.js";
@@ -310,6 +311,21 @@ export class InteractiveMode {
310
311
  }));
311
312
  };
312
313
  }
314
+ const themeCommand = slashCommands.find((command) => command.name === "theme");
315
+ if (themeCommand) {
316
+ themeCommand.getArgumentCompletions = (prefix) => {
317
+ const themes = getAvailableThemes();
318
+ const currentTheme = this.settingsManager.getTheme() || "dark";
319
+ const filtered = themes.filter((t) => t.toLowerCase().includes(prefix.toLowerCase()));
320
+ if (filtered.length === 0)
321
+ return null;
322
+ return filtered.map((t) => ({
323
+ value: t,
324
+ label: t,
325
+ description: t === currentTheme ? "(current)" : undefined,
326
+ }));
327
+ };
328
+ }
313
329
  // Convert prompt templates to SlashCommand format for autocomplete
314
330
  const templateCommands = this.session.promptTemplates.map((cmd) => ({
315
331
  name: cmd.name,
@@ -1930,6 +1946,12 @@ export class InteractiveMode {
1930
1946
  this.editor.setText("");
1931
1947
  return;
1932
1948
  }
1949
+ if (text === "/theme" || text.startsWith("/theme ")) {
1950
+ const themeName = text.startsWith("/theme ") ? text.slice(7).trim() : undefined;
1951
+ this.editor.setText("");
1952
+ this.handleThemeCommand(themeName);
1953
+ return;
1954
+ }
1933
1955
  if (text === "/scoped-models") {
1934
1956
  this.editor.setText("");
1935
1957
  await this.showModelsSelector();
@@ -3237,6 +3259,54 @@ export class InteractiveMode {
3237
3259
  return { component: selector, focus: selector.getSettingsList() };
3238
3260
  });
3239
3261
  }
3262
+ handleThemeCommand(themeName) {
3263
+ if (!themeName) {
3264
+ this.showThemeSelector();
3265
+ return;
3266
+ }
3267
+ const available = getAvailableThemes();
3268
+ if (!available.includes(themeName)) {
3269
+ this.showError(`Unknown theme: "${themeName}". Available: ${available.join(", ")}`);
3270
+ return;
3271
+ }
3272
+ const result = setTheme(themeName, true);
3273
+ this.settingsManager.setTheme(themeName);
3274
+ this.ui.invalidate();
3275
+ if (result.success) {
3276
+ this.showStatus(`Theme: ${themeName}`);
3277
+ }
3278
+ else {
3279
+ this.showError(`Failed to load theme "${themeName}": ${result.error}\nFell back to dark theme.`);
3280
+ }
3281
+ }
3282
+ showThemeSelector() {
3283
+ const currentTheme = this.settingsManager.getTheme() || "dark";
3284
+ const previousTheme = currentTheme;
3285
+ this.showSelector((done) => {
3286
+ const selector = new ThemeSelectorComponent(currentTheme, (themeName) => {
3287
+ const result = setTheme(themeName, true);
3288
+ this.settingsManager.setTheme(themeName);
3289
+ this.ui.invalidate();
3290
+ done();
3291
+ if (!result.success) {
3292
+ this.showError(`Failed to load theme "${themeName}": ${result.error}\nFell back to dark theme.`);
3293
+ }
3294
+ }, () => {
3295
+ // Cancel: restore previous theme
3296
+ setTheme(previousTheme, true);
3297
+ this.ui.invalidate();
3298
+ done();
3299
+ }, (themeName) => {
3300
+ // Preview on hover
3301
+ const result = setTheme(themeName, true);
3302
+ if (result.success) {
3303
+ this.ui.invalidate();
3304
+ this.ui.requestRender();
3305
+ }
3306
+ });
3307
+ return { component: selector, focus: selector.getSelectList() };
3308
+ });
3309
+ }
3240
3310
  async handleModelCommand(searchTerm) {
3241
3311
  if (!searchTerm) {
3242
3312
  this.showModelSelector();