@alpic-ai/api 0.0.0-staging.g19b2cd4 → 0.0.0-staging.g1abcf50

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
@@ -276,11 +276,11 @@ const deploymentSummarySchema = z.object({
276
276
  /**
277
277
  * Public environment
278
278
  *
279
- * No OAuth metadata exposed.
279
+ * Answers anonymously and exposes no OAuth metadata.
280
280
  */
281
281
  const publicEnvironmentSchema = z.object({
282
- isPublic: z.literal(true),
283
- oAuthMetadata: z.undefined().optional()
282
+ allowsAnonymous: z.literal(true),
283
+ oAuthMetadata: z.strictObject({})
284
284
  });
285
285
  /**
286
286
  * Protected environment with an external resource metadata URL
@@ -289,7 +289,7 @@ const publicEnvironmentSchema = z.object({
289
289
  * Everything that follows is handled outside of the MCP server scope.
290
290
  */
291
291
  const externalResourceMetadataEnvironmentSchema = z.object({
292
- isPublic: z.literal(false),
292
+ allowsAnonymous: z.boolean(),
293
293
  oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
294
294
  scope: z.string().optional()
295
295
  });
@@ -301,7 +301,7 @@ const externalResourceMetadataEnvironmentSchema = z.object({
301
301
  * Everything that follows is handled outside of the MCP server scope.
302
302
  */
303
303
  const externalAuthorizationServerEnvironmentSchema = z.object({
304
- isPublic: z.literal(false),
304
+ allowsAnonymous: z.boolean(),
305
305
  oAuthMetadata: z.object({
306
306
  externalAuthorizationServerUrl: z.url(),
307
307
  resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
@@ -315,7 +315,7 @@ const externalAuthorizationServerEnvironmentSchema = z.object({
315
315
  * The server itself exposes the /.well-known/oauth-authorization-server endpoint.
316
316
  */
317
317
  const standaloneEnvironmentSchema = z.object({
318
- isPublic: z.literal(false),
318
+ allowsAnonymous: z.boolean(),
319
319
  oAuthMetadata: z.object({
320
320
  authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
321
321
  resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
@@ -330,6 +330,36 @@ const standaloneEnvironmentSchema = z.object({
330
330
  * are advertised. Clients must obtain credentials out-of-band.
331
331
  */
332
332
  const protectedWithoutDiscoveryEnvironmentSchema = z.object({
333
+ allowsAnonymous: z.literal(false),
334
+ oAuthMetadata: z.strictObject({}),
335
+ scope: z.string().optional()
336
+ });
337
+ const legacyPublicEnvironmentSchema = z.object({
338
+ isPublic: z.literal(true),
339
+ oAuthMetadata: z.undefined().optional()
340
+ });
341
+ const legacyExternalResourceMetadataEnvironmentSchema = z.object({
342
+ isPublic: z.literal(false),
343
+ oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
344
+ scope: z.string().optional()
345
+ });
346
+ const legacyExternalAuthorizationServerEnvironmentSchema = z.object({
347
+ isPublic: z.literal(false),
348
+ oAuthMetadata: z.object({
349
+ externalAuthorizationServerUrl: z.url(),
350
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
351
+ }),
352
+ scope: z.string().optional()
353
+ });
354
+ const legacyStandaloneEnvironmentSchema = z.object({
355
+ isPublic: z.literal(false),
356
+ oAuthMetadata: z.object({
357
+ authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
358
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
359
+ }),
360
+ scope: z.string().optional()
361
+ });
362
+ const legacyProtectedWithoutDiscoveryEnvironmentSchema = z.object({
333
363
  isPublic: z.literal(false),
334
364
  oAuthMetadata: z.strictObject({}),
335
365
  scope: z.string().optional()
@@ -339,9 +369,20 @@ z.union([
339
369
  externalResourceMetadataEnvironmentSchema,
340
370
  externalAuthorizationServerEnvironmentSchema,
341
371
  standaloneEnvironmentSchema,
342
- protectedWithoutDiscoveryEnvironmentSchema
372
+ protectedWithoutDiscoveryEnvironmentSchema,
373
+ legacyPublicEnvironmentSchema,
374
+ legacyExternalResourceMetadataEnvironmentSchema,
375
+ legacyExternalAuthorizationServerEnvironmentSchema,
376
+ legacyStandaloneEnvironmentSchema,
377
+ legacyProtectedWithoutDiscoveryEnvironmentSchema
343
378
  ]);
344
379
  const allowedPlatformSchema = platformSchema;
380
+ const playgroundModelSchema = z.enum([
381
+ "global.anthropic.claude-haiku-4-5-20251001-v1:0",
382
+ "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
383
+ "openai.gpt-5.4",
384
+ "openai.gpt-5.5"
385
+ ]);
345
386
  const environmentDomainSchema = z.object({
346
387
  name: z.string(),
347
388
  status: z.enum([
@@ -361,6 +402,7 @@ const environmentSchema$1 = z.object({
361
402
  latestDeployment: deploymentSummarySchema.optional(),
362
403
  openaiAppsChallenge: z.string().nullable().optional(),
363
404
  isPlaygroundEnabled: z.boolean(),
405
+ playgroundModel: playgroundModelSchema,
364
406
  isIpWhitelistEnabled: z.boolean(),
365
407
  ipAllowlist: z.array(z.string()).nullable(),
366
408
  allowedPlatforms: z.array(allowedPlatformSchema),
@@ -509,6 +551,16 @@ z.object({
509
551
  environments: z.array(environmentWithDomainsSchema),
510
552
  productionEnvironment: environmentWithDomainsSchema.nullable()
511
553
  });
554
+ const domainFailureReasonSchema = z.enum([
555
+ "caa",
556
+ "dns",
557
+ "invalid_domain",
558
+ "other"
559
+ ]);
560
+ const projectDomainMappingSchema = z.object({
561
+ pathPrefix: z.string(),
562
+ environment: environmentSchema$1
563
+ });
512
564
  z.object({
513
565
  name: z.string(),
514
566
  createdAt: z.coerce.date(),
@@ -517,7 +569,9 @@ z.object({
517
569
  "deployed",
518
570
  "failed"
519
571
  ]),
520
- environment: environmentSchema$1
572
+ failureReason: domainFailureReasonSchema.nullable(),
573
+ environment: environmentSchema$1,
574
+ mappings: z.array(projectDomainMappingSchema)
521
575
  });
522
576
  const serverFieldsSchema$1 = z.object({
523
577
  $schema: z.string(),
@@ -581,8 +635,9 @@ const positiveTestCaseSchema = z.object({
581
635
  }).partial().describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
582
636
  const screenshotEntrySchema = z.object({
583
637
  prompt: z.string(),
584
- url: z.url().or(z.literal(""))
638
+ url: z.url()
585
639
  }).describe("Each screenshot: the user prompt that produced it + the image URL.");
640
+ const screenshotDraftEntrySchema = screenshotEntrySchema.extend({ url: z.string() });
586
641
  /** Accepts either a valid email or URL. */
587
642
  const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
588
643
  /** A URL field whose error spells out that the scheme is required. */
@@ -941,6 +996,17 @@ const chatgptSubmissionFormDataSchema = z.object({
941
996
  allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
942
997
  releaseNotes: z.string().describe("Publicly displayed on the app details page.")
943
998
  });
999
+ const chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
1000
+ tagline: z.string().optional(),
1001
+ companyUrl: z.string().optional(),
1002
+ supportChannel: z.string().optional(),
1003
+ privacyPolicyUrl: z.string().optional(),
1004
+ termsOfServiceUrl: z.string().optional(),
1005
+ demoRecordingUrl: z.string().optional(),
1006
+ serverUrl: z.string().optional(),
1007
+ screenshots: z.array(screenshotDraftEntrySchema).optional(),
1008
+ translations: z.array(chatgptTranslationSchema.extend({ tagline: z.string() })).optional()
1009
+ });
944
1010
  chatgptSubmissionFormDataSchema.pick({
945
1011
  appName: true,
946
1012
  developerName: true,
@@ -1067,6 +1133,21 @@ fully populated account.`),
1067
1133
  submission. Each is an attestation you are legally agreeing to by submitting.`),
1068
1134
  additionalNotes: z.string().optional().describe("Anything else the review team should know about your connector. Optional.")
1069
1135
  });
1136
+ const claudeSubmissionDraftSchema = claudeSubmissionFormDataSchema.partial().extend({
1137
+ serverUrl: z.string().optional(),
1138
+ name: z.string().optional(),
1139
+ slug: z.string().optional(),
1140
+ oneLiner: z.string().optional(),
1141
+ description: z.string().optional(),
1142
+ iconUrl: z.string().optional(),
1143
+ documentation: z.string().optional(),
1144
+ support: z.string().optional(),
1145
+ privacyPolicy: z.string().optional(),
1146
+ companyWebsite: z.string().optional(),
1147
+ primaryContactEmail: z.string().optional(),
1148
+ categories: z.array(claudeCategorySchema).optional(),
1149
+ screenshots: z.array(screenshotDraftEntrySchema).optional()
1150
+ });
1070
1151
  claudeSubmissionFormDataSchema.pick({
1071
1152
  serverUrl: true,
1072
1153
  name: true,
@@ -1107,14 +1188,14 @@ const submissionMetaFieldsSchema = z.object({
1107
1188
  });
1108
1189
  const claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
1109
1190
  platform: z.literal("claudeai"),
1110
- formData: claudeSubmissionFormDataSchema.partial()
1191
+ formData: claudeSubmissionDraftSchema
1111
1192
  });
1112
1193
  const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
1113
1194
  platform: z.literal("chatgpt"),
1114
- formData: chatgptSubmissionFormDataSchema.partial()
1195
+ formData: chatgptSubmissionDraftSchema
1115
1196
  });
1116
1197
  z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
1117
- z.union([claudeSubmissionFormDataSchema.partial(), chatgptSubmissionFormDataSchema.partial()]);
1198
+ z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
1118
1199
  const subscriptionPlanSchema = z.enum([
1119
1200
  "pro",
1120
1201
  "business",
@@ -1498,7 +1579,8 @@ const deployEnvironmentContractV1 = oc.route({
1498
1579
  BAD_REQUEST: {}
1499
1580
  }).input(z.object({
1500
1581
  environmentId: z.string().describe("The ID of the environment to deploy"),
1501
- token: z.string().describe("The token to identify the source archive").optional()
1582
+ token: z.string().describe("The token to identify the source archive").optional(),
1583
+ 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.")
1502
1584
  })).output(deploymentSchema);
1503
1585
  const uploadDeploymentArtifactContractV1 = oc.route({
1504
1586
  path: "/v1/deployments/upload",
@@ -1535,6 +1617,21 @@ const getDeploymentContractV1 = oc.route({
1535
1617
  tags: ["deployments"],
1536
1618
  successDescription: "The deployment details"
1537
1619
  }).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
1620
+ const logEntrySchema = z.object({
1621
+ timestamp: z.coerce.date(),
1622
+ type: z.enum([
1623
+ "START",
1624
+ "END",
1625
+ "INFO",
1626
+ "ERROR",
1627
+ "WARNING",
1628
+ "DEBUG"
1629
+ ]),
1630
+ requestId: z.string(),
1631
+ content: z.string().optional(),
1632
+ method: z.string().optional(),
1633
+ durationInMs: z.number().optional()
1634
+ });
1538
1635
  const getLogsContractV1 = oc.route({
1539
1636
  path: "/v1/environments/{environmentId}/logs",
1540
1637
  method: "GET",
@@ -1559,21 +1656,7 @@ const getLogsContractV1 = oc.route({
1559
1656
  search: z.string().optional().describe("Filter pattern to search for in log content"),
1560
1657
  nextToken: z.string().optional().describe("Pagination token from a previous response")
1561
1658
  })).output(z.object({
1562
- logs: z.array(z.object({
1563
- timestamp: z.coerce.date(),
1564
- type: z.enum([
1565
- "START",
1566
- "END",
1567
- "INFO",
1568
- "ERROR",
1569
- "WARNING",
1570
- "DEBUG"
1571
- ]),
1572
- requestId: z.string(),
1573
- content: z.string().optional(),
1574
- method: z.string().optional(),
1575
- durationInMs: z.number().optional()
1576
- })),
1659
+ logs: z.array(logEntrySchema),
1577
1660
  nextToken: z.string().nullable()
1578
1661
  }));
1579
1662
  const getLatestLogsContractV1 = oc.route({
@@ -1596,21 +1679,7 @@ const getLatestLogsContractV1 = oc.route({
1596
1679
  "DEBUG"
1597
1680
  ])).optional().describe("Filter by log level"),
1598
1681
  search: z.string().optional().describe("Filter pattern to search for in log content")
1599
- })).output(z.object({ logs: z.array(z.object({
1600
- timestamp: z.coerce.date(),
1601
- type: z.enum([
1602
- "START",
1603
- "END",
1604
- "INFO",
1605
- "ERROR",
1606
- "WARNING",
1607
- "DEBUG"
1608
- ]),
1609
- requestId: z.string(),
1610
- content: z.string().optional(),
1611
- method: z.string().optional(),
1612
- durationInMs: z.number().optional()
1613
- })) }));
1682
+ })).output(z.object({ logs: z.array(logEntrySchema) }));
1614
1683
  const getDeploymentLogsContractV1 = oc.route({
1615
1684
  path: "/v1/deployments/{deploymentId}/logs",
1616
1685
  method: "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-staging.g19b2cd4",
3
+ "version": "0.0.0-staging.g1abcf50",
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
  }