openpersona 0.14.2 → 0.14.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/bin/cli.js +1 -1
- package/lib/utils.js +38 -32
- package/package.json +1 -1
- package/presets/ai-girlfriend/manifest.json +1 -1
- package/presets/base/manifest.json +1 -1
- package/presets/health-butler/manifest.json +1 -1
- package/presets/life-assistant/manifest.json +1 -1
- package/presets/samantha/manifest.json +1 -1
- package/presets/stoic-mentor/manifest.json +1 -1
- package/skills/open-persona/SKILL.md +1 -1
package/bin/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ const PRESETS_DIR = path.join(PKG_ROOT, 'presets');
|
|
|
25
25
|
program
|
|
26
26
|
.name('openpersona')
|
|
27
27
|
.description('OpenPersona - Create, manage, and orchestrate agent personas')
|
|
28
|
-
.version('0.14.
|
|
28
|
+
.version('0.14.3');
|
|
29
29
|
|
|
30
30
|
if (process.argv.length === 2) {
|
|
31
31
|
process.argv.push('create');
|
package/lib/utils.js
CHANGED
|
@@ -116,67 +116,73 @@ function syncHeartbeat(config, manifestPath) {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
119
|
+
* Collect soft-ref hint from a layer entry (has `install` field).
|
|
120
|
+
* Does NOT execute any install — decision is left to the agent or user at runtime.
|
|
121
121
|
*
|
|
122
122
|
* @param {object} entry - Layer entry with optional `install` field (e.g. "clawhub:pkg")
|
|
123
123
|
* @param {string} layerName - Layer label for logging (e.g. "faculty", "skill", "body")
|
|
124
|
-
* @returns {
|
|
124
|
+
* @returns {{ name: string, install: string, layerName: string }|null}
|
|
125
125
|
*/
|
|
126
126
|
function installExternal(entry, layerName) {
|
|
127
|
-
if (!entry || !entry.install) return
|
|
128
|
-
const { execSync } = require('child_process');
|
|
127
|
+
if (!entry || !entry.install) return null;
|
|
129
128
|
const [source, pkg] = entry.install.split(':', 2);
|
|
130
|
-
if (!pkg || !SAFE_NAME_RE.test(pkg))
|
|
131
|
-
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
if (source === 'clawhub') {
|
|
136
|
-
execSync(`npx clawhub@latest install ${pkg}`, { stdio: 'inherit' });
|
|
137
|
-
printSuccess(`[${layerName}] Installed from ClawHub: ${pkg}`);
|
|
138
|
-
} else if (source === 'skillssh') {
|
|
139
|
-
execSync(`npx skills add ${pkg}`, { stdio: 'inherit' });
|
|
140
|
-
printSuccess(`[${layerName}] Installed from skills.sh: ${pkg}`);
|
|
141
|
-
} else {
|
|
142
|
-
printWarning(`[${layerName}] Unknown source "${source}" for ${entry.name || pkg} — skipping`);
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
return true;
|
|
146
|
-
} catch (e) {
|
|
147
|
-
printWarning(`[${layerName}] Failed to install ${entry.name || pkg} (${entry.install}): ${e.message}`);
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
129
|
+
if (!pkg || !SAFE_NAME_RE.test(pkg)) return null;
|
|
130
|
+
return { name: entry.name || pkg, install: entry.install, source, pkg, layerName };
|
|
150
131
|
}
|
|
151
132
|
|
|
152
133
|
/**
|
|
153
|
-
* Scan all four layers for `install` fields and
|
|
134
|
+
* Scan all four layers for soft-ref `install` fields and print hints.
|
|
135
|
+
* Never auto-installs — autonomous agents handle this at runtime when capabilities are needed.
|
|
154
136
|
*
|
|
155
137
|
* @param {object} layers - The layers object from manifest.json (soul, body, faculties, skills)
|
|
156
138
|
*/
|
|
157
139
|
function installAllExternal(layers) {
|
|
158
|
-
|
|
140
|
+
const hints = [];
|
|
141
|
+
|
|
142
|
+
// Soul layer
|
|
159
143
|
const soul = layers.soul || null;
|
|
160
144
|
if (soul && typeof soul === 'object') {
|
|
161
|
-
installExternal(soul, 'soul');
|
|
145
|
+
const h = installExternal(soul, 'soul');
|
|
146
|
+
if (h) hints.push(h);
|
|
162
147
|
}
|
|
163
148
|
|
|
164
|
-
// Body layer
|
|
149
|
+
// Body layer
|
|
165
150
|
const body = layers.body || null;
|
|
166
151
|
if (body && typeof body === 'object') {
|
|
167
|
-
installExternal(body, 'body');
|
|
152
|
+
const h = installExternal(body, 'body');
|
|
153
|
+
if (h) hints.push(h);
|
|
168
154
|
}
|
|
169
155
|
|
|
170
156
|
// Faculty layer
|
|
171
157
|
const faculties = Array.isArray(layers.faculties) ? layers.faculties : [];
|
|
172
158
|
for (const f of faculties) {
|
|
173
|
-
installExternal(f, 'faculty');
|
|
159
|
+
const h = installExternal(f, 'faculty');
|
|
160
|
+
if (h) hints.push(h);
|
|
174
161
|
}
|
|
175
162
|
|
|
176
163
|
// Skill layer
|
|
177
164
|
const skills = Array.isArray(layers.skills) ? layers.skills : [];
|
|
178
165
|
for (const s of skills) {
|
|
179
|
-
installExternal(s, 'skill');
|
|
166
|
+
const h = installExternal(s, 'skill');
|
|
167
|
+
if (h) hints.push(h);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Print soft-ref hints — no auto-install
|
|
171
|
+
if (hints.length > 0) {
|
|
172
|
+
printInfo('');
|
|
173
|
+
printInfo('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
174
|
+
printInfo(' Optional capabilities declared by this persona:');
|
|
175
|
+
for (const h of hints) {
|
|
176
|
+
const cmd = h.source === 'clawhub'
|
|
177
|
+
? `npx openpersona install ${h.pkg}`
|
|
178
|
+
: h.source === 'skillssh'
|
|
179
|
+
? `npx skills add ${h.pkg}`
|
|
180
|
+
: `# ${h.install}`;
|
|
181
|
+
printInfo(` [${h.layerName}] ${h.name}`);
|
|
182
|
+
printInfo(` To enable: ${cmd}`);
|
|
183
|
+
}
|
|
184
|
+
printInfo(' Autonomous agents (e.g. OpenClaw) can install these on demand.');
|
|
185
|
+
printInfo('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
180
186
|
}
|
|
181
187
|
}
|
|
182
188
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Meta-skill for building and managing agent persona skill packs.
|
|
5
5
|
Use when the user wants to create a new agent persona, install/manage
|
|
6
6
|
existing personas, or publish persona skill packs to ClawHub.
|
|
7
|
-
version: "0.14.
|
|
7
|
+
version: "0.14.3"
|
|
8
8
|
author: openpersona
|
|
9
9
|
repository: https://github.com/acnlabs/OpenPersona
|
|
10
10
|
tags: [persona, agent, skill-pack, meta-skill, agent-agnostic, openclaw]
|