@dosu/cli 0.15.0 → 0.15.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 +36 -10
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -4341,7 +4341,7 @@ function getSupabaseAnonKey() {
|
|
|
4341
4341
|
function getVersionString() {
|
|
4342
4342
|
return `v${VERSION}`;
|
|
4343
4343
|
}
|
|
4344
|
-
var VERSION = "0.15.
|
|
4344
|
+
var VERSION = "0.15.1";
|
|
4345
4345
|
|
|
4346
4346
|
// src/debug/logger.ts
|
|
4347
4347
|
import {
|
|
@@ -6655,6 +6655,9 @@ var init_skill = __esm(() => {
|
|
|
6655
6655
|
import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
6656
6656
|
});
|
|
6657
6657
|
|
|
6658
|
+
// src/mcp/constants.ts
|
|
6659
|
+
var MCP_PROVIDER_SLUG = "dosu_mcp";
|
|
6660
|
+
|
|
6658
6661
|
// node_modules/imurmurhash/imurmurhash.js
|
|
6659
6662
|
var require_imurmurhash = __commonJS((exports, module) => {
|
|
6660
6663
|
(function() {
|
|
@@ -10848,7 +10851,7 @@ ${dim(targetOrg.name)}`);
|
|
|
10848
10851
|
async function resolveOnboardingDeployment(apiClient, targetOrg) {
|
|
10849
10852
|
const deployments = await fetchDeployments(apiClient);
|
|
10850
10853
|
const orgDeployments = deployments.filter((deployment) => deployment.org_id === targetOrg.org_id);
|
|
10851
|
-
return orgDeployments.find((deployment) => deployment.provider_slug ===
|
|
10854
|
+
return orgDeployments.find((deployment) => deployment.provider_slug === MCP_PROVIDER_SLUG) ?? orgDeployments[0] ?? null;
|
|
10852
10855
|
}
|
|
10853
10856
|
async function resolveDeployment(apiClient, cfg, opts) {
|
|
10854
10857
|
if (opts.deploymentID) {
|
|
@@ -11588,11 +11591,13 @@ function emitNeedUserAction(opts) {
|
|
|
11588
11591
|
});
|
|
11589
11592
|
}
|
|
11590
11593
|
function emitError(opts) {
|
|
11594
|
+
const { step, reason, agent_next_steps, ...rest } = opts;
|
|
11591
11595
|
emitJSONLine({
|
|
11592
|
-
step
|
|
11596
|
+
step,
|
|
11593
11597
|
status: "error",
|
|
11594
|
-
reason
|
|
11595
|
-
|
|
11598
|
+
reason,
|
|
11599
|
+
...rest,
|
|
11600
|
+
agent_next_steps
|
|
11596
11601
|
});
|
|
11597
11602
|
}
|
|
11598
11603
|
function emitStep(opts) {
|
|
@@ -11895,8 +11900,8 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11895
11900
|
return { code: 0, cfg };
|
|
11896
11901
|
}
|
|
11897
11902
|
try {
|
|
11898
|
-
const
|
|
11899
|
-
if (
|
|
11903
|
+
const allDeployments = await client.getDeployments();
|
|
11904
|
+
if (allDeployments.length === 0) {
|
|
11900
11905
|
emitError({
|
|
11901
11906
|
step: "deployment",
|
|
11902
11907
|
reason: "no_deployments",
|
|
@@ -11904,8 +11909,17 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11904
11909
|
});
|
|
11905
11910
|
return { code: 1, cfg };
|
|
11906
11911
|
}
|
|
11907
|
-
|
|
11908
|
-
|
|
11912
|
+
const mcpDeployments = allDeployments.filter((d3) => d3.provider_slug === MCP_PROVIDER_SLUG);
|
|
11913
|
+
if (mcpDeployments.length === 0) {
|
|
11914
|
+
emitError({
|
|
11915
|
+
step: "deployment",
|
|
11916
|
+
reason: "no_mcp_deployment",
|
|
11917
|
+
agent_next_steps: "Account has deployments but none of them back an MCP server. Tell the user to create an MCP deployment at https://app.dosu.dev, or pass --deployment <id> to target a specific deployment."
|
|
11918
|
+
});
|
|
11919
|
+
return { code: 1, cfg };
|
|
11920
|
+
}
|
|
11921
|
+
if (mcpDeployments.length === 1) {
|
|
11922
|
+
const d3 = mcpDeployments[0];
|
|
11909
11923
|
cfg.deployment_id = d3.deployment_id;
|
|
11910
11924
|
cfg.deployment_name = d3.name;
|
|
11911
11925
|
cfg.org_id = d3.org_id;
|
|
@@ -11919,10 +11933,18 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11919
11933
|
});
|
|
11920
11934
|
return { code: 0, cfg };
|
|
11921
11935
|
}
|
|
11936
|
+
const candidates = mcpDeployments.map((d3) => ({
|
|
11937
|
+
deployment_id: d3.deployment_id,
|
|
11938
|
+
name: d3.name,
|
|
11939
|
+
org_id: d3.org_id,
|
|
11940
|
+
org_name: d3.org_name
|
|
11941
|
+
}));
|
|
11922
11942
|
emitError({
|
|
11923
11943
|
step: "deployment",
|
|
11924
11944
|
reason: "multiple_deployments",
|
|
11925
|
-
|
|
11945
|
+
candidates,
|
|
11946
|
+
agent_next_steps: `User has ${mcpDeployments.length} MCP deployments. Show these options to the user and re-run the same command with \`--deployment <id>\`:
|
|
11947
|
+
${formatCandidates(mcpDeployments)}`
|
|
11926
11948
|
});
|
|
11927
11949
|
return { code: 1, cfg };
|
|
11928
11950
|
} catch (err) {
|
|
@@ -11934,6 +11956,10 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11934
11956
|
return { code: 1, cfg };
|
|
11935
11957
|
}
|
|
11936
11958
|
}
|
|
11959
|
+
function formatCandidates(deployments) {
|
|
11960
|
+
return deployments.map((d3) => ` - ${d3.name} (${d3.org_name}) — ${d3.deployment_id}`).join(`
|
|
11961
|
+
`);
|
|
11962
|
+
}
|
|
11937
11963
|
async function ensureAPIKey(client, cfg) {
|
|
11938
11964
|
if (!cfg.deployment_id) {
|
|
11939
11965
|
emitError({
|