This repository has been archived on 2026-09-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
BPOS-MVP/api-report/packages/contracts/src/api/governance.d.ts
T
xcsandClaude Opus 5 0aa2fc11b0 资料文件真产出来了;E04/I01 补到验收线,顺手填了几个「墙拦住却不给路」的坑
**资料文件全链**(用户:审核资料这一步要真产出 word/excel/md/html,前端能渲、点资料名能开)
接手时这一步一个文件都产不出来 —— S3 剧本白纸黑字写着「file_ref 本 MVP 阶段可留空」。
文件是台账那一行的投影,不另存一份:
· 声明 `file:{titleColumn,bodyColumn,formatColumn}`,它同时是授权面(没声明就点不开)
· 现造真字节 —— docx/xlsx 是自己打的 OOXML 包(zip-write:store+CRC32,零依赖)
· 读回来渲 —— 解的就是造出来那份字节,渲得出来才证明文件是真的
· 件上 `data-file-of` → 工作区二级界面(Word 纸面/Excel 网格/渲好的 md/沙箱 html)+ 下载原件
放行落地前把每一份冻进 `sys.task_asset_file`(迁移 0029):归档件点开的必须是签字那一刻
那一份,而资料落在主数据上、试跑单不落正式表 —— 不存这一份,收工后一个都点不开。
工作成果里「产出的资料」自成一摞。Markdown 富文本渲染顺带销账(仍零依赖)。

**Harness**
· 画面按「这一拍办完之后」在办的那一步挑 —— 从前拿拍首的局面决定拍尾的事:
  收掉 S4、发出 S5 的卡,而屏上还摆着 S4 的只读件,人无处可填(墙要配路第四次现形)
· 验收「重做」真能退回重做,且打回后台账没动就不许再提交(软硬两段,不锁死单子)
· 立监听的授权面是清单声明;发卡的授权面是调人预算,不是计划项
· 读工具同参重调有兜底;空转写身后还有行动就不废串;finish 的 doneWhen 按写完后的草稿算

**界面**
· 翻件与翻页各归各位(从前二选一,多卡多页时页翻不动);没得翻写「—」不写 0/0
· 工作成果详情能翻份;表宽超出能横滑(E04/I01 抄版式时把 overflow-x 抄丢了)
· 查看面灰底滚过一屏变白 —— 两条独立的路都治了(沙箱内不同色 / 弹性子项不长个)
· 测试台「取不到」不再当成「还活着」

**活动**
E04 关系覆盖、I01 品牌内容各自补到验收线:判据全读基座数、判据指向的东西摆上卡面、
样例满载且名字 ≤14 字;提交前要裁的判据搬进说明书(模型会压拍,压过之后只有说明书还在)。

验收:e2e i01 4/4、e04 3/3 全部 released,资料在办中渲得出、放行后存了档点得开;
门禁 typecheck/lint/depcruise/1628 测全绿。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EEJX8Z7CHejvwmDQyPQuBX
2026-08-24 10:26:45 +08:00

2986 lines
126 KiB
TypeScript

