@femtomc/mu-agent 26.2.114 → 26.2.116

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.
@@ -1 +1 @@
1
- {"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../../src/extensions/branding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAsGpF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,QAuPjD;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../../src/extensions/branding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAwEpF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,QAoOjD;AAED,eAAe,iBAAiB,CAAC"}
@@ -6,10 +6,7 @@
6
6
  * - Terminal title and working message branding
7
7
  * - Lightweight periodic status refresh (open/ready/control-plane)
8
8
  */
9
- import { readFileSync } from "node:fs";
10
9
  import { basename } from "node:path";
11
- import { fileURLToPath } from "node:url";
12
- import { Image as TuiImage, detectCapabilities } from "@mariozechner/pi-tui";
13
10
  import { MU_DEFAULT_THEME_NAME, MU_VERSION } from "../ui_defaults.js";
14
11
  import { registerMuSubcommand } from "./mu-command-dispatcher.js";
15
12
  import { fetchMuStatus, muServerUrl } from "./shared.js";
@@ -20,24 +17,6 @@ const EMPTY_SNAPSHOT = {
20
17
  adapters: [],
21
18
  error: null,
22
19
  };
23
- const TUI_LOGO_MIME_TYPE = "image/png";
24
- const TUI_LOGO_FILENAME = "mu-tui-logo.png";
25
- const TUI_LOGO_MAX_WIDTH_CELLS = 16;
26
- function resolveTuiLogoPath() {
27
- return fileURLToPath(new URL("../../assets/mu-tui-logo.png", import.meta.url));
28
- }
29
- function readTuiLogoBase64() {
30
- try {
31
- return readFileSync(resolveTuiLogoPath()).toString("base64");
32
- }
33
- catch {
34
- return null;
35
- }
36
- }
37
- const TUI_LOGO_BASE64 = readTuiLogoBase64();
38
- function canRenderTuiLogoImage() {
39
- return TUI_LOGO_BASE64 !== null && detectCapabilities().images !== null;
40
- }
41
20
  const ANSI_RE = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
