diff --git a/src/components/PromptInput/PromptInputFooterLeftSide.tsx b/src/components/PromptInput/PromptInputFooterLeftSide.tsx index d307dcb1b..77df155c6 100644 --- a/src/components/PromptInput/PromptInputFooterLeftSide.tsx +++ b/src/components/PromptInput/PromptInputFooterLeftSide.tsx @@ -137,10 +137,7 @@ function GoalElapsedIndicator(): React.ReactNode { }, []); void tick; - const goalModule = require('../../services/goal/goalState.js') as unknown as { - getGoal: () => { status: string; [k: string]: unknown } | null; - getActiveElapsedMs: (g: { status: string; [k: string]: unknown }) => number; - }; + const goalModule = require('../../services/goal/goalState.js') as typeof import('../../services/goal/goalState'); const goal = goalModule.getGoal(); if (!goal) return null; @@ -431,7 +428,7 @@ function ModeIndicator({ : []), // Goal elapsed indicator — compact "goal (XhYmin)" after PID ...(feature('GOAL') && - (require('../../services/goal/goalState.js') as unknown as { getGoal: () => unknown }).getGoal() + (require('../../services/goal/goalState.js') as typeof import('../../services/goal/goalState')).getGoal() ? [] : []), ]; diff --git a/src/services/goal/goalState.ts b/src/services/goal/goalState.ts new file mode 100644 index 000000000..18c304c8f --- /dev/null +++ b/src/services/goal/goalState.ts @@ -0,0 +1,30 @@ +/** + * Stub for the goal feature module. + * + * The goal feature is not yet implemented. This stub exists so that + * PromptInputFooterLeftSide.tsx's require() can be resolved by Bun's + * bundler (build.ts). At runtime, getGoal() returns null, so the + * GoalElapsedIndicator component renders nothing. + * + * When the goal feature is implemented, replace this stub with the + * real implementation. + */ + +export type GoalState = { + status: + | 'active' + | 'paused' + | 'budget_limited' + | 'usage_limited' + | 'blocked' + | 'complete' + [key: string]: unknown +} + +export function getGoal(): GoalState | null { + return null +} + +export function getActiveElapsedMs(_goal: GoalState): number { + return 0 +}