@dmmulroy/overseer 0.2.0 → 0.2.2

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/bin/os CHANGED
@@ -60,7 +60,11 @@ function getBinaryPath() {
60
60
  return join(dirname(pkgPath), "os");
61
61
  } catch {
62
62
  console.error(`Platform package not installed: ${pkg}`);
63
- console.error("Try: npm install -g @dmmulroy/overseer");
63
+ console.error(`\nTry one of:`);
64
+ console.error(` npm install -g ${pkg}`);
65
+ console.error(` npm install -g @dmmulroy/overseer --include=optional`);
66
+ console.error(`\nIf you have npm configured to omit optional deps, check:`);
67
+ console.error(` npm config get omit`);
64
68
  process.exit(1);
65
69
  }
66
70
  }
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall script to ensure platform-specific binary is installed.
4
+ *
5
+ * npm's optionalDependencies may not install when users have `omit=optional`
6
+ * in their npm config. This script detects that case and installs the
7
+ * correct platform package.
8
+ */
9
+ import { execFileSync } from "node:child_process";
10
+ import { createRequire } from "node:module";
11
+ import { platform, arch, env } from "node:process";
12
+ import { fileURLToPath } from "node:url";
13
+ import { dirname, join } from "node:path";
14
+ import { readFileSync, existsSync } from "node:fs";
15
+
16
+ const require = createRequire(import.meta.url);
17
+ const pkgRoot = dirname(dirname(fileURLToPath(import.meta.url)));
18
+
19
+ const PLATFORMS = {
20
+ "darwin-arm64": "@dmmulroy/overseer-darwin-arm64",
21
+ "darwin-x64": "@dmmulroy/overseer-darwin-x64",
22
+ "linux-arm64": "@dmmulroy/overseer-linux-arm64",
23
+ "linux-x64": "@dmmulroy/overseer-linux-x64",
24
+ "linux-arm64-musl": "@dmmulroy/overseer-linux-arm64-musl",
25
+ "linux-x64-musl": "@dmmulroy/overseer-linux-x64-musl",
26
+ };
27
+
28
+ function isMusl() {
29
+ if (platform !== "linux") return false;
30
+ if (existsSync("/etc/alpine-release")) return true;
31
+ try {
32
+ return readFileSync("/proc/self/maps", "utf8").includes("musl");
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+
38
+ function platformKey() {
39
+ const cpuArch = arch === "arm64" ? "arm64" : "x64";
40
+ const libc = isMusl() ? "-musl" : "";
41
+ return `${platform}-${cpuArch}${libc}`;
42
+ }
43
+
44
+ function ensureInstalled() {
45
+ // Allow opt-out for distros/offline environments
46
+ if (env.OVERSEER_SKIP_POSTINSTALL === "1") return;
47
+
48
+ const key = platformKey();
49
+ const pkg = PLATFORMS[key];
50
+
51
+ if (!pkg) {
52
+ // Unsupported platform - bin/os will handle the error message
53
+ return;
54
+ }
55
+
56
+ // Check if platform package is already installed
57
+ try {
58
+ require.resolve(`${pkg}/package.json`);
59
+ return;
60
+ } catch {
61
+ // Platform package not found, try to install it
62
+ }
63
+
64
+ const pkgJson = JSON.parse(
65
+ readFileSync(join(pkgRoot, "package.json"), "utf8")
66
+ );
67
+ const version = pkgJson.version;
68
+ const ua = env.npm_config_user_agent || "";
69
+ const isNpm = ua.includes("npm/");
70
+
71
+ if (!isNpm) {
72
+ // Don't try to auto-install for pnpm/yarn - give clear instructions
73
+ console.error(`\n⚠️ Platform package missing: ${pkg}`);
74
+ console.error(` Your package manager may be omitting optionalDependencies.`);
75
+ console.error(` Install manually: npm install -g ${pkg}@${version}\n`);
76
+ process.exit(1);
77
+ }
78
+
79
+ console.log(`Installing platform package: ${pkg}@${version}`);
80
+
81
+ try {
82
+ execFileSync(
83
+ platform === "win32" ? "npm.cmd" : "npm",
84
+ [
85
+ "install",
86
+ "--no-save",
87
+ "--no-package-lock",
88
+ "--silent",
89
+ "--prefix",
90
+ pkgRoot,
91
+ `${pkg}@${version}`,
92
+ ],
93
+ { stdio: "inherit" }
94
+ );
95
+ } catch (err) {
96
+ console.error(`\n⚠️ Failed to install platform package: ${pkg}`);
97
+ console.error(` Try installing manually: npm install -g ${pkg}@${version}`);
98
+ console.error(`\n If you have npm configured to omit optional deps, try:`);
99
+ console.error(` npm config set omit ""`);
100
+ console.error(` or reinstall with:`);
101
+ console.error(` npm install -g @dmmulroy/overseer --include=optional\n`);
102
+ process.exit(1);
103
+ }
104
+ }
105
+
106
+ ensureInstalled();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmmulroy/overseer",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Codemode MCP server for agent task management",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,13 +11,16 @@
11
11
  "bin/",
12
12
  "dist/"
13
13
  ],
14
+ "scripts": {
15
+ "postinstall": "node ./bin/postinstall.mjs"
16
+ },
14
17
  "optionalDependencies": {
15
- "@dmmulroy/overseer-darwin-arm64": "0.2.0",
16
- "@dmmulroy/overseer-darwin-x64": "0.2.0",
17
- "@dmmulroy/overseer-linux-arm64": "0.2.0",
18
- "@dmmulroy/overseer-linux-x64": "0.2.0",
19
- "@dmmulroy/overseer-linux-arm64-musl": "0.2.0",
20
- "@dmmulroy/overseer-linux-x64-musl": "0.2.0"
18
+ "@dmmulroy/overseer-darwin-arm64": "0.2.2",
19
+ "@dmmulroy/overseer-darwin-x64": "0.2.2",
20
+ "@dmmulroy/overseer-linux-arm64": "0.2.2",
21
+ "@dmmulroy/overseer-linux-x64": "0.2.2",
22
+ "@dmmulroy/overseer-linux-arm64-musl": "0.2.2",
23
+ "@dmmulroy/overseer-linux-x64-musl": "0.2.2"
21
24
  },
22
25
  "dependencies": {
23
26
  "@modelcontextprotocol/sdk": "^1.0.4"