GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — v2 message format and upgrade to ai sdk v5 (#743) · kennyg/opencode@f884766

This repository was archived by the owner on Jul 27, 2025. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • stats.yml
  • bun.lock
  • package.json
  • packages
    • function/src
      • api.ts
    • opencode
      • script
        • publish.ts
      • src
        • app
          • app.ts
        • auth
          • anthropic.ts
          • copilot.ts
          • github-copilot.ts
        • bun
          • index.ts
        • bus
          • index.ts
        • cli
          • bootstrap.ts
          • cmd
            • auth.ts
            • debug
              • file.ts
              • index.ts
              • lsp.ts
              • ripgrep.ts
              • snapshot.ts
            • generate.ts
            • run.ts
            • serve.ts
            • tui.ts
            • upgrade.ts
          • error.ts
        • config
          • config.ts
          • hooks.ts
        • file
          • fzf.ts
          • index.ts
          • ripgrep.ts
          • time.ts
          • watch.ts
        • format
          • formatter.ts
        • id
          • id.ts
        • index.ts
        • installation
          • index.ts
        • lsp
          • client.ts
          • index.ts
          • server.ts
        • provider
          • provider.ts
          • transform.ts
        • server
          • server.ts
        • session
          • index.ts
          • message-v2.ts
          • message.ts
        • share
          • share.ts
        • snapshot
          • index.ts
        • storage
          • storage.ts
        • tool
          • bash.ts
          • edit.ts
          • glob.ts
          • grep.ts
          • ls.ts
          • lsp-diagnostics.ts
          • lsp-hover.ts
          • multiedit.ts
          • patch.ts
          • read.ts
          • task.ts
          • todo.ts
          • tool.ts
          • webfetch.ts
          • write.ts
        • util
          • error.ts
          • log.ts
      • test/tool
        • edit.test.ts
        • tool.test.ts
    • tui
      • go.mod
      • internal
        • app
          • app.go
        • components
          • chat
            • editor.go
            • message.go
            • messages.go
          • status
            • status.go
        • tui
          • tui.go
      • sdk
        • .github/workflows
          • ci.yml
        • .release-please-manifest.json
        • .stats.yml
        • CHANGELOG.md
        • api.md
        • event.go
        • release-please-config.json
        • session.go
        • session_test.go
        • shared
          • shared.go
    • web
      • astro.config.mjs
      • package.json
      • public
        • theme.json
      • src
        • components
          • CodeBlock.tsx
          • MarkdownView.tsx
          • Share.tsx
          • codeblock.module.css
          • diffview.module.css
          • icons
            • custom.tsx
            • index.tsx
          • markdownview.module.css
          • share.module.css
          • share
            • common.tsx
            • content-code.module.css
            • content-code.tsx
            • content-diff.module.css
            • content-diff.tsx
            • content-markdown.module.css
            • content-markdown.tsx
            • content-text.module.css
            • content-text.tsx
            • part.module.css
            • part.tsx
        • content/docs/docs
          • cli.mdx
          • config.mdx
          • index.mdx
          • rules.mdx
          • themes.mdx
        • types
          • lang-map.d.ts
      • sst-env.d.ts
  • scripts
    • stats.ts
  • sst-env.d.ts
  • stainless.yml

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/stats.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/stats.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ jobs:
2828
git config --local user.email "[email protected]"
2929
git config --local user.name "GitHub Action"
3030
git add STATS.md
31-
git diff --staged --quiet || git commit -m "Update download stats $(date -I)"
31+
git diff --staged --quiet || git commit -m "ignore: update download stats $(date -I)"
3232
git push
Collapse file

‎bun.lock‎

Copy file name to clipboardExpand all lines: bun.lock
+28-30Lines changed: 28 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"catalog": {
1818
"typescript": "5.8.2",
1919
"@types/node": "22.13.9",
20-
"zod": "3.24.2",
21-
"ai": "4.3.16"
20+
"zod": "3.25.49",
21+
"ai": "5.0.0-beta.7"
2222
}
2323
},
2424
"devDependencies": {
@@ -31,10 +31,8 @@
3131
},
3232
"license": "MIT",
3333
"prettier": {
34-
"semi": false
35-
},
36-
"overrides": {
37-
"zod": "3.24.2"
34+
"semi": false,
35+
"printWidth": 120
3836
},
3937
"trustedDependencies": [
4038
"esbuild",
Collapse file

‎packages/function/src/api.ts‎

Copy file name to clipboardExpand all lines: packages/function/src/api.ts
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ export class SyncServer extends DurableObject<Env> {
3838

3939
async publish(key: string, content: any) {
4040
const sessionID = await this.getSessionID()
41-
if (
42-
!key.startsWith(`session/info/${sessionID}`) &&
43-
!key.startsWith(`session/message/${sessionID}/`)
44-
)
41+
if (!key.startsWith(`session/info/${sessionID}`) && !key.startsWith(`session/message/${sessionID}/`))
4542
return new Response("Error: Invalid key", { status: 400 })
4643

4744
// store message
@@ -184,17 +181,15 @@ export default {
184181
}
185182
const id = url.searchParams.get("id")
186183
console.log("share_poll", id)
187-
if (!id)
188-
return new Response("Error: Share ID is required", { status: 400 })
184+
if (!id) return new Response("Error: Share ID is required", { status: 400 })
189185
const stub = env.SYNC_SERVER.get(env.SYNC_SERVER.idFromName(id))
190186
return stub.fetch(request)
191187
}
192188

193189
if (request.method === "GET" && method === "share_data") {
194190
const id = url.searchParams.get("id")
195191
console.log("share_data", id)
196-
if (!id)
197-
return new Response("Error: Share ID is required", { status: 400 })
192+
if (!id) return new Response("Error: Share ID is required", { status: 400 })
198193
const stub = env.SYNC_SERVER.get(env.SYNC_SERVER.idFromName(id))
199194
const data = await stub.getData()
200195

Collapse file

‎packages/opencode/script/publish.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/script/publish.ts
+10-31Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ for (const [os, arch] of targets) {
5757
2,
5858
),
5959
)
60-
if (!dry)
61-
await $`cd dist/${name} && bun publish --access public --tag ${npmTag}`
60+
if (!dry) await $`cd dist/${name} && bun publish --access public --tag ${npmTag}`
6261
optionalDependencies[name] = version
6362
}
6463

@@ -82,24 +81,19 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write(
8281
2,
8382
),
8483
)
85-
if (!dry)
86-
await $`cd ./dist/${pkg.name} && bun publish --access public --tag ${npmTag}`
84+
if (!dry) await $`cd ./dist/${pkg.name} && bun publish --access public --tag ${npmTag}`
8785

