@codesoul-co/hypha-memory / memory-utils
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/memory-utils.ts - Exports: 7
Using this module
Use the Memory utils module for using the public contracts and operations for this capability boundary. It exports 7 functions.
Import from the package entrypoint
import {
hashMemoryContent,
hashMemoryScope,
isNormalizedMemoryError,
memoryError,
normalizeMemoryError,
sha256,
stableStringify,
} from '@codesoul-co/hypha-memory';Usage patterns
- The module exposes 7 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
hashMemoryContent | function | hashMemoryContent(content: unknown): string | Hash Memory Content function with 1 public call signature; parameters and return types are listed below. |
hashMemoryScope | function | hashMemoryScope(scope: ManagedMemoryScope): string | Hash Memory Scope function with 1 public call signature; parameters and return types are listed below. |
isNormalizedMemoryError | function | isNormalizedMemoryError(value: unknown): value is NormalizedMemoryError | Is Normalized Memory Error function with 1 public call signature; parameters and return types are listed below. |
memoryError | function | memoryError(code: NormalizedMemoryError["code"], message: string, retryable?: boolean, details?: Record<string, unknown>): NormalizedMemoryError | Memory Error function with 1 public call signature; parameters and return types are listed below. |
normalizeMemoryError | function | normalizeMemoryError(error: unknown, fallbackCode?: NormalizedMemoryError["code"]): NormalizedMemoryError | Normalize Memory Error function with 1 public call signature; parameters and return types are listed below. |
sha256 | function | sha256(value: unknown): string | Sha256 function with 1 public call signature; parameters and return types are listed below. |
stableStringify | function | stableStringify(value: unknown): string | Stable Stringify function with 1 public call signature; parameters and return types are listed below. |
hashMemoryContent
Hash Memory Content function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { hashMemoryContent } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function hashMemoryContent(content: unknown): string;Call signature
hashMemoryContent(content: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
hashMemoryScope
Hash Memory Scope function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { hashMemoryScope } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function hashMemoryScope(scope: ManagedMemoryScope): string;Call signature
hashMemoryScope(scope: ManagedMemoryScope): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope | ManagedMemoryScope | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
isNormalizedMemoryError
Is Normalized Memory Error function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { isNormalizedMemoryError } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function isNormalizedMemoryError(value: unknown): value is NormalizedMemoryError;Call signature
isNormalizedMemoryError(value: unknown): value is NormalizedMemoryErrorParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
value is NormalizedMemoryError - Description: The return contract is defined by the type shown above.
memoryError
Memory Error function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { memoryError } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function memoryError(code: NormalizedMemoryError['code'], message: string, retryable?: boolean, details?: Record<string, unknown>): NormalizedMemoryError;Call signature
memoryError(code: NormalizedMemoryError["code"], message: string, retryable?: boolean, details?: Record<string, unknown>): NormalizedMemoryErrorParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code | "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" | "MEMORY_PROVIDER_TIMEOUT"... | Yes | Required parameter; accepted values are defined by the type column. |
message | string | Yes | Required parameter; accepted values are defined by the type column. |
retryable | boolean | No | Optional parameter; accepted values are defined by the type column. |
details | Record<string, unknown> | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
NormalizedMemoryError - Description: The return contract is defined by the type shown above.
normalizeMemoryError
Normalize Memory Error function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { normalizeMemoryError } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function normalizeMemoryError(error: unknown, fallbackCode?: NormalizedMemoryError['code']): NormalizedMemoryError;Call signature
normalizeMemoryError(error: unknown, fallbackCode?: NormalizedMemoryError["code"]): NormalizedMemoryErrorParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
error | unknown | Yes | Required parameter; accepted values are defined by the type column. |
fallbackCode | "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" | "MEMORY_PROVIDER_TIMEOUT"... | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
NormalizedMemoryError - Description: The return contract is defined by the type shown above.
sha256
Sha256 function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { sha256 } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function sha256(value: unknown): string;Call signature
sha256(value: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
stableStringify
Stable Stringify function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { stableStringify } from '@codesoul-co/hypha-memory'; - Source module:
memory-utils
Declaration
export declare function stableStringify(value: unknown): string;Call signature
stableStringify(value: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
