@codesoul-co/hypha-core / contracts/runtime-cancellation-schemas
模块用法
用于声明并运行时校验契约。Runtime cancellation schemas 模块公开 12 常量、3 函数。
从包入口导入
import {
runtimeCancelCommandDefinition,
runtimeCancelCommandExample,
runtimeCancelCommandJsonSchema,
runtimeCancelCommandSchema,
runtimeCancellationContractDefinitions,
runtimeCancellationContractJsonSchemas,
runtimeCancellationPolicySchema,
runtimeCancellationTargetResultSchema,
} from '@codesoul-co/hypha-core';
// 完整导出列表见下方。使用要点
- 3 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
- 12 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。
运行时校验示例
import { runtimeCancelCommandSchema } from '@codesoul-co/hypha-core';
declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = runtimeCancelCommandSchema.parse(input);配置、网络请求或持久化数据等不可信输入应先通过 Runtime Schema,再传给只接受已校验契约的函数或类。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
runtimeCancelCommandDefinition | 常量 | const runtimeCancelCommandDefinition: SpecSchemaDefinition<RuntimeCancelCommand> | 由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancel Command Definition 常量。 |
runtimeCancelCommandExample | 常量 | const runtimeCancelCommandExample: RuntimeCancelCommand | Runtime Cancel Command 的有效示例值。 |
runtimeCancelCommandJsonSchema | 常量 | const runtimeCancelCommandJsonSchema: JsonSchema | Runtime Cancel Command 的 JSON Schema。 |
runtimeCancelCommandSchema | 常量 | const runtimeCancelCommandSchema: z.ZodObject<{ commandId: z.ZodString; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; ... | Runtime Cancel Command 的运行时 Schema。 |
runtimeCancellationContractDefinitions | 常量 | const runtimeCancellationContractDefinitions: readonly [SpecSchemaDefinition<RuntimeCancelCommand>, SpecSchemaDefinition<RuntimeCancelResult>] | 由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancellation Contract Definitions 常量。 |
runtimeCancellationContractJsonSchemas | 常量 | const runtimeCancellationContractJsonSchemas: Record<string, JsonSchema> | 由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancellation Contract JSON Schemas 常量。 |
runtimeCancellationPolicySchema | 常量 | const runtimeCancellationPolicySchema: z.ZodObject<{ propagation: z.ZodEnum<["none", "children", "all_descendants"]>; cancelRunningActivities: z.ZodBoolean; waitGraceMs: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { propagation: "none" | "children" | "all_descendants"; cancelRunningActivities: boolean; waitGraceMs?: number | undefined; }, { propagation: "none" | "children" | "all_descendants"; cancelRun... | Runtime Cancellation Policy 的运行时 Schema。 |
runtimeCancellationTargetResultSchema | 常量 | const runtimeCancellationTargetResultSchema: z.ZodObject<{ targetType: z.ZodEnum<["activity", "child_run", "session_command"]>; targetId: z.ZodString; status: z.ZodEnum<["cancelled", "already_terminal", "not_found", "failed"]>; error: z.ZodOptional<z.ZodObject<{ code: z.ZodEnum<["RUNTIME_INVALID_INPUT", "RUNTIME_MESSAGE_BUS_UNAVAILABLE", "RUNTIME_MESSAGE_SCHEMA_INVALID", "RUNTIME_MESSAGE_DEAD_LETTERED", "RUNTIME_S... | Runtime Cancellation Target Result 的运行时 Schema。 |
runtimeCancelResultDefinition | 常量 | const runtimeCancelResultDefinition: SpecSchemaDefinition<RuntimeCancelResult> | 由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancel Result Definition 常量。 |
runtimeCancelResultExample | 常量 | const runtimeCancelResultExample: RuntimeCancelResult | Runtime Cancel Result 的有效示例值。 |
runtimeCancelResultJsonSchema | 常量 | const runtimeCancelResultJsonSchema: JsonSchema | Runtime Cancel Result 的 JSON Schema。 |
runtimeCancelResultSchema | 常量 | const runtimeCancelResultSchema: z.ZodObject<{ commandId: z.ZodString; disposition: z.ZodEnum<["applied", "reused"]>; eventIds: z.ZodArray<z.ZodString, "many">; targetResults: z.ZodArray<z.ZodObject<{ targetType: z.ZodEnum<["activity", "child_run", "session_command"]>; targetId: z.ZodString; status: z.ZodEnum<["cancelled", "already_terminal", "not_found", "failed"]>; error: z.ZodOptional<z.ZodObject<{ code: z.ZodE... | Runtime Cancel Result 的运行时 Schema。 |
validateRuntimeCancelCommand | 函数 | validateRuntimeCancelCommand(input: unknown): RuntimeCancelCommand | Validate Runtime Cancel Command 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateRuntimeCancellationTargetResult | 函数 | validateRuntimeCancellationTargetResult(input: unknown): { status: "failed" | "cancelled" | "already_terminal" | "not_found"; targetType: "session_command" | "activity" | "child_run"; targetId: string; error?: { code: "RUNTIME_INVALID_INPUT" | "RUNTIME_MESSAGE_BUS_UNAVAILABLE" | "RUNTIME_MESSAGE_SCHEMA_INVALID" | "RUNTIME_MESSAGE_DEAD_LETTERED" | "RUNTIME_SESSION_QUEUE_CONFLICT" | "RUNTIME_SESSION_QUEUE_OVERFLOW" ... | Validate Runtime Cancellation Target Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateRuntimeCancelResult | 函数 | validateRuntimeCancelResult(input: unknown): RuntimeCancelResult | Validate Runtime Cancel Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
runtimeCancelCommandDefinition
由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancel Command Definition 常量。
- 种类: 常量
- 导入:
import { runtimeCancelCommandDefinition } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancelCommandDefinition: SpecSchemaDefinition<RuntimeCancelCommand>;runtimeCancelCommandExample
Runtime Cancel Command 的有效示例值。
- 种类: 常量
- 导入:
import { runtimeCancelCommandExample } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancelCommandExample: RuntimeCancelCommand;runtimeCancelCommandJsonSchema
Runtime Cancel Command 的 JSON Schema。
- 种类: 常量
- 导入:
import { runtimeCancelCommandJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancelCommandJsonSchema: JsonSchema;runtimeCancelCommandSchema
Runtime Cancel Command 的运行时 Schema。
- 种类: 常量
- 导入:
import { runtimeCancelCommandSchema } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const runtimeCancelCommandSchema: (typeof import('@codesoul-co/hypha-core'))['runtimeCancelCommandSchema'];该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。
runtimeCancellationContractDefinitions
由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancellation Contract Definitions 常量。
- 种类: 常量
- 导入:
import { runtimeCancellationContractDefinitions } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancellationContractDefinitions: readonly [SpecSchemaDefinition<RuntimeCancelCommand>, SpecSchemaDefinition<RuntimeCancelResult>];runtimeCancellationContractJsonSchemas
由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancellation Contract JSON Schemas 常量。
- 种类: 常量
- 导入:
import { runtimeCancellationContractJsonSchemas } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancellationContractJsonSchemas: Record<string, JsonSchema>;runtimeCancellationPolicySchema
Runtime Cancellation Policy 的运行时 Schema。
- 种类: 常量
- 导入:
import { runtimeCancellationPolicySchema } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancellationPolicySchema: z.ZodObject<{ propagation: z.ZodEnum<["none", "children", "all_descendants"]>; cancelRunningActivities: z.ZodBoolean; waitGraceMs: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { propagation: "none" | "children" | "all_descendants"; cancelRunningActivities: boolean; waitGraceMs?: number | undefined; }, { propagation: "none" | "children" | "all_descendants"; cancelRunningActivities: boolean; waitGraceMs?: number | undefined; }>;runtimeCancellationTargetResultSchema
Runtime Cancellation Target Result 的运行时 Schema。
- 种类: 常量
- 导入:
import { runtimeCancellationTargetResultSchema } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const runtimeCancellationTargetResultSchema: (typeof import('@codesoul-co/hypha-core'))['runtimeCancellationTargetResultSchema'];该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。
runtimeCancelResultDefinition
由 contracts/runtime-cancellation-schemas 模块导出的 Runtime Cancel Result Definition 常量。
- 种类: 常量
- 导入:
import { runtimeCancelResultDefinition } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancelResultDefinition: SpecSchemaDefinition<RuntimeCancelResult>;runtimeCancelResultExample
Runtime Cancel Result 的有效示例值。
- 种类: 常量
- 导入:
import { runtimeCancelResultExample } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancelResultExample: RuntimeCancelResult;runtimeCancelResultJsonSchema
Runtime Cancel Result 的 JSON Schema。
- 种类: 常量
- 导入:
import { runtimeCancelResultJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare const runtimeCancelResultJsonSchema: JsonSchema;runtimeCancelResultSchema
Runtime Cancel Result 的运行时 Schema。
- 种类: 常量
- 导入:
import { runtimeCancelResultSchema } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const runtimeCancelResultSchema: (typeof import('@codesoul-co/hypha-core'))['runtimeCancelResultSchema'];该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。
validateRuntimeCancelCommand
Validate Runtime Cancel Command 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateRuntimeCancelCommand } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare function validateRuntimeCancelCommand(input: unknown): RuntimeCancelCommand;调用签名
validateRuntimeCancelCommand(input: unknown): RuntimeCancelCommand参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
RuntimeCancelCommand - 说明: 返回值契约由上述类型定义。
validateRuntimeCancellationTargetResult
Validate Runtime Cancellation Target Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateRuntimeCancellationTargetResult } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare function validateRuntimeCancellationTargetResult(input: unknown): {
status: "failed" | "cancelled" | "already_terminal" | "not_found";
targetType: "session_command" | "activity" | "child_run";
targetId: string;
error?: {
code: "RUNTIME_INVALID_INPUT" | "RUNTIME_MESSAGE_BUS_UNAVAILABLE" | "RUNTIME_MESSAGE_SCHEMA_INVALID" | "RUNTIME_MESSAGE_DEAD_LETTERED" | "RUNTIME_SESSION_QUEUE_CONFLICT" | "RUNTIME_SESSION_QUEUE_OVERFLOW" | "RUNTIME_FENCING_REJECTED" | "RUNTIME_RESOURCE_CONFLICT" | "RUNTIME_IDEMPOTENCY_CONFLICT" | "RUNTIME_EVENT_STREAM_CORRUPT" | "RUNTIME_RECOVERY_REQUIRES_REVIEW" | "RUNTIME_RUN_NOT_FOUND" | "RUNTIME_RUN_CONFLICT" | "RUNTIME_LEASE_CONFLICT" | "RUNTIME_WORKFLOW_INVALID" | "RUNTIME_PROCESS_MISMATCH" | "RUNTIME_STATE_NOT_FOUND" | "RUNTIME_TRANSITION_REJECTED" | "RUNTIME_GUARD_FAILED" | "RUNTIME_INVARIANT_FAILED" | "RUNTIME_STATE_TIMEOUT" | "RUNTIME_RUN_TIMEOUT" | "RUNTIME_CANCELLED" | "RUNTIME_SIGNAL_INVALID" | "RUNTIME_SIGNAL_EXPIRED" | "RUNTIME_RETRY_EXHAUSTED" | "RUNTIME_CHECKPOINT_FAILED" | "RUNTIME_EVENT_APPEND_FAILED" | "RUNTIME_PROJECTION_FAILED" | "RUNTIME_REPLAY_DIVERGENCE" | "RUNTIME_INTERNAL_ERROR";
message: string;
retryable: boolean;
details?: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
[key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null)[] | {
[key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
} | null> | undefined;
causeRef?: string | undefined;
stateId?: string | undefined;
transitionId?: string | undefined;
} | undefined;
};调用签名
validateRuntimeCancellationTargetResult(input: unknown): { status: "failed" | "cancelled" | "already_terminal" | "not_found"; targetType: "session_command" | "activity" | "child_run"; targetId: string; error?: { code: "RUNTIME_INVALID_INPUT" | "RUNTIME_MESSAGE_BUS_UNAVAILABLE" | "RUNTIME_MESSAGE_SCHEMA_INVALID" | "RUNTIME_MESSAGE_DEAD_LETTERED" | "RUNTIME_SESSION_QUEUE_CONFLICT" | "RUNTIME_SESSION_QUEUE_OVERFLOW" | "RUNTIME_FENCING_REJECTED" | "RUNTIME_RESOURCE_CONFLICT" | "RUNTIME_IDEMPOTENCY_CONFLICT" | "RUNTIME_EVENT_STREAM_CORRUPT" | "RUNTIME_RECOVERY_REQUIRES_REVIEW" | "RUNTIME_RUN_NOT_FOUND" | "RUNTIME_RUN_CONFLICT" | "RUNTIME_LEASE_CONFLICT" | "RUNTIME_WORKFLOW_INVALID" | "RUNTIME_PROCESS_MISMATCH" | "RUNTIME_STATE_NOT_FOUND" | "RUNTIME_TRANSITION_REJECTED" | "RUNTIME_GUARD_FAILED" | "RUNTIME_INVARIANT_FAILED" | "RUNTIME_STATE_TIMEOUT" | "RUNTIME_RUN_TIMEOUT" | "RUNTIME_CANCELLED" | "RUNTIME_SIGNAL_INVALID" | "RUNTIME_SIGNAL_EXPIRED" | "RUNTIME_RETRY_EXHAUSTED" | "RUNTIME_CHECKPOINT_FAILED" | "RUNTIME_EVENT_APPEND_FAILED" | "RUNTIME_PROJECTION_FAILED" | "RUNTIME_REPLAY_DIVERGENCE" | "RUNTIME_INTERNAL_ERROR"; message: string; retryable: boolean; details?: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | any | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null> | undefined; causeRef?: string | undefined; stateId?: string | undefined; transitionId?: string | undefined; } | undefined; }参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
{ status: "failed" | "cancelled" | "already_terminal" | "not_found"; targetType: "session_command" | "activity" | "child_run"; targetId: string; error?: { code: "RUNTIME_INVALID_INPUT" | "RUNTIME_MESSAGE_BUS_UNAVAILABLE" | "RUNTIME_MESSAGE_SCHEMA_INVALID" | "RUNTIME_MESSAGE_DEAD_LETTERED" | "RUNTIME_SESSION_QUEUE_CONFLICT" | "RUNTIME_SESSION_QUEUE_OVERFLOW" | "RUNTIME_FENCING_REJECTED" | "RUNTIME_RESOURCE_CONFLICT" | "RUNTIME_IDEMPOTENCY_CONFLICT" | "RUNTIME_EVENT_STREAM_CORRUPT" | "RUNTIME_RECOVERY_REQUIRES_REVIEW" | "RUNTIME_RUN_NOT_FOUND" | "RUNTIME_RUN_CONFLICT" | "RUNTIME_LEASE_CONFLICT" | "RUNTIME_WORKFLOW_INVALID" | "RUNTIME_PROCESS_MISMATCH" | "RUNTIME_STATE_NOT_FOUND" | "RUNTIME_TRANSITION_REJECTED" | "RUNTIME_GUARD_FAILED" | "RUNTIME_INVARIANT_FAILED" | "RUNTIME_STATE_TIMEOUT" | "RUNTIME_RUN_TIMEOUT" | "RUNTIME_CANCELLED" | "RUNTIME_SIGNAL_INVALID" | "RUNTIME_SIGNAL_EXPIRED" | "RUNTIME_RETRY_EXHAUSTED" | "RUNTIME_CHECKPOINT_FAILED" | "RUNTIME_EVENT_APPEND_FAILED" | "RUNTIME_PROJECTION_FAILED" | "RUNTIME_REPLAY_DIVERGENCE" | "RUNTIME_INTERNAL_ERROR"; message: string; retryable: boolean; details?: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | any | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null)[] | { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null; } | null> | undefined; causeRef?: string | undefined; stateId?: string | undefined; transitionId?: string | undefined; } | undefined; } - 说明: 返回值契约由上述类型定义。
validateRuntimeCancelResult
Validate Runtime Cancel Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateRuntimeCancelResult } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/runtime-cancellation-schemas
声明
export declare function validateRuntimeCancelResult(input: unknown): RuntimeCancelResult;调用签名
validateRuntimeCancelResult(input: unknown): RuntimeCancelResult参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
RuntimeCancelResult - 说明: 返回值契约由上述类型定义。
