@rine-network/sdk 0.1.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.
- package/CHANGELOG.md +96 -0
- package/LICENSE +291 -0
- package/README.md +127 -0
- package/dist/_parity.d.ts +34 -0
- package/dist/agent.d.ts +115 -0
- package/dist/api/adapters.d.ts +47 -0
- package/dist/api/http.d.ts +164 -0
- package/dist/api/middleware.d.ts +100 -0
- package/dist/client.d.ts +523 -0
- package/dist/errors.d.ts +80 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +3028 -0
- package/dist/onboard.d.ts +40 -0
- package/dist/resources/conversation.d.ts +111 -0
- package/dist/resources/decrypt.d.ts +44 -0
- package/dist/resources/discovery.d.ts +66 -0
- package/dist/resources/groups.d.ts +146 -0
- package/dist/resources/identity.d.ts +272 -0
- package/dist/resources/messages.d.ts +110 -0
- package/dist/resources/polling.d.ts +43 -0
- package/dist/resources/streams.d.ts +50 -0
- package/dist/resources/webhooks.d.ts +92 -0
- package/dist/types.d.ts +1362 -0
- package/dist/utils/abort.d.ts +40 -0
- package/dist/utils/cursor-page.d.ts +23 -0
- package/dist/utils/schema.d.ts +58 -0
- package/dist/utils/seen-ids.d.ts +23 -0
- package/dist/utils/sleep.d.ts +10 -0
- package/dist/utils/sse.d.ts +28 -0
- package/package.json +70 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,1362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded domain types + Zod schemas co-located.
|
|
3
|
+
*
|
|
4
|
+
* Branded types prevent mixing handles, UUIDs, and group IDs at compile time.
|
|
5
|
+
* Zod schemas serve as single source of truth for both runtime parsing and
|
|
6
|
+
* static type inference (via `z.infer<typeof schema>`).
|
|
7
|
+
*
|
|
8
|
+
* NOTE: All datetime fields use ISO-8601 strings (not Date objects) to match
|
|
9
|
+
* the Python SDK's Pydantic datetime serialisation and the API wire format.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
declare const BrandSymbol: unique symbol;
|
|
13
|
+
type Brand<T, B extends string = string> = T & {
|
|
14
|
+
readonly [BrandSymbol]: B;
|
|
15
|
+
};
|
|
16
|
+
/** Agent UUID — e.g. "550e8400-e29b-41d4-a716-446655440000" */
|
|
17
|
+
export type AgentUuid = Brand<string, "AgentUuid">;
|
|
18
|
+
/** Group UUID */
|
|
19
|
+
export type GroupUuid = Brand<string, "GroupUuid">;
|
|
20
|
+
/** Message UUID */
|
|
21
|
+
export type MessageUuid = Brand<string, "MessageUuid">;
|
|
22
|
+
/** Organisation UUID */
|
|
23
|
+
export type OrgUuid = Brand<string, "OrgUuid">;
|
|
24
|
+
/** Webhook UUID */
|
|
25
|
+
export type WebhookUuid = Brand<string, "WebhookUuid">;
|
|
26
|
+
/** Agent handle — e.g. "bot@acme.rine.network" */
|
|
27
|
+
export type AgentHandle = Brand<string, "AgentHandle">;
|
|
28
|
+
/** Group handle — e.g. "#my-group@acme.rine.network" */
|
|
29
|
+
export type GroupHandle = Brand<string, "GroupHandle">;
|
|
30
|
+
export declare const UUID_RE: RegExp;
|
|
31
|
+
export declare function isAgentHandle(s: string): s is AgentHandle;
|
|
32
|
+
export declare function isGroupHandle(s: string): s is GroupHandle;
|
|
33
|
+
export declare function asAgentUuid(s: string): AgentUuid;
|
|
34
|
+
export declare function asGroupUuid(s: string): GroupUuid;
|
|
35
|
+
export declare function asMessageUuid(s: string): MessageUuid;
|
|
36
|
+
export declare function asOrgUuid(s: string): OrgUuid;
|
|
37
|
+
export declare function asWebhookUuid(s: string): WebhookUuid;
|
|
38
|
+
/**
|
|
39
|
+
* Canonical rine message type strings. Derived from `PROTOCOL.md §458-474`
|
|
40
|
+
* and the Python SDK constants (`rine-sdk/src/rine/_constants.py:48`).
|
|
41
|
+
*
|
|
42
|
+
* Use these rather than raw strings — IDE autocomplete + compile-time
|
|
43
|
+
* validation + no typo-drift between consumers.
|
|
44
|
+
*/
|
|
45
|
+
export declare const MessageType: {
|
|
46
|
+
readonly Dm: "rine.v1.dm";
|
|
47
|
+
readonly TaskRequest: "rine.v1.task_request";
|
|
48
|
+
readonly TaskResponse: "rine.v1.task_response";
|
|
49
|
+
readonly StatusUpdate: "rine.v1.status_update";
|
|
50
|
+
readonly Negotiation: "rine.v1.negotiation";
|
|
51
|
+
readonly Receipt: "rine.v1.receipt";
|
|
52
|
+
readonly ErrorNotice: "rine.v1.error";
|
|
53
|
+
readonly CapabilityQuery: "rine.v1.capability_query";
|
|
54
|
+
readonly CapabilityResponse: "rine.v1.capability_response";
|
|
55
|
+
readonly PaymentRequest: "rine.v1.payment_request";
|
|
56
|
+
readonly PaymentConfirmation: "rine.v1.payment_confirmation";
|
|
57
|
+
readonly ConsentRequest: "rine.v1.consent_request";
|
|
58
|
+
readonly ConsentGrant: "rine.v1.consent_grant";
|
|
59
|
+
readonly ConsentRevoke: "rine.v1.consent_revoke";
|
|
60
|
+
readonly IdentityVerification: "rine.v1.identity_verification";
|
|
61
|
+
readonly SenderKeyDistribution: "rine.v1.sender_key_distribution";
|
|
62
|
+
readonly SenderKeyRequest: "rine.v1.sender_key_request";
|
|
63
|
+
readonly GroupInvite: "rine.v1.group_invite";
|
|
64
|
+
readonly Text: "rine.v1.text";
|
|
65
|
+
readonly A2AMessage: "a2a.v1.message";
|
|
66
|
+
};
|
|
67
|
+
/** Union of the canonical `MessageType.*` values. */
|
|
68
|
+
export type KnownMessageType = (typeof MessageType)[keyof typeof MessageType];
|
|
69
|
+
/**
|
|
70
|
+
* `MessageType` with an escape hatch for namespaced custom types. The
|
|
71
|
+
* `string & {}` trick preserves autocomplete for the canonical union while
|
|
72
|
+
* still accepting any other string — matching SPEC §7.2 / §10.9 exactly.
|
|
73
|
+
*/
|
|
74
|
+
export type MessageTypeString = KnownMessageType | (string & {});
|
|
75
|
+
export declare const ConversationStatus: {
|
|
76
|
+
readonly Submitted: "submitted";
|
|
77
|
+
readonly Open: "open";
|
|
78
|
+
readonly Paused: "paused";
|
|
79
|
+
readonly InputRequired: "input_required";
|
|
80
|
+
readonly Completed: "completed";
|
|
81
|
+
readonly Rejected: "rejected";
|
|
82
|
+
readonly Canceled: "canceled";
|
|
83
|
+
readonly Failed: "failed";
|
|
84
|
+
};
|
|
85
|
+
export type ConversationStatusString = (typeof ConversationStatus)[keyof typeof ConversationStatus];
|
|
86
|
+
export declare const JoinRequestStatus: {
|
|
87
|
+
readonly Pending: "pending";
|
|
88
|
+
readonly Approved: "approved";
|
|
89
|
+
readonly Denied: "denied";
|
|
90
|
+
readonly Expired: "expired";
|
|
91
|
+
};
|
|
92
|
+
export type JoinRequestStatusString = (typeof JoinRequestStatus)[keyof typeof JoinRequestStatus];
|
|
93
|
+
export declare const VoteChoice: {
|
|
94
|
+
readonly Approve: "approve";
|
|
95
|
+
readonly Deny: "deny";
|
|
96
|
+
};
|
|
97
|
+
export type VoteChoiceString = (typeof VoteChoice)[keyof typeof VoteChoice];
|
|
98
|
+
export declare const WebhookJobStatus: {
|
|
99
|
+
readonly Pending: "pending";
|
|
100
|
+
readonly Processing: "processing";
|
|
101
|
+
readonly Delivered: "delivered";
|
|
102
|
+
readonly Failed: "failed";
|
|
103
|
+
readonly Dead: "dead";
|
|
104
|
+
};
|
|
105
|
+
export type WebhookJobStatusString = (typeof WebhookJobStatus)[keyof typeof WebhookJobStatus];
|
|
106
|
+
export declare const EncryptionVersion: {
|
|
107
|
+
readonly HpkeV1: "hpke-v1";
|
|
108
|
+
readonly SenderKeyV1: "sender-key-v1";
|
|
109
|
+
};
|
|
110
|
+
export type EncryptionVersionString = (typeof EncryptionVersion)[keyof typeof EncryptionVersion];
|
|
111
|
+
/** Validate a custom message type against the server-side regex. */
|
|
112
|
+
export declare function isValidMessageType(s: string): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Message types the E2EE layer consumes internally and that must NEVER
|
|
115
|
+
* surface to user code. Enforced by `client.messages()` and `defineAgent`
|
|
116
|
+
* via the `includeReserved` debug escape hatch (SPEC D6d).
|
|
117
|
+
*/
|
|
118
|
+
export declare const RESERVED_MESSAGE_TYPES: ReadonlySet<MessageTypeString>;
|
|
119
|
+
export declare const OrgReadSchema: z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
contact_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
country_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
trust_tier: z.ZodDefault<z.ZodNumber>;
|
|
126
|
+
agent_count: z.ZodDefault<z.ZodNumber>;
|
|
127
|
+
created_at: z.ZodString;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
trust_tier: number;
|
|
132
|
+
agent_count: number;
|
|
133
|
+
created_at: string;
|
|
134
|
+
slug?: string | null | undefined;
|
|
135
|
+
contact_email?: string | null | undefined;
|
|
136
|
+
country_code?: string | null | undefined;
|
|
137
|
+
}, {
|
|
138
|
+
id: string;
|
|
139
|
+
name: string;
|
|
140
|
+
created_at: string;
|
|
141
|
+
slug?: string | null | undefined;
|
|
142
|
+
contact_email?: string | null | undefined;
|
|
143
|
+
country_code?: string | null | undefined;
|
|
144
|
+
trust_tier?: number | undefined;
|
|
145
|
+
agent_count?: number | undefined;
|
|
146
|
+
}>;
|
|
147
|
+
export type OrgRead = z.infer<typeof OrgReadSchema>;
|
|
148
|
+
export declare const AgentReadSchema: z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
handle: z.ZodString;
|
|
152
|
+
human_oversight: z.ZodDefault<z.ZodBoolean>;
|
|
153
|
+
incoming_policy: z.ZodDefault<z.ZodString>;
|
|
154
|
+
outgoing_policy: z.ZodDefault<z.ZodString>;
|
|
155
|
+
created_at: z.ZodString;
|
|
156
|
+
revoked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
157
|
+
unlisted: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
verification_words: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
159
|
+
warnings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
160
|
+
poll_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
created_at: string;
|
|
165
|
+
handle: string;
|
|
166
|
+
human_oversight: boolean;
|
|
167
|
+
incoming_policy: string;
|
|
168
|
+
outgoing_policy: string;
|
|
169
|
+
revoked_at?: string | null | undefined;
|
|
170
|
+
unlisted?: boolean | undefined;
|
|
171
|
+
verification_words?: string | null | undefined;
|
|
172
|
+
warnings?: string[] | null | undefined;
|
|
173
|
+
poll_url?: string | null | undefined;
|
|
174
|
+
}, {
|
|
175
|
+
id: string;
|
|
176
|
+
name: string;
|
|
177
|
+
created_at: string;
|
|
178
|
+
handle: string;
|
|
179
|
+
human_oversight?: boolean | undefined;
|
|
180
|
+
incoming_policy?: string | undefined;
|
|
181
|
+
outgoing_policy?: string | undefined;
|
|
182
|
+
revoked_at?: string | null | undefined;
|
|
183
|
+
unlisted?: boolean | undefined;
|
|
184
|
+
verification_words?: string | null | undefined;
|
|
185
|
+
warnings?: string[] | null | undefined;
|
|
186
|
+
poll_url?: string | null | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
export type AgentRead = z.infer<typeof AgentReadSchema>;
|
|
189
|
+
export declare const WhoAmISchema: z.ZodObject<{
|
|
190
|
+
org: z.ZodObject<{
|
|
191
|
+
id: z.ZodString;
|
|
192
|
+
name: z.ZodString;
|
|
193
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
contact_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
country_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
trust_tier: z.ZodDefault<z.ZodNumber>;
|
|
197
|
+
agent_count: z.ZodDefault<z.ZodNumber>;
|
|
198
|
+
created_at: z.ZodString;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
id: string;
|
|
201
|
+
name: string;
|
|
202
|
+
trust_tier: number;
|
|
203
|
+
agent_count: number;
|
|
204
|
+
created_at: string;
|
|
205
|
+
slug?: string | null | undefined;
|
|
206
|
+
contact_email?: string | null | undefined;
|
|
207
|
+
country_code?: string | null | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
id: string;
|
|
210
|
+
name: string;
|
|
211
|
+
created_at: string;
|
|
212
|
+
slug?: string | null | undefined;
|
|
213
|
+
contact_email?: string | null | undefined;
|
|
214
|
+
country_code?: string | null | undefined;
|
|
215
|
+
trust_tier?: number | undefined;
|
|
216
|
+
agent_count?: number | undefined;
|
|
217
|
+
}>;
|
|
218
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
handle: z.ZodString;
|
|
222
|
+
human_oversight: z.ZodDefault<z.ZodBoolean>;
|
|
223
|
+
incoming_policy: z.ZodDefault<z.ZodString>;
|
|
224
|
+
outgoing_policy: z.ZodDefault<z.ZodString>;
|
|
225
|
+
created_at: z.ZodString;
|
|
226
|
+
revoked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
unlisted: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
verification_words: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
warnings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
230
|
+
poll_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
id: string;
|
|
233
|
+
name: string;
|
|
234
|
+
created_at: string;
|
|
235
|
+
handle: string;
|
|
236
|
+
human_oversight: boolean;
|
|
237
|
+
incoming_policy: string;
|
|
238
|
+
outgoing_policy: string;
|
|
239
|
+
revoked_at?: string | null | undefined;
|
|
240
|
+
unlisted?: boolean | undefined;
|
|
241
|
+
verification_words?: string | null | undefined;
|
|
242
|
+
warnings?: string[] | null | undefined;
|
|
243
|
+
poll_url?: string | null | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
created_at: string;
|
|
248
|
+
handle: string;
|
|
249
|
+
human_oversight?: boolean | undefined;
|
|
250
|
+
incoming_policy?: string | undefined;
|
|
251
|
+
outgoing_policy?: string | undefined;
|
|
252
|
+
revoked_at?: string | null | undefined;
|
|
253
|
+
unlisted?: boolean | undefined;
|
|
254
|
+
verification_words?: string | null | undefined;
|
|
255
|
+
warnings?: string[] | null | undefined;
|
|
256
|
+
poll_url?: string | null | undefined;
|
|
257
|
+
}>, "many">;
|
|
258
|
+
trust_tier: z.ZodDefault<z.ZodNumber>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
trust_tier: number;
|
|
261
|
+
org: {
|
|
262
|
+
id: string;
|
|
263
|
+
name: string;
|
|
264
|
+
trust_tier: number;
|
|
265
|
+
agent_count: number;
|
|
266
|
+
created_at: string;
|
|
267
|
+
slug?: string | null | undefined;
|
|
268
|
+
contact_email?: string | null | undefined;
|
|
269
|
+
country_code?: string | null | undefined;
|
|
270
|
+
};
|
|
271
|
+
agents: {
|
|
272
|
+
id: string;
|
|
273
|
+
name: string;
|
|
274
|
+
created_at: string;
|
|
275
|
+
handle: string;
|
|
276
|
+
human_oversight: boolean;
|
|
277
|
+
incoming_policy: string;
|
|
278
|
+
outgoing_policy: string;
|
|
279
|
+
revoked_at?: string | null | undefined;
|
|
280
|
+
unlisted?: boolean | undefined;
|
|
281
|
+
verification_words?: string | null | undefined;
|
|
282
|
+
warnings?: string[] | null | undefined;
|
|
283
|
+
poll_url?: string | null | undefined;
|
|
284
|
+
}[];
|
|
285
|
+
}, {
|
|
286
|
+
org: {
|
|
287
|
+
id: string;
|
|
288
|
+
name: string;
|
|
289
|
+
created_at: string;
|
|
290
|
+
slug?: string | null | undefined;
|
|
291
|
+
contact_email?: string | null | undefined;
|
|
292
|
+
country_code?: string | null | undefined;
|
|
293
|
+
trust_tier?: number | undefined;
|
|
294
|
+
agent_count?: number | undefined;
|
|
295
|
+
};
|
|
296
|
+
agents: {
|
|
297
|
+
id: string;
|
|
298
|
+
name: string;
|
|
299
|
+
created_at: string;
|
|
300
|
+
handle: string;
|
|
301
|
+
human_oversight?: boolean | undefined;
|
|
302
|
+
incoming_policy?: string | undefined;
|
|
303
|
+
outgoing_policy?: string | undefined;
|
|
304
|
+
revoked_at?: string | null | undefined;
|
|
305
|
+
unlisted?: boolean | undefined;
|
|
306
|
+
verification_words?: string | null | undefined;
|
|
307
|
+
warnings?: string[] | null | undefined;
|
|
308
|
+
poll_url?: string | null | undefined;
|
|
309
|
+
}[];
|
|
310
|
+
trust_tier?: number | undefined;
|
|
311
|
+
}>;
|
|
312
|
+
export type WhoAmI = z.infer<typeof WhoAmISchema>;
|
|
313
|
+
export declare const MessageReadSchema: z.ZodObject<{
|
|
314
|
+
id: z.ZodString;
|
|
315
|
+
conversation_id: z.ZodString;
|
|
316
|
+
from_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
to_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
|
+
sender_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
319
|
+
recipient_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
320
|
+
type: z.ZodString;
|
|
321
|
+
encrypted_payload: z.ZodString;
|
|
322
|
+
encryption_version: z.ZodString;
|
|
323
|
+
sender_signing_kid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
324
|
+
content_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
326
|
+
created_at: z.ZodString;
|
|
327
|
+
delivered_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
read_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
329
|
+
group_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
330
|
+
group_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
331
|
+
}, "strip", z.ZodTypeAny, {
|
|
332
|
+
id: string;
|
|
333
|
+
created_at: string;
|
|
334
|
+
type: string;
|
|
335
|
+
conversation_id: string;
|
|
336
|
+
encrypted_payload: string;
|
|
337
|
+
encryption_version: string;
|
|
338
|
+
metadata: Record<string, unknown>;
|
|
339
|
+
from_agent_id?: string | null | undefined;
|
|
340
|
+
to_agent_id?: string | null | undefined;
|
|
341
|
+
sender_handle?: string | null | undefined;
|
|
342
|
+
recipient_handle?: string | null | undefined;
|
|
343
|
+
sender_signing_kid?: string | null | undefined;
|
|
344
|
+
content_type?: string | null | undefined;
|
|
345
|
+
delivered_at?: string | null | undefined;
|
|
346
|
+
read_at?: string | null | undefined;
|
|
347
|
+
group_id?: string | null | undefined;
|
|
348
|
+
group_handle?: string | null | undefined;
|
|
349
|
+
}, {
|
|
350
|
+
id: string;
|
|
351
|
+
created_at: string;
|
|
352
|
+
type: string;
|
|
353
|
+
conversation_id: string;
|
|
354
|
+
encrypted_payload: string;
|
|
355
|
+
encryption_version: string;
|
|
356
|
+
from_agent_id?: string | null | undefined;
|
|
357
|
+
to_agent_id?: string | null | undefined;
|
|
358
|
+
sender_handle?: string | null | undefined;
|
|
359
|
+
recipient_handle?: string | null | undefined;
|
|
360
|
+
sender_signing_kid?: string | null | undefined;
|
|
361
|
+
content_type?: string | null | undefined;
|
|
362
|
+
metadata?: Record<string, unknown> | undefined;
|
|
363
|
+
delivered_at?: string | null | undefined;
|
|
364
|
+
read_at?: string | null | undefined;
|
|
365
|
+
group_id?: string | null | undefined;
|
|
366
|
+
group_handle?: string | null | undefined;
|
|
367
|
+
}>;
|
|
368
|
+
export type MessageRead = z.infer<typeof MessageReadSchema>;
|
|
369
|
+
export declare const DecryptedMessageSchema: z.ZodObject<{
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
conversation_id: z.ZodString;
|
|
372
|
+
from_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
373
|
+
to_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
374
|
+
sender_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
375
|
+
recipient_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
376
|
+
type: z.ZodString;
|
|
377
|
+
encrypted_payload: z.ZodString;
|
|
378
|
+
encryption_version: z.ZodString;
|
|
379
|
+
sender_signing_kid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
|
+
content_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
382
|
+
created_at: z.ZodString;
|
|
383
|
+
delivered_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
384
|
+
read_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
385
|
+
group_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
386
|
+
group_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
387
|
+
} & {
|
|
388
|
+
plaintext: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
389
|
+
verified: z.ZodDefault<z.ZodBoolean>;
|
|
390
|
+
verification_status: z.ZodDefault<z.ZodEnum<["verified", "invalid", "unverifiable"]>>;
|
|
391
|
+
decrypt_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
392
|
+
}, "strip", z.ZodTypeAny, {
|
|
393
|
+
id: string;
|
|
394
|
+
created_at: string;
|
|
395
|
+
type: string;
|
|
396
|
+
conversation_id: string;
|
|
397
|
+
encrypted_payload: string;
|
|
398
|
+
encryption_version: string;
|
|
399
|
+
metadata: Record<string, unknown>;
|
|
400
|
+
verified: boolean;
|
|
401
|
+
verification_status: "verified" | "invalid" | "unverifiable";
|
|
402
|
+
from_agent_id?: string | null | undefined;
|
|
403
|
+
to_agent_id?: string | null | undefined;
|
|
404
|
+
sender_handle?: string | null | undefined;
|
|
405
|
+
recipient_handle?: string | null | undefined;
|
|
406
|
+
sender_signing_kid?: string | null | undefined;
|
|
407
|
+
content_type?: string | null | undefined;
|
|
408
|
+
delivered_at?: string | null | undefined;
|
|
409
|
+
read_at?: string | null | undefined;
|
|
410
|
+
group_id?: string | null | undefined;
|
|
411
|
+
group_handle?: string | null | undefined;
|
|
412
|
+
plaintext?: unknown;
|
|
413
|
+
decrypt_error?: string | null | undefined;
|
|
414
|
+
}, {
|
|
415
|
+
id: string;
|
|
416
|
+
created_at: string;
|
|
417
|
+
type: string;
|
|
418
|
+
conversation_id: string;
|
|
419
|
+
encrypted_payload: string;
|
|
420
|
+
encryption_version: string;
|
|
421
|
+
from_agent_id?: string | null | undefined;
|
|
422
|
+
to_agent_id?: string | null | undefined;
|
|
423
|
+
sender_handle?: string | null | undefined;
|
|
424
|
+
recipient_handle?: string | null | undefined;
|
|
425
|
+
sender_signing_kid?: string | null | undefined;
|
|
426
|
+
content_type?: string | null | undefined;
|
|
427
|
+
metadata?: Record<string, unknown> | undefined;
|
|
428
|
+
delivered_at?: string | null | undefined;
|
|
429
|
+
read_at?: string | null | undefined;
|
|
430
|
+
group_id?: string | null | undefined;
|
|
431
|
+
group_handle?: string | null | undefined;
|
|
432
|
+
plaintext?: unknown;
|
|
433
|
+
verified?: boolean | undefined;
|
|
434
|
+
verification_status?: "verified" | "invalid" | "unverifiable" | undefined;
|
|
435
|
+
decrypt_error?: string | null | undefined;
|
|
436
|
+
}>;
|
|
437
|
+
/**
|
|
438
|
+
* Decrypted message envelope. The `T` generic narrows `plaintext` end-to-end
|
|
439
|
+
* when a `StandardSchemaV1<T>` is supplied to `read<T>`, `messages<T>`,
|
|
440
|
+
* `sendAndWait<Req, Rep>`, `conversation(id).{messages,history}<T>`, or
|
|
441
|
+
* `defineAgent<T>` — SPEC §7.3 / §7.4 / §11.4.
|
|
442
|
+
*
|
|
443
|
+
* Default `T = unknown` forces callers to narrow before use. Without a
|
|
444
|
+
* schema the runtime plaintext is whatever rine-core's decrypt helpers
|
|
445
|
+
* returned (a string on the happy path, `null` when `decrypt_error` is
|
|
446
|
+
* populated) — the type stays `unknown` so callers can't blindly treat it
|
|
447
|
+
* as a specific shape without opting in.
|
|
448
|
+
*
|
|
449
|
+
* The Zod-inferred shape is preserved on `DecryptedMessage<unknown>` for
|
|
450
|
+
* all fields except `plaintext`, which is replaced with `T | null` so
|
|
451
|
+
* `msg.plaintext` is assignment-compatible with the user's validated
|
|
452
|
+
* output type.
|
|
453
|
+
*/
|
|
454
|
+
export type DecryptedMessage<T = unknown> = Omit<z.infer<typeof DecryptedMessageSchema>, "plaintext"> & {
|
|
455
|
+
plaintext?: T | null;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Wire-format Zod schema for `{ sent, reply }` — retained for symmetry with
|
|
459
|
+
* the other `*Schema` exports even though the resource layer no longer calls
|
|
460
|
+
* `parse(SendAndWaitResultSchema, …)` directly (Step 19 replaced that with
|
|
461
|
+
* an explicit object literal so the generic `Rep` narrowing could flow
|
|
462
|
+
* through). The hand-rolled `SendAndWaitResult<Rep>` below is the type
|
|
463
|
+
* `client.sendAndWait<Req, Rep>()` returns; the two are structurally
|
|
464
|
+
* equivalent at `Rep = unknown` but the Zod inference does not carry
|
|
465
|
+
* the generic, so consumers that want typed plaintext should rely on
|
|
466
|
+
* the function return type, not `z.infer<typeof SendAndWaitResultSchema>`.
|
|
467
|
+
*/
|
|
468
|
+
export declare const SendAndWaitResultSchema: z.ZodObject<{
|
|
469
|
+
sent: z.ZodObject<{
|
|
470
|
+
id: z.ZodString;
|
|
471
|
+
conversation_id: z.ZodString;
|
|
472
|
+
from_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
473
|
+
to_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
474
|
+
sender_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
475
|
+
recipient_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
476
|
+
type: z.ZodString;
|
|
477
|
+
encrypted_payload: z.ZodString;
|
|
478
|
+
encryption_version: z.ZodString;
|
|
479
|
+
sender_signing_kid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
480
|
+
content_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
481
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
482
|
+
created_at: z.ZodString;
|
|
483
|
+
delivered_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
484
|
+
read_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
485
|
+
group_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
486
|
+
group_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
487
|
+
}, "strip", z.ZodTypeAny, {
|
|
488
|
+
id: string;
|
|
489
|
+
created_at: string;
|
|
490
|
+
type: string;
|
|
491
|
+
conversation_id: string;
|
|
492
|
+
encrypted_payload: string;
|
|
493
|
+
encryption_version: string;
|
|
494
|
+
metadata: Record<string, unknown>;
|
|
495
|
+
from_agent_id?: string | null | undefined;
|
|
496
|
+
to_agent_id?: string | null | undefined;
|
|
497
|
+
sender_handle?: string | null | undefined;
|
|
498
|
+
recipient_handle?: string | null | undefined;
|
|
499
|
+
sender_signing_kid?: string | null | undefined;
|
|
500
|
+
content_type?: string | null | undefined;
|
|
501
|
+
delivered_at?: string | null | undefined;
|
|
502
|
+
read_at?: string | null | undefined;
|
|
503
|
+
group_id?: string | null | undefined;
|
|
504
|
+
group_handle?: string | null | undefined;
|
|
505
|
+
}, {
|
|
506
|
+
id: string;
|
|
507
|
+
created_at: string;
|
|
508
|
+
type: string;
|
|
509
|
+
conversation_id: string;
|
|
510
|
+
encrypted_payload: string;
|
|
511
|
+
encryption_version: string;
|
|
512
|
+
from_agent_id?: string | null | undefined;
|
|
513
|
+
to_agent_id?: string | null | undefined;
|
|
514
|
+
sender_handle?: string | null | undefined;
|
|
515
|
+
recipient_handle?: string | null | undefined;
|
|
516
|
+
sender_signing_kid?: string | null | undefined;
|
|
517
|
+
content_type?: string | null | undefined;
|
|
518
|
+
metadata?: Record<string, unknown> | undefined;
|
|
519
|
+
delivered_at?: string | null | undefined;
|
|
520
|
+
read_at?: string | null | undefined;
|
|
521
|
+
group_id?: string | null | undefined;
|
|
522
|
+
group_handle?: string | null | undefined;
|
|
523
|
+
}>;
|
|
524
|
+
reply: z.ZodNullable<z.ZodObject<{
|
|
525
|
+
id: z.ZodString;
|
|
526
|
+
conversation_id: z.ZodString;
|
|
527
|
+
from_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
528
|
+
to_agent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
529
|
+
sender_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
530
|
+
recipient_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
531
|
+
type: z.ZodString;
|
|
532
|
+
encrypted_payload: z.ZodString;
|
|
533
|
+
encryption_version: z.ZodString;
|
|
534
|
+
sender_signing_kid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
535
|
+
content_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
536
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
537
|
+
created_at: z.ZodString;
|
|
538
|
+
delivered_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
|
+
read_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
540
|
+
group_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
541
|
+
group_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
542
|
+
} & {
|
|
543
|
+
plaintext: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
544
|
+
verified: z.ZodDefault<z.ZodBoolean>;
|
|
545
|
+
verification_status: z.ZodDefault<z.ZodEnum<["verified", "invalid", "unverifiable"]>>;
|
|
546
|
+
decrypt_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
547
|
+
}, "strip", z.ZodTypeAny, {
|
|
548
|
+
id: string;
|
|
549
|
+
created_at: string;
|
|
550
|
+
type: string;
|
|
551
|
+
conversation_id: string;
|
|
552
|
+
encrypted_payload: string;
|
|
553
|
+
encryption_version: string;
|
|
554
|
+
metadata: Record<string, unknown>;
|
|
555
|
+
verified: boolean;
|
|
556
|
+
verification_status: "verified" | "invalid" | "unverifiable";
|
|
557
|
+
from_agent_id?: string | null | undefined;
|
|
558
|
+
to_agent_id?: string | null | undefined;
|
|
559
|
+
sender_handle?: string | null | undefined;
|
|
560
|
+
recipient_handle?: string | null | undefined;
|
|
561
|
+
sender_signing_kid?: string | null | undefined;
|
|
562
|
+
content_type?: string | null | undefined;
|
|
563
|
+
delivered_at?: string | null | undefined;
|
|
564
|
+
read_at?: string | null | undefined;
|
|
565
|
+
group_id?: string | null | undefined;
|
|
566
|
+
group_handle?: string | null | undefined;
|
|
567
|
+
plaintext?: unknown;
|
|
568
|
+
decrypt_error?: string | null | undefined;
|
|
569
|
+
}, {
|
|
570
|
+
id: string;
|
|
571
|
+
created_at: string;
|
|
572
|
+
type: string;
|
|
573
|
+
conversation_id: string;
|
|
574
|
+
encrypted_payload: string;
|
|
575
|
+
encryption_version: string;
|
|
576
|
+
from_agent_id?: string | null | undefined;
|
|
577
|
+
to_agent_id?: string | null | undefined;
|
|
578
|
+
sender_handle?: string | null | undefined;
|
|
579
|
+
recipient_handle?: string | null | undefined;
|
|
580
|
+
sender_signing_kid?: string | null | undefined;
|
|
581
|
+
content_type?: string | null | undefined;
|
|
582
|
+
metadata?: Record<string, unknown> | undefined;
|
|
583
|
+
delivered_at?: string | null | undefined;
|
|
584
|
+
read_at?: string | null | undefined;
|
|
585
|
+
group_id?: string | null | undefined;
|
|
586
|
+
group_handle?: string | null | undefined;
|
|
587
|
+
plaintext?: unknown;
|
|
588
|
+
verified?: boolean | undefined;
|
|
589
|
+
verification_status?: "verified" | "invalid" | "unverifiable" | undefined;
|
|
590
|
+
decrypt_error?: string | null | undefined;
|
|
591
|
+
}>>;
|
|
592
|
+
}, "strip", z.ZodTypeAny, {
|
|
593
|
+
sent: {
|
|
594
|
+
id: string;
|
|
595
|
+
created_at: string;
|
|
596
|
+
type: string;
|
|
597
|
+
conversation_id: string;
|
|
598
|
+
encrypted_payload: string;
|
|
599
|
+
encryption_version: string;
|
|
600
|
+
metadata: Record<string, unknown>;
|
|
601
|
+
from_agent_id?: string | null | undefined;
|
|
602
|
+
to_agent_id?: string | null | undefined;
|
|
603
|
+
sender_handle?: string | null | undefined;
|
|
604
|
+
recipient_handle?: string | null | undefined;
|
|
605
|
+
sender_signing_kid?: string | null | undefined;
|
|
606
|
+
content_type?: string | null | undefined;
|
|
607
|
+
delivered_at?: string | null | undefined;
|
|
608
|
+
read_at?: string | null | undefined;
|
|
609
|
+
group_id?: string | null | undefined;
|
|
610
|
+
group_handle?: string | null | undefined;
|
|
611
|
+
};
|
|
612
|
+
reply: {
|
|
613
|
+
id: string;
|
|
614
|
+
created_at: string;
|
|
615
|
+
type: string;
|
|
616
|
+
conversation_id: string;
|
|
617
|
+
encrypted_payload: string;
|
|
618
|
+
encryption_version: string;
|
|
619
|
+
metadata: Record<string, unknown>;
|
|
620
|
+
verified: boolean;
|
|
621
|
+
verification_status: "verified" | "invalid" | "unverifiable";
|
|
622
|
+
from_agent_id?: string | null | undefined;
|
|
623
|
+
to_agent_id?: string | null | undefined;
|
|
624
|
+
sender_handle?: string | null | undefined;
|
|
625
|
+
recipient_handle?: string | null | undefined;
|
|
626
|
+
sender_signing_kid?: string | null | undefined;
|
|
627
|
+
content_type?: string | null | undefined;
|
|
628
|
+
delivered_at?: string | null | undefined;
|
|
629
|
+
read_at?: string | null | undefined;
|
|
630
|
+
group_id?: string | null | undefined;
|
|
631
|
+
group_handle?: string | null | undefined;
|
|
632
|
+
plaintext?: unknown;
|
|
633
|
+
decrypt_error?: string | null | undefined;
|
|
634
|
+
} | null;
|
|
635
|
+
}, {
|
|
636
|
+
sent: {
|
|
637
|
+
id: string;
|
|
638
|
+
created_at: string;
|
|
639
|
+
type: string;
|
|
640
|
+
conversation_id: string;
|
|
641
|
+
encrypted_payload: string;
|
|
642
|
+
encryption_version: string;
|
|
643
|
+
from_agent_id?: string | null | undefined;
|
|
644
|
+
to_agent_id?: string | null | undefined;
|
|
645
|
+
sender_handle?: string | null | undefined;
|
|
646
|
+
recipient_handle?: string | null | undefined;
|
|
647
|
+
sender_signing_kid?: string | null | undefined;
|
|
648
|
+
content_type?: string | null | undefined;
|
|
649
|
+
metadata?: Record<string, unknown> | undefined;
|
|
650
|
+
delivered_at?: string | null | undefined;
|
|
651
|
+
read_at?: string | null | undefined;
|
|
652
|
+
group_id?: string | null | undefined;
|
|
653
|
+
group_handle?: string | null | undefined;
|
|
654
|
+
};
|
|
655
|
+
reply: {
|
|
656
|
+
id: string;
|
|
657
|
+
created_at: string;
|
|
658
|
+
type: string;
|
|
659
|
+
conversation_id: string;
|
|
660
|
+
encrypted_payload: string;
|
|
661
|
+
encryption_version: string;
|
|
662
|
+
from_agent_id?: string | null | undefined;
|
|
663
|
+
to_agent_id?: string | null | undefined;
|
|
664
|
+
sender_handle?: string | null | undefined;
|
|
665
|
+
recipient_handle?: string | null | undefined;
|
|
666
|
+
sender_signing_kid?: string | null | undefined;
|
|
667
|
+
content_type?: string | null | undefined;
|
|
668
|
+
metadata?: Record<string, unknown> | undefined;
|
|
669
|
+
delivered_at?: string | null | undefined;
|
|
670
|
+
read_at?: string | null | undefined;
|
|
671
|
+
group_id?: string | null | undefined;
|
|
672
|
+
group_handle?: string | null | undefined;
|
|
673
|
+
plaintext?: unknown;
|
|
674
|
+
verified?: boolean | undefined;
|
|
675
|
+
verification_status?: "verified" | "invalid" | "unverifiable" | undefined;
|
|
676
|
+
decrypt_error?: string | null | undefined;
|
|
677
|
+
} | null;
|
|
678
|
+
}>;
|
|
679
|
+
/**
|
|
680
|
+
* Result of `client.sendAndWait<Req, Rep>()`. The `Rep` generic narrows the
|
|
681
|
+
* decrypted reply plaintext end-to-end when `opts.replySchema` is supplied.
|
|
682
|
+
*/
|
|
683
|
+
export type SendAndWaitResult<Rep = unknown> = {
|
|
684
|
+
sent: MessageRead;
|
|
685
|
+
reply: DecryptedMessage<Rep> | null;
|
|
686
|
+
};
|
|
687
|
+
export declare const GroupReadSchema: z.ZodObject<{
|
|
688
|
+
id: z.ZodString;
|
|
689
|
+
name: z.ZodString;
|
|
690
|
+
handle: z.ZodString;
|
|
691
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
692
|
+
enrollment_policy: z.ZodDefault<z.ZodString>;
|
|
693
|
+
visibility: z.ZodDefault<z.ZodString>;
|
|
694
|
+
isolated: z.ZodDefault<z.ZodBoolean>;
|
|
695
|
+
vote_duration_hours: z.ZodDefault<z.ZodNumber>;
|
|
696
|
+
member_count: z.ZodDefault<z.ZodNumber>;
|
|
697
|
+
created_at: z.ZodString;
|
|
698
|
+
}, "strip", z.ZodTypeAny, {
|
|
699
|
+
id: string;
|
|
700
|
+
name: string;
|
|
701
|
+
created_at: string;
|
|
702
|
+
handle: string;
|
|
703
|
+
enrollment_policy: string;
|
|
704
|
+
visibility: string;
|
|
705
|
+
isolated: boolean;
|
|
706
|
+
vote_duration_hours: number;
|
|
707
|
+
member_count: number;
|
|
708
|
+
description?: string | null | undefined;
|
|
709
|
+
}, {
|
|
710
|
+
id: string;
|
|
711
|
+
name: string;
|
|
712
|
+
created_at: string;
|
|
713
|
+
handle: string;
|
|
714
|
+
description?: string | null | undefined;
|
|
715
|
+
enrollment_policy?: string | undefined;
|
|
716
|
+
visibility?: string | undefined;
|
|
717
|
+
isolated?: boolean | undefined;
|
|
718
|
+
vote_duration_hours?: number | undefined;
|
|
719
|
+
member_count?: number | undefined;
|
|
720
|
+
}>;
|
|
721
|
+
export type GroupRead = z.infer<typeof GroupReadSchema>;
|
|
722
|
+
export declare const GroupMemberSchema: z.ZodObject<{
|
|
723
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
724
|
+
group_id: z.ZodString;
|
|
725
|
+
agent_id: z.ZodString;
|
|
726
|
+
role: z.ZodDefault<z.ZodString>;
|
|
727
|
+
joined_at: z.ZodString;
|
|
728
|
+
agent_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
729
|
+
}, "strip", z.ZodTypeAny, {
|
|
730
|
+
group_id: string;
|
|
731
|
+
agent_id: string;
|
|
732
|
+
role: string;
|
|
733
|
+
joined_at: string;
|
|
734
|
+
id?: string | null | undefined;
|
|
735
|
+
agent_handle?: string | null | undefined;
|
|
736
|
+
}, {
|
|
737
|
+
group_id: string;
|
|
738
|
+
agent_id: string;
|
|
739
|
+
joined_at: string;
|
|
740
|
+
id?: string | null | undefined;
|
|
741
|
+
role?: string | undefined;
|
|
742
|
+
agent_handle?: string | null | undefined;
|
|
743
|
+
}>;
|
|
744
|
+
export type GroupMember = z.infer<typeof GroupMemberSchema>;
|
|
745
|
+
export declare const JoinRequestReadSchema: z.ZodObject<{
|
|
746
|
+
id: z.ZodString;
|
|
747
|
+
group_id: z.ZodString;
|
|
748
|
+
agent_id: z.ZodString;
|
|
749
|
+
invited_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
750
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
751
|
+
status: z.ZodString;
|
|
752
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
753
|
+
created_at: z.ZodString;
|
|
754
|
+
resolved_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
755
|
+
your_vote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
756
|
+
}, "strip", z.ZodTypeAny, {
|
|
757
|
+
id: string;
|
|
758
|
+
created_at: string;
|
|
759
|
+
status: string;
|
|
760
|
+
group_id: string;
|
|
761
|
+
agent_id: string;
|
|
762
|
+
message?: string | null | undefined;
|
|
763
|
+
invited_by?: string | null | undefined;
|
|
764
|
+
expires_at?: string | null | undefined;
|
|
765
|
+
resolved_at?: string | null | undefined;
|
|
766
|
+
your_vote?: string | null | undefined;
|
|
767
|
+
}, {
|
|
768
|
+
id: string;
|
|
769
|
+
created_at: string;
|
|
770
|
+
status: string;
|
|
771
|
+
group_id: string;
|
|
772
|
+
agent_id: string;
|
|
773
|
+
message?: string | null | undefined;
|
|
774
|
+
invited_by?: string | null | undefined;
|
|
775
|
+
expires_at?: string | null | undefined;
|
|
776
|
+
resolved_at?: string | null | undefined;
|
|
777
|
+
your_vote?: string | null | undefined;
|
|
778
|
+
}>;
|
|
779
|
+
export type JoinRequestRead = z.infer<typeof JoinRequestReadSchema>;
|
|
780
|
+
export declare const JoinedResultSchema: z.ZodObject<{
|
|
781
|
+
status: z.ZodLiteral<"joined">;
|
|
782
|
+
member: z.ZodObject<{
|
|
783
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
784
|
+
group_id: z.ZodString;
|
|
785
|
+
agent_id: z.ZodString;
|
|
786
|
+
role: z.ZodDefault<z.ZodString>;
|
|
787
|
+
joined_at: z.ZodString;
|
|
788
|
+
agent_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
789
|
+
}, "strip", z.ZodTypeAny, {
|
|
790
|
+
group_id: string;
|
|
791
|
+
agent_id: string;
|
|
792
|
+
role: string;
|
|
793
|
+
joined_at: string;
|
|
794
|
+
id?: string | null | undefined;
|
|
795
|
+
agent_handle?: string | null | undefined;
|
|
796
|
+
}, {
|
|
797
|
+
group_id: string;
|
|
798
|
+
agent_id: string;
|
|
799
|
+
joined_at: string;
|
|
800
|
+
id?: string | null | undefined;
|
|
801
|
+
role?: string | undefined;
|
|
802
|
+
agent_handle?: string | null | undefined;
|
|
803
|
+
}>;
|
|
804
|
+
}, "strip", z.ZodTypeAny, {
|
|
805
|
+
status: "joined";
|
|
806
|
+
member: {
|
|
807
|
+
group_id: string;
|
|
808
|
+
agent_id: string;
|
|
809
|
+
role: string;
|
|
810
|
+
joined_at: string;
|
|
811
|
+
id?: string | null | undefined;
|
|
812
|
+
agent_handle?: string | null | undefined;
|
|
813
|
+
};
|
|
814
|
+
}, {
|
|
815
|
+
status: "joined";
|
|
816
|
+
member: {
|
|
817
|
+
group_id: string;
|
|
818
|
+
agent_id: string;
|
|
819
|
+
joined_at: string;
|
|
820
|
+
id?: string | null | undefined;
|
|
821
|
+
role?: string | undefined;
|
|
822
|
+
agent_handle?: string | null | undefined;
|
|
823
|
+
};
|
|
824
|
+
}>;
|
|
825
|
+
export declare const PendingJoinResultSchema: z.ZodObject<{
|
|
826
|
+
status: z.ZodLiteral<"pending">;
|
|
827
|
+
request: z.ZodObject<{
|
|
828
|
+
id: z.ZodString;
|
|
829
|
+
group_id: z.ZodString;
|
|
830
|
+
agent_id: z.ZodString;
|
|
831
|
+
invited_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
832
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
833
|
+
status: z.ZodString;
|
|
834
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
835
|
+
created_at: z.ZodString;
|
|
836
|
+
resolved_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
837
|
+
your_vote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
838
|
+
}, "strip", z.ZodTypeAny, {
|
|
839
|
+
id: string;
|
|
840
|
+
created_at: string;
|
|
841
|
+
status: string;
|
|
842
|
+
group_id: string;
|
|
843
|
+
agent_id: string;
|
|
844
|
+
message?: string | null | undefined;
|
|
845
|
+
invited_by?: string | null | undefined;
|
|
846
|
+
expires_at?: string | null | undefined;
|
|
847
|
+
resolved_at?: string | null | undefined;
|
|
848
|
+
your_vote?: string | null | undefined;
|
|
849
|
+
}, {
|
|
850
|
+
id: string;
|
|
851
|
+
created_at: string;
|
|
852
|
+
status: string;
|
|
853
|
+
group_id: string;
|
|
854
|
+
agent_id: string;
|
|
855
|
+
message?: string | null | undefined;
|
|
856
|
+
invited_by?: string | null | undefined;
|
|
857
|
+
expires_at?: string | null | undefined;
|
|
858
|
+
resolved_at?: string | null | undefined;
|
|
859
|
+
your_vote?: string | null | undefined;
|
|
860
|
+
}>;
|
|
861
|
+
}, "strip", z.ZodTypeAny, {
|
|
862
|
+
status: "pending";
|
|
863
|
+
request: {
|
|
864
|
+
id: string;
|
|
865
|
+
created_at: string;
|
|
866
|
+
status: string;
|
|
867
|
+
group_id: string;
|
|
868
|
+
agent_id: string;
|
|
869
|
+
message?: string | null | undefined;
|
|
870
|
+
invited_by?: string | null | undefined;
|
|
871
|
+
expires_at?: string | null | undefined;
|
|
872
|
+
resolved_at?: string | null | undefined;
|
|
873
|
+
your_vote?: string | null | undefined;
|
|
874
|
+
};
|
|
875
|
+
}, {
|
|
876
|
+
status: "pending";
|
|
877
|
+
request: {
|
|
878
|
+
id: string;
|
|
879
|
+
created_at: string;
|
|
880
|
+
status: string;
|
|
881
|
+
group_id: string;
|
|
882
|
+
agent_id: string;
|
|
883
|
+
message?: string | null | undefined;
|
|
884
|
+
invited_by?: string | null | undefined;
|
|
885
|
+
expires_at?: string | null | undefined;
|
|
886
|
+
resolved_at?: string | null | undefined;
|
|
887
|
+
your_vote?: string | null | undefined;
|
|
888
|
+
};
|
|
889
|
+
}>;
|
|
890
|
+
export declare const JoinResultSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
891
|
+
status: z.ZodLiteral<"joined">;
|
|
892
|
+
member: z.ZodObject<{
|
|
893
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
894
|
+
group_id: z.ZodString;
|
|
895
|
+
agent_id: z.ZodString;
|
|
896
|
+
role: z.ZodDefault<z.ZodString>;
|
|
897
|
+
joined_at: z.ZodString;
|
|
898
|
+
agent_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
899
|
+
}, "strip", z.ZodTypeAny, {
|
|
900
|
+
group_id: string;
|
|
901
|
+
agent_id: string;
|
|
902
|
+
role: string;
|
|
903
|
+
joined_at: string;
|
|
904
|
+
id?: string | null | undefined;
|
|
905
|
+
agent_handle?: string | null | undefined;
|
|
906
|
+
}, {
|
|
907
|
+
group_id: string;
|
|
908
|
+
agent_id: string;
|
|
909
|
+
joined_at: string;
|
|
910
|
+
id?: string | null | undefined;
|
|
911
|
+
role?: string | undefined;
|
|
912
|
+
agent_handle?: string | null | undefined;
|
|
913
|
+
}>;
|
|
914
|
+
}, "strip", z.ZodTypeAny, {
|
|
915
|
+
status: "joined";
|
|
916
|
+
member: {
|
|
917
|
+
group_id: string;
|
|
918
|
+
agent_id: string;
|
|
919
|
+
role: string;
|
|
920
|
+
joined_at: string;
|
|
921
|
+
id?: string | null | undefined;
|
|
922
|
+
agent_handle?: string | null | undefined;
|
|
923
|
+
};
|
|
924
|
+
}, {
|
|
925
|
+
status: "joined";
|
|
926
|
+
member: {
|
|
927
|
+
group_id: string;
|
|
928
|
+
agent_id: string;
|
|
929
|
+
joined_at: string;
|
|
930
|
+
id?: string | null | undefined;
|
|
931
|
+
role?: string | undefined;
|
|
932
|
+
agent_handle?: string | null | undefined;
|
|
933
|
+
};
|
|
934
|
+
}>, z.ZodObject<{
|
|
935
|
+
status: z.ZodLiteral<"pending">;
|
|
936
|
+
request: z.ZodObject<{
|
|
937
|
+
id: z.ZodString;
|
|
938
|
+
group_id: z.ZodString;
|
|
939
|
+
agent_id: z.ZodString;
|
|
940
|
+
invited_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
941
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
942
|
+
status: z.ZodString;
|
|
943
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
944
|
+
created_at: z.ZodString;
|
|
945
|
+
resolved_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
946
|
+
your_vote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
947
|
+
}, "strip", z.ZodTypeAny, {
|
|
948
|
+
id: string;
|
|
949
|
+
created_at: string;
|
|
950
|
+
status: string;
|
|
951
|
+
group_id: string;
|
|
952
|
+
agent_id: string;
|
|
953
|
+
message?: string | null | undefined;
|
|
954
|
+
invited_by?: string | null | undefined;
|
|
955
|
+
expires_at?: string | null | undefined;
|
|
956
|
+
resolved_at?: string | null | undefined;
|
|
957
|
+
your_vote?: string | null | undefined;
|
|
958
|
+
}, {
|
|
959
|
+
id: string;
|
|
960
|
+
created_at: string;
|
|
961
|
+
status: string;
|
|
962
|
+
group_id: string;
|
|
963
|
+
agent_id: string;
|
|
964
|
+
message?: string | null | undefined;
|
|
965
|
+
invited_by?: string | null | undefined;
|
|
966
|
+
expires_at?: string | null | undefined;
|
|
967
|
+
resolved_at?: string | null | undefined;
|
|
968
|
+
your_vote?: string | null | undefined;
|
|
969
|
+
}>;
|
|
970
|
+
}, "strip", z.ZodTypeAny, {
|
|
971
|
+
status: "pending";
|
|
972
|
+
request: {
|
|
973
|
+
id: string;
|
|
974
|
+
created_at: string;
|
|
975
|
+
status: string;
|
|
976
|
+
group_id: string;
|
|
977
|
+
agent_id: string;
|
|
978
|
+
message?: string | null | undefined;
|
|
979
|
+
invited_by?: string | null | undefined;
|
|
980
|
+
expires_at?: string | null | undefined;
|
|
981
|
+
resolved_at?: string | null | undefined;
|
|
982
|
+
your_vote?: string | null | undefined;
|
|
983
|
+
};
|
|
984
|
+
}, {
|
|
985
|
+
status: "pending";
|
|
986
|
+
request: {
|
|
987
|
+
id: string;
|
|
988
|
+
created_at: string;
|
|
989
|
+
status: string;
|
|
990
|
+
group_id: string;
|
|
991
|
+
agent_id: string;
|
|
992
|
+
message?: string | null | undefined;
|
|
993
|
+
invited_by?: string | null | undefined;
|
|
994
|
+
expires_at?: string | null | undefined;
|
|
995
|
+
resolved_at?: string | null | undefined;
|
|
996
|
+
your_vote?: string | null | undefined;
|
|
997
|
+
};
|
|
998
|
+
}>]>;
|
|
999
|
+
export type JoinResult = z.infer<typeof JoinResultSchema>;
|
|
1000
|
+
export declare const InviteResultSchema: z.ZodObject<{
|
|
1001
|
+
status: z.ZodString;
|
|
1002
|
+
request_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1003
|
+
}, "strip", z.ZodTypeAny, {
|
|
1004
|
+
status: string;
|
|
1005
|
+
request_id?: string | null | undefined;
|
|
1006
|
+
}, {
|
|
1007
|
+
status: string;
|
|
1008
|
+
request_id?: string | null | undefined;
|
|
1009
|
+
}>;
|
|
1010
|
+
export type InviteResult = z.infer<typeof InviteResultSchema>;
|
|
1011
|
+
export declare const GroupSummarySchema: z.ZodObject<{
|
|
1012
|
+
id: z.ZodString;
|
|
1013
|
+
name: z.ZodString;
|
|
1014
|
+
handle: z.ZodString;
|
|
1015
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1016
|
+
visibility: z.ZodDefault<z.ZodString>;
|
|
1017
|
+
member_count: z.ZodDefault<z.ZodNumber>;
|
|
1018
|
+
}, "strip", z.ZodTypeAny, {
|
|
1019
|
+
id: string;
|
|
1020
|
+
name: string;
|
|
1021
|
+
handle: string;
|
|
1022
|
+
visibility: string;
|
|
1023
|
+
member_count: number;
|
|
1024
|
+
description?: string | null | undefined;
|
|
1025
|
+
}, {
|
|
1026
|
+
id: string;
|
|
1027
|
+
name: string;
|
|
1028
|
+
handle: string;
|
|
1029
|
+
description?: string | null | undefined;
|
|
1030
|
+
visibility?: string | undefined;
|
|
1031
|
+
member_count?: number | undefined;
|
|
1032
|
+
}>;
|
|
1033
|
+
export type GroupSummary = z.infer<typeof GroupSummarySchema>;
|
|
1034
|
+
export declare const VoteResponseSchema: z.ZodObject<{
|
|
1035
|
+
request_id: z.ZodString;
|
|
1036
|
+
your_vote: z.ZodString;
|
|
1037
|
+
status: z.ZodString;
|
|
1038
|
+
}, "strip", z.ZodTypeAny, {
|
|
1039
|
+
status: string;
|
|
1040
|
+
your_vote: string;
|
|
1041
|
+
request_id: string;
|
|
1042
|
+
}, {
|
|
1043
|
+
status: string;
|
|
1044
|
+
your_vote: string;
|
|
1045
|
+
request_id: string;
|
|
1046
|
+
}>;
|
|
1047
|
+
export type VoteResponse = z.infer<typeof VoteResponseSchema>;
|
|
1048
|
+
export declare const AgentSummarySchema: z.ZodObject<{
|
|
1049
|
+
id: z.ZodString;
|
|
1050
|
+
name: z.ZodString;
|
|
1051
|
+
handle: z.ZodString;
|
|
1052
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1053
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1054
|
+
verified: z.ZodDefault<z.ZodBoolean>;
|
|
1055
|
+
}, "strip", z.ZodTypeAny, {
|
|
1056
|
+
id: string;
|
|
1057
|
+
name: string;
|
|
1058
|
+
handle: string;
|
|
1059
|
+
verified: boolean;
|
|
1060
|
+
description?: string | null | undefined;
|
|
1061
|
+
category?: string | null | undefined;
|
|
1062
|
+
}, {
|
|
1063
|
+
id: string;
|
|
1064
|
+
name: string;
|
|
1065
|
+
handle: string;
|
|
1066
|
+
verified?: boolean | undefined;
|
|
1067
|
+
description?: string | null | undefined;
|
|
1068
|
+
category?: string | null | undefined;
|
|
1069
|
+
}>;
|
|
1070
|
+
export type AgentSummary = z.infer<typeof AgentSummarySchema>;
|
|
1071
|
+
export declare const AgentProfileSchema: z.ZodObject<{
|
|
1072
|
+
id: z.ZodString;
|
|
1073
|
+
name: z.ZodString;
|
|
1074
|
+
handle: z.ZodString;
|
|
1075
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1076
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1077
|
+
verified: z.ZodDefault<z.ZodBoolean>;
|
|
1078
|
+
human_oversight: z.ZodDefault<z.ZodBoolean>;
|
|
1079
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1080
|
+
}, "strip", z.ZodTypeAny, {
|
|
1081
|
+
id: string;
|
|
1082
|
+
name: string;
|
|
1083
|
+
handle: string;
|
|
1084
|
+
human_oversight: boolean;
|
|
1085
|
+
verified: boolean;
|
|
1086
|
+
created_at?: string | null | undefined;
|
|
1087
|
+
description?: string | null | undefined;
|
|
1088
|
+
category?: string | null | undefined;
|
|
1089
|
+
}, {
|
|
1090
|
+
id: string;
|
|
1091
|
+
name: string;
|
|
1092
|
+
handle: string;
|
|
1093
|
+
created_at?: string | null | undefined;
|
|
1094
|
+
human_oversight?: boolean | undefined;
|
|
1095
|
+
verified?: boolean | undefined;
|
|
1096
|
+
description?: string | null | undefined;
|
|
1097
|
+
category?: string | null | undefined;
|
|
1098
|
+
}>;
|
|
1099
|
+
export type AgentProfile = z.infer<typeof AgentProfileSchema>;
|
|
1100
|
+
export declare const AgentCardSchema: z.ZodObject<{
|
|
1101
|
+
id: z.ZodString;
|
|
1102
|
+
agent_id: z.ZodString;
|
|
1103
|
+
name: z.ZodString;
|
|
1104
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1105
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1106
|
+
is_public: z.ZodDefault<z.ZodBoolean>;
|
|
1107
|
+
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
1108
|
+
rine: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1109
|
+
created_at: z.ZodString;
|
|
1110
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1111
|
+
}, "strip", z.ZodTypeAny, {
|
|
1112
|
+
id: string;
|
|
1113
|
+
name: string;
|
|
1114
|
+
created_at: string;
|
|
1115
|
+
agent_id: string;
|
|
1116
|
+
is_public: boolean;
|
|
1117
|
+
skills: Record<string, unknown>[];
|
|
1118
|
+
rine: Record<string, unknown>;
|
|
1119
|
+
description?: string | null | undefined;
|
|
1120
|
+
version?: string | null | undefined;
|
|
1121
|
+
updated_at?: string | null | undefined;
|
|
1122
|
+
}, {
|
|
1123
|
+
id: string;
|
|
1124
|
+
name: string;
|
|
1125
|
+
created_at: string;
|
|
1126
|
+
agent_id: string;
|
|
1127
|
+
description?: string | null | undefined;
|
|
1128
|
+
version?: string | null | undefined;
|
|
1129
|
+
is_public?: boolean | undefined;
|
|
1130
|
+
skills?: Record<string, unknown>[] | undefined;
|
|
1131
|
+
rine?: Record<string, unknown> | undefined;
|
|
1132
|
+
updated_at?: string | null | undefined;
|
|
1133
|
+
}>;
|
|
1134
|
+
export type AgentCardRead = z.infer<typeof AgentCardSchema>;
|
|
1135
|
+
export declare const WebhookReadSchema: z.ZodObject<{
|
|
1136
|
+
id: z.ZodString;
|
|
1137
|
+
agent_id: z.ZodString;
|
|
1138
|
+
url: z.ZodString;
|
|
1139
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
1140
|
+
created_at: z.ZodString;
|
|
1141
|
+
}, "strip", z.ZodTypeAny, {
|
|
1142
|
+
id: string;
|
|
1143
|
+
created_at: string;
|
|
1144
|
+
agent_id: string;
|
|
1145
|
+
url: string;
|
|
1146
|
+
active: boolean;
|
|
1147
|
+
}, {
|
|
1148
|
+
id: string;
|
|
1149
|
+
created_at: string;
|
|
1150
|
+
agent_id: string;
|
|
1151
|
+
url: string;
|
|
1152
|
+
active?: boolean | undefined;
|
|
1153
|
+
}>;
|
|
1154
|
+
export type WebhookRead = z.infer<typeof WebhookReadSchema>;
|
|
1155
|
+
export declare const WebhookCreatedSchema: z.ZodObject<{
|
|
1156
|
+
id: z.ZodString;
|
|
1157
|
+
agent_id: z.ZodString;
|
|
1158
|
+
url: z.ZodString;
|
|
1159
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
1160
|
+
created_at: z.ZodString;
|
|
1161
|
+
} & {
|
|
1162
|
+
secret: z.ZodString;
|
|
1163
|
+
}, "strip", z.ZodTypeAny, {
|
|
1164
|
+
id: string;
|
|
1165
|
+
created_at: string;
|
|
1166
|
+
agent_id: string;
|
|
1167
|
+
url: string;
|
|
1168
|
+
active: boolean;
|
|
1169
|
+
secret: string;
|
|
1170
|
+
}, {
|
|
1171
|
+
id: string;
|
|
1172
|
+
created_at: string;
|
|
1173
|
+
agent_id: string;
|
|
1174
|
+
url: string;
|
|
1175
|
+
secret: string;
|
|
1176
|
+
active?: boolean | undefined;
|
|
1177
|
+
}>;
|
|
1178
|
+
export type WebhookCreated = z.infer<typeof WebhookCreatedSchema>;
|
|
1179
|
+
export declare const WebhookDeliveryReadSchema: z.ZodObject<{
|
|
1180
|
+
id: z.ZodString;
|
|
1181
|
+
webhook_id: z.ZodString;
|
|
1182
|
+
message_id: z.ZodString;
|
|
1183
|
+
status: z.ZodString;
|
|
1184
|
+
attempts: z.ZodDefault<z.ZodNumber>;
|
|
1185
|
+
max_attempts: z.ZodDefault<z.ZodNumber>;
|
|
1186
|
+
last_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1187
|
+
created_at: z.ZodString;
|
|
1188
|
+
delivered_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1189
|
+
next_attempt_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1190
|
+
}, "strip", z.ZodTypeAny, {
|
|
1191
|
+
id: string;
|
|
1192
|
+
created_at: string;
|
|
1193
|
+
status: string;
|
|
1194
|
+
webhook_id: string;
|
|
1195
|
+
message_id: string;
|
|
1196
|
+
attempts: number;
|
|
1197
|
+
max_attempts: number;
|
|
1198
|
+
delivered_at?: string | null | undefined;
|
|
1199
|
+
last_error?: string | null | undefined;
|
|
1200
|
+
next_attempt_at?: string | null | undefined;
|
|
1201
|
+
}, {
|
|
1202
|
+
id: string;
|
|
1203
|
+
created_at: string;
|
|
1204
|
+
status: string;
|
|
1205
|
+
webhook_id: string;
|
|
1206
|
+
message_id: string;
|
|
1207
|
+
delivered_at?: string | null | undefined;
|
|
1208
|
+
attempts?: number | undefined;
|
|
1209
|
+
max_attempts?: number | undefined;
|
|
1210
|
+
last_error?: string | null | undefined;
|
|
1211
|
+
next_attempt_at?: string | null | undefined;
|
|
1212
|
+
}>;
|
|
1213
|
+
export type WebhookDeliveryRead = z.infer<typeof WebhookDeliveryReadSchema>;
|
|
1214
|
+
export declare const WebhookJobSummarySchema: z.ZodObject<{
|
|
1215
|
+
total: z.ZodDefault<z.ZodNumber>;
|
|
1216
|
+
delivered: z.ZodDefault<z.ZodNumber>;
|
|
1217
|
+
failed: z.ZodDefault<z.ZodNumber>;
|
|
1218
|
+
dead: z.ZodDefault<z.ZodNumber>;
|
|
1219
|
+
pending: z.ZodDefault<z.ZodNumber>;
|
|
1220
|
+
processing: z.ZodDefault<z.ZodNumber>;
|
|
1221
|
+
}, "strip", z.ZodTypeAny, {
|
|
1222
|
+
failed: number;
|
|
1223
|
+
pending: number;
|
|
1224
|
+
processing: number;
|
|
1225
|
+
delivered: number;
|
|
1226
|
+
dead: number;
|
|
1227
|
+
total: number;
|
|
1228
|
+
}, {
|
|
1229
|
+
failed?: number | undefined;
|
|
1230
|
+
pending?: number | undefined;
|
|
1231
|
+
processing?: number | undefined;
|
|
1232
|
+
delivered?: number | undefined;
|
|
1233
|
+
dead?: number | undefined;
|
|
1234
|
+
total?: number | undefined;
|
|
1235
|
+
}>;
|
|
1236
|
+
export type WebhookJobSummary = z.infer<typeof WebhookJobSummarySchema>;
|
|
1237
|
+
export declare const QuotaEntrySchema: z.ZodObject<{
|
|
1238
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
1239
|
+
used: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1240
|
+
}, "strip", z.ZodTypeAny, {
|
|
1241
|
+
limit: number | null;
|
|
1242
|
+
used?: number | null | undefined;
|
|
1243
|
+
}, {
|
|
1244
|
+
limit: number | null;
|
|
1245
|
+
used?: number | null | undefined;
|
|
1246
|
+
}>;
|
|
1247
|
+
export type QuotaEntry = z.infer<typeof QuotaEntrySchema>;
|
|
1248
|
+
export declare const OrgQuotasSchema: z.ZodObject<{
|
|
1249
|
+
tier: z.ZodNumber;
|
|
1250
|
+
quotas: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1251
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
1252
|
+
used: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1253
|
+
}, "strip", z.ZodTypeAny, {
|
|
1254
|
+
limit: number | null;
|
|
1255
|
+
used?: number | null | undefined;
|
|
1256
|
+
}, {
|
|
1257
|
+
limit: number | null;
|
|
1258
|
+
used?: number | null | undefined;
|
|
1259
|
+
}>>;
|
|
1260
|
+
}, "strip", z.ZodTypeAny, {
|
|
1261
|
+
tier: number;
|
|
1262
|
+
quotas: Record<string, {
|
|
1263
|
+
limit: number | null;
|
|
1264
|
+
used?: number | null | undefined;
|
|
1265
|
+
}>;
|
|
1266
|
+
}, {
|
|
1267
|
+
tier: number;
|
|
1268
|
+
quotas: Record<string, {
|
|
1269
|
+
limit: number | null;
|
|
1270
|
+
used?: number | null | undefined;
|
|
1271
|
+
}>;
|
|
1272
|
+
}>;
|
|
1273
|
+
export type OrgQuotas = z.infer<typeof OrgQuotasSchema>;
|
|
1274
|
+
export declare const PollTokenResponseSchema: z.ZodObject<{
|
|
1275
|
+
poll_url: z.ZodString;
|
|
1276
|
+
}, "strip", z.ZodTypeAny, {
|
|
1277
|
+
poll_url: string;
|
|
1278
|
+
}, {
|
|
1279
|
+
poll_url: string;
|
|
1280
|
+
}>;
|
|
1281
|
+
export type PollTokenResponse = z.infer<typeof PollTokenResponseSchema>;
|
|
1282
|
+
export declare const RineEventSchema: z.ZodObject<{
|
|
1283
|
+
type: z.ZodEnum<["message", "heartbeat", "status", "disconnect"]>;
|
|
1284
|
+
data: z.ZodString;
|
|
1285
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1286
|
+
}, "strip", z.ZodTypeAny, {
|
|
1287
|
+
type: "message" | "status" | "heartbeat" | "disconnect";
|
|
1288
|
+
data: string;
|
|
1289
|
+
id?: string | null | undefined;
|
|
1290
|
+
}, {
|
|
1291
|
+
type: "message" | "status" | "heartbeat" | "disconnect";
|
|
1292
|
+
data: string;
|
|
1293
|
+
id?: string | null | undefined;
|
|
1294
|
+
}>;
|
|
1295
|
+
export type RineEvent = z.infer<typeof RineEventSchema>;
|
|
1296
|
+
export declare const ErasureResultSchema: z.ZodObject<{
|
|
1297
|
+
org_id: z.ZodString;
|
|
1298
|
+
erased_at: z.ZodString;
|
|
1299
|
+
messages_deleted: z.ZodNumber;
|
|
1300
|
+
agents_deleted: z.ZodNumber;
|
|
1301
|
+
conversations_deleted: z.ZodNumber;
|
|
1302
|
+
groups_deleted: z.ZodDefault<z.ZodNumber>;
|
|
1303
|
+
}, "strip", z.ZodTypeAny, {
|
|
1304
|
+
org_id: string;
|
|
1305
|
+
erased_at: string;
|
|
1306
|
+
messages_deleted: number;
|
|
1307
|
+
agents_deleted: number;
|
|
1308
|
+
conversations_deleted: number;
|
|
1309
|
+
groups_deleted: number;
|
|
1310
|
+
}, {
|
|
1311
|
+
org_id: string;
|
|
1312
|
+
erased_at: string;
|
|
1313
|
+
messages_deleted: number;
|
|
1314
|
+
agents_deleted: number;
|
|
1315
|
+
conversations_deleted: number;
|
|
1316
|
+
groups_deleted?: number | undefined;
|
|
1317
|
+
}>;
|
|
1318
|
+
export type ErasureResult = z.infer<typeof ErasureResultSchema>;
|
|
1319
|
+
export declare const PaginatedResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
|
|
1320
|
+
items: z.ZodArray<T, "many">;
|
|
1321
|
+
total_estimate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1322
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1323
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1324
|
+
prev_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1325
|
+
}, "strip", z.ZodTypeAny, {
|
|
1326
|
+
items: T["_output"][];
|
|
1327
|
+
total?: number | null | undefined;
|
|
1328
|
+
total_estimate?: number | null | undefined;
|
|
1329
|
+
next_cursor?: string | null | undefined;
|
|
1330
|
+
prev_cursor?: string | null | undefined;
|
|
1331
|
+
}, {
|
|
1332
|
+
items: T["_input"][];
|
|
1333
|
+
total?: number | null | undefined;
|
|
1334
|
+
total_estimate?: number | null | undefined;
|
|
1335
|
+
next_cursor?: string | null | undefined;
|
|
1336
|
+
prev_cursor?: string | null | undefined;
|
|
1337
|
+
}>;
|
|
1338
|
+
/**
|
|
1339
|
+
* CursorPage raw response schema — used by adapters.parsePaginated().
|
|
1340
|
+
* This is NOT a generic schema; it accepts a Zod schema for the item type
|
|
1341
|
+
* and returns the full paginated response schema.
|
|
1342
|
+
*/
|
|
1343
|
+
export declare function cursorPageSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
|
|
1344
|
+
items: z.ZodArray<T, "many">;
|
|
1345
|
+
total_estimate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1346
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1347
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1348
|
+
prev_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1349
|
+
}, "strip", z.ZodTypeAny, {
|
|
1350
|
+
items: T["_output"][];
|
|
1351
|
+
total?: number | null | undefined;
|
|
1352
|
+
total_estimate?: number | null | undefined;
|
|
1353
|
+
next_cursor?: string | null | undefined;
|
|
1354
|
+
prev_cursor?: string | null | undefined;
|
|
1355
|
+
}, {
|
|
1356
|
+
items: T["_input"][];
|
|
1357
|
+
total?: number | null | undefined;
|
|
1358
|
+
total_estimate?: number | null | undefined;
|
|
1359
|
+
next_cursor?: string | null | undefined;
|
|
1360
|
+
prev_cursor?: string | null | undefined;
|
|
1361
|
+
}>;
|
|
1362
|
+
export {};
|