@codesoul-co/hypha-memory / provider-governance
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/provider-governance.ts - Exports: 8
Using this module
Use the Provider governance module for binding external or local providers to Hypha ports. It exports 1 class, 2 functions, 5 interfaces.
Import from the package entrypoint
import {
InMemoryMemoryProviderQuota,
createMemoryDeletionEvidence,
verifyMemoryDeletionEvidence,
} from '@codesoul-co/hypha-memory';
import type {
MemoryDeletionEvidence,
MemoryProviderBackupRestoreCapabilities,
MemoryProviderQuotaDecision,
MemoryProviderQuotaPolicy,
MemoryProviderUsage,
} from '@codesoul-co/hypha-memory';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 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
InMemoryMemoryProviderQuota | class | new InMemoryMemoryProviderQuota(policies: MemoryProviderQuotaPolicy[], now?: () => Date): InMemoryMemoryProviderQuota | In Memory Memory Provider Quota class with 4 public constructor or member entries; its exact declarations are listed below. |
createMemoryDeletionEvidence | function | createMemoryDeletionEvidence(input: { operationId: string; providerId: string; scope: ManagedMemoryScope; requestedMemoryIds: string[]; deletedMemoryIds: string[]; mode: MemoryDeletionEvidence["mode"]; completedAt?: string; providerReceiptRef?: string; }): MemoryDeletionEvidence | Create Memory Deletion Evidence function with 1 public call signature; parameters and return types are listed below. |
verifyMemoryDeletionEvidence | function | verifyMemoryDeletionEvidence(evidence: MemoryDeletionEvidence): boolean | Verify Memory Deletion Evidence function with 1 public call signature; parameters and return types are listed below. |
MemoryDeletionEvidence | interface | interface MemoryDeletionEvidence | Memory Deletion Evidence interface with 12 public fields or methods. |
MemoryProviderBackupRestoreCapabilities | interface | interface MemoryProviderBackupRestoreCapabilities | Memory Provider Backup Restore Capabilities interface with 7 public fields or methods. |
MemoryProviderQuotaDecision | interface | interface MemoryProviderQuotaDecision | Memory Provider Quota Decision interface with 4 public fields or methods. |
MemoryProviderQuotaPolicy | interface | interface MemoryProviderQuotaPolicy | Memory Provider Quota Policy interface with 5 public fields or methods. |
MemoryProviderUsage | interface | interface MemoryProviderUsage | Memory Provider Usage interface with 5 public fields or methods. |
InMemoryMemoryProviderQuota
In Memory Memory Provider Quota class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryMemoryProviderQuota } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export declare class InMemoryMemoryProviderQuota {
constructor(policies: MemoryProviderQuotaPolicy[], now?: () => Date);
check(providerId: string, requestedCostUnits?: number, requestedBytes?: number): MemoryProviderQuotaDecision;
record(providerId: string, costUnits?: number, storedBytesDelta?: number): MemoryProviderUsage;
snapshot(providerId: string): MemoryProviderUsage;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
check | method | check(providerId: string, requestedCostUnits?: number, requestedBytes?: number): MemoryProviderQuotaDecision | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (policies: MemoryProviderQuotaPolicy[], now?: () => Date): InMemoryMemoryProviderQuota | Creates an instance of this class. |
record | method | record(providerId: string, costUnits?: number, storedBytesDelta?: number): MemoryProviderUsage | Public method; parameters and return type are shown in the signature. |
snapshot | method | snapshot(providerId: string): MemoryProviderUsage | Public method; parameters and return type are shown in the signature. |
createMemoryDeletionEvidence
Create Memory Deletion Evidence function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createMemoryDeletionEvidence } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export declare function createMemoryDeletionEvidence(input: {
operationId: string;
providerId: string;
scope: ManagedMemoryScope;
requestedMemoryIds: string[];
deletedMemoryIds: string[];
mode: MemoryDeletionEvidence['mode'];
completedAt?: string;
providerReceiptRef?: string;
}): MemoryDeletionEvidence;Call signature
createMemoryDeletionEvidence(input: { operationId: string; providerId: string; scope: ManagedMemoryScope; requestedMemoryIds: string[]; deletedMemoryIds: string[]; mode: MemoryDeletionEvidence["mode"]; completedAt?: string; providerReceiptRef?: string; }): MemoryDeletionEvidenceParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | { operationId: string; providerId: string; scope: ManagedMemoryScope; requestedMemoryIds: string[]; deletedMemoryIds: string[]; mode: MemoryDeletionEvidence["mode"]; completedAt?: string; providerReceiptRef?: string; } | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
MemoryDeletionEvidence - Description: The return contract is defined by the type shown above.
verifyMemoryDeletionEvidence
Verify Memory Deletion Evidence function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { verifyMemoryDeletionEvidence } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export declare function verifyMemoryDeletionEvidence(evidence: MemoryDeletionEvidence): boolean;Call signature
verifyMemoryDeletionEvidence(evidence: MemoryDeletionEvidence): booleanParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
evidence | MemoryDeletionEvidence | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
boolean - Description: The return contract is defined by the type shown above.
MemoryDeletionEvidence
Memory Deletion Evidence interface with 12 public fields or methods.
- Kind: interface
- Import:
import type { MemoryDeletionEvidence } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export interface MemoryDeletionEvidence {
schemaVersion: '1.0';
receiptId: string;
operationId: string;
providerId: string;
scopeHash: string;
requestedMemoryIds: string[];
deletedMemoryIds: string[];
pendingMemoryIds: string[];
mode: 'soft' | 'hard' | 'compliance';
completedAt: string;
providerReceiptRef?: string;
proofHash: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
completedAt | property | completedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
deletedMemoryIds | property | deletedMemoryIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: "soft" | "hard" | "compliance" | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
pendingMemoryIds | property | pendingMemoryIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
proofHash | property | proofHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerReceiptRef | property | providerReceiptRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
receiptId | property | receiptId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestedMemoryIds | property | requestedMemoryIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
schemaVersion | property | schemaVersion: "1.0" | Public property; its type, readonly modifier and optionality are shown in the signature. |
scopeHash | property | scopeHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryProviderBackupRestoreCapabilities
Memory Provider Backup Restore Capabilities interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { MemoryProviderBackupRestoreCapabilities } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export interface MemoryProviderBackupRestoreCapabilities {
exportRecords: boolean;
importRecords: boolean;
exportVersions: boolean;
preserveStableIds: boolean;
preserveScopeHashes: boolean;
pointInTimeRestore: boolean;
providerReceiptExport: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
exportRecords | property | exportRecords: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
exportVersions | property | exportVersions: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
importRecords | property | importRecords: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
pointInTimeRestore | property | pointInTimeRestore: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
preserveScopeHashes | property | preserveScopeHashes: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
preserveStableIds | property | preserveStableIds: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerReceiptExport | property | providerReceiptExport: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryProviderQuotaDecision
Memory Provider Quota Decision interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { MemoryProviderQuotaDecision } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export interface MemoryProviderQuotaDecision {
allowed: boolean;
reason?: 'operation_quota' | 'cost_quota' | 'storage_quota';
remainingOperations: number;
remainingCostUnits?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
allowed | property | allowed: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason?: "operation_quota" | "cost_quota" | "storage_quota" | Public property; its type, readonly modifier and optionality are shown in the signature. |
remainingCostUnits | property | remainingCostUnits?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
remainingOperations | property | remainingOperations: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryProviderQuotaPolicy
Memory Provider Quota Policy interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { MemoryProviderQuotaPolicy } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export interface MemoryProviderQuotaPolicy {
providerId: string;
windowMs: number;
maxOperations: number;
maxCostUnits?: number;
maxStoredBytes?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
maxCostUnits | property | maxCostUnits?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxOperations | property | maxOperations: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxStoredBytes | property | maxStoredBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
windowMs | property | windowMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryProviderUsage
Memory Provider Usage interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { MemoryProviderUsage } from '@codesoul-co/hypha-memory'; - Source module:
provider-governance
Declaration
export interface MemoryProviderUsage {
providerId: string;
windowStartedAt: string;
operations: number;
costUnits: number;
storedBytes?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
costUnits | property | costUnits: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
operations | property | operations: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
storedBytes | property | storedBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
windowStartedAt | property | windowStartedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
