Skip to content

@codesoul-co/hypha-core / contracts/recovery

模块用法

用于声明并运行时校验契约。Recovery 模块公开 4 常量、5 函数、9 接口、5 类型。

从包入口导入

ts
import {
  defaultRecoveryConvergencePolicy,
  RECOVERY_CATEGORIES,
  RECOVERY_MODULES,
  RECOVERY_STRATEGIES,
  recoveryEvidenceHash,
  recoveryFailureFingerprint,
  recoveryKnowledgeKeyMatches,
  recoveryKnowledgeScopeMatches,
} from '@codesoul-co/hypha-core';

import type {
  RecoveryAttemptRecord,
  RecoveryCaseSnapshot,
  RecoveryConvergencePolicy,
  RecoveryEvidence,
  RecoveryFailure,
  RecoveryKnowledge,
  RecoveryKnowledgeKey,
  RecoveryKnowledgePort,
} from '@codesoul-co/hypha-core';

// 完整导出列表见下方。

使用要点

  • 14 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 5 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
  • 4 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

公共导出

Symbol种类签名说明
defaultRecoveryConvergencePolicy常量const defaultRecoveryConvergencePolicy: RecoveryConvergencePolicycontracts/recovery 模块导出的 Default Recovery Convergence Policy 常量。
RECOVERY_CATEGORIES常量const RECOVERY_CATEGORIES: readonly ["validation", "policy_denied", "authentication", "authorization", "rate_limit", "timeout", "transient_dependency", "permanent_dependency", "concurrency_conflict", "resource_exhausted", "tool_failure", "inference_failure", "memory_failure", "execution_failure", "storage_failure", "message_failure", "cache_failure", "invariant_violation", "cancellation", "unknown"]contracts/recovery 模块导出的 RECOVERY CATEGORIES 常量。
RECOVERY_MODULES常量const RECOVERY_MODULES: readonly ["fsm", "inference", "tool", "memory", "execution", "mcp", "workspace", "storage", "message_bus", "cache", "policy", "domain", "unknown"]contracts/recovery 模块导出的 RECOVERY MODULES 常量。
RECOVERY_STRATEGIES常量const RECOVERY_STRATEGIES: readonly ["retry", "reconcile", "fallback", "degrade", "compensate", "wait", "human_review", "quarantine", "fail", "cancel"]contracts/recovery 模块导出的 RECOVERY STRATEGIES 常量。
recoveryEvidenceHash函数recoveryEvidenceHash(evidence: RecoveryEvidence): stringRecovery Evidence Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。
recoveryFailureFingerprint函数recoveryFailureFingerprint(failure: RecoveryFailure): stringRecovery Failure Fingerprint 函数,提供 1 个公开调用签名;参数与返回类型见下表。
recoveryKnowledgeKeyMatches函数recoveryKnowledgeKeyMatches(expected: RecoveryKnowledgeKey, actual: RecoveryKnowledgeKey): booleanRecovery Knowledge Key Matches 函数,提供 1 个公开调用签名;参数与返回类型见下表。
recoveryKnowledgeScopeMatches函数recoveryKnowledgeScopeMatches(expected: RecoveryKnowledgeScope | undefined, actual: RecoveryKnowledgeScope | undefined): booleanRecovery Knowledge Scope Matches 函数,提供 1 个公开调用签名;参数与返回类型见下表。
stableRecoveryHash函数stableRecoveryHash(value: unknown): stringStable Recovery Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。
RecoveryAttemptRecord接口interface RecoveryAttemptRecordRecovery Attempt Record 接口,共包含 12 个公开字段或方法。
RecoveryCaseSnapshot接口interface RecoveryCaseSnapshotRecovery Case Snapshot 接口,共包含 15 个公开字段或方法。
RecoveryConvergencePolicy接口interface RecoveryConvergencePolicyRecovery Convergence Policy 接口,共包含 6 个公开字段或方法。
RecoveryEvidence接口interface RecoveryEvidenceFacts that can prove whether a recovery attempt changed the underlying state. Callers should prefer stable revisions, receipts, checksums, and provider state over human-readable messages.
RecoveryFailure接口interface RecoveryFailureRecovery Failure 接口,共包含 14 个公开字段或方法。
RecoveryKnowledge接口interface RecoveryKnowledgeRecovery Knowledge 接口,共包含 7 个公开字段或方法。
RecoveryKnowledgeKey接口interface RecoveryKnowledgeKeyRecovery Knowledge Key 接口,共包含 6 个公开字段或方法。
RecoveryKnowledgePort接口interface RecoveryKnowledgePortCache implementations are hints only. The supervisor must revalidate a hit.
RecoveryKnowledgeScope接口interface RecoveryKnowledgeScopeRecovery Knowledge Scope 接口,共包含 6 个公开字段或方法。
RecoveryCaseStatus类型type RecoveryCaseStatus = 'active' | 'suspended' | 'recovered' | 'degraded' | 'compensated' | 'quarantined' | 'failed' | 'cancelled'Recovery Case Status 公共类型别名;完整类型表达式见声明。
RecoveryCategory类型type RecoveryCategory = (typeof RECOVERY_CATEGORIES)[number]Recovery Category 公共类型别名;完整类型表达式见声明。
RecoveryModule类型type RecoveryModule = (typeof RECOVERY_MODULES)[number]Recovery Module 公共类型别名;完整类型表达式见声明。
RecoverySideEffectState类型type RecoverySideEffectState = 'none' | 'not_started' | 'committed' | 'unknown'Recovery Side Effect State 公共类型别名;完整类型表达式见声明。
RecoveryStrategy类型type RecoveryStrategy = (typeof RECOVERY_STRATEGIES)[number]Recovery Strategy 公共类型别名;完整类型表达式见声明。

