@femtomc/mu-agent 26.2.113 → 26.2.115

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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.113",
3
+ "version": "26.2.115",
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.113",
27
+ "@femtomc/mu-core": "26.2.115",
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