@alpic-ai/api 0.0.0-staging.e2caa7a → 0.0.0-staging.e35e195
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 +603 -41
- package/dist/index.mjs +367 -22
- package/package.json +11 -8
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import ms from "ms";
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
|
|
4
4
|
//#region src/schemas.ts
|
|
5
5
|
const RESERVED_KEYS = [
|
|
6
6
|
"_HANDLER",
|
|
@@ -13,7 +13,11 @@ const RESERVED_KEYS = [
|
|
|
13
13
|
"AWS_LAMBDA_FUNCTION_VERSION",
|
|
14
14
|
"AWS_LAMBDA_INITIALIZATION_TYPE",
|
|
15
15
|
"AWS_LAMBDA_LOG_GROUP_NAME",
|
|
16
|
+
"AWS_LAMBDA_LOG_STREAM_NAME",
|
|
16
17
|
"AWS_ACCESS_KEY",
|
|
18
|
+
"AWS_ACCESS_KEY_ID",
|
|
19
|
+
"AWS_SECRET_ACCESS_KEY",
|
|
20
|
+
"AWS_SESSION_TOKEN",
|
|
17
21
|
"AWS_LAMBDA_RUNTIME_API",
|
|
18
22
|
"LAMBDA_TASK_ROOT",
|
|
19
23
|
"LAMBDA_RUNTIME_DIR",
|
|
@@ -30,7 +34,8 @@ const RESERVED_KEYS = [
|
|
|
30
34
|
"BUILD_ARG_BUILD_COMMAND",
|
|
31
35
|
"BUILD_ARG_BUILD_OUTPUT_DIR",
|
|
32
36
|
"BUILD_ARG_START_COMMAND",
|
|
33
|
-
"ALPIC_HOST"
|
|
37
|
+
"ALPIC_HOST",
|
|
38
|
+
"ALPIC_CUSTOM_DOMAINS"
|
|
34
39
|
];
|
|
35
40
|
const environmentVariableSchema = z.object({
|
|
36
41
|
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"),
|
|
@@ -55,7 +60,102 @@ const transportSchema = z.enum([
|
|
|
55
60
|
"sse",
|
|
56
61
|
"streamablehttp"
|
|
57
62
|
]);
|
|
58
|
-
|
|
63
|
+
const analysisStatusSchema = z.enum([
|
|
64
|
+
"pending",
|
|
65
|
+
"partial",
|
|
66
|
+
"completed",
|
|
67
|
+
"failed"
|
|
68
|
+
]);
|
|
69
|
+
const platformSchema = z.enum(["chatgpt", "claudeai"]);
|
|
70
|
+
const checkSeveritySchema = z.enum([
|
|
71
|
+
"error",
|
|
72
|
+
"warning",
|
|
73
|
+
"info"
|
|
74
|
+
]);
|
|
75
|
+
const checkCategorySchema = z.enum([
|
|
76
|
+
"connectivity",
|
|
77
|
+
"tool-metadata",
|
|
78
|
+
"resource-metadata",
|
|
79
|
+
"performance",
|
|
80
|
+
"e2e"
|
|
81
|
+
]);
|
|
82
|
+
const checkScopeSchema = z.enum(["server", "view"]);
|
|
83
|
+
const checkDetailSchema = z.object({
|
|
84
|
+
label: z.string(),
|
|
85
|
+
value: z.string().optional()
|
|
86
|
+
});
|
|
87
|
+
const checkResultSchema = z.object({
|
|
88
|
+
checkId: z.string(),
|
|
89
|
+
status: z.enum([
|
|
90
|
+
"pass",
|
|
91
|
+
"fail",
|
|
92
|
+
"skip",
|
|
93
|
+
"pending"
|
|
94
|
+
]),
|
|
95
|
+
message: z.string(),
|
|
96
|
+
skipReason: z.string().optional(),
|
|
97
|
+
severity: checkSeveritySchema,
|
|
98
|
+
category: checkCategorySchema,
|
|
99
|
+
scope: checkScopeSchema,
|
|
100
|
+
platforms: z.array(platformSchema).readonly().optional(),
|
|
101
|
+
durationMs: z.number(),
|
|
102
|
+
details: z.array(checkDetailSchema).optional(),
|
|
103
|
+
hint: z.object({ text: z.string() }).optional()
|
|
104
|
+
});
|
|
105
|
+
const auditReportSchema = z.object({
|
|
106
|
+
schemaVersion: z.string(),
|
|
107
|
+
auditId: z.string(),
|
|
108
|
+
targetUrl: z.string(),
|
|
109
|
+
startedAt: z.string(),
|
|
110
|
+
completedAt: z.string(),
|
|
111
|
+
durationMs: z.number(),
|
|
112
|
+
results: z.array(checkResultSchema),
|
|
113
|
+
requiresAuth: z.boolean(),
|
|
114
|
+
hasViewSupport: z.boolean(),
|
|
115
|
+
viewPlatforms: z.array(platformSchema).readonly().optional(),
|
|
116
|
+
isReadyForPlatform: z.record(platformSchema, z.boolean()),
|
|
117
|
+
widgetScreenshotKeys: z.object({
|
|
118
|
+
chatgpt: z.string().optional(),
|
|
119
|
+
claudeai: z.string().optional()
|
|
120
|
+
}).optional(),
|
|
121
|
+
widgetScreenshots: z.object({
|
|
122
|
+
chatgpt: z.object({ url: z.string() }).optional(),
|
|
123
|
+
claudeai: z.object({ url: z.string() }).optional()
|
|
124
|
+
}).optional()
|
|
125
|
+
});
|
|
126
|
+
const playgroundHeaderSchema = z.object({
|
|
127
|
+
name: z.string().min(1).max(100),
|
|
128
|
+
description: z.string().max(200),
|
|
129
|
+
isRequired: z.boolean().default(false),
|
|
130
|
+
isSecret: z.boolean().default(false)
|
|
131
|
+
});
|
|
132
|
+
const playgroundExamplePromptSchema = z.object({
|
|
133
|
+
title: z.string().min(1).max(100),
|
|
134
|
+
prompt: z.string().min(1).max(500)
|
|
135
|
+
});
|
|
136
|
+
const serverFieldsSchema = z.object({
|
|
137
|
+
$schema: z.string(),
|
|
138
|
+
name: z.string(),
|
|
139
|
+
description: z.string(),
|
|
140
|
+
version: z.string().optional(),
|
|
141
|
+
title: z.string().optional(),
|
|
142
|
+
websiteUrl: z.url().optional(),
|
|
143
|
+
icons: z.array(z.object({
|
|
144
|
+
src: z.url(),
|
|
145
|
+
mimeType: z.string().optional(),
|
|
146
|
+
sizes: z.array(z.string()).optional()
|
|
147
|
+
})).optional(),
|
|
148
|
+
remotes: z.array(z.object({
|
|
149
|
+
type: z.string(),
|
|
150
|
+
url: z.url().optional(),
|
|
151
|
+
headers: z.array(z.object({
|
|
152
|
+
name: z.string(),
|
|
153
|
+
description: z.string(),
|
|
154
|
+
isRequired: z.boolean().optional(),
|
|
155
|
+
isSecret: z.boolean().optional()
|
|
156
|
+
})).optional()
|
|
157
|
+
})).optional()
|
|
158
|
+
});
|
|
59
159
|
//#endregion
|
|
60
160
|
//#region src/api.contract.ts
|
|
61
161
|
const deploymentStatusSchema = z.enum([
|
|
@@ -80,9 +180,16 @@ const deploymentSchema = z.object({
|
|
|
80
180
|
authorUsername: z.string().nullable(),
|
|
81
181
|
authorAvatarUrl: z.string().nullable(),
|
|
82
182
|
startedAt: z.coerce.date().nullable(),
|
|
83
|
-
completedAt: z.coerce.date().nullable()
|
|
183
|
+
completedAt: z.coerce.date().nullable(),
|
|
184
|
+
environmentId: z.string(),
|
|
185
|
+
environmentName: z.string(),
|
|
186
|
+
isCurrent: z.boolean(),
|
|
187
|
+
deploymentPageUrl: z.url().nullable()
|
|
84
188
|
});
|
|
85
|
-
const
|
|
189
|
+
const isValidLogTimeInput = (value) => {
|
|
190
|
+
if (ms(value) !== void 0) return true;
|
|
191
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
192
|
+
};
|
|
86
193
|
const createEnvironmentContractV1 = oc.route({
|
|
87
194
|
path: "/v1/environments",
|
|
88
195
|
method: "POST",
|
|
@@ -122,10 +229,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
122
229
|
createdAt: z.coerce.date(),
|
|
123
230
|
projectId: z.string()
|
|
124
231
|
}));
|
|
232
|
+
const domainSchema = z.object({
|
|
233
|
+
domain: z.string(),
|
|
234
|
+
status: z.enum([
|
|
235
|
+
"ongoing",
|
|
236
|
+
"deployed",
|
|
237
|
+
"failed"
|
|
238
|
+
]),
|
|
239
|
+
createdAt: z.coerce.date()
|
|
240
|
+
});
|
|
125
241
|
const productionEnvironmentSchema = z.object({
|
|
126
242
|
id: z.string(),
|
|
127
243
|
name: z.string(),
|
|
128
244
|
mcpServerUrl: z.string(),
|
|
245
|
+
domains: z.array(domainSchema),
|
|
129
246
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
130
247
|
});
|
|
131
248
|
const environmentSchema = z.object({
|
|
@@ -168,7 +285,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
168
285
|
description: "List all projects for a team",
|
|
169
286
|
tags: ["projects"],
|
|
170
287
|
successDescription: "The list of projects"
|
|
171
|
-
}).output(z.array(projectOutputSchema));
|
|
288
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
172
289
|
const createProjectContractV1 = oc.route({
|
|
173
290
|
path: "/v1/projects",
|
|
174
291
|
method: "POST",
|
|
@@ -181,7 +298,7 @@ const createProjectContractV1 = oc.route({
|
|
|
181
298
|
BAD_REQUEST: {}
|
|
182
299
|
}).input(z.object({
|
|
183
300
|
teamId: z.string().optional(),
|
|
184
|
-
name: z.string().min(1).max(100),
|
|
301
|
+
name: z.string().trim().min(1).max(100),
|
|
185
302
|
sourceRepository: z.string().optional(),
|
|
186
303
|
branchName: z.string().min(1).optional(),
|
|
187
304
|
runtime: runtimeSchema,
|
|
@@ -211,8 +328,61 @@ const createProjectContractV1 = oc.route({
|
|
|
211
328
|
startCommand: z.string().nullable(),
|
|
212
329
|
createdAt: z.coerce.date()
|
|
213
330
|
}));
|
|
331
|
+
const environmentVariableOutputSchema = z.object({
|
|
332
|
+
id: z.string(),
|
|
333
|
+
key: z.string(),
|
|
334
|
+
value: z.string(),
|
|
335
|
+
isSecret: z.boolean(),
|
|
336
|
+
createdAt: z.coerce.date()
|
|
337
|
+
});
|
|
338
|
+
const listEnvironmentVariablesContractV1 = oc.route({
|
|
339
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
340
|
+
method: "GET",
|
|
341
|
+
summary: "List environment variables",
|
|
342
|
+
description: "List all environment variables for an environment",
|
|
343
|
+
tags: ["environments"],
|
|
344
|
+
successDescription: "The list of environment variables"
|
|
345
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
346
|
+
const createEnvironmentVariablesContractV1 = oc.route({
|
|
347
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
348
|
+
method: "POST",
|
|
349
|
+
summary: "Add environment variables",
|
|
350
|
+
description: "Add one or more environment variables to an environment",
|
|
351
|
+
tags: ["environments"],
|
|
352
|
+
successDescription: "The environment variables have been added successfully"
|
|
353
|
+
}).errors({
|
|
354
|
+
NOT_FOUND: {},
|
|
355
|
+
BAD_REQUEST: {}
|
|
356
|
+
}).input(z.object({
|
|
357
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
358
|
+
environmentVariables: environmentVariablesSchema
|
|
359
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
360
|
+
const updateEnvironmentVariableContractV1 = oc.route({
|
|
361
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
362
|
+
method: "PATCH",
|
|
363
|
+
summary: "Update an environment variable",
|
|
364
|
+
description: "Update an environment variable by ID",
|
|
365
|
+
tags: ["environments"],
|
|
366
|
+
successDescription: "The environment variable has been updated successfully"
|
|
367
|
+
}).errors({
|
|
368
|
+
NOT_FOUND: {},
|
|
369
|
+
BAD_REQUEST: {}
|
|
370
|
+
}).input(z.object({
|
|
371
|
+
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
372
|
+
key: environmentVariableSchema.shape.key,
|
|
373
|
+
value: environmentVariableSchema.shape.value.optional(),
|
|
374
|
+
isSecret: environmentVariableSchema.shape.isSecret
|
|
375
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
376
|
+
const deleteEnvironmentVariableContractV1 = oc.route({
|
|
377
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
378
|
+
method: "DELETE",
|
|
379
|
+
summary: "Delete an environment variable",
|
|
380
|
+
description: "Delete an environment variable by ID",
|
|
381
|
+
tags: ["environments"],
|
|
382
|
+
successDescription: "The environment variable has been deleted successfully"
|
|
383
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
214
384
|
const deleteProjectContractV1 = oc.route({
|
|
215
|
-
path: "/v1/projects
|
|
385
|
+
path: "/v1/projects/{projectId}",
|
|
216
386
|
method: "DELETE",
|
|
217
387
|
summary: "Delete a project",
|
|
218
388
|
description: "Delete a project and all its environments",
|
|
@@ -247,7 +417,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
247
417
|
}).input(z.object({
|
|
248
418
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
249
419
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
250
|
-
})).output(
|
|
420
|
+
})).output(deploymentSchema);
|
|
251
421
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
252
422
|
path: "/v1/deployments/upload",
|
|
253
423
|
method: "POST",
|
|
@@ -256,21 +426,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
256
426
|
tags: ["deployments"],
|
|
257
427
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
258
428
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
259
|
-
uploadUrl: z.
|
|
429
|
+
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
260
430
|
token: z.string().describe("Token to identify the source archive"),
|
|
261
431
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
262
432
|
}));
|
|
263
|
-
const
|
|
433
|
+
const listDeploymentsContractV1 = oc.route({
|
|
264
434
|
path: "/v1/projects/{projectId}/deployments",
|
|
265
435
|
method: "GET",
|
|
266
436
|
summary: "List project deployments",
|
|
267
437
|
description: "List all deployments for a project",
|
|
268
438
|
tags: ["deployments"],
|
|
269
439
|
successDescription: "The list of deployments"
|
|
270
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
440
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
441
|
+
projectId: z.string().describe("The ID of the project"),
|
|
442
|
+
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
443
|
+
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
444
|
+
})).output(z.array(deploymentSchema));
|
|
274
445
|
const getDeploymentContractV1 = oc.route({
|
|
275
446
|
path: "/v1/deployments/{deploymentId}",
|
|
276
447
|
method: "GET",
|
|
@@ -278,7 +449,48 @@ const getDeploymentContractV1 = oc.route({
|
|
|
278
449
|
description: "Get a deployment by ID",
|
|
279
450
|
tags: ["deployments"],
|
|
280
451
|
successDescription: "The deployment details"
|
|
281
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
452
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
453
|
+
const getLogsContractV1 = oc.route({
|
|
454
|
+
path: "/v1/environments/{environmentId}/logs",
|
|
455
|
+
method: "GET",
|
|
456
|
+
summary: "Get logs",
|
|
457
|
+
description: "Get logs for an environment",
|
|
458
|
+
tags: ["environments"],
|
|
459
|
+
successDescription: "The logs"
|
|
460
|
+
}).errors({
|
|
461
|
+
NOT_FOUND: {},
|
|
462
|
+
BAD_REQUEST: {}
|
|
463
|
+
}).input(z.object({
|
|
464
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
465
|
+
since: z.string().refine(isValidLogTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." }).optional().describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
466
|
+
until: z.string().refine(isValidLogTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." }).optional().describe("End time — ISO 8601 or relative"),
|
|
467
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
468
|
+
level: z.array(z.enum([
|
|
469
|
+
"INFO",
|
|
470
|
+
"ERROR",
|
|
471
|
+
"WARNING",
|
|
472
|
+
"DEBUG"
|
|
473
|
+
])).optional().describe("Filter by log level"),
|
|
474
|
+
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
475
|
+
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
476
|
+
})).output(z.object({
|
|
477
|
+
logs: z.array(z.object({
|
|
478
|
+
timestamp: z.coerce.date(),
|
|
479
|
+
type: z.enum([
|
|
480
|
+
"START",
|
|
481
|
+
"END",
|
|
482
|
+
"INFO",
|
|
483
|
+
"ERROR",
|
|
484
|
+
"WARNING",
|
|
485
|
+
"DEBUG"
|
|
486
|
+
]),
|
|
487
|
+
requestId: z.string(),
|
|
488
|
+
content: z.string().optional(),
|
|
489
|
+
method: z.string().optional(),
|
|
490
|
+
durationInMs: z.number().optional()
|
|
491
|
+
})),
|
|
492
|
+
nextToken: z.string().nullable()
|
|
493
|
+
}));
|
|
282
494
|
const getDeploymentLogsContractV1 = oc.route({
|
|
283
495
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
284
496
|
method: "GET",
|
|
@@ -342,14 +554,128 @@ const listTeamsContractV1 = oc.route({
|
|
|
342
554
|
id: z.string(),
|
|
343
555
|
name: z.string(),
|
|
344
556
|
createdAt: z.coerce.date(),
|
|
345
|
-
hasStripeAccount: z.boolean()
|
|
346
|
-
hasActiveSubscription: z.boolean()
|
|
557
|
+
hasStripeAccount: z.boolean()
|
|
347
558
|
})));
|
|
559
|
+
const getTunnelTicketContractV1 = oc.route({
|
|
560
|
+
path: "/v1/tunnels/ticket",
|
|
561
|
+
method: "GET",
|
|
562
|
+
summary: "Get a tunnel ticket",
|
|
563
|
+
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
564
|
+
tags: ["tunnels"],
|
|
565
|
+
successDescription: "The tunnel ticket"
|
|
566
|
+
}).output(z.object({
|
|
567
|
+
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
568
|
+
ticket: z.string().describe("The signed tunnel ticket"),
|
|
569
|
+
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
570
|
+
}));
|
|
571
|
+
const publishServerContractV1 = oc.route({
|
|
572
|
+
path: "/v1/distribution/publish",
|
|
573
|
+
method: "POST",
|
|
574
|
+
summary: "Publish a server to the MCP registry",
|
|
575
|
+
tags: ["distribution"],
|
|
576
|
+
successDescription: "The server has been published successfully"
|
|
577
|
+
}).errors({
|
|
578
|
+
NOT_FOUND: {},
|
|
579
|
+
BAD_REQUEST: {}
|
|
580
|
+
}).input(z.object({
|
|
581
|
+
projectId: z.string(),
|
|
582
|
+
domain: z.string(),
|
|
583
|
+
title: z.string().min(1).max(100),
|
|
584
|
+
description: z.string().min(1).max(100),
|
|
585
|
+
websiteUrl: z.url().max(255).optional(),
|
|
586
|
+
iconSrc: z.url().max(255).optional(),
|
|
587
|
+
dryRun: z.boolean().optional()
|
|
588
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
589
|
+
const getServerInfoContractV1 = oc.route({
|
|
590
|
+
path: "/v1/distribution/get",
|
|
591
|
+
method: "GET",
|
|
592
|
+
summary: "Get server info",
|
|
593
|
+
description: "Get info about a server",
|
|
594
|
+
tags: ["distribution"],
|
|
595
|
+
successDescription: "The server info"
|
|
596
|
+
}).errors({
|
|
597
|
+
NOT_FOUND: {},
|
|
598
|
+
BAD_REQUEST: {}
|
|
599
|
+
}).input(z.object({
|
|
600
|
+
projectId: z.string(),
|
|
601
|
+
domain: z.string()
|
|
602
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
603
|
+
const playgroundServerMetadataOutputSchema = z.object({
|
|
604
|
+
name: z.string(),
|
|
605
|
+
description: z.string(),
|
|
606
|
+
headers: z.array(z.object({
|
|
607
|
+
name: z.string(),
|
|
608
|
+
description: z.string(),
|
|
609
|
+
isRequired: z.boolean(),
|
|
610
|
+
isSecret: z.boolean()
|
|
611
|
+
})),
|
|
612
|
+
examplePrompts: z.array(playgroundExamplePromptSchema)
|
|
613
|
+
});
|
|
614
|
+
const playgroundOutputSchema = z.object({
|
|
615
|
+
isPlaygroundEnabled: z.boolean(),
|
|
616
|
+
serverMetadata: playgroundServerMetadataOutputSchema.nullable()
|
|
617
|
+
});
|
|
618
|
+
const getPlaygroundContractV1 = oc.route({
|
|
619
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
620
|
+
method: "GET",
|
|
621
|
+
summary: "Get playground configuration",
|
|
622
|
+
description: "Get the playground configuration for an environment",
|
|
623
|
+
tags: ["environments"],
|
|
624
|
+
successDescription: "The playground configuration"
|
|
625
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
|
|
626
|
+
const upsertPlaygroundContractV1 = oc.route({
|
|
627
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
628
|
+
method: "PUT",
|
|
629
|
+
summary: "Update playground configuration",
|
|
630
|
+
description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
|
|
631
|
+
tags: ["environments"],
|
|
632
|
+
successDescription: "The updated playground configuration"
|
|
633
|
+
}).errors({
|
|
634
|
+
NOT_FOUND: {},
|
|
635
|
+
BAD_REQUEST: {}
|
|
636
|
+
}).input(z.object({
|
|
637
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
638
|
+
isPlaygroundEnabled: z.boolean().optional(),
|
|
639
|
+
name: z.string().min(1).max(100).optional(),
|
|
640
|
+
description: z.string().min(1).max(500).optional(),
|
|
641
|
+
headers: z.array(playgroundHeaderSchema).optional(),
|
|
642
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(3).optional()
|
|
643
|
+
})).output(playgroundOutputSchema);
|
|
644
|
+
const createBeaconContractV1 = oc.route({
|
|
645
|
+
path: "/v1/beacon/analyses",
|
|
646
|
+
method: "POST",
|
|
647
|
+
summary: "Create a beacon analysis",
|
|
648
|
+
description: "Analyze an MCP server for spec compliance and AI client compatibility",
|
|
649
|
+
tags: ["beacon"],
|
|
650
|
+
successDescription: "The analysis has been created"
|
|
651
|
+
}).errors({
|
|
652
|
+
NOT_FOUND: {},
|
|
653
|
+
BAD_REQUEST: {}
|
|
654
|
+
}).input(z.object({
|
|
655
|
+
targetUrl: z.string().url().describe("The HTTPS URL of the MCP server to analyze"),
|
|
656
|
+
teamId: z.string().optional().describe("The team ID to associate the analysis with"),
|
|
657
|
+
projectId: z.string().optional().describe("The project ID to associate the analysis with")
|
|
658
|
+
})).output(z.object({ id: z.string() }));
|
|
659
|
+
const getBeaconContractV1 = oc.route({
|
|
660
|
+
path: "/v1/beacon/analyses/{analysisId}",
|
|
661
|
+
method: "GET",
|
|
662
|
+
summary: "Get a beacon analysis",
|
|
663
|
+
description: "Get a beacon analysis by ID, including the report if completed",
|
|
664
|
+
tags: ["beacon"],
|
|
665
|
+
successDescription: "The analysis details"
|
|
666
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ analysisId: z.string().describe("The ID of the analysis") })).output(z.object({
|
|
667
|
+
id: z.string(),
|
|
668
|
+
targetUrl: z.string(),
|
|
669
|
+
status: analysisStatusSchema,
|
|
670
|
+
durationMs: z.number().nullable(),
|
|
671
|
+
createdAt: z.coerce.date(),
|
|
672
|
+
report: auditReportSchema.nullable()
|
|
673
|
+
}));
|
|
348
674
|
const contract = {
|
|
349
675
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
350
676
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
351
677
|
deployments: {
|
|
352
|
-
list: { v1:
|
|
678
|
+
list: { v1: listDeploymentsContractV1 },
|
|
353
679
|
get: { v1: getDeploymentContractV1 },
|
|
354
680
|
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
355
681
|
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
@@ -357,7 +683,14 @@ const contract = {
|
|
|
357
683
|
environments: {
|
|
358
684
|
create: { v1: createEnvironmentContractV1 },
|
|
359
685
|
get: { v1: getEnvironmentContractV1 },
|
|
360
|
-
deploy: { v1: deployEnvironmentContractV1 }
|
|
686
|
+
deploy: { v1: deployEnvironmentContractV1 },
|
|
687
|
+
getLogs: { v1: getLogsContractV1 }
|
|
688
|
+
},
|
|
689
|
+
environmentVariables: {
|
|
690
|
+
list: { v1: listEnvironmentVariablesContractV1 },
|
|
691
|
+
create: { v1: createEnvironmentVariablesContractV1 },
|
|
692
|
+
update: { v1: updateEnvironmentVariableContractV1 },
|
|
693
|
+
delete: { v1: deleteEnvironmentVariableContractV1 }
|
|
361
694
|
},
|
|
362
695
|
projects: {
|
|
363
696
|
update: { v1: updateProjectContractV1 },
|
|
@@ -365,8 +698,20 @@ const contract = {
|
|
|
365
698
|
list: { v1: listProjectsContractV1 },
|
|
366
699
|
create: { v1: createProjectContractV1 },
|
|
367
700
|
delete: { v1: deleteProjectContractV1 }
|
|
701
|
+
},
|
|
702
|
+
playground: {
|
|
703
|
+
get: { v1: getPlaygroundContractV1 },
|
|
704
|
+
upsert: { v1: upsertPlaygroundContractV1 }
|
|
705
|
+
},
|
|
706
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
|
|
707
|
+
distribution: {
|
|
708
|
+
publish: { v1: publishServerContractV1 },
|
|
709
|
+
get: { v1: getServerInfoContractV1 }
|
|
710
|
+
},
|
|
711
|
+
beacon: {
|
|
712
|
+
create: { v1: createBeaconContractV1 },
|
|
713
|
+
get: { v1: getBeaconContractV1 }
|
|
368
714
|
}
|
|
369
715
|
};
|
|
370
|
-
|
|
371
716
|
//#endregion
|
|
372
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
717
|
+
export { analysisStatusSchema, auditReportSchema, buildSettingsSchema, checkDetailSchema, checkResultSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, platformSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-staging.
|
|
3
|
+
"version": "0.0.0-staging.e35e195",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,22 +17,25 @@
|
|
|
17
17
|
"author": "Alpic",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@orpc/contract": "^1.13.
|
|
20
|
+
"@orpc/contract": "^1.13.13",
|
|
21
|
+
"ms": "^2.1.3",
|
|
21
22
|
"zod": "^4.3.6"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
26
|
+
"@types/ms": "^2.1.0",
|
|
25
27
|
"shx": "^0.4.0",
|
|
26
|
-
"tsdown": "^0.
|
|
27
|
-
"typescript": "^
|
|
28
|
-
"vitest": "^4.
|
|
28
|
+
"tsdown": "^0.21.7",
|
|
29
|
+
"typescript": "^6.0.2",
|
|
30
|
+
"vitest": "^4.1.2"
|
|
29
31
|
},
|
|
30
32
|
"scripts": {
|
|
31
33
|
"build": "shx rm -rf dist && tsdown",
|
|
32
|
-
"format": "biome check --write --error-on-warnings",
|
|
34
|
+
"format": "biome check --write --error-on-warnings .",
|
|
33
35
|
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
34
36
|
"test:unit": "vitest run",
|
|
35
|
-
"test:format": "
|
|
36
|
-
"test:type": "tsc --noEmit"
|
|
37
|
+
"test:format": "biome check --error-on-warnings .",
|
|
38
|
+
"test:type": "tsc --noEmit",
|
|
39
|
+
"publish:npm": "pnpm publish --tag \"${NPM_TAG}\" --access public --no-git-checks"
|
|
37
40
|
}
|
|
38
41
|
}
|