@naisys/hub-protocol 3.0.0-beta.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.

Potentially problematic release.


This version of @naisys/hub-protocol might be problematic. Click here for more details.

@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ /** How often NAISYS instances flush buffered cost entries to the hub (ms) */
3
+ export const COST_FLUSH_INTERVAL_MS = 100;
4
+ export const CostSourceEnum = z.enum([
5
+ "console",
6
+ "write_protection",
7
+ "compact",
8
+ "lynx",
9
+ "look",
10
+ "listen",
11
+ "genimg",
12
+ ]);
13
+ /** A single cost entry sent from NAISYS instance to hub */
14
+ export const CostWriteEntrySchema = z.object({
15
+ userId: z.number(),
16
+ runId: z.number(),
17
+ sessionId: z.number(),
18
+ source: CostSourceEnum,
19
+ model: z.string(),
20
+ cost: z.number(),
21
+ inputTokens: z.number(),
22
+ outputTokens: z.number(),
23
+ cacheWriteTokens: z.number(),
24
+ cacheReadTokens: z.number(),
25
+ });
26
+ /** Batch of cost entries sent from NAISYS instance to hub */
27
+ export const CostWriteRequestSchema = z.object({
28
+ entries: z.array(CostWriteEntrySchema),
29
+ });
30
+ /** Per-user budget entry in the COST_WRITE response */
31
+ export const CostWriteBudgetEntrySchema = z.object({
32
+ userId: z.number(),
33
+ /** Remaining budget for this agent, or null if no per-agent limit */
34
+ budgetLeft: z.number().nullable(),
35
+ });
36
+ /** Response to COST_WRITE — returns per-agent budget info for each user in the batch */
37
+ export const CostWriteResponseSchema = z.object({
38
+ budgets: z.array(CostWriteBudgetEntrySchema),
39
+ });
40
+ /** Cost delta pushed from hub to supervisor after DB write */
41
+ export const CostPushEntrySchema = z.object({
42
+ userId: z.number(),
43
+ runId: z.number(),
44
+ sessionId: z.number(),
45
+ costDelta: z.number(),
46
+ });
47
+ export const CostPushSchema = z.object({
48
+ entries: z.array(CostPushEntrySchema),
49
+ });
50
+ /** Pushed from hub when an agent's spending status changes */
51
+ export const CostControlSchema = z.object({
52
+ userId: z.number(),
53
+ enabled: z.boolean(),
54
+ reason: z.string(),
55
+ });
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ /** How often NAISYS instances send heartbeats to the hub (ms) */
3
+ export declare const NAISYS_HEARTBEAT_INTERVAL_MS = 2000;
4
+ /** How often the hub pushes aggregate active user status to all connections (NAISYS/Supervisors) (ms) */
5
+ export declare const HUB_HEARTBEAT_INTERVAL_MS = 2000;
6
+ /** Sent by NAISYS instance to hub with active user IDs */
7
+ export declare const HeartbeatSchema: z.ZodObject<{
8
+ activeUserIds: z.ZodArray<z.ZodNumber>;
9
+ }, z.core.$strip>;
10
+ export type Heartbeat = z.infer<typeof HeartbeatSchema>;
11
+ /** Per-agent notification IDs pushed from hub to connected clients */
12
+ export declare const AgentNotificationSchema: z.ZodObject<{
13
+ latestLogId: z.ZodNumber;
14
+ latestMailId: z.ZodNumber;
15
+ latestChatId: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ export type AgentNotification = z.infer<typeof AgentNotificationSchema>;
18
+ /** Sent by hub to NAISYS instances with aggregate active agents and notifications */
19
+ export declare const AgentsStatusSchema: z.ZodObject<{
20
+ hostActiveAgents: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNumber>>;
21
+ agentNotifications: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
22
+ latestLogId: z.ZodNumber;
23
+ latestMailId: z.ZodNumber;
24
+ latestChatId: z.ZodNumber;
25
+ }, z.core.$strip>>>;
26
+ }, z.core.$strip>;
27
+ export type AgentsStatus = z.infer<typeof AgentsStatusSchema>;
28
+ //# sourceMappingURL=heartbeat.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ /** How often NAISYS instances send heartbeats to the hub (ms) */
3
+ export const NAISYS_HEARTBEAT_INTERVAL_MS = 2000;
4
+ /** How often the hub pushes aggregate active user status to all connections (NAISYS/Supervisors) (ms) */
5
+ export const HUB_HEARTBEAT_INTERVAL_MS = 2000;
6
+ /** Sent by NAISYS instance to hub with active user IDs */
7
+ export const HeartbeatSchema = z.object({
8
+ activeUserIds: z.array(z.number()),
9
+ });
10
+ /** Per-agent notification IDs pushed from hub to connected clients */
11
+ export const AgentNotificationSchema = z.object({
12
+ latestLogId: z.number(),
13
+ latestMailId: z.number(),
14
+ latestChatId: z.number(),
15
+ });
16
+ /** Sent by hub to NAISYS instances with aggregate active agents and notifications */
17
+ export const AgentsStatusSchema = z.object({
18
+ hostActiveAgents: z.record(z.string(), z.array(z.number())),
19
+ agentNotifications: z.record(z.string(), AgentNotificationSchema).optional(),
20
+ });
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export declare const HostTypeEnum: z.ZodEnum<{
3
+ naisys: "naisys";
4
+ supervisor: "supervisor";
5
+ }>;
6
+ export type HostType = z.infer<typeof HostTypeEnum>;
7
+ /** Pushed from hub to all NAISYS instances when the set of known hosts changes */
8
+ export declare const HostListSchema: z.ZodObject<{
9
+ hosts: z.ZodArray<z.ZodObject<{
10
+ hostId: z.ZodNumber;
11
+ hostName: z.ZodString;
12
+ restricted: z.ZodBoolean;
13
+ hostType: z.ZodEnum<{
14
+ naisys: "naisys";
15
+ supervisor: "supervisor";
16
+ }>;
17
+ online: z.ZodBoolean;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ export type HostList = z.infer<typeof HostListSchema>;
21
+ //# sourceMappingURL=hosts.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export const HostTypeEnum = z.enum(["naisys", "supervisor"]);
3
+ /** Pushed from hub to all NAISYS instances when the set of known hosts changes */
4
+ export const HostListSchema = z.object({
5
+ hosts: z.array(z.object({
6
+ hostId: z.number(),
7
+ hostName: z.string(),
8
+ restricted: z.boolean(),
9
+ hostType: HostTypeEnum,
10
+ online: z.boolean(),
11
+ })),
12
+ });
@@ -0,0 +1,154 @@
1
+ import { z } from "zod";
2
+ /** How often NAISYS instances flush buffered log entries to the hub (ms) */
3
+ export declare const LOG_FLUSH_INTERVAL_MS = 100;
4
+ export declare const LogRoleEnum: z.ZodEnum<{
5
+ NAISYS: "NAISYS";
6
+ LLM: "LLM";
7
+ }>;
8
+ export declare const LogSourceEnum: z.ZodEnum<{
9
+ console: "console";
10
+ startPrompt: "startPrompt";
11
+ endPrompt: "endPrompt";
12
+ llm: "llm";
13
+ }>;
14
+ export declare const LogTypeEnum: z.ZodEnum<{
15
+ error: "error";
16
+ comment: "comment";
17
+ system: "system";
18
+ tool: "tool";
19
+ }>;
20
+ /** A single log entry sent from NAISYS instance to hub */
21
+ export declare const LogWriteEntrySchema: z.ZodObject<{
22
+ userId: z.ZodNumber;
23
+ runId: z.ZodNumber;
24
+ sessionId: z.ZodNumber;
25
+ role: z.ZodEnum<{
26
+ NAISYS: "NAISYS";
27
+ LLM: "LLM";
28
+ }>;
29
+ source: z.ZodNullable<z.ZodEnum<{
30
+ console: "console";
31
+ startPrompt: "startPrompt";
32
+ endPrompt: "endPrompt";
33
+ llm: "llm";
34
+ }>>;
35
+ type: z.ZodNullable<z.ZodEnum<{
36
+ error: "error";
37
+ comment: "comment";
38
+ system: "system";
39
+ tool: "tool";
40
+ }>>;
41
+ message: z.ZodString;
42
+ createdAt: z.ZodString;
43
+ attachmentId: z.ZodOptional<z.ZodNumber>;
44
+ }, z.core.$strip>;
45
+ export type LogWriteEntry = z.infer<typeof LogWriteEntrySchema>;
46
+ /** Batch of log entries sent from NAISYS instance to hub */
47
+ export declare const LogWriteRequestSchema: z.ZodObject<{
48
+ entries: z.ZodArray<z.ZodObject<{
49
+ userId: z.ZodNumber;
50
+ runId: z.ZodNumber;
51
+ sessionId: z.ZodNumber;
52
+ role: z.ZodEnum<{
53
+ NAISYS: "NAISYS";
54
+ LLM: "LLM";
55
+ }>;
56
+ source: z.ZodNullable<z.ZodEnum<{
57
+ console: "console";
58
+ startPrompt: "startPrompt";
59
+ endPrompt: "endPrompt";
60
+ llm: "llm";
61
+ }>>;
62
+ type: z.ZodNullable<z.ZodEnum<{
63
+ error: "error";
64
+ comment: "comment";
65
+ system: "system";
66
+ tool: "tool";
67
+ }>>;
68
+ message: z.ZodString;
69
+ createdAt: z.ZodString;
70
+ attachmentId: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$strip>;
73
+ export type LogWriteRequest = z.infer<typeof LogWriteRequestSchema>;
74
+ /** A single log entry pushed from hub to supervisor (includes DB-assigned ID) */
75
+ export declare const LogPushEntrySchema: z.ZodObject<{
76
+ id: z.ZodNumber;
77
+ previousId: z.ZodNullable<z.ZodNumber>;
78
+ userId: z.ZodNumber;
79
+ runId: z.ZodNumber;
80
+ sessionId: z.ZodNumber;
81
+ role: z.ZodEnum<{
82
+ NAISYS: "NAISYS";
83
+ LLM: "LLM";
84
+ }>;
85
+ source: z.ZodNullable<z.ZodEnum<{
86
+ console: "console";
87
+ startPrompt: "startPrompt";
88
+ endPrompt: "endPrompt";
89
+ llm: "llm";
90
+ }>>;
91
+ type: z.ZodNullable<z.ZodEnum<{
92
+ error: "error";
93
+ comment: "comment";
94
+ system: "system";
95
+ tool: "tool";
96
+ }>>;
97
+ message: z.ZodString;
98
+ createdAt: z.ZodString;
99
+ attachmentId: z.ZodOptional<z.ZodString>;
100
+ attachmentFilename: z.ZodOptional<z.ZodString>;
101
+ attachmentFileSize: z.ZodOptional<z.ZodNumber>;
102
+ }, z.core.$strip>;
103
+ export type LogPushEntry = z.infer<typeof LogPushEntrySchema>;
104
+ /** Session delta included with log pushes */
105
+ export declare const LogPushSessionUpdateSchema: z.ZodObject<{
106
+ userId: z.ZodNumber;
107
+ runId: z.ZodNumber;
108
+ sessionId: z.ZodNumber;
109
+ lastActive: z.ZodString;
110
+ latestLogId: z.ZodNumber;
111
+ totalLinesDelta: z.ZodNumber;
112
+ }, z.core.$strip>;
113
+ export type LogPushSessionUpdate = z.infer<typeof LogPushSessionUpdateSchema>;
114
+ /** Full-data log push from hub to supervisor */
115
+ export declare const LogPushSchema: z.ZodObject<{
116
+ entries: z.ZodArray<z.ZodObject<{
117
+ id: z.ZodNumber;
118
+ previousId: z.ZodNullable<z.ZodNumber>;
119
+ userId: z.ZodNumber;
120
+ runId: z.ZodNumber;
121
+ sessionId: z.ZodNumber;
122
+ role: z.ZodEnum<{
123
+ NAISYS: "NAISYS";
124
+ LLM: "LLM";
125
+ }>;
126
+ source: z.ZodNullable<z.ZodEnum<{
127
+ console: "console";
128
+ startPrompt: "startPrompt";
129
+ endPrompt: "endPrompt";
130
+ llm: "llm";
131
+ }>>;
132
+ type: z.ZodNullable<z.ZodEnum<{
133
+ error: "error";
134
+ comment: "comment";
135
+ system: "system";
136
+ tool: "tool";
137
+ }>>;
138
+ message: z.ZodString;
139
+ createdAt: z.ZodString;
140
+ attachmentId: z.ZodOptional<z.ZodString>;
141
+ attachmentFilename: z.ZodOptional<z.ZodString>;
142
+ attachmentFileSize: z.ZodOptional<z.ZodNumber>;
143
+ }, z.core.$strip>>;
144
+ sessionUpdates: z.ZodArray<z.ZodObject<{
145
+ userId: z.ZodNumber;
146
+ runId: z.ZodNumber;
147
+ sessionId: z.ZodNumber;
148
+ lastActive: z.ZodString;
149
+ latestLogId: z.ZodNumber;
150
+ totalLinesDelta: z.ZodNumber;
151
+ }, z.core.$strip>>;
152
+ }, z.core.$strip>;
153
+ export type LogPush = z.infer<typeof LogPushSchema>;
154
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ /** How often NAISYS instances flush buffered log entries to the hub (ms) */
3
+ export const LOG_FLUSH_INTERVAL_MS = 100;
4
+ export const LogRoleEnum = z.enum(["NAISYS", "LLM"]);
5
+ export const LogSourceEnum = z.enum([
6
+ "startPrompt",
7
+ "endPrompt",
8
+ "console",
9
+ "llm",
10
+ ]);
11
+ export const LogTypeEnum = z.enum(["comment", "error", "system", "tool"]);
12
+ /** A single log entry sent from NAISYS instance to hub */
13
+ export const LogWriteEntrySchema = z.object({
14
+ userId: z.number(),
15
+ runId: z.number(),
16
+ sessionId: z.number(),
17
+ role: LogRoleEnum,
18
+ source: LogSourceEnum.nullable(),
19
+ type: LogTypeEnum.nullable(),
20
+ message: z.string(),
21
+ createdAt: z.string(),
22
+ attachmentId: z.number().optional(),
23
+ });
24
+ /** Batch of log entries sent from NAISYS instance to hub */
25
+ export const LogWriteRequestSchema = z.object({
26
+ entries: z.array(LogWriteEntrySchema),
27
+ });
28
+ /** A single log entry pushed from hub to supervisor (includes DB-assigned ID) */
29
+ export const LogPushEntrySchema = z.object({
30
+ id: z.number(),
31
+ /** ID of the previous log entry for this session, null if unknown (e.g. hub restart) */
32
+ previousId: z.number().nullable(),
33
+ userId: z.number(),
34
+ runId: z.number(),
35
+ sessionId: z.number(),
36
+ role: LogRoleEnum,
37
+ source: LogSourceEnum.nullable(),
38
+ type: LogTypeEnum.nullable(),
39
+ message: z.string(),
40
+ createdAt: z.string(),
41
+ attachmentId: z.string().optional(),
42
+ attachmentFilename: z.string().optional(),
43
+ attachmentFileSize: z.number().optional(),
44
+ });
45
+ /** Session delta included with log pushes */
46
+ export const LogPushSessionUpdateSchema = z.object({
47
+ userId: z.number(),
48
+ runId: z.number(),
49
+ sessionId: z.number(),
50
+ lastActive: z.string(),
51
+ latestLogId: z.number(),
52
+ totalLinesDelta: z.number(),
53
+ });
54
+ /** Full-data log push from hub to supervisor */
55
+ export const LogPushSchema = z.object({
56
+ entries: z.array(LogPushEntrySchema),
57
+ sessionUpdates: z.array(LogPushSessionUpdateSchema),
58
+ });
@@ -0,0 +1,261 @@
1
+ import { z } from "zod";
2
+ export declare const MessageKindSchema: z.ZodEnum<{
3
+ mail: "mail";
4
+ chat: "chat";
5
+ }>;
6
+ export type MessageKind = z.infer<typeof MessageKindSchema>;
7
+ export declare const AttachmentPurposeEnum: z.ZodEnum<{
8
+ mail: "mail";
9
+ context: "context";
10
+ }>;
11
+ export type AttachmentPurpose = z.infer<typeof AttachmentPurposeEnum>;
12
+ /** Request to send a mail message */
13
+ export declare const MailSendRequestSchema: z.ZodObject<{
14
+ fromUserId: z.ZodNumber;
15
+ toUserIds: z.ZodArray<z.ZodNumber>;
16
+ subject: z.ZodString;
17
+ body: z.ZodString;
18
+ kind: z.ZodEnum<{
19
+ mail: "mail";
20
+ chat: "chat";
21
+ }>;
22
+ attachmentIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
23
+ }, z.core.$strip>;
24
+ export type MailSendRequest = z.infer<typeof MailSendRequestSchema>;
25
+ /** Response to mail send request */
26
+ export declare const MailSendResponseSchema: z.ZodObject<{
27
+ success: z.ZodBoolean;
28
+ error: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ export type MailSendResponse = z.infer<typeof MailSendResponseSchema>;
31
+ /** Request to list mail messages */
32
+ export declare const MailListRequestSchema: z.ZodObject<{
33
+ userId: z.ZodNumber;
34
+ filter: z.ZodOptional<z.ZodEnum<{
35
+ received: "received";
36
+ sent: "sent";
37
+ }>>;
38
+ kind: z.ZodEnum<{
39
+ mail: "mail";
40
+ chat: "chat";
41
+ }>;
42
+ skip: z.ZodOptional<z.ZodNumber>;
43
+ take: z.ZodOptional<z.ZodNumber>;
44
+ withUserIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
45
+ }, z.core.$strip>;
46
+ export type MailListRequest = z.infer<typeof MailListRequestSchema>;
47
+ /** Attachment metadata included in message responses */
48
+ export declare const MailAttachmentDataSchema: z.ZodObject<{
49
+ id: z.ZodString;
50
+ filename: z.ZodString;
51
+ fileSize: z.ZodNumber;
52
+ }, z.core.$strip>;
53
+ export type MailAttachmentData = z.infer<typeof MailAttachmentDataSchema>;
54
+ /** A single message in a mail list response */
55
+ export declare const MailListMessageDataSchema: z.ZodObject<{
56
+ id: z.ZodNumber;
57
+ fromUsername: z.ZodString;
58
+ fromTitle: z.ZodString;
59
+ recipientUsernames: z.ZodArray<z.ZodString>;
60
+ subject: z.ZodString;
61
+ createdAt: z.ZodString;
62
+ isUnread: z.ZodBoolean;
63
+ body: z.ZodOptional<z.ZodString>;
64
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
65
+ id: z.ZodString;
66
+ filename: z.ZodString;
67
+ fileSize: z.ZodNumber;
68
+ }, z.core.$strip>>>;
69
+ }, z.core.$strip>;
70
+ export type MailListMessageData = z.infer<typeof MailListMessageDataSchema>;
71
+ /** Response to mail list request */
72
+ export declare const MailListResponseSchema: z.ZodObject<{
73
+ success: z.ZodBoolean;
74
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
75
+ id: z.ZodNumber;
76
+ fromUsername: z.ZodString;
77
+ fromTitle: z.ZodString;
78
+ recipientUsernames: z.ZodArray<z.ZodString>;
79
+ subject: z.ZodString;
80
+ createdAt: z.ZodString;
81
+ isUnread: z.ZodBoolean;
82
+ body: z.ZodOptional<z.ZodString>;
83
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
+ id: z.ZodString;
85
+ filename: z.ZodString;
86
+ fileSize: z.ZodNumber;
87
+ }, z.core.$strip>>>;
88
+ }, z.core.$strip>>>;
89
+ error: z.ZodOptional<z.ZodString>;
90
+ }, z.core.$strip>;
91
+ export type MailListResponse = z.infer<typeof MailListResponseSchema>;
92
+ /** Request to peek at a specific mail message */
93
+ export declare const MailPeekRequestSchema: z.ZodObject<{
94
+ userId: z.ZodNumber;
95
+ messageId: z.ZodNumber;
96
+ }, z.core.$strip>;
97
+ export type MailPeekRequest = z.infer<typeof MailPeekRequestSchema>;
98
+ /** Full message data returned when fetching a message */
99
+ export declare const MailMessageDataSchema: z.ZodObject<{
100
+ id: z.ZodNumber;
101
+ subject: z.ZodString;
102
+ fromUsername: z.ZodString;
103
+ fromTitle: z.ZodString;
104
+ recipientUsernames: z.ZodArray<z.ZodString>;
105
+ createdAt: z.ZodString;
106
+ body: z.ZodString;
107
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
108
+ id: z.ZodString;
109
+ filename: z.ZodString;
110
+ fileSize: z.ZodNumber;
111
+ }, z.core.$strip>>>;
112
+ }, z.core.$strip>;
113
+ export type MailMessageData = z.infer<typeof MailMessageDataSchema>;
114
+ /** Response to mail peek request */
115
+ export declare const MailPeekResponseSchema: z.ZodObject<{
116
+ success: z.ZodBoolean;
117
+ message: z.ZodOptional<z.ZodObject<{
118
+ id: z.ZodNumber;
119
+ subject: z.ZodString;
120
+ fromUsername: z.ZodString;
121
+ fromTitle: z.ZodString;
122
+ recipientUsernames: z.ZodArray<z.ZodString>;
123
+ createdAt: z.ZodString;
124
+ body: z.ZodString;
125
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
126
+ id: z.ZodString;
127
+ filename: z.ZodString;
128
+ fileSize: z.ZodNumber;
129
+ }, z.core.$strip>>>;
130
+ }, z.core.$strip>>;
131
+ error: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>;
133
+ export type MailPeekResponse = z.infer<typeof MailPeekResponseSchema>;
134
+ /** Request to archive mail messages */
135
+ export declare const MailArchiveRequestSchema: z.ZodObject<{
136
+ userId: z.ZodNumber;
137
+ messageIds: z.ZodArray<z.ZodNumber>;
138
+ }, z.core.$strip>;
139
+ export type MailArchiveRequest = z.infer<typeof MailArchiveRequestSchema>;
140
+ /** Response to mail archive request */
141
+ export declare const MailArchiveResponseSchema: z.ZodObject<{
142
+ success: z.ZodBoolean;
143
+ archivedIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
144
+ error: z.ZodOptional<z.ZodString>;
145
+ }, z.core.$strip>;
146
+ export type MailArchiveResponse = z.infer<typeof MailArchiveResponseSchema>;
147
+ /** Request to search mail messages */
148
+ export declare const MailSearchRequestSchema: z.ZodObject<{
149
+ userId: z.ZodNumber;
150
+ terms: z.ZodString;
151
+ includeArchived: z.ZodOptional<z.ZodBoolean>;
152
+ subjectOnly: z.ZodOptional<z.ZodBoolean>;
153
+ }, z.core.$strip>;
154
+ export type MailSearchRequest = z.infer<typeof MailSearchRequestSchema>;
155
+ /** A single message in a mail search response */
156
+ export declare const MailSearchMessageDataSchema: z.ZodObject<{
157
+ id: z.ZodNumber;
158
+ subject: z.ZodString;
159
+ fromUsername: z.ZodString;
160
+ createdAt: z.ZodString;
161
+ }, z.core.$strip>;
162
+ export type MailSearchMessageData = z.infer<typeof MailSearchMessageDataSchema>;
163
+ /** Response to mail search request */
164
+ export declare const MailSearchResponseSchema: z.ZodObject<{
165
+ success: z.ZodBoolean;
166
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
167
+ id: z.ZodNumber;
168
+ subject: z.ZodString;
169
+ fromUsername: z.ZodString;
170
+ createdAt: z.ZodString;
171
+ }, z.core.$strip>>>;
172
+ error: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strip>;
174
+ export type MailSearchResponse = z.infer<typeof MailSearchResponseSchema>;
175
+ /** Request to mark messages as read */
176
+ export declare const MailMarkReadRequestSchema: z.ZodObject<{
177
+ userId: z.ZodNumber;
178
+ messageIds: z.ZodArray<z.ZodNumber>;
179
+ kind: z.ZodEnum<{
180
+ mail: "mail";
181
+ chat: "chat";
182
+ }>;
183
+ }, z.core.$strip>;
184
+ export type MailMarkReadRequest = z.infer<typeof MailMarkReadRequestSchema>;
185
+ /** Response to mark-read request */
186
+ export declare const MailMarkReadResponseSchema: z.ZodObject<{
187
+ success: z.ZodBoolean;
188
+ error: z.ZodOptional<z.ZodString>;
189
+ }, z.core.$strip>;
190
+ export type MailMarkReadResponse = z.infer<typeof MailMarkReadResponseSchema>;
191
+ /** Request to get unread messages */
192
+ export declare const MailUnreadRequestSchema: z.ZodObject<{
193
+ userId: z.ZodNumber;
194
+ kind: z.ZodEnum<{
195
+ mail: "mail";
196
+ chat: "chat";
197
+ }>;
198
+ afterId: z.ZodOptional<z.ZodNumber>;
199
+ }, z.core.$strip>;
200
+ export type MailUnreadRequest = z.infer<typeof MailUnreadRequestSchema>;
201
+ /** Response to unread messages request */
202
+ export declare const MailUnreadResponseSchema: z.ZodObject<{
203
+ success: z.ZodBoolean;
204
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
205
+ id: z.ZodNumber;
206
+ subject: z.ZodString;
207
+ fromUsername: z.ZodString;
208
+ fromTitle: z.ZodString;
209
+ recipientUsernames: z.ZodArray<z.ZodString>;
210
+ createdAt: z.ZodString;
211
+ body: z.ZodString;
212
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
213
+ id: z.ZodString;
214
+ filename: z.ZodString;
215
+ fileSize: z.ZodNumber;
216
+ }, z.core.$strip>>>;
217
+ }, z.core.$strip>>>;
218
+ error: z.ZodOptional<z.ZodString>;
219
+ }, z.core.$strip>;
220
+ export type MailUnreadResponse = z.infer<typeof MailUnreadResponseSchema>;
221
+ /** Push notification from hub to NAISYS when mail is received */
222
+ export declare const MailReceivedPushSchema: z.ZodObject<{
223
+ recipientUserIds: z.ZodArray<z.ZodNumber>;
224
+ kind: z.ZodEnum<{
225
+ mail: "mail";
226
+ chat: "chat";
227
+ }>;
228
+ }, z.core.$strip>;
229
+ export type MailReceivedPush = z.infer<typeof MailReceivedPushSchema>;
230
+ /** Full-data mail/chat push from hub to supervisor after DB write */
231
+ export declare const MailPushSchema: z.ZodObject<{
232
+ recipientUserIds: z.ZodArray<z.ZodNumber>;
233
+ fromUserId: z.ZodNumber;
234
+ kind: z.ZodEnum<{
235
+ mail: "mail";
236
+ chat: "chat";
237
+ }>;
238
+ messageId: z.ZodNumber;
239
+ subject: z.ZodOptional<z.ZodString>;
240
+ body: z.ZodString;
241
+ createdAt: z.ZodString;
242
+ participants: z.ZodString;
243
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
244
+ id: z.ZodString;
245
+ filename: z.ZodString;
246
+ fileSize: z.ZodNumber;
247
+ }, z.core.$strip>>>;
248
+ }, z.core.$strip>;
249
+ export type MailPush = z.infer<typeof MailPushSchema>;
250
+ /** Read-receipt push from hub to supervisor when messages are marked read */
251
+ export declare const MailReadPushSchema: z.ZodObject<{
252
+ messageIds: z.ZodArray<z.ZodNumber>;
253
+ userId: z.ZodNumber;
254
+ kind: z.ZodEnum<{
255
+ mail: "mail";
256
+ chat: "chat";
257
+ }>;
258
+ participants: z.ZodArray<z.ZodString>;
259
+ }, z.core.$strip>;
260
+ export type MailReadPush = z.infer<typeof MailReadPushSchema>;
261
+ //# sourceMappingURL=mail.d.ts.map