larkmate 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,547 @@
1
+ syntax = "proto3";
2
+
3
+ // ============================================================
4
+ // Feishu/Lark Internal Protobuf Protocol
5
+ // Reverse-engineered from Feishu Web Client
6
+ // Reference: https://github.com/cv-cat/LarkAgentX
7
+ // ============================================================
8
+
9
+ // --- Transport Layer ---
10
+
11
+ message Frame {
12
+ optional uint64 seqid = 1;
13
+ optional uint64 logid = 2;
14
+ optional int32 service = 3;
15
+ optional int32 method = 4;
16
+ repeated ExtendedEntry headers = 5;
17
+ optional string payloadEncoding = 6;
18
+ optional string payloadType = 7;
19
+ optional bytes payload = 8;
20
+ }
21
+
22
+ message Packet {
23
+ optional string sid = 1;
24
+ optional PayloadType payloadType = 2;
25
+ optional int32 cmd = 3;
26
+ optional uint32 status = 4;
27
+ optional bytes payload = 5;
28
+ optional string cid = 6;
29
+ }
30
+
31
+ enum PayloadType {
32
+ TYPE_UNKNOWN = 0;
33
+ PB2 = 1;
34
+ JSON = 2;
35
+ }
36
+
37
+ message ExtendedEntry {
38
+ optional string key = 1;
39
+ optional string value = 2;
40
+ }
41
+
42
+ // --- Message Types ---
43
+
44
+ enum Type {
45
+ UNKNOWN = 0;
46
+ POST = 2;
47
+ FILE = 3;
48
+ TEXT = 4;
49
+ IMAGE = 5;
50
+ SYSTEM = 6;
51
+ AUDIO = 7;
52
+ STICKER = 10;
53
+ CARD = 14;
54
+ MEDIA = 15;
55
+ }
56
+
57
+ enum FromType {
58
+ UNKNOWN_FROMTYPE = 0;
59
+ USER = 1;
60
+ BOT = 2;
61
+ }
62
+
63
+ enum ChatType {
64
+ UNKNOWN_CHAT_TYPE = 0;
65
+ P2P = 1;
66
+ GROUP = 2;
67
+ TOPIC_GROUP = 3;
68
+ }
69
+
70
+ // --- Send Message (cmd=5) ---
71
+
72
+ message PutMessageRequest {
73
+ optional Type type = 1;
74
+ optional Content content = 2;
75
+ optional string chatId = 3;
76
+ optional string rootId = 4;
77
+ optional string parentId = 5;
78
+ optional string cid = 6;
79
+ optional bool isNotified = 7;
80
+ optional bool sendToChat = 8;
81
+ optional int32 version = 9;
82
+ }
83
+
84
+ // --- Receive Messages (WebSocket push) ---
85
+
86
+ message PushMessagesRequest {
87
+ map<string, MessageEntity> messages = 1;
88
+ map<string, bool> participatedMessageIds = 3;
89
+ map<string, bool> forcePush = 8;
90
+ map<string, bool> messagesAtMe = 9;
91
+ }
92
+
93
+ message MessageEntity {
94
+ optional string id = 1;
95
+ optional Type type = 2;
96
+ optional string fromId = 3;
97
+ optional int64 createTime = 4;
98
+ optional bytes content = 5;
99
+ optional MessageStatus status = 6;
100
+ optional FromType fromType = 7;
101
+ optional string rootId = 8;
102
+ optional string parentId = 9;
103
+ optional string chatId = 10;
104
+ optional int64 lastModifyTime = 11;
105
+ optional string cid = 12;
106
+ optional int32 position = 13;
107
+ optional int64 updateTime = 14;
108
+ optional bool isNotified = 15;
109
+ optional string threadId = 20;
110
+ optional ChatType chatType = 46;
111
+
112
+ enum MessageStatus {
113
+ UNKNOWN_STATUS = 0;
114
+ NORMAL = 1;
115
+ DELETED = 2;
116
+ MODIFIED = 3;
117
+ }
118
+ }
119
+
120
+ // --- Content ---
121
+
122
+ message Content {
123
+ optional string text = 1;
124
+ optional string imageKey = 2;
125
+ optional string title = 3;
126
+ // Image metadata fields (v1.3.9 — reverse-engineered via brute-force probe;
127
+ // see scripts/explore-image-minimize.js). Required for IMAGE messages on the
128
+ // cookie-protobuf path: imageKey + thumbnailKey(10) is the minimum the
129
+ // gateway accepts. width(4) / height(5) / mimeType(8) / fileSize(9) are
130
+ // optional but commonly present in the real wire format.
131
+ optional int32 imageWidth = 4;
132
+ optional int32 imageHeight = 5;
133
+ optional string fileKey = 6;
134
+ optional string audioKey = 7;
135
+ optional string mimeType = 8;
136
+ optional int64 fileSize = 13;
137
+ optional string thumbnailKey = 10;
138
+ optional string fileName = 11;
139
+ optional string fileMime = 12;
140
+ optional RichText richText = 14;
141
+ optional string stickerSetId = 24;
142
+ optional string stickerId = 25;
143
+ }
144
+
145
+ message TextContent {
146
+ optional string text = 1;
147
+ optional RichText richText = 3;
148
+ }
149
+
150
+ message PostContent {
151
+ optional string title = 1;
152
+ optional string text = 2;
153
+ optional RichText richText = 6;
154
+ }
155
+
156
+ message RichText {
157
+ repeated string elementIds = 1;
158
+ optional string innerText = 2;
159
+ optional RichTextElements elements = 3;
160
+ // Index fields: each "*Ids" is a list of elemIds (pointing into the dictionary)
161
+ // that the server needs to register as special-type elements. Discovered from
162
+ // Feishu Web bundle — atIds=6 is what makes @-mentions actually notify.
163
+ repeated string imageIds = 5;
164
+ repeated string atIds = 6;
165
+ repeated string anchorIds = 7;
166
+ repeated string i18nIds = 8;
167
+ repeated string mediaIds = 9;
168
+ repeated string docsIds = 10;
169
+ repeated string interactiveIds = 11;
170
+ repeated string mentionIds = 12;
171
+ optional int32 version = 13;
172
+ repeated string atUserGroupIds = 14;
173
+ }
174
+
175
+ message RichTextElements {
176
+ map<string, RichTextElement> dictionary = 1;
177
+ }
178
+
179
+ message RichTextElement {
180
+ optional Tag tag = 1;
181
+ map<string, string> style = 2;
182
+ optional bytes property = 3;
183
+ repeated string childIds = 4;
184
+
185
+ enum Tag {
186
+ UNKNOWN_TAG = 0;
187
+ TEXT = 1;
188
+ IMG = 2;
189
+ P = 3;
190
+ FIGURE = 4;
191
+ AT = 5;
192
+ A = 6;
193
+ }
194
+ }
195
+
196
+ message TextProperty {
197
+ optional string content = 1;
198
+ }
199
+
200
+ // For AT (@-mention) elements. Both fields are required in the real schema;
201
+ // `content` is marked deprecated but still required on the wire.
202
+ message AtProperty {
203
+ optional string userId = 1;
204
+ optional string content = 2;
205
+ }
206
+
207
+ // For A (hyperlink) elements.
208
+ message AnchorProperty {
209
+ optional string href = 1;
210
+ optional string content = 2;
211
+ optional string textContent = 3;
212
+ }
213
+
214
+ // --- Chat Operations ---
215
+
216
+ // Create a P2P or group chat (cmd=13).
217
+ message PutChatRequest {
218
+ optional ChatType type = 1;
219
+ repeated string userIds = 2;
220
+ optional string groupName = 3;
221
+ optional string groupDesc = 4;
222
+ optional bool isPublic = 5;
223
+ repeated string chatterIds = 6;
224
+ optional string cid = 16;
225
+ }
226
+
227
+ message PutChatResponse {
228
+ optional Chat chat = 1;
229
+ }
230
+
231
+ // Invite chatters to an existing chat (cmd=47).
232
+ message PutChatChatterRequest {
233
+ optional string chatId = 1;
234
+ repeated string chatterIds = 2;
235
+ optional bool isInviteAtChatters = 3;
236
+ }
237
+
238
+ message PutChatChatterResponse {
239
+ optional Chat chat = 1;
240
+ }
241
+
242
+ // Read a page of chatters (cmd=44).
243
+ message PullChatChattersRequest {
244
+ optional string chatId = 1;
245
+ optional bool needChatters = 2;
246
+ optional int64 cursor = 3;
247
+ optional string offset = 4;
248
+ optional int32 limit = 5;
249
+ }
250
+
251
+ message PullChatChattersResponse {
252
+ map<string, Chatter> chatters = 1;
253
+ map<string, Chatter> updateChatters = 3;
254
+ optional int64 nextCursor = 5;
255
+ optional string nextOffset = 9;
256
+ }
257
+
258
+ // Resolve user and bot IDs before selecting the correct invitation path (cmd=46).
259
+ message PullChattersByIdsRequest {
260
+ repeated string chatterIds = 1;
261
+ optional bool needBotInfo = 2;
262
+ optional bool notSubscribeChatters = 3;
263
+ }
264
+
265
+ message PullChattersByIdsResponse {
266
+ map<string, Chatter> chatters = 1;
267
+ }
268
+
269
+ // Read chat details (cmd=64) and message positions (cmd=43).
270
+ message PullChatsByIdsRequest {
271
+ repeated string chatIds = 1;
272
+ }
273
+
274
+ message PullChatsByIdsResponse {
275
+ map<string, Chat> chats = 1;
276
+ repeated string unauthorizedChatIds = 2;
277
+ }
278
+
279
+ // Edit or dissolve a group (cmd=72). Only explicitly listed fields change.
280
+ message PatchGroupChatRequest {
281
+ optional int64 chatId = 1;
282
+ optional string name = 2;
283
+ optional string description = 4;
284
+ optional bool isDissolved = 18;
285
+ repeated UpdateFields updateFields = 999;
286
+
287
+ enum UpdateFields {
288
+ UPDATE_FIELDS_UNSPECIFIED = 0;
289
+ NAME = 1;
290
+ DESCRIPTION = 3;
291
+ IS_DISSOLVED = 16;
292
+ }
293
+ }
294
+
295
+ message PatchGroupChatResponse {
296
+ optional Chat chat = 1;
297
+ }
298
+
299
+ message PullMessagesByPositionsRequest {
300
+ optional string chatId = 1;
301
+ repeated int32 positions = 2;
302
+ }
303
+
304
+ message PullMessagesByPositionsResponse {
305
+ map<int32, MessageEntity> messages = 1;
306
+ repeated int32 burnedMessages = 8;
307
+ repeated int32 expiredMessages = 9;
308
+ optional bool hasMore = 11;
309
+ optional int32 nextPosition = 12;
310
+ }
311
+
312
+ message Chatter {
313
+ optional string id = 1;
314
+ optional string name = 2;
315
+ optional int32 type = 9;
316
+ }
317
+
318
+ // Get group info (cmd=64)
319
+ message GetGroupInfoRequest {
320
+ optional string chatId = 1;
321
+ }
322
+
323
+ message GetGroupInfoResponse {
324
+ optional Chat chat = 1;
325
+ }
326
+
327
+ message Chat {
328
+ optional string id = 1;
329
+ optional ChatTypeEnum type = 2;
330
+ optional string lastMessageId = 3;
331
+ optional string name = 4;
332
+ optional string ownerId = 6;
333
+ optional int32 newMessageCount = 7;
334
+ optional int64 updateTime = 9;
335
+ optional string description = 11;
336
+ optional int32 memberCount = 12;
337
+ optional bool isPublic = 14;
338
+ optional int32 lastMessagePosition = 15;
339
+ optional int32 userCount = 16;
340
+ optional int64 createTime = 18;
341
+ optional string tenantId = 25;
342
+ optional bool isDissolved = 30;
343
+ optional string lastVisibleMessageId = 32;
344
+ optional int32 readPosition = 48;
345
+ optional int32 lastVisibleMessagePosition = 46;
346
+ optional bool isCrossTenant = 41;
347
+ optional Announcement announcement = 24;
348
+
349
+ enum ChatTypeEnum {
350
+ UNKNOWN_CHAT = 0;
351
+ P2P_CHAT = 1;
352
+ GROUP_CHAT = 2;
353
+ TOPIC_GROUP_CHAT = 3;
354
+ }
355
+
356
+ message Announcement {
357
+ optional string content = 1;
358
+ optional int64 updateTime = 2;
359
+ optional string lastEditorId = 3;
360
+ optional string docUrl = 4;
361
+ }
362
+ }
363
+
364
+ // --- Search (cmd=11021) ---
365
+
366
+ message UniversalSearchRequest {
367
+ optional SearchCommonRequestHeader header = 1;
368
+ }
369
+
370
+ message SearchCommonRequestHeader {
371
+ optional string searchSession = 1;
372
+ optional int32 sessionSeqId = 2;
373
+ optional string query = 3;
374
+ optional string paginationToken = 4;
375
+ optional SearchContext searchContext = 5;
376
+ optional string locale = 6;
377
+ optional int32 pageSize = 11;
378
+
379
+ message SearchContext {
380
+ optional string tagName = 1;
381
+ repeated EntityItem entityItems = 2;
382
+ optional CommonFilter commonFilter = 3;
383
+ optional string sourceKey = 5;
384
+ }
385
+ }
386
+
387
+ message EntityItem {
388
+ optional SearchEntityType type = 1;
389
+ optional EntityFilter filter = 2;
390
+
391
+ message EntityFilter {
392
+ oneof filter {
393
+ GroupChatFilter groupChatFilter = 2;
394
+ }
395
+ }
396
+ }
397
+
398
+ message GroupChatFilter {}
399
+
400
+ message CommonFilter {
401
+ optional bool includeOuterTenant = 1;
402
+ }
403
+
404
+ enum SearchEntityType {
405
+ SEARCH_UNKNOWN = 0;
406
+ SEARCH_USER = 1;
407
+ SEARCH_BOT = 2;
408
+ SEARCH_GROUP_CHAT = 3;
409
+ }
410
+
411
+ message UniversalSearchResponse {
412
+ optional SearchResponseHeader header = 1;
413
+ repeated SearchResult results = 2;
414
+ }
415
+
416
+ message SearchResponseHeader {
417
+ optional int32 total = 3;
418
+ optional bool hasMore = 4;
419
+ }
420
+
421
+ message SearchResult {
422
+ optional string id = 1;
423
+ optional SearchEntityType type = 2;
424
+ optional string titleHighlighted = 3;
425
+ optional string summaryHighlighted = 4;
426
+ optional string avatarKey = 6;
427
+ }
428
+
429
+ // --- User Info (cmd=5023) ---
430
+
431
+ message GetUserInfoRequest {
432
+ optional int64 chatId = 1;
433
+ optional int64 userId = 3;
434
+ optional int32 userType = 4;
435
+ }
436
+
437
+ message UserInfo {
438
+ optional UserInfoDetail userInfoDetail = 1;
439
+ }
440
+
441
+ message UserInfoDetail {
442
+ optional Detail detail = 2;
443
+ }
444
+
445
+ message Detail {
446
+ optional bytes nickname = 2;
447
+ optional bytes nickname1 = 4;
448
+ optional bytes nickname4 = 17;
449
+ repeated LocaleEntry locales = 18;
450
+ }
451
+
452
+ message LocaleEntry {
453
+ optional string key_string = 1;
454
+ optional string translation = 2;
455
+ }
456
+
457
+ // Web inbox cards and user file upload messages.
458
+ message PullFeedCardsRequest {
459
+ optional int32 type = 1;
460
+ optional int32 pullType = 2;
461
+ optional int64 cursor = 3;
462
+ optional int32 count = 4;
463
+ optional int64 parentCardId = 5;
464
+ }
465
+ message InboxCard {
466
+ optional string id = 1;
467
+ optional int32 type = 2;
468
+ optional int64 updateTime = 3;
469
+ optional int64 parentCardId = 5;
470
+ optional int32 feedType = 7;
471
+ optional FeedCardField feedCardField = 13;
472
+ }
473
+ message PullFeedCardsResponse {
474
+ map<string, Chat> chats = 1;
475
+ repeated InboxCard cards = 3;
476
+ optional int64 nextCursor = 4;
477
+ }
478
+ message CreateFileUploadRequest {
479
+ optional int32 fileType = 3;
480
+ optional string fileName = 5;
481
+ optional int64 fileSize = 6;
482
+ }
483
+ message CreateFileUploadResponse { optional string uploadId = 1; }
484
+ message UploadFilePartResponse { optional uint32 partId = 1; optional uint32 crc32 = 2; }
485
+ message CompleteFileUploadRequest {
486
+ optional string uploadId = 1;
487
+ optional int32 fileType = 2;
488
+ map<uint32, uint32> partToCrc32 = 3;
489
+ optional string fileName = 4;
490
+ optional string mime = 5;
491
+ }
492
+ message CompleteFileUploadResponse { optional int32 code = 1; }
493
+ message PutMessageResponse { optional MessageEntity message = 1; }
494
+ message FileContent {
495
+ optional string key = 1;
496
+ optional string name = 2;
497
+ optional int64 size = 3;
498
+ optional string mime = 4;
499
+ }
500
+ message ImageContent {
501
+ optional ImageSet image = 1;
502
+ optional ImageSetV2 imageV2 = 2;
503
+ }
504
+ message ImageSet { optional string key = 1; optional string imageKey = 4; }
505
+ message ImageSetV2 { optional string imageKey = 1; }
506
+
507
+ // Personal message-list controls (web gateway).
508
+ message FeedIdentity { optional string id = 1; optional int32 type = 2; }
509
+ message Shortcut { optional string id = 1; optional int32 type = 2; optional int32 position = 3; }
510
+ message PullShortcutsRequest { optional int32 position = 1; optional int32 count = 2; optional int64 version = 3; }
511
+ message PullShortcutsResponse { repeated Shortcut shortcuts = 1; optional bool hasMore = 2; optional int64 currentVersion = 3; }
512
+ message PutShortcutsRequest { repeated Shortcut shortcuts = 1; }
513
+ message DeleteShortcutsRequest { repeated Shortcut shortcuts = 1; }
514
+ message FlagItem { optional int64 itemId = 1; optional int32 itemType = 2; optional int32 flagType = 3; optional int64 createTime = 4; optional int64 updateTime = 5; }
515
+ message PullFlagsRequest { optional string cursor = 1; optional int64 count = 2; }
516
+ message PullFlagsResponse { repeated FlagItem items = 1; optional bool hasMore = 3; optional string nextCursor = 4; }
517
+ message UpdateFlagsRequest { repeated FlagItem items = 1; repeated FlagItem deletedItems = 2; }
518
+ message FeedGroup { optional int64 id = 1; optional int32 type = 2; optional bool isDefault = 3; optional string name = 4; optional int64 pos = 5; }
519
+ message FeedGroupItem { optional int64 feedCardId = 1; optional int32 feedCardType = 2; optional int64 groupId = 3; optional int64 pos = 4; optional int64 updateTime = 5; optional bool exclude = 6; }
520
+ message PullFeedGroupsRequest { optional string cursor = 1; optional int64 count = 2; optional bool isRebuilding = 3; optional int32 version = 4; }
521
+ message PullFeedGroupsResponse { repeated FeedGroup feedGroups = 1; optional bool hasMore = 3; optional string nextCursor = 4; optional bool needRebuilding = 5; }
522
+ message FeedGroupItemArgs { optional string cursor = 1; optional int64 count = 2; }
523
+ message FeedGroupItemArgsEntry { optional int64 key = 1; optional FeedGroupItemArgs value = 2; }
524
+ message PullFeedGroupItemsRequest { repeated FeedGroupItemArgsEntry args = 1; }
525
+ message FeedGroupItemPage { repeated FeedGroupItem items = 1; optional bool hasMore = 3; optional string nextCursor = 4; optional bool needRebuilding = 5; }
526
+ message FeedGroupItemPageEntry { optional int64 key = 1; optional FeedGroupItemPage value = 2; }
527
+ message PullFeedGroupItemsResponse { repeated FeedGroupItemPageEntry data = 1; }
528
+ message CreateFeedGroupRequest { optional FeedGroup feedGroup = 1; repeated FeedGroupItem feedGroupItems = 2; }
529
+ message CreateFeedGroupResponse { optional FeedGroup feedGroup = 1; repeated FeedGroupItem feedGroupItems = 2; }
530
+ message FeedGroupUpdateFields { repeated int32 fields = 1 [packed=false]; }
531
+ message FeedGroupUpdateFieldsEntry { optional int64 key = 1; optional FeedGroupUpdateFields value = 2; }
532
+ message UpdateFeedGroupsRequest { repeated FeedGroup feedGroups = 1; repeated FeedGroup deletedGroups = 2; repeated FeedGroupItem feedGroupItems = 3; repeated FeedGroupItem deletedFeedGroupItems = 4; repeated FeedGroupUpdateFieldsEntry feedGroupsUpdateFields = 5; }
533
+ message FeedMarkAsUnread { optional bool unread = 1; optional int64 updateTimeMs = 2; optional int64 readPos = 3; }
534
+ message FeedCardField { optional FeedMarkAsUnread markAsUnread = 5; }
535
+ message PullFeedCardsByIdsRequest { repeated string cardIds = 1; repeated FeedIdentity feedCardIdentities = 2; }
536
+ message PullFeedCardsByIdsResponse { map<string, InboxCard> cards = 1; }
537
+ message PatchFeedCardUnreadRequest { optional FeedIdentity card = 1; optional bool markAsUnread = 2; optional int64 readPos = 3; }
538
+ message PatchFeedCardUnreadResponse { optional InboxCard card = 1; }
539
+ message ChatSetting { optional bool isRemind = 1; }
540
+ message PullChatSettingsRequest { repeated string chatIds = 1; }
541
+ message PullChatSettingsResponse { map<string, ChatSetting> chatSettings = 1; }
542
+ message PatchChatSettingRequest { optional string chatId = 1; optional ChatSetting chatSetting = 2; repeated int32 updateChatSettingField = 3; }
543
+ message PatchChatSettingResponse { optional string chatId = 1; optional ChatSetting chatSetting = 2; }
544
+ message BoxCardsRequest { map<string, int32> feedCards = 1; }
545
+ message PatchFeedCardsRequest { optional int32 type = 1; repeated string ids = 2; repeated InboxCard cards = 3; }
546
+ message PutReadMessagesRequest { optional string chatId = 1; repeated string messageIds = 2; optional int32 maxPosition = 3; }
547
+ message PutReadMessagesResponse { optional int32 lastMessagePosition = 1; optional int32 newMessageCount = 2; optional int32 readPosition = 6; }
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: larkmate
3
+ description: 使用 LarkMate 以当前飞书网页用户身份查询和管理会话、读取消息、发送文本或文件、操作群组,以及查询录制妙记、申请访问和导出文字记录。当用户要求使用 LarkMate 或需要这些个人飞书操作时使用;不负责飞书文档或日历。
4
+ ---
5
+
6
+ # LarkMate
7
+
8
+ 使用 `larkmate` 操作当前用户可访问的飞书数据。它使用自己的网页 Cookie,不依赖 Lark CLI 或应用身份。命令和选项以 `larkmate --help`、`larkmate <命令> --help` 为准;尚未安装或登录时参照 LarkMate 项目的 `INSTALL.md`。不要输出、索取或粘贴 Cookie;用户应自行在本机配置。
9
+
10
+ 根据任务读取所需参考:
11
+
12
+ - 查找会话、阅读历史、会话状态和标签: [会话与消息](references/chats.md)。
13
+ - 发送消息或文件、管理群组和成员: [发送与群组](references/writes.md)。
14
+ - 查找录制妙记、导出文字记录、查询或申请访问权限: [录制妙记](references/minutes.md)。
15
+
16
+ 命令输出 JSON:成功为 `ok: true`,失败为 `ok: false`,检查退出码和错误信息。飞书网页客户端数字 ID 与开放平台 ID 不同;按实际查询结果选定对象,名称相近时先消歧。列表和搜索有分页或扫描范围,无法读取的内容、缺失结果和权限错误应如实说明。
17
+
18
+ `chat-open` 会打开或创建私聊,发送、群组、会话状态和妙记权限申请命令也会修改数据;按照用户的实际意图操作。写入返回 `EFFECT_UNKNOWN`、`submitted_unconfirmed` 或部分成功时,先查询实际状态,避免重复提交。不要将消息已发送当作对方已读。
@@ -0,0 +1,30 @@
1
+ # 会话与消息
2
+
3
+ ```sh
4
+ larkmate search --query '名称或关键词'
5
+ larkmate chats --limit 50
6
+ larkmate chats --cursor "$NEXT_CURSOR"
7
+ larkmate chats --parent "$BOX_ID"
8
+ larkmate chat-info --chat "$CHAT_ID"
9
+ larkmate history --chat "$CHAT_ID" --limit 50 --pages 3
10
+ ```
11
+
12
+ `chats` 默认读取收件箱的一页,不是全部历史会话。`--type`、`--state` 只过滤当前页,`--scope done` 查询已完成分组;`boxes` 用 `--parent` 单独读取,`nextCursor` 用于翻页。`history` 每页最多 100 个位置,`--pages` 最多 100 页;`--query`、`--sender`、`--after`、`--before` 只过滤已扫描的位置,不是全量搜索。`omittedPositions` 是没有返回的位置数,不是消息数;部分消息类型可能没有可解析正文。
13
+
14
+ ```sh
15
+ larkmate pinned
16
+ larkmate marked
17
+ larkmate chat-state --chat "$CHAT_ID"
18
+ larkmate pin --chat "$CHAT_ID" # 取消置顶:unpin
19
+ larkmate mark --chat "$CHAT_ID" # 取消旗帜标记:unmark
20
+ larkmate unread --chat "$CHAT_ID" # 标为已读:read
21
+ larkmate mute --chat "$CHAT_ID" # 取消免打扰:unmute
22
+ larkmate done --chat "$CHAT_ID" # 回到收件箱:inbox
23
+ larkmate box --chat "$CHAT_ID" # 取消收纳:unbox
24
+ larkmate labels
25
+ larkmate label-chats --label "$LABEL_ID"
26
+ larkmate label-add --label "$LABEL_ID" --chat "$CHAT_ID"
27
+ larkmate label-remove --label "$LABEL_ID" --chat "$CHAT_ID"
28
+ ```
29
+
30
+ `mark` 对应聊天右键菜单的旗帜“标记”。`read` 会推进到调用时最新可见位置并清除手动未读标记;`unread` 可能把已完成会话放回收件箱。标签创建、重命名和删除分别使用 `label-create`、`label-rename`、`label-delete`,会话成员调整仅支持手动标签。删除标签会删除整个个人标签。
@@ -0,0 +1,14 @@
1
+ # 录制妙记
2
+
3
+ ```sh
4
+ larkmate minutes-list --limit 20
5
+ larkmate minutes-list --cursor "$NEXT_CURSOR"
6
+ larkmate minutes-access-info --minute "$MINUTES_URL"
7
+ larkmate minutes-request-access --minute "$MINUTES_URL" --reason '需要查看会议文字记录'
8
+ larkmate minutes-export --minute "$MINUTES_URL" --output transcript.txt
9
+ larkmate minutes-export --minute "$MINUTES_URL" --format markdown --output transcript.md
10
+ ```
11
+
12
+ `minutes-list` 列出当前用户可访问的录制妙记,使用 `nextCursor` 继续翻页;`--minute` 接受妙记链接或列表中的 `object_token`。导出默认包含说话人和时间戳,分别用 `--no-speakers` 和 `--no-timestamps` 关闭。不指定 `--output` 时,文本位于 JSON 输出的 `content` 字段;指定文件必须不存在。字幕超过 10000 段或数据不完整时命令报错,不会写出残缺记录。
13
+
14
+ `minutes-access-info` 只读所有者和是否允许申请;`minutes-request-access` 会向所有者提交查看权限申请,仅在用户有此意图时执行,`--reason` 可省略。`submitted` 表示已提交,不能当作已获得权限;`EFFECT_UNKNOWN` 表示结果不确定,先确认是否收到,避免重复申请。当前不支持创建飞书文档、查询没有录制妙记的历史会议或获取会议智能纪要;不要把录制文字记录说成智能纪要。
@@ -0,0 +1,23 @@
1
+ # 发送与群组
2
+
3
+ 只在用户要求的目标和内容明确时发送消息或文件;从 `search`、`chats` 等结果取得网页客户端数字 ID,确认目标后再操作。`chat-open --id` 会打开或创建私聊。
4
+
5
+ ```sh
6
+ larkmate send --chat "$CHAT_ID" --text '消息内容'
7
+ larkmate send --chat "$CHAT_ID" --text '@名称 消息内容' --mention "$MEMBER_ID:名称"
8
+ larkmate send-file --chat "$CHAT_ID" --file ./report.pdf
9
+ ```
10
+
11
+ 文件须为非空普通文件且不超过 100 MiB。`accepted` 表示服务器返回消息 ID,`submitted_unconfirmed` 表示未可靠确认接收;不确定时先查历史再决定是否重试。
12
+
13
+ ```sh
14
+ larkmate group-members --chat "$CHAT_ID"
15
+ larkmate group-create --name '群名称' --member "$MEMBER_ID"
16
+ larkmate group-invite --chat "$CHAT_ID" --member "$MEMBER_ID"
17
+ larkmate group-update --chat "$CHAT_ID" --name '新名称'
18
+ larkmate group-bot-info --chat "$CHAT_ID" --bot "$BOT_ID"
19
+ larkmate group-bot-protection --chat "$CHAT_ID" --bot "$BOT_ID" --allow-member-removal
20
+ larkmate group-dissolve --chat "$CHAT_ID"
21
+ ```
22
+
23
+ `--member` 可重复指定。创建或邀请机器人默认限制普通成员移除,`--allow-member-removal` 可关闭该限制。`verified` 只表示机器人移除限制已读回。遇到 `GROUP_CREATED_PARTIAL` 或 `INVITE_PARTIAL` 时,先检查已产生的群或成员变化,不要盲目重复操作。