dsh-agent-persona 0.1.1 → 0.1.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
@@ -4,6 +4,23 @@ All notable changes to this project are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.2] - 2026-09-21
8
+
9
+ ### Fixed
10
+
11
+ - **The sidebar card could be missing after a restart even though the switch showed it on.** The two read
12
+ different sources: the switch shows the store's `prefs.showSidebar` (through the remote view), while the
13
+ registration resolved the sidebar service once, when this plugin applied, and gave up for good if it was not
14
+ there yet. Plugin load order is not guaranteed, so a restart could put this plugin's client half before the
15
+ sidebar plugin's; the card then only came back by toggling the switch by hand. The service is now awaited —
16
+ registered immediately when it is already present, otherwise through `ctx.inject(['betterSidebar'], …)` and
17
+ bound to the arriving context, so it is torn down with the provider. The switch still acts at once.
18
+
19
+ ### Added
20
+
21
+ - A `screenshots.json` in the repository, so storefronts show the three interface screenshots and they can be
22
+ replaced by pushing here rather than by opening a pull request elsewhere.
23
+
7
24
  ## [0.1.1] - 2026-09-20
8
25
 
9
26
  ### Added
@@ -165,5 +182,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
165
182
  - The conversation dialog hides plugin-injected user-side content — `AGENTS.md`, runtime snapshots, the skill
166
183
  catalog, goal rounds — reporting only 「已隐藏 N 条插件注入内容」.
167
184
 
185
+ [0.1.2]: https://github.com/Awoodwhale/dsh-agent-persona/compare/v0.1.1...v0.1.2
168
186
  [0.1.1]: https://github.com/Awoodwhale/dsh-agent-persona/compare/v0.1.0...v0.1.1
169
187
  [0.1.0]: https://github.com/Awoodwhale/dsh-agent-persona/releases/tag/v0.1.0
package/lib/client.js CHANGED
@@ -2609,21 +2609,27 @@ ${state.proposal.trim()}
2609
2609
  };
2610
2610
  {
2611
2611
  let disposeTab;
2612
- syncSidebarModule = () => {
2612
+ let sidebarService;
2613
+ const resolveSidebar = (from = void 0) => {
2614
+ try {
2615
+ return (from ?? ctx).get("betterSidebar");
2616
+ } catch {
2617
+ return void 0;
2618
+ }
2619
+ };
2620
+ const dropTab = () => {
2613
2621
  if (typeof disposeTab === "function") {
2614
2622
  disposeTab();
2615
2623
  disposeTab = void 0;
2616
2624
  }
2625
+ };
2626
+ const mountTab = (service) => {
2627
+ sidebarService = service;
2628
+ dropTab();
2617
2629
  if (readPrefs().showSidebar === false) return;
2618
- let better;
2619
- try {
2620
- better = ctx.get("betterSidebar");
2621
- } catch {
2622
- better = void 0;
2623
- }
2624
- sidebarAvailable = better !== void 0 && better !== null && typeof better.registerTab === "function";
2630
+ sidebarAvailable = service !== void 0 && service !== null && typeof service.registerTab === "function";
2625
2631
  if (sidebarAvailable !== true) return;
2626
- disposeTab = better.registerTab({
2632
+ disposeTab = service.registerTab({
2627
2633
  id: NS,
2628
2634
  title: () => "Agent \u4EBA\u8BBE",
2629
2635
  order: 30,
@@ -2631,7 +2637,20 @@ ${state.proposal.trim()}
2631
2637
  component: SidebarPersonaView
2632
2638
  });
2633
2639
  };
2634
- syncSidebarModule();
2640
+ syncSidebarModule = () => mountTab(sidebarService ?? resolveSidebar());
2641
+ const present = resolveSidebar();
2642
+ if (present !== void 0) {
2643
+ mountTab(present);
2644
+ } else if (typeof ctx.inject === "function") {
2645
+ ctx.inject(["betterSidebar"], (sidebarCtx) => {
2646
+ const service = resolveSidebar(sidebarCtx);
2647
+ if (service === void 0) return;
2648
+ sidebarCtx.effect(() => {
2649
+ mountTab(service);
2650
+ return () => dropTab();
2651
+ }, `${NS}: sidebar tab`);
2652
+ });
2653
+ }
2635
2654
  }
2636
2655
  ctx.slots.inject("settings.section", () => ctx.slots.register({
2637
2656
  name: "settings.section",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agent-persona",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Workspace personas for DeepSeek Harness (DSH): create many system-prompt personas and scope each one by workspace path or session id (exact / prefix / regex / contains), managed from a Web settings page with Markdown editing and AI tuning.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",