gnosys 5.4.2 → 5.4.3
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/dist/cli.js +43 -0
- package/dist/cli.js.map +1 -1
- package/dist/postinstall.d.ts +4 -0
- package/dist/postinstall.d.ts.map +1 -1
- package/dist/postinstall.js +38 -26
- package/dist/postinstall.js.map +1 -1
- package/package.json +1 -1
package/dist/postinstall.d.ts
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Postinstall hook — detects fresh install vs upgrade and always prints
|
|
4
4
|
* the next steps. If the terminal is interactive, offers to run
|
|
5
5
|
* gnosys upgrade (or setup) automatically.
|
|
6
|
+
*
|
|
7
|
+
* v5.4.3: All output goes to stderr (not stdout). npm hides postinstall
|
|
8
|
+
* stdout for global installs but shows stderr — so writing to stderr is
|
|
9
|
+
* the only way users actually see the message during `npm install -g`.
|
|
6
10
|
*/
|
|
7
11
|
export {};
|
|
8
12
|
//# sourceMappingURL=postinstall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
|
package/dist/postinstall.js
CHANGED
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
* Postinstall hook — detects fresh install vs upgrade and always prints
|
|
4
4
|
* the next steps. If the terminal is interactive, offers to run
|
|
5
5
|
* gnosys upgrade (or setup) automatically.
|
|
6
|
+
*
|
|
7
|
+
* v5.4.3: All output goes to stderr (not stdout). npm hides postinstall
|
|
8
|
+
* stdout for global installs but shows stderr — so writing to stderr is
|
|
9
|
+
* the only way users actually see the message during `npm install -g`.
|
|
6
10
|
*/
|
|
7
|
-
import { existsSync } from "fs";
|
|
8
|
-
import { join } from "path";
|
|
11
|
+
import { existsSync, readFileSync } from "fs";
|
|
12
|
+
import { join, dirname } from "path";
|
|
13
|
+
import { fileURLToPath } from "url";
|
|
9
14
|
import { createInterface } from "readline/promises";
|
|
10
15
|
import { stdin, stdout } from "process";
|
|
11
16
|
import { execSync } from "child_process";
|
|
12
17
|
import { GnosysDB } from "./lib/db.js";
|
|
18
|
+
/** Write a line to stderr — npm shows this even when stdout is suppressed. */
|
|
19
|
+
function out(line = "") {
|
|
20
|
+
process.stderr.write(`${line}\n`);
|
|
21
|
+
}
|
|
13
22
|
async function main() {
|
|
14
23
|
// Skip if GNOSYS_SKIP_POSTINSTALL is set (for testing or automation)
|
|
15
24
|
if (process.env.GNOSYS_SKIP_POSTINSTALL) {
|
|
@@ -18,11 +27,14 @@ async function main() {
|
|
|
18
27
|
// Detect if this is an upgrade (central DB exists) or fresh install
|
|
19
28
|
const centralDbPath = GnosysDB.getCentralDbPath();
|
|
20
29
|
const isUpgrade = existsSync(centralDbPath);
|
|
21
|
-
// Read package version
|
|
30
|
+
// Read package version. v5.4.3: use proper ESM path resolution and
|
|
31
|
+
// a top-level `readFileSync` import — the previous `require("fs")`
|
|
32
|
+
// call doesn't work in ESM and silently caused "vunknown" output.
|
|
22
33
|
let version = "unknown";
|
|
23
34
|
try {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
35
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
36
|
+
const pkgPath = join(here, "..", "package.json");
|
|
37
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
26
38
|
version = pkg.version;
|
|
27
39
|
}
|
|
28
40
|
catch {
|
|
@@ -31,17 +43,17 @@ async function main() {
|
|
|
31
43
|
const isInteractive = stdout.isTTY && stdin.isTTY;
|
|
32
44
|
if (isUpgrade) {
|
|
33
45
|
// ── Upgrade flow ──
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
out();
|
|
47
|
+
out(` Gnosys v${version} installed`);
|
|
48
|
+
out();
|
|
49
|
+
out(" Next steps:");
|
|
50
|
+
out(" 1. gnosys upgrade sync all projects + regenerate dashboard");
|
|
51
|
+
out(" 2. Restart MCP servers:");
|
|
52
|
+
out(" Cursor: Cmd+Shift+P > MCP: Restart All Servers");
|
|
53
|
+
out(" Claude Code: /mcp > restart gnosys (or start new session)");
|
|
54
|
+
out(" Codex: start new session");
|
|
55
|
+
out(" 3. gnosys status --web open the portfolio dashboard");
|
|
56
|
+
out();
|
|
45
57
|
// If interactive, offer to run upgrade automatically
|
|
46
58
|
if (isInteractive) {
|
|
47
59
|
const rl = createInterface({ input: stdin, output: stdout });
|
|
@@ -49,7 +61,7 @@ async function main() {
|
|
|
49
61
|
const answer = await rl.question(" Run gnosys upgrade now? [Y/n] ");
|
|
50
62
|
rl.close();
|
|
51
63
|
if (!answer || answer.trim().toLowerCase() !== "n") {
|
|
52
|
-
|
|
64
|
+
out();
|
|
53
65
|
execSync("gnosys upgrade", { stdio: "inherit" });
|
|
54
66
|
}
|
|
55
67
|
}
|
|
@@ -60,14 +72,14 @@ async function main() {
|
|
|
60
72
|
}
|
|
61
73
|
else {
|
|
62
74
|
// ── Fresh install flow ──
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
out();
|
|
76
|
+
out(` Gnosys v${version} installed`);
|
|
77
|
+
out();
|
|
78
|
+
out(" Get started:");
|
|
79
|
+
out(" 1. gnosys setup configure LLM providers and preferences");
|
|
80
|
+
out(" 2. gnosys init initialize gnosys in a project directory");
|
|
81
|
+
out(" 3. gnosys status check project status");
|
|
82
|
+
out();
|
|
71
83
|
// If interactive, offer to run setup automatically
|
|
72
84
|
if (isInteractive) {
|
|
73
85
|
const rl = createInterface({ input: stdin, output: stdout });
|
|
@@ -75,7 +87,7 @@ async function main() {
|
|
|
75
87
|
const answer = await rl.question(" Run setup wizard? [Y/n] ");
|
|
76
88
|
rl.close();
|
|
77
89
|
if (!answer || answer.trim().toLowerCase() !== "n") {
|
|
78
|
-
|
|
90
|
+
out();
|
|
79
91
|
execSync("gnosys setup", { stdio: "inherit" });
|
|
80
92
|
}
|
|
81
93
|
}
|
package/dist/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,8EAA8E;AAC9E,SAAS,GAAG,CAAC,OAAe,EAAE;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,qEAAqE;IACrE,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,oEAAoE;IACpE,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IAClD,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAA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EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gnosys",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.3",
|
|
4
4
|
"description": "Gnosys — Persistent Memory for AI Agents. Sandbox-first runtime, central SQLite brain, federated search, Dream Mode, Web Knowledge Base, Obsidian export.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|