@codesoul-co/hypha-memory / context-artifacts
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/context-artifacts.ts - Exports: 11
Using this module
Use the Context artifacts module for using the public contracts and operations for this capability boundary. It exports 2 classes, 2 functions, 6 interfaces, 1 type.
Import from the package entrypoint
import {
InMemoryContextArtifactStore,
ProviderBackedContextArtifactStore,
contextArtifactContentHash,
validateContextArtifactReference,
} from '@codesoul-co/hypha-memory';
import type {
ContextArtifactReadExpectation,
ContextArtifactRecord,
ContextArtifactRef,
ContextArtifactStore,
ContextArtifactWriteRequest,
ProviderBackedContextArtifactStoreOptions,
InMemoryContextArtifactBacking,
} from '@codesoul-co/hypha-memory';Usage patterns
- Use the 7 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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
InMemoryContextArtifactStore | class | new InMemoryContextArtifactStore(records?: InMemoryContextArtifactBacking): InMemoryContextArtifactStore | In Memory Context Artifact Store class with 5 public constructor or member entries; its exact declarations are listed below. |
ProviderBackedContextArtifactStore | class | new ProviderBackedContextArtifactStore(options: ProviderBackedContextArtifactStoreOptions): ProviderBackedContextArtifactStore | Provider Backed Context Artifact Store class with 5 public constructor or member entries; its exact declarations are listed below. |
contextArtifactContentHash | function | contextArtifactContentHash(content: string): string | Context Artifact Content Hash function with 1 public call signature; parameters and return types are listed below. |
validateContextArtifactReference | function | validateContextArtifactReference(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): void | Validate Context Artifact Reference function with 1 public call signature; parameters and return types are listed below. |
ContextArtifactReadExpectation | interface | interface ContextArtifactReadExpectation | Context Artifact Read Expectation interface with 2 public fields or methods. |
ContextArtifactRecord | interface | interface ContextArtifactRecord | Context Artifact Record interface with 2 public fields or methods. |
ContextArtifactRef | interface | interface ContextArtifactRef | Context Artifact Ref interface with 10 public fields or methods. |
ContextArtifactStore | interface | interface ContextArtifactStore | Context Artifact Store interface with 4 public fields or methods. |
ContextArtifactWriteRequest | interface | interface ContextArtifactWriteRequest | Context Artifact Write Request interface with 6 public fields or methods. |
ProviderBackedContextArtifactStoreOptions | interface | interface ProviderBackedContextArtifactStoreOptions | Provider Backed Context Artifact Store Options interface with 2 public fields or methods. |
InMemoryContextArtifactBacking | type | type InMemoryContextArtifactBacking = Map<string, ContextArtifactRecord> | Public type alias for In Memory Context Artifact Backing; the declaration contains its complete type expression. |
InMemoryContextArtifactStore
In Memory Context Artifact Store class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryContextArtifactStore } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export declare class InMemoryContextArtifactStore implements ContextArtifactStore {
readonly durability: "ephemeral";
constructor(records?: InMemoryContextArtifactBacking);
put(request: ContextArtifactWriteRequest): Promise<ContextArtifactRef>;
read(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): Promise<string>;
delete(reference: ContextArtifactRef): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (records?: InMemoryContextArtifactBacking): InMemoryContextArtifactStore | Creates an instance of this class. |
delete | method | delete(reference: ContextArtifactRef): Promise<void> | Public method; parameters and return type are shown in the signature. |
durability | property | readonly durability: "ephemeral" | Public property; its type, readonly modifier and optionality are shown in the signature. |
put | method | put(request: ContextArtifactWriteRequest): Promise<ContextArtifactRef> | Public method; parameters and return type are shown in the signature. |
read | method | read(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): Promise<string> | Public method; parameters and return type are shown in the signature. |
ProviderBackedContextArtifactStore
Provider Backed Context Artifact Store class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { ProviderBackedContextArtifactStore } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export declare class ProviderBackedContextArtifactStore implements ContextArtifactStore {
readonly durability: 'ephemeral' | 'durable';
constructor(options: ProviderBackedContextArtifactStoreOptions);
put(request: ContextArtifactWriteRequest): Promise<ContextArtifactRef>;
read(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): Promise<string>;
delete(reference: ContextArtifactRef): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (options: ProviderBackedContextArtifactStoreOptions): ProviderBackedContextArtifactStore | Creates an instance of this class. |
delete | method | delete(reference: ContextArtifactRef): Promise<void> | 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. |
put | method | put(request: ContextArtifactWriteRequest): Promise<ContextArtifactRef> | Public method; parameters and return type are shown in the signature. |
read | method | read(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): Promise<string> | Public method; parameters and return type are shown in the signature. |
contextArtifactContentHash
Context Artifact Content Hash function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { contextArtifactContentHash } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export declare function contextArtifactContentHash(content: string): string;Call signature
contextArtifactContentHash(content: string): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | 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.
validateContextArtifactReference
Validate Context Artifact Reference function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { validateContextArtifactReference } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export declare function validateContextArtifactReference(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): void;Call signature
validateContextArtifactReference(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): voidParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | ContextArtifactRef | Yes | Required parameter; accepted values are defined by the type column. |
expected | ContextArtifactReadExpectation | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
void - Description: Returns no value.
ContextArtifactReadExpectation
Context Artifact Read Expectation interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { ContextArtifactReadExpectation } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export interface ContextArtifactReadExpectation {
scopeHash: string;
profileRevision: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
profileRevision | property | profileRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scopeHash | property | scopeHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ContextArtifactRecord
Context Artifact Record interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { ContextArtifactRecord } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export interface ContextArtifactRecord {
reference: ContextArtifactRef;
content: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
content | property | content: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reference | property | reference: ContextArtifactRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
ContextArtifactRef
Context Artifact Ref interface with 10 public fields or methods.
- Kind: interface
- Import:
import type { ContextArtifactRef } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export interface ContextArtifactRef {
id: string;
path: string;
contentHash: string;
sizeBytes: number;
contentType: 'text/plain; charset=utf-8';
scopeHash: string;
profileRevision: string;
sourceItemId: string;
createdAt: string;
expiresAt?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
contentHash | property | contentHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contentType | property | contentType: "text/plain; charset=utf-8" | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt?: string | 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. |
path | property | path: 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. |
scopeHash | property | scopeHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sizeBytes | property | sizeBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceItemId | property | sourceItemId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ContextArtifactStore
Context Artifact Store interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { ContextArtifactStore } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export interface ContextArtifactStore {
readonly durability: 'ephemeral' | 'durable';
put(request: ContextArtifactWriteRequest): Promise<ContextArtifactRef>;
read(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): Promise<string>;
delete(reference: ContextArtifactRef): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
delete | method | delete(reference: ContextArtifactRef): Promise<void> | 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. |
put | method | put(request: ContextArtifactWriteRequest): Promise<ContextArtifactRef> | Public method; parameters and return type are shown in the signature. |
read | method | read(reference: ContextArtifactRef, expected: ContextArtifactReadExpectation): Promise<string> | Public method; parameters and return type are shown in the signature. |
ContextArtifactWriteRequest
Context Artifact Write Request interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { ContextArtifactWriteRequest } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export interface ContextArtifactWriteRequest {
content: string;
scopeHash: string;
profileRevision: string;
sourceItemId: string;
createdAt: string;
expiresAt?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
content | property | content: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt?: 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. |
scopeHash | property | scopeHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceItemId | property | sourceItemId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ProviderBackedContextArtifactStoreOptions
Provider Backed Context Artifact Store Options interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { ProviderBackedContextArtifactStoreOptions } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export interface ProviderBackedContextArtifactStoreOptions {
provider: ArtifactStoreProvider;
durability?: 'ephemeral' | 'durable';
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
durability | property | durability?: "ephemeral" | "durable" | Public property; its type, readonly modifier and optionality are shown in the signature. |
provider | property | provider: ArtifactStoreProvider | Public property; its type, readonly modifier and optionality are shown in the signature. |
InMemoryContextArtifactBacking
Public type alias for In Memory Context Artifact Backing; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { InMemoryContextArtifactBacking } from '@codesoul-co/hypha-memory'; - Source module:
context-artifacts
Declaration
export type InMemoryContextArtifactBacking = Map<string, ContextArtifactRecord>;