@namzu/cli 45.4.0 → 45.4.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 (44) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{bin-main-NJ2NAGPI.js → bin-main-TFRSQAXX.js} +3 -3
  4. package/dist/chunks/{chat-DXPIIYP5.js → chat-D3VWR3YR.js} +2 -2
  5. package/dist/chunks/{chunk-J5NFEZ7Y.js → chunk-3ALDQTHV.js} +3 -3
  6. package/dist/chunks/{chunk-7PDAYGAP.js → chunk-3LQKAYY7.js} +2 -2
  7. package/dist/chunks/{chunk-I3YUF54N.js → chunk-ATUCJYY5.js} +92 -46
  8. package/dist/chunks/chunk-ATUCJYY5.js.map +6 -0
  9. package/dist/chunks/{chunk-HVMVHXWZ.js → chunk-CD3PFLJG.js} +6 -6
  10. package/dist/chunks/{chunk-BV4Q6GZ7.js → chunk-DLAHIIB4.js} +2 -2
  11. package/dist/chunks/{chunk-JNV6273F.js → chunk-YNTWN7WE.js} +2 -2
  12. package/dist/chunks/{chunk-A5L4UGFM.js → chunk-ZKQL4CTJ.js} +2 -2
  13. package/dist/chunks/{doctor-7WER3J7R.js → doctor-FULZISWS.js} +6 -6
  14. package/dist/chunks/{entry-K4X4GXZF.js → entry-JREDN7MF.js} +3 -3
  15. package/dist/chunks/{host-3W7ZPE6Q.js → host-CAEKSCU6.js} +2 -2
  16. package/dist/chunks/{live-TSLMCW2I.js → live-KP4H5HU6.js} +5 -5
  17. package/dist/chunks/{pal-VEA2XW4R.js → pal-L5RWH4TM.js} +2 -2
  18. package/dist/chunks/{start-check-2JJWODNG.js → start-check-JXWT73ZI.js} +2 -2
  19. package/dist/chunks/{tui-7ZC32IBL.js → tui-GH3WJKT3.js} +6 -6
  20. package/dist/chunks/{upgrade-YVFOGNHR.js → upgrade-6UMTZSTP.js} +3 -3
  21. package/dist/chunks/{workspaces-7BI5D7PW.js → workspaces-E24UVQAY.js} +2 -2
  22. package/dist/index.js +6 -6
  23. package/dist/workspaces/host.d.ts.map +1 -1
  24. package/dist/workspaces/sidebar.d.ts +22 -6
  25. package/dist/workspaces/sidebar.d.ts.map +1 -1
  26. package/package.json +8 -8
  27. package/dist/chunks/chunk-I3YUF54N.js.map +0 -6
  28. /package/dist/chunks/{bin-main-NJ2NAGPI.js.map → bin-main-TFRSQAXX.js.map} +0 -0
  29. /package/dist/chunks/{chat-DXPIIYP5.js.map → chat-D3VWR3YR.js.map} +0 -0
  30. /package/dist/chunks/{chunk-J5NFEZ7Y.js.map → chunk-3ALDQTHV.js.map} +0 -0
  31. /package/dist/chunks/{chunk-7PDAYGAP.js.map → chunk-3LQKAYY7.js.map} +0 -0
  32. /package/dist/chunks/{chunk-HVMVHXWZ.js.map → chunk-CD3PFLJG.js.map} +0 -0
  33. /package/dist/chunks/{chunk-BV4Q6GZ7.js.map → chunk-DLAHIIB4.js.map} +0 -0
  34. /package/dist/chunks/{chunk-JNV6273F.js.map → chunk-YNTWN7WE.js.map} +0 -0
  35. /package/dist/chunks/{chunk-A5L4UGFM.js.map → chunk-ZKQL4CTJ.js.map} +0 -0
  36. /package/dist/chunks/{doctor-7WER3J7R.js.map → doctor-FULZISWS.js.map} +0 -0
  37. /package/dist/chunks/{entry-K4X4GXZF.js.map → entry-JREDN7MF.js.map} +0 -0
  38. /package/dist/chunks/{host-3W7ZPE6Q.js.map → host-CAEKSCU6.js.map} +0 -0
  39. /package/dist/chunks/{live-TSLMCW2I.js.map → live-KP4H5HU6.js.map} +0 -0
  40. /package/dist/chunks/{pal-VEA2XW4R.js.map → pal-L5RWH4TM.js.map} +0 -0
  41. /package/dist/chunks/{start-check-2JJWODNG.js.map → start-check-JXWT73ZI.js.map} +0 -0
  42. /package/dist/chunks/{tui-7ZC32IBL.js.map → tui-GH3WJKT3.js.map} +0 -0
  43. /package/dist/chunks/{upgrade-YVFOGNHR.js.map → upgrade-6UMTZSTP.js.map} +0 -0
  44. /package/dist/chunks/{workspaces-7BI5D7PW.js.map → workspaces-E24UVQAY.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @namzu/cli
2
2
 
3
+ ## 45.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c3c261d: In `namzu workspaces`, a workspace with nothing to show under its name, such as a folder outside git, is now one line instead of a line followed by a blank one. A workspace with a branch or a pending note keeps its second line. Scrolling, clicking and dragging follow each row's height.
8
+
3
9
  ## 45.4.0
4
10
 
5
11
  ### Minor Changes
package/dist/bin.js CHANGED
@@ -81,6 +81,6 @@ __name(suppressSqliteExperimentalWarning, "suppressSqliteExperimentalWarning");
81
81
  suppressSqliteExperimentalWarning();
82
82
 
83
83
  // src/bin.ts
84
- var { main } = await import("./chunks/bin-main-NJ2NAGPI.js");
84
+ var { main } = await import("./chunks/bin-main-TFRSQAXX.js");
85
85
  await main(fileURLToPath(new URL("./", import.meta.url).href + "bin.js"));
86
86
  //# sourceMappingURL=bin.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-R66H2G5R.js";
7
7
  import {
8
8
  runCli
9
- } from "./chunk-HVMVHXWZ.js";
9
+ } from "./chunk-CD3PFLJG.js";
10
10
  import "./chunk-MZP6SH3M.js";
