Skip to content

@codesoul-co/hypha-harness / manual-fsm-transition

Using this module

Use the Manual FSM transition module for using the public contracts and operations for this capability boundary. It exports 1 class, 1 constant, 4 interfaces.

Import from the package entrypoint

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

import type {
  GovernedFSMTransitionServiceOptions,
  ManualFSMRunView,
  ManualFSMTransitionCommand,
  ManualFSMTransitionResult,
} from '@codesoul-co/hypha-harness';

Usage patterns

  • Use the 4 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.
  • The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
GovernedFSMTransitionServiceclassnew GovernedFSMTransitionService(options: GovernedFSMTransitionServiceOptions): GovernedFSMTransitionServiceApplies an explicitly requested FSM edge under owner scope, permission, optimistic revision, Run Lease, fencing, Policy, guard, trace, and replay. It never mutates a snapshot or projection directly.
MANUAL_FSM_TRANSITION_PERMISSIONconstantconst MANUAL_FSM_TRANSITION_PERMISSION: "runtime.fsm.transition"MANUAL FSM TRANSITION PERMISSION constant exported by the manual-fsm-transition module.
GovernedFSMTransitionServiceOptionsinterfaceinterface GovernedFSMTransitionServiceOptionsGoverned FSM Transition Service Options interface with 7 public fields or methods.
ManualFSMRunViewinterfaceinterface ManualFSMRunViewManual FSM Run View interface with 10 public fields or methods.
ManualFSMTransitionCommandinterfaceinterface ManualFSMTransitionCommandManual FSM Transition Command interface with 15 public fields or methods.
ManualFSMTransitionResultinterfaceinterface ManualFSMTransitionResultManual FSM Transition Result interface with 5 public fields or methods.

GovernedFSMTransitionService

Applies an explicitly requested FSM edge under owner scope, permission, optimistic revision, Run Lease, fencing, Policy, guard, trace, and replay. It never mutates a snapshot or projection directly.

  • Kind: class
  • Import: import { GovernedFSMTransitionService } from '@codesoul-co/hypha-harness';
  • Source module: manual-fsm-transition

Declaration

text
export declare class GovernedFSMTransitionService {
    constructor(options: GovernedFSMTransitionServiceOptions);
    inspect(scope: RuntimeScope, process: FSMProcessSpec): Promise<ManualFSMRunView>;
    transition(process: FSMProcessSpec, input: ManualFSMTransitionCommand): Promise<ManualFSMTransitionResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: GovernedFSMTransitionServiceOptions): GovernedFSMTransitionServiceCreates an instance of this class.
inspectmethodinspect(scope: RuntimeScope, process: FSMProcessSpec): Promise<ManualFSMRunView>Public method; parameters and return type are shown in the signature.
transitionmethodtransition(process: FSMProcessSpec, input: ManualFSMTransitionCommand): Promise<ManualFSMTransitionResult>Public method; parameters and return type are shown in the signature.

MANUAL_FSM_TRANSITION_PERMISSION

MANUAL FSM TRANSITION PERMISSION constant exported by the manual-fsm-transition module.

  • Kind: constant
  • Import: import { MANUAL_FSM_TRANSITION_PERMISSION } from '@codesoul-co/hypha-harness';
  • Source module: manual-fsm-transition

Declaration

text
export declare const MANUAL_FSM_TRANSITION_PERMISSION: "runtime.fsm.transition";

GovernedFSMTransitionServiceOptions

Governed FSM Transition Service Options interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { GovernedFSMTransitionServiceOptions } from '@codesoul-co/hypha-harness';
  • Source module: manual-fsm-transition

Declaration

text
export interface GovernedFSMTransitionServiceOptions {
    events: EventRuntime;
    projections: ProjectionEngine;
    projectionStore: ProjectionStore<RuntimeOrchestrationProjection>;
    runLeases: RunLeaseStore;
    policy?: PolicyEngine;
    now?: () => string;
    nextId?: (namespace: string) => string;
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: EventRuntimePublic property; its type, readonly modifier and optionality 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.
policypropertypolicy?: PolicyEnginePublic property; its type, readonly modifier and optionality 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.

ManualFSMRunView

Manual FSM Run View interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { ManualFSMRunView } from '@codesoul-co/hypha-harness';
  • Source module: manual-fsm-transition

Declaration

text
export interface ManualFSMRunView {
    runId: string;
    processId: string;
    processVersion: string;
    runRevision: number;
    runStatus: RuntimeOrchestrationProjection['runStatus'];
    currentState?: string;
    statePath: string[];
    stateAttempt: number;
    terminalStates: string[];
    allowedTransitions: Array<{
        to: string;
        guard?: string;
        description?: string;
    }>;
}

Contract members

MemberKindSignatureDescription
allowedTransitionspropertyallowedTransitions: { to: string; guard?: string; description?: string; }[]Public property; its type, readonly modifier and optionality are shown in the signature.
currentStatepropertycurrentState?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
processIdpropertyprocessId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
processVersionpropertyprocessVersion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runRevisionpropertyrunRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
runStatuspropertyrunStatus: import("/Users/erwin/Downloads/codespace/Hypha/packages/core/dist/index").RuntimeOrchestrationRunStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
stateAttemptpropertystateAttempt: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
statePathpropertystatePath: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
terminalStatespropertyterminalStates: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

ManualFSMTransitionCommand

Manual FSM Transition Command interface with 15 public fields or methods.

  • Kind: interface
  • Import: import type { ManualFSMTransitionCommand } from '@codesoul-co/hypha-harness';
  • Source module: manual-fsm-transition

Declaration

text
export interface ManualFSMTransitionCommand {
    commandId: string;
    scope: RuntimeScope;
    principal: RuntimePrincipal;
    ownerId: string;
    leaseTtlMs: number;
    processId: string;
    processVersion: string;
    expectedState: string;
    expectedRunRevision: number;
    targetState: string;
    reason: string;
    requestedAt: string;
    guardContext?: FSMGuardContext;
    variablesPatch?: Record<string, RuntimeJsonValue>;
    idempotencyKey: string;
}

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedRunRevisionpropertyexpectedRunRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedStatepropertyexpectedState: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
guardContextpropertyguardContext?: FSMGuardContextPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey: 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.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: RuntimePrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
processIdpropertyprocessId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
processVersionpropertyprocessVersion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedAtpropertyrequestedAt: stringPublic 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.
targetStatepropertytargetState: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
variablesPatchpropertyvariablesPatch?: Record<string, RuntimeJsonValue>Public property; its type, readonly modifier and optionality are shown in the signature.

ManualFSMTransitionResult

Manual FSM Transition Result interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { ManualFSMTransitionResult } from '@codesoul-co/hypha-harness';
  • Source module: manual-fsm-transition

Declaration

text
export interface ManualFSMTransitionResult {
    commandId: string;
    disposition: 'applied' | 'reused' | 'lease_unavailable';
    eventIds: string[];
    runRevision: number;
    view: ManualFSMRunView;
}

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dispositionpropertydisposition: "applied" | "reused" | "lease_unavailable"Public property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
runRevisionpropertyrunRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
viewpropertyview: ManualFSMRunViewPublic property; its type, readonly modifier and optionality are shown in the signature.