@alpic-ai/api 0.0.0-staging.gfab86f0 → 0.0.0-staging.gfcfbb4c

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
@@ -257,6 +257,7 @@ declare const contract: {
257
257
  }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
258
258
  NOT_FOUND: {};
259
259
  BAD_REQUEST: {};
260
+ CONFLICT: {};
260
261
  }>, Record<never, never>>;
261
262
  };
262
263
  getLogs: {
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,13 @@ 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
343
388
  ]);
344
- const allowedPlatformSchema = platformSchema;
345
389
  const playgroundModelSchema = z.enum([
346
390
  "global.anthropic.claude-haiku-4-5-20251001-v1:0",
347
391
  "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
@@ -381,7 +425,8 @@ z.object({
381
425
  collectRequestPayload: z.boolean(),
382
426
  collectResponsePayload: z.boolean(),
383
427
  collectErrorMessage: z.boolean(),
384
- collectUserData: z.boolean()
428
+ collectUserData: z.boolean(),
429
+ identityTraitKey: z.string().min(1).max(200).nullable()
385
430
  });
386
431
  z.object({
387
432
  id: z.string(),
@@ -1225,7 +1270,10 @@ const RESERVED_KEYS = [
1225
1270
  "BUILD_ARG_START_COMMAND",
1226
1271
  "ALPIC_HOST",
1227
1272
  "ALPIC_CUSTOM_DOMAINS",
1228
- "ALPIC_INTENT_META_KEY"
1273
+ "ALPIC_INTENT_META_KEY",
1274
+ "ALPIC_FEEDBACK_META_KEY",
1275
+ "ALPIC_EVENTS_META_KEY",
1276
+ "ALPIC_IDENTIFY_META_KEY"
1229
1277
  ];
1230
1278
  const environmentVariableSchema = z.object({
1231
1279
  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"),
@@ -1541,7 +1589,8 @@ const deployEnvironmentContractV1 = oc.route({
1541
1589
  successDescription: "The environment has been deployed successfully"
1542
1590
  }).errors({
1543
1591
  NOT_FOUND: {},
1544
- BAD_REQUEST: {}
1592
+ BAD_REQUEST: {},
1593
+ CONFLICT: {}
1545
1594
  }).input(z.object({
1546
1595
  environmentId: z.string().describe("The ID of the environment to deploy"),
1547
1596
  token: z.string().describe("The token to identify the source archive").optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-staging.gfab86f0",
3
+ "version": "0.0.0-staging.gfcfbb4c",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -33,17 +33,17 @@
33
33
  "author": "Alpic",
34
34
  "license": "ISC",
35
35
  "dependencies": {
36
- "@orpc/contract": "^1.14.7",
36
+ "@orpc/contract": "^1.14.8",
37
37
  "ms": "^2.1.3",
38
38
  "zod": "^4.4.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@orpc/openapi": "^1.14.7",
42
- "@orpc/zod": "^1.14.7",
41
+ "@orpc/openapi": "^1.14.8",
42
+ "@orpc/zod": "^1.14.8",
43
43
  "@total-typescript/tsconfig": "^1.0.4",
44
44
  "@types/ms": "^2.1.0",
45
45
  "shx": "^0.4.0",
46
- "tsdown": "^0.22.5",
46
+ "tsdown": "^0.22.9",
47
47
  "typescript": "^6.0.3",
48
48
  "vitest": "^4.1.10",
49
49
  "@alpic-ai/domains": "0.0.0"