@company-semantics/contracts 0.124.0 → 0.126.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/src/chat/index.ts CHANGED
@@ -46,6 +46,9 @@ export type {
46
46
  CreateShareResponse,
47
47
  ListSharesResponse,
48
48
  UpdateShareResponse,
49
+ ChatMessage,
50
+ ChatDetail,
51
+ GetChatResponse,
49
52
  } from './types'
50
53
 
51
54
  // =============================================================================
@@ -81,6 +84,9 @@ export {
81
84
  CreateShareResponseSchema,
82
85
  ListSharesResponseSchema,
83
86
  UpdateShareResponseSchema,
87
+ ChatMessageSchema,
88
+ ChatDetailSchema,
89
+ GetChatResponseSchema,
84
90
  } from './schemas'
85
91
 
86
92
  // Runtime profile types and constants
@@ -153,6 +153,20 @@ export const ChatSseEventSchema = z.discriminatedUnion('type', [
153
153
  InvalidateChatListEventSchema,
154
154
  ])
155
155
 
156
+ // =============================================================================
157
+ // Message Types
158
+ // =============================================================================
159
+
160
+ /** Individual message in a chat, as returned by GET /api/chats/:id. */
161
+ export const ChatMessageSchema = z.object({
162
+ id: z.string(),
163
+ role: z.enum(['user', 'assistant']),
164
+ content: z.string(),
165
+ parts: z.array(z.unknown()).optional(),
166
+ sequenceNumber: z.number().int(),
167
+ createdAt: IsoDateString,
168
+ })
169
+
156
170
  // =============================================================================
157
171
  // HTTP Response Schemas
158
172
  // =============================================================================
@@ -192,3 +206,24 @@ export const ListSharesResponseSchema = z.object({
192
206
  export const UpdateShareResponseSchema = z.object({
193
207
  share: ChatShareInfoSchema,
194
208
  })
209
+
210
+ /**
211
+ * Chat detail object in GET /api/chats/:id response.
212
+ * Extends the base summary with interactionId (needed for append-on-edit flows).
213
+ */
214
+ export const ChatDetailSchema = z.object({
215
+ id: z.string(),
216
+ title: z.string(),
217
+ interactionId: z.string(),
218
+ pinnedAt: IsoDateString.nullable().optional(),
219
+ titleSource: TitleSourceSchema.nullable().optional(),
220
+ titleGeneratedAt: IsoDateString.nullable().optional(),
221
+ createdAt: IsoDateString,
222
+ updatedAt: IsoDateString,
223
+ })
224
+
225
+ /** Response for GET /api/chats/:id */
226
+ export const GetChatResponseSchema = z.object({
227
+ chat: ChatDetailSchema,
228
+ messages: z.array(ChatMessageSchema),
229
+ })
package/src/chat/types.ts CHANGED
@@ -34,6 +34,9 @@ import {
34
34
  CreateShareResponseSchema,
35
35
  ListSharesResponseSchema,
36
36
  UpdateShareResponseSchema,
37
+ ChatMessageSchema,
38
+ ChatDetailSchema,
39
+ GetChatResponseSchema,
37
40
  } from './schemas'
38
41
 
39
42
  // =============================================================================
@@ -259,3 +262,12 @@ export type ListSharesResponse = z.infer<typeof ListSharesResponseSchema>
259
262
 
260
263
  /** Response for PATCH /api/shares/:shareId */
261
264
  export type UpdateShareResponse = z.infer<typeof UpdateShareResponseSchema>
265
+
266
+ /** Individual message in a chat response (GET /api/chats/:id). */
267
+ export type ChatMessage = z.infer<typeof ChatMessageSchema>
268
+
269
+ /** Chat detail object in GET /api/chats/:id — includes interactionId for append-on-edit flows. */
270
+ export type ChatDetail = z.infer<typeof ChatDetailSchema>
271
+
272
+ /** Response for GET /api/chats/:id */
273
+ export type GetChatResponse = z.infer<typeof GetChatResponseSchema>
package/src/index.ts CHANGED
@@ -127,12 +127,24 @@ export {
127
127
  AuthVerifyResponseSchema,
128
128
  SsoConfigResponseSchema,
129
129
  ProfileResponseSchema,
130
+ AccountSessionListSchema,
131
+ AccountSessionRevokeResponseSchema,
132
+ AccountDeletionEligibilityResponseSchema,
133
+ AccountDeleteResponseSchema,
134
+ AccountConfirmDeletionResponseSchema,
135
+ AccountCancelDeletionResponseSchema,
130
136
  } from './identity/index'
131
137
  export type {
132
138
  MeResponse,
133
139
  AuthVerifyResponse,
134
140
  SsoConfigResponse,
135
141
  ProfileResponse,
142
+ AccountSessionList,
143
+ AccountSessionRevokeResponse,
144
+ AccountDeletionEligibilityResponse,
145
+ AccountDeleteResponse,
146
+ AccountConfirmDeletionResponse,
147
+ AccountCancelDeletionResponse,
136
148
  } from './identity/index'
137
149
 
138
150
  // Auth domain types