@codesoul-co/hypha-core / contracts/execution-activities
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/execution-activities.ts - Exports: 5
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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
EXECUTION_ACTIVITY_STATUSES | constant | const EXECUTION_ACTIVITY_STATUSES: readonly ["completed", "failed", "timeout", "cancelled", "unknown"] | EXECUTION ACTIVITY STATUSES constant exported by the contracts/execution-activities module. |
ExecutionActivityRequest | interface | interface ExecutionActivityRequest | Execution Activity Request interface with 9 public fields or methods. |
ExecutionActivityResult | interface | interface ExecutionActivityResult | Execution Activity Result interface with 7 public fields or methods. |
ExecutionActivityStatus | type | type ExecutionActivityStatus = (typeof EXECUTION_ACTIVITY_STATUSES)[number] | Public type alias for Execution Activity Status; the declaration contains its complete type expression. |
WorkspaceOperationRequest | type | type WorkspaceOperationRequest = WorkspacePathRequest | WorkspaceListRequest | WorkspaceReadRequest | WorkspaceWriteRequest | WorkspaceDeleteRequest | WorkspaceSnapshotRequest | WorkspaceRestoreRequest | WorkspaceDiffRequest | WorkspacePatchRequest | Public 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.
- Kind: constant
- Import:
import { EXECUTION_ACTIVITY_STATUSES } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-activities
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.
- Kind: interface
- Import:
import type { ExecutionActivityRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-activities
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
| Member | Kind | Signature | Description |
|---|---|---|---|
activityId | property | activityId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
deadlineAt | property | deadlineAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
fencingToken | property | fencingToken: number | 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. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
request | property | request: CommandExecutionRequest | WorkspaceOperationRequest | 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. |
stateAttemptId | property | stateAttemptId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceId | property | workspaceId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ExecutionActivityResult
Execution Activity Result interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionActivityResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-activities
Declaration
text
export interface ExecutionActivityResult {
activityId: string;
status: ExecutionActivityStatus;
executionId?: string;
artifactRefs?: string[];
snapshotRef?: string;
eventIds: string[];
error?: NormalizedExecutionError;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
activityId | property | activityId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
artifactRefs | property | artifactRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
error | property | error?: NormalizedExecutionError | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventIds | property | eventIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
executionId | property | executionId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshotRef | property | snapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "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.
- Kind: type
- Import:
import type { ExecutionActivityStatus } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-activities
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.
- Kind: type
- Import:
import type { WorkspaceOperationRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-activities
Declaration
text
export type WorkspaceOperationRequest = WorkspacePathRequest | WorkspaceListRequest | WorkspaceReadRequest | WorkspaceWriteRequest | WorkspaceDeleteRequest | WorkspaceSnapshotRequest | WorkspaceRestoreRequest | WorkspaceDiffRequest | WorkspacePatchRequest;