@aiwayds/dsh-opentui 0.17.2 → 0.17.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.17.3] - 2026-11-16
9
+
10
+ ### Added
11
+
12
+ - **Splash lists installed plugins.** The welcome hero shows the loaded plugin set tui-pi style — a root row plus `name@version` lines in loader order, a `+k more` overflow row and a `plugins N` summary. The row cap tracks the live terminal size (8 lines on tall terminals, down to a single example row below 30 rows, re-computed on resize without a restart); the list refreshes live through the plugin-change push channel, and the overflow/summary copy is localized (en/zh).
13
+
14
+ ### Fixed
15
+
16
+ - **The footer msgs segment no longer fakes a count.** While the journal count is unknown the segment hides instead of falling back to the send count (which read like a turn counter), and its label rides the i18n table so /language hot-switches it.
17
+ - **The 🧠 context segment keeps its full used/window(x.x%) form on narrow terminals.** A long preset label (e.g. `dsh(Standard + Append)`) now degrades first instead of crowding the context segment down to a bare token count.
18
+
8
19
  ## [0.17.2] - 2026-11-15
9
20
 
10
21
  ### Added
@@ -8793,7 +8793,7 @@ class RemoteHostSession {
8793
8793
  listPlugins() {
8794
8794
  return [...this.#pluginsCache];
8795
8795
  }
8796
- async refreshPlugins() {
8796
+ async refreshPlugins(opts = {}) {
8797
8797
  try {
8798
8798
  const before = this.#pluginsCache.length;
8799
8799
  const [plugins, bundles] = await Promise.all([
@@ -8821,7 +8821,7 @@ class RemoteHostSession {
8821
8821
  const title = typeof meta.title === "string" ? meta.title : moduleName;
8822
8822
  return { name: title, moduleName, version: versions.get(moduleName) ?? "" };
8823
8823
  }).filter((p) => p.name && !p.moduleName.startsWith("@deepseek-ai/")).map(({ name, version }) => ({ name, version }));
8824
- if (this.#pluginsCache.length !== before || before === 0 || bundlesChanged) {
8824
+ if (!opts.silent && (this.#pluginsCache.length !== before || before === 0 || bundlesChanged)) {
8825
8825
  for (const listener of this.#pushListeners) {
8826
8826
  try {
8827
8827
  listener.onPluginsChanged?.();
@@ -9420,7 +9420,7 @@ class RemoteHostSession {
9420
9420
  return;
9421
9421
  }
9422
9422
  if (event === "plugin-manager/changed") {
9423
- this.refreshPlugins().catch(() => {}).then(() => {
9423
+ this.refreshPlugins({ silent: true }).catch(() => {}).then(() => {
9424
9424
  for (const listener of this.#pushListeners) {
9425
9425
  try {
9426
9426
  listener.onPluginsChanged?.();
@@ -44618,23 +44618,69 @@ var init_gradient_text = __esm(() => {
44618
44618
  });
44619
44619
 
44620
44620
  // ../tui-base/src/routes/welcome-hero.tsx
44621
+ function splashRowCap(rows) {
44622
+ if (rows >= 40)
44623
+ return 8;
44624
+ if (rows >= COMPOSER_COMPACT_TERMINAL_ROWS)
44625
+ return 4;
44626
+ return 1;
44627
+ }
44628
+ function splashOverflowCount(total, cap) {
44629
+ return total > cap ? total - Math.max(1, cap - 1) : 0;
44630
+ }
44621
44631
  function shortenCwd(cwd) {
44622
44632
  const short = home && cwd.startsWith(home) ? `~${cwd.slice(home.length)}` : cwd;
44623
44633
  if (short.length <= 60)
44624
44634
  return short;
44625
44635
  return `\u2026${short.slice(-59)}`;
44626
44636
  }
44637
+ function pluginLabel(row) {
44638
+ return row.version === "" ? row.name : `${row.name}@${row.version}`;
44639
+ }
44640
+ function clipRow(line, maxWidth) {
44641
+ if (stringWidth(line) <= maxWidth)
44642
+ return line;
44643
+ const limit = Math.max(0, maxWidth - 1);
44644
+ let out = "";
44645
+ let width = 0;
44646
+ for (const grapheme of new Intl.Segmenter(undefined, {
44647
+ granularity: "grapheme"
44648
+ }).segment(line)) {
44649
+ const w = stringWidth(grapheme.segment);
44650
+ if (width + w > limit)
44651
+ break;
44652
+ out += grapheme.segment;
44653
+ width += w;
44654
+ }
44655
+ return `${out}\u2026`;
44656
+ }
44657
+ function fallbackSize() {
44658
+ return {
44659
+ width: typeof process !== "undefined" && process.stdout?.columns || 120,
44660
+ height: typeof process !== "undefined" && process.stdout?.rows || 40
44661
+ };
44662
+ }
44627
44663
  function WelcomeHero(props) {
44628
44664
  const quote = pickDailyQuote();
44665
+ const size = () => props.state.size?.() ?? fallbackSize();
44666
+ const cap = () => splashRowCap(size().height);
44667
+ const maxRowWidth = () => Math.max(20, size().width - 2);
44668
+ const pluginRows = () => props.state.plugins?.() ?? [];
44669
+ const overflowCount = () => splashOverflowCount(pluginRows().length, cap());
44670
+ const visibleRows = () => {
44671
+ const count = overflowCount();
44672
+ return count > 0 ? pluginRows().slice(0, pluginRows().length - count) : pluginRows();
44673
+ };
44674
+ const heroTitle = () => props.state.title?.();
44629
44675
  return createComponent2(Show, {
44630
44676
  get when() {
44631
44677
  return props.state.visible();
44632
44678
  },
44633
44679
  get children() {
44634
- var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("text");
44680
+ var _el$ = createElement("box"), _el$2 = createElement("box"), _el$7 = createElement("text"), _el$8 = createElement("text");
44635
44681
  insertNode(_el$, _el$2);
44636
- insertNode(_el$, _el$3);
44637
- insertNode(_el$, _el$4);
44682
+ insertNode(_el$, _el$7);
44683
+ insertNode(_el$, _el$8);
44638
44684
  setProp(_el$, "flexDirection", "column");
44639
44685
  setProp(_el$, "flexShrink", 0);
44640
44686
  setProp(_el$, "width", "100%");
@@ -44648,14 +44694,75 @@ function WelcomeHero(props) {
44648
44694
  }), _el$2);
44649
44695
  setProp(_el$2, "height", 1);
44650
44696
  setProp(_el$2, "flexShrink", 0);
44651
- setProp(_el$3, "selectable", false);
44652
- insert(_el$3, () => `${props.state.model() ? `${props.state.model()} \xB7 ` : ""}${shortenCwd(props.cwd)}`);
44653
- setProp(_el$4, "selectable", false);
44654
- insert(_el$4, `\u300C${quote}\u300D`);
44697
+ insert(_el$, createComponent2(Show, {
44698
+ get when() {
44699
+ return pluginRows().length > 0;
44700
+ },
44701
+ get children() {
44702
+ return [createComponent2(Show, {
44703
+ get when() {
44704
+ return memo2(() => heroTitle() !== undefined)() && heroTitle() !== "";
44705
+ },
44706
+ get children() {
44707
+ var _el$3 = createElement("text");
44708
+ setProp(_el$3, "selectable", false);
44709
+ insert(_el$3, heroTitle);
44710
+ effect((_$p) => setProp(_el$3, "fg", props.state.muted?.(), _$p));
44711
+ return _el$3;
44712
+ }
44713
+ }), createComponent2(For, {
44714
+ get each() {
44715
+ return visibleRows();
44716
+ },
44717
+ children: (row, index) => (() => {
44718
+ var _el$9 = createElement("text");
44719
+ setProp(_el$9, "selectable", false);
44720
+ insert(_el$9, () => clipRow(`${index() === visibleRows().length - 1 && overflowCount() === 0 ? "\u2514\u2500" : "\u251C\u2500"} ${pluginLabel(row)}`, maxRowWidth()));
44721
+ effect((_$p) => setProp(_el$9, "fg", props.state.muted?.(), _$p));
44722
+ return _el$9;
44723
+ })()
44724
+ }), createComponent2(Show, {
44725
+ get when() {
44726
+ return overflowCount() > 0;
44727
+ },
44728
+ get children() {
44729
+ var _el$4 = createElement("text");
44730
+ setProp(_el$4, "selectable", false);
44731
+ insert(_el$4, () => clipRow(`\u2514\u2500 ${t("hero.plugins.more", {
44732
+ count: overflowCount()
44733
+ })}`, maxRowWidth()));
44734
+ effect((_$p) => setProp(_el$4, "fg", props.state.muted?.(), _$p));
44735
+ return _el$4;
44736
+ }
44737
+ }), (() => {
44738
+ var _el$5 = createElement("text");
44739
+ setProp(_el$5, "selectable", false);
44740
+ insert(_el$5, () => clipRow(t("hero.plugins.count", {
44741
+ count: pluginRows().length
44742
+ }), maxRowWidth()));
44743
+ effect((_$p) => setProp(_el$5, "fg", props.state.muted?.(), _$p));
44744
+ return _el$5;
44745
+ })(), createComponent2(Show, {
44746
+ get when() {
44747
+ return cap() > 1;
44748
+ },
44749
+ get children() {
44750
+ var _el$6 = createElement("box");
44751
+ setProp(_el$6, "height", 1);
44752
+ setProp(_el$6, "flexShrink", 0);
44753
+ return _el$6;
44754
+ }
44755
+ })];
44756
+ }
44757
+ }), _el$7);
44758
+ setProp(_el$7, "selectable", false);
44759
+ insert(_el$7, () => `${props.state.model() ? `${props.state.model()} \xB7 ` : ""}${shortenCwd(props.cwd)}`);
44760
+ setProp(_el$8, "selectable", false);
44761
+ insert(_el$8, `\u300C${quote}\u300D`);
44655
44762
  effect((_p$) => {
44656
44763
  var _v$ = props.state.muted?.(), _v$2 = props.state.muted?.();
44657
- _v$ !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$, _p$.e));
44658
- _v$2 !== _p$.t && (_p$.t = setProp(_el$4, "fg", _v$2, _p$.t));
44764
+ _v$ !== _p$.e && (_p$.e = setProp(_el$7, "fg", _v$, _p$.e));
44765
+ _v$2 !== _p$.t && (_p$.t = setProp(_el$8, "fg", _v$2, _p$.t));
44659
44766
  return _p$;
44660
44767
  }, {
44661
44768
  e: undefined,
@@ -44677,6 +44784,9 @@ var init_welcome_hero = __esm(() => {
44677
44784
  init_server();
44678
44785
  init_quotes();
44679
44786
  init_gradient_text();
44787
+ init_semantic();
44788
+ init_i18n();
44789
+ init_string_width();
44680
44790
  home = typeof process !== "undefined" && process.env.HOME || "";
44681
44791
  });
44682
44792
 
@@ -46859,7 +46969,8 @@ function brandSegment(theme, presetLabel, mode = "dark") {
46859
46969
  return {
46860
46970
  text: label,
46861
46971
  bg: brandBlue(mode),
46862
- priority: 100
46972
+ priority: 100,
46973
+ degrade: "dsh"
46863
46974
  };
46864
46975
  }
46865
46976
  function providerSegment(provider, theme, mode = "dark") {
@@ -46948,7 +47059,9 @@ function messagesSegment(n, theme) {
46948
47059
  if (!Number.isFinite(n) || n < 0)
46949
47060
  return null;
46950
47061
  return {
46951
- text: `\uD83D\uDCAC ${n} msgs`,
47062
+ text: t("footer.messages", {
47063
+ n
47064
+ }),
46952
47065
  bg: resolvePalette(theme).messages,
46953
47066
  priority: 80
46954
47067
  };
@@ -47223,7 +47336,8 @@ function sessionFooterSegments(data) {
47223
47336
  add(modelSegment(data.model ?? "", effectiveEffort(data.effort), theme));
47224
47337
  add(contextSegment(data.contextTokens ?? null, data.contextWindow ?? null, theme));
47225
47338
  add(cacheSegment(data.cacheHitRate ?? null, theme));
47226
- add(messagesSegment(data.messages ?? 0, theme));
47339
+ if (data.messages !== undefined)
47340
+ add(messagesSegment(data.messages, theme));
47227
47341
  add(toolSegment(data.tools ?? 0, theme));
47228
47342
  add(elapsedSegment(data.elapsedSec ?? null, theme));
47229
47343
  add(speedSegment(data.tps ?? null, theme));
@@ -47245,6 +47359,7 @@ var init_powerline = __esm(() => {
47245
47359
  init_tool_summarize();
47246
47360
  init_string_width();
47247
47361
  init_terminal_size();
47362
+ init_i18n();
47248
47363
  POWERLINE_COLORS = {
47249
47364
  brand: "#4D6BFE",
47250
47365
  provider: "#6A1B9A",
@@ -59630,7 +59745,7 @@ var init_subagents_viewer = __esm(() => {
59630
59745
  import { TextAttributes as TextAttributes12 } from "@opentui/core";
59631
59746
  function resolveVersion() {
59632
59747
  try {
59633
- return "0.17.2";
59748
+ return "0.17.3";
59634
59749
  } catch {
59635
59750
  return "dev";
59636
59751
  }
@@ -61622,10 +61737,18 @@ class RemoteSessionSeam {
61622
61737
  #unjournal;
61623
61738
  #pluginsRevision = createSignal(0);
61624
61739
  #unplugins;
61740
+ #pluginsPushListeners = [];
61625
61741
  constructor(session) {
61626
61742
  this.#session = session;
61627
61743
  registerSubagentSteer((id, text) => this.#session.steerChild(id, text));
61628
- this.#unplugins = session.onPluginsChanged?.(() => this.#pluginsRevision[1]((n) => n + 1)) ?? undefined;
61744
+ this.#unplugins = session.onPluginsChanged?.(() => {
61745
+ this.#pluginsRevision[1]((n) => n + 1);
61746
+ for (const listener of this.#pluginsPushListeners) {
61747
+ try {
61748
+ listener();
61749
+ } catch {}
61750
+ }
61751
+ }) ?? undefined;
61629
61752
  }
61630
61753
  status() {
61631
61754
  const s = this.#session.status;
@@ -61840,6 +61963,14 @@ class RemoteSessionSeam {
61840
61963
  this.#pluginsRevision[0]();
61841
61964
  return this.#session.listPlugins();
61842
61965
  }
61966
+ onPluginsChanged(listener) {
61967
+ this.#pluginsPushListeners.push(listener);
61968
+ return () => {
61969
+ const index = this.#pluginsPushListeners.indexOf(listener);
61970
+ if (index >= 0)
61971
+ this.#pluginsPushListeners.splice(index, 1);
61972
+ };
61973
+ }
61843
61974
  pluginBundles() {
61844
61975
  this.#pluginsRevision[0]();
61845
61976
  return this.#session.listBundles();
@@ -61997,6 +62128,7 @@ class RemoteSessionSeam {
61997
62128
  this.#unplugins?.();
61998
62129
  this.#unplugins = undefined;
61999
62130
  this.#listeners.length = 0;
62131
+ this.#pluginsPushListeners.length = 0;
62000
62132
  await this.#session.dispose();
62001
62133
  }
62002
62134
  #ensureJournalFeed() {
@@ -62126,7 +62258,6 @@ function V2SessionPage(props) {
62126
62258
  const [turnBusy, setTurnBusy] = createSignal(false);
62127
62259
  const busy = () => composerBusy() || turnBusy();
62128
62260
  const [busySince, setBusySince] = createSignal(0);
62129
- const [msgs, setMsgs] = createSignal(0);
62130
62261
  const [model, setModel] = createSignal();
62131
62262
  const [tools, setTools] = createSignal(0);
62132
62263
  const [effort, setEffort] = createSignal();
@@ -62137,9 +62268,13 @@ function V2SessionPage(props) {
62137
62268
  const [presetLabel, setPresetLabel] = createSignal();
62138
62269
  const [skillRows, setSkillRows] = createSignal(props.skills ?? []);
62139
62270
  const slashCommands = createMemo(() => withSkillCommands(coreCommands(), skillRows()));
62271
+ const [pluginRows, setPluginRows] = createSignal(seam.plugins?.() ?? []);
62140
62272
  onMount(() => {
62141
62273
  const off = seam.onSkillsChanged?.((rows) => setSkillRows(rows.map((row) => ({ name: row.name, description: row.description, path: "skills/list" }))));
62142
62274
  onCleanup(() => off?.());
62275
+ const offPlugins = seam.onPluginsChanged?.(() => setPluginRows(seam.plugins?.() ?? []));
62276
+ onCleanup(() => offPlugins?.());
62277
+ setPluginRows(seam.plugins?.() ?? []);
62143
62278
  });
62144
62279
  const refreshPresetLabel = () => {
62145
62280
  const face = seam.preset;
@@ -62150,6 +62285,7 @@ function V2SessionPage(props) {
62150
62285
  let composerRef;
62151
62286
  let transcriptScroll;
62152
62287
  const renderer = useRenderer();
62288
+ const dimensions = useTerminalSize();
62153
62289
  const paneFocus = createPaneFocus({
62154
62290
  transcript: () => transcriptScroll,
62155
62291
  composer: () => composerRef?.node()
@@ -62190,7 +62326,6 @@ function V2SessionPage(props) {
62190
62326
  let turnAborted = false;
62191
62327
  const send = (text) => {
62192
62328
  turnAborted = false;
62193
- setMsgs((n) => n + 1);
62194
62329
  setTurnBusy(true);
62195
62330
  setBusySince(Date.now());
62196
62331
  setLastRequest(text);
@@ -62295,7 +62430,7 @@ function V2SessionPage(props) {
62295
62430
  provider: model()?.providerID,
62296
62431
  model: model()?.modelID,
62297
62432
  effort: effort(),
62298
- messages: remoteInfo()?.messageCount ?? msgs(),
62433
+ messages: remoteInfo()?.messageCount,
62299
62434
  tools: tools(),
62300
62435
  tps: remoteInfo()?.tps ?? null,
62301
62436
  contextTokens: ctxTokens(),
@@ -62490,10 +62625,13 @@ function V2SessionPage(props) {
62490
62625
  return [
62491
62626
  createComponent2(WelcomeHero, {
62492
62627
  state: {
62493
- visible: () => projection.hydrated() && msgs() === 0 && projection.rows.length === 0,
62628
+ visible: () => projection.hydrated() && projection.rows.length === 0,
62494
62629
  model: () => model()?.modelID,
62495
62630
  muted: () => theme.text.muted,
62496
- mode: () => themeService.mode()
62631
+ mode: () => themeService.mode(),
62632
+ title: () => props.profileName,
62633
+ plugins: () => pluginRows(),
62634
+ size: () => dimensions()
62497
62635
  },
62498
62636
  cwd: props.workspace
62499
62637
  }),
@@ -62837,6 +62975,7 @@ async function bootClientV2(options = {}) {
62837
62975
  themeName,
62838
62976
  quit: () => process.exit(0),
62839
62977
  workspace,
62978
+ profileName: profile,
62840
62979
  probeBranch: (cwd) => git.probeGitBranchOrSha(cwd),
62841
62980
  initialSessionId,
62842
62981
  resumeNotice,
@@ -62899,6 +63038,7 @@ var init_v2_entry = __esm(() => {
62899
63038
  init_delivery_choice();
62900
63039
  init_auto_resume();
62901
63040
  init_welcome_hero();
63041
+ init_terminal_size();
62902
63042
  init_subagents_picker();
62903
63043
  init_subagent_markers();
62904
63044
  init_seam_rows();
@@ -611,6 +611,7 @@
611
611
  "turn.stop.confirmMessage": "Stop {parts} now? Queued prompts stay and the session remains resumable.",
612
612
  "turn.stop.confirmLabel": "stop",
613
613
  "turn.stop.cancelLabel": "keep running",
614
+ "footer.messages": "💬 {n} msgs",
614
615
  "footer.hint.quit": "ctrl+c ×2 quit",
615
616
  "footer.hint.scroll": "pgup/pgdn scroll",
616
617
  "footer.hint.search": "ctrl+shift+f search",
@@ -906,5 +907,7 @@
906
907
  "dialog.mcp.details.unknownError": "Unknown MCP connection error",
907
908
  "dialog.mcp.details.context": "Status: {status}\nConfiguration: mcp.servers.{server}",
908
909
  "dialog.mcp.details.integration": "\nIntegration: {id}",
909
- "composer.placeholder": "Type a message (enter send, alt+enter newline)"
910
+ "composer.placeholder": "Type a message (enter send, alt+enter newline)",
911
+ "hero.plugins.count": "plugins {count}",
912
+ "hero.plugins.more": "… +{count} more"
910
913
  }
@@ -598,6 +598,7 @@
598
598
  "overlay.widgets.todosHeader": "● 待办({done}/{total})",
599
599
  "overlay.widgets.todosShowing": "显示 {ranges}",
600
600
  "overlay.widgets.todosSummary": "待办 [✓]{done}/{total}",
601
+ "footer.messages": "💬 {n} 条消息",
601
602
  "footer.hint.send.idle": "enter 发送",
602
603
  "footer.hint.send.busy": "enter 插话",
603
604
  "footer.hint.newline.idle": "alt+enter 换行",
@@ -906,5 +907,7 @@
906
907
  "dialog.mcp.details.unknownError": "未知的 MCP 连接错误",
907
908
  "dialog.mcp.details.context": "状态:{status}\n配置:mcp.servers.{server}",
908
909
  "dialog.mcp.details.integration": "\n集成:{id}",
909
- "composer.placeholder": "输入消息(enter 发送,alt+enter 换行)"
910
+ "composer.placeholder": "输入消息(enter 发送,alt+enter 换行)",
911
+ "hero.plugins.count": "插件 {count}",
912
+ "hero.plugins.more": "… 还有 {count} 个"
910
913
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-opentui",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "bin": {