@codesoul-co/hypha-core / contracts/execution
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/execution.ts - Exports: 3
Using this module
Use the Execution module for declaring and runtime-validating contracts. It exports 3 interfaces.
Import from the package entrypoint
ts
import type {
ExecutionPrincipal,
NormalizedExecutionError,
ProviderHealth,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 3 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 |
|---|---|---|---|
ExecutionPrincipal | interface | interface ExecutionPrincipal | Execution Principal interface with 8 public fields or methods. |
NormalizedExecutionError | interface | interface NormalizedExecutionError | Normalized Execution Error interface with 6 public fields or methods. |
ProviderHealth | interface | interface ProviderHealth | Provider Health interface with 5 public fields or methods. |
ExecutionPrincipal
Execution Principal interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionPrincipal } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution
Declaration
text
export interface ExecutionPrincipal {
principalId: string;
type: 'user' | 'agent' | 'service' | 'system';
tenantId?: string;
userId?: string;
agentId?: string;
roles?: string[];
permissionScopes: string[];
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
agentId | property | agentId?: string | 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. |
permissionScopes | property | permissionScopes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
principalId | property | principalId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
roles | property | roles?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantId | property | tenantId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
type | property | type: "system" | "agent" | "user" | "service" | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
NormalizedExecutionError
Normalized Execution Error interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { NormalizedExecutionError } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution
Declaration
text
export interface NormalizedExecutionError {
code: 'EXECUTION_INVALID_REQUEST' | 'EXECUTION_PERMISSION_DENIED' | 'EXECUTION_POLICY_DENIED' | 'EXECUTION_APPROVAL_REQUIRED' | 'EXECUTION_WORKSPACE_NOT_FOUND' | 'EXECUTION_PATH_ESCAPE' | 'EXECUTION_PATH_DENIED' | 'EXECUTION_QUOTA_EXCEEDED' | 'EXECUTION_ENVIRONMENT_UNAVAILABLE' | 'EXECUTION_SANDBOX_CREATE_FAILED' | 'EXECUTION_SANDBOX_START_FAILED' | 'EXECUTION_IMAGE_UNTRUSTED' | 'EXECUTION_NETWORK_DENIED' | 'EXECUTION_SECRET_DENIED' | 'EXECUTION_PROCESS_START_FAILED' | 'EXECUTION_TIMEOUT' | 'EXECUTION_IDLE_TIMEOUT' | 'EXECUTION_CANCELLED' | 'EXECUTION_OOM_KILLED' | 'EXECUTION_RESOURCE_EXCEEDED' | 'EXECUTION_OUTPUT_LIMIT' | 'EXECUTION_RESULT_UNKNOWN' | 'EXECUTION_REVISION_CONFLICT' | 'EXECUTION_LEASE_HELD' | 'EXECUTION_LEASE_LOST' | 'EXECUTION_IDEMPOTENCY_CONFLICT' | 'EXECUTION_CLEANUP_FAILED' | 'EXECUTION_INTERNAL_ERROR';
message: string;
retryable: boolean;
providerCode?: string | number;
details?: Record<string, unknown>;
causeRef?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
causeRef | property | causeRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
code | property | code: "EXECUTION_INVALID_REQUEST" | "EXECUTION_PERMISSION_DENIED" | "EXECUTION_POLICY_DENIED" | "EXECUTION_APPROVAL_REQUIRED" | "EXECUTION_WORKSPACE_NOT_FOUND" | "EXECUTION_PATH_ESCAPE" | "EXECUTION_PATH_DENIED" | "EXECUTION_QUOTA_EXCEEDED" | "EXECUTION_ENVIRONMENT_UNAVAILABLE" | "EXECUTION_SANDBOX_CREATE_FAILED" | "EXECUTION_SANDBOX_START_FAILED" | "EXECUTION_IMAGE_UNTRUSTED" | "EXECUTION_NETWORK_DENIED" | "EXECU... | Public property; its type, readonly modifier and optionality are shown in the signature. |
details | property | details?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
message | property | message: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerCode | property | providerCode?: string | number | Public property; its type, readonly modifier and optionality are shown in the signature. |
retryable | property | retryable: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
ProviderHealth
Provider Health interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { ProviderHealth } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution
Declaration
text
export interface ProviderHealth {
status: 'healthy' | 'degraded' | 'unhealthy' | 'unknown';
checkedAt: string;
latencyMs?: number;
message?: string;
details?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checkedAt | property | checkedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
details | property | details?: Record<string, unknown> | 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. |
message | property | message?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "healthy" | "degraded" | "unhealthy" | "unknown" | Public property; its type, readonly modifier and optionality are shown in the signature. |
