Drop the summaryModel preference (and the awkward textfield holding a raw model ID nobody could discover without poking the SDK types). Each AI view now controls its model dropdown, loads the shared velum.ai.last-model on mount, and writes it back on submit — so picking Claude 4.7 Opus in the summarize command becomes the prefilled default in briefing, action-items, structured-data, and reply next time around. Also drops 'model' from ReplyDefaults; the shared key supersedes it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
102 lines
4.8 KiB
TypeScript
102 lines
4.8 KiB
TypeScript
import { LocalStorage } from "@raycast/api";
|
|
|
|
export type Creativity = "none" | "low" | "medium" | "high";
|
|
|
|
export const CREATIVITY_OPTIONS: Creativity[] = [
|
|
"none",
|
|
"low",
|
|
"medium",
|
|
"high",
|
|
];
|
|
|
|
export type ModelOption = { value: string; title: string };
|
|
|
|
export const MODEL_OPTIONS: ModelOption[] = [
|
|
{ value: "anthropic-claude-opus-4-7", title: "Claude 4.7 Opus" },
|
|
{ value: "anthropic-claude-sonnet-4-6", title: "Claude 4.6 Sonnet" },
|
|
{ value: "anthropic-claude-opus-4-6", title: "Claude 4.6 Opus" },
|
|
{ value: "anthropic-claude-sonnet-4-5", title: "Claude 4.5 Sonnet" },
|
|
{ value: "anthropic-claude-opus-4-5", title: "Claude 4.5 Opus" },
|
|
{ value: "anthropic-claude-4-5-haiku", title: "Claude 4.5 Haiku" },
|
|
{ value: "anthropic-claude-sonnet-4", title: "Claude 4 Sonnet" },
|
|
{ value: "openai-gpt-5.4", title: "OpenAI GPT-5.4" },
|
|
{ value: "openai-gpt-5.4-mini", title: "OpenAI GPT-5.4 Mini" },
|
|
{ value: "openai-gpt-5.4-nano", title: "OpenAI GPT-5.4 Nano" },
|
|
{ value: "openai-gpt-5.3-instant", title: "OpenAI GPT-5.3 Instant" },
|
|
{ value: "openai-gpt-5.3-codex", title: "OpenAI GPT-5.3 Codex" },
|
|
{ value: "openai-gpt-5.2", title: "OpenAI GPT-5.2" },
|
|
{ value: "openai-gpt-5.2-instant", title: "OpenAI GPT-5.2 Instant" },
|
|
{ value: "openai-gpt-5.1", title: "OpenAI GPT-5.1" },
|
|
{ value: "openai-gpt-5.1-instant", title: "OpenAI GPT-5.1 Instant" },
|
|
{ value: "openai-gpt-5.1-codex", title: "OpenAI GPT-5.1 Codex" },
|
|
{ value: "openai_o1-gpt-5", title: "OpenAI GPT-5" },
|
|
{ value: "openai-gpt-5-mini", title: "OpenAI GPT-5 Mini" },
|
|
{ value: "openai-gpt-5-nano", title: "OpenAI GPT-5 Nano" },
|
|
{ value: "openai-gpt-4.1", title: "OpenAI GPT-4.1" },
|
|
{ value: "openai-gpt-4.1-mini", title: "OpenAI GPT-4.1 Mini" },
|
|
{ value: "openai-gpt-4.1-nano", title: "OpenAI GPT-4.1 Nano" },
|
|
{ value: "openai-gpt-4o", title: "OpenAI GPT-4o" },
|
|
{ value: "openai-gpt-4o-mini", title: "OpenAI GPT-4o mini" },
|
|
{ value: "openai_o1-o3", title: "OpenAI o3" },
|
|
{ value: "openai_o1-o3-mini", title: "OpenAI o3-mini" },
|
|
{ value: "openai_o1-o4-mini", title: "OpenAI o4-mini" },
|
|
{ value: "openai_o1-o1", title: "OpenAI o1" },
|
|
{ value: "google-gemini-3.1-pro", title: "Google Gemini 3.1 Pro" },
|
|
{ value: "google-gemini-3-flash", title: "Google Gemini 3 Flash" },
|
|
{
|
|
value: "google-gemini-3.1-flash-lite",
|
|
title: "Google Gemini 3.1 Flash Lite",
|
|
},
|
|
{ value: "google-gemini-2.5-pro", title: "Google Gemini 2.5 Pro" },
|
|
{ value: "google-gemini-2.5-flash", title: "Google Gemini 2.5 Flash" },
|
|
{
|
|
value: "google-gemini-2.5-flash-lite",
|
|
title: "Google Gemini 2.5 Flash Lite",
|
|
},
|
|
{ value: "xai-grok-4.20", title: "xAI Grok 4.20" },
|
|
{ value: "xai-grok-4", title: "xAI Grok 4" },
|
|
{ value: "xai-grok-4-fast", title: "xAI Grok 4 Fast" },
|
|
{ value: "xai-grok-4-1-fast", title: "xAI Grok 4.1 Fast" },
|
|
{ value: "xai-grok-code-fast", title: "xAI Grok Code Fast" },
|
|
{ value: "perplexity-sonar-pro", title: "Perplexity Sonar Pro" },
|
|
{ value: "perplexity-sonar", title: "Perplexity Sonar" },
|
|
{ value: "mistral-mistral-large-latest", title: "Mistral Large" },
|
|
{ value: "mistral-mistral-medium-latest", title: "Mistral Medium" },
|
|
{ value: "mistral-mistral-small-latest", title: "Mistral Small" },
|
|
{ value: "mistral-codestral-latest", title: "Mistral Codestral" },
|
|
{ value: "mistral-open-mistral-nemo", title: "Mistral Nemo" },
|
|
{ value: "groq-llama-3.3-70b-versatile", title: "Groq Llama 3.3 70B" },
|
|
{
|
|
value: "groq-meta-llama/llama-4-scout-17b-16e-instruct",
|
|
title: "Groq Llama 4 Scout",
|
|
},
|
|
{ value: "groq-llama-3.1-8b-instant", title: "Groq Llama 3.1 8B" },
|
|
{ value: "groq-qwen/qwen3-32b", title: "Groq Qwen3 32B" },
|
|
{ value: "groq-openai/gpt-oss-120b", title: "Groq GPT-OSS 120B" },
|
|
{ value: "groq-openai/gpt-oss-20b", title: "Groq GPT-OSS 20B" },
|
|
{ value: "together-deepseek-ai/DeepSeek-R1", title: "DeepSeek R1" },
|
|
{ value: "together-deepseek-ai/DeepSeek-V3", title: "DeepSeek V3" },
|
|
{ value: "together-moonshotai/Kimi-K2.5", title: "Kimi K2.5" },
|
|
];
|
|
|
|
const LAST_MODEL_STORAGE_KEY = "velum.ai.last-model";
|
|
|
|
export const DEFAULT_MODEL: string = MODEL_OPTIONS[0].value;
|
|
|
|
export async function getLastUsedModel(): Promise<string> {
|
|
const stored = await LocalStorage.getItem<string>(LAST_MODEL_STORAGE_KEY);
|
|
if (stored && MODEL_OPTIONS.some((option) => option.value === stored)) {
|
|
return stored;
|
|
}
|
|
return DEFAULT_MODEL;
|
|
}
|
|
|
|
export async function setLastUsedModel(model: string): Promise<void> {
|
|
await LocalStorage.setItem(LAST_MODEL_STORAGE_KEY, model);
|
|
}
|
|
|
|
export const STRICT_PLACEHOLDER_RULE = [
|
|
"STRENGE REGEL: Gib jeden Platzhalter zeichengetreu (inklusive spitzer Klammern, Großbuchstaben und Unterstrich + Nummer) zurück.",
|
|
"Du darfst Platzhalter NIEMALS auflösen, raten, übersetzen oder mit erfundenen Namen ersetzen. Schreibe sie exakt so, wie sie in der Eingabe stehen.",
|
|
].join("\n");
|