Skip to content

@codesoul-co/hypha-core / contracts/execution-human-task

Using this module

Use the Execution human task module for declaring and runtime-validating contracts. It exports 1 constant, 9 interfaces.

Import from the package entrypoint

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

import type {
  ExecutionHumanTaskActivityIdentity,
  ExecutionHumanTaskCommandSnapshot,
  ExecutionHumanTaskEnvironmentSnapshot,
  ExecutionHumanTaskExpectedEffects,
  ExecutionHumanTaskNetworkSnapshot,
  ExecutionHumanTaskRiskSnapshot,
  ExecutionHumanTaskSubject,
  ExecutionHumanTaskSubjectEnvelope,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 9 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
EXECUTION_HUMAN_TASK_SUBJECT_VERSIONconstantconst EXECUTION_HUMAN_TASK_SUBJECT_VERSION: "1.0.0"EXECUTION HUMAN TASK SUBJECT VERSION constant exported by the contracts/execution-human-task module.
ExecutionHumanTaskActivityIdentityinterfaceinterface ExecutionHumanTaskActivityIdentityExecution Human Task Activity Identity interface with 7 public fields or methods.
ExecutionHumanTaskCommandSnapshotinterfaceinterface ExecutionHumanTaskCommandSnapshotExecution Human Task Command Snapshot interface with 12 public fields or methods.
ExecutionHumanTaskEnvironmentSnapshotinterfaceinterface ExecutionHumanTaskEnvironmentSnapshotExecution Human Task Environment Snapshot interface with 11 public fields or methods.
ExecutionHumanTaskExpectedEffectsinterfaceinterface ExecutionHumanTaskExpectedEffectsExecution Human Task Expected Effects interface with 4 public fields or methods.
ExecutionHumanTaskNetworkSnapshotinterfaceinterface ExecutionHumanTaskNetworkSnapshotExecution Human Task Network Snapshot interface with 7 public fields or methods.
ExecutionHumanTaskRiskSnapshotinterfaceinterface ExecutionHumanTaskRiskSnapshotExecution Human Task Risk Snapshot interface with 5 public fields or methods.
ExecutionHumanTaskSubjectinterfaceinterface ExecutionHumanTaskSubjectVersioned, redacted subject approved by a Runtime HumanTask before command dispatch. Environment values, stdin, Secret values, and arbitrary request metadata are intentionally absent.
ExecutionHumanTaskSubjectEnvelopeinterfaceinterface ExecutionHumanTaskSubjectEnvelopeExecution Human Task Subject Envelope interface with 3 public fields or methods.
ExecutionHumanTaskToolIdentityinterfaceinterface ExecutionHumanTaskToolIdentityExecution Human Task Tool Identity interface with 6 public fields or methods.

EXECUTION_HUMAN_TASK_SUBJECT_VERSION

EXECUTION HUMAN TASK SUBJECT VERSION constant exported by the contracts/execution-human-task module.

Declaration

text
export declare const EXECUTION_HUMAN_TASK_SUBJECT_VERSION: "1.0.0";

ExecutionHumanTaskActivityIdentity

Execution Human Task Activity Identity interface with 7 public fields or methods.

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

Declaration

text
export interface ExecutionHumanTaskActivityIdentity {
    activityId: string;
    operationId: string;
    runId: string;
    stateAttemptId: string;
    workspaceId: string;
    fencingToken: number;
    deadlineAt?: string;
}

Contract members

MemberKindSignatureDescription
activityIdpropertyactivityId: stringPublic 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.
fencingTokenpropertyfencingToken: numberPublic 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.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stateAttemptIdpropertystateAttemptId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionHumanTaskCommandSnapshot

Execution Human Task Command Snapshot interface with 12 public fields or methods.

Declaration

text
export interface ExecutionHumanTaskCommandSnapshot {
    executable: string;
    args: string[];
    cwd?: string;
    shell: boolean;
    environmentVariableNames: string[];
    secretRefs: string[];
    networkAuthorizationRef?: string;
    expectedWorkspaceSnapshotHash?: string;
    timeoutMs?: number;
    idleTimeoutMs?: number;
    maxStdoutBytes?: number;
    maxStderrBytes?: number;
}

Contract members

MemberKindSignatureDescription
argspropertyargs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
cwdpropertycwd?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentVariableNamespropertyenvironmentVariableNames: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
executablepropertyexecutable: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedWorkspaceSnapshotHashpropertyexpectedWorkspaceSnapshotHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idleTimeoutMspropertyidleTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxStderrBytespropertymaxStderrBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxStdoutBytespropertymaxStdoutBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
networkAuthorizationRefpropertynetworkAuthorizationRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
secretRefspropertysecretRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
shellpropertyshell: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutMspropertytimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionHumanTaskEnvironmentSnapshot

Execution Human Task Environment Snapshot interface with 11 public fields or methods.

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

Declaration

text
export interface ExecutionHumanTaskEnvironmentSnapshot {
    id: string;
    version: string;
    revision: string;
    provider: 'mock' | 'local_process' | 'docker' | 'remote_sandbox' | 'custom';
    providerRef?: string;
    providerId: string;
    providerRevision: string;
    imageDigest?: string;
    mounts: SandboxMountSpec[];
    network: ExecutionHumanTaskNetworkSnapshot;
    resources: ResourceLimitSpec;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
imageDigestpropertyimageDigest?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mountspropertymounts: SandboxMountSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
networkpropertynetwork: ExecutionHumanTaskNetworkSnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider: "mock" | "local_process" | "docker" | "remote_sandbox" | "custom"Public property; its type, readonly modifier and optionality are shown in the signature.
providerIdpropertyproviderId: 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.
resourcespropertyresources: ResourceLimitSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionHumanTaskExpectedEffects

Execution Human Task Expected Effects interface with 4 public fields or methods.

Declaration

text
export interface ExecutionHumanTaskExpectedEffects {
    workspaceWrite: boolean;
    networkAccess: boolean;
    secretAccess: boolean;
    artifactCapture: boolean;
}

Contract members

MemberKindSignatureDescription
artifactCapturepropertyartifactCapture: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
networkAccesspropertynetworkAccess: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
secretAccesspropertysecretAccess: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceWritepropertyworkspaceWrite: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionHumanTaskNetworkSnapshot

Execution Human Task Network Snapshot interface with 7 public fields or methods.

Declaration

text
export interface ExecutionHumanTaskNetworkSnapshot {
    mode: 'disabled' | 'restricted' | 'enabled' | 'task_authorized';
    allowedDomains: string[];
    allowedCidrs: string[];
    allowedPorts: number[];
    allowedProtocols: Array<'tcp' | 'udp' | 'http' | 'https' | 'dns'>;
    proxyRef?: string;
    authorizationRef?: string;
}

Contract members

MemberKindSignatureDescription
allowedCidrspropertyallowedCidrs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedDomainspropertyallowedDomains: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedPortspropertyallowedPorts: number[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedProtocolspropertyallowedProtocols: ("tcp" | "udp" | "http" | "https" | "dns")[]Public property; its type, readonly modifier and optionality are shown in the signature.
authorizationRefpropertyauthorizationRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "disabled" | "restricted" | "enabled" | "task_authorized"Public property; its type, readonly modifier and optionality are shown in the signature.
proxyRefpropertyproxyRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionHumanTaskRiskSnapshot

Execution Human Task Risk Snapshot interface with 5 public fields or methods.

Declaration

text
export interface ExecutionHumanTaskRiskSnapshot {
    assessmentId: string;
    level: RiskLevel;
    reasons: string[];
    matchedRules: string[];
    policyDecisionRef: string;
}

Contract members

MemberKindSignatureDescription
assessmentIdpropertyassessmentId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
levelpropertylevel: RiskLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
matchedRulespropertymatchedRules: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
policyDecisionRefpropertypolicyDecisionRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonspropertyreasons: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

ExecutionHumanTaskSubject

Versioned, redacted subject approved by a Runtime HumanTask before command dispatch. Environment values, stdin, Secret values, and arbitrary request metadata are intentionally absent.

Declaration

text
export interface ExecutionHumanTaskSubject {
    id: string;
    version: typeof EXECUTION_HUMAN_TASK_SUBJECT_VERSION;
    kind: 'execution';
    capturedAt: string;
    principalId: string;
    inputHash: string;
    activity: ExecutionHumanTaskActivityIdentity;
    tool: ExecutionHumanTaskToolIdentity;
    command: ExecutionHumanTaskCommandSnapshot;
    environment: ExecutionHumanTaskEnvironmentSnapshot;
    risk: ExecutionHumanTaskRiskSnapshot;
    expectedEffects: ExecutionHumanTaskExpectedEffects;
}

Contract members

MemberKindSignatureDescription
activitypropertyactivity: ExecutionHumanTaskActivityIdentityPublic property; its type, readonly modifier and optionality are shown in the signature.
capturedAtpropertycapturedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
commandpropertycommand: ExecutionHumanTaskCommandSnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentpropertyenvironment: ExecutionHumanTaskEnvironmentSnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedEffectspropertyexpectedEffects: ExecutionHumanTaskExpectedEffectsPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: 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.
kindpropertykind: "execution"Public property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
riskpropertyrisk: ExecutionHumanTaskRiskSnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.
toolpropertytool: ExecutionHumanTaskToolIdentityPublic 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.

ExecutionHumanTaskSubjectEnvelope

Execution Human Task Subject Envelope interface with 3 public fields or methods.

Declaration

text
export interface ExecutionHumanTaskSubjectEnvelope {
    subjectRef: string;
    subjectHash: string;
    subject: ExecutionHumanTaskSubject;
}

Contract members

MemberKindSignatureDescription
subjectpropertysubject: ExecutionHumanTaskSubjectPublic 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.

ExecutionHumanTaskToolIdentity

Execution Human Task Tool Identity interface with 6 public fields or methods.

Declaration

text
export interface ExecutionHumanTaskToolIdentity {
    toolId: string;
    toolRevision?: string;
    operation: ExecutionToolOperation;
    executionProfileRef: string;
    sideEffectLevel: ExecutionToolSideEffectLevel;
    humanReviewPolicyRef: string;
}

Contract members

MemberKindSignatureDescription
executionProfileRefpropertyexecutionProfileRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
humanReviewPolicyRefpropertyhumanReviewPolicyRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationpropertyoperation: "artifact" | "command" | "file_read" | "file_write" | "sandbox"Public property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel: ExecutionToolSideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
toolIdpropertytoolId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.