forbocai 0.3.10 → 0.3.12
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/package.json +1 -1
- package/postinstall.js +24 -13
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -25,23 +25,34 @@ Run 'npx forbocai api status' to verify connection.
|
|
|
25
25
|
Welcome to the Future of NPC Intelligence.
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
function showBanner() {
|
|
29
|
+
const out = '\n' + msg;
|
|
30
|
+
try {
|
|
31
|
+
if (process.platform !== 'win32') {
|
|
32
|
+
const tty = fs.openSync('/dev/tty', 'w');
|
|
33
|
+
fs.writeSync(tty, out);
|
|
34
|
+
fs.closeSync(tty);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Windows: try writing to the real console so output isn't lost when npm pipes stdout/stderr
|
|
38
|
+
const winConsoles = ['CONOUT$', 'CON'];
|
|
39
|
+
for (const name of winConsoles) {
|
|
40
|
+
try {
|
|
41
|
+
const fd = fs.openSync(name, 'w');
|
|
42
|
+
fs.writeSync(fd, out);
|
|
43
|
+
fs.closeSync(fd);
|
|
44
|
+
return;
|
|
45
|
+
} catch (_) { /* try next */ }
|
|
46
|
+
}
|
|
47
|
+
// Fallback: stdout + stderr (may be piped/buffered by npm)
|
|
38
48
|
process.stdout.write(out);
|
|
39
49
|
process.stderr.write(out);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.log(msg);
|
|
40
52
|
}
|
|
41
|
-
} catch (e) {
|
|
42
|
-
// Method 3: Fallback - simple console.log (may be suppressed by npm)
|
|
43
|
-
console.log(msg);
|
|
44
53
|
}
|
|
45
54
|
|
|
55
|
+
showBanner();
|
|
56
|
+
|
|
46
57
|
// DO NOT require the SDK here - it causes ESM/CJS compatibility issues
|
|
47
58
|
// The SDK is loaded when the user imports it in their code
|