nexscope 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexscope",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "NexScope CLI tool",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const { spawn } = require('child_process');
4
- const https = require('https');
5
4
  const { Listr } = require('listr2');
6
5
 
7
6
  const SKILLS_REPO = 'nexscope-ai/eCommerce-Skills';
8
- const REPO_API = 'https://api.github.com/repos/nexscope-ai/eCommerce-Skills/contents';
9
7
 
10
8
  function printHelp() {
11
9
  console.log(`
@@ -30,22 +28,16 @@ Examples:
30
28
  `);
31
29
  }
32
30
 
33
- function get(url) {
34
- return new Promise((resolve, reject) => {
35
- https.get(url, { headers: { 'User-Agent': 'nexscope-cli' } }, (res) => {
36
- let data = '';
37
- res.on('data', (chunk) => (data += chunk));
38
- res.on('end', () => {
39
- if (res.statusCode === 200) resolve(data);
40
- else reject(new Error(`HTTP ${res.statusCode}: ${url}`));
41
- });
42
- }).on('error', reject);
43
- });
44
- }
45
-
46
31
  async function fetchSkillList() {
47
- const data = await get(REPO_API);
48
- return JSON.parse(data).filter((i) => i.type === 'dir').map((i) => i.name);
32
+ const output = await spawnAsync('npx', ['skills', 'add', SKILLS_REPO, '--list']);
33
+ // Strip ANSI escape codes and extract skill names from lines like "│ <skill-name>"
34
+ const clean = output.replace(/\x1B\[[0-9;?]*[a-zA-Z]/g, '');
35
+ const skills = [];
36
+ for (const line of clean.split('\n')) {
37
+ const match = line.match(/[│|]\s{4}([a-z][a-z0-9-]+)\s*$/);
38
+ if (match) skills.push(match[1]);
39
+ }
40
+ return skills;
49
41
  }
50
42
 
51
43
  function parseDirFlags(args) {