@canonmsg/backend-contracts 1.7.1 → 1.8.1

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.
Files changed (193) hide show
  1. package/dist/agentBehaviorPolicy.d.ts +86 -45
  2. package/dist/agentBehaviorPolicy.js +53 -0
  3. package/dist/bridgeLocal.d.ts +1729 -0
  4. package/dist/bridgeLocal.js +673 -0
  5. package/dist/cjs/agentBehaviorPolicy.js +54 -1
  6. package/dist/cjs/bridgeLocal.js +676 -0
  7. package/dist/cjs/contactRequest.js +30 -0
  8. package/dist/cjs/controlSignals.js +44 -0
  9. package/dist/cjs/endpointRegistry.js +264 -0
  10. package/dist/cjs/hitl.js +0 -0
  11. package/dist/cjs/inboundFrame.js +92 -0
  12. package/dist/cjs/index.js +8 -0
  13. package/dist/cjs/media.js +13 -0
  14. package/dist/cjs/message.js +64 -0
  15. package/dist/cjs/restEndpoints.js +237 -0
  16. package/dist/cjs/runtimeCardFields.js +58 -1
  17. package/dist/cjs/sendContextual.js +92 -0
  18. package/dist/cjs/sseEvents.js +298 -0
  19. package/dist/cjs/turnProtocol.js +41 -1
  20. package/dist/contactRequest.d.ts +42 -23
  21. package/dist/contactRequest.js +29 -0
  22. package/dist/controlSignals.d.ts +55 -0
  23. package/dist/controlSignals.js +41 -0
  24. package/dist/endpointRegistry.d.ts +13 -0
  25. package/dist/endpointRegistry.js +261 -0
  26. package/dist/hitl.d.ts +303 -0
  27. package/dist/hitl.js +168 -0
  28. package/dist/inboundFrame.d.ts +229 -0
  29. package/dist/inboundFrame.js +89 -0
  30. package/dist/index.d.ts +8 -0
  31. package/dist/index.js +8 -0
  32. package/dist/media.d.ts +24 -11
  33. package/dist/media.js +12 -0
  34. package/dist/message.d.ts +133 -50
  35. package/dist/message.js +64 -1
  36. package/dist/restEndpoints.d.ts +531 -0
  37. package/dist/restEndpoints.js +234 -0
  38. package/dist/runtimeCardFields.d.ts +112 -39
  39. package/dist/runtimeCardFields.js +57 -0
  40. package/dist/schemas/agent-behavior-settings-record.schema.json +48 -0
  41. package/dist/schemas/bridge-connection-state-notification.schema.json +19 -0
  42. package/dist/schemas/bridge-get-attachment-params.schema.json +24 -0
  43. package/dist/schemas/bridge-get-attachment-result.schema.json +20 -0
  44. package/dist/schemas/bridge-hello-params.schema.json +42 -0
  45. package/dist/schemas/bridge-hello-result.schema.json +105 -0
  46. package/dist/schemas/bridge-hitl-state.schema.json +38 -0
  47. package/dist/schemas/bridge-ok-result.schema.json +15 -0
  48. package/dist/schemas/bridge-ready-notification.schema.json +79 -0
  49. package/dist/schemas/bridge-resync-reason.schema.json +9 -0
  50. package/dist/schemas/bridge-resync.schema.json +18 -0
  51. package/dist/schemas/bridge-rpc-error.schema.json +19 -0
  52. package/dist/schemas/bridge-rpc-id.schema.json +12 -0
  53. package/dist/schemas/bridge-rpc-notification.schema.json +20 -0
  54. package/dist/schemas/bridge-rpc-request.schema.json +31 -0
  55. package/dist/schemas/bridge-rpc-response.schema.json +81 -0
  56. package/dist/schemas/bridge-status-result.schema.json +76 -0
  57. package/dist/schemas/bridge-upload-media-params.schema.json +28 -0
  58. package/dist/schemas/bridge-upstream-state.schema.json +10 -0
  59. package/dist/schemas/contacts-response.schema.json +52 -0
  60. package/dist/schemas/control-channel-key.schema.json +10 -0
  61. package/dist/schemas/control-primitive-event.schema.json +30 -0
  62. package/dist/schemas/control-primitive-map.schema.json +15 -0
  63. package/dist/schemas/control-session-event.schema.json +26 -0
  64. package/dist/schemas/control-session-node.schema.json +11 -0
  65. package/dist/schemas/control-signal-event.schema.json +35 -0
  66. package/dist/schemas/control-signal-node.schema.json +22 -0
  67. package/dist/schemas/control-signal-type.schema.json +10 -0
  68. package/dist/schemas/conversations-response.schema.json +167 -0
  69. package/dist/schemas/create-contact-request-request.schema.json +17 -0
  70. package/dist/schemas/create-contact-request-response.schema.json +51 -0
  71. package/dist/schemas/create-conversation-request.schema.json +82 -0
  72. package/dist/schemas/create-conversation-response.schema.json +29 -0
  73. package/dist/schemas/delete-message-response.schema.json +11 -0
  74. package/dist/schemas/delivery-intent.schema.json +11 -0
  75. package/dist/schemas/forward-message-request.schema.json +25 -0
  76. package/dist/schemas/forward-message-response.schema.json +35 -0
  77. package/dist/schemas/forwarded-from.schema.json +18 -0
  78. package/dist/schemas/get-messages-query.schema.json +17 -0
  79. package/dist/schemas/hitl-approval-category.schema.json +15 -0
  80. package/dist/schemas/hitl-approval-detail.schema.json +21 -0
  81. package/dist/schemas/hitl-approval-outcome-record.schema.json +33 -0
  82. package/dist/schemas/hitl-approval-reply-record.schema.json +57 -0
  83. package/dist/schemas/hitl-approval-request-record.schema.json +105 -0
  84. package/dist/schemas/hitl-approval-risk.schema.json +11 -0
  85. package/dist/schemas/hitl-card-outcome-record.schema.json +48 -0
  86. package/dist/schemas/hitl-card-reply-record.schema.json +46 -0
  87. package/dist/schemas/hitl-card-request-record.schema.json +73 -0
  88. package/dist/schemas/hitl-input-answers.schema.json +23 -0
  89. package/dist/schemas/hitl-input-kind.schema.json +10 -0
  90. package/dist/schemas/hitl-input-outcome-record.schema.json +46 -0
  91. package/dist/schemas/hitl-input-question.schema.json +54 -0
  92. package/dist/schemas/hitl-input-reply-record.schema.json +44 -0
  93. package/dist/schemas/hitl-input-request-record.schema.json +134 -0
  94. package/dist/schemas/hitl-pending.schema.json +31 -0
  95. package/dist/schemas/hitl-request-accepted.schema.json +18 -0
  96. package/dist/schemas/hitl-request-kind.schema.json +10 -0
  97. package/dist/schemas/hitl-resolution-status.schema.json +10 -0
  98. package/dist/schemas/hitl-resolution.schema.json +38 -0
  99. package/dist/schemas/hitl-session-rule.schema.json +32 -0
  100. package/dist/schemas/inbound-disposition.schema.json +13 -0
  101. package/dist/schemas/inbound-frame-attachment-v1.schema.json +94 -0
  102. package/dist/schemas/inbound-frame-contact-card-v1.schema.json +59 -0
  103. package/dist/schemas/inbound-frame-group-context-v1.schema.json +96 -0
  104. package/dist/schemas/inbound-frame-reply-context-v1.schema.json +261 -0
  105. package/dist/schemas/inbound-frame-shape-v1.schema.json +12 -0
  106. package/dist/schemas/inbound-frame-v1.schema.json +506 -0
  107. package/dist/schemas/mark-read-response.schema.json +11 -0
  108. package/dist/schemas/media-attachment-kind.schema.json +11 -0
  109. package/dist/schemas/media-attachment.schema.json +42 -0
  110. package/dist/schemas/messages-page-response.schema.json +290 -0
  111. package/dist/schemas/participation-decision-input.schema.json +44 -0
  112. package/dist/schemas/participation-history-message.schema.json +23 -0
  113. package/dist/schemas/participation-history-snapshot.schema.json +37 -0
  114. package/dist/schemas/participation-style.schema.json +13 -0
  115. package/dist/schemas/react-request.schema.json +22 -0
  116. package/dist/schemas/react-response.schema.json +35 -0
  117. package/dist/schemas/resolve-admission-request.schema.json +30 -0
  118. package/dist/schemas/resolve-admission-response.schema.json +129 -0
  119. package/dist/schemas/resolved-agent-behavior-policy-record.schema.json +81 -0
  120. package/dist/schemas/rest-contact.schema.json +40 -0
  121. package/dist/schemas/rest-conversation-last-message.schema.json +77 -0
  122. package/dist/schemas/rest-conversation.schema.json +155 -0
  123. package/dist/schemas/rest-message.schema.json +252 -0
  124. package/dist/schemas/rest-ok-response.schema.json +11 -0
  125. package/dist/schemas/rest-session-selection.schema.json +40 -0
  126. package/dist/schemas/runtime-card-field-choice.schema.json +23 -0
  127. package/dist/schemas/runtime-card-field-type.schema.json +17 -0
  128. package/dist/schemas/runtime-card-field.schema.json +180 -0
  129. package/dist/schemas/runtime-card-line-item-column-type.schema.json +12 -0
  130. package/dist/schemas/runtime-card-line-item-column.schema.json +74 -0
  131. package/dist/schemas/send-contextual-deferred-response.schema.json +39 -0
  132. package/dist/schemas/send-contextual-messaged-response.schema.json +42 -0
  133. package/dist/schemas/send-contextual-request.schema.json +103 -0
  134. package/dist/schemas/send-contextual-response.schema.json +105 -0
  135. package/dist/schemas/send-contextual-self-context.schema.json +19 -0
  136. package/dist/schemas/send-contextual-state-response.schema.json +24 -0
  137. package/dist/schemas/send-message-request.schema.json +106 -0
  138. package/dist/schemas/send-message-response.schema.json +14 -0
  139. package/dist/schemas/sender-type.schema.json +9 -0
  140. package/dist/schemas/serialize-message-input.schema.json +29 -0
  141. package/dist/schemas/serialized-agent-client-type.schema.json +12 -0
  142. package/dist/schemas/serialized-contact-card.schema.json +65 -0
  143. package/dist/schemas/serialized-contact-request-status.schema.json +11 -0
  144. package/dist/schemas/serialized-contact-request.schema.json +157 -0
  145. package/dist/schemas/serialized-content-type.schema.json +13 -0
  146. package/dist/schemas/serialized-message.schema.json +249 -0
  147. package/dist/schemas/serialized-reactions.schema.json +14 -0
  148. package/dist/schemas/serialized-sender-type.schema.json +9 -0
  149. package/dist/schemas/set-streaming-request.schema.json +67 -0
  150. package/dist/schemas/set-typing-request.schema.json +25 -0
  151. package/dist/schemas/sse-access-policy.schema.json +10 -0
  152. package/dist/schemas/sse-agent-context-payload.schema.json +57 -0
  153. package/dist/schemas/sse-connected-payload.schema.json +18 -0
  154. package/dist/schemas/sse-contact-payload.schema.json +40 -0
  155. package/dist/schemas/sse-contact-removed-payload.schema.json +14 -0
  156. package/dist/schemas/sse-contact-request-payload.schema.json +157 -0
  157. package/dist/schemas/sse-conversation-updated-payload.schema.json +48 -0
  158. package/dist/schemas/sse-error-payload.schema.json +23 -0
  159. package/dist/schemas/sse-event-envelope.schema.json +42 -0
  160. package/dist/schemas/sse-event-family.schema.json +12 -0
  161. package/dist/schemas/sse-event-type.schema.json +28 -0
  162. package/dist/schemas/sse-heartbeat-payload.schema.json +14 -0
  163. package/dist/schemas/sse-membership-change.schema.json +28 -0
  164. package/dist/schemas/sse-message-created-payload.schema.json +414 -0
  165. package/dist/schemas/sse-message-deleted-payload.schema.json +18 -0
  166. package/dist/schemas/sse-message-updated-payload.schema.json +46 -0
  167. package/dist/schemas/sse-presence-payload.schema.json +21 -0
  168. package/dist/schemas/sse-provenance.schema.json +64 -0
  169. package/dist/schemas/sse-replay-expired-payload.schema.json +21 -0
  170. package/dist/schemas/sse-runtime-control-kind.schema.json +13 -0
  171. package/dist/schemas/sse-runtime-control-payload.schema.json +44 -0
  172. package/dist/schemas/sse-runtime-updated-payload.schema.json +78 -0
  173. package/dist/schemas/sse-self-context.schema.json +45 -0
  174. package/dist/schemas/sse-turn-dispatch.schema.json +29 -0
  175. package/dist/schemas/sse-turn-updated-payload.schema.json +33 -0
  176. package/dist/schemas/sse-typing-payload.schema.json +32 -0
  177. package/dist/schemas/sse-voice-session-event-payload.schema.json +170 -0
  178. package/dist/schemas/sse-voice-session.schema.json +157 -0
  179. package/dist/schemas/trigger-decision.schema.json +27 -0
  180. package/dist/schemas/turn-lifecycle-state.schema.json +14 -0
  181. package/dist/schemas/turn-message-semantics.schema.json +10 -0
  182. package/dist/schemas/turn-metadata.schema.json +56 -0
  183. package/dist/schemas/turn-state-like.schema.json +39 -0
  184. package/dist/schemas/update-disposition-request.schema.json +22 -0
  185. package/dist/schemas/upload-media-request.schema.json +25 -0
  186. package/dist/schemas/upload-media-response.schema.json +55 -0
  187. package/dist/sendContextual.d.ts +114 -0
  188. package/dist/sendContextual.js +89 -0
  189. package/dist/sseEvents.d.ts +494 -0
  190. package/dist/sseEvents.js +295 -0
  191. package/dist/turnProtocol.d.ts +91 -24
  192. package/dist/turnProtocol.js +40 -0
  193. package/package.json +8 -5
