@chat-js/registry 0.2.0-beta.7 → 0.2.0-beta.9
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/README.md +4 -4
- package/dist/r/ai-titles.json +10 -13
- package/dist/r/attach-workspace-file.json +2 -2
- package/dist/r/attachment-uploads.json +13 -22
- package/dist/r/base/ai-titles.json +10 -13
- package/dist/r/base/attach-workspace-file.json +2 -2
- package/dist/r/base/attachment-uploads.json +13 -22
- package/dist/r/base/credits.json +11 -33
- package/dist/r/base/deep-research.json +0 -4
- package/dist/r/base/desktop.json +14 -30
- package/dist/r/base/feedback.json +18 -40
- package/dist/r/base/followup-suggestions.json +18 -40
- package/dist/r/base/guest-chat.json +20 -35
- package/dist/r/base/image-viewer.json +9 -15
- package/dist/r/base/mcp.json +24 -47
- package/dist/r/base/memory-storage.json +2 -2
- package/dist/r/base/model-preferences.json +16 -37
- package/dist/r/base/projects.json +23 -45
- package/dist/r/base/registry.json +138 -370
- package/dist/r/base/search.json +21 -43
- package/dist/r/base/sharing.json +18 -40
- package/dist/r/base/spreadsheet-viewer.json +9 -15
- package/dist/r/base/vercel-gateway.json +2 -1
- package/dist/r/base/video-viewer.json +9 -15
- package/dist/r/credits.json +11 -33
- package/dist/r/deep-research.json +0 -4
- package/dist/r/desktop.json +14 -30
- package/dist/r/feedback.json +18 -40
- package/dist/r/followup-suggestions.json +18 -40
- package/dist/r/guest-chat.json +20 -35
- package/dist/r/image-viewer.json +9 -15
- package/dist/r/mcp.json +24 -47
- package/dist/r/memory-storage.json +2 -2
- package/dist/r/model-preferences.json +16 -37
- package/dist/r/projects.json +23 -45
- package/dist/r/radix/ai-titles.json +10 -13
- package/dist/r/radix/attach-workspace-file.json +2 -2
- package/dist/r/radix/attachment-uploads.json +13 -22
- package/dist/r/radix/credits.json +11 -33
- package/dist/r/radix/deep-research.json +0 -4
- package/dist/r/radix/desktop.json +14 -30
- package/dist/r/radix/feedback.json +18 -40
- package/dist/r/radix/followup-suggestions.json +18 -40
- package/dist/r/radix/guest-chat.json +20 -35
- package/dist/r/radix/image-viewer.json +9 -15
- package/dist/r/radix/mcp.json +24 -47
- package/dist/r/radix/memory-storage.json +2 -2
- package/dist/r/radix/model-preferences.json +16 -37
- package/dist/r/radix/projects.json +23 -45
- package/dist/r/radix/registry.json +138 -370
- package/dist/r/radix/search.json +21 -43
- package/dist/r/radix/sharing.json +18 -40
- package/dist/r/radix/spreadsheet-viewer.json +9 -15
- package/dist/r/radix/vercel-gateway.json +2 -1
- package/dist/r/radix/video-viewer.json +9 -15
- package/dist/r/registry.json +138 -370
- package/dist/r/search.json +21 -43
- package/dist/r/sharing.json +18 -40
- package/dist/r/spreadsheet-viewer.json +9 -15
- package/dist/r/vercel-gateway.json +2 -1
- package/dist/r/video-viewer.json +9 -15
- package/package.json +1 -1
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
"title": "Vercel AI Gateway",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
"@ai-sdk/gateway@4.0.145",
|
|
7
|
+
"@vercel/oidc@3.2.0",
|
|
7
8
|
"zod@4.5.4"
|
|
8
9
|
],
|
|
9
10
|
"files": [
|
|
10
11
|
{
|
|
11
12
|
"path": "src/gateways/vercel/gateway.ts",
|
|
12
|
-
"content": "import type {\n Experimental_VideoModelV4,\n LanguageModelV4,\n} from \"@ai-sdk/provider\";\nimport {\n aiGatewayModelSchema,\n isAiGatewayModelType,\n} from \"@/chatjs/core/gateway/models\";\nimport type { AiGatewayModel } from \"@/chatjs/core/gateway/models\";\nimport type { GatewayProvider } from \"@/chatjs/core/gateway/gateway-provider\";\nimport { GatewayRuntime } from \"@/chatjs/core/gateway/runtime\";\nimport type { ImageModel } from \"ai\";\n\nimport { createGateway } from \"@ai-sdk/gateway\";\nimport type { gateway } from \"@ai-sdk/gateway\";\nimport { z } from \"zod\";\n\nconst MODEL_ID_PARAMETER_INDEX = 0;\ntype VercelImageModelId = Parameters<\n (typeof gateway)[\"imageModel\"]\n>[typeof MODEL_ID_PARAMETER_INDEX];\ntype VercelVideoModelId = Parameters<\n (typeof gateway)[\"videoModel\"]\n>[typeof MODEL_ID_PARAMETER_INDEX];\n\nconst EMPTY_MODEL_TYPE_COUNT = 0;\nconst modelDiscriminatorSchema = z.object({ type: z.string() });\nconst modelsEnvelopeSchema = z.object({\n data: z.array(z.unknown()),\n object: z.literal(\"list\"),\n});\n\nclass VercelGateway\n extends GatewayRuntime\n implements GatewayProvider<\"vercel\">\n{\n public readonly type = \"vercel\" as const;\n\n public createLanguageModel(\n modelId: Parameters<\n (typeof gateway)[\"languageModel\"]\n >[typeof MODEL_ID_PARAMETER_INDEX]\n ): LanguageModelV4 {\n return this.getProvider()(modelId);\n }\n\n public createImageModel(modelId: VercelImageModelId): ImageModel {\n return this.getProvider().imageModel(modelId);\n }\n\n public createVideoModel(\n modelId: VercelVideoModelId\n ): Experimental_VideoModelV4 {\n return this.getProvider().videoModel(modelId);\n }\n\n private provider?: ReturnType<typeof createGateway>;\n\n private getProvider(): ReturnType<typeof createGateway> {\n this.provider ??= createGateway({ apiKey: this.env.AI_GATEWAY_API_KEY });\n return this.provider;\n }\n\n private getApiKey(): string |
|
|
13
|
+
"content": "import type {\n Experimental_VideoModelV4,\n LanguageModelV4,\n} from \"@ai-sdk/provider\";\nimport {\n aiGatewayModelSchema,\n isAiGatewayModelType,\n} from \"@/chatjs/core/gateway/models\";\nimport type { AiGatewayModel } from \"@/chatjs/core/gateway/models\";\nimport type { GatewayProvider } from \"@/chatjs/core/gateway/gateway-provider\";\nimport { GatewayRuntime } from \"@/chatjs/core/gateway/runtime\";\nimport type { ImageModel } from \"ai\";\n\nimport { createGateway } from \"@ai-sdk/gateway\";\nimport type { gateway } from \"@ai-sdk/gateway\";\nimport { getVercelOidcToken } from \"@vercel/oidc\";\nimport { z } from \"zod\";\n\nconst MODEL_ID_PARAMETER_INDEX = 0;\ntype VercelImageModelId = Parameters<\n (typeof gateway)[\"imageModel\"]\n>[typeof MODEL_ID_PARAMETER_INDEX];\ntype VercelVideoModelId = Parameters<\n (typeof gateway)[\"videoModel\"]\n>[typeof MODEL_ID_PARAMETER_INDEX];\n\nconst EMPTY_MODEL_TYPE_COUNT = 0;\nconst modelDiscriminatorSchema = z.object({ type: z.string() });\nconst modelsEnvelopeSchema = z.object({\n data: z.array(z.unknown()),\n object: z.literal(\"list\"),\n});\nconst modelAvailability = z.object({\n model_eligibility: z\n .object({\n status: z.string(),\n category: z.string().optional(),\n })\n .optional(),\n});\n\nclass VercelGateway\n extends GatewayRuntime\n implements GatewayProvider<\"vercel\">\n{\n public readonly type = \"vercel\" as const;\n\n public createLanguageModel(\n modelId: Parameters<\n (typeof gateway)[\"languageModel\"]\n >[typeof MODEL_ID_PARAMETER_INDEX]\n ): LanguageModelV4 {\n return this.getProvider()(modelId);\n }\n\n public createImageModel(modelId: VercelImageModelId): ImageModel {\n return this.getProvider().imageModel(modelId);\n }\n\n public createVideoModel(\n modelId: VercelVideoModelId\n ): Experimental_VideoModelV4 {\n return this.getProvider().videoModel(modelId);\n }\n\n private provider?: ReturnType<typeof createGateway>;\n\n private getProvider(): ReturnType<typeof createGateway> {\n this.provider ??= createGateway({ apiKey: this.env.AI_GATEWAY_API_KEY });\n return this.provider;\n }\n\n private async getApiKey(): Promise<string | null> {\n const apiKey = this.env.AI_GATEWAY_API_KEY;\n\n if (typeof apiKey === \"string\" && apiKey !== \"\") {\n return apiKey;\n }\n const oidcToken = this.env.VERCEL_OIDC_TOKEN;\n if (typeof oidcToken === \"string\" && oidcToken !== \"\") {\n return oidcToken;\n }\n return await getVercelOidcToken().catch(() => null);\n }\n\n public async fetchModels(): Promise<AiGatewayModel[]> {\n const apiKey = await this.getApiKey();\n const catalogUrl = \"https://ai-gateway.vercel.sh/v1/models\";\n const url =\n apiKey === null ? catalogUrl : `${catalogUrl}?include_availability`;\n this.log.debug({ url }, \"Fetching models from Vercel AI Gateway\");\n\n try {\n const response = await this.fetch(\n url,\n apiKey === null\n ? undefined\n : { headers: { Authorization: `Bearer ${apiKey}` } }\n );\n\n if (!response.ok) {\n this.log.error(\n { status: response.status, statusText: response.statusText, url },\n \"Vercel AI Gateway returned non-OK response\"\n );\n throw new Error(`Failed to fetch models: ${response.statusText}`);\n }\n\n const bodyRaw: unknown = await response.json();\n const body = modelsEnvelopeSchema.parse(bodyRaw);\n const unsupportedTypes = new Set<string>();\n const models: AiGatewayModel[] = [];\n\n for (const candidate of body.data) {\n const { type } = modelDiscriminatorSchema.parse(candidate);\n if (isAiGatewayModelType(type)) {\n const availability = modelAvailability.safeParse(candidate);\n const eligibility = availability.data?.model_eligibility;\n if (\n eligibility?.status === \"ineligible\" &&\n (eligibility.category === \"policy\" ||\n eligibility.category === \"configuration\")\n ) {\n continue;\n }\n models.push(aiGatewayModelSchema.parse(candidate));\n } else {\n unsupportedTypes.add(type);\n }\n }\n\n if (unsupportedTypes.size > EMPTY_MODEL_TYPE_COUNT) {\n this.log.warn(\n {\n modelCount: body.data.length,\n skippedModelCount: body.data.length - models.length,\n unsupportedTypes: [...unsupportedTypes],\n },\n \"Skipping models with unsupported types from Vercel AI Gateway\"\n );\n }\n\n this.log.info(\n { modelCount: models.length },\n \"Successfully fetched models from Vercel AI Gateway\"\n );\n return models;\n } catch (error) {\n this.log.error(\n { err: error, url },\n \"Error fetching models from Vercel AI Gateway, falling back to generated models\"\n );\n return [...this.getFallbackModels(this.type)];\n }\n }\n}\nexport { VercelGateway as Gateway, VercelGateway };\n",
|
|
13
14
|
"type": "registry:file",
|
|
14
15
|
"target": "~/chatjs/providers/gateway.ts"
|
|
15
16
|
}
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
],
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
|
-
"path": "src/plugins/video-viewer/src/
|
|
12
|
-
"content": "\"use client\";\nimport { definePlugin, slot } from \"@/chatjs/core/ui/slots\";\nimport { ArtifactViewerActions } from \"@/components/artifact-actions\";\nimport { VideoViewerAction } from \"./viewer-action\";\n\nexport const
|
|
11
|
+
"path": "src/plugins/video-viewer/src/chat-ui.ts",
|
|
12
|
+
"content": "\"use client\";\nimport { definePlugin, slot } from \"@/chatjs/core/ui/slots\";\nimport { ArtifactViewerActions } from \"@/components/artifact-actions\";\nimport { VideoViewerAction } from \"./viewer-action\";\n\nexport const chatUi = definePlugin({\n id: \"video-viewer\",\n slots: [slot(ArtifactViewerActions, VideoViewerAction)],\n});\n",
|
|
13
13
|
"type": "registry:file",
|
|
14
|
-
"target": "~/chatjs/plugins/video-viewer/
|
|
14
|
+
"target": "~/chatjs/plugins/video-viewer/chat-ui.ts"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"path": "src/plugins/video-viewer/src/viewer-action.tsx",
|
|
@@ -21,27 +21,21 @@
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "dist/source/video-viewer.json",
|
|
24
|
-
"content": "{\n \"id\": \"video-viewer\",\n \"kind\": \"plugin\",\n \"files\": [\n \"chatjs/plugins/video-viewer/
|
|
24
|
+
"content": "{\n \"contractVersion\": 3,\n \"uiBase\": \"radix\",\n \"id\": \"video-viewer\",\n \"kind\": \"plugin\",\n \"files\": [\n \"chatjs/plugins/video-viewer/chat-ui.ts\",\n \"chatjs/plugins/video-viewer/viewer-action.tsx\"\n ]\n}\n",
|
|
25
25
|
"type": "registry:file",
|
|
26
|
-
"target": "~/chatjs/plugins/video-viewer/
|
|
26
|
+
"target": "~/chatjs/plugins/video-viewer/plugin.json"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
29
|
"meta": {
|
|
30
30
|
"chatjs": {
|
|
31
|
+
"contractVersion": 3,
|
|
32
|
+
"uiBase": "radix",
|
|
31
33
|
"id": "video-viewer",
|
|
32
34
|
"kind": "plugin",
|
|
33
35
|
"files": [
|
|
34
|
-
"chatjs/plugins/video-viewer/
|
|
36
|
+
"chatjs/plugins/video-viewer/chat-ui.ts",
|
|
35
37
|
"chatjs/plugins/video-viewer/viewer-action.tsx"
|
|
36
|
-
]
|
|
37
|
-
"client": {
|
|
38
|
-
"export": "videoViewerClient",
|
|
39
|
-
"composerControls": [],
|
|
40
|
-
"settingsItems": [],
|
|
41
|
-
"chat": true
|
|
42
|
-
},
|
|
43
|
-
"contractVersion": 2,
|
|
44
|
-
"uiBase": "radix"
|
|
38
|
+
]
|
|
45
39
|
}
|
|
46
40
|
},
|
|
47
41
|
"type": "registry:item"
|