dsh-brief-sidebar 0.9.11 → 0.9.13

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` (15 rc releases across lines 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
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` (16 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)
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.11",
3
+ "version": "0.9.13",
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"
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"
8
8
  },
9
9
  "contributes": {
10
10
  "tools": [],
package/lib/client.js CHANGED
@@ -3789,6 +3789,18 @@ window.__ModuleLoader__.load({
3789
3789
  * Memory viewer component: fetches full metadata by memoryId via records-meta API,
3790
3790
  * renders a structured header bar + markdown body.
3791
3791
  */
3792
+ /**
3793
+ * 把失败信封说成人话。
3794
+ *
3795
+ * 直接把 `error` 当字符串拼进模板会得到 `⚠️ [object Object]`——用户看不到原因,
3796
+ * 排查只能靠猜。取 `error.message`,拿不到才给兜底文案。
3797
+ */
3798
+ function describeEnvelopeError(env) {
3799
+ const e = env.error;
3800
+ if (typeof e === "string" && e.length > 0) return e;
3801
+ if (e !== null && typeof e === "object" && typeof e.message === "string" && e.message.length > 0) return e.message;
3802
+ return "未找到该记忆";
3803
+ }
3792
3804
  const WRAP = {
3793
3805
  padding: "12px 16px",
3794
3806
  overflow: "auto",
@@ -3962,16 +3974,24 @@ window.__ModuleLoader__.load({
3962
3974
  const [record, setRecord] = (0, react.useState)(void 0);
3963
3975
  const [error, setError] = (0, react.useState)(void 0);
3964
3976
  (0, react.useEffect)(() => {
3977
+ if (memoryId.length === 0) return;
3965
3978
  let cancelled = false;
3966
3979
  setError(void 0);
3967
3980
  fetch("/dsh-memory/rpc/records-meta", {
3968
3981
  method: "POST",
3969
3982
  headers: { "Content-Type": "application/json" },
3970
3983
  body: JSON.stringify({ ids: [memoryId] })
3971
- }).then((r) => r.json()).then((env) => {
3984
+ }).then(async (r) => {
3985
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
3986
+ return await r.json();
3987
+ }).then((env) => {
3972
3988
  if (cancelled) return;
3973
- if (env.ok && env.value?.items?.[0]) setRecord(env.value.items[0]);
3974
- else setError(env.error ?? "未找到该记忆");
3989
+ const first = env.ok === true ? env.value?.items?.[0] : void 0;
3990
+ if (first !== void 0) {
3991
+ setRecord(first);
3992
+ return;
3993
+ }
3994
+ setError(describeEnvelopeError(env));
3975
3995
  }).catch((e) => {
3976
3996
  if (!cancelled) setError(e instanceof Error ? e.message : String(e));
3977
3997
  });
@@ -3979,8 +3999,8 @@ window.__ModuleLoader__.load({
3979
3999
  cancelled = true;
3980
4000
  };
3981
4001
  }, [memoryId]);
3982
- if (error !== void 0) return (0, react.createElement)("div", { style: WRAP }, (0, react.createElement)("div", { style: PLACEHOLDER }, `⚠️ ${error}`));
3983
4002
  if (memoryId.length === 0) return (0, react.createElement)("div", { style: WRAP }, (0, react.createElement)("div", { style: PLACEHOLDER }, "未在本轮启动周期选择查看的记忆"));
4003
+ if (error !== void 0) return (0, react.createElement)("div", { style: WRAP }, (0, react.createElement)("div", { style: PLACEHOLDER }, `⚠️ ${error}`));
3984
4004
  if (record === void 0) return (0, react.createElement)("div", { style: WRAP }, (0, react.createElement)("div", { style: PLACEHOLDER }, "加载中…"));
3985
4005
  return (0, react.createElement)("div", { style: WRAP }, (0, react.createElement)("div", { style: HEADER }, (0, react.createElement)("div", { style: NAME_STYLE$1 }, record.name ?? record.id), (0, react.createElement)("div", null, (0, react.createElement)("span", { style: BADGE }, record.type), (0, react.createElement)("span", { style: BADGE }, record.scope === "workspace" ? "工作区" : "全局"), record.maturity && (0, react.createElement)("span", { style: BADGE }, `成熟:${record.maturity}`), (0, react.createElement)("span", { style: BADGE }, `P${record.priority}`), record.retired && (0, react.createElement)("span", { style: {
3986
4006
  ...BADGE,