@runfusion/fusion 0.2.4 → 0.2.5

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 (2) hide show
  1. package/dist/bin.js +42 -9
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -136867,7 +136867,7 @@ function UtilitiesPanel({ isFocused }) {
136867
136867
  { key: "t", label: "Toggle Engine Pause" },
136868
136868
  { key: "?", label: "Help" }
136869
136869
  ];
136870
- return /* @__PURE__ */ jsx(Panel, { title: "Utilities", isFocused, flexShrink: 0, children: /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: actions.map((action) => /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
136870
+ return /* @__PURE__ */ jsx(Panel, { title: "Utilities", isFocused, flexGrow: 1, children: /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: actions.map((action) => /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
136871
136871
  /* @__PURE__ */ jsxs(Text, { color: "yellow", children: [
136872
136872
  "[",
136873
136873
  action.key,
@@ -136998,9 +136998,9 @@ function StatusBar({ state, controller: _controller }) {
136998
136998
  statusParts.push(systemInfo.baseUrl);
136999
136999
  statusParts.push(formatUptime(Date.now() - systemInfo.startTimeMs));
137000
137000
  }
137001
- return /* @__PURE__ */ jsxs(Box, { justifyContent: "space-between", paddingX: 1, children: [
137002
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: hotkeys.join(" \xB7 ") }),
137003
- statusParts.length > 0 && /* @__PURE__ */ jsx(Text, { dimColor: true, children: statusParts.join(" | ") })
137001
+ return /* @__PURE__ */ jsxs(Box, { justifyContent: "space-between", paddingX: 1, flexShrink: 0, children: [
137002
+ /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "truncate-end", children: hotkeys.join(" \xB7 ") }),
137003
+ statusParts.length > 0 && /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "truncate-end", children: statusParts.join(" | ") })
137004
137004
  ] });
137005
137005
  }
137006
137006
  function MainHeader({ state }) {
@@ -137023,12 +137023,12 @@ function MainHeader({ state }) {
137023
137023
  const isActive = (t) => t.kind === "main" ? !inInteractive : inInteractive && t.view === interactiveView;
137024
137024
  if (tiny) {
137025
137025
  const active = tabs.find(isActive);
137026
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, paddingX: 1, children: [
137026
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, paddingX: 1, flexShrink: 0, overflow: "hidden", children: [
137027
137027
  /* @__PURE__ */ jsx(MiniLogo, {}),
137028
137028
  active && /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { backgroundColor: "cyan", color: "black", bold: true, children: ` ${active.key} ${active.label} ` }) })
137029
137029
  ] });
137030
137030
  }
137031
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, paddingX: 1, paddingY: 0, children: [
137031
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, paddingX: 1, paddingY: 0, flexShrink: 0, overflow: "hidden", children: [
137032
137032
  /* @__PURE__ */ jsx(MiniLogo, {}),
137033
137033
  /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2502" }) }),
137034
137034
  tabs.map((t) => {
@@ -139066,6 +139066,15 @@ function InteractiveMode({ state, controller }) {
139066
139066
  function DashboardApp({ controller }) {
139067
139067
  const { exit } = useApp();
139068
139068
  const { stdout } = useStdout();
139069
+ const [, setResizeTick] = useState2(0);
139070
+ useEffect2(() => {
139071
+ if (!stdout) return;
139072
+ const onResize = () => setResizeTick((t) => t + 1);
139073
+ stdout.on("resize", onResize);
139074
+ return () => {
139075
+ stdout.off("resize", onResize);
139076
+ };
139077
+ }, [stdout]);
139069
139078
  const cols = stdout?.columns ?? 80;
139070
139079
  const rows = stdout?.rows ?? 24;
139071
139080
  const state = useSyncExternalStore(
@@ -139216,14 +139225,15 @@ function DashboardApp({ controller }) {
139216
139225
  }
139217
139226
  }
139218
139227
  });
139228
+ const layoutKey = `${cols}x${rows}`;
139219
139229
  if (!state.systemInfo) {
139220
- return /* @__PURE__ */ jsx(Box, { flexDirection: "column", height: rows, children: /* @__PURE__ */ jsx(SplashScreen, { loadingStatus: state.loadingStatus }) });
139230
+ return /* @__PURE__ */ jsx(Box, { flexDirection: "column", height: rows, width: cols, overflow: "hidden", children: /* @__PURE__ */ jsx(SplashScreen, { loadingStatus: state.loadingStatus }) }, layoutKey);
139221
139231
  }
139222
139232
  const isNarrow = cols < 80 || rows < 20;
139223
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", height: rows, children: [
139233
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", height: rows, width: cols, overflow: "hidden", children: [
139224
139234
  state.mode === "interactive" ? /* @__PURE__ */ jsx(InteractiveMode, { state, controller }) : isNarrow ? /* @__PURE__ */ jsx(StatusModeSingle, { state, controller }) : /* @__PURE__ */ jsx(StatusModeGrid, { state, rows, controller }),
139225
139235
  state.showHelp && /* @__PURE__ */ jsx(Box, { position: "absolute", marginTop: 3, marginLeft: 4, children: /* @__PURE__ */ jsx(HelpOverlay, {}) })
139226
- ] });
139236
+ ] }, layoutKey);
139227
139237
  }
