Compare commits

..

1 commit
dev ... v2.3.1

Author SHA1 Message Date
github-actions[bot]
c769de8300 release: v2.3.1 2026-11-17 22:53:34 +00:00
6747 changed files with 90809 additions and 1010644 deletions

17
.gitattributes vendored
View file

@ -7,24 +7,7 @@ packages/protocol/openapi.json linguist-generated
packages/client/src/promise/generated/** linguist-generated packages/client/src/promise/generated/** linguist-generated
packages/client/src/effect/generated/** linguist-generated packages/client/src/effect/generated/** linguist-generated
packages/client/src/effect/api/** linguist-generated packages/client/src/effect/api/** linguist-generated
# cli-rs: parity recordings and the files `script/gen` writes.
packages/cli-rs/parity/fixtures/** linguist-generated
packages/cli-rs/assets/queries/** linguist-generated
packages/cli-rs/crates/acp/src/permission/structured_patch.json linguist-generated
packages/cli-rs/crates/api-types/src/types.rs linguist-generated
packages/cli-rs/crates/api/src/generated/** linguist-generated
packages/cli-rs/crates/cli/src/run/mime.rs linguist-generated
packages/cli-rs/crates/cli/tests/fixtures/** linguist-generated
packages/cli-rs/crates/local/src/generated/** linguist-generated
packages/cli-rs/crates/mermaid/src/core/entities.rs linguist-generated
packages/cli-rs/crates/mermaid/src/core/wide.rs linguist-generated
packages/cli-rs/crates/ui/src/fuzzy/accents.rs linguist-generated
packages/cli-rs/crates/ui/src/keymap/generated.rs linguist-generated
packages/cli-rs/crates/ui/src/theme/generated/** linguist-generated
packages/cli-rs/crates/util/fixtures/time.tsv linguist-generated
packages/core/src/**/*.txt text eol=lf packages/core/src/**/*.txt text eol=lf
# test/opencode-api-skill.test.ts compares the generated API reference byte for byte, so Windows checkouts keep LF.
packages/core/src/plugin/skill/opencode/** text eol=lf
packages/httpapi-codegen/test/generated/*.ts text eol=lf packages/httpapi-codegen/test/generated/*.ts text eol=lf
# The site tests compare source text and humans.txt byte for byte, so Windows checkouts keep LF. # The site tests compare source text and humans.txt byte for byte, so Windows checkouts keep LF.
services/site/** text=auto eol=lf services/site/** text=auto eol=lf

View file

@ -11,6 +11,7 @@ kommander
ludvigrask ludvigrask
MrMushrooooom MrMushrooooom
neriousy neriousy
nexxeln
R44VC0RP R44VC0RP
rekram1-node rekram1-node
thdxr thdxr
@ -18,8 +19,4 @@ simonklee
Slickstef11 Slickstef11
usrnk1 usrnk1
vimtor vimtor
Tarquinen StarpTech
dc85
vaprdev
hearnadam
heimoshuiyu

View file

@ -1,53 +0,0 @@
#!/usr/bin/env bash
# backfill-blockmaps.sh <version>...: builds the .blockmap for each published Windows installer and macOS zip of
# the given stable versions from the signed files on opencode.ai/files and uploads it next to them. Releases before
# publish-desktop.sh built blockmaps shipped without them, so electron-updater could not update differentially
# from them. A blockmap that already exists is left alone; a file the version never shipped is skipped.
. "$(dirname "$0")/lib.sh"
actor=${GITHUB_TRIGGERING_ACTOR:-${GITHUB_ACTOR:-}}
if ! (shopt -s nocasematch; [[ "$actor" = thdxr || "$actor" = Hona || "$actor" = rekram1-node ]]); then
die "${actor:-An unknown actor} is not allowed to backfill release files"
fi
[ $# -gt 0 ] || die "No versions given"
for version in "$@"; do
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] && [[ "$version" != 0.0.0-* ]] ||
die "Invalid release version: $version"
done
names=(opencode-desktop-win-arm64.exe opencode-desktop-win-x64.exe opencode-desktop-mac-arm64.zip opencode-desktop-mac-x64.zip)
status() {
curl -sS -o /dev/null -w '%{http_code}' --head "$1"
}
credentials=false
for version in "$@"; do
dir=$(mktemp -d)
for name in "${names[@]}"; do
url="https://opencode.ai/files/bin/$version/$name"
case "$(status "$url.blockmap")" in
200) echo "$version/$name.blockmap exists" && continue ;;
404) ;;
*) die "Could not check $url.blockmap" ;;
esac
case "$(status "$url")" in
200) ;;
404) echo "$version/$name was not published" && continue ;;
*) die "Could not check $url" ;;
esac
curl -fsSL --retry 3 -o "$dir/$name" "$url"
node "$release_dir/blockmap.mjs" "$dir/$name"
if dry_run; then
echo "dry-run upload: bin/$version/$name.blockmap ($(size "$dir/$name.blockmap") bytes)"
continue
fi
if [ "$credentials" = false ]; then
r2_credentials
credentials=true
fi
OPENCODE_VERSION=$version upload_file "$dir/$name.blockmap" "$name.blockmap" application/octet-stream ||
die "Upload failed: $version/$name.blockmap"
echo "uploaded bin/$version/$name.blockmap"
done
rm -rf "$dir"
done

View file

@ -1,179 +0,0 @@
// blockmap.mjs <file>...: writes <file>.blockmap next to each file, the gzipped block map electron-updater fetches
// for a differential download. It matches electron-builder's buildBlockMap (app-builder-lib 26): Rabin
// content-defined chunks of 8-32 KB and a 18-byte BLAKE2b checksum per chunk. electron-builder builds it at pack
// time, but signing changes the installer, so the release builds it here from the final signed files.
//
// It runs in publish jobs that hold secrets, so it uses Node's standard library only.
import { createReadStream, writeFileSync } from "node:fs"
import { gzipSync } from "node:zlib"
const MIN = 8192
const MAX = 32768
const MASK = 16384 - 1
const WINDOW = 64
// Rabin fingerprint tables for the degree-63 polynomial 0xbfe6b8a5bf378d83 (github.com/aclements/go-rabin), each
// 64-bit entry split into signed 32-bit hi and lo words.
const POLY = 0xbfe6b8a5bf378d83n
const PUSH_HI = new Int32Array(256)
const PUSH_LO = new Int32Array(256)
const POP_HI = new Int32Array(256)
const POP_LO = new Int32Array(256)
{
const mod = (a) => {
for (let d = a.toString(2).length - 1; a !== 0n && d >= 63; d = a.toString(2).length - 1)
a ^= POLY << BigInt(d - 63)
return a
}
const set = (hi, lo, i, x) => {
hi[i] = Number(BigInt.asIntN(32, x >> 32n))
lo[i] = Number(BigInt.asIntN(32, x))
}
for (let i = 0; i < 256; i++) {
const b = BigInt(i)
set(PUSH_HI, PUSH_LO, i, BigInt.asUintN(64, (b << 63n) ^ mod(b << 63n)))
set(POP_HI, POP_LO, i, mod(b << BigInt((WINDOW - 1) * 8)))
}
}
// BLAKE2b (RFC 7693) with an 18-byte digest and no key, on 32-bit word pairs. Node's crypto offers only BLAKE2b-512,
// whose digest length is part of the parameter block, so truncating it gives a different hash.
const IV = new Uint32Array([
0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, 0xade682d1,
0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,
])
const SIGMA = [
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
[14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3],
[11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4],
[7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8],
[9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13],
[2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9],
[12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11],
[13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10],
[6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5],
[10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0],
].map((row) => row.map((i) => i * 2))
const ROUNDS = [...SIGMA, SIGMA[0], SIGMA[1]]
const DIGEST = 18
const v = new Uint32Array(32)
const m = new Uint32Array(32)
const h = new Uint32Array(16)
const block = new Uint8Array(128)
const view = new DataView(block.buffer)
function add(a, b0, b1) {
const lo = v[a] + b0
v[a + 1] = v[a + 1] + b1 + (lo >= 0x100000000 ? 1 : 0)
v[a] = lo
}
function mix(a, b, c, d, x, y) {
add(a, v[b], v[b + 1])
add(a, m[x], m[x + 1])
let lo = v[d] ^ v[a]
let hi = v[d + 1] ^ v[a + 1]
v[d] = hi
v[d + 1] = lo
add(c, v[d], v[d + 1])
lo = v[b] ^ v[c]
hi = v[b + 1] ^ v[c + 1]
v[b] = (lo >>> 24) ^ (hi << 8)
v[b + 1] = (hi >>> 24) ^ (lo << 8)
add(a, v[b], v[b + 1])
add(a, m[y], m[y + 1])
lo = v[d] ^ v[a]
hi = v[d + 1] ^ v[a + 1]
v[d] = (lo >>> 16) ^ (hi << 16)
v[d + 1] = (hi >>> 16) ^ (lo << 16)
add(c, v[d], v[d + 1])
lo = v[b] ^ v[c]
hi = v[b + 1] ^ v[c + 1]
v[b] = (hi >>> 31) ^ (lo << 1)
v[b + 1] = (lo >>> 31) ^ (hi << 1)
}
function compress(count, last) {
for (let i = 0; i < 16; i++) {
v[i] = h[i]
v[i + 16] = IV[i]
}
v[24] ^= count
v[25] ^= Math.floor(count / 0x100000000)
if (last) {
v[28] = ~v[28]
v[29] = ~v[29]
}
for (let i = 0; i < 32; i++) m[i] = view.getUint32(i * 4, true)
for (const s of ROUNDS) {
mix(0, 8, 16, 24, s[0], s[1])
mix(2, 10, 18, 26, s[2], s[3])
mix(4, 12, 20, 28, s[4], s[5])
mix(6, 14, 22, 30, s[6], s[7])
mix(0, 10, 20, 30, s[8], s[9])
mix(2, 12, 22, 24, s[10], s[11])
mix(4, 14, 16, 26, s[12], s[13])
mix(6, 8, 18, 28, s[14], s[15])
}
for (let i = 0; i < 16; i++) h[i] ^= v[i] ^ v[i + 16]
}
function blake2b(data) {
h.set(IV)
h[0] ^= 0x01010000 ^ DIGEST
let offset = 0
while (data.length - offset > 128) {
block.set(data.subarray(offset, offset + 128))
offset += 128
compress(offset, false)
}
block.fill(0)
block.set(data.subarray(offset))
compress(data.length, true)
return Buffer.from(h.buffer, h.byteOffset, DIGEST).toString("base64")
}
async function blockmap(file) {
const checksums = []
const sizes = []
const chunk = Buffer.allocUnsafe(MAX)
const win = new Uint8Array(WINDOW)
let n = 0
let hi = 0
let lo = 0
let pos = 0
const emit = () => {
checksums.push(blake2b(chunk.subarray(0, n)))
sizes.push(n)
n = hi = lo = pos = 0
win.fill(0)
}
for await (const data of createReadStream(file, { highWaterMark: 256 * 1024 })) {
for (let i = 0; i < data.length; i++) {
const b = data[i]
chunk[n++] = b
if (n <= MIN - WINDOW) continue
if (n > MIN) {
const old = win[pos]
hi ^= POP_HI[old]
lo ^= POP_LO[old]
}
win[pos] = b
pos = (pos + 1) % WINDOW
const top = (hi >>> 23) & 0xff
const nhi = ((hi << 8) | (lo >>> 24)) & 0x7fffffff
const nlo = (lo << 8) | b
hi = nhi ^ PUSH_HI[top]
lo = nlo ^ PUSH_LO[top]
if (n >= MIN && ((lo & MASK) === MASK || n >= MAX)) emit()
}
}
if (n > 0) emit()
const map = { version: "2", files: [{ name: "file", offset: 0, checksums, sizes }] }
writeFileSync(`${file}.blockmap`, gzipSync(Buffer.from(JSON.stringify(map)), { level: 9 }))
}
for (const file of process.argv.slice(2)) await blockmap(file)

View file

@ -6,7 +6,5 @@
<true/> <true/>
<key>com.apple.security.device.audio-input</key> <key>com.apple.security.device.audio-input</key>
<true/> <true/>
<key>com.apple.security.device.camera</key>
<true/>
</dict> </dict>
</plist> </plist>

View file

@ -24,13 +24,7 @@ feed() {
done | jq -s --arg date "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" '{files: ., releaseDate: $date}' done | jq -s --arg date "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" '{files: ., releaseDate: $date}'
} }
# electron-updater fetches <file>.blockmap next to the Windows installer and the macOS zip for a differential files=$(upload_files "${win[@]}" "${mac[@]}" "${linux[@]}" "${linux_arm[@]}" "${bundles[@]}")
# download. Signing changes these files, so the blockmaps electron-builder made at pack time no longer match.
differential=("${win[@]}" "$macos/opencode-desktop-mac-arm64.zip" "$macos/opencode-desktop-mac-x64.zip")
node "$release_dir/blockmap.mjs" "${differential[@]}"
blockmaps=("${differential[@]/%/.blockmap}")
files=$(upload_files "${win[@]}" "${mac[@]}" "${linux[@]}" "${linux_arm[@]}" "${bundles[@]}" "${blockmaps[@]}")
manifests=$(jq -n --argjson win "$(feed "${win[@]}")" --argjson mac "$(feed "${mac[@]}")" \ manifests=$(jq -n --argjson win "$(feed "${win[@]}")" --argjson mac "$(feed "${mac[@]}")" \
--argjson linux "$(feed "${linux[@]}")" --argjson linux_arm64 "$(feed "${linux_arm[@]}")" \ --argjson linux "$(feed "${linux[@]}")" --argjson linux_arm64 "$(feed "${linux_arm[@]}")" \
'{"desktop.yml": $win, "desktop-mac.yml": $mac, "desktop-linux.yml": $linux, "desktop-linux-arm64.yml": $linux_arm64}') '{"desktop.yml": $win, "desktop-mac.yml": $mac, "desktop-linux.yml": $linux, "desktop-linux-arm64.yml": $linux_arm64}')

View file

@ -6,8 +6,7 @@
tag="v$OPENCODE_VERSION" tag="v$OPENCODE_VERSION"
payload=$(jq -n --arg tag "$tag" --arg notes "${OPENCODE_RELEASE_NOTES:-}" \ payload=$(jq -n --arg tag "$tag" --arg notes "${OPENCODE_RELEASE_NOTES:-}" \
--arg url "https://github.com/$GITHUB_REPOSITORY/releases/tag/$tag" ' --arg url "https://github.com/$GITHUB_REPOSITORY/releases/tag/$tag" '
($notes | gsub("(?m)^#{4,6}[ \\t]+(?<heading>[^\\r\\n]+)"; "**\(.heading)**") | ($notes | if length > 4000 then .[:4000] + "\n\n[Full release notes](\($url))" else . end) as $description |
if length > 4000 then .[:4000] + "\n\n[Full release notes](\($url))" else . end) as $description |
{ {
allowed_mentions: {parse: []}, allowed_mentions: {parse: []},
embeds: [{title: "OpenCode V2 \($tag)", url: $url, description: $description, color: 2829099}] embeds: [{title: "OpenCode V2 \($tag)", url: $url, description: $description, color: 2829099}]

View file

@ -11,10 +11,10 @@
"harfbuzz.wasm": { "type": "wasm" }, "harfbuzz.wasm": { "type": "wasm" },
"satori-layout.wasm": { "type": "wasm" }, "satori-layout.wasm": { "type": "wasm" },
"resvg.wasm": { "type": "wasm" }, "resvg.wasm": { "type": "wasm" },
"openmono-regular-rest.bin": { "type": "data" }, "opentui-mono-regular-rest.bin": { "type": "data" },
"openmono-regular-latin.bin": { "type": "data" }, "opentui-mono-regular-latin.bin": { "type": "data" },
"openmono-bold-rest.bin": { "type": "data" }, "opentui-mono-bold-rest.bin": { "type": "data" },
"openmono-bold-latin.bin": { "type": "data" } "opentui-mono-bold-latin.bin": { "type": "data" }
} }
} }
} }

View file

@ -11,10 +11,10 @@
"harfbuzz.wasm": { "type": "wasm" }, "harfbuzz.wasm": { "type": "wasm" },
"satori-layout.wasm": { "type": "wasm" }, "satori-layout.wasm": { "type": "wasm" },
"resvg.wasm": { "type": "wasm" }, "resvg.wasm": { "type": "wasm" },
"openmono-regular-rest.bin": { "type": "data" }, "opentui-mono-regular-rest.bin": { "type": "data" },
"openmono-regular-latin.bin": { "type": "data" }, "opentui-mono-regular-latin.bin": { "type": "data" },
"openmono-bold-rest.bin": { "type": "data" }, "opentui-mono-bold-rest.bin": { "type": "data" },
"openmono-bold-latin.bin": { "type": "data" } "opentui-mono-bold-latin.bin": { "type": "data" }
} }
} }
} }

View file

@ -19,58 +19,7 @@
"!/v1/docs/assets/*", "!/v1/docs/assets/*",
"!/v1/docs/pagefind/*", "!/v1/docs/pagefind/*",
"!/v1/docs/llms.txt", "!/v1/docs/llms.txt",
"!/v1/docs/theme.json", "!/v1/docs/theme.json"
"/zh/docs",
"/zh/docs/*",
"!/zh/docs/pagefind/*",
"/zht/docs",
"/zht/docs/*",
"!/zht/docs/pagefind/*",
"/ko/docs",
"/ko/docs/*",
"!/ko/docs/pagefind/*",
"/de/docs",
"/de/docs/*",
"!/de/docs/pagefind/*",
"/es/docs",
"/es/docs/*",
"!/es/docs/pagefind/*",
"/fr/docs",
"/fr/docs/*",
"!/fr/docs/pagefind/*",
"/it/docs",
"/it/docs/*",
"!/it/docs/pagefind/*",
"/da/docs",
"/da/docs/*",
"!/da/docs/pagefind/*",
"/ja/docs",
"/ja/docs/*",
"!/ja/docs/pagefind/*",
"/pl/docs",
"/pl/docs/*",
"!/pl/docs/pagefind/*",
"/ru/docs",
"/ru/docs/*",
"!/ru/docs/pagefind/*",
"/uk/docs",
"/uk/docs/*",
"!/uk/docs/pagefind/*",
"/ar/docs",
"/ar/docs/*",
"!/ar/docs/pagefind/*",
"/no/docs",
"/no/docs/*",
"!/no/docs/pagefind/*",
"/br/docs",
"/br/docs/*",
"!/br/docs/pagefind/*",
"/th/docs",
"/th/docs/*",
"!/th/docs/pagefind/*",
"/tr/docs",
"/tr/docs/*",
"!/tr/docs/pagefind/*"
] ]
}, },
"domains": ["dev.opencode.ai", "docs.dev.opencode.ai"], "domains": ["dev.opencode.ai", "docs.dev.opencode.ai"],

View file

@ -19,58 +19,7 @@
"!/v1/docs/assets/*", "!/v1/docs/assets/*",
"!/v1/docs/pagefind/*", "!/v1/docs/pagefind/*",
"!/v1/docs/llms.txt", "!/v1/docs/llms.txt",
"!/v1/docs/theme.json", "!/v1/docs/theme.json"
"/zh/docs",
"/zh/docs/*",
"!/zh/docs/pagefind/*",
"/zht/docs",
"/zht/docs/*",
"!/zht/docs/pagefind/*",
"/ko/docs",
"/ko/docs/*",
"!/ko/docs/pagefind/*",
"/de/docs",
"/de/docs/*",
"!/de/docs/pagefind/*",
"/es/docs",
"/es/docs/*",
"!/es/docs/pagefind/*",
"/fr/docs",
"/fr/docs/*",
"!/fr/docs/pagefind/*",
"/it/docs",
"/it/docs/*",
"!/it/docs/pagefind/*",
"/da/docs",
"/da/docs/*",
"!/da/docs/pagefind/*",
"/ja/docs",
"/ja/docs/*",
"!/ja/docs/pagefind/*",
"/pl/docs",
"/pl/docs/*",
"!/pl/docs/pagefind/*",
"/ru/docs",
"/ru/docs/*",
"!/ru/docs/pagefind/*",
"/uk/docs",
"/uk/docs/*",
"!/uk/docs/pagefind/*",
"/ar/docs",
"/ar/docs/*",
"!/ar/docs/pagefind/*",
"/no/docs",
"/no/docs/*",
"!/no/docs/pagefind/*",
"/br/docs",
"/br/docs/*",
"!/br/docs/pagefind/*",
"/th/docs",
"/th/docs/*",
"!/th/docs/pagefind/*",
"/tr/docs",
"/tr/docs/*",
"!/tr/docs/pagefind/*"
] ]
}, },
"domains": ["opencode.ai", "docs.opencode.ai"], "domains": ["opencode.ai", "docs.opencode.ai"],

View file

@ -1,70 +0,0 @@
name: backfill-blockmaps
# Uploads the .blockmap files electron-updater needs for a differential update next to desktop releases that
# shipped without them (2.2.0 through 2.4.1). Like release.yml's publish jobs, it runs in the release environment,
# checks out only .github/release/ and treats the published files as data; releasers only.
on:
workflow_dispatch:
inputs:
versions:
description: "Space-separated stable versions, such as 2.4.0 2.4.1"
required: true
type: string
dry_run:
description: "Build the blockmaps without uploading them"
required: false
type: boolean
default: true
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: read
jobs:
backfill:
if: github.repository == 'anomalyco/opencode' && github.ref == 'refs/heads/dev'
runs-on: ubuntu-24.04
environment: release
permissions:
contents: read
id-token: write
env:
OPENCODE_DRY_RUN: ${{ inputs.dry_run }}
steps:
- name: Check out release scripts
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ github.sha }}
sparse-checkout: /.github/release/
sparse-checkout-cone-mode: false
persist-credentials: false
- id: aws
name: Configure AWS credentials
if: inputs.dry_run != true
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
with:
output-env-credentials: false
output-credentials: true
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-release
role-session-name: opencode-${{ github.run_id }}
aws-region: us-east-1
- name: Cloudflare token
id: cloudflare-token
if: inputs.dry_run != true
run: bash .github/release/cloudflare-token.sh
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
CLOUDFLARE_TOKEN_URL: ${{ vars.CLOUDFLARE_TOKEN_URL }}
- name: Backfill
run: |
read -ra versions <<< "$VERSIONS"
bash .github/release/backfill-blockmaps.sh "${versions[@]}"
env:
VERSIONS: ${{ inputs.versions }}
CLOUDFLARE_ACCOUNT_ID: 15d29c8639fd3733b1b5486a2acfd968
CLOUDFLARE_API_TOKEN: ${{ steps.cloudflare-token.outputs.token }}

View file

@ -1,51 +0,0 @@
name: check-cli-rs
# Checks packages/cli-rs, the Rust client, which check-test.yml leaves out. Pull requests run it only when they change
# the client. Its tests and check:drift also compare it with the TypeScript packages below, so a dev push that changes
# one runs it too: a TypeScript change that breaks the client shows on dev, not on other teams' pull requests.
on:
pull_request:
paths:
- packages/cli-rs/**
- .github/workflows/check-cli-rs.yml
push:
branches: [dev]
paths:
- packages/cli-rs/**
- packages/cli/src/**
- packages/client/**
- packages/plugin/**
- packages/protocol/**
- packages/schema/**
- packages/theme/**
- packages/tui/**
- packages/util/**
- bun.lock
- .github/workflows/check-cli-rs.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 45
defaults:
run:
working-directory: packages/cli-rs
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# Bun and node_modules: the tests and check:drift run the TypeScript side they compare against.
- uses: ./.github/actions/setup-bun
# rustup reads rust-toolchain.toml; `bun run cargo` first fetches OpenTUI's native library from its release.
- run: rustup toolchain install
- run: bun run cargo fmt --check
- run: bun run cargo clippy --locked --workspace --all-targets -- -D warnings
# Every crate's tests, even after one fails, so one run shows every failure.
- run: bun run cargo test --locked --workspace --no-fail-fast
- run: bun run check:drift

View file

@ -1,126 +0,0 @@
name: cli-rs release
# Builds opencode-native, the Rust client in packages/cli-rs, natively on each runner below and keeps each archive as an
# artifact. A cli-rs-v<version> tag also publishes them as a GitHub release. It never becomes Latest: the monorepo's
# Latest release drives OpenCode's own update paths.
on:
push:
tags:
- "cli-rs-v*"
pull_request:
paths:
- .github/workflows/release-cli-rs.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# Zig links Linux against glibc 2.17, OpenTUI's floor. zig_sha is the archive's, from ziglang.org.
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
zig: x86_64-linux-gnu.2.17
zig_sha: 3581863e3cbcfd0fce0efc682ce7e9e93da96668a977791d356a26d2a7e9b17a
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
zig: aarch64-linux-gnu.2.17
zig_sha: a1546d5646eb184437918d6635ca6b762a0e889eac09cef720ee7a1ed3fe7795
- { runner: macos-15-intel, target: x86_64-apple-darwin }
- { runner: macos-15, target: aarch64-apple-darwin }
- { runner: windows-2025, target: x86_64-pc-windows-msvc, exe: .exe }
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
defaults:
run:
shell: bash
working-directory: packages/cli-rs
env:
OPENCODE_NATIVE_COMMIT: ${{ github.sha }}
CARGO_PROFILE_DIST_STRIP: symbols
MACOSX_DEPLOYMENT_TARGET: "13.0"
# No Visual C++ runtime to install beside the .exe.
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS: -C target-feature=+crt-static
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: package.json
# The version opencode-native --version prints: the tag's, or 0.0.0-<commit> for any other run.
- name: Version
run: |
version=0.0.0-$GITHUB_SHA
if [[ $GITHUB_REF == refs/tags/cli-rs-v* ]]; then version=${GITHUB_REF_NAME#cli-rs-v}; fi
echo "OPENCODE_VERSION=$version" >> "$GITHUB_ENV"
# Zig 0.17.1 as the C and C++ compiler and the linker. The wrapper drops flags zig rejects: cc's --target, and
# rustc's Cortex-A53 erratum fix on aarch64.
- if: matrix.zig
working-directory: ${{ runner.temp }}
run: |
file=zig-$(uname -m)-linux-0.17.1
curl -fsSL --retry 3 -o zig.tar.xz "https://ziglang.org/download/0.17.1/$file.tar.xz"
echo "${{ matrix.zig_sha }} zig.tar.xz" | sha256sum -c
tar -xJf zig.tar.xz
for tool in cc c++; do
cat > "zig-$tool" <<EOF
#!/bin/sh
for a; do shift; case \$a in --target=*|-Wl,--fix-cortex-a53-843419) ;; *) set -- "\$@" "\$a" ;; esac; done
exec "$PWD/$file/zig" $tool -target ${{ matrix.zig }} "\$@"
EOF
chmod +x "zig-$tool"
done
triple=$(tr a-z- A-Z_ <<< "${{ matrix.target }}")
{ echo "CARGO_TARGET_${triple}_LINKER=$PWD/zig-cc"; echo "CC_${triple,,}=$PWD/zig-cc"
echo "CXX_${triple,,}=$PWD/zig-c++"; echo "CXXSTDLIB_${triple,,}=c++"; } >> "$GITHUB_ENV"
# rustup reads rust-toolchain.toml; `bun run cargo` first fetches OpenTUI's native library from its release.
- run: rustup toolchain install
- run: bun run cargo build --locked --profile dist --bin opencode-native
- name: Check glibc 2.17 and no libstdc++
if: matrix.zig
run: "! readelf -dV target/dist/opencode-native | grep -E 'GLIBC_2\\.(1[89]|[2-9][0-9])|libstdc\\+\\+'"
- name: Package
run: |
name=opencode-native-$OPENCODE_VERSION-${{ matrix.target }}
mkdir -p "dist/$name"
cp "target/dist/opencode-native${{ matrix.exe }}" "dist/$name/"
# Our licence, and OpenTUI's licences (FFmpeg's among them) from its native release zip.
cp ../../LICENSE "dist/$name/"
cp -r .opentui/*/host/licenses "dist/$name/"
tar -C dist -czf "dist/$name.tar.gz" "$name"
ls -l "dist/$name" "dist/$name.tar.gz"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: opencode-native-${{ matrix.target }}
path: packages/cli-rs/dist/*.tar.gz
if-no-files-found: error
compression-level: 0
release:
needs: build
if: startsWith(github.ref, 'refs/tags/cli-rs-v')
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: opencode-native-*
merge-multiple: true
- name: Publish
env:
GH_TOKEN: ${{ github.token }}
run: |
sha256sum ./*.tar.gz > SHA256SUMS
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --latest=false \
--title "opencode-native ${GITHUB_REF_NAME#cli-rs-v}" --notes "The Rust client (packages/cli-rs) at $GITHUB_SHA." \
./*.tar.gz SHA256SUMS

View file

@ -2,17 +2,8 @@ name: triage-close-issues
on: on:
schedule: schedule:
- cron: "0 2 * * *" # Daily at 2:00 AM UTC - cron: "0 2 * * *" # Daily at 2:00 AM
workflow_dispatch: workflow_dispatch:
inputs:
dry-run:
description: "Log matching issues without closing them"
type: boolean
default: true
concurrency:
group: triage-close-issues
cancel-in-progress: false
jobs: jobs:
close: close:
@ -27,12 +18,7 @@ jobs:
with: with:
bun-version: latest bun-version: latest
- name: Close stale waiting-for-info issues - name: Close stale issues
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
run: | run: bun script/github/close-issues.ts
args=()
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs['dry-run'] }}" != "false" ]; then
args+=("--dry-run")
fi
bun script/github/close-issues.ts "${args[@]}"

View file

@ -1,397 +0,0 @@
name: triage-close-linked
# Closes what GitHub native auto-close misses on merge into the default branch:
# - additional issues in lists ("Fixes #1, #2 and #3" -> closes #2 and #3; GitHub closes #1)
# - superseded pull requests ("Supersedes #4", "Replaces #5")
#
# Runs entirely against the GitHub API with no checkout, so pull_request_target is safe.
permissions:
contents: read
on:
pull_request_target:
types: [closed]
workflow_dispatch:
inputs:
pr_number:
description: "Merged PR whose description to read"
required: true
type: string
dry_run:
description: "Log targets without closing them"
required: false
type: boolean
default: true
jobs:
close-linked:
if: >
github.repository == 'anomalyco/opencode' &&
(github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true)
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
issues: write
pull-requests: write
steps:
- name: Close linked issues and superseded PRs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const ISSUE_KEYWORDS = new Set([
"close", "closes", "closed",
"fix", "fixes", "fixed",
"resolve", "resolves", "resolved",
]);
const PR_KEYWORDS = new Set([
"supersede", "supersedes", "superseded",
"replace", "replaces", "replaced",
]);
const KEYWORDS = new Set([...ISSUE_KEYWORDS, ...PR_KEYWORDS]);
const HEDGES = new Set([
"may", "might", "could", "would", "possibly", "probably", "potentially",
"maybe", "perhaps", "hopefully", "likely", "unlikely", "partially", "partly", "partial",
]);
const SUBORDINATORS = new Set(["if", "whether", "when", "whenever", "once", "until", "unless", "before", "after"]);
const DISQUALIFIERS = new Set([
"not", "never", "neither", "nor", "without", "cannot", "can't", "doesn't", "don't",
"won't", "didn't", "isn't", "wasn't", "hasn't", "haven't", "hadn't", "wouldn't",
"couldn't", "shouldn't", "mightn't", "mustn't",
...HEDGES,
...SUBORDINATORS,
"the", "a", "an", "of", "on", "in", "by", "from", "with", "for", "than",
]);
const BASE_FORMS = new Set(["close", "fix", "resolve", "supersede", "replace"]);
const VERB_MARKERS = new Set(["does", "do", "did", "and"]);
const DETERMINERS = new Set(["this", "that", "the", "a", "an"]);
const INTERVENING = new Set([
"also", "fully", "completely", "entirely", "actually", "really", "yet", "directly", "properly",
"have", "has", "had",
]);
const MAX_TARGETS = 10;
function stripNonProse(body) {
const lines = body.replaceAll("\r\n", "\n").split("\n");
const kept = [];
let fence = null;
let inComment = false;
let paragraph = false;
for (const line of lines) {
if (inComment) {
const end = line.indexOf("-->");
if (end === -1) { kept.push(""); continue; }
inComment = false;
kept.push(line.slice(end + 3));
continue;
}
const trimmed = line.trim();
if (fence !== null) {
if (trimmed.startsWith(fence) && [...trimmed].every(c => c === fence[0])) fence = null;
paragraph = false;
kept.push("");
continue;
}
if (trimmed === "") { paragraph = false; kept.push(""); continue; }
// Skip 4-space or tab indented code blocks outside a paragraph.
if (!paragraph && (/^ {4}/.test(line) || line.startsWith("\t"))) {
kept.push("");
continue;
}
const fenceMatch = /^(`{3,}|~{3,})/.exec(trimmed);
if (fenceMatch && (fenceMatch[1][0] === "~" || !trimmed.slice(fenceMatch[1].length).includes("`"))) {
fence = fenceMatch[1];
paragraph = false;
kept.push("");
continue;
}
if (trimmed.startsWith(">")) { paragraph = false; kept.push(""); continue; }
// Skip markdown task list items like "- [ ] Fix #99".
if (/^[-*+]\s+\[[ xX]\]/.test(trimmed)) { paragraph = false; kept.push(""); continue; }
// Strip inline code spans BEFORE HTML comments so `<!--` in backticks is not a comment.
let cleaned = line.replace(/`[^`\n]+`/g, " code ");
while (cleaned.includes("<!--")) {
const start = cleaned.indexOf("<!--");
const end = cleaned.indexOf("-->", start + 4);
if (end === -1) {
cleaned = cleaned.slice(0, start);
inComment = true;
break;
}
cleaned = cleaned.slice(0, start) + " " + cleaned.slice(end + 3);
}
paragraph = !/^#{1,6}\s/.test(trimmed);
kept.push(cleaned);
}
let text = kept.join("\n");
text = text.replace(/~~[^~\n]+~~/g, " ");
text = text.replace(/<(?:s|del|strike)\b[^>]*>[\s\S]*?<\/(?:s|del|strike)>/gi, " ");
return text;
}
function tokenize(text) {
const tokens = [];
let i = 0;
while (i < text.length) {
const c = text[i];
if (c === "\n") {
if (tokens.at(-1)?.kind === "newline") tokens[tokens.length - 1] = { kind: "break" };
else if (tokens.at(-1)?.kind !== "break") tokens.push({ kind: "newline" });
i++;
continue;
}
if (c.trim() === "") { i++; continue; }
const urlMatch = /^https?:\/\/github\.com\/([\w.-]+\/[\w.-]+)\/(?:issues|pull)\/(\d+)(?![\w])/i.exec(text.slice(i));
if (urlMatch) {
tokens.push({ kind: "ref", repository: urlMatch[1].toLowerCase(), number: Number(urlMatch[2]) });
i += urlMatch[0].length;
continue;
}
const repoRefMatch = /^([\w.-]+\/[\w.-]+)#(\d+)(?![\w'\u2019])/.exec(text.slice(i));
if (repoRefMatch) {
tokens.push({ kind: "ref", repository: repoRefMatch[1].toLowerCase(), number: Number(repoRefMatch[2]) });
i += repoRefMatch[0].length;
continue;
}
const bareRefMatch = /^#(\d+)(?![\w'\u2019])/.exec(text.slice(i));
if (bareRefMatch) {
tokens.push({ kind: "ref", repository: null, number: Number(bareRefMatch[1]) });
i += bareRefMatch[0].length;
continue;
}
const wordMatch = /^[A-Za-z][A-Za-z0-9'\u2019-]*/.exec(text.slice(i));
if (wordMatch) {
tokens.push({ kind: "word", text: wordMatch[0].toLowerCase().replaceAll("\u2019", "'") });
i += wordMatch[0].length;
continue;
}
tokens.push({ kind: "punct", text: c });
i++;
}
return tokens;
}
const isPunct = (t, s) => t?.kind === "punct" && t.text === s;
const isWord = (t, s) => t?.kind === "word" && t.text === s;
const skipEmph = (tokens, i) => { while (isPunct(tokens[i], "*") || isPunct(tokens[i], "_")) i++; return i; };
const skipEmphBack = (tokens, i) => { while (i >= 0 && (isPunct(tokens[i], "*") || isPunct(tokens[i], "_"))) i--; return i; };
const skipInterveningBack = (tokens, i) => {
for (;;) {
i = skipEmphBack(tokens, i);
if (i < 0 || tokens[i].kind !== "word" || !INTERVENING.has(tokens[i].text)) return i;
i--;
}
};
const endsWithRef = (tokens, k) => {
const p = skipEmphBack(tokens, k);
const t = tokens[p];
if (!t) return false;
if (t.kind === "ref") return true;
if (isPunct(t, ">")) return tokens[p - 1]?.kind === "ref" && isPunct(tokens[p - 2], "<");
if (isPunct(t, ")")) {
if (tokens[p - 1]?.kind === "ref" && isPunct(tokens[p - 2], "(")) return true;
if (isPunct(tokens[p - 2], "(") && isPunct(tokens[p - 3], "]")) return tokens[p - 4]?.kind === "ref" && isPunct(tokens[p - 5], "[");
}
return false;
};
// A continuation reference must terminate cleanly (end of text/line/clause or list separator),
// so "Fixes #12, #13 is tracked separately" does NOT close #13.
const endsCleanly = (tokens, j) => {
const next = tokens[skipEmph(tokens, j)];
if (!next || next.kind === "newline" || next.kind === "break") return true;
if (next.kind === "punct" && ".,;:)&".includes(next.text)) return true;
if (isWord(next, "and")) return true;
return false;
};
function isClosingStatement(tokens, index, keyword) {
let k = skipInterveningBack(tokens, index - 1);
// Skip parenthetical / dash / colon lead-ins from a reference ("Reverts #100 (fixes #99)", "TODO: fix #99").
if (isPunct(tokens[k], ":") && tokens[k - 1]?.kind === "word" && ["todo", "note", "fyi"].includes(tokens[k - 1].text)) return false;
if (tokens[k]?.kind === "punct" && "(—–-".includes(tokens[k].text)) {
let q = skipInterveningBack(tokens, k - 1);
while (tokens[q]?.kind === "punct" && "-—–".includes(tokens[q].text)) q = skipInterveningBack(tokens, q - 1);
if (endsWithRef(tokens, q)) return false;
}
if (endsWithRef(tokens, k)) return false;
const lineStart = tokens[k]?.kind === "newline" || tokens[k]?.kind === "break" || k < 0;
if (tokens[k]?.kind === "newline") {
const e = skipEmphBack(tokens, k - 1);
const w = skipInterveningBack(tokens, e);
if (w < e && endsWithRef(tokens, w)) return false;
k = w;
}
const before = tokens[k];
if (!before || before.kind !== "word") return true;
if (before.text === "which" || before.text === "that") {
let p = skipInterveningBack(tokens, k - 1);
while (tokens[p]?.kind === "newline" || (tokens[p]?.kind === "punct" && ",(;:-\u2013\u2014".includes(tokens[p].text))) {
p = skipInterveningBack(tokens, p - 1);
}
if (endsWithRef(tokens, p)) return false;
}
if (DISQUALIFIERS.has(before.text)) return false;
let p = skipInterveningBack(tokens, k - 1);
if (tokens[p]?.kind === "newline") p = skipInterveningBack(tokens, p - 1);
if (tokens[p]?.kind === "word" && DETERMINERS.has(tokens[p].text)) {
p = skipInterveningBack(tokens, p - 1);
if (tokens[p]?.kind === "newline") p = skipInterveningBack(tokens, p - 1);
}
if (isPunct(tokens[p], ",")) p = skipInterveningBack(tokens, p - 1);
if (tokens[p]?.kind === "word" && (SUBORDINATORS.has(tokens[p].text) || HEDGES.has(tokens[p].text))) return false;
if (!BASE_FORMS.has(keyword)) return true;
return lineStart ? before.text !== "to" : VERB_MARKERS.has(before.text);
}
function readRef(tokens, index) {
index = skipEmph(tokens, index);
const t = tokens[index];
if (!t) return null;
if (t.kind === "ref") return { token: t, end: index + 1 };
if (isPunct(t, "<") && tokens[index + 1]?.kind === "ref" && isPunct(tokens[index + 2], ">")) {
return { token: tokens[index + 1], end: index + 3 };
}
if (isPunct(t, "[")) {
let close = index + 1;
while (close < tokens.length && close < index + 10 && !isPunct(tokens[close], "]")) {
if (tokens[close].kind === "newline" || tokens[close].kind === "break") return null;
close++;
}
if (isPunct(tokens[close], "]") && isPunct(tokens[close + 1], "(") && isPunct(tokens[close + 3], ")")) {
if (tokens[close + 2]?.kind === "ref") return { token: tokens[close + 2], end: close + 4 };
if (close === index + 2 && tokens[index + 1]?.kind === "ref") return { token: tokens[index + 1], end: close + 4 };
}
}
return null;
}
function findLinkedReferences(body, repository) {
const self = repository.toLowerCase();
const tokens = tokenize(stripNonProse(body));
const found = [];
let i = 0;
while (i < tokens.length) {
const token = tokens[i];
if (token.kind !== "word" || !KEYWORDS.has(token.text) || !isClosingStatement(tokens, i, token.text)) {
i++;
continue;
}
const targetKind = PR_KEYWORDS.has(token.text) ? "pull" : "issue";
let j = i + 1;
if (isPunct(tokens[j], ":")) j++;
let ref = readRef(tokens, j);
if (!ref) { i++; continue; }
let pos = 0;
for (;;) {
// For issue keywords, GitHub natively closes pos === 0 when bare #N/URL/owner/repo#N.
// Still emit pos === 0 only for markdown-link/PR keywords, or list continuations (pos > 0),
// avoiding racing GitHub native auto-close.
const nativeClose = targetKind === "issue" && pos === 0 && tokens[skipEmph(tokens, j)]?.kind === "ref";
if (!nativeClose && (pos === 0 || endsCleanly(tokens, ref.end))) {
found.push({ repository: ref.token.repository ?? self, number: ref.token.number, keyword: token.text, targetKind });
}
j = ref.end;
pos++;
let k = skipEmph(tokens, j);
let sep = false;
if (isPunct(tokens[k], ",")) { k++; sep = true; }
if (isWord(tokens[k], "and") || isPunct(tokens[k], "&")) { k++; sep = true; }
if (!sep) break;
ref = readRef(tokens, k);
if (!ref) break;
if (!endsCleanly(tokens, ref.end)) break;
}
i = j;
}
return found;
}
const { owner, repo } = context.repo;
const repository = `${owner}/${repo}`;
const expectedRepoUrl = `https://api.github.com/repos/${repository.toLowerCase()}`;
const inputs = context.payload.inputs ?? {};
const event = context.payload.pull_request;
const prNumber = event?.number ?? Number(inputs.pr_number);
const dryRun = String(inputs.dry_run ?? "false") === "true";
if (!Number.isInteger(prNumber) || prNumber <= 0) {
core.setFailed(`Invalid pull request number: ${inputs.pr_number}`);
return;
}
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: prNumber });
if (!pr.merged) {
core.info(`#${prNumber}: not merged, skipping`);
return;
}
const defaultBranch = pr.base.repo.default_branch;
if (pr.base.ref !== defaultBranch) {
core.info(`#${prNumber}: merged into ${pr.base.ref}, not ${defaultBranch}, skipping`);
return;
}
const prAuthor = pr.user?.login?.toLowerCase();
const trustedAuthor = ["OWNER", "MEMBER"].includes(pr.author_association);
const body = (event ? event.body : pr.body) ?? "";
const seen = new Set();
const targets = [];
for (const ref of findLinkedReferences(body, repository)) {
if (ref.repository !== repository.toLowerCase()) continue;
if (ref.number === prNumber || seen.has(ref.number)) continue;
seen.add(ref.number);
targets.push(ref);
}
if (targets.length === 0) {
core.info(`#${prNumber}: no additional linked references to close`);
return;
}
if (targets.length > MAX_TARGETS) {
core.warning(`#${prNumber}: found ${targets.length} references (cap ${MAX_TARGETS}); refusing bulk close`);
return;
}
let failed = 0;
for (const ref of targets) {
let item;
try {
({ data: item } = await github.rest.issues.get({ owner, repo, issue_number: ref.number }));
} catch (error) {
if (error.status === 404 || error.status === 410) continue;
failed++;
core.error(`#${ref.number}: ${error.message}`);
continue;
}
if (item.repository_url && item.repository_url.toLowerCase() !== expectedRepoUrl) continue;
if (item.state !== "open") continue;
const isPull = item.pull_request !== undefined;
// Only close issues for close/fix/resolve, and only close PRs for supersede/replace.
if (ref.targetKind === "issue" && isPull) continue;
if (ref.targetKind === "pull" && !isPull) continue;
// Only allow an outside contributor PR to supersede their own PR.
if (isPull && !trustedAuthor && item.user?.login?.toLowerCase() !== prAuthor) {
core.info(`#${ref.number}: skipping supersede of another contributor PR by non-member`);
continue;
}
if (dryRun) {
core.info(`[dry-run] Would close ${isPull ? "PR" : "issue"} #${ref.number} (${ref.keyword} in #${prNumber})`);
continue;
}
try {
if (isPull) {
await github.rest.pulls.update({ owner, repo, pull_number: ref.number, state: "closed" });
} else {
await github.rest.issues.update({ owner, repo, issue_number: ref.number, state: "closed", state_reason: "completed" });
}
await github.rest.issues.createComment({
owner,
repo,
issue_number: ref.number,
body: isPull ? `Superseded by #${prNumber}.` : `Closed as completed by #${prNumber}.`,
});
} catch (error) {
failed++;
core.error(`#${ref.number}: ${error.message}`);
}
}
if (failed > 0) core.setFailed(`${failed} of ${targets.length} references could not be closed`);

View file

@ -1,90 +0,0 @@
name: triage-slop
permissions:
contents: read
on:
pull_request_target:
types: [labeled]
jobs:
close-slop:
runs-on: ubuntu-latest
if: >
github.event.label.name == 'slop' &&
github.repository == 'anomalyco/opencode' &&
github.event.pull_request.state == 'open'
timeout-minutes: 5
permissions:
contents: read
issues: write
pull-requests: write
steps:
- name: Close, scrub, and comment on AI slop PR
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const pr = context.payload.pull_request;
const pullNumber = pr.number;
const login = pr.user?.login?.toLowerCase();
// Never touch merged/closed PRs, bots, or team members.
if (pr.state !== "open" || pr.merged) return;
if (pr.user?.type === "Bot" || ["OWNER", "MEMBER"].includes(pr.author_association)) {
core.info(`Skipping #${pullNumber}: author ${pr.user?.login} is exempt`);
return;
}
try {
const { data: file } = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: ".github/TEAM_MEMBERS",
ref: "dev",
});
const members = new Set(
Buffer.from(file.content, "base64").toString("utf8").split("\n").map((l) => l.trim().toLowerCase()).filter(Boolean),
);
if (login && members.has(login)) {
core.info(`Skipping #${pullNumber}: author ${pr.user?.login} is in TEAM_MEMBERS`);
return;
}
} catch (error) {
core.warning(`Could not read TEAM_MEMBERS: ${error.message}`);
return;
}
// Close and scrub first so a failed update never leaves a misleading closed comment.
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullNumber,
title: 'ai slop',
body: 'This pull request was closed as AI slop and its title/description were cleared to avoid misleading reviewers. If you believe this was closed in error, leave a comment explaining why.',
state: 'closed',
});
const marker = "<!-- triage-slop -->";
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullNumber,
per_page: 100,
});
if (comments.some((c) => (c.body || "").includes(marker))) return;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullNumber,
body: [
marker,
'This pull request has been closed because it was flagged as low-quality AI slop.',
'',
'Common reasons include:',
'- Failing to verify the underlying problem exists',
'- Failing to test that the change actually fixes it',
'- Making unverified assumptions about the codebase or adding speculative/misleading changes',
'',
'If you believe this was closed in error, leave a comment explaining how you reproduced and verified the change.',
].join('\n'),
});

View file

@ -13,12 +13,12 @@ Requirements:
- Preserve meaning, intent, tone, and formatting (including Markdown/MDX structure). - Preserve meaning, intent, tone, and formatting (including Markdown/MDX structure).
- Preserve all technical terms and artifacts exactly: product/company names, API names, identifiers, code, commands/flags, file paths, URLs, versions, error messages, config keys/values, and anything inside inline code or code blocks. - Preserve all technical terms and artifacts exactly: product/company names, API names, identifiers, code, commands/flags, file paths, URLs, versions, error messages, config keys/values, and anything inside inline code or code blocks.
- Also preserve every term listed in the Do-Not-Translate glossary below. - Also preserve every term listed in the Do-Not-Translate glossary below.
- Also apply the matching locale file when available: `.opencode/glossary/<locale>.md` for the marketing site, `services/site/src/docs/i18n/glossary/<locale>.md` for the docs (for example, `zh-cn.md` and `zh.md`). - Also apply locale-specific guidance from `.opencode/glossary/<locale>.md` when available (for example, `zh-cn.md`).
- Do not modify fenced code blocks. - Do not modify fenced code blocks.
- Output ONLY the translation (no commentary). - Output ONLY the translation (no commentary).
If the target locale is missing, ask the user to provide it. If the target locale is missing, ask the user to provide it.
If no locale-specific glossary exists, use the shared glossary only. If no locale-specific glossary exists, use the global glossary only.
--- ---
@ -35,31 +35,6 @@ When translating the marketing site (`services/site/src/i18n/<locale>.ts` and `s
--- ---
# V2 Docs Pages (opencode.ai/docs)
When translating a page of the latest docs (`services/site/src/docs/content`):
- Translate the English page at `src/docs/content/<same path>.mdx` into `src/docs/content/<locale>/<same path>.mdx`, using the site's language folder (`zh`, `zht`, `ko`, `de`, `es`, `fr`, `it`, `da`, `ja`, `pl`, `ru`, `uk`, `ar`, `no`, `br`, `th`, `tr`). English stays at the root.
- Translate the frontmatter's `title` and `description`; keep every other key and value as written.
- Keep the English heading structure: the same headings, in the same order and depth. Translated pages reuse the English heading ids, so `#anchors` keep working in every language. A translation whose heading depths differ is treated as stale: the build warns, the page shows the English fallback, and `check-translations.ts` lists it. If the English page gains a heading, update the translation's headings in the same place.
- Never call OpenCode an "AI coding agent": it is an "open source coding agent" in every language. Do not add "AI" to that phrase; "AI models" and "AI providers" are fine.
- Keep every MDX component, prop, code block, inline code span, path, URL, command, flag, config key and product name exactly as written. Translate only prose, table headers and code-block captions.
- Keep internal links docs-root-relative (`/config`): the site adds the page's language prefix. Do not write `/docs/...`, `/<locale>/docs/...` or `https://opencode.ai/docs/...`.
- A page you do not translate is served in English under that language's chrome, with a notice, so partial translations are safe.
- From `services/site`, run `bun src/docs/script/check-translations.ts <locale>` to list missing pages and pages whose English changed since their stamp, then run it with `--stamp` once the language is up to date. Stamps live in `src/docs/i18n/stamps/<locale>.json`.
## Review before shipping a language
- Compare every page paragraph by paragraph, list item, table row and code block against the CURRENT English page, not an older translation, and re-read pages whose English changed since their stamp.
- Read the result as native prose: remove translationese and literal calques, and keep the tone of the English page.
- Check numbers, prices, model IDs and version numbers against the English.
- Keep proper nouns, identifiers and code exactly as written, per the shared rules in `src/docs/i18n/glossary.md`.
- Keep the English heading order, depth and count; anchors depend on it.
- Apply the shared rules in `src/docs/i18n/glossary.md` and the language's terms in `src/docs/i18n/glossary/<locale>.md`.
- Spot-check two or three rendered pages in the built site: title, sidebar and code blocks.
---
# Locale-Specific Glossaries # Locale-Specific Glossaries
When a locale glossary exists, use it to: When a locale glossary exists, use it to:

View file

@ -1,43 +0,0 @@
# uk Glossary
## Sources
- Review of the desktop app's Ukrainian UI copy
## Do Not Translate (Locale Additions)
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
- `OpenCode CLI`
- `CLI`, `TUI`, `MCP`, `LSP`, `OAuth` (never transliterate them as `МКП` or `ЛСП`)
- Commands, flags, file paths, and code literals (keep exactly as written)
## Preferred Terms
| English | Preferred | Notes |
| ------------------------------------------------ | ------------------------------ | --------------------------------------------------------------------------- |
| session | сесія | Not `сеанс` |
| project | проєкт | 2019 orthography, not `проект` |
| worktree | робоче дерево | Not `робоча область` or `робоче місце` |
| Experimental (settings tab) | Експериментальні функції | Not the bare adjective `Експериментальний` |
| shell (tool, activity category, mode) | Термінал | `Використано: Читання, Запис, Термінал`; `режим термінала` |
| shell (a running command or process) | команда | `3 команди`, `запущено 2 команди`, `Очікування команди`, `Зупинити команду` |
| shell command | команда термінала | `Введіть команду термінала…` |
| shell (bash, zsh, PowerShell chosen in settings) | оболонка | Only where the user picks the shell program itself |
| terminal (genitive) | термінала | Not `терміналу` |
| About (settings tab) | Про OpenCode | Not a bare `Про` |
| third-party notices | ліцензії сторонніх компонентів | Not `повідомлення третіх сторін` |
| Released under the MIT License | Поширюється за ліцензією MIT | |
## Guidance
- Prefer natural Ukrainian phrasing over literal translation
- Keep tone clear and direct in UI labels and docs prose
- Fill every plural form the locale uses: `.one`, `.few`, `.many`, `.other`
- Keep the English punctuation of short taglines when it reads naturally (for example `OpenCode, агент кодування з відкритим кодом`)
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
## Avoid
- Avoid `оболонка` for shell activity, counts, and tool labels; it reads as jargon next to `Читання` and `Запис`
- Avoid translating product and protocol names that are fixed identifiers
- Avoid mixing multiple Ukrainian terms for the same recurring UI action once a preferred term is established

View file

@ -1,69 +0,0 @@
# vi Glossary
## Sources
- PR #55925: https://github.com/anomalyco/opencode/pull/55925 (terminology fixes in this file)
- PR #55922: https://github.com/anomalyco/opencode/pull/55922 (Vietnamese Console locale)
- Existing Vietnamese copy on dev: `packages/app/src/runtime/i18n/vi.ts`, `packages/ui/src/i18n/vi.ts`, `README.vi.md`
## Do Not Translate (Locale Additions)
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
- `Zen`, `Go`, `Go Plus`, `Black`, `Enterprise`, `Models.dev`
- `TUI`, `LSP`, `LLM`, `API`, `CLI`, `MCP`, `SSO`, `SDK`, `IDE`, `SSE`, `ZDR`, `MIT License`
- `terminal`, `desktop`, `web`, `shell`
- Plan names such as `Black 20`, `Black 100`, `Black 200`
- Commands, flags, file paths, and code literals (keep exactly as written)
## Preferred Terms
| English | Preferred | Notes |
| -------------------------- | --------------------- | -------------------------------------------------------- |
| coding agent (the product) | `trợ lý lập trình AI` | Matches the tagline already used in `README.vi.md` |
| agent (an instance) | `tác nhân` | Used in app UI copy; keep consistent with `packages/app` |
| session | `phiên` | Matches `packages/app/src/runtime/i18n/vi.ts` |
| file | `tệp` | `tệp đính kèm` for attachment |
| provider | `nhà cung cấp` | |
| model | `mô hình` | |
| docs | `tài liệu` | |
| download | `tải về` | |
| sign in / log in | `đăng nhập` | |
| sign up | `đăng ký` | |
| subscribe | `đăng ký` | Prefer `đăng ký gói ...` for plans |
| cancel | `hủy` | |
| privacy | `quyền riêng tư` | |
| settings | `cài đặt` | |
| usage limits | `hạn mức sử dụng` | |
| top up (balance/credit) | `nạp thêm` | `nạp thêm số dư` / `nạp thêm tín dụng` |
| refund | `hoàn tiền` | |
| waitlist | `danh sách chờ` | |
| server | `máy chủ` | |
| workspace | `không gian làm việc` | |
| brand | `thương hiệu` | |
| changelog | `nhật ký thay đổi` | |
| local models | `mô hình chạy cục bộ` | |
| prompt | `lời nhắc` | |
| token | `token` | Keep in English; do not use `mã thông báo` |
| skill | `kỹ năng` | Matches the app UI label for the skills tab |
| plugin | `tiện ích mở rộng` | Matches the app UI label for extensions |
| command | `lệnh` | |
| theme | `giao diện` | |
| formatter | `trình định dạng` | |
| compaction | `nén` | |
| attachment | `tệp đính kèm` | |
| data | `dữ liệu` | |
## Guidance
- Prefer natural Vietnamese phrasing over literal translation; short labels stay short
- Keep language names static/native in language pickers: always `Tiếng Việt`, never a translated form
- Keep `$` amounts in the original currency notation and numbers, e.g. `$10/month`
- Vietnamese has no grammatical plural, so `*_one` and `*_other` strings may be identical
- Write dates and numbers with the Latin digits used elsewhere in the UI
## Avoid
- Avoid translating language names differently per current locale in language lists
- Avoid `mã nguồn` for `token` and `token` for `source code`
- Avoid Sino-Vietnamese calques such as `chủ đề` for `topic` when `chủ đề` already means theme
- Avoid translating `Zen`, `Go`, and `Black` as generic words like `đỉnh cao` or `đi`

View file

@ -16,4 +16,7 @@
"tools": { "tools": {
"github-pr-search": false, "github-pr-search": false,
}, },
"experimental": {
"part_rows": true,
},
} }

View file

@ -15,14 +15,14 @@ Read these first rather than repeating them:
## Stories and `mount` ## Stories and `mount`
- **Location.** Put the Lab page next to the production component under `src/` of `ui`, `session-ui`, `app` or `gui-plugins`. The story server indexes `*.lab.tsx` files in those four trees (`packages/stories/vite.config.ts`, `src/index-plugin.ts`), reading each page's `export default { title, id }` and its `export const` states (the stories a test mounts) from source. Name a page that needs the story server's fixture runtime `*.standalone.lab.tsx`: the in-app Lab skips those. - **Location.** Put the story next to the production component under `src/` of `ui`, `session-ui`, `app` or `gui-plugins`. The story server indexes `*.stories.tsx` files in those four trees (`packages/stories/vite.config.ts`, `src/index-plugin.ts`), reading each file's `export default { title, id }` and its `export const` stories from source.
- **Story ID.** It is the meta `id` if one is set (`packages/session-ui/src/components/session-review.lab.tsx:25`). Otherwise it is the kebab-cased `title`, then `--`, then the kebab-cased export. Check it at `http://127.0.0.1:6006/?id=<id>` on a running story server (`bun --cwd packages/stories dev`). A wrong ID renders nothing (the page throws `No story has the id …`), so `mount` waits out its full 30 s root wait (`story.ts:39`) and then fails. - **Story ID.** It is the meta `id` if one is set (`packages/session-ui/src/components/session-review.stories.tsx:25`). Otherwise it is the kebab-cased `title`, then `--`, then the kebab-cased export. Check it at `http://127.0.0.1:6006/?id=<id>` on a running story server (`bun --cwd packages/stories dev`). A wrong ID renders nothing (the page throws `No story has the id …`), so `mount` waits out its full 30 s root wait (`story.ts:39`) and then fails.
- **URL args.** `mount(id, { args, globals })` writes them into the URL as `key:value` pairs (`story.ts:20-36`). The frame reads every one: a value becomes a boolean or number when the story's own default for that key is one, `!true`/`!false`/`!null`/`!undefined` keep Storybook's meaning, and anything else stays text. - **URL args.** `mount(id, { args, globals })` writes them into the URL as `key:value` pairs (`story.ts:20-36`). The frame reads every one: a value becomes a boolean or number when the story's own default for that key is one, `!true`/`!false`/`!null`/`!undefined` keep Storybook's meaning, and anything else stays text.
- Give every arg a typed default. With `args: { split: false }` (`session-review.lab.tsx:129`), `split:false` arrives as a boolean. - Give every arg a typed default. With `args: { split: false }` (`session-review.stories.tsx:129`), `split:false` arrives as a boolean.
- A value containing `;` would split the pair list, so pick such values inside the story, from a `scenario`-style arg. - A value containing `;` would split the pair list, so pick such values inside the story, from a `scenario`-style arg.
- **Globals** are `theme` (default `light`), `direction` and `locale` (`packages/stories/src/frame.tsx`). - **Globals** are `theme` (default `light`), `direction` and `locale` (`packages/stories/src/frame.tsx`).
- **Portaled UI.** `mount` returns `#story-root`. Dialogs, menus and drawers render outside it, so locate them from `page` (`packages/app/component-tests/composer.spec.ts:101-107`). - **Portaled UI.** `mount` returns `#story-root`. Dialogs, menus and drawers render outside it, so locate them from `page` (`packages/app/component-tests/composer.spec.ts:101-107`).
- **Server state** comes from the `resolve.alias` list in `packages/stories/vite.config.ts`, which points app server, SDK and sync modules at `packages/stories/mocks/app/**`. Extend a mock rather than adding a server. The app's Lab (`/components`) renders the same pages inside the real app instead, so a story must not depend on a mock-only export. Tests reset mock state on every mount. - **Server state** comes from the `resolve.alias` list in `packages/stories/vite.config.ts`, which points app server, SDK and sync modules at `packages/stories/mocks/app/**`. Extend a mock rather than adding a server. The app's components lab renders the same stories inside the real app instead, so a story must not depend on a mock-only export. Tests reset mock state on every mount.
- **Requests the mocks do not answer.** Route them with `page.route`. That includes server endpoints such as `/api/fs/read` (`packages/session-ui/component-tests/read-image.spec.ts:20`) and external URLs such as favicons (`packages/session-ui/component-tests/markdown.spec.ts:217`). - **Requests the mocks do not answer.** Route them with `page.route`. That includes server endpoints such as `/api/fs/read` (`packages/session-ui/component-tests/read-image.spec.ts:20`) and external URLs such as favicons (`packages/session-ui/component-tests/markdown.spec.ts:217`).
## Fixtures imported by URL ## Fixtures imported by URL
@ -44,10 +44,10 @@ Use these when the contract is not visible in a story, such as construction coun
## Vite pre-bundling and reloads ## Vite pre-bundling and reloads
`packages/stories/vite.config.ts` sets `optimizeDeps.entries`: every `*.lab.tsx` and `*.worker.ts` under the four `src/` trees, every module a component spec names by a `./` or `../` string literal ending in `.ts`/`.tsx` (collected at the top of the file), and the frame's `index.html`. Vite pre-bundles their bare imports before the first page loads. A dependency the scan misses is found on first import instead. If that changes chunks already served, Vite logs `✨ optimized dependencies changed. reloading` and sends `full-reload` with path `*` to every page in every worker, and requests with a stale `?v=` hash get a 504 "Outdated Optimize Dep". `packages/stories/vite.config.ts` sets `optimizeDeps.entries`: every `*.stories.tsx` and `*.worker.ts` under the four `src/` trees, every module a component spec names by a `./` or `../` string literal ending in `.ts`/`.tsx` (collected at the top of the file), and the frame's `index.html`. Vite pre-bundles their bare imports before the first page loads. A dependency the scan misses is found on first import instead. If that changes chunks already served, Vite logs `✨ optimized dependencies changed. reloading` and sends `full-reload` with path `*` to every page in every worker, and requests with a stale `?v=` hash get a 504 "Outdated Optimize Dep".
- **The bar is zero reloads.** A cold run of either suite should print neither `new dependencies optimized` nor `optimized dependencies changed`, so these lines are the signal to watch. - **The bar is zero reloads.** A cold run of either suite should print neither `new dependencies optimized` nor `optimized dependencies changed`, so these lines are the signal to watch.
- **Keep new code reachable by the scan.** A module path built at runtime, in a template literal, or without its extension is not collected, and neither is a spec named other than `*.spec.ts`. Name Lab pages `*.lab.tsx`: the story index and the scan read only that extension. Name workers `*.worker.ts`, since the scan does not follow `new Worker(new URL(…))`. Add an `optimizeDeps.include` entry only for a dependency the scan cannot reach. Vite names it in `✨ new dependencies optimized: …`, and `DEBUG=vite:deps` replaces that line with scan and discovery detail. - **Keep new code reachable by the scan.** A module path built at runtime, in a template literal, or without its extension is not collected, and neither is a spec named other than `*.spec.ts`. Name stories `*.stories.tsx`: the story index and the scan read only that extension. Name workers `*.worker.ts`, since the scan does not follow `new Worker(new URL(…))`. Add an `optimizeDeps.include` entry only for a dependency the scan cannot reach. Vite names it in `✨ new dependencies optimized: …`, and `DEBUG=vite:deps` replaces that line with scan and discovery detail.
- **Symptoms.** "page.evaluate: Execution context was destroyed", "Failed to fetch dynamically imported module …/@fs/…", or fixture state that is gone right after `mount` ("Registrations: 1" not found, an empty tab strip). - **Symptoms.** "page.evaluate: Execution context was destroyed", "Failed to fetch dynamically imported module …/@fs/…", or fixture state that is gone right after `mount` ("Registrations: 1" not found, an empty tab strip).
- **Only `mount()` survives a reload,** because it navigates back to the same URL. A reload loses everything set up after it: `page.evaluate` imports, mounted fixtures, state from earlier clicks, and the elements your locators pointed at. Another worker's discovery can trigger it at any moment. - **Only `mount()` survives a reload,** because it navigates back to the same URL. A reload loses everything set up after it: `page.evaluate` imports, mounted fixtures, state from earlier clicks, and the elements your locators pointed at. Another worker's discovery can trigger it at any moment.
- **Fix reloads in the scan, never with retries, timeouts or import order.** The import-everything-before-mount `Promise.all` in `browser-pane-restore.spec.ts:43-58` (comment at `:56`) only narrowed the window. Before the entries existed, that file's `:123` and `:150` were retried in 31 CI jobs each, and failed attempts cost about 39-47 s (Linux) and 34 s (Windows) of worker time per run. - **Fix reloads in the scan, never with retries, timeouts or import order.** The import-everything-before-mount `Promise.all` in `browser-pane-restore.spec.ts:43-58` (comment at `:56`) only narrowed the window. Before the entries existed, that file's `:123` and `:150` were retried in 31 CI jobs each, and failed attempts cost about 39-47 s (Linux) and 34 s (Windows) of worker time per run.

View file

@ -1,73 +0,0 @@
---
name: focus-states
description: Focus indicators and focus movement in OpenCode Desktop and the web app. Use when adding or reviewing an interactive component, a :focus/:focus-visible/:focus-within rule, an outline on focus, a list/menu/palette row, a text field, a dialog, menu or popover, a selected state, removing or closing a focused item, or anything that moves focus programmatically.
---
# Focus States
Use one default ring when someone navigates focus to a control, not when they click or tap it. The exceptions are below. Desktop uses Chromium; on the web, test the browser you’re changing or targeting rather than assuming identical focus behaviour.
## The ring
- Use `:focus-visible` for the ring. Don’t use `:focus` to decide whether to show it. `base.css` supplies `outline: 2px solid var(--v2-border-border-focus); outline-offset: 2px` and a 4px radius for links.
- Offset: `2px` outward by default. `-2px` inset for full-width rows and for controls flush against an edge that clips or scrolls (segmented items, split buttons, titlebar buttons, clear buttons). No other offsets.
- Follow the control’s radius; give a square text action or link 4px where appropriate. Use a wrapper with `:has(> trigger:focus-visible)` when the wrapper owns the visible shape or the trigger’s ring would clip, as with tabs and Settings project cards. End the selector at the wrapper or its pseudo-element (`wrapper:has(…)::after`). A selector that continues after `:has()` (`wrapper:has(…) ~ other`) restyles everything inside the wrapper on each focus change; around the timeline that made scrolling hitch (`packages/app/AGENTS.md`, Timeline stability).
- Outline only. Don't draw focus with `box-shadow`: Windows High Contrast removes shadows, so the ring disappears, and shadow rings looked different from every other ring.
- Rings appear and disappear instantly. Draw no outline at rest and leave `outline-color` out of `transition`; animating it from the default colour flashes black. Don't use `outline: 2px solid transparent` at rest: High Contrast turns it into a visible outline on every control.
- Keep a border that identifies an unfocused control. Where Chromium's forced colours remove the shadow that draws a control's edge, give it a system-colour border in `@media (forced-colors: active)`, separate from the ring, as switches and radios do.
- Inline rename inputs rely on the caret and editing state. The timeline's Jump to latest stays in the Tab order with the shared ring, since it's the only quick way back down from the keyboard; its container is `inert` while it's hidden. Loading alone doesn’t add a ring. If a busy button keeps keyboard focus, keep the ring and show the busy state separately with `aria-busy`, a disabled state, or loading text; the ring alone doesn’t say whether the button can be activated.
- These ring rules do not replace normal field borders or validation feedback. Those can respond to click focus and have their own inset treatment.
## Text fields and scroll areas
Chromium matches `:focus-visible` on every focused text field, and on anything that has focus once a key is pressed. A ring on a large surface then shows after a click, when the app moves focus there, and on returning to the window.
- A text field never draws the ring, the composer and Home search included. Focus shows as the caret and the field's focused border or background. Don't add ring state or pointer tracking to a field.
- A scroll area (the timeline, Home's list) takes focus from a click so the keyboard can scroll it, and draws no ring. It is not a Tab stop: Tab moves between the items inside it, and they show the ring. In a session, PageUp and PageDown in the composer page the timeline.
- Moving a screen reader’s reading cursor alone does not move DOM focus.
## Rows
- Choose by how focus moves.
- Focus stays in a search input while arrow keys move a highlight (`aria-activedescendant`: palettes, search lists): the active option is background-only and should not also be a Tab stop. Independent actions can still be Tab stops.
- A full-width row that is its own Tab stop (Home sessions and projects, settings rows) gets a 2px inset ring. Standalone disclosure and tool triggers can use an outset ring if it fits. Hover stays background-only.
- With roving focus (tabs and file trees), Tab enters the widget and arrow keys move focus within it. Show a ring on the keyboard-focused item, even though the other items are not separate Tab stops.
- The active option’s background highlight can disappear or become too faint in forced colours. Use `Highlight` and `HighlightText` in `@media (forced-colors: active)`. Check that nested labels and icons remain readable.
- Selection is not focus. Keep it neutral and distinct from the blue ring. The Settings › General layout cards (`settings/general/interface-mode.css`) are the reference for picker cards: a 2px `--v2-border-border-strong` border, a check badge outside the corner (`--v2-icon-icon-muted` fill, cut out in the surface colour, with a system-colour border in forced colours), and the other options' content faded. Don't use the inverse (black) border.
## Overlays and menus
- When an overlay closes and returns focus to its opener:
- Pointer dismissals (backdrop click, a close button clicked with the pointer) restore the opener’s ring state from when the overlay opened.
- Escape or another keyboard close after a keyboard open shows the ring on the restored control.
- Escape after a pointer open restores the no-ring state. Changing that is a deliberate product decision and needs its own test.
- Dialogs get this from the dialog context and dropdown menus from the `Menu` wrapper. Select, `Menu.Context`, and raw `@kobalte/core/popover` uses get it from `createOverlayFocus` in `packages/ui/src/context/overlay-focus.tsx`: call `openChanged` from `onOpenChange` and `restore(event, trigger)` from `onCloseAutoFocus`. Without a trigger, `restore(event)` returns to whatever had focus when it opened, such as a context menu's row. Never call a bare `trigger.focus()` on close.
- Choose the widget by what's inside, not by how it looks. A menu (`Menu`, `role="menu"`) holds only commands: arrow keys, Home/End and typeahead move, Enter chooses, Esc closes, and Tab does nothing, as in native menus. A popover that holds controls (switches, links, buttons in flyouts, like the Extensions panel) must let Tab move through them; arrow keys may be added on top.
## Clipping and covering
- Use `overflow: clip; overflow-clip-margin: 5px` only if the container does not need to scroll, including programmatic scrolling. For scrollers, use an inset ring, padding, or scroll margins as appropriate.
- Rows that overlap by a pixel to merge borders (accordions) let the next row paint over the bottom of an inset ring. Raise the header holding focus (`z-index`), as `accordion.css` and `sticky-accordion-header.css` do; with sticky headers, raise the header, not the item, or the item lands under its neighbours' sticky headers.
- Keep the whole ring clear of sticky content. Try an inset ring or a targeted `scroll-margin` on the affected items first. Use `scroll-padding` on the scroller only when sticky chrome covers focus across the whole area, since it changes every scroll, not just focus. Account for the header, any fade, and the ring’s reach (4px for the default outset ring). Check Tab and Shift+Tab.
## Colour and contrast
- Use `--v2-border-border-focus`, never a raw colour or a per-component override. It is Blue 500 in light and Blue 400 in dark; custom themes can override it.
- Light mode has a known contrast gap: Blue 500 is about 2.7:1 on white, below the 3:1 target. It was kept as a documented decision because Blue 600 read too heavy. It is not a pass, and 2.7:1 is not a new threshold.
- Measure against the actual adjacent colours in both schemes: the surrounding surface for an outset ring and the control’s fill for an inset ring. If contrast is low, first try a placement that improves it without clipping. If placement can’t fix it, flag the shortfall and revisit the token. Never change the colour per component.
## Order and movement
- Follow logical reading and interaction order, including in RTL. Fix DOM order rather than using positive `tabindex`. Use native buttons for actions and links for navigation; use established widget primitives or keyboard patterns for tabs, trees, sliders, and resize handles.
- Move focus in response to a user action or to recover focus when its target disappears. Background updates, streamed output, toasts, and incoming prompts must not steal focus.
- If a focused item is closed or deleted, move focus to the next place the user can continue the same task: the next or previous item in the same list, or a stable fallback such as the list heading or the control that opened it. Use the visually nearest control only when it serves that task. Don’t leave focus on `<body>`.
- Chromium drops focus to `<body>` without an event when the focused element is removed, disabled, or stops being editable. `packages/ui/src/context/focus-rescue.tsx` (installed in `AppBaseProviders`) recovers it inside a `data-focus-scope`: the next item, or the previous after the last, widening to the enclosing scope when the inner one is empty, and back to what had focus before when nothing is left. The control it moves focus to shows its ring only when Tab or an arrow key last moved focus; typing, shortcuts and a key pressed on a clicked control don't count. Mark a new list, strip, chip row or panel with `data-focus-scope` rather than adding per-feature focus code. Rescue never moves focus into a `role="tablist"`, because Kobalte tabs select themselves on focus, so don't mark a tab list as a scope. Items in an overlay leave the return to the overlay; rescue steps in only when the overlay's opener is gone too. Move focus explicitly when the task has a better target than the neighbour, such as the composer after the last chip.
- A row that scrolls out of a virtualized list is not a removed item. The list unmounts it with its focused control, and the rescue would then focus a control in another row, which scrolls the list to that row. The list gives focus to its own viewport first, with `preventScroll: true`, as `VirtualRow` does in `packages/app/src/session/timeline/virtualizer.tsx`. Do the same in a new virtualized list.
- `focus()` scrolls its target into view. Inside a scroll container, pass `{ preventScroll: true }` unless the reader must see that control next: keyboard navigation to it, or the item that takes the place of a removed one (`packages/app/AGENTS.md`, Timeline stability).
## Verify
- A story is optional, for visual checks such as clipping, colour, and forced colours. Use one if the repo has a suitable focus story, or a local one you don't commit; don't add a case for every fix. Test focus order, removal and restoration in the app with real input, not in a story.
- Use real keyboard and pointer input for the behaviour you changed. Check Tab and Shift+Tab for order and clipping, and when you replace a control, remove a ring or reuse a picker, run them through the whole changed flow and check both where focus lands and whether you can see it. Check arrow keys for composites, and shortcuts for programmatic focus. For overlay return, check keyboard open with Escape, keyboard open with a pointer dismissal, pointer open with a backdrop click, and pointer open with Escape. Forced focus shows appearance, not whether navigation or restoration works.
- After a change to focus in or near the timeline, click a tool header in it, then scroll up and down with the wheel. The timeline must follow the wheel.
- Check light, dark, and forced colours when the indicator or its background changes. Report Chromium forced-colours emulation (DevTools → Rendering → `forced-colors: active`) separately from native Windows High Contrast or assistive-technology testing.

View file

@ -179,6 +179,33 @@
} }
] ]
} }
},
{
"files": ["packages/codemode/src/interpreter/**", "packages/codemode/src/stdlib/**"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "effect",
"allowTypeImports": true,
"message": "The evaluator and built-ins are plain generators driven by the job queue in runner.ts. Start host work with runner.host or block on it with runner.blocking; only runner.ts, execute.ts, and extensions.ts run Effects."
}
]
}
]
}
},
{
"files": [
"packages/codemode/src/interpreter/runner.ts",
"packages/codemode/src/interpreter/execute.ts",
"packages/codemode/src/interpreter/extensions.ts"
],
"rules": {
"no-restricted-imports": "off"
}
} }
], ],
"ignorePatterns": [ "ignorePatterns": [
@ -188,7 +215,6 @@
"**/.sst", "**/.sst",
"**/*.d.ts", "**/*.d.ts",
"**/sdk.gen.ts", "**/sdk.gen.ts",
"packages/cli-rs/**",
"packages/plugins/figma/skills/**", "packages/plugins/figma/skills/**",
".agent/**", ".agent/**",
".agents/**", ".agents/**",

View file

@ -2,5 +2,4 @@ sst-env.d.ts
packages/desktop/src/bindings.ts packages/desktop/src/bindings.ts
packages/client/src/generated/ packages/client/src/generated/
packages/client/src/generated-effect/ packages/client/src/generated-effect/
packages/core/src/plugin/skill/opencode/
packages/plugins/figma/skills/ packages/plugins/figma/skills/

View file

@ -182,7 +182,7 @@ const table = sqliteTable("session", {
- When you open a PR, decide whether the change needs a flag: new user-visible behavior, risky core changes, and anything not ready to release get one; fixes, refactors, docs and tests do not. - When you open a PR, decide whether the change needs a flag: new user-visible behavior, risky core changes, and anything not ready to release get one; fixes, refactors, docs and tests do not.
- Gate risky behavior, or behavior that lands over several PRs, with a key and a description in `packages/schema/src/config/flag.ts`, and read it with `Flag.enabled("<key>")` from `@opencode/core/flag`. - Gate risky behavior, or behavior that lands over several PRs, with a key and a description in `packages/schema/src/config/flag.ts`, and read it with `Flag.enabled("<key>")` from `@opencode/core/flag`.
- Flags default to on in local and dev builds and off in releases, except `optInOnly` flags (such as `todo`), which require an explicit `OPENCODE_FLAGS=<key>` or `experimental.<key>: true` in every build. - Flags default to on in local and dev builds and off in releases, except `optInOnly` flags (such as `full_codemode`), which require an explicit `OPENCODE_FLAGS=<key>` or `experimental.<key>: true` in every build.
- Say in the PR body which flag guards the change. The reserved switches `OPENCODE_FLAGS=all` and `experimental.all_flags: true` skip opt-in-only flags; use `all,-<key>` or `experimental.<key>: false` to opt out within the respective source. - Say in the PR body which flag guards the change. The reserved switches `OPENCODE_FLAGS=all` and `experimental.all_flags: true` skip opt-in-only flags; use `all,-<key>` or `experimental.<key>: false` to opt out within the respective source.
- Ship a feature by deleting its flag and the checks that read it. - Ship a feature by deleting its flag and the checks that read it.
@ -202,7 +202,8 @@ const table = sqliteTable("session", {
## Plugin Loading ## Plugin Loading
- Plugins load asynchronously. Server handlers never wait for them (`Plugin.awaitActivation`), never retry until something appears, and never turn slow plugins into a timeout or 503. This applies to reads and to actions such as `generate.*`, `rpc.call`, `vcs.init` and `websearch.query`. - Plugins load asynchronously. Server handlers never wait for them (`Plugin.awaitActivation`), never retry until something appears, and never turn slow plugins into a timeout or 503. This applies to reads and to actions such as `rpc.call` and `vcs.init`.
- Temporary exception: endpoints that list or use providers managed policy can deny (`model.list`, `model.default`, `provider.list`, `generate.*`, `voice.*` and `websearch.query`) wait through `awaitPlugins` in `packages/server/src/location.ts`, because policy is applied by the last plugin to activate and is missing until then. Don't add new waits; this goes away once a plugin batch becomes visible only when it ends.
- The server answers with what is loaded now: lists may be empty or partial on a cold Location, and an action whose model, provider or RPC hasn't loaded yet fails with not-found. That is expected, not a bug to fix on the server. - The server answers with what is loaded now: lists may be empty or partial on a cold Location, and an action whose model, provider or RPC hasn't loaded yet fails with not-found. That is expected, not a bug to fix on the server.
- Clients are responsible for making sure what they need is loaded before they call. Long-lived clients refresh on the matching `*.updated` event (`model.updated`, `agent.updated`, `skill.updated`, `integration.updated`, `plugin.updated`, ...). One-shot clients (CLI commands, ACP, SDK callers) wait on their side, for example by polling `plugin.list` or the entry they need. See `packages/cli/src/services/plugin-startup.ts`. - Clients are responsible for making sure what they need is loaded before they call. Long-lived clients refresh on the matching `*.updated` event (`model.updated`, `agent.updated`, `skill.updated`, `integration.updated`, `plugin.updated`, ...). One-shot clients (CLI commands, ACP, SDK callers) wait on their side, for example by polling `plugin.list` or the entry they need. See `packages/cli/src/services/plugin-startup.ts`.
- Running the hooks that are registered and waiting for their result is fine (for example `hooks.trigger("session", "http.request", ...)`). What is not allowed is waiting for plugins to load first: if the plugin that adds a hook hasn't loaded yet, the call runs without that hook. - Running the hooks that are registered and waiting for their result is fine (for example `hooks.trigger("session", "http.request", ...)`). What is not allowed is waiting for plugins to load first: if the plugin that adds a hook hasn't loaded yet, the call runs without that hook.

View file

@ -2,251 +2,6 @@
Release notes for OpenCode V2, newest first. Release notes for OpenCode V2, newest first.
## v2.4.1 — 2026-11-23
### Highlights
- **macOS 12 Session Fix**: OpenCode can save assistant messages again on the older SQLite version included with macOS 12. ([#65771](https://github.com/anomalyco/opencode/pull/65771))
- **Config-Only Providers Show Their Models**: Providers you set up only in your config, such as Ollama, now show their models in `/models` without a `/connect` login. ([#65793](https://github.com/anomalyco/opencode/pull/65793))
- **Unread `/btw` Answers**: When a side question finishes behind another side-panel tab, its tab shows an unread dot until you open it. ([#65821](https://github.com/anomalyco/opencode/pull/65821))
### Core
#### Improvements
- With `experimental.model_speeds` enabled, model service tiers are exposed as remembered speeds instead of separate model-picker entries. ([#65749](https://github.com/anomalyco/opencode/pull/65749))
#### Bug fixes
- Fixed assistant messages failing to save on macOS 12 because its system SQLite does not support the JSON operator used in v2.4.0. ([#65771](https://github.com/anomalyco/opencode/pull/65771))
- Fixed compaction retaining more recent history than `keep.tokens`, including when a single newest message already exceeds the allowance. ([#65768](https://github.com/anomalyco/opencode/pull/65768))
- Fixed occasional extra cache cost in long goal sessions after a compaction. ([#65788](https://github.com/anomalyco/opencode/pull/65788))
### TUI
#### Improvements
- With `experimental.model_speeds` enabled, `/speed` and `/fast` list the current model’s service tiers and relative prices. The `speed.list` and `speed.cycle` keybinds are available without default bindings. ([#65749](https://github.com/anomalyco/opencode/pull/65749))
#### Bug fixes
- Fixed `/models` hiding models from config-only providers such as Ollama when no `/connect` login exists. ([#65793](https://github.com/anomalyco/opencode/pull/65793))
### Desktop
#### Improvements
- With `experimental.model_speeds` enabled, models with service tiers have a speed dropdown beside the variant selector; `/speed` cycles through the available speeds. ([#65749](https://github.com/anomalyco/opencode/pull/65749))
- Layout choices in Settings now use consistent navigation-card previews and accent styling. ([#65757](https://github.com/anomalyco/opencode/pull/65757), [#65800](https://github.com/anomalyco/opencode/pull/65800))
#### Bug fixes
- Fixed `/btw` answers completed behind another side-panel tab providing no unread indication. The tab now shows a dot until viewed. ([#65821](https://github.com/anomalyco/opencode/pull/65821))
- Fixed the timeline, Home list, file viewers and tool output adding invisible or oversized stops to keyboard Tab navigation. They remain focusable by clicking for keyboard scrolling. ([#65758](https://github.com/anomalyco/opencode/pull/65758), [#65785](https://github.com/anomalyco/opencode/pull/65785))
- Fixed unwanted focus rings around clicked Settings pages, error details, What’s New and the terminal, and corrected the split button’s focus-ring corners. ([#65783](https://github.com/anomalyco/opencode/pull/65783), [#65785](https://github.com/anomalyco/opencode/pull/65785))
- Fixed folder paths showing middle-truncation markers unnecessarily at fractional UI zoom levels. ([#65225](https://github.com/anomalyco/opencode/pull/65225))
### SDK
#### Bug fixes
- An aborted shared event subscription now stops immediately even when the source has already completed or failed with buffered events remaining. Thanks @chirag127. ([#65441](https://github.com/anomalyco/opencode/pull/65441))
### Extensions
#### Improvements
- Effect and Promise plugins can create, list and delete automations through `ctx.experimental.automation.{create,list,delete}`. ([#65747](https://github.com/anomalyco/opencode/pull/65747))
- `@opencode/plugin` now supports `@opentui/core` and `@opentui/solid` from version 0.8.0, allowing plugins capped below OpenTUI 0.9 to install again. ([#65819](https://github.com/anomalyco/opencode/pull/65819))
## v2.4.0 — 2026-11-23
### Highlights
- **Built-In Desktop Browser**: Import your sign-ins and browsing history from Chrome, Edge, Firefox or Safari, and add extensions from Chromium browsers or the Chrome and Edge stores. Everything stays in one persistent desktop profile: chat links open signed in, your tabs survive restarts and the agent can read and drive the same pages without you switching apps. ([#63002](https://github.com/anomalyco/opencode/pull/63002), [#65073](https://github.com/anomalyco/opencode/pull/65073))
- **Automations**: Ask the agent to run a prompt, a script or a shell command on a timer, on a cron schedule or when an MCP server sends an event, and manage them with `/automation`. Set `"automations": false` in your config if you don't want them. ([#65296](https://github.com/anomalyco/opencode/pull/65296), [#65186](https://github.com/anomalyco/opencode/pull/65186))
- **Generate Videos**: When a connected provider has a video model, the agent can make videos with `generate_video`. It keeps working while the video renders and saves the files into your workspace when they're ready. ([#63666](https://github.com/anomalyco/opencode/pull/63666), [#65664](https://github.com/anomalyco/opencode/pull/65664))
- **New TUI Look**: The TUI's new designs are on by default, and the `opencode` theme is the new one. Pick `opencode-classic` in **Theme** to keep the previous colors. ([#64988](https://github.com/anomalyco/opencode/pull/64988))
- **Windows Taskbar Status**: On Windows, the taskbar button shows session progress, counts sessions that need you and flashes when a permission or question is waiting. ([#65317](https://github.com/anomalyco/opencode/pull/65317), [#65318](https://github.com/anomalyco/opencode/pull/65318), [#65319](https://github.com/anomalyco/opencode/pull/65319))
### Upgrade notes
- **Image tool renamed.** `experimental_image_generate` is now `generate_image`. Permission rules with the old name are mapped automatically, but saved "always allow" approvals are not, so it asks again once. ([#65682](https://github.com/anomalyco/opencode/pull/65682))
- **Plugins that follow a version now update on their own.** A plugin written as `name@latest`, a version range (such as `name@^1.2.0`), a Git branch or a Git `semver:` range is checked on startup and every 24 hours, and a newer match is installed and reloaded. Ranges never leave their range, and if a new version fails to load the previous one keeps running. A bare `name`, an exact version, another tag such as `@next`, a Git tag or a commit hash doesn't update itself; `opencode plugin update` still updates those by hand. ([#64764](https://github.com/anomalyco/opencode/pull/64764), [#65052](https://github.com/anomalyco/opencode/pull/65052), [#65056](https://github.com/anomalyco/opencode/pull/65056))
- **GitHub Copilot no longer reads `GITHUB_TOKEN`.** Set `COPILOT_GITHUB_TOKEN` or sign in with OAuth. ([#64697](https://github.com/anomalyco/opencode/pull/64697))
- **MCP servers are tried on the newest protocol first.** A server without a `protocol` setting is probed before falling back to the legacy handshake. Set `protocol: "legacy"` on a server that misbehaves. ([#65282](https://github.com/anomalyco/opencode/pull/65282))
- **The TUI `opencode` theme changed.** It now means the new theme; set `opencode-classic` for the previous look, and `experimental["new-designs"]: false` in your TUI config for the previous designs. ([#64988](https://github.com/anomalyco/opencode/pull/64988))
- **Chat links open in the browser pane.** In the desktop app, web links from the chat open beside the conversation. Modifier-click a link to open it in your system browser. A `browser` deny in your permission rules refuses every agent browser call. ([#63002](https://github.com/anomalyco/opencode/pull/63002))
- **OpenCode Go connects through OpenCode.** The connect dialogs and `opencode auth login` list one **OpenCode** option that includes Go models. **OpenCode Go** is only listed when a Go key is already saved, and saved keys keep working. ([#65466](https://github.com/anomalyco/opencode/pull/65466))
- **New desktop shortcut.** `Cmd+Shift+S` (`Ctrl+Shift+S` on Windows and Linux) now archives the open session. The composer's `Cmd+U` and `Escape`/`Ctrl+G` now follow the **Attach file** and **Stop session** shortcuts. ([#65428](https://github.com/anomalyco/opencode/pull/65428), [#64394](https://github.com/anomalyco/opencode/pull/64394))
- **Code Mode session tool paths moved.** `tools.opencode.session_rename` and `session_move` are now `tools.opencode.session.rename` and `.move`. Direct tool names and permission actions are unchanged. ([#65080](https://github.com/anomalyco/opencode/pull/65080))
- **TUI plugins need OpenTUI 0.9.4.** `@opencode/plugin` requires `@opentui/core` and `@opentui/solid` 0.9.4 or later. Renderers passed to `registerCodeBlockRenderer` now receive an OpenTUI block (`block.text`) instead of a Markdown token; `codeBlockStyle` and `escaped` are gone. ([#63989](https://github.com/anomalyco/opencode/pull/63989))
- **SDK: plugins load in the background again.** Plugins are meant to load asynchronously, and the server never waits for them. In v2.2.7 the model, provider, `generate.*`, `voice.*` and `websearch.query` endpoints started waiting up to 5 seconds for plugins and returning 503 after that ([#63040](https://github.com/anomalyco/opencode/pull/63040)); this release removes that wait. Right after startup these endpoints answer with whatever has loaded, so a list can be empty or partial. Long-lived clients should refresh on the matching `*.updated` event, such as `model.updated`. One-shot scripts should wait on their side, for example by polling `plugin.list` until it returns plugins, or the endpoint until the entry they need appears. ([#63814](https://github.com/anomalyco/opencode/pull/63814))
- **Desktop voice needs a matching server.** The app reads each voice model's engine, which older servers don't report, so voice shows as unavailable against a server from before this release. ([#65506](https://github.com/anomalyco/opencode/pull/65506))
- **Storage write path.** Assistant parts are now saved as their own rows. `experimental.part_rows: false` restores the old path for this release. ([#65039](https://github.com/anomalyco/opencode/pull/65039))
### Core
#### Improvements
- Added automations. Agents can schedule prompts, Code Mode scripts or fixed shell commands to run once, on an interval, on a cron schedule or when a connected MCP server pushes an event. Use the `/automation` command or the `automation` tools. A shell action asks for approval once, when it's created, and records each run's exit code and output. Set `"automations": false` to turn them off. ([#65296](https://github.com/anomalyco/opencode/pull/65296), [#65186](https://github.com/anomalyco/opencode/pull/65186), [#65217](https://github.com/anomalyco/opencode/pull/65217), [#65236](https://github.com/anomalyco/opencode/pull/65236), [#65001](https://github.com/anomalyco/opencode/pull/65001), [#65699](https://github.com/anomalyco/opencode/pull/65699))
- MCP Events shipped: OpenCode follows the MCP Events beta for push delivery, with argument checks, heartbeats and automatic reconnects. An event too large for its prompt is skipped and its automation keeps running. ([#65271](https://github.com/anomalyco/opencode/pull/65271), [#65673](https://github.com/anomalyco/opencode/pull/65673))
- MCP servers without a `protocol` setting now negotiate the newest MCP protocol and fall back to the legacy handshake. ([#65282](https://github.com/anomalyco/opencode/pull/65282))
- Agents can generate videos with `generate_video` whenever a connected provider has a video model. The job runs in the background, survives a server restart, saves the finished videos into the workspace and wakes the agent with their paths. Set a default model with `experimental.video_generate.model`. The image tool is now called `generate_image`. ([#63666](https://github.com/anomalyco/opencode/pull/63666), [#64546](https://github.com/anomalyco/opencode/pull/64546), [#65664](https://github.com/anomalyco/opencode/pull/65664), [#65682](https://github.com/anomalyco/opencode/pull/65682))
- Plugins that follow a version (`name@latest`, a version range, a Git branch or a Git `semver:` range) are checked on startup and every 24 hours, and a newer match is installed and reloaded without a restart. A range stays within its range, and if a new version fails to load, the previous one keeps running. Other plugins still only report updates. ([#64764](https://github.com/anomalyco/opencode/pull/64764), [#65052](https://github.com/anomalyco/opencode/pull/65052), [#65056](https://github.com/anomalyco/opencode/pull/65056))
- The Claude Agent provider has a `configDir` setting for a Claude config folder other than the default. Given a list of folders, a chat moves to the next account when one hits its usage limit. Claude Agent sessions also show up in Claude Code as coming from `opencode`. ([#62514](https://github.com/anomalyco/opencode/pull/62514), [#65035](https://github.com/anomalyco/opencode/pull/65035), [#65016](https://github.com/anomalyco/opencode/pull/65016))
- Removing a Sign in with ChatGPT account, with `opencode auth logout` or the remove button in the app, now also revokes it with OpenAI. ([#64947](https://github.com/anomalyco/opencode/pull/64947))
- The ChatGPT plan model lists now come from models.dev, so new models show up without an OpenCode update. ([#65579](https://github.com/anomalyco/opencode/pull/65579))
- Voice models are now listed from models.dev, adding newer OpenAI models such as `gpt-live-1.1`. ([#65491](https://github.com/anomalyco/opencode/pull/65491))
- Reading far into a large file with `read`, or reading its tail, takes far fewer reads, which is much faster on remote workspaces. ([#65611](https://github.com/anomalyco/opencode/pull/65611))
- The shell tool's result says why a command ended without an exit code, and lists its output after the smaller fields so they survive truncation. ([#65365](https://github.com/anomalyco/opencode/pull/65365), [#65513](https://github.com/anomalyco/opencode/pull/65513))
- Code Mode scripts can define getters and setters, errors have a `stack` showing where they were thrown, and a failed import says why. ([#64908](https://github.com/anomalyco/opencode/pull/64908), [#64939](https://github.com/anomalyco/opencode/pull/64939), [#64587](https://github.com/anomalyco/opencode/pull/64587))
- A `timeout` set on a provider now applies to every request, including image, video, speech, transcription, embedding and compaction requests, which previously could hang forever on a stalled provider. ([#64692](https://github.com/anomalyco/opencode/pull/64692))
- Gemma 4 models on Google's Interactions API offer the `none` and `thinking` variants, and the provider's `safetySettings` are sent to Interactions. ([#65038](https://github.com/anomalyco/opencode/pull/65038), [#65036](https://github.com/anomalyco/opencode/pull/65036))
- Added `claude-agent` as a web search provider. With Claude Agent connected, set `"websearch": { "provider": "claude-agent" }` to run `websearch` through Claude Code's WebSearch, which Claude plans include, so any model can search without a search API key. ([#65704](https://github.com/anomalyco/opencode/pull/65704))
- With `full_codemode` on, agents can call `tools.opencode.session.interrupt` to stop another session, its background jobs and its subagents. ([#65718](https://github.com/anomalyco/opencode/pull/65718))
- Stored blobs, such as generated videos, are deleted a week after they were written, so the data folder no longer grows without limit. Copies saved into your project are untouched; `GET /api/experimental/blob/:id` returns 404 for a deleted blob. ([#65671](https://github.com/anomalyco/opencode/pull/65671))
- Config now reloads only when a file that feeds it changes, not on every write under `.opencode` such as editing a skill. ([#62158](https://github.com/anomalyco/opencode/pull/62158))
- Each streamed assistant part is saved as its own row instead of rewriting the whole message on every update, so long steps with many tool calls save reliably. ([#65039](https://github.com/anomalyco/opencode/pull/65039))
#### Bug fixes
- Fixed GitHub Copilot picking up `GITHUB_TOKEN`, which git tooling and GitHub Actions often set without Copilot access. It now reads `COPILOT_GITHUB_TOKEN`. ([#64697](https://github.com/anomalyco/opencode/pull/64697))
- Fixed shell commands the scanner can't analyze, such as dynamic execution, failing outright. They now ask for permission, and a matching `shell` deny rule still blocks them. ([#65269](https://github.com/anomalyco/opencode/pull/65269))
- Fixed sessions getting stuck on provider 400 errors after a model called a tool by a dotted name such as a Code Mode path. A Code Mode tool called at the top level now runs as that tool, with a note telling the model to use `execute`. ([#65292](https://github.com/anomalyco/opencode/pull/65292), [#65193](https://github.com/anomalyco/opencode/pull/65193), [#65494](https://github.com/anomalyco/opencode/pull/65494))
- Fixed a forced tool choice for a namespaced tool naming a tool the request never declared on every provider except native OpenAI Responses. ([#65621](https://github.com/anomalyco/opencode/pull/65621), [#65726](https://github.com/anomalyco/opencode/pull/65726))
- Fixed the shell tool's description not saying which OS and shell commands run in when `full_codemode` is on. ([#65712](https://github.com/anomalyco/opencode/pull/65712))
- Fixed a revoked or expired ChatGPT sign-in failing every prompt with "Request failed: 400". It now asks you to connect again. ([#65289](https://github.com/anomalyco/opencode/pull/65289))
- Fixed `edit` and `patch` replacing every non-UTF-8 character (Latin-1, cp1252, GBK…) with `<60>` across the whole file. They now refuse to rewrite such files. ([#64868](https://github.com/anomalyco/opencode/pull/64868))
- Fixed the review pane showing every line as changed in repositories with `core.autocrlf=true`, and symlinks as modified with `core.symlinks=false`. ([#64884](https://github.com/anomalyco/opencode/pull/64884))
- Fixed file permission rules not matching other capitalizations of the same path on macOS. Thanks @knp-sap. ([#64626](https://github.com/anomalyco/opencode/pull/64626))
- Fixed the model picker staying empty while a slow project was still loading. ([#63814](https://github.com/anomalyco/opencode/pull/63814))
- Fixed Claude Agent processes staying alive after their session was deleted. Thanks @WTLAIB. ([#62649](https://github.com/anomalyco/opencode/pull/62649))
- Fixed Claude Agent models becoming unavailable after Claude Code renamed them, and Claude Agent now waits up to 60 seconds for its process to start. ([#65032](https://github.com/anomalyco/opencode/pull/65032), [#65064](https://github.com/anomalyco/opencode/pull/65064))
- Fixed shell commands failing with "failed to open output file" after OpenCode's shell output directory was removed. ([#64889](https://github.com/anomalyco/opencode/pull/64889))
- Fixed concurrent shell commands failing on Windows with PowerShell 7 from the Microsoft Store, and stopping one such command killing the others. ([#64901](https://github.com/anomalyco/opencode/pull/64901))
- Fixed `opencode service set password` writing the password to the CLI log. ([#64911](https://github.com/anomalyco/opencode/pull/64911))
- Fixed `opencode run` hanging when a FIFO is passed as an attachment; it's now rejected right away. Thanks @yang0228. ([#64696](https://github.com/anomalyco/opencode/pull/64696))
- Fixed `opencode <name>` crashing with a stack trace when `<name>` is neither a command nor a directory. It now prints help and the error. ([#65262](https://github.com/anomalyco/opencode/pull/65262))
- Fixed the background service becoming unresponsive at startup with a large database write-ahead log on a slow disk. ([#64532](https://github.com/anomalyco/opencode/pull/64532))
- Fixed a client that opens a session during a running tool call not seeing that tool's progress, such as a running subagent's session. ([#64929](https://github.com/anomalyco/opencode/pull/64929))
- Fixed Markdown commands dropping a separate `variant` next to `model`, and agents being skipped when frontmatter repair turned inline lists or objects into strings. ([#65118](https://github.com/anomalyco/opencode/pull/65118), [#65119](https://github.com/anomalyco/opencode/pull/65119))
- Fixed Google Interactions responses stopping early when Google splits a response across requests. ([#65006](https://github.com/anomalyco/opencode/pull/65006))
- Fixed GPT models over OpenAI's WebSocket transport resending the whole conversation after a freeform tool call such as `execute` or `patch`. ([#64706](https://github.com/anomalyco/opencode/pull/64706))
- Fixed `gpt-6.2-astra` and later Astra models getting a 500k context window with ChatGPT sign-in; they stay at 272k. ([#64725](https://github.com/anomalyco/opencode/pull/64725))
- OpenAI `cyber_policy` and Gemini "terms of use" refusals are now reported as content policy errors. Thanks @lu-zero. ([#64844](https://github.com/anomalyco/opencode/pull/64844), [#64910](https://github.com/anomalyco/opencode/pull/64910))
- Fixed MiniMax text-to-video requests without an aspect ratio being rejected; they now default to `16:9`. ([#64822](https://github.com/anomalyco/opencode/pull/64822))
- Fixed several Code Mode built-ins to match Bun: `localeCompare` and `Date` `toLocale*` honor their locale and options, `toBase64`/`fromBase64` honor their options, `Buffer` `map`, `filter`, `slice` and `subarray` return a Buffer, and `Uint8Array.BYTES_PER_ELEMENT` is defined. ([#64935](https://github.com/anomalyco/opencode/pull/64935), [#64938](https://github.com/anomalyco/opencode/pull/64938), [#64931](https://github.com/anomalyco/opencode/pull/64931), [#64933](https://github.com/anomalyco/opencode/pull/64933), [#64930](https://github.com/anomalyco/opencode/pull/64930), [#64965](https://github.com/anomalyco/opencode/pull/64965))
- Fixed large file views not refreshing when only the end of the file changed. ([#65114](https://github.com/anomalyco/opencode/pull/65114))
- Fixed the install script failing with a disk-space error when `curl` is installed through Snap. ([#65132](https://github.com/anomalyco/opencode/pull/65132))
### TUI
#### Improvements
- The new TUI designs are on by default, and the theme named `opencode` is the new theme. The previous default is available as `opencode-classic`, and `opencode2` keeps working as an alias of `opencode`. To go back to the previous designs, turn off **New designs** in the Experiments dialog. ([#64988](https://github.com/anomalyco/opencode/pull/64988))
- `/login` and `/auth` open the same dialog as `/connect`, which now lists a single **OpenCode** entry that includes OpenCode Go models. ([#65265](https://github.com/anomalyco/opencode/pull/65265), [#65466](https://github.com/anomalyco/opencode/pull/65466))
- Pressing `↓` opens the picker on the first tab with something running, the same tab that clicking the footer opens. ([#64972](https://github.com/anomalyco/opencode/pull/64972))
- Text prompt dialogs such as rename session, `/btw`, worktree names and connect forms end with a **Submit** button, and prompt and export dialogs have tighter spacing. ([#64944](https://github.com/anomalyco/opencode/pull/64944))
- The `opencode` theme's light mode uses lighter grays for the prompt box, selected tabs and hovered rows. ([#64962](https://github.com/anomalyco/opencode/pull/64962))
#### Bug fixes
- Fixed connect forms built from integration fields, such as the Azure resource name, showing an empty row between the title and the input. ([#64944](https://github.com/anomalyco/opencode/pull/64944))
- Fixed list dialogs ending with two blank rows, and the **Manage workspaces** footer not staying at the bottom. ([#64983](https://github.com/anomalyco/opencode/pull/64983))
- Fixed long dialog lists replacing their last visible row with a stray `…`. ([#64934](https://github.com/anomalyco/opencode/pull/64934))
- Fixed the selection bar of a delete-confirmation row staying blue instead of red. ([#64936](https://github.com/anomalyco/opencode/pull/64936))
- Fixed file, agent and skill mentions landing on the wrong text when you restore a prompt sent from the desktop or web app that contains tabs or wide characters. ([#63989](https://github.com/anomalyco/opencode/pull/63989))
### Desktop
#### Improvements
- The browser pane keeps you signed in. Links from the chat open beside the conversation in one saved profile, you can import sign-ins and browsing history from Chrome, Edge, Firefox, Safari and other browsers, and you can install store extensions after reviewing what they can access. The pane gains a right-click menu, find in page, page dialogs, permission prompts, pop-up blocking and readable error pages, and the address bar completes from your history. The agent can read and drive the same signed-in tabs. ([#63002](https://github.com/anomalyco/opencode/pull/63002), [#65073](https://github.com/anomalyco/opencode/pull/65073))
- New tabs that a page opens in the browser pane appear beside the tab they came from, and middle-clicking a link opens it in a new tab. ([#65126](https://github.com/anomalyco/opencode/pull/65126), [#65091](https://github.com/anomalyco/opencode/pull/65091))
- Comments in the browser pane, file viewer and review diff can be sent to the session right away with `Mod+Enter`. Depending on your follow-up setting, they send, steer or queue. ([#65264](https://github.com/anomalyco/opencode/pull/65264))
- Added **Wrap code blocks** under Settings › General › Timeline, plus a **Wrap lines** button on timeline code blocks with lines too long to fit. ([#64545](https://github.com/anomalyco/opencode/pull/64545), [#64576](https://github.com/anomalyco/opencode/pull/64576))
- Added **Keep side panel open across sessions** in Settings › General. ([#64950](https://github.com/anomalyco/opencode/pull/64950))
- Added an **Archive session** command, bound to `Cmd+Shift+S` (`Ctrl+Shift+S` on Windows and Linux). ([#65428](https://github.com/anomalyco/opencode/pull/65428))
- The Home session menu has **Open** and **Open in background**, and Home shows the provider connect hint when nothing is connected. ([#65209](https://github.com/anomalyco/opencode/pull/65209), [#65212](https://github.com/anomalyco/opencode/pull/65212), [#64885](https://github.com/anomalyco/opencode/pull/64885))
- The Inbox layout's sidebar has a **Drafts** group for unsent new-session drafts. ([#65525](https://github.com/anomalyco/opencode/pull/65525))
- Conversation search (`Cmd+F` / `Ctrl+F`) has previous and next match buttons. ([#64865](https://github.com/anomalyco/opencode/pull/64865))
- The connect dialog lists one **OpenCode** option that includes OpenCode Go models, Settings › Providers follows the same rule, and the free model picker has a tighter layout. ([#65466](https://github.com/anomalyco/opencode/pull/65466), [#65740](https://github.com/anomalyco/opencode/pull/65740), [#64927](https://github.com/anomalyco/opencode/pull/64927))
- When you reach your ChatGPT Business workspace's usage limit, a dialog explains it and offers **Copy request for admin**. ([#64926](https://github.com/anomalyco/opencode/pull/64926))
- Voice uses the newest GPT-Live model the server lists. ([#65506](https://github.com/anomalyco/opencode/pull/65506))
- Shortcuts go through the same keymap engine as the TUI, and the new **Stop session** command can be changed in Settings › Shortcuts. ([#64394](https://github.com/anomalyco/opencode/pull/64394))
- Shortcuts can be key chords, such as `Mod+K Mod+C` or `G I`. In Settings › Shortcuts, click **+** on a shortcut you just recorded to add another key, up to 4. While a chord is pending, a panel lists the keys that continue it. ([#64395](https://github.com/anomalyco/opencode/pull/64395))
- The activity pill keeps a subagent listed while work it started is still running. ([#64790](https://github.com/anomalyco/opencode/pull/64790))
- The goal pill has a new design with the labels Following goal, Goal paused and Goal reached. ([#60001](https://github.com/anomalyco/opencode/pull/60001))
- Keyboard focus shows as one consistent ring across the app, no longer appears after a mouse click, and moves to the next item when the focused one is removed. The timeline and the composer no longer draw a ring around their whole frame. ([#64909](https://github.com/anomalyco/opencode/pull/64909), [#64976](https://github.com/anomalyco/opencode/pull/64976), [#65082](https://github.com/anomalyco/opencode/pull/65082), [#65084](https://github.com/anomalyco/opencode/pull/65084), [#65100](https://github.com/anomalyco/opencode/pull/65100), [#65690](https://github.com/anomalyco/opencode/pull/65690))
- Only the latest response shows its Copy button all the time; older ones show it on hover or focus. ([#64640](https://github.com/anomalyco/opencode/pull/64640))
- Added experimental tab groups for side tabs under Settings › Experimental. ([#64407](https://github.com/anomalyco/opencode/pull/64407))
- On Windows, the taskbar button shows session status as a progress bar, a count badge for sessions that need you, and flashes when a permission or question is waiting. Notifications say what is being asked and disappear once you answer. ([#65317](https://github.com/anomalyco/opencode/pull/65317), [#65318](https://github.com/anomalyco/opencode/pull/65318), [#65319](https://github.com/anomalyco/opencode/pull/65319), [#65325](https://github.com/anomalyco/opencode/pull/65325), [#65421](https://github.com/anomalyco/opencode/pull/65421))
- On Windows, the jump list has **New Session** and **New Window**, you can drag files from the file tree into other apps, and **Open in** includes Windows Terminal and lists only installed apps. ([#65327](https://github.com/anomalyco/opencode/pull/65327), [#65330](https://github.com/anomalyco/opencode/pull/65330), [#65320](https://github.com/anomalyco/opencode/pull/65320))
- The web app can be built to run under a path prefix, for example behind a reverse proxy, with `bun --cwd packages/app build --base=/opencode/`. ([#64597](https://github.com/anomalyco/opencode/pull/64597))
- The background activity menu stays smooth with many subagents, and the model picker stays responsive with catalogs of thousands of models. ([#65634](https://github.com/anomalyco/opencode/pull/65634), [#65189](https://github.com/anomalyco/opencode/pull/65189), [#65635](https://github.com/anomalyco/opencode/pull/65635))
#### Bug fixes
- Fixed `opencode://open-project` and `opencode://new-session` links doing nothing. ([#65332](https://github.com/anomalyco/opencode/pull/65332))
- Fixed file links like `~/Downloads/clip.mp4` showing "File not found". `~` now opens in the server's home folder. ([#65689](https://github.com/anomalyco/opencode/pull/65689))
- Fixed an open session's side panel tabs disappearing after you had used many other sessions. ([#65328](https://github.com/anomalyco/opencode/pull/65328), [#65322](https://github.com/anomalyco/opencode/pull/65322))
- Fixed the app freezing when opening a session on a remote server with **Share sign-ins with remote servers** on. ([#65339](https://github.com/anomalyco/opencode/pull/65339))
- Fixed the app freezing for several seconds when you open a group of long Code Mode scripts. An Execute row now lists its latest 10 calls, with **+N more** for the earlier ones. ([#65696](https://github.com/anomalyco/opencode/pull/65696))
- Fixed the browser pane showing "The browser couldn't open" in a project whose server had only just started. ([#65720](https://github.com/anomalyco/opencode/pull/65720))
- Fixed **Clear browsing data** clearing everything on the first click; it now asks first. ([#65124](https://github.com/anomalyco/opencode/pull/65124))
- Fixed browser tabs showing a generic globe instead of the site's icon, saved tabs appearing late after the app reopens, and the page going blank while a panel is resized on Windows. ([#65094](https://github.com/anomalyco/opencode/pull/65094), [#65067](https://github.com/anomalyco/opencode/pull/65067), [#65083](https://github.com/anomalyco/opencode/pull/65083))
- Fixed sites in the browser pane replacing the app's badge on the taskbar or Dock. ([#65646](https://github.com/anomalyco/opencode/pull/65646))
- Fixed the mouse Back and Forward buttons doing nothing. ([#65129](https://github.com/anomalyco/opencode/pull/65129))
- Fixed a subagent's pending permission request not reappearing after a reload or reconnect. ([#65120](https://github.com/anomalyco/opencode/pull/65120))
- Fixed background jobs that changed while the job list was loading showing the wrong state, and rows in the activity menu jumping around. ([#64966](https://github.com/anomalyco/opencode/pull/64966), [#65312](https://github.com/anomalyco/opencode/pull/65312))
- Fixed the session view crashing when a timeline row disappeared mid-update. ([#64565](https://github.com/anomalyco/opencode/pull/64565))
- Fixed earlier replies being folded into the "Used N tools" group when a session was woken without a new message. ([#64917](https://github.com/anomalyco/opencode/pull/64917))
- Fixed the Context tab showing the latest instruction update as the "System Prompt". ([#64991](https://github.com/anomalyco/opencode/pull/64991))
- Fixed the session header briefly showing the wrong worktree while a new session starts. ([#65190](https://github.com/anomalyco/opencode/pull/65190))
- Fixed Grep, Glob and List rows showing the parent of the folder they searched, and Windows paths not showing relative to the project. ([#65460](https://github.com/anomalyco/opencode/pull/65460), [#65639](https://github.com/anomalyco/opencode/pull/65639))
- Fixed server event streams going stale after Windows wakes from sleep, and windows reopening in the wrong place after being snapped or minimized. ([#65321](https://github.com/anomalyco/opencode/pull/65321), [#65323](https://github.com/anomalyco/opencode/pull/65323))
- Fixed the Windows caption buttons being hard to see with a contrast theme. ([#65324](https://github.com/anomalyco/opencode/pull/65324))
- Fixed **Open in PowerShell** on Windows opening Windows PowerShell instead of PowerShell 7 when it's installed. ([#64873](https://github.com/anomalyco/opencode/pull/64873))
- Fixed builds packaged without `app-update.yml`, such as AUR packages, showing update-check errors. Settings now shows **Updates unavailable**. ([#64681](https://github.com/anomalyco/opencode/pull/64681))
- Fixed the message menu's "Today" and "Yesterday" labels, and Home's date headers staying invisible while scrolling. ([#65081](https://github.com/anomalyco/opencode/pull/65081), [#64665](https://github.com/anomalyco/opencode/pull/64665))
- Fixed clipped or misleading focus rings, the side panel's add button being skipped by `Tab`, and the **Compacted** label only partly highlighting on hover. ([#65215](https://github.com/anomalyco/opencode/pull/65215), [#65192](https://github.com/anomalyco/opencode/pull/65192), [#65176](https://github.com/anomalyco/opencode/pull/65176), [#65177](https://github.com/anomalyco/opencode/pull/65177), [#65211](https://github.com/anomalyco/opencode/pull/65211), [#65213](https://github.com/anomalyco/opencode/pull/65213), [#65644](https://github.com/anomalyco/opencode/pull/65644))
- Fixed the Hex voice tip showing on phones and tablets, and a fringe on project icon corners. ([#64583](https://github.com/anomalyco/opencode/pull/64583), [#64582](https://github.com/anomalyco/opencode/pull/64582))
### SDK
#### Improvements
- Added `experimental.job.cancel` to cancel a running background job, and an `experimental.job.updated` event when a job starts, moves to the background or ends. `@opencode/client/solid`'s `createData` has a `job` slice. ([#64790](https://github.com/anomalyco/opencode/pull/64790), [#65266](https://github.com/anomalyco/opencode/pull/65266), [#64956](https://github.com/anomalyco/opencode/pull/64956))
- The video endpoints (`experimental.generate.video.create` and `.get`) no longer need a flag. Video jobs survive a server restart, can return more than one video, and stay readable for 24 hours after they finish. ([#65664](https://github.com/anomalyco/opencode/pull/65664), [#64546](https://github.com/anomalyco/opencode/pull/64546))
- The automation endpoints work without a flag, and an automation can run a shell command as its action. ([#65296](https://github.com/anomalyco/opencode/pull/65296), [#65186](https://github.com/anomalyco/opencode/pull/65186))
### Extensions
#### Improvements
- A plugin tool can set `options.codemode` to an object (`{ pinned?, description?, input?, output? }`) to give its Code Mode form its own description and schemas. Top-level `options.pinned` still works but is deprecated. ([#64515](https://github.com/anomalyco/opencode/pull/64515))
- The `execute.before` and `execute.after` tool hooks receive `info`, the tool's definition, and `codemode`, which is true when a Code Mode script made the call. ([#64515](https://github.com/anomalyco/opencode/pull/64515))
- An integration's OAuth method can define `revoke` to sign a credential out remotely before it's removed. ([#64947](https://github.com/anomalyco/opencode/pull/64947))
- TUI plugins can read a session's running background jobs with `api.data.job.list(sessionID)` (experimental). ([#64956](https://github.com/anomalyco/opencode/pull/64956))
- `experimental.idle` background entries can have the kind `video`. ([#63666](https://github.com/anomalyco/opencode/pull/63666))
- GUI plugins can declare their own SVG icons with `Plugin.define({ icons })` and use them through `ctx.icons`. The built-in `outline-pair` and `outline-steer` icons were removed. ([#64577](https://github.com/anomalyco/opencode/pull/64577))
- The GUI composer API adds `composer.send(commentID)` and `composer.delivery()`, and the `Browser` contract adds `experimental.open` and `experimental.close`. ([#65264](https://github.com/anomalyco/opencode/pull/65264), [#63002](https://github.com/anomalyco/opencode/pull/63002))
- GUI `System.open` only launches HTTP, HTTPS and mail URLs, and `Browser.open` refuses `file://` URLs outside the built-in preview. ([#63002](https://github.com/anomalyco/opencode/pull/63002))
## v2.3.2 — 2026-11-18
### Highlights
- **GPT-6.2 Prompt Caching**: GPT-6.2 models don't cache a system prompt sent in the Responses `instructions` field, so every step re-billed it as uncached input. OpenCode now sends it as a leading developer message on every Responses route, including OpenAI (API key and ChatGPT sign-in), GitHub Copilot, Zen, Azure and OpenRouter, so it is cached from the second step on. ([#64542](https://github.com/anomalyco/opencode/pull/64542), [#64544](https://github.com/anomalyco/opencode/pull/64544))
### Core
#### Bug fixes
- Fixed GPT-6.2 models re-billing the system prompt as uncached input on every step. On GitHub Copilot `gpt-6.2-sol`, uncached input per step dropped from about 14,000 tokens to 3. Compaction through `/responses/compact` now reads the same cached prefix. ([#64542](https://github.com/anomalyco/opencode/pull/64542), [#64544](https://github.com/anomalyco/opencode/pull/64544))
- `webfetch` structured output no longer repeats the `url` and `format` it was called with. ([#64534](https://github.com/anomalyco/opencode/pull/64534))
## v2.3.1 — 2026-11-17 ## v2.3.1 — 2026-11-17
### Highlights ### Highlights

View file

@ -110,4 +110,4 @@ OpenCode 内置两种 Agent,可用 `Tab` 键快速切换:
--- ---
**加入我们的社区** [飞书](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=a53kb082-3aff-41fb-b412-b3e669334f16&qr_code=true) | [X.com](https://x.com/opencode) **加入我们的社区** [飞书](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=52ao9352-5623-4fa0-b7dd-3407c392c1af&qr_code=true) | [X.com](https://x.com/opencode)

View file

@ -110,4 +110,4 @@ OpenCode 內建了兩種 Agent,您可以使用 `Tab` 鍵快速切換。
--- ---
**加入我們的社群** [飞书](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=a53kb082-3aff-41fb-b412-b3e669334f16&qr_code=true) | [X.com](https://x.com/opencode) **加入我們的社群** [飞书](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=52ao9352-5623-4fa0-b7dd-3407c392c1af&qr_code=true) | [X.com](https://x.com/opencode)

420
bun.lock
View file

@ -29,7 +29,7 @@
}, },
"packages/ai": { "packages/ai": {
"name": "@opencode/ai", "name": "@opencode/ai",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@aws-sdk/credential-providers": "3.1057.0", "@aws-sdk/credential-providers": "3.1057.0",
"@opencode/schema": "workspace:*", "@opencode/schema": "workspace:*",
@ -51,12 +51,13 @@
}, },
"packages/app": { "packages/app": {
"name": "@opencode/app", "name": "@opencode/app",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@corvu/drawer": "catalog:", "@corvu/drawer": "catalog:",
"@dnd-kit/abstract": "0.5.0", "@dnd-kit/abstract": "0.5.0",
"@dnd-kit/dom": "0.5.0", "@dnd-kit/dom": "0.5.0",
"@dnd-kit/solid": "0.5.0", "@dnd-kit/solid": "0.5.0",
"@ibm/plex": "6.4.1",
"@kobalte/core": "catalog:", "@kobalte/core": "catalog:",
"@opencode/client": "workspace:*", "@opencode/client": "workspace:*",
"@opencode/gui-plugins": "workspace:*", "@opencode/gui-plugins": "workspace:*",
@ -65,7 +66,6 @@
"@opencode/session-ui": "workspace:*", "@opencode/session-ui": "workspace:*",
"@opencode/ui": "workspace:*", "@opencode/ui": "workspace:*",
"@opencode/util": "workspace:*", "@opencode/util": "workspace:*",
"@opentui/keymap": "catalog:",
"@pierre/highlights": "catalog:", "@pierre/highlights": "catalog:",
"@pierre/trees": "1.0.0-beta.6", "@pierre/trees": "1.0.0-beta.6",
"@sentry/solid": "catalog:", "@sentry/solid": "catalog:",
@ -106,7 +106,7 @@
}, },
"packages/cli": { "packages/cli": {
"name": "@opencode/cli", "name": "@opencode/cli",
"version": "2.4.1", "version": "2.3.1",
"bin": { "bin": {
"opencode": "./bin/opencode.cjs", "opencode": "./bin/opencode.cjs",
"opencode2": "./bin/opencode2.cjs", "opencode2": "./bin/opencode2.cjs",
@ -169,25 +169,9 @@
"vite-plugin-solid": "catalog:", "vite-plugin-solid": "catalog:",
}, },
}, },
"packages/cli-rs": {
"name": "@opencode/cli-rs",
"devDependencies": {
"@opencode/httpapi-codegen": "workspace:*",
"@opencode/plugin": "workspace:*",
"@opencode/protocol": "workspace:*",
"@opencode/tui": "workspace:*",
"@opentui/core": "catalog:",
"@opentui/solid": "catalog:",
"@tsconfig/bun": "catalog:",
"@types/bun": "catalog:",
"@typescript/native": "catalog:",
"effect": "catalog:",
"solid-js": "catalog:",
},
},
"packages/client": { "packages/client": {
"name": "@opencode/client", "name": "@opencode/client",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/protocol": "workspace:*", "@opencode/protocol": "workspace:*",
"@opencode/schema": "workspace:*", "@opencode/schema": "workspace:*",
@ -213,11 +197,10 @@
}, },
"packages/codemode": { "packages/codemode": {
"name": "@opencode/codemode", "name": "@opencode/codemode",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"acorn": "8.15.0", "acorn": "8.15.0",
"effect": "catalog:", "effect": "catalog:",
"psychoscript": "0.3.0",
}, },
"devDependencies": { "devDependencies": {
"@tsconfig/bun": "catalog:", "@tsconfig/bun": "catalog:",
@ -227,7 +210,7 @@
}, },
"packages/core": { "packages/core": {
"name": "@opencode/core", "name": "@opencode/core",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "3.0.19", "@ai-sdk/provider": "3.0.19",
"@effect/platform-node": "catalog:", "@effect/platform-node": "catalog:",
@ -272,13 +255,6 @@
"@ai-sdk/openai-compatible": "2.0.41", "@ai-sdk/openai-compatible": "2.0.41",
"@anthropic-ai/claude-agent-sdk": "0.3.301", "@anthropic-ai/claude-agent-sdk": "0.3.301",
"@hona/strobe": "catalog:", "@hona/strobe": "catalog:",
"@number0/iroh-darwin-arm64": "1.2.0",
"@number0/iroh-linux-arm64-gnu": "1.2.0",
"@number0/iroh-linux-arm64-musl": "1.2.0",
"@number0/iroh-linux-x64-gnu": "1.2.0",
"@number0/iroh-linux-x64-musl": "1.2.0",
"@number0/iroh-win32-arm64-msvc": "1.2.0",
"@number0/iroh-win32-x64-msvc": "1.2.0",
"@opencode/http-recorder": "workspace:*", "@opencode/http-recorder": "workspace:*",
"@parcel/watcher-darwin-arm64": "2.5.1", "@parcel/watcher-darwin-arm64": "2.5.1",
"@parcel/watcher-darwin-x64": "2.5.1", "@parcel/watcher-darwin-x64": "2.5.1",
@ -294,10 +270,6 @@
"@types/which": "3.0.4", "@types/which": "3.0.4",
"drizzle-kit": "catalog:", "drizzle-kit": "catalog:",
"fast-check": "catalog:", "fast-check": "catalog:",
"miniflare": "4.20260708.1",
},
"optionalDependencies": {
"@number0/iroh": "1.2.0",
}, },
"peerDependencies": { "peerDependencies": {
"@anthropic-ai/claude-agent-sdk": "0.3.301", "@anthropic-ai/claude-agent-sdk": "0.3.301",
@ -308,11 +280,10 @@
}, },
"packages/data/app": { "packages/data/app": {
"name": "@opencode/data-app", "name": "@opencode/data-app",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@kobalte/core": "catalog:", "@kobalte/core": "catalog:",
"@opencode/data-core": "workspace:*", "@opencode/data-core": "workspace:*",
"@opencode/locale": "workspace:*",
"@opencode/nav-menus": "workspace:*", "@opencode/nav-menus": "workspace:*",
"@opencode/ui": "workspace:*", "@opencode/ui": "workspace:*",
"@resvg/resvg-wasm": "2.6.2", "@resvg/resvg-wasm": "2.6.2",
@ -337,7 +308,7 @@
}, },
"packages/data/core": { "packages/data/core": {
"name": "@opencode/data-core", "name": "@opencode/data-core",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@planetscale/database": "1.19.0", "@planetscale/database": "1.19.0",
"drizzle-orm": "catalog:", "drizzle-orm": "catalog:",
@ -354,7 +325,7 @@
}, },
"packages/data/server": { "packages/data/server": {
"name": "@opencode/data-server", "name": "@opencode/data-server",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/data-core": "workspace:*", "@opencode/data-core": "workspace:*",
"effect": "catalog:", "effect": "catalog:",
@ -370,13 +341,12 @@
}, },
"packages/desktop": { "packages/desktop": {
"name": "@opencode/desktop", "name": "@opencode/desktop",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@zip.js/zip.js": "2.7.62", "@zip.js/zip.js": "2.7.62",
"electron-context-menu": "5.0.0", "electron-context-menu": "5.0.0",
"electron-log": "^5", "electron-log": "^5",
"electron-updater": "6.8.9", "electron-updater": "6.8.9",
"ffi-rs": "1.3.7",
"lighthouse": "13.4.1", "lighthouse": "13.4.1",
}, },
"devDependencies": { "devDependencies": {
@ -418,7 +388,7 @@
}, },
"packages/gui-plugins": { "packages/gui-plugins": {
"name": "@opencode/gui-plugins", "name": "@opencode/gui-plugins",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@betteroffice/docx": "0.4.3", "@betteroffice/docx": "0.4.3",
"@betteroffice/fonts": "0.4.0", "@betteroffice/fonts": "0.4.0",
@ -441,12 +411,10 @@
"@tanstack/solid-query": "5.91.4", "@tanstack/solid-query": "5.91.4",
"@tanstack/solid-virtual": "catalog:", "@tanstack/solid-virtual": "catalog:",
"effect": "catalog:", "effect": "catalog:",
"ffi-rs": "1.3.7",
"fuzzysort": "catalog:", "fuzzysort": "catalog:",
"ghostty-web": "github:anomalyco/ghostty-web#e91e38a9ceb13c566ddfa15185a9393849f712a9", "ghostty-web": "github:anomalyco/ghostty-web#e91e38a9ceb13c566ddfa15185a9393849f712a9",
"knobs": "npm:@kitlangton/knobs@0.4.0-next.22", "knobs": "npm:@kitlangton/knobs@0.4.0-next.22",
"solid-js": "catalog:", "solid-js": "catalog:",
"tldts": "7.5.1",
}, },
"devDependencies": { "devDependencies": {
"@happy-dom/global-registrator": "20.0.11", "@happy-dom/global-registrator": "20.0.11",
@ -465,7 +433,7 @@
}, },
"packages/http-recorder": { "packages/http-recorder": {
"name": "@opencode/http-recorder", "name": "@opencode/http-recorder",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@effect/platform-node-shared": "catalog:", "@effect/platform-node-shared": "catalog:",
}, },
@ -484,7 +452,7 @@
}, },
"packages/httpapi-codegen": { "packages/httpapi-codegen": {
"name": "@opencode/httpapi-codegen", "name": "@opencode/httpapi-codegen",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"effect": "catalog:", "effect": "catalog:",
"prettier": "3.6.2", "prettier": "3.6.2",
@ -497,7 +465,7 @@
}, },
"packages/latex": { "packages/latex": {
"name": "@opencode/latex", "name": "@opencode/latex",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/plugin": "workspace:*", "@opencode/plugin": "workspace:*",
"@opentui/core": "catalog:", "@opentui/core": "catalog:",
@ -509,18 +477,9 @@
"@typescript/native": "catalog:", "@typescript/native": "catalog:",
}, },
}, },
"packages/locale": {
"name": "@opencode/locale",
"version": "2.4.1",
"devDependencies": {
"@types/bun": "catalog:",
"@typescript/native": "catalog:",
"typescript": "catalog:",
},
},
"packages/merman": { "packages/merman": {
"name": "@opencode/merman", "name": "@opencode/merman",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/plugin": "workspace:*", "@opencode/plugin": "workspace:*",
"@opentui/core": "catalog:", "@opentui/core": "catalog:",
@ -535,7 +494,7 @@
}, },
"packages/nav-menus": { "packages/nav-menus": {
"name": "@opencode/nav-menus", "name": "@opencode/nav-menus",
"version": "2.4.1", "version": "2.3.1",
"devDependencies": { "devDependencies": {
"@happy-dom/global-registrator": "20.0.11", "@happy-dom/global-registrator": "20.0.11",
"@types/bun": "catalog:", "@types/bun": "catalog:",
@ -546,7 +505,7 @@
}, },
"packages/patchmark": { "packages/patchmark": {
"name": "@opencode/patchmark", "name": "@opencode/patchmark",
"version": "2.4.1", "version": "2.3.1",
"devDependencies": { "devDependencies": {
"@tsconfig/bun": "catalog:", "@tsconfig/bun": "catalog:",
"@types/bun": "catalog:", "@types/bun": "catalog:",
@ -559,7 +518,7 @@
}, },
"packages/plugin": { "packages/plugin": {
"name": "@opencode/plugin", "name": "@opencode/plugin",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "3.0.8", "@ai-sdk/provider": "3.0.8",
"@opencode/ai": "workspace:*", "@opencode/ai": "workspace:*",
@ -585,8 +544,8 @@
}, },
"peerDependencies": { "peerDependencies": {
"@opencode/theme": "workspace:*", "@opencode/theme": "workspace:*",
"@opentui/core": ">=0.8.0", "@opentui/core": ">=0.8.4",
"@opentui/solid": ">=0.8.0", "@opentui/solid": ">=0.8.4",
"electron": "*", "electron": "*",
"solid-js": ">=1.9.0", "solid-js": ">=1.9.0",
"vite": ">=6", "vite": ">=6",
@ -604,11 +563,10 @@
}, },
"packages/plugin-browser": { "packages/plugin-browser": {
"name": "@opencode/plugin-browser", "name": "@opencode/plugin-browser",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/plugin": "workspace:*", "@opencode/plugin": "workspace:*",
"@opencode/schema": "workspace:*", "@opencode/schema": "workspace:*",
"@opencode/util": "workspace:*",
"effect": "catalog:", "effect": "catalog:",
}, },
"devDependencies": { "devDependencies": {
@ -620,7 +578,7 @@
}, },
"packages/plugins/figma": { "packages/plugins/figma": {
"name": "@opencode/plugin-figma", "name": "@opencode/plugin-figma",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"gray-matter": "4.0.3", "gray-matter": "4.0.3",
}, },
@ -635,7 +593,7 @@
}, },
"packages/protocol": { "packages/protocol": {
"name": "@opencode/protocol", "name": "@opencode/protocol",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/schema": "workspace:*", "@opencode/schema": "workspace:*",
"effect": "catalog:", "effect": "catalog:",
@ -650,7 +608,7 @@
}, },
"packages/schema": { "packages/schema": {
"name": "@opencode/schema", "name": "@opencode/schema",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@standard-schema/spec": "catalog:", "@standard-schema/spec": "catalog:",
"effect": "catalog:", "effect": "catalog:",
@ -674,7 +632,7 @@
}, },
"packages/sdk": { "packages/sdk": {
"name": "@opencode/sdk", "name": "@opencode/sdk",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/client": "workspace:*", "@opencode/client": "workspace:*",
"@opencode/core": "workspace:*", "@opencode/core": "workspace:*",
@ -695,7 +653,7 @@
}, },
"packages/server": { "packages/server": {
"name": "@opencode/server", "name": "@opencode/server",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@effect/platform-node": "catalog:", "@effect/platform-node": "catalog:",
"@effect/platform-node-shared": "catalog:", "@effect/platform-node-shared": "catalog:",
@ -718,7 +676,7 @@
}, },
"packages/session-ui": { "packages/session-ui": {
"name": "@opencode/session-ui", "name": "@opencode/session-ui",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@kitlangton/solid-motion": "0.2.2", "@kitlangton/solid-motion": "0.2.2",
"@kobalte/core": "catalog:", "@kobalte/core": "catalog:",
@ -750,7 +708,7 @@
}, },
"packages/simulation": { "packages/simulation": {
"name": "@opencode/simulation", "name": "@opencode/simulation",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/ai": "workspace:*", "@opencode/ai": "workspace:*",
"@opencode/core": "workspace:*", "@opencode/core": "workspace:*",
@ -788,7 +746,7 @@
}, },
"packages/theme": { "packages/theme": {
"name": "@opencode/theme", "name": "@opencode/theme",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opentui/core": "catalog:", "@opentui/core": "catalog:",
"effect": "catalog:", "effect": "catalog:",
@ -802,7 +760,7 @@
}, },
"packages/tui": { "packages/tui": {
"name": "@opencode/tui", "name": "@opencode/tui",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@opencode/client": "workspace:*", "@opencode/client": "workspace:*",
"@opencode/core": "workspace:*", "@opencode/core": "workspace:*",
@ -834,7 +792,7 @@
}, },
"packages/ui": { "packages/ui": {
"name": "@opencode/ui", "name": "@opencode/ui",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@kitlangton/solid-motion": "0.2.2", "@kitlangton/solid-motion": "0.2.2",
"@kobalte/core": "catalog:", "@kobalte/core": "catalog:",
@ -870,7 +828,7 @@
}, },
"packages/util": { "packages/util": {
"name": "@opencode/util", "name": "@opencode/util",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"@effect/opentelemetry": "catalog:", "@effect/opentelemetry": "catalog:",
"@effect/platform-node": "catalog:", "@effect/platform-node": "catalog:",
@ -950,7 +908,6 @@
"dependencies": { "dependencies": {
"@ibm/plex": "6.4.1", "@ibm/plex": "6.4.1",
"@kitlangton/rolling-number": "0.4.1", "@kitlangton/rolling-number": "0.4.1",
"@opencode/locale": "workspace:*",
"@opencode/nav-menus": "workspace:*", "@opencode/nav-menus": "workspace:*",
"@opencode/ui": "workspace:*", "@opencode/ui": "workspace:*",
"@solidjs/meta": "catalog:", "@solidjs/meta": "catalog:",
@ -1010,7 +967,7 @@
}, },
"services/update": { "services/update": {
"name": "@opencode/update", "name": "@opencode/update",
"version": "2.4.1", "version": "2.3.1",
"dependencies": { "dependencies": {
"jose": "6.0.11", "jose": "6.0.11",
"semver": "catalog:", "semver": "catalog:",
@ -1037,7 +994,6 @@
"@brendonovich/vite-plugin-opencode@0.1.3": "patches/@brendonovich%2Fvite-plugin-opencode@0.1.3.patch", "@brendonovich/vite-plugin-opencode@0.1.3": "patches/@brendonovich%2Fvite-plugin-opencode@0.1.3.patch",
"electron-updater@6.8.9": "patches/electron-updater@6.8.9.patch", "electron-updater@6.8.9": "patches/electron-updater@6.8.9.patch",
"@kobalte/core@0.13.13": "patches/@kobalte%2Fcore@0.13.13.patch", "@kobalte/core@0.13.13": "patches/@kobalte%2Fcore@0.13.13.patch",
"bun-pty@0.4.11": "patches/bun-pty@0.4.11.patch",
"pacote@21.5.1": "patches/pacote@21.5.1.patch", "pacote@21.5.1": "patches/pacote@21.5.1.patch",
"@npmcli/agent@4.0.2": "patches/@npmcli%2Fagent@4.0.2.patch", "@npmcli/agent@4.0.2": "patches/@npmcli%2Fagent@4.0.2.patch",
"@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch", "@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch",
@ -1069,14 +1025,14 @@
"@effect/platform-node-shared": "4.1.0", "@effect/platform-node-shared": "4.1.0",
"@effect/sql-sqlite-bun": "4.1.0", "@effect/sql-sqlite-bun": "4.1.0",
"@effect/sql-sqlite-node": "4.1.0", "@effect/sql-sqlite-node": "4.1.0",
"@hona/strobe": "0.44.1", "@hona/strobe": "0.42.0",
"@kobalte/core": "0.13.13", "@kobalte/core": "0.13.13",
"@lydell/node-pty": "1.2.0-beta.12", "@lydell/node-pty": "1.2.0-beta.12",
"@npmcli/arborist": "9.4.0", "@npmcli/arborist": "9.4.0",
"@octokit/rest": "22.0.0", "@octokit/rest": "22.0.0",
"@opentui/core": "0.9.9", "@opentui/core": "0.8.4",
"@opentui/keymap": "0.9.9", "@opentui/keymap": "0.8.4",
"@opentui/solid": "0.9.9", "@opentui/solid": "0.8.4",
"@pierre/diffs": "1.6.1", "@pierre/diffs": "1.6.1",
"@pierre/highlights": "0.2.0", "@pierre/highlights": "0.2.0",
"@playwright/test": "1.60.0", "@playwright/test": "1.60.0",
@ -1611,19 +1567,19 @@
"@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.0.11", "", { "dependencies": { "@types/node": "^20.0.0", "happy-dom": "^20.0.11" } }, "sha512-GqNqiShBT/lzkHTMC/slKBrvN0DsD4Di8ssBk4aDaVgEn+2WMzE6DXxq701ndSXj7/0cJ8mNT71pM7Bnrr6JRw=="], "@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.0.11", "", { "dependencies": { "@types/node": "^20.0.0", "happy-dom": "^20.0.11" } }, "sha512-GqNqiShBT/lzkHTMC/slKBrvN0DsD4Di8ssBk4aDaVgEn+2WMzE6DXxq701ndSXj7/0cJ8mNT71pM7Bnrr6JRw=="],
"@hona/strobe": ["@hona/strobe@0.44.1", "", { "optionalDependencies": { "@hona/strobe-darwin-arm64": "0.44.1", "@hona/strobe-darwin-x64": "0.44.1", "@hona/strobe-linux-arm64": "0.44.1", "@hona/strobe-linux-x64": "0.44.1", "@hona/strobe-win32-arm64": "0.44.1", "@hona/strobe-win32-x64": "0.44.1" }, "bin": { "strobe": "bin/strobe.js" } }, "sha512-9HKNumRLqJm9OlAPCSNcB8HykhF5F7I4wcTwRf+CJ78xzDcMUSIekjRWz8MjpsTL5t4GdIckmMtyY7duiwo46A=="], "@hona/strobe": ["@hona/strobe@0.42.0", "", { "optionalDependencies": { "@hona/strobe-darwin-arm64": "0.42.0", "@hona/strobe-darwin-x64": "0.42.0", "@hona/strobe-linux-arm64": "0.42.0", "@hona/strobe-linux-x64": "0.42.0", "@hona/strobe-win32-arm64": "0.42.0", "@hona/strobe-win32-x64": "0.42.0" }, "bin": { "strobe": "bin/strobe.js" } }, "sha512-9yGVLIZszb4rw91ew9MYn+K+19WiEd24pY104fz8vKF3VF21qn+bv/MdrLHqGrE3fwEZvocR9uwrRuWjyDS7YQ=="],
"@hona/strobe-darwin-arm64": ["@hona/strobe-darwin-arm64@0.44.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-WsTn+iyJMy0/UTSCv5ZaS8JQ984ZSA724OcyYP+znncSEVFDkJbtWSKMQOCYJ6Z7TDP9PPSXIs/YhwdfPXvPow=="], "@hona/strobe-darwin-arm64": ["@hona/strobe-darwin-arm64@0.42.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-b3UmIH7pzDzmXSZJKzj6B0UNIO9D/zU0scI/Be9l6Lx7FOXVTMM9UyHdYlDOAUyC8ew4GIRW4Owksq8qu9Vdxw=="],
"@hona/strobe-darwin-x64": ["@hona/strobe-darwin-x64@0.44.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-lYnOotxHyBLJKrUZ+OPoMzDHqbv8MNU6rw4hy9LxIlbjJQ6szfl1WmQWDJVjGNlTH7xgd8nfQQDCSSdDNGJ1YA=="], "@hona/strobe-darwin-x64": ["@hona/strobe-darwin-x64@0.42.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-rMcTyYJH6Dg+NRur4Id8EyM3lZJSAxCCGFVe9qc+cy1GwBdDFjRmvSxqsdCQ/ah6txlkCOIWpyAxOuCk1z4liA=="],
"@hona/strobe-linux-arm64": ["@hona/strobe-linux-arm64@0.44.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-lHtb1VIYCK64OpannKujYtmUUr58inwZYyI+D6m/FcqSYnHadMdXSIhDoVWDFQwH0kDJ1uB5Jbu+sYMQDXMujw=="], "@hona/strobe-linux-arm64": ["@hona/strobe-linux-arm64@0.42.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-3QAWiuMc7kvpKvEtf0XE115PIAsQ+jXqgKrIUpcex943maskLTI1ZQIfJZTFqQm8EeeLe9nRI5X6jJt3ezsxhQ=="],
"@hona/strobe-linux-x64": ["@hona/strobe-linux-x64@0.44.1", "", { "os": "linux", "cpu": "x64" }, "sha512-a0uTF+Er8qBEzcusczs4r+DTBmEWHEvvMGkEE4hRzNIWw/b3o4x9khGh0vaoyXFp3H7S0x4mI4LcFItyc2kamA=="], "@hona/strobe-linux-x64": ["@hona/strobe-linux-x64@0.42.0", "", { "os": "linux", "cpu": "x64" }, "sha512-LJLtYy3HrYzXAA5mKrTAZ4oWnEQHig6MwfYaqLaBoR3q/0z8qDR5u1dPcsppzI1jlS6WD3isjmXSmWYHe32CcQ=="],
"@hona/strobe-win32-arm64": ["@hona/strobe-win32-arm64@0.44.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-CpOrG4ruzC7pq01WQR01HisipFgBd3ZTLl4QHirMk9khCmOE/E32lEqaEaIZ24q9hub3ozDfbVdzHRWXkHKAXw=="], "@hona/strobe-win32-arm64": ["@hona/strobe-win32-arm64@0.42.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-upHLoBRbDsqMTmbm5QoryhUBPiQchp1MWo8FaImfPElsy25uiQKnlWfS5y4NlRLfZFZBStiSbiC0zupmXKxx0g=="],
"@hona/strobe-win32-x64": ["@hona/strobe-win32-x64@0.44.1", "", { "os": "win32", "cpu": "x64" }, "sha512-eH1/RvKy2en7DAUFinyq1ITw9FR/S0IJVrgXcHigxSyjUQIBsvII0UenbVeBoE4/ljd/BOw4aLx/GBsznrn1Zg=="], "@hona/strobe-win32-x64": ["@hona/strobe-win32-x64@0.42.0", "", { "os": "win32", "cpu": "x64" }, "sha512-cD64z5dlcNBDOgYnJlN5bcvGo1m8KUn7Ax3ttzZH33G9dVpeWdb+QhLgBq/CtPDKHf21mD+5WklCYaLMRBHk6A=="],
"@hono/node-server": ["@hono/node-server@2.1.5", "", { "peerDependencies": { "hono": "^4 || ^5.0.0-0" } }, "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q=="], "@hono/node-server": ["@hono/node-server@2.1.5", "", { "peerDependencies": { "hono": "^4 || ^5.0.0-0" } }, "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q=="],
@ -1787,30 +1743,6 @@
"@npmcli/run-script": ["@npmcli/run-script@10.0.4", "", { "dependencies": { "@npmcli/node-gyp": "^5.0.0", "@npmcli/package-json": "^7.0.0", "@npmcli/promise-spawn": "^9.0.0", "node-gyp": "^12.1.0", "proc-log": "^6.0.0" } }, "sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg=="], "@npmcli/run-script": ["@npmcli/run-script@10.0.4", "", { "dependencies": { "@npmcli/node-gyp": "^5.0.0", "@npmcli/package-json": "^7.0.0", "@npmcli/promise-spawn": "^9.0.0", "node-gyp": "^12.1.0", "proc-log": "^6.0.0" } }, "sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg=="],
"@number0/iroh": ["@number0/iroh@1.2.0", "", { "optionalDependencies": { "@number0/iroh-android-arm-eabi": "1.2.0", "@number0/iroh-android-arm64": "1.2.0", "@number0/iroh-darwin-arm64": "1.2.0", "@number0/iroh-linux-arm-gnueabihf": "1.2.0", "@number0/iroh-linux-arm-musleabihf": "1.2.0", "@number0/iroh-linux-arm64-gnu": "1.2.0", "@number0/iroh-linux-arm64-musl": "1.2.0", "@number0/iroh-linux-x64-gnu": "1.2.0", "@number0/iroh-linux-x64-musl": "1.2.0", "@number0/iroh-win32-arm64-msvc": "1.2.0", "@number0/iroh-win32-x64-msvc": "1.2.0" } }, "sha512-pZoVnL+8nK4DQG3owF5UQ/LcIjg7m2Ue1oeEUEhLsNt9RHtEFxiASNSPopOdsRfjRimJ/e6zjQ0k3iYE6N1hZQ=="],
"@number0/iroh-android-arm-eabi": ["@number0/iroh-android-arm-eabi@1.2.0", "", { "os": "android", "cpu": "arm" }, "sha512-T8Hp4G1ewh/7AUI8DBHi596Rlr9zZZzPA3CpN58XSSQBxUEpiqxtZoYmEa3w6QgVw1o5IQrEgAUxLN7ogBtnig=="],
"@number0/iroh-android-arm64": ["@number0/iroh-android-arm64@1.2.0", "", { "os": "android", "cpu": "arm64" }, "sha512-etoVzrsoPAij+XhD+BECISJKYUG6eW+XS43I5P4SD+nqAIJ6XnMTy/Brwayuj8ERoRaFLClL8bb++v5883TcrA=="],
"@number0/iroh-darwin-arm64": ["@number0/iroh-darwin-arm64@1.2.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-91oxmPrYiCnU0APp/Ky0mgNOxaIukQDFUvxth32TDq38vJs0lDX9ppAsWrkCA+4A/kJnAt1hc7YhIKcIGD3xOA=="],
"@number0/iroh-linux-arm-gnueabihf": ["@number0/iroh-linux-arm-gnueabihf@1.2.0", "", { "os": "linux", "cpu": "arm" }, "sha512-PTi5YyxjkLluzVec5Q0NJqRUaYcVT76sZ0SaM10HFGlwlTIniYO7DYUGTLs+XcByUBcE7Ph5xkyvoLmB1mOF4A=="],
"@number0/iroh-linux-arm-musleabihf": ["@number0/iroh-linux-arm-musleabihf@1.2.0", "", { "os": "linux", "cpu": "arm" }, "sha512-IwOPvWOEyX6ZMHjctDaZyWVV2kJSXx57DRN2l5Qg/cEQjY5zWO4IMFvjw075IKrQk+VpU6RrEEI++2w2Gci1dA=="],
"@number0/iroh-linux-arm64-gnu": ["@number0/iroh-linux-arm64-gnu@1.2.0", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-LEenFEMMWLnlyFy8++cYq+s7/nibFgFzs1kGDk7WvFDyxT3U2z0W0+hjENzDiS1iCtH8+zesdDdFxuQtxjJHYg=="],
"@number0/iroh-linux-arm64-musl": ["@number0/iroh-linux-arm64-musl@1.2.0", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-YgCWpz80VOTJRtAUsTKFgLYtd7tfWwrRCD0uk3/xG4z+AjiY5c49toeDFTJJ/3SF5Q8qmjWGjpcUk6B1E55D4w=="],
"@number0/iroh-linux-x64-gnu": ["@number0/iroh-linux-x64-gnu@1.2.0", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-SkZUe/dqv7J1kY3Af0Cu07ldfdstEDOz6F3yIKwMw/EpabhaE3fvdDbiDQoiMxbwgIiJMspChHRMZeC88Td3QQ=="],
"@number0/iroh-linux-x64-musl": ["@number0/iroh-linux-x64-musl@1.2.0", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-UnZHStWdFZgylftmX2IHF+VKkrkbEhK+amkOf7A9Z3JPrqkbF5em3UW3uyDK3qfhcc9Ijc3nnYKxym+BkOLPjQ=="],
"@number0/iroh-win32-arm64-msvc": ["@number0/iroh-win32-arm64-msvc@1.2.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-2srn9OquRffLD1bQiCDRLr3T1yxmc9xc3k4oLgEMWU+lZnaMONRS2r46cTXN1b/bGsSc82TjGCO/urauXZjQcQ=="],
"@number0/iroh-win32-x64-msvc": ["@number0/iroh-win32-x64-msvc@1.2.0", "", { "os": "win32", "cpu": "x64" }, "sha512-3ltCadoaZzrRM9OmPcfwPpqwF/DBXlzhwsOIXITtpFEFfRISgvbqyhmMCaiumpyXxFeGTCfpwvUJ40i+sE0sVQ=="],
"@octokit/auth-app": ["@octokit/auth-app@8.0.1", "", { "dependencies": { "@octokit/auth-oauth-app": "^9.0.1", "@octokit/auth-oauth-user": "^6.0.0", "@octokit/request": "^10.0.2", "@octokit/request-error": "^7.0.0", "@octokit/types": "^14.0.0", "toad-cache": "^3.7.0", "universal-github-app-jwt": "^2.2.0", "universal-user-agent": "^7.0.0" } }, "sha512-P2J5pB3pjiGwtJX4WqJVYCtNkcZ+j5T2Wm14aJAEIC3WJOrv12jvBley3G1U/XI8q9o1A7QMG54LiFED2BiFlg=="], "@octokit/auth-app": ["@octokit/auth-app@8.0.1", "", { "dependencies": { "@octokit/auth-oauth-app": "^9.0.1", "@octokit/auth-oauth-user": "^6.0.0", "@octokit/request": "^10.0.2", "@octokit/request-error": "^7.0.0", "@octokit/types": "^14.0.0", "toad-cache": "^3.7.0", "universal-github-app-jwt": "^2.2.0", "universal-user-agent": "^7.0.0" } }, "sha512-P2J5pB3pjiGwtJX4WqJVYCtNkcZ+j5T2Wm14aJAEIC3WJOrv12jvBley3G1U/XI8q9o1A7QMG54LiFED2BiFlg=="],
"@octokit/auth-oauth-app": ["@octokit/auth-oauth-app@9.0.4", "", { "dependencies": { "@octokit/auth-oauth-device": "^8.0.4", "@octokit/auth-oauth-user": "^6.0.3", "@octokit/request": "^10.0.13", "@octokit/types": "^17.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-Pe3du5LrC6dlv10b0RbarBlJtIT1Urq8BFoQklK8WmBw8YKnGgrANn7cQmHiA1v8AVihgi7YutV8MncP57I4og=="], "@octokit/auth-oauth-app": ["@octokit/auth-oauth-app@9.0.4", "", { "dependencies": { "@octokit/auth-oauth-device": "^8.0.4", "@octokit/auth-oauth-user": "^6.0.3", "@octokit/request": "^10.0.13", "@octokit/types": "^17.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-Pe3du5LrC6dlv10b0RbarBlJtIT1Urq8BFoQklK8WmBw8YKnGgrANn7cQmHiA1v8AVihgi7YutV8MncP57I4og=="],
@ -1859,8 +1791,6 @@
"@opencode/cli": ["@opencode/cli@workspace:packages/cli"], "@opencode/cli": ["@opencode/cli@workspace:packages/cli"],
"@opencode/cli-rs": ["@opencode/cli-rs@workspace:packages/cli-rs"],
"@opencode/client": ["@opencode/client@workspace:packages/client"], "@opencode/client": ["@opencode/client@workspace:packages/client"],
"@opencode/codemode": ["@opencode/codemode@workspace:packages/codemode"], "@opencode/codemode": ["@opencode/codemode@workspace:packages/codemode"],
@ -1889,8 +1819,6 @@
"@opencode/legacy": ["@opencode/legacy@workspace:services/legacy"], "@opencode/legacy": ["@opencode/legacy@workspace:services/legacy"],
"@opencode/locale": ["@opencode/locale@workspace:packages/locale"],
"@opencode/merman": ["@opencode/merman@workspace:packages/merman"], "@opencode/merman": ["@opencode/merman@workspace:packages/merman"],
"@opencode/nav-menus": ["@opencode/nav-menus@workspace:packages/nav-menus"], "@opencode/nav-menus": ["@opencode/nav-menus@workspace:packages/nav-menus"],
@ -1979,27 +1907,27 @@
"@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.43.0", "", {}, "sha512-eSYWTm620tTk45EKSedaUL8MFYI8hW164hIXsgIHyxu3VobUB3fFCu5t0hQby6OoWRPsG1KkKUG2M5UadiLiVg=="], "@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.43.0", "", {}, "sha512-eSYWTm620tTk45EKSedaUL8MFYI8hW164hIXsgIHyxu3VobUB3fFCu5t0hQby6OoWRPsG1KkKUG2M5UadiLiVg=="],
"@opentui/core": ["@opentui/core@0.9.9", "", { "dependencies": { "bun-ffi-structs": "0.3.1", "diff": "9.0.0", "string-width": "7.2.0" }, "optionalDependencies": { "@opentui/core-darwin-arm64": "0.9.9", "@opentui/core-darwin-x64": "0.9.9", "@opentui/core-linux-arm64": "0.9.9", "@opentui/core-linux-arm64-musl": "0.9.9", "@opentui/core-linux-x64": "0.9.9", "@opentui/core-linux-x64-musl": "0.9.9", "@opentui/core-win32-arm64": "0.9.9", "@opentui/core-win32-x64": "0.9.9" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-Dq4pFkTvM6QkQw8lcplnRF1JFbW5vSSYmymUA/nIVKOoqSUV/cxV3ns3KkOGwzR/JpeGxGrzc4wXEuY5RYrTzQ=="], "@opentui/core": ["@opentui/core@0.8.4", "", { "dependencies": { "bun-ffi-structs": "0.3.1", "diff": "9.0.0", "marked": "17.0.1", "string-width": "7.2.0" }, "optionalDependencies": { "@opentui/core-darwin-arm64": "0.8.4", "@opentui/core-darwin-x64": "0.8.4", "@opentui/core-linux-arm64": "0.8.4", "@opentui/core-linux-arm64-musl": "0.8.4", "@opentui/core-linux-x64": "0.8.4", "@opentui/core-linux-x64-musl": "0.8.4", "@opentui/core-win32-arm64": "0.8.4", "@opentui/core-win32-x64": "0.8.4" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-s2z2FFEWxsQ6IPVEiAjlHHY5yssnCI+dIltL54+ZhVz1EWxylaB0HER+ypPL2goot0DKwKqrM57rnomh19/2rQ=="],
"@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.9.9", "", { "os": "darwin", "cpu": "arm64" }, "sha512-KmDAKo9GnvJ8HNw8C9YSUdeA8jO1xjp7YxObPhhfdxfpWCwHOrM2W91pmgW14p52vOdvhCBMZvgX/1mHFAXYbQ=="], "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.8.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-kAWCmLsGuxQANeq4AjjX0Yodca2VIofQGUfIH9Edg9BKajYpf941heZfMJkkkJUXawYTNFTR2lBYsdneUUJBrg=="],
"@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.9.9", "", { "os": "darwin", "cpu": "x64" }, "sha512-3fz8z5kZwawz/PvewzDVDkyVYMrLqIDA/Eat1jwVkzFrqCVqh903P7Qr6Wpf/Ahg5La/qqqZMxRRYjc40qEW+A=="], "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.8.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-0S62YHtIh1Q9tTun7065njEtYUUtf1zXwllDKXr63R1cVgq+8eRdVQ2PsAGNOqB5OYYno+M8o2tuK/Es2uvmBA=="],
"@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.9.9", "", { "os": "linux", "cpu": "arm64" }, "sha512-nHLjJH04gqsE2WW6P0yNuzlxddeBYTwDpyDfscico9YBtOj21stfpEf7G5PIGhfeMCSmsY3D1B52ebrISq0YgA=="], "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.8.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-VGnBN3ItBwZog109wtPIou8pn93TseZwA5OZ05X2PYIYPw+IC6mVeO2Dn0qwwozLBDxeyH3ydbHMFlwzS4/fLg=="],
"@opentui/core-linux-arm64-musl": ["@opentui/core-linux-arm64-musl@0.9.9", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-FdbKKXfXk6Y5z46wojVNnHyPuEns8Dn7/ONhYTgBi0Z/dBVc/aRWRYzXHIn7x3ZBLpA0fNU01wTAW3SxgOmBmQ=="], "@opentui/core-linux-arm64-musl": ["@opentui/core-linux-arm64-musl@0.8.4", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-IG887NHjPJEw5D1dvNl9jPbcwNFREFKj2fnqEjdrwCnDRywtjNL7k7GgTo24NNlyMAZAq0OkoM0M0Sn6ex/Adg=="],
"@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.9.9", "", { "os": "linux", "cpu": "x64" }, "sha512-7W0ffV5ci202+6IkY3oh5Y67QWj/CjVJY0LkSaGu56/rLtRWL6RIl0/V9S5NSu2EcwqAyTp8C+EIhBdOoDwhCA=="], "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.8.4", "", { "os": "linux", "cpu": "x64" }, "sha512-N/uxyaPpWkCZlDXz3fgHMfMuj1L3IVZ/xZ4JifUc4NW9bwa/CYWFJ5J5jBoy2QsAIqoqo8/OD3iFpXR4o12mNQ=="],
"@opentui/core-linux-x64-musl": ["@opentui/core-linux-x64-musl@0.9.9", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-LvFHYVK/oWTsjaMj7UknAWMmRlhfpo85vW+RALHd2Y/t0PnRCHlEr2uRWPAlrymqIxU4tqei6BIodQLozc0HLg=="], "@opentui/core-linux-x64-musl": ["@opentui/core-linux-x64-musl@0.8.4", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-FAiH7wMt/ZbpP2w6TL62deNExTg5w6mujKUBSK89+gJV8FN4jk/K2xz9f522aYhC6SdbpyIKwS0oGIJldYLkcg=="],
"@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.9.9", "", { "os": "win32", "cpu": "arm64" }, "sha512-EiLfLFuNV4z1iXzx0fCDKGuweME4qkQOZgtLQmKak7IXicng02w3hbgkeWZrtPvuuZWB3WkqnNa0j6OD7UbpJQ=="], "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.8.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-vjDuuIcmanoipIKdME8A7ZuBgIw2E1fv4pRJp6M19+Zfx0HIUmtA8bv+mT/kaz8Cpad9EUzJkNI5fV8P2p/iKg=="],
"@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.9.9", "", { "os": "win32", "cpu": "x64" }, "sha512-WhLVmvPr5V+K0LN7ss0Ss0LxgYHyM0SKAaOtWP9oJSt4LnyFnRd3Hy6OQh67dANlCmr/sSkRN8OqQ0thmWuFyA=="], "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.8.4", "", { "os": "win32", "cpu": "x64" }, "sha512-I4XnzUmyKCb8cRD1UntQXRkIEl0fxfQnzS3bTODWbENAOdRsK2c7Ff07DG2qTAqNijyTuk63C+uLmAT9ObOQ1Q=="],
"@opentui/keymap": ["@opentui/keymap@0.9.9", "", { "dependencies": { "@opentui/core": "0.9.9" }, "peerDependencies": { "@opentui/react": "0.9.9", "@opentui/solid": "0.9.9", "react": ">=19.2.0", "solid-js": "^1.9.12" }, "optionalPeers": ["@opentui/react", "@opentui/solid", "react", "solid-js"] }, "sha512-XCxlKiuNBf9Dd6DjuUN54bElHikZ2EMi5fKP7ucJ9pc/n5Kgzcq/tu+qOx1K33LGvTLYpoSMWkMlW3WLgUqKtw=="], "@opentui/keymap": ["@opentui/keymap@0.8.4", "", { "dependencies": { "@opentui/core": "0.8.4" }, "peerDependencies": { "@opentui/react": "0.8.4", "@opentui/solid": "0.8.4", "react": ">=19.2.0", "solid-js": "^1.9.12" }, "optionalPeers": ["@opentui/react", "@opentui/solid", "react", "solid-js"] }, "sha512-dOHQYgvToXsYr4Am44wBEhvSvaF2bqZfJM8xPhEEZlpcnww3/+eh3OEq30btAKcukIMxDH0dI5cyCUfF2/8yUw=="],
"@opentui/solid": ["@opentui/solid@0.9.9", "", { "dependencies": { "@babel/core": "7.29.7", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.9.9", "babel-preset-solid": "1.9.16", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "^1.9.12" } }, "sha512-8bDc7vZThFMK4QX2LtHz+sHiZAdwwIn6c/0Pm4iFKoUSkCtuHg6YcXK5c7ZZdReXXMPbfh5Km9MI8iL0LW2ddg=="], "@opentui/solid": ["@opentui/solid@0.8.4", "", { "dependencies": { "@babel/core": "7.29.7", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.8.4", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.16", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "^1.9.12" } }, "sha512-QyaWIAtZTaAdYJiP4K2cG6hbXQkNUBfa0hjYQwvvr/V2OFIZWZ7l+SP8CYM05lBqVDfOraeThvSrhX+IuvKySA=="],
"@opentunnel/client": ["@opentunnel/client@0.6.1", "", { "dependencies": { "@opentunnel/protocol": "0.6.1" }, "peerDependencies": { "effect": "^4.0.0", "undici": ">=7.0.0" }, "optionalPeers": ["undici"] }, "sha512-OuVNlWywQebIXCtkixjVHebOsR3KFRxJ0DSZry6Dzj4hHaHIf3eTVmQ7VwLCjuVmw+ctU2qHIP6RxuAPr07WDw=="], "@opentunnel/client": ["@opentunnel/client@0.6.1", "", { "dependencies": { "@opentunnel/protocol": "0.6.1" }, "peerDependencies": { "effect": "^4.0.0", "undici": ">=7.0.0" }, "optionalPeers": ["undici"] }, "sha512-OuVNlWywQebIXCtkixjVHebOsR3KFRxJ0DSZry6Dzj4hHaHIf3eTVmQ7VwLCjuVmw+ctU2qHIP6RxuAPr07WDw=="],
@ -2347,7 +2275,7 @@
"@silvia-odwyer/photon-node": ["@silvia-odwyer/photon-node@0.3.4", "", {}, "sha512-bnly4BKB3KDTFxrUIcgCLbaeVVS8lrAkri1pEzskpmxu9MdfGQTy8b8EgcD83ywD3RPMsIulY8xJH5Awa+t9fA=="], "@silvia-odwyer/photon-node": ["@silvia-odwyer/photon-node@0.3.4", "", {}, "sha512-bnly4BKB3KDTFxrUIcgCLbaeVVS8lrAkri1pEzskpmxu9MdfGQTy8b8EgcD83ywD3RPMsIulY8xJH5Awa+t9fA=="],
"@sindresorhus/is": ["@sindresorhus/is@7.2.0", "", {}, "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw=="], "@sindresorhus/is": ["@sindresorhus/is@4.6.0", "", {}, "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="],
"@smithy/core": ["@smithy/core@3.33.2", "", { "dependencies": { "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-CUGXpnPkVdjUCbix+83sWLW9VFgQOm44MDOx/ihITJMAnOZKvL8YYIc7DR9pP/tZ8CIRvMiON/TucvygqbHO3w=="], "@smithy/core": ["@smithy/core@3.33.2", "", { "dependencies": { "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-CUGXpnPkVdjUCbix+83sWLW9VFgQOm44MDOx/ihITJMAnOZKvL8YYIc7DR9pP/tZ8CIRvMiON/TucvygqbHO3w=="],
@ -2715,6 +2643,8 @@
"babel-plugin-jsx-dom-expressions": ["babel-plugin-jsx-dom-expressions@0.40.10", "", { "dependencies": { "@babel/helper-module-imports": "7.18.6", "@babel/plugin-syntax-jsx": "^7.18.6", "@babel/types": "^7.20.7", "html-entities": "2.3.3", "parse5": "^7.1.2" }, "peerDependencies": { "@babel/core": "^7.20.12" } }, "sha512-lxve6Y02YiZTldB7efKpnbf1BH00XCFZNYYW235jSGsYaJNFtHrYlKV6/O+miHbjqpIr9FTe5+0no4hofAMbfA=="], "babel-plugin-jsx-dom-expressions": ["babel-plugin-jsx-dom-expressions@0.40.10", "", { "dependencies": { "@babel/helper-module-imports": "7.18.6", "@babel/plugin-syntax-jsx": "^7.18.6", "@babel/types": "^7.20.7", "html-entities": "2.3.3", "parse5": "^7.1.2" }, "peerDependencies": { "@babel/core": "^7.20.12" } }, "sha512-lxve6Y02YiZTldB7efKpnbf1BH00XCFZNYYW235jSGsYaJNFtHrYlKV6/O+miHbjqpIr9FTe5+0no4hofAMbfA=="],
"babel-plugin-module-resolver": ["babel-plugin-module-resolver@5.0.2", "", { "dependencies": { "find-babel-config": "^2.1.1", "glob": "^9.3.3", "pkg-up": "^3.1.0", "reselect": "^4.1.7", "resolve": "^1.22.8" } }, "sha512-9KtaCazHee2xc0ibfqsDeamwDps6FZNo5S0Q81dUqEuFzVwPhcT4J5jOqIVvgCA3Q/wO9hKYxN/Ds3tIsp5ygg=="],
"babel-plugin-polyfill-corejs2": ["babel-plugin-polyfill-corejs2@0.4.17", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-define-polyfill-provider": "^0.6.8", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w=="], "babel-plugin-polyfill-corejs2": ["babel-plugin-polyfill-corejs2@0.4.17", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-define-polyfill-provider": "^0.6.8", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w=="],
"babel-plugin-polyfill-corejs3": ["babel-plugin-polyfill-corejs3@0.14.2", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.8", "core-js-compat": "^3.48.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-coWpDLJ410R781Npmn/SIBZEsAetR4xVi0SxLMXPaMO4lSf1MwnkGYMtkFxew0Dn8B3/CpbpYxN0JCgg8mn67g=="], "babel-plugin-polyfill-corejs3": ["babel-plugin-polyfill-corejs3@0.14.2", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.8", "core-js-compat": "^3.48.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-coWpDLJ410R781Npmn/SIBZEsAetR4xVi0SxLMXPaMO4lSf1MwnkGYMtkFxew0Dn8B3/CpbpYxN0JCgg8mn67g=="],
@ -3163,6 +3093,8 @@
"finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="], "finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],
"find-babel-config": ["find-babel-config@2.1.2", "", { "dependencies": { "json5": "^2.2.3" } }, "sha512-ZfZp1rQyp4gyuxqt1ZqjFGVeVBvmpURMqdIWXbPRfB97Bf6BzdK/xSIbylEINzQ0kB5tlDQfn9HkNXXWsqTqLg=="],
"find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],
"for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="], "for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
@ -3715,7 +3647,7 @@
"mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="], "mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="],
"miniflare": ["miniflare@4.20260708.1", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.34.5", "undici": "7.28.0", "workerd": "1.20260708.1", "ws": "8.21.0", "youch": "4.1.0-beta.10" }, "bin": { "miniflare": "bootstrap.js" } }, "sha512-c94O9zRDISdqO18EHt6l0iF/fWgWt8p18PJvRsA/L/NJZ9Cfke3s/F5Blg1XXF7WDutVRzWVWy8Vy4LaT5ifsA=="], "miniflare": ["miniflare@5.20260930.0-alpha", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.35.4", "undici": "7.29.1", "workerd": "1.20260930.2", "ws": "8.21.0", "youch": "4.1.0-beta.10" } }, "sha512-vZljfRtOEeynbhJtuvYsnCU8t6zF5wIUm9ql4YFHB7zvYw2+F2tpT0BzXjzaa++eiUIml1gsODCf02qShBmJdg=="],
"minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], "minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="],
@ -3837,6 +3769,8 @@
"p-map": ["p-map@7.0.6", "", {}, "sha512-I4Prw6ivkd6p8PiYR1tXASOAOBzIJwu0TB7fqaX0c/8c3QAehNYmX57EijyGGGBt3c/BIowGwV03RVBtXvHEVg=="], "p-map": ["p-map@7.0.6", "", {}, "sha512-I4Prw6ivkd6p8PiYR1tXASOAOBzIJwu0TB7fqaX0c/8c3QAehNYmX57EijyGGGBt3c/BIowGwV03RVBtXvHEVg=="],
"p-try": ["p-try@2.2.0", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],
"package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="], "package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="],
"pacote": ["pacote@21.5.1", "", { "dependencies": { "@gar/promise-retry": "^1.0.0", "@npmcli/git": "^7.0.0", "@npmcli/installed-package-contents": "^4.0.0", "@npmcli/package-json": "^7.0.0", "@npmcli/promise-spawn": "^9.0.0", "@npmcli/run-script": "^10.0.0", "cacache": "^20.0.0", "fs-minipass": "^3.0.0", "minipass": "^7.0.2", "npm-package-arg": "^13.0.0", "npm-packlist": "^10.0.1", "npm-pick-manifest": "^11.0.1", "npm-registry-fetch": "^19.0.0", "proc-log": "^6.0.0", "sigstore": "^4.0.0", "ssri": "^13.0.0", "tar": "^7.4.3" }, "bin": { "pacote": "bin/index.js" } }, "sha512-KvcJ9iy3crysCsgqc4+PknH/w6jkrp8JN36mpZBPwNaDRwTfMZD37YzRazNstiZUOhuF5pno9f78n9mEJBavwg=="], "pacote": ["pacote@21.5.1", "", { "dependencies": { "@gar/promise-retry": "^1.0.0", "@npmcli/git": "^7.0.0", "@npmcli/installed-package-contents": "^4.0.0", "@npmcli/package-json": "^7.0.0", "@npmcli/promise-spawn": "^9.0.0", "@npmcli/run-script": "^10.0.0", "cacache": "^20.0.0", "fs-minipass": "^3.0.0", "minipass": "^7.0.2", "npm-package-arg": "^13.0.0", "npm-packlist": "^10.0.1", "npm-pick-manifest": "^11.0.1", "npm-registry-fetch": "^19.0.0", "proc-log": "^6.0.0", "sigstore": "^4.0.0", "ssri": "^13.0.0", "tar": "^7.4.3" }, "bin": { "pacote": "bin/index.js" } }, "sha512-KvcJ9iy3crysCsgqc4+PknH/w6jkrp8JN36mpZBPwNaDRwTfMZD37YzRazNstiZUOhuF5pno9f78n9mEJBavwg=="],
@ -3881,6 +3815,8 @@
"pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="],
"pkg-up": ["pkg-up@3.1.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="],
"pkijs": ["pkijs@3.4.0", "", { "dependencies": { "@noble/hashes": "1.4.0", "asn1js": "^3.0.6", "bytestreamjs": "^2.0.1", "pvtsutils": "^1.3.6", "pvutils": "^1.1.3", "tslib": "^2.8.1" } }, "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw=="], "pkijs": ["pkijs@3.4.0", "", { "dependencies": { "@noble/hashes": "1.4.0", "asn1js": "^3.0.6", "bytestreamjs": "^2.0.1", "pvtsutils": "^1.3.6", "pvutils": "^1.1.3", "tslib": "^2.8.1" } }, "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw=="],
"playwright": ["playwright@1.60.0", "", { "dependencies": { "playwright-core": "1.60.0" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA=="], "playwright": ["playwright@1.60.0", "", { "dependencies": { "playwright-core": "1.60.0" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA=="],
@ -3931,8 +3867,6 @@
"proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="],
"psychoscript": ["psychoscript@0.3.0", "", { "dependencies": { "acorn": "8.15.0" }, "peerDependencies": { "effect": "^4.1.0" }, "optionalPeers": ["effect"] }, "sha512-S4VohBlR6aXJtitKUZaYJ0OYs7AHjdKqBGYEL+6YoMU0oBFiVTFw8vTPrFujKBRuhjtj5kNu69CCJ/MBk4eM2g=="],
"pump": ["pump@3.0.4", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="], "pump": ["pump@3.0.4", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="],
"pupa": ["pupa@3.3.0", "", { "dependencies": { "escape-goat": "^4.0.0" } }, "sha512-LjgDO2zPtoXP2wJpDjZrGdojii1uqO0cnwKoIoUzkfS98HDmbeiGmYiXo3lXeFlq2xvne1QFQhwYXSUCLKtEuA=="], "pupa": ["pupa@3.3.0", "", { "dependencies": { "escape-goat": "^4.0.0" } }, "sha512-LjgDO2zPtoXP2wJpDjZrGdojii1uqO0cnwKoIoUzkfS98HDmbeiGmYiXo3lXeFlq2xvne1QFQhwYXSUCLKtEuA=="],
@ -4029,6 +3963,8 @@
"resedit": ["resedit@1.7.2", "", { "dependencies": { "pe-library": "^0.4.1" } }, "sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA=="], "resedit": ["resedit@1.7.2", "", { "dependencies": { "pe-library": "^0.4.1" } }, "sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA=="],
"reselect": ["reselect@4.1.8", "", {}, "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ=="],
"resolve": ["resolve@1.22.12", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="], "resolve": ["resolve@1.22.12", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="],
"resolve-alpn": ["resolve-alpn@1.2.1", "", {}, "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="], "resolve-alpn": ["resolve-alpn@1.2.1", "", {}, "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="],
@ -4279,9 +4215,7 @@
"tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="],
"tldts": ["tldts@7.5.1", "", { "dependencies": { "tldts-core": "^7.5.1" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-UW1Z5afSpu5qA0qhDnaynyiwPa+/VC7J/mofz72R032It5DUTUWk8I502cAitA6qMQV1x7IwNHg7pCBNVORVww=="], "tldts-core": ["tldts-core@7.4.11", "", {}, "sha512-CW3WN2rIIE/Of21mulhgnGOwoDyEFNygyIBOONSdyAuSATgMMUCpLeUlB+E8sAwA5xRV9hYPl+kyZ9citHCaKg=="],
"tldts-core": ["tldts-core@7.5.1", "", {}, "sha512-GGSowIH9Pp52ym/x0OxBBNqS2DuqlLL91YNnlnj+k+ZWjJQ+ilNxpwP7/RT+iX1gzuafhj1l7j46CNVqm+xAeQ=="],
"tldts-icann": ["tldts-icann@7.4.11", "", { "dependencies": { "tldts-core": "^7.4.11" } }, "sha512-1p+NDJ7FUYCliESmsQl9EW5Um8JIyFheiy6Y6ZoHho27d+TLAGFa0gMf1VOVy02vNY1aQo6xeKiaGj45+7P+PA=="], "tldts-icann": ["tldts-icann@7.4.11", "", { "dependencies": { "tldts-core": "^7.4.11" } }, "sha512-1p+NDJ7FUYCliESmsQl9EW5Um8JIyFheiy6Y6ZoHho27d+TLAGFa0gMf1VOVy02vNY1aQo6xeKiaGj45+7P+PA=="],
@ -4643,8 +4577,6 @@
"@opencode/site/@types/react": ["@types/react@19.3.0", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg=="], "@opencode/site/@types/react": ["@types/react@19.3.0", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg=="],
"@opencode/site/miniflare": ["miniflare@5.20260930.0-alpha", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.35.4", "undici": "7.29.1", "workerd": "1.20260930.2", "ws": "8.21.0", "youch": "4.1.0-beta.10" } }, "sha512-vZljfRtOEeynbhJtuvYsnCU8t6zF5wIUm9ql4YFHB7zvYw2+F2tpT0BzXjzaa++eiUIml1gsODCf02qShBmJdg=="],
"@opencode/stories/@tailwindcss/vite": ["@tailwindcss/vite@4.1.11", "", { "dependencies": { "@tailwindcss/node": "4.1.11", "@tailwindcss/oxide": "4.1.11", "tailwindcss": "4.1.11" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7" } }, "sha512-RHYhrR3hku0MJFRV+fN2gNbDNEh3dwKvY8XJvTxCSXeMOsCRSr+uKvDWQcbizrHgjML6ZmTE5OwMrl5wKcujCw=="], "@opencode/stories/@tailwindcss/vite": ["@tailwindcss/vite@4.1.11", "", { "dependencies": { "@tailwindcss/node": "4.1.11", "@tailwindcss/oxide": "4.1.11", "tailwindcss": "4.1.11" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7" } }, "sha512-RHYhrR3hku0MJFRV+fN2gNbDNEh3dwKvY8XJvTxCSXeMOsCRSr+uKvDWQcbizrHgjML6ZmTE5OwMrl5wKcujCw=="],
"@opencode/stories/vite": ["vite@7.3.7", "", { "dependencies": { "esbuild": "^0.27.0 || ^0.28.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA=="], "@opencode/stories/vite": ["vite@7.3.7", "", { "dependencies": { "esbuild": "^0.27.0 || ^0.28.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA=="],
@ -4673,6 +4605,8 @@
"@opentui/core/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="], "@opentui/core/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="],
"@opentui/core/marked": ["marked@17.0.1", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-boeBdiS0ghpWcSwoNm/jJBwdpFaMnZWRzjA6SkUMYb40SVaN1x7mmfGKp0jvexGcx+7y2La5zRZsYFZI6Qpypg=="],
"@opentui/solid/babel-preset-solid": ["babel-preset-solid@1.9.16", "", { "dependencies": { "babel-plugin-jsx-dom-expressions": "^0.40.11" }, "peerDependencies": { "@babel/core": "^7.0.0", "solid-js": "^1.9.16" }, "optionalPeers": ["solid-js"] }, "sha512-+0h40Qk2oBfkQ4OGDBHIDtvq/XQiOnCfzjNHmMxriAr8MmdsaIbyJgqYglDs4d70sF8O08sSpx61TKdpUt3oRw=="], "@opentui/solid/babel-preset-solid": ["babel-preset-solid@1.9.16", "", { "dependencies": { "babel-plugin-jsx-dom-expressions": "^0.40.11" }, "peerDependencies": { "@babel/core": "^7.0.0", "solid-js": "^1.9.16" }, "optionalPeers": ["solid-js"] }, "sha512-+0h40Qk2oBfkQ4OGDBHIDtvq/XQiOnCfzjNHmMxriAr8MmdsaIbyJgqYglDs4d70sF8O08sSpx61TKdpUt3oRw=="],
"@oxc-parser/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="], "@oxc-parser/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="],
@ -4683,6 +4617,8 @@
"@pierre/diffs/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="], "@pierre/diffs/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="],
"@poppinss/dumper/@sindresorhus/is": ["@sindresorhus/is@7.2.0", "", {}, "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw=="],
"@poppinss/dumper/supports-color": ["supports-color@10.2.2", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="], "@poppinss/dumper/supports-color": ["supports-color@10.2.2", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="],
"@puppeteer/browsers/yargs": ["yargs@18.1.0", "", { "dependencies": { "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "string-width": "^8.2.1", "y18n": "^5.0.5", "yargs-parser": "^22.0.0" } }, "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg=="], "@puppeteer/browsers/yargs": ["yargs@18.1.0", "", { "dependencies": { "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "string-width": "^8.2.1", "y18n": "^5.0.5", "yargs-parser": "^22.0.0" } }, "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg=="],
@ -4739,14 +4675,14 @@
"babel-plugin-jsx-dom-expressions/@babel/helper-module-imports": ["@babel/helper-module-imports@7.18.6", "", { "dependencies": { "@babel/types": "^7.18.6" } }, "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA=="], "babel-plugin-jsx-dom-expressions/@babel/helper-module-imports": ["@babel/helper-module-imports@7.18.6", "", { "dependencies": { "@babel/types": "^7.18.6" } }, "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA=="],
"babel-plugin-module-resolver/glob": ["glob@9.3.5", "", { "dependencies": { "fs.realpath": "^1.0.0", "minimatch": "^8.0.2", "minipass": "^4.2.4", "path-scurry": "^1.6.1" } }, "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q=="],
"babel-plugin-polyfill-corejs2/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], "babel-plugin-polyfill-corejs2/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
"body-parser/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], "body-parser/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="],
"builder-util/js-yaml": ["js-yaml@4.3.2", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA=="], "builder-util/js-yaml": ["js-yaml@4.3.2", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA=="],
"cf/miniflare": ["miniflare@5.20260930.0-alpha", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.35.4", "undici": "7.29.1", "workerd": "1.20260930.2", "ws": "8.21.0", "youch": "4.1.0-beta.10" } }, "sha512-vZljfRtOEeynbhJtuvYsnCU8t6zF5wIUm9ql4YFHB7zvYw2+F2tpT0BzXjzaa++eiUIml1gsODCf02qShBmJdg=="],
"chromium-bidi/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], "chromium-bidi/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
"cliui/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], "cliui/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
@ -4811,8 +4747,6 @@
"gitlab-ai-provider/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], "gitlab-ai-provider/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
"got/@sindresorhus/is": ["@sindresorhus/is@4.6.0", "", {}, "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="],
"h3/rou3": ["rou3@1.0.0", "", {}, "sha512-ySeaQkSrua+ut9g+65I7FHqOFBaY8tV0FmccXItoq0q21se32Q3u4YiW7/RqXSosWgYJaaKwRHXy3BST9PeCNQ=="], "h3/rou3": ["rou3@1.0.0", "", {}, "sha512-ySeaQkSrua+ut9g+65I7FHqOFBaY8tV0FmccXItoq0q21se32Q3u4YiW7/RqXSosWgYJaaKwRHXy3BST9PeCNQ=="],
"h3/srvx": ["srvx@1.0.6", "", { "bin": { "srvx": "./bin/srvx.mjs" } }, "sha512-QeTKgAhk8OSsfeq60bl3wuVs9PmBftzmk7owBInA/F1YQne+TRw0UcPymNpURldAmx8hfmM2PNNGH/zgo3GpLA=="], "h3/srvx": ["srvx@1.0.6", "", { "bin": { "srvx": "./bin/srvx.mjs" } }, "sha512-QeTKgAhk8OSsfeq60bl3wuVs9PmBftzmk7owBInA/F1YQne+TRw0UcPymNpURldAmx8hfmM2PNNGH/zgo3GpLA=="],
@ -4837,7 +4771,11 @@
"micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],
"miniflare/undici": ["undici@7.28.0", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="], "miniflare/sharp": ["sharp@0.35.4", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.4", "@img/sharp-darwin-x64": "0.35.4", "@img/sharp-freebsd-wasm32": "0.35.4", "@img/sharp-libvips-darwin-arm64": "1.3.3", "@img/sharp-libvips-darwin-x64": "1.3.3", "@img/sharp-libvips-linux-arm": "1.3.3", "@img/sharp-libvips-linux-arm64": "1.3.3", "@img/sharp-libvips-linux-ppc64": "1.3.3", "@img/sharp-libvips-linux-riscv64": "1.3.3", "@img/sharp-libvips-linux-s390x": "1.3.3", "@img/sharp-libvips-linux-x64": "1.3.3", "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", "@img/sharp-libvips-linuxmusl-x64": "1.3.3", "@img/sharp-linux-arm": "0.35.4", "@img/sharp-linux-arm64": "0.35.4", "@img/sharp-linux-ppc64": "0.35.4", "@img/sharp-linux-riscv64": "0.35.4", "@img/sharp-linux-s390x": "0.35.4", "@img/sharp-linux-x64": "0.35.4", "@img/sharp-linuxmusl-arm64": "0.35.4", "@img/sharp-linuxmusl-x64": "0.35.4", "@img/sharp-webcontainers-wasm32": "0.35.4", "@img/sharp-win32-arm64": "0.35.4", "@img/sharp-win32-ia32": "0.35.4", "@img/sharp-win32-x64": "0.35.4" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA=="],
"miniflare/undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="],
"miniflare/workerd": ["workerd@1.20260930.2", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20260930.2", "@cloudflare/workerd-darwin-arm64": "1.20260930.2", "@cloudflare/workerd-linux-64": "1.20260930.2", "@cloudflare/workerd-linux-arm64": "1.20260930.2", "@cloudflare/workerd-windows-64": "1.20260930.2" }, "hasInstallScript": true, "bin": { "workerd": "bin/workerd" } }, "sha512-k1lQzEiGyCDqaRsR5+o9PBT5wVU5omtas6hXx3spbEHHMFo8a7tkAixVCMsWFeiT7xhrmg21Hd6a9jLNrkcUMg=="],
"minipass-flush/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], "minipass-flush/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="],
@ -4857,6 +4795,8 @@
"parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], "parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="],
"pkg-up/find-up": ["find-up@3.0.0", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="],
"pkijs/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="], "pkijs/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="],
"playwright/fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], "playwright/fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="],
@ -4913,8 +4853,6 @@
"tiny-async-pool/semver": ["semver@5.7.2", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="], "tiny-async-pool/semver": ["semver@5.7.2", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="],
"tldts-icann/tldts-core": ["tldts-core@7.4.11", "", {}, "sha512-CW3WN2rIIE/Of21mulhgnGOwoDyEFNygyIBOONSdyAuSATgMMUCpLeUlB+E8sAwA5xRV9hYPl+kyZ9citHCaKg=="],
"type-is/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], "type-is/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="],
"unused-filename/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], "unused-filename/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="],
@ -4939,6 +4877,8 @@
"wrangler/esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="], "wrangler/esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="],
"wrangler/miniflare": ["miniflare@4.20260708.1", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.34.5", "undici": "7.28.0", "workerd": "1.20260708.1", "ws": "8.21.0", "youch": "4.1.0-beta.10" }, "bin": { "miniflare": "bootstrap.js" } }, "sha512-c94O9zRDISdqO18EHt6l0iF/fWgWt8p18PJvRsA/L/NJZ9Cfke3s/F5Blg1XXF7WDutVRzWVWy8Vy4LaT5ifsA=="],
"wrangler/path-to-regexp": ["path-to-regexp@6.3.0", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="], "wrangler/path-to-regexp": ["path-to-regexp@6.3.0", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="],
"wrap-ansi/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], "wrap-ansi/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
@ -5019,12 +4959,6 @@
"@opencode/legacy/wrangler/workerd": ["workerd@1.20261102.1", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20261102.1", "@cloudflare/workerd-darwin-arm64": "1.20261102.1", "@cloudflare/workerd-linux-64": "1.20261102.1", "@cloudflare/workerd-linux-arm64": "1.20261102.1", "@cloudflare/workerd-windows-64": "1.20261102.1" }, "hasInstallScript": true, "bin": { "workerd": "bin/workerd" } }, "sha512-5A+/vm0M5oc98pB3aR+DZ5cIOvRMhVWVS9tg+CrjUap7PIo8tqAnvNdvuiHBIE47/wkxtNM3jToAaU38dBsZTw=="], "@opencode/legacy/wrangler/workerd": ["workerd@1.20261102.1", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20261102.1", "@cloudflare/workerd-darwin-arm64": "1.20261102.1", "@cloudflare/workerd-linux-64": "1.20261102.1", "@cloudflare/workerd-linux-arm64": "1.20261102.1", "@cloudflare/workerd-windows-64": "1.20261102.1" }, "hasInstallScript": true, "bin": { "workerd": "bin/workerd" } }, "sha512-5A+/vm0M5oc98pB3aR+DZ5cIOvRMhVWVS9tg+CrjUap7PIo8tqAnvNdvuiHBIE47/wkxtNM3jToAaU38dBsZTw=="],
"@opencode/site/miniflare/sharp": ["sharp@0.35.4", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.4", "@img/sharp-darwin-x64": "0.35.4", "@img/sharp-freebsd-wasm32": "0.35.4", "@img/sharp-libvips-darwin-arm64": "1.3.3", "@img/sharp-libvips-darwin-x64": "1.3.3", "@img/sharp-libvips-linux-arm": "1.3.3", "@img/sharp-libvips-linux-arm64": "1.3.3", "@img/sharp-libvips-linux-ppc64": "1.3.3", "@img/sharp-libvips-linux-riscv64": "1.3.3", "@img/sharp-libvips-linux-s390x": "1.3.3", "@img/sharp-libvips-linux-x64": "1.3.3", "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", "@img/sharp-libvips-linuxmusl-x64": "1.3.3", "@img/sharp-linux-arm": "0.35.4", "@img/sharp-linux-arm64": "0.35.4", "@img/sharp-linux-ppc64": "0.35.4", "@img/sharp-linux-riscv64": "0.35.4", "@img/sharp-linux-s390x": "0.35.4", "@img/sharp-linux-x64": "0.35.4", "@img/sharp-linuxmusl-arm64": "0.35.4", "@img/sharp-linuxmusl-x64": "0.35.4", "@img/sharp-webcontainers-wasm32": "0.35.4", "@img/sharp-win32-arm64": "0.35.4", "@img/sharp-win32-ia32": "0.35.4", "@img/sharp-win32-x64": "0.35.4" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA=="],
"@opencode/site/miniflare/undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="],
"@opencode/site/miniflare/workerd": ["workerd@1.20260930.2", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20260930.2", "@cloudflare/workerd-darwin-arm64": "1.20260930.2", "@cloudflare/workerd-linux-64": "1.20260930.2", "@cloudflare/workerd-linux-arm64": "1.20260930.2", "@cloudflare/workerd-windows-64": "1.20260930.2" }, "hasInstallScript": true, "bin": { "workerd": "bin/workerd" } }, "sha512-k1lQzEiGyCDqaRsR5+o9PBT5wVU5omtas6hXx3spbEHHMFo8a7tkAixVCMsWFeiT7xhrmg21Hd6a9jLNrkcUMg=="],
"@opencode/stories/@tailwindcss/vite/@tailwindcss/node": ["@tailwindcss/node@4.1.11", "", { "dependencies": { "@ampproject/remapping": "^2.3.0", "enhanced-resolve": "^5.18.1", "jiti": "^2.4.2", "lightningcss": "1.30.1", "magic-string": "^0.30.17", "source-map-js": "^1.2.1", "tailwindcss": "4.1.11" } }, "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q=="], "@opencode/stories/@tailwindcss/vite/@tailwindcss/node": ["@tailwindcss/node@4.1.11", "", { "dependencies": { "@ampproject/remapping": "^2.3.0", "enhanced-resolve": "^5.18.1", "jiti": "^2.4.2", "lightningcss": "1.30.1", "magic-string": "^0.30.17", "source-map-js": "^1.2.1", "tailwindcss": "4.1.11" } }, "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q=="],
"@opencode/stories/@tailwindcss/vite/@tailwindcss/oxide": ["@tailwindcss/oxide@4.1.11", "", { "dependencies": { "detect-libc": "^2.0.4", "tar": "^7.4.3" }, "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.1.11", "@tailwindcss/oxide-darwin-arm64": "4.1.11", "@tailwindcss/oxide-darwin-x64": "4.1.11", "@tailwindcss/oxide-freebsd-x64": "4.1.11", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11", "@tailwindcss/oxide-linux-arm64-gnu": "4.1.11", "@tailwindcss/oxide-linux-arm64-musl": "4.1.11", "@tailwindcss/oxide-linux-x64-gnu": "4.1.11", "@tailwindcss/oxide-linux-x64-musl": "4.1.11", "@tailwindcss/oxide-wasm32-wasi": "4.1.11", "@tailwindcss/oxide-win32-arm64-msvc": "4.1.11", "@tailwindcss/oxide-win32-x64-msvc": "4.1.11" } }, "sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg=="], "@opencode/stories/@tailwindcss/vite/@tailwindcss/oxide": ["@tailwindcss/oxide@4.1.11", "", { "dependencies": { "detect-libc": "^2.0.4", "tar": "^7.4.3" }, "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.1.11", "@tailwindcss/oxide-darwin-arm64": "4.1.11", "@tailwindcss/oxide-darwin-x64": "4.1.11", "@tailwindcss/oxide-freebsd-x64": "4.1.11", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11", "@tailwindcss/oxide-linux-arm64-gnu": "4.1.11", "@tailwindcss/oxide-linux-arm64-musl": "4.1.11", "@tailwindcss/oxide-linux-x64-gnu": "4.1.11", "@tailwindcss/oxide-linux-x64-musl": "4.1.11", "@tailwindcss/oxide-wasm32-wasi": "4.1.11", "@tailwindcss/oxide-win32-arm64-msvc": "4.1.11", "@tailwindcss/oxide-win32-x64-msvc": "4.1.11" } }, "sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg=="],
@ -5079,11 +5013,11 @@
"app-builder-lib/which/isexe": ["isexe@3.1.5", "", {}, "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w=="], "app-builder-lib/which/isexe": ["isexe@3.1.5", "", {}, "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w=="],
"cf/miniflare/sharp": ["sharp@0.35.4", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.4", "@img/sharp-darwin-x64": "0.35.4", "@img/sharp-freebsd-wasm32": "0.35.4", "@img/sharp-libvips-darwin-arm64": "1.3.3", "@img/sharp-libvips-darwin-x64": "1.3.3", "@img/sharp-libvips-linux-arm": "1.3.3", "@img/sharp-libvips-linux-arm64": "1.3.3", "@img/sharp-libvips-linux-ppc64": "1.3.3", "@img/sharp-libvips-linux-riscv64": "1.3.3", "@img/sharp-libvips-linux-s390x": "1.3.3", "@img/sharp-libvips-linux-x64": "1.3.3", "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", "@img/sharp-libvips-linuxmusl-x64": "1.3.3", "@img/sharp-linux-arm": "0.35.4", "@img/sharp-linux-arm64": "0.35.4", "@img/sharp-linux-ppc64": "0.35.4", "@img/sharp-linux-riscv64": "0.35.4", "@img/sharp-linux-s390x": "0.35.4", "@img/sharp-linux-x64": "0.35.4", "@img/sharp-linuxmusl-arm64": "0.35.4", "@img/sharp-linuxmusl-x64": "0.35.4", "@img/sharp-webcontainers-wasm32": "0.35.4", "@img/sharp-win32-arm64": "0.35.4", "@img/sharp-win32-ia32": "0.35.4", "@img/sharp-win32-x64": "0.35.4" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA=="], "babel-plugin-module-resolver/glob/minimatch": ["minimatch@8.0.7", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-V+1uQNdzybxa14e/p00HZnQNNcTjnRJjDxg2V8wtkjFctq4M7hXFws4oekyTP0Jebeq7QYtpFyOeBAjc88zvYg=="],
"cf/miniflare/undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="], "babel-plugin-module-resolver/glob/minipass": ["minipass@4.2.8", "", {}, "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ=="],
"cf/miniflare/workerd": ["workerd@1.20260930.2", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20260930.2", "@cloudflare/workerd-darwin-arm64": "1.20260930.2", "@cloudflare/workerd-linux-64": "1.20260930.2", "@cloudflare/workerd-linux-arm64": "1.20260930.2", "@cloudflare/workerd-windows-64": "1.20260930.2" }, "hasInstallScript": true, "bin": { "workerd": "bin/workerd" } }, "sha512-k1lQzEiGyCDqaRsR5+o9PBT5wVU5omtas6hXx3spbEHHMFo8a7tkAixVCMsWFeiT7xhrmg21Hd6a9jLNrkcUMg=="], "babel-plugin-module-resolver/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="],
"cliui/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], "cliui/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
@ -5109,6 +5043,62 @@
"hosted-git-info/lru-cache/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], "hosted-git-info/lru-cache/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="],
"miniflare/sharp/@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.3" }, "os": "darwin", "cpu": "arm64" }, "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA=="],
"miniflare/sharp/@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.3" }, "os": "darwin", "cpu": "x64" }, "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw=="],
"miniflare/sharp/@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg=="],
"miniflare/sharp/@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw=="],
"miniflare/sharp/@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.3", "", { "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA=="],
"miniflare/sharp/@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A=="],
"miniflare/sharp/@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.3", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w=="],
"miniflare/sharp/@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.3", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ=="],
"miniflare/sharp/@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.3", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q=="],
"miniflare/sharp/@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.3", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA=="],
"miniflare/sharp/@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw=="],
"miniflare/sharp/@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.3", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw=="],
"miniflare/sharp/@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.3" }, "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A=="],
"miniflare/sharp/@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ=="],
"miniflare/sharp/@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.3" }, "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ=="],
"miniflare/sharp/@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.3" }, "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA=="],
"miniflare/sharp/@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.3" }, "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ=="],
"miniflare/sharp/@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.3" }, "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA=="],
"miniflare/sharp/@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA=="],
"miniflare/sharp/@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.3" }, "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg=="],
"miniflare/sharp/@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw=="],
"miniflare/sharp/@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw=="],
"miniflare/sharp/@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.4", "", { "os": "win32", "cpu": "x64" }, "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg=="],
"miniflare/workerd/@cloudflare/workerd-darwin-64": ["@cloudflare/workerd-darwin-64@1.20260930.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-wxKsfekWeev6xkjHEMx3x7nz6WfWOn1/scQ8geqWQhUm8qRl1ZRZhjnj+rucIMLhLhP9RGSYMZIjEm3AV0zwVQ=="],
"miniflare/workerd/@cloudflare/workerd-darwin-arm64": ["@cloudflare/workerd-darwin-arm64@1.20260930.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cviPpheZGQ2H5X+Ctxd3wfxhksNrdyoNprjSgg3br2+psetKacjdEvK8CILdN/2GF+u1KOExvr45amSL6lgzGA=="],
"miniflare/workerd/@cloudflare/workerd-linux-64": ["@cloudflare/workerd-linux-64@1.20260930.2", "", { "os": "linux", "cpu": "x64" }, "sha512-cwrJAC5y/avPd1OzGyhc5OvUUfPXBFc065TY5CjXp7Hb3dhiTx6JeB5Pc8L3G8L8M44HyAfRHSpoLtRr+SR3cQ=="],
"miniflare/workerd/@cloudflare/workerd-linux-arm64": ["@cloudflare/workerd-linux-arm64@1.20260930.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-FHucB4gak1IuT+IxLx3KbtMBMapZhcqD9EdhHvBxk1FpHwD2QU5x26MRRVN53jIKG/O25HUmE9yffb3cMANQgw=="],
"miniflare/workerd/@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20260930.2", "", { "os": "win32", "cpu": "x64" }, "sha512-JHFMdGFMqP+M2QiVzZq1S8Ie66Gvxo7Og5EYz/KtmDvGCqge5L3lK+ksZxAhF3j/tpSLqdvlUvcTKoR9PkwTTQ=="],
"minipass-flush/minipass/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], "minipass-flush/minipass/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="],
"minipass-pipeline/minipass/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], "minipass-pipeline/minipass/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="],
@ -5145,6 +5135,8 @@
"nitro/rolldown/@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.14", "", { "os": "win32", "cpu": "x64" }, "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ=="], "nitro/rolldown/@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.14", "", { "os": "win32", "cpu": "x64" }, "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ=="],
"pkg-up/find-up/locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="],
"rimraf/glob/jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="], "rimraf/glob/jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="],
"rimraf/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="], "rimraf/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="],
@ -5207,6 +5199,8 @@
"wrangler/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.1", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="], "wrangler/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.1", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="],
"wrangler/miniflare/undici": ["undici@7.28.0", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
"wrap-ansi-cjs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], "wrap-ansi-cjs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
"wrap-ansi-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], "wrap-ansi-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
@ -5335,62 +5329,6 @@
"@opencode/legacy/wrangler/workerd/@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20261102.1", "", { "os": "win32", "cpu": "x64" }, "sha512-s9iKBbAdNIdVjpMUHh48zbCfCHw5wbLl8I2aIW74H3OtxpWZP/cHeEwZZMq3xAz5kt4MmvwwO4hDbNYoAD4yhw=="], "@opencode/legacy/wrangler/workerd/@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20261102.1", "", { "os": "win32", "cpu": "x64" }, "sha512-s9iKBbAdNIdVjpMUHh48zbCfCHw5wbLl8I2aIW74H3OtxpWZP/cHeEwZZMq3xAz5kt4MmvwwO4hDbNYoAD4yhw=="],
"@opencode/site/miniflare/sharp/@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.3" }, "os": "darwin", "cpu": "arm64" }, "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA=="],
"@opencode/site/miniflare/sharp/@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.3" }, "os": "darwin", "cpu": "x64" }, "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.3", "", { "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.3", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.3", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.3", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.3", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw=="],
"@opencode/site/miniflare/sharp/@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.3", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw=="],
"@opencode/site/miniflare/sharp/@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.3" }, "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A=="],
"@opencode/site/miniflare/sharp/@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ=="],
"@opencode/site/miniflare/sharp/@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.3" }, "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ=="],
"@opencode/site/miniflare/sharp/@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.3" }, "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA=="],
"@opencode/site/miniflare/sharp/@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.3" }, "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ=="],
"@opencode/site/miniflare/sharp/@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.3" }, "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA=="],
"@opencode/site/miniflare/sharp/@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA=="],
"@opencode/site/miniflare/sharp/@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.3" }, "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg=="],
"@opencode/site/miniflare/sharp/@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw=="],
"@opencode/site/miniflare/sharp/@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw=="],
"@opencode/site/miniflare/sharp/@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.4", "", { "os": "win32", "cpu": "x64" }, "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg=="],
"@opencode/site/miniflare/workerd/@cloudflare/workerd-darwin-64": ["@cloudflare/workerd-darwin-64@1.20260930.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-wxKsfekWeev6xkjHEMx3x7nz6WfWOn1/scQ8geqWQhUm8qRl1ZRZhjnj+rucIMLhLhP9RGSYMZIjEm3AV0zwVQ=="],
"@opencode/site/miniflare/workerd/@cloudflare/workerd-darwin-arm64": ["@cloudflare/workerd-darwin-arm64@1.20260930.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cviPpheZGQ2H5X+Ctxd3wfxhksNrdyoNprjSgg3br2+psetKacjdEvK8CILdN/2GF+u1KOExvr45amSL6lgzGA=="],
"@opencode/site/miniflare/workerd/@cloudflare/workerd-linux-64": ["@cloudflare/workerd-linux-64@1.20260930.2", "", { "os": "linux", "cpu": "x64" }, "sha512-cwrJAC5y/avPd1OzGyhc5OvUUfPXBFc065TY5CjXp7Hb3dhiTx6JeB5Pc8L3G8L8M44HyAfRHSpoLtRr+SR3cQ=="],
"@opencode/site/miniflare/workerd/@cloudflare/workerd-linux-arm64": ["@cloudflare/workerd-linux-arm64@1.20260930.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-FHucB4gak1IuT+IxLx3KbtMBMapZhcqD9EdhHvBxk1FpHwD2QU5x26MRRVN53jIKG/O25HUmE9yffb3cMANQgw=="],
"@opencode/site/miniflare/workerd/@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20260930.2", "", { "os": "win32", "cpu": "x64" }, "sha512-JHFMdGFMqP+M2QiVzZq1S8Ie66Gvxo7Og5EYz/KtmDvGCqge5L3lK+ksZxAhF3j/tpSLqdvlUvcTKoR9PkwTTQ=="],
"@opencode/stories/@tailwindcss/vite/@tailwindcss/node/lightningcss": ["lightningcss@1.30.1", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-darwin-arm64": "1.30.1", "lightningcss-darwin-x64": "1.30.1", "lightningcss-freebsd-x64": "1.30.1", "lightningcss-linux-arm-gnueabihf": "1.30.1", "lightningcss-linux-arm64-gnu": "1.30.1", "lightningcss-linux-arm64-musl": "1.30.1", "lightningcss-linux-x64-gnu": "1.30.1", "lightningcss-linux-x64-musl": "1.30.1", "lightningcss-win32-arm64-msvc": "1.30.1", "lightningcss-win32-x64-msvc": "1.30.1" } }, "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg=="], "@opencode/stories/@tailwindcss/vite/@tailwindcss/node/lightningcss": ["lightningcss@1.30.1", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-darwin-arm64": "1.30.1", "lightningcss-darwin-x64": "1.30.1", "lightningcss-freebsd-x64": "1.30.1", "lightningcss-linux-arm-gnueabihf": "1.30.1", "lightningcss-linux-arm64-gnu": "1.30.1", "lightningcss-linux-arm64-musl": "1.30.1", "lightningcss-linux-x64-gnu": "1.30.1", "lightningcss-linux-x64-musl": "1.30.1", "lightningcss-win32-arm64-msvc": "1.30.1", "lightningcss-win32-x64-msvc": "1.30.1" } }, "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg=="],
"@opencode/stories/@tailwindcss/vite/@tailwindcss/oxide/@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.1.11", "", { "os": "android", "cpu": "arm64" }, "sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg=="], "@opencode/stories/@tailwindcss/vite/@tailwindcss/oxide/@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.1.11", "", { "os": "android", "cpu": "arm64" }, "sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg=="],
@ -5425,66 +5363,20 @@
"@textjs/app/vite/postcss/nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], "@textjs/app/vite/postcss/nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="],
"cf/miniflare/sharp/@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.3" }, "os": "darwin", "cpu": "arm64" }, "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA=="], "babel-plugin-module-resolver/glob/minimatch/brace-expansion": ["brace-expansion@2.1.7", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g=="],
"cf/miniflare/sharp/@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.3" }, "os": "darwin", "cpu": "x64" }, "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw=="], "babel-plugin-module-resolver/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
"cf/miniflare/sharp/@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg=="], "babel-plugin-module-resolver/glob/path-scurry/minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="],
"cf/miniflare/sharp/@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw=="],
"cf/miniflare/sharp/@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.3", "", { "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA=="],
"cf/miniflare/sharp/@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A=="],
"cf/miniflare/sharp/@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.3", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w=="],
"cf/miniflare/sharp/@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.3", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ=="],
"cf/miniflare/sharp/@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.3", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q=="],
"cf/miniflare/sharp/@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.3", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA=="],
"cf/miniflare/sharp/@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw=="],
"cf/miniflare/sharp/@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.3", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw=="],
"cf/miniflare/sharp/@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.3" }, "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A=="],
"cf/miniflare/sharp/@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ=="],
"cf/miniflare/sharp/@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.3" }, "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ=="],
"cf/miniflare/sharp/@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.3" }, "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA=="],
"cf/miniflare/sharp/@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.3" }, "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ=="],
"cf/miniflare/sharp/@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.3" }, "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA=="],
"cf/miniflare/sharp/@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA=="],
"cf/miniflare/sharp/@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.3" }, "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg=="],
"cf/miniflare/sharp/@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw=="],
"cf/miniflare/sharp/@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw=="],
"cf/miniflare/sharp/@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.4", "", { "os": "win32", "cpu": "x64" }, "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg=="],
"cf/miniflare/workerd/@cloudflare/workerd-darwin-64": ["@cloudflare/workerd-darwin-64@1.20260930.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-wxKsfekWeev6xkjHEMx3x7nz6WfWOn1/scQ8geqWQhUm8qRl1ZRZhjnj+rucIMLhLhP9RGSYMZIjEm3AV0zwVQ=="],
"cf/miniflare/workerd/@cloudflare/workerd-darwin-arm64": ["@cloudflare/workerd-darwin-arm64@1.20260930.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cviPpheZGQ2H5X+Ctxd3wfxhksNrdyoNprjSgg3br2+psetKacjdEvK8CILdN/2GF+u1KOExvr45amSL6lgzGA=="],
"cf/miniflare/workerd/@cloudflare/workerd-linux-64": ["@cloudflare/workerd-linux-64@1.20260930.2", "", { "os": "linux", "cpu": "x64" }, "sha512-cwrJAC5y/avPd1OzGyhc5OvUUfPXBFc065TY5CjXp7Hb3dhiTx6JeB5Pc8L3G8L8M44HyAfRHSpoLtRr+SR3cQ=="],
"cf/miniflare/workerd/@cloudflare/workerd-linux-arm64": ["@cloudflare/workerd-linux-arm64@1.20260930.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-FHucB4gak1IuT+IxLx3KbtMBMapZhcqD9EdhHvBxk1FpHwD2QU5x26MRRVN53jIKG/O25HUmE9yffb3cMANQgw=="],
"cf/miniflare/workerd/@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20260930.2", "", { "os": "win32", "cpu": "x64" }, "sha512-JHFMdGFMqP+M2QiVzZq1S8Ie66Gvxo7Og5EYz/KtmDvGCqge5L3lK+ksZxAhF3j/tpSLqdvlUvcTKoR9PkwTTQ=="],
"dir-compare/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], "dir-compare/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
"filelist/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], "filelist/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
"pkg-up/find-up/locate-path/p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="],
"pkg-up/find-up/locate-path/path-exists": ["path-exists@3.0.0", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="],
"rimraf/glob/jackspeak/@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="], "rimraf/glob/jackspeak/@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="],
"rimraf/glob/minimatch/brace-expansion": ["brace-expansion@2.1.7", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g=="], "rimraf/glob/minimatch/brace-expansion": ["brace-expansion@2.1.7", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g=="],
@ -5579,6 +5471,10 @@
"@puppeteer/browsers/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="], "@puppeteer/browsers/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="],
"babel-plugin-module-resolver/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
"pkg-up/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],
"rimraf/glob/jackspeak/@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], "rimraf/glob/jackspeak/@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="],
"rimraf/glob/jackspeak/@isaacs/cliui/wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="], "rimraf/glob/jackspeak/@isaacs/cliui/wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="],

View file

@ -2,7 +2,7 @@
exact = true exact = true
# Only install newly resolved package versions published at least 3 days ago. # Only install newly resolved package versions published at least 3 days ago.
minimumReleaseAge = 259200 minimumReleaseAge = 259200
minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@brendonovich/vite-plugin-opencode", "@hona/strobe", "@hona/strobe-darwin-arm64", "@hona/strobe-darwin-x64", "@hona/strobe-linux-arm64", "@hona/strobe-linux-x64", "@hona/strobe-win32-arm64", "@hona/strobe-win32-x64", "@kitlangton/knobs", "@kitlangton/solid-motion", "@opencode/sdk", "@opencode/pty", "@opencode/pty-darwin-arm64", "@opencode/pty-darwin-x64", "@opencode/pty-linux-arm64-gnu", "@opencode/pty-linux-arm64-musl", "@opencode/pty-linux-x64-gnu", "@opencode/pty-linux-x64-musl", "@opencode/pty-win32-arm64", "@opencode/pty-win32-x64", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "@opentunnel/client", "@opentunnel/protocol", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/highlights", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron", "electron-builder", "electron-publish", "blume", "pele", "bun-types", "typescript@7.1.0-beta", "@textjs/app", "@textjs/core", "@textjs/opencode", "@textjs/react", "psychoscript"] minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@brendonovich/vite-plugin-opencode", "@hona/strobe", "@hona/strobe-darwin-arm64", "@hona/strobe-darwin-x64", "@hona/strobe-linux-arm64", "@hona/strobe-linux-x64", "@hona/strobe-win32-arm64", "@hona/strobe-win32-x64", "@kitlangton/knobs", "@kitlangton/solid-motion", "@opencode/sdk", "@opencode/pty", "@opencode/pty-darwin-arm64", "@opencode/pty-darwin-x64", "@opencode/pty-linux-arm64-gnu", "@opencode/pty-linux-arm64-musl", "@opencode/pty-linux-x64-gnu", "@opencode/pty-linux-x64-musl", "@opencode/pty-win32-arm64", "@opencode/pty-win32-x64", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "@opentunnel/client", "@opentunnel/protocol", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/highlights", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron", "electron-builder", "electron-publish", "blume", "pele", "bun-types", "typescript@7.1.0-beta", "@textjs/app", "@textjs/core", "@textjs/opencode", "@textjs/react"]
[test] [test]
root = "./do-not-run-tests-from-root" root = "./do-not-run-tests-from-root"

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1794840529, "lastModified": 1790510107,
"narHash": "sha256-ySrWnmZB5UsZTYGHHnBjllT05O5iFjElCRS+mabtfP0=", "narHash": "sha256-EVMNYv7hYDDD9TGVT/hIyTYgpiXA8y3m5xIEIxuGNU0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e21fec321d73511849707a7585e4ea155ee4bf40", "rev": "3181085bfd08663b6b9e60bc7a8395c2aaa741bd",
"type": "github" "type": "github"
}, },
"original": { "original": {

47
install
View file

@ -262,26 +262,6 @@ print_progress() {
printf "\r${ORANGE}%s%s %3d%%${NC}" "$filled" "$empty" "$percent" >&4 printf "\r${ORANGE}%s%s %3d%%${NC}" "$filled" "$empty" "$percent" >&4
} }
install_tmp_dir=""
download_curl_pid=""
cursor_hidden=false
cleanup_download() {
if [ -n "${download_curl_pid:-}" ]; then
kill "$download_curl_pid" 2>/dev/null || true
wait "$download_curl_pid" 2>/dev/null || true
download_curl_pid=""
fi
if [ "$cursor_hidden" = "true" ]; then
{ printf '\033[?25h' >&4; exec 4>&-; } 2>/dev/null || true
cursor_hidden=false
fi
if [ -n "${install_tmp_dir:-}" ]; then
rm -rf "$install_tmp_dir"
install_tmp_dir=""
fi
}
download_with_progress() { download_with_progress() {
local url="$1" local url="$1"
local output="$2" local output="$2"
@ -292,23 +272,20 @@ download_with_progress() {
exec 4>/dev/null exec 4>/dev/null
fi fi
local headers="${output}.headers"
# Hide cursor # Hide cursor
printf "\033[?25l" >&4 printf "\033[?25l" >&4
cursor_hidden=true
trap 'trap - RETURN; if [ "$cursor_hidden" = "true" ]; then printf "\033[?25h" >&4; exec 4>&-; cursor_hidden=false; fi' RETURN trap "trap - RETURN; rm -f \"$headers\"; printf '\033[?25h' >&4; exec 4>&-" RETURN
local headers="${output}.headers"
# Poll the file size on a timer so rendering cost stays fixed no matter how many bytes arrive. # Poll the file size on a timer so rendering cost stays fixed no matter how many bytes arrive.
# Read the size with ls because busybox wc -c reads the whole file. # Read the size with ls because busybox wc -c reads the whole file.
# Bash opens both files so a confined curl (e.g. snap) with a private /tmp can still write them. curl -fsL -D "$headers" -o "$output" "$url" &
# npm's CDN omits content-length on HEAD, so read it from this request's headers. local curl_pid=$!
curl -fsL -D /dev/stderr "$url" > "$output" 2> "$headers" &
download_curl_pid=$!
local length bytes local length bytes
while kill -0 "$download_curl_pid" 2>/dev/null; do while kill -0 "$curl_pid" 2>/dev/null; do
if [ -f "$output" ]; then if [ -f "$output" ]; then
length=$(grep -i '^content-length:' "$headers" 2>/dev/null | tail -n 1 | tr -dc '0-9' || true) length=$(grep -i '^content-length:' "$headers" 2>/dev/null | tail -n 1 | tr -dc '0-9' || true)
bytes=$(ls -ln "$output" | awk '{print $5}') bytes=$(ls -ln "$output" | awk '{print $5}')
@ -318,8 +295,7 @@ download_with_progress() {
done done
local ret=0 local ret=0
wait "$download_curl_pid" || ret=$? wait "$curl_pid" || ret=$?
download_curl_pid=""
if [ "$ret" -eq 0 ]; then if [ "$ret" -eq 0 ]; then
bytes=$(ls -ln "$output" | awk '{print $5}') bytes=$(ls -ln "$output" | awk '{print $5}')
print_progress "$bytes" "$bytes" print_progress "$bytes" "$bytes"
@ -332,16 +308,11 @@ download_and_install() {
print_message info "\n${MUTED}Installing ${NC}$APP ${MUTED}version: ${NC}$specific_version" print_message info "\n${MUTED}Installing ${NC}$APP ${MUTED}version: ${NC}$specific_version"
local tmp_dir="${TMPDIR:-/tmp}/opencode_install_$$" local tmp_dir="${TMPDIR:-/tmp}/opencode_install_$$"
mkdir -p "$tmp_dir" mkdir -p "$tmp_dir"
install_tmp_dir="$tmp_dir"
trap cleanup_download EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
if [[ "$os" == "windows" ]] || ! [ -t 2 ] || ! download_with_progress "$url" "$tmp_dir/$filename"; then if [[ "$os" == "windows" ]] || ! [ -t 2 ] || ! download_with_progress "$url" "$tmp_dir/$filename"; then
# Fallback to standard curl on Windows, non-TTY environments, or if custom progress fails # Fallback to standard curl on Windows, non-TTY environments, or if custom progress fails
local ret=0 local ret=0
# Redirect in bash instead of passing -o to curl so confined builds (e.g. snap) don't need host /tmp access. curl -f -# -L -o "$tmp_dir/$filename" "$url" || ret=$?
curl -f -# -L "$url" > "$tmp_dir/$filename" || ret=$?
# curl exits 23 when it cannot write the file, usually because the temporary directory is full. # curl exits 23 when it cannot write the file, usually because the temporary directory is full.
if [ "$ret" -eq 23 ]; then if [ "$ret" -eq 23 ]; then
print_message error "Could not write the download to $tmp_dir. Make sure it has enough free space, or set TMPDIR to another directory, then try again." >&2 print_message error "Could not write the download to $tmp_dir. Make sure it has enough free space, or set TMPDIR to another directory, then try again." >&2
@ -358,7 +329,7 @@ download_and_install() {
fi fi
mv "$tmp_dir/package/bin/$binary_name" "$INSTALL_DIR/$installed_binary" mv "$tmp_dir/package/bin/$binary_name" "$INSTALL_DIR/$installed_binary"
chmod 755 "$INSTALL_DIR/$installed_binary" chmod 755 "$INSTALL_DIR/$installed_binary"
cleanup_download rm -rf "$tmp_dir"
} }
install_from_binary() { install_from_binary() {

View file

@ -1,7 +1,7 @@
{ {
"nodeModules": { "nodeModules": {
"x86_64-linux": "sha256-LhAICCt8oDBwcwwxDf11PBxJPgKx9gz0TcLcWEoSxp4=", "x86_64-linux": "sha256-UOVs48Z4yO4TJv859cg89lsul54KB9StTSl/VSQJXmc=",
"aarch64-linux": "sha256-lDEEZsLHGVvMgI7dsQqURo+Fo/dUyMisoOy2bb9qUGA=", "aarch64-linux": "sha256-INQvojH68t0J1Hc61N1dJvTJzl89afkQNrUcahxOs9g=",
"aarch64-darwin": "sha256-ktDDSk98gLUiafmmuWhsIO/1zqi06QeMzp1QvPoaWFE=" "aarch64-darwin": "sha256-AU2AUkdlL1g+hBkMZX93gQeQy6u8F0Gyzuk48yoN8as="
} }
} }

View file

@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/package.json", "$schema": "https://json.schemastore.org/package.json",
"name": "opencode", "name": "opencode",
"description": "AI-powered development tool", "description": "AI-powered development tool",
"version": "2.4.1", "version": "2.3.1",
"private": true, "private": true,
"type": "module", "type": "module",
"packageManager": "bun@1.4.4", "packageManager": "bun@1.4.4",
@ -48,12 +48,12 @@
"@effect/sql-sqlite-node": "4.1.0", "@effect/sql-sqlite-node": "4.1.0",
"@npmcli/arborist": "9.4.0", "@npmcli/arborist": "9.4.0",
"@types/bun": "1.4.3", "@types/bun": "1.4.3",
"@hona/strobe": "0.44.1", "@hona/strobe": "0.42.0",
"@types/cross-spawn": "6.0.6", "@types/cross-spawn": "6.0.6",
"@octokit/rest": "22.0.0", "@octokit/rest": "22.0.0",
"@opentui/core": "0.9.9", "@opentui/core": "0.8.4",
"@opentui/keymap": "0.9.9", "@opentui/keymap": "0.8.4",
"@opentui/solid": "0.9.9", "@opentui/solid": "0.8.4",
"@tanstack/solid-virtual": "3.13.37", "@tanstack/solid-virtual": "3.13.37",
"@standard-schema/spec": "1.1.0", "@standard-schema/spec": "1.1.0",
"@kobalte/core": "0.13.13", "@kobalte/core": "0.13.13",
@ -175,7 +175,6 @@
"@pierre/trees@1.0.0-beta.6": "patches/@pierre%2Ftrees@1.0.0-beta.6.patch", "@pierre/trees@1.0.0-beta.6": "patches/@pierre%2Ftrees@1.0.0-beta.6.patch",
"@brendonovich/vite-plugin-opencode@0.1.3": "patches/@brendonovich%2Fvite-plugin-opencode@0.1.3.patch", "@brendonovich/vite-plugin-opencode@0.1.3": "patches/@brendonovich%2Fvite-plugin-opencode@0.1.3.patch",
"@modelcontextprotocol/client@2.4.0": "patches/@modelcontextprotocol%2Fclient@2.4.0.patch", "@modelcontextprotocol/client@2.4.0": "patches/@modelcontextprotocol%2Fclient@2.4.0.patch",
"@kobalte/core@0.13.13": "patches/@kobalte%2Fcore@0.13.13.patch", "@kobalte/core@0.13.13": "patches/@kobalte%2Fcore@0.13.13.patch"
"bun-pty@0.4.11": "patches/bun-pty@0.4.11.patch"
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"$schema": "https://json.schemastore.org/package.json", "$schema": "https://json.schemastore.org/package.json",
"version": "2.4.1", "version": "2.3.1",
"name": "@opencode/ai", "name": "@opencode/ai",
"type": "module", "type": "module",
"license": "MIT", "license": "MIT",

View file

@ -5,7 +5,7 @@ import { tryRequest } from "./media-model.js"
import { import {
AIError, AIError,
type BaseRequest, type BaseRequest,
type TransportOptions, type HttpOptions,
ModelID, ModelID,
ProviderID, ProviderID,
ProviderMetadata, ProviderMetadata,
@ -200,8 +200,7 @@ export class DecisionModel<Options extends DecisionOptions = DecisionOptions> {
readonly id: ModelID readonly id: ModelID
readonly provider: ProviderID readonly provider: ProviderID
readonly route: DecisionModelRoute<Options> readonly route: DecisionModelRoute<Options>
/** Deployment headers, timeouts and `http` overlays, below each request's own. */ readonly http?: HttpOptions
readonly transport?: TransportOptions
readonly compatibility?: DecisionModelCompatibility readonly compatibility?: DecisionModelCompatibility
/** Defaults under each request's `providerOptions`, such as options a provider package reads from its settings. */ /** Defaults under each request's `providerOptions`, such as options a provider package reads from its settings. */
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
@ -210,7 +209,7 @@ export class DecisionModel<Options extends DecisionOptions = DecisionOptions> {
this.id = input.id this.id = input.id
this.provider = input.provider this.provider = input.provider
this.route = input.route this.route = input.route
this.transport = input.transport this.http = input.http
this.compatibility = input.compatibility this.compatibility = input.compatibility
this.providerOptions = input.providerOptions this.providerOptions = input.providerOptions
} }
@ -229,7 +228,7 @@ export namespace DecisionModel {
readonly id: ModelID readonly id: ModelID
readonly provider: ProviderID readonly provider: ProviderID
readonly route: DecisionModelRoute<Options> readonly route: DecisionModelRoute<Options>
readonly transport?: TransportOptions readonly http?: HttpOptions
readonly compatibility?: DecisionModelCompatibility readonly compatibility?: DecisionModelCompatibility
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
} }

View file

@ -5,7 +5,7 @@ import { tryRequest } from "./media-model.js"
import { import {
type AIError, type AIError,
type BaseRequest, type BaseRequest,
type TransportOptions, type HttpOptions,
ModelID, ModelID,
ProviderID, ProviderID,
ProviderMetadata, ProviderMetadata,
@ -38,10 +38,7 @@ export type EmbeddingOptions = Record<string, unknown>
/** What an embedding model's route does; `EmbeddingRoute.make(...).model(...)` builds one from a protocol. */ /** What an embedding model's route does; `EmbeddingRoute.make(...).model(...)` builds one from a protocol. */
export interface EmbeddingModelRoute<Options extends EmbeddingOptions = EmbeddingOptions> { export interface EmbeddingModelRoute<Options extends EmbeddingOptions = EmbeddingOptions> {
readonly id: string readonly id: string
generate( generate(request: EmbeddingRequest<EmbeddingModel<Options>>, execute: Execute): Effect.Effect<EmbeddingResponse, AIError>
request: EmbeddingRequest<EmbeddingModel<Options>>,
execute: Execute,
): Effect.Effect<EmbeddingResponse, AIError>
} }
export class EmbeddingModel<Options extends EmbeddingOptions = EmbeddingOptions> { export class EmbeddingModel<Options extends EmbeddingOptions = EmbeddingOptions> {
@ -49,8 +46,7 @@ export class EmbeddingModel<Options extends EmbeddingOptions = EmbeddingOptions>
readonly id: ModelID readonly id: ModelID
readonly provider: ProviderID readonly provider: ProviderID
readonly route: EmbeddingModelRoute<Options> readonly route: EmbeddingModelRoute<Options>
/** Deployment headers, timeouts and `http` overlays, below each request's own. */ readonly http?: HttpOptions
readonly transport?: TransportOptions
/** Defaults under each request's `providerOptions`, such as options a provider package reads from its settings. */ /** Defaults under each request's `providerOptions`, such as options a provider package reads from its settings. */
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
@ -58,7 +54,7 @@ export class EmbeddingModel<Options extends EmbeddingOptions = EmbeddingOptions>
this.id = input.id this.id = input.id
this.provider = input.provider this.provider = input.provider
this.route = input.route this.route = input.route
this.transport = input.transport this.http = input.http
this.providerOptions = input.providerOptions this.providerOptions = input.providerOptions
} }
@ -76,7 +72,7 @@ export namespace EmbeddingModel {
readonly id: ModelID readonly id: ModelID
readonly provider: ProviderID readonly provider: ProviderID
readonly route: EmbeddingModelRoute<Options> readonly route: EmbeddingModelRoute<Options>
readonly transport?: TransportOptions readonly http?: HttpOptions
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
} }

View file

@ -43,7 +43,6 @@ export type {
export { Realtime } from "./experimental/realtime.js" export { Realtime } from "./experimental/realtime.js"
export type { export type {
RealtimeConnectInput, RealtimeConnectInput,
RealtimeEngine,
RealtimeSession, RealtimeSession,
RealtimeTransport, RealtimeTransport,
RealtimeTransportInput, RealtimeTransportInput,

View file

@ -99,13 +99,14 @@ export const model = (input: MediaRoute.ModelInput) =>
new ExtractionModel({ new ExtractionModel({
id: input.id, id: input.id,
provider: route.provider, provider: route.provider,
transport: input.transport, http: input.http,
route: MediaRoute.inline({ route: MediaRoute.inline({
protocol, protocol,
endpoint: Endpoint.path<MediaProtocol.Body, ExtractionRequest>(({ request }) => `/${request.model.id}`, { endpoint: Endpoint.path<MediaProtocol.Body, ExtractionRequest>(({ request }) => `/${request.model.id}`, {
baseURL: input.baseURL, baseURL: input.baseURL,
}), }),
auth: input.auth, auth: input.auth,
headers: input.headers,
}), }),
}) })

View file

@ -1,7 +1,7 @@
import { Clock, Effect, Redacted, Schema } from "effect" import { Clock, Effect, Redacted, Schema } from "effect"
import { HttpClientRequest } from "effect/http" import { HttpClientRequest } from "effect/http"
import { RequestExecutor } from "../route/executor.js" import { RequestExecutor } from "../route/executor.js"
import { AIError, InvalidProviderOutputError, InvalidRequestError, type RequestTimeout } from "../schema/index.js" import { AIError, InvalidProviderOutputError, InvalidRequestError } from "../schema/index.js"
import { encodeJson } from "../utils/json.js" import { encodeJson } from "../utils/json.js"
const OPENAI_BASE_URL = "https://api.openai.com/v1" const OPENAI_BASE_URL = "https://api.openai.com/v1"
@ -21,30 +21,42 @@ export type RealtimeTransport =
export type RealtimeSession = Readonly<Record<string, unknown>> export type RealtimeSession = Readonly<Record<string, unknown>>
export interface RealtimeConnectInput { export interface RealtimeConnectInput {
readonly engine: RealtimeEngine
readonly model: string readonly model: string
readonly apiKey: Redacted.Redacted readonly apiKey: Redacted.Redacted
/** Where a GPT-Live session starts, OpenAI by default: another host of its API, such as OpenCode's. */ /** Where a GPT-Live session starts, OpenAI by default: another host of its API, such as OpenCode's. */
readonly baseURL?: string readonly baseURL?: string
/** Headers that host needs besides the API key, such as OpenCode's workspace. */ /** Headers that host needs besides the API key, such as OpenCode's workspace. */
readonly headers?: Readonly<Record<string, string>> readonly headers?: Readonly<Record<string, string>>
readonly timeout?: RequestTimeout
readonly session?: RealtimeSession readonly session?: RealtimeSession
readonly transport: RealtimeTransportInput readonly transport: RealtimeTransportInput
} }
// The voice APIs this package speaks, by provider and models.dev API. Which models they start comes from models.dev.
export const engines = [ export const engines = [
{ id: "openai-live", provider: "openai", api: "live", transports: ["webrtc"] }, { family: "gpt-live", model: "gpt-live-1", id: "openai-live", provider: "openai", transports: ["webrtc"] },
{ id: "openai-realtime", provider: "openai", api: "realtime", transports: ["webrtc", "websocket"] }, {
{ id: "xai-realtime", provider: "xai", api: "realtime", transports: ["websocket"] }, family: "gpt-realtime",
{ id: "gemini-live", provider: "google", api: "bidi-generate-content", transports: ["websocket"] }, model: "gpt-realtime-2.1",
id: "openai-realtime",
provider: "openai",
transports: ["webrtc", "websocket"],
},
{ family: "grok-voice", model: "grok-voice-3.0", id: "xai-realtime", provider: "xai", transports: ["websocket"] },
{
family: "gemini-3.8-live",
model: "gemini-3.8-live",
id: "gemini-live",
provider: "google",
transports: ["websocket"],
},
] as const ] as const
export type RealtimeEngine = (typeof engines)[number] // Matches the bare family name (`gpt-realtime`) and its versions (`gpt-realtime-2.1`, `gpt-realtime-mini`).
export const engine = (model: string) =>
engines.find((item) => model === item.family || model.startsWith(`${item.family}-`))
export const connect = Effect.fn("Realtime.connect")(function* (input: RealtimeConnectInput) { export const connect = Effect.fn("Realtime.connect")(function* (input: RealtimeConnectInput) {
const resolved = input.engine const resolved = engine(input.model)
if (!resolved) return yield* invalidRequest(`Unsupported voice model: ${input.model}`)
if (!resolved.transports.some((type) => type === input.transport.type)) if (!resolved.transports.some((type) => type === input.transport.type))
return yield* invalidRequest(`${input.model} only supports ${resolved.transports.join(", ")} transport`) return yield* invalidRequest(`${input.model} only supports ${resolved.transports.join(", ")} transport`)
const session = { ...input.session, model: input.model } const session = { ...input.session, model: input.model }
@ -57,23 +69,16 @@ export const connect = Effect.fn("Realtime.connect")(function* (input: RealtimeC
input.apiKey, input.apiKey,
{ session, transport: input.transport }, { session, transport: input.transport },
LiveSessionResponse, LiveSessionResponse,
{ headers: input.headers, timeout: input.timeout }, { headers: input.headers },
) )
return { type: "webrtc" as const, sdp: data.transport.sdp } return { type: "webrtc" as const, sdp: data.transport.sdp }
} }
case "openai-realtime": { case "openai-realtime": {
if (input.transport.type === "websocket") if (input.transport.type === "websocket")
return yield* clientSecret( return yield* clientSecret(resolved.id, OPENAI_BASE_URL, input.model, input.apiKey, {
resolved.id, expires_after: { anchor: "created_at", seconds: 60 },
OPENAI_BASE_URL, session,
input.model, })
input.apiKey,
{
expires_after: { anchor: "created_at", seconds: 60 },
session,
},
input.timeout,
)
const form = new FormData() const form = new FormData()
form.append("sdp", input.transport.sdp) form.append("sdp", input.transport.sdp)
form.append("session", encodeJson(session)) form.append("session", encodeJson(session))
@ -84,21 +89,13 @@ export const connect = Effect.fn("Realtime.connect")(function* (input: RealtimeC
input.apiKey, input.apiKey,
form, form,
Schema.String, Schema.String,
{ timeout: input.timeout },
) )
return { type: "webrtc" as const, sdp } return { type: "webrtc" as const, sdp }
} }
case "xai-realtime": case "xai-realtime":
return yield* clientSecret( return yield* clientSecret(resolved.id, XAI_BASE_URL, input.model, input.apiKey, {
resolved.id, expires_after: { seconds: 60 },
XAI_BASE_URL, })
input.model,
input.apiKey,
{
expires_after: { seconds: 60 },
},
input.timeout,
)
case "gemini-live": { case "gemini-live": {
const now = yield* Clock.currentTimeMillis const now = yield* Clock.currentTimeMillis
const expiresAt = now + 60_000 const expiresAt = now + 60_000
@ -113,7 +110,7 @@ export const connect = Effect.fn("Realtime.connect")(function* (input: RealtimeC
bidiGenerateContentSetup: { ...input.session, model: `models/${input.model}` }, bidiGenerateContentSetup: { ...input.session, model: `models/${input.model}` },
}, },
AuthTokenResponse, AuthTokenResponse,
{ authHeader: "x-goog-api-key", timeout: input.timeout }, { authHeader: "x-goog-api-key" },
) )
return { return {
type: "websocket" as const, type: "websocket" as const,
@ -127,6 +124,7 @@ export const connect = Effect.fn("Realtime.connect")(function* (input: RealtimeC
export const Realtime = { export const Realtime = {
engines, engines,
engine,
connect, connect,
} as const } as const
@ -160,18 +158,11 @@ const post = <A>(
apiKey: Redacted.Redacted, apiKey: Redacted.Redacted,
body: Record<string, unknown> | FormData, body: Record<string, unknown> | FormData,
response: Schema.Codec<A, string>, response: Schema.Codec<A, string>,
options: { options: { readonly authHeader?: string; readonly headers?: Readonly<Record<string, string>> } = {},
readonly authHeader?: string
readonly headers?: Readonly<Record<string, string>>
readonly timeout?: RequestTimeout
} = {},
) => ) =>
Effect.gen(function* () { Effect.gen(function* () {
const executor = yield* RequestExecutor.Service const executor = yield* RequestExecutor.Service
const res = yield* RequestExecutor.withTimeout( const res = yield* executor.execute(
executor.execute,
options.timeout,
)(
HttpClientRequest.post(url).pipe( HttpClientRequest.post(url).pipe(
HttpClientRequest.setHeaders(options.headers ?? {}), HttpClientRequest.setHeaders(options.headers ?? {}),
options.authHeader options.authHeader
@ -185,7 +176,7 @@ const post = <A>(
const http = RequestExecutor.responseHttp(res) const http = RequestExecutor.responseHttp(res)
const fail = (message: string, cause?: unknown, raw?: string) => const fail = (message: string, cause?: unknown, raw?: string) =>
new AIError({ reason: new InvalidProviderOutputError({ route, message, body: raw, http, cause }) }) new AIError({ reason: new InvalidProviderOutputError({ route, message, body: raw, http, cause }) })
const text = yield* RequestExecutor.responseText(res) const text = yield* res.text.pipe(Effect.mapError((cause) => fail(`Failed to read ${route} response`, cause)))
return yield* Schema.decodeEffect(response)(text).pipe( return yield* Schema.decodeEffect(response)(text).pipe(
Effect.mapError((cause) => fail(`${route} returned an invalid response`, cause, text)), Effect.mapError((cause) => fail(`${route} returned an invalid response`, cause, text)),
) )
@ -197,9 +188,8 @@ const clientSecret = (
model: string, model: string,
apiKey: Redacted.Redacted, apiKey: Redacted.Redacted,
body: Record<string, unknown>, body: Record<string, unknown>,
timeout?: RequestTimeout,
) => ) =>
post(route, `${baseURL}/realtime/client_secrets`, apiKey, body, ClientSecretResponse, { timeout }).pipe( post(route, `${baseURL}/realtime/client_secrets`, apiKey, body, ClientSecretResponse).pipe(
Effect.map( Effect.map(
(data): RealtimeTransport => ({ (data): RealtimeTransport => ({
type: "websocket", type: "websocket",

View file

@ -47,7 +47,7 @@ export class ImageModel<Options extends ImageOptions = ImageOptions> extends Med
return new ImageModel<Options>({ return new ImageModel<Options>({
id: input.id, id: input.id,
provider: route.protocol.provider, provider: route.protocol.provider,
transport: input.transport, http: input.http,
providerOptions: input.providerOptions, providerOptions: input.providerOptions,
route: composeRoute(route, input, collectResponse) as ImageRoute, route: composeRoute(route, input, collectResponse) as ImageRoute,
}) })

View file

@ -7,12 +7,12 @@ import {
InvalidRequestError, InvalidRequestError,
ModelID, ModelID,
ProviderID, ProviderID,
type HttpOptions,
type ProviderOptions, type ProviderOptions,
type TransportOptions,
} from "./schema/index.js" } from "./schema/index.js"
/** /**
* What every media model carries: ids, the configured route, and deployment transport overlays. Modality classes * What every media model carries: ids, the configured route, and deployment `http` overlays. Modality classes
* (`ImageModel`, `VideoModel`, `SpeechModel`, `TranscriptionModel`) extend it with their route type and a nominal * (`ImageModel`, `VideoModel`, `SpeechModel`, `TranscriptionModel`) extend it with their route type and a nominal
* marker so one cannot stand in for the other in requests. * marker so one cannot stand in for the other in requests.
*/ */
@ -23,8 +23,7 @@ export class MediaModel<Route, Options> {
readonly id: ModelID readonly id: ModelID
readonly provider: ProviderID readonly provider: ProviderID
readonly route: Route readonly route: Route
/** Deployment headers, timeouts and `http` overlays, below each request's own. */ readonly http?: HttpOptions
readonly transport?: TransportOptions
/** Defaults under each request's `providerOptions`, such as options a provider package reads from its settings. */ /** Defaults under each request's `providerOptions`, such as options a provider package reads from its settings. */
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
@ -32,7 +31,7 @@ export class MediaModel<Route, Options> {
this.id = ModelID.make(input.id) this.id = ModelID.make(input.id)
this.provider = ProviderID.make(input.provider) this.provider = ProviderID.make(input.provider)
this.route = input.route this.route = input.route
this.transport = input.transport this.http = input.http
this.providerOptions = input.providerOptions this.providerOptions = input.providerOptions
} }
} }
@ -44,7 +43,7 @@ export namespace MediaModel {
readonly id: string | ModelID readonly id: string | ModelID
readonly provider: string | ProviderID readonly provider: string | ProviderID
readonly route: Route readonly route: Route
readonly transport?: TransportOptions readonly http?: HttpOptions
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
} }
@ -102,7 +101,8 @@ const composition = <Request extends MediaRoute.MediaRequest, Protocol>(
protocol: route.protocol, protocol: route.protocol,
endpoint: Endpoint.path(route.path, { baseURL: input.baseURL ?? route.baseURL }), endpoint: Endpoint.path(route.path, { baseURL: input.baseURL ?? route.baseURL }),
auth: input.auth, auth: input.auth,
headers: route.headers, headers:
route.headers === undefined && input.headers === undefined ? undefined : { ...route.headers, ...input.headers },
}) })
const isStreamInput = <Request extends MediaRoute.MediaRequest, Event, Response, Frame, State, Token>( const isStreamInput = <Request extends MediaRoute.MediaRequest, Event, Response, Frame, State, Token>(

View file

@ -4,15 +4,9 @@ import { Effect, FileSystem, Result, Schema, SchemaGetter, Stream } from "effect
import { Base64 } from "effect/encoding" import { Base64 } from "effect/encoding"
import { HttpClientRequest } from "effect/http" import { HttpClientRequest } from "effect/http"
import { ProviderID } from "./schema/ids.js" import { ProviderID } from "./schema/ids.js"
import { AIError, InvalidRequestError } from "./schema/errors.js" import { AIError, InvalidProviderOutputError, InvalidRequestError } from "./schema/errors.js"
import { ProviderMetadata } from "./schema/options.js" import { ProviderMetadata } from "./schema/options.js"
import { import { CurrentMiddleware, type HttpMiddleware, responseHttp, Service } from "./route/executor-service.js"
CurrentMiddleware,
type HttpMiddleware,
responseBytes,
responseStream,
Service,
} from "./route/executor-service.js"
import { detectMediaType, fileMediaType } from "./utils/media-type.js" import { detectMediaType, fileMediaType } from "./utils/media-type.js"
export { detectMediaType } from "./utils/media-type.js" export { detectMediaType } from "./utils/media-type.js"
@ -277,7 +271,19 @@ const download = Effect.fn("Media.download")(function* (
const response = yield* executor const response = yield* executor
.execute(HttpClientRequest.get(source.url).pipe(HttpClientRequest.setHeaders(headers ?? {}))) .execute(HttpClientRequest.get(source.url).pipe(HttpClientRequest.setHeaders(headers ?? {})))
.pipe(Effect.provideService(CurrentMiddleware, middleware)) .pipe(Effect.provideService(CurrentMiddleware, middleware))
return yield* responseBytes(response) const buffer = yield* response.arrayBuffer.pipe(
Effect.mapError(
(cause) =>
new AIError({
reason: new InvalidProviderOutputError({
message: `Failed to read media from ${source.url}`,
http: responseHttp(response),
cause,
}),
}),
),
)
return new Uint8Array(buffer)
}) })
const downloadStream = Effect.fn("Media.downloadStream")(function* ( const downloadStream = Effect.fn("Media.downloadStream")(function* (
@ -289,7 +295,18 @@ const downloadStream = Effect.fn("Media.downloadStream")(function* (
const response = yield* executor const response = yield* executor
.execute(HttpClientRequest.get(source.url).pipe(HttpClientRequest.setHeaders(headers ?? {}))) .execute(HttpClientRequest.get(source.url).pipe(HttpClientRequest.setHeaders(headers ?? {})))
.pipe(Effect.provideService(CurrentMiddleware, middleware)) .pipe(Effect.provideService(CurrentMiddleware, middleware))
return responseStream(response) return response.stream.pipe(
Stream.mapError(
(cause) =>
new AIError({
reason: new InvalidProviderOutputError({
message: `Failed to read media from ${source.url}`,
http: responseHttp(response),
cause,
}),
}),
),
)
}) })
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View file

@ -44,8 +44,6 @@ export const protocol = Protocol.make({
}), }),
}, },
stream: AnthropicMessages.protocol.stream, stream: AnthropicMessages.protocol.stream,
supportsEffortUpdates: AnthropicMessages.protocol.supportsEffortUpdates,
toolUpdates: AnthropicMessages.protocol.toolUpdates,
}) })
export * as AlibabaMessages from "./alibaba-messages.js" export * as AlibabaMessages from "./alibaba-messages.js"

View file

@ -81,7 +81,6 @@ export const protocol = Protocol.make({
), ),
) )
}), }),
supportsEffortUpdates: OpenResponses.protocol.supportsEffortUpdates,
}) })
export * as AlibabaResponses from "./alibaba-responses.js" export * as AlibabaResponses from "./alibaba-responses.js"

View file

@ -29,7 +29,7 @@ import {
import { JsonObject, knownString, optionalArray, optionalNull, ProviderShared, withUntypedFrames } from "./shared.js" import { JsonObject, knownString, optionalArray, optionalNull, ProviderShared, withUntypedFrames } from "./shared.js"
import { classifyProviderFailure } from "../provider-error.js" import { classifyProviderFailure } from "../provider-error.js"
import { effortUpdate, resolveEffortUpdates } from "../effort-updates.js" import { effortUpdate, resolveEffortUpdates } from "../effort-updates.js"
import { addsTools, toolsUpdate, type ToolUpdateEncoding } from "../tool-updates.js" import { addsTools, foldTools, toolsUpdate, withdrawnTools, type ToolUpdateEncoding } from "../tool-updates.js"
import * as Cache from "./utils/cache.js" import * as Cache from "./utils/cache.js"
import { claudeVersion, supportsThinkingBlockBinding, THINKING_BINDING_BETA } from "./utils/claude-model.js" import { claudeVersion, supportsThinkingBlockBinding, THINKING_BINDING_BETA } from "./utils/claude-model.js"
import { Lifecycle } from "./utils/lifecycle.js" import { Lifecycle } from "./utils/lifecycle.js"
@ -806,6 +806,7 @@ const lowerWrappedSystemUpdate = Effect.fnUntraced(function* (
const lowerToolsUpdate = Effect.fnUntraced(function* ( const lowerToolsUpdate = Effect.fnUntraced(function* (
message: LLMRequest["messages"][number], message: LLMRequest["messages"][number],
update: ToolChanges, update: ToolChanges,
withdrawn: ReadonlyArray<string>,
breakpoints: Cache.Breakpoints, breakpoints: Cache.Breakpoints,
) { ) {
const text = message.content.length === 0 ? [] : (yield* lowerNativeSystemUpdate(message, breakpoints)).content const text = message.content.length === 0 ? [] : (yield* lowerNativeSystemUpdate(message, breakpoints)).content
@ -816,7 +817,7 @@ const lowerToolsUpdate = Effect.fnUntraced(function* (
type: "tool_addition" as const, type: "tool_addition" as const,
tool: { type: "tool_definition" as const, definition: lowerTool(breakpoints, tool) }, tool: { type: "tool_definition" as const, definition: lowerTool(breakpoints, tool) },
})), })),
...update.remove.map((name) => ({ ...withdrawn.map((name) => ({
type: "tool_removal" as const, type: "tool_removal" as const,
tool: { type: "tool_reference" as const, name }, tool: { type: "tool_reference" as const, name },
})), })),
@ -838,13 +839,17 @@ const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, breakpoi
// user turn, the nearest spot where Anthropic accepts a native system message. // user turn, the nearest spot where Anthropic accepts a native system message.
const holdUpdates = supportsNativeSystemUpdates(request) const holdUpdates = supportsNativeSystemUpdates(request)
const held: Array<LLMRequest["messages"][number]> = [] const held: Array<LLMRequest["messages"][number]> = []
// The tools declared so far, so each tool update can name the flattened tools it takes away.
let declared = request.tools
const releaseHeld = Effect.fnUntraced(function* () { const releaseHeld = Effect.fnUntraced(function* () {
const native = acceptsNativeSystemAfter(messages.findLast((message) => message.role !== "system")) const native = acceptsNativeSystemAfter(messages.findLast((message) => message.role !== "system"))
for (const update of held.splice(0)) { for (const update of held.splice(0)) {
const tools = toolsUpdate(update) const tools = toolsUpdate(update)
if (tools !== undefined) { if (tools !== undefined) {
if (!native) return yield* invalid("Anthropic Messages tool updates must follow a user message or tool result") if (!native) return yield* invalid("Anthropic Messages tool updates must follow a user message or tool result")
const lowered = yield* lowerToolsUpdate(update, tools, breakpoints) const next = foldTools(declared, tools.add, tools.remove)
const lowered = yield* lowerToolsUpdate(update, tools, withdrawnTools(declared, next), breakpoints)
declared = next
if (lowered.content.length > 0) messages.push(lowered) if (lowered.content.length > 0) messages.push(lowered)
continue continue
} }
@ -1022,8 +1027,8 @@ const fromRequest = Effect.fn("AnthropicMessages.fromRequest")(function* (reques
// messages. Tools live highest in the cache hierarchy, so when callers // messages. Tools live highest in the cache hierarchy, so when callers
// over-mark we keep their tool hints and shed the message-tail ones first. // over-mark we keep their tool hints and shed the message-tail ones first.
const breakpoints = Cache.newBreakpoints(ANTHROPIC_BREAKPOINT_CAP) const breakpoints = Cache.newBreakpoints(ANTHROPIC_BREAKPOINT_CAP)
const definitions = ProviderShared.flattenTools(updates.request.tools) const flattened = ProviderShared.flattenToolRequest(updates.request)
const tools = definitions.length === 0 ? undefined : definitions.map((tool) => lowerTool(breakpoints, tool)) const tools = flattened.tools.length === 0 ? undefined : flattened.tools.map((tool) => lowerTool(breakpoints, tool))
// Anthropic rejects tool_choice when no tool is declared; "none" is only meaningful with tools present. // Anthropic rejects tool_choice when no tool is declared; "none" is only meaningful with tools present.
const declared = tools !== undefined || addsTools(request) const declared = tools !== undefined || addsTools(request)
const toolChoice = !declared || !request.toolChoice ? undefined : yield* lowerToolChoice(request.toolChoice) const toolChoice = !declared || !request.toolChoice ? undefined : yield* lowerToolChoice(request.toolChoice)
@ -1036,7 +1041,7 @@ const fromRequest = Effect.fn("AnthropicMessages.fromRequest")(function* (reques
text: part.text, text: part.text,
cache_control: cacheControl(breakpoints, part.cache), cache_control: cacheControl(breakpoints, part.cache),
})) }))
const messages = yield* lowerMessages(updates.request, breakpoints) const messages = yield* lowerMessages(flattened.request, breakpoints)
yield* Cache.warnDropped(breakpoints, "Anthropic Messages", ANTHROPIC_BREAKPOINT_CAP) yield* Cache.warnDropped(breakpoints, "Anthropic Messages", ANTHROPIC_BREAKPOINT_CAP)
const output_config = const output_config =
updates.effort === undefined && format === undefined ? undefined : { effort: updates.effort, format } updates.effort === undefined && format === undefined ? undefined : { effort: updates.effort, format }

View file

@ -312,8 +312,8 @@ const removeEmptyToolInputKeys = (input: unknown): unknown => {
const lowerToolCall = (part: ToolCallPart, normalizeID: (id: string) => string): BedrockToolUseBlock => ({ const lowerToolCall = (part: ToolCallPart, normalizeID: (id: string) => string): BedrockToolUseBlock => ({
toolUse: { toolUse: {
toolUseId: normalizeID(part.id), toolUseId: normalizeID(part.id),
// Converse rejects replayed names over 64 characters; flattenRequest already fixed invalid characters. // Models can emit names that Converse rejects when replayed in history.
name: part.name.slice(0, 64), name: part.name.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64) || "_",
input: removeEmptyToolInputKeys(part.input), input: removeEmptyToolInputKeys(part.input),
}, },
}) })
@ -560,7 +560,7 @@ const applyThinkingBindingDefault = (request: LLMRequest, thinking: Readonly<Rec
const fromRequest = Effect.fn("BedrockConverse.fromRequest")(function* (request: LLMRequest) { const fromRequest = Effect.fn("BedrockConverse.fromRequest")(function* (request: LLMRequest) {
const toolChoice = request.toolChoice ? yield* lowerToolChoice(request.toolChoice) : undefined const toolChoice = request.toolChoice ? yield* lowerToolChoice(request.toolChoice) : undefined
const definitions = ProviderShared.flattenTools(request.tools) const flattened = ProviderShared.flattenToolRequest(request)
const options = yield* decodeOptions(request.providerOptions ?? {}) const options = yield* decodeOptions(request.providerOptions ?? {})
const maxTokens = const maxTokens =
isNova2(request.model) && (options.effort === "high" || isHighReasoningEffort(request.http?.body)) isNova2(request.model) && (options.effort === "high" || isHighReasoningEffort(request.http?.body))
@ -593,16 +593,16 @@ const fromRequest = Effect.fn("BedrockConverse.fromRequest")(function* (request:
// tools → system → messages order to favour the highest-impact prefixes. // tools → system → messages order to favour the highest-impact prefixes.
const breakpoints = BedrockCache.breakpoints(request.model) const breakpoints = BedrockCache.breakpoints(request.model)
const toolConfig = (() => { const toolConfig = (() => {
if (definitions.length === 0) return undefined if (flattened.tools.length === 0) return undefined
return { return {
tools: lowerTools(breakpoints, definitions), tools: lowerTools(breakpoints, flattened.tools),
// Converse has no native "none". Keep definitions stable for prompt // Converse has no native "none". Keep definitions stable for prompt
// caching and omit only the unsupported choice. // caching and omit only the unsupported choice.
toolChoice, toolChoice,
} }
})() })()
const system = lowerSystem(breakpoints, request.system) const system = lowerSystem(breakpoints, request.system)
const messages = yield* lowerMessages(request, breakpoints) const messages = yield* lowerMessages(flattened.request, breakpoints)
yield* warnDropped(breakpoints, "Bedrock Converse", BedrockCache.BEDROCK_BREAKPOINT_CAP) yield* warnDropped(breakpoints, "Bedrock Converse", BedrockCache.BEDROCK_BREAKPOINT_CAP)
const inferenceConfig = (() => { const inferenceConfig = (() => {
if ( if (

View file

@ -145,7 +145,7 @@ const TOOL_CHOICE = { auto: undefined, none: "NONE", required: "REQUIRED", tool:
const fromRequest = Effect.fn("CohereChat.fromRequest")(function* (request: LLMRequest) { const fromRequest = Effect.fn("CohereChat.fromRequest")(function* (request: LLMRequest) {
const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Options))(request.providerOptions ?? {}) const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Options))(request.providerOptions ?? {})
const definitions = ProviderShared.flattenTools(request.tools) const flattened = ProviderShared.flattenToolRequest(request)
const messages: (typeof Message.Type)[] = request.system.length const messages: (typeof Message.Type)[] = request.system.length
? [ ? [
{ {
@ -157,7 +157,7 @@ const fromRequest = Effect.fn("CohereChat.fromRequest")(function* (request: LLMR
}, },
] ]
: [] : []
for (const message of request.messages) { for (const message of flattened.request.messages) {
if (message.role === "system") { if (message.role === "system") {
messages.push({ role: "user", content: (yield* ProviderShared.wrappedSystemUpdate("Cohere Chat", message)).text }) messages.push({ role: "user", content: (yield* ProviderShared.wrappedSystemUpdate("Cohere Chat", message)).text })
continue continue
@ -211,7 +211,7 @@ const fromRequest = Effect.fn("CohereChat.fromRequest")(function* (request: LLMR
}) })
} }
const selected = request.toolChoice?.type === "tool" ? request.toolChoice.name : undefined const selected = request.toolChoice?.type === "tool" ? request.toolChoice.name : undefined
const tools = selected === undefined ? definitions : definitions.filter((tool) => tool.name === selected) const tools = selected === undefined ? flattened.tools : flattened.tools.filter((tool) => tool.name === selected)
if (selected !== undefined && tools.length === 0) if (selected !== undefined && tools.length === 0)
return yield* ProviderShared.invalidRequest("Cohere Chat tool choice must name an available tool") return yield* ProviderShared.invalidRequest("Cohere Chat tool choice must name an available tool")
if (tools.some((tool) => tool.native !== undefined)) if (tools.some((tool) => tool.native !== undefined))

View file

@ -149,6 +149,25 @@ const GeminiThinkingConfig = Schema.Struct({
thinkingLevel: Schema.optional(GeminiThinkingLevel), thinkingLevel: Schema.optional(GeminiThinkingLevel),
}) })
const GeminiSafetySetting = Schema.Struct({
category: knownString<
| "HARM_CATEGORY_UNSPECIFIED"
| "HARM_CATEGORY_HATE_SPEECH"
| "HARM_CATEGORY_DANGEROUS_CONTENT"
| "HARM_CATEGORY_HARASSMENT"
| "HARM_CATEGORY_SEXUALLY_EXPLICIT"
| "HARM_CATEGORY_CIVIC_INTEGRITY"
>(),
threshold: knownString<
| "HARM_BLOCK_THRESHOLD_UNSPECIFIED"
| "BLOCK_LOW_AND_ABOVE"
| "BLOCK_MEDIUM_AND_ABOVE"
| "BLOCK_ONLY_HIGH"
| "BLOCK_NONE"
| "OFF"
>(),
})
// ============================================================================= // =============================================================================
// Provider Options // Provider Options
// ============================================================================= // =============================================================================
@ -161,7 +180,7 @@ const GeminiThinkingConfigInput = Schema.Struct({
}) })
const Options = Schema.Struct({ const Options = Schema.Struct({
cachedContent: lenient(Schema.String), cachedContent: lenient(Schema.String),
safetySettings: lenient(Schema.Array(GeminiGenerateContent.SafetySetting)), safetySettings: lenient(Schema.Array(GeminiSafetySetting)),
serviceTier: lenient(knownString<"standard" | "flex" | "priority">()), serviceTier: lenient(knownString<"standard" | "flex" | "priority">()),
thinkingConfig: lenient(GeminiThinkingConfigInput), thinkingConfig: lenient(GeminiThinkingConfigInput),
}) })
@ -183,7 +202,7 @@ const GeminiBodyFields = {
cachedContent: Schema.optional(Schema.String), cachedContent: Schema.optional(Schema.String),
contents: Schema.Array(GeminiContent), contents: Schema.Array(GeminiContent),
labels: Schema.optional(Schema.Record(Schema.String, Schema.String)), labels: Schema.optional(Schema.Record(Schema.String, Schema.String)),
safetySettings: optionalArray(GeminiGenerateContent.SafetySetting), safetySettings: optionalArray(GeminiSafetySetting),
serviceTier: Schema.optional(Schema.String), serviceTier: Schema.optional(Schema.String),
systemInstruction: Schema.optional(GeminiSystemInstruction), systemInstruction: Schema.optional(GeminiSystemInstruction),
tools: optionalArray(GeminiTool), tools: optionalArray(GeminiTool),
@ -423,8 +442,8 @@ const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest) {
}) })
const fromRequest = Effect.fn("Gemini.fromRequest")(function* (request: LLMRequest) { const fromRequest = Effect.fn("Gemini.fromRequest")(function* (request: LLMRequest) {
const definitions = ProviderShared.flattenTools(request.tools) const flattened = ProviderShared.flattenToolRequest(request)
const hasTools = definitions.length > 0 const hasTools = flattened.tools.length > 0
const options = yield* decodeOptions(request.providerOptions ?? {}) const options = yield* decodeOptions(request.providerOptions ?? {})
const generationConfig = { const generationConfig = {
maxOutputTokens: request.maxTokens, maxOutputTokens: request.maxTokens,
@ -455,7 +474,7 @@ const fromRequest = Effect.fn("Gemini.fromRequest")(function* (request: LLMReque
return { return {
cachedContent: options.cachedContent, cachedContent: options.cachedContent,
contents: yield* lowerMessages(request), contents: yield* lowerMessages(flattened.request),
safetySettings: options.safetySettings, safetySettings: options.safetySettings,
serviceTier: options.serviceTier, serviceTier: options.serviceTier,
systemInstruction: systemInstruction:
@ -463,7 +482,7 @@ const fromRequest = Effect.fn("Gemini.fromRequest")(function* (request: LLMReque
tools: hasTools tools: hasTools
? [ ? [
{ {
functionDeclarations: definitions.map(lowerTool), functionDeclarations: flattened.tools.map(lowerTool),
}, },
] ]
: undefined, : undefined,

View file

@ -1,14 +1,9 @@
import { Effect, Option, Schema, SchemaGetter, Stream } from "effect" import { Effect, Option, Schema, SchemaGetter } from "effect"
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { Auth } from "../route/auth.js" import { Auth } from "../route/auth.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { Framing } from "../route/framing.js"
import { Protocol } from "../route/protocol.js" import { Protocol } from "../route/protocol.js"
import {
HttpTransport,
type Transport,
type TransportExecution,
type TransportPrepareInput,
} from "../route/transport/index.js"
import { import {
AIError, AIError,
ContentPolicyError, ContentPolicyError,
@ -30,9 +25,6 @@ import { GeminiGenerateContent } from "./utils/gemini-generate-content.js"
import { ToolStream } from "./utils/tool-stream.js" import { ToolStream } from "./utils/tool-stream.js"
const ADAPTER = "google-interactions" const ADAPTER = "google-interactions"
const CONTINUATION = "requires_continuation"
// Matches Google's GenAI SDKs (Python, JS, and Go).
const MAX_STREAM_RECONNECTS_WITHOUT_PROGRESS = 3
const SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator" const SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator"
export const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta" export const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta"
@ -46,7 +38,6 @@ const Options = Schema.Struct({
thinkingLevel: lenient(ThinkingLevel), thinkingLevel: lenient(ThinkingLevel),
thinkingSummaries: lenient(knownString<"auto" | "none">()), thinkingSummaries: lenient(knownString<"auto" | "none">()),
serviceTier: lenient(knownString<"standard" | "flex" | "priority" | "deferred">()), serviceTier: lenient(knownString<"standard" | "flex" | "priority" | "deferred">()),
safetySettings: lenient(Schema.Array(GeminiGenerateContent.SafetySetting)),
}) })
export type OptionsInput = typeof Options.Encoded export type OptionsInput = typeof Options.Encoded
export type ProviderOptionsInput = OptionsInput export type ProviderOptionsInput = OptionsInput
@ -92,14 +83,12 @@ const ToolChoice = Schema.Union([
]) ])
const Body = Schema.Struct({ const Body = Schema.Struct({
model: Schema.String, model: Schema.String,
input: Schema.optional(Schema.Array(InputStep)), input: Schema.Array(InputStep),
stream: Schema.Literal(true), stream: Schema.Literal(true),
store: Schema.Boolean, store: Schema.Boolean,
previous_interaction_id: Schema.optional(Schema.String), previous_interaction_id: Schema.optional(Schema.String),
continuation_token: Schema.optional(Schema.String),
system_instruction: Schema.optional(Schema.String), system_instruction: Schema.optional(Schema.String),
service_tier: Schema.optional(Schema.String), service_tier: Schema.optional(Schema.String),
safety_settings: Schema.optional(Schema.Array(Schema.Struct({ type: Schema.String, threshold: Schema.String }))),
tools: Schema.optional( tools: Schema.optional(
Schema.Array( Schema.Array(
Schema.Struct({ Schema.Struct({
@ -168,7 +157,6 @@ const Interaction = Schema.StructWithRest(
Schema.Struct({ Schema.Struct({
id: Schema.optional(Schema.String), id: Schema.optional(Schema.String),
status: Schema.String, status: Schema.String,
continuation_token: optionalNull(Schema.String),
usage: Schema.optional(RawUsage), usage: Schema.optional(RawUsage),
errors: Schema.optional( errors: Schema.optional(
Schema.Array(Schema.Struct({ code: Schema.optional(Schema.String), message: Schema.optional(Schema.String) })), Schema.Array(Schema.Struct({ code: Schema.optional(Schema.String), message: Schema.optional(Schema.String) })),
@ -214,8 +202,6 @@ const Event = Schema.Union([
event_type: Schema.Literal("interaction.status_update"), event_type: Schema.Literal("interaction.status_update"),
interaction_id: Schema.optional(Schema.String), interaction_id: Schema.optional(Schema.String),
status: Schema.String, status: Schema.String,
continuation_token: optionalNull(Schema.String),
usage: Schema.optional(RawUsage),
}), }),
Schema.Struct({ event_type: Schema.Literal("interaction.completed"), interaction: Interaction }), Schema.Struct({ event_type: Schema.Literal("interaction.completed"), interaction: Interaction }),
Schema.Struct({ event_type: Schema.Literal("error"), error: Schema.optionalKey(Schema.Unknown) }), Schema.Struct({ event_type: Schema.Literal("error"), error: Schema.optionalKey(Schema.Unknown) }),
@ -230,10 +216,6 @@ interface ParserState {
readonly route: string readonly route: string
readonly metadataKey: string readonly metadataKey: string
readonly lifecycle: Lifecycle.State readonly lifecycle: Lifecycle.State
readonly hop: number
readonly hasToolCalls: boolean
readonly usage?: RawUsage
readonly continuedUsage: ReadonlyArray<RawUsage | undefined>
readonly steps: Partial<Record<number, OutputStep>> readonly steps: Partial<Record<number, OutputStep>>
readonly tools: ToolStream.State<number> readonly tools: ToolStream.State<number>
} }
@ -242,28 +224,13 @@ type StepResult = readonly [ParserState, ReadonlyArray<LLMEvent>]
// ============================================================================= // =============================================================================
// Request Body Construction // Request Body Construction
// ============================================================================= // =============================================================================
// https://aistudio.google.com/docs/document-processing#office-documents
const OFFICE_DOCUMENT_MIME_TYPES = new Set([
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
"application/vnd.oasis.opendocument.text",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.oasis.opendocument.presentation",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.oasis.opendocument.spreadsheet",
])
export const mediaContent = Effect.fnUntraced(function* (asset: Media.Asset) { export const mediaContent = Effect.fnUntraced(function* (asset: Media.Asset) {
if ( if (
asset.kind !== "image" && asset.kind !== "image" &&
asset.kind !== "audio" && asset.kind !== "audio" &&
asset.kind !== "video" && asset.kind !== "video" &&
asset.mediaType !== "application/pdf" && asset.mediaType !== "application/pdf" &&
asset.mediaType !== "text/csv" && asset.mediaType !== "text/csv"
!OFFICE_DOCUMENT_MIME_TYPES.has(asset.mediaType)
) )
return yield* ProviderShared.invalidRequest( return yield* ProviderShared.invalidRequest(
`Google Interactions does not support ${asset.mediaType} document input`, `Google Interactions does not support ${asset.mediaType} document input`,
@ -368,8 +335,8 @@ const lowerToolResult = Effect.fnUntraced(function* (part: ToolResultPart) {
const fromRequest = Effect.fn("GoogleInteractions.fromRequest")(function* (request: LLMRequest) { const fromRequest = Effect.fn("GoogleInteractions.fromRequest")(function* (request: LLMRequest) {
const options = yield* decodeOptions(request.providerOptions ?? {}) const options = yield* decodeOptions(request.providerOptions ?? {})
const definitions = ProviderShared.flattenTools(request.tools) const flattened = ProviderShared.flattenToolRequest(request)
if (definitions.some((tool) => tool.native !== undefined)) if (flattened.tools.some((tool) => tool.native !== undefined))
return yield* ProviderShared.invalidRequest("Google Interactions hosted tools are not supported") return yield* ProviderShared.invalidRequest("Google Interactions hosted tools are not supported")
if (request.topK !== undefined || request.frequencyPenalty !== undefined || request.presencePenalty !== undefined) if (request.topK !== undefined || request.frequencyPenalty !== undefined || request.presencePenalty !== undefined)
return yield* ProviderShared.invalidRequest( return yield* ProviderShared.invalidRequest(
@ -386,19 +353,15 @@ const fromRequest = Effect.fn("GoogleInteractions.fromRequest")(function* (reque
}) })
return { return {
model: request.model.id, model: request.model.id,
input: yield* lowerMessages(request), input: yield* lowerMessages(flattened.request),
stream: true as const, stream: true as const,
// Full-history replay need not create retained provider resources. Continuation callers opt in to storage. // Full-history replay need not create retained provider resources. Continuation callers opt in to storage.
store: options.store ?? false, store: options.store ?? false,
previous_interaction_id: options.previousInteractionId, previous_interaction_id: options.previousInteractionId,
system_instruction: request.system.length ? ProviderShared.joinText(request.system) : undefined, system_instruction: request.system.length ? ProviderShared.joinText(request.system) : undefined,
service_tier: options.serviceTier, service_tier: options.serviceTier,
safety_settings: options.safetySettings?.map((setting) => ({ tools: flattened.tools.length
type: setting.category.replace(/^HARM_CATEGORY_/, "").toLowerCase(), ? flattened.tools.map((tool) => ({
threshold: setting.threshold.toLowerCase(),
})),
tools: definitions.length
? definitions.map((tool) => ({
type: "function" as const, type: "function" as const,
name: tool.name, name: tool.name,
description: tool.description, description: tool.description,
@ -424,54 +387,32 @@ const fromRequest = Effect.fn("GoogleInteractions.fromRequest")(function* (reque
const metadata = (state: ParserState, step: OutputStep): ProviderMetadata => ({ const metadata = (state: ParserState, step: OutputStep): ProviderMetadata => ({
[state.metadataKey]: { interactionSignature: step.signature }, [state.metadataKey]: { interactionSignature: step.signature },
}) })
const mapUsage = (usage: RawUsage | undefined, key: string, continued: ParserState["continuedUsage"]) => { const mapUsage = (usage: RawUsage | undefined, key: string) => {
if (!usage && continued.every((hop) => !hop)) return undefined if (!usage) return undefined
const first = continued.length ? continued[0] : usage const input = usage.total_input_tokens ?? undefined
const hops = [...continued, usage] const cached = usage.total_cached_tokens ?? undefined
const sum = (field: (hop: RawUsage) => number | null | undefined) => const reasoning = usage.total_thought_tokens ?? undefined
ProviderShared.sumTokens(...hops.map((hop) => (hop ? (field(hop) ?? undefined) : undefined))) const output =
const input = first?.total_input_tokens ?? undefined usage.total_output_tokens === undefined || usage.total_output_tokens === null
const cached = first?.total_cached_tokens ?? undefined
const reasoning = sum((hop) => hop.total_thought_tokens)
const text = sum((hop) => hop.total_output_tokens)
const output = continued.length
? ProviderShared.sumTokens(text, reasoning)
: text === undefined
? undefined ? undefined
: text + (reasoning ?? 0) : usage.total_output_tokens + (reasoning ?? 0)
return new Usage({ return new Usage({
contextTokens: first?.raw_prompt_token ?? input, contextTokens: usage.raw_prompt_token ?? input,
inputTokens: input, inputTokens: input,
outputTokens: output, outputTokens: output,
nonCachedInputTokens: ProviderShared.subtractTokens(input, cached), nonCachedInputTokens: ProviderShared.subtractTokens(input, cached),
cacheReadInputTokens: cached, cacheReadInputTokens: cached,
reasoningTokens: reasoning, reasoningTokens: reasoning,
totalTokens: continued.length totalTokens: usage.total_tokens ?? undefined,
? ProviderShared.totalTokens(input, output, undefined) providerMetadata: { [key]: usage },
: (usage?.total_tokens ?? undefined),
// Keep re-billed input in provider metadata, separate from the logical call's input.
providerMetadata: {
[key]: continued.length
? {
total_input_tokens: sum((hop) => hop.total_input_tokens),
total_cached_tokens: sum((hop) => hop.total_cached_tokens),
total_output_tokens: text,
total_thought_tokens: reasoning,
total_tokens: sum((hop) => hop.total_tokens),
requests: hops.length,
}
: (usage ?? {}),
},
}) })
} }
const blockID = (state: ParserState, index: number) => (state.hop === 0 ? String(index) : `${state.hop}:${index}`)
const onStart = Effect.fnUntraced(function* (state: ParserState, index: number, step: OutputStep) { const onStart = Effect.fnUntraced(function* (state: ParserState, index: number, step: OutputStep) {
const events: LLMEvent[] = [] const events: LLMEvent[] = []
let lifecycle = Lifecycle.stepStart(state.lifecycle, events) let lifecycle = Lifecycle.stepStart(state.lifecycle, events)
let tools = state.tools let tools = state.tools
const id = blockID(state, index) const id = String(index)
if (step.type === "thought") { if (step.type === "thought") {
lifecycle = Lifecycle.reasoningStart(lifecycle, events, id, metadata(state, step)) lifecycle = Lifecycle.reasoningStart(lifecycle, events, id, metadata(state, step))
for (const part of step.summary ?? []) lifecycle = Lifecycle.reasoningDelta(lifecycle, events, id, part.text) for (const part of step.summary ?? []) lifecycle = Lifecycle.reasoningDelta(lifecycle, events, id, part.text)
@ -498,16 +439,7 @@ const onStart = Effect.fnUntraced(function* (state: ParserState, index: number,
events.push(LLMEvent.toolInputStart({ id: step.id, name: step.name, providerMetadata: metadata(state, step) })) events.push(LLMEvent.toolInputStart({ id: step.id, name: step.name, providerMetadata: metadata(state, step) }))
} else } else
return yield* ProviderShared.eventError(ADAPTER, `Unsupported Interactions step: ${step.type}`, encodeJson(step)) return yield* ProviderShared.eventError(ADAPTER, `Unsupported Interactions step: ${step.type}`, encodeJson(step))
return [ return [{ ...state, lifecycle, tools, steps: { ...state.steps, [index]: step } }, events] satisfies StepResult
{
...state,
lifecycle,
tools,
hasToolCalls: state.hasToolCalls || step.type === "function_call",
steps: { ...state.steps, [index]: step },
},
events,
] satisfies StepResult
}) })
const onDelta = Effect.fnUntraced(function* (state: ParserState, index: number, delta: typeof Delta.Type) { const onDelta = Effect.fnUntraced(function* (state: ParserState, index: number, delta: typeof Delta.Type) {
@ -517,15 +449,12 @@ const onDelta = Effect.fnUntraced(function* (state: ParserState, index: number,
const events: LLMEvent[] = [] const events: LLMEvent[] = []
if (delta.type === "text" && step.type === "model_output") if (delta.type === "text" && step.type === "model_output")
return [ return [
{ ...state, lifecycle: Lifecycle.textDelta(state.lifecycle, events, blockID(state, index), delta.text) }, { ...state, lifecycle: Lifecycle.textDelta(state.lifecycle, events, String(index), delta.text) },
events, events,
] satisfies StepResult ] satisfies StepResult
if (delta.type === "thought_summary" && step.type === "thought") if (delta.type === "thought_summary" && step.type === "thought")
return [ return [
{ { ...state, lifecycle: Lifecycle.reasoningDelta(state.lifecycle, events, String(index), delta.content.text) },
...state,
lifecycle: Lifecycle.reasoningDelta(state.lifecycle, events, blockID(state, index), delta.content.text),
},
events, events,
] satisfies StepResult ] satisfies StepResult
if (delta.type === "thought_signature") { if (delta.type === "thought_signature") {
@ -564,15 +493,12 @@ const onStop = Effect.fnUntraced(function* (state: ParserState, index: number) {
const events: LLMEvent[] = [] const events: LLMEvent[] = []
if (step.type === "thought") if (step.type === "thought")
return [ return [
{ { ...state, lifecycle: Lifecycle.reasoningEnd(state.lifecycle, events, String(index), metadata(state, step)) },
...state,
lifecycle: Lifecycle.reasoningEnd(state.lifecycle, events, blockID(state, index), metadata(state, step)),
},
events, events,
] satisfies StepResult ] satisfies StepResult
if (step.type === "model_output") if (step.type === "model_output")
return [ return [
{ ...state, lifecycle: Lifecycle.textEnd(state.lifecycle, events, blockID(state, index)) }, { ...state, lifecycle: Lifecycle.textEnd(state.lifecycle, events, String(index)) },
events, events,
] satisfies StepResult ] satisfies StepResult
const result = yield* ToolStream.finish(ADAPTER, state.tools, index) const result = yield* ToolStream.finish(ADAPTER, state.tools, index)
@ -598,32 +524,7 @@ const failureReason = (route: string, code: string | undefined, message: string,
return classifyProviderFailure({ message, data, rawBody }) return classifyProviderFailure({ message, data, rawBody })
} }
// Marks a request boundary without adding another logical LLM step or finish. const step = Effect.fnUntraced(function* (state: ParserState, event: Event) {
class NextRequest {}
const step = Effect.fnUntraced(function* (state: ParserState, event: Event | NextRequest) {
if (event instanceof NextRequest) {
const pending = yield* ToolStream.finishAll(ADAPTER, state.tools)
const events = [...pending.events]
let lifecycle = state.lifecycle
for (const [index, step] of Object.entries(state.steps)) {
const id = blockID(state, Number(index))
if (step?.type === "thought") lifecycle = Lifecycle.reasoningEnd(lifecycle, events, id, metadata(state, step))
if (step?.type === "model_output") lifecycle = Lifecycle.textEnd(lifecycle, events, id)
}
return [
{
...state,
hop: state.hop + 1,
lifecycle,
steps: {},
tools: ToolStream.empty<number>(),
usage: undefined,
continuedUsage: [...state.continuedUsage, state.usage],
},
events,
] satisfies StepResult
}
switch (event.event_type) { switch (event.event_type) {
case "step.start": case "step.start":
return yield* onStart(state, event.index, event.step) return yield* onStart(state, event.index, event.step)
@ -631,9 +532,8 @@ const step = Effect.fnUntraced(function* (state: ParserState, event: Event | Nex
return yield* onDelta(state, event.index, event.delta) return yield* onDelta(state, event.index, event.delta)
case "step.stop": case "step.stop":
return yield* onStop(state, event.index) return yield* onStop(state, event.index)
case "interaction.status_update":
return [{ ...state, usage: event.usage ?? state.usage }, []] satisfies StepResult
case "interaction.created": case "interaction.created":
case "interaction.status_update":
case "unknown": case "unknown":
return [state, []] satisfies StepResult return [state, []] satisfies StepResult
case "error": { case "error": {
@ -651,8 +551,6 @@ const step = Effect.fnUntraced(function* (state: ParserState, event: Event | Nex
} }
case "interaction.completed": { case "interaction.completed": {
const interaction = event.interaction const interaction = event.interaction
if (interaction.status === CONTINUATION)
return [{ ...state, usage: interaction.usage ?? state.usage }, []] satisfies StepResult
if (interaction.status === "failed" || interaction.status === "cancelled") { if (interaction.status === "failed" || interaction.status === "cancelled") {
const messages = (interaction.errors ?? []).flatMap((error) => (error.message?.trim() ? [error.message] : [])) const messages = (interaction.errors ?? []).flatMap((error) => (error.message?.trim() ? [error.message] : []))
const coded = interaction.errors?.find((error) => error.code) const coded = interaction.errors?.find((error) => error.code)
@ -675,17 +573,18 @@ const step = Effect.fnUntraced(function* (state: ParserState, event: Event | Nex
) )
const pending = yield* ToolStream.finishAll(ADAPTER, state.tools) const pending = yield* ToolStream.finishAll(ADAPTER, state.tools)
const events = [...pending.events] const events = [...pending.events]
const hasToolCalls = Object.values(state.steps).some((item) => item?.type === "function_call")
const lifecycle = Lifecycle.finish(state.lifecycle, events, { const lifecycle = Lifecycle.finish(state.lifecycle, events, {
reason: { reason: {
normalized: normalized:
interaction.status === "requires_action" || (interaction.status === "completed" && state.hasToolCalls) interaction.status === "requires_action" || (interaction.status === "completed" && hasToolCalls)
? "tool-calls" ? "tool-calls"
: interaction.status === "incomplete" : interaction.status === "incomplete"
? "length" ? "length"
: "stop", : "stop",
raw: interaction.status, raw: interaction.status,
}, },
usage: mapUsage(interaction.usage ?? state.usage, state.metadataKey, state.continuedUsage), usage: mapUsage(interaction.usage, state.metadataKey),
providerMetadata: { [state.metadataKey]: { interactionId: interaction.id } }, providerMetadata: { [state.metadataKey]: { interactionId: interaction.id } },
}) })
return [{ ...state, lifecycle, tools: pending.tools }, events] satisfies StepResult return [{ ...state, lifecycle, tools: pending.tools }, events] satisfies StepResult
@ -693,177 +592,6 @@ const step = Effect.fnUntraced(function* (state: ParserState, event: Event | Nex
} }
}) })
// =============================================================================
// Transport
// =============================================================================
type Body = typeof Body.Type
export interface Prepared {
readonly http: HttpTransport.HttpPrepared<string>
readonly input: TransportPrepareInput<Body>
}
interface Resume {
readonly token: string
readonly owner?: string
readonly reconnectsWithoutProgress: number
readonly lastError?: AIError
}
const sse = HttpTransport.sseJson.with<Body>()
const WireEvent = Protocol.jsonEvent(Event)
const decodeEvent = Schema.decodeUnknownEffect(WireEvent)
export const transport: Transport<Body, Prepared, Event | NextRequest> = {
id: sse.id,
prepare: (input) => sse.prepare(input).pipe(Effect.map((http) => ({ http, input }))),
execute: (prepared, request, runtime) =>
Effect.gen(function* () {
const label = `${request.model.provider}/${request.model.route.id}`
const raw = new WeakMap<object, string>()
const respond = (
execution: TransportExecution<string>,
resume?: Resume,
): Stream.Stream<Event | NextRequest, AIError> =>
Stream.suspend(() => {
let token = resume?.token
let owner: string | undefined
let status: string | undefined
let contentSinceToken = false
let terminal = false
let dropped: AIError | undefined
const pendingTools = new Set<number>()
return execution.frames.pipe(
Stream.mapEffect((frame) =>
decodeEvent(frame).pipe(
Effect.mapError((cause) =>
ProviderShared.eventError(ADAPTER, `Invalid ${label} stream event`, frame, cause),
),
Effect.map((event) => {
raw.set(event, frame)
switch (event.event_type) {
case "interaction.created":
owner = event.interaction.id
break
case "interaction.status_update":
status = event.status
owner = event.interaction_id ?? owner
if (event.continuation_token && event.continuation_token !== token) {
token = event.continuation_token
contentSinceToken = false
}
break
case "interaction.completed":
terminal = true
status = event.interaction.status
owner = event.interaction.id ?? owner
if (event.interaction.continuation_token) {
token = event.interaction.continuation_token
contentSinceToken = false
}
break
case "step.start":
if (event.step.type === "function_call") pendingTools.add(event.index)
if (
pendingTools.has(event.index) ||
event.step.content?.length ||
event.step.summary?.length ||
event.step.signature
)
contentSinceToken = true
break
case "step.delta":
contentSinceToken = true
break
case "step.stop":
if (pendingTools.delete(event.index)) contentSinceToken = true
break
}
return event
}),
),
),
Stream.takeUntil((event) => event.event_type === "interaction.completed"),
Stream.catchIf(
(error) => error.reason._tag === "Transport" && error.reason.code !== "Timeout",
(error) => {
dropped = error
return Stream.empty
},
),
Stream.concat(
Stream.suspend(() => {
const needsContinuation = status === CONTINUATION
const resumable = needsContinuation || (!terminal && (status === undefined || status === "in_progress"))
const newToken = token !== resume?.token
// An interrupted tool call may carry arguments across the checkpoint. Don't finalize it on EOF.
if (
token &&
resumable &&
!contentSinceToken &&
(terminal || pendingTools.size === 0) &&
(!needsContinuation || newToken)
) {
const reconnectsWithoutProgress = newToken ? 0 : (resume?.reconnectsWithoutProgress ?? 0) + 1
const lastError = dropped ?? (newToken ? undefined : resume?.lastError)
if (reconnectsWithoutProgress > MAX_STREAM_RECONNECTS_WITHOUT_PROGRESS) {
if (!lastError) return Stream.empty
return Stream.fail(
new AIError({
reason: new InvalidProviderOutputError({
route: label,
message: lastError.reason.message,
classification: "incomplete-stream",
cause: lastError,
http: lastError.reason.http,
}),
}),
)
}
return Stream.concat(
Stream.succeed(new NextRequest()),
next({ token, owner: newToken ? owner : resume?.owner, reconnectsWithoutProgress, lastError }),
)
}
if (dropped) return Stream.fail(dropped)
if (terminal && needsContinuation && !token)
return Stream.fail(ProviderShared.eventError(label, "Google Interactions continued without a token"))
// No safe checkpoint. Leave EOF for the route's incomplete-stream check.
return Stream.empty
}),
),
)
})
const next = (resume: Resume) => {
const body = prepared.input.body
return Stream.unwrap(
sse
.prepare({
...prepared.input,
body: {
...body,
continuation_token: resume.token,
...(body.store && resume.owner ? { input: undefined, previous_interaction_id: resume.owner } : {}),
},
})
.pipe(
Effect.flatMap((continued) => sse.execute(continued, request, runtime)),
Effect.map((execution) => respond(execution, resume)),
),
)
}
const first = yield* sse.execute(prepared.http, request, runtime)
return {
frames: respond(first),
http: first.http,
body: (frame) => raw.get(frame),
raw: (frame) => {
const body = raw.get(frame)
return body === undefined ? undefined : ProviderShared.decodeJson(body)
},
}
}),
}
// ============================================================================= // =============================================================================
// Protocol And Route // Protocol And Route
// ============================================================================= // =============================================================================
@ -872,22 +600,16 @@ export const protocol = Protocol.make({
sanitizer: "gemini", sanitizer: "gemini",
body: { schema: Body, from: fromRequest }, body: { schema: Body, from: fromRequest },
stream: { stream: {
event: Schema.Union([Schema.instanceOf(NextRequest), Schema.toType(Event), WireEvent]), event: Protocol.jsonEvent(Event),
initial: (request): ParserState => ({ initial: (request): ParserState => ({
route: `${request.model.provider}/${request.model.route.id}`, route: `${request.model.provider}/${request.model.route.id}`,
metadataKey: request.model.route.providerMetadataKey ?? request.model.provider, metadataKey: request.model.route.providerMetadataKey ?? request.model.provider,
lifecycle: Lifecycle.initial(), lifecycle: Lifecycle.initial(),
hop: 0,
hasToolCalls: false,
continuedUsage: [],
steps: {}, steps: {},
tools: ToolStream.empty<number>(), tools: ToolStream.empty<number>(),
}), }),
step, step,
terminal: (event) => terminal: (event) => event.event_type === "interaction.completed",
!(event instanceof NextRequest) &&
event.event_type === "interaction.completed" &&
event.interaction.status !== CONTINUATION,
}, },
}) })
@ -898,7 +620,7 @@ export const route = Route.make({
protocol, protocol,
endpoint: Endpoint.path("/interactions", { baseURL: DEFAULT_BASE_URL }), endpoint: Endpoint.path("/interactions", { baseURL: DEFAULT_BASE_URL }),
auth: Auth.none, auth: Auth.none,
transport, framing: Framing.sse,
}) })
export * as GoogleInteractions from "./google-interactions.js" export * as GoogleInteractions from "./google-interactions.js"

View file

@ -26,8 +26,8 @@ const Body = Schema.Struct({
}) })
const fromRequest = Effect.fn("MetaMessages.fromRequest")(function* (request: LLMRequest) { const fromRequest = Effect.fn("MetaMessages.fromRequest")(function* (request: LLMRequest) {
const body = yield* AnthropicMessages.protocol.body.from(request) const projected = ProviderShared.flattenToolRequest(request)
const definitions = ProviderShared.flattenTools(request.tools) const body = yield* AnthropicMessages.protocol.body.from(projected.request)
return { return {
...body, ...body,
messages: body.messages.map((message) => { messages: body.messages.map((message) => {
@ -45,7 +45,7 @@ const fromRequest = Effect.fn("MetaMessages.fromRequest")(function* (request: LL
? undefined ? undefined
: yield* Effect.forEach(body.tools, (tool, index) => : yield* Effect.forEach(body.tools, (tool, index) =>
Effect.gen(function* () { Effect.gen(function* () {
const native = definitions[index]?.native const native = projected.tools[index]?.native
if (native === undefined) return tool if (native === undefined) return tool
const search = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(MetaResponses.WebSearch))( const search = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(MetaResponses.WebSearch))(
native.meta, native.meta,
@ -62,8 +62,6 @@ export const protocol = Protocol.make({
id: "meta-messages", id: "meta-messages",
body: { schema: Body, from: fromRequest }, body: { schema: Body, from: fromRequest },
stream: AnthropicMessages.protocol.stream, stream: AnthropicMessages.protocol.stream,
supportsEffortUpdates: AnthropicMessages.protocol.supportsEffortUpdates,
toolUpdates: AnthropicMessages.protocol.toolUpdates,
}) })
export * as MetaMessages from "./meta-messages.js" export * as MetaMessages from "./meta-messages.js"

View file

@ -242,7 +242,6 @@ export const protocol = Protocol.make({
step, step,
terminal: OpenResponses.terminal, terminal: OpenResponses.terminal,
}, },
supportsEffortUpdates: OpenResponses.protocol.supportsEffortUpdates,
}) })
export const httpTransport = OpenResponses.httpTransport export const httpTransport = OpenResponses.httpTransport

View file

@ -183,13 +183,6 @@ const fromRequest = Effect.fn("MiniMaxVideo.fromRequest")(function* (request: Re
...(request.end === undefined ? [] : [yield* item(request.end, "last_frame")]), ...(request.end === undefined ? [] : [yield* item(request.end, "last_frame")]),
...(yield* Effect.forEach(request.references ?? [], reference)), ...(yield* Effect.forEach(request.references ?? [], reference)),
] ]
// H3 rejects a t2va (text-only) request without a concrete `ratio`, so `auto` and unset default to `16:9`.
const ratio =
content.length === 1 && (request.aspect === undefined || request.aspect === "auto")
? "16:9"
: request.aspect === "auto"
? "adaptive"
: request.aspect
return MediaProtocol.json( return MediaProtocol.json(
mergeJsonRecords( mergeJsonRecords(
{ {
@ -197,7 +190,7 @@ const fromRequest = Effect.fn("MiniMaxVideo.fromRequest")(function* (request: Re
content, content,
resolution: resolution(request), resolution: resolution(request),
duration: request.duration === undefined ? undefined : seconds(request.duration), duration: request.duration === undefined ? undefined : seconds(request.duration),
ratio, ratio: request.aspect === "auto" ? "adaptive" : request.aspect,
}, },
request.providerOptions, request.providerOptions,
request.http?.body, request.http?.body,

View file

@ -369,7 +369,6 @@ const lowerTool = (tool: ToolDefinition): MistralTool => ({
function: { name: tool.name, description: tool.description, parameters: tool.inputSchema, strict: false }, function: { name: tool.name, description: tool.description, parameters: tool.inputSchema, strict: false },
}) })
/** Expects tool namespaces already flattened, as `protocol.body.from` passes it; otherwise run `ProviderShared.flattenRequest` first. */
export const fromRequest = Effect.fn("MistralChat.fromRequest")(function* (request: LLMRequest) { export const fromRequest = Effect.fn("MistralChat.fromRequest")(function* (request: LLMRequest) {
const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(MistralOptions))( const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(MistralOptions))(
request.providerOptions ?? {}, request.providerOptions ?? {},
@ -386,10 +385,11 @@ export const fromRequest = Effect.fn("MistralChat.fromRequest")(function* (reque
tool: (name) => ({ type: "function" as const, function: { name } }), tool: (name) => ({ type: "function" as const, function: { name } }),
}) })
: undefined : undefined
const flattened = ProviderShared.flattenToolRequest(request)
return { return {
model: request.model.id, model: request.model.id,
messages: yield* lowerMessages(request), messages: yield* lowerMessages(flattened.request),
tools: request.tools.length > 0 ? ProviderShared.flattenTools(request.tools).map(lowerTool) : undefined, tools: flattened.tools.length > 0 ? flattened.tools.map(lowerTool) : undefined,
tool_choice: toolChoice, tool_choice: toolChoice,
stream: true as const, stream: true as const,
max_tokens: request.maxTokens, max_tokens: request.maxTokens,

View file

@ -87,8 +87,6 @@ const comparable = (value: unknown) => {
name: value.name, name: value.name,
arguments: json(value.arguments), arguments: json(value.arguments),
} }
if (value.type === "custom_tool_call")
return { type: value.type, call_id: value.call_id, name: value.name, input: value.input }
if (value.type === "reasoning") if (value.type === "reasoning")
return { return {
type: value.type, type: value.type,

View file

@ -30,7 +30,7 @@ import {
withUntypedFrames, withUntypedFrames,
} from "./shared.js" } from "./shared.js"
import { classifyProviderFailure } from "../provider-error.js" import { classifyProviderFailure } from "../provider-error.js"
import { effortUpdate, resolveEffortUpdates } from "../effort-updates.js" import { effortUpdate } from "../effort-updates.js"
import { toolsUpdate } from "../tool-updates.js" import { toolsUpdate } from "../tool-updates.js"
import { OpenResponsesOptions } from "./utils/open-responses-options.js" import { OpenResponsesOptions } from "./utils/open-responses-options.js"
import { Lifecycle } from "./utils/lifecycle.js" import { Lifecycle } from "./utils/lifecycle.js"
@ -496,11 +496,11 @@ export const lowerTool = Effect.fnUntraced(function* (protocolName: string, tool
}) })
export const lowerCustomTool = (tool: ToolDefinition, custom: OpenAIFreeform.Custom) => { export const lowerCustomTool = (tool: ToolDefinition, custom: OpenAIFreeform.Custom) => {
const grammar = OpenAIFreeform.grammar(custom) const grammar = OpenAIFreeform.grammar(custom.format)
return { return {
type: "custom" as const, type: "custom" as const,
name: tool.name, name: tool.name,
description: OpenAIFreeform.description(tool, custom), description: tool.description,
format: grammar ? { type: "grammar" as const, ...grammar } : { type: "text" as const }, format: grammar ? { type: "grammar" as const, ...grammar } : { type: "text" as const },
} }
} }
@ -560,7 +560,7 @@ const lowerToolCall = (
...(id === undefined ? {} : { id }), ...(id === undefined ? {} : { id }),
call_id: part.id, call_id: part.id,
name: part.name, name: part.name,
input: OpenAIFreeform.toRaw(custom, part.input, part.providerMetadata?.[providerMetadataKey]?.header), input: OpenAIFreeform.toRaw(custom, part.input),
} }
return { return {
type: "function_call", type: "function_call",
@ -653,17 +653,10 @@ const lowerToolResultOutput = Effect.fnUntraced(function* (
const DEFAULT_EFFORT = "medium" const DEFAULT_EFFORT = "medium"
// A call's output only follows the whole assistant turn, and Meta's Muse models, directly or through a gateway, const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, adapter: ProviderAdapter) {
// reject a commentary message replayed while a call is waiting for it. Text after a call keeps its place without
// the phase there; other providers accept it and keep the phase.
const rejectsPendingCommentary = (request: LLMRequest) =>
request.model.provider === "meta" || /(?:^|\/)muse-/i.test(request.model.id)
export const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, adapter: ProviderAdapter) {
const input: OpenResponsesInputItem[] = [] const input: OpenResponsesInputItem[] = []
const providerMetadataKey = metadataKey(request.model) const providerMetadataKey = metadataKey(request.model)
const custom = OpenAIFreeform.tools(request) const custom = OpenAIFreeform.tools(request)
const pendingCommentaryRejected = rejectsPendingCommentary(request)
const customTool = (part: ToolCallPart | ToolResultPart) => const customTool = (part: ToolCallPart | ToolResultPart) =>
part.namespace === undefined ? custom.get(part.name) : undefined part.namespace === undefined ? custom.get(part.name) : undefined
@ -708,7 +701,6 @@ export const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, a
const content: TextPart[] = [] const content: TextPart[] = []
const reasoningItems: Record<string, OpenResponsesReasoningInput> = {} const reasoningItems: Record<string, OpenResponsesReasoningInput> = {}
const hostedToolItems = new Set<string>() const hostedToolItems = new Set<string>()
let calledTool = false
const flushText = () => { const flushText = () => {
if (content.length === 0) return if (content.length === 0) return
const groups = content.reduce< const groups = content.reduce<
@ -717,8 +709,7 @@ export const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, a
const partMetadata = part.providerMetadata?.[providerMetadataKey] const partMetadata = part.providerMetadata?.[providerMetadataKey]
const id = itemID(part.providerMetadata, providerMetadataKey) ?? metadata?.itemId const id = itemID(part.providerMetadata, providerMetadataKey) ?? metadata?.itemId
const partPhase = messagePhase(partMetadata?.phase) const partPhase = messagePhase(partMetadata?.phase)
const declared = partPhase === undefined ? metadata?.phase : partPhase const phase = partPhase === undefined ? metadata?.phase : partPhase
const phase = calledTool && declared === "commentary" && pendingCommentaryRejected ? undefined : declared
const group = groups.at(-1) const group = groups.at(-1)
if (group && group.id === id && group.phase === phase) group.parts.push(part) if (group && group.id === id && group.phase === phase) group.parts.push(part)
else groups.push({ id, phase, parts: [part] }) else groups.push({ id, phase, parts: [part] })
@ -770,7 +761,6 @@ export const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, a
flushText() flushText()
if (part.providerExecuted === true) continue if (part.providerExecuted === true) continue
input.push(lowerToolCall(part, providerMetadataKey, customTool(part))) input.push(lowerToolCall(part, providerMetadataKey, customTool(part)))
calledTool = true
continue continue
} }
if (part.type === "tool-result" && part.providerExecuted === true) { if (part.type === "tool-result" && part.providerExecuted === true) {
@ -834,15 +824,12 @@ export const lowerMessages = Effect.fnUntraced(function* (request: LLMRequest, a
return input return input
}) })
// The system prompt leads `input` as a developer message: GPT-6.2 models never cache top-level `instructions`.
export const lowerConversation = Effect.fnUntraced(function* (request: LLMRequest, adapter: ProviderAdapter) { export const lowerConversation = Effect.fnUntraced(function* (request: LLMRequest, adapter: ProviderAdapter) {
const system = ProviderShared.joinText(request.system) const instructions = ProviderShared.joinText(request.system)
return { return {
model: request.model.id, model: request.model.id,
input: [ input: yield* lowerMessages(request, adapter),
...(system ? [{ type: "message" as const, role: "developer" as const, content: system }] : []), ...(instructions ? { instructions } : {}),
...(yield* lowerMessages(request, adapter)),
],
} }
}) })
@ -896,26 +883,23 @@ export const allowedToolChoice = (
} }
} }
/** Expects tool namespaces already flattened, as `protocol.body.from` passes it; otherwise run `ProviderShared.flattenRequest` first. */
export const fromRequestWithAdapter = Effect.fn("OpenResponses.fromRequestWithAdapter")(function* ( export const fromRequestWithAdapter = Effect.fn("OpenResponses.fromRequestWithAdapter")(function* (
request: LLMRequest, request: LLMRequest,
adapter: ProviderAdapter, adapter: ProviderAdapter,
) { ) {
const definitions = ProviderShared.flattenTools(request.tools) const projected = ProviderShared.flattenToolRequest(request)
const options = OpenResponsesOptions.resolve(request) const options = OpenResponsesOptions.resolve(request)
const custom = OpenAIFreeform.tools(request) const custom = OpenAIFreeform.tools(request)
const updates = resolveEffortUpdates(request, options.reasoningEffort)
return { return {
...(yield* lowerConversation(updates.request, adapter)), ...(yield* lowerConversation(projected.request, adapter)),
...lowerGeneration(request, { ...options, reasoningEffort: updates.effort }), ...lowerGeneration(request, options),
tools: definitions.length === 0 ? undefined : yield* lowerTools(definitions, adapter, custom), tools: projected.tools.length === 0 ? undefined : yield* lowerTools(projected.tools, adapter, custom),
tool_choice: tool_choice:
allowedToolChoice(options, custom) ?? allowedToolChoice(options, custom) ??
(request.toolChoice ? yield* lowerToolChoice(adapter.name, request.toolChoice, custom) : undefined), (request.toolChoice ? yield* lowerToolChoice(adapter.name, request.toolChoice, custom) : undefined),
} }
}) })
/** Expects tool namespaces already flattened, as `protocol.body.from` passes it; otherwise run `ProviderShared.flattenRequest` first. */
export const fromRequest = (request: LLMRequest) => fromRequestWithAdapter(request, BASE_ADAPTER) export const fromRequest = (request: LLMRequest) => fromRequestWithAdapter(request, BASE_ADAPTER)
// ============================================================================= // =============================================================================
@ -1348,25 +1332,19 @@ const onOutputItemDone = Effect.fnUntraced(function* (state: ParserState, item:
if (!item.call_id || !item.name) return [state, NO_EVENTS] satisfies StepResult if (!item.call_id || !item.name) return [state, NO_EVENTS] satisfies StepResult
const custom = item.type === "custom_tool_call" const custom = item.type === "custom_tool_call"
const metadata = providerMetadata(state, OpenAIFreeform.metadata(item.id, custom)) const metadata = providerMetadata(state, OpenAIFreeform.metadata(item.id, custom))
const final = { custom: state.custom.get(item.name), raw: rawInput(item) }
const input = custom ? OpenAIFreeform.fromRaw(final.custom, final.raw) : item.arguments
const registered = state.tools[item.id] !== undefined const registered = state.tools[item.id] !== undefined
const started = registered const closed = custom ? OpenAIFreeform.close(state.tools, [item.id], final) : undefined
? state.tools const tools = registered
? (closed?.tools ?? state.tools)
: ToolStream.start(state.tools, item.id, { : ToolStream.start(state.tools, item.id, {
id: item.call_id, id: item.call_id,
name: item.name, name: item.name,
namespace: item.namespace, namespace: item.namespace,
providerMetadata: metadata, providerMetadata: metadata,
}) })
// A custom call's final raw text sets its input, so it finishes without an override. const result = yield* ToolStream.finish(state.id, tools, item.id, input)
const closed = custom
? OpenAIFreeform.close(started, [item.id], state.custom, state.providerMetadataKey, rawInput(item))
: undefined
const result = yield* ToolStream.finish(
state.id,
closed?.tools ?? started,
item.id,
custom ? undefined : item.arguments,
)
const events: LLMEvent[] = [] const events: LLMEvent[] = []
const finished = [...(closed?.events ?? []), ...(result.events ?? [])] const finished = [...(closed?.events ?? []), ...(result.events ?? [])]
// A done-only call never streamed a start event, so open its lifecycle here. // A done-only call never streamed a start event, so open its lifecycle here.
@ -1458,16 +1436,7 @@ const onResponseFinish = Effect.fnUntraced(function* (state: ParserState, event:
events.push(...emitted) events.push(...emitted)
} }
// Some compatible providers omit output_item.done even after completing the response. // Some compatible providers omit output_item.done even after completing the response.
const open = OpenAIFreeform.close( const pending = yield* ToolStream.finishAll(current.id, current.tools)
current.tools,
Object.keys(current.tools).filter(
(key) => current.tools[key]?.providerMetadata?.[current.providerMetadataKey]?.custom === true,
),
current.custom,
current.providerMetadataKey,
)
events.push(...open.events)
const pending = yield* ToolStream.finishAll(current.id, open.tools)
current = { current = {
...current, ...current,
tools: pending.tools, tools: pending.tools,
@ -1640,8 +1609,6 @@ export const protocol = Protocol.make({
step: (state: ParserState, event: Event) => step(state, normalize(state, event)), step: (state: ParserState, event: Event) => step(state, normalize(state, event)),
terminal, terminal,
}, },
// Not every Open Responses server accepts `configuration_update`, so only models that opt in get it.
supportsEffortUpdates: (request) => request.model.capabilities?.reasoning?.updates === true,
}) })
export const httpTransport = HttpTransport.sseJson.with<OpenResponsesBody>() export const httpTransport = HttpTransport.sseJson.with<OpenResponsesBody>()

View file

@ -406,12 +406,12 @@ const lowerTool = (
custom: OpenAIFreeform.Custom | undefined, custom: OpenAIFreeform.Custom | undefined,
): OpenAIChatTool => { ): OpenAIChatTool => {
if (custom) { if (custom) {
const grammar = OpenAIFreeform.grammar(custom) const grammar = OpenAIFreeform.grammar(custom.format)
return { return {
type: "custom", type: "custom",
custom: { custom: {
name: tool.name, name: tool.name,
description: OpenAIFreeform.description(tool, custom), description: tool.description,
format: grammar ? { type: "grammar", grammar } : { type: "text" }, format: grammar ? { type: "grammar", grammar } : { type: "text" },
}, },
cache_control: options.cacheControl?.(tool.cache), cache_control: options.cacheControl?.(tool.cache),
@ -450,10 +450,7 @@ const lowerToolCall = (part: ToolCallPart, options: MessageLoweringOptions): Ope
return { return {
id: options.toolCallID?.(part.id) ?? part.id, id: options.toolCallID?.(part.id) ?? part.id,
type: "custom", type: "custom",
custom: { custom: { name: part.name, input: OpenAIFreeform.toRaw(custom, part.input) },
name: part.name,
input: OpenAIFreeform.toRaw(custom, part.input, part.providerMetadata?.[options.providerMetadataKey]?.header),
},
} }
return { return {
id: options.toolCallID?.(part.id) ?? part.id, id: options.toolCallID?.(part.id) ?? part.id,
@ -869,7 +866,6 @@ const lowerOptions = (request: LLMRequest, supportsStore: boolean, hasActiveTool
} }
} }
/** Expects tool namespaces already flattened, as `protocol.body.from` passes it; otherwise run `ProviderShared.flattenRequest` first. */
export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* ( export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* (
request: LLMRequest, request: LLMRequest,
options: LoweringOptions = {}, options: LoweringOptions = {},
@ -881,7 +877,7 @@ export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* (
return yield* ProviderShared.invalidRequest( return yield* ProviderShared.invalidRequest(
`OpenAI Chat reasoning field conflicts with reserved field ${reasoningField}`, `OpenAI Chat reasoning field conflicts with reserved field ${reasoningField}`,
) )
const definitions = ProviderShared.flattenTools(request.tools) const flattened = ProviderShared.flattenToolRequest(request)
const provider = request.model.provider const provider = request.model.provider
const baseURL = request.model.route.endpoint.baseURL const baseURL = request.model.route.endpoint.baseURL
const detectedMaxTokensField = detectMaxTokensField(provider, baseURL) const detectedMaxTokensField = detectMaxTokensField(provider, baseURL)
@ -891,18 +887,18 @@ export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* (
const zaiToolStream = const zaiToolStream =
request.model.compatibility?.zaiToolStream ?? detectZaiToolStream(provider, baseURL, request.model.id) request.model.compatibility?.zaiToolStream ?? detectZaiToolStream(provider, baseURL, request.model.id)
const hasHistory = hasToolHistory(request.messages) const hasHistory = hasToolHistory(request.messages)
const hasActiveTools = definitions.length > 0 const hasActiveTools = flattened.tools.length > 0
const custom = OpenAIFreeform.tools(request) const custom = OpenAIFreeform.tools(request)
const lowering = { ...options, cacheControl: options.cacheControl ?? declaredCacheControl(request), custom } const lowering = { ...options, cacheControl: options.cacheControl ?? declaredCacheControl(request), custom }
return { return {
model: request.model.id, model: request.model.id,
messages: yield* lowerMessages(request, lowering), messages: yield* lowerMessages(flattened.request, lowering),
tools: tools:
definitions.length === 0 flattened.tools.length === 0
? hasHistory ? hasHistory
? [] ? []
: undefined : undefined
: definitions.map((tool) => lowerTool(tool, lowering, supportsStrictMode, custom.get(tool.name))), : flattened.tools.map((tool) => lowerTool(tool, lowering, supportsStrictMode, custom.get(tool.name))),
tool_choice: hasActiveTools && request.toolChoice ? yield* lowerToolChoice(request.toolChoice, custom) : undefined, tool_choice: hasActiveTools && request.toolChoice ? yield* lowerToolChoice(request.toolChoice, custom) : undefined,
stream: true as const, stream: true as const,
...((request.model.capabilities?.streamUsage ?? true) ? { stream_options: { include_usage: true } } : {}), ...((request.model.capabilities?.streamUsage ?? true) ? { stream_options: { include_usage: true } } : {}),
@ -950,12 +946,8 @@ const mapFinishReason = Effect.fnUntraced(function* (event: OpenAIChatEvent, rea
case "end": case "end":
return "stop" as const return "stop" as const
case "length": case "length":
// Z.AI stops with this when the prompt plus the generated output fill the context window.
case "model_context_window_exceeded":
return "length" as const return "length" as const
case "content_filter": case "content_filter":
// Z.AI ends a response its safety review blocked with "sensitive".
case "sensitive":
return "content-filter" as const return "content-filter" as const
case "function_call": case "function_call":
case "tool_calls": case "tool_calls":
@ -1295,7 +1287,7 @@ const step = (state: ParserState, event: OpenAIChatEvent) =>
!incompleteTools && !incompleteTools &&
state.finishReason === undefined && state.finishReason === undefined &&
Object.keys(tools).length > 0 Object.keys(tools).length > 0
? yield* finishTools(state, tools, customCalls) ? yield* finishTools(tools, customCalls)
: undefined : undefined
return [ return [
@ -1324,12 +1316,8 @@ const step = (state: ParserState, event: OpenAIChatEvent) =>
}) })
// Custom calls close their JSON fragment before every pending call finishes. // Custom calls close their JSON fragment before every pending call finishes.
const finishTools = Effect.fnUntraced(function* ( const finishTools = Effect.fnUntraced(function* (tools: ParserState["tools"], customCalls: ReadonlySet<number>) {
state: ParserState, const closed = OpenAIFreeform.close(tools, customCalls)
tools: ParserState["tools"],
customCalls: ReadonlySet<number>,
) {
const closed = OpenAIFreeform.close(tools, customCalls, state.custom, state.providerMetadataKey)
const finished = yield* ToolStream.finishAll(ADAPTER, closed.tools) const finished = yield* ToolStream.finishAll(ADAPTER, closed.tools)
return { tools: finished.tools, events: [...closed.events, ...finished.events] } return { tools: finished.tools, events: [...closed.events, ...finished.events] }
}) })
@ -1346,7 +1334,7 @@ export const finishEvents = Effect.fnUntraced(function* (state: ParserState) {
const events: LLMEvent[] = [] const events: LLMEvent[] = []
const toolCallEvents = const toolCallEvents =
state.finishReason === undefined && Object.keys(state.tools).length > 0 state.finishReason === undefined && Object.keys(state.tools).length > 0
? (yield* finishTools(state, state.tools, state.customCalls)).events ? (yield* finishTools(state.tools, state.customCalls)).events
: state.toolCallEvents : state.toolCallEvents
const hasToolCalls = toolCallEvents.length > 0 const hasToolCalls = toolCallEvents.length > 0
const reason = state.finishReason const reason = state.finishReason

View file

@ -1,6 +1,5 @@
import { Option, Schema } from "effect" import { Option, Schema } from "effect"
import { import {
JsonSchema,
ToolDefinition, ToolDefinition,
type Freeform, type Freeform,
type LLMEvent, type LLMEvent,
@ -16,198 +15,43 @@ import { toolsUpdate } from "../tool-updates.js"
// Calls keep the normal `{ field: raw }` input everywhere else; only the wire carries raw text. // Calls keep the normal `{ field: raw }` input everywhere else; only the wire carries raw text.
export interface Custom { export interface Custom {
/** The tool's required string parameter, which the raw text fills. */ /** The tool's one required string parameter, which the raw text fills. */
readonly field: string readonly field: string
readonly format: Freeform readonly format: Freeform
/** The tool's other parameters, set on a first line. */
readonly options?: {
readonly fields: ReadonlyArray<OptionField>
/** How to write the line, added to the custom tool's description. */
readonly description: string
/** The grammar for the line and the raw text, when the model takes Lark. */
readonly grammar?: string
}
} }
interface OptionField { /** How a tool goes out: a custom tool when it declares `freeform` with one required string parameter. */
readonly name: string export const resolve = (tool: ToolDefinition): Custom | undefined => {
readonly schema: JsonSchema const field = ToolDefinition.freeformField(tool.inputSchema)
readonly required: boolean
}
// The other parameters go on a first line as a JSON object, `// @options: {"timeout": 5000}`, then the field's text.
// It is a JavaScript comment, so the line reads naturally before code.
export const PREFIX = "// @options:"
/**
* How a tool goes out: a custom tool when it declares `freeform` in a format the model accepts (`formats`; none when
* unset), with its required string parameter. Other parameters need a grammar for their values, and a raw
* text body when the model can't take Lark; otherwise the tool stays a JSON tool.
*/
export const resolve = (tool: ToolDefinition, formats: ReadonlyArray<Freeform["type"]> = []): Custom | undefined => {
const field = ToolDefinition.freeformField(tool.inputSchema, tool.freeform)
if (tool.freeform === undefined || tool.native !== undefined || field === undefined) return undefined if (tool.freeform === undefined || tool.native !== undefined || field === undefined) return undefined
if (!formats.includes(tool.freeform.type)) return undefined return { field, format: tool.freeform }
const lark = formats.includes("lark")
const required = Array.isArray(tool.inputSchema.required) ? tool.inputSchema.required : []
const fields = Object.entries(Schema.is(JsonSchema)(tool.inputSchema.properties) ? tool.inputSchema.properties : {})
.filter(([name]) => name !== field)
.map(([name, schema]) => ({
name,
schema: Schema.is(JsonSchema)(schema) ? schema : {},
required: required.includes(name),
}))
if (fields.length === 0) return { field, format: tool.freeform }
const rules = fields.flatMap((item) => valueRule(item.schema) ?? [])
if (rules.length !== fields.length || (!lark && tool.freeform.type !== "text")) return undefined
return {
field,
format: tool.freeform,
options: {
fields,
description: describe(field, fields),
grammar: lark ? lineGrammar(fields, rules, tool.freeform) : undefined,
},
}
} }
// Keys in any order, with spaces after `{`, `:` and `,` and before `}`. The tool's own schema checks the values it
// gets, as it does for a JSON call. Without required parameters a call may leave the line out, so plain raw text
// can't start with the prefix. A tool's own grammar becomes the body, its `start` renamed to `fb_start`.
const lineGrammar = (fields: ReadonlyArray<OptionField>, rules: ReadonlyArray<string>, format: Freeform) => {
const body = format.type === "text" ? "ff_body" : "fb_start"
const plain = format.type === "text" ? "ff_plain" : body
return [
`start: ff_line ${body}${fields.some((item) => item.required) ? "" : ` | ${plain}`}`,
`ff_line: ${larkString(PREFIX)} " "* "{" " "* ff_pair (" "* "," " "* ff_pair)* " "* "}" "\\n"`,
`ff_pair: ${fields.map((item, index) => `${larkString(encodeJson(item.name))} " "* ":" " "* ${rules[index]}`).join(" | ")}`,
...(format.type === "text"
? ["ff_body: /[\\s\\S]+/", `ff_plain: /${notStartingWith(PREFIX)}/`]
: format.type === "regex"
? [`fb_start: /${format.pattern.replace(/\\?\//g, "\\/")}/`]
: [format.grammar.replace(/^([ \t]*)start([ \t]*:)/m, "$1fb_start$2")]),
].join("\n")
}
const valueRule = (schema: JsonSchema) => {
if (Array.isArray(schema.enum))
return schema.enum.length === 0
? undefined
: `(${schema.enum.map((item) => larkString(encodeJson(item))).join(" | ")})`
if (schema.type === "boolean") return '("true" | "false")'
if (schema.type === "number") return "/-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/"
if (schema.type === "string") return '/"(?:[^"\\\\\\x00-\\x1f]|\\\\["\\\\\\/bfnrt]|\\\\u[0-9a-fA-F]{4})*"/'
if (schema.type !== "integer") return undefined
const lowest = minimum(schema)
if (lowest >= 1) return "/[1-9][0-9]*/"
return lowest >= 0 ? "/0|[1-9][0-9]*/" : "/-?(?:0|[1-9][0-9]*)/"
}
const minimum = (schema: JsonSchema) =>
Math.max(
typeof schema.minimum === "number" ? schema.minimum : -Infinity,
typeof schema.exclusiveMinimum === "number" ? schema.exclusiveMinimum + 1 : -Infinity,
)
const describe = (field: string, fields: ReadonlyArray<OptionField>) => {
const required = fields.filter((item) => item.required)
const example = required.length > 0 ? required : [fields.find((item) => item.schema.type === "boolean") ?? fields[0]]
return [
required.length === 0
? `To set the parameters below, start with a \`${PREFIX}\` line holding a JSON object of them, then write \`${field}\` from the next line. Leave the line out to use the defaults.`
: `Start with a \`${PREFIX}\` line holding a JSON object of the parameters below, then write \`${field}\` from the next line.`,
...fields.map(
(item) =>
`- \`${item.name}\` (${Array.isArray(item.schema.enum) ? `one of ${item.schema.enum.map((value) => encodeJson(value)).join(", ")}` : String(item.schema.type)}${item.required ? ", required" : ""})${typeof item.schema.description === "string" ? `: ${item.schema.description}` : ""}`,
),
"For example:",
`${PREFIX} {${example.map((item) => `${encodeJson(item.name)}: ${encodeJson(sample(item.schema))}`).join(", ")}}`,
`<${field}>`,
].join("\n")
}
const sample = (schema: JsonSchema) => {
if (Array.isArray(schema.enum)) return schema.enum[0]
if (schema.type === "boolean") return true
if (schema.type === "string") return "..."
return Math.max(1, minimum(schema))
}
const larkString = (text: string) => JSON.stringify(text)
// A regex for text that does not start with `prefix`: it differs from the prefix at some character, or is a shorter
// prefix of it.
const notStartingWith = (prefix: string) => {
const chars = [...prefix]
const head = (end: number) => chars.slice(0, end).map(escapeRegex).join("")
const differs = chars.map((char, index) => `${head(index)}[^${escapeClass(char)}]`)
const shorter = chars.slice(1).map((_, index) => head(index + 1))
return [`(?:${differs.join("|")})[\\s\\S]*`, ...shorter].join("|")
}
const escapeRegex = (char: string) => char.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&")
const escapeClass = (char: string) => char.replace(/[\\\]^\-/]/g, "\\$&")
/** Custom tools in this request, including ones added mid-conversation, by flattened tool name. */ /** Custom tools in this request, including ones added mid-conversation, by flattened tool name. */
export const tools = (request: LLMRequest): ReadonlyMap<string, Custom> => { export const tools = (request: LLMRequest): ReadonlyMap<string, Custom> => {
const formats = request.model.capabilities?.tools?.freeform
const added = request.messages.flatMap((message) => toolsUpdate(message)?.add ?? []) const added = request.messages.flatMap((message) => toolsUpdate(message)?.add ?? [])
return new Map( return new Map(
flattenTools([...request.tools, ...added]).flatMap((tool) => { flattenTools([...request.tools, ...added]).flatMap((tool) => {
const custom = resolve(tool, formats) const custom = resolve(tool)
return custom ? [[tool.name, custom] as const] : [] return custom ? [[tool.name, custom] as const] : []
}), }),
) )
} }
/** The grammar to send, or `undefined` for unconstrained text. */ /** The format's grammar, or `undefined` for unconstrained text. */
export const grammar = (custom: Custom) => { export const grammar = (format: Freeform) =>
if (custom.options) format.type === "text"
return custom.options.grammar === undefined ? undefined
? undefined : { syntax: format.type, definition: format.type === "regex" ? format.pattern : format.grammar }
: { syntax: "lark" as const, definition: custom.options.grammar }
const format = custom.format
if (format.type === "text") return undefined
return { syntax: format.type, definition: format.type === "regex" ? format.pattern : format.grammar }
}
/** The custom tool's description, with how to write the line when the tool has other parameters. */ /** Raw text replayed for a past call: its field, or the whole input as JSON when the field is not a string. */
export const description = (tool: ToolDefinition, custom: Custom) => export const toRaw = (custom: Custom, input: unknown) => {
custom.options ? `${tool.description}\n\n${custom.options.description}` : tool.description
/**
* Raw text replayed for a past call: its field after a line for the other parameters, or the whole input as JSON when
* the field is not a string. The line the model wrote, saved as `header`, replays as is while it still says the same,
* so the prompt cache holds; otherwise, as for a call another model made, a fresh line is written.
*/
export const toRaw = (custom: Custom, input: unknown, header?: unknown) => {
const value = isRecord(input) ? input[custom.field] : undefined const value = isRecord(input) ? input[custom.field] : undefined
if (typeof value !== "string" || !isRecord(input)) return encodeJson(input ?? {}) return typeof value === "string" ? value : encodeJson(input ?? {})
const fields = custom.options?.fields ?? []
const options = encodeJson(pick(fields, input))
if (options === "{}") return value
const saved = typeof header === "string" ? Option.getOrUndefined(decodeLine(header)) : undefined
const same = saved !== undefined && encodeJson(pick(fields, saved)) === options
return `${same ? header : `${PREFIX} ${options}`}\n${value}`
} }
const pick = (fields: ReadonlyArray<OptionField>, input: Readonly<Record<string, unknown>>) => /** JSON arguments for a raw call. A call to an undeclared custom tool fills `input`. */
Object.fromEntries(fields.flatMap((item) => (input[item.name] === undefined ? [] : [[item.name, input[item.name]]]))) export const fromRaw = (custom: Custom | undefined, raw: string) => encodeJson({ [field(custom)]: raw })
/**
* JSON arguments for a raw call, with its line as `header`. A call to an undeclared custom tool fills `input`. A line
* that isn't a JSON object stays raw text, which fails as malformed JSON; the tool's schema checks the rest.
*/
export const parse = (custom: Custom | undefined, raw: string) => {
const end = raw.indexOf("\n")
if (!custom?.options || !raw.startsWith(PREFIX) || end === -1) return { input: encodeJson({ [field(custom)]: raw }) }
const header = raw.slice(0, end)
const options = Option.getOrUndefined(decodeLine(header))
if (options === undefined) return { input: raw }
return { input: encodeJson({ ...options, [custom.field]: raw.slice(end + 1) }), header }
}
const decodeLine = (header: string) => decodeArguments(header.slice(PREFIX.length))
const field = (custom: Custom | undefined) => custom?.field ?? "input" const field = (custom: Custom | undefined) => custom?.field ?? "input"
@ -221,59 +65,25 @@ const STREAM_END = '"}'
const decodeArguments = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown))) const decodeArguments = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown)))
/** /**
* Close the JSON fragment of each open custom call, and set its input from the raw text. With a `final` raw input * Close the JSON fragment of each open custom call. With a `final` raw input, a call only closes when its fragments
* that the streamed fragments don't decode to, the final one sets the input and the streamed one stays unclosed. A * decode to it, so an authoritative final input that disagrees replaces the streamed one instead.
* line the model wrote goes in the call's provider metadata as `header`, so it replays exactly.
*/ */
export const close = <K extends string | number>( export const close = <K extends string | number>(
tools: ToolStream.State<K>, tools: ToolStream.State<K>,
keys: Iterable<K>, keys: Iterable<K>,
custom: ReadonlyMap<string, Custom>, final?: { readonly custom: Custom | undefined; readonly raw: string },
metadataKey: string,
final?: string,
) => ) =>
[...keys].reduce<{ readonly tools: ToolStream.State<K>; readonly events: ReadonlyArray<LLMEvent> }>( [...keys].reduce<{ readonly tools: ToolStream.State<K>; readonly events: ReadonlyArray<LLMEvent> }>(
(result, key) => { (result, key) => {
const pending = result.tools[key] const pending = result.tools[key]
if (!pending) return result const streamed = pending && Option.getOrUndefined(decodeArguments(`${pending.input}${STREAM_END}`))
const definition = custom.get(pending.name) if (!pending || (final !== undefined && streamed?.[field(final.custom)] !== final.raw)) return result
const streamed = Option.getOrUndefined(decodeArguments(`${pending.input}${STREAM_END}`))?.[field(definition)]
if (final !== undefined && streamed !== final)
return {
tools: { ...result.tools, [key]: settle(pending, definition, metadataKey, final) },
events: result.events,
}
const appended = ToolStream.append(result.tools, key, STREAM_END) const appended = ToolStream.append(result.tools, key, STREAM_END)
if (!appended) return result return appended ? { tools: appended.tools, events: [...result.events, ...appended.events] } : result
return {
tools:
typeof streamed === "string"
? { ...appended.tools, [key]: settle(appended.tool, definition, metadataKey, streamed) }
: appended.tools,
events: [...result.events, ...appended.events],
}
}, },
{ tools, events: [] }, { tools, events: [] },
) )
const settle = (
tool: ToolStream.PendingTool,
custom: Custom | undefined,
metadataKey: string,
raw: string,
): ToolStream.PendingTool => {
const parsed = parse(custom, raw)
if (parsed.header === undefined) return { ...tool, input: parsed.input }
return {
...tool,
input: parsed.input,
providerMetadata: {
...tool.providerMetadata,
[metadataKey]: { ...tool.providerMetadata?.[metadataKey], header: parsed.header },
},
}
}
/** Provider metadata marking a call that arrived as a custom tool call. */ /** Provider metadata marking a call that arrived as a custom tool call. */
export const metadata = (itemId: string, custom: boolean) => (custom ? { itemId, custom: true } : { itemId }) export const metadata = (itemId: string, custom: boolean) => (custom ? { itemId, custom: true } : { itemId })

View file

@ -188,10 +188,7 @@ const toolUpdates = {
const isHostedTool = (tool: ToolEntry) => tool.type === "tool" && tool.native !== undefined const isHostedTool = (tool: ToolEntry) => tool.type === "tool" && tool.native !== undefined
// Automatic `context_management` compaction drops developer messages, removal notices included, while the tools stay const declaresInPlace = (request: LLMRequest) => toolUpdateKinds(request).includes("add")
// declared, so tool changes fold alongside it.
const declaresInPlace = (request: LLMRequest) =>
request.providerOptions?.contextManagement === undefined && toolUpdateKinds(request).includes("add")
const nativeImageToolInput = (tool: ToolDefinition) => { const nativeImageToolInput = (tool: ToolDefinition) => {
const native = tool.native?.openai const native = tool.native?.openai
@ -319,7 +316,7 @@ const fromRequest = Effect.fn("OpenAIResponses.fromRequest")(function* (request:
lowerToolChanges: toolChangeLowering(layout.head.length > 0, custom), lowerToolChanges: toolChangeLowering(layout.head.length > 0, custom),
}) })
return { return {
model: conversation.model, ...conversation,
input: [...layout.head, ...conversation.input], input: [...layout.head, ...conversation.input],
...generation, ...generation,
...Cache.openAIRequestTTL(requestTTL(request)), ...Cache.openAIRequestTTL(requestTTL(request)),
@ -409,7 +406,6 @@ export const protocol = Protocol.make({
}), }),
supportsEffortUpdates, supportsEffortUpdates,
toolUpdates, toolUpdates,
namespaces: true,
}) })
const endpoint = Endpoint.path<OpenAIResponsesBody>(PATH, { baseURL: DEFAULT_BASE_URL }) const endpoint = Endpoint.path<OpenAIResponsesBody>(PATH, { baseURL: DEFAULT_BASE_URL })

View file

@ -10,8 +10,6 @@ import {
AssistantMessage, AssistantMessage,
type LLMRequest, type LLMRequest,
Message, Message,
SystemMessage,
ToolChoice,
ToolDefinition, ToolDefinition,
ToolMessage, ToolMessage,
type ContentPart, type ContentPart,
@ -26,7 +24,6 @@ import {
} from "../schema/index.js" } from "../schema/index.js"
import { Json, decodeJson, encodeJson } from "../utils/json.js" import { Json, decodeJson, encodeJson } from "../utils/json.js"
import { isRecord } from "../utils/record.js" import { isRecord } from "../utils/record.js"
import { foldTools, toolsUpdate, withdrawnTools } from "../tool-updates.js"
export { Json, decodeJson, encodeJson, isRecord } export { Json, decodeJson, encodeJson, isRecord }
const isJson = Schema.is(Schema.Json) const isJson = Schema.is(Schema.Json)
@ -365,8 +362,7 @@ export const unsupportedOperation = (input: {
/** /**
* Lower namespaces to flat definitions for protocols without a native * Lower namespaces to flat definitions for protocols without a native
* namespace construct. Leaf names join their namespace path with `_` because * namespace construct. Leaf names join their namespace path with `_` because
* `.` is not broadly accepted in provider tool names. A no-op on tools `flattenRequest` already flattened; adapters call * `.` is not broadly accepted in provider tool names.
* it to type their tools.
*/ */
export const flattenTools = (tools: ReadonlyArray<ToolEntry>, path: ReadonlyArray<string> = []) => { export const flattenTools = (tools: ReadonlyArray<ToolEntry>, path: ReadonlyArray<string> = []) => {
const flat = tools.flatMap((tool): ReadonlyArray<ToolDefinition> => { const flat = tools.flatMap((tool): ReadonlyArray<ToolDefinition> => {
@ -377,84 +373,28 @@ export const flattenTools = (tools: ReadonlyArray<ToolEntry>, path: ReadonlyArra
return [...new Map(flat.map((tool) => [tool.name, tool])).values()] return [...new Map(flat.map((tool) => [tool.name, tool])).values()]
} }
/** export const flattenToolRequest = (request: LLMRequest) => {
* The request as a protocol without native namespaces sees it: tools, tool updates, past calls and a forced choice all
* use flattened names. `Protocol.make` applies it before `body.from` for such protocols, so adapters only see flat
* requests.
*/
export const flattenRequest = (request: LLMRequest): LLMRequest => {
const all = [...request.tools, ...request.messages.flatMap((message) => toolsUpdate(message)?.add ?? [])]
const declared = new Set(flattenTools(all).map((tool) => tool.name))
const flatten = <Part extends ToolCallPart | ToolResultPart>(part: Part) => flattenToolName(part, declared)
// A tool update that redefines a namespace drops the tools it leaves out, which only the namespace shows, so name
// them as explicit removals.
let tools = request.tools
const messages = request.messages.map((message) => { const messages = request.messages.map((message) => {
if (message.role === "system" && message.tools !== undefined) {
const next = foldTools(tools, message.tools.add, message.tools.remove)
const remove = withdrawnTools(tools, next)
tools = next
return new SystemMessage({ ...message, tools: { add: flattenTools(message.tools.add), remove } })
}
if (message.role === "assistant") { if (message.role === "assistant") {
const content = message.content.map((part) => const content = message.content.map((part) =>
part.type === "tool-call" || part.type === "tool-result" ? flatten(part) : part, part.type === "tool-call" || part.type === "tool-result" ? flattenToolName(part) : part,
) )
return sameParts(content, message.content) ? message : new AssistantMessage({ ...message, content }) return sameParts(content, message.content) ? message : new AssistantMessage({ ...message, content })
} }
if (message.role !== "tool") return message if (message.role !== "tool") return message
const content = message.content.map(flatten) const content = message.content.map(flattenToolName)
return sameParts(content, message.content) ? message : new ToolMessage({ ...message, content }) return sameParts(content, message.content) ? message : new ToolMessage({ ...message, content })
}) })
return { return {
...request,
tools: flattenTools(request.tools), tools: flattenTools(request.tools),
messages, request: messages.every((message, index) => message === request.messages[index])
toolChoice: flattenToolChoice(request.toolChoice, all, declared), ? request
: { ...request, messages },
} }
} }
/** const flattenToolName = <Part extends ToolCallPart | ToolResultPart>(part: Part): Part =>
* @deprecated Routes without native namespaces already receive flattened requests; use `flattenRequest`. Removed in part.namespace === undefined ? part : { ...part, name: `${part.namespace}_${part.name}`, namespace: undefined }
* the next minor.
*/
export const flattenToolRequest = (request: LLMRequest) => {
const flat = flattenRequest(request)
return { tools: flattenTools(flat.tools), request: flat }
}
// A forced choice names a namespaced tool by its path (`crm.lookup`); point it at the flattened definition.
const flattenToolChoice = (
choice: LLMRequest["toolChoice"],
tools: ReadonlyArray<ToolEntry>,
declared: ReadonlySet<string>,
) => {
if (choice?.type !== "tool" || choice.name === undefined || declared.has(choice.name)) return choice
const name = new Map(namespacedPaths(tools)).get(choice.name)
return name === undefined ? choice : new ToolChoice({ ...choice, name })
}
// Each namespaced tool's path and the name flattenTools gives it.
const namespacedPaths = (
tools: ReadonlyArray<ToolEntry>,
path: ReadonlyArray<string> = [],
): ReadonlyArray<readonly [string, string]> =>
tools.flatMap((tool) => {
if (tool.type === "namespace") return namespacedPaths(tool.tools, [...path, tool.name])
return path.length === 0 ? [] : [[[...path, tool.name].join("."), [...path, tool.name].join("_")] as const]
})
const flattenToolName = <Part extends ToolCallPart | ToolResultPart>(
part: Part,
declared: ReadonlySet<string>,
): Part => {
const flat = part.namespace === undefined ? part.name : `${part.namespace}_${part.name}`
// Models sometimes call names no tool declares, such as a Code Mode path like `a.b.c`. Several providers (OpenAI
// Chat Completions, Bedrock Converse) reject those characters when the call is replayed, so replace them. A
// declared name is kept as is, so a provider that accepts it sees calls under the tool's own name.
const name = declared.has(flat) ? flat : flat.replace(/[^a-zA-Z0-9_-]/g, "_") || "_"
return name === part.name && part.namespace === undefined ? part : { ...part, name, namespace: undefined }
}
const sameParts = (next: ReadonlyArray<ContentPart>, previous: ReadonlyArray<ContentPart>) => const sameParts = (next: ReadonlyArray<ContentPart>, previous: ReadonlyArray<ContentPart>) =>
next.every((part, index) => part === previous[index]) next.every((part, index) => part === previous[index])

View file

@ -65,7 +65,6 @@ export function gatewayProtocol<Body, Event, State>(
}, },
supportsEffortUpdates: protocol.supportsEffortUpdates, supportsEffortUpdates: protocol.supportsEffortUpdates,
toolUpdates: protocol.toolUpdates, toolUpdates: protocol.toolUpdates,
namespaces: protocol.namespaces,
sanitizer: protocol.sanitizer, sanitizer: protocol.sanitizer,
stream: { stream: {
event: protocol.stream.event, event: protocol.stream.event,

View file

@ -11,30 +11,11 @@ import {
type MediaUsage, type MediaUsage,
type ProviderMetadata, type ProviderMetadata,
} from "../../schema/index.js" } from "../../schema/index.js"
import { knownString, ProviderShared } from "../shared.js" import { ProviderShared } from "../shared.js"
import { MediaInput } from "./media-input.js" import { MediaInput } from "./media-input.js"
const PROVIDER = ProviderID.make("google") const PROVIDER = ProviderID.make("google")
export const SafetySetting = Schema.Struct({
category: knownString<
| "HARM_CATEGORY_UNSPECIFIED"
| "HARM_CATEGORY_HATE_SPEECH"
| "HARM_CATEGORY_DANGEROUS_CONTENT"
| "HARM_CATEGORY_HARASSMENT"
| "HARM_CATEGORY_SEXUALLY_EXPLICIT"
| "HARM_CATEGORY_CIVIC_INTEGRITY"
>(),
threshold: knownString<
| "HARM_BLOCK_THRESHOLD_UNSPECIFIED"
| "BLOCK_LOW_AND_ABOVE"
| "BLOCK_MEDIUM_AND_ABOVE"
| "BLOCK_ONLY_HIGH"
| "BLOCK_NONE"
| "OFF"
>(),
})
const UsageMetadata = Schema.Struct({ const UsageMetadata = Schema.Struct({
promptTokenCount: Schema.optional(Schema.Number), promptTokenCount: Schema.optional(Schema.Number),
candidatesTokenCount: Schema.optional(Schema.Number), candidatesTokenCount: Schema.optional(Schema.Number),

View file

@ -1,4 +1,4 @@
import { Effect, Schema } from "effect" import { Effect, Schema, Stream } from "effect"
import { import {
AIError, AIError,
InvalidProviderOutputError, InvalidProviderOutputError,
@ -76,8 +76,6 @@ const Response = Schema.Struct({
role: Schema.Literal("assistant"), role: Schema.Literal("assistant"),
content: Schema.Array(Text).check(Schema.isMinLength(1)), content: Schema.Array(Text).check(Schema.isMinLength(1)),
}), }),
// The system prompt sent as a developer message, echoed back; the next request leads with its own.
Schema.Struct({ ...MessageFields, role: Schema.Literal("developer"), content: Schema.Unknown }),
]), ]),
), ),
usage: Schema.optional(Schema.StructWithRest(OpenResponses.OpenResponsesUsage, [JsonObject])), usage: Schema.optional(Schema.StructWithRest(OpenResponses.OpenResponsesUsage, [JsonObject])),
@ -93,8 +91,6 @@ export const make = (
// top-level `tools`: after compacting a history whose tools were only in `additional_tools`, small models lost // top-level `tools`: after compacting a history whose tools were only in `additional_tools`, small models lost
// track of them more often. // track of them more often.
const folded = foldToolUpdates(stripEffortUpdates(request)) const folded = foldToolUpdates(stripEffortUpdates(request))
// The system prompt leads `input` as a developer message, as every step's request does, so `/compact` reads the
// prefix those requests cached.
const native = yield* OpenResponses.lowerConversation(folded, adapter) const native = yield* OpenResponses.lowerConversation(folded, adapter)
const generation = OpenResponses.lowerGeneration(request) const generation = OpenResponses.lowerGeneration(request)
const tools = folded.tools.length === 0 ? undefined : yield* lowerTools(folded) const tools = folded.tools.length === 0 ? undefined : yield* lowerTools(folded)
@ -125,10 +121,7 @@ export const make = (
auth: route.auth, auth: route.auth,
encodeBody: Schema.encodeSync(Schema.fromJsonString(Body)), encodeBody: Schema.encodeSync(Schema.fromJsonString(Body)),
}) })
const response = yield* RequestExecutor.withTimeout( const response = yield* RequestExecutor.withTls(executor.execute, request.http?.tls)(
RequestExecutor.withTls(executor.execute, request.http?.tls),
request.timeout,
)(
ProviderShared.jsonPost({ ProviderShared.jsonPost({
url: parts.url, url: parts.url,
body: parts.bodyText, body: parts.bodyText,
@ -137,7 +130,13 @@ export const make = (
}), }),
RequestExecutor.withFetch(request.fetch, options?.http), RequestExecutor.withFetch(request.fetch, options?.http),
) )
const text = yield* RequestExecutor.responseText(response) const text = yield* RequestExecutor.responseStream(response).pipe(
Stream.decodeText(),
Stream.runFold(
() => "",
(text, chunk) => text + chunk,
),
)
const invalid = (message: string, cause?: unknown) => const invalid = (message: string, cause?: unknown) =>
new AIError({ new AIError({
reason: new InvalidProviderOutputError({ reason: new InvalidProviderOutputError({
@ -154,16 +153,12 @@ export const make = (
if (!result.output.some((item) => item.type === "compaction")) if (!result.output.some((item) => item.type === "compaction"))
return yield* invalid("Compaction response did not contain a checkpoint") return yield* invalid("Compaction response did not contain a checkpoint")
return new CompactionResponse({ return new CompactionResponse({
replacement: result.output replacement: result.output.map((item) => toMessage(item, request.model)),
.filter((item): item is Output => item.type !== "message" || item.role !== "developer")
.map((item) => toMessage(item, request.model)),
usage: OpenResponses.mapUsage(result.usage, OpenResponses.metadataKey(request.model)), usage: OpenResponses.mapUsage(result.usage, OpenResponses.metadataKey(request.model)),
}) })
}) })
type Output = Exclude<(typeof Response.Type.output)[number], { readonly role: "developer" }> function toMessage(item: (typeof Response.Type.output)[number], model: LLMRequest["model"]): Message {
function toMessage(item: Output, model: LLMRequest["model"]): Message {
if (item.type === "compaction") if (item.type === "compaction")
return Message.assistant( return Message.assistant(
CompactionPart.make({ provider: model.provider, id: item.id ?? undefined, encrypted: item.encrypted_content }), CompactionPart.make({ provider: model.provider, id: item.id ?? undefined, encrypted: item.encrypted_content }),

View file

@ -72,33 +72,35 @@ export const onDone: (
state: OpenResponses.ParserState, state: OpenResponses.ParserState,
item: Item, item: Item,
tools: Definitions, tools: Definitions,
) => Effect.Effect<OpenResponses.StepResult, AIError> = Effect.fnUntraced(function* (state, item, tools) { ) => Effect.Effect<OpenResponses.StepResult, AIError> = Effect.fnUntraced(
const tool = tools[item.type] function* (state, item, tools) {
if (!tool) return [state, []] satisfies OpenResponses.StepResult const tool = tools[item.type]
const providerMetadata = OpenResponses.providerMetadata(state, { itemId: item.id }) if (!tool) return [state, []] satisfies OpenResponses.StepResult
const events: LLMEvent[] = [] const providerMetadata = OpenResponses.providerMetadata(state, { itemId: item.id })
const lifecycle = Lifecycle.stepStart(state.lifecycle, events) const events: LLMEvent[] = []
events.push( const lifecycle = Lifecycle.stepStart(state.lifecycle, events)
LLMEvent.toolCall({ events.push(
id: item.id, LLMEvent.toolCall({
name: tool.name, id: item.id,
input: tool.input(item), name: tool.name,
providerExecuted: true, input: tool.input(item),
providerMetadata, providerExecuted: true,
}), providerMetadata,
LLMEvent.toolResult({ }),
id: item.id, LLMEvent.toolResult({
name: tool.name, id: item.id,
result: tool.result name: tool.name,
? yield* tool.result(item) result: tool.result
: item.error !== undefined && item.error !== null ? yield* tool.result(item)
? { type: "error", value: item.error } : item.error !== undefined && item.error !== null
: { type: "json", value: item }, ? { type: "error", value: item.error }
providerExecuted: true, : { type: "json", value: item },
providerMetadata, providerExecuted: true,
}), providerMetadata,
) }),
return [{ ...state, lifecycle }, events] satisfies OpenResponses.StepResult )
}) return [{ ...state, lifecycle }, events] satisfies OpenResponses.StepResult
},
)
export * as ResponsesHostedTools from "./responses-hosted-tools.js" export * as ResponsesHostedTools from "./responses-hosted-tools.js"

View file

@ -1,6 +1,5 @@
import { Effect, Schema } from "effect" import { Effect, Schema } from "effect"
import { Protocol } from "../route/protocol.js" import { Protocol } from "../route/protocol.js"
import type { CompactOperation } from "../route/client.js"
import type { LLMRequest } from "../schema/index.js" import type { LLMRequest } from "../schema/index.js"
import { OpenResponses } from "./open-responses.js" import { OpenResponses } from "./open-responses.js"
import { JsonObject, optionalNull, ProviderShared } from "./shared.js" import { JsonObject, optionalNull, ProviderShared } from "./shared.js"
@ -92,16 +91,10 @@ export const protocol = Protocol.make({
from: fromRequest, from: fromRequest,
}, },
stream: ResponsesHostedTools.stream(adapter, HOSTED_TOOLS), stream: ResponsesHostedTools.stream(adapter, HOSTED_TOOLS),
supportsEffortUpdates: OpenResponses.protocol.supportsEffortUpdates,
}) })
const compactFlat = ResponsesCompaction.make(adapter, (request) => export const compact = ResponsesCompaction.make(adapter, (request) =>
OpenResponses.lowerTools(ProviderShared.flattenTools(request.tools), adapter, OpenAIFreeform.tools(request)), OpenResponses.lowerTools(ProviderShared.flattenTools(request.tools), adapter, OpenAIFreeform.tools(request)),
) )
// /compact lowers the history itself, so flatten the whole request as `Protocol.make` does before every step's body:
// past calls to namespaced tools then carry the same names as on those steps, and /compact reads the prefix they cached.
export const compact: CompactOperation = (request, executor, options) =>
compactFlat(ProviderShared.flattenRequest(request), executor, options)
export * as XAIResponses from "./xai-responses.js" export * as XAIResponses from "./xai-responses.js"

View file

@ -29,8 +29,6 @@ export const protocol = Protocol.make({
id: "zai-messages", id: "zai-messages",
body: { schema: Body, from: fromRequest }, body: { schema: Body, from: fromRequest },
stream: AnthropicMessages.protocol.stream, stream: AnthropicMessages.protocol.stream,
supportsEffortUpdates: AnthropicMessages.protocol.supportsEffortUpdates,
toolUpdates: AnthropicMessages.protocol.toolUpdates,
}) })
export * as ZAIMessages from "./zai-messages.js" export * as ZAIMessages from "./zai-messages.js"

View file

@ -18,8 +18,6 @@ const patterns = [
/input is too long for (?:the )?(?:requested|selected) model/i, /input is too long for (?:the )?(?:requested|selected) model/i,
// OpenCode Go // OpenCode Go
/too large for the model'?s configured input limit/i, /too large for the model'?s configured input limit/i,
// Tencent TokenHub code 400003, which OpenCode Go passes through for Hy models.
/input tokens exceeds? the model'?s? context limit/i,
// Cloudflare Workers AI reports this as HTTP 413. // Cloudflare Workers AI reports this as HTTP 413.
/exceeded this model context window limit/i, /exceeded this model context window limit/i,
/exceeds the context window/i, /exceeds the context window/i,
@ -130,8 +128,6 @@ const CONTENT_POLICY_CODES = new Set([
"responsibleaipolicyviolation", "responsibleaipolicyviolation",
"content_policy_violation", "content_policy_violation",
"image_content_policy_violation", "image_content_policy_violation",
// OpenAI's cybersecurity safeguard, as an HTTP 400 or a mid-stream error frame.
"cyber_policy",
"refusal", "refusal",
"datainspectionfailed", "datainspectionfailed",
"moderation_blocked", "moderation_blocked",
@ -158,7 +154,7 @@ const QUOTA_TEXT =
// Bedrock Mantle reuses it for schema validation; Anthropic reports blocked output // Bedrock Mantle reuses it for schema validation; Anthropic reports blocked output
// under `invalid_request_error`. The Vercel AI Gateway drops OpenAI's `moderation_blocked` code. // under `invalid_request_error`. The Vercel AI Gateway drops OpenAI's `moderation_blocked` code.
const CONTENT_POLICY_TEXT = const CONTENT_POLICY_TEXT =
/violating our usage policy|blocked by content filtering policy|content[-_\s]?policy|rejected (?:as a result of our|by the) safety system|detected potentially unsafe or sensitive content|rejected in accordance with our terms of use/i /violating our usage policy|blocked by content filtering policy|content[-_\s]?policy|rejected (?:as a result of our|by the) safety system|detected potentially unsafe or sensitive content/i
const SERVER_ERROR_TEXT = const SERVER_ERROR_TEXT =
/\b(?:try again|(?:please |you can )?retry (?:the |this |your )?request|try (?:the |this |your )?request again|(?:currently |temporarily )?at capacity|overloaded|temporarily unavailable|service[-_\s]?unavailable|(?:server|internal)[-_\s]?error|server (?:is )?busy|provider returned (?:an )?error|resource[-_\s]?exhausted|upstream (?:connect|connection|request)|request buffer limit while retrying upstream)\b/i /\b(?:try again|(?:please |you can )?retry (?:the |this |your )?request|try (?:the |this |your )?request again|(?:currently |temporarily )?at capacity|overloaded|temporarily unavailable|service[-_\s]?unavailable|(?:server|internal)[-_\s]?error|server (?:is )?busy|provider returned (?:an )?error|resource[-_\s]?exhausted|upstream (?:connect|connection|request)|request buffer limit while retrying upstream)\b/i

View file

@ -11,7 +11,6 @@ import { Endpoint } from "../route/endpoint.js"
import { Framing } from "../route/framing.js" import { Framing } from "../route/framing.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { import {
mergeTransport,
ProviderConfigurationError, ProviderConfigurationError,
ProviderID, ProviderID,
ToolDefinition, ToolDefinition,
@ -124,7 +123,8 @@ export const configure = (input: Config) => {
provider: id, provider: id,
endpoint: common.endpoint, endpoint: common.endpoint,
auth: opts.auth, auth: opts.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const embedding = (id: string | ModelID, providerOptions?: ProviderOptions) => const embedding = (id: string | ModelID, providerOptions?: ProviderOptions) =>
embeddingRoute.model({ id, providerOptions }) embeddingRoute.model({ id, providerOptions })

View file

@ -1,18 +1,19 @@
import { Auth } from "../route/auth.js" import { Auth } from "../route/auth.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { ProviderID, type ModelID, type TransportOptions } from "../schema/index.js" import { type HttpOptions, ProviderID, type ModelID } from "../schema/index.js"
import { AssemblyAITranscription } from "../protocols/assemblyai-transcription.js" import { AssemblyAITranscription } from "../protocols/assemblyai-transcription.js"
export type { AssemblyAITranscriptionOptions } from "../protocols/assemblyai-transcription.js" export type { AssemblyAITranscriptionOptions } from "../protocols/assemblyai-transcription.js"
export const id = ProviderID.make("assemblyai") export const id = ProviderID.make("assemblyai")
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { /** `https://api.eu.assemblyai.com` for the EU region. */
/** `https://api.eu.assemblyai.com` for the EU region. */ readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
// The key is the whole `authorization` value, without a scheme. // The key is the whole `authorization` value, without a scheme.
const auth = (options: ProviderAuthOption<"optional">) => const auth = (options: ProviderAuthOption<"optional">) =>

View file

@ -5,7 +5,6 @@ import { Endpoint } from "../route/endpoint.js"
import type { ProviderPackage } from "../provider-package.js" import type { ProviderPackage } from "../provider-package.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { import {
mergeTransport,
ProviderConfigurationError, ProviderConfigurationError,
ProviderID, ProviderID,
type ModelID, type ModelID,
@ -159,9 +158,14 @@ export const configure = (input: Config) => {
const image = (modelID: string | ModelID, providerOptions?: ProviderOptions) => { const image = (modelID: string | ModelID, providerOptions?: ProviderOptions) => {
const target = endpoint(input, modelID) const target = endpoint(input, modelID)
const transport = mergeTransport(input, { http: { query: target.query } }) const media = MediaRoute.deployment({ ...input, baseURL: target.baseURL }, auth(input))
const media = MediaRoute.deployment({ ...transport, baseURL: target.baseURL }, auth(input)) return OpenAIImages.model({
return OpenAIImages.model({ ...media, id: modelID, provider: id, providerOptions }) ...media,
id: modelID,
provider: id,
providerOptions,
http: { ...media.http, query: { ...media.http?.query, ...target.query } },
})
} }
const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
@ -170,7 +174,8 @@ export const configure = (input: Config) => {
provider: id, provider: id,
endpoint: endpoint(input, modelID), endpoint: endpoint(input, modelID),
auth: auth(input), auth: auth(input),
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
.model({ id: modelID, providerOptions }) .model({ id: modelID, providerOptions })

View file

@ -6,7 +6,7 @@ import type { ProviderAuthOption } from "../route/auth-options.js"
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { DecisionRoute } from "../route/decision.js" import { DecisionRoute } from "../route/decision.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import type { OpenAIProviderOptionsInput } from "./openai-options.js" import type { OpenAIProviderOptionsInput } from "./openai-options.js"
import { bearerRouteDefaults, toConfig } from "./settings.js" import { bearerRouteDefaults, toConfig } from "./settings.js"
@ -63,7 +63,8 @@ export const configure = (input: Config = {}) => {
protocol: decisionProtocol, protocol: decisionProtocol,
endpoint: Endpoint.path("/systemone", { baseURL: options.endpoint.baseURL }), endpoint: Endpoint.path("/systemone", { baseURL: options.endpoint.baseURL }),
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
decisionRoute.model<BasetenDecisionOptions>({ id: modelID, providerOptions }) decisionRoute.model<BasetenDecisionOptions>({ id: modelID, providerOptions })

View file

@ -2,15 +2,16 @@ import type { ProviderPackage } from "../provider-package.js"
import { SeedanceVideo } from "../protocols/seedance-video.js" import { SeedanceVideo } from "../protocols/seedance-video.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { ProviderID, type ModelID, type ProviderOptions, type TransportOptions } from "../schema/index.js" import { type HttpOptions, ProviderID, type ModelID, type ProviderOptions } from "../schema/index.js"
import { toConfig } from "./settings.js" import { toConfig } from "./settings.js"
export const id = ProviderID.make("byteplus") export const id = ProviderID.make("byteplus")
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
export type Settings = ProviderPackage.Settings & { export type Settings = ProviderPackage.Settings & {
readonly apiKey?: string | false readonly apiKey?: string | false

View file

@ -1,16 +1,17 @@
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { ProviderID, type ModelID, type TransportOptions } from "../schema/index.js" import { type HttpOptions, ProviderID, type ModelID } from "../schema/index.js"
import { CartesiaSpeech } from "../protocols/cartesia-speech.js" import { CartesiaSpeech } from "../protocols/cartesia-speech.js"
export type { CartesiaEncoding, CartesiaSpeechOptions } from "../protocols/cartesia-speech.js" export type { CartesiaEncoding, CartesiaSpeechOptions } from "../protocols/cartesia-speech.js"
export const id = ProviderID.make("cartesia") export const id = ProviderID.make("cartesia")
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
const auth = (options: ProviderAuthOption<"optional">) => AuthOptions.bearer(options, "CARTESIA_API_KEY") const auth = (options: ProviderAuthOption<"optional">) => AuthOptions.bearer(options, "CARTESIA_API_KEY")

View file

@ -4,7 +4,7 @@ import { CloudflareRunDecisions } from "../protocols/cloudflare-run-decisions.js
import { AnthropicMessages, OpenAIChat, OpenAIResponses } from "../protocols/index.js" import { AnthropicMessages, OpenAIChat, OpenAIResponses } from "../protocols/index.js"
import { Auth } from "../route/auth.js" import { Auth } from "../route/auth.js"
import { AuthOptions, type AtLeastOne, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type AtLeastOne, type ProviderAuthOption } from "../route/auth-options.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import { encodeJson } from "../utils/json.js" import { encodeJson } from "../utils/json.js"
import type { OpenAIProviderOptionsInput } from "./openai-options.js" import type { OpenAIProviderOptionsInput } from "./openai-options.js"
import { CloudflareShared } from "./cloudflare-shared.js" import { CloudflareShared } from "./cloudflare-shared.js"
@ -96,7 +96,6 @@ export const configure = (input: Config) => {
endpoint: { baseURL: baseURL(input) }, endpoint: { baseURL: baseURL(input) },
auth: custom ?? credential(input, (credential) => credential.bearer()), auth: custom ?? credential(input, (credential) => credential.bearer()),
headers: { "cf-aig-gateway-id": gatewayId(input), ...headers(input) }, headers: { "cf-aig-gateway-id": gatewayId(input), ...headers(input) },
timeout: input.timeout,
http: input.http, http: input.http,
providerOptions: input.providerOptions, providerOptions: input.providerOptions,
} }
@ -131,7 +130,8 @@ export const configure = (input: Config) => {
provider: id, provider: id,
endpoint: { baseURL: runBaseURL(input) }, endpoint: { baseURL: runBaseURL(input) },
auth: rest.auth, auth: rest.auth,
...mergeTransport(input, { headers: rest.headers }), headers: rest.headers,
http: input.http,
}) })
.model({ id: value, providerOptions }) .model({ id: value, providerOptions })
return { return {

View file

@ -7,7 +7,7 @@ import { AuthOptions, type AtLeastOne, type ProviderAuthOption } from "../route/
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import type { OpenAIProviderOptionsInput } from "./openai-options.js" import type { OpenAIProviderOptionsInput } from "./openai-options.js"
import { CloudflareShared } from "./cloudflare-shared.js" import { CloudflareShared } from "./cloudflare-shared.js"
@ -61,7 +61,8 @@ export const configure = (input: Config) => {
provider: id, provider: id,
endpoint: { baseURL: runBaseURL(input) }, endpoint: { baseURL: runBaseURL(input) },
auth: auth, auth: auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
.model({ id: modelID, providerOptions }) .model({ id: modelID, providerOptions })
return { return {

View file

@ -4,7 +4,7 @@ import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js"
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import type { ProviderAuthOption } from "../route/auth-options.js" import type { ProviderAuthOption } from "../route/auth-options.js"
import { mergeTransport, ProviderID, type ModelID, type OpenString, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type OpenString, type RequestOptions } from "../schema/index.js"
import type { ProviderPackage } from "../provider-package.js" import type { ProviderPackage } from "../provider-package.js"
import { bearerRouteDefaults, toConfig } from "./settings.js" import { bearerRouteDefaults, toConfig } from "./settings.js"
@ -40,7 +40,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: compatibility.endpoint, endpoint: compatibility.endpoint,
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
return { return {
id, id,

View file

@ -1,7 +1,7 @@
import { Auth } from "../route/auth.js" import { Auth } from "../route/auth.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { ProviderID, type ModelID, type TransportOptions } from "../schema/index.js" import { type HttpOptions, ProviderID, type ModelID } from "../schema/index.js"
import { DeepgramSpeech } from "../protocols/deepgram-speech.js" import { DeepgramSpeech } from "../protocols/deepgram-speech.js"
import { DeepgramTranscription } from "../protocols/deepgram-transcription.js" import { DeepgramTranscription } from "../protocols/deepgram-transcription.js"
@ -10,10 +10,11 @@ export type { DeepgramTranscriptionOptions } from "../protocols/deepgram-transcr
export const id = ProviderID.make("deepgram") export const id = ProviderID.make("deepgram")
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
const auth = (options: ProviderAuthOption<"optional">) => const auth = (options: ProviderAuthOption<"optional">) =>
AuthOptions.apiKey(options, "DEEPGRAM_API_KEY", Auth.scheme("Token")) AuthOptions.apiKey(options, "DEEPGRAM_API_KEY", Auth.scheme("Token"))

View file

@ -4,7 +4,7 @@ import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js"
import type { ProviderAuthOption } from "../route/auth-options.js" import type { ProviderAuthOption } from "../route/auth-options.js"
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import type { OpenAIProviderOptionsInput } from "./openai-options.js" import type { OpenAIProviderOptionsInput } from "./openai-options.js"
import { bearerRouteDefaults, toConfig } from "./settings.js" import { bearerRouteDefaults, toConfig } from "./settings.js"
@ -47,7 +47,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: options.endpoint, endpoint: options.endpoint,
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
return { return {
id, id,

View file

@ -10,7 +10,7 @@ import { Route } from "../route/client.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { Protocol } from "../route/protocol.js" import { Protocol } from "../route/protocol.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import type { OpenAIProviderOptionsInput } from "./openai-options.js" import type { OpenAIProviderOptionsInput } from "./openai-options.js"
import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js" import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js"
import { bearerRouteDefaults } from "./settings.js" import { bearerRouteDefaults } from "./settings.js"
@ -71,7 +71,8 @@ export const configure = (input: Config = {}) => {
endpoint: options.endpoint, endpoint: options.endpoint,
auth: options.auth, auth: options.auth,
// DigitalOcean serves TypeSafe's Jev, which needs this header for images. // DigitalOcean serves TypeSafe's Jev, which needs this header for images.
...mergeTransport({ headers: { "TypeSafe-Danger-Zone-Images": "true" } }, input), headers: { "TypeSafe-Danger-Zone-Images": "true", ...input.headers },
http: input.http,
}) })
const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
decisionRoute.model({ id: modelID, providerOptions }) decisionRoute.model({ id: modelID, providerOptions })
@ -82,7 +83,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: options.endpoint, endpoint: options.endpoint,
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
embeddingRoute.model({ id: modelID, providerOptions }) embeddingRoute.model({ id: modelID, providerOptions })

View file

@ -1,7 +1,7 @@
import { Auth } from "../route/auth.js" import { Auth } from "../route/auth.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { ProviderID, type ModelID, type TransportOptions } from "../schema/index.js" import { type HttpOptions, ProviderID, type ModelID } from "../schema/index.js"
import { ElevenLabsSpeech } from "../protocols/elevenlabs-speech.js" import { ElevenLabsSpeech } from "../protocols/elevenlabs-speech.js"
import { ElevenLabsTranscription } from "../protocols/elevenlabs-transcription.js" import { ElevenLabsTranscription } from "../protocols/elevenlabs-transcription.js"
@ -10,10 +10,11 @@ export type { ElevenLabsTranscriptionOptions } from "../protocols/elevenlabs-tra
export const id = ProviderID.make("elevenlabs") export const id = ProviderID.make("elevenlabs")
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
const auth = (options: ProviderAuthOption<"optional">) => const auth = (options: ProviderAuthOption<"optional">) =>
AuthOptions.apiKey(options, "ELEVENLABS_API_KEY", Auth.header("xi-api-key")) AuthOptions.apiKey(options, "ELEVENLABS_API_KEY", Auth.header("xi-api-key"))

View file

@ -4,7 +4,7 @@ import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js"
import type { ProviderAuthOption } from "../route/auth-options.js" import type { ProviderAuthOption } from "../route/auth-options.js"
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import type { OpenAIProviderOptionsInput } from "./openai-options.js" import type { OpenAIProviderOptionsInput } from "./openai-options.js"
import { bearerRouteDefaults, toConfig } from "./settings.js" import { bearerRouteDefaults, toConfig } from "./settings.js"
@ -41,7 +41,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: options.endpoint, endpoint: options.endpoint,
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
return { return {
id, id,

View file

@ -3,6 +3,7 @@ import { GoogleInteractions } from "../protocols/google-interactions.js"
import { Auth } from "../route/auth.js" import { Auth } from "../route/auth.js"
import { Route } from "../route/client.js" import { Route } from "../route/client.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { Framing } from "../route/framing.js"
import { ProviderConfigurationError, ProviderID, type ModelID, type RequestOptions } from "../schema/index.js" import { ProviderConfigurationError, ProviderID, type ModelID, type RequestOptions } from "../schema/index.js"
import { GoogleVertexShared } from "./google-vertex-shared.js" import { GoogleVertexShared } from "./google-vertex-shared.js"
@ -40,7 +41,7 @@ const route = Route.make({
const serviceTier = request.providerOptions?.serviceTier const serviceTier = request.providerOptions?.serviceTier
return typeof serviceTier === "string" ? { "x-vertex-ai-llm-shared-request-type": serviceTier } : {} return typeof serviceTier === "string" ? { "x-vertex-ai-llm-shared-request-type": serviceTier } : {}
}, },
transport: GoogleInteractions.transport, framing: Framing.sse,
}) })
export const routes = [route] export const routes = [route]

View file

@ -15,7 +15,6 @@ import { EmbeddingRoute } from "../route/embedding.js"
import { Endpoint } from "../route/endpoint.js" import { Endpoint } from "../route/endpoint.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { import {
mergeTransport,
ProviderConfigurationError, ProviderConfigurationError,
ProviderID, ProviderID,
type LLMRequest, type LLMRequest,
@ -184,11 +183,7 @@ export const configure = (input: Config = {}) => {
message: "Google Vertex embedContent does not support Express Mode API keys; use project credentials", message: "Google Vertex embedContent does not support Express Mode API keys; use project credentials",
}) })
return selected.route return selected.route
.with({ .with({ endpoint: target.endpoint, auth: target.auth, headers: input.headers, http: input.http })
endpoint: target.endpoint,
auth: target.auth,
...mergeTransport(input),
})
.model<VertexOptionsInput & PredictOptionsInput>({ id: modelID, providerOptions }) .model<VertexOptionsInput & PredictOptionsInput>({ id: modelID, providerOptions })
}, },
configure, configure,

View file

@ -2,7 +2,7 @@ import { Auth } from "../route/auth.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import type { ProviderPackage } from "../provider-package.js" import type { ProviderPackage } from "../provider-package.js"
import { mergeTransport, ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js" import { ProviderID, type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js"
import { Gemini } from "../protocols/gemini.js" import { Gemini } from "../protocols/gemini.js"
import { import {
GoogleEmbedContent, GoogleEmbedContent,
@ -63,7 +63,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: { baseURL: input.baseURL }, endpoint: { baseURL: input.baseURL },
auth: auth(input), auth: auth(input),
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
return { return {
id, id,
@ -81,11 +82,7 @@ export const configure = (input: Config = {}) => {
embeddingRoute.model<GoogleEmbeddingOptionsInput>({ id: modelID, providerOptions }), embeddingRoute.model<GoogleEmbeddingOptionsInput>({ id: modelID, providerOptions }),
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
GoogleDecisions.route GoogleDecisions.route
.with({ .with({ endpoint: { baseURL: media.baseURL }, auth: media.auth, headers: media.headers, http: media.http })
endpoint: { baseURL: media.baseURL },
auth: media.auth,
...media.transport,
})
.model<GoogleDecisions.OptionsInput>({ id: modelID, providerOptions }), .model<GoogleDecisions.OptionsInput>({ id: modelID, providerOptions }),
configure, configure,
} }

View file

@ -1,5 +1,4 @@
import { import {
mergeTransport,
mergeProviderOptions, mergeProviderOptions,
ProviderID, ProviderID,
type ModelID, type ModelID,
@ -49,13 +48,15 @@ export const configure = (input: Config) => {
provider, provider,
endpoint: { baseURL }, endpoint: { baseURL },
auth, auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const decisionRoute = SystemOne.route.with({ const decisionRoute = SystemOne.route.with({
provider, provider,
endpoint: { baseURL }, endpoint: { baseURL },
auth, auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
return { return {
id: ProviderID.make(provider), id: ProviderID.make(provider),

View file

@ -3,7 +3,6 @@ import type { Route, CompactionOperations } from "../route/client.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import type { ProviderPackage } from "../provider-package.js" import type { ProviderPackage } from "../provider-package.js"
import { import {
mergeTransport,
ProviderID, ProviderID,
ToolDefinition, ToolDefinition,
type ModelID, type ModelID,
@ -110,10 +109,11 @@ export const configure = (input: Config = {}) => {
id, id,
capabilities: { promptCacheKey: true }, capabilities: { promptCacheKey: true },
}) })
const media = MediaRoute.deployment( const deployment = MediaRoute.deployment(input, auth(input))
{ ...mergeTransport(input, { http: { query: input.queryParams } }), baseURL: input.baseURL }, const media = {
auth(input), ...deployment,
) http: { ...deployment.http, query: { ...deployment.http?.query, ...input.queryParams } },
}
// The ChatGPT backend (ChatGPT sign-in) rejects multipart image edits with "Unsupported content type". // The ChatGPT backend (ChatGPT sign-in) rejects multipart image edits with "Unsupported content type".
const imageInput = media.baseURL?.startsWith("https://chatgpt.com/") ? "json-edits" : undefined const imageInput = media.baseURL?.startsWith("https://chatgpt.com/") ? "json-edits" : undefined
const image = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const image = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
@ -123,14 +123,16 @@ export const configure = (input: Config = {}) => {
const decisionRoute = OpenAIDecisions.route.with({ const decisionRoute = OpenAIDecisions.route.with({
endpoint: { baseURL: media.baseURL }, endpoint: { baseURL: media.baseURL },
auth: media.auth, auth: media.auth,
...media.transport, headers: media.headers,
http: media.http,
}) })
const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
decisionRoute.model<OpenAIDecisionOptionsInput>({ id: modelID, providerOptions }) decisionRoute.model<OpenAIDecisionOptionsInput>({ id: modelID, providerOptions })
const embeddingRoute = OpenAIEmbeddings.route.with({ const embeddingRoute = OpenAIEmbeddings.route.with({
endpoint: { baseURL: media.baseURL }, endpoint: { baseURL: media.baseURL },
auth: media.auth, auth: media.auth,
...media.transport, headers: media.headers,
http: media.http,
}) })
const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
embeddingRoute.model<OpenAIEmbeddingOptionsInput>({ id: modelID, providerOptions }) embeddingRoute.model<OpenAIEmbeddingOptionsInput>({ id: modelID, providerOptions })

View file

@ -1,10 +1,4 @@
import { import { type HttpOptions, ProviderID, type ModelID, type ProviderOptions } from "../schema/index.js"
mergeTransport,
ProviderID,
type ModelID,
type ProviderOptions,
type TransportOptions,
} from "../schema/index.js"
import type { ProviderPackage } from "../provider-package.js" import type { ProviderPackage } from "../provider-package.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { SystemOne } from "../protocols/system-one.js" import { SystemOne } from "../protocols/system-one.js"
@ -13,10 +7,11 @@ import { toConfig } from "./settings.js"
export const id = ProviderID.make("opencode") export const id = ProviderID.make("opencode")
const baseURL = "https://opencode.ai/inference/systemone/v1" const baseURL = "https://opencode.ai/inference/systemone/v1"
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
export type Settings = ProviderPackage.Settings & { readonly apiKey?: string | false } export type Settings = ProviderPackage.Settings & { readonly apiKey?: string | false }
@ -27,7 +22,8 @@ export const configure = (input: Config = {}) => {
endpoint: { baseURL: input.baseURL ?? baseURL }, endpoint: { baseURL: input.baseURL ?? baseURL },
auth: AuthOptions.bearer(input, "OPENCODE_API_KEY"), auth: AuthOptions.bearer(input, "OPENCODE_API_KEY"),
// Zen forwards TypeSafe's image opt-in header; text-only requests are unchanged with it. // Zen forwards TypeSafe's image opt-in header; text-only requests are unchanged with it.
...mergeTransport({ headers: { "TypeSafe-Danger-Zone-Images": "true" } }, input), headers: { "TypeSafe-Danger-Zone-Images": "true", ...input.headers },
http: input.http,
}) })
const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
route.model({ id: modelID, providerOptions }) route.model({ id: modelID, providerOptions })

View file

@ -4,7 +4,6 @@ import { Endpoint } from "../route/endpoint.js"
import { Protocol } from "../route/protocol.js" import { Protocol } from "../route/protocol.js"
import type { ProviderAuthOption } from "../route/auth-options.js" import type { ProviderAuthOption } from "../route/auth-options.js"
import { import {
mergeTransport,
ProviderID, ProviderID,
type ModelID, type ModelID,
type OpenString, type OpenString,
@ -237,7 +236,6 @@ const responsesProtocol = Protocol.make({
), ),
}, },
stream: OpenResponses.protocol.stream, stream: OpenResponses.protocol.stream,
supportsEffortUpdates: OpenResponses.protocol.supportsEffortUpdates,
}) })
export const route = Route.make({ export const route = Route.make({
@ -270,7 +268,8 @@ export const configure = (input: Config = {}) => {
providerMetadataKey: "openrouter", providerMetadataKey: "openrouter",
endpoint: options.endpoint, endpoint: options.endpoint,
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const media = MediaRoute.deployment({ ...input, baseURL: options.endpoint.baseURL }, options.auth) const media = MediaRoute.deployment({ ...input, baseURL: options.endpoint.baseURL }, options.auth)
const image = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const image = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
@ -294,7 +293,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: options.endpoint, endpoint: options.endpoint,
auth: options.auth, auth: options.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
embeddingRoute.model<OpenRouterEmbeddingOptions>({ id: modelID, providerOptions }) embeddingRoute.model<OpenRouterEmbeddingOptions>({ id: modelID, providerOptions })

View file

@ -1,10 +1,4 @@
import { import { type HttpOptions, ProviderID, type ModelID, type ProviderOptions } from "../schema/index.js"
mergeTransport,
ProviderID,
type ModelID,
type ProviderOptions,
type TransportOptions,
} from "../schema/index.js"
import type { ProviderPackage } from "../provider-package.js" import type { ProviderPackage } from "../provider-package.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { SystemOne } from "../protocols/system-one.js" import { SystemOne } from "../protocols/system-one.js"
@ -13,10 +7,11 @@ import { toConfig } from "./settings.js"
export const id = ProviderID.make("typesafe-ai") export const id = ProviderID.make("typesafe-ai")
const baseURL = "https://api.typesafe.ai/v1" const baseURL = "https://api.typesafe.ai/v1"
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
export type Settings = ProviderPackage.Settings & { readonly apiKey?: string | false } export type Settings = ProviderPackage.Settings & { readonly apiKey?: string | false }
@ -27,7 +22,8 @@ export const configure = (input: Config = {}) => {
endpoint: { baseURL: input.baseURL ?? baseURL }, endpoint: { baseURL: input.baseURL ?? baseURL },
auth: AuthOptions.bearer(input, "TYPESAFE_API_KEY"), auth: AuthOptions.bearer(input, "TYPESAFE_API_KEY"),
// Required for images; text-only requests are unchanged with it. // Required for images; text-only requests are unchanged with it.
...mergeTransport({ headers: { "TypeSafe-Danger-Zone-Images": "true" } }, input), headers: { "TypeSafe-Danger-Zone-Images": "true", ...input.headers },
http: input.http,
}) })
const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
route.model({ id: modelID, providerOptions }) route.model({ id: modelID, providerOptions })

View file

@ -16,7 +16,6 @@ import { Framing } from "../route/framing.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import type { Protocol } from "../route/protocol.js" import type { Protocol } from "../route/protocol.js"
import { import {
mergeTransport,
type LLMRequest, type LLMRequest,
ModelID, ModelID,
ProviderID, ProviderID,
@ -252,7 +251,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: { baseURL: configured.endpoint.baseURL }, endpoint: { baseURL: configured.endpoint.baseURL },
auth: configured.auth, auth: configured.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const decision = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
decisionRoute.model({ id: modelID, providerOptions }) decisionRoute.model({ id: modelID, providerOptions })
@ -260,7 +260,8 @@ export const configure = (input: Config = {}) => {
provider: id, provider: id,
endpoint: { baseURL: configured.endpoint.baseURL }, endpoint: { baseURL: configured.endpoint.baseURL },
auth: configured.auth, auth: configured.auth,
...mergeTransport(input), headers: input.headers,
http: input.http,
}) })
const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) => const embedding = (modelID: string | ModelID, providerOptions?: ProviderOptions) =>
embeddingRoute.model({ id: modelID, providerOptions }) embeddingRoute.model({ id: modelID, providerOptions })

View file

@ -2,15 +2,16 @@ import type { ProviderPackage } from "../provider-package.js"
import { SeedanceVideo } from "../protocols/seedance-video.js" import { SeedanceVideo } from "../protocols/seedance-video.js"
import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
import { MediaRoute } from "../route/media.js" import { MediaRoute } from "../route/media.js"
import { ProviderID, type ModelID, type ProviderOptions, type TransportOptions } from "../schema/index.js" import { type HttpOptions, ProviderID, type ModelID, type ProviderOptions } from "../schema/index.js"
import { toConfig } from "./settings.js" import { toConfig } from "./settings.js"
export const id = ProviderID.make("volcengine") export const id = ProviderID.make("volcengine")
export type Config = TransportOptions & export type Config = ProviderAuthOption<"optional"> & {
ProviderAuthOption<"optional"> & { readonly baseURL?: string
readonly baseURL?: string readonly headers?: Record<string, string>
} readonly http?: HttpOptions
}
export type Settings = ProviderPackage.Settings & { export type Settings = ProviderPackage.Settings & {
readonly apiKey?: string | false readonly apiKey?: string | false

View file

@ -8,16 +8,10 @@ import {
type DecisionRequest, type DecisionRequest,
type DecisionResponse, type DecisionResponse,
} from "../decision.js" } from "../decision.js"
import { import { ProviderID, type HttpOptions, type AIError, type ProviderOptions } from "../schema/index.js"
mergeTransport,
ProviderID,
type AIError,
type ProviderOptions,
type TransportOptions,
} from "../schema/index.js"
import { Auth } from "./auth.js" import { Auth } from "./auth.js"
import { Endpoint } from "./endpoint.js" import { Endpoint } from "./endpoint.js"
import { RequestExecutor } from "./executor.js" import { RequestExecutorService } from "./executor-service.js"
import { MediaProtocol } from "./media-protocol.js" import { MediaProtocol } from "./media-protocol.js"
import { MediaRoute, type Execute } from "./media.js" import { MediaRoute, type Execute } from "./media.js"
@ -38,23 +32,26 @@ export interface Protocol {
export const protocol = (input: Protocol) => input export const protocol = (input: Protocol) => input
/** Headers, timeouts and `http` overlays merge into the route's; every model of the route starts from them. */ export interface Patch {
export interface Patch extends TransportOptions {
readonly id?: string readonly id?: string
readonly provider?: string | ProviderID readonly provider?: string | ProviderID
/** ProviderMetadata namespace for responses; defaults to the provider. */ /** ProviderMetadata namespace for responses; defaults to the provider. */
readonly providerMetadataKey?: string readonly providerMetadataKey?: string
readonly endpoint?: Endpoint.EndpointPatch<MediaProtocol.Body, DecisionRequest> readonly endpoint?: Endpoint.EndpointPatch<MediaProtocol.Body, DecisionRequest>
readonly auth?: Auth.Definition readonly auth?: Auth.Definition
readonly headers?: Record<string, string>
readonly http?: HttpOptions
} }
export interface Route extends TransportOptions { export interface Route {
readonly id: string readonly id: string
readonly provider: ProviderID readonly provider: ProviderID
readonly providerMetadataKey: string readonly providerMetadataKey: string
readonly protocol: Protocol readonly protocol: Protocol
readonly endpoint: Endpoint.Definition<MediaProtocol.Body, DecisionRequest> readonly endpoint: Endpoint.Definition<MediaProtocol.Body, DecisionRequest>
readonly auth: Auth.Definition readonly auth: Auth.Definition
readonly headers?: Record<string, string>
readonly http?: HttpOptions
readonly with: (patch: Patch) => Route readonly with: (patch: Patch) => Route
readonly model: <Options extends DecisionOptions = DecisionOptions>(input: { readonly model: <Options extends DecisionOptions = DecisionOptions>(input: {
readonly id: string readonly id: string
@ -79,7 +76,8 @@ export const make = (input: MakeInput): Route => {
protocol: input.protocol, protocol: input.protocol,
endpoint: input.endpoint, endpoint: input.endpoint,
auth: input.auth ?? Auth.none, auth: input.auth ?? Auth.none,
...mergeTransport(input), headers: input.headers,
http: input.http,
} }
return { return {
...route, ...route,
@ -91,7 +89,8 @@ export const make = (input: MakeInput): Route => {
providerMetadataKey: providerMetadataKey:
patch.providerMetadataKey ?? (patch.provider === undefined ? route.providerMetadataKey : undefined), patch.providerMetadataKey ?? (patch.provider === undefined ? route.providerMetadataKey : undefined),
endpoint: patch.endpoint === undefined ? route.endpoint : Endpoint.merge(route.endpoint, patch.endpoint), endpoint: patch.endpoint === undefined ? route.endpoint : Endpoint.merge(route.endpoint, patch.endpoint),
...mergeTransport(route, patch), headers: patch.headers === undefined ? route.headers : { ...route.headers, ...patch.headers },
http: patch.http ?? route.http,
}), }),
model: <Options extends DecisionOptions>(model: { model: <Options extends DecisionOptions>(model: {
readonly id: string readonly id: string
@ -102,7 +101,7 @@ export const make = (input: MakeInput): Route => {
return DecisionModel.make<Options>({ return DecisionModel.make<Options>({
id: model.id, id: model.id,
provider, provider,
transport: mergeTransport(route), http: route.http,
providerOptions: model.providerOptions, providerOptions: model.providerOptions,
compatibility: compatibility:
model.compatibility === undefined ? undefined : DecisionModelCompatibility.make(model.compatibility), model.compatibility === undefined ? undefined : DecisionModelCompatibility.make(model.compatibility),
@ -130,11 +129,11 @@ const transport = (route: Omit<Route, "with" | "model">) => {
}), }),
endpoint: route.endpoint, endpoint: route.endpoint,
auth: route.auth, auth: route.auth,
headers: route.headers,
}) })
return Effect.fnUntraced(function* (request: DecisionRequest, execute: Execute) { return Effect.fnUntraced(function* (request: DecisionRequest, execute: Execute) {
if (!route.protocol.inlineMedia) return yield* composed.generate(request, execute) if (!route.protocol.inlineMedia) return yield* composed.generate(request, execute)
const timed = RequestExecutor.withTimeout(execute, mergeTransport(request.model.transport, request).timeout) const input = yield* Effect.forEach(request.input, (part) => materialize(part, execute))
const input = yield* Effect.forEach(request.input, (part) => materialize(part, timed))
return yield* composed.generate({ ...request, input }, execute) return yield* composed.generate({ ...request, input }, execute)
}) })
} }
@ -142,7 +141,7 @@ const transport = (route: Omit<Route, "with" | "model">) => {
const materialize = (part: DecisionPart, execute: Execute) => const materialize = (part: DecisionPart, execute: Execute) =>
part.type === "media" && part.media.source.type === "url" part.type === "media" && part.media.source.type === "url"
? part.media.materialize().pipe( ? part.media.materialize().pipe(
Effect.provideService(RequestExecutor.Service, { execute }), Effect.provideService(RequestExecutorService, { execute }),
Effect.map((media) => ({ ...part, media })), Effect.map((media) => ({ ...part, media })),
) )
: Effect.succeed(part) : Effect.succeed(part)

View file

@ -7,13 +7,7 @@ import {
type EmbeddingOptions, type EmbeddingOptions,
type EmbeddingRequest, type EmbeddingRequest,
} from "../embedding.js" } from "../embedding.js"
import { import { ProviderID, type HttpOptions, type AIError, type ProviderOptions } from "../schema/index.js"
mergeTransport,
ProviderID,
type AIError,
type ProviderOptions,
type TransportOptions,
} from "../schema/index.js"
import { Auth } from "./auth.js" import { Auth } from "./auth.js"
import { Endpoint } from "./endpoint.js" import { Endpoint } from "./endpoint.js"
import { MediaProtocol } from "./media-protocol.js" import { MediaProtocol } from "./media-protocol.js"
@ -34,14 +28,15 @@ export interface Protocol {
export const protocol = (input: Protocol) => input export const protocol = (input: Protocol) => input
/** Headers, timeouts and `http` overlays merge into the route's; every model of the route starts from them. */ export interface Patch {
export interface Patch extends TransportOptions {
readonly id?: string readonly id?: string
readonly provider?: string | ProviderID readonly provider?: string | ProviderID
/** ProviderMetadata namespace for responses; defaults to the provider. */ /** ProviderMetadata namespace for responses; defaults to the provider. */
readonly providerMetadataKey?: string readonly providerMetadataKey?: string
readonly endpoint?: Endpoint.EndpointPatch<MediaProtocol.Body, EmbeddingRequest> readonly endpoint?: Endpoint.EndpointPatch<MediaProtocol.Body, EmbeddingRequest>
readonly auth?: Auth.Definition readonly auth?: Auth.Definition
readonly headers?: Record<string, string>
readonly http?: HttpOptions
/** /**
* Most values one HTTP request may carry. Longer requests are split into requests of this size, sent a few at a * Most values one HTTP request may carry. Longer requests are split into requests of this size, sent a few at a
* time, and joined back in value order. * time, and joined back in value order.
@ -49,13 +44,15 @@ export interface Patch extends TransportOptions {
readonly maxValues?: number readonly maxValues?: number
} }
export interface Route extends TransportOptions { export interface Route {
readonly id: string readonly id: string
readonly provider: ProviderID readonly provider: ProviderID
readonly providerMetadataKey: string readonly providerMetadataKey: string
readonly protocol: Protocol readonly protocol: Protocol
readonly endpoint: Endpoint.Definition<MediaProtocol.Body, EmbeddingRequest> readonly endpoint: Endpoint.Definition<MediaProtocol.Body, EmbeddingRequest>
readonly auth: Auth.Definition readonly auth: Auth.Definition
readonly headers?: Record<string, string>
readonly http?: HttpOptions
readonly maxValues?: number readonly maxValues?: number
readonly with: (patch: Patch) => Route readonly with: (patch: Patch) => Route
readonly model: <Options extends EmbeddingOptions = EmbeddingOptions>(input: { readonly model: <Options extends EmbeddingOptions = EmbeddingOptions>(input: {
@ -80,7 +77,8 @@ export const make = (input: MakeInput): Route => {
protocol: input.protocol, protocol: input.protocol,
endpoint: input.endpoint, endpoint: input.endpoint,
auth: input.auth ?? Auth.none, auth: input.auth ?? Auth.none,
...mergeTransport(input), headers: input.headers,
http: input.http,
maxValues: input.maxValues, maxValues: input.maxValues,
} }
return { return {
@ -93,7 +91,8 @@ export const make = (input: MakeInput): Route => {
providerMetadataKey: providerMetadataKey:
patch.providerMetadataKey ?? (patch.provider === undefined ? route.providerMetadataKey : undefined), patch.providerMetadataKey ?? (patch.provider === undefined ? route.providerMetadataKey : undefined),
endpoint: patch.endpoint === undefined ? route.endpoint : Endpoint.merge(route.endpoint, patch.endpoint), endpoint: patch.endpoint === undefined ? route.endpoint : Endpoint.merge(route.endpoint, patch.endpoint),
...mergeTransport(route, patch), headers: patch.headers === undefined ? route.headers : { ...route.headers, ...patch.headers },
http: patch.http ?? route.http,
maxValues: patch.maxValues ?? route.maxValues, maxValues: patch.maxValues ?? route.maxValues,
}), }),
model: <Options extends EmbeddingOptions>(model: { model: <Options extends EmbeddingOptions>(model: {
@ -103,7 +102,7 @@ export const make = (input: MakeInput): Route => {
EmbeddingModel.make<Options>({ EmbeddingModel.make<Options>({
id: model.id, id: model.id,
provider, provider,
transport: mergeTransport(route), http: route.http,
providerOptions: model.providerOptions, providerOptions: model.providerOptions,
route: { id: route.id, generate: split(route.maxValues, transport(route).generate) }, route: { id: route.id, generate: split(route.maxValues, transport(route).generate) },
}), }),
@ -170,6 +169,7 @@ const transport = (route: Omit<Route, "with" | "model">) =>
), ),
endpoint: route.endpoint, endpoint: route.endpoint,
auth: route.auth, auth: route.auth,
headers: route.headers,
}) })
export * as EmbeddingRoute from "./embedding.js" export * as EmbeddingRoute from "./embedding.js"

View file

@ -1,7 +1,7 @@
import { Cause, Context, Effect, Option, Schema, Stream } from "effect" import { Context, Effect, Stream } from "effect"
import { HttpClientError, type Headers, type HttpClientRequest, type HttpClientResponse } from "effect/http" import type { Headers, HttpClientRequest, HttpClientResponse } from "effect/http"
import { AIError, HttpContext, TransportError } from "../schema/errors.js" import { HttpContext, type AIError } from "../schema/errors.js"
import type { ClientTls, RequestTimeout } from "../schema/options.js" import type { ClientTls } from "../schema/options.js"
// The service tag lives in its own leaf module so `Media.Asset` (imported by the schema layer) can require the // The service tag lives in its own leaf module so `Media.Asset` (imported by the schema layer) can require the
// executor without pulling the full executor implementation, and therefore the schema barrel, into a cycle. // executor without pulling the full executor implementation, and therefore the schema barrel, into a cycle.
@ -32,16 +32,6 @@ export const Service = RequestExecutorService
export const CurrentTls = Context.Reference<ClientTls | undefined>("@opencode/AI/RequestExecutor/CurrentTls", { export const CurrentTls = Context.Reference<ClientTls | undefined>("@opencode/AI/RequestExecutor/CurrentTls", {
defaultValue: () => undefined, defaultValue: () => undefined,
}) })
/**
* Per-phase HTTP timeouts for requests executed while it is set. Transports set it from `request.timeout`;
* `RequestExecutor` applies defaults (`DEFAULT_HTTP_TIMEOUT_MS` for headers, `DEFAULT_CHUNK_TIMEOUT_MS` between
* response chunks) whenever a phase is left unset.
*/
export const CurrentTimeout = Context.Reference<RequestTimeout | undefined>(
"@opencode/AI/RequestExecutor/CurrentTimeout",
{ defaultValue: () => undefined },
)
export type Service = RequestExecutorService export type Service = RequestExecutorService
/** /**
@ -93,99 +83,3 @@ export const responseHttp = (response: HttpClientResponse.HttpClientResponse) =>
status: response.status, status: response.status,
headers: headerDetails(response.headers), headers: headerDetails(response.headers),
}) })
export type HttpOperation = "request" | "read"
const NativeTransportFailure = Schema.Struct({
message: Schema.String,
code: Schema.optionalKey(Schema.String),
cause: Schema.optionalKey(Schema.Unknown),
})
const decodeNativeTransportFailure = Schema.decodeUnknownOption(NativeTransportFailure)
const nativeTransportFailure = (error: unknown) => {
const failure = Option.getOrUndefined(decodeNativeTransportFailure(error))
if (!failure) return undefined
if (failure.code !== undefined) return failure
const cause = Option.getOrUndefined(decodeNativeTransportFailure(failure.cause))
if (cause?.code !== undefined) return cause
return failure
}
// HTTP hooks re-wrap response bodies, so a read failure can arrive as an HttpClientError caused by
// another HttpClientError. The innermost cause carries the native failure.
export const rootCause = (error: unknown): unknown =>
HttpClientError.isHttpClientError(error) && "cause" in error.reason && error.reason.cause !== undefined
? rootCause(error.reason.cause)
: error
const CONNECTION_LOST = "Connection lost while reading the response"
export const httpError = (input: {
readonly error: unknown
readonly request: HttpClientRequest.HttpClientRequest
readonly operation: HttpOperation
readonly http?: HttpContext
}) => {
const request = HttpClientError.isHttpClientError(input.error) ? input.error.request : input.request
const transportError = (failure: { readonly message: string; readonly code?: string | undefined }) =>
new AIError({
reason: new TransportError({
message: failure.message,
cause: source,
http: input.http,
transport: "http",
operation: input.operation,
code: failure.code,
url: request.url,
}),
})
const source = rootCause(input.error)
const native = nativeTransportFailure(source)
const code = native?.code
const detail =
code && native?.message && !native.message.includes(code) ? `${code}: ${native.message}` : native?.message
const message = detail ?? (input.error instanceof Error ? input.error.message : undefined)
if (Cause.isTimeoutError(input.error) || Cause.isTimeoutError(source))
return transportError({ message: message ?? "HTTP transport timed out", code: code ?? "Timeout" })
if (!HttpClientError.isHttpClientError(input.error))
return transportError({ message: message ?? "HTTP transport failed", code })
// Effect reports every response body read failure as a DecodeError, but the raw byte stream decodes
// nothing: provider output parsing happens later and fails as InvalidProviderOutput.
if (input.operation === "read" && input.error.reason._tag === "DecodeError")
return transportError({ message: detail ? `${CONNECTION_LOST}: ${detail}` : CONNECTION_LOST, code })
if (input.error.reason._tag === "TransportError") {
return transportError({
message: message ?? input.error.reason.description ?? "HTTP transport failed",
code: code ?? input.error.reason._tag,
})
}
return transportError({
message: message ?? `HTTP transport failed: ${input.error.reason._tag}`,
code: code ?? input.error.reason._tag,
})
}
export const responseStream = (response: HttpClientResponse.HttpClientResponse): Stream.Stream<Uint8Array, AIError> =>
response.stream.pipe(
Stream.mapError((error) =>
httpError({ error, request: response.request, operation: "read", http: responseHttp(response) }),
),
)
export const responseBytes = (response: HttpClientResponse.HttpClientResponse): Effect.Effect<Uint8Array, AIError> =>
response.arrayBuffer.pipe(
Effect.map((buffer) => new Uint8Array(buffer)),
Effect.mapError((error) =>
httpError({ error, request: response.request, operation: "read", http: responseHttp(response) }),
),
)
export const responseText = (response: HttpClientResponse.HttpClientResponse): Effect.Effect<string, AIError> =>
response.text.pipe(
Effect.mapError((error) =>
httpError({ error, request: response.request, operation: "read", http: responseHttp(response) }),
),
)

View file

@ -1,4 +1,4 @@
import { Cause, Clock, Duration, Effect, Layer, Stream } from "effect" import { Cause, Effect, Layer, Option, Schema, Stream } from "effect"
import { import {
FetchHttpClient, FetchHttpClient,
Headers, Headers,
@ -7,43 +7,25 @@ import {
HttpClientRequest, HttpClientRequest,
HttpClientResponse, HttpClientResponse,
} from "effect/http" } from "effect/http"
import { import { HttpContext, HttpRateLimitDetails, AIError, TransportError } from "../schema/index.js"
AIError,
DEFAULT_CHUNK_TIMEOUT_MS,
DEFAULT_HTTP_TIMEOUT_MS,
HttpContext,
HttpRateLimitDetails,
timeoutConfig,
TransportError,
type ClientTls,
type HttpTimeout,
type RequestTimeout,
} from "../schema/index.js"
import { classifyProviderFailure, providerErrorMessage } from "../provider-error.js" import { classifyProviderFailure, providerErrorMessage } from "../provider-error.js"
import { import {
composeMiddleware, composeMiddleware,
CurrentMiddleware, CurrentMiddleware,
CurrentTimeout,
CurrentTls, CurrentTls,
headerDetails, headerDetails,
httpError, responseHttp,
responseStream,
rootCause,
Service, Service,
type HttpMiddleware, type HttpMiddleware,
type HttpOperation,
type Interface, type Interface,
} from "./executor-service.js" } from "./executor-service.js"
import type { ClientTls } from "../schema/options.js"
export { export {
composeMiddleware, composeMiddleware,
CurrentMiddleware, CurrentMiddleware,
CurrentTimeout,
CurrentTls, CurrentTls,
responseBytes,
responseHttp, responseHttp,
responseStream,
responseText,
Service, Service,
withMiddleware, withMiddleware,
} from "./executor-service.js" } from "./executor-service.js"
@ -113,19 +95,14 @@ const rateLimitDetails = (headers: Record<string, string>, retryAfter: number |
const MAX_BODY_CHARS = 2000 const MAX_BODY_CHARS = 2000
const requestTarget = (url: string) => {
const parsed = URL.parse(url)
return parsed ? `${parsed.origin}${parsed.pathname}` : url.split(/[?#]/)[0]
}
// Without a recognized message, show the raw body so the provider's explanation is never dropped. // Without a recognized message, show the raw body so the provider's explanation is never dropped.
const providerMessage = (request: HttpClientRequest.HttpClientRequest, status: number, body: string | void) => { const providerMessage = (status: number, body: string | void) => {
const fallback = `Provider request failed with HTTP ${status}` const fallback = `Provider request failed with HTTP ${status}`
const text = body?.trim() ?? "" const text = body?.trim() ?? ""
const message = providerErrorMessage(text) const message = providerErrorMessage(text)
if (message) return message if (message) return message
// Gateway and proxy HTML error pages are markup, not an explanation. // Gateway and proxy HTML error pages are markup, not an explanation.
if (!text || /^<(?:!doctype|html)/i.test(text)) return `${fallback} (${request.method} ${requestTarget(request.url)})` if (!text || /^<(?:!doctype|html)/i.test(text)) return fallback
return `${fallback}: ${text.length > MAX_BODY_CHARS ? `${text.slice(0, MAX_BODY_CHARS)}…` : text}` return `${fallback}: ${text.length > MAX_BODY_CHARS ? `${text.slice(0, MAX_BODY_CHARS)}…` : text}`
} }
@ -134,16 +111,12 @@ const statusError = (response: HttpClientResponse.HttpClientResponse) =>
if (response.status < 400) return response if (response.status < 400) return response
const result = yield* response.text.pipe(Effect.result) const result = yield* response.text.pipe(Effect.result)
return yield* httpFailure({ return yield* httpFailure({
message: providerMessage( message: providerMessage(response.status, result._tag === "Success" ? result.success : undefined),
response.request,
response.status,
result._tag === "Success" ? result.success : undefined,
),
url: response.request.url, url: response.request.url,
status: response.status, status: response.status,
responseHeaders: headerDetails(response.headers), responseHeaders: headerDetails(response.headers),
responseBody: result._tag === "Success" ? result.success : undefined, responseBody: result._tag === "Success" ? result.success : undefined,
cause: result._tag === "Failure" ? rootCause(result.failure) : undefined, cause: result._tag === "Failure" ? (result.failure.cause ?? result.failure) : undefined,
}) })
}) })
@ -177,75 +150,87 @@ export const httpFailure = (input: {
}) })
} }
const timeoutDuration = (value: HttpTimeout | undefined, fallback = DEFAULT_HTTP_TIMEOUT_MS) => type HttpOperation = "request" | "read"
value === false ? Duration.infinity : Duration.millis(value ?? fallback)
const timeoutError = (url: string, operation: HttpOperation, message: string, http?: HttpContext) => const NativeTransportFailure = Schema.Struct({
new AIError({ message: Schema.String,
reason: new TransportError({ code: Schema.optionalKey(Schema.String),
message, cause: Schema.optionalKey(Schema.Unknown),
transport: "http", })
operation, const decodeNativeTransportFailure = Schema.decodeUnknownOption(NativeTransportFailure)
code: "Timeout",
url,
http,
}),
})
const bodyTimeoutError = (response: HttpClientResponse.HttpClientResponse, message: string) => const nativeTransportFailure = (error: unknown) => {
new HttpClientError.HttpClientError({ const failure = Option.getOrUndefined(decodeNativeTransportFailure(error))
reason: new HttpClientError.DecodeError({ if (!failure) return undefined
request: response.request, if (failure.code !== undefined) return failure
response, const cause = Option.getOrUndefined(decodeNativeTransportFailure(failure.cause))
cause: new Cause.TimeoutError(message), if (cause?.code !== undefined) return cause
}), return failure
})
// A response with one of these statuses has no body to re-wrap.
const NO_BODY = new Set([101, 204, 205, 304])
/**
* Re-wraps the body behind the chunk and whole-request limits, so every way of reading it (`stream`, `text`, `json`,
* `formData`, ...) fails cleanly once it stalls.
*/
const withBodyTimeouts = (
raw: HttpClientResponse.HttpClientResponse,
limits: { readonly chunk: Duration.Duration; readonly deadline: number | undefined },
): Effect.Effect<HttpClientResponse.HttpClientResponse> => {
if (NO_BODY.has(raw.status) || (!Duration.isFinite(limits.chunk) && limits.deadline === undefined))
return Effect.succeed(raw)
const chunked = raw.stream.pipe(
Stream.catchIf(
(error) => error.reason._tag === "EmptyBodyError",
() => Stream.empty,
),
Stream.timeoutOrElse({
duration: limits.chunk,
orElse: () => Stream.fail(bodyTimeoutError(raw, "Timed out waiting for response data")),
}),
)
const deadline = limits.deadline
const body =
deadline === undefined
? chunked
: Stream.unwrap(
Effect.map(Clock.currentTimeMillis, (now) =>
chunked.pipe(
Stream.interruptWhen(
Effect.sleep(Duration.millis(Math.max(0, deadline - now))).pipe(
Effect.andThen(Effect.fail(bodyTimeoutError(raw, "Timed out waiting for the response to complete"))),
),
),
),
),
)
return Stream.toReadableStreamEffect(body).pipe(
Effect.map((readable) =>
HttpClientResponse.fromWeb(raw.request, new Response(readable, { status: raw.status, headers: raw.headers })),
),
)
} }
// HTTP hooks re-wrap response bodies, so a read failure can arrive as an HttpClientError caused by
// another HttpClientError. The innermost cause carries the native failure.
const rootCause = (error: unknown): unknown =>
HttpClientError.isHttpClientError(error) && "cause" in error.reason && error.reason.cause !== undefined
? rootCause(error.reason.cause)
: error
const CONNECTION_LOST = "Connection lost while reading the response"
const httpError = (input: {
readonly error: unknown
readonly request: HttpClientRequest.HttpClientRequest
readonly operation: HttpOperation
readonly http?: HttpContext
}) => {
const request = HttpClientError.isHttpClientError(input.error) ? input.error.request : input.request
const transportError = (failure: { readonly message: string; readonly code?: string | undefined }) =>
new AIError({
reason: new TransportError({
message: failure.message,
cause: source,
http: input.http,
transport: "http",
operation: input.operation,
code: failure.code,
url: request.url,
}),
})
const source = rootCause(input.error)
const native = nativeTransportFailure(source)
const code = native?.code
const detail =
code && native?.message && !native.message.includes(code) ? `${code}: ${native.message}` : native?.message
const message = detail ?? (input.error instanceof Error ? input.error.message : undefined)
if (Cause.isTimeoutError(input.error) || Cause.isTimeoutError(source))
return transportError({ message: message ?? "HTTP transport timed out", code: code ?? "Timeout" })
if (!HttpClientError.isHttpClientError(input.error))
return transportError({ message: message ?? "HTTP transport failed", code })
// Effect reports every response body read failure as a DecodeError, but the raw byte stream decodes
// nothing: provider output parsing happens later and fails as InvalidProviderOutput.
if (input.operation === "read" && input.error.reason._tag === "DecodeError")
return transportError({ message: detail ? `${CONNECTION_LOST}: ${detail}` : CONNECTION_LOST, code })
if (input.error.reason._tag === "TransportError") {
return transportError({
message: message ?? input.error.reason.description ?? "HTTP transport failed",
code: code ?? input.error.reason._tag,
})
}
return transportError({
message: message ?? `HTTP transport failed: ${input.error.reason._tag}`,
code: code ?? input.error.reason._tag,
})
}
export const responseStream = (response: HttpClientResponse.HttpClientResponse): Stream.Stream<Uint8Array, AIError> =>
response.stream.pipe(
Stream.mapError((error) =>
httpError({ error, request: response.request, operation: "read", http: responseHttp(response) }),
),
)
export const stream = ( export const stream = (
executor: Interface, executor: Interface,
request: HttpClientRequest.HttpClientRequest, request: HttpClientRequest.HttpClientRequest,
@ -262,48 +247,28 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient> = Layer.e
Service, Service,
Effect.gen(function* () { Effect.gen(function* () {
const http = yield* HttpClient.HttpClient const http = yield* HttpClient.HttpClient
const executeOnce = ( const executeOnce = (request: HttpClientRequest.HttpClientRequest, middleware?: HttpMiddleware) =>
request: HttpClientRequest.HttpClientRequest,
middleware: HttpMiddleware | undefined,
timeout: RequestTimeout | undefined,
) =>
Effect.gen(function* () { Effect.gen(function* () {
const started = yield* Clock.currentTimeMillis if (!middleware)
const limits = timeoutConfig(timeout) return yield* http.execute(request).pipe(
// Unlike the header and chunk limits, the whole-request budget has no default. Effect.mapError((error) => httpError({ error, request, operation: "request" })),
const total = limits.total ? Duration.millis(limits.total) : Duration.infinity Effect.flatMap(statusError),
const headersLimit = Duration.min(timeoutDuration(limits.headers), total) )
const send = !middleware
? http.execute(request).pipe(Effect.mapError((error) => httpError({ error, request, operation: "request" }))) const response = yield* middleware(request, (input) =>
: middleware(request, (input) => http
http .execute(input)
.execute(input) .pipe(Effect.mapError((cause) => (cause instanceof Error ? cause : new Error(String(cause))))),
.pipe(Effect.mapError((cause) => (cause instanceof Error ? cause : new Error(String(cause))))), ).pipe(Effect.mapError((error) => httpError({ error, request, operation: "request" })))
).pipe(Effect.mapError((error) => httpError({ error, request, operation: "request" })))
const raw = yield* send.pipe(
Effect.timeoutOrElse({
duration: headersLimit,
orElse: () => Effect.fail(timeoutError(request.url, "request", "Timed out waiting for response headers")),
}),
)
const deadline = Duration.isFinite(total) ? started + Duration.toMillis(total) : undefined
const response = yield* withBodyTimeouts(raw, {
chunk: timeoutDuration(limits.chunk, DEFAULT_CHUNK_TIMEOUT_MS),
deadline,
})
return yield* statusError(response) return yield* statusError(response)
}) })
return Service.of({ return Service.of({
// Scoped middleware and timeouts are cleared while the request runs, so a request a middleware makes itself // Scoped middleware runs outside per-call middleware. It is cleared while the request runs, so a request a
// isn't wrapped again and starts with default timeouts. // middleware makes itself isn't wrapped again.
execute: (request, next) => execute: (request, next) =>
Effect.gen(function* () { Effect.gen(function* () {
const middleware = composeMiddleware(yield* CurrentMiddleware, next) const middleware = composeMiddleware(yield* CurrentMiddleware, next)
const timeout = yield* CurrentTimeout return yield* executeOnce(request, middleware).pipe(Effect.provideService(CurrentMiddleware, undefined))
return yield* executeOnce(request, middleware, timeout).pipe(
Effect.provideService(CurrentMiddleware, undefined),
Effect.provideService(CurrentTimeout, undefined),
)
}), }),
}) })
}), }),
@ -318,15 +283,6 @@ export const fetchLayer = layer.pipe(Layer.provide(FetchHttpClient.layer))
export const withTls = (execute: Interface["execute"], tls: ClientTls | undefined): Interface["execute"] => export const withTls = (execute: Interface["execute"], tls: ClientTls | undefined): Interface["execute"] =>
tls ? (request, middleware) => execute(request, middleware).pipe(Effect.provideService(CurrentTls, tls)) : execute tls ? (request, middleware) => execute(request, middleware).pipe(Effect.provideService(CurrentTls, tls)) : execute
/** Sends through `execute` with `timeout` applied to the request and its response body. */
export const withTimeout = (
execute: Interface["execute"],
timeout: RequestTimeout | undefined,
): Interface["execute"] =>
timeout === undefined
? execute
: (request, middleware) => execute(request, middleware).pipe(Effect.provideService(CurrentTimeout, timeout))
/** /**
* Per-call middleware that sends through `fetch` instead of the executor's HTTP client. Executor middleware and * Per-call middleware that sends through `fetch` instead of the executor's HTTP client. Executor middleware and
* `middleware` still wrap the call, and status classification still applies. * `middleware` still wrap the call, and status classification still applies.

View file

@ -206,6 +206,15 @@ export const identity = (input: { readonly id: string; readonly name: string; re
const provider = ProviderID.make(input.provider) const provider = ProviderID.make(input.provider)
const frameError = (message: string, body?: string, cause?: unknown) => const frameError = (message: string, body?: string, cause?: unknown) =>
new AIError({ reason: new InvalidProviderOutputError({ route: input.id, message, body, cause }) }) new AIError({ reason: new InvalidProviderOutputError({ route: input.id, message, body, cause }) })
const readError = (http: HttpContext) => (cause: unknown) =>
new AIError({
reason: new InvalidProviderOutputError({
route: input.id,
message: `Failed to read the ${input.name} response`,
http,
cause,
}),
})
/** /**
* Read a text body while retaining the original payload and HTTP context on every downstream error. `invalid` is a * Read a text body while retaining the original payload and HTTP context on every downstream error. `invalid` is a
@ -216,7 +225,7 @@ export const identity = (input: { readonly id: string; readonly name: string; re
*/ */
const text = Effect.fn("MediaProtocol.text")(function* (response: HttpClientResponse.HttpClientResponse) { const text = Effect.fn("MediaProtocol.text")(function* (response: HttpClientResponse.HttpClientResponse) {
const http = RequestExecutor.responseHttp(response) const http = RequestExecutor.responseHttp(response)
const body = yield* RequestExecutor.responseText(response) const body = yield* response.text.pipe(Effect.mapError(readError(http)))
return { return {
body, body,
http, http,
@ -254,7 +263,11 @@ export const identity = (input: { readonly id: string; readonly name: string; re
} }
/** Read a raw binary body, for providers that answer with the media bytes themselves. */ /** Read a raw binary body, for providers that answer with the media bytes themselves. */
const bytes = RequestExecutor.responseBytes const bytes = (response: HttpClientResponse.HttpClientResponse) =>
response.arrayBuffer.pipe(
Effect.map((buffer) => new Uint8Array(buffer)),
Effect.mapError(readError(RequestExecutor.responseHttp(response))),
)
return { return {
id: input.id, id: input.id,

View file

@ -16,9 +16,8 @@ import {
mergeProviderOptions, mergeProviderOptions,
mergeTransport, mergeTransport,
type BaseRequest, type BaseRequest,
type HttpOptions,
type ProviderOptions, type ProviderOptions,
type RequestTimeout,
type TransportOptions,
} from "../schema/index.js" } from "../schema/index.js"
import { encodeJson } from "../utils/json.js" import { encodeJson } from "../utils/json.js"
import { sanitizeSurrogates } from "../utils/sanitize.js" import { sanitizeSurrogates } from "../utils/sanitize.js"
@ -29,29 +28,29 @@ export type Execute = Interface["execute"]
export type MediaRequest = BaseRequest<{ export type MediaRequest = BaseRequest<{
readonly id: string readonly id: string
readonly provider: ProviderID readonly provider: ProviderID
readonly transport?: TransportOptions readonly http?: HttpOptions
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
}> }>
/** What every HTTP exchange of one generation shares. */ /** What every HTTP exchange of one generation shares. */
type Exchange = Pick<MediaRequest, "headers" | "timeout" | "http" | "fetch"> type Exchange = Pick<MediaRequest, "headers" | "http" | "fetch">
/** Deployment inputs every media model factory accepts; provider facades fill these from `configure(...)`. */ /** Deployment inputs every media model factory accepts; provider facades fill these from `configure(...)`. */
export interface ModelInput { export interface ModelInput {
readonly id: string readonly id: string
readonly auth: Auth.Definition readonly auth: Auth.Definition
readonly baseURL?: string readonly baseURL?: string
/** Deployment headers, timeouts and `http` overlays every request of the model starts from. */ readonly headers?: Record<string, string>
readonly transport?: TransportOptions readonly http?: HttpOptions
/** Defaults under each request's `providerOptions`. */ /** Defaults under each request's `providerOptions`. */
readonly providerOptions?: ProviderOptions readonly providerOptions?: ProviderOptions
} }
/** A provider facade's `configure(...)` input as the `ModelInput` every media selector shares, minus the model id. */ /** A provider facade's `configure(...)` input as the `ModelInput` every media selector shares, minus the model id. */
export const deployment = ( export const deployment = (
input: TransportOptions & { readonly baseURL?: string }, input: { readonly baseURL?: string; readonly headers?: Record<string, string>; readonly http?: HttpOptions },
auth: Auth.Definition, auth: Auth.Definition,
): Omit<ModelInput, "id"> => ({ auth, baseURL: input.baseURL, transport: mergeTransport(input) }) ): Omit<ModelInput, "id"> => ({ auth, baseURL: input.baseURL, headers: input.headers, http: input.http })
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Routes // Routes
@ -105,7 +104,7 @@ export type AnyRoute<Request extends MediaRequest, Event, Response> =
export interface Composition<Request extends MediaRequest> { export interface Composition<Request extends MediaRequest> {
readonly endpoint: Endpoint.Definition<MediaProtocol.Body, Request> readonly endpoint: Endpoint.Definition<MediaProtocol.Body, Request>
readonly auth: Auth.Definition readonly auth: Auth.Definition
/** Headers the protocol requires on every call; the model's transport headers win. */ /** Deployment headers applied before transport authentication. */
readonly headers?: Record<string, string> readonly headers?: Record<string, string>
} }
@ -344,7 +343,6 @@ const makeTransport = <Request extends MediaRequest>(
readonly headers: Headers.Headers readonly headers: Headers.Headers
readonly request: AuthInput["request"] readonly request: AuthInput["request"]
readonly body?: MediaProtocol.Body readonly body?: MediaProtocol.Body
readonly timeout?: RequestTimeout
}, },
fetch: typeof globalThis.fetch | undefined, fetch: typeof globalThis.fetch | undefined,
execute: Execute, execute: Execute,
@ -358,10 +356,7 @@ const makeTransport = <Request extends MediaRequest>(
body: encoded.text, body: encoded.text,
headers: encoded.headers, headers: encoded.headers,
}) })
const response = yield* RequestExecutor.withTimeout( const response = yield* RequestExecutor.withTls(execute, call.request.http?.tls)(
RequestExecutor.withTls(execute, call.request.http?.tls),
call.timeout,
)(
encoded.apply(HttpClientRequest.make(call.method)(url).pipe(HttpClientRequest.setHeaders(headers))), encoded.apply(HttpClientRequest.make(call.method)(url).pipe(HttpClientRequest.setHeaders(headers))),
RequestExecutor.withFetch(fetch), RequestExecutor.withFetch(fetch),
) )
@ -369,7 +364,7 @@ const makeTransport = <Request extends MediaRequest>(
}) })
return { return {
/** Route and model overlays; `start` additionally merges the request's own. */ /** Route and model overlays; `start` additionally merges the request's own. */
exchange: (model: MediaRequest["model"]): Exchange => mergeTransport({ headers: input.headers }, model.transport), exchange: (model: MediaRequest["model"]): Exchange => mergeTransport({ headers: input.headers, http: model.http }),
/** POST the protocol body to the route endpoint. */ /** POST the protocol body to the route endpoint. */
submit: Effect.fn("MediaRoute.submit")(function* ( submit: Effect.fn("MediaRoute.submit")(function* (
request: Request, request: Request,
@ -381,12 +376,8 @@ const makeTransport = <Request extends MediaRequest>(
execute: Execute, execute: Execute,
) { ) {
yield* rejectUnsupported(input.protocol.id, input.protocol.provider, request, protocol.unsupported) yield* rejectUnsupported(input.protocol.id, input.protocol.provider, request, protocol.unsupported)
const { const { headers: merged, http } = mergeTransport({ headers: input.headers, http: request.model.http }, request)
headers: merged, const exchange = { headers: merged, http, fetch: request.fetch }
timeout,
http,
} = mergeTransport({ headers: input.headers }, request.model.transport, request)
const exchange = { headers: merged, timeout, http, fetch: request.fetch }
const providerOptions = mergeProviderOptions(request.model.providerOptions, request.providerOptions) const providerOptions = mergeProviderOptions(request.model.providerOptions, request.providerOptions)
const headers = Headers.fromInput(merged) const headers = Headers.fromInput(merged)
const prepared = const prepared =
@ -394,7 +385,7 @@ const makeTransport = <Request extends MediaRequest>(
? request ? request
: yield* protocol.prepare(request, (path, body) => : yield* protocol.prepare(request, (path, body) =>
send( send(
{ method: "POST", url: baseURL(path), headers, request: { ...request, http }, body, timeout }, { method: "POST", url: baseURL(path), headers, request: { ...request, http }, body },
request.fetch, request.fetch,
execute, execute,
).pipe(Effect.map((sent) => sent.response)), ).pipe(Effect.map((sent) => sent.response)),
@ -412,11 +403,7 @@ const makeTransport = <Request extends MediaRequest>(
), ),
http?.query, http?.query,
) )
const sent = yield* send( const sent = yield* send({ method: "POST", url, headers, request: resolved, body }, request.fetch, execute)
{ method: "POST", url, headers, request: resolved, body, timeout },
request.fetch,
execute,
)
return { response: sent.response, context: { request: resolved, body }, exchange } return { response: sent.response, context: { request: resolved, body }, exchange }
}), }),
/** /**
@ -439,11 +426,7 @@ const makeTransport = <Request extends MediaRequest>(
const url = withQuery(/^https?:\/\//.test(path) ? new URL(path) : baseURL(path), exchange.http?.query) const url = withQuery(/^https?:\/\//.test(path) ? new URL(path) : baseURL(path), exchange.http?.query)
for (const [key, value] of Object.entries(input.endpoint.query ?? {})) url.searchParams.set(key, value) for (const [key, value] of Object.entries(input.endpoint.query ?? {})) url.searchParams.set(key, value)
const headers = Headers.fromInput(exchange.headers) const headers = Headers.fromInput(exchange.headers)
return send( return send({ method, url, headers, request: { http: exchange.http } }, exchange.fetch, execute)
{ method, url, headers, request: { http: exchange.http }, timeout: exchange.timeout },
exchange.fetch,
execute,
)
}, },
} }
} }

View file

@ -1,6 +1,5 @@
import { Schema, type Effect } from "effect" import { Schema, type Effect } from "effect"
import type { AIError, LanguageModelSanitizerCompatibility, LLMEvent, LLMRequest, ProtocolID } from "../schema/index.js" import type { AIError, LanguageModelSanitizerCompatibility, LLMEvent, LLMRequest, ProtocolID } from "../schema/index.js"
import { flattenRequest } from "../protocols/shared.js"
import type { ToolUpdateEncoding } from "../tool-updates.js" import type { ToolUpdateEncoding } from "../tool-updates.js"
/** /**
@ -47,8 +46,6 @@ export interface Protocol<Body, Frame, Event, State> {
readonly supportsEffortUpdates?: (request: LLMRequest) => boolean readonly supportsEffortUpdates?: (request: LLMRequest) => boolean
/** Tool changes `body.from` can send in place of `Message.tools(...)` markers; wrappers around another `body.from` must forward it. */ /** Tool changes `body.from` can send in place of `Message.tools(...)` markers; wrappers around another `body.from` must forward it. */
readonly toolUpdates?: ToolUpdateEncoding readonly toolUpdates?: ToolUpdateEncoding
/** Whether `body.from` sends tool namespaces natively; otherwise `make` hands it flattened requests. Wrappers around another `body.from` must forward it. */
readonly namespaces?: boolean
/** Tool schema sanitizer for every model on this protocol unless the model's compatibility sets one; wrappers around another `body.from` must forward it. */ /** Tool schema sanitizer for every model on this protocol unless the model's compatibility sets one; wrappers around another `body.from` must forward it. */
readonly sanitizer?: LanguageModelSanitizerCompatibility readonly sanitizer?: LanguageModelSanitizerCompatibility
} }
@ -87,10 +84,7 @@ export interface ProtocolStream<Frame, Event, State> {
*/ */
export const make = <Body, Frame, Event, State>( export const make = <Body, Frame, Event, State>(
input: Protocol<Body, Frame, Event, State>, input: Protocol<Body, Frame, Event, State>,
): Protocol<Body, Frame, Event, State> => ): Protocol<Body, Frame, Event, State> => input
input.namespaces
? input
: { ...input, body: { ...input.body, from: (request) => input.body.from(flattenRequest(request)) } }
export const jsonEvent = <const S extends Schema.Top>(schema: S) => Schema.fromJsonString(schema) export const jsonEvent = <const S extends Schema.Top>(schema: S) => Schema.fromJsonString(schema)

View file

@ -1,11 +1,21 @@
import { Effect } from "effect" import { Clock, Duration, Effect, Stream } from "effect"
import { Headers, HttpClientRequest } from "effect/http" import { Headers, HttpClientRequest } from "effect/http"
import { Auth } from "../auth.js" import { Auth } from "../auth.js"
import { render as renderEndpoint } from "../endpoint.js" import { render as renderEndpoint } from "../endpoint.js"
import { Framing } from "../framing.js" import { Framing } from "../framing.js"
import type { HttpMiddleware, Transport, TransportPrepareInput } from "./index.js" import type { HttpMiddleware, Transport, TransportPrepareInput } from "./index.js"
import * as ProviderShared from "../../protocols/shared.js" import * as ProviderShared from "../../protocols/shared.js"
import { mergeJsonRecords, type LLMRequest } from "../../schema/index.js" import {
AIError,
DEFAULT_CHUNK_TIMEOUT_MS,
DEFAULT_HTTP_TIMEOUT_MS,
mergeJsonRecords,
timeoutConfig,
TransportError,
type HttpContext,
type HttpTimeout,
type LLMRequest,
} from "../../schema/index.js"
import { RequestExecutor } from "../executor.js" import { RequestExecutor } from "../executor.js"
export type JsonRequestInput<Body> = TransportPrepareInput<Body> export type JsonRequestInput<Body> = TransportPrepareInput<Body>
@ -84,19 +94,56 @@ export const httpJson = <Body, Frame>(input: HttpJsonInput<Body, Frame>): HttpJs
}), }),
execute: (prepared, request, runtime) => execute: (prepared, request, runtime) =>
Effect.gen(function* () { Effect.gen(function* () {
const response = yield* RequestExecutor.withTimeout( const timeout = (operation: "request" | "read", message: string, http?: HttpContext) =>
RequestExecutor.withTls(runtime.http.execute, request.http?.tls), new AIError({
request.timeout, reason: new TransportError({
)(prepared.request, prepared.middleware) message,
transport: "http",
operation,
code: "Timeout",
url: prepared.request.url,
http,
}),
})
const started = yield* Clock.currentTimeMillis
const limits = timeoutConfig(request.timeout)
// Unlike the header and chunk limits, the whole-request budget has no default.
const total = limits.total ? Duration.millis(limits.total) : Duration.infinity
const response = yield* RequestExecutor.withTls(runtime.http.execute, request.http?.tls)(
prepared.request,
prepared.middleware,
).pipe(
Effect.timeoutOrElse({
duration: Duration.min(timeoutDuration(limits.headers), total),
orElse: () => timeout("request", "Timed out waiting for response headers"),
}),
)
const http = RequestExecutor.responseHttp(response)
const remaining = Duration.subtract(total, Duration.millis((yield* Clock.currentTimeMillis) - started))
return { return {
frames: prepared.framing.frame(RequestExecutor.responseStream(response)), frames: prepared.framing.frame(
http: RequestExecutor.responseHttp(response), RequestExecutor.responseStream(response).pipe(
Stream.timeoutOrElse({
duration: timeoutDuration(limits.chunk, DEFAULT_CHUNK_TIMEOUT_MS),
orElse: () => Stream.fail(timeout("read", "Timed out waiting for response data", http)),
}),
Stream.interruptWhen(
Effect.sleep(remaining).pipe(
Effect.andThen(Effect.fail(timeout("read", "Timed out waiting for the response to complete", http))),
),
),
),
),
http,
body: prepared.framing.body, body: prepared.framing.body,
raw: prepared.framing.raw, raw: prepared.framing.raw,
} }
}), }),
}) })
const timeoutDuration = (value: HttpTimeout | undefined, fallback = DEFAULT_HTTP_TIMEOUT_MS) =>
value === false ? Duration.infinity : Duration.millis(value ?? fallback)
export const sseJson = { export const sseJson = {
id: "http-json/sse", id: "http-json/sse",
with: <Body>() => httpJson<Body, string>({ framing: Framing.sse }), with: <Body>() => httpJson<Body, string>({ framing: Framing.sse }),

Some files were not shown because too many files have changed in this diff Show more