@alpic-ai/api 0.0.0-dev.ge713bc8 → 0.0.0-dev.ge72bf03

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
@@ -3271,6 +3271,20 @@ export declare const contract: {
3271
3271
  NOT_FOUND: {};
3272
3272
  }>, Record<never, never>>;
3273
3273
  };
3274
+ list: {
3275
+ v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
3276
+ projectId: z.ZodString;
3277
+ environmentId: z.ZodOptional<z.ZodString>;
3278
+ platform: z.ZodOptional<z.ZodEnum<{
3279
+ chatgpt: "chatgpt";
3280
+ claudeai: "claudeai";
3281
+ }>>;
3282
+ }, z.core.$strip>, z.ZodArray<z.ZodType<Submission, unknown, z.core.$ZodTypeInternals<Submission, unknown>>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
3283
+ BAD_REQUEST: {};
3284
+ }>, {
3285
+ NOT_FOUND: {};
3286
+ }>, Record<never, never>>;
3287
+ };
3274
3288
  get: {
3275
3289
  v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
3276
3290
  submissionId: z.ZodString;
@@ -5135,6 +5149,20 @@ export declare const contractForDocs: {
5135
5149
  NOT_FOUND: {};
5136
5150
  }>, Record<never, never>>;
5137
5151
  };
5152
+ list: {
5153
+ v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
5154
+ projectId: z.ZodString;
5155
+ environmentId: z.ZodOptional<z.ZodString>;
5156
+ platform: z.ZodOptional<z.ZodEnum<{
5157
+ chatgpt: "chatgpt";
5158
+ claudeai: "claudeai";
5159
+ }>>;
5160
+ }, z.core.$strip>, z.ZodArray<z.ZodType<Submission, unknown, z.core.$ZodTypeInternals<Submission, unknown>>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
5161
+ BAD_REQUEST: {};
5162
+ }>, {
5163
+ NOT_FOUND: {};
5164
+ }>, Record<never, never>>;
5165
+ };
5138
5166
  get: {
5139
5167
  v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
5140
5168
  submissionId: z.ZodString;
@@ -5841,11 +5869,11 @@ await logger(() => Promise.resolve('bar'));
5841
5869
  */
5842
5870
  type Promisable<T> = T | PromiseLike<T>;
5843
5871
  //#endregion
5844
- //#region ../../node_modules/.pnpm/@orpc+shared@1.15.0_@opentelemetry+api@1.9.1/node_modules/@orpc/shared/dist/index.d.mts
5872
+ //#region ../../node_modules/.pnpm/@orpc+shared@1.15.4_@opentelemetry+api@1.9.1/node_modules/@orpc/shared/dist/index.d.mts
5845
5873
  type MaybeOptionalOptions<TOptions> = Record<never, never> extends TOptions ? [options?: TOptions] : [options: TOptions];
5846
5874
  type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => T);
5847
5875
  //#endregion
