@codesoul-co/hypha-harness / execution-context
- Package index:
@codesoul-co/hypha-harness - Source:
packages/harness/src/execution-context.ts - Exports: 3
Using this module
Use the Execution context module for executing runtime behavior at this boundary. It exports 1 function, 2 interfaces.
Import from the package entrypoint
ts
import {
createRuntimeExecutionContext,
} from '@codesoul-co/hypha-harness';
import type {
CreateRuntimeExecutionContextOptions,
RuntimeExecutionContext,
} from '@codesoul-co/hypha-harness';Usage patterns
- Use the 2 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 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
createRuntimeExecutionContext | function | createRuntimeExecutionContext(options: CreateRuntimeExecutionContextOptions): RuntimeExecutionContext | Create Runtime Execution Context function with 1 public call signature; parameters and return types are listed below. |
CreateRuntimeExecutionContextOptions | interface | interface CreateRuntimeExecutionContextOptions | Create Runtime Execution Context Options interface with 15 public fields or methods. |
RuntimeExecutionContext | interface | interface RuntimeExecutionContext | Runtime Execution Context interface with 16 public fields or methods. |
createRuntimeExecutionContext
Create Runtime Execution Context function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createRuntimeExecutionContext } from '@codesoul-co/hypha-harness'; - Source module:
execution-context
Declaration
text
export declare function createRuntimeExecutionContext(options: CreateRuntimeExecutionContextOptions): RuntimeExecutionContext;Call signature
text
createRuntimeExecutionContext(options: CreateRuntimeExecutionContextOptions): RuntimeExecutionContextParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | CreateRuntimeExecutionContextOptions | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
RuntimeExecutionContext - Description: The return contract is defined by the type shown above.
CreateRuntimeExecutionContextOptions
Create Runtime Execution Context Options interface with 15 public fields or methods.
- Kind: interface
- Import:
import type { CreateRuntimeExecutionContextOptions } from '@codesoul-co/hypha-harness'; - Source module:
execution-context
Declaration
text
export interface CreateRuntimeExecutionContextOptions {
scope: RuntimeScope;
principal: RuntimePrincipal;
run: RuntimeRun;
snapshot: FSMSnapshot;
process: FSMProcessSpec;
attempt: number;
runLease: RunLeaseAuthorization;
abortSignal: AbortSignal;
determinismStore: RuntimeDeterminismStore;
eventCommitPort: RuntimeEventCommitPort;
activityDispatchPort: RuntimeActivityDispatchPort;
resourceCoordinator: RuntimeResourceCoordinator;
causationId?: string;
now?: () => string;
nextId?: (namespace: string) => string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
abortSignal | property | abortSignal: AbortSignal | Public property; its type, readonly modifier and optionality are shown in the signature. |
activityDispatchPort | property | activityDispatchPort: RuntimeActivityDispatchPort | Public property; its type, readonly modifier and optionality are shown in the signature. |
attempt | property | attempt: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
causationId | property | causationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
determinismStore | property | determinismStore: RuntimeDeterminismStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventCommitPort | property | eventCommitPort: RuntimeEventCommitPort | 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. |
principal | property | principal: RuntimePrincipal | Public property; its type, readonly modifier and optionality are shown in the signature. |
process | property | process: FSMProcessSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
resourceCoordinator | property | resourceCoordinator: RuntimeResourceCoordinator | Public property; its type, readonly modifier and optionality are shown in the signature. |
run | property | run: RuntimeRun | Public property; its type, readonly modifier and optionality are shown in the signature. |
runLease | property | runLease: RunLeaseAuthorization | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: RuntimeScope | 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. |
RuntimeExecutionContext
Runtime Execution Context interface with 16 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeExecutionContext } from '@codesoul-co/hypha-harness'; - Source module:
execution-context
Declaration
text
export interface RuntimeExecutionContext {
readonly scope: Readonly<RuntimeScope>;
readonly principal: Readonly<RuntimePrincipal>;
readonly run: Readonly<RuntimeRun>;
readonly snapshot: Readonly<FSMSnapshot>;
readonly process: Readonly<FSMProcessSpec>;
readonly state: Readonly<FSMStateSpec>;
readonly attempt: number;
readonly fencingToken: number;
readonly abortSignal: AbortSignal;
readonly events: RuntimeEventHelper;
readonly activities: RuntimeActivityHelper;
readonly transitions: RuntimeTransitionHelper;
readonly waits: RuntimeWaitHelper;
readonly resources: RuntimeResourceHelper;
readonly clock: RuntimeClockHelper;
readonly ids: RuntimeIdHelper;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
abortSignal | property | readonly abortSignal: AbortSignal | Public property; its type, readonly modifier and optionality are shown in the signature. |
activities | property | readonly activities: RuntimeActivityHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
attempt | property | readonly attempt: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
clock | property | readonly clock: RuntimeClockHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
events | property | readonly events: RuntimeEventHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
fencingToken | property | readonly fencingToken: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ids | property | readonly ids: RuntimeIdHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | readonly principal: Readonly<RuntimePrincipal> | Public property; its type, readonly modifier and optionality are shown in the signature. |
process | property | readonly process: Readonly<FSMProcessSpec> | Public property; its type, readonly modifier and optionality are shown in the signature. |
resources | property | readonly resources: RuntimeResourceHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
run | property | readonly run: Readonly<RuntimeRun> | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | readonly scope: Readonly<RuntimeScope> | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshot | property | readonly snapshot: Readonly<FSMSnapshot> | Public property; its type, readonly modifier and optionality are shown in the signature. |
state | property | readonly state: Readonly<FSMStateSpec> | Public property; its type, readonly modifier and optionality are shown in the signature. |
transitions | property | readonly transitions: RuntimeTransitionHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
waits | property | readonly waits: RuntimeWaitHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