defaultRecoveryConvergencePolicy

contracts/recovery 模块导出的 Default Recovery Convergence Policy 常量。

  • 种类: 常量
  • 导入: import { defaultRecoveryConvergencePolicy } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare const defaultRecoveryConvergencePolicy: RecoveryConvergencePolicy;

RECOVERY_CATEGORIES

contracts/recovery 模块导出的 RECOVERY CATEGORIES 常量。

  • 种类: 常量
  • 导入: import { RECOVERY_CATEGORIES } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare const RECOVERY_CATEGORIES: readonly ["validation", "policy_denied", "authentication", "authorization", "rate_limit", "timeout", "transient_dependency", "permanent_dependency", "concurrency_conflict", "resource_exhausted", "tool_failure", "inference_failure", "memory_failure", "execution_failure", "storage_failure", "message_failure", "cache_failure", "invariant_violation", "cancellation", "unknown"];

RECOVERY_MODULES

contracts/recovery 模块导出的 RECOVERY MODULES 常量。

  • 种类: 常量
  • 导入: import { RECOVERY_MODULES } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare const RECOVERY_MODULES: readonly ["fsm", "inference", "tool", "memory", "execution", "mcp", "workspace", "storage", "message_bus", "cache", "policy", "domain", "unknown"];

RECOVERY_STRATEGIES

contracts/recovery 模块导出的 RECOVERY STRATEGIES 常量。

  • 种类: 常量
  • 导入: import { RECOVERY_STRATEGIES } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare const RECOVERY_STRATEGIES: readonly ["retry", "reconcile", "fallback", "degrade", "compensate", "wait", "human_review", "quarantine", "fail", "cancel"];

recoveryEvidenceHash

Recovery Evidence Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { recoveryEvidenceHash } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare function recoveryEvidenceHash(evidence: RecoveryEvidence): string;

调用签名

text
recoveryEvidenceHash(evidence: RecoveryEvidence): string

参数

参数类型必需说明
evidenceRecoveryEvidence必需参数;接受的值由类型列定义。

返回值

  • 类型: string
  • 说明: 返回值契约由上述类型定义。

recoveryFailureFingerprint

Recovery Failure Fingerprint 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { recoveryFailureFingerprint } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare function recoveryFailureFingerprint(failure: RecoveryFailure): string;

