@agent-webui/ai-desk-daemon 1.0.54 → 1.0.56

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/lib/platform.js CHANGED
@@ -9,6 +9,15 @@ const { getBinaryPackageByPlatformKey, resolveInstalledPackageDir } = require('.
9
9
 
10
10
  const VERSION = require('../package.json').version;
11
11
 
12
+ function readPackageVersion(packageDir) {
13
+ try {
14
+ const packageJsonPath = path.join(packageDir, 'package.json');
15
+ return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')).version || '';
16
+ } catch {
17
+ return '';
18
+ }
19
+ }
20
+
12
21
  /**
13
22
  * Detect current platform and architecture
14
23
  */
@@ -49,6 +58,17 @@ function getDaemonBinaryPath() {
49
58
  if (packageDir) {
50
59
  const packageBinaryPath = path.join(packageDir, 'bin', binaryName);
51
60
  if (fs.existsSync(packageBinaryPath)) {
61
+ const packageVersion = readPackageVersion(packageDir);
62
+ if (packageVersion && packageVersion !== VERSION) {
63
+ throw new Error(
64
+ `Daemon binary package version mismatch: ${binaryPackage.packageName}@${packageVersion} ` +
65
+ `does not match @agent-webui/ai-desk-daemon@${VERSION}.\n` +
66
+ 'Update the active AI Desk installation:\n' +
67
+ ' npm install @agent-webui/ai-desk@latest --include=optional\n' +
68
+ 'Or, for a global install:\n' +
69
+ ' npm install -g @agent-webui/ai-desk@latest --include=optional'
70
+ );
71
+ }
52
72
  return packageBinaryPath;
53
73
  }
54
74
  }
@@ -149,6 +149,11 @@ function findWorkspaceSiblingPackageDir(packageName) {
149
149
 
150
150
  function resolveInstalledPackageDir(packageName, searchPaths = []) {
151
151
  const path = require('path');
152
+ const workspacePackageDir = findWorkspaceSiblingPackageDir(packageName);
153
+ if (workspacePackageDir) {
154
+ return workspacePackageDir;
155
+ }
156
+
152
157
  const defaultPaths = [path.join(__dirname, '..'), process.cwd(), ...searchPaths];
153
158
  try {
154
159
  const packageJsonPath = require.resolve(`${packageName}/package.json`, {
@@ -156,7 +161,7 @@ function resolveInstalledPackageDir(packageName, searchPaths = []) {
156
161
  });
157
162
  return path.dirname(packageJsonPath);
158
163
  } catch (error) {
159
- return findWorkspaceSiblingPackageDir(packageName);
164
+ return null;
160
165
  }
161
166
  }
162
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-webui/ai-desk-daemon",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "AI Desk Daemon - CLI tool for managing the AI Desk daemon service",
5
5
  "workspaces": [
6
6
  "packages/*"
@@ -39,16 +39,16 @@
39
39
  "chalk": "^4.1.2"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@agent-webui/ai-desk-daemon-darwin-arm64": "1.0.54",
43
- "@agent-webui/ai-desk-daemon-darwin-x64": "1.0.54",
44
- "@agent-webui/ai-desk-daemon-linux-arm64": "1.0.54",
45
- "@agent-webui/ai-desk-daemon-linux-x64": "1.0.54",
46
- "@agent-webui/ai-desk-daemon-win32-x64": "1.0.54",
47
- "@agent-webui/ai-desk-python-darwin-arm64": "1.0.54",
48
- "@agent-webui/ai-desk-python-darwin-x64": "1.0.54",
49
- "@agent-webui/ai-desk-python-linux-arm64": "1.0.54",
50
- "@agent-webui/ai-desk-python-linux-x64": "1.0.54",
51
- "@agent-webui/ai-desk-python-win32-x64": "1.0.54"
42
+ "@agent-webui/ai-desk-daemon-darwin-arm64": "1.0.56",
43
+ "@agent-webui/ai-desk-daemon-darwin-x64": "1.0.56",
44
+ "@agent-webui/ai-desk-daemon-linux-arm64": "1.0.56",
45
+ "@agent-webui/ai-desk-daemon-linux-x64": "1.0.56",
46
+ "@agent-webui/ai-desk-daemon-win32-x64": "1.0.56",
47
+ "@agent-webui/ai-desk-python-darwin-arm64": "1.0.56",
48
+ "@agent-webui/ai-desk-python-darwin-x64": "1.0.56",
49
+ "@agent-webui/ai-desk-python-linux-arm64": "1.0.56",
50
+ "@agent-webui/ai-desk-python-linux-x64": "1.0.56",
51
+ "@agent-webui/ai-desk-python-win32-x64": "1.0.56"
52
52
  },
53
53
  "repository": {
54
54
  "type": "git",