dsh-team-rooms 1.0.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/ARCHITECTURE.md +127 -0
- package/LICENSE +201 -0
- package/README-es.md +248 -0
- package/README-hi.md +248 -0
- package/README-pt.md +248 -0
- package/README-zh.md +248 -0
- package/README.md +248 -0
- package/THIRD_PARTY_NOTICES.md +41 -0
- package/cordis.patch.yml +34 -0
- package/lib/client.js +4713 -0
- package/lib/index.js +6580 -0
- package/lib/types/audit.d.ts +80 -0
- package/lib/types/client/TeamRoomsSection.d.ts +33 -0
- package/lib/types/client/index.d.ts +41 -0
- package/lib/types/client/room-locales.d.ts +61 -0
- package/lib/types/client/room-presenter.d.ts +67 -0
- package/lib/types/facts.d.ts +66 -0
- package/lib/types/inbound.d.ts +282 -0
- package/lib/types/index.d.ts +125 -0
- package/lib/types/room/commands.d.ts +23 -0
- package/lib/types/room/domain.d.ts +72 -0
- package/lib/types/room/events.d.ts +105 -0
- package/lib/types/room/hub.d.ts +243 -0
- package/lib/types/room/projection.d.ts +388 -0
- package/lib/types/room/schema.d.ts +550 -0
- package/lib/types/room/tools.d.ts +34 -0
- package/lib/types/vocabulary.d.ts +20 -0
- package/package.json +170 -0
- package/src/audit.ts +113 -0
- package/src/client/TeamRoomsSection.module.css +272 -0
- package/src/client/TeamRoomsSection.tsx +369 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/index.ts +215 -0
- package/src/client/room-locales.ts +115 -0
- package/src/client/room-presenter.ts +126 -0
- package/src/facts.ts +127 -0
- package/src/inbound.ts +440 -0
- package/src/index.ts +309 -0
- package/src/room/commands.ts +278 -0
- package/src/room/domain.ts +38 -0
- package/src/room/events.ts +116 -0
- package/src/room/hub.ts +1022 -0
- package/src/room/projection.ts +267 -0
- package/src/room/schema.ts +153 -0
- package/src/room/tools.ts +603 -0
- package/src/vocabulary.ts +20 -0
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure wire vocabulary of the team-room domain: zod schemas for every stored
|
|
3
|
+
* record, shared by the domain spec (durable boundary validation), the
|
|
4
|
+
* `teamRoom` session projection (wire value), and the client bundle guard.
|
|
5
|
+
* All times are epoch ms; ids are plain strings.
|
|
6
|
+
*
|
|
7
|
+
* @module dsh-team-rooms/room/schema
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
/** One member slot of a room: an independent session registered into the team. */
|
|
11
|
+
export declare const roomMemberSchema: z.ZodObject<{
|
|
12
|
+
/** Durable member session id (each member is its own session). */
|
|
13
|
+
sessionId: z.ZodString;
|
|
14
|
+
/** `owner` created the room; `member` joined it. */
|
|
15
|
+
role: z.ZodEnum<["owner", "member"]>;
|
|
16
|
+
/** Epoch ms of registration. */
|
|
17
|
+
joinedAt: z.ZodNumber;
|
|
18
|
+
/**
|
|
19
|
+
* Bus seq up to which this member's session log has received the
|
|
20
|
+
* model-visible delivery (0 = none yet). The offline outbox cursor.
|
|
21
|
+
*/
|
|
22
|
+
lastDeliveredSeq: z.ZodNumber;
|
|
23
|
+
/**
|
|
24
|
+
* Timeline seq up to which this member's session log carries the log-only
|
|
25
|
+
* facts (-1 = none yet). The offline fact-replay cursor.
|
|
26
|
+
*/
|
|
27
|
+
lastFactSeq: z.ZodNumber;
|
|
28
|
+
}, "strict", z.ZodTypeAny, {
|
|
29
|
+
sessionId: string;
|
|
30
|
+
role: "owner" | "member";
|
|
31
|
+
joinedAt: number;
|
|
32
|
+
lastDeliveredSeq: number;
|
|
33
|
+
lastFactSeq: number;
|
|
34
|
+
}, {
|
|
35
|
+
sessionId: string;
|
|
36
|
+
role: "owner" | "member";
|
|
37
|
+
joinedAt: number;
|
|
38
|
+
lastDeliveredSeq: number;
|
|
39
|
+
lastFactSeq: number;
|
|
40
|
+
}>;
|
|
41
|
+
/** The durable room record: membership plus the two append cursors. */
|
|
42
|
+
export declare const roomRecordSchema: z.ZodObject<{
|
|
43
|
+
roomId: z.ZodString;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
createdAt: z.ZodNumber;
|
|
46
|
+
/** Registration-order member list (each member is an independent session). */
|
|
47
|
+
members: z.ZodArray<z.ZodObject<{
|
|
48
|
+
/** Durable member session id (each member is its own session). */
|
|
49
|
+
sessionId: z.ZodString;
|
|
50
|
+
/** `owner` created the room; `member` joined it. */
|
|
51
|
+
role: z.ZodEnum<["owner", "member"]>;
|
|
52
|
+
/** Epoch ms of registration. */
|
|
53
|
+
joinedAt: z.ZodNumber;
|
|
54
|
+
/**
|
|
55
|
+
* Bus seq up to which this member's session log has received the
|
|
56
|
+
* model-visible delivery (0 = none yet). The offline outbox cursor.
|
|
57
|
+
*/
|
|
58
|
+
lastDeliveredSeq: z.ZodNumber;
|
|
59
|
+
/**
|
|
60
|
+
* Timeline seq up to which this member's session log carries the log-only
|
|
61
|
+
* facts (-1 = none yet). The offline fact-replay cursor.
|
|
62
|
+
*/
|
|
63
|
+
lastFactSeq: z.ZodNumber;
|
|
64
|
+
}, "strict", z.ZodTypeAny, {
|
|
65
|
+
sessionId: string;
|
|
66
|
+
role: "owner" | "member";
|
|
67
|
+
joinedAt: number;
|
|
68
|
+
lastDeliveredSeq: number;
|
|
69
|
+
lastFactSeq: number;
|
|
70
|
+
}, {
|
|
71
|
+
sessionId: string;
|
|
72
|
+
role: "owner" | "member";
|
|
73
|
+
joinedAt: number;
|
|
74
|
+
lastDeliveredSeq: number;
|
|
75
|
+
lastFactSeq: number;
|
|
76
|
+
}>, "many">;
|
|
77
|
+
/** Next bus seq to mint (monotonic per room; the ordering authority). */
|
|
78
|
+
busNext: z.ZodNumber;
|
|
79
|
+
/** Next timeline seq to mint. */
|
|
80
|
+
timelineNext: z.ZodNumber;
|
|
81
|
+
}, "strict", z.ZodTypeAny, {
|
|
82
|
+
roomId: string;
|
|
83
|
+
name: string;
|
|
84
|
+
createdAt: number;
|
|
85
|
+
members: {
|
|
86
|
+
sessionId: string;
|
|
87
|
+
role: "owner" | "member";
|
|
88
|
+
joinedAt: number;
|
|
89
|
+
lastDeliveredSeq: number;
|
|
90
|
+
lastFactSeq: number;
|
|
91
|
+
}[];
|
|
92
|
+
busNext: number;
|
|
93
|
+
timelineNext: number;
|
|
94
|
+
}, {
|
|
95
|
+
roomId: string;
|
|
96
|
+
name: string;
|
|
97
|
+
createdAt: number;
|
|
98
|
+
members: {
|
|
99
|
+
sessionId: string;
|
|
100
|
+
role: "owner" | "member";
|
|
101
|
+
joinedAt: number;
|
|
102
|
+
lastDeliveredSeq: number;
|
|
103
|
+
lastFactSeq: number;
|
|
104
|
+
}[];
|
|
105
|
+
busNext: number;
|
|
106
|
+
timelineNext: number;
|
|
107
|
+
}>;
|
|
108
|
+
/** One message on the room bus: broadcast, or directed when `toSessionId` is set. */
|
|
109
|
+
export declare const busMessageSchema: z.ZodObject<{
|
|
110
|
+
roomId: z.ZodString;
|
|
111
|
+
/** Monotonic per-room seq: the bus order every reader agrees on. */
|
|
112
|
+
seq: z.ZodNumber;
|
|
113
|
+
senderSessionId: z.ZodString;
|
|
114
|
+
/** Directed delivery target; absent = broadcast to every member. */
|
|
115
|
+
toSessionId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
text: z.ZodString;
|
|
117
|
+
createdAt: z.ZodNumber;
|
|
118
|
+
}, "strict", z.ZodTypeAny, {
|
|
119
|
+
roomId: string;
|
|
120
|
+
createdAt: number;
|
|
121
|
+
seq: number;
|
|
122
|
+
senderSessionId: string;
|
|
123
|
+
text: string;
|
|
124
|
+
toSessionId?: string | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
roomId: string;
|
|
127
|
+
createdAt: number;
|
|
128
|
+
seq: number;
|
|
129
|
+
senderSessionId: string;
|
|
130
|
+
text: string;
|
|
131
|
+
toSessionId?: string | undefined;
|
|
132
|
+
}>;
|
|
133
|
+
/** One task-board card: todo / in-progress / done plus its assignee. */
|
|
134
|
+
export declare const taskRecordSchema: z.ZodObject<{
|
|
135
|
+
roomId: z.ZodString;
|
|
136
|
+
taskId: z.ZodString;
|
|
137
|
+
title: z.ZodString;
|
|
138
|
+
description: z.ZodString;
|
|
139
|
+
status: z.ZodEnum<["todo", "in-progress", "done"]>;
|
|
140
|
+
/** Assignee member session id; null = unassigned. */
|
|
141
|
+
assigneeSessionId: z.ZodNullable<z.ZodString>;
|
|
142
|
+
createdBy: z.ZodString;
|
|
143
|
+
createdAt: z.ZodNumber;
|
|
144
|
+
updatedAt: z.ZodNumber;
|
|
145
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
}, "strict", z.ZodTypeAny, {
|
|
147
|
+
status: "todo" | "in-progress" | "done";
|
|
148
|
+
roomId: string;
|
|
149
|
+
createdAt: number;
|
|
150
|
+
taskId: string;
|
|
151
|
+
title: string;
|
|
152
|
+
description: string;
|
|
153
|
+
assigneeSessionId: string | null;
|
|
154
|
+
createdBy: string;
|
|
155
|
+
updatedAt: number;
|
|
156
|
+
completedAt?: number | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
status: "todo" | "in-progress" | "done";
|
|
159
|
+
roomId: string;
|
|
160
|
+
createdAt: number;
|
|
161
|
+
taskId: string;
|
|
162
|
+
title: string;
|
|
163
|
+
description: string;
|
|
164
|
+
assigneeSessionId: string | null;
|
|
165
|
+
createdBy: string;
|
|
166
|
+
updatedAt: number;
|
|
167
|
+
completedAt?: number | undefined;
|
|
168
|
+
}>;
|
|
169
|
+
/** Timeline kinds the room appends; the shared event stream. */
|
|
170
|
+
export declare const timelineKindSchema: z.ZodEnum<["room-created", "member-joined", "member-left", "message-posted", "message-directed", "task-created", "task-claimed", "task-assigned", "task-completed"]>;
|
|
171
|
+
/** One shared timeline event (append-only per room). */
|
|
172
|
+
export declare const timelineEventSchema: z.ZodObject<{
|
|
173
|
+
roomId: z.ZodString;
|
|
174
|
+
/** Monotonic per-room seq; the timeline order. */
|
|
175
|
+
seq: z.ZodNumber;
|
|
176
|
+
kind: z.ZodEnum<["room-created", "member-joined", "member-left", "message-posted", "message-directed", "task-created", "task-claimed", "task-assigned", "task-completed"]>;
|
|
177
|
+
at: z.ZodNumber;
|
|
178
|
+
/** Kind-specific payload; plain lossless JSON. */
|
|
179
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
180
|
+
}, "strict", z.ZodTypeAny, {
|
|
181
|
+
at: number;
|
|
182
|
+
roomId: string;
|
|
183
|
+
seq: number;
|
|
184
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
185
|
+
data: Record<string, unknown>;
|
|
186
|
+
}, {
|
|
187
|
+
at: number;
|
|
188
|
+
roomId: string;
|
|
189
|
+
seq: number;
|
|
190
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
191
|
+
data: Record<string, unknown>;
|
|
192
|
+
}>;
|
|
193
|
+
/** One member row as the fold serves it. */
|
|
194
|
+
export declare const roomViewMemberSchema: z.ZodObject<{
|
|
195
|
+
sessionId: z.ZodString;
|
|
196
|
+
role: z.ZodEnum<["owner", "member"]>;
|
|
197
|
+
joinedAt: z.ZodNumber;
|
|
198
|
+
}, "strict", z.ZodTypeAny, {
|
|
199
|
+
sessionId: string;
|
|
200
|
+
role: "owner" | "member";
|
|
201
|
+
joinedAt: number;
|
|
202
|
+
}, {
|
|
203
|
+
sessionId: string;
|
|
204
|
+
role: "owner" | "member";
|
|
205
|
+
joinedAt: number;
|
|
206
|
+
}>;
|
|
207
|
+
/** One task row as the fold serves it. */
|
|
208
|
+
export declare const roomViewTaskSchema: z.ZodObject<{
|
|
209
|
+
taskId: z.ZodString;
|
|
210
|
+
title: z.ZodString;
|
|
211
|
+
description: z.ZodString;
|
|
212
|
+
status: z.ZodEnum<["todo", "in-progress", "done"]>;
|
|
213
|
+
assigneeSessionId: z.ZodNullable<z.ZodString>;
|
|
214
|
+
createdBy: z.ZodString;
|
|
215
|
+
createdAt: z.ZodNumber;
|
|
216
|
+
updatedAt: z.ZodNumber;
|
|
217
|
+
}, "strict", z.ZodTypeAny, {
|
|
218
|
+
status: "todo" | "in-progress" | "done";
|
|
219
|
+
createdAt: number;
|
|
220
|
+
taskId: string;
|
|
221
|
+
title: string;
|
|
222
|
+
description: string;
|
|
223
|
+
assigneeSessionId: string | null;
|
|
224
|
+
createdBy: string;
|
|
225
|
+
updatedAt: number;
|
|
226
|
+
}, {
|
|
227
|
+
status: "todo" | "in-progress" | "done";
|
|
228
|
+
createdAt: number;
|
|
229
|
+
taskId: string;
|
|
230
|
+
title: string;
|
|
231
|
+
description: string;
|
|
232
|
+
assigneeSessionId: string | null;
|
|
233
|
+
createdBy: string;
|
|
234
|
+
updatedAt: number;
|
|
235
|
+
}>;
|
|
236
|
+
/** One room as the fold serves it. */
|
|
237
|
+
export declare const roomViewSchema: z.ZodObject<{
|
|
238
|
+
roomId: z.ZodString;
|
|
239
|
+
name: z.ZodString;
|
|
240
|
+
createdAt: z.ZodNumber;
|
|
241
|
+
members: z.ZodArray<z.ZodObject<{
|
|
242
|
+
sessionId: z.ZodString;
|
|
243
|
+
role: z.ZodEnum<["owner", "member"]>;
|
|
244
|
+
joinedAt: z.ZodNumber;
|
|
245
|
+
}, "strict", z.ZodTypeAny, {
|
|
246
|
+
sessionId: string;
|
|
247
|
+
role: "owner" | "member";
|
|
248
|
+
joinedAt: number;
|
|
249
|
+
}, {
|
|
250
|
+
sessionId: string;
|
|
251
|
+
role: "owner" | "member";
|
|
252
|
+
joinedAt: number;
|
|
253
|
+
}>, "many">;
|
|
254
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
255
|
+
taskId: z.ZodString;
|
|
256
|
+
title: z.ZodString;
|
|
257
|
+
description: z.ZodString;
|
|
258
|
+
status: z.ZodEnum<["todo", "in-progress", "done"]>;
|
|
259
|
+
assigneeSessionId: z.ZodNullable<z.ZodString>;
|
|
260
|
+
createdBy: z.ZodString;
|
|
261
|
+
createdAt: z.ZodNumber;
|
|
262
|
+
updatedAt: z.ZodNumber;
|
|
263
|
+
}, "strict", z.ZodTypeAny, {
|
|
264
|
+
status: "todo" | "in-progress" | "done";
|
|
265
|
+
createdAt: number;
|
|
266
|
+
taskId: string;
|
|
267
|
+
title: string;
|
|
268
|
+
description: string;
|
|
269
|
+
assigneeSessionId: string | null;
|
|
270
|
+
createdBy: string;
|
|
271
|
+
updatedAt: number;
|
|
272
|
+
}, {
|
|
273
|
+
status: "todo" | "in-progress" | "done";
|
|
274
|
+
createdAt: number;
|
|
275
|
+
taskId: string;
|
|
276
|
+
title: string;
|
|
277
|
+
description: string;
|
|
278
|
+
assigneeSessionId: string | null;
|
|
279
|
+
createdBy: string;
|
|
280
|
+
updatedAt: number;
|
|
281
|
+
}>, "many">;
|
|
282
|
+
timeline: z.ZodArray<z.ZodObject<{
|
|
283
|
+
roomId: z.ZodString;
|
|
284
|
+
/** Monotonic per-room seq; the timeline order. */
|
|
285
|
+
seq: z.ZodNumber;
|
|
286
|
+
kind: z.ZodEnum<["room-created", "member-joined", "member-left", "message-posted", "message-directed", "task-created", "task-claimed", "task-assigned", "task-completed"]>;
|
|
287
|
+
at: z.ZodNumber;
|
|
288
|
+
/** Kind-specific payload; plain lossless JSON. */
|
|
289
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
290
|
+
}, "strict", z.ZodTypeAny, {
|
|
291
|
+
at: number;
|
|
292
|
+
roomId: string;
|
|
293
|
+
seq: number;
|
|
294
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
295
|
+
data: Record<string, unknown>;
|
|
296
|
+
}, {
|
|
297
|
+
at: number;
|
|
298
|
+
roomId: string;
|
|
299
|
+
seq: number;
|
|
300
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
301
|
+
data: Record<string, unknown>;
|
|
302
|
+
}>, "many">;
|
|
303
|
+
}, "strict", z.ZodTypeAny, {
|
|
304
|
+
roomId: string;
|
|
305
|
+
name: string;
|
|
306
|
+
createdAt: number;
|
|
307
|
+
members: {
|
|
308
|
+
sessionId: string;
|
|
309
|
+
role: "owner" | "member";
|
|
310
|
+
joinedAt: number;
|
|
311
|
+
}[];
|
|
312
|
+
tasks: {
|
|
313
|
+
status: "todo" | "in-progress" | "done";
|
|
314
|
+
createdAt: number;
|
|
315
|
+
taskId: string;
|
|
316
|
+
title: string;
|
|
317
|
+
description: string;
|
|
318
|
+
assigneeSessionId: string | null;
|
|
319
|
+
createdBy: string;
|
|
320
|
+
updatedAt: number;
|
|
321
|
+
}[];
|
|
322
|
+
timeline: {
|
|
323
|
+
at: number;
|
|
324
|
+
roomId: string;
|
|
325
|
+
seq: number;
|
|
326
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
327
|
+
data: Record<string, unknown>;
|
|
328
|
+
}[];
|
|
329
|
+
}, {
|
|
330
|
+
roomId: string;
|
|
331
|
+
name: string;
|
|
332
|
+
createdAt: number;
|
|
333
|
+
members: {
|
|
334
|
+
sessionId: string;
|
|
335
|
+
role: "owner" | "member";
|
|
336
|
+
joinedAt: number;
|
|
337
|
+
}[];
|
|
338
|
+
tasks: {
|
|
339
|
+
status: "todo" | "in-progress" | "done";
|
|
340
|
+
createdAt: number;
|
|
341
|
+
taskId: string;
|
|
342
|
+
title: string;
|
|
343
|
+
description: string;
|
|
344
|
+
assigneeSessionId: string | null;
|
|
345
|
+
createdBy: string;
|
|
346
|
+
updatedAt: number;
|
|
347
|
+
}[];
|
|
348
|
+
timeline: {
|
|
349
|
+
at: number;
|
|
350
|
+
roomId: string;
|
|
351
|
+
seq: number;
|
|
352
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
353
|
+
data: Record<string, unknown>;
|
|
354
|
+
}[];
|
|
355
|
+
}>;
|
|
356
|
+
/** The whole `teamRoom` projection value: every room this session belongs to. */
|
|
357
|
+
export declare const teamRoomViewSchema: z.ZodObject<{
|
|
358
|
+
rooms: z.ZodArray<z.ZodObject<{
|
|
359
|
+
roomId: z.ZodString;
|
|
360
|
+
name: z.ZodString;
|
|
361
|
+
createdAt: z.ZodNumber;
|
|
362
|
+
members: z.ZodArray<z.ZodObject<{
|
|
363
|
+
sessionId: z.ZodString;
|
|
364
|
+
role: z.ZodEnum<["owner", "member"]>;
|
|
365
|
+
joinedAt: z.ZodNumber;
|
|
366
|
+
}, "strict", z.ZodTypeAny, {
|
|
367
|
+
sessionId: string;
|
|
368
|
+
role: "owner" | "member";
|
|
369
|
+
joinedAt: number;
|
|
370
|
+
}, {
|
|
371
|
+
sessionId: string;
|
|
372
|
+
role: "owner" | "member";
|
|
373
|
+
joinedAt: number;
|
|
374
|
+
}>, "many">;
|
|
375
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
376
|
+
taskId: z.ZodString;
|
|
377
|
+
title: z.ZodString;
|
|
378
|
+
description: z.ZodString;
|
|
379
|
+
status: z.ZodEnum<["todo", "in-progress", "done"]>;
|
|
380
|
+
assigneeSessionId: z.ZodNullable<z.ZodString>;
|
|
381
|
+
createdBy: z.ZodString;
|
|
382
|
+
createdAt: z.ZodNumber;
|
|
383
|
+
updatedAt: z.ZodNumber;
|
|
384
|
+
}, "strict", z.ZodTypeAny, {
|
|
385
|
+
status: "todo" | "in-progress" | "done";
|
|
386
|
+
createdAt: number;
|
|
387
|
+
taskId: string;
|
|
388
|
+
title: string;
|
|
389
|
+
description: string;
|
|
390
|
+
assigneeSessionId: string | null;
|
|
391
|
+
createdBy: string;
|
|
392
|
+
updatedAt: number;
|
|
393
|
+
}, {
|
|
394
|
+
status: "todo" | "in-progress" | "done";
|
|
395
|
+
createdAt: number;
|
|
396
|
+
taskId: string;
|
|
397
|
+
title: string;
|
|
398
|
+
description: string;
|
|
399
|
+
assigneeSessionId: string | null;
|
|
400
|
+
createdBy: string;
|
|
401
|
+
updatedAt: number;
|
|
402
|
+
}>, "many">;
|
|
403
|
+
timeline: z.ZodArray<z.ZodObject<{
|
|
404
|
+
roomId: z.ZodString;
|
|
405
|
+
/** Monotonic per-room seq; the timeline order. */
|
|
406
|
+
seq: z.ZodNumber;
|
|
407
|
+
kind: z.ZodEnum<["room-created", "member-joined", "member-left", "message-posted", "message-directed", "task-created", "task-claimed", "task-assigned", "task-completed"]>;
|
|
408
|
+
at: z.ZodNumber;
|
|
409
|
+
/** Kind-specific payload; plain lossless JSON. */
|
|
410
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
411
|
+
}, "strict", z.ZodTypeAny, {
|
|
412
|
+
at: number;
|
|
413
|
+
roomId: string;
|
|
414
|
+
seq: number;
|
|
415
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
416
|
+
data: Record<string, unknown>;
|
|
417
|
+
}, {
|
|
418
|
+
at: number;
|
|
419
|
+
roomId: string;
|
|
420
|
+
seq: number;
|
|
421
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
422
|
+
data: Record<string, unknown>;
|
|
423
|
+
}>, "many">;
|
|
424
|
+
}, "strict", z.ZodTypeAny, {
|
|
425
|
+
roomId: string;
|
|
426
|
+
name: string;
|
|
427
|
+
createdAt: number;
|
|
428
|
+
members: {
|
|
429
|
+
sessionId: string;
|
|
430
|
+
role: "owner" | "member";
|
|
431
|
+
joinedAt: number;
|
|
432
|
+
}[];
|
|
433
|
+
tasks: {
|
|
434
|
+
status: "todo" | "in-progress" | "done";
|
|
435
|
+
createdAt: number;
|
|
436
|
+
taskId: string;
|
|
437
|
+
title: string;
|
|
438
|
+
description: string;
|
|
439
|
+
assigneeSessionId: string | null;
|
|
440
|
+
createdBy: string;
|
|
441
|
+
updatedAt: number;
|
|
442
|
+
}[];
|
|
443
|
+
timeline: {
|
|
444
|
+
at: number;
|
|
445
|
+
roomId: string;
|
|
446
|
+
seq: number;
|
|
447
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
448
|
+
data: Record<string, unknown>;
|
|
449
|
+
}[];
|
|
450
|
+
}, {
|
|
451
|
+
roomId: string;
|
|
452
|
+
name: string;
|
|
453
|
+
createdAt: number;
|
|
454
|
+
members: {
|
|
455
|
+
sessionId: string;
|
|
456
|
+
role: "owner" | "member";
|
|
457
|
+
joinedAt: number;
|
|
458
|
+
}[];
|
|
459
|
+
tasks: {
|
|
460
|
+
status: "todo" | "in-progress" | "done";
|
|
461
|
+
createdAt: number;
|
|
462
|
+
taskId: string;
|
|
463
|
+
title: string;
|
|
464
|
+
description: string;
|
|
465
|
+
assigneeSessionId: string | null;
|
|
466
|
+
createdBy: string;
|
|
467
|
+
updatedAt: number;
|
|
468
|
+
}[];
|
|
469
|
+
timeline: {
|
|
470
|
+
at: number;
|
|
471
|
+
roomId: string;
|
|
472
|
+
seq: number;
|
|
473
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
474
|
+
data: Record<string, unknown>;
|
|
475
|
+
}[];
|
|
476
|
+
}>, "many">;
|
|
477
|
+
}, "strict", z.ZodTypeAny, {
|
|
478
|
+
rooms: {
|
|
479
|
+
roomId: string;
|
|
480
|
+
name: string;
|
|
481
|
+
createdAt: number;
|
|
482
|
+
members: {
|
|
483
|
+
sessionId: string;
|
|
484
|
+
role: "owner" | "member";
|
|
485
|
+
joinedAt: number;
|
|
486
|
+
}[];
|
|
487
|
+
tasks: {
|
|
488
|
+
status: "todo" | "in-progress" | "done";
|
|
489
|
+
createdAt: number;
|
|
490
|
+
taskId: string;
|
|
491
|
+
title: string;
|
|
492
|
+
description: string;
|
|
493
|
+
assigneeSessionId: string | null;
|
|
494
|
+
createdBy: string;
|
|
495
|
+
updatedAt: number;
|
|
496
|
+
}[];
|
|
497
|
+
timeline: {
|
|
498
|
+
at: number;
|
|
499
|
+
roomId: string;
|
|
500
|
+
seq: number;
|
|
501
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
502
|
+
data: Record<string, unknown>;
|
|
503
|
+
}[];
|
|
504
|
+
}[];
|
|
505
|
+
}, {
|
|
506
|
+
rooms: {
|
|
507
|
+
roomId: string;
|
|
508
|
+
name: string;
|
|
509
|
+
createdAt: number;
|
|
510
|
+
members: {
|
|
511
|
+
sessionId: string;
|
|
512
|
+
role: "owner" | "member";
|
|
513
|
+
joinedAt: number;
|
|
514
|
+
}[];
|
|
515
|
+
tasks: {
|
|
516
|
+
status: "todo" | "in-progress" | "done";
|
|
517
|
+
createdAt: number;
|
|
518
|
+
taskId: string;
|
|
519
|
+
title: string;
|
|
520
|
+
description: string;
|
|
521
|
+
assigneeSessionId: string | null;
|
|
522
|
+
createdBy: string;
|
|
523
|
+
updatedAt: number;
|
|
524
|
+
}[];
|
|
525
|
+
timeline: {
|
|
526
|
+
at: number;
|
|
527
|
+
roomId: string;
|
|
528
|
+
seq: number;
|
|
529
|
+
kind: "room-created" | "member-joined" | "member-left" | "message-posted" | "message-directed" | "task-created" | "task-claimed" | "task-assigned" | "task-completed";
|
|
530
|
+
data: Record<string, unknown>;
|
|
531
|
+
}[];
|
|
532
|
+
}[];
|
|
533
|
+
}>;
|
|
534
|
+
export type RoomMember = z.infer<typeof roomMemberSchema>;
|
|
535
|
+
export type RoomRecord = z.infer<typeof roomRecordSchema>;
|
|
536
|
+
export type BusMessage = z.infer<typeof busMessageSchema>;
|
|
537
|
+
export type TaskRecord = z.infer<typeof taskRecordSchema>;
|
|
538
|
+
export type TimelineEvent = z.infer<typeof timelineEventSchema>;
|
|
539
|
+
export type TimelineKind = z.infer<typeof timelineKindSchema>;
|
|
540
|
+
export type RoomView = z.infer<typeof roomViewSchema>;
|
|
541
|
+
export type TeamRoomView = z.infer<typeof teamRoomViewSchema>;
|
|
542
|
+
/**
|
|
543
|
+
* Runtime-guard an opaque projection cell as the `teamRoom` value (the client
|
|
544
|
+
* reads projection cells as unknown because it cannot merge the host's
|
|
545
|
+
* `SessionProjectionMap`).
|
|
546
|
+
* @param value - the opaque cell value.
|
|
547
|
+
* @returns the typed view, or undefined when the cell is absent or invalid.
|
|
548
|
+
*/
|
|
549
|
+
export declare function isTeamRoomView(value: unknown): TeamRoomView | undefined;
|
|
550
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The eight room tools the model calls inside a member session:
|
|
3
|
+
* `room_list_rooms`, `room_post`, `room_read`, `room_list_tasks`,
|
|
4
|
+
* `room_create_task`, `room_claim_task`, `room_transfer_task`,
|
|
5
|
+
* `room_complete_task`. Every tool authorizes against the calling session's
|
|
6
|
+
* membership; the cross-member handoff (`room_transfer_task`) routes through
|
|
7
|
+
* the official approval seam and fails closed when no answerer grants it.
|
|
8
|
+
*
|
|
9
|
+
* @module dsh-team-rooms/room/tools
|
|
10
|
+
*/
|
|
11
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
+
import { type ToolExecution } from '@deepseek-ai/dsh-tools';
|
|
13
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
14
|
+
/** Local derived brand: the host renamed CallId to ToolCallId on master; deriving from the tools contract keeps both typecheck rulers green. */
|
|
15
|
+
type CallId = ToolExecution['callId'];
|
|
16
|
+
import { type RoomHub } from './hub.js';
|
|
17
|
+
/** The approval seam face the tools ask through (optional in the composition). */
|
|
18
|
+
export interface ApprovalLike {
|
|
19
|
+
request(req: {
|
|
20
|
+
readonly agent: Agent;
|
|
21
|
+
readonly toolName: string;
|
|
22
|
+
readonly callId?: CallId;
|
|
23
|
+
readonly reason?: string;
|
|
24
|
+
readonly signal?: AbortSignal;
|
|
25
|
+
}): Promise<'allowed-once' | 'rejected' | 'cancelled' | 'unavailable'>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Register the eight room tools.
|
|
29
|
+
* @param ctx - context carrying tools and the optional approval service.
|
|
30
|
+
* @param hub - the room service owning the durable state.
|
|
31
|
+
*/
|
|
32
|
+
export declare function registerRoomTools(ctx: Context, hub: RoomHub): void;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The durable producer tag `dsh-team-rooms` stamps on every replay metadata
|
|
3
|
+
* block its room tools attach to a `tool/result` event.
|
|
4
|
+
*
|
|
5
|
+
* The value stays byte-identical to the tag written by `dsh-background-agents`
|
|
6
|
+
* 0.9.6: the room half of that plugin produced it, and existing profiles carry
|
|
7
|
+
* `presentationMeta.plugin === 'dsh-background-agents'` on stored results. A
|
|
8
|
+
* rename would not break a fold (nothing parses this value across packages,
|
|
9
|
+
* and the room projection reads the durable store, not this tag), but it would
|
|
10
|
+
* split one logical producer across two strings in stored logs — so the
|
|
11
|
+
* extraction deliberately keeps the historical literal. Only the constant that
|
|
12
|
+
* already belonged to the room half moved here; the Group-A notice-line and
|
|
13
|
+
* meta machinery (`NOTICE_PREFIX`/`noticeLine`/`parseNotice`/
|
|
14
|
+
* `isBackgroundAgentsMeta`) stays with the background-agent package.
|
|
15
|
+
*
|
|
16
|
+
* @module dsh-team-rooms/vocabulary
|
|
17
|
+
*/
|
|
18
|
+
/** The producer tag stamped on the room tools' `tool/result` replay metadata. */
|
|
19
|
+
export declare const PLUGIN: "dsh-background-agents";
|
|
20
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|