@kolisachint/hoocode-agent 0.5.9 → 0.5.11

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/modes/interactive/interactive-mode.d.ts +6 -9
  3. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  4. package/dist/modes/interactive/interactive-mode.js +18 -35
  5. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  6. package/dist/modes/interactive/model-controller.d.ts +5 -3
  7. package/dist/modes/interactive/model-controller.d.ts.map +1 -1
  8. package/dist/modes/interactive/model-controller.js +9 -16
  9. package/dist/modes/interactive/model-controller.js.map +1 -1
  10. package/dist/modes/interactive/resource-display.d.ts +0 -5
  11. package/dist/modes/interactive/resource-display.d.ts.map +1 -1
  12. package/dist/modes/interactive/resource-display.js +4 -9
  13. package/dist/modes/interactive/resource-display.js.map +1 -1
  14. package/dist/modes/interactive/theme/colorsafe-dark.json +3 -1
  15. package/dist/modes/interactive/theme/colorsafe-light.json +3 -1
  16. package/dist/modes/interactive/theme/dark.json +2 -0
  17. package/dist/modes/interactive/theme/high-contrast-dark.json +3 -1
  18. package/dist/modes/interactive/theme/high-contrast-light.json +3 -1
  19. package/dist/modes/interactive/theme/light.json +2 -0
  20. package/dist/modes/interactive/theme/theme-schema.json +4 -0
  21. package/dist/modes/interactive/theme/theme.d.ts +1 -1
  22. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  23. package/dist/modes/interactive/theme/theme.js +9 -0
  24. package/dist/modes/interactive/theme/theme.js.map +1 -1
  25. package/dist/modes/interactive/theme/vox-dark.json +3 -1
  26. package/dist/modes/interactive/theme/vox-light.json +4 -2
  27. package/dist/modes/interactive/theme/warm-dark.json +3 -1
  28. package/dist/modes/interactive/theme/warm-light.json +3 -1
  29. package/docs/themes.md +7 -0
  30. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  31. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  32. package/examples/extensions/sandbox/package.json +1 -1
  33. package/examples/extensions/with-deps/package.json +1 -1
  34. package/package.json +4 -4
@@ -7,13 +7,12 @@ import * as fs from "node:fs";
7
7
  import * as os from "node:os";
8
8
  import * as path from "node:path";
9
9
  import { createCompactionSummaryMessage } from "@kolisachint/hoocode-agent-core";
10
- import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TUI, } from "@kolisachint/hoocode-tui";
10
+ import { Box, CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TUI, } from "@kolisachint/hoocode-tui";
11
11
  import { spawnSync } from "child_process";
12
12
  import { APP_NAME, APP_TITLE, VERSION } from "../../config.js";
13
13
  import { loadAgentRegistry } from "../../core/agent-registry.js";
14
14
  import { parseSkillBlock } from "../../core/agent-session.js";
15
15
  import { sumAssistantUsage } from "../../core/agent-session-stats.js";
16
- import { SEGMENT_SEP } from "../../core/brand.js";
17
16
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
18
17
  import { formatDurationSecs } from "../../core/format-duration.js";
19
18
  import { formatTokens } from "../../core/format-tokens.js";
@@ -56,7 +55,7 @@ import { ExtensionDialogs } from "./extension-dialogs.js";
56
55
  import { LoginController } from "./login-controller.js";
57
56
  import { MessageQueueController } from "./message-queue-controller.js";
58
57
  import { ModelController } from "./model-controller.js";
59
- import { ExpandableText, formatDisplayPath, isExpandable, showLoadedResources as renderLoadedResources, willShowResourceListing, } from "./resource-display.js";
58
+ import { ExpandableText, formatDisplayPath, isExpandable, showLoadedResources as renderLoadedResources, } from "./resource-display.js";
60
59
  import { checkForPackageUpdates, checkTmuxKeyboardSetup, getChangelogForDisplay } from "./startup-checks.js";
61
60
  import { TeamFocusController } from "./team-focus.js";