139228
139238
  var LOGO_COLORS, NARROW_THRESHOLD, SPLASH_MIN_COLS, SPLASH_MIN_ROWS, LARGE_LOGO_MIN_COLS, LARGE_LOGO_MIN_ROWS, PREFIX_WIDTH, PANEL_ORDER, KANBAN_COLUMNS, COLUMN_COLORS, STEP_ICON, STEP_COLOR, MAX_LOG_ENTRIES2, INITIAL_LOG_LIMIT, SETTING_DEFS, FILES_DENYLIST;
139229
139239
  var init_app = __esm({
@@ -139318,7 +139328,11 @@ var init_controller = __esm({
139318
139328
  // notify() invalidates this; getSnapshot() rebuilds on demand.
139319
139329
  cachedSnapshot = null;
139320
139330
  // Ink instance — set when start() is called.
139331
+ // Loose type — the real Ink Instance has additional methods (clear,
139332
+ // rerender, etc.) that we use defensively below.
139321
139333
  inkInstance = null;
139334
+ // Resize listener attached at start(), detached at stop().
139335
+ resizeListener = null;
139322
139336
  // Uptime ticker to keep footer time live.
139323
139337
  uptimeTimer = null;
139324
139338
  // System stats sampler — process memory + CPU%.
@@ -139547,9 +139561,21 @@ var init_controller = __esm({
139547
139561
  const { render } = await import("ink");
139548
139562
  const { createElement } = await import("react");
139549
139563
  const { DashboardApp: DashboardApp2 } = await Promise.resolve().then(() => (init_app(), app_exports));
139564
+ if (process.stdout?.isTTY && typeof process.stdout.write === "function") {
139565
+ process.stdout.write("\x1B[?1049h\x1B[H");
139566
+ }
139550
139567
  this.inkInstance = render(
139551
139568
  createElement(DashboardApp2, { controller: this })
139552
139569
  );
139570
+ this.resizeListener = () => {
139571
+ try {
139572
+ this.inkInstance?.clear?.();
139573
+ } catch {
139574
+ }
139575
+ };
139576
+ if (process.stdout && typeof process.stdout.on === "function") {
139577
+ process.stdout.on("resize", this.resizeListener);
139578
+ }
139553
139579
  this.uptimeTimer = setInterval(() => {
139554
139580
  if (this.isRunning) this.notify();
139555
139581
  }, 5e3);
@@ -139571,10 +139597,17 @@ var init_controller = __esm({
139571
139597
  clearInterval(this.systemStatsTimer);
139572
139598
  this.systemStatsTimer = null;
139573
139599
  }
139600
+ if (this.resizeListener && process.stdout && typeof process.stdout.off === "function") {
139601
+ process.stdout.off("resize", this.resizeListener);
139602
+ this.resizeListener = null;
139603
+ }
139574
139604
  if (this.inkInstance) {
139575
139605
  this.inkInstance.unmount();
139576
139606
  this.inkInstance = null;
139577
139607
  }
139608
+ if (process.stdout?.isTTY && typeof process.stdout.write === "function") {
139609
+ process.stdout.write("\x1B[?1049l");
139610
+ }
139578
139611
  }
139579
139612
  // ── Private helpers ────────────────────────────────────────────────────────
139580
139613
  clampSelectedLogIndex(entries) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runfusion/fusion",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "license": "MIT",
5
5
  "description": "Fusion CLI: HTTP API server, daemon, dashboard launcher, and task tooling for the Fusion AI coding agent.",
6
6
  "homepage": "https://github.com/Runfusion/Fusion#readme",