Skip to content

@codesoul-co/hypha-core / modules/artifact/eventing

模块用法

用于创建、记录或读取 Event 契约。Eventing 模块公开 3 类、3 接口。

从包入口导入

ts
import {
  EventingArtifactGarbageCollector,
  EventingArtifactManager,
  EventingArtifactRetentionProcessor,
} from '@codesoul-co/hypha-core';

import type {
  EventingArtifactGarbageCollectorOptions,
  EventingArtifactManagerOptions,
  EventingArtifactRetentionProcessorOptions,
} from '@codesoul-co/hypha-core';

使用要点

  • 3 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 3 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。

公共导出

Symbol种类签名说明
EventingArtifactGarbageCollectornew EventingArtifactGarbageCollector(options: EventingArtifactGarbageCollectorOptions): EventingArtifactGarbageCollectorEventing Artifact Garbage Collector 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
EventingArtifactManagernew EventingArtifactManager(options: EventingArtifactManagerOptions): EventingArtifactManagerEventing Artifact Manager 类,共公开 17 个构造函数或成员;精确签名见本条目的声明与成员表。
EventingArtifactRetentionProcessornew EventingArtifactRetentionProcessor(options: EventingArtifactRetentionProcessorOptions): EventingArtifactRetentionProcessorEventing Artifact Retention Processor 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
EventingArtifactGarbageCollectorOptions接口interface EventingArtifactGarbageCollectorOptionsEventing Artifact Garbage Collector Options 接口,共包含 8 个公开字段或方法。
EventingArtifactManagerOptions接口interface EventingArtifactManagerOptionsEventing Artifact Manager Options 接口,共包含 4 个公开字段或方法。
EventingArtifactRetentionProcessorOptions接口interface EventingArtifactRetentionProcessorOptionsEventing Artifact Retention Processor Options 接口,共包含 8 个公开字段或方法。

EventingArtifactGarbageCollector

Eventing Artifact Garbage Collector 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { EventingArtifactGarbageCollector } from '@codesoul-co/hypha-core';
  • 源码模块: modules/artifact/eventing

声明

text
export declare class EventingArtifactGarbageCollector implements ArtifactGarbageCollector {
    constructor(options: EventingArtifactGarbageCollectorOptions);
    collect(input: ArtifactGarbageCollectionRequest): Promise<ArtifactGarbageCollectionResult>;
}

公开成员

成员种类签名说明
collect方法collect(input: ArtifactGarbageCollectionRequest): Promise<ArtifactGarbageCollectionResult>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options: EventingArtifactGarbageCollectorOptions): EventingArtifactGarbageCollector创建该类的实例。

EventingArtifactManager

Eventing Artifact Manager 类,共公开 17 个构造函数或成员;精确签名见本条目的声明与成员表。

声明

