Skip to content

@codesoul-co/hypha-core / contracts/session-queue-schemas

模块用法

用于声明并运行时校验契约。Session queue schemas 模块公开 24 常量、8 函数。

从包入口导入

ts
import {
  cancelSessionCommandsRequestDefinition,
  cancelSessionCommandsRequestSchema,
  cancelSessionCommandsResultDefinition,
  cancelSessionCommandsResultSchema,
  closeDeadLetterSessionCommandRequestDefinition,
  closeDeadLetterSessionCommandRequestSchema,
  listStuckSessionCommandsRequestSchema,
  redriveDeadLetterSessionCommandRequestDefinition,
} from '@codesoul-co/hypha-core';

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

使用要点

  • 8 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
  • 24 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

运行时校验示例

ts
import { cancelSessionCommandsRequestSchema } from '@codesoul-co/hypha-core';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = cancelSessionCommandsRequestSchema.parse(input);

配置、网络请求或持久化数据等不可信输入应先通过 Runtime Schema,再传给只接受已校验契约的函数或类。

公共导出

Symbol种类签名说明
cancelSessionCommandsRequestDefinition常量const cancelSessionCommandsRequestDefinition: SpecSchemaDefinition<CancelSessionCommandsRequest>contracts/session-queue-schemas 模块导出的 Cancel Session Commands Request Definition 常量。
cancelSessionCommandsRequestSchema常量const cancelSessionCommandsRequestSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; targetRunId: z.ZodString; cancellationCommandId: z.ZodS...Cancel Session Commands Request 的运行时 Schema。
cancelSessionCommandsResultDefinition常量const cancelSessionCommandsResultDefinition: SpecSchemaDefinition<CancelSessionCommandsResult>contracts/session-queue-schemas 模块导出的 Cancel Session Commands Result Definition 常量。
cancelSessionCommandsResultSchema常量const cancelSessionCommandsResultSchema: z.ZodObject<{ targetRunId: z.ZodString; cancelledCommandIds: z.ZodArray<z.ZodString, "many">; alreadyCancelledCommandIds: z.ZodArray<z.ZodString, "many">; alreadyTerminalCommandIds: z.ZodArray<z.ZodString, "many">; }, "strict", z.ZodTypeAny, { targetRunId: string; cancelledCommandIds: string[]; alreadyCancelledCommandIds: string[]; alreadyTerminalCommandIds: string[]; }, { ...Cancel Session Commands Result 的运行时 Schema。
closeDeadLetterSessionCommandRequestDefinition常量const closeDeadLetterSessionCommandRequestDefinition: SpecSchemaDefinition<CloseDeadLetterSessionCommandRequest>contracts/session-queue-schemas 模块导出的 Close Dead Letter Session Command Request Definition 常量。
closeDeadLetterSessionCommandRequestSchema常量const closeDeadLetterSessionCommandRequestSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; commandId: z.ZodString; operatorId: z.ZodString...Close Dead Letter Session Command Request 的运行时 Schema。
listStuckSessionCommandsRequestSchema常量const listStuckSessionCommandsRequestSchema: z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; checkedAt: z.ZodString; graceMs: z.ZodOptional<z.ZodNumber>; limit: z.ZodOptional<z....List Stuck Session Commands Request 的运行时 Schema。
redriveDeadLetterSessionCommandRequestDefinition常量const redriveDeadLetterSessionCommandRequestDefinition: SpecSchemaDefinition<RedriveDeadLetterSessionCommandRequest>contracts/session-queue-schemas 模块导出的 Redrive Dead Letter Session Command Request Definition 常量。
redriveDeadLetterSessionCommandRequestSchema常量const redriveDeadLetterSessionCommandRequestSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; sourceCommandId: z.ZodString; id: z.ZodString...Redrive Dead Letter Session Command Request 的运行时 Schema。
sessionCommandDeadLetterResolutionSchema常量const sessionCommandDeadLetterResolutionSchema: z.ZodEffects<z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; disposition: z.ZodEnum<["redriven", "closed"]>; operatorId: z.ZodString; reason: z.ZodString; resolvedAt: z.ZodString; redriveCommandId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { version: "1.0.0"; reason: string; disposition: "closed" | "redriven"; resolvedAt: string; operatorId: string; redriv...Session Command Dead Letter Resolution 的运行时 Schema。
sessionCommandLeaseRecoverySchema常量const sessionCommandLeaseRecoverySchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; previousWorkerId: z.ZodString; previousLeaseEpoch: z.ZodNumber; leaseExpiredAt: z.ZodString; recoveredAt: z.ZodString; disposition: z.ZodEnum<["requeued", "dead_lettered"]>; }, "strict", z.ZodTypeAny, { version: "1.0.0"; disposition: "requeued" | "dead_lettered"; previousWorkerId: string; previousLeaseEpoch: number; leaseExpired...Session Command Lease Recovery 的运行时 Schema。
sessionCommandRecordDefinition常量const sessionCommandRecordDefinition: SpecSchemaDefinition<SessionCommandRecord>contracts/session-queue-schemas 模块导出的 Session Command Record Definition 常量。
sessionCommandRecordExample常量const sessionCommandRecordExample: SessionCommandRecordSession Command Record 的有效示例值。
sessionCommandRecordJsonSchema常量const sessionCommandRecordJsonSchema: JsonSchemaSession Command Record 的 JSON Schema。
sessionCommandRecordSchema常量const sessionCommandRecordSchema: z.ZodEffects<z.ZodObject<{ id: z.ZodString; commandType: z.ZodEnum<["start_run", "user_input", "resume", "signal", "cancel", "transition", "continue_react", "close_session"]>; idempotencyKey: z.ZodString; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; targetRunId: z.ZodOptional<z.ZodString>; enqueueSequen...Session Command Record 的运行时 Schema。
sessionCommandRedriveSchema常量const sessionCommandRedriveSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; sourceCommandId: z.ZodString; operatorId: z.ZodString; reason: z.ZodString; requestedAt: z.ZodString; }, "strict", z.ZodTypeAny, { version: "1.0.0"; reason: string; requestedAt: string; sourceCommandId: string; operatorId: string; }, { version: "1.0.0"; reason: string; requestedAt: string; sourceCommandId: string; operatorId: string; }>Session Command Redrive 的运行时 Schema。
sessionCommandStatusSchema常量const sessionCommandStatusSchema: z.ZodEnum<["queued", "claimed", "applied", "reused", "rejected", "expired", "failed", "dead_letter", "dead_letter_resolved"]>Session Command Status 的运行时 Schema。
sessionCommandTypeSchema常量const sessionCommandTypeSchema: z.ZodEnum<["start_run", "user_input", "resume", "signal", "cancel", "transition", "continue_react", "close_session"]>Session Command Type 的运行时 Schema。
sessionQueueContractDefinitions常量const sessionQueueContractDefinitions: readonly [SpecSchemaDefinition<SessionCommandRecord>, SpecSchemaDefinition<CancelSessionCommandsRequest>, SpecSchemaDefinition<CancelSessionCommandsResult>, SpecSchemaDefinition<RedriveDeadLetterSessionCommandRequest>, SpecSchemaDefinition<CloseDeadLetterSessionCommandRequest>, SpecSchemaDefinition<SessionQueueHealthSnapshot>]contracts/session-queue-schemas 模块导出的 Session Queue Contract Definitions 常量。
sessionQueueContractJsonSchemas常量const sessionQueueContractJsonSchemas: Record<string, JsonSchema>contracts/session-queue-schemas 模块导出的 Session Queue Contract JSON Schemas 常量。
sessionQueueHealthSnapshotDefinition常量const sessionQueueHealthSnapshotDefinition: SpecSchemaDefinition<SessionQueueHealthSnapshot>contracts/session-queue-schemas 模块导出的 Session Queue Health Snapshot Definition 常量。
sessionQueueHealthSnapshotSchema常量const sessionQueueHealthSnapshotSchema: z.ZodEffects<z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; totalCommands: z.ZodNumber; pendingCommands: z.ZodNumber; queuedCommands: z.ZodNumber; claimedCommands: z.ZodNumber; deadLetterCommands: z.ZodNumber; resolvedDeadLetterCommands: z.ZodNumber; retryingCommands: z.ZodNumber; redeliveredCommands: z.ZodNumber; recoveredExpiredLeases: z.ZodNumber; leaseRecoveryCount: z.Zod...Session Queue Health Snapshot 的运行时 Schema。
sessionQueueScopeSchema常量const sessionQueueScopeSchema: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>Session Queue Scope 的运行时 Schema。
stuckSessionCommandSchema常量const stuckSessionCommandSchema: z.ZodObject<{ command: z.ZodEffects<z.ZodObject<{ id: z.ZodString; commandType: z.ZodEnum<["start_run", "user_input", "resume", "signal", "cancel", "transition", "continue_react", "close_session"]>; idempotencyKey: z.ZodString; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; targetRunId: z.ZodOptional<z.Zod...Stuck Session Command 的运行时 Schema。
validateCancelSessionCommandsRequest函数validateCancelSessionCommandsRequest(input: unknown): CancelSessionCommandsRequestValidate Cancel Session Commands Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateCancelSessionCommandsResult函数validateCancelSessionCommandsResult(input: unknown): CancelSessionCommandsResultValidate Cancel Session Commands Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateCloseDeadLetterSessionCommandRequest函数validateCloseDeadLetterSessionCommandRequest(input: unknown): CloseDeadLetterSessionCommandRequestValidate Close Dead Letter Session Command Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateListStuckSessionCommandsRequest函数validateListStuckSessionCommandsRequest(input: unknown): ListStuckSessionCommandsRequestValidate List Stuck Session Commands Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateRedriveDeadLetterSessionCommandRequest函数validateRedriveDeadLetterSessionCommandRequest(input: unknown): RedriveDeadLetterSessionCommandRequestValidate Redrive Dead Letter Session Command Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateSessionCommandRecord函数validateSessionCommandRecord(input: unknown): SessionCommandRecordValidate Session Command Record 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateSessionQueueHealthSnapshot函数validateSessionQueueHealthSnapshot(input: unknown): SessionQueueHealthSnapshotValidate Session Queue Health Snapshot 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateStuckSessionCommand函数validateStuckSessionCommand(input: unknown): StuckSessionCommandValidate Stuck Session Command 函数,提供 1 个公开调用签名;参数与返回类型见下表。

cancelSessionCommandsRequestDefinition

contracts/session-queue-schemas 模块导出的 Cancel Session Commands Request Definition 常量。

声明

text
export declare const cancelSessionCommandsRequestDefinition: SpecSchemaDefinition<CancelSessionCommandsRequest>;

cancelSessionCommandsRequestSchema

Cancel Session Commands Request 的运行时 Schema。

声明

text
export declare const cancelSessionCommandsRequestSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; targetRunId: z.ZodString; cancellationCommandId: z.ZodString; reason: z.ZodString; cancelledAt: z.ZodString; }, "strict", z.ZodTypeAny, { version: "1.0.0"; reason: string; scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; targetRunId: string; cancellationCommandId: string; cancelledAt: string; }, { version: "1.0.0"; reason: string; scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; targetRunId: string; cancellationCommandId: string; cancelledAt: string; }>;

cancelSessionCommandsResultDefinition

contracts/session-queue-schemas 模块导出的 Cancel Session Commands Result Definition 常量。

声明

text
export declare const cancelSessionCommandsResultDefinition: SpecSchemaDefinition<CancelSessionCommandsResult>;

cancelSessionCommandsResultSchema

Cancel Session Commands Result 的运行时 Schema。

声明

text
export declare const cancelSessionCommandsResultSchema: z.ZodObject<{ targetRunId: z.ZodString; cancelledCommandIds: z.ZodArray<z.ZodString, "many">; alreadyCancelledCommandIds: z.ZodArray<z.ZodString, "many">; alreadyTerminalCommandIds: z.ZodArray<z.ZodString, "many">; }, "strict", z.ZodTypeAny, { targetRunId: string; cancelledCommandIds: string[]; alreadyCancelledCommandIds: string[]; alreadyTerminalCommandIds: string[]; }, { targetRunId: string; cancelledCommandIds: string[]; alreadyCancelledCommandIds: string[]; alreadyTerminalCommandIds: string[]; }>;

closeDeadLetterSessionCommandRequestDefinition

contracts/session-queue-schemas 模块导出的 Close Dead Letter Session Command Request Definition 常量。

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

声明

text
export declare const closeDeadLetterSessionCommandRequestDefinition: SpecSchemaDefinition<CloseDeadLetterSessionCommandRequest>;

closeDeadLetterSessionCommandRequestSchema

Close Dead Letter Session Command Request 的运行时 Schema。

声明

text
export declare const closeDeadLetterSessionCommandRequestSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; commandId: z.ZodString; operatorId: z.ZodString; reason: z.ZodString; closedAt: z.ZodString; }, "strict", z.ZodTypeAny, { version: "1.0.0"; reason: string; scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; commandId: string; operatorId: string; closedAt: string; }, { version: "1.0.0"; reason: string; scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; commandId: string; operatorId: string; closedAt: string; }>;

listStuckSessionCommandsRequestSchema

List Stuck Session Commands Request 的运行时 Schema。

声明

text
export declare const listStuckSessionCommandsRequestSchema: z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; checkedAt: z.ZodString; graceMs: z.ZodOptional<z.ZodNumber>; limit: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; checkedAt: string; limit?: number | undefined; graceMs?: number | undefined; }, { scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; checkedAt: string; limit?: number | undefined; graceMs?: number | undefined; }>;

redriveDeadLetterSessionCommandRequestDefinition

contracts/session-queue-schemas 模块导出的 Redrive Dead Letter Session Command Request Definition 常量。

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

声明

text
export declare const redriveDeadLetterSessionCommandRequestDefinition: SpecSchemaDefinition<RedriveDeadLetterSessionCommandRequest>;

redriveDeadLetterSessionCommandRequestSchema

Redrive Dead Letter Session Command Request 的运行时 Schema。

声明

text
export declare const redriveDeadLetterSessionCommandRequestSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>; sourceCommandId: z.ZodString; id: z.ZodString; idempotencyKey: z.ZodString; operatorId: z.ZodString; reason: z.ZodString; requestedAt: z.ZodOptional<z.ZodString>; availableAt: z.ZodOptional<z.ZodString>; expiresAt: z.ZodOptional<z.ZodString>; priority: z.ZodOptional<z.ZodNumber>; maxAttempts: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { id: string; version: "1.0.0"; reason: string; idempotencyKey: string; scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; sourceCommandId: string; operatorId: string; expiresAt?: string | undefined; requestedAt?: string | undefined; maxAttempts?: number | undefined; priority?: number | undefined; availableAt?: string | undefined; }, { id: string; version: "1.0.0"; reason: string; idempotencyKey: string; scope: { userId: string; sessionId: string; tenantId?: string | undefined; }; sourceCommandId: string; operatorId: string; expiresAt?: string | undefined; requestedAt?: string | undefined; maxAttempts?: number | undefined; priority?: number | undefined; availableAt?: string | undefined; }>;

sessionCommandDeadLetterResolutionSchema

Session Command Dead Letter Resolution 的运行时 Schema。

声明

text
export declare const sessionCommandDeadLetterResolutionSchema: z.ZodEffects<z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; disposition: z.ZodEnum<["redriven", "closed"]>; operatorId: z.ZodString; reason: z.ZodString; resolvedAt: z.ZodString; redriveCommandId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { version: "1.0.0"; reason: string; disposition: "closed" | "redriven"; resolvedAt: string; operatorId: string; redriveCommandId?: string | undefined; }, { version: "1.0.0"; reason: string; disposition: "closed" | "redriven"; resolvedAt: string; operatorId: string; redriveCommandId?: string | undefined; }>, { version: "1.0.0"; reason: string; disposition: "closed" | "redriven"; resolvedAt: string; operatorId: string; redriveCommandId?: string | undefined; }, { version: "1.0.0"; reason: string; disposition: "closed" | "redriven"; resolvedAt: string; operatorId: string; redriveCommandId?: string | undefined; }>;

sessionCommandLeaseRecoverySchema

Session Command Lease Recovery 的运行时 Schema。

声明

text
export declare const sessionCommandLeaseRecoverySchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; previousWorkerId: z.ZodString; previousLeaseEpoch: z.ZodNumber; leaseExpiredAt: z.ZodString; recoveredAt: z.ZodString; disposition: z.ZodEnum<["requeued", "dead_lettered"]>; }, "strict", z.ZodTypeAny, { version: "1.0.0"; disposition: "requeued" | "dead_lettered"; previousWorkerId: string; previousLeaseEpoch: number; leaseExpiredAt: string; recoveredAt: string; }, { version: "1.0.0"; disposition: "requeued" | "dead_lettered"; previousWorkerId: string; previousLeaseEpoch: number; leaseExpiredAt: string; recoveredAt: string; }>;

