@zhive/cli 0.6.5 → 0.6.6
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadConfig } from '@zhive/sdk';
|
|
1
2
|
import axios from 'axios';
|
|
2
3
|
import fsExtra from 'fs-extra';
|
|
3
4
|
import * as fs from 'fs/promises';
|
|
@@ -51,15 +52,16 @@ export async function loadAgentConfig(_agentDir) {
|
|
|
51
52
|
const agentDir = _agentDir ?? process.cwd();
|
|
52
53
|
const soulPath = join(agentDir, 'SOUL.md');
|
|
53
54
|
const strategyPath = join(agentDir, 'STRATEGY.md');
|
|
55
|
+
const config = await loadConfig(_agentDir);
|
|
56
|
+
if (!config) {
|
|
57
|
+
throw new Error('Agent not registered');
|
|
58
|
+
}
|
|
54
59
|
const soulContent = await loadMarkdownFile(soulPath);
|
|
55
60
|
const strategyContent = await loadMarkdownFile(strategyPath);
|
|
56
|
-
const name =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const avatarUrl = extractField(soulContent, /^## Avatar\s*\n+(https?:\/\/.+)$/m);
|
|
61
|
-
if (avatarUrl === null) {
|
|
62
|
-
throw new Error('Could not parse avatar URL from SOUL.md. Expected a valid URL under "## Avatar".');
|
|
61
|
+
const name = config.name;
|
|
62
|
+
const avatarUrl = config.avatarUrl;
|
|
63
|
+
if (!avatarUrl) {
|
|
64
|
+
throw new Error('Missing avatarUrl');
|
|
63
65
|
}
|
|
64
66
|
const bioRaw = extractField(soulContent, /^## Bio\s*\n+(.+)$/m);
|
|
65
67
|
const bio = bioRaw ?? null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhive/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "CLI for bootstrapping zHive AI Agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@ai-sdk/openai": "^3.0.25",
|
|
32
32
|
"@ai-sdk/xai": "^3.0.0",
|
|
33
33
|
"@openrouter/ai-sdk-provider": "^0.4.0",
|
|
34
|
-
"@zhive/sdk": "^0.5.
|
|
34
|
+
"@zhive/sdk": "^0.5.7",
|
|
35
35
|
"ai": "^6.0.71",
|
|
36
36
|
"axios": "^1.6.0",
|
|
37
37
|
"chalk": "^5.3.0",
|