@dosu/cli 0.3.8 → 0.5.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/bin/dosu.js +28 -22
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -2460,7 +2460,7 @@ function writeTOML(path, content) {
|
|
|
2460
2460
|
function installDosuToTOML(path, cfg) {
|
|
2461
2461
|
let content = readTOML(path);
|
|
2462
2462
|
content = removeDosuFromTOML(content);
|
|
2463
|
-
const url = mcpURL(cfg.deployment_id);
|
|
2463
|
+
const url = cfg.mode === MODE_OSS ? mcpBaseURL() : mcpURL(cfg.deployment_id);
|
|
2464
2464
|
const headers = mcpHeaders(cfg.api_key);
|
|
2465
2465
|
const headerEntries = Object.entries(headers).map(([k, v]) => `${k} = "${v}"`).join(`
|
|
2466
2466
|
`);
|
|
@@ -2509,7 +2509,7 @@ var CodexProvider = () => ({
|
|
|
2509
2509
|
return content.includes("[mcp_servers.dosu]");
|
|
2510
2510
|
},
|
|
2511
2511
|
install(cfg, global) {
|
|
2512
|
-
if (!cfg.deployment_id)
|
|
2512
|
+
if (cfg.mode !== MODE_OSS && !cfg.deployment_id)
|
|
2513
2513
|
throw new Error("deployment ID is required");
|
|
2514
2514
|
installDosuToTOML(getConfigPath2(global), cfg);
|
|
2515
2515
|
},
|
|
@@ -2521,6 +2521,7 @@ var CodexProvider = () => ({
|
|
|
2521
2521
|
}
|
|
2522
2522
|
});
|
|
2523
2523
|
var init_codex = __esm(() => {
|
|
2524
|
+
init_config();
|
|
2524
2525
|
init_config_helpers();
|
|
2525
2526
|
init_detect();
|
|
2526
2527
|
});
|
|
@@ -2543,9 +2544,9 @@ var CopilotProvider = () => ({
|
|
|
2543
2544
|
globalConfigPath: () => globalPath(),
|
|
2544
2545
|
isConfigured: () => isJSONKeyConfigured(globalPath(), "mcpServers"),
|
|
2545
2546
|
install(cfg, global) {
|
|
2546
|
-
if (!cfg.deployment_id)
|
|
2547
|
+
if (cfg.mode !== MODE_OSS && !cfg.deployment_id)
|
|
2547
2548
|
throw new Error("deployment ID is required");
|
|
2548
|
-
const url = mcpURL(cfg.deployment_id);
|
|
2549
|
+
const url = cfg.mode === MODE_OSS ? mcpBaseURL() : mcpURL(cfg.deployment_id);
|
|
2549
2550
|
if (global) {
|
|
2550
2551
|
const server = {
|
|
2551
2552
|
type: "http",
|
|
@@ -2574,6 +2575,7 @@ var CopilotProvider = () => ({
|
|
|
2574
2575
|
}
|
|
2575
2576
|
});
|
|
2576
2577
|
var init_copilot = __esm(() => {
|
|
2578
|
+
init_config();
|
|
2577
2579
|
init_config_helpers();
|
|
2578
2580
|
init_detect();
|
|
2579
2581
|
});
|
|
@@ -2621,7 +2623,7 @@ var ManualProvider = () => ({
|
|
|
2621
2623
|
id: () => "manual",
|
|
2622
2624
|
supportsLocal: () => false,
|
|
2623
2625
|
install(cfg) {
|
|
2624
|
-
const url = mcpURL(cfg.deployment_id);
|
|
2626
|
+
const url = cfg.mode === MODE_OSS ? mcpBaseURL() : mcpURL(cfg.deployment_id);
|
|
2625
2627
|
console.log("Use these details to configure the Dosu MCP server in your client:");
|
|
2626
2628
|
console.log();
|
|
2627
2629
|
console.log(` Transport: HTTP`);
|
|
@@ -2635,6 +2637,7 @@ To remove the Dosu MCP server, manually delete the configuration from your clien
|
|
|
2635
2637
|
}
|
|
2636
2638
|
});
|
|
2637
2639
|
var init_manual = __esm(() => {
|
|
2640
|
+
init_config();
|
|
2638
2641
|
init_config_helpers();
|
|
2639
2642
|
});
|
|
2640
2643
|
|
|
@@ -2660,12 +2663,12 @@ var MCPorterProvider = () => ({
|
|
|
2660
2663
|
globalConfigPath: () => resolveGlobalConfigPath(),
|
|
2661
2664
|
isConfigured: () => isJSONKeyConfigured(resolveGlobalConfigPath(), "mcpServers"),
|
|
2662
2665
|
install(cfg, global) {
|
|
2663
|
-
if (!cfg.deployment_id)
|
|
2666
|
+
if (cfg.mode !== MODE_OSS && !cfg.deployment_id)
|
|
2664
2667
|
throw new Error("deployment ID is required");
|
|
2665
2668
|
const configPath = global ? resolveGlobalConfigPath() : join11(process.cwd(), "config", "mcporter.json");
|
|
2666
2669
|
const server = {
|
|
2667
2670
|
type: "http",
|
|
2668
|
-
url: mcpURL(cfg.deployment_id),
|
|
2671
|
+
url: cfg.mode === MODE_OSS ? mcpBaseURL() : mcpURL(cfg.deployment_id),
|
|
2669
2672
|
headers: mcpHeaders(cfg.api_key)
|
|
2670
2673
|
};
|
|
2671
2674
|
installJSONServer(configPath, "mcpServers", server);
|
|
@@ -2676,6 +2679,7 @@ var MCPorterProvider = () => ({
|
|
|
2676
2679
|
}
|
|
2677
2680
|
});
|
|
2678
2681
|
var init_mcporter = __esm(() => {
|
|
2682
|
+
init_config();
|
|
2679
2683
|
init_config_helpers();
|
|
2680
2684
|
init_detect();
|
|
2681
2685
|
});
|
|
@@ -4538,7 +4542,7 @@ async function runTUI() {
|
|
|
4538
4542
|
return;
|
|
4539
4543
|
}
|
|
4540
4544
|
while (true) {
|
|
4541
|
-
const
|
|
4545
|
+
const hasMcpTarget = cfg.mode === MODE_OSS || !!cfg.deployment_id;
|
|
4542
4546
|
const action = await ve({
|
|
4543
4547
|
message: "What would you like to do?",
|
|
4544
4548
|
options: [
|
|
@@ -4555,12 +4559,12 @@ async function runTUI() {
|
|
|
4555
4559
|
{
|
|
4556
4560
|
label: "Add MCP",
|
|
4557
4561
|
value: "mcp-add",
|
|
4558
|
-
hint: !
|
|
4562
|
+
hint: !hasMcpTarget ? "Select deployment first" : undefined
|
|
4559
4563
|
},
|
|
4560
4564
|
{
|
|
4561
4565
|
label: "Remove MCP",
|
|
4562
4566
|
value: "mcp-remove",
|
|
4563
|
-
hint: !
|
|
4567
|
+
hint: !hasMcpTarget ? "Select deployment first" : undefined
|
|
4564
4568
|
},
|
|
4565
4569
|
{ label: "Clear Credentials", value: "logout" },
|
|
4566
4570
|
{ label: "Exit", value: "exit" }
|
|
@@ -4577,14 +4581,14 @@ async function runTUI() {
|
|
|
4577
4581
|
await handleDeployments(cfg);
|
|
4578
4582
|
break;
|
|
4579
4583
|
case "mcp-add":
|
|
4580
|
-
if (!
|
|
4584
|
+
if (!hasMcpTarget) {
|
|
4581
4585
|
M2.warn("Please select a deployment first.");
|
|
4582
4586
|
continue;
|
|
4583
4587
|
}
|
|
4584
4588
|
await handleMCPAdd(cfg);
|
|
4585
4589
|
break;
|
|
4586
4590
|
case "mcp-remove":
|
|
4587
|
-
if (!
|
|
4591
|
+
if (!hasMcpTarget) {
|
|
4588
4592
|
M2.warn("Please select a deployment first.");
|
|
4589
4593
|
continue;
|
|
4590
4594
|
}
|
|
@@ -4721,6 +4725,7 @@ function handleLogout(cfg) {
|
|
|
4721
4725
|
cfg.access_token = "";
|
|
4722
4726
|
cfg.refresh_token = "";
|
|
4723
4727
|
cfg.expires_at = 0;
|
|
4728
|
+
cfg.mode = undefined;
|
|
4724
4729
|
cfg.deployment_id = undefined;
|
|
4725
4730
|
cfg.deployment_name = undefined;
|
|
4726
4731
|
cfg.api_key = undefined;
|
|
@@ -4997,14 +5002,14 @@ async function stepSelectTools(detected) {
|
|
|
4997
5002
|
const options = detected.map((p2) => {
|
|
4998
5003
|
const configured = configuredMap.get(p2.id()) ?? false;
|
|
4999
5004
|
return {
|
|
5000
|
-
label:
|
|
5005
|
+
label: p2.name(),
|
|
5001
5006
|
value: p2.id(),
|
|
5002
5007
|
hint: configured ? "configured" : undefined
|
|
5003
5008
|
};
|
|
5004
5009
|
});
|
|
5005
5010
|
const preselected = detected.filter((p2) => configuredMap.get(p2.id())).map((p2) => p2.id());
|
|
5006
5011
|
const selected = await fe({
|
|
5007
|
-
message: "Select tools to configure",
|
|
5012
|
+
message: "Select tools to configure or update",
|
|
5008
5013
|
options,
|
|
5009
5014
|
initialValues: preselected
|
|
5010
5015
|
});
|
|
@@ -5015,11 +5020,9 @@ async function stepSelectTools(detected) {
|
|
|
5015
5020
|
for (const provider of detected) {
|
|
5016
5021
|
const isSelected = selectedSet.has(provider.id());
|
|
5017
5022
|
const isConfigured = configuredMap.get(provider.id()) ?? false;
|
|
5018
|
-
if (isSelected
|
|
5023
|
+
if (isSelected)
|
|
5019
5024
|
result.toInstall.push(provider);
|
|
5020
|
-
else if (
|
|
5021
|
-
result.skipped.push(provider);
|
|
5022
|
-
else if (!isSelected && isConfigured)
|
|
5025
|
+
else if (isConfigured)
|
|
5023
5026
|
result.toRemove.push(provider);
|
|
5024
5027
|
}
|
|
5025
5028
|
return result;
|
|
@@ -5073,7 +5076,7 @@ ${lines}`);
|
|
|
5073
5076
|
M2.success("All tools already configured. No changes needed.");
|
|
5074
5077
|
}
|
|
5075
5078
|
if (installed.length > 0 || skipped.length > 0) {
|
|
5076
|
-
const prompt = mode === MODE_OSS ? `What can Dosu
|
|
5079
|
+
const prompt = mode === MODE_OSS ? `What can Dosu help me with? Pick an open source library related to my project and explain how it works.` : `I'm new to this codebase. Give me a 5-minute mental model: main services, request flow, where to start.`;
|
|
5077
5080
|
M2.message(`Try it out! Paste this into your agent:
|
|
5078
5081
|
|
|
5079
5082
|
${info(prompt)}`);
|
|
@@ -5108,7 +5111,7 @@ init_config();
|
|
|
5108
5111
|
init_providers();
|
|
5109
5112
|
|
|
5110
5113
|
// src/version/version.ts
|
|
5111
|
-
var VERSION = "0.
|
|
5114
|
+
var VERSION = "0.5.0";
|
|
5112
5115
|
function getVersionString() {
|
|
5113
5116
|
return `v${VERSION}`;
|
|
5114
5117
|
}
|
|
@@ -5165,7 +5168,10 @@ function createProgram() {
|
|
|
5165
5168
|
} else {
|
|
5166
5169
|
console.log("Status: Logged in");
|
|
5167
5170
|
}
|
|
5168
|
-
if (cfg.
|
|
5171
|
+
if (cfg.mode === MODE_OSS) {
|
|
5172
|
+
console.log("Mode: OSS");
|
|
5173
|
+
console.log("Deployment: Public libraries only");
|
|
5174
|
+
} else if (cfg.deployment_id) {
|
|
5169
5175
|
console.log(`Deployment: ${cfg.deployment_name}`);
|
|
5170
5176
|
console.log(`Deployment ID: ${cfg.deployment_id}`);
|
|
5171
5177
|
} else {
|
|
@@ -5188,7 +5194,7 @@ function createProgram() {
|
|
|
5188
5194
|
if (isTokenExpired(cfg)) {
|
|
5189
5195
|
throw new Error("session expired. Run 'dosu login' to re-authenticate");
|
|
5190
5196
|
}
|
|
5191
|
-
if (!cfg.deployment_id) {
|
|
5197
|
+
if (cfg.mode !== MODE_OSS && !cfg.deployment_id) {
|
|
5192
5198
|
throw new Error("no deployment selected. Run 'dosu' to open the TUI and select a deployment");
|
|
5193
5199
|
}
|
|
5194
5200
|
if (provider.id() === "manual") {
|