feat: remove legacy OpenCode runtime
Cut product flows over to Coding/Pi and retain only the migration-owned v1 boundary. Promote supported native optional packages because electron-builder omitted pnpm transitive optional closure from the packaged ASAR.
This commit is contained in:
1 parent
61fede2b4d
commit
5a275b93a7
199 files changed
+1330
-64725
No files matched your search
@@ -1,6 +1,4 @@
|
||||
import type { ProviderAccount, ProviderVendorInfo, ProviderWithKeyInfo } from '@/lib/providers';
|
||||
import type { OpencodeRuntimeConfigSummary } from '@/types/opencode';
|
||||
import { resolveOpencodeProviderId } from '../../shared/opencode-provider-id';
|
||||
import {
|
||||
getKnownModelCapabilityKind,
|
||||
getModelCapabilityLabel,
|
||||
@@ -29,7 +27,7 @@ export interface RuntimeProviderOption {
|
||||
}
|
||||
|
||||
export function resolveRuntimeProviderKey(account: ProviderAccount): string {
|
||||
return resolveOpencodeProviderId(account);
|
||||
return account.id;
|
||||
}
|
||||
|
||||
export function splitModelRef(modelRef: string | null | undefined): { providerKey: string; modelId: string } | null {
|
||||
@@ -54,18 +52,14 @@ export function toModelOptionTestId(label: string): string {
|
||||
|
||||
export function getConfiguredModelCapability(
|
||||
option: ConfiguredModelOption,
|
||||
runtimeSummary?: OpencodeRuntimeConfigSummary | null,
|
||||
): ModelCapabilityKind {
|
||||
const provider = runtimeSummary?.providers?.find((item) => item.id === option.runtimeProviderKey);
|
||||
if (!provider || !Array.isArray(provider.imageInputModelIds)) return option.capability;
|
||||
return provider.imageInputModelIds.includes(option.label) ? 'multimodal' : 'text';
|
||||
return option.capability;
|
||||
}
|
||||
|
||||
export function getConfiguredModelCapabilityLabel(
|
||||
option: ConfiguredModelOption,
|
||||
runtimeSummary?: OpencodeRuntimeConfigSummary | null,
|
||||
): string {
|
||||
return getModelCapabilityLabel(getConfiguredModelCapability(option, runtimeSummary));
|
||||
return getModelCapabilityLabel(getConfiguredModelCapability(option));
|
||||
}
|
||||
|
||||
export function hasConfiguredProviderCredentials(
|
||||
|
||||
Reference in new issue
Block a user