forked from ChaiHao/BPOS-MVP
人手改的那一手真正落得下去;界面不撒谎那几处补齐
手改是**兜 AI 的错**的那一手 —— 这一轮把它从「摆在那儿但落不了地」做成真的: 件上就地改 · 保存**按地址收**,不看当下那张卡:载荷从前借道工单的 `blocks[i]` 取列名, 于是熔断卡(没有 blocks)在屏上时,人补的那一格一个字都送不出去 —— 而他要补的恰恰是把这一单卡住的那个必填格。授权面改由活动清单的台账声明把关。 · **能增删行**:错不止「这一格填错了」,还有「这一行不该在」与「漏了一行」。 删挂记号不当场抹掉(看得见、可后悔),且**删要说出来**(`drops`)—— 「没回传就是删了」会把一次不完整的回传变成一次删表。 · **必填没填按不下提交**:与放行门 L1 同一个数同一套算法;闸上摆出差在哪一行哪一格。 · 只写真改了的那几行 —— 改一格却留「修订 4 行」的痕,那句话是假的。 判据与门 · 裁量判据带谓词时**谓词说了算**:「选填缺口已补齐」基座数得出来, 人填好的目标价它照样判「客户未提供」的毛病由此消掉。 · 验收卡判据**读时现算** —— 人在成果件上补一格,判据跟着变。 · 放行门认「**办完了没有**」不认「有人写过」:从前写个 `false` 就把门推开, 于是一单没打标就进了放行门。三个数全由基座现数。 · 拒回把「活没干完」说成「数或行对不上」的毛病:判据点名的表一行都没写时直说那一步没办。 **指向两扇打不开的门,比不指还糟。** 界面不撒谎 · 日志只有三色:负责人绿 · 智能体蓝 · 系统灰(归侧五种是度量的分法,不是给人看的)。 · 验收收口答两件事:落了什么(按**交付物**点名,一份成果的几张表并成一行)、 往哪儿去(转出哪一口、带过去哪些字段);一个口都没发就直说到此为止。 · 签完到收尾之间那一段有自己的话「字已签下,正在落地」—— 中间态本来就该说出来,只是要说对。 · 消息不再被内部事件刷屏:只有从通道进来的件才谈得上「无人认领」。 · 建客户公司与联系人**一次确认落两行**;联系人编码自增不问人;卡面摆表的人读名。 A1 三案例端到端全 released:全 A 类直通 12 拍 / 客户点名跳一条 10 拍 / 新客户缺必填 14 拍。 五道门禁全绿(971 passed)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JsTDjoHovERXyy6Wmw1ALp
This commit is contained in:
@@ -6,7 +6,8 @@ export { ActivityNotInstalledError, InstallRejectedError, ToolNotDeclaredError }
|
||||
export type { Clock, IdGenerator, LedgerDeclarationApplier, ModelBindingProbe, RegistryStore, TemplateGuard, ToolContractProbe, } from './port.ts';
|
||||
export type { RegistryServiceDeps } from './internal/usecase/registry-service.ts';
|
||||
export { createRegistryService } from './internal/usecase/registry-service.ts';
|
||||
export { acceptanceLevelFindings, auditPassed, danglingListeners, loopFindings, scanArtifact, staticAudit, } from './internal/domain/static-audit.ts';
|
||||
export type { AcceptanceAuditInput, DeliverableAuditInput } from './internal/domain/static-audit.ts';
|
||||
export { acceptanceLevelFindings, deliverableAddressFindings, ledgerKindFindings, auditPassed, danglingListeners, loopFindings, scanArtifact, staticAudit, } from './internal/domain/static-audit.ts';
|
||||
export { ASSET_KINDS, assertTransition, buildLoadEnvelope, canTransition, IllegalIncrementTransitionError, INCREMENT_STATES, judgeReplay, mayTakeEffect, shouldSeedAsset, } from './internal/domain/versioning.ts';
|
||||
export { createRegistryStore } from './internal/adapter/registry-store.ts';
|
||||
export { activityAssetTable, activityPackageTable, assetIncrementTable } from './internal/adapter/registry-schema.ts';
|
||||
|
||||
+33
-1
@@ -54,6 +54,8 @@ export type IssuedChatCard = {
|
||||
};
|
||||
export type ReplyOutcome = {
|
||||
readonly order: WorkOrder;
|
||||
/** 这张卡挂在哪一单 —— 装配层要拿它把「人就地改的那几行」写回草稿层 */
|
||||
readonly taskId: TaskId;
|
||||
/** 完成只出自放行通过 —— 这里为真,任务才可收敛终态 */
|
||||
readonly producesCompletion: boolean;
|
||||
/** 驳回:环内回转,任务继续 */
|
||||
@@ -78,9 +80,39 @@ export type HumanToolService = {
|
||||
}): Promise<IssuedWorkOrder>;
|
||||
issueChatCard(context: IssueContext, card: ChatCard): Promise<IssuedChatCard>;
|
||||
replyWorkOrder(reply: WorkOrderReply, by: StaffId): Promise<ReplyOutcome>;
|
||||
replyChatCard(reply: ChatCardReply, by: StaffId): Promise<ChatCard>;
|
||||
/**
|
||||
* 回传带上 `taskId` —— **数据录入卡的确认要当场写草稿**,而写库要知道写给哪一单。
|
||||
* 由本模块自己写会让 human-tool 依赖 ledger(越层),所以把事实交出去,由组装层落笔。
|
||||
*/
|
||||
replyChatCard(reply: ChatCardReply, by: StaffId): Promise<{
|
||||
card: ChatCard;
|
||||
taskId: TaskId;
|
||||
}>;
|
||||
/** 驳回重答:新卡实例,原卡闭合 —— 只增不改 */
|
||||
rejectAndReask(cardId: string, reason: string): Promise<IssuedChatCard>;
|
||||
/**
|
||||
* 给已发出的验收工单补上选择组(AM 1.2 恰选一口)。
|
||||
*
|
||||
* 为什么分两步:卡由 `release.submitForRelease` 发 —— 它守的是预检那道门,
|
||||
* 不该也不必知道「这个活动有哪些出口」。出口是契约的事实,由 app 从 manifest 现读后贴上。
|
||||
*/
|
||||
attachPortChoice(workOrderId: string, choice: {
|
||||
group: string;
|
||||
ports: ReadonlyArray<{
|
||||
name: string;
|
||||
label?: string | undefined;
|
||||
}>;
|
||||
}): Promise<void>;
|
||||
/**
|
||||
* **算出来的去向**上卡 —— 不给人选,只告诉他走哪一口、凭哪一条。
|
||||
* 去向是台账那几个数的函数;摆成选择题,等于把可回放的判定换成一次手感。
|
||||
*/
|
||||
attachRoutedPort(workOrderId: string, routed: {
|
||||
group: string;
|
||||
name: string;
|
||||
label?: string | undefined;
|
||||
because: string;
|
||||
}): Promise<void>;
|
||||
openWorkOrders(taskId: TaskId): Promise<WorkOrder[]>;
|
||||
/** 全部工单(含已办结)—— 工作成果要回看定稿的报告,只给 open 就永远是空的 */
|
||||
allWorkOrders(taskId: TaskId): Promise<WorkOrder[]>;
|
||||
|
||||
@@ -17,6 +17,8 @@ export type CardStore = {
|
||||
} | undefined>;
|
||||
listWorkOrders(taskId: TaskId, openOnly: boolean): Promise<WorkOrder[]>;
|
||||
markWorkOrderDone(id: string, done: NonNullable<WorkOrder['done']>): Promise<void>;
|
||||
/** 局部改卡面 —— 只增不改是对**已回传**的卡;未答的卡还可补齐契约事实(如选择组) */
|
||||
patchWorkOrder(id: string, patch: Partial<WorkOrder>): Promise<void>;
|
||||
saveChatCard(taskId: TaskId, card: ChatCard, recipientId: StaffId): Promise<void>;
|
||||
getChatCard(id: string): Promise<{
|
||||
taskId: TaskId;
|
||||
|
||||
+20
-1
@@ -50,17 +50,36 @@ export type InteractionService = {
|
||||
/** 视图流控:活动按局面推结构化块 */
|
||||
pushView(taskId: TaskId, blocks: readonly ViewBlock[]): Promise<void>;
|
||||
/** 视图流控:活动推 HTML 模版 —— 过净化门,不过即抛 */
|
||||
pushViewHtml(taskId: TaskId, html: string): Promise<void>;
|
||||
/**
|
||||
* 推一帧 HTML。`template` **要一起存下来** —— 件是投影,而投影得能按当下数据**重渲**。
|
||||
*
|
||||
* 只存渲染好的 HTML,那一帧就成了快照:人在件上改完几格,由数据算出来的东西
|
||||
* (类徽 A/B/C、分布条、结论横幅那条去向)全停在渲染那一刻 ——
|
||||
* 屏上一半新一半旧,那不是没更新,是界面在撒谎。记住模版名,才重得出来。
|
||||
*/
|
||||
pushViewHtml(taskId: TaskId, html: string, template?: string): Promise<void>;
|
||||
/** 视图区当前呈现什么 —— 只读投影,刷新即重建(前端零过程状态) */
|
||||
viewOf(taskId: TaskId): Promise<{
|
||||
blocks?: readonly ViewBlock[];
|
||||
html?: string;
|
||||
template?: string;
|
||||
} | undefined>;
|
||||
/** 控制权转交 —— 随引擎的激活 / 完成事件自动发生 */
|
||||
setPhase(taskId: TaskId, phase: InteractionPhase): Promise<ControlHolder>;
|
||||
phaseOf(taskId: TaskId): Promise<InteractionPhase>;
|
||||
/** SSE:单连接、按信封目标失效缓存 */
|
||||
subscribe(staffId: StaffId, onPush: (envelope: PushEnvelope) => void): Subscription;
|
||||
/**
|
||||
* **系统级转接**:装配层把所有推送接出去(转给前端的 SSE 广播),不按人筛。
|
||||
*
|
||||
* 为什么不复用 `subscribe`:那个要一个收件人,而转接是系统的事 ——
|
||||
* 为它编一个假员工 id 是撒谎。不按人筛也不漏:推送**不带业务载荷**
|
||||
* (只说「哪个任务动了」),谁该看见由前端自己那几把查询决定(§9.2 前端零过程状态)。
|
||||
*
|
||||
* 没有这个口子的后果实测过:AI 说的每一句、推的每一帧画面都广播给了空气 ——
|
||||
* `subscribe` 一个订阅者都没有,前端只好靠人点刷新。
|
||||
*/
|
||||
onPush(listener: (envelope: PushEnvelope) => void): Subscription;
|
||||
/** 供上层广播失效信号 */
|
||||
invalidate(target: 'task' | 'workflow' | 'desk', id: string): void;
|
||||
};
|
||||
|
||||
@@ -16,10 +16,12 @@ export type InteractionStore = {
|
||||
putView(taskId: TaskId, view: {
|
||||
blocks?: readonly ViewBlock[];
|
||||
html?: string;
|
||||
template?: string;
|
||||
}): Promise<void>;
|
||||
getView(taskId: TaskId): Promise<{
|
||||
blocks?: readonly ViewBlock[];
|
||||
html?: string;
|
||||
template?: string;
|
||||
} | undefined>;
|
||||
setPhase(taskId: TaskId, phase: InteractionPhase): Promise<void>;
|
||||
phaseOf(taskId: TaskId): Promise<InteractionPhase | undefined>;
|
||||
|
||||
@@ -51,6 +51,12 @@ export type DraftWrite = {
|
||||
export type ReleaseWriteResult = {
|
||||
readonly mergedRows: number;
|
||||
readonly emittedEvents: number;
|
||||
/**
|
||||
* **试跑单被挡下的主数据行数** —— 合到出参里去,是因为界面不撒谎:
|
||||
* 放行痕上写「合并 N 行」而其中几行根本没进表,那句话就是假的。
|
||||
* 非试跑单恒为 0。
|
||||
*/
|
||||
readonly simulatedRows: number;
|
||||
/**
|
||||
* 合并进正式版的那些行(键 + 值)。
|
||||
* 「落地收敛,输出口才发射」——发射的载荷就该是**这些已落地的事实**,
|
||||
@@ -78,6 +84,22 @@ export type LedgerService = {
|
||||
}>>;
|
||||
systemWrite(write: SystemWrite): Promise<void>;
|
||||
draftWrite(write: DraftWrite): Promise<void>;
|
||||
/**
|
||||
* **撤掉本单草稿层的一行** —— 写错了得有退路(2026-08-01 加)。
|
||||
*
|
||||
* 不是第四种写:它只作用在**本单草稿层**,正式版一个字都动不了,也不抛事件 ——
|
||||
* 撤的是「我这一单还没过门的那一笔」。放行门的位置没变。
|
||||
*
|
||||
* 没有它的后果实测过:客户说本轮跳过的那颗料被写进了有效清单,条目数报 9 而表里躺着 10,
|
||||
* 判据 `record_rows = line_total` 正确地拦住,而模型**改不动** ——
|
||||
* 它唯一能改的是那个数(改了 skipped_total 又不对),13 次拒回、23 拍、234k token 才熔断。
|
||||
* 门拦住一件办错的事却不给改正的手段,那扇门就只是个死胡同。
|
||||
*/
|
||||
draftDrop(drop: {
|
||||
taskId: TaskId;
|
||||
address: ObjectAddress;
|
||||
key: Record<string, unknown>;
|
||||
}): Promise<boolean>;
|
||||
releaseWrite(taskId: TaskId): Promise<ReleaseWriteResult>;
|
||||
/** 正式版查询 —— 跨任务只见过门的事实 */
|
||||
query(query: LedgerQuery): Promise<LedgerPage>;
|
||||
|
||||
+32
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* module: ledger —— 本模块要外界提供的能力(编码规范 §10.1 / §5.3)。
|
||||
*/
|
||||
import type { EnvelopeDraft, LedgerKey, LedgerQuery, LedgerRow } from '@contracts';
|
||||
import type { EnvelopeDraft, LedgerKey, LedgerQuery, LedgerRow, LedgerObjectKind } from '@contracts';
|
||||
import type { MaterializedObject, SchemaChange } from './internal/domain/schema-merge.ts';
|
||||
import type { DraftEntry } from './internal/domain/task-view.ts';
|
||||
export type Clock = {
|
||||
@@ -14,6 +14,20 @@ export type IdGenerator = {
|
||||
export type EventPublisher = {
|
||||
publish(envelope: EnvelopeDraft): Promise<void>;
|
||||
};
|
||||
/**
|
||||
* 这一单是不是**试跑** —— app 注入(设计台的两条试跑路径都算,见 `container.ts`)。
|
||||
*
|
||||
* 台账在 L1,认不出「谁起的单」;而放行写要不要落主数据,取决的恰恰是这件事。
|
||||
* 所以由 app 把这一个布尔判断喂进来 —— 与 `EventPublisher` 同一个套路:
|
||||
* 模块只声明「我需要知道什么」,不声明「去哪儿问」。
|
||||
*
|
||||
* 为什么只挡主数据、不挡单据:单据按单标识分行,一次试跑写一行自己的,
|
||||
* 清运行数据就没了;主数据是**按业务实体**分行的档案,试跑往里建一位客户,
|
||||
* 「新客户」那条样例就此再也试不出来 —— 它成了老客户。
|
||||
*/
|
||||
export type SimulationProbe = {
|
||||
isSimulated(taskId: string): Promise<boolean>;
|
||||
};
|
||||
export type ObjectRef = {
|
||||
readonly domain: string;
|
||||
readonly object: string;
|
||||
@@ -26,9 +40,18 @@ export type LedgerStore = {
|
||||
/** 已物化对象的列与主键;未物化返回 undefined */
|
||||
describe(ref: ObjectRef): Promise<MaterializedObject | undefined>;
|
||||
/** 出参带人读名(表注释);没登记就没有 label,呈现退回对象键 */
|
||||
/** 记下对象性质(单据/主数据/派生)与单标识 —— 随声明走,不随建表走 */
|
||||
setObjectMeta(ref: ObjectRef, kind: LedgerObjectKind, caseKey: string | undefined): Promise<void>;
|
||||
listObjects(): Promise<Array<ObjectRef & {
|
||||
label?: string | undefined;
|
||||
}>>;
|
||||
/**
|
||||
* 哪些对象是**主数据** —— 放行写要据此把试跑单的主数据挡在正式表外。
|
||||
*
|
||||
* 单独一个方法而不是让调用方 `listObjects` 自己筛:性质记在 `__object_meta` 里,
|
||||
* 一次 where 就够;`describe` 读的是 information_schema,那里没有性质这一维。
|
||||
*/
|
||||
masterRefs(): Promise<ReadonlyArray<ObjectRef>>;
|
||||
/** 执行「只增不破坏」的变更计划 */
|
||||
applyChanges(ref: ObjectRef, changes: readonly SchemaChange[]): Promise<void>;
|
||||
select(query: LedgerQuery): Promise<{
|
||||
@@ -46,5 +69,13 @@ export type DraftStore = {
|
||||
list(taskId: string): Promise<Array<DraftEntry & ObjectRef>>;
|
||||
listForObject(taskId: string, ref: ObjectRef): Promise<DraftEntry[]>;
|
||||
put(taskId: string, ref: ObjectRef, entry: DraftEntry): Promise<void>;
|
||||
/**
|
||||
* 撤掉本单草稿层的**一行** —— 写错了得有退路(2026-08-01 加)。
|
||||
*
|
||||
* 只动 `taskId` 那一份,正式版碰不到。没有它的后果实测过:客户说本轮跳过的那颗料
|
||||
* 被写进了有效清单,条目数报 9 而表里躺着 10 —— 判据正确地拦住,而模型改不动
|
||||
* (唯一能改的是那个数,改了别的判据又不对),13 次拒回、23 拍、234k token 才熔断。
|
||||
*/
|
||||
drop(taskId: string, ref: ObjectRef, key: LedgerKey): Promise<void>;
|
||||
clear(taskId: string): Promise<void>;
|
||||
};
|
||||
|
||||
@@ -31,6 +31,12 @@ export type ModelCall = {
|
||||
readonly prompt: string;
|
||||
readonly temperature?: number;
|
||||
readonly maxOutputTokens?: number;
|
||||
/**
|
||||
* 压推理:`off` 不许想、`low` 少想;缺省由着模型。
|
||||
* 只对画像里声明了 `reasoningControl` 的厂家生效 —— 没姿势的厂家如实忽略。
|
||||
* 规划型调用(loop 单拍)该关:隐藏思考按秒计,而它的判断本就交给了判定表与工具。
|
||||
*/
|
||||
readonly reasoning?: 'off' | 'low';
|
||||
/** 出参 schema(JSON Schema);给定即要求结构化出参并校验 */
|
||||
readonly outputSchema?: Record<string, unknown>;
|
||||
/** 录制/回放的定位:任务 × 步序号(§7.3) */
|
||||
|
||||
+229
-2
@@ -8,7 +8,8 @@ import type { LoopModel, TaskId } from '@contracts';
|
||||
import type { CaseModel, PlanItem, PlanItemType } from './internal/domain/cmmn-parse.ts';
|
||||
import type { CaseRuntime, CaseState, EnabledEntry, EnabledSet, ItemRuntime, ItemState, Navigation, TerminalAuthority } from './internal/domain/lifecycle.ts';
|
||||
import type { DecisionResult, DecisionTrace, Gap } from './internal/domain/dmn.ts';
|
||||
export type { CaseModel, CaseRuntime, CaseState, DecisionResult, DecisionTrace, EnabledEntry, EnabledSet, Gap, ItemRuntime, ItemState, LoopModel, Navigation, PlanItem, PlanItemType, TerminalAuthority, };
|
||||
import type { PhaseProgress } from './internal/domain/phase.ts';
|
||||
export type { CaseModel, CaseRuntime, CaseState, DecisionResult, DecisionTrace, EnabledEntry, EnabledSet, Gap, ItemRuntime, ItemState, LoopModel, Navigation, PhaseProgress, PlanItem, PlanItemType, TerminalAuthority, };
|
||||
export { CmmnParseError } from './internal/domain/cmmn-parse.ts';
|
||||
export { IllegalTransitionError } from './internal/domain/lifecycle.ts';
|
||||
export declare class ForbiddenTerminalError extends Error {
|
||||
@@ -28,6 +29,48 @@ export type AgentAction =
|
||||
readonly tool: string;
|
||||
readonly input: Record<string, unknown>;
|
||||
}
|
||||
/**
|
||||
* 写台账草稿 —— **活动过程写的唯一形态**(铁律②:登记那一刻世界上什么都没变)。
|
||||
*
|
||||
* 一拍可写多行:逐条把一份 BOM 解析成几十行,是**一件事**,不该拆成几十拍
|
||||
* 各烧一次模型。地址必须在活动清单声明过的台账对象之内(越域写与越权调工具同罪)。
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'write';
|
||||
readonly itemId: string;
|
||||
/**
|
||||
* 台账地址「域.对象」—— **一个字符串,不是两个字段**。
|
||||
*
|
||||
* 系统上下都用这一种写法(可写台账字典、`requiredDeliverables[].ledger` 都是它),
|
||||
* 拆成 domain + object 只会让模型把整个地址塞进其中一格 —— 实测第一拍就这么错。
|
||||
*/
|
||||
readonly address: string;
|
||||
readonly rows: ReadonlyArray<{
|
||||
readonly key: Record<string, string | number>;
|
||||
readonly patch: Record<string, unknown>;
|
||||
}>;
|
||||
}
|
||||
/**
|
||||
* **撤掉自己写错的那一行** —— 写错了得有退路(2026-08-01 加)。
|
||||
*
|
||||
* 只作用在**本单草稿层**:正式版一个字都动不了,也不抛事件 ——
|
||||
* 撤的是「我这一单还没过门的那一笔」,放行门的位置没变。
|
||||
*
|
||||
* 起因是实测的一次死胡同:客户明说本轮跳过的那颗料被写进了有效清单,
|
||||
* 条目数报 9(对)而表里躺着 10,判据 `record_rows = line_total` 正确地拦住 ——
|
||||
* 而模型**改不动**:它唯一能改的是那个数,改了 `skipped_total` 又不对。
|
||||
* 13 次拒回、23 拍、234k token 才熔断。**门拦住一件办错的事却不给改正的手段,
|
||||
* 那扇门就只是个死胡同。**
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'drop';
|
||||
readonly itemId: string;
|
||||
/** 台账地址「域.对象」—— 与 write 同一种写法 */
|
||||
readonly address: string;
|
||||
/** 要撤的那几行的主键 —— 认不出的行如实回「草稿层里没有这一行」 */
|
||||
readonly keys: ReadonlyArray<Record<string, string | number>>;
|
||||
readonly reason: string;
|
||||
}
|
||||
/** 调人:四卡之一 —— 调人 = 立监听听人 */
|
||||
| {
|
||||
readonly kind: 'human';
|
||||
@@ -35,6 +78,119 @@ export type AgentAction =
|
||||
readonly card: Record<string, unknown>;
|
||||
readonly workOrder: 'execution' | 'acceptance';
|
||||
}
|
||||
/**
|
||||
* **发补全卡** —— 对话卡族之一,与执行工单是两种东西。
|
||||
*
|
||||
* 「按缺口清单追问补全」(A1-S2)要的就是它:缺口清单摆在对话区、带一张表单,
|
||||
* 人就地填齐。而执行工单是「派一件活给你办」—— 派一张工单去问几个字段,
|
||||
* 收卡的人得进待处理、办完再回来,重得不成比例。
|
||||
*
|
||||
* 从前 Agent **发不出对话卡**:行动型里只有 `human` 且只能选执行 / 验收两种工单,
|
||||
* 于是 SOP 上画着「补全卡」的那一步只能拿执行工单顶 —— 形似而神非。
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'ask';
|
||||
readonly itemId: string;
|
||||
/** 问什么 —— 一句话说清缺口 */
|
||||
readonly ask: string;
|
||||
/**
|
||||
* 要对方填的格子。`hint` 是格子里的灰字提示;
|
||||
* **`value` 是预填值** —— AI 从来件里读得出的先替人填上(公司名、联系人姓名),
|
||||
* 人只需核对一眼、补上填不出的那个,而不是对着一排空格从头敲。
|
||||
* 读不出来的就别给:填错了人还得先擦掉再写,比空着更费事。
|
||||
*/
|
||||
readonly fields: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly label: string;
|
||||
readonly hint?: string;
|
||||
readonly value?: string;
|
||||
}>;
|
||||
/** 依据快照:哪几条缺哪几个字段 —— 调用必附上下文,裸调用拒发 */
|
||||
readonly basis?: ReadonlyArray<{
|
||||
readonly k: string;
|
||||
readonly v: string;
|
||||
}>;
|
||||
}
|
||||
/**
|
||||
* 发**数据录入卡** —— 人类工具的第五类:**人按下确认那一刻就是写入**。
|
||||
*
|
||||
* 与补全卡(`ask`)的分工:那张收的是「答案」,你拿到之后还要自己 `write` 一遍;
|
||||
* 这张收的是「这一行数据」—— 卡上写明落哪张表、哪个主键,人确认,基座当场落草稿层,
|
||||
* **你不经手**。建档这类事该用它:主数据建错一次,后面每一单都跟着错,
|
||||
* 那一笔该由人亲手落下,不该经你转述一遍。
|
||||
*
|
||||
* 你的活是**把能填的先填好**(`value`),填不出的留空 —— 界面会标「待填写」。
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'entry';
|
||||
readonly itemId: string;
|
||||
readonly ask: string;
|
||||
/** 落哪张表:`域.对象` */
|
||||
readonly ledger: string;
|
||||
/** 主键值 —— 确认时按它定位那一行 */
|
||||
readonly key: Readonly<Record<string, string>>;
|
||||
readonly fields: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly label: string;
|
||||
readonly value?: string;
|
||||
readonly required?: boolean;
|
||||
}>;
|
||||
/**
|
||||
* **同一次确认还要落的另几张表**(2026-08-02)。
|
||||
*
|
||||
* 建一位新客户落的是**两条主数据**:公司档 + 联系人档。只把公司那一半摆上卡、
|
||||
* 联系人由你自己写,等于让人确认了一半 —— 而联系人档的 `contact_code`
|
||||
* 恰恰是你编出来的那一个。分成两张卡也能办,但那是把一件事拆成两次打断。
|
||||
*/
|
||||
readonly also?: ReadonlyArray<{
|
||||
/** 这一段是什么 —— 卡上那行小标题(如「联系人档案」) */
|
||||
readonly title: string;
|
||||
readonly ledger: string;
|
||||
readonly key: Readonly<Record<string, string>>;
|
||||
readonly fields: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly label: string;
|
||||
readonly value?: string;
|
||||
readonly required?: boolean;
|
||||
}>;
|
||||
}>;
|
||||
readonly basis?: ReadonlyArray<{
|
||||
readonly k: string;
|
||||
readonly v: string;
|
||||
}>;
|
||||
}
|
||||
/**
|
||||
* 发**决策卡** —— 对话卡族的第二种:把一个岔路口摆给人,人点一个选项。
|
||||
*
|
||||
* 与补全卡的分工:补全卡问的是**事实**(缺哪几个字段,你填);
|
||||
* 决策卡问的是**处置**(这一步该往哪走,你选)。A1 的
|
||||
* 「字段没齐 —— 要我系统外去问客户,还是替你草拟一封邮件」正是后者:
|
||||
* 两条路都合法,选哪条是业务判断,不该由模型替人决定。
|
||||
*
|
||||
* 从前决策卡**只有 UI 没有 Agent 侧**:卡面在对话区画得出来,而行动型里发不出它 ——
|
||||
* 于是所有岔路口都被写成补全卡,人拿到的是一张要自己敲字的表单,而不是两个可点的选项。
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'decide';
|
||||
readonly itemId: string;
|
||||
/** 问什么 —— 一句话说清这是个什么岔路 */
|
||||
readonly ask: string;
|
||||
/** 选项:一条路一项。`consequence` 写清选了它会发生什么 */
|
||||
readonly options: ReadonlyArray<{
|
||||
readonly value: string;
|
||||
readonly label: string;
|
||||
readonly detail?: string;
|
||||
readonly consequence?: string;
|
||||
readonly recommended?: boolean;
|
||||
}>;
|
||||
/** 依据快照:凭什么问这一问 —— 调用必附上下文,裸调用拒发 */
|
||||
readonly basis?: ReadonlyArray<{
|
||||
readonly k: string;
|
||||
readonly v: string;
|
||||
}>;
|
||||
/** 允许人给出选项之外的处置(附理由) */
|
||||
readonly allowCustom?: boolean;
|
||||
}
|
||||
/** 立监听:AI 不能调用世界,对世界只有两种合法姿势 —— 触达它(动作)与等它(监听) */
|
||||
| {
|
||||
readonly kind: 'listen';
|
||||
@@ -66,10 +222,38 @@ export type AgentAction =
|
||||
readonly satisfied: boolean;
|
||||
readonly rationale: string;
|
||||
}
|
||||
/** 判定成果已齐,提交放行 */
|
||||
/**
|
||||
* 这一项干完了 —— **完成由 Agent 自己宣告,不是某个动作的副作用**。
|
||||
*
|
||||
* 从前 `tool` / `write` 一做完就把计划项收了。可一个计划项常常要好几个动作才交得出成果
|
||||
* (先逐条写记录、再结算总数;先调工具取判据、再把判据写进台账)——
|
||||
* 一收就再也动不了它,于是那一项该产出的东西永远缺着,而环在原地打转。
|
||||
* 实测:20 拍烧掉 120k token,卡在「当下可为 ∩ 目标所需 = 空」。
|
||||
*
|
||||
* 宣告完成不等于成果被认可:终局仍唯放行,人验收才算数。
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'finish';
|
||||
readonly itemId: string;
|
||||
readonly rationale: string;
|
||||
}
|
||||
/**
|
||||
* 判定成果已齐,提交放行。
|
||||
*
|
||||
* `fields` = 验收报告上**让人当场改**的那几个值(PRD:「AI 已填好、可编辑」)——
|
||||
* `ai` 是活动拟的值,`ledger` 是改完落回哪个台账地址(`域.对象`)。
|
||||
* 不给 `fields`,验收报告就只能看不能改;给了 `ai` 不给 `ledger`,人改了也只留在
|
||||
* 工单留痕里,落地用的还是活动的原值 —— 两样都得有,修订才落得下去。
|
||||
*/
|
||||
| {
|
||||
readonly kind: 'submit';
|
||||
readonly rationale: string;
|
||||
readonly fields?: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly label: string;
|
||||
readonly ai?: string;
|
||||
readonly ledger?: string;
|
||||
}>;
|
||||
}
|
||||
/**
|
||||
* 本回合**已在工具循环里调过人**:卡已发、监听已立(工具总线执行的)。
|
||||
@@ -81,6 +265,41 @@ export type AgentAction =
|
||||
readonly cardId: string;
|
||||
readonly rationale: string;
|
||||
};
|
||||
/**
|
||||
* **对人说的一句话** —— 交代进展,并可顺手换一张局面画面。
|
||||
*
|
||||
* 它**不是一型行动,是每一拍的附带** —— 这一点是改过的:一开始把它做成独立行动,
|
||||
* 结果它占一整拍又不推进局面,预算下的 Agent 理所当然跳过它,对话区照旧空白。
|
||||
* 让说话与干活抢拍,是把「必须说」设计成了「有空才说」。
|
||||
*
|
||||
* 现在:一拍 = 一个行动 + 一句交代。说话不花额外的拍,也就没有不说的理由。
|
||||
* `view` 是可选的局面模版名 —— 局面变了,人既要听到一句为什么,也要看到新画面。
|
||||
*/
|
||||
export type Narration = {
|
||||
readonly text: string;
|
||||
/** 语气签:指导 / 判据 / 结论 —— 前端各有其样式 */
|
||||
readonly tag?: 'guidance' | 'criterion' | 'conclusion';
|
||||
readonly view?: string;
|
||||
};
|
||||
/**
|
||||
* 一拍的产出:**一串行动**(按序执行)+ 对人交代一句。
|
||||
*
|
||||
* 为什么是一串不是一件:一拍只许一个行动时,每个 write、每个 finish、每个 start
|
||||
* 都单烧一次完整模型调用(说明书 + 轨迹整段重读)。实测 A1 六步的活恰好花 21 拍 ——
|
||||
* 其中 19 拍是这个约束下的**最短路径**,浪费不在模型跑偏,在架构按拍计费。
|
||||
* 收成一串后,「写记录、写结算、finish、start 下一项」一口气给,一单 5-8 拍收得了口。
|
||||
*
|
||||
* 执行纪律(引擎强制,不靠模型自觉):
|
||||
* · 按序执行,谁被拒就停在谁那儿 —— 已执行的前缀落笔留痕,理由喂回下一拍;
|
||||
* · `tool` 之后截断 —— 出参没看见,后面的行动是闭着眼计划的;
|
||||
* · `ask` / `decide` / `human` / `listen` / `submit` 让本拍挂起 —— 只能是最后一个;
|
||||
* · 一串封顶 `TURN_ACTION_CAP` 件,超出的直接丢弃(留痕)。
|
||||
*/
|
||||
export declare const TURN_ACTION_CAP = 6;
|
||||
export type AgentTurn = {
|
||||
readonly actions: readonly AgentAction[];
|
||||
readonly say?: Narration;
|
||||
};
|
||||
export type TurnOutcome = {
|
||||
readonly runtime: CaseRuntime;
|
||||
readonly enabled: EnabledSet;
|
||||
@@ -96,6 +315,14 @@ export type LoopEngineService = {
|
||||
/** 装载:XML 进语义引擎,说明书进 Agent 上下文;版本全部入信封 */
|
||||
load(taskId: TaskId, model: LoopModel): Promise<CaseRuntime>;
|
||||
runtime(taskId: TaskId): Promise<CaseRuntime | undefined>;
|
||||
/**
|
||||
* 进度刻度:这一单在第几阶段(见 `internal/domain/phase.ts`)。
|
||||
*
|
||||
* 由 loop 出而不是让调用方自己算:阶段声明与计划项状态**同在一行运行时里**,
|
||||
* 调用方要自己算就得先把模型和运行时都捞出来 —— 那是把内部结构摊给外面。
|
||||
* 活动没声明阶段就回 `undefined`:界面照此不画进度条,不编一个出来。
|
||||
*/
|
||||
phaseOf(taskId: TaskId, terminal: boolean): Promise<PhaseProgress | undefined>;
|
||||
/** 发布 Enabled 集与红绿灯 —— 引擎推进的终点 */
|
||||
publish(taskId: TaskId): Promise<EnabledSet>;
|
||||
/** 跑一个回合:定位 → 择向 → 决断 → 行动 → 写数据 */
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* module: loop-engine —— 唯一出口。只做 re-export,不写逻辑(编码规范 §10.1)。
|
||||
*/
|
||||
export type { AgentAction, CaseModel, CaseRuntime, CaseState, DecisionResult, DecisionTrace, EnabledEntry, EnabledSet, Gap, ItemRuntime, ItemState, LoopEngineService, LoopModel, Navigation, PlanItem, PlanItemType, TerminalAuthority, TurnOutcome, } from './contract.ts';
|
||||
export { AutomaticOnWorldTouchingError, CmmnParseError, ForbiddenTerminalError, IllegalTransitionError, } from './contract.ts';
|
||||
export type { AgentAction, AgentTurn, Narration, CaseModel, CaseRuntime, CaseState, DecisionResult, DecisionTrace, EnabledEntry, EnabledSet, Gap, ItemRuntime, ItemState, LoopEngineService, LoopModel, Navigation, PlanItem, PlanItemType, TerminalAuthority, TurnOutcome, } from './contract.ts';
|
||||
export { AutomaticOnWorldTouchingError, CmmnParseError, ForbiddenTerminalError, IllegalTransitionError, TURN_ACTION_CAP, } from './contract.ts';
|
||||
export type { AgentPort, CardGateway, Clock, ListenerRegistrar, LoopStateStore, MemoryRecorder, Sfeel, TaskContext, TaskDataGateway, ToolGateway, } from './port.ts';
|
||||
export type { TurnRunnerDeps } from './internal/usecase/turn-runner.ts';
|
||||
export { createTurnRunner } from './internal/usecase/turn-runner.ts';
|
||||
export { parseCmmn, parseXml, PLAN_ITEM_TYPES } from './internal/domain/cmmn-parse.ts';
|
||||
export { assertItemTransition, autoCompleteReady, canTransitionCase, canTransitionItem, CASE_STATES, evaluateCriterion, initialRuntime, ITEM_STATES, mayCompleteCase, mayTerminateCase, navigate, occur, publishEnabled, reenter, transitionItem, } from './internal/domain/lifecycle.ts';
|
||||
export { assertItemTransition, achieveMilestones, autoCompleteReady, canTransitionCase, canTransitionItem, criterionKey, readingsOf, CASE_STATES, evaluateCriterion, initialRuntime, ITEM_STATES, mayCompleteCase, mayTerminateCase, navigate, occur, publishEnabled, reenter, transitionItem, } from './internal/domain/lifecycle.ts';
|
||||
export { deduceGaps, evaluateTable, evaluationOrder, isBindingConclusion } from './internal/domain/dmn.ts';
|
||||
export { createLoopStateStore } from './internal/adapter/loop-state-store.ts';
|
||||
export { loopStateTable } from './internal/adapter/loop-state-schema.ts';
|
||||
|
||||
+200
-7
@@ -4,7 +4,7 @@
|
||||
import type { LoopModel, StaffId, TaskId } from '@contracts';
|
||||
import type { CaseModel } from './internal/domain/cmmn-parse.ts';
|
||||
import type { CaseRuntime, EnabledSet } from './internal/domain/lifecycle.ts';
|
||||
import type { AgentAction } from './contract.ts';
|
||||
import type { AgentTurn } from './contract.ts';
|
||||
export type Clock = {
|
||||
now(): Date;
|
||||
};
|
||||
@@ -27,13 +27,53 @@ export type Sfeel = {
|
||||
/** 任务数据 —— app 注入 `ledger`(L1):引擎对**任务视图**求值,不依赖事件 */
|
||||
export type TaskDataGateway = {
|
||||
view(taskId: TaskId): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* 本活动**声明过**的台账对象(域.对象 → 列名与中文标)。
|
||||
*
|
||||
* 两用:喂给 Agent(不知道能写哪儿就只会瞎猜列名),以及校验 `write` 行动 ——
|
||||
* 没声明过的地址一律拒写。越域写与越权调工具同罪,都得在结构上拦住。
|
||||
*/
|
||||
writable(taskId: TaskId): Promise<Array<{
|
||||
domain: string;
|
||||
object: string;
|
||||
label: string;
|
||||
keys: string[];
|
||||
fields: Array<{
|
||||
name: string;
|
||||
label: string;
|
||||
type?: string;
|
||||
}>;
|
||||
}>>;
|
||||
/**
|
||||
* 写草稿,并回报**这一笔到底有没有改变什么**。
|
||||
*
|
||||
* 值和上次一模一样的写是空转。不回报,Agent 就看不出自己在原地打转 ——
|
||||
* 实测:同一行 verdict 被反复重写十几拍,每拍烧一次模型,预算就这么淌完。
|
||||
*/
|
||||
draftWrite(input: {
|
||||
taskId: TaskId;
|
||||
domain: string;
|
||||
object: string;
|
||||
key: Record<string, string | number>;
|
||||
patch: Record<string, unknown>;
|
||||
}): Promise<void>;
|
||||
}): Promise<{
|
||||
changed: boolean;
|
||||
}>;
|
||||
/**
|
||||
* **撤掉本单草稿层的一行** —— 写错了得有退路。
|
||||
*
|
||||
* 回 `false` = 草稿层里根本没有这一行(多半是主键写法对不上,
|
||||
* `DAG…` 与 `DAG…-R0` 是两行)。如实说比静默成功有用:静默成功会让模型
|
||||
* 以为撤掉了,下一拍判据照旧不过,它又去撤一次。
|
||||
*/
|
||||
draftDrop(input: {
|
||||
taskId: TaskId;
|
||||
domain: string;
|
||||
object: string;
|
||||
key: Record<string, string | number>;
|
||||
}): Promise<{
|
||||
dropped: boolean;
|
||||
}>;
|
||||
};
|
||||
/**
|
||||
* Agent 回路 —— app 注入(Mastra Agent 在 adapter,§6.1)。
|
||||
@@ -46,7 +86,32 @@ export type AgentPort = {
|
||||
narrative: string;
|
||||
enabled: EnabledSet;
|
||||
scope: Record<string, unknown>;
|
||||
}): Promise<AgentAction>;
|
||||
/**
|
||||
* 这一单能调什么 —— **声明 × 目录**编译出来的工具清单(`compileToolBus`)。
|
||||
*
|
||||
* 不给它这份清单,它就只知道说明书里提过的工具名,连入参长什么样都得猜 ——
|
||||
* 实测的后果是:该调工具的那一步改成了发一张卡问人(「请为以下三个PN查询历史价格」),
|
||||
* 明明系统里就有这件工具。工具是声明式的,清单得摆在它眼前。
|
||||
*/
|
||||
tools: Array<{
|
||||
id: string;
|
||||
description: string;
|
||||
input: Record<string, unknown>;
|
||||
effect: 'read' | 'write';
|
||||
}>;
|
||||
/** 本活动可写的台账地址与列名 —— 不给它字典,它只会照想象编列名 */
|
||||
writable: Array<{
|
||||
domain: string;
|
||||
object: string;
|
||||
label: string;
|
||||
keys: string[];
|
||||
fields: Array<{
|
||||
name: string;
|
||||
label: string;
|
||||
type?: string;
|
||||
}>;
|
||||
}>;
|
||||
}): Promise<AgentTurn>;
|
||||
};
|
||||
/** 工具 / 人类工具 / 监听 —— 三型行动的落点 */
|
||||
export type ToolGateway = {
|
||||
@@ -61,6 +126,16 @@ export type ToolGateway = {
|
||||
error?: {
|
||||
message: string;
|
||||
};
|
||||
/**
|
||||
* 已转人代办,等人回填(§6.2)——「人是工具的一种实现」。
|
||||
*
|
||||
* 系统里没有这件工具时,不是失败:基座已开了一张执行卡并立了监听。
|
||||
* 这一拍该**挂起等人**,不该把计划项判 Failed —— 判 Failed 等于告诉 Agent
|
||||
* 「这条路走不通,换一条」,可这条路明明正在走,只是走的人换成了人。
|
||||
*/
|
||||
awaitingHuman?: {
|
||||
readonly workOrderId: string;
|
||||
};
|
||||
}>;
|
||||
isWriteEffect(tool: string): Promise<boolean>;
|
||||
registerIntent(input: {
|
||||
@@ -69,6 +144,13 @@ export type ToolGateway = {
|
||||
input: Record<string, unknown>;
|
||||
label: string;
|
||||
}): Promise<void>;
|
||||
/** 这一单能调什么(声明 × 目录)—— 单拍路径与开环路径吃同一份清单 */
|
||||
busOf(activityId: string): Promise<Array<{
|
||||
id: string;
|
||||
description: string;
|
||||
input: Record<string, unknown>;
|
||||
effect: 'read' | 'write';
|
||||
}>>;
|
||||
};
|
||||
/**
|
||||
* 在途验收(提交放行的持久痕):卡发出即记,裁决到达再记 verdict ——
|
||||
@@ -80,6 +162,39 @@ export type PendingAcceptance = {
|
||||
readonly selectedPorts?: Record<string, string>;
|
||||
};
|
||||
export type CardGateway = {
|
||||
/** 数据录入卡 —— 人确认那一下由基座直接写草稿层,不回到 Agent 手里 */
|
||||
entry(input: {
|
||||
taskId: TaskId;
|
||||
ownerId: StaffId;
|
||||
humanCallCap: number;
|
||||
ask: string;
|
||||
ledger: string;
|
||||
key: Readonly<Record<string, string>>;
|
||||
fields: ReadonlyArray<{
|
||||
key: string;
|
||||
label: string;
|
||||
value?: string;
|
||||
required?: boolean;
|
||||
}>;
|
||||
/** 同一次确认还要落的另几张表 —— 建一位新客户 = 公司档 + 联系人档 */
|
||||
also?: ReadonlyArray<{
|
||||
title: string;
|
||||
ledger: string;
|
||||
key: Readonly<Record<string, string>>;
|
||||
fields: ReadonlyArray<{
|
||||
key: string;
|
||||
label: string;
|
||||
value?: string;
|
||||
required?: boolean;
|
||||
}>;
|
||||
}>;
|
||||
basis?: ReadonlyArray<{
|
||||
k: string;
|
||||
v: string;
|
||||
}>;
|
||||
}): Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
issue(input: {
|
||||
taskId: TaskId;
|
||||
ownerId: StaffId;
|
||||
@@ -89,6 +204,56 @@ export type CardGateway = {
|
||||
}): Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
/**
|
||||
* 发**补全卡**(对话卡族)—— 缺口清单摆在对话区、带一张表单,人就地填齐。
|
||||
*
|
||||
* 与执行工单分开是因为它们是两件事:工单是「派一件活给你办」,
|
||||
* 派一张工单去问几个字段,收卡的人得进待处理、办完再回来,重得不成比例。
|
||||
* SOP 上画着「补全卡」的那一步(A1-S2),要的就是这一件。
|
||||
*/
|
||||
ask(input: {
|
||||
taskId: TaskId;
|
||||
ownerId: StaffId;
|
||||
humanCallCap: number;
|
||||
ask: string;
|
||||
fields: ReadonlyArray<{
|
||||
key: string;
|
||||
label: string;
|
||||
hint?: string;
|
||||
}>;
|
||||
basis?: ReadonlyArray<{
|
||||
k: string;
|
||||
v: string;
|
||||
}>;
|
||||
}): Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
/**
|
||||
* 发**决策卡**(对话卡族)—— 岔路口摆给人**点一个**,不是让人敲字。
|
||||
*
|
||||
* 与补全卡的分工:补全卡问事实(缺哪几个字段,你填);决策卡问处置(往哪走,你选)。
|
||||
* 两条路都合法、选哪条是业务判断的时候,该发的是这一件。
|
||||
*/
|
||||
decide(input: {
|
||||
taskId: TaskId;
|
||||
ownerId: StaffId;
|
||||
humanCallCap: number;
|
||||
ask: string;
|
||||
options: ReadonlyArray<{
|
||||
value: string;
|
||||
label: string;
|
||||
detail?: string;
|
||||
consequence?: string;
|
||||
recommended?: boolean;
|
||||
}>;
|
||||
basis?: ReadonlyArray<{
|
||||
k: string;
|
||||
v: string;
|
||||
}>;
|
||||
allowCustom?: boolean;
|
||||
}): Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
export type ListenerRegistrar = {
|
||||
register(input: {
|
||||
@@ -107,12 +272,21 @@ export type ListenerRegistrar = {
|
||||
* 零 LLM 即可成屏;模型只决定「下一步做什么」,不负责画面。
|
||||
*/
|
||||
export type ViewGateway = {
|
||||
/**
|
||||
* 推一帧画面。**回报推没推上** —— 从前是 `Promise<void>` 且模版查不到就静默 return:
|
||||
* 引擎每拍推一个硬编码的 `case-overview`,而 A1 声明的四张模版一个都不叫这个名字,
|
||||
* 于是**每一帧都被悄悄丢掉**,工作区从头到尾空白,日志里也没有一个字。
|
||||
* 静默失败比报错坏得多:它让「没画面」看起来像「活动还没产出」。
|
||||
*/
|
||||
push(input: {
|
||||
taskId: TaskId;
|
||||
activityId: string;
|
||||
template: string;
|
||||
scope: Record<string, unknown>;
|
||||
}): Promise<void>;
|
||||
}): Promise<{
|
||||
pushed: boolean;
|
||||
templates: string[];
|
||||
}>;
|
||||
};
|
||||
/**
|
||||
* 技能 —— app 注入 `skill-engine`(L4)。
|
||||
@@ -134,7 +308,7 @@ export type SkillGateway = {
|
||||
export type MemoryRecorder = {
|
||||
append(input: {
|
||||
taskId: TaskId;
|
||||
kind: 'engine-transition' | 'evaluation' | 'thought' | 'action' | 'result' | 'observation';
|
||||
kind: 'engine-transition' | 'evaluation' | 'thought' | 'action' | 'result' | 'observation' | 'narration';
|
||||
title: string;
|
||||
detail?: Record<string, unknown>;
|
||||
}): Promise<void>;
|
||||
@@ -143,10 +317,19 @@ export type MemoryRecorder = {
|
||||
layer: string;
|
||||
statement: string;
|
||||
}>>;
|
||||
/** 本任务自己的最近轨迹(窗口大小由活动声明的 memoryWindow 定)—— 喂回叙事面,Agent 每拍不失忆 */
|
||||
window(taskId: TaskId): Promise<Array<{
|
||||
/**
|
||||
* 本任务自己的最近轨迹 —— 喂回叙事面,Agent 每拍不失忆。
|
||||
*
|
||||
* 不给 `size` 就用活动声明的 `memoryWindow`(叙事面按它给;窗口越大越贵)。
|
||||
* **熔断检测要另开一个更大的窗**:它数的是「同一堵墙撞了几次」,
|
||||
* 而一次提交被拒会连带写下交代、评估、推画面好几条 —— 20 条的叙事窗里
|
||||
* 至多装得下三四次撞墙,于是撞十次也数不到 5(实测:同一条判据拒回 10 次没熔断,
|
||||
* 另一单拒回 33 次,40 万 token 烧到 exhausted 才停)。
|
||||
*/
|
||||
window(taskId: TaskId, size?: number): Promise<Array<{
|
||||
kind: string;
|
||||
title: string;
|
||||
detail?: Record<string, unknown> | undefined;
|
||||
}>>;
|
||||
};
|
||||
export type TaskContext = {
|
||||
@@ -155,4 +338,14 @@ export type TaskContext = {
|
||||
ownerId: StaffId;
|
||||
humanCallCap: number;
|
||||
}>;
|
||||
/**
|
||||
* 这一单的**机检判据名**(归一化后的 key 与 label 都在里头)。
|
||||
*
|
||||
* 给 `judge` 行动当门用:L1/L2 是拿 S-FEEL 对台账求值的,Agent 裁不动它 ——
|
||||
* 判据投影压根不读 Agent 对机检项的裁定。可从前引擎照收不误,还往轨迹里
|
||||
* 写一句「语义性前提评估:XXX → 满足」:模型于是以为这条已经过了,
|
||||
* 转头就 submit,被门以同一条判据拒回;再裁、再拒,连拒五拍熔断(实测 A2 死于此)。
|
||||
* 轨迹里那句「满足」是**假话** —— 界面不撒谎,对 Agent 也一样。
|
||||
*/
|
||||
machineCriteria(taskId: TaskId): Promise<ReadonlySet<string>>;
|
||||
};
|
||||
|
||||
@@ -28,6 +28,11 @@ export type SubmitForReleaseInput = {
|
||||
readonly criteria: readonly CriterionCheck[];
|
||||
/** 报告可修订:AI 拟值已填的表单字段 */
|
||||
readonly fields?: ReadonlyArray<Record<string, unknown>>;
|
||||
/**
|
||||
* 验收页的正文块 —— 与执行工单同一套件,可含**绑台账的可编辑表**。
|
||||
* 验收是最重的一道门:人得能在成果本身上改,不只是改几个整单级字段。
|
||||
*/
|
||||
readonly blocks?: ReadonlyArray<Record<string, unknown>>;
|
||||
};
|
||||
export type SubmitOutcome = {
|
||||
readonly report: PrecheckReport;
|
||||
|
||||
@@ -23,6 +23,8 @@ export type LedgerGateway = {
|
||||
releaseWrite(taskId: TaskId): Promise<{
|
||||
mergedRows: number;
|
||||
emittedEvents: number;
|
||||
/** 试跑单被挡在正式表外的主数据行数(非试跑恒为 0)—— 放行痕要如实说 */
|
||||
simulatedRows: number;
|
||||
/** 合并进正式版的行 —— 输出口发射的载荷取自这里 */
|
||||
merged: ReadonlyArray<{
|
||||
domain: string;
|
||||
@@ -79,12 +81,27 @@ export type CardGateway = {
|
||||
label: string;
|
||||
level: 'L1' | 'L2' | 'L3' | 'L4' | 'L5';
|
||||
pass: boolean;
|
||||
settled?: boolean | undefined;
|
||||
rationale?: string | undefined;
|
||||
}>;
|
||||
actions: ReadonlyArray<{
|
||||
label: string;
|
||||
effect: 'read' | 'write';
|
||||
detail: string;
|
||||
}>;
|
||||
/**
|
||||
* 可修订字段 —— 验收报告「AI 已填好、可编辑」改的就是它们(带 `ai` 拟值与 `ledger` 落回地址)。
|
||||
* **端口不声明它,值就在装配层被丢掉**:上游一路传下来,而 TypeScript 对条件展开
|
||||
* 不做多余属性检查,于是编译不报、运行时静默丢 —— 卡面 `fields` 恒空(踩过)。
|
||||
*/
|
||||
fields?: ReadonlyArray<Record<string, unknown>>;
|
||||
/**
|
||||
* 验收页的正文块 —— 绑台账的可编辑成果表走这里。
|
||||
* **端口不声明它,值就在装配层被丢掉**(与 `fields` 同一个坑,又踩了一次:
|
||||
* 契约声明了、submit 传了、release 转了,到装配层那个显式对象里被抹平,
|
||||
* 编译不报、运行时静默丢 —— 卡面 blocks 恒空)。
|
||||
*/
|
||||
blocks?: ReadonlyArray<Record<string, unknown>>;
|
||||
}): Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
|
||||
@@ -32,6 +32,8 @@ export type Task = {
|
||||
/** 起单来源:工作流节点;登记触发的直起单为 undefined */
|
||||
readonly workflowId?: string;
|
||||
readonly nodeId?: string;
|
||||
/** `testbed` = 设计台试跑 —— 认得出才拔得掉(仿真不该在别人工作台上过夜) */
|
||||
readonly origin?: string;
|
||||
readonly ownerId: StaffId;
|
||||
readonly title: string;
|
||||
readonly runtime: TaskRuntimeState;
|
||||
@@ -52,6 +54,7 @@ export type StartTaskInput = {
|
||||
readonly title: string;
|
||||
readonly workflowId?: string;
|
||||
readonly nodeId?: string;
|
||||
readonly origin?: string;
|
||||
/** 输入:data(按 schema 校验,缺项不得启动)+ message(委托消息,可为空) */
|
||||
readonly data: Record<string, unknown>;
|
||||
readonly message?: string;
|
||||
|
||||
+29
-2
@@ -26,10 +26,34 @@ export type ActivityLoader = {
|
||||
envelope: Record<string, unknown>;
|
||||
/** 输入 data 的 JSON Schema —— 缺项不得启动 */
|
||||
inputSchema: Record<string, unknown>;
|
||||
/**
|
||||
* 这一单是被一封信叫起来的 —— 活动清单声明的**来件字段映射**。
|
||||
* 声明了,起单那一刻就把来件归进沟通记录(工作台那一屏)。
|
||||
*/
|
||||
inboundComm?: {
|
||||
channel: string;
|
||||
partyField: string;
|
||||
subjectField?: string | undefined;
|
||||
bodyField?: string | undefined;
|
||||
attachmentsField?: string | undefined;
|
||||
};
|
||||
businessModel: unknown;
|
||||
stallAfter: string;
|
||||
}>;
|
||||
};
|
||||
/** 沟通记录 —— 一单往来的原件存档(工作台「沟通记录」那一屏读它) */
|
||||
export type CommRecorder = {
|
||||
record(input: {
|
||||
taskId: TaskId;
|
||||
direction: 'in' | 'out';
|
||||
channel: string;
|
||||
party: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
attachments: readonly unknown[];
|
||||
note: string;
|
||||
}): Promise<void>;
|
||||
};
|
||||
export type SchemaValidator = {
|
||||
validate(schema: Record<string, unknown>, value: unknown): {
|
||||
ok: boolean;
|
||||
@@ -76,8 +100,11 @@ export type LandingGateway = {
|
||||
export type MemoryRecorder = {
|
||||
append(input: {
|
||||
taskId: TaskId;
|
||||
/** control = 治理干预(叫停 / 恢复 / 改派):人对过程的裁断,归人裁决侧 */
|
||||
kind: 'engine-transition' | 'terminal' | 'observation' | 'control';
|
||||
/**
|
||||
* control = 治理干预(叫停 / 恢复 / 改派):人对过程的裁断,归人裁决侧。
|
||||
* trigger = 触发事件:这一单被什么叫起来的 —— 不是机器产出,也不是谁的动作。
|
||||
*/
|
||||
kind: 'engine-transition' | 'terminal' | 'observation' | 'control' | 'trigger';
|
||||
title: string;
|
||||
detail?: Record<string, unknown>;
|
||||
}): Promise<void>;
|
||||
|
||||
+5
-3
@@ -3,15 +3,17 @@
|
||||
*/
|
||||
export type { ActionIntent, AuditFinding, CallDisposition, EffectLevel, EvolutionViolation, InvocationTrace, InvokerMode, Preauthorization, RegisterToolInput, RegistrationVerdict, ToolCall, ToolContract, ToolInvoker, ToolResult, ToolboxService, } from './contract.ts';
|
||||
export { INVOKER_MODES, RegistrationRejectedError, ToolDisabledError, ToolNotAllowedError, ToolNotFoundError, ToolReplayMissError, } from './contract.ts';
|
||||
export type { Clock, IdGenerator, SchemaValidator, SecretBox, ToolRegistry, ToolReplayStore, ToolRuntime, } from './port.ts';
|
||||
export type { Clock, IdGenerator, SchemaValidator, SecretBox, ToolHandoff, ToolHandoffStore, ToolRegistry, ToolReplayStore, ToolRuntime, } from './port.ts';
|
||||
export type { ToolInvokerDeps } from './internal/usecase/tool-invoker.ts';
|
||||
export { createToolInvoker, toolReplayKey } from './internal/usecase/tool-invoker.ts';
|
||||
export type { ToolboxServiceDeps } from './internal/usecase/toolbox-service.ts';
|
||||
export { createToolboxService } from './internal/usecase/toolbox-service.ts';
|
||||
export { checkEvolution, dispositionOf, EFFECT_LEVEL_LABEL, EFFECT_LEVELS } from './internal/domain/tool-contract.ts';
|
||||
export type { BusTool, CatalogEntry, ToolBusInput, ToolBusReport } from './internal/domain/tool-bus.ts';
|
||||
export { compileToolBus, HUMAN_TOOL, LLM_TOOLS } from './internal/domain/tool-bus.ts';
|
||||
export { compileToolBus, HUMAN_TOOL, LEDGER_TOOL, LLM_TOOLS } from './internal/domain/tool-bus.ts';
|
||||
export { auditPassed, staticAudit } from './internal/domain/registration-audit.ts';
|
||||
export type { HandoffField } from './internal/domain/handoff.ts';
|
||||
export { callKeyOf, coerceBySchema, handoffFields } from './internal/domain/handoff.ts';
|
||||
export type { ToolHandler } from './internal/adapter/toolbox-store.ts';
|
||||
export { createSchemaValidator, createToolRegistry, createToolReplayStore, createToolRuntime, isAllowed, } from './internal/adapter/toolbox-store.ts';
|
||||
export { createSchemaValidator, createToolRegistry, createToolReplayStore, createToolHandoffStore, createToolRuntime, isAllowed, } from './internal/adapter/toolbox-store.ts';
|
||||
export { replayToolTable, toolAllowlistTable, toolTable } from './internal/adapter/toolbox-schema.ts';
|
||||
|
||||
@@ -43,6 +43,26 @@ export type ToolReplayStore = {
|
||||
* 工具执行 —— 实现对系统:server 侧执行代码,运行时受限,
|
||||
* **只可访问注册申报的连接目标,无其他环境能力**(OS 7.3)。
|
||||
*/
|
||||
/**
|
||||
* 工具转人台(§6.2)—— 人是工具的一种实现:发出去的卡、答回来的出参都记在这。
|
||||
* 内容地址 `callKey` 保证同一次调用只问人一次。
|
||||
*/
|
||||
export type ToolHandoffStore = {
|
||||
find(taskId: string, callKey: string): Promise<ToolHandoff | undefined>;
|
||||
open(handoff: Omit<ToolHandoff, 'state' | 'output'>): Promise<void>;
|
||||
/** 人答完:值即出参 */
|
||||
answer(workOrderId: string, output: Record<string, unknown>): Promise<ToolHandoff | undefined>;
|
||||
};
|
||||
export type ToolHandoff = {
|
||||
readonly id: string;
|
||||
readonly taskId: string;
|
||||
readonly tool: string;
|
||||
readonly callKey: string;
|
||||
readonly input: Record<string, unknown>;
|
||||
readonly workOrderId: string;
|
||||
readonly state: 'pending' | 'answered';
|
||||
readonly output?: Record<string, unknown> | undefined;
|
||||
};
|
||||
export type ToolRuntime = {
|
||||
execute(input: {
|
||||
readonly contract: ToolContract;
|
||||
|
||||
+2
-2
@@ -10,6 +10,6 @@ export { defineActivity } from './define.ts';
|
||||
export type { ActivityMemoryLayer, ChatCardDraft, FormFieldDraft, LedgerKey, LedgerRow, ViewBlockLike, WorkOrderDraft, } from './types.ts';
|
||||
export type { HostOptions, HostRecording, MockHost } from './host.ts';
|
||||
export { createMockHost } from './host.ts';
|
||||
export type { Tone } from './view.ts';
|
||||
export { kvCard, noteCard, stagesCard, tableCard, viewShell } from './view.ts';
|
||||
export type { ColStyle, FactTone, Stamp, Tone } from './view.ts';
|
||||
export { actionList, bigCount, factCards, letter, meter, noteOnly, ruleTable, section, stagesOnly, statsBand, tableOnly, verdict, viewShell, } from './view.ts';
|
||||
export declare const SDK_VERSION = "0.1.0-m5";
|
||||
|
||||
+343
-4
@@ -116,9 +116,9 @@ export declare const listGrantsRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"governance">;
|
||||
function: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
@@ -155,9 +155,9 @@ export declare const setGrantsRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"governance">;
|
||||
function: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
@@ -187,9 +187,9 @@ export declare const setGrantsRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"governance">;
|
||||
function: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
@@ -508,6 +508,7 @@ export declare const govTaskLogRoute: {
|
||||
id: z.ZodString;
|
||||
at: z.ZodString;
|
||||
sideLabel: z.ZodString;
|
||||
action: z.ZodString;
|
||||
title: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
@@ -1835,12 +1836,20 @@ export declare const installActivityRoute: {
|
||||
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;
|
||||
@@ -1848,6 +1857,7 @@ export declare const installActivityRoute: {
|
||||
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>;
|
||||
@@ -1855,6 +1865,9 @@ export declare const installActivityRoute: {
|
||||
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;
|
||||
@@ -1869,6 +1882,11 @@ export declare const installActivityRoute: {
|
||||
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;
|
||||
@@ -1911,6 +1929,12 @@ export declare const installActivityRoute: {
|
||||
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>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
@@ -1925,6 +1949,10 @@ export declare const installActivityRoute: {
|
||||
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>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>>;
|
||||
listeners: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -2001,6 +2029,20 @@ export declare const installActivityRoute: {
|
||||
}, 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">;
|
||||
@@ -2139,7 +2181,13 @@ export declare const listActivitiesRoute: {
|
||||
name: z.ZodString;
|
||||
type: z.ZodString;
|
||||
required: z.ZodBoolean;
|
||||
label: z.ZodOptional<z.ZodString>;
|
||||
format: z.ZodOptional<z.ZodString>;
|
||||
}, 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>;
|
||||
@@ -2184,6 +2232,12 @@ export declare const listLedgerObjectsRoute: {
|
||||
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>;
|
||||
};
|
||||
@@ -2355,6 +2409,30 @@ export declare const testRunRoute: {
|
||||
}>;
|
||||
}, 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 全部销毁。
|
||||
* 仿真不是生产:试跑留下的东西不该在库里、在别人工作台上过夜。
|
||||
@@ -2362,8 +2440,10 @@ export declare const testRunRoute: {
|
||||
export declare const testStopRoute: {
|
||||
readonly method: "POST";
|
||||
readonly path: "/api/gov/testbed/stop";
|
||||
/** 两种试法各有其拔法:流程包给 workflowId,单活动给 taskId;都不给 = 拔掉所有试跑残留 */
|
||||
readonly body: z.ZodObject<{
|
||||
workflowId: z.ZodString;
|
||||
workflowId: z.ZodDefault<z.ZodString>;
|
||||
taskId: z.ZodDefault<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
destroyed: z.ZodBoolean;
|
||||
@@ -2371,12 +2451,271 @@ export declare const testStopRoute: {
|
||||
}, 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 树(节点 → 步骤 / 工具 / 模型 / 人卡) */
|
||||
|
||||
+758
-2
File diff suppressed because it is too large
Load Diff
+614
@@ -70,6 +70,7 @@ export declare const formFieldSchema: z.ZodObject<{
|
||||
group: z.ZodOptional<z.ZodString>;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
ai: z.ZodOptional<z.ZodString>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
||||
@@ -144,6 +145,8 @@ export declare const viewBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
||||
linkDonut: z.ZodOptional<z.ZodObject<{
|
||||
col: z.ZodNumber;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
@@ -379,6 +382,8 @@ export declare const deliverableSchema: z.ZodObject<{
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
||||
linkDonut: z.ZodOptional<z.ZodObject<{
|
||||
col: z.ZodNumber;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
@@ -641,6 +646,8 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
||||
linkDonut: z.ZodOptional<z.ZodObject<{
|
||||
col: z.ZodNumber;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
@@ -837,11 +844,17 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
|
||||
group: z.ZodOptional<z.ZodString>;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
ai: z.ZodOptional<z.ZodString>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
||||
}, z.core.$strip>>;
|
||||
submitLabel: z.ZodOptional<z.ZodString>;
|
||||
gate: z.ZodOptional<z.ZodObject<{
|
||||
ready: z.ZodBoolean;
|
||||
why: z.ZodString;
|
||||
blanks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
title: z.ZodString;
|
||||
@@ -873,6 +886,8 @@ export declare const acceptanceCriterionCheckSchema: z.ZodObject<{
|
||||
L5: "L5";
|
||||
}>;
|
||||
pass: z.ZodBoolean;
|
||||
settled: z.ZodOptional<z.ZodBoolean>;
|
||||
rationale: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
export type AcceptanceCriterionCheck = z.infer<typeof acceptanceCriterionCheckSchema>;
|
||||
/** 待落地动作意向:预检全过才上卡,卡面呈现的即已验证的动作清单(OS 7.3) */
|
||||
@@ -900,6 +915,8 @@ export declare const acceptanceWorkOrderSchema: z.ZodObject<{
|
||||
L5: "L5";
|
||||
}>;
|
||||
pass: z.ZodBoolean;
|
||||
settled: z.ZodOptional<z.ZodBoolean>;
|
||||
rationale: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
@@ -932,10 +949,221 @@ export declare const acceptanceWorkOrderSchema: z.ZodObject<{
|
||||
group: z.ZodOptional<z.ZodString>;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
ai: z.ZodOptional<z.ZodString>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
||||
}, z.core.$strip>>>;
|
||||
blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
t: z.ZodLiteral<"callout">;
|
||||
tone: z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"kv">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
fromItem: z.ZodOptional<z.ZodObject<{
|
||||
item: z.ZodString;
|
||||
field: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"badges">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
on: z.ZodBoolean;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"table">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
cols: z.ZodArray<z.ZodString>;
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
||||
linkDonut: z.ZodOptional<z.ZodObject<{
|
||||
col: z.ZodNumber;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
map: z.ZodArray<z.ZodObject<{
|
||||
match: z.ZodString;
|
||||
label: z.ZodString;
|
||||
tone: z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"bars">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
max: z.ZodOptional<z.ZodNumber>;
|
||||
redline: z.ZodOptional<z.ZodNumber>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
value: z.ZodNumber;
|
||||
text: z.ZodOptional<z.ZodString>;
|
||||
tone: z.ZodOptional<z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"donut">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
value: z.ZodNumber;
|
||||
tone: z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"mail">;
|
||||
dir: z.ZodEnum<{
|
||||
out: "out";
|
||||
in: "in";
|
||||
}>;
|
||||
statusLabel: z.ZodOptional<z.ZodString>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
from: z.ZodString;
|
||||
fromAddr: z.ZodOptional<z.ZodString>;
|
||||
to: z.ZodString;
|
||||
cc: z.ZodOptional<z.ZodString>;
|
||||
subject: z.ZodString;
|
||||
time: z.ZodString;
|
||||
body: z.ZodString;
|
||||
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
meta: z.ZodOptional<z.ZodString>;
|
||||
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"html">;
|
||||
name: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"markdown">;
|
||||
name: z.ZodString;
|
||||
md: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"excel">;
|
||||
name: z.ZodString;
|
||||
sheet: z.ZodString;
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"word">;
|
||||
name: z.ZodString;
|
||||
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
||||
t: z.ZodEnum<{
|
||||
h1: "h1";
|
||||
h2: "h2";
|
||||
p: "p";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"ul">;
|
||||
items: z.ZodArray<z.ZodString>;
|
||||
}, z.core.$strip>]>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"pdf">;
|
||||
name: z.ZodString;
|
||||
src: z.ZodString;
|
||||
}, z.core.$strip>], "kind">>;
|
||||
}, z.core.$strip>>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"cards">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
tag: z.ZodString;
|
||||
icon: z.ZodOptional<z.ZodString>;
|
||||
tone: z.ZodOptional<z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>>;
|
||||
title: z.ZodString;
|
||||
code: z.ZodOptional<z.ZodString>;
|
||||
swap: z.ZodOptional<z.ZodObject<{
|
||||
from: z.ZodString;
|
||||
to: z.ZodString;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
big: z.ZodString;
|
||||
bigLabel: z.ZodOptional<z.ZodString>;
|
||||
meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
note: z.ZodOptional<z.ZodString>;
|
||||
from: z.ZodOptional<z.ZodString>;
|
||||
time: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"waiting">;
|
||||
label: z.ZodString;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"files">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
desc: z.ZodString;
|
||||
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"html">;
|
||||
name: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"markdown">;
|
||||
name: z.ZodString;
|
||||
md: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"excel">;
|
||||
name: z.ZodString;
|
||||
sheet: z.ZodString;
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"word">;
|
||||
name: z.ZodString;
|
||||
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
||||
t: z.ZodEnum<{
|
||||
h1: "h1";
|
||||
h2: "h2";
|
||||
p: "p";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"ul">;
|
||||
items: z.ZodArray<z.ZodString>;
|
||||
}, z.core.$strip>]>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"pdf">;
|
||||
name: z.ZodString;
|
||||
src: z.ZodString;
|
||||
}, z.core.$strip>], "kind">;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>], "t">>>;
|
||||
portChoice: z.ZodOptional<z.ZodObject<{
|
||||
group: z.ZodString;
|
||||
ports: z.ZodArray<z.ZodObject<{
|
||||
@@ -943,6 +1171,22 @@ export declare const acceptanceWorkOrderSchema: z.ZodObject<{
|
||||
label: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
landing: z.ZodOptional<z.ZodObject<{
|
||||
rows: z.ZodNumber;
|
||||
simulated: z.ZodDefault<z.ZodNumber>;
|
||||
tables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
rows: z.ZodNumber;
|
||||
}, z.core.$strip>>>;
|
||||
ports: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
||||
carried: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>>;
|
||||
routedPort: z.ZodOptional<z.ZodObject<{
|
||||
group: z.ZodString;
|
||||
name: z.ZodString;
|
||||
label: z.ZodOptional<z.ZodString>;
|
||||
because: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
passLabel: z.ZodOptional<z.ZodString>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
@@ -1009,6 +1253,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
||||
linkDonut: z.ZodOptional<z.ZodObject<{
|
||||
col: z.ZodNumber;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
@@ -1205,11 +1451,17 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
group: z.ZodOptional<z.ZodString>;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
ai: z.ZodOptional<z.ZodString>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
||||
}, z.core.$strip>>;
|
||||
submitLabel: z.ZodOptional<z.ZodString>;
|
||||
gate: z.ZodOptional<z.ZodObject<{
|
||||
ready: z.ZodBoolean;
|
||||
why: z.ZodString;
|
||||
blanks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
title: z.ZodString;
|
||||
@@ -1242,6 +1494,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
L5: "L5";
|
||||
}>;
|
||||
pass: z.ZodBoolean;
|
||||
settled: z.ZodOptional<z.ZodBoolean>;
|
||||
rationale: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
@@ -1274,10 +1528,221 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
group: z.ZodOptional<z.ZodString>;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
ai: z.ZodOptional<z.ZodString>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodOptional<z.ZodBoolean>;
|
||||
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
||||
}, z.core.$strip>>>;
|
||||
blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
t: z.ZodLiteral<"callout">;
|
||||
tone: z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"kv">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
fromItem: z.ZodOptional<z.ZodObject<{
|
||||
item: z.ZodString;
|
||||
field: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"badges">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
on: z.ZodBoolean;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"table">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
cols: z.ZodArray<z.ZodString>;
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
editableCols: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
||||
ledger: z.ZodOptional<z.ZodString>;
|
||||
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
||||
linkDonut: z.ZodOptional<z.ZodObject<{
|
||||
col: z.ZodNumber;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
map: z.ZodArray<z.ZodObject<{
|
||||
match: z.ZodString;
|
||||
label: z.ZodString;
|
||||
tone: z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"bars">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
max: z.ZodOptional<z.ZodNumber>;
|
||||
redline: z.ZodOptional<z.ZodNumber>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
value: z.ZodNumber;
|
||||
text: z.ZodOptional<z.ZodString>;
|
||||
tone: z.ZodOptional<z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"donut">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
unit: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
value: z.ZodNumber;
|
||||
tone: z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"mail">;
|
||||
dir: z.ZodEnum<{
|
||||
out: "out";
|
||||
in: "in";
|
||||
}>;
|
||||
statusLabel: z.ZodOptional<z.ZodString>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
from: z.ZodString;
|
||||
fromAddr: z.ZodOptional<z.ZodString>;
|
||||
to: z.ZodString;
|
||||
cc: z.ZodOptional<z.ZodString>;
|
||||
subject: z.ZodString;
|
||||
time: z.ZodString;
|
||||
body: z.ZodString;
|
||||
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
meta: z.ZodOptional<z.ZodString>;
|
||||
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"html">;
|
||||
name: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"markdown">;
|
||||
name: z.ZodString;
|
||||
md: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"excel">;
|
||||
name: z.ZodString;
|
||||
sheet: z.ZodString;
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"word">;
|
||||
name: z.ZodString;
|
||||
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
||||
t: z.ZodEnum<{
|
||||
h1: "h1";
|
||||
h2: "h2";
|
||||
p: "p";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"ul">;
|
||||
items: z.ZodArray<z.ZodString>;
|
||||
}, z.core.$strip>]>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"pdf">;
|
||||
name: z.ZodString;
|
||||
src: z.ZodString;
|
||||
}, z.core.$strip>], "kind">>;
|
||||
}, z.core.$strip>>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"cards">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
tag: z.ZodString;
|
||||
icon: z.ZodOptional<z.ZodString>;
|
||||
tone: z.ZodOptional<z.ZodEnum<{
|
||||
ok: "ok";
|
||||
warn: "warn";
|
||||
danger: "danger";
|
||||
brand: "brand";
|
||||
muted: "muted";
|
||||
}>>;
|
||||
title: z.ZodString;
|
||||
code: z.ZodOptional<z.ZodString>;
|
||||
swap: z.ZodOptional<z.ZodObject<{
|
||||
from: z.ZodString;
|
||||
to: z.ZodString;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
big: z.ZodString;
|
||||
bigLabel: z.ZodOptional<z.ZodString>;
|
||||
meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
note: z.ZodOptional<z.ZodString>;
|
||||
from: z.ZodOptional<z.ZodString>;
|
||||
time: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"waiting">;
|
||||
label: z.ZodString;
|
||||
hint: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"files">;
|
||||
title: z.ZodOptional<z.ZodString>;
|
||||
items: z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
desc: z.ZodString;
|
||||
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"html">;
|
||||
name: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"markdown">;
|
||||
name: z.ZodString;
|
||||
md: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"excel">;
|
||||
name: z.ZodString;
|
||||
sheet: z.ZodString;
|
||||
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"word">;
|
||||
name: z.ZodString;
|
||||
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
||||
t: z.ZodEnum<{
|
||||
h1: "h1";
|
||||
h2: "h2";
|
||||
p: "p";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"ul">;
|
||||
items: z.ZodArray<z.ZodString>;
|
||||
}, z.core.$strip>]>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"pdf">;
|
||||
name: z.ZodString;
|
||||
src: z.ZodString;
|
||||
}, z.core.$strip>], "kind">;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>], "t">>>;
|
||||
portChoice: z.ZodOptional<z.ZodObject<{
|
||||
group: z.ZodString;
|
||||
ports: z.ZodArray<z.ZodObject<{
|
||||
@@ -1285,6 +1750,22 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
label: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
landing: z.ZodOptional<z.ZodObject<{
|
||||
rows: z.ZodNumber;
|
||||
simulated: z.ZodDefault<z.ZodNumber>;
|
||||
tables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
label: z.ZodString;
|
||||
rows: z.ZodNumber;
|
||||
}, z.core.$strip>>>;
|
||||
ports: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
||||
carried: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
||||
}, z.core.$strip>>;
|
||||
routedPort: z.ZodOptional<z.ZodObject<{
|
||||
group: z.ZodString;
|
||||
name: z.ZodString;
|
||||
label: z.ZodOptional<z.ZodString>;
|
||||
because: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
passLabel: z.ZodOptional<z.ZodString>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "WorkOrderId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
@@ -1355,6 +1836,7 @@ export declare const elicitationCardSchema: z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
done: z.ZodOptional<z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
@@ -1366,6 +1848,49 @@ export declare const elicitationCardSchema: z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>;
|
||||
export type ElicitationCard = z.infer<typeof elicitationCardSchema>;
|
||||
export declare const dataEntryCardSchema: z.ZodObject<{
|
||||
k: z.ZodLiteral<"entry">;
|
||||
ask: z.ZodString;
|
||||
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
ledger: z.ZodString;
|
||||
ledgerLabel: z.ZodOptional<z.ZodString>;
|
||||
key: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
keyLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodDefault<z.ZodBoolean>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
autoNote: z.ZodOptional<z.ZodString>;
|
||||
also: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
title: z.ZodString;
|
||||
ledger: z.ZodString;
|
||||
ledgerLabel: z.ZodOptional<z.ZodString>;
|
||||
key: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
keyLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodDefault<z.ZodBoolean>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
autoNote: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>>;
|
||||
done: z.ZodOptional<z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
values: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>;
|
||||
export type DataEntryCard = z.infer<typeof dataEntryCardSchema>;
|
||||
/** 评价卡:任务评价(评分 1–5 + 改进建议) */
|
||||
export declare const ratingCardSchema: z.ZodObject<{
|
||||
k: z.ZodLiteral<"rating">;
|
||||
@@ -1408,6 +1933,47 @@ export declare const chatCardSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"entry">;
|
||||
ask: z.ZodString;
|
||||
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
ledger: z.ZodString;
|
||||
ledgerLabel: z.ZodOptional<z.ZodString>;
|
||||
key: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
keyLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodDefault<z.ZodBoolean>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
autoNote: z.ZodOptional<z.ZodString>;
|
||||
also: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
title: z.ZodString;
|
||||
ledger: z.ZodString;
|
||||
ledgerLabel: z.ZodOptional<z.ZodString>;
|
||||
key: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
keyLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodDefault<z.ZodBoolean>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
autoNote: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>>;
|
||||
done: z.ZodOptional<z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
values: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"elicitation">;
|
||||
ask: z.ZodString;
|
||||
@@ -1419,6 +1985,7 @@ export declare const chatCardSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
done: z.ZodOptional<z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
@@ -1471,6 +2038,7 @@ export declare const chatMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
control: "control";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
openComms: z.ZodOptional<z.ZodBoolean>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
@@ -1497,6 +2065,47 @@ export declare const chatMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"entry">;
|
||||
ask: z.ZodString;
|
||||
basis: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
k: z.ZodString;
|
||||
v: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
ledger: z.ZodString;
|
||||
ledgerLabel: z.ZodOptional<z.ZodString>;
|
||||
key: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
keyLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodDefault<z.ZodBoolean>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
autoNote: z.ZodOptional<z.ZodString>;
|
||||
also: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
title: z.ZodString;
|
||||
ledger: z.ZodString;
|
||||
ledgerLabel: z.ZodOptional<z.ZodString>;
|
||||
key: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
keyLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
required: z.ZodDefault<z.ZodBoolean>;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
autoNote: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>>;
|
||||
done: z.ZodOptional<z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
|
||||
values: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
id: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
at: z.ZodISODateTime;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"elicitation">;
|
||||
ask: z.ZodString;
|
||||
@@ -1508,6 +2117,7 @@ export declare const chatMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
key: z.ZodString;
|
||||
label: z.ZodString;
|
||||
placeholder: z.ZodOptional<z.ZodString>;
|
||||
value: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
done: z.ZodOptional<z.ZodObject<{
|
||||
at: z.ZodISODateTime;
|
||||
@@ -1560,6 +2170,10 @@ export declare const chatCardReplySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
cardId: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
values: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
reason: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"entry">;
|
||||
cardId: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
values: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"rating">;
|
||||
cardId: z.core.$ZodBranded<z.ZodString, "CardId", "out">;
|
||||
|
||||
@@ -16,12 +16,20 @@ export declare const contractInputSchema: 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>;
|
||||
export type ContractInput = z.infer<typeof contractInputSchema>;
|
||||
export declare const outputPortSchema: 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>;
|
||||
export type OutputPort = z.infer<typeof outputPortSchema>;
|
||||
export declare const outputPortsSchema: z.ZodObject<{
|
||||
@@ -29,6 +37,7 @@ export declare const outputPortsSchema: 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;
|
||||
@@ -36,6 +45,7 @@ export declare const outputPortsSchema: 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>;
|
||||
@@ -44,6 +54,9 @@ export declare const requiredDeliverableSchema: 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>;
|
||||
export type RequiredDeliverable = z.infer<typeof requiredDeliverableSchema>;
|
||||
export declare const acceptanceCriterionSchema: z.ZodObject<{
|
||||
@@ -109,12 +122,20 @@ export declare const sevenPartContractSchema: 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;
|
||||
@@ -122,6 +143,7 @@ export declare const sevenPartContractSchema: 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>;
|
||||
@@ -129,6 +151,9 @@ export declare const sevenPartContractSchema: 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;
|
||||
@@ -143,6 +168,11 @@ export declare const sevenPartContractSchema: z.ZodObject<{
|
||||
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;
|
||||
|
||||
+43
@@ -49,12 +49,51 @@ export declare const fieldDeclarationSchema: z.ZodObject<{
|
||||
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>;
|
||||
}, z.core.$strip>;
|
||||
export type FieldDeclaration = z.infer<typeof fieldDeclarationSchema>;
|
||||
/**
|
||||
* 台账对象的**性质** —— 这条数据归谁管、活多久、谁有权改它。
|
||||
*
|
||||
* 从前台账只有「地址 + 列」,没有这一维,于是**没人需要回答「这张表是什么」**——
|
||||
* 后果不是不好看,是主键写歪了还没人发现:A4 的报价草案本该一单一份,
|
||||
* 主键却只有 `pn`,第二单报同一个料号直接 upsert 覆盖上一单
|
||||
* (实测:跑了四轮 A4,`quote_pricing.draft` 只剩最后一轮的 3 行;
|
||||
* 而主键带了单号的 `quote_intake.record` 是 61 行 / 20 单,一单不少)。
|
||||
*
|
||||
* 分三类,判据是**机械的**,不靠感觉:
|
||||
*
|
||||
* · `record` 单据 —— 一单一份的过程与结论。主键**必含单标识**(`caseKey`),
|
||||
* 放行即定稿、只增不改。它不需要「管理」,需要的是查得到、回放得出。
|
||||
* · `master` 主数据 —— 跨单积累的经营资产(客户、供应商、料号规格、历史价)。
|
||||
* 主键是**业务实体**,会被反复更新,下一单读它做判断。治理都在这一类上:
|
||||
* 谁能改、依据是什么、怎么去重、多久算过期。
|
||||
* · `derived` 派生 —— 能由前两类算出来的指标(落地率、命中率)。
|
||||
* **本不该手写**:手写的派生值能和它的来源打架,而没人会发现。
|
||||
* 标出来至少让它可被重算校验。
|
||||
*/
|
||||
export declare const LEDGER_OBJECT_KINDS: readonly ["record", "master", "derived"];
|
||||
export declare const ledgerObjectKindSchema: z.ZodEnum<{
|
||||
record: "record";
|
||||
master: "master";
|
||||
derived: "derived";
|
||||
}>;
|
||||
export type LedgerObjectKind = z.infer<typeof ledgerObjectKindSchema>;
|
||||
export declare const LEDGER_KIND_LABEL: Readonly<Record<LedgerObjectKind, string>>;
|
||||
export declare const LEDGER_KIND_DESC: Readonly<Record<LedgerObjectKind, string>>;
|
||||
export declare const objectDeclarationSchema: 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>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
@@ -69,6 +108,10 @@ export declare const objectDeclarationSchema: z.ZodObject<{
|
||||
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>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
export type ObjectDeclaration = z.infer<typeof objectDeclarationSchema>;
|
||||
|
||||
+143
@@ -42,6 +42,12 @@ export declare const manifestDeclarationsSchema: 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>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
@@ -56,6 +62,10 @@ export declare const manifestDeclarationsSchema: z.ZodObject<{
|
||||
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>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>>;
|
||||
listeners: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -154,6 +164,50 @@ export declare const dmnModelSchema: z.ZodObject<{
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
export type DmnModel = z.infer<typeof dmnModelSchema>;
|
||||
/**
|
||||
* **步骤剧本** —— 一个计划项一条,把「这一步是什么状态」写成机器读得懂的东西。
|
||||
*
|
||||
* 为什么要有它(2026-07-31 加,起因是 A1 反复空转):
|
||||
* 从前每一拍喂给模型的是**整本说明书 + 全部工具 + 全部可写台账**,
|
||||
* 模型得自己从六步里认出「我现在在第几步」。认对了还好,认岔了就开始转圈 ——
|
||||
* 实测 S1 已经把八字段写齐了,而说明书里 S3 写着「把八字段补到齐」,
|
||||
* 模型于是把同样三行又写一遍,被「写了等于没写」拒回,下一拍再写一遍,如此往复。
|
||||
*
|
||||
* 治法不是把说明书写得更啰嗦,是**把状态挪进引擎**:
|
||||
* ① `doneWhen` 让引擎自己算得出「这一步的成果已经在那儿了」—— 是就直接收掉,
|
||||
* **不问模型**(能算的不问 LLM:同输入必同结论、零 token);
|
||||
* ② `guide` / `writes` / `tools` 让每一拍的上下文**只装当前这一步要用的东西** ——
|
||||
* 上下文小了,模型跑偏的余地也就小了。
|
||||
*
|
||||
* 不写剧本的活动照旧跑(整本说明书 + 全部工具),只是没有这两样好处。
|
||||
*/
|
||||
export declare const planStepSchema: 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>;
|
||||
export type PlanStep = z.infer<typeof planStepSchema>;
|
||||
/**
|
||||
* 阶段 —— **给人看的进度刻度**,引擎一眼都不看。
|
||||
*
|
||||
* 计划项是给引擎的:一件事拆到能判「干完没有」的粒度,A1 有六项。
|
||||
* 可六格进度条对人没有意义 —— 「查历史价 / 打标 / 定去向」在业务上是**一件事**
|
||||
* (判这单该怎么走),人关心的是「到哪一步了」,不是引擎拆了几项。
|
||||
* 所以另立一层:几个计划项合成一个阶段,进度条按阶段走。
|
||||
*
|
||||
* **只声明激活态的阶段**。结束态不在这里 —— 每个活动都以放行收口(铁律③),
|
||||
* 那是系统的规矩不是活动的阶段;进度条自己在末尾加这一格。
|
||||
*/
|
||||
export declare const casePhaseSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
items: z.ZodArray<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
export type CasePhase = z.infer<typeof casePhaseSchema>;
|
||||
export declare const loopModelSchema: z.ZodObject<{
|
||||
cmmnXml: z.ZodString;
|
||||
narrative: z.ZodString;
|
||||
@@ -187,6 +241,20 @@ export declare const loopModelSchema: z.ZodObject<{
|
||||
}, 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>;
|
||||
export type LoopModel = z.infer<typeof loopModelSchema>;
|
||||
/**
|
||||
@@ -227,6 +295,20 @@ export declare const businessModelSchema: z.ZodObject<{
|
||||
}, 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>;
|
||||
export type BusinessModel = z.infer<typeof businessModelSchema>;
|
||||
export declare const skillSchema: z.ZodObject<{
|
||||
@@ -276,6 +358,20 @@ export declare const manifestAssetsSchema: z.ZodObject<{
|
||||
}, 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">;
|
||||
@@ -331,12 +427,20 @@ export declare const activityManifestSchema: 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;
|
||||
@@ -344,6 +448,7 @@ export declare const activityManifestSchema: 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>;
|
||||
@@ -351,6 +456,9 @@ export declare const activityManifestSchema: 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;
|
||||
@@ -365,6 +473,11 @@ export declare const activityManifestSchema: z.ZodObject<{
|
||||
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;
|
||||
@@ -407,6 +520,12 @@ export declare const activityManifestSchema: 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>;
|
||||
fields: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
type: z.ZodEnum<{
|
||||
@@ -421,6 +540,10 @@ export declare const activityManifestSchema: z.ZodObject<{
|
||||
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>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>>;
|
||||
listeners: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -497,6 +620,20 @@ export declare const activityManifestSchema: z.ZodObject<{
|
||||
}, 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">;
|
||||
@@ -552,6 +689,9 @@ export declare const staticAuditFindingSchema: z.ZodObject<{
|
||||
"dynamic-eval": "dynamic-eval";
|
||||
"ledger-type-conflict": "ledger-type-conflict";
|
||||
"acceptance-level-misreported": "acceptance-level-misreported";
|
||||
"acceptance-predicate-unbound": "acceptance-predicate-unbound";
|
||||
"deliverable-address-unbound": "deliverable-address-unbound";
|
||||
"ledger-kind-invalid": "ledger-kind-invalid";
|
||||
}>;
|
||||
severity: z.ZodEnum<{
|
||||
error: "error";
|
||||
@@ -590,6 +730,9 @@ export declare const installVerdictSchema: z.ZodObject<{
|
||||
"dynamic-eval": "dynamic-eval";
|
||||
"ledger-type-conflict": "ledger-type-conflict";
|
||||
"acceptance-level-misreported": "acceptance-level-misreported";
|
||||
"acceptance-predicate-unbound": "acceptance-predicate-unbound";
|
||||
"deliverable-address-unbound": "deliverable-address-unbound";
|
||||
"ledger-kind-invalid": "ledger-kind-invalid";
|
||||
}>;
|
||||
severity: z.ZodEnum<{
|
||||
error: "error";
|
||||
|
||||
+4
-4
@@ -41,9 +41,9 @@ export declare const GRANT_ACTION_LABEL: Readonly<Record<GrantAction, string>>;
|
||||
/** 治理台九功能 —— 授权客体之一 */
|
||||
export declare const GOVERNANCE_FUNCTIONS: readonly ["task", "staff", "process", "trigger", "activity", "tool", "data", "memory", "system"];
|
||||
export declare const governanceFunctionSchema: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
@@ -61,9 +61,9 @@ export declare const grantObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"governance">;
|
||||
function: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
@@ -86,9 +86,9 @@ export declare const grantSchema: z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"governance">;
|
||||
function: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
@@ -152,9 +152,9 @@ export declare const sessionSchema: z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"governance">;
|
||||
function: z.ZodEnum<{
|
||||
trigger: "trigger";
|
||||
data: "data";
|
||||
task: "task";
|
||||
trigger: "trigger";
|
||||
system: "system";
|
||||
tool: "tool";
|
||||
activity: "activity";
|
||||
|
||||
+2
-1
@@ -60,12 +60,13 @@ export declare const workflowStateSchema: z.ZodEnum<{
|
||||
}>;
|
||||
export type WorkflowState = z.infer<typeof workflowStateSchema>;
|
||||
export declare const WORKFLOW_STATE_LABEL: Readonly<Record<WorkflowState, string>>;
|
||||
export declare const ATTRIBUTION_SIDES: readonly ["machine", "human", "human-verdict", "world-wait"];
|
||||
export declare const ATTRIBUTION_SIDES: readonly ["machine", "human", "human-verdict", "world-wait", "trigger"];
|
||||
export declare const attributionSideSchema: z.ZodEnum<{
|
||||
machine: "machine";
|
||||
human: "human";
|
||||
"human-verdict": "human-verdict";
|
||||
"world-wait": "world-wait";
|
||||
trigger: "trigger";
|
||||
}>;
|
||||
export type AttributionSide = z.infer<typeof attributionSideSchema>;
|
||||
export declare const ATTRIBUTION_SIDE_LABEL: Readonly<Record<AttributionSide, string>>;
|
||||
|
||||
Reference in New Issue
Block a user