Skip to content

@codesoul-co/hypha-memory / memory-runtime-factory

Using this module

Use the Memory runtime factory module for executing runtime behavior at this boundary. It exports 2 classes, 2 constants, 1 function, 8 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  MemoryManagementProviderRegistry,
  MemoryRuntimeFactory,
  memoryRuntimeConfigSchema,
  memoryRuntimeProfileSchema,
  validateMemoryRuntimeConfig,
} from '@codesoul-co/hypha-memory';

import type {
  MemoryManagementProviderFactory,
  MemoryManagementProviderFactoryContext,
  MemoryManagementProviderInstallation,
  MemoryRuntime,
  MemoryRuntimeCompositionReceipt,
  MemoryRuntimeConfig,
  MemoryRuntimeFactoryOptions,
  MemoryRuntimeProfile,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

  • Use the 9 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 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The module exposes 1 function 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
MemoryManagementProviderRegistryclassnew MemoryManagementProviderRegistry(): MemoryManagementProviderRegistryMemory Management Provider Registry class with 3 public constructor or member entries; its exact declarations are listed below.
MemoryRuntimeFactoryclassnew MemoryRuntimeFactory(options: MemoryRuntimeFactoryOptions): MemoryRuntimeFactoryStrict composition root for all Memory consumers.
memoryRuntimeConfigSchemaconstantconst memoryRuntimeConfigSchema: ZodType<MemoryRuntimeConfig, ZodTypeDef, MemoryRuntimeConfig>Runtime schema for Memory Runtime Config.
memoryRuntimeProfileSchemaconstantconst memoryRuntimeProfileSchema: ZodType<MemoryRuntimeProfile, ZodTypeDef, MemoryRuntimeProfile>Runtime schema for Memory Runtime Profile.
validateMemoryRuntimeConfigfunctionvalidateMemoryRuntimeConfig(input: unknown): MemoryRuntimeConfigValidate Memory Runtime Config function with 1 public call signature; parameters and return types are listed below.
MemoryManagementProviderFactoryinterfaceinterface MemoryManagementProviderFactoryMemory Management Provider Factory interface with 3 public fields or methods.
MemoryManagementProviderFactoryContextinterfaceinterface MemoryManagementProviderFactoryContextMemory Management Provider Factory Context interface with 3 public fields or methods.
MemoryManagementProviderInstallationinterfaceinterface MemoryManagementProviderInstallationMemory Management Provider Installation interface with 4 public fields or methods.
MemoryRuntimeinterfaceinterface MemoryRuntimeMemory Runtime interface with 10 public fields or methods.
MemoryRuntimeCompositionReceiptinterfaceinterface MemoryRuntimeCompositionReceiptMemory Runtime Composition Receipt interface with 10 public fields or methods.
MemoryRuntimeConfiginterfaceinterface MemoryRuntimeConfigMemory Runtime Config interface with 2 public fields or methods.
MemoryRuntimeFactoryOptionsinterfaceinterface MemoryRuntimeFactoryOptionsMemory Runtime Factory Options interface with 12 public fields or methods.
MemoryRuntimeProfileinterfaceinterface MemoryRuntimeProfileMemory Runtime Profile interface with 2 public fields or methods.
MemoryRuntimeSearchCacheOptionstypetype MemoryRuntimeSearchCacheOptions = Omit<CachedMemoryManagementProviderOptions, 'provider' | 'providerRevision' | 'requiredScopeFields' | 'cacheAuthorization' | 'requireCacheAuthorization'>Public type alias for Memory Runtime Search Cache Options; the declaration contains its complete type expression.

MemoryManagementProviderRegistry

Memory Management Provider Registry class with 3 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { MemoryManagementProviderRegistry } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export declare class MemoryManagementProviderRegistry {
    register(factory: MemoryManagementProviderFactory): this;
    resolve(spec: MemoryManagementProviderSpec): MemoryManagementProviderFactory;
}

Public members

MemberKindSignatureDescription
constructorconstructor(): MemoryManagementProviderRegistryCreates an instance of this class.
registermethodregister(factory: MemoryManagementProviderFactory): MemoryManagementProviderRegistryPublic method; parameters and return type are shown in the signature.
resolvemethodresolve(spec: MemoryManagementProviderSpec): MemoryManagementProviderFactoryPublic method; parameters and return type are shown in the signature.

MemoryRuntimeFactory

Strict composition root for all Memory consumers.

  • Kind: class
  • Import: import { MemoryRuntimeFactory } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export declare class MemoryRuntimeFactory {
    constructor(options: MemoryRuntimeFactoryOptions);
    create(input: unknown, references?: ReadonlyMap<string, unknown>): Promise<MemoryRuntime>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: MemoryRuntimeFactoryOptions): MemoryRuntimeFactoryCreates an instance of this class.
createmethodcreate(input: unknown, references?: ReadonlyMap<string, unknown>): Promise<MemoryRuntime>Public method; parameters and return type are shown in the signature.

memoryRuntimeConfigSchema

Runtime schema for Memory Runtime Config.

  • Kind: constant
  • Import: import { memoryRuntimeConfigSchema } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export declare const memoryRuntimeConfigSchema: ZodType<MemoryRuntimeConfig, ZodTypeDef, MemoryRuntimeConfig>;

memoryRuntimeProfileSchema

Runtime schema for Memory Runtime Profile.

  • Kind: constant
  • Import: import { memoryRuntimeProfileSchema } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export declare const memoryRuntimeProfileSchema: ZodType<MemoryRuntimeProfile, ZodTypeDef, MemoryRuntimeProfile>;

validateMemoryRuntimeConfig

Validate Memory Runtime Config function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { validateMemoryRuntimeConfig } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export declare function validateMemoryRuntimeConfig(input: unknown): MemoryRuntimeConfig;

Call signature

text
validateMemoryRuntimeConfig(input: unknown): MemoryRuntimeConfig

Parameters

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

Returns

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

MemoryManagementProviderFactory

Memory Management Provider Factory interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryManagementProviderFactory } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryManagementProviderFactory {
    readonly id: string;
    supports(spec: MemoryManagementProviderSpec): boolean;
    create(context: MemoryManagementProviderFactoryContext): Promise<MemoryManagementProvider | MemoryManagementProviderInstallation>;
}

