microfoom
API referenceInterfaces

AgentResult

Interface: AgentResult<T>

Defined in: packages/microfoom-core/src/result.ts:15

The awaitable result of an agent turn. Awaiting yields the value; abort() cancels an in-flight run (the awaiter then rejects with FoomtimeCancelledError). An un-awaited result self-handles its own cancellation rejection, so abort() never surfaces an unhandledRejection.

Extends

  • PromiseLike<T>

Extended by

Type Parameters

Type Parameter
T

Properties

PropertyModifierTypeDefined in
usagereadonlyAgentUsagepackages/microfoom-core/src/result.ts:17

Methods

abort()

abort(reason?): void;

Defined in: packages/microfoom-core/src/result.ts:16

Parameters

ParameterType
reason?unknown

Returns

void


then()

then<TResult1, TResult2>(onfulfilled?, onrejected?): PromiseLike<TResult1 | TResult2>;

Defined in: docs-website/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1544

Attaches callbacks for the resolution and/or rejection of the Promise.

Type Parameters

Type ParameterDefault type
TResult1T
TResult2never

Parameters

ParameterTypeDescription
onfulfilled?((value) => TResult1 | PromiseLike<TResult1>) | nullThe callback to execute when the Promise is resolved.
onrejected?((reason) => TResult2 | PromiseLike<TResult2>) | nullThe callback to execute when the Promise is rejected.

Returns

PromiseLike<TResult1 | TResult2>

A Promise for the completion of which ever callback is executed.

Inherited from

PromiseLike.then

On this page