hippo-memory 1.63.2 → 1.64.1

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.
Files changed (280) hide show
  1. package/README.md +11 -5
  2. package/dist/agent-memories/claude-code.js +3 -3
  3. package/dist/ambient-store.d.ts +2 -0
  4. package/dist/ambient-store.js +4 -3
  5. package/dist/api/assemble.d.ts +2 -0
  6. package/dist/api/assemble.js +11 -7
  7. package/dist/api/auth.d.ts +15 -11
  8. package/dist/api/auth.js +116 -22
  9. package/dist/api/context-select.d.ts +5 -3
  10. package/dist/api/context-select.js +6 -11
  11. package/dist/api/context-types.d.ts +2 -1
  12. package/dist/api/context.d.ts +1 -1
  13. package/dist/api/context.js +79 -55
  14. package/dist/api/dormant.d.ts +5 -5
  15. package/dist/api/dormant.js +13 -9
  16. package/dist/api/drill-down.d.ts +2 -0
  17. package/dist/api/drill-down.js +12 -7
  18. package/dist/api/forget.d.ts +1 -1
  19. package/dist/api/forget.js +8 -4
  20. package/dist/api/learn.js +5 -3
  21. package/dist/api/outcome.d.ts +1 -1
  22. package/dist/api/outcome.js +2 -1
  23. package/dist/api/promote.js +8 -5
  24. package/dist/api/recall-types.d.ts +4 -2
  25. package/dist/api/recall.js +51 -36
  26. package/dist/api/remember.d.ts +7 -0
  27. package/dist/api/remember.js +26 -2
  28. package/dist/api/sleep-run.d.ts +28 -0
  29. package/dist/api/sleep-run.js +267 -0
  30. package/dist/api/sleep.d.ts +5 -45
  31. package/dist/api/sleep.js +5 -252
  32. package/dist/api/types.d.ts +5 -0
  33. package/dist/api/types.js +4 -0
  34. package/dist/audit-prune.js +1 -1
  35. package/dist/audit.d.ts +1 -3
  36. package/dist/audit.js +7 -103
  37. package/dist/auth.d.ts +48 -4
  38. package/dist/auth.js +111 -42
  39. package/dist/autolearn.js +2 -2
  40. package/dist/capture/caller-session.d.ts +16 -0
  41. package/dist/capture/caller-session.js +58 -0
  42. package/dist/capture/command.d.ts +19 -1
  43. package/dist/capture/command.js +28 -21
  44. package/dist/capture/compact-resume-caller.d.ts +11 -0
  45. package/dist/capture/compact-resume-caller.js +35 -0
  46. package/dist/capture/compact.d.ts +0 -14
  47. package/dist/capture/compact.js +7 -160
  48. package/dist/capture/compaction-items-caller.d.ts +16 -0
  49. package/dist/capture/compaction-items-caller.js +32 -0
  50. package/dist/capture/extract.d.ts +2 -14
  51. package/dist/capture/extract.js +135 -346
  52. package/dist/capture/failure-caller.d.ts +21 -0
  53. package/dist/capture/failure-caller.js +74 -0
  54. package/dist/capture/failure-reading.d.ts +44 -0
  55. package/dist/capture/failure-reading.js +78 -0
  56. package/dist/capture/pre-compact-caller.d.ts +16 -0
  57. package/dist/capture/pre-compact-caller.js +39 -0
  58. package/dist/capture/session-end-caller.d.ts +21 -0
  59. package/dist/capture/session-end-caller.js +30 -0
  60. package/dist/capture/session-texts.d.ts +14 -0
  61. package/dist/capture/session-texts.js +42 -0
  62. package/dist/capture/transcript.d.ts +6 -1
  63. package/dist/capture/transcript.js +20 -16
  64. package/dist/capture/working-state.d.ts +21 -0
  65. package/dist/capture/working-state.js +154 -0
  66. package/dist/capture-error.d.ts +8 -22
  67. package/dist/capture-error.js +9 -61
  68. package/dist/cli/audit.js +25 -0
  69. package/dist/cli/auth.js +4 -3
  70. package/dist/cli/context.js +13 -158
  71. package/dist/cli/continuity.js +2 -1
  72. package/dist/cli/init.js +5 -3
  73. package/dist/cli/last-sleep.d.ts +6 -0
  74. package/dist/cli/last-sleep.js +68 -0
  75. package/dist/cli/maintenance.d.ts +2 -1
  76. package/dist/cli/maintenance.js +17 -11
  77. package/dist/cli/quality-repair-once.d.ts +3 -0
  78. package/dist/cli/quality-repair-once.js +36 -0
  79. package/dist/cli/recall.js +2 -1
  80. package/dist/cli/remember.d.ts +2 -0
  81. package/dist/cli/remember.js +4 -1
  82. package/dist/cli/session-hooks.d.ts +0 -3
  83. package/dist/cli/session-hooks.js +12 -49
  84. package/dist/cli/setup.js +10 -2
  85. package/dist/cli/shared.d.ts +7 -14
  86. package/dist/cli/shared.js +19 -78
  87. package/dist/cli/sleep.js +6 -3
  88. package/dist/cli/usage.js +18 -9
  89. package/dist/cli.d.ts +1 -1
  90. package/dist/cli.js +3 -2
  91. package/dist/client.js +1 -1
  92. package/dist/compaction-record.d.ts +19 -1
  93. package/dist/compaction-record.js +61 -132
  94. package/dist/compaction-spool.d.ts +45 -0
  95. package/dist/compaction-spool.js +454 -0
  96. package/dist/config.d.ts +8 -0
  97. package/dist/config.js +49 -0
  98. package/dist/connectors/github/deletion.d.ts +1 -1
  99. package/dist/connectors/github/deletion.js +5 -17
  100. package/dist/consolidate/conflicts.js +4 -0
  101. package/dist/consolidate/flush-units.d.ts +9 -0
  102. package/dist/consolidate/flush-units.js +63 -0
  103. package/dist/consolidate/llm-passes.js +5 -4
  104. package/dist/consolidate/merge.js +5 -1
  105. package/dist/consolidate/run.d.ts +2 -1
  106. package/dist/consolidate/sleep.d.ts +2 -0
  107. package/dist/consolidate/sleep.js +82 -15
  108. package/dist/context-render.d.ts +14 -0
  109. package/dist/context-render.js +28 -0
  110. package/dist/dag.js +6 -0
  111. package/dist/dashboard-actions.js +3 -2
  112. package/dist/dashboard.js +4 -3
  113. package/dist/db/backup.d.ts +6 -0
  114. package/dist/db/backup.js +29 -0
  115. package/dist/db/busy.d.ts +9 -0
  116. package/dist/db/busy.js +35 -0
  117. package/dist/db/continuity.d.ts +1 -0
  118. package/dist/db/continuity.js +31 -4
  119. package/dist/db/meta.d.ts +2 -0
  120. package/dist/db/meta.js +7 -0
  121. package/dist/db/migrate.js +2 -3
  122. package/dist/db/migrations/index.d.ts +1 -1
  123. package/dist/db/migrations/index.js +5 -1
  124. package/dist/db/migrations/v39.js +2 -7
  125. package/dist/db/migrations/v53.d.ts +3 -0
  126. package/dist/db/migrations/v53.js +16 -0
  127. package/dist/db/migrations/v54.d.ts +3 -0
  128. package/dist/db/migrations/v54.js +25 -0
  129. package/dist/db/open.d.ts +11 -0
  130. package/dist/db/open.js +27 -0
  131. package/dist/db/tables.d.ts +2 -0
  132. package/dist/db/tables.js +6 -2
  133. package/dist/db.d.ts +2 -2
  134. package/dist/db.js +2 -2
  135. package/dist/doctor.d.ts +1 -1
  136. package/dist/doctor.js +31 -15
  137. package/dist/dormant.d.ts +16 -20
  138. package/dist/dormant.js +24 -30
  139. package/dist/embedding-provider.js +4 -3
  140. package/dist/entry/json-hooks.d.ts +3 -0
  141. package/dist/entry/json-hooks.js +4 -0
  142. package/dist/entry/project-identity.d.ts +2 -0
  143. package/dist/entry/project-identity.js +3 -0
  144. package/dist/entry/session-text.d.ts +7 -0
  145. package/dist/entry/session-text.js +8 -0
  146. package/dist/extract.js +6 -0
  147. package/dist/failure-log.d.ts +10 -2
  148. package/dist/failure-log.js +19 -2
  149. package/dist/gated-write.js +1 -1
  150. package/dist/graph/delta.d.ts +44 -0
  151. package/dist/graph/delta.js +109 -0
  152. package/dist/graph/types.d.ts +5 -0
  153. package/dist/graph/write.d.ts +20 -20
  154. package/dist/graph/write.js +103 -36
  155. package/dist/graph-extract.d.ts +43 -9
  156. package/dist/graph-extract.js +140 -157
  157. package/dist/graph-recall.d.ts +1 -0
  158. package/dist/graph-recall.js +2 -2
  159. package/dist/graph-view.d.ts +1 -0
  160. package/dist/graph-view.js +25 -2
  161. package/dist/half-life-migration.js +5 -1
  162. package/dist/handoff-evidence.d.ts +5 -0
  163. package/dist/handoff-evidence.js +30 -0
  164. package/dist/home-path.d.ts +5 -0
  165. package/dist/home-path.js +24 -0
  166. package/dist/hooks/json-hooks.d.ts +13 -2
  167. package/dist/hooks/json-hooks.js +246 -117
  168. package/dist/hooks/opencode.js +1 -1
  169. package/dist/hooks/shared.d.ts +2 -0
  170. package/dist/hooks/shared.js +6 -1
  171. package/dist/http-util.d.ts +16 -7
  172. package/dist/http-util.js +65 -20
  173. package/dist/importers/vault.js +2 -0
  174. package/dist/index.d.ts +2 -1
  175. package/dist/index.js +1 -0
  176. package/dist/json.d.ts +2 -0
  177. package/dist/json.js +7 -0
  178. package/dist/ledger-db.d.ts +10 -0
  179. package/dist/ledger-db.js +42 -0
  180. package/dist/local-embedding.d.ts +2 -0
  181. package/dist/local-embedding.js +20 -4
  182. package/dist/mcp/admin-tools.d.ts +2 -2
  183. package/dist/mcp/admin-tools.js +47 -5
  184. package/dist/mcp/memory-tools.js +7 -2
  185. package/dist/mcp/protocol.d.ts +6 -0
  186. package/dist/mcp/protocol.js +4 -2
  187. package/dist/mcp/recall-tools.js +19 -6
  188. package/dist/mcp/request.js +4 -0
  189. package/dist/mcp/session-state.d.ts +4 -0
  190. package/dist/mcp/session-state.js +15 -6
  191. package/dist/mcp/shared-gate.d.ts +4 -0
  192. package/dist/mcp/shared-gate.js +22 -0
  193. package/dist/mcp/tools.js +1 -0
  194. package/dist/memory-quality.d.ts +35 -0
  195. package/dist/memory-quality.js +191 -0
  196. package/dist/memory.d.ts +4 -4
  197. package/dist/physics-state.js +1 -1
  198. package/dist/pilot-arm.d.ts +14 -3
  199. package/dist/pilot-arm.js +32 -10
  200. package/dist/postinstall.js +2 -2
  201. package/dist/project-briefs.js +4 -4
  202. package/dist/project-identity.d.ts +14 -10
  203. package/dist/project-identity.js +29 -11
  204. package/dist/project-merge.d.ts +0 -2
  205. package/dist/project-merge.js +9 -13
  206. package/dist/prompt-hook.d.ts +65 -0
  207. package/dist/prompt-hook.js +213 -0
  208. package/dist/prompt-recall.js +1 -1
  209. package/dist/quality-repair.d.ts +27 -0
  210. package/dist/quality-repair.js +220 -0
  211. package/dist/rate-limit.d.ts +1 -0
  212. package/dist/rate-limit.js +5 -3
  213. package/dist/raw-archive.d.ts +1 -1
  214. package/dist/raw-archive.js +6 -16
  215. package/dist/recall-scope.d.ts +28 -5
  216. package/dist/recall-scope.js +52 -7
  217. package/dist/recall-trace.js +1 -1
  218. package/dist/reject-flow.d.ts +2 -0
  219. package/dist/reject-flow.js +20 -6
  220. package/dist/secret-detect.js +7 -8
  221. package/dist/server/auth.d.ts +8 -6
  222. package/dist/server/auth.js +85 -38
  223. package/dist/server/client-ip.d.ts +2 -0
  224. package/dist/server/client-ip.js +16 -1
  225. package/dist/server/mcp-http.d.ts +9 -3
  226. package/dist/server/mcp-http.js +56 -13
  227. package/dist/server/request.d.ts +1 -1
  228. package/dist/server/request.js +5 -5
  229. package/dist/server/routes/admin.js +12 -6
  230. package/dist/server/routes/memories.js +9 -1
  231. package/dist/server/routes/recall.js +14 -2
  232. package/dist/server/types.d.ts +42 -5
  233. package/dist/server/validation.d.ts +5 -2
  234. package/dist/server/validation.js +19 -2
  235. package/dist/server.d.ts +21 -4
  236. package/dist/server.js +207 -49
  237. package/dist/session-digest.d.ts +0 -1
  238. package/dist/session-digest.js +3 -12
  239. package/dist/session-owners.d.ts +7 -0
  240. package/dist/session-owners.js +54 -0
  241. package/dist/share-scrub.d.ts +3 -0
  242. package/dist/share-scrub.js +8 -0
  243. package/dist/shared.d.ts +1 -0
  244. package/dist/shared.js +26 -18
  245. package/dist/store/candidates.d.ts +14 -3
  246. package/dist/store/candidates.js +48 -26
  247. package/dist/store/conflicts.d.ts +15 -0
  248. package/dist/store/conflicts.js +68 -44
  249. package/dist/store/delete-and-batch.d.ts +25 -1
  250. package/dist/store/delete-and-batch.js +121 -69
  251. package/dist/store/entry-reads.d.ts +5 -6
  252. package/dist/store/entry-reads.js +24 -12
  253. package/dist/store/entry-row.d.ts +7 -10
  254. package/dist/store/entry-row.js +40 -18
  255. package/dist/store/entry-writes.d.ts +3 -3
  256. package/dist/store/entry-writes.js +9 -23
  257. package/dist/store/handoffs.d.ts +9 -6
  258. package/dist/store/handoffs.js +72 -59
  259. package/dist/store/index-and-stats.js +2 -2
  260. package/dist/store/open.d.ts +3 -1
  261. package/dist/store/open.js +3 -3
  262. package/dist/store/search-rows.d.ts +8 -5
  263. package/dist/store/search-rows.js +15 -18
  264. package/dist/store/sessions.d.ts +25 -6
  265. package/dist/store/sessions.js +61 -19
  266. package/dist/store/summaries.d.ts +1 -1
  267. package/dist/store/summaries.js +3 -18
  268. package/dist/store/tenant-lookup.d.ts +7 -3
  269. package/dist/store/tenant-lookup.js +9 -9
  270. package/dist/store-port.d.ts +13 -0
  271. package/dist/store-port.js +20 -0
  272. package/dist/version.d.ts +5 -1
  273. package/dist/version.js +5 -1
  274. package/dist/working-memory.js +1 -1
  275. package/dist/write-budget.d.ts +15 -0
  276. package/dist/write-budget.js +15 -0
  277. package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
  278. package/extensions/openclaw-plugin/package.json +1 -1
  279. package/openclaw.plugin.json +1 -1
  280. package/package.json +8 -4
