Kaynağa Gözat

vercel ai gateway

Dax Raad 7 ay önce
ebeveyn
işleme
4bbbbac5f6

+ 7 - 1
packages/opencode/src/cli/cmd/auth.ts

@@ -78,6 +78,8 @@ export const AuthLoginCommand = cmd({
       "github-copilot": 1,
       openai: 2,
       google: 3,
+      openrouter: 4,
+      vercel: 5,
     }
     let provider = await prompts.select({
       message: "Select provider",
@@ -108,7 +110,7 @@ export const AuthLoginCommand = cmd({
     if (provider === "other") {
       provider = await prompts.text({
         message: "Enter provider id",
-        validate: (x) => (x.match(/^[a-z-]+$/) ? undefined : "a-z and hyphens only"),
+        validate: (x) => (x.match(/^[0-9a-z-]+$/) ? undefined : "a-z, 0-9 and hyphens only"),
       })
       if (prompts.isCancel(provider)) throw new UI.CancelledError()
       provider = provider.replace(/^@ai-sdk\//, "")
@@ -265,6 +267,10 @@ export const AuthLoginCommand = cmd({
       return
     }
 
+    if (provider === "vercel") {
+      prompts.log.info("You can create an api key in the dashboard")
+    }
+
     const key = await prompts.password({
       message: "Enter your API key",
       validate: (x) => (x.length > 0 ? undefined : "Required"),

+ 1 - 1
packages/opencode/src/global/index.ts

@@ -27,7 +27,7 @@ await Promise.all([
   fs.mkdir(Global.Path.state, { recursive: true }),
 ])
 
-const CACHE_VERSION = "2"
+const CACHE_VERSION = "3"
 
 const version = await Bun.file(path.join(Global.Path.cache, "version"))
   .text()