@chat-js/registry 0.2.0-beta.5 → 0.2.0-beta.7
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 +1 -1
- package/dist/r/attach-workspace-file.json +1 -1
- package/dist/r/base/attach-workspace-file.json +1 -1
- package/dist/r/base/default-sandbox.json +1 -1
- package/dist/r/base/docker-sandbox.json +1 -1
- package/dist/r/base/generate-image.json +1 -1
- package/dist/r/base/generate-video.json +1 -1
- package/dist/r/base/guest-chat.json +1 -1
- package/dist/r/base/just-bash-sandbox.json +1 -1
- package/dist/r/base/litellm-gateway.json +2 -3
- package/dist/r/base/mcp.json +2 -2
- package/dist/r/base/openai-compatible-gateway.json +2 -3
- package/dist/r/base/openai-gateway.json +2 -3
- package/dist/r/base/openrouter-gateway.json +1 -2
- package/dist/r/base/registry.json +14 -18
- package/dist/r/base/vercel-gateway.json +3 -3
- package/dist/r/base/vercel-sandbox.json +1 -1
- package/dist/r/default-sandbox.json +1 -1
- package/dist/r/docker-sandbox.json +1 -1
- package/dist/r/eve/deep-research.json +1 -1
- package/dist/r/eve/registry.json +1 -1
- package/dist/r/generate-image.json +1 -1
- package/dist/r/generate-video.json +1 -1
- package/dist/r/guest-chat.json +1 -1
- package/dist/r/just-bash-sandbox.json +1 -1
- package/dist/r/litellm-gateway.json +2 -3
- package/dist/r/mcp.json +2 -2
- package/dist/r/openai-compatible-gateway.json +2 -3
- package/dist/r/openai-gateway.json +2 -3
- package/dist/r/openrouter-gateway.json +1 -2
- package/dist/r/radix/attach-workspace-file.json +1 -1
- package/dist/r/radix/default-sandbox.json +1 -1
- package/dist/r/radix/docker-sandbox.json +1 -1
- package/dist/r/radix/generate-image.json +1 -1
- package/dist/r/radix/generate-video.json +1 -1
- package/dist/r/radix/guest-chat.json +1 -1
- package/dist/r/radix/just-bash-sandbox.json +1 -1
- package/dist/r/radix/litellm-gateway.json +2 -3
- package/dist/r/radix/mcp.json +2 -2
- package/dist/r/radix/openai-compatible-gateway.json +2 -3
- package/dist/r/radix/openai-gateway.json +2 -3
- package/dist/r/radix/openrouter-gateway.json +1 -2
- package/dist/r/radix/registry.json +14 -18
- package/dist/r/radix/vercel-gateway.json +3 -3
- package/dist/r/radix/vercel-sandbox.json +1 -1
- package/dist/r/registry.json +14 -18
- package/dist/r/vercel-gateway.json +3 -3
- package/dist/r/vercel-sandbox.json +1 -1
- package/package.json +11 -12
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
"name": "openrouter-gateway",
|
|
4
4
|
"title": "OpenRouter",
|
|
5
5
|
"dependencies": [
|
|
6
|
-
"@chat-js/gateways@0.2.1",
|
|
7
6
|
"@openrouter/ai-sdk-provider@3.0.0",
|
|
8
7
|
"zod@4.5.4"
|
|
9
8
|
],
|
|
10
9
|
"files": [
|
|
11
10
|
{
|
|
12
11
|
"path": "src/gateways/openrouter/gateway.ts",
|
|
13
|
-
"content": "import type { LanguageModelV4 } from \"@ai-sdk/provider\";\nimport type { AiGatewayModel } from \"
|
|
12
|
+
"content": "import type { LanguageModelV4 } from \"@ai-sdk/provider\";\nimport type { AiGatewayModel } from \"@/chatjs/core/gateway/models\";\n\nimport type { GatewayProvider } from \"@/chatjs/core/gateway/gateway-provider\";\n\nimport { GatewayRuntime } from \"@/chatjs/core/gateway/runtime\";\n\nimport { createOpenRouter } from \"@openrouter/ai-sdk-provider\";\n\nimport { z } from \"zod\";\n\nconst MODEL_OWNER_SEGMENT_INDEX = 0;\nconst EMPTY_TAG_COUNT = 0;\nconst OPENROUTER_MODELS_URL = \"https://openrouter.ai/api/v1/models\";\n\nconst modalitiesSchema = z.array(z.string()).nullish();\nconst providerModelSchema = z.object({\n architecture: z\n .object({\n input_modalities: modalitiesSchema,\n output_modalities: modalitiesSchema,\n })\n .nullish(),\n context_length: z.number().nullish(),\n created: z.number().nullish(),\n description: z.string().nullish(),\n id: z.string(),\n name: z.string().nullish(),\n pricing: z\n .object({\n completion: z.string().optional(),\n image: z.string().optional(),\n input_cache_read: z.string().optional(),\n input_cache_write: z.string().optional(),\n prompt: z.string().optional(),\n web_search: z.string().optional(),\n })\n .nullish(),\n supported_parameters: z.array(z.string()).nullish(),\n top_provider: z\n .object({ max_completion_tokens: z.number().nullish() })\n .nullish(),\n});\ntype OpenRouterModelResponse = Omit<\n z.output<typeof providerModelSchema>,\n \"architecture\" | \"pricing\" | \"top_provider\" | \"supported_parameters\"\n> & {\n architecture?: {\n readonly input_modalities?: readonly string[] | null;\n readonly output_modalities?: readonly string[] | null;\n } | null;\n pricing?: Readonly<z.output<typeof providerModelSchema>[\"pricing\"]>;\n top_provider?: Readonly<z.output<typeof providerModelSchema>[\"top_provider\"]>;\n supported_parameters?: readonly string[] | null;\n};\nconst providerModelListSchema = z.object({\n data: z.array(z.unknown()),\n});\n\nconst deriveTags = (model: Readonly<OpenRouterModelResponse>): string[] => {\n const inputMods = (model.architecture ?? {}).input_modalities ?? [\"text\"];\n const outputMods = (model.architecture ?? {}).output_modalities ?? [\"text\"];\n const supportedParams = model.supported_parameters ?? [];\n\n const capabilities: readonly (readonly [boolean, string])[] = [\n [inputMods.includes(\"image\"), \"vision\"],\n [inputMods.includes(\"file\"), \"file-input\"],\n [outputMods.includes(\"image\"), \"image-generation\"],\n [\n supportedParams.includes(\"reasoning\") ||\n supportedParams.includes(\"include_reasoning\"),\n \"reasoning\",\n ],\n [supportedParams.includes(\"tools\"), \"tool-use\"],\n ];\n return capabilities.filter(([supported]) => supported).map(([, tag]) => tag);\n};\n\nconst EMPTY_MODEL_COUNT = 0;\nconst UNKNOWN_MODEL_LIMIT = 0;\nconst UNKNOWN_MODEL_TIMESTAMP = 0;\nconst toAiGatewayModel = (\n model: Readonly<OpenRouterModelResponse>\n): AiGatewayModel => {\n const tags = deriveTags(model);\n const outputMods = (model.architecture ?? {}).output_modalities ?? [\"text\"];\n\n let type: \"language\" | \"embedding\" | \"image\" = \"language\";\n if (!outputMods.includes(\"text\") && outputMods.includes(\"image\")) {\n type = \"image\";\n }\n\n const owned_by =\n model.id.split(\"/\").at(MODEL_OWNER_SEGMENT_INDEX) ?? \"unknown\";\n\n return {\n context_window: model.context_length ?? UNKNOWN_MODEL_LIMIT,\n created: model.created ?? UNKNOWN_MODEL_TIMESTAMP,\n description: model.description ?? \"\",\n id: model.id,\n max_tokens:\n (model.top_provider ?? {}).max_completion_tokens ?? UNKNOWN_MODEL_LIMIT,\n name: model.name ?? model.id,\n object: \"model\",\n owned_by,\n pricing: {\n image: (model.pricing ?? {}).image,\n input: (model.pricing ?? {}).prompt,\n input_cache_read: (model.pricing ?? {}).input_cache_read,\n input_cache_write: (model.pricing ?? {}).input_cache_write,\n output: (model.pricing ?? {}).completion,\n web_search: (model.pricing ?? {}).web_search,\n },\n tags: tags.length > EMPTY_TAG_COUNT ? tags : undefined,\n type,\n };\n};\n\n// Validate the wire envelope separately from each model so valid neighbors survive.\nconst parseProviderModels = (value: unknown): AiGatewayModel[] => {\n const body = providerModelListSchema.parse(value);\n const result = body.data.flatMap((entry): AiGatewayModel[] => {\n const model = providerModelSchema.safeParse(entry);\n if (!model.success) {\n return [];\n }\n return [toAiGatewayModel(model.data)];\n });\n // A genuinely empty catalog is valid; a nonempty unparseable catalog is not.\n if (\n body.data.length > EMPTY_MODEL_COUNT &&\n result.length === EMPTY_MODEL_COUNT\n ) {\n throw new Error(\"Provider catalog contains no valid models.\");\n }\n return result;\n};\n\nclass OpenRouterGateway\n extends GatewayRuntime\n implements GatewayProvider<\"openrouter\">\n{\n public readonly type = \"openrouter\" as const;\n\n private getProvider(): ReturnType<typeof createOpenRouter> {\n const apiKey = this.getApiKey();\n if (!(typeof apiKey === \"string\" && apiKey !== \"\")) {\n throw new Error(\"OPENROUTER_API_KEY is not configured\");\n }\n return createOpenRouter({ apiKey });\n }\n\n public createLanguageModel(modelId: string): LanguageModelV4 {\n const provider = this.getProvider();\n return provider.chat(modelId);\n }\n\n // OpenRouter generates images through multimodal language models.\n public readonly createImageModel = null;\n\n public readonly createVideoModel = null;\n\n private getApiKey(): string | undefined {\n return this.env.OPENROUTER_API_KEY;\n }\n\n public async fetchModels(): Promise<AiGatewayModel[]> {\n const apiKey = this.getApiKey();\n\n if (!(typeof apiKey === \"string\" && apiKey !== \"\")) {\n this.log.warn(\"No OPENROUTER_API_KEY found, using fallback models\");\n return [...this.getFallbackModels(this.type)];\n }\n\n const url = OPENROUTER_MODELS_URL;\n this.log.debug({ url }, \"Fetching models from OpenRouter\");\n\n try {\n const response = await this.fetch(url, {\n headers: {\n Authorization: `Bearer ${apiKey}`,\n \"Content-Type\": \"application/json\",\n },\n });\n\n if (!response.ok) {\n this.log.error(\n { status: response.status, statusText: response.statusText, url },\n \"OpenRouter returned non-OK response\"\n );\n throw new Error(`Failed to fetch models: ${response.statusText}`);\n }\n\n const result = parseProviderModels(await response.json());\n\n this.log.info(\n { modelCount: result.length },\n \"Successfully fetched models from OpenRouter\"\n );\n return result;\n } catch (error) {\n this.log.error(\n { err: error, url },\n \"Error fetching models from OpenRouter, falling back to generated models\"\n );\n return [...this.getFallbackModels(this.type)];\n }\n }\n}\nexport { OpenRouterGateway as Gateway, OpenRouterGateway };\n",
|
|
14
13
|
"type": "registry:file",
|
|
15
14
|
"target": "~/chatjs/providers/gateway.ts"
|
|
16
15
|
}
|
|
@@ -1037,7 +1037,7 @@
|
|
|
1037
1037
|
"name": "guest-chat",
|
|
1038
1038
|
"description": "Disposable text chat for visitors with isolated sessions and bounded cleanup",
|
|
1039
1039
|
"dependencies": [
|
|
1040
|
-
"ai@7.0.
|
|
1040
|
+
"ai@7.0.172",
|
|
1041
1041
|
"drizzle-orm@^0.45.1",
|
|
1042
1042
|
"zod@4.5.4"
|
|
1043
1043
|
],
|
|
@@ -1508,7 +1508,7 @@
|
|
|
1508
1508
|
"name": "mcp",
|
|
1509
1509
|
"description": "MCP connectors, management pages, OAuth and composer control",
|
|
1510
1510
|
"dependencies": [
|
|
1511
|
-
"@ai-sdk/mcp@2.0.
|
|
1511
|
+
"@ai-sdk/mcp@2.0.99",
|
|
1512
1512
|
"@hookform/resolvers@^5.2.1",
|
|
1513
1513
|
"@modelcontextprotocol/sdk@^1.24.3",
|
|
1514
1514
|
"@tanstack/react-query@^5.104.1",
|
|
@@ -1898,8 +1898,8 @@
|
|
|
1898
1898
|
"name": "vercel-gateway",
|
|
1899
1899
|
"title": "Vercel AI Gateway",
|
|
1900
1900
|
"dependencies": [
|
|
1901
|
-
"@
|
|
1902
|
-
"@
|
|
1901
|
+
"@ai-sdk/gateway@4.0.145",
|
|
1902
|
+
"zod@4.5.4"
|
|
1903
1903
|
],
|
|
1904
1904
|
"files": [
|
|
1905
1905
|
{
|
|
@@ -1970,8 +1970,7 @@
|
|
|
1970
1970
|
"name": "openai-gateway",
|
|
1971
1971
|
"title": "OpenAI",
|
|
1972
1972
|
"dependencies": [
|
|
1973
|
-
"@
|
|
1974
|
-
"@ai-sdk/openai@4.0.59",
|
|
1973
|
+
"@ai-sdk/openai@4.0.117",
|
|
1975
1974
|
"zod@4.5.4"
|
|
1976
1975
|
],
|
|
1977
1976
|
"files": [
|
|
@@ -2033,8 +2032,7 @@
|
|
|
2033
2032
|
"name": "openai-compatible-gateway",
|
|
2034
2033
|
"title": "OpenAI Compatible",
|
|
2035
2034
|
"dependencies": [
|
|
2036
|
-
"@
|
|
2037
|
-
"@ai-sdk/openai-compatible@3.0.44",
|
|
2035
|
+
"@ai-sdk/openai-compatible@3.0.92",
|
|
2038
2036
|
"zod@4.5.4"
|
|
2039
2037
|
],
|
|
2040
2038
|
"files": [
|
|
@@ -2098,7 +2096,6 @@
|
|
|
2098
2096
|
"name": "openrouter-gateway",
|
|
2099
2097
|
"title": "OpenRouter",
|
|
2100
2098
|
"dependencies": [
|
|
2101
|
-
"@chat-js/gateways@0.2.1",
|
|
2102
2099
|
"@openrouter/ai-sdk-provider@3.0.0",
|
|
2103
2100
|
"zod@4.5.4"
|
|
2104
2101
|
],
|
|
@@ -2168,8 +2165,7 @@
|
|
|
2168
2165
|
"name": "litellm-gateway",
|
|
2169
2166
|
"title": "LiteLLM",
|
|
2170
2167
|
"dependencies": [
|
|
2171
|
-
"@
|
|
2172
|
-
"@ai-sdk/openai-compatible@3.0.44"
|
|
2168
|
+
"@ai-sdk/openai-compatible@3.0.92"
|
|
2173
2169
|
],
|
|
2174
2170
|
"files": [
|
|
2175
2171
|
{
|
|
@@ -2231,7 +2227,7 @@
|
|
|
2231
2227
|
"title": "Automatic",
|
|
2232
2228
|
"description": "EVE selects Vercel on Vercel, Docker when available, or a simulated shell in development.",
|
|
2233
2229
|
"dependencies": [
|
|
2234
|
-
"eve@npm:@chat-js/eve@1.
|
|
2230
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2235
2231
|
],
|
|
2236
2232
|
"files": [
|
|
2237
2233
|
{
|
|
@@ -2264,7 +2260,7 @@
|
|
|
2264
2260
|
"title": "Vercel Sandbox",
|
|
2265
2261
|
"description": "Hosted sandbox with native Python and Node processes.",
|
|
2266
2262
|
"dependencies": [
|
|
2267
|
-
"eve@npm:@chat-js/eve@1.
|
|
2263
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2268
2264
|
],
|
|
2269
2265
|
"files": [
|
|
2270
2266
|
{
|
|
@@ -2311,7 +2307,7 @@
|
|
|
2311
2307
|
"title": "Docker",
|
|
2312
2308
|
"description": "Containers on a reachable Docker host, with native Python and Node processes.",
|
|
2313
2309
|
"dependencies": [
|
|
2314
|
-
"eve@npm:@chat-js/eve@1.
|
|
2310
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2315
2311
|
],
|
|
2316
2312
|
"files": [
|
|
2317
2313
|
{
|
|
@@ -2344,7 +2340,7 @@
|
|
|
2344
2340
|
"title": "just-bash",
|
|
2345
2341
|
"description": "Simulated shell and filesystem. Cannot run native Python or Node processes.",
|
|
2346
2342
|
"dependencies": [
|
|
2347
|
-
"eve@npm:@chat-js/eve@1.
|
|
2343
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2348
2344
|
],
|
|
2349
2345
|
"files": [
|
|
2350
2346
|
{
|
|
@@ -2373,7 +2369,7 @@
|
|
|
2373
2369
|
"name": "generate-video",
|
|
2374
2370
|
"description": "Generate videos using the selected gateway and storage",
|
|
2375
2371
|
"dependencies": [
|
|
2376
|
-
"ai@7.0.
|
|
2372
|
+
"ai@7.0.172",
|
|
2377
2373
|
"zod@4.5.4"
|
|
2378
2374
|
],
|
|
2379
2375
|
"files": [
|
|
@@ -2443,7 +2439,7 @@
|
|
|
2443
2439
|
"name": "generate-image",
|
|
2444
2440
|
"description": "Generate and edit images using the selected gateway and storage",
|
|
2445
2441
|
"dependencies": [
|
|
2446
|
-
"ai@7.0.
|
|
2442
|
+
"ai@7.0.172",
|
|
2447
2443
|
"zod@4.5.4",
|
|
2448
2444
|
"lucide-react@0.553.0"
|
|
2449
2445
|
],
|
|
@@ -2539,7 +2535,7 @@
|
|
|
2539
2535
|
"name": "attach-workspace-file",
|
|
2540
2536
|
"description": "Attach workspace files to the conversation as downloads, or import earlier files into the workspace for revision.",
|
|
2541
2537
|
"dependencies": [
|
|
2542
|
-
"eve@npm:@chat-js/eve@1.
|
|
2538
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0",
|
|
2543
2539
|
"zod@4.5.4",
|
|
2544
2540
|
"lucide-react@0.553.0"
|
|
2545
2541
|
],
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"name": "vercel-gateway",
|
|
4
4
|
"title": "Vercel AI Gateway",
|
|
5
5
|
"dependencies": [
|
|
6
|
-
"@
|
|
7
|
-
"@
|
|
6
|
+
"@ai-sdk/gateway@4.0.145",
|
|
7
|
+
"zod@4.5.4"
|
|
8
8
|
],
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/gateways/vercel/gateway.ts",
|
|
12
|
-
"content": "import type {\n Experimental_VideoModelV4,\n LanguageModelV4,\n} from \"@ai-sdk/provider\";\nimport {\n
|
|
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 | undefined {\n const apiKey = this.env.AI_GATEWAY_API_KEY;\n\n if (typeof apiKey === \"string\" && apiKey !== \"\") {\n return apiKey;\n }\n return this.env.VERCEL_OIDC_TOKEN;\n }\n\n public async fetchModels(): Promise<AiGatewayModel[]> {\n const apiKey = this.getApiKey();\n\n if (!(typeof apiKey === \"string\" && apiKey !== \"\")) {\n this.log.warn(\"No AI gateway API key found, using fallback models\");\n return [...this.getFallbackModels(this.type)];\n }\n\n const url = \"https://ai-gateway.vercel.sh/v1/models\";\n this.log.debug({ url }, \"Fetching models from Vercel AI Gateway\");\n\n try {\n const response = await this.fetch(url, {\n headers: {\n Authorization: `Bearer ${apiKey}`,\n \"Content-Type\": \"application/json\",\n },\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 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
13
|
"type": "registry:file",
|
|
14
14
|
"target": "~/chatjs/providers/gateway.ts"
|
|
15
15
|
}
|
package/dist/r/registry.json
CHANGED
|
@@ -1037,7 +1037,7 @@
|
|
|
1037
1037
|
"name": "guest-chat",
|
|
1038
1038
|
"description": "Disposable text chat for visitors with isolated sessions and bounded cleanup",
|
|
1039
1039
|
"dependencies": [
|
|
1040
|
-
"ai@7.0.
|
|
1040
|
+
"ai@7.0.172",
|
|
1041
1041
|
"drizzle-orm@^0.45.1",
|
|
1042
1042
|
"zod@4.5.4"
|
|
1043
1043
|
],
|
|
@@ -1508,7 +1508,7 @@
|
|
|
1508
1508
|
"name": "mcp",
|
|
1509
1509
|
"description": "MCP connectors, management pages, OAuth and composer control",
|
|
1510
1510
|
"dependencies": [
|
|
1511
|
-
"@ai-sdk/mcp@2.0.
|
|
1511
|
+
"@ai-sdk/mcp@2.0.99",
|
|
1512
1512
|
"@hookform/resolvers@^5.2.1",
|
|
1513
1513
|
"@modelcontextprotocol/sdk@^1.24.3",
|
|
1514
1514
|
"@tanstack/react-query@^5.104.1",
|
|
@@ -1898,8 +1898,8 @@
|
|
|
1898
1898
|
"name": "vercel-gateway",
|
|
1899
1899
|
"title": "Vercel AI Gateway",
|
|
1900
1900
|
"dependencies": [
|
|
1901
|
-
"@
|
|
1902
|
-
"@
|
|
1901
|
+
"@ai-sdk/gateway@4.0.145",
|
|
1902
|
+
"zod@4.5.4"
|
|
1903
1903
|
],
|
|
1904
1904
|
"files": [
|
|
1905
1905
|
{
|
|
@@ -1970,8 +1970,7 @@
|
|
|
1970
1970
|
"name": "openai-gateway",
|
|
1971
1971
|
"title": "OpenAI",
|
|
1972
1972
|
"dependencies": [
|
|
1973
|
-
"@
|
|
1974
|
-
"@ai-sdk/openai@4.0.59",
|
|
1973
|
+
"@ai-sdk/openai@4.0.117",
|
|
1975
1974
|
"zod@4.5.4"
|
|
1976
1975
|
],
|
|
1977
1976
|
"files": [
|
|
@@ -2033,8 +2032,7 @@
|
|
|
2033
2032
|
"name": "openai-compatible-gateway",
|
|
2034
2033
|
"title": "OpenAI Compatible",
|
|
2035
2034
|
"dependencies": [
|
|
2036
|
-
"@
|
|
2037
|
-
"@ai-sdk/openai-compatible@3.0.44",
|
|
2035
|
+
"@ai-sdk/openai-compatible@3.0.92",
|
|
2038
2036
|
"zod@4.5.4"
|
|
2039
2037
|
],
|
|
2040
2038
|
"files": [
|
|
@@ -2098,7 +2096,6 @@
|
|
|
2098
2096
|
"name": "openrouter-gateway",
|
|
2099
2097
|
"title": "OpenRouter",
|
|
2100
2098
|
"dependencies": [
|
|
2101
|
-
"@chat-js/gateways@0.2.1",
|
|
2102
2099
|
"@openrouter/ai-sdk-provider@3.0.0",
|
|
2103
2100
|
"zod@4.5.4"
|
|
2104
2101
|
],
|
|
@@ -2168,8 +2165,7 @@
|
|
|
2168
2165
|
"name": "litellm-gateway",
|
|
2169
2166
|
"title": "LiteLLM",
|
|
2170
2167
|
"dependencies": [
|
|
2171
|
-
"@
|
|
2172
|
-
"@ai-sdk/openai-compatible@3.0.44"
|
|
2168
|
+
"@ai-sdk/openai-compatible@3.0.92"
|
|
2173
2169
|
],
|
|
2174
2170
|
"files": [
|
|
2175
2171
|
{
|
|
@@ -2231,7 +2227,7 @@
|
|
|
2231
2227
|
"title": "Automatic",
|
|
2232
2228
|
"description": "EVE selects Vercel on Vercel, Docker when available, or a simulated shell in development.",
|
|
2233
2229
|
"dependencies": [
|
|
2234
|
-
"eve@npm:@chat-js/eve@1.
|
|
2230
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2235
2231
|
],
|
|
2236
2232
|
"files": [
|
|
2237
2233
|
{
|
|
@@ -2264,7 +2260,7 @@
|
|
|
2264
2260
|
"title": "Vercel Sandbox",
|
|
2265
2261
|
"description": "Hosted sandbox with native Python and Node processes.",
|
|
2266
2262
|
"dependencies": [
|
|
2267
|
-
"eve@npm:@chat-js/eve@1.
|
|
2263
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2268
2264
|
],
|
|
2269
2265
|
"files": [
|
|
2270
2266
|
{
|
|
@@ -2311,7 +2307,7 @@
|
|
|
2311
2307
|
"title": "Docker",
|
|
2312
2308
|
"description": "Containers on a reachable Docker host, with native Python and Node processes.",
|
|
2313
2309
|
"dependencies": [
|
|
2314
|
-
"eve@npm:@chat-js/eve@1.
|
|
2310
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2315
2311
|
],
|
|
2316
2312
|
"files": [
|
|
2317
2313
|
{
|
|
@@ -2344,7 +2340,7 @@
|
|
|
2344
2340
|
"title": "just-bash",
|
|
2345
2341
|
"description": "Simulated shell and filesystem. Cannot run native Python or Node processes.",
|
|
2346
2342
|
"dependencies": [
|
|
2347
|
-
"eve@npm:@chat-js/eve@1.
|
|
2343
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0"
|
|
2348
2344
|
],
|
|
2349
2345
|
"files": [
|
|
2350
2346
|
{
|
|
@@ -2373,7 +2369,7 @@
|
|
|
2373
2369
|
"name": "generate-video",
|
|
2374
2370
|
"description": "Generate videos using the selected gateway and storage",
|
|
2375
2371
|
"dependencies": [
|
|
2376
|
-
"ai@7.0.
|
|
2372
|
+
"ai@7.0.172",
|
|
2377
2373
|
"zod@4.5.4"
|
|
2378
2374
|
],
|
|
2379
2375
|
"files": [
|
|
@@ -2443,7 +2439,7 @@
|
|
|
2443
2439
|
"name": "generate-image",
|
|
2444
2440
|
"description": "Generate and edit images using the selected gateway and storage",
|
|
2445
2441
|
"dependencies": [
|
|
2446
|
-
"ai@7.0.
|
|
2442
|
+
"ai@7.0.172",
|
|
2447
2443
|
"zod@4.5.4",
|
|
2448
2444
|
"lucide-react@0.553.0"
|
|
2449
2445
|
],
|
|
@@ -2539,7 +2535,7 @@
|
|
|
2539
2535
|
"name": "attach-workspace-file",
|
|
2540
2536
|
"description": "Attach workspace files to the conversation as downloads, or import earlier files into the workspace for revision.",
|
|
2541
2537
|
"dependencies": [
|
|
2542
|
-
"eve@npm:@chat-js/eve@1.
|
|
2538
|
+
"eve@npm:@chat-js/eve@1.1.1-chatjs.0",
|
|
2543
2539
|
"zod@4.5.4",
|
|
2544
2540
|
"lucide-react@0.553.0"
|
|
2545
2541
|
],
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"name": "vercel-gateway",
|
|
4
4
|
"title": "Vercel AI Gateway",
|
|
5
5
|
"dependencies": [
|
|
6
|
-
"@
|
|
7
|
-
"@
|
|
6
|
+
"@ai-sdk/gateway@4.0.145",
|
|
7
|
+
"zod@4.5.4"
|
|
8
8
|
],
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/gateways/vercel/gateway.ts",
|
|
12
|
-
"content": "import type {\n Experimental_VideoModelV4,\n LanguageModelV4,\n} from \"@ai-sdk/provider\";\nimport {\n
|
|
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 | undefined {\n const apiKey = this.env.AI_GATEWAY_API_KEY;\n\n if (typeof apiKey === \"string\" && apiKey !== \"\") {\n return apiKey;\n }\n return this.env.VERCEL_OIDC_TOKEN;\n }\n\n public async fetchModels(): Promise<AiGatewayModel[]> {\n const apiKey = this.getApiKey();\n\n if (!(typeof apiKey === \"string\" && apiKey !== \"\")) {\n this.log.warn(\"No AI gateway API key found, using fallback models\");\n return [...this.getFallbackModels(this.type)];\n }\n\n const url = \"https://ai-gateway.vercel.sh/v1/models\";\n this.log.debug({ url }, \"Fetching models from Vercel AI Gateway\");\n\n try {\n const response = await this.fetch(url, {\n headers: {\n Authorization: `Bearer ${apiKey}`,\n \"Content-Type\": \"application/json\",\n },\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 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
13
|
"type": "registry:file",
|
|
14
14
|
"target": "~/chatjs/providers/gateway.ts"
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat-js/registry",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ChatJS tool and gateway registry items",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"test:types": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
|
|
37
37
|
"test:unit": "bun test src",
|
|
38
38
|
"test:native": "bun run build && bun test --timeout 180000 test/native-eve.test.ts",
|
|
39
|
-
"test:installation": "bunx turbo run build --filter=@chat-js/
|
|
39
|
+
"test:installation": "bunx turbo run build --filter=@chat-js/thread && bun run --cwd ../cli template:sync && bun test --timeout 60000 test/installation-validation.test.ts",
|
|
40
40
|
"profile:validation": "bun scripts/validation-profile.ts",
|
|
41
41
|
"test:visual": "vitest run --config visual/vitest.config.ts",
|
|
42
42
|
"check": "bun run test:types && bun run test:unit && bun run test:visual",
|
|
@@ -46,15 +46,14 @@
|
|
|
46
46
|
"demo:sync": "bun scripts/demo-sync.ts"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@ai-sdk/anthropic": "4.0.
|
|
50
|
-
"@ai-sdk/gateway": "4.0.
|
|
51
|
-
"@ai-sdk/google": "4.0.
|
|
52
|
-
"@ai-sdk/mcp": "2.0.
|
|
53
|
-
"@ai-sdk/openai": "4.0.
|
|
54
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
55
|
-
"@ai-sdk/provider": "4.0.
|
|
49
|
+
"@ai-sdk/anthropic": "4.0.104",
|
|
50
|
+
"@ai-sdk/gateway": "4.0.145",
|
|
51
|
+
"@ai-sdk/google": "4.0.120",
|
|
52
|
+
"@ai-sdk/mcp": "2.0.99",
|
|
53
|
+
"@ai-sdk/openai": "4.0.117",
|
|
54
|
+
"@ai-sdk/openai-compatible": "3.0.92",
|
|
55
|
+
"@ai-sdk/provider": "4.0.38",
|
|
56
56
|
"@better-auth/electron": "1.6.2",
|
|
57
|
-
"@chat-js/gateways": "workspace:*",
|
|
58
57
|
"@chat-js/registry-validation": "workspace:*",
|
|
59
58
|
"@hookform/resolvers": "^5.2.1",
|
|
60
59
|
"@lexical/react": "^0.32.1",
|
|
@@ -72,14 +71,14 @@
|
|
|
72
71
|
"@types/react-dom": "19.2.3",
|
|
73
72
|
"@vercel/blob": "2.4.0",
|
|
74
73
|
"@vercel/oidc": "3.2.0",
|
|
75
|
-
"ai": "7.0.
|
|
74
|
+
"ai": "7.0.172",
|
|
76
75
|
"ajv": "8.18.0",
|
|
77
76
|
"basic-ftp": "^5.0.5",
|
|
78
77
|
"better-auth": "1.6.2",
|
|
79
78
|
"browser-image-compression": "^2.0.2",
|
|
80
79
|
"date-fns": "^4.1.0",
|
|
81
80
|
"drizzle-orm": "^0.45.1",
|
|
82
|
-
"eve": "npm:@chat-js/eve@1.
|
|
81
|
+
"eve": "npm:@chat-js/eve@1.1.1-chatjs.0",
|
|
83
82
|
"files-sdk": "2.5.0",
|
|
84
83
|
"geist": "^1.7.2",
|
|
85
84
|
"guarded-fetch": "^0.1.4",
|