@dosu/cli 0.45.0 → 0.46.1

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.
Files changed (2) hide show
  1. package/bin/dosu.js +54 -14
  2. package/package.json +1 -1
package/bin/dosu.js CHANGED
@@ -4773,7 +4773,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
4773
4773
  function getVersionString() {
4774
4774
  return `v${VERSION}`;
4775
4775
  }
4776
- var VERSION = "0.45.0", INSTALL_CHANNEL = "npm";
4776
+ var VERSION = "0.46.1", INSTALL_CHANNEL = "npm";
4777
4777
 
4778
4778
  // src/debug/logger.ts
4779
4779
  import {
@@ -10454,6 +10454,11 @@ function writeSkillCache(cache) {
10454
10454
  writeFileSync6(getCachePath2(), JSON.stringify(cache), { mode: 384 });
10455
10455
  } catch {}
10456
10456
  }
10457
+ function clearInstalledSha() {
10458
+ const cache = readSkillCache();
10459
+ if (cache)
10460
+ writeSkillCache({ ...cache, installedSha: "" });
10461
+ }
10457
10462
  async function fetchLatestSha() {
10458
10463
  const controller = new AbortController;
10459
10464
  const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS2);
@@ -10566,7 +10571,7 @@ async function installSkill(providerIDs, options = {}) {
10566
10571
  return { success: true };
10567
10572
  }
10568
10573
  try {
10569
- const command = `npx skills add ${SKILL_REPO} -g ${agentArgs} -s ${SKILL_NAME} -y`;
10574
+ const command = `npx skills add ${SKILL_REPO} -g ${agentArgs} -s "*" -y`;
10570
10575
  if (options.quiet)
10571
10576
  await execQuiet(command);
10572
10577
  else
@@ -10587,36 +10592,70 @@ async function installSkill(providerIDs, options = {}) {
10587
10592
  logger.debug("skill", "Skill installed but could not fetch latest SHA");
10588
10593
  return { success: true };
10589
10594
  }
10595
+ function installedSkillNames() {
10596
+ let entries;
10597
+ try {
10598
+ const json = execSync2("npx skills list -g --json", {
10599
+ encoding: "utf-8",
10600
+ stdio: ["ignore", "pipe", "ignore"]
10601
+ });
10602
+ const parsed = JSON.parse(json);
10603
+ if (!Array.isArray(parsed))
10604
+ throw new Error("expected a JSON array");
10605
+ entries = parsed;
10606
+ } catch (err) {
10607
+ logger.debug("skill", `Could not list installed skills: ${err}`);
10608
+ return null;
10609
+ }
10610
+ const names = [];
10611
+ for (const entry of entries) {
10612
+ if (entry.source !== SKILL_REPO || typeof entry.name !== "string")
10613
+ continue;
10614
+ if (!SAFE_SKILL_NAME.test(entry.name)) {
10615
+ logger.warn("skill", `Skipping skill with an unsupported name: ${entry.name}`);
10616
+ continue;
10617
+ }
10618
+ names.push(entry.name);
10619
+ }
10620
+ return names;
10621
+ }
10590
10622
  function skillCommand() {
10591
10623
  const cmd = new Command("skill").description("Manage the Dosu agent skill");
10592
10624
  cmd.command("install").description("Install the Dosu skill for AI coding agents").action(async () => {
10593
- console.log(`Installing ${SKILL_NAME} skill from ${SKILL_REPO}...`);
10625
+ console.log(`Installing skills from ${SKILL_REPO}...`);
10594
10626
  const result = await installSkill();
10595
10627
  if (result.success) {
10596
10628
  console.log(import_picocolors13.default.green(`
10597
- ✓ Skill "${SKILL_NAME}" installed successfully.`));
10629
+ ✓ Skills installed successfully.`));
10598
10630
  } else {
10599
10631
  console.error(import_picocolors13.default.red(`
10600
10632
  Failed to install skill. Make sure npx is available.`));
10601
10633
  process.exit(1);
10602
10634
  }
10603
10635
  });
10604
- cmd.command("remove").description("Remove the Dosu skill").action(() => {
10605
- console.log(`Removing ${SKILL_NAME} skill...`);
10636
+ cmd.command("remove").description("Remove the Dosu skills").action(() => {
10637
+ const installed = installedSkillNames();
10638
+ if (installed?.length === 0) {
10639
+ console.log(`No skills from ${SKILL_REPO} are installed.`);
10640
+ return;
10641
+ }
10642
+ const targets = installed ?? [SKILL_NAME];
10643
+ console.log(`Removing skills from ${SKILL_REPO}...`);
10606
10644
  try {
10607
- execSync2(`npx skills remove -g -s ${SKILL_NAME} -y`, {
10645
+ execSync2(`npx skills remove -g ${targets.join(" ")} -y`, {
10608
10646
  stdio: "inherit"
10609
10647
  });
10648
+ clearInstalledSha();
10610
10649
  console.log(import_picocolors13.default.green(`
10611
- ✓ Skill "${SKILL_NAME}" removed.`));
10650
+ ✓ Skills removed.`));
10612
10651
  } catch {
10613
10652
  console.error(import_picocolors13.default.red(`
10614
- Failed to remove skill.`));
10653
+ Failed to remove skills.`));
10615
10654
  process.exit(1);
10616
10655
  }
10617
10656
  });
10618
10657
  cmd.command("update").description("Update the Dosu skill to the latest version").action(async () => {
10619
- console.log(`Updating ${SKILL_NAME} skill...`);
10658
+ console.log(`Updating skills from ${SKILL_REPO}...`);
10620
10659
  const result = await installSkill();
10621
10660
  if (!result.success) {
10622
10661
  console.error(import_picocolors13.default.red(`
@@ -10624,16 +10663,17 @@ Failed to update skill.`));
10624
10663
  process.exit(1);
10625
10664
  }
10626
10665
  console.log(import_picocolors13.default.green(`
10627
- ✓ Skill "${SKILL_NAME}" updated.`));
10666
+ ✓ Skills updated.`));
10628
10667
  });
