/** * 流程包 DSL 与触发器配置(编码规范 §8.1;语义出处 OS 03)。 * * 流程包 = 调用接口 + 两种活动(声明)+ 审批点 + 两种网关;工作流 = 其运行时实例。 * 触发器与流程包**平级**:不入流程包结构、不随流程包版本,配置独立存放。 * * 编排铁律:**连线即映射,画图即校验,不闭合不得发布** —— 存在未完成边、未满足必填 * 或类型冲突的流程包可存草稿、不得发布。校验算法在 `process` 的 domain,本文件只定形状。 */ import { z } from 'zod'; export declare const OWNER_STRATEGIES: readonly ["assigned", "sole", "rotation", "follow-source"]; export declare const ownerStrategySchema: z.ZodEnum<{ assigned: "assigned"; sole: "sole"; rotation: "rotation"; "follow-source": "follow-source"; }>; export type OwnerStrategy = z.infer; export declare const OWNER_STRATEGY_LABEL: Readonly>; export declare const ownerSpecSchema: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; export type OwnerSpec = z.infer; /** * 映射来源四类:上游输出口载荷字段 / 流程变量 / 起单载荷 / 常量; * 允许 S-FEEL 表达式做转换(与触发器字段映射同一形式)。 */ export declare const mappingSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ from: z.ZodLiteral<"output-port">; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; export type MappingSource = z.infer; export declare const fieldMappingSchema: z.ZodObject<{ target: z.ZodString; source: z.ZodDiscriminatedUnion<[z.ZodObject<{ from: z.ZodLiteral<"output-port">; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>; export type FieldMapping = z.infer; export declare const edgeSchema: z.ZodObject<{ id: z.ZodString; from: z.core.$ZodBranded; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; reopen: z.ZodDefault; }, z.core.$strip>; export type Edge = z.infer; export declare const failureDispositionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">; export type FailureDisposition = z.infer; export declare const FAILURE_DISPOSITION_LABEL: Readonly>; export declare const nudgeLadderSchema: z.ZodObject<{ deadline: z.ZodString; steps: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; export type NudgeLadder = z.infer; export declare const GATEWAY_KINDS: readonly ["parallel", "exclusive"]; export declare const gatewayKindSchema: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; export type GatewayKind = z.infer; export declare const GATEWAY_KIND_LABEL: Readonly>; export declare const processNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"start">; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>], "kind">; export type ProcessNode = z.infer; export declare const callInterfaceSchema: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; export type CallInterface = z.infer; export declare const PROCESS_PACKAGE_STATES: readonly ["draft", "published", "retired"]; export declare const processPackageStateSchema: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; export type ProcessPackageState = z.infer; export declare const processPackageSchema: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; version: z.ZodNumber; state: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; callInterface: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; nodes: z.ZodArray; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; id: z.core.$ZodBranded; label: z.ZodString; layout: z.ZodOptional>; }, z.core.$strip>], "kind">>; edges: z.ZodArray; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; reopen: z.ZodDefault; }, z.core.$strip>>; variables: z.ZodDefault; }, z.core.$strip>>>; description: z.ZodOptional; }, z.core.$strip>; export type ProcessPackage = z.infer; export declare const CLOSURE_VIOLATION_KINDS: readonly ["edge-unmapped", "required-unmapped", "type-conflict", "dangling-node", "gateway-unbalanced", "join-ambiguous-source", "tolerate-required-dependency", "unknown-activity", "missing-owner-position"]; export declare const closureViolationKindSchema: z.ZodEnum<{ "edge-unmapped": "edge-unmapped"; "required-unmapped": "required-unmapped"; "type-conflict": "type-conflict"; "dangling-node": "dangling-node"; "gateway-unbalanced": "gateway-unbalanced"; "join-ambiguous-source": "join-ambiguous-source"; "tolerate-required-dependency": "tolerate-required-dependency"; "unknown-activity": "unknown-activity"; "missing-owner-position": "missing-owner-position"; }>; export type ClosureViolationKind = z.infer; export declare const closureViolationSchema: z.ZodObject<{ kind: z.ZodEnum<{ "edge-unmapped": "edge-unmapped"; "required-unmapped": "required-unmapped"; "type-conflict": "type-conflict"; "dangling-node": "dangling-node"; "gateway-unbalanced": "gateway-unbalanced"; "join-ambiguous-source": "join-ambiguous-source"; "tolerate-required-dependency": "tolerate-required-dependency"; "unknown-activity": "unknown-activity"; "missing-owner-position": "missing-owner-position"; }>; nodeId: z.ZodOptional>; edgeId: z.ZodOptional; field: z.ZodOptional; message: z.ZodString; }, z.core.$strip>; export type ClosureViolation = z.infer; export declare const closureReportSchema: z.ZodObject<{ publishable: z.ZodBoolean; violations: z.ZodArray; nodeId: z.ZodOptional>; edgeId: z.ZodOptional; field: z.ZodOptional; message: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; export type ClosureReport = z.infer; export declare const TRIGGER_KINDS: readonly ["periodic", "event", "registration"]; export declare const triggerKindSchema: z.ZodEnum<{ periodic: "periodic"; event: "event"; registration: "registration"; }>; export type TriggerKind = z.infer; export declare const TRIGGER_KIND_LABEL: Readonly>; export declare const triggerConfigSchema: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; enabled: z.ZodDefault; processPackageId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; spec: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"periodic">; mode: z.ZodLiteral<"calendar">; calendar: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"periodic">; mode: z.ZodLiteral<"data-calendar">; domain: z.ZodString; object: z.ZodString; dateField: z.ZodString; offset: z.ZodString; filter: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"event">; rule: z.ZodString; eventType: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"registration">; formHint: z.ZodOptional; }, z.core.$strip>], "kind">; }, z.core.$strip>; export type TriggerConfig = z.infer;