Skip to content

@codesoul-co/hypha-core / contracts/runtime-coordination

模块用法

用于声明并运行时校验契约。Runtime coordination 模块公开 3 常量、28 接口、3 类型。

从包入口导入

ts
import {
  RUNTIME_RESOURCE_CLAIM_MODES,
  RUNTIME_RESOURCE_TYPES,
  STATE_EXECUTION_CLAIM_STATUSES,
} from '@codesoul-co/hypha-core';

import type {
  FencedRunLease,
  ResourceAcquireRequest,
  ResourceClaimAssertionRequest,
  ResourceListRequest,
  ResourceReleaseRequest,
  ResourceRenewRequest,
  RunLease,
  RunLeaseAcquireRequest,
} from '@codesoul-co/hypha-core';

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

使用要点

  • 31 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 3 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

公共导出

Symbol种类签名说明
RUNTIME_RESOURCE_CLAIM_MODES常量const RUNTIME_RESOURCE_CLAIM_MODES: readonly ["shared", "exclusive"]contracts/runtime-coordination 模块导出的 RUNTIME RESOURCE CLAIM MODES 常量。
RUNTIME_RESOURCE_TYPES常量const RUNTIME_RESOURCE_TYPES: readonly ["workspace", "artifact", "tool_scope", "memory_scope", "external_account", "custom"]contracts/runtime-coordination 模块导出的 RUNTIME RESOURCE TYPES 常量。
STATE_EXECUTION_CLAIM_STATUSES常量const STATE_EXECUTION_CLAIM_STATUSES: readonly ["claimed", "completed", "released", "expired"]contracts/runtime-coordination 模块导出的 STATE EXECUTION CLAIM STATUSES 常量。
FencedRunLease接口interface FencedRunLease extends RunLeaseFenced Run Lease 接口,共包含 11 个公开字段或方法。
ResourceAcquireRequest接口interface ResourceAcquireRequestResource Acquire Request 接口,共包含 6 个公开字段或方法。
ResourceClaimAssertionRequest接口interface ResourceClaimAssertionRequest extends ResourceListRequestResource Claim Assertion Request 接口,共包含 7 个公开字段或方法。
ResourceListRequest接口interface ResourceListRequestResource List Request 接口,共包含 4 个公开字段或方法。
ResourceReleaseRequest接口interface ResourceReleaseRequestResource Release Request 接口,共包含 3 个公开字段或方法。
ResourceRenewRequest接口interface ResourceRenewRequestResource Renew Request 接口,共包含 4 个公开字段或方法。
RunLease接口interface RunLeaseRun Lease 接口,共包含 9 个公开字段或方法。
RunLeaseAcquireRequest接口interface RunLeaseAcquireRequest extends RunLeaseScopeRun Lease Acquire Request 接口,共包含 9 个公开字段或方法。
RunLeaseAssertionRequest接口interface RunLeaseAssertionRequestRun Lease Assertion Request 接口,共包含 3 个公开字段或方法。
RunLeaseAuthorization接口interface RunLeaseAuthorizationRun Lease Authorization 接口,共包含 2 个公开字段或方法。
RunLeaseGuard接口interface RunLeaseGuardRun Lease Guard 接口,共包含 3 个公开字段或方法。
RunLeaseHeartbeatRequest接口interface RunLeaseHeartbeatRequestRun Lease Heartbeat Request 接口,共包含 4 个公开字段或方法。
RunLeasePreemptRequest接口interface RunLeasePreemptRequest extends RunLeaseAcquireRequestRun Lease Preempt Request 接口,共包含 10 个公开字段或方法。
RunLeaseReleaseRequest接口interface RunLeaseReleaseRequestRun Lease Release Request 接口,共包含 3 个公开字段或方法。
RunLeaseScope接口interface RunLeaseScopeRun Lease Scope 接口,共包含 4 个公开字段或方法。
RunLeaseStore接口interface RunLeaseStoreRun Lease Store 接口,共包含 6 个公开字段或方法。
RuntimeResourceClaim接口interface RuntimeResourceClaimRuntime Resource Claim 接口,共包含 14 个公开字段或方法。
RuntimeResourceCoordinator接口interface RuntimeResourceCoordinatorRuntime Resource Coordinator 接口,共包含 5 个公开字段或方法。
RuntimeResourceRequest接口interface RuntimeResourceRequestRuntime Resource Request 接口,共包含 5 个公开字段或方法。
StateExecutionClaim接口interface StateExecutionClaim extends StateExecutionClaimScopeState Execution Claim 接口,共包含 15 个公开字段或方法。
StateExecutionClaimAcquireRequest接口interface StateExecutionClaimAcquireRequest extends StateExecutionClaimScopeState Execution Claim Acquire Request 接口,共包含 12 个公开字段或方法。
StateExecutionClaimAssertionRequest接口interface StateExecutionClaimAssertionRequestState Execution Claim Assertion Request 接口,共包含 3 个公开字段或方法。
StateExecutionClaimCompleteRequest接口interface StateExecutionClaimCompleteRequestState Execution Claim Complete Request 接口,共包含 4 个公开字段或方法。
StateExecutionClaimGuard接口interface StateExecutionClaimGuardState Execution Claim Guard 接口,共包含 3 个公开字段或方法。
StateExecutionClaimReleaseRequest接口interface StateExecutionClaimReleaseRequestState Execution Claim Release Request 接口,共包含 4 个公开字段或方法。
StateExecutionClaimRenewRequest接口interface StateExecutionClaimRenewRequestState Execution Claim Renew Request 接口,共包含 5 个公开字段或方法。
StateExecutionClaimScope接口interface StateExecutionClaimScopeState Execution Claim Scope 接口,共包含 5 个公开字段或方法。
StateExecutionClaimStore接口interface StateExecutionClaimStoreState Execution Claim Store 接口,共包含 6 个公开字段或方法。
RuntimeResourceClaimMode类型type RuntimeResourceClaimMode = (typeof RUNTIME_RESOURCE_CLAIM_MODES)[number]Runtime Resource Claim Mode 公共类型别名;完整类型表达式见声明。
RuntimeResourceType类型type RuntimeResourceType = (typeof RUNTIME_RESOURCE_TYPES)[number]Runtime Resource Type 公共类型别名;完整类型表达式见声明。
StateExecutionClaimStatus类型type StateExecutionClaimStatus = (typeof STATE_EXECUTION_CLAIM_STATUSES)[number]State Execution Claim Status 公共类型别名;完整类型表达式见声明。

