mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-29 04:25:52 +01:00
Use the shared composer for new tasks, including project and worktree selection, rich mentions and slash commands, and remembered task settings. Save project preferences after successful task updates. Show known agent models by name and use Default for unknown runtime defaults. Co-Authored-By: Paperclip <noreply@paperclip.ing>
22 lines
763 B
TypeScript
22 lines
763 B
TypeScript
const STORAGE_KEY = "paperclip:composer-effort";
|
|
|
|
/** Undefined means no preference; null is the user's explicit Default choice. */
|
|
export function getLastComposerEffort(companyId: string): string | null | undefined {
|
|
try {
|
|
const raw = localStorage.getItem(`${STORAGE_KEY}:${companyId}`);
|
|
if (raw === null) return undefined;
|
|
const value: unknown = JSON.parse(raw);
|
|
return value === null || typeof value === "string" ? value : undefined;
|
|
} catch {
|
|
return undefined;
|
|
}
|
|
}
|
|
|
|
export function rememberComposerEffort(companyId: string, effort: string | null): void {
|
|
try {
|
|
localStorage.setItem(`${STORAGE_KEY}:${companyId}`, JSON.stringify(effort));
|
|
} catch {
|
|
// The current run setting still works without persistent storage.
|
|
}
|
|
}
|