sessionCommandRecordDefinition

contracts/session-queue-schemas 模块导出的 Session Command Record Definition 常量。

声明

text
export declare const sessionCommandRecordDefinition: SpecSchemaDefinition<SessionCommandRecord>;

sessionCommandRecordExample

Session Command Record 的有效示例值。

声明

text
export declare const sessionCommandRecordExample: SessionCommandRecord;

sessionCommandRecordJsonSchema

Session Command Record 的 JSON Schema。

声明

text
export declare const sessionCommandRecordJsonSchema: JsonSchema;

sessionCommandRecordSchema

Session Command Record 的运行时 Schema。

声明

text
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const sessionCommandRecordSchema: (typeof import('@codesoul-co/hypha-core'))['sessionCommandRecordSchema'];

该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。

sessionCommandRedriveSchema

Session Command Redrive 的运行时 Schema。

声明

text
export declare const sessionCommandRedriveSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; sourceCommandId: z.ZodString; operatorId: z.ZodString; reason: z.ZodString; requestedAt: z.ZodString; }, "strict", z.ZodTypeAny, { version: "1.0.0"; reason: string; requestedAt: string; sourceCommandId: string; operatorId: string; }, { version: "1.0.0"; reason: string; requestedAt: string; sourceCommandId: string; operatorId: string; }>;

