/** * 治理台路由契约(编码规范 §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; account: z.ZodString; name: z.ZodString; positionId: z.core.$ZodBranded; state: z.ZodDefault>; position: z.ZodObject<{ id: z.core.$ZodBranded; code: z.ZodString; name: z.ZodString; note: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>>; positions: z.ZodArray; code: z.ZodString; name: z.ZodString; note: z.ZodOptional; }, 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.core.$strip>; readonly output: z.ZodObject<{ id: z.core.$ZodBranded; account: z.ZodString; name: z.ZodString; positionId: z.core.$ZodBranded; state: z.ZodDefault>; }, 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.core.$strip>; readonly output: z.ZodObject<{ staffId: z.core.$ZodBranded; blocked: z.ZodBoolean; openTasks: z.ZodDefault>>; openCards: z.ZodDefault>>; openApprovals: z.ZodDefault>>; }, 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.core.$strip>; readonly output: z.ZodObject<{ ok: z.ZodBoolean; check: z.ZodObject<{ staffId: z.core.$ZodBranded; blocked: z.ZodBoolean; openTasks: z.ZodDefault>>; openCards: z.ZodDefault>>; openApprovals: z.ZodDefault>>; }, 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.core.$strip>; readonly output: z.ZodObject<{ grants: z.ZodArray; object: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"data">; domain: z.ZodString; object: z.ZodString; field: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"governance">; function: z.ZodEnum<{ data: "data"; task: "task"; trigger: "trigger"; 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.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.core.$strip>; readonly body: z.ZodObject<{ grants: z.ZodArray; object: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"data">; domain: z.ZodString; object: z.ZodString; field: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"governance">; function: z.ZodEnum<{ data: "data"; task: "task"; trigger: "trigger"; 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.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; object: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"data">; domain: z.ZodString; object: z.ZodString; field: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"governance">; function: z.ZodEnum<{ data: "data"; task: "task"; trigger: "trigger"; 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.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; /** 活动只见自定义模型名;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; enabled: z.ZodDefault; }, z.core.$strip>; export type LlmInstanceView = z.infer; export declare const listLlmInstancesRoute: { readonly method: "GET"; readonly path: "/api/gov/llm"; readonly output: z.ZodObject<{ instances: z.ZodArray; baseUrl: z.ZodString; model: z.ZodString; apiKeyBound: z.ZodBoolean; systemUse: z.ZodDefault; enabled: z.ZodDefault; }, 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; name: z.ZodString; provider: z.ZodEnum<{ "openai-compatible": "openai-compatible"; openai: "openai"; deepseek: "deepseek"; anthropic: "anthropic"; qwen: "qwen"; }>; baseUrl: z.ZodDefault; model: z.ZodString; apiKey: z.ZodOptional; systemUse: z.ZodDefault; enabled: z.ZodDefault; }, 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; enabled: z.ZodDefault; }, 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; error: z.ZodOptional; }, z.core.$strip>; }; export declare const govTaskRowSchema: z.ZodObject<{ id: z.core.$ZodBranded; title: z.ZodString; activityId: z.ZodString; paradigm: z.ZodEnum<{ loop: "loop"; flow: "flow"; }>; 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>; workflowId: z.ZodOptional; usedSteps: z.ZodNumber; capSteps: z.ZodNumber; startedAt: z.ZodString; }, z.core.$strip>; export type GovTaskRow = z.infer; export declare const listGovTasksRoute: { readonly method: "GET"; readonly path: "/api/gov/tasks"; readonly output: z.ZodObject<{ tasks: z.ZodArray; title: z.ZodString; activityId: z.ZodString; paradigm: z.ZodEnum<{ loop: "loop"; flow: "flow"; }>; 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>; workflowId: z.ZodOptional; usedSteps: z.ZodNumber; capSteps: z.ZodNumber; startedAt: z.ZodString; }, z.core.$strip>>; workflows: z.ZodArray; 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.core.$strip>; readonly body: z.ZodObject<{ semantic: z.ZodEnum<{ pause: "pause"; halt: "halt"; terminate: "terminate"; }>; reason: z.ZodOptional; }, 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.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.core.$strip>; readonly body: z.ZodObject<{ to: z.core.$ZodBranded; }, z.core.$strip>; readonly output: z.ZodObject<{ ok: z.ZodBoolean; ownerId: z.core.$ZodBranded; }, 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.core.$strip>; readonly output: z.ZodObject<{ log: z.ZodArray>; }, z.core.$strip>; }; export declare const listProcessPackagesRoute: { readonly method: "GET"; readonly path: "/api/gov/process"; readonly output: z.ZodObject<{ packages: z.ZodArray; name: z.ZodString; version: z.ZodNumber; state: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; callInterface: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; nodes: z.ZodArray; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; in: z.ZodOptional>; out: z.ZodOptional>; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; basis: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "kind">>; edges: z.ZodArray; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; tone: z.ZodOptional>; reopen: z.ZodDefault; }, z.core.$strip>>; variables: z.ZodDefault; }, z.core.$strip>>>; description: z.ZodOptional; diagram: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; }; /** 画图即校验 —— 与前端画布同源的闭合校验 */ /** * 保存流程包(编排工作区的落笔)。 * **保存 ≠ 发布**:落的是这一版的定义(草稿可反复存);已发布版本不可回改 —— * 后端按 (id, version, state) 判:published 版拒存,提示另起新版本。 * 返回连同闭合报告:画图即校验,每次落笔都知道离「可发布」还差几条。 */ export declare const saveProcessRoute: { readonly method: "PUT"; readonly path: "/api/gov/process"; readonly body: z.ZodObject<{ pkg: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; version: z.ZodNumber; state: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; callInterface: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; nodes: z.ZodArray; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; in: z.ZodOptional>; out: z.ZodOptional>; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; basis: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "kind">>; edges: z.ZodArray; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; tone: z.ZodOptional>; reopen: z.ZodDefault; }, z.core.$strip>>; variables: z.ZodDefault; }, z.core.$strip>>>; description: z.ZodOptional; diagram: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; readonly output: z.ZodObject<{ pkg: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; version: z.ZodNumber; state: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; callInterface: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; nodes: z.ZodArray; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; in: z.ZodOptional>; out: z.ZodOptional>; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; basis: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "kind">>; edges: z.ZodArray; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; tone: z.ZodOptional>; reopen: z.ZodDefault; }, z.core.$strip>>; variables: z.ZodDefault; }, z.core.$strip>>>; description: z.ZodOptional; diagram: z.ZodOptional>; }, z.core.$strip>; report: z.ZodObject<{ publishable: z.ZodBoolean; violations: z.ZodArray; nodeId: z.ZodOptional>; edgeId: z.ZodOptional; field: z.ZodOptional; message: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; }, 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; name: z.ZodString; version: z.ZodNumber; state: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; callInterface: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; nodes: z.ZodArray; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; in: z.ZodOptional>; out: z.ZodOptional>; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; basis: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "kind">>; edges: z.ZodArray; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; tone: z.ZodOptional>; reopen: z.ZodDefault; }, z.core.$strip>>; variables: z.ZodDefault; }, z.core.$strip>>>; description: z.ZodOptional; diagram: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; readonly output: z.ZodObject<{ publishable: z.ZodBoolean; violations: z.ZodArray; nodeId: z.ZodOptional>; edgeId: z.ZodOptional; field: z.ZodOptional; message: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; }; export declare const publishProcessRoute: { readonly method: "POST"; readonly path: "/api/gov/process/:id/:version/publish"; readonly params: z.ZodObject<{ id: z.ZodString; version: z.ZodString; }, z.core.$strip>; readonly output: z.ZodObject<{ publishable: z.ZodBoolean; violations: z.ZodArray; nodeId: z.ZodOptional>; edgeId: z.ZodOptional; field: z.ZodOptional; message: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; }; export declare const listTriggersRoute: { readonly method: "GET"; readonly path: "/api/gov/triggers"; readonly output: z.ZodObject<{ triggers: z.ZodArray; name: z.ZodString; enabled: z.ZodDefault; processPackageId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; spec: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"periodic-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.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"event">; rule: z.ZodString; eventType: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"registration">; formHint: z.ZodOptional; }, z.core.$strip>], "kind">; }, z.core.$strip>>; }, 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; name: z.ZodString; enabled: z.ZodDefault; processPackageId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; spec: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"periodic-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.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"event">; rule: z.ZodString; eventType: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"registration">; formHint: z.ZodOptional; }, z.core.$strip>], "kind">; }, z.core.$strip>; }, z.core.$strip>; readonly output: z.ZodObject<{ trigger: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; enabled: z.ZodDefault; processPackageId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; spec: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"periodic-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.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"event">; rule: z.ZodString; eventType: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"registration">; formHint: z.ZodOptional; }, z.core.$strip>], "kind">; }, z.core.$strip>; }, z.core.$strip>; }; export declare const listActivitiesRoute: { readonly method: "GET"; readonly path: "/api/gov/activities"; readonly output: z.ZodObject<{ activities: z.ZodArray; enabled: z.ZodBoolean; packageVersions: z.ZodArray>; assetVersions: z.ZodArray>; }, 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; pure: z.ZodBoolean; connectionKeys: z.ZodArray; }, z.core.$strip>>; }, z.core.$strip>; }; export declare const listLedgerObjectsRoute: { readonly method: "GET"; readonly path: "/api/gov/data/objects"; readonly output: z.ZodObject<{ objects: z.ZodArray>; }, 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<{ columns: z.ZodArray>; primaryKey: z.ZodArray; rows: z.ZodArray>; 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; 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; address: z.ZodString; enabled: z.ZodBoolean; extractCount: z.ZodNumber; mappingCount: z.ZodNumber; fallbackPosition: z.ZodOptional; 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; issuedAt: 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.core.$strip>; startedAt: z.ZodString; finishedAt: z.ZodOptional; }, z.core.$strip>; pkg: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; version: z.ZodNumber; state: z.ZodEnum<{ draft: "draft"; published: "published"; retired: "retired"; }>; callInterface: z.ZodObject<{ input: z.ZodRecord; output: z.ZodRecord; }, z.core.$strip>; nodes: z.ZodArray; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"end">; output: z.ZodOptional>; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"activity">; activityId: z.core.$ZodBranded; in: z.ZodOptional>; out: z.ZodOptional>; activityVersion: z.ZodOptional; owner: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; failure: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"reroute">; edgeId: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"escalate">; approvalNodeId: z.core.$ZodBranded; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"tolerate">; }, z.core.$strip>], "kind">>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"approval">; approver: z.ZodObject<{ position: z.ZodString; strategy: z.ZodDefault>; staffId: z.ZodOptional>; }, z.core.$strip>; reject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"reopen">; nodeId: z.core.$ZodBranded; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"terminate">; }, z.core.$strip>], "kind">; nudge: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; message: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"gateway">; gateway: z.ZodEnum<{ parallel: "parallel"; exclusive: "exclusive"; }>; mode: z.ZodEnum<{ join: "join"; fork: "fork"; }>; basis: z.ZodOptional; id: z.core.$ZodBranded; label: z.ZodString; sub: z.ZodOptional; layout: z.ZodOptional; y: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "kind">>; edges: z.ZodArray; to: z.core.$ZodBranded; condition: z.ZodOptional; mapping: z.ZodDefault; port: z.ZodString; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"workflow-var">; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"initiation">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"constant">; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ from: z.ZodLiteral<"expression">; sfeel: z.ZodString; }, z.core.$strip>], "from">; }, z.core.$strip>>>; label: z.ZodOptional; tone: z.ZodOptional>; reopen: z.ZodDefault; }, z.core.$strip>>; variables: z.ZodDefault; }, z.core.$strip>>>; description: z.ZodOptional; diagram: z.ZodOptional>; }, z.core.$strip>; instances: z.ZodArray>; }, z.core.$strip>>; tasks: z.ZodArray; 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.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; taskCount: z.ZodNumber; period: z.ZodEnum<{ day: "day"; week: "week"; month: "month"; year: "year"; }>; }, z.core.$strip>; }; export type GovTasksOutput = z.infer; export type GovApprovalsOutput = z.infer; export type GovStaffOutput = z.infer; export type GovGrantsOutput = z.infer; export type GovPackagesOutput = z.infer; export type GovTriggersOutput = z.infer; export type GovActivitiesOutput = z.infer; export type GovToolsOutput = z.infer; export type GovObjectsOutput = z.infer; export type GovLedgerPageOutput = z.infer; export type GovMemoryOutput = z.infer; export type GovMetricsOutput = z.infer; export type GovChannelsOutput = z.infer; export type GovLlmOutput = z.infer; export type GovWorkflowOutput = z.infer; export type GovTaskLogOutput = z.infer;