@kolisachint/hoocode-agent 0.5.55 → 0.5.56

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.
@@ -26,6 +26,7 @@ import { formatTokens } from "../../core/format-tokens.js";
26
26
  import { KeybindingsManager } from "../../core/keybindings.js";
27
27
  import { measurePromptSurface, measureToolSchemaTokens } from "../../core/light.js";
28
28
  import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
29
+ import { cycleSessionColorSlot, sessionColorName } from "../../core/session-identity.js";
29
30
  import { SessionManager } from "../../core/session-manager.js";
30
31
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
31
32
  import { startupProgress } from "../../core/startup-progress.js";
@@ -1529,6 +1530,8 @@ export class InteractiveMode {
1529
1530
  this.editor.setText("/cd ");
1530
1531
  this.ui.requestRender();
1531
1532
  });
1533
+ this.defaultEditor.onAction("app.session.color.cycleForward", () => this.cycleSessionColor("forward"));
1534
+ this.defaultEditor.onAction("app.session.color.cycleBackward", () => this.cycleSessionColor("backward"));
1532
1535
  this.defaultEditor.onAction("app.settings.open", () => this.showSettingsSelector());
1533
1536
  this.defaultEditor.onAction("app.hotkeys.open", () => this.commandExecutor.handleHotkeys());
1534
1537
  this.defaultEditor.onAction("app.mode.cycle", () => void this.cycleAgentMode());
@@ -2859,6 +2862,22 @@ export class InteractiveMode {
2859
2862
  const next = modes[(index + 1) % modes.length];
2860
2863
  await this.session.prompt(`/mode ${next}`);
2861
2864
  }
2865
+ /**
2866
+ * Step the session chip to the next colour slot, no picker involved.
2867
+ *
2868
+ * The picker exists for choosing a colour; this exists for telling two
2869
+ * terminals apart, which is a different job — you press the key until the two
2870
+ * chips stop looking alike, and the chip repaints on each press because
2871
+ * setSessionColor writes the slot and the session_info event refreshes the
2872
+ * identity. The status line names the slot as well, since the point of the
2873
+ * names is that `/color <name>` takes them.
2874
+ */
2875
+ cycleSessionColor(direction) {
2876
+ const slot = cycleSessionColorSlot(this.sessionManager.getSessionColorSlot(), direction);
2877
+ this.session.setSessionColor(slot);
2878
+ const name = sessionColorName(slot);
2879
+ this.showStatus(`Session color: ${name ?? slot}`);
2880
+ }
2862
2881
  toggleThinkingBlockVisibility() {
2863
2882
  this.hideThinkingBlock = !this.hideThinkingBlock;
2864
2883
  this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
@@ -3522,7 +3541,7 @@ export class InteractiveMode {
3522
3541
  const selector = new SessionColorSelectorComponent(this.sessionManager.getDisplayName(), originalSlot, (slot) => {
3523
3542
  done();
3524
3543
  this.session.setSessionColor(slot);
3525
- this.showStatus(`Session color set to ${slot}`);
3544
+ this.showStatus(`Session color: ${sessionColorName(slot) ?? slot}`);
3526
3545
  }, () => {
3527
3546
  done();
3528
3547
  // Cancelling must put back the colour the session actually has,