Skip to content

@codesoul-co/hypha-core / contracts/runtime-helpers

Using this module

Use the Runtime helpers module for declaring and runtime-validating contracts. It exports 2 constants, 27 interfaces, 4 types.

Import from the package entrypoint

ts
import {
  RUNTIME_DETERMINISTIC_OBSERVATION_KINDS,
  RUNTIME_WAIT_INTENT_TYPES,
} from '@codesoul-co/hypha-core';

import type {
  HumanWaitRequest,
  PauseRequest,
  RuntimeClockHelper,
  RuntimeDeterminismResolution,
  RuntimeDeterminismResolveRequest,
  RuntimeDeterminismScope,
  RuntimeDeterminismStore,
  RuntimeDeterministicObservation,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 31 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The 2 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
RUNTIME_DETERMINISTIC_OBSERVATION_KINDSconstantconst RUNTIME_DETERMINISTIC_OBSERVATION_KINDS: readonly ["clock", "id"]RUNTIME DETERMINISTIC OBSERVATION KINDS constant exported by the contracts/runtime-helpers module.
RUNTIME_WAIT_INTENT_TYPESconstantconst RUNTIME_WAIT_INTENT_TYPES: readonly ["human", "signal", "timer", "pause"]RUNTIME WAIT INTENT TYPES constant exported by the contracts/runtime-helpers module.
HumanWaitRequestinterfaceinterface HumanWaitRequestHuman Wait Request interface with 5 public fields or methods.
PauseRequestinterfaceinterface PauseRequestPause Request interface with 3 public fields or methods.
RuntimeClockHelperinterfaceinterface RuntimeClockHelperRuntime Clock Helper interface with 2 public fields or methods.
RuntimeDeterminismResolutioninterfaceinterface RuntimeDeterminismResolutionRuntime Determinism Resolution interface with 2 public fields or methods.
RuntimeDeterminismResolveRequestinterfaceinterface RuntimeDeterminismResolveRequestRuntime Determinism Resolve Request interface with 3 public fields or methods.
RuntimeDeterminismScopeinterfaceinterface RuntimeDeterminismScopeRuntime Determinism Scope interface with 5 public fields or methods.
RuntimeDeterminismStoreinterfaceinterface RuntimeDeterminismStoreRuntime Determinism Store interface with 1 public fields or methods.
RuntimeDeterministicObservationinterfaceinterface RuntimeDeterministicObservationRuntime Deterministic Observation interface with 4 public fields or methods.
RuntimeEventAppendOptionsinterfaceinterface RuntimeEventAppendOptionsRuntime Event Append Options interface with 4 public fields or methods.
RuntimeEventCommitPortinterfaceinterface RuntimeEventCommitPortRuntime Event Commit Port interface with 2 public fields or methods.
RuntimeEventCommitRequestinterfaceinterface RuntimeEventCommitRequestRuntime Event Commit Request interface with 4 public fields or methods.
RuntimeEventHelperinterfaceinterface RuntimeEventHelperRuntime Event Helper interface with 3 public fields or methods.
RuntimeHelperExecutionScopeinterfaceinterface RuntimeHelperExecutionScopeRuntime Helper Execution Scope interface with 6 public fields or methods.
RuntimeHelperSdkinterfaceinterface RuntimeHelperSdkRuntime Helper Sdk interface with 4 public fields or methods.
RuntimeIdHelperinterfaceinterface RuntimeIdHelperRuntime ID Helper interface with 1 public fields or methods.
RuntimeIoHelperSdkinterfaceinterface RuntimeIoHelperSdkRuntime Io Helper Sdk interface with 2 public fields or methods.
RuntimeObservationEventInputinterfaceinterface RuntimeObservationEventInputRuntime Observation Event Input interface with 3 public fields or methods.
RuntimeResourceAcquireOptionsinterfaceinterface RuntimeResourceAcquireOptionsRuntime Resource Acquire Options interface with 2 public fields or methods.
RuntimeResourceHelperinterfaceinterface RuntimeResourceHelperRuntime Resource Helper interface with 4 public fields or methods.
RuntimeResourceHelperDependenciesinterfaceinterface RuntimeResourceHelperDependenciesRuntime Resource Helper Dependencies interface with 5 public fields or methods.
RuntimeResourceRenewOptionsinterfaceinterface RuntimeResourceRenewOptionsRuntime Resource Renew Options interface with 1 public fields or methods.
RuntimeTransitionHelperinterfaceinterface RuntimeTransitionHelperRuntime Transition Helper interface with 4 public fields or methods.
RuntimeTransitionProposalinterfaceinterface RuntimeTransitionProposalRuntime Transition Proposal interface with 3 public fields or methods.
RuntimeWaitHelperinterfaceinterface RuntimeWaitHelperRuntime Wait Helper interface with 4 public fields or methods.
RuntimeWaitIntentinterfaceinterface RuntimeWaitIntentRuntime Wait Intent interface with 8 public fields or methods.
SignalWaitRequestinterfaceinterface SignalWaitRequestSignal Wait Request interface with 5 public fields or methods.
TimerWaitRequestinterfaceinterface TimerWaitRequestTimer Wait Request interface with 3 public fields or methods.
RuntimeDeterministicObservationKindtypetype RuntimeDeterministicObservationKind = (typeof RUNTIME_DETERMINISTIC_OBSERVATION_KINDS)[number]Public type alias for Runtime Deterministic Observation Kind; the declaration contains its complete type expression.
RuntimeJsonValuetypetype RuntimeJsonValue = null | boolean | number | string | RuntimeJsonValue[] | { [key: string]: RuntimeJsonValue; }Public type alias for Runtime JSON Value; the declaration contains its complete type expression.
RuntimeStateExecutionResulttypetype RuntimeStateExecutionResult = { kind: 'completed'; output?: RuntimeJsonValue; variablesPatch?: Record<string, RuntimeJsonValue>; } | { kind: 'continued'; observation?: RuntimeJsonValue; } | { kind: 'failed'; error: NormalizedRuntimeError; } | { kind: 'waiting'; wait: RuntimeWaitIntent; }Public type alias for Runtime State Execution Result; the declaration contains its complete type expression.
RuntimeWaitIntentTypetypetype RuntimeWaitIntentType = (typeof RUNTIME_WAIT_INTENT_TYPES)[number]Public type alias for Runtime Wait Intent Type; the declaration contains its complete type expression.

RUNTIME_DETERMINISTIC_OBSERVATION_KINDS

RUNTIME DETERMINISTIC OBSERVATION KINDS constant exported by the contracts/runtime-helpers module.

  • Kind: constant
  • Import: import { RUNTIME_DETERMINISTIC_OBSERVATION_KINDS } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export declare const RUNTIME_DETERMINISTIC_OBSERVATION_KINDS: readonly ["clock", "id"];

RUNTIME_WAIT_INTENT_TYPES

RUNTIME WAIT INTENT TYPES constant exported by the contracts/runtime-helpers module.

  • Kind: constant
  • Import: import { RUNTIME_WAIT_INTENT_TYPES } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export declare const RUNTIME_WAIT_INTENT_TYPES: readonly ["human", "signal", "timer", "pause"];

HumanWaitRequest

Human Wait Request interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { HumanWaitRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface HumanWaitRequest {
    key?: string;
    expiresAt?: string;
    timeoutTransitionId?: string;
    pendingActionRef?: string;
    metadata?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
expiresAtpropertyexpiresAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
keypropertykey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, RuntimeJsonValue>Public property; its type, readonly modifier and optionality are shown in the signature.
pendingActionRefpropertypendingActionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutTransitionIdpropertytimeoutTransitionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

PauseRequest

Pause Request interface with 3 public fields or methods.

Declaration

text
export interface PauseRequest {
    reason: string;
    resumeKey?: string;
    metadata?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
metadatapropertymetadata?: Record<string, RuntimeJsonValue>Public 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.
resumeKeypropertyresumeKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeClockHelper

Runtime Clock Helper interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeClockHelper } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeClockHelper {
    now(): Promise<string>;
    sleepUntil(isoTime: string): Promise<RuntimeStateExecutionResult>;
}

Contract members

MemberKindSignatureDescription
nowmethodnow(): Promise<string>Public method; parameters and return type are shown in the signature.
sleepUntilmethodsleepUntil(isoTime: string): Promise<RuntimeStateExecutionResult>Public method; parameters and return type are shown in the signature.

RuntimeDeterminismResolution

Runtime Determinism Resolution interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeDeterminismResolution } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeDeterminismResolution<T extends RuntimeJsonValue = RuntimeJsonValue> {
    observation: RuntimeDeterministicObservation<T>;
    reused: boolean;
}

Contract members

MemberKindSignatureDescription
observationpropertyobservation: RuntimeDeterministicObservation<T>Public property; its type, readonly modifier and optionality are shown in the signature.
reusedpropertyreused: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeDeterminismResolveRequest

Runtime Determinism Resolve Request interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeDeterminismResolveRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeDeterminismResolveRequest {
    scope: RuntimeDeterminismScope;
    key: string;
    kind: RuntimeDeterministicObservationKind;
}

Contract members

MemberKindSignatureDescription
keypropertykey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
kindpropertykind: "clock" | "id"Public property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeDeterminismScopePublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeDeterminismScope

Runtime Determinism Scope interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeDeterminismScope } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeDeterminismScope {
    tenantId?: string;
    userId: string;
    runId: string;
    stateId: string;
    stateAttempt: number;
}

Contract members

MemberKindSignatureDescription
runIdpropertyrunId: stringPublic 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.
stateIdpropertystateId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeDeterminismStore

Runtime Determinism Store interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeDeterminismStore } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeDeterminismStore {
    resolve<T extends RuntimeJsonValue>(request: RuntimeDeterminismResolveRequest, produce: () => T | Promise<T>): Promise<RuntimeDeterminismResolution<T>>;
}

