@alpic-ai/api 0.0.0-staging.e2ffb8b → 0.0.0-staging.e366eba
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 +622 -44
- package/dist/index.mjs +380 -15
- package/package.json +11 -8
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import ms from "ms";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/schemas.ts
|
|
4
5
|
const RESERVED_KEYS = [
|
|
@@ -42,6 +43,10 @@ const environmentVariableSchema = z.object({
|
|
|
42
43
|
isSecret: z.boolean().default(false)
|
|
43
44
|
});
|
|
44
45
|
const environmentVariablesSchema = z.array(environmentVariableSchema);
|
|
46
|
+
const updateEnvironmentVariableSchema = environmentVariableSchema.partial({
|
|
47
|
+
value: true,
|
|
48
|
+
isSecret: true
|
|
49
|
+
});
|
|
45
50
|
const buildSettingsSchema = z.object({
|
|
46
51
|
installCommand: z.string().optional(),
|
|
47
52
|
buildCommand: z.string().optional(),
|
|
@@ -59,6 +64,105 @@ const transportSchema = z.enum([
|
|
|
59
64
|
"sse",
|
|
60
65
|
"streamablehttp"
|
|
61
66
|
]);
|
|
67
|
+
const auditStatusSchema = z.enum([
|
|
68
|
+
"pending",
|
|
69
|
+
"partial",
|
|
70
|
+
"completed",
|
|
71
|
+
"failed"
|
|
72
|
+
]);
|
|
73
|
+
const platformSchema = z.enum(["chatgpt", "claudeai"]);
|
|
74
|
+
const checkSeveritySchema = z.enum([
|
|
75
|
+
"error",
|
|
76
|
+
"warning",
|
|
77
|
+
"info"
|
|
78
|
+
]);
|
|
79
|
+
const checkCategorySchema = z.enum([
|
|
80
|
+
"connectivity",
|
|
81
|
+
"tool-metadata",
|
|
82
|
+
"resource-metadata",
|
|
83
|
+
"performance",
|
|
84
|
+
"e2e",
|
|
85
|
+
"ai-review"
|
|
86
|
+
]);
|
|
87
|
+
const checkScopeSchema = z.enum(["server", "view"]);
|
|
88
|
+
const checkDetailSchema = z.object({
|
|
89
|
+
label: z.string(),
|
|
90
|
+
value: z.string().optional()
|
|
91
|
+
});
|
|
92
|
+
const checkResultSchema = z.object({
|
|
93
|
+
checkId: z.string(),
|
|
94
|
+
checkName: z.string(),
|
|
95
|
+
description: z.string(),
|
|
96
|
+
status: z.enum([
|
|
97
|
+
"pass",
|
|
98
|
+
"fail",
|
|
99
|
+
"skip",
|
|
100
|
+
"pending"
|
|
101
|
+
]),
|
|
102
|
+
message: z.string(),
|
|
103
|
+
skipReason: z.string().optional(),
|
|
104
|
+
severity: checkSeveritySchema,
|
|
105
|
+
category: checkCategorySchema,
|
|
106
|
+
scope: checkScopeSchema,
|
|
107
|
+
platforms: z.array(platformSchema).readonly().optional(),
|
|
108
|
+
durationMs: z.number(),
|
|
109
|
+
details: z.array(checkDetailSchema).optional(),
|
|
110
|
+
hint: z.object({ text: z.string() }).optional()
|
|
111
|
+
});
|
|
112
|
+
const auditReportSchema = z.object({
|
|
113
|
+
schemaVersion: z.string(),
|
|
114
|
+
auditId: z.string(),
|
|
115
|
+
targetUrl: z.string(),
|
|
116
|
+
startedAt: z.string(),
|
|
117
|
+
completedAt: z.string(),
|
|
118
|
+
durationMs: z.number(),
|
|
119
|
+
results: z.array(checkResultSchema),
|
|
120
|
+
requiresAuth: z.boolean(),
|
|
121
|
+
hasViewSupport: z.boolean(),
|
|
122
|
+
viewPlatforms: z.array(platformSchema).readonly().optional(),
|
|
123
|
+
isReadyForPlatform: z.record(platformSchema, z.boolean()),
|
|
124
|
+
widgetScreenshotKeys: z.object({
|
|
125
|
+
chatgpt: z.string().optional(),
|
|
126
|
+
claudeai: z.string().optional()
|
|
127
|
+
}).optional(),
|
|
128
|
+
widgetScreenshots: z.object({
|
|
129
|
+
chatgpt: z.object({ url: z.string() }).optional(),
|
|
130
|
+
claudeai: z.object({ url: z.string() }).optional()
|
|
131
|
+
}).optional()
|
|
132
|
+
});
|
|
133
|
+
const playgroundHeaderSchema = z.object({
|
|
134
|
+
name: z.string().min(1).max(100),
|
|
135
|
+
description: z.string().max(200),
|
|
136
|
+
isRequired: z.boolean().default(false),
|
|
137
|
+
isSecret: z.boolean().default(false)
|
|
138
|
+
});
|
|
139
|
+
const playgroundExamplePromptSchema = z.object({
|
|
140
|
+
title: z.string().min(1).max(100),
|
|
141
|
+
prompt: z.string().min(1).max(500)
|
|
142
|
+
});
|
|
143
|
+
const serverFieldsSchema = z.object({
|
|
144
|
+
$schema: z.string(),
|
|
145
|
+
name: z.string(),
|
|
146
|
+
description: z.string(),
|
|
147
|
+
version: z.string().optional(),
|
|
148
|
+
title: z.string().optional(),
|
|
149
|
+
websiteUrl: z.url().optional(),
|
|
150
|
+
icons: z.array(z.object({
|
|
151
|
+
src: z.url(),
|
|
152
|
+
mimeType: z.string().optional(),
|
|
153
|
+
sizes: z.array(z.string()).optional()
|
|
154
|
+
})).optional(),
|
|
155
|
+
remotes: z.array(z.object({
|
|
156
|
+
type: z.string(),
|
|
157
|
+
url: z.url().optional(),
|
|
158
|
+
headers: z.array(z.object({
|
|
159
|
+
name: z.string(),
|
|
160
|
+
description: z.string(),
|
|
161
|
+
isRequired: z.boolean().optional(),
|
|
162
|
+
isSecret: z.boolean().optional()
|
|
163
|
+
})).optional()
|
|
164
|
+
})).optional()
|
|
165
|
+
});
|
|
62
166
|
//#endregion
|
|
63
167
|
//#region src/api.contract.ts
|
|
64
168
|
const deploymentStatusSchema = z.enum([
|
|
@@ -83,9 +187,16 @@ const deploymentSchema = z.object({
|
|
|
83
187
|
authorUsername: z.string().nullable(),
|
|
84
188
|
authorAvatarUrl: z.string().nullable(),
|
|
85
189
|
startedAt: z.coerce.date().nullable(),
|
|
86
|
-
completedAt: z.coerce.date().nullable()
|
|
190
|
+
completedAt: z.coerce.date().nullable(),
|
|
191
|
+
environmentId: z.string(),
|
|
192
|
+
environmentName: z.string(),
|
|
193
|
+
isCurrent: z.boolean(),
|
|
194
|
+
deploymentPageUrl: z.url().nullable()
|
|
87
195
|
});
|
|
88
|
-
const
|
|
196
|
+
const isValidLogTimeInput = (value) => {
|
|
197
|
+
if (ms(value) !== void 0) return true;
|
|
198
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
199
|
+
};
|
|
89
200
|
const createEnvironmentContractV1 = oc.route({
|
|
90
201
|
path: "/v1/environments",
|
|
91
202
|
method: "POST",
|
|
@@ -224,8 +335,61 @@ const createProjectContractV1 = oc.route({
|
|
|
224
335
|
startCommand: z.string().nullable(),
|
|
225
336
|
createdAt: z.coerce.date()
|
|
226
337
|
}));
|
|
338
|
+
const environmentVariableOutputSchema = z.object({
|
|
339
|
+
id: z.string(),
|
|
340
|
+
key: z.string(),
|
|
341
|
+
value: z.string(),
|
|
342
|
+
isSecret: z.boolean(),
|
|
343
|
+
createdAt: z.coerce.date()
|
|
344
|
+
});
|
|
345
|
+
const listEnvironmentVariablesContractV1 = oc.route({
|
|
346
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
347
|
+
method: "GET",
|
|
348
|
+
summary: "List environment variables",
|
|
349
|
+
description: "List all environment variables for an environment",
|
|
350
|
+
tags: ["environments"],
|
|
351
|
+
successDescription: "The list of environment variables"
|
|
352
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
353
|
+
const createEnvironmentVariablesContractV1 = oc.route({
|
|
354
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
355
|
+
method: "POST",
|
|
356
|
+
summary: "Add environment variables",
|
|
357
|
+
description: "Add one or more environment variables to an environment",
|
|
358
|
+
tags: ["environments"],
|
|
359
|
+
successDescription: "The environment variables have been added successfully"
|
|
360
|
+
}).errors({
|
|
361
|
+
NOT_FOUND: {},
|
|
362
|
+
BAD_REQUEST: {}
|
|
363
|
+
}).input(z.object({
|
|
364
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
365
|
+
environmentVariables: environmentVariablesSchema
|
|
366
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
367
|
+
const updateEnvironmentVariableContractV1 = oc.route({
|
|
368
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
369
|
+
method: "PATCH",
|
|
370
|
+
summary: "Update an environment variable",
|
|
371
|
+
description: "Update an environment variable by ID",
|
|
372
|
+
tags: ["environments"],
|
|
373
|
+
successDescription: "The environment variable has been updated successfully"
|
|
374
|
+
}).errors({
|
|
375
|
+
NOT_FOUND: {},
|
|
376
|
+
BAD_REQUEST: {}
|
|
377
|
+
}).input(z.object({
|
|
378
|
+
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
379
|
+
key: environmentVariableSchema.shape.key,
|
|
380
|
+
value: environmentVariableSchema.shape.value.optional(),
|
|
381
|
+
isSecret: environmentVariableSchema.shape.isSecret.optional()
|
|
382
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
383
|
+
const deleteEnvironmentVariableContractV1 = oc.route({
|
|
384
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
385
|
+
method: "DELETE",
|
|
386
|
+
summary: "Delete an environment variable",
|
|
387
|
+
description: "Delete an environment variable by ID",
|
|
388
|
+
tags: ["environments"],
|
|
389
|
+
successDescription: "The environment variable has been deleted successfully"
|
|
390
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
227
391
|
const deleteProjectContractV1 = oc.route({
|
|
228
|
-
path: "/v1/projects
|
|
392
|
+
path: "/v1/projects/{projectId}",
|
|
229
393
|
method: "DELETE",
|
|
230
394
|
summary: "Delete a project",
|
|
231
395
|
description: "Delete a project and all its environments",
|
|
@@ -260,7 +424,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
260
424
|
}).input(z.object({
|
|
261
425
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
262
426
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
263
|
-
})).output(
|
|
427
|
+
})).output(deploymentSchema);
|
|
264
428
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
265
429
|
path: "/v1/deployments/upload",
|
|
266
430
|
method: "POST",
|
|
@@ -269,21 +433,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
269
433
|
tags: ["deployments"],
|
|
270
434
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
271
435
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
272
|
-
uploadUrl: z.
|
|
436
|
+
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
273
437
|
token: z.string().describe("Token to identify the source archive"),
|
|
274
438
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
275
439
|
}));
|
|
276
|
-
const
|
|
440
|
+
const listDeploymentsContractV1 = oc.route({
|
|
277
441
|
path: "/v1/projects/{projectId}/deployments",
|
|
278
442
|
method: "GET",
|
|
279
443
|
summary: "List project deployments",
|
|
280
444
|
description: "List all deployments for a project",
|
|
281
445
|
tags: ["deployments"],
|
|
282
446
|
successDescription: "The list of deployments"
|
|
283
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
447
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
448
|
+
projectId: z.string().describe("The ID of the project"),
|
|
449
|
+
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
450
|
+
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
451
|
+
})).output(z.array(deploymentSchema));
|
|
287
452
|
const getDeploymentContractV1 = oc.route({
|
|
288
453
|
path: "/v1/deployments/{deploymentId}",
|
|
289
454
|
method: "GET",
|
|
@@ -291,7 +456,83 @@ const getDeploymentContractV1 = oc.route({
|
|
|
291
456
|
description: "Get a deployment by ID",
|
|
292
457
|
tags: ["deployments"],
|
|
293
458
|
successDescription: "The deployment details"
|
|
294
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
459
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
460
|
+
const getLogsContractV1 = oc.route({
|
|
461
|
+
path: "/v1/environments/{environmentId}/logs",
|
|
462
|
+
method: "GET",
|
|
463
|
+
summary: "Get logs",
|
|
464
|
+
description: "Get logs for an environment",
|
|
465
|
+
tags: ["environments"],
|
|
466
|
+
successDescription: "The logs"
|
|
467
|
+
}).errors({
|
|
468
|
+
NOT_FOUND: {},
|
|
469
|
+
BAD_REQUEST: {}
|
|
470
|
+
}).input(z.object({
|
|
471
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
472
|
+
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)"),
|
|
473
|
+
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"),
|
|
474
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
475
|
+
level: z.array(z.enum([
|
|
476
|
+
"INFO",
|
|
477
|
+
"ERROR",
|
|
478
|
+
"WARNING",
|
|
479
|
+
"DEBUG"
|
|
480
|
+
])).optional().describe("Filter by log level"),
|
|
481
|
+
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
482
|
+
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
483
|
+
})).output(z.object({
|
|
484
|
+
logs: z.array(z.object({
|
|
485
|
+
timestamp: z.coerce.date(),
|
|
486
|
+
type: z.enum([
|
|
487
|
+
"START",
|
|
488
|
+
"END",
|
|
489
|
+
"INFO",
|
|
490
|
+
"ERROR",
|
|
491
|
+
"WARNING",
|
|
492
|
+
"DEBUG"
|
|
493
|
+
]),
|
|
494
|
+
requestId: z.string(),
|
|
495
|
+
content: z.string().optional(),
|
|
496
|
+
method: z.string().optional(),
|
|
497
|
+
durationInMs: z.number().optional()
|
|
498
|
+
})),
|
|
499
|
+
nextToken: z.string().nullable()
|
|
500
|
+
}));
|
|
501
|
+
const getLatestLogsContractV1 = oc.route({
|
|
502
|
+
path: "/v1/environments/{environmentId}/latest-logs",
|
|
503
|
+
method: "GET",
|
|
504
|
+
summary: "Get latest logs",
|
|
505
|
+
description: "Get the N most recent logs for an environment",
|
|
506
|
+
tags: ["environments"],
|
|
507
|
+
successDescription: "The latest logs"
|
|
508
|
+
}).errors({
|
|
509
|
+
NOT_FOUND: {},
|
|
510
|
+
BAD_REQUEST: {}
|
|
511
|
+
}).input(z.object({
|
|
512
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
513
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(100).describe("Number of most recent log entries to return"),
|
|
514
|
+
level: z.array(z.enum([
|
|
515
|
+
"INFO",
|
|
516
|
+
"ERROR",
|
|
517
|
+
"WARNING",
|
|
518
|
+
"DEBUG"
|
|
519
|
+
])).optional().describe("Filter by log level"),
|
|
520
|
+
search: z.string().optional().describe("Filter pattern to search for in log content")
|
|
521
|
+
})).output(z.object({ logs: z.array(z.object({
|
|
522
|
+
timestamp: z.coerce.date(),
|
|
523
|
+
type: z.enum([
|
|
524
|
+
"START",
|
|
525
|
+
"END",
|
|
526
|
+
"INFO",
|
|
527
|
+
"ERROR",
|
|
528
|
+
"WARNING",
|
|
529
|
+
"DEBUG"
|
|
530
|
+
]),
|
|
531
|
+
requestId: z.string(),
|
|
532
|
+
content: z.string().optional(),
|
|
533
|
+
method: z.string().optional(),
|
|
534
|
+
durationInMs: z.number().optional()
|
|
535
|
+
})) }));
|
|
295
536
|
const getDeploymentLogsContractV1 = oc.route({
|
|
296
537
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
297
538
|
method: "GET",
|
|
@@ -369,11 +610,115 @@ const getTunnelTicketContractV1 = oc.route({
|
|
|
369
610
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
370
611
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
371
612
|
}));
|
|
613
|
+
const publishServerContractV1 = oc.route({
|
|
614
|
+
path: "/v1/distribution/publish",
|
|
615
|
+
method: "POST",
|
|
616
|
+
summary: "Publish a server to the MCP registry",
|
|
617
|
+
tags: ["distribution"],
|
|
618
|
+
successDescription: "The server has been published successfully"
|
|
619
|
+
}).errors({
|
|
620
|
+
NOT_FOUND: {},
|
|
621
|
+
BAD_REQUEST: {}
|
|
622
|
+
}).input(z.object({
|
|
623
|
+
projectId: z.string(),
|
|
624
|
+
domain: z.string(),
|
|
625
|
+
title: z.string().min(1).max(100),
|
|
626
|
+
description: z.string().min(1).max(100),
|
|
627
|
+
websiteUrl: z.url().max(255).optional(),
|
|
628
|
+
iconSrc: z.url().max(255).optional(),
|
|
629
|
+
dryRun: z.boolean().optional()
|
|
630
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
631
|
+
const getServerInfoContractV1 = oc.route({
|
|
632
|
+
path: "/v1/distribution/get",
|
|
633
|
+
method: "GET",
|
|
634
|
+
summary: "Get server info",
|
|
635
|
+
description: "Get info about a server",
|
|
636
|
+
tags: ["distribution"],
|
|
637
|
+
successDescription: "The server info"
|
|
638
|
+
}).errors({
|
|
639
|
+
NOT_FOUND: {},
|
|
640
|
+
BAD_REQUEST: {}
|
|
641
|
+
}).input(z.object({
|
|
642
|
+
projectId: z.string(),
|
|
643
|
+
domain: z.string()
|
|
644
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
645
|
+
const playgroundServerMetadataOutputSchema = z.object({
|
|
646
|
+
name: z.string(),
|
|
647
|
+
description: z.string(),
|
|
648
|
+
headers: z.array(z.object({
|
|
649
|
+
name: z.string(),
|
|
650
|
+
description: z.string(),
|
|
651
|
+
isRequired: z.boolean(),
|
|
652
|
+
isSecret: z.boolean()
|
|
653
|
+
})),
|
|
654
|
+
examplePrompts: z.array(playgroundExamplePromptSchema)
|
|
655
|
+
});
|
|
656
|
+
const playgroundOutputSchema = z.object({
|
|
657
|
+
isPlaygroundEnabled: z.boolean(),
|
|
658
|
+
serverMetadata: playgroundServerMetadataOutputSchema.nullable()
|
|
659
|
+
});
|
|
660
|
+
const getPlaygroundContractV1 = oc.route({
|
|
661
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
662
|
+
method: "GET",
|
|
663
|
+
summary: "Get playground configuration",
|
|
664
|
+
description: "Get the playground configuration for an environment",
|
|
665
|
+
tags: ["environments"],
|
|
666
|
+
successDescription: "The playground configuration"
|
|
667
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
|
|
668
|
+
const upsertPlaygroundContractV1 = oc.route({
|
|
669
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
670
|
+
method: "PUT",
|
|
671
|
+
summary: "Update playground configuration",
|
|
672
|
+
description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
|
|
673
|
+
tags: ["environments"],
|
|
674
|
+
successDescription: "The updated playground configuration"
|
|
675
|
+
}).errors({
|
|
676
|
+
NOT_FOUND: {},
|
|
677
|
+
BAD_REQUEST: {}
|
|
678
|
+
}).input(z.object({
|
|
679
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
680
|
+
isPlaygroundEnabled: z.boolean().optional(),
|
|
681
|
+
name: z.string().min(1).max(100).optional(),
|
|
682
|
+
description: z.string().min(1).max(500).optional(),
|
|
683
|
+
headers: z.array(playgroundHeaderSchema).optional(),
|
|
684
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(3).optional()
|
|
685
|
+
})).output(playgroundOutputSchema);
|
|
686
|
+
const createBeaconContractV1 = oc.route({
|
|
687
|
+
path: "/v1/beacon/audits",
|
|
688
|
+
method: "POST",
|
|
689
|
+
summary: "Create a beacon audit",
|
|
690
|
+
description: "Audit an MCP server for spec compliance and AI client compatibility",
|
|
691
|
+
tags: ["beacon"],
|
|
692
|
+
successDescription: "The audit has been created"
|
|
693
|
+
}).errors({
|
|
694
|
+
NOT_FOUND: {},
|
|
695
|
+
BAD_REQUEST: {}
|
|
696
|
+
}).input(z.object({
|
|
697
|
+
targetUrl: z.string().url().describe("The HTTPS URL of the MCP server to audit"),
|
|
698
|
+
teamId: z.string().optional().describe("The team ID to associate the audit with"),
|
|
699
|
+
projectId: z.string().optional().describe("The project ID to associate the audit with"),
|
|
700
|
+
excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
|
|
701
|
+
})).output(z.object({ id: z.string() }));
|
|
702
|
+
const getBeaconContractV1 = oc.route({
|
|
703
|
+
path: "/v1/beacon/audits/{auditId}",
|
|
704
|
+
method: "GET",
|
|
705
|
+
summary: "Get a beacon audit",
|
|
706
|
+
description: "Get a beacon audit by ID, including the report if completed",
|
|
707
|
+
tags: ["beacon"],
|
|
708
|
+
successDescription: "The audit details"
|
|
709
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ auditId: z.string().describe("The ID of the audit") })).output(z.object({
|
|
710
|
+
id: z.string(),
|
|
711
|
+
targetUrl: z.string(),
|
|
712
|
+
status: auditStatusSchema,
|
|
713
|
+
durationMs: z.number().nullable(),
|
|
714
|
+
createdAt: z.coerce.date(),
|
|
715
|
+
report: auditReportSchema.nullable()
|
|
716
|
+
}));
|
|
372
717
|
const contract = {
|
|
373
718
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
374
719
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
375
720
|
deployments: {
|
|
376
|
-
list: { v1:
|
|
721
|
+
list: { v1: listDeploymentsContractV1 },
|
|
377
722
|
get: { v1: getDeploymentContractV1 },
|
|
378
723
|
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
379
724
|
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
@@ -381,7 +726,15 @@ const contract = {
|
|
|
381
726
|
environments: {
|
|
382
727
|
create: { v1: createEnvironmentContractV1 },
|
|
383
728
|
get: { v1: getEnvironmentContractV1 },
|
|
384
|
-
deploy: { v1: deployEnvironmentContractV1 }
|
|
729
|
+
deploy: { v1: deployEnvironmentContractV1 },
|
|
730
|
+
getLogs: { v1: getLogsContractV1 },
|
|
731
|
+
getLatestLogs: { v1: getLatestLogsContractV1 }
|
|
732
|
+
},
|
|
733
|
+
environmentVariables: {
|
|
734
|
+
list: { v1: listEnvironmentVariablesContractV1 },
|
|
735
|
+
create: { v1: createEnvironmentVariablesContractV1 },
|
|
736
|
+
update: { v1: updateEnvironmentVariableContractV1 },
|
|
737
|
+
delete: { v1: deleteEnvironmentVariableContractV1 }
|
|
385
738
|
},
|
|
386
739
|
projects: {
|
|
387
740
|
update: { v1: updateProjectContractV1 },
|
|
@@ -390,7 +743,19 @@ const contract = {
|
|
|
390
743
|
create: { v1: createProjectContractV1 },
|
|
391
744
|
delete: { v1: deleteProjectContractV1 }
|
|
392
745
|
},
|
|
393
|
-
|
|
746
|
+
playground: {
|
|
747
|
+
get: { v1: getPlaygroundContractV1 },
|
|
748
|
+
upsert: { v1: upsertPlaygroundContractV1 }
|
|
749
|
+
},
|
|
750
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
|
|
751
|
+
distribution: {
|
|
752
|
+
publish: { v1: publishServerContractV1 },
|
|
753
|
+
get: { v1: getServerInfoContractV1 }
|
|
754
|
+
},
|
|
755
|
+
beacon: {
|
|
756
|
+
create: { v1: createBeaconContractV1 },
|
|
757
|
+
get: { v1: getBeaconContractV1 }
|
|
758
|
+
}
|
|
394
759
|
};
|
|
395
760
|
//#endregion
|
|
396
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
761
|
+
export { auditReportSchema, auditStatusSchema, buildSettingsSchema, checkCategorySchema, checkDetailSchema, checkResultSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, platformSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
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.e366eba",
|
|
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.14",
|
|
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.21.
|
|
27
|
-
"typescript": "^
|
|
28
|
-
"vitest": "^4.
|
|
28
|
+
"tsdown": "^0.21.7",
|
|
29
|
+
"typescript": "^6.0.2",
|
|
30
|
+
"vitest": "^4.1.4"
|
|
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
|
}
|