@restregular/dsh-memory 0.27.0 → 0.29.0
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 +747 -728
- package/README.md +655 -643
- package/lib/client.js +212 -4
- package/lib/inject/apply.js +1 -1
- package/lib/inject/policy.js +3 -1
- package/lib/panel.js +1344 -1245
- package/lib/provider/apply.js +6 -1
- package/lib/provider/index.js +33 -4
- package/lib/tools/index.js +159 -33
- package/lib/tools/render.js +43 -17
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -184,6 +184,26 @@ window.__ModuleLoader__.load({
|
|
|
184
184
|
'.memp .tab{background:none;border:0;border-radius:7px;padding:4px 14px;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:13px;line-height:1.6;transition:background .12s ease,color .12s ease}',
|
|
185
185
|
'.memp .tab:hover{color:var(--dsw-alias-label-primary)}',
|
|
186
186
|
'.memp .tab.on{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-brand-primary);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.10)}',
|
|
187
|
+
// 标签页里的二级切换(记录 → 记忆 / 作用域):比主标签栏小一档,跟在主标签栏下面
|
|
188
|
+
'.memp .subtabs{display:inline-flex;gap:2px;padding:2px;border-radius:8px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1)}',
|
|
189
|
+
'.memp .subtab{background:none;border:0;border-radius:6px;padding:2px 12px;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:12px;line-height:1.7;transition:background .12s ease,color .12s ease}',
|
|
190
|
+
'.memp .subtab:hover{color:var(--dsw-alias-label-primary)}',
|
|
191
|
+
'.memp .subtab.on{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-brand-primary);font-weight:600}',
|
|
192
|
+
// 作用域清单:一行一个作用域(名称 + 条数 + 用途 + 真实键)
|
|
193
|
+
'.memp .scope-row{display:flex;flex-direction:column;gap:5px;padding:9px 12px;border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1)}',
|
|
194
|
+
'.memp .scope-row:hover{border-color:var(--dsw-alias-brand-primary)}',
|
|
195
|
+
'.memp .scope-row-head{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:11.5px;color:var(--dsw-alias-label-secondary);min-width:0}',
|
|
196
|
+
'.memp .scope-row-name{font-size:12.5px;font-weight:600;color:var(--dsw-alias-label-primary);max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
197
|
+
'.memp .scope-row-desc{font-size:11.5px;line-height:1.55;color:var(--dsw-alias-label-secondary)}',
|
|
198
|
+
'.memp .scope-row-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:10.5px;color:var(--dsw-alias-label-secondary)}',
|
|
199
|
+
'.memp .scope-row-key{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
200
|
+
// 作用域编辑(0.29.0):用途 textarea + 可选别名输入,动作行只有保存 / 取消
|
|
201
|
+
'.memp .scope-edit{display:flex;flex-direction:column;gap:5px;padding:2px 0 4px}',
|
|
202
|
+
'.memp .scope-edit label{font-size:10.5px;color:var(--dsw-alias-label-secondary)}',
|
|
203
|
+
'.memp .scope-edit textarea{width:100%;min-height:46px;resize:vertical;font-size:12px;line-height:1.5}',
|
|
204
|
+
'.memp .scope-edit input[type=text]{width:100%;font-size:12px}',
|
|
205
|
+
'.memp .scope-edit-actions{display:flex;gap:6px;padding-top:2px}',
|
|
206
|
+
'.memp .scope-edit-actions button{padding:3px 12px;font-size:11.5px}',
|
|
187
207
|
// 记录视图:各区块之间留出呼吸感(之前全贴在一起)
|
|
188
208
|
'.memp .memp-body > * + *{margin-top:14px}',
|
|
189
209
|
'.memp .stats{margin-bottom:0}',
|
|
@@ -3535,6 +3555,18 @@ window.__ModuleLoader__.load({
|
|
|
3535
3555
|
const [loading, setLoading] = React.useState(true)
|
|
3536
3556
|
const [error, setError] = React.useState('')
|
|
3537
3557
|
const [tab, setTab] = React.useState('data')
|
|
3558
|
+
// 「记录」页里的二级标签页(0.28.0):记忆(列表) / 作用域(名称 + 用途 + 条数)。
|
|
3559
|
+
// 两个视图共用 /status 的那次拉取,切换不重新请求。
|
|
3560
|
+
const [dataView, setDataView] = React.useState('memories')
|
|
3561
|
+
const [scopeQuery, setScopeQuery] = React.useState('')
|
|
3562
|
+
// 作用域编辑(0.29.0):同一时间只编辑一行 —— 描述 / 别名都是全局共享的元数据,
|
|
3563
|
+
// 同时开多个编辑框只会让人不确定保存的是哪一条。
|
|
3564
|
+
const [editingScope, setEditingScope] = React.useState('')
|
|
3565
|
+
const [scopeDraftDescription, setScopeDraftDescription] = React.useState('')
|
|
3566
|
+
const [scopeDraftName, setScopeDraftName] = React.useState('')
|
|
3567
|
+
const [scopeBusy, setScopeBusy] = React.useState(false)
|
|
3568
|
+
const [scopeError, setScopeError] = React.useState('')
|
|
3569
|
+
const [scopeSaved, setScopeSaved] = React.useState('')
|
|
3538
3570
|
const [pendingTick, setPendingTick] = React.useState(0)
|
|
3539
3571
|
const [creating, setCreating] = React.useState(false)
|
|
3540
3572
|
|
|
@@ -3595,6 +3627,8 @@ window.__ModuleLoader__.load({
|
|
|
3595
3627
|
// 列表里没有时补一张卡,保证跳过去一定能展开。
|
|
3596
3628
|
setFocusRecordData(record && record.id ? record : null)
|
|
3597
3629
|
setTab('data')
|
|
3630
|
+
// 「记录」页现在是 记忆 / 作用域 两个子标签页:跳转必须落在记忆列表上。
|
|
3631
|
+
setDataView('memories')
|
|
3598
3632
|
setQ('')
|
|
3599
3633
|
// 语义模式是按查询排名的:跳转要看到那条记录,必须回到普通列表。
|
|
3600
3634
|
setSemantic(false)
|
|
@@ -3603,6 +3637,52 @@ window.__ModuleLoader__.load({
|
|
|
3603
3637
|
setScopeFilter(nextScope)
|
|
3604
3638
|
load('', nextScope, false)
|
|
3605
3639
|
}
|
|
3640
|
+
/** 作用域行的「查看记忆」:切回记忆子标签页并只看这个作用域。 */
|
|
3641
|
+
const openScopeRecords = (scope) => {
|
|
3642
|
+
setDataView('memories')
|
|
3643
|
+
setScopeFilter(scope)
|
|
3644
|
+
setQ('')
|
|
3645
|
+
setSupersededFilter('hide')
|
|
3646
|
+
setSemantic(false)
|
|
3647
|
+
setSearchInfo(null)
|
|
3648
|
+
load('', scope, false)
|
|
3649
|
+
}
|
|
3650
|
+
/**
|
|
3651
|
+
* 编辑作用域的描述 / 别名(0.29.0)。
|
|
3652
|
+
*
|
|
3653
|
+
* 用途只预填**自己写的**那句:`descriptionSource==='default'` 是按类型补的默认
|
|
3654
|
+
* 描述,预填进去再保存等于把默认文案固化成手写内容。
|
|
3655
|
+
* 别名字段对 global / session 不显示 —— provider 也不接受(显示名跟随类型/会话 id)。
|
|
3656
|
+
*/
|
|
3657
|
+
const beginScopeEdit = (row) => {
|
|
3658
|
+
setEditingScope(row.scope)
|
|
3659
|
+
setScopeDraftDescription(row.descriptionSource === 'custom' ? row.description : '')
|
|
3660
|
+
setScopeDraftName(row.name === undefined ? '' : row.name)
|
|
3661
|
+
setScopeError('')
|
|
3662
|
+
setScopeSaved('')
|
|
3663
|
+
}
|
|
3664
|
+
const cancelScopeEdit = () => {
|
|
3665
|
+
setEditingScope('')
|
|
3666
|
+
setScopeError('')
|
|
3667
|
+
}
|
|
3668
|
+
const saveScopeEdit = async (row) => {
|
|
3669
|
+
setScopeBusy(true); setScopeError(''); setScopeSaved('')
|
|
3670
|
+
try {
|
|
3671
|
+
await api('scope-meta', {
|
|
3672
|
+
scope: row.scope,
|
|
3673
|
+
description: scopeDraftDescription.trim(),
|
|
3674
|
+
...(row.canAlias ? { name: scopeDraftName.trim() } : {}),
|
|
3675
|
+
})
|
|
3676
|
+
setEditingScope('')
|
|
3677
|
+
setScopeSaved(row.scope)
|
|
3678
|
+
// 重新拉 /status:用途、别名与展示名都由服务端算(别名影响 label 与下拉)。
|
|
3679
|
+
await load()
|
|
3680
|
+
} catch (e) {
|
|
3681
|
+
setScopeError(String(e.message || e))
|
|
3682
|
+
} finally {
|
|
3683
|
+
setScopeBusy(false)
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3606
3686
|
// 审批浮层 / 其它入口点击记忆 ID:挂载时消费一次 pending,之后靠同一事件。
|
|
3607
3687
|
React.useEffect(() => {
|
|
3608
3688
|
const applyFocus = () => {
|
|
@@ -3999,14 +4079,142 @@ window.__ModuleLoader__.load({
|
|
|
3999
4079
|
h('a', { href: 'https://github.com/RestRegular/dsh-memory/issues/new', target: '_blank', rel: 'noreferrer' }, '💬 反馈建议 / 提 issue'),
|
|
4000
4080
|
)
|
|
4001
4081
|
const overviewBody = h('div', { className: 'memp-body' }, serverCard, maintenanceCard, footer)
|
|
4082
|
+
|
|
4083
|
+
// ---- 「记录」页的二级标签页:记忆 / 作用域(0.28.0) ----
|
|
4084
|
+
// 作用域子标签页回答的是「有哪些域、各自干什么、多少条」——用途与
|
|
4085
|
+
// memory_scopes 目录、memory_search 的范围外清单同源(服务端 /status 已合并)。
|
|
4086
|
+
const scopeRows = (() => {
|
|
4087
|
+
const needle = scopeQuery.trim().toLowerCase()
|
|
4088
|
+
return scopes
|
|
4089
|
+
.map((s) => ({
|
|
4090
|
+
scope: s.scope,
|
|
4091
|
+
label: scopeLabel(s.scope, labels),
|
|
4092
|
+
description: typeof s.description === 'string' ? s.description.trim() : '',
|
|
4093
|
+
descriptionSource: s.descriptionSource === 'custom' ? 'custom' : (s.descriptionSource === 'default' ? 'default' : 'none'),
|
|
4094
|
+
name: typeof s.name === 'string' && s.name !== '' ? s.name : undefined,
|
|
4095
|
+
// global / session 的显示名跟随类型与会话 id,provider 也不接受别名。
|
|
4096
|
+
canAlias: !(String(s.scope) === 'global' || String(s.scope).startsWith('session:')),
|
|
4097
|
+
records: Number(s.records) || 0,
|
|
4098
|
+
pendingEmbeds: Number(s.pendingEmbeds) || 0,
|
|
4099
|
+
updatedAt: Number(s.updatedAt) || 0,
|
|
4100
|
+
}))
|
|
4101
|
+
.filter((row) => needle === ''
|
|
4102
|
+
|| row.label.toLowerCase().includes(needle)
|
|
4103
|
+
|| row.scope.toLowerCase().includes(needle)
|
|
4104
|
+
|| row.description.toLowerCase().includes(needle)
|
|
4105
|
+
|| (row.name !== undefined && row.name.toLowerCase().includes(needle)))
|
|
4106
|
+
.sort((a, b) => b.records - a.records || b.updatedAt - a.updatedAt || a.label.localeCompare(b.label))
|
|
4107
|
+
})()
|
|
4108
|
+
const viewSwitch = h('div', { className: 'row' },
|
|
4109
|
+
h('div', { className: 'subtabs' },
|
|
4110
|
+
h('button', {
|
|
4111
|
+
className: 'subtab' + (dataView === 'memories' ? ' on' : ''),
|
|
4112
|
+
onClick: () => setDataView('memories'),
|
|
4113
|
+
}, '记忆'),
|
|
4114
|
+
h('button', {
|
|
4115
|
+
className: 'subtab' + (dataView === 'scopes' ? ' on' : ''),
|
|
4116
|
+
onClick: () => setDataView('scopes'),
|
|
4117
|
+
}, '作用域'),
|
|
4118
|
+
),
|
|
4119
|
+
)
|
|
4120
|
+
const scopeToolbar = h('div', { className: 'row toolbar' },
|
|
4121
|
+
h('input', {
|
|
4122
|
+
type: 'text',
|
|
4123
|
+
placeholder: '搜索作用域名称 / 用途 / 键',
|
|
4124
|
+
value: scopeQuery,
|
|
4125
|
+
onChange: (e) => setScopeQuery(e.target.value),
|
|
4126
|
+
}),
|
|
4127
|
+
h('button', { onClick: () => load(), disabled: loading }, loading ? '刷新中…' : '刷新'),
|
|
4128
|
+
scopeQuery.trim() !== '' ? h('button', { className: 'linkbtn', onClick: () => setScopeQuery('') }, '清空筛选') : null,
|
|
4129
|
+
)
|
|
4130
|
+
const scopeListBody = !loading && !error && scopeRows.length === 0
|
|
4131
|
+
? h('div', { className: 'empty' }, scopeQuery.trim() !== '' ? '没有匹配的作用域' : '还没有作用域')
|
|
4132
|
+
: h('div', { className: 'list' },
|
|
4133
|
+
scopeRows.map((row) => {
|
|
4134
|
+
const editing = editingScope === row.scope
|
|
4135
|
+
return h('div', { className: 'scope-row', key: row.scope },
|
|
4136
|
+
h('div', { className: 'scope-row-head' },
|
|
4137
|
+
h('span', { className: 'scope-row-name', title: scopeTitle(row.scope, row.label) }, row.label),
|
|
4138
|
+
h('span', { className: 'badge' }, `${row.records} 条记忆`),
|
|
4139
|
+
row.pendingEmbeds > 0
|
|
4140
|
+
? h('span', { className: 'pending', title: '待嵌入向量:向量服务就绪后会自动补上' }, `待嵌入 ${row.pendingEmbeds}`)
|
|
4141
|
+
: null,
|
|
4142
|
+
scopeSaved === row.scope ? h('span', { className: 'meta-done' }, '已保存') : null,
|
|
4143
|
+
h('span', {
|
|
4144
|
+
className: 'time',
|
|
4145
|
+
title: row.updatedAt > 0 ? `最近更新 ${fmtTime(row.updatedAt)}` : '还没有记录',
|
|
4146
|
+
}, row.updatedAt > 0 ? fmtTime(row.updatedAt) : '—'),
|
|
4147
|
+
),
|
|
4148
|
+
editing
|
|
4149
|
+
? h('div', { className: 'scope-edit' },
|
|
4150
|
+
h('label', null, '用途'),
|
|
4151
|
+
h('textarea', {
|
|
4152
|
+
rows: 2,
|
|
4153
|
+
value: scopeDraftDescription,
|
|
4154
|
+
placeholder: '一句话说明这个作用域放什么;留空保存 = 清空,回退到按类型的默认描述',
|
|
4155
|
+
onChange: (e) => setScopeDraftDescription(e.target.value),
|
|
4156
|
+
}),
|
|
4157
|
+
row.canAlias
|
|
4158
|
+
? h('label', null, '别名(可选)')
|
|
4159
|
+
: h('div', { className: 'hint' }, 'global / session 作用域不支持别名:显示名跟随类型与会话 id。'),
|
|
4160
|
+
row.canAlias
|
|
4161
|
+
? h('input', {
|
|
4162
|
+
type: 'text',
|
|
4163
|
+
value: scopeDraftName,
|
|
4164
|
+
placeholder: '只影响显示与引用;留空保存 = 移除别名。不改作用域键本身。',
|
|
4165
|
+
onChange: (e) => setScopeDraftName(e.target.value),
|
|
4166
|
+
})
|
|
4167
|
+
: null,
|
|
4168
|
+
scopeError !== '' ? h('div', { className: 'err' }, scopeError) : null,
|
|
4169
|
+
h('div', { className: 'scope-edit-actions' },
|
|
4170
|
+
h('button', { disabled: scopeBusy, onClick: () => saveScopeEdit(row) }, scopeBusy ? '保存中…' : '保存'),
|
|
4171
|
+
h('button', { disabled: scopeBusy, onClick: cancelScopeEdit }, '取消'),
|
|
4172
|
+
),
|
|
4173
|
+
)
|
|
4174
|
+
: h('div', { className: 'scope-row-desc' },
|
|
4175
|
+
row.description === '' ? '(未填写用途)' : row.description,
|
|
4176
|
+
row.descriptionSource === 'default' ? h('span', { className: 'muted' }, ' · 默认描述') : null,
|
|
4177
|
+
),
|
|
4178
|
+
editing
|
|
4179
|
+
? null
|
|
4180
|
+
: h('div', { className: 'scope-row-foot' },
|
|
4181
|
+
h('span', { className: 'scope-row-key', title: '作用域键:工具参数直接用它(自定义作用域传裸名)' }, row.scope),
|
|
4182
|
+
h('span', { style: { flex: 1 } }),
|
|
4183
|
+
row.records > 0
|
|
4184
|
+
? h('button', {
|
|
4185
|
+
className: 'linkbtn',
|
|
4186
|
+
title: '切到「记忆」并只看这个作用域',
|
|
4187
|
+
onClick: () => openScopeRecords(row.scope),
|
|
4188
|
+
}, '查看记忆')
|
|
4189
|
+
: null,
|
|
4190
|
+
h('button', {
|
|
4191
|
+
className: 'linkbtn',
|
|
4192
|
+
title: '编辑这个作用域的用途与别名(别名可选)',
|
|
4193
|
+
onClick: () => beginScopeEdit(row),
|
|
4194
|
+
}, '编辑'),
|
|
4195
|
+
),
|
|
4196
|
+
)
|
|
4197
|
+
}),
|
|
4198
|
+
)
|
|
4199
|
+
// 旧 provider 没有 scope-meta 用途:说明一句,而不是让人以为作用域都没有用途。
|
|
4200
|
+
const scopeDescriptionMissing = scopes.length > 0
|
|
4201
|
+
&& scopes.every((s) => !(typeof s.description === 'string' && s.description.trim() !== ''))
|
|
4202
|
+
|
|
4002
4203
|
// 记录页:统计 + 工具栏 + 新建表单固定在上面,只有列表在滚动容器里 —— 记忆多了也不把面板撑长。
|
|
4003
4204
|
const dataBody = h('div', { className: 'memp-body' },
|
|
4205
|
+
viewSwitch,
|
|
4004
4206
|
statsCard,
|
|
4005
|
-
toolbar,
|
|
4006
|
-
searchNoteNode,
|
|
4007
|
-
|
|
4207
|
+
dataView === 'scopes' ? scopeToolbar : toolbar,
|
|
4208
|
+
dataView === 'scopes' ? null : searchNoteNode,
|
|
4209
|
+
dataView === 'scopes'
|
|
4210
|
+
? (scopeDescriptionMissing
|
|
4211
|
+
? h('div', { className: 'hint' }, '当前 provider 没有返回作用域用途(升级 @restregular/dsh-memory 后即可显示)。')
|
|
4212
|
+
: null)
|
|
4213
|
+
: createForm,
|
|
4008
4214
|
error ? h('div', { className: 'err' }, error) : null,
|
|
4009
|
-
h('div', {
|
|
4215
|
+
h('div', {
|
|
4216
|
+
className: 'scroll' + ((dataView === 'scopes' ? scopeRows.length > 0 : records.length > 0) || loading ? '' : ' is-empty'),
|
|
4217
|
+
}, dataView === 'scopes' ? scopeListBody : listBody),
|
|
4010
4218
|
)
|
|
4011
4219
|
// 记忆树是自己的过滤维度(客户端即时筛选),进来时先拉一份不带服务端筛选的全量记录,
|
|
4012
4220
|
// 否则从「记录」页带着搜索词切过来会只剩一部分树。
|
package/lib/inject/apply.js
CHANGED
|
@@ -131,7 +131,7 @@ const NUDGE_TEXT =
|
|
|
131
131
|
|
|
132
132
|
const VISIBILITY_LEVEL_TEXT = {
|
|
133
133
|
absolute: '绝对限制:可见域外的记忆一律查不到,即使工具内部命中也不会返回;范围外也写不进去。',
|
|
134
|
-
normal: '
|
|
134
|
+
normal: '普通限制:可见域外的记忆命中时默认只返回作用域清单(outOfScope 字段:名字 / 条数 / 用途,不含记忆内容),不自动弹审批;Agent 确认这些作用域确实相关后带 requestApproval=true 才向用户发起一次审批。写入 / 删除范围外同样需要审批。',
|
|
135
135
|
none: '无限制:可以读写所有作用域(当前选择仅作为下次切换的偏好保留)。',
|
|
136
136
|
}
|
|
137
137
|
|
package/lib/inject/policy.js
CHANGED
|
@@ -8,7 +8,7 @@ export const POLICY_TEXT = `## 记忆系统
|
|
|
8
8
|
|
|
9
9
|
memory_search 只返回印象(ID、作用域、类型、标签和少量摘要);判断相关后再用 memory_get(ids, fields) 取正文。fields 省略 = content + scope + kind + tags;只要摘要用 ["summary"],只要正文用 ["content"],需要重要度 / 时间 / 触发词等再显式加上对应字段。
|
|
10
10
|
|
|
11
|
-
搜索命中作用域外记忆时默认**不弹审批**:结果里的 outOfScope
|
|
11
|
+
搜索命中作用域外记忆时默认**不弹审批**:结果里的 outOfScope 字段只列出命中的作用域——各几条、以及这些作用域的**用途描述**,不含任何记忆内容(也就没有摘要可引用)。确认某个作用域的用途确实与本次任务相关时,再用 memory_search 带 requestApproval=true 重新发起同一次搜索(这时才弹审批),或用 memory_scopes(action="request") 申请该作用域的本会话权限。
|
|
12
12
|
|
|
13
13
|
需要知道有哪些作用域、各自用来做什么、当前能不能读/写时,用 memory_scopes(action="list")。它只返回目录元信息(名字 / 用途 / 访问状态)与初始化记录正文,不返回普通记忆正文;范围外作用域在绝对限制下仍可发现,但正文(含初始化记录)永不可读、不可申请。
|
|
14
14
|
|
|
@@ -18,6 +18,8 @@ memory_search 只返回印象(ID、作用域、类型、标签和少量摘要
|
|
|
18
18
|
|
|
19
19
|
新建自定义作用域时,memory_save 必须带 scopeDescription(一句话用途);可选带 scopeRule 写一条初始规则。已有作用域带上 scopeDescription 表示更新用途,不会写初始记忆。
|
|
20
20
|
|
|
21
|
+
作用域的**用途**和**别名**可以改(用户也能在面板「记录 → 作用域」里改):memory_scopes({ action: "edit", scope, scopeDescription?, scopeName? }) —— scopeDescription 是那句用途(空串 = 清空,回退到按类型的默认描述),scopeName 是别名(空串 = 移除;只影响显示与引用,不改作用域键;项目 / 自定义作用域支持,global / session 不支持)。两者至少给一个,且需要该作用域可写(范围外先用 action="request" 申请写权限)。把用途写清楚,后续检索的「范围外清单」会直接告诉接手的人这个域是干什么的。
|
|
22
|
+
|
|
21
23
|
同一会话里已经出现过的记忆,memory_search / memory_list 只回 ID 并注明“摘要因上下文去重被省略”;那不是没找到,需要正文时直接用 memory_get 取。
|
|
22
24
|
|
|
23
25
|
本会话「记忆范围」为普通限制时(默认),调用任一 memory_* 工具都必须带 description 字段:用一句话说明这次调用要做什么(例如「查发布流程的坑」)。它只用于范围外访问的审批弹窗,不写进记忆;漏了会被工具直接拒绝。绝对限制 / 无限制下可省略。
|