We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4407d5d commit 4d6e2d8Copy full SHA for 4d6e2d8
packages/opencode/src/installation/index.ts
@@ -142,7 +142,9 @@ export namespace Installation {
142
export const USER_AGENT = `opencode/${CHANNEL}/${VERSION}`
143
144
export async function latest() {
145
- return fetch(`https://registry.npmjs.org/opencode-ai/${CHANNEL}`)
+ const [major] = VERSION.split(".").map((x) => Number(x))
146
+ const channel = CHANNEL === "latest" ? `latest-${major}` : CHANNEL
147
+ return fetch(`https://registry.npmjs.org/opencode-ai/${channel}`)
148
.then((res) => {
149
if (!res.ok) throw new Error(res.statusText)
150
return res.json()
0 commit comments