forbocai 0.3.13 → 0.3.14

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.
Files changed (2) hide show
  1. package/package.json +49 -45
  2. package/postinstall.js +4 -14
package/package.json CHANGED
@@ -1,47 +1,51 @@
1
1
  {
2
- "name": "forbocai",
3
- "version": "0.3.13",
4
- "description": "The Infrastructure Layer for Autonomous AI Characters",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
- "bin": {
9
- "forbocai": "dist/cli.js"
10
- },
11
- "scripts": {
12
- "build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts",
13
- "dev": "tsup src/index.ts --watch",
14
- "test": "vitest",
15
- "test:watch": "vitest --watch",
16
- "preinstall": "node scripts/check-cmake.js",
17
- "postinstall": "node postinstall.js"
18
- },
19
- "dependencies": {
20
- "@helia/json": "^5.0.6",
21
- "@lancedb/lancedb": "^0.23.0",
22
- "@mlc-ai/web-llm": "^0.2.80",
23
- "@xenova/transformers": "^2.17.2",
24
- "apache-arrow": "^18.1.0",
25
- "axios": "^1.6.2",
26
- "blockstore-core": "^6.1.2",
27
- "datastore-core": "^11.0.2",
28
- "helia": "^6.0.18",
29
- "idb": "^8.0.3",
30
- "node-llama-cpp": "^3.15.1",
31
- "onnxruntime-node": "^1.23.2",
32
- "zod": "^3.22.4"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^20.0.0",
36
- "tsup": "^8.5.1",
37
- "typescript": "^5.9.3",
38
- "vitest": "^1.0.0"
39
- },
40
- "files": [
41
- "dist",
42
- "README.md",
43
- "package.json",
44
- "postinstall.js",
45
- "scripts"
46
- ]
2
+ "name": "forbocai",
3
+ "version": "0.3.14",
4
+ "description": "The Infrastructure Layer for Autonomous AI Characters",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "forbocai": "dist/cli.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts",
13
+ "dev": "tsup src/index.ts --watch",
14
+ "test": "vitest",
15
+ "test:watch": "vitest --watch",
16
+ "preinstall": "node scripts/check-cmake.js",
17
+ "postinstall": "node postinstall.js"
18
+ },
19
+ "dependencies": {
20
+ "@helia/json": "^5.0.6",
21
+ "@lancedb/lancedb": "^0.23.0",
22
+ "@mlc-ai/web-llm": "^0.2.80",
23
+ "@xenova/transformers": "^2.17.2",
24
+ "apache-arrow": "^18.1.0",
25
+ "axios": "^1.6.2",
26
+ "blockstore-core": "^6.1.2",
27
+ "datastore-core": "^11.0.2",
28
+ "helia": "^6.0.18",
29
+ "idb": "^8.0.3",
30
+ "node-llama-cpp": "^3.15.1",
31
+ "onnxruntime-node": "^1.23.2",
32
+ "zod": "^3.22.4"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^20.0.0",
36
+ "tsup": "^8.5.1",
37
+ "typescript": "^5.9.3",
38
+ "vitest": "^1.0.0"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "README.md",
43
+ "package.json",
44
+ "postinstall.js",
45
+ "scripts"
46
+ ],
47
+ "overrides": {
48
+ "glob": "^11.0.0",
49
+ "rimraf": "^5.0.0"
50
+ }
47
51
  }
package/postinstall.js CHANGED
@@ -34,18 +34,8 @@ function showBanner() {
34
34
  fs.closeSync(tty);
35
35
  return;
36
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)
48
- process.stdout.write(out);
37
+ // Windows: use console.log + stderr so npm shows output (piped stdout/stderr).
38
+ console.log(out);
49
39
  process.stderr.write(out);
50
40
  } catch (e) {
51
41
  console.log(msg);
@@ -54,8 +44,8 @@ function showBanner() {
54
44
 
55
45
  showBanner();
56
46
 
57
- // Windows: make postinstall interactive so npm shows our output. User presses Enter to finish.
58
- if (process.platform === 'win32') {
47
+ // Windows + TTY: interactive so user sees banner and presses Enter (avoids hang when npm pipes stdin).
48
+ if (process.platform === 'win32' && process.stdin.isTTY) {
59
49
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
60
50
  rl.question('\nPress Enter to continue...', () => {
61
51
  rl.close();