@alpic-ai/api 0.0.0-staging.g5f9cfc4 → 0.0.0-staging.g601babe
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 +1522 -58
- package/dist/index.mjs +478 -149
- package/package.json +6 -6
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.
|
|
5
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
6
6
|
/**
|
|
7
7
|
* Reusable URL validation that disallows javascript: scheme
|
|
8
8
|
*/
|
|
@@ -179,6 +179,7 @@ const PLATFORM_LABELS = {
|
|
|
179
179
|
};
|
|
180
180
|
const WAF_PLATFORMS = [
|
|
181
181
|
"akamai",
|
|
182
|
+
"cato",
|
|
182
183
|
"cloudflare",
|
|
183
184
|
"fastly"
|
|
184
185
|
];
|
|
@@ -256,6 +257,16 @@ z.object({
|
|
|
256
257
|
clientSecret: z.string(),
|
|
257
258
|
clientScopes: z.array(z.string())
|
|
258
259
|
});
|
|
260
|
+
z.enum([
|
|
261
|
+
"opening_balance",
|
|
262
|
+
"free_seed",
|
|
263
|
+
"paid_conversion_floor",
|
|
264
|
+
"top_up",
|
|
265
|
+
"usage",
|
|
266
|
+
"refund",
|
|
267
|
+
"admin_adjustment"
|
|
268
|
+
]);
|
|
269
|
+
z.enum(["playground"]);
|
|
259
270
|
const deploymentStatusSchema$1 = z.enum([
|
|
260
271
|
"ongoing",
|
|
261
272
|
"deployed",
|
|
@@ -283,33 +294,18 @@ const deploymentSummarySchema = z.object({
|
|
|
283
294
|
createdAt: z.coerce.date(),
|
|
284
295
|
updatedAt: z.coerce.date()
|
|
285
296
|
});
|
|
286
|
-
/**
|
|
287
|
-
* Public environment
|
|
288
|
-
*
|
|
289
|
-
* Answers anonymously and exposes no OAuth metadata.
|
|
290
|
-
*/
|
|
297
|
+
/** Public environment: answers anonymously and exposes no OAuth metadata. */
|
|
291
298
|
const publicEnvironmentSchema = z.object({
|
|
292
299
|
allowsAnonymous: z.literal(true),
|
|
293
300
|
oAuthMetadata: z.strictObject({})
|
|
294
301
|
});
|
|
295
|
-
/**
|
|
296
|
-
* Protected environment with an external resource metadata URL
|
|
297
|
-
*
|
|
298
|
-
* An external resource metadata URL is returned in the WWW-Authenticate header during the first 401 response.
|
|
299
|
-
* Everything that follows is handled outside of the MCP server scope.
|
|
300
|
-
*/
|
|
302
|
+
/** Protected environment whose external resource metadata URL is returned in the WWW-Authenticate header on the first 401; everything after is handled outside the MCP server scope. */
|
|
301
303
|
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
302
304
|
allowsAnonymous: z.boolean(),
|
|
303
305
|
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
304
306
|
scope: z.string().optional()
|
|
305
307
|
});
|
|
306
|
-
/**
|
|
307
|
-
* Protected environment with an external authorization server URL
|
|
308
|
-
*
|
|
309
|
-
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
310
|
-
* An external authorization server URL is returned when requesting the endpoint.
|
|
311
|
-
* Everything that follows is handled outside of the MCP server scope.
|
|
312
|
-
*/
|
|
308
|
+
/** Protected environment whose own /.well-known/oauth-protected-resource endpoint points at an external authorization server; everything after is handled outside the MCP server scope. */
|
|
313
309
|
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
314
310
|
allowsAnonymous: z.boolean(),
|
|
315
311
|
oAuthMetadata: z.object({
|
|
@@ -318,12 +314,7 @@ const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
|
318
314
|
}),
|
|
319
315
|
scope: z.string().optional()
|
|
320
316
|
});
|
|
321
|
-
/**
|
|
322
|
-
* Standalone protected environment
|
|
323
|
-
*
|
|
324
|
-
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
325
|
-
* The server itself exposes the /.well-known/oauth-authorization-server endpoint.
|
|
326
|
-
*/
|
|
317
|
+
/** Standalone protected environment: the server itself exposes both the /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server endpoints. */
|
|
327
318
|
const standaloneEnvironmentSchema = z.object({
|
|
328
319
|
allowsAnonymous: z.boolean(),
|
|
329
320
|
oAuthMetadata: z.object({
|
|
@@ -332,13 +323,7 @@ const standaloneEnvironmentSchema = z.object({
|
|
|
332
323
|
}),
|
|
333
324
|
scope: z.string().optional()
|
|
334
325
|
});
|
|
335
|
-
/**
|
|
336
|
-
* Protected environment without OAuth discovery
|
|
337
|
-
*
|
|
338
|
-
* The server enforces authentication but exposes no OAuth discovery metadata.
|
|
339
|
-
* Neither /.well-known/oauth-protected-resource nor /.well-known/oauth-authorization-server
|
|
340
|
-
* are advertised. Clients must obtain credentials out-of-band.
|
|
341
|
-
*/
|
|
326
|
+
/** Protected environment that enforces authentication but advertises no OAuth discovery metadata; clients must obtain credentials out-of-band. */
|
|
342
327
|
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
343
328
|
allowsAnonymous: z.literal(false),
|
|
344
329
|
oAuthMetadata: z.strictObject({}),
|
|
@@ -428,12 +413,13 @@ z.object({
|
|
|
428
413
|
collectUserData: z.boolean(),
|
|
429
414
|
identityTraitKey: z.string().min(1).max(200).nullable()
|
|
430
415
|
});
|
|
431
|
-
z.object({
|
|
416
|
+
const feedbackSchema = z.object({
|
|
432
417
|
id: z.string(),
|
|
433
418
|
createdAt: z.coerce.date(),
|
|
434
419
|
environmentId: z.string(),
|
|
435
420
|
content: z.string(),
|
|
436
|
-
source: z.enum(["model", "user"])
|
|
421
|
+
source: z.enum(["model", "user"]),
|
|
422
|
+
clientName: z.string().nullable()
|
|
437
423
|
});
|
|
438
424
|
z.object({
|
|
439
425
|
content: z.string(),
|
|
@@ -449,7 +435,7 @@ const intentCategoryColorSchema = z.enum([
|
|
|
449
435
|
"pink",
|
|
450
436
|
"gray"
|
|
451
437
|
]);
|
|
452
|
-
intentCategoryColorSchema.options;
|
|
438
|
+
const INTENT_CATEGORY_COLORS = intentCategoryColorSchema.options;
|
|
453
439
|
const intentCategorySchema = z.object({
|
|
454
440
|
id: z.string(),
|
|
455
441
|
createdAt: z.coerce.date(),
|
|
@@ -457,7 +443,7 @@ const intentCategorySchema = z.object({
|
|
|
457
443
|
name: z.string(),
|
|
458
444
|
color: intentCategoryColorSchema
|
|
459
445
|
});
|
|
460
|
-
z.object({
|
|
446
|
+
const intentCategorySummarySchema = z.object({
|
|
461
447
|
id: z.string(),
|
|
462
448
|
name: z.string(),
|
|
463
449
|
color: intentCategoryColorSchema,
|
|
@@ -469,6 +455,7 @@ z.object({
|
|
|
469
455
|
environmentId: z.string(),
|
|
470
456
|
toolName: z.string(),
|
|
471
457
|
message: z.string(),
|
|
458
|
+
clientName: z.string().nullable(),
|
|
472
459
|
categories: z.array(intentCategorySchema)
|
|
473
460
|
});
|
|
474
461
|
const signalCategorySchema = z.object({
|
|
@@ -533,6 +520,246 @@ z.enum([
|
|
|
533
520
|
"DEBUG",
|
|
534
521
|
"ERROR"
|
|
535
522
|
]);
|
|
523
|
+
/** Only names a vendor actually ships belong here: lookalikes like `claude-code-test` are customers' own scripts. */
|
|
524
|
+
const MCP_CLIENT_GROUPS = [
|
|
525
|
+
{
|
|
526
|
+
id: "claude_code",
|
|
527
|
+
label: "Claude Code",
|
|
528
|
+
vendor: "anthropic",
|
|
529
|
+
rawNames: ["claude-code", "Anthropic/ClaudeCodeDesktop"]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
id: "claude",
|
|
533
|
+
label: "Claude",
|
|
534
|
+
vendor: "anthropic",
|
|
535
|
+
rawNames: [
|
|
536
|
+
"Anthropic/ClaudeAI",
|
|
537
|
+
"claude-ai",
|
|
538
|
+
"claude",
|
|
539
|
+
"Claude",
|
|
540
|
+
"claude-desktop",
|
|
541
|
+
"claude-desktop-3p"
|
|
542
|
+
]
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
id: "claude_mobile",
|
|
546
|
+
label: "Claude mobile",
|
|
547
|
+
vendor: "anthropic",
|
|
548
|
+
rawNames: ["claude-ios", "ClaudeAndroid"]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
id: "claude_cowork",
|
|
552
|
+
label: "Claude Cowork",
|
|
553
|
+
vendor: "anthropic",
|
|
554
|
+
rawNames: ["Anthropic/Cowork"]
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
id: "claude_toolbox",
|
|
558
|
+
label: "Claude Toolbox",
|
|
559
|
+
vendor: "anthropic",
|
|
560
|
+
rawNames: ["Anthropic/Toolbox", "Anthropic/toolbox-bootstrap"]
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
id: "anthropic_api",
|
|
564
|
+
label: "Anthropic API",
|
|
565
|
+
vendor: "anthropic",
|
|
566
|
+
rawNames: ["Anthropic/API"]
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
id: "anthropic_connector_refresh",
|
|
570
|
+
label: "Anthropic (connector refresh)",
|
|
571
|
+
vendor: "anthropic",
|
|
572
|
+
rawNames: ["Anthropic"]
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
id: "codex",
|
|
576
|
+
label: "Codex",
|
|
577
|
+
vendor: "openai",
|
|
578
|
+
rawNames: [
|
|
579
|
+
"codex-mcp-client",
|
|
580
|
+
"codex",
|
|
581
|
+
"Codex",
|
|
582
|
+
"codex-cli",
|
|
583
|
+
"openai-mcp (Codex)"
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
id: "chatgpt",
|
|
588
|
+
label: "ChatGPT",
|
|
589
|
+
vendor: "openai",
|
|
590
|
+
rawNames: ["openai-mcp (ChatGPT)"]
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: "openai_responses_api",
|
|
594
|
+
label: "OpenAI Responses API",
|
|
595
|
+
vendor: "openai",
|
|
596
|
+
rawNames: ["openai-mcp (Responses API)"]
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "openai_agent_builder",
|
|
600
|
+
label: "OpenAI Agent Builder",
|
|
601
|
+
vendor: "openai",
|
|
602
|
+
rawNames: ["openai-mcp (Agent Builder)"]
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
id: "openai_other",
|
|
606
|
+
label: "OpenAI Other",
|
|
607
|
+
vendor: "openai",
|
|
608
|
+
rawNames: ["openai-mcp"]
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
id: "cursor",
|
|
612
|
+
label: "Cursor",
|
|
613
|
+
vendor: "cursor",
|
|
614
|
+
rawNames: [
|
|
615
|
+
"cursor-vscode",
|
|
616
|
+
"Cursor",
|
|
617
|
+
"cursor"
|
|
618
|
+
]
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
id: "cline",
|
|
622
|
+
label: "Cline",
|
|
623
|
+
vendor: "cline",
|
|
624
|
+
rawNames: [
|
|
625
|
+
"Cline",
|
|
626
|
+
"cline",
|
|
627
|
+
"@cline/core"
|
|
628
|
+
]
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
id: "github_copilot",
|
|
632
|
+
label: "GitHub Copilot",
|
|
633
|
+
vendor: "githubCopilot",
|
|
634
|
+
rawNames: [
|
|
635
|
+
"Copilot",
|
|
636
|
+
"github-copilot-developer",
|
|
637
|
+
"Copilot MCP Gateway",
|
|
638
|
+
"Xcode/copilot-xcode"
|
|
639
|
+
]
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
id: "gemini_cli",
|
|
643
|
+
label: "Gemini CLI",
|
|
644
|
+
vendor: "google",
|
|
645
|
+
rawNames: ["gemini-cli-mcp-client", "gemini-cli"]
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
id: "antigravity",
|
|
649
|
+
label: "Antigravity",
|
|
650
|
+
vendor: "google",
|
|
651
|
+
rawNames: ["antigravity-client"]
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
id: "gemini",
|
|
655
|
+
label: "Gemini",
|
|
656
|
+
vendor: "google",
|
|
657
|
+
rawNames: ["Gemini", "google-ai-edge-gallery"]
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
id: "windsurf",
|
|
661
|
+
label: "Windsurf",
|
|
662
|
+
vendor: "windsurf",
|
|
663
|
+
rawNames: ["Windsurf", "windsurf-client"]
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
id: "mistral",
|
|
667
|
+
label: "Mistral / Le Chat",
|
|
668
|
+
vendor: "mistral",
|
|
669
|
+
rawNames: ["Mistral"],
|
|
670
|
+
rawNamePrefixes: ["connector:custom-mcp:"]
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
id: "n8n",
|
|
674
|
+
label: "n8n",
|
|
675
|
+
vendor: "n8n",
|
|
676
|
+
rawNames: [
|
|
677
|
+
"@n8n/n8n-nodes-langchain.mcpClient",
|
|
678
|
+
"@n8n/n8n-nodes-langchain.mcpClientTool",
|
|
679
|
+
"n8n"
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
id: "alpic_playground",
|
|
684
|
+
label: "Alpic Playground",
|
|
685
|
+
vendor: "alpic",
|
|
686
|
+
rawNames: ["alpic-playground", "playground"]
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
id: "opencode",
|
|
690
|
+
label: "opencode",
|
|
691
|
+
vendor: "opencode",
|
|
692
|
+
rawNames: ["opencode"]
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
id: "zed",
|
|
696
|
+
label: "Zed",
|
|
697
|
+
vendor: "zed",
|
|
698
|
+
rawNames: ["Zed", "zed"]
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
id: "zapier",
|
|
702
|
+
label: "Zapier",
|
|
703
|
+
vendor: "zapier",
|
|
704
|
+
rawNames: ["Zapier", "zapier"]
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
id: "make",
|
|
708
|
+
label: "Make",
|
|
709
|
+
vendor: "make",
|
|
710
|
+
rawNames: ["Make", "make"]
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
id: "librechat",
|
|
714
|
+
label: "LibreChat",
|
|
715
|
+
vendor: "mcp",
|
|
716
|
+
rawNames: ["LibreChat", "librechat"]
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
id: "jan",
|
|
720
|
+
label: "Jan",
|
|
721
|
+
vendor: "mcp",
|
|
722
|
+
rawNames: ["Jan", "jan"]
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
id: "goose",
|
|
726
|
+
label: "goose",
|
|
727
|
+
vendor: "mcp",
|
|
728
|
+
rawNames: ["goose", "Goose"]
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
id: "mcphost",
|
|
732
|
+
label: "mcphost",
|
|
733
|
+
vendor: "mcp",
|
|
734
|
+
rawNames: ["mcphost"]
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
id: "mcporter",
|
|
738
|
+
label: "mcporter",
|
|
739
|
+
vendor: "mcp",
|
|
740
|
+
rawNames: ["mcporter"]
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
id: "rmcp",
|
|
744
|
+
label: "rmcp",
|
|
745
|
+
vendor: "mcp",
|
|
746
|
+
rawNames: ["rmcp"]
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
id: "unnamed_client",
|
|
750
|
+
label: "Unnamed client",
|
|
751
|
+
vendor: "mcp",
|
|
752
|
+
rawNames: [
|
|
753
|
+
"mcp",
|
|
754
|
+
"unknown",
|
|
755
|
+
""
|
|
756
|
+
]
|
|
757
|
+
}
|
|
758
|
+
];
|
|
759
|
+
/** A source pattern, not a RegExp, because analytics renders the same rule into ClickHouse RE2, which shares this syntax. */
|
|
760
|
+
const MCP_REMOTE_WRAPPER_SUFFIX = String.raw` \(via mcp-remote [^\n]+?\)$`;
|
|
761
|
+
new RegExp(MCP_REMOTE_WRAPPER_SUFFIX);
|
|
762
|
+
new Map(MCP_CLIENT_GROUPS.map((group) => [group.id, group]));
|
|
536
763
|
const runtimeSchema = z.enum([
|
|
537
764
|
"python3.13",
|
|
538
765
|
"python3.14",
|
|
@@ -610,15 +837,7 @@ z.object({
|
|
|
610
837
|
serverFields: serverFieldsSchema$1,
|
|
611
838
|
source: z.enum(["registry", "defaults"])
|
|
612
839
|
});
|
|
613
|
-
/**
|
|
614
|
-
* Returns a variant of a `maxLength`-constrained string that clamps (truncates) instead of
|
|
615
|
-
* rejecting on overflow — used for AI-generated copy where the model routinely overshoots.
|
|
616
|
-
*
|
|
617
|
-
* NOTE: this rebuilds the schema from scratch, carrying over only `maxLength` (as a clamp),
|
|
618
|
-
* `minLength`, and the description. Any other validators on the source field (`.regex()`,
|
|
619
|
-
* `.email()`, custom refinements) are intentionally dropped — this helper is meant for plain
|
|
620
|
-
* free-text length caps only. A field with `null` `maxLength` is returned unchanged.
|
|
621
|
-
*/
|
|
840
|
+
/** Clamps instead of rejecting on max-length overflow (for AI-generated copy that overshoots); intentionally carries over only maxLength, minLength, and description, dropping any other validators. */
|
|
622
841
|
const clampStringField = (field) => {
|
|
623
842
|
const max = field.maxLength;
|
|
624
843
|
if (max === null) return field;
|
|
@@ -964,11 +1183,7 @@ const chatgptToolJustificationSchema = z.object({
|
|
|
964
1183
|
openWorldJustification: z.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
965
1184
|
destructiveJustification: z.string().describe("One sentence on whether the tool changes data. For a read-only tool, state the full triad: \"No data is created, modified, or deleted.\"")
|
|
966
1185
|
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
967
|
-
/**
|
|
968
|
-
* Base copy fields, defined once and reused by both the submission form and per-locale
|
|
969
|
-
* translations so the constraints (tagline ≤ 30 chars) never drift. The translation generation
|
|
970
|
-
* path wraps these in {@link clampStringField} since the LLM tends to overshoot the limit.
|
|
971
|
-
*/
|
|
1186
|
+
/** Defined once and reused by both the submission form and per-locale translations so the tagline ≤ 30 chars constraint never drifts. */
|
|
972
1187
|
const chatgptTaglineSchema = z.string().max(30);
|
|
973
1188
|
const chatgptDescriptionSchema = z.string();
|
|
974
1189
|
const chatgptTranslationSchema = z.object({
|
|
@@ -977,10 +1192,7 @@ const chatgptTranslationSchema = z.object({
|
|
|
977
1192
|
description: chatgptDescriptionSchema
|
|
978
1193
|
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
979
1194
|
chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
980
|
-
/**
|
|
981
|
-
* Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
|
|
982
|
-
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
983
|
-
*/
|
|
1195
|
+
/** Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section; keep it in sync with the sheet. */
|
|
984
1196
|
const chatgptSubmissionFormDataSchema = z.object({
|
|
985
1197
|
logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
|
|
986
1198
|
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."),
|
|
@@ -1077,11 +1289,7 @@ const claudePolicyAcknowledgementSchema = z.enum([
|
|
|
1077
1289
|
"My connector does not collect conversation data beyond what is needed for its function.",
|
|
1078
1290
|
"Public documentation for this connector will be live by the publish date."
|
|
1079
1291
|
]);
|
|
1080
|
-
/**
|
|
1081
|
-
* Field order mirrors the claude.ai directory submission wizard
|
|
1082
|
-
* (`claude.ai/admin-settings/directory/submissions/new`), grouped by step.
|
|
1083
|
-
* When adding/removing/reordering fields, keep this in sync with the wizard.
|
|
1084
|
-
*/
|
|
1292
|
+
/** Field order mirrors the claude.ai directory submission wizard (`claude.ai/admin-settings/directory/submissions/new`), grouped by step; keep it in sync with the wizard. */
|
|
1085
1293
|
const claudeSubmissionFormDataSchema = z.object({
|
|
1086
1294
|
serverUrl: z.url().describe(`The full https:// URL where your MCP server is hosted and reachable. In the claude.ai wizard this is read live
|
|
1087
1295
|
from the custom connector you select — the connection is used to verify the URL and the tool list at submission time.
|
|
@@ -1173,12 +1381,7 @@ claudeSubmissionFormDataSchema.pick({
|
|
|
1173
1381
|
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
1174
1382
|
testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
|
|
1175
1383
|
});
|
|
1176
|
-
/**
|
|
1177
|
-
* Narrative fields the LLM-backed generation step produces for Claude submissions.
|
|
1178
|
-
* This schema accepts the slightly loose shape returned by AI generation, then normalizes it into
|
|
1179
|
-
* the strict form shape. Keep transforms here rather than in callers so generation leniency is
|
|
1180
|
-
* colocated with the Claude contract.
|
|
1181
|
-
*/
|
|
1384
|
+
/** Loose shape returned by AI generation for Claude narrative fields; transforms live here so generation leniency stays colocated with the Claude contract. */
|
|
1182
1385
|
const claudeAiGeneratedFormDataRawSchema = z.object({
|
|
1183
1386
|
oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
|
|
1184
1387
|
description: claudeSubmissionFormDataSchema.shape.description,
|
|
@@ -1206,6 +1409,11 @@ const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
|
1206
1409
|
});
|
|
1207
1410
|
z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
|
|
1208
1411
|
z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
|
|
1412
|
+
z.literal([
|
|
1413
|
+
100,
|
|
1414
|
+
75,
|
|
1415
|
+
50
|
|
1416
|
+
]);
|
|
1209
1417
|
const subscriptionPlanSchema = z.enum([
|
|
1210
1418
|
"pro",
|
|
1211
1419
|
"business",
|
|
@@ -1223,6 +1431,7 @@ const customerUsageSchema = z.object({
|
|
|
1223
1431
|
periodEnd: z.number()
|
|
1224
1432
|
});
|
|
1225
1433
|
const partnerDiscountSchema = z.object({ endsAt: z.number() });
|
|
1434
|
+
z.object({ balanceInNanoUSD: z.number() });
|
|
1226
1435
|
z.object({
|
|
1227
1436
|
customerCredits: customerCreditsSchema.nullable(),
|
|
1228
1437
|
customerUsage: customerUsageSchema.nullable(),
|
|
@@ -1354,21 +1563,20 @@ const deploymentSchema = z.object({
|
|
|
1354
1563
|
isCurrent: z.boolean(),
|
|
1355
1564
|
deploymentPageUrl: z.url().nullable()
|
|
1356
1565
|
});
|
|
1357
|
-
const
|
|
1566
|
+
const isValidTimeInput = (value) => {
|
|
1358
1567
|
if (ms(value) !== void 0) return true;
|
|
1359
1568
|
return !Number.isNaN(new Date(value).getTime());
|
|
1360
1569
|
};
|
|
1361
|
-
const
|
|
1570
|
+
const timeInputSchema = z.string().refine(isValidTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." });
|
|
1571
|
+
const base = oc.errors({ BAD_REQUEST: {} });
|
|
1572
|
+
const createEnvironmentContractV1 = base.route({
|
|
1362
1573
|
path: "/v1/environments",
|
|
1363
1574
|
method: "POST",
|
|
1364
1575
|
summary: "Create an environment",
|
|
1365
1576
|
description: "Create an environment for a project",
|
|
1366
1577
|
tags: ["environments"],
|
|
1367
1578
|
successDescription: "The environment has been created successfully"
|
|
1368
|
-
}).errors({
|
|
1369
|
-
NOT_FOUND: {},
|
|
1370
|
-
BAD_REQUEST: {}
|
|
1371
|
-
}).input(z.object({
|
|
1579
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1372
1580
|
projectId: z.string().describe("The ID of the project to create the environment for"),
|
|
1373
1581
|
name: z.string().min(1).describe("The name of the environment"),
|
|
1374
1582
|
sourceBranch: z.string().min(1).describe("The branch used to build the environment"),
|
|
@@ -1381,7 +1589,7 @@ const createEnvironmentContractV1 = oc.route({
|
|
|
1381
1589
|
createdAt: z.coerce.date(),
|
|
1382
1590
|
projectId: z.string().describe("The ID of the project the environment belongs to")
|
|
1383
1591
|
}));
|
|
1384
|
-
const getEnvironmentContractV1 =
|
|
1592
|
+
const getEnvironmentContractV1 = base.route({
|
|
1385
1593
|
path: "/v1/environments/{environmentId}",
|
|
1386
1594
|
method: "GET",
|
|
1387
1595
|
summary: "Get an environment",
|
|
@@ -1438,7 +1646,7 @@ const projectOutputSchema = z.object({
|
|
|
1438
1646
|
productionEnvironment: productionEnvironmentSchema.nullable(),
|
|
1439
1647
|
environments: z.array(environmentSchema)
|
|
1440
1648
|
});
|
|
1441
|
-
const getProjectContractV1 =
|
|
1649
|
+
const getProjectContractV1 = base.route({
|
|
1442
1650
|
path: "/v1/projects/{projectId}",
|
|
1443
1651
|
method: "GET",
|
|
1444
1652
|
summary: "Get a project",
|
|
@@ -1446,18 +1654,15 @@ const getProjectContractV1 = oc.route({
|
|
|
1446
1654
|
tags: ["projects"],
|
|
1447
1655
|
successDescription: "The project details"
|
|
1448
1656
|
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(projectOutputSchema);
|
|
1449
|
-
const listProjectsContractV1 =
|
|
1657
|
+
const listProjectsContractV1 = base.route({
|
|
1450
1658
|
path: "/v1/projects",
|
|
1451
1659
|
method: "GET",
|
|
1452
1660
|
summary: "List projects",
|
|
1453
1661
|
description: "List all projects for a team",
|
|
1454
1662
|
tags: ["projects"],
|
|
1455
1663
|
successDescription: "The list of projects"
|
|
1456
|
-
}).errors({
|
|
1457
|
-
|
|
1458
|
-
BAD_REQUEST: {}
|
|
1459
|
-
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
1460
|
-
const createProjectContractV1 = oc.route({
|
|
1664
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
1665
|
+
const createProjectContractV1 = base.route({
|
|
1461
1666
|
path: "/v1/projects",
|
|
1462
1667
|
method: "POST",
|
|
1463
1668
|
summary: "Create a project",
|
|
@@ -1466,7 +1671,6 @@ const createProjectContractV1 = oc.route({
|
|
|
1466
1671
|
successDescription: "The project has been created successfully"
|
|
1467
1672
|
}).errors({
|
|
1468
1673
|
NOT_FOUND: {},
|
|
1469
|
-
BAD_REQUEST: {},
|
|
1470
1674
|
FORBIDDEN: {}
|
|
1471
1675
|
}).input(z.object({
|
|
1472
1676
|
teamId: z.string().optional(),
|
|
@@ -1507,7 +1711,7 @@ const environmentVariableOutputSchema = z.object({
|
|
|
1507
1711
|
isSecret: z.boolean(),
|
|
1508
1712
|
createdAt: z.coerce.date()
|
|
1509
1713
|
});
|
|
1510
|
-
const listEnvironmentVariablesContractV1 =
|
|
1714
|
+
const listEnvironmentVariablesContractV1 = base.route({
|
|
1511
1715
|
path: "/v1/environments/{environmentId}/environment-variables",
|
|
1512
1716
|
method: "GET",
|
|
1513
1717
|
summary: "List environment variables",
|
|
@@ -1515,48 +1719,39 @@ const listEnvironmentVariablesContractV1 = oc.route({
|
|
|
1515
1719
|
tags: ["environments"],
|
|
1516
1720
|
successDescription: "The list of environment variables"
|
|
1517
1721
|
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
1518
|
-
const createEnvironmentVariablesContractV1 =
|
|
1722
|
+
const createEnvironmentVariablesContractV1 = base.route({
|
|
1519
1723
|
path: "/v1/environments/{environmentId}/environment-variables",
|
|
1520
1724
|
method: "POST",
|
|
1521
1725
|
summary: "Add environment variables",
|
|
1522
1726
|
description: "Add one or more environment variables to an environment",
|
|
1523
1727
|
tags: ["environments"],
|
|
1524
1728
|
successDescription: "The environment variables have been added successfully"
|
|
1525
|
-
}).errors({
|
|
1526
|
-
NOT_FOUND: {},
|
|
1527
|
-
BAD_REQUEST: {}
|
|
1528
|
-
}).input(z.object({
|
|
1729
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1529
1730
|
environmentId: z.string().describe("The ID of the environment"),
|
|
1530
1731
|
environmentVariables: environmentVariablesSchema
|
|
1531
1732
|
})).output(z.object({ success: z.literal(true) }));
|
|
1532
|
-
const updateEnvironmentVariableContractV1 =
|
|
1733
|
+
const updateEnvironmentVariableContractV1 = base.route({
|
|
1533
1734
|
path: "/v1/environment-variables/{environmentVariableId}",
|
|
1534
1735
|
method: "PATCH",
|
|
1535
1736
|
summary: "Update an environment variable",
|
|
1536
1737
|
description: "Update an environment variable by ID",
|
|
1537
1738
|
tags: ["environments"],
|
|
1538
1739
|
successDescription: "The environment variable has been updated successfully"
|
|
1539
|
-
}).errors({
|
|
1540
|
-
NOT_FOUND: {},
|
|
1541
|
-
BAD_REQUEST: {}
|
|
1542
|
-
}).input(z.object({
|
|
1740
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1543
1741
|
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
1544
1742
|
key: environmentVariableSchema.shape.key,
|
|
1545
1743
|
value: environmentVariableSchema.shape.value.optional(),
|
|
1546
1744
|
isSecret: environmentVariableSchema.shape.isSecret.optional()
|
|
1547
1745
|
})).output(z.object({ success: z.literal(true) }));
|
|
1548
|
-
const deleteEnvironmentVariableContractV1 =
|
|
1746
|
+
const deleteEnvironmentVariableContractV1 = base.route({
|
|
1549
1747
|
path: "/v1/environment-variables/{environmentVariableId}",
|
|
1550
1748
|
method: "DELETE",
|
|
1551
1749
|
summary: "Delete an environment variable",
|
|
1552
1750
|
description: "Delete an environment variable by ID",
|
|
1553
1751
|
tags: ["environments"],
|
|
1554
1752
|
successDescription: "The environment variable has been deleted successfully"
|
|
1555
|
-
}).errors({
|
|
1556
|
-
|
|
1557
|
-
BAD_REQUEST: {}
|
|
1558
|
-
}).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
1559
|
-
const deleteProjectContractV1 = oc.route({
|
|
1753
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
1754
|
+
const deleteProjectContractV1 = base.route({
|
|
1560
1755
|
path: "/v1/projects/{projectId}",
|
|
1561
1756
|
method: "DELETE",
|
|
1562
1757
|
summary: "Delete a project",
|
|
@@ -1564,7 +1759,7 @@ const deleteProjectContractV1 = oc.route({
|
|
|
1564
1759
|
tags: ["projects"],
|
|
1565
1760
|
successDescription: "The project has been deleted successfully"
|
|
1566
1761
|
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.object({ success: z.literal(true) }));
|
|
1567
|
-
const updateProjectContractV1 =
|
|
1762
|
+
const updateProjectContractV1 = base.route({
|
|
1568
1763
|
path: "/v1/projects/{projectId}",
|
|
1569
1764
|
method: "PATCH",
|
|
1570
1765
|
summary: "Update a project",
|
|
@@ -1573,14 +1768,13 @@ const updateProjectContractV1 = oc.route({
|
|
|
1573
1768
|
successDescription: "The project has been updated successfully"
|
|
1574
1769
|
}).errors({
|
|
1575
1770
|
NOT_FOUND: {},
|
|
1576
|
-
BAD_REQUEST: {},
|
|
1577
1771
|
FORBIDDEN: {}
|
|
1578
1772
|
}).input(z.object({
|
|
1579
1773
|
projectId: z.string().describe("The ID of the project"),
|
|
1580
1774
|
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
1581
1775
|
sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
|
|
1582
1776
|
})).output(projectOutputSchema);
|
|
1583
|
-
const deployEnvironmentContractV1 =
|
|
1777
|
+
const deployEnvironmentContractV1 = base.route({
|
|
1584
1778
|
path: "/v1/environments/{environmentId}/deploy",
|
|
1585
1779
|
method: "POST",
|
|
1586
1780
|
summary: "Deploy an environment",
|
|
@@ -1589,29 +1783,25 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
1589
1783
|
successDescription: "The environment has been deployed successfully"
|
|
1590
1784
|
}).errors({
|
|
1591
1785
|
NOT_FOUND: {},
|
|
1592
|
-
BAD_REQUEST: {},
|
|
1593
1786
|
CONFLICT: {}
|
|
1594
1787
|
}).input(z.object({
|
|
1595
1788
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
1596
1789
|
token: z.string().describe("The token to identify the source archive").optional(),
|
|
1597
1790
|
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.")
|
|
1598
1791
|
})).output(deploymentSchema);
|
|
1599
|
-
const uploadDeploymentArtifactContractV1 =
|
|
1792
|
+
const uploadDeploymentArtifactContractV1 = base.route({
|
|
1600
1793
|
path: "/v1/deployments/upload",
|
|
1601
1794
|
method: "POST",
|
|
1602
1795
|
summary: "Upload deployment artifacts",
|
|
1603
1796
|
description: "Return a presigned S3 URL to upload a deployment artifact",
|
|
1604
1797
|
tags: ["deployments"],
|
|
1605
1798
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
1606
|
-
}).errors({
|
|
1607
|
-
NOT_FOUND: {},
|
|
1608
|
-
BAD_REQUEST: {}
|
|
1609
|
-
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
1799
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
1610
1800
|
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
1611
1801
|
token: z.string().describe("Token to identify the source archive"),
|
|
1612
1802
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
1613
1803
|
}));
|
|
1614
|
-
const listDeploymentsContractV1 =
|
|
1804
|
+
const listDeploymentsContractV1 = base.route({
|
|
1615
1805
|
path: "/v1/projects/{projectId}/deployments",
|
|
1616
1806
|
method: "GET",
|
|
1617
1807
|
summary: "List project deployments",
|
|
@@ -1623,7 +1813,7 @@ const listDeploymentsContractV1 = oc.route({
|
|
|
1623
1813
|
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
1624
1814
|
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
1625
1815
|
})).output(z.array(deploymentSchema));
|
|
1626
|
-
const getDeploymentContractV1 =
|
|
1816
|
+
const getDeploymentContractV1 = base.route({
|
|
1627
1817
|
path: "/v1/deployments/{deploymentId}",
|
|
1628
1818
|
method: "GET",
|
|
1629
1819
|
summary: "Get a deployment",
|
|
@@ -1646,20 +1836,17 @@ const logEntrySchema = z.object({
|
|
|
1646
1836
|
method: z.string().optional(),
|
|
1647
1837
|
durationInMs: z.number().optional()
|
|
1648
1838
|
});
|
|
1649
|
-
const getLogsContractV1 =
|
|
1839
|
+
const getLogsContractV1 = base.route({
|
|
1650
1840
|
path: "/v1/environments/{environmentId}/logs",
|
|
1651
1841
|
method: "GET",
|
|
1652
1842
|
summary: "Get logs",
|
|
1653
1843
|
description: "Get logs for an environment",
|
|
1654
1844
|
tags: ["environments"],
|
|
1655
1845
|
successDescription: "The logs"
|
|
1656
|
-
}).errors({
|
|
1657
|
-
NOT_FOUND: {},
|
|
1658
|
-
BAD_REQUEST: {}
|
|
1659
|
-
}).input(z.object({
|
|
1846
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1660
1847
|
environmentId: z.string().describe("The ID of the environment"),
|
|
1661
|
-
since:
|
|
1662
|
-
until:
|
|
1848
|
+
since: timeInputSchema.optional().describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
1849
|
+
until: timeInputSchema.optional().describe("End time — ISO 8601 or relative"),
|
|
1663
1850
|
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
1664
1851
|
level: z.array(z.enum([
|
|
1665
1852
|
"INFO",
|
|
@@ -1673,17 +1860,14 @@ const getLogsContractV1 = oc.route({
|
|
|
1673
1860
|
logs: z.array(logEntrySchema),
|
|
1674
1861
|
nextToken: z.string().nullable()
|
|
1675
1862
|
}));
|
|
1676
|
-
const getLatestLogsContractV1 =
|
|
1863
|
+
const getLatestLogsContractV1 = base.route({
|
|
1677
1864
|
path: "/v1/environments/{environmentId}/latest-logs",
|
|
1678
1865
|
method: "GET",
|
|
1679
1866
|
summary: "Get latest logs",
|
|
1680
1867
|
description: "Get the N most recent logs for an environment",
|
|
1681
1868
|
tags: ["environments"],
|
|
1682
1869
|
successDescription: "The latest logs"
|
|
1683
|
-
}).errors({
|
|
1684
|
-
NOT_FOUND: {},
|
|
1685
|
-
BAD_REQUEST: {}
|
|
1686
|
-
}).input(z.object({
|
|
1870
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1687
1871
|
environmentId: z.string().describe("The ID of the environment"),
|
|
1688
1872
|
limit: z.coerce.number().int().min(1).max(1e3).default(100).describe("Number of most recent log entries to return"),
|
|
1689
1873
|
level: z.array(z.enum([
|
|
@@ -1694,7 +1878,7 @@ const getLatestLogsContractV1 = oc.route({
|
|
|
1694
1878
|
])).optional().describe("Filter by log level"),
|
|
1695
1879
|
search: z.string().optional().describe("Filter pattern to search for in log content")
|
|
1696
1880
|
})).output(z.object({ logs: z.array(logEntrySchema) }));
|
|
1697
|
-
const getDeploymentLogsContractV1 =
|
|
1881
|
+
const getDeploymentLogsContractV1 = base.route({
|
|
1698
1882
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
1699
1883
|
method: "GET",
|
|
1700
1884
|
summary: "Get deployment logs",
|
|
@@ -1721,17 +1905,14 @@ const analyticsTimeSeriesSchema = z.object({
|
|
|
1721
1905
|
output_token_mean: z.array(analyticsDataPointSchema),
|
|
1722
1906
|
task_count: z.array(analyticsDataPointSchema)
|
|
1723
1907
|
});
|
|
1724
|
-
const getProjectAnalyticsContractV1 =
|
|
1908
|
+
const getProjectAnalyticsContractV1 = base.route({
|
|
1725
1909
|
path: "/v1/analytics/{projectId}",
|
|
1726
1910
|
method: "GET",
|
|
1727
1911
|
summary: "Get project analytics",
|
|
1728
1912
|
description: "Get analytics data for a project over a time range",
|
|
1729
1913
|
tags: ["analytics"],
|
|
1730
1914
|
successDescription: "The project analytics data"
|
|
1731
|
-
}).errors({
|
|
1732
|
-
NOT_FOUND: {},
|
|
1733
|
-
BAD_REQUEST: {}
|
|
1734
|
-
}).input(z.object({
|
|
1915
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1735
1916
|
projectId: z.string().describe("The ID of the project"),
|
|
1736
1917
|
startTimestamp: z.coerce.number().describe("Start timestamp in milliseconds"),
|
|
1737
1918
|
endTimestamp: z.coerce.number().describe("End timestamp in milliseconds"),
|
|
@@ -1746,7 +1927,132 @@ const getProjectAnalyticsContractV1 = oc.route({
|
|
|
1746
1927
|
}),
|
|
1747
1928
|
timeSeries: analyticsTimeSeriesSchema
|
|
1748
1929
|
}));
|
|
1749
|
-
const
|
|
1930
|
+
const paginatedInsightsInputShape = {
|
|
1931
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
1932
|
+
since: timeInputSchema.default("7d").describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
1933
|
+
until: timeInputSchema.optional().describe("End time — ISO 8601 or relative"),
|
|
1934
|
+
limit: z.coerce.number().int().min(1).max(200).default(50),
|
|
1935
|
+
offset: z.coerce.number().int().min(0).default(0),
|
|
1936
|
+
search: z.string().trim().min(1).max(200).optional()
|
|
1937
|
+
};
|
|
1938
|
+
const listIntentsContractV1 = base.route({
|
|
1939
|
+
path: "/v1/environments/{environmentId}/intents",
|
|
1940
|
+
method: "GET",
|
|
1941
|
+
summary: "List intents",
|
|
1942
|
+
description: "List grouped user intents for an environment over a time range",
|
|
1943
|
+
tags: ["insights"],
|
|
1944
|
+
successDescription: "The grouped user intents"
|
|
1945
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1946
|
+
...paginatedInsightsInputShape,
|
|
1947
|
+
tools: z.array(z.string().trim().min(1)).min(1).max(100).optional(),
|
|
1948
|
+
clientIds: z.array(z.string().min(1)).min(1).max(100).optional(),
|
|
1949
|
+
categoryIds: z.array(z.string().trim().min(1)).min(1).max(100).optional(),
|
|
1950
|
+
sortDir: z.enum(["asc", "desc"]).default("desc")
|
|
1951
|
+
})).output(z.object({
|
|
1952
|
+
intents: z.array(z.object({
|
|
1953
|
+
id: z.string(),
|
|
1954
|
+
intentIds: z.array(z.string()).min(1),
|
|
1955
|
+
environmentId: z.string(),
|
|
1956
|
+
message: z.string(),
|
|
1957
|
+
toolName: z.string(),
|
|
1958
|
+
createdAt: z.coerce.date(),
|
|
1959
|
+
occurrenceCount: z.number().int().positive(),
|
|
1960
|
+
clientName: z.string().nullable(),
|
|
1961
|
+
clientId: z.string().nullable(),
|
|
1962
|
+
categories: z.array(z.object({
|
|
1963
|
+
id: z.string(),
|
|
1964
|
+
name: z.string(),
|
|
1965
|
+
color: intentCategoryColorSchema
|
|
1966
|
+
}))
|
|
1967
|
+
})),
|
|
1968
|
+
totalCount: z.number().int().nonnegative()
|
|
1969
|
+
}));
|
|
1970
|
+
const listFeedbacksContractV1 = base.route({
|
|
1971
|
+
path: "/v1/environments/{environmentId}/feedbacks",
|
|
1972
|
+
method: "GET",
|
|
1973
|
+
summary: "List feedbacks",
|
|
1974
|
+
description: "List user feedback for an environment over a time range",
|
|
1975
|
+
tags: ["insights"],
|
|
1976
|
+
successDescription: "The user feedback"
|
|
1977
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1978
|
+
...paginatedInsightsInputShape,
|
|
1979
|
+
clientIds: z.array(z.string().min(1)).min(1).max(100).optional()
|
|
1980
|
+
})).output(z.object({
|
|
1981
|
+
feedbacks: z.array(feedbackSchema.extend({ clientId: z.string().nullable() })),
|
|
1982
|
+
totalCount: z.number().int().nonnegative()
|
|
1983
|
+
}));
|
|
1984
|
+
const intentCategoryNameSchema = z.string().trim().min(1).max(100).describe("The category name");
|
|
1985
|
+
const categorizableIntentIdsSchema = z.array(z.string().trim().min(1)).min(1).max(100).describe("IDs of the intents to categorize");
|
|
1986
|
+
const listIntentCategoriesContractV1 = base.route({
|
|
1987
|
+
path: "/v1/environments/{environmentId}/intent-categories",
|
|
1988
|
+
method: "GET",
|
|
1989
|
+
summary: "List intent categories",
|
|
1990
|
+
description: "List intent categories for an environment, including how many intents each category is linked to",
|
|
1991
|
+
tags: ["insights"],
|
|
1992
|
+
successDescription: "The intent categories"
|
|
1993
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(intentCategorySummarySchema));
|
|
1994
|
+
const createIntentCategoryContractV1 = base.route({
|
|
1995
|
+
path: "/v1/environments/{environmentId}/intent-categories",
|
|
1996
|
+
method: "POST",
|
|
1997
|
+
summary: "Create an intent category",
|
|
1998
|
+
description: "Create an intent category, optionally linking it to existing intents",
|
|
1999
|
+
tags: ["insights"],
|
|
2000
|
+
successDescription: "The created intent category"
|
|
2001
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2002
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2003
|
+
name: intentCategoryNameSchema,
|
|
2004
|
+
color: intentCategoryColorSchema.optional().describe("The category color; derived from the name when omitted"),
|
|
2005
|
+
intentIds: categorizableIntentIdsSchema.optional().describe("IDs of intents to link to the new category")
|
|
2006
|
+
})).output(intentCategorySchema);
|
|
2007
|
+
const updateIntentCategoryContractV1 = base.route({
|
|
2008
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}",
|
|
2009
|
+
method: "PATCH",
|
|
2010
|
+
summary: "Update an intent category",
|
|
2011
|
+
description: "Rename or recolor an intent category",
|
|
2012
|
+
tags: ["insights"],
|
|
2013
|
+
successDescription: "The updated intent category"
|
|
2014
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2015
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2016
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
2017
|
+
name: intentCategoryNameSchema.optional(),
|
|
2018
|
+
color: intentCategoryColorSchema.optional().describe("The category color")
|
|
2019
|
+
}).refine(({ name, color }) => name !== void 0 || color !== void 0, { message: "At least one of name or color must be provided" })).output(intentCategorySchema);
|
|
2020
|
+
const deleteIntentCategoryContractV1 = base.route({
|
|
2021
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}",
|
|
2022
|
+
method: "DELETE",
|
|
2023
|
+
summary: "Delete an intent category",
|
|
2024
|
+
description: "Delete an intent category; its intents are unlinked but not deleted",
|
|
2025
|
+
tags: ["insights"],
|
|
2026
|
+
successDescription: "The intent category has been deleted successfully"
|
|
2027
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2028
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2029
|
+
categoryId: z.string().describe("The ID of the category")
|
|
2030
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
2031
|
+
const linkIntentCategoryContractV1 = base.route({
|
|
2032
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}/link",
|
|
2033
|
+
method: "POST",
|
|
2034
|
+
summary: "Link an intent category",
|
|
2035
|
+
description: "Link an intent category to intents; already linked intents are ignored",
|
|
2036
|
+
tags: ["insights"],
|
|
2037
|
+
successDescription: "The intents have been linked successfully"
|
|
2038
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2039
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2040
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
2041
|
+
intentIds: categorizableIntentIdsSchema
|
|
2042
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
2043
|
+
const unlinkIntentCategoryContractV1 = base.route({
|
|
2044
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}/unlink",
|
|
2045
|
+
method: "POST",
|
|
2046
|
+
summary: "Unlink an intent category",
|
|
2047
|
+
description: "Unlink an intent category from intents; intents without the category are ignored",
|
|
2048
|
+
tags: ["insights"],
|
|
2049
|
+
successDescription: "The intents have been unlinked successfully"
|
|
2050
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2051
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2052
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
2053
|
+
intentIds: categorizableIntentIdsSchema
|
|
2054
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
2055
|
+
const listTeamsContractV1 = base.route({
|
|
1750
2056
|
path: "/v1/teams",
|
|
1751
2057
|
method: "GET",
|
|
1752
2058
|
summary: "List teams",
|
|
@@ -1759,7 +2065,22 @@ const listTeamsContractV1 = oc.route({
|
|
|
1759
2065
|
createdAt: z.coerce.date(),
|
|
1760
2066
|
hasStripeAccount: z.boolean()
|
|
1761
2067
|
})));
|
|
1762
|
-
const
|
|
2068
|
+
const getTeamUsageContractV1 = base.route({
|
|
2069
|
+
path: "/v1/teams/{teamId}/usage",
|
|
2070
|
+
method: "GET",
|
|
2071
|
+
summary: "Get team usage",
|
|
2072
|
+
description: "Get the MCP request usage of a team for its current billing window. A team that has made no request in the window reports zero.",
|
|
2073
|
+
tags: ["teams"],
|
|
2074
|
+
successDescription: "The current billing window usage"
|
|
2075
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().describe("The ID of the team") })).output(z.object({
|
|
2076
|
+
teamId: z.string(),
|
|
2077
|
+
plan: subscriptionPlanSchema.nullable().describe("The plan in force for the window, null on the Free plan"),
|
|
2078
|
+
periodStart: z.coerce.date().describe("Start of the current billing window"),
|
|
2079
|
+
periodEnd: z.coerce.date().describe("End of the current billing window"),
|
|
2080
|
+
requestCount: z.number().int().describe("MCP requests settled during the current billing window"),
|
|
2081
|
+
includedRequests: z.number().int().nullable().describe("Requests included in the plan for one window, null when the allowance is contract-specific")
|
|
2082
|
+
}));
|
|
2083
|
+
const getTunnelTicketContractV1 = base.route({
|
|
1763
2084
|
path: "/v1/tunnels/ticket",
|
|
1764
2085
|
method: "GET",
|
|
1765
2086
|
summary: "Get a tunnel ticket",
|
|
@@ -1771,16 +2092,13 @@ const getTunnelTicketContractV1 = oc.route({
|
|
|
1771
2092
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
1772
2093
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
1773
2094
|
}));
|
|
1774
|
-
const publishServerContractV1 =
|
|
2095
|
+
const publishServerContractV1 = base.route({
|
|
1775
2096
|
path: "/v1/distribution/publish",
|
|
1776
2097
|
method: "POST",
|
|
1777
2098
|
summary: "Publish a server to the MCP registry",
|
|
1778
2099
|
tags: ["distribution"],
|
|
1779
2100
|
successDescription: "The server has been published successfully"
|
|
1780
|
-
}).errors({
|
|
1781
|
-
NOT_FOUND: {},
|
|
1782
|
-
BAD_REQUEST: {}
|
|
1783
|
-
}).input(z.object({
|
|
2101
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1784
2102
|
projectId: z.string(),
|
|
1785
2103
|
domain: z.string(),
|
|
1786
2104
|
title: z.string().min(1).max(100),
|
|
@@ -1789,17 +2107,14 @@ const publishServerContractV1 = oc.route({
|
|
|
1789
2107
|
iconSrc: z.url().max(255).optional(),
|
|
1790
2108
|
dryRun: z.boolean().optional()
|
|
1791
2109
|
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
1792
|
-
const getServerInfoContractV1 =
|
|
2110
|
+
const getServerInfoContractV1 = base.route({
|
|
1793
2111
|
path: "/v1/distribution/get",
|
|
1794
2112
|
method: "GET",
|
|
1795
2113
|
summary: "Get server info",
|
|
1796
2114
|
description: "Get info about a server",
|
|
1797
2115
|
tags: ["distribution"],
|
|
1798
2116
|
successDescription: "The server info"
|
|
1799
|
-
}).errors({
|
|
1800
|
-
NOT_FOUND: {},
|
|
1801
|
-
BAD_REQUEST: {}
|
|
1802
|
-
}).input(z.object({
|
|
2117
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1803
2118
|
projectId: z.string(),
|
|
1804
2119
|
domain: z.string()
|
|
1805
2120
|
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
@@ -1818,7 +2133,7 @@ const playgroundOutputSchema = z.object({
|
|
|
1818
2133
|
isPlaygroundEnabled: z.boolean(),
|
|
1819
2134
|
serverMetadata: playgroundServerMetadataOutputSchema.nullable()
|
|
1820
2135
|
});
|
|
1821
|
-
const getPlaygroundContractV1 =
|
|
2136
|
+
const getPlaygroundContractV1 = base.route({
|
|
1822
2137
|
path: "/v1/environments/{environmentId}/playground",
|
|
1823
2138
|
method: "GET",
|
|
1824
2139
|
summary: "Get playground configuration",
|
|
@@ -1826,17 +2141,14 @@ const getPlaygroundContractV1 = oc.route({
|
|
|
1826
2141
|
tags: ["environments"],
|
|
1827
2142
|
successDescription: "The playground configuration"
|
|
1828
2143
|
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
|
|
1829
|
-
const upsertPlaygroundContractV1 =
|
|
2144
|
+
const upsertPlaygroundContractV1 = base.route({
|
|
1830
2145
|
path: "/v1/environments/{environmentId}/playground",
|
|
1831
2146
|
method: "PUT",
|
|
1832
2147
|
summary: "Update playground configuration",
|
|
1833
2148
|
description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
|
|
1834
2149
|
tags: ["environments"],
|
|
1835
2150
|
successDescription: "The updated playground configuration"
|
|
1836
|
-
}).errors({
|
|
1837
|
-
NOT_FOUND: {},
|
|
1838
|
-
BAD_REQUEST: {}
|
|
1839
|
-
}).input(z.object({
|
|
2151
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1840
2152
|
environmentId: z.string().describe("The ID of the environment"),
|
|
1841
2153
|
isPlaygroundEnabled: z.boolean().optional(),
|
|
1842
2154
|
name: z.string().min(1).max(100).optional(),
|
|
@@ -1844,7 +2156,7 @@ const upsertPlaygroundContractV1 = oc.route({
|
|
|
1844
2156
|
headers: z.array(playgroundHeaderSchema).optional(),
|
|
1845
2157
|
examplePrompts: z.array(playgroundExamplePromptSchema).max(5).optional()
|
|
1846
2158
|
})).output(playgroundOutputSchema);
|
|
1847
|
-
const createBeaconContractV1 =
|
|
2159
|
+
const createBeaconContractV1 = base.route({
|
|
1848
2160
|
path: "/v1/beacon/audits",
|
|
1849
2161
|
method: "POST",
|
|
1850
2162
|
summary: "Create a beacon audit",
|
|
@@ -1853,7 +2165,6 @@ const createBeaconContractV1 = oc.route({
|
|
|
1853
2165
|
successDescription: "The audit has been created"
|
|
1854
2166
|
}).errors({
|
|
1855
2167
|
NOT_FOUND: {},
|
|
1856
|
-
BAD_REQUEST: {},
|
|
1857
2168
|
DNS_RESOLUTION_FAILED: { status: 400 }
|
|
1858
2169
|
}).input(z.object({
|
|
1859
2170
|
targetUrl: z.url().describe("The HTTPS URL of the MCP server to audit"),
|
|
@@ -1861,7 +2172,7 @@ const createBeaconContractV1 = oc.route({
|
|
|
1861
2172
|
projectId: z.string().optional().describe("The project ID to associate the audit with"),
|
|
1862
2173
|
excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
|
|
1863
2174
|
})).output(z.object({ id: z.string() }));
|
|
1864
|
-
const getBeaconContractV1 =
|
|
2175
|
+
const getBeaconContractV1 = base.route({
|
|
1865
2176
|
path: "/v1/beacon/audits/{auditId}",
|
|
1866
2177
|
method: "GET",
|
|
1867
2178
|
summary: "Get a beacon audit",
|
|
@@ -1877,8 +2188,21 @@ const getBeaconContractV1 = oc.route({
|
|
|
1877
2188
|
report: auditReportWithScreenshotsSchema.nullable()
|
|
1878
2189
|
}));
|
|
1879
2190
|
const contract = {
|
|
1880
|
-
teams: {
|
|
2191
|
+
teams: {
|
|
2192
|
+
list: { v1: listTeamsContractV1 },
|
|
2193
|
+
getUsage: { v1: getTeamUsageContractV1 }
|
|
2194
|
+
},
|
|
1881
2195
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
2196
|
+
intents: { list: { v1: listIntentsContractV1 } },
|
|
2197
|
+
intentCategories: {
|
|
2198
|
+
list: { v1: listIntentCategoriesContractV1 },
|
|
2199
|
+
create: { v1: createIntentCategoryContractV1 },
|
|
2200
|
+
update: { v1: updateIntentCategoryContractV1 },
|
|
2201
|
+
delete: { v1: deleteIntentCategoryContractV1 },
|
|
2202
|
+
link: { v1: linkIntentCategoryContractV1 },
|
|
2203
|
+
unlink: { v1: unlinkIntentCategoryContractV1 }
|
|
2204
|
+
},
|
|
2205
|
+
feedbacks: { list: { v1: listFeedbacksContractV1 } },
|
|
1882
2206
|
deployments: {
|
|
1883
2207
|
list: { v1: listDeploymentsContractV1 },
|
|
1884
2208
|
get: { v1: getDeploymentContractV1 },
|
|
@@ -1919,5 +2243,10 @@ const contract = {
|
|
|
1919
2243
|
get: { v1: getBeaconContractV1 }
|
|
1920
2244
|
}
|
|
1921
2245
|
};
|
|
2246
|
+
const { uploadArtifact: _discard, ...deploymentsForDocs } = contract.deployments;
|
|
2247
|
+
const contractForDocs = {
|
|
2248
|
+
...contract,
|
|
2249
|
+
deployments: deploymentsForDocs
|
|
2250
|
+
};
|
|
1922
2251
|
//#endregion
|
|
1923
|
-
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
2252
|
+
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, INTENT_CATEGORY_COLORS, PLATFORM_LABELS, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, intentCategoryColorSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|