调用签名

text
recoveryFailureFingerprint(failure: RecoveryFailure): string

参数

参数类型必需说明
failureRecoveryFailure必需参数;接受的值由类型列定义。

返回值

  • 类型: string
  • 说明: 返回值契约由上述类型定义。

recoveryKnowledgeKeyMatches

Recovery Knowledge Key Matches 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { recoveryKnowledgeKeyMatches } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare function recoveryKnowledgeKeyMatches(expected: RecoveryKnowledgeKey, actual: RecoveryKnowledgeKey): boolean;

调用签名

text
recoveryKnowledgeKeyMatches(expected: RecoveryKnowledgeKey, actual: RecoveryKnowledgeKey): boolean

参数

参数类型必需说明
expectedRecoveryKnowledgeKey必需参数;接受的值由类型列定义。
actualRecoveryKnowledgeKey必需参数;接受的值由类型列定义。

返回值

  • 类型: boolean
  • 说明: 返回值契约由上述类型定义。

recoveryKnowledgeScopeMatches

Recovery Knowledge Scope Matches 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { recoveryKnowledgeScopeMatches } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare function recoveryKnowledgeScopeMatches(expected: RecoveryKnowledgeScope | undefined, actual: RecoveryKnowledgeScope | undefined): boolean;

调用签名

text
recoveryKnowledgeScopeMatches(expected: RecoveryKnowledgeScope | undefined, actual: RecoveryKnowledgeScope | undefined): boolean

参数

参数类型必需说明
expectedRecoveryKnowledgeScope必需参数;接受的值由类型列定义。
actualRecoveryKnowledgeScope必需参数;接受的值由类型列定义。

返回值

  • 类型: boolean
  • 说明: 返回值契约由上述类型定义。

stableRecoveryHash

Stable Recovery Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { stableRecoveryHash } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export declare function stableRecoveryHash(value: unknown): string;

调用签名

text
stableRecoveryHash(value: unknown): string

参数

参数类型必需说明
valueunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: string
  • 说明: 返回值契约由上述类型定义。

RecoveryAttemptRecord

