@alpic-ai/api 0.0.0-staging.gf8b2f50 → 0.0.0-staging.gfbabe10
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 +67 -59
- package/dist/index.mjs +828 -46
- 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,11 +573,15 @@ 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" });
|
|
139
587
|
const chatgptCategorySchema = z.enum([
|
|
@@ -152,32 +600,325 @@ const chatgptCategorySchema = z.enum([
|
|
|
152
600
|
"TRAVEL"
|
|
153
601
|
]);
|
|
154
602
|
const chatgptAuthenticationSchema = z.enum(["No auth needed", "OAuth 2.0"]);
|
|
155
|
-
const
|
|
603
|
+
const chatgptCountryCodeSchema = z.enum([
|
|
604
|
+
"AD",
|
|
605
|
+
"AE",
|
|
606
|
+
"AF",
|
|
607
|
+
"AG",
|
|
608
|
+
"AL",
|
|
609
|
+
"AM",
|
|
610
|
+
"AO",
|
|
611
|
+
"AR",
|
|
612
|
+
"AT",
|
|
613
|
+
"AU",
|
|
614
|
+
"AW",
|
|
615
|
+
"AX",
|
|
616
|
+
"AZ",
|
|
617
|
+
"BA",
|
|
618
|
+
"BB",
|
|
619
|
+
"BD",
|
|
620
|
+
"BE",
|
|
621
|
+
"BF",
|
|
622
|
+
"BG",
|
|
623
|
+
"BH",
|
|
624
|
+
"BI",
|
|
625
|
+
"BJ",
|
|
626
|
+
"BL",
|
|
627
|
+
"BM",
|
|
628
|
+
"BN",
|
|
629
|
+
"BO",
|
|
630
|
+
"BR",
|
|
631
|
+
"BS",
|
|
632
|
+
"BT",
|
|
633
|
+
"BW",
|
|
634
|
+
"BZ",
|
|
635
|
+
"CA",
|
|
636
|
+
"CD",
|
|
637
|
+
"CF",
|
|
638
|
+
"CG",
|
|
639
|
+
"CH",
|
|
640
|
+
"CI",
|
|
641
|
+
"CL",
|
|
642
|
+
"CM",
|
|
643
|
+
"CO",
|
|
644
|
+
"CR",
|
|
645
|
+
"CV",
|
|
646
|
+
"CY",
|
|
647
|
+
"CZ",
|
|
648
|
+
"DE",
|
|
649
|
+
"DJ",
|
|
650
|
+
"DK",
|
|
651
|
+
"DM",
|
|
652
|
+
"DO",
|
|
653
|
+
"DZ",
|
|
654
|
+
"EC",
|
|
655
|
+
"EE",
|
|
656
|
+
"EG",
|
|
657
|
+
"ER",
|
|
658
|
+
"ES",
|
|
659
|
+
"ET",
|
|
660
|
+
"FI",
|
|
661
|
+
"FJ",
|
|
662
|
+
"FM",
|
|
663
|
+
"FO",
|
|
664
|
+
"FR",
|
|
665
|
+
"GA",
|
|
666
|
+
"GB",
|
|
667
|
+
"GD",
|
|
668
|
+
"GE",
|
|
669
|
+
"GF",
|
|
670
|
+
"GH",
|
|
671
|
+
"GL",
|
|
672
|
+
"GM",
|
|
673
|
+
"GN",
|
|
674
|
+
"GP",
|
|
675
|
+
"GQ",
|
|
676
|
+
"GR",
|
|
677
|
+
"GT",
|
|
678
|
+
"GW",
|
|
679
|
+
"GY",
|
|
680
|
+
"HN",
|
|
681
|
+
"HR",
|
|
682
|
+
"HT",
|
|
683
|
+
"HU",
|
|
684
|
+
"ID",
|
|
685
|
+
"IE",
|
|
686
|
+
"IL",
|
|
687
|
+
"IN",
|
|
688
|
+
"IQ",
|
|
689
|
+
"IS",
|
|
690
|
+
"IT",
|
|
691
|
+
"JM",
|
|
692
|
+
"JO",
|
|
693
|
+
"JP",
|
|
694
|
+
"KE",
|
|
695
|
+
"KG",
|
|
696
|
+
"KH",
|
|
697
|
+
"KI",
|
|
698
|
+
"KM",
|
|
699
|
+
"KN",
|
|
700
|
+
"KR",
|
|
701
|
+
"KW",
|
|
702
|
+
"KY",
|
|
703
|
+
"KZ",
|
|
704
|
+
"LA",
|
|
705
|
+
"LB",
|
|
706
|
+
"LC",
|
|
707
|
+
"LI",
|
|
708
|
+
"LK",
|
|
709
|
+
"LR",
|
|
710
|
+
"LS",
|
|
711
|
+
"LT",
|
|
712
|
+
"LU",
|
|
713
|
+
"LV",
|
|
714
|
+
"LY",
|
|
715
|
+
"MA",
|
|
716
|
+
"MC",
|
|
717
|
+
"MD",
|
|
718
|
+
"ME",
|
|
719
|
+
"MF",
|
|
720
|
+
"MG",
|
|
721
|
+
"MH",
|
|
722
|
+
"MK",
|
|
723
|
+
"ML",
|
|
724
|
+
"MM",
|
|
725
|
+
"MN",
|
|
726
|
+
"MQ",
|
|
727
|
+
"MR",
|
|
728
|
+
"MT",
|
|
729
|
+
"MU",
|
|
730
|
+
"MV",
|
|
731
|
+
"MW",
|
|
732
|
+
"MX",
|
|
733
|
+
"MY",
|
|
734
|
+
"MZ",
|
|
735
|
+
"NA",
|
|
736
|
+
"NC",
|
|
737
|
+
"NE",
|
|
738
|
+
"NG",
|
|
739
|
+
"NI",
|
|
740
|
+
"NL",
|
|
741
|
+
"NO",
|
|
742
|
+
"NP",
|
|
743
|
+
"NR",
|
|
744
|
+
"NZ",
|
|
745
|
+
"OM",
|
|
746
|
+
"PA",
|
|
747
|
+
"PE",
|
|
748
|
+
"PF",
|
|
749
|
+
"PG",
|
|
750
|
+
"PH",
|
|
751
|
+
"PK",
|
|
752
|
+
"PL",
|
|
753
|
+
"PM",
|
|
754
|
+
"PS",
|
|
755
|
+
"PT",
|
|
756
|
+
"PW",
|
|
757
|
+
"PY",
|
|
758
|
+
"QA",
|
|
759
|
+
"RE",
|
|
760
|
+
"RO",
|
|
761
|
+
"RS",
|
|
762
|
+
"RW",
|
|
763
|
+
"SA",
|
|
764
|
+
"SB",
|
|
765
|
+
"SC",
|
|
766
|
+
"SD",
|
|
767
|
+
"SE",
|
|
768
|
+
"SG",
|
|
769
|
+
"SH",
|
|
770
|
+
"SI",
|
|
771
|
+
"SJ",
|
|
772
|
+
"SK",
|
|
773
|
+
"SL",
|
|
774
|
+
"SM",
|
|
775
|
+
"SN",
|
|
776
|
+
"SO",
|
|
777
|
+
"SR",
|
|
778
|
+
"SS",
|
|
779
|
+
"ST",
|
|
780
|
+
"SV",
|
|
781
|
+
"SZ",
|
|
782
|
+
"TD",
|
|
783
|
+
"TF",
|
|
784
|
+
"TG",
|
|
785
|
+
"TH",
|
|
786
|
+
"TJ",
|
|
787
|
+
"TL",
|
|
788
|
+
"TM",
|
|
789
|
+
"TN",
|
|
790
|
+
"TO",
|
|
791
|
+
"TR",
|
|
792
|
+
"TT",
|
|
793
|
+
"TV",
|
|
794
|
+
"TW",
|
|
795
|
+
"TZ",
|
|
796
|
+
"UA",
|
|
797
|
+
"UG",
|
|
798
|
+
"US",
|
|
799
|
+
"UY",
|
|
800
|
+
"UZ",
|
|
801
|
+
"VA",
|
|
802
|
+
"VC",
|
|
803
|
+
"VN",
|
|
804
|
+
"VU",
|
|
805
|
+
"WF",
|
|
806
|
+
"WS",
|
|
807
|
+
"YE",
|
|
808
|
+
"YT",
|
|
809
|
+
"ZA",
|
|
810
|
+
"ZM",
|
|
811
|
+
"ZW"
|
|
812
|
+
]);
|
|
813
|
+
const chatgptAllowedCountriesSchema = z.discriminatedUnion("mode", [
|
|
814
|
+
z.object({ mode: z.literal("all") }),
|
|
815
|
+
z.object({
|
|
816
|
+
mode: z.literal("allow"),
|
|
817
|
+
countries: z.array(chatgptCountryCodeSchema)
|
|
818
|
+
}),
|
|
819
|
+
z.object({
|
|
820
|
+
mode: z.literal("block"),
|
|
821
|
+
countries: z.array(chatgptCountryCodeSchema)
|
|
822
|
+
})
|
|
823
|
+
]);
|
|
824
|
+
const chatgptTranslationLocaleSchema = z.enum([
|
|
825
|
+
"am",
|
|
826
|
+
"ar",
|
|
827
|
+
"bg-BG",
|
|
828
|
+
"bn-BD",
|
|
829
|
+
"bs-BA",
|
|
830
|
+
"ca-ES",
|
|
831
|
+
"cs-CZ",
|
|
832
|
+
"da-DK",
|
|
833
|
+
"de-DE",
|
|
834
|
+
"el-GR",
|
|
835
|
+
"es-419",
|
|
836
|
+
"es-ES",
|
|
837
|
+
"et-EE",
|
|
838
|
+
"fi-FI",
|
|
839
|
+
"fr-CA",
|
|
840
|
+
"fr-FR",
|
|
841
|
+
"gu-IN",
|
|
842
|
+
"hi-IN",
|
|
843
|
+
"hr-HR",
|
|
844
|
+
"hu-HU",
|
|
845
|
+
"hy-AM",
|
|
846
|
+
"id-ID",
|
|
847
|
+
"is-IS",
|
|
848
|
+
"it-IT",
|
|
849
|
+
"ja-JP",
|
|
850
|
+
"ka-GE",
|
|
851
|
+
"kk",
|
|
852
|
+
"kn-IN",
|
|
853
|
+
"ko-KR",
|
|
854
|
+
"lt",
|
|
855
|
+
"lv-LV",
|
|
856
|
+
"mk-MK",
|
|
857
|
+
"ml",
|
|
858
|
+
"mn",
|
|
859
|
+
"mr-IN",
|
|
860
|
+
"ms-MY",
|
|
861
|
+
"my-MM",
|
|
862
|
+
"nb-NO",
|
|
863
|
+
"nl-NL",
|
|
864
|
+
"pa",
|
|
865
|
+
"pl-PL",
|
|
866
|
+
"pt-BR",
|
|
867
|
+
"pt-PT",
|
|
868
|
+
"ro-RO",
|
|
869
|
+
"ru-RU",
|
|
870
|
+
"sk-SK",
|
|
871
|
+
"sl-SI",
|
|
872
|
+
"so-SO",
|
|
873
|
+
"sq-AL",
|
|
874
|
+
"sr-RS",
|
|
875
|
+
"sv-SE",
|
|
876
|
+
"sw-TZ",
|
|
877
|
+
"ta-IN",
|
|
878
|
+
"te-IN",
|
|
879
|
+
"th-TH",
|
|
880
|
+
"tl",
|
|
881
|
+
"tr-TR",
|
|
882
|
+
"uk-UA",
|
|
883
|
+
"ur",
|
|
884
|
+
"vi-VN",
|
|
885
|
+
"zh-CN",
|
|
886
|
+
"zh-HK",
|
|
887
|
+
"zh-TW"
|
|
888
|
+
]);
|
|
156
889
|
const negativeTestCaseSchema = z.object({
|
|
157
890
|
scenario: z.string(),
|
|
158
891
|
userPrompt: z.string()
|
|
159
892
|
}).partial().describe("Each case: Scenario + User prompt (the app should NOT trigger).");
|
|
160
893
|
const chatgptToolJustificationSchema = z.object({
|
|
161
894
|
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).");
|
|
895
|
+
readOnlyJustification: z.string().describe("One sentence on what the tool reads and returns."),
|
|
896
|
+
openWorldJustification: z.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
897
|
+
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.\"")
|
|
898
|
+
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
899
|
+
/**
|
|
900
|
+
* Base copy fields, defined once and reused by both the submission form and per-locale
|
|
901
|
+
* translations so the constraints (tagline ≤ 30 chars) never drift. The translation generation
|
|
902
|
+
* path wraps these in {@link clampStringField} since the LLM tends to overshoot the limit.
|
|
903
|
+
*/
|
|
904
|
+
const chatgptTaglineSchema = z.string().max(30);
|
|
905
|
+
const chatgptDescriptionSchema = z.string();
|
|
166
906
|
const chatgptTranslationSchema = z.object({
|
|
167
|
-
locale:
|
|
168
|
-
tagline:
|
|
169
|
-
description:
|
|
907
|
+
locale: chatgptTranslationLocaleSchema,
|
|
908
|
+
tagline: chatgptTaglineSchema,
|
|
909
|
+
description: chatgptDescriptionSchema
|
|
170
910
|
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
911
|
+
chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
171
912
|
/**
|
|
172
913
|
* Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
|
|
173
914
|
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
174
915
|
*/
|
|
175
916
|
const chatgptSubmissionFormDataSchema = z.object({
|
|
176
917
|
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("
|
|
918
|
+
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
919
|
appName: z.string().describe("The name users will see in ChatGPT and in the Apps Directory."),
|
|
179
|
-
tagline:
|
|
180
|
-
description:
|
|
920
|
+
tagline: chatgptTaglineSchema.describe("Plain-language phrase focused on function and user value, 30 chars max. Avoid generic superlatives like \"the best …\"."),
|
|
921
|
+
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
922
|
category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
|
|
182
923
|
developerName: z.string().describe("Developer name shown publicly on the app's directory page."),
|
|
183
924
|
companyUrl: z.url().describe("Your company's main website URL."),
|
|
@@ -189,12 +930,12 @@ const chatgptSubmissionFormDataSchema = z.object({
|
|
|
189
930
|
serverUrl: z.url().describe("URL of the MCP server."),
|
|
190
931
|
authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
|
|
191
932
|
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(
|
|
933
|
+
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."),
|
|
934
|
+
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."),
|
|
935
|
+
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."),
|
|
936
|
+
screenshots: z.array(screenshotEntrySchema).max(3).describe("In-app screenshots paired with the user prompt that produced them. 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
937
|
translations: z.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
|
|
197
|
-
allowedCountries: chatgptAllowedCountriesSchema.describe("
|
|
938
|
+
allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
|
|
198
939
|
releaseNotes: z.string().describe("Publicly displayed on the app details page.")
|
|
199
940
|
});
|
|
200
941
|
chatgptSubmissionFormDataSchema.pick({
|
|
@@ -211,7 +952,7 @@ chatgptSubmissionFormDataSchema.pick({
|
|
|
211
952
|
testCases: true,
|
|
212
953
|
negativeTestCases: true,
|
|
213
954
|
toolJustifications: true
|
|
214
|
-
});
|
|
955
|
+
}).extend({ tagline: clampStringField(chatgptSubmissionFormDataSchema.shape.tagline) });
|
|
215
956
|
const claudeCategorySchema = z.enum([
|
|
216
957
|
"Business & Productivity",
|
|
217
958
|
"Communication",
|
|
@@ -223,7 +964,7 @@ const claudeCategorySchema = z.enum([
|
|
|
223
964
|
"Media & Entertainment",
|
|
224
965
|
"Commerce & Shopping"
|
|
225
966
|
]);
|
|
226
|
-
z.enum([
|
|
967
|
+
const claudeAuthenticationSchema = z.enum([
|
|
227
968
|
"No auth needed",
|
|
228
969
|
"OAuth 2.0",
|
|
229
970
|
"Custom URL"
|
|
@@ -231,28 +972,34 @@ z.enum([
|
|
|
231
972
|
const claudeMcpUrlTypeSchema = z.enum(["Universal URL", "Custom MCP URLs"]);
|
|
232
973
|
z.enum(["Static OAuth Client", "Dynamic OAuth Client (DCR / CIMD)"]);
|
|
233
974
|
const claudeReadWriteCapabilitiesSchema = z.enum([
|
|
234
|
-
"Read
|
|
235
|
-
"Write
|
|
236
|
-
"Read +
|
|
975
|
+
"Read Only",
|
|
976
|
+
"Write Only",
|
|
977
|
+
"Read + Write"
|
|
237
978
|
]);
|
|
238
979
|
const claudeTransportSchema = z.enum(["Streamable HTTP", "SSE"]);
|
|
980
|
+
const claudeTestedSurfaceSchema = z.enum([
|
|
981
|
+
"Claude.ai (web)",
|
|
982
|
+
"Claude Desktop",
|
|
983
|
+
"Claude Code",
|
|
984
|
+
"Cowork"
|
|
985
|
+
]);
|
|
239
986
|
const claudeThirdPartySchema = z.enum([
|
|
240
|
-
"Web access
|
|
241
|
-
"Third-party AI model integration",
|
|
242
|
-
"Third-party data retrieval (
|
|
243
|
-
"Third-party data modification (
|
|
987
|
+
"Web access: Fetches information from the open web (e.g., web scraping, search engines, or browsing arbitrary URLs, not just connecting to a specific API)",
|
|
988
|
+
"Third-party AI model integration: Sends data to or receives data from a generative AI model other than Claude",
|
|
989
|
+
"Third-party data retrieval: Connects to external services that themselves retrieve data from other sources (e.g., workflow automation platforms or other services that aggregate or relay data from multiple third-party sources)",
|
|
990
|
+
"Third-party data modification: Can connect to external services that themselves create, update, or delete data in other sources (e.g., workflow automation platforms or other services that write to multiple third-party sources)",
|
|
244
991
|
"N/A"
|
|
245
992
|
]);
|
|
246
993
|
const claudeDataHandlingSchema = z.enum([
|
|
247
994
|
"Server only accesses data explicitly requested by user",
|
|
248
995
|
"No data is stored beyond session requirements",
|
|
249
|
-
"Data transmission is encrypted (HTTPS
|
|
996
|
+
"Data transmission is encrypted (HTTPS/TLS)",
|
|
250
997
|
"GDPR compliant (if applicable)"
|
|
251
998
|
]);
|
|
252
999
|
const claudeSponsoredContentSchema = z.enum([
|
|
253
1000
|
"No, there is no sponsored content or advertisements",
|
|
254
1001
|
"Yes, there are banner ads or other paid visual elements",
|
|
255
|
-
"Yes, returned content or ranking is impacted by sponsorship or ad placement"
|
|
1002
|
+
"Yes, the returned content or ranking of returned content is impacted by sponsorship or ad placement"
|
|
256
1003
|
]);
|
|
257
1004
|
/**
|
|
258
1005
|
* Field order mirrors the Claude (Anthropic) submission spreadsheet, grouped by section.
|
|
@@ -317,7 +1064,7 @@ If 'Yes', you will also be required to provide screenshots of your UI (see Promo
|
|
|
317
1064
|
Note: These are attestations — you are legally agreeing to these practices by submitting the form.`),
|
|
318
1065
|
personalDataHealthAccess: z.boolean().describe(`Select 'Yes' ONLY if your connector gives users access to their own personal health information — such as medical records, lab results, diagnoses, prescriptions, wearable health metrics (heart rate, sleep data, etc.), or mental health data.
|
|
319
1066
|
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
|
-
|
|
1067
|
+
category: claudeCategorySchema.describe(`Select the category that best describes your connector. This determines where it appears in the directory's browse experience. Choose the most specific fit:
|
|
321
1068
|
• Business & Productivity — project management, CRM, HR, office tools
|
|
322
1069
|
• Communication — email, chat, messaging, notifications
|
|
323
1070
|
• Data & Analytics — dashboards, reporting, databases, BI tools
|
|
@@ -327,12 +1074,13 @@ Select 'No' for the vast majority of business/productivity/dev tools. When in do
|
|
|
327
1074
|
• Health & Life Sciences — clinical, pharma, medical professional tools
|
|
328
1075
|
• Media & Entertainment — content, publishing, streaming
|
|
329
1076
|
• Commerce & Shopping — e-commerce, inventory, orders
|
|
330
|
-
|
|
1077
|
+
Anthropic's submission form only accepts a single category.`),
|
|
331
1078
|
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
1079
|
• '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
1080
|
• '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
1081
|
• '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
1082
|
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'.`),
|
|
1083
|
+
authentication: claudeAuthenticationSchema.describe("How users authenticate with the server. No auth / OAuth 2.0 / Custom URL (not supported)."),
|
|
336
1084
|
transportSupport: z.array(claudeTransportSchema).describe(`Select all transport protocols your server supports:
|
|
337
1085
|
• 'Streamable HTTP' — the modern, recommended transport. Anthropic strongly recommends implementing this. This is the future-proof option and should be your default.
|
|
338
1086
|
• '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.
|
|
@@ -372,19 +1120,21 @@ Reviewers test every single tool you list here — don't list tools that don't w
|
|
|
372
1120
|
• '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
1121
|
• '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
1122
|
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
|
-
|
|
1123
|
+
testedSurfaces: z.array(claudeTestedSurfaceSchema).describe(`Confirm testing is complete and your server works as intended in these surfaces. Select every surface you've verified. Claude.ai (web) and Claude Desktop are the usual targets for remote MCP servers; Claude Code and Cowork compatibility is not required. Anthropic requires at least two surfaces.`),
|
|
1124
|
+
logoLight: z.string().describe(`Your connector's logo for light backgrounds. Requirements:
|
|
376
1125
|
• Format: SVG only
|
|
377
1126
|
• Aspect ratio: square (1:1)
|
|
378
|
-
• Should work on
|
|
1127
|
+
• Should work on a light background
|
|
379
1128
|
• Provide via URL (Google Drive link is fine) or upload directly
|
|
380
1129
|
Tip: use a simple, recognizable icon — not a full wordmark. The logo appears at small sizes in the directory grid.`),
|
|
381
|
-
|
|
1130
|
+
logoDark: z.string().optional().describe(`Optional dark-mode variant of the connector logo. Same specs as the light variant (SVG, square 1:1) but designed to read on a dark background. Leave empty if the light logo already works on dark.`),
|
|
1131
|
+
screenshots: z.array(screenshotEntrySchema).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
1132
|
• 3–5 images is ideal
|
|
383
1133
|
• Minimum 1000px width, PNG format preferred
|
|
1134
|
+
• Each screenshot is paired with the user prompt that produced it
|
|
384
1135
|
• Crop to just the relevant part of the Claude interface (the tool response area)
|
|
385
1136
|
• Show your connector doing something impressive and useful — real data, real results
|
|
386
1137
|
• If you're an MCP App, include screenshots of your interactive UI elements
|
|
387
|
-
• Videos are also welcome
|
|
388
1138
|
These images appear in your directory listing and are a key factor in driving user installs.`)
|
|
389
1139
|
});
|
|
390
1140
|
claudeSubmissionFormDataSchema.pick({
|
|
@@ -397,17 +1147,24 @@ claudeSubmissionFormDataSchema.pick({
|
|
|
397
1147
|
isMcpApp: true,
|
|
398
1148
|
transportSupport: true,
|
|
399
1149
|
primaryContactEmail: true,
|
|
400
|
-
primaryContactName: true
|
|
1150
|
+
primaryContactName: true,
|
|
1151
|
+
authentication: true,
|
|
1152
|
+
personalDataHealthAccess: true,
|
|
1153
|
+
testedSurfaces: true
|
|
1154
|
+
}).extend({
|
|
1155
|
+
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
1156
|
+
testingCredentials: claudeSubmissionFormDataSchema.shape.testingCredentials.optional()
|
|
401
1157
|
});
|
|
402
1158
|
claudeSubmissionFormDataSchema.pick({
|
|
403
1159
|
tagline: true,
|
|
404
1160
|
description: true,
|
|
405
|
-
|
|
1161
|
+
category: true,
|
|
406
1162
|
testCases: true
|
|
407
|
-
});
|
|
1163
|
+
}).extend({ tagline: clampStringField(claudeSubmissionFormDataSchema.shape.tagline) });
|
|
408
1164
|
const submissionMetaFieldsSchema = z.object({
|
|
409
1165
|
id: z.string(),
|
|
410
1166
|
environmentId: z.string(),
|
|
1167
|
+
auditId: z.string().nullable(),
|
|
411
1168
|
createdAt: z.coerce.date(),
|
|
412
1169
|
updatedAt: z.coerce.date()
|
|
413
1170
|
});
|
|
@@ -427,6 +1184,22 @@ const subscriptionPlanSchema = z.enum([
|
|
|
427
1184
|
"enterprise"
|
|
428
1185
|
]);
|
|
429
1186
|
z.object({ plan: subscriptionPlanSchema.nullable() });
|
|
1187
|
+
const customerCreditsSchema = z.object({
|
|
1188
|
+
balanceInCents: z.number(),
|
|
1189
|
+
expiresAt: z.number().nullable(),
|
|
1190
|
+
currency: z.string()
|
|
1191
|
+
});
|
|
1192
|
+
const customerUsageSchema = z.object({
|
|
1193
|
+
amountInCents: z.number(),
|
|
1194
|
+
currency: z.string(),
|
|
1195
|
+
periodEnd: z.number()
|
|
1196
|
+
});
|
|
1197
|
+
const partnerDiscountSchema = z.object({ endsAt: z.number() });
|
|
1198
|
+
z.object({
|
|
1199
|
+
customerCredits: customerCreditsSchema.nullable(),
|
|
1200
|
+
customerUsage: customerUsageSchema.nullable(),
|
|
1201
|
+
partnerDiscount: partnerDiscountSchema.nullable()
|
|
1202
|
+
});
|
|
430
1203
|
//#endregion
|
|
431
1204
|
//#region src/schemas.ts
|
|
432
1205
|
const RESERVED_KEYS = [
|
|
@@ -567,7 +1340,7 @@ const createEnvironmentContractV1 = oc.route({
|
|
|
567
1340
|
id: z.string(),
|
|
568
1341
|
name: z.string(),
|
|
569
1342
|
sourceBranch: z.string().nullable().describe("The branch used to build the environment"),
|
|
570
|
-
urls: z.array(z.
|
|
1343
|
+
urls: z.array(z.url()).describe("The URLs of the MCP server"),
|
|
571
1344
|
createdAt: z.coerce.date(),
|
|
572
1345
|
projectId: z.string().describe("The ID of the project the environment belongs to")
|
|
573
1346
|
}));
|
|
@@ -583,7 +1356,7 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
583
1356
|
name: z.string(),
|
|
584
1357
|
sourceBranch: z.string().nullable(),
|
|
585
1358
|
mcpServerUrl: z.string(),
|
|
586
|
-
domains: z.array(z.
|
|
1359
|
+
domains: z.array(z.hostname()),
|
|
587
1360
|
createdAt: z.coerce.date(),
|
|
588
1361
|
projectId: z.string()
|
|
589
1362
|
}));
|
|
@@ -643,6 +1416,9 @@ const listProjectsContractV1 = oc.route({
|
|
|
643
1416
|
description: "List all projects for a team",
|
|
644
1417
|
tags: ["projects"],
|
|
645
1418
|
successDescription: "The list of projects"
|
|
1419
|
+
}).errors({
|
|
1420
|
+
NOT_FOUND: {},
|
|
1421
|
+
BAD_REQUEST: {}
|
|
646
1422
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
647
1423
|
const createProjectContractV1 = oc.route({
|
|
648
1424
|
path: "/v1/projects",
|
|
@@ -738,7 +1514,10 @@ const deleteEnvironmentVariableContractV1 = oc.route({
|
|
|
738
1514
|
description: "Delete an environment variable by ID",
|
|
739
1515
|
tags: ["environments"],
|
|
740
1516
|
successDescription: "The environment variable has been deleted successfully"
|
|
741
|
-
}).errors({
|
|
1517
|
+
}).errors({
|
|
1518
|
+
NOT_FOUND: {},
|
|
1519
|
+
BAD_REQUEST: {}
|
|
1520
|
+
}).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
742
1521
|
const deleteProjectContractV1 = oc.route({
|
|
743
1522
|
path: "/v1/projects/{projectId}",
|
|
744
1523
|
method: "DELETE",
|
|
@@ -783,6 +1562,9 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
783
1562
|
description: "Return a presigned S3 URL to upload a deployment artifact",
|
|
784
1563
|
tags: ["deployments"],
|
|
785
1564
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
1565
|
+
}).errors({
|
|
1566
|
+
NOT_FOUND: {},
|
|
1567
|
+
BAD_REQUEST: {}
|
|
786
1568
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
787
1569
|
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
788
1570
|
token: z.string().describe("Token to identify the source archive"),
|
|
@@ -956,7 +1738,7 @@ const getTunnelTicketContractV1 = oc.route({
|
|
|
956
1738
|
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
957
1739
|
tags: ["tunnels"],
|
|
958
1740
|
successDescription: "The tunnel ticket"
|
|
959
|
-
}).output(z.object({
|
|
1741
|
+
}).errors({ FORBIDDEN: {} }).output(z.object({
|
|
960
1742
|
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
961
1743
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
962
1744
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
@@ -1032,7 +1814,7 @@ const upsertPlaygroundContractV1 = oc.route({
|
|
|
1032
1814
|
name: z.string().min(1).max(100).optional(),
|
|
1033
1815
|
description: z.string().min(1).max(500).optional(),
|
|
1034
1816
|
headers: z.array(playgroundHeaderSchema).optional(),
|
|
1035
|
-
examplePrompts: z.array(playgroundExamplePromptSchema).max(
|
|
1817
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(5).optional()
|
|
1036
1818
|
})).output(playgroundOutputSchema);
|
|
1037
1819
|
const createBeaconContractV1 = oc.route({
|
|
1038
1820
|
path: "/v1/beacon/audits",
|