Skip to content

@codesoul-co/hypha-core / contracts/runtime-human-task ​

Using this module ​

Use the Runtime human task module for declaring and runtime-validating contracts. It exports 3 constants, 3 interfaces, 3 types.

Import from the package entrypoint ​

ts
import {
  RUNTIME_HUMAN_TASK_DECISIONS,
  RUNTIME_HUMAN_TASK_KINDS,
  RUNTIME_HUMAN_TASK_STATUSES,
} from '@codesoul-co/hypha-core';

import type {
  RuntimeHumanTask,
  RuntimeHumanTaskDecisionCommand,
  RuntimeHumanTaskRequest,
  RuntimeHumanTaskDecision,
  RuntimeHumanTaskKind,
  RuntimeHumanTaskStatus,
} from '@codesoul-co/hypha-core';

Usage patterns ​

  • Use the 6 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The 3 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_HUMAN_TASK_DECISIONSconstantconst RUNTIME_HUMAN_TASK_DECISIONS: readonly ["approved", "rejected", "expired", "cancelled", "superseded"]RUNTIME HUMAN TASK DECISIONS constant exported by the contracts/runtime-human-task module.
RUNTIME_HUMAN_TASK_KINDSconstantconst RUNTIME_HUMAN_TASK_KINDS: readonly ["tool", "skill", "prompt", "memory", "execution", "mcp", "policy"]RUNTIME HUMAN TASK KINDS constant exported by the contracts/runtime-human-task module.
RUNTIME_HUMAN_TASK_STATUSESconstantconst RUNTIME_HUMAN_TASK_STATUSES: readonly ["pending", "approved", "rejected", "expired", "cancelled", "superseded"]RUNTIME HUMAN TASK STATUSES constant exported by the contracts/runtime-human-task module.
RuntimeHumanTaskinterfaceinterface RuntimeHumanTaskRuntime Human Task interface with 26 public fields or methods.
RuntimeHumanTaskDecisionCommandinterfaceinterface RuntimeHumanTaskDecisionCommandRuntime Human Task Decision Command interface with 11 public fields or methods.
RuntimeHumanTaskRequestinterfaceinterface RuntimeHumanTaskRequestRuntime Human Task Request interface with 15 public fields or methods.
RuntimeHumanTaskDecisiontypetype RuntimeHumanTaskDecision = (typeof RUNTIME_HUMAN_TASK_DECISIONS)[number]Public type alias for Runtime Human Task Decision; the declaration contains its complete type expression.
RuntimeHumanTaskKindtypetype RuntimeHumanTaskKind = (typeof RUNTIME_HUMAN_TASK_KINDS)[number]Public type alias for Runtime Human Task Kind; the declaration contains its complete type expression.
RuntimeHumanTaskStatustypetype RuntimeHumanTaskStatus = (typeof RUNTIME_HUMAN_TASK_STATUSES)[number]Public type alias for Runtime Human Task Status; the declaration contains its complete type expression.

RUNTIME_HUMAN_TASK_DECISIONS ​

RUNTIME HUMAN TASK DECISIONS constant exported by the contracts/runtime-human-task module.

Declaration ​

text
export declare const RUNTIME_HUMAN_TASK_DECISIONS: readonly ["approved", "rejected", "expired", "cancelled", "superseded"];

RUNTIME_HUMAN_TASK_KINDS ​

RUNTIME HUMAN TASK KINDS constant exported by the contracts/runtime-human-task module.

Declaration ​

text
export declare const RUNTIME_HUMAN_TASK_KINDS: readonly ["tool", "skill", "prompt", "memory", "execution", "mcp", "policy"];

RUNTIME_HUMAN_TASK_STATUSES ​

RUNTIME HUMAN TASK STATUSES constant exported by the contracts/runtime-human-task module.

Declaration ​

text
export declare const RUNTIME_HUMAN_TASK_STATUSES: readonly ["pending", "approved", "rejected", "expired", "cancelled", "superseded"];

RuntimeHumanTask ​

Runtime Human Task interface with 26 public fields or methods.

Declaration ​

text
export interface RuntimeHumanTask {
    taskId: string;
    runId: string;
    stateId: string;
    stateAttempt: number;
    kind: RuntimeHumanTaskKind;
    subjectRef: string;
    subjectHash: string;
    status: RuntimeHumanTaskStatus;
    requestedBy: string;
    allowedDecisionScopes: string[];
    requestedAt: string;
    expiresAt?: string;
    revision: number;
    checkpointRef?: string;
    policyRef?: string;
    providerRevision?: string;
    activityDescriptorRef?: string;
    activityDescriptorHash?: string;
    decisionEventId?: string;
    decisionCommandId?: string;
    decisionIdempotencyKey?: string;
    decidedBy?: string;
    decidedAt?: string;
    supersededByTaskId?: string;
    reason?: string;
    metadata?: Record<string, unknown>;
}