5848
- //#region ../../node_modules/.pnpm/@orpc+client@1.15.0_@opentelemetry+api@1.9.1/node_modules/@orpc/client/dist/index.d.mts
5876
+ //#region ../../node_modules/.pnpm/@orpc+client@1.15.4_@opentelemetry+api@1.9.1/node_modules/@orpc/client/dist/index.d.mts
5849
5877
  declare const COMMON_ORPC_ERROR_DEFS: {
5850
5878
  readonly BAD_REQUEST: {
5851
5879
  readonly status: 400;
@@ -5958,7 +5986,7 @@ declare class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {
5958
5986
  }
5959
5987
  type ORPCErrorJSON<TCode extends string, TData> = Pick<ORPCError<TCode, TData>, 'defined' | 'code' | 'status' | 'message' | 'data'>;
5960
5988
  //#endregion
5961
- //#region ../../node_modules/.pnpm/@orpc+server@1.15.0_@opentelemetry+api@1.9.1_ws@8.21.3/node_modules/@orpc/server/dist/shared/server.qKsRrdxW.d.mts
5989
+ //#region ../../node_modules/.pnpm/@orpc+server@1.15.4_@opentelemetry+api@1.9.1_ws@8.21.3/node_modules/@orpc/server/dist/shared/server.qKsRrdxW.d.mts
5962
5990
  type Context = Record<PropertyKey, any>;
5963
5991
  type ORPCErrorConstructorMapItemOptions<TData> = Omit<ORPCErrorOptions<TData>, 'defined' | 'status'>;
5964
5992
  type ORPCErrorConstructorMapItem<TCode extends ORPCErrorCode, TInData> = (...rest: MaybeOptionalOptions<ORPCErrorConstructorMapItemOptions<TInData>>) => ORPCError<TCode, TInData>;
@@ -6029,7 +6057,7 @@ interface Middleware<TInContext extends Context, TOutContext extends Context, TI
6029
6057
  }
6030
6058
  type AnyMiddleware = Middleware<any, any, any, any, any, any>;
6031
6059
  //#endregion
6032
- //#region ../../node_modules/.pnpm/@orpc+server@1.15.0_@opentelemetry+api@1.9.1_ws@8.21.3/node_modules/@orpc/server/dist/shared/server.C8_sRzQB.d.mts
6060
+ //#region ../../node_modules/.pnpm/@orpc+server@1.15.4_@opentelemetry+api@1.9.1_ws@8.21.3/node_modules/@orpc/server/dist/shared/server.C8_sRzQB.d.mts
6033
6061
  interface TraverseContractProcedureCallbackOptions {
6034
6062
  contract: AnyContractProcedure | AnyProcedure;
6035
6063
  path: readonly string[];
@@ -7063,7 +7091,7 @@ declare enum TypeName {
7063
7091
  String = "string"
7064
7092
  }
7065
7093
  //#endregion
7066
- //#region ../../node_modules/.pnpm/@orpc+openapi@1.15.0_@opentelemetry+api@1.9.1_ws@8.21.3/node_modules/@orpc/openapi/dist/shared/openapi.BGy4N6eR.d.mts
7094
+ //#region ../../node_modules/.pnpm/@orpc+openapi@1.15.4_@opentelemetry+api@1.9.1_ws@8.21.3/node_modules/@orpc/openapi/dist/shared/openapi.BGy4N6eR.d.mts
7067
7095
  interface SchemaConverterComponent {
7068
7096
  allowedStrategies: readonly SchemaConvertOptions['strategy'][];
7069
7097
  schema: AnySchema;
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import * as z$1 from "zod/v4";
3
3
  import { oc } from "@orpc/contract";
4
4
  import ms from "ms";
5
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
5
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.1_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
6
6
  /**
7
7
  * Reusable URL validation that disallows javascript: scheme
8
8
  */
@@ -420,7 +420,8 @@ z.object({
420
420
  collectResponsePayload: z.boolean(),
421
421
  collectErrorMessage: z.boolean(),
422
422
  collectUserData: z.boolean(),
423
- identityTraitKey: z.string().min(1).max(200).nullable()
423
+ identityTraitKey: z.string().min(1).max(200).nullable(),
424
+ leadEventName: z.string().min(1).max(200).nullable()
424
425
  });
425
426
  const feedbackSchema = z.object({
426
427
  id: z.string(),
@@ -539,6 +540,14 @@ z.enum([
539
540
  "DEBUG",
540
541
  "ERROR"
541
542
  ]);
543
+ const LOG_SEARCH_MAX_ESCAPED_LENGTH = 960;
544
+ function escapeLogSearchTerm(search) {
545
+ return [...search].flatMap((character) => [...new TextEncoder().encode(character)]).map((byte) => {
546
+ const character = String.fromCharCode(byte);
547
+ return /^[a-zA-Z0-9]$/.test(character) ? character : `\\x${byte.toString(16).toUpperCase().padStart(2, "0")}`;
548
+ }).join("");
549
+ }
550
+ const logSearchSchema = z.string().max(240, `Search must be 240 characters or fewer`).refine((search) => escapeLogSearchTerm(search).length <= LOG_SEARCH_MAX_ESCAPED_LENGTH, "Search is too complex; shorten it or use fewer special characters");
542
551
  /** Only names a vendor actually ships belong here: lookalikes like `claude-code-test` are customers' own scripts. */
543
552
  const MCP_CLIENT_GROUPS = [
544
553
  {
@@ -1210,7 +1219,7 @@ const chatgptTranslationLocaleSchema = z.enum([
1210
1219
  const negativeTestCaseSchema = z.object({
1211
1220
  scenario: z.string().min(1),
1212
1221
  userPrompt: z.string().min(1)
1213
- }).describe("Each case: Scenario + User prompt (the app should NOT trigger).");
1222
+ }).describe("Each case: Scenario + User prompt (the plugin should NOT trigger).");
1214
1223
  const negativeTestCaseDraftSchema = negativeTestCaseSchema.partial().extend({
1215
1224
  scenario: z.string().optional(),
1216
1225
  userPrompt: z.string().optional()
@@ -1239,28 +1248,28 @@ chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema
1239
1248
  const chatgptSubmissionFormDataSchema = z.object({
1240
1249
  logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
1241
1250
  logoDark: z.string().optional().describe("Optional dark-mode logo icon. Square PNG, same specs as the light icon. Leave empty if the light icon also works on dark backgrounds."),
1242
- appName: z.string().describe("The name users will see in ChatGPT and in the Apps Directory."),
1251
+ appName: z.string().describe("The name users will see in ChatGPT and in the Plugin Directory."),
1243
1252
  tagline: chatgptTaglineSchema.describe("Plain-language phrase focused on function and user value, 30 chars max. Avoid generic superlatives like \"the best …\"."),
1244
- description: chatgptDescriptionSchema.describe("Clear, engaging description highlighting what the app does and why people will love it. Appears publicly on the directory page. End it by naming the product categories or intents the app does NOT cover, so ChatGPT learns when not to route to it (define exclusions by absent categories or wrong intents, never by naming other brands)."),
1253
+ description: chatgptDescriptionSchema.describe("Clear, engaging description highlighting what the plugin does and why people will love it. Appears publicly on the directory page. End it by naming the product categories or intents the plugin does NOT cover, so ChatGPT learns when not to route to it (define exclusions by absent categories or wrong intents, never by naming other brands)."),
1245
1254
  category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
1246
- developerName: z.string().describe("Developer name shown publicly on the app's directory page."),
1255
+ developerName: z.string().describe("Developer name shown publicly on the plugin's directory page."),
1247
1256
  companyUrl: urlField.describe("Your company's main website URL."),
1248
1257
  supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
1249
1258
  privacyPolicyUrl: urlField.describe("URL to your privacy policy."),
1250
- termsOfServiceUrl: urlField.describe("URL to the app's terms of service."),
1251
- demoRecordingUrl: urlField.describe("URL to a video demonstrating the app, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
1252
- appCommerceAndPurchasing: z.boolean().describe("Checkbox: 'My app links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the app does not offer digital goods."),
1259
+ termsOfServiceUrl: urlField.describe("URL to the plugin's terms of service."),
1260
+ demoRecordingUrl: urlField.describe("URL to a video demonstrating the plugin, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
1261
+ appCommerceAndPurchasing: z.boolean().describe("Checkbox: 'My plugin links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the plugin does not offer digital goods."),
1253
1262
  serverUrl: urlField.describe("URL of the MCP server."),
1254
1263
  authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
1255
1264
  tools: z.array(toolDefinitionSchema).describe("List of tools exposed by the MCP server (auto-populated from the production server's manifest)."),
1256
1265
  toolJustifications: z.array(chatgptToolJustificationSchema).describe("Per-tool justification of `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotation values. One short, specific sentence per hint describing what the tool actually does."),
1257
1266
  skills: z.array(chatgptSkillSchema).optional().describe("Skills the server exposes over MCP (auto-populated from the production server's manifest). Left unset when the server does not advertise the skills extension, which is a different state from advertising it and exposing none."),
1258
1267
  testCases: z.array(positiveTestCaseSchema).length(5).describe("Exactly 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output. Collectively cover the full capability across different flow stages (initial search or browse, market or locale handling, post-interaction detail, an action ChatGPT performs on the user's behalf, and a conversion or secondary tool) rather than five variations of the same first step."),
1259
- negativeTestCases: z.array(negativeTestCaseSchema).length(3).describe("Exactly 3 negative test cases: prompts where the app should NOT trigger but the model might think it is relevant. These become production routing metadata that teaches ChatGPT when to stay silent, so pick tight near-misses: a product category the app does not carry, the right brand or domain but an intent the app does not serve, or a boundary with a sibling app."),
1260
- screenshots: z.array(screenshotEntrySchema.extend({ prompt: z.string().max(75, { error: "Screenshot prompts are limited to 75 characters." }) })).max(3).describe("In-app screenshots paired with the user prompt that produced them (each prompt is 75 characters max). Widget apps must show the widget UI; non-widget apps show the model response. Min 1, max 3 entries, all public. Images: 706px wide, 400–860px tall, PNG."),
1268
+ negativeTestCases: z.array(negativeTestCaseSchema).length(3).describe("Exactly 3 negative test cases: prompts where the plugin should NOT trigger but the model might think it is relevant. These become production routing metadata that teaches ChatGPT when to stay silent, so pick tight near-misses: a product category the plugin does not carry, the right brand or domain but an intent the plugin does not serve, or a boundary with a sibling plugin."),
1269
+ screenshots: z.array(screenshotEntrySchema.extend({ prompt: z.string().max(75, { error: "Screenshot prompts are limited to 75 characters." }) })).max(3).describe("In-plugin screenshots paired with the user prompt that produced them (each prompt is 75 characters max). Widget plugins must show the widget UI; non-widget plugins show the model response. Min 1, max 3 entries, all public. Images: 706px wide, 400–860px tall, PNG."),
1261
1270
  translations: z.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
1262
1271
  allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
1263
- releaseNotes: z.string().describe("Publicly displayed on the app details page.")
1272
+ releaseNotes: z.string().describe("Publicly displayed on the plugin details page.")
1264
1273
  });
1265
1274
  const chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
1266
1275
  tagline: z.string().optional(),
@@ -2033,7 +2042,7 @@ const getLogsContractV1 = base.route({
2033
2042
  "WARNING",
2034
2043
  "DEBUG"
2035
2044
  ])).optional().describe("Filter by log level"),
2036
- search: z.string().optional().describe("Filter pattern to search for in log content"),
2045
+ search: logSearchSchema.optional().describe("Term to search for in log content"),
2037
2046
  nextToken: z.string().optional().describe("Pagination token from a previous response")
2038
2047
  })).output(z.object({
2039
2048
  logs: z.array(logEntrySchema),
@@ -2055,7 +2064,7 @@ const getLatestLogsContractV1 = base.route({
2055
2064
  "WARNING",
2056
2065
  "DEBUG"
2057
2066
  ])).optional().describe("Filter by log level"),
2058
- search: z.string().optional().describe("Filter pattern to search for in log content")
2067
+ search: logSearchSchema.optional().describe("Term to search for in log content")
2059
2068
  })).output(z.object({ logs: z.array(logEntrySchema) }));
2060
2069
  const getDeploymentLogsContractV1 = base.route({
2061
2070
  path: "/v1/deployments/{deploymentId}/logs",
@@ -2381,6 +2390,18 @@ const createSubmissionContractV1 = base.route({
2381
2390
  environmentId: z.string().describe("The ID of the environment to build the package from"),
2382
2391
  platform: platformSchema.describe(PLATFORM_DESCRIPTION)
2383
2392
  })).output(submissionSchema);
2393
+ const listSubmissionsContractV1 = base.route({
2394
+ path: "/v1/projects/{projectId}/submissions",
2395
+ method: "GET",
2396
+ summary: "List submission packages",
2397
+ description: "List the submission packages of a project, grouped by directory and most recently updated first, optionally narrowed to one environment or one directory",
2398
+ tags: ["submissions"],
2399
+ successDescription: "The list of submission packages"
2400
+ }).errors({ NOT_FOUND: {} }).input(z.object({
2401
+ projectId: z.string().describe("The ID of the project"),
2402
+ environmentId: z.string().optional().describe("Filter by environment ID"),
2403
+ platform: platformSchema.optional().describe(PLATFORM_DESCRIPTION)
2404
+ })).output(z.array(submissionSchema));
2384
2405
  const getSubmissionContractV1 = base.route({
2385
2406
  path: "/v1/submissions/{submissionId}",
2386
2407
  method: "GET",
@@ -2463,6 +2484,7 @@ const contract = {
2463
2484
  },
2464
2485
  submissions: {
2465
2486
  create: { v1: createSubmissionContractV1 },
2487
+ list: { v1: listSubmissionsContractV1 },
2466
2488
  get: { v1: getSubmissionContractV1 },
2467
2489
  update: { v1: updateSubmissionContractV1 }
2468
2490
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-dev.ge713bc8",
3
+ "version": "0.0.0-dev.ge72bf03",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -33,20 +33,20 @@
33
33
  "author": "Alpic",
34
34
  "license": "ISC",
35
35
  "dependencies": {
36
- "@orpc/contract": "^1.15.0",
36
+ "@orpc/contract": "^1.15.4",
37
37
  "ms": "^2.1.3",
38
38
  "zod": "^4.5.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@alpic-ai/domains": "0.0.0",
42
- "@orpc/openapi": "^1.15.0",
43
- "@orpc/zod": "^1.15.0",
42
+ "@orpc/openapi": "^1.15.4",
43
+ "@orpc/zod": "^1.15.4",
44
44
  "@total-typescript/tsconfig": "^1.0.4",
45
45
  "@types/ms": "^2.1.0",
46
46
  "shx": "^0.4.0",
47
47
  "tsdown": "^0.23.0",
48
48
  "typescript": "^6.0.3",
49
- "vitest": "^5.0.0"
49
+ "vitest": "^5.0.2"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "shx rm -rf dist && tsdown",