Skip to content

@codesoul-co/hypha-harness / bounded-fsm-driver

Using this module

Use the Bounded FSM driver module for using the public contracts and operations for this capability boundary. It exports 1 class, 5 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  FencedBoundedFSMDriver,
} from '@codesoul-co/hypha-harness';

import type {
  BoundedFSMDriverResult,
  BoundedFSMDriverRunInput,
  BoundedStateExecutionDecision,
  BoundedStateExecutorInput,
  FencedBoundedFSMDriverOptions,
  BoundedFSMDriverDisposition,
} from '@codesoul-co/hypha-harness';

Usage patterns

  • Use the 6 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
FencedBoundedFSMDriverclassnew FencedBoundedFSMDriver(options: FencedBoundedFSMDriverOptions): FencedBoundedFSMDriverFenced Bounded FSM Driver class with 2 public constructor or member entries; its exact declarations are listed below.
BoundedFSMDriverResultinterfaceinterface BoundedFSMDriverResultBounded FSM Driver Result interface with 4 public fields or methods.
BoundedFSMDriverRunInputinterfaceinterface BoundedFSMDriverRunInputBounded FSM Driver Run Input interface with 9 public fields or methods.
BoundedStateExecutionDecisioninterfaceinterface BoundedStateExecutionDecisionBounded State Execution Decision interface with 3 public fields or methods.
BoundedStateExecutorInputinterfaceinterface BoundedStateExecutorInputBounded State Executor Input interface with 7 public fields or methods.
FencedBoundedFSMDriverOptionsinterfaceinterface FencedBoundedFSMDriverOptionsFenced Bounded FSM Driver Options interface with 9 public fields or methods.
BoundedFSMDriverDispositiontypetype BoundedFSMDriverDisposition = 'completed' | 'failed' | 'cancelled' | 'waiting' | 'budget_exhausted' | 'lease_unavailable' | 'state_claim_unavailable'Public type alias for Bounded FSM Driver Disposition; the declaration contains its complete type expression.

FencedBoundedFSMDriver

Fenced Bounded FSM Driver class with 2 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { FencedBoundedFSMDriver } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export declare class FencedBoundedFSMDriver {
    constructor(options: FencedBoundedFSMDriverOptions);
    run(input: BoundedFSMDriverRunInput): Promise<BoundedFSMDriverResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: FencedBoundedFSMDriverOptions): FencedBoundedFSMDriverCreates an instance of this class.
runmethodrun(input: BoundedFSMDriverRunInput): Promise<BoundedFSMDriverResult>Public method; parameters and return type are shown in the signature.

BoundedFSMDriverResult

Bounded FSM Driver Result interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { BoundedFSMDriverResult } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export interface BoundedFSMDriverResult {
    disposition: BoundedFSMDriverDisposition;
    steps: number;
    projection: RuntimeOrchestrationProjection;
    wait?: RuntimeWaitIntent;
}

Contract members

MemberKindSignatureDescription
dispositionpropertydisposition: BoundedFSMDriverDispositionPublic property; its type, readonly modifier and optionality are shown in the signature.
projectionpropertyprojection: RuntimeOrchestrationProjectionPublic property; its type, readonly modifier and optionality are shown in the signature.
stepspropertysteps: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
waitpropertywait?: RuntimeWaitIntentPublic property; its type, readonly modifier and optionality are shown in the signature.

BoundedFSMDriverRunInput

Bounded FSM Driver Run Input interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { BoundedFSMDriverRunInput } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export interface BoundedFSMDriverRunInput {
    scope: RuntimeScope;
    process: FSMProcessSpec;
    ownerId: string;
    commandId?: string;
    maxSteps: number;
    leaseTtlMs: number;
    stateClaimTtlMs: number;
    deadlineAt?: string;
    abortSignal?: AbortSignal;
}

Contract members

MemberKindSignatureDescription
abortSignalpropertyabortSignal?: AbortSignalPublic property; its type, readonly modifier and optionality are shown in the signature.
commandIdpropertycommandId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deadlineAtpropertydeadlineAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxStepspropertymaxSteps: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
processpropertyprocess: FSMProcessSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeScopePublic property; its type, readonly modifier and optionality are shown in the signature.
stateClaimTtlMspropertystateClaimTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

BoundedStateExecutionDecision

