@codesoul-co/hypha-memory / memory-runtime-coordinator
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/memory-runtime-coordinator.ts - Exports: 12
Using this module
Use the Memory runtime coordinator module for executing runtime behavior at this boundary. It exports 3 classes, 8 interfaces, 1 type.
Import from the package entrypoint
import {
InMemoryMemoryRuntimeControlStore,
MemoryRuntimeCoordinator,
StructuredMemoryRuntimeControlStore,
} from '@codesoul-co/hypha-memory';
import type {
MemoryRuntimeActiveState,
MemoryRuntimeControlStore,
MemoryRuntimeCoordinatorOptions,
MemoryRuntimeCreator,
MemoryRuntimeGeneration,
MemoryRuntimeRevisionState,
MemoryRuntimeSwitchResult,
StructuredMemoryRuntimeControlStoreOptions,
} 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 3 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
InMemoryMemoryRuntimeControlStore | class | new InMemoryMemoryRuntimeControlStore(): InMemoryMemoryRuntimeControlStore | In Memory Memory Runtime Control Store class with 7 public constructor or member entries; its exact declarations are listed below. |
MemoryRuntimeCoordinator | class | new MemoryRuntimeCoordinator(options: MemoryRuntimeCoordinatorOptions): MemoryRuntimeCoordinator | Memory Runtime Coordinator class with 8 public constructor or member entries; its exact declarations are listed below. |
StructuredMemoryRuntimeControlStore | class | new StructuredMemoryRuntimeControlStore(options: StructuredMemoryRuntimeControlStoreOptions): StructuredMemoryRuntimeControlStore | Structured Memory Runtime Control Store class with 7 public constructor or member entries; its exact declarations are listed below. |
MemoryRuntimeActiveState | interface | interface MemoryRuntimeActiveState extends MemoryRuntimeRevisionState | Memory Runtime Active State interface with 14 public fields or methods. |
MemoryRuntimeControlStore | interface | interface MemoryRuntimeControlStore | Memory Runtime Control Store interface with 6 public fields or methods. |
MemoryRuntimeCoordinatorOptions | interface | interface MemoryRuntimeCoordinatorOptions | Memory Runtime Coordinator Options interface with 6 public fields or methods. |
MemoryRuntimeCreator | interface | interface MemoryRuntimeCreator | Memory Runtime Creator interface with 1 public fields or methods. |
MemoryRuntimeGeneration | interface | interface MemoryRuntimeGeneration | Memory Runtime Generation interface with 6 public fields or methods. |
MemoryRuntimeRevisionState | interface | interface MemoryRuntimeRevisionState | Memory Runtime Revision State interface with 14 public fields or methods. |
MemoryRuntimeSwitchResult | interface | interface MemoryRuntimeSwitchResult extends MemoryRuntimeGeneration | Memory Runtime Switch Result interface with 7 public fields or methods. |
StructuredMemoryRuntimeControlStoreOptions | interface | interface StructuredMemoryRuntimeControlStoreOptions | Structured Memory Runtime Control Store Options interface with 3 public fields or methods. |
MemoryRuntimeRevisionStatus | type | type MemoryRuntimeRevisionStatus = 'active' | 'draining' | 'retired' | 'quarantined' | Public type alias for Memory Runtime Revision Status; the declaration contains its complete type expression. |
InMemoryMemoryRuntimeControlStore
In Memory Memory Runtime Control Store class with 7 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryMemoryRuntimeControlStore } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export declare class InMemoryMemoryRuntimeControlStore implements MemoryRuntimeControlStore {
readonly durability: "ephemeral";
getActive(coordinatorId: string): Promise<MemoryRuntimeActiveState | null>;
activate(coordinatorId: string, expectedGeneration: number | null, next: MemoryRuntimeActiveState, previous?: MemoryRuntimeRevisionState): Promise<boolean>;
getRevision(coordinatorId: string, profileRevision: string): Promise<MemoryRuntimeRevisionState | null>;
setRevision(state: MemoryRuntimeRevisionState): Promise<void>;
listRevisions(coordinatorId: string): Promise<MemoryRuntimeRevisionState[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
activate | method | activate(coordinatorId: string, expectedGeneration: number | null, next: MemoryRuntimeActiveState, previous?: MemoryRuntimeRevisionState): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (): InMemoryMemoryRuntimeControlStore | Creates an instance of this class. |
durability | property | readonly durability: "ephemeral" | Public property; its type, readonly modifier and optionality are shown in the signature. |
getActive | method | getActive(coordinatorId: string): Promise<MemoryRuntimeActiveState | null> | Public method; parameters and return type are shown in the signature. |
getRevision | method | getRevision(coordinatorId: string, profileRevision: string): Promise<MemoryRuntimeRevisionState | null> | Public method; parameters and return type are shown in the signature. |
listRevisions | method | listRevisions(coordinatorId: string): Promise<MemoryRuntimeRevisionState[]> | Public method; parameters and return type are shown in the signature. |
setRevision | method | setRevision(state: MemoryRuntimeRevisionState): Promise<void> | Public method; parameters and return type are shown in the signature. |
MemoryRuntimeCoordinator
Memory Runtime Coordinator class with 8 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { MemoryRuntimeCoordinator } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export declare class MemoryRuntimeCoordinator {
constructor(options: MemoryRuntimeCoordinatorOptions);
initialize(input: unknown, references?: ReadonlyMap<string, unknown>): Promise<MemoryRuntimeSwitchResult>;
switchRevision(input: unknown, references?: ReadonlyMap<string, unknown>, expectedProfileRevision?: string): Promise<MemoryRuntimeSwitchResult>;
withRuntime<T>(operation: (runtime: MemoryRuntime, generation: MemoryRuntimeGeneration) => Promise<T>): Promise<T>;
probeActive(): Promise<MemoryRuntimeRevisionState>;
current(): MemoryRuntimeGeneration | null;
drain(): Promise<void>;
close(): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
close | method | close(): Promise<void> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: MemoryRuntimeCoordinatorOptions): MemoryRuntimeCoordinator | Creates an instance of this class. |
current | method | current(): MemoryRuntimeGeneration | null | Public method; parameters and return type are shown in the signature. |
drain | method | drain(): Promise<void> | Public method; parameters and return type are shown in the signature. |
initialize | method | initialize(input: unknown, references?: ReadonlyMap<string, unknown>): Promise<MemoryRuntimeSwitchResult> | Public method; parameters and return type are shown in the signature. |
probeActive | method | probeActive(): Promise<MemoryRuntimeRevisionState> | Public method; parameters and return type are shown in the signature. |
switchRevision | method | switchRevision(input: unknown, references?: ReadonlyMap<string, unknown>, expectedProfileRevision?: string): Promise<MemoryRuntimeSwitchResult> | Public method; parameters and return type are shown in the signature. |
withRuntime | method | withRuntime<T>(operation: (runtime: MemoryRuntime, generation: MemoryRuntimeGeneration) => Promise<T>): Promise<T> | Public method; parameters and return type are shown in the signature. |
StructuredMemoryRuntimeControlStore
Structured Memory Runtime Control Store class with 7 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { StructuredMemoryRuntimeControlStore } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export declare class StructuredMemoryRuntimeControlStore implements MemoryRuntimeControlStore {
readonly durability: "durable";
constructor(options: StructuredMemoryRuntimeControlStoreOptions);
getActive(coordinatorId: string): Promise<MemoryRuntimeActiveState | null>;
activate(coordinatorId: string, expectedGeneration: number | null, next: MemoryRuntimeActiveState, previous?: MemoryRuntimeRevisionState): Promise<boolean>;
getRevision(coordinatorId: string, profileRevision: string): Promise<MemoryRuntimeRevisionState | null>;
setRevision(state: MemoryRuntimeRevisionState): Promise<void>;
listRevisions(coordinatorId: string): Promise<MemoryRuntimeRevisionState[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
activate | method | activate(coordinatorId: string, expectedGeneration: number | null, next: MemoryRuntimeActiveState, previous?: MemoryRuntimeRevisionState): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: StructuredMemoryRuntimeControlStoreOptions): StructuredMemoryRuntimeControlStore | Creates an instance of this class. |
durability | property | readonly durability: "durable" | Public property; its type, readonly modifier and optionality are shown in the signature. |
getActive | method | getActive(coordinatorId: string): Promise<MemoryRuntimeActiveState | null> | Public method; parameters and return type are shown in the signature. |
getRevision | method | getRevision(coordinatorId: string, profileRevision: string): Promise<MemoryRuntimeRevisionState | null> | Public method; parameters and return type are shown in the signature. |
listRevisions | method | listRevisions(coordinatorId: string): Promise<MemoryRuntimeRevisionState[]> | Public method; parameters and return type are shown in the signature. |
setRevision | method | setRevision(state: MemoryRuntimeRevisionState): Promise<void> | Public method; parameters and return type are shown in the signature. |
MemoryRuntimeActiveState
Memory Runtime Active State interface with 14 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeActiveState } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeActiveState extends MemoryRuntimeRevisionState {
id: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilityHash | property | capabilityHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
capabilitySnapshot | property | capabilitySnapshot: MemoryManagementCapabilities | Public property; its type, readonly modifier and optionality are shown in the signature. |
coordinatorId | property | coordinatorId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
generation | property | generation: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
observedAt | property | observedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileHash | property | profileHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileId | property | profileId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileRevision | property | profileRevision: 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. |
providerRevision | property | providerRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
quarantineError | property | quarantineError?: NormalizedMemoryError | Public property; its type, readonly modifier and optionality are shown in the signature. |
runtimeId | property | runtimeId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: MemoryRuntimeRevisionStatus | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryRuntimeControlStore
Memory Runtime Control Store interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeControlStore } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeControlStore {
readonly durability: 'ephemeral' | 'durable';
getActive(coordinatorId: string): Promise<MemoryRuntimeActiveState | null>;
activate(coordinatorId: string, expectedGeneration: number | null, next: MemoryRuntimeActiveState, previous?: MemoryRuntimeRevisionState): Promise<boolean>;
getRevision(coordinatorId: string, profileRevision: string): Promise<MemoryRuntimeRevisionState | null>;
setRevision(state: MemoryRuntimeRevisionState): Promise<void>;
listRevisions(coordinatorId: string): Promise<MemoryRuntimeRevisionState[]>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
activate | method | activate(coordinatorId: string, expectedGeneration: number | null, next: MemoryRuntimeActiveState, previous?: MemoryRuntimeRevisionState): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
durability | property | readonly durability: "ephemeral" | "durable" | Public property; its type, readonly modifier and optionality are shown in the signature. |
getActive | method | getActive(coordinatorId: string): Promise<MemoryRuntimeActiveState | null> | Public method; parameters and return type are shown in the signature. |
getRevision | method | getRevision(coordinatorId: string, profileRevision: string): Promise<MemoryRuntimeRevisionState | null> | Public method; parameters and return type are shown in the signature. |
listRevisions | method | listRevisions(coordinatorId: string): Promise<MemoryRuntimeRevisionState[]> | Public method; parameters and return type are shown in the signature. |
setRevision | method | setRevision(state: MemoryRuntimeRevisionState): Promise<void> | Public method; parameters and return type are shown in the signature. |
MemoryRuntimeCoordinatorOptions
Memory Runtime Coordinator Options interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeCoordinatorOptions } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeCoordinatorOptions {
id: string;
factory: MemoryRuntimeFactory | MemoryRuntimeCreator;
store: MemoryRuntimeControlStore;
requireDurableStore?: boolean;
now?: () => Date;
capabilityProbeIntervalMs?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilityProbeIntervalMs | property | capabilityProbeIntervalMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
factory | property | factory: MemoryRuntimeFactory | MemoryRuntimeCreator | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
now | method | now?(): Date | Public method; parameters and return type are shown in the signature. |
requireDurableStore | property | requireDurableStore?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
store | property | store: MemoryRuntimeControlStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryRuntimeCreator
Memory Runtime Creator interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeCreator } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeCreator {
create(input: unknown, references?: ReadonlyMap<string, unknown>): Promise<MemoryRuntime>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
create | method | create(input: unknown, references?: ReadonlyMap<string, unknown>): Promise<MemoryRuntime> | Public method; parameters and return type are shown in the signature. |
MemoryRuntimeGeneration
Memory Runtime Generation interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeGeneration } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeGeneration {
generation: number;
profileId: string;
profileRevision: string;
providerId: string;
providerRevision: string;
runtimeId: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
generation | property | generation: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileId | property | profileId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileRevision | property | profileRevision: 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. |
providerRevision | property | providerRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runtimeId | property | runtimeId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryRuntimeRevisionState
Memory Runtime Revision State interface with 14 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeRevisionState } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeRevisionState {
id: string;
coordinatorId: string;
profileId: string;
profileRevision: string;
providerId: string;
providerRevision: string;
runtimeId: string;
profileHash: string;
capabilityHash: string;
capabilitySnapshot: MemoryManagementCapabilities;
status: MemoryRuntimeRevisionStatus;
generation: number;
observedAt: string;
quarantineError?: NormalizedMemoryError;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilityHash | property | capabilityHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
capabilitySnapshot | property | capabilitySnapshot: MemoryManagementCapabilities | Public property; its type, readonly modifier and optionality are shown in the signature. |
coordinatorId | property | coordinatorId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
generation | property | generation: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
observedAt | property | observedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileHash | property | profileHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileId | property | profileId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileRevision | property | profileRevision: 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. |
providerRevision | property | providerRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
quarantineError | property | quarantineError?: NormalizedMemoryError | Public property; its type, readonly modifier and optionality are shown in the signature. |
runtimeId | property | runtimeId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: MemoryRuntimeRevisionStatus | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryRuntimeSwitchResult
Memory Runtime Switch Result interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { MemoryRuntimeSwitchResult } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface MemoryRuntimeSwitchResult extends MemoryRuntimeGeneration {
previousProfileRevision?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
generation | property | generation: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
previousProfileRevision | property | previousProfileRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileId | property | profileId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileRevision | property | profileRevision: 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. |
providerRevision | property | providerRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runtimeId | property | runtimeId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
StructuredMemoryRuntimeControlStoreOptions
Structured Memory Runtime Control Store Options interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { StructuredMemoryRuntimeControlStoreOptions } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export interface StructuredMemoryRuntimeControlStoreOptions {
provider: StructuredStoreProvider;
activeTable?: string;
revisionTable?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
activeTable | property | activeTable?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
provider | property | provider: StructuredStoreProvider | Public property; its type, readonly modifier and optionality are shown in the signature. |
revisionTable | property | revisionTable?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryRuntimeRevisionStatus
Public type alias for Memory Runtime Revision Status; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { MemoryRuntimeRevisionStatus } from '@codesoul-co/hypha-memory'; - Source module:
memory-runtime-coordinator
Declaration
export type MemoryRuntimeRevisionStatus = 'active' | 'draining' | 'retired' | 'quarantined';