@canonmsg/core 0.7.2 → 0.7.3
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/dist/types.d.ts +23 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -17,6 +17,25 @@ export interface ForwardedFrom {
|
|
|
17
17
|
sourceConversationId: string;
|
|
18
18
|
messageId: string;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Server-serialized contact-card payload. Emitted on messages with
|
|
22
|
+
* `contentType: 'contact_card'` so agents receive the referenced user's
|
|
23
|
+
* identity alongside the card. Agents use the referenced `userId` with the
|
|
24
|
+
* standard send-message path; if the target's inbound policy blocks cold
|
|
25
|
+
* contact, they first send a contact request and retry after approval.
|
|
26
|
+
*/
|
|
27
|
+
export interface ContactCardPayload {
|
|
28
|
+
userId: string;
|
|
29
|
+
displayName: string;
|
|
30
|
+
avatarUrl: string | null;
|
|
31
|
+
userType: 'human' | 'ai_agent';
|
|
32
|
+
about?: string;
|
|
33
|
+
isActive?: boolean;
|
|
34
|
+
ownerId?: string;
|
|
35
|
+
ownerName?: string;
|
|
36
|
+
accessLevel?: 'open' | 'owner-only';
|
|
37
|
+
lifecycleState?: string;
|
|
38
|
+
}
|
|
20
39
|
export interface CanonMessage {
|
|
21
40
|
id: string;
|
|
22
41
|
senderId: string;
|
|
@@ -33,6 +52,7 @@ export interface CanonMessage {
|
|
|
33
52
|
forwardedFrom?: ForwardedFrom;
|
|
34
53
|
workSession?: CanonWorkSessionContext | null;
|
|
35
54
|
metadata?: Record<string, unknown>;
|
|
55
|
+
contactCard?: ContactCardPayload;
|
|
36
56
|
status: 'sent' | 'read';
|
|
37
57
|
deleted: boolean;
|
|
38
58
|
createdAt: string;
|
|
@@ -122,6 +142,8 @@ export interface MessageCreatedPayload {
|
|
|
122
142
|
workSession?: CanonWorkSessionContext | null;
|
|
123
143
|
/** Structured metadata for rich UI (approval cards, etc.) */
|
|
124
144
|
metadata?: Record<string, unknown>;
|
|
145
|
+
/** Populated when `contentType === 'contact_card'`. */
|
|
146
|
+
contactCard?: ContactCardPayload;
|
|
125
147
|
};
|
|
126
148
|
}
|
|
127
149
|
export interface TypingPayload {
|
|
@@ -251,4 +273,5 @@ export interface RegistrationStatus {
|
|
|
251
273
|
agentName: string;
|
|
252
274
|
agentId?: string;
|
|
253
275
|
apiKey?: string;
|
|
276
|
+
apiKeyDelivered?: boolean;
|
|
254
277
|
}
|