@agentuity/cli 0.1.27 → 0.1.29

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 (73) hide show
  1. package/dist/banner.js +2 -2
  2. package/dist/banner.js.map +1 -1
  3. package/dist/cmd/auth/signup.js +1 -1
  4. package/dist/cmd/auth/signup.js.map +1 -1
  5. package/dist/cmd/canary/index.d.ts.map +1 -1
  6. package/dist/cmd/canary/index.js +62 -127
  7. package/dist/cmd/canary/index.js.map +1 -1
  8. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  9. package/dist/cmd/cloud/deploy.js +1 -8
  10. package/dist/cmd/cloud/deploy.js.map +1 -1
  11. package/dist/cmd/dev/api.d.ts +3 -1
  12. package/dist/cmd/dev/api.d.ts.map +1 -1
  13. package/dist/cmd/dev/api.js +16 -2
  14. package/dist/cmd/dev/api.js.map +1 -1
  15. package/dist/cmd/dev/index.d.ts.map +1 -1
  16. package/dist/cmd/dev/index.js +16 -3
  17. package/dist/cmd/dev/index.js.map +1 -1
  18. package/dist/cmd/index.d.ts.map +1 -1
  19. package/dist/cmd/index.js +0 -6
  20. package/dist/cmd/index.js.map +1 -1
  21. package/dist/cmd/setup/index.d.ts.map +1 -1
  22. package/dist/cmd/setup/index.js +7 -9
  23. package/dist/cmd/setup/index.js.map +1 -1
  24. package/dist/cmd/upgrade/index.d.ts +7 -24
  25. package/dist/cmd/upgrade/index.d.ts.map +1 -1
  26. package/dist/cmd/upgrade/index.js +78 -263
  27. package/dist/cmd/upgrade/index.js.map +1 -1
  28. package/dist/command-prefix.d.ts +1 -1
  29. package/dist/command-prefix.d.ts.map +1 -1
  30. package/dist/command-prefix.js +4 -14
  31. package/dist/command-prefix.js.map +1 -1
  32. package/dist/download.d.ts.map +1 -1
  33. package/dist/download.js +2 -0
  34. package/dist/download.js.map +1 -1
  35. package/dist/errors.d.ts +2 -1
  36. package/dist/errors.d.ts.map +1 -1
  37. package/dist/errors.js +3 -0
  38. package/dist/errors.js.map +1 -1
  39. package/dist/legacy-check.d.ts.map +1 -1
  40. package/dist/legacy-check.js +2 -2
  41. package/dist/legacy-check.js.map +1 -1
  42. package/dist/types.d.ts +1 -0
  43. package/dist/types.d.ts.map +1 -1
  44. package/dist/types.js +1 -0
  45. package/dist/types.js.map +1 -1
  46. package/dist/utils/installation-type.d.ts +25 -0
  47. package/dist/utils/installation-type.d.ts.map +1 -0
  48. package/dist/utils/installation-type.js +43 -0
  49. package/dist/utils/installation-type.js.map +1 -0
  50. package/dist/version-check.d.ts.map +1 -1
  51. package/dist/version-check.js +16 -13
  52. package/dist/version-check.js.map +1 -1
  53. package/dist/version.js +1 -1
  54. package/dist/version.js.map +1 -1
  55. package/package.json +6 -6
  56. package/src/api-errors.md +2 -2
  57. package/src/banner.ts +2 -2
  58. package/src/cmd/auth/signup.ts +1 -1
  59. package/src/cmd/canary/index.ts +69 -144
  60. package/src/cmd/cloud/deploy.ts +1 -12
  61. package/src/cmd/dev/api.ts +19 -3
  62. package/src/cmd/dev/index.ts +23 -3
  63. package/src/cmd/index.ts +0 -7
  64. package/src/cmd/setup/index.ts +8 -9
  65. package/src/cmd/upgrade/index.ts +84 -302
  66. package/src/command-prefix.ts +4 -18
  67. package/src/download.ts +3 -0
  68. package/src/errors.ts +4 -0
  69. package/src/legacy-check.ts +2 -4
  70. package/src/types.ts +1 -0
  71. package/src/utils/installation-type.ts +51 -0
  72. package/src/version-check.ts +18 -13
  73. package/src/version.ts +1 -1
