mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Merge dev: STT feature, git date fixes, and session improvements (#82)
* fix session last active * Feature/sst (#81) * Use CSS field-sizing for textarea auto-height and abort STT recording on clear * Fix invalid date display in git commits * Use Unix timestamps for git log dates
This commit is contained in:
1 parent
21010956f7
commit
cb1714a4e0
17 files changed
+2475
-76
No files matched your search
@@ -20,6 +20,18 @@ export const TTSConfigSchema = z.object({
|
||||
lastModelsFetch: z.number().optional(),
|
||||
});
|
||||
|
||||
export const STTConfigSchema = z.object({
|
||||
enabled: z.boolean(),
|
||||
provider: z.enum(['external', 'builtin']).default('builtin'),
|
||||
endpoint: z.string(),
|
||||
apiKey: z.string(),
|
||||
model: z.string(),
|
||||
language: z.string().default('en-US'),
|
||||
continuous: z.boolean().default(false),
|
||||
availableModels: z.array(z.string()).optional(),
|
||||
lastModelsFetch: z.number().optional(),
|
||||
});
|
||||
|
||||
export const CustomAgentSchema = z.object({
|
||||
name: z.string(),
|
||||
description: z.string(),
|
||||
@@ -40,6 +52,18 @@ export type TTSConfig = {
|
||||
lastModelsFetch?: number;
|
||||
};
|
||||
|
||||
export type STTConfig = {
|
||||
enabled: boolean;
|
||||
provider: 'external' | 'builtin';
|
||||
endpoint: string;
|
||||
apiKey: string;
|
||||
model: string;
|
||||
language: string;
|
||||
continuous: boolean;
|
||||
availableModels?: string[];
|
||||
lastModelsFetch?: number;
|
||||
};
|
||||
|
||||
const isBrowser = typeof navigator !== 'undefined';
|
||||
const isMac = isBrowser && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||
const CMD_KEY = isMac ? 'Cmd' : 'Ctrl';
|
||||
@@ -101,6 +125,7 @@ export const UserPreferencesSchema = z.object({
|
||||
gitCredentials: z.array(GitCredentialSchema).optional(),
|
||||
gitIdentity: GitIdentitySchema.optional(),
|
||||
tts: TTSConfigSchema.optional(),
|
||||
stt: STTConfigSchema.optional(),
|
||||
lastKnownGoodConfig: z.string().optional(),
|
||||
repoOrder: z.array(z.number()).optional(),
|
||||
});
|
||||
@@ -119,6 +144,18 @@ export const DEFAULT_TTS_CONFIG: TTSConfig = {
|
||||
lastModelsFetch: 0,
|
||||
};
|
||||
|
||||
export const DEFAULT_STT_CONFIG: STTConfig = {
|
||||
enabled: false,
|
||||
provider: 'builtin',
|
||||
endpoint: "https://api.openai.com",
|
||||
apiKey: "",
|
||||
model: '',
|
||||
language: 'en-US',
|
||||
continuous: false,
|
||||
availableModels: [],
|
||||
lastModelsFetch: 0,
|
||||
};
|
||||
|
||||
export const DEFAULT_USER_PREFERENCES = {
|
||||
theme: "dark" as const,
|
||||
mode: "build" as const,
|
||||
@@ -134,6 +171,7 @@ export const DEFAULT_USER_PREFERENCES = {
|
||||
gitCredentials: [] as GitCredential[],
|
||||
gitIdentity: DEFAULT_GIT_IDENTITY,
|
||||
tts: DEFAULT_TTS_CONFIG,
|
||||
stt: DEFAULT_STT_CONFIG,
|
||||
};
|
||||
|
||||
export const SettingsResponseSchema = z.object({
|
||||
|
||||
Reference in new issue
Block a user