Files
JX-BPOS/api-report/packages/contracts/src/card.d.ts
T
ChaiHaoandClaude Opus 5 545103af1b A6 三个去向改选择组,「恰选一口」全链打通 —— 整条流第一次真正跑完
G4 是整条流最后的断点:三个去向写成了必交口里的 outcome 字段 + selective: [],
而引擎只在选择组恰发一口时才注入 outcome —— 结构上永远没有判据。

## 四层贯通

① 契约:验收工单加 `portChoice`(组名 + 可选出口)。draft 是 Omit 透传,human-tool 零改动。
② A6 声明:outcome 移出必交口,三个去向成选择组(won/revise/lost 各一口带人读说明)。
   契约 0.2.0、包版 0.7.0。G4 三条边一行没改 —— outcome 由放行选口注入落地事实。
③ 引擎:验收发卡时从活动契约现读选择组上卡(组是契约的事实,不在步的卡面里声明)。
④ 前端 AcceptForm:选择组渲染为必选单选,不选「通过」不亮;选中的口随放行回传。

## 「恰选一口」拦在收单,不拦在落地 —— 拦错位置实测翻过车

第一版把 validateSelection 放进 release.land:回传是**同步收单**(200 = 收到裁决),
落地在推进器里**异步**跑 —— 拦晚了就是「工单已答完、任务卡死、推进器循环报错」(实测)。
改到 checkWorkOrderReply(与「驳回必附意见」同族的收单规矩):工单投影自带 portChoice,
放行回传缺口/口不在组内 → 400 同步拒收,工单还活着,人补选就是。
land 里的 validateSelection 留作兜底 —— 这条从 contracts 导出以来从未被执行的不变量,
现在两个岗位都有了。

## 实测四连

  不选口通过 → 400「放行前先选『议价结果』」,工单未被吃掉
  选 won    → end_won released,流 completed —— **整条流第一次真正跑完**
  选 revise → A4#2 重开新实例(A4#1 留痕不动)
  选 lost   → A7 情报归档 → end_arch released,流 completed
  全程 route-dead-end 事件 0 条

typecheck ✓ lint ✓ depcruise ✓ 498 测试 ✓

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
2026-07-28 16:37:59 +08:00

1577 lines
57 KiB
TypeScript

