@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.
- package/index.js +18 -38
- 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
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Mockingbird AI Developer Client CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"mockingbird-cli": "
|
|
8
|
-
"
|
|
7
|
+
"mockingbird-cli": "index.js",
|
|
8
|
+
"cli": "index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1"
|