Skip to content

Commit 0c288a4

Browse files
committed
feat(core): add StreamingBehavior type and extend message/action schemas
Add optional streamingBehavior field ("steer" | "followUp" | "info") to RoomMessage, DmMessage, and the send/dm CommsAction variants.
1 parent c82b381 commit 0c288a4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/core/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ export const RoomType = defineSchema(
5959
);
6060
export type RoomType = z.infer<typeof RoomType>;
6161

62+
export const StreamingBehavior = defineSchema(
63+
z.union([z.literal("steer"), z.literal("followUp"), z.literal("info")]),
64+
);
65+
export type StreamingBehavior = z.infer<typeof StreamingBehavior>;
66+
6267
// ---------------------------------------------------------------------------
6368
// AgentIdentity
6469
// ---------------------------------------------------------------------------
@@ -111,6 +116,7 @@ export const RoomMessageSchema = defineSchema(
111116
timestamp: z.string(),
112117
replyTo: z.string().optional(),
113118
readBy: z.array(z.string()),
119+
streamingBehavior: StreamingBehavior.optional(),
114120
}),
115121
);
116122
export type RoomMessage = z.infer<typeof RoomMessageSchema>;
@@ -123,6 +129,7 @@ export const DmMessageSchema = defineSchema(
123129
content: z.string(),
124130
timestamp: z.string(),
125131
readBy: z.array(z.string()),
132+
streamingBehavior: StreamingBehavior.optional(),
126133
}),
127134
);
128135
export type DmMessage = z.infer<typeof DmMessageSchema>;
@@ -267,11 +274,13 @@ export const CommsActionSchema = defineSchema(
267274
target: z.string(),
268275
content: z.string(),
269276
replyTo: z.string().optional(),
277+
streamingBehavior: StreamingBehavior.optional(),
270278
}),
271279
z.object({
272280
action: z.literal("dm"),
273281
target: z.string(),
274282
content: z.string(),
283+
streamingBehavior: StreamingBehavior.optional(),
275284
}),
276285
z.object({ action: z.literal("list_agents") }),
277286
z.object({

0 commit comments

Comments
 (0)