/**
* 人类工具的卡协议(编码规范 §8.1 / §9;语义出处 OS 05,AM 06/07)。
*
* **双层边界**:范式(loop / flow / skill)是后端实现逻辑的模型,只存在于引擎层;
* 本文件是**前端呈现协议**,前端永远感知不到范式。旧文「四卡」的映射:
* 执行卡 → 执行工单(work order · execution)
* 放行卡 → 验收(工作区可修订报告 + 对话区验收单)(work order · acceptance)
* 决策 / 补全 → 对话卡(decision / elicitation)
* 落地失败卡 = 执行工单的系统预置形态,不构成第五种卡(OS 7.3)。
*
* 形状以 2026-07-26 原型定稿为准(`~/coding/JCAI_PRD/workbench/_data/model.ts`);
* 枚举值改用英文标识符 + 本文件的 *_LABEL 字典,界面文案由字典给出、与原型逐字一致。
*/
import { z } from 'zod';
export declare const TONES: readonly ["ok", "warn", "danger", "brand", "muted"];
export declare const toneSchema: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
export type Tone = z.infer<typeof toneSchema>;
/** 依据快照:调用必附上下文(OS 05)—— 裸调用基座必须拒发 */
export declare const basisSchema: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
export type Basis = z.infer<typeof basisSchema>;
export declare const formOptionSchema: z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
negative: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export type FormOption = z.infer<typeof formOptionSchema>;
export declare const FORM_FIELD_KINDS: readonly ["text", "textarea", "radio", "number", "select", "check", "date", "money", "file"];
export declare const formFieldKindSchema: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
textarea: "textarea";
radio: "radio";
select: "select";
money: "money";
}>;
export type FormFieldKind = z.infer<typeof formFieldKindSchema>;
/** 表单字段:结构化交互的原子。卡片表单由本 schema 驱动渲染与校验,后端回传校验同 schema(§9.2) */
export declare const formFieldSchema: z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
textarea: "textarea";
radio: "radio";
select: "select";
money: "money";
}>;
placeholder: z.ZodOptional<z.ZodString>;
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
negative: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
group: z.ZodOptional<z.ZodString>;
hint: z.ZodOptional<z.ZodString>;
ai: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
}, z.core.$strip>;
export type FormField = z.infer<typeof formFieldSchema>;
declare const fileDocSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
export type FileDoc = z.infer<typeof fileDocSchema>;
export { fileDocSchema };
export declare const viewBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
t: z.ZodLiteral<"callout">;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"kv">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
fromItem: z.ZodOptional<z.ZodObject<{
item: z.ZodString;
field: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"badges">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
on: z.ZodBoolean;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"table">;
title: z.ZodOptional<z.ZodString>;
cols: z.ZodArray<z.ZodString>;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
editable: z.ZodOptional<z.ZodBoolean>;
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
linkDonut: z.ZodOptional<z.ZodObject<{
col: z.ZodNumber;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
map: z.ZodArray<z.ZodObject<{
match: z.ZodString;
label: z.ZodString;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"bars">;
title: z.ZodOptional<z.ZodString>;
max: z.ZodOptional<z.ZodNumber>;
redline: z.ZodOptional<z.ZodNumber>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
text: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"donut">;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
from: z.ZodString;
fromAddr: z.ZodOptional<z.ZodString>;
to: z.ZodString;
cc: z.ZodOptional<z.ZodString>;
subject: z.ZodString;
time: z.ZodString;
body: z.ZodString;
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">>;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"cards">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
tag: z.ZodString;
icon: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
title: z.ZodString;
code: z.ZodOptional<z.ZodString>;
swap: z.ZodOptional<z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
big: z.ZodString;
bigLabel: z.ZodOptional<z.ZodString>;
meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
note: z.ZodOptional<z.ZodString>;
from: z.ZodOptional<z.ZodString>;
time: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"waiting">;
label: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"files">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
}, z.core.$strip>], "t">;
export type ViewBlock = z.infer<typeof viewBlockSchema>;
/**
* 阶段:交互层的统一进展刻度。
* 引擎层的来源随范式而异(loop = CMMN Stage / 里程碑,flow = 步序位置),前端不感知。
*/
export declare const stageSchema: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "StageId", "out">;
label: z.ZodString;
round: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type Stage = z.infer<typeof stageSchema>;
export declare const DELIVERABLE_STATES: readonly ["draft", "pending-acceptance", "released", "rejected"];
export declare const deliverableStateSchema: z.ZodEnum<{
released: "released";
draft: "draft";
"pending-acceptance": "pending-acceptance";
rejected: "rejected";
}>;
export type DeliverableState = z.infer<typeof deliverableStateSchema>;
export declare const DELIVERABLE_STATE_LABEL: Readonly<Record<DeliverableState, string>>;
/** 过程成果:每个成果都要经验收放行才落地(放行门,OS 09) */
export declare const deliverableSchema: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "DeliverableId", "out">;
stage: z.core.$ZodBranded<z.ZodString, "StageId", "out">;
round: z.ZodOptional<z.ZodNumber>;
title: z.ZodString;
desc: z.ZodOptional<z.ZodString>;
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
t: z.ZodLiteral<"callout">;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"kv">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
fromItem: z.ZodOptional<z.ZodObject<{
item: z.ZodString;
field: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"badges">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
on: z.ZodBoolean;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"table">;
title: z.ZodOptional<z.ZodString>;
cols: z.ZodArray<z.ZodString>;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
editable: z.ZodOptional<z.ZodBoolean>;
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
linkDonut: z.ZodOptional<z.ZodObject<{
col: z.ZodNumber;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
map: z.ZodArray<z.ZodObject<{
match: z.ZodString;
label: z.ZodString;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"bars">;
title: z.ZodOptional<z.ZodString>;
max: z.ZodOptional<z.ZodNumber>;
redline: z.ZodOptional<z.ZodNumber>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
text: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"donut">;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
from: z.ZodString;
fromAddr: z.ZodOptional<z.ZodString>;
to: z.ZodString;
cc: z.ZodOptional<z.ZodString>;
subject: z.ZodString;
time: z.ZodString;
body: z.ZodString;
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">>;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"cards">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
tag: z.ZodString;
icon: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
title: z.ZodString;
code: z.ZodOptional<z.ZodString>;
swap: z.ZodOptional<z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
big: z.ZodString;
bigLabel: z.ZodOptional<z.ZodString>;
meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
note: z.ZodOptional<z.ZodString>;
from: z.ZodOptional<z.ZodString>;
time: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"waiting">;
label: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"files">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
}, z.core.$strip>], "t">>;
state: z.ZodEnum<{
released: "released";
draft: "draft";
"pending-acceptance": "pending-acceptance";
rejected: "rejected";
}>;
at: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type Deliverable = z.infer<typeof deliverableSchema>;
export declare const WORK_ORDER_MODES: readonly ["execution", "acceptance"];
export declare const workOrderModeSchema: z.ZodEnum<{
execution: "execution";
acceptance: "acceptance";
}>;
export type WorkOrderMode = z.infer<typeof workOrderModeSchema>;
export declare const WORK_ORDER_MODE_LABEL: Readonly<Record<WorkOrderMode, string>>;
/**
* 办结口径:执行件只有「已提交」,验收件是放行三选一 —— 与回传协议同一套标识符。
* 界面文案由字典给出(与原型逐字一致),不在组件里散落中文。
*/
export declare const WORK_ORDER_RESULTS: readonly ["submitted", "pass", "redo", "revise"];
export declare const workOrderResultSchema: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
export type WorkOrderResult = z.infer<typeof workOrderResultSchema>;
export declare const WORK_ORDER_RESULT_LABEL: Readonly<Record<WorkOrderResult, string>>;
/** 驳回两式 —— 退回即重来,判定处只此一处 */
export declare function isRejection(result: WorkOrderResult): boolean;
/** 完成回传:谁、何时、答了什么(回传即留痕) */
export declare const workDoneSchema: z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>;
export type WorkDone = z.infer<typeof workDoneSchema>;
/** 执行工单:作业指导书 + 空表单(补全并入此类);落地失败卡是它的系统预置形态 */
export declare const executionWorkOrderSchema: z.ZodObject<{
mode: z.ZodLiteral<"execution">;
preset: z.ZodOptional<z.ZodEnum<{
"landing-failure": "landing-failure";
}>>;
ask: z.ZodString;
standard: z.ZodOptional<z.ZodString>;
steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
basedOn: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "DeliverableId", "out">>;
blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
t: z.ZodLiteral<"callout">;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"kv">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
fromItem: z.ZodOptional<z.ZodObject<{
item: z.ZodString;
field: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"badges">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
on: z.ZodBoolean;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"table">;
title: z.ZodOptional<z.ZodString>;
cols: z.ZodArray<z.ZodString>;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
editable: z.ZodOptional<z.ZodBoolean>;
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
linkDonut: z.ZodOptional<z.ZodObject<{
col: z.ZodNumber;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
map: z.ZodArray<z.ZodObject<{
match: z.ZodString;
label: z.ZodString;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"bars">;
title: z.ZodOptional<z.ZodString>;
max: z.ZodOptional<z.ZodNumber>;
redline: z.ZodOptional<z.ZodNumber>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
text: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"donut">;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
from: z.ZodString;
fromAddr: z.ZodOptional<z.ZodString>;
to: z.ZodString;
cc: z.ZodOptional<z.ZodString>;
subject: z.ZodString;
time: z.ZodString;
body: z.ZodString;
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">>;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"cards">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
tag: z.ZodString;
icon: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
title: z.ZodString;
code: z.ZodOptional<z.ZodString>;
swap: z.ZodOptional<z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
big: z.ZodString;
bigLabel: z.ZodOptional<z.ZodString>;
meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
note: z.ZodOptional<z.ZodString>;
from: z.ZodOptional<z.ZodString>;
time: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"waiting">;
label: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"files">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
}, z.core.$strip>], "t">>>;
fields: z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
textarea: "textarea";
radio: "radio";
select: "select";
money: "money";
}>;
placeholder: z.ZodOptional<z.ZodString>;
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
negative: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
group: z.ZodOptional<z.ZodString>;
hint: z.ZodOptional<z.ZodString>;
ai: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
}, z.core.$strip>>;
submitLabel: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
at: z.ZodISODateTime;
title: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
stage: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StageId", "out">>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type ExecutionWorkOrder = z.infer<typeof executionWorkOrderSchema>;
export declare const acceptanceCriterionCheckSchema: z.ZodObject<{
label: z.ZodString;
level: z.ZodEnum<{
L1: "L1";
L2: "L2";
L3: "L3";
L4: "L4";
L5: "L5";
}>;
pass: z.ZodBoolean;
}, z.core.$strip>;
export type AcceptanceCriterionCheck = z.infer<typeof acceptanceCriterionCheckSchema>;
/** 待落地动作意向:预检全过才上卡,卡面呈现的即已验证的动作清单(OS 7.3) */
export declare const actionIntentViewSchema: z.ZodObject<{
label: z.ZodString;
effect: z.ZodEnum<{
read: "read";
write: "write";
}>;
detail: z.ZodString;
}, z.core.$strip>;
export type ActionIntentView = z.infer<typeof actionIntentViewSchema>;
export declare const ACTION_EFFECT_LABEL: Readonly<Record<'read' | 'write', string>>;
/** 验收工单:AI 拟好的可修订报告 + 判据逐条核对 + 放行三选一 */
export declare const acceptanceWorkOrderSchema: z.ZodObject<{
mode: z.ZodLiteral<"acceptance">;
deliverable: z.core.$ZodBranded<z.ZodString, "DeliverableId", "out">;
criteria: z.ZodArray<z.ZodObject<{
label: z.ZodString;
level: z.ZodEnum<{
L1: "L1";
L2: "L2";
L3: "L3";
L4: "L4";
L5: "L5";
}>;
pass: z.ZodBoolean;
}, z.core.$strip>>;
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
label: z.ZodString;
effect: z.ZodEnum<{
read: "read";
write: "write";
}>;
detail: z.ZodString;
}, z.core.$strip>>>;
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
textarea: "textarea";
radio: "radio";
select: "select";
money: "money";
}>;
placeholder: z.ZodOptional<z.ZodString>;
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
negative: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
group: z.ZodOptional<z.ZodString>;
hint: z.ZodOptional<z.ZodString>;
ai: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
}, z.core.$strip>>>;
portChoice: z.ZodOptional<z.ZodObject<{
group: z.ZodString;
ports: z.ZodArray<z.ZodObject<{
name: z.ZodString;
label: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
passLabel: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
at: z.ZodISODateTime;
title: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
stage: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StageId", "out">>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type AcceptanceWorkOrder = z.infer<typeof acceptanceWorkOrderSchema>;
export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
mode: z.ZodLiteral<"execution">;
preset: z.ZodOptional<z.ZodEnum<{
"landing-failure": "landing-failure";
}>>;
ask: z.ZodString;
standard: z.ZodOptional<z.ZodString>;
steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
basedOn: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "DeliverableId", "out">>;
blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
t: z.ZodLiteral<"callout">;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"kv">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
fromItem: z.ZodOptional<z.ZodObject<{
item: z.ZodString;
field: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"badges">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
on: z.ZodBoolean;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"table">;
title: z.ZodOptional<z.ZodString>;
cols: z.ZodArray<z.ZodString>;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
editable: z.ZodOptional<z.ZodBoolean>;
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
linkDonut: z.ZodOptional<z.ZodObject<{
col: z.ZodNumber;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
map: z.ZodArray<z.ZodObject<{
match: z.ZodString;
label: z.ZodString;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"bars">;
title: z.ZodOptional<z.ZodString>;
max: z.ZodOptional<z.ZodNumber>;
redline: z.ZodOptional<z.ZodNumber>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
text: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"donut">;
title: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
value: z.ZodNumber;
tone: z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
from: z.ZodString;
fromAddr: z.ZodOptional<z.ZodString>;
to: z.ZodString;
cc: z.ZodOptional<z.ZodString>;
subject: z.ZodString;
time: z.ZodString;
body: z.ZodString;
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">>;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"cards">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
tag: z.ZodString;
icon: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
warn: "warn";
danger: "danger";
brand: "brand";
muted: "muted";
}>>;
title: z.ZodString;
code: z.ZodOptional<z.ZodString>;
swap: z.ZodOptional<z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
big: z.ZodString;
bigLabel: z.ZodOptional<z.ZodString>;
meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
note: z.ZodOptional<z.ZodString>;
from: z.ZodOptional<z.ZodString>;
time: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"waiting">;
label: z.ZodString;
hint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"files">;
title: z.ZodOptional<z.ZodString>;
items: z.ZodArray<z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
}, z.core.$strip>], "t">>>;
fields: z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
textarea: "textarea";
radio: "radio";
select: "select";
money: "money";
}>;
placeholder: z.ZodOptional<z.ZodString>;
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
negative: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
group: z.ZodOptional<z.ZodString>;
hint: z.ZodOptional<z.ZodString>;
ai: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
}, z.core.$strip>>;
submitLabel: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
at: z.ZodISODateTime;
title: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
stage: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StageId", "out">>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
mode: z.ZodLiteral<"acceptance">;
deliverable: z.core.$ZodBranded<z.ZodString, "DeliverableId", "out">;
criteria: z.ZodArray<z.ZodObject<{
label: z.ZodString;
level: z.ZodEnum<{
L1: "L1";
L2: "L2";
L3: "L3";
L4: "L4";
L5: "L5";
}>;
pass: z.ZodBoolean;
}, z.core.$strip>>;
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
label: z.ZodString;
effect: z.ZodEnum<{
read: "read";
write: "write";
}>;
detail: z.ZodString;
}, z.core.$strip>>>;
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
textarea: "textarea";
radio: "radio";
select: "select";
money: "money";
}>;
placeholder: z.ZodOptional<z.ZodString>;
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
negative: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
group: z.ZodOptional<z.ZodString>;
hint: z.ZodOptional<z.ZodString>;
ai: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
}, z.core.$strip>>>;
portChoice: z.ZodOptional<z.ZodObject<{
group: z.ZodString;
ports: z.ZodArray<z.ZodObject<{
name: z.ZodString;
label: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
passLabel: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
at: z.ZodISODateTime;
title: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
stage: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StageId", "out">>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>], "mode">;
export type WorkOrder = z.infer<typeof workOrderSchema>;
/** AI 发言的类型标记 —— 对话区可分辨:结论 / 指导 / 判据 */
export declare const AI_TAGS: readonly ["conclusion", "guidance", "criterion"];
export declare const aiTagSchema: z.ZodEnum<{
conclusion: "conclusion";
guidance: "guidance";
criterion: "criterion";
}>;
export type AiTag = z.infer<typeof aiTagSchema>;
export declare const AI_TAG_LABEL: Readonly<Record<AiTag, string>>;
/** 决策卡:分支条件选择表;含自定义收尾项 */
export declare const decisionCardSchema: z.ZodObject<{
k: z.ZodLiteral<"decision">;
ask: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
recommend: z.ZodOptional<z.ZodString>;
options: z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
detail: z.ZodOptional<z.ZodString>;
consequence: z.ZodOptional<z.ZodString>;
recommended: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>;
allowCustom: z.ZodDefault<z.ZodBoolean>;
chosen: z.ZodOptional<z.ZodObject<{
value: z.ZodString;
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>;
export type DecisionCard = z.infer<typeof decisionCardSchema>;
/** 补全卡:就地要几个小信息;含「没法填」旁路 —— 两条路必走其一 */
export declare const elicitationCardSchema: z.ZodObject<{
k: z.ZodLiteral<"elicitation">;
ask: z.ZodString;
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
fields: z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
placeholder: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
values: z.ZodRecord<z.ZodString, z.ZodString>;
reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>;
export type ElicitationCard = z.infer<typeof elicitationCardSchema>;
/** 评价卡:任务评价(评分 1–5 + 改进建议) */
export declare const ratingCardSchema: z.ZodObject<{
k: z.ZodLiteral<"rating">;
ask: z.ZodString;
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
score: z.ZodNumber;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>;
export type RatingCard = z.infer<typeof ratingCardSchema>;
export declare const chatCardSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
k: z.ZodLiteral<"decision">;
ask: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
recommend: z.ZodOptional<z.ZodString>;
options: z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
detail: z.ZodOptional<z.ZodString>;
consequence: z.ZodOptional<z.ZodString>;
recommended: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>;
allowCustom: z.ZodDefault<z.ZodBoolean>;
chosen: z.ZodOptional<z.ZodObject<{
value: z.ZodString;
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"elicitation">;
ask: z.ZodString;
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
fields: z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
placeholder: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
values: z.ZodRecord<z.ZodString, z.ZodString>;
reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"rating">;
ask: z.ZodString;
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
score: z.ZodNumber;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>], "k">;
export type ChatCard = z.infer<typeof chatCardSchema>;
export declare const chatMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
k: z.ZodLiteral<"ai">;
text: z.ZodString;
tag: z.ZodOptional<z.ZodEnum<{
conclusion: "conclusion";
guidance: "guidance";
criterion: "criterion";
}>>;
ref: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"human">;
text: z.ZodString;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"system">;
type: z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>;
text: z.ZodString;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"decision">;
ask: z.ZodString;
basis: z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>;
recommend: z.ZodOptional<z.ZodString>;
options: z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
detail: z.ZodOptional<z.ZodString>;
consequence: z.ZodOptional<z.ZodString>;
recommended: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>;
allowCustom: z.ZodDefault<z.ZodBoolean>;
chosen: z.ZodOptional<z.ZodObject<{
value: z.ZodString;
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"elicitation">;
ask: z.ZodString;
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
fields: z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
placeholder: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
values: z.ZodRecord<z.ZodString, z.ZodString>;
reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"rating">;
ask: z.ZodString;
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
k: z.ZodString;
v: z.ZodString;
}, z.core.$strip>>>;
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
score: z.ZodNumber;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
at: z.ZodISODateTime;
}, z.core.$strip>], "k">;
export type ChatMessage = z.infer<typeof chatMessageSchema>;
export declare const workOrderReplySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
mode: z.ZodLiteral<"execution">;
workOrderId: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
values: z.ZodRecord<z.ZodString, z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
mode: z.ZodLiteral<"acceptance">;
workOrderId: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
verdict: z.ZodUnion<readonly [z.ZodLiteral<"pass">, z.ZodEnum<{
redo: "redo";
revise: "revise";
}>]>;
values: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
comment: z.ZodOptional<z.ZodString>;
selectedPorts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>], "mode">;
export type WorkOrderReply = z.infer<typeof workOrderReplySchema>;
export declare const chatCardReplySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
k: z.ZodLiteral<"decision">;
cardId: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
value: z.ZodString;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"elicitation">;
cardId: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
values: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"rating">;
cardId: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
score: z.ZodNumber;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "k">;
export type ChatCardReply = z.infer<typeof chatCardReplySchema>;
/**
* 驳回必附意见 —— 三规矩之一的机检形态(OS 05)。
* 后端回传校验与前端提交校验共用本函数。
*/
export declare function rejectionNeedsComment(reply: WorkOrderReply): boolean;
/** 补全卡两条路必走其一:要么填值,要么给「没法填」的理由 */
export declare function elicitationReplyIsEmpty(reply: ChatCardReply): boolean;