e15461febc
- remove bundled snapshot dependency on src/generated in model-core - make shared harness provide runtime bundled snapshot - update guardrail and capability tests to pass explicit snapshot Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import {
|
|
getBundledModelCapabilitiesSnapshot,
|
|
getModelCapabilities as getModelCapabilitiesFromCore,
|
|
} from "@oh-my-opencode/model-core"
|
|
import type { GetModelCapabilitiesInput, ModelCapabilities } from "@oh-my-opencode/model-core"
|
|
import * as connectedProvidersCache from "../connected-providers-cache"
|
|
import bundledModelCapabilitiesSnapshotJson from "../../generated/model-capabilities.generated.json"
|
|
|
|
export function getBundledModelCapabilitiesSnapshotForRuntime() {
|
|
return getBundledModelCapabilitiesSnapshot(bundledModelCapabilitiesSnapshotJson)
|
|
}
|
|
|
|
export function getBundledModelCapabilitiesSnapshotForShared(): ReturnType<typeof getBundledModelCapabilitiesSnapshotForRuntime> {
|
|
return getBundledModelCapabilitiesSnapshotForRuntime()
|
|
}
|
|
|
|
export { getBundledModelCapabilitiesSnapshotForShared as getBundledModelCapabilitiesSnapshot }
|
|
|
|
export function getModelCapabilities(input: GetModelCapabilitiesInput): ModelCapabilities {
|
|
return getModelCapabilitiesFromCore({
|
|
...input,
|
|
bundledSnapshot: input.bundledSnapshot ?? getBundledModelCapabilitiesSnapshotForRuntime(),
|
|
providerCache: input.providerCache ?? connectedProvidersCache,
|
|
})
|
|
}
|
|
export type {
|
|
GetModelCapabilitiesInput,
|
|
ModelCapabilities,
|
|
ModelCapabilitiesDiagnostics,
|
|
ModelCapabilitiesSnapshot,
|
|
ModelCapabilitiesSnapshotEntry,
|
|
} from "@oh-my-opencode/model-core"
|