@aiwayds/dsh-opentui 0.9.4 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ 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.9.5] - 2026-11-11
9
+
10
+ ### Added
11
+
12
+ - **`/flush`** — delivers a paused delivery queue now. A failed or aborted turn keeps the client-side queue and pauses the pump; `/flush` starts the head prompt immediately and the rest follow one per turn end, in submission order. Every outcome is reported (an empty queue is never silent).
13
+ - **Settings catalogs** — `permission.defaultPreset` reads the host `permissionPresets/catalog` RPC and offers its `defaultOptions` as real choices (the settings value, else the catalog default); without a catalog the row is read-only and shows the effective value plus why, never an empty picker. The slash skill registry keeps the boot disk snapshot and refreshes once after the first user message when `skills/list` becomes readable, so plugin-provided skills appear without a restart.
14
+
15
+ ### Changed
16
+
17
+ - **A launch starts a fresh session; restore is opt-in** — a plain launch no longer reopens the last workspace session. Set `"autoResume": "last"` or pass `--resume-last` for a single launch (it overrides the config) to restore the newest non-empty session from the launch workspace that was active within the last 7 days (`autoResumeDays`); `--new` wins over both, and `--session <id>` still pins a session.
18
+
19
+ ### Fixed
20
+
21
+ - **Skill rows survived a session switch** — the palette kept the previous session's plugin skill rows after `/new` or `/resume`; the session-scoped `skills/list` rows now reset to the boot snapshot.
22
+ - **`/flush` during a running turn** — the notice no longer promises delivery; it says the queued prompts wait for that turn to finish, matching the pause-on-failure behavior.
23
+
24
+ ### Known Issues
25
+
26
+ - Engine paint defects remain: streaming diff-paint row loss, and wide-glyph loss under translucent overlays (upstream).
27
+ - Skills before the first message are the boot-time disk snapshot; plugin-provided skills appear only after the refresh.
28
+ - `permission.defaultPreset` choices depend on the host catalog schema; without one the row is read-only.
29
+ - The delivery queue is in-memory only and is lost on exit.
30
+ - CI cannot run the real-client tmux gate (no tmux/dsh on hosted runners).
31
+
8
32
  ## [0.9.4] - 2026-11-10
9
33
 
10
34
  ### Added
@@ -12,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
36
  - **MCP by default** — the core plugin set now installs `@aiwayds/dsh-mcp-adapter`, and provisioning inserts a `mcp-context7` client row (streamable HTTP, no API key) so `mcp_list` / `mcp_call` have a server to catalog on a fresh profile. An existing row is never rewritten or duplicated; `--plugins=none` writes neither.
13
37
  - **Steer or queue on a busy submit** — Enter on a busy turn opens a two-row choice (Steer is the default highlight; `esc` keeps the typed text). Queueing is client-side: one prompt per turn end in submission order. Failed or aborted turns pause the queue and notify; the next successful turn end resumes it. The transcript shows muted `⏸ 排队等待 #N` queue rows and `⤵ 已注入当前回合` steer receipts that flip to `✓ 已投递` at turn end.
14
38
  - **cwd · git branch row** — one muted row directly above the composer with the workspace directory (`~/…` abbreviation, left-clipped tail) and the git branch (short SHA on a detached HEAD). Probed on mount and on each session switch; non-repos and probe failures degrade silently to the directory only.
15
- - **Session restore on launch** — a fresh client reopens the newest non-empty session from the launch workspace that was active within the last 7 days and prints one `resumed <title> · <time ago>` notice. `--new` starts fresh, `--session <id>` pins a session, `autoResume: "off"` disables the restore, and `autoResumeDays` changes the window.
39
+ - **Session restore on launch (opt-in)** — a plain launch starts a new, empty session. Setting `"autoResume": "last"` reopens the newest non-empty session from the launch workspace that was active within the last 7 days and prints one `resumed <title> · <time ago>` notice; `--resume-last` enables it for a single launch (overrides the config). `--new` always starts fresh and wins over both, `--session <id>` pins a session, and `autoResumeDays` changes the window.
16
40
 
