@rubytech/taskmaster 1.0.82 → 1.0.84

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.82",
3
- "commit": "4707adc4b128245c2e265a9e6fec6b2d0315ad08",
4
- "builtAt": "2026-02-20T22:56:04.720Z"
2
+ "version": "1.0.84",
3
+ "commit": "c6ef29a833abff78398911d513b9cc2585049604",
4
+ "builtAt": "2026-02-20T23:01:26.439Z"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/taskmaster",
3
- "version": "1.0.82",
3
+ "version": "1.0.84",
4
4
  "description": "AI-powered business assistant for small businesses",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -164,7 +164,7 @@ if [ "$PLATFORM" = "linux" ]; then
164
164
 
165
165
  # Tailscale (for optional internet access via Funnel)
166
166
  if ! command -v tailscale >/dev/null 2>&1; then
167
- curl -fsSL https://tailscale.com/install.sh | sh >/dev/null 2>&1 \
167
+ curl -fsSL https://tailscale.com/install.sh | as_root sh >/dev/null 2>&1 \
168
168
  && echo " tailscale installed" \
169
169
  || echo " tailscale install failed (continuing)"
170
170
  else
@@ -254,12 +254,70 @@ function applyPatchFile({ patchPath, targetDir }) {
254
254
  applyPatchSet({ patchText, targetDir });
255
255
  }
256
256
 
257
+ /**
258
+ * On Linux global installs (including upgrades), ensure platform dependencies
259
+ * that the original install may have missed are present. Runs as root since
260
+ * `sudo npm install -g` passes root to postinstall.
261
+ */
262
+ function ensurePlatformDeps() {
263
+ if (process.platform !== "linux") return;
264
+ // Only run for global installs (deployed devices), not local dev
265
+ const isGlobal =
266
+ process.env.npm_config_global === "true" ||
267
+ // npm 9+ sets this instead
268
+ (getRepoRoot().includes("/lib/node_modules/") && !fs.existsSync(path.join(getRepoRoot(), ".git")));
269
+ if (!isGlobal) return;
270
+
271
+ const deps = [
272
+ {
273
+ name: "tailscale",
274
+ check: "tailscale",
275
+ install: ["sh", "-c", "curl -fsSL https://tailscale.com/install.sh | sh"],
276
+ },
277
+ {
278
+ name: "avahi-daemon",
279
+ check: "avahi-browse",
280
+ install: ["apt-get", "install", "-y", "avahi-daemon", "avahi-utils"],
281
+ },
282
+ ];
283
+
284
+ for (const dep of deps) {
285
+ const exists = spawnSync("command", ["-v", dep.check], { shell: true, stdio: "ignore" });
286
+ if (exists.status === 0) continue;
287
+ console.log(`[postinstall] Installing ${dep.name}...`);
288
+ const result = spawnSync(dep.install[0], dep.install.slice(1), {
289
+ stdio: "inherit",
290
+ timeout: 120_000,
291
+ });
292
+ if (result.status === 0) {
293
+ console.log(`[postinstall] ${dep.name} installed`);
294
+ } else {
295
+ console.warn(`[postinstall] ${dep.name} install failed (continuing)`);
296
+ }
297
+ }
298
+
299
+ // Ensure hostname resolves in /etc/hosts (prevents sudo timeouts)
300
+ try {
301
+ const hostname = spawnSync("hostname", [], { encoding: "utf-8" }).stdout.trim();
302
+ if (hostname) {
303
+ const hosts = fs.readFileSync("/etc/hosts", "utf-8");
304
+ if (!hosts.includes(hostname)) {
305
+ fs.appendFileSync("/etc/hosts", `\n127.0.1.1\t${hostname}\n`);
306
+ console.log(`[postinstall] Added ${hostname} to /etc/hosts`);
307
+ }
308
+ }
309
+ } catch {
310
+ // non-critical
311
+ }
312
+ }
313
+
257
314
  function main() {
258
315
  const repoRoot = getRepoRoot();
259
316
  process.chdir(repoRoot);
260
317
 
261
318
  ensureExecutable(path.join(repoRoot, "dist", "entry.js"));
262
319
  setupGitHooks({ repoRoot });
320
+ ensurePlatformDeps();
263
321
 
264
322
  if (!shouldApplyPnpmPatchedDependenciesFallback()) {
265
323
  return;