@canonmsg/backend-contracts 1.8.0 → 1.9.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.
@@ -304,22 +304,6 @@ export declare const SsePresencePayloadSchema: z.ZodObject<{
304
304
  lastSeen: z.ZodOptional<z.ZodString>;
305
305
  }, z.core.$strip>;
306
306
  export type SsePresencePayload = z.infer<typeof SsePresencePayloadSchema>;
307
- /** Aggregated RTDB runtime snapshot — nodes are passed through opaquely. */
308
- export declare const SseRuntimeUpdatedPayloadSchema: z.ZodObject<{
309
- conversationId: z.ZodString;
310
- agentId: z.ZodString;
311
- runtime: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
312
- runtimeInfo: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
313
- sessionState: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
314
- sessionConfig: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
315
- }, z.core.$strip>;
316
- export type SseRuntimeUpdatedPayload = z.infer<typeof SseRuntimeUpdatedPayloadSchema>;
317
- export declare const SseTurnUpdatedPayloadSchema: z.ZodObject<{
318
- conversationId: z.ZodString;
319
- agentId: z.ZodString;
320
- turn: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
321
- }, z.core.$strip>;
322
- export type SseTurnUpdatedPayload = z.infer<typeof SseTurnUpdatedPayloadSchema>;
323
307
  export declare const SseRuntimeControlKindSchema: z.ZodEnum<{
324
308
  session: "session";
325
309
  signal: "signal";
@@ -419,7 +403,7 @@ export type SseVoiceSessionEventPayload = z.infer<typeof SseVoiceSessionEventPay
419
403
  * mirrored by CanonStream's dispatch switch in core). NOTE: `contact.updated`
420
404
  * is emitted by stream-service but not yet consumed by CanonStream.
421
405
  */
422
- export declare const SSE_EVENT_TYPES: readonly ["connected", "agent.context", "heartbeat", "message.created", "message.updated", "message.deleted", "conversation.updated", "contact.request", "contact.approved", "contact.added", "contact.updated", "contact.removed", "typing", "presence", "runtime.updated", "turn.updated", "runtime.control", "voice.session.started", "voice.session.ended", "replay.expired", "error"];
406
+ export declare const SSE_EVENT_TYPES: readonly ["connected", "agent.context", "heartbeat", "message.created", "message.updated", "message.deleted", "conversation.updated", "contact.request", "contact.approved", "contact.added", "contact.updated", "contact.removed", "typing", "presence", "runtime.control", "voice.session.started", "voice.session.ended", "replay.expired", "error"];
423
407
  export declare const SseEventTypeSchema: z.ZodEnum<{
424
408
  typing: "typing";
425
409
  error: "error";
@@ -436,8 +420,6 @@ export declare const SseEventTypeSchema: z.ZodEnum<{
436
420
  "contact.updated": "contact.updated";
437
421
  "contact.removed": "contact.removed";
438
422
  presence: "presence";
439
- "runtime.updated": "runtime.updated";
440
- "turn.updated": "turn.updated";
441
423
  "runtime.control": "runtime.control";
442
424
  "voice.session.started": "voice.session.started";
443
425
  "voice.session.ended": "voice.session.ended";
@@ -482,8 +464,6 @@ export declare const SseEventEnvelopeSchema: z.ZodObject<{
482
464
  "contact.updated": "contact.updated";
483
465
  "contact.removed": "contact.removed";
484
466
  presence: "presence";
485
- "runtime.updated": "runtime.updated";
486
- "turn.updated": "turn.updated";
487
467
  "runtime.control": "runtime.control";
488
468
  "voice.session.started": "voice.session.started";
489
469
  "voice.session.ended": "voice.session.ended";
package/dist/sseEvents.js CHANGED
@@ -139,20 +139,9 @@ export const SsePresencePayloadSchema = z.object({
139
139
  lastSeen: z.string().optional(),
140
140
  });
141
141
  // ── Runtime / turn family ──────────────────────────────────────────────
142
- /** Aggregated RTDB runtime snapshot — nodes are passed through opaquely. */
143
- export const SseRuntimeUpdatedPayloadSchema = z.object({
144
- conversationId: z.string(),
145
- agentId: z.string(),
146
- runtime: z.record(z.string(), z.unknown()).nullable(),
147
- runtimeInfo: z.record(z.string(), z.unknown()).nullable(),
148
- sessionState: z.record(z.string(), z.unknown()).nullable(),
149
- sessionConfig: z.record(z.string(), z.unknown()).nullable(),
150
- });
151
- export const SseTurnUpdatedPayloadSchema = z.object({
152
- conversationId: z.string(),
153
- agentId: z.string(),
154
- turn: z.record(z.string(), z.unknown()).nullable(),
155
- });
142
+ // `runtime.updated` / `turn.updated` were retired 2026-07 (zero consumers;
143
+ // the bridge reads RTDB directly). `runtime.control` remains — it is the
144
+ // planned event-push control transport (housecleaning plan §6 W2-A2).
156
145
  export const SseRuntimeControlKindSchema = z.enum([
157
146
  'session',
158
147
  'signal',
@@ -216,8 +205,6 @@ export const SSE_EVENT_TYPES = [
216
205
  'contact.removed',
217
206
  'typing',
218
207
  'presence',
219
- 'runtime.updated',
220
- 'turn.updated',
221
208
  'runtime.control',
222
209
  'voice.session.started',
223
210
  'voice.session.ended',
@@ -241,8 +228,6 @@ export const SSE_EVENT_PAYLOAD_SCHEMAS = {
241
228
  'contact.removed': SseContactRemovedPayloadSchema,
242
229
  'typing': SseTypingPayloadSchema,
243
230
  'presence': SsePresencePayloadSchema,
244
- 'runtime.updated': SseRuntimeUpdatedPayloadSchema,
245
- 'turn.updated': SseTurnUpdatedPayloadSchema,
246
231
  'runtime.control': SseRuntimeControlPayloadSchema,
247
232
  'voice.session.started': SseVoiceSessionEventPayloadSchema,
248
233
  'voice.session.ended': SseVoiceSessionEventPayloadSchema,
@@ -276,8 +261,6 @@ export const SSE_EVENT_FAMILY_BY_TYPE = {
276
261
  'contact.removed': 'contacts',
277
262
  'typing': 'typing_presence',
278
263
  'presence': 'typing_presence',
279
- 'runtime.updated': 'runtime_turn',
280
- 'turn.updated': 'runtime_turn',
281
264
  'runtime.control': 'runtime_turn',
282
265
  'voice.session.started': 'voice',
283
266
  'voice.session.ended': 'voice',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/backend-contracts",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Canon backend contract helpers shared by Functions and stream-service",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",
@@ -1,78 +0,0 @@
1
- {
2
- "$id": "canon:SseRuntimeUpdatedPayloadSchema",
3
- "$schema": "https://json-schema.org/draft/2020-12/schema",
4
- "type": "object",
5
- "properties": {
6
- "conversationId": {
7
- "type": "string"
8
- },
9
- "agentId": {
10
- "type": "string"
11
- },
12
- "runtime": {
13
- "anyOf": [
14
- {
15
- "type": "object",
16
- "propertyNames": {
17
- "type": "string"
18
- },
19
- "additionalProperties": {}
20
- },
21
- {
22
- "type": "null"
23
- }
24
- ]
25
- },
26
- "runtimeInfo": {
27
- "anyOf": [
28
- {
29
- "type": "object",
30
- "propertyNames": {
31
- "type": "string"
32
- },
33
- "additionalProperties": {}
34
- },
35
- {
36
- "type": "null"
37
- }
38
- ]
39
- },
40
- "sessionState": {
41
- "anyOf": [
42
- {
43
- "type": "object",
44
- "propertyNames": {
45
- "type": "string"
46
- },
47
- "additionalProperties": {}
48
- },
49
- {
50
- "type": "null"
51
- }
52
- ]
53
- },
54
- "sessionConfig": {
55
- "anyOf": [
56
- {
57
- "type": "object",
58
- "propertyNames": {
59
- "type": "string"
60
- },
61
- "additionalProperties": {}
62
- },
63
- {
64
- "type": "null"
65
- }
66
- ]
67
- }
68
- },
69
- "required": [
70
- "conversationId",
71
- "agentId",
72
- "runtime",
73
- "runtimeInfo",
74
- "sessionState",
75
- "sessionConfig"
76
- ],
77
- "additionalProperties": false
78
- }
@@ -1,33 +0,0 @@
1
- {
2
- "$id": "canon:SseTurnUpdatedPayloadSchema",
3
- "$schema": "https://json-schema.org/draft/2020-12/schema",
4
- "type": "object",
5
- "properties": {
6
- "conversationId": {
7
- "type": "string"
8
- },
9
- "agentId": {
10
- "type": "string"
11
- },
12
- "turn": {
13
- "anyOf": [
14
- {
15
- "type": "object",
16
- "propertyNames": {
17
- "type": "string"
18
- },
19
- "additionalProperties": {}
20
- },
21
- {
22
- "type": "null"
23
- }
24
- ]
25
- }
26
- },
27
- "required": [
28
- "conversationId",
29
- "agentId",
30
- "turn"
31
- ],
32
- "additionalProperties": false
33
- }