@alpic-ai/api 0.0.0-staging.gf8b2f50 → 0.0.0-staging.gfd6a22f
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.mts +81 -60
- package/dist/index.mjs +929 -205
- package/package.json +6 -15
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,174 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import * as z$1 from "zod/v4";
|
|
2
3
|
import { oc } from "@orpc/contract";
|
|
3
4
|
import ms from "ms";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
6
|
+
/**
|
|
7
|
+
* Reusable URL validation that disallows javascript: scheme
|
|
8
|
+
*/
|
|
9
|
+
const SafeUrlSchema = z$1.url().superRefine((val, ctx) => {
|
|
10
|
+
if (!URL.canParse(val)) {
|
|
11
|
+
ctx.addIssue({
|
|
12
|
+
code: z$1.ZodIssueCode.custom,
|
|
13
|
+
message: "URL must be parseable",
|
|
14
|
+
fatal: true
|
|
15
|
+
});
|
|
16
|
+
return z$1.NEVER;
|
|
17
|
+
}
|
|
18
|
+
}).refine((url) => {
|
|
19
|
+
const u = new URL(url);
|
|
20
|
+
return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
|
|
21
|
+
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
22
|
+
/**
|
|
23
|
+
* RFC 9728 OAuth Protected Resource Metadata
|
|
24
|
+
*/
|
|
25
|
+
const OAuthProtectedResourceMetadataSchema = z$1.looseObject({
|
|
26
|
+
resource: z$1.string().url(),
|
|
27
|
+
authorization_servers: z$1.array(SafeUrlSchema).optional(),
|
|
28
|
+
jwks_uri: z$1.string().url().optional(),
|
|
29
|
+
scopes_supported: z$1.array(z$1.string()).optional(),
|
|
30
|
+
bearer_methods_supported: z$1.array(z$1.string()).optional(),
|
|
31
|
+
resource_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
32
|
+
resource_name: z$1.string().optional(),
|
|
33
|
+
resource_documentation: z$1.string().optional(),
|
|
34
|
+
resource_policy_uri: z$1.string().url().optional(),
|
|
35
|
+
resource_tos_uri: z$1.string().url().optional(),
|
|
36
|
+
tls_client_certificate_bound_access_tokens: z$1.boolean().optional(),
|
|
37
|
+
authorization_details_types_supported: z$1.array(z$1.string()).optional(),
|
|
38
|
+
dpop_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
39
|
+
dpop_bound_access_tokens_required: z$1.boolean().optional()
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* RFC 8414 OAuth 2.0 Authorization Server Metadata
|
|
43
|
+
*/
|
|
44
|
+
const OAuthMetadataSchema = z$1.looseObject({
|
|
45
|
+
issuer: z$1.string(),
|
|
46
|
+
authorization_endpoint: SafeUrlSchema,
|
|
47
|
+
token_endpoint: SafeUrlSchema,
|
|
48
|
+
registration_endpoint: SafeUrlSchema.optional(),
|
|
49
|
+
scopes_supported: z$1.array(z$1.string()).optional(),
|
|
50
|
+
response_types_supported: z$1.array(z$1.string()),
|
|
51
|
+
response_modes_supported: z$1.array(z$1.string()).optional(),
|
|
52
|
+
grant_types_supported: z$1.array(z$1.string()).optional(),
|
|
53
|
+
token_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
54
|
+
token_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
55
|
+
service_documentation: SafeUrlSchema.optional(),
|
|
56
|
+
revocation_endpoint: SafeUrlSchema.optional(),
|
|
57
|
+
revocation_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
58
|
+
revocation_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
59
|
+
introspection_endpoint: z$1.string().optional(),
|
|
60
|
+
introspection_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
61
|
+
introspection_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
62
|
+
code_challenge_methods_supported: z$1.array(z$1.string()).optional(),
|
|
63
|
+
client_id_metadata_document_supported: z$1.boolean().optional()
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* OpenID Connect Discovery 1.0 Provider Metadata
|
|
67
|
+
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
|
|
68
|
+
*/
|
|
69
|
+
const OpenIdProviderMetadataSchema = z$1.looseObject({
|
|
70
|
+
issuer: z$1.string(),
|
|
71
|
+
authorization_endpoint: SafeUrlSchema,
|
|
72
|
+
token_endpoint: SafeUrlSchema,
|
|
73
|
+
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
74
|
+
jwks_uri: SafeUrlSchema,
|
|
75
|
+
registration_endpoint: SafeUrlSchema.optional(),
|
|
76
|
+
scopes_supported: z$1.array(z$1.string()).optional(),
|
|
77
|
+
response_types_supported: z$1.array(z$1.string()),
|
|
78
|
+
response_modes_supported: z$1.array(z$1.string()).optional(),
|
|
79
|
+
grant_types_supported: z$1.array(z$1.string()).optional(),
|
|
80
|
+
acr_values_supported: z$1.array(z$1.string()).optional(),
|
|
81
|
+
subject_types_supported: z$1.array(z$1.string()),
|
|
82
|
+
id_token_signing_alg_values_supported: z$1.array(z$1.string()),
|
|
83
|
+
id_token_encryption_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
84
|
+
id_token_encryption_enc_values_supported: z$1.array(z$1.string()).optional(),
|
|
85
|
+
userinfo_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
86
|
+
userinfo_encryption_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
87
|
+
userinfo_encryption_enc_values_supported: z$1.array(z$1.string()).optional(),
|
|
88
|
+
request_object_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
89
|
+
request_object_encryption_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
90
|
+
request_object_encryption_enc_values_supported: z$1.array(z$1.string()).optional(),
|
|
91
|
+
token_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
92
|
+
token_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
93
|
+
display_values_supported: z$1.array(z$1.string()).optional(),
|
|
94
|
+
claim_types_supported: z$1.array(z$1.string()).optional(),
|
|
95
|
+
claims_supported: z$1.array(z$1.string()).optional(),
|
|
96
|
+
service_documentation: z$1.string().optional(),
|
|
97
|
+
claims_locales_supported: z$1.array(z$1.string()).optional(),
|
|
98
|
+
ui_locales_supported: z$1.array(z$1.string()).optional(),
|
|
99
|
+
claims_parameter_supported: z$1.boolean().optional(),
|
|
100
|
+
request_parameter_supported: z$1.boolean().optional(),
|
|
101
|
+
request_uri_parameter_supported: z$1.boolean().optional(),
|
|
102
|
+
require_request_uri_registration: z$1.boolean().optional(),
|
|
103
|
+
op_policy_uri: SafeUrlSchema.optional(),
|
|
104
|
+
op_tos_uri: SafeUrlSchema.optional(),
|
|
105
|
+
client_id_metadata_document_supported: z$1.boolean().optional()
|
|
106
|
+
});
|
|
107
|
+
/**
|
|
108
|
+
* OpenID Connect Discovery metadata that may include OAuth 2.0 fields
|
|
109
|
+
* This schema represents the real-world scenario where OIDC providers
|
|
110
|
+
* return a mix of OpenID Connect and OAuth 2.0 metadata fields
|
|
111
|
+
*/
|
|
112
|
+
const OpenIdProviderDiscoveryMetadataSchema = z$1.object({
|
|
113
|
+
...OpenIdProviderMetadataSchema.shape,
|
|
114
|
+
...OAuthMetadataSchema.pick({ code_challenge_methods_supported: true }).shape
|
|
115
|
+
});
|
|
116
|
+
z$1.object({
|
|
117
|
+
access_token: z$1.string(),
|
|
118
|
+
id_token: z$1.string().optional(),
|
|
119
|
+
token_type: z$1.string(),
|
|
120
|
+
expires_in: z$1.coerce.number().optional(),
|
|
121
|
+
scope: z$1.string().optional(),
|
|
122
|
+
refresh_token: z$1.string().optional()
|
|
123
|
+
}).strip();
|
|
124
|
+
z$1.object({
|
|
125
|
+
error: z$1.string(),
|
|
126
|
+
error_description: z$1.string().optional(),
|
|
127
|
+
error_uri: z$1.string().optional()
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri
|
|
131
|
+
*/
|
|
132
|
+
const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z$1.literal("").transform(() => void 0));
|
|
133
|
+
/**
|
|
134
|
+
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
|
|
135
|
+
*/
|
|
136
|
+
const OAuthClientMetadataSchema = z$1.object({
|
|
137
|
+
redirect_uris: z$1.array(SafeUrlSchema),
|
|
138
|
+
token_endpoint_auth_method: z$1.string().optional(),
|
|
139
|
+
grant_types: z$1.array(z$1.string()).optional(),
|
|
140
|
+
response_types: z$1.array(z$1.string()).optional(),
|
|
141
|
+
client_name: z$1.string().optional(),
|
|
142
|
+
client_uri: SafeUrlSchema.optional(),
|
|
143
|
+
logo_uri: OptionalSafeUrlSchema,
|
|
144
|
+
scope: z$1.string().optional(),
|
|
145
|
+
contacts: z$1.array(z$1.string()).optional(),
|
|
146
|
+
tos_uri: OptionalSafeUrlSchema,
|
|
147
|
+
policy_uri: z$1.string().optional(),
|
|
148
|
+
jwks_uri: SafeUrlSchema.optional(),
|
|
149
|
+
jwks: z$1.any().optional(),
|
|
150
|
+
software_id: z$1.string().optional(),
|
|
151
|
+
software_version: z$1.string().optional(),
|
|
152
|
+
software_statement: z$1.string().optional()
|
|
153
|
+
}).strip();
|
|
154
|
+
/**
|
|
155
|
+
* RFC 7591 OAuth 2.0 Dynamic Client Registration client information
|
|
156
|
+
*/
|
|
157
|
+
const OAuthClientInformationSchema = z$1.object({
|
|
158
|
+
client_id: z$1.string(),
|
|
159
|
+
client_secret: z$1.string().optional(),
|
|
160
|
+
client_id_issued_at: z$1.number().optional(),
|
|
161
|
+
client_secret_expires_at: z$1.number().optional()
|
|
162
|
+
}).strip();
|
|
163
|
+
OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
164
|
+
z$1.object({
|
|
165
|
+
error: z$1.string(),
|
|
166
|
+
error_description: z$1.string().optional()
|
|
167
|
+
}).strip();
|
|
168
|
+
z$1.object({
|
|
169
|
+
token: z$1.string(),
|
|
170
|
+
token_type_hint: z$1.string().optional()
|
|
171
|
+
}).strip();
|
|
4
172
|
const platformSchema = z.enum(["chatgpt", "claudeai"]);
|
|
5
173
|
const PLATFORM_LABELS = {
|
|
6
174
|
chatgpt: "ChatGPT",
|
|
@@ -71,7 +239,14 @@ const auditReportWithScreenshotsSchema = auditReportSchema.extend({ widgetScreen
|
|
|
71
239
|
chatgpt: widgetScreenshotSchema.optional(),
|
|
72
240
|
claudeai: widgetScreenshotSchema.optional()
|
|
73
241
|
}) });
|
|
74
|
-
z.
|
|
242
|
+
z.object({
|
|
243
|
+
id: z.string(),
|
|
244
|
+
environmentId: z.string(),
|
|
245
|
+
clientId: z.string(),
|
|
246
|
+
clientSecret: z.string(),
|
|
247
|
+
clientScopes: z.array(z.string())
|
|
248
|
+
});
|
|
249
|
+
const deploymentStatusSchema$1 = z.enum([
|
|
75
250
|
"ongoing",
|
|
76
251
|
"deployed",
|
|
77
252
|
"failed",
|
|
@@ -81,6 +256,125 @@ z.object({
|
|
|
81
256
|
timestamp: z.coerce.date().optional(),
|
|
82
257
|
content: z.string().optional()
|
|
83
258
|
});
|
|
259
|
+
const deploymentSummarySchema = z.object({
|
|
260
|
+
id: z.string(),
|
|
261
|
+
status: deploymentStatusSchema$1,
|
|
262
|
+
sourceBucket: z.string().nullable(),
|
|
263
|
+
sourceObjectKey: z.string().nullable(),
|
|
264
|
+
sourceRef: z.string().nullable(),
|
|
265
|
+
sourceCommitId: z.string().nullable(),
|
|
266
|
+
sourceCommitMessage: z.string().nullable(),
|
|
267
|
+
environmentId: z.string(),
|
|
268
|
+
authorUsername: z.string().nullable(),
|
|
269
|
+
authorAvatarUrl: z.string().nullable(),
|
|
270
|
+
startedAt: z.coerce.date().nullable(),
|
|
271
|
+
completedAt: z.coerce.date().nullable(),
|
|
272
|
+
isCurrent: z.boolean().optional(),
|
|
273
|
+
createdAt: z.coerce.date(),
|
|
274
|
+
updatedAt: z.coerce.date()
|
|
275
|
+
});
|
|
276
|
+
/**
|
|
277
|
+
* Public environment
|
|
278
|
+
*
|
|
279
|
+
* No OAuth metadata exposed.
|
|
280
|
+
*/
|
|
281
|
+
const publicEnvironmentSchema = z.object({
|
|
282
|
+
isPublic: z.literal(true),
|
|
283
|
+
oAuthMetadata: z.undefined().optional()
|
|
284
|
+
});
|
|
285
|
+
/**
|
|
286
|
+
* Protected environment with an external resource metadata URL
|
|
287
|
+
*
|
|
288
|
+
* An external resource metadata URL is returned in the WWW-Authenticate header during the first 401 response.
|
|
289
|
+
* Everything that follows is handled outside of the MCP server scope.
|
|
290
|
+
*/
|
|
291
|
+
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
292
|
+
isPublic: z.literal(false),
|
|
293
|
+
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
294
|
+
scope: z.string().optional()
|
|
295
|
+
});
|
|
296
|
+
/**
|
|
297
|
+
* Protected environment with an external authorization server URL
|
|
298
|
+
*
|
|
299
|
+
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
300
|
+
* An external authorization server URL is returned when requesting the endpoint.
|
|
301
|
+
* Everything that follows is handled outside of the MCP server scope.
|
|
302
|
+
*/
|
|
303
|
+
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
304
|
+
isPublic: z.literal(false),
|
|
305
|
+
oAuthMetadata: z.object({
|
|
306
|
+
externalAuthorizationServerUrl: z.url(),
|
|
307
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
308
|
+
}),
|
|
309
|
+
scope: z.string().optional()
|
|
310
|
+
});
|
|
311
|
+
/**
|
|
312
|
+
* Standalone protected environment
|
|
313
|
+
*
|
|
314
|
+
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
315
|
+
* The server itself exposes the /.well-known/oauth-authorization-server endpoint.
|
|
316
|
+
*/
|
|
317
|
+
const standaloneEnvironmentSchema = z.object({
|
|
318
|
+
isPublic: z.literal(false),
|
|
319
|
+
oAuthMetadata: z.object({
|
|
320
|
+
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
321
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
322
|
+
}),
|
|
323
|
+
scope: z.string().optional()
|
|
324
|
+
});
|
|
325
|
+
/**
|
|
326
|
+
* Protected environment without OAuth discovery
|
|
327
|
+
*
|
|
328
|
+
* The server enforces authentication but exposes no OAuth discovery metadata.
|
|
329
|
+
* Neither /.well-known/oauth-protected-resource nor /.well-known/oauth-authorization-server
|
|
330
|
+
* are advertised. Clients must obtain credentials out-of-band.
|
|
331
|
+
*/
|
|
332
|
+
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
333
|
+
isPublic: z.literal(false),
|
|
334
|
+
oAuthMetadata: z.strictObject({}),
|
|
335
|
+
scope: z.string().optional()
|
|
336
|
+
});
|
|
337
|
+
z.union([
|
|
338
|
+
publicEnvironmentSchema,
|
|
339
|
+
externalResourceMetadataEnvironmentSchema,
|
|
340
|
+
externalAuthorizationServerEnvironmentSchema,
|
|
341
|
+
standaloneEnvironmentSchema,
|
|
342
|
+
protectedWithoutDiscoveryEnvironmentSchema
|
|
343
|
+
]);
|
|
344
|
+
const allowedPlatformSchema = platformSchema;
|
|
345
|
+
const environmentDomainSchema = z.object({
|
|
346
|
+
domain: z.string(),
|
|
347
|
+
status: z.enum([
|
|
348
|
+
"ongoing",
|
|
349
|
+
"deployed",
|
|
350
|
+
"failed"
|
|
351
|
+
]),
|
|
352
|
+
createdAt: z.coerce.date(),
|
|
353
|
+
updatedAt: z.coerce.date()
|
|
354
|
+
});
|
|
355
|
+
const environmentSchema$1 = z.object({
|
|
356
|
+
id: z.string(),
|
|
357
|
+
name: z.string(),
|
|
358
|
+
sourceBranch: z.string().nullable(),
|
|
359
|
+
mcpServerUrl: z.string(),
|
|
360
|
+
activeDeployment: deploymentSummarySchema.optional(),
|
|
361
|
+
latestDeployment: deploymentSummarySchema.optional(),
|
|
362
|
+
openaiAppsChallenge: z.string().nullable().optional(),
|
|
363
|
+
isPlaygroundEnabled: z.boolean(),
|
|
364
|
+
isIpWhitelistEnabled: z.boolean(),
|
|
365
|
+
ipAllowlist: z.array(z.string()).nullable(),
|
|
366
|
+
allowedPlatforms: z.array(allowedPlatformSchema),
|
|
367
|
+
projectId: z.string(),
|
|
368
|
+
createdAt: z.coerce.date(),
|
|
369
|
+
updatedAt: z.coerce.date()
|
|
370
|
+
});
|
|
371
|
+
const environmentWithDomainsSchema = environmentSchema$1.extend({ domains: z.array(environmentDomainSchema) });
|
|
372
|
+
z.object({
|
|
373
|
+
sessionReplayEnabled: z.boolean(),
|
|
374
|
+
collectRequestPayload: z.boolean(),
|
|
375
|
+
collectResponsePayload: z.boolean(),
|
|
376
|
+
collectErrorMessage: z.boolean()
|
|
377
|
+
});
|
|
84
378
|
z.object({
|
|
85
379
|
id: z.string(),
|
|
86
380
|
createdAt: z.coerce.date(),
|
|
@@ -92,6 +386,86 @@ z.object({
|
|
|
92
386
|
content: z.string(),
|
|
93
387
|
source: z.enum(["model", "user"])
|
|
94
388
|
});
|
|
389
|
+
const intentCategoryColorSchema = z.enum([
|
|
390
|
+
"red",
|
|
391
|
+
"orange",
|
|
392
|
+
"yellow",
|
|
393
|
+
"green",
|
|
394
|
+
"blue",
|
|
395
|
+
"purple",
|
|
396
|
+
"pink",
|
|
397
|
+
"gray"
|
|
398
|
+
]);
|
|
399
|
+
intentCategoryColorSchema.options;
|
|
400
|
+
const intentCategorySchema = z.object({
|
|
401
|
+
id: z.string(),
|
|
402
|
+
createdAt: z.coerce.date(),
|
|
403
|
+
environmentId: z.string(),
|
|
404
|
+
name: z.string(),
|
|
405
|
+
color: intentCategoryColorSchema
|
|
406
|
+
});
|
|
407
|
+
z.object({
|
|
408
|
+
id: z.string(),
|
|
409
|
+
name: z.string(),
|
|
410
|
+
color: intentCategoryColorSchema,
|
|
411
|
+
intentCount: z.number().int().nonnegative()
|
|
412
|
+
});
|
|
413
|
+
z.object({
|
|
414
|
+
id: z.string(),
|
|
415
|
+
createdAt: z.coerce.date(),
|
|
416
|
+
environmentId: z.string(),
|
|
417
|
+
toolName: z.string(),
|
|
418
|
+
message: z.string(),
|
|
419
|
+
categories: z.array(intentCategorySchema)
|
|
420
|
+
});
|
|
421
|
+
const signalCategorySchema = z.object({
|
|
422
|
+
id: z.string(),
|
|
423
|
+
name: z.string(),
|
|
424
|
+
color: intentCategoryColorSchema
|
|
425
|
+
});
|
|
426
|
+
z.discriminatedUnion("kind", [
|
|
427
|
+
z.object({
|
|
428
|
+
kind: z.literal("new"),
|
|
429
|
+
category: signalCategorySchema,
|
|
430
|
+
currentCount: z.number().int().nonnegative(),
|
|
431
|
+
currentShare: z.number()
|
|
432
|
+
}),
|
|
433
|
+
z.object({
|
|
434
|
+
kind: z.literal("resurging"),
|
|
435
|
+
category: signalCategorySchema,
|
|
436
|
+
currentCount: z.number().int().nonnegative(),
|
|
437
|
+
daysQuiet: z.number(),
|
|
438
|
+
currentShare: z.number()
|
|
439
|
+
}),
|
|
440
|
+
z.object({
|
|
441
|
+
kind: z.literal("spike"),
|
|
442
|
+
category: signalCategorySchema,
|
|
443
|
+
currentCount: z.number().int().nonnegative(),
|
|
444
|
+
previousCount: z.number().int().nonnegative(),
|
|
445
|
+
currentShare: z.number(),
|
|
446
|
+
previousShare: z.number(),
|
|
447
|
+
changeRatio: z.number()
|
|
448
|
+
}),
|
|
449
|
+
z.object({
|
|
450
|
+
kind: z.literal("declining"),
|
|
451
|
+
category: signalCategorySchema,
|
|
452
|
+
currentCount: z.number().int().nonnegative(),
|
|
453
|
+
previousCount: z.number().int().nonnegative(),
|
|
454
|
+
currentShare: z.number(),
|
|
455
|
+
previousShare: z.number(),
|
|
456
|
+
changeRatio: z.number()
|
|
457
|
+
})
|
|
458
|
+
]);
|
|
459
|
+
z.discriminatedUnion("kind", [z.object({
|
|
460
|
+
kind: z.literal("existing"),
|
|
461
|
+
categoryId: z.string(),
|
|
462
|
+
categoryName: z.string(),
|
|
463
|
+
intentIds: z.array(z.string())
|
|
464
|
+
}), z.object({
|
|
465
|
+
kind: z.literal("new"),
|
|
466
|
+
categoryName: z.string(),
|
|
467
|
+
intentIds: z.array(z.string())
|
|
468
|
+
})]);
|
|
95
469
|
z.object({
|
|
96
470
|
id: z.string(),
|
|
97
471
|
teamId: z.string(),
|
|
@@ -117,6 +491,76 @@ const transportSchema = z.enum([
|
|
|
117
491
|
"sse",
|
|
118
492
|
"streamablehttp"
|
|
119
493
|
]);
|
|
494
|
+
z.object({
|
|
495
|
+
id: z.string(),
|
|
496
|
+
name: z.string(),
|
|
497
|
+
teamId: z.string(),
|
|
498
|
+
sourceRepository: z.string().nullable(),
|
|
499
|
+
createdAt: z.coerce.date().optional(),
|
|
500
|
+
runtime: runtimeSchema,
|
|
501
|
+
transport: transportSchema.nullable(),
|
|
502
|
+
rootDirectory: z.string().nullable(),
|
|
503
|
+
installCommand: z.string().nullable(),
|
|
504
|
+
buildCommand: z.string().nullable(),
|
|
505
|
+
buildOutputDir: z.string().nullable(),
|
|
506
|
+
startCommand: z.string().nullable(),
|
|
507
|
+
fixedOutboundIp: z.boolean(),
|
|
508
|
+
environments: z.array(environmentWithDomainsSchema),
|
|
509
|
+
productionEnvironment: environmentWithDomainsSchema.nullable()
|
|
510
|
+
});
|
|
511
|
+
z.object({
|
|
512
|
+
domain: z.string(),
|
|
513
|
+
createdAt: z.coerce.date(),
|
|
514
|
+
status: z.enum([
|
|
515
|
+
"ongoing",
|
|
516
|
+
"deployed",
|
|
517
|
+
"failed"
|
|
518
|
+
]),
|
|
519
|
+
environment: environmentSchema$1
|
|
520
|
+
});
|
|
521
|
+
const serverFieldsSchema$1 = z.object({
|
|
522
|
+
$schema: z.string(),
|
|
523
|
+
name: z.string(),
|
|
524
|
+
description: z.string(),
|
|
525
|
+
version: z.string().optional(),
|
|
526
|
+
title: z.string().optional(),
|
|
527
|
+
websiteUrl: z.string().optional(),
|
|
528
|
+
icons: z.array(z.object({
|
|
529
|
+
src: z.string(),
|
|
530
|
+
mimeType: z.string().optional(),
|
|
531
|
+
sizes: z.array(z.string()).optional()
|
|
532
|
+
})).optional(),
|
|
533
|
+
remotes: z.array(z.object({
|
|
534
|
+
type: z.string(),
|
|
535
|
+
url: z.string().optional(),
|
|
536
|
+
headers: z.array(z.object({
|
|
537
|
+
name: z.string(),
|
|
538
|
+
description: z.string(),
|
|
539
|
+
isRequired: z.boolean().optional(),
|
|
540
|
+
isSecret: z.boolean().optional()
|
|
541
|
+
})).optional()
|
|
542
|
+
})).optional()
|
|
543
|
+
}).catchall(z.unknown());
|
|
544
|
+
z.object({
|
|
545
|
+
serverFields: serverFieldsSchema$1,
|
|
546
|
+
source: z.enum(["registry", "defaults"])
|
|
547
|
+
});
|
|
548
|
+
/**
|
|
549
|
+
* Returns a variant of a `maxLength`-constrained string that clamps (truncates) instead of
|
|
550
|
+
* rejecting on overflow — used for AI-generated copy where the model routinely overshoots.
|
|
551
|
+
*
|
|
552
|
+
* NOTE: this rebuilds the schema from scratch, carrying over only `maxLength` (as a clamp),
|
|
553
|
+
* `minLength`, and the description. Any other validators on the source field (`.regex()`,
|
|
554
|
+
* `.email()`, custom refinements) are intentionally dropped — this helper is meant for plain
|
|
555
|
+
* free-text length caps only. A field with `null` `maxLength` is returned unchanged.
|
|
556
|
+
*/
|
|
557
|
+
const clampStringField = (field) => {
|
|
558
|
+
const max = field.maxLength;
|
|
559
|
+
if (max === null) return field;
|
|
560
|
+
const clamped = z.string().overwrite((value) => value.slice(0, max)).max(max);
|
|
561
|
+
const withMin = field.minLength === null ? clamped : clamped.min(field.minLength);
|
|
562
|
+
return field.description ? withMin.describe(field.description) : withMin;
|
|
563
|
+
};
|
|
120
564
|
const toolDefinitionSchema = z.object({
|
|
121
565
|
name: z.string(),
|
|
122
566
|
title: z.string().optional().describe("Human-friendly name for the tool, used in the UI. If not provided, `name` will be used."),
|
|
@@ -129,13 +573,19 @@ const toolDefinitionSchema = z.object({
|
|
|
129
573
|
}).optional()
|
|
130
574
|
});
|
|
131
575
|
const positiveTestCaseSchema = z.object({
|
|
132
|
-
scenario: z.string(),
|
|
133
|
-
userPrompt: z.string(),
|
|
134
|
-
toolTriggered: z.string().optional(),
|
|
135
|
-
expectedOutput: z.string().optional()
|
|
576
|
+
scenario: z.string().describe("Short label for what this case demonstrates."),
|
|
577
|
+
userPrompt: z.string().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."),
|
|
578
|
+
toolTriggered: z.string().optional().describe("The tool this prompt should invoke."),
|
|
579
|
+
expectedOutput: z.string().optional().describe("What the user should see, including post-interaction behaviour where relevant.")
|
|
136
580
|
}).partial().describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
|
|
581
|
+
const screenshotEntrySchema = z.object({
|
|
582
|
+
prompt: z.string(),
|
|
583
|
+
url: z.url().or(z.literal(""))
|
|
584
|
+
}).describe("Each screenshot: the user prompt that produced it + the image URL.");
|
|
137
585
|
/** Accepts either a valid email or URL. */
|
|
138
586
|
const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
|
|
587
|
+
/** A URL field whose error spells out that the scheme is required. */
|
|
588
|
+
const urlField = z.url({ error: "Enter a full URL including https:// (e.g. https://example.com)" });
|
|
139
589
|
const chatgptCategorySchema = z.enum([
|
|
140
590
|
"BUSINESS",
|
|
141
591
|
"COLLABORATION",
|
|
@@ -152,49 +602,342 @@ const chatgptCategorySchema = z.enum([
|
|
|
152
602
|
"TRAVEL"
|
|
153
603
|
]);
|
|
154
604
|
const chatgptAuthenticationSchema = z.enum(["No auth needed", "OAuth 2.0"]);
|
|
155
|
-
const
|
|
605
|
+
const chatgptCountryCodeSchema = z.enum([
|
|
606
|
+
"AD",
|
|
607
|
+
"AE",
|
|
608
|
+
"AF",
|
|
609
|
+
"AG",
|
|
610
|
+
"AL",
|
|
611
|
+
"AM",
|
|
612
|
+
"AO",
|
|
613
|
+
"AR",
|
|
614
|
+
"AT",
|
|
615
|
+
"AU",
|
|
616
|
+
"AW",
|
|
617
|
+
"AX",
|
|
618
|
+
"AZ",
|
|
619
|
+
"BA",
|
|
620
|
+
"BB",
|
|
621
|
+
"BD",
|
|
622
|
+
"BE",
|
|
623
|
+
"BF",
|
|
624
|
+
"BG",
|
|
625
|
+
"BH",
|
|
626
|
+
"BI",
|
|
627
|
+
"BJ",
|
|
628
|
+
"BL",
|
|
629
|
+
"BM",
|
|
630
|
+
"BN",
|
|
631
|
+
"BO",
|
|
632
|
+
"BR",
|
|
633
|
+
"BS",
|
|
634
|
+
"BT",
|
|
635
|
+
"BW",
|
|
636
|
+
"BZ",
|
|
637
|
+
"CA",
|
|
638
|
+
"CD",
|
|
639
|
+
"CF",
|
|
640
|
+
"CG",
|
|
641
|
+
"CH",
|
|
642
|
+
"CI",
|
|
643
|
+
"CL",
|
|
644
|
+
"CM",
|
|
645
|
+
"CO",
|
|
646
|
+
"CR",
|
|
647
|
+
"CV",
|
|
648
|
+
"CY",
|
|
649
|
+
"CZ",
|
|
650
|
+
"DE",
|
|
651
|
+
"DJ",
|
|
652
|
+
"DK",
|
|
653
|
+
"DM",
|
|
654
|
+
"DO",
|
|
655
|
+
"DZ",
|
|
656
|
+
"EC",
|
|
657
|
+
"EE",
|
|
658
|
+
"EG",
|
|
659
|
+
"ER",
|
|
660
|
+
"ES",
|
|
661
|
+
"ET",
|
|
662
|
+
"FI",
|
|
663
|
+
"FJ",
|
|
664
|
+
"FM",
|
|
665
|
+
"FO",
|
|
666
|
+
"FR",
|
|
667
|
+
"GA",
|
|
668
|
+
"GB",
|
|
669
|
+
"GD",
|
|
670
|
+
"GE",
|
|
671
|
+
"GF",
|
|
672
|
+
"GH",
|
|
673
|
+
"GL",
|
|
674
|
+
"GM",
|
|
675
|
+
"GN",
|
|
676
|
+
"GP",
|
|
677
|
+
"GQ",
|
|
678
|
+
"GR",
|
|
679
|
+
"GT",
|
|
680
|
+
"GW",
|
|
681
|
+
"GY",
|
|
682
|
+
"HN",
|
|
683
|
+
"HR",
|
|
684
|
+
"HT",
|
|
685
|
+
"HU",
|
|
686
|
+
"ID",
|
|
687
|
+
"IE",
|
|
688
|
+
"IL",
|
|
689
|
+
"IN",
|
|
690
|
+
"IQ",
|
|
691
|
+
"IS",
|
|
692
|
+
"IT",
|
|
693
|
+
"JM",
|
|
694
|
+
"JO",
|
|
695
|
+
"JP",
|
|
696
|
+
"KE",
|
|
697
|
+
"KG",
|
|
698
|
+
"KH",
|
|
699
|
+
"KI",
|
|
700
|
+
"KM",
|
|
701
|
+
"KN",
|
|
702
|
+
"KR",
|
|
703
|
+
"KW",
|
|
704
|
+
"KY",
|
|
705
|
+
"KZ",
|
|
706
|
+
"LA",
|
|
707
|
+
"LB",
|
|
708
|
+
"LC",
|
|
709
|
+
"LI",
|
|
710
|
+
"LK",
|
|
711
|
+
"LR",
|
|
712
|
+
"LS",
|
|
713
|
+
"LT",
|
|
714
|
+
"LU",
|
|
715
|
+
"LV",
|
|
716
|
+
"LY",
|
|
717
|
+
"MA",
|
|
718
|
+
"MC",
|
|
719
|
+
"MD",
|
|
720
|
+
"ME",
|
|
721
|
+
"MF",
|
|
722
|
+
"MG",
|
|
723
|
+
"MH",
|
|
724
|
+
"MK",
|
|
725
|
+
"ML",
|
|
726
|
+
"MM",
|
|
727
|
+
"MN",
|
|
728
|
+
"MQ",
|
|
729
|
+
"MR",
|
|
730
|
+
"MT",
|
|
731
|
+
"MU",
|
|
732
|
+
"MV",
|
|
733
|
+
"MW",
|
|
734
|
+
"MX",
|
|
735
|
+
"MY",
|
|
736
|
+
"MZ",
|
|
737
|
+
"NA",
|
|
738
|
+
"NC",
|
|
739
|
+
"NE",
|
|
740
|
+
"NG",
|
|
741
|
+
"NI",
|
|
742
|
+
"NL",
|
|
743
|
+
"NO",
|
|
744
|
+
"NP",
|
|
745
|
+
"NR",
|
|
746
|
+
"NZ",
|
|
747
|
+
"OM",
|
|
748
|
+
"PA",
|
|
749
|
+
"PE",
|
|
750
|
+
"PF",
|
|
751
|
+
"PG",
|
|
752
|
+
"PH",
|
|
753
|
+
"PK",
|
|
754
|
+
"PL",
|
|
755
|
+
"PM",
|
|
756
|
+
"PS",
|
|
757
|
+
"PT",
|
|
758
|
+
"PW",
|
|
759
|
+
"PY",
|
|
760
|
+
"QA",
|
|
761
|
+
"RE",
|
|
762
|
+
"RO",
|
|
763
|
+
"RS",
|
|
764
|
+
"RW",
|
|
765
|
+
"SA",
|
|
766
|
+
"SB",
|
|
767
|
+
"SC",
|
|
768
|
+
"SD",
|
|
769
|
+
"SE",
|
|
770
|
+
"SG",
|
|
771
|
+
"SH",
|
|
772
|
+
"SI",
|
|
773
|
+
"SJ",
|
|
774
|
+
"SK",
|
|
775
|
+
"SL",
|
|
776
|
+
"SM",
|
|
777
|
+
"SN",
|
|
778
|
+
"SO",
|
|
779
|
+
"SR",
|
|
780
|
+
"SS",
|
|
781
|
+
"ST",
|
|
782
|
+
"SV",
|
|
783
|
+
"SZ",
|
|
784
|
+
"TD",
|
|
785
|
+
"TF",
|
|
786
|
+
"TG",
|
|
787
|
+
"TH",
|
|
788
|
+
"TJ",
|
|
789
|
+
"TL",
|
|
790
|
+
"TM",
|
|
791
|
+
"TN",
|
|
792
|
+
"TO",
|
|
793
|
+
"TR",
|
|
794
|
+
"TT",
|
|
795
|
+
"TV",
|
|
796
|
+
"TW",
|
|
797
|
+
"TZ",
|
|
798
|
+
"UA",
|
|
799
|
+
"UG",
|
|
800
|
+
"US",
|
|
801
|
+
"UY",
|
|
802
|
+
"UZ",
|
|
803
|
+
"VA",
|
|
804
|
+
"VC",
|
|
805
|
+
"VN",
|
|
806
|
+
"VU",
|
|
807
|
+
"WF",
|
|
808
|
+
"WS",
|
|
809
|
+
"YE",
|
|
810
|
+
"YT",
|
|
811
|
+
"ZA",
|
|
812
|
+
"ZM",
|
|
813
|
+
"ZW"
|
|
814
|
+
]);
|
|
815
|
+
const chatgptAllowedCountriesSchema = z.discriminatedUnion("mode", [
|
|
816
|
+
z.object({ mode: z.literal("all") }),
|
|
817
|
+
z.object({
|
|
818
|
+
mode: z.literal("allow"),
|
|
819
|
+
countries: z.array(chatgptCountryCodeSchema)
|
|
820
|
+
}),
|
|
821
|
+
z.object({
|
|
822
|
+
mode: z.literal("block"),
|
|
823
|
+
countries: z.array(chatgptCountryCodeSchema)
|
|
824
|
+
})
|
|
825
|
+
]);
|
|
826
|
+
const chatgptTranslationLocaleSchema = z.enum([
|
|
827
|
+
"am",
|
|
828
|
+
"ar",
|
|
829
|
+
"bg-BG",
|
|
830
|
+
"bn-BD",
|
|
831
|
+
"bs-BA",
|
|
832
|
+
"ca-ES",
|
|
833
|
+
"cs-CZ",
|
|
834
|
+
"da-DK",
|
|
835
|
+
"de-DE",
|
|
836
|
+
"el-GR",
|
|
837
|
+
"es-419",
|
|
838
|
+
"es-ES",
|
|
839
|
+
"et-EE",
|
|
840
|
+
"fi-FI",
|
|
841
|
+
"fr-CA",
|
|
842
|
+
"fr-FR",
|
|
843
|
+
"gu-IN",
|
|
844
|
+
"hi-IN",
|
|
845
|
+
"hr-HR",
|
|
846
|
+
"hu-HU",
|
|
847
|
+
"hy-AM",
|
|
848
|
+
"id-ID",
|
|
849
|
+
"is-IS",
|
|
850
|
+
"it-IT",
|
|
851
|
+
"ja-JP",
|
|
852
|
+
"ka-GE",
|
|
853
|
+
"kk",
|
|
854
|
+
"kn-IN",
|
|
855
|
+
"ko-KR",
|
|
856
|
+
"lt",
|
|
857
|
+
"lv-LV",
|
|
858
|
+
"mk-MK",
|
|
859
|
+
"ml",
|
|
860
|
+
"mn",
|
|
861
|
+
"mr-IN",
|
|
862
|
+
"ms-MY",
|
|
863
|
+
"my-MM",
|
|
864
|
+
"nb-NO",
|
|
865
|
+
"nl-NL",
|
|
866
|
+
"pa",
|
|
867
|
+
"pl-PL",
|
|
868
|
+
"pt-BR",
|
|
869
|
+
"pt-PT",
|
|
870
|
+
"ro-RO",
|
|
871
|
+
"ru-RU",
|
|
872
|
+
"sk-SK",
|
|
873
|
+
"sl-SI",
|
|
874
|
+
"so-SO",
|
|
875
|
+
"sq-AL",
|
|
876
|
+
"sr-RS",
|
|
877
|
+
"sv-SE",
|
|
878
|
+
"sw-TZ",
|
|
879
|
+
"ta-IN",
|
|
880
|
+
"te-IN",
|
|
881
|
+
"th-TH",
|
|
882
|
+
"tl",
|
|
883
|
+
"tr-TR",
|
|
884
|
+
"uk-UA",
|
|
885
|
+
"ur",
|
|
886
|
+
"vi-VN",
|
|
887
|
+
"zh-CN",
|
|
888
|
+
"zh-HK",
|
|
889
|
+
"zh-TW"
|
|
890
|
+
]);
|
|
156
891
|
const negativeTestCaseSchema = z.object({
|
|
157
892
|
scenario: z.string(),
|
|
158
893
|
userPrompt: z.string()
|
|
159
894
|
}).partial().describe("Each case: Scenario + User prompt (the app should NOT trigger).");
|
|
160
895
|
const chatgptToolJustificationSchema = z.object({
|
|
161
896
|
toolName: z.string(),
|
|
162
|
-
readOnlyJustification: z.string(),
|
|
163
|
-
openWorldJustification: z.string(),
|
|
164
|
-
destructiveJustification: z.string()
|
|
165
|
-
}).describe("Per-tool justification of each MCP annotation value (one sentence per hint).");
|
|
897
|
+
readOnlyJustification: z.string().describe("One sentence on what the tool reads and returns."),
|
|
898
|
+
openWorldJustification: z.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
899
|
+
destructiveJustification: z.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.\"")
|
|
900
|
+
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
901
|
+
/**
|
|
902
|
+
* Base copy fields, defined once and reused by both the submission form and per-locale
|
|
903
|
+
* translations so the constraints (tagline ≤ 30 chars) never drift. The translation generation
|
|
904
|
+
* path wraps these in {@link clampStringField} since the LLM tends to overshoot the limit.
|
|
905
|
+
*/
|
|
906
|
+
const chatgptTaglineSchema = z.string().max(30);
|
|
907
|
+
const chatgptDescriptionSchema = z.string();
|
|
166
908
|
const chatgptTranslationSchema = z.object({
|
|
167
|
-
locale:
|
|
168
|
-
tagline:
|
|
169
|
-
description:
|
|
909
|
+
locale: chatgptTranslationLocaleSchema,
|
|
910
|
+
tagline: chatgptTaglineSchema,
|
|
911
|
+
description: chatgptDescriptionSchema
|
|
170
912
|
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
913
|
+
chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
171
914
|
/**
|
|
172
915
|
* Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
|
|
173
916
|
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
174
917
|
*/
|
|
175
918
|
const chatgptSubmissionFormDataSchema = z.object({
|
|
176
919
|
logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
|
|
177
|
-
logoDark: z.string().describe("
|
|
920
|
+
logoDark: z.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."),
|
|
178
921
|
appName: z.string().describe("The name users will see in ChatGPT and in the Apps Directory."),
|
|
179
|
-
tagline:
|
|
180
|
-
description:
|
|
922
|
+
tagline: chatgptTaglineSchema.describe("Plain-language phrase focused on function and user value, 30 chars max. Avoid generic superlatives like \"the best …\"."),
|
|
923
|
+
description: chatgptDescriptionSchema.describe("Clear, engaging description highlighting what the app does and why people will love it. Appears publicly on the directory page. End it by naming the product categories or intents the app 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)."),
|
|
181
924
|
category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
|
|
182
925
|
developerName: z.string().describe("Developer name shown publicly on the app's directory page."),
|
|
183
|
-
companyUrl:
|
|
926
|
+
companyUrl: urlField.describe("Your company's main website URL."),
|
|
184
927
|
supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
|
|
185
|
-
privacyPolicyUrl:
|
|
186
|
-
termsOfServiceUrl:
|
|
187
|
-
demoRecordingUrl:
|
|
928
|
+
privacyPolicyUrl: urlField.describe("URL to your privacy policy."),
|
|
929
|
+
termsOfServiceUrl: urlField.describe("URL to the app's terms of service."),
|
|
930
|
+
demoRecordingUrl: urlField.describe("URL to a video demonstrating the app, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
|
|
188
931
|
appCommerceAndPurchasing: z.boolean().describe("Checkbox: 'My app links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the app does not offer digital goods."),
|
|
189
|
-
serverUrl:
|
|
932
|
+
serverUrl: urlField.describe("URL of the MCP server."),
|
|
190
933
|
authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
|
|
191
934
|
tools: z.array(toolDefinitionSchema).describe("List of tools exposed by the MCP server (auto-populated from the production server's manifest)."),
|
|
192
|
-
toolJustifications: z.array(chatgptToolJustificationSchema).describe("Per-tool justification of `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotation values."),
|
|
193
|
-
testCases: z.array(positiveTestCaseSchema).describe("At least 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output.
|
|
194
|
-
negativeTestCases: z.array(negativeTestCaseSchema).describe("3 negative test cases
|
|
195
|
-
screenshots: z.array(z.
|
|
935
|
+
toolJustifications: z.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."),
|
|
936
|
+
testCases: z.array(positiveTestCaseSchema).describe("At least 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."),
|
|
937
|
+
negativeTestCases: z.array(negativeTestCaseSchema).describe("3 negative test cases: prompts where the app 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 app does not carry, the right brand or domain but an intent the app does not serve, or a boundary with a sibling app."),
|
|
938
|
+
screenshots: z.array(screenshotEntrySchema.extend({ prompt: z.string().max(75, { error: "Screenshot prompts are limited to 75 characters." }) })).max(3).describe("In-app screenshots paired with the user prompt that produced them (each prompt is 75 characters max). Widget apps must show the widget UI; non-widget apps show the model response. Min 1, max 3 entries, all public. Images: 706px wide, 400–860px tall, PNG."),
|
|
196
939
|
translations: z.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
|
|
197
|
-
allowedCountries: chatgptAllowedCountriesSchema.describe("
|
|
940
|
+
allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
|
|
198
941
|
releaseNotes: z.string().describe("Publicly displayed on the app details page.")
|
|
199
942
|
});
|
|
200
943
|
chatgptSubmissionFormDataSchema.pick({
|
|
@@ -211,9 +954,9 @@ chatgptSubmissionFormDataSchema.pick({
|
|
|
211
954
|
testCases: true,
|
|
212
955
|
negativeTestCases: true,
|
|
213
956
|
toolJustifications: true
|
|
214
|
-
});
|
|
957
|
+
}).extend({ tagline: clampStringField(chatgptSubmissionFormDataSchema.shape.tagline) });
|
|
215
958
|
const claudeCategorySchema = z.enum([
|
|
216
|
-
"
|
|
959
|
+
"Productivity",
|
|
217
960
|
"Communication",
|
|
218
961
|
"Data & Analytics",
|
|
219
962
|
"Development tools",
|
|
@@ -221,193 +964,141 @@ const claudeCategorySchema = z.enum([
|
|
|
221
964
|
"Consumer Health",
|
|
222
965
|
"Health & Life Sciences",
|
|
223
966
|
"Media & Entertainment",
|
|
224
|
-
"Commerce & Shopping"
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
967
|
+
"Commerce & Shopping",
|
|
968
|
+
"Legal",
|
|
969
|
+
"Sales and marketing",
|
|
970
|
+
"Creative",
|
|
971
|
+
"Nonprofit",
|
|
972
|
+
"Education",
|
|
973
|
+
"Other"
|
|
230
974
|
]);
|
|
231
|
-
const
|
|
232
|
-
z.enum(["Static OAuth Client", "Dynamic OAuth Client (DCR / CIMD)"]);
|
|
975
|
+
const claudeCategoryDescription = `The categories used to filter connectors in the directory UI. Select up to 5 that best describe your connector.`;
|
|
233
976
|
const claudeReadWriteCapabilitiesSchema = z.enum([
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
977
|
+
"read_only",
|
|
978
|
+
"write_only",
|
|
979
|
+
"read_write"
|
|
237
980
|
]);
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
244
|
-
"N/A"
|
|
981
|
+
const claudeAuthenticationSchema = z.enum([
|
|
982
|
+
"oauth_dcr",
|
|
983
|
+
"oauth_cimd",
|
|
984
|
+
"oauth_anthropic_creds",
|
|
985
|
+
"custom_connection",
|
|
986
|
+
"none"
|
|
245
987
|
]);
|
|
246
|
-
const
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"GDPR compliant (if applicable)"
|
|
988
|
+
const claudeApiOwnershipSchema = z.enum([
|
|
989
|
+
"first_party",
|
|
990
|
+
"proxied",
|
|
991
|
+
"third_party"
|
|
251
992
|
]);
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
"
|
|
255
|
-
"
|
|
993
|
+
const claudeYesNoOtherSchema = z.union([z.boolean(), z.object({ other: z.string() })]);
|
|
994
|
+
const claudePolicyAcknowledgementSchema = z.enum([
|
|
995
|
+
"I have read and understand the MCP Directory developer guidelines.",
|
|
996
|
+
"My server calls our own first-party APIs (or APIs we legitimately proxy with permission).",
|
|
997
|
+
"My connector does not transfer money, cryptocurrency, or other financial assets on a user's behalf.",
|
|
998
|
+
"My connector does not use AI models to generate images, video, or audio.",
|
|
999
|
+
"Tool descriptions contain no instructions about model behavior, other tools, or external instruction sources, and no hidden or encoded text.",
|
|
1000
|
+
"My connector does not collect conversation data beyond what is needed for its function.",
|
|
1001
|
+
"Public documentation for this connector will be live by the publish date."
|
|
256
1002
|
]);
|
|
257
1003
|
/**
|
|
258
|
-
* Field order mirrors the
|
|
259
|
-
*
|
|
1004
|
+
* Field order mirrors the claude.ai directory submission wizard
|
|
1005
|
+
* (`claude.ai/admin-settings/directory/submissions/new`), grouped by step.
|
|
1006
|
+
* When adding/removing/reordering fields, keep this in sync with the wizard.
|
|
260
1007
|
*/
|
|
261
1008
|
const claudeSubmissionFormDataSchema = z.object({
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
(
|
|
272
|
-
|
|
273
|
-
(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
•
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
• '
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
Select 'No' for the vast majority of business/productivity/dev tools. When in doubt, select 'No'. This field triggers additional compliance review if 'Yes'.`),
|
|
320
|
-
categories: z.array(claudeCategorySchema).describe(`Select the category or categories that best describe your connector. This determines where it appears in the directory's browse experience. Choose the most specific fit:
|
|
321
|
-
• Business & Productivity — project management, CRM, HR, office tools
|
|
322
|
-
• Communication — email, chat, messaging, notifications
|
|
323
|
-
• Data & Analytics — dashboards, reporting, databases, BI tools
|
|
324
|
-
• Development tools — code repositories, CI/CD, issue trackers, monitoring
|
|
325
|
-
• Financial Services — accounting, invoicing, fintech (note: financial transaction execution is not permitted)
|
|
326
|
-
• Consumer Health — fitness, wellness, personal health tracking
|
|
327
|
-
• Health & Life Sciences — clinical, pharma, medical professional tools
|
|
328
|
-
• Media & Entertainment — content, publishing, streaming
|
|
329
|
-
• Commerce & Shopping — e-commerce, inventory, orders
|
|
330
|
-
Multiple categories are allowed if genuinely applicable.`),
|
|
331
|
-
sponsoredContentsOrAdvertisement: claudeSponsoredContentSchema.describe(`Be honest here — advertising is not permitted in the Connectors Directory per Anthropic's policy. Select the option that accurately describes your server:
|
|
332
|
-
• 'No, there is no sponsored content or advertisements' — the results your server returns are not influenced by paid placement or sponsorship. This is what almost all connectors should select.
|
|
333
|
-
• 'Yes, there are banner ads or other paid visual elements' — your UI includes visual ads. NOTE: this will likely lead to rejection, as Anthropic prohibits advertising in Claude.
|
|
334
|
-
• 'Yes, the returned content or ranking of returned content is impacted by sponsorship or ad placement' — paid results affect what you return. NOTE: this also likely leads to rejection.
|
|
335
|
-
If your server returns organic results from a platform that has ads in its own UI (but your API results are not affected by ads), select 'No'.`),
|
|
336
|
-
transportSupport: z.array(claudeTransportSchema).describe(`Select all transport protocols your server supports:
|
|
337
|
-
• 'Streamable HTTP' — the modern, recommended transport. Anthropic strongly recommends implementing this. This is the future-proof option and should be your default.
|
|
338
|
-
• 'SSE (Server-Sent Events)' — the older transport. SSE may be deprecated by Anthropic later in 2025/2026. If you currently only support SSE, you should plan to migrate to Streamable HTTP.
|
|
339
|
-
If you support both, select both. If you're building from scratch, implement Streamable HTTP only.`),
|
|
340
|
-
serverDocumentationLink: z.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. This is displayed in the Directory listing and must be publicly accessible without login. Minimum requirements for the docs page:
|
|
341
|
-
• What the connector does and its key capabilities
|
|
342
|
-
• How to connect/set it up (step by step)
|
|
343
|
-
• What each tool does (or at least the main ones)
|
|
344
|
-
• How to troubleshoot common issues
|
|
345
|
-
• A support contact or channel
|
|
346
|
-
Acceptable formats: a dedicated docs page, a help center article, a README on GitHub, or a blog post — as long as it's comprehensive. Note: Anthropic requires public documentation to be live by your publish date.`),
|
|
347
|
-
privacyPolicyUrl: z.url().describe(`URL to your privacy policy. This is mandatory and displayed in the directory listing. Missing or incomplete privacy policies result in immediate rejection. Your privacy policy must cover:
|
|
348
|
-
• What data you collect (and how)
|
|
349
|
-
• How you use the collected data
|
|
350
|
-
• Where and how long you store it
|
|
351
|
-
• Whether you share data with third parties (and who)
|
|
352
|
-
• How users can contact you about data concerns
|
|
353
|
-
The policy must be publicly accessible. If you don't have one yet, create one before submitting — there are free generators online, but make sure it accurately reflects your actual practices. If you're GDPR-compliant, your policy should reflect that.`),
|
|
354
|
-
supportChannel: supportChannelSchema.describe(`A URL or email address where users can get help with your connector. This is displayed in the Directory listing. Acceptable options:
|
|
355
|
-
• Email address (e.g. support@myapp.com)
|
|
356
|
-
• Link to a GitHub Issues page
|
|
357
|
-
• Link to a help center or support article
|
|
358
|
-
• Link to a Discord/Slack community
|
|
359
|
-
• Link to your documentation's troubleshooting section
|
|
360
|
-
Also uses this to notify you of security or compliance issues, so make sure it's actively monitored.`),
|
|
361
|
-
testingCredentials: z.string().describe(`Provide login credentials for a test account that Anthropic reviewers can use to verify your server works end-to-end. Critical requirements:
|
|
362
|
-
• The account must have sample/demo data loaded — reviewers need to actually test your tools with real data.
|
|
363
|
-
• No 2FA — reviewers can't receive SMS codes. Disable 2FA on this account.
|
|
364
|
-
• If your service uses Google OAuth or another OAuth that requires email verification, use mcp-review@anthropic.com as the account email — Anthropic has access to this inbox.
|
|
365
|
-
• Credentials must remain valid for at least 30 days from submission.
|
|
366
|
-
• If your service requires API keys instead of a password, provide those.
|
|
367
|
-
Format suggestion: Username/email: xxx | Password: xxx | Any other notes`),
|
|
368
|
-
tools: z.array(toolDefinitionSchema).describe(`A comma-separated list of all tools your MCP server exposes. Use the format: tool_name (Human-Readable Name). The tool_name is the internal identifier (snake_case, max 64 characters). The Human-Readable Name is what users see.
|
|
369
|
-
Example: list_issues (List Issues), create_issue (Create Issue), update_issue (Update Issue), delete_issue (Delete Issue), search_issues (Search Issues)
|
|
370
|
-
Reviewers test every single tool you list here — don't list tools that don't work. Also: do not have a single catch-all tool like api_request(method, endpoint) — Anthropic rejects these. Each action should be its own purpose-built tool.`),
|
|
371
|
-
toolTitlesAnnotationsConfirmed: z.boolean().describe(`This is a compliance confirmation — check both boxes only if you have actually implemented these in your server code:
|
|
372
|
-
• 'I've specified user-friendly titles for all tools' — every tool has a 'title' annotation (a human-readable label, different from the tool name).
|
|
373
|
-
• 'I've specified accurate tool annotations for all tools' — every tool has the correct annotation: readOnlyHint: true for read operations (search, get, list, fetch), OR destructiveHint: true for write operations (create, update, delete, send).
|
|
374
|
-
This is the #1 reason submissions get rejected (30% of all rejections). Do not check these boxes without actually having implemented the annotations. See MCP spec for how to add them.`),
|
|
375
|
-
logoLight: z.string().describe(`Your connector's logo as displayed in the directory. Requirements:
|
|
376
|
-
• Format: SVG only
|
|
377
|
-
• Aspect ratio: square (1:1)
|
|
378
|
-
• Should work on both light and dark backgrounds (or you can provide separate light/dark versions)
|
|
379
|
-
• Provide via URL (Google Drive link is fine) or upload directly
|
|
380
|
-
Tip: use a simple, recognizable icon — not a full wordmark. The logo appears at small sizes in the directory grid.`),
|
|
381
|
-
screenshots: z.array(z.url()).describe(`Screenshots or promotional images of your connector in action within Claude. Strongly recommended for all connectors, and required for MCP Apps (interactive UI). Guidelines:
|
|
382
|
-
• 3–5 images is ideal
|
|
383
|
-
• Minimum 1000px width, PNG format preferred
|
|
384
|
-
• Crop to just the relevant part of the Claude interface (the tool response area)
|
|
385
|
-
• Show your connector doing something impressive and useful — real data, real results
|
|
386
|
-
• If you're an MCP App, include screenshots of your interactive UI elements
|
|
387
|
-
• Videos are also welcome
|
|
388
|
-
These images appear in your directory listing and are a key factor in driving user installs.`)
|
|
1009
|
+
serverUrl: z.url().describe(`The full https:// URL where your MCP server is hosted and reachable. In the claude.ai wizard this is read live
|
|
1010
|
+
from the custom connector you select — the connection is used to verify the URL and the tool list at submission time.
|
|
1011
|
+
The server must be publicly accessible without VPN or whitelisting.`),
|
|
1012
|
+
name: z.string().max(100).describe(`The public display name for your connector as it appears in the directory. Use your brand/product name. You must
|
|
1013
|
+
own or have the right to use this name. Max 100 characters.`),
|
|
1014
|
+
slug: z.string().max(50).regex(/^[a-z0-9-]+$/).describe(`URL-safe identifier for your connector's directory page. Lowercase letters, numbers, and hyphens only.
|
|
1015
|
+
PERMANENT after submission — it cannot be changed. Pre-filled from the name. Max 50 characters.`),
|
|
1016
|
+
oneLiner: z.string().max(200).describe(`A short tagline shown below your connector name in the directory listing. Max 200 characters. Avoid generic
|
|
1017
|
+
phrases like 'The best MCP server for...'. Example: 'Manage tasks and projects in Linear'.`),
|
|
1018
|
+
description: z.string().max(2e3).describe(`A description of what your connector does and its key features, shown on the connector's detail page in
|
|
1019
|
+
claude.ai. Write it from a user perspective and be specific. Max 2000 characters.`),
|
|
1020
|
+
categories: z.array(claudeCategorySchema).max(5).describe(claudeCategoryDescription),
|
|
1021
|
+
iconUrl: z.url().optional().describe(`Optional custom icon URL for the directory listing. By default the favicon from your MCP URL is used (recommended).
|
|
1022
|
+
Set this only if you want to override the favicon.`),
|
|
1023
|
+
documentation: z.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. Must be publicly
|
|
1024
|
+
accessible without login. IT admins often review these when deciding whether to approve a server. Required to be live
|
|
1025
|
+
by your publish date.`),
|
|
1026
|
+
support: supportChannelSchema.describe(`A support URL or email address where users can get help with your connector. Displayed in the directory listing and
|
|
1027
|
+
used to notify you of security or compliance issues, so make sure it's actively monitored.`),
|
|
1028
|
+
privacyPolicy: z.url().describe(`URL to your privacy policy. Mandatory and displayed in the directory listing. Must be publicly accessible and cover
|
|
1029
|
+
what data you collect, how you use and store it, and whether you share it with third parties.`),
|
|
1030
|
+
primaryUseCases: z.string().describe(`Describe the main tasks users will accomplish with this connector, and include a few example prompts a user might
|
|
1031
|
+
type. These may be shown publicly but are primarily used for internal review — reviewers test your server using them.`),
|
|
1032
|
+
connectionRequirements: z.string().describe(`What accounts, permissions, or setup a user needs before connecting (e.g. 'Requires a paid Acme account with admin
|
|
1033
|
+
permissions'). If there are genuinely no special requirements, say so explicitly.`),
|
|
1034
|
+
readWriteCapabilities: claudeReadWriteCapabilitiesSchema.describe(`What your server can do:
|
|
1035
|
+
• 'read_only': retrieves data but never modifies it.
|
|
1036
|
+
• 'write_only': creates or modifies data but does not read it.
|
|
1037
|
+
• 'read_write': both retrieves and modifies data (most common).`),
|
|
1038
|
+
companyName: z.string().describe("The company or organization behind this connector — its legal name or publicly known product name."),
|
|
1039
|
+
companyWebsite: z.url().describe("The company's main website URL, e.g. https://example.com."),
|
|
1040
|
+
primaryContactName: z.string().describe("Full name of the person Anthropic should contact about this submission. Receives review feedback and follow-up questions."),
|
|
1041
|
+
primaryContactEmail: z.email().describe("Email for the primary contact (pre-filled from the Claude account). Anthropic uses this to communicate about your submission."),
|
|
1042
|
+
primaryContactRole: z.string().optional().describe("The primary contact's role at the company (e.g. 'Engineer', 'Product Manager'). Optional."),
|
|
1043
|
+
anthropicPointOfContact: z.string().optional().describe("If you've been working with someone at Anthropic, their name or email. Optional, can expedite review."),
|
|
1044
|
+
authentication: claudeAuthenticationSchema.describe(`How users authenticate with your server:
|
|
1045
|
+
• 'oauth_dcr': OAuth 2.0 + Dynamic Client Registration (RFC 7591) — clients register themselves.
|
|
1046
|
+
• 'oauth_cimd': OAuth 2.0 + Client ID Metadata Document — a published client_id metadata document.
|
|
1047
|
+
• 'oauth_anthropic_creds': OAuth 2.0 with Anthropic-held client credentials (a static client_id, and secret if needed).
|
|
1048
|
+
• 'custom_connection': users supply their own URL or client details at connection time (e.g. Snowflake).
|
|
1049
|
+
• 'none': no authentication (authless) — anyone can connect and call tools without credentials.`),
|
|
1050
|
+
partialAuth: z.boolean().optional().describe("Whether some tools return 401 and prompt for auth on demand while the server otherwise starts authless (partial auth)."),
|
|
1051
|
+
apiOwnership: claudeApiOwnershipSchema.describe(`How your connector relates to the API it calls:
|
|
1052
|
+
• 'first_party': the MCP server calls your own production APIs.
|
|
1053
|
+
• 'proxied': calls go to a third-party API you're authorized to integrate (e.g. a Zapier-style integration).
|
|
1054
|
+
• 'third_party': calls a third-party API you don't control — typically blocks listing; explain in 'additionalNotes'.`),
|
|
1055
|
+
personalHealthData: claudeYesNoOtherSchema.describe(`Whether this connector accesses, processes, or stores personal health information.
|
|
1056
|
+
No → false, Yes → true, or { other: explanation } when it depends on configuration.`),
|
|
1057
|
+
sponsoredContent: claudeYesNoOtherSchema.describe(`Whether this connector surfaces sponsored, promoted, or advertising content (prohibited in directory connectors).
|
|
1058
|
+
No → false, Yes → true, or { other: explanation }.`),
|
|
1059
|
+
testInstructions: z.string().optional().describe(`Clear test-account setup and access instructions for reviewers: every link, credential, and step needed to access
|
|
1060
|
+
the MCP server autonomously. For accounts that need to be populated, provide test credentials granting access to a
|
|
1061
|
+
fully populated account.`),
|
|
1062
|
+
selfTested: z.boolean().optional().describe("Confirmation that you have run every tool via MCP Inspector or as a custom connector in Claude."),
|
|
1063
|
+
policyAcknowledgements: z.array(claudePolicyAcknowledgementSchema).describe(`Anthropic directory policy acknowledgements. All items must be acknowledged before the claude.ai wizard allows
|
|
1064
|
+
submission. Each is an attestation you are legally agreeing to by submitting.`),
|
|
1065
|
+
additionalNotes: z.string().optional().describe("Anything else the review team should know about your connector. Optional.")
|
|
389
1066
|
});
|
|
390
1067
|
claudeSubmissionFormDataSchema.pick({
|
|
391
|
-
companyName: true,
|
|
392
|
-
appName: true,
|
|
393
|
-
mcpUrlType: true,
|
|
394
1068
|
serverUrl: true,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
transportSupport: true,
|
|
1069
|
+
name: true,
|
|
1070
|
+
slug: true,
|
|
1071
|
+
companyName: true,
|
|
399
1072
|
primaryContactEmail: true,
|
|
400
|
-
primaryContactName: true
|
|
1073
|
+
primaryContactName: true,
|
|
1074
|
+
readWriteCapabilities: true,
|
|
1075
|
+
authentication: true,
|
|
1076
|
+
apiOwnership: true,
|
|
1077
|
+
personalHealthData: true
|
|
1078
|
+
}).extend({
|
|
1079
|
+
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
1080
|
+
testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
|
|
401
1081
|
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
1082
|
+
/**
|
|
1083
|
+
* Narrative fields the LLM-backed generation step produces for Claude submissions.
|
|
1084
|
+
* This schema accepts the slightly loose shape returned by AI generation, then normalizes it into
|
|
1085
|
+
* the strict form shape. Keep transforms here rather than in callers so generation leniency is
|
|
1086
|
+
* colocated with the Claude contract.
|
|
1087
|
+
*/
|
|
1088
|
+
const claudeAiGeneratedFormDataRawSchema = z.object({
|
|
1089
|
+
oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
|
|
1090
|
+
description: claudeSubmissionFormDataSchema.shape.description,
|
|
1091
|
+
categories: z.array(claudeCategorySchema).describe(claudeCategoryDescription),
|
|
1092
|
+
primaryUseCases: claudeSubmissionFormDataSchema.shape.primaryUseCases
|
|
1093
|
+
});
|
|
1094
|
+
claudeAiGeneratedFormDataRawSchema.extend({
|
|
1095
|
+
oneLiner: clampStringField(claudeSubmissionFormDataSchema.shape.oneLiner),
|
|
1096
|
+
categories: claudeAiGeneratedFormDataRawSchema.shape.categories.transform((categories) => categories.slice(0, 5))
|
|
407
1097
|
});
|
|
408
1098
|
const submissionMetaFieldsSchema = z.object({
|
|
409
1099
|
id: z.string(),
|
|
410
1100
|
environmentId: z.string(),
|
|
1101
|
+
auditId: z.string().nullable(),
|
|
411
1102
|
createdAt: z.coerce.date(),
|
|
412
1103
|
updatedAt: z.coerce.date()
|
|
413
1104
|
});
|
|
@@ -427,6 +1118,28 @@ const subscriptionPlanSchema = z.enum([
|
|
|
427
1118
|
"enterprise"
|
|
428
1119
|
]);
|
|
429
1120
|
z.object({ plan: subscriptionPlanSchema.nullable() });
|
|
1121
|
+
const customerCreditsSchema = z.object({
|
|
1122
|
+
balanceInCents: z.number(),
|
|
1123
|
+
expiresAt: z.number().nullable(),
|
|
1124
|
+
currency: z.string()
|
|
1125
|
+
});
|
|
1126
|
+
const customerUsageSchema = z.object({
|
|
1127
|
+
amountInCents: z.number(),
|
|
1128
|
+
currency: z.string(),
|
|
1129
|
+
periodEnd: z.number()
|
|
1130
|
+
});
|
|
1131
|
+
const partnerDiscountSchema = z.object({ endsAt: z.number() });
|
|
1132
|
+
z.object({
|
|
1133
|
+
customerCredits: customerCreditsSchema.nullable(),
|
|
1134
|
+
customerUsage: customerUsageSchema.nullable(),
|
|
1135
|
+
partnerDiscount: partnerDiscountSchema.nullable()
|
|
1136
|
+
});
|
|
1137
|
+
//#endregion
|
|
1138
|
+
//#region src/auth-scope.ts
|
|
1139
|
+
/** Accepts an API key or OAuth access token (default for most routes). */
|
|
1140
|
+
const AUTH_SCOPE_ANY = "any";
|
|
1141
|
+
/** Requires a user OAuth access token; API keys are not accepted. */
|
|
1142
|
+
const AUTH_SCOPE_USER = "user";
|
|
430
1143
|
//#endregion
|
|
431
1144
|
//#region src/schemas.ts
|
|
432
1145
|
const RESERVED_KEYS = [
|
|
@@ -567,7 +1280,7 @@ const createEnvironmentContractV1 = oc.route({
|
|
|
567
1280
|
id: z.string(),
|
|
568
1281
|
name: z.string(),
|
|
569
1282
|
sourceBranch: z.string().nullable().describe("The branch used to build the environment"),
|
|
570
|
-
urls: z.array(z.
|
|
1283
|
+
urls: z.array(z.url()).describe("The URLs of the MCP server"),
|
|
571
1284
|
createdAt: z.coerce.date(),
|
|
572
1285
|
projectId: z.string().describe("The ID of the project the environment belongs to")
|
|
573
1286
|
}));
|
|
@@ -583,7 +1296,7 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
583
1296
|
name: z.string(),
|
|
584
1297
|
sourceBranch: z.string().nullable(),
|
|
585
1298
|
mcpServerUrl: z.string(),
|
|
586
|
-
domains: z.array(z.
|
|
1299
|
+
domains: z.array(z.hostname()),
|
|
587
1300
|
createdAt: z.coerce.date(),
|
|
588
1301
|
projectId: z.string()
|
|
589
1302
|
}));
|
|
@@ -643,6 +1356,9 @@ const listProjectsContractV1 = oc.route({
|
|
|
643
1356
|
description: "List all projects for a team",
|
|
644
1357
|
tags: ["projects"],
|
|
645
1358
|
successDescription: "The list of projects"
|
|
1359
|
+
}).errors({
|
|
1360
|
+
NOT_FOUND: {},
|
|
1361
|
+
BAD_REQUEST: {}
|
|
646
1362
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
647
1363
|
const createProjectContractV1 = oc.route({
|
|
648
1364
|
path: "/v1/projects",
|
|
@@ -653,7 +1369,8 @@ const createProjectContractV1 = oc.route({
|
|
|
653
1369
|
successDescription: "The project has been created successfully"
|
|
654
1370
|
}).errors({
|
|
655
1371
|
NOT_FOUND: {},
|
|
656
|
-
BAD_REQUEST: {}
|
|
1372
|
+
BAD_REQUEST: {},
|
|
1373
|
+
FORBIDDEN: {}
|
|
657
1374
|
}).input(z.object({
|
|
658
1375
|
teamId: z.string().optional(),
|
|
659
1376
|
name: z.string().trim().min(1).max(100),
|
|
@@ -738,7 +1455,10 @@ const deleteEnvironmentVariableContractV1 = oc.route({
|
|
|
738
1455
|
description: "Delete an environment variable by ID",
|
|
739
1456
|
tags: ["environments"],
|
|
740
1457
|
successDescription: "The environment variable has been deleted successfully"
|
|
741
|
-
}).errors({
|
|
1458
|
+
}).errors({
|
|
1459
|
+
NOT_FOUND: {},
|
|
1460
|
+
BAD_REQUEST: {}
|
|
1461
|
+
}).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
742
1462
|
const deleteProjectContractV1 = oc.route({
|
|
743
1463
|
path: "/v1/projects/{projectId}",
|
|
744
1464
|
method: "DELETE",
|
|
@@ -756,7 +1476,8 @@ const updateProjectContractV1 = oc.route({
|
|
|
756
1476
|
successDescription: "The project has been updated successfully"
|
|
757
1477
|
}).errors({
|
|
758
1478
|
NOT_FOUND: {},
|
|
759
|
-
BAD_REQUEST: {}
|
|
1479
|
+
BAD_REQUEST: {},
|
|
1480
|
+
FORBIDDEN: {}
|
|
760
1481
|
}).input(z.object({
|
|
761
1482
|
projectId: z.string().describe("The ID of the project"),
|
|
762
1483
|
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
@@ -783,6 +1504,9 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
783
1504
|
description: "Return a presigned S3 URL to upload a deployment artifact",
|
|
784
1505
|
tags: ["deployments"],
|
|
785
1506
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
1507
|
+
}).errors({
|
|
1508
|
+
NOT_FOUND: {},
|
|
1509
|
+
BAD_REQUEST: {}
|
|
786
1510
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
787
1511
|
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
788
1512
|
token: z.string().describe("Token to identify the source archive"),
|
|
@@ -956,7 +1680,7 @@ const getTunnelTicketContractV1 = oc.route({
|
|
|
956
1680
|
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
957
1681
|
tags: ["tunnels"],
|
|
958
1682
|
successDescription: "The tunnel ticket"
|
|
959
|
-
}).output(z.object({
|
|
1683
|
+
}).meta({ authScope: AUTH_SCOPE_USER }).errors({ FORBIDDEN: {} }).output(z.object({
|
|
960
1684
|
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
961
1685
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
962
1686
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
@@ -1032,7 +1756,7 @@ const upsertPlaygroundContractV1 = oc.route({
|
|
|
1032
1756
|
name: z.string().min(1).max(100).optional(),
|
|
1033
1757
|
description: z.string().min(1).max(500).optional(),
|
|
1034
1758
|
headers: z.array(playgroundHeaderSchema).optional(),
|
|
1035
|
-
examplePrompts: z.array(playgroundExamplePromptSchema).max(
|
|
1759
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(5).optional()
|
|
1036
1760
|
})).output(playgroundOutputSchema);
|
|
1037
1761
|
const createBeaconContractV1 = oc.route({
|
|
1038
1762
|
path: "/v1/beacon/audits",
|
|
@@ -1110,4 +1834,4 @@ const contract = {
|
|
|
1110
1834
|
}
|
|
1111
1835
|
};
|
|
1112
1836
|
//#endregion
|
|
1113
|
-
export { PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
1837
|
+
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|