@codesoul-co/hypha-fsm / index
- Package index:
@codesoul-co/hypha-fsm - Source:
packages/fsm/src/index.ts - Exports: 50
Using this module
Aggregates the public entrypoint exports for @codesoul-co/hypha-fsm; applications import these symbols from the package entrypoint instead of internal file paths.
Import from the package entrypoint
import {
FSMRuntime,
defaultReActFSMProcessSpec,
fsmProcessSpecDefinition,
fsmProcessSpecExample,
fsmProcessSpecJsonSchema,
fsmProcessSpecSchema,
fsmSpecDefinitions,
fsmSpecJsonSchemas,
} from '@codesoul-co/hypha-fsm';
import type {
FSMGuardContext,
FSMProcessSpec,
FSMRecoveryDecisionRecord,
FSMRuntimeCancelOptions,
FSMRuntimeOptions,
FSMRuntimeTransitionOptions,
FSMSnapshot,
FSMStateEnteredRecord,
} from '@codesoul-co/hypha-fsm';
// The complete export list is documented below.Usage patterns
- Use the 19 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 module exposes 17 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
- The 13 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.
Runtime validation example
import { fsmProcessSpecSchema } from '@codesoul-co/hypha-fsm';
declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = fsmProcessSpecSchema.parse(input);Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
FSMRuntime | class | new FSMRuntime(spec: FSMProcessSpec, runId: string, options?: FSMRuntimeOptions, snapshot?: FSMSnapshot): FSMRuntime | FSM Runtime class with 8 public constructor or member entries; its exact declarations are listed below. |
defaultReActFSMProcessSpec | constant | const defaultReActFSMProcessSpec: FSMProcessSpec | Default ReAct FSM Process Spec constant exported by the index module. |
fsmProcessSpecDefinition | constant | const fsmProcessSpecDefinition: SpecSchemaDefinition<FSMProcessSpec> | Runtime validation entrypoint for the FSM Process spec, combining its parser, example and JSON Schema. |
fsmProcessSpecExample | constant | const fsmProcessSpecExample: FSMProcessSpec | Valid example value for FSM Process Spec. |
fsmProcessSpecJsonSchema | constant | const fsmProcessSpecJsonSchema: JsonSchema | JSON Schema for FSM Process Spec. |
fsmProcessSpecSchema | constant | const fsmProcessSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; owner: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; createdAt: z.ZodOptional<z.ZodString>; updatedAt: z.ZodOptional<z.ZodString>; } & { initialState: z.ZodString; states: z.ZodArray<z.ZodObject<{ name: z.ZodOptional<z.... | Runtime schema for FSM Process Spec. |
fsmSpecDefinitions | constant | const fsmSpecDefinitions: readonly [SpecSchemaDefinition<FSMProcessSpec>] | FSM Spec Definitions constant exported by the index module. |
fsmSpecJsonSchemas | constant | const fsmSpecJsonSchemas: Record<string, JsonSchema> | FSM Spec JSON Schemas constant exported by the index module. |
fsmStateSpecSchema | constant | const fsmStateSpecSchema: z.ZodObject<{ name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; owner: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; createdAt: z.ZodOptional<z.ZodString>; updatedAt: z.ZodOptional<z.ZodString>; } & { id: z.ZodString; kind: z.ZodOptional<z.ZodEnum<["idle", "run_initialized", "context_built", "reasoning", "action_selected", "poli... | Runtime schema for FSM State Spec. |
fsmTransitionSpecSchema | constant | const fsmTransitionSpecSchema: z.ZodObject<{ from: z.ZodString; to: z.ZodString; guard: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; traceEvent: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { from: string; to: string; description?: string | undefined; guard?: string | undefined; traceEvent?: string | undefined; }, { from: string; to: string; description?: string | undefined; guard?... | Runtime schema for FSM Transition Spec. |
HARNESS_FSM_STATE_IDS | constant | const HARNESS_FSM_STATE_IDS: readonly ["Idle", "RunInitialized", "ContextBuilt", "Reasoning", "ActionSelected", "PolicyChecked", "Acting", "ObservationRecorded", "Verifying", "MemorySync", "Recovering", "Compensating", "Quarantined", "HumanReview", "Completed", "Failed", "Cancelled"] | Stable Harness states owned by the framework runtime. Domain Packs may bind capabilities and policy to these phases, but must not add, remove, rename, or reconnect them. |
HARNESS_STATE_CAPABILITY_AREA | constant | const HARNESS_STATE_CAPABILITY_AREA: Readonly<Record<"Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled", HarnessCapabilityArea>> | activity is the governed side-effect phase shared by Tool, MCP, Execution, file, Memory-write, and external-write adapters. The concrete activity type remains Event evidence; it never becomes a Domain-defined FSM state. |
REACT_FSM_STATE_PATH | constant | const REACT_FSM_STATE_PATH: readonly ["Idle", "RunInitialized", "ContextBuilt", "Reasoning", "ActionSelected", "PolicyChecked", "Acting", "ObservationRecorded", "Verifying", "MemorySync", "Completed"] | REACT FSM STATE PATH constant exported by the index module. |
REACT_PHASE_TO_HARNESS_STATE | constant | const REACT_PHASE_TO_HARNESS_STATE: Readonly<{ reason: "Reasoning"; select_action: "ActionSelected"; policy_check: "PolicyChecked"; act: "Acting"; observe_result: "ObservationRecorded"; verify: "Verifying"; memory_sync: "MemorySync"; complete: "Completed"; fail: "Failed"; human_review: "HumanReview"; cancel: "Cancelled"; }> | REACT PHASE TO HARNESS STATE constant exported by the index module. |
analyzeFSMTopology | function | analyzeFSMTopology(spec: FSMProcessSpec): FSMTopologyAnalysis | Describes graph properties without imposing product-specific topology rules. Callers can decide whether unreachable states, non-terminal dead ends, or cycles are valid for their Domain workflow. |
applyTransition | function | applyTransition(spec: FSMProcessSpec, snapshot: FSMSnapshot, to: string, nowOrOptions?: string | FSMTransitionOptions): FSMSnapshot | Apply Transition function with 1 public call signature; parameters and return types are listed below. |
applyTransitionWithRuntimePolicy | function | applyTransitionWithRuntimePolicy(spec: FSMProcessSpec, snapshot: FSMSnapshot, to: string, options?: FSMRuntimeTransitionOptions): Promise<FSMSnapshot> | Apply Transition With Runtime Policy function with 1 public call signature; parameters and return types are listed below. |
assertHarnessFSMProcessSpec | function | assertHarnessFSMProcessSpec(spec: FSMProcessSpec): void | Fails closed when an application or Domain Pack attempts to replace the Harness capability topology with a product workflow. |
canRetryState | function | canRetryState(spec: FSMProcessSpec, stateId: string, attemptedCount: number): boolean | Can Retry State function with 1 public call signature; parameters and return types are listed below. |
createHarnessFSMProcessSpec | function | createHarnessFSMProcessSpec(): FSMProcessSpec | Returns an isolated copy so composition code cannot mutate the shared contract. |
createInitialSnapshot | function | createInitialSnapshot(spec: FSMProcessSpec, runId: string, now?: string): FSMSnapshot | Create Initial Snapshot function with 1 public call signature; parameters and return types are listed below. |
evaluateGuardExpression | function | evaluateGuardExpression(guard: string, context?: FSMGuardContext): boolean | Evaluate Guard Expression function with 1 public call signature; parameters and return types are listed below. |
evaluateStateTimeout | function | evaluateStateTimeout(spec: FSMProcessSpec, snapshot: FSMSnapshot, now?: string): FSMTimeoutEvaluation | null | Evaluate State Timeout function with 1 public call signature; parameters and return types are listed below. |
getAllowedTransitions | function | getAllowedTransitions(spec: FSMProcessSpec, stateId: string): FSMTransitionSpec[] | Get Allowed Transitions function with 1 public call signature; parameters and return types are listed below. |
harnessStateForReActPhase | function | harnessStateForReActPhase(phase: string): HarnessFSMStateId | undefined | Harness State For ReAct Phase function with 1 public call signature; parameters and return types are listed below. |
isHarnessFSMProcessSpec | function | isHarnessFSMProcessSpec(spec: FSMProcessSpec): boolean | Returns false for either an invalid process or a valid non-Harness topology. |
isHarnessFSMStateId | function | isHarnessFSMStateId(value: string): value is HarnessFSMStateId | Is Harness FSM State ID function with 1 public call signature; parameters and return types are listed below. |
parseFSMProcessSpec | function | parseFSMProcessSpec(input: unknown): FSMProcessSpec | Parse FSM Process Spec function with 1 public call signature; parameters and return types are listed below. |
planHarnessCapabilityPath | function | planHarnessCapabilityPath(from: HarnessFSMStateId, to: HarnessFSMStateId): HarnessFSMStateId[] | Plans only normal capability movement. Recovery, compensation, quarantine, human review, failure, and cancellation are selected by their dedicated supervisors and can never be traversed as a shortcut for Domain work. |
validateFSMProcessSpec | function | validateFSMProcessSpec(spec: FSMProcessSpec): void | Validate FSM Process Spec function with 1 public call signature; parameters and return types are listed below. |
validateFSMSnapshot | function | validateFSMSnapshot(spec: FSMProcessSpec, snapshot: FSMSnapshot, expectedRunId?: string): void | Validate FSM Snapshot function with 1 public call signature; parameters and return types are listed below. |
FSMGuardContext | interface | interface FSMGuardContext | FSM Guard Context interface with 3 public fields or methods. |
FSMProcessSpec | interface | interface FSMProcessSpec extends VersionedSpec, SpecMetadata | FSM Process Spec interface with 13 public fields or methods. |
FSMRecoveryDecisionRecord | interface | interface FSMRecoveryDecisionRecord | FSM Recovery Decision Record interface with 4 public fields or methods. |
FSMRuntimeCancelOptions | interface | interface FSMRuntimeCancelOptions extends FSMRuntimeTransitionOptions | FSM Runtime Cancel Options interface with 8 public fields or methods. |
FSMRuntimeOptions | interface | interface FSMRuntimeOptions | FSM Runtime Options interface with 5 public fields or methods. |
FSMRuntimeTransitionOptions | interface | interface FSMRuntimeTransitionOptions extends FSMTransitionOptions | FSM Runtime Transition Options interface with 7 public fields or methods. |
FSMSnapshot | interface | interface FSMSnapshot | FSM Snapshot interface with 8 public fields or methods. |
FSMStateEnteredRecord | interface | interface FSMStateEnteredRecord | FSM State Entered Record interface with 7 public fields or methods. |
FSMStateSpec | interface | interface FSMStateSpec extends SpecMetadata | FSM State Spec interface with 15 public fields or methods. |
FSMTimeoutEvaluation | interface | interface FSMTimeoutEvaluation | FSM Timeout Evaluation interface with 5 public fields or methods. |
FSMTopologyAnalysis | interface | interface FSMTopologyAnalysis | FSM Topology Analysis interface with 5 public fields or methods. |
FSMTransitionOptions | interface | interface FSMTransitionOptions | FSM Transition Options interface with 3 public fields or methods. |
FSMTransitionSpec | interface | interface FSMTransitionSpec | FSM Transition Spec interface with 5 public fields or methods. |
StateTransition | interface | interface StateTransition | State Transition interface with 8 public fields or methods. |
FSMGuardEvaluator | type | type FSMGuardEvaluator = (guard: string, context: FSMGuardContext) => boolean | Public type alias for FSM Guard Evaluator; the declaration contains its complete type expression. |
FSMStateKind | type | type FSMStateKind = 'idle' | 'run_initialized' | 'context_built' | 'reasoning' | 'action_selected' | 'policy_checked' | 'acting' | 'observation_recorded' | 'verifying' | 'memory_sync' | 'recovering' | 'compensating' | 'quarantined' | 'human_review' | 'completed' | 'failed' | 'cancelled' | 'domain' | Public type alias for FSM State Kind; the declaration contains its complete type expression. |
FsmTerminalStatus | type | type FsmTerminalStatus = 'completed' | 'failed' | 'cancelled' | Public type alias for FSM Terminal Status; the declaration contains its complete type expression. |
HarnessCapabilityArea | type | type HarnessCapabilityArea = 'lifecycle' | 'context' | 'reasoning' | 'policy' | 'activity' | 'observation' | 'verification' | 'memory' | 'recovery' | 'human_review' | 'terminal' | Public type alias for Harness Capability Area; the declaration contains its complete type expression. |
HarnessFSMStateId | type | type HarnessFSMStateId = (typeof HARNESS_FSM_STATE_IDS)[number] | Public type alias for Harness FSM State ID; the declaration contains its complete type expression. |
FSMRuntime
FSM Runtime class with 8 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { FSMRuntime } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare class FSMRuntime {
constructor(spec: FSMProcessSpec, runId: string, options?: FSMRuntimeOptions, snapshot?: FSMSnapshot);
getSnapshot(): FSMSnapshot;
start(metadata?: Record<string, unknown>): Promise<FSMSnapshot>;
transition(to: string, options?: FSMRuntimeTransitionOptions): Promise<StateTransition>;
transitionPath(states: string[], options?: FSMRuntimeTransitionOptions): Promise<StateTransition[]>;
cancel(options?: FSMRuntimeCancelOptions): Promise<StateTransition>;
decideRecovery(anomaly: FSMAnomaly, options?: {
stateId?: string;
now?: string;
}): Promise<FSMRecoveryDecision>;
registerRecoverySuccess(circuitKey: string, now?: string): FSMSnapshot;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
cancel | method | cancel(options?: FSMRuntimeCancelOptions): Promise<StateTransition> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (spec: FSMProcessSpec, runId: string, options?: FSMRuntimeOptions, snapshot?: FSMSnapshot): FSMRuntime | Creates an instance of this class. |
decideRecovery | method | decideRecovery(anomaly: FSMAnomaly, options?: { stateId?: string; now?: string; }): Promise<FSMRecoveryDecision> | Public method; parameters and return type are shown in the signature. |
getSnapshot | method | getSnapshot(): FSMSnapshot | Public method; parameters and return type are shown in the signature. |
registerRecoverySuccess | method | registerRecoverySuccess(circuitKey: string, now?: string): FSMSnapshot | Public method; parameters and return type are shown in the signature. |
start | method | start(metadata?: Record<string, unknown>): Promise<FSMSnapshot> | Public method; parameters and return type are shown in the signature. |
transition | method | transition(to: string, options?: FSMRuntimeTransitionOptions): Promise<StateTransition> | Public method; parameters and return type are shown in the signature. |
transitionPath | method | transitionPath(states: string[], options?: FSMRuntimeTransitionOptions): Promise<StateTransition[]> | Public method; parameters and return type are shown in the signature. |
defaultReActFSMProcessSpec
Default ReAct FSM Process Spec constant exported by the index module.
- Kind: constant
- Import:
import { defaultReActFSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const defaultReActFSMProcessSpec: FSMProcessSpec;fsmProcessSpecDefinition
Runtime validation entrypoint for the FSM Process spec, combining its parser, example and JSON Schema.
- Kind: constant
- Import:
import { fsmProcessSpecDefinition } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const fsmProcessSpecDefinition: SpecSchemaDefinition<FSMProcessSpec>;fsmProcessSpecExample
Valid example value for FSM Process Spec.
- Kind: constant
- Import:
import { fsmProcessSpecExample } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const fsmProcessSpecExample: FSMProcessSpec;fsmProcessSpecJsonSchema
JSON Schema for FSM Process Spec.
- Kind: constant
- Import:
import { fsmProcessSpecJsonSchema } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const fsmProcessSpecJsonSchema: JsonSchema;fsmProcessSpecSchema
Runtime schema for FSM Process Spec.
- Kind: constant
- Import:
import { fsmProcessSpecSchema } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const fsmProcessSpecSchema: (typeof import('@codesoul-co/hypha-fsm'))['fsmProcessSpecSchema'];This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.
fsmSpecDefinitions
FSM Spec Definitions constant exported by the index module.
- Kind: constant
- Import:
import { fsmSpecDefinitions } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const fsmSpecDefinitions: readonly [SpecSchemaDefinition<FSMProcessSpec>];fsmSpecJsonSchemas
FSM Spec JSON Schemas constant exported by the index module.
- Kind: constant
- Import:
import { fsmSpecJsonSchemas } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const fsmSpecJsonSchemas: Record<string, JsonSchema>;fsmStateSpecSchema
Runtime schema for FSM State Spec.
- Kind: constant
- Import:
import { fsmStateSpecSchema } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const fsmStateSpecSchema: (typeof import('@codesoul-co/hypha-fsm'))['fsmStateSpecSchema'];This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.
fsmTransitionSpecSchema
Runtime schema for FSM Transition Spec.
- Kind: constant
- Import:
import { fsmTransitionSpecSchema } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const fsmTransitionSpecSchema: z.ZodObject<{ from: z.ZodString; to: z.ZodString; guard: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; traceEvent: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { from: string; to: string; description?: string | undefined; guard?: string | undefined; traceEvent?: string | undefined; }, { from: string; to: string; description?: string | undefined; guard?: string | undefined; traceEvent?: string | undefined; }>;HARNESS_FSM_STATE_IDS
Stable Harness states owned by the framework runtime. Domain Packs may bind capabilities and policy to these phases, but must not add, remove, rename, or reconnect them.
- Kind: constant
- Import:
import { HARNESS_FSM_STATE_IDS } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const HARNESS_FSM_STATE_IDS: readonly ["Idle", "RunInitialized", "ContextBuilt", "Reasoning", "ActionSelected", "PolicyChecked", "Acting", "ObservationRecorded", "Verifying", "MemorySync", "Recovering", "Compensating", "Quarantined", "HumanReview", "Completed", "Failed", "Cancelled"];HARNESS_STATE_CAPABILITY_AREA
activity is the governed side-effect phase shared by Tool, MCP, Execution, file, Memory-write, and external-write adapters. The concrete activity type remains Event evidence; it never becomes a Domain-defined FSM state.
- Kind: constant
- Import:
import { HARNESS_STATE_CAPABILITY_AREA } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const HARNESS_STATE_CAPABILITY_AREA: Readonly<Record<"Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled", HarnessCapabilityArea>>;REACT_FSM_STATE_PATH
REACT FSM STATE PATH constant exported by the index module.
- Kind: constant
- Import:
import { REACT_FSM_STATE_PATH } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const REACT_FSM_STATE_PATH: readonly ["Idle", "RunInitialized", "ContextBuilt", "Reasoning", "ActionSelected", "PolicyChecked", "Acting", "ObservationRecorded", "Verifying", "MemorySync", "Completed"];REACT_PHASE_TO_HARNESS_STATE
REACT PHASE TO HARNESS STATE constant exported by the index module.
- Kind: constant
- Import:
import { REACT_PHASE_TO_HARNESS_STATE } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare const REACT_PHASE_TO_HARNESS_STATE: Readonly<{ reason: "Reasoning"; select_action: "ActionSelected"; policy_check: "PolicyChecked"; act: "Acting"; observe_result: "ObservationRecorded"; verify: "Verifying"; memory_sync: "MemorySync"; complete: "Completed"; fail: "Failed"; human_review: "HumanReview"; cancel: "Cancelled"; }>;analyzeFSMTopology
Describes graph properties without imposing product-specific topology rules. Callers can decide whether unreachable states, non-terminal dead ends, or cycles are valid for their Domain workflow.
- Kind: function
- Import:
import { analyzeFSMTopology } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function analyzeFSMTopology(spec: FSMProcessSpec): FSMTopologyAnalysis;Call signature
analyzeFSMTopology(spec: FSMProcessSpec): FSMTopologyAnalysisDescribes graph properties without imposing product-specific topology rules. Callers can decide whether unreachable states, non-terminal dead ends, or cycles are valid for their Domain workflow.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
FSMTopologyAnalysis - Description: The return contract is defined by the type shown above.
applyTransition
Apply Transition function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { applyTransition } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function applyTransition(spec: FSMProcessSpec, snapshot: FSMSnapshot, to: string, nowOrOptions?: string | FSMTransitionOptions): FSMSnapshot;Call signature
applyTransition(spec: FSMProcessSpec, snapshot: FSMSnapshot, to: string, nowOrOptions?: string | FSMTransitionOptions): FSMSnapshotParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
snapshot | FSMSnapshot | Yes | Required parameter; accepted values are defined by the type column. |
to | string | Yes | Required parameter; accepted values are defined by the type column. |
nowOrOptions | string | FSMTransitionOptions | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
FSMSnapshot - Description: The return contract is defined by the type shown above.
applyTransitionWithRuntimePolicy
Apply Transition With Runtime Policy function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { applyTransitionWithRuntimePolicy } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function applyTransitionWithRuntimePolicy(spec: FSMProcessSpec, snapshot: FSMSnapshot, to: string, options?: FSMRuntimeTransitionOptions): Promise<FSMSnapshot>;Call signature
applyTransitionWithRuntimePolicy(spec: FSMProcessSpec, snapshot: FSMSnapshot, to: string, options?: FSMRuntimeTransitionOptions): Promise<FSMSnapshot>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
snapshot | FSMSnapshot | Yes | Required parameter; accepted values are defined by the type column. |
to | string | Yes | Required parameter; accepted values are defined by the type column. |
options | FSMRuntimeTransitionOptions | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
Promise<FSMSnapshot> - Description: The return contract is defined by the type shown above.
assertHarnessFSMProcessSpec
Fails closed when an application or Domain Pack attempts to replace the Harness capability topology with a product workflow.
- Kind: function
- Import:
import { assertHarnessFSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function assertHarnessFSMProcessSpec(spec: FSMProcessSpec): void;Call signature
assertHarnessFSMProcessSpec(spec: FSMProcessSpec): voidFails closed when an application or Domain Pack attempts to replace the Harness capability topology with a product workflow.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
void - Description: Returns no value.
canRetryState
Can Retry State function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { canRetryState } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function canRetryState(spec: FSMProcessSpec, stateId: string, attemptedCount: number): boolean;Call signature
canRetryState(spec: FSMProcessSpec, stateId: string, attemptedCount: number): booleanParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
stateId | string | Yes | Required parameter; accepted values are defined by the type column. |
attemptedCount | number | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
boolean - Description: The return contract is defined by the type shown above.
createHarnessFSMProcessSpec
Returns an isolated copy so composition code cannot mutate the shared contract.
- Kind: function
- Import:
import { createHarnessFSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function createHarnessFSMProcessSpec(): FSMProcessSpec;Call signature
createHarnessFSMProcessSpec(): FSMProcessSpecReturns an isolated copy so composition code cannot mutate the shared contract.
Parameters
No parameters.
Returns
- Type:
FSMProcessSpec - Description: The return contract is defined by the type shown above.
createInitialSnapshot
Create Initial Snapshot function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createInitialSnapshot } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function createInitialSnapshot(spec: FSMProcessSpec, runId: string, now?: string): FSMSnapshot;Call signature
createInitialSnapshot(spec: FSMProcessSpec, runId: string, now?: string): FSMSnapshotParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
runId | string | Yes | Required parameter; accepted values are defined by the type column. |
now | string | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
FSMSnapshot - Description: The return contract is defined by the type shown above.
evaluateGuardExpression
Evaluate Guard Expression function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { evaluateGuardExpression } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function evaluateGuardExpression(guard: string, context?: FSMGuardContext): boolean;Call signature
evaluateGuardExpression(guard: string, context?: FSMGuardContext): booleanParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
guard | string | Yes | Required parameter; accepted values are defined by the type column. |
context | FSMGuardContext | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
boolean - Description: The return contract is defined by the type shown above.
evaluateStateTimeout
Evaluate State Timeout function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { evaluateStateTimeout } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function evaluateStateTimeout(spec: FSMProcessSpec, snapshot: FSMSnapshot, now?: string): FSMTimeoutEvaluation | null;Call signature
evaluateStateTimeout(spec: FSMProcessSpec, snapshot: FSMSnapshot, now?: string): FSMTimeoutEvaluation | nullParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
snapshot | FSMSnapshot | Yes | Required parameter; accepted values are defined by the type column. |
now | string | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
FSMTimeoutEvaluation - Description: The return contract is defined by the type shown above.
getAllowedTransitions
Get Allowed Transitions function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { getAllowedTransitions } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function getAllowedTransitions(spec: FSMProcessSpec, stateId: string): FSMTransitionSpec[];Call signature
getAllowedTransitions(spec: FSMProcessSpec, stateId: string): FSMTransitionSpec[]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
stateId | string | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
FSMTransitionSpec[] - Description: The return contract is defined by the type shown above.
harnessStateForReActPhase
Harness State For ReAct Phase function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { harnessStateForReActPhase } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function harnessStateForReActPhase(phase: string): HarnessFSMStateId | undefined;Call signature
harnessStateForReActPhase(phase: string): HarnessFSMStateId | undefinedParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phase | string | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
"Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled" - Description: The return contract is defined by the type shown above.
isHarnessFSMProcessSpec
Returns false for either an invalid process or a valid non-Harness topology.
- Kind: function
- Import:
import { isHarnessFSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function isHarnessFSMProcessSpec(spec: FSMProcessSpec): boolean;Call signature
isHarnessFSMProcessSpec(spec: FSMProcessSpec): booleanReturns false for either an invalid process or a valid non-Harness topology.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
boolean - Description: The return contract is defined by the type shown above.
isHarnessFSMStateId
Is Harness FSM State ID function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { isHarnessFSMStateId } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function isHarnessFSMStateId(value: string): value is HarnessFSMStateId;Call signature
isHarnessFSMStateId(value: string): value is HarnessFSMStateIdParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | string | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
value is "Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled" - Description: The return contract is defined by the type shown above.
parseFSMProcessSpec
Parse FSM Process Spec function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { parseFSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function parseFSMProcessSpec(input: unknown): FSMProcessSpec;Call signature
parseFSMProcessSpec(input: unknown): FSMProcessSpecParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
FSMProcessSpec - Description: The return contract is defined by the type shown above.
planHarnessCapabilityPath
Plans only normal capability movement. Recovery, compensation, quarantine, human review, failure, and cancellation are selected by their dedicated supervisors and can never be traversed as a shortcut for Domain work.
- Kind: function
- Import:
import { planHarnessCapabilityPath } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function planHarnessCapabilityPath(from: HarnessFSMStateId, to: HarnessFSMStateId): HarnessFSMStateId[];Call signature
planHarnessCapabilityPath(from: HarnessFSMStateId, to: HarnessFSMStateId): HarnessFSMStateId[]Plans only normal capability movement. Recovery, compensation, quarantine, human review, failure, and cancellation are selected by their dedicated supervisors and can never be traversed as a shortcut for Domain work.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | "Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled" | Yes | Required parameter; accepted values are defined by the type column. |
to | "Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled" | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
("Idle" | "RunInitialized" | "ContextBuilt" | "Reasoning" | "ActionSelected" | "PolicyChecked" | "Acting" | "ObservationRecorded" | "Verifying" | "MemorySync" | "Recovering" | "Compensating" | "Quarantined" | "HumanReview" | "Completed" | "Failed" | "Cancelled")[] - Description: The return contract is defined by the type shown above.
validateFSMProcessSpec
Validate FSM Process Spec function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { validateFSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function validateFSMProcessSpec(spec: FSMProcessSpec): void;Call signature
validateFSMProcessSpec(spec: FSMProcessSpec): voidParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
void - Description: Returns no value.
validateFSMSnapshot
Validate FSM Snapshot function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { validateFSMSnapshot } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export declare function validateFSMSnapshot(spec: FSMProcessSpec, snapshot: FSMSnapshot, expectedRunId?: string): void;Call signature
validateFSMSnapshot(spec: FSMProcessSpec, snapshot: FSMSnapshot, expectedRunId?: string): voidParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spec | FSMProcessSpec | Yes | Required parameter; accepted values are defined by the type column. |
snapshot | FSMSnapshot | Yes | Required parameter; accepted values are defined by the type column. |
expectedRunId | string | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
void - Description: Returns no value.
FSMGuardContext
FSM Guard Context interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { FSMGuardContext } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMGuardContext {
input?: unknown;
variables?: Record<string, unknown>;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
input | property | input?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
variables | property | variables?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMProcessSpec
FSM Process Spec interface with 13 public fields or methods.
- Kind: interface
- Import:
import type { FSMProcessSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMProcessSpec extends VersionedSpec, SpecMetadata {
initialState: string;
states: FSMStateSpec[];
transitions: FSMTransitionSpec[];
terminalStates: string[];
recoveryPolicy?: FSMRecoveryPolicySpec;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
createdAt | property | createdAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
description | property | description?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
initialState | property | initialState: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
name | property | name?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
owner | property | owner?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
recoveryPolicy | property | recoveryPolicy?: FSMRecoveryPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
states | property | states: FSMStateSpec[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
tags | property | tags?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
terminalStates | property | terminalStates: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
transitions | property | transitions: FSMTransitionSpec[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
updatedAt | property | updatedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
version | property | version: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMRecoveryDecisionRecord
FSM Recovery Decision Record interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { FSMRecoveryDecisionRecord } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMRecoveryDecisionRecord {
processId: string;
runId: string;
decision: FSMRecoveryDecision;
snapshot: FSMSnapshot;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
decision | property | decision: FSMRecoveryDecision | Public property; its type, readonly modifier and optionality are shown in the signature. |
processId | property | processId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshot | property | snapshot: FSMSnapshot | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMRuntimeCancelOptions
FSM Runtime Cancel Options interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { FSMRuntimeCancelOptions } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMRuntimeCancelOptions extends FSMRuntimeTransitionOptions {
reason?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
guardContext | property | guardContext?: FSMGuardContext | Public property; its type, readonly modifier and optionality are shown in the signature. |
guardEvaluator | method | guardEvaluator?(guard: string, context: FSMGuardContext): boolean | Public method; parameters and return type are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
now | property | now?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policy | property | policy?: PolicyEngine | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
stepId | property | stepId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMRuntimeOptions
FSM Runtime Options interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { FSMRuntimeOptions } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMRuntimeOptions {
now?: () => string;
policy?: PolicyEngine;
onStateEntered?: (record: FSMStateEnteredRecord) => Promise<void> | void;
onTransition?: (record: StateTransition) => Promise<void> | void;
onRecoveryDecision?: (record: FSMRecoveryDecisionRecord) => Promise<void> | void;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
now | method | now?(): string | Public method; parameters and return type are shown in the signature. |
onRecoveryDecision | method | onRecoveryDecision?(record: FSMRecoveryDecisionRecord): Promise<void> | void | Public method; parameters and return type are shown in the signature. |
onStateEntered | method | onStateEntered?(record: FSMStateEnteredRecord): Promise<void> | void | Public method; parameters and return type are shown in the signature. |
onTransition | method | onTransition?(record: StateTransition): Promise<void> | void | Public method; parameters and return type are shown in the signature. |
policy | property | policy?: PolicyEngine | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMRuntimeTransitionOptions
FSM Runtime Transition Options interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { FSMRuntimeTransitionOptions } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMRuntimeTransitionOptions extends FSMTransitionOptions {
userId?: string;
stepId?: string;
policy?: PolicyEngine;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
guardContext | property | guardContext?: FSMGuardContext | Public property; its type, readonly modifier and optionality are shown in the signature. |
guardEvaluator | method | guardEvaluator?(guard: string, context: FSMGuardContext): boolean | Public method; parameters and return type are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
now | property | now?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policy | property | policy?: PolicyEngine | Public property; its type, readonly modifier and optionality are shown in the signature. |
stepId | property | stepId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMSnapshot
FSM Snapshot interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { FSMSnapshot } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMSnapshot {
processId: string;
runId: string;
currentState: string;
statePath: string[];
status: 'running' | FsmTerminalStatus;
updatedAt: string;
recovery?: FSMRecoverySnapshot;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
currentState | property | currentState: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
processId | property | processId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
recovery | property | recovery?: FSMRecoverySnapshot | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
statePath | property | statePath: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "running" | FsmTerminalStatus | Public property; its type, readonly modifier and optionality are shown in the signature. |
updatedAt | property | updatedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMStateEnteredRecord
FSM State Entered Record interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { FSMStateEnteredRecord } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMStateEnteredRecord {
processId: string;
runId: string;
stateId: string;
fromState?: string;
snapshot: FSMSnapshot;
enteredAt: string;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
enteredAt | property | enteredAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
fromState | property | fromState?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
processId | property | processId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshot | property | snapshot: FSMSnapshot | Public property; its type, readonly modifier and optionality are shown in the signature. |
stateId | property | stateId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMStateSpec
FSM State Spec interface with 15 public fields or methods.
- Kind: interface
- Import:
import type { FSMStateSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMStateSpec extends SpecMetadata {
id: string;
kind?: FSMStateKind;
entryAction?: string;
exitAction?: string;
timeoutPolicy?: TimeoutPolicySpec;
retryPolicy?: RetryPolicySpec;
humanReviewPolicy?: HumanReviewPolicySpec;
policyRefs?: string[];
traceEvents?: string[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
createdAt | property | createdAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
description | property | description?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
entryAction | property | entryAction?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
exitAction | property | exitAction?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
humanReviewPolicy | property | humanReviewPolicy?: HumanReviewPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind?: FSMStateKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
name | property | name?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
owner | property | owner?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRefs | property | policyRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
retryPolicy | property | retryPolicy?: RetryPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
tags | property | tags?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
timeoutPolicy | property | timeoutPolicy?: TimeoutPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
traceEvents | property | traceEvents?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
updatedAt | property | updatedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMTimeoutEvaluation
FSM Timeout Evaluation interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { FSMTimeoutEvaluation } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMTimeoutEvaluation {
timedOut: boolean;
action?: NonNullable<TimeoutPolicySpec['onTimeout']>;
stateId: string;
elapsedMs: number;
timeoutMs: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
action | property | action?: NonNullable<"fail" | "retry" | "human_review"> | Public property; its type, readonly modifier and optionality are shown in the signature. |
elapsedMs | property | elapsedMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
stateId | property | stateId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
timedOut | property | timedOut: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
timeoutMs | property | timeoutMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMTopologyAnalysis
FSM Topology Analysis interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { FSMTopologyAnalysis } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMTopologyAnalysis {
initialState: string;
reachableStates: string[];
unreachableStates: string[];
deadEndStates: string[];
cycleStates: string[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
cycleStates | property | cycleStates: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
deadEndStates | property | deadEndStates: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
initialState | property | initialState: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reachableStates | property | reachableStates: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
unreachableStates | property | unreachableStates: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMTransitionOptions
FSM Transition Options interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { FSMTransitionOptions } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMTransitionOptions {
now?: string;
guardContext?: FSMGuardContext;
guardEvaluator?: FSMGuardEvaluator;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
guardContext | property | guardContext?: FSMGuardContext | Public property; its type, readonly modifier and optionality are shown in the signature. |
guardEvaluator | method | guardEvaluator?(guard: string, context: FSMGuardContext): boolean | Public method; parameters and return type are shown in the signature. |
now | property | now?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMTransitionSpec
FSM Transition Spec interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { FSMTransitionSpec } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface FSMTransitionSpec {
from: string;
to: string;
guard?: string;
description?: string;
traceEvent?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
description | property | description?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
from | property | from: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
guard | property | guard?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
to | property | to: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
traceEvent | property | traceEvent?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
StateTransition
State Transition interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { StateTransition } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export interface StateTransition {
processId: string;
runId: string;
from: string;
to: string;
transition: FSMTransitionSpec;
snapshot: FSMSnapshot;
acceptedAt: string;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
acceptedAt | property | acceptedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
from | property | from: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
processId | property | processId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshot | property | snapshot: FSMSnapshot | Public property; its type, readonly modifier and optionality are shown in the signature. |
to | property | to: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
transition | property | transition: FSMTransitionSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
FSMGuardEvaluator
Public type alias for FSM Guard Evaluator; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { FSMGuardEvaluator } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export type FSMGuardEvaluator = (guard: string, context: FSMGuardContext) => boolean;FSMStateKind
Public type alias for FSM State Kind; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { FSMStateKind } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export type FSMStateKind = 'idle' | 'run_initialized' | 'context_built' | 'reasoning' | 'action_selected' | 'policy_checked' | 'acting' | 'observation_recorded' | 'verifying' | 'memory_sync' | 'recovering' | 'compensating' | 'quarantined' | 'human_review' | 'completed' | 'failed' | 'cancelled' | 'domain';FsmTerminalStatus
Public type alias for FSM Terminal Status; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { FsmTerminalStatus } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export type FsmTerminalStatus = 'completed' | 'failed' | 'cancelled';HarnessCapabilityArea
Public type alias for Harness Capability Area; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { HarnessCapabilityArea } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export type HarnessCapabilityArea = 'lifecycle' | 'context' | 'reasoning' | 'policy' | 'activity' | 'observation' | 'verification' | 'memory' | 'recovery' | 'human_review' | 'terminal';HarnessFSMStateId
Public type alias for Harness FSM State ID; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { HarnessFSMStateId } from '@codesoul-co/hypha-fsm'; - Source module:
index
Declaration
export type HarnessFSMStateId = (typeof HARNESS_FSM_STATE_IDS)[number];