Skip to content

@codesoul-co/hypha-memory / integration-contracts

Using this module

Use the Integration contracts module for declaring and runtime-validating contracts. It exports 2 classes, 8 functions, 20 interfaces, 2 types.

Import from the package entrypoint

ts
import {
  DefaultMemoryActivityPort,
  MemoryContextInferenceBridge,
  createContextBuildActivityHandler,
  createDomainMemoryDependencySnapshot,
  createMemoryCacheValidityInput,
  createMemorySearchActivityHandler,
  memoryCacheValidityHash,
  memoryRecordVersionSetHash,
} from '@codesoul-co/hypha-memory';

import type {
  DefaultMemoryActivityPortOptions,
  DomainMemoryDependencySnapshot,
  InferenceContextInput,
  InferenceContextPort,
  MemoryActivityHarnessHook,
  MemoryActivityObserver,
  MemoryActivityPolicyDecision,
  MemoryActivityPolicyPort,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

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

Public exports

SymbolKindSignatureDescription
DefaultMemoryActivityPortclassnew DefaultMemoryActivityPort(options: DefaultMemoryActivityPortOptions): DefaultMemoryActivityPortDefault Memory Activity Port class with 3 public constructor or member entries; its exact declarations are listed below.
MemoryContextInferenceBridgeclassnew MemoryContextInferenceBridge(activities: MemoryActivityPort, inference: InferenceContextPort): MemoryContextInferenceBridgeMemory Context Inference Bridge class with 2 public constructor or member entries; its exact declarations are listed below.
createContextBuildActivityHandlerfunctioncreateContextBuildActivityHandler(builder: MemoryContextBuilder, gateway: ContextInjectionGateway): MemoryActivityHandlerCreate Context Build Activity Handler function with 1 public call signature; parameters and return types are listed below.
createDomainMemoryDependencySnapshotfunctioncreateDomainMemoryDependencySnapshot(input: Omit<DomainMemoryDependencySnapshot, "dependencyHash" | "createdAt">, now?: string): DomainMemoryDependencySnapshotCreate Domain Memory Dependency Snapshot function with 1 public call signature; parameters and return types are listed below.
createMemoryCacheValidityInputfunctioncreateMemoryCacheValidityInput(input: Omit<MemoryCacheValidityInput, "scopeHash"> & { scope: ManagedMemoryScope; }): MemoryCacheValidityInputCreate Memory Cache Validity Input function with 1 public call signature; parameters and return types are listed below.
createMemorySearchActivityHandlerfunctioncreateMemorySearchActivityHandler(provider: MemoryManagementProvider): MemoryActivityHandlerCreate Memory Search Activity Handler function with 1 public call signature; parameters and return types are listed below.
memoryCacheValidityHashfunctionmemoryCacheValidityHash(input: MemoryCacheValidityInput): stringMemory Cache Validity Hash function with 1 public call signature; parameters and return types are listed below.
memoryRecordVersionSetHashfunctionmemoryRecordVersionSetHash(versionIds: string[]): stringMemory Record Version Set Hash function with 1 public call signature; parameters and return types are listed below.
validateMemoryBindingCapabilitiesfunctionvalidateMemoryBindingCapabilities(binding: WorkflowStateMemoryBinding, capabilities: MemoryManagementCapabilities): string[]Validate Memory Binding Capabilities function with 1 public call signature; parameters and return types are listed below.
validateMemoryProfileCapabilitiesfunctionvalidateMemoryProfileCapabilities(profile: MemoryProfileSpec, capabilities: MemoryManagementCapabilities): string[]Validate Memory Profile Capabilities function with 1 public call signature; parameters and return types are listed below.
DefaultMemoryActivityPortOptionsinterfaceinterface DefaultMemoryActivityPortOptionsDefault Memory Activity Port Options interface with 4 public fields or methods.
DomainMemoryDependencySnapshotinterfaceinterface DomainMemoryDependencySnapshotDomain Memory Dependency Snapshot interface with 10 public fields or methods.
InferenceContextInputinterfaceinterface InferenceContextInputInference Context Input interface with 3 public fields or methods.
InferenceContextPortinterfaceinterface InferenceContextPortInference Context Port interface with 1 public fields or methods.
MemoryActivityHarnessHookinterfaceinterface MemoryActivityHarnessHookMemory Activity Harness Hook interface with 2 public fields or methods.
MemoryActivityObserverinterfaceinterface MemoryActivityObserverMemory Activity Observer interface with 3 public fields or methods.
MemoryActivityPolicyDecisioninterfaceinterface MemoryActivityPolicyDecisionMemory Activity Policy Decision interface with 3 public fields or methods.
MemoryActivityPolicyPortinterfaceinterface MemoryActivityPolicyPortMemory Activity Policy Port interface with 1 public fields or methods.
MemoryActivityPortinterfaceinterface MemoryActivityPortMemory Activity Port interface with 1 public fields or methods.
MemoryActivityRequestinterfaceinterface MemoryActivityRequestMemory Activity Request interface with 9 public fields or methods.
MemoryActivityResultinterfaceinterface MemoryActivityResultMemory Activity Result interface with 8 public fields or methods.
MemoryCacheInvalidationinterfaceinterface MemoryCacheInvalidationMemory Cache Invalidation interface with 7 public fields or methods.
MemoryCacheValidityInputinterfaceinterface MemoryCacheValidityInputMemory Cache Validity Input interface with 10 public fields or methods.
MemoryContextInferenceResultinterfaceinterface MemoryContextInferenceResultMemory Context Inference Result interface with 2 public fields or methods.
MemoryEvaluationCaseinterfaceinterface MemoryEvaluationCaseMemory Evaluation Case interface with 6 public fields or methods.
MemoryEvaluationObservationinterfaceinterface MemoryEvaluationObservationMemory Evaluation Observation interface with 7 public fields or methods.
MemoryEvaluationPortinterfaceinterface MemoryEvaluationPortMemory Evaluation Port interface with 1 public fields or methods.
MemoryReplayReferenceinterfaceinterface MemoryReplayReferenceMemory Replay Reference interface with 7 public fields or methods.
SessionMemoryBindinginterfaceinterface SessionMemoryBindingSession Memory Binding interface with 4 public fields or methods.
WorkflowStateMemoryBindinginterfaceinterface WorkflowStateMemoryBindingWorkflow State Memory Binding interface with 8 public fields or methods.
MemoryActivityHandlertypetype MemoryActivityHandler = (request: MemoryActivityRequest, signal?: AbortSignal) => Promise<Omit<MemoryActivityResult, 'operationId'>>Public type alias for Memory Activity Handler; the declaration contains its complete type expression.
MemoryActivityOperationtypetype MemoryActivityOperation = 'add' | 'extract' | 'search' | 'get' | 'list' | 'update' | 'write' | 'maintain' | 'delete' | 'history' | 'build_context'Public type alias for Memory Activity Operation; the declaration contains its complete type expression.

DefaultMemoryActivityPort

Default Memory Activity Port class with 3 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { DefaultMemoryActivityPort } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare class DefaultMemoryActivityPort implements MemoryActivityPort {
    constructor(options: DefaultMemoryActivityPortOptions);
    register(operation: MemoryActivityOperation, handler: MemoryActivityHandler): this;
    execute(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryActivityResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: DefaultMemoryActivityPortOptions): DefaultMemoryActivityPortCreates an instance of this class.
executemethodexecute(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryActivityResult>Public method; parameters and return type are shown in the signature.
registermethodregister(operation: MemoryActivityOperation, handler: MemoryActivityHandler): DefaultMemoryActivityPortPublic method; parameters and return type are shown in the signature.

MemoryContextInferenceBridge

Memory Context Inference Bridge class with 2 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { MemoryContextInferenceBridge } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare class MemoryContextInferenceBridge {
    constructor(activities: MemoryActivityPort, inference: InferenceContextPort);
    execute(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryContextInferenceResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(activities: MemoryActivityPort, inference: InferenceContextPort): MemoryContextInferenceBridgeCreates an instance of this class.
executemethodexecute(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryContextInferenceResult>Public method; parameters and return type are shown in the signature.

createContextBuildActivityHandler

Create Context Build Activity Handler function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createContextBuildActivityHandler } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function createContextBuildActivityHandler(builder: MemoryContextBuilder, gateway: ContextInjectionGateway): MemoryActivityHandler;

Call signature

text
createContextBuildActivityHandler(builder: MemoryContextBuilder, gateway: ContextInjectionGateway): MemoryActivityHandler

Parameters

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

Returns

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

createDomainMemoryDependencySnapshot

Create Domain Memory Dependency Snapshot function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createDomainMemoryDependencySnapshot } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function createDomainMemoryDependencySnapshot(input: Omit<DomainMemoryDependencySnapshot, 'dependencyHash' | 'createdAt'>, now?: string): DomainMemoryDependencySnapshot;

Call signature

text
createDomainMemoryDependencySnapshot(input: Omit<DomainMemoryDependencySnapshot, "dependencyHash" | "createdAt">, now?: string): DomainMemoryDependencySnapshot

Parameters

ParameterTypeRequiredDescription
inputOmit<DomainMemoryDependencySnapshot, "createdAt" | "dependencyHash">YesRequired parameter; accepted values are defined by the type column.
nowstringNoOptional parameter; accepted values are defined by the type column.

Returns

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

createMemoryCacheValidityInput

Create Memory Cache Validity Input function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createMemoryCacheValidityInput } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function createMemoryCacheValidityInput(input: Omit<MemoryCacheValidityInput, 'scopeHash'> & {
    scope: ManagedMemoryScope;
}): MemoryCacheValidityInput;

Call signature

text
createMemoryCacheValidityInput(input: Omit<MemoryCacheValidityInput, "scopeHash"> & { scope: ManagedMemoryScope; }): MemoryCacheValidityInput

Parameters

ParameterTypeRequiredDescription
inputOmit<MemoryCacheValidityInput, "scopeHash"> & { scope: ManagedMemoryScope; }YesRequired parameter; accepted values are defined by the type column.

Returns

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

createMemorySearchActivityHandler

Create Memory Search Activity Handler function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createMemorySearchActivityHandler } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function createMemorySearchActivityHandler(provider: MemoryManagementProvider): MemoryActivityHandler;

Call signature

text
createMemorySearchActivityHandler(provider: MemoryManagementProvider): MemoryActivityHandler

Parameters

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

Returns

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

memoryCacheValidityHash

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

  • Kind: function
  • Import: import { memoryCacheValidityHash } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function memoryCacheValidityHash(input: MemoryCacheValidityInput): string;

Call signature

text
memoryCacheValidityHash(input: MemoryCacheValidityInput): string

Parameters

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

Returns

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

memoryRecordVersionSetHash

Memory Record Version Set Hash function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { memoryRecordVersionSetHash } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function memoryRecordVersionSetHash(versionIds: string[]): string;

Call signature

text
memoryRecordVersionSetHash(versionIds: string[]): string

Parameters

ParameterTypeRequiredDescription
versionIdsstring[]YesRequired parameter; accepted values are defined by the type column.

Returns

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

validateMemoryBindingCapabilities

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

  • Kind: function
  • Import: import { validateMemoryBindingCapabilities } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function validateMemoryBindingCapabilities(binding: WorkflowStateMemoryBinding, capabilities: MemoryManagementCapabilities): string[];

Call signature

text
validateMemoryBindingCapabilities(binding: WorkflowStateMemoryBinding, capabilities: MemoryManagementCapabilities): string[]

Parameters

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

Returns

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

validateMemoryProfileCapabilities

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

  • Kind: function
  • Import: import { validateMemoryProfileCapabilities } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export declare function validateMemoryProfileCapabilities(profile: MemoryProfileSpec, capabilities: MemoryManagementCapabilities): string[];

Call signature

text
validateMemoryProfileCapabilities(profile: MemoryProfileSpec, capabilities: MemoryManagementCapabilities): string[]

Parameters

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

Returns

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

DefaultMemoryActivityPortOptions

Default Memory Activity Port Options interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { DefaultMemoryActivityPortOptions } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface DefaultMemoryActivityPortOptions {
    policy: MemoryActivityPolicyPort;
    events: MemoryEventPublisher;
    harness: MemoryActivityHarnessHook;
    observers?: MemoryActivityObserver[];
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: MemoryEventPublisherPublic property; its type, readonly modifier and optionality are shown in the signature.
harnesspropertyharness: MemoryActivityHarnessHookPublic property; its type, readonly modifier and optionality are shown in the signature.
observerspropertyobservers?: MemoryActivityObserver[]Public property; its type, readonly modifier and optionality are shown in the signature.
policypropertypolicy: MemoryActivityPolicyPortPublic property; its type, readonly modifier and optionality are shown in the signature.

DomainMemoryDependencySnapshot

Domain Memory Dependency Snapshot interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { DomainMemoryDependencySnapshot } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface DomainMemoryDependencySnapshot {
    domainPackRef: SpecRef;
    memoryProfileRef?: SpecRef;
    contextProfileRef?: SpecRef;
    extractionProfileRef?: SpecRef;
    providerRefs: SpecRef[];
    policyRefs: SpecRef[];
    scopeTemplate?: Partial<ManagedMemoryScope>;
    capabilitySnapshot: Partial<MemoryManagementCapabilities>;
    dependencyHash: string;
    createdAt: string;
}

Contract members

MemberKindSignatureDescription
capabilitySnapshotpropertycapabilitySnapshot: Partial<MemoryManagementCapabilities>Public property; its type, readonly modifier and optionality are shown in the signature.
contextProfileRefpropertycontextProfileRef?: SpecRefPublic 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.
dependencyHashpropertydependencyHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
domainPackRefpropertydomainPackRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
extractionProfileRefpropertyextractionProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryProfileRefpropertymemoryProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRefspropertypolicyRefs: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
providerRefspropertyproviderRefs: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
scopeTemplatepropertyscopeTemplate?: Partial<ManagedMemoryScope>Public property; its type, readonly modifier and optionality are shown in the signature.

InferenceContextInput

Inference Context Input interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { InferenceContextInput } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface InferenceContextInput {
    envelope: ContextEnvelope;
    contextHash: string;
    provenanceRequired: boolean;
}

Contract members

MemberKindSignatureDescription
contextHashpropertycontextHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
envelopepropertyenvelope: ContextEnvelopePublic property; its type, readonly modifier and optionality are shown in the signature.
provenanceRequiredpropertyprovenanceRequired: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

InferenceContextPort

Inference Context Port interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { InferenceContextPort } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface InferenceContextPort<TOutput = unknown> {
    invoke(input: InferenceContextInput, signal?: AbortSignal): Promise<TOutput>;
}

Contract members

MemberKindSignatureDescription
invokemethodinvoke(input: InferenceContextInput, signal?: AbortSignal): Promise<TOutput>Public method; parameters and return type are shown in the signature.

MemoryActivityHarnessHook

Memory Activity Harness Hook interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityHarnessHook } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityHarnessHook {
    beforeExecute(request: MemoryActivityRequest, signal: AbortSignal): void | Promise<void>;
    afterExecute(request: MemoryActivityRequest, result: MemoryActivityResult): void | Promise<void>;
}

Contract members

MemberKindSignatureDescription
afterExecutemethodafterExecute(request: MemoryActivityRequest, result: MemoryActivityResult): void | Promise<void>Public method; parameters and return type are shown in the signature.
beforeExecutemethodbeforeExecute(request: MemoryActivityRequest, signal: AbortSignal): void | Promise<void>Public method; parameters and return type are shown in the signature.

MemoryActivityObserver

Memory Activity Observer interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityObserver } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityObserver {
    onStarted?(request: MemoryActivityRequest): void | Promise<void>;
    onCompleted?(request: MemoryActivityRequest, result: MemoryActivityResult): void | Promise<void>;
    onFailed?(request: MemoryActivityRequest, result: MemoryActivityResult): void | Promise<void>;
}

Contract members

MemberKindSignatureDescription
onCompletedmethodonCompleted?(request: MemoryActivityRequest, result: MemoryActivityResult): void | Promise<void>Public method; parameters and return type are shown in the signature.
onFailedmethodonFailed?(request: MemoryActivityRequest, result: MemoryActivityResult): void | Promise<void>Public method; parameters and return type are shown in the signature.
onStartedmethodonStarted?(request: MemoryActivityRequest): void | Promise<void>Public method; parameters and return type are shown in the signature.

MemoryActivityPolicyDecision

Memory Activity Policy Decision interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityPolicyDecision } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityPolicyDecision {
    allowed: boolean;
    reason?: string;
    policyRevision?: string;
}

