@ai-agent-forge/plugin-memory 0.85.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/README.md +65 -0
- package/agent-forge.json +11 -0
- package/dist/capability.d.ts +182 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/capability.js +2565 -0
- package/dist/capability.js.map +1 -0
- package/dist/entry.d.ts +36 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +154 -0
- package/dist/entry.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/assistant-card.d.ts +31 -0
- package/dist/memory/assistant-card.d.ts.map +1 -0
- package/dist/memory/assistant-card.js +108 -0
- package/dist/memory/assistant-card.js.map +1 -0
- package/dist/memory/candidates.d.ts +65 -0
- package/dist/memory/candidates.d.ts.map +1 -0
- package/dist/memory/candidates.js +100 -0
- package/dist/memory/candidates.js.map +1 -0
- package/dist/memory/code-memory.d.ts +89 -0
- package/dist/memory/code-memory.d.ts.map +1 -0
- package/dist/memory/code-memory.js +104 -0
- package/dist/memory/code-memory.js.map +1 -0
- package/dist/memory/compaction-sequencer.d.ts +63 -0
- package/dist/memory/compaction-sequencer.d.ts.map +1 -0
- package/dist/memory/compaction-sequencer.js +129 -0
- package/dist/memory/compaction-sequencer.js.map +1 -0
- package/dist/memory/continuation.d.ts +44 -0
- package/dist/memory/continuation.d.ts.map +1 -0
- package/dist/memory/continuation.js +49 -0
- package/dist/memory/continuation.js.map +1 -0
- package/dist/memory/curation.d.ts +58 -0
- package/dist/memory/curation.d.ts.map +1 -0
- package/dist/memory/curation.js +68 -0
- package/dist/memory/curation.js.map +1 -0
- package/dist/memory/egress-policy.d.ts +50 -0
- package/dist/memory/egress-policy.d.ts.map +1 -0
- package/dist/memory/egress-policy.js +71 -0
- package/dist/memory/egress-policy.js.map +1 -0
- package/dist/memory/embedding-provider.d.ts +70 -0
- package/dist/memory/embedding-provider.d.ts.map +1 -0
- package/dist/memory/embedding-provider.js +164 -0
- package/dist/memory/embedding-provider.js.map +1 -0
- package/dist/memory/embedding-reranker.d.ts +56 -0
- package/dist/memory/embedding-reranker.d.ts.map +1 -0
- package/dist/memory/embedding-reranker.js +109 -0
- package/dist/memory/embedding-reranker.js.map +1 -0
- package/dist/memory/foundation.d.ts +168 -0
- package/dist/memory/foundation.d.ts.map +1 -0
- package/dist/memory/foundation.js +487 -0
- package/dist/memory/foundation.js.map +1 -0
- package/dist/memory/host-module-import.d.ts +25 -0
- package/dist/memory/host-module-import.d.ts.map +1 -0
- package/dist/memory/host-module-import.js +41 -0
- package/dist/memory/host-module-import.js.map +1 -0
- package/dist/memory/ledger.d.ts +58 -0
- package/dist/memory/ledger.d.ts.map +1 -0
- package/dist/memory/ledger.js +315 -0
- package/dist/memory/ledger.js.map +1 -0
- package/dist/memory/lifecycle.d.ts +124 -0
- package/dist/memory/lifecycle.d.ts.map +1 -0
- package/dist/memory/lifecycle.js +201 -0
- package/dist/memory/lifecycle.js.map +1 -0
- package/dist/memory/memory-network.d.ts +55 -0
- package/dist/memory/memory-network.d.ts.map +1 -0
- package/dist/memory/memory-network.js +70 -0
- package/dist/memory/memory-network.js.map +1 -0
- package/dist/memory/model-cache-hygiene.d.ts +18 -0
- package/dist/memory/model-cache-hygiene.d.ts.map +1 -0
- package/dist/memory/model-cache-hygiene.js +38 -0
- package/dist/memory/model-cache-hygiene.js.map +1 -0
- package/dist/memory/preference-disambiguator.d.ts +43 -0
- package/dist/memory/preference-disambiguator.d.ts.map +1 -0
- package/dist/memory/preference-disambiguator.js +81 -0
- package/dist/memory/preference-disambiguator.js.map +1 -0
- package/dist/memory/preference-lifecycle.d.ts +66 -0
- package/dist/memory/preference-lifecycle.d.ts.map +1 -0
- package/dist/memory/preference-lifecycle.js +129 -0
- package/dist/memory/preference-lifecycle.js.map +1 -0
- package/dist/memory/preference-promotion.d.ts +87 -0
- package/dist/memory/preference-promotion.d.ts.map +1 -0
- package/dist/memory/preference-promotion.js +102 -0
- package/dist/memory/preference-promotion.js.map +1 -0
- package/dist/memory/preference-resolver.d.ts +44 -0
- package/dist/memory/preference-resolver.d.ts.map +1 -0
- package/dist/memory/preference-resolver.js +107 -0
- package/dist/memory/preference-resolver.js.map +1 -0
- package/dist/memory/purge-journal.d.ts +76 -0
- package/dist/memory/purge-journal.d.ts.map +1 -0
- package/dist/memory/purge-journal.js +130 -0
- package/dist/memory/purge-journal.js.map +1 -0
- package/dist/memory/purge.d.ts +90 -0
- package/dist/memory/purge.d.ts.map +1 -0
- package/dist/memory/purge.js +138 -0
- package/dist/memory/purge.js.map +1 -0
- package/dist/memory/recall-agent.d.ts +84 -0
- package/dist/memory/recall-agent.d.ts.map +1 -0
- package/dist/memory/recall-agent.js +199 -0
- package/dist/memory/recall-agent.js.map +1 -0
- package/dist/memory/recall-index.d.ts +87 -0
- package/dist/memory/recall-index.d.ts.map +1 -0
- package/dist/memory/recall-index.js +222 -0
- package/dist/memory/recall-index.js.map +1 -0
- package/dist/memory/recall-packet.d.ts +121 -0
- package/dist/memory/recall-packet.d.ts.map +1 -0
- package/dist/memory/recall-packet.js +156 -0
- package/dist/memory/recall-packet.js.map +1 -0
- package/dist/memory/scheduler-api.d.ts +99 -0
- package/dist/memory/scheduler-api.d.ts.map +1 -0
- package/dist/memory/scheduler-api.js +93 -0
- package/dist/memory/scheduler-api.js.map +1 -0
- package/dist/memory/scheduler.d.ts +55 -0
- package/dist/memory/scheduler.d.ts.map +1 -0
- package/dist/memory/scheduler.js +91 -0
- package/dist/memory/scheduler.js.map +1 -0
- package/dist/memory/store.d.ts +107 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +208 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/memory/suite-memory.d.ts +208 -0
- package/dist/memory/suite-memory.d.ts.map +1 -0
- package/dist/memory/suite-memory.js +288 -0
- package/dist/memory/suite-memory.js.map +1 -0
- package/dist/memory/transfer.d.ts +142 -0
- package/dist/memory/transfer.d.ts.map +1 -0
- package/dist/memory/transfer.js +210 -0
- package/dist/memory/transfer.js.map +1 -0
- package/dist/memory/vector-index.d.ts +39 -0
- package/dist/memory/vector-index.d.ts.map +1 -0
- package/dist/memory/vector-index.js +136 -0
- package/dist/memory/vector-index.js.map +1 -0
- package/dist/memory/write-budget.d.ts +33 -0
- package/dist/memory/write-budget.d.ts.map +1 -0
- package/dist/memory/write-budget.js +45 -0
- package/dist/memory/write-budget.js.map +1 -0
- package/dist/testing/memory-testkit.d.ts +149 -0
- package/dist/testing/memory-testkit.d.ts.map +1 -0
- package/dist/testing/memory-testkit.js +438 -0
- package/dist/testing/memory-testkit.js.map +1 -0
- package/dist/utils/sync-sleep.d.ts +2 -0
- package/dist/utils/sync-sleep.d.ts.map +1 -0
- package/dist/utils/sync-sleep.js +11 -0
- package/dist/utils/sync-sleep.js.map +1 -0
- package/package.json +56 -0
- package/plugin.json +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-testkit.js","sourceRoot":"","sources":["../../src/testing/memory-testkit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAS9C,OAAO,EAAE,4BAA4B,EAAiC,MAAM,yBAAyB,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,8BAA8B,EAAmC,MAAM,2BAA2B,CAAC;AAC5G,OAAO,EAAE,yBAAyB,EAA8B,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,wCAAwC,EAAE,MAAM,iCAAiC,CAAC;AAG3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACN,4BAA4B,GAG5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,qBAAqB,EACrB,2BAA2B,GAG3B,MAAM,oBAAoB,CAAC;AA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QAC5E,sBAAsB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;YACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;YACnC,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7E,gBAAgB,IAAI,CAAC,CAAC;YACtB,MAAM,cAAc,GAA4B;gBAC/C,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,UAAU,EAAE,iBAAiB,gBAAgB,EAAE;gBAC/C,IAAI,EAAE,KAAK,CAAC,EAAE;gBACd,OAAO;gBACP,KAAK,EAAE,WAAW;gBAClB,MAAM,EAAE,MAAM;gBACd,SAAS,EAAE,CAAC;gBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;aAChB,CAAC;YACF,KAAK,MAAM,OAAO,IAAI,IAAI;gBAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;QAAA,CAC1D;KACD,CAAC;AAAA,CACF","sourcesContent":["/**\n * Deterministic memory testkit (1C.8a) — wires the 1C.1–1C.7 Foundation pieces\n * (atom validator, store, candidate machine, recall index, lifecycle manager,\n * scheduler, curation, continuation, purge gate/journal) into one reusable,\n * clock-injectable fixture. Acceptance: the 1C.7b closed loop repeats 20 times\n * with identical results through this kit.\n */\nimport { deepStrictEqual } from \"node:assert\";\nimport type {\n\tCapabilityAPI,\n\tJsonValue,\n\tLifecycleEvent,\n\tLifecycleEventDefinition,\n\tLifecycleEventReference,\n\tLifecycleObserveHandler,\n} from \"@agent-forge/plugin-sdk\";\nimport { createMemoryCandidateMachine, type MemoryCandidateMachineV1 } from \"../memory/candidates.ts\";\nimport { createMemoryCompactionSequencer } from \"../memory/compaction-sequencer.ts\";\nimport { createMemoryContinuationIssuer, type MemoryContinuationIssuerV1 } from \"../memory/continuation.ts\";\nimport { createMemoryCurationAgent, type MemoryCurationAgentV1 } from \"../memory/curation.ts\";\nimport type { MemoryEmbeddingProviderV1 } from \"../memory/embedding-provider.ts\";\nimport { createDeterministicMockEmbeddingProvider } from \"../memory/embedding-provider.ts\";\nimport type { MemoryRerankerV1 } from \"../memory/embedding-reranker.ts\";\nimport type { MemoryAtomV1, MemoryScopeV1 } from \"../memory/foundation.ts\";\nimport { buildMemoryAtomV1 } from \"../memory/foundation.ts\";\nimport {\n\tcreateMemoryLifecycleManager,\n\ttype MemoryLifecycleManagerV1,\n\ttype MemoryLifecyclePolicyV1,\n} from \"../memory/lifecycle.ts\";\nimport {\n\tcreateMemoryPurgeGate,\n\tcreateMemoryReplicaRegistry,\n\ttype MemoryPurgeGateV1,\n\ttype MemoryReplicaRegistryV1,\n} from \"../memory/purge.ts\";\nimport { createMemoryPurgeJournal, type MemoryPurgeJournalV1 } from \"../memory/purge-journal.ts\";\nimport { createMemoryRecallAgent, type MemoryRecallAgentV1 } from \"../memory/recall-agent.ts\";\nimport { createMemoryRecallIndex, type MemoryRecallPageV1, type MemoryRecallQueryV1 } from \"../memory/recall-index.ts\";\nimport { createMemoryScheduler, type MemorySchedulerV1 } from \"../memory/scheduler.ts\";\nimport {\n\tcreateFirstPartyRetentionRegistry,\n\tcreateMemoryStore,\n\ttype MemoryStoreV1,\n\ttype RetentionModeRegistryV1,\n} from \"../memory/store.ts\";\nimport type { MemoryVectorIndexEntryV1, MemoryVectorIndexV1 } from \"../memory/vector-index.ts\";\n\nexport interface MemoryTestKitOptions {\n\treadonly now?: () => number;\n\treadonly retentionRegistry?: RetentionModeRegistryV1;\n\treadonly lifecyclePolicy?: MemoryLifecyclePolicyV1;\n}\n\nexport interface MemoryTestKitAtomSeed {\n\treadonly owner?: string;\n\treadonly scope?: MemoryScopeV1;\n\treadonly retentionMode?: string;\n\treadonly memoryId?: string;\n\treadonly observationId?: string;\n\treadonly project?: string;\n\treadonly task?: string;\n\treadonly scene?: string;\n\treadonly occurredAt: string;\n\treadonly payload?: JsonValue;\n}\n\nexport interface MemoryTestKit {\n\treadonly store: MemoryStoreV1;\n\treadonly machine: MemoryCandidateMachineV1;\n\treadonly sequencer: ReturnType<typeof createMemoryCompactionSequencer>;\n\treadonly index: ReturnType<typeof createMemoryRecallIndex>;\n\treadonly lifecycle: MemoryLifecycleManagerV1;\n\treadonly scheduler: MemorySchedulerV1;\n\treadonly curation: MemoryCurationAgentV1;\n\treadonly continuation: MemoryContinuationIssuerV1;\n\treadonly purgeGate: MemoryPurgeGateV1;\n\treadonly purgeJournal: MemoryPurgeJournalV1;\n\treadonly recallAgent: MemoryRecallAgentV1;\n\t/** Builds a validated deterministic atom from a seed. */\n\tmakeAtom(seed: MemoryTestKitAtomSeed): MemoryAtomV1;\n\t/** Convenience: curation-commit an atom and return its memoryId. */\n\tcommit(atom: MemoryAtomV1): string;\n\tquery(query: MemoryRecallQueryV1): MemoryRecallPageV1;\n}\n\nexport function createMemoryTestKit(options: MemoryTestKitOptions = {}): MemoryTestKit {\n\tconst now = options.now ?? (() => Date.now());\n\tconst retentionRegistry = options.retentionRegistry ?? createFirstPartyRetentionRegistry();\n\tconst store = createMemoryStore({ retentionRegistry, now });\n\tconst machine = createMemoryCandidateMachine({ store, now });\n\tconst sequencer = createMemoryCompactionSequencer({ store });\n\tconst index = createMemoryRecallIndex({ store });\n\tconst lifecyclePolicy: MemoryLifecyclePolicyV1 = options.lifecyclePolicy ?? {\n\t\tpolicyVersion: \"lifecycle@1\",\n\t\thalfLifeMs: Object.freeze({\n\t\t\tsession: 1 * 24 * 60 * 60 * 1000,\n\t\t\tcycle: 7 * 24 * 60 * 60 * 1000,\n\t\t\t\"long-term\": 30 * 24 * 60 * 60 * 1000,\n\t\t}),\n\t\tstaleAfterMs: Object.freeze({\n\t\t\tsession: 2 * 24 * 60 * 60 * 1000,\n\t\t\tcycle: 14 * 24 * 60 * 60 * 1000,\n\t\t\t\"long-term\": 60 * 24 * 60 * 60 * 1000,\n\t\t}),\n\t\tarchiveAfterMs: Object.freeze({\n\t\t\tsession: 7 * 24 * 60 * 60 * 1000,\n\t\t\tcycle: 60 * 24 * 60 * 60 * 1000,\n\t\t\t\"long-term\": 180 * 24 * 60 * 60 * 1000,\n\t\t}),\n\t\tbaselineAttention: 0.5,\n\t};\n\tconst lifecycle = createMemoryLifecycleManager({ policy: lifecyclePolicy, now });\n\tconst scheduler = createMemoryScheduler({ now });\n\tconst curation = createMemoryCurationAgent({ store });\n\tconst continuation = createMemoryContinuationIssuer();\n\tconst replicaRegistry: MemoryReplicaRegistryV1 = createMemoryReplicaRegistry();\n\treplicaRegistry.register({\n\t\treplicaId: \"canonical-1\",\n\t\tkind: \"canonical\",\n\t\townerScope: \"*\",\n\t\tcontractVersion: \"agent-forge/memory@1\",\n\t\thealthy: true,\n\t});\n\tconst purgeGate = createMemoryPurgeGate({ registry: replicaRegistry, now });\n\tconst purgeJournal = createMemoryPurgeJournal();\n\tconst recallAgent = createMemoryRecallAgent({\n\t\tscheduler,\n\t\tindex,\n\t\tpolicyDefaults: {\n\t\t\tcandidateBudget: 1000,\n\t\t\tmodelInspectionLimit: 20,\n\t\t\tfinalResultLimit: 10,\n\t\t\tmaxRelationHops: 2,\n\t\t\tmaxModelCalls: 3,\n\t\t\tmaxOutputTokens: 4000,\n\t\t\tmaxOutputBytes: 16_000,\n\t\t\tmaxRounds: 3,\n\t\t},\n\t\thostLimits: {\n\t\t\tcandidateBudget: 5000,\n\t\t\tmodelInspectionLimit: 100,\n\t\t\tfinalResultLimit: 100,\n\t\t\tmaxRelationHops: 5,\n\t\t\tmaxModelCalls: 10,\n\t\t\tmaxOutputTokens: 100_000,\n\t\t\tmaxOutputBytes: 1_000_000,\n\t\t\tmaxRounds: 10,\n\t\t},\n\t\tnow,\n\t});\n\n\tlet sequence = 0;\n\tconst makeAtom = (seed: MemoryTestKitAtomSeed): MemoryAtomV1 => {\n\t\tsequence += 1;\n\t\treturn buildMemoryAtomV1({\n\t\t\tmemoryId: seed.memoryId ?? `mem-${String(sequence).padStart(4, \"0\")}`,\n\t\t\tcontractVersion: \"agent-forge/memory@1\",\n\t\t\tschemaVersion: 1,\n\t\t\tscope: seed.scope ?? \"long-term\",\n\t\t\tretentionMode: seed.retentionMode ?? \"permanent\",\n\t\t\towner: seed.owner ?? \"code-memory\",\n\t\t\tprofileId: \"coding-agent\",\n\t\t\tretentionPolicyVersion: \"retention@1\",\n\t\t\tmemoryKind: \"fact\",\n\t\t\tpayload: seed.payload ?? { sequence },\n\t\t\toccurredAt: seed.occurredAt,\n\t\t\trecordedAt: seed.occurredAt,\n\t\t\tsourceRefs: [{ kind: \"entry\", id: `entry-${sequence}` }],\n\t\t\tobservationId: seed.observationId ?? `obs-${sequence}`,\n\t\t\tsessionRefs: [],\n\t\t\tagentInstanceRefs: [],\n\t\t\tprojectRefs: seed.project ? [seed.project] : [],\n\t\t\tsubjectRefs: seed.task ? [seed.task] : [],\n\t\t\tfacets: [],\n\t\t\trelations: [],\n\t\t\tconfidence: 1,\n\t\t\timportance: 0.5,\n\t\t\tevidenceClass: \"explicit\",\n\t\t\tcontentRevision: `c-${sequence}`,\n\t\t\twriteReason: \"test\",\n\t\t});\n\t};\n\n\tconst commit = (atom: MemoryAtomV1): string => {\n\t\tstore.commit(atom);\n\t\treturn atom.memoryId;\n\t};\n\n\tconst query = (query: MemoryRecallQueryV1): MemoryRecallPageV1 => index.query(query);\n\n\treturn {\n\t\tstore,\n\t\tmachine,\n\t\tsequencer,\n\t\tindex,\n\t\tlifecycle,\n\t\tscheduler,\n\t\tcuration,\n\t\tcontinuation,\n\t\tpurgeGate,\n\t\tpurgeJournal,\n\t\trecallAgent,\n\t\tmakeAtom,\n\t\tcommit,\n\t\tquery,\n\t};\n}\n\n/** Repeats `run` up to `times` and requires every result to deep-equal the first. */\nexport async function repeatMemoryTestKit<T>(\n\ttimes: number,\n\trun: () => Promise<T>,\n): Promise<{ readonly baseline: T; readonly repeats: number }> {\n\tlet baseline: T | undefined;\n\tlet repeats = 0;\n\tfor (let index = 0; index < times; index += 1) {\n\t\tconst result = await run();\n\t\tif (index === 0) {\n\t\t\tbaseline = result;\n\t\t\tcontinue;\n\t\t}\n\t\t// node:assert deep compare keeps the kit free of test-runner imports\n\t\t// (plugin-src boundary gate allows node: builtins only); vitest renders\n\t\t// the AssertionError like any other thrown assertion.\n\t\tdeepStrictEqual(result, baseline);\n\t\trepeats += 1;\n\t}\n\treturn { baseline: baseline as T, repeats };\n}\n\n// ---------------------------------------------------------------------------\n// 向量混合检索 mock 注入点 (架构宪法: 默认测试只允许 deterministic mock AI)。\n// 供 capabilities/memory.ts 的 createCapabilityWithVectorComponents 注入,\n// 不触真实 transformers/lancedb。\n// ---------------------------------------------------------------------------\n\nfunction tokenizeForFakeIndex(text: string): readonly string[] {\n\treturn text\n\t\t.toLowerCase()\n\t\t.split(/[^\\p{L}\\p{N}]+/u)\n\t\t.filter((token) => token !== \"\");\n}\n\n/**\n * In-memory fake of the LanceDB vector index (memory/vector-index.ts 同契约):\n * KNN 平扫平方 L2 (score = 1/(1+距离), 与真组件同口径), FTS 按词元包含匹配\n * (score = 1/(60+rank+1), 与真组件同口径)。确定性: 排序并列按插入序打破。\n */\nexport function createInMemoryMemoryVectorIndex(options: { readonly dimensions: number }): MemoryVectorIndexV1 {\n\tconst dimensions = options.dimensions;\n\tconst rows = new Map<string, MemoryVectorIndexEntryV1>();\n\tconst insertOrder: string[] = [];\n\tconst bodyOf = (entry: MemoryVectorIndexEntryV1): string => `${entry.statement} ${entry.tags.join(\" \")}`;\n\treturn {\n\t\treplicaId: \"memory-vector-index\",\n\t\tupsert: async (entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.vector.length !== dimensions) {\n\t\t\t\t\tthrow new Error(`dimension mismatch for ${entry.memoryId}`);\n\t\t\t\t}\n\t\t\t\tif (!rows.has(entry.memoryId)) insertOrder.push(entry.memoryId);\n\t\t\t\trows.set(entry.memoryId, entry);\n\t\t\t}\n\t\t},\n\t\tremove: async (memoryIds) => {\n\t\t\tfor (const memoryId of memoryIds) {\n\t\t\t\trows.delete(memoryId);\n\t\t\t\tconst position = insertOrder.indexOf(memoryId);\n\t\t\t\tif (position >= 0) insertOrder.splice(position, 1);\n\t\t\t}\n\t\t},\n\t\tqueryKnn: async (vector, query) => {\n\t\t\tif (vector.length !== dimensions) throw new Error(\"query vector dimension mismatch\");\n\t\t\tconst hits = insertOrder\n\t\t\t\t.map((memoryId) => {\n\t\t\t\t\tconst entry = rows.get(memoryId);\n\t\t\t\t\tif (entry === undefined || entry.owner !== query.owner) return undefined;\n\t\t\t\t\tlet sumSquares = 0;\n\t\t\t\t\tfor (const [axis, value] of vector.entries()) {\n\t\t\t\t\t\tconst delta = value - (entry.vector[axis] ?? 0);\n\t\t\t\t\t\tsumSquares += delta * delta;\n\t\t\t\t\t}\n\t\t\t\t\treturn { memoryId, score: 1 / (1 + sumSquares) };\n\t\t\t\t})\n\t\t\t\t.filter((hit): hit is { memoryId: string; score: number } => hit !== undefined);\n\t\t\thits.sort((left, right) => right.score - left.score);\n\t\t\treturn hits.slice(0, query.limit);\n\t\t},\n\t\tqueryFts: async (queryText, query) => {\n\t\t\tconst queryTokens = tokenizeForFakeIndex(queryText);\n\t\t\tif (queryTokens.length === 0) return [];\n\t\t\tconst matched = insertOrder\n\t\t\t\t.map((memoryId) => {\n\t\t\t\t\tconst entry = rows.get(memoryId);\n\t\t\t\t\tif (entry === undefined || entry.owner !== query.owner) return undefined;\n\t\t\t\t\tconst bodyTokens = new Set(tokenizeForFakeIndex(bodyOf(entry)));\n\t\t\t\t\tconst hits = queryTokens.filter((token) => bodyTokens.has(token)).length;\n\t\t\t\t\treturn hits > 0 ? { memoryId, hits } : undefined;\n\t\t\t\t})\n\t\t\t\t.filter((hit): hit is { memoryId: string; hits: number } => hit !== undefined);\n\t\t\t// 命中词元数降序, 并列按插入序; 打分与真组件同口径 (RRF_K=60)。\n\t\t\tmatched.sort((left, right) => right.hits - left.hits);\n\t\t\treturn matched\n\t\t\t\t.slice(0, query.limit)\n\t\t\t\t.map((hit, rank) => ({ memoryId: hit.memoryId, score: 1 / (60 + rank + 1) }));\n\t\t},\n\t\tlistMemoryIds: async () => new Set(rows.keys()),\n\t\tcount: async () => rows.size,\n\t\tgetStoredModelId: async () => {\n\t\t\tconst first = insertOrder.find((memoryId) => rows.has(memoryId));\n\t\t\treturn first === undefined ? undefined : rows.get(first)?.modelId;\n\t\t},\n\t\tclose: async () => {},\n\t};\n}\n\n/**\n * Deterministic mock vector components for the capability's vector-channel\n * injection seam: the FNV token-hash mock embedder plus a scripted or\n * lexical-overlap reranker over an in-memory fake index. No network, no real\n * models, fully deterministic.\n */\nexport interface MockMemoryVectorComponentsOptions {\n\treadonly dimensions?: number;\n\t/** Explicit rerank scoring; default = deterministic lexical-overlap reranker. */\n\treadonly rerank?: (query: string, docs: readonly string[]) => readonly number[];\n\t/** true → no reranker at all (精排不可用路径: 跳过精排, RRF 序)。 */\n\treadonly rerankerUnavailable?: boolean;\n}\n\nexport function createMockMemoryVectorComponents(options: MockMemoryVectorComponentsOptions = {}): {\n\treadonly embedProvider: MemoryEmbeddingProviderV1;\n\treadonly reranker: MemoryRerankerV1 | undefined;\n\treadonly vectorIndex: MemoryVectorIndexV1;\n} {\n\tconst embedProvider = createDeterministicMockEmbeddingProvider({ dimensions: options.dimensions ?? 8 });\n\tconst vectorIndex = createInMemoryMemoryVectorIndex({ dimensions: embedProvider.dimensions });\n\tconst scriptedRerank = options.rerank;\n\tconst reranker: MemoryRerankerV1 | undefined = options.rerankerUnavailable\n\t\t? undefined\n\t\t: {\n\t\t\t\tmodelId: \"mock-reranker@1\",\n\t\t\t\trerank:\n\t\t\t\t\tscriptedRerank === undefined\n\t\t\t\t\t\t? createLexicalMockReranker().rerank\n\t\t\t\t\t\t: async (query, docs) => scriptedRerank(query, docs),\n\t\t\t};\n\treturn { embedProvider, reranker, vectorIndex };\n}\n\n/** Deterministic reranker mock: score = count of query tokens present in the doc. */\nexport function createLexicalMockReranker(): MemoryRerankerV1 {\n\treturn {\n\t\tmodelId: \"mock-reranker@1\",\n\t\trerank: async (query, docs) => {\n\t\t\tconst queryTokens = new Set(tokenizeForFakeIndex(query));\n\t\t\treturn docs.map((doc) => {\n\t\t\t\tlet overlap = 0;\n\t\t\t\tfor (const token of tokenizeForFakeIndex(doc)) {\n\t\t\t\t\tif (queryTokens.has(token)) overlap += 1;\n\t\t\t\t}\n\t\t\t\treturn overlap;\n\t\t\t});\n\t\t},\n\t};\n}\n\n/**\n * 显式向量表 mock 组件 (2.4d6 S3 语义合并测试用): 每条文本的向量由测试直接\n * 指定 (绕过 FNV token hash — 合并阈值的余弦判定需要可控向量), 搭配\n * in-memory fake index 与缺省词元重排器, 零网络零真实模型 (架构宪法测试\n * 门禁)。dimensions 取自向量表首个声明向量; 未声明向量的文本显式抛错 —\n * 测试必须登记每一条会被 embed 的内容与查询 (含召回 query), 保证确定性。\n */\nexport function createScriptedMockVectorComponents(vectors: { readonly [text: string]: readonly number[] }): {\n\treadonly embedProvider: MemoryEmbeddingProviderV1;\n\treadonly reranker: MemoryRerankerV1 | undefined;\n\treadonly vectorIndex: MemoryVectorIndexV1;\n} {\n\tconst table = new Map<string, readonly number[]>(Object.entries(vectors));\n\tconst firstVector = table.values().next();\n\tif (firstVector.done || firstVector.value.length === 0) {\n\t\tthrow new Error(\"createScriptedMockVectorComponents requires at least one declared vector\");\n\t}\n\tconst dimensions = firstVector.value.length;\n\tconst embedProvider: MemoryEmbeddingProviderV1 = {\n\t\tmodelId: \"mock-embedding-scripted@1\",\n\t\tdimensions,\n\t\tembed: async (texts) =>\n\t\t\ttexts.map((text) => {\n\t\t\t\tconst vector = table.get(text);\n\t\t\t\tif (vector === undefined) throw new Error(`no scripted vector declared for text: ${text}`);\n\t\t\t\treturn vector;\n\t\t\t}),\n\t};\n\treturn {\n\t\tembedProvider,\n\t\treranker: createLexicalMockReranker(),\n\t\tvectorIndex: createInMemoryMemoryVectorIndex({ dimensions }),\n\t};\n}\n\n/** A loop hook captured from a capability registration (测试侧驱动用). */\nexport interface MemoryCapabilityLoopHookCaptureV1 {\n\treadonly position: string;\n\treadonly handler: (messages: unknown) => Promise<unknown>;\n}\n\n/**\n * Minimal capture api for driving `createCapability` / its vector-component\n * test variant at the factory level (mirrors the runtime tool/command surface:\n * registerTool, registerCommand, publish, logger, capabilities, session,\n * lifecycle, registerLoopHook).\n */\nexport interface MemoryCapabilityTestApiV1 {\n\treadonly api: CapabilityAPI;\n\t/** Registered tool by name (undefined when the capability did not register it). */\n\ttool(name: string): { readonly execute: (first: unknown, second?: unknown) => Promise<unknown> } | undefined;\n\t/** Registered command by name (undefined when the capability did not register it). */\n\tcommand(name: string): { readonly execute: (args: string) => Promise<unknown> } | undefined;\n\t/** logger.warn messages captured for degraded-channel assertions. */\n\treadonly warnings: readonly string[];\n\t/** logger.info messages captured for off/enabling declaration assertions. */\n\treadonly infos: readonly string[];\n\t/** logger.debug messages captured for bounded-skip assertions (§2.2 配对失败). */\n\treadonly debugs: readonly string[];\n\t/** Appends a suite binding entry; resolveSessionDomain reads the LAST one. */\n\tbindSuite(suiteId: string): void;\n\t/**\n\t * Appends one message entry (assistant/user/toolResult shape is the test's\n\t * responsibility) to the branch; returns the entry id.\n\t */\n\tappendMessageEntry(message: unknown): string;\n\t/** The registered loop hook for a position (undefined when not registered). */\n\tloopHook(position: string): MemoryCapabilityLoopHookCaptureV1 | undefined;\n\t/**\n\t * Dispatches a committed lifecycle event to every registered observer of\n\t * id@version (test-side stand-in for the host lifecycle dispatcher).\n\t */\n\tdispatchLifecycleEvent(event: {\n\t\treadonly id: string;\n\t\treadonly version?: number;\n\t\treadonly data: unknown;\n\t}): Promise<void>;\n}\n\nexport function createMemoryCapabilityTestApi(options: { readonly suiteId?: string } = {}): MemoryCapabilityTestApiV1 {\n\tconst warnings: string[] = [];\n\tconst infos: string[] = [];\n\tconst debugs: string[] = [];\n\tconst registered = new Map<string, { readonly execute: (first: unknown, second?: unknown) => Promise<unknown> }>();\n\tconst commands = new Map<string, { readonly execute: (args: string) => Promise<unknown> }>();\n\tconst entries: { id: string; type: string; customType?: string; data?: unknown; message?: unknown }[] = [];\n\tconst loopHooks: MemoryCapabilityLoopHookCaptureV1[] = [];\n\t// Lifecycle stand-in: definitions by id@version plus observer lists, enough\n\t// for capabilities that define catalog events and register observe handlers.\n\tlet deliverySequence = 0;\n\tconst lifecycleDefinitions = new Map<string, LifecycleEventDefinition<unknown>>();\n\tconst lifecycleObservers = new Map<string, ((event: LifecycleEvent<unknown>) => unknown)[]>();\n\tconst lifecycleKeyOf = (id: string, version: number): string => `${id}@${version}`;\n\tconst lifecycleReferenceOf = (\n\t\tevent: LifecycleEventDefinition<unknown> | LifecycleEventReference | string,\n\t\tversion?: number,\n\t): { readonly id: string; readonly version: number } => {\n\t\tif (typeof event === \"string\") return { id: event, version: version ?? 1 };\n\t\treturn { id: event.id, version: event.version };\n\t};\n\tconst registerLifecycleObserver = (\n\t\tevent: LifecycleEventDefinition<unknown> | LifecycleEventReference | string,\n\t\thandler: LifecycleObserveHandler<unknown>,\n\t\tversion?: number,\n\t): { dispose: () => void } => {\n\t\tconst reference = lifecycleReferenceOf(event, version);\n\t\tconst key = lifecycleKeyOf(reference.id, reference.version);\n\t\tconst list = lifecycleObservers.get(key) ?? [];\n\t\tlist.push(handler);\n\t\tlifecycleObservers.set(key, list);\n\t\treturn { dispose: () => {} };\n\t};\n\tconst lifecycle = {\n\t\tdefine: (definition: LifecycleEventDefinition<unknown>): LifecycleEventDefinition<unknown> => {\n\t\t\tconst key = lifecycleKeyOf(definition.id, definition.version);\n\t\t\tif (lifecycleDefinitions.has(key)) {\n\t\t\t\tthrow new Error(`Lifecycle event is already defined: ${definition.id}@${definition.version}`);\n\t\t\t}\n\t\t\tlifecycleDefinitions.set(key, definition);\n\t\t\treturn definition;\n\t\t},\n\t\tget: (id: string, version: number): LifecycleEventDefinition<unknown> => {\n\t\t\tconst definition = lifecycleDefinitions.get(lifecycleKeyOf(id, version));\n\t\t\tif (definition === undefined) throw new Error(`Lifecycle event is not defined: ${id}@${version}`);\n\t\t\treturn definition;\n\t\t},\n\t\tregisterObserve: registerLifecycleObserver,\n\t\tregisterTransform: (): { dispose: () => void } => {\n\t\t\tthrow new Error(\"lifecycle transform is not available in this fixture\");\n\t\t},\n\t\tregisterExecute: (): { dispose: () => void } => {\n\t\t\tthrow new Error(\"lifecycle execute is not available in this fixture\");\n\t\t},\n\t\tregisterAfterCommit: registerLifecycleObserver,\n\t};\n\tlet messageSequence = 0;\n\tif (options.suiteId !== undefined) {\n\t\tentries.push({ id: \"binding-0\", type: \"custom\", customType: \"suite\", data: { suiteId: options.suiteId } });\n\t}\n\tconst api = {\n\t\tregisterTool: (definition: { name: string; execute: (first: unknown, second?: unknown) => Promise<unknown> }) => {\n\t\t\tregistered.set(definition.name, definition);\n\t\t\treturn { dispose: async () => {} };\n\t\t},\n\t\tregisterCommand: (definition: { name: string; execute: (args: string) => Promise<unknown> }) => {\n\t\t\tcommands.set(definition.name, definition);\n\t\t\treturn { dispose: async () => {} };\n\t\t},\n\t\tregisterLoopHook: (position: string, handler: (messages: unknown) => Promise<unknown>) => {\n\t\t\tloopHooks.push({ position, handler });\n\t\t\treturn { dispose: async () => {} };\n\t\t},\n\t\tpublish: async (event: unknown) => ({ id: \"test-event\", source: \"test\", timestamp: 0, ...(event as object) }),\n\t\tlogger: {\n\t\t\tdebug: (message: string) => {\n\t\t\t\tdebugs.push(message);\n\t\t\t},\n\t\t\tinfo: (message: string) => {\n\t\t\t\tinfos.push(message);\n\t\t\t},\n\t\t\twarn: (message: string) => {\n\t\t\t\twarnings.push(message);\n\t\t\t},\n\t\t\terror: () => {},\n\t\t},\n\t\tcapabilities: {\n\t\t\tprovide: () => ({ dispose: () => {} }),\n\t\t\trequire: () => {\n\t\t\t\tthrow new Error(\"capability require is not available in this fixture\");\n\t\t\t},\n\t\t\tlist: () => [],\n\t\t},\n\t\tsession: {\n\t\t\tgetSessionId: () => \"memory-test-session\",\n\t\t\tgetBranchEntries: () => entries,\n\t\t},\n\t\tlifecycle,\n\t} as unknown as CapabilityAPI;\n\treturn {\n\t\tapi,\n\t\ttool: (name) => registered.get(name),\n\t\tcommand: (name) => commands.get(name),\n\t\twarnings,\n\t\tinfos,\n\t\tdebugs,\n\t\tbindSuite: (suiteId) => {\n\t\t\tentries.push({ id: `binding-${entries.length}`, type: \"custom\", customType: \"suite\", data: { suiteId } });\n\t\t},\n\t\tappendMessageEntry: (message) => {\n\t\t\tmessageSequence += 1;\n\t\t\tconst id = `message-${messageSequence}`;\n\t\t\tentries.push({ id, type: \"message\", message });\n\t\t\treturn id;\n\t\t},\n\t\tloopHook: (position) => loopHooks.find((hook) => hook.position === position),\n\t\tdispatchLifecycleEvent: async (event) => {\n\t\t\tconst version = event.version ?? 1;\n\t\t\tconst list = lifecycleObservers.get(lifecycleKeyOf(event.id, version)) ?? [];\n\t\t\tdeliverySequence += 1;\n\t\t\tconst lifecycleEvent: LifecycleEvent<unknown> = {\n\t\t\t\tid: event.id,\n\t\t\t\tdeliveryId: `test-delivery-${deliverySequence}`,\n\t\t\t\ttype: event.id,\n\t\t\t\tversion,\n\t\t\t\tphase: \"committed\",\n\t\t\t\tsource: \"test\",\n\t\t\t\ttimestamp: 0,\n\t\t\t\tdata: event.data,\n\t\t\t};\n\t\t\tfor (const handler of list) await handler(lifecycleEvent);\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-sleep.d.ts","sourceRoot":"","sources":["../../src/utils/sync-sleep.ts"],"names":[],"mappings":"AAQA,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE1C","sourcesContent":["/**\n * Synchronous poll sleep: Node allows a blocking {@link Atomics.wait} on any\n * thread, so synchronous APIs that poll under a cross-process lock (the memory\n * ledger's append lock, the durable store backend's persist lock) can block\n * the bounded wait instead of deferring to a timer.\n */\nconst lockSleepBuffer = new Int32Array(new SharedArrayBuffer(4));\n\nexport function sleepSync(ms: number): void {\n\tAtomics.wait(lockSleepBuffer, 0, 0, ms);\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synchronous poll sleep: Node allows a blocking {@link Atomics.wait} on any
|
|
3
|
+
* thread, so synchronous APIs that poll under a cross-process lock (the memory
|
|
4
|
+
* ledger's append lock, the durable store backend's persist lock) can block
|
|
5
|
+
* the bounded wait instead of deferring to a timer.
|
|
6
|
+
*/
|
|
7
|
+
const lockSleepBuffer = new Int32Array(new SharedArrayBuffer(4));
|
|
8
|
+
export function sleepSync(ms) {
|
|
9
|
+
Atomics.wait(lockSleepBuffer, 0, 0, ms);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=sync-sleep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-sleep.js","sourceRoot":"","sources":["../../src/utils/sync-sleep.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,UAAU,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjE,MAAM,UAAU,SAAS,CAAC,EAAU,EAAQ;IAC3C,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAAA,CACxC","sourcesContent":["/**\n * Synchronous poll sleep: Node allows a blocking {@link Atomics.wait} on any\n * thread, so synchronous APIs that poll under a cross-process lock (the memory\n * ledger's append lock, the durable store backend's persist lock) can block\n * the bounded wait instead of deferring to a timer.\n */\nconst lockSleepBuffer = new Int32Array(new SharedArrayBuffer(4));\n\nexport function sleepSync(ms: number): void {\n\tAtomics.wait(lockSleepBuffer, 0, 0, ms);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ai-agent-forge/plugin-memory",
|
|
3
|
+
"version": "0.85.0",
|
|
4
|
+
"description": "First-party memory capability plugin for Agent Forge (memory_write/recall/list/forget over the M5 Memory Foundation)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"agent-forge.json",
|
|
17
|
+
"plugin.json",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"clean": "shx rm -rf dist",
|
|
22
|
+
"build": "tsgo -p tsconfig.build.json",
|
|
23
|
+
"test": "vitest --run",
|
|
24
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"agent-forge",
|
|
28
|
+
"plugin",
|
|
29
|
+
"memory"
|
|
30
|
+
],
|
|
31
|
+
"author": "Agent Forge contributors",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/agent-forge/agent-forge.git",
|
|
36
|
+
"directory": "plugins/memory"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/agent-forge/agent-forge/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/agent-forge/agent-forge#readme",
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=22.19.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@agent-forge/plugin-sdk": "^0.85.0",
|
|
47
|
+
"@huggingface/transformers": "4.3.0",
|
|
48
|
+
"@lancedb/lancedb": "0.39.0",
|
|
49
|
+
"typebox": "1.3.27"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@agent-forge/agent-forge": "^0.85.0",
|
|
53
|
+
"shx": "0.4.0",
|
|
54
|
+
"vitest": "4.1.9"
|
|
55
|
+
}
|
|
56
|
+
}
|
package/plugin.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "agent-forge.plugin.memory",
|
|
3
|
+
"version": "0.84.4",
|
|
4
|
+
"apiVersion": "1-draft",
|
|
5
|
+
"entry": "./dist/entry.js",
|
|
6
|
+
"hostVersion": ">=0.84.4",
|
|
7
|
+
"requiredCapabilities": ["session", "events", "tools"],
|
|
8
|
+
"provides": [{ "id": "memory.scheduler", "version": 1, "kind": "service" }],
|
|
9
|
+
"config": {}
|
|
10
|
+
}
|