import { ECSContext } from "../core/ecs"; import { Effect } from "../core/schema"; import { ConditionDefinition, ConditionTraceNode, ConditionTraceSource } from "./condition"; import { RuleTargetValidationIssue, RuleTriggerType, RuntimeRuleContext } from "./ruleContextContracts"; export declare const ACTION_CONTROL_FLOW_TYPE_OPTIONS: readonly ["sequence", "firstSuccess", "parallel", "if"]; export declare const ACTION_TYPE_OPTIONS: readonly ["sequence", "firstSuccess", "parallel", "if", "teleport", "kill", "getPickedUp", "addToInventory", "removeFromInventory", "incrementStock", "setMetric", "incrementMetric", "damage", "spawnEntityFrom", "spawnAtHit", "emitParticles", "mount", "discover", "popup", "emitEvent", "heal"]; export type ActionType = typeof ACTION_TYPE_OPTIONS[number]; export declare const ACTION_PARALLEL_SUCCESS_POLICY_OPTIONS: readonly ["all", "any"]; export type ActionParallelSuccessPolicy = typeof ACTION_PARALLEL_SUCCESS_POLICY_OPTIONS[number]; export type ActionLeafDefinition = Effect; export type ActionDefinition = ActionLeafDefinition | { type: "sequence"; params: { actions: ActionDefinition[]; continueOnFailure?: boolean; }; } | { type: "firstSuccess"; params: { actions: ActionDefinition[]; }; } | { type: "parallel"; params: { actions: ActionDefinition[]; successPolicy?: ActionParallelSuccessPolicy; }; } | { type: "if"; params: { condition: ConditionDefinition; then: ActionDefinition; else?: ActionDefinition; }; }; export type ActionInput = ActionDefinition | Effect | Array | null | undefined; export type ActionTraceReason = "action_applied" | "action_failed" | "sequence_complete" | "sequence_halted" | "sequence_empty" | "first_success_selected" | "first_success_failed" | "first_success_empty" | "parallel_complete" | "parallel_partial" | "if_then" | "if_else" | "if_unmet" | "target_unavailable_for_trigger" | "missing_context_value" | "invalid_action"; export type ActionOperationTrace = { path: string; type: string; target: string; success: boolean; executed: boolean; reason: ActionTraceReason; message?: string; }; export type ActionTraceNode = { type: string; passed: boolean; reason: ActionTraceReason; details?: Record; conditionTrace?: ConditionTraceNode; children?: ActionTraceNode[]; }; export type ActionExecutionResult = { passed: boolean; executedOperations: number; successfulOperations: number; operationTraces: ActionOperationTrace[]; trace: ActionTraceNode; }; export type ActionExecutionOptions = { triggerType: RuleTriggerType; conditionTraceSource?: ConditionTraceSource; }; export declare function normalizeActionDefinition(action: ActionInput): ActionDefinition; export declare function buildActionSequenceFromEffects(effects: Effect[] | undefined): ActionDefinition; export declare function validateActionTargetsForTrigger(triggerType: RuleTriggerType, action: ActionInput, pathPrefix?: string): RuleTargetValidationIssue[]; export declare function executeActionDefinition(ctx: ECSContext, action: ActionInput, runtimeContext: RuntimeRuleContext, options: ActionExecutionOptions): ActionExecutionResult; //# sourceMappingURL=action.d.ts.map