File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export function Home() {
132132 </ box >
133133 < box flexGrow = { 1 } />
134134 < box flexShrink = { 0 } >
135- < text fg = { theme . textMuted } > { Installation . VERSION } </ text >
135+ < text fg = { theme . textMuted } > { Installation . DISPLAY_VERSION } </ text >
136136 </ box >
137137 </ box >
138138 </ >
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export function Header() {
116116 < box flexGrow = { 1 } flexShrink = { 1 } />
117117 < box flexDirection = "row" gap = { 1 } flexShrink = { 0 } >
118118 < ContextInfo context = { context } cost = { cost } />
119- < text fg = { theme . textMuted } > v { Installation . VERSION } </ text >
119+ < text fg = { theme . textMuted } > { Installation . DISPLAY_VERSION } </ text >
120120 </ box >
121121 </ box >
122122 </ Match >
@@ -125,7 +125,7 @@ export function Header() {
125125 < Title session = { session } />
126126 < box flexDirection = "row" gap = { 1 } flexShrink = { 0 } >
127127 < ContextInfo context = { context } cost = { cost } />
128- < text fg = { theme . textMuted } > v { Installation . VERSION } </ text >
128+ < text fg = { theme . textMuted } > { Installation . DISPLAY_VERSION } </ text >
129129 </ box >
130130 </ box >
131131 </ Match >
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ export function Sidebar(props: { sessionID: string; overlay?: boolean }) {
303303 < span style = { { fg : theme . text } } >
304304 < b > Code</ b >
305305 </ span > { " " }
306- < span > { Installation . VERSION } </ span >
306+ < span > { Installation . DISPLAY_VERSION } </ span >
307307 </ text >
308308 </ box >
309309 </ box >
Original file line number Diff line number Diff line change 11import { BusEvent } from "@/bus/bus-event"
22import path from "path"
3+ import fs from "fs"
34import { $ } from "bun"
45import z from "zod"
56import { NamedError } from "@opencode-ai/util/error"
67import { Log } from "../util/log"
78import { iife } from "@/util/iife"
89import { Flag } from "../flag/flag"
910
11+ function readBundleVersion ( ) : string | undefined {
12+ if ( ! Flag . OPENCODE_OFFLINE_DEPS_PATH ) return undefined
13+ try {
14+ // The manifest is in the parent directory of deps (bundle root)
15+ const bundleRoot = path . dirname ( Flag . OPENCODE_OFFLINE_DEPS_PATH )
16+ const manifestPath = path . join ( bundleRoot , "manifest.json" )
17+ const content = fs . readFileSync ( manifestPath , "utf-8" )
18+ const manifest = JSON . parse ( content )
19+ return manifest . bundleVersion
20+ } catch {
21+ return undefined
22+ }
23+ }
24+
1025declare global {
1126 const OPENCODE_VERSION : string
1227 const OPENCODE_CHANNEL : string
@@ -183,6 +198,9 @@ export namespace Installation {
183198 export const CHANNEL = typeof OPENCODE_CHANNEL === "string" ? OPENCODE_CHANNEL : "local"
184199 export const USER_AGENT = `opencode/${ CHANNEL } /${ VERSION } /${ Flag . OPENCODE_CLIENT } `
185200
201+ const BUNDLE_VERSION = readBundleVersion ( )
202+ export const DISPLAY_VERSION = BUNDLE_VERSION ? `offline-v${ BUNDLE_VERSION } ` : VERSION
203+
186204 export async function latest ( installMethod ?: Method ) {
187205 const detectedMethod = installMethod || ( await method ( ) )
188206
You can’t perform that action at this time.
0 commit comments