@mintlify/cli 4.0.1730 → 4.0.1732
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/__test__/agent-claim.test.ts +12 -1
- package/__test__/deploy-instructions.test.ts +6 -1
- package/__test__/deploy.test.ts +16 -0
- package/bin/agent-claim.js +6 -0
- package/bin/deploy.js +4 -0
- package/bin/telemetry/track.js +9 -5
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/agent-claim.ts +6 -0
- package/src/deploy.ts +4 -0
- package/src/telemetry/track.ts +12 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1732",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "7.9.0",
|
|
48
|
-
"@mintlify/common": "1.0.
|
|
49
|
-
"@mintlify/link-rot": "3.0.
|
|
50
|
-
"@mintlify/models": "0.0.
|
|
51
|
-
"@mintlify/og": "0.0.
|
|
52
|
-
"@mintlify/prebuild": "1.0.
|
|
53
|
-
"@mintlify/previewing": "4.0.
|
|
54
|
-
"@mintlify/validation": "0.1.
|
|
48
|
+
"@mintlify/common": "1.0.1304",
|
|
49
|
+
"@mintlify/link-rot": "3.0.1531",
|
|
50
|
+
"@mintlify/models": "0.0.379",
|
|
51
|
+
"@mintlify/og": "0.0.103",
|
|
52
|
+
"@mintlify/prebuild": "1.0.1470",
|
|
53
|
+
"@mintlify/previewing": "4.0.1549",
|
|
54
|
+
"@mintlify/validation": "0.1.944",
|
|
55
55
|
"adm-zip": "0.6.0",
|
|
56
56
|
"chalk": "5.2.0",
|
|
57
57
|
"color": "4.2.3",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"keytar": "7.9.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@mintlify/editor": "0.0.
|
|
85
|
+
"@mintlify/editor": "0.0.576",
|
|
86
86
|
"@mintlify/ts-config": "2.0.2",
|
|
87
87
|
"@tsconfig/recommended": "1.0.2",
|
|
88
88
|
"@types/detect-port": "1.3.2",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"vitest": "2.1.9",
|
|
102
102
|
"vitest-mock-process": "1.0.4"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "c92cc428580477a5168c2a891b2038e2670861a2"
|
|
105
105
|
}
|
package/src/agent-claim.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from './agent-credentials.js';
|
|
13
13
|
import { agentRequest, agentResponse } from './agent-http.js';
|
|
14
14
|
import { DASHBOARD_URL } from './constants.js';
|
|
15
|
+
import { trackEvent } from './telemetry/track.js';
|
|
15
16
|
|
|
16
17
|
const claimAttemptSchema = z.object({ attempt: z.object({ verification_uri: z.url() }) });
|
|
17
18
|
|
|
@@ -43,6 +44,8 @@ export async function createAgentClaimLink(
|
|
|
43
44
|
.parse(new URL(claim.attempt.verification_uri).searchParams.get('token'));
|
|
44
45
|
const claimUrl = new URL('/agent-claim', DASHBOARD_URL);
|
|
45
46
|
claimUrl.searchParams.set('token', token);
|
|
47
|
+
claimUrl.searchParams.set('registration', credentials.registrationId);
|
|
48
|
+
void trackEvent('agent_signup.claim_started', { registration_id: credentials.registrationId });
|
|
46
49
|
return claimUrl.toString();
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -97,6 +100,9 @@ export async function claimDeployment(
|
|
|
97
100
|
}),
|
|
98
101
|
completedClaimSchema
|
|
99
102
|
);
|
|
103
|
+
void trackEvent('agent_signup.claim_completed', {
|
|
104
|
+
registration_id: credentials.registrationId,
|
|
105
|
+
});
|
|
100
106
|
credentials = {
|
|
101
107
|
...credentials,
|
|
102
108
|
assertion: completed.identity.assertion,
|
package/src/deploy.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
type AgentWriteToken,
|
|
19
19
|
} from './agent-deployment.js';
|
|
20
20
|
import { getAgentSiteMetadata, setAgentSiteMetadata } from './config.js';
|
|
21
|
+
import { trackEvent } from './telemetry/track.js';
|
|
21
22
|
|
|
22
23
|
export type DeployOptions = {
|
|
23
24
|
apiUrl: string;
|
|
@@ -73,6 +74,9 @@ export async function prepareAgentDeployment(
|
|
|
73
74
|
|
|
74
75
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
75
76
|
const credentials = saved ?? (await registerAgent(discovery));
|
|
77
|
+
void trackEvent('agent_signup.discovered', { registration_id: credentials.registrationId });
|
|
78
|
+
if (!saved)
|
|
79
|
+
void trackEvent('agent_signup.registered', { registration_id: credentials.registrationId });
|
|
76
80
|
await save(credentials);
|
|
77
81
|
const authenticated = await exchangeAgentToken(discovery, credentials);
|
|
78
82
|
await save(authenticated);
|
package/src/telemetry/track.ts
CHANGED
|
@@ -123,14 +123,18 @@ export async function trackEvent(
|
|
|
123
123
|
): Promise<void> {
|
|
124
124
|
if (!isTelemetryEnabled()) return;
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
const work = (async () => {
|
|
127
|
+
try {
|
|
128
|
+
const { cli: cliVersion } = getVersions();
|
|
129
|
+
await captureWithTimeout(event, {
|
|
130
|
+
...properties,
|
|
131
|
+
cli_version: cliVersion,
|
|
132
|
+
...getEnvironmentProperties(),
|
|
133
|
+
});
|
|
134
|
+
} catch {}
|
|
135
|
+
})();
|
|
136
|
+
deferShutdownUntil(work);
|
|
137
|
+
await work;
|
|
134
138
|
}
|
|
135
139
|
|
|
136
140
|
export async function trackTelemetryPreferenceChange(options: { enabled: boolean }): Promise<void> {
|