Contract members

MemberKindSignatureDescription
resolvemethodresolve<T extends RuntimeJsonValue>(request: RuntimeDeterminismResolveRequest, produce: () => T | Promise<T>): Promise<RuntimeDeterminismResolution<T>>Public method; parameters and return type are shown in the signature.

RuntimeDeterministicObservation

Runtime Deterministic Observation interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeDeterministicObservation } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeDeterministicObservation<T extends RuntimeJsonValue = RuntimeJsonValue> {
    scope: RuntimeDeterminismScope;
    key: string;
    kind: RuntimeDeterministicObservationKind;
    value: T;
}

Contract members

MemberKindSignatureDescription
keypropertykey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
kindpropertykind: "clock" | "id"Public property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeDeterminismScopePublic property; its type, readonly modifier and optionality are shown in the signature.
valuepropertyvalue: TPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeEventAppendOptions

Runtime Event Append Options interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeEventAppendOptions } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeEventAppendOptions {
    idempotencyKey?: string;
    causationId?: string;
    parentEventId?: string;
    metadata?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
causationIdpropertycausationId?: stringPublic 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.
metadatapropertymetadata?: Record<string, RuntimeJsonValue>Public property; its type, readonly modifier and optionality are shown in the signature.
parentEventIdpropertyparentEventId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeEventCommitPort

Runtime Event Commit Port interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeEventCommitPort } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeEventCommitPort {
    append(request: RuntimeEventCommitRequest): Promise<FrameworkEvent[]>;
    readSince(scope: RuntimeScope, sequence: number): Promise<FrameworkEvent[]>;
}

