@kolisachint/hoocode-agent 0.5.15 → 0.5.16

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 (35) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/core/learn/extract.d.ts +48 -1
  3. package/dist/core/learn/extract.d.ts.map +1 -1
  4. package/dist/core/learn/extract.js +120 -23
  5. package/dist/core/learn/extract.js.map +1 -1
  6. package/dist/core/learn/state.d.ts +6 -3
  7. package/dist/core/learn/state.d.ts.map +1 -1
  8. package/dist/core/learn/state.js +6 -3
  9. package/dist/core/learn/state.js.map +1 -1
  10. package/dist/core/session-manager.d.ts +8 -0
  11. package/dist/core/session-manager.d.ts.map +1 -1
  12. package/dist/core/session-manager.js +12 -2
  13. package/dist/core/session-manager.js.map +1 -1
  14. package/dist/core/settings-manager.d.ts +11 -0
  15. package/dist/core/settings-manager.d.ts.map +1 -1
  16. package/dist/core/settings-manager.js +14 -0
  17. package/dist/core/settings-manager.js.map +1 -1
  18. package/dist/extensions/core/learn.d.ts.map +1 -1
  19. package/dist/extensions/core/learn.js +149 -15
  20. package/dist/extensions/core/learn.js.map +1 -1
  21. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  22. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  23. package/dist/modes/interactive/components/settings-selector.js +72 -0
  24. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  25. package/dist/modes/interactive/interactive-mode.d.ts +21 -3
  26. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  27. package/dist/modes/interactive/interactive-mode.js +54 -15
  28. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  29. package/docs/settings.md +4 -0
  30. package/docs/usage.md +16 -1
  31. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  32. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  33. package/examples/extensions/sandbox/package.json +1 -1
  34. package/examples/extensions/with-deps/package.json +1 -1
  35. package/package.json +4 -4
@@ -2560,23 +2560,19 @@ export class InteractiveMode {
2560
2560
  this.editor.setText("");
2561
2561
  this.ui.requestRender();
2562
2562
  }
2563
- showError(errorMessage) {
2564
- this.chatContainer.addChild(new Spacer(1));
2565
- this.chatContainer.addChild(new Text(theme.fg("error", `Error: ${errorMessage}`), 1, 0));
2566
- this.ui.requestRender();
2567
- }
2568
- showWarning(warningMessage) {
2569
- this.chatContainer.addChild(new Text(theme.fg("warning", warningMessage), 0, 0));
2570
- this.ui.requestRender();
2571
- }
2572
2563
  /**
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.
2564
+ * Paint a message as a filled block, the shape errors and warnings share.
2565
+ *
2566
+ * These two used to render differently for no reason anyone could name: an
2567
+ * error got a blank line above it and a column of padding, a warning got
2568
+ * neither, so a warning collided with whatever was printed before it and hung
2569
+ * off the left margin. Both are the same kind of interruption, so both get the
2570
+ * same frame, and the fill is what separates them from ordinary chat output —
2571
+ * a single coloured line is easy to scroll straight past.
2576
2572
  */
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));
2573
+ showBlock(bg, fg, title, body) {
2574
+ const box = new Box(1, 1, (t) => theme.bg(bg, t));
2575
+ box.addChild(new Text(theme.bold(theme.fg(fg, title)), 0, 0));
2580
2576
  for (const line of body) {
2581
2577
  box.addChild(new Text(theme.fg("muted", line), 0, 0));
2582
2578
  }
@@ -2584,6 +2580,32 @@ export class InteractiveMode {
2584
2580
  this.chatContainer.addChild(box);
2585
2581
  this.ui.requestRender();
2586
2582
  }
2583
+ /**
2584
+ * Split a message into its headline and the rest.
2585
+ *
2586
+ * Multi-line notifications — `/learn` reporting where it searched, a settings
2587
+ * dump — read as a heading over detail, and rendering them as one undifferen-
2588
+ * tiated coloured block loses that. A single-line message is all headline.
2589
+ */
2590
+ splitBlockMessage(message) {
2591
+ const [first = "", ...rest] = message.split("\n");
2592
+ return { title: first, body: rest };
2593
+ }
2594
+ showError(errorMessage) {
2595
+ const { title, body } = this.splitBlockMessage(errorMessage);
2596
+ this.showBlock("toolErrorBg", "error", `Error: ${title}`, body);
2597
+ }
2598
+ showWarning(warningMessage) {
2599
+ const { title, body } = this.splitBlockMessage(warningMessage);
2600
+ this.showBlock("warningBg", "warning", title, body);
2601
+ }
2602
+ /**
2603
+ * A warning the user pays for if they miss it — same frame as `showWarning`,
2604
+ * with an explicit title over its body.
2605
+ */
2606
+ showNotice(title, body) {
2607
+ this.showBlock("warningBg", "warning", title, body);
2608
+ }
2587
2609
  showNewVersionNotification(newVersion) {
2588
2610
  const action = theme.fg("accent", `${APP_NAME} update`);
2589
2611
  const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. Run `) + action;
@@ -2699,6 +2721,18 @@ export class InteractiveMode {
2699
2721
  // getWebtoolsTimeoutSecs already folds in HOOCODE_WEBTOOLS_TIMEOUT.
2700
2722
  voiceSilenceMs: resolveVoiceSilenceMs(this.settingsManager),
2701
2723
  webtoolsTimeoutSecs: this.settingsManager.getWebtoolsTimeoutSecs(),
2724
+ // The effective window, so a project settings.json narrowing it for
2725
+ // this repo shows up here rather than the user-scope value alone.
2726
+ learn: (() => {
2727
+ const learn = this.settingsManager.getLearnSettings();
2728
+ return {
2729
+ learnMaxSessions: learn.maxSessions,
2730
+ learnMaxAgeDays: learn.maxAgeDays,
2731
+ learnMinRepeats: learn.minRepeats,
2732
+ learnMinWorkflowRepeats: learn.minWorkflowRepeats,
2733
+ learnMaxProposals: learn.maxProposals,
2734
+ };
2735
+ })(),
2702
2736
  }, {
2703
2737
  onAutoCompactChange: (enabled) => {
2704
2738
  this.session.setAutoCompactionEnabled(enabled);
@@ -2897,6 +2931,11 @@ export class InteractiveMode {
2897
2931
  // Persisted; webfetch/websearch pick it up when tools rebuild next session.
2898
2932
  this.settingsManager.setWebtoolsTimeoutSecs(secs);
2899
2933
  },
2934
+ onLearnSettingChange: (key, value) => {
2935
+ // /learn reads settings fresh on every invocation, so the next run
2936
+ // picks this up with no restart and nothing to re-wire live.
2937
+ this.settingsManager.setLearnSetting(key, value);
2938
+ },
2900
2939
  onCancel: () => {
2901
2940
  done();
2902
2941
  this.ui.requestRender();