summaryrefslogtreecommitdiffhomepage
path: root/src/features/chat/reasoning-effort.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/chat/reasoning-effort.ts')
-rw-r--r--src/features/chat/reasoning-effort.ts32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/features/chat/reasoning-effort.ts b/src/features/chat/reasoning-effort.ts
index 2a55089..1eb77b6 100644
--- a/src/features/chat/reasoning-effort.ts
+++ b/src/features/chat/reasoning-effort.ts
@@ -13,11 +13,11 @@ import type { ReasoningEffort } from "@dispatch/transport-contract";
/** The canonical ladder, in ascending thinking-depth order (`[email protected]`). */
export const REASONING_EFFORT_LEVELS: readonly ReasoningEffort[] = [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
];
/** The server's fallback when nothing is set (the resolution chain's tail). */
@@ -25,7 +25,7 @@ export const DEFAULT_REASONING_EFFORT: ReasoningEffort = "high";
/** Narrow an untrusted string (e.g. a `<select>` value) to the ladder. */
export function isReasoningEffort(value: string): value is ReasoningEffort {
- return (REASONING_EFFORT_LEVELS as readonly string[]).includes(value);
+ return (REASONING_EFFORT_LEVELS as readonly string[]).includes(value);
}
/**
@@ -33,13 +33,13 @@ export function isReasoningEffort(value: string): value is ReasoningEffort {
* server default when never set (`null` = "default applies", not "off").
*/
export function effectiveEffort(persisted: ReasoningEffort | null): ReasoningEffort {
- return persisted ?? DEFAULT_REASONING_EFFORT;
+ return persisted ?? DEFAULT_REASONING_EFFORT;
}
/** One `<option>` of the selector. */
export interface EffortOption {
- readonly value: ReasoningEffort;
- readonly label: string;
+ readonly value: ReasoningEffort;
+ readonly label: string;
}
/**
@@ -47,10 +47,10 @@ export interface EffortOption {
* `(default)` so a never-set conversation reads "high (default)".
*/
export function effortOptions(): readonly EffortOption[] {
- return REASONING_EFFORT_LEVELS.map((level) => ({
- value: level,
- label: level === DEFAULT_REASONING_EFFORT ? `${level} (default)` : level,
- }));
+ return REASONING_EFFORT_LEVELS.map((level) => ({
+ value: level,
+ label: level === DEFAULT_REASONING_EFFORT ? `${level} (default)` : level,
+ }));
}
// ── Injected port (consumer-defines-port; the composition root adapts the
@@ -58,9 +58,9 @@ export function effortOptions(): readonly EffortOption[] {
/** Outcome of `PUT /conversations/:id/reasoning-effort`. */
export type ReasoningEffortSaveResult =
- | { readonly ok: true; readonly reasoningEffort: ReasoningEffort }
- | { readonly ok: false; readonly error: string };
+ | { readonly ok: true; readonly reasoningEffort: ReasoningEffort }
+ | { readonly ok: false; readonly error: string };
export type SaveReasoningEffort = (
- level: ReasoningEffort,
+ level: ReasoningEffort,
) => Promise<ReasoningEffortSaveResult | null>;