@@ -1,4 +1,4 @@
1
- import { closeHippoDb } from '../db.js';
1
+ import { closeHippoDb, withWriteScope } from '../db.js';
2
2
  import { assertTenantId } from '../tenant.js';
3
3
  import { findRejectedValue, rejectionDigest } from '../rejection.js';
4
4
  import { log } from '../log.js';
@@ -173,7 +173,7 @@ export function loadChildrenOfSummary(hippoRoot, summaryId, tenantId) {
173
173
  }
174
174
  /**
175
175
  * Apply a rebuild result to a dirty summary. Atomic: one
176
- * prepared UPDATE statement plus syncFtsRow inside one SAVEPOINT.
176
+ * prepared UPDATE statement plus syncFtsRow inside one write scope.
177
177
  * WHERE includes `AND summary_dirty = 1` so concurrent sleep's race-loser
178
178
  * becomes a no-op (no rebuild_count bump, no audit row).
179
179
  *
@@ -187,22 +187,7 @@ export function applyRebuildResult(hippoRoot, summary, patch) {
187
187
  assertTenantId('applyRebuildResult', summary.tenantId);
188
188
  const db = openStore(hippoRoot);
189
189
  try {
190
- db.exec('SAVEPOINT rebuild_summary');
191
- try {
192
- const outcome = applyRebuildInSavepoint(db, summary, patch);
193
- db.exec('RELEASE SAVEPOINT rebuild_summary');
194
- return outcome;
195
- }
196
- catch (e) {
197
- try {
198
- db.exec('ROLLBACK TO SAVEPOINT rebuild_summary');
199
- db.exec('RELEASE SAVEPOINT rebuild_summary');
200
- }
201
- catch {
202
- // Ignore rollback failures — throw below is what matters.
203
- }
204
- throw e;
205
- }
190
+ return withWriteScope(db, 'rebuild_summary', () => applyRebuildInSavepoint(db, summary, patch));
206
191
  }
207
192
  finally {
208
193
  closeHippoDb(db);
@@ -1,12 +1,16 @@
1
1
  import type { DatabaseSyncLike } from '../db.js';
2
- /** The api_keys fields a tenant, revocation or rank check reads. */
2
+ /** The api_keys fields a tenant, revocation, rank or self-service ownership check reads. */
3
3
  export interface ApiKeyOwner {
4
4
  tenantId: string;
5
5
  revokedAt: string | null;
6
6
  role: string;
7
+ ownerSubject: string | null;
7
8
  }
