@codesoul-co/hypha-core / modules/execution-governance/contracts
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/modules/execution-governance/contracts.ts - Exports: 12
Using this module
Use the Contracts module for declaring and runtime-validating contracts. It exports 10 constants, 2 functions.
Import from the package entrypoint
import {
executionGovernanceJsonSchemas,
executionRiskAssessmentExample,
executionRiskAssessmentJsonSchema,
executionRiskAssessmentSchema,
executionSandboxLevelSchema,
executionToolBindingExample,
executionToolBindingJsonSchema,
executionToolBindingSchema,
} from '@codesoul-co/hypha-core';
// The complete export list is documented below.Usage patterns
- The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
- The 10 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.
Runtime validation example
import { executionRiskAssessmentSchema } from '@codesoul-co/hypha-core';
declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = executionRiskAssessmentSchema.parse(input);Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
executionGovernanceJsonSchemas | constant | const executionGovernanceJsonSchemas: Record<string, JsonSchema> | Execution Governance JSON Schemas constant exported by the modules/execution-governance/contracts module. |
executionRiskAssessmentExample | constant | const executionRiskAssessmentExample: ExecutionRiskAssessment | Valid example value for Execution Risk Assessment. |
executionRiskAssessmentJsonSchema | constant | const executionRiskAssessmentJsonSchema: JsonSchema | JSON Schema for Execution Risk Assessment. |
executionRiskAssessmentSchema | constant | const executionRiskAssessmentSchema: z.ZodEffects<z.ZodObject<{ id: z.ZodString; level: z.ZodEnum<["low", "medium", "high", "critical"]>; reasons: z.ZodArray<z.ZodString, "many">; matchedRules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; requiresApproval: z.ZodBoolean; recommendedSandboxLevel: z.ZodOptional<z.ZodEnum<["local", "container", "remote_isolated"]>>; evaluatedAt: z.ZodString; }, "strict", z.ZodTypeA... | Runtime schema for Execution Risk Assessment. |
executionSandboxLevelSchema | constant | const executionSandboxLevelSchema: z.ZodEnum<["local", "container", "remote_isolated"]> | Runtime schema for Execution Sandbox Level. |
executionToolBindingExample | constant | const executionToolBindingExample: ExecutionToolBinding | Valid example value for Execution Tool Binding. |
executionToolBindingJsonSchema | constant | const executionToolBindingJsonSchema: JsonSchema | JSON Schema for Execution Tool Binding. |
executionToolBindingSchema | constant | const executionToolBindingSchema: z.ZodEffects<z.ZodObject<{ toolId: z.ZodString; operation: z.ZodEnum<["file_read", "file_write", "command", "sandbox", "artifact"]>; executionProfileRef: z.ZodString; requiredScopes: z.ZodArray<z.ZodString, "many">; sideEffectLevel: z.ZodEnum<["read", "write", "external_effect", "irreversible"]>; humanReviewPolicyRef: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { operat... | Runtime schema for Execution Tool Binding. |
executionToolOperationSchema | constant | const executionToolOperationSchema: z.ZodEnum<["file_read", "file_write", "command", "sandbox", "artifact"]> | Runtime schema for Execution Tool Operation. |
executionToolSideEffectLevelSchema | constant | const executionToolSideEffectLevelSchema: z.ZodEnum<["read", "write", "external_effect", "irreversible"]> | Runtime schema for Execution Tool Side Effect Level. |
validateExecutionRiskAssessment | function | validateExecutionRiskAssessment(input: unknown): ExecutionRiskAssessment | Validate Execution Risk Assessment function with 1 public call signature; parameters and return types are listed below. |
validateExecutionToolBinding | function | validateExecutionToolBinding(input: unknown): ExecutionToolBinding | Validate Execution Tool Binding function with 1 public call signature; parameters and return types are listed below. |
executionGovernanceJsonSchemas
Execution Governance JSON Schemas constant exported by the modules/execution-governance/contracts module.
- Kind: constant
- Import:
import { executionGovernanceJsonSchemas } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionGovernanceJsonSchemas: Record<string, JsonSchema>;executionRiskAssessmentExample
Valid example value for Execution Risk Assessment.
- Kind: constant
- Import:
import { executionRiskAssessmentExample } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionRiskAssessmentExample: ExecutionRiskAssessment;executionRiskAssessmentJsonSchema
JSON Schema for Execution Risk Assessment.
- Kind: constant
- Import:
import { executionRiskAssessmentJsonSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionRiskAssessmentJsonSchema: JsonSchema;executionRiskAssessmentSchema
Runtime schema for Execution Risk Assessment.
- Kind: constant
- Import:
import { executionRiskAssessmentSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionRiskAssessmentSchema: z.ZodEffects<z.ZodObject<{ id: z.ZodString; level: z.ZodEnum<["low", "medium", "high", "critical"]>; reasons: z.ZodArray<z.ZodString, "many">; matchedRules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; requiresApproval: z.ZodBoolean; recommendedSandboxLevel: z.ZodOptional<z.ZodEnum<["local", "container", "remote_isolated"]>>; evaluatedAt: z.ZodString; }, "strict", z.ZodTypeAny, { id: string; evaluatedAt: string; level: "low" | "medium" | "high" | "critical"; reasons: string[]; requiresApproval: boolean; matchedRules?: string[] | undefined; recommendedSandboxLevel?: "local" | "container" | "remote_isolated" | undefined; }, { id: string; evaluatedAt: string; level: "low" | "medium" | "high" | "critical"; reasons: string[]; requiresApproval: boolean; matchedRules?: string[] | undefined; recommendedSandboxLevel?: "local" | "container" | "remote_isolated" | undefined; }>, { id: string; evaluatedAt: string; level: "low" | "medium" | "high" | "critical"; reasons: string[]; requiresApproval: boolean; matchedRules?: string[] | undefined; recommendedSandboxLevel?: "local" | "container" | "remote_isolated" | undefined; }, { id: string; evaluatedAt: string; level: "low" | "medium" | "high" | "critical"; reasons: string[]; requiresApproval: boolean; matchedRules?: string[] | undefined; recommendedSandboxLevel?: "local" | "container" | "remote_isolated" | undefined; }>;executionSandboxLevelSchema
Runtime schema for Execution Sandbox Level.
- Kind: constant
- Import:
import { executionSandboxLevelSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionSandboxLevelSchema: z.ZodEnum<["local", "container", "remote_isolated"]>;executionToolBindingExample
Valid example value for Execution Tool Binding.
- Kind: constant
- Import:
import { executionToolBindingExample } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionToolBindingExample: ExecutionToolBinding;executionToolBindingJsonSchema
JSON Schema for Execution Tool Binding.
- Kind: constant
- Import:
import { executionToolBindingJsonSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionToolBindingJsonSchema: JsonSchema;executionToolBindingSchema
Runtime schema for Execution Tool Binding.
- Kind: constant
- Import:
import { executionToolBindingSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionToolBindingSchema: z.ZodEffects<z.ZodObject<{ toolId: z.ZodString; operation: z.ZodEnum<["file_read", "file_write", "command", "sandbox", "artifact"]>; executionProfileRef: z.ZodString; requiredScopes: z.ZodArray<z.ZodString, "many">; sideEffectLevel: z.ZodEnum<["read", "write", "external_effect", "irreversible"]>; humanReviewPolicyRef: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { operation: "command" | "artifact" | "file_read" | "file_write" | "sandbox"; toolId: string; sideEffectLevel: "external_effect" | "irreversible" | "read" | "write"; executionProfileRef: string; requiredScopes: string[]; humanReviewPolicyRef?: string | undefined; }, { operation: "command" | "artifact" | "file_read" | "file_write" | "sandbox"; toolId: string; sideEffectLevel: "external_effect" | "irreversible" | "read" | "write"; executionProfileRef: string; requiredScopes: string[]; humanReviewPolicyRef?: string | undefined; }>, { operation: "command" | "artifact" | "file_read" | "file_write" | "sandbox"; toolId: string; sideEffectLevel: "external_effect" | "irreversible" | "read" | "write"; executionProfileRef: string; requiredScopes: string[]; humanReviewPolicyRef?: string | undefined; }, { operation: "command" | "artifact" | "file_read" | "file_write" | "sandbox"; toolId: string; sideEffectLevel: "external_effect" | "irreversible" | "read" | "write"; executionProfileRef: string; requiredScopes: string[]; humanReviewPolicyRef?: string | undefined; }>;executionToolOperationSchema
Runtime schema for Execution Tool Operation.
- Kind: constant
- Import:
import { executionToolOperationSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionToolOperationSchema: z.ZodEnum<["file_read", "file_write", "command", "sandbox", "artifact"]>;executionToolSideEffectLevelSchema
Runtime schema for Execution Tool Side Effect Level.
- Kind: constant
- Import:
import { executionToolSideEffectLevelSchema } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare const executionToolSideEffectLevelSchema: z.ZodEnum<["read", "write", "external_effect", "irreversible"]>;validateExecutionRiskAssessment
Validate Execution Risk Assessment function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { validateExecutionRiskAssessment } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare function validateExecutionRiskAssessment(input: unknown): ExecutionRiskAssessment;Call signature
validateExecutionRiskAssessment(input: unknown): ExecutionRiskAssessmentParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
ExecutionRiskAssessment - Description: The return contract is defined by the type shown above.
validateExecutionToolBinding
Validate Execution Tool Binding function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { validateExecutionToolBinding } from '@codesoul-co/hypha-core'; - Source module:
modules/execution-governance/contracts
Declaration
export declare function validateExecutionToolBinding(input: unknown): ExecutionToolBinding;Call signature
validateExecutionToolBinding(input: unknown): ExecutionToolBindingParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
ExecutionToolBinding - Description: The return contract is defined by the type shown above.