Contract members

MemberKindSignatureDescription
allowedpropertyallowed: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryActivityPolicyPort

Memory Activity Policy Port interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityPolicyPort } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityPolicyPort {
    authorize(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryActivityPolicyDecision>;
}

Contract members

MemberKindSignatureDescription
authorizemethodauthorize(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryActivityPolicyDecision>Public method; parameters and return type are shown in the signature.

MemoryActivityPort

Memory Activity Port interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityPort } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityPort {
    execute(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryActivityResult>;
}

Contract members

MemberKindSignatureDescription
executemethodexecute(request: MemoryActivityRequest, signal?: AbortSignal): Promise<MemoryActivityResult>Public method; parameters and return type are shown in the signature.

MemoryActivityRequest

Memory Activity Request interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityRequest } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityRequest {
    operationId: string;
    operation: MemoryActivityOperation;
    principal: MemoryPrincipal;
    scope: ManagedMemoryScope;
    profileRef: SpecRef;
    eventContext: MemoryEventContext;
    payload: unknown;
    timeoutMs?: number;
    idempotencyKey?: string;
}

Contract members

MemberKindSignatureDescription
eventContextpropertyeventContext: MemoryEventContextPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationpropertyoperation: MemoryActivityOperationPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadpropertypayload: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: MemoryPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: ManagedMemoryScopePublic 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.

MemoryActivityResult

Memory Activity Result interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryActivityResult } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryActivityResult {
    operationId: string;
    status: 'completed' | 'failed' | 'cancelled' | 'partial';
    memoryRefs?: string[];
    contextEnvelopeRef?: string;
    eventIds: string[];
    error?: NormalizedMemoryError;
    evidence?: MemoryProviderReturnEvidence;
    output?: unknown;
}

