@codesoul-co/hypha-core / contracts/runtime-control
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/runtime-control.ts - Exports: 9
Using this module
Use the Runtime control module for declaring and runtime-validating contracts. It exports 2 constants, 4 interfaces, 3 types.
Import from the package entrypoint
import {
RUNTIME_CONTROL_DISPOSITIONS,
RUNTIME_CONTROL_KINDS,
} from '@codesoul-co/hypha-core';
import type {
RuntimePauseCommand,
RuntimeResumeCommand,
RuntimeRunControlResult,
RuntimeSignalCommand,
RuntimeControlDisposition,
RuntimeControlKind,
RuntimeRunControlCommand,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 7 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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
RUNTIME_CONTROL_DISPOSITIONS | constant | const RUNTIME_CONTROL_DISPOSITIONS: readonly ["applied", "reused", "lease_unavailable"] | RUNTIME CONTROL DISPOSITIONS constant exported by the contracts/runtime-control module. |
RUNTIME_CONTROL_KINDS | constant | const RUNTIME_CONTROL_KINDS: readonly ["pause", "resume", "signal"] | RUNTIME CONTROL KINDS constant exported by the contracts/runtime-control module. |
RuntimePauseCommand | interface | interface RuntimePauseCommand extends RuntimeRunControlCommandBase | Runtime Pause Command interface with 10 public fields or methods. |
RuntimeResumeCommand | interface | interface RuntimeResumeCommand extends RuntimeRunControlCommandBase | Runtime Resume Command interface with 10 public fields or methods. |
RuntimeRunControlResult | interface | interface RuntimeRunControlResult | Runtime Run Control Result interface with 6 public fields or methods. |
RuntimeSignalCommand | interface | interface RuntimeSignalCommand extends RuntimeRunControlCommandBase | Runtime Signal Command interface with 10 public fields or methods. |
RuntimeControlDisposition | type | type RuntimeControlDisposition = (typeof RUNTIME_CONTROL_DISPOSITIONS)[number] | Public type alias for Runtime Control Disposition; the declaration contains its complete type expression. |
RuntimeControlKind | type | type RuntimeControlKind = (typeof RUNTIME_CONTROL_KINDS)[number] | Public type alias for Runtime Control Kind; the declaration contains its complete type expression. |
RuntimeRunControlCommand | type | type RuntimeRunControlCommand = RuntimePauseCommand | RuntimeResumeCommand | RuntimeSignalCommand | Public type alias for Runtime Run Control Command; the declaration contains its complete type expression. |
RUNTIME_CONTROL_DISPOSITIONS
RUNTIME CONTROL DISPOSITIONS constant exported by the contracts/runtime-control module.
- Kind: constant
- Import:
import { RUNTIME_CONTROL_DISPOSITIONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export declare const RUNTIME_CONTROL_DISPOSITIONS: readonly ["applied", "reused", "lease_unavailable"];RUNTIME_CONTROL_KINDS
RUNTIME CONTROL KINDS constant exported by the contracts/runtime-control module.
- Kind: constant
- Import:
import { RUNTIME_CONTROL_KINDS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export declare const RUNTIME_CONTROL_KINDS: readonly ["pause", "resume", "signal"];RuntimePauseCommand
Runtime Pause Command interface with 10 public fields or methods.
- Kind: interface
- Import:
import type { RuntimePauseCommand } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export interface RuntimePauseCommand extends RuntimeRunControlCommandBase {
kind: 'pause';
reason: string;
resumeKey?: string;
requestedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
commandId | property | commandId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyKey | property | idempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "pause" | Public property; its type, readonly modifier and optionality are shown in the signature. |
leaseTtlMs | property | leaseTtlMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ownerId | property | ownerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: RuntimePrincipal | 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. |
requestedAt | property | requestedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
resumeKey | property | resumeKey?: string | 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. |
RuntimeResumeCommand
Runtime Resume Command interface with 10 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeResumeCommand } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export interface RuntimeResumeCommand extends RuntimeRunControlCommandBase {
kind: 'resume';
key?: string;
payload?: RuntimeJsonValue;
requestedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
commandId | property | commandId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyKey | property | idempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
key | property | key?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "resume" | Public property; its type, readonly modifier and optionality are shown in the signature. |
leaseTtlMs | property | leaseTtlMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ownerId | property | ownerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
payload | property | payload?: RuntimeJsonValue | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: RuntimePrincipal | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestedAt | property | requestedAt: string | 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. |
RuntimeRunControlResult
Runtime Run Control Result interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeRunControlResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export interface RuntimeRunControlResult {
commandId: string;
kind: RuntimeControlKind;
disposition: RuntimeControlDisposition;
eventIds: string[];
runRevision: number;
projection: RuntimeOrchestrationProjection;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
commandId | property | commandId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
disposition | property | disposition: "applied" | "reused" | "lease_unavailable" | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventIds | property | eventIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "signal" | "resume" | "pause" | Public property; its type, readonly modifier and optionality are shown in the signature. |
projection | property | projection: RuntimeOrchestrationProjection | Public property; its type, readonly modifier and optionality are shown in the signature. |
runRevision | property | runRevision: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeSignalCommand
Runtime Signal Command interface with 10 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeSignalCommand } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export interface RuntimeSignalCommand extends RuntimeRunControlCommandBase {
kind: 'signal';
key: string;
payload: RuntimeJsonValue;
sentAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
commandId | property | commandId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyKey | property | idempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
key | property | key: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "signal" | Public property; its type, readonly modifier and optionality are shown in the signature. |
leaseTtlMs | property | leaseTtlMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ownerId | property | ownerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
payload | property | payload: RuntimeJsonValue | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: RuntimePrincipal | 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. |
sentAt | property | sentAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeControlDisposition
Public type alias for Runtime Control Disposition; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeControlDisposition } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export type RuntimeControlDisposition = (typeof RUNTIME_CONTROL_DISPOSITIONS)[number];RuntimeControlKind
Public type alias for Runtime Control Kind; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeControlKind } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export type RuntimeControlKind = (typeof RUNTIME_CONTROL_KINDS)[number];RuntimeRunControlCommand
Public type alias for Runtime Run Control Command; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeRunControlCommand } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-control
Declaration
export type RuntimeRunControlCommand = RuntimePauseCommand | RuntimeResumeCommand | RuntimeSignalCommand;