twokey 1.0.8 → 1.0.9

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.
@@ -30,7 +30,7 @@ if (isRoot && sudoUser && sudoUser !== "root") {
30
30
 
31
31
  const delegated = spawn(
32
32
  "sudo",
33
- ["-u", sudoUser, "-H", process.execPath, cliPath, "--desktop", "--enable-autostart", "--quiet"],
33
+ ["-u", sudoUser, "-H", process.execPath, cliPath, "--desktop", "--enable-autostart"],
34
34
  {
35
35
  stdio: "ignore",
36
36
  shell: false,
@@ -41,7 +41,7 @@ if (isRoot && sudoUser && sudoUser !== "root") {
41
41
  delegated.on("error", () => process.exit(0));
42
42
  delegated.on("close", () => process.exit(0));
43
43
  } else {
44
- const child = spawn(process.execPath, [cliPath, "--desktop", "--enable-autostart", "--quiet"], {
44
+ const child = spawn(process.execPath, [cliPath, "--desktop", "--enable-autostart"], {
45
45
  stdio: "ignore",
46
46
  shell: false,
47
47
  });
package/bin/twokey.js CHANGED
@@ -6,7 +6,7 @@ import os from "node:os";
6
6
  import path from "node:path";
7
7
  import readline from "node:readline";
8
8
 
9
- const VERSION = process.env.npm_package_version || "1.0.8";
9
+ const VERSION = process.env.npm_package_version || "1.0.9";
10
10
  const DEFAULT_MODEL = process.env.TWOKEY_OLLAMA_MODEL || "qwen2.5:3b";
11
11
  const DEFAULT_OLLAMA_URL = process.env.TWOKEY_OLLAMA_URL || "http://127.0.0.1:11434";
12
12
  const LATEST_RELEASE_API = "https://api.github.com/repos/meinzeug/twokey/releases/latest";
@@ -380,14 +380,34 @@ async function ensureUserService(command) {
380
380
 
381
381
  await fs.promises.writeFile(servicePath, content, "utf8");
382
382
 
383
- await runSystemctlUser(["daemon-reload"]);
384
- await runSystemctlUser(["enable", "--now", "twokey.service"]);
383
+ try {
384
+ await runSystemctlUser(["daemon-reload"]);
385
+ await runSystemctlUser(["enable", "--now", "twokey.service"]);
386
+ } catch {
387
+ // Fallback for install contexts where user DBus is not reachable.
388
+ await enableServiceBySymlink(systemdDir, servicePath);
389
+ }
385
390
 
386
391
  if (!QUIET) {
387
392
  console.log("TwoKey systemd user service enabled: twokey.service");
388
393
  }
389
394
  }
390
395
 
396
+ async function enableServiceBySymlink(systemdDir, servicePath) {
397
+ const wantsDir = path.join(systemdDir, "default.target.wants");
398
+ const wantsLink = path.join(wantsDir, "twokey.service");
399
+ await fs.promises.mkdir(wantsDir, { recursive: true });
400
+
401
+ try {
402
+ await fs.promises.lstat(wantsLink);
403
+ await fs.promises.unlink(wantsLink);
404
+ } catch {
405
+ // Link does not exist yet.
406
+ }
407
+
408
+ await fs.promises.symlink(servicePath, wantsLink);
409
+ }
410
+
391
411
  async function runSystemctlUser(argsList) {
392
412
  return new Promise((resolve, reject) => {
393
413
  const child = spawn("systemctl", ["--user", ...argsList], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twokey",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Linux-first desktop AI assistant built with Tauri, React, and TypeScript.",
5
5
  "license": "MIT",
6
6
  "repository": {