Skip to content

@codesoul-co/hypha-memory / external-provider-acceptance

Using this module

Use the External provider acceptance module for binding external or local providers to Hypha ports. It exports 2 functions, 6 interfaces.

Import from the package entrypoint

ts
import {
  assertContractShape,
  runExternalProviderAcceptance,
} from '@codesoul-co/hypha-memory';

import type {
  ExternalProviderAcceptanceEvidence,
  ExternalProviderAcceptanceEvidenceInput,
  ExternalProviderAcceptanceFixture,
  ExternalProviderAcceptanceHooks,
  ExternalProviderAcceptanceReport,
  ExternalProviderFailureProbe,
} 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 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
assertContractShapefunctionassertContractShape(client: ExternalMemoryClient): voidAssert Contract Shape function with 1 public call signature; parameters and return types are listed below.
runExternalProviderAcceptancefunctionrunExternalProviderAcceptance(client: ExternalMemoryClient, fixture: ExternalProviderAcceptanceFixture, signal?: AbortSignal, evidenceInput?: ExternalProviderAcceptanceEvidenceInput, hooks?: ExternalProviderAcceptanceHooks): Promise<ExternalProviderAcceptanceReport>Provider-neutral management acceptance flow shared by every external client.
ExternalProviderAcceptanceEvidenceinterfaceinterface ExternalProviderAcceptanceEvidenceExternal Provider Acceptance Evidence interface with 8 public fields or methods.
ExternalProviderAcceptanceEvidenceInputinterfaceinterface ExternalProviderAcceptanceEvidenceInputExternal Provider Acceptance Evidence Input interface with 6 public fields or methods.
ExternalProviderAcceptanceFixtureinterfaceinterface ExternalProviderAcceptanceFixtureExternal Provider Acceptance Fixture interface with 9 public fields or methods.
ExternalProviderAcceptanceHooksinterfaceinterface ExternalProviderAcceptanceHooksExternal Provider Acceptance Hooks interface with 6 public fields or methods.
ExternalProviderAcceptanceReportinterfaceinterface ExternalProviderAcceptanceReportExternal Provider Acceptance Report interface with 15 public fields or methods.
ExternalProviderFailureProbeinterfaceinterface ExternalProviderFailureProbeExternal Provider Failure Probe interface with 3 public fields or methods.

assertContractShape

Assert Contract Shape function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function assertContractShape(client: ExternalMemoryClient): void;

Call signature

text
assertContractShape(client: ExternalMemoryClient): void

Parameters

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

Returns

  • Type: void
  • Description: Returns no value.

runExternalProviderAcceptance

Provider-neutral management acceptance flow shared by every external client.

Declaration

text
export declare function runExternalProviderAcceptance(client: ExternalMemoryClient, fixture: ExternalProviderAcceptanceFixture, signal?: AbortSignal, evidenceInput?: ExternalProviderAcceptanceEvidenceInput, hooks?: ExternalProviderAcceptanceHooks): Promise<ExternalProviderAcceptanceReport>;

Call signature

text
runExternalProviderAcceptance(client: ExternalMemoryClient, fixture: ExternalProviderAcceptanceFixture, signal?: AbortSignal, evidenceInput?: ExternalProviderAcceptanceEvidenceInput, hooks?: ExternalProviderAcceptanceHooks): Promise<ExternalProviderAcceptanceReport>

Provider-neutral management acceptance flow shared by every external client.

Parameters

ParameterTypeRequiredDescription
clientExternalMemoryClientYesRequired parameter; accepted values are defined by the type column.
fixtureExternalProviderAcceptanceFixtureYesRequired parameter; accepted values are defined by the type column.
signalAbortSignalNoOptional parameter; accepted values are defined by the type column.
evidenceInputExternalProviderAcceptanceEvidenceInputNoOptional parameter; accepted values are defined by the type column.
hooksExternalProviderAcceptanceHooksNoOptional parameter; accepted values are defined by the type column.

