@tofrankie/agents-sync 0.0.2 → 0.0.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/CHANGELOG.md +4 -0
- package/dist/cli.mjs +20 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -269,18 +269,18 @@ async function runMcpCommand(cwd, options) {
|
|
|
269
269
|
}
|
|
270
270
|
const sourceFile = await resolveMcpSourceFile(runtime.source);
|
|
271
271
|
if (!sourceFile) {
|
|
272
|
-
printSkip(`No MCP config file found in ${runtime.source}.`);
|
|
272
|
+
printSkip(`No MCP config file found in ${c.dim(runtime.source)}.`);
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
const rendered = renderMcpConfigByAgent(await normalizeMcpConfig(sourceFile), runtime.targetAgent);
|
|
276
276
|
const targetFile = resolveMcpTargetFile(cwd);
|
|
277
277
|
if (runtime.dryRun) {
|
|
278
|
-
process.stdout.write(`dry-run: MCP sync target => ${targetFile}\n`);
|
|
278
|
+
process.stdout.write(`dry-run: MCP sync target => ${c.dim(targetFile)}\n`);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
await fs.mkdir(path.dirname(targetFile), { recursive: true });
|
|
282
282
|
await fs.writeFile(targetFile, rendered, "utf8");
|
|
283
|
-
process.stdout.write(`done: MCP synced to ${targetFile}\n`);
|
|
283
|
+
process.stdout.write(`done: MCP synced to ${c.dim(targetFile)}\n`);
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/cli/commands/rule.ts
|
|
@@ -292,7 +292,7 @@ async function runRuleCommand(cwd, options) {
|
|
|
292
292
|
}
|
|
293
293
|
const files = await discoverRuleFiles(runtime.source);
|
|
294
294
|
if (files.length === 0) {
|
|
295
|
-
printSkip(`No rule files found in ${runtime.source}.`);
|
|
295
|
+
printSkip(`No rule files found in ${c.dim(runtime.source)}.`);
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
298
|
printSummary("rules", await copyRuleFiles(files, resolveRulesTargetDir(cwd), {
|
|
@@ -302,28 +302,36 @@ async function runRuleCommand(cwd, options) {
|
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/cli/commands/skill.ts
|
|
305
|
+
/** Multiselect sentinel: not a filesystem path. When selected, every skill is synced. */
|
|
306
|
+
const MULTISELECT_ALL_SKILLS = "__agents-sync:all-skills__";
|
|
305
307
|
async function runSkillCommand(cwd, options) {
|
|
306
308
|
const runtime = resolveOptions(await loadUserConfig(cwd, options.config), options);
|
|
307
309
|
const skillDirs = await discoverSkills(runtime.source);
|
|
308
310
|
if (skillDirs.length === 0) {
|
|
309
|
-
printSkip(`No syncable skills found in ${runtime.source}.`);
|
|
311
|
+
printSkip(`No syncable skills found in ${c.dim(runtime.source)}.`);
|
|
310
312
|
return;
|
|
311
313
|
}
|
|
312
314
|
let selected = skillDirs;
|
|
313
315
|
if (!runtime.yes) {
|
|
316
|
+
const skillOptions = skillDirs.map((dir) => ({
|
|
317
|
+
label: path.basename(dir),
|
|
318
|
+
value: dir
|
|
319
|
+
}));
|
|
320
|
+
const options = skillDirs.length > 1 ? [{
|
|
321
|
+
label: "All skills",
|
|
322
|
+
value: MULTISELECT_ALL_SKILLS
|
|
323
|
+
}, ...skillOptions] : skillOptions;
|
|
314
324
|
const picked = await p.multiselect({
|
|
315
|
-
message: `Select ${c.green("skills")} to sync ${c.dim(runtime.source)}`,
|
|
316
|
-
options
|
|
317
|
-
label: path.basename(dir),
|
|
318
|
-
value: dir
|
|
319
|
-
})),
|
|
325
|
+
message: `Select one or more ${c.green("skills")} to sync from ${c.dim(runtime.source)}`,
|
|
326
|
+
options,
|
|
320
327
|
required: false
|
|
321
328
|
});
|
|
322
329
|
if (p.isCancel(picked)) {
|
|
323
330
|
p.cancel("Operation canceled.");
|
|
324
331
|
return;
|
|
325
332
|
}
|
|
326
|
-
|
|
333
|
+
const values = picked;
|
|
334
|
+
selected = values.includes(MULTISELECT_ALL_SKILLS) ? skillDirs : values;
|
|
327
335
|
}
|
|
328
336
|
if (selected.length === 0) {
|
|
329
337
|
printSkip("No skills selected.");
|
|
@@ -355,7 +363,7 @@ async function runSkillCommand(cwd, options) {
|
|
|
355
363
|
//#endregion
|
|
356
364
|
//#region package.json
|
|
357
365
|
var name = "@tofrankie/agents-sync";
|
|
358
|
-
var version = "0.0.
|
|
366
|
+
var version = "0.0.3";
|
|
359
367
|
//#endregion
|
|
360
368
|
//#region src/cli/index.ts
|
|
361
369
|
main().catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tofrankie/agents-sync",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"description": "Sync skills, rules, and MCP from a configurable source into your project",
|
|
6
6
|
"author": "Frankie <1426203851@qq.com> (https://github.com/tofrankie)",
|
|
7
7
|
"license": "MIT",
|