omp-fabric 1.27.2 → 1.28.1

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 (121) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/dist/capture/interceptor.d.ts.map +1 -1
  4. package/dist/chunks/{chunk-OJZNMROB.js → chunk-4PPAWZM6.js} +36 -50
  5. package/dist/chunks/chunk-4PPAWZM6.js.map +7 -0
  6. package/dist/chunks/{chunk-KIH3KLZU.js → chunk-C2YMZNT5.js} +5 -5
  7. package/dist/chunks/chunk-C2YMZNT5.js.map +7 -0
  8. package/dist/chunks/chunk-CHXPTZUF.js +277 -0
  9. package/dist/chunks/chunk-CHXPTZUF.js.map +7 -0
  10. package/dist/chunks/chunk-CYNNPPN4.js +93 -0
  11. package/dist/chunks/chunk-CYNNPPN4.js.map +7 -0
  12. package/dist/chunks/{chunk-ANHZ3SWB.js → chunk-DGKGPZET.js} +9 -4
  13. package/dist/chunks/{chunk-ANHZ3SWB.js.map → chunk-DGKGPZET.js.map} +2 -2
  14. package/dist/chunks/{chunk-2BOZMRT5.js → chunk-FVNEGH4J.js} +32 -49
  15. package/dist/chunks/chunk-FVNEGH4J.js.map +7 -0
  16. package/dist/chunks/{chunk-CNCRWY4Q.js → chunk-GS6IWGXQ.js} +9 -1
  17. package/dist/chunks/chunk-GS6IWGXQ.js.map +7 -0
  18. package/dist/chunks/{chunk-7QKSPNXQ.js → chunk-V5FB7D4C.js} +3 -3
  19. package/dist/chunks/chunk-VDYGBL4Z.js +132 -0
  20. package/dist/chunks/chunk-VDYGBL4Z.js.map +7 -0
  21. package/dist/chunks/chunk-XVA63H6I.js +151 -0
  22. package/dist/chunks/chunk-XVA63H6I.js.map +7 -0
  23. package/dist/chunks/{chunk-NOZBB266.js → chunk-XZIQGFF7.js} +9 -13
  24. package/dist/chunks/chunk-XZIQGFF7.js.map +7 -0
  25. package/dist/chunks/{chunk-4XLJPEI4.js → chunk-ZJ7HHWW4.js} +20 -41
  26. package/dist/chunks/chunk-ZJ7HHWW4.js.map +7 -0
  27. package/dist/config.d.ts +2 -0
  28. package/dist/config.d.ts.map +1 -1
  29. package/dist/core/approval-controller.d.ts.map +1 -1
  30. package/dist/fabric-exec-tool.d.ts.map +1 -1
  31. package/dist/fabric-runtime-state.js +5 -3
  32. package/dist/fabric-runtime-state.js.map +1 -1
  33. package/dist/host-compatibility.d.ts +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +180 -170
  36. package/dist/index.js.map +3 -3
  37. package/dist/residency/host.js +3 -3
  38. package/dist/residency/omp-entry.js +3 -3
  39. package/dist/topology/participant-directory.d.ts.map +1 -1
  40. package/dist/ui/arc-group.d.ts +1 -1
  41. package/dist/ui/arc-group.d.ts.map +1 -1
  42. package/dist/ui/code-preview-shell.d.ts +2 -2
  43. package/dist/ui/code-preview-shell.d.ts.map +1 -1
  44. package/dist/ui/controller.d.ts.map +1 -1
  45. package/dist/ui/conversation-chrome.d.ts +1 -5
  46. package/dist/ui/conversation-chrome.d.ts.map +1 -1
  47. package/dist/ui/conversation-chrome.js +2 -2
  48. package/dist/ui/conversation-queue.d.ts +3 -2
  49. package/dist/ui/conversation-queue.d.ts.map +1 -1
  50. package/dist/ui/conversation-render.d.ts +19 -23
  51. package/dist/ui/conversation-render.d.ts.map +1 -1
  52. package/dist/ui/conversation.d.ts +7 -17
  53. package/dist/ui/conversation.d.ts.map +1 -1
  54. package/dist/ui/conversation.js +317 -318
  55. package/dist/ui/conversation.js.map +3 -3
  56. package/dist/ui/core-tool-render.d.ts +1 -1
  57. package/dist/ui/core-tool-render.d.ts.map +1 -1
  58. package/dist/ui/dashboard-detail.d.ts +4 -4
  59. package/dist/ui/dashboard-detail.d.ts.map +1 -1
  60. package/dist/ui/dashboard-fabric-graph.d.ts +1 -1
  61. package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -1
  62. package/dist/ui/dashboard-presentation.d.ts +1 -1
  63. package/dist/ui/dashboard-presentation.d.ts.map +1 -1
  64. package/dist/ui/dashboard.d.ts +8 -8
  65. package/dist/ui/dashboard.d.ts.map +1 -1
  66. package/dist/ui/dashboard.js +206 -343
  67. package/dist/ui/dashboard.js.map +3 -3
  68. package/dist/ui/diff-background.d.ts +1 -1
  69. package/dist/ui/diff-background.d.ts.map +1 -1
  70. package/dist/ui/fabric-actor-delivery-selector.d.ts +4 -4
  71. package/dist/ui/fabric-actor-delivery-selector.d.ts.map +1 -1
  72. package/dist/ui/fabric-actor-tool-selector.d.ts +5 -6
  73. package/dist/ui/fabric-actor-tool-selector.d.ts.map +1 -1
  74. package/dist/ui/fabric-host-event-selector.d.ts +4 -4
  75. package/dist/ui/fabric-host-event-selector.d.ts.map +1 -1
  76. package/dist/ui/fabric-model-selector.d.ts +4 -6
  77. package/dist/ui/fabric-model-selector.d.ts.map +1 -1
  78. package/dist/ui/fabric-render.d.ts +6 -6
  79. package/dist/ui/fabric-render.d.ts.map +1 -1
  80. package/dist/ui/fabric-thinking-selector.d.ts +4 -7
  81. package/dist/ui/fabric-thinking-selector.d.ts.map +1 -1
  82. package/dist/ui/highlight.d.ts +2 -13
  83. package/dist/ui/highlight.d.ts.map +1 -1
  84. package/dist/ui/row-balance.d.ts +6 -6
  85. package/dist/ui/row-balance.d.ts.map +1 -1
  86. package/dist/ui/settings.d.ts +6 -3
  87. package/dist/ui/settings.d.ts.map +1 -1
  88. package/dist/ui/settings.js +239 -113
  89. package/dist/ui/settings.js.map +3 -3
  90. package/dist/ui/state-file-preview.d.ts +1 -1
  91. package/dist/ui/state-file-preview.d.ts.map +1 -1
  92. package/dist/ui/tui/host-term.d.ts +16 -0
  93. package/dist/ui/tui/host-term.d.ts.map +1 -0
  94. package/dist/ui/tui/input.d.ts +19 -0
  95. package/dist/ui/tui/input.d.ts.map +1 -0
  96. package/dist/ui/tui/rows.d.ts +24 -0
  97. package/dist/ui/tui/rows.d.ts.map +1 -0
  98. package/dist/ui/tui/select-list.d.ts +28 -0
  99. package/dist/ui/tui/select-list.d.ts.map +1 -0
  100. package/dist/ui/tui/settings-list.d.ts +38 -0
  101. package/dist/ui/tui/settings-list.d.ts.map +1 -0
  102. package/dist/ui/tui/text-field.d.ts +40 -0
  103. package/dist/ui/tui/text-field.d.ts.map +1 -0
  104. package/dist/ui/tui/view.d.ts +26 -0
  105. package/dist/ui/tui/view.d.ts.map +1 -0
  106. package/dist/ui/widget.d.ts +3 -3
  107. package/dist/ui/widget.d.ts.map +1 -1
  108. package/docs/configuration.md +2 -0
  109. package/docs/interface.md +16 -3
  110. package/package.json +13 -12
  111. package/dist/chunks/chunk-2BOZMRT5.js.map +0 -7
  112. package/dist/chunks/chunk-4XLJPEI4.js.map +0 -7
  113. package/dist/chunks/chunk-CNCRWY4Q.js.map +0 -7
  114. package/dist/chunks/chunk-G2IBGGBM.js +0 -42
  115. package/dist/chunks/chunk-G2IBGGBM.js.map +0 -7
  116. package/dist/chunks/chunk-KIH3KLZU.js.map +0 -7
  117. package/dist/chunks/chunk-NOZBB266.js.map +0 -7
  118. package/dist/chunks/chunk-OJZNMROB.js.map +0 -7
  119. package/dist/ui/symbol-theme.d.ts +0 -3
  120. package/dist/ui/symbol-theme.d.ts.map +0 -1
  121. /package/dist/chunks/{chunk-7QKSPNXQ.js.map → chunk-V5FB7D4C.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  FabricModelSelector
3
- } from "../chunks/chunk-OJZNMROB.js";
3
+ } from "../chunks/chunk-4PPAWZM6.js";
4
4
  import {
5
- ompSymbolTheme
6
- } from "../chunks/chunk-G2IBGGBM.js";
5
+ TextField
6
+ } from "../chunks/chunk-CHXPTZUF.js";
7
7
  import {
8
8
  INHERIT_VALUE,
9
9
  buildClaudeModelSource,
@@ -13,6 +13,19 @@ import {
13
13
  import {
14
14
  DynamicBorder
15
15
  } from "../chunks/chunk-7VIQNUPS.js";
16
+ import {
17
+ BlankRows,
18
+ SelectList,
19
+ Stack,
20
+ TextBlock
21
+ } from "../chunks/chunk-VDYGBL4Z.js";
22
+ import {
23
+ decodeTerminalInput,
24
+ isAction,
25
+ isKey,
26
+ keyMatches,
27
+ typedText
28
+ } from "../chunks/chunk-XVA63H6I.js";
16
29
  import {
17
30
  DEFAULT_FABRIC_CONFIG,
18
31
  MAX_COMPACTION_RATIO_THRESHOLD,
@@ -27,7 +40,7 @@ import {
27
40
  maxExecutorMemoryLimitBytes,
28
41
  resolveAgentDir,
29
42
  saveFabricConfig
30
- } from "../chunks/chunk-CNCRWY4Q.js";
43
+ } from "../chunks/chunk-GS6IWGXQ.js";
31
44
  import {
32
45
  THINKING_LEVELS,
33
46
  thinkingLabel
@@ -35,17 +48,143 @@ import {
35
48
  import "../chunks/chunk-KAD7UWT2.js";
36
49
  import "../chunks/chunk-6YR6XPNF.js";
37
50
 
51
+ // src/ui/tui/settings-list.ts
52
+ import { padTo, truncate, visibleWidth, wrap } from "@oh-my-pi/pi-tui/text/width";
53
+ import { fuzzyFilter } from "@oh-my-pi/pi-coding-agent/utils/fuzzy";
54
+ var CURSOR = "\u2192 ";
55
+ var LABEL_MAX = 40;
56
+ var SettingsList = class {
57
+ constructor(items, maxVisible, theme, onChange, onCancel, options = {}) {
58
+ this.items = items;
59
+ this.maxVisible = maxVisible;
60
+ this.theme = theme;
61
+ this.onChange = onChange;
62
+ this.onCancel = onCancel;
63
+ this.options = options;
64
+ }
65
+ selectedIndex = 0;
66
+ query = "";
67
+ submenu;
68
+ getSelectedItem() {
69
+ return this.visibleItems()[this.selectedIndex];
70
+ }
71
+ selectItem(id) {
72
+ this.query = "";
73
+ const index = this.items.findIndex((item) => item.id === id);
74
+ if (index < 0) return false;
75
+ this.selectedIndex = index;
76
+ return true;
77
+ }
78
+ updateValue(id, value) {
79
+ const item = this.items.find((candidate) => candidate.id === id);
80
+ if (item) item.currentValue = value;
81
+ }
82
+ handleInput(data) {
83
+ for (const event of decodeTerminalInput(data)) {
84
+ if (this.submenu) {
85
+ this.submenu.handleInput?.(event.type === "paste" ? `\x1B[200~${event.text}\x1B[201~` : event.key.raw);
86
+ continue;
87
+ }
88
+ if (event.type === "paste") {
89
+ if (this.options.typeToSearch) this.setQuery(this.query + event.text.replace(/\s+/g, " "));
90
+ continue;
91
+ }
92
+ const key = event.key;
93
+ const count = this.visibleItems().length;
94
+ if (keyMatches(key, "select.cancel")) {
95
+ if (this.query !== "") this.setQuery("");
96
+ else this.onCancel();
97
+ } else if (keyMatches(key, "select.up")) {
98
+ if (count > 0) this.selectedIndex = (this.selectedIndex - 1 + count) % count;
99
+ } else if (keyMatches(key, "select.down")) {
100
+ if (count > 0) this.selectedIndex = (this.selectedIndex + 1) % count;
101
+ } else if (keyMatches(key, "select.pageUp")) {
102
+ this.selectedIndex = Math.max(0, this.selectedIndex - this.pageSize());
103
+ } else if (keyMatches(key, "select.pageDown")) {
104
+ this.selectedIndex = Math.max(0, Math.min(count - 1, this.selectedIndex + this.pageSize()));
105
+ } else if (keyMatches(key, "select.confirm") || key.id === "space" && this.query === "") {
106
+ this.activate();
107
+ } else if (this.options.typeToSearch && keyMatches(key, "editor.deleteCharBackward")) {
108
+ if (this.query !== "") this.setQuery(Array.from(this.query).slice(0, -1).join(""));
109
+ } else if (this.options.typeToSearch) {
110
+ const typed = typedText(key);
111
+ if (typed !== void 0) this.setQuery(this.query + typed);
112
+ }
113
+ }
114
+ }
115
+ render(width) {
116
+ if (this.submenu) return [...this.submenu.render(width)];
117
+ const items = this.visibleItems();
118
+ const rows = [];
119
+ if (this.query !== "") rows.push(truncate(`${this.theme.fg("muted", "Search: ")}${this.query}`, width));
120
+ if (items.length === 0) {
121
+ rows.push(this.theme.fg("muted", this.items.length === 0 ? " No settings available" : " No matching settings"));
122
+ return rows;
123
+ }
124
+ const visible = this.pageSize();
125
+ const start = Math.max(0, Math.min(this.selectedIndex - Math.floor(visible / 2), items.length - visible));
126
+ const end = Math.min(items.length, start + visible);
127
+ const labelWidth = Math.min(LABEL_MAX, Math.max(...items.map((item) => visibleWidth(item.label))));
128
+ for (let index = start; index < end; index++) {
129
+ const item = items[index];
130
+ const selected = index === this.selectedIndex;
131
+ const prefix = selected ? this.theme.fg("accent", CURSOR) : " ".repeat(CURSOR.length);
132
+ const label = padTo(truncate(item.label, labelWidth), labelWidth);
133
+ const valueRoom = Math.max(1, width - CURSOR.length - labelWidth - 2);
134
+ const value = truncate(item.currentValue, valueRoom);
135
+ rows.push(truncate(
136
+ `${prefix}${selected ? this.theme.fg("accent", label) : label} ${this.theme.fg(selected ? "accent" : "muted", value)}`,
137
+ width
138
+ ));
139
+ }
140
+ if (start > 0 || end < items.length) {
141
+ rows.push(this.theme.fg("dim", ` (${this.selectedIndex + 1}/${items.length})`));
142
+ }
143
+ const description = items[this.selectedIndex]?.description;
144
+ if (description) {
145
+ rows.push("");
146
+ for (const line of wrap(description, Math.max(1, width - 2))) rows.push(this.theme.fg("dim", ` ${line}`));
147
+ }
148
+ rows.push("");
149
+ rows.push(this.theme.fg("dim", truncate(this.hint(), width)));
150
+ return rows;
151
+ }
152
+ hint() {
153
+ return this.options.typeToSearch ? " Enter/Space to change \xB7 Type to search \xB7 Esc to cancel" : " Enter/Space to change \xB7 Esc to cancel";
154
+ }
155
+ pageSize() {
156
+ return Math.max(1, this.maxVisible);
157
+ }
158
+ visibleItems() {
159
+ const query = this.query.trim();
160
+ return query === "" ? this.items : fuzzyFilter(this.items, query, (item) => `${item.label} ${item.id} ${item.currentValue} ${item.description ?? ""} ${(item.values ?? []).join(" ")}`);
161
+ }
162
+ setQuery(query) {
163
+ this.query = query;
164
+ this.selectedIndex = 0;
165
+ }
166
+ activate() {
167
+ const item = this.getSelectedItem();
168
+ if (!item) return;
169
+ if (item.values && item.values.length > 0) {
170
+ const index = item.values.indexOf(item.currentValue);
171
+ const next = item.values[(index + 1) % item.values.length];
172
+ item.currentValue = next;
173
+ this.onChange(item.id, next);
174
+ return;
175
+ }
176
+ if (!item.submenu) return;
177
+ this.submenu = item.submenu(item.currentValue, (selectedValue) => {
178
+ this.submenu?.dispose?.();
179
+ this.submenu = void 0;
180
+ if (selectedValue === void 0) return;
181
+ item.currentValue = selectedValue;
182
+ this.onChange(item.id, selectedValue);
183
+ });
184
+ }
185
+ };
186
+
38
187
  // src/ui/settings.ts
39
- import {
40
- Container,
41
- Input,
42
- Key,
43
- matchesKey,
44
- SelectList,
45
- SettingsList,
46
- Spacer,
47
- Text
48
- } from "@oh-my-pi/pi-tui";
49
188
  var SUBMENU_LAYOUT = {
50
189
  minPrimaryColumnWidth: 12,
51
190
  maxPrimaryColumnWidth: 32
@@ -134,23 +273,8 @@ var ALIASED_CONFIG_KEYS = {
134
273
  "compaction.tokenThresholds": COMPACTION_THRESHOLD_SETTING_ID,
135
274
  "image.models": "image.models.1"
136
275
  };
137
- var SAVE_SCOPE_SHORTCUT = Key.ctrl("g");
276
+ var SAVE_SCOPE_SHORTCUT = "ctrl+g";
138
277
  var unique = (values) => [...new Set(values)];
139
- var settingsListTheme = (theme) => ({
140
- label: (text, selected) => selected ? theme.fg("accent", text) : text,
141
- value: (text, selected) => selected ? theme.fg("accent", text) : theme.fg("muted", text),
142
- description: (text) => theme.fg("dim", text),
143
- cursor: theme.fg("accent", "\u2192 "),
144
- hint: (text) => theme.fg("dim", text)
145
- });
146
- var selectListTheme = (theme) => ({
147
- selectedPrefix: (text) => theme.fg("accent", text),
148
- selectedText: (text) => theme.fg("accent", text),
149
- description: (text) => theme.fg("muted", text),
150
- scrollInfo: (text) => theme.fg("muted", text),
151
- noMatch: (text) => theme.fg("muted", text),
152
- symbols: ompSymbolTheme
153
- });
154
278
  var formatDebounce = (ms) => ms === 0 ? "Off" : ms < 1e3 ? `${ms}ms` : `${ms / 1e3}s`;
155
279
  var formatMs = (ms) => ms < 1e3 ? `${ms}ms` : ms < 6e4 ? `${ms / 1e3}s` : ms < 36e5 ? `${ms / 6e4}m` : `${ms / 36e5}h`;
156
280
  var formatRetention = (ms) => ms >= 24 * 60 * 60 * 1e3 && ms % (24 * 60 * 60 * 1e3) === 0 ? `${ms / (24 * 60 * 60 * 1e3)}d` : formatMs(ms);
@@ -469,19 +593,17 @@ var sectionSubmenu = (theme, title, description, items, persist, rebuild) => (_c
469
593
  true,
470
594
  rebuild === void 0 ? void 0 : () => markDrillIn(rebuild())
471
595
  );
472
- var IntegerInputSubmenu = class extends Container {
473
- input;
474
- validationText;
596
+ var IntegerInputSubmenu = class extends Stack {
475
597
  constructor(theme, title, description, currentValue, onSelect, onCancel) {
476
598
  super();
477
- this.addChild(new Text(theme.bold(theme.fg("accent", title)), 0, 0));
478
- this.addChild(new Spacer(1));
479
- this.addChild(new Text(theme.fg("muted", description), 0, 0));
480
- this.addChild(new Spacer(1));
481
- this.input = new Input();
482
- this.input.handleInput(currentValue);
483
- this.input.focused = true;
484
- this.validationText = new Text("", 0, 0);
599
+ this.onCancel = onCancel;
600
+ this.add(new TextBlock(theme.style("strong", theme.fg("accent", title))));
601
+ this.add(new BlankRows(1));
602
+ this.add(new TextBlock(theme.fg("muted", description)));
603
+ this.add(new BlankRows(1));
604
+ this.input = new TextField();
605
+ this.input.setText(currentValue);
606
+ this.validationText = new TextBlock();
485
607
  this.input.onSubmit = (value) => {
486
608
  const normalized = value.trim();
487
609
  const parsed = /^\d+$/.test(normalized) ? Number(normalized) : Number.NaN;
@@ -493,40 +615,38 @@ var IntegerInputSubmenu = class extends Container {
493
615
  }
494
616
  onSelect(String(parsed));
495
617
  };
496
- this.input.onEscape = onCancel;
497
- this.addChild(this.input);
498
- this.addChild(this.validationText);
499
- this.addChild(new Spacer(1));
500
- this.addChild(new Text(theme.fg("dim", " Enter to save \xB7 Esc to go back"), 0, 0));
618
+ this.add(this.input);
619
+ this.add(this.validationText);
620
+ this.add(new BlankRows(1));
621
+ this.add(new TextBlock(theme.fg("dim", " Enter to save \xB7 Esc to go back")));
501
622
  }
623
+ input;
624
+ validationText;
502
625
  handleInput(data) {
503
626
  this.validationText.setText("");
627
+ if (isAction(data, "select.cancel")) {
628
+ this.onCancel();
629
+ return;
630
+ }
504
631
  this.input.handleInput(data);
505
632
  }
506
- render(width) {
507
- this.input.focused = true;
508
- return super.render(width);
509
- }
510
633
  submitRpc(value) {
511
- this.input.setValue(value);
512
- this.input.handleInput("\r");
634
+ this.input.setText(value);
635
+ this.input.onSubmit?.(this.input.getText());
513
636
  }
514
637
  };
515
- var StringInputSubmenu = class extends Container {
516
- input;
517
- validationText;
518
- validate;
638
+ var StringInputSubmenu = class extends Stack {
519
639
  constructor(theme, title, description, currentValue, onSelect, onCancel, validate) {
520
640
  super();
641
+ this.onCancel = onCancel;
521
642
  this.validate = validate;
522
- this.addChild(new Text(theme.bold(theme.fg("accent", title)), 0, 0));
523
- this.addChild(new Spacer(1));
524
- this.addChild(new Text(theme.fg("muted", description), 0, 0));
525
- this.addChild(new Spacer(1));
526
- this.input = new Input();
527
- this.input.handleInput(currentValue);
528
- this.input.focused = true;
529
- this.validationText = new Text("", 0, 0);
643
+ this.add(new TextBlock(theme.style("strong", theme.fg("accent", title))));
644
+ this.add(new BlankRows(1));
645
+ this.add(new TextBlock(theme.fg("muted", description)));
646
+ this.add(new BlankRows(1));
647
+ this.input = new TextField();
648
+ this.input.setText(currentValue);
649
+ this.validationText = new TextBlock();
530
650
  this.input.onSubmit = (value) => {
531
651
  const normalized = value.trim();
532
652
  const error = this.validationError(normalized);
@@ -536,53 +656,55 @@ var StringInputSubmenu = class extends Container {
536
656
  }
537
657
  onSelect(normalized);
538
658
  };
539
- this.input.onEscape = onCancel;
540
- this.addChild(this.input);
541
- this.addChild(this.validationText);
542
- this.addChild(new Spacer(1));
543
- this.addChild(new Text(theme.fg("dim", " Enter to save \xB7 Esc to go back"), 0, 0));
659
+ this.add(this.input);
660
+ this.add(this.validationText);
661
+ this.add(new BlankRows(1));
662
+ this.add(new TextBlock(theme.fg("dim", " Enter to save \xB7 Esc to go back")));
544
663
  }
664
+ input;
665
+ validationText;
666
+ validate;
545
667
  validationError(value) {
546
668
  return this.validate?.(value.trim());
547
669
  }
548
670
  handleInput(data) {
549
671
  this.validationText.setText("");
672
+ if (isAction(data, "select.cancel")) {
673
+ this.onCancel();
674
+ return;
675
+ }
550
676
  this.input.handleInput(data);
551
677
  }
552
- render(width) {
553
- this.input.focused = true;
554
- return super.render(width);
555
- }
556
678
  submitRpc(value) {
557
- this.input.setValue(value);
558
- this.input.handleInput("\r");
679
+ this.input.setText(value);
680
+ this.input.onSubmit?.(this.input.getText());
559
681
  }
560
682
  };
561
- var SelectSubmenu = class extends Container {
683
+ var SelectSubmenu = class extends Stack {
562
684
  selectList;
563
685
  options;
564
686
  constructor(theme, title, description, options, currentValue, onSelect, onCancel) {
565
687
  super();
566
688
  this.options = options;
567
- this.addChild(new Text(theme.bold(theme.fg("accent", title)), 0, 0));
689
+ this.add(new TextBlock(theme.style("strong", theme.fg("accent", title))));
568
690
  if (description) {
569
- this.addChild(new Spacer(1));
570
- this.addChild(new Text(theme.fg("muted", description), 0, 0));
691
+ this.add(new BlankRows(1));
692
+ this.add(new TextBlock(theme.fg("muted", description)));
571
693
  }
572
- this.addChild(new Spacer(1));
694
+ this.add(new BlankRows(1));
573
695
  this.selectList = new SelectList(
574
696
  options,
575
697
  Math.min(options.length, 10),
576
- selectListTheme(theme),
698
+ theme,
577
699
  SUBMENU_LAYOUT
578
700
  );
579
701
  const index = options.findIndex((option) => option.value === currentValue);
580
702
  if (index !== -1) this.selectList.setSelectedIndex(index);
581
703
  this.selectList.onSelect = (item) => onSelect(item.value);
582
704
  this.selectList.onCancel = onCancel;
583
- this.addChild(this.selectList);
584
- this.addChild(new Spacer(1));
585
- this.addChild(new Text(theme.fg("dim", " Enter to select \xB7 Esc to go back"), 0, 0));
705
+ this.add(this.selectList);
706
+ this.add(new BlankRows(1));
707
+ this.add(new TextBlock(theme.fg("dim", " Enter to select \xB7 Esc to go back")));
586
708
  }
587
709
  handleInput(data) {
588
710
  this.selectList.handleInput(data);
@@ -594,7 +716,7 @@ var SelectSubmenu = class extends Container {
594
716
  return true;
595
717
  }
596
718
  };
597
- var CompactionThresholdSubmenu = class extends Container {
719
+ var CompactionThresholdSubmenu = class extends Stack {
598
720
  constructor(theme, currentValue, done) {
599
721
  super();
600
722
  this.theme = theme;
@@ -607,7 +729,7 @@ var CompactionThresholdSubmenu = class extends Container {
607
729
  active;
608
730
  swap(next) {
609
731
  this.clear();
610
- this.addChild(next);
732
+ this.add(next);
611
733
  this.active = next;
612
734
  }
613
735
  showSelect() {
@@ -663,7 +785,7 @@ var CompactionThresholdSubmenu = class extends Container {
663
785
  this.swap(inputSubmenu);
664
786
  }
665
787
  handleInput(data) {
666
- this.active.handleInput(data);
788
+ this.active.handleInput?.(data);
667
789
  }
668
790
  completeRpc(selectedValue) {
669
791
  this.done(selectedValue);
@@ -706,7 +828,7 @@ var modelPickerSubmenu = (theme, source, options = {}) => (currentValue, done) =
706
828
  ...options.inheritName ? { inheritName: options.inheritName } : {}
707
829
  });
708
830
  };
709
- var SectionSubmenu = class extends Container {
831
+ var SectionSubmenu = class extends Stack {
710
832
  settingsList;
711
833
  items;
712
834
  applyChange;
@@ -724,25 +846,25 @@ var SectionSubmenu = class extends Container {
724
846
  this.items = rebuild2();
725
847
  this.listContainer.clear();
726
848
  this.settingsList = this.createList(theme, this.items, onChange, onCancel, enableSearch);
727
- this.listContainer.addChild(this.settingsList);
849
+ this.listContainer.add(this.settingsList);
728
850
  });
729
851
  };
730
- this.addChild(new Text(theme.bold(theme.fg("accent", title)), 0, 0));
852
+ this.add(new TextBlock(theme.style("strong", theme.fg("accent", title))));
731
853
  if (description) {
732
- this.addChild(new Spacer(1));
733
- this.addChild(new Text(theme.fg("muted", description), 0, 0));
854
+ this.add(new BlankRows(1));
855
+ this.add(new TextBlock(theme.fg("muted", description)));
734
856
  }
735
- this.addChild(new Spacer(1));
736
- this.listContainer = new Container();
857
+ this.add(new BlankRows(1));
858
+ this.listContainer = new Stack();
737
859
  this.settingsList = this.createList(theme, items, onChange, onCancel, enableSearch);
738
- this.listContainer.addChild(this.settingsList);
739
- this.addChild(this.listContainer);
860
+ this.listContainer.add(this.settingsList);
861
+ this.add(this.listContainer);
740
862
  }
741
863
  createList(theme, items, onChange, onCancel, enableSearch) {
742
864
  return new SettingsList(
743
865
  items,
744
866
  Math.min(items.length, 16),
745
- settingsListTheme(theme),
867
+ theme,
746
868
  (id, newValue) => this.applyChange(id, newValue),
747
869
  onCancel,
748
870
  { typeToSearch: enableSearch }
@@ -752,7 +874,7 @@ var SectionSubmenu = class extends Container {
752
874
  this.settingsList.handleInput(data);
753
875
  }
754
876
  };
755
- var FabricSettingsComponent = class extends Container {
877
+ var FabricSettingsComponent = class extends Stack {
756
878
  settingsList;
757
879
  theme;
758
880
  saveScopeText;
@@ -773,19 +895,19 @@ var FabricSettingsComponent = class extends Container {
773
895
  this.onSaveScopeChange = options.onSaveScopeChange ?? (() => {
774
896
  });
775
897
  this.itemsForSaveScope = options.itemsForSaveScope;
776
- this.addChild(new DynamicBorder((text) => theme.fg("border", text)));
777
- this.saveScopeText = new Text("", 1, 0);
898
+ this.add(new DynamicBorder((text) => theme.fg("border", text)));
899
+ this.saveScopeText = new TextBlock("", 1, 0);
778
900
  this.updateSaveScopeText();
779
- this.addChild(this.saveScopeText);
780
- this.addChild(new Spacer(1));
781
- this.settingsListContainer = new Container();
901
+ this.add(this.saveScopeText);
902
+ this.add(new BlankRows(1));
903
+ this.settingsListContainer = new Stack();
782
904
  this.settingsList = this.createSettingsList(items);
783
- this.settingsListContainer.addChild(this.settingsList);
784
- this.addChild(this.settingsListContainer);
785
- this.addChild(new DynamicBorder((text) => theme.fg("border", text)));
905
+ this.settingsListContainer.add(this.settingsList);
906
+ this.add(this.settingsListContainer);
907
+ this.add(new DynamicBorder((text) => theme.fg("border", text)));
786
908
  }
787
909
  handleInput(data) {
788
- if (matchesKey(data, SAVE_SCOPE_SHORTCUT)) {
910
+ if (isKey(data, SAVE_SCOPE_SHORTCUT)) {
789
911
  if (!this.projectScopeAvailable) return;
790
912
  this.saveScope = this.saveScope === "project" ? "global" : "project";
791
913
  this.updateSaveScopeText();
@@ -794,7 +916,7 @@ var FabricSettingsComponent = class extends Container {
794
916
  if (nextItems) {
795
917
  this.settingsListContainer.clear();
796
918
  this.settingsList = this.createSettingsList(nextItems);
797
- this.settingsListContainer.addChild(this.settingsList);
919
+ this.settingsListContainer.add(this.settingsList);
798
920
  }
799
921
  return;
800
922
  }
@@ -804,7 +926,7 @@ var FabricSettingsComponent = class extends Container {
804
926
  return new SettingsList(
805
927
  items,
806
928
  10,
807
- settingsListTheme(this.theme),
929
+ this.theme,
808
930
  this.onChange,
809
931
  this.onCancel,
810
932
  { typeToSearch: true }
@@ -1612,6 +1734,10 @@ var buildFabricSettingsItems = (theme, config, apply, options) => {
1612
1734
  description: "Hide captured tools from the parent model's tool schema.",
1613
1735
  values: BOOLEANS
1614
1736
  }),
1737
+ setting("capture.keepEssentialVisible", "Keep essential visible", config.capture.keepEssentialVisible ? "true" : "false", {
1738
+ description: `Keep captured tools that declare loadMode "essential" in the parent model's tool schema.`,
1739
+ values: BOOLEANS
1740
+ }),
1615
1741
  setting("capture.defaultRisk", "Default risk", config.capture.defaultRisk, {
1616
1742
  description: "Approval risk level applied to registered tools without an explicit override.",
1617
1743
  values: RISKS
@@ -2535,7 +2661,7 @@ var editRpcSetting = async (context, path, item, onChange) => {
2535
2661
  if (selected === void 0 || !component.selectRpc(selected)) return;
2536
2662
  } else if (component instanceof IntegerInputSubmenu) {
2537
2663
  while (!completed) {
2538
- const value = await context.ui.input(rpcTitle(path, item.description), component.input.getValue());
2664
+ const value = await context.ui.input(rpcTitle(path, item.description), component.input.getText());
2539
2665
  if (value === void 0) return;
2540
2666
  if (!/^\d+$/.test(value.trim()) || !Number.isSafeInteger(Number(value.trim()))) {
2541
2667
  context.ui.notify("Enter a non-negative safe integer.", "warning");
@@ -2545,7 +2671,7 @@ var editRpcSetting = async (context, path, item, onChange) => {
2545
2671
  }
2546
2672
  } else if (component instanceof StringInputSubmenu) {
2547
2673
  while (!completed) {
2548
- const value = await context.ui.input(rpcTitle(path, item.description), component.input.getValue());
2674
+ const value = await context.ui.input(rpcTitle(path, item.description), component.input.getText());
2549
2675
  if (value === void 0) return;
2550
2676
  const error = component.validationError(value);
2551
2677
  if (error !== void 0) {
@@ -2704,7 +2830,7 @@ async function openFabricSettings(context, deps) {
2704
2830
  return;
2705
2831
  } else {
2706
2832
  await context.ui.custom(
2707
- (tui, theme, _keybindings, done) => {
2833
+ (ui, theme, _keybindings, done) => {
2708
2834
  const component = new FabricSettingsComponent(
2709
2835
  theme,
2710
2836
  itemsForScope(saveScope, theme),
@@ -2715,7 +2841,7 @@ async function openFabricSettings(context, deps) {
2715
2841
  projectScopeAvailable: projectTrusted,
2716
2842
  onSaveScopeChange: (scope) => {
2717
2843
  saveScope = scope;
2718
- tui.requestRender();
2844
+ ui.requestRender();
2719
2845
  },
2720
2846
  itemsForSaveScope: (scope) => itemsForScope(scope, theme)
2721
2847
  }