sage-mem 2.15.9 → 2.15.11

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.en.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  **Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.**
14
14
 
15
- **Current release: `2.15.9`** — the npm badge above is the dynamic source of truth. **Contract baseline: `1.0.0`** — the first stable release, whose public commitments, the capability boundaries and the list of things it explicitly cannot do are frozen in the
15
+ **Current release: `2.15.11`** — the npm badge above is the dynamic source of truth. **Contract baseline: `1.0.0`** — the first stable release, whose public commitments, the capability boundaries and the list of things it explicitly cannot do are frozen in the
16
16
  [frozen contract](https://github.com/gezi-wen/sage-mem/blob/main/docs/1.0.0-contract.md).
17
17
 
18
18
  If it is useful to you, a Star is the most direct feedback.
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  > File-based cross-session memory for DeepSeek Harness — every memory is a plain markdown file you can open, edit and delete. No database, no worker, no port.
16
16
 
17
- **当前发布版本:`2.15.9`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
17
+ **当前发布版本:`2.15.11`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
18
18
  [契约冻结](https://github.com/gezi-wen/sage-mem/blob/main/docs/1.0.0-contract.md)。
19
19
 
20
20
  如果它对你有用,给个 Star 是最直接的反馈。
package/lib/client.js CHANGED
@@ -2881,6 +2881,8 @@ const StarmapRuntime = (function (require, _react) {
2881
2881
  ".smem-todo-depth-select{width:auto;padding:0 2px;font-size:11.5px;}",
2882
2882
  // 「搬进流水」是待删除块的主动作(清空是丢弃、这条是留档),给品牌色。
2883
2883
  ".smem-todo-archive{font-weight:600;}",
2884
+ // 2.15.10:页签标题里的图标与文字垂直对齐。
2885
+ ".smem-todo-tab-title{display:inline-flex;align-items:center;gap:5px;}",
2884
2886
  // 2.15.5:确认条独占一行,与「搬进流水」那颗按钮不在同一位置(双击打不到它)。
2885
2887
  ".smem-todo-confirm{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 0 2px;border-top:1px dashed var(--dsw-alias-border-l1);}",
2886
2888
  ".smem-todo-confirm .smem-todo-archive{color:var(--dsw-alias-state-danger-primary,#ef4444);}",
@@ -2895,7 +2897,7 @@ const StarmapRuntime = (function (require, _react) {
2895
2897
  ".smem-todo-done-title{font-weight:600;}",
2896
2898
  ].join("\n");
2897
2899
 
2898
- /**
2900
+ /**
2899
2901
  * 把输入框里的一串标签切成数组。
2900
2902
  *
2901
2903
  * 分隔符收半角逗号、全角逗号、顿号三种 —— 中文输入法下这三种都会自然敲出来。
@@ -11047,12 +11049,36 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
11047
11049
 
11048
11050
  // ── 注册与热开关 ──────────────────────────────────────────────────
11049
11051
 
11052
+ /**
11053
+ * 待办清单的图标(2.15.10)。
11054
+ *
11055
+ * 内联 SVG、`currentColor`、无外链:右栏页签只有 16px,栅格图(`icon.png` 是插件卡片
11056
+ * 用的 35 KB 位图)在这里会糊。宿主给 guide 卡片传 `size`(22/26),页签标题按 14 传。
11057
+ *
11058
+ * @param {{size?: number, className?: string}} [props]
11059
+ */
11060
+ function TodoGlyph(props) {
11061
+ const size = props && typeof props.size === "number" ? props.size : 14;
11062
+ return h("svg", {
11063
+ viewBox: "0 0 16 16", width: size, height: size, fill: "none",
11064
+ stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round",
11065
+ className: props && typeof props.className === "string" ? props.className : undefined,
11066
+ "aria-hidden": "true",
11067
+ }, [
11068
+ h("rect", { key: "f", x: 2.75, y: 2.25, width: 10.5, height: 11.5, rx: 2 }),
11069
+ h("path", { key: "l1", d: "M5.25 6h3.5" }),
11070
+ h("path", { key: "l2", d: "M5.25 8.75h2" }),
11071
+ h("path", { key: "c", d: "M9.25 10.6l1.05 1.05 1.95-2.3" }),
11072
+ ]);
11073
+ }
11050
11074
  /** guide 条目(开始页那张卡片)。关掉开关时整条不给 —— 卡片随之消失。 */
11051
11075
  function todoBoardGuideEntry() {
11052
11076
  return {
11053
11077
  id: TODO_GUIDE_ID,
11054
11078
  order: 30,
11055
11079
  title: function () { return t("todo.guide.title"); },
11080
+ // 2.15.10:开始页那张卡片也用同一个图标(宿主把 size 传进来)。
11081
+ icon: TodoGlyph,
11056
11082
  description: function () { return t("todo.guide.desc"); },
11057
11083
  };
11058
11084
  }
@@ -11116,7 +11142,11 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
11116
11142
  });
11117
11143
  todoBoardTitleDispose = ctx.slots.inject("sidebar.right.pane.tab.title", function () {
11118
11144
  return ctx.slots.register({ name: "sidebar.right.pane.tab.title", key: TODO_TAB_ID }, function () {
11119
- return h("span", null, t("todo.tabTitle"));
11145
+ return h("span", { className: "smem-todo-tab-title" }, [
11146
+ // 2.15.10:页签标题带图标 —— 宿主只给一个 span 的位置,图标得自己画。
11147
+ h(TodoGlyph, { key: "i", size: 14 }),
11148
+ h("span", { key: "t" }, t("todo.tabTitle")),
11149
+ ]);
11120
11150
  });
11121
11151
  });
11122
11152
  } catch (e) {
@@ -11243,6 +11273,7 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
11243
11273
  rememberOrigin: rememberTodoOrigin,
11244
11274
  recallOrigin: recallTodoOrigin,
11245
11275
  arrowIcon: todoArrowIcon,
11276
+ glyph: TodoGlyph,
11246
11277
  isEnabled: function () { return todoBoardEnabled; },
11247
11278
  notify: todoBoardNotify,
11248
11279
  };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * 注入调试账的结果形状(2026-11-22 从 `typert.host.js` 拆出)。
3
+ *
4
+ * 为什么单独一份:`typert.host.js` 有 1160 行那条守卫(契约面不许无限膨胀)。2.15.11 补
5
+ * `gated` / `validitySuppressed` 时又贴顶,按 D47 的口径「先想能不能挪走」——把这一族纯形状
6
+ * 挪出来,invocation 声明仍留在 `typert.host.js`。
7
+ *
8
+ * 依赖方向:只依赖 zod。
9
+ */
10
+ import { z } from 'zod'
11
+
12
+ /** 一条打分(文件 + 分数)。 */
13
+ export const recallDebugScoreSchema = z.object({
14
+ 'file': z.string().readonly(),
15
+ 'score': z.number().readonly(),
16
+ }).readonly()
17
+
18
+ /**
19
+ * 一步装配的调试记录。
20
+ *
21
+ * `gated` 与 `validitySuppressed` 是「这条记忆为什么没进来」的两个主要线索:
22
+ * 前者把「同题同目录没重算」与「算过了但没东西可给」分开(两者 `outcome` 都是 `empty`),
23
+ * 后者列出被失效 / 待裁决矛盾挡掉的条目。
24
+ */
25
+ export const recallDebugRecordSchema = z.object({
26
+ 'at': z.number().readonly(),
27
+ 'sessionId': z.string().readonly(),
28
+ 'query': z.string().readonly(),
29
+ // injected | card-only | empty:这一步到底注进去了什么
30
+ 'outcome': z.string().readonly(),
31
+ 'deduped': z.boolean().readonly(),
32
+ 'baseline': z.number().readonly(),
33
+ 'scanned': z.number().readonly(),
34
+ 'hits': z.number().readonly(),
35
+ 'scores': z.array(recallDebugScoreSchema).readonly(),
36
+ 'body': z.array(recallDebugScoreSchema).readonly(),
37
+ 'picked': z.array(z.string()).readonly(),
38
+ 'injected': z.array(z.string()).readonly(),
39
+ // chars = 这一步正文;sessionChars = 本代累计;cardChars = 这一步的卡
40
+ 'chars': z.number().readonly(),
41
+ 'sessionChars': z.number().readonly(),
42
+ 'cardChars': z.number().readonly(),
43
+ 'skippedByBudget': z.number().readonly(),
44
+ 'card': z.string().readonly(),
45
+ 'gated': z.boolean().readonly().optional(),
46
+ // ⚠️ 2.15.11 定为可选:有的分支(短路、早期返回)不带这个键,写成必填会让整条调用被判坏 ——
47
+ // 那正是这一族 bug 的形态。
48
+ 'validitySuppressed': z.array(z.object({
49
+ 'file': z.string().readonly(),
50
+ 'reason': z.string().readonly(),
51
+ 'label': z.string().readonly(),
52
+ 'conflictId': z.string().readonly().optional(),
53
+ }).readonly()).readonly().optional(),
54
+ }).readonly()
55
+
56
+ /** 开关关着时 records 是空数组、enabled 是 false —— 面板据此不显示入口。 */
57
+ export const recallDebugResultSchema = z.object({
58
+ 'enabled': z.boolean().readonly(),
59
+ 'records': z.array(recallDebugRecordSchema).readonly(),
60
+ }).readonly()
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { z } from 'zod'
8
8
  import { checkpointsResultSchema } from './shared/checkpoints-schema.js'
9
+ import { recallDebugResultSchema } from './shared/recall-debug-schema.js'
9
10
  import { MD_NAME_PATTERN } from './shared/md-name.js'
10
11
  import { MAX_FILE_BYTES, MAX_RAW_BYTES } from './shared/limits.js'
11
12
 
@@ -344,20 +345,7 @@ const rawFileContentSchema = z.string().max(MAX_RAW_BYTES)
344
345
  // 一个永远 undefined 的格子(与 R01 漏四个配置字段同一类错误)。
345
346
  // 写法比相邻 schema 紧凑(一行多字段):本文件已有 ≤900 行的结构守卫
346
347
  // (test/structure-test.mjs),加一条 remote 不能把文件顶爆。
347
- const recallDebugScoreSchema = z.object({ 'file': z.string().readonly(), 'score': z.number().readonly() }).readonly()
348
- const recallDebugRecordSchema = z.object({
349
- 'at': z.number().readonly(), 'sessionId': z.string().readonly(), 'query': z.string().readonly(),
350
- // injected | card-only | empty:这一步到底注进去了什么
351
- 'outcome': z.string().readonly(), 'deduped': z.boolean().readonly(), 'baseline': z.number().readonly(),
352
- 'scanned': z.number().readonly(), 'hits': z.number().readonly(),
353
- 'scores': z.array(recallDebugScoreSchema).readonly(), 'body': z.array(recallDebugScoreSchema).readonly(),
354
- 'picked': z.array(z.string()).readonly(), 'injected': z.array(z.string()).readonly(),
355
- // chars = 这一步正文;sessionChars = 本代累计;cardChars = 这一步的卡
356
- 'chars': z.number().readonly(), 'sessionChars': z.number().readonly(), 'cardChars': z.number().readonly(),
357
- 'skippedByBudget': z.number().readonly(), 'card': z.string().readonly(),
358
- }).readonly()
359
- // 开关关着时 records 是空数组、enabled 是 false —— 面板据此不显示入口。
360
- const recallDebugResultSchema = z.object({ 'enabled': z.boolean().readonly(), 'records': z.array(recallDebugRecordSchema).readonly() }).readonly()
348
+
361
349
 
362
350
  // ── autodream(夜间记忆整理)───────────────────────────────────────────────
363
351
  // 配置的每一项都可写;lastResult 是一个「成功/失败两条分支共用」的结构,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sage-mem",
3
3
  "description": "Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.",
4
- "version": "2.15.9",
4
+ "version": "2.15.11",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "icon": "./icon.png",