@dosu/cli 0.46.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.
- package/bin/dosu.js +49 -9
- 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.46.
|
|
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);
|
|
@@ -10587,6 +10592,33 @@ 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 () => {
|
|
@@ -10601,17 +10633,24 @@ 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
|
|
10605
|
-
|
|
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
|
|
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
|
-
✓
|
|
10650
|
+
✓ Skills removed.`));
|
|
10612
10651
|
} catch {
|
|
10613
10652
|
console.error(import_picocolors13.default.red(`
|
|
10614
|
-
Failed to remove
|
|
10653
|
+
Failed to remove skills.`));
|
|
10615
10654
|
process.exit(1);
|
|
10616
10655
|
}
|
|
10617
10656
|
});
|
|
@@ -10628,12 +10667,13 @@ Failed to update skill.`));
|
|
|
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 = "
|
|
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=
|
|
18657
|
+
//# debugId=5d9b7117-e4c0-4509-6475-6e2164756e21
|