RUNTIME_RESOURCE_CLAIM_MODES

contracts/runtime-coordination 模块导出的 RUNTIME RESOURCE CLAIM MODES 常量。

声明

text
export declare const RUNTIME_RESOURCE_CLAIM_MODES: readonly ["shared", "exclusive"];

RUNTIME_RESOURCE_TYPES

contracts/runtime-coordination 模块导出的 RUNTIME RESOURCE TYPES 常量。

声明

text
export declare const RUNTIME_RESOURCE_TYPES: readonly ["workspace", "artifact", "tool_scope", "memory_scope", "external_account", "custom"];

STATE_EXECUTION_CLAIM_STATUSES

contracts/runtime-coordination 模块导出的 STATE EXECUTION CLAIM STATUSES 常量。

声明

text
export declare const STATE_EXECUTION_CLAIM_STATUSES: readonly ["claimed", "completed", "released", "expired"];

FencedRunLease

Fenced Run Lease 接口,共包含 11 个公开字段或方法。

声明

text
export interface FencedRunLease extends RunLease {
    fencingToken: number;
    partitionKey: string;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
expiresAt属性expiresAt: string公开属性;类型、只读和可选状态以签名列为准。
fencingToken属性fencingToken: number公开属性;类型、只读和可选状态以签名列为准。
heartbeatAt属性heartbeatAt: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
partitionKey属性partitionKey: string公开属性;类型、只读和可选状态以签名列为准。
revision属性revision: number公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

ResourceAcquireRequest

Resource Acquire Request 接口,共包含 6 个公开字段或方法。

声明

text
export interface ResourceAcquireRequest {
    runLease: RunLeaseAuthorization;
    stateId?: string;
    resources: RuntimeResourceRequest[];
    ttlMs: number;
    acquiredAt: string;
    idempotencyKey: string;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey: string公开属性;类型、只读和可选状态以签名列为准。
resources属性resources: RuntimeResourceRequest[]公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。
stateId属性stateId?: string公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。

ResourceClaimAssertionRequest

Resource Claim Assertion Request 接口,共包含 7 个公开字段或方法。

声明

text
export interface ResourceClaimAssertionRequest extends ResourceListRequest {
    claimId: string;
    ownerId: string;
    fencingToken: number;
}

契约成员

成员种类签名说明
checkedAt属性checkedAt: string公开属性;类型、只读和可选状态以签名列为准。
claimId属性claimId: string公开属性;类型、只读和可选状态以签名列为准。
fencingToken属性fencingToken: number公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
resourceKey属性resourceKey: string公开属性;类型、只读和可选状态以签名列为准。
resourceType属性resourceType: "artifact" | "workspace" | "custom" | "tool_scope" | "memory_scope" | "external_account"公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。

ResourceListRequest

Resource List Request 接口,共包含 4 个公开字段或方法。

声明

text
export interface ResourceListRequest {
    tenantId?: string;
    resourceType: RuntimeResourceType;
    resourceKey: string;
    checkedAt: string;
}

契约成员

成员种类签名说明
checkedAt属性checkedAt: string公开属性;类型、只读和可选状态以签名列为准。
resourceKey属性resourceKey: string公开属性;类型、只读和可选状态以签名列为准。
resourceType属性resourceType: "artifact" | "workspace" | "custom" | "tool_scope" | "memory_scope" | "external_account"公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。

ResourceReleaseRequest

Resource Release Request 接口,共包含 3 个公开字段或方法。

声明

text
export interface ResourceReleaseRequest {
    runLease: RunLeaseAuthorization;
    claimIds: string[];
    releasedAt: string;
}

契约成员

成员种类签名说明
claimIds属性claimIds: string[]公开属性;类型、只读和可选状态以签名列为准。
releasedAt属性releasedAt: string公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。

ResourceRenewRequest

Resource Renew Request 接口,共包含 4 个公开字段或方法。

声明

text
export interface ResourceRenewRequest {
    runLease: RunLeaseAuthorization;
    claimIds: string[];
    ttlMs: number;
    renewedAt: string;
}

契约成员

成员种类签名说明
claimIds属性claimIds: string[]公开属性;类型、只读和可选状态以签名列为准。
renewedAt属性renewedAt: string公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。

RunLease

Run Lease 接口,共包含 9 个公开字段或方法。

声明

text
export interface RunLease {
    id: string;
    tenantId?: string;
    userId: string;
    runId: string;
    ownerId: string;
    acquiredAt: string;
    expiresAt: string;
    heartbeatAt: string;
    revision: number;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
expiresAt属性expiresAt: string公开属性;类型、只读和可选状态以签名列为准。
heartbeatAt属性heartbeatAt: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
revision属性revision: number公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

RunLeaseAcquireRequest

Run Lease Acquire Request 接口,共包含 9 个公开字段或方法。

声明

text
export interface RunLeaseAcquireRequest extends RunLeaseScope {
    requestedLeaseId: string;
    ownerId: string;
    ttlMs: number;
    acquiredAt: string;
    idempotencyKey: string;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey: string公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
partitionKey属性partitionKey: string公开属性;类型、只读和可选状态以签名列为准。
requestedLeaseId属性requestedLeaseId: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

RunLeaseAssertionRequest

Run Lease Assertion Request 接口,共包含 3 个公开字段或方法。

声明

text
export interface RunLeaseAssertionRequest {
    scope: RunLeaseScope;
    guard: RunLeaseGuard;
    checkedAt: string;
}

契约成员

成员种类签名说明
checkedAt属性checkedAt: string公开属性;类型、只读和可选状态以签名列为准。
guard属性guard: RunLeaseGuard公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RunLeaseScope公开属性;类型、只读和可选状态以签名列为准。

RunLeaseAuthorization

Run Lease Authorization 接口,共包含 2 个公开字段或方法。

声明

text
export interface RunLeaseAuthorization {
    scope: RunLeaseScope;
    guard: RunLeaseGuard;
}

契约成员

成员种类签名说明
guard属性guard: RunLeaseGuard公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RunLeaseScope公开属性;类型、只读和可选状态以签名列为准。

RunLeaseGuard

Run Lease Guard 接口,共包含 3 个公开字段或方法。

声明

text
export interface RunLeaseGuard {
    leaseId: string;
    ownerId: string;
    fencingToken: number;
}

契约成员

成员种类签名说明
fencingToken属性fencingToken: number公开属性;类型、只读和可选状态以签名列为准。
leaseId属性leaseId: string公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。

RunLeaseHeartbeatRequest

Run Lease Heartbeat Request 接口,共包含 4 个公开字段或方法。

声明

text
export interface RunLeaseHeartbeatRequest {
    scope: RunLeaseScope;
    guard: RunLeaseGuard;
    ttlMs: number;
    heartbeatAt: string;
}

契约成员

成员种类签名说明
guard属性guard: RunLeaseGuard公开属性;类型、只读和可选状态以签名列为准。
heartbeatAt属性heartbeatAt: string公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RunLeaseScope公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。

RunLeasePreemptRequest

Run Lease Preempt Request 接口,共包含 10 个公开字段或方法。

声明

text
export interface RunLeasePreemptRequest extends RunLeaseAcquireRequest {
    reason: 'cancellation';
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey: string公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
partitionKey属性partitionKey: string公开属性;类型、只读和可选状态以签名列为准。
reason属性reason: "cancellation"公开属性;类型、只读和可选状态以签名列为准。
requestedLeaseId属性requestedLeaseId: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

RunLeaseReleaseRequest

Run Lease Release Request 接口,共包含 3 个公开字段或方法。

声明

text
export interface RunLeaseReleaseRequest {
    scope: RunLeaseScope;
    guard: RunLeaseGuard;
    releasedAt: string;
}

契约成员

成员种类签名说明
guard属性guard: RunLeaseGuard公开属性;类型、只读和可选状态以签名列为准。
releasedAt属性releasedAt: string公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RunLeaseScope公开属性;类型、只读和可选状态以签名列为准。

RunLeaseScope

Run Lease Scope 接口,共包含 4 个公开字段或方法。

声明

text
export interface RunLeaseScope {
    tenantId?: string;
    userId: string;
    runId: string;
    partitionKey: string;
}

契约成员

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

RunLeaseStore

Run Lease Store 接口,共包含 6 个公开字段或方法。

声明

text
export interface RunLeaseStore {
    acquire(request: RunLeaseAcquireRequest): Promise<FencedRunLease | null>;
    preempt(request: RunLeasePreemptRequest): Promise<FencedRunLease>;
    heartbeat(request: RunLeaseHeartbeatRequest): Promise<FencedRunLease>;
    release(request: RunLeaseReleaseRequest): Promise<void>;
    get(scope: RunLeaseScope, checkedAt?: string): Promise<FencedRunLease | null>;
    assertCurrent(request: RunLeaseAssertionRequest): Promise<FencedRunLease>;
}

契约成员

成员种类签名说明
acquire方法acquire(request: RunLeaseAcquireRequest): Promise<FencedRunLease | null>公开方法;参数与返回类型以签名列为准。
assertCurrent方法assertCurrent(request: RunLeaseAssertionRequest): Promise<FencedRunLease>公开方法;参数与返回类型以签名列为准。
get方法get(scope: RunLeaseScope, checkedAt?: string): Promise<FencedRunLease | null>公开方法;参数与返回类型以签名列为准。
heartbeat方法heartbeat(request: RunLeaseHeartbeatRequest): Promise<FencedRunLease>公开方法;参数与返回类型以签名列为准。
preempt方法preempt(request: RunLeasePreemptRequest): Promise<FencedRunLease>公开方法;参数与返回类型以签名列为准。
release方法release(request: RunLeaseReleaseRequest): Promise<void>公开方法;参数与返回类型以签名列为准。

RuntimeResourceClaim

Runtime Resource Claim 接口,共包含 14 个公开字段或方法。

声明

text
export interface RuntimeResourceClaim {
    id: string;
    tenantId?: string;
    userId: string;
    resourceType: RuntimeResourceType;
    resourceKey: string;
    mode: RuntimeResourceClaimMode;
    runId: string;
    stateId?: string;
    ownerId: string;
    fencingToken: number;
    runFencingToken: number;
    acquiredAt: string;
    expiresAt: string;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
expiresAt属性expiresAt: string公开属性;类型、只读和可选状态以签名列为准。
fencingToken属性fencingToken: number公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
mode属性mode: "shared" | "exclusive"公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
resourceKey属性resourceKey: string公开属性;类型、只读和可选状态以签名列为准。
resourceType属性resourceType: "artifact" | "workspace" | "custom" | "tool_scope" | "memory_scope" | "external_account"公开属性;类型、只读和可选状态以签名列为准。
runFencingToken属性runFencingToken: number公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
stateId属性stateId?: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

RuntimeResourceCoordinator

Runtime Resource Coordinator 接口,共包含 5 个公开字段或方法。

声明

text
export interface RuntimeResourceCoordinator {
    acquire(request: ResourceAcquireRequest): Promise<RuntimeResourceClaim[]>;
    renew(request: ResourceRenewRequest): Promise<RuntimeResourceClaim[]>;
    release(request: ResourceReleaseRequest): Promise<void>;
    list(request: ResourceListRequest): Promise<RuntimeResourceClaim[]>;
    assertCurrent(request: ResourceClaimAssertionRequest): Promise<RuntimeResourceClaim>;
}

契约成员

成员种类签名说明
acquire方法acquire(request: ResourceAcquireRequest): Promise<RuntimeResourceClaim[]>公开方法;参数与返回类型以签名列为准。
assertCurrent方法assertCurrent(request: ResourceClaimAssertionRequest): Promise<RuntimeResourceClaim>公开方法;参数与返回类型以签名列为准。
list方法list(request: ResourceListRequest): Promise<RuntimeResourceClaim[]>公开方法;参数与返回类型以签名列为准。
release方法release(request: ResourceReleaseRequest): Promise<void>公开方法;参数与返回类型以签名列为准。
renew方法renew(request: ResourceRenewRequest): Promise<RuntimeResourceClaim[]>公开方法;参数与返回类型以签名列为准。

RuntimeResourceRequest

Runtime Resource Request 接口,共包含 5 个公开字段或方法。

声明

text
export interface RuntimeResourceRequest {
    requestedClaimId: string;
    resourceType: RuntimeResourceType;
    resourceKey: string;
    mode: RuntimeResourceClaimMode;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
mode属性mode: "shared" | "exclusive"公开属性;类型、只读和可选状态以签名列为准。
requestedClaimId属性requestedClaimId: string公开属性;类型、只读和可选状态以签名列为准。
resourceKey属性resourceKey: string公开属性;类型、只读和可选状态以签名列为准。
resourceType属性resourceType: "artifact" | "workspace" | "custom" | "tool_scope" | "memory_scope" | "external_account"公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaim

State Execution Claim 接口,共包含 15 个公开字段或方法。

声明

text
export interface StateExecutionClaim extends StateExecutionClaimScope {
    claimId: string;
    processRevision: string;
    expectedRunRevision: number;
    fencingToken: number;
    ownerId: string;
    status: StateExecutionClaimStatus;
    acquiredAt: string;
    expiresAt: string;
    completedAt?: string;
    releasedAt?: string;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
claimId属性claimId: string公开属性;类型、只读和可选状态以签名列为准。
completedAt属性completedAt?: string公开属性;类型、只读和可选状态以签名列为准。
expectedRunRevision属性expectedRunRevision: number公开属性;类型、只读和可选状态以签名列为准。
expiresAt属性expiresAt: string公开属性;类型、只读和可选状态以签名列为准。
fencingToken属性fencingToken: number公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
processRevision属性processRevision: string公开属性;类型、只读和可选状态以签名列为准。
releasedAt属性releasedAt?: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
stateAttempt属性stateAttempt: number公开属性;类型、只读和可选状态以签名列为准。
stateId属性stateId: string公开属性;类型、只读和可选状态以签名列为准。
status属性status: "completed" | "expired" | "claimed" | "released"公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimAcquireRequest

State Execution Claim Acquire Request 接口,共包含 12 个公开字段或方法。

声明

text
export interface StateExecutionClaimAcquireRequest extends StateExecutionClaimScope {
    requestedClaimId: string;
    processRevision: string;
    expectedRunRevision: number;
    runLease: RunLeaseAuthorization;
    ttlMs: number;
    acquiredAt: string;
    idempotencyKey: string;
}

契约成员

成员种类签名说明
acquiredAt属性acquiredAt: string公开属性;类型、只读和可选状态以签名列为准。
expectedRunRevision属性expectedRunRevision: number公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey: string公开属性;类型、只读和可选状态以签名列为准。
processRevision属性processRevision: string公开属性;类型、只读和可选状态以签名列为准。
requestedClaimId属性requestedClaimId: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。
stateAttempt属性stateAttempt: number公开属性;类型、只读和可选状态以签名列为准。
stateId属性stateId: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimAssertionRequest

State Execution Claim Assertion Request 接口,共包含 3 个公开字段或方法。

声明

text
export interface StateExecutionClaimAssertionRequest {
    scope: StateExecutionClaimScope;
    guard: StateExecutionClaimGuard;
    checkedAt: string;
}

契约成员

成员种类签名说明
checkedAt属性checkedAt: string公开属性;类型、只读和可选状态以签名列为准。
guard属性guard: StateExecutionClaimGuard公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: StateExecutionClaimScope公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimCompleteRequest

State Execution Claim Complete Request 接口,共包含 4 个公开字段或方法。

声明

text
export interface StateExecutionClaimCompleteRequest {
    scope: StateExecutionClaimScope;
    guard: StateExecutionClaimGuard;
    runLease: RunLeaseAuthorization;
    completedAt: string;
}

契约成员

成员种类签名说明
completedAt属性completedAt: string公开属性;类型、只读和可选状态以签名列为准。
guard属性guard: StateExecutionClaimGuard公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: StateExecutionClaimScope公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimGuard

State Execution Claim Guard 接口,共包含 3 个公开字段或方法。

声明

text
export interface StateExecutionClaimGuard {
    claimId: string;
    ownerId: string;
    fencingToken: number;
}

契约成员

成员种类签名说明
claimId属性claimId: string公开属性;类型、只读和可选状态以签名列为准。
fencingToken属性fencingToken: number公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimReleaseRequest

State Execution Claim Release Request 接口,共包含 4 个公开字段或方法。

声明

text
export interface StateExecutionClaimReleaseRequest {
    scope: StateExecutionClaimScope;
    guard: StateExecutionClaimGuard;
    runLease: RunLeaseAuthorization;
    releasedAt: string;
}

契约成员

成员种类签名说明
guard属性guard: StateExecutionClaimGuard公开属性;类型、只读和可选状态以签名列为准。
releasedAt属性releasedAt: string公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: StateExecutionClaimScope公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimRenewRequest

State Execution Claim Renew Request 接口,共包含 5 个公开字段或方法。

声明

text
export interface StateExecutionClaimRenewRequest {
    scope: StateExecutionClaimScope;
    guard: StateExecutionClaimGuard;
    runLease: RunLeaseAuthorization;
    ttlMs: number;
    renewedAt: string;
}

契约成员

成员种类签名说明
guard属性guard: StateExecutionClaimGuard公开属性;类型、只读和可选状态以签名列为准。
renewedAt属性renewedAt: string公开属性;类型、只读和可选状态以签名列为准。
runLease属性runLease: RunLeaseAuthorization公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: StateExecutionClaimScope公开属性;类型、只读和可选状态以签名列为准。
ttlMs属性ttlMs: number公开属性;类型、只读和可选状态以签名列为准。

StateExecutionClaimScope

State Execution Claim Scope 接口,共包含 5 个公开字段或方法。

声明

text
export interface StateExecutionClaimScope {
    tenantId?: string;
    userId: string;
    runId: string;
    stateId: string;
    stateAttempt: number;
}

契约成员

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

StateExecutionClaimStore

State Execution Claim Store 接口,共包含 6 个公开字段或方法。

声明

text
export interface StateExecutionClaimStore {
    acquire(request: StateExecutionClaimAcquireRequest): Promise<StateExecutionClaim | null>;
    renew(request: StateExecutionClaimRenewRequest): Promise<StateExecutionClaim>;
    complete(request: StateExecutionClaimCompleteRequest): Promise<StateExecutionClaim>;
    release(request: StateExecutionClaimReleaseRequest): Promise<StateExecutionClaim>;
    get(scope: StateExecutionClaimScope, checkedAt?: string): Promise<StateExecutionClaim | null>;
    assertCurrent(request: StateExecutionClaimAssertionRequest): Promise<StateExecutionClaim>;
}

契约成员

成员种类签名说明
acquire方法acquire(request: StateExecutionClaimAcquireRequest): Promise<StateExecutionClaim | null>公开方法;参数与返回类型以签名列为准。
assertCurrent方法assertCurrent(request: StateExecutionClaimAssertionRequest): Promise<StateExecutionClaim>公开方法;参数与返回类型以签名列为准。
complete方法complete(request: StateExecutionClaimCompleteRequest): Promise<StateExecutionClaim>公开方法;参数与返回类型以签名列为准。
get方法get(scope: StateExecutionClaimScope, checkedAt?: string): Promise<StateExecutionClaim | null>公开方法;参数与返回类型以签名列为准。
release方法release(request: StateExecutionClaimReleaseRequest): Promise<StateExecutionClaim>公开方法;参数与返回类型以签名列为准。
renew方法renew(request: StateExecutionClaimRenewRequest): Promise<StateExecutionClaim>公开方法;参数与返回类型以签名列为准。

RuntimeResourceClaimMode

Runtime Resource Claim Mode 公共类型别名;完整类型表达式见声明。

声明

text
export type RuntimeResourceClaimMode = (typeof RUNTIME_RESOURCE_CLAIM_MODES)[number];

RuntimeResourceType

Runtime Resource Type 公共类型别名;完整类型表达式见声明。

声明

text
export type RuntimeResourceType = (typeof RUNTIME_RESOURCE_TYPES)[number];

StateExecutionClaimStatus

State Execution Claim Status 公共类型别名;完整类型表达式见声明。

声明

text
export type StateExecutionClaimStatus = (typeof STATE_EXECUTION_CLAIM_STATUSES)[number];