Contract members

MemberKindSignatureDescription
contextEnvelopeRefpropertycontextEnvelopeRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror?: NormalizedMemoryErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
evidencepropertyevidence?: MemoryProviderReturnEvidencePublic property; its type, readonly modifier and optionality are shown in the signature.
memoryRefspropertymemoryRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputpropertyoutput?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "completed" | "cancelled" | "failed" | "partial"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryCacheInvalidation

Memory Cache Invalidation interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryCacheInvalidation } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryCacheInvalidation {
    operationId: string;
    scopeHash: string;
    reason: 'created' | 'updated' | 'invalidated' | 'deleted' | 'provider_revision';
    memoryIds: string[];
    memoryVersionIds?: string[];
    mutationGeneration: string;
    validityHash: string;
}

Contract members

MemberKindSignatureDescription
memoryIdspropertymemoryIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
memoryVersionIdspropertymemoryVersionIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
mutationGenerationpropertymutationGeneration: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason: "created" | "invalidated" | "deleted" | "updated" | "provider_revision"Public property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
validityHashpropertyvalidityHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryCacheValidityInput

Memory Cache Validity Input interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryCacheValidityInput } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryCacheValidityInput {
    memoryProfileRevision: string;
    mutationGeneration: string;
    contextProfileRevision?: string;
    scopeHash: string;
    queryHash?: string;
    recordSetRevision?: string;
    selectedMemoryVersionIds?: string[];
    providerRevision?: string;
    embeddingRevision?: string;
    policyRevision?: string;
}