62
61
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
@@ -170,8 +169,6 @@ export class InteractiveMode {
170
169
  lastEscapeTime = 0;
171
170
  changelogMarkdown = undefined;
172
171
  startupNoticesShown = false;
173
- /** Billing caveat folded into the startup state line, once resolved. */
174
- startupAuthNote = undefined;
175
172
  // Status line tracking (for mutating immediately-sequential status updates)
176
173
  lastStatusSpacer = undefined;
177
174
  lastStatusText = undefined;
@@ -431,6 +428,7 @@ export class InteractiveMode {
431
428
  showStatus: (message) => this.showStatus(message),
432
429
  showError: (message) => this.showError(message),
433
430
  showWarning: (message) => this.showWarning(message),
431
+ showNotice: (title, body) => this.showNotice(title, body),
434
432
  updateEditorBorderColor: () => this.updateEditorBorderColor(),
435
433
  invalidateFooter: () => this.footer.invalidate(),
436
434
  setAvailableProviderCount: (count) => this.footerDataProvider.setAvailableProviderCount(count),
@@ -860,7 +858,6 @@ export class InteractiveMode {
860
858
  return [];
861
859
  }
862
860
  },
863
- getStateLine: () => this.buildSessionStateLine(),
864
861
  getColumns: () => this.ui.terminal.columns,
865
862
  quietStartup: () => this.settingsManager.getQuietStartup(),
866
863
  verbose: this.options.verbose ?? false,
@@ -882,26 +879,6 @@ export class InteractiveMode {
882
879
  return 0;
883
880
  }
884
881
  }
885
- /**
886
- * One line of session state for the startup summary: the model, its thinking
887
- * level, and any billing caveat. The footer carries the same facts for the
888
- * rest of the session, so this replaces the separate status lines that used
889
- * to be emitted for each of them.
890
- */
891
- buildSessionStateLine() {
892
- const model = this.session.model;
893
- if (!model)
894
- return undefined;
895
- const segments = [theme.fg("muted", model.id)];
896
- const thinkingLevel = this.session.thinkingLevel;
897
- if (model.reasoning && thinkingLevel && thinkingLevel !== "off") {
898
- segments.push(theme.fg("dim", `thinking ${thinkingLevel}`));
899
- }
900
- if (this.startupAuthNote) {
901
- segments.push(theme.fg("warning", this.startupAuthNote));
902
- }
903
- return segments.join(theme.fg("muted", ` ${SEGMENT_SEP} `));
904
- }
905
882
  /**
906
883
  * Initialize the extension system with TUI-based UI context.
907
884
  */
@@ -983,15 +960,6 @@ export class InteractiveMode {
983
960
  this.setupAutocompleteProvider();
984
961
  const extensionRunner = this.session.extensionRunner;
985
962
  this.setupExtensionShortcuts(extensionRunner);
986
- // Resolved before the summary renders so the billing caveat lands on the
987
- // state line instead of arriving as a late, separate warning. Skipped on a
988
- // quiet startup, where the full warning still fires from run().
989
- if (willShowResourceListing({
990
- verbose: this.options.verbose ?? false,
991
- quietStartup: () => this.settingsManager.getQuietStartup(),
992
- })) {
993
- this.startupAuthNote = await this.modelController.getAnthropicSubscriptionNote();
994
- }
995
963
  this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });
996
964
  this.showStartupNoticesIfNeeded();
997
965
  }
@@ -2601,6 +2569,21 @@ export class InteractiveMode {
2601
2569
  this.chatContainer.addChild(new Text(theme.fg("warning", warningMessage), 0, 0));
2602
2570
  this.ui.requestRender();
2603
2571
  }
2572
+ /**
2573
+ * A warning the user pays for if they miss it. `showWarning` paints one more
2574
+ * coloured line in a startup already full of them, so this fills a `warningBg`
2575
+ * block instead — the same weight the custom-message box carries.
2576
+ */
2577
+ showNotice(title, body) {
2578
+ const box = new Box(1, 1, (t) => theme.bg("warningBg", t));
2579
+ box.addChild(new Text(theme.bold(theme.fg("warning", title)), 0, 0));
2580
+ for (const line of body) {
2581
+ box.addChild(new Text(theme.fg("muted", line), 0, 0));
2582
+ }
2583
+ this.chatContainer.addChild(new Spacer(1));
2584
+ this.chatContainer.addChild(box);
2585
+ this.ui.requestRender();
2586
+ }
2604
2587
  showNewVersionNotification(newVersion) {
2605
2588
  const action = theme.fg("accent", `${APP_NAME} update`);
2606
2589
  const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. Run `) + action;