Skip to content

@codesoul-co/hypha-core / specs

Using this module

Use the Specs module for declaring and runtime-validating contracts. It exports 2 constants, 2 functions, 22 interfaces, 2 types.

Import from the package entrypoint

ts
import {
  allowAllPolicyEngine,
  denyExternalEffectsPolicyEngine,
  assertVersionedSpec,
  createPolicySpecEngine,
} from '@codesoul-co/hypha-core';

import type {
  AuditPolicySpec,
  ContextSourceSpec,
  ContextSpec,
  DeploymentSpec,
  EvaluationSpec,
  HarnessedAgentSystemSpec,
  HumanReviewPolicySpec,
  JsonSchema,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 24 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • 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

SymbolKindSignatureDescription
allowAllPolicyEngineconstantconst allowAllPolicyEngine: PolicyEngineAllow All Policy Engine constant exported by the specs module.
denyExternalEffectsPolicyEngineconstantconst denyExternalEffectsPolicyEngine: PolicyEngineDeny External Effects Policy Engine constant exported by the specs module.
assertVersionedSpecfunctionassertVersionedSpec(spec: VersionedSpec, label?: string): voidAssert Versioned Spec function with 1 public call signature; parameters and return types are listed below.
createPolicySpecEnginefunctioncreatePolicySpecEngine(policy: PolicySpec): PolicyEngineCreate Policy Spec Engine function with 1 public call signature; parameters and return types are listed below.
AuditPolicySpecinterfaceinterface AuditPolicySpecAudit Policy Spec interface with 4 public fields or methods.
ContextSourceSpecinterfaceinterface ContextSourceSpec extends VersionedSpec, SpecMetadataContext Source Spec interface with 11 public fields or methods.
ContextSpecinterfaceinterface ContextSpec extends VersionedSpec, SpecMetadataContext Spec interface with 12 public fields or methods.
DeploymentSpecinterfaceinterface DeploymentSpec extends VersionedSpec, SpecMetadataDeployment Spec interface with 11 public fields or methods.
EvaluationSpecinterfaceinterface EvaluationSpec extends VersionedSpec, SpecMetadataEvaluation Spec interface with 11 public fields or methods.
HarnessedAgentSystemSpecinterfaceinterface HarnessedAgentSystemSpec extends VersionedSpec, SpecMetadataHarnessed Agent System Spec interface with 25 public fields or methods.
HumanReviewPolicySpecinterfaceinterface HumanReviewPolicySpecHuman Review Policy Spec interface with 4 public fields or methods.
JsonSchemainterfaceinterface JsonSchemaJSON Schema for .
OutputContractSpecinterfaceinterface OutputContractSpec extends VersionedSpec, SpecMetadataOutput Contract Spec interface with 9 public fields or methods.
PolicyDecisioninterfaceinterface PolicyDecisionPolicy Decision interface with 6 public fields or methods.
PolicyEngineinterfaceinterface PolicyEnginePolicy Engine interface with 1 public fields or methods.
PolicyEvaluationContextinterfaceinterface PolicyEvaluationContextPolicy Evaluation Context interface with 7 public fields or methods.
PolicyRuleSpecinterfaceinterface PolicyRuleSpec extends VersionedSpec, SpecMetadataPolicy Rule Spec interface with 12 public fields or methods.
PolicySpecinterfaceinterface PolicySpec extends VersionedSpec, SpecMetadataPolicy Spec interface with 10 public fields or methods.
RegressionSpecinterfaceinterface RegressionSpec extends VersionedSpec, SpecMetadataRegression Spec interface with 10 public fields or methods.
ReplaySpecinterfaceinterface ReplaySpec extends VersionedSpec, SpecMetadataReplay Spec interface with 13 public fields or methods.
RetryPolicySpecinterfaceinterface RetryPolicySpecRetry Policy Spec interface with 6 public fields or methods.
SpecMetadatainterfaceinterface SpecMetadataSpec Metadata interface with 6 public fields or methods.
SpecRefinterfaceinterface SpecRefSpec Ref interface with 3 public fields or methods.
TimeoutPolicySpecinterfaceinterface TimeoutPolicySpecTimeout Policy Spec interface with 2 public fields or methods.
TraceSpecinterfaceinterface TraceSpec extends VersionedSpec, SpecMetadataTrace Spec interface with 11 public fields or methods.
VersionedSpecinterfaceinterface VersionedSpecVersioned Spec interface with 2 public fields or methods.
RiskLeveltypetype RiskLevel = 'low' | 'medium' | 'high' | 'critical'Public type alias for Risk Level; the declaration contains its complete type expression.
SideEffectLeveltypetype SideEffectLevel = 'none' | 'read' | 'write' | 'external_effect' | 'irreversible'Public type alias for Side Effect Level; the declaration contains its complete type expression.

allowAllPolicyEngine

Allow All Policy Engine constant exported by the specs module.

  • Kind: constant
  • Import: import { allowAllPolicyEngine } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export declare const allowAllPolicyEngine: PolicyEngine;

denyExternalEffectsPolicyEngine

Deny External Effects Policy Engine constant exported by the specs module.

  • Kind: constant
  • Import: import { denyExternalEffectsPolicyEngine } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export declare const denyExternalEffectsPolicyEngine: PolicyEngine;

assertVersionedSpec

Assert Versioned Spec function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { assertVersionedSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export declare function assertVersionedSpec(spec: VersionedSpec, label?: string): void;

Call signature

text
assertVersionedSpec(spec: VersionedSpec, label?: string): void

Parameters

ParameterTypeRequiredDescription
specVersionedSpecYesRequired parameter; accepted values are defined by the type column.
labelstringNoOptional parameter; accepted values are defined by the type column.

Returns

  • Type: void
  • Description: Returns no value.

createPolicySpecEngine

Create Policy Spec Engine function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createPolicySpecEngine } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export declare function createPolicySpecEngine(policy: PolicySpec): PolicyEngine;

Call signature

text
createPolicySpecEngine(policy: PolicySpec): PolicyEngine

Parameters

ParameterTypeRequiredDescription
policyPolicySpecYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: PolicyEngine
  • Description: The return contract is defined by the type shown above.

AuditPolicySpec

Audit Policy Spec interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { AuditPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface AuditPolicySpec {
    enabled: boolean;
    includeInput?: boolean;
    includeOutput?: boolean;
    redactPaths?: string[];
}

Contract members

MemberKindSignatureDescription
enabledpropertyenabled: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
includeInputpropertyincludeInput?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
includeOutputpropertyincludeOutput?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
redactPathspropertyredactPaths?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

ContextSourceSpec

Context Source Spec interface with 11 public fields or methods.

  • Kind: interface
  • Import: import type { ContextSourceSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface ContextSourceSpec extends VersionedSpec, SpecMetadata {
    type: 'memory' | 'artifact' | 'skill' | 'domain' | 'mcp' | 'user_input' | 'system';
    provenanceRequired?: boolean;
    trustLevel?: 'trusted' | 'reviewed' | 'untrusted';
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
provenanceRequiredpropertyprovenanceRequired?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
trustLevelpropertytrustLevel?: "trusted" | "reviewed" | "untrusted"Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "memory" | "artifact" | "skill" | "domain" | "mcp" | "user_input" | "system"Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ContextSpec

Context Spec interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { ContextSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface ContextSpec extends VersionedSpec, SpecMetadata {
    sources: ContextSourceSpec[];
    tokenBudget?: number;
    provenancePolicy?: 'required' | 'best_effort' | 'none';
    instructionBoundaryPolicy?: 'strict' | 'tagged' | 'none';
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
instructionBoundaryPolicypropertyinstructionBoundaryPolicy?: "none" | "strict" | "tagged"Public property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
provenancePolicypropertyprovenancePolicy?: "none" | "required" | "best_effort"Public property; its type, readonly modifier and optionality are shown in the signature.
sourcespropertysources: ContextSourceSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
tokenBudgetpropertytokenBudget?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

DeploymentSpec

Deployment Spec interface with 11 public fields or methods.

  • Kind: interface
  • Import: import type { DeploymentSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface DeploymentSpec extends VersionedSpec, SpecMetadata {
    mode: 'local' | 'self_hosted' | 'managed';
    runtimeMode?: 'single-user' | 'multi-user';
    configRefs?: SpecRef[];
}

Contract members

MemberKindSignatureDescription
configRefspropertyconfigRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "local" | "self_hosted" | "managed"Public property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runtimeModepropertyruntimeMode?: "single-user" | "multi-user"Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

EvaluationSpec

Evaluation Spec interface with 11 public fields or methods.

  • Kind: interface
  • Import: import type { EvaluationSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface EvaluationSpec extends VersionedSpec, SpecMetadata {
    type: 'schema' | 'output_contract' | 'tool_trace' | 'policy' | 'process' | 'cost' | 'latency' | 'regression' | 'human';
    rubric?: JsonSchema;
    deterministic?: boolean;
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deterministicpropertydeterministic?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rubricpropertyrubric?: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "schema" | "output_contract" | "tool_trace" | "policy" | "process" | "cost" | "latency" | "regression" | "human"Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

HarnessedAgentSystemSpec

Harnessed Agent System Spec interface with 25 public fields or methods.

  • Kind: interface
  • Import: import type { HarnessedAgentSystemSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface HarnessedAgentSystemSpec extends VersionedSpec, SpecMetadata {
    agentRef: SpecRef;
    fsmProcessRef: SpecRef;
    traceRef: SpecRef;
    policyRefs?: SpecRef[];
    memoryRefs?: SpecRef[];
    toolRefs?: SpecRef[];
    skillRefs?: SpecRef[];
    mcpRefs?: SpecRef[];
    contextRefs?: SpecRef[];
    reasoningRefs?: SpecRef[];
    outputContractRefs?: SpecRef[];
    businessRuleRefs?: SpecRef[];
    modelProfileRef?: SpecRef;
    evaluationRefs?: SpecRef[];
    replayRef?: SpecRef;
    regressionRef?: SpecRef;
    deploymentRef?: SpecRef;
}

Contract members

MemberKindSignatureDescription
agentRefpropertyagentRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
businessRuleRefspropertybusinessRuleRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
contextRefspropertycontextRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deploymentRefpropertydeploymentRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
evaluationRefspropertyevaluationRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
fsmProcessRefpropertyfsmProcessRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mcpRefspropertymcpRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
memoryRefspropertymemoryRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
modelProfileRefpropertymodelProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputContractRefspropertyoutputContractRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRefspropertypolicyRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
reasoningRefspropertyreasoningRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
regressionRefpropertyregressionRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
replayRefpropertyreplayRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
skillRefspropertyskillRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
toolRefspropertytoolRefs?: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
traceRefpropertytraceRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

HumanReviewPolicySpec

Human Review Policy Spec interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { HumanReviewPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface HumanReviewPolicySpec {
    required: boolean;
    reason?: string;
    approverRole?: string;
    timeoutPolicy?: TimeoutPolicySpec;
}

Contract members

MemberKindSignatureDescription
approverRolepropertyapproverRole?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requiredpropertyrequired: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutPolicypropertytimeoutPolicy?: TimeoutPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.

JsonSchema

JSON Schema for .

  • Kind: interface
  • Import: import type { JsonSchema } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface JsonSchema {
    type?: string;
    properties?: Record<string, JsonSchema>;
    required?: string[];
    items?: JsonSchema;
    enum?: unknown[];
    additionalProperties?: boolean | JsonSchema;
    [key: string]: unknown;
}

Contract members

MemberKindSignatureDescription
additionalPropertiespropertyadditionalProperties?: boolean | JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
enumpropertyenum?: unknown[]Public property; its type, readonly modifier and optionality are shown in the signature.
itemspropertyitems?: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
propertiespropertyproperties?: Record<string, JsonSchema>Public property; its type, readonly modifier and optionality are shown in the signature.
requiredpropertyrequired?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

OutputContractSpec

Output Contract Spec interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { OutputContractSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface OutputContractSpec extends VersionedSpec, SpecMetadata {
    schema: JsonSchema;
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
schemapropertyschema: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

PolicyDecision

Policy Decision interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { PolicyDecision } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface PolicyDecision {
    allowed: boolean;
    requiresHumanReview?: boolean;
    policyId?: string;
    ruleId?: string;
    reason?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
allowedpropertyallowed: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
policyIdpropertypolicyId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requiresHumanReviewpropertyrequiresHumanReview?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
ruleIdpropertyruleId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

PolicyEngine

Policy Engine interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { PolicyEngine } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface PolicyEngine {
    evaluate(context: PolicyEvaluationContext): Promise<PolicyDecision>;
}

Contract members

MemberKindSignatureDescription
evaluatemethodevaluate(context: PolicyEvaluationContext): Promise<PolicyDecision>Public method; parameters and return type are shown in the signature.

PolicyEvaluationContext

Policy Evaluation Context interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { PolicyEvaluationContext } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface PolicyEvaluationContext<TInput = unknown> {
    runId: string;
    stepId?: string;
    userId?: string;
    capabilityId?: string;
    sideEffectLevel?: SideEffectLevel;
    input?: TInput;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
capabilityIdpropertycapabilityId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputpropertyinput?: TInputPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel?: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
stepIdpropertystepId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

PolicyRuleSpec

Policy Rule Spec interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { PolicyRuleSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface PolicyRuleSpec extends VersionedSpec, SpecMetadata {
    effect: 'allow' | 'deny' | 'require_human_review';
    expression?: string;
    sideEffectLevels?: SideEffectLevel[];
    scopes?: string[];
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
effectpropertyeffect: "allow" | "deny" | "require_human_review"Public property; its type, readonly modifier and optionality are shown in the signature.
expressionpropertyexpression?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopespropertyscopes?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelspropertysideEffectLevels?: SideEffectLevel[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

PolicySpec

Policy Spec interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { PolicySpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface PolicySpec extends VersionedSpec, SpecMetadata {
    rules: PolicyRuleSpec[];
    defaultEffect?: 'allow' | 'deny';
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
defaultEffectpropertydefaultEffect?: "allow" | "deny"Public property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rulespropertyrules: PolicyRuleSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RegressionSpec

Regression Spec interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { RegressionSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface RegressionSpec extends VersionedSpec, SpecMetadata {
    fixtureRefs: SpecRef[];
    requiredChecks: Array<'event_types' | 'state_path' | 'tool_calls' | 'policy_decisions' | 'output_contract'>;
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fixtureRefspropertyfixtureRefs: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requiredCheckspropertyrequiredChecks: ("output_contract" | "state_path" | "event_types" | "tool_calls" | "policy_decisions")[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ReplaySpec

Replay Spec interface with 13 public fields or methods.

  • Kind: interface
  • Import: import type { ReplaySpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface ReplaySpec extends VersionedSpec, SpecMetadata {
    captureModelIO?: boolean;
    captureToolIO?: boolean;
    captureMemoryReadSet?: boolean;
    capturePolicyDecisions?: boolean;
    snapshotPolicy?: 'none' | 'state_path' | 'full';
}

Contract members

MemberKindSignatureDescription
captureMemoryReadSetpropertycaptureMemoryReadSet?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
captureModelIOpropertycaptureModelIO?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
capturePolicyDecisionspropertycapturePolicyDecisions?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
captureToolIOpropertycaptureToolIO?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
snapshotPolicypropertysnapshotPolicy?: "none" | "state_path" | "full"Public property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RetryPolicySpec

Retry Policy Spec interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { RetryPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface RetryPolicySpec {
    maxAttempts: number;
    backoffMs?: number;
    maxBackoffMs?: number;
    jitterRatio?: number;
    maxElapsedMs?: number;
    retryableCodes?: string[];
}

Contract members

MemberKindSignatureDescription
backoffMspropertybackoffMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
jitterRatiopropertyjitterRatio?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxAttemptspropertymaxAttempts: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxBackoffMspropertymaxBackoffMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxElapsedMspropertymaxElapsedMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
retryableCodespropertyretryableCodes?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

SpecMetadata

Spec Metadata interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { SpecMetadata } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface SpecMetadata {
    name?: string;
    description?: string;
    owner?: string;
    tags?: string[];
    createdAt?: string;
    updatedAt?: string;
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

SpecRef

Spec Ref interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { SpecRef } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface SpecRef {
    id: string;
    version?: string;
    revision?: string;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

TimeoutPolicySpec

Timeout Policy Spec interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { TimeoutPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface TimeoutPolicySpec {
    timeoutMs: number;
    onTimeout?: 'fail' | 'retry' | 'human_review';
}

Contract members

MemberKindSignatureDescription
onTimeoutpropertyonTimeout?: "fail" | "retry" | "human_review"Public property; its type, readonly modifier and optionality are shown in the signature.
timeoutMspropertytimeoutMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

TraceSpec

Trace Spec interface with 11 public fields or methods.

  • Kind: interface
  • Import: import type { TraceSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface TraceSpec extends VersionedSpec, SpecMetadata {
    eventTypes: string[];
    retentionPolicy?: string;
    redactionPolicy?: string;
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
eventTypespropertyeventTypes: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
redactionPolicypropertyredactionPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retentionPolicypropertyretentionPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

VersionedSpec

Versioned Spec interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { VersionedSpec } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export interface VersionedSpec {
    id: string;
    version: string;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RiskLevel

Public type alias for Risk Level; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RiskLevel } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';

SideEffectLevel

Public type alias for Side Effect Level; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { SideEffectLevel } from '@codesoul-co/hypha-core';
  • Source module: specs

Declaration

text
export type SideEffectLevel = 'none' | 'read' | 'write' | 'external_effect' | 'irreversible';