Dax Raad 9 месяцев назад
Родитель
Сommit
ec1c9f8cd1

+ 1 - 0
opencode.json

@@ -1,4 +1,5 @@
 {
   "$schema": "https://opencode.ai/config.json",
+  "keybinds": {},
   "mcp": {}
 }

+ 2 - 2
packages/opencode/script/postinstall.mjs

@@ -80,9 +80,9 @@ function main() {
 
     // Create symlink to the actual binary
     fs.symlinkSync(binaryPath, binScript)
-    console.log(`OpenCode binary symlinked: ${binScript} -> ${binaryPath}`)
+    console.log(`opencode binary symlinked: ${binScript} -> ${binaryPath}`)
   } catch (error) {
-    console.error("Failed to create OpenCode binary symlink:", error.message)
+    console.error("Failed to create opencode binary symlink:", error.message)
     process.exit(1)
   }
 }

+ 2 - 1
packages/opencode/src/cli/cmd/run.ts

@@ -20,11 +20,12 @@ const TOOL: Record<string, [string, string]> = {
   list: ["List", UI.Style.TEXT_INFO_BOLD],
   read: ["Read", UI.Style.TEXT_HIGHLIGHT_BOLD],
   write: ["Write", UI.Style.TEXT_SUCCESS_BOLD],
+  websearch: ["Search", UI.Style.TEXT_MUTED_BOLD],
 }
 
 export const RunCommand = cmd({
   command: "run [message..]",
-  describe: "Run OpenCode with a message",
+  describe: "Run opencode with a message",
   builder: (yargs: Argv) => {
     return yargs
       .positional("message", {

+ 4 - 0
packages/opencode/src/installation/index.ts

@@ -41,6 +41,10 @@ export namespace Installation {
     return VERSION.startsWith("0.0.0")
   }
 
+  export function isDev() {
+    return VERSION === "dev"
+  }
+
   export async function method() {
     if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl"
     const exec = process.execPath.toLowerCase()

+ 5 - 1
packages/opencode/src/share/share.ts

@@ -1,5 +1,6 @@
 import { App } from "../app/app"
 import { Bus } from "../bus"
+import { Installation } from "../installation"
 import { Session } from "../session"
 import { Storage } from "../storage/storage"
 import { Log } from "../util/log"
@@ -56,7 +57,10 @@ export namespace Share {
   }
 
   export const URL =
-    process.env["OPENCODE_API"] ?? "https://api.dev.opencode.ai"
+    process.env["OPENCODE_API"] ??
+    (Installation.isSnapshot() || Installation.isDev()
+      ? "https://api.dev.opencode.ai"
+      : "https://api.opencode.ai")
 
   export async function create(sessionID: string) {
     return fetch(`${URL}/share_create`, {

+ 1 - 1
packages/opencode/src/tool/websearch.txt

@@ -1,5 +1,5 @@
 
-- Allows OpenCode to search the web and use the results to inform responses
+- Allows opencode to search the web and use the results to inform responses
 - Provides up-to-date information for current events and recent data
 - Returns search result information formatted as search result blocks
 - Use this tool for accessing information beyond Claude's knowledge cutoff