Skip to content

@codesoul-co/hypha-memory / dead-letter-management

Using this module

Use the Dead letter management module for using the public contracts and operations for this capability boundary. It exports 2 classes, 2 functions, 5 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  InMemoryMemoryDeadLetterRepository,
  MemoryDeadLetterManager,
  deadLetterFromTask,
  inspectMemoryLifecycleDeadLetters,
} from '@codesoul-co/hypha-memory';

import type {
  DeadLetterDispositionRequest,
  MemoryDeadLetterInspection,
  MemoryDeadLetterQuery,
  MemoryDeadLetterRecord,
  MemoryDeadLetterRepository,
  MemoryDeadLetterState,
} from '@codesoul-co/hypha-memory';

Usage patterns

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

Public exports

SymbolKindSignatureDescription
InMemoryMemoryDeadLetterRepositoryclassnew InMemoryMemoryDeadLetterRepository(): InMemoryMemoryDeadLetterRepositoryIn Memory Memory Dead Letter Repository class with 4 public constructor or member entries; its exact declarations are listed below.
MemoryDeadLetterManagerclassnew MemoryDeadLetterManager(repository: MemoryDeadLetterRepository): MemoryDeadLetterManagerMemory Dead Letter Manager class with 4 public constructor or member entries; its exact declarations are listed below.
deadLetterFromTaskfunctiondeadLetterFromTask(task: MemoryLifecycleTask, occurredAt?: string): MemoryDeadLetterRecordDead Letter From Task function with 1 public call signature; parameters and return types are listed below.
inspectMemoryLifecycleDeadLettersfunctioninspectMemoryLifecycleDeadLetters(store: MemoryLifecycleTaskStore, query?: { workerType?: MemoryLifecycleWorkerType; scopeHash?: string; }): Promise<MemoryDeadLetterInspection[]>Returns operator-safe DLQ metadata without exposing task payloads or Provider messages.
DeadLetterDispositionRequestinterfaceinterface DeadLetterDispositionRequestDead Letter Disposition Request interface with 7 public fields or methods.
MemoryDeadLetterInspectioninterfaceinterface MemoryDeadLetterInspectionMemory Dead Letter Inspection interface with 9 public fields or methods.
MemoryDeadLetterQueryinterfaceinterface MemoryDeadLetterQueryMemory Dead Letter Query interface with 4 public fields or methods.
MemoryDeadLetterRecordinterfaceinterface MemoryDeadLetterRecordMemory Dead Letter Record interface with 14 public fields or methods.
MemoryDeadLetterRepositoryinterfaceinterface MemoryDeadLetterRepositoryMemory Dead Letter Repository interface with 3 public fields or methods.
MemoryDeadLetterStatetypetype MemoryDeadLetterState = 'dead_letter' | 'replay_queued' | 'discarded'Public type alias for Memory Dead Letter State; the declaration contains its complete type expression.

InMemoryMemoryDeadLetterRepository