/**
* 治理台路由契约(编码规范 §8.1 / §9.1)。
* 治理台九功能不设后端 governance 模块:每个功能是对应模块的管理用例 + 本文件的路由组装(§3)。
*/
import { z } from 'zod';
export declare const listStaffRoute: {
readonly method: "GET";
readonly path: "/api/gov/staff";
readonly output: z.ZodObject<{
staff: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
account: z.ZodString;
name: z.ZodString;
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
state: z.ZodDefault<z.ZodEnum<{
active: "active";
disabled: "disabled";
}>>;
position: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
code: z.ZodString;
name: z.ZodString;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
}, z.core.$strip>>;
positions: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
code: z.ZodString;
name: z.ZodString;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const createStaffRoute: {
readonly method: "POST";
readonly path: "/api/gov/staff";
readonly body: z.ZodObject<{
account: z.ZodString;
name: z.ZodString;
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
account: z.ZodString;
name: z.ZodString;
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
state: z.ZodDefault<z.ZodEnum<{
active: "active";
disabled: "disabled";
}>>;
}, z.core.$strip>;
};
export declare const disableStaffCheckRoute: {
readonly method: "GET";
readonly path: "/api/gov/staff/:staffId/disable-check";
readonly params: z.ZodObject<{
staffId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
staffId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
blocked: z.ZodBoolean;
openTasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
taskId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>>;
openCards: z.ZodDefault<z.ZodArray<z.ZodObject<{
cardId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>>;
openApprovals: z.ZodDefault<z.ZodArray<z.ZodObject<{
approvalId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>>;
}, z.core.$strip>;
};
export declare const disableStaffRoute: {
readonly method: "POST";
readonly path: "/api/gov/staff/:staffId/disable";
readonly params: z.ZodObject<{
staffId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
check: z.ZodObject<{
staffId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
blocked: z.ZodBoolean;
openTasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
taskId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>>;
openCards: z.ZodDefault<z.ZodArray<z.ZodObject<{
cardId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>>;
openApprovals: z.ZodDefault<z.ZodArray<z.ZodObject<{
approvalId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>>;
}, z.core.$strip>;
}, z.core.$strip>;
};
export declare const listGrantsRoute: {
readonly method: "GET";
readonly path: "/api/gov/positions/:positionId/grants";
readonly params: z.ZodObject<{
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
grants: z.ZodArray<z.ZodObject<{
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
object: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"data">;
domain: z.ZodString;
object: z.ZodString;
field: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"governance">;
function: z.ZodEnum<{
trigger: "trigger";
data: "data";
task: "task";
system: "system";
tool: "tool";
activity: "activity";
staff: "staff";
process: "process";
memory: "memory";
}>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"task">;
activityId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
action: z.ZodEnum<{
read: "read";
write: "write";
govern: "govern";
}>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const setGrantsRoute: {
readonly method: "POST";
readonly path: "/api/gov/positions/:positionId/grants";
readonly params: z.ZodObject<{
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
}, z.core.$strip>;
readonly body: z.ZodObject<{
grants: z.ZodArray<z.ZodObject<{
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
object: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"data">;
domain: z.ZodString;
object: z.ZodString;
field: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"governance">;
function: z.ZodEnum<{
trigger: "trigger";
data: "data";
task: "task";
system: "system";
tool: "tool";
activity: "activity";
staff: "staff";
process: "process";
memory: "memory";
}>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"task">;
activityId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
action: z.ZodEnum<{
read: "read";
write: "write";
govern: "govern";
}>;
}, z.core.$strip>>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
grants: z.ZodArray<z.ZodObject<{
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
object: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"data">;
domain: z.ZodString;
object: z.ZodString;
field: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"governance">;
function: z.ZodEnum<{
trigger: "trigger";
data: "data";
task: "task";
system: "system";
tool: "tool";
activity: "activity";
staff: "staff";
process: "process";
memory: "memory";
}>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"task">;
activityId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
action: z.ZodEnum<{
read: "read";
write: "write";
govern: "govern";
}>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const LLM_PROVIDERS: readonly ["openai-compatible", "openai", "deepseek", "anthropic", "qwen"];
export declare const llmProviderSchema: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
export type LlmProvider = z.infer<typeof llmProviderSchema>;
/** 活动只见自定义模型名;Provider / URL / API-Key / Model 四元在系统侧绑定,活动不触厂商与密钥 */
export declare const llmInstanceViewSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
provider: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
baseUrl: z.ZodString;
model: z.ZodString;
apiKeyBound: z.ZodBoolean;
systemUse: z.ZodDefault<z.ZodBoolean>;
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
export type LlmInstanceView = z.infer<typeof llmInstanceViewSchema>;
/**
* Provider 一览 —— 建实例那张表要**预填默认端点**,而唯一真相在服务端的 provider 档案里。
* 前端不自带一份 URL 表:那种表迟早与服务端漂移,漂移的那天没人会发现(端点错了只表现为「连不上」)。
*/
export declare const listLlmProvidersRoute: {
readonly method: "GET";
readonly path: "/api/gov/llm/providers";
readonly output: z.ZodObject<{
providers: z.ZodArray<z.ZodObject<{
provider: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
label: z.ZodString;
defaultBaseUrl: z.ZodString;
structuredOutput: z.ZodEnum<{
"json-object": "json-object";
"prompt-only": "prompt-only";
}>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const listLlmInstancesRoute: {
readonly method: "GET";
readonly path: "/api/gov/llm";
readonly output: z.ZodObject<{
instances: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
provider: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
baseUrl: z.ZodString;
model: z.ZodString;
apiKeyBound: z.ZodBoolean;
systemUse: z.ZodDefault<z.ZodBoolean>;
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const upsertLlmInstanceRoute: {
readonly method: "POST";
readonly path: "/api/gov/llm";
readonly body: z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodString;
provider: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
baseUrl: z.ZodDefault<z.ZodString>;
model: z.ZodString;
apiKey: z.ZodOptional<z.ZodString>;
systemUse: z.ZodDefault<z.ZodBoolean>;
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
provider: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
baseUrl: z.ZodString;
model: z.ZodString;
apiKeyBound: z.ZodBoolean;
systemUse: z.ZodDefault<z.ZodBoolean>;
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
};
/**
* 测试连接(草稿)—— **只测不存**:拿表单上正填的四元真发一次最小调用,一个字节不落库。
* 「测试」把表单写进库是个会咬人的副作用:人只想知道钥匙对不对,取消却收不回已改的端点。
* 留空 `apiKey` 时取该实例已存的密钥(改端点、换型号不必重打钥匙)。
*/
/**
* 删一条模型实例 —— 还有活动声明着它的用途名就拒(409):
* 删了那些活动一调模型就是「用途名未绑定」,而人当时以为只是清掉一条没用的记录。
*/
export declare const deleteLlmInstanceRoute: {
readonly method: "DELETE";
readonly path: "/api/gov/llm/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
export declare const probeLlmDraftRoute: {
readonly method: "POST";
readonly path: "/api/gov/llm/probe";
readonly body: z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
provider: z.ZodEnum<{
"openai-compatible": "openai-compatible";
openai: "openai";
deepseek: "deepseek";
anthropic: "anthropic";
qwen: "qwen";
}>;
baseUrl: z.ZodDefault<z.ZodString>;
model: z.ZodString;
apiKey: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
latencyMs: z.ZodOptional<z.ZodNumber>;
error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
};
export declare const probeLlmInstanceRoute: {
readonly method: "POST";
readonly path: "/api/gov/llm/:id/probe";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
latencyMs: z.ZodOptional<z.ZodNumber>;
error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
};
export declare const govTaskRowSchema: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
title: z.ZodString;
activityId: z.ZodString;
ownerName: z.ZodString;
runtime: z.ZodEnum<{
running: "running";
"awaiting-human": "awaiting-human";
"awaiting-event": "awaiting-event";
suspended: "suspended";
"landing-blocked": "landing-blocked";
terminal: "terminal";
}>;
terminal: z.ZodOptional<z.ZodEnum<{
released: "released";
blocked: "blocked";
stalled: "stalled";
exhausted: "exhausted";
terminated: "terminated";
}>>;
workflowId: z.ZodOptional<z.ZodString>;
usedSteps: z.ZodNumber;
capSteps: z.ZodNumber;
startedAt: z.ZodString;
}, z.core.$strip>;
export type GovTaskRow = z.infer<typeof govTaskRowSchema>;
export declare const listGovTasksRoute: {
readonly method: "GET";
readonly path: "/api/gov/tasks";
readonly output: z.ZodObject<{
tasks: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
title: z.ZodString;
activityId: z.ZodString;
ownerName: z.ZodString;
runtime: z.ZodEnum<{
running: "running";
"awaiting-human": "awaiting-human";
"awaiting-event": "awaiting-event";
suspended: "suspended";
"landing-blocked": "landing-blocked";
terminal: "terminal";
}>;
terminal: z.ZodOptional<z.ZodEnum<{
released: "released";
blocked: "blocked";
stalled: "stalled";
exhausted: "exhausted";
terminated: "terminated";
}>>;
workflowId: z.ZodOptional<z.ZodString>;
usedSteps: z.ZodNumber;
capSteps: z.ZodNumber;
startedAt: z.ZodString;
}, z.core.$strip>>;
workflows: z.ZodArray<z.ZodObject<{
id: z.ZodString;
subject: z.ZodString;
state: z.ZodEnum<{
terminated: "terminated";
running: "running";
waiting: "waiting";
completed: "completed";
abnormal: "abnormal";
}>;
packageId: z.ZodString;
startedAt: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 控制三语义:暂停 / 叫停 / 终止 —— 治理台的干预面(OS 06) */
export declare const controlTaskRoute: {
readonly method: "POST";
readonly path: "/api/gov/tasks/:taskId/control";
readonly params: z.ZodObject<{
taskId: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
}, z.core.$strip>;
readonly body: z.ZodObject<{
semantic: z.ZodEnum<{
pause: "pause";
halt: "halt";
terminate: "terminate";
}>;
reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
resumable: z.ZodBoolean;
}, z.core.$strip>;
};
export declare const resumeTaskRoute: {
readonly method: "POST";
readonly path: "/api/gov/tasks/:taskId/resume";
readonly params: z.ZodObject<{
taskId: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
runtime: z.ZodEnum<{
running: "running";
"awaiting-human": "awaiting-human";
"awaiting-event": "awaiting-event";
suspended: "suspended";
"landing-blocked": "landing-blocked";
terminal: "terminal";
}>;
}, z.core.$strip>;
};
/** 改派 —— 在途任务的负责人变更,留痕并通知双方 */
export declare const reassignTaskRoute: {
readonly method: "POST";
readonly path: "/api/gov/tasks/:taskId/reassign";
readonly params: z.ZodObject<{
taskId: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
}, z.core.$strip>;
readonly body: z.ZodObject<{
to: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
}, z.core.$strip>;
};
/** 任务日志 —— 治理台可查看任意任务的任务日志(OS 02) */
export declare const govTaskLogRoute: {
readonly method: "GET";
readonly path: "/api/gov/tasks/:taskId/log";
readonly params: z.ZodObject<{
taskId: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
}, z.core.$strip>;
readonly output: z.ZodObject<{
log: z.ZodArray<z.ZodObject<{
id: z.ZodString;
at: z.ZodString;
sideLabel: z.ZodString;
action: z.ZodString;
title: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const listProcessPackagesRoute: {
readonly method: "GET";
readonly path: "/api/gov/process";
readonly output: z.ZodObject<{
packages: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 保存流程包 —— **严格检查 + 保存即生效**,没有发布这一道门。
*
* 不闭合即拒存(412 带闭合报告):存下来的就是能起单的。
* 保存**恒产生新版本号**,由服务端算 —— body 里的 `version` 只用于「改的是哪一版」的溯源,
* 服务端不采信它当目标版本号。在途工作流按 (包id, 版本) 读定义,就地覆盖会改掉它们读的东西。
* 返回的 `pkg.version` 是**实际落的新版本**,`report` 是这一版的闭合报告(必然 closed)。
*/
export declare const saveProcessRoute: {
readonly method: "PUT";
readonly path: "/api/gov/process";
/**
* 编辑即其身:pkg.version 已存在 → 就地写回该版(号不变)。
* `asNew: true`(或版本不存在,如新流程首版)→ 产生新版本号(服务端算,不生效)。
* 就地写回的两道闸:在途钉版 409;写回生效版不闭合 412(带整份报告)。
*/
readonly body: z.ZodObject<{
pkg: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
asNew: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
pkg: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
report: z.ZodObject<{
closed: z.ZodBoolean;
violations: z.ZodArray<z.ZodObject<{
kind: z.ZodEnum<{
"dangling-node": "dangling-node";
"multi-default-edge": "multi-default-edge";
"unknown-activity": "unknown-activity";
}>;
nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
edgeId: z.ZodOptional<z.ZodString>;
field: z.ZodOptional<z.ZodString>;
message: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
}, z.core.$strip>;
};
/**
* 版本启停 —— 运行时开关,不改定义一个字。
* 激活某版:同流其余版本一并停用(一条流恰一个生效版本);停用生效版:整条流下线,新起单被拒。
* 在途工作流按启动时钉住的版本跑完,启停对它们零影响。
* 返回这条流启停后的全部版本(新→旧),界面直接以它刷新版本列表。
*/
export declare const setProcessStateRoute: {
readonly method: "POST";
readonly path: "/api/gov/process/:id/:version/state";
readonly params: z.ZodObject<{
id: z.ZodString;
version: z.ZodString;
}, z.core.$strip>;
readonly body: z.ZodObject<{
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
packages: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 删一版 —— 两道闸(2026-07-30):
* · **生效版不可删**:先停用,免得手滑把正在起单的定义删了;
* · **在途钉版不可删**:那些单要按它跑完,定义没了就再也推不动。
*/
export declare const deleteProcessVersionRoute: {
readonly method: "DELETE";
readonly path: "/api/gov/process/:id/:version";
readonly params: z.ZodObject<{
id: z.ZodString;
version: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
packages: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 审批模板一览 —— 活动库里「审批活动」那一格看的就是它 */
export declare const listApprovalTemplatesRoute: {
readonly method: "GET";
readonly path: "/api/gov/approval-templates";
readonly output: z.ZodObject<{
templates: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
basis: z.ZodDefault<z.ZodArray<z.ZodObject<{
field: z.ZodString;
label: z.ZodString;
}, z.core.$strip>>>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
usedBy: z.ZodArray<z.ZodObject<{
packageId: z.ZodString;
nodeId: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 建或改一张模板 —— id 已存在即覆盖(模板是配置,不长版本) */
export declare const upsertApprovalTemplateRoute: {
readonly method: "PUT";
readonly path: "/api/gov/approval-templates";
readonly body: z.ZodObject<{
template: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
basis: z.ZodDefault<z.ZodArray<z.ZodObject<{
field: z.ZodString;
label: z.ZodString;
}, z.core.$strip>>>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
template: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
basis: z.ZodDefault<z.ZodArray<z.ZodObject<{
field: z.ZodString;
label: z.ZodString;
}, z.core.$strip>>>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
}, z.core.$strip>;
};
/** 删一张模板 —— 还被审批点引着就拒(409):删了引它的节点会退回「载荷全摊开」 */
export declare const deleteApprovalTemplateRoute: {
readonly method: "DELETE";
readonly path: "/api/gov/approval-templates/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
/**
* 删整条流 —— 连同它的**所有版本**。货架上一条流一张卡,删的就是那张卡。
* 两道闸:任一版有在途单即拒(那些单要按它跑完);还有调起规则指着它也拒 ——
* 删了包留着规则,那规则再命中就调不动任何东西,是个哑火的配置。
*/
export declare const deleteProcessFlowRoute: {
readonly method: "DELETE";
readonly path: "/api/gov/process/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
packages: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 改版本记录 —— **版本号自己定**(2026-07-29 用户定)、名字随之:改哪版只动哪版。
*
* 号从前只能由系统递增。设计人员要能自己编号(1 / 2 / 10 都行),所以放开;
* 两条约束是数据本身要求的:号不许撞同流已有版本;**在途钉版不许改号**
* (那些单正按这个号找定义)。已完结的单跟着改指 —— 号只是这一版的名牌,
* 搬号连引用一起搬,留痕仍指同一份定义。
*/
export declare const editProcessVersionRoute: {
readonly method: "POST";
readonly path: "/api/gov/process/:id/:version/edit";
readonly params: z.ZodObject<{
id: z.ZodString;
version: z.ZodString;
}, z.core.$strip>;
readonly body: z.ZodObject<{
version: z.ZodOptional<z.ZodNumber>;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
packages: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 画图即校验 —— 与前端画布同源;保存前随手看还差几条,不改任何状态 */
export declare const validateProcessRoute: {
readonly method: "POST";
readonly path: "/api/gov/process/validate";
readonly body: z.ZodObject<{
pkg: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
closed: z.ZodBoolean;
violations: z.ZodArray<z.ZodObject<{
kind: z.ZodEnum<{
"dangling-node": "dangling-node";
"multi-default-edge": "multi-default-edge";
"unknown-activity": "unknown-activity";
}>;
nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
edgeId: z.ZodOptional<z.ZodString>;
field: z.ZodOptional<z.ZodString>;
message: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const listTriggersRoute: {
readonly method: "GET";
readonly path: "/api/gov/triggers";
readonly output: z.ZodObject<{
triggers: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TriggerId", "out">;
name: z.ZodString;
enabled: z.ZodDefault<z.ZodBoolean>;
processPackageId: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
mapping: z.ZodDefault<z.ZodArray<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>>>;
confirm: z.ZodDefault<z.ZodObject<{
required: z.ZodDefault<z.ZodBoolean>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>>;
spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"periodic-calendar">;
calendar: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"periodic-data">;
domain: z.ZodString;
object: z.ZodString;
dateField: z.ZodString;
offset: z.ZodString;
filter: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"event">;
rule: z.ZodString;
eventType: z.ZodDefault<z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"registration">;
formHint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const toggleTriggerRoute: {
readonly method: "POST";
readonly path: "/api/gov/triggers/:id/toggle";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly body: z.ZodObject<{
enabled: z.ZodBoolean;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
/**
* 调起规则的**定义面**(设计中心):新建 / 改规则 / 改起单装配。
*
* 与 `toggleTriggerRoute` 分开是有意的:定义归设计,启停归运营 ——
* 同一个触发器,「它按什么规则调起」和「今天开不开」是两个人在两个台面上做的两件事。
* 触发器与流程包平级:改它**不动任何包版本**。
*/
export declare const upsertTriggerRoute: {
readonly method: "PUT";
readonly path: "/api/gov/triggers";
readonly body: z.ZodObject<{
trigger: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TriggerId", "out">;
name: z.ZodString;
enabled: z.ZodDefault<z.ZodBoolean>;
processPackageId: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
mapping: z.ZodDefault<z.ZodArray<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>>>;
confirm: z.ZodDefault<z.ZodObject<{
required: z.ZodDefault<z.ZodBoolean>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>>;
spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"periodic-calendar">;
calendar: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"periodic-data">;
domain: z.ZodString;
object: z.ZodString;
dateField: z.ZodString;
offset: z.ZodString;
filter: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"event">;
rule: z.ZodString;
eventType: z.ZodDefault<z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"registration">;
formHint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
}, z.core.$strip>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
trigger: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TriggerId", "out">;
name: z.ZodString;
enabled: z.ZodDefault<z.ZodBoolean>;
processPackageId: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
mapping: z.ZodDefault<z.ZodArray<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>>>;
confirm: z.ZodDefault<z.ZodObject<{
required: z.ZodDefault<z.ZodBoolean>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>>;
spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"periodic-calendar">;
calendar: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"periodic-data">;
domain: z.ZodString;
object: z.ZodString;
dateField: z.ZodString;
offset: z.ZodString;
filter: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"event">;
rule: z.ZodString;
eventType: z.ZodDefault<z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"registration">;
formHint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
}, z.core.$strip>;
}, z.core.$strip>;
};
/**
* 工作组 = 一组「岗位 → 员工」的绑定,**起单时装载、随工作流走**。
*
* 它是**绑定先于策略**,不是第五种负责人策略:起单人有组,整条流的岗位就按组指人;
* 没有组才回落四策略。装进工作流的是**快照** —— 改组不改已起的单。
*/
export declare const listWorkGroupsRoute: {
readonly method: "GET";
readonly path: "/api/gov/work-groups";
/** `ownerName` 是组长姓名的呈现补充,读表时一并带出,免得前端再对一次 id */
readonly output: z.ZodObject<{
groups: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
members: z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
ownerName: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 一人一组:按 `ownerId` 落,已有即更新、没有即新建 */
export declare const saveWorkGroupRoute: {
readonly method: "PUT";
readonly path: "/api/gov/work-groups";
readonly body: z.ZodObject<{
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
name: z.ZodString;
members: z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
group: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
members: z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
}, z.core.$strip>;
};
/**
* 经安装通道装入活动包 —— **无代码通道**(ADR-004):交的是清单 + .js 产物,都是数据。
*
* 安装两审在服务端跑:静态审读清单(工具契约在否、模型名绑没绑、模版有没有脚本、
* 声明与已物化的台账冲不冲),回放审重演历史(首装无历史即免,以样例集替代)。
* **恒为新增、版本并存**:装入不覆盖旧版本,在途任务按其启动时版本跑完。
*/
export declare const installActivityRoute: {
readonly method: "POST";
readonly path: "/api/gov/activities";
readonly body: z.ZodObject<{
manifest: z.ZodObject<{
identity: z.ZodObject<{
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
name: z.ZodString;
packageVersion: z.ZodString;
category: z.ZodString;
sdkVersion: z.ZodString;
checksum: z.ZodString;
signature: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
contract: z.ZodObject<{
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
version: z.ZodString;
input: z.ZodObject<{
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
messageAllowed: z.ZodDefault<z.ZodBoolean>;
messageHint: z.ZodOptional<z.ZodString>;
inboundComm: z.ZodOptional<z.ZodObject<{
channel: z.ZodDefault<z.ZodString>;
partyField: z.ZodString;
subjectField: z.ZodOptional<z.ZodString>;
bodyField: z.ZodOptional<z.ZodString>;
attachmentsField: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
output: z.ZodObject<{
mandatory: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
description: z.ZodOptional<z.ZodString>;
when: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
selective: z.ZodDefault<z.ZodArray<z.ZodObject<{
group: z.ZodString;
ports: z.ZodArray<z.ZodObject<{
name: z.ZodString;
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
description: z.ZodOptional<z.ZodString>;
when: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>>;
}, z.core.$strip>;
requiredDeliverables: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
ledger: z.ZodOptional<z.ZodString>;
ledgers: z.ZodOptional<z.ZodArray<z.ZodString>>;
editableAtRelease: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>>;
acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
level: z.ZodEnum<{
L1: "L1";
L2: "L2";
L3: "L3";
L4: "L4";
L5: "L5";
}>;
predicate: z.ZodOptional<z.ZodString>;
modelRef: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
revisableAtRelease: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
label: z.ZodString;
ledger: z.ZodString;
}, z.core.$strip>>>;
prohibitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
statement: z.ZodString;
}, z.core.$strip>>>;
authorization: z.ZodObject<{
discretion: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
statement: z.ZodString;
}, z.core.$strip>>>;
preauthorizedActions: z.ZodDefault<z.ZodArray<z.ZodObject<{
tool: z.ZodString;
operation: z.ZodString;
limit: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
humanCallBudget: z.ZodNumber;
}, z.core.$strip>;
resources: z.ZodObject<{
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
version: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
skills: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "SkillId", "out">>>;
models: z.ZodDefault<z.ZodArray<z.ZodString>>;
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
budget: z.ZodObject<{
steps: z.ZodNumber;
tokens: z.ZodNumber;
activeMinutes: z.ZodNumber;
humanCalls: z.ZodNumber;
}, z.core.$strip>;
}, z.core.$strip>;
}, z.core.$strip>;
declarations: z.ZodObject<{
models: z.ZodDefault<z.ZodArray<z.ZodString>>;
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
version: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
ledger: z.ZodDefault<z.ZodArray<z.ZodObject<{
domain: z.ZodString;
object: z.ZodString;
label: z.ZodOptional<z.ZodString>;
kind: z.ZodDefault<z.ZodEnum<{
record: "record";
master: "master";
derived: "derived";
}>>;
caseKey: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodObject<{
titleColumn: z.ZodString;
bodyColumn: z.ZodString;
formatColumn: z.ZodString;
}, z.core.$strip>>;
fields: z.ZodArray<z.ZodObject<{
name: z.ZodString;
type: z.ZodEnum<{
number: "number";
boolean: "boolean";
json: "json";
text: "text";
date: "date";
integer: "integer";
timestamp: "timestamp";
}>;
label: z.ZodOptional<z.ZodString>;
primaryKey: z.ZodDefault<z.ZodBoolean>;
masked: z.ZodDefault<z.ZodBoolean>;
required: z.ZodOptional<z.ZodBoolean>;
tally: z.ZodOptional<z.ZodArray<z.ZodString>>;
expect: z.ZodOptional<z.ZodBoolean>;
auto: z.ZodOptional<z.ZodBoolean>;
requiredWhen: z.ZodOptional<z.ZodObject<{
column: z.ZodString;
value: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>>>;
listeners: z.ZodDefault<z.ZodArray<z.ZodObject<{
origin: z.ZodEnum<{
static: "static";
dynamic: "dynamic";
}>;
eventType: z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>;
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
condition: z.ZodOptional<z.ZodString>;
semantic: z.ZodEnum<{
observe: "observe";
"complete-step": "complete-step";
}>;
deadline: z.ZodString;
escalation: z.ZodDefault<z.ZodArray<z.ZodEnum<{
nudge: "nudge";
reroute: "reroute";
escalate: "escalate";
}>>>;
}, z.core.$strip>>>;
harness: z.ZodObject<{
memoryWindow: z.ZodDefault<z.ZodNumber>;
stallAfter: z.ZodDefault<z.ZodString>;
nudge: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
retry: z.ZodDefault<z.ZodObject<{
times: z.ZodDefault<z.ZodNumber>;
backoff: z.ZodDefault<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
}, z.core.$strip>;
assets: z.ZodObject<{
businessModel: z.ZodObject<{
cmmnXml: z.ZodString;
narrative: z.ZodString;
dmn: z.ZodObject<{
drd: z.ZodArray<z.ZodObject<{
decision: z.ZodString;
requires: z.ZodDefault<z.ZodArray<z.ZodString>>;
inputs: z.ZodDefault<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>;
tables: z.ZodArray<z.ZodObject<{
id: z.ZodString;
label: z.ZodString;
hitPolicy: z.ZodDefault<z.ZodEnum<{
UNIQUE: "UNIQUE";
FIRST: "FIRST";
PRIORITY: "PRIORITY";
COLLECT: "COLLECT";
}>>;
inputs: z.ZodArray<z.ZodObject<{
name: z.ZodString;
expression: z.ZodString;
}, z.core.$strip>>;
outputs: z.ZodArray<z.ZodObject<{
name: z.ZodString;
}, z.core.$strip>>;
rules: z.ZodArray<z.ZodObject<{
id: z.ZodString;
when: z.ZodArray<z.ZodString>;
then: z.ZodArray<z.ZodUnknown>;
annotation: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
item: z.ZodString;
intent: z.ZodString;
guide: z.ZodString;
writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
reads: z.ZodDefault<z.ZodArray<z.ZodString>>;
view: z.ZodOptional<z.ZodString>;
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
doneWhen: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>>>;
}, z.core.$strip>;
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "SkillId", "out">;
label: z.ZodString;
applicability: z.ZodString;
method: z.ZodString;
crystallized: z.ZodDefault<z.ZodArray<z.ZodObject<{
tool: z.ZodString;
input: z.ZodRecord<z.ZodString, z.ZodString>;
}, z.core.$strip>>>;
knowledgeRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
version: z.ZodString;
}, z.core.$strip>>>;
viewTemplates: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>>>;
cardSchemas: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
distillHooks: z.ZodDefault<z.ZodArray<z.ZodObject<{
on: z.ZodEnum<{
terminal: "terminal";
milestone: "milestone";
}>;
milestone: z.ZodOptional<z.ZodString>;
prompt: z.ZodString;
}, z.core.$strip>>>;
}, z.core.$strip>;
samples: z.ZodArray<z.ZodObject<{
name: z.ZodString;
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
message: z.ZodOptional<z.ZodString>;
expect: z.ZodObject<{
ports: z.ZodArray<z.ZodString>;
payloadShape: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
}, z.core.$strip>>;
entry: z.ZodObject<{
file: z.ZodString;
checksum: z.ZodString;
}, z.core.$strip>;
}, z.core.$strip>;
artifact: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
accepted: z.ZodBoolean;
activityId: z.ZodString;
packageVersion: z.ZodString;
staticFindings: z.ZodArray<z.ZodObject<{
code: z.ZodString;
severity: z.ZodString;
message: z.ZodString;
}, z.core.$strip>>;
replay: z.ZodObject<{
oldPassStillPass: z.ZodBoolean;
checked: z.ZodNumber;
skippedNoHistory: z.ZodBoolean;
regressions: z.ZodArray<z.ZodObject<{
taskId: z.ZodString;
detail: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
}, z.core.$strip>;
};
/**
* 导入自定义工具 —— 与第一方工具走**同一条门**:静态审 + 试运行审。
*
* 工具承载权力,约束严于活动包:契约对活动、实现对系统、凭证对治理台(OS 7.3)。
* 连接配置**只声明键**;值随本次导入送到治理台加密落库,此后只读得到「是否已绑定」。
*/
export declare const registerToolRoute: {
readonly method: "POST";
readonly path: "/api/gov/tools";
readonly body: z.ZodObject<{
contract: z.ZodObject<{
name: z.ZodString;
displayName: z.ZodOptional<z.ZodString>;
version: z.ZodString;
description: z.ZodString;
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
effect: z.ZodEnum<{
read: "read";
write: "write";
}>;
errors: z.ZodDefault<z.ZodArray<z.ZodObject<{
code: z.ZodString;
retryable: z.ZodBoolean;
message: z.ZodString;
}, z.core.$strip>>>;
idempotent: z.ZodDefault<z.ZodBoolean>;
timeoutMs: z.ZodDefault<z.ZodNumber>;
retries: z.ZodDefault<z.ZodNumber>;
connectionKeys: z.ZodDefault<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
connectionValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
samples: z.ZodArray<z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
accepted: z.ZodBoolean;
findings: z.ZodArray<z.ZodObject<{
code: z.ZodString;
severity: z.ZodString;
message: z.ZodString;
}, z.core.$strip>>;
trialRun: z.ZodObject<{
ran: z.ZodNumber;
passed: z.ZodNumber;
failures: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
}, z.core.$strip>;
};
export declare const listActivitiesRoute: {
readonly method: "GET";
readonly path: "/api/gov/activities";
readonly output: z.ZodObject<{
activities: z.ZodArray<z.ZodObject<{
activityId: z.ZodString;
name: z.ZodString;
category: z.ZodString;
enabled: z.ZodBoolean;
packageVersions: z.ZodArray<z.ZodObject<{
version: z.ZodString;
state: z.ZodString;
installedAt: z.ZodString;
}, z.core.$strip>>;
assetVersions: z.ZodArray<z.ZodObject<{
kind: z.ZodString;
version: z.ZodNumber;
effective: z.ZodBoolean;
}, z.core.$strip>>;
contract: z.ZodObject<{
requiredInputs: z.ZodArray<z.ZodString>;
inputFields: z.ZodArray<z.ZodObject<{
name: z.ZodString;
type: z.ZodString;
required: z.ZodBoolean;
label: z.ZodOptional<z.ZodString>;
format: z.ZodOptional<z.ZodString>;
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
value: z.ZodString;
label: z.ZodString;
}, z.core.$strip>>>;
example: z.ZodOptional<z.ZodString>;
showWhen: z.ZodOptional<z.ZodObject<{
field: z.ZodString;
equals: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
samples: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
outputPorts: z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
fields: z.ZodArray<z.ZodObject<{
name: z.ZodString;
type: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
tools: z.ZodArray<z.ZodString>;
models: z.ZodArray<z.ZodString>;
objects: z.ZodArray<z.ZodString>;
roles: z.ZodArray<z.ZodString>;
humanCallBudget: z.ZodNumber;
}, z.core.$strip>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const listToolsRoute: {
readonly method: "GET";
readonly path: "/api/gov/tools";
readonly output: z.ZodObject<{
tools: z.ZodArray<z.ZodObject<{
name: z.ZodString;
displayName: z.ZodString;
version: z.ZodString;
description: z.ZodString;
effect: z.ZodEnum<{
read: "read";
write: "write";
}>;
pure: z.ZodBoolean;
connectionKeys: z.ZodArray<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const listLedgerObjectsRoute: {
readonly method: "GET";
readonly path: "/api/gov/data/objects";
/** `label` 是人读名(落在表注释上);缺省即没登记,呈现退回对象键 */
readonly output: z.ZodObject<{
objects: z.ZodArray<z.ZodObject<{
domain: z.ZodString;
object: z.ZodString;
label: z.ZodOptional<z.ZodString>;
kind: z.ZodOptional<z.ZodEnum<{
record: "record";
master: "master";
derived: "derived";
}>>;
caseKey: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const browseLedgerRoute: {
readonly method: "GET";
readonly path: "/api/gov/data/:domain/:object";
readonly params: z.ZodObject<{
domain: z.ZodString;
object: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
columns: z.ZodArray<z.ZodObject<{
name: z.ZodString;
type: z.ZodString;
label: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
primaryKey: z.ZodArray<z.ZodString>;
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
total: z.ZodNumber;
}, z.core.$strip>;
};
export declare const listActivityMemoryRoute: {
readonly method: "GET";
readonly path: "/api/gov/memory/:activityId";
readonly params: z.ZodObject<{
activityId: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
entries: z.ZodArray<z.ZodObject<{
id: z.ZodString;
layer: z.ZodString;
statement: z.ZodString;
evidenceCount: z.ZodNumber;
incrementState: z.ZodOptional<z.ZodString>;
createdAt: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 通道配置里本就没有凭证字段(凭证只在治理台的连接配置中,ADR-009);此处整体可回 */
export declare const listChannelsRoute: {
readonly method: "GET";
readonly path: "/api/gov/channels";
readonly output: z.ZodObject<{
channels: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
kind: z.ZodEnum<{
mail: "mail";
im: "im";
}>;
address: z.ZodString;
enabled: z.ZodBoolean;
extractCount: z.ZodNumber;
extract: z.ZodDefault<z.ZodArray<z.ZodObject<{
key: z.ZodString;
regex: z.ZodString;
source: z.ZodEnum<{
from: "from";
to: "to";
subject: "subject";
body: "body";
both: "both";
}>;
}, z.core.$strip>>>;
mappingCount: z.ZodNumber;
fallbackPosition: z.ZodOptional<z.ZodString>;
addressWindowMs: z.ZodNumber;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 审批单不是任务:没有预算、没有任务日志,只有批不批(卡在审批人工位的验收工单) */
export declare const listApprovalsRoute: {
readonly method: "GET";
readonly path: "/api/gov/approvals";
readonly output: z.ZodObject<{
approvals: z.ZodArray<z.ZodObject<{
id: z.ZodString;
workflowId: z.ZodString;
workflowSubject: z.ZodString;
title: z.ZodString;
approverName: z.ZodString;
state: z.ZodEnum<{
pending: "pending";
rejected: "rejected";
passed: "passed";
}>;
issuedAt: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 起一条流(测试台专用):**带节点指派**把整条流定向到指定账号 ——
* 真实任务照旧落到那个人的工作台,测试台只管起单与观测。
*/
/**
* 触发器的**运营配置**:要不要人工确认、谁来确认 —— 与设计面的 upsert 分口,
* 设计动规则不碰这两项,运营动这两项不碰规则。
*/
export declare const setTriggerConfirmRoute: {
readonly method: "POST";
readonly path: "/api/gov/triggers/:id/confirm";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly body: z.ZodObject<{
required: z.ZodBoolean;
staffId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
/** 节点负责人(运营配置):流程包的哪个节点归谁 —— 显式指派 > 这里 > 轮值 */
export declare const listNodeOwnersRoute: {
readonly method: "GET";
readonly path: "/api/gov/packages/:id/owners";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
owners: z.ZodArray<z.ZodObject<{
nodeId: z.ZodString;
staffId: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const setNodeOwnerRoute: {
readonly method: "PUT";
readonly path: "/api/gov/packages/:id/owners/:nodeId";
readonly params: z.ZodObject<{
id: z.ZodString;
nodeId: z.ZodString;
}, z.core.$strip>;
/** null = 撤掉运营指定,回到轮值 */
readonly body: z.ZodObject<{
staffId: z.ZodNullable<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
export declare const testRunRoute: {
readonly method: "POST";
readonly path: "/api/gov/testbed/run";
readonly body: z.ZodObject<{
packageId: z.ZodString;
mail: z.ZodObject<{
from: z.ZodString;
to: z.ZodDefault<z.ZodString>;
subject: z.ZodString;
body: z.ZodString;
attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
contentType: z.ZodString;
size: z.ZodNumber;
}, z.core.$strip>>>;
}, z.core.$strip>;
assignments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
workflowId: z.ZodString;
state: z.ZodEnum<{
terminated: "terminated";
running: "running";
waiting: "waiting";
completed: "completed";
abnormal: "abnormal";
}>;
}, z.core.$strip>;
};
/**
* 仿真测试台 · 试跑**一个活动** —— 与试跑流程包并列的第二种试法。
*
* 为什么要单有一条:开发一个活动时,关心的是「这个活动自己跑不跑得动」——
* 案例模型推不推得开、判据取不取得齐、台账写不写得对、验收卡长什么样。
* 走流程包试,前面几个节点的噪音全得先趟一遍,而且每改一次活动就要重跑整条流。
*
* 起出来的是**真任务**(不挂工作流),照旧落到被指派人的工作台、照旧过 Harness 与放行门 ——
* 试跑不等于假跑:假跑试不出任何东西。区别只在它带 `origin='testbed'`,可以连根拔掉。
*/
export declare const testRunActivityRoute: {
readonly method: "POST";
readonly path: "/api/gov/testbed/run-activity";
readonly body: z.ZodObject<{
activityId: z.ZodString;
data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
message: z.ZodDefault<z.ZodString>;
ownerId: z.ZodDefault<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
taskId: z.ZodString;
title: z.ZodString;
}, z.core.$strip>;
};
/**
* 停止仿真 —— **把这一单连根拔掉**:工作流、它的活动任务、工单、实例、trace 全部销毁。
* 仿真不是生产:试跑留下的东西不该在库里、在别人工作台上过夜。
*/
export declare const testStopRoute: {
readonly method: "POST";
readonly path: "/api/gov/testbed/stop";
/** 两种试法各有其拔法:流程包给 workflowId,单活动给 taskId;都不给 = 拔掉所有试跑残留 */
readonly body: z.ZodObject<{
workflowId: z.ZodDefault<z.ZodString>;
taskId: z.ZodDefault<z.ZodString>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
destroyed: z.ZodBoolean;
tasks: z.ZodNumber;
}, z.core.$strip>;
};
/** 当前在跑的仿真(测试台一次只跑一条)—— 刷新页面也认得回来 */
/**
* 当前这一台仪器上的试跑单(测试台一次只跑一条)—— 刷新页面也认得回来。
*
* **返回还在跑的那一单,以及刚跑完的那一单** —— 两者要分得开:
* `live` 为真才锁旋钮(在跑的不许换台);为假表示它已收尾,观测面照旧摆着结果给人看,
* 但可以再起一单了。从前不分,已终结的单照样被当成「在跑」——
* 跑完之后旋钮永久锁住,人只能刷新整页才起得了下一单(实测)。
*/
export declare const testCurrentRoute: {
readonly method: "GET";
readonly path: "/api/gov/testbed/current";
readonly output: z.ZodObject<{
workflowId: z.ZodOptional<z.ZodString>;
subject: z.ZodOptional<z.ZodString>;
taskId: z.ZodOptional<z.ZodString>;
activityId: z.ZodOptional<z.ZodString>;
live: z.ZodDefault<z.ZodBoolean>;
terminal: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
};
/**
* 单活动试跑的**观测面** —— 一屏看穿这一单:
* 轨迹(每一拍干了什么)· 台账草稿(成果落到哪儿了)· 卡(问了谁什么)· 预算读数。
*
* 流程包那侧看的是 trace 树(节点 → 步骤);活动这侧要看的是**活动内部**,
* 拿 trace 树看不出「第三拍为什么被拒」。
*/
export declare const testActivityStateRoute: {
readonly method: "GET";
readonly path: "/api/gov/testbed/activity/:taskId";
readonly params: z.ZodObject<{
taskId: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
taskId: z.ZodString;
activityId: z.ZodString;
title: z.ZodString;
runtime: z.ZodEnum<{
running: "running";
"awaiting-human": "awaiting-human";
"awaiting-event": "awaiting-event";
suspended: "suspended";
"landing-blocked": "landing-blocked";
terminal: "terminal";
}>;
terminal: z.ZodOptional<z.ZodEnum<{
released: "released";
blocked: "blocked";
stalled: "stalled";
exhausted: "exhausted";
terminated: "terminated";
}>>;
reason: z.ZodOptional<z.ZodString>;
used: z.ZodObject<{
steps: z.ZodNumber;
tokens: z.ZodNumber;
humanCalls: z.ZodNumber;
}, z.core.$strip>;
caps: z.ZodObject<{
steps: z.ZodNumber;
tokens: z.ZodNumber;
humanCalls: z.ZodNumber;
}, z.core.$strip>;
trail: z.ZodArray<z.ZodObject<{
at: z.ZodString;
kind: z.ZodString;
title: z.ZodString;
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
drafts: z.ZodArray<z.ZodObject<{
address: z.ZodString;
key: z.ZodRecord<z.ZodString, z.ZodUnknown>;
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>;
cards: z.ZodArray<z.ZodObject<{
id: z.ZodString;
mode: z.ZodEnum<{
execution: "execution";
acceptance: "acceptance";
}>;
title: z.ZodString;
done: z.ZodBoolean;
result: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 上传一个文件 —— 走 base64 而不是 multipart。
*
* 这一层所有路由都由同一套 zod 契约与 typed-fetch 收着,multipart 得在它旁边另开一条
* 不受契约管的路;而这里要传的是 BOM、规格书这类几十 KB 的件,base64 那点膨胀
* 换来「照旧一条契约管到底」是划算的。真大的件不该走界面上传,该走通道。
*/
export declare const uploadFileRoute: {
readonly method: "POST";
readonly path: "/api/gov/upload";
readonly body: z.ZodObject<{
name: z.ZodString;
contentType: z.ZodDefault<z.ZodString>;
dataBase64: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ref: z.ZodString;
name: z.ZodString;
contentType: z.ZodString;
size: z.ZodNumber;
text: z.ZodOptional<z.ZodString>;
note: z.ZodString;
}, z.core.$strip>;
};
export type UploadedFile = z.infer<typeof uploadFileRoute.output>;
/** 取回原件 —— 存的是真字节,人点得开才算真留住了 */
export declare const downloadFileRoute: {
readonly method: "GET";
readonly path: "/api/gov/upload/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
name: z.ZodString;
contentType: z.ZodString;
dataBase64: z.ZodString;
}, z.core.$strip>;
};
/**
* 一次试跑的存档 —— **销毁那一刻拍的快照**。
*
* 「停止仿真 = 连根拔掉」这条不变(试跑起的是真任务,不该在别人工作台上过夜);
* 拔掉之前把这一单的观测面存下来。开发活动是反复试的活,「上一版跑了几拍、
* 卡在哪一步、台账写成什么样」正是要拿来比对的东西 —— 拔干净等于每改一次
* 就把上一次的账一并烧了。
*/
export declare const testLogRowSchema: z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<{
activity: "activity";
package: "package";
}>;
subject: z.ZodString;
target: z.ZodString;
taskId: z.ZodOptional<z.ZodString>;
workflowId: z.ZodOptional<z.ZodString>;
terminal: z.ZodOptional<z.ZodString>;
reason: z.ZodOptional<z.ZodString>;
used: z.ZodObject<{
steps: z.ZodOptional<z.ZodNumber>;
tokens: z.ZodOptional<z.ZodNumber>;
humanCalls: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
caps: z.ZodObject<{
steps: z.ZodOptional<z.ZodNumber>;
tokens: z.ZodOptional<z.ZodNumber>;
humanCalls: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
trailCount: z.ZodNumber;
draftCount: z.ZodNumber;
cardCount: z.ZodNumber;
startedAt: z.ZodOptional<z.ZodString>;
archivedAt: z.ZodString;
}, z.core.$strip>;
export type TestLogRow = z.infer<typeof testLogRowSchema>;
export declare const listTestLogsRoute: {
readonly method: "GET";
readonly path: "/api/gov/testbed/logs";
readonly output: z.ZodObject<{
runs: z.ZodArray<z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<{
activity: "activity";
package: "package";
}>;
subject: z.ZodString;
target: z.ZodString;
taskId: z.ZodOptional<z.ZodString>;
workflowId: z.ZodOptional<z.ZodString>;
terminal: z.ZodOptional<z.ZodString>;
reason: z.ZodOptional<z.ZodString>;
used: z.ZodObject<{
steps: z.ZodOptional<z.ZodNumber>;
tokens: z.ZodOptional<z.ZodNumber>;
humanCalls: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
caps: z.ZodObject<{
steps: z.ZodOptional<z.ZodNumber>;
tokens: z.ZodOptional<z.ZodNumber>;
humanCalls: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
trailCount: z.ZodNumber;
draftCount: z.ZodNumber;
cardCount: z.ZodNumber;
startedAt: z.ZodOptional<z.ZodString>;
archivedAt: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 一次试跑的正文 —— 逐拍轨迹 / 台账草稿 / 发过的卡 */
export declare const testLogDetailRoute: {
readonly method: "GET";
readonly path: "/api/gov/testbed/logs/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<{
activity: "activity";
package: "package";
}>;
subject: z.ZodString;
target: z.ZodString;
taskId: z.ZodOptional<z.ZodString>;
workflowId: z.ZodOptional<z.ZodString>;
terminal: z.ZodOptional<z.ZodString>;
reason: z.ZodOptional<z.ZodString>;
used: z.ZodObject<{
steps: z.ZodOptional<z.ZodNumber>;
tokens: z.ZodOptional<z.ZodNumber>;
humanCalls: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
caps: z.ZodObject<{
steps: z.ZodOptional<z.ZodNumber>;
tokens: z.ZodOptional<z.ZodNumber>;
humanCalls: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
trailCount: z.ZodNumber;
draftCount: z.ZodNumber;
cardCount: z.ZodNumber;
startedAt: z.ZodOptional<z.ZodString>;
archivedAt: z.ZodString;
trail: z.ZodArray<z.ZodObject<{
at: z.ZodString;
kind: z.ZodString;
title: z.ZodString;
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
drafts: z.ZodArray<z.ZodObject<{
address: z.ZodString;
key: z.ZodRecord<z.ZodString, z.ZodUnknown>;
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>;
cards: z.ZodArray<z.ZodObject<{
id: z.ZodString;
mode: z.ZodString;
title: z.ZodString;
done: z.ZodBoolean;
result: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 删一条 / 清空 —— 日志是给人比对用的,留多久由人说了算 */
export declare const deleteTestLogRoute: {
readonly method: "DELETE";
readonly path: "/api/gov/testbed/logs/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
deleted: z.ZodNumber;
}, z.core.$strip>;
};
export declare const clearTestLogsRoute: {
readonly method: "DELETE";
readonly path: "/api/gov/testbed/logs";
readonly output: z.ZodObject<{
deleted: z.ZodNumber;
}, z.core.$strip>;
};
/** 全链 Trace:一条工作流的 span 树(节点 → 步骤 / 工具 / 模型 / 人卡) */
export declare const traceOfWorkflowRoute: {
readonly method: "GET";
readonly path: "/api/gov/workflows/:id/trace";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
spans: z.ZodArray<z.ZodObject<{
id: z.ZodString;
traceId: z.ZodString;
parentId: z.ZodOptional<z.ZodString>;
name: z.ZodString;
kind: z.ZodEnum<{
node: "node";
human: "human";
workflow: "workflow";
tool: "tool";
model: "model";
step: "step";
}>;
nodeId: z.ZodOptional<z.ZodString>;
taskId: z.ZodOptional<z.ZodString>;
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
error: z.ZodOptional<z.ZodObject<{
message: z.ZodString;
}, z.core.$strip>>;
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
startedAt: z.ZodString;
endedAt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const govWorkflowRoute: {
readonly method: "GET";
readonly path: "/api/gov/workflows/:id";
readonly params: z.ZodObject<{
id: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
workflow: z.ZodObject<{
id: z.ZodString;
subject: z.ZodString;
state: z.ZodEnum<{
terminated: "terminated";
running: "running";
waiting: "waiting";
completed: "completed";
abnormal: "abnormal";
}>;
packageId: z.ZodString;
packageVersion: z.ZodNumber;
source: z.ZodObject<{
kind: z.ZodString;
ref: z.ZodString;
by: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
startedAt: z.ZodString;
finishedAt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
pkg: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
active: "active";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
activityVersion: z.ZodOptional<z.ZodString>;
failure: z.ZodDefault<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.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
templateId: z.ZodOptional<z.ZodString>;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
instances: z.ZodArray<z.ZodObject<{
nodeId: z.ZodString;
instance: z.ZodNumber;
running: z.ZodBoolean;
waiting: z.ZodBoolean;
activated: z.ZodBoolean;
terminal: z.ZodOptional<z.ZodEnum<{
released: "released";
blocked: "blocked";
stalled: "stalled";
exhausted: "exhausted";
terminated: "terminated";
}>>;
}, z.core.$strip>>;
tasks: z.ZodArray<z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
nodeId: z.ZodString;
title: z.ZodString;
ownerName: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 度量八指标(OS 8.3)—— 运营驾驶舱的仪表读数。
*
* 出参直接复用 `reportMetricsSchema`:**与工作台汇报同源同口径**。
* 治理台若另算一套,同一个组织会读出两个自主率 —— 那时候争的就不是数,是谁的表准。
* 自主率与纠正率**成对读**,复合为有效自主率 —— 单看自主率会奖励「猛冲后返工」。
*/
export declare const govMetricsRoute: {
readonly method: "GET";
readonly path: "/api/gov/metrics";
/** 统计窗口 —— 不传按月;驾驶舱可切日/周/月/年 */
readonly query: z.ZodObject<{
period: z.ZodOptional<z.ZodEnum<{
day: "day";
week: "week";
month: "month";
year: "year";
}>>;
}, z.core.$strip>;
/** `period` 原样回声:客户端不传时,由它知道服务端用的是哪个窗口 */
readonly output: z.ZodObject<{
autonomy: z.ZodNumber;
correction: z.ZodNumber;
effectiveAutonomy: z.ZodNumber;
interruption: z.ZodNumber;
breakpoint: z.ZodNumber;
dmnCoverage: z.ZodNumber;
unitCost: z.ZodObject<{
tokens: z.ZodNumber;
minutes: z.ZodNumber;
humanCalls: z.ZodNumber;
}, z.core.$strip>;
terminalMix: z.ZodRecord<z.ZodString, z.ZodNumber>;
taskCount: z.ZodNumber;
period: z.ZodEnum<{
day: "day";
week: "week";
month: "month";
year: "year";
}>;
}, z.core.$strip>;
};
export type GovTasksOutput = z.infer<typeof listGovTasksRoute.output>;
export type GovWorkGroupsOutput = z.infer<typeof listWorkGroupsRoute.output>;
export type GovApprovalsOutput = z.infer<typeof listApprovalsRoute.output>;
export type GovStaffOutput = z.infer<typeof listStaffRoute.output>;
export type GovGrantsOutput = z.infer<typeof listGrantsRoute.output>;
export type GovPackagesOutput = z.infer<typeof listProcessPackagesRoute.output>;
export type GovTriggersOutput = z.infer<typeof listTriggersRoute.output>;
export type GovActivitiesOutput = z.infer<typeof listActivitiesRoute.output>;
export type GovToolsOutput = z.infer<typeof listToolsRoute.output>;
export type GovObjectsOutput = z.infer<typeof listLedgerObjectsRoute.output>;
export type GovLedgerPageOutput = z.infer<typeof browseLedgerRoute.output>;
export type GovMemoryOutput = z.infer<typeof listActivityMemoryRoute.output>;
export type GovMetricsOutput = z.infer<typeof govMetricsRoute.output>;
export type GovChannelsOutput = z.infer<typeof listChannelsRoute.output>;
export type GovLlmOutput = z.infer<typeof listLlmInstancesRoute.output>;
export type GovWorkflowOutput = z.infer<typeof govWorkflowRoute.output>;
export type GovTaskLogOutput = z.infer<typeof govTaskLogRoute.output>;