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