In Memory Memory Dead Letter Repository class with 4 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { InMemoryMemoryDeadLetterRepository } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export declare class InMemoryMemoryDeadLetterRepository implements MemoryDeadLetterRepository {
    get(id: string): Promise<MemoryDeadLetterRecord | null>;
    list(query?: MemoryDeadLetterQuery): Promise<MemoryDeadLetterRecord[]>;
    set(record: MemoryDeadLetterRecord): Promise<void>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(): InMemoryMemoryDeadLetterRepositoryCreates an instance of this class.
getmethodget(id: string): Promise<MemoryDeadLetterRecord | null>Public method; parameters and return type are shown in the signature.
listmethodlist(query?: MemoryDeadLetterQuery): Promise<MemoryDeadLetterRecord[]>Public method; parameters and return type are shown in the signature.
setmethodset(record: MemoryDeadLetterRecord): Promise<void>Public method; parameters and return type are shown in the signature.

MemoryDeadLetterManager

Memory Dead Letter Manager class with 4 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { MemoryDeadLetterManager } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export declare class MemoryDeadLetterManager {
    constructor(repository: MemoryDeadLetterRepository);
    query(input?: MemoryDeadLetterQuery): Promise<MemoryDeadLetterRecord[]>;
    replay(request: DeadLetterDispositionRequest): Promise<MemoryDeadLetterRecord>;
    discard(request: DeadLetterDispositionRequest): Promise<MemoryDeadLetterRecord>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(repository: MemoryDeadLetterRepository): MemoryDeadLetterManagerCreates an instance of this class.
discardmethoddiscard(request: DeadLetterDispositionRequest): Promise<MemoryDeadLetterRecord>Public method; parameters and return type are shown in the signature.
querymethodquery(input?: MemoryDeadLetterQuery): Promise<MemoryDeadLetterRecord[]>Public method; parameters and return type are shown in the signature.
replaymethodreplay(request: DeadLetterDispositionRequest): Promise<MemoryDeadLetterRecord>Public method; parameters and return type are shown in the signature.

deadLetterFromTask

Dead Letter From Task function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { deadLetterFromTask } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export declare function deadLetterFromTask(task: MemoryLifecycleTask, occurredAt?: string): MemoryDeadLetterRecord;

Call signature

text
deadLetterFromTask(task: MemoryLifecycleTask, occurredAt?: string): MemoryDeadLetterRecord

Parameters

ParameterTypeRequiredDescription
taskMemoryLifecycleTask<unknown>YesRequired parameter; accepted values are defined by the type column.
occurredAtstringNoOptional parameter; accepted values are defined by the type column.

Returns

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

inspectMemoryLifecycleDeadLetters

Returns operator-safe DLQ metadata without exposing task payloads or Provider messages.

  • Kind: function
  • Import: import { inspectMemoryLifecycleDeadLetters } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export declare function inspectMemoryLifecycleDeadLetters(store: MemoryLifecycleTaskStore, query?: {
    workerType?: MemoryLifecycleWorkerType;
    scopeHash?: string;
}): Promise<MemoryDeadLetterInspection[]>;

Call signature

text
inspectMemoryLifecycleDeadLetters(store: MemoryLifecycleTaskStore, query?: { workerType?: MemoryLifecycleWorkerType; scopeHash?: string; }): Promise<MemoryDeadLetterInspection[]>

Returns operator-safe DLQ metadata without exposing task payloads or Provider messages.

Parameters

ParameterTypeRequiredDescription
storeMemoryLifecycleTaskStoreYesRequired parameter; accepted values are defined by the type column.
query{ workerType?: MemoryLifecycleWorkerType; scopeHash?: string; }NoOptional parameter; accepted values are defined by the type column.

Returns

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

DeadLetterDispositionRequest

Dead Letter Disposition Request interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { DeadLetterDispositionRequest } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export interface DeadLetterDispositionRequest {
    deadLetterId: string;
    actorId: string;
    reason: string;
    expectedFailureFingerprint: string;
    confirmation: 'replay' | 'discard';
    idempotencyKey?: string;
    occurredAt?: string;
}

Contract members

MemberKindSignatureDescription
actorIdpropertyactorId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
confirmationpropertyconfirmation: "replay" | "discard"Public property; its type, readonly modifier and optionality are shown in the signature.
deadLetterIdpropertydeadLetterId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedFailureFingerprintpropertyexpectedFailureFingerprint: stringPublic 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.
occurredAtpropertyoccurredAt?: 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.

MemoryDeadLetterInspection

Memory Dead Letter Inspection interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryDeadLetterInspection } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export interface MemoryDeadLetterInspection {
    taskId: string;
    operationId: string;
    workerType: MemoryLifecycleWorkerType;
    scopeHash: string;
    attempts: number;
    error: Pick<NormalizedMemoryError, 'code' | 'retryable' | 'providerCode'>;
    payloadHash: string;
    createdAt: string;
    updatedAt: string;
}

Contract members

MemberKindSignatureDescription
attemptspropertyattempts: numberPublic 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.
errorpropertyerror: Pick<NormalizedMemoryError, "code" | "retryable" | "providerCode">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.
payloadHashpropertypayloadHash: 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.
taskIdpropertytaskId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workerTypepropertyworkerType: MemoryLifecycleWorkerTypePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryDeadLetterQuery

Memory Dead Letter Query interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryDeadLetterQuery } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export interface MemoryDeadLetterQuery {
    workerType?: MemoryLifecycleWorkerType;
    scopeHash?: string;
    state?: MemoryDeadLetterState;
    failureFingerprint?: string;
}

Contract members

MemberKindSignatureDescription
failureFingerprintpropertyfailureFingerprint?: 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.
statepropertystate?: MemoryDeadLetterStatePublic property; its type, readonly modifier and optionality are shown in the signature.
workerTypepropertyworkerType?: MemoryLifecycleWorkerTypePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryDeadLetterRecord

Memory Dead Letter Record interface with 14 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryDeadLetterRecord } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export interface MemoryDeadLetterRecord {
    id: string;
    taskId: string;
    operationId: string;
    workerType: MemoryLifecycleWorkerType;
    scopeHash: string;
    state: MemoryDeadLetterState;
    attempts: number;
    failure: NormalizedMemoryError;
    failureFingerprint: string;
    payload: unknown;
    idempotencyKey?: string;
    createdAt: string;
    updatedAt: string;
    disposition?: {
        actorId: string;
        reason: string;
        occurredAt: string;
    };
}

Contract members

MemberKindSignatureDescription
attemptspropertyattempts: numberPublic 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.
dispositionpropertydisposition?: { actorId: string; reason: string; occurredAt: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
failurepropertyfailure: NormalizedMemoryErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
failureFingerprintpropertyfailureFingerprint: 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.
idempotencyKeypropertyidempotencyKey?: 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.
payloadpropertypayload: unknownPublic 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.
statepropertystate: MemoryDeadLetterStatePublic property; its type, readonly modifier and optionality are shown in the signature.
taskIdpropertytaskId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workerTypepropertyworkerType: MemoryLifecycleWorkerTypePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryDeadLetterRepository

Memory Dead Letter Repository interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryDeadLetterRepository } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export interface MemoryDeadLetterRepository {
    get(id: string): Promise<MemoryDeadLetterRecord | null>;
    list(query?: MemoryDeadLetterQuery): Promise<MemoryDeadLetterRecord[]>;
    set(record: MemoryDeadLetterRecord): Promise<void>;
}

Contract members

MemberKindSignatureDescription
getmethodget(id: string): Promise<MemoryDeadLetterRecord | null>Public method; parameters and return type are shown in the signature.
listmethodlist(query?: MemoryDeadLetterQuery): Promise<MemoryDeadLetterRecord[]>Public method; parameters and return type are shown in the signature.
setmethodset(record: MemoryDeadLetterRecord): Promise<void>Public method; parameters and return type are shown in the signature.

MemoryDeadLetterState

Public type alias for Memory Dead Letter State; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MemoryDeadLetterState } from '@codesoul-co/hypha-memory';
  • Source module: dead-letter-management

Declaration

text
export type MemoryDeadLetterState = 'dead_letter' | 'replay_queued' | 'discarded';