@codesoul-co/hypha-core / modules/runtime/runtime-helper-sdk
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/modules/runtime/runtime-helper-sdk.ts - Exports: 8
Using this module
Use the Runtime helper sdk module for executing runtime behavior at this boundary. It exports 5 classes, 2 functions, 1 interface.
Import from the package entrypoint
import {
DefaultRuntimeTransitionHelper,
DefaultRuntimeWaitHelper,
DeterministicRuntimeClockHelper,
DeterministicRuntimeIdHelper,
InMemoryRuntimeDeterminismStore,
createRuntimeHelperSdk,
deterministicObservationKey,
} from '@codesoul-co/hypha-core';
import type {
CreateRuntimeHelperSdkOptions,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 5 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
- The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
DefaultRuntimeTransitionHelper | class | new DefaultRuntimeTransitionHelper(): DefaultRuntimeTransitionHelper | Default Runtime Transition Helper class with 5 public constructor or member entries; its exact declarations are listed below. |
DefaultRuntimeWaitHelper | class | new DefaultRuntimeWaitHelper(): DefaultRuntimeWaitHelper | Default Runtime Wait Helper class with 5 public constructor or member entries; its exact declarations are listed below. |
DeterministicRuntimeClockHelper | class | new DeterministicRuntimeClockHelper(scope: RuntimeDeterminismScope, store: RuntimeDeterminismStore, waits: RuntimeWaitHelper, source?: () => string): DeterministicRuntimeClockHelper | Deterministic Runtime Clock Helper class with 3 public constructor or member entries; its exact declarations are listed below. |
DeterministicRuntimeIdHelper | class | new DeterministicRuntimeIdHelper(scope: RuntimeDeterminismScope, store: RuntimeDeterminismStore, source?: (namespace: string) => string): DeterministicRuntimeIdHelper | Deterministic Runtime ID Helper class with 2 public constructor or member entries; its exact declarations are listed below. |
InMemoryRuntimeDeterminismStore | class | new InMemoryRuntimeDeterminismStore(): InMemoryRuntimeDeterminismStore | In Memory Runtime Determinism Store class with 2 public constructor or member entries; its exact declarations are listed below. |
createRuntimeHelperSdk | function | createRuntimeHelperSdk(options: CreateRuntimeHelperSdkOptions): RuntimeHelperSdk | Create Runtime Helper Sdk function with 1 public call signature; parameters and return types are listed below. |
deterministicObservationKey | function | deterministicObservationKey(scope: RuntimeDeterminismScope, key: string): string | Deterministic Observation Key function with 1 public call signature; parameters and return types are listed below. |
CreateRuntimeHelperSdkOptions | interface | interface CreateRuntimeHelperSdkOptions | Create Runtime Helper Sdk Options interface with 4 public fields or methods. |
DefaultRuntimeTransitionHelper
Default Runtime Transition Helper class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DefaultRuntimeTransitionHelper } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare class DefaultRuntimeTransitionHelper implements RuntimeTransitionHelper {
propose(to: string, reason?: string, variablesPatch?: Record<string, RuntimeJsonValue>): RuntimeTransitionProposal;
complete(output?: RuntimeJsonValue, variablesPatch?: Record<string, RuntimeJsonValue>): RuntimeStateExecutionResult;
continue(observation?: RuntimeJsonValue): RuntimeStateExecutionResult;
fail(error: NormalizedRuntimeError): RuntimeStateExecutionResult;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
complete | method | complete(output?: RuntimeJsonValue, variablesPatch?: Record<string, RuntimeJsonValue>): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (): DefaultRuntimeTransitionHelper | Creates an instance of this class. |
continue | method | continue(observation?: RuntimeJsonValue): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
fail | method | fail(error: NormalizedRuntimeError): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
propose | method | propose(to: string, reason?: string, variablesPatch?: Record<string, RuntimeJsonValue>): RuntimeTransitionProposal | Public method; parameters and return type are shown in the signature. |
DefaultRuntimeWaitHelper
Default Runtime Wait Helper class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DefaultRuntimeWaitHelper } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare class DefaultRuntimeWaitHelper implements RuntimeWaitHelper {
human(request: HumanWaitRequest): RuntimeStateExecutionResult;
signal(request: SignalWaitRequest): RuntimeStateExecutionResult;
timer(request: TimerWaitRequest): RuntimeStateExecutionResult;
pause(request: PauseRequest): RuntimeStateExecutionResult;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): DefaultRuntimeWaitHelper | Creates an instance of this class. |
human | method | human(request: HumanWaitRequest): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
pause | method | pause(request: PauseRequest): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
signal | method | signal(request: SignalWaitRequest): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
timer | method | timer(request: TimerWaitRequest): RuntimeStateExecutionResult | Public method; parameters and return type are shown in the signature. |
DeterministicRuntimeClockHelper
Deterministic Runtime Clock Helper class with 3 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DeterministicRuntimeClockHelper } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare class DeterministicRuntimeClockHelper implements RuntimeClockHelper {
constructor(scope: RuntimeDeterminismScope, store: RuntimeDeterminismStore, waits: RuntimeWaitHelper, source?: () => string);
now(): Promise<string>;
sleepUntil(isoTime: string): Promise<RuntimeStateExecutionResult>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (scope: RuntimeDeterminismScope, store: RuntimeDeterminismStore, waits: RuntimeWaitHelper, source?: () => string): DeterministicRuntimeClockHelper | Creates an instance of this class. |
now | method | now(): Promise<string> | Public method; parameters and return type are shown in the signature. |
sleepUntil | method | sleepUntil(isoTime: string): Promise<RuntimeStateExecutionResult> | Public method; parameters and return type are shown in the signature. |
DeterministicRuntimeIdHelper
Deterministic Runtime ID Helper class with 2 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DeterministicRuntimeIdHelper } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare class DeterministicRuntimeIdHelper implements RuntimeIdHelper {
constructor(scope: RuntimeDeterminismScope, store: RuntimeDeterminismStore, source?: (namespace: string) => string);
next(namespace: string): Promise<string>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (scope: RuntimeDeterminismScope, store: RuntimeDeterminismStore, source?: (namespace: string) => string): DeterministicRuntimeIdHelper | Creates an instance of this class. |
next | method | next(namespace: string): Promise<string> | Public method; parameters and return type are shown in the signature. |
InMemoryRuntimeDeterminismStore
In Memory Runtime Determinism Store class with 2 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryRuntimeDeterminismStore } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare class InMemoryRuntimeDeterminismStore implements RuntimeDeterminismStore {
resolve<T extends RuntimeJsonValue>(request: RuntimeDeterminismResolveRequest, produce: () => T | Promise<T>): Promise<RuntimeDeterminismResolution<T>>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): InMemoryRuntimeDeterminismStore | Creates an instance of this class. |
resolve | method | resolve<T extends RuntimeJsonValue>(request: RuntimeDeterminismResolveRequest, produce: () => T | Promise<T>): Promise<RuntimeDeterminismResolution<T>> | Public method; parameters and return type are shown in the signature. |
createRuntimeHelperSdk
Create Runtime Helper Sdk function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createRuntimeHelperSdk } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare function createRuntimeHelperSdk(options: CreateRuntimeHelperSdkOptions): RuntimeHelperSdk;Call signature
createRuntimeHelperSdk(options: CreateRuntimeHelperSdkOptions): RuntimeHelperSdkParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | CreateRuntimeHelperSdkOptions | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
RuntimeHelperSdk - Description: The return contract is defined by the type shown above.
deterministicObservationKey
Deterministic Observation Key function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { deterministicObservationKey } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export declare function deterministicObservationKey(scope: RuntimeDeterminismScope, key: string): string;Call signature
deterministicObservationKey(scope: RuntimeDeterminismScope, key: string): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope | RuntimeDeterminismScope | Yes | Required parameter; accepted values are defined by the type column. |
key | string | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
CreateRuntimeHelperSdkOptions
Create Runtime Helper Sdk Options interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { CreateRuntimeHelperSdkOptions } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-helper-sdk
Declaration
export interface CreateRuntimeHelperSdkOptions {
scope: RuntimeDeterminismScope;
determinismStore: RuntimeDeterminismStore;
now?: () => string;
nextId?: (namespace: string) => string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
determinismStore | property | determinismStore: RuntimeDeterminismStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
nextId | method | nextId?(namespace: string): string | Public method; parameters and return type are shown in the signature. |
now | method | now?(): string | Public method; parameters and return type are shown in the signature. |
scope | property | scope: RuntimeDeterminismScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
