Skip to content

@codesoul-co/hypha-mcp / governance

Using this module

Use the Governance module for applying policy and governance checks. It exports 1 class, 5 functions, 3 interfaces, 2 types.

Import from the package entrypoint

ts
import {
  InMemoryMCPCapabilityBaselineStore,
  attestCapability,
  capabilityHash,
  capabilityKey,
  evaluateCapabilityDrift,
  governedSideEffectLevel,
} from '@codesoul-co/hypha-mcp';

import type {
  MCPCapabilityBaselineStore,
  MCPDriftEvaluation,
  MCPDriftRecord,
  MCPDriftPolicy,
  MCPDriftStatus,
} from '@codesoul-co/hypha-mcp';

Usage patterns

  • Use the 5 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 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The module exposes 5 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
InMemoryMCPCapabilityBaselineStoreclassnew InMemoryMCPCapabilityBaselineStore(): InMemoryMCPCapabilityBaselineStoreIn Memory MCP Capability Baseline Store class with 3 public constructor or member entries; its exact declarations are listed below.
attestCapabilityfunctionattestCapability(capability: MCPCapabilityDescriptor): MCPCapabilityDescriptorAttest Capability function with 1 public call signature; parameters and return types are listed below.
capabilityHashfunctioncapabilityHash(capability: MCPCapabilityDescriptor): stringCapability Hash function with 1 public call signature; parameters and return types are listed below.
capabilityKeyfunctioncapabilityKey(capability: Pick<MCPCapabilityDescriptor, "serverId" | "capabilityId">): stringCapability Key function with 1 public call signature; parameters and return types are listed below.
evaluateCapabilityDriftfunctionevaluateCapabilityDrift(discovered: MCPCapabilityDescriptor[], baseline: MCPCapabilityDescriptor[], policy?: MCPDriftPolicy): MCPDriftEvaluationEvaluate Capability Drift function with 1 public call signature; parameters and return types are listed below.
governedSideEffectLevelfunctiongovernedSideEffectLevel(capability: MCPCapabilityDescriptor): SideEffectLevelGoverned Side Effect Level function with 1 public call signature; parameters and return types are listed below.
MCPCapabilityBaselineStoreinterfaceinterface MCPCapabilityBaselineStoreMCP Capability Baseline Store interface with 2 public fields or methods.
MCPDriftEvaluationinterfaceinterface MCPDriftEvaluationMCP Drift Evaluation interface with 4 public fields or methods.
MCPDriftRecordinterfaceinterface MCPDriftRecordMCP Drift Record interface with 6 public fields or methods.
MCPDriftPolicytypetype MCPDriftPolicy = 'quarantine' | 'accept'Public type alias for MCP Drift Policy; the declaration contains its complete type expression.
MCPDriftStatustypetype MCPDriftStatus = 'added' | 'unchanged' | 'changed' | 'removed'Public type alias for MCP Drift Status; the declaration contains its complete type expression.

InMemoryMCPCapabilityBaselineStore

