@wowok/agent-mcp 2.2.8 → 2.2.13
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/README.md +5 -5
- package/dist/docs/index.d.ts +3 -0
- package/dist/docs/index.js +2 -0
- package/dist/docs/loader.d.ts +12 -0
- package/dist/docs/loader.js +177 -0
- package/dist/docs/search.d.ts +17 -0
- package/dist/docs/search.js +325 -0
- package/dist/docs/types.d.ts +55 -0
- package/dist/docs/types.js +1 -0
- package/dist/index.d.ts +400 -388
- package/dist/index.js +146 -39
- package/dist/schema/call/allocation.d.ts +23 -23
- package/dist/schema/call/arbitration.d.ts +23 -23
- package/dist/schema/call/base.d.ts +72 -72
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/contact.d.ts +23 -23
- package/dist/schema/call/demand.d.ts +23 -23
- package/dist/schema/call/guard.d.ts +45 -45
- package/dist/schema/call/handler.d.ts +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +28 -28
- package/dist/schema/call/order.d.ts +23 -23
- package/dist/schema/call/payment.d.ts +5 -5
- package/dist/schema/call/permission.d.ts +23 -23
- package/dist/schema/call/personal.d.ts +31 -31
- package/dist/schema/call/progress.d.ts +23 -23
- package/dist/schema/call/proof.d.ts +10 -10
- package/dist/schema/call/repository.d.ts +49 -49
- package/dist/schema/call/reward.d.ts +23 -23
- package/dist/schema/call/service.d.ts +38 -38
- package/dist/schema/call/treasury.d.ts +23 -23
- package/dist/schema/common/index.d.ts +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/local/index.d.ts +63 -63
- package/dist/schema/messenger/index.d.ts +3 -3
- package/dist/schema/query/index.d.ts +1446 -1446
- package/dist/schema/query/index.js +2 -2
- package/dist/schema/utils/guard-query-utils.d.ts +1 -1
- package/dist/schema/utils/guard-query-utils.js +1 -1
- package/dist/schema/utils/permission-index-utils.js +1 -1
- package/docs/README.md +249 -0
- package/docs/WIP.md +388 -0
- package/docs/WTS.md +536 -0
- package/docs/docs/account.md +914 -0
- package/docs/docs/allocation.md +635 -0
- package/docs/docs/arbitration.md +1804 -0
- package/docs/docs/arbitration_state_machine.md +270 -0
- package/docs/docs/contact.md +709 -0
- package/docs/docs/demand.md +948 -0
- package/docs/docs/guard.md +1465 -0
- package/docs/docs/localinfo.md +432 -0
- package/docs/docs/localmark.md +583 -0
- package/docs/docs/machine.md +2490 -0
- package/docs/docs/messenger.md +2098 -0
- package/docs/docs/onchain_events.md +267 -0
- package/docs/docs/order.md +1001 -0
- package/docs/docs/payment.md +512 -0
- package/docs/docs/permission.md +1438 -0
- package/docs/docs/personal.md +742 -0
- package/docs/docs/progress.md +1748 -0
- package/docs/docs/query.md +467 -0
- package/docs/docs/repository.md +1043 -0
- package/docs/docs/reward.md +833 -0
- package/docs/docs/service.md +2130 -0
- package/docs/docs/stage-01-introduction.md +243 -0
- package/docs/docs/stage-02-trust.md +302 -0
- package/docs/docs/stage-03-collaboration.md +337 -0
- package/docs/docs/stage-04-transaction.md +277 -0
- package/docs/docs/stage-05-business.md +151 -0
- package/docs/docs/stage-06-personal.md +203 -0
- package/docs/docs/stage-07-query.md +572 -0
- package/docs/docs/stage-08-examples.md +184 -0
- package/docs/docs/treasury.md +1149 -0
- package/docs/docs/wowok_buildin_info.md +740 -0
- package/docs/examples/Insurance/Insurance.md +594 -0
- package/docs/examples/Insurance/Insurance_TestResults.md +481 -0
- package/docs/examples/Insurance/insurance_complete_guard_v1.json +50 -0
- package/docs/examples/MyShop/MyShop.md +1353 -0
- package/docs/examples/MyShop/MyShop_TestResults.md +1003 -0
- package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
- package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
- package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
- package/docs/examples/MyShop_Advanced/machine_nodes.json +222 -0
- package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
- package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
- package/docs/examples/Travel/Travel.md +1157 -0
- package/docs/examples/Travel/Travel_TestResults.md +743 -0
- package/docs/examples/Travel/calc-weather-timestamps.js +8 -0
- package/docs/examples/Travel/travel_machine_v2_export.json +104 -0
- package/docs/examples/Travel/weather_check_guard_v1.json +51 -0
- package/docs/skills/WOWOK.md +650 -0
- package/docs/skills/onchain_operations/_common.md +406 -0
- package/docs/skills/onchain_operations/_index.md +196 -0
- package/docs/skills/onchain_operations/allocation.md +28 -0
- package/docs/skills/onchain_operations/arbitration.md +106 -0
- package/docs/skills/onchain_operations/contact.md +40 -0
- package/docs/skills/onchain_operations/demand.md +53 -0
- package/docs/skills/onchain_operations/gen_passport.md +23 -0
- package/docs/skills/onchain_operations/guard.md +56 -0
- package/docs/skills/onchain_operations/machine.md +89 -0
- package/docs/skills/onchain_operations/order.md +56 -0
- package/docs/skills/onchain_operations/payment.md +24 -0
- package/docs/skills/onchain_operations/permission.md +68 -0
- package/docs/skills/onchain_operations/personal.md +58 -0
- package/docs/skills/onchain_operations/progress.md +38 -0
- package/docs/skills/onchain_operations/repository.md +70 -0
- package/docs/skills/onchain_operations/reward.md +38 -0
- package/docs/skills/onchain_operations/service.md +78 -0
- package/docs/skills/onchain_operations/treasury.md +68 -0
- package/docs/skills/schema-account_operation.md +402 -0
- package/docs/skills/schema-guard2file.md +153 -0
- package/docs/skills/schema-local_info_operation.md +160 -0
- package/docs/skills/schema-local_mark_operation.md +148 -0
- package/docs/skills/schema-machineNode2file.md +155 -0
- package/docs/skills/schema-messenger_operation.md +547 -0
- package/docs/skills/schema-onchain_events.md +201 -0
- package/docs/skills/schema-onchain_table_data.md +334 -0
- package/docs/skills/schema-query_toolkit.md +395 -0
- package/docs/skills/schema-wip_file.md +240 -0
- package/docs/skills/schema-wowok_buildin_info.md +296 -0
- package/docs/wip-examples/three_body.html +57 -0
- package/docs/wip-examples/three_body.wip +30 -0
- package/package.json +3 -2
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
# Schema: messenger_operation
|
|
2
|
+
|
|
3
|
+
> WoWok encrypted messenger operations: watch conversations (with unread filtering, preview messages), send message, send file, watch messages (with viewed status filtering), extract zip messages, generate WTS, verify WTS, sign WTS, WTS to HTML, proof message on-chain, manage blacklist, friendslist, guardlist, settings, mark messages as viewed, and mark conversation as viewed.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Top-Level Structure
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
MessengerOperation {
|
|
11
|
+
operation: string; // One of 16 operation types (see below)
|
|
12
|
+
// Operation-specific fields
|
|
13
|
+
...
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Operation Types
|
|
20
|
+
|
|
21
|
+
### watch_conversations
|
|
22
|
+
|
|
23
|
+
Watch conversations with unread filtering and preview messages.
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
WatchConversations {
|
|
27
|
+
operation: "watch_conversations";
|
|
28
|
+
filter?: ConversationsFilter;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ConversationsFilter {
|
|
32
|
+
account?: string; // Account name or address. Empty = default
|
|
33
|
+
unreadOnly?: boolean; // Only return conversations with unread messages
|
|
34
|
+
startTime?: number; // Filter by lastMessageAt >= value (ms)
|
|
35
|
+
endTime?: number; // Filter by lastMessageAt <= value (ms)
|
|
36
|
+
previewMessageCount?: number; // Number of preview messages (default: 2)
|
|
37
|
+
sortBy?: "lastMessageAt" | "unreadCount" | "messageCount";
|
|
38
|
+
sortOrder?: "asc" | "desc";
|
|
39
|
+
skipAutoMarkViewed?: boolean; // Don't auto-mark preview messages as viewed
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Result**:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
ConversationInfo[] {
|
|
47
|
+
peerAddress: string; // Peer address
|
|
48
|
+
lastMessageAt: number; // Last message time
|
|
49
|
+
messageCount: number; // Total message count
|
|
50
|
+
unreadCount: number; // Unviewed message count
|
|
51
|
+
lastMessagePreview?: string; // Last message preview text
|
|
52
|
+
previewMessages?: Message[]; // Preview messages
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### send_message
|
|
59
|
+
|
|
60
|
+
Send encrypted message to a peer.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
SendMessage {
|
|
64
|
+
operation: "send_message";
|
|
65
|
+
from?: string; // Sender account. Empty = default
|
|
66
|
+
to: string | { name_or_address?: string; local_mark_first?: boolean };
|
|
67
|
+
content: string; // Message content (max 10000 chars)
|
|
68
|
+
options?: SendMessageOptions;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
SendMessageOptions {
|
|
72
|
+
guardAddress?: string; // Guard address for verification
|
|
73
|
+
passportAddress?: string; // Passport address
|
|
74
|
+
force?: boolean; // Force send even with pending Guard messages
|
|
75
|
+
new_messenger_name?: string; // New messenger name for recipient
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Result**:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
SendMessageResult {
|
|
83
|
+
messageId: string;
|
|
84
|
+
status: "pending" | "confirmed" | "read" | "failed" | "rejected" | "decrypted" | "decrypt_failed";
|
|
85
|
+
merkleData?: {
|
|
86
|
+
leafIndex: number;
|
|
87
|
+
prevRoot: string;
|
|
88
|
+
newRoot: string;
|
|
89
|
+
serverSignature: string;
|
|
90
|
+
serverTimestamp: number;
|
|
91
|
+
serverPublicKey: string;
|
|
92
|
+
};
|
|
93
|
+
guardList?: string[]; // Only on error
|
|
94
|
+
lastReceivedLeafIndex?: number;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### send_file
|
|
101
|
+
|
|
102
|
+
Send file as encrypted ZIP message.
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
SendFile {
|
|
106
|
+
operation: "send_file";
|
|
107
|
+
from?: string; // Sender account. Empty = default
|
|
108
|
+
to: string | { name_or_address?: string; local_mark_first?: boolean };
|
|
109
|
+
filePath: string; // Local file path
|
|
110
|
+
options?: SendFileOptions;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
SendFileOptions {
|
|
114
|
+
fileName?: string; // Custom file name
|
|
115
|
+
contentType?: "wts" | "wip" | "zip";
|
|
116
|
+
guardAddress?: string;
|
|
117
|
+
passportAddress?: string;
|
|
118
|
+
force?: boolean;
|
|
119
|
+
new_messenger_name?: string;
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Result**: `SendMessageResult`
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### watch_messages
|
|
128
|
+
|
|
129
|
+
Watch messages with viewed status filtering.
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
WatchMessages {
|
|
133
|
+
operation: "watch_messages";
|
|
134
|
+
filter?: MessageFilter;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
MessageFilter {
|
|
138
|
+
account?: string; // Account to filter for
|
|
139
|
+
direction?: "sent" | "received";
|
|
140
|
+
status?: "pending" | "confirmed" | "read" | "failed" | "rejected" | "decrypted" | "decrypt_failed";
|
|
141
|
+
peerAddress?: string | { name_or_address?: string; local_mark_first?: boolean };
|
|
142
|
+
msgType?: 1 | 3;
|
|
143
|
+
contentType?: "text" | "zip" | "wts" | "wip";
|
|
144
|
+
decryptedOnly?: boolean;
|
|
145
|
+
confirmedOnly?: boolean;
|
|
146
|
+
keyword?: string; // Search in plaintext
|
|
147
|
+
sortOrder?: "asc" | "desc";
|
|
148
|
+
limit?: number;
|
|
149
|
+
offset?: number;
|
|
150
|
+
timeField?: "createdAt" | "receivedAt" | "serverTimestamp";
|
|
151
|
+
startTime?: number;
|
|
152
|
+
endTime?: number;
|
|
153
|
+
createdAtStart?: number;
|
|
154
|
+
createdAtEnd?: number;
|
|
155
|
+
receivedAtStart?: number;
|
|
156
|
+
receivedAtEnd?: number;
|
|
157
|
+
serverTimestampStart?: number;
|
|
158
|
+
serverTimestampEnd?: number;
|
|
159
|
+
arkConfirmedOnly?: boolean;
|
|
160
|
+
arkTimestampStart?: number;
|
|
161
|
+
arkTimestampEnd?: number;
|
|
162
|
+
proofedOnly?: boolean;
|
|
163
|
+
hasLastReceivedIndexOnly?: boolean;
|
|
164
|
+
lastReceivedIndexMin?: number;
|
|
165
|
+
lastReceivedIndexMax?: number;
|
|
166
|
+
listFilterMode?: "friends" | "guard" | "stranger" | "any";
|
|
167
|
+
customListFilter?: {
|
|
168
|
+
includeAddresses?: string[];
|
|
169
|
+
excludeAddresses?: string[];
|
|
170
|
+
relation?: "union" | "intersection";
|
|
171
|
+
};
|
|
172
|
+
viewed?: boolean; // true = viewed only, false = unviewed only
|
|
173
|
+
viewedAtStart?: number;
|
|
174
|
+
viewedAtEnd?: number;
|
|
175
|
+
skipAutoMarkViewed?: boolean;
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Result**:
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
Message[] {
|
|
183
|
+
messageId: string;
|
|
184
|
+
fromAddress: string;
|
|
185
|
+
toAddress: string;
|
|
186
|
+
plaintextHash: string;
|
|
187
|
+
plaintext?: string; // Decrypted plaintext
|
|
188
|
+
guardAddress?: string;
|
|
189
|
+
passportAddress?: string;
|
|
190
|
+
lastReceivedLeafIndex?: number;
|
|
191
|
+
direction: "sent" | "received";
|
|
192
|
+
status: "pending" | "confirmed" | "read" | "failed" | "rejected" | "decrypted" | "decrypt_failed";
|
|
193
|
+
msgType: 1 | 3;
|
|
194
|
+
leafIndex?: number;
|
|
195
|
+
prevRoot?: string;
|
|
196
|
+
newRoot?: string;
|
|
197
|
+
serverSignature?: string;
|
|
198
|
+
serverTimestamp?: number;
|
|
199
|
+
serverPublicKey?: string;
|
|
200
|
+
arkConfirmed?: {
|
|
201
|
+
recipient: string;
|
|
202
|
+
recipientPublicKey: string;
|
|
203
|
+
signature: string;
|
|
204
|
+
timestamp: number;
|
|
205
|
+
};
|
|
206
|
+
createdAt: number;
|
|
207
|
+
receivedAt?: number;
|
|
208
|
+
zipMetadata?: {
|
|
209
|
+
fileName: string;
|
|
210
|
+
fileSize: number;
|
|
211
|
+
fileHash: string;
|
|
212
|
+
contentType: "text" | "zip" | "wts" | "wip";
|
|
213
|
+
localCachePath?: string;
|
|
214
|
+
downloadedAt?: number;
|
|
215
|
+
};
|
|
216
|
+
proof?: string; // On-chain proof object address
|
|
217
|
+
decryptError?: string;
|
|
218
|
+
decryptAttempts?: number;
|
|
219
|
+
lastDecryptAttemptAt?: number;
|
|
220
|
+
viewedAt?: number; // Timestamp when viewed
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### extract_zip_messages
|
|
227
|
+
|
|
228
|
+
Extract ZIP files from messages.
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
ExtractZipMessages {
|
|
232
|
+
operation: "extract_zip_messages";
|
|
233
|
+
account?: string; // Account. Empty = default
|
|
234
|
+
messages: (string | Message)[]; // Message IDs or Message objects
|
|
235
|
+
outputDir: string; // Output directory path
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Result**: `string[]` (extracted file paths)
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
### generate_wts
|
|
244
|
+
|
|
245
|
+
Generate WTS (Witness Transcript) from message history.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
GenerateWts {
|
|
249
|
+
operation: "generate_wts";
|
|
250
|
+
params: {
|
|
251
|
+
myAccount: string; // My account name or address
|
|
252
|
+
peerAccount: string | { name_or_address?: string; local_mark_first?: boolean };
|
|
253
|
+
range?: WtsRange;
|
|
254
|
+
excludePlaintext?: boolean;
|
|
255
|
+
outputDir: string;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
WtsRange =
|
|
260
|
+
| { type: "time"; start: number; end: number }
|
|
261
|
+
| { type: "messageId"; start: string; end: string }
|
|
262
|
+
| { type: "seqIndex"; start: number; end: number };
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Result**:
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
WtsFileResult {
|
|
269
|
+
files: string[]; // Generated WTS file paths
|
|
270
|
+
totalMessageCount: number;
|
|
271
|
+
timeRange: { start: number; end: number };
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### verify_wts
|
|
278
|
+
|
|
279
|
+
Verify WTS file integrity and signatures.
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
VerifyWts {
|
|
283
|
+
operation: "verify_wts";
|
|
284
|
+
wtsFilePath: string; // WTS file path
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Result**:
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
WtsVerificationResult {
|
|
292
|
+
valid: boolean;
|
|
293
|
+
error?: string;
|
|
294
|
+
hashValid: boolean;
|
|
295
|
+
hasSignature: boolean;
|
|
296
|
+
signatureValid?: boolean;
|
|
297
|
+
signatures?: {
|
|
298
|
+
publicKey: string;
|
|
299
|
+
address?: string;
|
|
300
|
+
valid: boolean;
|
|
301
|
+
}[];
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
### sign_wts
|
|
308
|
+
|
|
309
|
+
Sign WTS file.
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
SignWts {
|
|
313
|
+
operation: "sign_wts";
|
|
314
|
+
wtsFilePath: string;
|
|
315
|
+
account?: string; // Signing account. Empty = default
|
|
316
|
+
outputPath?: string; // Output path (default: signed_*.wts)
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Result**: `string` (signed file path)
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
### wts2html
|
|
325
|
+
|
|
326
|
+
Convert WTS to HTML.
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
Wts2Html {
|
|
330
|
+
operation: "wts2html";
|
|
331
|
+
wtsPath: string; // WTS file or directory path
|
|
332
|
+
options?: {
|
|
333
|
+
title?: string; // HTML page title
|
|
334
|
+
theme?: "light" | "dark";
|
|
335
|
+
outputPath?: string; // Output file/directory path
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**Result**: `string | string[]` (HTML string or file paths)
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
### proof_message
|
|
345
|
+
|
|
346
|
+
Proof message on-chain.
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
ProofMessage {
|
|
350
|
+
operation: "proof_message";
|
|
351
|
+
account?: string; // Account. Empty = default
|
|
352
|
+
messageId: string; // Message ID to proof
|
|
353
|
+
network?: "localnet" | "testnet";
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Result**:
|
|
358
|
+
|
|
359
|
+
```typescript
|
|
360
|
+
{
|
|
361
|
+
proofAddress: string; // Proof object address on blockchain
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
### blacklist
|
|
368
|
+
|
|
369
|
+
Manage blacklist.
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
BlacklistOperation {
|
|
373
|
+
operation: "blacklist";
|
|
374
|
+
account?: string; // Account. Empty = default
|
|
375
|
+
blacklist: {
|
|
376
|
+
op: "add" | "remove" | "clear" | "get" | "exist";
|
|
377
|
+
users?: (string | { name_or_address?: string; local_mark_first?: boolean })[];
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Result**:
|
|
383
|
+
|
|
384
|
+
```typescript
|
|
385
|
+
BlacklistResult {
|
|
386
|
+
success: boolean;
|
|
387
|
+
operation: "add" | "remove" | "clear" | "get" | "exist";
|
|
388
|
+
modifiedCount: number;
|
|
389
|
+
currentCount: number;
|
|
390
|
+
maxCount: number;
|
|
391
|
+
invalidAddresses?: string[];
|
|
392
|
+
existResults?: { address: string; exists: boolean }[];
|
|
393
|
+
message?: string;
|
|
394
|
+
currentList?: string[];
|
|
395
|
+
}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
### friendslist
|
|
401
|
+
|
|
402
|
+
Manage friends list.
|
|
403
|
+
|
|
404
|
+
```typescript
|
|
405
|
+
FriendslistOperation {
|
|
406
|
+
operation: "friendslist";
|
|
407
|
+
account?: string; // Account. Empty = default
|
|
408
|
+
friendslist: {
|
|
409
|
+
op: "add" | "remove" | "clear" | "get" | "exist";
|
|
410
|
+
users?: (string | { name_or_address?: string; local_mark_first?: boolean })[];
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
**Result**:
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
FriendslistResult {
|
|
419
|
+
success: boolean;
|
|
420
|
+
operation: "add" | "remove" | "clear" | "get" | "exist";
|
|
421
|
+
modifiedCount: number;
|
|
422
|
+
currentCount: number;
|
|
423
|
+
maxCount: number;
|
|
424
|
+
invalidAddresses?: string[];
|
|
425
|
+
existResults?: { address: string; exists: boolean }[];
|
|
426
|
+
message?: string;
|
|
427
|
+
currentList?: string[];
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
### guardlist
|
|
434
|
+
|
|
435
|
+
Manage guard list.
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
GuardlistOperation {
|
|
439
|
+
operation: "guardlist";
|
|
440
|
+
account?: string; // Account. Empty = default
|
|
441
|
+
guardlist: {
|
|
442
|
+
op: "add" | "remove" | "get";
|
|
443
|
+
guards?: GuardParam[]; // For add op (1-10 items)
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
GuardParam {
|
|
448
|
+
guard: string; // Guard address or name
|
|
449
|
+
passportValiditySeconds: number; // 10s to 10 years
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
**Result**:
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
GuardlistResult {
|
|
457
|
+
success: boolean;
|
|
458
|
+
operation: "add" | "remove" | "get";
|
|
459
|
+
modifiedCount: number;
|
|
460
|
+
currentCount: number;
|
|
461
|
+
maxCount: number;
|
|
462
|
+
invalidAddresses?: string[];
|
|
463
|
+
existResults?: { address: string; exists: boolean }[];
|
|
464
|
+
message?: string;
|
|
465
|
+
currentGuardList?: {
|
|
466
|
+
guardAddress: string;
|
|
467
|
+
passportValiditySeconds: number;
|
|
468
|
+
}[];
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
### settings
|
|
475
|
+
|
|
476
|
+
Manage messenger settings.
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
SettingsOperation {
|
|
480
|
+
operation: "settings";
|
|
481
|
+
account?: string; // Account. Empty = default
|
|
482
|
+
settings: {
|
|
483
|
+
op: "get" | "set";
|
|
484
|
+
allowStrangerMessages?: boolean;
|
|
485
|
+
maxInboxSize?: number; // Minimum 1
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
**Result**:
|
|
491
|
+
|
|
492
|
+
```typescript
|
|
493
|
+
SettingsResult =
|
|
494
|
+
| { // For "get" operation
|
|
495
|
+
allowStrangerMessages?: boolean;
|
|
496
|
+
maxInboxSize?: number;
|
|
497
|
+
minUserInboxSize: number;
|
|
498
|
+
maxUserInboxSize: number;
|
|
499
|
+
defaultAllowStrangerMessages: boolean;
|
|
500
|
+
}
|
|
501
|
+
| boolean; // For "set" operation
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
### mark_messages_as_viewed
|
|
507
|
+
|
|
508
|
+
Mark specific messages as viewed.
|
|
509
|
+
|
|
510
|
+
```typescript
|
|
511
|
+
MarkMessagesAsViewed {
|
|
512
|
+
operation: "mark_messages_as_viewed";
|
|
513
|
+
account?: string; // Account. Empty = default
|
|
514
|
+
messageIds: string[]; // 1-1000 message IDs
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**Result**: `number` (count of messages marked as viewed)
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
### mark_conversation_as_viewed
|
|
523
|
+
|
|
524
|
+
Mark all messages in a conversation as viewed.
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
MarkConversationAsViewed {
|
|
528
|
+
operation: "mark_conversation_as_viewed";
|
|
529
|
+
account?: string; // Account. Empty = default
|
|
530
|
+
peerAddress: string | { name_or_address?: string; local_mark_first?: boolean };
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
**Result**: `number` (count of messages marked as viewed)
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## Output Structure
|
|
539
|
+
|
|
540
|
+
```typescript
|
|
541
|
+
MessengerOperationOutput {
|
|
542
|
+
result: {
|
|
543
|
+
operation: string; // The operation type
|
|
544
|
+
result: OperationResult; // Operation-specific result
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
```
|