agent-working-memory 0.17.0 → 0.19.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 +8 -5
- package/dist/adapters/common.d.ts +34 -0
- package/dist/adapters/common.d.ts.map +1 -1
- package/dist/adapters/common.js +528 -446
- package/dist/adapters/common.js.map +1 -1
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +19 -0
- package/dist/api/routes.js.map +1 -1
- package/dist/cli/migrate.d.ts.map +1 -1
- package/dist/cli/migrate.js +31 -29
- package/dist/cli/migrate.js.map +1 -1
- package/dist/core/asked-value.d.ts +37 -0
- package/dist/core/asked-value.d.ts.map +1 -0
- package/dist/core/asked-value.js +77 -0
- package/dist/core/asked-value.js.map +1 -0
- package/dist/core/conflicts.d.ts +89 -0
- package/dist/core/conflicts.d.ts.map +1 -0
- package/dist/core/conflicts.js +267 -0
- package/dist/core/conflicts.js.map +1 -0
- package/dist/core/embeddings.d.ts +14 -2
- package/dist/core/embeddings.d.ts.map +1 -1
- package/dist/core/embeddings.js +32 -10
- package/dist/core/embeddings.js.map +1 -1
- package/dist/core/format-recall.d.ts +21 -1
- package/dist/core/format-recall.d.ts.map +1 -1
- package/dist/core/format-recall.js +60 -5
- package/dist/core/format-recall.js.map +1 -1
- package/dist/core/ml-worker.d.ts +24 -1
- package/dist/core/ml-worker.d.ts.map +1 -1
- package/dist/core/ml-worker.js +165 -4
- package/dist/core/ml-worker.js.map +1 -1
- package/dist/core/model-daemon-client.d.ts +77 -0
- package/dist/core/model-daemon-client.d.ts.map +1 -0
- package/dist/core/model-daemon-client.js +383 -0
- package/dist/core/model-daemon-client.js.map +1 -0
- package/dist/core/model-daemon-server.d.ts +71 -0
- package/dist/core/model-daemon-server.d.ts.map +1 -0
- package/dist/core/model-daemon-server.js +363 -0
- package/dist/core/model-daemon-server.js.map +1 -0
- package/dist/core/model-daemon.d.ts +137 -0
- package/dist/core/model-daemon.d.ts.map +1 -0
- package/dist/core/model-daemon.js +231 -0
- package/dist/core/model-daemon.js.map +1 -0
- package/dist/core/query-expander.d.ts +5 -0
- package/dist/core/query-expander.d.ts.map +1 -1
- package/dist/core/query-expander.js +3 -2
- package/dist/core/query-expander.js.map +1 -1
- package/dist/core/recall-config.d.ts +1 -1
- package/dist/core/recall-config.d.ts.map +1 -1
- package/dist/core/recall-config.js +5 -0
- package/dist/core/recall-config.js.map +1 -1
- package/dist/core/rerank-window.d.ts +7 -2
- package/dist/core/rerank-window.d.ts.map +1 -1
- package/dist/core/rerank-window.js +9 -4
- package/dist/core/rerank-window.js.map +1 -1
- package/dist/core/rerank2.d.ts +52 -2
- package/dist/core/rerank2.d.ts.map +1 -1
- package/dist/core/rerank2.js +60 -3
- package/dist/core/rerank2.js.map +1 -1
- package/dist/core/reranker.d.ts +19 -0
- package/dist/core/reranker.d.ts.map +1 -1
- package/dist/core/reranker.js +90 -13
- package/dist/core/reranker.js.map +1 -1
- package/dist/core/trust.d.ts +32 -0
- package/dist/core/trust.d.ts.map +1 -0
- package/dist/core/trust.js +66 -0
- package/dist/core/trust.js.map +1 -0
- package/dist/core/validity.d.ts +21 -0
- package/dist/core/validity.d.ts.map +1 -0
- package/dist/core/validity.js +41 -0
- package/dist/core/validity.js.map +1 -0
- package/dist/core/whoami.d.ts +3 -0
- package/dist/core/whoami.d.ts.map +1 -1
- package/dist/core/whoami.js +14 -0
- package/dist/core/whoami.js.map +1 -1
- package/dist/core/write-pipeline.d.ts +48 -0
- package/dist/core/write-pipeline.d.ts.map +1 -1
- package/dist/core/write-pipeline.js +80 -3
- package/dist/core/write-pipeline.js.map +1 -1
- package/dist/engine/activation.d.ts.map +1 -1
- package/dist/engine/activation.js +27 -4
- package/dist/engine/activation.js.map +1 -1
- package/dist/engine/consolidation.d.ts.map +1 -1
- package/dist/engine/consolidation.js +53 -4
- package/dist/engine/consolidation.js.map +1 -1
- package/dist/hooks/prime-query.d.ts +57 -0
- package/dist/hooks/prime-query.d.ts.map +1 -0
- package/dist/hooks/prime-query.js +388 -0
- package/dist/hooks/prime-query.js.map +1 -0
- package/dist/hooks/prime.d.ts +8 -0
- package/dist/hooks/prime.d.ts.map +1 -1
- package/dist/hooks/prime.js +21 -2
- package/dist/hooks/prime.js.map +1 -1
- package/dist/hooks/sidecar.d.ts +18 -0
- package/dist/hooks/sidecar.d.ts.map +1 -1
- package/dist/hooks/sidecar.js +58 -2
- package/dist/hooks/sidecar.js.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +157 -104
- package/dist/mcp.js.map +1 -1
- package/dist/model-daemon.d.ts +8 -0
- package/dist/model-daemon.d.ts.map +1 -0
- package/dist/model-daemon.js +45 -0
- package/dist/model-daemon.js.map +1 -0
- package/dist/storage/factory.d.ts.map +1 -1
- package/dist/storage/factory.js +5 -0
- package/dist/storage/factory.js.map +1 -1
- package/dist/storage/pglite-schema.d.ts.map +1 -1
- package/dist/storage/pglite-schema.js +176 -170
- package/dist/storage/pglite-schema.js.map +1 -1
- package/dist/storage/pglite.d.ts +5 -0
- package/dist/storage/pglite.d.ts.map +1 -1
- package/dist/storage/pglite.js +165 -153
- package/dist/storage/pglite.js.map +1 -1
- package/dist/storage/postgres.d.ts +5 -0
- package/dist/storage/postgres.d.ts.map +1 -1
- package/dist/storage/postgres.js +165 -153
- package/dist/storage/postgres.js.map +1 -1
- package/dist/storage/sqlite.d.ts +22 -0
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +415 -363
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/types/engram.d.ts +33 -0
- package/dist/types/engram.d.ts.map +1 -1
- package/dist/types/engram.js.map +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/README.md +1 -1
- package/plugin/bin/awm-mcp-launcher.cjs +2 -2
- package/plugin/skills/awm-memory/SKILL.md +11 -2
- package/src/adapters/common.ts +881 -802
- package/src/api/routes.ts +20 -0
- package/src/cli/migrate.ts +309 -307
- package/src/core/asked-value.ts +74 -0
- package/src/core/conflicts.ts +280 -0
- package/src/core/embeddings.ts +35 -10
- package/src/core/format-recall.ts +83 -25
- package/src/core/ml-worker.ts +458 -281
- package/src/core/model-daemon-client.ts +374 -0
- package/src/core/model-daemon-server.ts +344 -0
- package/src/core/model-daemon.ts +243 -0
- package/src/core/query-expander.ts +127 -126
- package/src/core/recall-config.ts +5 -0
- package/src/core/rerank-window.ts +164 -159
- package/src/core/rerank2.ts +143 -82
- package/src/core/reranker.ts +92 -12
- package/src/core/trust.ts +65 -0
- package/src/core/validity.ts +47 -0
- package/src/core/whoami.ts +136 -120
- package/src/core/write-pipeline.ts +119 -3
- package/src/engine/activation.ts +27 -4
- package/src/engine/consolidation.ts +950 -899
- package/src/hooks/prime-query.ts +375 -0
- package/src/hooks/prime.ts +25 -2
- package/src/hooks/sidecar.ts +57 -3
- package/src/index.ts +258 -248
- package/src/mcp.ts +1529 -1475
- package/src/model-daemon.ts +48 -0
- package/src/storage/factory.ts +25 -19
- package/src/storage/pglite-schema.ts +199 -193
- package/src/storage/pglite.ts +1513 -1498
- package/src/storage/postgres.ts +1613 -1598
- package/src/storage/sqlite.ts +2069 -2019
- package/src/types/engram.ts +30 -0
package/src/api/routes.ts
CHANGED
|
@@ -51,8 +51,11 @@ import type { TaskStatus, TaskPriority } from '../types/engram.js';
|
|
|
51
51
|
import type { ConsciousState } from '../types/checkpoint.js';
|
|
52
52
|
import { DEFAULT_AGENT_CONFIG } from '../types/agent.js';
|
|
53
53
|
import { embed, embedBatch, embeddingHealth } from '../core/embeddings.js';
|
|
54
|
+
import { modelDaemonStatus } from '../core/ml-worker.js';
|
|
54
55
|
import { VERSION } from '../version.js';
|
|
55
56
|
import { activeRecallConfig, recallConfigFingerprint } from '../core/recall-config.js';
|
|
57
|
+
import { isLiveStorePath } from '../adapters/common.js';
|
|
58
|
+
import { getConfiguredPath } from '../storage/factory.js';
|
|
56
59
|
|
|
57
60
|
export interface MemoryDeps {
|
|
58
61
|
store: EngramStore;
|
|
@@ -124,6 +127,7 @@ export function registerRoutes(app: FastifyInstance, deps: MemoryDeps): void {
|
|
|
124
127
|
recipeId?: string; recipe_id?: string;
|
|
125
128
|
validFrom?: string; valid_from?: string;
|
|
126
129
|
validTo?: string; valid_to?: string;
|
|
130
|
+
correction?: boolean;
|
|
127
131
|
};
|
|
128
132
|
|
|
129
133
|
if (!body.agentId || typeof body.agentId !== 'string' ||
|
|
@@ -168,6 +172,9 @@ export function registerRoutes(app: FastifyInstance, deps: MemoryDeps): void {
|
|
|
168
172
|
eventType: body.eventType,
|
|
169
173
|
surprise: body.surprise,
|
|
170
174
|
decisionMade: body.decisionMade,
|
|
175
|
+
// Parity with the MCP write path — the intent→salience mapping is in
|
|
176
|
+
// write-pipeline.ts so both surfaces cannot drift apart.
|
|
177
|
+
intent: body.intent,
|
|
171
178
|
causalDepth: body.causalDepth,
|
|
172
179
|
resolutionEffort: body.resolutionEffort,
|
|
173
180
|
confidence: body.confidence,
|
|
@@ -179,6 +186,7 @@ export function registerRoutes(app: FastifyInstance, deps: MemoryDeps): void {
|
|
|
179
186
|
recipeId: body.recipeId ?? body.recipe_id,
|
|
180
187
|
validFrom: body.validFrom ?? body.valid_from,
|
|
181
188
|
validTo: body.validTo ?? body.valid_to,
|
|
189
|
+
correction: body.correction === true,
|
|
182
190
|
});
|
|
183
191
|
|
|
184
192
|
// Auto-checkpoint always (covers create, reinforce, and supersede).
|
|
@@ -982,6 +990,15 @@ export function registerRoutes(app: FastifyInstance, deps: MemoryDeps): void {
|
|
|
982
990
|
fingerprint: recallConfigFingerprint(),
|
|
983
991
|
flags: activeRecallConfig(),
|
|
984
992
|
},
|
|
993
|
+
// Is this server pointed at the LIVE store? (A-3, 2026-10-12.) Same purpose
|
|
994
|
+
// as the recall fingerprint above: a benchmark that WRITES must be able to
|
|
995
|
+
// refuse a server whose store is the user's real one, loudly, instead of
|
|
996
|
+
// silently contaminating it. 4,745 fixture engrams were purged from the live
|
|
997
|
+
// store on 2026-10-11, and nine real memories sat among them. A boolean, not
|
|
998
|
+
// the path — the caller only needs to know whether to stop.
|
|
999
|
+
store: {
|
|
1000
|
+
live: isLiveStorePath(getConfiguredPath()),
|
|
1001
|
+
},
|
|
985
1002
|
// Embedding-corpus integrity. A dimension mismatch scores 0 on the vector
|
|
986
1003
|
// channel for the affected memories — recall still answers, just much worse,
|
|
987
1004
|
// with no error anywhere. Reported here so "why did quality drop" has somewhere
|
|
@@ -989,6 +1006,9 @@ export function registerRoutes(app: FastifyInstance, deps: MemoryDeps): void {
|
|
|
989
1006
|
...(embeddingHealth().dimensionMismatches > 0
|
|
990
1007
|
? { embeddingIntegrity: { status: 'degraded' as const, ...embeddingHealth() } }
|
|
991
1008
|
: {}),
|
|
1009
|
+
// Where inference runs (AWM_MODEL_DAEMON=1): the shared daemon, or this process
|
|
1010
|
+
// after a fallback, with the count and reason. Absent when the daemon is off.
|
|
1011
|
+
...(modelDaemonStatus().enabled ? { models: modelDaemonStatus() } : {}),
|
|
992
1012
|
// D15 (2026-07-30): consolidation visibility — finishes the long-unwired
|
|
993
1013
|
// "DMN endpoint" (May P2). Answers "is a sleep cycle running right now
|
|
994
1014
|
// and is the scheduler even on" without reading logs.
|