@codesoul-co/hypha-core / contracts/execution-governance
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/execution-governance.ts - Exports: 9
Using this module
Use the Execution governance module for declaring and runtime-validating contracts. It exports 2 constants, 4 interfaces, 3 types.
Import from the package entrypoint
import {
EXECUTION_SANDBOX_LEVELS,
EXECUTION_TOOL_OPERATIONS,
} from '@codesoul-co/hypha-core';
import type {
ExecutionRiskAssessment,
ExecutionRiskEvaluationInput,
ExecutionRiskEvaluator,
ExecutionToolBinding,
ExecutionSandboxLevel,
ExecutionToolOperation,
ExecutionToolSideEffectLevel,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 7 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The 2 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
EXECUTION_SANDBOX_LEVELS | constant | const EXECUTION_SANDBOX_LEVELS: readonly ["local", "container", "remote_isolated"] | EXECUTION SANDBOX LEVELS constant exported by the contracts/execution-governance module. |
EXECUTION_TOOL_OPERATIONS | constant | const EXECUTION_TOOL_OPERATIONS: readonly ["file_read", "file_write", "command", "sandbox", "artifact"] | EXECUTION TOOL OPERATIONS constant exported by the contracts/execution-governance module. |
ExecutionRiskAssessment | interface | interface ExecutionRiskAssessment | Execution Risk Assessment interface with 7 public fields or methods. |
ExecutionRiskEvaluationInput | interface | interface ExecutionRiskEvaluationInput | Execution Risk Evaluation Input interface with 6 public fields or methods. |
ExecutionRiskEvaluator | interface | interface ExecutionRiskEvaluator | Execution Risk Evaluator interface with 1 public fields or methods. |
ExecutionToolBinding | interface | interface ExecutionToolBinding | Execution Tool Binding interface with 6 public fields or methods. |
ExecutionSandboxLevel | type | type ExecutionSandboxLevel = (typeof EXECUTION_SANDBOX_LEVELS)[number] | Public type alias for Execution Sandbox Level; the declaration contains its complete type expression. |
ExecutionToolOperation | type | type ExecutionToolOperation = (typeof EXECUTION_TOOL_OPERATIONS)[number] | Public type alias for Execution Tool Operation; the declaration contains its complete type expression. |
ExecutionToolSideEffectLevel | type | type ExecutionToolSideEffectLevel = Exclude<SideEffectLevel, 'none'> | Public type alias for Execution Tool Side Effect Level; the declaration contains its complete type expression. |
EXECUTION_SANDBOX_LEVELS
EXECUTION SANDBOX LEVELS constant exported by the contracts/execution-governance module.
- Kind: constant
- Import:
import { EXECUTION_SANDBOX_LEVELS } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export declare const EXECUTION_SANDBOX_LEVELS: readonly ["local", "container", "remote_isolated"];EXECUTION_TOOL_OPERATIONS
EXECUTION TOOL OPERATIONS constant exported by the contracts/execution-governance module.
- Kind: constant
- Import:
import { EXECUTION_TOOL_OPERATIONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export declare const EXECUTION_TOOL_OPERATIONS: readonly ["file_read", "file_write", "command", "sandbox", "artifact"];ExecutionRiskAssessment
Execution Risk Assessment interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionRiskAssessment } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export interface ExecutionRiskAssessment {
id: string;
level: RiskLevel;
reasons: string[];
matchedRules?: string[];
requiresApproval: boolean;
recommendedSandboxLevel?: ExecutionSandboxLevel;
evaluatedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
evaluatedAt | property | evaluatedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
level | property | level: RiskLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
matchedRules | property | matchedRules?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
reasons | property | reasons: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
recommendedSandboxLevel | property | recommendedSandboxLevel?: "local" | "container" | "remote_isolated" | Public property; its type, readonly modifier and optionality are shown in the signature. |
requiresApproval | property | requiresApproval: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
ExecutionRiskEvaluationInput
Execution Risk Evaluation Input interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionRiskEvaluationInput } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export interface ExecutionRiskEvaluationInput {
assessmentId: string;
binding: ExecutionToolBinding;
request: CommandExecutionRequest | WorkspaceOperationRequest;
environment: ExecutionEnvironmentSpec;
workspace: WorkspaceSpec;
evaluatedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
assessmentId | property | assessmentId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
binding | property | binding: ExecutionToolBinding | Public property; its type, readonly modifier and optionality are shown in the signature. |
environment | property | environment: ExecutionEnvironmentSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
evaluatedAt | property | evaluatedAt: 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. |
workspace | property | workspace: WorkspaceSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
ExecutionRiskEvaluator
Execution Risk Evaluator interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionRiskEvaluator } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export interface ExecutionRiskEvaluator {
evaluate(input: ExecutionRiskEvaluationInput): ExecutionRiskAssessment;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
evaluate | method | evaluate(input: ExecutionRiskEvaluationInput): ExecutionRiskAssessment | Public method; parameters and return type are shown in the signature. |
ExecutionToolBinding
Execution Tool Binding interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionToolBinding } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export interface ExecutionToolBinding {
toolId: string;
operation: ExecutionToolOperation;
executionProfileRef: string;
requiredScopes: string[];
sideEffectLevel: ExecutionToolSideEffectLevel;
humanReviewPolicyRef?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
executionProfileRef | property | executionProfileRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
humanReviewPolicyRef | property | humanReviewPolicyRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
operation | property | operation: "artifact" | "command" | "file_read" | "file_write" | "sandbox" | Public property; its type, readonly modifier and optionality are shown in the signature. |
requiredScopes | property | requiredScopes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectLevel | property | sideEffectLevel: ExecutionToolSideEffectLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolId | property | toolId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ExecutionSandboxLevel
Public type alias for Execution Sandbox Level; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionSandboxLevel } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export type ExecutionSandboxLevel = (typeof EXECUTION_SANDBOX_LEVELS)[number];ExecutionToolOperation
Public type alias for Execution Tool Operation; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionToolOperation } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export type ExecutionToolOperation = (typeof EXECUTION_TOOL_OPERATIONS)[number];ExecutionToolSideEffectLevel
Public type alias for Execution Tool Side Effect Level; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionToolSideEffectLevel } from '@codesoul-co/hypha-core'; - Source module:
contracts/execution-governance
Declaration
export type ExecutionToolSideEffectLevel = Exclude<SideEffectLevel, 'none'>;