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