@hasna/mementos 0.14.87 → 0.14.88
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/bun.lock +3 -0
- package/dist/cli/brains.d.ts.map +1 -1
- package/dist/cli/commands/io-backup.d.ts.map +1 -1
- package/dist/cli/commands/io-restore.d.ts.map +1 -1
- package/dist/cli/commands/system-profile.d.ts.map +1 -1
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.js +952 -681
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/memories.d.ts.map +1 -1
- package/dist/db/pg-migrate.d.ts.map +1 -1
- package/dist/diagnostics/historical-project-registration-receipt.js +116 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +808 -543
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/model-config.d.ts +1 -1
- package/dist/lib/paths.d.ts +51 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/profile-sync.d.ts.map +1 -1
- package/dist/lib/search.d.ts.map +1 -1
- package/dist/lib/storage-sync.d.ts.map +1 -1
- package/dist/lib/sync.d.ts.map +1 -1
- package/dist/mcp/index.js +815 -548
- package/dist/project-registration.js +179 -42
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/helpers.d.ts +31 -0
- package/dist/server/helpers.d.ts.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +872 -554
- package/dist/server/routes/system-synthesis.d.ts.map +1 -1
- package/dist/storage.d.ts +18 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +134 -17
- package/package.json +5 -3
- package/postinstall.mjs +34 -0
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAA+B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAA+B,MAAM,UAAU,CAAC;AAe5E,eAAO,MAAM,cAAc,EAAE,cA4B5B,CAAC;AA4DF,wBAAgB,UAAU,IAAI,cAAc,CAwC3C;AA2FD,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAMhD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAQ1D;AAED,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAOvC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOnD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAmDlC"}
|
|
@@ -4,7 +4,7 @@ export declare const DEFAULT_MODEL = "gpt-4o-mini";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function getActiveModel(): string;
|
|
6
6
|
/**
|
|
7
|
-
* Sets the active fine-tuned model ID in
|
|
7
|
+
* Sets the active fine-tuned model ID in config.json under the effective data root.
|
|
8
8
|
*/
|
|
9
9
|
export declare function setActiveModel(modelId: string): void;
|
|
10
10
|
/**
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hasna/mementos data-home resolution through the @hasna/paths resolver.
|
|
3
|
+
*
|
|
4
|
+
* mementos stores its sqlite database (`mementos.db`), `config.json`, the
|
|
5
|
+
* per-agent `agents/`, `profiles/`, `training/` and `backups/` data and the
|
|
6
|
+
* remote-storage `storage/config.json` under a single data root. Historically
|
|
7
|
+
* that root was `~/.hasna/mementos`. This module resolves the root through
|
|
8
|
+
* `@hasna/paths` (XDG / macOS home layout) with a gated legacy adoption: the
|
|
9
|
+
* legacy `~/.hasna/mementos` stays the effective data root until the store is
|
|
10
|
+
* physically migrated to the XDG data home (`mementos.db` present there) or
|
|
11
|
+
* the operator sets the data-kind override `HASNA_DATA_HOME`. An existing
|
|
12
|
+
* live store never becomes invisible on upgrade. The exact-app overrides
|
|
13
|
+
* `HASNA_MEMENTOS_HOME` (then `MEMENTOS_HOME`) win unconditionally, and the
|
|
14
|
+
* db-path overrides (`HASNA_MEMENTOS_DB_PATH` / `MEMENTOS_DB_PATH`) stay
|
|
15
|
+
* layered on top by `getDbPath`.
|
|
16
|
+
*
|
|
17
|
+
* Nothing moves on disk in this phase — the package just resolves the new
|
|
18
|
+
* paths.
|
|
19
|
+
*/
|
|
20
|
+
/** The effective user home, mirroring the pre-existing mementos resolution (`HOME` || `USERPROFILE`). */
|
|
21
|
+
export declare function effectiveHome(): string;
|
|
22
|
+
/** The legacy (pre-XDG) data root: `~/.hasna/mementos`. */
|
|
23
|
+
export declare function legacyDataRoot(): string;
|
|
24
|
+
/**
|
|
25
|
+
* The @hasna/paths-resolved (XDG / macOS home layout) data root for mementos:
|
|
26
|
+
* `~/.local/share/hasna/mementos` on Linux, `~/Library/Application
|
|
27
|
+
* Support/Hasna/mementos` on macOS. The home override mirrors the pre-existing
|
|
28
|
+
* `$HOME`-first resolution so the resolver follows the same home the legacy
|
|
29
|
+
* path does.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolverDataRoot(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the resolver (XDG) data root should be adopted as the effective
|
|
34
|
+
* data root. The resolver root is adopted only when the operator has set
|
|
35
|
+
* `HASNA_DATA_HOME` (the data-kind override — a deliberate opt-in to the XDG
|
|
36
|
+
* layout) or the store has already been physically migrated there
|
|
37
|
+
* (`mementos.db` exists — mementos' store file). A machine that only
|
|
38
|
+
* redirects another kind (e.g. cache to tmpfs) must NOT have its data home
|
|
39
|
+
* moved, and a live store at the legacy home must never become invisible on
|
|
40
|
+
* upgrade.
|
|
41
|
+
*/
|
|
42
|
+
export declare function adoptResolverDataRoot(resolved: string, env?: NodeJS.ProcessEnv): boolean;
|
|
43
|
+
/** The exact-app override root, when set: `HASNA_MEMENTOS_HOME`, then `MEMENTOS_HOME`. */
|
|
44
|
+
export declare function exactDataRoot(): string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The effective data root: an exact-app override (`HASNA_MEMENTOS_HOME`, then
|
|
47
|
+
* `MEMENTOS_HOME`) wins unconditionally; otherwise the resolver (XDG) data
|
|
48
|
+
* root once adopted; otherwise the legacy `~/.hasna/mementos` default.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getDataRoot(): string;
|
|
51
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/paths.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yGAAyG;AACzG,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAKzC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAIT;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,CAQlD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAKpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-sync.d.ts","sourceRoot":"","sources":["../../src/lib/profile-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-sync.d.ts","sourceRoot":"","sources":["../../src/lib/profile-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAaD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAmDnB"}
|
package/dist/lib/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAqpBlF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,YAAY,EACrB,EAAE,CAAC,EAAE,QAAQ,GACZ,kBAAkB,EAAE,CAqEtB;AAMD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,YAAY,EACrB,EAAE,CAAC,EAAE,QAAQ,GACZ,kBAAkB,EAAE,CA4DtB;AAMD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,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;CAAE,EAAE,CAUpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-sync.d.ts","sourceRoot":"","sources":["../../src/lib/storage-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"storage-sync.d.ts","sourceRoot":"","sources":["../../src/lib/storage-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,QAAQ,EAQb,gBAAgB,EAMjB,MAAM,eAAe,CAAC;AAgBvB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAC7C,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC9B,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;CAC3C;AAED,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAunBD,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,qBAA0B,GAClC,yBAAyB,CAE3B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,qBAA0B,GAClC,yBAAyB,CAE3B;AAED,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,oBAAoB,CAAM,GACxE,qBAAqB,CAqBvB"}
|
package/dist/lib/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/lib/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/lib/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EACV,kBAAkB,EAElB,aAAa,EACb,UAAU,EACX,MAAM,mBAAmB,CAAC;AA8K3B,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,aAAsB,EACjC,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;IACzC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACV,GACL,UAAU,CAgCZ;AAED,eAAO,MAAM,iBAAiB,UAAgC,CAAC"}
|