8886
if (!snapshot) {
8987
// Github Release
9088
for (const key of Object.keys(optionalDependencies)) {
9189
await $`cd dist/${key}/bin && zip -r ../../${key}.zip *`
9290
}
9391

94-
const previous = await fetch(
95-
"https://api.github.com/repos/sst/opencode/releases/latest",
96-
)
92+
const previous = await fetch("https://api.github.com/repos/sst/opencode/releases/latest")
9793
.then((res) => res.json())
9894
.then((data) => data.tag_name)
9995

100-
const commits = await fetch(
101-
`https://api.github.com/repos/sst/opencode/compare/${previous}...HEAD`,
102-
)
96+
const commits = await fetch(`https://api.github.com/repos/sst/opencode/compare/${previous}...HEAD`)
10397
.then((res) => res.json())
10498
.then((data) => data.commits || [])
10599

@@ -117,26 +111,13 @@ if (!snapshot) {
117111
})
118112
.join("\n")
119113

120-
if (!dry)
121-
await $`gh release create v${version} --title "v${version}" --notes ${notes} ./dist/*.zip`
114+
if (!dry) await $`gh release create v${version} --title "v${version}" --notes ${notes} ./dist/*.zip`
122115

123116
// Calculate SHA values
124-
const arm64Sha =
125-
await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`
126-
.text()
127-
.then((x) => x.trim())
128-
const x64Sha =
129-
await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`
130-
.text()
131-
.then((x) => x.trim())
132-
const macX64Sha =
133-
await $`sha256sum ./dist/opencode-darwin-x64.zip | cut -d' ' -f1`
134-
.text()
135-
.then((x) => x.trim())
136-
const macArm64Sha =
137-
await $`sha256sum ./dist/opencode-darwin-arm64.zip | cut -d' ' -f1`
138-
.text()
139-
.then((x) => x.trim())
117+
const arm64Sha = await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
118+
const x64Sha = await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
119+
const macX64Sha = await $`sha256sum ./dist/opencode-darwin-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
120+
const macArm64Sha = await $`sha256sum ./dist/opencode-darwin-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
140121