Recovery Attempt Record 接口,共包含 12 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryAttemptRecord } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryAttemptRecord {
    cycle: number;
    participantId: string;
    module: RecoveryModule;
    strategy: RecoveryStrategy;
    fingerprint: string;
    startedAt: string;
    completedAt?: string;
    status: 'started' | 'succeeded' | 'failed' | 'no_progress' | 'skipped';
    evidenceBeforeHash: string;
    evidenceAfterHash?: string;
    errorCode?: string;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
completedAt属性completedAt?: string公开属性;类型、只读和可选状态以签名列为准。
cycle属性cycle: number公开属性;类型、只读和可选状态以签名列为准。
errorCode属性errorCode?: string公开属性;类型、只读和可选状态以签名列为准。
evidenceAfterHash属性evidenceAfterHash?: string公开属性;类型、只读和可选状态以签名列为准。
evidenceBeforeHash属性evidenceBeforeHash: string公开属性;类型、只读和可选状态以签名列为准。
fingerprint属性fingerprint: string公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
module属性module: "memory" | "domain" | "mcp" | "policy" | "workspace" | "tool" | "unknown" | "execution" | "fsm" | "inference" | "storage" | "message_bus" | "cache"公开属性;类型、只读和可选状态以签名列为准。
participantId属性participantId: string公开属性;类型、只读和可选状态以签名列为准。
startedAt属性startedAt: string公开属性;类型、只读和可选状态以签名列为准。
status属性status: "failed" | "started" | "succeeded" | "no_progress" | "skipped"公开属性;类型、只读和可选状态以签名列为准。
strategy属性strategy: "fail" | "retry" | "human_review" | "reconcile" | "fallback" | "degrade" | "compensate" | "wait" | "quarantine" | "cancel"公开属性;类型、只读和可选状态以签名列为准。

RecoveryCaseSnapshot

Recovery Case Snapshot 接口,共包含 15 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryCaseSnapshot } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryCaseSnapshot {
    id: string;
    runId: string;
    fsmState: string;
    rootFingerprint: string;
    status: RecoveryCaseStatus;
    openedAt: string;
    updatedAt: string;
    cycles: number;
    noProgressCycles: number;
    lastEvidenceHash: string;
    lastFailure?: RecoveryFailure;
    attempts: RecoveryAttemptRecord[];
    outputs: Record<string, unknown>;
    degradedParticipants: string[];
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
attempts属性attempts: RecoveryAttemptRecord[]公开属性;类型、只读和可选状态以签名列为准。
cycles属性cycles: number公开属性;类型、只读和可选状态以签名列为准。
degradedParticipants属性degradedParticipants: string[]公开属性;类型、只读和可选状态以签名列为准。
fsmState属性fsmState: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
lastEvidenceHash属性lastEvidenceHash: string公开属性;类型、只读和可选状态以签名列为准。
lastFailure属性lastFailure?: RecoveryFailure公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
noProgressCycles属性noProgressCycles: number公开属性;类型、只读和可选状态以签名列为准。
openedAt属性openedAt: string公开属性;类型、只读和可选状态以签名列为准。
outputs属性outputs: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
rootFingerprint属性rootFingerprint: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
status属性status: RecoveryCaseStatus公开属性;类型、只读和可选状态以签名列为准。
updatedAt属性updatedAt: string公开属性;类型、只读和可选状态以签名列为准。

RecoveryConvergencePolicy

Recovery Convergence Policy 接口,共包含 6 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryConvergencePolicy } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryConvergencePolicy {
    maxCycles: number;
    maxNoProgressCycles: number;
    maxSameStrategyAttempts: number;
    maxElapsedMs: number;
    onNoProgress: Extract<RecoveryStrategy, 'fallback' | 'degrade' | 'human_review' | 'quarantine' | 'fail'>;
    onExhausted: Extract<RecoveryStrategy, 'human_review' | 'quarantine' | 'fail'>;
}

契约成员

成员种类签名说明
maxCycles属性maxCycles: number公开属性;类型、只读和可选状态以签名列为准。
maxElapsedMs属性maxElapsedMs: number公开属性;类型、只读和可选状态以签名列为准。
maxNoProgressCycles属性maxNoProgressCycles: number公开属性;类型、只读和可选状态以签名列为准。
maxSameStrategyAttempts属性maxSameStrategyAttempts: number公开属性;类型、只读和可选状态以签名列为准。
onExhausted属性onExhausted: "fail" | "human_review" | "quarantine"公开属性;类型、只读和可选状态以签名列为准。
onNoProgress属性onNoProgress: "fail" | "human_review" | "fallback" | "degrade" | "quarantine"公开属性;类型、只读和可选状态以签名列为准。

RecoveryEvidence

Facts that can prove whether a recovery attempt changed the underlying state. Callers should prefer stable revisions, receipts, checksums, and provider state over human-readable messages.

  • 种类: 接口
  • 导入: import type { RecoveryEvidence } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryEvidence {
    observedAt: string;
    operationKey: string;
    dependencyKey?: string;
    state?: string;
    revision?: string | number;
    receiptStatus?: 'accepted' | 'completed' | 'rejected' | 'unknown';
    idempotencyKey?: string;
    inputHash?: string;
    outputHash?: string;
    policyRevision?: string;
    specRevision?: string;
    providerRevision?: string;
    sourceHashes?: Record<string, string>;
    markers?: Record<string, string | number | boolean | null>;
}

契约成员

