This commit is contained in:
Dax Raad
2025-10-14 14:56:21 -04:00
parent 289783f627
commit 61f6091de1
6 changed files with 23 additions and 24 deletions

View File

@@ -36,7 +36,7 @@
},
"packages/console/core": {
"name": "@opencode-ai/console-core",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@aws-sdk/client-sts": "3.782.0",
"@jsx-email/render": "1.1.1",
@@ -62,7 +62,7 @@
},
"packages/console/function": {
"name": "@opencode-ai/console-function",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@ai-sdk/anthropic": "2.0.0",
"@ai-sdk/openai": "2.0.2",
@@ -85,7 +85,7 @@
},
"packages/console/mail": {
"name": "@opencode-ai/console-mail",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@jsx-email/all": "2.2.3",
"@jsx-email/cli": "1.4.3",
@@ -106,18 +106,18 @@
},
"packages/console/scripts": {
"name": "@opencode-ai/console-scripts",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@opencode-ai/console-core": "workspace:*",
},
},
"packages/css": {
"name": "@opencode-ai/css",
"version": "0.15.3",
"version": "0.0.0-202510141852",
},
"packages/desktop": {
"name": "@opencode-ai/desktop",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@kobalte/core": "catalog:",
"@opencode-ai/sdk": "workspace:*",
@@ -153,7 +153,7 @@
},
"packages/function": {
"name": "@opencode-ai/function",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@octokit/auth-app": "8.0.1",
"@octokit/rest": "22.0.0",
@@ -168,7 +168,7 @@
},
"packages/opencode": {
"name": "opencode",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"bin": {
"opencode": "./bin/opencode",
},
@@ -224,7 +224,7 @@
},
"packages/plugin": {
"name": "@opencode-ai/plugin",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@opencode-ai/sdk": "workspace:*",
"zod": "catalog:",
@@ -243,7 +243,7 @@
},
"packages/sdk/js": {
"name": "@opencode-ai/sdk",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"devDependencies": {
"@hey-api/openapi-ts": "0.81.0",
"@tsconfig/node22": "catalog:",
@@ -253,7 +253,7 @@
},
"packages/slack": {
"name": "@opencode-ai/slack",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@opencode-ai/sdk": "workspace:*",
"@slack/bolt": "^3.17.1",
@@ -265,7 +265,7 @@
},
"packages/ui": {
"name": "@opencode-ai/ui",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@kobalte/core": "catalog:",
"@opencode-ai/css": "workspace:*",
@@ -280,7 +280,7 @@
},
"packages/web": {
"name": "@opencode-ai/web",
"version": "0.15.3",
"version": "0.0.0-202510141852",
"dependencies": {
"@astrojs/cloudflare": "12.6.3",
"@astrojs/markdown-remark": "6.3.1",

View File

@@ -156,8 +156,7 @@ export const TuiCommand = cmd({
})
;(async () => {
if (Installation.isDev()) return
if (Installation.isPreview()) return
if (Installation.isLocal()) return
const config = await Config.global()
if (config.autoupdate === false || Flag.OPENCODE_DISABLE_AUTOUPDATE) return
const latest = await Installation.latest().catch(() => {})
@@ -214,7 +213,7 @@ function getOpencodeCommand(): string[] {
const execPath = process.execPath.toLowerCase()
if (Installation.isDev()) {
if (Installation.isLocal()) {
// In development, use bun to run the TypeScript entry point
return [execPath, "run", process.argv[1]]
}

View File

@@ -138,7 +138,7 @@ export namespace Config {
}
async function installDependencies(dir: string) {
if (Installation.isDev()) return
if (Installation.isLocal()) return
const pkg = path.join(dir, "package.json")
@@ -151,7 +151,7 @@ export namespace Config {
if (!hasGitIgnore) await Bun.write(gitignore, ["node_modules", "package.json", "bun.lock", ".gitignore"].join("\n"))
await BunProc.run(
["add", "@opencode-ai/plugin@" + (Installation.isDev() ? "latest" : Installation.VERSION), "--exact"],
["add", "@opencode-ai/plugin@" + (Installation.isLocal() ? "latest" : Installation.VERSION), "--exact"],
{
cwd: dir,
},

View File

@@ -51,10 +51,10 @@ const cli = yargs(hideBin(process.argv))
.middleware(async (opts) => {
await Log.init({
print: process.argv.includes("--print-logs"),
dev: Installation.isDev(),
dev: Installation.isLocal(),
level: (() => {
if (opts.logLevel) return opts.logLevel as Log.Level
if (Installation.isDev()) return "DEBUG"
if (Installation.isLocal()) return "DEBUG"
return "INFO"
})(),
})

View File

@@ -42,11 +42,11 @@ export namespace Installation {
}
export function isPreview() {
return VERSION.startsWith("0.0.0")
return CHANNEL !== "latest"
}
export function isDev() {
return VERSION === "dev"
export function isLocal() {
return typeof OPENCODE_CHANNEL !== "string"
}
export async function method() {

View File

@@ -67,7 +67,7 @@ export namespace Share {
export const URL =
process.env["OPENCODE_API"] ??
(Installation.isPreview() || Installation.isDev() ? "https://api.dev.opencode.ai" : "https://api.opencode.ai")
(Installation.isPreview() || Installation.isLocal() ? "https://api.dev.opencode.ai" : "https://api.opencode.ai")
export async function create(sessionID: string) {
return fetch(`${URL}/share_create`, {