Contract members

MemberKindSignatureDescription
createmethodcreate(context: MemoryManagementProviderFactoryContext): Promise<MemoryManagementProvider | MemoryManagementProviderInstallation>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
supportsmethodsupports(spec: MemoryManagementProviderSpec): booleanPublic method; parameters and return type are shown in the signature.

MemoryManagementProviderFactoryContext

Memory Management Provider Factory Context interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryManagementProviderFactoryContext } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryManagementProviderFactoryContext {
    profile: MemoryProfileSpec;
    spec: MemoryManagementProviderSpec;
    references?: ReadonlyMap<string, unknown>;
}

Contract members

MemberKindSignatureDescription
profilepropertyprofile: MemoryProfileSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
referencespropertyreferences?: ReadonlyMap<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
specpropertyspec: MemoryManagementProviderSpecPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryManagementProviderInstallation

Memory Management Provider Installation interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryManagementProviderInstallation } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryManagementProviderInstallation {
    provider: MemoryManagementProvider;
    reconciliationStore?: MemoryLifecycleTaskStore;
    resources?: unknown;
    close?(): Promise<void>;
}

Contract members

MemberKindSignatureDescription
closemethodclose?(): Promise<void>Public method; parameters and return type are shown in the signature.
providerpropertyprovider: MemoryManagementProviderPublic 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.
resourcespropertyresources?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRuntime

Memory Runtime interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryRuntime } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryRuntime {
    service: MemoryApplicationService;
    provider: MemoryManagementProvider;
    profile: MemoryProfileSpec;
    providerSpec: MemoryManagementProviderSpec;
    profileHash: string;
    capabilities: MemoryManagementCapabilities;
    compositionReceipt: MemoryRuntimeCompositionReceipt;
    resources?: unknown;
    close(): Promise<void>;
    telemetry?: MemoryProviderTelemetry;
}

Contract members

MemberKindSignatureDescription
capabilitiespropertycapabilities: MemoryManagementCapabilitiesPublic property; its type, readonly modifier and optionality are shown in the signature.
closemethodclose(): Promise<void>Public method; parameters and return type are shown in the signature.
compositionReceiptpropertycompositionReceipt: MemoryRuntimeCompositionReceiptPublic property; its type, readonly modifier and optionality are shown in the signature.
profilepropertyprofile: MemoryProfileSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
profileHashpropertyprofileHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider: MemoryManagementProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
providerSpecpropertyproviderSpec: MemoryManagementProviderSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
resourcespropertyresources?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
servicepropertyservice: MemoryApplicationServicePublic property; its type, readonly modifier and optionality are shown in the signature.
telemetrypropertytelemetry?: MemoryProviderTelemetryPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRuntimeCompositionReceipt

