@kolisachint/hoocode-agent 0.5.39 → 0.5.41
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/CHANGELOG.md +98 -0
- package/dist/core/agent-session.d.ts +10 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +18 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +6 -67
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/git-branch.d.ts +35 -0
- package/dist/core/git-branch.d.ts.map +1 -0
- package/dist/core/git-branch.js +88 -0
- package/dist/core/git-branch.js.map +1 -0
- package/dist/core/session-identity.d.ts +25 -0
- package/dist/core/session-identity.d.ts.map +1 -0
- package/dist/core/session-identity.js +137 -0
- package/dist/core/session-identity.js.map +1 -0
- package/dist/core/session-manager.d.ts +38 -4
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +62 -10
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/command-executor.d.ts +8 -0
- package/dist/modes/interactive/command-executor.d.ts.map +1 -1
- package/dist/modes/interactive/command-executor.js +39 -11
- package/dist/modes/interactive/command-executor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +14 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/session-chip.d.ts +25 -0
- package/dist/modes/interactive/components/session-chip.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-chip.js +62 -0
- package/dist/modes/interactive/components/session-chip.js.map +1 -0
- package/dist/modes/interactive/components/session-color-selector.d.ts +14 -0
- package/dist/modes/interactive/components/session-color-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-color-selector.js +54 -0
- package/dist/modes/interactive/components/session-color-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +32 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +18 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +75 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/solarized-dark.json +107 -0
- package/dist/modes/interactive/theme/solarized-light.json +110 -0
- package/dist/modes/interactive/theme/theme.d.ts +24 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +72 -11
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/docs/themes.md +53 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
|
@@ -50,6 +50,8 @@ import { CustomMessageComponent } from "./components/custom-message.js";
|
|
|
50
50
|
import { DynamicBorder } from "./components/dynamic-border.js";
|
|
51
51
|
import { FooterComponent } from "./components/footer.js";
|
|
52
52
|
import { keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
53
|
+
import { renderSessionChip } from "./components/session-chip.js";
|
|
54
|
+
import { SessionColorSelectorComponent } from "./components/session-color-selector.js";
|
|
53
55
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
54
56
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
55
57
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
@@ -760,6 +762,9 @@ export class InteractiveMode {
|
|
|
760
762
|
onThemeChange(() => {
|
|
761
763
|
this.ui.invalidate();
|
|
762
764
|
this.updateEditorBorderColor();
|
|
765
|
+
// The chip's fill and ink are baked in at build time, so a theme swap
|
|
766
|
+
// has to rebuild it or it keeps the old theme's colours.
|
|
767
|
+
this.updateSessionChip();
|
|
763
768
|
this.ui.requestRender();
|
|
764
769
|
});
|
|
765
770
|
// Set up git branch watcher (uses provider instead of footer)
|
|
@@ -781,6 +786,29 @@ export class InteractiveMode {
|
|
|
781
786
|
// Initialize available provider count for footer display
|
|
782
787
|
await this.modelController.updateAvailableProviderCount();
|
|
783
788
|
}
|
|
789
|
+
/**
|
|
790
|
+
* Refresh everything in the chrome that says *which session this is*: the
|
|
791
|
+
* terminal title and the chip on the input box. Both read from the same
|
|
792
|
+
* source, so they can never disagree about a rename.
|
|
793
|
+
*/
|
|
794
|
+
refreshSessionIdentity() {
|
|
795
|
+
this.updateTerminalTitle();
|
|
796
|
+
this.updateSessionChip();
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Rebuild the session chip and hand it to the editor, telling the footer to
|
|
800
|
+
* stand down from showing the name itself. Cheap enough to call on any change
|
|
801
|
+
* that could move the name, the colour, or the theme they are drawn in.
|
|
802
|
+
*/
|
|
803
|
+
updateSessionChip() {
|
|
804
|
+
const chip = renderSessionChip(this.sessionManager.getDisplayName(), this.sessionManager.getSessionColorSlot());
|
|
805
|
+
this.defaultEditor.topBorderLabel = chip;
|
|
806
|
+
if (this.editor !== this.defaultEditor) {
|
|
807
|
+
this.editor.topBorderLabel = chip;
|
|
808
|
+
}
|
|
809
|
+
this.footer.setSessionChipShown(chip !== undefined);
|
|
810
|
+
this.ui.requestRender();
|
|
811
|
+
}
|
|
784
812
|
/**
|
|
785
813
|
* Update terminal title with session name and cwd.
|
|
786
814
|
*/
|
|
@@ -1059,7 +1087,7 @@ export class InteractiveMode {
|
|
|
1059
1087
|
this.subscribeToAgent();
|
|
1060
1088
|
await this.modelController.updateAvailableProviderCount();
|
|
1061
1089
|
this.updateEditorBorderColor();
|
|
1062
|
-
this.
|
|
1090
|
+
this.refreshSessionIdentity();
|
|
1063
1091
|
}
|
|
1064
1092
|
async handleFatalRuntimeError(prefix, error) {
|
|
1065
1093
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1228,7 +1256,7 @@ export class InteractiveMode {
|
|
|
1228
1256
|
this.setCustomEditorComponent(undefined);
|
|
1229
1257
|
this.setupAutocompleteProvider();
|
|
1230
1258
|
this.defaultEditor.onExtensionShortcut = undefined;
|
|
1231
|
-
this.
|
|
1259
|
+
this.refreshSessionIdentity();
|
|
1232
1260
|
this.workingMessage = undefined;
|
|
1233
1261
|
this.workingVisible = true;
|
|
1234
1262
|
this.setWorkingIndicator();
|
|
@@ -1389,6 +1417,7 @@ export class InteractiveMode {
|
|
|
1389
1417
|
this.editor = this.defaultEditor;
|
|
1390
1418
|
}
|
|
1391
1419
|
this.editorContainer.addChild(this.editor);
|
|
1420
|
+
this.updateSessionChip();
|
|
1392
1421
|
this.ui.setFocus(this.editor);
|
|
1393
1422
|
this.ui.requestRender();
|
|
1394
1423
|
}
|
|
@@ -1606,6 +1635,18 @@ export class InteractiveMode {
|
|
|
1606
1635
|
clearEditor();
|
|
1607
1636
|
},
|
|
1608
1637
|
},
|
|
1638
|
+
"/color": {
|
|
1639
|
+
withArgs: true,
|
|
1640
|
+
run: (text) => {
|
|
1641
|
+
// An argument sets the slot outright; bare `/color` opens the
|
|
1642
|
+
// swatches, since a slot number is not something anyone knows
|
|
1643
|
+
// by heart.
|
|
1644
|
+
if (!this.commandExecutor.handleColor(text)) {
|
|
1645
|
+
this.showSessionColorSelector();
|
|
1646
|
+
}
|
|
1647
|
+
clearEditor();
|
|
1648
|
+
},
|
|
1649
|
+
},
|
|
1609
1650
|
"/session": {
|
|
1610
1651
|
run: () => {
|
|
1611
1652
|
this.commandExecutor.handleSession();
|
|
@@ -1916,7 +1957,7 @@ export class InteractiveMode {
|
|
|
1916
1957
|
this.ui.requestRender();
|
|
1917
1958
|
break;
|
|
1918
1959
|
case "session_info_changed":
|
|
1919
|
-
this.
|
|
1960
|
+
this.refreshSessionIdentity();
|
|
1920
1961
|
this.footer.invalidate();
|
|
1921
1962
|
this.ui.requestRender();
|
|
1922
1963
|
break;
|
|
@@ -3440,6 +3481,36 @@ export class InteractiveMode {
|
|
|
3440
3481
|
return { component: selector, focus: selector };
|
|
3441
3482
|
});
|
|
3442
3483
|
}
|
|
3484
|
+
/**
|
|
3485
|
+
* Swatch picker for the session chip's colour. Moving through the list
|
|
3486
|
+
* repaints the live chip, so the choice is made by looking at the real thing
|
|
3487
|
+
* in the real theme rather than at a preview of it.
|
|
3488
|
+
*/
|
|
3489
|
+
showSessionColorSelector() {
|
|
3490
|
+
const originalSlot = this.sessionManager.getSessionColorSlot();
|
|
3491
|
+
this.showSelector((done) => {
|
|
3492
|
+
const previewSlot = (slot) => {
|
|
3493
|
+
const chip = renderSessionChip(this.sessionManager.getDisplayName(), slot);
|
|
3494
|
+
this.defaultEditor.topBorderLabel = chip;
|
|
3495
|
+
if (this.editor !== this.defaultEditor) {
|
|
3496
|
+
this.editor.topBorderLabel = chip;
|
|
3497
|
+
}
|
|
3498
|
+
this.ui.requestRender();
|
|
3499
|
+
};
|
|
3500
|
+
const selector = new SessionColorSelectorComponent(this.sessionManager.getDisplayName(), originalSlot, (slot) => {
|
|
3501
|
+
done();
|
|
3502
|
+
this.session.setSessionColor(slot);
|
|
3503
|
+
this.showStatus(`Session color set to ${slot}`);
|
|
3504
|
+
}, () => {
|
|
3505
|
+
done();
|
|
3506
|
+
// Cancelling must put back the colour the session actually has,
|
|
3507
|
+
// not leave it wearing the last swatch the cursor passed over.
|
|
3508
|
+
previewSlot(originalSlot);
|
|
3509
|
+
this.ui.requestRender();
|
|
3510
|
+
}, previewSlot);
|
|
3511
|
+
return { component: selector, focus: selector.getSelectList() };
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3443
3514
|
showSessionSelector() {
|
|
3444
3515
|
this.showSelector((done) => {
|
|
3445
3516
|
const selector = new SessionSelectorComponent((onProgress) => SessionManager.list(this.sessionManager.getCwd(), this.sessionManager.getSessionDir(), onProgress), SessionManager.listAll, async (sessionPath) => {
|
|
@@ -3456,7 +3527,7 @@ export class InteractiveMode {
|
|
|
3456
3527
|
if (!next)
|
|
3457
3528
|
return;
|
|
3458
3529
|
const mgr = SessionManager.open(sessionFilePath);
|
|
3459
|
-
mgr.appendSessionInfo(next);
|
|
3530
|
+
mgr.appendSessionInfo({ name: next });
|
|
3460
3531
|
},
|
|
3461
3532
|
showRenameHint: true,
|
|
3462
3533
|
keybindings: this.keybindings,
|