@yolk_vat-y/dsh-project-memory 0.6.0 → 0.6.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 +104 -2
- package/README.md +10 -10
- package/README.zh-CN.md +10 -10
- package/client/client.js +363 -123
- package/client/client.js.map +1 -1
- package/package.json +11 -8
- package/src/auto-inject.js +25 -1
- package/src/client/MemoryView.tsx +157 -44
- package/src/client/TaskPanel.module.css +23 -0
- package/src/client/locales.ts +10 -0
- package/src/client/paging.js +165 -0
- package/src/commands/insight-actions.js +85 -11
- package/src/commands/invocation.js +4 -1
- package/src/commands/task-actions.js +5 -0
- package/src/index.js +10 -0
- package/src/insight-store.js +361 -35
- package/src/lazy.js +5 -3
- package/src/recall.js +13 -8
- package/src/setup/taskbridge.js +13 -7
- package/src/store.js +170 -131
- package/src/tools/forget.js +26 -6
- package/src/tools/lesson-tools.js +21 -8
- package/src/tools/query-memory.js +10 -4
- package/src/tools/remember.js +30 -14
- package/src/tools/task-tools.js +3 -0
- package/src/types.js +8 -1
- package/src/util/fs.js +3 -1
- package/src/util/session-dir.js +48 -0
- package/src/vector-index.js +3 -2
|
@@ -6,22 +6,26 @@ import { cfgInsight, saveInsight, defaultGlobalFile, GlobalStore } from '../insi
|
|
|
6
6
|
import { ensureGlobalInit } from '../global-seed.js'
|
|
7
7
|
import { INSIGHT_KINDS, INSIGHT_SCOPES } from '../insight-store.js'
|
|
8
8
|
import { sessionIdOf } from '../util/task-view.js'
|
|
9
|
+
import { createVectorRerank, vectorItemsFrom } from '../vector-index.js'
|
|
10
|
+
import { createWriteCosine } from '../auto-inject.js'
|
|
9
11
|
|
|
10
12
|
export function lessonTool(config) {
|
|
11
13
|
// 描述预算:这两段以前同时出现在「工具描述」和「参数描述」里,等于付两遍钱。
|
|
12
14
|
// 现在只在参数上写一次 —— 语义一条没少,只是不再重复。
|
|
13
|
-
const kindDesc = 'lesson(踩坑/纠偏, 用 pattern+fix) | decision(选型, choice+reason) | procedure(步骤, steps) | experience(
|
|
15
|
+
const kindDesc = 'lesson(踩坑/纠偏, 用 pattern+fix) | decision(选型, choice+reason) | procedure(步骤, steps) | experience(问题→解法,remember 写的形态);默认 lesson。'
|
|
14
16
|
const scopeDesc =
|
|
15
17
|
'task(任务私有,随任务归档) | project(项目资产) | global(个人能力库,跨项目);默认 project。' +
|
|
16
|
-
'解析顺序:显式 scope > task_id > 当前绑定任务 > project
|
|
18
|
+
'解析顺序:显式 scope > task_id > 当前绑定任务 > project。给了 id 时忽略 scope:条目留在原层。'
|
|
17
19
|
return defineTool({
|
|
18
20
|
name: 'save_lesson',
|
|
19
21
|
description:
|
|
20
22
|
'把一条教训 / 决策 / 流程写进分层记忆(单条 insight)。新的经验优先用它,而不是 remember。' +
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
+
'在踩到坑、被纠正、做了值得记的取舍时调用;日常琐事不要写。' +
|
|
24
|
+
'写入前会与既有记忆比对:相似度 ≥0.9 自动覆盖那一条(旧值留在 prev,可写回);≥0.7 在返回里提示近邻 id。' +
|
|
25
|
+
'发现记错了/过时了:带 id 再调一次就是就地覆盖,不必新写一条;确定该删的用 forget。' +
|
|
23
26
|
'kind / scope / trigger 的语义见对应参数。',
|
|
24
27
|
parameters: {
|
|
28
|
+
id: { type: 'string', description: '要就地更新的既有条目 id(来自 query_memory 或上一次写入返回的近邻提示)。给了它只覆盖本次显式传的字段,忽略 scope。' },
|
|
25
29
|
title: { type: 'string', description: 'One-line title (lesson: the failure pattern; decision: the topic; procedure: the name).' },
|
|
26
30
|
kind: { type: 'string', enum: INSIGHT_KINDS, description: kindDesc },
|
|
27
31
|
scope: { type: 'string', enum: INSIGHT_SCOPES, description: scopeDesc },
|
|
@@ -89,6 +93,7 @@ export function lessonTool(config) {
|
|
|
89
93
|
const taskId = args.task_id || boundTaskId
|
|
90
94
|
|
|
91
95
|
const raw = {
|
|
96
|
+
id: args.id,
|
|
92
97
|
title: args.title,
|
|
93
98
|
kind: args.kind,
|
|
94
99
|
pattern: args.pattern,
|
|
@@ -101,23 +106,31 @@ export function lessonTool(config) {
|
|
|
101
106
|
symbols: args.symbols,
|
|
102
107
|
confidence: args.confidence,
|
|
103
108
|
}
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
// 就地更新只要求 id(可以只改一个字段);新建仍然要求有个能当标题的东西。
|
|
110
|
+
if (!args.id && !raw.title && !raw.pattern && !raw.choice) {
|
|
111
|
+
return truncate(JSON.stringify({ success: false, error: '需要 title / pattern / choice 之一(或给 id 做就地更新)' }), config.maxOutputChars || 8000)
|
|
106
112
|
}
|
|
107
113
|
if (!INSIGHT_KINDS.includes(raw.kind)) raw.kind = 'lesson'
|
|
108
114
|
|
|
109
115
|
let scope = args.scope
|
|
110
116
|
if (!scope) scope = taskId ? 'task' : 'project'
|
|
111
|
-
if (scope === 'task' && !taskId) {
|
|
117
|
+
if (!args.id && scope === 'task' && !taskId) {
|
|
112
118
|
return truncate(JSON.stringify({ success: false, error: 'task 级写入需要 task_id(或先 select_task 绑定会话)' }), config.maxOutputChars || 8000)
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
ensureGlobalInit(config) // 幂等确保 global 文件结构就绪
|
|
116
122
|
const globalStore = new GlobalStore(cfg.globalFile || defaultGlobalFile()).load()
|
|
117
123
|
|
|
124
|
+
// 可选向量层:**没装/没配就是 null**,此时 saveInsight 逐字段退回原来的纯词法行为。
|
|
125
|
+
// 就地更新(给了 id)不需要比对,跳过它可以省掉一次模型加载(~118ms / ~120MB)。
|
|
126
|
+
let cosine = null
|
|
127
|
+
if (!args.id) {
|
|
128
|
+
cosine = await createWriteCosine(config, { storeDir: memoryDir, items: vectorItemsFrom(store, globalStore) })
|
|
129
|
+
}
|
|
130
|
+
|
|
118
131
|
let result
|
|
119
132
|
store.commit((s) => {
|
|
120
|
-
result = saveInsight({ store: s, globalStore, raw, scope, taskId, cfg, source: 'agent' })
|
|
133
|
+
result = saveInsight({ store: s, globalStore, raw, scope, taskId, cfg, source: 'agent', cosine })
|
|
121
134
|
return result
|
|
122
135
|
})
|
|
123
136
|
// global 变更(global scope 直写或 project 自动提升)单独落盘
|
|
@@ -115,10 +115,14 @@ export function queryMemoryTool(ctx, config) {
|
|
|
115
115
|
// 使用记账:检索命中也是"被用到"(活跃度/衰减用得上它,见 recordHit)。查询是热路径
|
|
116
116
|
// (p50 2.6ms),这里只改内存 + 标脏,**不**强制落盘——注入路径会立即落盘,这条路
|
|
117
117
|
// 靠下一次自然 save 带上。记账失败绝不影响查询结果。
|
|
118
|
-
|
|
118
|
+
// 经验层同源(kind:'experience' 的 insight),所以两桶都要记:`insightId` 是 insight
|
|
119
|
+
// 适配器带的键,经验桶给的是原始条目,用 `id` 兜底。
|
|
120
|
+
for (const layer of ['insight', 'experience']) {
|
|
121
|
+
if (layer === 'insight' && !wantInsight) continue
|
|
122
|
+
if (layer === 'experience' && !(type === 'all' || type === 'experience')) continue
|
|
119
123
|
try {
|
|
120
|
-
const bucket = recalled.layers.find((l) => l.layer ===
|
|
121
|
-
recordHit({ store, globalStore, ids: (bucket?.hits || []).map((h) => h.item?.insightId) })
|
|
124
|
+
const bucket = recalled.layers.find((l) => l.layer === layer)
|
|
125
|
+
recordHit({ store, globalStore, ids: (bucket?.hits || []).map((h) => h.item?.insightId || h.item?.id) })
|
|
122
126
|
} catch {
|
|
123
127
|
/* ignore:记账是旁路 */
|
|
124
128
|
}
|
|
@@ -170,7 +174,9 @@ export function queryMemoryTool(ctx, config) {
|
|
|
170
174
|
if (expBucket && expBucket.hits.length) {
|
|
171
175
|
lines.push(`## Experience (past problems -> solutions)`)
|
|
172
176
|
for (const { item: e, rel } of expBucket.hits) {
|
|
173
|
-
|
|
177
|
+
// 统一存储后经验条目就是 insight:导入时 source_file 落在 files[0],新写的也走同一处。
|
|
178
|
+
const src = e.sourceFile || (Array.isArray(e.files) ? e.files[0] : '')
|
|
179
|
+
const source = src ? ` (source: ${toAbs(root, src)})` : ''
|
|
174
180
|
lines.push(
|
|
175
181
|
`### Problem: ${e.problem} (score: ${Math.round(rel * 100)}, id: ${e.id})\n- solution: ${e.solution}${source}\n- updated: ${e.updatedAt}`,
|
|
176
182
|
)
|
package/src/tools/remember.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
2
2
|
import { assertIndexRoot, memoryRootFor, resolveSafeIndexRoot } from '../util/fs.js'
|
|
3
3
|
import { ProjectMemoryStore } from '../store.js'
|
|
4
|
+
import { cfgInsight, saveInsight, GlobalStore, defaultGlobalFile } from '../insight-store.js'
|
|
5
|
+
import { ensureGlobalInit } from '../global-seed.js'
|
|
6
|
+
import { vectorItemsFrom } from '../vector-index.js'
|
|
7
|
+
import { createWriteCosine } from '../auto-inject.js'
|
|
4
8
|
|
|
5
9
|
export function rememberTool(config) {
|
|
6
10
|
return defineTool({
|
|
7
11
|
name: 'remember',
|
|
8
12
|
description:
|
|
9
13
|
'Save an experience note (problem -> solution) into project memory, e.g. a bug you just fixed. ' +
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'(the tiered insight store) — query_memory searches both.',
|
|
14
|
+
'It lands as a `kind:experience` entry in the same store as lessons / decisions / procedures, so query_memory ' +
|
|
15
|
+
'finds it and the same dedup applies (near-identical writes merge, similar ones report the nearest id). ' +
|
|
16
|
+
'Prefer save_lesson for anything that is not a problem->solution note.',
|
|
14
17
|
parameters: {
|
|
15
18
|
problem: {
|
|
16
19
|
type: 'string',
|
|
@@ -41,16 +44,29 @@ export function rememberTool(config) {
|
|
|
41
44
|
assertIndexRoot(root, args.root || root)
|
|
42
45
|
const memoryDir = memoryRootFor(root, config.memoryDir)
|
|
43
46
|
const store = new ProjectMemoryStore(memoryDir).load()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const cfg = cfgInsight(config)
|
|
48
|
+
ensureGlobalInit(config) // 幂等:project 写入可能被自动提升到 global
|
|
49
|
+
const globalStore = new GlobalStore(cfg.globalFile || defaultGlobalFile()).load()
|
|
50
|
+
// 与 save_lesson 同一条写入路径 ⇒ 同一套去重/自动覆盖/近邻提示;没装 leanvec 时 `cosine` 为 null,
|
|
51
|
+
// 退回纯词法(与旧版经验层行为一致)。
|
|
52
|
+
const cosine = await createWriteCosine(config, { storeDir: memoryDir, items: vectorItemsFrom(store, globalStore) })
|
|
53
|
+
const raw = {
|
|
54
|
+
title: args.problem,
|
|
55
|
+
kind: 'experience',
|
|
56
|
+
problem: args.problem,
|
|
57
|
+
solution: args.solution,
|
|
58
|
+
files: args.source_file ? [args.source_file] : undefined,
|
|
59
|
+
confidence: 1,
|
|
60
|
+
}
|
|
61
|
+
let result
|
|
62
|
+
store.commit((s) => {
|
|
63
|
+
result = saveInsight({ store: s, globalStore, raw, scope: 'project', cfg, source: 'agent', cosine })
|
|
64
|
+
return result
|
|
53
65
|
})
|
|
66
|
+
globalStore.commit()
|
|
67
|
+
if (!result || !result.ok) return `Failed: ${result?.error || '写入未完成'}`
|
|
68
|
+
const verb = result.action === 'created' ? 'Saved' : 'Updated existing'
|
|
69
|
+
return `${verb} experience note (${result.id}).${result.hint ? ` ${result.hint}` : ''}`
|
|
54
70
|
},
|
|
55
71
|
})
|
|
56
|
-
}
|
|
72
|
+
}
|
package/src/tools/task-tools.js
CHANGED
|
@@ -118,6 +118,8 @@ export function selectTaskTool(config, host) {
|
|
|
118
118
|
task.updatedAt = now
|
|
119
119
|
task.lastActiveAt = now
|
|
120
120
|
if (sid) task.lastSessionId = sid
|
|
121
|
+
// 解归档 / 改名 / 戳活动时间都是直接改 task:不标脏则 save() 早退,tasks.json 不落盘。
|
|
122
|
+
store.markTasksDirty()
|
|
121
123
|
store.save()
|
|
122
124
|
|
|
123
125
|
// 反向接管:绑定成功后,把任务步骤推成宿主 todo/write(dsh 清单跟随我们的任务)
|
|
@@ -181,6 +183,7 @@ export function archiveTaskTool(config, host) {
|
|
|
181
183
|
if (task.archived) return truncate(JSON.stringify({ success: false, error: 'Already archived' }), config.maxOutputChars)
|
|
182
184
|
task.archived = true
|
|
183
185
|
task.updatedAt = new Date().toISOString()
|
|
186
|
+
store.markTasksDirty()
|
|
184
187
|
store.save()
|
|
185
188
|
// 反思钩子:归档即收割最终教训(默认关)
|
|
186
189
|
fireReflect(config, host, root, args.taskId, 'archive', resolveRoute(exec, config))
|
package/src/types.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {'lesson' | 'decision' | 'procedure' | 'experience'} InsightKind
|
|
6
6
|
* lesson: 曾踩坑/纠偏(pattern→fix);decision: 曾权衡的选型(topic→choice+reason);
|
|
7
|
-
* procedure: 多步操作指南(steps);experience:
|
|
7
|
+
* procedure: 多步操作指南(steps);experience: 问题→解法笔记(`remember` 写的就是它,
|
|
8
|
+
* v0.4 experience.json 在加载时导入成同一实体,不再有第二个存储)。
|
|
8
9
|
*
|
|
9
10
|
* @typedef {'task' | 'project' | 'global'} InsightScope
|
|
10
11
|
* task: tasks.json 内嵌于任务实体 task.insights[](私有草稿);
|
|
@@ -35,6 +36,8 @@
|
|
|
35
36
|
* @property {number} [confidence] 0..1
|
|
36
37
|
* @property {number} [hitCount] 被注入/命中的次数(强化信号,无 LLM)
|
|
37
38
|
* @property {string} [lastHitAt] 最近一次命中时间 ISO(衰减/归档依据)
|
|
39
|
+
* @property {object} [prev] 被自动覆盖/就地更新挤掉的**上一个**值(按字段名),只留一版:
|
|
40
|
+
* 误覆盖后用同一个 id 再写一次即可写回;不是历史(不做折叠、不压实)
|
|
38
41
|
* @property {boolean} [archived] 归档 = 软删:不进召回/注入,可恢复
|
|
39
42
|
* @property {string[]} [tags]
|
|
40
43
|
* @property {string} createdAt
|
|
@@ -45,6 +48,10 @@
|
|
|
45
48
|
* @typedef {object} InsightConfig
|
|
46
49
|
* @property {number} [dedupOverlap] 双向 token overlap 阈值(≥ 合并/取代)
|
|
47
50
|
* @property {number} [reinforceBand] 近重复强化带下界(0.65~dedupOverlap → 强化)
|
|
51
|
+
* @property {number} [autoMergeCos] 向量余弦自动覆盖带(默认 0.9,需 leanvec;无向量则不用)
|
|
52
|
+
* @property {number} [autoMergeMargin] 自动覆盖还要求第一名领先第二名这么多(默认 0.05)
|
|
53
|
+
* @property {number} [hintCos] 向量近邻提示带(默认 0.7,只在返回文本里提示 id,不改数据)
|
|
54
|
+
* @property {number} [maxForgetMatches] forget 关键词删除的命中上限(默认 10);超了一条都不删,只回报候选
|
|
48
55
|
* @property {number} [maxProject] project insights 容量(归档区另计)
|
|
49
56
|
* @property {number} [maxGlobalProcedures] global insights 容量
|
|
50
57
|
* @property {number} [promoteConfidence] 提升 project 所需最低 confidence
|
package/src/util/fs.js
CHANGED
|
@@ -6,6 +6,7 @@ import { readFile } from 'node:fs/promises'
|
|
|
6
6
|
import { createHash } from 'node:crypto'
|
|
7
7
|
import os from 'node:os'
|
|
8
8
|
import path from 'node:path'
|
|
9
|
+
import { sessionWorkingDir } from './session-dir.js'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* 原子写 JSON:先写同目录的 `<file>.<pid>.tmp`,再 rename 覆盖目标。
|
|
@@ -542,7 +543,8 @@ export function assertSafeRoot(root, { requested = root, allowUnsafe = false } =
|
|
|
542
543
|
|
|
543
544
|
export function resolveIndexRoot(exec, explicitRoot) {
|
|
544
545
|
if (explicitRoot && explicitRoot.trim()) return path.resolve(explicitRoot)
|
|
545
|
-
|
|
546
|
+
// 会话当前工作目录:0.2.1+ 读 workingDirectory 投影(cd 后会变),老宿主回退 header.cwd。
|
|
547
|
+
const sessionCwd = sessionWorkingDir(exec?.agent?.session, { agent: exec?.agent })
|
|
546
548
|
if (sessionCwd) return path.resolve(sessionCwd)
|
|
547
549
|
return path.resolve(process.cwd())
|
|
548
550
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 会话「当前工作目录」的唯一取值口。
|
|
3
|
+
*
|
|
4
|
+
* 为什么需要它:dsh 0.2.1 引入了 `@deepseek-ai/dsh-working-directory`,把**当前执行目录**
|
|
5
|
+
* 从 `Session.header.cwd` 里拆了出去——`header.cwd` 现在只表示「原始项目身份 / 权限根」,
|
|
6
|
+
* `working_directory({cd})` 改的是会话投影 `workingDirectory`,**不写回 header**。
|
|
7
|
+
* 本插件的全部根解析(索引 / 检索 / 懒索引 / 审计注入 / 任务桥 / watch)用的都是「人明确
|
|
8
|
+
* 选择的工作位置」这层语义(见 util/fs.js 的根推导注释),所以必须跟着这条新权威走,
|
|
9
|
+
* 否则用户 cd 到另一个项目后,记忆仍落在原项目的 store 上(不报错,只是静默错根)。
|
|
10
|
+
*
|
|
11
|
+
* 兼容策略:新服务用 `ctx.get()` **软探测**——它既不在插件的顶层 inject 里(那是装配期
|
|
12
|
+
* 门控,缺一项插件就整个不挂载),在老宿主(< 0.2.1)上也根本不存在;两者都回退到
|
|
13
|
+
* `header.cwd`,也就是该服务出现之前"当前工作目录"的存放位置。
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 读该会话的当前工作目录。
|
|
18
|
+
*
|
|
19
|
+
* 取值顺序(前者只在真的可用时才生效):
|
|
20
|
+
* 1. `workingDirectory.get(session)` —— 0.2.1+ 的权威。该投影的 `init` 就是
|
|
21
|
+
* `header => header.cwd ?? null`,所以**没 cd 过时它与 header.cwd 恒等**,
|
|
22
|
+
* 本函数对既有行为是 no-op;cd 过才返回改写后的目录。
|
|
23
|
+
* 2. `session.header.cwd` —— 服务缺失(老宿主)或会话不是宿主 Session 时的回退。
|
|
24
|
+
* 3. `agent.session.header.cwd` —— 会话对象与服务都拿不到时的最后回退。
|
|
25
|
+
*
|
|
26
|
+
* 全程不抛出:根解析在审计 / 注入等旁路里被调用,那里读不到目录只应降级,不应带崩调用方。
|
|
27
|
+
* @param {object|null} [session] - 宿主 Session(`workingDirectory.get` 需要它)。
|
|
28
|
+
* @param {{agent?: object, ctx?: object}} [opts] - `agent` 提供 `agent.ctx` 回退;`ctx` 直接指定宿主上下文(任务桥这类只有 ctx 的地方)。
|
|
29
|
+
* @returns {string|undefined} 绝对目录;都取不到时 undefined。
|
|
30
|
+
*/
|
|
31
|
+
export function sessionWorkingDir(session, opts = {}) {
|
|
32
|
+
const agent = opts.agent
|
|
33
|
+
const target = session || agent?.session || null
|
|
34
|
+
const host = opts.ctx || agent?.ctx || null
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
const svc = host && typeof host.get === 'function' ? host.get('workingDirectory') : null
|
|
38
|
+
if (svc && typeof svc.get === 'function' && target) {
|
|
39
|
+
const dir = svc.get(target)
|
|
40
|
+
if (typeof dir === 'string' && dir) return dir
|
|
41
|
+
}
|
|
42
|
+
} catch {
|
|
43
|
+
// 老宿主没有该服务;或 session 不是宿主认识的 Session——两种情况都走 header 回退。
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const cwd = target?.header?.cwd ?? agent?.session?.header?.cwd
|
|
47
|
+
return typeof cwd === 'string' && cwd ? cwd : undefined
|
|
48
|
+
}
|
package/src/vector-index.js
CHANGED
|
@@ -172,14 +172,15 @@ export function openVectorIndex({ dir = null, items = [], embed, model, dim = DI
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
|
-
* 从两个 store 收集**要建索引的条目**:洞察层(项目 +
|
|
175
|
+
* 从两个 store 收集**要建索引的条目**:洞察层(项目 + 全局)。
|
|
176
176
|
* 与提示通道/召回看到的池子同源;归档条目不进(它们不会被召回)。
|
|
177
|
+
* v0.4 的经验笔记也在里面——统一存储后它们是 `kind:'experience'` 的 insight,
|
|
178
|
+
* 加载时已从 experience.json 导入,不再有第二个池子。
|
|
177
179
|
*/
|
|
178
180
|
export function vectorItemsFrom(store, globalStore) {
|
|
179
181
|
const out = []
|
|
180
182
|
try { if (typeof store?.insightItems === 'function') out.push(...store.insightItems()) } catch { /* store 形状不保证 */ }
|
|
181
183
|
try { if (typeof globalStore?.items === 'function') out.push(...globalStore.items()) } catch { /* 同上 */ }
|
|
182
|
-
try { if (Array.isArray(store?.experience)) out.push(...store.experience) } catch { /* 同上 */ }
|
|
183
184
|
return out.filter((it) => it && !it.archived)
|
|
184
185
|
}
|
|
185
186
|
|