Contract members

MemberKindSignatureDescription
contextProfileRevisionpropertycontextProfileRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
embeddingRevisionpropertyembeddingRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryProfileRevisionpropertymemoryProfileRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mutationGenerationpropertymutationGeneration: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRevisionpropertyproviderRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
queryHashpropertyqueryHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
recordSetRevisionpropertyrecordSetRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
selectedMemoryVersionIdspropertyselectedMemoryVersionIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryContextInferenceResult

Memory Context Inference Result interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryContextInferenceResult } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryContextInferenceResult<TOutput = unknown> {
    activity: MemoryActivityResult;
    inferenceOutput: TOutput;
}

Contract members

MemberKindSignatureDescription
activitypropertyactivity: MemoryActivityResultPublic property; its type, readonly modifier and optionality are shown in the signature.
inferenceOutputpropertyinferenceOutput: TOutputPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryEvaluationCase

Memory Evaluation Case interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryEvaluationCase } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryEvaluationCase {
    id: string;
    category: 'extraction' | 'retrieval' | 'context' | 'lifecycle';
    inputRef: string;
    expectedRef?: string;
    metricIds: string[];
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
categorypropertycategory: "lifecycle" | "context" | "extraction" | "retrieval"Public property; its type, readonly modifier and optionality are shown in the signature.
expectedRefpropertyexpectedRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputRefpropertyinputRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
metricIdspropertymetricIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryEvaluationObservation

Memory Evaluation Observation interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryEvaluationObservation } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryEvaluationObservation {
    caseId: string;
    operationId: string;
    traceEventIds: string[];
    memoryVersionIds?: string[];
    retrievalSnapshotId?: string;
    contextHash?: string;
    metrics?: Record<string, number>;
}

