@dosu/cli 0.15.0 → 0.15.2
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 +42 -12
- 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.2";
|
|
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() {
|
|
@@ -9224,7 +9227,11 @@ async function createDeploymentForRepo(trpc, orgID, spaceID, repo) {
|
|
|
9224
9227
|
return null;
|
|
9225
9228
|
}
|
|
9226
9229
|
const dataSourceID = dataSource.data_source_id;
|
|
9227
|
-
await trpc.dataSource.syncDataSource.mutate(dataSourceID);
|
|
9230
|
+
await trpc.dataSource.syncDataSource.mutate({ data_source_id: dataSourceID });
|
|
9231
|
+
await trpc.dataSource.attachToSpace.mutate({
|
|
9232
|
+
space_id: spaceID,
|
|
9233
|
+
data_source_ids: [dataSourceID]
|
|
9234
|
+
});
|
|
9228
9235
|
const spaceDeployments = await trpc.workspaces.listForSpace.query(spaceID);
|
|
9229
9236
|
await Promise.all(spaceDeployments.map((d3) => trpc.deploymentDataSource.create.mutate({
|
|
9230
9237
|
deployment_id: d3.deployment_id,
|
|
@@ -10848,7 +10855,7 @@ ${dim(targetOrg.name)}`);
|
|
|
10848
10855
|
async function resolveOnboardingDeployment(apiClient, targetOrg) {
|
|
10849
10856
|
const deployments = await fetchDeployments(apiClient);
|
|
10850
10857
|
const orgDeployments = deployments.filter((deployment) => deployment.org_id === targetOrg.org_id);
|
|
10851
|
-
return orgDeployments.find((deployment) => deployment.provider_slug ===
|
|
10858
|
+
return orgDeployments.find((deployment) => deployment.provider_slug === MCP_PROVIDER_SLUG) ?? orgDeployments[0] ?? null;
|
|
10852
10859
|
}
|
|
10853
10860
|
async function resolveDeployment(apiClient, cfg, opts) {
|
|
10854
10861
|
if (opts.deploymentID) {
|
|
@@ -11588,11 +11595,13 @@ function emitNeedUserAction(opts) {
|
|
|
11588
11595
|
});
|
|
11589
11596
|
}
|
|
11590
11597
|
function emitError(opts) {
|
|
11598
|
+
const { step, reason, agent_next_steps, ...rest } = opts;
|
|
11591
11599
|
emitJSONLine({
|
|
11592
|
-
step
|
|
11600
|
+
step,
|
|
11593
11601
|
status: "error",
|
|
11594
|
-
reason
|
|
11595
|
-
|
|
11602
|
+
reason,
|
|
11603
|
+
...rest,
|
|
11604
|
+
agent_next_steps
|
|
11596
11605
|
});
|
|
11597
11606
|
}
|
|
11598
11607
|
function emitStep(opts) {
|
|
@@ -11895,8 +11904,8 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11895
11904
|
return { code: 0, cfg };
|
|
11896
11905
|
}
|
|
11897
11906
|
try {
|
|
11898
|
-
const
|
|
11899
|
-
if (
|
|
11907
|
+
const allDeployments = await client.getDeployments();
|
|
11908
|
+
if (allDeployments.length === 0) {
|
|
11900
11909
|
emitError({
|
|
11901
11910
|
step: "deployment",
|
|
11902
11911
|
reason: "no_deployments",
|
|
@@ -11904,8 +11913,17 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11904
11913
|
});
|
|
11905
11914
|
return { code: 1, cfg };
|
|
11906
11915
|
}
|
|
11907
|
-
|
|
11908
|
-
|
|
11916
|
+
const mcpDeployments = allDeployments.filter((d3) => d3.provider_slug === MCP_PROVIDER_SLUG);
|
|
11917
|
+
if (mcpDeployments.length === 0) {
|
|
11918
|
+
emitError({
|
|
11919
|
+
step: "deployment",
|
|
11920
|
+
reason: "no_mcp_deployment",
|
|
11921
|
+
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."
|
|
11922
|
+
});
|
|
11923
|
+
return { code: 1, cfg };
|
|
11924
|
+
}
|
|
11925
|
+
if (mcpDeployments.length === 1) {
|
|
11926
|
+
const d3 = mcpDeployments[0];
|
|
11909
11927
|
cfg.deployment_id = d3.deployment_id;
|
|
11910
11928
|
cfg.deployment_name = d3.name;
|
|
11911
11929
|
cfg.org_id = d3.org_id;
|
|
@@ -11919,10 +11937,18 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11919
11937
|
});
|
|
11920
11938
|
return { code: 0, cfg };
|
|
11921
11939
|
}
|
|
11940
|
+
const candidates = mcpDeployments.map((d3) => ({
|
|
11941
|
+
deployment_id: d3.deployment_id,
|
|
11942
|
+
name: d3.name,
|
|
11943
|
+
org_id: d3.org_id,
|
|
11944
|
+
org_name: d3.org_name
|
|
11945
|
+
}));
|
|
11922
11946
|
emitError({
|
|
11923
11947
|
step: "deployment",
|
|
11924
11948
|
reason: "multiple_deployments",
|
|
11925
|
-
|
|
11949
|
+
candidates,
|
|
11950
|
+
agent_next_steps: `User has ${mcpDeployments.length} MCP deployments. Show these options to the user and re-run the same command with \`--deployment <id>\`:
|
|
11951
|
+
${formatCandidates(mcpDeployments)}`
|
|
11926
11952
|
});
|
|
11927
11953
|
return { code: 1, cfg };
|
|
11928
11954
|
} catch (err) {
|
|
@@ -11934,6 +11960,10 @@ async function resolveDeployment2(client, cfg, opts) {
|
|
|
11934
11960
|
return { code: 1, cfg };
|
|
11935
11961
|
}
|
|
11936
11962
|
}
|
|
11963
|
+
function formatCandidates(deployments) {
|
|
11964
|
+
return deployments.map((d3) => ` - ${d3.name} (${d3.org_name}) — ${d3.deployment_id}`).join(`
|
|
11965
|
+
`);
|
|
11966
|
+
}
|
|
11937
11967
|
async function ensureAPIKey(client, cfg) {
|
|
11938
11968
|
if (!cfg.deployment_id) {
|
|
11939
11969
|
emitError({
|
|
@@ -13116,7 +13146,7 @@ function sourcesCommand() {
|
|
|
13116
13146
|
cmd.command("sync").description("Trigger a data source sync").argument("<id>", "Data source ID").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
13117
13147
|
const cfg = requireConfig10();
|
|
13118
13148
|
const client = createTypedClient(cfg);
|
|
13119
|
-
await client.dataSource.syncDataSource.mutate(id);
|
|
13149
|
+
await client.dataSource.syncDataSource.mutate({ data_source_id: id });
|
|
13120
13150
|
if (opts.json) {
|
|
13121
13151
|
printResult({ success: true, id }, opts);
|
|
13122
13152
|
return;
|