@dosu/cli 0.37.0-alpha.4 → 0.37.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/README.md +1 -1
- package/bin/dosu.js +26 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ Or right-click the binary, select "Open", and click "Open" in the dialog.
|
|
|
92
92
|
| `dosu setup` | Run the setup wizard (auth → deployment → detect tools → configure) |
|
|
93
93
|
| `dosu login` | Authenticate with Dosu via browser OAuth |
|
|
94
94
|
| `dosu logout` | Clear saved credentials |
|
|
95
|
-
| `dosu status
|
|
95
|
+
| `dosu status` | Show current authentication and MCP status |
|
|
96
96
|
| `dosu mcp list` | List supported AI tools |
|
|
97
97
|
| `dosu mcp add <tool>` | Add the Dosu MCP server to a specific tool |
|
|
98
98
|
| `dosu logs` | View or manage debug logs (`--tail`, `--clear`) |
|
package/bin/dosu.js
CHANGED
|
@@ -4759,7 +4759,7 @@ var init_dist4 = __esm(() => {
|
|
|
4759
4759
|
function getVersionString() {
|
|
4760
4760
|
return `v${VERSION}`;
|
|
4761
4761
|
}
|
|
4762
|
-
var VERSION = "0.37.0
|
|
4762
|
+
var VERSION = "0.37.0", INSTALL_CHANNEL = "npm";
|
|
4763
4763
|
|
|
4764
4764
|
// src/debug/logger.ts
|
|
4765
4765
|
import {
|
|
@@ -10458,7 +10458,7 @@ var init_skill_update_check = __esm(() => {
|
|
|
10458
10458
|
});
|
|
10459
10459
|
|
|
10460
10460
|
// src/commands/skill.ts
|
|
10461
|
-
import { execSync as execSync2 } from "node:child_process";
|
|
10461
|
+
import { exec as exec2, execSync as execSync2 } from "node:child_process";
|
|
10462
10462
|
import { homedir } from "node:os";
|
|
10463
10463
|
import { join as join11 } from "node:path";
|
|
10464
10464
|
function skillAgentIDsForProviders(providerIDs) {
|
|
@@ -10489,6 +10489,16 @@ function skillAgentArgs(providerIDs) {
|
|
|
10489
10489
|
const agents = providerIDs === undefined ? SUPPORTED_SKILL_AGENTS : skillAgentIDsForProviders(providerIDs);
|
|
10490
10490
|
return agents.map((agent) => `-a ${agent}`).join(" ");
|
|
10491
10491
|
}
|
|
10492
|
+
function execQuiet(command) {
|
|
10493
|
+
return new Promise((resolve, reject) => {
|
|
10494
|
+
exec2(command, { windowsHide: true }, (error) => {
|
|
10495
|
+
if (error)
|
|
10496
|
+
reject(error);
|
|
10497
|
+
else
|
|
10498
|
+
resolve();
|
|
10499
|
+
});
|
|
10500
|
+
});
|
|
10501
|
+
}
|
|
10492
10502
|
async function installSkill(providerIDs, options = {}) {
|
|
10493
10503
|
const agentArgs = skillAgentArgs(providerIDs);
|
|
10494
10504
|
if (!agentArgs) {
|
|
@@ -10496,9 +10506,11 @@ async function installSkill(providerIDs, options = {}) {
|
|
|
10496
10506
|
return { success: true };
|
|
10497
10507
|
}
|
|
10498
10508
|
try {
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10509
|
+
const command = `npx skills add ${SKILL_REPO} -g ${agentArgs} -s ${SKILL_NAME} -y`;
|
|
10510
|
+
if (options.quiet)
|
|
10511
|
+
await execQuiet(command);
|
|
10512
|
+
else
|
|
10513
|
+
execSync2(command, { stdio: "inherit" });
|
|
10502
10514
|
} catch (err) {
|
|
10503
10515
|
logger.error("skill", `Failed to install skill: ${err}`);
|
|
10504
10516
|
return { success: false };
|
|
@@ -12377,6 +12389,9 @@ Run ${info("dosu mcp add <agent>")} to manually configure an agent.`);
|
|
|
12377
12389
|
}
|
|
12378
12390
|
async function runInstallSkill(providers) {
|
|
12379
12391
|
logger.info("setup", "Step: install skill");
|
|
12392
|
+
const spinner2 = spinner();
|
|
12393
|
+
const agentLabel = providers.length === 1 ? "agent" : "agents";
|
|
12394
|
+
spinner2.start(`Installing skill for ${providers.length} ${agentLabel}`);
|
|
12380
12395
|
try {
|
|
12381
12396
|
const result = await installSkill(providers.map((provider) => provider.id()), { quiet: true });
|
|
12382
12397
|
if (result.success) {
|
|
@@ -12393,14 +12408,17 @@ async function runInstallSkill(providers) {
|
|
|
12393
12408
|
}
|
|
12394
12409
|
];
|
|
12395
12410
|
});
|
|
12411
|
+
spinner2.clear();
|
|
12396
12412
|
log.success(formatSetupSummary(`Skill ready for ${items.length} agent(s):`, items));
|
|
12397
12413
|
return true;
|
|
12398
12414
|
}
|
|
12415
|
+
spinner2.clear();
|
|
12399
12416
|
log.error("Failed to install skill. Run `dosu skill install` to retry.");
|
|
12400
12417
|
return false;
|
|
12401
12418
|
} catch (err) {
|
|
12402
12419
|
const msg = err instanceof Error ? err.message : String(err);
|
|
12403
12420
|
logger.error("setup", `Skill install failed: ${msg}`);
|
|
12421
|
+
spinner2.clear();
|
|
12404
12422
|
log.error(`Skill install failed: ${msg}`);
|
|
12405
12423
|
return false;
|
|
12406
12424
|
}
|
|
@@ -13614,7 +13632,7 @@ async function runAgentSetup(opts) {
|
|
|
13614
13632
|
}
|
|
13615
13633
|
emitStep({
|
|
13616
13634
|
step: "done",
|
|
13617
|
-
agent_next_steps: `Dosu is configured for ${provider.name()}. Tell the user setup is complete and they can ask their agent a Dosu question. Run 'dosu status
|
|
13635
|
+
agent_next_steps: `Dosu is configured for ${provider.name()}. Tell the user setup is complete and they can ask their agent a Dosu question. Run 'dosu status' to verify.`
|
|
13618
13636
|
});
|
|
13619
13637
|
return 0;
|
|
13620
13638
|
}
|
|
@@ -16903,45 +16921,14 @@ Run 'dosu --help' to see available commands.`;
|
|
|
16903
16921
|
saveConfig(cfg);
|
|
16904
16922
|
console.log("Successfully logged out.");
|
|
16905
16923
|
});
|
|
16906
|
-
program2.command("status").description("Show current authentication and MCP status").
|
|
16924
|
+
program2.command("status").description("Show current authentication and MCP status").action(async () => {
|
|
16907
16925
|
const cfg = loadConfig();
|
|
16908
|
-
const mode = cfg.mode === MODE_OSS ? "oss" : "cloud";
|
|
16909
16926
|
if (!isAuthenticated(cfg)) {
|
|
16910
|
-
if (opts.json) {
|
|
16911
|
-
console.log(JSON.stringify({
|
|
16912
|
-
authenticated: false,
|
|
16913
|
-
session_status: "missing",
|
|
16914
|
-
mode,
|
|
16915
|
-
mcp: {
|
|
16916
|
-
status: "not_configured",
|
|
16917
|
-
deployment_id: null,
|
|
16918
|
-
deployment_name: null
|
|
16919
|
-
}
|
|
16920
|
-
}, null, 2));
|
|
16921
|
-
return;
|
|
16922
|
-
}
|
|
16923
16927
|
console.log("Status: Not logged in");
|
|
16924
16928
|
console.log("Run 'dosu login' to authenticate.");
|
|
16925
16929
|
return;
|
|
16926
16930
|
}
|
|
16927
|
-
|
|
16928
|
-
if (opts.json) {
|
|
16929
|
-
const deploymentId = cfg.active_account.target?.deployment_id ?? null;
|
|
16930
|
-
const deploymentName = cfg.active_account.target?.deployment_name ?? null;
|
|
16931
|
-
const mcpStatus = cfg.mode === MODE_OSS ? "public_libraries" : deploymentId ? "configured" : "not_configured";
|
|
16932
|
-
console.log(JSON.stringify({
|
|
16933
|
-
authenticated: sessionStatus === "valid",
|
|
16934
|
-
session_status: sessionStatus,
|
|
16935
|
-
mode,
|
|
16936
|
-
mcp: {
|
|
16937
|
-
status: mcpStatus,
|
|
16938
|
-
deployment_id: deploymentId,
|
|
16939
|
-
deployment_name: deploymentName
|
|
16940
|
-
}
|
|
16941
|
-
}, null, 2));
|
|
16942
|
-
return;
|
|
16943
|
-
}
|
|
16944
|
-
if (sessionStatus === "expired") {
|
|
16931
|
+
if (isTokenExpired(cfg) && !await ensureFreshSession(cfg)) {
|
|
16945
16932
|
console.log("Status: Token expired");
|
|
16946
16933
|
console.log("Run 'dosu login' to re-authenticate.");
|
|
16947
16934
|
} else {
|