Skip to content

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

Using this module

Use the Execution activities module for declaring and runtime-validating contracts. It exports 1 constant, 2 interfaces, 2 types.

Import from the package entrypoint

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

import type {
  ExecutionActivityRequest,
  ExecutionActivityResult,
  ExecutionActivityStatus,
  WorkspaceOperationRequest,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 4 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_ACTIVITY_STATUSESconstantconst EXECUTION_ACTIVITY_STATUSES: readonly ["completed", "failed", "timeout", "cancelled", "unknown"]EXECUTION ACTIVITY STATUSES constant exported by the contracts/execution-activities module.
ExecutionActivityRequestinterfaceinterface ExecutionActivityRequestExecution Activity Request interface with 9 public fields or methods.
ExecutionActivityResultinterfaceinterface ExecutionActivityResultExecution Activity Result interface with 7 public fields or methods.
ExecutionActivityStatustypetype ExecutionActivityStatus = (typeof EXECUTION_ACTIVITY_STATUSES)[number]Public type alias for Execution Activity Status; the declaration contains its complete type expression.
WorkspaceOperationRequesttypetype WorkspaceOperationRequest = WorkspacePathRequest | WorkspaceListRequest | WorkspaceReadRequest | WorkspaceWriteRequest | WorkspaceDeleteRequest | WorkspaceSnapshotRequest | WorkspaceRestoreRequest | WorkspaceDiffRequest | WorkspacePatchRequestPublic type alias for Workspace Operation Request; the declaration contains its complete type expression.

EXECUTION_ACTIVITY_STATUSES

EXECUTION ACTIVITY STATUSES constant exported by the contracts/execution-activities module.

Declaration

text
export declare const EXECUTION_ACTIVITY_STATUSES: readonly ["completed", "failed", "timeout", "cancelled", "unknown"];

ExecutionActivityRequest

Execution Activity Request interface with 9 public fields or methods.

Declaration

text
export interface ExecutionActivityRequest {
    activityId: string;
    operationId: string;
    runId: string;
    stateAttemptId: string;
    workspaceId: string;
    request: CommandExecutionRequest | WorkspaceOperationRequest;
    fencingToken: number;
    deadlineAt?: string;
    idempotencyKey?: 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.
idempotencyKeypropertyidempotencyKey?: stringPublic 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.
requestpropertyrequest: CommandExecutionRequest | WorkspaceOperationRequestPublic 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.

ExecutionActivityResult

Execution Activity Result interface with 7 public fields or methods.

Declaration

text
export interface ExecutionActivityResult {
    activityId: string;
    status: ExecutionActivityStatus;
    executionId?: string;
    artifactRefs?: string[];
    snapshotRef?: string;
    eventIds: string[];
    error?: NormalizedExecutionError;
}

Contract members

MemberKindSignatureDescription
activityIdpropertyactivityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
artifactRefspropertyartifactRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror?: NormalizedExecutionErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
executionIdpropertyexecutionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
snapshotRefpropertysnapshotRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "unknown" | "completed" | "cancelled" | "failed" | "timeout"Public property; its type, readonly modifier and optionality are shown in the signature.

ExecutionActivityStatus

Public type alias for Execution Activity Status; the declaration contains its complete type expression.

Declaration

text
export type ExecutionActivityStatus = (typeof EXECUTION_ACTIVITY_STATUSES)[number];

WorkspaceOperationRequest

Public type alias for Workspace Operation Request; the declaration contains its complete type expression.

Declaration

text
export type WorkspaceOperationRequest = WorkspacePathRequest | WorkspaceListRequest | WorkspaceReadRequest | WorkspaceWriteRequest | WorkspaceDeleteRequest | WorkspaceSnapshotRequest | WorkspaceRestoreRequest | WorkspaceDiffRequest | WorkspacePatchRequest;