Skip to content

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

Using this module

Use the Runtime activity module for declaring and runtime-validating contracts. It exports 2 constants, 1 interface, 1 type.

Import from the package entrypoint

ts
import {
  RUNTIME_ACTIVITY_DESCRIPTOR_VERSION,
  RUNTIME_ACTIVITY_KINDS,
} from '@codesoul-co/hypha-core';

import type {
  RuntimeActivityDescriptor,
  RuntimeActivityKind,
} from '@codesoul-co/hypha-core';

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 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_ACTIVITY_DESCRIPTOR_VERSIONconstantconst RUNTIME_ACTIVITY_DESCRIPTOR_VERSION: "1.0.0"RUNTIME ACTIVITY DESCRIPTOR VERSION constant exported by the contracts/runtime-activity module.
RUNTIME_ACTIVITY_KINDSconstantconst RUNTIME_ACTIVITY_KINDS: readonly ["react_quantum", "tool", "memory", "execution", "mcp", "policy"]RUNTIME ACTIVITY KINDS constant exported by the contracts/runtime-activity module.
RuntimeActivityDescriptorinterfaceinterface RuntimeActivityDescriptorRuntime Activity Descriptor interface with 13 public fields or methods.
RuntimeActivityKindtypetype RuntimeActivityKind = (typeof RUNTIME_ACTIVITY_KINDS)[number]Public type alias for Runtime Activity Kind; the declaration contains its complete type expression.

RUNTIME_ACTIVITY_DESCRIPTOR_VERSION

RUNTIME ACTIVITY DESCRIPTOR VERSION constant exported by the contracts/runtime-activity module.

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

Declaration

text
export declare const RUNTIME_ACTIVITY_DESCRIPTOR_VERSION: "1.0.0";

RUNTIME_ACTIVITY_KINDS

RUNTIME ACTIVITY KINDS constant exported by the contracts/runtime-activity module.

Declaration

text
export declare const RUNTIME_ACTIVITY_KINDS: readonly ["react_quantum", "tool", "memory", "execution", "mcp", "policy"];

RuntimeActivityDescriptor

Runtime Activity Descriptor interface with 13 public fields or methods.

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

Declaration

text
export interface RuntimeActivityDescriptor {
    version: typeof RUNTIME_ACTIVITY_DESCRIPTOR_VERSION;
    activityId: string;
    activityKind: RuntimeActivityKind;
    runId: string;
    stateId: string;
    stateAttempt: number;
    operationId: string;
    inputRef: string;
    inputHash: string;
    providerRef?: string;
    providerRevision?: string;
    idempotencyKey: string;
    deadlineAt?: string;
}

Contract members

MemberKindSignatureDescription
activityIdpropertyactivityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
activityKindpropertyactivityKind: "memory" | "mcp" | "policy" | "tool" | "execution" | "react_quantum"Public property; its type, readonly modifier and optionality are shown in the signature.
deadlineAtpropertydeadlineAt?: 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.
inputHashpropertyinputHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputRefpropertyinputRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRefpropertyproviderRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRevisionpropertyproviderRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
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.
versionpropertyversion: "1.0.0"Public property; its type, readonly modifier and optionality are shown in the signature.

RuntimeActivityKind

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

Declaration

text
export type RuntimeActivityKind = (typeof RUNTIME_ACTIVITY_KINDS)[number];