@easysociable/cli 0.1.29 → 0.1.31

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.
@@ -34683,6 +34683,12 @@ function isUnifiedConfigCompatible(config2) {
34683
34683
  }
34684
34684
 
34685
34685
  // src/installSkills.ts
34686
+ var ALL_SKILL_IDS = [
34687
+ "easysociable-content",
34688
+ "easysociable-template",
34689
+ "easysociable-slideshow"
34690
+ ];
34691
+ var RETIRED_SKILL_IDS = ["easysociable-tweet-image"];
34686
34692
  var DEFAULT_SKILL_IDS = [
34687
34693
  "easysociable-slideshow"
34688
34694
  ];
@@ -35588,6 +35594,10 @@ function detectedHosts(home) {
35588
35594
  ];
35589
35595
  return candidates.filter((item) => existsSync4(item.dir)).map((item) => ({ host: item.host, configPath: join4(item.dir, "mcp.json"), skillsPath: join4(item.dir, "skills") }));
35590
35596
  }
35597
+ function hostSkillIds(skillsPath, options) {
35598
+ const installed = ALL_SKILL_IDS.filter((skill) => existsSync4(join4(skillsPath, skill)));
35599
+ return [.../* @__PURE__ */ new Set([...resolveInstallSkillIds(options), ...installed])];
35600
+ }
35591
35601
  async function planInstallation(options) {
35592
35602
  const home = installHome(options);
35593
35603
  const source = installSource(options);
@@ -35602,7 +35612,8 @@ async function planInstallation(options) {
35602
35612
  missingSkills,
35603
35613
  changes: hosts.flatMap((host) => [
35604
35614
  `merge ${host.configPath} with one easysociable MCP registration`,
35605
- ...skillNames.map((name) => `install ${join4(host.skillsPath, name)}`)
35615
+ ...hostSkillIds(host.skillsPath, options).map((name) => `install ${join4(host.skillsPath, name)}`),
35616
+ ...RETIRED_SKILL_IDS.filter((name) => existsSync4(join4(host.skillsPath, name))).map((name) => `remove ${join4(host.skillsPath, name)}`)
35606
35617
  ])
35607
35618
  };
35608
35619
  }
@@ -35625,11 +35636,13 @@ async function applyInstallation(options) {
35625
35636
  }
35626
35637
  await installHostConfig({ host: host.host, dataDir: "", configPath: host.configPath });
35627
35638
  await mkdir(host.skillsPath, { recursive: true, mode: 448 });
35628
- for (const skill of resolveInstallSkillIds(options)) {
35639
+ for (const skill of hostSkillIds(host.skillsPath, options)) {
35629
35640
  const target = join4(host.skillsPath, skill);
35630
35641
  await rm(target, { recursive: true, force: true });
35631
35642
  await cp(join4(String(plan.source), skill), target, { recursive: true });
35632
35643
  }
35644
+ for (const skill of RETIRED_SKILL_IDS)
35645
+ await rm(join4(host.skillsPath, skill), { recursive: true, force: true });
35633
35646
  }
35634
35647
  if (options.json !== true) {
35635
35648
  process.stdout.write(`Installed skills your Agent will use:
@@ -35845,15 +35858,14 @@ Waiting for approval\u2026
35845
35858
  return page.templates;
35846
35859
  }));
35847
35860
  jsonOption(templates.command("get").requiredOption("--id <id>")).action(withClient(async (client, opts) => client.getTemplate(String(opts.id))));
35848
- jsonOption(templates.command("source").option("--id <pageId>").option("--family <familyId>").option("--platform <platform>", "With --family: pick that platform's variant")).action(withClient(async (client, opts) => {
35861
+ jsonOption(templates.command("source").option("--id <pageId>").option("--family <familyId>")).action(withClient(async (client, opts) => {
35849
35862
  let id = opts.id ? String(opts.id) : "";
35850
35863
  if (!id && opts.family) {
35851
35864
  const { variants } = await client.getTemplateFamily(String(opts.family));
35852
- const variant = variants.find((v) => v.platforms?.includes(String(opts.platform ?? ""))) ?? variants[0];
35853
- if (!variant) throw new Error(`Family ${opts.family} has no published page`);
35854
- id = variant.pageId;
35865
+ if (!variants[0]) throw new Error(`Family ${opts.family} has no published page`);
35866
+ id = variants[0].pageId;
35855
35867
  }
35856
- if (!id) throw new Error("Pass --id <pageId> or --family <familyId> [--platform <p>]");
35868
+ if (!id) throw new Error("Pass --id <pageId> or --family <familyId>");
35857
35869
  const draft = await client.getDraft(id);
35858
35870
  return { id: draft.id, name: draft.name, familyId: draft.familyId, canvas: draft.authoringSource?.canvas, studioJson: draft.authoringSource?.json };
35859
35871
  }));