Skip to content

@codesoul-co/hypha-memory / canonical-runtime-config

模块用法

用于执行该边界的运行时行为。Canonical runtime config 模块公开 1 类、3 常量、3 接口。

从包入口导入

ts
import {
  CanonicalMemoryRuntimeLoader,
  canonicalMemoryRuntimeConfigExample,
  canonicalMemoryRuntimeConfigJsonSchema,
  canonicalMemoryRuntimeConfigSchema,
} from '@codesoul-co/hypha-memory';

import type {
  CanonicalMemoryRuntimeConfig,
  LoadedCanonicalMemoryRuntimeConfig,
  MemoryRuntimeReferenceResolver,
} from '@codesoul-co/hypha-memory';

使用要点

  • 3 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 1 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
  • 3 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

公共导出

Symbol种类签名说明
CanonicalMemoryRuntimeLoadernew CanonicalMemoryRuntimeLoader(resolver: MemoryRuntimeReferenceResolver): CanonicalMemoryRuntimeLoaderCanonical Memory Runtime Loader 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。
canonicalMemoryRuntimeConfigExample常量const canonicalMemoryRuntimeConfigExample: CanonicalMemoryRuntimeConfigCanonical Memory Runtime Config 的有效示例值。
canonicalMemoryRuntimeConfigJsonSchema常量const canonicalMemoryRuntimeConfigJsonSchema: JsonSchemaCanonical Memory Runtime Config 的 JSON Schema。
canonicalMemoryRuntimeConfigSchema常量const canonicalMemoryRuntimeConfigSchema: ZodType<CanonicalMemoryRuntimeConfig, ZodTypeDef, CanonicalMemoryRuntimeConfig>Canonical Memory Runtime Config 的运行时 Schema。
CanonicalMemoryRuntimeConfig接口interface CanonicalMemoryRuntimeConfig extends MemoryRuntimeConfigCanonical Memory Runtime Config 接口,共包含 3 个公开字段或方法。
LoadedCanonicalMemoryRuntimeConfig接口interface LoadedCanonicalMemoryRuntimeConfigLoaded Canonical Memory Runtime Config 接口,共包含 2 个公开字段或方法。
MemoryRuntimeReferenceResolver接口interface MemoryRuntimeReferenceResolverMemory Runtime Reference Resolver 接口,共包含 1 个公开字段或方法。

CanonicalMemoryRuntimeLoader

Canonical Memory Runtime Loader 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { CanonicalMemoryRuntimeLoader } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export declare class CanonicalMemoryRuntimeLoader {
    constructor(resolver: MemoryRuntimeReferenceResolver);
    load(input: unknown): Promise<LoadedCanonicalMemoryRuntimeConfig>;
    create(factory: MemoryRuntimeFactory, input: unknown): Promise<MemoryRuntime>;
}

公开成员

成员种类签名说明
constructor构造函数(resolver: MemoryRuntimeReferenceResolver): CanonicalMemoryRuntimeLoader创建该类的实例。
create方法create(factory: MemoryRuntimeFactory, input: unknown): Promise<MemoryRuntime>公开方法;参数与返回类型以签名列为准。
load方法load(input: unknown): Promise<LoadedCanonicalMemoryRuntimeConfig>公开方法;参数与返回类型以签名列为准。

canonicalMemoryRuntimeConfigExample

Canonical Memory Runtime Config 的有效示例值。

  • 种类: 常量
  • 导入: import { canonicalMemoryRuntimeConfigExample } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export declare const canonicalMemoryRuntimeConfigExample: CanonicalMemoryRuntimeConfig;

canonicalMemoryRuntimeConfigJsonSchema

Canonical Memory Runtime Config 的 JSON Schema。

  • 种类: 常量
  • 导入: import { canonicalMemoryRuntimeConfigJsonSchema } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export declare const canonicalMemoryRuntimeConfigJsonSchema: JsonSchema;

canonicalMemoryRuntimeConfigSchema

Canonical Memory Runtime Config 的运行时 Schema。

  • 种类: 常量
  • 导入: import { canonicalMemoryRuntimeConfigSchema } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export declare const canonicalMemoryRuntimeConfigSchema: ZodType<CanonicalMemoryRuntimeConfig, ZodTypeDef, CanonicalMemoryRuntimeConfig>;

CanonicalMemoryRuntimeConfig

Canonical Memory Runtime Config 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { CanonicalMemoryRuntimeConfig } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export interface CanonicalMemoryRuntimeConfig extends MemoryRuntimeConfig {
    schemaVersion: '1.0';
}

契约成员

成员种类签名说明
activeProfile属性activeProfile: string公开属性;类型、只读和可选状态以签名列为准。
profiles属性profiles: Record<string, MemoryRuntimeProfile>公开属性;类型、只读和可选状态以签名列为准。
schemaVersion属性schemaVersion: "1.0"公开属性;类型、只读和可选状态以签名列为准。

LoadedCanonicalMemoryRuntimeConfig

Loaded Canonical Memory Runtime Config 接口,共包含 2 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { LoadedCanonicalMemoryRuntimeConfig } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export interface LoadedCanonicalMemoryRuntimeConfig {
    config: MemoryRuntimeConfig;
    references: ReadonlyMap<string, unknown>;
}

契约成员

成员种类签名说明
config属性config: MemoryRuntimeConfig公开属性;类型、只读和可选状态以签名列为准。
references属性references: ReadonlyMap<string, unknown>公开属性;类型、只读和可选状态以签名列为准。

MemoryRuntimeReferenceResolver

Memory Runtime Reference Resolver 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { MemoryRuntimeReferenceResolver } from '@codesoul-co/hypha-memory';
  • 源码模块: canonical-runtime-config

声明

text
export interface MemoryRuntimeReferenceResolver {
    resolve(reference: string, kind: 'connection' | 'secret' | 'environment' | 'dependency'): Promise<unknown>;
}

契约成员

成员种类签名说明
resolve方法resolve(reference: string, kind: "connection" | "secret" | "environment" | "dependency"): Promise<unknown>公开方法;参数与返回类型以签名列为准。