EscalationStateManager
Defined in: escalation/state.ts:55
Manager for escalation states across multiple tasks
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new EscalationStateManager():
EscalationStateManager
Returns
Section titled “Returns”EscalationStateManager
Methods
Section titled “Methods”addCost()
Section titled “addCost()”addCost(
taskId,cost):EscalationState
Defined in: escalation/state.ts:138
Add cost to task
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
number
Returns
Section titled “Returns”clear()
Section titled “clear()”clear():
void
Defined in: escalation/state.ts:174
Clear all states
Returns
Section titled “Returns”void
escalate()
Section titled “escalate()”escalate(
taskId):EscalationState
Defined in: escalation/state.ts:122
Escalate to next level
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
Returns
Section titled “Returns”getAllStates()
Section titled “getAllStates()”getAllStates():
EscalationState[]
Defined in: escalation/state.ts:160
Get all states
Returns
Section titled “Returns”getState()
Section titled “getState()”getState(
taskId):EscalationState
Defined in: escalation/state.ts:61
Create or get state for a task
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
Returns
Section titled “Returns”getTotalCost()
Section titled “getTotalCost()”getTotalCost():
number
Defined in: escalation/state.ts:181
Get total cost across all tasks
Returns
Section titled “Returns”number
getUnresolved()
Section titled “getUnresolved()”getUnresolved():
EscalationState[]
Defined in: escalation/state.ts:167
Get unresolved states
Returns
Section titled “Returns”recordAttempt()
Section titled “recordAttempt()”recordAttempt(
taskId,level):EscalationState
Defined in: escalation/state.ts:100
Record an attempt at a level
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
Returns
Section titled “Returns”recordError()
Section titled “recordError()”recordError(
taskId,error):EscalationState
Defined in: escalation/state.ts:113
Record an error
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
string
Returns
Section titled “Returns”resetState()
Section titled “resetState()”resetState(
taskId):void
Defined in: escalation/state.ts:153
Reset state for a task
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
Returns
Section titled “Returns”void
resolve()
Section titled “resolve()”resolve(
taskId):EscalationState
Defined in: escalation/state.ts:131
Mark task as resolved
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
Returns
Section titled “Returns”setApproval()
Section titled “setApproval()”setApproval(
taskId,approved):EscalationState
Defined in: escalation/state.ts:146
Set approval status
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
approved
Section titled “approved”boolean
Returns
Section titled “Returns”updateState()
Section titled “updateState()”updateState(
taskId,update):EscalationState
Defined in: escalation/state.ts:86
Update state for a task
Parameters
Section titled “Parameters”taskId
Section titled “taskId”string
update
Section titled “update”Partial<Omit<EscalationState, "taskId" | "createdAt">>