@solidactions/cli 3.19.0 → 3.20.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/README.md +19 -3
- package/dist/command-manifest.json +148 -1
- package/dist/commands/role-pull.js +215 -0
- package/dist/commands/role-push.js +226 -44
- package/dist/commands/skill-publish.js +12 -4
- package/dist/commands/skill-pull.js +144 -66
- package/dist/commands/skill-push.js +89 -24
- package/dist/index.js +22 -0
- package/dist/utils/atomic-dir.js +111 -0
- package/dist/utils/crew.js +31 -0
- package/dist/utils/mcp.js +129 -19
- package/dist/utils/mutating-commands.js +1 -0
- package/dist/utils/skill-snapshot.js +15 -6
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Composes two existing MCP actions: crews_skills.read resolves a skill name to
|
|
6
6
|
* its doc_id and reports whether the current revision is unpublished, and
|
|
7
|
-
*
|
|
7
|
+
* crews_history_manage.take_doc_snapshot promotes that revision to all agents.
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -15,11 +15,11 @@ exports.publishSkillByName = publishSkillByName;
|
|
|
15
15
|
exports.emitPublishOutcome = emitPublishOutcome;
|
|
16
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
17
|
const mcp_1 = require("./mcp");
|
|
18
|
-
/** Snapshot a skill by its doc_id (
|
|
18
|
+
/** Snapshot a skill by its doc_id (crews_history_manage.take_doc_snapshot). */
|
|
19
19
|
async function publishSkillByDocId(config, docId) {
|
|
20
20
|
let result;
|
|
21
21
|
try {
|
|
22
|
-
result = await (0, mcp_1.callCrewsTool)(config, '
|
|
22
|
+
result = await (0, mcp_1.callCrewsTool)(config, 'crews_history_manage', { action: 'take_doc_snapshot', doc_id: docId });
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
25
25
|
return { status: 'error', code: 'mcp_request_failed', message: e.message };
|
|
@@ -35,10 +35,19 @@ async function publishSkillByDocId(config, docId) {
|
|
|
35
35
|
* read response, NOT the take_snapshot error code (the server maps both
|
|
36
36
|
* "nothing to snapshot" and "live-mode" to the same not_snapshotable code).
|
|
37
37
|
*/
|
|
38
|
-
async function publishSkillByName(config, name) {
|
|
38
|
+
async function publishSkillByName(config, name, opts = {}) {
|
|
39
39
|
let read;
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
if (opts.role) {
|
|
42
|
+
// Role-scoped skill: addressed by role + name (in_crew disambiguates the role).
|
|
43
|
+
const args = { action: 'read_skill', role: opts.role, name };
|
|
44
|
+
if (opts.inCrew)
|
|
45
|
+
args.in_crew = opts.inCrew;
|
|
46
|
+
read = await (0, mcp_1.callCrewsTool)(config, 'roles', args);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
read = await (0, mcp_1.callCrewsTool)(config, 'skills', { action: 'read', identifier: name });
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
catch (e) {
|
|
44
53
|
return { status: 'error', code: 'mcp_request_failed', message: e.message };
|
|
@@ -81,7 +90,7 @@ function emitPublishOutcome(name, outcome, opts = {}) {
|
|
|
81
90
|
const prefix = opts.pushed ? 'pushed, but publish failed — ' : '';
|
|
82
91
|
process.stderr.write(chalk_1.default.red(`${prefix}${outcome.code}: ${outcome.message}\n`));
|
|
83
92
|
if (opts.pushed) {
|
|
84
|
-
process.stderr.write(chalk_1.default.yellow(` The skill was pushed. Retry: solidactions skill publish ${name}\n`));
|
|
93
|
+
process.stderr.write(chalk_1.default.yellow(` The skill was pushed. Retry: solidactions skill publish ${name}${opts.role ? ` --role ${opts.role}` : ''}${opts.role && opts.inCrew ? ` --in-crew ${opts.inCrew}` : ''}\n`));
|
|
85
94
|
}
|
|
86
95
|
process.exit(1);
|
|
87
96
|
}
|