eaos-workspace API Reference
eaos-workspace API Reference
Section titled “eaos-workspace API Reference”FUNCTION approvedExecution<T>
Section titled “FUNCTION approvedExecution<T>”Executes an agentic operation under explicit policy gatekeeper approval and sandbox constraints.
function approvedExecution<T>(action: () => Promise<T>, options?: ExecutionOptions): Promise<T>Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
action |
() => Promise<T> |
Yes | The asynchronous task or effect to be executed. |
options |
ExecutionOptions |
Optional | Execution constraints including timeout, circuit breaker thresholds, and audit sinks. |
Returns
Section titled “Returns”- Type:
Promise<T> - Description: The resolved value of the executed action.
Example
Section titled “Example”import { approvedExecution } from '@alneas/eaos-core';
const result = await approvedExecution(async () => { return await runAgentAction();}, { timeoutMs: 5000 });CLASS CircuitBreaker
Section titled “CLASS CircuitBreaker”Provides automated fault tolerance and circuit tripping when upstream LLM or external services encounter consecutive errors.
class CircuitBreaker { constructor(config: CircuitBreakerConfig); execute<T>(fn: () => Promise<T>): Promise<T>;}Example
Section titled “Example”const breaker = new CircuitBreaker({ failureThreshold: 3, resetTimeoutMs: 10000 });await breaker.execute(() => callLlmGateway());