@hasna/domains 0.0.46 → 0.0.47
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 +1 -1
- package/dist/cli/index.js +413 -158
- package/dist/db/database.d.ts +5 -3
- package/dist/db/database.d.ts.map +1 -1
- package/dist/index.js +340 -104
- package/dist/lib/app-home.d.ts +60 -0
- package/dist/lib/app-home.d.ts.map +1 -0
- package/dist/lib/config.d.ts +4 -3
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/mcp/index.js +360 -124
- package/dist/sdk/index.js +93 -15
- package/dist/server/migrations.d.ts +35 -0
- package/dist/server/migrations.d.ts.map +1 -1
- package/package.json +5 -3
- package/postinstall.js +42 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hasna/domains home resolution — the legacy `~/.hasna/domains` root,
|
|
3
|
+
* resolved through the @hasna/paths resolver (XDG / macOS home layout).
|
|
4
|
+
*
|
|
5
|
+
* The legacy `~/.hasna/domains` default stays the effective home until the
|
|
6
|
+
* XDG data home is adopted — the operator sets `HASNA_DATA_HOME` (the
|
|
7
|
+
* data-kind override — a deliberate opt-in to the XDG layout), or the store
|
|
8
|
+
* has already been physically migrated there (`domains.db` exists at the
|
|
9
|
+
* resolver home) — so an existing local store and config never become
|
|
10
|
+
* invisible on upgrade. An exact-app override (`HASNA_DOMAINS_HOME` /
|
|
11
|
+
* `DOMAINS_HOME`, and the pre-existing `HASNA_DOMAINS_DIR` / `DOMAINS_DIR`
|
|
12
|
+
* names) wins unconditionally and keeps the legacy layout under the override
|
|
13
|
+
* root.
|
|
14
|
+
*
|
|
15
|
+
* Everything accepts an explicit env object (default `process.env`) so the
|
|
16
|
+
* resolver is deterministic in tests and honors the same `$HOME`-first home
|
|
17
|
+
* resolution the package has always used.
|
|
18
|
+
*/
|
|
19
|
+
export declare const APP: "domains";
|
|
20
|
+
/** The effective user home, mirroring the pre-existing domains resolution (`HOME` || `USERPROFILE` || os.homedir()). */
|
|
21
|
+
export declare function effectiveHome(env?: NodeJS.ProcessEnv): string;
|
|
22
|
+
/** Pre-XDG default home: ~/.hasna/domains. */
|
|
23
|
+
export declare function legacyHomeDir(env?: NodeJS.ProcessEnv): string;
|
|
24
|
+
/**
|
|
25
|
+
* The @hasna/paths-resolved data home for domains (XDG / macOS home layout).
|
|
26
|
+
* The home override mirrors the pre-existing `$HOME`-first resolution, and the
|
|
27
|
+
* env object is passed through so `HASNA_DATA_HOME` in the caller's env (not
|
|
28
|
+
* only process.env) is honored.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolverHome(env?: NodeJS.ProcessEnv): string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the resolver (XDG) home should be adopted as the store home. The
|
|
33
|
+
* resolver home is adopted only when the operator has set `HASNA_DATA_HOME`
|
|
34
|
+
* (a deliberate opt-in to the XDG layout) or the store has already been
|
|
35
|
+
* physically migrated there (`domains.db` exists). A machine that only
|
|
36
|
+
* redirects another kind (e.g. cache to tmpfs) must NOT have its data home
|
|
37
|
+
* moved, and a live store at the legacy home must never become invisible on
|
|
38
|
+
* upgrade.
|
|
39
|
+
*/
|
|
40
|
+
export declare function adoptResolverHome(resolved: string, env?: NodeJS.ProcessEnv): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The exact-app override root, when set: `HASNA_DOMAINS_HOME` / `DOMAINS_HOME`
|
|
43
|
+
* (the wave-wide names), then the pre-existing `HASNA_DOMAINS_DIR` /
|
|
44
|
+
* `DOMAINS_DIR` aliases. Wins unconditionally and keeps the legacy layout
|
|
45
|
+
* under the override root.
|
|
46
|
+
*/
|
|
47
|
+
export declare function exactAppOverride(env?: NodeJS.ProcessEnv): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The effective app home: the exact-app override wins unconditionally;
|
|
50
|
+
* otherwise the resolver (XDG) data home once adopted (`HASNA_DATA_HOME` set,
|
|
51
|
+
* or the store already migrated there); otherwise the legacy
|
|
52
|
+
* `~/.hasna/domains` default — an existing store and config never become
|
|
53
|
+
* invisible on upgrade.
|
|
54
|
+
*/
|
|
55
|
+
export declare function appHome(env?: NodeJS.ProcessEnv): string;
|
|
56
|
+
/** The default SQLite db path, at the root of the effective home. */
|
|
57
|
+
export declare function getDefaultDbPath(env?: NodeJS.ProcessEnv): string;
|
|
58
|
+
/** The default config path, at the root of the effective home. */
|
|
59
|
+
export declare function getDefaultConfigPath(env?: NodeJS.ProcessEnv): string;
|
|
60
|
+
//# sourceMappingURL=app-home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-home.d.ts","sourceRoot":"","sources":["../../src/lib/app-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,eAAO,MAAM,GAAG,EAAG,SAAkB,CAAC;AAEtC,wHAAwH;AACxH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE1E;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAGzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAOzF;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAKpE;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE7E;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAEjF"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -43,9 +43,10 @@ export interface LegacyConfigMigrationReport {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function migrateLegacyConfig(env?: NodeJS.ProcessEnv, dryRun?: boolean): LegacyConfigMigrationReport;
|
|
45
45
|
/**
|
|
46
|
-
* The default config location
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* The default config location — `config.json` at the root of the effective
|
|
47
|
+
* domains home, resolved through `@hasna/paths` (legacy `~/.hasna/domains`
|
|
48
|
+
* until the XDG data home is adopted). Env overrides (DOMAINS_CONFIG_PATH /
|
|
49
|
+
* DOMAINS_CONFIG_DIR) are honored unchanged and win over the default.
|
|
49
50
|
*/
|
|
50
51
|
export declare function getConfigPath(env?: NodeJS.ProcessEnv): string;
|
|
51
52
|
export declare function loadConfig(env?: NodeJS.ProcessEnv): DomainsConfig;
|
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":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;A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