Contract members

MemberKindSignatureDescription
appendmethodappend(request: RuntimeEventCommitRequest): Promise<FrameworkEvent[]>Public method; parameters and return type are shown in the signature.
readSincemethodreadSince(scope: RuntimeScope, sequence: number): Promise<FrameworkEvent[]>Public method; parameters and return type are shown in the signature.

RuntimeEventCommitRequest

Runtime Event Commit Request interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeEventCommitRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeEventCommitRequest {
    scope: RuntimeHelperExecutionScope;
    events: EventCreateInput[];
    fencingToken: number;
    idempotencyKey: string;
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: EventCreateInput<unknown>[]Public property; its type, readonly modifier and optionality are shown in the signature.
fencingTokenpropertyfencingToken: numberPublic 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.
scopepropertyscope: RuntimeHelperExecutionScopePublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeEventHelper

Runtime Event Helper interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeEventHelper } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeEventHelper {
    append<T extends RuntimeJsonValue>(type: RuntimeObservationEventType, payload: T, options?: RuntimeEventAppendOptions): Promise<FrameworkEvent<T>>;
    appendBatch(inputs: RuntimeObservationEventInput[]): Promise<FrameworkEvent[]>;
    readSince(sequence: number): Promise<FrameworkEvent[]>;
}

