From 42154d60d46d47f7997a9030440be0834933455f Mon Sep 17 00:00:00 2001 From: Lukas May Date: Wed, 4 Feb 2026 22:16:57 +0100 Subject: [PATCH] feat(20): export SubscriptionEvent type from shared package Add SubscriptionEvent interface for frontend consumption of SSE subscription data in onData callbacks. Vite proxy confirmed compatible with SSE streaming (http-proxy passes chunked responses by default). --- packages/shared/src/index.ts | 2 +- packages/shared/src/types.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 8308a5d..03fbbb7 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -1,2 +1,2 @@ export type { AppRouter } from './trpc.js'; -export type { Initiative, Phase, Plan, Task, Agent, Message, PendingQuestions, QuestionItem } from './types.js'; +export type { Initiative, Phase, Plan, Task, Agent, Message, PendingQuestions, QuestionItem, SubscriptionEvent } from './types.js'; diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts index a57b9e2..d183727 100644 --- a/packages/shared/src/types.ts +++ b/packages/shared/src/types.ts @@ -1,2 +1,13 @@ export type { Initiative, Phase, Plan, Task, Agent, Message } from '../../../src/db/schema.js'; export type { PendingQuestions, QuestionItem } from '../../../src/agent/types.js'; + +/** + * Shape of events received from tRPC subscription streams. + * Used by the frontend in onData callbacks. + */ +export interface SubscriptionEvent { + id: string; + type: string; + payload: unknown; + timestamp: string; +}