cowork-os 0.3.61 → 0.3.62

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cowork-os",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "description": "CoWork OS - The operating system for personal AI assistants",
5
5
  "overrides": {
6
6
  "undici": "^7.0.0"
@@ -43,7 +43,6 @@
43
43
  "setup": "npm install --no-audit --no-fund && { sleep 2; i=1; max=${COWORK_SETUP_NATIVE_OUTER_ATTEMPTS:-6}; delay=2; while [ $i -le $max ]; do echo \"[cowork] setup:native (outer attempt $i/$max)\"; sh scripts/setup_native_retry.sh; s=$?; if [ $s -eq 0 ]; then exit 0; fi; if [ $s -ne 137 ] && [ $s -ne 9 ]; then exit $s; fi; echo \"[cowork] setup:native was killed; retrying in ${delay}s...\"; sleep $delay; delay=$((delay * 2)); if [ $delay -gt 20 ]; then delay=20; fi; i=$((i + 1)); done; exit $s; }",
44
44
  "setup:native": "sleep 2; i=1; max=${COWORK_SETUP_NATIVE_OUTER_ATTEMPTS:-6}; delay=2; while [ $i -le $max ]; do echo \"[cowork] setup:native (outer attempt $i/$max)\"; sh scripts/setup_native_retry.sh; s=$?; if [ $s -eq 0 ]; then exit 0; fi; if [ $s -ne 137 ] && [ $s -ne 9 ]; then exit $s; fi; echo \"[cowork] setup:native was killed; retrying in ${delay}s...\"; sleep $delay; delay=$((delay * 2)); if [ $delay -gt 20 ]; then delay=20; fi; i=$((i + 1)); done; exit $s",
45
45
  "setup:server": "npm install && npm rebuild --ignore-scripts=false better-sqlite3",
46
- "postinstall": "node scripts/postinstall.mjs",
47
46
  "dev": "concurrently \"npm run dev:react\" \"npm run dev:electron\"",
48
47
  "dev:react": "vite",
49
48
  "dev:electron": "tsc -p tsconfig.electron.json && cross-env NODE_ENV=development electron .",
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Best-effort postinstall hook.
4
- *
5
- * Why this exists:
6
- * - npm installs of this package can run in environments where some build tools
7
- * are unavailable.
8
- * - Postinstall must never hard-fail the whole install for end users.
9
- *
10
- * Behavior:
11
- * - If Electron + better-sqlite3 are present, try native setup.
12
- * - If setup fails, log a warning and continue (exit 0).
13
- */
14
-
15
- import { spawnSync } from "node:child_process";
16
- import fs from "node:fs";
17
- import path from "node:path";
18
- import process from "node:process";
19
-
20
- function exists(relPath) {
21
- return fs.existsSync(path.join(process.cwd(), relPath));
22
- }
23
-
24
- function log(msg) {
25
- console.log(`[cowork] ${msg}`);
26
- }
27
-
28
- function warn(msg) {
29
- console.warn(`[cowork] ${msg}`);
30
- }
31
-
32
- function main() {
33
- const hasElectron = exists("node_modules/electron/package.json");
34
- const hasBetterSqlite3 = exists("node_modules/better-sqlite3/package.json");
35
-
36
- if (!hasElectron || !hasBetterSqlite3) {
37
- log(
38
- "postinstall: skipping native setup (electron or better-sqlite3 not present in this install context)."
39
- );
40
- process.exit(0);
41
- }
42
-
43
- const setupDriver = path.join(process.cwd(), "scripts", "setup_native_driver.mjs");
44
- if (!fs.existsSync(setupDriver)) {
45
- warn("postinstall: setup driver not found; skipping native setup.");
46
- process.exit(0);
47
- }
48
-
49
- log("postinstall: running native setup (best effort)...");
50
- const res = spawnSync(process.execPath, [setupDriver], {
51
- stdio: "inherit",
52
- env: process.env,
53
- cwd: process.cwd(),
54
- });
55
-
56
- if (res.status === 0) {
57
- log("postinstall: native setup complete.");
58
- process.exit(0);
59
- }
60
-
61
- const detail = res.signal ? `signal ${res.signal}` : `exit ${res.status ?? 1}`;
62
- warn(
63
- `postinstall: native setup failed (${detail}). Install continues. ` +
64
- "If needed, run `npm run setup` in the CoWork OS project."
65
- );
66
- process.exit(0);
67
- }
68
-
69
- main();