Bounded State Execution Decision interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { BoundedStateExecutionDecision } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export interface BoundedStateExecutionDecision {
    result: RuntimeStateExecutionResult;
    transition?: RuntimeTransitionProposal;
    guardContext?: FSMGuardContext;
}

Contract members

MemberKindSignatureDescription
guardContextpropertyguardContext?: FSMGuardContextPublic property; its type, readonly modifier and optionality are shown in the signature.
resultpropertyresult: RuntimeStateExecutionResultPublic property; its type, readonly modifier and optionality are shown in the signature.
transitionpropertytransition?: RuntimeTransitionProposalPublic property; its type, readonly modifier and optionality are shown in the signature.

BoundedStateExecutorInput

Bounded State Executor Input interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { BoundedStateExecutorInput } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export interface BoundedStateExecutorInput {
    scope: Readonly<RuntimeScope>;
    process: Readonly<FSMProcessSpec>;
    state: Readonly<FSMStateSpec>;
    projection: Readonly<RuntimeOrchestrationProjection>;
    runLease: Readonly<FencedRunLease>;
    stateClaim: Readonly<StateExecutionClaim>;
    abortSignal: AbortSignal;
}

Contract members

MemberKindSignatureDescription
abortSignalpropertyabortSignal: AbortSignalPublic property; its type, readonly modifier and optionality are shown in the signature.
processpropertyprocess: Readonly<FSMProcessSpec>Public property; its type, readonly modifier and optionality are shown in the signature.
projectionpropertyprojection: Readonly<RuntimeOrchestrationProjection>Public property; its type, readonly modifier and optionality are shown in the signature.
runLeasepropertyrunLease: Readonly<FencedRunLease>Public property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: Readonly<RuntimeScope>Public property; its type, readonly modifier and optionality are shown in the signature.
statepropertystate: Readonly<FSMStateSpec>Public property; its type, readonly modifier and optionality are shown in the signature.
stateClaimpropertystateClaim: Readonly<StateExecutionClaim>Public property; its type, readonly modifier and optionality are shown in the signature.

FencedBoundedFSMDriverOptions

Fenced Bounded FSM Driver Options interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { FencedBoundedFSMDriverOptions } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export interface FencedBoundedFSMDriverOptions {
    events: EventRuntime;
    projections: ProjectionEngine;
    projectionStore: ProjectionStore<RuntimeOrchestrationProjection>;
    runLeases: RunLeaseStore;
    stateClaims: StateExecutionClaimStore;
    executeState(input: BoundedStateExecutorInput): Promise<BoundedStateExecutionDecision>;
    evaluateGuard?: (transition: Readonly<FSMTransitionSpec>, context: Readonly<FSMGuardContext>) => Promise<boolean> | boolean;
    now?: () => string;
    nextId?: (namespace: string) => string;
}

Contract members

MemberKindSignatureDescription
evaluateGuardmethodevaluateGuard?(transition: Readonly<FSMTransitionSpec>, context: Readonly<FSMGuardContext>): Promise<boolean> | booleanPublic method; parameters and return type are shown in the signature.
eventspropertyevents: EventRuntimePublic property; its type, readonly modifier and optionality are shown in the signature.
executeStatemethodexecuteState(input: BoundedStateExecutorInput): Promise<BoundedStateExecutionDecision>Public method; parameters and return type are shown in the signature.
nextIdmethodnextId?(namespace: string): stringPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
projectionspropertyprojections: ProjectionEnginePublic property; its type, readonly modifier and optionality are shown in the signature.
projectionStorepropertyprojectionStore: ProjectionStore<RuntimeOrchestrationProjection>Public property; its type, readonly modifier and optionality are shown in the signature.
runLeasespropertyrunLeases: RunLeaseStorePublic property; its type, readonly modifier and optionality are shown in the signature.
stateClaimspropertystateClaims: StateExecutionClaimStorePublic property; its type, readonly modifier and optionality are shown in the signature.

BoundedFSMDriverDisposition

Public type alias for Bounded FSM Driver Disposition; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { BoundedFSMDriverDisposition } from '@codesoul-co/hypha-harness';
  • Source module: bounded-fsm-driver

Declaration

text
export type BoundedFSMDriverDisposition = 'completed' | 'failed' | 'cancelled' | 'waiting' | 'budget_exhausted' | 'lease_unavailable' | 'state_claim_unavailable';