// User-facing capability state deliberately hides model providers, revisions and
// runtime details. Those remain available through the advanced diagnostics UI.
export function toUserCapabilityState(model) {
    const status = model.executionPath === "unsupported" ? "unsupported"
        : model.status === "已缓存" ? "ready"
            : model.status === "下载中" ? "downloading"
                : model.status === "缓存损坏" ? "corrupt"
                    : model.status === "下载失败" || model.status === "查询失败" || model.status === "删除失败" ? "failed"
                        : "download_required";
    return {
        status,
        ...(model.totalBytes ? { totalBytes: model.totalBytes } : {}),
        ...(model.downloadedBytes !== undefined ? { downloadedBytes: model.downloadedBytes } : {}),
        canDownload: model.canDownload === true,
    };
}