Contract members

MemberKindSignatureDescription
appendmethodappend<T extends RuntimeJsonValue>(type: RuntimeObservationEventType, payload: T, options?: RuntimeEventAppendOptions): Promise<FrameworkEvent<T>>Public method; parameters and return type are shown in the signature.
appendBatchmethodappendBatch(inputs: RuntimeObservationEventInput[]): Promise<FrameworkEvent[]>Public method; parameters and return type are shown in the signature.
readSincemethodreadSince(sequence: number): Promise<FrameworkEvent[]>Public method; parameters and return type are shown in the signature.

RuntimeHelperExecutionScope

Runtime Helper Execution Scope interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeHelperExecutionScope } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeHelperExecutionScope {
    scope: RuntimeScope;
    stateId: string;
    stateAttempt: number;
    fencingToken: number;
    correlationId: string;
    causationId?: string;
}

Contract members

MemberKindSignatureDescription
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fencingTokenpropertyfencingToken: numberPublic 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.
stateAttemptpropertystateAttempt: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
stateIdpropertystateId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeHelperSdk

Runtime Helper Sdk interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeHelperSdk } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeHelperSdk {
    readonly transitions: RuntimeTransitionHelper;
    readonly waits: RuntimeWaitHelper;
    readonly clock: RuntimeClockHelper;
    readonly ids: RuntimeIdHelper;
}

Contract members

MemberKindSignatureDescription
clockpropertyreadonly clock: RuntimeClockHelperPublic property; its type, readonly modifier and optionality are shown in the signature.
idspropertyreadonly ids: RuntimeIdHelperPublic property; its type, readonly modifier and optionality are shown in the signature.
transitionspropertyreadonly transitions: RuntimeTransitionHelperPublic property; its type, readonly modifier and optionality are shown in the signature.
waitspropertyreadonly waits: RuntimeWaitHelperPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeIdHelper

Runtime ID Helper interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeIdHelper } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeIdHelper {
    next(namespace: string): Promise<string>;
}

Contract members

MemberKindSignatureDescription
nextmethodnext(namespace: string): Promise<string>Public method; parameters and return type are shown in the signature.

RuntimeIoHelperSdk

Runtime Io Helper Sdk interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeIoHelperSdk } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeIoHelperSdk {
    readonly events: RuntimeEventHelper;
    readonly resources: RuntimeResourceHelper;
}

Contract members

MemberKindSignatureDescription
eventspropertyreadonly events: RuntimeEventHelperPublic property; its type, readonly modifier and optionality are shown in the signature.
resourcespropertyreadonly resources: RuntimeResourceHelperPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeObservationEventInput

Runtime Observation Event Input interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeObservationEventInput } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeObservationEventInput<T extends RuntimeJsonValue = RuntimeJsonValue> {
    type: RuntimeObservationEventType;
    payload: T;
    options?: RuntimeEventAppendOptions;
}