sessionCommandStatusSchema

Session Command Status 的运行时 Schema。

声明

text
export declare const sessionCommandStatusSchema: z.ZodEnum<["queued", "claimed", "applied", "reused", "rejected", "expired", "failed", "dead_letter", "dead_letter_resolved"]>;

sessionCommandTypeSchema

Session Command Type 的运行时 Schema。

声明

text
export declare const sessionCommandTypeSchema: z.ZodEnum<["start_run", "user_input", "resume", "signal", "cancel", "transition", "continue_react", "close_session"]>;

sessionQueueContractDefinitions

contracts/session-queue-schemas 模块导出的 Session Queue Contract Definitions 常量。

声明

text
export declare const sessionQueueContractDefinitions: readonly [SpecSchemaDefinition<SessionCommandRecord>, SpecSchemaDefinition<CancelSessionCommandsRequest>, SpecSchemaDefinition<CancelSessionCommandsResult>, SpecSchemaDefinition<RedriveDeadLetterSessionCommandRequest>, SpecSchemaDefinition<CloseDeadLetterSessionCommandRequest>, SpecSchemaDefinition<SessionQueueHealthSnapshot>];

sessionQueueContractJsonSchemas

contracts/session-queue-schemas 模块导出的 Session Queue Contract JSON Schemas 常量。

