@agent-webui/ai-desk 1.0.60 → 1.0.61-beta4

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.
Files changed (2) hide show
  1. package/bin/aidesk.js +13 -3
  2. package/package.json +3 -3
package/bin/aidesk.js CHANGED
@@ -6,7 +6,7 @@ const { spawnSync } = require('child_process');
6
6
 
7
7
  const PACKAGE_NAME = '@agent-webui/ai-desk';
8
8
  const SKIP_UPDATE_ENV = 'AI_DESK_SKIP_SELF_UPDATE';
9
- const UPDATE_COMMANDS = new Set(['start', 'restart']);
9
+ const UPDATE_COMMANDS = new Set(['start', 'restart', 'upgrade']);
10
10
  const OFFICIAL_NPM_REGISTRY = 'https://registry.npmjs.org/';
11
11
 
12
12
  function readJSON(filePath) {
@@ -234,11 +234,18 @@ function updateBeforeCommand(args) {
234
234
  }
235
235
 
236
236
  const installedVersion = currentVersion();
237
- if (compareVersions(latestVersion, installedVersion) <= 0) {
237
+ const forceUpgrade = command === 'upgrade' && args.includes('--force');
238
+ const alreadyLatest = compareVersions(latestVersion, installedVersion) <= 0;
239
+ if (alreadyLatest && !forceUpgrade) {
240
+ if (command === 'upgrade') {
241
+ console.log(`AI Desk is already up to date (${installedVersion}).`);
242
+ process.exit(0);
243
+ }
238
244
  return;
239
245
  }
240
246
 
241
- console.log(`Updating AI Desk from ${installedVersion} to ${latestVersion}...`);
247
+ const verb = alreadyLatest ? 'Reinstalling' : 'Updating';
248
+ console.log(`${verb} AI Desk from ${installedVersion} to ${latestVersion}...`);
242
249
  const result = installLatestVersion(latestVersion);
243
250
  if (result.error) {
244
251
  throw result.error;
@@ -249,6 +256,9 @@ function updateBeforeCommand(args) {
249
256
 
250
257
  const updatedVersion = currentVersion();
251
258
  console.log(`AI Desk updated to ${updatedVersion}.`);
259
+ if (command === 'upgrade') {
260
+ process.exit(0);
261
+ }
252
262
  console.log(`Restarting aidesk ${command} with the updated CLI...`);
253
263
  restartWithUpdatedCli(args);
254
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-webui/ai-desk",
3
- "version": "1.0.60",
3
+ "version": "1.0.61-beta4",
4
4
  "description": "Single-install AI Desk package with daemon and default harnesses",
5
5
  "bin": {
6
6
  "aidesk": "bin/aidesk.js"
@@ -14,8 +14,8 @@
14
14
  "README.md"
15
15
  ],
16
16
  "dependencies": {
17
- "@agent-webui/ai-desk-daemon": "1.0.60",
18
- "@agent-webui/ai-desk-harness-gimp": "1.0.60"
17
+ "@agent-webui/ai-desk-daemon": "1.0.61-beta4",
18
+ "@agent-webui/ai-desk-harness-gimp": "1.0.61-beta4"
19
19
  },
20
20
  "license": "MIT"
21
21
  }