Class: GraphExpander
Defined in: packages/agentos/src/orchestration/planning/GraphExpander.ts:29
Applies GraphPatch modifications atomically to a CompiledExecutionGraph. Checks guardrail thresholds before approving expansions in guardrailed mode.
Constructors
Constructor
new GraphExpander(
thresholds):GraphExpander
Defined in: packages/agentos/src/orchestration/planning/GraphExpander.ts:32
Parameters
thresholds
Returns
GraphExpander
Methods
applyPatch()
applyPatch(
graph,patch):CompiledExecutionGraph
Defined in: packages/agentos/src/orchestration/planning/GraphExpander.ts:40
Apply a patch to a graph, returning a new graph (immutable). Patches are applied atomically — all changes happen together.
Parameters
graph
patch
Returns
getExceededThreshold()
getExceededThreshold(
state): {cap:number;threshold:string;value:number; } |null
Defined in: packages/agentos/src/orchestration/planning/GraphExpander.ts:99
Identify which specific threshold was exceeded. Returns null if no threshold is exceeded.
Parameters
state
ExpansionState
Returns
{ cap: number; threshold: string; value: number; } | null
shouldAutoApprove()
shouldAutoApprove(
autonomy,state):boolean
Defined in: packages/agentos/src/orchestration/planning/GraphExpander.ts:82
Determine whether an expansion should be auto-approved based on autonomy mode and resource thresholds.
- autonomous: always approve
- guided: never auto-approve (requires user input)
- guardrailed: approve if below all thresholds
Parameters
autonomy
state
ExpansionState
Returns
boolean