Skip to content

@codesoul-co/hypha-core / contracts/execution-port

Using this module

Use the Execution port module for declaring and runtime-validating contracts. It exports 6 interfaces.

Import from the package entrypoint

ts
import type {
  ExecutionAuthorizationEvidence,
  ExecutionAuthorizationVerificationResult,
  ExecutionAuthorizationVerifier,
  ExecutionDispatchRequest,
  ExecutionOperationDispatcher,
  ExecutionPort,
} 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.

Public exports

SymbolKindSignatureDescription
ExecutionAuthorizationEvidenceinterfaceinterface ExecutionAuthorizationEvidenceExecution Authorization Evidence interface with 14 public fields or methods.
ExecutionAuthorizationVerificationResultinterfaceinterface ExecutionAuthorizationVerificationResultExecution Authorization Verification Result interface with 5 public fields or methods.
ExecutionAuthorizationVerifierinterfaceinterface ExecutionAuthorizationVerifierExecution Authorization Verifier interface with 1 public fields or methods.
ExecutionDispatchRequestinterfaceinterface ExecutionDispatchRequestExecution Dispatch Request interface with 4 public fields or methods.
ExecutionOperationDispatcherinterfaceinterface ExecutionOperationDispatcherExecution Operation Dispatcher interface with 1 public fields or methods.
ExecutionPortinterfaceinterface ExecutionPortExecution Port interface with 1 public fields or methods.

ExecutionAuthorizationEvidence

Execution Authorization Evidence interface with 14 public fields or methods.

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

Declaration

text
export interface ExecutionAuthorizationEvidence {
    id: string;
    invocationId: string;
    activityId: string;
    runId: string;
    toolId: string;
    toolRevision?: string;
    contractSnapshotRef?: string;
    principalId: string;
    inputHash: string;
    policyDecisionRef: string;
    riskAssessmentId: string;
    approvalRef?: string;
    authorizedAt: string;
    expiresAt?: string;
}

Contract members

MemberKindSignatureDescription
activityIdpropertyactivityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
approvalRefpropertyapprovalRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
authorizedAtpropertyauthorizedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contractSnapshotRefpropertycontractSnapshotRef?: 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.
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.
invocationIdpropertyinvocationId: stringPublic 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.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
riskAssessmentIdpropertyriskAssessmentId: 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.
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.

ExecutionAuthorizationVerificationResult

Execution Authorization Verification Result interface with 5 public fields or methods.

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

Declaration

text
export interface ExecutionAuthorizationVerificationResult {
    valid: boolean;
    verificationRef: string;
    verifiedAt: string;
    expiresAt?: string;
    reason?: string;
}

Contract members

MemberKindSignatureDescription
expiresAtpropertyexpiresAt?: 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.
validpropertyvalid: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
verificationRefpropertyverificationRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
verifiedAtpropertyverifiedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionAuthorizationVerifier

Execution Authorization Verifier interface with 1 public fields or methods.

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

Declaration

text
export interface ExecutionAuthorizationVerifier {
    verify(request: ExecutionDispatchRequest, abortSignal: AbortSignal): Promise<ExecutionAuthorizationVerificationResult>;
}

Contract members

MemberKindSignatureDescription
verifymethodverify(request: ExecutionDispatchRequest, abortSignal: AbortSignal): Promise<ExecutionAuthorizationVerificationResult>Public method; parameters and return type are shown in the signature.

ExecutionDispatchRequest

Execution Dispatch Request interface with 4 public fields or methods.

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

Declaration

text
export interface ExecutionDispatchRequest {
    activity: ExecutionActivityRequest;
    binding: ExecutionToolBinding;
    riskAssessment: ExecutionRiskAssessment;
    authorization: ExecutionAuthorizationEvidence;
}

Contract members

MemberKindSignatureDescription
activitypropertyactivity: ExecutionActivityRequestPublic property; its type, readonly modifier and optionality are shown in the signature.
authorizationpropertyauthorization: ExecutionAuthorizationEvidencePublic property; its type, readonly modifier and optionality are shown in the signature.
bindingpropertybinding: ExecutionToolBindingPublic property; its type, readonly modifier and optionality are shown in the signature.
riskAssessmentpropertyriskAssessment: ExecutionRiskAssessmentPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOperationDispatcher

Execution Operation Dispatcher interface with 1 public fields or methods.

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

Declaration

text
export interface ExecutionOperationDispatcher {
    dispatch(request: ExecutionActivityRequest, abortSignal: AbortSignal): Promise<ExecutionActivityResult>;
}

Contract members

MemberKindSignatureDescription
dispatchmethoddispatch(request: ExecutionActivityRequest, abortSignal: AbortSignal): Promise<ExecutionActivityResult>Public method; parameters and return type are shown in the signature.

ExecutionPort

Execution Port interface with 1 public fields or methods.

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

Declaration

text
export interface ExecutionPort {
    execute(request: ExecutionDispatchRequest, abortSignal: AbortSignal): Promise<ExecutionActivityResult>;
}

Contract members

MemberKindSignatureDescription
executemethodexecute(request: ExecutionDispatchRequest, abortSignal: AbortSignal): Promise<ExecutionActivityResult>Public method; parameters and return type are shown in the signature.