From 9242cee89ddcf520280dfdcd5e5d89a9c75d3040 Mon Sep 17 00:00:00 2001 From: weichen Date: Thu, 15 Oct 2026 06:46:40 +0000 Subject: [PATCH] Synchronize the work card contract Why: Consume the Core work result and optional decision snapshot. Evidence: Generated with make contracts from Core 00f1826. Impact: Add optional types without changing existing cards. Refs: feature/workbench-flow-completion --- src/contracts.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/contracts.ts b/src/contracts.ts index 70348ef..8e6f8ef 100644 --- a/src/contracts.ts +++ b/src/contracts.ts @@ -151,7 +151,20 @@ export interface ActivityCard { sourceRunId?: ID; anchorMessageId?: ID; kind: CardKind; title: string; status: CardStatus; tone?: string; body?: UINode[]; actions?: { id: string; label: string; style?: 'primary' | 'default' | 'danger'; command?: string }[]; - pinned?: boolean; createdAt: string; updatedAt: string; + pinned?: boolean; createdAt: string; updatedAt: string; work?: WorkCard; +} + +export interface WorkCard { + result?: string; resultVersion: number; readVersion: number; completedAt?: string; + decision?: WorkDecision; +} +export interface WorkDecision { + mode: 'single' | 'multiple'; state: 'open' | 'deferred' | 'submitted'; + options?: { id: string; label: string }[]; + selectedIds?: string[]; freeText?: string; respondedAt?: string; +} +export interface WorkCardAction { + resultVersion: number; selectedIds?: string[]; freeText?: string; } export interface CardPayload { card: ActivityCard }