8
9
  /** The owner row of `keyId`, or undefined when no such key exists. */
9
10
  export declare function selectApiKeyOwner(db: DatabaseSyncLike, keyId: string): ApiKeyOwner | undefined;
10
- /** The tenant that owns memory `id`, or undefined when no such memory exists. */
11
- export declare function selectMemoryTenant(db: DatabaseSyncLike, id: string): string | undefined;
11
+ /** Who may reach memory `id`: its tenant and scope, or undefined when no such memory exists. */
12
+ export declare function selectMemoryReach(db: DatabaseSyncLike, id: string): {
13
+ tenantId: string;
14
+ scope: string | null;
15
+ } | undefined;
12
16
  //# sourceMappingURL=tenant-lookup.d.ts.map
@@ -1,16 +1,16 @@
1
- // Owner lookups by id: the tenant checks in src/api and the CLI's key-tenant lookup share these queries.
1
+ // Owner lookups by id: the tenant and scope checks in src/api and the CLI's key-tenant lookup share these queries.
2
2
  /** The owner row of `keyId`, or undefined when no such key exists. */
3
3
  export function selectApiKeyOwner(db, keyId) {
4
- // SAFETY: row's shape matches the three columns named in the SELECT.
4
+ // SAFETY: row's shape matches the four columns named in the SELECT.
5
5
  const row = db
6
- .prepare(`SELECT tenant_id, revoked_at, role FROM api_keys WHERE key_id = ?`)
6
+ .prepare(`SELECT tenant_id, revoked_at, role, owner_subject FROM api_keys WHERE key_id = ?`)
7
7
  .get(keyId);
8
- return row && { tenantId: row.tenant_id, revokedAt: row.revoked_at, role: row.role };
8
+ return row && { tenantId: row.tenant_id, revokedAt: row.revoked_at, role: row.role, ownerSubject: row.owner_subject };
9
9
  }
