@alpic-ai/api 0.0.0-staging.79eb8bf → 0.0.0-staging.7a9191a

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.
Files changed (3) hide show
  1. package/dist/index.d.mts +514 -31
  2. package/dist/index.mjs +764 -27
  3. package/package.json +24 -10
package/dist/index.mjs CHANGED
@@ -1,6 +1,408 @@
1
- import { oc } from "@orpc/contract";
2
1
  import { z } from "zod";
2
+ import { oc } from "@orpc/contract";
3
+ import ms from "ms";
4
+ const platformSchema = z.enum(["chatgpt", "claudeai"]);
5
+ const PLATFORM_LABELS = {
6
+ chatgpt: "ChatGPT",
7
+ claudeai: "Claude.ai"
8
+ };
9
+ const auditStatusSchema = z.enum([
10
+ "pending",
11
+ "partial",
12
+ "completed",
13
+ "failed"
14
+ ]);
15
+ const checkSeveritySchema = z.enum([
16
+ "error",
17
+ "warning",
18
+ "info"
19
+ ]);
20
+ const checkCategorySchema = z.enum([
21
+ "connectivity",
22
+ "tool-metadata",
23
+ "resource-metadata",
24
+ "performance",
25
+ "e2e"
26
+ ]);
27
+ const checkScopeSchema = z.enum(["server", "view"]);
28
+ const checkDetailSchema = z.object({
29
+ label: z.string(),
30
+ value: z.string().optional()
31
+ });
32
+ const checkResultSchema = z.object({
33
+ checkId: z.string(),
34
+ checkName: z.string(),
35
+ description: z.string(),
36
+ status: z.enum([
37
+ "pass",
38
+ "fail",
39
+ "skip",
40
+ "pending"
41
+ ]),
42
+ message: z.string(),
43
+ skipReason: z.string().optional(),
44
+ severity: checkSeveritySchema,
45
+ category: checkCategorySchema,
46
+ scope: checkScopeSchema,
47
+ platforms: z.array(platformSchema).readonly().optional(),
48
+ durationMs: z.number(),
49
+ details: z.array(checkDetailSchema).optional(),
50
+ hint: z.object({ text: z.string() }).optional()
51
+ });
52
+ const auditReportSchema = z.object({
53
+ schemaVersion: z.string(),
54
+ auditId: z.string(),
55
+ targetUrl: z.string(),
56
+ startedAt: z.string(),
57
+ completedAt: z.string(),
58
+ durationMs: z.number(),
59
+ results: z.array(checkResultSchema),
60
+ requiresAuth: z.boolean(),
61
+ hasViewSupport: z.boolean(),
62
+ viewPlatforms: z.array(platformSchema).readonly().optional(),
63
+ isReadyForPlatform: z.record(platformSchema, z.boolean()),
64
+ widgetScreenshotKeys: z.object({
65
+ chatgpt: z.string().optional(),
66
+ claudeai: z.string().optional()
67
+ })
68
+ });
69
+ const widgetScreenshotSchema = z.object({ url: z.string() });
70
+ const auditReportWithScreenshotsSchema = auditReportSchema.extend({ widgetScreenshots: z.object({
71
+ chatgpt: widgetScreenshotSchema.optional(),
72
+ claudeai: widgetScreenshotSchema.optional()
73
+ }) });
74
+ z.enum([
75
+ "ongoing",
76
+ "deployed",
77
+ "failed",
78
+ "canceled"
79
+ ]);
80
+ z.object({
81
+ timestamp: z.coerce.date().optional(),
82
+ content: z.string().optional()
83
+ });
84
+ z.object({
85
+ id: z.string(),
86
+ createdAt: z.coerce.date(),
87
+ environmentId: z.string(),
88
+ content: z.string(),
89
+ source: z.enum(["model", "user"])
90
+ });
91
+ z.object({
92
+ content: z.string(),
93
+ source: z.enum(["model", "user"])
94
+ });
95
+ const toolDefinitionSchema = z.object({
96
+ name: z.string(),
97
+ title: z.string().optional().describe("Human-friendly name for the tool, used in the UI. If not provided, `name` will be used."),
98
+ description: z.string().optional(),
99
+ annotations: z.object({
100
+ readOnlyHint: z.boolean().optional(),
101
+ destructiveHint: z.boolean().optional(),
102
+ openWorldHint: z.boolean().optional(),
103
+ idempotentHint: z.boolean().optional()
104
+ }).optional()
105
+ });
106
+ const positiveTestCaseSchema = z.object({
107
+ scenario: z.string(),
108
+ userPrompt: z.string(),
109
+ toolTriggered: z.string().optional(),
110
+ expectedOutput: z.string().optional()
111
+ }).partial().describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
112
+ /** Accepts either a valid email or URL. */
113
+ const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
114
+ const chatgptCategorySchema = z.enum([
115
+ "BUSINESS",
116
+ "COLLABORATION",
117
+ "DESIGN",
118
+ "DEVELOPER_TOOLS",
119
+ "EDUCATION",
120
+ "ENTERTAINMENT",
121
+ "FINANCE",
122
+ "FOOD",
123
+ "LIFESTYLE",
124
+ "NEWS",
125
+ "PRODUCTIVITY",
126
+ "SHOPPING",
127
+ "TRAVEL"
128
+ ]);
129
+ const chatgptAuthenticationSchema = z.enum(["No auth needed", "OAuth 2.0"]);
130
+ const chatgptAllowedCountriesSchema = z.enum(["Allow all", "Restrict to specific countries"]);
131
+ const negativeTestCaseSchema = z.object({
132
+ scenario: z.string(),
133
+ userPrompt: z.string()
134
+ }).partial().describe("Each case: Scenario + User prompt (the app should NOT trigger).");
135
+ const chatgptToolJustificationSchema = z.object({
136
+ toolName: z.string(),
137
+ readOnlyJustification: z.string(),
138
+ openWorldJustification: z.string(),
139
+ destructiveJustification: z.string()
140
+ }).describe("Per-tool justification of each MCP annotation value (one sentence per hint).");
141
+ const chatgptTranslationSchema = z.object({
142
+ locale: z.string(),
143
+ tagline: z.string().optional(),
144
+ description: z.string().optional()
145
+ }).describe("Locale-scoped override for tagline + description. English (US) is the default.");
146
+ /**
147
+ * Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
148
+ * When adding/removing/reordering fields, keep this in sync with the sheet.
149
+ */
150
+ const chatgptSubmissionFormDataSchema = z.object({
151
+ logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
152
+ logoDark: z.string().describe("Logo icon for dark mode. Square PNG. Same specs as the light icon."),
153
+ appName: z.string().describe("The name users will see in ChatGPT and in the Apps Directory."),
154
+ tagline: z.string().max(30).describe("Plain-language phrase focused on function and user value. 30 chars max."),
155
+ description: z.string().describe("Clear, engaging description highlighting what the app does and why people will love it. Appears publicly on the directory page."),
156
+ category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
157
+ developerName: z.string().describe("Developer name shown publicly on the app's directory page."),
158
+ companyUrl: z.url().describe("Your company's main website URL."),
159
+ supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
160
+ privacyPolicyUrl: z.url().describe("URL to your privacy policy."),
161
+ termsOfServiceUrl: z.url().describe("URL to the app's terms of service."),
162
+ demoRecordingUrl: z.url().describe("URL to a video demonstrating the app, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
163
+ 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."),
164
+ serverUrl: z.url().describe("URL of the MCP server."),
165
+ authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
166
+ tools: z.array(toolDefinitionSchema).describe("List of tools exposed by the MCP server (auto-populated from the production server's manifest)."),
167
+ toolJustifications: z.array(chatgptToolJustificationSchema).describe("Per-tool justification of `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotation values."),
168
+ testCases: z.array(positiveTestCaseSchema).describe("At least 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output. Coverage over all major use cases."),
169
+ negativeTestCases: z.array(negativeTestCaseSchema).describe("3 negative test cases — prompts where the app should NOT trigger but the model might think it's relevant."),
170
+ screenshots: z.array(z.url()).describe("URLs of in-app screenshots. Widget apps must show the widget UI; non-widget apps show the model response. Min 1, max 4. First three are public."),
171
+ translations: z.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
172
+ allowedCountries: chatgptAllowedCountriesSchema.describe("'Allow all' or restrict to a specific list. See OpenAI's supported countries list."),
173
+ releaseNotes: z.string().describe("Publicly displayed on the app details page.")
174
+ });
175
+ chatgptSubmissionFormDataSchema.pick({
176
+ appName: true,
177
+ developerName: true,
178
+ serverUrl: true,
179
+ tools: true,
180
+ authentication: true
181
+ });
182
+ chatgptSubmissionFormDataSchema.pick({
183
+ tagline: true,
184
+ description: true,
185
+ category: true,
186
+ testCases: true,
187
+ negativeTestCases: true,
188
+ toolJustifications: true
189
+ });
190
+ const claudeCategorySchema = z.enum([
191
+ "Business & Productivity",
192
+ "Communication",
193
+ "Data & Analytics",
194
+ "Development tools",
195
+ "Financial Services",
196
+ "Consumer Health",
197
+ "Health & Life Sciences",
198
+ "Media & Entertainment",
199
+ "Commerce & Shopping"
200
+ ]);
201
+ z.enum([
202
+ "No auth needed",
203
+ "OAuth 2.0",
204
+ "Custom URL"
205
+ ]);
206
+ const claudeMcpUrlTypeSchema = z.enum(["Universal URL", "Custom MCP URLs"]);
207
+ z.enum(["Static OAuth Client", "Dynamic OAuth Client (DCR / CIMD)"]);
208
+ const claudeReadWriteCapabilitiesSchema = z.enum([
209
+ "Read only",
210
+ "Write only",
211
+ "Read + write"
212
+ ]);
213
+ const claudeTransportSchema = z.enum(["Streamable HTTP", "SSE"]);
214
+ const claudeThirdPartySchema = z.enum([
215
+ "Web access (open web fetch / scraping / arbitrary URLs)",
216
+ "Third-party AI model integration",
217
+ "Third-party data retrieval (via workflow / aggregator)",
218
+ "Third-party data modification (via workflow / aggregator)",
219
+ "N/A"
220
+ ]);
221
+ const claudeDataHandlingSchema = z.enum([
222
+ "Server only accesses data explicitly requested by user",
223
+ "No data is stored beyond session requirements",
224
+ "Data transmission is encrypted (HTTPS / TLS)",
225
+ "GDPR compliant (if applicable)"
226
+ ]);
227
+ const claudeSponsoredContentSchema = z.enum([
228
+ "No, there is no sponsored content or advertisements",
229
+ "Yes, there are banner ads or other paid visual elements",
230
+ "Yes, returned content or ranking is impacted by sponsorship or ad placement"
231
+ ]);
232
+ /**
233
+ * Field order mirrors the Claude (Anthropic) submission spreadsheet, grouped by section.
234
+ * When adding/removing/reordering fields, keep this in sync with the sheet.
235
+ */
236
+ const claudeSubmissionFormDataSchema = z.object({
237
+ companyName: z.string().describe("Enter your company's legal name or the name under which your product is publicly known. This is used for internal tracking and may appear in directory listings."),
238
+ companyUrl: z.url().describe("Your company's main website URL, e.g. https://mycompany.com. Must be a valid URL with https://. This should be the root domain of the company behind this MCP server."),
239
+ primaryContactName: z.string().describe("Full name of the person Anthropic should contact about this submission. This person will receive review feedback, approval notices, and any follow-up questions."),
240
+ primaryContactEmail: z.email().describe("Business email for the primary contact. Must be a valid email address. Anthropic uses this to communicate about your submission status, required changes, and post-listing issues. Avoid using personal email addresses."),
241
+ primaryContactRole: z.string().optional().describe("The job title or role of the primary contact (e.g. 'CTO', 'Developer Relations Lead', 'Founder'). Optional but helps Anthropic route questions to the right person."),
242
+ anthropicPointOfContact: z.string().optional().describe("If you have a direct contact at Anthropic (e.g. from a partnership or sales conversation), enter their name here. This is optional but can greatly help expedite the review process. Leave blank if you don't have one."),
243
+ appName: z.string().describe(`The public display name for your connector as it will appear in the Connectors Directory.
244
+
245
+ Rules:
246
+ (1) Do NOT include the words 'MCP' or 'Server' — these are auto-rejected.
247
+ (2) Use your brand/product name, e.g. 'Notion', 'Linear', 'Slack'.
248
+ (3) You must own or have the right to use this brand name. For example, don't call it 'Google Drive Helper' if you're not Google.`),
249
+ mcpUrlType: claudeMcpUrlTypeSchema.describe(`Choose how your server URL works:
250
+ • 'Universal URL': one single URL that all users connect to (most common). Example: https://mcp.myapp.com
251
+ • 'Custom MCP URLs': each user gets their own unique URL (e.g. based on their workspace or instance).
252
+ If you choose this, you'll need to provide both a signup URL and a regex pattern that matches valid server URLs for your service.`),
253
+ serverUrl: z.url().describe(`If 'Universal URL': enter the full https:// URL where your MCP server is hosted and reachable. Example: https://mcp.myapp.com/
254
+ If 'Custom MCP URLs': provide (1) the signup/onboarding URL where users create an account, and (2) a regex pattern that matches all valid server URLs for your service (e.g. https://[a-z0-9-]+\\.myapp\\.com/mcp). The server must be publicly accessible without VPN or whitelisting required.`),
255
+ tagline: z.string().max(55).describe(`A very short, punchy description shown below your server name in the directory listing. Max 55 characters including spaces.
256
+ Think of it as a subtitle or elevator pitch fragment. Example: 'Manage tasks and projects in Linear' or 'Search and read your Notion workspace'. Avoid generic phrases like 'The best MCP server for...'`),
257
+ description: z.string().describe(`A 50–100 word description of what your MCP server does. This appears in the connector's detail page inside Claude. Write it from a user perspective: what can users do with this connector? What are the key features/tools? Avoid marketing fluff. Be specific. Example: 'Connect Claude to your Linear workspace. Create and update issues, search projects, manage teams, and track engineering cycles, all from within Claude.' Anthropic reviewers check this for accuracy against your actual tools.`),
258
+ testCases: z.array(positiveTestCaseSchema).describe(`Provide at least 3 concrete use cases, each with an example prompt a user could type to Claude. These are critical: Anthropic reviewers literally test your server using these prompts. Good examples are specific and demonstrate real value.
259
+ Best format: [Use case]: [exact prompt]"
260
+ Example for a task manager:
261
+ 1. Create a task: 'Create a task called Review Q3 report, due Friday, assigned to Alice'
262
+ 2. Search tasks: 'Show me all open bugs in the Mobile project'
263
+ 3. Update status: 'Mark the Deploy v2.1 task as done'"`),
264
+ connectionRequirements: z.string().describe(`Describe any prerequisites a user must have before they can connect your server. Be exhaustive. Examples of things to mention:
265
+ • Account type required (free vs paid plan)
266
+ • Admin permissions or specific roles needed
267
+ • Geographic restrictions (e.g. 'US only' or 'Not available in EU')
268
+ • If users need to provide their own server URL or instance domain
269
+ • Any setup steps needed before connecting (e.g. 'Enable API access in your account settings')
270
+ If there are genuinely no special requirements, write exactly: 'No special requirements.'`),
271
+ readWriteCapabilities: claudeReadWriteCapabilitiesSchema.describe(`Select the option that best describes what your server can do:
3
272
 
273
+ 'Read Only': your tools only fetch/retrieve data (GET operations). Claude cannot modify anything via your server.
274
+ 'Write Only': your tools only create/update/delete data (rare).
275
+ 'Read + Write': your tools can both retrieve AND modify data (most common for full-featured connectors).
276
+
277
+ Note: Anthropic rejects catch-all tools that accept both safe (GET) and unsafe (POST, PUT, DELETE) HTTP methods via a parameter e.g. a single api_request(method, endpoint) tool. Each tool should have a fixed, specific purpose. `),
278
+ isMcpApp: z.boolean().describe(`Select 'Yes' if your MCP server renders interactive UI elements (aka widgets or views) inside the Claude conversation.
279
+ Select 'No' if your server only returns text/data responses.
280
+ If 'Yes', you will also be required to provide screenshots of your UI (see Promotional Images section). MCP Apps are displayed with a special badge in the directory.`),
281
+ thirdPartyConnectionsAndWebAccess: z.array(claudeThirdPartySchema).describe(`Multi-select all that apply to your server's behavior:
282
+ • 'Web access' — your server fetches arbitrary URLs, scrapes websites, or makes open-ended HTTP requests to the web (not just your own API).
283
+ • 'Third-party AI model integration' — your server calls another AI model (e.g. OpenAI, Gemini, Cohere) as part of its processing.
284
+ • 'Third-party data retrieval' — your server retrieves data via a workflow or aggregator platform (e.g. Zapier, Make, n8n) rather than calling your own API directly.
285
+ • 'Third-party data modification' — your server modifies data via such a platform.
286
+ • 'N/A' — your server only calls your own first-party API and does nothing else. Select this only if none of the above apply.`),
287
+ dataHandling: z.array(claudeDataHandlingSchema).describe(`Multi-select all data handling practices that accurately apply to your server. You must select at least 3. Key points:
288
+ • 'Server only accesses data explicitly requested by user' — your server doesn't silently read unrelated user data.
289
+ • 'No data is stored beyond session requirements' — you don't log or retain conversation data after the session.
290
+ • 'Data transmission is encrypted (HTTPS/TLS)' — all data in transit is encrypted. This should always apply for remote servers.
291
+ • 'GDPR compliant' — if you operate in the EU or serve EU users, check this only if you are genuinely compliant. Don't check it without having proper data processing agreements and procedures in place.
292
+ Note: These are attestations — you are legally agreeing to these practices by submitting the form.`),
293
+ personalDataHealthAccess: z.boolean().describe(`Select 'Yes' ONLY if your connector gives users access to their own personal health information — such as medical records, lab results, diagnoses, prescriptions, wearable health metrics (heart rate, sleep data, etc.), or mental health data.
294
+ Select 'No' for the vast majority of business/productivity/dev tools. When in doubt, select 'No'. This field triggers additional compliance review if 'Yes'.`),
295
+ categories: z.array(claudeCategorySchema).describe(`Select the category or categories that best describe your connector. This determines where it appears in the directory's browse experience. Choose the most specific fit:
296
+ • Business & Productivity — project management, CRM, HR, office tools
297
+ • Communication — email, chat, messaging, notifications
298
+ • Data & Analytics — dashboards, reporting, databases, BI tools
299
+ • Development tools — code repositories, CI/CD, issue trackers, monitoring
300
+ • Financial Services — accounting, invoicing, fintech (note: financial transaction execution is not permitted)
301
+ • Consumer Health — fitness, wellness, personal health tracking
302
+ • Health & Life Sciences — clinical, pharma, medical professional tools
303
+ • Media & Entertainment — content, publishing, streaming
304
+ • Commerce & Shopping — e-commerce, inventory, orders
305
+ Multiple categories are allowed if genuinely applicable.`),
306
+ sponsoredContentsOrAdvertisement: claudeSponsoredContentSchema.describe(`Be honest here — advertising is not permitted in the Connectors Directory per Anthropic's policy. Select the option that accurately describes your server:
307
+ • 'No, there is no sponsored content or advertisements' — the results your server returns are not influenced by paid placement or sponsorship. This is what almost all connectors should select.
308
+ • 'Yes, there are banner ads or other paid visual elements' — your UI includes visual ads. NOTE: this will likely lead to rejection, as Anthropic prohibits advertising in Claude.
309
+ • 'Yes, the returned content or ranking of returned content is impacted by sponsorship or ad placement' — paid results affect what you return. NOTE: this also likely leads to rejection.
310
+ If your server returns organic results from a platform that has ads in its own UI (but your API results are not affected by ads), select 'No'.`),
311
+ transportSupport: z.array(claudeTransportSchema).describe(`Select all transport protocols your server supports:
312
+ • 'Streamable HTTP' — the modern, recommended transport. Anthropic strongly recommends implementing this. This is the future-proof option and should be your default.
313
+ • 'SSE (Server-Sent Events)' — the older transport. SSE may be deprecated by Anthropic later in 2025/2026. If you currently only support SSE, you should plan to migrate to Streamable HTTP.
314
+ If you support both, select both. If you're building from scratch, implement Streamable HTTP only.`),
315
+ serverDocumentationLink: z.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. This is displayed in the Directory listing and must be publicly accessible without login. Minimum requirements for the docs page:
316
+ • What the connector does and its key capabilities
317
+ • How to connect/set it up (step by step)
318
+ • What each tool does (or at least the main ones)
319
+ • How to troubleshoot common issues
320
+ • A support contact or channel
321
+ Acceptable formats: a dedicated docs page, a help center article, a README on GitHub, or a blog post — as long as it's comprehensive. Note: Anthropic requires public documentation to be live by your publish date.`),
322
+ privacyPolicyUrl: z.url().describe(`URL to your privacy policy. This is mandatory and displayed in the directory listing. Missing or incomplete privacy policies result in immediate rejection. Your privacy policy must cover:
323
+ • What data you collect (and how)
324
+ • How you use the collected data
325
+ • Where and how long you store it
326
+ • Whether you share data with third parties (and who)
327
+ • How users can contact you about data concerns
328
+ The policy must be publicly accessible. If you don't have one yet, create one before submitting — there are free generators online, but make sure it accurately reflects your actual practices. If you're GDPR-compliant, your policy should reflect that.`),
329
+ supportChannel: supportChannelSchema.describe(`A URL or email address where users can get help with your connector. This is displayed in the Directory listing. Acceptable options:
330
+ • Email address (e.g. support@myapp.com)
331
+ • Link to a GitHub Issues page
332
+ • Link to a help center or support article
333
+ • Link to a Discord/Slack community
334
+ • Link to your documentation's troubleshooting section
335
+ Also uses this to notify you of security or compliance issues, so make sure it's actively monitored.`),
336
+ testingCredentials: z.string().describe(`Provide login credentials for a test account that Anthropic reviewers can use to verify your server works end-to-end. Critical requirements:
337
+ • The account must have sample/demo data loaded — reviewers need to actually test your tools with real data.
338
+ • No 2FA — reviewers can't receive SMS codes. Disable 2FA on this account.
339
+ • If your service uses Google OAuth or another OAuth that requires email verification, use mcp-review@anthropic.com as the account email — Anthropic has access to this inbox.
340
+ • Credentials must remain valid for at least 30 days from submission.
341
+ • If your service requires API keys instead of a password, provide those.
342
+ Format suggestion: Username/email: xxx | Password: xxx | Any other notes`),
343
+ tools: z.array(toolDefinitionSchema).describe(`A comma-separated list of all tools your MCP server exposes. Use the format: tool_name (Human-Readable Name). The tool_name is the internal identifier (snake_case, max 64 characters). The Human-Readable Name is what users see.
344
+ Example: list_issues (List Issues), create_issue (Create Issue), update_issue (Update Issue), delete_issue (Delete Issue), search_issues (Search Issues)
345
+ Reviewers test every single tool you list here — don't list tools that don't work. Also: do not have a single catch-all tool like api_request(method, endpoint) — Anthropic rejects these. Each action should be its own purpose-built tool.`),
346
+ toolTitlesAnnotationsConfirmed: z.boolean().describe(`This is a compliance confirmation — check both boxes only if you have actually implemented these in your server code:
347
+ • 'I've specified user-friendly titles for all tools' — every tool has a 'title' annotation (a human-readable label, different from the tool name).
348
+ • 'I've specified accurate tool annotations for all tools' — every tool has the correct annotation: readOnlyHint: true for read operations (search, get, list, fetch), OR destructiveHint: true for write operations (create, update, delete, send).
349
+ This is the #1 reason submissions get rejected (30% of all rejections). Do not check these boxes without actually having implemented the annotations. See MCP spec for how to add them.`),
350
+ logoLight: z.string().describe(`Your connector's logo as displayed in the directory. Requirements:
351
+ • Format: SVG only
352
+ • Aspect ratio: square (1:1)
353
+ • Should work on both light and dark backgrounds (or you can provide separate light/dark versions)
354
+ • Provide via URL (Google Drive link is fine) or upload directly
355
+ Tip: use a simple, recognizable icon — not a full wordmark. The logo appears at small sizes in the directory grid.`),
356
+ screenshots: z.array(z.url()).describe(`Screenshots or promotional images of your connector in action within Claude. Strongly recommended for all connectors, and required for MCP Apps (interactive UI). Guidelines:
357
+ • 3–5 images is ideal
358
+ • Minimum 1000px width, PNG format preferred
359
+ • Crop to just the relevant part of the Claude interface (the tool response area)
360
+ • Show your connector doing something impressive and useful — real data, real results
361
+ • If you're an MCP App, include screenshots of your interactive UI elements
362
+ • Videos are also welcome
363
+ These images appear in your directory listing and are a key factor in driving user installs.`)
364
+ });
365
+ claudeSubmissionFormDataSchema.pick({
366
+ companyName: true,
367
+ appName: true,
368
+ mcpUrlType: true,
369
+ serverUrl: true,
370
+ tools: true,
371
+ readWriteCapabilities: true,
372
+ isMcpApp: true,
373
+ transportSupport: true,
374
+ primaryContactEmail: true,
375
+ primaryContactName: true
376
+ });
377
+ claudeSubmissionFormDataSchema.pick({
378
+ tagline: true,
379
+ description: true,
380
+ categories: true,
381
+ testCases: true
382
+ });
383
+ const submissionMetaFieldsSchema = z.object({
384
+ id: z.string(),
385
+ environmentId: z.string(),
386
+ createdAt: z.coerce.date(),
387
+ updatedAt: z.coerce.date()
388
+ });
389
+ const claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
390
+ platform: z.literal("claudeai"),
391
+ formData: claudeSubmissionFormDataSchema.partial()
392
+ });
393
+ const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
394
+ platform: z.literal("chatgpt"),
395
+ formData: chatgptSubmissionFormDataSchema.partial()
396
+ });
397
+ z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
398
+ z.union([claudeSubmissionFormDataSchema.partial(), chatgptSubmissionFormDataSchema.partial()]);
399
+ const subscriptionPlanSchema = z.enum([
400
+ "pro",
401
+ "business",
402
+ "enterprise"
403
+ ]);
404
+ z.object({ plan: subscriptionPlanSchema.nullable() });
405
+ //#endregion
4
406
  //#region src/schemas.ts