42
21
  function visibleWidth(text) {
43
22
  return text.replace(ANSI_RE, "").length;
@@ -59,12 +38,6 @@ function centerLine(text, width) {
59
38
  const pad = Math.floor((width - vw) / 2);
60
39
  return " ".repeat(pad) + text;
61
40
  }
62
- function centerLogoLines(lines, width) {
63
- const targetLogoWidth = Math.max(1, Math.min(TUI_LOGO_MAX_WIDTH_CELLS, width - 2));
64
- const pad = Math.max(0, Math.floor((width - targetLogoWidth) / 2));
65
- const prefix = " ".repeat(pad);
66
- return lines.map((line) => (line.length > 0 ? `${prefix}${line}` : line));
67
- }
68
41
  function routesFromStatus(adapters, routes) {
69
42
  if (routes && routes.length > 0)
70
43
  return routes;
@@ -112,35 +85,24 @@ export function brandingExtension(pi) {
112
85
  ctx.ui.setTitle(`mu · ${repoName}`);
113
86
  ctx.ui.setWorkingMessage("working…");
114
87
  ctx.ui.setWidget("mu-quick-actions", undefined);
115
- ctx.ui.setHeader((_tui, theme) => {
116
- const logoComponent = canRenderTuiLogoImage()
117
- ? new TuiImage(TUI_LOGO_BASE64, TUI_LOGO_MIME_TYPE, { fallbackColor: (text) => theme.fg("dim", text) }, { maxWidthCells: TUI_LOGO_MAX_WIDTH_CELLS, filename: TUI_LOGO_FILENAME })
118
- : null;
119
- return {
120
- render(width) {
121
- const cpPart = snapshot.error
122
- ? ""
123
- : snapshot.controlPlaneActive
124
- ? ` ${theme.fg("muted", "·")} ${theme.fg("success", `cp:${snapshot.adapters.join(",") || "on"}`)}`
125
- : "";
126
- const line = [
127
- theme.fg("accent", theme.bold("μ")),
128
- theme.fg("muted", "·"),
129
- theme.fg("dim", `v${MU_VERSION}`),
130
- theme.fg("muted", "·"),
131
- theme.fg("dim", repoName),
132
- ].join(" ") + cpPart;
133
- if (!logoComponent) {
134
- return [centerLine(line, width)];
135
- }
136
- const logoLines = centerLogoLines(logoComponent.render(width), width);
137
- return [...logoLines, centerLine(line, width)];
138
- },
139
- invalidate() {
140
- logoComponent?.invalidate();
141
- },
142
- };
143
- });
88
+ ctx.ui.setHeader((_tui, theme) => ({
89
+ render(width) {
90
+ const cpPart = snapshot.error
91
+ ? ""
92
+ : snapshot.controlPlaneActive
93
+ ? ` ${theme.fg("muted", "·")} ${theme.fg("success", `cp:${snapshot.adapters.join(",") || "on"}`)}`
94
+ : "";
95
+ const line = [
96
+ theme.fg("accent", theme.bold("μ")),
97
+ theme.fg("muted", "·"),
98
+ theme.fg("dim", `v${MU_VERSION}`),
99
+ theme.fg("muted", "·"),
100
+ theme.fg("dim", repoName),
101
+ ].join(" ") + cpPart;
102
+ return [centerLine(line, width)];
103
+ },
104
+ invalidate() { },
105
+ }));
144
106
  ctx.ui.setFooter((tui, theme, footerData) => {
145
107
  const requestRender = () => tui.requestRender();
146
108
  const unsubscribeBranch = footerData.onBranchChange(requestRender);
@@ -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;AAw4CpF,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,QA6N3C;AAED,eAAe,WAAW,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;AA04CpF,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,QA6N3C;AAED,eAAe,WAAW,CAAC"}
@@ -865,7 +865,9 @@ class UiActionPickerComponent {
865
865
  const selectedDoc = this.#currentEntry().doc;
866
866
  const selectedActions = this.#currentActions();
867
867
  const renderLines = [];
868
- const innerPadSegment = horizontalPadding > 0 ? this.#theme.bg("customMessageBg", " ".repeat(horizontalPadding)) : "";
868
+ const panelBg = (text) => this.#theme.bg("customMessageBg", text);
869
+ const borderCell = (tone, text) => panelBg(this.#theme.fg(tone, text));
870
+ const innerPadSegment = horizontalPadding > 0 ? panelBg(" ".repeat(horizontalPadding)) : "";
869
871
  const contentRowText = (line, bg) => {
870
872
  const core = this.#theme.bg(bg, fitStyledLine(line, contentWidth));
871
873
  return `${innerPadSegment}${core}${innerPadSegment}`;
@@ -956,16 +958,16 @@ class UiActionPickerComponent {
956
958
  const titleWidth = Math.min(innerWidth, visibleWidth(title));
957
959
  const leftRule = "─".repeat(Math.max(0, Math.floor((innerWidth - titleWidth) / 2)));
958
960
  const rightRule = "─".repeat(Math.max(0, innerWidth - titleWidth - leftRule.length));
959
- frame.push(`${leftPad}${this.#theme.fg("borderAccent", `╭${leftRule}`)}${this.#theme.fg("accent", title)}${this.#theme.fg("borderAccent", `${rightRule}╮`)}`);
961
+ frame.push(`${leftPad}${panelBg(`${this.#theme.fg("borderAccent", `╭${leftRule}`)}${this.#theme.fg("accent", title)}${this.#theme.fg("borderAccent", `${rightRule}╮`)}`)}`);
960
962
  this.#mouseTargets = [];
961
- const blankInnerRow = `${leftPad}${this.#theme.fg("border", "│")}${this.#theme.bg("customMessageBg", " ".repeat(innerWidth))}${this.#theme.fg("border", "│")}`;
963
+ const blankInnerRow = `${leftPad}${borderCell("border", "│")}${panelBg(" ".repeat(innerWidth))}${borderCell("border", "│")}`;
962
964
  for (let row = 0; row < verticalPadding; row += 1) {
963
965
  frame.push(blankInnerRow);
964
966
  }
965
967
  const contentStartRow = frame.length + 1;
966
968
  for (let idx = 0; idx < renderLines.length; idx += 1) {
967
969
  const line = renderLines[idx];
968
- frame.push(`${leftPad}${this.#theme.fg("border", "│")}${line.text}${this.#theme.fg("border", "│")}`);
970
+ frame.push(`${leftPad}${borderCell("border", "│")}${line.text}${borderCell("border", "│")}`);
969
971
  const row = contentStartRow + idx;
970
972
  if (line.docTarget) {
971
973
  this.#mouseTargets.push({
@@ -989,7 +991,7 @@ class UiActionPickerComponent {
989
991
  for (let row = 0; row < verticalPadding; row += 1) {
990
992
  frame.push(blankInnerRow);
991
993
  }
992
- frame.push(`${leftPad}${this.#theme.fg("borderAccent", `╰${"─".repeat(innerWidth)}╯`)}`);
994
+ frame.push(`${leftPad}${borderCell("borderAccent", `╰${"─".repeat(innerWidth)}╯`)}`);
993
995
  for (let row = 0; row < bottomMarginRows; row += 1) {
994
996
  frame.push("");
995
997
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.114",
3
+ "version": "26.2.116",
4
4
  "description": "Shared operator runtime for mu assistant sessions and serve extensions.",
5
5
  "keywords": [
6
6
  "mu",
@@ -20,12 +20,11 @@
20
20
  },
21
21
  "files": [
22
22
  "dist/**",
23
- "assets/**",
24
23
  "prompts/**",
25
24
  "themes/**"
26
25
  ],
27
26
  "dependencies": {
28
- "@femtomc/mu-core": "26.2.114",
27
+ "@femtomc/mu-core": "26.2.116",
29
28
  "@mariozechner/pi-agent-core": "^0.54.2",
30
29
  "@mariozechner/pi-ai": "^0.54.2",
31
30
  "@mariozechner/pi-coding-agent": "^0.54.2",
Binary file