Contract members

MemberKindSignatureDescription
optionspropertyoptions?: RuntimeEventAppendOptionsPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadpropertypayload: TPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: runtime.observation.${string}Public property; its type, readonly modifier and optionality are shown in the signature.

RuntimeResourceAcquireOptions

Runtime Resource Acquire Options interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeResourceAcquireOptions } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeResourceAcquireOptions {
    ttlMs: number;
    idempotencyKey?: string;
}

Contract members

MemberKindSignatureDescription
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ttlMspropertyttlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeResourceHelper

Runtime Resource Helper interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeResourceHelper } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeResourceHelper {
    acquire(resources: Omit<RuntimeResourceRequest, 'requestedClaimId'>[], options: RuntimeResourceAcquireOptions): Promise<RuntimeResourceClaim[]>;
    renew(claims: RuntimeResourceClaim[], options: RuntimeResourceRenewOptions): Promise<RuntimeResourceClaim[]>;
    release(claims: RuntimeResourceClaim[]): Promise<void>;
    assertCurrent(claim: RuntimeResourceClaim): Promise<RuntimeResourceClaim>;
}

Contract members

MemberKindSignatureDescription
acquiremethodacquire(resources: Omit<RuntimeResourceRequest, "requestedClaimId">[], options: RuntimeResourceAcquireOptions): Promise<RuntimeResourceClaim[]>Public method; parameters and return type are shown in the signature.
assertCurrentmethodassertCurrent(claim: RuntimeResourceClaim): Promise<RuntimeResourceClaim>Public method; parameters and return type are shown in the signature.
releasemethodrelease(claims: RuntimeResourceClaim[]): Promise<void>Public method; parameters and return type are shown in the signature.
renewmethodrenew(claims: RuntimeResourceClaim[], options: RuntimeResourceRenewOptions): Promise<RuntimeResourceClaim[]>Public method; parameters and return type are shown in the signature.

RuntimeResourceHelperDependencies

Runtime Resource Helper Dependencies interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeResourceHelperDependencies } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeResourceHelperDependencies {
    runLease: RunLeaseAuthorization;
    coordinator: RuntimeResourceCoordinator;
    ids: RuntimeIdHelper;
    clock: RuntimeClockHelper;
    stateId: string;
}

Contract members

MemberKindSignatureDescription
clockpropertyclock: RuntimeClockHelperPublic property; its type, readonly modifier and optionality are shown in the signature.
coordinatorpropertycoordinator: RuntimeResourceCoordinatorPublic property; its type, readonly modifier and optionality are shown in the signature.
idspropertyids: RuntimeIdHelperPublic property; its type, readonly modifier and optionality are shown in the signature.
runLeasepropertyrunLease: RunLeaseAuthorizationPublic property; its type, readonly modifier and optionality are shown in the signature.
stateIdpropertystateId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeResourceRenewOptions

Runtime Resource Renew Options interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeResourceRenewOptions } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeResourceRenewOptions {
    ttlMs: number;
}

Contract members

MemberKindSignatureDescription
ttlMspropertyttlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeTransitionHelper

Runtime Transition Helper interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeTransitionHelper } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface 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;
}

Contract members

MemberKindSignatureDescription
completemethodcomplete(output?: RuntimeJsonValue, variablesPatch?: Record<string, RuntimeJsonValue>): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.
continuemethodcontinue(observation?: RuntimeJsonValue): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.
failmethodfail(error: NormalizedRuntimeError): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.
proposemethodpropose(to: string, reason?: string, variablesPatch?: Record<string, RuntimeJsonValue>): RuntimeTransitionProposalPublic method; parameters and return type are shown in the signature.

RuntimeTransitionProposal

