@f2a/network 0.1.2 → 0.1.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.
Files changed (136) hide show
  1. package/package.json +8 -1
  2. package/.github/workflows/ci.yml +0 -113
  3. package/.github/workflows/publish.yml +0 -60
  4. package/MONOREPO.md +0 -58
  5. package/SKILL.md +0 -137
  6. package/dist/adapters/openclaw.d.ts +0 -103
  7. package/dist/adapters/openclaw.d.ts.map +0 -1
  8. package/dist/adapters/openclaw.js +0 -297
  9. package/dist/adapters/openclaw.js.map +0 -1
  10. package/dist/core/connection-manager.d.ts +0 -80
  11. package/dist/core/connection-manager.d.ts.map +0 -1
  12. package/dist/core/connection-manager.js +0 -235
  13. package/dist/core/connection-manager.js.map +0 -1
  14. package/dist/core/connection-manager.test.d.ts +0 -2
  15. package/dist/core/connection-manager.test.d.ts.map +0 -1
  16. package/dist/core/connection-manager.test.js +0 -52
  17. package/dist/core/connection-manager.test.js.map +0 -1
  18. package/dist/core/identity.d.ts +0 -47
  19. package/dist/core/identity.d.ts.map +0 -1
  20. package/dist/core/identity.js +0 -130
  21. package/dist/core/identity.js.map +0 -1
  22. package/dist/core/identity.test.d.ts +0 -2
  23. package/dist/core/identity.test.d.ts.map +0 -1
  24. package/dist/core/identity.test.js +0 -43
  25. package/dist/core/identity.test.js.map +0 -1
  26. package/dist/core/serverless.d.ts +0 -155
  27. package/dist/core/serverless.d.ts.map +0 -1
  28. package/dist/core/serverless.js +0 -615
  29. package/dist/core/serverless.js.map +0 -1
  30. package/dist/daemon/webhook.test.d.ts +0 -2
  31. package/dist/daemon/webhook.test.d.ts.map +0 -1
  32. package/dist/daemon/webhook.test.js +0 -24
  33. package/dist/daemon/webhook.test.js.map +0 -1
  34. package/dist/protocol/messages.d.ts +0 -739
  35. package/dist/protocol/messages.d.ts.map +0 -1
  36. package/dist/protocol/messages.js +0 -188
  37. package/dist/protocol/messages.js.map +0 -1
  38. package/dist/protocol/messages.test.d.ts +0 -2
  39. package/dist/protocol/messages.test.d.ts.map +0 -1
  40. package/dist/protocol/messages.test.js +0 -55
  41. package/dist/protocol/messages.test.js.map +0 -1
  42. package/docs/F2A-PROTOCOL.md +0 -61
  43. package/docs/MOBILE_BOOTSTRAP_DESIGN.md +0 -126
  44. package/docs/a2a-lessons.md +0 -316
  45. package/docs/middleware-guide.md +0 -448
  46. package/docs/readme-update-checklist.md +0 -90
  47. package/docs/reputation-guide.md +0 -396
  48. package/docs/rfcs/001-reputation-system.md +0 -712
  49. package/docs/security-design.md +0 -247
  50. package/install.sh +0 -231
  51. package/packages/openclaw-adapter/README.md +0 -510
  52. package/packages/openclaw-adapter/openclaw.plugin.json +0 -106
  53. package/packages/openclaw-adapter/package.json +0 -40
  54. package/packages/openclaw-adapter/src/announcement-queue.test.ts +0 -449
  55. package/packages/openclaw-adapter/src/announcement-queue.ts +0 -403
  56. package/packages/openclaw-adapter/src/capability-detector.test.ts +0 -99
  57. package/packages/openclaw-adapter/src/capability-detector.ts +0 -183
  58. package/packages/openclaw-adapter/src/claim-handlers.test.ts +0 -974
  59. package/packages/openclaw-adapter/src/claim-handlers.ts +0 -482
  60. package/packages/openclaw-adapter/src/connector.business.test.ts +0 -583
  61. package/packages/openclaw-adapter/src/connector.ts +0 -795
  62. package/packages/openclaw-adapter/src/index.test.ts +0 -82
  63. package/packages/openclaw-adapter/src/index.ts +0 -18
  64. package/packages/openclaw-adapter/src/integration.e2e.test.ts +0 -829
  65. package/packages/openclaw-adapter/src/logger.ts +0 -51
  66. package/packages/openclaw-adapter/src/network-client.test.ts +0 -266
  67. package/packages/openclaw-adapter/src/network-client.ts +0 -251
  68. package/packages/openclaw-adapter/src/network-recovery.test.ts +0 -465
  69. package/packages/openclaw-adapter/src/node-manager.test.ts +0 -136
  70. package/packages/openclaw-adapter/src/node-manager.ts +0 -429
  71. package/packages/openclaw-adapter/src/plugin.test.ts +0 -439
  72. package/packages/openclaw-adapter/src/plugin.ts +0 -104
  73. package/packages/openclaw-adapter/src/reputation.test.ts +0 -221
  74. package/packages/openclaw-adapter/src/reputation.ts +0 -368
  75. package/packages/openclaw-adapter/src/task-guard.test.ts +0 -502
  76. package/packages/openclaw-adapter/src/task-guard.ts +0 -860
  77. package/packages/openclaw-adapter/src/task-queue.concurrency.test.ts +0 -462
  78. package/packages/openclaw-adapter/src/task-queue.edge-cases.test.ts +0 -284
  79. package/packages/openclaw-adapter/src/task-queue.persistence.test.ts +0 -408
  80. package/packages/openclaw-adapter/src/task-queue.ts +0 -668
  81. package/packages/openclaw-adapter/src/tool-handlers.test.ts +0 -906
  82. package/packages/openclaw-adapter/src/tool-handlers.ts +0 -574
  83. package/packages/openclaw-adapter/src/types.ts +0 -361
  84. package/packages/openclaw-adapter/src/webhook-pusher.test.ts +0 -188
  85. package/packages/openclaw-adapter/src/webhook-pusher.ts +0 -220
  86. package/packages/openclaw-adapter/src/webhook-server.test.ts +0 -580
  87. package/packages/openclaw-adapter/src/webhook-server.ts +0 -202
  88. package/packages/openclaw-adapter/tsconfig.json +0 -20
  89. package/src/cli/commands.test.ts +0 -157
  90. package/src/cli/commands.ts +0 -129
  91. package/src/cli/index.test.ts +0 -77
  92. package/src/cli/index.ts +0 -234
  93. package/src/core/autonomous-economy.test.ts +0 -291
  94. package/src/core/autonomous-economy.ts +0 -428
  95. package/src/core/e2ee-crypto.test.ts +0 -125
  96. package/src/core/e2ee-crypto.ts +0 -246
  97. package/src/core/f2a.test.ts +0 -269
  98. package/src/core/f2a.ts +0 -618
  99. package/src/core/p2p-network.test.ts +0 -199
  100. package/src/core/p2p-network.ts +0 -1432
  101. package/src/core/reputation-security.test.ts +0 -403
  102. package/src/core/reputation-security.ts +0 -562
  103. package/src/core/reputation.test.ts +0 -260
  104. package/src/core/reputation.ts +0 -576
  105. package/src/core/review-committee.test.ts +0 -380
  106. package/src/core/review-committee.ts +0 -401
  107. package/src/core/token-manager.test.ts +0 -133
  108. package/src/core/token-manager.ts +0 -140
  109. package/src/daemon/control-server.test.ts +0 -216
  110. package/src/daemon/control-server.ts +0 -292
  111. package/src/daemon/index.test.ts +0 -85
  112. package/src/daemon/index.ts +0 -89
  113. package/src/daemon/main.ts +0 -44
  114. package/src/daemon/start.ts +0 -29
  115. package/src/daemon/webhook.test.ts +0 -68
  116. package/src/daemon/webhook.ts +0 -105
  117. package/src/index.test.ts +0 -436
  118. package/src/index.ts +0 -72
  119. package/src/types/index.test.ts +0 -87
  120. package/src/types/index.ts +0 -341
  121. package/src/types/result.ts +0 -68
  122. package/src/utils/benchmark.ts +0 -237
  123. package/src/utils/logger.ts +0 -331
  124. package/src/utils/middleware.ts +0 -229
  125. package/src/utils/rate-limiter.ts +0 -207
  126. package/src/utils/signature.ts +0 -136
  127. package/src/utils/validation.ts +0 -186
  128. package/tests/docker/Dockerfile.node +0 -23
  129. package/tests/docker/Dockerfile.runner +0 -18
  130. package/tests/docker/docker-compose.test.yml +0 -73
  131. package/tests/integration/message-passing.test.ts +0 -109
  132. package/tests/integration/multi-node.test.ts +0 -92
  133. package/tests/integration/p2p-connection.test.ts +0 -83
  134. package/tests/integration/test-config.ts +0 -32
  135. package/tsconfig.json +0 -21
  136. package/vitest.config.ts +0 -26