Returns

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

ExternalProviderAcceptanceEvidence

External Provider Acceptance Evidence interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderAcceptanceEvidence } from '@codesoul-co/hypha-memory';
  • Source module: external-provider-acceptance

Declaration

text
export interface ExternalProviderAcceptanceEvidence {
    commitSha: string;
    providerId: string;
    providerVersion: string;
    profileHash: string;
    capabilitySnapshot: MemoryManagementCapabilities;
    environmentHash: string;
    startedAt: string;
    finishedAt: string;
}

Contract members

MemberKindSignatureDescription
capabilitySnapshotpropertycapabilitySnapshot: MemoryManagementCapabilitiesPublic property; its type, readonly modifier and optionality are shown in the signature.
commitShapropertycommitSha: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentHashpropertyenvironmentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
finishedAtpropertyfinishedAt: 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.
providerVersionpropertyproviderVersion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
startedAtpropertystartedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExternalProviderAcceptanceEvidenceInput

External Provider Acceptance Evidence Input interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderAcceptanceEvidenceInput } from '@codesoul-co/hypha-memory';
  • Source module: external-provider-acceptance

Declaration

text
export interface ExternalProviderAcceptanceEvidenceInput {
    commitSha: string;
    providerId: string;
    providerVersion: string;
    profileHash: string;
    environmentHash: string;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
commitShapropertycommitSha: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentHashpropertyenvironmentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type 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.
providerVersionpropertyproviderVersion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExternalProviderAcceptanceFixture

External Provider Acceptance Fixture interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderAcceptanceFixture } from '@codesoul-co/hypha-memory';
  • Source module: external-provider-acceptance

Declaration

text
export interface ExternalProviderAcceptanceFixture {
    add: MemoryAddRequest;
    search: ManagedMemorySearchRequest;
    list: MemoryListRequest;
    get(memoryId: string): MemoryGetRequest;
    update(memoryId: string): ManagedMemoryUpdateRequest;
    history(memoryId: string): MemoryHistoryRequest;
    delete(memoryId: string): ManagedMemoryDeleteRequest;
    forbiddenGet?(memoryId: string): MemoryGetRequest;
    resolveMemoryId(result: {
        addedIds: string[];
        searchedIds: string[];
        listedIds: string[];
    }): string | undefined;
}

Contract members

MemberKindSignatureDescription
addpropertyadd: MemoryAddRequestPublic property; its type, readonly modifier and optionality are shown in the signature.
deletemethoddelete(memoryId: string): ManagedMemoryDeleteRequestPublic method; parameters and return type are shown in the signature.
forbiddenGetmethodforbiddenGet?(memoryId: string): MemoryGetRequestPublic method; parameters and return type are shown in the signature.
getmethodget(memoryId: string): MemoryGetRequestPublic method; parameters and return type are shown in the signature.
historymethodhistory(memoryId: string): MemoryHistoryRequestPublic method; parameters and return type are shown in the signature.
listpropertylist: MemoryListRequestPublic property; its type, readonly modifier and optionality are shown in the signature.
resolveMemoryIdmethodresolveMemoryId(result: { addedIds: string[]; searchedIds: string[]; listedIds: string[]; }): string | undefinedPublic method; parameters and return type are shown in the signature.
searchpropertysearch: ManagedMemorySearchRequestPublic property; its type, readonly modifier and optionality are shown in the signature.
updatemethodupdate(memoryId: string): ManagedMemoryUpdateRequestPublic method; parameters and return type are shown in the signature.

ExternalProviderAcceptanceHooks

External Provider Acceptance Hooks interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderAcceptanceHooks } from '@codesoul-co/hypha-memory';
  • Source module: external-provider-acceptance

Declaration

