@moxxy/plugin-memory 0.41.2 → 0.42.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/plugin-memory",
3
- "version": "0.41.2",
3
+ "version": "0.42.0",
4
4
  "description": "Journal-based long-term memory for moxxy. Markdown files at ~/.moxxy/memory/ with type/description frontmatter + an index. Plus STM selectors over the event log.",
5
5
  "keywords": [
6
6
  "moxxy",
@@ -44,12 +44,12 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "zod": "^3.25.76",
47
- "@moxxy/sdk": "0.41.2"
47
+ "@moxxy/sdk": "0.42.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/node": "^22.10.0",
50
+ "@types/node": "^22.20.5",
51
51
  "typescript": "^6.0.3",
52
- "vitest": "^4.1.11",
52
+ "vitest": "^5.0.3",
53
53
  "@moxxy/tsconfig": "0.0.0",
54
54
  "@moxxy/vitest-preset": "0.0.0"
55
55
  },
@@ -6,13 +6,14 @@ import type { LLMProvider, ProviderEvent } from '@moxxy/sdk';
6
6
  import { assertDefined } from '@moxxy/sdk';
7
7
  import { MemoryStore } from './store.js';
8
8
  import { buildMemoryConsolidatePlugin } from './consolidate.js';
9
+ import { removeDir } from '@moxxy/vitest-preset/fs';
9
10
 
10
11
  let tmp: string;
11
12
  beforeEach(async () => {
12
13
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-nudge-'));
13
14
  });
14
15
  afterEach(async () => {
15
- await fs.rm(tmp, { recursive: true, force: true });
16
+ await removeDir(tmp);
16
17
  });
17
18
 
