@codesoul-co/hypha-mcp / governance
- Package index:
@codesoul-co/hypha-mcp - Source:
packages/mcp/src/governance.ts - Exports: 11
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
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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
InMemoryMCPCapabilityBaselineStore | class | new InMemoryMCPCapabilityBaselineStore(): InMemoryMCPCapabilityBaselineStore | In Memory MCP Capability Baseline Store class with 3 public constructor or member entries; its exact declarations are listed below. |
attestCapability | function | attestCapability(capability: MCPCapabilityDescriptor): MCPCapabilityDescriptor | Attest Capability function with 1 public call signature; parameters and return types are listed below. |
capabilityHash | function | capabilityHash(capability: MCPCapabilityDescriptor): string | Capability Hash function with 1 public call signature; parameters and return types are listed below. |
capabilityKey | function | capabilityKey(capability: Pick<MCPCapabilityDescriptor, "serverId" | "capabilityId">): string | Capability Key function with 1 public call signature; parameters and return types are listed below. |
evaluateCapabilityDrift | function | evaluateCapabilityDrift(discovered: MCPCapabilityDescriptor[], baseline: MCPCapabilityDescriptor[], policy?: MCPDriftPolicy): MCPDriftEvaluation | Evaluate Capability Drift function with 1 public call signature; parameters and return types are listed below. |
governedSideEffectLevel | function | governedSideEffectLevel(capability: MCPCapabilityDescriptor): SideEffectLevel | Governed Side Effect Level function with 1 public call signature; parameters and return types are listed below. |
MCPCapabilityBaselineStore | interface | interface MCPCapabilityBaselineStore | MCP Capability Baseline Store interface with 2 public fields or methods. |
MCPDriftEvaluation | interface | interface MCPDriftEvaluation | MCP Drift Evaluation interface with 4 public fields or methods. |
MCPDriftRecord | interface | interface MCPDriftRecord | MCP Drift Record interface with 6 public fields or methods. |
MCPDriftPolicy | type | type MCPDriftPolicy = 'quarantine' | 'accept' | Public type alias for MCP Drift Policy; the declaration contains its complete type expression. |
MCPDriftStatus | type | type 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
export declare class InMemoryMCPCapabilityBaselineStore implements MCPCapabilityBaselineStore {
load(integrationId: string): Promise<MCPCapabilityDescriptor[]>;
save(integrationId: string, capabilities: MCPCapabilityDescriptor[]): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): InMemoryMCPCapabilityBaselineStore | Creates an instance of this class. |
load | method | load(integrationId: string): Promise<MCPCapabilityDescriptor[]> | Public method; parameters and return type are shown in the signature. |
save | method | save(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
export declare function attestCapability(capability: MCPCapabilityDescriptor): MCPCapabilityDescriptor;Call signature
attestCapability(capability: MCPCapabilityDescriptor): MCPCapabilityDescriptorParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
capability | MCPCapabilityDescriptor | Yes | Required 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
export declare function capabilityHash(capability: MCPCapabilityDescriptor): string;Call signature
capabilityHash(capability: MCPCapabilityDescriptor): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
capability | MCPCapabilityDescriptor | Yes | Required 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
export declare function capabilityKey(capability: Pick<MCPCapabilityDescriptor, 'serverId' | 'capabilityId'>): string;Call signature
capabilityKey(capability: Pick<MCPCapabilityDescriptor, "serverId" | "capabilityId">): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
capability | Pick<MCPCapabilityDescriptor, "serverId" | "capabilityId"> | Yes | Required 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
export declare function evaluateCapabilityDrift(discovered: MCPCapabilityDescriptor[], baseline: MCPCapabilityDescriptor[], policy?: MCPDriftPolicy): MCPDriftEvaluation;Call signature
evaluateCapabilityDrift(discovered: MCPCapabilityDescriptor[], baseline: MCPCapabilityDescriptor[], policy?: MCPDriftPolicy): MCPDriftEvaluationParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
discovered | MCPCapabilityDescriptor[] | Yes | Required parameter; accepted values are defined by the type column. |
baseline | MCPCapabilityDescriptor[] | Yes | Required parameter; accepted values are defined by the type column. |
policy | MCPDriftPolicy | No | Optional 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
export declare function governedSideEffectLevel(capability: MCPCapabilityDescriptor): SideEffectLevel;Call signature
governedSideEffectLevel(capability: MCPCapabilityDescriptor): SideEffectLevelParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
capability | MCPCapabilityDescriptor | Yes | Required 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
export interface MCPCapabilityBaselineStore {
load(integrationId: string): Promise<MCPCapabilityDescriptor[]>;
save(integrationId: string, capabilities: MCPCapabilityDescriptor[]): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
load | method | load(integrationId: string): Promise<MCPCapabilityDescriptor[]> | Public method; parameters and return type are shown in the signature. |
save | method | save(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
export interface MCPDriftEvaluation {
current: MCPCapabilityDescriptor[];
acceptedBaseline: MCPCapabilityDescriptor[];
records: MCPDriftRecord[];
quarantinedKeys: Set<string>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
acceptedBaseline | property | acceptedBaseline: MCPCapabilityDescriptor[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
current | property | current: MCPCapabilityDescriptor[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
quarantinedKeys | property | quarantinedKeys: Set<string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
records | property | records: 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
export interface MCPDriftRecord {
capabilityKey: string;
serverId: string;
capabilityId: string;
status: MCPDriftStatus;
previousHash?: string;
currentHash?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilityId | property | capabilityId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
capabilityKey | property | capabilityKey: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
currentHash | property | currentHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
previousHash | property | previousHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
serverId | property | serverId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: MCPDriftStatus | Public 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
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
export type MCPDriftStatus = 'added' | 'unchanged' | 'changed' | 'removed';