dsh-memu-memory 1.4.1 → 1.4.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/AGENTS.md +2 -0
- package/CHANGELOG.md +20 -0
- package/docs/client-conventions.md +3 -0
- package/docs/mcp-porting.md +146 -0
- package/docs/troubleshooting.md +14 -0
- package/lib/client.js +223 -120
- package/lib/engine.js +68 -0
- package/lib/memory.js +51 -21
- package/lib/port-surface.js +82 -0
- package/lib/rpc.js +19 -5
- package/lib/tools.js +25 -0
- package/package.json +2 -1
- package/tests/browser.test.mjs +21 -0
- package/tests/client-export.test.mjs +1 -0
- package/tests/client-render.test.mjs +1 -0
- package/tests/engine.test.mjs +60 -0
- package/tests/help-page.test.mjs +1 -0
- package/tests/new-session-gate.test.mjs +1 -0
- package/tests/port-surface.test.mjs +138 -0
- package/tests/react-snapshot.test.mjs +1 -0
- package/tests/settings-beat.test.mjs +1 -0
- package/tests/sidebar-beat.test.mjs +1 -0
- package/tests/webui.test.mjs +8 -1
|
@@ -25,6 +25,7 @@ const React = {
|
|
|
25
25
|
if (hooks[index] === undefined) hooks[index] = typeof initial === "function" ? initial() : initial
|
|
26
26
|
return [hooks[index], (next) => { hooks[index] = typeof next === "function" ? next(hooks[index]) : next }]
|
|
27
27
|
},
|
|
28
|
+
memo: (component) => component,
|
|
28
29
|
useCallback: (fn) => fn,
|
|
29
30
|
useMemo: (fn) => fn(),
|
|
30
31
|
useEffect(fn, deps) { effects.push({ fn, deps }) },
|
|
@@ -25,6 +25,7 @@ const React = {
|
|
|
25
25
|
if (hooks[index] === undefined) hooks[index] = typeof initial === "function" ? initial() : initial
|
|
26
26
|
return [hooks[index], (next) => { hooks[index] = typeof next === "function" ? next(hooks[index]) : next }]
|
|
27
27
|
},
|
|
28
|
+
memo: (component) => component,
|
|
28
29
|
useCallback: (fn) => fn,
|
|
29
30
|
useMemo: (fn) => fn(),
|
|
30
31
|
useEffect(fn, deps) { effects.push({ fn, deps }) },
|
package/tests/webui.test.mjs
CHANGED
|
@@ -200,6 +200,12 @@ test('single-library browseWall still carries global rows and F1/F2 metadata', a
|
|
|
200
200
|
|
|
201
201
|
const wall = await dispatch({}, 'browseWall', { libraryId: library.id })
|
|
202
202
|
assert.ok(wall.items.some((item) => item.id === 'mem-private-merge'), 'the authorized private row is present')
|
|
203
|
+
// 记忆墙按 offset 逐批读完整库:分页不得改变 total,也不得重排(新到旧)。
|
|
204
|
+
const wallPage = await dispatch({}, 'browseWall', { libraryId: library.id, limit: 1, offset: 1 })
|
|
205
|
+
assert.equal(wallPage.offset, 1)
|
|
206
|
+
assert.equal(wallPage.total, wall.total, 'paging must not change the total')
|
|
207
|
+
assert.equal(wallPage.items.length, 1)
|
|
208
|
+
assert.equal(wallPage.items[0].id, wall.items[1].id, 'offset continues the same sorted list')
|
|
203
209
|
const globalRow = wall.items.find((item) => item.id === 'gmem-linked')
|
|
204
210
|
assert.ok(globalRow, 'a single-library wall must keep the shared global scope')
|
|
205
211
|
assert.equal(globalRow.libraryId, null)
|
|
@@ -214,7 +220,8 @@ test('single-library browseWall still carries global rows and F1/F2 metadata', a
|
|
|
214
220
|
|
|
215
221
|
const source = fs.readFileSync(new URL('../lib/client.js', import.meta.url), 'utf8')
|
|
216
222
|
assert.match(source, /wallAllBlocked/, 'the single-library fallback explains itself')
|
|
217
|
-
assert.match(source, /
|
|
223
|
+
assert.match(source, /const stream = async \(targetLibraryId\)/, 'the wall reads the library in batches')
|
|
224
|
+
assert.match(source, /await stream\(firstLibraryId\)/, 'the wall retries the first library after an all-libraries 403')
|
|
218
225
|
assert.match(source, /setMultiBlocked\(true\)/, 'the fallback disables the all-libraries option')
|
|
219
226
|
})
|
|
220
227
|
test('the settings button preserves the host SPA and links to individual pages', () => {
|