From 37b96fd94f96d8092ecacb8a4232ee23f3ec8d49 Mon Sep 17 00:00:00 2001 From: weichen Date: Sun, 11 Oct 2026 11:32:43 +0000 Subject: [PATCH] Add the Surface snapshot types to the TS contract authority Why: U4 needs the frontend to render saved surfaces; the Go contract (Core #25) gains its TypeScript mirror in the single authority so make contracts regenerates the frontend and UI copies. Evidence: Mirror regeneration and combined make test in the Dev workspace after re-pinning. Impact: Type-only additive change. Refs: Core PR #25; Dev task feature/generative-ui-u4 --- ts/types.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/ts/types.ts b/ts/types.ts index 23eba5a..268c7de 100644 --- a/ts/types.ts +++ b/ts/types.ts @@ -354,3 +354,45 @@ export interface UploadInfo { artifactId: ID; filename: string; mime?: string; size: number; parsed?: ParsedDocument; } + +// ---- Generative UI Surface(提案 U2/U4;与 Go surface.go 同步)---- + +export interface SurfaceCompat { + schemaVersion: number; + catalogVersion: string; + pluginVersion?: string; +} + +export interface SurfaceIdentity { + surfaceId: ID; + owner: string; + projectId?: ID; + conversationId?: ID; + sourceRunId?: ID; + pluginId: string; +} + +export interface SurfaceSpec { + title: string; + nodes: UINode[]; +} + +export interface SurfaceSnapshot { + identity: SurfaceIdentity; + compat: SurfaceCompat; + revision: number; + baseRevision?: number; + contextVersion?: string; + activationEpoch: number; + spec: SurfaceSpec; + semanticText?: string; +} + +export interface SurfaceMeta { + surfaceId: ID; + title: string; + pluginId: string; + revision: number; + conversationId?: ID; + updatedAt: string; +}