10
- /** The tenant that owns memory `id`, or undefined when no such memory exists. */
11
- export function selectMemoryTenant(db, id) {
12
- // SAFETY: row's shape matches the single tenant_id column named in the SELECT.
13
- const row = db.prepare(`SELECT tenant_id FROM memories WHERE id = ?`).get(id);
14
- return row?.tenant_id;
10
+ /** Who may reach memory `id`: its tenant and scope, or undefined when no such memory exists. */
11
+ export function selectMemoryReach(db, id) {
12
+ // SAFETY: row's shape matches the tenant_id and scope columns named in the SELECT.
13
+ const row = db.prepare(`SELECT tenant_id, scope FROM memories WHERE id = ?`).get(id);
14
+ return row && { tenantId: row.tenant_id, scope: row.scope };
15
15
  }
16
16
  //# sourceMappingURL=tenant-lookup.js.map
@@ -0,0 +1,13 @@
1
+ import { type ApiKeyRecord } from './auth.js';
2
+ /** What `serve()` reads and writes through. Each method is atomic and no transaction spans an await, since SQLite's lock wait blocks the event loop; a lock timeout throws `StoreBusyError`. */
3
+ export interface HippoStore {
4
+ /** 'sqlite' is hippo.db under the served root. Under any other kind, an unported route answers 501 and a hippo.db open inside a request throws. */
5
+ readonly kind: string;
6
+ /** The api_keys row for `keyId` with its scope grants, revoked or not; null when no row matches. */
7
+ findApiKey(keyId: string): Promise<ApiKeyRecord | null>;
8
+ /** Releases the store's connections; `serve()` closes only a store it made itself. */
9
+ close(): Promise<void>;
10
+ }
11
+ /** The built-in store: today's synchronous hippo.db functions behind the port, one handle per call, so close has nothing to release. */
12
+ export declare function sqliteStore(hippoRoot: string): HippoStore;
13
+ //# sourceMappingURL=store-port.d.ts.map
@@ -0,0 +1,20 @@
1
+ // The async seam the server reaches its store through, so an add-on can serve from a database other than hippo.db.
2
+ import { readApiKeyRecord } from './auth.js';
3
+ import { closeHippoDb, openHippoDb } from './db.js';
4
+ /** The built-in store: today's synchronous hippo.db functions behind the port, one handle per call, so close has nothing to release. */
5
+ export function sqliteStore(hippoRoot) {
6
+ return {
7
+ kind: 'sqlite',
8
+ async findApiKey(keyId) {
9
+ const db = openHippoDb(hippoRoot);
10
+ try {
11
+ return readApiKeyRecord(db, keyId);
12
+ }
13
+ finally {
14
+ closeHippoDb(db);
15
+ }
16
+ },
17
+ async close() { },
18
+ };
19
+ }
20
+ //# sourceMappingURL=store-port.js.map
package/dist/version.d.ts CHANGED
@@ -16,7 +16,11 @@
16
16
  * an ESM `import` can resolve cleanly, and a hardcoded constant survives
17
17
  * any packager that drops .json files.
18
18
  */
19
- export declare const PACKAGE_VERSION = "1.63.2";
19
+ export declare const PACKAGE_VERSION = "1.64.1";
20
+ /** The floor a store takes on its first expiring key: the first release with schema v53, set by hand in that release; scripts/check-expiring-keys-floor.mjs gates it. */
21
+ export declare const EXPIRING_KEYS_MIN_BINARY = "1.64.0";
22
+ /** The floor a store takes on its first session bind or owner snapshot: first release with v54; set by hand in that release. */
23
+ export declare const TASK_OWNER_MIN_BINARY = "1.64.0";
20
24
  /** Compares plain x.y.z versions, positive if a > b; tags throw so the rollback guard never misfires silently. */
21
25
  export declare function compareSemver(a: string, b: string): number;
22
26
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -16,7 +16,11 @@
16
16
  * an ESM `import` can resolve cleanly, and a hardcoded constant survives
17
17
  * any packager that drops .json files.
18
18
  */
19
- export const PACKAGE_VERSION = '1.63.2';
19
+ export const PACKAGE_VERSION = '1.64.1';
20
+ /** The floor a store takes on its first expiring key: the first release with schema v53, set by hand in that release; scripts/check-expiring-keys-floor.mjs gates it. */
21
+ export const EXPIRING_KEYS_MIN_BINARY = '1.64.0';
22
+ /** The floor a store takes on its first session bind or owner snapshot: first release with v54; set by hand in that release. */
23
+ export const TASK_OWNER_MIN_BINARY = '1.64.0';
20
24
  /** Compares plain x.y.z versions, positive if a > b; tags throw so the rollback guard never misfires silently. */
21
25
  export function compareSemver(a, b) {
22
26
  const parse = (v) => {
@@ -42,7 +42,7 @@ export function wmPush(hippoRoot, opts) {
42
42
  try {
43
43
  const now = new Date().toISOString();
44
44
  const importance = opts.importance ?? 0;
45
- db.exec('BEGIN');
45
+ db.exec('BEGIN IMMEDIATE');
46
46
  try {
47
47
  const result = db.prepare(`
48
48
  INSERT INTO working_memory(scope, session_id, task_id, importance, content, metadata_json, created_at, updated_at)
@@ -0,0 +1,15 @@
1
+ /** A chunk closes at the first unit boundary after this long: a server request gives up after a 250 ms wait. */
2
+ export declare const TARGET_HOLD_MS = 100;
3
+ /** SQLite's longest busy-handler sleep under a hook's 1 s wait, so a waiting hook always wakes inside the gap. */
4
+ export declare const GAP_MS = 100;
5
+ export declare function clock(): number;
6
+ /** Waits until GAP_MS have passed since the last commit; always yields once, so timers and requests run between chunks. */
7
+ export declare function pauseForWaiters(lastCommitAt: number): Promise<void>;
8
+ /** The hold, clock and pause a chunked write runs on; a test passes its own to force chunk boundaries without real waits. */
9
+ export interface WriteBudget {
10
+ readonly holdMs: number;
11
+ readonly clock: () => number;
12
+ readonly pause: (lastCommitAt: number) => Promise<void>;
13
+ }
14
+ export declare const WRITE_BUDGET: WriteBudget;
15
+ //# sourceMappingURL=write-budget.d.ts.map
@@ -0,0 +1,15 @@
1
+ // How long a long-running write may hold the store's write lock per transaction, and how long it lets other writers in after.
2
+ import { setTimeout as delay } from 'node:timers/promises';
3
+ /** A chunk closes at the first unit boundary after this long: a server request gives up after a 250 ms wait. */
4
+ export const TARGET_HOLD_MS = 100;
5
+ /** SQLite's longest busy-handler sleep under a hook's 1 s wait, so a waiting hook always wakes inside the gap. */
6
+ export const GAP_MS = 100;
7
+ export function clock() {
8
+ return performance.now();
9
+ }
10
+ /** Waits until GAP_MS have passed since the last commit; always yields once, so timers and requests run between chunks. */
11
+ export async function pauseForWaiters(lastCommitAt) {
12
+ await delay(Math.max(0, GAP_MS - (clock() - lastCommitAt)));
13
+ }
14
+ export const WRITE_BUDGET = { holdMs: TARGET_HOLD_MS, clock, pause: pauseForWaiters };
15
+ //# sourceMappingURL=write-budget.js.map
@@ -2,7 +2,7 @@
2
2
  "id": "hippo-memory",
3
3
  "name": "Hippo Memory",
4
4
  "description": "Make your agent's memory work like a brain. Hippo is long-term memory for coding agents.",
5
- "version": "1.63.2",
5
+ "version": "1.64.1",
6
6
 
7
7
  "configSchema": {
8
8
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hippo-memory",
3
- "version": "1.63.2",
3
+ "version": "1.64.1",
4
4
  "type": "module",
5
5
  "description": "Make your agent's memory work like a brain. Hippo is long-term memory for coding agents.",
6
6
  "main": "index.ts",
@@ -2,7 +2,7 @@
2
2
  "id": "hippo-memory",
3
3
  "name": "Hippo Memory",
4
4
  "description": "Make your agent's memory work like a brain. Hippo is long-term memory for coding agents.",
5
- "version": "1.63.2",
5
+ "version": "1.64.1",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "hippo-memory",
3
- "version": "1.63.2",
3
+ "version": "1.64.1",
4
4
  "description": "Make your agent's memory work like a brain. Hippo is long-term memory for coding agents.",
5
5
  "mcpName": "io.github.kitfunso/hippo-memory",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "exports": {
9
9
  ".": "./dist/index.js",
10
- "./server": "./dist/server.js"
10
+ "./server": "./dist/server.js",
11
+ "./project-identity": "./dist/entry/project-identity.js",
12
+ "./json-hooks": "./dist/entry/json-hooks.js",
13
+ "./session-text": "./dist/entry/session-text.js"
11
14
  },
12
15
  "openclaw": {
13
16
  "extensions": [
@@ -37,6 +40,7 @@
37
40
  "test:watch": "vitest",
38
41
  "test:coverage": "vitest run --coverage",
39
42
  "test:delivery-ledger": "vitest run tests/delivery-ledger",
43
+ "test:eval": "vitest run --config vitest.eval.config.ts",
40
44
  "lint": "oxlint",
41
45
  "sbom": "node scripts/sbom.mjs",
42
46
  "audit:security": "npm audit --audit-level=high && npm --prefix ui audit --audit-level=high",
@@ -45,8 +49,8 @@
45
49
  "smoke:openclaw-install": "node scripts/smoke-openclaw-install.mjs",
46
50
  "build:ui": "cd ui && npm install && npm run build",
47
51
  "build:all": "npm run build && npm run build:ui",
48
- "version": "node scripts/sync-version.mjs && node scripts/check-manifest-versions.mjs",
49
- "prepublishOnly": "node scripts/check-manifest-versions.mjs && node scripts/changelog-fragments.mjs check && node scripts/check-em-dashes-in-release-notes.mjs && node scripts/check-graph-writes.mjs && npm run build:all && node scripts/check-openclaw-dist.mjs && npm run smoke:openclaw-install && node scripts/check-tests-pass.mjs"
52
+ "version": "node scripts/sync-version.mjs && node scripts/check-manifest-versions.mjs && node scripts/check-expiring-keys-floor.mjs",
53
+ "prepublishOnly": "node scripts/check-manifest-versions.mjs && node scripts/check-expiring-keys-floor.mjs && node scripts/changelog-fragments.mjs check && node scripts/check-em-dashes-in-release-notes.mjs && node scripts/check-graph-writes.mjs && npm run build:all && node scripts/check-openclaw-dist.mjs && npm run smoke:openclaw-install && node scripts/check-tests-pass.mjs"
50
54
  },
51
55
  "keywords": [
52
56
  "memory",