声明

text
export declare const sessionQueueContractJsonSchemas: Record<string, JsonSchema>;

sessionQueueHealthSnapshotDefinition

contracts/session-queue-schemas 模块导出的 Session Queue Health Snapshot Definition 常量。

声明

text
export declare const sessionQueueHealthSnapshotDefinition: SpecSchemaDefinition<SessionQueueHealthSnapshot>;

sessionQueueHealthSnapshotSchema

Session Queue Health Snapshot 的运行时 Schema。

声明

text
export declare const sessionQueueHealthSnapshotSchema: z.ZodEffects<z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; totalCommands: z.ZodNumber; pendingCommands: z.ZodNumber; queuedCommands: z.ZodNumber; claimedCommands: z.ZodNumber; deadLetterCommands: z.ZodNumber; resolvedDeadLetterCommands: z.ZodNumber; retryingCommands: z.ZodNumber; redeliveredCommands: z.ZodNumber; recoveredExpiredLeases: z.ZodNumber; leaseRecoveryCount: z.ZodNumber; oldestPendingAgeMs: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { version: "1.0.0"; totalCommands: number; pendingCommands: number; queuedCommands: number; claimedCommands: number; deadLetterCommands: number; resolvedDeadLetterCommands: number; retryingCommands: number; redeliveredCommands: number; recoveredExpiredLeases: number; leaseRecoveryCount: number; oldestPendingAgeMs?: number | undefined; }, { version: "1.0.0"; totalCommands: number; pendingCommands: number; queuedCommands: number; claimedCommands: number; deadLetterCommands: number; resolvedDeadLetterCommands: number; retryingCommands: number; redeliveredCommands: number; recoveredExpiredLeases: number; leaseRecoveryCount: number; oldestPendingAgeMs?: number | undefined; }>, { version: "1.0.0"; totalCommands: number; pendingCommands: number; queuedCommands: number; claimedCommands: number; deadLetterCommands: number; resolvedDeadLetterCommands: number; retryingCommands: number; redeliveredCommands: number; recoveredExpiredLeases: number; leaseRecoveryCount: number; oldestPendingAgeMs?: number | undefined; }, { version: "1.0.0"; totalCommands: number; pendingCommands: number; queuedCommands: number; claimedCommands: number; deadLetterCommands: number; resolvedDeadLetterCommands: number; retryingCommands: number; redeliveredCommands: number; recoveredExpiredLeases: number; leaseRecoveryCount: number; oldestPendingAgeMs?: number | undefined; }>;

