@codesoul-co/hypha-core / contracts/runtime-human-task
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/runtime-human-task.ts - Exports: 9
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
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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
RUNTIME_HUMAN_TASK_DECISIONS | constant | const 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_KINDS | constant | const 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_STATUSES | constant | const RUNTIME_HUMAN_TASK_STATUSES: readonly ["pending", "approved", "rejected", "expired", "cancelled", "superseded"] | RUNTIME HUMAN TASK STATUSES constant exported by the contracts/runtime-human-task module. |
RuntimeHumanTask | interface | interface RuntimeHumanTask | Runtime Human Task interface with 26 public fields or methods. |
RuntimeHumanTaskDecisionCommand | interface | interface RuntimeHumanTaskDecisionCommand | Runtime Human Task Decision Command interface with 11 public fields or methods. |
RuntimeHumanTaskRequest | interface | interface RuntimeHumanTaskRequest | Runtime Human Task Request interface with 15 public fields or methods. |
RuntimeHumanTaskDecision | type | type RuntimeHumanTaskDecision = (typeof RUNTIME_HUMAN_TASK_DECISIONS)[number] | Public type alias for Runtime Human Task Decision; the declaration contains its complete type expression. |
RuntimeHumanTaskKind | type | type RuntimeHumanTaskKind = (typeof RUNTIME_HUMAN_TASK_KINDS)[number] | Public type alias for Runtime Human Task Kind; the declaration contains its complete type expression. |
RuntimeHumanTaskStatus | type | type 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.
- Kind: constant
- Import:
import { RUNTIME_HUMAN_TASK_DECISIONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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.
- Kind: constant
- Import:
import { RUNTIME_HUMAN_TASK_KINDS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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.
- Kind: constant
- Import:
import { RUNTIME_HUMAN_TASK_STATUSES } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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.
- Kind: interface
- Import:
import type { RuntimeHumanTask } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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
| Member | Kind | Signature | Description |
|---|---|---|---|
activityDescriptorHash | property | activityDescriptorHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
activityDescriptorRef | property | activityDescriptorRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
allowedDecisionScopes | property | allowedDecisionScopes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
checkpointRef | property | checkpointRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decidedAt | property | decidedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decidedBy | property | decidedBy?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decisionCommandId | property | decisionCommandId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decisionEventId | property | decisionEventId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decisionIdempotencyKey | property | decisionIdempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "memory" | "skill" | "mcp" | "policy" | "tool" | "execution" | "prompt" | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRef | property | policyRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerRevision | property | providerRevision?: string | 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. |
requestedBy | property | requestedBy: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
revision | property | revision: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
stateAttempt | property | stateAttempt: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
stateId | property | stateId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "rejected" | "cancelled" | "expired" | "pending" | "approved" | "superseded" | Public property; its type, readonly modifier and optionality are shown in the signature. |
subjectHash | property | subjectHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
subjectRef | property | subjectRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
supersededByTaskId | property | supersededByTaskId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
taskId | property | taskId: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
commandId | property | commandId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decidedAt | property | decidedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decision | property | decision: "rejected" | "cancelled" | "expired" | "approved" | "superseded" | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedRevision | property | expectedRevision: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedSubjectHash | property | expectedSubjectHash: 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. |
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. |
scope | property | scope: RuntimeScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
supersededByTaskId | property | supersededByTaskId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
taskId | property | taskId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeHumanTaskRequest
Runtime Human Task Request interface with 15 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeHumanTaskRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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
| Member | Kind | Signature | Description |
|---|---|---|---|
activityDescriptorHash | property | activityDescriptorHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
activityDescriptorRef | property | activityDescriptorRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
allowedDecisionScopes | property | allowedDecisionScopes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
checkpointRef | property | checkpointRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "memory" | "skill" | "mcp" | "policy" | "tool" | "execution" | "prompt" | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRef | property | policyRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerRevision | property | providerRevision?: string | 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. |
requestedBy | property | requestedBy: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
subjectHash | property | subjectHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
subjectRef | property | subjectRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
taskId | property | taskId: string | Public 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.
- Kind: type
- Import:
import type { RuntimeHumanTaskDecision } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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.
- Kind: type
- Import:
import type { RuntimeHumanTaskKind } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
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.
- Kind: type
- Import:
import type { RuntimeHumanTaskStatus } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-human-task
Declaration
export type RuntimeHumanTaskStatus = (typeof RUNTIME_HUMAN_TASK_STATUSES)[number];