@alpic-ai/api 0.0.0-dev.gde7c050 → 0.0.0-dev.gde915af
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 +6780 -123
- package/dist/index.mjs +3265 -334
- package/package.json +19 -12
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,1601 @@
|
|
|
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";
|
|
4
|
-
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@8.1.1_zod@4.6.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
9
|
+
/**
|
|
10
|
+
* Reusable URL validation that disallows javascript: scheme
|
|
11
|
+
*/
|
|
12
|
+
const SafeUrlSchema = z$1.url().superRefine((val, ctx) => {
|
|
13
|
+
if (!URL.canParse(val)) {
|
|
14
|
+
ctx.addIssue({
|
|
15
|
+
code: z$1.ZodIssueCode.custom,
|
|
16
|
+
message: "URL must be parseable",
|
|
17
|
+
fatal: true
|
|
18
|
+
});
|
|
19
|
+
return z$1.NEVER;
|
|
20
|
+
}
|
|
21
|
+
}).refine((url) => {
|
|
22
|
+
const u = new URL(url);
|
|
23
|
+
return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
|
|
24
|
+
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
25
|
+
/**
|
|
26
|
+
* RFC 9728 OAuth Protected Resource Metadata
|
|
27
|
+
*/
|
|
28
|
+
const OAuthProtectedResourceMetadataSchema = z$1.looseObject({
|
|
29
|
+
resource: z$1.string().url(),
|
|
30
|
+
authorization_servers: z$1.array(SafeUrlSchema).optional(),
|
|
31
|
+
jwks_uri: z$1.string().url().optional(),
|
|
32
|
+
scopes_supported: z$1.array(z$1.string()).optional(),
|
|
33
|
+
bearer_methods_supported: z$1.array(z$1.string()).optional(),
|
|
34
|
+
resource_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
35
|
+
resource_name: z$1.string().optional(),
|
|
36
|
+
resource_documentation: z$1.string().optional(),
|
|
37
|
+
resource_policy_uri: z$1.string().url().optional(),
|
|
38
|
+
resource_tos_uri: z$1.string().url().optional(),
|
|
39
|
+
tls_client_certificate_bound_access_tokens: z$1.boolean().optional(),
|
|
40
|
+
authorization_details_types_supported: z$1.array(z$1.string()).optional(),
|
|
41
|
+
dpop_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
42
|
+
dpop_bound_access_tokens_required: z$1.boolean().optional()
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* RFC 8414 OAuth 2.0 Authorization Server Metadata
|
|
46
|
+
*/
|
|
47
|
+
const OAuthMetadataSchema = z$1.looseObject({
|
|
48
|
+
issuer: z$1.string(),
|
|
49
|
+
authorization_endpoint: SafeUrlSchema,
|
|
50
|
+
token_endpoint: SafeUrlSchema,
|
|
51
|
+
registration_endpoint: SafeUrlSchema.optional(),
|
|
52
|
+
scopes_supported: z$1.array(z$1.string()).optional(),
|
|
53
|
+
response_types_supported: z$1.array(z$1.string()),
|
|
54
|
+
response_modes_supported: z$1.array(z$1.string()).optional(),
|
|
55
|
+
grant_types_supported: z$1.array(z$1.string()).optional(),
|
|
56
|
+
token_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
57
|
+
token_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
58
|
+
service_documentation: SafeUrlSchema.optional(),
|
|
59
|
+
revocation_endpoint: SafeUrlSchema.optional(),
|
|
60
|
+
revocation_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
61
|
+
revocation_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
62
|
+
introspection_endpoint: z$1.string().optional(),
|
|
63
|
+
introspection_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
64
|
+
introspection_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
65
|
+
code_challenge_methods_supported: z$1.array(z$1.string()).optional(),
|
|
66
|
+
client_id_metadata_document_supported: z$1.boolean().optional()
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* OpenID Connect Discovery 1.0 Provider Metadata
|
|
70
|
+
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
|
|
71
|
+
*/
|
|
72
|
+
const OpenIdProviderMetadataSchema = z$1.looseObject({
|
|
73
|
+
issuer: z$1.string(),
|
|
74
|
+
authorization_endpoint: SafeUrlSchema,
|
|
75
|
+
token_endpoint: SafeUrlSchema,
|
|
76
|
+
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
77
|
+
jwks_uri: SafeUrlSchema,
|
|
78
|
+
registration_endpoint: SafeUrlSchema.optional(),
|
|
79
|
+
scopes_supported: z$1.array(z$1.string()).optional(),
|
|
80
|
+
response_types_supported: z$1.array(z$1.string()),
|
|
81
|
+
response_modes_supported: z$1.array(z$1.string()).optional(),
|
|
82
|
+
grant_types_supported: z$1.array(z$1.string()).optional(),
|
|
83
|
+
acr_values_supported: z$1.array(z$1.string()).optional(),
|
|
84
|
+
subject_types_supported: z$1.array(z$1.string()),
|
|
85
|
+
id_token_signing_alg_values_supported: z$1.array(z$1.string()),
|
|
86
|
+
id_token_encryption_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
87
|
+
id_token_encryption_enc_values_supported: z$1.array(z$1.string()).optional(),
|
|
88
|
+
userinfo_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
89
|
+
userinfo_encryption_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
90
|
+
userinfo_encryption_enc_values_supported: z$1.array(z$1.string()).optional(),
|
|
91
|
+
request_object_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
92
|
+
request_object_encryption_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
93
|
+
request_object_encryption_enc_values_supported: z$1.array(z$1.string()).optional(),
|
|
94
|
+
token_endpoint_auth_methods_supported: z$1.array(z$1.string()).optional(),
|
|
95
|
+
token_endpoint_auth_signing_alg_values_supported: z$1.array(z$1.string()).optional(),
|
|
96
|
+
display_values_supported: z$1.array(z$1.string()).optional(),
|
|
97
|
+
claim_types_supported: z$1.array(z$1.string()).optional(),
|
|
98
|
+
claims_supported: z$1.array(z$1.string()).optional(),
|
|
99
|
+
service_documentation: z$1.string().optional(),
|
|
100
|
+
claims_locales_supported: z$1.array(z$1.string()).optional(),
|
|
101
|
+
ui_locales_supported: z$1.array(z$1.string()).optional(),
|
|
102
|
+
claims_parameter_supported: z$1.boolean().optional(),
|
|
103
|
+
request_parameter_supported: z$1.boolean().optional(),
|
|
104
|
+
request_uri_parameter_supported: z$1.boolean().optional(),
|
|
105
|
+
require_request_uri_registration: z$1.boolean().optional(),
|
|
106
|
+
op_policy_uri: SafeUrlSchema.optional(),
|
|
107
|
+
op_tos_uri: SafeUrlSchema.optional(),
|
|
108
|
+
client_id_metadata_document_supported: z$1.boolean().optional()
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* OpenID Connect Discovery metadata that may include OAuth 2.0 fields
|
|
112
|
+
* This schema represents the real-world scenario where OIDC providers
|
|
113
|
+
* return a mix of OpenID Connect and OAuth 2.0 metadata fields
|
|
114
|
+
*/
|
|
115
|
+
const OpenIdProviderDiscoveryMetadataSchema = z$1.object({
|
|
116
|
+
...OpenIdProviderMetadataSchema.shape,
|
|
117
|
+
...OAuthMetadataSchema.pick({ code_challenge_methods_supported: true }).shape
|
|
118
|
+
});
|
|
119
|
+
z$1.object({
|
|
120
|
+
access_token: z$1.string(),
|
|
121
|
+
id_token: z$1.string().optional(),
|
|
122
|
+
token_type: z$1.string(),
|
|
123
|
+
expires_in: z$1.coerce.number().optional(),
|
|
124
|
+
scope: z$1.string().optional(),
|
|
125
|
+
refresh_token: z$1.string().optional(),
|
|
126
|
+
/**
|
|
127
|
+
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
128
|
+
* the client's `auth()` before it is stored and compared when it is read back.
|
|
129
|
+
*/
|
|
130
|
+
issuer: z$1.string().optional().catch(void 0)
|
|
131
|
+
}).strip();
|
|
132
|
+
z$1.object({
|
|
133
|
+
error: z$1.string(),
|
|
134
|
+
error_description: z$1.string().optional(),
|
|
135
|
+
error_uri: z$1.string().optional()
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri
|
|
139
|
+
*/
|
|
140
|
+
const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z$1.literal("").transform(() => void 0));
|
|
141
|
+
/**
|
|
142
|
+
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
|
|
143
|
+
*/
|
|
144
|
+
const OAuthClientMetadataSchema = z$1.object({
|
|
145
|
+
redirect_uris: z$1.array(SafeUrlSchema),
|
|
146
|
+
token_endpoint_auth_method: z$1.string().optional(),
|
|
147
|
+
grant_types: z$1.array(z$1.string()).optional(),
|
|
148
|
+
response_types: z$1.array(z$1.string()).optional(),
|
|
149
|
+
client_name: z$1.string().optional(),
|
|
150
|
+
client_uri: SafeUrlSchema.optional(),
|
|
151
|
+
logo_uri: OptionalSafeUrlSchema,
|
|
152
|
+
scope: z$1.string().optional(),
|
|
153
|
+
contacts: z$1.array(z$1.string()).optional(),
|
|
154
|
+
tos_uri: OptionalSafeUrlSchema,
|
|
155
|
+
policy_uri: z$1.string().optional(),
|
|
156
|
+
jwks_uri: SafeUrlSchema.optional(),
|
|
157
|
+
jwks: z$1.any().optional(),
|
|
158
|
+
software_id: z$1.string().optional(),
|
|
159
|
+
software_version: z$1.string().optional(),
|
|
160
|
+
software_statement: z$1.string().optional()
|
|
161
|
+
}).strip();
|
|
162
|
+
/**
|
|
163
|
+
* RFC 7591 OAuth 2.0 Dynamic Client Registration client information
|
|
164
|
+
*/
|
|
165
|
+
const OAuthClientInformationSchema = z$1.object({
|
|
166
|
+
client_id: z$1.string(),
|
|
167
|
+
client_secret: z$1.string().optional(),
|
|
168
|
+
client_id_issued_at: z$1.number().optional(),
|
|
169
|
+
client_secret_expires_at: z$1.number().optional(),
|
|
170
|
+
/**
|
|
171
|
+
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
172
|
+
* the client's `auth()` before it is stored and compared when it is read back.
|
|
173
|
+
*/
|
|
174
|
+
issuer: z$1.string().optional().catch(void 0)
|
|
175
|
+
}).strip();
|
|
176
|
+
OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
177
|
+
z$1.object({
|
|
178
|
+
error: z$1.string(),
|
|
179
|
+
error_description: z$1.string().optional()
|
|
180
|
+
}).strip();
|
|
181
|
+
z$1.object({
|
|
182
|
+
token: z$1.string(),
|
|
183
|
+
token_type_hint: z$1.string().optional()
|
|
184
|
+
}).strip();
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
|
|
187
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
188
|
+
module.exports = {
|
|
189
|
+
MAX_LENGTH: 256,
|
|
190
|
+
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
191
|
+
MAX_SAFE_BUILD_LENGTH: 250,
|
|
192
|
+
MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER ||
|
|
193
|
+
/* istanbul ignore next */ 9007199254740991,
|
|
194
|
+
RELEASE_TYPES: [
|
|
195
|
+
"major",
|
|
196
|
+
"premajor",
|
|
197
|
+
"minor",
|
|
198
|
+
"preminor",
|
|
199
|
+
"patch",
|
|
200
|
+
"prepatch",
|
|
201
|
+
"prerelease"
|
|
202
|
+
],
|
|
203
|
+
SEMVER_SPEC_VERSION: "2.0.0",
|
|
204
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
205
|
+
FLAG_LOOSE: 2
|
|
206
|
+
};
|
|
207
|
+
}));
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
|
|
210
|
+
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
211
|
+
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
212
|
+
}));
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
|
|
215
|
+
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
216
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
217
|
+
const debug = require_debug();
|
|
218
|
+
exports = module.exports = {};
|
|
219
|
+
const re = exports.re = [];
|
|
220
|
+
const safeRe = exports.safeRe = [];
|
|
221
|
+
const src = exports.src = [];
|
|
222
|
+
const safeSrc = exports.safeSrc = [];
|
|
223
|
+
const t = exports.t = {};
|
|
224
|
+
let R = 0;
|
|
225
|
+
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
226
|
+
const safeRegexReplacements = [
|
|
227
|
+
["\\s", 1],
|
|
228
|
+
["\\d", MAX_LENGTH],
|
|
229
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
230
|
+
];
|
|
231
|
+
const makeSafeRegex = (value) => {
|
|
232
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
233
|
+
return value;
|
|
234
|
+
};
|
|
235
|
+
const createToken = (name, value, isGlobal) => {
|
|
236
|
+
const safe = makeSafeRegex(value);
|
|
237
|
+
const index = R++;
|
|
238
|
+
debug(name, index, value);
|
|
239
|
+
t[name] = index;
|
|
240
|
+
src[index] = value;
|
|
241
|
+
safeSrc[index] = safe;
|
|
242
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
243
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
244
|
+
};
|
|
245
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
246
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
247
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
248
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
249
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
250
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
251
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
252
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
253
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
254
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
255
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
256
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
257
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
258
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
259
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
260
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
261
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
262
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
263
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
264
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
265
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
266
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
267
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
268
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
269
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
270
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
271
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
272
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
273
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
274
|
+
exports.tildeTrimReplace = "$1~";
|
|
275
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
276
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
277
|
+
createToken("LONECARET", "(?:\\^)");
|
|
278
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
279
|
+
exports.caretTrimReplace = "$1^";
|
|
280
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
281
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
282
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
283
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
284
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
285
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
286
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
287
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
288
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
289
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
290
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
291
|
+
}));
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
|
|
294
|
+
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
295
|
+
const looseOption = Object.freeze({ loose: true });
|
|
296
|
+
const emptyOpts = Object.freeze({});
|
|
297
|
+
const parseOptions = (options) => {
|
|
298
|
+
if (!options) return emptyOpts;
|
|
299
|
+
if (typeof options !== "object") return looseOption;
|
|
300
|
+
return options;
|
|
301
|
+
};
|
|
302
|
+
module.exports = parseOptions;
|
|
303
|
+
}));
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
|
|
306
|
+
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
307
|
+
const numeric = /^[0-9]+$/;
|
|
308
|
+
const compareIdentifiers = (a, b) => {
|
|
309
|
+
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
310
|
+
const anum = numeric.test(a);
|
|
311
|
+
const bnum = numeric.test(b);
|
|
312
|
+
if (anum && bnum) {
|
|
313
|
+
a = +a;
|
|
314
|
+
b = +b;
|
|
315
|
+
}
|
|
316
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
317
|
+
};
|
|
318
|
+
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
319
|
+
module.exports = {
|
|
320
|
+
compareIdentifiers,
|
|
321
|
+
rcompareIdentifiers
|
|
322
|
+
};
|
|
323
|
+
}));
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
|
|
326
|
+
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
327
|
+
const debug = require_debug();
|
|
328
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
329
|
+
const { safeRe: re, t } = require_re();
|
|
330
|
+
const parseOptions = require_parse_options();
|
|
331
|
+
const { compareIdentifiers } = require_identifiers();
|
|
332
|
+
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
333
|
+
const identifiers = identifier.split(".");
|
|
334
|
+
if (identifiers.length > prerelease.length) return false;
|
|
335
|
+
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
336
|
+
return true;
|
|
337
|
+
};
|
|
338
|
+
module.exports = class SemVer {
|
|
339
|
+
constructor(version, options) {
|
|
340
|
+
options = parseOptions(options);
|
|
341
|
+
if (version instanceof SemVer) {
|
|
342
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
343
|
+
else version = version.version;
|
|
344
|
+
} else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
345
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
346
|
+
debug("SemVer", version, options);
|
|
347
|
+
this.options = options;
|
|
348
|
+
this.loose = !!options.loose;
|
|
349
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
350
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
351
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
352
|
+
this.raw = version;
|
|
353
|
+
this.major = +m[1];
|
|
354
|
+
this.minor = +m[2];
|
|
355
|
+
this.patch = +m[3];
|
|
356
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
357
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
358
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
359
|
+
if (!m[4]) this.prerelease = [];
|
|
360
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
361
|
+
if (/^[0-9]+$/.test(id)) {
|
|
362
|
+
const num = +id;
|
|
363
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
364
|
+
}
|
|
365
|
+
return id;
|
|
366
|
+
});
|
|
367
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
368
|
+
this.format();
|
|
369
|
+
}
|
|
370
|
+
format() {
|
|
371
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
372
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
373
|
+
return this.version;
|
|
374
|
+
}
|
|
375
|
+
toString() {
|
|
376
|
+
return this.version;
|
|
377
|
+
}
|
|
378
|
+
compare(other) {
|
|
379
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
380
|
+
if (!(other instanceof SemVer)) {
|
|
381
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
382
|
+
other = new SemVer(other, this.options);
|
|
383
|
+
}
|
|
384
|
+
if (other.version === this.version) return 0;
|
|
385
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
386
|
+
}
|
|
387
|
+
compareMain(other) {
|
|
388
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
389
|
+
if (this.major < other.major) return -1;
|
|
390
|
+
if (this.major > other.major) return 1;
|
|
391
|
+
if (this.minor < other.minor) return -1;
|
|
392
|
+
if (this.minor > other.minor) return 1;
|
|
393
|
+
if (this.patch < other.patch) return -1;
|
|
394
|
+
if (this.patch > other.patch) return 1;
|
|
395
|
+
return 0;
|
|
396
|
+
}
|
|
397
|
+
comparePre(other) {
|
|
398
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
399
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
400
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
401
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
402
|
+
let i = 0;
|
|
403
|
+
do {
|
|
404
|
+
const a = this.prerelease[i];
|
|
405
|
+
const b = other.prerelease[i];
|
|
406
|
+
debug("prerelease compare", i, a, b);
|
|
407
|
+
if (a === void 0 && b === void 0) return 0;
|
|
408
|
+
else if (b === void 0) return 1;
|
|
409
|
+
else if (a === void 0) return -1;
|
|
410
|
+
else if (a === b) continue;
|
|
411
|
+
else return compareIdentifiers(a, b);
|
|
412
|
+
} while (++i);
|
|
413
|
+
}
|
|
414
|
+
compareBuild(other) {
|
|
415
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
416
|
+
let i = 0;
|
|
417
|
+
do {
|
|
418
|
+
const a = this.build[i];
|
|
419
|
+
const b = other.build[i];
|
|
420
|
+
debug("build compare", i, a, b);
|
|
421
|
+
if (a === void 0 && b === void 0) return 0;
|
|
422
|
+
else if (b === void 0) return 1;
|
|
423
|
+
else if (a === void 0) return -1;
|
|
424
|
+
else if (a === b) continue;
|
|
425
|
+
else return compareIdentifiers(a, b);
|
|
426
|
+
} while (++i);
|
|
427
|
+
}
|
|
428
|
+
inc(release, identifier, identifierBase) {
|
|
429
|
+
if (release.startsWith("pre")) {
|
|
430
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
431
|
+
if (identifier) {
|
|
432
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
433
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
switch (release) {
|
|
437
|
+
case "premajor":
|
|
438
|
+
this.prerelease.length = 0;
|
|
439
|
+
this.patch = 0;
|
|
440
|
+
this.minor = 0;
|
|
441
|
+
this.major++;
|
|
442
|
+
this.inc("pre", identifier, identifierBase);
|
|
443
|
+
break;
|
|
444
|
+
case "preminor":
|
|
445
|
+
this.prerelease.length = 0;
|
|
446
|
+
this.patch = 0;
|
|
447
|
+
this.minor++;
|
|
448
|
+
this.inc("pre", identifier, identifierBase);
|
|
449
|
+
break;
|
|
450
|
+
case "prepatch":
|
|
451
|
+
this.prerelease.length = 0;
|
|
452
|
+
this.inc("patch", identifier, identifierBase);
|
|
453
|
+
this.inc("pre", identifier, identifierBase);
|
|
454
|
+
break;
|
|
455
|
+
case "prerelease":
|
|
456
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
457
|
+
this.inc("pre", identifier, identifierBase);
|
|
458
|
+
break;
|
|
459
|
+
case "release":
|
|
460
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
461
|
+
this.prerelease.length = 0;
|
|
462
|
+
break;
|
|
463
|
+
case "major":
|
|
464
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
465
|
+
this.minor = 0;
|
|
466
|
+
this.patch = 0;
|
|
467
|
+
this.prerelease = [];
|
|
468
|
+
break;
|
|
469
|
+
case "minor":
|
|
470
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
471
|
+
this.patch = 0;
|
|
472
|
+
this.prerelease = [];
|
|
473
|
+
break;
|
|
474
|
+
case "patch":
|
|
475
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
476
|
+
this.prerelease = [];
|
|
477
|
+
break;
|
|
478
|
+
case "pre": {
|
|
479
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
480
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
481
|
+
else {
|
|
482
|
+
let i = this.prerelease.length;
|
|
483
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
484
|
+
this.prerelease[i]++;
|
|
485
|
+
i = -2;
|
|
486
|
+
}
|
|
487
|
+
if (i === -1) {
|
|
488
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
489
|
+
this.prerelease.push(base);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
if (identifier) {
|
|
493
|
+
let prerelease = [identifier, base];
|
|
494
|
+
if (identifierBase === false) prerelease = [identifier];
|
|
495
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
496
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
497
|
+
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
498
|
+
} else this.prerelease = prerelease;
|
|
499
|
+
}
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
default: throw new Error(`invalid increment argument: ${release}`);
|
|
503
|
+
}
|
|
504
|
+
this.raw = this.format();
|
|
505
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
506
|
+
return this;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}));
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
|
|
512
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
513
|
+
const SemVer = require_semver$1();
|
|
514
|
+
const parse = (version, options, throwErrors = false) => {
|
|
515
|
+
if (version instanceof SemVer) return version;
|
|
516
|
+
try {
|
|
517
|
+
return new SemVer(version, options);
|
|
518
|
+
} catch (er) {
|
|
519
|
+
if (!throwErrors) return null;
|
|
520
|
+
throw er;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
module.exports = parse;
|
|
524
|
+
}));
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
|
|
527
|
+
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
528
|
+
const parse = require_parse();
|
|
529
|
+
const valid = (version, options) => {
|
|
530
|
+
const v = parse(version, options);
|
|
531
|
+
return v ? v.version : null;
|
|
532
|
+
};
|
|
533
|
+
module.exports = valid;
|
|
534
|
+
}));
|
|
535
|
+
//#endregion
|
|
536
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
|
|
537
|
+
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
538
|
+
const parse = require_parse();
|
|
539
|
+
const clean = (version, options) => {
|
|
540
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
541
|
+
return s ? s.version : null;
|
|
542
|
+
};
|
|
543
|
+
module.exports = clean;
|
|
544
|
+
}));
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
|
|
547
|
+
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
548
|
+
const SemVer = require_semver$1();
|
|
549
|
+
const inc = (version, release, options, identifier, identifierBase) => {
|
|
550
|
+
if (typeof options === "string") {
|
|
551
|
+
identifierBase = identifier;
|
|
552
|
+
identifier = options;
|
|
553
|
+
options = void 0;
|
|
554
|
+
}
|
|
555
|
+
try {
|
|
556
|
+
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
557
|
+
} catch (er) {
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
module.exports = inc;
|
|
562
|
+
}));
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
|
|
565
|
+
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
566
|
+
const parse = require_parse();
|
|
567
|
+
const diff = (version1, version2) => {
|
|
568
|
+
const v1 = parse(version1, null, true);
|
|
569
|
+
const v2 = parse(version2, null, true);
|
|
570
|
+
const comparison = v1.compare(v2);
|
|
571
|
+
if (comparison === 0) return null;
|
|
572
|
+
const v1Higher = comparison > 0;
|
|
573
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
574
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
575
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
576
|
+
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
577
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
578
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
579
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
580
|
+
return "patch";
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
const prefix = highHasPre ? "pre" : "";
|
|
584
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
585
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
586
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
587
|
+
return "prerelease";
|
|
588
|
+
};
|
|
589
|
+
module.exports = diff;
|
|
590
|
+
}));
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
|
|
593
|
+
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
594
|
+
const SemVer = require_semver$1();
|
|
595
|
+
const major = (a, loose) => new SemVer(a, loose).major;
|
|
596
|
+
module.exports = major;
|
|
597
|
+
}));
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
|
|
600
|
+
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
601
|
+
const SemVer = require_semver$1();
|
|
602
|
+
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
603
|
+
module.exports = minor;
|
|
604
|
+
}));
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
|
|
607
|
+
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
608
|
+
const SemVer = require_semver$1();
|
|
609
|
+
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
610
|
+
module.exports = patch;
|
|
611
|
+
}));
|
|
612
|
+
//#endregion
|
|
613
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
|
|
614
|
+
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
615
|
+
const parse = require_parse();
|
|
616
|
+
const prerelease = (version, options) => {
|
|
617
|
+
const parsed = parse(version, options);
|
|
618
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
619
|
+
};
|
|
620
|
+
module.exports = prerelease;
|
|
621
|
+
}));
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
|
|
624
|
+
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
625
|
+
const SemVer = require_semver$1();
|
|
626
|
+
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
627
|
+
module.exports = compare;
|
|
628
|
+
}));
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
|
|
631
|
+
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
632
|
+
const compare = require_compare();
|
|
633
|
+
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
634
|
+
module.exports = rcompare;
|
|
635
|
+
}));
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
|
|
638
|
+
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
639
|
+
const compare = require_compare();
|
|
640
|
+
const compareLoose = (a, b) => compare(a, b, true);
|
|
641
|
+
module.exports = compareLoose;
|
|
642
|
+
}));
|
|
643
|
+
//#endregion
|
|
644
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
|
|
645
|
+
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
646
|
+
const SemVer = require_semver$1();
|
|
647
|
+
const compareBuild = (a, b, loose) => {
|
|
648
|
+
const versionA = new SemVer(a, loose);
|
|
649
|
+
const versionB = new SemVer(b, loose);
|
|
650
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
651
|
+
};
|
|
652
|
+
module.exports = compareBuild;
|
|
653
|
+
}));
|
|
654
|
+
//#endregion
|
|
655
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
|
|
656
|
+
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
657
|
+
const compareBuild = require_compare_build();
|
|
658
|
+
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
659
|
+
module.exports = sort;
|
|
660
|
+
}));
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
|
|
663
|
+
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
664
|
+
const compareBuild = require_compare_build();
|
|
665
|
+
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
666
|
+
module.exports = rsort;
|
|
667
|
+
}));
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
|
|
670
|
+
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
671
|
+
const compare = require_compare();
|
|
672
|
+
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
673
|
+
module.exports = gt;
|
|
674
|
+
}));
|
|
675
|
+
//#endregion
|
|
676
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
|
|
677
|
+
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
678
|
+
const compare = require_compare();
|
|
679
|
+
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
680
|
+
module.exports = lt;
|
|
681
|
+
}));
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
|
|
684
|
+
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
685
|
+
const compare = require_compare();
|
|
686
|
+
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
687
|
+
module.exports = eq;
|
|
688
|
+
}));
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
|
|
691
|
+
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
692
|
+
const compare = require_compare();
|
|
693
|
+
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
694
|
+
module.exports = neq;
|
|
695
|
+
}));
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
|
|
698
|
+
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
699
|
+
const compare = require_compare();
|
|
700
|
+
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
701
|
+
module.exports = gte;
|
|
702
|
+
}));
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
|
|
705
|
+
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
706
|
+
const compare = require_compare();
|
|
707
|
+
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
708
|
+
module.exports = lte;
|
|
709
|
+
}));
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
|
|
712
|
+
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
713
|
+
const eq = require_eq();
|
|
714
|
+
const neq = require_neq();
|
|
715
|
+
const gt = require_gt();
|
|
716
|
+
const gte = require_gte();
|
|
717
|
+
const lt = require_lt();
|
|
718
|
+
const lte = require_lte();
|
|
719
|
+
const cmp = (a, op, b, loose) => {
|
|
720
|
+
switch (op) {
|
|
721
|
+
case "===":
|
|
722
|
+
if (typeof a === "object") a = a.version;
|
|
723
|
+
if (typeof b === "object") b = b.version;
|
|
724
|
+
return a === b;
|
|
725
|
+
case "!==":
|
|
726
|
+
if (typeof a === "object") a = a.version;
|
|
727
|
+
if (typeof b === "object") b = b.version;
|
|
728
|
+
return a !== b;
|
|
729
|
+
case "":
|
|
730
|
+
case "=":
|
|
731
|
+
case "==": return eq(a, b, loose);
|
|
732
|
+
case "!=": return neq(a, b, loose);
|
|
733
|
+
case ">": return gt(a, b, loose);
|
|
734
|
+
case ">=": return gte(a, b, loose);
|
|
735
|
+
case "<": return lt(a, b, loose);
|
|
736
|
+
case "<=": return lte(a, b, loose);
|
|
737
|
+
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
module.exports = cmp;
|
|
741
|
+
}));
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
|
|
744
|
+
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
745
|
+
const SemVer = require_semver$1();
|
|
746
|
+
const parse = require_parse();
|
|
747
|
+
const { safeRe: re, t } = require_re();
|
|
748
|
+
const coerce = (version, options) => {
|
|
749
|
+
if (version instanceof SemVer) return version;
|
|
750
|
+
if (typeof version === "number") version = String(version);
|
|
751
|
+
if (typeof version !== "string") return null;
|
|
752
|
+
options = options || {};
|
|
753
|
+
let match = null;
|
|
754
|
+
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
755
|
+
else {
|
|
756
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
757
|
+
let next;
|
|
758
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
759
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
760
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
761
|
+
}
|
|
762
|
+
coerceRtlRegex.lastIndex = -1;
|
|
763
|
+
}
|
|
764
|
+
if (match === null) return null;
|
|
765
|
+
const major = match[2];
|
|
766
|
+
const minor = match[3] || "0";
|
|
767
|
+
const patch = match[4] || "0";
|
|
768
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
769
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
770
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
771
|
+
};
|
|
772
|
+
module.exports = coerce;
|
|
773
|
+
}));
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
|
|
776
|
+
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
777
|
+
const parse = require_parse();
|
|
778
|
+
const constants = require_constants();
|
|
779
|
+
const SemVer = require_semver$1();
|
|
780
|
+
const truncate = (version, truncation, options) => {
|
|
781
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
782
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
783
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
784
|
+
};
|
|
785
|
+
const cloneInputVersion = (version, options) => {
|
|
786
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
787
|
+
return parse(versionStringToParse, options);
|
|
788
|
+
};
|
|
789
|
+
const doTruncation = (version, truncation) => {
|
|
790
|
+
if (isPrerelease(truncation)) return version.version;
|
|
791
|
+
version.prerelease = [];
|
|
792
|
+
switch (truncation) {
|
|
793
|
+
case "major":
|
|
794
|
+
version.minor = 0;
|
|
795
|
+
version.patch = 0;
|
|
796
|
+
break;
|
|
797
|
+
case "minor": version.patch = 0;
|
|
798
|
+
}
|
|
799
|
+
return version.format();
|
|
800
|
+
};
|
|
801
|
+
const isPrerelease = (type) => {
|
|
802
|
+
return type.startsWith("pre");
|
|
803
|
+
};
|
|
804
|
+
module.exports = truncate;
|
|
805
|
+
}));
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
|
|
808
|
+
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
809
|
+
var LRUCache = class {
|
|
810
|
+
constructor() {
|
|
811
|
+
this.max = 1e3;
|
|
812
|
+
this.map = /* @__PURE__ */ new Map();
|
|
813
|
+
}
|
|
814
|
+
get(key) {
|
|
815
|
+
const value = this.map.get(key);
|
|
816
|
+
if (value === void 0) return;
|
|
817
|
+
else {
|
|
818
|
+
this.map.delete(key);
|
|
819
|
+
this.map.set(key, value);
|
|
820
|
+
return value;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
delete(key) {
|
|
824
|
+
return this.map.delete(key);
|
|
825
|
+
}
|
|
826
|
+
set(key, value) {
|
|
827
|
+
if (!this.delete(key) && value !== void 0) {
|
|
828
|
+
if (this.map.size >= this.max) {
|
|
829
|
+
const firstKey = this.map.keys().next().value;
|
|
830
|
+
this.delete(firstKey);
|
|
831
|
+
}
|
|
832
|
+
this.map.set(key, value);
|
|
833
|
+
}
|
|
834
|
+
return this;
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
module.exports = LRUCache;
|
|
838
|
+
}));
|
|
839
|
+
//#endregion
|
|
840
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
|
|
841
|
+
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
842
|
+
const SPACE_CHARACTERS = /\s+/g;
|
|
843
|
+
module.exports = class Range {
|
|
844
|
+
constructor(range, options) {
|
|
845
|
+
options = parseOptions(options);
|
|
846
|
+
if (range instanceof Range) {
|
|
847
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
848
|
+
else return new Range(range.raw, options);
|
|
849
|
+
}
|
|
850
|
+
if (range instanceof Comparator) {
|
|
851
|
+
this.raw = range.value;
|
|
852
|
+
this.set = [[range]];
|
|
853
|
+
this.formatted = void 0;
|
|
854
|
+
return this;
|
|
855
|
+
}
|
|
856
|
+
this.options = options;
|
|
857
|
+
this.loose = !!options.loose;
|
|
858
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
859
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
860
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
861
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
862
|
+
if (this.set.length > 1) {
|
|
863
|
+
const first = this.set[0];
|
|
864
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
865
|
+
if (this.set.length === 0) this.set = [first];
|
|
866
|
+
else if (this.set.length > 1) {
|
|
867
|
+
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
868
|
+
this.set = [c];
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
this.formatted = void 0;
|
|
874
|
+
}
|
|
875
|
+
get range() {
|
|
876
|
+
if (this.formatted === void 0) {
|
|
877
|
+
this.formatted = "";
|
|
878
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
879
|
+
if (i > 0) this.formatted += "||";
|
|
880
|
+
const comps = this.set[i];
|
|
881
|
+
for (let k = 0; k < comps.length; k++) {
|
|
882
|
+
if (k > 0) this.formatted += " ";
|
|
883
|
+
this.formatted += comps[k].toString().trim();
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
return this.formatted;
|
|
888
|
+
}
|
|
889
|
+
format() {
|
|
890
|
+
return this.range;
|
|
891
|
+
}
|
|
892
|
+
toString() {
|
|
893
|
+
return this.range;
|
|
894
|
+
}
|
|
895
|
+
parseRange(range) {
|
|
896
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
897
|
+
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
898
|
+
const cached = cache.get(memoKey);
|
|
899
|
+
if (cached) return cached;
|
|
900
|
+
const loose = this.options.loose;
|
|
901
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
902
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
903
|
+
debug("hyphen replace", range);
|
|
904
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
905
|
+
debug("comparator trim", range);
|
|
906
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
907
|
+
debug("tilde trim", range);
|
|
908
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
909
|
+
debug("caret trim", range);
|
|
910
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
911
|
+
if (loose) rangeList = rangeList.filter((comp) => {
|
|
912
|
+
debug("loose invalid filter", comp, this.options);
|
|
913
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
914
|
+
});
|
|
915
|
+
debug("range list", rangeList);
|
|
916
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
917
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
918
|
+
for (const comp of comparators) {
|
|
919
|
+
if (isNullSet(comp)) return [comp];
|
|
920
|
+
rangeMap.set(comp.value, comp);
|
|
921
|
+
}
|
|
922
|
+
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
923
|
+
const result = [...rangeMap.values()];
|
|
924
|
+
cache.set(memoKey, result);
|
|
925
|
+
return result;
|
|
926
|
+
}
|
|
927
|
+
intersects(range, options) {
|
|
928
|
+
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
929
|
+
return this.set.some((thisComparators) => {
|
|
930
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
931
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
932
|
+
return rangeComparators.every((rangeComparator) => {
|
|
933
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
934
|
+
});
|
|
935
|
+
});
|
|
936
|
+
});
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
test(version) {
|
|
940
|
+
if (!version) return false;
|
|
941
|
+
if (typeof version === "string") try {
|
|
942
|
+
version = new SemVer(version, this.options);
|
|
943
|
+
} catch (er) {
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
946
|
+
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
const cache = new (require_lrucache())();
|
|
951
|
+
const parseOptions = require_parse_options();
|
|
952
|
+
const Comparator = require_comparator();
|
|
953
|
+
const debug = require_debug();
|
|
954
|
+
const SemVer = require_semver$1();
|
|
955
|
+
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
956
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
957
|
+
const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
958
|
+
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
959
|
+
const isAny = (c) => c.value === "";
|
|
960
|
+
const isSatisfiable = (comparators, options) => {
|
|
961
|
+
let result = true;
|
|
962
|
+
const remainingComparators = comparators.slice();
|
|
963
|
+
let testComparator = remainingComparators.pop();
|
|
964
|
+
while (result && remainingComparators.length) {
|
|
965
|
+
result = remainingComparators.every((otherComparator) => {
|
|
966
|
+
return testComparator.intersects(otherComparator, options);
|
|
967
|
+
});
|
|
968
|
+
testComparator = remainingComparators.pop();
|
|
969
|
+
}
|
|
970
|
+
return result;
|
|
971
|
+
};
|
|
972
|
+
const parseComparator = (comp, options) => {
|
|
973
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
974
|
+
debug("comp", comp, options);
|
|
975
|
+
comp = replaceCarets(comp, options);
|
|
976
|
+
debug("caret", comp);
|
|
977
|
+
comp = replaceTildes(comp, options);
|
|
978
|
+
debug("tildes", comp);
|
|
979
|
+
comp = replaceXRanges(comp, options);
|
|
980
|
+
debug("xrange", comp);
|
|
981
|
+
comp = replaceStars(comp, options);
|
|
982
|
+
debug("stars", comp);
|
|
983
|
+
return comp;
|
|
984
|
+
};
|
|
985
|
+
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
986
|
+
const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
987
|
+
const replaceTildes = (comp, options) => {
|
|
988
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
989
|
+
};
|
|
990
|
+
const replaceTilde = (comp, options) => {
|
|
991
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
992
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
993
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
994
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
995
|
+
let ret;
|
|
996
|
+
if (isX(M)) ret = "";
|
|
997
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
998
|
+
else if (isX(p)) ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
999
|
+
else if (pr) {
|
|
1000
|
+
debug("replaceTilde pr", pr);
|
|
1001
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1002
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1003
|
+
debug("tilde return", ret);
|
|
1004
|
+
return ret;
|
|
1005
|
+
});
|
|
1006
|
+
};
|
|
1007
|
+
const replaceCarets = (comp, options) => {
|
|
1008
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1009
|
+
};
|
|
1010
|
+
const replaceCaret = (comp, options) => {
|
|
1011
|
+
debug("caret", comp, options);
|
|
1012
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1013
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1014
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1015
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1016
|
+
let ret;
|
|
1017
|
+
if (isX(M)) ret = "";
|
|
1018
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1019
|
+
else if (isX(p)) {
|
|
1020
|
+
if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1021
|
+
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1022
|
+
} else if (pr) {
|
|
1023
|
+
debug("replaceCaret pr", pr);
|
|
1024
|
+
if (M === "0") {
|
|
1025
|
+
if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1026
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1027
|
+
} else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1028
|
+
} else {
|
|
1029
|
+
debug("no pr");
|
|
1030
|
+
if (M === "0") {
|
|
1031
|
+
if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
1032
|
+
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1033
|
+
} else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1034
|
+
}
|
|
1035
|
+
debug("caret return", ret);
|
|
1036
|
+
return ret;
|
|
1037
|
+
});
|
|
1038
|
+
};
|
|
1039
|
+
const replaceXRanges = (comp, options) => {
|
|
1040
|
+
debug("replaceXRanges", comp, options);
|
|
1041
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1042
|
+
};
|
|
1043
|
+
const replaceXRange = (comp, options) => {
|
|
1044
|
+
comp = comp.trim();
|
|
1045
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1046
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1047
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1048
|
+
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
1049
|
+
const xM = isX(M);
|
|
1050
|
+
const xm = xM || isX(m);
|
|
1051
|
+
const xp = xm || isX(p);
|
|
1052
|
+
const anyX = xp;
|
|
1053
|
+
if (gtlt === "=" && anyX) gtlt = "";
|
|
1054
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1055
|
+
if (xM) {
|
|
1056
|
+
if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
1057
|
+
else ret = "*";
|
|
1058
|
+
} else if (gtlt && anyX) {
|
|
1059
|
+
if (xm) m = 0;
|
|
1060
|
+
p = 0;
|
|
1061
|
+
if (gtlt === ">") {
|
|
1062
|
+
gtlt = ">=";
|
|
1063
|
+
if (xm) {
|
|
1064
|
+
M = +M + 1;
|
|
1065
|
+
m = 0;
|
|
1066
|
+
p = 0;
|
|
1067
|
+
} else {
|
|
1068
|
+
m = +m + 1;
|
|
1069
|
+
p = 0;
|
|
1070
|
+
}
|
|
1071
|
+
} else if (gtlt === "<=") {
|
|
1072
|
+
gtlt = "<";
|
|
1073
|
+
if (xm) M = +M + 1;
|
|
1074
|
+
else m = +m + 1;
|
|
1075
|
+
}
|
|
1076
|
+
if (gtlt === "<") pr = "-0";
|
|
1077
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1078
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1079
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1080
|
+
debug("xRange return", ret);
|
|
1081
|
+
return ret;
|
|
1082
|
+
});
|
|
1083
|
+
};
|
|
1084
|
+
const replaceStars = (comp, options) => {
|
|
1085
|
+
debug("replaceStars", comp, options);
|
|
1086
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1087
|
+
};
|
|
1088
|
+
const replaceGTE0 = (comp, options) => {
|
|
1089
|
+
debug("replaceGTE0", comp, options);
|
|
1090
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1091
|
+
};
|
|
1092
|
+
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1093
|
+
if (isX(fM)) from = "";
|
|
1094
|
+
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1095
|
+
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1096
|
+
else if (fpr) from = `>=${from}`;
|
|
1097
|
+
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1098
|
+
if (isX(tM)) to = "";
|
|
1099
|
+
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
1100
|
+
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
1101
|
+
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1102
|
+
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1103
|
+
else to = `<=${to}`;
|
|
1104
|
+
return `${from} ${to}`.trim();
|
|
1105
|
+
};
|
|
1106
|
+
const testSet = (set, version, options) => {
|
|
1107
|
+
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
1108
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1109
|
+
for (let i = 0; i < set.length; i++) {
|
|
1110
|
+
debug(set[i].semver);
|
|
1111
|
+
if (set[i].semver === Comparator.ANY) continue;
|
|
1112
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1113
|
+
const allowed = set[i].semver;
|
|
1114
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
return false;
|
|
1118
|
+
}
|
|
1119
|
+
return true;
|
|
1120
|
+
};
|
|
1121
|
+
}));
|
|
1122
|
+
//#endregion
|
|
1123
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
|
|
1124
|
+
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1125
|
+
const ANY = Symbol("SemVer ANY");
|
|
1126
|
+
module.exports = class Comparator {
|
|
1127
|
+
static get ANY() {
|
|
1128
|
+
return ANY;
|
|
1129
|
+
}
|
|
1130
|
+
constructor(comp, options) {
|
|
1131
|
+
options = parseOptions(options);
|
|
1132
|
+
if (comp instanceof Comparator) {
|
|
1133
|
+
if (comp.loose === !!options.loose) return comp;
|
|
1134
|
+
else comp = comp.value;
|
|
1135
|
+
}
|
|
1136
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1137
|
+
debug("comparator", comp, options);
|
|
1138
|
+
this.options = options;
|
|
1139
|
+
this.loose = !!options.loose;
|
|
1140
|
+
this.parse(comp);
|
|
1141
|
+
if (this.semver === ANY) this.value = "";
|
|
1142
|
+
else this.value = this.operator + this.semver.version;
|
|
1143
|
+
debug("comp", this);
|
|
1144
|
+
}
|
|
1145
|
+
parse(comp) {
|
|
1146
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1147
|
+
const m = comp.match(r);
|
|
1148
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1149
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1150
|
+
if (this.operator === "=") this.operator = "";
|
|
1151
|
+
if (!m[2]) this.semver = ANY;
|
|
1152
|
+
else this.semver = new SemVer(m[2], this.options.loose);
|
|
1153
|
+
}
|
|
1154
|
+
toString() {
|
|
1155
|
+
return this.value;
|
|
1156
|
+
}
|
|
1157
|
+
test(version) {
|
|
1158
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1159
|
+
if (this.semver === ANY || version === ANY) return true;
|
|
1160
|
+
if (typeof version === "string") try {
|
|
1161
|
+
version = new SemVer(version, this.options);
|
|
1162
|
+
} catch (er) {
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1165
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1166
|
+
}
|
|
1167
|
+
intersects(comp, options) {
|
|
1168
|
+
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
1169
|
+
if (this.operator === "") {
|
|
1170
|
+
if (this.value === "") return true;
|
|
1171
|
+
return new Range(comp.value, options).test(this.value);
|
|
1172
|
+
} else if (comp.operator === "") {
|
|
1173
|
+
if (comp.value === "") return true;
|
|
1174
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1175
|
+
}
|
|
1176
|
+
options = parseOptions(options);
|
|
1177
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1178
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1179
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1180
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1181
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1182
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1183
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1184
|
+
return false;
|
|
1185
|
+
}
|
|
1186
|
+
};
|
|
1187
|
+
const parseOptions = require_parse_options();
|
|
1188
|
+
const { safeRe: re, t } = require_re();
|
|
1189
|
+
const cmp = require_cmp();
|
|
1190
|
+
const debug = require_debug();
|
|
1191
|
+
const SemVer = require_semver$1();
|
|
1192
|
+
const Range = require_range();
|
|
1193
|
+
}));
|
|
1194
|
+
//#endregion
|
|
1195
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
|
|
1196
|
+
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1197
|
+
const Range = require_range();
|
|
1198
|
+
const satisfies = (version, range, options) => {
|
|
1199
|
+
try {
|
|
1200
|
+
range = new Range(range, options);
|
|
1201
|
+
} catch (er) {
|
|
1202
|
+
return false;
|
|
1203
|
+
}
|
|
1204
|
+
return range.test(version);
|
|
1205
|
+
};
|
|
1206
|
+
module.exports = satisfies;
|
|
1207
|
+
}));
|
|
1208
|
+
//#endregion
|
|
1209
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
|
|
1210
|
+
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1211
|
+
const Range = require_range();
|
|
1212
|
+
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1213
|
+
module.exports = toComparators;
|
|
1214
|
+
}));
|
|
1215
|
+
//#endregion
|
|
1216
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
|
|
1217
|
+
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1218
|
+
const SemVer = require_semver$1();
|
|
1219
|
+
const Range = require_range();
|
|
1220
|
+
const maxSatisfying = (versions, range, options) => {
|
|
1221
|
+
let max = null;
|
|
1222
|
+
let maxSV = null;
|
|
1223
|
+
let rangeObj = null;
|
|
1224
|
+
try {
|
|
1225
|
+
rangeObj = new Range(range, options);
|
|
1226
|
+
} catch (er) {
|
|
1227
|
+
return null;
|
|
1228
|
+
}
|
|
1229
|
+
versions.forEach((v) => {
|
|
1230
|
+
if (rangeObj.test(v)) {
|
|
1231
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1232
|
+
max = v;
|
|
1233
|
+
maxSV = new SemVer(max, options);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
return max;
|
|
1238
|
+
};
|
|
1239
|
+
module.exports = maxSatisfying;
|
|
1240
|
+
}));
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
|
|
1243
|
+
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1244
|
+
const SemVer = require_semver$1();
|
|
1245
|
+
const Range = require_range();
|
|
1246
|
+
const minSatisfying = (versions, range, options) => {
|
|
1247
|
+
let min = null;
|
|
1248
|
+
let minSV = null;
|
|
1249
|
+
let rangeObj = null;
|
|
1250
|
+
try {
|
|
1251
|
+
rangeObj = new Range(range, options);
|
|
1252
|
+
} catch (er) {
|
|
1253
|
+
return null;
|
|
1254
|
+
}
|
|
1255
|
+
versions.forEach((v) => {
|
|
1256
|
+
if (rangeObj.test(v)) {
|
|
1257
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1258
|
+
min = v;
|
|
1259
|
+
minSV = new SemVer(min, options);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
return min;
|
|
1264
|
+
};
|
|
1265
|
+
module.exports = minSatisfying;
|
|
1266
|
+
}));
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
|
|
1269
|
+
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1270
|
+
const SemVer = require_semver$1();
|
|
1271
|
+
const Range = require_range();
|
|
1272
|
+
const gt = require_gt();
|
|
1273
|
+
const minVersion = (range, loose) => {
|
|
1274
|
+
range = new Range(range, loose);
|
|
1275
|
+
let minver = new SemVer("0.0.0");
|
|
1276
|
+
if (range.test(minver)) return minver;
|
|
1277
|
+
minver = new SemVer("0.0.0-0");
|
|
1278
|
+
if (range.test(minver)) return minver;
|
|
1279
|
+
minver = null;
|
|
1280
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1281
|
+
const comparators = range.set[i];
|
|
1282
|
+
let setMin = null;
|
|
1283
|
+
comparators.forEach((comparator) => {
|
|
1284
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1285
|
+
switch (comparator.operator) {
|
|
1286
|
+
case ">":
|
|
1287
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
1288
|
+
else compver.prerelease.push(0);
|
|
1289
|
+
compver.raw = compver.format();
|
|
1290
|
+
case "":
|
|
1291
|
+
case ">=":
|
|
1292
|
+
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1293
|
+
break;
|
|
1294
|
+
case "<":
|
|
1295
|
+
case "<=": break;
|
|
1296
|
+
/* istanbul ignore next */
|
|
1297
|
+
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1301
|
+
}
|
|
1302
|
+
if (minver && range.test(minver)) return minver;
|
|
1303
|
+
return null;
|
|
1304
|
+
};
|
|
1305
|
+
module.exports = minVersion;
|
|
1306
|
+
}));
|
|
1307
|
+
//#endregion
|
|
1308
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
|
|
1309
|
+
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1310
|
+
const Range = require_range();
|
|
1311
|
+
const validRange = (range, options) => {
|
|
1312
|
+
try {
|
|
1313
|
+
return new Range(range, options).range || "*";
|
|
1314
|
+
} catch (er) {
|
|
1315
|
+
return null;
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
module.exports = validRange;
|
|
1319
|
+
}));
|
|
1320
|
+
//#endregion
|
|
1321
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
|
|
1322
|
+
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1323
|
+
const SemVer = require_semver$1();
|
|
1324
|
+
const Comparator = require_comparator();
|
|
1325
|
+
const { ANY } = Comparator;
|
|
1326
|
+
const Range = require_range();
|
|
1327
|
+
const satisfies = require_satisfies();
|
|
1328
|
+
const gt = require_gt();
|
|
1329
|
+
const lt = require_lt();
|
|
1330
|
+
const lte = require_lte();
|
|
1331
|
+
const gte = require_gte();
|
|
1332
|
+
const outside = (version, range, hilo, options) => {
|
|
1333
|
+
version = new SemVer(version, options);
|
|
1334
|
+
range = new Range(range, options);
|
|
1335
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1336
|
+
switch (hilo) {
|
|
1337
|
+
case ">":
|
|
1338
|
+
gtfn = gt;
|
|
1339
|
+
ltefn = lte;
|
|
1340
|
+
ltfn = lt;
|
|
1341
|
+
comp = ">";
|
|
1342
|
+
ecomp = ">=";
|
|
1343
|
+
break;
|
|
1344
|
+
case "<":
|
|
1345
|
+
gtfn = lt;
|
|
1346
|
+
ltefn = gte;
|
|
1347
|
+
ltfn = gt;
|
|
1348
|
+
comp = "<";
|
|
1349
|
+
ecomp = "<=";
|
|
1350
|
+
break;
|
|
1351
|
+
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1352
|
+
}
|
|
1353
|
+
if (satisfies(version, range, options)) return false;
|
|
1354
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1355
|
+
const comparators = range.set[i];
|
|
1356
|
+
let high = null;
|
|
1357
|
+
let low = null;
|
|
1358
|
+
comparators.forEach((comparator) => {
|
|
1359
|
+
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
1360
|
+
high = high || comparator;
|
|
1361
|
+
low = low || comparator;
|
|
1362
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1363
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1364
|
+
});
|
|
1365
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1366
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1367
|
+
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1368
|
+
}
|
|
1369
|
+
return true;
|
|
1370
|
+
};
|
|
1371
|
+
module.exports = outside;
|
|
1372
|
+
}));
|
|
1373
|
+
//#endregion
|
|
1374
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
|
|
1375
|
+
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1376
|
+
const outside = require_outside();
|
|
1377
|
+
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1378
|
+
module.exports = gtr;
|
|
1379
|
+
}));
|
|
1380
|
+
//#endregion
|
|
1381
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
|
|
1382
|
+
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1383
|
+
const outside = require_outside();
|
|
1384
|
+
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1385
|
+
module.exports = ltr;
|
|
1386
|
+
}));
|
|
1387
|
+
//#endregion
|
|
1388
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
|
|
1389
|
+
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1390
|
+
const Range = require_range();
|
|
1391
|
+
const intersects = (r1, r2, options) => {
|
|
1392
|
+
r1 = new Range(r1, options);
|
|
1393
|
+
r2 = new Range(r2, options);
|
|
1394
|
+
return r1.intersects(r2, options);
|
|
1395
|
+
};
|
|
1396
|
+
module.exports = intersects;
|
|
1397
|
+
}));
|
|
1398
|
+
//#endregion
|
|
1399
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
|
|
1400
|
+
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1401
|
+
const satisfies = require_satisfies();
|
|
1402
|
+
const compare = require_compare();
|
|
1403
|
+
module.exports = (versions, range, options) => {
|
|
1404
|
+
const set = [];
|
|
1405
|
+
let first = null;
|
|
1406
|
+
let prev = null;
|
|
1407
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1408
|
+
for (const version of v) if (satisfies(version, range, options)) {
|
|
1409
|
+
prev = version;
|
|
1410
|
+
if (!first) first = version;
|
|
1411
|
+
} else {
|
|
1412
|
+
if (prev) set.push([first, prev]);
|
|
1413
|
+
prev = null;
|
|
1414
|
+
first = null;
|
|
1415
|
+
}
|
|
1416
|
+
if (first) set.push([first, null]);
|
|
1417
|
+
const ranges = [];
|
|
1418
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
1419
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
1420
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
1421
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
1422
|
+
else ranges.push(`${min} - ${max}`);
|
|
1423
|
+
const simplified = ranges.join(" || ");
|
|
1424
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1425
|
+
return simplified.length < original.length ? simplified : range;
|
|
1426
|
+
};
|
|
1427
|
+
}));
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
|
|
1430
|
+
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1431
|
+
const Range = require_range();
|
|
1432
|
+
const Comparator = require_comparator();
|
|
1433
|
+
const { ANY } = Comparator;
|
|
1434
|
+
const satisfies = require_satisfies();
|
|
1435
|
+
const compare = require_compare();
|
|
1436
|
+
const subset = (sub, dom, options = {}) => {
|
|
1437
|
+
if (sub === dom) return true;
|
|
1438
|
+
sub = new Range(sub, options);
|
|
1439
|
+
dom = new Range(dom, options);
|
|
1440
|
+
let sawNonNull = false;
|
|
1441
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1442
|
+
for (const simpleDom of dom.set) {
|
|
1443
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1444
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1445
|
+
if (isSub) continue OUTER;
|
|
1446
|
+
}
|
|
1447
|
+
if (sawNonNull) return false;
|
|
1448
|
+
}
|
|
1449
|
+
return true;
|
|
1450
|
+
};
|
|
1451
|
+
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1452
|
+
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1453
|
+
const simpleSubset = (sub, dom, options) => {
|
|
1454
|
+
if (sub === dom) return true;
|
|
1455
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1456
|
+
if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
1457
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
1458
|
+
else sub = minimumVersion;
|
|
1459
|
+
}
|
|
1460
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1461
|
+
if (options.includePrerelease) return true;
|
|
1462
|
+
else dom = minimumVersion;
|
|
1463
|
+
}
|
|
1464
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1465
|
+
let gt, lt;
|
|
1466
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
1467
|
+
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
1468
|
+
else eqSet.add(c.semver);
|
|
1469
|
+
if (eqSet.size > 1) return null;
|
|
1470
|
+
let gtltComp;
|
|
1471
|
+
if (gt && lt) {
|
|
1472
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1473
|
+
if (gtltComp > 0) return null;
|
|
1474
|
+
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
1475
|
+
}
|
|
1476
|
+
for (const eq of eqSet) {
|
|
1477
|
+
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1478
|
+
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1479
|
+
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
1480
|
+
return true;
|
|
1481
|
+
}
|
|
1482
|
+
let higher, lower;
|
|
1483
|
+
let hasDomLT, hasDomGT;
|
|
1484
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1485
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1486
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1487
|
+
for (const c of dom) {
|
|
1488
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1489
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1490
|
+
if (gt) {
|
|
1491
|
+
if (needDomGTPre) {
|
|
1492
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
1493
|
+
}
|
|
1494
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1495
|
+
higher = higherGT(gt, c, options);
|
|
1496
|
+
if (higher === c && higher !== gt) return false;
|
|
1497
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
1498
|
+
}
|
|
1499
|
+
if (lt) {
|
|
1500
|
+
if (needDomLTPre) {
|
|
1501
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
1502
|
+
}
|
|
1503
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1504
|
+
lower = lowerLT(lt, c, options);
|
|
1505
|
+
if (lower === c && lower !== lt) return false;
|
|
1506
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
1507
|
+
}
|
|
1508
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1509
|
+
}
|
|
1510
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
1511
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
1512
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
1513
|
+
return true;
|
|
1514
|
+
};
|
|
1515
|
+
const higherGT = (a, b, options) => {
|
|
1516
|
+
if (!a) return b;
|
|
1517
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1518
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1519
|
+
};
|
|
1520
|
+
const lowerLT = (a, b, options) => {
|
|
1521
|
+
if (!a) return b;
|
|
1522
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1523
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1524
|
+
};
|
|
1525
|
+
module.exports = subset;
|
|
1526
|
+
}));
|
|
1527
|
+
(/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1528
|
+
const internalRe = require_re();
|
|
1529
|
+
const constants = require_constants();
|
|
1530
|
+
const SemVer = require_semver$1();
|
|
1531
|
+
const identifiers = require_identifiers();
|
|
1532
|
+
module.exports = {
|
|
1533
|
+
parse: require_parse(),
|
|
1534
|
+
valid: require_valid$1(),
|
|
1535
|
+
clean: require_clean(),
|
|
1536
|
+
inc: require_inc(),
|
|
1537
|
+
diff: require_diff(),
|
|
1538
|
+
major: require_major(),
|
|
1539
|
+
minor: require_minor(),
|
|
1540
|
+
patch: require_patch(),
|
|
1541
|
+
prerelease: require_prerelease(),
|
|
1542
|
+
compare: require_compare(),
|
|
1543
|
+
rcompare: require_rcompare(),
|
|
1544
|
+
compareLoose: require_compare_loose(),
|
|
1545
|
+
compareBuild: require_compare_build(),
|
|
1546
|
+
sort: require_sort(),
|
|
1547
|
+
rsort: require_rsort(),
|
|
1548
|
+
gt: require_gt(),
|
|
1549
|
+
lt: require_lt(),
|
|
1550
|
+
eq: require_eq(),
|
|
1551
|
+
neq: require_neq(),
|
|
1552
|
+
gte: require_gte(),
|
|
1553
|
+
lte: require_lte(),
|
|
1554
|
+
cmp: require_cmp(),
|
|
1555
|
+
coerce: require_coerce(),
|
|
1556
|
+
truncate: require_truncate(),
|
|
1557
|
+
Comparator: require_comparator(),
|
|
1558
|
+
Range: require_range(),
|
|
1559
|
+
satisfies: require_satisfies(),
|
|
1560
|
+
toComparators: require_to_comparators(),
|
|
1561
|
+
maxSatisfying: require_max_satisfying(),
|
|
1562
|
+
minSatisfying: require_min_satisfying(),
|
|
1563
|
+
minVersion: require_min_version(),
|
|
1564
|
+
validRange: require_valid(),
|
|
1565
|
+
outside: require_outside(),
|
|
1566
|
+
gtr: require_gtr(),
|
|
1567
|
+
ltr: require_ltr(),
|
|
1568
|
+
intersects: require_intersects(),
|
|
1569
|
+
simplifyRange: require_simplify(),
|
|
1570
|
+
subset: require_subset(),
|
|
1571
|
+
SemVer,
|
|
1572
|
+
re: internalRe.re,
|
|
1573
|
+
src: internalRe.src,
|
|
1574
|
+
tokens: internalRe.t,
|
|
1575
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1576
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1577
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1578
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1579
|
+
};
|
|
1580
|
+
})))();
|
|
1581
|
+
const AI_PLATFORMS = ["chatgpt", "claudeai"];
|
|
1582
|
+
const platformSchema = z.enum(AI_PLATFORMS);
|
|
5
1583
|
const PLATFORM_LABELS = {
|
|
6
1584
|
chatgpt: "ChatGPT",
|
|
7
1585
|
claudeai: "Claude.ai"
|
|
8
1586
|
};
|
|
1587
|
+
const WAF_PLATFORMS = [
|
|
1588
|
+
"akamai",
|
|
1589
|
+
"cato",
|
|
1590
|
+
"cloudflare",
|
|
1591
|
+
"fastly"
|
|
1592
|
+
];
|
|
1593
|
+
const ALLOWED_PLATFORMS = [...[
|
|
1594
|
+
...AI_PLATFORMS,
|
|
1595
|
+
"meta",
|
|
1596
|
+
"google"
|
|
1597
|
+
], ...WAF_PLATFORMS];
|
|
1598
|
+
const allowedPlatformSchema = z.enum(ALLOWED_PLATFORMS);
|
|
9
1599
|
const auditStatusSchema = z.enum([
|
|
10
1600
|
"pending",
|
|
11
1601
|
"partial",
|
|
@@ -71,7 +1661,33 @@ const auditReportWithScreenshotsSchema = auditReportSchema.extend({ widgetScreen
|
|
|
71
1661
|
chatgpt: widgetScreenshotSchema.optional(),
|
|
72
1662
|
claudeai: widgetScreenshotSchema.optional()
|
|
73
1663
|
}) });
|
|
74
|
-
z.
|
|
1664
|
+
z.object({
|
|
1665
|
+
id: z.string(),
|
|
1666
|
+
environmentId: z.string(),
|
|
1667
|
+
clientId: z.string(),
|
|
1668
|
+
clientSecret: z.string(),
|
|
1669
|
+
clientScopes: z.array(z.string())
|
|
1670
|
+
});
|
|
1671
|
+
const creditEntryReasonSchema = z.enum([
|
|
1672
|
+
"free_seed",
|
|
1673
|
+
"paid_conversion_floor",
|
|
1674
|
+
"top_up",
|
|
1675
|
+
"usage",
|
|
1676
|
+
"admin_adjustment"
|
|
1677
|
+
]);
|
|
1678
|
+
z.enum(["playground"]);
|
|
1679
|
+
z.number().int().min(500);
|
|
1680
|
+
const creditActivityEntrySchema = z.object({
|
|
1681
|
+
reason: creditEntryReasonSchema,
|
|
1682
|
+
day: z.number(),
|
|
1683
|
+
amountInNanoUSD: z.number(),
|
|
1684
|
+
messageCount: z.number().nullable()
|
|
1685
|
+
});
|
|
1686
|
+
z.object({
|
|
1687
|
+
balanceInNanoUSD: z.number(),
|
|
1688
|
+
recentActivity: z.array(creditActivityEntrySchema)
|
|
1689
|
+
});
|
|
1690
|
+
const deploymentStatusSchema$1 = z.enum([
|
|
75
1691
|
"ongoing",
|
|
76
1692
|
"deployed",
|
|
77
1693
|
"failed",
|
|
@@ -81,17 +1697,240 @@ z.object({
|
|
|
81
1697
|
timestamp: z.coerce.date().optional(),
|
|
82
1698
|
content: z.string().optional()
|
|
83
1699
|
});
|
|
1700
|
+
const deploymentSummarySchema = z.object({
|
|
1701
|
+
id: z.string(),
|
|
1702
|
+
status: deploymentStatusSchema$1,
|
|
1703
|
+
sourceBucket: z.string().nullable(),
|
|
1704
|
+
sourceObjectKey: z.string().nullable(),
|
|
1705
|
+
sourceRef: z.string().nullable(),
|
|
1706
|
+
sourceCommitId: z.string().nullable(),
|
|
1707
|
+
sourceCommitMessage: z.string().nullable(),
|
|
1708
|
+
environmentId: z.string(),
|
|
1709
|
+
authorUsername: z.string().nullable(),
|
|
1710
|
+
authorAvatarUrl: z.string().nullable(),
|
|
1711
|
+
startedAt: z.coerce.date().nullable(),
|
|
1712
|
+
completedAt: z.coerce.date().nullable(),
|
|
1713
|
+
isCurrent: z.boolean().optional(),
|
|
1714
|
+
createdAt: z.coerce.date(),
|
|
1715
|
+
updatedAt: z.coerce.date()
|
|
1716
|
+
});
|
|
1717
|
+
/** Public environment: answers anonymously and exposes no OAuth metadata. */
|
|
1718
|
+
const publicEnvironmentSchema = z.object({
|
|
1719
|
+
allowsAnonymous: z.literal(true),
|
|
1720
|
+
oAuthMetadata: z.strictObject({})
|
|
1721
|
+
});
|
|
1722
|
+
/** Protected environment whose external resource metadata URL is returned in the WWW-Authenticate header on the first 401; everything after is handled outside the MCP server scope. */
|
|
1723
|
+
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
1724
|
+
allowsAnonymous: z.boolean(),
|
|
1725
|
+
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
1726
|
+
scope: z.string().optional()
|
|
1727
|
+
});
|
|
1728
|
+
/** Protected environment whose own /.well-known/oauth-protected-resource endpoint points at an external authorization server; everything after is handled outside the MCP server scope. */
|
|
1729
|
+
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
1730
|
+
allowsAnonymous: z.boolean(),
|
|
1731
|
+
oAuthMetadata: z.object({
|
|
1732
|
+
externalAuthorizationServerUrl: z.url(),
|
|
1733
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
1734
|
+
}),
|
|
1735
|
+
scope: z.string().optional()
|
|
1736
|
+
});
|
|
1737
|
+
/** Standalone protected environment: the server itself exposes both the /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server endpoints. */
|
|
1738
|
+
const standaloneEnvironmentSchema = z.object({
|
|
1739
|
+
allowsAnonymous: z.boolean(),
|
|
1740
|
+
oAuthMetadata: z.object({
|
|
1741
|
+
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
1742
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
1743
|
+
}),
|
|
1744
|
+
scope: z.string().optional()
|
|
1745
|
+
});
|
|
1746
|
+
/** Protected environment that enforces authentication but advertises no OAuth discovery metadata; clients must obtain credentials out-of-band. */
|
|
1747
|
+
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
1748
|
+
allowsAnonymous: z.literal(false),
|
|
1749
|
+
oAuthMetadata: z.strictObject({}),
|
|
1750
|
+
scope: z.string().optional(),
|
|
1751
|
+
wwwAuthenticate: z.string().optional()
|
|
1752
|
+
});
|
|
1753
|
+
const legacyPublicEnvironmentSchema = z.object({
|
|
1754
|
+
isPublic: z.literal(true),
|
|
1755
|
+
oAuthMetadata: z.undefined().optional()
|
|
1756
|
+
});
|
|
1757
|
+
const legacyExternalResourceMetadataEnvironmentSchema = z.object({
|
|
1758
|
+
isPublic: z.literal(false),
|
|
1759
|
+
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
1760
|
+
scope: z.string().optional()
|
|
1761
|
+
});
|
|
1762
|
+
const legacyExternalAuthorizationServerEnvironmentSchema = z.object({
|
|
1763
|
+
isPublic: z.literal(false),
|
|
1764
|
+
oAuthMetadata: z.object({
|
|
1765
|
+
externalAuthorizationServerUrl: z.url(),
|
|
1766
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
1767
|
+
}),
|
|
1768
|
+
scope: z.string().optional()
|
|
1769
|
+
});
|
|
1770
|
+
const legacyStandaloneEnvironmentSchema = z.object({
|
|
1771
|
+
isPublic: z.literal(false),
|
|
1772
|
+
oAuthMetadata: z.object({
|
|
1773
|
+
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
1774
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
1775
|
+
}),
|
|
1776
|
+
scope: z.string().optional()
|
|
1777
|
+
});
|
|
1778
|
+
const legacyProtectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
1779
|
+
isPublic: z.literal(false),
|
|
1780
|
+
oAuthMetadata: z.strictObject({}),
|
|
1781
|
+
scope: z.string().optional()
|
|
1782
|
+
});
|
|
1783
|
+
z.union([
|
|
1784
|
+
publicEnvironmentSchema,
|
|
1785
|
+
externalResourceMetadataEnvironmentSchema,
|
|
1786
|
+
externalAuthorizationServerEnvironmentSchema,
|
|
1787
|
+
standaloneEnvironmentSchema,
|
|
1788
|
+
protectedWithoutDiscoveryEnvironmentSchema,
|
|
1789
|
+
legacyPublicEnvironmentSchema,
|
|
1790
|
+
legacyExternalResourceMetadataEnvironmentSchema,
|
|
1791
|
+
legacyExternalAuthorizationServerEnvironmentSchema,
|
|
1792
|
+
legacyStandaloneEnvironmentSchema,
|
|
1793
|
+
legacyProtectedWithoutDiscoveryEnvironmentSchema
|
|
1794
|
+
]);
|
|
1795
|
+
const playgroundModelSchema = z.enum([
|
|
1796
|
+
"global.anthropic.claude-haiku-5-5",
|
|
1797
|
+
"global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
1798
|
+
"global.anthropic.claude-sonnet-5-5",
|
|
1799
|
+
"openai.gpt-5.4",
|
|
1800
|
+
"openai.gpt-5.5",
|
|
1801
|
+
"openai.gpt-6-luna",
|
|
1802
|
+
"openai.gpt-6.1-sol"
|
|
1803
|
+
]);
|
|
1804
|
+
const environmentDomainSchema = z.object({
|
|
1805
|
+
name: z.string(),
|
|
1806
|
+
status: z.enum([
|
|
1807
|
+
"ongoing",
|
|
1808
|
+
"deployed",
|
|
1809
|
+
"failed"
|
|
1810
|
+
]),
|
|
1811
|
+
createdAt: z.coerce.date(),
|
|
1812
|
+
updatedAt: z.coerce.date()
|
|
1813
|
+
});
|
|
1814
|
+
const environmentSchema$1 = z.object({
|
|
1815
|
+
id: z.string(),
|
|
1816
|
+
name: z.string(),
|
|
1817
|
+
sourceBranch: z.string().nullable(),
|
|
1818
|
+
mcpServerUrl: z.string(),
|
|
1819
|
+
activeDeployment: deploymentSummarySchema.optional(),
|
|
1820
|
+
latestDeployment: deploymentSummarySchema.optional(),
|
|
1821
|
+
openaiAppsChallenge: z.string().nullable().optional(),
|
|
1822
|
+
isPlaygroundEnabled: z.boolean(),
|
|
1823
|
+
playgroundModel: playgroundModelSchema,
|
|
1824
|
+
isIpWhitelistEnabled: z.boolean(),
|
|
1825
|
+
ipAllowlist: z.array(z.string()).nullable(),
|
|
1826
|
+
allowedPlatforms: z.array(allowedPlatformSchema),
|
|
1827
|
+
projectId: z.string(),
|
|
1828
|
+
createdAt: z.coerce.date(),
|
|
1829
|
+
updatedAt: z.coerce.date()
|
|
1830
|
+
});
|
|
1831
|
+
const environmentWithDomainsSchema = environmentSchema$1.extend({ domains: z.array(environmentDomainSchema) });
|
|
84
1832
|
z.object({
|
|
1833
|
+
sessionReplayEnabled: z.boolean(),
|
|
1834
|
+
collectRequestPayload: z.boolean(),
|
|
1835
|
+
collectResponsePayload: z.boolean(),
|
|
1836
|
+
collectErrorMessage: z.boolean(),
|
|
1837
|
+
collectUserData: z.boolean(),
|
|
1838
|
+
identityTraitKey: z.string().min(1).max(200).nullable(),
|
|
1839
|
+
leadEventName: z.string().min(1).max(200).nullable()
|
|
1840
|
+
});
|
|
1841
|
+
const feedbackSchema = z.object({
|
|
85
1842
|
id: z.string(),
|
|
86
1843
|
createdAt: z.coerce.date(),
|
|
87
1844
|
environmentId: z.string(),
|
|
88
1845
|
content: z.string(),
|
|
89
|
-
source: z.enum(["model", "user"])
|
|
1846
|
+
source: z.enum(["model", "user"]),
|
|
1847
|
+
clientName: z.string().nullable()
|
|
90
1848
|
});
|
|
91
1849
|
z.object({
|
|
92
1850
|
content: z.string(),
|
|
93
1851
|
source: z.enum(["model", "user"])
|
|
94
1852
|
});
|
|
1853
|
+
const intentCategoryColorSchema = z.enum([
|
|
1854
|
+
"red",
|
|
1855
|
+
"orange",
|
|
1856
|
+
"yellow",
|
|
1857
|
+
"green",
|
|
1858
|
+
"blue",
|
|
1859
|
+
"purple",
|
|
1860
|
+
"pink",
|
|
1861
|
+
"gray"
|
|
1862
|
+
]);
|
|
1863
|
+
const INTENT_CATEGORY_COLORS = intentCategoryColorSchema.options;
|
|
1864
|
+
const intentCategorySchema = z.object({
|
|
1865
|
+
id: z.string(),
|
|
1866
|
+
createdAt: z.coerce.date(),
|
|
1867
|
+
environmentId: z.string(),
|
|
1868
|
+
name: z.string(),
|
|
1869
|
+
color: intentCategoryColorSchema
|
|
1870
|
+
});
|
|
1871
|
+
const intentCategorySummarySchema = z.object({
|
|
1872
|
+
id: z.string(),
|
|
1873
|
+
name: z.string(),
|
|
1874
|
+
color: intentCategoryColorSchema,
|
|
1875
|
+
intentCount: z.number().int().nonnegative()
|
|
1876
|
+
});
|
|
1877
|
+
z.object({
|
|
1878
|
+
id: z.string(),
|
|
1879
|
+
createdAt: z.coerce.date(),
|
|
1880
|
+
environmentId: z.string(),
|
|
1881
|
+
toolName: z.string(),
|
|
1882
|
+
message: z.string(),
|
|
1883
|
+
clientName: z.string().nullable(),
|
|
1884
|
+
categories: z.array(intentCategorySchema)
|
|
1885
|
+
});
|
|
1886
|
+
const signalCategorySchema = z.object({
|
|
1887
|
+
id: z.string(),
|
|
1888
|
+
name: z.string(),
|
|
1889
|
+
color: intentCategoryColorSchema
|
|
1890
|
+
});
|
|
1891
|
+
z.discriminatedUnion("kind", [
|
|
1892
|
+
z.object({
|
|
1893
|
+
kind: z.literal("new"),
|
|
1894
|
+
category: signalCategorySchema,
|
|
1895
|
+
currentCount: z.number().int().nonnegative(),
|
|
1896
|
+
currentShare: z.number()
|
|
1897
|
+
}),
|
|
1898
|
+
z.object({
|
|
1899
|
+
kind: z.literal("resurging"),
|
|
1900
|
+
category: signalCategorySchema,
|
|
1901
|
+
currentCount: z.number().int().nonnegative(),
|
|
1902
|
+
daysQuiet: z.number(),
|
|
1903
|
+
currentShare: z.number()
|
|
1904
|
+
}),
|
|
1905
|
+
z.object({
|
|
1906
|
+
kind: z.literal("spike"),
|
|
1907
|
+
category: signalCategorySchema,
|
|
1908
|
+
currentCount: z.number().int().nonnegative(),
|
|
1909
|
+
previousCount: z.number().int().nonnegative(),
|
|
1910
|
+
currentShare: z.number(),
|
|
1911
|
+
previousShare: z.number(),
|
|
1912
|
+
changeRatio: z.number()
|
|
1913
|
+
}),
|
|
1914
|
+
z.object({
|
|
1915
|
+
kind: z.literal("declining"),
|
|
1916
|
+
category: signalCategorySchema,
|
|
1917
|
+
currentCount: z.number().int().nonnegative(),
|
|
1918
|
+
previousCount: z.number().int().nonnegative(),
|
|
1919
|
+
currentShare: z.number(),
|
|
1920
|
+
previousShare: z.number(),
|
|
1921
|
+
changeRatio: z.number()
|
|
1922
|
+
})
|
|
1923
|
+
]);
|
|
1924
|
+
z.discriminatedUnion("kind", [z.object({
|
|
1925
|
+
kind: z.literal("existing"),
|
|
1926
|
+
categoryId: z.string(),
|
|
1927
|
+
categoryName: z.string(),
|
|
1928
|
+
intentIds: z.array(z.string())
|
|
1929
|
+
}), z.object({
|
|
1930
|
+
kind: z.literal("new"),
|
|
1931
|
+
categoryName: z.string(),
|
|
1932
|
+
intentIds: z.array(z.string())
|
|
1933
|
+
})]);
|
|
95
1934
|
z.object({
|
|
96
1935
|
id: z.string(),
|
|
97
1936
|
teamId: z.string(),
|
|
@@ -100,23 +1939,361 @@ z.object({
|
|
|
100
1939
|
createdAt: z.coerce.date(),
|
|
101
1940
|
updatedAt: z.coerce.date()
|
|
102
1941
|
});
|
|
1942
|
+
const alpicMcpRequestLogSchema = z.object({
|
|
1943
|
+
type: z.literal("mcp_request"),
|
|
1944
|
+
method: z.string()
|
|
1945
|
+
});
|
|
1946
|
+
const alpicMcpErrorLogSchema = z.object({
|
|
1947
|
+
type: z.literal("mcp_error"),
|
|
1948
|
+
method: z.string(),
|
|
1949
|
+
error: z.string()
|
|
1950
|
+
});
|
|
1951
|
+
z.union([alpicMcpRequestLogSchema, alpicMcpErrorLogSchema]);
|
|
103
1952
|
z.enum([
|
|
104
1953
|
"INFO",
|
|
105
1954
|
"WARNING",
|
|
106
1955
|
"DEBUG",
|
|
107
1956
|
"ERROR"
|
|
108
1957
|
]);
|
|
1958
|
+
const LOG_SEARCH_MAX_ESCAPED_LENGTH = 960;
|
|
1959
|
+
function escapeLogSearchTerm(search) {
|
|
1960
|
+
return [...search].flatMap((character) => [...new TextEncoder().encode(character)]).map((byte) => {
|
|
1961
|
+
const character = String.fromCharCode(byte);
|
|
1962
|
+
return /^[a-zA-Z0-9]$/.test(character) ? character : `\\x${byte.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
1963
|
+
}).join("");
|
|
1964
|
+
}
|
|
1965
|
+
const logSearchSchema = z.string().max(240, `Search must be 240 characters or fewer`).refine((search) => escapeLogSearchTerm(search).length <= LOG_SEARCH_MAX_ESCAPED_LENGTH, "Search is too complex; shorten it or use fewer special characters");
|
|
1966
|
+
/** Only names a vendor actually ships belong here: lookalikes like `claude-code-test` are customers' own scripts. */
|
|
1967
|
+
const MCP_CLIENT_GROUPS = [
|
|
1968
|
+
{
|
|
1969
|
+
id: "claude_code",
|
|
1970
|
+
label: "Claude Code",
|
|
1971
|
+
vendor: "anthropic",
|
|
1972
|
+
rawNames: ["claude-code", "Anthropic/ClaudeCodeDesktop"]
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
id: "claude",
|
|
1976
|
+
label: "Claude",
|
|
1977
|
+
vendor: "anthropic",
|
|
1978
|
+
rawNames: [
|
|
1979
|
+
"Anthropic/ClaudeAI",
|
|
1980
|
+
"claude-ai",
|
|
1981
|
+
"claude",
|
|
1982
|
+
"Claude",
|
|
1983
|
+
"claude-desktop",
|
|
1984
|
+
"claude-desktop-3p"
|
|
1985
|
+
]
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
id: "claude_mobile",
|
|
1989
|
+
label: "Claude mobile",
|
|
1990
|
+
vendor: "anthropic",
|
|
1991
|
+
rawNames: ["claude-ios", "ClaudeAndroid"]
|
|
1992
|
+
},
|
|
1993
|
+
{
|
|
1994
|
+
id: "claude_cowork",
|
|
1995
|
+
label: "Claude Cowork",
|
|
1996
|
+
vendor: "anthropic",
|
|
1997
|
+
rawNames: ["Anthropic/Cowork"]
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
id: "claude_sheet_add_in",
|
|
2001
|
+
label: "Claude (Sheet Add-In)",
|
|
2002
|
+
vendor: "anthropic",
|
|
2003
|
+
rawNames: ["sheet-add-in"]
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
id: "claude_toolbox",
|
|
2007
|
+
label: "Claude Toolbox",
|
|
2008
|
+
vendor: "anthropic",
|
|
2009
|
+
rawNames: ["Anthropic/Toolbox", "Anthropic/toolbox-bootstrap"]
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
id: "anthropic_api",
|
|
2013
|
+
label: "Anthropic API",
|
|
2014
|
+
vendor: "anthropic",
|
|
2015
|
+
rawNames: ["Anthropic/API"]
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
id: "anthropic_connector_refresh",
|
|
2019
|
+
label: "Anthropic (connector refresh)",
|
|
2020
|
+
vendor: "anthropic",
|
|
2021
|
+
rawNames: ["Anthropic"]
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
id: "codex",
|
|
2025
|
+
label: "Codex",
|
|
2026
|
+
vendor: "openai",
|
|
2027
|
+
rawNames: [
|
|
2028
|
+
"codex-mcp-client",
|
|
2029
|
+
"codex",
|
|
2030
|
+
"Codex",
|
|
2031
|
+
"codex-cli",
|
|
2032
|
+
"openai-mcp (Codex)"
|
|
2033
|
+
]
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
id: "chatgpt",
|
|
2037
|
+
label: "ChatGPT",
|
|
2038
|
+
vendor: "openai",
|
|
2039
|
+
rawNames: ["openai-mcp", "openai-mcp (ChatGPT)"]
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
id: "openai_responses_api",
|
|
2043
|
+
label: "OpenAI Responses API",
|
|
2044
|
+
vendor: "openai",
|
|
2045
|
+
rawNames: ["openai-mcp (Responses API)"]
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
id: "openai_agent_builder",
|
|
2049
|
+
label: "OpenAI Agent Builder",
|
|
2050
|
+
vendor: "openai",
|
|
2051
|
+
rawNames: ["openai-mcp (Agent Builder)"]
|
|
2052
|
+
},
|
|
2053
|
+
{
|
|
2054
|
+
id: "cursor",
|
|
2055
|
+
label: "Cursor",
|
|
2056
|
+
vendor: "cursor",
|
|
2057
|
+
rawNames: [
|
|
2058
|
+
"cursor-vscode",
|
|
2059
|
+
"Cursor",
|
|
2060
|
+
"cursor"
|
|
2061
|
+
]
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
id: "cline",
|
|
2065
|
+
label: "Cline",
|
|
2066
|
+
vendor: "cline",
|
|
2067
|
+
rawNames: [
|
|
2068
|
+
"Cline",
|
|
2069
|
+
"cline",
|
|
2070
|
+
"@cline/core"
|
|
2071
|
+
]
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
id: "github_copilot",
|
|
2075
|
+
label: "GitHub Copilot",
|
|
2076
|
+
vendor: "githubCopilot",
|
|
2077
|
+
rawNames: [
|
|
2078
|
+
"Copilot",
|
|
2079
|
+
"github-copilot-developer",
|
|
2080
|
+
"Copilot MCP Gateway",
|
|
2081
|
+
"Xcode/copilot-xcode"
|
|
2082
|
+
]
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
id: "gemini_cli",
|
|
2086
|
+
label: "Gemini CLI",
|
|
2087
|
+
vendor: "google",
|
|
2088
|
+
rawNames: ["gemini-cli-mcp-client", "gemini-cli"]
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
id: "antigravity",
|
|
2092
|
+
label: "Antigravity",
|
|
2093
|
+
vendor: "google",
|
|
2094
|
+
rawNames: ["antigravity-client"]
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
id: "gemini",
|
|
2098
|
+
label: "Gemini",
|
|
2099
|
+
vendor: "google",
|
|
2100
|
+
rawNames: ["Gemini", "google-ai-edge-gallery"]
|
|
2101
|
+
},
|
|
2102
|
+
{
|
|
2103
|
+
id: "windsurf",
|
|
2104
|
+
label: "Windsurf",
|
|
2105
|
+
vendor: "windsurf",
|
|
2106
|
+
rawNames: ["Windsurf", "windsurf-client"]
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
id: "mistral",
|
|
2110
|
+
label: "Mistral / Le Chat",
|
|
2111
|
+
vendor: "mistral",
|
|
2112
|
+
rawNames: ["Mistral"],
|
|
2113
|
+
rawNamePrefixes: ["connector:custom-mcp:"]
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
id: "n8n",
|
|
2117
|
+
label: "n8n",
|
|
2118
|
+
vendor: "n8n",
|
|
2119
|
+
rawNames: [
|
|
2120
|
+
"@n8n/n8n-nodes-langchain.mcpClient",
|
|
2121
|
+
"@n8n/n8n-nodes-langchain.mcpClientTool",
|
|
2122
|
+
"n8n"
|
|
2123
|
+
]
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
id: "alpic_playground",
|
|
2127
|
+
label: "Alpic Playground",
|
|
2128
|
+
vendor: "alpic",
|
|
2129
|
+
rawNames: ["alpic-playground", "playground"]
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
id: "opencode",
|
|
2133
|
+
label: "opencode",
|
|
2134
|
+
vendor: "opencode",
|
|
2135
|
+
rawNames: ["opencode"]
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
id: "zed",
|
|
2139
|
+
label: "Zed",
|
|
2140
|
+
vendor: "zed",
|
|
2141
|
+
rawNames: ["Zed", "zed"]
|
|
2142
|
+
},
|
|
2143
|
+
{
|
|
2144
|
+
id: "zapier",
|
|
2145
|
+
label: "Zapier",
|
|
2146
|
+
vendor: "zapier",
|
|
2147
|
+
rawNames: ["Zapier", "zapier"]
|
|
2148
|
+
},
|
|
2149
|
+
{
|
|
2150
|
+
id: "make",
|
|
2151
|
+
label: "Make",
|
|
2152
|
+
vendor: "make",
|
|
2153
|
+
rawNames: ["Make", "make"]
|
|
2154
|
+
},
|
|
2155
|
+
{
|
|
2156
|
+
id: "librechat",
|
|
2157
|
+
label: "LibreChat",
|
|
2158
|
+
vendor: "mcp",
|
|
2159
|
+
rawNames: ["LibreChat", "librechat"]
|
|
2160
|
+
},
|
|
2161
|
+
{
|
|
2162
|
+
id: "jan",
|
|
2163
|
+
label: "Jan",
|
|
2164
|
+
vendor: "mcp",
|
|
2165
|
+
rawNames: ["Jan", "jan"]
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
id: "goose",
|
|
2169
|
+
label: "goose",
|
|
2170
|
+
vendor: "mcp",
|
|
2171
|
+
rawNames: ["goose", "Goose"]
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
id: "mcphost",
|
|
2175
|
+
label: "mcphost",
|
|
2176
|
+
vendor: "mcp",
|
|
2177
|
+
rawNames: ["mcphost"]
|
|
2178
|
+
},
|
|
2179
|
+
{
|
|
2180
|
+
id: "mcporter",
|
|
2181
|
+
label: "mcporter",
|
|
2182
|
+
vendor: "mcp",
|
|
2183
|
+
rawNames: ["mcporter"]
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
id: "rmcp",
|
|
2187
|
+
label: "rmcp",
|
|
2188
|
+
vendor: "mcp",
|
|
2189
|
+
rawNames: ["rmcp"]
|
|
2190
|
+
},
|
|
2191
|
+
{
|
|
2192
|
+
id: "unnamed_client",
|
|
2193
|
+
label: "Unnamed client",
|
|
2194
|
+
vendor: "mcp",
|
|
2195
|
+
rawNames: [
|
|
2196
|
+
"mcp",
|
|
2197
|
+
"unknown",
|
|
2198
|
+
""
|
|
2199
|
+
]
|
|
2200
|
+
}
|
|
2201
|
+
];
|
|
2202
|
+
/** A source pattern, not a RegExp, because analytics renders the same rule into ClickHouse RE2, which shares this syntax. */
|
|
2203
|
+
const MCP_REMOTE_WRAPPER_SUFFIX = String.raw` \(via mcp-remote [^\n]+?\)$`;
|
|
2204
|
+
new RegExp(MCP_REMOTE_WRAPPER_SUFFIX);
|
|
2205
|
+
new Map(MCP_CLIENT_GROUPS.map((group) => [group.id, group]));
|
|
109
2206
|
const runtimeSchema = z.enum([
|
|
110
2207
|
"python3.13",
|
|
111
2208
|
"python3.14",
|
|
2209
|
+
"python3.15",
|
|
112
2210
|
"node22",
|
|
113
|
-
"node24"
|
|
2211
|
+
"node24",
|
|
2212
|
+
"node26"
|
|
114
2213
|
]);
|
|
115
2214
|
const transportSchema = z.enum([
|
|
116
2215
|
"stdio",
|
|
117
2216
|
"sse",
|
|
118
2217
|
"streamablehttp"
|
|
119
2218
|
]);
|
|
2219
|
+
z.object({
|
|
2220
|
+
id: z.string(),
|
|
2221
|
+
name: z.string(),
|
|
2222
|
+
teamId: z.string(),
|
|
2223
|
+
sourceRepository: z.string().nullable(),
|
|
2224
|
+
createdAt: z.coerce.date().optional(),
|
|
2225
|
+
runtime: runtimeSchema,
|
|
2226
|
+
transport: transportSchema.nullable(),
|
|
2227
|
+
rootDirectory: z.string().nullable(),
|
|
2228
|
+
installCommand: z.string().nullable(),
|
|
2229
|
+
buildCommand: z.string().nullable(),
|
|
2230
|
+
buildOutputDir: z.string().nullable(),
|
|
2231
|
+
startCommand: z.string().nullable(),
|
|
2232
|
+
fixedOutboundIp: z.boolean(),
|
|
2233
|
+
environments: z.array(environmentWithDomainsSchema),
|
|
2234
|
+
productionEnvironment: environmentWithDomainsSchema.nullable()
|
|
2235
|
+
});
|
|
2236
|
+
const domainFailureReasonSchema = z.enum([
|
|
2237
|
+
"caa",
|
|
2238
|
+
"dns",
|
|
2239
|
+
"invalid_domain",
|
|
2240
|
+
"other"
|
|
2241
|
+
]);
|
|
2242
|
+
const projectDomainMappingSchema = z.object({
|
|
2243
|
+
pathPrefix: z.string(),
|
|
2244
|
+
environment: environmentSchema$1
|
|
2245
|
+
});
|
|
2246
|
+
z.object({
|
|
2247
|
+
name: z.string(),
|
|
2248
|
+
createdAt: z.coerce.date(),
|
|
2249
|
+
status: z.enum([
|
|
2250
|
+
"ongoing",
|
|
2251
|
+
"deployed",
|
|
2252
|
+
"failed"
|
|
2253
|
+
]),
|
|
2254
|
+
failureReason: domainFailureReasonSchema.nullable(),
|
|
2255
|
+
environment: environmentSchema$1,
|
|
2256
|
+
mappings: z.array(projectDomainMappingSchema)
|
|
2257
|
+
});
|
|
2258
|
+
const serverFieldsSchema$1 = z.object({
|
|
2259
|
+
$schema: z.string(),
|
|
2260
|
+
name: z.string(),
|
|
2261
|
+
description: z.string(),
|
|
2262
|
+
version: z.string().optional(),
|
|
2263
|
+
title: z.string().optional(),
|
|
2264
|
+
websiteUrl: z.string().optional(),
|
|
2265
|
+
icons: z.array(z.object({
|
|
2266
|
+
src: z.string(),
|
|
2267
|
+
mimeType: z.string().optional(),
|
|
2268
|
+
sizes: z.array(z.string()).optional()
|
|
2269
|
+
})).optional(),
|
|
2270
|
+
remotes: z.array(z.object({
|
|
2271
|
+
type: z.string(),
|
|
2272
|
+
url: z.string().optional(),
|
|
2273
|
+
headers: z.array(z.object({
|
|
2274
|
+
name: z.string(),
|
|
2275
|
+
description: z.string(),
|
|
2276
|
+
isRequired: z.boolean().optional(),
|
|
2277
|
+
isSecret: z.boolean().optional()
|
|
2278
|
+
})).optional()
|
|
2279
|
+
})).optional()
|
|
2280
|
+
}).catchall(z.unknown());
|
|
2281
|
+
z.object({
|
|
2282
|
+
serverFields: serverFieldsSchema$1,
|
|
2283
|
+
source: z.enum(["registry", "defaults"])
|
|
2284
|
+
});
|
|
2285
|
+
/** Clamps instead of rejecting on max-length overflow (for AI-generated copy that overshoots); intentionally carries over only maxLength, minLength, and description, dropping any other validators. */
|
|
2286
|
+
const clampStringField = (field) => {
|
|
2287
|
+
const max = field.maxLength;
|
|
2288
|
+
if (max === null) return field;
|
|
2289
|
+
const clamped = z.string().overwrite((value) => value.slice(0, max)).max(max);
|
|
2290
|
+
const withMin = field.minLength === null ? clamped : clamped.min(field.minLength);
|
|
2291
|
+
return field.description ? withMin.describe(field.description) : withMin;
|
|
2292
|
+
};
|
|
2293
|
+
const unboundedArrayField = (field) => {
|
|
2294
|
+
const unbounded = z.array(field.element);
|
|
2295
|
+
return field.description ? unbounded.describe(field.description) : unbounded;
|
|
2296
|
+
};
|
|
120
2297
|
const toolDefinitionSchema = z.object({
|
|
121
2298
|
name: z.string(),
|
|
122
2299
|
title: z.string().optional().describe("Human-friendly name for the tool, used in the UI. If not provided, `name` will be used."),
|
|
@@ -129,13 +2306,31 @@ const toolDefinitionSchema = z.object({
|
|
|
129
2306
|
}).optional()
|
|
130
2307
|
});
|
|
131
2308
|
const positiveTestCaseSchema = z.object({
|
|
132
|
-
scenario: z.string(),
|
|
133
|
-
userPrompt: z.string(),
|
|
134
|
-
toolTriggered: z.string().optional(),
|
|
135
|
-
expectedOutput: z.string().optional()
|
|
136
|
-
}).
|
|
2309
|
+
scenario: z.string().min(1).describe("Short label for what this case demonstrates."),
|
|
2310
|
+
userPrompt: z.string().min(1).describe("A realistic, standalone user message a reviewer can paste and run with no prior state or multi-turn setup. Vary phrasing and tone across cases."),
|
|
2311
|
+
toolTriggered: z.string().optional().describe("The tool this prompt should invoke."),
|
|
2312
|
+
expectedOutput: z.string().optional().describe("What the user should see, including post-interaction behaviour where relevant.")
|
|
2313
|
+
}).describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
|
|
2314
|
+
const positiveTestCaseDraftSchema = positiveTestCaseSchema.partial().extend({
|
|
2315
|
+
scenario: z.string().optional(),
|
|
2316
|
+
userPrompt: z.string().optional()
|
|
2317
|
+
});
|
|
2318
|
+
const blankPositiveTestCase = () => ({
|
|
2319
|
+
scenario: "",
|
|
2320
|
+
userPrompt: "",
|
|
2321
|
+
toolTriggered: "",
|
|
2322
|
+
expectedOutput: ""
|
|
2323
|
+
});
|
|
2324
|
+
const toFixedLength = (entries, length, blank) => Array.from({ length }, (_, index) => entries[index] ?? blank());
|
|
2325
|
+
const screenshotEntrySchema = z.object({
|
|
2326
|
+
prompt: z.string(),
|
|
2327
|
+
url: z.url()
|
|
2328
|
+
}).describe("Each screenshot: the user prompt that produced it + the image URL.");
|
|
2329
|
+
const screenshotDraftEntrySchema = screenshotEntrySchema.extend({ url: z.string() });
|
|
137
2330
|
/** Accepts either a valid email or URL. */
|
|
138
2331
|
const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
|
|
2332
|
+
/** A URL field whose error spells out that the scheme is required. */
|
|
2333
|
+
const urlField = z.url({ error: "Enter a full URL including https:// (e.g. https://example.com)" });
|
|
139
2334
|
const chatgptCategorySchema = z.enum([
|
|
140
2335
|
"BUSINESS",
|
|
141
2336
|
"COLLABORATION",
|
|
@@ -152,68 +2347,387 @@ const chatgptCategorySchema = z.enum([
|
|
|
152
2347
|
"TRAVEL"
|
|
153
2348
|
]);
|
|
154
2349
|
const chatgptAuthenticationSchema = z.enum(["No auth needed", "OAuth 2.0"]);
|
|
155
|
-
const
|
|
2350
|
+
const chatgptCountryCodeSchema = z.enum([
|
|
2351
|
+
"AD",
|
|
2352
|
+
"AE",
|
|
2353
|
+
"AF",
|
|
2354
|
+
"AG",
|
|
2355
|
+
"AL",
|
|
2356
|
+
"AM",
|
|
2357
|
+
"AO",
|
|
2358
|
+
"AR",
|
|
2359
|
+
"AT",
|
|
2360
|
+
"AU",
|
|
2361
|
+
"AW",
|
|
2362
|
+
"AX",
|
|
2363
|
+
"AZ",
|
|
2364
|
+
"BA",
|
|
2365
|
+
"BB",
|
|
2366
|
+
"BD",
|
|
2367
|
+
"BE",
|
|
2368
|
+
"BF",
|
|
2369
|
+
"BG",
|
|
2370
|
+
"BH",
|
|
2371
|
+
"BI",
|
|
2372
|
+
"BJ",
|
|
2373
|
+
"BL",
|
|
2374
|
+
"BM",
|
|
2375
|
+
"BN",
|
|
2376
|
+
"BO",
|
|
2377
|
+
"BR",
|
|
2378
|
+
"BS",
|
|
2379
|
+
"BT",
|
|
2380
|
+
"BW",
|
|
2381
|
+
"BZ",
|
|
2382
|
+
"CA",
|
|
2383
|
+
"CD",
|
|
2384
|
+
"CF",
|
|
2385
|
+
"CG",
|
|
2386
|
+
"CH",
|
|
2387
|
+
"CI",
|
|
2388
|
+
"CL",
|
|
2389
|
+
"CM",
|
|
2390
|
+
"CO",
|
|
2391
|
+
"CR",
|
|
2392
|
+
"CV",
|
|
2393
|
+
"CY",
|
|
2394
|
+
"CZ",
|
|
2395
|
+
"DE",
|
|
2396
|
+
"DJ",
|
|
2397
|
+
"DK",
|
|
2398
|
+
"DM",
|
|
2399
|
+
"DO",
|
|
2400
|
+
"DZ",
|
|
2401
|
+
"EC",
|
|
2402
|
+
"EE",
|
|
2403
|
+
"EG",
|
|
2404
|
+
"ER",
|
|
2405
|
+
"ES",
|
|
2406
|
+
"ET",
|
|
2407
|
+
"FI",
|
|
2408
|
+
"FJ",
|
|
2409
|
+
"FM",
|
|
2410
|
+
"FO",
|
|
2411
|
+
"FR",
|
|
2412
|
+
"GA",
|
|
2413
|
+
"GB",
|
|
2414
|
+
"GD",
|
|
2415
|
+
"GE",
|
|
2416
|
+
"GF",
|
|
2417
|
+
"GH",
|
|
2418
|
+
"GL",
|
|
2419
|
+
"GM",
|
|
2420
|
+
"GN",
|
|
2421
|
+
"GP",
|
|
2422
|
+
"GQ",
|
|
2423
|
+
"GR",
|
|
2424
|
+
"GT",
|
|
2425
|
+
"GW",
|
|
2426
|
+
"GY",
|
|
2427
|
+
"HN",
|
|
2428
|
+
"HR",
|
|
2429
|
+
"HT",
|
|
2430
|
+
"HU",
|
|
2431
|
+
"ID",
|
|
2432
|
+
"IE",
|
|
2433
|
+
"IL",
|
|
2434
|
+
"IN",
|
|
2435
|
+
"IQ",
|
|
2436
|
+
"IS",
|
|
2437
|
+
"IT",
|
|
2438
|
+
"JM",
|
|
2439
|
+
"JO",
|
|
2440
|
+
"JP",
|
|
2441
|
+
"KE",
|
|
2442
|
+
"KG",
|
|
2443
|
+
"KH",
|
|
2444
|
+
"KI",
|
|
2445
|
+
"KM",
|
|
2446
|
+
"KN",
|
|
2447
|
+
"KR",
|
|
2448
|
+
"KW",
|
|
2449
|
+
"KY",
|
|
2450
|
+
"KZ",
|
|
2451
|
+
"LA",
|
|
2452
|
+
"LB",
|
|
2453
|
+
"LC",
|
|
2454
|
+
"LI",
|
|
2455
|
+
"LK",
|
|
2456
|
+
"LR",
|
|
2457
|
+
"LS",
|
|
2458
|
+
"LT",
|
|
2459
|
+
"LU",
|
|
2460
|
+
"LV",
|
|
2461
|
+
"LY",
|
|
2462
|
+
"MA",
|
|
2463
|
+
"MC",
|
|
2464
|
+
"MD",
|
|
2465
|
+
"ME",
|
|
2466
|
+
"MF",
|
|
2467
|
+
"MG",
|
|
2468
|
+
"MH",
|
|
2469
|
+
"MK",
|
|
2470
|
+
"ML",
|
|
2471
|
+
"MM",
|
|
2472
|
+
"MN",
|
|
2473
|
+
"MQ",
|
|
2474
|
+
"MR",
|
|
2475
|
+
"MT",
|
|
2476
|
+
"MU",
|
|
2477
|
+
"MV",
|
|
2478
|
+
"MW",
|
|
2479
|
+
"MX",
|
|
2480
|
+
"MY",
|
|
2481
|
+
"MZ",
|
|
2482
|
+
"NA",
|
|
2483
|
+
"NC",
|
|
2484
|
+
"NE",
|
|
2485
|
+
"NG",
|
|
2486
|
+
"NI",
|
|
2487
|
+
"NL",
|
|
2488
|
+
"NO",
|
|
2489
|
+
"NP",
|
|
2490
|
+
"NR",
|
|
2491
|
+
"NZ",
|
|
2492
|
+
"OM",
|
|
2493
|
+
"PA",
|
|
2494
|
+
"PE",
|
|
2495
|
+
"PF",
|
|
2496
|
+
"PG",
|
|
2497
|
+
"PH",
|
|
2498
|
+
"PK",
|
|
2499
|
+
"PL",
|
|
2500
|
+
"PM",
|
|
2501
|
+
"PS",
|
|
2502
|
+
"PT",
|
|
2503
|
+
"PW",
|
|
2504
|
+
"PY",
|
|
2505
|
+
"QA",
|
|
2506
|
+
"RE",
|
|
2507
|
+
"RO",
|
|
2508
|
+
"RS",
|
|
2509
|
+
"RW",
|
|
2510
|
+
"SA",
|
|
2511
|
+
"SB",
|
|
2512
|
+
"SC",
|
|
2513
|
+
"SD",
|
|
2514
|
+
"SE",
|
|
2515
|
+
"SG",
|
|
2516
|
+
"SH",
|
|
2517
|
+
"SI",
|
|
2518
|
+
"SJ",
|
|
2519
|
+
"SK",
|
|
2520
|
+
"SL",
|
|
2521
|
+
"SM",
|
|
2522
|
+
"SN",
|
|
2523
|
+
"SO",
|
|
2524
|
+
"SR",
|
|
2525
|
+
"SS",
|
|
2526
|
+
"ST",
|
|
2527
|
+
"SV",
|
|
2528
|
+
"SZ",
|
|
2529
|
+
"TD",
|
|
2530
|
+
"TF",
|
|
2531
|
+
"TG",
|
|
2532
|
+
"TH",
|
|
2533
|
+
"TJ",
|
|
2534
|
+
"TL",
|
|
2535
|
+
"TM",
|
|
2536
|
+
"TN",
|
|
2537
|
+
"TO",
|
|
2538
|
+
"TR",
|
|
2539
|
+
"TT",
|
|
2540
|
+
"TV",
|
|
2541
|
+
"TW",
|
|
2542
|
+
"TZ",
|
|
2543
|
+
"UA",
|
|
2544
|
+
"UG",
|
|
2545
|
+
"US",
|
|
2546
|
+
"UY",
|
|
2547
|
+
"UZ",
|
|
2548
|
+
"VA",
|
|
2549
|
+
"VC",
|
|
2550
|
+
"VN",
|
|
2551
|
+
"VU",
|
|
2552
|
+
"WF",
|
|
2553
|
+
"WS",
|
|
2554
|
+
"YE",
|
|
2555
|
+
"YT",
|
|
2556
|
+
"ZA",
|
|
2557
|
+
"ZM",
|
|
2558
|
+
"ZW"
|
|
2559
|
+
]);
|
|
2560
|
+
const chatgptAllowedCountriesSchema = z.discriminatedUnion("mode", [
|
|
2561
|
+
z.object({ mode: z.literal("all") }),
|
|
2562
|
+
z.object({
|
|
2563
|
+
mode: z.literal("allow"),
|
|
2564
|
+
countries: z.array(chatgptCountryCodeSchema)
|
|
2565
|
+
}),
|
|
2566
|
+
z.object({
|
|
2567
|
+
mode: z.literal("block"),
|
|
2568
|
+
countries: z.array(chatgptCountryCodeSchema)
|
|
2569
|
+
})
|
|
2570
|
+
]);
|
|
2571
|
+
const chatgptTranslationLocaleSchema = z.enum([
|
|
2572
|
+
"am",
|
|
2573
|
+
"ar",
|
|
2574
|
+
"bg-BG",
|
|
2575
|
+
"bn-BD",
|
|
2576
|
+
"bs-BA",
|
|
2577
|
+
"ca-ES",
|
|
2578
|
+
"cs-CZ",
|
|
2579
|
+
"da-DK",
|
|
2580
|
+
"de-DE",
|
|
2581
|
+
"el-GR",
|
|
2582
|
+
"es-419",
|
|
2583
|
+
"es-ES",
|
|
2584
|
+
"et-EE",
|
|
2585
|
+
"fi-FI",
|
|
2586
|
+
"fr-CA",
|
|
2587
|
+
"fr-FR",
|
|
2588
|
+
"gu-IN",
|
|
2589
|
+
"hi-IN",
|
|
2590
|
+
"hr-HR",
|
|
2591
|
+
"hu-HU",
|
|
2592
|
+
"hy-AM",
|
|
2593
|
+
"id-ID",
|
|
2594
|
+
"is-IS",
|
|
2595
|
+
"it-IT",
|
|
2596
|
+
"ja-JP",
|
|
2597
|
+
"ka-GE",
|
|
2598
|
+
"kk",
|
|
2599
|
+
"kn-IN",
|
|
2600
|
+
"ko-KR",
|
|
2601
|
+
"lt",
|
|
2602
|
+
"lv-LV",
|
|
2603
|
+
"mk-MK",
|
|
2604
|
+
"ml",
|
|
2605
|
+
"mn",
|
|
2606
|
+
"mr-IN",
|
|
2607
|
+
"ms-MY",
|
|
2608
|
+
"my-MM",
|
|
2609
|
+
"nb-NO",
|
|
2610
|
+
"nl-NL",
|
|
2611
|
+
"pa",
|
|
2612
|
+
"pl-PL",
|
|
2613
|
+
"pt-BR",
|
|
2614
|
+
"pt-PT",
|
|
2615
|
+
"ro-RO",
|
|
2616
|
+
"ru-RU",
|
|
2617
|
+
"sk-SK",
|
|
2618
|
+
"sl-SI",
|
|
2619
|
+
"so-SO",
|
|
2620
|
+
"sq-AL",
|
|
2621
|
+
"sr-RS",
|
|
2622
|
+
"sv-SE",
|
|
2623
|
+
"sw-TZ",
|
|
2624
|
+
"ta-IN",
|
|
2625
|
+
"te-IN",
|
|
2626
|
+
"th-TH",
|
|
2627
|
+
"tl",
|
|
2628
|
+
"tr-TR",
|
|
2629
|
+
"uk-UA",
|
|
2630
|
+
"ur",
|
|
2631
|
+
"vi-VN",
|
|
2632
|
+
"zh-CN",
|
|
2633
|
+
"zh-HK",
|
|
2634
|
+
"zh-TW"
|
|
2635
|
+
]);
|
|
156
2636
|
const negativeTestCaseSchema = z.object({
|
|
157
|
-
scenario: z.string(),
|
|
158
|
-
userPrompt: z.string()
|
|
159
|
-
}).
|
|
2637
|
+
scenario: z.string().min(1),
|
|
2638
|
+
userPrompt: z.string().min(1)
|
|
2639
|
+
}).describe("Each case: Scenario + User prompt (the plugin should NOT trigger).");
|
|
2640
|
+
const negativeTestCaseDraftSchema = negativeTestCaseSchema.partial().extend({
|
|
2641
|
+
scenario: z.string().optional(),
|
|
2642
|
+
userPrompt: z.string().optional()
|
|
2643
|
+
});
|
|
2644
|
+
const blankNegativeTestCase = () => ({
|
|
2645
|
+
scenario: "",
|
|
2646
|
+
userPrompt: ""
|
|
2647
|
+
});
|
|
2648
|
+
const chatgptSkillSchema = z.object({ name: z.string() }).describe("A skill discovered on the MCP server, by name.");
|
|
160
2649
|
const chatgptToolJustificationSchema = z.object({
|
|
161
2650
|
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).");
|
|
2651
|
+
readOnlyJustification: z.string().describe("One sentence on what the tool reads and returns."),
|
|
2652
|
+
openWorldJustification: z.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
2653
|
+
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.\"")
|
|
2654
|
+
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
2655
|
+
/** Defined once and reused by both the submission form and per-locale translations so the tagline ≤ 30 chars constraint never drifts. */
|
|
2656
|
+
const chatgptTaglineSchema = z.string().max(30);
|
|
2657
|
+
const chatgptDescriptionSchema = z.string();
|
|
166
2658
|
const chatgptTranslationSchema = z.object({
|
|
167
|
-
locale:
|
|
168
|
-
tagline:
|
|
169
|
-
description:
|
|
2659
|
+
locale: chatgptTranslationLocaleSchema,
|
|
2660
|
+
tagline: chatgptTaglineSchema,
|
|
2661
|
+
description: chatgptDescriptionSchema
|
|
170
2662
|
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
174
|
-
*/
|
|
2663
|
+
chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
2664
|
+
/** Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section; keep it in sync with the sheet. */
|
|
175
2665
|
const chatgptSubmissionFormDataSchema = z.object({
|
|
176
2666
|
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("
|
|
178
|
-
appName: z.string().describe("The name users will see in ChatGPT and in the
|
|
179
|
-
tagline:
|
|
180
|
-
description:
|
|
2667
|
+
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."),
|
|
2668
|
+
appName: z.string().describe("The name users will see in ChatGPT and in the Plugin Directory."),
|
|
2669
|
+
tagline: chatgptTaglineSchema.describe("Plain-language phrase focused on function and user value, 30 chars max. Avoid generic superlatives like \"the best …\"."),
|
|
2670
|
+
description: chatgptDescriptionSchema.describe("Clear, engaging description highlighting what the plugin does and why people will love it. Appears publicly on the directory page. End it by naming the product categories or intents the plugin does NOT cover, so ChatGPT learns when not to route to it (define exclusions by absent categories or wrong intents, never by naming other brands)."),
|
|
181
2671
|
category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
|
|
182
|
-
developerName: z.string().describe("Developer name shown publicly on the
|
|
183
|
-
companyUrl:
|
|
2672
|
+
developerName: z.string().describe("Developer name shown publicly on the plugin's directory page."),
|
|
2673
|
+
companyUrl: urlField.describe("Your company's main website URL."),
|
|
184
2674
|
supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
|
|
185
|
-
privacyPolicyUrl:
|
|
186
|
-
termsOfServiceUrl:
|
|
187
|
-
demoRecordingUrl:
|
|
188
|
-
appCommerceAndPurchasing: z.boolean().describe("Checkbox: 'My
|
|
189
|
-
serverUrl:
|
|
2675
|
+
privacyPolicyUrl: urlField.describe("URL to your privacy policy."),
|
|
2676
|
+
termsOfServiceUrl: urlField.describe("URL to the plugin's terms of service."),
|
|
2677
|
+
demoRecordingUrl: urlField.describe("URL to a video demonstrating the plugin, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
|
|
2678
|
+
appCommerceAndPurchasing: z.boolean().describe("Checkbox: 'My plugin links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the plugin does not offer digital goods."),
|
|
2679
|
+
serverUrl: urlField.describe("URL of the MCP server."),
|
|
190
2680
|
authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
|
|
191
2681
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
2682
|
+
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."),
|
|
2683
|
+
skills: z.array(chatgptSkillSchema).optional().describe("Skills the server exposes over MCP (auto-populated from the production server's manifest). Left unset when the server does not advertise the skills extension, which is a different state from advertising it and exposing none."),
|
|
2684
|
+
testCases: z.array(positiveTestCaseSchema).length(5).describe("Exactly 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output. Collectively cover the full capability across different flow stages (initial search or browse, market or locale handling, post-interaction detail, an action ChatGPT performs on the user's behalf, and a conversion or secondary tool) rather than five variations of the same first step."),
|
|
2685
|
+
negativeTestCases: z.array(negativeTestCaseSchema).length(3).describe("Exactly 3 negative test cases: prompts where the plugin should NOT trigger but the model might think it is relevant. These become production routing metadata that teaches ChatGPT when to stay silent, so pick tight near-misses: a product category the plugin does not carry, the right brand or domain but an intent the plugin does not serve, or a boundary with a sibling plugin."),
|
|
2686
|
+
screenshots: z.array(screenshotEntrySchema.extend({ prompt: z.string().max(75, { error: "Screenshot prompts are limited to 75 characters." }) })).max(3).describe("In-plugin screenshots paired with the user prompt that produced them (each prompt is 75 characters max). Widget plugins must show the widget UI; non-widget plugins show the model response. Min 1, max 3 entries, all public. Images: 706px wide, 400–860px tall, PNG."),
|
|
196
2687
|
translations: z.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
|
|
197
|
-
allowedCountries: chatgptAllowedCountriesSchema.describe("
|
|
198
|
-
releaseNotes: z.string().describe("Publicly displayed on the
|
|
2688
|
+
allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
|
|
2689
|
+
releaseNotes: z.string().describe("Publicly displayed on the plugin details page.")
|
|
2690
|
+
});
|
|
2691
|
+
const chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
|
|
2692
|
+
tagline: z.string().optional(),
|
|
2693
|
+
companyUrl: z.string().optional(),
|
|
2694
|
+
supportChannel: z.string().optional(),
|
|
2695
|
+
privacyPolicyUrl: z.string().optional(),
|
|
2696
|
+
termsOfServiceUrl: z.string().optional(),
|
|
2697
|
+
demoRecordingUrl: z.string().optional(),
|
|
2698
|
+
serverUrl: z.string().optional(),
|
|
2699
|
+
screenshots: z.array(screenshotDraftEntrySchema).optional(),
|
|
2700
|
+
testCases: z.array(positiveTestCaseDraftSchema).optional(),
|
|
2701
|
+
negativeTestCases: z.array(negativeTestCaseDraftSchema).optional(),
|
|
2702
|
+
translations: z.array(chatgptTranslationSchema.extend({ tagline: z.string() })).optional()
|
|
199
2703
|
});
|
|
200
|
-
|
|
2704
|
+
/** Source of truth for the fields `SubmissionPrefillService.prefill({ platform: "chatgpt" })` can populate. */
|
|
2705
|
+
const chatgptPrefillFormDataSchema = chatgptSubmissionFormDataSchema.pick({
|
|
201
2706
|
appName: true,
|
|
202
2707
|
developerName: true,
|
|
203
2708
|
serverUrl: true,
|
|
204
2709
|
tools: true,
|
|
2710
|
+
skills: true,
|
|
205
2711
|
authentication: true
|
|
206
2712
|
});
|
|
207
|
-
|
|
2713
|
+
/** Source of truth for `SubmissionPrefillService.generate({ platform: "chatgpt" })`. */
|
|
2714
|
+
const chatgptAiGeneratedFormDataSchema = chatgptSubmissionFormDataSchema.pick({
|
|
208
2715
|
tagline: true,
|
|
209
2716
|
description: true,
|
|
210
2717
|
category: true,
|
|
211
2718
|
testCases: true,
|
|
212
2719
|
negativeTestCases: true,
|
|
213
2720
|
toolJustifications: true
|
|
2721
|
+
}).extend({
|
|
2722
|
+
testCases: unboundedArrayField(chatgptSubmissionFormDataSchema.shape.testCases),
|
|
2723
|
+
negativeTestCases: unboundedArrayField(chatgptSubmissionFormDataSchema.shape.negativeTestCases)
|
|
2724
|
+
}).extend({
|
|
2725
|
+
tagline: clampStringField(chatgptSubmissionFormDataSchema.shape.tagline),
|
|
2726
|
+
testCases: z.array(positiveTestCaseDraftSchema).transform((cases) => toFixedLength(cases, 5, blankPositiveTestCase)),
|
|
2727
|
+
negativeTestCases: z.array(negativeTestCaseDraftSchema).transform((cases) => toFixedLength(cases, 3, blankNegativeTestCase))
|
|
214
2728
|
});
|
|
215
2729
|
const claudeCategorySchema = z.enum([
|
|
216
|
-
"
|
|
2730
|
+
"Productivity",
|
|
217
2731
|
"Communication",
|
|
218
2732
|
"Data & Analytics",
|
|
219
2733
|
"Development tools",
|
|
@@ -221,212 +2735,311 @@ const claudeCategorySchema = z.enum([
|
|
|
221
2735
|
"Consumer Health",
|
|
222
2736
|
"Health & Life Sciences",
|
|
223
2737
|
"Media & Entertainment",
|
|
224
|
-
"Commerce & Shopping"
|
|
2738
|
+
"Commerce & Shopping",
|
|
2739
|
+
"Legal",
|
|
2740
|
+
"Sales and marketing",
|
|
2741
|
+
"Creative",
|
|
2742
|
+
"Nonprofit",
|
|
2743
|
+
"Education",
|
|
2744
|
+
"Other"
|
|
225
2745
|
]);
|
|
226
|
-
|
|
227
|
-
"No auth needed",
|
|
228
|
-
"OAuth 2.0",
|
|
229
|
-
"Custom URL"
|
|
230
|
-
]);
|
|
231
|
-
const claudeMcpUrlTypeSchema = z.enum(["Universal URL", "Custom MCP URLs"]);
|
|
232
|
-
z.enum(["Static OAuth Client", "Dynamic OAuth Client (DCR / CIMD)"]);
|
|
2746
|
+
const claudeCategoryDescription = `The categories used to filter connectors in the directory UI. Select up to 5 that best describe your connector.`;
|
|
233
2747
|
const claudeReadWriteCapabilitiesSchema = z.enum([
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
2748
|
+
"read_only",
|
|
2749
|
+
"write_only",
|
|
2750
|
+
"read_write"
|
|
237
2751
|
]);
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
244
|
-
"N/A"
|
|
2752
|
+
const claudeAuthenticationSchema = z.enum([
|
|
2753
|
+
"oauth_dcr",
|
|
2754
|
+
"oauth_cimd",
|
|
2755
|
+
"oauth_anthropic_creds",
|
|
2756
|
+
"custom_connection",
|
|
2757
|
+
"none"
|
|
245
2758
|
]);
|
|
246
|
-
const
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"GDPR compliant (if applicable)"
|
|
2759
|
+
const claudeApiOwnershipSchema = z.enum([
|
|
2760
|
+
"first_party",
|
|
2761
|
+
"proxied",
|
|
2762
|
+
"third_party"
|
|
251
2763
|
]);
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
"
|
|
255
|
-
"
|
|
2764
|
+
const claudeYesNoOtherSchema = z.union([z.boolean(), z.object({ other: z.string() })]);
|
|
2765
|
+
const claudePolicyAcknowledgementSchema = z.enum([
|
|
2766
|
+
"I have read and understand the MCP Directory developer guidelines.",
|
|
2767
|
+
"My server calls our own first-party APIs (or APIs we legitimately proxy with permission).",
|
|
2768
|
+
"My connector does not transfer money, cryptocurrency, or other financial assets on a user's behalf.",
|
|
2769
|
+
"My connector does not use AI models to generate images, video, or audio.",
|
|
2770
|
+
"Tool descriptions contain no instructions about model behavior, other tools, or external instruction sources, and no hidden or encoded text.",
|
|
2771
|
+
"My connector does not collect conversation data beyond what is needed for its function.",
|
|
2772
|
+
"Public documentation for this connector will be live by the publish date."
|
|
256
2773
|
]);
|
|
257
|
-
/**
|
|
258
|
-
* Field order mirrors the Claude (Anthropic) submission spreadsheet, grouped by section.
|
|
259
|
-
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
260
|
-
*/
|
|
2774
|
+
/** Field order mirrors the claude.ai directory submission wizard (`claude.ai/admin-settings/directory/submissions/new`), grouped by step; keep it in sync with the wizard. */
|
|
261
2775
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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.`)
|
|
389
|
-
});
|
|
390
|
-
claudeSubmissionFormDataSchema.pick({
|
|
391
|
-
companyName: true,
|
|
392
|
-
appName: true,
|
|
393
|
-
mcpUrlType: true,
|
|
2776
|
+
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
|
|
2777
|
+
from the custom connector you select — the connection is used to verify the URL and the tool list at submission time.
|
|
2778
|
+
The server must be publicly accessible without VPN or whitelisting.`),
|
|
2779
|
+
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
|
|
2780
|
+
own or have the right to use this name. Max 100 characters.`),
|
|
2781
|
+
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.
|
|
2782
|
+
PERMANENT after submission — it cannot be changed. Pre-filled from the name. Max 50 characters.`),
|
|
2783
|
+
oneLiner: z.string().max(200).describe(`A short tagline shown below your connector name in the directory listing. Max 200 characters. Avoid generic
|
|
2784
|
+
phrases like 'The best MCP server for...'. Example: 'Manage tasks and projects in Linear'.`),
|
|
2785
|
+
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
|
|
2786
|
+
claude.ai. Write it from a user perspective and be specific. Max 2000 characters.`),
|
|
2787
|
+
categories: z.array(claudeCategorySchema).max(5).describe(claudeCategoryDescription),
|
|
2788
|
+
iconUrl: z.url().optional().describe(`Optional custom icon for the directory listing — a square SVG. By default the favicon from your MCP URL is used
|
|
2789
|
+
(recommended); upload a custom icon only to override it.`),
|
|
2790
|
+
documentation: z.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. Must be publicly
|
|
2791
|
+
accessible without login. IT admins often review these when deciding whether to approve a server. Required to be live
|
|
2792
|
+
by your publish date.`),
|
|
2793
|
+
support: supportChannelSchema.describe(`A support URL or email address where users can get help with your connector. Displayed in the directory listing and
|
|
2794
|
+
used to notify you of security or compliance issues, so make sure it's actively monitored.`),
|
|
2795
|
+
privacyPolicy: z.url().describe(`URL to your privacy policy. Mandatory and displayed in the directory listing. Must be publicly accessible and cover
|
|
2796
|
+
what data you collect, how you use and store it, and whether you share it with third parties.`),
|
|
2797
|
+
screenshots: z.array(screenshotEntrySchema).optional().describe(`Carousel images shown on your connector's directory page (PNG). Each is paired with the user prompt that produced
|
|
2798
|
+
it. This is editable on the directory page only after the connector is submitted — optional here so you can prepare it.`),
|
|
2799
|
+
primaryUseCases: z.string().describe(`Describe the main tasks users will accomplish with this connector, and include a few example prompts a user might
|
|
2800
|
+
type. These may be shown publicly but are primarily used for internal review — reviewers test your server using them.`),
|
|
2801
|
+
connectionRequirements: z.string().describe(`What accounts, permissions, or setup a user needs before connecting (e.g. 'Requires a paid Acme account with admin
|
|
2802
|
+
permissions'). If there are genuinely no special requirements, say so explicitly.`),
|
|
2803
|
+
readWriteCapabilities: claudeReadWriteCapabilitiesSchema.describe(`What your server can do:
|
|
2804
|
+
• 'read_only': retrieves data but never modifies it.
|
|
2805
|
+
• 'write_only': creates or modifies data but does not read it.
|
|
2806
|
+
• 'read_write': both retrieves and modifies data (most common).`),
|
|
2807
|
+
companyName: z.string().describe("The company or organization behind this connector — its legal name or publicly known product name."),
|
|
2808
|
+
companyWebsite: z.url().describe("The company's main website URL, e.g. https://example.com."),
|
|
2809
|
+
primaryContactName: z.string().describe("Full name of the person Anthropic should contact about this submission. Receives review feedback and follow-up questions."),
|
|
2810
|
+
primaryContactEmail: z.email().describe("Email for the primary contact (pre-filled from the Claude account). Anthropic uses this to communicate about your submission."),
|
|
2811
|
+
primaryContactRole: z.string().optional().describe("The primary contact's role at the company (e.g. 'Engineer', 'Product Manager'). Optional."),
|
|
2812
|
+
anthropicPointOfContact: z.string().optional().describe("If you've been working with someone at Anthropic, their name or email. Optional, can expedite review."),
|
|
2813
|
+
authentication: claudeAuthenticationSchema.describe(`How users authenticate with your server:
|
|
2814
|
+
• 'oauth_dcr': OAuth 2.0 + Dynamic Client Registration (RFC 7591) — clients register themselves.
|
|
2815
|
+
• 'oauth_cimd': OAuth 2.0 + Client ID Metadata Document — a published client_id metadata document.
|
|
2816
|
+
• 'oauth_anthropic_creds': OAuth 2.0 with Anthropic-held client credentials (a static client_id, and secret if needed).
|
|
2817
|
+
• 'custom_connection': users supply their own URL or client details at connection time (e.g. Snowflake).
|
|
2818
|
+
• 'none': no authentication (authless) — anyone can connect and call tools without credentials.`),
|
|
2819
|
+
partialAuth: z.boolean().optional().describe("Whether some tools return 401 and prompt for auth on demand while the server otherwise starts authless (partial auth)."),
|
|
2820
|
+
apiOwnership: claudeApiOwnershipSchema.describe(`How your connector relates to the API it calls:
|
|
2821
|
+
• 'first_party': the MCP server calls your own production APIs.
|
|
2822
|
+
• 'proxied': calls go to a third-party API you're authorized to integrate (e.g. a Zapier-style integration).
|
|
2823
|
+
• 'third_party': calls a third-party API you don't control — typically blocks listing; explain in 'additionalNotes'.`),
|
|
2824
|
+
personalHealthData: claudeYesNoOtherSchema.describe(`Whether this connector accesses, processes, or stores personal health information.
|
|
2825
|
+
No → false, Yes → true, or { other: explanation } when it depends on configuration.`),
|
|
2826
|
+
sponsoredContent: claudeYesNoOtherSchema.describe(`Whether this connector surfaces sponsored, promoted, or advertising content (prohibited in directory connectors).
|
|
2827
|
+
No → false, Yes → true, or { other: explanation }.`),
|
|
2828
|
+
testInstructions: z.string().optional().describe(`Clear test-account setup and access instructions for reviewers: every link, credential, and step needed to access
|
|
2829
|
+
the MCP server autonomously. For accounts that need to be populated, provide test credentials granting access to a
|
|
2830
|
+
fully populated account.`),
|
|
2831
|
+
selfTested: z.boolean().optional().describe("Confirmation that you have run every tool via MCP Inspector or as a custom connector in Claude."),
|
|
2832
|
+
policyAcknowledgements: z.array(claudePolicyAcknowledgementSchema).describe(`Anthropic directory policy acknowledgements. All items must be acknowledged before the claude.ai wizard allows
|
|
2833
|
+
submission. Each is an attestation you are legally agreeing to by submitting.`),
|
|
2834
|
+
additionalNotes: z.string().optional().describe("Anything else the review team should know about your connector. Optional.")
|
|
2835
|
+
});
|
|
2836
|
+
const claudeSubmissionDraftSchema = claudeSubmissionFormDataSchema.partial().extend({
|
|
2837
|
+
serverUrl: z.string().optional(),
|
|
2838
|
+
name: z.string().optional(),
|
|
2839
|
+
slug: z.string().optional(),
|
|
2840
|
+
oneLiner: z.string().optional(),
|
|
2841
|
+
description: z.string().optional(),
|
|
2842
|
+
iconUrl: z.string().optional(),
|
|
2843
|
+
documentation: z.string().optional(),
|
|
2844
|
+
support: z.string().optional(),
|
|
2845
|
+
privacyPolicy: z.string().optional(),
|
|
2846
|
+
companyWebsite: z.string().optional(),
|
|
2847
|
+
primaryContactEmail: z.string().optional(),
|
|
2848
|
+
categories: z.array(claudeCategorySchema).optional(),
|
|
2849
|
+
screenshots: z.array(screenshotDraftEntrySchema).optional()
|
|
2850
|
+
});
|
|
2851
|
+
/** Source of truth for the fields `SubmissionPrefillService.prefill({ platform: "claudeai" })` can populate. */
|
|
2852
|
+
const claudePrefillFormDataSchema = claudeSubmissionFormDataSchema.pick({
|
|
394
2853
|
serverUrl: true,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
transportSupport: true,
|
|
2854
|
+
name: true,
|
|
2855
|
+
slug: true,
|
|
2856
|
+
companyName: true,
|
|
399
2857
|
primaryContactEmail: true,
|
|
400
|
-
primaryContactName: true
|
|
2858
|
+
primaryContactName: true,
|
|
2859
|
+
readWriteCapabilities: true,
|
|
2860
|
+
authentication: true,
|
|
2861
|
+
apiOwnership: true,
|
|
2862
|
+
personalHealthData: true
|
|
2863
|
+
}).extend({
|
|
2864
|
+
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
2865
|
+
testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
|
|
401
2866
|
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
2867
|
+
/** Loose shape returned by AI generation for Claude narrative fields; transforms live here so generation leniency stays colocated with the Claude contract. */
|
|
2868
|
+
const claudeAiGeneratedFormDataRawSchema = z.object({
|
|
2869
|
+
oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
|
|
2870
|
+
description: claudeSubmissionFormDataSchema.shape.description,
|
|
2871
|
+
categories: z.array(claudeCategorySchema).describe(claudeCategoryDescription),
|
|
2872
|
+
primaryUseCases: claudeSubmissionFormDataSchema.shape.primaryUseCases
|
|
2873
|
+
});
|
|
2874
|
+
const claudeAiGeneratedFormDataSchema = claudeAiGeneratedFormDataRawSchema.extend({
|
|
2875
|
+
oneLiner: clampStringField(claudeSubmissionFormDataSchema.shape.oneLiner),
|
|
2876
|
+
categories: claudeAiGeneratedFormDataRawSchema.shape.categories.transform((categories) => categories.slice(0, 5))
|
|
2877
|
+
});
|
|
2878
|
+
function provenanceByField(prefillShape, aiGeneratedShape) {
|
|
2879
|
+
const byField = {};
|
|
2880
|
+
for (const field of Object.keys(prefillShape)) byField[field] = "prefilled";
|
|
2881
|
+
for (const field of Object.keys(aiGeneratedShape)) byField[field] = "ai-generated";
|
|
2882
|
+
return byField;
|
|
2883
|
+
}
|
|
2884
|
+
provenanceByField(claudePrefillFormDataSchema.shape, claudeAiGeneratedFormDataSchema.shape), provenanceByField(chatgptPrefillFormDataSchema.shape, chatgptAiGeneratedFormDataSchema.shape);
|
|
2885
|
+
const urlVerificationOutcomeSchema = z.enum([
|
|
2886
|
+
"pass",
|
|
2887
|
+
"fail",
|
|
2888
|
+
"unverified"
|
|
2889
|
+
]);
|
|
2890
|
+
const VERIFIABLE_URL_FIELDS = {
|
|
2891
|
+
chatgpt: ["privacyPolicyUrl", "termsOfServiceUrl"],
|
|
2892
|
+
claudeai: ["privacyPolicy"]
|
|
2893
|
+
};
|
|
2894
|
+
const verifiableUrlFieldSchema = z.enum([...VERIFIABLE_URL_FIELDS.chatgpt, ...VERIFIABLE_URL_FIELDS.claudeai]);
|
|
2895
|
+
const policyDisclosureSchema = z.enum([
|
|
2896
|
+
"dataCategories",
|
|
2897
|
+
"purposesOfUse",
|
|
2898
|
+
"recipients",
|
|
2899
|
+
"retention"
|
|
2900
|
+
]);
|
|
2901
|
+
const urlVerificationFieldResultSchema = z.object({
|
|
2902
|
+
field: verifiableUrlFieldSchema,
|
|
2903
|
+
url: z.string(),
|
|
2904
|
+
outcome: urlVerificationOutcomeSchema,
|
|
2905
|
+
reason: z.string(),
|
|
2906
|
+
concerns: z.array(z.string()).optional(),
|
|
2907
|
+
scrapedWith: z.enum(["fetch", "firecrawl"]).optional()
|
|
2908
|
+
});
|
|
2909
|
+
const urlVerificationSchema = z.object({
|
|
2910
|
+
verifiedAt: z.coerce.date(),
|
|
2911
|
+
results: z.array(urlVerificationFieldResultSchema)
|
|
2912
|
+
});
|
|
2913
|
+
const pageKindSchema = z.enum([
|
|
2914
|
+
"expectedDocument",
|
|
2915
|
+
"errorPage",
|
|
2916
|
+
"loginWall",
|
|
2917
|
+
"parkedDomain",
|
|
2918
|
+
"comingSoon",
|
|
2919
|
+
"marketingPage",
|
|
2920
|
+
"unrelatedDocument"
|
|
2921
|
+
]);
|
|
2922
|
+
z.object({
|
|
2923
|
+
pageKind: pageKindSchema.describe("What the page actually is. Use 'expectedDocument' only when it is genuinely the document the field claims."),
|
|
2924
|
+
reason: z.string().max(200).describe("One sentence naming what the page is, addressed to the developer who entered the URL."),
|
|
2925
|
+
missingDisclosures: z.array(policyDisclosureSchema).describe("For a privacy policy only: which of the four required disclosures the text does not cover. Empty for every other page kind.")
|
|
407
2926
|
});
|
|
408
2927
|
const submissionMetaFieldsSchema = z.object({
|
|
409
2928
|
id: z.string(),
|
|
410
2929
|
environmentId: z.string(),
|
|
2930
|
+
auditId: z.string().nullable(),
|
|
2931
|
+
urlVerification: urlVerificationSchema.nullable().default(null),
|
|
411
2932
|
createdAt: z.coerce.date(),
|
|
412
2933
|
updatedAt: z.coerce.date()
|
|
413
2934
|
});
|
|
414
2935
|
const claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
415
2936
|
platform: z.literal("claudeai"),
|
|
416
|
-
formData:
|
|
2937
|
+
formData: claudeSubmissionDraftSchema,
|
|
2938
|
+
prefillSnapshot: claudeSubmissionDraftSchema.nullable().default(null)
|
|
417
2939
|
});
|
|
418
2940
|
const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
419
2941
|
platform: z.literal("chatgpt"),
|
|
420
|
-
formData:
|
|
2942
|
+
formData: chatgptSubmissionDraftSchema,
|
|
2943
|
+
prefillSnapshot: chatgptSubmissionDraftSchema.nullable().default(null)
|
|
421
2944
|
});
|
|
422
|
-
z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
|
|
423
|
-
z.union([
|
|
2945
|
+
const submissionSchemaInternal = z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
|
|
2946
|
+
z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
|
|
2947
|
+
/** Discriminated on `platform`, which pins the shape of `formData`: a Claude submission cannot carry chatgpt-only fields, and vice-versa. */
|
|
2948
|
+
const submissionSchema = submissionSchemaInternal;
|
|
2949
|
+
z.literal([
|
|
2950
|
+
100,
|
|
2951
|
+
75,
|
|
2952
|
+
50
|
|
2953
|
+
]);
|
|
424
2954
|
const subscriptionPlanSchema = z.enum([
|
|
425
2955
|
"pro",
|
|
426
2956
|
"business",
|
|
427
2957
|
"enterprise"
|
|
428
2958
|
]);
|
|
429
2959
|
z.object({ plan: subscriptionPlanSchema.nullable() });
|
|
2960
|
+
const customerCreditsSchema = z.object({
|
|
2961
|
+
balanceInCents: z.number(),
|
|
2962
|
+
expiresAt: z.number().nullable(),
|
|
2963
|
+
currency: z.string()
|
|
2964
|
+
});
|
|
2965
|
+
const partnerDiscountSchema = z.object({ endsAt: z.number() });
|
|
2966
|
+
z.object({
|
|
2967
|
+
customerCredits: customerCreditsSchema.nullable(),
|
|
2968
|
+
partnerDiscount: partnerDiscountSchema.nullable()
|
|
2969
|
+
});
|
|
2970
|
+
const metricsQueueEventSchema = z.object({
|
|
2971
|
+
ts: z.number().int(),
|
|
2972
|
+
method: z.string(),
|
|
2973
|
+
tool: z.string().nullable(),
|
|
2974
|
+
client: z.string(),
|
|
2975
|
+
sessionId: z.string().nullable(),
|
|
2976
|
+
conversationId: z.string().nullable().optional(),
|
|
2977
|
+
durationMs: z.number().int(),
|
|
2978
|
+
outputTokens: z.number().int().nullable(),
|
|
2979
|
+
errorType: z.enum([
|
|
2980
|
+
"mcp_error",
|
|
2981
|
+
"tool_error",
|
|
2982
|
+
"timeout"
|
|
2983
|
+
]).nullable(),
|
|
2984
|
+
errorCode: z.number().int().nullable()
|
|
2985
|
+
});
|
|
2986
|
+
z.object({
|
|
2987
|
+
v: z.literal(1),
|
|
2988
|
+
envId: z.string(),
|
|
2989
|
+
events: z.array(metricsQueueEventSchema)
|
|
2990
|
+
});
|
|
2991
|
+
z.object({ v: z.number() });
|
|
2992
|
+
const TELEMETRY_SIGNALS = [
|
|
2993
|
+
"logs",
|
|
2994
|
+
"metrics",
|
|
2995
|
+
"traces"
|
|
2996
|
+
];
|
|
2997
|
+
const telemetrySignalSchema = z.enum(TELEMETRY_SIGNALS);
|
|
2998
|
+
const OTLP_PROTOCOLS = ["http/protobuf", "http/json"];
|
|
2999
|
+
const otlpProtocolSchema = z.enum(OTLP_PROTOCOLS);
|
|
3000
|
+
const otlpEndpointSchema = z.string().trim().min(1).max(2048);
|
|
3001
|
+
const OTLP_HEADER_VALUE_MAX_LENGTH = 2048;
|
|
3002
|
+
const otlpHeaderNameSchema = z.string().trim().min(1, "Enter a header name").max(128).regex(/^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/, "Use letters, digits and !#$%&'*+-.^_`|~ only");
|
|
3003
|
+
const otlpHeaderValueSchema = z.string().trim().max(OTLP_HEADER_VALUE_MAX_LENGTH).refine((value) => !/[\r\n]/.test(value), "Line breaks are not allowed in a header value");
|
|
3004
|
+
const telemetryDestinationHeaderSchema = z.object({
|
|
3005
|
+
id: z.string(),
|
|
3006
|
+
name: otlpHeaderNameSchema,
|
|
3007
|
+
value: otlpHeaderValueSchema,
|
|
3008
|
+
isSecret: z.boolean()
|
|
3009
|
+
});
|
|
3010
|
+
const otlpPushFailureReasonSchema = z.enum([
|
|
3011
|
+
"credentials",
|
|
3012
|
+
"wrong-path",
|
|
3013
|
+
"wrong-protocol",
|
|
3014
|
+
"invalid-payload",
|
|
3015
|
+
"partial-rejection",
|
|
3016
|
+
"blocked-target",
|
|
3017
|
+
"timeout",
|
|
3018
|
+
"unreachable",
|
|
3019
|
+
"receiver-error",
|
|
3020
|
+
"unexpected-status"
|
|
3021
|
+
]);
|
|
3022
|
+
const telemetryDestinationStatusSchema = z.enum(["active", "suspended"]);
|
|
3023
|
+
z.object({
|
|
3024
|
+
id: z.string(),
|
|
3025
|
+
signal: telemetrySignalSchema,
|
|
3026
|
+
endpoint: otlpEndpointSchema,
|
|
3027
|
+
protocol: otlpProtocolSchema,
|
|
3028
|
+
headers: z.array(telemetryDestinationHeaderSchema),
|
|
3029
|
+
status: telemetryDestinationStatusSchema,
|
|
3030
|
+
lastFailureReason: otlpPushFailureReasonSchema.nullable(),
|
|
3031
|
+
isScopedToIntentionalRequestsOnly: z.boolean()
|
|
3032
|
+
});
|
|
3033
|
+
const hasDuplicateHeaderNames = (headers) => {
|
|
3034
|
+
const names = headers.map(({ name }) => name.trim().toLowerCase());
|
|
3035
|
+
return new Set(names).size !== names.length;
|
|
3036
|
+
};
|
|
3037
|
+
//#endregion
|
|
3038
|
+
//#region src/auth-scope.ts
|
|
3039
|
+
/** Accepts an API key or OAuth access token (default for most routes). */
|
|
3040
|
+
const AUTH_SCOPE_ANY = "any";
|
|
3041
|
+
/** Requires a user OAuth access token; API keys are not accepted. */
|
|
3042
|
+
const AUTH_SCOPE_USER = "user";
|
|
430
3043
|
//#endregion
|
|
431
3044
|
//#region src/schemas.ts
|
|
432
3045
|
const RESERVED_KEYS = [
|
|
@@ -463,7 +3076,10 @@ const RESERVED_KEYS = [
|
|
|
463
3076
|
"BUILD_ARG_START_COMMAND",
|
|
464
3077
|
"ALPIC_HOST",
|
|
465
3078
|
"ALPIC_CUSTOM_DOMAINS",
|
|
466
|
-
"ALPIC_INTENT_META_KEY"
|
|
3079
|
+
"ALPIC_INTENT_META_KEY",
|
|
3080
|
+
"ALPIC_FEEDBACK_META_KEY",
|
|
3081
|
+
"ALPIC_EVENTS_META_KEY",
|
|
3082
|
+
"ALPIC_IDENTIFY_META_KEY"
|
|
467
3083
|
];
|
|
468
3084
|
const environmentVariableSchema = z.object({
|
|
469
3085
|
key: z.string().min(2, "Key must be at least 2 characters").regex(/^[a-zA-Z]([a-zA-Z0-9_])+$/, "Key must start with a letter and contain only letters, numbers, and underscores").refine((key) => !RESERVED_KEYS.includes(key), "This key is reserved and cannot be used as an environment variable key"),
|
|
@@ -516,6 +3132,14 @@ const serverFieldsSchema = z.object({
|
|
|
516
3132
|
});
|
|
517
3133
|
//#endregion
|
|
518
3134
|
//#region src/api.contract.ts
|
|
3135
|
+
const isValidIanaTimeZone = (timeZone) => {
|
|
3136
|
+
try {
|
|
3137
|
+
new Intl.DateTimeFormat("en-US", { timeZone });
|
|
3138
|
+
return true;
|
|
3139
|
+
} catch {
|
|
3140
|
+
return false;
|
|
3141
|
+
}
|
|
3142
|
+
};
|
|
519
3143
|
const deploymentStatusSchema = z.enum([
|
|
520
3144
|
"ongoing",
|
|
521
3145
|
"deployed",
|
|
@@ -544,21 +3168,20 @@ const deploymentSchema = z.object({
|
|
|
544
3168
|
isCurrent: z.boolean(),
|
|
545
3169
|
deploymentPageUrl: z.url().nullable()
|
|
546
3170
|
});
|
|
547
|
-
const
|
|
3171
|
+
const isValidTimeInput = (value) => {
|
|
548
3172
|
if (ms(value) !== void 0) return true;
|
|
549
3173
|
return !Number.isNaN(new Date(value).getTime());
|
|
550
3174
|
};
|
|
551
|
-
const
|
|
3175
|
+
const timeInputSchema = z.string().refine(isValidTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." });
|
|
3176
|
+
const base = oc.errors({ BAD_REQUEST: {} });
|
|
3177
|
+
const createEnvironmentContractV1 = base.route({
|
|
552
3178
|
path: "/v1/environments",
|
|
553
3179
|
method: "POST",
|
|
554
3180
|
summary: "Create an environment",
|
|
555
3181
|
description: "Create an environment for a project",
|
|
556
3182
|
tags: ["environments"],
|
|
557
3183
|
successDescription: "The environment has been created successfully"
|
|
558
|
-
}).errors({
|
|
559
|
-
NOT_FOUND: {},
|
|
560
|
-
BAD_REQUEST: {}
|
|
561
|
-
}).input(z.object({
|
|
3184
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
562
3185
|
projectId: z.string().describe("The ID of the project to create the environment for"),
|
|
563
3186
|
name: z.string().min(1).describe("The name of the environment"),
|
|
564
3187
|
sourceBranch: z.string().min(1).describe("The branch used to build the environment"),
|
|
@@ -567,11 +3190,11 @@ const createEnvironmentContractV1 = oc.route({
|
|
|
567
3190
|
id: z.string(),
|
|
568
3191
|
name: z.string(),
|
|
569
3192
|
sourceBranch: z.string().nullable().describe("The branch used to build the environment"),
|
|
570
|
-
urls: z.array(z.
|
|
3193
|
+
urls: z.array(z.url()).describe("The URLs of the MCP server"),
|
|
571
3194
|
createdAt: z.coerce.date(),
|
|
572
3195
|
projectId: z.string().describe("The ID of the project the environment belongs to")
|
|
573
3196
|
}));
|
|
574
|
-
const getEnvironmentContractV1 =
|
|
3197
|
+
const getEnvironmentContractV1 = base.route({
|
|
575
3198
|
path: "/v1/environments/{environmentId}",
|
|
576
3199
|
method: "GET",
|
|
577
3200
|
summary: "Get an environment",
|
|
@@ -583,10 +3206,18 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
583
3206
|
name: z.string(),
|
|
584
3207
|
sourceBranch: z.string().nullable(),
|
|
585
3208
|
mcpServerUrl: z.string(),
|
|
586
|
-
domains: z.array(z.
|
|
3209
|
+
domains: z.array(z.hostname()),
|
|
587
3210
|
createdAt: z.coerce.date(),
|
|
588
3211
|
projectId: z.string()
|
|
589
3212
|
}));
|
|
3213
|
+
const deleteEnvironmentContractV1 = base.route({
|
|
3214
|
+
path: "/v1/environments/{environmentId}",
|
|
3215
|
+
method: "DELETE",
|
|
3216
|
+
summary: "Delete an environment",
|
|
3217
|
+
description: "All environments can be deleted except the production environment. This operation is not reversible: associated logs, analytics, and metrics are deleted as well.",
|
|
3218
|
+
tags: ["environments"],
|
|
3219
|
+
successDescription: "The environment has been deleted successfully"
|
|
3220
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.object({ success: z.literal(true) }));
|
|
590
3221
|
const domainSchema = z.object({
|
|
591
3222
|
domain: z.string(),
|
|
592
3223
|
status: z.enum([
|
|
@@ -628,7 +3259,7 @@ const projectOutputSchema = z.object({
|
|
|
628
3259
|
productionEnvironment: productionEnvironmentSchema.nullable(),
|
|
629
3260
|
environments: z.array(environmentSchema)
|
|
630
3261
|
});
|
|
631
|
-
const getProjectContractV1 =
|
|
3262
|
+
const getProjectContractV1 = base.route({
|
|
632
3263
|
path: "/v1/projects/{projectId}",
|
|
633
3264
|
method: "GET",
|
|
634
3265
|
summary: "Get a project",
|
|
@@ -636,15 +3267,15 @@ const getProjectContractV1 = oc.route({
|
|
|
636
3267
|
tags: ["projects"],
|
|
637
3268
|
successDescription: "The project details"
|
|
638
3269
|
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(projectOutputSchema);
|
|
639
|
-
const listProjectsContractV1 =
|
|
3270
|
+
const listProjectsContractV1 = base.route({
|
|
640
3271
|
path: "/v1/projects",
|
|
641
3272
|
method: "GET",
|
|
642
3273
|
summary: "List projects",
|
|
643
3274
|
description: "List all projects for a team",
|
|
644
3275
|
tags: ["projects"],
|
|
645
3276
|
successDescription: "The list of projects"
|
|
646
|
-
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
647
|
-
const createProjectContractV1 =
|
|
3277
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
3278
|
+
const createProjectContractV1 = base.route({
|
|
648
3279
|
path: "/v1/projects",
|
|
649
3280
|
method: "POST",
|
|
650
3281
|
summary: "Create a project",
|
|
@@ -653,7 +3284,7 @@ const createProjectContractV1 = oc.route({
|
|
|
653
3284
|
successDescription: "The project has been created successfully"
|
|
654
3285
|
}).errors({
|
|
655
3286
|
NOT_FOUND: {},
|
|
656
|
-
|
|
3287
|
+
FORBIDDEN: {}
|
|
657
3288
|
}).input(z.object({
|
|
658
3289
|
teamId: z.string().optional(),
|
|
659
3290
|
name: z.string().trim().min(1).max(100),
|
|
@@ -693,7 +3324,101 @@ const environmentVariableOutputSchema = z.object({
|
|
|
693
3324
|
isSecret: z.boolean(),
|
|
694
3325
|
createdAt: z.coerce.date()
|
|
695
3326
|
});
|
|
696
|
-
const
|
|
3327
|
+
const telemetryDestinationHeaderOutputSchema = z.discriminatedUnion("isSecret", [z.object({
|
|
3328
|
+
id: z.string(),
|
|
3329
|
+
name: otlpHeaderNameSchema,
|
|
3330
|
+
value: z.null(),
|
|
3331
|
+
isSecret: z.literal(true)
|
|
3332
|
+
}), z.object({
|
|
3333
|
+
id: z.string(),
|
|
3334
|
+
name: otlpHeaderNameSchema,
|
|
3335
|
+
value: otlpHeaderValueSchema,
|
|
3336
|
+
isSecret: z.literal(false)
|
|
3337
|
+
})]);
|
|
3338
|
+
const telemetryDestinationOutputSchema = z.object({
|
|
3339
|
+
id: z.string(),
|
|
3340
|
+
signal: telemetrySignalSchema,
|
|
3341
|
+
endpoint: otlpEndpointSchema,
|
|
3342
|
+
protocol: otlpProtocolSchema,
|
|
3343
|
+
headers: z.array(telemetryDestinationHeaderOutputSchema),
|
|
3344
|
+
status: telemetryDestinationStatusSchema,
|
|
3345
|
+
lastFailureReason: otlpPushFailureReasonSchema.nullable(),
|
|
3346
|
+
isScopedToIntentionalRequestsOnly: z.boolean()
|
|
3347
|
+
});
|
|
3348
|
+
const createTelemetryDestinationHeaderInputSchema = z.object({
|
|
3349
|
+
name: otlpHeaderNameSchema,
|
|
3350
|
+
value: otlpHeaderValueSchema.min(1, "Enter a header value"),
|
|
3351
|
+
isSecret: z.boolean()
|
|
3352
|
+
});
|
|
3353
|
+
const updateTelemetryDestinationHeaderInputSchema = z.object({
|
|
3354
|
+
id: z.string().optional(),
|
|
3355
|
+
name: otlpHeaderNameSchema,
|
|
3356
|
+
value: otlpHeaderValueSchema.optional(),
|
|
3357
|
+
isSecret: z.boolean()
|
|
3358
|
+
});
|
|
3359
|
+
const uniqueTelemetryHeaders = (headers) => !hasDuplicateHeaderNames(headers);
|
|
3360
|
+
const listTelemetryDestinationsContractV1 = base.route({
|
|
3361
|
+
path: "/v1/environments/{environmentId}/telemetry-destinations",
|
|
3362
|
+
method: "GET",
|
|
3363
|
+
summary: "List telemetry destinations",
|
|
3364
|
+
description: "List the OTLP destinations configured for an environment. Secret header values are never returned.",
|
|
3365
|
+
tags: ["telemetry"],
|
|
3366
|
+
successDescription: "The list of telemetry destinations"
|
|
3367
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(telemetryDestinationOutputSchema));
|
|
3368
|
+
const createTelemetryDestinationContractV1 = base.route({
|
|
3369
|
+
path: "/v1/environments/{environmentId}/telemetry-destinations",
|
|
3370
|
+
method: "POST",
|
|
3371
|
+
summary: "Create a telemetry destination",
|
|
3372
|
+
description: "Verify and save an OTLP destination for logs, metrics, or traces.",
|
|
3373
|
+
tags: ["telemetry"],
|
|
3374
|
+
successDescription: "The telemetry destination has been created"
|
|
3375
|
+
}).errors({
|
|
3376
|
+
NOT_FOUND: {},
|
|
3377
|
+
FORBIDDEN: {},
|
|
3378
|
+
OTLP_DESTINATION_UNVERIFIED: { status: 400 },
|
|
3379
|
+
INTERNAL_SERVER_ERROR: {}
|
|
3380
|
+
}).input(z.object({
|
|
3381
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3382
|
+
signal: telemetrySignalSchema,
|
|
3383
|
+
endpoint: otlpEndpointSchema,
|
|
3384
|
+
protocol: otlpProtocolSchema.default("http/protobuf"),
|
|
3385
|
+
isScopedToIntentionalRequestsOnly: z.boolean().default(false),
|
|
3386
|
+
headers: z.array(createTelemetryDestinationHeaderInputSchema).default([]).refine(uniqueTelemetryHeaders, "Header names must be unique")
|
|
3387
|
+
})).output(telemetryDestinationOutputSchema);
|
|
3388
|
+
const updateTelemetryDestinationContractV1 = base.route({
|
|
3389
|
+
path: "/v1/environments/{environmentId}/telemetry-destinations/{destinationId}",
|
|
3390
|
+
method: "PATCH",
|
|
3391
|
+
summary: "Update a telemetry destination",
|
|
3392
|
+
description: "Verify and save changes to an OTLP destination. Omit headers to keep them unchanged; omit the value of an existing header to preserve it. A secret header value must be re-entered when the endpoint changes.",
|
|
3393
|
+
tags: ["telemetry"],
|
|
3394
|
+
successDescription: "The telemetry destination has been updated"
|
|
3395
|
+
}).errors({
|
|
3396
|
+
NOT_FOUND: {},
|
|
3397
|
+
FORBIDDEN: {},
|
|
3398
|
+
OTLP_DESTINATION_UNVERIFIED: { status: 400 }
|
|
3399
|
+
}).input(z.object({
|
|
3400
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3401
|
+
destinationId: z.string().describe("The ID of the telemetry destination"),
|
|
3402
|
+
endpoint: otlpEndpointSchema.optional(),
|
|
3403
|
+
protocol: otlpProtocolSchema.optional(),
|
|
3404
|
+
isScopedToIntentionalRequestsOnly: z.boolean().optional(),
|
|
3405
|
+
headers: z.array(updateTelemetryDestinationHeaderInputSchema).refine(uniqueTelemetryHeaders, "Header names must be unique").optional()
|
|
3406
|
+
})).output(telemetryDestinationOutputSchema);
|
|
3407
|
+
const deleteTelemetryDestinationContractV1 = base.route({
|
|
3408
|
+
path: "/v1/environments/{environmentId}/telemetry-destinations/{destinationId}",
|
|
3409
|
+
method: "DELETE",
|
|
3410
|
+
summary: "Delete a telemetry destination",
|
|
3411
|
+
description: "Delete an OTLP destination from an environment.",
|
|
3412
|
+
tags: ["telemetry"],
|
|
3413
|
+
successDescription: "The telemetry destination has been deleted"
|
|
3414
|
+
}).errors({
|
|
3415
|
+
NOT_FOUND: {},
|
|
3416
|
+
INTERNAL_SERVER_ERROR: {}
|
|
3417
|
+
}).input(z.object({
|
|
3418
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3419
|
+
destinationId: z.string().describe("The ID of the telemetry destination")
|
|
3420
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
3421
|
+
const listEnvironmentVariablesContractV1 = base.route({
|
|
697
3422
|
path: "/v1/environments/{environmentId}/environment-variables",
|
|
698
3423
|
method: "GET",
|
|
699
3424
|
summary: "List environment variables",
|
|
@@ -701,37 +3426,31 @@ const listEnvironmentVariablesContractV1 = oc.route({
|
|
|
701
3426
|
tags: ["environments"],
|
|
702
3427
|
successDescription: "The list of environment variables"
|
|
703
3428
|
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
704
|
-
const createEnvironmentVariablesContractV1 =
|
|
3429
|
+
const createEnvironmentVariablesContractV1 = base.route({
|
|
705
3430
|
path: "/v1/environments/{environmentId}/environment-variables",
|
|
706
3431
|
method: "POST",
|
|
707
3432
|
summary: "Add environment variables",
|
|
708
3433
|
description: "Add one or more environment variables to an environment",
|
|
709
3434
|
tags: ["environments"],
|
|
710
3435
|
successDescription: "The environment variables have been added successfully"
|
|
711
|
-
}).errors({
|
|
712
|
-
NOT_FOUND: {},
|
|
713
|
-
BAD_REQUEST: {}
|
|
714
|
-
}).input(z.object({
|
|
3436
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
715
3437
|
environmentId: z.string().describe("The ID of the environment"),
|
|
716
3438
|
environmentVariables: environmentVariablesSchema
|
|
717
3439
|
})).output(z.object({ success: z.literal(true) }));
|
|
718
|
-
const updateEnvironmentVariableContractV1 =
|
|
3440
|
+
const updateEnvironmentVariableContractV1 = base.route({
|
|
719
3441
|
path: "/v1/environment-variables/{environmentVariableId}",
|
|
720
3442
|
method: "PATCH",
|
|
721
3443
|
summary: "Update an environment variable",
|
|
722
3444
|
description: "Update an environment variable by ID",
|
|
723
3445
|
tags: ["environments"],
|
|
724
3446
|
successDescription: "The environment variable has been updated successfully"
|
|
725
|
-
}).errors({
|
|
726
|
-
NOT_FOUND: {},
|
|
727
|
-
BAD_REQUEST: {}
|
|
728
|
-
}).input(z.object({
|
|
3447
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
729
3448
|
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
730
3449
|
key: environmentVariableSchema.shape.key,
|
|
731
3450
|
value: environmentVariableSchema.shape.value.optional(),
|
|
732
3451
|
isSecret: environmentVariableSchema.shape.isSecret.optional()
|
|
733
3452
|
})).output(z.object({ success: z.literal(true) }));
|
|
734
|
-
const deleteEnvironmentVariableContractV1 =
|
|
3453
|
+
const deleteEnvironmentVariableContractV1 = base.route({
|
|
735
3454
|
path: "/v1/environment-variables/{environmentVariableId}",
|
|
736
3455
|
method: "DELETE",
|
|
737
3456
|
summary: "Delete an environment variable",
|
|
@@ -739,7 +3458,7 @@ const deleteEnvironmentVariableContractV1 = oc.route({
|
|
|
739
3458
|
tags: ["environments"],
|
|
740
3459
|
successDescription: "The environment variable has been deleted successfully"
|
|
741
3460
|
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
742
|
-
const deleteProjectContractV1 =
|
|
3461
|
+
const deleteProjectContractV1 = base.route({
|
|
743
3462
|
path: "/v1/projects/{projectId}",
|
|
744
3463
|
method: "DELETE",
|
|
745
3464
|
summary: "Delete a project",
|
|
@@ -747,7 +3466,7 @@ const deleteProjectContractV1 = oc.route({
|
|
|
747
3466
|
tags: ["projects"],
|
|
748
3467
|
successDescription: "The project has been deleted successfully"
|
|
749
3468
|
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.object({ success: z.literal(true) }));
|
|
750
|
-
const updateProjectContractV1 =
|
|
3469
|
+
const updateProjectContractV1 = base.route({
|
|
751
3470
|
path: "/v1/projects/{projectId}",
|
|
752
3471
|
method: "PATCH",
|
|
753
3472
|
summary: "Update a project",
|
|
@@ -756,13 +3475,13 @@ const updateProjectContractV1 = oc.route({
|
|
|
756
3475
|
successDescription: "The project has been updated successfully"
|
|
757
3476
|
}).errors({
|
|
758
3477
|
NOT_FOUND: {},
|
|
759
|
-
|
|
3478
|
+
FORBIDDEN: {}
|
|
760
3479
|
}).input(z.object({
|
|
761
3480
|
projectId: z.string().describe("The ID of the project"),
|
|
762
3481
|
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
763
3482
|
sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
|
|
764
3483
|
})).output(projectOutputSchema);
|
|
765
|
-
const deployEnvironmentContractV1 =
|
|
3484
|
+
const deployEnvironmentContractV1 = base.route({
|
|
766
3485
|
path: "/v1/environments/{environmentId}/deploy",
|
|
767
3486
|
method: "POST",
|
|
768
3487
|
summary: "Deploy an environment",
|
|
@@ -771,24 +3490,25 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
771
3490
|
successDescription: "The environment has been deployed successfully"
|
|
772
3491
|
}).errors({
|
|
773
3492
|
NOT_FOUND: {},
|
|
774
|
-
|
|
3493
|
+
CONFLICT: {}
|
|
775
3494
|
}).input(z.object({
|
|
776
3495
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
777
|
-
token: z.string().describe("The token to identify the source archive").optional()
|
|
3496
|
+
token: z.string().describe("The token to identify the source archive").optional(),
|
|
3497
|
+
settings: buildSettingsSchema.extend({ transport: transportSchema }).optional().describe("Project settings detected by the client from the source. When provided, the server skips downloading and extracting the source archive to detect them.")
|
|
778
3498
|
})).output(deploymentSchema);
|
|
779
|
-
const uploadDeploymentArtifactContractV1 =
|
|
3499
|
+
const uploadDeploymentArtifactContractV1 = base.route({
|
|
780
3500
|
path: "/v1/deployments/upload",
|
|
781
3501
|
method: "POST",
|
|
782
3502
|
summary: "Upload deployment artifacts",
|
|
783
3503
|
description: "Return a presigned S3 URL to upload a deployment artifact",
|
|
784
3504
|
tags: ["deployments"],
|
|
785
3505
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
786
|
-
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
3506
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
787
3507
|
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
788
3508
|
token: z.string().describe("Token to identify the source archive"),
|
|
789
3509
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
790
3510
|
}));
|
|
791
|
-
const listDeploymentsContractV1 =
|
|
3511
|
+
const listDeploymentsContractV1 = base.route({
|
|
792
3512
|
path: "/v1/projects/{projectId}/deployments",
|
|
793
3513
|
method: "GET",
|
|
794
3514
|
summary: "List project deployments",
|
|
@@ -800,7 +3520,7 @@ const listDeploymentsContractV1 = oc.route({
|
|
|
800
3520
|
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
801
3521
|
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
802
3522
|
})).output(z.array(deploymentSchema));
|
|
803
|
-
const getDeploymentContractV1 =
|
|
3523
|
+
const getDeploymentContractV1 = base.route({
|
|
804
3524
|
path: "/v1/deployments/{deploymentId}",
|
|
805
3525
|
method: "GET",
|
|
806
3526
|
summary: "Get a deployment",
|
|
@@ -808,20 +3528,32 @@ const getDeploymentContractV1 = oc.route({
|
|
|
808
3528
|
tags: ["deployments"],
|
|
809
3529
|
successDescription: "The deployment details"
|
|
810
3530
|
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
811
|
-
const
|
|
3531
|
+
const logEntrySchema = z.object({
|
|
3532
|
+
timestamp: z.coerce.date(),
|
|
3533
|
+
type: z.enum([
|
|
3534
|
+
"START",
|
|
3535
|
+
"END",
|
|
3536
|
+
"INFO",
|
|
3537
|
+
"ERROR",
|
|
3538
|
+
"WARNING",
|
|
3539
|
+
"DEBUG"
|
|
3540
|
+
]),
|
|
3541
|
+
requestId: z.string(),
|
|
3542
|
+
content: z.string().optional(),
|
|
3543
|
+
method: z.string().optional(),
|
|
3544
|
+
durationInMs: z.number().optional()
|
|
3545
|
+
});
|
|
3546
|
+
const getLogsContractV1 = base.route({
|
|
812
3547
|
path: "/v1/environments/{environmentId}/logs",
|
|
813
3548
|
method: "GET",
|
|
814
3549
|
summary: "Get logs",
|
|
815
3550
|
description: "Get logs for an environment",
|
|
816
3551
|
tags: ["environments"],
|
|
817
3552
|
successDescription: "The logs"
|
|
818
|
-
}).errors({
|
|
819
|
-
NOT_FOUND: {},
|
|
820
|
-
BAD_REQUEST: {}
|
|
821
|
-
}).input(z.object({
|
|
3553
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
822
3554
|
environmentId: z.string().describe("The ID of the environment"),
|
|
823
|
-
since:
|
|
824
|
-
until:
|
|
3555
|
+
since: timeInputSchema.optional().describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
3556
|
+
until: timeInputSchema.optional().describe("End time — ISO 8601 or relative"),
|
|
825
3557
|
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
826
3558
|
level: z.array(z.enum([
|
|
827
3559
|
"INFO",
|
|
@@ -829,37 +3561,20 @@ const getLogsContractV1 = oc.route({
|
|
|
829
3561
|
"WARNING",
|
|
830
3562
|
"DEBUG"
|
|
831
3563
|
])).optional().describe("Filter by log level"),
|
|
832
|
-
search:
|
|
3564
|
+
search: logSearchSchema.optional().describe("Term to search for in log content"),
|
|
833
3565
|
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
834
3566
|
})).output(z.object({
|
|
835
|
-
logs: z.array(
|
|
836
|
-
timestamp: z.coerce.date(),
|
|
837
|
-
type: z.enum([
|
|
838
|
-
"START",
|
|
839
|
-
"END",
|
|
840
|
-
"INFO",
|
|
841
|
-
"ERROR",
|
|
842
|
-
"WARNING",
|
|
843
|
-
"DEBUG"
|
|
844
|
-
]),
|
|
845
|
-
requestId: z.string(),
|
|
846
|
-
content: z.string().optional(),
|
|
847
|
-
method: z.string().optional(),
|
|
848
|
-
durationInMs: z.number().optional()
|
|
849
|
-
})),
|
|
3567
|
+
logs: z.array(logEntrySchema),
|
|
850
3568
|
nextToken: z.string().nullable()
|
|
851
3569
|
}));
|
|
852
|
-
const getLatestLogsContractV1 =
|
|
3570
|
+
const getLatestLogsContractV1 = base.route({
|
|
853
3571
|
path: "/v1/environments/{environmentId}/latest-logs",
|
|
854
3572
|
method: "GET",
|
|
855
3573
|
summary: "Get latest logs",
|
|
856
3574
|
description: "Get the N most recent logs for an environment",
|
|
857
3575
|
tags: ["environments"],
|
|
858
3576
|
successDescription: "The latest logs"
|
|
859
|
-
}).errors({
|
|
860
|
-
NOT_FOUND: {},
|
|
861
|
-
BAD_REQUEST: {}
|
|
862
|
-
}).input(z.object({
|
|
3577
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
863
3578
|
environmentId: z.string().describe("The ID of the environment"),
|
|
864
3579
|
limit: z.coerce.number().int().min(1).max(1e3).default(100).describe("Number of most recent log entries to return"),
|
|
865
3580
|
level: z.array(z.enum([
|
|
@@ -868,23 +3583,9 @@ const getLatestLogsContractV1 = oc.route({
|
|
|
868
3583
|
"WARNING",
|
|
869
3584
|
"DEBUG"
|
|
870
3585
|
])).optional().describe("Filter by log level"),
|
|
871
|
-
search:
|
|
872
|
-
})).output(z.object({ logs: z.array(
|
|
873
|
-
|
|
874
|
-
type: z.enum([
|
|
875
|
-
"START",
|
|
876
|
-
"END",
|
|
877
|
-
"INFO",
|
|
878
|
-
"ERROR",
|
|
879
|
-
"WARNING",
|
|
880
|
-
"DEBUG"
|
|
881
|
-
]),
|
|
882
|
-
requestId: z.string(),
|
|
883
|
-
content: z.string().optional(),
|
|
884
|
-
method: z.string().optional(),
|
|
885
|
-
durationInMs: z.number().optional()
|
|
886
|
-
})) }));
|
|
887
|
-
const getDeploymentLogsContractV1 = oc.route({
|
|
3586
|
+
search: logSearchSchema.optional().describe("Term to search for in log content")
|
|
3587
|
+
})).output(z.object({ logs: z.array(logEntrySchema) }));
|
|
3588
|
+
const getDeploymentLogsContractV1 = base.route({
|
|
888
3589
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
889
3590
|
method: "GET",
|
|
890
3591
|
summary: "Get deployment logs",
|
|
@@ -911,22 +3612,19 @@ const analyticsTimeSeriesSchema = z.object({
|
|
|
911
3612
|
output_token_mean: z.array(analyticsDataPointSchema),
|
|
912
3613
|
task_count: z.array(analyticsDataPointSchema)
|
|
913
3614
|
});
|
|
914
|
-
const getProjectAnalyticsContractV1 =
|
|
3615
|
+
const getProjectAnalyticsContractV1 = base.route({
|
|
915
3616
|
path: "/v1/analytics/{projectId}",
|
|
916
3617
|
method: "GET",
|
|
917
3618
|
summary: "Get project analytics",
|
|
918
3619
|
description: "Get analytics data for a project over a time range",
|
|
919
3620
|
tags: ["analytics"],
|
|
920
3621
|
successDescription: "The project analytics data"
|
|
921
|
-
}).errors({
|
|
922
|
-
NOT_FOUND: {},
|
|
923
|
-
BAD_REQUEST: {}
|
|
924
|
-
}).input(z.object({
|
|
3622
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
925
3623
|
projectId: z.string().describe("The ID of the project"),
|
|
926
3624
|
startTimestamp: z.coerce.number().describe("Start timestamp in milliseconds"),
|
|
927
3625
|
endTimestamp: z.coerce.number().describe("End timestamp in milliseconds"),
|
|
928
3626
|
timeZone: z.string().describe("IANA timezone (e.g. Europe/Paris)")
|
|
929
|
-
}).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp > 0, { message: "End date must be after start date" }).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp <=
|
|
3627
|
+
}).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp > 0, { message: "End date must be after start date" }).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp <= 26784e5, { message: "Date range must be less than 1 month" }).refine(({ timeZone }) => isValidIanaTimeZone(timeZone), { message: "Time zone must be a valid IANA timezone" })).output(z.object({
|
|
930
3628
|
metadata: z.object({
|
|
931
3629
|
startTimestamp: z.number(),
|
|
932
3630
|
endTimestamp: z.number(),
|
|
@@ -936,7 +3634,132 @@ const getProjectAnalyticsContractV1 = oc.route({
|
|
|
936
3634
|
}),
|
|
937
3635
|
timeSeries: analyticsTimeSeriesSchema
|
|
938
3636
|
}));
|
|
939
|
-
const
|
|
3637
|
+
const paginatedInsightsInputShape = {
|
|
3638
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3639
|
+
since: timeInputSchema.default("7d").describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
3640
|
+
until: timeInputSchema.optional().describe("End time — ISO 8601 or relative"),
|
|
3641
|
+
limit: z.coerce.number().int().min(1).max(200).default(50),
|
|
3642
|
+
offset: z.coerce.number().int().min(0).default(0),
|
|
3643
|
+
search: z.string().trim().min(1).max(200).optional()
|
|
3644
|
+
};
|
|
3645
|
+
const listIntentsContractV1 = base.route({
|
|
3646
|
+
path: "/v1/environments/{environmentId}/intents",
|
|
3647
|
+
method: "GET",
|
|
3648
|
+
summary: "List intents",
|
|
3649
|
+
description: "List grouped user intents for an environment over a time range",
|
|
3650
|
+
tags: ["insights"],
|
|
3651
|
+
successDescription: "The grouped user intents"
|
|
3652
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3653
|
+
...paginatedInsightsInputShape,
|
|
3654
|
+
tools: z.array(z.string().trim().min(1)).min(1).max(100).optional(),
|
|
3655
|
+
clientIds: z.array(z.string().min(1)).min(1).max(100).optional(),
|
|
3656
|
+
categoryIds: z.array(z.string().trim().min(1)).min(1).max(100).optional(),
|
|
3657
|
+
sortDir: z.enum(["asc", "desc"]).default("desc")
|
|
3658
|
+
})).output(z.object({
|
|
3659
|
+
intents: z.array(z.object({
|
|
3660
|
+
id: z.string(),
|
|
3661
|
+
intentIds: z.array(z.string()).min(1),
|
|
3662
|
+
environmentId: z.string(),
|
|
3663
|
+
message: z.string(),
|
|
3664
|
+
toolName: z.string(),
|
|
3665
|
+
createdAt: z.coerce.date(),
|
|
3666
|
+
occurrenceCount: z.number().int().positive(),
|
|
3667
|
+
clientName: z.string().nullable(),
|
|
3668
|
+
clientId: z.string().nullable(),
|
|
3669
|
+
categories: z.array(z.object({
|
|
3670
|
+
id: z.string(),
|
|
3671
|
+
name: z.string(),
|
|
3672
|
+
color: intentCategoryColorSchema
|
|
3673
|
+
}))
|
|
3674
|
+
})),
|
|
3675
|
+
totalCount: z.number().int().nonnegative()
|
|
3676
|
+
}));
|
|
3677
|
+
const listFeedbacksContractV1 = base.route({
|
|
3678
|
+
path: "/v1/environments/{environmentId}/feedbacks",
|
|
3679
|
+
method: "GET",
|
|
3680
|
+
summary: "List feedbacks",
|
|
3681
|
+
description: "List user feedback for an environment over a time range",
|
|
3682
|
+
tags: ["insights"],
|
|
3683
|
+
successDescription: "The user feedback"
|
|
3684
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3685
|
+
...paginatedInsightsInputShape,
|
|
3686
|
+
clientIds: z.array(z.string().min(1)).min(1).max(100).optional()
|
|
3687
|
+
})).output(z.object({
|
|
3688
|
+
feedbacks: z.array(feedbackSchema.extend({ clientId: z.string().nullable() })),
|
|
3689
|
+
totalCount: z.number().int().nonnegative()
|
|
3690
|
+
}));
|
|
3691
|
+
const intentCategoryNameSchema = z.string().trim().min(1).max(100).describe("The category name");
|
|
3692
|
+
const categorizableIntentIdsSchema = z.array(z.string().trim().min(1)).min(1).max(100).describe("IDs of the intents to categorize");
|
|
3693
|
+
const listIntentCategoriesContractV1 = base.route({
|
|
3694
|
+
path: "/v1/environments/{environmentId}/intent-categories",
|
|
3695
|
+
method: "GET",
|
|
3696
|
+
summary: "List intent categories",
|
|
3697
|
+
description: "List intent categories for an environment, including how many intents each category is linked to",
|
|
3698
|
+
tags: ["insights"],
|
|
3699
|
+
successDescription: "The intent categories"
|
|
3700
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(intentCategorySummarySchema));
|
|
3701
|
+
const createIntentCategoryContractV1 = base.route({
|
|
3702
|
+
path: "/v1/environments/{environmentId}/intent-categories",
|
|
3703
|
+
method: "POST",
|
|
3704
|
+
summary: "Create an intent category",
|
|
3705
|
+
description: "Create an intent category, optionally linking it to existing intents",
|
|
3706
|
+
tags: ["insights"],
|
|
3707
|
+
successDescription: "The created intent category"
|
|
3708
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3709
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3710
|
+
name: intentCategoryNameSchema,
|
|
3711
|
+
color: intentCategoryColorSchema.optional().describe("The category color; derived from the name when omitted"),
|
|
3712
|
+
intentIds: categorizableIntentIdsSchema.optional().describe("IDs of intents to link to the new category")
|
|
3713
|
+
})).output(intentCategorySchema);
|
|
3714
|
+
const updateIntentCategoryContractV1 = base.route({
|
|
3715
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}",
|
|
3716
|
+
method: "PATCH",
|
|
3717
|
+
summary: "Update an intent category",
|
|
3718
|
+
description: "Rename or recolor an intent category",
|
|
3719
|
+
tags: ["insights"],
|
|
3720
|
+
successDescription: "The updated intent category"
|
|
3721
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3722
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3723
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
3724
|
+
name: intentCategoryNameSchema.optional(),
|
|
3725
|
+
color: intentCategoryColorSchema.optional().describe("The category color")
|
|
3726
|
+
}).refine(({ name, color }) => name !== void 0 || color !== void 0, { message: "At least one of name or color must be provided" })).output(intentCategorySchema);
|
|
3727
|
+
const deleteIntentCategoryContractV1 = base.route({
|
|
3728
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}",
|
|
3729
|
+
method: "DELETE",
|
|
3730
|
+
summary: "Delete an intent category",
|
|
3731
|
+
description: "Delete an intent category; its intents are unlinked but not deleted",
|
|
3732
|
+
tags: ["insights"],
|
|
3733
|
+
successDescription: "The intent category has been deleted successfully"
|
|
3734
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3735
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3736
|
+
categoryId: z.string().describe("The ID of the category")
|
|
3737
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
3738
|
+
const linkIntentCategoryContractV1 = base.route({
|
|
3739
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}/link",
|
|
3740
|
+
method: "POST",
|
|
3741
|
+
summary: "Link an intent category",
|
|
3742
|
+
description: "Link an intent category to intents; already linked intents are ignored",
|
|
3743
|
+
tags: ["insights"],
|
|
3744
|
+
successDescription: "The intents have been linked successfully"
|
|
3745
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3746
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3747
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
3748
|
+
intentIds: categorizableIntentIdsSchema
|
|
3749
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
3750
|
+
const unlinkIntentCategoryContractV1 = base.route({
|
|
3751
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}/unlink",
|
|
3752
|
+
method: "POST",
|
|
3753
|
+
summary: "Unlink an intent category",
|
|
3754
|
+
description: "Unlink an intent category from intents; intents without the category are ignored",
|
|
3755
|
+
tags: ["insights"],
|
|
3756
|
+
successDescription: "The intents have been unlinked successfully"
|
|
3757
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3758
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
3759
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
3760
|
+
intentIds: categorizableIntentIdsSchema
|
|
3761
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
3762
|
+
const listTeamsContractV1 = base.route({
|
|
940
3763
|
path: "/v1/teams",
|
|
941
3764
|
method: "GET",
|
|
942
3765
|
summary: "List teams",
|
|
@@ -949,28 +3772,40 @@ const listTeamsContractV1 = oc.route({
|
|
|
949
3772
|
createdAt: z.coerce.date(),
|
|
950
3773
|
hasStripeAccount: z.boolean()
|
|
951
3774
|
})));
|
|
952
|
-
const
|
|
3775
|
+
const getTeamUsageContractV1 = base.route({
|
|
3776
|
+
path: "/v1/teams/{teamId}/usage",
|
|
3777
|
+
method: "GET",
|
|
3778
|
+
summary: "Get team usage",
|
|
3779
|
+
description: "Get the MCP request usage of a team for its current billing window. A team that has made no request in the window reports zero.",
|
|
3780
|
+
tags: ["teams"],
|
|
3781
|
+
successDescription: "The current billing window usage"
|
|
3782
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().describe("The ID of the team") })).output(z.object({
|
|
3783
|
+
teamId: z.string(),
|
|
3784
|
+
plan: subscriptionPlanSchema.nullable().describe("The plan in force for the window, null on the Free plan"),
|
|
3785
|
+
periodStart: z.coerce.date().describe("Start of the current billing window"),
|
|
3786
|
+
periodEnd: z.coerce.date().describe("End of the current billing window"),
|
|
3787
|
+
requestCount: z.number().int().describe("MCP requests settled during the current billing window"),
|
|
3788
|
+
includedRequests: z.number().int().nullable().describe("Requests included in the plan for one window, null when the allowance is contract-specific")
|
|
3789
|
+
}));
|
|
3790
|
+
const getTunnelTicketContractV1 = base.route({
|
|
953
3791
|
path: "/v1/tunnels/ticket",
|
|
954
3792
|
method: "GET",
|
|
955
3793
|
summary: "Get a tunnel ticket",
|
|
956
3794
|
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
957
3795
|
tags: ["tunnels"],
|
|
958
3796
|
successDescription: "The tunnel ticket"
|
|
959
|
-
}).output(z.object({
|
|
3797
|
+
}).meta({ authScope: AUTH_SCOPE_USER }).errors({ FORBIDDEN: {} }).output(z.object({
|
|
960
3798
|
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
961
3799
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
962
3800
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
963
3801
|
}));
|
|
964
|
-
const publishServerContractV1 =
|
|
3802
|
+
const publishServerContractV1 = base.route({
|
|
965
3803
|
path: "/v1/distribution/publish",
|
|
966
3804
|
method: "POST",
|
|
967
3805
|
summary: "Publish a server to the MCP registry",
|
|
968
3806
|
tags: ["distribution"],
|
|
969
3807
|
successDescription: "The server has been published successfully"
|
|
970
|
-
}).errors({
|
|
971
|
-
NOT_FOUND: {},
|
|
972
|
-
BAD_REQUEST: {}
|
|
973
|
-
}).input(z.object({
|
|
3808
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
974
3809
|
projectId: z.string(),
|
|
975
3810
|
domain: z.string(),
|
|
976
3811
|
title: z.string().min(1).max(100),
|
|
@@ -979,17 +3814,14 @@ const publishServerContractV1 = oc.route({
|
|
|
979
3814
|
iconSrc: z.url().max(255).optional(),
|
|
980
3815
|
dryRun: z.boolean().optional()
|
|
981
3816
|
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
982
|
-
const getServerInfoContractV1 =
|
|
3817
|
+
const getServerInfoContractV1 = base.route({
|
|
983
3818
|
path: "/v1/distribution/get",
|
|
984
3819
|
method: "GET",
|
|
985
3820
|
summary: "Get server info",
|
|
986
3821
|
description: "Get info about a server",
|
|
987
3822
|
tags: ["distribution"],
|
|
988
3823
|
successDescription: "The server info"
|
|
989
|
-
}).errors({
|
|
990
|
-
NOT_FOUND: {},
|
|
991
|
-
BAD_REQUEST: {}
|
|
992
|
-
}).input(z.object({
|
|
3824
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
993
3825
|
projectId: z.string(),
|
|
994
3826
|
domain: z.string()
|
|
995
3827
|
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
@@ -1008,7 +3840,7 @@ const playgroundOutputSchema = z.object({
|
|
|
1008
3840
|
isPlaygroundEnabled: z.boolean(),
|
|
1009
3841
|
serverMetadata: playgroundServerMetadataOutputSchema.nullable()
|
|
1010
3842
|
});
|
|
1011
|
-
const getPlaygroundContractV1 =
|
|
3843
|
+
const getPlaygroundContractV1 = base.route({
|
|
1012
3844
|
path: "/v1/environments/{environmentId}/playground",
|
|
1013
3845
|
method: "GET",
|
|
1014
3846
|
summary: "Get playground configuration",
|
|
@@ -1016,25 +3848,22 @@ const getPlaygroundContractV1 = oc.route({
|
|
|
1016
3848
|
tags: ["environments"],
|
|
1017
3849
|
successDescription: "The playground configuration"
|
|
1018
3850
|
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
|
|
1019
|
-
const upsertPlaygroundContractV1 =
|
|
3851
|
+
const upsertPlaygroundContractV1 = base.route({
|
|
1020
3852
|
path: "/v1/environments/{environmentId}/playground",
|
|
1021
3853
|
method: "PUT",
|
|
1022
3854
|
summary: "Update playground configuration",
|
|
1023
3855
|
description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
|
|
1024
3856
|
tags: ["environments"],
|
|
1025
3857
|
successDescription: "The updated playground configuration"
|
|
1026
|
-
}).errors({
|
|
1027
|
-
NOT_FOUND: {},
|
|
1028
|
-
BAD_REQUEST: {}
|
|
1029
|
-
}).input(z.object({
|
|
3858
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1030
3859
|
environmentId: z.string().describe("The ID of the environment"),
|
|
1031
3860
|
isPlaygroundEnabled: z.boolean().optional(),
|
|
1032
3861
|
name: z.string().min(1).max(100).optional(),
|
|
1033
3862
|
description: z.string().min(1).max(500).optional(),
|
|
1034
3863
|
headers: z.array(playgroundHeaderSchema).optional(),
|
|
1035
|
-
examplePrompts: z.array(playgroundExamplePromptSchema).max(
|
|
3864
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(5).optional()
|
|
1036
3865
|
})).output(playgroundOutputSchema);
|
|
1037
|
-
const createBeaconContractV1 =
|
|
3866
|
+
const createBeaconContractV1 = base.route({
|
|
1038
3867
|
path: "/v1/beacon/audits",
|
|
1039
3868
|
method: "POST",
|
|
1040
3869
|
summary: "Create a beacon audit",
|
|
@@ -1043,7 +3872,6 @@ const createBeaconContractV1 = oc.route({
|
|
|
1043
3872
|
successDescription: "The audit has been created"
|
|
1044
3873
|
}).errors({
|
|
1045
3874
|
NOT_FOUND: {},
|
|
1046
|
-
BAD_REQUEST: {},
|
|
1047
3875
|
DNS_RESOLUTION_FAILED: { status: 400 }
|
|
1048
3876
|
}).input(z.object({
|
|
1049
3877
|
targetUrl: z.url().describe("The HTTPS URL of the MCP server to audit"),
|
|
@@ -1051,7 +3879,7 @@ const createBeaconContractV1 = oc.route({
|
|
|
1051
3879
|
projectId: z.string().optional().describe("The project ID to associate the audit with"),
|
|
1052
3880
|
excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
|
|
1053
3881
|
})).output(z.object({ id: z.string() }));
|
|
1054
|
-
const getBeaconContractV1 =
|
|
3882
|
+
const getBeaconContractV1 = base.route({
|
|
1055
3883
|
path: "/v1/beacon/audits/{auditId}",
|
|
1056
3884
|
method: "GET",
|
|
1057
3885
|
summary: "Get a beacon audit",
|
|
@@ -1066,9 +3894,73 @@ const getBeaconContractV1 = oc.route({
|
|
|
1066
3894
|
createdAt: z.coerce.date(),
|
|
1067
3895
|
report: auditReportWithScreenshotsSchema.nullable()
|
|
1068
3896
|
}));
|
|
3897
|
+
const PLATFORM_DESCRIPTION = "The directory the package targets: `chatgpt` for the OpenAI App Directory, `claudeai` for the Anthropic MCP Directory";
|
|
3898
|
+
const submissionIdSchema = z.string().describe("The ID of the submission package");
|
|
3899
|
+
const claudeSubmissionUpdateSchema = claudeSubmissionDraftSchema.strict();
|
|
3900
|
+
const chatgptSubmissionUpdateSchema = chatgptSubmissionDraftSchema.strict();
|
|
3901
|
+
const createSubmissionContractV1 = base.route({
|
|
3902
|
+
path: "/v1/submissions",
|
|
3903
|
+
method: "POST",
|
|
3904
|
+
summary: "Create a submission package",
|
|
3905
|
+
description: "Create a submission package for an environment. Alpic reads the environment's live MCP server and prefills every field it can infer, so the response already carries the populated package. The environment must have a successful deployment and must not require authentication.",
|
|
3906
|
+
tags: ["submissions"],
|
|
3907
|
+
successDescription: "The created submission package, with its prefilled fields"
|
|
3908
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3909
|
+
environmentId: z.string().describe("The ID of the environment to build the package from"),
|
|
3910
|
+
platform: platformSchema.describe(PLATFORM_DESCRIPTION)
|
|
3911
|
+
})).output(submissionSchema);
|
|
3912
|
+
const listSubmissionsContractV1 = base.route({
|
|
3913
|
+
path: "/v1/projects/{projectId}/submissions",
|
|
3914
|
+
method: "GET",
|
|
3915
|
+
summary: "List submission packages",
|
|
3916
|
+
description: "List the submission packages of a project, grouped by directory and most recently updated first, optionally narrowed to one environment or one directory",
|
|
3917
|
+
tags: ["submissions"],
|
|
3918
|
+
successDescription: "The list of submission packages"
|
|
3919
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
3920
|
+
projectId: z.string().describe("The ID of the project"),
|
|
3921
|
+
environmentId: z.string().optional().describe("Filter by environment ID"),
|
|
3922
|
+
platform: platformSchema.optional().describe(PLATFORM_DESCRIPTION)
|
|
3923
|
+
})).output(z.array(submissionSchema));
|
|
3924
|
+
const getSubmissionContractV1 = base.route({
|
|
3925
|
+
path: "/v1/submissions/{submissionId}",
|
|
3926
|
+
method: "GET",
|
|
3927
|
+
summary: "Get a submission package",
|
|
3928
|
+
description: "Get a submission package by ID, including its form data and the prefill it started from",
|
|
3929
|
+
tags: ["submissions"],
|
|
3930
|
+
successDescription: "The submission package"
|
|
3931
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ submissionId: submissionIdSchema })).output(submissionSchema);
|
|
3932
|
+
const updateSubmissionContractV1 = base.route({
|
|
3933
|
+
path: "/v1/submissions/{submissionId}",
|
|
3934
|
+
method: "PUT",
|
|
3935
|
+
summary: "Update a submission package",
|
|
3936
|
+
description: "Update the form data of a submission package. Only the fields you send are changed; the rest are left as they are. Unknown field names are rejected rather than ignored, so a typo fails the call. `platform` must match the package's own platform.",
|
|
3937
|
+
tags: ["submissions"],
|
|
3938
|
+
successDescription: "The updated submission package"
|
|
3939
|
+
}).errors({ NOT_FOUND: {} }).input(z.discriminatedUnion("platform", [z.object({
|
|
3940
|
+
submissionId: submissionIdSchema,
|
|
3941
|
+
platform: z.literal("claudeai").describe(PLATFORM_DESCRIPTION),
|
|
3942
|
+
formData: claudeSubmissionUpdateSchema
|
|
3943
|
+
}), z.object({
|
|
3944
|
+
submissionId: submissionIdSchema,
|
|
3945
|
+
platform: z.literal("chatgpt").describe(PLATFORM_DESCRIPTION),
|
|
3946
|
+
formData: chatgptSubmissionUpdateSchema
|
|
3947
|
+
})])).output(submissionSchema);
|
|
1069
3948
|
const contract = {
|
|
1070
|
-
teams: {
|
|
3949
|
+
teams: {
|
|
3950
|
+
list: { v1: listTeamsContractV1 },
|
|
3951
|
+
getUsage: { v1: getTeamUsageContractV1 }
|
|
3952
|
+
},
|
|
1071
3953
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
3954
|
+
intents: { list: { v1: listIntentsContractV1 } },
|
|
3955
|
+
intentCategories: {
|
|
3956
|
+
list: { v1: listIntentCategoriesContractV1 },
|
|
3957
|
+
create: { v1: createIntentCategoryContractV1 },
|
|
3958
|
+
update: { v1: updateIntentCategoryContractV1 },
|
|
3959
|
+
delete: { v1: deleteIntentCategoryContractV1 },
|
|
3960
|
+
link: { v1: linkIntentCategoryContractV1 },
|
|
3961
|
+
unlink: { v1: unlinkIntentCategoryContractV1 }
|
|
3962
|
+
},
|
|
3963
|
+
feedbacks: { list: { v1: listFeedbacksContractV1 } },
|
|
1072
3964
|
deployments: {
|
|
1073
3965
|
list: { v1: listDeploymentsContractV1 },
|
|
1074
3966
|
get: { v1: getDeploymentContractV1 },
|
|
@@ -1078,6 +3970,7 @@ const contract = {
|
|
|
1078
3970
|
environments: {
|
|
1079
3971
|
create: { v1: createEnvironmentContractV1 },
|
|
1080
3972
|
get: { v1: getEnvironmentContractV1 },
|
|
3973
|
+
delete: { v1: deleteEnvironmentContractV1 },
|
|
1081
3974
|
deploy: { v1: deployEnvironmentContractV1 },
|
|
1082
3975
|
getLogs: { v1: getLogsContractV1 },
|
|
1083
3976
|
getLatestLogs: { v1: getLatestLogsContractV1 }
|
|
@@ -1088,6 +3981,12 @@ const contract = {
|
|
|
1088
3981
|
update: { v1: updateEnvironmentVariableContractV1 },
|
|
1089
3982
|
delete: { v1: deleteEnvironmentVariableContractV1 }
|
|
1090
3983
|
},
|
|
3984
|
+
telemetryDestinations: {
|
|
3985
|
+
list: { v1: listTelemetryDestinationsContractV1 },
|
|
3986
|
+
create: { v1: createTelemetryDestinationContractV1 },
|
|
3987
|
+
update: { v1: updateTelemetryDestinationContractV1 },
|
|
3988
|
+
delete: { v1: deleteTelemetryDestinationContractV1 }
|
|
3989
|
+
},
|
|
1091
3990
|
projects: {
|
|
1092
3991
|
update: { v1: updateProjectContractV1 },
|
|
1093
3992
|
get: { v1: getProjectContractV1 },
|
|
@@ -1107,7 +4006,39 @@ const contract = {
|
|
|
1107
4006
|
beacon: {
|
|
1108
4007
|
create: { v1: createBeaconContractV1 },
|
|
1109
4008
|
get: { v1: getBeaconContractV1 }
|
|
4009
|
+
},
|
|
4010
|
+
submissions: {
|
|
4011
|
+
create: { v1: createSubmissionContractV1 },
|
|
4012
|
+
list: { v1: listSubmissionsContractV1 },
|
|
4013
|
+
get: { v1: getSubmissionContractV1 },
|
|
4014
|
+
update: { v1: updateSubmissionContractV1 }
|
|
4015
|
+
}
|
|
4016
|
+
};
|
|
4017
|
+
const { uploadArtifact: _discard, ...deploymentsForDocs } = contract.deployments;
|
|
4018
|
+
const contractForDocs = {
|
|
4019
|
+
...contract,
|
|
4020
|
+
deployments: deploymentsForDocs
|
|
4021
|
+
};
|
|
4022
|
+
/** Shared by the served `openapi.json` and the snapshot test that guards it, so the two cannot drift. */
|
|
4023
|
+
const OPENAPI_DOC_OPTIONS = {
|
|
4024
|
+
info: {
|
|
4025
|
+
title: "Alpic API",
|
|
4026
|
+
version: "1.0.0"
|
|
4027
|
+
},
|
|
4028
|
+
servers: [{ url: "https://api.alpic.ai" }],
|
|
4029
|
+
security: [{ bearerAuth: [] }],
|
|
4030
|
+
components: { securitySchemes: { bearerAuth: {
|
|
4031
|
+
type: "http",
|
|
4032
|
+
description: "Bearer token for authentication. Use an API key from the API Keys page in team settings, or an OAuth access token.",
|
|
4033
|
+
scheme: "bearer"
|
|
4034
|
+
} } },
|
|
4035
|
+
commonSchemas: {
|
|
4036
|
+
Submission: { schema: submissionSchema },
|
|
4037
|
+
ClaudeSubmissionFormData: { schema: claudeSubmissionDraftSchema },
|
|
4038
|
+
ChatgptSubmissionFormData: { schema: chatgptSubmissionDraftSchema },
|
|
4039
|
+
ClaudeSubmissionFormDataUpdate: { schema: claudeSubmissionUpdateSchema },
|
|
4040
|
+
ChatgptSubmissionFormDataUpdate: { schema: chatgptSubmissionUpdateSchema }
|
|
1110
4041
|
}
|
|
1111
4042
|
};
|
|
1112
4043
|
//#endregion
|
|
1113
|
-
export { PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
4044
|
+
export { AI_PLATFORMS, AUTH_SCOPE_ANY, AUTH_SCOPE_USER, INTENT_CATEGORY_COLORS, OPENAPI_DOC_OPTIONS, OTLP_PROTOCOLS, PLATFORM_LABELS, TELEMETRY_SIGNALS, buildSettingsSchema, chatgptSubmissionUpdateSchema, claudeSubmissionUpdateSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, intentCategoryColorSchema, otlpProtocolSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, telemetrySignalSchema, transportSchema, updateEnvironmentVariableSchema };
|