sessionQueueScopeSchema

Session Queue Scope 的运行时 Schema。

声明

text
export declare const sessionQueueScopeSchema: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; sessionId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; sessionId: string; tenantId?: string | undefined; }, { userId: string; sessionId: string; tenantId?: string | undefined; }>;

stuckSessionCommandSchema

Stuck Session Command 的运行时 Schema。

声明

text
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const stuckSessionCommandSchema: (typeof import('@codesoul-co/hypha-core'))['stuckSessionCommandSchema'];

该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。

validateCancelSessionCommandsRequest

Validate Cancel Session Commands Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateCancelSessionCommandsRequest(input: unknown): CancelSessionCommandsRequest;

调用签名

text
validateCancelSessionCommandsRequest(input: unknown): CancelSessionCommandsRequest

参数

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

返回值

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

validateCancelSessionCommandsResult

Validate Cancel Session Commands Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateCancelSessionCommandsResult(input: unknown): CancelSessionCommandsResult;

调用签名

text
validateCancelSessionCommandsResult(input: unknown): CancelSessionCommandsResult

参数

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

返回值

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

validateCloseDeadLetterSessionCommandRequest

Validate Close Dead Letter Session Command Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateCloseDeadLetterSessionCommandRequest(input: unknown): CloseDeadLetterSessionCommandRequest;