Memory Runtime Composition Receipt interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryRuntimeCompositionReceipt } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryRuntimeCompositionReceipt {
    runtimeId: string;
    serviceInstanceId: string;
    serviceContract: '@codesoul-co/hypha-memory.MemoryApplicationService';
    activeProfileId: string;
    providerId: string;
    providerSpecId: string;
    configHash: string;
    profileHash: string;
    resolvedDependencyRefs: string[];
    createdAt: string;
}

Contract members

MemberKindSignatureDescription
activeProfileIdpropertyactiveProfileId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
configHashpropertyconfigHash: stringPublic 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.
profileHashpropertyprofileHash: stringPublic 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.
providerSpecIdpropertyproviderSpecId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
resolvedDependencyRefspropertyresolvedDependencyRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
runtimeIdpropertyruntimeId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
serviceContractpropertyserviceContract: "@codesoul-co/hypha-memory.MemoryApplicationService"Public property; its type, readonly modifier and optionality are shown in the signature.
serviceInstanceIdpropertyserviceInstanceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRuntimeConfig

Memory Runtime Config interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryRuntimeConfig } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryRuntimeConfig {
    activeProfile: string;
    profiles: Record<string, MemoryRuntimeProfile>;
}

Contract members

MemberKindSignatureDescription
activeProfilepropertyactiveProfile: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profilespropertyprofiles: Record<string, MemoryRuntimeProfile>Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryRuntimeFactoryOptions

Memory Runtime Factory Options interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryRuntimeFactoryOptions } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryRuntimeFactoryOptions {
    registry: MemoryManagementProviderRegistry;
    activities: DefaultMemoryActivityPortOptions;
    eventContext: (request: MemoryRuntimeRequestContext) => MemoryEventContext;
    contextBuilder?: MemoryContextBuilder;
    contextGateway?: ContextInjectionGateway;
    reconciliationStore?: MemoryLifecycleTaskStore;
    telemetry?: MemoryProviderTelemetry;
    operationalMetrics?: MemoryOperationalMetrics;
    providerCostEstimator?: MemoryProviderCostEstimator;
    searchCache?: MemoryRuntimeSearchCacheOptions;
    projectionInvalidation?: MemoryProjectionInvalidationPort;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
activitiespropertyactivities: DefaultMemoryActivityPortOptionsPublic property; its type, readonly modifier and optionality are shown in the signature.
contextBuilderpropertycontextBuilder?: MemoryContextBuilderPublic property; its type, readonly modifier and optionality are shown in the signature.
contextGatewaypropertycontextGateway?: ContextInjectionGatewayPublic property; its type, readonly modifier and optionality are shown in the signature.
eventContextmethodeventContext(request: MemoryRuntimeRequestContext): MemoryEventContextPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
operationalMetricspropertyoperationalMetrics?: MemoryOperationalMetricsPublic 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.
providerCostEstimatormethodproviderCostEstimator?(operation: import("/Users/erwin/Downloads/codespace/Hypha/packages/memory/dist/provider-observability").MemoryProviderOperation, request: unknown): import("/Users/erwin/Downloads/codespace/Hypha/packages/memory/dist/provider-observability").MemoryProviderOperationEstimatePublic method; parameters and return type are shown in the signature.
reconciliationStorepropertyreconciliationStore?: MemoryLifecycleTaskStorePublic property; its type, readonly modifier and optionality are shown in the signature.
registrypropertyregistry: MemoryManagementProviderRegistryPublic property; its type, readonly modifier and optionality are shown in the signature.
searchCachepropertysearchCache?: MemoryRuntimeSearchCacheOptionsPublic property; its type, readonly modifier and optionality are shown in the signature.
telemetrypropertytelemetry?: MemoryProviderTelemetryPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRuntimeProfile

Memory Runtime Profile interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryRuntimeProfile } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export interface MemoryRuntimeProfile {
    profile: MemoryProfileSpec;
    management: MemoryManagementProviderSpec;
}

Contract members

MemberKindSignatureDescription
managementpropertymanagement: MemoryManagementProviderSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
profilepropertyprofile: MemoryProfileSpecPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRuntimeSearchCacheOptions

Public type alias for Memory Runtime Search Cache Options; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MemoryRuntimeSearchCacheOptions } from '@codesoul-co/hypha-memory';
  • Source module: memory-runtime-factory

Declaration

text
export type MemoryRuntimeSearchCacheOptions = Omit<CachedMemoryManagementProviderOptions, 'provider' | 'providerRevision' | 'requiredScopeFields' | 'cacheAuthorization' | 'requireCacheAuthorization'>;