@dosu/cli 0.3.7 → 0.4.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.
Files changed (2) hide show
  1. package/bin/dosu.js +29 -21
  2. 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 hasDeployment = !!cfg.deployment_id;
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: !hasDeployment ? "Select deployment first" : undefined
4562
+ hint: !hasMcpTarget ? "Select deployment first" : undefined
4559
4563
  },
4560
4564
  {
4561
4565
  label: "Remove MCP",
4562
4566
  value: "mcp-remove",
4563
- hint: !hasDeployment ? "Select deployment first" : undefined
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 (!hasDeployment) {
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 (!hasDeployment) {
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;
@@ -4775,6 +4780,7 @@ async function runSetup(opts = {}) {
4775
4780
  const d3 = await stepResolveDeployment(apiClient, opts.deploymentID);
4776
4781
  if (!d3)
4777
4782
  return;
4783
+ cfg.mode = undefined;
4778
4784
  cfg.deployment_id = d3.deployment_id;
4779
4785
  cfg.deployment_name = d3.name;
4780
4786
  } else if (cfg.mode === MODE_OSS) {
@@ -4790,6 +4796,7 @@ async function runSetup(opts = {}) {
4790
4796
  const d3 = await stepSelectDeployment(apiClient, org);
4791
4797
  if (!d3)
4792
4798
  return;
4799
+ cfg.mode = undefined;
4793
4800
  cfg.deployment_id = d3.deployment_id;
4794
4801
  cfg.deployment_name = d3.name;
4795
4802
  }
@@ -4995,14 +5002,14 @@ async function stepSelectTools(detected) {
4995
5002
  const options = detected.map((p2) => {
4996
5003
  const configured = configuredMap.get(p2.id()) ?? false;
4997
5004
  return {
4998
- label: configured ? `${p2.name()} ${dim("(already configured)")}` : p2.name(),
5005
+ label: p2.name(),
4999
5006
  value: p2.id(),
5000
5007
  hint: configured ? "configured" : undefined
5001
5008
  };
5002
5009
  });
5003
5010
  const preselected = detected.filter((p2) => configuredMap.get(p2.id())).map((p2) => p2.id());
5004
5011
  const selected = await fe({
5005
- message: "Select tools to configure",
5012
+ message: "Select tools to configure or update",
5006
5013
  options,
5007
5014
  initialValues: preselected
5008
5015
  });
@@ -5013,11 +5020,9 @@ async function stepSelectTools(detected) {
5013
5020
  for (const provider of detected) {
5014
5021
  const isSelected = selectedSet.has(provider.id());
5015
5022
  const isConfigured = configuredMap.get(provider.id()) ?? false;
5016
- if (isSelected && !isConfigured)
5023
+ if (isSelected)
5017
5024
  result.toInstall.push(provider);
5018
- else if (isSelected && isConfigured)
5019
- result.skipped.push(provider);
5020
- else if (!isSelected && isConfigured)
5025
+ else if (isConfigured)
5021
5026
  result.toRemove.push(provider);
5022
5027
  }
5023
5028
  return result;
@@ -5106,7 +5111,7 @@ init_config();
5106
5111
  init_providers();
5107
5112
 
5108
5113
  // src/version/version.ts
5109
- var VERSION = "0.3.7";
5114
+ var VERSION = "0.4.0";
5110
5115
  function getVersionString() {
5111
5116
  return `v${VERSION}`;
5112
5117
  }
@@ -5163,7 +5168,10 @@ function createProgram() {
5163
5168
  } else {
5164
5169
  console.log("Status: Logged in");
5165
5170
  }
5166
- if (cfg.deployment_id) {
5171
+ if (cfg.mode === MODE_OSS) {
5172
+ console.log("Mode: OSS");
5173
+ console.log("Deployment: Public libraries only");
5174
+ } else if (cfg.deployment_id) {
5167
5175
  console.log(`Deployment: ${cfg.deployment_name}`);
5168
5176
  console.log(`Deployment ID: ${cfg.deployment_id}`);
5169
5177
  } else {
@@ -5186,7 +5194,7 @@ function createProgram() {
5186
5194
  if (isTokenExpired(cfg)) {
5187
5195
  throw new Error("session expired. Run 'dosu login' to re-authenticate");
5188
5196
  }
5189
- if (!cfg.deployment_id) {
5197
+ if (cfg.mode !== MODE_OSS && !cfg.deployment_id) {
5190
5198
  throw new Error("no deployment selected. Run 'dosu' to open the TUI and select a deployment");
5191
5199
  }
5192
5200
  if (provider.id() === "manual") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/cli",
3
- "version": "0.3.7",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Dosu CLI - Manage MCP servers for AI tools",
6
6
  "license": "MIT",