成员种类签名说明
dependencyKey属性dependencyKey?: string公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey?: string公开属性;类型、只读和可选状态以签名列为准。
inputHash属性inputHash?: string公开属性;类型、只读和可选状态以签名列为准。
markers属性markers?: Record<string, string | number | boolean>公开属性;类型、只读和可选状态以签名列为准。
observedAt属性observedAt: string公开属性;类型、只读和可选状态以签名列为准。
operationKey属性operationKey: string公开属性;类型、只读和可选状态以签名列为准。
outputHash属性outputHash?: string公开属性;类型、只读和可选状态以签名列为准。
policyRevision属性policyRevision?: string公开属性;类型、只读和可选状态以签名列为准。
providerRevision属性providerRevision?: string公开属性;类型、只读和可选状态以签名列为准。
receiptStatus属性receiptStatus?: "unknown" | "accepted" | "completed" | "rejected"公开属性;类型、只读和可选状态以签名列为准。
revision属性revision?: string | number公开属性;类型、只读和可选状态以签名列为准。
sourceHashes属性sourceHashes?: Record<string, string>公开属性;类型、只读和可选状态以签名列为准。
specRevision属性specRevision?: string公开属性;类型、只读和可选状态以签名列为准。
state属性state?: string公开属性;类型、只读和可选状态以签名列为准。

RecoveryFailure

Recovery Failure 接口,共包含 14 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryFailure } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryFailure {
    id: string;
    module: RecoveryModule;
    category: RecoveryCategory;
    code: string;
    message: string;
    occurredAt: string;
    retryable: boolean;
    sideEffectState: RecoverySideEffectState;
    compensationAvailable?: boolean;
    retryAfterMs?: number;
    circuitKey?: string;
    rootCauseKey?: string;
    evidence: RecoveryEvidence;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
category属性category: "unknown" | "cancellation" | "timeout" | "validation" | "policy_denied" | "authentication" | "authorization" | "rate_limit" | "transient_dependency" | "permanent_dependency" | "concurrency_conflict" | "resource_exhausted" | "tool_failure" | "inference_failure" | "memory_failure" | "execution_failure" | "storage_failure" | "message_failure" | "cache_failure" | "invariant_violation"公开属性;类型、只读和可选状态以签名列为准。
circuitKey属性circuitKey?: string公开属性;类型、只读和可选状态以签名列为准。
code属性code: string公开属性;类型、只读和可选状态以签名列为准。
compensationAvailable属性compensationAvailable?: boolean公开属性;类型、只读和可选状态以签名列为准。
evidence属性evidence: RecoveryEvidence公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
message属性message: string公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
module属性module: "memory" | "domain" | "mcp" | "policy" | "workspace" | "tool" | "unknown" | "execution" | "fsm" | "inference" | "storage" | "message_bus" | "cache"公开属性;类型、只读和可选状态以签名列为准。
occurredAt属性occurredAt: string公开属性;类型、只读和可选状态以签名列为准。
retryable属性retryable: boolean公开属性;类型、只读和可选状态以签名列为准。
retryAfterMs属性retryAfterMs?: number公开属性;类型、只读和可选状态以签名列为准。
rootCauseKey属性rootCauseKey?: string公开属性;类型、只读和可选状态以签名列为准。
sideEffectState属性sideEffectState: RecoverySideEffectState公开属性;类型、只读和可选状态以签名列为准。

RecoveryKnowledge

Recovery Knowledge 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryKnowledge } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryKnowledge {
    key: RecoveryKnowledgeKey;
    strategy: RecoveryStrategy;
    outcome: Extract<RecoveryCaseStatus, 'recovered' | 'degraded' | 'compensated' | 'failed'>;
    evidenceHash: string;
    learnedAt: string;
    expiresAt?: string;
    validation: {
        status: 'verified' | 'negative';
        sourceEventId?: string;
        proof?: Record<string, unknown>;
    };
}

契约成员

成员种类签名说明
evidenceHash属性evidenceHash: string公开属性;类型、只读和可选状态以签名列为准。
expiresAt属性expiresAt?: string公开属性;类型、只读和可选状态以签名列为准。
key属性key: RecoveryKnowledgeKey公开属性;类型、只读和可选状态以签名列为准。
learnedAt属性learnedAt: string公开属性;类型、只读和可选状态以签名列为准。
outcome属性outcome: "degraded" | "failed" | "recovered" | "compensated"公开属性;类型、只读和可选状态以签名列为准。
strategy属性strategy: "fail" | "retry" | "human_review" | "reconcile" | "fallback" | "degrade" | "compensate" | "wait" | "quarantine" | "cancel"公开属性;类型、只读和可选状态以签名列为准。
validation属性validation: { status: "verified" | "negative"; sourceEventId?: string; proof?: Record<string, unknown>; }公开属性;类型、只读和可选状态以签名列为准。

