@alpic-ai/api 0.0.0-dev.geca1d94 → 0.0.0-dev.ged18600
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 +904 -1
- package/dist/index.mjs +336 -103
- package/package.json +5 -5
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
|
*/
|
|
@@ -169,11 +169,21 @@ z$1.object({
|
|
|
169
169
|
token: z$1.string(),
|
|
170
170
|
token_type_hint: z$1.string().optional()
|
|
171
171
|
}).strip();
|
|
172
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region ../domains/dist/index.mjs
|
|
174
|
+
const AI_PLATFORMS = ["chatgpt", "claudeai"];
|
|
175
|
+
const platformSchema = z.enum(AI_PLATFORMS);
|
|
173
176
|
const PLATFORM_LABELS = {
|
|
174
177
|
chatgpt: "ChatGPT",
|
|
175
178
|
claudeai: "Claude.ai"
|
|
176
179
|
};
|
|
180
|
+
const WAF_PLATFORMS = [
|
|
181
|
+
"akamai",
|
|
182
|
+
"cloudflare",
|
|
183
|
+
"fastly"
|
|
184
|
+
];
|
|
185
|
+
const ALLOWED_PLATFORMS = [...AI_PLATFORMS, ...WAF_PLATFORMS];
|
|
186
|
+
const allowedPlatformSchema = z.enum(ALLOWED_PLATFORMS);
|
|
177
187
|
const auditStatusSchema = z.enum([
|
|
178
188
|
"pending",
|
|
179
189
|
"partial",
|
|
@@ -273,34 +283,51 @@ const deploymentSummarySchema = z.object({
|
|
|
273
283
|
createdAt: z.coerce.date(),
|
|
274
284
|
updatedAt: z.coerce.date()
|
|
275
285
|
});
|
|
276
|
-
/**
|
|
277
|
-
* Public environment
|
|
278
|
-
*
|
|
279
|
-
* No OAuth metadata exposed.
|
|
280
|
-
*/
|
|
286
|
+
/** Public environment: answers anonymously and exposes no OAuth metadata. */
|
|
281
287
|
const publicEnvironmentSchema = z.object({
|
|
288
|
+
allowsAnonymous: z.literal(true),
|
|
289
|
+
oAuthMetadata: z.strictObject({})
|
|
290
|
+
});
|
|
291
|
+
/** 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. */
|
|
292
|
+
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
293
|
+
allowsAnonymous: z.boolean(),
|
|
294
|
+
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
295
|
+
scope: z.string().optional()
|
|
296
|
+
});
|
|
297
|
+
/** 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. */
|
|
298
|
+
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
299
|
+
allowsAnonymous: z.boolean(),
|
|
300
|
+
oAuthMetadata: z.object({
|
|
301
|
+
externalAuthorizationServerUrl: z.url(),
|
|
302
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
303
|
+
}),
|
|
304
|
+
scope: z.string().optional()
|
|
305
|
+
});
|
|
306
|
+
/** Standalone protected environment: the server itself exposes both the /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server endpoints. */
|
|
307
|
+
const standaloneEnvironmentSchema = z.object({
|
|
308
|
+
allowsAnonymous: z.boolean(),
|
|
309
|
+
oAuthMetadata: z.object({
|
|
310
|
+
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
311
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
312
|
+
}),
|
|
313
|
+
scope: z.string().optional()
|
|
314
|
+
});
|
|
315
|
+
/** Protected environment that enforces authentication but advertises no OAuth discovery metadata; clients must obtain credentials out-of-band. */
|
|
316
|
+
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
317
|
+
allowsAnonymous: z.literal(false),
|
|
318
|
+
oAuthMetadata: z.strictObject({}),
|
|
319
|
+
scope: z.string().optional()
|
|
320
|
+
});
|
|
321
|
+
const legacyPublicEnvironmentSchema = z.object({
|
|
282
322
|
isPublic: z.literal(true),
|
|
283
323
|
oAuthMetadata: z.undefined().optional()
|
|
284
324
|
});
|
|
285
|
-
|
|
286
|
-
* Protected environment with an external resource metadata URL
|
|
287
|
-
*
|
|
288
|
-
* An external resource metadata URL is returned in the WWW-Authenticate header during the first 401 response.
|
|
289
|
-
* Everything that follows is handled outside of the MCP server scope.
|
|
290
|
-
*/
|
|
291
|
-
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
325
|
+
const legacyExternalResourceMetadataEnvironmentSchema = z.object({
|
|
292
326
|
isPublic: z.literal(false),
|
|
293
327
|
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
294
328
|
scope: z.string().optional()
|
|
295
329
|
});
|
|
296
|
-
|
|
297
|
-
* Protected environment with an external authorization server URL
|
|
298
|
-
*
|
|
299
|
-
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
300
|
-
* An external authorization server URL is returned when requesting the endpoint.
|
|
301
|
-
* Everything that follows is handled outside of the MCP server scope.
|
|
302
|
-
*/
|
|
303
|
-
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
330
|
+
const legacyExternalAuthorizationServerEnvironmentSchema = z.object({
|
|
304
331
|
isPublic: z.literal(false),
|
|
305
332
|
oAuthMetadata: z.object({
|
|
306
333
|
externalAuthorizationServerUrl: z.url(),
|
|
@@ -308,13 +335,7 @@ const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
|
308
335
|
}),
|
|
309
336
|
scope: z.string().optional()
|
|
310
337
|
});
|
|
311
|
-
|
|
312
|
-
* Standalone protected environment
|
|
313
|
-
*
|
|
314
|
-
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
315
|
-
* The server itself exposes the /.well-known/oauth-authorization-server endpoint.
|
|
316
|
-
*/
|
|
317
|
-
const standaloneEnvironmentSchema = z.object({
|
|
338
|
+
const legacyStandaloneEnvironmentSchema = z.object({
|
|
318
339
|
isPublic: z.literal(false),
|
|
319
340
|
oAuthMetadata: z.object({
|
|
320
341
|
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
@@ -322,14 +343,7 @@ const standaloneEnvironmentSchema = z.object({
|
|
|
322
343
|
}),
|
|
323
344
|
scope: z.string().optional()
|
|
324
345
|
});
|
|
325
|
-
|
|
326
|
-
* Protected environment without OAuth discovery
|
|
327
|
-
*
|
|
328
|
-
* The server enforces authentication but exposes no OAuth discovery metadata.
|
|
329
|
-
* Neither /.well-known/oauth-protected-resource nor /.well-known/oauth-authorization-server
|
|
330
|
-
* are advertised. Clients must obtain credentials out-of-band.
|
|
331
|
-
*/
|
|
332
|
-
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
346
|
+
const legacyProtectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
333
347
|
isPublic: z.literal(false),
|
|
334
348
|
oAuthMetadata: z.strictObject({}),
|
|
335
349
|
scope: z.string().optional()
|
|
@@ -339,9 +353,13 @@ z.union([
|
|
|
339
353
|
externalResourceMetadataEnvironmentSchema,
|
|
340
354
|
externalAuthorizationServerEnvironmentSchema,
|
|
341
355
|
standaloneEnvironmentSchema,
|
|
342
|
-
protectedWithoutDiscoveryEnvironmentSchema
|
|
356
|
+
protectedWithoutDiscoveryEnvironmentSchema,
|
|
357
|
+
legacyPublicEnvironmentSchema,
|
|
358
|
+
legacyExternalResourceMetadataEnvironmentSchema,
|
|
359
|
+
legacyExternalAuthorizationServerEnvironmentSchema,
|
|
360
|
+
legacyStandaloneEnvironmentSchema,
|
|
361
|
+
legacyProtectedWithoutDiscoveryEnvironmentSchema
|
|
343
362
|
]);
|
|
344
|
-
const allowedPlatformSchema = platformSchema;
|
|
345
363
|
const playgroundModelSchema = z.enum([
|
|
346
364
|
"global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
347
365
|
"global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
@@ -381,14 +399,16 @@ z.object({
|
|
|
381
399
|
collectRequestPayload: z.boolean(),
|
|
382
400
|
collectResponsePayload: z.boolean(),
|
|
383
401
|
collectErrorMessage: z.boolean(),
|
|
384
|
-
collectUserData: z.boolean()
|
|
402
|
+
collectUserData: z.boolean(),
|
|
403
|
+
identityTraitKey: z.string().min(1).max(200).nullable()
|
|
385
404
|
});
|
|
386
405
|
z.object({
|
|
387
406
|
id: z.string(),
|
|
388
407
|
createdAt: z.coerce.date(),
|
|
389
408
|
environmentId: z.string(),
|
|
390
409
|
content: z.string(),
|
|
391
|
-
source: z.enum(["model", "user"])
|
|
410
|
+
source: z.enum(["model", "user"]),
|
|
411
|
+
clientName: z.string().nullable()
|
|
392
412
|
});
|
|
393
413
|
z.object({
|
|
394
414
|
content: z.string(),
|
|
@@ -424,6 +444,7 @@ z.object({
|
|
|
424
444
|
environmentId: z.string(),
|
|
425
445
|
toolName: z.string(),
|
|
426
446
|
message: z.string(),
|
|
447
|
+
clientName: z.string().nullable(),
|
|
427
448
|
categories: z.array(intentCategorySchema)
|
|
428
449
|
});
|
|
429
450
|
const signalCategorySchema = z.object({
|
|
@@ -488,6 +509,246 @@ z.enum([
|
|
|
488
509
|
"DEBUG",
|
|
489
510
|
"ERROR"
|
|
490
511
|
]);
|
|
512
|
+
/** Only names a vendor actually ships belong here: lookalikes like `claude-code-test` are customers' own scripts. */
|
|
513
|
+
const MCP_CLIENT_GROUPS = [
|
|
514
|
+
{
|
|
515
|
+
id: "claude_code",
|
|
516
|
+
label: "Claude Code",
|
|
517
|
+
vendor: "anthropic",
|
|
518
|
+
rawNames: ["claude-code", "Anthropic/ClaudeCodeDesktop"]
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
id: "claude",
|
|
522
|
+
label: "Claude",
|
|
523
|
+
vendor: "anthropic",
|
|
524
|
+
rawNames: [
|
|
525
|
+
"Anthropic/ClaudeAI",
|
|
526
|
+
"claude-ai",
|
|
527
|
+
"claude",
|
|
528
|
+
"Claude",
|
|
529
|
+
"claude-desktop",
|
|
530
|
+
"claude-desktop-3p"
|
|
531
|
+
]
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
id: "claude_mobile",
|
|
535
|
+
label: "Claude mobile",
|
|
536
|
+
vendor: "anthropic",
|
|
537
|
+
rawNames: ["claude-ios", "ClaudeAndroid"]
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
id: "claude_cowork",
|
|
541
|
+
label: "Claude Cowork",
|
|
542
|
+
vendor: "anthropic",
|
|
543
|
+
rawNames: ["Anthropic/Cowork"]
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
id: "claude_toolbox",
|
|
547
|
+
label: "Claude Toolbox",
|
|
548
|
+
vendor: "anthropic",
|
|
549
|
+
rawNames: ["Anthropic/Toolbox", "Anthropic/toolbox-bootstrap"]
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
id: "anthropic_api",
|
|
553
|
+
label: "Anthropic API",
|
|
554
|
+
vendor: "anthropic",
|
|
555
|
+
rawNames: ["Anthropic/API"]
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
id: "anthropic_connector_refresh",
|
|
559
|
+
label: "Anthropic (connector refresh)",
|
|
560
|
+
vendor: "anthropic",
|
|
561
|
+
rawNames: ["Anthropic"]
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: "codex",
|
|
565
|
+
label: "Codex",
|
|
566
|
+
vendor: "openai",
|
|
567
|
+
rawNames: [
|
|
568
|
+
"codex-mcp-client",
|
|
569
|
+
"codex",
|
|
570
|
+
"Codex",
|
|
571
|
+
"codex-cli",
|
|
572
|
+
"openai-mcp (Codex)"
|
|
573
|
+
]
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
id: "chatgpt",
|
|
577
|
+
label: "ChatGPT",
|
|
578
|
+
vendor: "openai",
|
|
579
|
+
rawNames: ["openai-mcp (ChatGPT)"]
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
id: "openai_responses_api",
|
|
583
|
+
label: "OpenAI Responses API",
|
|
584
|
+
vendor: "openai",
|
|
585
|
+
rawNames: ["openai-mcp (Responses API)"]
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
id: "openai_agent_builder",
|
|
589
|
+
label: "OpenAI Agent Builder",
|
|
590
|
+
vendor: "openai",
|
|
591
|
+
rawNames: ["openai-mcp (Agent Builder)"]
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
id: "openai_other",
|
|
595
|
+
label: "OpenAI Other",
|
|
596
|
+
vendor: "openai",
|
|
597
|
+
rawNames: ["openai-mcp"]
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
id: "cursor",
|
|
601
|
+
label: "Cursor",
|
|
602
|
+
vendor: "cursor",
|
|
603
|
+
rawNames: [
|
|
604
|
+
"cursor-vscode",
|
|
605
|
+
"Cursor",
|
|
606
|
+
"cursor"
|
|
607
|
+
]
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
id: "cline",
|
|
611
|
+
label: "Cline",
|
|
612
|
+
vendor: "cline",
|
|
613
|
+
rawNames: [
|
|
614
|
+
"Cline",
|
|
615
|
+
"cline",
|
|
616
|
+
"@cline/core"
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
id: "github_copilot",
|
|
621
|
+
label: "GitHub Copilot",
|
|
622
|
+
vendor: "githubCopilot",
|
|
623
|
+
rawNames: [
|
|
624
|
+
"Copilot",
|
|
625
|
+
"github-copilot-developer",
|
|
626
|
+
"Copilot MCP Gateway",
|
|
627
|
+
"Xcode/copilot-xcode"
|
|
628
|
+
]
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
id: "gemini_cli",
|
|
632
|
+
label: "Gemini CLI",
|
|
633
|
+
vendor: "google",
|
|
634
|
+
rawNames: ["gemini-cli-mcp-client", "gemini-cli"]
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
id: "antigravity",
|
|
638
|
+
label: "Antigravity",
|
|
639
|
+
vendor: "google",
|
|
640
|
+
rawNames: ["antigravity-client"]
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
id: "gemini",
|
|
644
|
+
label: "Gemini",
|
|
645
|
+
vendor: "google",
|
|
646
|
+
rawNames: ["Gemini", "google-ai-edge-gallery"]
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
id: "windsurf",
|
|
650
|
+
label: "Windsurf",
|
|
651
|
+
vendor: "windsurf",
|
|
652
|
+
rawNames: ["Windsurf", "windsurf-client"]
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
id: "mistral",
|
|
656
|
+
label: "Mistral / Le Chat",
|
|
657
|
+
vendor: "mistral",
|
|
658
|
+
rawNames: ["Mistral"],
|
|
659
|
+
rawNamePrefixes: ["connector:custom-mcp:"]
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
id: "n8n",
|
|
663
|
+
label: "n8n",
|
|
664
|
+
vendor: "n8n",
|
|
665
|
+
rawNames: [
|
|
666
|
+
"@n8n/n8n-nodes-langchain.mcpClient",
|
|
667
|
+
"@n8n/n8n-nodes-langchain.mcpClientTool",
|
|
668
|
+
"n8n"
|
|
669
|
+
]
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
id: "alpic_playground",
|
|
673
|
+
label: "Alpic Playground",
|
|
674
|
+
vendor: "alpic",
|
|
675
|
+
rawNames: ["alpic-playground", "playground"]
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
id: "opencode",
|
|
679
|
+
label: "opencode",
|
|
680
|
+
vendor: "opencode",
|
|
681
|
+
rawNames: ["opencode"]
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
id: "zed",
|
|
685
|
+
label: "Zed",
|
|
686
|
+
vendor: "zed",
|
|
687
|
+
rawNames: ["Zed", "zed"]
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
id: "zapier",
|
|
691
|
+
label: "Zapier",
|
|
692
|
+
vendor: "zapier",
|
|
693
|
+
rawNames: ["Zapier", "zapier"]
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
id: "make",
|
|
697
|
+
label: "Make",
|
|
698
|
+
vendor: "make",
|
|
699
|
+
rawNames: ["Make", "make"]
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
id: "librechat",
|
|
703
|
+
label: "LibreChat",
|
|
704
|
+
vendor: "mcp",
|
|
705
|
+
rawNames: ["LibreChat", "librechat"]
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
id: "jan",
|
|
709
|
+
label: "Jan",
|
|
710
|
+
vendor: "mcp",
|
|
711
|
+
rawNames: ["Jan", "jan"]
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
id: "goose",
|
|
715
|
+
label: "goose",
|
|
716
|
+
vendor: "mcp",
|
|
717
|
+
rawNames: ["goose", "Goose"]
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
id: "mcphost",
|
|
721
|
+
label: "mcphost",
|
|
722
|
+
vendor: "mcp",
|
|
723
|
+
rawNames: ["mcphost"]
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
id: "mcporter",
|
|
727
|
+
label: "mcporter",
|
|
728
|
+
vendor: "mcp",
|
|
729
|
+
rawNames: ["mcporter"]
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
id: "rmcp",
|
|
733
|
+
label: "rmcp",
|
|
734
|
+
vendor: "mcp",
|
|
735
|
+
rawNames: ["rmcp"]
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
id: "unnamed_client",
|
|
739
|
+
label: "Unnamed client",
|
|
740
|
+
vendor: "mcp",
|
|
741
|
+
rawNames: [
|
|
742
|
+
"mcp",
|
|
743
|
+
"unknown",
|
|
744
|
+
""
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
];
|
|
748
|
+
/** A source pattern, not a RegExp, because analytics renders the same rule into ClickHouse RE2, which shares this syntax. */
|
|
749
|
+
const MCP_REMOTE_WRAPPER_SUFFIX = String.raw` \(via mcp-remote [^\n]+?\)$`;
|
|
750
|
+
new RegExp(MCP_REMOTE_WRAPPER_SUFFIX);
|
|
751
|
+
new Map(MCP_CLIENT_GROUPS.map((group) => [group.id, group]));
|
|
491
752
|
const runtimeSchema = z.enum([
|
|
492
753
|
"python3.13",
|
|
493
754
|
"python3.14",
|
|
@@ -565,15 +826,7 @@ z.object({
|
|
|
565
826
|
serverFields: serverFieldsSchema$1,
|
|
566
827
|
source: z.enum(["registry", "defaults"])
|
|
567
828
|
});
|
|
568
|
-
/**
|
|
569
|
-
* Returns a variant of a `maxLength`-constrained string that clamps (truncates) instead of
|
|
570
|
-
* rejecting on overflow — used for AI-generated copy where the model routinely overshoots.
|
|
571
|
-
*
|
|
572
|
-
* NOTE: this rebuilds the schema from scratch, carrying over only `maxLength` (as a clamp),
|
|
573
|
-
* `minLength`, and the description. Any other validators on the source field (`.regex()`,
|
|
574
|
-
* `.email()`, custom refinements) are intentionally dropped — this helper is meant for plain
|
|
575
|
-
* free-text length caps only. A field with `null` `maxLength` is returned unchanged.
|
|
576
|
-
*/
|
|
829
|
+
/** 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. */
|
|
577
830
|
const clampStringField = (field) => {
|
|
578
831
|
const max = field.maxLength;
|
|
579
832
|
if (max === null) return field;
|
|
@@ -919,11 +1172,7 @@ const chatgptToolJustificationSchema = z.object({
|
|
|
919
1172
|
openWorldJustification: z.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
920
1173
|
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.\"")
|
|
921
1174
|
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
922
|
-
/**
|
|
923
|
-
* Base copy fields, defined once and reused by both the submission form and per-locale
|
|
924
|
-
* translations so the constraints (tagline ≤ 30 chars) never drift. The translation generation
|
|
925
|
-
* path wraps these in {@link clampStringField} since the LLM tends to overshoot the limit.
|
|
926
|
-
*/
|
|
1175
|
+
/** Defined once and reused by both the submission form and per-locale translations so the tagline ≤ 30 chars constraint never drifts. */
|
|
927
1176
|
const chatgptTaglineSchema = z.string().max(30);
|
|
928
1177
|
const chatgptDescriptionSchema = z.string();
|
|
929
1178
|
const chatgptTranslationSchema = z.object({
|
|
@@ -932,10 +1181,7 @@ const chatgptTranslationSchema = z.object({
|
|
|
932
1181
|
description: chatgptDescriptionSchema
|
|
933
1182
|
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
934
1183
|
chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
935
|
-
/**
|
|
936
|
-
* Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
|
|
937
|
-
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
938
|
-
*/
|
|
1184
|
+
/** Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section; keep it in sync with the sheet. */
|
|
939
1185
|
const chatgptSubmissionFormDataSchema = z.object({
|
|
940
1186
|
logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
|
|
941
1187
|
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."),
|
|
@@ -1032,11 +1278,7 @@ const claudePolicyAcknowledgementSchema = z.enum([
|
|
|
1032
1278
|
"My connector does not collect conversation data beyond what is needed for its function.",
|
|
1033
1279
|
"Public documentation for this connector will be live by the publish date."
|
|
1034
1280
|
]);
|
|
1035
|
-
/**
|
|
1036
|
-
* Field order mirrors the claude.ai directory submission wizard
|
|
1037
|
-
* (`claude.ai/admin-settings/directory/submissions/new`), grouped by step.
|
|
1038
|
-
* When adding/removing/reordering fields, keep this in sync with the wizard.
|
|
1039
|
-
*/
|
|
1281
|
+
/** 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. */
|
|
1040
1282
|
const claudeSubmissionFormDataSchema = z.object({
|
|
1041
1283
|
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
|
|
1042
1284
|
from the custom connector you select — the connection is used to verify the URL and the tool list at submission time.
|
|
@@ -1128,12 +1370,7 @@ claudeSubmissionFormDataSchema.pick({
|
|
|
1128
1370
|
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
1129
1371
|
testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
|
|
1130
1372
|
});
|
|
1131
|
-
/**
|
|
1132
|
-
* Narrative fields the LLM-backed generation step produces for Claude submissions.
|
|
1133
|
-
* This schema accepts the slightly loose shape returned by AI generation, then normalizes it into
|
|
1134
|
-
* the strict form shape. Keep transforms here rather than in callers so generation leniency is
|
|
1135
|
-
* colocated with the Claude contract.
|
|
1136
|
-
*/
|
|
1373
|
+
/** Loose shape returned by AI generation for Claude narrative fields; transforms live here so generation leniency stays colocated with the Claude contract. */
|
|
1137
1374
|
const claudeAiGeneratedFormDataRawSchema = z.object({
|
|
1138
1375
|
oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
|
|
1139
1376
|
description: claudeSubmissionFormDataSchema.shape.description,
|
|
@@ -1225,7 +1462,10 @@ const RESERVED_KEYS = [
|
|
|
1225
1462
|
"BUILD_ARG_START_COMMAND",
|
|
1226
1463
|
"ALPIC_HOST",
|
|
1227
1464
|
"ALPIC_CUSTOM_DOMAINS",
|
|
1228
|
-
"ALPIC_INTENT_META_KEY"
|
|
1465
|
+
"ALPIC_INTENT_META_KEY",
|
|
1466
|
+
"ALPIC_FEEDBACK_META_KEY",
|
|
1467
|
+
"ALPIC_EVENTS_META_KEY",
|
|
1468
|
+
"ALPIC_IDENTIFY_META_KEY"
|
|
1229
1469
|
];
|
|
1230
1470
|
const environmentVariableSchema = z.object({
|
|
1231
1471
|
key: z.string().min(2, "Key must be at least 2 characters").regex(/^[a-zA-Z]([a-zA-Z0-9_])+$/, "Key must start with a letter and contain only letters, numbers, and underscores").refine((key) => !RESERVED_KEYS.includes(key), "This key is reserved and cannot be used as an environment variable key"),
|
|
@@ -1541,7 +1781,8 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
1541
1781
|
successDescription: "The environment has been deployed successfully"
|
|
1542
1782
|
}).errors({
|
|
1543
1783
|
NOT_FOUND: {},
|
|
1544
|
-
BAD_REQUEST: {}
|
|
1784
|
+
BAD_REQUEST: {},
|
|
1785
|
+
CONFLICT: {}
|
|
1545
1786
|
}).input(z.object({
|
|
1546
1787
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
1547
1788
|
token: z.string().describe("The token to identify the source archive").optional(),
|
|
@@ -1582,6 +1823,21 @@ const getDeploymentContractV1 = oc.route({
|
|
|
1582
1823
|
tags: ["deployments"],
|
|
1583
1824
|
successDescription: "The deployment details"
|
|
1584
1825
|
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
1826
|
+
const logEntrySchema = z.object({
|
|
1827
|
+
timestamp: z.coerce.date(),
|
|
1828
|
+
type: z.enum([
|
|
1829
|
+
"START",
|
|
1830
|
+
"END",
|
|
1831
|
+
"INFO",
|
|
1832
|
+
"ERROR",
|
|
1833
|
+
"WARNING",
|
|
1834
|
+
"DEBUG"
|
|
1835
|
+
]),
|
|
1836
|
+
requestId: z.string(),
|
|
1837
|
+
content: z.string().optional(),
|
|
1838
|
+
method: z.string().optional(),
|
|
1839
|
+
durationInMs: z.number().optional()
|
|
1840
|
+
});
|
|
1585
1841
|
const getLogsContractV1 = oc.route({
|
|
1586
1842
|
path: "/v1/environments/{environmentId}/logs",
|
|
1587
1843
|
method: "GET",
|
|
@@ -1606,21 +1862,7 @@ const getLogsContractV1 = oc.route({
|
|
|
1606
1862
|
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
1607
1863
|
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
1608
1864
|
})).output(z.object({
|
|
1609
|
-
logs: z.array(
|
|
1610
|
-
timestamp: z.coerce.date(),
|
|
1611
|
-
type: z.enum([
|
|
1612
|
-
"START",
|
|
1613
|
-
"END",
|
|
1614
|
-
"INFO",
|
|
1615
|
-
"ERROR",
|
|
1616
|
-
"WARNING",
|
|
1617
|
-
"DEBUG"
|
|
1618
|
-
]),
|
|
1619
|
-
requestId: z.string(),
|
|
1620
|
-
content: z.string().optional(),
|
|
1621
|
-
method: z.string().optional(),
|
|
1622
|
-
durationInMs: z.number().optional()
|
|
1623
|
-
})),
|
|
1865
|
+
logs: z.array(logEntrySchema),
|
|
1624
1866
|
nextToken: z.string().nullable()
|
|
1625
1867
|
}));
|
|
1626
1868
|
const getLatestLogsContractV1 = oc.route({
|
|
@@ -1643,21 +1885,7 @@ const getLatestLogsContractV1 = oc.route({
|
|
|
1643
1885
|
"DEBUG"
|
|
1644
1886
|
])).optional().describe("Filter by log level"),
|
|
1645
1887
|
search: z.string().optional().describe("Filter pattern to search for in log content")
|
|
1646
|
-
})).output(z.object({ logs: z.array(
|
|
1647
|
-
timestamp: z.coerce.date(),
|
|
1648
|
-
type: z.enum([
|
|
1649
|
-
"START",
|
|
1650
|
-
"END",
|
|
1651
|
-
"INFO",
|
|
1652
|
-
"ERROR",
|
|
1653
|
-
"WARNING",
|
|
1654
|
-
"DEBUG"
|
|
1655
|
-
]),
|
|
1656
|
-
requestId: z.string(),
|
|
1657
|
-
content: z.string().optional(),
|
|
1658
|
-
method: z.string().optional(),
|
|
1659
|
-
durationInMs: z.number().optional()
|
|
1660
|
-
})) }));
|
|
1888
|
+
})).output(z.object({ logs: z.array(logEntrySchema) }));
|
|
1661
1889
|
const getDeploymentLogsContractV1 = oc.route({
|
|
1662
1890
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
1663
1891
|
method: "GET",
|
|
@@ -1883,5 +2111,10 @@ const contract = {
|
|
|
1883
2111
|
get: { v1: getBeaconContractV1 }
|
|
1884
2112
|
}
|
|
1885
2113
|
};
|
|
2114
|
+
const { uploadArtifact: _discard, ...deploymentsForDocs } = contract.deployments;
|
|
2115
|
+
const contractForDocs = {
|
|
2116
|
+
...contract,
|
|
2117
|
+
deployments: deploymentsForDocs
|
|
2118
|
+
};
|
|
1886
2119
|
//#endregion
|
|
1887
|
-
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
2120
|
+
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.ged18600",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"author": "Alpic",
|
|
34
34
|
"license": "ISC",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@orpc/contract": "^1.14.
|
|
36
|
+
"@orpc/contract": "^1.14.13",
|
|
37
37
|
"ms": "^2.1.3",
|
|
38
38
|
"zod": "^4.4.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@orpc/openapi": "^1.14.
|
|
42
|
-
"@orpc/zod": "^1.14.
|
|
41
|
+
"@orpc/openapi": "^1.14.13",
|
|
42
|
+
"@orpc/zod": "^1.14.13",
|
|
43
43
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
44
44
|
"@types/ms": "^2.1.0",
|
|
45
45
|
"shx": "^0.4.0",
|
|
46
|
-
"tsdown": "^0.22.
|
|
46
|
+
"tsdown": "^0.22.14",
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
48
|
"vitest": "^4.1.10",
|
|
49
49
|
"@alpic-ai/domains": "0.0.0"
|