Runtime Transition Proposal interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeTransitionProposal } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeTransitionProposal {
    to: string;
    reason?: string;
    variablesPatch?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
reasonpropertyreason?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
topropertyto: 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.

RuntimeWaitHelper

Runtime Wait Helper interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeWaitHelper } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeWaitHelper {
    human(request: HumanWaitRequest): RuntimeStateExecutionResult;
    signal(request: SignalWaitRequest): RuntimeStateExecutionResult;
    timer(request: TimerWaitRequest): RuntimeStateExecutionResult;
    pause(request: PauseRequest): RuntimeStateExecutionResult;
}

Contract members

MemberKindSignatureDescription
humanmethodhuman(request: HumanWaitRequest): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.
pausemethodpause(request: PauseRequest): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.
signalmethodsignal(request: SignalWaitRequest): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.
timermethodtimer(request: TimerWaitRequest): RuntimeStateExecutionResultPublic method; parameters and return type are shown in the signature.

RuntimeWaitIntent

Runtime Wait Intent interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { RuntimeWaitIntent } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface RuntimeWaitIntent {
    type: RuntimeWaitIntentType;
    key?: string;
    expectedSchema?: JsonSchema;
    expiresAt?: string;
    timeoutTransitionId?: string;
    pendingActionRef?: string;
    reason?: string;
    metadata?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
expectedSchemapropertyexpectedSchema?: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
keypropertykey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, RuntimeJsonValue>Public property; its type, readonly modifier and optionality are shown in the signature.
pendingActionRefpropertypendingActionRef?: 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.
timeoutTransitionIdpropertytimeoutTransitionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "human" | "signal" | "timer" | "pause"Public property; its type, readonly modifier and optionality are shown in the signature.

SignalWaitRequest

Signal Wait Request interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { SignalWaitRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface SignalWaitRequest {
    key: string;
    expectedSchema?: JsonSchema;
    expiresAt?: string;
    timeoutTransitionId?: string;
    metadata?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
expectedSchemapropertyexpectedSchema?: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
keypropertykey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, RuntimeJsonValue>Public property; its type, readonly modifier and optionality are shown in the signature.
timeoutTransitionIdpropertytimeoutTransitionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

TimerWaitRequest

Timer Wait Request interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { TimerWaitRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export interface TimerWaitRequest {
    fireAt: string;
    timeoutTransitionId?: string;
    metadata?: Record<string, RuntimeJsonValue>;
}

Contract members

MemberKindSignatureDescription
fireAtpropertyfireAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, RuntimeJsonValue>Public property; its type, readonly modifier and optionality are shown in the signature.
timeoutTransitionIdpropertytimeoutTransitionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeDeterministicObservationKind

Public type alias for Runtime Deterministic Observation Kind; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RuntimeDeterministicObservationKind } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export type RuntimeDeterministicObservationKind = (typeof RUNTIME_DETERMINISTIC_OBSERVATION_KINDS)[number];

RuntimeJsonValue

Public type alias for Runtime JSON Value; the declaration contains its complete type expression.

Declaration

text
export type RuntimeJsonValue = null | boolean | number | string | RuntimeJsonValue[] | {
    [key: string]: RuntimeJsonValue;
};

RuntimeStateExecutionResult

Public type alias for Runtime State Execution Result; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RuntimeStateExecutionResult } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export type RuntimeStateExecutionResult = {
    kind: 'completed';
    output?: RuntimeJsonValue;
    variablesPatch?: Record<string, RuntimeJsonValue>;
} | {
    kind: 'continued';
    observation?: RuntimeJsonValue;
} | {
    kind: 'failed';
    error: NormalizedRuntimeError;
} | {
    kind: 'waiting';
    wait: RuntimeWaitIntent;
};

RuntimeWaitIntentType

Public type alias for Runtime Wait Intent Type; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RuntimeWaitIntentType } from '@codesoul-co/hypha-core';
  • Source module: contracts/runtime-helpers

Declaration

text
export type RuntimeWaitIntentType = (typeof RUNTIME_WAIT_INTENT_TYPES)[number];