Skip to content

@codesoul-co/hypha-memory / governed-memory-manager

Using this module

Use the Governed memory manager module for using the public contracts and operations for this capability boundary. It exports 1 class, 3 functions, 2 interfaces.

Import from the package entrypoint

ts
import {
  GovernedMemoryManager,
  governedMemoryProviderCapabilities,
  governedMemoryProviderHealth,
  registerMemoryManagementProviderHandlers,
} from '@codesoul-co/hypha-memory';

import type {
  GovernedMemoryManagerOptions,
  MemoryActivityRegistrar,
} from '@codesoul-co/hypha-memory';

Usage patterns

  • Use the 2 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 3 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
GovernedMemoryManagerclassnew GovernedMemoryManager(options: GovernedMemoryManagerOptions): GovernedMemoryManagerCanonical managed-memory entry point. Every operation is executed through the policy, harness, event, cancellation and timeout boundary of MemoryActivityPort.
governedMemoryProviderCapabilitiesfunctiongovernedMemoryProviderCapabilities(provider: MemoryManagementProvider): Promise<MemoryManagementCapabilities>Governed Memory Provider Capabilities function with 1 public call signature; parameters and return types are listed below.
governedMemoryProviderHealthfunctiongovernedMemoryProviderHealth(provider: MemoryManagementProvider): Promise<ProviderHealth>Governed Memory Provider Health function with 1 public call signature; parameters and return types are listed below.
registerMemoryManagementProviderHandlersfunctionregisterMemoryManagementProviderHandlers(activities: MemoryActivityRegistrar | DefaultMemoryActivityPort, provider: MemoryManagementProvider): voidRegister Memory Management Provider Handlers function with 1 public call signature; parameters and return types are listed below.
GovernedMemoryManagerOptionsinterfaceinterface GovernedMemoryManagerOptionsGoverned Memory Manager Options interface with 8 public fields or methods.
MemoryActivityRegistrarinterfaceinterface MemoryActivityRegistrarMemory Activity Registrar interface with 1 public fields or methods.

GovernedMemoryManager

Canonical managed-memory entry point. Every operation is executed through the policy, harness, event, cancellation and timeout boundary of MemoryActivityPort.

  • Kind: class
  • Import: import { GovernedMemoryManager } from '@codesoul-co/hypha-memory';
  • Source module: governed-memory-manager

Declaration

text
export declare class GovernedMemoryManager {
    constructor(options: GovernedMemoryManagerOptions);
    add(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>;
    search(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>;
    get(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | null>;
    list(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>;
    update(request: ManagedMemoryUpdateRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>;
    delete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult>;
    history(request: MemoryHistoryRequest, signal?: AbortSignal): Promise<MemoryVersion[]>;
}

Public members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: GovernedMemoryManagerOptions): GovernedMemoryManagerCreates an instance of this class.
deletemethoddelete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult>Public method; parameters and return type are shown in the signature.
getmethodget(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | null>Public method; parameters and return type are shown in the signature.
historymethodhistory(request: MemoryHistoryRequest, signal?: AbortSignal): Promise<MemoryVersion[]>Public method; parameters and return type are shown in the signature.
listmethodlist(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>Public method; parameters and return type are shown in the signature.
searchmethodsearch(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>Public method; parameters and return type are shown in the signature.
updatemethodupdate(request: ManagedMemoryUpdateRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.

governedMemoryProviderCapabilities

Governed Memory Provider Capabilities function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { governedMemoryProviderCapabilities } from '@codesoul-co/hypha-memory';
  • Source module: governed-memory-manager

Declaration

text
export declare function governedMemoryProviderCapabilities(provider: MemoryManagementProvider): Promise<MemoryManagementCapabilities>;

Call signature

text
governedMemoryProviderCapabilities(provider: MemoryManagementProvider): Promise<MemoryManagementCapabilities>

Parameters

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

Returns

  • Type: Promise<MemoryManagementCapabilities>
  • Description: The return contract is defined by the type shown above.

governedMemoryProviderHealth

Governed Memory Provider Health function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { governedMemoryProviderHealth } from '@codesoul-co/hypha-memory';
  • Source module: governed-memory-manager

Declaration

text
export declare function governedMemoryProviderHealth(provider: MemoryManagementProvider): Promise<ProviderHealth>;

Call signature

text
governedMemoryProviderHealth(provider: MemoryManagementProvider): Promise<ProviderHealth>

Parameters

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

Returns

  • Type: Promise<ProviderHealth>
  • Description: The return contract is defined by the type shown above.

registerMemoryManagementProviderHandlers

Register Memory Management Provider Handlers function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { registerMemoryManagementProviderHandlers } from '@codesoul-co/hypha-memory';
  • Source module: governed-memory-manager

Declaration

text
export declare function registerMemoryManagementProviderHandlers(activities: MemoryActivityRegistrar | DefaultMemoryActivityPort, provider: MemoryManagementProvider): void;

Call signature

text
registerMemoryManagementProviderHandlers(activities: MemoryActivityRegistrar | DefaultMemoryActivityPort, provider: MemoryManagementProvider): void

Parameters

ParameterTypeRequiredDescription
activitiesMemoryActivityRegistrar | DefaultMemoryActivityPortYesRequired parameter; accepted values are defined by the type column.
providerMemoryManagementProviderYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: void
  • Description: Returns no value.

GovernedMemoryManagerOptions

Governed Memory Manager Options interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { GovernedMemoryManagerOptions } from '@codesoul-co/hypha-memory';
  • Source module: governed-memory-manager

Declaration

text
export interface GovernedMemoryManagerOptions {
    activities: MemoryActivityPort;
    providerId: string;
    profileRef: MemoryContractSpecRef | ((request: GovernedMemoryRequest) => MemoryContractSpecRef);
    eventContext: MemoryEventContext | ((request: GovernedMemoryRequest) => MemoryEventContext);
    timeoutMs?: number;
    reconciliationStore?: MemoryLifecycleTaskStore;
    projectionInvalidation?: MemoryProjectionInvalidationPort;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
activitiespropertyactivities: MemoryActivityPortPublic property; its type, readonly modifier and optionality are shown in the signature.
eventContextpropertyeventContext: MemoryEventContext | ((request: GovernedMemoryRequest) => MemoryEventContext)Public property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
profileRefpropertyprofileRef: MemoryContractSpecRef | ((request: GovernedMemoryRequest) => MemoryContractSpecRef)Public property; its type, readonly modifier and optionality are shown in the signature.
projectionInvalidationpropertyprojectionInvalidation?: MemoryProjectionInvalidationPortPublic property; its type, readonly modifier and optionality are shown in the signature.
providerIdpropertyproviderId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reconciliationStorepropertyreconciliationStore?: MemoryLifecycleTaskStorePublic 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.

MemoryActivityRegistrar

Memory Activity Registrar interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityRegistrar } from '@codesoul-co/hypha-memory';
  • Source module: governed-memory-manager

Declaration

text
export interface MemoryActivityRegistrar {
    register(operation: MemoryActivityOperation, handler: MemoryActivityHandler): unknown;
}

Contract members

MemberKindSignatureDescription
registermethodregister(operation: MemoryActivityOperation, handler: MemoryActivityHandler): unknownPublic method; parameters and return type are shown in the signature.