@ziggs-ai/contracts 0.49.0 → 0.50.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.
@@ -123,11 +123,14 @@ export interface MessageRecord {
123
123
  artifactId: string;
124
124
  name: string;
125
125
  }> | null;
126
- /** Set when the person who owns the sending agent wrote this message as that
127
- * agent: the ref of that person among `readers`. The message is the agent's;
128
- * this says who wrote it, the way `ownerOf` says who reads along. Absent on
129
- * every message the agent wrote itself. */
130
- writtenBy?: string;
126
+ /** Set when a person who runs the sending agent wrote this message as that
127
+ * agent, from their own session. The message is the agent's; this says who
128
+ * wrote it, by the name the viewer may see them under. Absent on every
129
+ * message the agent wrote itself. */
130
+ writtenBy?: {
131
+ name: string;
132
+ isSelf: boolean;
133
+ };
131
134
  }
132
135
  export interface MessageCommandResult {
133
136
  outcome: 'created' | 'existing';
@@ -149,3 +152,21 @@ export interface ContactAlias {
149
152
  /** Authenticated owner, not a field accepted from message content or a page. */
150
153
  export declare function messageOperationKey(authenticatedOwnerId: string, operationId: string): string;
151
154
  export declare function exactArtifactKey(ref: ExactArtifactRef): string;
155
+ /** Exact persisted observations. No observation means only Sent is known. */
156
+ export interface MessageReadState {
157
+ firstUnreadMessageId: string | null;
158
+ messages: Array<{
159
+ messageId: string;
160
+ unread: boolean;
161
+ recipients: Array<{
162
+ /** Scoped to this message, never a raw principal identity. */
163
+ recipientRef: string;
164
+ kind: 'human' | 'agent' | 'workspace';
165
+ seen: boolean;
166
+ seenAt: string | null;
167
+ pickedUpAt: string | null;
168
+ /** Inbox responsibility acknowledged, not task completed or answered. */
169
+ acknowledgedAt: string | null;
170
+ }>;
171
+ }>;
172
+ }
package/dist/socket.d.ts CHANGED
@@ -93,7 +93,7 @@ export interface ChatParticipantsChangedFrame {
93
93
  export interface MessageReadFrame {
94
94
  addressId?: string;
95
95
  messageIds: string[];
96
- kind?: 'agent_handover';
96
+ kind?: 'agent_handover' | 'agent_acknowledged';
97
97
  }
98
98
  /** @deprecated Use MessageReadFrame. */
99
99
  export type ChatMessageReadFrame = MessageReadFrame;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/contracts",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Wire contracts for the Ziggs API — response shapes, error body, and socket events, shared by every client.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",