/** * [WHO]: GoalStore class - atomic JSON-file persistence layer for per-thread goals; CRUD primitives (get/replace/insert/update/delete) and account_usage; no concurrency control beyond filesystem atomic rename * [FROM]: Depends on node:fs, node:path, node:crypto, ./goal-types * [TO]: Consumed by ./goal-controller and any code that needs to mutate or observe persisted goal state * [HERE]: extensions/builtin/goal/goal-store.ts - durable per-thread storage under /goals/.json */ import { type GoalAccountingMode, type GoalAccountingOutcome, type ThreadGoal, type ThreadGoalStatus } from "./goal-types.js"; export declare class GoalStore { private readonly agentDir; private readonly threadId; readonly filePath: string; constructor(agentDir: string, threadId: string); get_goal(): ThreadGoal | null; replace_goal(objective: string, status: ThreadGoalStatus, tokenBudget: number | null): ThreadGoal; insert_goal(objective: string, status: ThreadGoalStatus, tokenBudget: number | null): ThreadGoal | null; update_goal(update: { objective?: string; status?: ThreadGoalStatus; tokenBudget?: number | null | undefined; expectedGoalId?: string | null; }): ThreadGoal | null; delete_goal(): boolean; account_usage(timeDeltaSeconds: number, tokenDelta: number, mode: GoalAccountingMode, expectedGoalId?: string): GoalAccountingOutcome; set_status(status: ThreadGoalStatus, expectedGoalId?: string): ThreadGoal | null; usage_limit_active(): ThreadGoal | null; stop_active_as_blocked(): ThreadGoal | null; } export declare function createGoalStore(agentDir: string, threadId: string): GoalStore;