@callmeradical/augy 0.3.0 → 0.4.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/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ program.command("sync [path]").description("Install/update skills from an augy.j
|
|
|
36
36
|
await syncCommand(path, opts ?? {});
|
|
37
37
|
});
|
|
38
38
|
program.command("scan").description("Find skills installed outside augy and optionally import them into the registry").action(async () => {
|
|
39
|
-
const { scanCommand } = await import("./scan-
|
|
39
|
+
const { scanCommand } = await import("./scan-4KFMTKHO.js");
|
|
40
40
|
await scanCommand();
|
|
41
41
|
});
|
|
42
42
|
program.command("info <skill>").description("Show full metadata, version history, and description for an installed skill").action(async (skill) => {
|
|
@@ -52,6 +52,7 @@ async function scanCommand() {
|
|
|
52
52
|
untracked.push({ name, agents });
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
const additionalInstalls = findAdditionalAgentInstalls(onDisk, registry);
|
|
55
56
|
const tracked = listSkills(registry);
|
|
56
57
|
if (!untracked.length) {
|
|
57
58
|
outro(chalk.green("All installed skills are already tracked by augy."));
|
|
@@ -224,6 +225,36 @@ async function scanCommand() {
|
|
|
224
225
|
outro(
|
|
225
226
|
importedCount > 0 ? chalk.green(`${importedCount} skill(s) imported into augy`) : chalk.dim("No skills imported.")
|
|
226
227
|
);
|
|
228
|
+
if (additionalInstalls.length) {
|
|
229
|
+
console.log(
|
|
230
|
+
`
|
|
231
|
+
${chalk.bold("Additional installs found")}` + chalk.dim(` (${additionalInstalls.length} skill(s) installed in new agent(s))`) + "\n"
|
|
232
|
+
);
|
|
233
|
+
for (const { skillName, newAgents } of additionalInstalls) {
|
|
234
|
+
console.log(` ${chalk.cyan.bold(skillName)}`);
|
|
235
|
+
for (const { agent, path } of newAgents) {
|
|
236
|
+
console.log(` ${chalk.bold(agent.name.padEnd(10))} ${chalk.dim(tildefy(path))}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
console.log();
|
|
240
|
+
const doRegister = await confirm({
|
|
241
|
+
message: "Register these additional agent paths in the registry?"
|
|
242
|
+
});
|
|
243
|
+
if (!isCancel(doRegister) && doRegister) {
|
|
244
|
+
let registered = 0;
|
|
245
|
+
for (const { skillName, newAgents } of additionalInstalls) {
|
|
246
|
+
const skill = getSkill(registry, skillName);
|
|
247
|
+
for (const { agent, path } of newAgents) {
|
|
248
|
+
skill.agents[agent.id] = { path, active: true };
|
|
249
|
+
registered++;
|
|
250
|
+
}
|
|
251
|
+
registry.skills[skillName] = skill;
|
|
252
|
+
await writeRegistry(registry);
|
|
253
|
+
}
|
|
254
|
+
console.log(chalk.green(`
|
|
255
|
+
\u2713 Registered ${registered} additional path(s)`));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
227
258
|
}
|
|
228
259
|
function printDetected(sk) {
|
|
229
260
|
const p = sk.provenance;
|
|
@@ -309,6 +340,18 @@ async function readSkillDescription(skillPath) {
|
|
|
309
340
|
}
|
|
310
341
|
return void 0;
|
|
311
342
|
}
|
|
343
|
+
function findAdditionalAgentInstalls(onDisk, registry) {
|
|
344
|
+
const result = [];
|
|
345
|
+
for (const [name, agents] of onDisk) {
|
|
346
|
+
const tracked = getSkill(registry, name);
|
|
347
|
+
if (!tracked) continue;
|
|
348
|
+
const newAgents = agents.filter((a) => !tracked.agents[a.agent.id]);
|
|
349
|
+
if (newAgents.length) {
|
|
350
|
+
result.push({ skillName: name, newAgents });
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
312
355
|
function tildefy(p) {
|
|
313
356
|
const home = homedir();
|
|
314
357
|
return p.startsWith(home) ? "~" + p.slice(home.length) : p;
|
|
@@ -324,5 +367,6 @@ async function tryResolveTapSource(registry, name) {
|
|
|
324
367
|
}
|
|
325
368
|
}
|
|
326
369
|
export {
|
|
370
|
+
findAdditionalAgentInstalls,
|
|
327
371
|
scanCommand
|
|
328
372
|
};
|