Contract members ​

MemberKindSignatureDescription
activityDescriptorHashpropertyactivityDescriptorHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
activityDescriptorRefpropertyactivityDescriptorRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedDecisionScopespropertyallowedDecisionScopes: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
checkpointRefpropertycheckpointRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decidedAtpropertydecidedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decidedBypropertydecidedBy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionCommandIdpropertydecisionCommandId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionEventIdpropertydecisionEventId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionIdempotencyKeypropertydecisionIdempotencyKey?: stringPublic 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.
kindpropertykind: "memory" | "skill" | "mcp" | "policy" | "tool" | "execution" | "prompt"Public property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
policyRefpropertypolicyRef?: 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.
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.
requestedBypropertyrequestedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic 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.
statuspropertystatus: "rejected" | "cancelled" | "expired" | "pending" | "approved" | "superseded"Public property; its type, readonly modifier and optionality are shown in the signature.
subjectHashpropertysubjectHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
subjectRefpropertysubjectRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
supersededByTaskIdpropertysupersededByTaskId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
taskIdpropertytaskId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeHumanTaskDecisionCommand ​

Runtime Human Task Decision Command interface with 11 public fields or methods.

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

Declaration ​

text
export interface RuntimeHumanTaskDecisionCommand {
    commandId: string;
    scope: RuntimeScope;
    principal: RuntimePrincipal;
    taskId: string;
    expectedRevision: number;
    expectedSubjectHash: string;
    decision: RuntimeHumanTaskDecision;
    decidedAt: string;
    supersededByTaskId?: string;
    reason?: string;
    idempotencyKey?: string;
}

Contract members ​

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decidedAtpropertydecidedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionpropertydecision: "rejected" | "cancelled" | "expired" | "approved" | "superseded"Public property; its type, readonly modifier and optionality are shown in the signature.
expectedRevisionpropertyexpectedRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedSubjectHashpropertyexpectedSubjectHash: 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.
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.
scopepropertyscope: RuntimeScopePublic property; its type, readonly modifier and optionality are shown in the signature.
supersededByTaskIdpropertysupersededByTaskId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
taskIdpropertytaskId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeHumanTaskRequest ​

Runtime Human Task Request interface with 15 public fields or methods.

Declaration ​

text
export interface RuntimeHumanTaskRequest {
    taskId: string;
    kind: RuntimeHumanTaskKind;
    subjectRef: string;
    subjectHash: string;
    requestedBy: string;
    allowedDecisionScopes: string[];
    requestedAt: string;
    expiresAt?: string;
    checkpointRef?: string;
    policyRef?: string;
    providerRevision?: string;
    activityDescriptorRef?: string;
    activityDescriptorHash?: string;
    reason?: string;
    metadata?: Record<string, unknown>;
}

Contract members ​

MemberKindSignatureDescription
activityDescriptorHashpropertyactivityDescriptorHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
activityDescriptorRefpropertyactivityDescriptorRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedDecisionScopespropertyallowedDecisionScopes: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
checkpointRefpropertycheckpointRef?: stringPublic 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.
kindpropertykind: "memory" | "skill" | "mcp" | "policy" | "tool" | "execution" | "prompt"Public property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
policyRefpropertypolicyRef?: 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.
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.
requestedBypropertyrequestedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
subjectHashpropertysubjectHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
subjectRefpropertysubjectRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
taskIdpropertytaskId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeHumanTaskDecision ​

Public type alias for Runtime Human Task Decision; the declaration contains its complete type expression.

Declaration ​

text
export type RuntimeHumanTaskDecision = (typeof RUNTIME_HUMAN_TASK_DECISIONS)[number];

RuntimeHumanTaskKind ​

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

Declaration ​

text
export type RuntimeHumanTaskKind = (typeof RUNTIME_HUMAN_TASK_KINDS)[number];

RuntimeHumanTaskStatus ​

Public type alias for Runtime Human Task Status; the declaration contains its complete type expression.

Declaration ​

text
export type RuntimeHumanTaskStatus = (typeof RUNTIME_HUMAN_TASK_STATUSES)[number];