Contract members

MemberKindSignatureDescription
caseIdpropertycaseId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contextHashpropertycontextHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryVersionIdspropertymemoryVersionIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
metricspropertymetrics?: Record<string, number>Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retrievalSnapshotIdpropertyretrievalSnapshotId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
traceEventIdspropertytraceEventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryEvaluationPort

Memory Evaluation Port interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryEvaluationPort } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryEvaluationPort {
    record(observation: MemoryEvaluationObservation): Promise<void>;
}

Contract members

MemberKindSignatureDescription
recordmethodrecord(observation: MemoryEvaluationObservation): Promise<void>Public method; parameters and return type are shown in the signature.

MemoryReplayReference

Memory Replay Reference interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryReplayReference } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface MemoryReplayReference {
    operationId: string;
    profileRevision: string;
    scopeHash: string;
    eventIds: string[];
    memoryVersionIds: string[];
    retrievalSnapshotId?: string;
    contextHash?: string;
}

Contract members

MemberKindSignatureDescription
contextHashpropertycontextHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
memoryVersionIdspropertymemoryVersionIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRevisionpropertyprofileRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retrievalSnapshotIdpropertyretrievalSnapshotId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

SessionMemoryBinding

Session Memory Binding interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { SessionMemoryBinding } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface SessionMemoryBinding {
    memoryProfileRef?: SpecRef;
    contextProfileRef?: SpecRef;
    memoryScopeTemplate?: Partial<ManagedMemoryScope>;
    sessionScopeMode?: 'isolated' | 'user_shared' | 'workspace_shared';
}

