Skip to content

Documentation / @agentick/core / ProcedurePromise

Interface: ProcedurePromise<T> ​

Defined in: kernel/src/procedure.ts:63

Enhanced Promise returned by all procedures.

ProcedurePromise extends Promise<T> with a .result property that chains through to the inner result. This allows ergonomic access to final values without losing access to the handle.

Examples ​

typescript
const handle = await run(<Agent />, opts);
handle.status;  // 'running'
for await (const event of handle) { }
typescript
const result = await run(<Agent />, opts).result;
// Equivalent to: (await run(<Agent />, opts)).result
typescript
const promise = run(<Agent />, opts);
const handle = await promise;           // Get handle
const result = await promise.result;    // Get final result

Extends ​

  • Promise<T>

Type Parameters ​

T ​

T

The type the promise resolves to (usually a handle or value)

Properties ​

result ​

readonly result: Promise<ResultOf<T>>

Defined in: kernel/src/procedure.ts:68

Promise that resolves to the final result. Chains through to T.result if T has a result property.

Released under the ISC License.