@alpic-ai/api 0.0.0-dev.ge636196 → 0.0.0-dev.ge66b214

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 CHANGED
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { InferContractRouterInputs, InferContractRouterOutputs } from "@orpc/contract";
3
-
4
3
  //#region src/api.contract.d.ts
5
4
  type ApiContext = {
6
5
  request: Request & {
@@ -225,6 +224,17 @@ declare const contract: {
225
224
  v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
226
225
  environmentId: z.ZodString;
227
226
  token: z.ZodOptional<z.ZodString>;
227
+ settings: z.ZodOptional<z.ZodObject<{
228
+ installCommand: z.ZodOptional<z.ZodString>;
229
+ buildCommand: z.ZodOptional<z.ZodString>;
230
+ buildOutputDir: z.ZodOptional<z.ZodString>;
231
+ startCommand: z.ZodOptional<z.ZodString>;
232
+ transport: z.ZodEnum<{
233
+ stdio: "stdio";
234
+ sse: "sse";
235
+ streamablehttp: "streamablehttp";
236
+ }>;
237
+ }, z.core.$strip>>;
228
238
  }, z.core.$strip>, z.ZodObject<{
229
239
  id: z.ZodString;
230
240
  status: z.ZodEnum<{
package/dist/index.mjs CHANGED
@@ -169,11 +169,21 @@ z$1.object({
169
169
  token: z$1.string(),
170
170
  token_type_hint: z$1.string().optional()
171
171
  }).strip();
172
- const platformSchema = z.enum(["chatgpt", "claudeai"]);
172
+ //#endregion
173
+ //#region ../domains/dist/index.mjs
174
+ const AI_PLATFORMS = ["chatgpt", "claudeai"];
175
+ const platformSchema = z.enum(AI_PLATFORMS);
173
176
  const PLATFORM_LABELS = {
174
177
  chatgpt: "ChatGPT",
175
178
  claudeai: "Claude.ai"
176
179
  };
180
+ const WAF_PLATFORMS = [
181
+ "akamai",
182
+ "cloudflare",
183
+ "fastly"
184
+ ];
185
+ const ALLOWED_PLATFORMS = [...AI_PLATFORMS, ...WAF_PLATFORMS];
186
+ const allowedPlatformSchema = z.enum(ALLOWED_PLATFORMS);
177
187
  const auditStatusSchema = z.enum([
178
188
  "pending",
179
189
  "partial",
@@ -276,11 +286,11 @@ const deploymentSummarySchema = z.object({
276
286
  /**
277
287
  * Public environment
278
288
  *
279
- * No OAuth metadata exposed.
289
+ * Answers anonymously and exposes no OAuth metadata.
280
290
  */
281
291
  const publicEnvironmentSchema = z.object({
282
- isPublic: z.literal(true),
283
- oAuthMetadata: z.undefined().optional()
292
+ allowsAnonymous: z.literal(true),
293
+ oAuthMetadata: z.strictObject({})
284
294
  });
285
295
  /**
286
296
  * Protected environment with an external resource metadata URL
@@ -289,7 +299,7 @@ const publicEnvironmentSchema = z.object({
289
299
  * Everything that follows is handled outside of the MCP server scope.
290
300
  */
291
301
  const externalResourceMetadataEnvironmentSchema = z.object({
292
- isPublic: z.literal(false),
302
+ allowsAnonymous: z.boolean(),
293
303
  oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
294
304
  scope: z.string().optional()
295
305
  });
@@ -301,7 +311,7 @@ const externalResourceMetadataEnvironmentSchema = z.object({
301
311
  * Everything that follows is handled outside of the MCP server scope.
302
312
  */
303
313
  const externalAuthorizationServerEnvironmentSchema = z.object({
304
- isPublic: z.literal(false),
314
+ allowsAnonymous: z.boolean(),
305
315
  oAuthMetadata: z.object({
306
316
  externalAuthorizationServerUrl: z.url(),
307
317
  resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
@@ -315,7 +325,7 @@ const externalAuthorizationServerEnvironmentSchema = z.object({
315
325
  * The server itself exposes the /.well-known/oauth-authorization-server endpoint.
316
326
  */
317
327
  const standaloneEnvironmentSchema = z.object({
318
- isPublic: z.literal(false),
328
+ allowsAnonymous: z.boolean(),
319
329
  oAuthMetadata: z.object({
320
330
  authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
321
331
  resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
@@ -330,6 +340,36 @@ const standaloneEnvironmentSchema = z.object({
330
340
  * are advertised. Clients must obtain credentials out-of-band.
331
341
  */
332
342
  const protectedWithoutDiscoveryEnvironmentSchema = z.object({
343
+ allowsAnonymous: z.literal(false),
344
+ oAuthMetadata: z.strictObject({}),
345
+ scope: z.string().optional()
346
+ });
347
+ const legacyPublicEnvironmentSchema = z.object({
348
+ isPublic: z.literal(true),
349
+ oAuthMetadata: z.undefined().optional()
350
+ });
351
+ const legacyExternalResourceMetadataEnvironmentSchema = z.object({
352
+ isPublic: z.literal(false),
353
+ oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
354
+ scope: z.string().optional()
355
+ });
356
+ const legacyExternalAuthorizationServerEnvironmentSchema = z.object({
357
+ isPublic: z.literal(false),
358
+ oAuthMetadata: z.object({
359
+ externalAuthorizationServerUrl: z.url(),
360
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
361
+ }),
362
+ scope: z.string().optional()
363
+ });
364
+ const legacyStandaloneEnvironmentSchema = z.object({
365
+ isPublic: z.literal(false),
366
+ oAuthMetadata: z.object({
367
+ authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
368
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
369
+ }),
370
+ scope: z.string().optional()
371
+ });
372
+ const legacyProtectedWithoutDiscoveryEnvironmentSchema = z.object({
333
373
  isPublic: z.literal(false),
334
374
  oAuthMetadata: z.strictObject({}),
335
375
  scope: z.string().optional()
@@ -339,9 +379,19 @@ z.union([
339
379
  externalResourceMetadataEnvironmentSchema,
340
380
  externalAuthorizationServerEnvironmentSchema,
341
381
  standaloneEnvironmentSchema,
342
- protectedWithoutDiscoveryEnvironmentSchema
382
+ protectedWithoutDiscoveryEnvironmentSchema,
383
+ legacyPublicEnvironmentSchema,
384
+ legacyExternalResourceMetadataEnvironmentSchema,
385
+ legacyExternalAuthorizationServerEnvironmentSchema,
386
+ legacyStandaloneEnvironmentSchema,
387
+ legacyProtectedWithoutDiscoveryEnvironmentSchema
388
+ ]);
389
+ const playgroundModelSchema = z.enum([
390
+ "global.anthropic.claude-haiku-4-5-20251001-v1:0",
391
+ "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
392
+ "openai.gpt-5.4",
393
+ "openai.gpt-5.5"
343
394
  ]);
344
- const allowedPlatformSchema = platformSchema;
345
395
  const environmentDomainSchema = z.object({
346
396
  name: z.string(),
347
397
  status: z.enum([
@@ -361,6 +411,7 @@ const environmentSchema$1 = z.object({
361
411
  latestDeployment: deploymentSummarySchema.optional(),
362
412
  openaiAppsChallenge: z.string().nullable().optional(),
363
413
  isPlaygroundEnabled: z.boolean(),
414
+ playgroundModel: playgroundModelSchema,
364
415
  isIpWhitelistEnabled: z.boolean(),
365
416
  ipAllowlist: z.array(z.string()).nullable(),
366
417
  allowedPlatforms: z.array(allowedPlatformSchema),
@@ -515,6 +566,10 @@ const domainFailureReasonSchema = z.enum([
515
566
  "invalid_domain",
516
567
  "other"
517
568
  ]);
569
+ const projectDomainMappingSchema = z.object({
570
+ pathPrefix: z.string(),
571
+ environment: environmentSchema$1
572
+ });
518
573
  z.object({
519
574
  name: z.string(),
520
575
  createdAt: z.coerce.date(),
@@ -524,7 +579,8 @@ z.object({
524
579
  "failed"
525
580
  ]),
526
581
  failureReason: domainFailureReasonSchema.nullable(),
527
- environment: environmentSchema$1
582
+ environment: environmentSchema$1,
583
+ mappings: z.array(projectDomainMappingSchema)
528
584
  });
529
585
  const serverFieldsSchema$1 = z.object({
530
586
  $schema: z.string(),
@@ -588,8 +644,9 @@ const positiveTestCaseSchema = z.object({
588
644
  }).partial().describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
589
645
  const screenshotEntrySchema = z.object({
590
646
  prompt: z.string(),
591
- url: z.url().or(z.literal(""))
647
+ url: z.url()
592
648
  }).describe("Each screenshot: the user prompt that produced it + the image URL.");
649
+ const screenshotDraftEntrySchema = screenshotEntrySchema.extend({ url: z.string() });
593
650
  /** Accepts either a valid email or URL. */
594
651
  const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
595
652
  /** A URL field whose error spells out that the scheme is required. */
@@ -948,6 +1005,17 @@ const chatgptSubmissionFormDataSchema = z.object({
948
1005
  allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
949
1006
  releaseNotes: z.string().describe("Publicly displayed on the app details page.")
950
1007
  });
1008
+ const chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
1009
+ tagline: z.string().optional(),
1010
+ companyUrl: z.string().optional(),
1011
+ supportChannel: z.string().optional(),
1012
+ privacyPolicyUrl: z.string().optional(),
1013
+ termsOfServiceUrl: z.string().optional(),
1014
+ demoRecordingUrl: z.string().optional(),
1015
+ serverUrl: z.string().optional(),
1016
+ screenshots: z.array(screenshotDraftEntrySchema).optional(),
1017
+ translations: z.array(chatgptTranslationSchema.extend({ tagline: z.string() })).optional()
1018
+ });
951
1019
  chatgptSubmissionFormDataSchema.pick({
952
1020
  appName: true,
953
1021
  developerName: true,
@@ -1074,6 +1142,21 @@ fully populated account.`),
1074
1142
  submission. Each is an attestation you are legally agreeing to by submitting.`),
1075
1143
  additionalNotes: z.string().optional().describe("Anything else the review team should know about your connector. Optional.")
1076
1144
  });
1145
+ const claudeSubmissionDraftSchema = claudeSubmissionFormDataSchema.partial().extend({
1146
+ serverUrl: z.string().optional(),
1147
+ name: z.string().optional(),
1148
+ slug: z.string().optional(),
1149
+ oneLiner: z.string().optional(),
1150
+ description: z.string().optional(),
1151
+ iconUrl: z.string().optional(),
1152
+ documentation: z.string().optional(),
1153
+ support: z.string().optional(),
1154
+ privacyPolicy: z.string().optional(),
1155
+ companyWebsite: z.string().optional(),
1156
+ primaryContactEmail: z.string().optional(),
1157
+ categories: z.array(claudeCategorySchema).optional(),
1158
+ screenshots: z.array(screenshotDraftEntrySchema).optional()
1159
+ });
1077
1160
  claudeSubmissionFormDataSchema.pick({
1078
1161
  serverUrl: true,
1079
1162
  name: true,
@@ -1114,14 +1197,14 @@ const submissionMetaFieldsSchema = z.object({
1114
1197
  });
1115
1198
  const claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
1116
1199
  platform: z.literal("claudeai"),
1117
- formData: claudeSubmissionFormDataSchema.partial()
1200
+ formData: claudeSubmissionDraftSchema
1118
1201
  });
1119
1202
  const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
1120
1203
  platform: z.literal("chatgpt"),
1121
- formData: chatgptSubmissionFormDataSchema.partial()
1204
+ formData: chatgptSubmissionDraftSchema
1122
1205
  });
1123
1206
  z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
1124
- z.union([claudeSubmissionFormDataSchema.partial(), chatgptSubmissionFormDataSchema.partial()]);
1207
+ z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
1125
1208
  const subscriptionPlanSchema = z.enum([
1126
1209
  "pro",
1127
1210
  "business",
@@ -1505,7 +1588,8 @@ const deployEnvironmentContractV1 = oc.route({
1505
1588
  BAD_REQUEST: {}
1506
1589
  }).input(z.object({
1507
1590
  environmentId: z.string().describe("The ID of the environment to deploy"),
1508
- token: z.string().describe("The token to identify the source archive").optional()
1591
+ token: z.string().describe("The token to identify the source archive").optional(),
1592
+ 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.")
1509
1593
  })).output(deploymentSchema);
1510
1594
  const uploadDeploymentArtifactContractV1 = oc.route({
1511
1595
  path: "/v1/deployments/upload",
@@ -1542,6 +1626,21 @@ const getDeploymentContractV1 = oc.route({
1542
1626
  tags: ["deployments"],
1543
1627
  successDescription: "The deployment details"
1544
1628
  }).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
1629
+ const logEntrySchema = z.object({
1630
+ timestamp: z.coerce.date(),
1631
+ type: z.enum([
1632
+ "START",
1633
+ "END",
1634
+ "INFO",
1635
+ "ERROR",
1636
+ "WARNING",
1637
+ "DEBUG"
1638
+ ]),
1639
+ requestId: z.string(),
1640
+ content: z.string().optional(),
1641
+ method: z.string().optional(),
1642
+ durationInMs: z.number().optional()
1643
+ });
1545
1644
  const getLogsContractV1 = oc.route({
1546
1645
  path: "/v1/environments/{environmentId}/logs",
1547
1646
  method: "GET",
@@ -1566,21 +1665,7 @@ const getLogsContractV1 = oc.route({
1566
1665
  search: z.string().optional().describe("Filter pattern to search for in log content"),
1567
1666
  nextToken: z.string().optional().describe("Pagination token from a previous response")
1568
1667
  })).output(z.object({
1569
- logs: z.array(z.object({
1570
- timestamp: z.coerce.date(),
1571
- type: z.enum([
1572
- "START",
1573
- "END",
1574
- "INFO",
1575
- "ERROR",
1576
- "WARNING",
1577
- "DEBUG"
1578
- ]),
1579
- requestId: z.string(),
1580
- content: z.string().optional(),
1581
- method: z.string().optional(),
1582
- durationInMs: z.number().optional()
1583
- })),
1668
+ logs: z.array(logEntrySchema),
1584
1669
  nextToken: z.string().nullable()
1585
1670
  }));
1586
1671
  const getLatestLogsContractV1 = oc.route({
@@ -1603,21 +1688,7 @@ const getLatestLogsContractV1 = oc.route({
1603
1688
  "DEBUG"
1604
1689
  ])).optional().describe("Filter by log level"),
1605
1690
  search: z.string().optional().describe("Filter pattern to search for in log content")
1606
- })).output(z.object({ logs: z.array(z.object({
1607
- timestamp: z.coerce.date(),
1608
- type: z.enum([
1609
- "START",
1610
- "END",
1611
- "INFO",
1612
- "ERROR",
1613
- "WARNING",
1614
- "DEBUG"
1615
- ]),
1616
- requestId: z.string(),
1617
- content: z.string().optional(),
1618
- method: z.string().optional(),
1619
- durationInMs: z.number().optional()
1620
- })) }));
1691
+ })).output(z.object({ logs: z.array(logEntrySchema) }));
1621
1692
  const getDeploymentLogsContractV1 = oc.route({
1622
1693
  path: "/v1/deployments/{deploymentId}/logs",
1623
1694
  method: "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-dev.ge636196",
3
+ "version": "0.0.0-dev.ge66b214",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -14,22 +14,38 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
+ "nx": {
18
+ "targets": {
19
+ "build": {
20
+ "cache": true,
21
+ "inputs": [
22
+ "{projectRoot}/src/**/*",
23
+ "{projectRoot}/tsdown.config.ts",
24
+ "{projectRoot}/tsconfig.json",
25
+ "^default"
26
+ ],
27
+ "outputs": [
28
+ "{projectRoot}/dist"
29
+ ]
30
+ }
31
+ }
32
+ },
17
33
  "author": "Alpic",
18
34
  "license": "ISC",
19
35
  "dependencies": {
20
- "@orpc/contract": "^1.14.6",
36
+ "@orpc/contract": "^1.14.8",
21
37
  "ms": "^2.1.3",
22
38
  "zod": "^4.4.3"
23
39
  },
24
40
  "devDependencies": {
25
- "@orpc/openapi": "^1.14.6",
26
- "@orpc/zod": "^1.14.6",
41
+ "@orpc/openapi": "^1.14.8",
42
+ "@orpc/zod": "^1.14.8",
27
43
  "@total-typescript/tsconfig": "^1.0.4",
28
44
  "@types/ms": "^2.1.0",
29
45
  "shx": "^0.4.0",
30
- "tsdown": "^0.22.3",
46
+ "tsdown": "^0.22.9",
31
47
  "typescript": "^6.0.3",
32
- "vitest": "^4.1.9",
48
+ "vitest": "^4.1.10",
33
49
  "@alpic-ai/domains": "0.0.0"
34
50
  },
35
51
  "scripts": {
@@ -38,7 +54,7 @@
38
54
  "test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
39
55
  "test:unit": "vitest run",
40
56
  "test:format": "biome check --error-on-warnings .",
41
- "test:type": "tsc --noEmit",
57
+ "test:type": "tsgo --noEmit",
42
58
  "publish:npm": "pnpm publish --tag \"${NPM_TAG}\" --access public --no-git-checks"
43
59
  }
44
60
  }