refactor(core): move v1 schemas into core (#30473)

This commit is contained in:
Dax
2026-06-02 22:42:13 -04:00
committed by GitHub
parent 2c16b222fc
commit fbda5fadda
129 changed files with 1578 additions and 1227 deletions
+5 -4
View File
@@ -1,12 +1,13 @@
import type { Config } from "@/config/config"
import { SessionLegacy } from "@opencode-ai/core/session/legacy"
import { ConfigV1 } from "@opencode-ai/core/v1/config/config"
import { SessionV1 } from "@opencode-ai/core/v1/session"
import type { Provider } from "@/provider/provider"
import { ProviderTransform } from "@/provider/transform"
import type { MessageV2 } from "./message-v2"
const COMPACTION_BUFFER = 20_000
export function usable(input: { cfg: Config.Info; model: Provider.Model; outputTokenMax?: number }) {
export function usable(input: { cfg: ConfigV1.Info; model: Provider.Model; outputTokenMax?: number }) {
const context = input.model.limit.context
if (context === 0) return 0
@@ -19,8 +20,8 @@ export function usable(input: { cfg: Config.Info; model: Provider.Model; outputT
}
export function isOverflow(input: {
cfg: Config.Info
tokens: SessionLegacy.Assistant["tokens"]
cfg: ConfigV1.Info
tokens: SessionV1.Assistant["tokens"]
model: Provider.Model
outputTokenMax?: number
}) {