/** * Data models for Goal Engineering. * * Python parity: praisonaiagents/goal/models.py. A {@link Goal} is a * structured, measurable representation of what an agent should achieve. It * is decomposed into {@link SuccessCriterion} items that can be tracked and * verified independently. */ /** Python parity: goal/models.py:14 `CriterionStatus`. */ export type CriterionStatus = 'pending' | 'met' | 'unmet'; /** Constructor options for {@link SuccessCriterion} (goal/models.py:18-34). */ export interface SuccessCriterionOptions { /** What must be true for this criterion to be met. */ description: string; /** Unique identifier (default: 8-char UUID prefix). */ id?: string; /** Relative importance when scoring the goal (default 1.0). */ weight?: number; /** Current status (default "pending"). */ status?: CriterionStatus; /** Optional notes from verification (default ""). */ notes?: string; } /** * A single measurable condition that contributes to achieving a goal. * * Python parity: goal/models.py:18 `SuccessCriterion`. */ export declare class SuccessCriterion { description: string; id: string; weight: number; status: CriterionStatus; notes: string; constructor(options: SuccessCriterionOptions); /** Python parity: goal/models.py:36 `to_dict`. */ toDict(): Record; /** Python parity: goal/models.py:46 `from_dict`. */ static fromDict(data: Record): SuccessCriterion; /** Independent copy (Python `dataclasses.replace(criterion)`, goal/engineer.py:199). */ clone(): SuccessCriterion; } /** Constructor options for {@link Goal} (goal/models.py:57-73). */ export interface GoalOptions { /** The high-level objective in natural language. */ statement: string; /** Unique identifier (default: 8-char UUID prefix). */ id?: string; /** Ordered list of success criteria (default []). */ criteria?: SuccessCriterion[]; /** Hard constraints that must never be violated (default []). */ constraints?: string[]; /** Free-form metadata (domain, owner, etc.) (default {}). */ metadata?: Record; } /** * A structured, measurable goal for an agent. * * Python parity: goal/models.py:57 `Goal`. */ export declare class Goal { statement: string; id: string; criteria: SuccessCriterion[]; constraints: string[]; metadata: Record; constructor(options: GoalOptions); /** * Add a success criterion and return it. * * Python parity: goal/models.py:75 `add_criterion(description, weight=1.0)`. */ addCriterion(description: string, weight?: number): SuccessCriterion; /** * Fraction of weighted criteria currently met (0.0 - 1.0). * * Non-positive weights are treated as 0 so a single criterion cannot skew * the fraction outside the documented range. If no criterion carries a * positive weight, criteria are counted equally. * * Python parity: goal/models.py:84 `progress`. */ get progress(): number; /** * True when there is at least one criterion and all are met. * * Python parity: goal/models.py:103 `is_achieved`. */ get isAchieved(): boolean; /** Python parity: goal/models.py:109 `to_dict`. */ toDict(): Record; /** Python parity: goal/models.py:119 `from_dict`. */ static fromDict(data: Record): Goal; /** * Render the goal as an instruction block for an agent prompt. * * Python parity: goal/models.py:130 `to_prompt`. */ toPrompt(): string; } /** Constructor options for {@link GoalCriteria} (goal/models.py:145-157). */ export interface GoalCriteriaOptions { /** What "done" means, in one line (default ""). */ outcome?: string; /** How to check it - the concrete bar the judge uses (default ""). */ verification?: string; /** Must-not-violate conditions; any violation blocks `done` (default []). */ constraints?: string[]; } /** * A structured "definition of done" for a goal-gated autonomous loop. * * Python parity: goal/models.py:145 `GoalCriteria`. */ export declare class GoalCriteria { outcome: string; verification: string; constraints: string[]; constructor(options?: GoalCriteriaOptions); /** Python parity: goal/models.py:159 `to_dict`. */ toDict(): Record; /** Python parity: goal/models.py:167 `from_dict`. */ static fromDict(data: Record): GoalCriteria; } /** Constructor options for {@link GoalState} (goal/models.py:176-201). */ export interface GoalStateOptions { /** The goal text (free text, or paired with `criteria`). */ goal: string; /** Optional structured acceptance criteria (default null). */ criteria?: GoalCriteria | null; /** `active` | `paused` | `done` (default "active"). */ status?: string; /** Judged iterations consumed so far (default 0). */ turnsUsed?: number; /** Budget of judged iterations before a recoverable pause (default 20). */ maxTurns?: number; /** Most recent judge verdict (`done` | `continue`) (default ""). */ lastVerdict?: string; /** Most recent judge reason (default ""). */ lastReason?: string; /** Consecutive unparseable judge responses (default 0). */ consecutiveParseFailures?: number; } /** * Persistent state for a goal-gated autonomous loop. * * Python parity: goal/models.py:176 `GoalState`. */ export declare class GoalState { goal: string; criteria: GoalCriteria | null; status: string; turnsUsed: number; maxTurns: number; lastVerdict: string; lastReason: string; consecutiveParseFailures: number; constructor(options: GoalStateOptions); /** Python parity: goal/models.py:203 `to_dict` (snake_case keys for wire compatibility). */ toDict(): Record; /** Python parity: goal/models.py:216 `from_dict` (accepts snake_case or camelCase keys). */ static fromDict(data: Record): GoalState; } /** Constructor options for {@link GoalVerificationResult} (goal/models.py:235-251). */ export interface GoalVerificationResultOptions { /** The verified goal's id. */ goalId: string; /** Overall score in the 0.0 - 10.0 range. */ score: number; /** Whether the goal is considered achieved. */ achieved: boolean; /** The (updated) criteria with their statuses (default []). */ criteria?: SuccessCriterion[]; /** Explanation of the verification (default ""). */ reasoning?: string; } /** * Outcome of verifying an output against a goal. * * Python parity: goal/models.py:235 `GoalVerificationResult`. */ export declare class GoalVerificationResult { goalId: string; score: number; achieved: boolean; criteria: SuccessCriterion[]; reasoning: string; constructor(options: GoalVerificationResultOptions); /** Python parity: goal/models.py:253 `to_dict` (snake_case `goal_id` for wire compatibility). */ toDict(): Record; }