18
19
  const stubProvider: LLMProvider = {
@@ -6,6 +6,7 @@ import type { LLMProvider, ProviderEvent } from '@moxxy/sdk';
6
6
  import { assertDefined } from '@moxxy/sdk';
7
7
  import { MemoryStore } from './store.js';
8
8
  import { consolidateMemory, planConsolidation } from './consolidate.js';
9
+ import { removeDir } from '@moxxy/vitest-preset/fs';
9
10
 
10
11
  let tmp: string;
11
12
 
@@ -13,7 +14,7 @@ beforeEach(async () => {
13
14
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-cons-'));
14
15
  });
15
16
  afterEach(async () => {
16
- await fs.rm(tmp, { recursive: true, force: true });
17
+ await removeDir(tmp);
17
18
  });
18
19
 
19
20
  const fakeProvider = (jsonReply: string): LLMProvider => ({
@@ -5,13 +5,14 @@ import * as path from 'node:path';
5
5
  import type { EmbeddingProvider } from '@moxxy/sdk';
6
6
  import { EmbeddingIndex } from './embedding-cache.js';
7
7
  import { MemoryStore } from './store.js';
8
+ import { removeDir } from '@moxxy/vitest-preset/fs';
8
9
 
9
10
  let tmp: string;
10
11
  beforeEach(async () => {
11
12
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-cache-'));
12
13
  });
13
14
  afterEach(async () => {
14
- await fs.rm(tmp, { recursive: true, force: true });
15
+ await removeDir(tmp);
15
16
  });
16
17
 
17
18
  describe('EmbeddingIndex', () => {
package/src/index.test.ts CHANGED
@@ -5,13 +5,14 @@ import * as path from 'node:path';
5
5
  import type { ToolDef } from '@moxxy/sdk';
6
6
  import { buildMemoryPlugin } from './index.js';
7
7
  import { MemoryStore } from './store.js';
8
+ import { removeDir } from '@moxxy/vitest-preset/fs';
8
9
 
9
10
  let tmp: string;
10
11
  beforeEach(async () => {
11
12
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-idx-'));
12
13
  });
13
14
  afterEach(async () => {
14
- await fs.rm(tmp, { recursive: true, force: true });
15
+ await removeDir(tmp);
15
16
  });
16
17
 
17
18
  const toolByName = (name: string): ToolDef => {
@@ -3,13 +3,14 @@ import { promises as fs } from 'node:fs';
3
3
  import * as os from 'node:os';
4
4
  import * as path from 'node:path';
5
5
  import { listEntries, readEntry, safeRead } from './io.js';
6
+ import { removeDir } from '@moxxy/vitest-preset/fs';
6
7
 
7
8
  let tmp: string;
8
9
  beforeEach(async () => {
9
10
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-io-'));
10
11
  });
11
12
  afterEach(async () => {
12
- await fs.rm(tmp, { recursive: true, force: true });
13
+ await removeDir(tmp);
13
14
  });
14
15
 
15
16
  async function writeEntry(name: string, type = 'fact'): Promise<void> {
@@ -7,6 +7,7 @@ import { createMutex, assertDefined } from '@moxxy/sdk';
7
7
  import { rankByKeywords, recallVector } from './search.js';
8
8
  import { EmbeddingIndex } from '../embedding-cache.js';
9
9
  import type { MemoryEntry, MemoryType } from './types.js';
10
+ import { removeDir } from '@moxxy/vitest-preset/fs';
10
11
 
11
12
  function entry(
12
13
  name: string,
@@ -89,7 +90,7 @@ describe('recallVector dimension-drift hardening', () => {
89
90
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-search-'));
90
91
  });
91
92
  afterEach(async () => {
92
- await fs.rm(tmp, { recursive: true, force: true });
93
+ await removeDir(tmp);
93
94
  });
94
95
 
95
96
  it('degrades (no crash) when a misbehaving embedder under-returns vectors — no-cache path', async () => {
package/src/store.test.ts CHANGED
@@ -4,6 +4,7 @@ import { promises as fs } from 'node:fs';
4
4
  import * as os from 'node:os';
5
5
  import * as path from 'node:path';
6
6
  import { MemoryStore } from './store.js';
7
+ import { removeDir } from '@moxxy/vitest-preset/fs';
7
8
 
8
9
  let tmp: string;
9
10
  const newStore = () => new MemoryStore({ dir: tmp });
@@ -12,7 +13,7 @@ beforeEach(async () => {
12
13
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-mem-'));
13
14
  });
14
15
  afterEach(async () => {
15
- await fs.rm(tmp, { recursive: true, force: true });
16
+ await removeDir(tmp);
16
17
  });
17
18
 
18
19
  describe('MemoryStore', () => {
@@ -14,6 +14,7 @@ import {
14
14
  USER_MODEL_OPEN,
15
15
  type UserModel,
16
16
  } from './user-model.js';
17
+ import { removeDir } from '@moxxy/vitest-preset/fs';
17
18
 
18
19
  let tmp: string;
19
20
  const newStore = () => new UserModelStore(tmp);
@@ -36,7 +37,7 @@ beforeEach(async () => {
36
37
  });
37
38
  afterEach(async () => {
38
39
  vi.restoreAllMocks();
39
- await fs.rm(tmp, { recursive: true, force: true });
40
+ await removeDir(tmp);
40
41
  });
41
42
 
42
43
  const req = (system?: string): ProviderRequest => ({
@@ -5,13 +5,14 @@ import * as path from 'node:path';
5
5
  import type { EmbeddingProvider } from '@moxxy/sdk';
6
6
  import { assertDefined } from '@moxxy/sdk';
7
7
  import { MemoryStore } from './store.js';
8
+ import { removeDir } from '@moxxy/vitest-preset/fs';
8
9
 
9
10
  let tmp: string;
10
11
  beforeEach(async () => {
11
12
  tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'mox-vec-'));
12
13
  });
13
14
  afterEach(async () => {
14
- await fs.rm(tmp, { recursive: true, force: true });
15
+ await removeDir(tmp);
15
16
  });
16
17
 
17
18
  const sampleCorpus = async (store: MemoryStore): Promise<void> => {