Add GitHub token validation and improve TTS configuration

- Add git token validation endpoint and UI validation
- Improve TTS endpoint normalization and discovery
- Move shared types to workspace package
- Add better error handling for TTS API calls
- Support composite voices for Kokoro-style TTS
- Auto-fetch TTS models and voices on config change
This commit is contained in:
Chris Scott committed 2025-12-15 14:43:03 -05:00
1 parent 406ff8fd4a
commit c7de65290a
11 files changed
+410 -154

No files matched your search

+2 -2
View File
@@ -27,7 +27,7 @@ export const ProviderAuthMethodSchema = z.object({
label: z.string(),
});
export const ProviderAuthMethodsSchema = z.record(z.array(ProviderAuthMethodSchema));
export const ProviderAuthMethodsSchema = z.record(z.string(), z.array(ProviderAuthMethodSchema));
export const OAuthAuthorizeRequestSchema = z.object({
method: z.number(),
@@ -45,5 +45,5 @@ export const OAuthCallbackRequestSchema = z.object({
});
export const ProviderAuthMethodsResponseSchema = z.object({
providers: z.record(z.array(ProviderAuthMethodSchema)),
providers: z.record(z.string(), z.array(ProviderAuthMethodSchema)),
});
+33 -11
View File
@@ -25,15 +25,37 @@ export const CustomAgentSchema = z.object({
config: z.record(z.string(), z.any()),
});
export const DEFAULT_KEYBOARD_SHORTCUTS = {
submit: "shift+Enter",
abort: "Escape",
undo: "ctrl+Z",
redo: "ctrl+R",
compact: "ctrl",
newSession: "ctrl+N",
toggleMode: "Tab",
selectModel: "ctrl+M",
export type TTSConfig = {
enabled: boolean;
endpoint: string;
apiKey: string;
voice: string;
model: string;
speed: number;
availableVoices?: string[];
availableModels?: string[];
lastVoicesFetch?: number;
lastModelsFetch?: number;
};
const isBrowser = typeof navigator !== 'undefined';
const isMac = isBrowser && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
const CMD_KEY = isMac ? 'Cmd' : 'Ctrl';
export const DEFAULT_KEYBOARD_SHORTCUTS: Record<string, string> = {
submit: `${CMD_KEY}+Enter`,
abort: 'Escape',
toggleMode: 'Tab',
undo: `${CMD_KEY}+Z`,
redo: `${CMD_KEY}+Shift+Z`,
compact: `${CMD_KEY}+K`,
fork: `${CMD_KEY}+Shift+F`,
settings: `${CMD_KEY}+,`,
sessions: `${CMD_KEY}+S`,
newSession: `${CMD_KEY}+N`,
closeSession: `${CMD_KEY}+W`,
toggleSidebar: `${CMD_KEY}+B`,
selectModel: `${CMD_KEY}+M`,
};
export const UserPreferencesSchema = z.object({
@@ -51,9 +73,9 @@ export const UserPreferencesSchema = z.object({
tts: TTSConfigSchema.optional(),
});
export const DEFAULT_TTS_CONFIG = {
export const DEFAULT_TTS_CONFIG: TTSConfig = {
enabled: false,
endpoint: "https://api.openai.com/v1/audio/speech",
endpoint: "https://api.openai.com",
apiKey: "",
voice: "alloy",
model: "tts-1",