141122
// AUR package
142123
const pkgbuild = [
@@ -170,9 +151,7 @@ if (!snapshot) {
170151
for (const pkg of ["opencode", "opencode-bin"]) {
171152
await $`rm -rf ./dist/aur-${pkg}`
172153
await $`git clone ssh://[email protected]/${pkg}.git ./dist/aur-${pkg}`
173-
await Bun.file(`./dist/aur-${pkg}/PKGBUILD`).write(
174-
pkgbuild.replace("${pkg}", pkg),
175-
)
154+
await Bun.file(`./dist/aur-${pkg}/PKGBUILD`).write(pkgbuild.replace("${pkg}", pkg))
176155
await $`cd ./dist/aur-${pkg} && makepkg --printsrcinfo > .SRCINFO`
177156
await $`cd ./dist/aur-${pkg} && git add PKGBUILD .SRCINFO`
178157
await $`cd ./dist/aur-${pkg} && git commit -m "Update to v${version}"`
Collapse file

‎packages/opencode/src/app/app.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/app/app.ts
+3-12Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,14 @@ export namespace App {
4545
}
4646

4747
export const provideExisting = ctx.provide
48-
export async function provide<T>(
49-
input: Input,
50-
cb: (app: App.Info) => Promise<T>,
51-
) {
48+
export async function provide<T>(input: Input, cb: (app: App.Info) => Promise<T>) {
5249
log.info("creating", {
5350
cwd: input.cwd,
5451
})
55-
const git = await Filesystem.findUp(".git", input.cwd).then(([x]) =>
56-
x ? path.dirname(x) : undefined,
57-
)
52+
const git = await Filesystem.findUp(".git", input.cwd).then(([x]) => (x ? path.dirname(x) : undefined))
5853
log.info("git", { git })
5954

60-
const data = path.join(
61-
Global.Path.data,
62-
"project",
63-
git ? directory(git) : "global",
64-
)
55+
const data = path.join(Global.Path.data, "project", git ? directory(git) : "global")
6556
const stateFile = Bun.file(path.join(data, APP_JSON))
6657
const state = (await stateFile.json().catch(() => ({}))) as {
6758
initialized: number
Collapse file

‎packages/opencode/src/auth/anthropic.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/auth/anthropic.ts
+12-21Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ export namespace AuthAnthropic {
1010
url.searchParams.set("code", "true")
1111
url.searchParams.set("client_id", CLIENT_ID)
1212
url.searchParams.set("response_type", "code")
13-
url.searchParams.set(
14-
"redirect_uri",
15-
"https://console.anthropic.com/oauth/code/callback",
16-
)
17-
url.searchParams.set(
18-
"scope",
19-
"org:create_api_key user:profile user:inference",
20-
)
13+
url.searchParams.set("redirect_uri", "https://console.anthropic.com/oauth/code/callback")
14+
url.searchParams.set("scope", "org:create_api_key user:profile user:inference")
2115
url.searchParams.set("code_challenge", pkce.challenge)
2216
url.searchParams.set("code_challenge_method", "S256")
2317
url.searchParams.set("state", pkce.verifier)
@@ -57,20 +51,17 @@ export namespace AuthAnthropic {
5751
const info = await Auth.get("anthropic")
5852
if (!info || info.type !== "oauth") return
5953
if (info.access && info.expires > Date.now()) return info.access
60-
const response = await fetch(
61-
"https://console.anthropic.com/v1/oauth/token",
62-
{
63-
method: "POST",
64-
headers: {
65-
"Content-Type": "application/json",
66-
},
67-
body: JSON.stringify({
68-
grant_type: "refresh_token",
69-
refresh_token: info.refresh,
70-
client_id: CLIENT_ID,
71-
}),
54+
const response = await fetch("https://console.anthropic.com/v1/oauth/token", {
55+
method: "POST",
56+
headers: {
57+
"Content-Type": "application/json",
7258
},
73-
)
59+
body: JSON.stringify({
60+
grant_type: "refresh_token",
61+
refresh_token: info.refresh,
62+
client_id: CLIENT_ID,
63+
}),
64+
})
7465
if (!response.ok) return
7566
const json = await response.json()
7667
await Auth.set("anthropic", {
Collapse file

‎packages/opencode/src/auth/copilot.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/auth/copilot.ts
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import path from "path"
44

55
export const AuthCopilot = lazy(async () => {
66
const file = Bun.file(path.join(Global.Path.state, "plugin", "copilot.ts"))
7-
const response = fetch(
8-
"https://raw.githubusercontent.com/sst/opencode-github-copilot/refs/heads/main/auth.ts",
9-
)
7+
const response = fetch("https://raw.githubusercontent.com/sst/opencode-github-copilot/refs/heads/main/auth.ts")
108
.then((x) => Bun.write(file, x))
119
.catch(() => {})
1210

Collapse file

‎packages/opencode/src/auth/github-copilot.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/auth/github-copilot.ts
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ export namespace AuthGithubCopilot {
122122
return tokenData.token
123123
}
124124

125-
export const DeviceCodeError = NamedError.create(
126-
"DeviceCodeError",
127-
z.object({}),
128-
)
125+
export const DeviceCodeError = NamedError.create("DeviceCodeError", z.object({}))
129126

130127
export const TokenExchangeError = NamedError.create(
131128
"TokenExchangeError",
Collapse file

‎packages/opencode/src/bun/index.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/bun/index.ts
+13-8Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import { readableStreamToText } from "bun"
88
export namespace BunProc {
99
const log = Log.create({ service: "bun" })
1010

11-
export async function run(
12-
cmd: string[],
13-
options?: Bun.SpawnOptions.OptionsObject<any, any, any>,
14-
) {
11+
export async function run(cmd: string[], options?: Bun.SpawnOptions.OptionsObject<any, any, any>) {
1512
log.info("running", {
1613
cmd: [which(), ...cmd],
1714
...options,
@@ -26,9 +23,17 @@ export namespace BunProc {
2623
BUN_BE_BUN: "1",
2724
},
2825
})
29-
const code = await result.exited;
30-
const stdout = result.stdout ? typeof result.stdout === "number" ? result.stdout : await readableStreamToText(result.stdout) : undefined
31-
const stderr = result.stderr ? typeof result.stderr === "number" ? result.stderr : await readableStreamToText(result.stderr) : undefined
26+
const code = await result.exited
27+
const stdout = result.stdout
28+
? typeof result.stdout === "number"
29+
? result.stdout
30+
: await readableStreamToText(result.stdout)
31+
: undefined
32+
const stderr = result.stderr
33+
? typeof result.stderr === "number"
34+
? result.stderr
35+
: await readableStreamToText(result.stderr)
36+
: undefined
3237
log.info("done", {
3338
code,
3439
stdout,
@@ -61,7 +66,7 @@ export namespace BunProc {
6166
if (parsed.dependencies[pkg] === version) return mod
6267
parsed.dependencies[pkg] = version
6368
await Bun.write(pkgjson, JSON.stringify(parsed, null, 2))
64-
await BunProc.run(["install", "--registry=https://registry.npmjs.org"], {
69+
await BunProc.run(["install", "--cwd", Global.Path.cache, "--registry=https://registry.npmjs.org"], {
6570
cwd: Global.Path.cache,
6671
}).catch((e) => {
6772
throw new InstallFailedError(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.