Skip to content

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

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

ts
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

SymbolKindSignatureDescription
RUNTIME_CONTROL_DISPOSITIONSconstantconst RUNTIME_CONTROL_DISPOSITIONS: readonly ["applied", "reused", "lease_unavailable"]RUNTIME CONTROL DISPOSITIONS constant exported by the contracts/runtime-control module.
RUNTIME_CONTROL_KINDSconstantconst RUNTIME_CONTROL_KINDS: readonly ["pause", "resume", "signal"]RUNTIME CONTROL KINDS constant exported by the contracts/runtime-control module.
RuntimePauseCommandinterfaceinterface RuntimePauseCommand extends RuntimeRunControlCommandBaseRuntime Pause Command interface with 10 public fields or methods.
RuntimeResumeCommandinterfaceinterface RuntimeResumeCommand extends RuntimeRunControlCommandBaseRuntime Resume Command interface with 10 public fields or methods.
RuntimeRunControlResultinterfaceinterface RuntimeRunControlResultRuntime Run Control Result interface with 6 public fields or methods.
RuntimeSignalCommandinterfaceinterface RuntimeSignalCommand extends RuntimeRunControlCommandBaseRuntime Signal Command interface with 10 public fields or methods.
RuntimeControlDispositiontypetype RuntimeControlDisposition = (typeof RUNTIME_CONTROL_DISPOSITIONS)[number]Public type alias for Runtime Control Disposition; the declaration contains its complete type expression.
RuntimeControlKindtypetype RuntimeControlKind = (typeof RUNTIME_CONTROL_KINDS)[number]Public type alias for Runtime Control Kind; the declaration contains its complete type expression.
RuntimeRunControlCommandtypetype RuntimeRunControlCommand = RuntimePauseCommand | RuntimeResumeCommand | RuntimeSignalCommandPublic 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

text
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

text
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

text
export interface RuntimePauseCommand extends RuntimeRunControlCommandBase {
    kind: 'pause';
    reason: string;
    resumeKey?: string;
    requestedAt: string;
}

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: 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.
kindpropertykind: "pause"Public property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: RuntimePrincipalPublic 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.
requestedAtpropertyrequestedAt: 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.
scopepropertyscope: RuntimeScopePublic 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

text
export interface RuntimeResumeCommand extends RuntimeRunControlCommandBase {
    kind: 'resume';
    key?: string;
    payload?: RuntimeJsonValue;
    requestedAt: string;
}

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: 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.
keypropertykey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
kindpropertykind: "resume"Public property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadpropertypayload?: RuntimeJsonValuePublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: RuntimePrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedAtpropertyrequestedAt: stringPublic 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.

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

text
export interface RuntimeRunControlResult {
    commandId: string;
    kind: RuntimeControlKind;
    disposition: RuntimeControlDisposition;
    eventIds: string[];
    runRevision: number;
    projection: RuntimeOrchestrationProjection;
}

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dispositionpropertydisposition: "applied" | "reused" | "lease_unavailable"Public property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
kindpropertykind: "signal" | "resume" | "pause"Public property; its type, readonly modifier and optionality are shown in the signature.
projectionpropertyprojection: RuntimeOrchestrationProjectionPublic property; its type, readonly modifier and optionality are shown in the signature.
runRevisionpropertyrunRevision: numberPublic 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

text
export interface RuntimeSignalCommand extends RuntimeRunControlCommandBase {
    kind: 'signal';
    key: string;
    payload: RuntimeJsonValue;
    sentAt: string;
}

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: 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.
keypropertykey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
kindpropertykind: "signal"Public property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadpropertypayload: RuntimeJsonValuePublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: RuntimePrincipalPublic 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.
sentAtpropertysentAt: stringPublic 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

text
export type RuntimeControlDisposition = (typeof RUNTIME_CONTROL_DISPOSITIONS)[number];

RuntimeControlKind

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

Declaration

text
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

text
export type RuntimeRunControlCommand = RuntimePauseCommand | RuntimeResumeCommand | RuntimeSignalCommand;