@@ -0,0 +1,290 @@
1
+ {
2
+ "$id": "canon:MessagesPageResponseSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "messages": {
7
+ "type": "array",
8
+ "items": {
9
+ "type": "object",
10
+ "properties": {
11
+ "id": {
12
+ "type": "string"
13
+ },
14
+ "senderId": {
15
+ "type": "string"
16
+ },
17
+ "senderName": {
18
+ "type": "string"
19
+ },
20
+ "senderType": {
21
+ "type": "string",
22
+ "enum": [
23
+ "human",
24
+ "ai_agent"
25
+ ]
26
+ },
27
+ "isOwner": {
28
+ "type": "boolean"
29
+ },
30
+ "contentType": {
31
+ "type": "string",
32
+ "enum": [
33
+ "text",
34
+ "image",
35
+ "audio",
36
+ "video",
37
+ "file",
38
+ "contact_card"
39
+ ]
40
+ },
41
+ "text": {
42
+ "anyOf": [
43
+ {
44
+ "type": "string"
45
+ },
46
+ {
47
+ "type": "null"
48
+ }
49
+ ]
50
+ },
51
+ "attachments": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "properties": {
56
+ "kind": {
57
+ "type": "string",
58
+ "enum": [
59
+ "image",
60
+ "audio",
61
+ "video",
62
+ "file"
63
+ ]
64
+ },
65
+ "url": {
66
+ "type": "string"
67
+ },
68
+ "mimeType": {
69
+ "type": "string"
70
+ },
71
+ "fileName": {
72
+ "type": "string"
73
+ },
74
+ "sizeBytes": {
75
+ "type": "number"
76
+ },
77
+ "width": {
78
+ "type": "number"
79
+ },
80
+ "height": {
81
+ "type": "number"
82
+ },
83
+ "durationMs": {
84
+ "type": "number"
85
+ }
86
+ },
87
+ "required": [
88
+ "kind",
89
+ "url"
90
+ ],
91
+ "additionalProperties": false
92
+ }
93
+ },
94
+ "mentions": {
95
+ "type": "array",
96
+ "items": {
97
+ "type": "string"
98
+ }
99
+ },
100
+ "replyTo": {
101
+ "anyOf": [
102
+ {
103
+ "type": "string"
104
+ },
105
+ {
106
+ "type": "null"
107
+ }
108
+ ]
109
+ },
110
+ "replyToPosition": {
111
+ "anyOf": [
112
+ {
113
+ "type": "number"
114
+ },
115
+ {
116
+ "type": "null"
117
+ }
118
+ ]
119
+ },
120
+ "forwarded": {
121
+ "type": "boolean"
122
+ },
123
+ "forwardedFrom": {
124
+ "type": "object",
125
+ "properties": {
126
+ "sourceConversationId": {
127
+ "type": "string"
128
+ },
129
+ "messageId": {
130
+ "type": "string"
131
+ }
132
+ },
133
+ "required": [
134
+ "sourceConversationId",
135
+ "messageId"
136
+ ],
137
+ "additionalProperties": false
138
+ },
139
+ "status": {
140
+ "type": "string",
141
+ "enum": [
142
+ "sent",
143
+ "read"
144
+ ]
145
+ },
146
+ "createdAt": {
147
+ "type": "string"
148
+ },
149
+ "metadata": {
150
+ "type": "object",
151
+ "propertyNames": {
152
+ "type": "string"
153
+ },
154
+ "additionalProperties": {}
155
+ },
156
+ "contactCard": {
157
+ "type": "object",
158
+ "properties": {
159
+ "userId": {
160
+ "type": "string"
161
+ },
162
+ "canonContactId": {
163
+ "type": "string"
164
+ },
165
+ "displayName": {
166
+ "type": "string"
167
+ },
168
+ "avatarUrl": {
169
+ "anyOf": [
170
+ {
171
+ "type": "string"
172
+ },
173
+ {
174
+ "type": "null"
175
+ }
176
+ ]
177
+ },
178
+ "userType": {
179
+ "type": "string",
180
+ "enum": [
181
+ "human",
182
+ "ai_agent"
183
+ ]
184
+ },
185
+ "clientType": {
186
+ "type": "string",
187
+ "enum": [
188
+ "claude-code",
189
+ "openclaw",
190
+ "codex",
191
+ "hermes",
192
+ "generic"
193
+ ]
194
+ },
195
+ "about": {
196
+ "type": "string"
197
+ },
198
+ "isActive": {
199
+ "type": "boolean"
200
+ },
201
+ "ownerId": {
202
+ "type": "string"
203
+ },
204
+ "ownerName": {
205
+ "type": "string"
206
+ },
207
+ "lifecycleState": {
208
+ "type": "string"
209
+ }
210
+ },
211
+ "required": [
212
+ "userId",
213
+ "displayName",
214
+ "avatarUrl",
215
+ "userType"
216
+ ],
217
+ "additionalProperties": false
218
+ },
219
+ "runtimeCard": {
220
+ "type": "object",
221
+ "propertyNames": {
222
+ "type": "string"
223
+ },
224
+ "additionalProperties": {}
225
+ },
226
+ "reactions": {
227
+ "type": "object",
228
+ "propertyNames": {
229
+ "type": "string"
230
+ },
231
+ "additionalProperties": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "string"
235
+ }
236
+ }
237
+ },
238
+ "deleted": {
239
+ "type": "boolean"
240
+ }
241
+ },
242
+ "required": [
243
+ "id",
244
+ "senderId",
245
+ "senderType",
246
+ "isOwner",
247
+ "contentType",
248
+ "text",
249
+ "attachments",
250
+ "mentions",
251
+ "replyTo",
252
+ "replyToPosition",
253
+ "status",
254
+ "createdAt"
255
+ ],
256
+ "additionalProperties": false
257
+ }
258
+ },
259
+ "behavior": {
260
+ "type": "object",
261
+ "propertyNames": {
262
+ "type": "string"
263
+ },
264
+ "additionalProperties": {}
265
+ },
266
+ "activeSelfContextIdByMessageId": {
267
+ "type": "object",
268
+ "propertyNames": {
269
+ "type": "string"
270
+ },
271
+ "additionalProperties": {
272
+ "type": "string"
273
+ }
274
+ },
275
+ "selfContexts": {
276
+ "type": "array",
277
+ "items": {
278
+ "type": "object",
279
+ "propertyNames": {
280
+ "type": "string"
281
+ },
282
+ "additionalProperties": {}
283
+ }
284
+ }
285
+ },
286
+ "required": [
287
+ "messages"
288
+ ],
289
+ "additionalProperties": {}
290
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$id": "canon:ParticipationDecisionInputSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "conversationType": {
7
+ "type": "string",
8
+ "enum": [
9
+ "direct",
10
+ "group",
11
+ "unknown"
12
+ ]
13
+ },
14
+ "senderType": {
15
+ "type": "string",
16
+ "enum": [
17
+ "human",
18
+ "ai_agent"
19
+ ]
20
+ },
21
+ "isOwner": {
22
+ "type": "boolean"
23
+ },
24
+ "mentionedAgent": {
25
+ "type": "boolean"
26
+ },
27
+ "recentHumanCount": {
28
+ "type": "number"
29
+ },
30
+ "consecutiveAgentTurns": {
31
+ "type": "number"
32
+ },
33
+ "currentAgentStreakStartedByHuman": {
34
+ "type": "boolean"
35
+ }
36
+ },
37
+ "required": [
38
+ "conversationType",
39
+ "senderType",
40
+ "isOwner",
41
+ "mentionedAgent"
42
+ ],
43
+ "additionalProperties": false
44
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$id": "canon:ParticipationHistoryMessageSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "senderId": {
7
+ "type": "string"
8
+ },
9
+ "senderType": {
10
+ "type": "string",
11
+ "enum": [
12
+ "human",
13
+ "ai_agent"
14
+ ]
15
+ },
16
+ "metadata": {}
17
+ },
18
+ "required": [
19
+ "senderId",
20
+ "senderType"
21
+ ],
22
+ "additionalProperties": false
23
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$id": "canon:ParticipationHistorySnapshotSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "recentSenderTypes": {
7
+ "type": "array",
8
+ "items": {
9
+ "type": "string",
10
+ "enum": [
11
+ "human",
12
+ "ai_agent"
13
+ ]
14
+ }
15
+ },
16
+ "recentHumanCount": {
17
+ "type": "number"
18
+ },
19
+ "recentAgentCount": {
20
+ "type": "number"
21
+ },
22
+ "consecutiveAgentTurns": {
23
+ "type": "number"
24
+ },
25
+ "currentAgentStreakStartedByHuman": {
26
+ "type": "boolean"
27
+ }
28
+ },
29
+ "required": [
30
+ "recentSenderTypes",
31
+ "recentHumanCount",
32
+ "recentAgentCount",
33
+ "consecutiveAgentTurns",
34
+ "currentAgentStreakStartedByHuman"
35
+ ],
36
+ "additionalProperties": false
37
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$id": "canon:ParticipationStyleSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "string",
5
+ "enum": [
6
+ "natural",
7
+ "collaborative",
8
+ "mention-first",
9
+ "approval-gated",
10
+ "handoff-only",
11
+ "observer"
12
+ ]
13
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$id": "canon:ReactRequestSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "conversationId": {
7
+ "type": "string"
8
+ },
9
+ "messageId": {
10
+ "type": "string"
11
+ },
12
+ "emoji": {
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "conversationId",
18
+ "messageId",
19
+ "emoji"
20
+ ],
21
+ "additionalProperties": false
22
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$id": "canon:ReactResponseSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "success": {
7
+ "type": "boolean"
8
+ },
9
+ "action": {
10
+ "type": "string",
11
+ "enum": [
12
+ "added",
13
+ "removed"
14
+ ]
15
+ },
16
+ "reactions": {
17
+ "type": "object",
18
+ "propertyNames": {
19
+ "type": "string"
20
+ },
21
+ "additionalProperties": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "string"
25
+ }
26
+ }
27
+ }
28
+ },
29
+ "required": [
30
+ "success",
31
+ "action",
32
+ "reactions"
33
+ ],
34
+ "additionalProperties": false
35
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$id": "canon:ResolveAdmissionRequestSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "anyOf": [
5
+ {
6
+ "type": "object",
7
+ "properties": {
8
+ "targetUserId": {
9
+ "type": "string"
10
+ }
11
+ },
12
+ "required": [
13
+ "targetUserId"
14
+ ],
15
+ "additionalProperties": false
16
+ },
17
+ {
18
+ "type": "object",
19
+ "properties": {
20
+ "canonContactId": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "required": [
25
+ "canonContactId"
26
+ ],
27
+ "additionalProperties": false
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "$id": "canon:ResolveAdmissionResponseSchema",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "resolvedTargetUserId": {
7
+ "anyOf": [
8
+ {
9
+ "type": "string"
10
+ },
11
+ {
12
+ "type": "null"
13
+ }
14
+ ]
15
+ },
16
+ "target": {
17
+ "anyOf": [
18
+ {
19
+ "type": "object",
20
+ "properties": {
21
+ "id": {
22
+ "type": "string"
23
+ },
24
+ "canonContactId": {
25
+ "type": "string"
26
+ },
27
+ "displayName": {
28
+ "type": "string"
29
+ },
30
+ "avatarUrl": {
31
+ "anyOf": [
32
+ {
33
+ "type": "string"
34
+ },
35
+ {
36
+ "type": "null"
37
+ }
38
+ ]
39
+ },
40
+ "about": {
41
+ "type": "string"
42
+ },
43
+ "userType": {
44
+ "type": "string",
45
+ "enum": [
46
+ "human",
47
+ "ai_agent"
48
+ ]
49
+ },
50
+ "discoverable": {
51
+ "type": "boolean"
52
+ },
53
+ "inboundPolicy": {
54
+ "type": "string",
55
+ "enum": [
56
+ "open",
57
+ "approval-required",
58
+ "owner-only"
59
+ ]
60
+ },
61
+ "groupJoinPolicy": {
62
+ "type": "string",
63
+ "enum": [
64
+ "open",
65
+ "approval-required",
66
+ "owner-only"
67
+ ]
68
+ }
69
+ },
70
+ "required": [
71
+ "id"
72
+ ],
73
+ "additionalProperties": {}
74
+ },
75
+ {
76
+ "type": "null"
77
+ }
78
+ ]
79
+ },
80
+ "admission": {
81
+ "type": "object",
82
+ "properties": {
83
+ "state": {
84
+ "type": "string",
85
+ "enum": [
86
+ "self",
87
+ "not-found",
88
+ "allowed",
89
+ "request-required",
90
+ "pending-outbound",
91
+ "blocked",
92
+ "inactive",
93
+ "owner-only"
94
+ ]
95
+ },
96
+ "canMessage": {
97
+ "type": "boolean"
98
+ },
99
+ "canRequestContact": {
100
+ "type": "boolean"
101
+ },
102
+ "isContact": {
103
+ "type": "boolean"
104
+ },
105
+ "pendingRequestId": {
106
+ "type": "string"
107
+ },
108
+ "blockedByViewer": {
109
+ "type": "boolean"
110
+ },
111
+ "blockedByTarget": {
112
+ "type": "boolean"
113
+ }
114
+ },
115
+ "required": [
116
+ "state",
117
+ "canMessage",
118
+ "canRequestContact",
119
+ "isContact"
120
+ ],
121
+ "additionalProperties": {}
122
+ }
123
+ },
124
+ "required": [
125
+ "target",
126
+ "admission"
127
+ ],
128
+ "additionalProperties": {}
129
+ }