@codesoul-co/hypha-adapters-local / index
模块用法
聚合 @codesoul-co/hypha-adapters-local 的公共入口导出;应用应从包入口导入这些 Symbol,不应依赖内部文件路径。
从包入口导入
import {
ArtifactStoreToolPort,
FileArtifactStore,
FileMCPCapabilityCatalogStore,
FileToolContractSnapshotStore,
FileToolObservationStore,
FileToolRuntimeStore,
InMemoryArtifactStore,
InMemoryStructuredStore,
} from '@codesoul-co/hypha-adapters-local';
import type {
FileArtifactStoreOptions,
FileToolRuntimeStoreOptions,
LocalAdapterProfile,
LocalHashEmbeddingProviderOptions,
LocalStorageBackbone,
LocalStorageBackboneOptions,
LocalVectorIndexProviderOptions,
SQLiteEventStoreOptions,
} from '@codesoul-co/hypha-adapters-local';
// 完整导出列表见下方。使用要点
- 9 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用
import type,运行时不应依赖它们。 - 14 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
- 2 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
- 1 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
ArtifactStoreToolPort | 类 | new ArtifactStoreToolPort(artifacts: ArtifactStoreProvider): ArtifactStoreToolPort | Artifact Store Tool Port 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
FileArtifactStore | 类 | new FileArtifactStore(options: FileArtifactStoreOptions): FileArtifactStore | File Artifact Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。 |
FileMCPCapabilityCatalogStore | 类 | new FileMCPCapabilityCatalogStore(filename: string): FileMCPCapabilityCatalogStore | File MCP Capability Catalog Store 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。 |
FileToolContractSnapshotStore | 类 | new FileToolContractSnapshotStore(rootPath: string): FileToolContractSnapshotStore | File Tool Contract Snapshot Store 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。 |
FileToolObservationStore | 类 | new FileToolObservationStore(rootPath: string): FileToolObservationStore | File Tool Observation Store 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
FileToolRuntimeStore | 类 | new FileToolRuntimeStore(options: FileToolRuntimeStoreOptions): FileToolRuntimeStore | File Tool Runtime Store 类,共公开 13 个构造函数或成员;精确签名见本条目的声明与成员表。 |
InMemoryArtifactStore | 类 | new InMemoryArtifactStore(): InMemoryArtifactStore | In Memory Artifact Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。 |
InMemoryStructuredStore | 类 | new InMemoryStructuredStore(): InMemoryStructuredStore | In Memory Structured Store 类,共公开 7 个构造函数或成员;精确签名见本条目的声明与成员表。 |
InMemoryVectorIndexProvider | 类 | new InMemoryVectorIndexProvider(): InMemoryVectorIndexProvider | In Memory Vector Index Provider 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。 |
LocalHashEmbeddingProvider | 类 | new LocalHashEmbeddingProvider(options?: LocalHashEmbeddingProviderOptions): LocalHashEmbeddingProvider | Zero-dependency lexical embedding for the local backbone. This is deliberately named by its algorithm rather than presented as a neural semantic model. Token and character n-gram feature hashing gives related local text stable overlap while keeping dimensions and persistence deterministic. Deployments that require semantic recall should inject a concrete embedding Provider through createLocalStorageBackbone. |
LocalVectorIndexProvider | 类 | new LocalVectorIndexProvider(options: LocalVectorIndexProviderOptions): LocalVectorIndexProvider | Local Vector Index Provider 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MockEmbeddingProvider | 类 | new MockEmbeddingProvider(): MockEmbeddingProvider | Mock Embedding Provider 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
SQLiteEventStore | 类 | new SQLiteEventStore(options: SQLiteEventStoreOptions): SQLiteEventStore | SQLite Event Store 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
SQLiteStructuredStore | 类 | new SQLiteStructuredStore(options: SQLiteStructuredStoreOptions): SQLiteStructuredStore | SQLite Structured Store 类,共公开 7 个构造函数或成员;精确签名见本条目的声明与成员表。 |
LOCAL_ADAPTER_TYPES | 常量 | const LOCAL_ADAPTER_TYPES: readonly ["sqlite", "local-vector", "file-artifact"] | 由 index 模块导出的 LOCAL ADAPTER TYPES 常量。 |
createLocalStorageBackbone | 函数 | createLocalStorageBackbone(options: LocalStorageBackboneOptions): LocalStorageBackbone | Create Local Storage Backbone 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
createLocalStorageProfiles | 函数 | createLocalStorageProfiles(input: { eventDbFilename: string; structuredDbFilename: string; vectorFilename: string; artifactRootPath: string; }): StorageProviderProfile[] | Create Local Storage Profiles 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
FileArtifactStoreOptions | 接口 | interface FileArtifactStoreOptions | File Artifact Store Options 接口,共包含 1 个公开字段或方法。 |
FileToolRuntimeStoreOptions | 接口 | interface FileToolRuntimeStoreOptions | File Tool Runtime Store Options 接口,共包含 1 个公开字段或方法。 |
LocalAdapterProfile | 接口 | interface LocalAdapterProfile | Local Adapter Profile 接口,共包含 4 个公开字段或方法。 |
LocalHashEmbeddingProviderOptions | 接口 | interface LocalHashEmbeddingProviderOptions | Local Hash Embedding Provider Options 接口,共包含 1 个公开字段或方法。 |
LocalStorageBackbone | 接口 | interface LocalStorageBackbone | Local Storage Backbone 接口,共包含 7 个公开字段或方法。 |
LocalStorageBackboneOptions | 接口 | interface LocalStorageBackboneOptions | Local Storage Backbone Options 接口,共包含 8 个公开字段或方法。 |
LocalVectorIndexProviderOptions | 接口 | interface LocalVectorIndexProviderOptions | Local Vector Index Provider Options 接口,共包含 1 个公开字段或方法。 |
SQLiteEventStoreOptions | 接口 | interface SQLiteEventStoreOptions | SQLite Event Store Options 接口,共包含 3 个公开字段或方法。 |
SQLiteStructuredStoreOptions | 接口 | interface SQLiteStructuredStoreOptions | SQLite Structured Store Options 接口,共包含 3 个公开字段或方法。 |
ArtifactStoreToolPort
Artifact Store Tool Port 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { ArtifactStoreToolPort } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class ArtifactStoreToolPort implements ToolArtifactPort {
constructor(artifacts: ArtifactStoreProvider);
store(request: {
invocationId: string;
toolId: string;
value: unknown;
mimeType?: string;
metadata?: Record<string, unknown>;
}): Promise<string>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (artifacts: ArtifactStoreProvider): ArtifactStoreToolPort | 创建该类的实例。 |
store | 方法 | store(request: { invocationId: string; toolId: string; value: unknown; mimeType?: string; metadata?: Record<string, unknown>; }): Promise<string> | 公开方法;参数与返回类型以签名列为准。 |
FileArtifactStore
File Artifact Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { FileArtifactStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class FileArtifactStore implements ArtifactStoreProvider {
constructor(options: FileArtifactStoreOptions);
put(filePath: string, content: Buffer | string, meta?: ArtifactMeta): Promise<ArtifactRef>;
get(ref: ArtifactRef): Promise<Buffer>;
delete(ref: ArtifactRef): Promise<void>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: FileArtifactStoreOptions): FileArtifactStore | 创建该类的实例。 |
delete | 方法 | delete(ref: ArtifactRef): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
get | 方法 | get(ref: ArtifactRef): Promise<Buffer> | 公开方法;参数与返回类型以签名列为准。 |
put | 方法 | put(filePath: string, content: Buffer | string, meta?: ArtifactMeta): Promise<ArtifactRef> | 公开方法;参数与返回类型以签名列为准。 |
FileMCPCapabilityCatalogStore
File MCP Capability Catalog Store 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { FileMCPCapabilityCatalogStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class FileMCPCapabilityCatalogStore implements MCPCapabilityCatalogStore {
constructor(filename: string);
list(serverId?: string): Promise<MCPCapabilityRecord[]>;
save(record: MCPCapabilityRecord, options?: {
expected?: MCPCapabilityRecord | null;
}): Promise<boolean>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (filename: string): FileMCPCapabilityCatalogStore | 创建该类的实例。 |
list | 方法 | list(serverId?: string): Promise<MCPCapabilityRecord[]> | 公开方法;参数与返回类型以签名列为准。 |
save | 方法 | save(record: MCPCapabilityRecord, options?: { expected?: MCPCapabilityRecord | null; }): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
FileToolContractSnapshotStore
File Tool Contract Snapshot Store 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { FileToolContractSnapshotStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class FileToolContractSnapshotStore implements ToolContractSnapshotStore {
constructor(rootPath: string);
get(snapshotId: string): Promise<ToolContractSnapshot | null>;
save(snapshot: ToolContractSnapshot): Promise<void>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (rootPath: string): FileToolContractSnapshotStore | 创建该类的实例。 |
get | 方法 | get(snapshotId: string): Promise<ToolContractSnapshot | null> | 公开方法;参数与返回类型以签名列为准。 |
save | 方法 | save(snapshot: ToolContractSnapshot): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
FileToolObservationStore
File Tool Observation Store 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { FileToolObservationStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class FileToolObservationStore implements ToolObservationPort {
constructor(rootPath: string);
record(request: {
invocationId: string;
toolId: string;
toolRevision: string;
runId: string;
stepId: string;
inputHash: string;
outputHash: string;
value: unknown;
artifactRefs?: string[];
provenance: Record<string, unknown>;
}): Promise<string>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (rootPath: string): FileToolObservationStore | 创建该类的实例。 |
record | 方法 | record(request: { invocationId: string; toolId: string; toolRevision: string; runId: string; stepId: string; inputHash: string; outputHash: string; value: unknown; artifactRefs?: string[]; provenance: Record<string, unknown>; }): Promise<string> | 公开方法;参数与返回类型以签名列为准。 |
FileToolRuntimeStore
File Tool Runtime Store 类,共公开 13 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { FileToolRuntimeStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class FileToolRuntimeStore implements ToolInvocationStore, ToolApprovalStore {
constructor(options: FileToolRuntimeStoreOptions);
get(invocationId: string): Promise<ToolInvocationRecord | null>;
findByIdempotency(request: ToolIdempotencyLookup): Promise<ToolInvocationRecord | null>;
list(request?: ToolInvocationListRequest): Promise<ToolInvocationRecord[]>;
create(record: ToolInvocationRecord): Promise<ToolInvocationRecord>;
update(invocationId: string, patch: ToolInvocationPatch, options?: {
expectedStatuses?: readonly ToolInvocationStatus[];
expectedRevision?: number;
}): Promise<ToolInvocationRecord>;
getCompleted(invocationId: string): Promise<ToolCallResult | null>;
saveCompleted(invocationId: string, result: ToolCallResult): Promise<void>;
getRequest(invocationId: string): Promise<ToolApprovalRequest | null>;
requestApproval(request: ToolApprovalRequest): Promise<ToolApprovalRequest>;
getGrant(invocationId: string): Promise<ToolApprovalGrant | null>;
approve(invocationId: string, approvedBy: string, options?: {
approvedAt?: string;
expiresAt?: string;
}): Promise<ToolApprovalGrant>;
reject(invocationId: string): Promise<ToolApprovalRequest>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
approve | 方法 | approve(invocationId: string, approvedBy: string, options?: { approvedAt?: string; expiresAt?: string; }): Promise<ToolApprovalGrant> | 公开方法;参数与返回类型以签名列为准。 |
constructor | 构造函数 | (options: FileToolRuntimeStoreOptions): FileToolRuntimeStore | 创建该类的实例。 |
create | 方法 | create(record: ToolInvocationRecord): Promise<ToolInvocationRecord> | 公开方法;参数与返回类型以签名列为准。 |
findByIdempotency | 方法 | findByIdempotency(request: ToolIdempotencyLookup): Promise<ToolInvocationRecord | null> | 公开方法;参数与返回类型以签名列为准。 |
get | 方法 | get(invocationId: string): Promise<ToolInvocationRecord | null> | 公开方法;参数与返回类型以签名列为准。 |
getCompleted | 方法 | getCompleted(invocationId: string): Promise<ToolCallResult | null> | 公开方法;参数与返回类型以签名列为准。 |
getGrant | 方法 | getGrant(invocationId: string): Promise<ToolApprovalGrant | null> | 公开方法;参数与返回类型以签名列为准。 |
getRequest | 方法 | getRequest(invocationId: string): Promise<ToolApprovalRequest | null> | 公开方法;参数与返回类型以签名列为准。 |
list | 方法 | list(request?: ToolInvocationListRequest): Promise<ToolInvocationRecord[]> | 公开方法;参数与返回类型以签名列为准。 |
reject | 方法 | reject(invocationId: string): Promise<ToolApprovalRequest> | 公开方法;参数与返回类型以签名列为准。 |
requestApproval | 方法 | requestApproval(request: ToolApprovalRequest): Promise<ToolApprovalRequest> | 公开方法;参数与返回类型以签名列为准。 |
saveCompleted | 方法 | saveCompleted(invocationId: string, result: ToolCallResult): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
update | 方法 | update(invocationId: string, patch: ToolInvocationPatch, options?: { expectedStatuses?: readonly ToolInvocationStatus[]; expectedRevision?: number; }): Promise<ToolInvocationRecord> | 公开方法;参数与返回类型以签名列为准。 |
InMemoryArtifactStore
In Memory Artifact Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { InMemoryArtifactStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class InMemoryArtifactStore implements ArtifactStoreProvider {
put(path: string, content: Buffer | string, meta?: ArtifactMeta): Promise<ArtifactRef>;
get(ref: ArtifactRef): Promise<Buffer>;
delete(ref: ArtifactRef): Promise<void>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (): InMemoryArtifactStore | 创建该类的实例。 |
delete | 方法 | delete(ref: ArtifactRef): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
get | 方法 | get(ref: ArtifactRef): Promise<Buffer> | 公开方法;参数与返回类型以签名列为准。 |
put | 方法 | put(path: string, content: Buffer | string, meta?: ArtifactMeta): Promise<ArtifactRef> | 公开方法;参数与返回类型以签名列为准。 |
InMemoryStructuredStore
In Memory Structured Store 类,共公开 7 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { InMemoryStructuredStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class InMemoryStructuredStore implements StructuredStoreProvider {
get<T>(table: string, id: string): Promise<T | null>;
insert<T extends {
id: string;
}>(table: string, record: T): Promise<void>;
update<T>(table: string, id: string, patch: Partial<T>): Promise<void>;
delete(table: string, id: string): Promise<void>;
query<T>(table: string, query: StructuredQuery): Promise<T[]>;
transaction<T>(fn: (tx: StructuredStoreProvider) => Promise<T>): Promise<T>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (): InMemoryStructuredStore | 创建该类的实例。 |
delete | 方法 | delete(table: string, id: string): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
get | 方法 | get<T>(table: string, id: string): Promise<T | null> | 公开方法;参数与返回类型以签名列为准。 |
insert | 方法 | insert<T extends { id: string; }>(table: string, record: T): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
query | 方法 | query<T>(table: string, query: StructuredQuery): Promise<T[]> | 公开方法;参数与返回类型以签名列为准。 |
transaction | 方法 | transaction<T>(fn: (tx: StructuredStoreProvider) => Promise<T>): Promise<T> | 公开方法;参数与返回类型以签名列为准。 |
update | 方法 | update<T>(table: string, id: string, patch: Partial<T>): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
InMemoryVectorIndexProvider
In Memory Vector Index Provider 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { InMemoryVectorIndexProvider } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class InMemoryVectorIndexProvider implements VectorIndexProvider {
upsert(records: VectorRecord[]): Promise<void>;
search(query: VectorQuery): Promise<VectorSearchResult[]>;
delete(ids: string[]): Promise<void>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (): InMemoryVectorIndexProvider | 创建该类的实例。 |
delete | 方法 | delete(ids: string[]): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
search | 方法 | search(query: VectorQuery): Promise<VectorSearchResult[]> | 公开方法;参数与返回类型以签名列为准。 |
upsert | 方法 | upsert(records: VectorRecord[]): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
LocalHashEmbeddingProvider
Zero-dependency lexical embedding for the local backbone. This is deliberately named by its algorithm rather than presented as a neural semantic model. Token and character n-gram feature hashing gives related local text stable overlap while keeping dimensions and persistence deterministic. Deployments that require semantic recall should inject a concrete embedding Provider through createLocalStorageBackbone.
- 种类: 类
- 导入:
import { LocalHashEmbeddingProvider } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class LocalHashEmbeddingProvider implements EmbeddingProvider {
constructor(options?: LocalHashEmbeddingProviderOptions);
embed(input: string[]): Promise<number[][]>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options?: LocalHashEmbeddingProviderOptions): LocalHashEmbeddingProvider | 创建该类的实例。 |
embed | 方法 | embed(input: string[]): Promise<number[][]> | 公开方法;参数与返回类型以签名列为准。 |
LocalVectorIndexProvider
Local Vector Index Provider 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { LocalVectorIndexProvider } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class LocalVectorIndexProvider implements VectorIndexProvider {
constructor(options: LocalVectorIndexProviderOptions);
upsert(records: VectorRecord[]): Promise<void>;
search(query: VectorQuery): Promise<VectorSearchResult[]>;
delete(ids: string[]): Promise<void>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: LocalVectorIndexProviderOptions): LocalVectorIndexProvider | 创建该类的实例。 |
delete | 方法 | delete(ids: string[]): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
search | 方法 | search(query: VectorQuery): Promise<VectorSearchResult[]> | 公开方法;参数与返回类型以签名列为准。 |
upsert | 方法 | upsert(records: VectorRecord[]): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MockEmbeddingProvider
Mock Embedding Provider 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { MockEmbeddingProvider } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class MockEmbeddingProvider implements EmbeddingProvider {
embed(input: string[]): Promise<number[][]>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (): MockEmbeddingProvider | 创建该类的实例。 |
embed | 方法 | embed(input: string[]): Promise<number[][]> | 公开方法;参数与返回类型以签名列为准。 |
SQLiteEventStore
SQLite Event Store 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { SQLiteEventStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class SQLiteEventStore implements EventStore, TraceRecorder {
constructor(options: SQLiteEventStoreOptions);
append(event: FrameworkEvent): Promise<void>;
record(event: FrameworkEvent): Promise<void>;
list(filter?: EventFilter): Promise<FrameworkEvent[]>;
exportJsonl(filename: string, filter?: EventFilter): Promise<number>;
importJsonl(filename: string): Promise<number>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
append | 方法 | append(event: FrameworkEvent): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
constructor | 构造函数 | (options: SQLiteEventStoreOptions): SQLiteEventStore | 创建该类的实例。 |
exportJsonl | 方法 | exportJsonl(filename: string, filter?: EventFilter): Promise<number> | 公开方法;参数与返回类型以签名列为准。 |
importJsonl | 方法 | importJsonl(filename: string): Promise<number> | 公开方法;参数与返回类型以签名列为准。 |
list | 方法 | list(filter?: EventFilter): Promise<FrameworkEvent[]> | 公开方法;参数与返回类型以签名列为准。 |
record | 方法 | record(event: FrameworkEvent): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
SQLiteStructuredStore
SQLite Structured Store 类,共公开 7 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { SQLiteStructuredStore } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare class SQLiteStructuredStore implements StructuredStoreProvider {
constructor(options: SQLiteStructuredStoreOptions);
get<T>(table: string, id: string): Promise<T | null>;
insert<T extends {
id: string;
}>(table: string, record: T): Promise<void>;
update<T>(table: string, id: string, patch: Partial<T>): Promise<void>;
delete(table: string, id: string): Promise<void>;
query<T>(table: string, query: StructuredQuery): Promise<T[]>;
transaction<T>(fn: (tx: StructuredStoreProvider) => Promise<T>): Promise<T>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: SQLiteStructuredStoreOptions): SQLiteStructuredStore | 创建该类的实例。 |
delete | 方法 | delete(table: string, id: string): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
get | 方法 | get<T>(table: string, id: string): Promise<T | null> | 公开方法;参数与返回类型以签名列为准。 |
insert | 方法 | insert<T extends { id: string; }>(table: string, record: T): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
query | 方法 | query<T>(table: string, query: StructuredQuery): Promise<T[]> | 公开方法;参数与返回类型以签名列为准。 |
transaction | 方法 | transaction<T>(fn: (tx: StructuredStoreProvider) => Promise<T>): Promise<T> | 公开方法;参数与返回类型以签名列为准。 |
update | 方法 | update<T>(table: string, id: string, patch: Partial<T>): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
LOCAL_ADAPTER_TYPES
由 index 模块导出的 LOCAL ADAPTER TYPES 常量。
- 种类: 常量
- 导入:
import { LOCAL_ADAPTER_TYPES } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare const LOCAL_ADAPTER_TYPES: readonly ["sqlite", "local-vector", "file-artifact"];createLocalStorageBackbone
Create Local Storage Backbone 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { createLocalStorageBackbone } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare function createLocalStorageBackbone(options: LocalStorageBackboneOptions): LocalStorageBackbone;调用签名
createLocalStorageBackbone(options: LocalStorageBackboneOptions): LocalStorageBackbone参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
options | LocalStorageBackboneOptions | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
LocalStorageBackbone - 说明: 返回值契约由上述类型定义。
createLocalStorageProfiles
Create Local Storage Profiles 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { createLocalStorageProfiles } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export declare function createLocalStorageProfiles(input: {
eventDbFilename: string;
structuredDbFilename: string;
vectorFilename: string;
artifactRootPath: string;
}): StorageProviderProfile[];调用签名
createLocalStorageProfiles(input: { eventDbFilename: string; structuredDbFilename: string; vectorFilename: string; artifactRootPath: string; }): StorageProviderProfile[]参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | { eventDbFilename: string; structuredDbFilename: string; vectorFilename: string; artifactRootPath: string; } | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
StorageProviderProfile[] - 说明: 返回值契约由上述类型定义。
FileArtifactStoreOptions
File Artifact Store Options 接口,共包含 1 个公开字段或方法。
- 种类: 接口
- 导入:
import type { FileArtifactStoreOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface FileArtifactStoreOptions {
rootPath: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
rootPath | 属性 | rootPath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
FileToolRuntimeStoreOptions
File Tool Runtime Store Options 接口,共包含 1 个公开字段或方法。
- 种类: 接口
- 导入:
import type { FileToolRuntimeStoreOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface FileToolRuntimeStoreOptions {
filename: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
filename | 属性 | filename: string | 公开属性;类型、只读和可选状态以签名列为准。 |
LocalAdapterProfile
Local Adapter Profile 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LocalAdapterProfile } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface LocalAdapterProfile {
id: string;
type: 'sqlite' | 'local-vector' | 'file-artifact';
rootPath?: string;
options?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
options | 属性 | options?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
rootPath | 属性 | rootPath?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
type | 属性 | type: "sqlite" | "local-vector" | "file-artifact" | 公开属性;类型、只读和可选状态以签名列为准。 |
LocalHashEmbeddingProviderOptions
Local Hash Embedding Provider Options 接口,共包含 1 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LocalHashEmbeddingProviderOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface LocalHashEmbeddingProviderOptions {
dimensions?: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
dimensions | 属性 | dimensions?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
LocalStorageBackbone
Local Storage Backbone 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LocalStorageBackbone } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface LocalStorageBackbone {
profiles: StorageProviderProfile[];
eventStore: SQLiteEventStore;
structured: SQLiteStructuredStore;
vector: LocalVectorIndexProvider;
artifacts: FileArtifactStore;
embeddings: EmbeddingProvider;
memory: HybridMemoryProvider;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifacts | 属性 | artifacts: FileArtifactStore | 公开属性;类型、只读和可选状态以签名列为准。 |
embeddings | 属性 | embeddings: EmbeddingProvider | 公开属性;类型、只读和可选状态以签名列为准。 |
eventStore | 属性 | eventStore: SQLiteEventStore | 公开属性;类型、只读和可选状态以签名列为准。 |
memory | 属性 | memory: HybridMemoryProvider | 公开属性;类型、只读和可选状态以签名列为准。 |
profiles | 属性 | profiles: StorageProviderProfile[] | 公开属性;类型、只读和可选状态以签名列为准。 |
structured | 属性 | structured: SQLiteStructuredStore | 公开属性;类型、只读和可选状态以签名列为准。 |
vector | 属性 | vector: LocalVectorIndexProvider | 公开属性;类型、只读和可选状态以签名列为准。 |
LocalStorageBackboneOptions
Local Storage Backbone Options 接口,共包含 8 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LocalStorageBackboneOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface LocalStorageBackboneOptions {
rootPath: string;
sqliteMode?: SQLiteEventStoreOptions['mode'];
eventDbFilename?: string;
structuredDbFilename?: string;
vectorFilename?: string;
artifactRootPath?: string;
memoryTableName?: string;
embeddings?: EmbeddingProvider;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifactRootPath | 属性 | artifactRootPath?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
embeddings | 属性 | embeddings?: EmbeddingProvider | 公开属性;类型、只读和可选状态以签名列为准。 |
eventDbFilename | 属性 | eventDbFilename?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryTableName | 属性 | memoryTableName?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
rootPath | 属性 | rootPath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sqliteMode | 属性 | sqliteMode?: "sqlite" | "json" | "auto" | "node-sqlite" | 公开属性;类型、只读和可选状态以签名列为准。 |
structuredDbFilename | 属性 | structuredDbFilename?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
vectorFilename | 属性 | vectorFilename?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
LocalVectorIndexProviderOptions
Local Vector Index Provider Options 接口,共包含 1 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LocalVectorIndexProviderOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface LocalVectorIndexProviderOptions {
filename: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
filename | 属性 | filename: string | 公开属性;类型、只读和可选状态以签名列为准。 |
SQLiteEventStoreOptions
SQLite Event Store Options 接口,共包含 3 个公开字段或方法。
- 种类: 接口
- 导入:
import type { SQLiteEventStoreOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface SQLiteEventStoreOptions {
filename: string;
mode?: 'auto' | 'sqlite' | 'node-sqlite' | 'json';
jsonFallbackFilename?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
filename | 属性 | filename: string | 公开属性;类型、只读和可选状态以签名列为准。 |
jsonFallbackFilename | 属性 | jsonFallbackFilename?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode?: "sqlite" | "json" | "auto" | "node-sqlite" | 公开属性;类型、只读和可选状态以签名列为准。 |
SQLiteStructuredStoreOptions
SQLite Structured Store Options 接口,共包含 3 个公开字段或方法。
- 种类: 接口
- 导入:
import type { SQLiteStructuredStoreOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
index
声明
export interface SQLiteStructuredStoreOptions {
filename: string;
mode?: 'auto' | 'sqlite' | 'node-sqlite' | 'json';
jsonFallbackFilename?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
filename | 属性 | filename: string | 公开属性;类型、只读和可选状态以签名列为准。 |
jsonFallbackFilename | 属性 | jsonFallbackFilename?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode?: "sqlite" | "json" | "auto" | "node-sqlite" | 公开属性;类型、只读和可选状态以签名列为准。 |