RecoveryKnowledgeKey

Recovery Knowledge Key 接口,共包含 6 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryKnowledgeKey } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryKnowledgeKey {
    fingerprint: string;
    participantId: string;
    /**
     * New runtime writes always include scope. Absence is accepted only for
     * legacy Provider migration and must not be persisted by strict adapters.
     */
    scope?: RecoveryKnowledgeScope;
    policyRevision?: string;
    specRevision?: string;
    providerRevision?: string;
}

契约成员

成员种类签名说明
fingerprint属性fingerprint: string公开属性;类型、只读和可选状态以签名列为准。
participantId属性participantId: string公开属性;类型、只读和可选状态以签名列为准。
policyRevision属性policyRevision?: string公开属性;类型、只读和可选状态以签名列为准。
providerRevision属性providerRevision?: string公开属性;类型、只读和可选状态以签名列为准。
scope属性scope?: RecoveryKnowledgeScopeNew runtime writes always include scope. Absence is accepted only for legacy Provider migration and must not be persisted by strict adapters.
specRevision属性specRevision?: string公开属性;类型、只读和可选状态以签名列为准。

RecoveryKnowledgePort

Cache implementations are hints only. The supervisor must revalidate a hit.

  • 种类: 接口
  • 导入: import type { RecoveryKnowledgePort } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryKnowledgePort {
    get(key: RecoveryKnowledgeKey): Promise<RecoveryKnowledge | null>;
    put(knowledge: RecoveryKnowledge): Promise<void>;
    invalidate(key: RecoveryKnowledgeKey, reason: string): Promise<void>;
}

契约成员

成员种类签名说明
get方法get(key: RecoveryKnowledgeKey): Promise<RecoveryKnowledge | null>公开方法;参数与返回类型以签名列为准。
invalidate方法invalidate(key: RecoveryKnowledgeKey, reason: string): Promise<void>公开方法;参数与返回类型以签名列为准。
put方法put(knowledge: RecoveryKnowledge): Promise<void>公开方法;参数与返回类型以签名列为准。

RecoveryKnowledgeScope

Recovery Knowledge Scope 接口,共包含 6 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RecoveryKnowledgeScope } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export interface RecoveryKnowledgeScope {
    tenantId?: string;
    userId: string;
    workspaceId?: string;
    sessionId?: string;
    agentId?: string;
    domainPackId?: string;
}

契约成员

成员种类签名说明
agentId属性agentId?: string公开属性;类型、只读和可选状态以签名列为准。
domainPackId属性domainPackId?: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId?: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。
workspaceId属性workspaceId?: string公开属性;类型、只读和可选状态以签名列为准。

RecoveryCaseStatus

Recovery Case Status 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { RecoveryCaseStatus } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export type RecoveryCaseStatus = 'active' | 'suspended' | 'recovered' | 'degraded' | 'compensated' | 'quarantined' | 'failed' | 'cancelled';

RecoveryCategory

Recovery Category 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { RecoveryCategory } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export type RecoveryCategory = (typeof RECOVERY_CATEGORIES)[number];

RecoveryModule

Recovery Module 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { RecoveryModule } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export type RecoveryModule = (typeof RECOVERY_MODULES)[number];

RecoverySideEffectState

Recovery Side Effect State 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { RecoverySideEffectState } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export type RecoverySideEffectState = 'none' | 'not_started' | 'committed' | 'unknown';

RecoveryStrategy

Recovery Strategy 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { RecoveryStrategy } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/recovery

声明

text
export type RecoveryStrategy = (typeof RECOVERY_STRATEGIES)[number];