17
41
  ### Changed
18
42
 
package/README.md CHANGED
@@ -150,11 +150,13 @@ allow, `n` decline; `esc` aborts a running turn. Ctrl+C twice quits. Commands:
150
150
  `/help` `/model [provider/id]` `/usage` `/clear` `/login` `/logout` `/resume`
151
151
  `/search` `/new` `/quit` and more — see `/help` inside the TUI.
152
152
 
153
- **Session restore on launch**: the client reopens the newest non-empty session
154
- from the launch workspace that was active within the last 7 days, with a
155
- `resumed <title> · <time ago>` notice. Disable it with `"autoResume": "off"` in
153
+ **Session restore on launch (opt-in)**: a plain launch starts a new, empty
154
+ session. To reopen the newest non-empty session from the launch workspace that
155
+ was active within the last 7 days — with a `resumed <title> · <time ago>`
156
+ notice — set `"autoResume": "last"` in
156
157
  `$DSH_HOME/profiles/opentui/config.json` (change the window with
157
- `"autoResumeDays": N`), or skip it for one launch with `--new`; `--session <id>`
158
+ `"autoResumeDays": N`), or pass `--resume-last` for one launch (it overrides
159
+ the config). `--new` always starts fresh and wins over both; `--session <id>`
158
160
  pins a specific session.
159
161
 
160
162
  ## Develop
@@ -208,7 +210,7 @@ PATH; otherwise the scripts self-skip (exit 0) so CI runs green.
208
210
 
209
211
  ## Status
210
212
 
211
- v0.9.4: published as `@aiwayds/dsh-opentui` — client-only distribution
213
+ v0.9.5: published as `@aiwayds/dsh-opentui` — client-only distribution
212
214
  (npm bin → client chain; the in-process plugin mode was retired). New
213
215
  default theme dsh-blue (dark/light, auto-selected from terminal background,
214
216
  `/theme` to pin) with focus visuals, framed composer/messages/code blocks,
@@ -223,4 +225,7 @@ plugin provisioning with keyless `web_search`. 0.9.4 ships MCP by default
223
225
  (`dsh-mcp-adapter` plus a keyless context7 server), a steer-or-queue choice
224
226
  on a busy submit, the cwd · git branch composer row, session restore on
225
227
  launch, a compact footer context percent, and a fix for transcript loss on
226
- `/resume`. Roadmap: platform + Kit polish.
228
+ `/resume`. 0.9.5 adds `/flush` for a paused delivery queue, closes the
229
+ settings permission-preset and skill-catalog gaps, and makes session restore
230
+ opt-in (`--resume-last` or `autoResume: "last"`) so a plain launch starts
231
+ fresh. Roadmap: platform + Kit polish.
@@ -7057,6 +7057,8 @@ class RemoteHostSession {
7057
7057
  #tail;
7058
7058
  #pluginsCache = [];
7059
7059
  #skillsCache = [];
7060
+ #skillListeners = [];
7061
+ #skillsRefreshedFor;
7060
7062
  #pushListeners = [];
7061
7063
  #coldBootLabelApplied = false;
7062
7064
  #executionMode = "native";
@@ -7171,6 +7173,7 @@ class RemoteHostSession {
7171
7173
  content: [{ type: "text", text: userText }, ...attachmentParts]
7172
7174
  }
7173
7175
  });
7176
+ this.#refreshSkillsOnce(sessionId);
7174
7177
  this.#promptInFlight = false;
