@restregular/dsh-memory 0.14.4 → 0.14.5
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 +6 -0
- package/README.md +1 -1
- package/lib/client.js +13 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的版本记录。安装 id 与 npm 版本一一对应。
|
|
4
4
|
|
|
5
|
+
## 0.14.5 — 修复记忆面板审计「在轨迹中定位」不生效
|
|
6
|
+
|
|
7
|
+
- **根因**:主面板把 `jumpAuditEntryToTrajectory`(签名是 `(entry) => Promise`)当成 `openTrajectory(focus)` 回调传给 `AuditTab`。按钮把 `callId` 字符串传进去,`jumpAuditEntryToTrajectory` 读不到 `entry.sessionId`,直接按 `no_session` 返回,实际什么都没发生;UI 还误报“已定位到轨迹”。
|
|
8
|
+
- **修复**:主面板不再传 `openTrajectory`,`AuditTab` 走模块内的 `jumpAuditEntryToTrajectory(selected)`:先 `openSession`,等 per-session store 可用后 `openView('trajectory', callId)`,Trajectory 会选中该记录并自动打开右侧详情面板。会话内「记忆」视图仍走 `openView` 回调,回调现在返回 `{opened, focused}`,提示文案按真实结果展示。
|
|
9
|
+
- 回归测试:主面板路径断言 `openSession('s1')` + `openView('trajectory','call-9')`。
|
|
10
|
+
|
|
5
11
|
## 0.14.4 — 轨迹行图标同时按 composer 上沿裁剪
|
|
6
12
|
|
|
7
13
|
- **根因**:0.14.3 只用 `_tablePane` 的底边做下界。Trajectory 的表格会一直延伸到浮动 composer 后面,`_tablePane` 的底边在 composer 下方;行滚到底部、被 composer 遮住时,fixed 图标仍在表格底边以内,所以继续显示。
|
package/README.md
CHANGED
|
@@ -377,7 +377,7 @@ DSH 自带的 Trajectory 面板是一个**纯投影**:它只声明 `conversati
|
|
|
377
377
|
|
|
378
378
|
- **轨迹 → 记忆审计**:Trajectory 的选中行带有 `data-trajectory-row-key`。注意它在 DOM 上经过 `encodeURIComponent`(工具行实际是 `tool%00call%00<callId>`),插件会先解码再取 callId。有审计的调用行左侧会显示产品年轮线条图标;选中行右侧另有「记忆 N」徽标,点击按 `op:<callId>` 打开审计。两者都会按轨迹滚动容器(扣除 sticky 表头与底部浮动 composer)裁剪,行滚出可视区后被遮住时不会残留。
|
|
379
379
|
- **轨迹详情页签**:点击轨迹里的任意记录后,右侧详情面板的页签行会多出一个「记忆审计」页签(用 `shell.overlay` 贴着详情面板,不改轨迹的 React 树)。它展示该记录 callId 对应的审计事件,底部按钮直接打开本会话的记忆审计面板;没有 callId 的记录明确提示无法精确过滤。
|
|
380
|
-
- **记忆审计 → 轨迹**:审计详情里的「在轨迹中定位」把条目上的 `operationId`(记忆工具调用、触发召回的工具调用)交给 Trajectory 的 `openView('trajectory', callId)
|
|
380
|
+
- **记忆审计 → 轨迹**:审计详情里的「在轨迹中定位」把条目上的 `operationId`(记忆工具调用、触发召回的工具调用)交给 Trajectory 的 `openView('trajectory', callId)`;主面板会先打开会话,再切换轨迹并选中该记录,右侧详情面板自动打开。没有 `operationId` 的按轮/步事件先请求 `/anchor`,由 Host 从会话事件窗口里找该 turn/step 的第一个 `tool/call`;找不到就只切到轨迹页,不伪造定位。
|
|
381
381
|
- **会话内的「记忆」视图**:与 Chat / 轨迹同一个 view ring,按当前会话展示审计;它直接使用宿主传给每个 view 的 `openView`,因此跳转是官方支持路径。它声明 `data-conversation-composer-overlay` 让壳层压住外层滚动,审计列表在自己的滚动容器里滚动,外层界面不需要跟着滚。主面板不在 view ring 内,通过 `conversation.session` 注册的 per-session store 调同一个 action;拿不到时退化为打开会话/轨迹页。
|
|
382
382
|
- 记忆工具调用(`memory_save/search/list/get/forget`)本身会额外留一条 `stage: tool_call` 的审计锚点:即使自动召回关闭,也能从这条记录精确跳回轨迹里的那次调用。
|
|
383
383
|
|
package/lib/client.js
CHANGED
|
@@ -2914,8 +2914,11 @@ window.__ModuleLoader__.load({
|
|
|
2914
2914
|
try {
|
|
2915
2915
|
const focus = await resolveAuditFocus(selected)
|
|
2916
2916
|
if (typeof openTrajectory === 'function') {
|
|
2917
|
-
openTrajectory(focus)
|
|
2918
|
-
|
|
2917
|
+
const result = await openTrajectory(focus, selected)
|
|
2918
|
+
if (result && result.focused === true) setFocusNotice('已定位到轨迹')
|
|
2919
|
+
else if (result && result.opened === true) setFocusNotice('已切到轨迹页(未找到精确锚点)')
|
|
2920
|
+
else if (result === undefined) setFocusNotice(focus === undefined ? '已切到轨迹页(这条没有精确锚点)' : '已定位到轨迹')
|
|
2921
|
+
else setFocusNotice('定位失败')
|
|
2919
2922
|
return
|
|
2920
2923
|
}
|
|
2921
2924
|
const result = await jumpAuditEntryToTrajectory(selected)
|
|
@@ -3137,7 +3140,7 @@ window.__ModuleLoader__.load({
|
|
|
3137
3140
|
/** 待嵌入自动刷新:最多 300 次 × 1.5s(后端挂着时不无限轮询)。 */
|
|
3138
3141
|
const PENDING_POLL_LIMIT = 300
|
|
3139
3142
|
|
|
3140
|
-
function MemoryPanel({ openSession, sessionInfo,
|
|
3143
|
+
function MemoryPanel({ openSession, sessionInfo, audience = 'panel', lockSession } = {}) {
|
|
3141
3144
|
const [records, setRecords] = React.useState([])
|
|
3142
3145
|
const [scopes, setScopes] = React.useState([])
|
|
3143
3146
|
const [embedServer, setEmbedServer] = React.useState(null)
|
|
@@ -3625,7 +3628,6 @@ window.__ModuleLoader__.load({
|
|
|
3625
3628
|
sessionInfo,
|
|
3626
3629
|
audience,
|
|
3627
3630
|
lockSession,
|
|
3628
|
-
openTrajectory,
|
|
3629
3631
|
})
|
|
3630
3632
|
: overviewBody,
|
|
3631
3633
|
)
|
|
@@ -3641,8 +3643,12 @@ window.__ModuleLoader__.load({
|
|
|
3641
3643
|
function MemoryAuditView({ sessionId, openView, sessionInfo }) {
|
|
3642
3644
|
const openTrajectory = (focus) => {
|
|
3643
3645
|
try {
|
|
3644
|
-
if (typeof openView === 'function')
|
|
3646
|
+
if (typeof openView === 'function') {
|
|
3647
|
+
openView('trajectory', focus)
|
|
3648
|
+
return { opened: true, focused: focus !== undefined }
|
|
3649
|
+
}
|
|
3645
3650
|
} catch { /* 视图不可用时保持在本页 */ }
|
|
3651
|
+
return { opened: false, focused: false }
|
|
3646
3652
|
}
|
|
3647
3653
|
return h('div', {
|
|
3648
3654
|
className: 'memp mem-view',
|
|
@@ -4148,10 +4154,10 @@ window.__ModuleLoader__.load({
|
|
|
4148
4154
|
const inject = ['slots']
|
|
4149
4155
|
|
|
4150
4156
|
/** 侧栏入口打开的主界面页面(整块可滚动,内容就是面板本体)。 */
|
|
4151
|
-
function MemoryPage({ openSession, sessionInfo
|
|
4157
|
+
function MemoryPage({ openSession, sessionInfo } = {}) {
|
|
4152
4158
|
return h('div', { className: 'mem-page' },
|
|
4153
4159
|
h('div', { className: 'mem-page-head' }, h('h2', null, '记忆系统')),
|
|
4154
|
-
h(MemoryPanel, { openSession, sessionInfo,
|
|
4160
|
+
h(MemoryPanel, { openSession, sessionInfo, audience: 'panel' }),
|
|
4155
4161
|
)
|
|
4156
4162
|
}
|
|
4157
4163
|
|
|
@@ -4232,7 +4238,6 @@ window.__ModuleLoader__.load({
|
|
|
4232
4238
|
openSession,
|
|
4233
4239
|
sessionInfo,
|
|
4234
4240
|
audience: 'panel',
|
|
4235
|
-
openTrajectory: jumpAuditEntryToTrajectory,
|
|
4236
4241
|
}),
|
|
4237
4242
|
))
|
|
4238
4243
|
|
|
@@ -4255,7 +4260,6 @@ window.__ModuleLoader__.load({
|
|
|
4255
4260
|
slots.inject('main', () => slots.register({ name: 'main', key: 'memory' }, () => React.createElement(MemoryPage, {
|
|
4256
4261
|
openSession,
|
|
4257
4262
|
sessionInfo,
|
|
4258
|
-
openTrajectory: jumpAuditEntryToTrajectory,
|
|
4259
4263
|
}))),
|
|
4260
4264
|
slots.inject('sidebar.panellist', () => slots.register(
|
|
4261
4265
|
{ name: 'sidebar.panellist', id: 'memory', order: 20, label: () => NAV_LABEL },
|