@aiwayds/dsh-opentui 0.30.1 → 0.30.2

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
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.30.2] - 2026-11-27
11
+
12
+ ### Fixed
13
+
14
+ - Plugin-registered commands were missing from the slash palette on first
15
+ open: host command rows now apply while the palette is open, plugin command
16
+ listing ensures a host session first, and host command names are normalized
17
+ to slash form (#25).
18
+
10
19
  ## [0.30.1] - 2026-11-27
11
20
 
12
21
  ### Fixed
@@ -44641,18 +44641,20 @@ function seamFailureReason(error) {
44641
44641
  function mergeHostCommands(local, host, deps) {
44642
44642
  const localNames = new Set(local.map((command) => command.name.toLowerCase()));
44643
44643
  const hostRows = host.slice(0, HOST_COMMAND_CAP).map((row) => {
44644
- const rawName = row.name;
44644
+ const name = row.name.startsWith("/") ? row.name : `/${row.name}`;
44645
+ const duplicate = localNames.has(name.toLowerCase());
44645
44646
  return {
44646
- name: localNames.has(rawName.toLowerCase()) ? deps.t("command.hostSource", { name: rawName }) : rawName,
44647
+ name,
44648
+ ...duplicate ? { displayName: deps.t("command.hostSource", { name }) } : {},
44647
44649
  description: row.description,
44648
44650
  source: "host",
44649
44651
  run: async (ctx, argText) => {
44650
- const line = argText ? `${rawName} ${argText}` : rawName;
44652
+ const line = argText ? `${name} ${argText}` : name;
44651
44653
  try {
44652
44654
  const result = await ctx.seam?.hostCommands?.execute(line);
44653
- ctx.say(result === undefined ? deps.t("command.hostExecuteFailed", { name: rawName }) : result.text ?? deps.t("command.hostExecuted", { name: rawName }));
44655
+ ctx.say(result === undefined ? deps.t("command.hostExecuteFailed", { name }) : result.text ?? deps.t("command.hostExecuted", { name }));
44654
44656
  } catch {
44655
- ctx.say(deps.t("command.hostExecuteFailed", { name: rawName }));
44657
+ ctx.say(deps.t("command.hostExecuteFailed", { name }));
44656
44658
  }
44657
44659
  }
44658
44660
  };
@@ -46562,6 +46564,10 @@ class SlashPaletteController {
46562
46564
  this.#selected[1](edge === "home" ? 0 : count - 1);
46563
46565
  this.#follow(count);
46564
46566
  }
46567
+ resetSelection() {
46568
+ this.#selected[1](0);
46569
+ this.#offset[1](0);
46570
+ }
46565
46571
  current(commands) {
46566
46572
  return this.filtered(commands)[this.#selected[0]() - this.#offset[0]()];
46567
46573
  }
@@ -46625,7 +46631,7 @@ function SlashPalette(props) {
46625
46631
  insertNode(_el$3, _el$5);
46626
46632
  setProp(_el$3, "flexShrink", 0);
46627
46633
  setProp(_el$3, "wrapMode", "none");
46628
- insert(_el$3, () => command.name, _el$4);
46634
+ insert(_el$3, () => command.displayName ?? command.name, _el$4);
46629
46635
  insert(_el$5, () => command.description);
46630
46636
  effect((_p$) => {
46631
46637
  var _v$3 = active() ? row().backgroundColor : undefined, _v$4 = active() ? row().textColor : color.base(), _v$5 = paletteRowAttributes(command, active()), _v$6 = {
@@ -55693,7 +55699,7 @@ var init_subagents_viewer = __esm(() => {
55693
55699
  import { TextAttributes as TextAttributes12 } from "@opentui/core";
55694
55700
  function resolveVersion() {
55695
55701
  try {
55696
- return "0.30.1";
55702
+ return "0.30.2";
55697
55703
  } catch {
55698
55704
  return "dev";
55699
55705
  }
@@ -62122,9 +62128,17 @@ var init_bridge_session_seam = __esm(() => {
62122
62128
  return this.#hostCommandsOpsRef;
62123
62129
  }
62124
62130
  async#hostCommandsList() {
62125
- const agentId = this.currentSessionId() ?? this.stagedSessionId();
62126
- if (agentId === undefined || agentId === "")
62127
- return [];
62131
+ let agentId = this.currentSessionId() ?? this.stagedSessionId();
62132
+ if (agentId === undefined || agentId === "") {
62133
+ try {
62134
+ agentId = await this.#ensureSession();
62135
+ } catch (err) {
62136
+ this.#degradeOnce("hostCommands.list", `ensure session failed: ${err instanceof Error ? err.message : String(err)}`);
62137
+ return [];
62138
+ }
62139
+ if (agentId === undefined || agentId === "")
62140
+ return [];
62141
+ }
62128
62142
  const now = this.#confirmClock.now();
62129
62143
  const cached = this.#hostCommandsCache.get(agentId);
62130
62144
  if (cached && now - cached.fetchedAt < HOST_COMMANDS_TTL_MS)
@@ -62147,10 +62161,18 @@ var init_bridge_session_seam = __esm(() => {
62147
62161
  return request;
62148
62162
  }
62149
62163
  async#hostCommandsExecute(line) {
62150
- const agentId = this.currentSessionId() ?? this.stagedSessionId();
62164
+ let agentId = this.currentSessionId() ?? this.stagedSessionId();
62151
62165
  if (agentId === undefined || agentId === "") {
62152
- this.#degradeOnce("hostCommands.execute", "execute without an active session");
62153
- return;
62166
+ try {
62167
+ agentId = await this.#ensureSession();
62168
+ } catch (err) {
62169
+ this.#degradeOnce("hostCommands.execute", `ensure session failed: ${err instanceof Error ? err.message : String(err)}`);
62170
+ return;
62171
+ }
62172
+ if (agentId === undefined || agentId === "") {
62173
+ this.#degradeOnce("hostCommands.execute", "execute without an active session");
62174
+ return;
62175
+ }
62154
62176
  }
62155
62177
  try {
62156
62178
  const result = await this.#hostCommandsOps().commandsExecute(agentId, line);
@@ -62358,6 +62380,7 @@ var init_bridge_session_seam = __esm(() => {
62358
62380
  #appliedReplayKeys = new Set;
62359
62381
  #recoveryState = "idle";
62360
62382
  #pendingOpen;
62383
+ #ensureSessionInFlight;
62361
62384
  #inFlightTurnId;
62362
62385
  #sideSessionInFlight = false;
62363
62386
  #lastSideSessionId;
@@ -63725,16 +63748,11 @@ var init_bridge_session_seam = __esm(() => {
63725
63748
  this.#cancelAsksForTurn(endedTurnId);
63726
63749
  done?.();
63727
63750
  }
63728
- async turn(userText, cb) {
63729
- if (this.#inFlightGeneration !== 0) {
63730
- throw new BridgeProtocolError("TURN_REENTRANT", "turn() called while another turn is in flight; await the first turn()", { activeTurnId: this.#inFlightTurnId });
63731
- }
63732
- const gen = ++this.#turnGeneration;
63733
- this.#inFlightGeneration = gen;
63734
- this.#deadInFlight = undefined;
63735
- this.#inFlightPartial = "";
63736
- let sendFailed;
63737
- try {
63751
+ #ensureSession() {
63752
+ const inFlight = this.#ensureSessionInFlight;
63753
+ if (inFlight !== undefined)
63754
+ return inFlight;
63755
+ const task = (async () => {
63738
63756
  if (this.#pendingOpen === undefined && !this.#sessionAttached) {
63739
63757
  this.#pendingOpen = { mode: "new" };
63740
63758
  }
@@ -63756,23 +63774,40 @@ var init_bridge_session_seam = __esm(() => {
63756
63774
  throw new BridgeProtocolError("DISPOSED", "bridge seam is disposed");
63757
63775
  }
63758
63776
  const params = pending.mode === "resume" ? { mode: "resume", id: pending.id, ...this.#sessionAttached ? { replace: true } : {} } : { mode: "new" };
63759
- try {
63760
- const opened = asRecord14(await this.#transport.request("session.open", params));
63761
- if (typeof opened.sessionId === "string") {
63762
- this.#currentSessionId = opened.sessionId;
63763
- this.#resetHostCommands();
63764
- }
63765
- if (this.#lastAppliedSessionId !== this.#currentSessionId) {
63766
- this.#lastAppliedSessionId = this.#currentSessionId;
63767
- this.#lastAppliedSeq = undefined;
63768
- this.#appliedReplayKeys.clear();
63769
- this.#resetModelRoute();
63770
- }
63771
- this.#sessionAttached = true;
63772
- } catch (err) {
63773
- throw err;
63777
+ const opened = asRecord14(await this.#transport.request("session.open", params));
63778
+ if (typeof opened.sessionId === "string") {
63779
+ this.#currentSessionId = opened.sessionId;
63780
+ this.#resetHostCommands();
63774
63781
  }
63782
+ if (this.#lastAppliedSessionId !== this.#currentSessionId) {
63783
+ this.#lastAppliedSessionId = this.#currentSessionId;
63784
+ this.#lastAppliedSeq = undefined;
63785
+ this.#appliedReplayKeys.clear();
63786
+ this.#resetModelRoute();
63787
+ }
63788
+ this.#sessionAttached = true;
63775
63789
  }
63790
+ return this.#currentSessionId;
63791
+ })();
63792
+ this.#ensureSessionInFlight = task;
63793
+ const clear = () => {
63794
+ if (this.#ensureSessionInFlight === task)
63795
+ this.#ensureSessionInFlight = undefined;
63796
+ };
63797
+ task.then(clear, clear);
63798
+ return task;
63799
+ }
63800
+ async turn(userText, cb) {
63801
+ if (this.#inFlightGeneration !== 0) {
63802
+ throw new BridgeProtocolError("TURN_REENTRANT", "turn() called while another turn is in flight; await the first turn()", { activeTurnId: this.#inFlightTurnId });
63803
+ }
63804
+ const gen = ++this.#turnGeneration;
63805
+ this.#inFlightGeneration = gen;
63806
+ this.#deadInFlight = undefined;
63807
+ this.#inFlightPartial = "";
63808
+ let sendFailed;
63809
+ try {
63810
+ await this.#ensureSession();
63776
63811
  this.#activeCallbacks = cb;
63777
63812
  const done = new Promise((resolve) => {
63778
63813
  this.#turnDone = resolve;
@@ -65043,22 +65078,17 @@ function V2SessionPageBody(props) {
65043
65078
  clearRecoveryUi: () => recovery.clearRecoveryState()
65044
65079
  }));
65045
65080
  let paletteWasOpen = false;
65046
- let pendingHostRows;
65047
65081
  const applyHostRows = (rows) => {
65048
- pendingHostRows = undefined;
65049
65082
  setHostRows(rows);
65050
65083
  setHostRowsRevision((n) => n + 1);
65084
+ if (slash.controller.open)
65085
+ slash.controller.resetSelection();
65051
65086
  };
65052
65087
  const pullHostRows = () => {
65053
65088
  const face = seam.hostCommands;
65054
65089
  if (!face?.available())
65055
65090
  return;
65056
- face.list().then((rows) => {
65057
- if (slash.controller.open)
65058
- pendingHostRows = rows;
65059
- else
65060
- applyHostRows(rows);
65061
- }).catch(() => {});
65091
+ face.list().then((rows) => applyHostRows(rows)).catch(() => {});
65062
65092
  };
65063
65093
  const slashSync = (buffer) => {
65064
65094
  const wasOpen = paletteWasOpen;
@@ -65067,8 +65097,6 @@ function V2SessionPageBody(props) {
65067
65097
  if (open && !wasOpen) {
65068
65098
  seam.hostCommands?.refresh();
65069
65099
  pullHostRows();
65070
- } else if (!open && pendingHostRows !== undefined) {
65071
- applyHostRows(pendingHostRows);
65072
65100
  }
65073
65101
  paletteWasOpen = open;
65074
65102
  };
@@ -65922,5 +65950,5 @@ if (import.meta.main) {
65922
65950
  main();
65923
65951
  }
65924
65952
 
65925
- //# debugId=6886CF64AF78A9FF64756E2164756E21
65953
+ //# debugId=BF6CBB1CD4EC280664756E2164756E21
65926
65954
  //# sourceMappingURL=index.js.map