@hasna/mementos 0.14.88 → 0.16.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 +119 -30
- package/bun.lock +4 -65
- package/dist/audit-contract.d.ts +87 -0
- package/dist/audit-contract.d.ts.map +1 -0
- package/dist/cli/commands/info-context.d.ts.map +1 -1
- package/dist/cli/commands/info-history.d.ts.map +1 -1
- package/dist/cli/commands/info-stale.d.ts.map +1 -1
- package/dist/cli/commands/io-backup.d.ts.map +1 -1
- package/dist/cli/commands/io-export.d.ts.map +1 -1
- package/dist/cli/commands/io-restore.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-chain.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-crud.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-list.d.ts +25 -0
- package/dist/cli/commands/memory-cmd-list.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-recall.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-search.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-tail.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-view.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-when-to-use.d.ts.map +1 -1
- package/dist/cli/commands/project.d.ts.map +1 -1
- package/dist/cli/commands/storage.d.ts.map +1 -1
- package/dist/cli/commands/system-doctor.d.ts.map +1 -1
- package/dist/cli/commands/system-session.d.ts.map +1 -1
- package/dist/cli/commands/system-status.d.ts +43 -0
- package/dist/cli/commands/system-status.d.ts.map +1 -0
- package/dist/cli/commands/system-synthesized-profile.d.ts.map +1 -1
- package/dist/cli/commands/system.d.ts.map +1 -1
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.js +4964 -2168
- package/dist/cli/register-all.d.ts +1 -1
- package/dist/cli/register-all.d.ts.map +1 -1
- package/dist/db/api-mode.d.ts +145 -37
- package/dist/db/api-mode.d.ts.map +1 -1
- package/dist/db/api-response-contract.d.ts +23 -0
- package/dist/db/api-response-contract.d.ts.map +1 -0
- package/dist/db/audit.d.ts +34 -45
- package/dist/db/audit.d.ts.map +1 -1
- package/dist/db/database.d.ts +1 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/locks.d.ts.map +1 -1
- package/dist/db/machines.d.ts +50 -13
- package/dist/db/machines.d.ts.map +1 -1
- package/dist/db/memories.d.ts.map +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/pg-migrate.d.ts.map +1 -1
- package/dist/db/pg-migrations.d.ts.map +1 -1
- package/dist/db/session-jobs.d.ts +2 -0
- package/dist/db/session-jobs.d.ts.map +1 -1
- package/dist/db/store-backend.d.ts +8 -2
- package/dist/db/store-backend.d.ts.map +1 -1
- package/dist/diagnostics/historical-project-registration-receipt.js +299 -50
- package/dist/generated/storage-kit/backend.d.ts +12 -2
- package/dist/generated/storage-kit/backend.d.ts.map +1 -1
- package/dist/generated/storage-kit/index.d.ts +1 -1
- package/dist/generated/storage-kit/index.d.ts.map +1 -1
- package/dist/generated/storage-kit/migrations.d.ts +21 -0
- package/dist/generated/storage-kit/migrations.d.ts.map +1 -1
- package/dist/generated/storage-kit/pool.d.ts +2 -5
- package/dist/generated/storage-kit/pool.d.ts.map +1 -1
- package/dist/generated/storage-kit/query.d.ts +1 -1
- package/dist/generated/storage-kit/query.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4328 -1485
- package/dist/lib/built-in-hooks.d.ts.map +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/env.d.ts +10 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/gatherer.d.ts.map +1 -1
- package/dist/lib/injection-project.d.ts +10 -0
- package/dist/lib/injection-project.d.ts.map +1 -0
- package/dist/lib/injector.d.ts +1 -0
- package/dist/lib/injector.d.ts.map +1 -1
- package/dist/lib/local-opt-in.d.ts +114 -0
- package/dist/lib/local-opt-in.d.ts.map +1 -0
- package/dist/lib/machine-visibility.d.ts.map +1 -1
- package/dist/lib/memory-lock.d.ts.map +1 -1
- package/dist/lib/paths.d.ts +9 -0
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/profile-synthesizer.d.ts +13 -2
- package/dist/lib/profile-synthesizer.d.ts.map +1 -1
- package/dist/lib/redact.d.ts +70 -10
- package/dist/lib/redact.d.ts.map +1 -1
- package/dist/lib/reflection.d.ts.map +1 -1
- package/dist/lib/session-queue.d.ts.map +1 -1
- package/dist/lib/session-registry.d.ts +38 -1
- package/dist/lib/session-registry.d.ts.map +1 -1
- package/dist/lib/storage-sync.d.ts +5 -0
- package/dist/lib/storage-sync.d.ts.map +1 -1
- package/dist/lib/synthesis/index.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +6215 -2598
- package/dist/mcp/profile.d.ts +23 -0
- package/dist/mcp/profile.d.ts.map +1 -0
- package/dist/mcp/tools/lock-tools.d.ts.map +1 -1
- package/dist/mcp/tools/memory-audit.d.ts +1 -1
- package/dist/mcp/tools/memory-audit.d.ts.map +1 -1
- package/dist/mcp/tools/memory-crud.d.ts.map +1 -1
- package/dist/mcp/tools/memory-inject.d.ts.map +1 -1
- package/dist/mcp/tools/project-tools.d.ts.map +1 -1
- package/dist/mcp/tools/session-tools.d.ts.map +1 -1
- package/dist/mcp/tools/tool-registry.d.ts +22 -19
- package/dist/mcp/tools/tool-registry.d.ts.map +1 -1
- package/dist/mcp/tools/utility-tools.d.ts +2 -1
- package/dist/mcp/tools/utility-tools.d.ts.map +1 -1
- package/dist/project-registration.js +549 -205
- package/dist/sdk/index.d.ts +282 -14
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1691 -35
- package/dist/server/auth.d.ts +2 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/helpers.d.ts +21 -7
- package/dist/server/helpers.d.ts.map +1 -1
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +6040 -2475
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/routes/audit.d.ts +2 -0
- package/dist/server/routes/audit.d.ts.map +1 -0
- package/dist/server/routes/machines.d.ts +2 -0
- package/dist/server/routes/machines.d.ts.map +1 -0
- package/dist/server/routes/system-sessions.d.ts.map +1 -1
- package/dist/server/routes/system-synthesis.d.ts.map +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +78 -129
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/docker-entrypoint.sh +7 -0
- package/hasna.contract.json +19 -7
- package/package.json +12 -11
- package/postinstall.mjs +52 -1
- package/dashboard/bun.lock +0 -519
- package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts +0 -2
- package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts.map +0 -1
- package/dist/cli/__fixtures__/io-restore-stub-server.d.ts +0 -2
- package/dist/cli/__fixtures__/io-restore-stub-server.d.ts.map +0 -1
- package/dist/cli/brains.d.ts +0 -3
- package/dist/cli/brains.d.ts.map +0 -1
- package/dist/db/__fixtures__/fail-closed-stub-server.d.ts +0 -2
- package/dist/db/__fixtures__/fail-closed-stub-server.d.ts.map +0 -1
- package/dist/db/__fixtures__/list-filter-capture-server.d.ts +0 -2
- package/dist/db/__fixtures__/list-filter-capture-server.d.ts.map +0 -1
- package/dist/db/__fixtures__/list-filter-client-runner.d.ts +0 -2
- package/dist/db/__fixtures__/list-filter-client-runner.d.ts.map +0 -1
- package/dist/lib/retired-storage-mode.d.ts +0 -11
- package/dist/lib/retired-storage-mode.d.ts.map +0 -1
- package/dist/test-support/memories-page-stub-server.d.ts +0 -2
- package/dist/test-support/memories-page-stub-server.d.ts.map +0 -1
- package/dist/test-support/memories-page-stub.d.ts +0 -28
- package/dist/test-support/memories-page-stub.d.ts.map +0 -1
- package/dist/test-support/pg-sync-stub-worker.d.ts +0 -2
- package/dist/test-support/pg-sync-stub-worker.d.ts.map +0 -1
- package/dist/test-support/preload-local-store.d.ts +0 -2
- package/dist/test-support/preload-local-store.d.ts.map +0 -1
- package/dist/test-support/project-authority-identity.d.ts +0 -8
- package/dist/test-support/project-authority-identity.d.ts.map +0 -1
- package/dist/test-support/store-isolation.d.ts +0 -108
- package/dist/test-support/store-isolation.d.ts.map +0 -1
- package/dist/test-support/strip-ansi.d.ts +0 -3
- package/dist/test-support/strip-ansi.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/mementos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Universal memory system for AI agents - CLI + MCP server + library API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,18 +30,19 @@
|
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
-
"dashboard/dist",
|
|
34
33
|
"Dockerfile.package",
|
|
35
34
|
"docker-entrypoint.sh",
|
|
36
35
|
"bun.lock",
|
|
37
36
|
"hasna.contract.json",
|
|
38
37
|
"LICENSE",
|
|
39
38
|
"README.md",
|
|
40
|
-
"postinstall.mjs"
|
|
39
|
+
"postinstall.mjs",
|
|
40
|
+
"!dist/test-support/**",
|
|
41
|
+
"!dist/**/__fixtures__/**"
|
|
41
42
|
],
|
|
42
43
|
"scripts": {
|
|
43
44
|
"clean": "rm -rf dist",
|
|
44
|
-
"build": "bun run clean && bun build src/cli/index.tsx --outdir dist/cli --target bun --external ink --external react --external chalk --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts
|
|
45
|
+
"build": "bun run clean && bun build src/cli/index.tsx --outdir dist/cli --target bun --external ink --external react --external chalk --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/server/index.ts --outdir dist/server --target bun --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/index.ts src/storage.ts src/pg-sync-worker.ts src/project-registration.ts --outdir dist --target bun --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/diagnostics/historical-project-registration-receipt.ts --outdir dist/diagnostics --target bun --external pg && bun build src/sdk/index.ts --outdir dist/sdk --target bun && tsc --emitDeclarationOnly --outDir dist",
|
|
45
46
|
"prepare": "bun run build:js",
|
|
46
47
|
"prepack": "bun run build && bun run scan-artifact",
|
|
47
48
|
"prepublishOnly": "bun run typecheck && bun run test && bun run contracts:conformance && contracts no-cloud-scan .",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"dev:mcp": "bun run src/mcp/index.ts",
|
|
57
58
|
"dev:serve": "bun run src/server/index.ts",
|
|
58
59
|
"postinstall": "node postinstall.mjs",
|
|
59
|
-
"build:js": "bun run clean && bun build src/cli/index.tsx --outdir dist/cli --target bun --external ink --external react --external chalk --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts
|
|
60
|
+
"build:js": "bun run clean && bun build src/cli/index.tsx --outdir dist/cli --target bun --external ink --external react --external chalk --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/server/index.ts --outdir dist/server --target bun --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/index.ts src/storage.ts src/pg-sync-worker.ts src/project-registration.ts --outdir dist --target bun --external @hasna/contracts --external @hasna/contracts/* --external pg && bun build src/diagnostics/historical-project-registration-receipt.ts --outdir dist/diagnostics --target bun --external pg && bun build src/sdk/index.ts --outdir dist/sdk --target bun && tsc --emitDeclarationOnly --outDir dist"
|
|
60
61
|
},
|
|
61
62
|
"keywords": [
|
|
62
63
|
"memory",
|
|
@@ -76,11 +77,12 @@
|
|
|
76
77
|
},
|
|
77
78
|
"repository": {
|
|
78
79
|
"type": "git",
|
|
79
|
-
"url": "
|
|
80
|
+
"url": "https://github.com/hasna/apps.git",
|
|
81
|
+
"directory": "apps/mementos"
|
|
80
82
|
},
|
|
81
|
-
"homepage": "https://github.com/hasna/mementos",
|
|
83
|
+
"homepage": "https://github.com/hasna/apps/tree/main/apps/mementos#readme",
|
|
82
84
|
"bugs": {
|
|
83
|
-
"url": "https://github.com/hasna/
|
|
85
|
+
"url": "https://github.com/hasna/apps/issues"
|
|
84
86
|
},
|
|
85
87
|
"engines": {
|
|
86
88
|
"bun": ">=1.0.0"
|
|
@@ -91,9 +93,8 @@
|
|
|
91
93
|
"@ai-sdk/anthropic": "^3.0.82",
|
|
92
94
|
"@ai-sdk/openai": "^3.0.69",
|
|
93
95
|
"@ai-sdk/openai-compatible": "^2.0.48",
|
|
94
|
-
"@hasna/contracts": "0.
|
|
96
|
+
"@hasna/contracts": "1.0.2",
|
|
95
97
|
"@hasna/events": "0.1.6",
|
|
96
|
-
"@hasna/paths": "0.1.0",
|
|
97
98
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
98
99
|
"ai": "^6.0.199",
|
|
99
100
|
"chalk": "^5.4.1",
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
"zod": "^3.24.2"
|
|
107
108
|
},
|
|
108
109
|
"devDependencies": {
|
|
109
|
-
"@types/bun": "
|
|
110
|
+
"@types/bun": "1.3.14",
|
|
110
111
|
"bun-types": "1.3.14",
|
|
111
112
|
"@types/pg": "^8.11.11",
|
|
112
113
|
"@types/react": "^18.3.18",
|
package/postinstall.mjs
CHANGED
|
@@ -5,6 +5,57 @@
|
|
|
5
5
|
// already migrated there); otherwise the legacy ~/.hasna/mementos default.
|
|
6
6
|
// Failures are non-fatal: the runtime creates the same directories on first use.
|
|
7
7
|
import { existsSync, mkdirSync } from "node:fs";
|
|
8
|
+
// --- Local path resolver -------------------------------------------------
|
|
9
|
+
// @hasna/paths was deleted (hasna/apps#1535, 2026-09-03); this in-package
|
|
10
|
+
// implementation preserves the resolver contract (XDG / macOS home layout
|
|
11
|
+
// honoring HASNA_{CONFIG,DATA,STATE,CACHE}_HOME, with the same env-override
|
|
12
|
+
// and home-override semantics the deleted package had).
|
|
13
|
+
import { homedir as pathsResolverHomedir } from "node:os";
|
|
14
|
+
import { join as pathsResolverJoin } from "node:path";
|
|
15
|
+
|
|
16
|
+
const PATHS_RESOLVER_KIND_ENV = {
|
|
17
|
+
config: "HASNA_CONFIG_HOME",
|
|
18
|
+
data: "HASNA_DATA_HOME",
|
|
19
|
+
state: "HASNA_STATE_HOME",
|
|
20
|
+
cache: "HASNA_CACHE_HOME",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function pathsResolverBaseDir(kind, options) {
|
|
24
|
+
const env = options.env ?? process.env;
|
|
25
|
+
const override = env[PATHS_RESOLVER_KIND_ENV[kind]];
|
|
26
|
+
if (typeof override === "string" && override.length > 0) return override;
|
|
27
|
+
const home = options.home ?? pathsResolverHomedir();
|
|
28
|
+
const platform = options.platform ?? process.platform;
|
|
29
|
+
if (platform === "darwin") {
|
|
30
|
+
switch (kind) {
|
|
31
|
+
case "config":
|
|
32
|
+
case "data":
|
|
33
|
+
return pathsResolverJoin(home, "Library", "Application Support", "Hasna");
|
|
34
|
+
case "cache":
|
|
35
|
+
return pathsResolverJoin(home, "Library", "Caches", "Hasna");
|
|
36
|
+
case "state":
|
|
37
|
+
return pathsResolverJoin(home, "Library", "Logs", "Hasna");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
switch (kind) {
|
|
41
|
+
case "config":
|
|
42
|
+
return pathsResolverJoin(home, ".config", "hasna");
|
|
43
|
+
case "data":
|
|
44
|
+
return pathsResolverJoin(home, ".local", "share", "hasna");
|
|
45
|
+
case "state":
|
|
46
|
+
return pathsResolverJoin(home, ".local", "state", "hasna");
|
|
47
|
+
case "cache":
|
|
48
|
+
return pathsResolverJoin(home, ".cache", "hasna");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function pathsResolverResolve(kind, options) {
|
|
53
|
+
const appSegment = options.internal === true ? pathsResolverJoin("internal", options.app) : options.app;
|
|
54
|
+
return pathsResolverJoin(pathsResolverBaseDir(kind, options), appSegment);
|
|
55
|
+
}
|
|
56
|
+
function dataDir(options) {
|
|
57
|
+
return pathsResolverResolve("data", options);
|
|
58
|
+
}
|
|
8
59
|
import { homedir } from "node:os";
|
|
9
60
|
import { join } from "node:path";
|
|
10
61
|
|
|
@@ -15,7 +66,7 @@ const EXACT_OVERRIDES = [
|
|
|
15
66
|
const DATA_HOME_OVERRIDE = (process.env["HASNA_DATA_HOME"] || "").trim();
|
|
16
67
|
|
|
17
68
|
try {
|
|
18
|
-
|
|
69
|
+
// (local resolver — @hasna/paths deleted, hasna/apps#1535)
|
|
19
70
|
const home = process.env["HOME"] || process.env["USERPROFILE"] || homedir();
|
|
20
71
|
const resolved = dataDir({ app: "mementos", home });
|
|
21
72
|
let root;
|