@codesoul-co/hypha-core / contracts/execution-events
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/execution-events.ts - Exports: 11
Using this module
Use the Execution events module for declaring and runtime-validating contracts. It exports 4 interfaces, 7 types.
Import from the package entrypoint
import type {
CommandExecutionEventPayload,
ExecutionEventPayloadBase,
NetworkAuthorizationEventPayload,
SandboxLifecycleEventPayload,
CommandExecutionFrameworkEventType,
ExecutionEventCreateInput,
ExecutionEventPayloadMap,
ExecutionFrameworkEvent,
} from '@codesoul-co/hypha-core';
// The complete export list is documented below.Usage patterns
- Use the 11 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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
CommandExecutionEventPayload | interface | interface CommandExecutionEventPayload extends ExecutionEventPayloadBase | Command Execution Event Payload interface with 22 public fields or methods. |
ExecutionEventPayloadBase | interface | interface ExecutionEventPayloadBase | Execution Event Payload Base interface with 14 public fields or methods. |
NetworkAuthorizationEventPayload | interface | interface NetworkAuthorizationEventPayload extends ExecutionEventPayloadBase | Network Authorization Event Payload interface with 19 public fields or methods. |
SandboxLifecycleEventPayload | interface | interface SandboxLifecycleEventPayload extends ExecutionEventPayloadBase | Sandbox Lifecycle Event Payload interface with 17 public fields or methods. |
CommandExecutionFrameworkEventType | type | type CommandExecutionFrameworkEventType = 'command.execution.requested' | 'command.execution.validated' | 'command.execution.approval.required' | 'command.execution.queued' | 'command.execution.started' | 'command.execution.output.truncated' | 'command.execution.resource.exceeded' | 'command.execution.oom_killed' | 'command.execution.timeout' | 'command.execution.cancellation.requested' | 'command.execution.cancel... | Public type alias for Command Execution Framework Event Type; the declaration contains its complete type expression. |
ExecutionEventCreateInput | type | type ExecutionEventCreateInput = Omit<EventCreateInput<ExecutionEventPayloadMap[TType]>, 'type'> & { type: TType; } | Public type alias for Execution Event Create Input; the declaration contains its complete type expression. |
ExecutionEventPayloadMap | type | type ExecutionEventPayloadMap = { [K in SandboxFrameworkEventType]: SandboxLifecycleEventPayload; } & { [K in CommandExecutionFrameworkEventType]: CommandExecutionEventPayload; } & { [K in NetworkAuthorizationFrameworkEventType]: NetworkAuthorizationEventPayload; } | Public type alias for Execution Event Payload Map; the declaration contains its complete type expression. |
ExecutionFrameworkEvent | type | type ExecutionFrameworkEvent = Omit<FrameworkEvent<ExecutionEventPayloadMap[TType]>, 'type'> & { type: TType; } | Public type alias for Execution Framework Event; the declaration contains its complete type expression. |
ExecutionFrameworkEventType | type | type ExecutionFrameworkEventType = SandboxFrameworkEventType | CommandExecutionFrameworkEventType | NetworkAuthorizationFrameworkEventType | Public type alias for Execution Framework Event Type; the declaration contains its complete type expression. |
NetworkAuthorizationFrameworkEventType | type | type NetworkAuthorizationFrameworkEventType = 'network.authorization.requested' | 'network.authorization.granted' | 'network.authorization.denied' | 'network.authorization.revoked' | Public type alias for Network Authorization Framework Event Type; the declaration contains its complete type expression. |
SandboxFrameworkEventType | type | type SandboxFrameworkEventType = 'sandbox.create.requested' | 'sandbox.created' | 'sandbox.started' | 'sandbox.ready' | 'sandbox.degraded' | 'sandbox.terminate.requested' | 'sandbox.terminated' | 'sandbox.cleanup.completed' | 'sandbox.cleanup.failed' | Public type alias for Sandbox Framework Event Type; the declaration contains its complete type expression. |
CommandExecutionEventPayload
Command Execution Event Payload interface with 22 public fields or methods.
- Kind: interface
- Import:
import type { CommandExecutionEventPayload } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export interface CommandExecutionEventPayload extends ExecutionEventPayloadBase {
executionId: string;
revision?: number;
providerId?: string;
status?: CommandExecutionStatus;
exitCode?: number | null;
signal?: string;
outputStream?: 'stdout' | 'stderr';
outputTruncated?: boolean;
approvalRef?: string;
recoveryDisposition?: ExecutionRecoveryDisposition;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
approvalRef | property | approvalRef?: 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. |
commandHash | property | commandHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentId | property | environmentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentRevision | property | environmentRevision?: 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. |
executionId | property | executionId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
exitCode | property | exitCode?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
latencyMs | property | latencyMs?: number | 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. |
operationId | property | operationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputStream | property | outputStream?: "stdout" | "stderr" | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputTruncated | property | outputTruncated?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
recoveryDisposition | property | recoveryDisposition?: ExecutionRecoveryDisposition | Public property; its type, readonly modifier and optionality are shown in the signature. |
resourceUsage | property | resourceUsage?: ExecutionResourceUsage | 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. |
sandboxId | property | sandboxId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
signal | property | signal?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceTreeHash | property | sourceTreeHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status?: CommandExecutionStatus | 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. |
ExecutionEventPayloadBase
Execution Event Payload Base interface with 14 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionEventPayloadBase } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export interface ExecutionEventPayloadBase {
operationId?: string;
executionId?: string;
sandboxId?: string;
workspaceId?: string;
environmentId?: string;
environmentRevision?: string;
commandHash?: string;
sourceTreeHash?: string;
artifactRefs?: string[];
status?: string;
latencyMs?: number;
resourceUsage?: ExecutionResourceUsage;
error?: NormalizedExecutionError;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
artifactRefs | property | artifactRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
commandHash | property | commandHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentId | property | environmentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentRevision | property | environmentRevision?: 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. |
executionId | property | executionId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
latencyMs | property | latencyMs?: number | 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. |
operationId | property | operationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
resourceUsage | property | resourceUsage?: ExecutionResourceUsage | Public property; its type, readonly modifier and optionality are shown in the signature. |
sandboxId | property | sandboxId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceTreeHash | property | sourceTreeHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status?: 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. |
NetworkAuthorizationEventPayload
Network Authorization Event Payload interface with 19 public fields or methods.
- Kind: interface
- Import:
import type { NetworkAuthorizationEventPayload } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export interface NetworkAuthorizationEventPayload extends ExecutionEventPayloadBase {
authorizationId: string;
networkPolicyHash: string;
decision: 'requested' | 'granted' | 'denied' | 'revoked';
expiresAt?: string;
reason?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
artifactRefs | property | artifactRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
authorizationId | property | authorizationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
commandHash | property | commandHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decision | property | decision: "requested" | "granted" | "denied" | "revoked" | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentId | property | environmentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentRevision | property | environmentRevision?: 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. |
executionId | property | executionId?: 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. |
latencyMs | property | latencyMs?: number | 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. |
networkPolicyHash | property | networkPolicyHash: 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. |
reason | property | reason?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
resourceUsage | property | resourceUsage?: ExecutionResourceUsage | Public property; its type, readonly modifier and optionality are shown in the signature. |
sandboxId | property | sandboxId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceTreeHash | property | sourceTreeHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status?: 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. |
SandboxLifecycleEventPayload
Sandbox Lifecycle Event Payload interface with 17 public fields or methods.
- Kind: interface
- Import:
import type { SandboxLifecycleEventPayload } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export interface SandboxLifecycleEventPayload extends ExecutionEventPayloadBase {
sandboxId?: string;
providerId?: string;
providerSandboxRef?: string;
status?: SandboxStatus | 'degraded';
missingCapabilities?: SandboxCapabilityName[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
artifactRefs | property | artifactRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
commandHash | property | commandHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentId | property | environmentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentRevision | property | environmentRevision?: 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. |
executionId | property | executionId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
latencyMs | property | latencyMs?: number | 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. |
missingCapabilities | property | missingCapabilities?: (keyof import("/Users/erwin/Downloads/codespace/Hypha/packages/core/dist/contracts/sandbox").SandboxProviderCapabilities)[] | 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. |
providerId | property | providerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerSandboxRef | property | providerSandboxRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
resourceUsage | property | resourceUsage?: ExecutionResourceUsage | Public property; its type, readonly modifier and optionality are shown in the signature. |
sandboxId | property | sandboxId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceTreeHash | property | sourceTreeHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status?: "degraded" | SandboxStatus | 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. |
CommandExecutionFrameworkEventType
Public type alias for Command Execution Framework Event Type; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { CommandExecutionFrameworkEventType } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type CommandExecutionFrameworkEventType = 'command.execution.requested' | 'command.execution.validated' | 'command.execution.approval.required' | 'command.execution.queued' | 'command.execution.started' | 'command.execution.output.truncated' | 'command.execution.resource.exceeded' | 'command.execution.oom_killed' | 'command.execution.timeout' | 'command.execution.cancellation.requested' | 'command.execution.cancelled' | 'command.execution.completed' | 'command.execution.failed' | 'command.execution.result.unknown' | 'command.execution.recovered';ExecutionEventCreateInput
Public type alias for Execution Event Create Input; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionEventCreateInput } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type ExecutionEventCreateInput<TType extends ExecutionFrameworkEventType = ExecutionFrameworkEventType> = Omit<EventCreateInput<ExecutionEventPayloadMap[TType]>, 'type'> & {
type: TType;
};ExecutionEventPayloadMap
Public type alias for Execution Event Payload Map; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionEventPayloadMap } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type ExecutionEventPayloadMap = {
[K in SandboxFrameworkEventType]: SandboxLifecycleEventPayload;
} & {
[K in CommandExecutionFrameworkEventType]: CommandExecutionEventPayload;
} & {
[K in NetworkAuthorizationFrameworkEventType]: NetworkAuthorizationEventPayload;
};ExecutionFrameworkEvent
Public type alias for Execution Framework Event; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionFrameworkEvent } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type ExecutionFrameworkEvent<TType extends ExecutionFrameworkEventType = ExecutionFrameworkEventType> = Omit<FrameworkEvent<ExecutionEventPayloadMap[TType]>, 'type'> & {
type: TType;
};ExecutionFrameworkEventType
Public type alias for Execution Framework Event Type; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionFrameworkEventType } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type ExecutionFrameworkEventType = SandboxFrameworkEventType | CommandExecutionFrameworkEventType | NetworkAuthorizationFrameworkEventType;NetworkAuthorizationFrameworkEventType
Public type alias for Network Authorization Framework Event Type; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { NetworkAuthorizationFrameworkEventType } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type NetworkAuthorizationFrameworkEventType = 'network.authorization.requested' | 'network.authorization.granted' | 'network.authorization.denied' | 'network.authorization.revoked';SandboxFrameworkEventType
Public type alias for Sandbox Framework Event Type; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { SandboxFrameworkEventType } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-events
Declaration
export type SandboxFrameworkEventType = 'sandbox.create.requested' | 'sandbox.created' | 'sandbox.started' | 'sandbox.ready' | 'sandbox.degraded' | 'sandbox.terminate.requested' | 'sandbox.terminated' | 'sandbox.cleanup.completed' | 'sandbox.cleanup.failed';