@mockingbird_konwlage_cli/cli 1.0.0 → 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 (2) hide show
  1. package/index.js +18 -38
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -22,49 +22,29 @@ program
22
22
 
23
23
  console.log(chalk.blue(`[Mockingbird] Installing skill '${slug}' for agent '${agent}'...`));
24
24
 
25
- // Map known Mockingbird prefixes to their actual GitHub raw paths
26
- // e.g., pytorch-skills/document-public-apis -> https://raw.githubusercontent.com/pytorch/pytorch/main/.claude/skills/document-public-apis/SKILL.md
27
-
28
- // First, try to see if it matches our known internal mapping
29
- const repoMap = {
30
- "anthropic-skills": "anthropics/skills/main/skills",
31
- "awesome-copilot": "github/awesome-copilot/main/skills",
32
- "gemini-cli": "google-gemini/gemini-cli/main/.gemini/skills",
33
- "openai-skills": "openai/skills/main/skills",
34
- "playwright-skills": "microsoft/playwright/main/packages/playwright/src/skill",
35
- "pytorch-skills": "pytorch/pytorch/main/.claude/skills",
36
- "antfu-skills": "antfu/skills/main/skills",
37
- "dimillian-skills": "Dimillian/Skills/main",
38
- "prompts-chat-skills": "f/prompts.chat/main/.windsurf/skills",
39
- "huggingface-skills": "huggingface/skills/main/skills"
40
- };
41
-
42
- let rawUrl = '';
43
-
44
- if (slug.includes('/')) {
45
- const parts = slug.split('/');
46
- const prefix = parts[0];
47
- const skillName = parts[1];
48
-
49
- if (repoMap[prefix]) {
50
- rawUrl = `https://raw.githubusercontent.com/${repoMap[prefix]}/${skillName}/SKILL.md`;
25
+ // The Mockingbird Knowledge API URL
26
+ const API_BASE_URL = process.env.MOCKINGBIRD_API_URL || 'https://mockingbird.youmind.com';
27
+ const apiUrl = `${API_BASE_URL}/api/public/skills/raw/${slug}`;
28
+
29
+ let skillContent = null;
30
+
31
+ try {
32
+ process.stdout.write(chalk.gray(`Fetching from Mockingbird API: ${apiUrl} ... `));
33
+ const response = await axios.get(apiUrl, { timeout: 10000 });
34
+ skillContent = response.data;
35
+ console.log(chalk.green('OK'));
36
+ } catch (error) {
37
+ console.log(chalk.red('NOT FOUND'));
38
+ console.error(chalk.red(`\n✖ Error: Failed to find SKILL.md for '${slug}' from Mockingbird Knowledge Base.`));
39
+ if (error.response && error.response.status === 404) {
40
+ console.error(chalk.gray(`The skill might not be registered or supported yet.`));
51
41
  } else {
52
- // Generic fallback for org/repo/skillname
53
- let filePath = parts.slice(2).join('/') || 'SKILL.md';
54
- if (!filePath.endsWith('.md')) {
55
- filePath += filePath ? '/SKILL.md' : 'SKILL.md';
56
- }
57
- rawUrl = `https://raw.githubusercontent.com/${parts[0]}/${parts[1]}/main/${filePath}`;
42
+ console.error(chalk.gray(`Details: ${error.message}`));
58
43
  }
59
- } else {
60
- rawUrl = `https://raw.githubusercontent.com/mockingbird-ai/skills/main/${slug}/SKILL.md`;
44
+ process.exit(1);
61
45
  }
62
46
 
63
47
  try {
64
- console.log(chalk.gray(`Fetching from: ${rawUrl}`));
65
- const response = await axios.get(rawUrl);
66
- const skillContent = response.data;
67
-
68
48
  await installForAgent(agent, slug, skillContent);
69
49
  console.log(chalk.green(`\n✓ Successfully installed skill '${slug}' for ${agent}!`));
70
50
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mockingbird_konwlage_cli/cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Mockingbird AI Developer Client CLI",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "mockingbird-cli": "./index.js",
8
- "@mockingbird-ai/cli": "./index.js"
7
+ "mockingbird-cli": "index.js",
8
+ "cli": "index.js"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1"