@hotmeshio/hotmesh
Version:
Permanent-Memory Workflows & AI Agents
75 lines (74 loc) • 2.68 kB
TypeScript
import { getContext } from './context';
import { didRun } from './didRun';
import { isSideEffectAllowed } from './isSideEffectAllowed';
import { trace } from './trace';
import { enrich } from './enrich';
import { emit } from './emit';
import { execChild, startChild } from './execChild';
import { execHook } from './execHook';
import { execHookBatch } from './execHookBatch';
import { proxyActivities } from './proxyActivities';
import { search } from './searchMethods';
import { random } from './random';
import { signal } from './signal';
import { hook } from './hook';
import { interrupt } from './interrupt';
import { didInterrupt } from './interruption';
import { all } from './all';
import { sleepFor } from './sleepFor';
import { waitFor } from './waitFor';
import { HotMesh } from './common';
import { entity } from './entityMethods';
/**
* The WorkflowService class provides a set of static methods to be used within a workflow function.
* These methods ensure deterministic replay, persistence of state, and error handling across
* re-entrant workflow executions.
*
* @example
* ```typescript
* import { MemFlow } from '@hotmeshio/hotmesh';
*
* export async function waitForExample(): Promise<[boolean, number]> {
* const [s1, s2] = await Promise.all([
* MemFlow.workflow.waitFor<boolean>('my-sig-nal-1'),
* MemFlow.workflow.waitFor<number>('my-sig-nal-2')
* ]);
* return [s1, s2];
* }
* ```
*/
export declare class WorkflowService {
/**
* @private
* The constructor is private to prevent instantiation;
* all methods are static.
*/
private constructor();
static getContext: typeof getContext;
static didRun: typeof didRun;
static isSideEffectAllowed: typeof isSideEffectAllowed;
static trace: typeof trace;
static enrich: typeof enrich;
static emit: typeof emit;
static execChild: typeof execChild;
static executeChild: typeof execChild;
static startChild: typeof startChild;
static execHook: typeof execHook;
static execHookBatch: typeof execHookBatch;
static proxyActivities: typeof proxyActivities;
static search: typeof search;
static entity: typeof entity;
static random: typeof random;
static signal: typeof signal;
static hook: typeof hook;
static didInterrupt: typeof didInterrupt;
static interrupt: typeof interrupt;
static all: typeof all;
static sleepFor: typeof sleepFor;
static waitFor: typeof waitFor;
/**
* Return a handle to the HotMesh client hosting the workflow execution.
* @returns {Promise<HotMesh>} The HotMesh client instance.
*/
static getHotMesh(): Promise<HotMesh>;
}