Archived
refactor: source thinking levels from pi and make the gauge dynamic
Depend on @earendil-works/pi-agent-core so the ThinkingLevel union has a single source of truth (re-exported via shared/thinkingLevels). Wire/data fields use string and the parser is lenient, so an unknown level from a newer pi runtime is still listed, selectable, and rendered gracefully instead of throwing. The composer gauge now derives its bar count from the levels available for the current model and fills by rank. Adds compile-time drift guards (satisfies + Exclude check) and unit tests so a changed pi level set fails fast in development.
This commit is contained in:
@@ -183,7 +183,10 @@ export interface SessionModel {
|
||||
reasoning?: unknown;
|
||||
}
|
||||
|
||||
export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
||||
// Domain type is owned by pi and re-exported from the shared thinking-levels
|
||||
// module. Wire/data fields below intentionally use `string` so an unknown level
|
||||
// from a newer pi runtime parses and renders gracefully instead of failing.
|
||||
export type { ThinkingLevel } from "./thinkingLevels.js";
|
||||
|
||||
export type AuthType = "oauth" | "api_key";
|
||||
export type AuthStatusSource = "stored" | "runtime" | "environment" | "fallback" | "models_json_key" | "models_json_command";
|
||||
@@ -222,7 +225,7 @@ export interface ModelSelectionResponse {
|
||||
}
|
||||
|
||||
export interface ThinkingLevelsResponse {
|
||||
levels: ThinkingLevel[];
|
||||
levels: string[];
|
||||
}
|
||||
|
||||
export interface SessionStatus {
|
||||
|
||||
Reference in New Issue
Block a user