@dosu/cli 0.52.0 → 0.52.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 +34 -32
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -5000,7 +5000,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
|
|
|
5000
5000
|
function getVersionString() {
|
|
5001
5001
|
return `v${VERSION}`;
|
|
5002
5002
|
}
|
|
5003
|
-
var VERSION = "0.52.
|
|
5003
|
+
var VERSION = "0.52.2", INSTALL_CHANNEL = "npm";
|
|
5004
5004
|
|
|
5005
5005
|
// src/debug/logger.ts
|
|
5006
5006
|
import {
|
|
@@ -5134,7 +5134,7 @@ var init_logger = __esm(() => {
|
|
|
5134
5134
|
});
|
|
5135
5135
|
|
|
5136
5136
|
// src/client/contract.ts
|
|
5137
|
-
var CLI_CONTRACT_HASH = "
|
|
5137
|
+
var CLI_CONTRACT_HASH = "1d4be4b6214f";
|
|
5138
5138
|
|
|
5139
5139
|
// src/client/trpc.ts
|
|
5140
5140
|
var exports_trpc = {};
|
|
@@ -11444,7 +11444,7 @@ var init_settings = __esm(() => {
|
|
|
11444
11444
|
});
|
|
11445
11445
|
|
|
11446
11446
|
// src/telemetry/debug-id.ts
|
|
11447
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
11447
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "11869608-d7a8-aa45-6475-6e2164756e21";
|
|
11448
11448
|
|
|
11449
11449
|
// src/telemetry/telemetry.ts
|
|
11450
11450
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
@@ -11473,11 +11473,13 @@ function normalizeContext(context) {
|
|
|
11473
11473
|
const isAuthenticated2 = context?.isAuthenticated === true;
|
|
11474
11474
|
const id = safeRead(context?.user, "id");
|
|
11475
11475
|
const email = safeRead(context?.user, "email");
|
|
11476
|
-
const
|
|
11476
|
+
const orgId = safeRead(context, "orgId");
|
|
11477
|
+
const user = isAuthenticated2 && isUUID2(id) ? { id, ...validEmail(email) ? { email } : {} } : undefined;
|
|
11477
11478
|
return {
|
|
11478
11479
|
mode: context?.mode === "oss" ? "oss" : "cloud",
|
|
11479
11480
|
isAuthenticated: isAuthenticated2,
|
|
11480
|
-
...user ? { user } : {}
|
|
11481
|
+
...user ? { user } : {},
|
|
11482
|
+
...user && isUUID2(orgId) ? { orgId } : {}
|
|
11481
11483
|
};
|
|
11482
11484
|
}
|
|
11483
11485
|
function normalizeExitCode(value, fallback = 1) {
|
|
@@ -11497,12 +11499,9 @@ function normalizeRuntime(runtime) {
|
|
|
11497
11499
|
isTty: runtime.isTty === true
|
|
11498
11500
|
};
|
|
11499
11501
|
}
|
|
11500
|
-
function
|
|
11502
|
+
function isUUID2(value) {
|
|
11501
11503
|
return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
11502
11504
|
}
|
|
11503
|
-
function validUserId(value) {
|
|
11504
|
-
return validInstallId(value);
|
|
11505
|
-
}
|
|
11506
11505
|
function validEmail(value) {
|
|
11507
11506
|
return typeof value === "string" && value.length <= 254 && /^[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/.test(value);
|
|
11508
11507
|
}
|
|
@@ -11652,7 +11651,7 @@ function buildPostHogPayload(input) {
|
|
|
11652
11651
|
const result = input.result === "success" || input.result === "validation_error" ? input.result : "failure";
|
|
11653
11652
|
return {
|
|
11654
11653
|
api_key: input.apiKey,
|
|
11655
|
-
distinct_id: context.user?.id ?? (
|
|
11654
|
+
distinct_id: context.user?.id ?? (isUUID2(input.installId) ? input.installId : FALLBACK_INSTALL_ID),
|
|
11656
11655
|
event: "cli_command_completed",
|
|
11657
11656
|
properties: {
|
|
11658
11657
|
$geoip_disable: true,
|
|
@@ -11670,6 +11669,10 @@ function buildPostHogPayload(input) {
|
|
|
11670
11669
|
is_ci: runtime.isCi,
|
|
11671
11670
|
is_tty: runtime.isTty,
|
|
11672
11671
|
mode: context.mode,
|
|
11672
|
+
...context.orgId ? {
|
|
11673
|
+
org_id: context.orgId,
|
|
11674
|
+
$groups: { organization: context.orgId }
|
|
11675
|
+
} : {},
|
|
11673
11676
|
is_authenticated: context.isAuthenticated,
|
|
11674
11677
|
exit_code: normalizeExitCode(input.exitCode),
|
|
11675
11678
|
...errorCode ? { error_code: errorCode } : {}
|
|
@@ -11784,7 +11787,12 @@ function buildSentryEnvelope(input) {
|
|
|
11784
11787
|
level: "error",
|
|
11785
11788
|
release: `dosu-cli@${runtime.version}`,
|
|
11786
11789
|
tags: sentryTags(command, context, runtime, error),
|
|
11787
|
-
...context.user ? {
|
|
11790
|
+
...context.user ? {
|
|
11791
|
+
user: {
|
|
11792
|
+
id: context.user.id,
|
|
11793
|
+
...context.user.email ? { email: context.user.email } : {}
|
|
11794
|
+
}
|
|
11795
|
+
} : {},
|
|
11788
11796
|
...mappedBundle ? {
|
|
11789
11797
|
debug_meta: {
|
|
11790
11798
|
images: [{ type: "sourcemap", code_file: BUNDLE_CODE_FILE, debug_id: debugId }]
|
|
@@ -11978,7 +11986,7 @@ function safeNow(now) {
|
|
|
11978
11986
|
function safeUuid(generate) {
|
|
11979
11987
|
try {
|
|
11980
11988
|
const value = generate();
|
|
11981
|
-
return
|
|
11989
|
+
return isUUID2(value) ? value : undefined;
|
|
11982
11990
|
} catch {
|
|
11983
11991
|
return;
|
|
11984
11992
|
}
|
|
@@ -12010,7 +12018,7 @@ function createCommandTelemetry(settings2, dependencies = {}) {
|
|
|
12010
12018
|
let installIdResolved = false;
|
|
12011
12019
|
let resolvedInstallId = settings2.install_id;
|
|
12012
12020
|
function installId() {
|
|
12013
|
-
if (
|
|
12021
|
+
if (isUUID2(resolvedInstallId))
|
|
12014
12022
|
return resolvedInstallId;
|
|
12015
12023
|
if (installIdResolved)
|
|
12016
12024
|
return;
|
|
@@ -12020,7 +12028,7 @@ function createCommandTelemetry(settings2, dependencies = {}) {
|
|
|
12020
12028
|
} catch {
|
|
12021
12029
|
resolvedInstallId = undefined;
|
|
12022
12030
|
}
|
|
12023
|
-
return
|
|
12031
|
+
return isUUID2(resolvedInstallId) ? resolvedInstallId : undefined;
|
|
12024
12032
|
}
|
|
12025
12033
|
function debugPayload(payload) {
|
|
12026
12034
|
try {
|
|
@@ -12211,7 +12219,7 @@ async function trackCliOnboardingEvent(cfg, onboardingRunID, event, properties =
|
|
|
12211
12219
|
return;
|
|
12212
12220
|
if (!cfg.active_account?.session.access_token)
|
|
12213
12221
|
return;
|
|
12214
|
-
if (!
|
|
12222
|
+
if (!isUUID3(onboardingRunID))
|
|
12215
12223
|
return;
|
|
12216
12224
|
const input = {
|
|
12217
12225
|
event,
|
|
@@ -12234,7 +12242,7 @@ async function trackCliOnboardingPreAuthEvent(onboardingRunID, event, properties
|
|
|
12234
12242
|
return;
|
|
12235
12243
|
if (!analyticsReleaseEnabled())
|
|
12236
12244
|
return;
|
|
12237
|
-
if (!
|
|
12245
|
+
if (!isUUID3(onboardingRunID))
|
|
12238
12246
|
return;
|
|
12239
12247
|
const input = {
|
|
12240
12248
|
event,
|
|
@@ -12267,13 +12275,14 @@ function analyticsReleaseEnabled() {
|
|
|
12267
12275
|
return Boolean(parsePostHogProjectToken(process.env.DOSU_POSTHOG_PROJECT_TOKEN_OVERRIDE ?? "phc_Uo9RxhN0HRk8gZkPlT18BCr7eqsM0MPWVW88HZB95V5"));
|
|
12268
12276
|
}
|
|
12269
12277
|
function baseProperties(cfg) {
|
|
12278
|
+
const orgId = cfg.active_account?.target?.org_id;
|
|
12270
12279
|
return {
|
|
12271
12280
|
cli_version: safeIdentifier(VERSION, 32),
|
|
12272
12281
|
install_channel: safeIdentifier(INSTALL_CHANNEL, 32),
|
|
12273
12282
|
platform: safeIdentifier(process.platform, 24),
|
|
12274
12283
|
arch: safeIdentifier(process.arch, 24),
|
|
12275
12284
|
mode: cfg.mode ?? "cloud",
|
|
12276
|
-
org_id:
|
|
12285
|
+
...orgId && isUUID3(orgId) ? { org_id: orgId, $groups: { organization: orgId } } : {},
|
|
12277
12286
|
deployment_id: safeIdentifier(cfg.active_account?.target?.deployment_id, 128),
|
|
12278
12287
|
space_id: safeIdentifier(cfg.active_account?.target?.space_id, 128)
|
|
12279
12288
|
};
|
|
@@ -12316,7 +12325,7 @@ function allowlistedWorkflowProperties(properties) {
|
|
|
12316
12325
|
function safeIdentifier(value, maxLength) {
|
|
12317
12326
|
return typeof value === "string" && value.length <= maxLength && /^[A-Za-z0-9][A-Za-z0-9._+-]*$/.test(value) ? value : undefined;
|
|
12318
12327
|
}
|
|
12319
|
-
function
|
|
12328
|
+
function isUUID3(value) {
|
|
12320
12329
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
12321
12330
|
}
|
|
12322
12331
|
function createAnalyticsClient(accessToken, requestSignal) {
|
|
@@ -12401,9 +12410,6 @@ function binOnPath(bin) {
|
|
|
12401
12410
|
return false;
|
|
12402
12411
|
}
|
|
12403
12412
|
}
|
|
12404
|
-
function kickoffAgentLabel(agent) {
|
|
12405
|
-
return AGENT_LABELS[agent];
|
|
12406
|
-
}
|
|
12407
12413
|
function cursorAgentBin() {
|
|
12408
12414
|
if (binOnPath("agent"))
|
|
12409
12415
|
return "agent";
|
|
@@ -12483,15 +12489,10 @@ function launchKickoffAgent(agent, prompt, options = {}) {
|
|
|
12483
12489
|
logger.warn("setup", "No Cursor kickoff binary found");
|
|
12484
12490
|
return false;
|
|
12485
12491
|
}
|
|
12486
|
-
var KICKOFF_AGENTS
|
|
12492
|
+
var KICKOFF_AGENTS;
|
|
12487
12493
|
var init_agent_kickoff = __esm(() => {
|
|
12488
12494
|
init_logger();
|
|
12489
12495
|
KICKOFF_AGENTS = ["cursor", "claude", "codex"];
|
|
12490
|
-
AGENT_LABELS = {
|
|
12491
|
-
cursor: "Cursor",
|
|
12492
|
-
claude: "Claude Code",
|
|
12493
|
-
codex: "Codex"
|
|
12494
|
-
};
|
|
12495
12496
|
});
|
|
12496
12497
|
|
|
12497
12498
|
// src/setup/logs-handoff.ts
|
|
@@ -12587,8 +12588,8 @@ function printManualLogsNudge(opts = {}) {
|
|
|
12587
12588
|
log.message(info(prompt));
|
|
12588
12589
|
}
|
|
12589
12590
|
function confirmLogsHandoffMessage(agent) {
|
|
12590
|
-
const lead = agent === "cursor" && !cursorAgentBin() ? "We'll print a prompt to paste into Agent to mine these into Dosu. Cursor CLI isn't on PATH, so nothing runs until you send it." :
|
|
12591
|
-
return `${lead} ${LOGS_HANDOFF_PRIVACY}
|
|
12591
|
+
const lead = agent === "cursor" && !cursorAgentBin() ? "We'll print a prompt to paste into Agent to mine these into Dosu. Cursor CLI isn't on PATH, so nothing runs until you send it." : null;
|
|
12592
|
+
return lead ? `${lead} ${LOGS_HANDOFF_PRIVACY}` : LOGS_HANDOFF_PRIVACY;
|
|
12592
12593
|
}
|
|
12593
12594
|
async function offerLogsHandoff(options = {}) {
|
|
12594
12595
|
const hits = detectLogSources(options.home);
|
|
@@ -16494,7 +16495,6 @@ var LIBRARY_VISIBILITIES = ["public", "internal", "private"];
|
|
|
16494
16495
|
var CONFIG_SETTINGS = {
|
|
16495
16496
|
commit_to_trigger_pr: true,
|
|
16496
16497
|
default_accept_review: true,
|
|
16497
|
-
default_save_publish: true,
|
|
16498
16498
|
review_timeout_days: true
|
|
16499
16499
|
};
|
|
16500
16500
|
var CONFIG_SETTING_NAMES = Object.keys(CONFIG_SETTINGS);
|
|
@@ -17879,10 +17879,12 @@ function commandTelemetryContext() {
|
|
|
17879
17879
|
const tokenUserID = getAccessTokenUserID(accessToken);
|
|
17880
17880
|
const userID = configUserID && configUserID === tokenUserID ? configUserID : undefined;
|
|
17881
17881
|
const email = userID ? getAccessTokenEmail(accessToken) : undefined;
|
|
17882
|
+
const orgId = userID ? cfg.active_account?.target?.org_id : undefined;
|
|
17882
17883
|
return {
|
|
17883
17884
|
mode: cfg.mode === MODE_OSS ? "oss" : "cloud",
|
|
17884
17885
|
isAuthenticated: authenticated,
|
|
17885
|
-
...userID ? { user: { id: userID, ...email ? { email } : {} } } : {}
|
|
17886
|
+
...userID ? { user: { id: userID, ...email ? { email } : {} } } : {},
|
|
17887
|
+
...orgId ? { orgId } : {}
|
|
17886
17888
|
};
|
|
17887
17889
|
} catch {
|
|
17888
17890
|
return { mode: "cloud", isAuthenticated: false };
|
|
@@ -18348,4 +18350,4 @@ execute().catch((err) => {
|
|
|
18348
18350
|
process.exit(1);
|
|
18349
18351
|
});
|
|
18350
18352
|
|
|
18351
|
-
//# debugId=
|
|
18353
|
+
//# debugId=11869608-d7a8-aa45-6475-6e2164756e21
|