@alpic-ai/sdk 0.0.0-dev.gb4b9d9e → 0.0.0-dev.gb4ee3bd
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/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/project/detect-runtime.js +1654 -22
- package/dist/project/detect-runtime.js.map +7 -1
- package/dist/vendor/pipenet.js +578 -173
- package/dist/vendor/pipenet.js.map +4 -4
- package/package.json +10 -9
|
@@ -1,25 +1,1657 @@
|
|
|
1
|
+
// src/project/detect-runtime.ts
|
|
1
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
|
|
4
|
+
// ../domains/dist/index.mjs
|
|
5
|
+
import { z as z2 } from "zod";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@8.1.1_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
8
|
+
import * as z from "zod/v4";
|
|
9
|
+
var SafeUrlSchema = z.url().superRefine((val, ctx) => {
|
|
10
|
+
if (!URL.canParse(val)) {
|
|
11
|
+
ctx.addIssue({
|
|
12
|
+
code: z.ZodIssueCode.custom,
|
|
13
|
+
message: "URL must be parseable",
|
|
14
|
+
fatal: true
|
|
15
|
+
});
|
|
16
|
+
return z.NEVER;
|
|
17
|
+
}
|
|
18
|
+
}).refine((url2) => {
|
|
19
|
+
const u = new URL(url2);
|
|
20
|
+
return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
|
|
21
|
+
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
22
|
+
var OAuthProtectedResourceMetadataSchema = z.looseObject({
|
|
23
|
+
resource: z.string().url(),
|
|
24
|
+
authorization_servers: z.array(SafeUrlSchema).optional(),
|
|
25
|
+
jwks_uri: z.string().url().optional(),
|
|
26
|
+
scopes_supported: z.array(z.string()).optional(),
|
|
27
|
+
bearer_methods_supported: z.array(z.string()).optional(),
|
|
28
|
+
resource_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
29
|
+
resource_name: z.string().optional(),
|
|
30
|
+
resource_documentation: z.string().optional(),
|
|
31
|
+
resource_policy_uri: z.string().url().optional(),
|
|
32
|
+
resource_tos_uri: z.string().url().optional(),
|
|
33
|
+
tls_client_certificate_bound_access_tokens: z.boolean().optional(),
|
|
34
|
+
authorization_details_types_supported: z.array(z.string()).optional(),
|
|
35
|
+
dpop_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
36
|
+
dpop_bound_access_tokens_required: z.boolean().optional()
|
|
37
|
+
});
|
|
38
|
+
var OAuthMetadataSchema = z.looseObject({
|
|
39
|
+
issuer: z.string(),
|
|
40
|
+
authorization_endpoint: SafeUrlSchema,
|
|
41
|
+
token_endpoint: SafeUrlSchema,
|
|
42
|
+
registration_endpoint: SafeUrlSchema.optional(),
|
|
43
|
+
scopes_supported: z.array(z.string()).optional(),
|
|
44
|
+
response_types_supported: z.array(z.string()),
|
|
45
|
+
response_modes_supported: z.array(z.string()).optional(),
|
|
46
|
+
grant_types_supported: z.array(z.string()).optional(),
|
|
47
|
+
token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
|
|
48
|
+
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
49
|
+
service_documentation: SafeUrlSchema.optional(),
|
|
50
|
+
revocation_endpoint: SafeUrlSchema.optional(),
|
|
51
|
+
revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),
|
|
52
|
+
revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
53
|
+
introspection_endpoint: z.string().optional(),
|
|
54
|
+
introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(),
|
|
55
|
+
introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
56
|
+
code_challenge_methods_supported: z.array(z.string()).optional(),
|
|
57
|
+
client_id_metadata_document_supported: z.boolean().optional()
|
|
58
|
+
});
|
|
59
|
+
var OpenIdProviderMetadataSchema = z.looseObject({
|
|
60
|
+
issuer: z.string(),
|
|
61
|
+
authorization_endpoint: SafeUrlSchema,
|
|
62
|
+
token_endpoint: SafeUrlSchema,
|
|
63
|
+
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
64
|
+
jwks_uri: SafeUrlSchema,
|
|
65
|
+
registration_endpoint: SafeUrlSchema.optional(),
|
|
66
|
+
scopes_supported: z.array(z.string()).optional(),
|
|
67
|
+
response_types_supported: z.array(z.string()),
|
|
68
|
+
response_modes_supported: z.array(z.string()).optional(),
|
|
69
|
+
grant_types_supported: z.array(z.string()).optional(),
|
|
70
|
+
acr_values_supported: z.array(z.string()).optional(),
|
|
71
|
+
subject_types_supported: z.array(z.string()),
|
|
72
|
+
id_token_signing_alg_values_supported: z.array(z.string()),
|
|
73
|
+
id_token_encryption_alg_values_supported: z.array(z.string()).optional(),
|
|
74
|
+
id_token_encryption_enc_values_supported: z.array(z.string()).optional(),
|
|
75
|
+
userinfo_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
76
|
+
userinfo_encryption_alg_values_supported: z.array(z.string()).optional(),
|
|
77
|
+
userinfo_encryption_enc_values_supported: z.array(z.string()).optional(),
|
|
78
|
+
request_object_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
79
|
+
request_object_encryption_alg_values_supported: z.array(z.string()).optional(),
|
|
80
|
+
request_object_encryption_enc_values_supported: z.array(z.string()).optional(),
|
|
81
|
+
token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
|
|
82
|
+
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
|
|
83
|
+
display_values_supported: z.array(z.string()).optional(),
|
|
84
|
+
claim_types_supported: z.array(z.string()).optional(),
|
|
85
|
+
claims_supported: z.array(z.string()).optional(),
|
|
86
|
+
service_documentation: z.string().optional(),
|
|
87
|
+
claims_locales_supported: z.array(z.string()).optional(),
|
|
88
|
+
ui_locales_supported: z.array(z.string()).optional(),
|
|
89
|
+
claims_parameter_supported: z.boolean().optional(),
|
|
90
|
+
request_parameter_supported: z.boolean().optional(),
|
|
91
|
+
request_uri_parameter_supported: z.boolean().optional(),
|
|
92
|
+
require_request_uri_registration: z.boolean().optional(),
|
|
93
|
+
op_policy_uri: SafeUrlSchema.optional(),
|
|
94
|
+
op_tos_uri: SafeUrlSchema.optional(),
|
|
95
|
+
client_id_metadata_document_supported: z.boolean().optional()
|
|
96
|
+
});
|
|
97
|
+
var OpenIdProviderDiscoveryMetadataSchema = z.object({
|
|
98
|
+
...OpenIdProviderMetadataSchema.shape,
|
|
99
|
+
...OAuthMetadataSchema.pick({
|
|
100
|
+
code_challenge_methods_supported: true
|
|
101
|
+
}).shape
|
|
102
|
+
});
|
|
103
|
+
var OAuthTokensSchema = z.object({
|
|
104
|
+
access_token: z.string(),
|
|
105
|
+
id_token: z.string().optional(),
|
|
106
|
+
// Optional for OAuth 2.1, but necessary in OpenID Connect
|
|
107
|
+
token_type: z.string(),
|
|
108
|
+
expires_in: z.coerce.number().optional(),
|
|
109
|
+
scope: z.string().optional(),
|
|
110
|
+
refresh_token: z.string().optional(),
|
|
111
|
+
/**
|
|
112
|
+
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
113
|
+
* the client's `auth()` before it is stored and compared when it is read back.
|
|
114
|
+
*/
|
|
115
|
+
issuer: z.string().optional().catch(void 0)
|
|
116
|
+
}).strip();
|
|
117
|
+
var OAuthErrorResponseSchema = z.object({
|
|
118
|
+
error: z.string(),
|
|
119
|
+
error_description: z.string().optional(),
|
|
120
|
+
error_uri: z.string().optional()
|
|
121
|
+
});
|
|
122
|
+
var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal("").transform(() => void 0));
|
|
123
|
+
var OAuthClientMetadataSchema = z.object({
|
|
124
|
+
redirect_uris: z.array(SafeUrlSchema),
|
|
125
|
+
token_endpoint_auth_method: z.string().optional(),
|
|
126
|
+
grant_types: z.array(z.string()).optional(),
|
|
127
|
+
response_types: z.array(z.string()).optional(),
|
|
128
|
+
client_name: z.string().optional(),
|
|
129
|
+
client_uri: SafeUrlSchema.optional(),
|
|
130
|
+
logo_uri: OptionalSafeUrlSchema,
|
|
131
|
+
scope: z.string().optional(),
|
|
132
|
+
contacts: z.array(z.string()).optional(),
|
|
133
|
+
tos_uri: OptionalSafeUrlSchema,
|
|
134
|
+
policy_uri: z.string().optional(),
|
|
135
|
+
jwks_uri: SafeUrlSchema.optional(),
|
|
136
|
+
jwks: z.any().optional(),
|
|
137
|
+
software_id: z.string().optional(),
|
|
138
|
+
software_version: z.string().optional(),
|
|
139
|
+
software_statement: z.string().optional()
|
|
140
|
+
}).strip();
|
|
141
|
+
var OAuthClientInformationSchema = z.object({
|
|
142
|
+
client_id: z.string(),
|
|
143
|
+
client_secret: z.string().optional(),
|
|
144
|
+
client_id_issued_at: z.number().optional(),
|
|
145
|
+
client_secret_expires_at: z.number().optional(),
|
|
146
|
+
/**
|
|
147
|
+
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
148
|
+
* the client's `auth()` before it is stored and compared when it is read back.
|
|
149
|
+
*/
|
|
150
|
+
issuer: z.string().optional().catch(void 0)
|
|
151
|
+
}).strip();
|
|
152
|
+
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
153
|
+
var OAuthClientRegistrationErrorSchema = z.object({
|
|
154
|
+
error: z.string(),
|
|
155
|
+
error_description: z.string().optional()
|
|
156
|
+
}).strip();
|
|
157
|
+
var OAuthTokenRevocationRequestSchema = z.object({
|
|
158
|
+
token: z.string(),
|
|
159
|
+
token_type_hint: z.string().optional()
|
|
160
|
+
}).strip();
|
|
161
|
+
|
|
162
|
+
// ../domains/dist/index.mjs
|
|
163
|
+
var AI_PLATFORMS = ["chatgpt", "claudeai"];
|
|
164
|
+
var platformSchema = z2.enum(AI_PLATFORMS);
|
|
165
|
+
var WAF_PLATFORMS = [
|
|
166
|
+
"akamai",
|
|
167
|
+
"cato",
|
|
168
|
+
"cloudflare",
|
|
169
|
+
"fastly"
|
|
170
|
+
];
|
|
171
|
+
var ALLOWED_PLATFORMS = [...AI_PLATFORMS, ...WAF_PLATFORMS];
|
|
172
|
+
var allowedPlatformSchema = z2.enum(ALLOWED_PLATFORMS);
|
|
173
|
+
var auditStatusSchema = z2.enum([
|
|
174
|
+
"pending",
|
|
175
|
+
"partial",
|
|
176
|
+
"completed",
|
|
177
|
+
"failed"
|
|
178
|
+
]);
|
|
179
|
+
var checkSeveritySchema = z2.enum([
|
|
180
|
+
"error",
|
|
181
|
+
"warning",
|
|
182
|
+
"info"
|
|
183
|
+
]);
|
|
184
|
+
var checkCategorySchema = z2.enum([
|
|
185
|
+
"connectivity",
|
|
186
|
+
"tool-metadata",
|
|
187
|
+
"resource-metadata",
|
|
188
|
+
"performance",
|
|
189
|
+
"e2e"
|
|
190
|
+
]);
|
|
191
|
+
var checkScopeSchema = z2.enum(["server", "view"]);
|
|
192
|
+
var checkDetailSchema = z2.object({
|
|
193
|
+
label: z2.string(),
|
|
194
|
+
value: z2.string().optional()
|
|
195
|
+
});
|
|
196
|
+
var checkResultSchema = z2.object({
|
|
197
|
+
checkId: z2.string(),
|
|
198
|
+
checkName: z2.string(),
|
|
199
|
+
description: z2.string(),
|
|
200
|
+
status: z2.enum([
|
|
201
|
+
"pass",
|
|
202
|
+
"fail",
|
|
203
|
+
"skip",
|
|
204
|
+
"pending"
|
|
205
|
+
]),
|
|
206
|
+
message: z2.string(),
|
|
207
|
+
skipReason: z2.string().optional(),
|
|
208
|
+
severity: checkSeveritySchema,
|
|
209
|
+
category: checkCategorySchema,
|
|
210
|
+
scope: checkScopeSchema,
|
|
211
|
+
platforms: z2.array(platformSchema).readonly().optional(),
|
|
212
|
+
durationMs: z2.number(),
|
|
213
|
+
details: z2.array(checkDetailSchema).optional(),
|
|
214
|
+
hint: z2.object({ text: z2.string() }).optional()
|
|
215
|
+
});
|
|
216
|
+
var auditReportSchema = z2.object({
|
|
217
|
+
schemaVersion: z2.string(),
|
|
218
|
+
auditId: z2.string(),
|
|
219
|
+
targetUrl: z2.string(),
|
|
220
|
+
startedAt: z2.string(),
|
|
221
|
+
completedAt: z2.string(),
|
|
222
|
+
durationMs: z2.number(),
|
|
223
|
+
results: z2.array(checkResultSchema),
|
|
224
|
+
requiresAuth: z2.boolean(),
|
|
225
|
+
hasViewSupport: z2.boolean(),
|
|
226
|
+
viewPlatforms: z2.array(platformSchema).readonly().optional(),
|
|
227
|
+
isReadyForPlatform: z2.record(platformSchema, z2.boolean()),
|
|
228
|
+
widgetScreenshotKeys: z2.object({
|
|
229
|
+
chatgpt: z2.string().optional(),
|
|
230
|
+
claudeai: z2.string().optional()
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
var widgetScreenshotSchema = z2.object({ url: z2.string() });
|
|
234
|
+
var auditReportWithScreenshotsSchema = auditReportSchema.extend({ widgetScreenshots: z2.object({
|
|
235
|
+
chatgpt: widgetScreenshotSchema.optional(),
|
|
236
|
+
claudeai: widgetScreenshotSchema.optional()
|
|
237
|
+
}) });
|
|
238
|
+
var clientPoolSchema = z2.object({
|
|
239
|
+
id: z2.string(),
|
|
240
|
+
environmentId: z2.string(),
|
|
241
|
+
clientId: z2.string(),
|
|
242
|
+
clientSecret: z2.string(),
|
|
243
|
+
clientScopes: z2.array(z2.string())
|
|
244
|
+
});
|
|
245
|
+
var NANO_USD_PER_USD = 1e9;
|
|
246
|
+
var NANO_USD_PER_CENT = NANO_USD_PER_USD / 100;
|
|
247
|
+
var FREE_CREDIT_SEED_IN_NANO_USD = 5 * NANO_USD_PER_USD;
|
|
248
|
+
var PAID_CONVERSION_CREDIT_FLOOR_IN_NANO_USD = 5 * NANO_USD_PER_USD;
|
|
249
|
+
var creditEntryReasonSchema = z2.enum([
|
|
250
|
+
"free_seed",
|
|
251
|
+
"paid_conversion_floor",
|
|
252
|
+
"top_up",
|
|
253
|
+
"usage",
|
|
254
|
+
"admin_adjustment"
|
|
255
|
+
]);
|
|
256
|
+
var creditEntrySourceSchema = z2.enum(["playground"]);
|
|
257
|
+
var creditTopUpAmountInCentsSchema = z2.number().int().min(500);
|
|
258
|
+
var creditActivityEntrySchema = z2.object({
|
|
259
|
+
reason: creditEntryReasonSchema,
|
|
260
|
+
day: z2.number(),
|
|
261
|
+
amountInNanoUSD: z2.number(),
|
|
262
|
+
messageCount: z2.number().nullable()
|
|
263
|
+
});
|
|
264
|
+
var teamCreditsSchema = z2.object({
|
|
265
|
+
balanceInNanoUSD: z2.number(),
|
|
266
|
+
recentActivity: z2.array(creditActivityEntrySchema)
|
|
267
|
+
});
|
|
268
|
+
var deploymentStatusSchema = z2.enum([
|
|
269
|
+
"ongoing",
|
|
270
|
+
"deployed",
|
|
271
|
+
"failed",
|
|
272
|
+
"canceled"
|
|
273
|
+
]);
|
|
274
|
+
var deploymentLogSchema = z2.object({
|
|
275
|
+
timestamp: z2.coerce.date().optional(),
|
|
276
|
+
content: z2.string().optional()
|
|
277
|
+
});
|
|
278
|
+
var deploymentSummarySchema = z2.object({
|
|
279
|
+
id: z2.string(),
|
|
280
|
+
status: deploymentStatusSchema,
|
|
281
|
+
sourceBucket: z2.string().nullable(),
|
|
282
|
+
sourceObjectKey: z2.string().nullable(),
|
|
283
|
+
sourceRef: z2.string().nullable(),
|
|
284
|
+
sourceCommitId: z2.string().nullable(),
|
|
285
|
+
sourceCommitMessage: z2.string().nullable(),
|
|
286
|
+
environmentId: z2.string(),
|
|
287
|
+
authorUsername: z2.string().nullable(),
|
|
288
|
+
authorAvatarUrl: z2.string().nullable(),
|
|
289
|
+
startedAt: z2.coerce.date().nullable(),
|
|
290
|
+
completedAt: z2.coerce.date().nullable(),
|
|
291
|
+
isCurrent: z2.boolean().optional(),
|
|
292
|
+
createdAt: z2.coerce.date(),
|
|
293
|
+
updatedAt: z2.coerce.date()
|
|
294
|
+
});
|
|
295
|
+
var publicEnvironmentSchema = z2.object({
|
|
296
|
+
allowsAnonymous: z2.literal(true),
|
|
297
|
+
oAuthMetadata: z2.strictObject({})
|
|
298
|
+
});
|
|
299
|
+
var externalResourceMetadataEnvironmentSchema = z2.object({
|
|
300
|
+
allowsAnonymous: z2.boolean(),
|
|
301
|
+
oAuthMetadata: z2.object({ externalResourceMetadataUrl: z2.url() }),
|
|
302
|
+
scope: z2.string().optional()
|
|
303
|
+
});
|
|
304
|
+
var externalAuthorizationServerEnvironmentSchema = z2.object({
|
|
305
|
+
allowsAnonymous: z2.boolean(),
|
|
306
|
+
oAuthMetadata: z2.object({
|
|
307
|
+
externalAuthorizationServerUrl: z2.url(),
|
|
308
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
309
|
+
}),
|
|
310
|
+
scope: z2.string().optional()
|
|
311
|
+
});
|
|
312
|
+
var standaloneEnvironmentSchema = z2.object({
|
|
313
|
+
allowsAnonymous: z2.boolean(),
|
|
314
|
+
oAuthMetadata: z2.object({
|
|
315
|
+
authorizationServerMetadata: z2.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
316
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
317
|
+
}),
|
|
318
|
+
scope: z2.string().optional()
|
|
319
|
+
});
|
|
320
|
+
var protectedWithoutDiscoveryEnvironmentSchema = z2.object({
|
|
321
|
+
allowsAnonymous: z2.literal(false),
|
|
322
|
+
oAuthMetadata: z2.strictObject({}),
|
|
323
|
+
scope: z2.string().optional(),
|
|
324
|
+
wwwAuthenticate: z2.string().optional()
|
|
325
|
+
});
|
|
326
|
+
var legacyPublicEnvironmentSchema = z2.object({
|
|
327
|
+
isPublic: z2.literal(true),
|
|
328
|
+
oAuthMetadata: z2.undefined().optional()
|
|
329
|
+
});
|
|
330
|
+
var legacyExternalResourceMetadataEnvironmentSchema = z2.object({
|
|
331
|
+
isPublic: z2.literal(false),
|
|
332
|
+
oAuthMetadata: z2.object({ externalResourceMetadataUrl: z2.url() }),
|
|
333
|
+
scope: z2.string().optional()
|
|
334
|
+
});
|
|
335
|
+
var legacyExternalAuthorizationServerEnvironmentSchema = z2.object({
|
|
336
|
+
isPublic: z2.literal(false),
|
|
337
|
+
oAuthMetadata: z2.object({
|
|
338
|
+
externalAuthorizationServerUrl: z2.url(),
|
|
339
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
340
|
+
}),
|
|
341
|
+
scope: z2.string().optional()
|
|
342
|
+
});
|
|
343
|
+
var legacyStandaloneEnvironmentSchema = z2.object({
|
|
344
|
+
isPublic: z2.literal(false),
|
|
345
|
+
oAuthMetadata: z2.object({
|
|
346
|
+
authorizationServerMetadata: z2.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
347
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
348
|
+
}),
|
|
349
|
+
scope: z2.string().optional()
|
|
350
|
+
});
|
|
351
|
+
var legacyProtectedWithoutDiscoveryEnvironmentSchema = z2.object({
|
|
352
|
+
isPublic: z2.literal(false),
|
|
353
|
+
oAuthMetadata: z2.strictObject({}),
|
|
354
|
+
scope: z2.string().optional()
|
|
355
|
+
});
|
|
356
|
+
var environmentOAuthMetadataSchema = z2.union([
|
|
357
|
+
publicEnvironmentSchema,
|
|
358
|
+
externalResourceMetadataEnvironmentSchema,
|
|
359
|
+
externalAuthorizationServerEnvironmentSchema,
|
|
360
|
+
standaloneEnvironmentSchema,
|
|
361
|
+
protectedWithoutDiscoveryEnvironmentSchema,
|
|
362
|
+
legacyPublicEnvironmentSchema,
|
|
363
|
+
legacyExternalResourceMetadataEnvironmentSchema,
|
|
364
|
+
legacyExternalAuthorizationServerEnvironmentSchema,
|
|
365
|
+
legacyStandaloneEnvironmentSchema,
|
|
366
|
+
legacyProtectedWithoutDiscoveryEnvironmentSchema
|
|
367
|
+
]);
|
|
368
|
+
var PLAYGROUND_MODELS = [
|
|
369
|
+
"global.anthropic.claude-haiku-5-5",
|
|
370
|
+
"global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
371
|
+
"global.anthropic.claude-sonnet-5-5",
|
|
372
|
+
"openai.gpt-5.4",
|
|
373
|
+
"openai.gpt-5.5",
|
|
374
|
+
"openai.gpt-6-luna",
|
|
375
|
+
"openai.gpt-6.1-sol"
|
|
376
|
+
];
|
|
377
|
+
var playgroundModelSchema = z2.enum(PLAYGROUND_MODELS);
|
|
378
|
+
var environmentDomainSchema = z2.object({
|
|
379
|
+
name: z2.string(),
|
|
380
|
+
status: z2.enum([
|
|
381
|
+
"ongoing",
|
|
382
|
+
"deployed",
|
|
383
|
+
"failed"
|
|
384
|
+
]),
|
|
385
|
+
createdAt: z2.coerce.date(),
|
|
386
|
+
updatedAt: z2.coerce.date()
|
|
387
|
+
});
|
|
388
|
+
var environmentSchema = z2.object({
|
|
389
|
+
id: z2.string(),
|
|
390
|
+
name: z2.string(),
|
|
391
|
+
sourceBranch: z2.string().nullable(),
|
|
392
|
+
mcpServerUrl: z2.string(),
|
|
393
|
+
activeDeployment: deploymentSummarySchema.optional(),
|
|
394
|
+
latestDeployment: deploymentSummarySchema.optional(),
|
|
395
|
+
openaiAppsChallenge: z2.string().nullable().optional(),
|
|
396
|
+
isPlaygroundEnabled: z2.boolean(),
|
|
397
|
+
playgroundModel: playgroundModelSchema,
|
|
398
|
+
isIpWhitelistEnabled: z2.boolean(),
|
|
399
|
+
ipAllowlist: z2.array(z2.string()).nullable(),
|
|
400
|
+
allowedPlatforms: z2.array(allowedPlatformSchema),
|
|
401
|
+
projectId: z2.string(),
|
|
402
|
+
createdAt: z2.coerce.date(),
|
|
403
|
+
updatedAt: z2.coerce.date()
|
|
404
|
+
});
|
|
405
|
+
var environmentWithDomainsSchema = environmentSchema.extend({ domains: z2.array(environmentDomainSchema) });
|
|
406
|
+
var privacySettingsSchema = z2.object({
|
|
407
|
+
sessionReplayEnabled: z2.boolean(),
|
|
408
|
+
collectRequestPayload: z2.boolean(),
|
|
409
|
+
collectResponsePayload: z2.boolean(),
|
|
410
|
+
collectErrorMessage: z2.boolean(),
|
|
411
|
+
collectUserData: z2.boolean(),
|
|
412
|
+
identityTraitKey: z2.string().min(1).max(200).nullable(),
|
|
413
|
+
leadEventName: z2.string().min(1).max(200).nullable()
|
|
414
|
+
});
|
|
415
|
+
var feedbackSchema = z2.object({
|
|
416
|
+
id: z2.string(),
|
|
417
|
+
createdAt: z2.coerce.date(),
|
|
418
|
+
environmentId: z2.string(),
|
|
419
|
+
content: z2.string(),
|
|
420
|
+
source: z2.enum(["model", "user"]),
|
|
421
|
+
clientName: z2.string().nullable()
|
|
422
|
+
});
|
|
423
|
+
var feedbackMetaSchema = z2.object({
|
|
424
|
+
content: z2.string(),
|
|
425
|
+
source: z2.enum(["model", "user"])
|
|
426
|
+
});
|
|
427
|
+
var intentCategoryColorSchema = z2.enum([
|
|
428
|
+
"red",
|
|
429
|
+
"orange",
|
|
430
|
+
"yellow",
|
|
431
|
+
"green",
|
|
432
|
+
"blue",
|
|
433
|
+
"purple",
|
|
434
|
+
"pink",
|
|
435
|
+
"gray"
|
|
436
|
+
]);
|
|
437
|
+
var INTENT_CATEGORY_COLORS = intentCategoryColorSchema.options;
|
|
438
|
+
var intentCategorySchema = z2.object({
|
|
439
|
+
id: z2.string(),
|
|
440
|
+
createdAt: z2.coerce.date(),
|
|
441
|
+
environmentId: z2.string(),
|
|
442
|
+
name: z2.string(),
|
|
443
|
+
color: intentCategoryColorSchema
|
|
444
|
+
});
|
|
445
|
+
var intentCategorySummarySchema = z2.object({
|
|
446
|
+
id: z2.string(),
|
|
447
|
+
name: z2.string(),
|
|
448
|
+
color: intentCategoryColorSchema,
|
|
449
|
+
intentCount: z2.number().int().nonnegative()
|
|
450
|
+
});
|
|
451
|
+
var intentSchema = z2.object({
|
|
452
|
+
id: z2.string(),
|
|
453
|
+
createdAt: z2.coerce.date(),
|
|
454
|
+
environmentId: z2.string(),
|
|
455
|
+
toolName: z2.string(),
|
|
456
|
+
message: z2.string(),
|
|
457
|
+
clientName: z2.string().nullable(),
|
|
458
|
+
categories: z2.array(intentCategorySchema)
|
|
459
|
+
});
|
|
460
|
+
var signalCategorySchema = z2.object({
|
|
461
|
+
id: z2.string(),
|
|
462
|
+
name: z2.string(),
|
|
463
|
+
color: intentCategoryColorSchema
|
|
464
|
+
});
|
|
465
|
+
var signalSchema = z2.discriminatedUnion("kind", [
|
|
466
|
+
z2.object({
|
|
467
|
+
kind: z2.literal("new"),
|
|
468
|
+
category: signalCategorySchema,
|
|
469
|
+
currentCount: z2.number().int().nonnegative(),
|
|
470
|
+
currentShare: z2.number()
|
|
471
|
+
}),
|
|
472
|
+
z2.object({
|
|
473
|
+
kind: z2.literal("resurging"),
|
|
474
|
+
category: signalCategorySchema,
|
|
475
|
+
currentCount: z2.number().int().nonnegative(),
|
|
476
|
+
daysQuiet: z2.number(),
|
|
477
|
+
currentShare: z2.number()
|
|
478
|
+
}),
|
|
479
|
+
z2.object({
|
|
480
|
+
kind: z2.literal("spike"),
|
|
481
|
+
category: signalCategorySchema,
|
|
482
|
+
currentCount: z2.number().int().nonnegative(),
|
|
483
|
+
previousCount: z2.number().int().nonnegative(),
|
|
484
|
+
currentShare: z2.number(),
|
|
485
|
+
previousShare: z2.number(),
|
|
486
|
+
changeRatio: z2.number()
|
|
487
|
+
}),
|
|
488
|
+
z2.object({
|
|
489
|
+
kind: z2.literal("declining"),
|
|
490
|
+
category: signalCategorySchema,
|
|
491
|
+
currentCount: z2.number().int().nonnegative(),
|
|
492
|
+
previousCount: z2.number().int().nonnegative(),
|
|
493
|
+
currentShare: z2.number(),
|
|
494
|
+
previousShare: z2.number(),
|
|
495
|
+
changeRatio: z2.number()
|
|
496
|
+
})
|
|
497
|
+
]);
|
|
498
|
+
var intentCategorySuggestionSchema = z2.discriminatedUnion("kind", [z2.object({
|
|
499
|
+
kind: z2.literal("existing"),
|
|
500
|
+
categoryId: z2.string(),
|
|
501
|
+
categoryName: z2.string(),
|
|
502
|
+
intentIds: z2.array(z2.string())
|
|
503
|
+
}), z2.object({
|
|
504
|
+
kind: z2.literal("new"),
|
|
505
|
+
categoryName: z2.string(),
|
|
506
|
+
intentIds: z2.array(z2.string())
|
|
507
|
+
})]);
|
|
508
|
+
var invitationSchema = z2.object({
|
|
509
|
+
id: z2.string(),
|
|
510
|
+
teamId: z2.string(),
|
|
511
|
+
email: z2.string(),
|
|
512
|
+
expiresAt: z2.coerce.date(),
|
|
513
|
+
createdAt: z2.coerce.date(),
|
|
514
|
+
updatedAt: z2.coerce.date()
|
|
515
|
+
});
|
|
516
|
+
var alpicMcpRequestLogSchema = z2.object({
|
|
517
|
+
type: z2.literal("mcp_request"),
|
|
518
|
+
method: z2.string()
|
|
519
|
+
});
|
|
520
|
+
var alpicMcpErrorLogSchema = z2.object({
|
|
521
|
+
type: z2.literal("mcp_error"),
|
|
522
|
+
method: z2.string(),
|
|
523
|
+
error: z2.string()
|
|
524
|
+
});
|
|
525
|
+
var alpicLogContentSchema = z2.union([alpicMcpRequestLogSchema, alpicMcpErrorLogSchema]);
|
|
526
|
+
var logLevelSchema = z2.enum([
|
|
527
|
+
"INFO",
|
|
528
|
+
"WARNING",
|
|
529
|
+
"DEBUG",
|
|
530
|
+
"ERROR"
|
|
531
|
+
]);
|
|
532
|
+
var LOG_SEARCH_MAX_ESCAPED_LENGTH = 960;
|
|
533
|
+
function escapeLogSearchTerm(search) {
|
|
534
|
+
return [...search].flatMap((character) => [...new TextEncoder().encode(character)]).map((byte) => {
|
|
535
|
+
const character = String.fromCharCode(byte);
|
|
536
|
+
return /^[a-zA-Z0-9]$/.test(character) ? character : `\\x${byte.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
537
|
+
}).join("");
|
|
538
|
+
}
|
|
539
|
+
var logSearchSchema = z2.string().max(240, `Search must be 240 characters or fewer`).refine((search) => escapeLogSearchTerm(search).length <= LOG_SEARCH_MAX_ESCAPED_LENGTH, "Search is too complex; shorten it or use fewer special characters");
|
|
540
|
+
var UNNAMED_MCP_CLIENT_ID = "unnamed_client";
|
|
541
|
+
var MCP_CLIENT_GROUPS = [
|
|
542
|
+
{
|
|
543
|
+
id: "claude_code",
|
|
544
|
+
label: "Claude Code",
|
|
545
|
+
vendor: "anthropic",
|
|
546
|
+
rawNames: ["claude-code", "Anthropic/ClaudeCodeDesktop"]
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
id: "claude",
|
|
550
|
+
label: "Claude",
|
|
551
|
+
vendor: "anthropic",
|
|
552
|
+
rawNames: [
|
|
553
|
+
"Anthropic/ClaudeAI",
|
|
554
|
+
"claude-ai",
|
|
555
|
+
"claude",
|
|
556
|
+
"Claude",
|
|
557
|
+
"claude-desktop",
|
|
558
|
+
"claude-desktop-3p"
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
id: "claude_mobile",
|
|
563
|
+
label: "Claude mobile",
|
|
564
|
+
vendor: "anthropic",
|
|
565
|
+
rawNames: ["claude-ios", "ClaudeAndroid"]
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
id: "claude_cowork",
|
|
569
|
+
label: "Claude Cowork",
|
|
570
|
+
vendor: "anthropic",
|
|
571
|
+
rawNames: ["Anthropic/Cowork"]
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
id: "claude_sheet_add_in",
|
|
575
|
+
label: "Claude (Sheet Add-In)",
|
|
576
|
+
vendor: "anthropic",
|
|
577
|
+
rawNames: ["sheet-add-in"]
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
id: "claude_toolbox",
|
|
581
|
+
label: "Claude Toolbox",
|
|
582
|
+
vendor: "anthropic",
|
|
583
|
+
rawNames: ["Anthropic/Toolbox", "Anthropic/toolbox-bootstrap"]
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
id: "anthropic_api",
|
|
587
|
+
label: "Anthropic API",
|
|
588
|
+
vendor: "anthropic",
|
|
589
|
+
rawNames: ["Anthropic/API"]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
id: "anthropic_connector_refresh",
|
|
593
|
+
label: "Anthropic (connector refresh)",
|
|
594
|
+
vendor: "anthropic",
|
|
595
|
+
rawNames: ["Anthropic"]
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
id: "codex",
|
|
599
|
+
label: "Codex",
|
|
600
|
+
vendor: "openai",
|
|
601
|
+
rawNames: [
|
|
602
|
+
"codex-mcp-client",
|
|
603
|
+
"codex",
|
|
604
|
+
"Codex",
|
|
605
|
+
"codex-cli",
|
|
606
|
+
"openai-mcp (Codex)"
|
|
607
|
+
]
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
id: "chatgpt",
|
|
611
|
+
label: "ChatGPT",
|
|
612
|
+
vendor: "openai",
|
|
613
|
+
rawNames: ["openai-mcp", "openai-mcp (ChatGPT)"]
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
id: "openai_responses_api",
|
|
617
|
+
label: "OpenAI Responses API",
|
|
618
|
+
vendor: "openai",
|
|
619
|
+
rawNames: ["openai-mcp (Responses API)"]
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
id: "openai_agent_builder",
|
|
623
|
+
label: "OpenAI Agent Builder",
|
|
624
|
+
vendor: "openai",
|
|
625
|
+
rawNames: ["openai-mcp (Agent Builder)"]
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
id: "cursor",
|
|
629
|
+
label: "Cursor",
|
|
630
|
+
vendor: "cursor",
|
|
631
|
+
rawNames: [
|
|
632
|
+
"cursor-vscode",
|
|
633
|
+
"Cursor",
|
|
634
|
+
"cursor"
|
|
635
|
+
]
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
id: "cline",
|
|
639
|
+
label: "Cline",
|
|
640
|
+
vendor: "cline",
|
|
641
|
+
rawNames: [
|
|
642
|
+
"Cline",
|
|
643
|
+
"cline",
|
|
644
|
+
"@cline/core"
|
|
645
|
+
]
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
id: "github_copilot",
|
|
649
|
+
label: "GitHub Copilot",
|
|
650
|
+
vendor: "githubCopilot",
|
|
651
|
+
rawNames: [
|
|
652
|
+
"Copilot",
|
|
653
|
+
"github-copilot-developer",
|
|
654
|
+
"Copilot MCP Gateway",
|
|
655
|
+
"Xcode/copilot-xcode"
|
|
656
|
+
]
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
id: "gemini_cli",
|
|
660
|
+
label: "Gemini CLI",
|
|
661
|
+
vendor: "google",
|
|
662
|
+
rawNames: ["gemini-cli-mcp-client", "gemini-cli"]
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
id: "antigravity",
|
|
666
|
+
label: "Antigravity",
|
|
667
|
+
vendor: "google",
|
|
668
|
+
rawNames: ["antigravity-client"]
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
id: "gemini",
|
|
672
|
+
label: "Gemini",
|
|
673
|
+
vendor: "google",
|
|
674
|
+
rawNames: ["Gemini", "google-ai-edge-gallery"]
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
id: "windsurf",
|
|
678
|
+
label: "Windsurf",
|
|
679
|
+
vendor: "windsurf",
|
|
680
|
+
rawNames: ["Windsurf", "windsurf-client"]
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
id: "mistral",
|
|
684
|
+
label: "Mistral / Le Chat",
|
|
685
|
+
vendor: "mistral",
|
|
686
|
+
rawNames: ["Mistral"],
|
|
687
|
+
rawNamePrefixes: ["connector:custom-mcp:"]
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
id: "n8n",
|
|
691
|
+
label: "n8n",
|
|
692
|
+
vendor: "n8n",
|
|
693
|
+
rawNames: [
|
|
694
|
+
"@n8n/n8n-nodes-langchain.mcpClient",
|
|
695
|
+
"@n8n/n8n-nodes-langchain.mcpClientTool",
|
|
696
|
+
"n8n"
|
|
697
|
+
]
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
id: "alpic_playground",
|
|
701
|
+
label: "Alpic Playground",
|
|
702
|
+
vendor: "alpic",
|
|
703
|
+
rawNames: ["alpic-playground", "playground"]
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
id: "opencode",
|
|
707
|
+
label: "opencode",
|
|
708
|
+
vendor: "opencode",
|
|
709
|
+
rawNames: ["opencode"]
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
id: "zed",
|
|
713
|
+
label: "Zed",
|
|
714
|
+
vendor: "zed",
|
|
715
|
+
rawNames: ["Zed", "zed"]
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
id: "zapier",
|
|
719
|
+
label: "Zapier",
|
|
720
|
+
vendor: "zapier",
|
|
721
|
+
rawNames: ["Zapier", "zapier"]
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
id: "make",
|
|
725
|
+
label: "Make",
|
|
726
|
+
vendor: "make",
|
|
727
|
+
rawNames: ["Make", "make"]
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
id: "librechat",
|
|
731
|
+
label: "LibreChat",
|
|
732
|
+
vendor: "mcp",
|
|
733
|
+
rawNames: ["LibreChat", "librechat"]
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
id: "jan",
|
|
737
|
+
label: "Jan",
|
|
738
|
+
vendor: "mcp",
|
|
739
|
+
rawNames: ["Jan", "jan"]
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
id: "goose",
|
|
743
|
+
label: "goose",
|
|
744
|
+
vendor: "mcp",
|
|
745
|
+
rawNames: ["goose", "Goose"]
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
id: "mcphost",
|
|
749
|
+
label: "mcphost",
|
|
750
|
+
vendor: "mcp",
|
|
751
|
+
rawNames: ["mcphost"]
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
id: "mcporter",
|
|
755
|
+
label: "mcporter",
|
|
756
|
+
vendor: "mcp",
|
|
757
|
+
rawNames: ["mcporter"]
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
id: "rmcp",
|
|
761
|
+
label: "rmcp",
|
|
762
|
+
vendor: "mcp",
|
|
763
|
+
rawNames: ["rmcp"]
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
id: UNNAMED_MCP_CLIENT_ID,
|
|
767
|
+
label: "Unnamed client",
|
|
768
|
+
vendor: "mcp",
|
|
769
|
+
rawNames: [
|
|
770
|
+
"mcp",
|
|
771
|
+
"unknown",
|
|
772
|
+
""
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
];
|
|
776
|
+
var MCP_REMOTE_WRAPPER_SUFFIX = String.raw` \(via mcp-remote [^\n]+?\)$`;
|
|
777
|
+
var MCP_REMOTE_WRAPPER = new RegExp(MCP_REMOTE_WRAPPER_SUFFIX);
|
|
778
|
+
var groupById = new Map(MCP_CLIENT_GROUPS.map((group) => [group.id, group]));
|
|
779
|
+
var LTS_CODENAMES = /* @__PURE__ */ new Map([
|
|
780
|
+
["gallium", 16],
|
|
781
|
+
["hydrogen", 18],
|
|
782
|
+
["iron", 20],
|
|
783
|
+
["jod", 22],
|
|
784
|
+
["krypton", 24],
|
|
785
|
+
["lithium", 26]
|
|
786
|
+
]);
|
|
787
|
+
var LATEST_LTS_VERSION = 26;
|
|
788
|
+
function detectNodeRuntime(input) {
|
|
789
|
+
for (const content of [input.nvmrcContent, input.nodeVersionContent]) {
|
|
790
|
+
if (!content?.trim()) continue;
|
|
791
|
+
const version = parseNodeVersion(content);
|
|
792
|
+
if (version !== null) return mapNodeVersionToRuntime(version);
|
|
793
|
+
}
|
|
794
|
+
return null;
|
|
795
|
+
}
|
|
796
|
+
function parseNodeVersion(content) {
|
|
797
|
+
const trimmed = content.trim().toLowerCase();
|
|
798
|
+
if (!trimmed || trimmed === "node" || trimmed === "stable" || trimmed === "lts/*") return LATEST_LTS_VERSION;
|
|
799
|
+
if (trimmed.startsWith("lts/")) return LTS_CODENAMES.get(trimmed.slice(4)) ?? null;
|
|
800
|
+
const majorMatch = (trimmed.startsWith("v") ? trimmed.slice(1) : trimmed).match(/^(\d+)/);
|
|
801
|
+
return majorMatch?.[1] ? parseInt(majorMatch[1], 10) : null;
|
|
802
|
+
}
|
|
803
|
+
function mapNodeVersionToRuntime(version) {
|
|
804
|
+
if (version === null || version >= 26) return "node26";
|
|
805
|
+
if (version >= 24) return "node24";
|
|
806
|
+
return "node22";
|
|
807
|
+
}
|
|
808
|
+
var runtimeSchema = z2.enum([
|
|
809
|
+
"python3.13",
|
|
810
|
+
"python3.14",
|
|
811
|
+
"node22",
|
|
812
|
+
"node24",
|
|
813
|
+
"node26"
|
|
814
|
+
]);
|
|
815
|
+
var transportSchema = z2.enum([
|
|
816
|
+
"stdio",
|
|
817
|
+
"sse",
|
|
818
|
+
"streamablehttp"
|
|
819
|
+
]);
|
|
820
|
+
var projectSchema = z2.object({
|
|
821
|
+
id: z2.string(),
|
|
822
|
+
name: z2.string(),
|
|
823
|
+
teamId: z2.string(),
|
|
824
|
+
sourceRepository: z2.string().nullable(),
|
|
825
|
+
createdAt: z2.coerce.date().optional(),
|
|
826
|
+
runtime: runtimeSchema,
|
|
827
|
+
transport: transportSchema.nullable(),
|
|
828
|
+
rootDirectory: z2.string().nullable(),
|
|
829
|
+
installCommand: z2.string().nullable(),
|
|
830
|
+
buildCommand: z2.string().nullable(),
|
|
831
|
+
buildOutputDir: z2.string().nullable(),
|
|
832
|
+
startCommand: z2.string().nullable(),
|
|
833
|
+
fixedOutboundIp: z2.boolean(),
|
|
834
|
+
environments: z2.array(environmentWithDomainsSchema),
|
|
835
|
+
productionEnvironment: environmentWithDomainsSchema.nullable()
|
|
836
|
+
});
|
|
837
|
+
var domainFailureReasonSchema = z2.enum([
|
|
838
|
+
"caa",
|
|
839
|
+
"dns",
|
|
840
|
+
"invalid_domain",
|
|
841
|
+
"other"
|
|
842
|
+
]);
|
|
843
|
+
var projectDomainMappingSchema = z2.object({
|
|
844
|
+
pathPrefix: z2.string(),
|
|
845
|
+
environment: environmentSchema
|
|
846
|
+
});
|
|
847
|
+
var projectDomainSchema = z2.object({
|
|
848
|
+
name: z2.string(),
|
|
849
|
+
createdAt: z2.coerce.date(),
|
|
850
|
+
status: z2.enum([
|
|
851
|
+
"ongoing",
|
|
852
|
+
"deployed",
|
|
853
|
+
"failed"
|
|
854
|
+
]),
|
|
855
|
+
failureReason: domainFailureReasonSchema.nullable(),
|
|
856
|
+
environment: environmentSchema,
|
|
857
|
+
mappings: z2.array(projectDomainMappingSchema)
|
|
858
|
+
});
|
|
859
|
+
var serverFieldsSchema = z2.object({
|
|
860
|
+
$schema: z2.string(),
|
|
861
|
+
name: z2.string(),
|
|
862
|
+
description: z2.string(),
|
|
863
|
+
version: z2.string().optional(),
|
|
864
|
+
title: z2.string().optional(),
|
|
865
|
+
websiteUrl: z2.string().optional(),
|
|
866
|
+
icons: z2.array(z2.object({
|
|
867
|
+
src: z2.string(),
|
|
868
|
+
mimeType: z2.string().optional(),
|
|
869
|
+
sizes: z2.array(z2.string()).optional()
|
|
870
|
+
})).optional(),
|
|
871
|
+
remotes: z2.array(z2.object({
|
|
872
|
+
type: z2.string(),
|
|
873
|
+
url: z2.string().optional(),
|
|
874
|
+
headers: z2.array(z2.object({
|
|
875
|
+
name: z2.string(),
|
|
876
|
+
description: z2.string(),
|
|
877
|
+
isRequired: z2.boolean().optional(),
|
|
878
|
+
isSecret: z2.boolean().optional()
|
|
879
|
+
})).optional()
|
|
880
|
+
})).optional()
|
|
881
|
+
}).catchall(z2.unknown());
|
|
882
|
+
var serverJsonSchema = z2.object({
|
|
883
|
+
serverFields: serverFieldsSchema,
|
|
884
|
+
source: z2.enum(["registry", "defaults"])
|
|
885
|
+
});
|
|
886
|
+
var clampStringField = (field) => {
|
|
887
|
+
const max = field.maxLength;
|
|
888
|
+
if (max === null) return field;
|
|
889
|
+
const clamped = z2.string().overwrite((value) => value.slice(0, max)).max(max);
|
|
890
|
+
const withMin = field.minLength === null ? clamped : clamped.min(field.minLength);
|
|
891
|
+
return field.description ? withMin.describe(field.description) : withMin;
|
|
892
|
+
};
|
|
893
|
+
var unboundedArrayField = (field) => {
|
|
894
|
+
const unbounded = z2.array(field.element);
|
|
895
|
+
return field.description ? unbounded.describe(field.description) : unbounded;
|
|
896
|
+
};
|
|
897
|
+
var toolDefinitionSchema = z2.object({
|
|
898
|
+
name: z2.string(),
|
|
899
|
+
title: z2.string().optional().describe("Human-friendly name for the tool, used in the UI. If not provided, `name` will be used."),
|
|
900
|
+
description: z2.string().optional(),
|
|
901
|
+
annotations: z2.object({
|
|
902
|
+
readOnlyHint: z2.boolean().optional(),
|
|
903
|
+
destructiveHint: z2.boolean().optional(),
|
|
904
|
+
openWorldHint: z2.boolean().optional(),
|
|
905
|
+
idempotentHint: z2.boolean().optional()
|
|
906
|
+
}).optional()
|
|
907
|
+
});
|
|
908
|
+
var positiveTestCaseSchema = z2.object({
|
|
909
|
+
scenario: z2.string().min(1).describe("Short label for what this case demonstrates."),
|
|
910
|
+
userPrompt: z2.string().min(1).describe("A realistic, standalone user message a reviewer can paste and run with no prior state or multi-turn setup. Vary phrasing and tone across cases."),
|
|
911
|
+
toolTriggered: z2.string().optional().describe("The tool this prompt should invoke."),
|
|
912
|
+
expectedOutput: z2.string().optional().describe("What the user should see, including post-interaction behaviour where relevant.")
|
|
913
|
+
}).describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
|
|
914
|
+
var positiveTestCaseDraftSchema = positiveTestCaseSchema.partial().extend({
|
|
915
|
+
scenario: z2.string().optional(),
|
|
916
|
+
userPrompt: z2.string().optional()
|
|
917
|
+
});
|
|
918
|
+
var blankPositiveTestCase = () => ({
|
|
919
|
+
scenario: "",
|
|
920
|
+
userPrompt: "",
|
|
921
|
+
toolTriggered: "",
|
|
922
|
+
expectedOutput: ""
|
|
923
|
+
});
|
|
924
|
+
var toFixedLength = (entries, length, blank) => Array.from({ length }, (_, index) => entries[index] ?? blank());
|
|
925
|
+
var screenshotEntrySchema = z2.object({
|
|
926
|
+
prompt: z2.string(),
|
|
927
|
+
url: z2.url()
|
|
928
|
+
}).describe("Each screenshot: the user prompt that produced it + the image URL.");
|
|
929
|
+
var screenshotDraftEntrySchema = screenshotEntrySchema.extend({ url: z2.string() });
|
|
930
|
+
var supportChannelSchema = z2.string().refine((value) => z2.email().safeParse(value).success || z2.url().safeParse(value).success, { error: "Must be a valid email or URL" });
|
|
931
|
+
var urlField = z2.url({ error: "Enter a full URL including https:// (e.g. https://example.com)" });
|
|
932
|
+
var chatgptCategorySchema = z2.enum([
|
|
933
|
+
"BUSINESS",
|
|
934
|
+
"COLLABORATION",
|
|
935
|
+
"DESIGN",
|
|
936
|
+
"DEVELOPER_TOOLS",
|
|
937
|
+
"EDUCATION",
|
|
938
|
+
"ENTERTAINMENT",
|
|
939
|
+
"FINANCE",
|
|
940
|
+
"FOOD",
|
|
941
|
+
"LIFESTYLE",
|
|
942
|
+
"NEWS",
|
|
943
|
+
"PRODUCTIVITY",
|
|
944
|
+
"SHOPPING",
|
|
945
|
+
"TRAVEL"
|
|
946
|
+
]);
|
|
947
|
+
var chatgptAuthenticationSchema = z2.enum(["No auth needed", "OAuth 2.0"]);
|
|
948
|
+
var chatgptCountryCodeSchema = z2.enum([
|
|
949
|
+
"AD",
|
|
950
|
+
"AE",
|
|
951
|
+
"AF",
|
|
952
|
+
"AG",
|
|
953
|
+
"AL",
|
|
954
|
+
"AM",
|
|
955
|
+
"AO",
|
|
956
|
+
"AR",
|
|
957
|
+
"AT",
|
|
958
|
+
"AU",
|
|
959
|
+
"AW",
|
|
960
|
+
"AX",
|
|
961
|
+
"AZ",
|
|
962
|
+
"BA",
|
|
963
|
+
"BB",
|
|
964
|
+
"BD",
|
|
965
|
+
"BE",
|
|
966
|
+
"BF",
|
|
967
|
+
"BG",
|
|
968
|
+
"BH",
|
|
969
|
+
"BI",
|
|
970
|
+
"BJ",
|
|
971
|
+
"BL",
|
|
972
|
+
"BM",
|
|
973
|
+
"BN",
|
|
974
|
+
"BO",
|
|
975
|
+
"BR",
|
|
976
|
+
"BS",
|
|
977
|
+
"BT",
|
|
978
|
+
"BW",
|
|
979
|
+
"BZ",
|
|
980
|
+
"CA",
|
|
981
|
+
"CD",
|
|
982
|
+
"CF",
|
|
983
|
+
"CG",
|
|
984
|
+
"CH",
|
|
985
|
+
"CI",
|
|
986
|
+
"CL",
|
|
987
|
+
"CM",
|
|
988
|
+
"CO",
|
|
989
|
+
"CR",
|
|
990
|
+
"CV",
|
|
991
|
+
"CY",
|
|
992
|
+
"CZ",
|
|
993
|
+
"DE",
|
|
994
|
+
"DJ",
|
|
995
|
+
"DK",
|
|
996
|
+
"DM",
|
|
997
|
+
"DO",
|
|
998
|
+
"DZ",
|
|
999
|
+
"EC",
|
|
1000
|
+
"EE",
|
|
1001
|
+
"EG",
|
|
1002
|
+
"ER",
|
|
1003
|
+
"ES",
|
|
1004
|
+
"ET",
|
|
1005
|
+
"FI",
|
|
1006
|
+
"FJ",
|
|
1007
|
+
"FM",
|
|
1008
|
+
"FO",
|
|
1009
|
+
"FR",
|
|
1010
|
+
"GA",
|
|
1011
|
+
"GB",
|
|
1012
|
+
"GD",
|
|
1013
|
+
"GE",
|
|
1014
|
+
"GF",
|
|
1015
|
+
"GH",
|
|
1016
|
+
"GL",
|
|
1017
|
+
"GM",
|
|
1018
|
+
"GN",
|
|
1019
|
+
"GP",
|
|
1020
|
+
"GQ",
|
|
1021
|
+
"GR",
|
|
1022
|
+
"GT",
|
|
1023
|
+
"GW",
|
|
1024
|
+
"GY",
|
|
1025
|
+
"HN",
|
|
1026
|
+
"HR",
|
|
1027
|
+
"HT",
|
|
1028
|
+
"HU",
|
|
1029
|
+
"ID",
|
|
1030
|
+
"IE",
|
|
1031
|
+
"IL",
|
|
1032
|
+
"IN",
|
|
1033
|
+
"IQ",
|
|
1034
|
+
"IS",
|
|
1035
|
+
"IT",
|
|
1036
|
+
"JM",
|
|
1037
|
+
"JO",
|
|
1038
|
+
"JP",
|
|
1039
|
+
"KE",
|
|
1040
|
+
"KG",
|
|
1041
|
+
"KH",
|
|
1042
|
+
"KI",
|
|
1043
|
+
"KM",
|
|
1044
|
+
"KN",
|
|
1045
|
+
"KR",
|
|
1046
|
+
"KW",
|
|
1047
|
+
"KY",
|
|
1048
|
+
"KZ",
|
|
1049
|
+
"LA",
|
|
1050
|
+
"LB",
|
|
1051
|
+
"LC",
|
|
1052
|
+
"LI",
|
|
1053
|
+
"LK",
|
|
1054
|
+
"LR",
|
|
1055
|
+
"LS",
|
|
1056
|
+
"LT",
|
|
1057
|
+
"LU",
|
|
1058
|
+
"LV",
|
|
1059
|
+
"LY",
|
|
1060
|
+
"MA",
|
|
1061
|
+
"MC",
|
|
1062
|
+
"MD",
|
|
1063
|
+
"ME",
|
|
1064
|
+
"MF",
|
|
1065
|
+
"MG",
|
|
1066
|
+
"MH",
|
|
1067
|
+
"MK",
|
|
1068
|
+
"ML",
|
|
1069
|
+
"MM",
|
|
1070
|
+
"MN",
|
|
1071
|
+
"MQ",
|
|
1072
|
+
"MR",
|
|
1073
|
+
"MT",
|
|
1074
|
+
"MU",
|
|
1075
|
+
"MV",
|
|
1076
|
+
"MW",
|
|
1077
|
+
"MX",
|
|
1078
|
+
"MY",
|
|
1079
|
+
"MZ",
|
|
1080
|
+
"NA",
|
|
1081
|
+
"NC",
|
|
1082
|
+
"NE",
|
|
1083
|
+
"NG",
|
|
1084
|
+
"NI",
|
|
1085
|
+
"NL",
|
|
1086
|
+
"NO",
|
|
1087
|
+
"NP",
|
|
1088
|
+
"NR",
|
|
1089
|
+
"NZ",
|
|
1090
|
+
"OM",
|
|
1091
|
+
"PA",
|
|
1092
|
+
"PE",
|
|
1093
|
+
"PF",
|
|
1094
|
+
"PG",
|
|
1095
|
+
"PH",
|
|
1096
|
+
"PK",
|
|
1097
|
+
"PL",
|
|
1098
|
+
"PM",
|
|
1099
|
+
"PS",
|
|
1100
|
+
"PT",
|
|
1101
|
+
"PW",
|
|
1102
|
+
"PY",
|
|
1103
|
+
"QA",
|
|
1104
|
+
"RE",
|
|
1105
|
+
"RO",
|
|
1106
|
+
"RS",
|
|
1107
|
+
"RW",
|
|
1108
|
+
"SA",
|
|
1109
|
+
"SB",
|
|
1110
|
+
"SC",
|
|
1111
|
+
"SD",
|
|
1112
|
+
"SE",
|
|
1113
|
+
"SG",
|
|
1114
|
+
"SH",
|
|
1115
|
+
"SI",
|
|
1116
|
+
"SJ",
|
|
1117
|
+
"SK",
|
|
1118
|
+
"SL",
|
|
1119
|
+
"SM",
|
|
1120
|
+
"SN",
|
|
1121
|
+
"SO",
|
|
1122
|
+
"SR",
|
|
1123
|
+
"SS",
|
|
1124
|
+
"ST",
|
|
1125
|
+
"SV",
|
|
1126
|
+
"SZ",
|
|
1127
|
+
"TD",
|
|
1128
|
+
"TF",
|
|
1129
|
+
"TG",
|
|
1130
|
+
"TH",
|
|
1131
|
+
"TJ",
|
|
1132
|
+
"TL",
|
|
1133
|
+
"TM",
|
|
1134
|
+
"TN",
|
|
1135
|
+
"TO",
|
|
1136
|
+
"TR",
|
|
1137
|
+
"TT",
|
|
1138
|
+
"TV",
|
|
1139
|
+
"TW",
|
|
1140
|
+
"TZ",
|
|
1141
|
+
"UA",
|
|
1142
|
+
"UG",
|
|
1143
|
+
"US",
|
|
1144
|
+
"UY",
|
|
1145
|
+
"UZ",
|
|
1146
|
+
"VA",
|
|
1147
|
+
"VC",
|
|
1148
|
+
"VN",
|
|
1149
|
+
"VU",
|
|
1150
|
+
"WF",
|
|
1151
|
+
"WS",
|
|
1152
|
+
"YE",
|
|
1153
|
+
"YT",
|
|
1154
|
+
"ZA",
|
|
1155
|
+
"ZM",
|
|
1156
|
+
"ZW"
|
|
1157
|
+
]);
|
|
1158
|
+
var chatgptAllowedCountriesSchema = z2.discriminatedUnion("mode", [
|
|
1159
|
+
z2.object({ mode: z2.literal("all") }),
|
|
1160
|
+
z2.object({
|
|
1161
|
+
mode: z2.literal("allow"),
|
|
1162
|
+
countries: z2.array(chatgptCountryCodeSchema)
|
|
1163
|
+
}),
|
|
1164
|
+
z2.object({
|
|
1165
|
+
mode: z2.literal("block"),
|
|
1166
|
+
countries: z2.array(chatgptCountryCodeSchema)
|
|
1167
|
+
})
|
|
1168
|
+
]);
|
|
1169
|
+
var chatgptTranslationLocaleSchema = z2.enum([
|
|
1170
|
+
"am",
|
|
1171
|
+
"ar",
|
|
1172
|
+
"bg-BG",
|
|
1173
|
+
"bn-BD",
|
|
1174
|
+
"bs-BA",
|
|
1175
|
+
"ca-ES",
|
|
1176
|
+
"cs-CZ",
|
|
1177
|
+
"da-DK",
|
|
1178
|
+
"de-DE",
|
|
1179
|
+
"el-GR",
|
|
1180
|
+
"es-419",
|
|
1181
|
+
"es-ES",
|
|
1182
|
+
"et-EE",
|
|
1183
|
+
"fi-FI",
|
|
1184
|
+
"fr-CA",
|
|
1185
|
+
"fr-FR",
|
|
1186
|
+
"gu-IN",
|
|
1187
|
+
"hi-IN",
|
|
1188
|
+
"hr-HR",
|
|
1189
|
+
"hu-HU",
|
|
1190
|
+
"hy-AM",
|
|
1191
|
+
"id-ID",
|
|
1192
|
+
"is-IS",
|
|
1193
|
+
"it-IT",
|
|
1194
|
+
"ja-JP",
|
|
1195
|
+
"ka-GE",
|
|
1196
|
+
"kk",
|
|
1197
|
+
"kn-IN",
|
|
1198
|
+
"ko-KR",
|
|
1199
|
+
"lt",
|
|
1200
|
+
"lv-LV",
|
|
1201
|
+
"mk-MK",
|
|
1202
|
+
"ml",
|
|
1203
|
+
"mn",
|
|
1204
|
+
"mr-IN",
|
|
1205
|
+
"ms-MY",
|
|
1206
|
+
"my-MM",
|
|
1207
|
+
"nb-NO",
|
|
1208
|
+
"nl-NL",
|
|
1209
|
+
"pa",
|
|
1210
|
+
"pl-PL",
|
|
1211
|
+
"pt-BR",
|
|
1212
|
+
"pt-PT",
|
|
1213
|
+
"ro-RO",
|
|
1214
|
+
"ru-RU",
|
|
1215
|
+
"sk-SK",
|
|
1216
|
+
"sl-SI",
|
|
1217
|
+
"so-SO",
|
|
1218
|
+
"sq-AL",
|
|
1219
|
+
"sr-RS",
|
|
1220
|
+
"sv-SE",
|
|
1221
|
+
"sw-TZ",
|
|
1222
|
+
"ta-IN",
|
|
1223
|
+
"te-IN",
|
|
1224
|
+
"th-TH",
|
|
1225
|
+
"tl",
|
|
1226
|
+
"tr-TR",
|
|
1227
|
+
"uk-UA",
|
|
1228
|
+
"ur",
|
|
1229
|
+
"vi-VN",
|
|
1230
|
+
"zh-CN",
|
|
1231
|
+
"zh-HK",
|
|
1232
|
+
"zh-TW"
|
|
1233
|
+
]);
|
|
1234
|
+
var negativeTestCaseSchema = z2.object({
|
|
1235
|
+
scenario: z2.string().min(1),
|
|
1236
|
+
userPrompt: z2.string().min(1)
|
|
1237
|
+
}).describe("Each case: Scenario + User prompt (the plugin should NOT trigger).");
|
|
1238
|
+
var negativeTestCaseDraftSchema = negativeTestCaseSchema.partial().extend({
|
|
1239
|
+
scenario: z2.string().optional(),
|
|
1240
|
+
userPrompt: z2.string().optional()
|
|
1241
|
+
});
|
|
1242
|
+
var blankNegativeTestCase = () => ({
|
|
1243
|
+
scenario: "",
|
|
1244
|
+
userPrompt: ""
|
|
1245
|
+
});
|
|
1246
|
+
var chatgptSkillSchema = z2.object({ name: z2.string() }).describe("A skill discovered on the MCP server, by name.");
|
|
1247
|
+
var chatgptToolJustificationSchema = z2.object({
|
|
1248
|
+
toolName: z2.string(),
|
|
1249
|
+
readOnlyJustification: z2.string().describe("One sentence on what the tool reads and returns."),
|
|
1250
|
+
openWorldJustification: z2.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
1251
|
+
destructiveJustification: z2.string().describe('One sentence on whether the tool changes data. For a read-only tool, state the full triad: "No data is created, modified, or deleted."')
|
|
1252
|
+
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
1253
|
+
var chatgptTaglineSchema = z2.string().max(30);
|
|
1254
|
+
var chatgptDescriptionSchema = z2.string();
|
|
1255
|
+
var chatgptTranslationSchema = z2.object({
|
|
1256
|
+
locale: chatgptTranslationLocaleSchema,
|
|
1257
|
+
tagline: chatgptTaglineSchema,
|
|
1258
|
+
description: chatgptDescriptionSchema
|
|
1259
|
+
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
1260
|
+
var chatgptTranslationGenerationSchema = chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
1261
|
+
var chatgptSubmissionFormDataSchema = z2.object({
|
|
1262
|
+
logoLight: z2.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
|
|
1263
|
+
logoDark: z2.string().optional().describe("Optional dark-mode logo icon. Square PNG, same specs as the light icon. Leave empty if the light icon also works on dark backgrounds."),
|
|
1264
|
+
appName: z2.string().describe("The name users will see in ChatGPT and in the Plugin Directory."),
|
|
1265
|
+
tagline: chatgptTaglineSchema.describe('Plain-language phrase focused on function and user value, 30 chars max. Avoid generic superlatives like "the best \u2026".'),
|
|
1266
|
+
description: chatgptDescriptionSchema.describe("Clear, engaging description highlighting what the plugin does and why people will love it. Appears publicly on the directory page. End it by naming the product categories or intents the plugin does NOT cover, so ChatGPT learns when not to route to it (define exclusions by absent categories or wrong intents, never by naming other brands)."),
|
|
1267
|
+
category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
|
|
1268
|
+
developerName: z2.string().describe("Developer name shown publicly on the plugin's directory page."),
|
|
1269
|
+
companyUrl: urlField.describe("Your company's main website URL."),
|
|
1270
|
+
supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
|
|
1271
|
+
privacyPolicyUrl: urlField.describe("URL to your privacy policy."),
|
|
1272
|
+
termsOfServiceUrl: urlField.describe("URL to the plugin's terms of service."),
|
|
1273
|
+
demoRecordingUrl: urlField.describe("URL to a video demonstrating the plugin, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
|
|
1274
|
+
appCommerceAndPurchasing: z2.boolean().describe("Checkbox: 'My plugin links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the plugin does not offer digital goods."),
|
|
1275
|
+
serverUrl: urlField.describe("URL of the MCP server."),
|
|
1276
|
+
authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
|
|
1277
|
+
tools: z2.array(toolDefinitionSchema).describe("List of tools exposed by the MCP server (auto-populated from the production server's manifest)."),
|
|
1278
|
+
toolJustifications: z2.array(chatgptToolJustificationSchema).describe("Per-tool justification of `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotation values. One short, specific sentence per hint describing what the tool actually does."),
|
|
1279
|
+
skills: z2.array(chatgptSkillSchema).optional().describe("Skills the server exposes over MCP (auto-populated from the production server's manifest). Left unset when the server does not advertise the skills extension, which is a different state from advertising it and exposing none."),
|
|
1280
|
+
testCases: z2.array(positiveTestCaseSchema).length(5).describe("Exactly 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output. Collectively cover the full capability across different flow stages (initial search or browse, market or locale handling, post-interaction detail, an action ChatGPT performs on the user's behalf, and a conversion or secondary tool) rather than five variations of the same first step."),
|
|
1281
|
+
negativeTestCases: z2.array(negativeTestCaseSchema).length(3).describe("Exactly 3 negative test cases: prompts where the plugin should NOT trigger but the model might think it is relevant. These become production routing metadata that teaches ChatGPT when to stay silent, so pick tight near-misses: a product category the plugin does not carry, the right brand or domain but an intent the plugin does not serve, or a boundary with a sibling plugin."),
|
|
1282
|
+
screenshots: z2.array(screenshotEntrySchema.extend({ prompt: z2.string().max(75, { error: "Screenshot prompts are limited to 75 characters." }) })).max(3).describe("In-plugin screenshots paired with the user prompt that produced them (each prompt is 75 characters max). Widget plugins must show the widget UI; non-widget plugins show the model response. Min 1, max 3 entries, all public. Images: 706px wide, 400\u2013860px tall, PNG."),
|
|
1283
|
+
translations: z2.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
|
|
1284
|
+
allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
|
|
1285
|
+
releaseNotes: z2.string().describe("Publicly displayed on the plugin details page.")
|
|
1286
|
+
});
|
|
1287
|
+
var chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
|
|
1288
|
+
tagline: z2.string().optional(),
|
|
1289
|
+
companyUrl: z2.string().optional(),
|
|
1290
|
+
supportChannel: z2.string().optional(),
|
|
1291
|
+
privacyPolicyUrl: z2.string().optional(),
|
|
1292
|
+
termsOfServiceUrl: z2.string().optional(),
|
|
1293
|
+
demoRecordingUrl: z2.string().optional(),
|
|
1294
|
+
serverUrl: z2.string().optional(),
|
|
1295
|
+
screenshots: z2.array(screenshotDraftEntrySchema).optional(),
|
|
1296
|
+
testCases: z2.array(positiveTestCaseDraftSchema).optional(),
|
|
1297
|
+
negativeTestCases: z2.array(negativeTestCaseDraftSchema).optional(),
|
|
1298
|
+
translations: z2.array(chatgptTranslationSchema.extend({ tagline: z2.string() })).optional()
|
|
1299
|
+
});
|
|
1300
|
+
var chatgptPrefillFormDataSchema = chatgptSubmissionFormDataSchema.pick({
|
|
1301
|
+
appName: true,
|
|
1302
|
+
developerName: true,
|
|
1303
|
+
serverUrl: true,
|
|
1304
|
+
tools: true,
|
|
1305
|
+
skills: true,
|
|
1306
|
+
authentication: true
|
|
1307
|
+
});
|
|
1308
|
+
var chatgptAiGeneratedFormDataRawSchema = chatgptSubmissionFormDataSchema.pick({
|
|
1309
|
+
tagline: true,
|
|
1310
|
+
description: true,
|
|
1311
|
+
category: true,
|
|
1312
|
+
testCases: true,
|
|
1313
|
+
negativeTestCases: true,
|
|
1314
|
+
toolJustifications: true
|
|
1315
|
+
}).extend({
|
|
1316
|
+
testCases: unboundedArrayField(chatgptSubmissionFormDataSchema.shape.testCases),
|
|
1317
|
+
negativeTestCases: unboundedArrayField(chatgptSubmissionFormDataSchema.shape.negativeTestCases)
|
|
1318
|
+
});
|
|
1319
|
+
var chatgptAiGeneratedFormDataSchema = chatgptAiGeneratedFormDataRawSchema.extend({
|
|
1320
|
+
tagline: clampStringField(chatgptSubmissionFormDataSchema.shape.tagline),
|
|
1321
|
+
testCases: z2.array(positiveTestCaseDraftSchema).transform((cases) => toFixedLength(cases, 5, blankPositiveTestCase)),
|
|
1322
|
+
negativeTestCases: z2.array(negativeTestCaseDraftSchema).transform((cases) => toFixedLength(cases, 3, blankNegativeTestCase))
|
|
1323
|
+
});
|
|
1324
|
+
var claudeCategorySchema = z2.enum([
|
|
1325
|
+
"Productivity",
|
|
1326
|
+
"Communication",
|
|
1327
|
+
"Data & Analytics",
|
|
1328
|
+
"Development tools",
|
|
1329
|
+
"Financial Services",
|
|
1330
|
+
"Consumer Health",
|
|
1331
|
+
"Health & Life Sciences",
|
|
1332
|
+
"Media & Entertainment",
|
|
1333
|
+
"Commerce & Shopping",
|
|
1334
|
+
"Legal",
|
|
1335
|
+
"Sales and marketing",
|
|
1336
|
+
"Creative",
|
|
1337
|
+
"Nonprofit",
|
|
1338
|
+
"Education",
|
|
1339
|
+
"Other"
|
|
1340
|
+
]);
|
|
1341
|
+
var claudeCategoryDescription = `The categories used to filter connectors in the directory UI. Select up to 5 that best describe your connector.`;
|
|
1342
|
+
var claudeReadWriteCapabilitiesSchema = z2.enum([
|
|
1343
|
+
"read_only",
|
|
1344
|
+
"write_only",
|
|
1345
|
+
"read_write"
|
|
1346
|
+
]);
|
|
1347
|
+
var claudeAuthenticationSchema = z2.enum([
|
|
1348
|
+
"oauth_dcr",
|
|
1349
|
+
"oauth_cimd",
|
|
1350
|
+
"oauth_anthropic_creds",
|
|
1351
|
+
"custom_connection",
|
|
1352
|
+
"none"
|
|
1353
|
+
]);
|
|
1354
|
+
var claudeApiOwnershipSchema = z2.enum([
|
|
1355
|
+
"first_party",
|
|
1356
|
+
"proxied",
|
|
1357
|
+
"third_party"
|
|
1358
|
+
]);
|
|
1359
|
+
var claudeYesNoOtherSchema = z2.union([z2.boolean(), z2.object({ other: z2.string() })]);
|
|
1360
|
+
var claudePolicyAcknowledgementSchema = z2.enum([
|
|
1361
|
+
"I have read and understand the MCP Directory developer guidelines.",
|
|
1362
|
+
"My server calls our own first-party APIs (or APIs we legitimately proxy with permission).",
|
|
1363
|
+
"My connector does not transfer money, cryptocurrency, or other financial assets on a user's behalf.",
|
|
1364
|
+
"My connector does not use AI models to generate images, video, or audio.",
|
|
1365
|
+
"Tool descriptions contain no instructions about model behavior, other tools, or external instruction sources, and no hidden or encoded text.",
|
|
1366
|
+
"My connector does not collect conversation data beyond what is needed for its function.",
|
|
1367
|
+
"Public documentation for this connector will be live by the publish date."
|
|
1368
|
+
]);
|
|
1369
|
+
var claudeSubmissionFormDataSchema = z2.object({
|
|
1370
|
+
serverUrl: z2.url().describe(`The full https:// URL where your MCP server is hosted and reachable. In the claude.ai wizard this is read live
|
|
1371
|
+
from the custom connector you select \u2014 the connection is used to verify the URL and the tool list at submission time.
|
|
1372
|
+
The server must be publicly accessible without VPN or whitelisting.`),
|
|
1373
|
+
name: z2.string().max(100).describe(`The public display name for your connector as it appears in the directory. Use your brand/product name. You must
|
|
1374
|
+
own or have the right to use this name. Max 100 characters.`),
|
|
1375
|
+
slug: z2.string().max(50).regex(/^[a-z0-9-]+$/).describe(`URL-safe identifier for your connector's directory page. Lowercase letters, numbers, and hyphens only.
|
|
1376
|
+
PERMANENT after submission \u2014 it cannot be changed. Pre-filled from the name. Max 50 characters.`),
|
|
1377
|
+
oneLiner: z2.string().max(200).describe(`A short tagline shown below your connector name in the directory listing. Max 200 characters. Avoid generic
|
|
1378
|
+
phrases like 'The best MCP server for...'. Example: 'Manage tasks and projects in Linear'.`),
|
|
1379
|
+
description: z2.string().max(2e3).describe(`A description of what your connector does and its key features, shown on the connector's detail page in
|
|
1380
|
+
claude.ai. Write it from a user perspective and be specific. Max 2000 characters.`),
|
|
1381
|
+
categories: z2.array(claudeCategorySchema).max(5).describe(claudeCategoryDescription),
|
|
1382
|
+
iconUrl: z2.url().optional().describe(`Optional custom icon for the directory listing \u2014 a square SVG. By default the favicon from your MCP URL is used
|
|
1383
|
+
(recommended); upload a custom icon only to override it.`),
|
|
1384
|
+
documentation: z2.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. Must be publicly
|
|
1385
|
+
accessible without login. IT admins often review these when deciding whether to approve a server. Required to be live
|
|
1386
|
+
by your publish date.`),
|
|
1387
|
+
support: supportChannelSchema.describe(`A support URL or email address where users can get help with your connector. Displayed in the directory listing and
|
|
1388
|
+
used to notify you of security or compliance issues, so make sure it's actively monitored.`),
|
|
1389
|
+
privacyPolicy: z2.url().describe(`URL to your privacy policy. Mandatory and displayed in the directory listing. Must be publicly accessible and cover
|
|
1390
|
+
what data you collect, how you use and store it, and whether you share it with third parties.`),
|
|
1391
|
+
screenshots: z2.array(screenshotEntrySchema).optional().describe(`Carousel images shown on your connector's directory page (PNG). Each is paired with the user prompt that produced
|
|
1392
|
+
it. This is editable on the directory page only after the connector is submitted \u2014 optional here so you can prepare it.`),
|
|
1393
|
+
primaryUseCases: z2.string().describe(`Describe the main tasks users will accomplish with this connector, and include a few example prompts a user might
|
|
1394
|
+
type. These may be shown publicly but are primarily used for internal review \u2014 reviewers test your server using them.`),
|
|
1395
|
+
connectionRequirements: z2.string().describe(`What accounts, permissions, or setup a user needs before connecting (e.g. 'Requires a paid Acme account with admin
|
|
1396
|
+
permissions'). If there are genuinely no special requirements, say so explicitly.`),
|
|
1397
|
+
readWriteCapabilities: claudeReadWriteCapabilitiesSchema.describe(`What your server can do:
|
|
1398
|
+
\u2022 'read_only': retrieves data but never modifies it.
|
|
1399
|
+
\u2022 'write_only': creates or modifies data but does not read it.
|
|
1400
|
+
\u2022 'read_write': both retrieves and modifies data (most common).`),
|
|
1401
|
+
companyName: z2.string().describe("The company or organization behind this connector \u2014 its legal name or publicly known product name."),
|
|
1402
|
+
companyWebsite: z2.url().describe("The company's main website URL, e.g. https://example.com."),
|
|
1403
|
+
primaryContactName: z2.string().describe("Full name of the person Anthropic should contact about this submission. Receives review feedback and follow-up questions."),
|
|
1404
|
+
primaryContactEmail: z2.email().describe("Email for the primary contact (pre-filled from the Claude account). Anthropic uses this to communicate about your submission."),
|
|
1405
|
+
primaryContactRole: z2.string().optional().describe("The primary contact's role at the company (e.g. 'Engineer', 'Product Manager'). Optional."),
|
|
1406
|
+
anthropicPointOfContact: z2.string().optional().describe("If you've been working with someone at Anthropic, their name or email. Optional, can expedite review."),
|
|
1407
|
+
authentication: claudeAuthenticationSchema.describe(`How users authenticate with your server:
|
|
1408
|
+
\u2022 'oauth_dcr': OAuth 2.0 + Dynamic Client Registration (RFC 7591) \u2014 clients register themselves.
|
|
1409
|
+
\u2022 'oauth_cimd': OAuth 2.0 + Client ID Metadata Document \u2014 a published client_id metadata document.
|
|
1410
|
+
\u2022 'oauth_anthropic_creds': OAuth 2.0 with Anthropic-held client credentials (a static client_id, and secret if needed).
|
|
1411
|
+
\u2022 'custom_connection': users supply their own URL or client details at connection time (e.g. Snowflake).
|
|
1412
|
+
\u2022 'none': no authentication (authless) \u2014 anyone can connect and call tools without credentials.`),
|
|
1413
|
+
partialAuth: z2.boolean().optional().describe("Whether some tools return 401 and prompt for auth on demand while the server otherwise starts authless (partial auth)."),
|
|
1414
|
+
apiOwnership: claudeApiOwnershipSchema.describe(`How your connector relates to the API it calls:
|
|
1415
|
+
\u2022 'first_party': the MCP server calls your own production APIs.
|
|
1416
|
+
\u2022 'proxied': calls go to a third-party API you're authorized to integrate (e.g. a Zapier-style integration).
|
|
1417
|
+
\u2022 'third_party': calls a third-party API you don't control \u2014 typically blocks listing; explain in 'additionalNotes'.`),
|
|
1418
|
+
personalHealthData: claudeYesNoOtherSchema.describe(`Whether this connector accesses, processes, or stores personal health information.
|
|
1419
|
+
No \u2192 false, Yes \u2192 true, or { other: explanation } when it depends on configuration.`),
|
|
1420
|
+
sponsoredContent: claudeYesNoOtherSchema.describe(`Whether this connector surfaces sponsored, promoted, or advertising content (prohibited in directory connectors).
|
|
1421
|
+
No \u2192 false, Yes \u2192 true, or { other: explanation }.`),
|
|
1422
|
+
testInstructions: z2.string().optional().describe(`Clear test-account setup and access instructions for reviewers: every link, credential, and step needed to access
|
|
1423
|
+
the MCP server autonomously. For accounts that need to be populated, provide test credentials granting access to a
|
|
1424
|
+
fully populated account.`),
|
|
1425
|
+
selfTested: z2.boolean().optional().describe("Confirmation that you have run every tool via MCP Inspector or as a custom connector in Claude."),
|
|
1426
|
+
policyAcknowledgements: z2.array(claudePolicyAcknowledgementSchema).describe(`Anthropic directory policy acknowledgements. All items must be acknowledged before the claude.ai wizard allows
|
|
1427
|
+
submission. Each is an attestation you are legally agreeing to by submitting.`),
|
|
1428
|
+
additionalNotes: z2.string().optional().describe("Anything else the review team should know about your connector. Optional.")
|
|
1429
|
+
});
|
|
1430
|
+
var claudeSubmissionDraftSchema = claudeSubmissionFormDataSchema.partial().extend({
|
|
1431
|
+
serverUrl: z2.string().optional(),
|
|
1432
|
+
name: z2.string().optional(),
|
|
1433
|
+
slug: z2.string().optional(),
|
|
1434
|
+
oneLiner: z2.string().optional(),
|
|
1435
|
+
description: z2.string().optional(),
|
|
1436
|
+
iconUrl: z2.string().optional(),
|
|
1437
|
+
documentation: z2.string().optional(),
|
|
1438
|
+
support: z2.string().optional(),
|
|
1439
|
+
privacyPolicy: z2.string().optional(),
|
|
1440
|
+
companyWebsite: z2.string().optional(),
|
|
1441
|
+
primaryContactEmail: z2.string().optional(),
|
|
1442
|
+
categories: z2.array(claudeCategorySchema).optional(),
|
|
1443
|
+
screenshots: z2.array(screenshotDraftEntrySchema).optional()
|
|
1444
|
+
});
|
|
1445
|
+
var claudePrefillFormDataSchema = claudeSubmissionFormDataSchema.pick({
|
|
1446
|
+
serverUrl: true,
|
|
1447
|
+
name: true,
|
|
1448
|
+
slug: true,
|
|
1449
|
+
companyName: true,
|
|
1450
|
+
primaryContactEmail: true,
|
|
1451
|
+
primaryContactName: true,
|
|
1452
|
+
readWriteCapabilities: true,
|
|
1453
|
+
authentication: true,
|
|
1454
|
+
apiOwnership: true,
|
|
1455
|
+
personalHealthData: true
|
|
1456
|
+
}).extend({
|
|
1457
|
+
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
1458
|
+
testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
|
|
1459
|
+
});
|
|
1460
|
+
var claudeAiGeneratedFormDataRawSchema = z2.object({
|
|
1461
|
+
oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
|
|
1462
|
+
description: claudeSubmissionFormDataSchema.shape.description,
|
|
1463
|
+
categories: z2.array(claudeCategorySchema).describe(claudeCategoryDescription),
|
|
1464
|
+
primaryUseCases: claudeSubmissionFormDataSchema.shape.primaryUseCases
|
|
1465
|
+
});
|
|
1466
|
+
var claudeAiGeneratedFormDataSchema = claudeAiGeneratedFormDataRawSchema.extend({
|
|
1467
|
+
oneLiner: clampStringField(claudeSubmissionFormDataSchema.shape.oneLiner),
|
|
1468
|
+
categories: claudeAiGeneratedFormDataRawSchema.shape.categories.transform((categories) => categories.slice(0, 5))
|
|
1469
|
+
});
|
|
1470
|
+
function provenanceByField(prefillShape, aiGeneratedShape) {
|
|
1471
|
+
const byField = {};
|
|
1472
|
+
for (const field of Object.keys(prefillShape)) byField[field] = "prefilled";
|
|
1473
|
+
for (const field of Object.keys(aiGeneratedShape)) byField[field] = "ai-generated";
|
|
1474
|
+
return byField;
|
|
1475
|
+
}
|
|
1476
|
+
var PROVENANCE_BY_PLATFORM = {
|
|
1477
|
+
claudeai: provenanceByField(claudePrefillFormDataSchema.shape, claudeAiGeneratedFormDataSchema.shape),
|
|
1478
|
+
chatgpt: provenanceByField(chatgptPrefillFormDataSchema.shape, chatgptAiGeneratedFormDataSchema.shape)
|
|
1479
|
+
};
|
|
1480
|
+
var urlVerificationOutcomeSchema = z2.enum([
|
|
1481
|
+
"pass",
|
|
1482
|
+
"fail",
|
|
1483
|
+
"unverified"
|
|
1484
|
+
]);
|
|
1485
|
+
var VERIFIABLE_URL_FIELDS = {
|
|
1486
|
+
chatgpt: ["privacyPolicyUrl", "termsOfServiceUrl"],
|
|
1487
|
+
claudeai: ["privacyPolicy"]
|
|
1488
|
+
};
|
|
1489
|
+
var verifiableUrlFieldSchema = z2.enum([...VERIFIABLE_URL_FIELDS.chatgpt, ...VERIFIABLE_URL_FIELDS.claudeai]);
|
|
1490
|
+
var POLICY_DISCLOSURES = [
|
|
1491
|
+
"dataCategories",
|
|
1492
|
+
"purposesOfUse",
|
|
1493
|
+
"recipients",
|
|
1494
|
+
"retention"
|
|
1495
|
+
];
|
|
1496
|
+
var policyDisclosureSchema = z2.enum(POLICY_DISCLOSURES);
|
|
1497
|
+
var urlVerificationFieldResultSchema = z2.object({
|
|
1498
|
+
field: verifiableUrlFieldSchema,
|
|
1499
|
+
url: z2.string(),
|
|
1500
|
+
outcome: urlVerificationOutcomeSchema,
|
|
1501
|
+
reason: z2.string(),
|
|
1502
|
+
concerns: z2.array(z2.string()).optional(),
|
|
1503
|
+
scrapedWith: z2.enum(["fetch", "firecrawl"]).optional()
|
|
1504
|
+
});
|
|
1505
|
+
var urlVerificationSchema = z2.object({
|
|
1506
|
+
verifiedAt: z2.coerce.date(),
|
|
1507
|
+
results: z2.array(urlVerificationFieldResultSchema)
|
|
1508
|
+
});
|
|
1509
|
+
var PAGE_KINDS = [
|
|
1510
|
+
"expectedDocument",
|
|
1511
|
+
"errorPage",
|
|
1512
|
+
"loginWall",
|
|
1513
|
+
"parkedDomain",
|
|
1514
|
+
"comingSoon",
|
|
1515
|
+
"marketingPage",
|
|
1516
|
+
"unrelatedDocument"
|
|
1517
|
+
];
|
|
1518
|
+
var pageKindSchema = z2.enum(PAGE_KINDS);
|
|
1519
|
+
var urlJudgementSchema = z2.object({
|
|
1520
|
+
pageKind: pageKindSchema.describe("What the page actually is. Use 'expectedDocument' only when it is genuinely the document the field claims."),
|
|
1521
|
+
reason: z2.string().max(200).describe("One sentence naming what the page is, addressed to the developer who entered the URL."),
|
|
1522
|
+
missingDisclosures: z2.array(policyDisclosureSchema).describe("For a privacy policy only: which of the four required disclosures the text does not cover. Empty for every other page kind.")
|
|
1523
|
+
});
|
|
1524
|
+
var submissionMetaFieldsSchema = z2.object({
|
|
1525
|
+
id: z2.string(),
|
|
1526
|
+
environmentId: z2.string(),
|
|
1527
|
+
auditId: z2.string().nullable(),
|
|
1528
|
+
urlVerification: urlVerificationSchema.nullable().default(null),
|
|
1529
|
+
createdAt: z2.coerce.date(),
|
|
1530
|
+
updatedAt: z2.coerce.date()
|
|
1531
|
+
});
|
|
1532
|
+
var claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
1533
|
+
platform: z2.literal("claudeai"),
|
|
1534
|
+
formData: claudeSubmissionDraftSchema,
|
|
1535
|
+
prefillSnapshot: claudeSubmissionDraftSchema.nullable().default(null)
|
|
1536
|
+
});
|
|
1537
|
+
var chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
1538
|
+
platform: z2.literal("chatgpt"),
|
|
1539
|
+
formData: chatgptSubmissionDraftSchema,
|
|
1540
|
+
prefillSnapshot: chatgptSubmissionDraftSchema.nullable().default(null)
|
|
1541
|
+
});
|
|
1542
|
+
var submissionSchemaInternal = z2.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
|
|
1543
|
+
var submissionFormDataSchemaInternal = z2.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
|
|
1544
|
+
var REQUEST_USAGE_THRESHOLD_PERCENTS = [
|
|
1545
|
+
100,
|
|
1546
|
+
75,
|
|
1547
|
+
50
|
|
1548
|
+
];
|
|
1549
|
+
var requestUsageThresholdPercentSchema = z2.literal(REQUEST_USAGE_THRESHOLD_PERCENTS);
|
|
1550
|
+
var subscriptionPlanSchema = z2.enum([
|
|
1551
|
+
"pro",
|
|
1552
|
+
"business",
|
|
1553
|
+
"enterprise"
|
|
1554
|
+
]);
|
|
1555
|
+
var subscriptionSchema = z2.object({ plan: subscriptionPlanSchema.nullable() });
|
|
1556
|
+
var customerCreditsSchema = z2.object({
|
|
1557
|
+
balanceInCents: z2.number(),
|
|
1558
|
+
expiresAt: z2.number().nullable(),
|
|
1559
|
+
currency: z2.string()
|
|
1560
|
+
});
|
|
1561
|
+
var partnerDiscountSchema = z2.object({ endsAt: z2.number() });
|
|
1562
|
+
var customerBillingSchema = z2.object({
|
|
1563
|
+
customerCredits: customerCreditsSchema.nullable(),
|
|
1564
|
+
partnerDiscount: partnerDiscountSchema.nullable()
|
|
1565
|
+
});
|
|
1566
|
+
var metricsQueueEventSchema = z2.object({
|
|
1567
|
+
ts: z2.number().int(),
|
|
1568
|
+
method: z2.string(),
|
|
1569
|
+
tool: z2.string().nullable(),
|
|
1570
|
+
client: z2.string(),
|
|
1571
|
+
sessionId: z2.string().nullable(),
|
|
1572
|
+
conversationId: z2.string().nullable().optional(),
|
|
1573
|
+
durationMs: z2.number().int(),
|
|
1574
|
+
outputTokens: z2.number().int().nullable(),
|
|
1575
|
+
errorType: z2.enum([
|
|
1576
|
+
"mcp_error",
|
|
1577
|
+
"tool_error",
|
|
1578
|
+
"timeout"
|
|
1579
|
+
]).nullable(),
|
|
1580
|
+
errorCode: z2.number().int().nullable()
|
|
1581
|
+
});
|
|
1582
|
+
var metricsQueueMessageSchema = z2.object({
|
|
1583
|
+
v: z2.literal(1),
|
|
1584
|
+
envId: z2.string(),
|
|
1585
|
+
events: z2.array(metricsQueueEventSchema)
|
|
1586
|
+
});
|
|
1587
|
+
var metricsQueueMessageVersionSchema = z2.object({ v: z2.number() });
|
|
1588
|
+
var TELEMETRY_SIGNALS = [
|
|
1589
|
+
"logs",
|
|
1590
|
+
"metrics",
|
|
1591
|
+
"traces"
|
|
1592
|
+
];
|
|
1593
|
+
var telemetrySignalSchema = z2.enum(TELEMETRY_SIGNALS);
|
|
1594
|
+
var OTLP_PROTOCOLS = ["http/protobuf", "http/json"];
|
|
1595
|
+
var otlpProtocolSchema = z2.enum(OTLP_PROTOCOLS);
|
|
1596
|
+
var otlpEndpointSchema = z2.string().trim().min(1).max(2048);
|
|
1597
|
+
var OTLP_HEADER_VALUE_MAX_LENGTH = 2048;
|
|
1598
|
+
var OTLP_HEADER_NAME_PATTERN = /^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/;
|
|
1599
|
+
var otlpHeaderNameSchema = z2.string().trim().min(1, "Enter a header name").max(128).regex(OTLP_HEADER_NAME_PATTERN, "Use letters, digits and !#$%&'*+-.^_`|~ only");
|
|
1600
|
+
var otlpHeaderValueSchema = z2.string().trim().max(OTLP_HEADER_VALUE_MAX_LENGTH).refine((value) => !/[\r\n]/.test(value), "Line breaks are not allowed in a header value");
|
|
1601
|
+
var telemetryDestinationHeaderSchema = z2.object({
|
|
1602
|
+
id: z2.string(),
|
|
1603
|
+
name: otlpHeaderNameSchema,
|
|
1604
|
+
value: otlpHeaderValueSchema,
|
|
1605
|
+
isSecret: z2.boolean()
|
|
1606
|
+
});
|
|
1607
|
+
var OTLP_PUSH_FAILURE_REASONS = [
|
|
1608
|
+
"credentials",
|
|
1609
|
+
"wrong-path",
|
|
1610
|
+
"wrong-protocol",
|
|
1611
|
+
"invalid-payload",
|
|
1612
|
+
"partial-rejection",
|
|
1613
|
+
"blocked-target",
|
|
1614
|
+
"timeout",
|
|
1615
|
+
"unreachable",
|
|
1616
|
+
"receiver-error",
|
|
1617
|
+
"unexpected-status"
|
|
1618
|
+
];
|
|
1619
|
+
var otlpPushFailureReasonSchema = z2.enum(OTLP_PUSH_FAILURE_REASONS);
|
|
1620
|
+
var TELEMETRY_DESTINATION_STATUSES = ["active", "suspended"];
|
|
1621
|
+
var telemetryDestinationStatusSchema = z2.enum(TELEMETRY_DESTINATION_STATUSES);
|
|
1622
|
+
var telemetryDestinationSchema = z2.object({
|
|
1623
|
+
id: z2.string(),
|
|
1624
|
+
signal: telemetrySignalSchema,
|
|
1625
|
+
endpoint: otlpEndpointSchema,
|
|
1626
|
+
protocol: otlpProtocolSchema,
|
|
1627
|
+
headers: z2.array(telemetryDestinationHeaderSchema),
|
|
1628
|
+
status: telemetryDestinationStatusSchema,
|
|
1629
|
+
lastFailureReason: otlpPushFailureReasonSchema.nullable(),
|
|
1630
|
+
isScopedToIntentionalRequestsOnly: z2.boolean()
|
|
1631
|
+
});
|
|
1632
|
+
|
|
1633
|
+
// src/project/detect-runtime.ts
|
|
1634
|
+
function detectRuntime() {
|
|
1635
|
+
const has = (file) => existsSync(file);
|
|
1636
|
+
const read = (file) => {
|
|
1637
|
+
try {
|
|
1638
|
+
return readFileSync(file, "utf8");
|
|
1639
|
+
} catch {
|
|
1640
|
+
return "";
|
|
22
1641
|
}
|
|
23
|
-
|
|
1642
|
+
};
|
|
1643
|
+
if (has("pyproject.toml") || has("requirements.txt") || has("setup.py") || has(".python-version")) {
|
|
1644
|
+
return "python3.13";
|
|
1645
|
+
}
|
|
1646
|
+
if (has("package.json")) {
|
|
1647
|
+
return detectNodeRuntime({
|
|
1648
|
+
nvmrcContent: has(".nvmrc") ? read(".nvmrc") : null,
|
|
1649
|
+
nodeVersionContent: has(".node-version") ? read(".node-version") : null
|
|
1650
|
+
}) ?? "node26";
|
|
1651
|
+
}
|
|
1652
|
+
return null;
|
|
24
1653
|
}
|
|
25
|
-
|
|
1654
|
+
export {
|
|
1655
|
+
detectRuntime
|
|
1656
|
+
};
|
|
1657
|
+
//# sourceMappingURL=detect-runtime.js.map
|