@hasna/mementos 0.14.88 → 0.15.2
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 +44 -9
- package/bun.lock +4 -65
- 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-chain.d.ts.map +1 -1
- package/dist/cli/commands/memory-cmd-crud.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/storage.d.ts.map +1 -1
- package/dist/cli/commands/system-doctor.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.d.ts.map +1 -1
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.js +3397 -1954
- 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 +135 -37
- 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.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 +85 -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 +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2811 -1285
- 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/local-opt-in.d.ts +114 -0
- package/dist/lib/local-opt-in.d.ts.map +1 -0
- package/dist/lib/paths.d.ts +9 -0
- package/dist/lib/paths.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/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +2856 -1291
- package/dist/project-registration.js +273 -185
- package/dist/sdk/index.d.ts +173 -8
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +953 -12
- 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.map +1 -1
- package/dist/server/index.js +2855 -1351
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +78 -129
- package/dist/test-support/store-isolation.d.ts +50 -11
- package/dist/test-support/store-isolation.d.ts.map +1 -1
- package/docker-entrypoint.sh +7 -0
- package/hasna.contract.json +17 -5
- package/package.json +5 -7
- package/postinstall.mjs +52 -1
- package/dashboard/bun.lock +0 -519
- package/dist/cli/brains.d.ts +0 -3
- package/dist/cli/brains.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/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;
|