Skip to content

@codesoul-co/hypha-core / modules/runtime/runtime-human-task

Using this module

Use the Runtime human task module for executing runtime behavior at this boundary. It exports 5 functions.

Import from the package entrypoint

ts
import {
  assertRuntimeHumanTaskDecision,
  assertRuntimeHumanTaskResume,
  projectRuntimeHumanTasks,
  runtimeHumanTaskKind,
  runtimeHumanTaskResolutionEventId,
} from '@codesoul-co/hypha-core';

Usage patterns

  • The module exposes 5 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
assertRuntimeHumanTaskDecisionfunctionassertRuntimeHumanTaskDecision<TTask extends RuntimeHumanTask>(task: TTask | undefined, command: Pick<RuntimeHumanTaskDecisionCommand, "expectedRevision" | "expectedSubjectHash" | "principal" | "decidedAt" | "decision">): TTaskAssert Runtime Human Task Decision function with 1 public call signature; parameters and return types are listed below.
assertRuntimeHumanTaskResumefunctionassertRuntimeHumanTaskResume<TTask extends RuntimeHumanTask>(task: TTask | undefined, expected: { taskId: string; kind: RuntimeHumanTaskKind; subjectRef: string; subjectHash: string; revision: number; requestedBy: string; resumedAt: string; checkpointRef?: string; policyRef?: string; providerRevision?: string; activityDescriptorRef?: string; activityDescriptorHash?: string; }): TTaskAssert Runtime Human Task Resume function with 1 public call signature; parameters and return types are listed below.
projectRuntimeHumanTasksfunctionprojectRuntimeHumanTasks(events: readonly FrameworkEvent[]): RuntimeHumanTask[]Project Runtime Human Tasks function with 1 public call signature; parameters and return types are listed below.
runtimeHumanTaskKindfunctionruntimeHumanTaskKind(value: string): RuntimeHumanTaskKind | undefinedRuntime Human Task Kind function with 1 public call signature; parameters and return types are listed below.
runtimeHumanTaskResolutionEventIdfunctionruntimeHumanTaskResolutionEventId(input: { runId: string; taskId: string; expectedRevision: number; }): stringRuntime Human Task Resolution Event ID function with 1 public call signature; parameters and return types are listed below.

assertRuntimeHumanTaskDecision

Assert Runtime Human Task Decision function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function assertRuntimeHumanTaskDecision<TTask extends RuntimeHumanTask>(task: TTask | undefined, command: Pick<RuntimeHumanTaskDecisionCommand, 'expectedRevision' | 'expectedSubjectHash' | 'principal' | 'decidedAt' | 'decision'>): TTask;

Call signature

text
assertRuntimeHumanTaskDecision<TTask extends RuntimeHumanTask>(task: TTask | undefined, command: Pick<RuntimeHumanTaskDecisionCommand, "expectedRevision" | "expectedSubjectHash" | "principal" | "decidedAt" | "decision">): TTask

Parameters

ParameterTypeRequiredDescription
taskTTaskYesRequired parameter; accepted values are defined by the type column.
commandPick<RuntimeHumanTaskDecisionCommand, "principal" | "decidedAt" | "expectedRevision" | "expectedSubjectHash" | "decision">YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: TTask
  • Description: The return contract is defined by the type shown above.

assertRuntimeHumanTaskResume

Assert Runtime Human Task Resume function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function assertRuntimeHumanTaskResume<TTask extends RuntimeHumanTask>(task: TTask | undefined, expected: {
    taskId: string;
    kind: RuntimeHumanTaskKind;
    subjectRef: string;
    subjectHash: string;
    revision: number;
    requestedBy: string;
    resumedAt: string;
    checkpointRef?: string;
    policyRef?: string;
    providerRevision?: string;
    activityDescriptorRef?: string;
    activityDescriptorHash?: string;
}): TTask;

Call signature

text
assertRuntimeHumanTaskResume<TTask extends RuntimeHumanTask>(task: TTask | undefined, expected: { taskId: string; kind: RuntimeHumanTaskKind; subjectRef: string; subjectHash: string; revision: number; requestedBy: string; resumedAt: string; checkpointRef?: string; policyRef?: string; providerRevision?: string; activityDescriptorRef?: string; activityDescriptorHash?: string; }): TTask

Parameters

ParameterTypeRequiredDescription
taskTTaskYesRequired parameter; accepted values are defined by the type column.
expected{ taskId: string; kind: RuntimeHumanTaskKind; subjectRef: string; subjectHash: string; revision: number; requestedBy: string; resumedAt: string; checkpointRef?: string; policyRef?: string; providerRevision?: string; activityDescriptorRef?: string; activityDescriptorHash?: string; }YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: TTask
  • Description: The return contract is defined by the type shown above.

projectRuntimeHumanTasks

Project Runtime Human Tasks function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function projectRuntimeHumanTasks(events: readonly FrameworkEvent[]): RuntimeHumanTask[];

Call signature

text
projectRuntimeHumanTasks(events: readonly FrameworkEvent[]): RuntimeHumanTask[]

Parameters

ParameterTypeRequiredDescription
eventsreadonly FrameworkEvent<unknown>[]YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: RuntimeHumanTask[]
  • Description: The return contract is defined by the type shown above.

runtimeHumanTaskKind

Runtime Human Task Kind function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function runtimeHumanTaskKind(value: string): RuntimeHumanTaskKind | undefined;

Call signature

text
runtimeHumanTaskKind(value: string): RuntimeHumanTaskKind | undefined

Parameters

ParameterTypeRequiredDescription
valuestringYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: "memory" | "skill" | "mcp" | "policy" | "tool" | "execution" | "prompt"
  • Description: The return contract is defined by the type shown above.

runtimeHumanTaskResolutionEventId

Runtime Human Task Resolution Event ID function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function runtimeHumanTaskResolutionEventId(input: {
    runId: string;
    taskId: string;
    expectedRevision: number;
}): string;

Call signature

text
runtimeHumanTaskResolutionEventId(input: { runId: string; taskId: string; expectedRevision: number; }): string

Parameters

ParameterTypeRequiredDescription
input{ runId: string; taskId: string; expectedRevision: number; }YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.