@hasna/mementos 0.14.83 → 0.14.85
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/Dockerfile.package +0 -1
- package/README.md +13 -10
- package/dashboard/bun.lock +519 -0
- 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-export.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-list.d.ts.map +1 -1
- package/dist/cli/commands/storage.d.ts.map +1 -1
- package/dist/cli/helpers.d.ts +31 -0
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.js +3781 -1512
- package/dist/db/analytics.d.ts +13 -0
- package/dist/db/analytics.d.ts.map +1 -1
- package/dist/db/api-mode.d.ts +5 -1
- package/dist/db/api-mode.d.ts.map +1 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/memories.d.ts +59 -3
- package/dist/db/memories.d.ts.map +1 -1
- package/dist/db/store-backend.d.ts +3 -3
- package/dist/db/store-backend.d.ts.map +1 -1
- package/dist/diagnostics/historical-project-registration-receipt.d.ts +39 -0
- package/dist/diagnostics/historical-project-registration-receipt.d.ts.map +1 -0
- package/dist/diagnostics/historical-project-registration-receipt.js +1656 -0
- package/dist/generated/storage-kit/backend.d.ts +20 -0
- package/dist/generated/storage-kit/backend.d.ts.map +1 -0
- package/dist/generated/storage-kit/index.d.ts +2 -2
- package/dist/generated/storage-kit/index.d.ts.map +1 -1
- package/dist/generated/storage-kit/migrations.d.ts.map +1 -1
- package/dist/generated/storage-kit/own.d.ts +11 -0
- package/dist/generated/storage-kit/own.d.ts.map +1 -0
- package/dist/generated/storage-kit/pool.d.ts +7 -6
- package/dist/generated/storage-kit/pool.d.ts.map +1 -1
- package/dist/generated/storage-kit/tls.d.ts +30 -3
- package/dist/generated/storage-kit/tls.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3628 -1453
- package/dist/lib/gatherer.d.ts.map +1 -1
- package/dist/lib/retired-storage-mode.d.ts +11 -0
- package/dist/lib/retired-storage-mode.d.ts.map +1 -0
- package/dist/lib/storage-sync.d.ts +2 -2
- package/dist/lib/storage-sync.d.ts.map +1 -1
- package/dist/mcp/index.js +3684 -1492
- package/dist/mcp/tools/memory-io.d.ts.map +1 -1
- package/dist/mcp/tools/project-tools.d.ts.map +1 -1
- package/dist/project-registration/authority.d.ts.map +1 -1
- package/dist/project-registration/historical-receipt.d.ts +38 -0
- package/dist/project-registration/historical-receipt.d.ts.map +1 -0
- package/dist/project-registration/identity.d.ts.map +1 -1
- package/dist/project-registration/index.d.ts +1 -1
- package/dist/project-registration/index.d.ts.map +1 -1
- package/dist/project-registration/types.d.ts +26 -0
- package/dist/project-registration/types.d.ts.map +1 -1
- package/dist/project-registration.js +361 -162
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +122 -30
- package/dist/server/index.js +3698 -1431
- package/dist/storage.d.ts +18 -50
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +151 -122
- package/dist/test-support/memories-page-stub-server.d.ts +2 -0
- package/dist/test-support/memories-page-stub-server.d.ts.map +1 -0
- package/dist/test-support/memories-page-stub.d.ts +28 -0
- package/dist/test-support/memories-page-stub.d.ts.map +1 -0
- package/dist/test-support/store-isolation.d.ts +5 -0
- package/dist/test-support/store-isolation.d.ts.map +1 -1
- package/docker-entrypoint.sh +4 -5
- package/hasna.contract.json +2 -2
- package/package.json +7 -6
- package/dist/generated/storage-kit/mode.d.ts +0 -48
- package/dist/generated/storage-kit/mode.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-isolation.d.ts","sourceRoot":"","sources":["../../src/test-support/store-isolation.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{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AAC,CAsD7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAA0B,GAAG,IAAI,CAQ9F"}
|
package/docker-entrypoint.sh
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
# mementos container entrypoint
|
|
4
4
|
# -----------------------------------------------------------------------------
|
|
5
5
|
# Bridges the hasna-app Terraform module's injected env (DATABASE_URL,
|
|
6
|
-
# API_KEY_SIGNING_SECRET, PORT) to mementos' native env,
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
6
|
+
# API_KEY_SIGNING_SECRET, PORT) to mementos' native env, and binds to all
|
|
7
|
+
# interfaces so the ALB target group is reachable. Migrations run against the
|
|
8
|
+
# OWNER DSN (DDL); the long-running service runs against the least-privilege
|
|
9
|
+
# APP DSN.
|
|
10
10
|
# =============================================================================
|
|
11
11
|
set -e
|
|
12
12
|
|
|
@@ -14,7 +14,6 @@ set -e
|
|
|
14
14
|
export MEMENTOS_HOST="${MEMENTOS_HOST:-0.0.0.0}"
|
|
15
15
|
|
|
16
16
|
# Amendment A1 — serve/CLI read+write RDS directly.
|
|
17
|
-
export HASNA_MEMENTOS_STORAGE_MODE="${HASNA_MEMENTOS_STORAGE_MODE:-cloud}"
|
|
18
17
|
|
|
19
18
|
# Select the DSN by workload: migrations need the owner role (DDL); everything
|
|
20
19
|
# else uses the app role. MIGRATION_DATABASE_URL is optional; falls back to
|
package/hasna.contract.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"name": "mementos",
|
|
5
5
|
"class": "cli-with-store",
|
|
6
6
|
"contractVersion": "v1",
|
|
7
|
-
"kitVersion": "0.
|
|
8
|
-
"description": "Universal memory system for AI agents — CLI, MCP server, REST API, and TypeScript SDK over one SQLite or PostgreSQL store.",
|
|
7
|
+
"kitVersion": "0.10.6",
|
|
8
|
+
"description": "Universal memory system for AI agents — CLI, MCP server, REST API, and TypeScript SDK over one SQLite or PostgreSQL store. Clients use local SQLite or the HTTP API selected by HASNA_MEMENTOS_API_URL; mementos-serve reads PostgreSQL selected by HASNA_MEMENTOS_DATABASE_URL. The data backend is the only runtime switch.",
|
|
9
9
|
"bins": [
|
|
10
10
|
"mementos",
|
|
11
11
|
"mementos-mcp",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/mementos",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.85",
|
|
4
4
|
"description": "Universal memory system for AI agents - CLI + MCP server + library API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"scripts": {
|
|
42
42
|
"clean": "rm -rf dist",
|
|
43
|
-
"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/schemas --external @hasna/contracts/auth --external pg && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts/schemas --external @hasna/contracts/auth --external pg && bun build src/server/index.ts --outdir dist/server --target bun --external @hasna/contracts --external @hasna/contracts/schemas --external @hasna/contracts/auth --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/schemas --external @hasna/contracts/auth --external pg && bun build src/sdk/index.ts --outdir dist/sdk --target bun && tsc --emitDeclarationOnly --outDir dist",
|
|
43
|
+
"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/schemas --external @hasna/contracts/auth --external pg && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk --external @hasna/contracts --external @hasna/contracts/schemas --external @hasna/contracts/auth --external pg && bun build src/server/index.ts --outdir dist/server --target bun --external @hasna/contracts --external @hasna/contracts/schemas --external @hasna/contracts/auth --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/schemas --external @hasna/contracts/auth --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",
|
|
44
44
|
"prepare": "bun run build",
|
|
45
45
|
"prepack": "bun run build && bun run scan-artifact",
|
|
46
46
|
"prepublishOnly": "bun run typecheck && bun run test && bun run contracts:conformance && contracts no-cloud-scan .",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"contracts:conformance": "contracts conformance fixtures",
|
|
50
50
|
"typecheck": "tsc --noEmit",
|
|
51
51
|
"test": "bun test --isolate --timeout=10000",
|
|
52
|
+
"diagnose:historical-project-registration-receipt": "bun run src/diagnostics/historical-project-registration-receipt.ts",
|
|
52
53
|
"test:pg": "bun scripts/pg-test-gate.ts",
|
|
53
54
|
"dev:cli": "bun run src/cli/index.tsx",
|
|
54
55
|
"dev:mcp": "bun run src/mcp/index.ts",
|
|
@@ -88,8 +89,8 @@
|
|
|
88
89
|
"@ai-sdk/anthropic": "^3.0.82",
|
|
89
90
|
"@ai-sdk/openai": "^3.0.69",
|
|
90
91
|
"@ai-sdk/openai-compatible": "^2.0.48",
|
|
91
|
-
"@hasna/contracts": "0.
|
|
92
|
-
"@hasna/events": "
|
|
92
|
+
"@hasna/contracts": "0.10.6",
|
|
93
|
+
"@hasna/events": "0.1.6",
|
|
93
94
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
94
95
|
"ai": "^6.0.199",
|
|
95
96
|
"chalk": "^5.4.1",
|
|
@@ -103,10 +104,10 @@
|
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|
|
105
106
|
"@types/bun": "^1.2.4",
|
|
107
|
+
"bun-types": "1.3.14",
|
|
106
108
|
"@types/pg": "^8.11.11",
|
|
107
109
|
"@types/react": "^18.3.18",
|
|
108
110
|
"sigstore": "5.0.0",
|
|
109
111
|
"typescript": "^5.7.3"
|
|
110
|
-
}
|
|
111
|
-
"gitHead": "e3b0801ce74ba37ed740b57b68bd0e4e948d0d3f"
|
|
112
|
+
}
|
|
112
113
|
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export declare const STORAGE_MODES: readonly ["local", "cloud"];
|
|
2
|
-
export type StorageMode = (typeof STORAGE_MODES)[number];
|
|
3
|
-
export declare const DEPRECATED_STORAGE_MODE_ALIASES: readonly ["remote", "hybrid", "self_hosted"];
|
|
4
|
-
export type Env = Record<string, string | undefined>;
|
|
5
|
-
export interface StorageModeNormalization {
|
|
6
|
-
mode: StorageMode;
|
|
7
|
-
/** The deprecated alias that was normalized to `cloud`, if any. */
|
|
8
|
-
deprecatedAlias: string | null;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Normalize a raw storage-mode string to the `local | cloud` runtime enum.
|
|
12
|
-
* Accepts deprecated aliases (`remote`, `hybrid`, `self_hosted`) and maps them
|
|
13
|
-
* to `cloud`. Throws on any other value.
|
|
14
|
-
*/
|
|
15
|
-
export declare function normalizeStorageMode(value: string): StorageModeNormalization;
|
|
16
|
-
/** Upper-snake env token for an app name, e.g. `todos` -> `TODOS`. */
|
|
17
|
-
export declare function envToken(name: string): string;
|
|
18
|
-
export interface StorageEnvKeys {
|
|
19
|
-
/** `HASNA_<NAME>_STORAGE_MODE` then the optional `<NAME>_STORAGE_MODE` alias. */
|
|
20
|
-
modeKeys: string[];
|
|
21
|
-
/** `HASNA_<NAME>_DATABASE_URL` then the optional `<NAME>_DATABASE_URL` alias. */
|
|
22
|
-
databaseUrlKeys: string[];
|
|
23
|
-
}
|
|
24
|
-
/** Resolve the canonical env-key spec for an app's storage config. */
|
|
25
|
-
export declare function storageEnvKeys(name: string): StorageEnvKeys;
|
|
26
|
-
export interface StorageModeResolution {
|
|
27
|
-
mode: StorageMode;
|
|
28
|
-
/** Env key the mode came from, or `"default"`. */
|
|
29
|
-
source: string;
|
|
30
|
-
deprecatedAlias: string | null;
|
|
31
|
-
databaseUrlPresent: boolean;
|
|
32
|
-
/** Env key the database URL came from, or `null`. */
|
|
33
|
-
databaseUrlSource: string | null;
|
|
34
|
-
warning: string | null;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Resolve an app's storage mode from the environment per the contract env spec.
|
|
38
|
-
* Precedence: `HASNA_<NAME>_STORAGE_MODE`, then `<NAME>_STORAGE_MODE`, else
|
|
39
|
-
* `local`. Never reads secret values — only detects DATABASE_URL presence.
|
|
40
|
-
*/
|
|
41
|
-
export declare function resolveStorageMode(name: string, env?: Env): StorageModeResolution;
|
|
42
|
-
/**
|
|
43
|
-
* Resolve the database URL value for an app, honoring the canonical then alias
|
|
44
|
-
* env keys. Returns `null` when unset. The caller is responsible for never
|
|
45
|
-
* logging the returned value.
|
|
46
|
-
*/
|
|
47
|
-
export declare function resolveDatabaseUrl(name: string, env?: Env): string | null;
|
|
48
|
-
//# sourceMappingURL=mode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/mode.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa,6BAA8B,CAAC;AACzD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,+BAA+B,8CAIlC,CAAC;AAEX,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,WAAW,CAAC;IAClB,mEAAmE;IACnE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,oB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