nex-framework-cli 1.0.9 → 1.0.10

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/cli/nex-cli.js CHANGED
@@ -28,10 +28,10 @@ program.configureHelp({
28
28
  program
29
29
  .name('nex')
30
30
  .description('NEX Framework - Framework completo de agentes AI')
31
- .version('1.0.8', '-v, --version', 'Mostra a versão')
31
+ .version('1.0.9', '-v, --version', 'Mostra a versão')
32
32
  .addHelpText('before', chalk.bold.cyan(`
33
33
  ╔════════════════════════════════════════════════════════════════╗
34
- ║ NEX Framework - CLI v1.0.8
34
+ ║ NEX Framework - CLI v1.0.9
35
35
  ║ Framework completo de agentes AI ║
36
36
  ╚════════════════════════════════════════════════════════════════╝
37
37
  `))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nex-framework-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "NEX CLI - Command-line interface for NEX Framework and Agent Marketplace",
5
5
  "type": "module",
6
6
  "main": "cli/nex-cli.js",
@@ -247,6 +247,8 @@ export default class NEXMarketplace {
247
247
 
248
248
  if (merged.length > 0) {
249
249
  spinner.succeed(`Found ${merged.length} available agents`)
250
+ } else if (apiError && localResults.length === 0) {
251
+ spinner.warn('No agents found (API unavailable and no local registry)')
250
252
  } else {
251
253
  spinner.warn('No agents found')
252
254
  }
@@ -254,9 +256,18 @@ export default class NEXMarketplace {
254
256
  // Display results
255
257
  this.displaySearchResults(merged)
256
258
 
257
- // Show warning if API failed but we have local results
258
- if (apiError && localResults.length > 0) {
259
- console.log(chalk.yellow('\n💡 Tip: Some agents may be missing. Check your connection or configure NEX_MARKETPLACE_API_URL\n'))
259
+ // Show helpful messages
260
+ if (apiError) {
261
+ if (localResults.length > 0) {
262
+ console.log(chalk.yellow('\n💡 Tip: Some agents may be missing. Check your connection or configure NEX_MARKETPLACE_API_URL\n'))
263
+ } else {
264
+ console.log(chalk.yellow('\n💡 Troubleshooting:'))
265
+ console.log(chalk.gray(' • The marketplace API is not responding'))
266
+ console.log(chalk.gray(' • No local registry found in this project'))
267
+ console.log(chalk.gray(' • Try: nex agent list (shows only installed agents)'))
268
+ console.log(chalk.gray(' • Or configure: export NEX_MARKETPLACE_API_URL=<your-url>'))
269
+ console.log(chalk.gray(' • Check your internet connection and try again later\n'))
270
+ }
260
271
  }
261
272
 
262
273
  return merged
@@ -377,6 +388,11 @@ export default class NEXMarketplace {
377
388
  async searchLocal(query, options = {}) {
378
389
  const results = []
379
390
 
391
+ // Check if registry path exists
392
+ if (!await fs.pathExists(this.registryPath)) {
393
+ return results
394
+ }
395
+
380
396
  const categories = ['planning', 'execution', 'community']
381
397
 
382
398
  for (const category of categories) {
@@ -384,36 +400,49 @@ export default class NEXMarketplace {
384
400
 
385
401
  if (!await fs.pathExists(categoryPath)) continue
386
402
 
387
- const agents = await fs.readdir(categoryPath)
388
-
389
- for (const agentId of agents) {
390
- const manifestPath = path.join(categoryPath, agentId, 'manifest.yaml')
391
-
392
- if (!await fs.pathExists(manifestPath)) continue
393
-
394
- const manifestFile = await fs.readFile(manifestPath, 'utf8')
395
- const manifest = yaml.parse(manifestFile)
403
+ try {
404
+ const agents = await fs.readdir(categoryPath)
396
405
 
397
- // Filter by query
398
- if (query) {
399
- const searchable = [
400
- manifest.name,
401
- manifest.description,
402
- manifest.tagline,
403
- ...(manifest.tags || [])
404
- ].join(' ').toLowerCase()
406
+ for (const agentId of agents) {
407
+ const manifestPath = path.join(categoryPath, agentId, 'manifest.yaml')
405
408
 
406
- if (!searchable.includes(query.toLowerCase())) {
409
+ if (!await fs.pathExists(manifestPath)) continue
410
+
411
+ try {
412
+ const manifestFile = await fs.readFile(manifestPath, 'utf8')
413
+ const manifest = yaml.parse(manifestFile)
414
+
415
+ // Filter by query
416
+ if (query) {
417
+ const searchable = [
418
+ manifest.name,
419
+ manifest.description,
420
+ manifest.tagline,
421
+ ...(manifest.tags || [])
422
+ ].join(' ').toLowerCase()
423
+
424
+ if (!searchable.includes(query.toLowerCase())) {
425
+ continue
426
+ }
427
+ }
428
+
429
+ // Filter by category
430
+ if (options.category && manifest.category !== options.category) {
431
+ continue
432
+ }
433
+
434
+ results.push({
435
+ agent_id: agentId,
436
+ ...manifest
437
+ })
438
+ } catch (error) {
439
+ // Skip invalid manifests
407
440
  continue
408
441
  }
409
442
  }
410
-
411
- // Filter by category
412
- if (options.category && manifest.category !== options.category) {
413
- continue
414
- }
415
-
416
- results.push(manifest)
443
+ } catch (error) {
444
+ // Skip categories that can't be read
445
+ continue
417
446
  }
418
447
  }
419
448