10629
10668
  return cmd;
10630
10669
  }
10631
- var import_picocolors13, SKILL_REPO = "dosu-ai/dosu-skill", SKILL_NAME = "dosu", SUPPORTED_SKILL_AGENTS, SKILL_AGENT_BY_PROVIDER;
10670
+ var import_picocolors13, SKILL_REPO = "dosu-ai/dosu-skill", SKILL_NAME = "dosu", SAFE_SKILL_NAME, SUPPORTED_SKILL_AGENTS, SKILL_AGENT_BY_PROVIDER;
10632
10671
  var init_skill = __esm(() => {
10633
10672
  init_commander();
10634
10673
  init_logger();
10635
10674
  init_skill_update_check();
10636
10675
  import_picocolors13 = __toESM(require_picocolors(), 1);
10676
+ SAFE_SKILL_NAME = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
10637
10677
  SUPPORTED_SKILL_AGENTS = [
10638
10678
  "claude-code",
10639
10679
  "cursor",
@@ -11751,7 +11791,7 @@ var init_settings = __esm(() => {
11751
11791
  });
11752
11792
 
11753
11793
  // src/telemetry/debug-id.ts
11754
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "df4adcb4-addf-31e4-6475-6e2164756e21";
11794
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "5d9b7117-e4c0-4509-6475-6e2164756e21";
11755
11795
 
11756
11796
  // src/telemetry/telemetry.ts
11757
11797
  import { randomUUID as randomUUID2 } from "node:crypto";
@@ -18614,4 +18654,4 @@ execute().catch((err) => {
18614
18654
  process.exit(1);
18615
18655
  });
18616
18656
 
18617
- //# debugId=df4adcb4-addf-31e4-6475-6e2164756e21
18657
+ //# debugId=5d9b7117-e4c0-4509-6475-6e2164756e21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/cli",
3
- "version": "0.45.0",
3
+ "version": "0.46.1",
4
4
  "type": "module",
5
5
  "description": "Dosu CLI - Manage MCP servers for AI tools",
6
6
  "license": "MIT",