Contract members

MemberKindSignatureDescription
contextProfileRefpropertycontextProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryProfileRefpropertymemoryProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryScopeTemplatepropertymemoryScopeTemplate?: Partial<ManagedMemoryScope>Public property; its type, readonly modifier and optionality are shown in the signature.
sessionScopeModepropertysessionScopeMode?: "isolated" | "user_shared" | "workspace_shared"Public property; its type, readonly modifier and optionality are shown in the signature.

WorkflowStateMemoryBinding

Workflow State Memory Binding interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { WorkflowStateMemoryBinding } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export interface WorkflowStateMemoryBinding {
    memoryProfileRef?: SpecRef;
    contextProfileRef?: SpecRef;
    extractionProfileRef?: SpecRef;
    readPolicyRef?: SpecRef;
    writePolicyRef?: SpecRef;
    allowedMemoryTypes?: ManagedMemoryType[];
    memoryAccessMode?: 'none' | 'read' | 'write' | 'read_write';
    autoCapture?: boolean;
}

Contract members

MemberKindSignatureDescription
allowedMemoryTypespropertyallowedMemoryTypes?: ManagedMemoryType[]Public property; its type, readonly modifier and optionality are shown in the signature.
autoCapturepropertyautoCapture?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
contextProfileRefpropertycontextProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
extractionProfileRefpropertyextractionProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryAccessModepropertymemoryAccessMode?: "none" | "read" | "write" | "read_write"Public property; its type, readonly modifier and optionality are shown in the signature.
memoryProfileRefpropertymemoryProfileRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
readPolicyRefpropertyreadPolicyRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
writePolicyRefpropertywritePolicyRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryActivityHandler

Public type alias for Memory Activity Handler; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MemoryActivityHandler } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export type MemoryActivityHandler = (request: MemoryActivityRequest, signal?: AbortSignal) => Promise<Omit<MemoryActivityResult, 'operationId'>>;

MemoryActivityOperation

Public type alias for Memory Activity Operation; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MemoryActivityOperation } from '@codesoul-co/hypha-memory';
  • Source module: integration-contracts

Declaration

text
export type MemoryActivityOperation = 'add' | 'extract' | 'search' | 'get' | 'list' | 'update' | 'write' | 'maintain' | 'delete' | 'history' | 'build_context';