text
export declare class EventingArtifactManager implements ArtifactManager {
    constructor(options: EventingArtifactManagerOptions);
    create(input: ArtifactCreateRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>;
    createFromWorkspace(input: ArtifactFromWorkspaceRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>;
    createVersion(input: ArtifactVersionRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>;
    get(request: ArtifactGetRecordRequest): Promise<ArtifactRecord | null>;
    read(input: ArtifactReadRequest, options?: ArtifactOperationOptions): Promise<ArtifactReadResult>;
    createDownloadAccess(request: ArtifactCreateDownloadAccessRequest): Promise<ArtifactDownloadAccess>;
    list(request: ArtifactListRequest): Promise<ArtifactRecord[]>;
    finalize(input: ArtifactFinalizeRequest): Promise<ArtifactRecord>;
    archive(input: ArtifactArchiveRequest): Promise<ArtifactRecord>;
    invalidate(input: ArtifactInvalidateRequest): Promise<ArtifactRecord>;
    delete(input: ArtifactDeleteRequest): Promise<void>;
    traceLineage(request: ArtifactTraceLineageRequest): Promise<ArtifactLineage>;
    latest(request: ArtifactLatestRequest): Promise<ArtifactRecord | null>;
    previous(request: ArtifactPreviousRequest): Promise<ArtifactRecord | null>;
    profile(ref: SpecRef): Promise<ArtifactProfileSpec | null>;
    health(): Promise<Record<string, ProviderHealth>>;
}

公开成员

成员种类签名说明
archive方法archive(input: ArtifactArchiveRequest): Promise<ArtifactRecord>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options: EventingArtifactManagerOptions): EventingArtifactManager创建该类的实例。
create方法create(input: ArtifactCreateRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>公开方法;参数与返回类型以签名列为准。
createDownloadAccess方法createDownloadAccess(request: ArtifactCreateDownloadAccessRequest): Promise<ArtifactDownloadAccess>公开方法;参数与返回类型以签名列为准。
createFromWorkspace方法createFromWorkspace(input: ArtifactFromWorkspaceRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>公开方法;参数与返回类型以签名列为准。
createVersion方法createVersion(input: ArtifactVersionRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>公开方法;参数与返回类型以签名列为准。
delete方法delete(input: ArtifactDeleteRequest): Promise<void>公开方法;参数与返回类型以签名列为准。
finalize方法finalize(input: ArtifactFinalizeRequest): Promise<ArtifactRecord>公开方法;参数与返回类型以签名列为准。
get方法get(request: ArtifactGetRecordRequest): Promise<ArtifactRecord | null>公开方法;参数与返回类型以签名列为准。
health方法health(): Promise<Record<string, ProviderHealth>>公开方法;参数与返回类型以签名列为准。
invalidate方法invalidate(input: ArtifactInvalidateRequest): Promise<ArtifactRecord>公开方法;参数与返回类型以签名列为准。
latest方法latest(request: ArtifactLatestRequest): Promise<ArtifactRecord | null>公开方法;参数与返回类型以签名列为准。
list方法list(request: ArtifactListRequest): Promise<ArtifactRecord[]>公开方法;参数与返回类型以签名列为准。
previous方法previous(request: ArtifactPreviousRequest): Promise<ArtifactRecord | null>公开方法;参数与返回类型以签名列为准。
profile方法profile(ref: SpecRef): Promise<ArtifactProfileSpec | null>公开方法;参数与返回类型以签名列为准。
read方法read(input: ArtifactReadRequest, options?: ArtifactOperationOptions): Promise<ArtifactReadResult>公开方法;参数与返回类型以签名列为准。
traceLineage方法traceLineage(request: ArtifactTraceLineageRequest): Promise<ArtifactLineage>公开方法;参数与返回类型以签名列为准。

EventingArtifactRetentionProcessor

Eventing Artifact Retention Processor 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { EventingArtifactRetentionProcessor } from '@codesoul-co/hypha-core';
  • 源码模块: modules/artifact/eventing

声明

text
export declare class EventingArtifactRetentionProcessor implements ArtifactRetentionProcessor {
    constructor(options: EventingArtifactRetentionProcessorOptions);
    process(request: ArtifactRetentionProcessRequest): Promise<ArtifactRetentionProcessResult>;
}

公开成员

成员种类签名说明
constructor构造函数(options: EventingArtifactRetentionProcessorOptions): EventingArtifactRetentionProcessor创建该类的实例。
process方法process(request: ArtifactRetentionProcessRequest): Promise<ArtifactRetentionProcessResult>公开方法;参数与返回类型以签名列为准。

EventingArtifactGarbageCollectorOptions

Eventing Artifact Garbage Collector Options 接口,共包含 8 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { EventingArtifactGarbageCollectorOptions } from '@codesoul-co/hypha-core';
  • 源码模块: modules/artifact/eventing

声明

text
export interface EventingArtifactGarbageCollectorOptions {
    collector: ArtifactGarbageCollector;
    publisher: ArtifactEventPublisher;
    idGenerator: () => string;
    now?: () => string;
    workspaceId?: string;
    sessionId?: string;
    runId?: string;
    agentId?: string;
}

契约成员

成员种类签名说明
agentId属性agentId?: string公开属性;类型、只读和可选状态以签名列为准。
collector属性collector: ArtifactGarbageCollector公开属性;类型、只读和可选状态以签名列为准。
idGenerator方法idGenerator(): string公开方法;参数与返回类型以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
publisher属性publisher: ArtifactEventPublisher公开属性;类型、只读和可选状态以签名列为准。
runId属性runId?: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId?: string公开属性;类型、只读和可选状态以签名列为准。
workspaceId属性workspaceId?: string公开属性;类型、只读和可选状态以签名列为准。

EventingArtifactManagerOptions

Eventing Artifact Manager Options 接口,共包含 4 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { EventingArtifactManagerOptions } from '@codesoul-co/hypha-core';
  • 源码模块: modules/artifact/eventing

声明

text
export interface EventingArtifactManagerOptions {
    manager: ArtifactManager;
    publisher: ArtifactEventPublisher;
    idGenerator: () => string;
    now?: () => string;
}

契约成员

成员种类签名说明
idGenerator方法idGenerator(): string公开方法;参数与返回类型以签名列为准。
manager属性manager: ArtifactManager公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
publisher属性publisher: ArtifactEventPublisher公开属性;类型、只读和可选状态以签名列为准。

EventingArtifactRetentionProcessorOptions

Eventing Artifact Retention Processor Options 接口,共包含 8 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { EventingArtifactRetentionProcessorOptions } from '@codesoul-co/hypha-core';
  • 源码模块: modules/artifact/eventing

声明

text
export interface EventingArtifactRetentionProcessorOptions {
    processor: ArtifactRetentionProcessor;
    publisher: ArtifactEventPublisher;
    idGenerator: () => string;
    now?: () => string;
    workspaceId?: string;
    sessionId?: string;
    runId?: string;
    agentId?: string;
}

契约成员

成员种类签名说明
agentId属性agentId?: string公开属性;类型、只读和可选状态以签名列为准。
idGenerator方法idGenerator(): string公开方法;参数与返回类型以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
processor属性processor: ArtifactRetentionProcessor公开属性;类型、只读和可选状态以签名列为准。
publisher属性publisher: ArtifactEventPublisher公开属性;类型、只读和可选状态以签名列为准。
runId属性runId?: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId?: string公开属性;类型、只读和可选状态以签名列为准。
workspaceId属性workspaceId?: string公开属性;类型、只读和可选状态以签名列为准。