Archived
feat(ops): 运营中心 · 活动模块接口落地 —— L1/L2/L3 十一条(全 ops)+ 设计端活动库两条改名让位
`apps/api/src/app/activity-ops/*`(service / store / instance-state / instance-steps / launch-params / summaries / view-html / view-scope)+ `routes/activities.ts`;契约 `activity-ops.ts` / `api/activity-ops.ts` (与队友按文档补的那版 43 个导出同名,多 INSTANCE_REASON_KINDS / STEP_RESULTS / launchOptionSchema); 迁移 0035_activity_ops;《API文档-活动模块》按契约回写。 设计端活动库 GET/POST `/api/gov/activities` 改名 `/api/gov/activity-packages`,`/api/gov/activities/*` 整个让给运营端(前端 import 路由对象,零改动);activity-registry CONTRACT.md 与路由总表同步。 2026-08-27 另一会话做的,一直留在工作树没入库;与同批另两条提交互相依赖,以合并提交为验证单位。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0167qWjeyBwvfdGovd7FWbCu
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+353
@@ -0,0 +1,353 @@
|
||||
/**
|
||||
* 运营中心 · 活动模块的契约(L1 活动清单 / L2 活动详情 / L3 实例详情;`docs/API文档-活动模块.md`)。
|
||||
*
|
||||
* 只有 zod schema 与推导类型。两个概念(2026-08-25 用户定):
|
||||
* · **活动** = 装进来的活动包在运营面上的投影 —— 名称 / 分类 / 版本 / 模型来自清单,
|
||||
* 负责人 / 说明 / 图标 / 色相来自运营侧档案(`sys.activity_profile`,活动包本身不载这些);
|
||||
* · **实例** = 这个活动的一次运行(一张 task)—— 五态是对 task 运行态 / 终态的**如实映射**,
|
||||
* 不是第六套状态机(见 `INSTANCE_STATE_LABEL` 旁的口径)。
|
||||
*/
|
||||
import { z } from 'zod';
|
||||
/** 运营态:激活中 / 已禁用 —— 禁用只拦「新启动」,已完成与在途实例都不受影响(2026-08-27 用户定) */
|
||||
export declare const ACTIVITY_STATUSES: readonly ["active", "disabled"];
|
||||
export declare const activityStatusSchema: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
export type ActivityStatus = z.infer<typeof activityStatusSchema>;
|
||||
export declare const ACTIVITY_STATUS_LABEL: Readonly<Record<ActivityStatus, string>>;
|
||||
/** 业务色相 —— 一卡一色;缺省由前端兜底(`blue`) */
|
||||
export declare const ACTIVITY_HUES: readonly ["blue", "teal", "amber", "violet"];
|
||||
export declare const activityHueSchema: z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>;
|
||||
export type ActivityHue = z.infer<typeof activityHueSchema>;
|
||||
/** 凡出人都是两段:展示用 name,筛选 / 提交用 id */
|
||||
export declare const staffRefSchema: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
export type StaffRef = z.infer<typeof staffRefSchema>;
|
||||
export declare const activitySummarySchema: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
biz: z.ZodString;
|
||||
status: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
version: z.ZodString;
|
||||
owner: z.ZodNullable<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
llm: z.ZodString;
|
||||
instanceCount: z.ZodNumber;
|
||||
createdAt: z.ZodString;
|
||||
ico: z.ZodOptional<z.ZodString>;
|
||||
hue: z.ZodOptional<z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>>;
|
||||
}, z.core.$strip>;
|
||||
export type ActivitySummary = z.infer<typeof activitySummarySchema>;
|
||||
export declare const activityDetailSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
id: z.ZodString;
|
||||
version: z.ZodString;
|
||||
status: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
createdAt: z.ZodString;
|
||||
biz: z.ZodString;
|
||||
owner: z.ZodNullable<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
llm: z.ZodString;
|
||||
ico: z.ZodOptional<z.ZodString>;
|
||||
hue: z.ZodOptional<z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>>;
|
||||
desc: z.ZodString;
|
||||
view: z.ZodNullable<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
export type ActivityDetail = z.infer<typeof activityDetailSchema>;
|
||||
/**
|
||||
* 沙箱视图向父页报高的消息类型(postMessage 载荷 `{ type, height }`)。
|
||||
* 视图模版本身**无脚本**(安装静态审拦着);报高脚本由服务端在出口那一刻注入。
|
||||
*/
|
||||
export declare const ACTIVITY_VIEW_HEIGHT_MESSAGE = "jcai:view-height";
|
||||
/**
|
||||
* 实例五态(2026-08-25 用户定),对 task 的如实映射:
|
||||
* pending 已建单、推进器还没领到(`used.steps = 0`)
|
||||
* running 在途(含等人回传 / 监听中 / 挂起 / 落地受阻)
|
||||
* completed 终态 released
|
||||
* rejected 验收被负责人打回、模型还没重新提交的那一段(重新提交后回 running)
|
||||
* failed 终态 blocked / stalled / exhausted,以及手动终止(靠 `reason.kind='terminated'` 区分)
|
||||
*/
|
||||
export declare const INSTANCE_STATES: readonly ["pending", "running", "completed", "rejected", "failed"];
|
||||
export declare const instanceStateSchema: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
export type InstanceState = z.infer<typeof instanceStateSchema>;
|
||||
export declare const INSTANCE_STATE_LABEL: Readonly<Record<InstanceState, string>>;
|
||||
export declare const instanceSummarySchema: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
no: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
input: z.ZodString;
|
||||
output: z.ZodNullable<z.ZodString>;
|
||||
startedAt: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceSummary = z.infer<typeof instanceSummarySchema>;
|
||||
export declare const instanceStatsSchema: z.ZodObject<{
|
||||
total: z.ZodNumber;
|
||||
byState: z.ZodRecord<z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>, z.ZodNumber>;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceStats = z.infer<typeof instanceStatsSchema>;
|
||||
export declare const instanceListSchema: z.ZodObject<{
|
||||
stats: z.ZodObject<{
|
||||
total: z.ZodNumber;
|
||||
byState: z.ZodRecord<z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>, z.ZodNumber>;
|
||||
}, z.core.$strip>;
|
||||
total: z.ZodNumber;
|
||||
page: z.ZodNumber;
|
||||
size: z.ZodNumber;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
no: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
input: z.ZodString;
|
||||
output: z.ZodNullable<z.ZodString>;
|
||||
startedAt: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceList = z.infer<typeof instanceListSchema>;
|
||||
export declare const instanceFileSchema: z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceFile = z.infer<typeof instanceFileSchema>;
|
||||
export declare const INSTANCE_REASON_KINDS: readonly ["rejected", "failed", "terminated"];
|
||||
export declare const instanceReasonSchema: z.ZodObject<{
|
||||
kind: z.ZodEnum<{
|
||||
terminated: "terminated";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceReason = z.infer<typeof instanceReasonSchema>;
|
||||
export declare const STEP_RESULTS: readonly ["done", "fail", "current", "pending"];
|
||||
export declare const instanceStepSchema: z.ZodObject<{
|
||||
seq: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
by: z.ZodEnum<{
|
||||
human: "human";
|
||||
agent: "agent";
|
||||
}>;
|
||||
byName: z.ZodString;
|
||||
at: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
res: z.ZodEnum<{
|
||||
pending: "pending";
|
||||
done: "done";
|
||||
fail: "fail";
|
||||
current: "current";
|
||||
}>;
|
||||
note: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceStep = z.infer<typeof instanceStepSchema>;
|
||||
/** 起单来源:manual(运营端手动启动)/ upstream(工作流节点)/ mail 等通道名 / testbed(测试台试跑)/ system */
|
||||
export declare const instanceSourceSchema: z.ZodObject<{
|
||||
kind: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceSource = z.infer<typeof instanceSourceSchema>;
|
||||
export declare const instanceDetailSchema: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
startedAt: z.ZodString;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
no: z.ZodString;
|
||||
activityId: z.ZodString;
|
||||
llm: z.ZodString;
|
||||
endedAt: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
reason: z.ZodNullable<z.ZodObject<{
|
||||
kind: z.ZodEnum<{
|
||||
terminated: "terminated";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
input: z.ZodObject<{
|
||||
content: z.ZodString;
|
||||
source: z.ZodObject<{
|
||||
kind: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
submittedAt: z.ZodString;
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
output: z.ZodObject<{
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
steps: z.ZodArray<z.ZodObject<{
|
||||
seq: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
by: z.ZodEnum<{
|
||||
human: "human";
|
||||
agent: "agent";
|
||||
}>;
|
||||
byName: z.ZodString;
|
||||
at: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
res: z.ZodEnum<{
|
||||
pending: "pending";
|
||||
done: "done";
|
||||
fail: "fail";
|
||||
current: "current";
|
||||
}>;
|
||||
note: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
export type InstanceDetail = z.infer<typeof instanceDetailSchema>;
|
||||
/**
|
||||
* 控件种类:text 单行 / textarea 多行 / select 单选(只能选候选)/ combo 选择 + 新增 / list 字符串数组。
|
||||
* 新增种类前后端一起升级;前端遇到不认识的 type 摆「暂不支持的控件」。
|
||||
*/
|
||||
export declare const LAUNCH_PARAM_TYPES: readonly ["text", "textarea", "select", "combo", "list"];
|
||||
export declare const launchParamTypeSchema: z.ZodEnum<{
|
||||
text: "text";
|
||||
textarea: "textarea";
|
||||
select: "select";
|
||||
combo: "combo";
|
||||
list: "list";
|
||||
}>;
|
||||
export type LaunchParamType = z.infer<typeof launchParamTypeSchema>;
|
||||
export declare const launchOptionSchema: z.ZodObject<{
|
||||
value: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
export type LaunchOption = z.infer<typeof launchOptionSchema>;
|
||||
export declare const launchParamSchema: z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
text: "text";
|
||||
textarea: "textarea";
|
||||
select: "select";
|
||||
combo: "combo";
|
||||
list: "list";
|
||||
}>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
desc: z.ZodOptional<z.ZodString>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
value: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
||||
}, z.core.$strip>;
|
||||
export type LaunchParam = z.infer<typeof launchParamSchema>;
|
||||
export declare const launchParamsSchema: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
version: z.ZodString;
|
||||
params: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
text: "text";
|
||||
textarea: "textarea";
|
||||
select: "select";
|
||||
combo: "combo";
|
||||
list: "list";
|
||||
}>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
desc: z.ZodOptional<z.ZodString>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
value: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
export type LaunchParams = z.infer<typeof launchParamsSchema>;
|
||||
export declare const launchInputSchema: z.ZodObject<{
|
||||
idempotencyKey: z.ZodString;
|
||||
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
params: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
||||
}, z.core.$strip>;
|
||||
export type LaunchInput = z.infer<typeof launchInputSchema>;
|
||||
@@ -0,0 +1,522 @@
|
||||
/**
|
||||
* 运营中心 · 活动模块的路由契约(`docs/API文档-活动模块.md`)。
|
||||
*
|
||||
* 全部 `access: 'ops'` —— 活动区落在运营中心,与工作流 / 任务看板同端。
|
||||
* `/api/gov/*` 的写路由由 app 中间件自动广播 `{kind:'system', id:'gov'}`。
|
||||
* 设计端的活动库(包版本 / 资产版本 / 装入)在 `/api/gov/activity-packages`(governance.ts),
|
||||
* `/api/gov/activities/*` 整个归运营端(2026-08-27 用户定)。
|
||||
*/
|
||||
import { z } from 'zod';
|
||||
import type { RouteContract } from './http.ts';
|
||||
export declare const listOpsActivitiesRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities";
|
||||
readonly access: "ops";
|
||||
/** 不带 status = 全量;量小不分页 */
|
||||
readonly query: z.ZodObject<{
|
||||
status: z.ZodOptional<z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>>;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
activities: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
biz: z.ZodString;
|
||||
status: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
version: z.ZodString;
|
||||
owner: z.ZodNullable<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
llm: z.ZodString;
|
||||
instanceCount: z.ZodNumber;
|
||||
createdAt: z.ZodString;
|
||||
ico: z.ZodOptional<z.ZodString>;
|
||||
hue: z.ZodOptional<z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
export declare const getOpsActivityRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities/:activityId";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
id: z.ZodString;
|
||||
version: z.ZodString;
|
||||
status: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
createdAt: z.ZodString;
|
||||
biz: z.ZodString;
|
||||
owner: z.ZodNullable<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
llm: z.ZodString;
|
||||
ico: z.ZodOptional<z.ZodString>;
|
||||
hue: z.ZodOptional<z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>>;
|
||||
desc: z.ZodString;
|
||||
view: z.ZodNullable<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/**
|
||||
* 沙箱要渲染的活动视图 —— 处理器回 `text/html`(不是 JSON),`output` 只是形式上的字符串。
|
||||
* iframe 带不了 Authorization 头,走票据 `?ticket=`(GET,中间件已认)。404 = 该活动没配视图。
|
||||
*/
|
||||
export declare const opsActivityViewRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities/:activityId/view";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodString;
|
||||
};
|
||||
export declare const listOpsInstancesRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities/:activityId/instances";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly query: z.ZodObject<{
|
||||
id: z.ZodOptional<z.ZodString>;
|
||||
ownerId: z.ZodOptional<z.ZodString>;
|
||||
state: z.ZodOptional<z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>>;
|
||||
startedFrom: z.ZodOptional<z.ZodString>;
|
||||
startedTo: z.ZodOptional<z.ZodString>;
|
||||
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
||||
size: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
stats: z.ZodObject<{
|
||||
total: z.ZodNumber;
|
||||
byState: z.ZodRecord<z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>, z.ZodNumber>;
|
||||
}, z.core.$strip>;
|
||||
total: z.ZodNumber;
|
||||
page: z.ZodNumber;
|
||||
size: z.ZodNumber;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
no: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
input: z.ZodString;
|
||||
output: z.ZodNullable<z.ZodString>;
|
||||
startedAt: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
export declare const opsLaunchParamsRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities/:activityId/launch-params";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
version: z.ZodString;
|
||||
params: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
text: "text";
|
||||
textarea: "textarea";
|
||||
select: "select";
|
||||
combo: "combo";
|
||||
list: "list";
|
||||
}>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
desc: z.ZodOptional<z.ZodString>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
value: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/**
|
||||
* 启动活动 = 创建实例。同一 `idempotencyKey` 重放返回第一次创建的实例;
|
||||
* 412 活动已禁用;400 缺必填 / 类型不符 / select 值不在候选 / 责任人不在职;409 同键正在创建中。
|
||||
*/
|
||||
export declare const launchOpsInstanceRoute: {
|
||||
readonly method: "POST";
|
||||
readonly path: "/api/gov/activities/:activityId/instances";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly body: z.ZodObject<{
|
||||
idempotencyKey: z.ZodString;
|
||||
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
params: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
startedAt: z.ZodString;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
no: z.ZodString;
|
||||
activityId: z.ZodString;
|
||||
llm: z.ZodString;
|
||||
endedAt: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
reason: z.ZodNullable<z.ZodObject<{
|
||||
kind: z.ZodEnum<{
|
||||
terminated: "terminated";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
input: z.ZodObject<{
|
||||
content: z.ZodString;
|
||||
source: z.ZodObject<{
|
||||
kind: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
submittedAt: z.ZodString;
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
output: z.ZodObject<{
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
steps: z.ZodArray<z.ZodObject<{
|
||||
seq: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
by: z.ZodEnum<{
|
||||
human: "human";
|
||||
agent: "agent";
|
||||
}>;
|
||||
byName: z.ZodString;
|
||||
at: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
res: z.ZodEnum<{
|
||||
pending: "pending";
|
||||
done: "done";
|
||||
fail: "fail";
|
||||
current: "current";
|
||||
}>;
|
||||
note: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
export declare const getOpsInstanceRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities/:activityId/instances/:instanceId";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
instanceId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
startedAt: z.ZodString;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
no: z.ZodString;
|
||||
activityId: z.ZodString;
|
||||
llm: z.ZodString;
|
||||
endedAt: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
reason: z.ZodNullable<z.ZodObject<{
|
||||
kind: z.ZodEnum<{
|
||||
terminated: "terminated";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
input: z.ZodObject<{
|
||||
content: z.ZodString;
|
||||
source: z.ZodObject<{
|
||||
kind: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
submittedAt: z.ZodString;
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
output: z.ZodObject<{
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
steps: z.ZodArray<z.ZodObject<{
|
||||
seq: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
by: z.ZodEnum<{
|
||||
human: "human";
|
||||
agent: "agent";
|
||||
}>;
|
||||
byName: z.ZodString;
|
||||
at: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
res: z.ZodEnum<{
|
||||
pending: "pending";
|
||||
done: "done";
|
||||
fail: "fail";
|
||||
current: "current";
|
||||
}>;
|
||||
note: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/**
|
||||
* 实例文件:默认 JSON + base64(与 `GET /api/gov/upload/:id` 同形);`?raw=1` 直出字节
|
||||
* (RFC 5987 文件名),配 `?ticket=` 给 `<a href download>` 用。
|
||||
*/
|
||||
export declare const opsInstanceFileRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/activities/:activityId/instances/:instanceId/files/:io/:index";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
instanceId: z.ZodString;
|
||||
io: z.ZodEnum<{
|
||||
output: "output";
|
||||
input: "input";
|
||||
}>;
|
||||
index: z.ZodCoercedNumber<unknown>;
|
||||
}, z.core.$strip>;
|
||||
readonly query: z.ZodObject<{
|
||||
raw: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
dataBase64: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/** 任何时刻都可禁用:只拦新启动,在途实例继续跑完;已禁用再禁用 = 幂等 200 */
|
||||
export declare const disableOpsActivityRoute: {
|
||||
readonly method: "POST";
|
||||
readonly path: "/api/gov/activities/:activityId/disable";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
id: z.ZodString;
|
||||
version: z.ZodString;
|
||||
status: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
createdAt: z.ZodString;
|
||||
biz: z.ZodString;
|
||||
owner: z.ZodNullable<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
llm: z.ZodString;
|
||||
ico: z.ZodOptional<z.ZodString>;
|
||||
hue: z.ZodOptional<z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>>;
|
||||
desc: z.ZodString;
|
||||
view: z.ZodNullable<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
export declare const activateOpsActivityRoute: {
|
||||
readonly method: "POST";
|
||||
readonly path: "/api/gov/activities/:activityId/activate";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
id: z.ZodString;
|
||||
version: z.ZodString;
|
||||
status: z.ZodEnum<{
|
||||
active: "active";
|
||||
disabled: "disabled";
|
||||
}>;
|
||||
createdAt: z.ZodString;
|
||||
biz: z.ZodString;
|
||||
owner: z.ZodNullable<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
llm: z.ZodString;
|
||||
ico: z.ZodOptional<z.ZodString>;
|
||||
hue: z.ZodOptional<z.ZodEnum<{
|
||||
blue: "blue";
|
||||
teal: "teal";
|
||||
amber: "amber";
|
||||
violet: "violet";
|
||||
}>>;
|
||||
desc: z.ZodString;
|
||||
view: z.ZodNullable<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/** body 空;→ `state='failed'` + `reason.kind='terminated'`;412 实例已终态 */
|
||||
export declare const terminateOpsInstanceRoute: {
|
||||
readonly method: "POST";
|
||||
readonly path: "/api/gov/activities/:activityId/instances/:instanceId/terminate";
|
||||
readonly access: "ops";
|
||||
readonly params: z.ZodObject<{
|
||||
activityId: z.ZodString;
|
||||
instanceId: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
state: z.ZodEnum<{
|
||||
running: "running";
|
||||
completed: "completed";
|
||||
pending: "pending";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
startedAt: z.ZodString;
|
||||
owner: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
name: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
no: z.ZodString;
|
||||
activityId: z.ZodString;
|
||||
llm: z.ZodString;
|
||||
endedAt: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
reason: z.ZodNullable<z.ZodObject<{
|
||||
kind: z.ZodEnum<{
|
||||
terminated: "terminated";
|
||||
failed: "failed";
|
||||
rejected: "rejected";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
input: z.ZodObject<{
|
||||
content: z.ZodString;
|
||||
source: z.ZodObject<{
|
||||
kind: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
submittedAt: z.ZodString;
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
output: z.ZodObject<{
|
||||
files: z.ZodArray<z.ZodObject<{
|
||||
index: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
contentType: z.ZodString;
|
||||
size: z.ZodNumber;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
steps: z.ZodArray<z.ZodObject<{
|
||||
seq: z.ZodNumber;
|
||||
name: z.ZodString;
|
||||
by: z.ZodEnum<{
|
||||
human: "human";
|
||||
agent: "agent";
|
||||
}>;
|
||||
byName: z.ZodString;
|
||||
at: z.ZodNullable<z.ZodString>;
|
||||
durationMs: z.ZodNullable<z.ZodNumber>;
|
||||
res: z.ZodEnum<{
|
||||
pending: "pending";
|
||||
done: "done";
|
||||
fail: "fail";
|
||||
current: "current";
|
||||
}>;
|
||||
note: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/** 全部 11 条 —— 文档总表与覆盖测试按它数 */
|
||||
export declare const ACTIVITY_OPS_ROUTES: readonly RouteContract[];
|
||||
Reference in New Issue
Block a user