7175
7178
  if (this.#interrupted || this.#disposed)
7176
7179
  return;
@@ -7536,6 +7539,19 @@ class RemoteHostSession {
7536
7539
  async settingsDocument() {
7537
7540
  return this.#settingsClient().describeDocument();
7538
7541
  }
7542
+ async permissionCatalog() {
7543
+ try {
7544
+ const value = await this.#rpc("permissionPresets/catalog");
7545
+ const options = asPermissionOptions(value.options);
7546
+ const defaultOptions = asPermissionOptions(value.defaultOptions);
7547
+ const defaultPreset = typeof value.defaultPreset === "string" ? value.defaultPreset : "";
7548
+ if (options.length === 0 && defaultOptions.length === 0 && defaultPreset === "")
7549
+ return;
7550
+ return { options, defaultOptions, defaultPreset };
7551
+ } catch {
7552
+ return;
7553
+ }
7554
+ }
7539
7555
  profileName() {
7540
7556
  return this.#profile;
7541
7557
  }
@@ -7699,7 +7715,29 @@ class RemoteHostSession {
7699
7715
  if (sessionId === undefined)
7700
7716
  return [...this.#skillsCache];
7701
7717
  this.#skillsCache = await this.#opsClient().skillsList(sessionId);
7702
- return [...this.#skillsCache];
7718
+ const snapshot = [...this.#skillsCache];
7719
+ for (const listener of [...this.#skillListeners]) {
7720
+ try {
7721
+ listener(snapshot);
7722
+ } catch (error) {
7723
+ console.error("[remote-host-session] skill listener failed:", error);
7724
+ }
7725
+ }
7726
+ return snapshot;
7727
+ }
7728
+ onSkillsChanged(listener) {
7729
+ this.#skillListeners.push(listener);
7730
+ return () => {
7731
+ this.#skillListeners = this.#skillListeners.filter((entry) => entry !== listener);
7732
+ };
7733
+ }
7734
+ #refreshSkillsOnce(sessionId) {
7735
+ if (this.#skillsRefreshedFor === sessionId)
7736
+ return;
7737
+ this.#skillsRefreshedFor = sessionId;
7738
+ this.refreshSkills().catch((error) => {
7739
+ console.error("[remote-host-session] skill catalog refresh failed:", error);
7740
+ });
7703
7741
  }
7704
7742
  async reloadPlugins() {
7705
7743
  if (this.#disposed)
@@ -8447,6 +8485,22 @@ class RemoteHostSession {
8447
8485
  }
8448
8486
  }
8449
8487
  }
8488
+ function asPermissionOptions(value) {
8489
+ if (!Array.isArray(value))
8490
+ return [];
8491
+ return value.flatMap((entry) => {
8492
+ const row = typeof entry === "object" && entry !== null ? entry : {};
8493
+ if (typeof row.value !== "string" || row.value === "")
8494
+ return [];
8495
+ return [
8496
+ {
8497
+ value: row.value,
8498
+ ...typeof row.name === "string" ? { name: row.name } : {},
8499
+ ...typeof row.description === "string" ? { description: row.description } : {}
8500
+ }
8501
+ ];
8502
+ });
8503
+ }
8450
8504
  var REATTACH_RETRY_MS = 1000, REATTACH_MAX_ATTEMPTS = 30, PRESET_ENGLISH_NAMES;
8451
8505
  var init_remote_host_session = __esm(() => {
8452
8506
  init_loop();
@@ -11154,6 +11208,17 @@ class ComposerController {
11154
11208
  this.pendingRows = [];
11155
11209
  this.emitPending();
11156
11210
  }
11211
+ flushQueue() {
11212
+ if (this.queueItems.length === 0)
11213
+ return { kind: "empty", started: 0, remaining: 0 };
11214
+ if (this.busyState)
11215
+ return { kind: "busy", started: 0, remaining: this.queueItems.length };
11216
+ const next = this.queueItems.shift();
11217
+ this.dropQueueRow(next.id);
11218
+ this.setQueuedState("queued");
11219
+ this.startTurn(next.text);
11220
+ return { kind: "flushed", started: 1, remaining: this.queueItems.length };
11221
+ }
11157
11222
  get turn() {
11158
11223
  return this.pendingTurn;
11159
11224
  }
@@ -39413,7 +39478,8 @@ function SessionComposer(props) {
39413
39478
  value.focus();
39414
39479
  },
39415
39480
  node: () => value.isDestroyed ? undefined : value,
39416
- resetDeliveries: () => controller.resetDeliveries()
39481
+ resetDeliveries: () => controller.resetDeliveries(),
39482
+ flushQueue: () => controller.flushQueue()
39417
39483
  });
39418
39484
  }, _el$2);
39419
39485
  setProp(_el$2, "width", "100%");
@@ -42586,6 +42652,7 @@ var SESSIONS_MIN_BYTES = 1024, SESSIONS_DIR_CAP = 32;
42586
42652
  // ../tui-base/src/routes/session/auto-resume.ts
42587
42653
  function parseLaunchArgs(argv) {
42588
42654
  let newRequested = false;
42655
+ let resumeLastRequested = false;
42589
42656
  let sessionId;
42590
42657
  for (let index = 0;index < argv.length; index++) {
42591
42658
  const arg = argv[index];
@@ -42595,6 +42662,10 @@ function parseLaunchArgs(argv) {
42595
42662
  newRequested = true;
42596
42663
  continue;
42597
42664
  }
42665
+ if (arg === "--resume-last") {
42666
+ resumeLastRequested = true;
42667
+ continue;
42668
+ }
42598
42669
  if (arg === "--session") {
42599
42670
  const value = argv[index + 1];
42600
42671
  if (value !== undefined && value !== "" && !value.startsWith("--")) {
@@ -42609,10 +42680,17 @@ function parseLaunchArgs(argv) {
42609
42680
  sessionId = value;
42610
42681
  }
42611
42682
  }
42612
- return { newRequested, ...sessionId !== undefined ? { sessionId } : {} };
42683
+ return { newRequested, resumeLastRequested, ...sessionId !== undefined ? { sessionId } : {} };
42613
42684
  }
42614
42685
  function readAutoResumeMode(config) {
42615
- return config?.autoResume === "off" ? "off" : "last";
42686
+ return config?.autoResume === "last" ? "last" : "off";
42687
+ }
42688
+ function resolveAutoResumeMode(config, launch) {
42689
+ if (launch.newRequested || launch.sessionId !== undefined)
42690
+ return "off";
42691
+ if (launch.resumeLastRequested)
42692
+ return "last";
42693
+ return readAutoResumeMode(config);
42616
42694
  }
42617
42695
  function readAutoResumeDays(config, fallback = DEFAULT_AUTO_RESUME_DAYS) {
42618
42696
  const value = Number(config?.autoResumeDays);
@@ -42685,9 +42763,7 @@ async function withBudget(promise, timeoutMs) {
42685
42763
  }
42686
42764
  async function runAutoResume(input, deps) {
42687
42765
  const warn = deps.warn ?? (() => {});
42688
- if (input.launch.newRequested || input.launch.sessionId !== undefined)
42689
- return;
42690
- const mode = readAutoResumeMode(input.config);
42766
+ const mode = resolveAutoResumeMode(input.config, input.launch);
42691
42767
  if (mode !== "last")
42692
42768
  return;
42693
42769
  const timeoutMs = deps.timeoutMs ?? AUTO_RESUME_TIMEOUT_MS;
@@ -48826,6 +48902,26 @@ function coreCommands() {
48826
48902
  ctx.say("transcript cleared");
48827
48903
  }
48828
48904
  },
48905
+ {
48906
+ name: "/flush",
48907
+ description: "deliver the queued prompts now",
48908
+ run(ctx) {
48909
+ if (!ctx.flushQueue) {
48910
+ ctx.say("/flush unavailable in this session");
48911
+ return;
48912
+ }
48913
+ const result = ctx.flushQueue();
48914
+ if (result.kind === "empty") {
48915
+ ctx.say("queue is empty \u2014 nothing to flush");
48916
+ return;
48917
+ }
48918
+ if (result.kind === "busy") {
48919
+ ctx.say(`a turn is running \u2014 ${result.remaining} queued prompt(s) wait for it to finish`);
48920
+ return;
48921
+ }
48922
+ ctx.say(`queue flushed \u2014 ${result.started} prompt(s) sending now, ${result.remaining} still queued`);
48923
+ }
48924
+ },
48829
48925
  {
48830
48926
  name: "/btw",
48831
48927
  description: "side question (bare reopens the last answer)",
@@ -49209,7 +49305,8 @@ function buildSlashDeps(base, hooks) {
49209
49305
  openAgents: hooks.openAgents,
49210
49306
  openSettings: hooks.openSettings,
49211
49307
  refreshFooter: hooks.refreshFooter,
49212
- invalidateFooter: hooks.invalidateFooter
49308
+ invalidateFooter: hooks.invalidateFooter,
49309
+ flushQueue: hooks.flushQueue
49213
49310
  };
49214
49311
  }
49215
49312
  function carrySlashHooks(deps) {
@@ -49232,7 +49329,8 @@ var init_slash_deps = __esm(() => {
49232
49329
  "openAgents",
49233
49330
  "openSettings",
49234
49331
  "refreshFooter",
49235
- "invalidateFooter"
49332
+ "invalidateFooter",
49333
+ "flushQueue"
49236
49334
  ];
49237
49335
  });
49238
49336
 
@@ -49669,6 +49767,7 @@ class SlashPaletteController {
49669
49767
  }
49670
49768
  }
49671
49769
  function SlashPalette(props) {
49770
+ const commands = () => typeof props.commands === "function" ? props.commands() : props.commands;
49672
49771
  const theme = useThemeOptional();
49673
49772
  const color = {
49674
49773
  base: () => theme?.text.base ?? "#e6e6e6",
@@ -49688,7 +49787,7 @@ function SlashPalette(props) {
49688
49787
  setProp(_el$, "paddingLeft", 2);
49689
49788
  insert(_el$, createComponent2(For, {
49690
49789
  get each() {
49691
- return props.controller.filtered(props.commands);
49790
+ return props.controller.filtered(commands());
49692
49791
  },
49693
49792
  children: (command, index) => {
49694
49793
  const active = () => props.controller.isRowActive(index());
@@ -49729,7 +49828,7 @@ function SlashPalette(props) {
49729
49828
  }), null);
49730
49829
  insert(_el$, createComponent2(Show, {
49731
49830
  get when() {
49732
- return overflowHint(props.controller.matches(props.commands), props.controller.offset());
49831
+ return overflowHint(props.controller.matches(commands()), props.controller.offset());
49733
49832
  },
49734
49833
  children: (hint) => (() => {
49735
49834
  var _el$6 = createElement("box"), _el$7 = createElement("text");
@@ -49759,7 +49858,8 @@ function SlashPalette(props) {
49759
49858
  });
49760
49859
  }
49761
49860
  function createSlashHost(deps) {
49762
- const commands = deps.commands ?? coreCommands();
49861
+ const fallbackCommands = coreCommands();
49862
+ const commands = () => typeof deps.commands === "function" ? deps.commands() : deps.commands ?? fallbackCommands;
49763
49863
  const usage = createCommandUsage(deps.seam);
49764
49864
  const controller = new SlashPaletteController(usage);
49765
49865
  const ctx = {
@@ -49777,33 +49877,35 @@ function createSlashHost(deps) {
49777
49877
  return true;
49778
49878
  }
49779
49879
  return {
49780
- commands,
49880
+ get commands() {
49881
+ return commands();
49882
+ },
49781
49883
  controller,
49782
49884
  usage,
49783
49885
  slashComplete(buffer, cursor) {
49784
- controller.sync(buffer, commands);
49785
- const selected = controller.open ? controller.current(commands)?.name : undefined;
49786
- return completeSlash(buffer, cursor, commands, selected === undefined ? {} : {
49886
+ controller.sync(buffer, commands());
49887
+ const selected = controller.open ? controller.current(commands())?.name : undefined;
49888
+ return completeSlash(buffer, cursor, commands(), selected === undefined ? {} : {
49787
49889
  selected
49788
49890
  });
49789
49891
  },
49790
49892
  slashKeyFilter(event, buffer) {
49791
- controller.sync(buffer, commands);
49893
+ controller.sync(buffer, commands());
49792
49894
  if (!controller.open)
49793
49895
  return false;
49794
49896
  if (event.name === "up" || event.name === "down") {
49795
49897
  event.preventDefault();
49796
- controller.move(event.name === "up" ? -1 : 1, commands);
49898
+ controller.move(event.name === "up" ? -1 : 1, commands());
49797
49899
  return true;
49798
49900
  }
49799
49901
  if (event.name === "pageup" || event.name === "pagedown") {
49800
49902
  event.preventDefault();
49801
- controller.movePage(event.name === "pageup" ? -1 : 1, commands);
49903
+ controller.movePage(event.name === "pageup" ? -1 : 1, commands());
49802
49904
  return true;
49803
49905
  }
49804
49906
  if (event.name === "home" || event.name === "end") {
49805
49907
  event.preventDefault();
49806
- controller.moveEdge(event.name === "home" ? "home" : "end", commands);
49908
+ controller.moveEdge(event.name === "home" ? "home" : "end", commands());
49807
49909
  return true;
49808
49910
  }
49809
49911
  if (event.name === "escape") {
@@ -49814,11 +49916,11 @@ function createSlashHost(deps) {
49814
49916
  return false;
49815
49917
  },
49816
49918
  interceptSubmit(buffer, apply) {
49817
- controller.sync(buffer, commands);
49818
- const highlighted = controller.current(commands);
49919
+ controller.sync(buffer, commands());
49920
+ const highlighted = controller.current(commands());
49819
49921
  controller.close();
49820
49922
  const needle = buffer.trim().toLowerCase();
49821
- const exact = commands.find((command) => command.name.toLowerCase() === needle);
49923
+ const exact = commands().find((command) => command.name.toLowerCase() === needle);
49822
49924
  if (exact)
49823
49925
  return isSkillCommand(exact) ? false : run(exact, "");
49824
49926
  if (highlighted) {
@@ -49828,7 +49930,7 @@ function createSlashHost(deps) {
49828
49930
  apply?.(`${highlighted.name} `);
49829
49931
  return false;
49830
49932
  }
49831
- const dispatch = dispatchLine(commands, buffer);
49933
+ const dispatch = dispatchLine(commands(), buffer);
49832
49934
  if (dispatch.kind === "command") {
49833
49935
  return isSkillCommand(dispatch.command) ? false : run(dispatch.command, dispatch.argText);
49834
49936
  }
@@ -50448,7 +50550,7 @@ function buildLocalItems(input) {
50448
50550
  }];
50449
50551
  return items;
50450
50552
  }
50451
- function buildHostItems(document, writable) {
50553
+ function buildHostItems(document, writable, catalog) {
50452
50554
  return HOST_SETTINGS_WHITELIST.map((spec) => {
50453
50555
  const row = document?.namespaces.find((candidate) => candidate.ns === spec.ns);
50454
50556
  const item = {
@@ -50481,21 +50583,33 @@ function buildHostItems(document, writable) {
50481
50583
  const raw = valueAtPath(row.value, spec.path);
50482
50584
  const base = valueAtPath(row.base, spec.path);
50483
50585
  const declared = schemaDeclaresPath(row.schema, spec.path);
50484
- if (raw === undefined && base === undefined && !declared)
50586
+ const permissionRow = spec.id === "permission.defaultPreset";
50587
+ const hasCatalog = permissionRow && catalog !== undefined;
50588
+ if (raw === undefined && base === undefined && !declared && !hasCatalog)
50485
50589
  return item;
50486
50590
  item.revision = row.revision;
50487
50591
  const effective = raw ?? base;
50488
- item.value = effective === undefined ? UNKNOWN : typeof effective === "boolean" ? effective ? "on" : "off" : String(effective);
50592
+ item.value = effective === undefined ? hasCatalog && catalog.defaultPreset !== "" ? catalog.defaultPreset : UNKNOWN : typeof effective === "boolean" ? effective ? "on" : "off" : String(effective);
50489
50593
  item.note = undefined;
50490
50594
  item.editable = writable;
50491
50595
  if (spec.kind === "enum") {
50492
50596
  const info = readSchemaField(row.schema, spec.path);
50493
50597
  const derived = spec.id === "permission.defaultPreset" ? presetEnumFromSchema(row.schema) : [];
50494
- const options = info.options !== undefined && info.options.length > 0 ? info.options : derived;
50495
- if (options.length > 0)
50598
+ const schemaOptions = info.options !== undefined && info.options.length > 0 ? info.options : derived;
50599
+ const catalogOptions = hasCatalog ? catalog.defaultOptions.map((option) => option.value) : [];
50600
+ const options = catalogOptions.length > 0 ? catalogOptions : schemaOptions;
50601
+ if (options.length > 0) {
50496
50602
  item.options = options;
50497
- else
50498
- item.note = "schema \u672A\u58F0\u660E\u53EF\u9009\u9879";
50603
+ if (hasCatalog) {
50604
+ item.source = "permissionPresets/catalog \xB7 \u5199\u5165 settings.mutate";
50605
+ if (item.value !== UNKNOWN && item.value !== NA && !options.includes(item.value)) {
50606
+ item.note = `\u5F53\u524D\u503C "${item.value}" \u4E0D\u5728 catalog \u9ED8\u8BA4\u9009\u9879\u4E2D`;
50607
+ }
50608
+ }
50609
+ } else {
50610
+ item.editable = false;
50611
+ item.note = hasCatalog ? "catalog \u672A\u58F0\u660E\u53EF\u9009\u9879 \u2014 \u53EA\u8BFB\u5C55\u793A\u751F\u6548\u503C" : "\u65E0 preset catalog\uFF08permissionPresets/catalog \u4E0D\u53EF\u7528\uFF09\u2014 \u53EA\u8BFB\u5C55\u793A\u751F\u6548\u503C";
50612
+ }
50499
50613
  }
50500
50614
  if (spec.kind === "number") {
50501
50615
  const info = readSchemaField(row.schema, spec.path);
@@ -51079,6 +51193,7 @@ function SettingsPanel(props) {
51079
51193
  const [open, setOpen] = useSettingsPanelOpenState();
51080
51194
  const [document, setDocument] = createSignal(undefined);
51081
51195
  const [describeError, setDescribeError] = createSignal(undefined);
51196
+ const [permissionCatalog, setPermissionCatalog] = createSignal(undefined);
51082
51197
  const [merged, setMerged] = createSignal({});
51083
51198
  const [profile, setProfile] = createSignal({});
51084
51199
  const [workspace, setWorkspace] = createSignal({});
@@ -51118,7 +51233,7 @@ function SettingsPanel(props) {
51118
51233
  themeNames: safeThemeNames()
51119
51234
  } : {},
51120
51235
  writable: writable().local
51121
- }), ...buildHostItems(document(), writable().host), ...buildOtherItems(document())]);
51236
+ }), ...buildHostItems(document(), writable().host, permissionCatalog()), ...buildOtherItems(document())]);
51122
51237
  const visible = createMemo(() => filterSettingsItems(items(), filter()));
51123
51238
  const active = createMemo(() => visible()[cursor()]);
51124
51239
  function safeThemeNames() {
@@ -51150,6 +51265,7 @@ function SettingsPanel(props) {
51150
51265
  if (face === undefined) {
51151
51266
  setDocument(undefined);
51152
51267
  setDescribeError(undefined);
51268
+ setPermissionCatalog(undefined);
51153
51269
  return;
51154
51270
  }
51155
51271
  try {
@@ -51158,6 +51274,11 @@ function SettingsPanel(props) {
51158
51274
  } catch (error) {
51159
51275
  setDescribeError(error instanceof Error ? error.message : String(error));
51160
51276
  }
51277
+ try {
51278
+ setPermissionCatalog(await face.permissionCatalog?.());
51279
+ } catch {
51280
+ setPermissionCatalog(undefined);
51281
+ }
51161
51282
  }
51162
51283
  function close() {
51163
51284
  unsettings?.();
@@ -53733,6 +53854,12 @@ class RemoteSessionSeam {
53733
53854
  this.#pluginsRevision[0]();
53734
53855
  return this.#session.listPlugins();
53735
53856
  }
53857
+ async refreshSkills() {
53858
+ return this.#session.refreshSkills();
53859
+ }
53860
+ onSkillsChanged(listener) {
53861
+ return this.#session.onSkillsChanged(listener);
53862
+ }
53736
53863
  preset = {
53737
53864
  list: () => this.#session.listPresets(),
53738
53865
  currentId: async () => this.#session.resolveCurrentPresetId(),
@@ -53782,7 +53909,8 @@ class RemoteSessionSeam {
53782
53909
  identity: () => ({
53783
53910
  profile: this.#session.profileName(),
53784
53911
  dshHome: this.#session.homeDir()
53785
- })
53912
+ }),
53913
+ permissionCatalog: () => this.#session.permissionCatalog()
53786
53914
  };
53787
53915
  login = {
53788
53916
  credentialStatus: (ref) => this.#session.credentialStatus(ref),
@@ -53989,6 +54117,12 @@ function V2SessionPage(props) {
53989
54117
  const [now, setNow] = createSignal(new Date);
53990
54118
  const [contextRevision, setContextRevision] = createSignal(0);
53991
54119
  const [presetLabel, setPresetLabel] = createSignal();
54120
+ const [skillRows, setSkillRows] = createSignal(props.skills ?? []);
54121
+ const slashCommands = createMemo(() => withSkillCommands(coreCommands(), skillRows()));
54122
+ onMount(() => {
54123
+ const off = seam.onSkillsChanged?.((rows) => setSkillRows(rows.map((row) => ({ name: row.name, description: row.description, path: "skills/list" }))));
54124
+ onCleanup(() => off?.());
54125
+ });
53992
54126
  const refreshPresetLabel = () => {
53993
54127
  const face = seam.preset;
53994
54128
  if (!face)
@@ -54213,7 +54347,7 @@ function V2SessionPage(props) {
54213
54347
  };
54214
54348
  const slash = createSlashHost(buildSlashDeps({
54215
54349
  seam,
54216
- commands: withSkillCommands(coreCommands(), props.skills ?? []),
54350
+ commands: slashCommands,
54217
54351
  say: sayLine,
54218
54352
  clear: () => {
54219
54353
  projection.hydrate([]);
@@ -54223,6 +54357,7 @@ function V2SessionPage(props) {
54223
54357
  setTools(0);
54224
54358
  refreshFooterData();
54225
54359
  resetSkinLineFades();
54360
+ setSkillRows(props.skills ?? []);
54226
54361
  setContextRevision((n) => n + 1);
54227
54362
  },
54228
54363
  reload: (sessionId) => {
@@ -54235,6 +54370,7 @@ function V2SessionPage(props) {
54235
54370
  seam.currentModelSelection().then(setModel);
54236
54371
  refreshFooterData();
54237
54372
  refreshPresetLabel();
54373
+ setSkillRows(props.skills ?? []);
54238
54374
  setContextRevision((n) => n + 1);
54239
54375
  return settled;
54240
54376
  },
@@ -54251,7 +54387,8 @@ function V2SessionPage(props) {
54251
54387
  invalidateFooter: () => {
54252
54388
  footerRefreshSeq++;
54253
54389
  },
54254
- themes: themeFace
54390
+ themes: themeFace,
54391
+ flushQueue: () => composerRef?.flushQueue() ?? { kind: "empty", started: 0, remaining: 0 }
54255
54392
  }));
54256
54393
  const overlayHost = createComponent2(TurnOverlayHost, {
54257
54394
  controller: overlays,
@@ -54382,7 +54519,7 @@ function V2SessionPage(props) {
54382
54519
  slashSync: (buffer) => slash.controller.sync(buffer, slash.commands),
54383
54520
  interceptSubmit: slash.interceptSubmit,
54384
54521
  slashComplete: (buffer, cursor) => dialog.stack.length > 0 ? undefined : slash.slashComplete(buffer, cursor),
54385
- slashPalette: () => createComponent2(SlashPalette, { controller: slash.controller, commands: slash.commands }),
54522
+ slashPalette: () => createComponent2(SlashPalette, { controller: slash.controller, commands: () => slash.commands }),
54386
54523
  slashHeight: () => slash.controller.rows()
54387
54524
  })
54388
54525
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-opentui",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "bin": {