5
407
  const RESERVED_KEYS = [
6
408
  "_HANDLER",
@@ -13,7 +415,11 @@ const RESERVED_KEYS = [
13
415
  "AWS_LAMBDA_FUNCTION_VERSION",
14
416
  "AWS_LAMBDA_INITIALIZATION_TYPE",
15
417
  "AWS_LAMBDA_LOG_GROUP_NAME",
418
+ "AWS_LAMBDA_LOG_STREAM_NAME",
16
419
  "AWS_ACCESS_KEY",
420
+ "AWS_ACCESS_KEY_ID",
421
+ "AWS_SECRET_ACCESS_KEY",
422
+ "AWS_SESSION_TOKEN",
17
423
  "AWS_LAMBDA_RUNTIME_API",
18
424
  "LAMBDA_TASK_ROOT",
19
425
  "LAMBDA_RUNTIME_DIR",
@@ -30,7 +436,9 @@ const RESERVED_KEYS = [
30
436
  "BUILD_ARG_BUILD_COMMAND",
31
437
  "BUILD_ARG_BUILD_OUTPUT_DIR",
32
438
  "BUILD_ARG_START_COMMAND",
33
- "ALPIC_HOST"
439
+ "ALPIC_HOST",
440
+ "ALPIC_CUSTOM_DOMAINS",
441
+ "ALPIC_INTENT_META_KEY"
34
442
  ];
35
443
  const environmentVariableSchema = z.object({
36
444
  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"),
@@ -38,6 +446,10 @@ const environmentVariableSchema = z.object({
38
446
  isSecret: z.boolean().default(false)
39
447
  });
40
448
  const environmentVariablesSchema = z.array(environmentVariableSchema);
449
+ const updateEnvironmentVariableSchema = environmentVariableSchema.partial({
450
+ value: true,
451
+ isSecret: true
452
+ });
41
453
  const buildSettingsSchema = z.object({
42
454
  installCommand: z.string().optional(),
43
455
  buildCommand: z.string().optional(),
@@ -55,7 +467,39 @@ const transportSchema = z.enum([
55
467
  "sse",
56
468
  "streamablehttp"
57
469
  ]);
58
-
470
+ const playgroundHeaderSchema = z.object({
471
+ name: z.string().min(1).max(100),
472
+ description: z.string().max(200),
473
+ isRequired: z.boolean().default(false),
474
+ isSecret: z.boolean().default(false)
475
+ });
476
+ const playgroundExamplePromptSchema = z.object({
477
+ title: z.string().min(1).max(100),
478
+ prompt: z.string().min(1).max(500)
479
+ });
480
+ const serverFieldsSchema = z.object({
481
+ $schema: z.string(),
482
+ name: z.string(),
483
+ description: z.string(),
484
+ version: z.string().optional(),
485
+ title: z.string().optional(),
486
+ websiteUrl: z.url().optional(),
487
+ icons: z.array(z.object({
488
+ src: z.url(),
489
+ mimeType: z.string().optional(),
490
+ sizes: z.array(z.string()).optional()
491
+ })).optional(),
492
+ remotes: z.array(z.object({
493
+ type: z.string(),
494
+ url: z.url().optional(),
495
+ headers: z.array(z.object({
496
+ name: z.string(),
497
+ description: z.string(),
498
+ isRequired: z.boolean().optional(),
499
+ isSecret: z.boolean().optional()
500
+ })).optional()
501
+ })).optional()
502
+ });
59
503
  //#endregion
60
504
  //#region src/api.contract.ts
61
505
  const deploymentStatusSchema = z.enum([
@@ -80,8 +524,16 @@ const deploymentSchema = z.object({
80
524
  authorUsername: z.string().nullable(),
81
525
  authorAvatarUrl: z.string().nullable(),
82
526
  startedAt: z.coerce.date().nullable(),
83
- completedAt: z.coerce.date().nullable()
527
+ completedAt: z.coerce.date().nullable(),
528
+ environmentId: z.string(),
529
+ environmentName: z.string(),
530
+ isCurrent: z.boolean(),
531
+ deploymentPageUrl: z.url().nullable()
84
532
  });
533
+ const isValidLogTimeInput = (value) => {
534
+ if (ms(value) !== void 0) return true;
535
+ return !Number.isNaN(new Date(value).getTime());
536
+ };
85
537
  const createEnvironmentContractV1 = oc.route({
86
538
  path: "/v1/environments",
87
539
  method: "POST",
@@ -106,7 +558,7 @@ const createEnvironmentContractV1 = oc.route({
106
558
  projectId: z.string().describe("The ID of the project the environment belongs to")
107
559
  }));
108
560
  const getEnvironmentContractV1 = oc.route({
109
- path: "/v1/environments/:environmentId",
561
+ path: "/v1/environments/{environmentId}",
110
562
  method: "GET",
111
563
  summary: "Get an environment",
112
564
  description: "Get an environment by ID",
@@ -121,10 +573,20 @@ const getEnvironmentContractV1 = oc.route({
121
573
  createdAt: z.coerce.date(),
122
574
  projectId: z.string()
123
575
  }));
576
+ const domainSchema = z.object({
577
+ domain: z.string(),
578
+ status: z.enum([
579
+ "ongoing",
580
+ "deployed",
581
+ "failed"
582
+ ]),
583
+ createdAt: z.coerce.date()
584
+ });
124
585
  const productionEnvironmentSchema = z.object({
125
586
  id: z.string(),
126
587
  name: z.string(),
127
588
  mcpServerUrl: z.string(),
589
+ domains: z.array(domainSchema),
128
590
  latestDeployment: latestDeploymentSchema.nullable()
129
591
  });
130
592
  const environmentSchema = z.object({
@@ -153,7 +615,7 @@ const projectOutputSchema = z.object({
153
615
  environments: z.array(environmentSchema)
154
616
  });
155
617
  const getProjectContractV1 = oc.route({
156
- path: "/v1/projects/:projectId",
618
+ path: "/v1/projects/{projectId}",
157
619
  method: "GET",
158
620
  summary: "Get a project",
159
621
  description: "Get a project by ID",
@@ -167,7 +629,7 @@ const listProjectsContractV1 = oc.route({
167
629
  description: "List all projects for a team",
168
630
  tags: ["projects"],
169
631
  successDescription: "The list of projects"
170
- }).output(z.array(projectOutputSchema));
632
+ }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
171
633
  const createProjectContractV1 = oc.route({
172
634
  path: "/v1/projects",
173
635
  method: "POST",
@@ -180,7 +642,7 @@ const createProjectContractV1 = oc.route({
180
642
  BAD_REQUEST: {}
181
643
  }).input(z.object({
182
644
  teamId: z.string().optional(),
183
- name: z.string().min(1).max(100),
645
+ name: z.string().trim().min(1).max(100),
184
646
  sourceRepository: z.string().optional(),
185
647
  branchName: z.string().min(1).optional(),
186
648
  runtime: runtimeSchema,
@@ -210,8 +672,69 @@ const createProjectContractV1 = oc.route({
210
672
  startCommand: z.string().nullable(),
211
673
  createdAt: z.coerce.date()
212
674
  }));
675
+ const environmentVariableOutputSchema = z.object({
676
+ id: z.string(),
677
+ key: z.string(),
678
+ value: z.string(),
679
+ isSecret: z.boolean(),
680
+ createdAt: z.coerce.date()
681
+ });
682
+ const listEnvironmentVariablesContractV1 = oc.route({
683
+ path: "/v1/environments/{environmentId}/environment-variables",
684
+ method: "GET",
685
+ summary: "List environment variables",
686
+ description: "List all environment variables for an environment",
687
+ tags: ["environments"],
688
+ successDescription: "The list of environment variables"
689
+ }).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
690
+ const createEnvironmentVariablesContractV1 = oc.route({
691
+ path: "/v1/environments/{environmentId}/environment-variables",
692
+ method: "POST",
693
+ summary: "Add environment variables",
694
+ description: "Add one or more environment variables to an environment",
695
+ tags: ["environments"],
696
+ successDescription: "The environment variables have been added successfully"
697
+ }).errors({
698
+ NOT_FOUND: {},
699
+ BAD_REQUEST: {}
700
+ }).input(z.object({
701
+ environmentId: z.string().describe("The ID of the environment"),
702
+ environmentVariables: environmentVariablesSchema
703
+ })).output(z.object({ success: z.literal(true) }));
704
+ const updateEnvironmentVariableContractV1 = oc.route({
705
+ path: "/v1/environment-variables/{environmentVariableId}",
706
+ method: "PATCH",
707
+ summary: "Update an environment variable",
708
+ description: "Update an environment variable by ID",
709
+ tags: ["environments"],
710
+ successDescription: "The environment variable has been updated successfully"
711
+ }).errors({
712
+ NOT_FOUND: {},
713
+ BAD_REQUEST: {}
714
+ }).input(z.object({
715
+ environmentVariableId: z.string().describe("The ID of the environment variable"),
716
+ key: environmentVariableSchema.shape.key,
717
+ value: environmentVariableSchema.shape.value.optional(),
718
+ isSecret: environmentVariableSchema.shape.isSecret.optional()
719
+ })).output(z.object({ success: z.literal(true) }));
720
+ const deleteEnvironmentVariableContractV1 = oc.route({
721
+ path: "/v1/environment-variables/{environmentVariableId}",
722
+ method: "DELETE",
723
+ summary: "Delete an environment variable",
724
+ description: "Delete an environment variable by ID",
725
+ tags: ["environments"],
726
+ successDescription: "The environment variable has been deleted successfully"
727
+ }).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
728
+ const deleteProjectContractV1 = oc.route({
729
+ path: "/v1/projects/{projectId}",
730
+ method: "DELETE",
731
+ summary: "Delete a project",
732
+ description: "Delete a project and all its environments",
733
+ tags: ["projects"],
734
+ successDescription: "The project has been deleted successfully"
735
+ }).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.object({ success: z.literal(true) }));
213
736
  const updateProjectContractV1 = oc.route({
214
- path: "/v1/projects/:projectId",
737
+ path: "/v1/projects/{projectId}",
215
738
  method: "PATCH",
216
739
  summary: "Update a project",
217
740
  description: "Update project settings",
@@ -222,10 +745,11 @@ const updateProjectContractV1 = oc.route({
222
745
  BAD_REQUEST: {}
223
746
  }).input(z.object({
224
747
  projectId: z.string().describe("The ID of the project"),
748
+ name: z.string().min(1).max(100).optional().describe("The new name for the project"),
225
749
  sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
226
750
  })).output(projectOutputSchema);
227
751
  const deployEnvironmentContractV1 = oc.route({
228
- path: "/v1/environments/:environmentId/deploy",
752
+ path: "/v1/environments/{environmentId}/deploy",
229
753
  method: "POST",
230
754
  summary: "Deploy an environment",
231
755
  description: "Deploy an environment",
@@ -246,31 +770,108 @@ const uploadDeploymentArtifactContractV1 = oc.route({
246
770
  tags: ["deployments"],
247
771
  successDescription: "The presigned upload URL has been generated successfully"
248
772
  }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
249
- uploadUrl: z.string().url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
773
+ uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
250
774
  token: z.string().describe("Token to identify the source archive"),
251
775
  expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
252
776
  }));
253
- const listProjectDeploymentsContractV1 = oc.route({
254
- path: "/v1/projects/:projectId/deployments",
777
+ const listDeploymentsContractV1 = oc.route({
778
+ path: "/v1/projects/{projectId}/deployments",
255
779
  method: "GET",
256
780
  summary: "List project deployments",
257
781
  description: "List all deployments for a project",
258
782
  tags: ["deployments"],
259
783
  successDescription: "The list of deployments"
260
- }).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.array(deploymentSchema.extend({
261
- isCurrent: z.boolean(),
262
- environmentId: z.string()
263
- })));
784
+ }).errors({ NOT_FOUND: {} }).input(z.object({
785
+ projectId: z.string().describe("The ID of the project"),
786
+ status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
787
+ environmentId: z.string().optional().describe("Filter by environment ID")
788
+ })).output(z.array(deploymentSchema));
264
789
  const getDeploymentContractV1 = oc.route({
265
- path: "/v1/deployments/:deploymentId",
790
+ path: "/v1/deployments/{deploymentId}",
266
791
  method: "GET",
267
792
  summary: "Get a deployment",
268
793
  description: "Get a deployment by ID",
269
794
  tags: ["deployments"],
270
795
  successDescription: "The deployment details"
271
796
  }).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
797
+ const getLogsContractV1 = oc.route({
798
+ path: "/v1/environments/{environmentId}/logs",
799
+ method: "GET",
800
+ summary: "Get logs",
801
+ description: "Get logs for an environment",
802
+ tags: ["environments"],
803
+ successDescription: "The logs"
804
+ }).errors({
805
+ NOT_FOUND: {},
806
+ BAD_REQUEST: {}
807
+ }).input(z.object({
808
+ environmentId: z.string().describe("The ID of the environment"),
809
+ 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)"),
810
+ 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"),
811
+ limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
812
+ level: z.array(z.enum([
813
+ "INFO",
814
+ "ERROR",
815
+ "WARNING",
816
+ "DEBUG"
817
+ ])).optional().describe("Filter by log level"),
818
+ search: z.string().optional().describe("Filter pattern to search for in log content"),
819
+ nextToken: z.string().optional().describe("Pagination token from a previous response")
820
+ })).output(z.object({
821
+ logs: z.array(z.object({
822
+ timestamp: z.coerce.date(),
823
+ type: z.enum([
824
+ "START",
825
+ "END",
826
+ "INFO",
827
+ "ERROR",
828
+ "WARNING",
829
+ "DEBUG"
830
+ ]),
831
+ requestId: z.string(),
832
+ content: z.string().optional(),
833
+ method: z.string().optional(),
834
+ durationInMs: z.number().optional()
835
+ })),
836
+ nextToken: z.string().nullable()
837
+ }));
838
+ const getLatestLogsContractV1 = oc.route({
839
+ path: "/v1/environments/{environmentId}/latest-logs",
840
+ method: "GET",
841
+ summary: "Get latest logs",
842
+ description: "Get the N most recent logs for an environment",
843
+ tags: ["environments"],
844
+ successDescription: "The latest logs"
845
+ }).errors({
846
+ NOT_FOUND: {},
847
+ BAD_REQUEST: {}
848
+ }).input(z.object({
849
+ environmentId: z.string().describe("The ID of the environment"),
850
+ limit: z.coerce.number().int().min(1).max(1e3).default(100).describe("Number of most recent log entries to return"),
851
+ level: z.array(z.enum([
852
+ "INFO",
853
+ "ERROR",
854
+ "WARNING",
855
+ "DEBUG"
856
+ ])).optional().describe("Filter by log level"),
857
+ search: z.string().optional().describe("Filter pattern to search for in log content")
858
+ })).output(z.object({ logs: z.array(z.object({
859
+ timestamp: z.coerce.date(),
860
+ type: z.enum([
861
+ "START",
862
+ "END",
863
+ "INFO",
864
+ "ERROR",
865
+ "WARNING",
866
+ "DEBUG"
867
+ ]),
868
+ requestId: z.string(),
869
+ content: z.string().optional(),
870
+ method: z.string().optional(),
871
+ durationInMs: z.number().optional()
872
+ })) }));
272
873
  const getDeploymentLogsContractV1 = oc.route({
273
- path: "/v1/deployments/:deploymentId/logs",
874
+ path: "/v1/deployments/{deploymentId}/logs",
274
875
  method: "GET",
275
876
  summary: "Get deployment logs",
276
877
  description: "Get the logs for a deployment",
@@ -297,7 +898,7 @@ const analyticsTimeSeriesSchema = z.object({
297
898
  task_count: z.array(analyticsDataPointSchema)
298
899
  });
299
900
  const getProjectAnalyticsContractV1 = oc.route({
300
- path: "/v1/analytics/:projectId",
901
+ path: "/v1/analytics/{projectId}",
301
902
  method: "GET",
302
903
  summary: "Get project analytics",
303
904
  description: "Get analytics data for a project over a time range",
@@ -332,14 +933,129 @@ const listTeamsContractV1 = oc.route({
332
933
  id: z.string(),
333
934
  name: z.string(),
334
935
  createdAt: z.coerce.date(),
335
- hasStripeAccount: z.boolean(),
336
- hasActiveSubscription: z.boolean()
936
+ hasStripeAccount: z.boolean()
337
937
  })));
938
+ const getTunnelTicketContractV1 = oc.route({
939
+ path: "/v1/tunnels/ticket",
940
+ method: "GET",
941
+ summary: "Get a tunnel ticket",
942
+ description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
943
+ tags: ["tunnels"],
944
+ successDescription: "The tunnel ticket"
945
+ }).output(z.object({
946
+ subdomain: z.string().describe("The subdomain assigned to the user"),
947
+ ticket: z.string().describe("The signed tunnel ticket"),
948
+ tunnelHost: z.string().describe("The tunnel host to connect to")
949
+ }));
950
+ const publishServerContractV1 = oc.route({
951
+ path: "/v1/distribution/publish",
952
+ method: "POST",
953
+ summary: "Publish a server to the MCP registry",
954
+ tags: ["distribution"],
955
+ successDescription: "The server has been published successfully"
956
+ }).errors({
957
+ NOT_FOUND: {},
958
+ BAD_REQUEST: {}
959
+ }).input(z.object({
960
+ projectId: z.string(),
961
+ domain: z.string(),
962
+ title: z.string().min(1).max(100),
963
+ description: z.string().min(1).max(100),
964
+ websiteUrl: z.url().max(255).optional(),
965
+ iconSrc: z.url().max(255).optional(),
966
+ dryRun: z.boolean().optional()
967
+ })).output(z.object({ serverFields: serverFieldsSchema }));
968
+ const getServerInfoContractV1 = oc.route({
969
+ path: "/v1/distribution/get",
970
+ method: "GET",
971
+ summary: "Get server info",
972
+ description: "Get info about a server",
973
+ tags: ["distribution"],
974
+ successDescription: "The server info"
975
+ }).errors({
976
+ NOT_FOUND: {},
977
+ BAD_REQUEST: {}
978
+ }).input(z.object({
979
+ projectId: z.string(),
980
+ domain: z.string()
981
+ })).output(z.object({ serverFields: serverFieldsSchema }));
982
+ const playgroundServerMetadataOutputSchema = z.object({
983
+ name: z.string(),
984
+ description: z.string(),
985
+ headers: z.array(z.object({
986
+ name: z.string(),
987
+ description: z.string(),
988
+ isRequired: z.boolean(),
989
+ isSecret: z.boolean()
990
+ })),
991
+ examplePrompts: z.array(playgroundExamplePromptSchema)
992
+ });
993
+ const playgroundOutputSchema = z.object({
994
+ isPlaygroundEnabled: z.boolean(),
995
+ serverMetadata: playgroundServerMetadataOutputSchema.nullable()
996
+ });
997
+ const getPlaygroundContractV1 = oc.route({
998
+ path: "/v1/environments/{environmentId}/playground",
999
+ method: "GET",
1000
+ summary: "Get playground configuration",
1001
+ description: "Get the playground configuration for an environment",
1002
+ tags: ["environments"],
1003
+ successDescription: "The playground configuration"
1004
+ }).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
1005
+ const upsertPlaygroundContractV1 = oc.route({
1006
+ path: "/v1/environments/{environmentId}/playground",
1007
+ method: "PUT",
1008
+ summary: "Update playground configuration",
1009
+ description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
1010
+ tags: ["environments"],
1011
+ successDescription: "The updated playground configuration"
1012
+ }).errors({
1013
+ NOT_FOUND: {},
1014
+ BAD_REQUEST: {}
1015
+ }).input(z.object({
1016
+ environmentId: z.string().describe("The ID of the environment"),
1017
+ isPlaygroundEnabled: z.boolean().optional(),
1018
+ name: z.string().min(1).max(100).optional(),
1019
+ description: z.string().min(1).max(500).optional(),
1020
+ headers: z.array(playgroundHeaderSchema).optional(),
1021
+ examplePrompts: z.array(playgroundExamplePromptSchema).max(3).optional()
1022
+ })).output(playgroundOutputSchema);
1023
+ const createBeaconContractV1 = oc.route({
1024
+ path: "/v1/beacon/audits",
1025
+ method: "POST",
1026
+ summary: "Create a beacon audit",
1027
+ description: "Audit an MCP server for spec compliance and AI client compatibility",
1028
+ tags: ["beacon"],
1029
+ successDescription: "The audit has been created"
1030
+ }).errors({
1031
+ NOT_FOUND: {},
1032
+ BAD_REQUEST: {}
1033
+ }).input(z.object({
1034
+ targetUrl: z.url().describe("The HTTPS URL of the MCP server to audit"),
1035
+ teamId: z.string().optional().describe("The team ID to associate the audit with"),
1036
+ projectId: z.string().optional().describe("The project ID to associate the audit with"),
1037
+ excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
1038
+ })).output(z.object({ id: z.string() }));
1039
+ const getBeaconContractV1 = oc.route({
1040
+ path: "/v1/beacon/audits/{auditId}",
1041
+ method: "GET",
1042
+ summary: "Get a beacon audit",
1043
+ description: "Get a beacon audit by ID, including the report if completed",
1044
+ tags: ["beacon"],
1045
+ successDescription: "The audit details"
1046
+ }).errors({ NOT_FOUND: {} }).input(z.object({ auditId: z.string().describe("The ID of the audit") })).output(z.object({
1047
+ id: z.string(),
1048
+ targetUrl: z.string(),
1049
+ status: auditStatusSchema,
1050
+ durationMs: z.number().nullable(),
1051
+ createdAt: z.coerce.date(),
1052
+ report: auditReportWithScreenshotsSchema.nullable()
1053
+ }));
338
1054
  const contract = {
339
1055
  teams: { list: { v1: listTeamsContractV1 } },
340
1056
  analytics: { get: { v1: getProjectAnalyticsContractV1 } },
341
1057
  deployments: {
342
- list: { v1: listProjectDeploymentsContractV1 },
1058
+ list: { v1: listDeploymentsContractV1 },
343
1059
  get: { v1: getDeploymentContractV1 },
344
1060
  uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
345
1061
  getLogs: { v1: getDeploymentLogsContractV1 }
@@ -347,15 +1063,36 @@ const contract = {
347
1063
  environments: {
348
1064
  create: { v1: createEnvironmentContractV1 },
349
1065
  get: { v1: getEnvironmentContractV1 },
350
- deploy: { v1: deployEnvironmentContractV1 }
1066
+ deploy: { v1: deployEnvironmentContractV1 },
1067
+ getLogs: { v1: getLogsContractV1 },
1068
+ getLatestLogs: { v1: getLatestLogsContractV1 }
1069
+ },
1070
+ environmentVariables: {
1071
+ list: { v1: listEnvironmentVariablesContractV1 },
1072
+ create: { v1: createEnvironmentVariablesContractV1 },
1073
+ update: { v1: updateEnvironmentVariableContractV1 },
1074
+ delete: { v1: deleteEnvironmentVariableContractV1 }
351
1075
  },
352
1076
  projects: {
353
1077
  update: { v1: updateProjectContractV1 },
354
1078
  get: { v1: getProjectContractV1 },
355
1079
  list: { v1: listProjectsContractV1 },
356
- create: { v1: createProjectContractV1 }
1080
+ create: { v1: createProjectContractV1 },
1081
+ delete: { v1: deleteProjectContractV1 }
1082
+ },
1083
+ playground: {
1084
+ get: { v1: getPlaygroundContractV1 },
1085
+ upsert: { v1: upsertPlaygroundContractV1 }
1086
+ },
1087
+ tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
1088
+ distribution: {
1089
+ publish: { v1: publishServerContractV1 },
1090
+ get: { v1: getServerInfoContractV1 }
1091
+ },
1092
+ beacon: {
1093
+ create: { v1: createBeaconContractV1 },
1094
+ get: { v1: getBeaconContractV1 }
357
1095
  }
358
1096
  };
359
-
360
1097
  //#endregion
361
- export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
1098
+ export { PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };