myrmidocs 0.4.7 → 0.4.8
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/dist/index.js +52 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6743,7 +6743,7 @@ async function originResponds(origin) {
|
|
|
6743
6743
|
}
|
|
6744
6744
|
|
|
6745
6745
|
// src/version.ts
|
|
6746
|
-
var VERSION = true ? "0.4.
|
|
6746
|
+
var VERSION = true ? "0.4.8" : "0.0.0-dev";
|
|
6747
6747
|
|
|
6748
6748
|
// src/commands/run.ts
|
|
6749
6749
|
function looksRiskyForBootstrap(dir) {
|
|
@@ -7948,7 +7948,7 @@ function candidateSkillsDirs() {
|
|
|
7948
7948
|
// Hermes agent (safe default; dir created on first Hermes run)
|
|
7949
7949
|
];
|
|
7950
7950
|
}
|
|
7951
|
-
function
|
|
7951
|
+
function installSkillContent(key, content) {
|
|
7952
7952
|
const dirs = candidateSkillsDirs();
|
|
7953
7953
|
const written = [];
|
|
7954
7954
|
for (const dir of dirs) {
|
|
@@ -7959,18 +7959,21 @@ function installSkill() {
|
|
|
7959
7959
|
continue;
|
|
7960
7960
|
}
|
|
7961
7961
|
if (!stat.isDirectory()) continue;
|
|
7962
|
-
const skillDir = import_path14.default.join(dir,
|
|
7962
|
+
const skillDir = import_path14.default.join(dir, key);
|
|
7963
7963
|
import_fs14.default.mkdirSync(skillDir, { recursive: true });
|
|
7964
7964
|
const skillPath = import_path14.default.join(skillDir, "SKILL.md");
|
|
7965
|
-
import_fs14.default.writeFileSync(skillPath,
|
|
7965
|
+
import_fs14.default.writeFileSync(skillPath, content, "utf8");
|
|
7966
7966
|
written.push(skillPath);
|
|
7967
7967
|
}
|
|
7968
7968
|
if (written.length > 0) {
|
|
7969
7969
|
return { installed: true, paths: written, path: written[0] };
|
|
7970
7970
|
}
|
|
7971
|
-
const fallback = import_path14.default.join(dirs[0],
|
|
7971
|
+
const fallback = import_path14.default.join(dirs[0], key, "SKILL.md");
|
|
7972
7972
|
return { installed: false, paths: [fallback], path: fallback };
|
|
7973
7973
|
}
|
|
7974
|
+
function installSkill() {
|
|
7975
|
+
return installSkillContent(SKILL_DIR_NAME, SKILL_MD);
|
|
7976
|
+
}
|
|
7974
7977
|
|
|
7975
7978
|
// src/commands/connect.ts
|
|
7976
7979
|
async function runConnect(workspaceUrl, opts, fetcher = fetch) {
|
|
@@ -8096,6 +8099,49 @@ function registerIdentity(program3) {
|
|
|
8096
8099
|
});
|
|
8097
8100
|
}
|
|
8098
8101
|
|
|
8102
|
+
// src/commands/skill.ts
|
|
8103
|
+
async function runSkillList() {
|
|
8104
|
+
const { skills } = await daemonGet(
|
|
8105
|
+
"/api/daemon/skills"
|
|
8106
|
+
);
|
|
8107
|
+
if (!skills.length) {
|
|
8108
|
+
console.log("No skills published in this space yet.");
|
|
8109
|
+
return;
|
|
8110
|
+
}
|
|
8111
|
+
for (const s of skills) {
|
|
8112
|
+
const tags = s.tags?.length ? ` (${s.tags.join(", ")})` : "";
|
|
8113
|
+
console.log(`${s.key} [${s.kind}] ${s.name}${tags}`);
|
|
8114
|
+
if (s.description) console.log(` ${s.description}`);
|
|
8115
|
+
}
|
|
8116
|
+
console.log(`
|
|
8117
|
+
Grab one into your agent: myr skill add <key>`);
|
|
8118
|
+
}
|
|
8119
|
+
async function runSkillAdd(key) {
|
|
8120
|
+
const { packet, content } = await daemonGet(`/api/daemon/skills/${encodeURIComponent(key)}`);
|
|
8121
|
+
const result = installSkillContent(packet.key, content);
|
|
8122
|
+
if (result.installed) {
|
|
8123
|
+
console.log(`installed "${packet.key}" -> ${result.paths.join(", ")}`);
|
|
8124
|
+
console.log(
|
|
8125
|
+
"Your agent picks it up on next load. Only this skill was added."
|
|
8126
|
+
);
|
|
8127
|
+
} else {
|
|
8128
|
+
console.log(
|
|
8129
|
+
`No agent skills dir found. Create one (e.g. ~/.claude/skills) and rerun, or save the skill to: ${result.path}`
|
|
8130
|
+
);
|
|
8131
|
+
}
|
|
8132
|
+
}
|
|
8133
|
+
function registerSkill(program3) {
|
|
8134
|
+
const skill = program3.command("skill").description("Browse and grab skills published in this space");
|
|
8135
|
+
skill.command("list").description("List the skills published in this space").action(async () => {
|
|
8136
|
+
await runSkillList();
|
|
8137
|
+
});
|
|
8138
|
+
skill.command("add").description(
|
|
8139
|
+
"Install ONE published skill into your agent's runtime (this skill only, no pollution)"
|
|
8140
|
+
).argument("<key>", "skill key (from `myr skill list`)").action(async (key) => {
|
|
8141
|
+
await runSkillAdd(key);
|
|
8142
|
+
});
|
|
8143
|
+
}
|
|
8144
|
+
|
|
8099
8145
|
// src/commands/uninstall.ts
|
|
8100
8146
|
var import_fs15 = __toESM(require("fs"));
|
|
8101
8147
|
var import_path15 = __toESM(require("path"));
|
|
@@ -8249,6 +8295,7 @@ registerNew(program2);
|
|
|
8249
8295
|
registerConnect(program2);
|
|
8250
8296
|
registerWhoami(program2);
|
|
8251
8297
|
registerIdentity(program2);
|
|
8298
|
+
registerSkill(program2);
|
|
8252
8299
|
registerUninstall(program2);
|
|
8253
8300
|
registerResetConfig(program2);
|
|
8254
8301
|
program2.parseAsync().catch((err) => {
|