11
11
  import {
12
12
  EXIT_INTERNAL_ERROR,
@@ -126,7 +126,7 @@ async function plainFailure(err) {
126
126
  __name(plainFailure, "plainFailure");
127
127
  function main(entrypoint) {
128
128
  if (process.argv[2] === "--start-check") {
129
- return import("./start-check-2JJWODNG.js").then((check) => check.runStartCheck()).then(
129
+ return import("./start-check-JXWT73ZI.js").then((check) => check.runStartCheck()).then(
130
130
  (code) => process.exit(code),
131
131
  () => process.exit(1)
132
132
  );
@@ -165,4 +165,4 @@ __name(main, "main");
165
165
  export {
166
166
  main
167
167
  };
168
- //# sourceMappingURL=bin-main-NJ2NAGPI.js.map
168
+ //# sourceMappingURL=bin-main-TFRSQAXX.js.map
@@ -82,7 +82,7 @@ async function runPalChat(ctx, palId, args, options = {}) {
82
82
  ...ctx.config.composerTriggers ? { composerTriggers: ctx.config.composerTriggers } : {},
83
83
  ...ctx.config.statusLine ? { statusLine: ctx.config.statusLine } : {}
84
84
  };
85
- const { launchTui } = await import("./tui-7ZC32IBL.js");
85
+ const { launchTui } = await import("./tui-GH3WJKT3.js");
86
86
  await launchTui(tui, options);
87
87
  } catch (error) {
88
88
  ctx.formatter.error({ message: error instanceof Error ? error.message : String(error) });
@@ -103,4 +103,4 @@ __name(runPalChat, "runPalChat");
103
103
  export {
104
104
  runPalChat
105
105
  };
106
- //# sourceMappingURL=chat-DXPIIYP5.js.map
106
+ //# sourceMappingURL=chat-D3VWR3YR.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-ZPR4IMRT.js";
6
6
  import {
7
7
  currentInstall
8
- } from "./chunk-A5L4UGFM.js";
8
+ } from "./chunk-ZKQL4CTJ.js";
9
9
  import {
10
10
  readManifest
11
11
  } from "./chunk-AK2U3N2A.js";
@@ -17,7 +17,7 @@ import {
17
17
  readCheck,
18
18
  readLastResult,
19
19
  scopeOf
20
- } from "./chunk-7PDAYGAP.js";
20
+ } from "./chunk-3LQKAYY7.js";
21
21
  import {
22
22
  describeNetwork
23
23
  } from "./chunk-JHDNGNQT.js";
@@ -1206,4 +1206,4 @@ export {
1206
1206
  buildDoctorRegistry,
1207
1207
  runLiveDoctor
1208
1208
  };
1209
- //# sourceMappingURL=chunk-J5NFEZ7Y.js.map
1209
+ //# sourceMappingURL=chunk-3ALDQTHV.js.map
@@ -2,7 +2,7 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
2
2
  const require = __namzuCreateRequire(import.meta.url);
3
3
  import {
4
4
  START_CHECK_FLAG
5
- } from "./chunk-BV4Q6GZ7.js";
5
+ } from "./chunk-DLAHIIB4.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-76FLAFCG.js";
@@ -1186,4 +1186,4 @@ export {
1186
1186
  realRoot,
1187
1187
  resolveUpdatePolicy
1188
1188
  };
1189
- //# sourceMappingURL=chunk-7PDAYGAP.js.map
1189
+ //# sourceMappingURL=chunk-3LQKAYY7.js.map
@@ -1631,8 +1631,8 @@ function geometry(height, footLines, split, rail) {
1631
1631
  ruleY,
1632
1632
  headerY: void 0,
1633
1633
  workspaceTop: 0,
1634
- workspaceStep: 1,
1635
- workspaceCap: Math.max(0, ruleY),
1634
+ workspaceRows: Math.max(0, ruleY),
1635
+ agentStep: 1,
1636
1636
  footerY: void 0,
1637
1637
  agentHeaderY: void 0,
1638
1638
  agentTop: ruleY + 1,
@@ -1648,8 +1648,8 @@ function geometry(height, footLines, split, rail) {
1648
1648
  ruleY,
1649
1649
  headerY: 0,
1650
1650
  workspaceTop: 2,
1651
- workspaceStep: 2,
1652
- workspaceCap: Math.max(0, Math.floor((footerY - 2) / 2)),
1651
+ workspaceRows: Math.max(0, footerY - 2),
1652
+ agentStep: 2,
1653
1653
  footerY,
1654
1654
  agentHeaderY: ruleY + 1,
1655
1655
  agentTop,
@@ -1685,16 +1685,70 @@ function within2(scroll, total, cap, reveal) {
1685
1685
  return Math.max(0, Math.min(next, most));
1686
1686
  }
1687
1687
  __name(within2, "within");
1688
+ function workspaceHeights(model) {
1689
+ return model.roster.workspaces.map((workspace) => {
1690
+ if (model.rail) return 1;
1691
+ if (workspaceNote(model.roster.workspaceDot(workspace)) !== void 0) return 2;
1692
+ return model.git(workspace.cwd) ? 2 : 1;
1693
+ });
1694
+ }
1695
+ __name(workspaceHeights, "workspaceHeights");
1696
+ function fitting(heights, start, rows) {
1697
+ let used = 0;
1698
+ let count = 0;
1699
+ for (let i = start; i < heights.length; i++) {
1700
+ used += heights[i] ?? 1;
1701
+ if (used > rows) break;
1702
+ count++;
1703
+ }
1704
+ return count;
1705
+ }
1706
+ __name(fitting, "fitting");
1707
+ function lastStart(heights, rows) {
1708
+ let used = 0;
1709
+ let start = heights.length;
1710
+ while (start > 0 && used + (heights[start - 1] ?? 1) <= rows) {
1711
+ used += heights[start - 1] ?? 1;
1712
+ start--;
1713
+ }
1714
+ return start;
1715
+ }
1716
+ __name(lastStart, "lastStart");
1717
+ function withinRows(scroll, heights, rows, reveal) {
1718
+ const most = lastStart(heights, rows);
1719
+ let next = Math.max(0, Math.min(scroll, most));
1720
+ if (reveal >= 0 && rows > 0) {
1721
+ if (reveal < next) next = reveal;
1722
+ else while (next < reveal && next + fitting(heights, next, rows) <= reveal) next++;
1723
+ }
1724
+ return Math.max(0, Math.min(next, most));
1725
+ }
1726
+ __name(withinRows, "withinRows");
1727
+ function workspaceSlots(model, height) {
1728
+ const geo = geometry(height, model.foot.length, model.split, model.rail);
1729
+ const heights = workspaceHeights(model);
1730
+ const slots = [];
1731
+ let y = geo.workspaceTop;
1732
+ for (let index = model.scroll.workspaces; index < heights.length; index++) {
1733
+ const rows = heights[index] ?? 1;
1734
+ if (y + rows > geo.workspaceTop + geo.workspaceRows) break;
1735
+ const workspace = model.roster.workspaces[index];
1736
+ if (workspace) slots.push({ workspace, index, y, height: rows });
1737
+ y += rows;
1738
+ }
1739
+ return slots;
1740
+ }
1741
+ __name(workspaceSlots, "workspaceSlots");
1688
1742
  function clampScroll(scroll, model, height, reveal = false) {
1689
1743
  const geo = geometry(height, model.foot.length, model.split, model.rail);
1690
1744
  const selected = model.roster.selected;
1691
1745
  const workspace = selected ? model.roster.workspaceOf(selected) : void 0;
1692
1746
  const agents = agentList(model.roster, model.order);
1693
1747
  return {
1694
- workspaces: within2(
1748
+ workspaces: withinRows(
1695
1749
  scroll.workspaces,
1696
- model.roster.workspaces.length,
1697
- geo.workspaceCap,
1750
+ workspaceHeights(model),
1751
+ geo.workspaceRows,
1698
1752
  reveal && workspace ? model.roster.workspaces.indexOf(workspace) : -1
1699
1753
  ),
1700
1754
  agents: within2(
@@ -1729,14 +1783,13 @@ function hitTest(model, width, height, x, y) {
1729
1783
  if (geo.agentHeaderY !== void 0 && y === geo.agentHeaderY) {
1730
1784
  return x >= width - orderLabel(model.order).length - 1 ? { kind: "order" } : void 0;
1731
1785
  }
1732
- const workspaceLine = y - geo.workspaceTop;
1733
- if (workspaceLine >= 0 && workspaceLine < geo.workspaceCap * geo.workspaceStep && y < geo.ruleY) {
1734
- const workspace = model.roster.workspaces[model.scroll.workspaces + Math.floor(workspaceLine / geo.workspaceStep)];
1735
- return workspace ? { kind: "workspace", workspace } : void 0;
1786
+ if (y >= geo.workspaceTop && y < geo.ruleY) {
1787
+ const slot = workspaceSlots(model, height).find((s) => y >= s.y && y < s.y + s.height);
1788
+ return slot ? { kind: "workspace", workspace: slot.workspace } : void 0;
1736
1789
  }
1737
1790
  const agentLine = y - geo.agentTop;
1738
- if (agentLine >= 0 && agentLine < geo.agentCap * geo.workspaceStep) {
1739
- const entry = agentList(model.roster, model.order)[model.scroll.agents + Math.floor(agentLine / geo.workspaceStep)];
1791
+ if (agentLine >= 0 && agentLine < geo.agentCap * geo.agentStep) {
1792
+ const entry = agentList(model.roster, model.order)[model.scroll.agents + Math.floor(agentLine / geo.agentStep)];
1740
1793
  return entry ? { kind: "agent", entry } : void 0;
1741
1794
  }
1742
1795
  return void 0;
@@ -1827,25 +1880,20 @@ function drawSidebar(frame, rect, model) {
1827
1880
  if (!thumb) return;
1828
1881
  for (let i = 0; i < thumb.length; i++) at(x, top2 + thumb.start + i, "\u2503", { fg: palette.dim });
1829
1882
  }, "bar");
1830
- const workspaceRoom = rect.width - 3 - (roster.workspaces.length > geo.workspaceCap ? 1 : 0);
1883
+ const slots = workspaceSlots(model, rect.height);
1884
+ const workspaceRoom = rect.width - 3 - (slots.length < roster.workspaces.length ? 1 : 0);
1831
1885
  const agentRoom = rect.width - 3 - (agentList(roster, model.order).length > geo.agentCap ? 1 : 0);
1832
1886
  const shown = roster.selected ? roster.workspaceOf(roster.selected) : void 0;
1833
1887
  const agents = agentList(roster, model.order);
1834
1888
  if (geo.headerY !== void 0)
1835
1889
  at(1, geo.headerY, "workspaces", { fg: palette.text, attrs: ATTR_BOLD });
1836
1890
  const reversed = [];
1837
- const workspaces = roster.workspaces.slice(
1838
- model.scroll.workspaces,
1839
- model.scroll.workspaces + geo.workspaceCap
1840
- );
1841
- workspaces.forEach((workspace, i) => {
1842
- const y = geo.workspaceTop + i * geo.workspaceStep;
1843
- const index = model.scroll.workspaces + i;
1891
+ for (const { workspace, index, y, height } of slots) {
1844
1892
  const focused = workspace === shown;
1845
1893
  const dot = roster.workspaceDot(workspace);
1846
1894
  const bg = focused ? navigating ? palette.cursorRow : palette.activeRow : -1;
1847
- tint(y, geo.workspaceStep, bg);
1848
- if (palette.mono && focused && navigating) reversed.push([y, geo.workspaceStep]);
1895
+ tint(y, height, bg);
1896
+ if (palette.mono && focused && navigating) reversed.push([y, height]);
1849
1897
  if (geo.rail) {
1850
1898
  at(0, y, railIndex(index), { fg: palette.dim, bg });
1851
1899
  at(2, y, GLYPHS[dot], {
@@ -1853,7 +1901,7 @@ function drawSidebar(frame, rect, model) {
1853
1901
  bg,
1854
1902
  ...focused ? { attrs: ATTR_BOLD } : {}
1855
1903
  });
1856
- return;
1904
+ continue;
1857
1905
  }
1858
1906
  at(1, y, GLYPHS[dot], { fg: dotColor(dot, palette), bg });
1859
1907
  at(3, y, clip(workspace.name, workspaceRoom), {
@@ -1861,16 +1909,17 @@ function drawSidebar(frame, rect, model) {
1861
1909
  bg,
1862
1910
  ...focused ? { attrs: ATTR_BOLD } : {}
1863
1911
  });
1912
+ if (height === 1) continue;
1864
1913
  const note = workspaceNote(dot);
1865
1914
  if (note) {
1866
1915
  at(3, y + 1, clip(note, workspaceRoom), {
1867
1916
  fg: dot === "blocked" ? palette.blocked : palette.done,
1868
1917
  bg
1869
1918
  });
1870
- return;
1919
+ continue;
1871
1920
  }
1872
1921
  const git = model.git(workspace.cwd);
1873
- if (!git) return;
1922
+ if (!git) continue;
1874
1923
  const counts = [];
1875
1924
  if (git.ahead > 0) counts.push({ text: `\u2191${git.ahead}`, fg: palette.ahead });
1876
1925
  if (git.behind > 0) counts.push({ text: `\u2193${git.behind}`, fg: palette.behind });
@@ -1882,7 +1931,7 @@ function drawSidebar(frame, rect, model) {
1882
1931
  at(x + 1, y + 1, c.text, { fg: c.fg, bg });
1883
1932
  x += 1 + c.text.length;
1884
1933
  }
1885
- });
1934
+ }
1886
1935
  for (const [top2, rows] of reversed)
1887
1936
  for (let row = 0; row < rows; row++)
1888
1937
  for (let x = 0; x < rect.width; x++) {
@@ -1894,9 +1943,9 @@ function drawSidebar(frame, rect, model) {
1894
1943
  bar(
1895
1944
  rect.width - 1,
1896
1945
  geo.workspaceTop,
1897
- geo.workspaceCap * geo.workspaceStep,
1946
+ geo.workspaceRows,
1898
1947
  roster.workspaces.length,
1899
- geo.workspaceCap,
1948
+ slots.length,
1900
1949
  model.scroll.workspaces
1901
1950
  );
1902
1951
  if (geo.footerY !== void 0) {
@@ -1917,12 +1966,12 @@ function drawSidebar(frame, rect, model) {
1917
1966
  }
1918
1967
  const visible = agents.slice(model.scroll.agents, model.scroll.agents + geo.agentCap);
1919
1968
  visible.forEach((entry, i) => {
1920
- const y = geo.agentTop + i * geo.workspaceStep;
1969
+ const y = geo.agentTop + i * geo.agentStep;
1921
1970
  const index = model.scroll.agents + i;
1922
1971
  const focused = entry === roster.selected;
1923
1972
  const dot = entry.dot();
1924
1973
  const bg = focused ? palette.activeRow : -1;
1925
- tint(y, geo.workspaceStep, bg);
1974
+ tint(y, geo.agentStep, bg);
1926
1975
  if (geo.rail) {
1927
1976
  at(0, y, railIndex(index), { fg: palette.dim, bg });
1928
1977
  at(2, y, GLYPHS[dot], {
@@ -1949,7 +1998,7 @@ function drawSidebar(frame, rect, model) {
1949
1998
  bar(
1950
1999
  rect.width - 1,
1951
2000
  geo.agentTop,
1952
- geo.agentCap * geo.workspaceStep,
2001
+ geo.agentCap * geo.agentStep,
1953
2002
  agents.length,
1954
2003
  geo.agentCap,
1955
2004
  model.scroll.agents
@@ -3614,14 +3663,11 @@ var WorkspacesHost = class {
3614
3663
  );
3615
3664
  if (target?.kind === "workspace") drag.to = this.roster.workspaces.indexOf(target.workspace);
3616
3665
  else if (!target) {
3617
- const geo = geometry(
3618
- layout.sidebar.height,
3619
- this.sidebarModel(layout.rail).foot.length,
3620
- this.split,
3621
- layout.rail
3622
- );
3623
- const shown = this.roster.workspaces.length - this.sidebarScroll.workspaces;
3624
- if (event.y >= geo.workspaceTop + shown * geo.workspaceStep && event.y < (geo.footerY ?? geo.ruleY))
3666
+ const model = this.sidebarModel(layout.rail);
3667
+ const geo = geometry(layout.sidebar.height, model.foot.length, this.split, layout.rail);
3668
+ const last = workspaceSlots(model, layout.sidebar.height).at(-1);
3669
+ const end = last ? last.y + last.height : geo.workspaceTop;
3670
+ if (event.y >= end && event.y < (geo.footerY ?? geo.ruleY))
3625
3671
  drag.to = this.roster.workspaces.length - 1;
3626
3672
  }
3627
3673
  this.requestRender();
@@ -4277,11 +4323,11 @@ var WorkspacesHost = class {
4277
4323
  if (!drag || !sidebar) return;
4278
4324
  const from = this.roster.workspaces.indexOf(drag.workspace);
4279
4325
  if (drag.to === from) return;
4280
- const geo = geometry(sidebar.height, 0, this.split, layout.rail);
4281
- const shown = drag.to - this.sidebarScroll.workspaces;
4282
- if (shown < 0 || shown >= geo.workspaceCap) return;
4283
- const top = geo.workspaceTop + shown * geo.workspaceStep;
4284
- const y = (drag.to < from ? top : top + geo.workspaceStep) - 1;
4326
+ const slot = workspaceSlots(this.sidebarModel(layout.rail), sidebar.height).find(
4327
+ (s) => s.index === drag.to
4328
+ );
4329
+ if (!slot) return;
4330
+ const y = (drag.to < from ? slot.y : slot.y + slot.height) - 1;
4285
4331
  for (let x = 0; x < sidebar.width; x++) {
4286
4332
  const cell = frame.cellAt(x, y);
4287
4333
  if (!cell) continue;
@@ -4465,4 +4511,4 @@ export {
4465
4511
  realSchedule,
4466
4512
  WorkspacesHost
4467
4513
  };
4468
- //# sourceMappingURL=chunk-I3YUF54N.js.map
4514
+ //# sourceMappingURL=chunk-ATUCJYY5.js.map