调用签名

text
validateCloseDeadLetterSessionCommandRequest(input: unknown): CloseDeadLetterSessionCommandRequest

参数

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

返回值

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

validateListStuckSessionCommandsRequest

Validate List Stuck Session Commands Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateListStuckSessionCommandsRequest(input: unknown): ListStuckSessionCommandsRequest;

调用签名

text
validateListStuckSessionCommandsRequest(input: unknown): ListStuckSessionCommandsRequest

参数

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

返回值

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

validateRedriveDeadLetterSessionCommandRequest

Validate Redrive Dead Letter Session Command Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

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

声明

text
export declare function validateRedriveDeadLetterSessionCommandRequest(input: unknown): RedriveDeadLetterSessionCommandRequest;

调用签名

text
validateRedriveDeadLetterSessionCommandRequest(input: unknown): RedriveDeadLetterSessionCommandRequest

参数

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

返回值

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

validateSessionCommandRecord

Validate Session Command Record 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateSessionCommandRecord(input: unknown): SessionCommandRecord;

调用签名

text
validateSessionCommandRecord(input: unknown): SessionCommandRecord

参数

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

返回值

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

validateSessionQueueHealthSnapshot

Validate Session Queue Health Snapshot 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateSessionQueueHealthSnapshot(input: unknown): SessionQueueHealthSnapshot;

调用签名

text
validateSessionQueueHealthSnapshot(input: unknown): SessionQueueHealthSnapshot

参数

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

返回值

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

validateStuckSessionCommand

Validate Stuck Session Command 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateStuckSessionCommand(input: unknown): StuckSessionCommand;

调用签名

text
validateStuckSessionCommand(input: unknown): StuckSessionCommand

参数

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

返回值

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