dsh-brief-sidebar 0.9.17 → 0.9.19

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/README.md CHANGED
@@ -31,7 +31,7 @@ dock cell、`dsh-tool-todo` 属于 DSH 上游领域,沿用 `todo` 原词,不
31
31
  **记忆系统**:简报的第三个分区(记忆召回)目前**仅预留布局插槽**,处于**规划中**,本期不渲染——见 R11 / K4。
32
32
 
33
33
  <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
34
- - **Supported DSH hosts:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-rc.1` `0.2.1-rc.2` `0.2.1-rc.3` `0.2.1-rc.4` `0.2.1-rc.5` (20 rc releases across lines 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
34
+ - **Supported DSH hosts:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-rc.1` `0.2.1-rc.2` `0.2.1-rc.3` `0.2.1-rc.4` `0.2.1-rc.5` `0.2.2-rc.1` (21 rc releases across lines 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 / 0.2.2)
35
35
  <!-- host-compat:end -->
36
36
 
37
37
  ## 需求映射
package/dsh.plugin.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-brief-sidebar",
3
- "version": "0.9.17",
3
+ "version": "0.9.19",
4
4
  "main": "./lib/index.mjs",
5
5
  "description": "会话简报侧栏页(brief):把会话的 todo 列表(`todos` 投影的进展看板)、产物列表(`dshSummaryDeliverables` 投影的实时产出文件)与记忆槽位(`memorySlots` 投影,来自 dsh-prime-memory,开关可关)一起渲染成右侧栏的一个「概要」tab,并遮蔽 DSH 官方那条 composer 上方的 todo 面板。只读展示,不做写回。",
6
6
  "engines": {
7
- "dsh": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5"
7
+ "dsh": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5 || 0.2.2-rc.1"
8
8
  },
9
9
  "contributes": {
10
10
  "tools": [],
package/lib/client.js CHANGED
@@ -4320,10 +4320,16 @@ window.__ModuleLoader__.load({
4320
4320
  return raw.subscribe(() => setPolled(raw.getSnapshot()));
4321
4321
  });
4322
4322
  const tabs = props.useTabs !== void 0 ? props.useTabs((value) => value) : polled;
4323
+ const ownId = props.ownId ?? "__own__";
4324
+ const rows = props.renderOwn ? [{
4325
+ id: ownId,
4326
+ order: Number.NEGATIVE_INFINITY,
4327
+ label: ownId
4328
+ }, ...tabs.filter((tab) => tab.id !== ownId)] : tabs;
4323
4329
  return (0, react.createElement)("div", { style: {
4324
4330
  display: "grid",
4325
4331
  gap: "12px"
4326
- } }, tabs.map((row) => (0, react.createElement)("div", { key: row.id }, props.renderSlot ? props.renderSlot(FAMILY_CHILD_KEY, {}, {
4332
+ } }, rows.map((row) => (0, react.createElement)("div", { key: row.id }, props.renderOwn && row.id === ownId ? props.renderOwn() : props.renderSlot ? props.renderSlot(FAMILY_CHILD_KEY, {}, {
4327
4333
  only: row.id,
4328
4334
  fallback: null
4329
4335
  }) : props.renderContributor?.(row.id) ?? null)));
@@ -4366,7 +4372,7 @@ window.__ModuleLoader__.load({
4366
4372
  * @param log - console 前缀(带插件名)。
4367
4373
  * @returns 取消定时器与撤销接管注册的 disposer。
4368
4374
  */
4369
- function claimFamilyHostIfOrphaned(slots, isHeld, label, log) {
4375
+ function claimFamilyHostIfOrphaned(slots, isHeld, label, log, ownTab) {
4370
4376
  let disposeClaim;
4371
4377
  let claimed = false;
4372
4378
  const timer = setTimeout(() => {
@@ -4397,7 +4403,9 @@ window.__ModuleLoader__.load({
4397
4403
  label,
4398
4404
  inject: () => ({
4399
4405
  hooks: { tabs: ledger },
4400
- renderContributor
4406
+ renderContributor,
4407
+ ownId: ownTab?.id,
4408
+ renderOwn: ownTab === void 0 ? void 0 : () => (0, react.createElement)(ownTab.component, ownTab.inject ? ownTab.inject() : {})
4401
4409
  }),
4402
4410
  children: { [FAMILY_CHILD_KEY]: {
4403
4411
  kind: "list",
@@ -4634,13 +4642,11 @@ window.__ModuleLoader__.load({
4634
4642
  registerOnNative(scope.sidebarRightTabs);
4635
4643
  });
4636
4644
  const slots = ctx.get("slots");
4637
- /** 探针:宿主执行过我们的 tab 工厂 == 有人声明了 `dsh-family.tab`。这是插件侧
4638
- * 唯一合法的「容器在不在」判据(槽门面不暴露 spec 查询,entriesOfSlot 也不区分
4639
- * 「已声明但空」与「未声明」)。 */
4640
- let familyTabHeld = false;
4645
+ let configFormsHandle;
4641
4646
  ctx.inject(["configForms"], (scope) => {
4642
4647
  const configForms = scope.configForms;
4643
4648
  if (slots === void 0 || configForms === void 0 || typeof configForms.get !== "function") return;
4649
+ configFormsHandle = configForms;
4644
4650
  /** Same face for both seats: the entry scope plus the applied-time binder. */
4645
4651
  const injectFactory = () => ({
4646
4652
  t,
@@ -4648,23 +4654,33 @@ window.__ModuleLoader__.load({
4648
4654
  });
4649
4655
  /** The slot core hands the component `unknown` props (registry typing). */
4650
4656
  const component = BriefSettingsCard;
4651
- slots.inject("dsh-family.tab", () => {
4652
- familyTabHeld = true;
4653
- return slots.register({
4654
- name: "dsh-family.tab",
4655
- id: "brief-sidebar",
4656
- order: 30,
4657
- label: () => t("settings.title"),
4658
- inject: injectFactory
4659
- }, component);
4660
- });
4657
+ slots.inject("dsh-family.tab", () => slots.register({
4658
+ name: "dsh-family.tab",
4659
+ id: "brief-sidebar",
4660
+ order: 30,
4661
+ label: () => t("settings.title"),
4662
+ inject: injectFactory
4663
+ }, component));
4661
4664
  slots.inject("plugins.bundle.config", () => slots.register({
4662
4665
  name: "plugins.bundle.config",
4663
4666
  key: "dsh-brief-sidebar",
4664
4667
  inject: injectFactory
4665
4668
  }, component));
4666
4669
  });
4667
- if (slots !== void 0) ctx.effect(() => claimFamilyHostIfOrphaned(slots, () => familyTabHeld, () => "起子插件设置", LOG), "brief: family host backstop");
4670
+ if (slots !== void 0) ctx.effect(() => claimFamilyHostIfOrphaned(slots, () => {
4671
+ try {
4672
+ return slots.entries("settings.section").some((e) => String((e.options ?? {}).id ?? "") === "dsh-family");
4673
+ } catch {
4674
+ return false;
4675
+ }
4676
+ }, () => "起子插件设置", LOG, {
4677
+ id: "brief-sidebar",
4678
+ component: BriefSettingsCard,
4679
+ inject: () => ({
4680
+ t,
4681
+ scope: configFormsHandle?.get("dsh-brief-sidebar")
4682
+ })
4683
+ }), "brief: family host backstop");
4668
4684
  try {
4669
4685
  let nativeTabsAtApply = false;
4670
4686
  try {