@@ -1,5 +1,6 @@
1
1
  import type { Config, Logger, CommandDefinition, SubcommandDefinition } from './types';
2
- import { isRunningFromExecutable, fetchLatestVersion } from './cmd/upgrade';
2
+ import { getInstallationType } from './utils/installation-type';
3
+ import { fetchLatestVersion } from './cmd/upgrade';
3
4
  import { getVersion, getCompareUrl, getReleaseUrl, toTag } from './version';
4
5
  import * as tui from './tui';
5
6
  import { saveConfig } from './config';
@@ -26,8 +27,9 @@ function shouldSkipCheck(
26
27
  subcommandDef: SubcommandDefinition | undefined,
27
28
  args: string[]
28
29
  ): boolean {
29
- // Skip if running via bun/bunx (not installed executable)
30
- if (!isRunningFromExecutable()) {
30
+ // Skip if not a global installation (can't auto-upgrade local/source installs)
31
+ const installationType = getInstallationType();
32
+ if (installationType !== 'global') {
31
33
  return true;
32
34
  }
33
35
 
@@ -154,25 +156,28 @@ async function updateCheckTimestamp(config: Config | null, logger: Logger): Prom
154
156
  }
155
157
 
156
158
  /**
157
- * Perform the upgrade and re-run the command
159
+ * Perform the upgrade using bun global install and re-run the command
158
160
  */
159
- async function performUpgrade(logger: Logger): Promise<void> {
161
+ async function performUpgrade(logger: Logger, targetVersion: string): Promise<void> {
160
162
  try {
161
- // Run upgrade command with --force since user already confirmed via prompt
162
- // Use process.execPath to get the actual binary path (not Bun.main which is virtual)
163
- logger.info('Starting upgrade...');
164
- await $`${process.execPath} upgrade --force`.quiet();
163
+ // Remove 'v' prefix for npm version
164
+ const npmVersion = targetVersion.replace(/^v/, '');
165
+
166
+ logger.info('Upgrading to version %s...', npmVersion);
167
+
168
+ // Use bun to install the specific version globally
169
+ await $`bun add -g @agentuity/cli@${npmVersion}`.quiet();
165
170
 
166
171
  // If we got here, the upgrade succeeded
167
172
  // Re-run the original command with the new binary
168
173
  const args = process.argv.slice(2);
169
- const newBinaryPath = process.execPath;
170
174
 
171
175
  logger.info('Upgrade successful! Restarting with new version...');
172
176
  console.log('');
173
177
 
174
- // Spawn new process with same arguments
175
- const proc = Bun.spawn([newBinaryPath, ...args], {
178
+ // Spawn new process using the global agentuity command
179
+ // This will use the newly installed version
180
+ const proc = Bun.spawn(['agentuity', ...args], {
176
181
  stdin: 'inherit',
177
182
  stdout: 'inherit',
178
183
  stderr: 'inherit',
@@ -251,7 +256,7 @@ export async function checkForUpdates(
251
256
  }
252
257
 
253
258
  // User wants to upgrade - perform it
254
- await performUpgrade(logger);
259
+ await performUpgrade(logger, latestVersion);
255
260
  } catch (error) {
256
261
  // Non-fatal - if we can't fetch the latest version (network error, timeout, etc.),
257
262
  // just log at debug level and continue without interrupting the user's command
package/src/version.ts CHANGED
@@ -16,7 +16,7 @@ export function getPackage(): typeof pkg {
16
16
  }
17
17
 
18
18
  export function getVersion(): string {
19
- return process.env.AGENTUITY_CLI_VERSION || getPackage().version || 'dev';
19
+ return getPackage().version || 'dev';
20
20
  }
21
21
 
22
22
  export function getPackageName(): string {