In Memory MCP Capability Baseline Store class with 3 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { InMemoryMCPCapabilityBaselineStore } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export declare class InMemoryMCPCapabilityBaselineStore implements MCPCapabilityBaselineStore {
    load(integrationId: string): Promise<MCPCapabilityDescriptor[]>;
    save(integrationId: string, capabilities: MCPCapabilityDescriptor[]): Promise<void>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(): InMemoryMCPCapabilityBaselineStoreCreates an instance of this class.
loadmethodload(integrationId: string): Promise<MCPCapabilityDescriptor[]>Public method; parameters and return type are shown in the signature.
savemethodsave(integrationId: string, capabilities: MCPCapabilityDescriptor[]): Promise<void>Public method; parameters and return type are shown in the signature.

attestCapability

Attest Capability function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { attestCapability } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export declare function attestCapability(capability: MCPCapabilityDescriptor): MCPCapabilityDescriptor;

Call signature

text
attestCapability(capability: MCPCapabilityDescriptor): MCPCapabilityDescriptor

Parameters

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

Returns

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

capabilityHash

Capability Hash function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { capabilityHash } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export declare function capabilityHash(capability: MCPCapabilityDescriptor): string;

Call signature

text
capabilityHash(capability: MCPCapabilityDescriptor): string

Parameters

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

Returns

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

capabilityKey

Capability Key function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { capabilityKey } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export declare function capabilityKey(capability: Pick<MCPCapabilityDescriptor, 'serverId' | 'capabilityId'>): string;

Call signature

text
capabilityKey(capability: Pick<MCPCapabilityDescriptor, "serverId" | "capabilityId">): string

Parameters

ParameterTypeRequiredDescription
capabilityPick<MCPCapabilityDescriptor, "serverId" | "capabilityId">YesRequired parameter; accepted values are defined by the type column.

Returns

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

evaluateCapabilityDrift

Evaluate Capability Drift function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { evaluateCapabilityDrift } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export declare function evaluateCapabilityDrift(discovered: MCPCapabilityDescriptor[], baseline: MCPCapabilityDescriptor[], policy?: MCPDriftPolicy): MCPDriftEvaluation;

Call signature

text
evaluateCapabilityDrift(discovered: MCPCapabilityDescriptor[], baseline: MCPCapabilityDescriptor[], policy?: MCPDriftPolicy): MCPDriftEvaluation

Parameters

ParameterTypeRequiredDescription
discoveredMCPCapabilityDescriptor[]YesRequired parameter; accepted values are defined by the type column.
baselineMCPCapabilityDescriptor[]YesRequired parameter; accepted values are defined by the type column.
policyMCPDriftPolicyNoOptional parameter; accepted values are defined by the type column.

Returns

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

governedSideEffectLevel

Governed Side Effect Level function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { governedSideEffectLevel } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export declare function governedSideEffectLevel(capability: MCPCapabilityDescriptor): SideEffectLevel;

Call signature

text
governedSideEffectLevel(capability: MCPCapabilityDescriptor): SideEffectLevel

Parameters

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

Returns

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

MCPCapabilityBaselineStore

MCP Capability Baseline Store interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { MCPCapabilityBaselineStore } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export interface MCPCapabilityBaselineStore {
    load(integrationId: string): Promise<MCPCapabilityDescriptor[]>;
    save(integrationId: string, capabilities: MCPCapabilityDescriptor[]): Promise<void>;
}

Contract members

MemberKindSignatureDescription
loadmethodload(integrationId: string): Promise<MCPCapabilityDescriptor[]>Public method; parameters and return type are shown in the signature.
savemethodsave(integrationId: string, capabilities: MCPCapabilityDescriptor[]): Promise<void>Public method; parameters and return type are shown in the signature.

MCPDriftEvaluation

MCP Drift Evaluation interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { MCPDriftEvaluation } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export interface MCPDriftEvaluation {
    current: MCPCapabilityDescriptor[];
    acceptedBaseline: MCPCapabilityDescriptor[];
    records: MCPDriftRecord[];
    quarantinedKeys: Set<string>;
}

Contract members

MemberKindSignatureDescription
acceptedBaselinepropertyacceptedBaseline: MCPCapabilityDescriptor[]Public property; its type, readonly modifier and optionality are shown in the signature.
currentpropertycurrent: MCPCapabilityDescriptor[]Public property; its type, readonly modifier and optionality are shown in the signature.
quarantinedKeyspropertyquarantinedKeys: Set<string>Public property; its type, readonly modifier and optionality are shown in the signature.
recordspropertyrecords: MCPDriftRecord[]Public property; its type, readonly modifier and optionality are shown in the signature.

MCPDriftRecord

MCP Drift Record interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { MCPDriftRecord } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export interface MCPDriftRecord {
    capabilityKey: string;
    serverId: string;
    capabilityId: string;
    status: MCPDriftStatus;
    previousHash?: string;
    currentHash?: string;
}

Contract members

MemberKindSignatureDescription
capabilityIdpropertycapabilityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
capabilityKeypropertycapabilityKey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
currentHashpropertycurrentHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
previousHashpropertypreviousHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
serverIdpropertyserverId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: MCPDriftStatusPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPDriftPolicy

Public type alias for MCP Drift Policy; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MCPDriftPolicy } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export type MCPDriftPolicy = 'quarantine' | 'accept';

MCPDriftStatus

Public type alias for MCP Drift Status; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MCPDriftStatus } from '@codesoul-co/hypha-mcp';
  • Source module: governance

Declaration

text
export type MCPDriftStatus = 'added' | 'unchanged' | 'changed' | 'removed';