@company-semantics/contracts 0.106.0 → 0.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/src/chat/index.ts +27 -0
- package/src/chat/schemas.ts +154 -0
- package/src/chat/types.ts +45 -122
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@company-semantics/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.107.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": "22.x"
|
|
92
92
|
},
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"zod": "^4.2.1"
|
|
95
|
+
},
|
|
93
96
|
"devDependencies": {
|
|
94
97
|
"@types/node": "^25.0.3",
|
|
95
98
|
"husky": "^9.1.7",
|
package/src/chat/index.ts
CHANGED
|
@@ -40,6 +40,33 @@ export type {
|
|
|
40
40
|
ChatSseEvent,
|
|
41
41
|
} from './types'
|
|
42
42
|
|
|
43
|
+
// =============================================================================
|
|
44
|
+
// Schemas (Zod runtime validation)
|
|
45
|
+
// =============================================================================
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
IsoDateString,
|
|
49
|
+
ChatVisibilitySchema,
|
|
50
|
+
TitleSourceSchema,
|
|
51
|
+
InvalidationReasonSchema,
|
|
52
|
+
ChatChangedFieldSchema,
|
|
53
|
+
ChatSummarySchema,
|
|
54
|
+
ChatSummaryExtendedSchema,
|
|
55
|
+
TitleGenerationResponseSchema,
|
|
56
|
+
SharedChatMessageSchema,
|
|
57
|
+
ChatShareInfoSchema,
|
|
58
|
+
SharedChatViewSchema,
|
|
59
|
+
BaseEventSchema,
|
|
60
|
+
ChatCreatedEventSchema,
|
|
61
|
+
ChatUpdatedEventSchema,
|
|
62
|
+
ChatDeletedEventSchema,
|
|
63
|
+
InvalidateChatEventSchema,
|
|
64
|
+
InvalidateChatListEventSchema,
|
|
65
|
+
ChatDomainEventSchema,
|
|
66
|
+
ChatInvalidationEventSchema,
|
|
67
|
+
ChatSseEventSchema,
|
|
68
|
+
} from './schemas'
|
|
69
|
+
|
|
43
70
|
// Runtime profile types and constants
|
|
44
71
|
export type { ChatRuntimeProfile, ChatRuntimeProfileInfo } from './runtime-profile'
|
|
45
72
|
export { CHAT_RUNTIME_PROFILES, DEFAULT_CHAT_RUNTIME_PROFILE } from './runtime-profile'
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Reusable Primitives
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
/** ISO 8601 datetime string — the runtime safety net for date serialization. */
|
|
8
|
+
export const IsoDateString = z.string().datetime()
|
|
9
|
+
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Enums
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
export const ChatVisibilitySchema = z.enum(['private', 'public'])
|
|
15
|
+
export const TitleSourceSchema = z.enum(['auto', 'manual'])
|
|
16
|
+
export const InvalidationReasonSchema = z.enum(['external-mutation', 'bulk-operation', 'sync-required'])
|
|
17
|
+
export const ChatChangedFieldSchema = z.enum(['title', 'titleSource', 'pinnedAt'])
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// Core Entities
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
export const ChatSummarySchema = z.object({
|
|
24
|
+
id: z.string(),
|
|
25
|
+
title: z.string().nullable(),
|
|
26
|
+
messageCount: z.number().int(),
|
|
27
|
+
createdAt: IsoDateString,
|
|
28
|
+
updatedAt: IsoDateString,
|
|
29
|
+
isShared: z.boolean(),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export const ChatSummaryExtendedSchema = ChatSummarySchema.extend({
|
|
33
|
+
pinnedAt: IsoDateString.nullable(),
|
|
34
|
+
titleSource: TitleSourceSchema.nullable(),
|
|
35
|
+
titleGeneratedAt: IsoDateString.nullable(),
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export const TitleGenerationResponseSchema = z.object({
|
|
39
|
+
title: z.string(),
|
|
40
|
+
isAutoGenerated: z.boolean(),
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// =============================================================================
|
|
44
|
+
// Share Types
|
|
45
|
+
// =============================================================================
|
|
46
|
+
|
|
47
|
+
export const SharedChatMessageSchema = z.object({
|
|
48
|
+
role: z.enum(['user', 'assistant']),
|
|
49
|
+
content: z.string(),
|
|
50
|
+
parts: z.array(z.unknown()).optional(),
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const ChatShareInfoSchema = z.object({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
chatId: z.string(),
|
|
56
|
+
token: z.string(),
|
|
57
|
+
visibility: ChatVisibilitySchema,
|
|
58
|
+
shareUrl: z.string(),
|
|
59
|
+
messageCountAtShare: z.number().int(),
|
|
60
|
+
titleAtShare: z.string(),
|
|
61
|
+
createdAt: IsoDateString,
|
|
62
|
+
createdByName: z.string(),
|
|
63
|
+
isRevoked: z.boolean(),
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
export const SharedChatViewSchema = z.object({
|
|
67
|
+
title: z.string(),
|
|
68
|
+
messages: z.array(SharedChatMessageSchema),
|
|
69
|
+
sharedAt: IsoDateString,
|
|
70
|
+
sharedByName: z.string(),
|
|
71
|
+
visibility: ChatVisibilitySchema,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// SSE Event Schemas
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
export const BaseEventSchema = z.object({
|
|
79
|
+
v: z.literal(1),
|
|
80
|
+
timestamp: IsoDateString,
|
|
81
|
+
eventId: z.string().optional(),
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
export const ChatCreatedEventSchema = BaseEventSchema.extend({
|
|
85
|
+
type: z.literal('chat.created'),
|
|
86
|
+
data: z.object({
|
|
87
|
+
chatId: z.string(),
|
|
88
|
+
interactionId: z.string().optional(),
|
|
89
|
+
title: z.string(),
|
|
90
|
+
titleSource: TitleSourceSchema,
|
|
91
|
+
pinnedAt: IsoDateString.nullable(),
|
|
92
|
+
messageCount: z.number().int(),
|
|
93
|
+
createdAt: IsoDateString,
|
|
94
|
+
updatedAt: IsoDateString,
|
|
95
|
+
isShared: z.boolean(),
|
|
96
|
+
}),
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
export const ChatUpdatedEventSchema = BaseEventSchema.extend({
|
|
100
|
+
type: z.literal('chat.updated'),
|
|
101
|
+
data: z.object({
|
|
102
|
+
chatId: z.string(),
|
|
103
|
+
title: z.string(),
|
|
104
|
+
titleSource: TitleSourceSchema.nullable(),
|
|
105
|
+
titleGeneratedAt: IsoDateString.nullable(),
|
|
106
|
+
pinnedAt: IsoDateString.nullable(),
|
|
107
|
+
messageCount: z.number().int(),
|
|
108
|
+
createdAt: IsoDateString,
|
|
109
|
+
updatedAt: IsoDateString,
|
|
110
|
+
isShared: z.boolean(),
|
|
111
|
+
}),
|
|
112
|
+
changed: z.array(ChatChangedFieldSchema),
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
export const ChatDeletedEventSchema = BaseEventSchema.extend({
|
|
116
|
+
type: z.literal('chat.deleted'),
|
|
117
|
+
data: z.object({
|
|
118
|
+
chatId: z.string(),
|
|
119
|
+
}),
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
export const InvalidateChatEventSchema = BaseEventSchema.extend({
|
|
123
|
+
type: z.literal('invalidate.chat'),
|
|
124
|
+
chatId: z.string(),
|
|
125
|
+
reason: InvalidationReasonSchema,
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
export const InvalidateChatListEventSchema = BaseEventSchema.extend({
|
|
129
|
+
type: z.literal('invalidate.chat-list'),
|
|
130
|
+
reason: InvalidationReasonSchema,
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
// =============================================================================
|
|
134
|
+
// SSE Event Unions
|
|
135
|
+
// =============================================================================
|
|
136
|
+
|
|
137
|
+
export const ChatDomainEventSchema = z.discriminatedUnion('type', [
|
|
138
|
+
ChatCreatedEventSchema,
|
|
139
|
+
ChatUpdatedEventSchema,
|
|
140
|
+
ChatDeletedEventSchema,
|
|
141
|
+
])
|
|
142
|
+
|
|
143
|
+
export const ChatInvalidationEventSchema = z.discriminatedUnion('type', [
|
|
144
|
+
InvalidateChatEventSchema,
|
|
145
|
+
InvalidateChatListEventSchema,
|
|
146
|
+
])
|
|
147
|
+
|
|
148
|
+
export const ChatSseEventSchema = z.discriminatedUnion('type', [
|
|
149
|
+
ChatCreatedEventSchema,
|
|
150
|
+
ChatUpdatedEventSchema,
|
|
151
|
+
ChatDeletedEventSchema,
|
|
152
|
+
InvalidateChatEventSchema,
|
|
153
|
+
InvalidateChatListEventSchema,
|
|
154
|
+
])
|
package/src/chat/types.ts
CHANGED
|
@@ -2,8 +2,32 @@
|
|
|
2
2
|
* Chat Domain Types
|
|
3
3
|
*
|
|
4
4
|
* Shared types for chat persistence and sharing across Company Semantics codebases.
|
|
5
|
-
*
|
|
6
|
-
|
|
5
|
+
* Response and event types are derived from Zod schemas (single source of truth).
|
|
6
|
+
* Request-only types remain as interfaces (no runtime validation needed).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { z } from 'zod'
|
|
10
|
+
import {
|
|
11
|
+
ChatVisibilitySchema,
|
|
12
|
+
TitleSourceSchema,
|
|
13
|
+
InvalidationReasonSchema,
|
|
14
|
+
ChatChangedFieldSchema,
|
|
15
|
+
ChatSummarySchema,
|
|
16
|
+
ChatSummaryExtendedSchema,
|
|
17
|
+
TitleGenerationResponseSchema,
|
|
18
|
+
ChatShareInfoSchema,
|
|
19
|
+
SharedChatViewSchema,
|
|
20
|
+
SharedChatMessageSchema,
|
|
21
|
+
BaseEventSchema,
|
|
22
|
+
ChatCreatedEventSchema,
|
|
23
|
+
ChatUpdatedEventSchema,
|
|
24
|
+
ChatDeletedEventSchema,
|
|
25
|
+
InvalidateChatEventSchema,
|
|
26
|
+
InvalidateChatListEventSchema,
|
|
27
|
+
ChatDomainEventSchema,
|
|
28
|
+
ChatInvalidationEventSchema,
|
|
29
|
+
ChatSseEventSchema,
|
|
30
|
+
} from './schemas'
|
|
7
31
|
|
|
8
32
|
// =============================================================================
|
|
9
33
|
// Visibility
|
|
@@ -14,7 +38,7 @@
|
|
|
14
38
|
* - private: Token exists but access requires authentication as chat owner
|
|
15
39
|
* - public: Token grants anonymous access to anyone with the link
|
|
16
40
|
*/
|
|
17
|
-
export type ChatVisibility =
|
|
41
|
+
export type ChatVisibility = z.infer<typeof ChatVisibilitySchema>
|
|
18
42
|
|
|
19
43
|
// =============================================================================
|
|
20
44
|
// Chat Summary
|
|
@@ -23,16 +47,7 @@ export type ChatVisibility = 'private' | 'public'
|
|
|
23
47
|
/**
|
|
24
48
|
* Lightweight chat summary for list views.
|
|
25
49
|
*/
|
|
26
|
-
export
|
|
27
|
-
id: string
|
|
28
|
-
/** Title - null means intentionally untitled (title not yet generated) */
|
|
29
|
-
title: string | null
|
|
30
|
-
messageCount: number
|
|
31
|
-
createdAt: string
|
|
32
|
-
updatedAt: string
|
|
33
|
-
/** True if this chat has an active (non-revoked) share */
|
|
34
|
-
isShared: boolean
|
|
35
|
-
}
|
|
50
|
+
export type ChatSummary = z.infer<typeof ChatSummarySchema>
|
|
36
51
|
|
|
37
52
|
// =============================================================================
|
|
38
53
|
// Share Types
|
|
@@ -45,42 +60,18 @@ export interface ChatSummary {
|
|
|
45
60
|
* A chat share must never expose messages with sequenceNumber > messageCountAtShare.
|
|
46
61
|
* Enforced in ChatShareService.viewSharedChat() only.
|
|
47
62
|
*/
|
|
48
|
-
export
|
|
49
|
-
id: string
|
|
50
|
-
chatId: string
|
|
51
|
-
token: string
|
|
52
|
-
visibility: ChatVisibility
|
|
53
|
-
shareUrl: string
|
|
54
|
-
/** Message count at time of sharing - the snapshot boundary */
|
|
55
|
-
messageCountAtShare: number
|
|
56
|
-
/** Title snapshot at share time */
|
|
57
|
-
titleAtShare: string
|
|
58
|
-
createdAt: string
|
|
59
|
-
createdByName: string
|
|
60
|
-
isRevoked: boolean
|
|
61
|
-
}
|
|
63
|
+
export type ChatShareInfo = z.infer<typeof ChatShareInfoSchema>
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
66
|
* Shared chat view returned to viewers.
|
|
65
67
|
* Messages are limited by the snapshot boundary.
|
|
66
68
|
*/
|
|
67
|
-
export
|
|
68
|
-
title: string
|
|
69
|
-
messages: SharedChatMessage[]
|
|
70
|
-
sharedAt: string
|
|
71
|
-
sharedByName: string
|
|
72
|
-
visibility: ChatVisibility
|
|
73
|
-
}
|
|
69
|
+
export type SharedChatView = z.infer<typeof SharedChatViewSchema>
|
|
74
70
|
|
|
75
71
|
/**
|
|
76
72
|
* Individual message in a shared chat view.
|
|
77
73
|
*/
|
|
78
|
-
export
|
|
79
|
-
role: 'user' | 'assistant'
|
|
80
|
-
content: string
|
|
81
|
-
/** Optional rich content parts (tool calls, artifacts, etc.) */
|
|
82
|
-
parts?: unknown[]
|
|
83
|
-
}
|
|
74
|
+
export type SharedChatMessage = z.infer<typeof SharedChatMessageSchema>
|
|
84
75
|
|
|
85
76
|
// =============================================================================
|
|
86
77
|
// API Request/Response Types
|
|
@@ -114,7 +105,7 @@ export interface UpdateShareRequest {
|
|
|
114
105
|
* - auto: Generated automatically by LLM
|
|
115
106
|
* - manual: Set by user (disables future auto-generation)
|
|
116
107
|
*/
|
|
117
|
-
export type TitleSource =
|
|
108
|
+
export type TitleSource = z.infer<typeof TitleSourceSchema>
|
|
118
109
|
|
|
119
110
|
/**
|
|
120
111
|
* Filters for listing chats.
|
|
@@ -133,14 +124,7 @@ export interface ChatListFilters {
|
|
|
133
124
|
/**
|
|
134
125
|
* Extended chat summary with pin/title status.
|
|
135
126
|
*/
|
|
136
|
-
export
|
|
137
|
-
/** If pinned, when it was pinned */
|
|
138
|
-
pinnedAt: string | null
|
|
139
|
-
/** How the title was set: 'auto' or 'manual' */
|
|
140
|
-
titleSource: TitleSource | null
|
|
141
|
-
/** When auto-title was generated (null if never auto-generated) */
|
|
142
|
-
titleGeneratedAt: string | null
|
|
143
|
-
}
|
|
127
|
+
export type ChatSummaryExtended = z.infer<typeof ChatSummaryExtendedSchema>
|
|
144
128
|
|
|
145
129
|
/**
|
|
146
130
|
* Request to generate a title for a chat.
|
|
@@ -154,11 +138,7 @@ export interface TitleGenerationRequest {
|
|
|
154
138
|
/**
|
|
155
139
|
* Response from title generation.
|
|
156
140
|
*/
|
|
157
|
-
export
|
|
158
|
-
title: string
|
|
159
|
-
/** Whether this was auto-generated */
|
|
160
|
-
isAutoGenerated: boolean
|
|
161
|
-
}
|
|
141
|
+
export type TitleGenerationResponse = z.infer<typeof TitleGenerationResponseSchema>
|
|
162
142
|
|
|
163
143
|
// =============================================================================
|
|
164
144
|
// Event System Types
|
|
@@ -174,26 +154,19 @@ export interface TitleGenerationResponse {
|
|
|
174
154
|
* INV-EVENT-CONVERGENCE: Clients must assume events may be missed during SSE
|
|
175
155
|
* disconnects. Invalidation events ensure convergence.
|
|
176
156
|
*/
|
|
177
|
-
export
|
|
178
|
-
/** Protocol version for forward compatibility */
|
|
179
|
-
v: 1
|
|
180
|
-
/** ISO 8601 timestamp when event was created */
|
|
181
|
-
timestamp: string
|
|
182
|
-
/** Optional event ID for telemetry/debugging (not for deduplication logic) */
|
|
183
|
-
eventId?: string
|
|
184
|
-
}
|
|
157
|
+
export type BaseEvent = z.infer<typeof BaseEventSchema>
|
|
185
158
|
|
|
186
159
|
/**
|
|
187
160
|
* Reason for cache invalidation.
|
|
188
161
|
* INV-REASON-TELEMETRY: This is for telemetry only. UI behavior must be
|
|
189
162
|
* identical regardless of reason. Do not branch on this.
|
|
190
163
|
*/
|
|
191
|
-
export type InvalidationReason =
|
|
164
|
+
export type InvalidationReason = z.infer<typeof InvalidationReasonSchema>
|
|
192
165
|
|
|
193
166
|
/**
|
|
194
167
|
* Fields that can change on a chat, used in changed[] array.
|
|
195
168
|
*/
|
|
196
|
-
export type ChatChangedField =
|
|
169
|
+
export type ChatChangedField = z.infer<typeof ChatChangedFieldSchema>
|
|
197
170
|
|
|
198
171
|
// =============================================================================
|
|
199
172
|
// Domain Events (past-tense facts, carry full state)
|
|
@@ -206,60 +179,18 @@ export type ChatChangedField = 'title' | 'titleSource' | 'pinnedAt'
|
|
|
206
179
|
* INV-EVENT-1: This event is emitted exactly once per successful stream.
|
|
207
180
|
* INV-PERSIST-1: Chat record + messages are committed atomically before this event.
|
|
208
181
|
*/
|
|
209
|
-
export
|
|
210
|
-
type: 'chat.created'
|
|
211
|
-
data: {
|
|
212
|
-
/** Canonical server-generated UUID - use this for URLs */
|
|
213
|
-
chatId: string
|
|
214
|
-
/** Client-provided ID for correlation (optional) */
|
|
215
|
-
interactionId?: string
|
|
216
|
-
/** Chat title */
|
|
217
|
-
title: string
|
|
218
|
-
/** How the title was set */
|
|
219
|
-
titleSource: TitleSource
|
|
220
|
-
/** When pinned (null if not pinned) */
|
|
221
|
-
pinnedAt: string | null
|
|
222
|
-
/** Message count */
|
|
223
|
-
messageCount: number
|
|
224
|
-
/** ISO timestamp */
|
|
225
|
-
createdAt: string
|
|
226
|
-
/** ISO timestamp */
|
|
227
|
-
updatedAt: string
|
|
228
|
-
/** Whether chat is shared */
|
|
229
|
-
isShared: boolean
|
|
230
|
-
}
|
|
231
|
-
}
|
|
182
|
+
export type ChatCreatedEvent = z.infer<typeof ChatCreatedEventSchema>
|
|
232
183
|
|
|
233
184
|
/**
|
|
234
185
|
* Emitted when chat metadata changes (title, pin, etc.)
|
|
235
186
|
* Carries full current state - clients should replace local state entirely.
|
|
236
187
|
*/
|
|
237
|
-
export
|
|
238
|
-
type: 'chat.updated'
|
|
239
|
-
data: {
|
|
240
|
-
chatId: string
|
|
241
|
-
title: string
|
|
242
|
-
titleSource: TitleSource | null
|
|
243
|
-
titleGeneratedAt: string | null
|
|
244
|
-
pinnedAt: string | null
|
|
245
|
-
messageCount: number
|
|
246
|
-
createdAt: string
|
|
247
|
-
updatedAt: string
|
|
248
|
-
isShared: boolean
|
|
249
|
-
}
|
|
250
|
-
/** What fields changed - for UI optimization only */
|
|
251
|
-
changed: ChatChangedField[]
|
|
252
|
-
}
|
|
188
|
+
export type ChatUpdatedEvent = z.infer<typeof ChatUpdatedEventSchema>
|
|
253
189
|
|
|
254
190
|
/**
|
|
255
191
|
* Emitted when a chat is deleted.
|
|
256
192
|
*/
|
|
257
|
-
export
|
|
258
|
-
type: 'chat.deleted'
|
|
259
|
-
data: {
|
|
260
|
-
chatId: string
|
|
261
|
-
}
|
|
262
|
-
}
|
|
193
|
+
export type ChatDeletedEvent = z.infer<typeof ChatDeletedEventSchema>
|
|
263
194
|
|
|
264
195
|
// =============================================================================
|
|
265
196
|
// Invalidation Events (staleness signals)
|
|
@@ -269,20 +200,13 @@ export interface ChatDeletedEvent extends BaseEvent {
|
|
|
269
200
|
* Single-entity staleness signal.
|
|
270
201
|
* Emitted when a specific chat may be out of sync (e.g., external mutation).
|
|
271
202
|
*/
|
|
272
|
-
export
|
|
273
|
-
type: 'invalidate.chat'
|
|
274
|
-
chatId: string
|
|
275
|
-
reason: InvalidationReason
|
|
276
|
-
}
|
|
203
|
+
export type InvalidateChatEvent = z.infer<typeof InvalidateChatEventSchema>
|
|
277
204
|
|
|
278
205
|
/**
|
|
279
206
|
* Collection staleness signal.
|
|
280
207
|
* Emitted when chat list ordering/filtering may be stale.
|
|
281
208
|
*/
|
|
282
|
-
export
|
|
283
|
-
type: 'invalidate.chat-list'
|
|
284
|
-
reason: InvalidationReason
|
|
285
|
-
}
|
|
209
|
+
export type InvalidateChatListEvent = z.infer<typeof InvalidateChatListEventSchema>
|
|
286
210
|
|
|
287
211
|
// =============================================================================
|
|
288
212
|
// SSE Event Union
|
|
@@ -291,16 +215,15 @@ export interface InvalidateChatListEvent extends BaseEvent {
|
|
|
291
215
|
/**
|
|
292
216
|
* All domain events that carry full state.
|
|
293
217
|
*/
|
|
294
|
-
export type ChatDomainEvent =
|
|
218
|
+
export type ChatDomainEvent = z.infer<typeof ChatDomainEventSchema>
|
|
295
219
|
|
|
296
220
|
/**
|
|
297
221
|
* All invalidation events that signal staleness.
|
|
298
222
|
*/
|
|
299
|
-
export type ChatInvalidationEvent =
|
|
223
|
+
export type ChatInvalidationEvent = z.infer<typeof ChatInvalidationEventSchema>
|
|
300
224
|
|
|
301
225
|
/**
|
|
302
226
|
* SSE event types for chat updates.
|
|
303
227
|
* Client receives these via SSE and handles accordingly.
|
|
304
228
|
*/
|
|
305
|
-
export type ChatSseEvent =
|
|
306
|
-
|
|
229
|
+
export type ChatSseEvent = z.infer<typeof ChatSseEventSchema>
|