@@ -1,739 +0,0 @@
1
- /**
2
- * 协议消息定义和验证
3
- * 使用 Zod 进行运行时类型验证
4
- */
5
- import { z } from 'zod';
6
- export declare const MessageTypeSchema: z.ZodEnum<["identity_challenge", "identity_response", "connection_pending", "confirmation_result", "message", "message_ack", "skill_query", "skill_response", "skill_invoke", "skill_result", "group_message", "group_invite", "key_exchange", "webrtc_offer", "webrtc_answer", "webrtc_ice"]>;
7
- export declare const BaseMessageSchema: z.ZodObject<{
8
- type: z.ZodEnum<["identity_challenge", "identity_response", "connection_pending", "confirmation_result", "message", "message_ack", "skill_query", "skill_response", "skill_invoke", "skill_result", "group_message", "group_invite", "key_exchange", "webrtc_offer", "webrtc_answer", "webrtc_ice"]>;
9
- id: z.ZodOptional<z.ZodString>;
10
- timestamp: z.ZodNumber;
11
- }, "strip", z.ZodTypeAny, {
12
- type: "message" | "identity_challenge" | "identity_response" | "connection_pending" | "confirmation_result" | "message_ack" | "skill_query" | "skill_response" | "skill_invoke" | "skill_result" | "group_message" | "group_invite" | "key_exchange" | "webrtc_offer" | "webrtc_answer" | "webrtc_ice";
13
- timestamp: number;
14
- id?: string | undefined;
15
- }, {
16
- type: "message" | "identity_challenge" | "identity_response" | "connection_pending" | "confirmation_result" | "message_ack" | "skill_query" | "skill_response" | "skill_invoke" | "skill_result" | "group_message" | "group_invite" | "key_exchange" | "webrtc_offer" | "webrtc_answer" | "webrtc_ice";
17
- timestamp: number;
18
- id?: string | undefined;
19
- }>;
20
- export declare const IdentityChallengeSchema: z.ZodObject<{
21
- id: z.ZodOptional<z.ZodString>;
22
- } & {
23
- type: z.ZodLiteral<"identity_challenge">;
24
- agentId: z.ZodString;
25
- publicKey: z.ZodString;
26
- challenge: z.ZodString;
27
- timestamp: z.ZodNumber;
28
- }, "strip", z.ZodTypeAny, {
29
- type: "identity_challenge";
30
- agentId: string;
31
- timestamp: number;
32
- publicKey: string;
33
- challenge: string;
34
- id?: string | undefined;
35
- }, {
36
- type: "identity_challenge";
37
- agentId: string;
38
- timestamp: number;
39
- publicKey: string;
40
- challenge: string;
41
- id?: string | undefined;
42
- }>;
43
- export declare const IdentityResponseSchema: z.ZodObject<{
44
- id: z.ZodOptional<z.ZodString>;
45
- timestamp: z.ZodNumber;
46
- } & {
47
- type: z.ZodLiteral<"identity_response">;
48
- agentId: z.ZodString;
49
- publicKey: z.ZodString;
50
- signature: z.ZodString;
51
- }, "strip", z.ZodTypeAny, {
52
- type: "identity_response";
53
- agentId: string;
54
- timestamp: number;
55
- publicKey: string;
56
- signature: string;
57
- id?: string | undefined;
58
- }, {
59
- type: "identity_response";
60
- agentId: string;
61
- timestamp: number;
62
- publicKey: string;
63
- signature: string;
64
- id?: string | undefined;
65
- }>;
66
- export declare const ConnectionPendingSchema: z.ZodObject<{
67
- id: z.ZodOptional<z.ZodString>;
68
- timestamp: z.ZodNumber;
69
- } & {
70
- type: z.ZodLiteral<"connection_pending">;
71
- confirmationId: z.ZodString;
72
- message: z.ZodString;
73
- timeout: z.ZodNumber;
74
- }, "strip", z.ZodTypeAny, {
75
- timeout: number;
76
- message: string;
77
- type: "connection_pending";
78
- timestamp: number;
79
- confirmationId: string;
80
- id?: string | undefined;
81
- }, {
82
- timeout: number;
83
- message: string;
84
- type: "connection_pending";
85
- timestamp: number;
86
- confirmationId: string;
87
- id?: string | undefined;
88
- }>;
89
- export declare const ConfirmationResultSchema: z.ZodObject<{
90
- id: z.ZodOptional<z.ZodString>;
91
- timestamp: z.ZodNumber;
92
- } & {
93
- type: z.ZodLiteral<"confirmation_result">;
94
- confirmationId: z.ZodString;
95
- accepted: z.ZodBoolean;
96
- reason: z.ZodOptional<z.ZodString>;
97
- }, "strip", z.ZodTypeAny, {
98
- type: "confirmation_result";
99
- timestamp: number;
100
- confirmationId: string;
101
- accepted: boolean;
102
- id?: string | undefined;
103
- reason?: string | undefined;
104
- }, {
105
- type: "confirmation_result";
106
- timestamp: number;
107
- confirmationId: string;
108
- accepted: boolean;
109
- id?: string | undefined;
110
- reason?: string | undefined;
111
- }>;
112
- export declare const TextMessageSchema: z.ZodObject<{} & {
113
- type: z.ZodLiteral<"message">;
114
- id: z.ZodString;
115
- from: z.ZodString;
116
- to: z.ZodString;
117
- content: z.ZodString;
118
- timestamp: z.ZodNumber;
119
- }, "strip", z.ZodTypeAny, {
120
- content: string;
121
- id: string;
122
- to: string;
123
- type: "message";
124
- timestamp: number;
125
- from: string;
126
- }, {
127
- content: string;
128
- id: string;
129
- to: string;
130
- type: "message";
131
- timestamp: number;
132
- from: string;
133
- }>;
134
- export declare const MessageAckSchema: z.ZodObject<{
135
- id: z.ZodOptional<z.ZodString>;
136
- timestamp: z.ZodNumber;
137
- } & {
138
- type: z.ZodLiteral<"message_ack">;
139
- messageId: z.ZodString;
140
- }, "strip", z.ZodTypeAny, {
141
- type: "message_ack";
142
- timestamp: number;
143
- messageId: string;
144
- id?: string | undefined;
145
- }, {
146
- type: "message_ack";
147
- timestamp: number;
148
- messageId: string;
149
- id?: string | undefined;
150
- }>;
151
- export declare const SkillQuerySchema: z.ZodObject<{
152
- id: z.ZodOptional<z.ZodString>;
153
- timestamp: z.ZodNumber;
154
- } & {
155
- type: z.ZodLiteral<"skill_query">;
156
- requestId: z.ZodString;
157
- }, "strip", z.ZodTypeAny, {
158
- type: "skill_query";
159
- timestamp: number;
160
- requestId: string;
161
- id?: string | undefined;
162
- }, {
163
- type: "skill_query";
164
- timestamp: number;
165
- requestId: string;
166
- id?: string | undefined;
167
- }>;
168
- export declare const SkillResponseSchema: z.ZodObject<{
169
- id: z.ZodOptional<z.ZodString>;
170
- timestamp: z.ZodNumber;
171
- } & {
172
- type: z.ZodLiteral<"skill_response">;
173
- requestId: z.ZodString;
174
- skills: z.ZodArray<z.ZodObject<{
175
- name: z.ZodString;
176
- description: z.ZodString;
177
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
178
- }, "strip", z.ZodTypeAny, {
179
- description: string;
180
- name: string;
181
- parameters: Record<string, any>;
182
- }, {
183
- description: string;
184
- name: string;
185
- parameters: Record<string, any>;
186
- }>, "many">;
187
- }, "strip", z.ZodTypeAny, {
188
- type: "skill_response";
189
- timestamp: number;
190
- requestId: string;
191
- skills: {
192
- description: string;
193
- name: string;
194
- parameters: Record<string, any>;
195
- }[];
196
- id?: string | undefined;
197
- }, {
198
- type: "skill_response";
199
- timestamp: number;
200
- requestId: string;
201
- skills: {
202
- description: string;
203
- name: string;
204
- parameters: Record<string, any>;
205
- }[];
206
- id?: string | undefined;
207
- }>;
208
- export declare const SkillInvokeSchema: z.ZodObject<{
209
- id: z.ZodOptional<z.ZodString>;
210
- timestamp: z.ZodNumber;
211
- } & {
212
- type: z.ZodLiteral<"skill_invoke">;
213
- requestId: z.ZodString;
214
- skill: z.ZodString;
215
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
216
- }, "strip", z.ZodTypeAny, {
217
- type: "skill_invoke";
218
- timestamp: number;
219
- requestId: string;
220
- parameters: Record<string, any>;
221
- skill: string;
222
- id?: string | undefined;
223
- }, {
224
- type: "skill_invoke";
225
- timestamp: number;
226
- requestId: string;
227
- parameters: Record<string, any>;
228
- skill: string;
229
- id?: string | undefined;
230
- }>;
231
- export declare const SkillResultSchema: z.ZodObject<{
232
- id: z.ZodOptional<z.ZodString>;
233
- timestamp: z.ZodNumber;
234
- } & {
235
- type: z.ZodLiteral<"skill_result">;
236
- requestId: z.ZodString;
237
- status: z.ZodEnum<["success", "error"]>;
238
- result: z.ZodOptional<z.ZodAny>;
239
- error: z.ZodOptional<z.ZodString>;
240
- }, "strip", z.ZodTypeAny, {
241
- status: "success" | "error";
242
- type: "skill_result";
243
- timestamp: number;
244
- requestId: string;
245
- error?: string | undefined;
246
- result?: any;
247
- id?: string | undefined;
248
- }, {
249
- status: "success" | "error";
250
- type: "skill_result";
251
- timestamp: number;
252
- requestId: string;
253
- error?: string | undefined;
254
- result?: any;
255
- id?: string | undefined;
256
- }>;
257
- export declare const GroupMessageSchema: z.ZodObject<{
258
- id: z.ZodOptional<z.ZodString>;
259
- timestamp: z.ZodNumber;
260
- } & {
261
- type: z.ZodLiteral<"group_message">;
262
- groupId: z.ZodString;
263
- groupName: z.ZodString;
264
- from: z.ZodString;
265
- content: z.ZodString;
266
- }, "strip", z.ZodTypeAny, {
267
- content: string;
268
- type: "group_message";
269
- timestamp: number;
270
- from: string;
271
- groupId: string;
272
- groupName: string;
273
- id?: string | undefined;
274
- }, {
275
- content: string;
276
- type: "group_message";
277
- timestamp: number;
278
- from: string;
279
- groupId: string;
280
- groupName: string;
281
- id?: string | undefined;
282
- }>;
283
- export declare const GroupInviteSchema: z.ZodObject<{
284
- id: z.ZodOptional<z.ZodString>;
285
- timestamp: z.ZodNumber;
286
- } & {
287
- type: z.ZodLiteral<"group_invite">;
288
- groupId: z.ZodString;
289
- groupName: z.ZodString;
290
- inviter: z.ZodString;
291
- }, "strip", z.ZodTypeAny, {
292
- type: "group_invite";
293
- timestamp: number;
294
- groupId: string;
295
- groupName: string;
296
- inviter: string;
297
- id?: string | undefined;
298
- }, {
299
- type: "group_invite";
300
- timestamp: number;
301
- groupId: string;
302
- groupName: string;
303
- inviter: string;
304
- id?: string | undefined;
305
- }>;
306
- export declare const WebRTCOfferSchema: z.ZodObject<{
307
- id: z.ZodOptional<z.ZodString>;
308
- timestamp: z.ZodNumber;
309
- } & {
310
- type: z.ZodLiteral<"webrtc_offer">;
311
- offer: z.ZodAny;
312
- }, "strip", z.ZodTypeAny, {
313
- type: "webrtc_offer";
314
- timestamp: number;
315
- id?: string | undefined;
316
- offer?: any;
317
- }, {
318
- type: "webrtc_offer";
319
- timestamp: number;
320
- id?: string | undefined;
321
- offer?: any;
322
- }>;
323
- export declare const WebRTCAnswerSchema: z.ZodObject<{
324
- id: z.ZodOptional<z.ZodString>;
325
- timestamp: z.ZodNumber;
326
- } & {
327
- type: z.ZodLiteral<"webrtc_answer">;
328
- answer: z.ZodAny;
329
- }, "strip", z.ZodTypeAny, {
330
- type: "webrtc_answer";
331
- timestamp: number;
332
- id?: string | undefined;
333
- answer?: any;
334
- }, {
335
- type: "webrtc_answer";
336
- timestamp: number;
337
- id?: string | undefined;
338
- answer?: any;
339
- }>;
340
- export declare const WebRTCIceSchema: z.ZodObject<{
341
- id: z.ZodOptional<z.ZodString>;
342
- timestamp: z.ZodNumber;
343
- } & {
344
- type: z.ZodLiteral<"webrtc_ice">;
345
- candidate: z.ZodAny;
346
- }, "strip", z.ZodTypeAny, {
347
- type: "webrtc_ice";
348
- timestamp: number;
349
- id?: string | undefined;
350
- candidate?: any;
351
- }, {
352
- type: "webrtc_ice";
353
- timestamp: number;
354
- id?: string | undefined;
355
- candidate?: any;
356
- }>;
357
- export declare const KeyExchangeSchema: z.ZodObject<{
358
- id: z.ZodOptional<z.ZodString>;
359
- timestamp: z.ZodNumber;
360
- } & {
361
- type: z.ZodLiteral<"key_exchange">;
362
- publicKey: z.ZodString;
363
- }, "strip", z.ZodTypeAny, {
364
- type: "key_exchange";
365
- timestamp: number;
366
- publicKey: string;
367
- id?: string | undefined;
368
- }, {
369
- type: "key_exchange";
370
- timestamp: number;
371
- publicKey: string;
372
- id?: string | undefined;
373
- }>;
374
- export declare const F2AMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
375
- id: z.ZodOptional<z.ZodString>;
376
- } & {
377
- type: z.ZodLiteral<"identity_challenge">;
378
- agentId: z.ZodString;
379
- publicKey: z.ZodString;
380
- challenge: z.ZodString;
381
- timestamp: z.ZodNumber;
382
- }, "strip", z.ZodTypeAny, {
383
- type: "identity_challenge";
384
- agentId: string;
385
- timestamp: number;
386
- publicKey: string;
387
- challenge: string;
388
- id?: string | undefined;
389
- }, {
390
- type: "identity_challenge";
391
- agentId: string;
392
- timestamp: number;
393
- publicKey: string;
394
- challenge: string;
395
- id?: string | undefined;
396
- }>, z.ZodObject<{
397
- id: z.ZodOptional<z.ZodString>;
398
- timestamp: z.ZodNumber;
399
- } & {
400
- type: z.ZodLiteral<"identity_response">;
401
- agentId: z.ZodString;
402
- publicKey: z.ZodString;
403
- signature: z.ZodString;
404
- }, "strip", z.ZodTypeAny, {
405
- type: "identity_response";
406
- agentId: string;
407
- timestamp: number;
408
- publicKey: string;
409
- signature: string;
410
- id?: string | undefined;
411
- }, {
412
- type: "identity_response";
413
- agentId: string;
414
- timestamp: number;
415
- publicKey: string;
416
- signature: string;
417
- id?: string | undefined;
418
- }>, z.ZodObject<{
419
- id: z.ZodOptional<z.ZodString>;
420
- timestamp: z.ZodNumber;
421
- } & {
422
- type: z.ZodLiteral<"connection_pending">;
423
- confirmationId: z.ZodString;
424
- message: z.ZodString;
425
- timeout: z.ZodNumber;
426
- }, "strip", z.ZodTypeAny, {
427
- timeout: number;
428
- message: string;
429
- type: "connection_pending";
430
- timestamp: number;
431
- confirmationId: string;
432
- id?: string | undefined;
433
- }, {
434
- timeout: number;
435
- message: string;
436
- type: "connection_pending";
437
- timestamp: number;
438
- confirmationId: string;
439
- id?: string | undefined;
440
- }>, z.ZodObject<{
441
- id: z.ZodOptional<z.ZodString>;
442
- timestamp: z.ZodNumber;
443
- } & {
444
- type: z.ZodLiteral<"confirmation_result">;
445
- confirmationId: z.ZodString;
446
- accepted: z.ZodBoolean;
447
- reason: z.ZodOptional<z.ZodString>;
448
- }, "strip", z.ZodTypeAny, {
449
- type: "confirmation_result";
450
- timestamp: number;
451
- confirmationId: string;
452
- accepted: boolean;
453
- id?: string | undefined;
454
- reason?: string | undefined;
455
- }, {
456
- type: "confirmation_result";
457
- timestamp: number;
458
- confirmationId: string;
459
- accepted: boolean;
460
- id?: string | undefined;
461
- reason?: string | undefined;
462
- }>, z.ZodObject<{} & {
463
- type: z.ZodLiteral<"message">;
464
- id: z.ZodString;
465
- from: z.ZodString;
466
- to: z.ZodString;
467
- content: z.ZodString;
468
- timestamp: z.ZodNumber;
469
- }, "strip", z.ZodTypeAny, {
470
- content: string;
471
- id: string;
472
- to: string;
473
- type: "message";
474
- timestamp: number;
475
- from: string;
476
- }, {
477
- content: string;
478
- id: string;
479
- to: string;
480
- type: "message";
481
- timestamp: number;
482
- from: string;
483
- }>, z.ZodObject<{
484
- id: z.ZodOptional<z.ZodString>;
485
- timestamp: z.ZodNumber;
486
- } & {
487
- type: z.ZodLiteral<"message_ack">;
488
- messageId: z.ZodString;
489
- }, "strip", z.ZodTypeAny, {
490
- type: "message_ack";
491
- timestamp: number;
492
- messageId: string;
493
- id?: string | undefined;
494
- }, {
495
- type: "message_ack";
496
- timestamp: number;
497
- messageId: string;
498
- id?: string | undefined;
499
- }>, z.ZodObject<{
500
- id: z.ZodOptional<z.ZodString>;
501
- timestamp: z.ZodNumber;
502
- } & {
503
- type: z.ZodLiteral<"skill_query">;
504
- requestId: z.ZodString;
505
- }, "strip", z.ZodTypeAny, {
506
- type: "skill_query";
507
- timestamp: number;
508
- requestId: string;
509
- id?: string | undefined;
510
- }, {
511
- type: "skill_query";
512
- timestamp: number;
513
- requestId: string;
514
- id?: string | undefined;
515
- }>, z.ZodObject<{
516
- id: z.ZodOptional<z.ZodString>;
517
- timestamp: z.ZodNumber;
518
- } & {
519
- type: z.ZodLiteral<"skill_response">;
520
- requestId: z.ZodString;
521
- skills: z.ZodArray<z.ZodObject<{
522
- name: z.ZodString;
523
- description: z.ZodString;
524
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
525
- }, "strip", z.ZodTypeAny, {
526
- description: string;
527
- name: string;
528
- parameters: Record<string, any>;
529
- }, {
530
- description: string;
531
- name: string;
532
- parameters: Record<string, any>;
533
- }>, "many">;
534
- }, "strip", z.ZodTypeAny, {
535
- type: "skill_response";
536
- timestamp: number;
537
- requestId: string;
538
- skills: {
539
- description: string;
540
- name: string;
541
- parameters: Record<string, any>;
542
- }[];
543
- id?: string | undefined;
544
- }, {
545
- type: "skill_response";
546
- timestamp: number;
547
- requestId: string;
548
- skills: {
549
- description: string;
550
- name: string;
551
- parameters: Record<string, any>;
552
- }[];
553
- id?: string | undefined;
554
- }>, z.ZodObject<{
555
- id: z.ZodOptional<z.ZodString>;
556
- timestamp: z.ZodNumber;
557
- } & {
558
- type: z.ZodLiteral<"skill_invoke">;
559
- requestId: z.ZodString;
560
- skill: z.ZodString;
561
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
562
- }, "strip", z.ZodTypeAny, {
563
- type: "skill_invoke";
564
- timestamp: number;
565
- requestId: string;
566
- parameters: Record<string, any>;
567
- skill: string;
568
- id?: string | undefined;
569
- }, {
570
- type: "skill_invoke";
571
- timestamp: number;
572
- requestId: string;
573
- parameters: Record<string, any>;
574
- skill: string;
575
- id?: string | undefined;
576
- }>, z.ZodObject<{
577
- id: z.ZodOptional<z.ZodString>;
578
- timestamp: z.ZodNumber;
579
- } & {
580
- type: z.ZodLiteral<"skill_result">;
581
- requestId: z.ZodString;
582
- status: z.ZodEnum<["success", "error"]>;
583
- result: z.ZodOptional<z.ZodAny>;
584
- error: z.ZodOptional<z.ZodString>;
585
- }, "strip", z.ZodTypeAny, {
586
- status: "success" | "error";
587
- type: "skill_result";
588
- timestamp: number;
589
- requestId: string;
590
- error?: string | undefined;
591
- result?: any;
592
- id?: string | undefined;
593
- }, {
594
- status: "success" | "error";
595
- type: "skill_result";
596
- timestamp: number;
597
- requestId: string;
598
- error?: string | undefined;
599
- result?: any;
600
- id?: string | undefined;
601
- }>, z.ZodObject<{
602
- id: z.ZodOptional<z.ZodString>;
603
- timestamp: z.ZodNumber;
604
- } & {
605
- type: z.ZodLiteral<"group_message">;
606
- groupId: z.ZodString;
607
- groupName: z.ZodString;
608
- from: z.ZodString;
609
- content: z.ZodString;
610
- }, "strip", z.ZodTypeAny, {
611
- content: string;
612
- type: "group_message";
613
- timestamp: number;
614
- from: string;
615
- groupId: string;
616
- groupName: string;
617
- id?: string | undefined;
618
- }, {
619
- content: string;
620
- type: "group_message";
621
- timestamp: number;
622
- from: string;
623
- groupId: string;
624
- groupName: string;
625
- id?: string | undefined;
626
- }>, z.ZodObject<{
627
- id: z.ZodOptional<z.ZodString>;
628
- timestamp: z.ZodNumber;
629
- } & {
630
- type: z.ZodLiteral<"group_invite">;
631
- groupId: z.ZodString;
632
- groupName: z.ZodString;
633
- inviter: z.ZodString;
634
- }, "strip", z.ZodTypeAny, {
635
- type: "group_invite";
636
- timestamp: number;
637
- groupId: string;
638
- groupName: string;
639
- inviter: string;
640
- id?: string | undefined;
641
- }, {
642
- type: "group_invite";
643
- timestamp: number;
644
- groupId: string;
645
- groupName: string;
646
- inviter: string;
647
- id?: string | undefined;
648
- }>, z.ZodObject<{
649
- id: z.ZodOptional<z.ZodString>;
650
- timestamp: z.ZodNumber;
651
- } & {
652
- type: z.ZodLiteral<"webrtc_offer">;
653
- offer: z.ZodAny;
654
- }, "strip", z.ZodTypeAny, {
655
- type: "webrtc_offer";
656
- timestamp: number;
657
- id?: string | undefined;
658
- offer?: any;
659
- }, {
660
- type: "webrtc_offer";
661
- timestamp: number;
662
- id?: string | undefined;
663
- offer?: any;
664
- }>, z.ZodObject<{
665
- id: z.ZodOptional<z.ZodString>;
666
- timestamp: z.ZodNumber;
667
- } & {
668
- type: z.ZodLiteral<"webrtc_answer">;
669
- answer: z.ZodAny;
670
- }, "strip", z.ZodTypeAny, {
671
- type: "webrtc_answer";
672
- timestamp: number;
673
- id?: string | undefined;
674
- answer?: any;
675
- }, {
676
- type: "webrtc_answer";
677
- timestamp: number;
678
- id?: string | undefined;
679
- answer?: any;
680
- }>, z.ZodObject<{
681
- id: z.ZodOptional<z.ZodString>;
682
- timestamp: z.ZodNumber;
683
- } & {
684
- type: z.ZodLiteral<"webrtc_ice">;
685
- candidate: z.ZodAny;
686
- }, "strip", z.ZodTypeAny, {
687
- type: "webrtc_ice";
688
- timestamp: number;
689
- id?: string | undefined;
690
- candidate?: any;
691
- }, {
692
- type: "webrtc_ice";
693
- timestamp: number;
694
- id?: string | undefined;
695
- candidate?: any;
696
- }>, z.ZodObject<{
697
- id: z.ZodOptional<z.ZodString>;
698
- timestamp: z.ZodNumber;
699
- } & {
700
- type: z.ZodLiteral<"key_exchange">;
701
- publicKey: z.ZodString;
702
- }, "strip", z.ZodTypeAny, {
703
- type: "key_exchange";
704
- timestamp: number;
705
- publicKey: string;
706
- id?: string | undefined;
707
- }, {
708
- type: "key_exchange";
709
- timestamp: number;
710
- publicKey: string;
711
- id?: string | undefined;
712
- }>]>;
713
- export type IdentityChallengeMessage = z.infer<typeof IdentityChallengeSchema>;
714
- export type IdentityResponseMessage = z.infer<typeof IdentityResponseSchema>;
715
- export type ConnectionPendingMessage = z.infer<typeof ConnectionPendingSchema>;
716
- export type ConfirmationResultMessage = z.infer<typeof ConfirmationResultSchema>;
717
- export type TextMessage = z.infer<typeof TextMessageSchema>;
718
- export type MessageAck = z.infer<typeof MessageAckSchema>;
719
- export type SkillQueryMessage = z.infer<typeof SkillQuerySchema>;
720
- export type SkillResponseMessage = z.infer<typeof SkillResponseSchema>;
721
- export type SkillInvokeMessage = z.infer<typeof SkillInvokeSchema>;
722
- export type SkillResultMessage = z.infer<typeof SkillResultSchema>;
723
- export type GroupMessage = z.infer<typeof GroupMessageSchema>;
724
- export type GroupInviteMessage = z.infer<typeof GroupInviteSchema>;
725
- export type WebRTCOfferMessage = z.infer<typeof WebRTCOfferSchema>;
726
- export type WebRTCAnswerMessage = z.infer<typeof WebRTCAnswerSchema>;
727
- export type WebRTCIceMessage = z.infer<typeof WebRTCIceSchema>;
728
- export type KeyExchangeMessage = z.infer<typeof KeyExchangeSchema>;
729
- export type F2AMessage = z.infer<typeof F2AMessageSchema>;
730
- export declare function validateMessage(data: unknown): {
731
- success: true;
732
- data: F2AMessage;
733
- } | {
734
- success: false;
735
- error: string;
736
- };
737
- export declare function createMessageId(): string;
738
- export declare function createTimestamp(): number;
739
- //# sourceMappingURL=messages.d.ts.map