@dosu/cli 0.57.1 → 0.57.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 +31 -5
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -1083,7 +1083,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
|
|
|
1083
1083
|
function getVersionString() {
|
|
1084
1084
|
return `v${VERSION}`;
|
|
1085
1085
|
}
|
|
1086
|
-
var VERSION = "0.57.
|
|
1086
|
+
var VERSION = "0.57.2", INSTALL_CHANNEL = "npm";
|
|
1087
1087
|
|
|
1088
1088
|
// src/debug/logger.ts
|
|
1089
1089
|
import {
|
|
@@ -6869,8 +6869,11 @@ function messageLimit(value) {
|
|
|
6869
6869
|
}
|
|
6870
6870
|
return parsed;
|
|
6871
6871
|
}
|
|
6872
|
+
function isUuid(value) {
|
|
6873
|
+
return UUID_RE.test(value);
|
|
6874
|
+
}
|
|
6872
6875
|
function uuid(value) {
|
|
6873
|
-
if (
|
|
6876
|
+
if (!isUuid(value)) {
|
|
6874
6877
|
throw new InvalidArgumentError("must be a UUID");
|
|
6875
6878
|
}
|
|
6876
6879
|
return value;
|
|
@@ -6913,8 +6916,10 @@ function boundedText(maximum) {
|
|
|
6913
6916
|
return trimmed;
|
|
6914
6917
|
};
|
|
6915
6918
|
}
|
|
6919
|
+
var UUID_RE;
|
|
6916
6920
|
var init_arguments = __esm(() => {
|
|
6917
6921
|
init_commander();
|
|
6922
|
+
UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
6918
6923
|
});
|
|
6919
6924
|
|
|
6920
6925
|
// src/commands/auth.ts
|
|
@@ -11170,6 +11175,25 @@ async function listAccessibleDeployments(client, activeOrgId) {
|
|
|
11170
11175
|
const deployments = await Promise.all(orgs.map((org) => client.workspaces.listForOrg.query(org.org_id)));
|
|
11171
11176
|
return deployments.flat();
|
|
11172
11177
|
}
|
|
11178
|
+
async function resolveDeploymentId(client, activeOrgId, id) {
|
|
11179
|
+
const needle = id.trim();
|
|
11180
|
+
if (isUuid(needle))
|
|
11181
|
+
return needle;
|
|
11182
|
+
const prefix = needle.toLowerCase();
|
|
11183
|
+
const matches = (await listAccessibleDeployments(client, activeOrgId)).filter((d) => d.provider_slug === MCP_PROVIDER_SLUG && prefix.length > 0 && d.deployment_id.toLowerCase().startsWith(prefix));
|
|
11184
|
+
if (matches.length === 1)
|
|
11185
|
+
return matches[0].deployment_id;
|
|
11186
|
+
if (matches.length === 0) {
|
|
11187
|
+
console.error(import_picocolors15.default.red(`Deployment not found: ${id}`));
|
|
11188
|
+
console.error(import_picocolors15.default.dim("Expected a full deployment ID (UUID). Run 'dosu deployments list --json' to see full IDs."));
|
|
11189
|
+
process.exit(1);
|
|
11190
|
+
}
|
|
11191
|
+
console.error(import_picocolors15.default.red(`Ambiguous deployment ID prefix: ${id} matches ${matches.length}:`));
|
|
11192
|
+
for (const d of matches) {
|
|
11193
|
+
console.error(import_picocolors15.default.dim(` ${d.deployment_id} ${d.name}`));
|
|
11194
|
+
}
|
|
11195
|
+
process.exit(1);
|
|
11196
|
+
}
|
|
11173
11197
|
function deploymentsCommand() {
|
|
11174
11198
|
const cmd = new Command("deployments").description("Manage deployments");
|
|
11175
11199
|
cmd.command("list").description("List all deployments").option("--json", "Output as JSON").action(async (opts) => {
|
|
@@ -11223,9 +11247,10 @@ ${import_picocolors15.default.dim(`Current: ${cfg.active_account?.target?.deploy
|
|
|
11223
11247
|
["Created", formatDate(deployment.created_at)]
|
|
11224
11248
|
], { rawData: deployment });
|
|
11225
11249
|
});
|
|
11226
|
-
cmd.command("switch").description("Switch to a different deployment").argument("<id>", "Deployment ID").option("--json", "Output as JSON").action(async (
|
|
11250
|
+
cmd.command("switch").description("Switch to a different deployment").argument("<id>", "Deployment ID (full UUID, or a unique prefix as shown by 'list')").option("--json", "Output as JSON").action(async (rawId, opts) => {
|
|
11227
11251
|
const cfg = requireConfig4();
|
|
11228
11252
|
const client = createTypedClient(cfg);
|
|
11253
|
+
const id = await resolveDeploymentId(client, cfg.active_account?.target?.org_id, rawId);
|
|
11229
11254
|
const deployment = await client.workspaces.get.query(id);
|
|
11230
11255
|
if (!deployment) {
|
|
11231
11256
|
console.error(import_picocolors15.default.red(`Deployment not found: ${id}`));
|
|
@@ -11258,6 +11283,7 @@ var init_deployments = __esm(() => {
|
|
|
11258
11283
|
init_client();
|
|
11259
11284
|
init_trpc();
|
|
11260
11285
|
init_config();
|
|
11286
|
+
init_arguments();
|
|
11261
11287
|
init_auth();
|
|
11262
11288
|
init_output();
|
|
11263
11289
|
import_picocolors15 = __toESM(require_picocolors(), 1);
|
|
@@ -13716,7 +13742,7 @@ var init_sync = __esm(() => {
|
|
|
13716
13742
|
});
|
|
13717
13743
|
|
|
13718
13744
|
// src/telemetry/debug-id.ts
|
|
13719
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
13745
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "46f904ed-b3a2-d9c5-6475-6e2164756e21";
|
|
13720
13746
|
|
|
13721
13747
|
// src/telemetry/telemetry.ts
|
|
13722
13748
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -66813,4 +66839,4 @@ main().catch((err) => {
|
|
|
66813
66839
|
process.exit(1);
|
|
66814
66840
|
});
|
|
66815
66841
|
|
|
66816
|
-
//# debugId=
|
|
66842
|
+
//# debugId=46f904ed-b3a2-d9c5-6475-6e2164756e21
|