@leejungkiin/awkit 1.0.9 → 1.1.0

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 (3) hide show
  1. package/VERSION +1 -1
  2. package/bin/awk.js +50 -8
  3. package/package.json +1 -1
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.7
1
+ 1.1.0
package/bin/awk.js CHANGED
@@ -413,21 +413,63 @@ function cmdUninstall() {
413
413
  }
414
414
 
415
415
  function cmdUpdate() {
416
- info(`Updating to AWK v${AWK_VERSION}...`);
416
+ info('Checking for updates on npm registry...');
417
417
 
418
- // Check current version
419
- let currentVersion = '0.0.0';
418
+ // 1. Fetch latest version from npm
419
+ let npmLatest = null;
420
+ try {
421
+ npmLatest = execSync(
422
+ 'npm view @leejungkiin/awkit version',
423
+ { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 5000 }
424
+ ).trim();
425
+ } catch (_) {
426
+ warn('Could not reach npm registry (offline?). Falling back to local check.');
427
+ }
428
+
429
+ // 2. Read currently installed version
430
+ let installedVersion = '0.0.0';
420
431
  if (fs.existsSync(TARGETS.versionFile)) {
421
- currentVersion = fs.readFileSync(TARGETS.versionFile, 'utf8').trim();
432
+ installedVersion = fs.readFileSync(TARGETS.versionFile, 'utf8').trim();
422
433
  }
423
434
 
424
- if (currentVersion === AWK_VERSION) {
425
- ok(`Already on latest version (${AWK_VERSION})`);
435
+ const targetVersion = npmLatest || AWK_VERSION;
436
+
437
+ log('');
438
+ log(`${C.gray} npm latest: v${npmLatest || '(unknown)'}${C.reset}`);
439
+ log(`${C.gray} installed: v${installedVersion}${C.reset}`);
440
+ log(`${C.gray} local repo: v${AWK_VERSION}${C.reset}`);
441
+ log('');
442
+
443
+ // 3. Already up-to-date?
444
+ if (npmLatest && npmLatest === installedVersion) {
445
+ ok(`Already on the latest version (v${installedVersion}) 🎉`);
426
446
  return;
427
447
  }
428
448
 
429
- info(`Upgrading from ${currentVersion}${AWK_VERSION}`);
430
- cmdInstall();
449
+ // 4. New version available on npm install from registry
450
+ if (npmLatest && npmLatest !== installedVersion) {
451
+ info(`Upgrading: v${installedVersion} → v${npmLatest}`);
452
+ info('Running: npm install -g @leejungkiin/awkit');
453
+ try {
454
+ execSync('npm install -g @leejungkiin/awkit', { stdio: 'inherit' });
455
+ } catch (e) {
456
+ err(`npm install failed: ${e.message}`);
457
+ dim('Try manually: npm install -g @leejungkiin/awkit');
458
+ return;
459
+ }
460
+ log('');
461
+ info('Applying new workflows, skills & schemas...');
462
+ cmdInstall();
463
+ return;
464
+ }
465
+
466
+ // 5. Offline fallback: compare AWK_VERSION (local repo) vs installed
467
+ if (installedVersion === AWK_VERSION) {
468
+ ok(`Already on latest version (v${AWK_VERSION}) — could not verify with npm`);
469
+ } else {
470
+ info(`Upgrading from v${installedVersion} → v${AWK_VERSION} (local only, npm unreachable)`);
471
+ cmdInstall();
472
+ }
431
473
  }
432
474
 
433
475
  function cmdDoctor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leejungkiin/awkit",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "AWKit v1.0.9 — Antigravity Workflow Kit. Unified AI agent orchestration system.",
5
5
  "main": "bin/awk.js",
6
6
  "bin": {