import { atom, map } from 'nanostores'; import { workbenchStore } from './workbench'; import { PROVIDER_LIST } from '~/utils/constants'; import type { IProviderConfig } from '~/types/model'; export interface Shortcut { key: string; ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; ctrlOrMetaKey?: boolean; action: () => void; } export interface Shortcuts { toggleTerminal: Shortcut; } export const URL_CONFIGURABLE_PROVIDERS = ['Ollama', 'LMStudio', 'OpenAILike']; export const LOCAL_PROVIDERS = ['OpenAILike', 'LMStudio', 'Ollama']; export type ProviderSetting = Record; export const shortcutsStore = map({ toggleTerminal: { key: 'j', ctrlOrMetaKey: true, action: () => workbenchStore.toggleTerminal(), }, }); const initialProviderSettings: ProviderSetting = {}; PROVIDER_LIST.forEach((provider) => { initialProviderSettings[provider.name] = { ...provider, settings: { enabled: false, }, }; }); export const providersStore = map(initialProviderSettings); export const isDebugMode = atom(false); export const isLocalModelsEnabled = atom(true);