@femtomc/mu-agent 26.2.112 → 26.2.113
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/assets/mu-tui-logo.png +0 -0
- package/dist/extensions/ui.d.ts.map +1 -1
- package/dist/extensions/ui.js +37 -19
- package/package.json +2 -2
package/assets/mu-tui-logo.png
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/extensions/ui.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/extensions/ui.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAw4CpF,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,QA6N3C;AAED,eAAe,WAAW,CAAC"}
|
package/dist/extensions/ui.js
CHANGED
|
@@ -13,6 +13,8 @@ const UI_PICKER_PANEL_MAX_WIDTH = 118;
|
|
|
13
13
|
const UI_PICKER_PANEL_WIDTH_RATIO = 0.9;
|
|
14
14
|
const UI_PICKER_PANEL_TOP_MARGIN = 1;
|
|
15
15
|
const UI_PICKER_PANEL_BOTTOM_MARGIN = 1;
|
|
16
|
+
const UI_PICKER_PANEL_INNER_PADDING_X = 2;
|
|
17
|
+
const UI_PICKER_PANEL_INNER_PADDING_Y = 1;
|
|
16
18
|
const UI_PICKER_TWO_PANE_MIN_WIDTH = 92;
|
|
17
19
|
const UI_PICKER_TWO_PANE_LEFT_MIN = 24;
|
|
18
20
|
const UI_PICKER_TWO_PANE_RIGHT_MIN = 32;
|
|
@@ -858,26 +860,33 @@ class UiActionPickerComponent {
|
|
|
858
860
|
const panelTargetWidth = Math.max(UI_PICKER_PANEL_MIN_WIDTH, Math.min(UI_PICKER_PANEL_MAX_WIDTH, Math.floor(width * UI_PICKER_PANEL_WIDTH_RATIO)));
|
|
859
861
|
const panelWidth = Math.max(4, Math.min(width, panelTargetWidth));
|
|
860
862
|
const innerWidth = Math.max(1, panelWidth - 2);
|
|
863
|
+
const horizontalPadding = Math.min(UI_PICKER_PANEL_INNER_PADDING_X, Math.max(0, Math.floor((innerWidth - 1) / 2)));
|
|
864
|
+
const contentWidth = Math.max(1, innerWidth - horizontalPadding * 2);
|
|
861
865
|
const selectedDoc = this.#currentEntry().doc;
|
|
862
866
|
const selectedActions = this.#currentActions();
|
|
863
867
|
const renderLines = [];
|
|
868
|
+
const innerPadSegment = horizontalPadding > 0 ? this.#theme.bg("customMessageBg", " ".repeat(horizontalPadding)) : "";
|
|
869
|
+
const contentRowText = (line, bg) => {
|
|
870
|
+
const core = this.#theme.bg(bg, fitStyledLine(line, contentWidth));
|
|
871
|
+
return `${innerPadSegment}${core}${innerPadSegment}`;
|
|
872
|
+
};
|
|
864
873
|
const pushFullLine = (line) => {
|
|
865
874
|
renderLines.push({
|
|
866
|
-
text:
|
|
875
|
+
text: contentRowText(line, "customMessageBg"),
|
|
867
876
|
});
|
|
868
877
|
};
|
|
869
878
|
const modeLabel = this.#mode === "action" ? "action focus" : "document focus";
|
|
870
879
|
pushFullLine(`${this.#theme.fg("accent", "mu_ui")}${this.#theme.fg("dim", ` · ${this.#entries.length} ${pluralize(this.#entries.length, "doc")} · ${modeLabel}`)}`);
|
|
871
|
-
pushFullLine(this.#theme.fg("dim", short(UI_PICKER_INTERACTION_HINT, Math.max(8,
|
|
872
|
-
pushFullLine(this.#theme.fg("borderMuted", "─".repeat(
|
|
880
|
+
pushFullLine(this.#theme.fg("dim", short(UI_PICKER_INTERACTION_HINT, Math.max(8, contentWidth))));
|
|
881
|
+
pushFullLine(this.#theme.fg("borderMuted", "─".repeat(contentWidth)));
|
|
873
882
|
const minTwoPaneWidth = UI_PICKER_TWO_PANE_LEFT_MIN + UI_PICKER_TWO_PANE_RIGHT_MIN + UI_PICKER_TWO_PANE_SEPARATOR_WIDTH;
|
|
874
|
-
const useTwoPane =
|
|
883
|
+
const useTwoPane = contentWidth >= UI_PICKER_TWO_PANE_MIN_WIDTH && contentWidth >= minTwoPaneWidth;
|
|
875
884
|
if (useTwoPane) {
|
|
876
|
-
let leftWidth = Math.max(UI_PICKER_TWO_PANE_LEFT_MIN, Math.floor(
|
|
877
|
-
let rightWidth =
|
|
885
|
+
let leftWidth = Math.max(UI_PICKER_TWO_PANE_LEFT_MIN, Math.floor(contentWidth * 0.34));
|
|
886
|
+
let rightWidth = contentWidth - leftWidth - UI_PICKER_TWO_PANE_SEPARATOR_WIDTH;
|
|
878
887
|
if (rightWidth < UI_PICKER_TWO_PANE_RIGHT_MIN) {
|
|
879
|
-
leftWidth = Math.max(UI_PICKER_TWO_PANE_LEFT_MIN,
|
|
880
|
-
rightWidth =
|
|
888
|
+
leftWidth = Math.max(UI_PICKER_TWO_PANE_LEFT_MIN, contentWidth - UI_PICKER_TWO_PANE_RIGHT_MIN - UI_PICKER_TWO_PANE_SEPARATOR_WIDTH);
|
|
889
|
+
rightWidth = contentWidth - leftWidth - UI_PICKER_TWO_PANE_SEPARATOR_WIDTH;
|
|
881
890
|
}
|
|
882
891
|
const leftLines = this.#buildDocsLines();
|
|
883
892
|
const rightLines = this.#buildDetailLines();
|
|
@@ -889,7 +898,7 @@ class UiActionPickerComponent {
|
|
|
889
898
|
const separator = this.#theme.bg("customMessageBg", this.#theme.fg("borderMuted", " │ "));
|
|
890
899
|
const rightCell = this.#theme.bg(right?.selected ? "selectedBg" : "customMessageBg", fitStyledLine(right?.text ?? "", rightWidth));
|
|
891
900
|
const row = {
|
|
892
|
-
text: `${leftCell}${separator}${rightCell}`,
|
|
901
|
+
text: `${innerPadSegment}${leftCell}${separator}${rightCell}${innerPadSegment}`,
|
|
893
902
|
};
|
|
894
903
|
if (left?.docIndex !== undefined) {
|
|
895
904
|
row.docTarget = {
|
|
@@ -912,29 +921,30 @@ class UiActionPickerComponent {
|
|
|
912
921
|
const singleColumn = this.#singleColumnLines();
|
|
913
922
|
for (const line of singleColumn) {
|
|
914
923
|
const row = {
|
|
915
|
-
text:
|
|
924
|
+
text: contentRowText(line.text, line.selected ? "selectedBg" : "customMessageBg"),
|
|
916
925
|
};
|
|
917
926
|
if (line.docIndex !== undefined) {
|
|
918
927
|
row.docTarget = {
|
|
919
928
|
index: line.docIndex,
|
|
920
929
|
colStart: 1,
|
|
921
|
-
colEnd:
|
|
930
|
+
colEnd: contentWidth,
|
|
922
931
|
};
|
|
923
932
|
}
|
|
924
933
|
if (line.actionIndex !== undefined) {
|
|
925
934
|
row.actionTarget = {
|
|
926
935
|
index: line.actionIndex,
|
|
927
936
|
colStart: 1,
|
|
928
|
-
colEnd:
|
|
937
|
+
colEnd: contentWidth,
|
|
929
938
|
};
|
|
930
939
|
}
|
|
931
940
|
renderLines.push(row);
|
|
932
941
|
}
|
|
933
942
|
}
|
|
934
|
-
pushFullLine(this.#theme.fg("borderMuted", "─".repeat(
|
|
935
|
-
pushFullLine(this.#theme.fg("dim", short(`selected ${selectedDoc.ui_id} · revision ${selectedDoc.revision.version} · ${selectedActions.length} ${pluralize(selectedActions.length, "action")}`, Math.max(8,
|
|
943
|
+
pushFullLine(this.#theme.fg("borderMuted", "─".repeat(contentWidth)));
|
|
944
|
+
pushFullLine(this.#theme.fg("dim", short(`selected ${selectedDoc.ui_id} · revision ${selectedDoc.revision.version} · ${selectedActions.length} ${pluralize(selectedActions.length, "action")}`, Math.max(8, contentWidth))));
|
|
936
945
|
const topMarginRows = Math.max(0, UI_PICKER_PANEL_TOP_MARGIN);
|
|
937
946
|
const bottomMarginRows = Math.max(0, UI_PICKER_PANEL_BOTTOM_MARGIN);
|
|
947
|
+
const verticalPadding = Math.max(0, UI_PICKER_PANEL_INNER_PADDING_Y);
|
|
938
948
|
const leftPadWidth = Math.max(0, Math.floor((width - panelWidth) / 2));
|
|
939
949
|
const leftPad = " ".repeat(leftPadWidth);
|
|
940
950
|
const panelColStart = leftPadWidth + 1;
|
|
@@ -948,6 +958,10 @@ class UiActionPickerComponent {
|
|
|
948
958
|
const rightRule = "─".repeat(Math.max(0, innerWidth - titleWidth - leftRule.length));
|
|
949
959
|
frame.push(`${leftPad}${this.#theme.fg("borderAccent", `╭${leftRule}`)}${this.#theme.fg("accent", title)}${this.#theme.fg("borderAccent", `${rightRule}╮`)}`);
|
|
950
960
|
this.#mouseTargets = [];
|
|
961
|
+
const blankInnerRow = `${leftPad}${this.#theme.fg("border", "│")}${this.#theme.bg("customMessageBg", " ".repeat(innerWidth))}${this.#theme.fg("border", "│")}`;
|
|
962
|
+
for (let row = 0; row < verticalPadding; row += 1) {
|
|
963
|
+
frame.push(blankInnerRow);
|
|
964
|
+
}
|
|
951
965
|
const contentStartRow = frame.length + 1;
|
|
952
966
|
for (let idx = 0; idx < renderLines.length; idx += 1) {
|
|
953
967
|
const line = renderLines[idx];
|
|
@@ -958,8 +972,8 @@ class UiActionPickerComponent {
|
|
|
958
972
|
kind: "doc",
|
|
959
973
|
index: line.docTarget.index,
|
|
960
974
|
row,
|
|
961
|
-
colStart: panelColStart + line.docTarget.colStart,
|
|
962
|
-
colEnd: panelColStart + line.docTarget.colEnd,
|
|
975
|
+
colStart: panelColStart + horizontalPadding + line.docTarget.colStart,
|
|
976
|
+
colEnd: panelColStart + horizontalPadding + line.docTarget.colEnd,
|
|
963
977
|
});
|
|
964
978
|
}
|
|
965
979
|
if (line.actionTarget) {
|
|
@@ -967,17 +981,21 @@ class UiActionPickerComponent {
|
|
|
967
981
|
kind: "action",
|
|
968
982
|
index: line.actionTarget.index,
|
|
969
983
|
row,
|
|
970
|
-
colStart: panelColStart + line.actionTarget.colStart,
|
|
971
|
-
colEnd: panelColStart + line.actionTarget.colEnd,
|
|
984
|
+
colStart: panelColStart + horizontalPadding + line.actionTarget.colStart,
|
|
985
|
+
colEnd: panelColStart + horizontalPadding + line.actionTarget.colEnd,
|
|
972
986
|
});
|
|
973
987
|
}
|
|
974
988
|
}
|
|
989
|
+
for (let row = 0; row < verticalPadding; row += 1) {
|
|
990
|
+
frame.push(blankInnerRow);
|
|
991
|
+
}
|
|
975
992
|
frame.push(`${leftPad}${this.#theme.fg("borderAccent", `╰${"─".repeat(innerWidth)}╯`)}`);
|
|
976
993
|
for (let row = 0; row < bottomMarginRows; row += 1) {
|
|
977
994
|
frame.push("");
|
|
978
995
|
}
|
|
979
996
|
this.#panelRowStart = topMarginRows + 1;
|
|
980
|
-
|
|
997
|
+
const panelRows = 1 + verticalPadding + renderLines.length + verticalPadding + 1;
|
|
998
|
+
this.#panelRowEnd = this.#panelRowStart + panelRows - 1;
|
|
981
999
|
this.#panelColStart = panelColStart;
|
|
982
1000
|
this.#panelColEnd = leftPadWidth + panelWidth;
|
|
983
1001
|
return frame;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@femtomc/mu-agent",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.113",
|
|
4
4
|
"description": "Shared operator runtime for mu assistant sessions and serve extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mu",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"themes/**"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@femtomc/mu-core": "26.2.
|
|
28
|
+
"@femtomc/mu-core": "26.2.113",
|
|
29
29
|
"@mariozechner/pi-agent-core": "^0.54.2",
|
|
30
30
|
"@mariozechner/pi-ai": "^0.54.2",
|
|
31
31
|
"@mariozechner/pi-coding-agent": "^0.54.2",
|