text
export interface ExternalProviderAcceptanceHooks {
    settleAdd?(result: ManagedMemoryWriteResult, signal?: AbortSignal): Promise<void>;
    preparePagination?(signal?: AbortSignal): Promise<void>;
    verifyRestart?(memoryId: string, signal?: AbortSignal): Promise<void>;
    verifyDelete?(memoryId: string, signal?: AbortSignal): Promise<void>;
    failureProbes?: readonly ExternalProviderFailureProbe[];
    cleanup?(signal?: AbortSignal): Promise<void>;
}

Contract members

MemberKindSignatureDescription
cleanupmethodcleanup?(signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.
failureProbespropertyfailureProbes?: readonly ExternalProviderFailureProbe[]Public property; its type, readonly modifier and optionality are shown in the signature.
preparePaginationmethodpreparePagination?(signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.
settleAddmethodsettleAdd?(result: ManagedMemoryWriteResult, signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.
verifyDeletemethodverifyDelete?(memoryId: string, signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.
verifyRestartmethodverifyRestart?(memoryId: string, signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.

ExternalProviderAcceptanceReport

External Provider Acceptance Report interface with 15 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderAcceptanceReport } from '@codesoul-co/hypha-memory';
  • Source module: external-provider-acceptance

Declaration

text
export interface ExternalProviderAcceptanceReport {
    status: 'passed';
    capabilities: MemoryManagementCapabilities;
    memoryId: string;
    addStatus: string;
    searchCount: number;
    listCount: number;
    updateStatus?: string;
    historyCount?: number;
    deleteStatus: string;
    healthStatus: string;
    paginationPageCount: number;
    scopeIsolationVerified: boolean;
    restartVerified: boolean;
    failureProbeCount: number;
    evidence?: ExternalProviderAcceptanceEvidence;
}

Contract members

MemberKindSignatureDescription
addStatuspropertyaddStatus: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
capabilitiespropertycapabilities: MemoryManagementCapabilitiesPublic property; its type, readonly modifier and optionality are shown in the signature.
deleteStatuspropertydeleteStatus: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
evidencepropertyevidence?: ExternalProviderAcceptanceEvidencePublic property; its type, readonly modifier and optionality are shown in the signature.
failureProbeCountpropertyfailureProbeCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
healthStatuspropertyhealthStatus: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
historyCountpropertyhistoryCount?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
listCountpropertylistCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryIdpropertymemoryId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
paginationPageCountpropertypaginationPageCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
restartVerifiedpropertyrestartVerified: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeIsolationVerifiedpropertyscopeIsolationVerified: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
searchCountpropertysearchCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "passed"Public property; its type, readonly modifier and optionality are shown in the signature.
updateStatuspropertyupdateStatus?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExternalProviderFailureProbe

External Provider Failure Probe interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderFailureProbe } from '@codesoul-co/hypha-memory';
  • Source module: external-provider-acceptance

Declaration

text
export interface ExternalProviderFailureProbe {
    id: string;
    expectedCodes: readonly NormalizedMemoryError['code'][];
    run(signal?: AbortSignal): Promise<void>;
}

Contract members

MemberKindSignatureDescription
expectedCodespropertyexpectedCodes: readonly ("MEMORY_INVALID_INPUT" | "MEMORY_EXTRACTION_SOURCE_UNAVAILABLE" | "MEMORY_EXTRACTION_FAILED" | "MEMORY_EXTRACTION_CURSOR_CONFLICT" | "MEMORY_MAINTENANCE_CONFLICT" | "MEMORY_RANKING_FAILED" | "MEMORY_IDEMPOTENCY_CONFLICT" | "MEMORY_SCOPE_DENIED" | "MEMORY_PERMISSION_DENIED" | "MEMORY_NOT_FOUND" | "MEMORY_REVISION_CONFLICT" | "MEMORY_PROVIDER_NOT_INSTALLED" | "MEMORY_PROVIDER_UNAVAILABLE" | ...Public 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.
runmethodrun(signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.