@ctxthuta/cxops 1.0.2 → 1.0.3
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/bin/cxops.js +85 -0
- package/package.json +3 -2
package/bin/cxops.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const os = require('os');
|
|
11
|
+
const https = require('https');
|
|
11
12
|
const { spawn, spawnSync } = require('child_process');
|
|
12
13
|
const readline = require('readline/promises');
|
|
13
14
|
|
|
@@ -399,6 +400,82 @@ function runDoctor() {
|
|
|
399
400
|
console.log('='.repeat(70));
|
|
400
401
|
}
|
|
401
402
|
|
|
403
|
+
function getPackageVersion() {
|
|
404
|
+
try {
|
|
405
|
+
const pkgPath = path.join(ROOT_DIR, 'package.json');
|
|
406
|
+
if (fs.existsSync(pkgPath)) {
|
|
407
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
408
|
+
return pkg.version || '1.0.3';
|
|
409
|
+
}
|
|
410
|
+
} catch (_) {}
|
|
411
|
+
return '1.0.3';
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function fetchLatestNpmVersion() {
|
|
415
|
+
return new Promise((resolve) => {
|
|
416
|
+
const req = https.get('https://registry.npmjs.org/@ctxthuta%2Fcxops/latest', {
|
|
417
|
+
headers: { 'User-Agent': 'cxops-cli' },
|
|
418
|
+
timeout: 2500,
|
|
419
|
+
}, (res) => {
|
|
420
|
+
if (res.statusCode !== 200) {
|
|
421
|
+
resolve(null);
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
let data = '';
|
|
425
|
+
res.on('data', chunk => data += chunk);
|
|
426
|
+
res.on('end', () => {
|
|
427
|
+
try {
|
|
428
|
+
const parsed = JSON.parse(data);
|
|
429
|
+
resolve(parsed.version || null);
|
|
430
|
+
} catch (_) {
|
|
431
|
+
resolve(null);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
req.on('error', () => resolve(null));
|
|
436
|
+
req.on('timeout', () => {
|
|
437
|
+
req.destroy();
|
|
438
|
+
resolve(null);
|
|
439
|
+
});
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
async function runVersion(detailed = false) {
|
|
444
|
+
const currentVer = getPackageVersion();
|
|
445
|
+
if (!detailed) {
|
|
446
|
+
console.log(`@ctxthuta/cxops v${currentVer}`);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
console.log('='.repeat(70));
|
|
451
|
+
console.log(`CORTEXOPS FRAMEWORK VERSION: v${currentVer}`);
|
|
452
|
+
console.log('='.repeat(70));
|
|
453
|
+
console.log(`Package Name: @ctxthuta/cxops`);
|
|
454
|
+
console.log(`Current Version: v${currentVer}`);
|
|
455
|
+
console.log(`Node.js Runtime: ${process.version}`);
|
|
456
|
+
console.log(`Platform: ${process.platform} (${process.arch})`);
|
|
457
|
+
|
|
458
|
+
const py = getVenvPython();
|
|
459
|
+
if (py) {
|
|
460
|
+
const pyVer = spawnSync(py, ['--version'], { encoding: 'utf-8' }).stdout.trim();
|
|
461
|
+
console.log(`Python Runtime: ${pyVer}`);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
process.stdout.write('Checking npm registry for updates... ');
|
|
465
|
+
const latest = await fetchLatestNpmVersion();
|
|
466
|
+
if (latest) {
|
|
467
|
+
if (latest === currentVer) {
|
|
468
|
+
console.log(`[UP TO DATE] (v${latest} is latest)`);
|
|
469
|
+
} else {
|
|
470
|
+
console.log(`[UPDATE AVAILABLE] (Latest: v${latest})`);
|
|
471
|
+
console.log(`Run "npm install -g @ctxthuta/cxops@latest" to upgrade.`);
|
|
472
|
+
}
|
|
473
|
+
} else {
|
|
474
|
+
console.log('[SKIPPED] (Offline or registry unreachable)');
|
|
475
|
+
}
|
|
476
|
+
console.log('='.repeat(70));
|
|
477
|
+
}
|
|
478
|
+
|
|
402
479
|
function printHelp() {
|
|
403
480
|
console.log(`CortexOps Multi-Agent Framework CLI
|
|
404
481
|
|
|
@@ -412,6 +489,7 @@ Commands:
|
|
|
412
489
|
watch Continuously monitor the dashboard (auto-refresh)
|
|
413
490
|
verify Verify all 12 declarative subagent definitions
|
|
414
491
|
run "<prompt>" Dispatch an autonomous multi-agent task via Python SDK
|
|
492
|
+
version, -v, --version Display framework version and check for updates
|
|
415
493
|
link Link Antigravity global plugin symlink/junction
|
|
416
494
|
unlink Remove Antigravity global plugin symlink/junction
|
|
417
495
|
help, --help, -h Display this command reference
|
|
@@ -446,6 +524,13 @@ async function main() {
|
|
|
446
524
|
case 'verify':
|
|
447
525
|
executePythonScript(VERIFY_SCRIPT, args.slice(1));
|
|
448
526
|
break;
|
|
527
|
+
case 'version':
|
|
528
|
+
case '--version':
|
|
529
|
+
case '-v':
|
|
530
|
+
case '-version':
|
|
531
|
+
const isDetailed = command === 'version' || args.includes('--check') || args.includes('-c');
|
|
532
|
+
await runVersion(isDetailed);
|
|
533
|
+
break;
|
|
449
534
|
case 'run':
|
|
450
535
|
if (args.length < 2) {
|
|
451
536
|
console.error('[ERROR] Task prompt required. Usage: cxops run "<prompt>"');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctxthuta/cxops",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "CortexOps Multi-Agent Framework: Autonomous engineering and research operating system for Google Antigravity and Python SDK.",
|
|
5
5
|
"main": "bin/cxops.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"dashboard": "node ./bin/cxops.js dashboard",
|
|
15
15
|
"watch": "node ./bin/cxops.js watch",
|
|
16
16
|
"verify": "node ./bin/cxops.js verify",
|
|
17
|
-
"doctor": "node ./bin/cxops.js doctor"
|
|
17
|
+
"doctor": "node ./bin/cxops.js doctor",
|
|
18
|
+
"version": "node ./bin/cxops.js version"
|
|
18
19
|
},
|
|
19
20
|
"keywords": [
|
|
20
21
|
"cortexops",
|