Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat: read Feishu documents and preserve rich-text images (#19401)

Rdmclin28171469b801b
diff --git a/apps/cli/src/commands/botMessage.ts b/apps/cli/src/commands/botMessage.ts
index 65f4f7767b7..6c00a9baa59 100644
--- a/apps/cli/src/commands/botMessage.ts
+++ b/apps/cli/src/commands/botMessage.ts
@@ -275,6 +275,41 @@ export function registerBotMessageCommands(bot: Command) {
},
);
+ // ── doc ─────────────────────────────────────────────────
+
+ message
+ .command('doc <botId>')
+ .description('Read a cloud document linked in the chat (Feishu/Lark docx / wiki)')
+ .option('--url <url>', 'Document URL as it appears in the chat')
+ .option('--document-id <id>', 'Document token, when you have no URL')
+ .option('--json', 'Output JSON')
+ .action(
+ async (botId: string, options: { documentId?: string; json?: boolean; url?: string }) => {
+ if (!options.url && !options.documentId) {
+ log.error('Pass --url <url> or --document-id <id>');
+ process.exit(1);
+ }
+ const client = await getTrpcClient();
+ const result = await client.botMessage.readDocument.query({
+ botId,
+ documentId: options.documentId,
+ url: options.url,
+ });
+
+ if (options.json) {
+ outputJson(result);
+ return;
+ }
+
+ const r = result as any;
+ if (r.title) console.log(pc.bold(r.title));
+ if (r.url) console.log(pc.dim(r.url));
+ console.log();
+ console.log(r.content || '(empty document)');
+ if (r.truncated) console.log(pc.dim('\n[content truncated]'));
+ },
+ );
+
// ── edit ────────────────────────────────────────────────
message
diff --git a/apps/server/src/routers/lambda/botMessage.ts b/apps/server/src/routers/lambda/botMessage.ts
index 3274c1dda71..17e3fad87a6 100644
--- a/apps/server/src/routers/lambda/botMessage.ts
+++ b/apps/server/src/routers/lambda/botMessage.ts
@@ -387,6 +387,33 @@ export const botMessageRouter = router({
});
}),
+ readDocument: botMessageProcedure
+ .input(
+ z
+ .object({
+ botId: z.string(),
+ documentId: z.string().optional(),
+ url: z.string().optional(),
+ })
+ .refine((v) => !!v.url || !!v.documentId, {
+ message: 'Either url or documentId is required',
+ }),
+ )
+ .query(async ({ input, ctx }) => {
+ const { service, platform } = await resolveBot(ctx.agentBotProviderModel, input.botId);
+ if (!service.readDocument) {
+ throw new TRPCError({
+ code: 'BAD_REQUEST',
+ message: `readDocument is not supported on ${platform}`,
+ });
+ }
+ return service.readDocument({
+ documentId: input.documentId,
+ platform,
+ url: input.url,
+ });
+ }),
+
editMessage: botMessageWriteProcedure
.input(
z.object({
diff --git a/apps/server/src/services/bot/platforms/feishu/client.test.ts b/apps/server/src/services/bot/platforms/feishu/client.test.ts
index 00764a8c4ee..bcba3dab42a 100644
--- a/apps/server/src/services/bot/platforms/feishu/client.test.ts
+++ b/apps/server/src/services/bot/platforms/feishu/client.test.ts
@@ -80,6 +80,7 @@ describe('FeishuWebhookClient.extractFiles', () => {
beforeEach(() => {
vi.clearAllMocks();
+ mockDownloadMediaFromRawMessage.mockReset();
});
afterEach(() => {
@@ -119,6 +120,7 @@ describe('FeishuWebhookClient.extractFiles', () => {
expect(mockDownloadMediaFromRawMessage).toHaveBeenCalledWith(
expect.anything(), // LarkApiClient instance
raw,
+ expect.objectContaining({ warn: expect.any(Function) }),
);
expect(result).toEqual([
{ buffer, mimeType: 'image/jpeg', name: 'image.jpg', size: undefined },
@@ -218,6 +220,86 @@ describe('FeishuWebhookClient.extractFiles', () => {
{ buffer, mimeType: 'image/jpeg', name: 'image.jpg', size: undefined },
]);
});
+
+ it('keeps post images across webhook parse + queue serialization + extractFiles', async () => {
+ const actualAdapter = await vi.importActual<typeof FeishuAdapterModule>(
+ '@lobechat/chat-adapter-feishu',
+ );
+ const { Message } = await import('chat');
+ const processMessage = vi.fn();
+ const adapter = new actualAdapter.LarkAdapter({
+ appId: 'cli_test_app',
+ appSecret: 'sec',
+ platform: 'feishu',
+ });
+ (adapter as any).chat = { processMessage };
+ (adapter as any).logger = { error: vi.fn(), info: vi.fn(), warn: vi.fn() };
+ vi.spyOn(adapter as any, 'resolveSenderName').mockResolvedValue('User');
+
+ const raw = {
+ chat_id: 'oc_test',
+ chat_type: 'group',
+ content: JSON.stringify({
+ content_v2: [
+ [
+ { tag: 'text', text: '请分析' },
+ { tag: 'img', image_key: 'img_first' },
+ ],
+ [{ tag: 'md', text: '补充图:![second](img_second)' }],
+ ],
+ }),
+ create_time: '1700000000000',
+ message_id: 'om_post',
+ message_type: 'post',
+ };
+ const request = new Request('http://localhost/webhook', {
+ body: JSON.stringify({
+ event: {
+ message: raw,
+ sender: { sender_id: { open_id: 'ou_user' }, sender_type: 'user' },
+ },
+ header: { event_type: 'im.message.receive_v1' },
+ }),
+ headers: { 'Content-Type': 'application/json' },
+ method: 'POST',
+ });
+
+ await adapter.handleWebhook(request);
+ const messageFactory = processMessage.mock.calls[0][2];
+ const parsedMessage = await messageFactory();
+ const queuedMessage = Message.fromJSON(parsedMessage.toJSON());
+
+ const downloadResource = vi
+ .fn()
+ .mockResolvedValueOnce(Buffer.from('first'))
+ .mockResolvedValueOnce(Buffer.from('second'));
+ mockDownloadMediaFromRawMessage.mockImplementation(actualAdapter.downloadMediaFromRawMessage);
+ const client = createClient();
+ (client as any)._api = { downloadResource };
+
+ const result = await client.extractFiles!(queuedMessage);
+
+ expect(queuedMessage.text).toBe('请分析[image]\n补充图:[image]');
+ expect(queuedMessage.attachments).toHaveLength(2);
+ expect(downloadResource.mock.calls).toEqual([
+ ['om_post', 'img_first', 'image'],
+ ['om_post', 'img_second', 'image'],
+ ]);
+ expect(result).toEqual([
+ {
+ buffer: Buffer.from('first'),
+ mimeType: 'image/jpeg',
+ name: 'image-1.jpg',
+ size: undefined,
+ },
+ {
+ buffer: Buffer.from('second'),
+ mimeType: 'image/jpeg',
+ name: 'image-2.jpg',
+ size: undefined,
+ },
+ ]);
+ });
});
describe('Feishu messenger reactions', () => {
diff --git a/apps/server/src/services/bot/platforms/feishu/client.ts b/apps/server/src/services/bot/platforms/feishu/client.ts
index 040dc1a1acc..6cb5e48be7b 100644
--- a/apps/server/src/services/bot/platforms/feishu/client.ts
+++ b/apps/server/src/services/bot/platforms/feishu/client.ts
@@ -216,7 +216,9 @@ async function feishuExtractFiles(
log('extractFiles: msgId=%s, message_type=%s', (message as any).id, raw.message_type);
- const attachments = await downloadMediaFromRawMessage(api, raw);
+ const attachments = await downloadMediaFromRawMessage(api, raw, {
+ warn: (message, ...args) => console.error(`[bot-platform:feishu:client] ${message}`, ...args),
+ });
if (attachments.length === 0) {
log('extractFiles: no media items resolved for msgId=%s', (message as any).id);
return undefined;
diff --git a/apps/server/src/services/bot/platforms/feishu/const.ts b/apps/server/src/services/bot/platforms/feishu/const.ts
index 62b93f0697b..1a05ceb6408 100644
--- a/apps/server/src/services/bot/platforms/feishu/const.ts
+++ b/apps/server/src/services/bot/platforms/feishu/const.ts
@@ -2,3 +2,10 @@
export const MAX_FEISHU_HISTORY_LIMIT = 50;
export const DEFAULT_FEISHU_CONNECTION_MODE = 'websocket';
+
+/**
+ * Cap on the docx body returned by `readDocument`. Meeting minutes run a few
+ * thousand characters; this leaves room for long specs without letting one
+ * tool result eat the whole context window.
+ */
+export const MAX_FEISHU_DOCUMENT_CHARS = 60_000;
diff --git a/apps/server/src/services/bot/platforms/feishu/protocol-spec.md b/apps/server/src/services/bot/platforms/feishu/protocol-spec.md
index 475c328ad1f..15a4c0447d6 100644
--- a/apps/server/src/services/bot/platforms/feishu/protocol-spec.md
+++ b/apps/server/src/services/bot/platforms/feishu/protocol-spec.md
@@ -29,7 +29,7 @@
## 2. 认证
-### 2.1 获取 tenant_access_token(自建应用)
+### 2.1 获取 tenant\_access\_token(自建应用)
**Method**
@@ -755,7 +755,7 @@ curl 'https://open.feishu.cn/open-apis/im/v1/messages/om_dc13264520392913993dd05
| `reaction_type` | `object` | 是 | 表情类型对象。 |
| `reaction_type.emoji_type` | `string` | 是 | 表情标识(见下方列表)。 |
-**常用 emoji_type 值**
+**常用 emoji\_type 值**
| 类别 | 常用值 |
| ----------- | ------------------------------------------------------------------------------------- |
@@ -879,7 +879,7 @@ curl 'https://open.feishu.cn/open-apis/im/v1/messages/om_dc13264520392913993dd05
| `231003` | 目标消息不存在或已撤回。 |
| `231007` | 权限不足(只能删除自己添加的表情回复)。 |
| `231010` | 表情回复不属于该消息。 |
-| `231011` | 无效的 reaction_id。 |
+| `231011` | 无效的 reaction\_id。 |
**工程建议**
@@ -986,7 +986,7 @@ curl 'https://open.feishu.cn/open-apis/im/v1/chats/oc_84983ff6516d731e5b5f68d4ea
| 错误码 | 含义 |
| -------- | ------------------ |
-| `232006` | 无效的 chat_id。 |
+| `232006` | 无效的 chat\_id。 |
| `232010` | 不同租户。 |
| `232011` | 操作者不在群组中。 |
| `232025` | 未启用机器人能力。 |
@@ -1071,9 +1071,9 @@ curl 'https://open.feishu.cn/open-apis/im/v1/chats/oc_84983ff6516d731e5b5f68d4ea
| 字段 | 类型 | 说明 |
| ---------------- | -------- | ------------------------------------------------------------ |
-| `union_id` | `string` | 用户 union_id(跨应用唯一)。 |
-| `user_id` | `string` | 用户 user_id(企业内唯一,即员工工号 ID)。 |
-| `open_id` | `string` | 用户 open_id(应用内唯一)。 |
+| `union_id` | `string` | 用户 union\_id(跨应用唯一)。 |
+| `user_id` | `string` | 用户 user\_id(企业内唯一,即员工工号 ID)。 |
+| `open_id` | `string` | 用户 open\_id(应用内唯一)。 |
| `name` | `string` | 用户姓名。 |
| `en_name` | `string` | 英文名。 |
| `nickname` | `string` | 别名。 |
@@ -1151,16 +1151,16 @@ curl 'https://open.feishu.cn/open-apis/contact/v3/users/ou_7d8a6e6df7621556ce0d2
### 8.3 其他消息类型
-| msg_type | content 字段 | 说明 |
-| ------------- | ----------------------------------------------- | ---------------------------- |
-| `image` | `{"image_key":"img_xxx"}` | 需先上传图片获取 image_key。 |
-| `file` | `{"file_key":"file_xxx"}` | 需先上传文件获取 file_key。 |
-| `audio` | `{"file_key":"file_xxx"}` | 需先上传音频获取 file_key。 |
-| `media` | `{"file_key":"file_xxx","image_key":"img_xxx"}` | 视频,需上传视频和封面。 |
-| `sticker` | `{"file_key":"file_xxx"}` | 表情包。 |
-| `interactive` | `{...card_content...}` | 消息卡片 JSON。 |
-| `share_chat` | `{"chat_id":"oc_xxx"}` | 分享群组。 |
-| `share_user` | `{"user_id":"ou_xxx"}` | 分享用户名片。 |
+| msg\_type | content 字段 | 说明 |
+| ------------- | ----------------------------------------------- | ----------------------------- |
+| `image` | `{"image_key":"img_xxx"}` | 需先上传图片获取 image\_key。 |
+| `file` | `{"file_key":"file_xxx"}` | 需先上传文件获取 file\_key。 |
+| `audio` | `{"file_key":"file_xxx"}` | 需先上传音频获取 file\_key。 |
+| `media` | `{"file_key":"file_xxx","image_key":"img_xxx"}` | 视频,需上传视频和封面。 |
+| `sticker` | `{"file_key":"file_xxx"}` | 表情包。 |
+| `interactive` | `{...card_content...}` | 消息卡片 JSON。 |
+| `share_chat` | `{"chat_id":"oc_xxx"}` | 分享群组。 |
+| `share_user` | `{"user_id":"ou_xxx"}` | 分享用户名片。 |
**工程建议**
@@ -1169,6 +1169,29 @@ curl 'https://open.feishu.cn/open-apis/contact/v3/users/ou_7d8a6e6df7621556ce0d2
- 卡片和富文本 `content` 最大 30 KB。
- 当前 `LarkApiClient` 实现中仅使用 `text` 类型,且在客户端做了 4000 字符截断保护。
+## 8.4 云文档正文读取(docx /wiki)
+
+群里的智能纪要、会议纪要和方案文档以**链接**的形式出现(`text` 里的 URL、`post` 的 `a` 标签或 `interactive` 卡片按钮),消息体本身没有正文。`readDocument` 用应用自己的 `tenant_access_token` 走 Docs API 拉取纯文本。
+
+| 用途 | 方法 / 路径 | 所需权限 |
+| ---------------------- | -------------------------------------------------- | ------------------------------------------- |
+| 读取文档纯文本 | `GET /docx/v1/documents/{document_id}/raw_content` | `docx:document:readonly` 或 `docx:document` |
+| 读取文档元信息(标题) | `GET /docx/v1/documents/{document_id}` | 同上 |
+| wiki 链接解析为 docx | `GET /wiki/v2/spaces/get_node?token={node_token}` | `wiki:wiki:readonly` 或 `wiki:wiki` |
+
+- `document_id` 即 URL `https://<tenant>.feishu.cn/docx/{token}` 中的 token;`/wiki/{token}` 是知识库节点,需要先 `get_node` 取 `obj_token`(仅 `obj_type = docx` 可读)。
+- 旧版 `/docs/` 文档、`/minutes/` 妙记、表格、多维表格不在 docx API 范围内,服务层会直接返回可执行的提示而不是调用接口。
+- 单应用限流 5 次 / 秒;`raw_content` 返回的是把标题、段落、表格单元格拍平后的纯文本,无块结构。
+- **可见性是独立于 scope 的**:文档分享到机器人所在的群不等于应用可读。`1770032` 时需要文档所有者把应用添加为协作者(文档「分享」→ 添加协作者 → 搜索应用名),或由知识库授权给应用。
+
+| 错误码 | 含义 |
+| --------- | --------------------------------- |
+| `1770001` | 参数非法(token 格式不对)。 |
+| `1770002` | 文档不存在(或属于其他租户)。 |
+| `1770003` | 文档已删除。 |
+| `1770032` | 应用对该文档没有阅读 / 编辑权限。 |
+| `1770033` | 纯文本超出大小限制。 |
+
## 9. 通用错误码速查
| 错误码 | 含义 |
@@ -1195,8 +1218,8 @@ curl 'https://open.feishu.cn/open-apis/contact/v3/users/ou_7d8a6e6df7621556ce0d2
| `231003` | 消息不存在或已被撤回。 |
| `231007` | 只能删除自己添加的表情回复。 |
| `231010` | 表情回复不属于该消息。 |
-| `231011` | 无效的 reaction_id。 |
-| `232006` | 无效的 chat_id。 |
+| `231011` | 无效的 reaction\_id。 |
+| `232006` | 无效的 chat\_id。 |
| `232010` | 不同租户。 |
| `232011` | 操作者不在群组中。 |
| `232025` | 未启用机器人能力。 |
@@ -1267,24 +1290,25 @@ curl 'https://open.feishu.cn/open-apis/contact/v3/users/ou_7d8a6e6df7621556ce0d2
### 11.3 服务适配器操作支持情况
-服务适配器支持 **9 / 17** 项 message tool 操作:
-
-| 操作 | 支持 | 映射的飞书 API |
-| ------------------- | ---- | --------------------------------------------------------- |
-| `sendMessage` | Yes | `POST /im/v1/messages` |
-| `readMessages` | Yes | `GET /im/v1/messages`(会话历史) |
-| `editMessage` | Yes | `PUT /im/v1/messages/{message_id}` |
-| `deleteMessage` | Yes | `DELETE /im/v1/messages/{message_id}` |
-| `reactToMessage` | Yes | `POST /im/v1/messages/{message_id}/reactions` |
-| `getChannelInfo` | Yes | `GET /im/v1/chats/{chat_id}`(getChatInfo) |
-| `getMemberInfo` | Yes | `GET /contact/v3/users/{user_id}`(getUserInfo) |
-| `replyToThread` | Yes | `POST /im/v1/messages/{message_id}/reply`(replyMessage) |
-| `searchMessages` | No | 飞书无全文搜索 API |
-| `getReactions` | No | 未实现 |
-| `pinMessage` | No | 未实现 |
-| `unpinMessage` | No | 未实现 |
-| `getPinnedMessages` | No | 未实现 |
-| `listChannels` | No | 未实现 |
-| `createThread` | No | 未实现 |
-| `listThreads` | No | 未实现 |
-| `createPoll` | No | 飞书无投票 API |
+服务适配器支持 **10 / 18** 项 message tool 操作:
+
+| 操作 | 支持 | 映射的飞书 API |
+| ------------------- | ---- | ------------------------------------------------------------- |
+| `sendMessage` | Yes | `POST /im/v1/messages` |
+| `readMessages` | Yes | `GET /im/v1/messages`(会话历史) |
+| `readDocument` | Yes | `GET /docx/v1/documents/{id}/raw_content`(+ wiki get\_node) |
+| `editMessage` | Yes | `PUT /im/v1/messages/{message_id}` |
+| `deleteMessage` | Yes | `DELETE /im/v1/messages/{message_id}` |
+| `reactToMessage` | Yes | `POST /im/v1/messages/{message_id}/reactions` |
+| `getChannelInfo` | Yes | `GET /im/v1/chats/{chat_id}`(getChatInfo) |
+| `getMemberInfo` | Yes | `GET /contact/v3/users/{user_id}`(getUserInfo) |
+| `replyToThread` | Yes | `POST /im/v1/messages/{message_id}/reply`(replyMessage) |
+| `searchMessages` | No | 飞书无全文搜索 API |
+| `getReactions` | No | 未实现 |
+| `pinMessage` | No | 未实现 |
+| `unpinMessage` | No | 未实现 |
+| `getPinnedMessages` | No | 未实现 |
+| `listChannels` | No | 未实现 |
+| `createThread` | No | 未实现 |
+| `listThreads` | No | 未实现 |
+| `createPoll` | No | 飞书无投票 API |
diff --git a/apps/server/src/services/bot/platforms/feishu/service.test.ts b/apps/server/src/services/bot/platforms/feishu/service.test.ts
index d8398e03e84..5f1f20828cc 100644
--- a/apps/server/src/services/bot/platforms/feishu/service.test.ts
+++ b/apps/server/src/services/bot/platforms/feishu/service.test.ts
@@ -99,4 +99,171 @@ describe('FeishuMessageService.readMessages', () => {
} as any),
).rejects.toThrow('socket hang up');
});
+
+ it('flattens rich-text and card bodies so document links stay visible', async () => {
+ // Meeting minutes land in the group as a `post` (rich text) or an
+ // `interactive` card — previously both read back as content ''.
+ const listMessages = vi.fn().mockResolvedValue({
+ hasMore: false,
+ items: [
+ {
+ body: {
+ content: JSON.stringify({
+ elements: [{ tag: 'div', text: { content: '会议纪要已生成', tag: 'lark_md' } }],
+ header: { title: { content: '9/9 评审会', tag: 'plain_text' } },
+ // The link lives on a button, not in any text — it must be appended.
+ link: { url: 'https://lobe-hub.feishu.cn/docx/CardTok' },
+ }),
+ },
+ create_time: '1700000002000',
+ message_id: 'om_card',
+ msg_type: 'interactive',
+ sender: { id: 'ou_bot', sender_type: 'app' },
+ },
+ {
+ body: {
+ content: JSON.stringify({
+ content: [
+ [{ href: 'https://lobe-hub.feishu.cn/docx/PostTok', tag: 'a', text: '纪要' }],
+ ],
+ title: '',
+ }),
+ },
+ create_time: '1700000001000',
+ message_id: 'om_post',
+ msg_type: 'post',
+ sender: { id: 'ou_1', sender_type: 'user' },
+ },
+ ],
+ });
+
+ const result = await makeService(listMessages).readMessages({
+ channelId: 'oc_chat_1',
+ platform: 'feishu',
+ } as any);
+
+ expect(result.messages?.map((m) => m.content)).toEqual([
+ '纪要 (https://lobe-hub.feishu.cn/docx/PostTok)',
+ '会议纪要已生成\n9/9 评审会\n[links: https://lobe-hub.feishu.cn/docx/CardTok]',
+ ]);
+ });
+});
+
+describe('FeishuMessageService.readDocument', () => {
+ const makeDocService = (api: Record<string, ReturnType<typeof vi.fn>>) =>
+ new FeishuMessageService(api as any, 'feishu');
+
+ it('reads a docx link: raw body plus the title from metadata', async () => {
+ const getDocxRawContent = vi.fn().mockResolvedValue('参会人:A、B\n总结:...');
+ const getDocxDocument = vi
+ .fn()
+ .mockResolvedValue({ documentId: 'DocTok', title: '远程设备研讨会' });
+
+ const result = await makeDocService({ getDocxDocument, getDocxRawContent }).readDocument({
+ platform: 'feishu',
+ url: 'https://lobe-hub.feishu.cn/docx/DocTok?from=chat',
+ });
+
+ expect(getDocxRawContent).toHaveBeenCalledWith('DocTok');
+ expect(result).toEqual({
+ content: '参会人:A、B\n总结:...',
+ documentId: 'DocTok',
+ kind: 'docx',
+ platform: 'feishu',
+ title: '远程设备研讨会',
+ truncated: false,
+ url: 'https://lobe-hub.feishu.cn/docx/DocTok',
+ });
+ });
+
+ it('still returns the body when only the metadata call fails', async () => {
+ const getDocxRawContent = vi.fn().mockResolvedValue('body');
+ const getDocxDocument = vi.fn().mockRejectedValue(new Error('meta down'));
+
+ const result = await makeDocService({ getDocxDocument, getDocxRawContent }).readDocument({
+ documentId: 'DocTok',
+ platform: 'feishu',
+ });
+
+ expect(result).toMatchObject({ content: 'body', documentId: 'DocTok', title: undefined });
+ expect(result.url).toBeUndefined();
+ });
+
+ it('resolves a wiki link to the docx it wraps', async () => {
+ const getWikiNode = vi.fn().mockResolvedValue({
+ nodeToken: 'WikiTok',
+ objToken: 'DocTok',
+ objType: 'docx',
+ title: 'Wiki 页',
+ });
+ const getDocxRawContent = vi.fn().mockResolvedValue('wiki body');
+ const getDocxDocument = vi.fn().mockResolvedValue({ documentId: 'DocTok' });
+
+ const result = await makeDocService({
+ getDocxDocument,
+ getDocxRawContent,
+ getWikiNode,
+ }).readDocument({ platform: 'feishu', url: 'https://lobe-hub.feishu.cn/wiki/WikiTok' });
+
+ expect(getWikiNode).toHaveBeenCalledWith('WikiTok');
+ expect(getDocxRawContent).toHaveBeenCalledWith('DocTok');
+ expect(result).toMatchObject({ documentId: 'DocTok', kind: 'wiki', title: 'Wiki 页' });
+ });
+
+ it('refuses a wiki node that does not wrap a docx', async () => {
+ const getWikiNode = vi.fn().mockResolvedValue({ objToken: 'sht', objType: 'sheet' });
+ await expect(
+ makeDocService({ getWikiNode }).readDocument({
+ platform: 'feishu',
+ url: 'https://lobe-hub.feishu.cn/wiki/WikiTok',
+ }),
+ ).rejects.toThrow('wraps a "sheet" object');
+ });
+
+ it.each([
+ ['1770032', 'add the app as a collaborator'],
+ ['1770002', 'does not exist'],
+ ['1770003', 'has been deleted'],
+ ])('turns docx error %s into an actionable hint', async (code, expected) => {
+ const getDocxRawContent = vi
+ .fn()
+ .mockRejectedValue(
+ new Error(`Lark API GET /docx/v1/documents/x/raw_content failed: ${code} forbidden`),
+ );
+ await expect(
+ makeDocService({ getDocxRawContent }).readDocument({
+ platform: 'feishu',
+ url: 'https://lobe-hub.feishu.cn/docx/x',
+ }),
+ ).rejects.toThrow(expected);
+ });
+
+ it.each([
+ ['https://lobe-hub.feishu.cn/docs/legacy', 'legacy /docs/ document'],
+ ['https://lobe-hub.feishu.cn/minutes/obcn1', 'minutes:minutes'],
+ ['https://lobe-hub.feishu.cn/sheets/sht1', 'spreadsheet'],
+ ])('explains why %s cannot be read instead of calling the API', async (url, expected) => {
+ const getDocxRawContent = vi.fn();
+ await expect(
+ makeDocService({ getDocxRawContent }).readDocument({ platform: 'feishu', url }),
+ ).rejects.toThrow(expected);
+ expect(getDocxRawContent).not.toHaveBeenCalled();
+ });
+
+ it('rejects a URL that is not a Feishu document link', async () => {
+ await expect(
+ makeDocService({}).readDocument({ platform: 'feishu', url: 'https://example.com/x' }),
+ ).rejects.toThrow('not a Feishu/Lark document link');
+ });
+
+ it('truncates very long bodies and says so', async () => {
+ const getDocxRawContent = vi.fn().mockResolvedValue('x'.repeat(70_000));
+ const getDocxDocument = vi.fn().mockResolvedValue({});
+ const result = await makeDocService({ getDocxDocument, getDocxRawContent }).readDocument({
+ documentId: 'DocTok',
+ platform: 'feishu',
+ });
+ expect(result.truncated).toBe(true);
+ expect(result.content?.length).toBe(60_000);
+ });
});
diff --git a/apps/server/src/services/bot/platforms/feishu/service.ts b/apps/server/src/services/bot/platforms/feishu/service.ts
index 4da57c3144e..eb8c86744e1 100644
--- a/apps/server/src/services/bot/platforms/feishu/service.ts
+++ b/apps/server/src/services/bot/platforms/feishu/service.ts
@@ -24,6 +24,8 @@ import type {
PinMessageState,
ReactToMessageParams,
ReactToMessageState,
+ ReadDocumentParams,
+ ReadDocumentState,
ReadMessagesParams,
ReadMessagesState,
ReplyToThreadParams,
@@ -35,14 +37,19 @@ import type {
UnpinMessageParams,
UnpinMessageState,
} from '@lobechat/builtin-tool-message/executionRuntime';
-import type { LarkApiClient } from '@lobechat/chat-adapter-feishu';
-import { supportedFeishuEmojiTypes, toFeishuEmojiType } from '@lobechat/chat-adapter-feishu';
+import type { LarkApiClient, LarkDocLink } from '@lobechat/chat-adapter-feishu';
+import {
+ flattenLarkMessageContent,
+ parseLarkDocUrl,
+ supportedFeishuEmojiTypes,
+ toFeishuEmojiType,
+} from '@lobechat/chat-adapter-feishu';
import { DEFAULT_BOT_HISTORY_LIMIT } from '@lobechat/const';
import type { MessageRuntimeService } from '@/server/services/toolExecution/serverRuntimes/message/adapters/types';
import { PlatformUnsupportedError } from '@/server/services/toolExecution/serverRuntimes/message/PlatformUnsupportedError';
-import { MAX_FEISHU_HISTORY_LIMIT } from './const';
+import { MAX_FEISHU_DOCUMENT_CHARS, MAX_FEISHU_HISTORY_LIMIT } from './const';
import { sendFeishuAttachments } from './sendAttachments';
/**
@@ -86,13 +93,14 @@ const explainHistoryReadError = (error: unknown): Error => {
* Normalize a Feishu/Lark message object to MessageItem.
*/
const toMessageItem = (msg: any): MessageItem => {
- let content: string;
- try {
- const parsed = JSON.parse(msg.body?.content ?? '{}');
- content = parsed.text ?? '';
- } catch {
- content = msg.body?.content ?? '';
- }
+ // History rows carry `msg_type` (receive events say `message_type`). Only
+ // `text` bodies are a plain string; rich text and cards — which is how
+ // meeting minutes and other documents land in a chat — are flattened so
+ // the model sees their text AND the document links, instead of ''.
+ const { text: content } = flattenLarkMessageContent(
+ msg.msg_type ?? msg.message_type,
+ msg.body?.content ?? '{}',
+ );
return {
author: {
@@ -108,6 +116,62 @@ const toMessageItem = (msg: any): MessageItem => {
};
};
+/**
+ * Docx API failures that have a fix on the operator's side, mapped to that
+ * fix. Scope violations are already spelled out by `LarkApiClient`
+ * (`permission_violations`), so this table only covers the codes where the
+ * bare message is misleading — notably `1770032`, which reads as a scope
+ * problem but usually means the *document* is not visible to the app.
+ *
+ * @see https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/raw_content
+ */
+const DOCUMENT_READ_ERROR_HINTS: Record<string, string> = {
+ '1770001': 'the document token is malformed — pass the URL exactly as it appears in the chat',
+ '1770002': 'the document does not exist (or the token belongs to a different tenant)',
+ '1770003': 'the document has been deleted',
+ '1770032':
+ 'the app cannot see this document. Sharing it into a group the bot is in does not grant access — the owner must add the app as a collaborator (文档「分享」→ 添加协作者 → 搜索应用名), or the space/folder must grant the app access. If the app also lacks the scope, enable `docx:document:readonly` under 权限管理 and re-publish the app',
+};
+
+const explainDocumentReadError = (error: unknown): Error => {
+ const message = error instanceof Error ? error.message : String(error);
+ const code = Object.keys(DOCUMENT_READ_ERROR_HINTS).find((c) => message.includes(c));
+ if (!code) return error instanceof Error ? error : new Error(message);
+ return new Error(`${message} — ${DOCUMENT_READ_ERROR_HINTS[code]}.`);
+};
+
+/**
+ * What a `readDocument` call points at. A bare `documentId` is assumed to be
+ * a docx token — that is what every other docx endpoint takes and what the
+ * model gets back in `ReadDocumentState.documentId`.
+ */
+const resolveDocumentTarget = (
+ params: ReadDocumentParams,
+): Pick<LarkDocLink, 'kind' | 'token'> & { url?: string } => {
+ if (params.url) {
+ const link = parseLarkDocUrl(params.url);
+ if (!link) {
+ throw new Error(
+ `"${params.url}" is not a Feishu/Lark document link. Expected https://<tenant>.feishu.cn/docx/<token> (or /wiki/, /docs/ …)`,
+ );
+ }
+ return link;
+ }
+ if (params.documentId) return { kind: 'docx', token: params.documentId };
+ throw new Error('readDocument needs the document `url` (preferred) or its `documentId`');
+};
+
+const UNREADABLE_KIND_HINTS: Partial<Record<LarkDocLink['kind'], string>> = {
+ base: 'this is a Bitable (多维表格) link; only docx documents and wiki pages wrapping them can be read',
+ doc: 'this is a legacy /docs/ document; the docx API cannot read it — ask the owner to upgrade it to the new docx format (文档右上角「升级」) or share a docx link',
+ file: 'this is a drive file link, not a document — ask for the docx link',
+ minutes:
+ 'this is a Feishu Minutes (妙记) link; reading its transcript needs the `minutes:minutes` scope and a dedicated API that is not wired up yet. Meeting minutes shared as docx (智能纪要) can be read',
+ sheets:
+ 'this is a spreadsheet link; only docx documents and wiki pages wrapping them can be read',
+ slides: 'this is a slides link; only docx documents and wiki pages wrapping them can be read',
+};
+
export class FeishuMessageService implements MessageRuntimeService {
private platformName: string;
@@ -168,6 +232,55 @@ export class FeishuMessageService implements MessageRuntimeService {
};
};
+ /**
+ * Read a docx document (or the docx a wiki node wraps) as plain text.
+ * Reads use the app's own tenant token, so the document has to be
+ * visible to the *app* — see `DOCUMENT_READ_ERROR_HINTS['1770032']`.
+ */
+ readDocument = async (params: ReadDocumentParams): Promise<ReadDocumentState> => {
+ const target = resolveDocumentTarget(params);
+
+ const kindHint = UNREADABLE_KIND_HINTS[target.kind];
+ if (kindHint) throw new Error(`Cannot read ${target.url ?? target.token}: ${kindHint}.`);
+
+ let documentId = target.token;
+ let wikiTitle: string | undefined;
+ if (target.kind === 'wiki') {
+ // A wiki URL names a tree node; the docx endpoints want the object
+ // behind it. Resolving needs `wiki:wiki:readonly` on top of the docx scope.
+ const node = await this.api.getWikiNode(target.token).catch((error) => {
+ throw new Error(
+ `${error instanceof Error ? error.message : String(error)} — resolving a wiki link needs the \`wiki:wiki:readonly\` scope and the app must have access to that knowledge space.`,
+ );
+ });
+ if (node.objType !== 'docx' || !node.objToken) {
+ throw new Error(
+ `Wiki node ${target.token} wraps a "${node.objType ?? 'unknown'}" object; only docx pages can be read.`,
+ );
+ }
+ documentId = node.objToken;
+ wikiTitle = node.title;
+ }
+
+ const rawContent = await this.api.getDocxRawContent(documentId).catch((error) => {
+ throw explainDocumentReadError(error);
+ });
+ // Title is nice-to-have: if the metadata call fails after the body
+ // succeeded, still return the body rather than the whole read failing.
+ const meta = await this.api.getDocxDocument(documentId).catch(() => undefined);
+
+ const truncated = rawContent.length > MAX_FEISHU_DOCUMENT_CHARS;
+ return {
+ content: truncated ? rawContent.slice(0, MAX_FEISHU_DOCUMENT_CHARS) : rawContent,
+ documentId,
+ kind: target.kind,
+ platform: this.platformName,
+ title: meta?.title ?? wikiTitle,
+ truncated,
+ url: target.url,
+ };
+ };
+
editMessage = async (params: EditMessageParams): Promise<EditMessageState> => {
await this.api.editMessage(params.messageId, params.content);
return { messageId: params.messageId, success: true };
diff --git a/apps/server/src/services/bot/platforms/messageCapabilities.ts b/apps/server/src/services/bot/platforms/messageCapabilities.ts
index 289041758fe..4ebbb516e71 100644
--- a/apps/server/src/services/bot/platforms/messageCapabilities.ts
+++ b/apps/server/src/services/bot/platforms/messageCapabilities.ts
@@ -11,6 +11,7 @@ export const CHANNEL_MESSAGE_APIS = [
MessageApiName.sendMessage,
MessageApiName.sendDirectMessage,
MessageApiName.readMessages,
+ MessageApiName.readDocument,
MessageApiName.searchMessages,
MessageApiName.editMessage,
MessageApiName.deleteMessage,
@@ -54,7 +55,8 @@ export const TELEGRAM_GUEST_UNSUPPORTED_MESSAGE_APIS: string[] = [...CHANNEL_MES
*/
export const PLATFORM_UNSUPPORTED_MESSAGE_APIS: Record<string, string[]> = {
// Discord implements the full surface — no entry needed, but keep it explicit.
- discord: [],
+ // Discord has no document API — `readDocument` is Feishu/Lark only.
+ discord: [MessageApiName.readDocument],
feishu: [
MessageApiName.createPoll,
MessageApiName.createThread,
@@ -79,6 +81,7 @@ export const PLATFORM_UNSUPPORTED_MESSAGE_APIS: Record<string, string[]> = {
MessageApiName.listThreads,
MessageApiName.pinMessage,
MessageApiName.reactToMessage,
+ MessageApiName.readDocument,
MessageApiName.sendDirectMessage,
MessageApiName.unpinMessage,
],
@@ -109,19 +112,26 @@ export const PLATFORM_UNSUPPORTED_MESSAGE_APIS: Record<string, string[]> = {
MessageApiName.listThreads,
MessageApiName.pinMessage,
MessageApiName.reactToMessage,
+ MessageApiName.readDocument,
MessageApiName.readMessages,
MessageApiName.replyToThread,
MessageApiName.searchMessages,
MessageApiName.sendDirectMessage,
MessageApiName.unpinMessage,
],
- slack: [MessageApiName.createPoll, MessageApiName.createThread, MessageApiName.sendDirectMessage],
+ slack: [
+ MessageApiName.createPoll,
+ MessageApiName.createThread,
+ MessageApiName.readDocument,
+ MessageApiName.sendDirectMessage,
+ ],
// Telegram has no history-read API → prompt uses pre-injected recent channel history.
telegram: [
MessageApiName.getReactions,
MessageApiName.listChannels,
MessageApiName.listPins,
MessageApiName.listThreads,
+ MessageApiName.readDocument,
MessageApiName.readMessages,
MessageApiName.searchMessages,
MessageApiName.sendDirectMessage,
@@ -140,6 +150,7 @@ export const PLATFORM_UNSUPPORTED_MESSAGE_APIS: Record<string, string[]> = {
MessageApiName.listThreads,
MessageApiName.pinMessage,
MessageApiName.reactToMessage,
+ MessageApiName.readDocument,
MessageApiName.readMessages,
MessageApiName.replyToThread,
MessageApiName.searchMessages,
diff --git a/apps/server/src/services/toolExecution/serverRuntimes/__tests__/message.test.ts b/apps/server/src/services/toolExecution/serverRuntimes/__tests__/message.test.ts
index 9958ffeacde..f46d5b348bd 100644
--- a/apps/server/src/services/toolExecution/serverRuntimes/__tests__/message.test.ts
+++ b/apps/server/src/services/toolExecution/serverRuntimes/__tests__/message.test.ts
@@ -203,13 +203,20 @@ vi.mock('@/server/services/bot/platforms/slack/api', () => ({
}));
const mockFeishuSendMessage = vi.fn();
-vi.mock('@lobechat/chat-adapter-feishu', () => ({
+const mockFeishuGetDocxRawContent = vi.fn();
+const mockFeishuGetDocxDocument = vi.fn();
+vi.mock('@lobechat/chat-adapter-feishu', async (importOriginal) => ({
+ // Keep the pure helpers (URL parsing, content flattening) real — only the
+ // HTTP client is mocked.
+ ...(await importOriginal<Record<string, unknown>>()),
LarkApiClient: vi.fn().mockImplementation(function () {
return {
addReaction: vi.fn(),
deleteMessage: vi.fn(),
editMessage: vi.fn(),
getChatInfo: vi.fn(),
+ getDocxDocument: mockFeishuGetDocxDocument,
+ getDocxRawContent: mockFeishuGetDocxRawContent,
getUserInfo: vi.fn(),
listMessages: vi.fn(),
replyMessage: vi.fn(),
@@ -408,6 +415,41 @@ describe('messageRuntime', () => {
platform: 'feishu',
});
});
+
+ it('reads a docx document linked from the chat', async () => {
+ mockProviderFor('feishu', { appSecret: 'feishu-secret' });
+ mockFeishuGetDocxRawContent.mockResolvedValue('参会人:A、B\n总结:上线延期一周');
+ mockFeishuGetDocxDocument.mockResolvedValue({ documentId: 'DocTok', title: '评审会纪要' });
+
+ const runtime = await messageRuntime.factory(validContext);
+ const result = await runtime.readDocument({
+ platform: 'feishu',
+ url: 'https://lobe-hub.feishu.cn/docx/DocTok?from=chat',
+ });
+
+ expect(result.success).toBe(true);
+ expect(mockFeishuGetDocxRawContent).toHaveBeenCalledWith('DocTok');
+ expect(result.content).toContain('Document: 评审会纪要');
+ expect(result.content).toContain('总结:上线延期一周');
+ expect(result.state).toMatchObject({
+ documentId: 'DocTok',
+ kind: 'docx',
+ platform: 'feishu',
+ });
+ });
+
+ it('reports readDocument as unsupported on a platform without a document API', async () => {
+ mockProviderFor('discord', { botToken: 'discord-token' });
+
+ const runtime = await messageRuntime.factory(validContext);
+ const result = await runtime.readDocument({
+ platform: 'discord',
+ url: 'https://example.com/doc',
+ });
+
+ expect(result.success).toBe(false);
+ expect(result.content).toContain('not supported on discord');
+ });
});
describe('QQ adapter', () => {
diff --git a/apps/server/src/services/toolExecution/serverRuntimes/message/MessageDispatcherService.ts b/apps/server/src/services/toolExecution/serverRuntimes/message/MessageDispatcherService.ts
index 171a9569532..f94038b3ed1 100644
--- a/apps/server/src/services/toolExecution/serverRuntimes/message/MessageDispatcherService.ts
+++ b/apps/server/src/services/toolExecution/serverRuntimes/message/MessageDispatcherService.ts
@@ -24,6 +24,8 @@ import type {
PinMessageState,
ReactToMessageParams,
ReactToMessageState,
+ ReadDocumentParams,
+ ReadDocumentState,
ReadMessagesParams,
ReadMessagesState,
ReplyToThreadParams,
@@ -80,6 +82,16 @@ export class MessageDispatcherService implements MessageRuntimeService {
return (await this.getService(params.platform)).readMessages(params);
};
+ // Optional on the service contract: forward only when the platform has it,
+ // so the runtime's "not supported on <platform>" branch stays reachable.
+ readDocument = async (params: ReadDocumentParams): Promise<ReadDocumentState> => {
+ const service = await this.getService(params.platform);
+ if (!service.readDocument) {
+ throw new Error(`readDocument is not supported on ${params.platform}`);
+ }
+ return service.readDocument(params);
+ };
+
editMessage = async (params: EditMessageParams): Promise<EditMessageState> => {
return (await this.getService(params.platform)).editMessage(params);
};
diff --git a/locales/ar/verify.json b/locales/ar/verify.json
index 9122c06c64f..cae249acd6f 100644
--- a/locales/ar/verify.json
+++ b/locales/ar/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "تم تشغيل نفس الفحص في {{count}} جولات؛ الجولة الأخيرة هي الأهم.",
"acceptance.checks.title": "فحوصات القبول",
"acceptance.checks.viewTrace": "عرض تشغيل التحقق",
+ "acceptance.comments.addReaction": "إضافة رد فعل",
+ "acceptance.comments.approvalCount": "{{count}} مراجع وافق",
+ "acceptance.comments.approve": "وافق على هذا التسليم",
+ "acceptance.comments.approveAgain": "وافق على هذه الجولة",
+ "acceptance.comments.approveDescription": "رأيك في المراجعة. لا يغير حالة القبول - فقط المالك يقبل التسليم.",
+ "acceptance.comments.approveSummaryPlaceholder": "ملخص من سطر واحد (اختياري)",
+ "acceptance.comments.approved": "تمت الموافقة",
+ "acceptance.comments.approvedAtRound": "تمت الموافقة (الجولة {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} وافق على هذا التسليم",
+ "acceptance.comments.approvedByAtRound": "{{name}} وافق على الجولة {{round}}",
+ "acceptance.comments.author.agent": "وكيل",
+ "acceptance.comments.author.deactivated": "معطل",
+ "acceptance.comments.author.former": "عضو سابق",
+ "acceptance.comments.collapseThread": "طي",
+ "acceptance.comments.commentEvidence": "التعليق على منطقة",
+ "acceptance.comments.commented": "علق {{time}}",
+ "acceptance.comments.copyLink": "نسخ الرابط",
+ "acceptance.comments.createFailed": "فشل في نشر التعليق. يرجى المحاولة مرة أخرى.",
+ "acceptance.comments.delete": "حذف",
+ "acceptance.comments.deleteConfirm": "هل تريد حذف هذا التعليق؟",
+ "acceptance.comments.deleteFailed": "فشل في حذف التعليق. يرجى المحاولة مرة أخرى.",
+ "acceptance.comments.deleted": "تم حذف هذا التعليق",
+ "acceptance.comments.empty": "لا توجد مناقشة حتى الآن.",
+ "acceptance.comments.evidenceFromRound": "دليل من الجولة {{round}} - تم استبداله في جولة لاحقة",
+ "acceptance.comments.evidenceThisRound": "الدليل الذي يظهره هذا الفحص الآن",
+ "acceptance.comments.historicalRegions": "{{count}} ملاحظة منطقة على دليل تم استبداله في جولة لاحقة",
+ "acceptance.comments.linkCopied": "تم نسخ الرابط",
+ "acceptance.comments.loadFailed": "فشل في تحميل المناقشة. يرجى التحديث.",
+ "acceptance.comments.moreActions": "إجراءات إضافية",
+ "acceptance.comments.participants": "المشاركون",
+ "acceptance.comments.placeholder": "قل شيئًا عن هذا التسليم...",
+ "acceptance.comments.readOnly": "يمكنك قراءة المناقشة؛ انضم إلى مساحة العمل للمشاركة.",
+ "acceptance.comments.region": "منطقة",
+ "acceptance.comments.regionCount": "{{count}} ملاحظة منطقة",
+ "acceptance.comments.regionHint": "اسحب مربعًا على الصورة، ثم اكتب ملاحظتك.",
+ "acceptance.comments.regionMissing": "حدد منطقة أولاً.",
+ "acceptance.comments.regionModalTitle": "حدد النقطة التي تقصدها",
+ "acceptance.comments.reopen": "إعادة فتح",
+ "acceptance.comments.reply": "رد",
+ "acceptance.comments.replyPlaceholder": "رد...",
+ "acceptance.comments.resolve": "وضع علامة تم الحل",
+ "acceptance.comments.resolvedSummary": "تم الحل · {{name}} · {{count}} رسالة",
+ "acceptance.comments.roundCompletedBy": "{{name}} أكمل الجولة {{round}}",
+ "acceptance.comments.roundContext": "الجولة {{round}}",
+ "acceptance.comments.roundLanded": "الجولة {{round}} وصلت",
+ "acceptance.comments.send": "إرسال",
+ "acceptance.comments.title": "المناقشة",
+ "acceptance.comments.updateFailed": "فشل في تحديث التعليق. يرجى المحاولة مرة أخرى.",
+ "acceptance.comments.withdraw": "سحب الموافقة",
+ "acceptance.comments.withdrawDescription": "يمكنك سحب أو إعطاء هذا مرة أخرى في أي وقت أثناء فتح الجولة - فقط المكان الذي تصل إليه عندما يقرر المالك هو الذي يُحسب.",
+ "acceptance.comments.youApproved": "لقد وافقت على الجولة {{round}}",
+ "acceptance.comments.youApprovedNoRound": "لقد وافقت على هذا التسليم",
"acceptance.detail.suggestion": "اقتراح",
"acceptance.error.description": "تحقق من اتصالك وحاول تحميل هذا القبول مرة أخرى.",
"acceptance.error.title": "تعذر تحميل القبول",
diff --git a/locales/bg-BG/verify.json b/locales/bg-BG/verify.json
index 1462d869ebe..a34f552420c 100644
--- a/locales/bg-BG/verify.json
+++ b/locales/bg-BG/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Същата проверка е изпълнена в {{count}} кръга; последният кръг е решаващ.",
"acceptance.checks.title": "Проверки за приемане",
"acceptance.checks.viewTrace": "Преглед на проверката",
+ "acceptance.comments.addReaction": "Добавяне на реакция",
+ "acceptance.comments.approvalCount": "{{count}} рецензент(и) одобриха",
+ "acceptance.comments.approve": "Одобрете тази доставка",
+ "acceptance.comments.approveAgain": "Одобрете този кръг",
+ "acceptance.comments.approveDescription": "Вашето мнение за прегледа. То не променя статуса на приемане — само собственикът приема доставката.",
+ "acceptance.comments.approveSummaryPlaceholder": "Едноредово обобщение (по избор)",
+ "acceptance.comments.approved": "Одобрено",
+ "acceptance.comments.approvedAtRound": "Одобрено (кръг {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} одобри тази доставка",
+ "acceptance.comments.approvedByAtRound": "{{name}} одобри кръг {{round}}",
+ "acceptance.comments.author.agent": "Агент",
+ "acceptance.comments.author.deactivated": "Деактивиран",
+ "acceptance.comments.author.former": "Бивш член",
+ "acceptance.comments.collapseThread": "Свиване",
+ "acceptance.comments.commentEvidence": "Коментар за регион",
+ "acceptance.comments.commented": "коментирано {{time}}",
+ "acceptance.comments.copyLink": "Копиране на връзка",
+ "acceptance.comments.createFailed": "Неуспешно публикуване на коментара. Моля, опитайте отново.",
+ "acceptance.comments.delete": "Изтриване",
+ "acceptance.comments.deleteConfirm": "Изтриване на този коментар?",
+ "acceptance.comments.deleteFailed": "Неуспешно изтриване на коментара. Моля, опитайте отново.",
+ "acceptance.comments.deleted": "Този коментар беше изтрит",
+ "acceptance.comments.empty": "Все още няма дискусия.",
+ "acceptance.comments.evidenceFromRound": "Доказателство от кръг {{round}} — заменено в по-късен кръг",
+ "acceptance.comments.evidenceThisRound": "Доказателството, което този преглед показва сега",
+ "acceptance.comments.historicalRegions": "{{count}} бележка(и) за регион върху доказателства, заменени в по-късен кръг",
+ "acceptance.comments.linkCopied": "Връзката е копирана",
+ "acceptance.comments.loadFailed": "Неуспешно зареждане на дискусията. Моля, обновете.",
+ "acceptance.comments.moreActions": "Още действия",
+ "acceptance.comments.participants": "Участници",
+ "acceptance.comments.placeholder": "Кажете нещо за тази доставка…",
+ "acceptance.comments.readOnly": "Можете да четете дискусията; присъединете се към работното пространство, за да участвате.",
+ "acceptance.comments.region": "Регион",
+ "acceptance.comments.regionCount": "{{count}} бележка(и) за регион",
+ "acceptance.comments.regionHint": "Начертайте кутия върху изображението, след това напишете вашата бележка.",
+ "acceptance.comments.regionMissing": "Първо очертайте регион.",
+ "acceptance.comments.regionModalTitle": "Очертайте мястото, което имате предвид",
+ "acceptance.comments.reopen": "Отваряне отново",
+ "acceptance.comments.reply": "Отговор",
+ "acceptance.comments.replyPlaceholder": "Отговор…",
+ "acceptance.comments.resolve": "Маркирайте като решено",
+ "acceptance.comments.resolvedSummary": "Решено · {{name}} · {{count}} съобщение(я)",
+ "acceptance.comments.roundCompletedBy": "{{name}} завърши кръг {{round}}",
+ "acceptance.comments.roundContext": "Кръг {{round}}",
+ "acceptance.comments.roundLanded": "Кръг {{round}} завършен",
+ "acceptance.comments.send": "Изпращане",
+ "acceptance.comments.title": "Дискусия",
+ "acceptance.comments.updateFailed": "Неуспешно обновяване на коментара. Моля, опитайте отново.",
+ "acceptance.comments.withdraw": "Оттегляне на одобрението",
+ "acceptance.comments.withdrawDescription": "Можете да оттеглите или дадете това отново по всяко време, докато кръгът е отворен — само където се намирате, когато собственикът реши, има значение.",
+ "acceptance.comments.youApproved": "Вие одобрихте кръг {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Вие одобрихте тази доставка",
"acceptance.detail.suggestion": "Предложение",
"acceptance.error.description": "Проверете връзката си и опитайте да заредите това приемане отново.",
"acceptance.error.title": "Неуспешно зареждане на приемането",
diff --git a/locales/de-DE/verify.json b/locales/de-DE/verify.json
index ec1980dd526..861da5ab5a7 100644
--- a/locales/de-DE/verify.json
+++ b/locales/de-DE/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Die gleiche Überprüfung wurde in {{count}} Runden durchgeführt; die letzte Runde ist entscheidend.",
"acceptance.checks.title": "Akzeptanzüberprüfungen",
"acceptance.checks.viewTrace": "Überprüfungsdurchlauf anzeigen",
+ "acceptance.comments.addReaction": "Reaktion hinzufügen",
+ "acceptance.comments.approvalCount": "{{count}} Prüfer haben zugestimmt",
+ "acceptance.comments.approve": "Diese Lieferung genehmigen",
+ "acceptance.comments.approveAgain": "Diese Runde erneut genehmigen",
+ "acceptance.comments.approveDescription": "Ihre Überprüfungsmeinung. Sie ändert nicht den Annahmestatus – nur der Eigentümer akzeptiert die Lieferung.",
+ "acceptance.comments.approveSummaryPlaceholder": "Einzeilige Zusammenfassung (optional)",
+ "acceptance.comments.approved": "Genehmigt",
+ "acceptance.comments.approvedAtRound": "Genehmigt (Runde {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} hat diese Lieferung genehmigt",
+ "acceptance.comments.approvedByAtRound": "{{name}} hat Runde {{round}} genehmigt",
+ "acceptance.comments.author.agent": "Agent",
+ "acceptance.comments.author.deactivated": "Deaktiviert",
+ "acceptance.comments.author.former": "Ehemaliges Mitglied",
+ "acceptance.comments.collapseThread": "Einklappen",
+ "acceptance.comments.commentEvidence": "Kommentar zu einem Bereich",
+ "acceptance.comments.commented": "kommentiert {{time}}",
+ "acceptance.comments.copyLink": "Link kopieren",
+ "acceptance.comments.createFailed": "Kommentar konnte nicht gepostet werden. Bitte versuchen Sie es erneut.",
+ "acceptance.comments.delete": "Löschen",
+ "acceptance.comments.deleteConfirm": "Diesen Kommentar löschen?",
+ "acceptance.comments.deleteFailed": "Kommentar konnte nicht gelöscht werden. Bitte versuchen Sie es erneut.",
+ "acceptance.comments.deleted": "Dieser Kommentar wurde gelöscht",
+ "acceptance.comments.empty": "Noch keine Diskussion.",
+ "acceptance.comments.evidenceFromRound": "Beweis aus Runde {{round}} – in einer späteren Runde ersetzt",
+ "acceptance.comments.evidenceThisRound": "Der Beweis, den diese Überprüfung jetzt zeigt",
+ "acceptance.comments.historicalRegions": "{{count}} Bereichsnotiz(en) zu Beweisen, die in einer späteren Runde ersetzt wurden",
+ "acceptance.comments.linkCopied": "Link kopiert",
+ "acceptance.comments.loadFailed": "Diskussion konnte nicht geladen werden. Bitte aktualisieren.",
+ "acceptance.comments.moreActions": "Weitere Aktionen",
+ "acceptance.comments.participants": "Teilnehmer",
+ "acceptance.comments.placeholder": "Sagen Sie etwas zu dieser Lieferung…",
+ "acceptance.comments.readOnly": "Sie können die Diskussion lesen; treten Sie dem Arbeitsbereich bei, um teilzunehmen.",
+ "acceptance.comments.region": "Bereich",
+ "acceptance.comments.regionCount": "{{count}} Bereichsnotiz(en)",
+ "acceptance.comments.regionHint": "Ziehen Sie ein Feld auf das Bild und schreiben Sie dann Ihre Notiz.",
+ "acceptance.comments.regionMissing": "Markieren Sie zuerst einen Bereich.",
+ "acceptance.comments.regionModalTitle": "Markieren Sie die Stelle, die Sie meinen",
+ "acceptance.comments.reopen": "Wieder öffnen",
+ "acceptance.comments.reply": "Antworten",
+ "acceptance.comments.replyPlaceholder": "Antworten…",
+ "acceptance.comments.resolve": "Als gelöst markieren",
+ "acceptance.comments.resolvedSummary": "Gelöst · {{name}} · {{count}} Nachricht(en)",
+ "acceptance.comments.roundCompletedBy": "{{name}} hat Runde {{round}} abgeschlossen",
+ "acceptance.comments.roundContext": "Runde {{round}}",
+ "acceptance.comments.roundLanded": "Runde {{round}} abgeschlossen",
+ "acceptance.comments.send": "Senden",
+ "acceptance.comments.title": "Diskussion",
+ "acceptance.comments.updateFailed": "Kommentar konnte nicht aktualisiert werden. Bitte versuchen Sie es erneut.",
+ "acceptance.comments.withdraw": "Genehmigung zurückziehen",
+ "acceptance.comments.withdrawDescription": "Sie können dies jederzeit zurückziehen oder erneut geben, solange die Runde offen ist – nur der Status, wenn der Eigentümer entscheidet, zählt.",
+ "acceptance.comments.youApproved": "Sie haben Runde {{round}} genehmigt",
+ "acceptance.comments.youApprovedNoRound": "Sie haben diese Lieferung genehmigt",
"acceptance.detail.suggestion": "Vorschlag",
"acceptance.error.description": "Überprüfen Sie Ihre Verbindung und versuchen Sie, diese Akzeptanz erneut zu laden.",
"acceptance.error.title": "Akzeptanz konnte nicht geladen werden",
diff --git a/locales/es-ES/verify.json b/locales/es-ES/verify.json
index 38cc1a6f79c..49c9033cb60 100644
--- a/locales/es-ES/verify.json
+++ b/locales/es-ES/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "La misma verificación se realizó en {{count}} rondas; la última ronda prevalece.",
"acceptance.checks.title": "Verificaciones de aceptación",
"acceptance.checks.viewTrace": "Ver ejecución de verificación",
+ "acceptance.comments.addReaction": "Agregar reacción",
+ "acceptance.comments.approvalCount": "{{count}} revisor(es) aprobaron",
+ "acceptance.comments.approve": "Aprobar esta entrega",
+ "acceptance.comments.approveAgain": "Aprobar esta ronda",
+ "acceptance.comments.approveDescription": "Tu opinión de revisión. No cambia el estado de aceptación, solo el propietario acepta la entrega.",
+ "acceptance.comments.approveSummaryPlaceholder": "Resumen en una línea (opcional)",
+ "acceptance.comments.approved": "Aprobado",
+ "acceptance.comments.approvedAtRound": "Aprobado (ronda {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} aprobó esta entrega",
+ "acceptance.comments.approvedByAtRound": "{{name}} aprobó la ronda {{round}}",
+ "acceptance.comments.author.agent": "Agente",
+ "acceptance.comments.author.deactivated": "Desactivado",
+ "acceptance.comments.author.former": "Miembro anterior",
+ "acceptance.comments.collapseThread": "Colapsar",
+ "acceptance.comments.commentEvidence": "Comentar sobre una región",
+ "acceptance.comments.commented": "comentó {{time}}",
+ "acceptance.comments.copyLink": "Copiar enlace",
+ "acceptance.comments.createFailed": "No se pudo publicar el comentario. Por favor, inténtalo de nuevo.",
+ "acceptance.comments.delete": "Eliminar",
+ "acceptance.comments.deleteConfirm": "¿Eliminar este comentario?",
+ "acceptance.comments.deleteFailed": "No se pudo eliminar el comentario. Por favor, inténtalo de nuevo.",
+ "acceptance.comments.deleted": "Este comentario fue eliminado",
+ "acceptance.comments.empty": "Aún no hay discusión.",
+ "acceptance.comments.evidenceFromRound": "Evidencia de la ronda {{round}} — reemplazada en una ronda posterior",
+ "acceptance.comments.evidenceThisRound": "La evidencia que muestra esta verificación ahora",
+ "acceptance.comments.historicalRegions": "{{count}} nota(s) de región sobre evidencia reemplazada en una ronda posterior",
+ "acceptance.comments.linkCopied": "Enlace copiado",
+ "acceptance.comments.loadFailed": "No se pudo cargar la discusión. Por favor, actualiza.",
+ "acceptance.comments.moreActions": "Más acciones",
+ "acceptance.comments.participants": "Participantes",
+ "acceptance.comments.placeholder": "Di algo sobre esta entrega…",
+ "acceptance.comments.readOnly": "Puedes leer la discusión; únete al espacio de trabajo para participar.",
+ "acceptance.comments.region": "Región",
+ "acceptance.comments.regionCount": "{{count}} nota(s) de región",
+ "acceptance.comments.regionHint": "Dibuja un cuadro en la imagen, luego escribe tu nota.",
+ "acceptance.comments.regionMissing": "Primero selecciona una región.",
+ "acceptance.comments.regionModalTitle": "Marca el lugar que quieres decir",
+ "acceptance.comments.reopen": "Reabrir",
+ "acceptance.comments.reply": "Responder",
+ "acceptance.comments.replyPlaceholder": "Responder…",
+ "acceptance.comments.resolve": "Marcar como resuelto",
+ "acceptance.comments.resolvedSummary": "Resuelto · {{name}} · {{count}} mensaje(s)",
+ "acceptance.comments.roundCompletedBy": "{{name}} completó la ronda {{round}}",
+ "acceptance.comments.roundContext": "Ronda {{round}}",
+ "acceptance.comments.roundLanded": "Ronda {{round}} aterrizó",
+ "acceptance.comments.send": "Enviar",
+ "acceptance.comments.title": "Discusión",
+ "acceptance.comments.updateFailed": "No se pudo actualizar el comentario. Por favor, inténtalo de nuevo.",
+ "acceptance.comments.withdraw": "Retirar aprobación",
+ "acceptance.comments.withdrawDescription": "Puedes retirar o dar esto nuevamente en cualquier momento mientras la ronda esté abierta; solo cuenta donde aterrices cuando el propietario decida.",
+ "acceptance.comments.youApproved": "Aprobaste la ronda {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Aprobaste esta entrega",
"acceptance.detail.suggestion": "Sugerencia",
"acceptance.error.description": "Revisa tu conexión e intenta cargar esta aceptación nuevamente.",
"acceptance.error.title": "No se pudo cargar la aceptación",
diff --git a/locales/fa-IR/verify.json b/locales/fa-IR/verify.json
index f65705b46b0..bd2748a348a 100644
--- a/locales/fa-IR/verify.json
+++ b/locales/fa-IR/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "همان بررسی در {{count}} دور اجرا شده است؛ دور آخر معتبر است.",
"acceptance.checks.title": "بررسی‌های پذیرش",
"acceptance.checks.viewTrace": "مشاهده اجرای تأیید",
+ "acceptance.comments.addReaction": "افزودن واکنش",
+ "acceptance.comments.approvalCount": "{{count}} بازبین تایید کرده‌اند",
+ "acceptance.comments.approve": "این تحویل را تایید کنید",
+ "acceptance.comments.approveAgain": "این دور را دوباره تایید کنید",
+ "acceptance.comments.approveDescription": "نظر شما در مورد بازبینی. این وضعیت پذیرش را تغییر نمی‌دهد — فقط مالک تحویل را می‌پذیرد.",
+ "acceptance.comments.approveSummaryPlaceholder": "خلاصه‌ای یک‌خطی (اختیاری)",
+ "acceptance.comments.approved": "تایید شده",
+ "acceptance.comments.approvedAtRound": "تایید شده (دور {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} این تحویل را تایید کرد",
+ "acceptance.comments.approvedByAtRound": "{{name}} دور {{round}} را تایید کرد",
+ "acceptance.comments.author.agent": "عامل",
+ "acceptance.comments.author.deactivated": "غیرفعال شده",
+ "acceptance.comments.author.former": "عضو سابق",
+ "acceptance.comments.collapseThread": "جمع کردن",
+ "acceptance.comments.commentEvidence": "نظر دادن روی یک منطقه",
+ "acceptance.comments.commented": "نظر داده شده {{time}}",
+ "acceptance.comments.copyLink": "کپی کردن لینک",
+ "acceptance.comments.createFailed": "ارسال نظر ناموفق بود. لطفاً دوباره تلاش کنید.",
+ "acceptance.comments.delete": "حذف",
+ "acceptance.comments.deleteConfirm": "این نظر حذف شود؟",
+ "acceptance.comments.deleteFailed": "حذف نظر ناموفق بود. لطفاً دوباره تلاش کنید.",
+ "acceptance.comments.deleted": "این نظر حذف شده است",
+ "acceptance.comments.empty": "هنوز بحثی وجود ندارد.",
+ "acceptance.comments.evidenceFromRound": "شواهد از دور {{round}} — در دور بعدی جایگزین شد",
+ "acceptance.comments.evidenceThisRound": "شواهدی که این بررسی اکنون نشان می‌دهد",
+ "acceptance.comments.historicalRegions": "{{count}} یادداشت منطقه‌ای روی شواهدی که در دور بعدی جایگزین شد",
+ "acceptance.comments.linkCopied": "لینک کپی شد",
+ "acceptance.comments.loadFailed": "بارگذاری بحث ناموفق بود. لطفاً صفحه را تازه کنید.",
+ "acceptance.comments.moreActions": "اقدامات بیشتر",
+ "acceptance.comments.participants": "شرکت‌کنندگان",
+ "acceptance.comments.placeholder": "درباره این تحویل چیزی بگویید…",
+ "acceptance.comments.readOnly": "شما می‌توانید بحث را بخوانید؛ برای شرکت در آن به فضای کاری بپیوندید.",
+ "acceptance.comments.region": "منطقه",
+ "acceptance.comments.regionCount": "{{count}} یادداشت منطقه‌ای",
+ "acceptance.comments.regionHint": "یک جعبه روی تصویر بکشید، سپس یادداشت خود را بنویسید.",
+ "acceptance.comments.regionMissing": "ابتدا یک منطقه را مشخص کنید.",
+ "acceptance.comments.regionModalTitle": "محلی که منظور دارید را مشخص کنید",
+ "acceptance.comments.reopen": "بازگشایی",
+ "acceptance.comments.reply": "پاسخ",
+ "acceptance.comments.replyPlaceholder": "پاسخ…",
+ "acceptance.comments.resolve": "علامت‌گذاری به‌عنوان حل‌شده",
+ "acceptance.comments.resolvedSummary": "حل‌شده · {{name}} · {{count}} پیام",
+ "acceptance.comments.roundCompletedBy": "{{name}} دور {{round}} را تکمیل کرد",
+ "acceptance.comments.roundContext": "دور {{round}}",
+ "acceptance.comments.roundLanded": "دور {{round}} به پایان رسید",
+ "acceptance.comments.send": "ارسال",
+ "acceptance.comments.title": "بحث",
+ "acceptance.comments.updateFailed": "به‌روزرسانی نظر ناموفق بود. لطفاً دوباره تلاش کنید.",
+ "acceptance.comments.withdraw": "پس گرفتن تایید",
+ "acceptance.comments.withdrawDescription": "شما می‌توانید این را در هر زمانی که دور باز است پس بگیرید یا دوباره بدهید — فقط جایی که وقتی مالک تصمیم می‌گیرد قرار دارید، مهم است.",
+ "acceptance.comments.youApproved": "شما دور {{round}} را تایید کردید",
+ "acceptance.comments.youApprovedNoRound": "شما این تحویل را تایید کردید",
"acceptance.detail.suggestion": "پیشنهاد",
"acceptance.error.description": "اتصال خود را بررسی کنید و دوباره این پذیرش را بارگذاری کنید.",
"acceptance.error.title": "بارگذاری پذیرش امکان‌پذیر نیست",
diff --git a/locales/fr-FR/verify.json b/locales/fr-FR/verify.json
index c39d105cafd..03e78717a8c 100644
--- a/locales/fr-FR/verify.json
+++ b/locales/fr-FR/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "La même vérification a été effectuée sur {{count}} cycles ; le dernier cycle prévaut.",
"acceptance.checks.title": "Vérifications d'acceptation",
"acceptance.checks.viewTrace": "Voir l'exécution de la vérification",
+ "acceptance.comments.addReaction": "Ajouter une réaction",
+ "acceptance.comments.approvalCount": "{{count}} réviseur(s) ont approuvé",
+ "acceptance.comments.approve": "Approuver cette livraison",
+ "acceptance.comments.approveAgain": "Approuver ce tour",
+ "acceptance.comments.approveDescription": "Votre avis de révision. Cela ne modifie pas le statut d'acceptation — seul le propriétaire accepte la livraison.",
+ "acceptance.comments.approveSummaryPlaceholder": "Résumé en une ligne (facultatif)",
+ "acceptance.comments.approved": "Approuvé",
+ "acceptance.comments.approvedAtRound": "Approuvé (tour {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} a approuvé cette livraison",
+ "acceptance.comments.approvedByAtRound": "{{name}} a approuvé le tour {{round}}",
+ "acceptance.comments.author.agent": "Agent",
+ "acceptance.comments.author.deactivated": "Désactivé",
+ "acceptance.comments.author.former": "Ancien membre",
+ "acceptance.comments.collapseThread": "Réduire",
+ "acceptance.comments.commentEvidence": "Commenter une région",
+ "acceptance.comments.commented": "a commenté {{time}}",
+ "acceptance.comments.copyLink": "Copier le lien",
+ "acceptance.comments.createFailed": "Échec de la publication du commentaire. Veuillez réessayer.",
+ "acceptance.comments.delete": "Supprimer",
+ "acceptance.comments.deleteConfirm": "Supprimer ce commentaire ?",
+ "acceptance.comments.deleteFailed": "Échec de la suppression du commentaire. Veuillez réessayer.",
+ "acceptance.comments.deleted": "Ce commentaire a été supprimé",
+ "acceptance.comments.empty": "Pas encore de discussion.",
+ "acceptance.comments.evidenceFromRound": "Preuve du tour {{round}} — remplacée dans un tour ultérieur",
+ "acceptance.comments.evidenceThisRound": "La preuve que cette vérification montre maintenant",
+ "acceptance.comments.historicalRegions": "{{count}} note(s) de région sur des preuves remplacées dans un tour ultérieur",
+ "acceptance.comments.linkCopied": "Lien copié",
+ "acceptance.comments.loadFailed": "Échec du chargement de la discussion. Veuillez actualiser.",
+ "acceptance.comments.moreActions": "Plus d'actions",
+ "acceptance.comments.participants": "Participants",
+ "acceptance.comments.placeholder": "Dites quelque chose à propos de cette livraison…",
+ "acceptance.comments.readOnly": "Vous pouvez lire la discussion ; rejoignez l'espace de travail pour participer.",
+ "acceptance.comments.region": "Région",
+ "acceptance.comments.regionCount": "{{count}} note(s) de région",
+ "acceptance.comments.regionHint": "Tracez un rectangle sur l'image, puis écrivez votre note.",
+ "acceptance.comments.regionMissing": "Entourez d'abord une région.",
+ "acceptance.comments.regionModalTitle": "Entourez l'endroit que vous voulez dire",
+ "acceptance.comments.reopen": "Rouvrir",
+ "acceptance.comments.reply": "Répondre",
+ "acceptance.comments.replyPlaceholder": "Répondre…",
+ "acceptance.comments.resolve": "Marquer comme résolu",
+ "acceptance.comments.resolvedSummary": "Résolu · {{name}} · {{count}} message(s)",
+ "acceptance.comments.roundCompletedBy": "{{name}} a terminé le tour {{round}}",
+ "acceptance.comments.roundContext": "Tour {{round}}",
+ "acceptance.comments.roundLanded": "Tour {{round}} terminé",
+ "acceptance.comments.send": "Envoyer",
+ "acceptance.comments.title": "Discussion",
+ "acceptance.comments.updateFailed": "Échec de la mise à jour du commentaire. Veuillez réessayer.",
+ "acceptance.comments.withdraw": "Retirer l'approbation",
+ "acceptance.comments.withdrawDescription": "Vous pouvez retirer ou donner cela à tout moment tant que le tour est ouvert — seul votre choix au moment où le propriétaire décide compte.",
+ "acceptance.comments.youApproved": "Vous avez approuvé le tour {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Vous avez approuvé cette livraison",
"acceptance.detail.suggestion": "Suggestion",
"acceptance.error.description": "Vérifiez votre connexion et essayez de recharger cette acceptation.",
"acceptance.error.title": "Impossible de charger l'acceptation",
diff --git a/locales/it-IT/verify.json b/locales/it-IT/verify.json
index 59a53204d65..1ca580bdcc4 100644
--- a/locales/it-IT/verify.json
+++ b/locales/it-IT/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Lo stesso controllo è stato eseguito in {{count}} cicli; l'ultimo ciclo è quello valido.",
"acceptance.checks.title": "Controlli di accettazione",
"acceptance.checks.viewTrace": "Visualizza esecuzione di verifica",
+ "acceptance.comments.addReaction": "Aggiungi reazione",
+ "acceptance.comments.approvalCount": "{{count}} revisore(i) hanno approvato",
+ "acceptance.comments.approve": "Approva questa consegna",
+ "acceptance.comments.approveAgain": "Approva questo turno",
+ "acceptance.comments.approveDescription": "La tua opinione di revisione. Non modifica lo stato di accettazione — solo il proprietario accetta la consegna.",
+ "acceptance.comments.approveSummaryPlaceholder": "Riepilogo in una riga (opzionale)",
+ "acceptance.comments.approved": "Approvato",
+ "acceptance.comments.approvedAtRound": "Approvato (turno {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} ha approvato questa consegna",
+ "acceptance.comments.approvedByAtRound": "{{name}} ha approvato il turno {{round}}",
+ "acceptance.comments.author.agent": "Agente",
+ "acceptance.comments.author.deactivated": "Disattivato",
+ "acceptance.comments.author.former": "Ex membro",
+ "acceptance.comments.collapseThread": "Comprimi",
+ "acceptance.comments.commentEvidence": "Commenta su una regione",
+ "acceptance.comments.commented": "ha commentato {{time}}",
+ "acceptance.comments.copyLink": "Copia link",
+ "acceptance.comments.createFailed": "Impossibile pubblicare il commento. Riprova.",
+ "acceptance.comments.delete": "Elimina",
+ "acceptance.comments.deleteConfirm": "Eliminare questo commento?",
+ "acceptance.comments.deleteFailed": "Impossibile eliminare il commento. Riprova.",
+ "acceptance.comments.deleted": "Questo commento è stato eliminato",
+ "acceptance.comments.empty": "Nessuna discussione ancora.",
+ "acceptance.comments.evidenceFromRound": "Prova dal turno {{round}} — sostituita in un turno successivo",
+ "acceptance.comments.evidenceThisRound": "La prova che questo controllo mostra ora",
+ "acceptance.comments.historicalRegions": "{{count}} nota(e) di regione su prove sostituite in un turno successivo",
+ "acceptance.comments.linkCopied": "Link copiato",
+ "acceptance.comments.loadFailed": "Impossibile caricare la discussione. Aggiorna la pagina.",
+ "acceptance.comments.moreActions": "Altre azioni",
+ "acceptance.comments.participants": "Partecipanti",
+ "acceptance.comments.placeholder": "Dì qualcosa su questa consegna…",
+ "acceptance.comments.readOnly": "Puoi leggere la discussione; unisciti all'area di lavoro per partecipare.",
+ "acceptance.comments.region": "Regione",
+ "acceptance.comments.regionCount": "{{count}} nota(e) di regione",
+ "acceptance.comments.regionHint": "Trascina un riquadro sull'immagine, poi scrivi la tua nota.",
+ "acceptance.comments.regionMissing": "Seleziona prima una regione.",
+ "acceptance.comments.regionModalTitle": "Seleziona il punto che intendi",
+ "acceptance.comments.reopen": "Riapri",
+ "acceptance.comments.reply": "Rispondi",
+ "acceptance.comments.replyPlaceholder": "Rispondi…",
+ "acceptance.comments.resolve": "Segna come risolto",
+ "acceptance.comments.resolvedSummary": "Risolto · {{name}} · {{count}} messaggio(i)",
+ "acceptance.comments.roundCompletedBy": "{{name}} ha completato il turno {{round}}",
+ "acceptance.comments.roundContext": "Turno {{round}}",
+ "acceptance.comments.roundLanded": "Turno {{round}} completato",
+ "acceptance.comments.send": "Invia",
+ "acceptance.comments.title": "Discussione",
+ "acceptance.comments.updateFailed": "Impossibile aggiornare il commento. Riprova.",
+ "acceptance.comments.withdraw": "Ritira approvazione",
+ "acceptance.comments.withdrawDescription": "Puoi ritirare o dare di nuovo questa approvazione in qualsiasi momento mentre il turno è aperto — conta solo dove ti trovi quando il proprietario decide.",
+ "acceptance.comments.youApproved": "Hai approvato il turno {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Hai approvato questa consegna",
"acceptance.detail.suggestion": "Suggerimento",
"acceptance.error.description": "Controlla la tua connessione e prova a caricare di nuovo questa accettazione.",
"acceptance.error.title": "Impossibile caricare l'accettazione",
diff --git a/locales/ja-JP/verify.json b/locales/ja-JP/verify.json
index 1834c8037a5..73710435ebf 100644
--- a/locales/ja-JP/verify.json
+++ b/locales/ja-JP/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "同じチェックが {{count}} ラウンドで実行されました。最後のラウンドが基準です。",
"acceptance.checks.title": "受け入れチェック",
"acceptance.checks.viewTrace": "検証実行を表示",
+ "acceptance.comments.addReaction": "リアクションを追加",
+ "acceptance.comments.approvalCount": "{{count}} 人のレビュアーが承認しました",
+ "acceptance.comments.approve": "この納品を承認する",
+ "acceptance.comments.approveAgain": "このラウンドを再承認する",
+ "acceptance.comments.approveDescription": "あなたのレビュー意見です。受け入れステータスは変更されません — オーナーのみが納品を受け入れます。",
+ "acceptance.comments.approveSummaryPlaceholder": "一行の要約(オプション)",
+ "acceptance.comments.approved": "承認済み",
+ "acceptance.comments.approvedAtRound": "承認済み(ラウンド {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} がこの納品を承認しました",
+ "acceptance.comments.approvedByAtRound": "{{name}} がラウンド {{round}} を承認しました",
+ "acceptance.comments.author.agent": "エージェント",
+ "acceptance.comments.author.deactivated": "無効化済み",
+ "acceptance.comments.author.former": "元メンバー",
+ "acceptance.comments.collapseThread": "折りたたむ",
+ "acceptance.comments.commentEvidence": "領域についてコメントする",
+ "acceptance.comments.commented": "{{time}} にコメントしました",
+ "acceptance.comments.copyLink": "リンクをコピー",
+ "acceptance.comments.createFailed": "コメントの投稿に失敗しました。もう一度お試しください。",
+ "acceptance.comments.delete": "削除",
+ "acceptance.comments.deleteConfirm": "このコメントを削除しますか?",
+ "acceptance.comments.deleteFailed": "コメントの削除に失敗しました。もう一度お試しください。",
+ "acceptance.comments.deleted": "このコメントは削除されました",
+ "acceptance.comments.empty": "まだ議論はありません。",
+ "acceptance.comments.evidenceFromRound": "ラウンド {{round}} の証拠 — 後のラウンドで置き換えられました",
+ "acceptance.comments.evidenceThisRound": "このチェックが現在示している証拠",
+ "acceptance.comments.historicalRegions": "後のラウンドで置き換えられた証拠に関する {{count}} 件の領域ノート",
+ "acceptance.comments.linkCopied": "リンクをコピーしました",
+ "acceptance.comments.loadFailed": "議論の読み込みに失敗しました。再読み込みしてください。",
+ "acceptance.comments.moreActions": "その他のアクション",
+ "acceptance.comments.participants": "参加者",
+ "acceptance.comments.placeholder": "この納品について何か言ってください…",
+ "acceptance.comments.readOnly": "議論を読むことはできますが、参加するにはワークスペースに参加してください。",
+ "acceptance.comments.region": "領域",
+ "acceptance.comments.regionCount": "{{count}} 件の領域ノート",
+ "acceptance.comments.regionHint": "画像上でボックスをドラッグし、ノートを書いてください。",
+ "acceptance.comments.regionMissing": "まず領域を囲んでください。",
+ "acceptance.comments.regionModalTitle": "対象の場所を囲んでください",
+ "acceptance.comments.reopen": "再開する",
+ "acceptance.comments.reply": "返信",
+ "acceptance.comments.replyPlaceholder": "返信…",
+ "acceptance.comments.resolve": "解決済みにする",
+ "acceptance.comments.resolvedSummary": "解決済み · {{name}} · {{count}} 件のメッセージ",
+ "acceptance.comments.roundCompletedBy": "{{name}} がラウンド {{round}} を完了しました",
+ "acceptance.comments.roundContext": "ラウンド {{round}}",
+ "acceptance.comments.roundLanded": "ラウンド {{round}} が着地しました",
+ "acceptance.comments.send": "送信",
+ "acceptance.comments.title": "議論",
+ "acceptance.comments.updateFailed": "コメントの更新に失敗しました。もう一度お試しください。",
+ "acceptance.comments.withdraw": "承認を取り下げる",
+ "acceptance.comments.withdrawDescription": "ラウンドが開いている間は、いつでもこれを取り下げたり再度与えたりできます — オーナーが決定する際にどこに着地しているかだけが重要です。",
+ "acceptance.comments.youApproved": "ラウンド {{round}} を承認しました",
+ "acceptance.comments.youApprovedNoRound": "この納品を承認しました",
"acceptance.detail.suggestion": "提案",
"acceptance.error.description": "接続を確認し、この受け入れを再度読み込んでください。",
"acceptance.error.title": "受け入れを読み込めません",
diff --git a/locales/ko-KR/verify.json b/locales/ko-KR/verify.json
index 354d1d8f8b1..9e9b9dcd704 100644
--- a/locales/ko-KR/verify.json
+++ b/locales/ko-KR/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "동일한 검사가 {{count}}개의 라운드에서 실행되었습니다. 마지막 라운드가 최종 결과입니다.",
"acceptance.checks.title": "수락 검사",
"acceptance.checks.viewTrace": "검증 실행 보기",
+ "acceptance.comments.addReaction": "반응 추가",
+ "acceptance.comments.approvalCount": "{{count}}명의 검토자가 승인함",
+ "acceptance.comments.approve": "이 전달을 승인",
+ "acceptance.comments.approveAgain": "이번 라운드를 다시 승인",
+ "acceptance.comments.approveDescription": "귀하의 검토 의견입니다. 이는 수락 상태를 변경하지 않습니다 — 소유자만이 전달을 수락합니다.",
+ "acceptance.comments.approveSummaryPlaceholder": "한 줄 요약 (선택 사항)",
+ "acceptance.comments.approved": "승인됨",
+ "acceptance.comments.approvedAtRound": "승인됨 (라운드 {{round}})",
+ "acceptance.comments.approvedBy": "{{name}}님이 이 전달을 승인함",
+ "acceptance.comments.approvedByAtRound": "{{name}}님이 라운드 {{round}}을 승인함",
+ "acceptance.comments.author.agent": "에이전트",
+ "acceptance.comments.author.deactivated": "비활성화됨",
+ "acceptance.comments.author.former": "이전 멤버",
+ "acceptance.comments.collapseThread": "접기",
+ "acceptance.comments.commentEvidence": "영역에 대한 댓글 작성",
+ "acceptance.comments.commented": "{{time}}에 댓글 작성",
+ "acceptance.comments.copyLink": "링크 복사",
+ "acceptance.comments.createFailed": "댓글 게시에 실패했습니다. 다시 시도해주세요.",
+ "acceptance.comments.delete": "삭제",
+ "acceptance.comments.deleteConfirm": "이 댓글을 삭제하시겠습니까?",
+ "acceptance.comments.deleteFailed": "댓글 삭제에 실패했습니다. 다시 시도해주세요.",
+ "acceptance.comments.deleted": "이 댓글은 삭제되었습니다",
+ "acceptance.comments.empty": "아직 논의가 없습니다.",
+ "acceptance.comments.evidenceFromRound": "라운드 {{round}}의 증거 — 이후 라운드에서 대체됨",
+ "acceptance.comments.evidenceThisRound": "이 검사가 현재 보여주는 증거",
+ "acceptance.comments.historicalRegions": "이후 라운드에서 대체된 증거에 대한 {{count}}개의 영역 노트",
+ "acceptance.comments.linkCopied": "링크가 복사되었습니다",
+ "acceptance.comments.loadFailed": "논의 로드에 실패했습니다. 새로고침 해주세요.",
+ "acceptance.comments.moreActions": "더 많은 작업",
+ "acceptance.comments.participants": "참여자",
+ "acceptance.comments.placeholder": "이 전달에 대해 말해보세요…",
+ "acceptance.comments.readOnly": "논의를 읽을 수 있습니다; 작업 공간에 참여하여 논의에 참여하세요.",
+ "acceptance.comments.region": "영역",
+ "acceptance.comments.regionCount": "{{count}}개의 영역 노트",
+ "acceptance.comments.regionHint": "이미지에 상자를 드래그한 후 노트를 작성하세요.",
+ "acceptance.comments.regionMissing": "먼저 영역을 선택하세요.",
+ "acceptance.comments.regionModalTitle": "의미하는 지점을 선택하세요",
+ "acceptance.comments.reopen": "다시 열기",
+ "acceptance.comments.reply": "답글",
+ "acceptance.comments.replyPlaceholder": "답글 작성…",
+ "acceptance.comments.resolve": "해결됨으로 표시",
+ "acceptance.comments.resolvedSummary": "해결됨 · {{name}} · {{count}}개의 메시지",
+ "acceptance.comments.roundCompletedBy": "{{name}}님이 라운드 {{round}}을 완료함",
+ "acceptance.comments.roundContext": "라운드 {{round}}",
+ "acceptance.comments.roundLanded": "라운드 {{round}} 도착",
+ "acceptance.comments.send": "보내기",
+ "acceptance.comments.title": "논의",
+ "acceptance.comments.updateFailed": "댓글 업데이트에 실패했습니다. 다시 시도해주세요.",
+ "acceptance.comments.withdraw": "승인 철회",
+ "acceptance.comments.withdrawDescription": "라운드가 열려 있는 동안 언제든지 승인하거나 철회할 수 있습니다 — 소유자가 결정할 때 귀하의 위치만이 중요합니다.",
+ "acceptance.comments.youApproved": "라운드 {{round}}을 승인함",
+ "acceptance.comments.youApprovedNoRound": "이 전달을 승인함",
"acceptance.detail.suggestion": "제안",
"acceptance.error.description": "연결 상태를 확인하고 이 수락을 다시 로드하세요.",
"acceptance.error.title": "수락을 로드할 수 없음",
diff --git a/locales/nl-NL/verify.json b/locales/nl-NL/verify.json
index 0c32223370a..2bfe344af77 100644
--- a/locales/nl-NL/verify.json
+++ b/locales/nl-NL/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Dezelfde controle werd uitgevoerd in {{count}} rondes; de laatste ronde is bepalend.",
"acceptance.checks.title": "Acceptatiecontroles",
"acceptance.checks.viewTrace": "Bekijk verificatierun",
+ "acceptance.comments.addReaction": "Reactie toevoegen",
+ "acceptance.comments.approvalCount": "{{count}} beoordelaar(s) hebben goedgekeurd",
+ "acceptance.comments.approve": "Keur deze levering goed",
+ "acceptance.comments.approveAgain": "Keur deze ronde opnieuw goed",
+ "acceptance.comments.approveDescription": "Uw beoordelingsmening. Dit verandert de acceptatiestatus niet — alleen de eigenaar accepteert de levering.",
+ "acceptance.comments.approveSummaryPlaceholder": "Eén-regelige samenvatting (optioneel)",
+ "acceptance.comments.approved": "Goedgekeurd",
+ "acceptance.comments.approvedAtRound": "Goedgekeurd (ronde {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} heeft deze levering goedgekeurd",
+ "acceptance.comments.approvedByAtRound": "{{name}} heeft ronde {{round}} goedgekeurd",
+ "acceptance.comments.author.agent": "Agent",
+ "acceptance.comments.author.deactivated": "Gedeactiveerd",
+ "acceptance.comments.author.former": "Voormalig lid",
+ "acceptance.comments.collapseThread": "Inklappen",
+ "acceptance.comments.commentEvidence": "Opmerking over een gebied",
+ "acceptance.comments.commented": "heeft gereageerd {{time}}",
+ "acceptance.comments.copyLink": "Link kopiëren",
+ "acceptance.comments.createFailed": "Het plaatsen van de opmerking is mislukt. Probeer het opnieuw.",
+ "acceptance.comments.delete": "Verwijderen",
+ "acceptance.comments.deleteConfirm": "Deze opmerking verwijderen?",
+ "acceptance.comments.deleteFailed": "Het verwijderen van de opmerking is mislukt. Probeer het opnieuw.",
+ "acceptance.comments.deleted": "Deze opmerking is verwijderd",
+ "acceptance.comments.empty": "Nog geen discussie.",
+ "acceptance.comments.evidenceFromRound": "Bewijs van ronde {{round}} — vervangen in een latere ronde",
+ "acceptance.comments.evidenceThisRound": "Het bewijs dat deze controle nu toont",
+ "acceptance.comments.historicalRegions": "{{count}} gebiedsnotitie(s) over bewijs dat in een latere ronde is vervangen",
+ "acceptance.comments.linkCopied": "Link gekopieerd",
+ "acceptance.comments.loadFailed": "Het laden van de discussie is mislukt. Vernieuw de pagina.",
+ "acceptance.comments.moreActions": "Meer acties",
+ "acceptance.comments.participants": "Deelnemers",
+ "acceptance.comments.placeholder": "Zeg iets over deze levering…",
+ "acceptance.comments.readOnly": "U kunt de discussie lezen; sluit u aan bij de werkruimte om deel te nemen.",
+ "acceptance.comments.region": "Gebied",
+ "acceptance.comments.regionCount": "{{count}} gebiedsnotitie(s)",
+ "acceptance.comments.regionHint": "Teken een vak op de afbeelding en schrijf vervolgens uw notitie.",
+ "acceptance.comments.regionMissing": "Selecteer eerst een gebied.",
+ "acceptance.comments.regionModalTitle": "Selecteer de plek die u bedoelt",
+ "acceptance.comments.reopen": "Heropenen",
+ "acceptance.comments.reply": "Antwoorden",
+ "acceptance.comments.replyPlaceholder": "Antwoord…",
+ "acceptance.comments.resolve": "Markeer als opgelost",
+ "acceptance.comments.resolvedSummary": "Opgelost · {{name}} · {{count}} bericht(en)",
+ "acceptance.comments.roundCompletedBy": "{{name}} heeft ronde {{round}} voltooid",
+ "acceptance.comments.roundContext": "Ronde {{round}}",
+ "acceptance.comments.roundLanded": "Ronde {{round}} afgerond",
+ "acceptance.comments.send": "Verzenden",
+ "acceptance.comments.title": "Discussie",
+ "acceptance.comments.updateFailed": "Het bijwerken van de opmerking is mislukt. Probeer het opnieuw.",
+ "acceptance.comments.withdraw": "Goedkeuring intrekken",
+ "acceptance.comments.withdrawDescription": "U kunt dit op elk moment intrekken of opnieuw geven zolang de ronde open is — alleen waar u landt wanneer de eigenaar beslist, telt.",
+ "acceptance.comments.youApproved": "U heeft ronde {{round}} goedgekeurd",
+ "acceptance.comments.youApprovedNoRound": "U heeft deze levering goedgekeurd",
"acceptance.detail.suggestion": "Suggestie",
"acceptance.error.description": "Controleer je verbinding en probeer deze acceptatie opnieuw te laden.",
"acceptance.error.title": "Kan acceptatie niet laden",
diff --git a/locales/pl-PL/verify.json b/locales/pl-PL/verify.json
index 937ce55dc9b..c101cc1f834 100644
--- a/locales/pl-PL/verify.json
+++ b/locales/pl-PL/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Ta sama kontrola była przeprowadzana w {{count}} rundach; ostatnia runda jest decydująca.",
"acceptance.checks.title": "Kontrole akceptacji",
"acceptance.checks.viewTrace": "Zobacz przebieg weryfikacji",
+ "acceptance.comments.addReaction": "Dodaj reakcję",
+ "acceptance.comments.approvalCount": "{{count}} recenzent(ów) zatwierdziło",
+ "acceptance.comments.approve": "Zatwierdź tę dostawę",
+ "acceptance.comments.approveAgain": "Zatwierdź tę rundę",
+ "acceptance.comments.approveDescription": "Twoja opinia recenzenta. Nie zmienia statusu akceptacji — tylko właściciel akceptuje dostawę.",
+ "acceptance.comments.approveSummaryPlaceholder": "Jednolinijkowe podsumowanie (opcjonalne)",
+ "acceptance.comments.approved": "Zatwierdzono",
+ "acceptance.comments.approvedAtRound": "Zatwierdzono (runda {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} zatwierdził(a) tę dostawę",
+ "acceptance.comments.approvedByAtRound": "{{name}} zatwierdził(a) rundę {{round}}",
+ "acceptance.comments.author.agent": "Agent",
+ "acceptance.comments.author.deactivated": "Dezaktywowany",
+ "acceptance.comments.author.former": "Były członek",
+ "acceptance.comments.collapseThread": "Zwiń",
+ "acceptance.comments.commentEvidence": "Skomentuj region",
+ "acceptance.comments.commented": "skomentował(a) {{time}}",
+ "acceptance.comments.copyLink": "Kopiuj link",
+ "acceptance.comments.createFailed": "Nie udało się opublikować komentarza. Spróbuj ponownie.",
+ "acceptance.comments.delete": "Usuń",
+ "acceptance.comments.deleteConfirm": "Usunąć ten komentarz?",
+ "acceptance.comments.deleteFailed": "Nie udało się usunąć komentarza. Spróbuj ponownie.",
+ "acceptance.comments.deleted": "Ten komentarz został usunięty",
+ "acceptance.comments.empty": "Brak dyskusji.",
+ "acceptance.comments.evidenceFromRound": "Dowód z rundy {{round}} — zastąpiony w późniejszej rundzie",
+ "acceptance.comments.evidenceThisRound": "Dowód, który pokazuje teraz ta kontrola",
+ "acceptance.comments.historicalRegions": "{{count}} notatka(i) dotycząca regionu na dowodzie zastąpionym w późniejszej rundzie",
+ "acceptance.comments.linkCopied": "Link skopiowany",
+ "acceptance.comments.loadFailed": "Nie udało się załadować dyskusji. Odśwież stronę.",
+ "acceptance.comments.moreActions": "Więcej akcji",
+ "acceptance.comments.participants": "Uczestnicy",
+ "acceptance.comments.placeholder": "Powiedz coś o tej dostawie…",
+ "acceptance.comments.readOnly": "Możesz czytać dyskusję; dołącz do przestrzeni roboczej, aby wziąć udział.",
+ "acceptance.comments.region": "Region",
+ "acceptance.comments.regionCount": "{{count}} notatka(i) dotycząca regionu",
+ "acceptance.comments.regionHint": "Przeciągnij ramkę na obrazku, a następnie napisz swoją notatkę.",
+ "acceptance.comments.regionMissing": "Najpierw zaznacz region.",
+ "acceptance.comments.regionModalTitle": "Zaznacz miejsce, o które chodzi",
+ "acceptance.comments.reopen": "Otwórz ponownie",
+ "acceptance.comments.reply": "Odpowiedz",
+ "acceptance.comments.replyPlaceholder": "Odpowiedz…",
+ "acceptance.comments.resolve": "Oznacz jako rozwiązane",
+ "acceptance.comments.resolvedSummary": "Rozwiązane · {{name}} · {{count}} wiadomość(i)",
+ "acceptance.comments.roundCompletedBy": "{{name}} zakończył(a) rundę {{round}}",
+ "acceptance.comments.roundContext": "Runda {{round}}",
+ "acceptance.comments.roundLanded": "Runda {{round}} zakończona",
+ "acceptance.comments.send": "Wyślij",
+ "acceptance.comments.title": "Dyskusja",
+ "acceptance.comments.updateFailed": "Nie udało się zaktualizować komentarza. Spróbuj ponownie.",
+ "acceptance.comments.withdraw": "Wycofaj zatwierdzenie",
+ "acceptance.comments.withdrawDescription": "Możesz wycofać lub ponownie zatwierdzić w dowolnym momencie, gdy runda jest otwarta — liczy się tylko to, gdzie się znajdziesz, gdy właściciel podejmie decyzję.",
+ "acceptance.comments.youApproved": "Zatwierdziłeś(aś) rundę {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Zatwierdziłeś(aś) tę dostawę",
"acceptance.detail.suggestion": "Sugestia",
"acceptance.error.description": "Sprawdź swoje połączenie i spróbuj ponownie załadować tę akceptację.",
"acceptance.error.title": "Nie można załadować akceptacji",
diff --git a/locales/pt-BR/verify.json b/locales/pt-BR/verify.json
index 8184573f996..e61f986c8c1 100644
--- a/locales/pt-BR/verify.json
+++ b/locales/pt-BR/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "A mesma verificação foi executada em {{count}} rodadas; a última rodada prevalece.",
"acceptance.checks.title": "Verificações de aceitação",
"acceptance.checks.viewTrace": "Ver execução de verificação",
+ "acceptance.comments.addReaction": "Adicionar reação",
+ "acceptance.comments.approvalCount": "{{count}} revisor(es) aprovaram",
+ "acceptance.comments.approve": "Aprovar esta entrega",
+ "acceptance.comments.approveAgain": "Aprovar esta rodada",
+ "acceptance.comments.approveDescription": "Sua opinião de revisão. Isso não altera o status de aceitação — apenas o proprietário aceita a entrega.",
+ "acceptance.comments.approveSummaryPlaceholder": "Resumo em uma linha (opcional)",
+ "acceptance.comments.approved": "Aprovado",
+ "acceptance.comments.approvedAtRound": "Aprovado (rodada {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} aprovou esta entrega",
+ "acceptance.comments.approvedByAtRound": "{{name}} aprovou a rodada {{round}}",
+ "acceptance.comments.author.agent": "Agente",
+ "acceptance.comments.author.deactivated": "Desativado",
+ "acceptance.comments.author.former": "Ex-membro",
+ "acceptance.comments.collapseThread": "Recolher",
+ "acceptance.comments.commentEvidence": "Comentar em uma região",
+ "acceptance.comments.commented": "comentou {{time}}",
+ "acceptance.comments.copyLink": "Copiar link",
+ "acceptance.comments.createFailed": "Falha ao postar o comentário. Por favor, tente novamente.",
+ "acceptance.comments.delete": "Excluir",
+ "acceptance.comments.deleteConfirm": "Excluir este comentário?",
+ "acceptance.comments.deleteFailed": "Falha ao excluir o comentário. Por favor, tente novamente.",
+ "acceptance.comments.deleted": "Este comentário foi excluído",
+ "acceptance.comments.empty": "Nenhuma discussão ainda.",
+ "acceptance.comments.evidenceFromRound": "Evidência da rodada {{round}} — substituída em uma rodada posterior",
+ "acceptance.comments.evidenceThisRound": "A evidência que esta verificação mostra agora",
+ "acceptance.comments.historicalRegions": "{{count}} nota(s) de região sobre evidências substituídas em uma rodada posterior",
+ "acceptance.comments.linkCopied": "Link copiado",
+ "acceptance.comments.loadFailed": "Falha ao carregar a discussão. Por favor, atualize.",
+ "acceptance.comments.moreActions": "Mais ações",
+ "acceptance.comments.participants": "Participantes",
+ "acceptance.comments.placeholder": "Diga algo sobre esta entrega…",
+ "acceptance.comments.readOnly": "Você pode ler a discussão; entre no espaço de trabalho para participar.",
+ "acceptance.comments.region": "Região",
+ "acceptance.comments.regionCount": "{{count}} nota(s) de região",
+ "acceptance.comments.regionHint": "Arraste uma caixa na imagem e escreva sua nota.",
+ "acceptance.comments.regionMissing": "Circule uma região primeiro.",
+ "acceptance.comments.regionModalTitle": "Circule o ponto que você quer dizer",
+ "acceptance.comments.reopen": "Reabrir",
+ "acceptance.comments.reply": "Responder",
+ "acceptance.comments.replyPlaceholder": "Responder…",
+ "acceptance.comments.resolve": "Marcar como resolvido",
+ "acceptance.comments.resolvedSummary": "Resolvido · {{name}} · {{count}} mensagem(s)",
+ "acceptance.comments.roundCompletedBy": "{{name}} completou a rodada {{round}}",
+ "acceptance.comments.roundContext": "Rodada {{round}}",
+ "acceptance.comments.roundLanded": "Rodada {{round}} concluída",
+ "acceptance.comments.send": "Enviar",
+ "acceptance.comments.title": "Discussão",
+ "acceptance.comments.updateFailed": "Falha ao atualizar o comentário. Por favor, tente novamente.",
+ "acceptance.comments.withdraw": "Retirar aprovação",
+ "acceptance.comments.withdrawDescription": "Você pode retirar ou dar novamente a qualquer momento enquanto a rodada estiver aberta — apenas onde você estiver quando o proprietário decidir conta.",
+ "acceptance.comments.youApproved": "Você aprovou a rodada {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Você aprovou esta entrega",
"acceptance.detail.suggestion": "Sugestão",
"acceptance.error.description": "Verifique sua conexão e tente carregar esta aceitação novamente.",
"acceptance.error.title": "Não foi possível carregar a aceitação",
diff --git a/locales/ru-RU/verify.json b/locales/ru-RU/verify.json
index 7f256725fd8..042d2b1662d 100644
--- a/locales/ru-RU/verify.json
+++ b/locales/ru-RU/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Одна и та же проверка проводилась в {{count}} раундах; последний раунд является окончательным.",
"acceptance.checks.title": "Проверки принятия",
"acceptance.checks.viewTrace": "Просмотреть проверочный запуск",
+ "acceptance.comments.addReaction": "Добавить реакцию",
+ "acceptance.comments.approvalCount": "{{count}} рецензент(ов) одобрил(и)",
+ "acceptance.comments.approve": "Одобрить эту доставку",
+ "acceptance.comments.approveAgain": "Одобрить этот раунд",
+ "acceptance.comments.approveDescription": "Ваше мнение о рецензии. Оно не изменяет статус принятия — только владелец принимает доставку.",
+ "acceptance.comments.approveSummaryPlaceholder": "Однострочное резюме (необязательно)",
+ "acceptance.comments.approved": "Одобрено",
+ "acceptance.comments.approvedAtRound": "Одобрено (раунд {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} одобрил(а) эту доставку",
+ "acceptance.comments.approvedByAtRound": "{{name}} одобрил(а) раунд {{round}}",
+ "acceptance.comments.author.agent": "Агент",
+ "acceptance.comments.author.deactivated": "Деактивирован",
+ "acceptance.comments.author.former": "Бывший участник",
+ "acceptance.comments.collapseThread": "Свернуть",
+ "acceptance.comments.commentEvidence": "Комментировать область",
+ "acceptance.comments.commented": "прокомментировал(а) {{time}}",
+ "acceptance.comments.copyLink": "Скопировать ссылку",
+ "acceptance.comments.createFailed": "Не удалось опубликовать комментарий. Пожалуйста, попробуйте снова.",
+ "acceptance.comments.delete": "Удалить",
+ "acceptance.comments.deleteConfirm": "Удалить этот комментарий?",
+ "acceptance.comments.deleteFailed": "Не удалось удалить комментарий. Пожалуйста, попробуйте снова.",
+ "acceptance.comments.deleted": "Этот комментарий был удален",
+ "acceptance.comments.empty": "Обсуждение пока отсутствует.",
+ "acceptance.comments.evidenceFromRound": "Доказательства из раунда {{round}} — заменены в более позднем раунде",
+ "acceptance.comments.evidenceThisRound": "Доказательства, которые показывает эта проверка сейчас",
+ "acceptance.comments.historicalRegions": "{{count}} заметка(и) о регионах на доказательствах, замененных в более позднем раунде",
+ "acceptance.comments.linkCopied": "Ссылка скопирована",
+ "acceptance.comments.loadFailed": "Не удалось загрузить обсуждение. Пожалуйста, обновите страницу.",
+ "acceptance.comments.moreActions": "Дополнительные действия",
+ "acceptance.comments.participants": "Участники",
+ "acceptance.comments.placeholder": "Напишите что-нибудь о этой доставке…",
+ "acceptance.comments.readOnly": "Вы можете читать обсуждение; присоединитесь к рабочей области, чтобы участвовать.",
+ "acceptance.comments.region": "Область",
+ "acceptance.comments.regionCount": "{{count}} заметка(и) о регионах",
+ "acceptance.comments.regionHint": "Нарисуйте рамку на изображении, затем напишите свою заметку.",
+ "acceptance.comments.regionMissing": "Сначала выделите область.",
+ "acceptance.comments.regionModalTitle": "Обведите место, которое вы имеете в виду",
+ "acceptance.comments.reopen": "Открыть снова",
+ "acceptance.comments.reply": "Ответить",
+ "acceptance.comments.replyPlaceholder": "Ответить…",
+ "acceptance.comments.resolve": "Отметить как решенное",
+ "acceptance.comments.resolvedSummary": "Решено · {{name}} · {{count}} сообщение(й)",
+ "acceptance.comments.roundCompletedBy": "{{name}} завершил(а) раунд {{round}}",
+ "acceptance.comments.roundContext": "Раунд {{round}}",
+ "acceptance.comments.roundLanded": "Раунд {{round}} завершен",
+ "acceptance.comments.send": "Отправить",
+ "acceptance.comments.title": "Обсуждение",
+ "acceptance.comments.updateFailed": "Не удалось обновить комментарий. Пожалуйста, попробуйте снова.",
+ "acceptance.comments.withdraw": "Отозвать одобрение",
+ "acceptance.comments.withdrawDescription": "Вы можете отозвать или дать это снова в любое время, пока раунд открыт — учитывается только то, где вы окажетесь, когда владелец примет решение.",
+ "acceptance.comments.youApproved": "Вы одобрили раунд {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Вы одобрили эту доставку",
"acceptance.detail.suggestion": "Рекомендация",
"acceptance.error.description": "Проверьте соединение и попробуйте загрузить это принятие снова.",
"acceptance.error.title": "Не удалось загрузить принятие",
diff --git a/locales/tr-TR/verify.json b/locales/tr-TR/verify.json
index 210feaa8a2f..9bae0c232c5 100644
--- a/locales/tr-TR/verify.json
+++ b/locales/tr-TR/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Aynı kontrol {{count}} turda çalıştı; son tur geçerlidir.",
"acceptance.checks.title": "Kabul kontrolleri",
"acceptance.checks.viewTrace": "Doğrulama çalışmasını görüntüle",
+ "acceptance.comments.addReaction": "Tepki ekle",
+ "acceptance.comments.approvalCount": "{{count}} inceleyici onayladı",
+ "acceptance.comments.approve": "Bu teslimatı onayla",
+ "acceptance.comments.approveAgain": "Bu turu tekrar onayla",
+ "acceptance.comments.approveDescription": "İnceleme görüşünüz. Kabul durumunu değiştirmez — yalnızca sahibi teslimatı kabul eder.",
+ "acceptance.comments.approveSummaryPlaceholder": "Tek satırlık özet (isteğe bağlı)",
+ "acceptance.comments.approved": "Onaylandı",
+ "acceptance.comments.approvedAtRound": "Onaylandı (tur {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} bu teslimatı onayladı",
+ "acceptance.comments.approvedByAtRound": "{{name}} {{round}}. turu onayladı",
+ "acceptance.comments.author.agent": "Ajan",
+ "acceptance.comments.author.deactivated": "Devre dışı bırakıldı",
+ "acceptance.comments.author.former": "Eski üye",
+ "acceptance.comments.collapseThread": "Daralt",
+ "acceptance.comments.commentEvidence": "Bir bölge hakkında yorum yap",
+ "acceptance.comments.commented": "{{time}} yorum yaptı",
+ "acceptance.comments.copyLink": "Bağlantıyı kopyala",
+ "acceptance.comments.createFailed": "Yorum gönderilemedi. Lütfen tekrar deneyin.",
+ "acceptance.comments.delete": "Sil",
+ "acceptance.comments.deleteConfirm": "Bu yorumu silmek istiyor musunuz?",
+ "acceptance.comments.deleteFailed": "Yorum silinemedi. Lütfen tekrar deneyin.",
+ "acceptance.comments.deleted": "Bu yorum silindi",
+ "acceptance.comments.empty": "Henüz tartışma yok.",
+ "acceptance.comments.evidenceFromRound": "{{round}}. turdan kanıt — sonraki bir turda değiştirildi",
+ "acceptance.comments.evidenceThisRound": "Bu kontrolün şu anda gösterdiği kanıt",
+ "acceptance.comments.historicalRegions": "Sonraki bir turda değiştirilen kanıt üzerinde {{count}} bölge notu",
+ "acceptance.comments.linkCopied": "Bağlantı kopyalandı",
+ "acceptance.comments.loadFailed": "Tartışma yüklenemedi. Lütfen yenileyin.",
+ "acceptance.comments.moreActions": "Daha fazla eylem",
+ "acceptance.comments.participants": "Katılımcılar",
+ "acceptance.comments.placeholder": "Bu teslimat hakkında bir şeyler söyleyin…",
+ "acceptance.comments.readOnly": "Tartışmayı okuyabilirsiniz; katılmak için çalışma alanına katılın.",
+ "acceptance.comments.region": "Bölge",
+ "acceptance.comments.regionCount": "{{count}} bölge notu",
+ "acceptance.comments.regionHint": "Resimde bir kutu sürükleyin, ardından notunuzu yazın.",
+ "acceptance.comments.regionMissing": "Önce bir bölge çizin.",
+ "acceptance.comments.regionModalTitle": "Belirttiğiniz noktayı çizin",
+ "acceptance.comments.reopen": "Yeniden aç",
+ "acceptance.comments.reply": "Yanıtla",
+ "acceptance.comments.replyPlaceholder": "Yanıtla…",
+ "acceptance.comments.resolve": "Çözüldü olarak işaretle",
+ "acceptance.comments.resolvedSummary": "Çözüldü · {{name}} · {{count}} mesaj",
+ "acceptance.comments.roundCompletedBy": "{{name}} {{round}}. turu tamamladı",
+ "acceptance.comments.roundContext": "{{round}}. tur",
+ "acceptance.comments.roundLanded": "{{round}}. tur tamamlandı",
+ "acceptance.comments.send": "Gönder",
+ "acceptance.comments.title": "Tartışma",
+ "acceptance.comments.updateFailed": "Yorum güncellenemedi. Lütfen tekrar deneyin.",
+ "acceptance.comments.withdraw": "Onayı geri çek",
+ "acceptance.comments.withdrawDescription": "Tur açıkken bunu istediğiniz zaman geri çekebilir veya tekrar verebilirsiniz — yalnızca sahibi karar verdiğinde bulunduğunuz yer geçerlidir.",
+ "acceptance.comments.youApproved": "{{round}}. turu onayladınız",
+ "acceptance.comments.youApprovedNoRound": "Bu teslimatı onayladınız",
"acceptance.detail.suggestion": "Öneri",
"acceptance.error.description": "Bağlantınızı kontrol edin ve bu kabulü tekrar yüklemeyi deneyin.",
"acceptance.error.title": "Kabul yüklenemedi",
diff --git a/locales/vi-VN/verify.json b/locales/vi-VN/verify.json
index 0479268dc55..8ebdd0d65c4 100644
--- a/locales/vi-VN/verify.json
+++ b/locales/vi-VN/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "Cùng một kiểm tra đã chạy trong {{count}} vòng; vòng cuối cùng là kết quả cuối cùng.",
"acceptance.checks.title": "Kiểm tra chấp nhận",
"acceptance.checks.viewTrace": "Xem quá trình xác minh",
+ "acceptance.comments.addReaction": "Thêm phản ứng",
+ "acceptance.comments.approvalCount": "{{count}} người đánh giá đã phê duyệt",
+ "acceptance.comments.approve": "Phê duyệt giao hàng này",
+ "acceptance.comments.approveAgain": "Phê duyệt lại vòng này",
+ "acceptance.comments.approveDescription": "Ý kiến đánh giá của bạn. Nó không thay đổi trạng thái chấp nhận — chỉ chủ sở hữu mới có thể chấp nhận giao hàng.",
+ "acceptance.comments.approveSummaryPlaceholder": "Tóm tắt một dòng (tùy chọn)",
+ "acceptance.comments.approved": "Đã phê duyệt",
+ "acceptance.comments.approvedAtRound": "Đã phê duyệt (vòng {{round}})",
+ "acceptance.comments.approvedBy": "{{name}} đã phê duyệt giao hàng này",
+ "acceptance.comments.approvedByAtRound": "{{name}} đã phê duyệt vòng {{round}}",
+ "acceptance.comments.author.agent": "Đại lý",
+ "acceptance.comments.author.deactivated": "Đã hủy kích hoạt",
+ "acceptance.comments.author.former": "Thành viên cũ",
+ "acceptance.comments.collapseThread": "Thu gọn",
+ "acceptance.comments.commentEvidence": "Bình luận về một khu vực",
+ "acceptance.comments.commented": "đã bình luận {{time}}",
+ "acceptance.comments.copyLink": "Sao chép liên kết",
+ "acceptance.comments.createFailed": "Không thể đăng bình luận. Vui lòng thử lại.",
+ "acceptance.comments.delete": "Xóa",
+ "acceptance.comments.deleteConfirm": "Xóa bình luận này?",
+ "acceptance.comments.deleteFailed": "Không thể xóa bình luận. Vui lòng thử lại.",
+ "acceptance.comments.deleted": "Bình luận này đã bị xóa",
+ "acceptance.comments.empty": "Chưa có thảo luận nào.",
+ "acceptance.comments.evidenceFromRound": "Bằng chứng từ vòng {{round}} — đã được thay thế trong vòng sau",
+ "acceptance.comments.evidenceThisRound": "Bằng chứng kiểm tra này hiện hiển thị",
+ "acceptance.comments.historicalRegions": "{{count}} ghi chú khu vực về bằng chứng đã được thay thế trong vòng sau",
+ "acceptance.comments.linkCopied": "Liên kết đã được sao chép",
+ "acceptance.comments.loadFailed": "Không thể tải thảo luận. Vui lòng làm mới.",
+ "acceptance.comments.moreActions": "Thêm hành động",
+ "acceptance.comments.participants": "Người tham gia",
+ "acceptance.comments.placeholder": "Nói gì đó về giao hàng này…",
+ "acceptance.comments.readOnly": "Bạn có thể đọc thảo luận; tham gia không gian làm việc để tham gia.",
+ "acceptance.comments.region": "Khu vực",
+ "acceptance.comments.regionCount": "{{count}} ghi chú khu vực",
+ "acceptance.comments.regionHint": "Kéo một hộp trên hình ảnh, sau đó viết ghi chú của bạn.",
+ "acceptance.comments.regionMissing": "Hãy khoanh vùng trước.",
+ "acceptance.comments.regionModalTitle": "Khoanh vùng bạn muốn nói đến",
+ "acceptance.comments.reopen": "Mở lại",
+ "acceptance.comments.reply": "Trả lời",
+ "acceptance.comments.replyPlaceholder": "Trả lời…",
+ "acceptance.comments.resolve": "Đánh dấu đã giải quyết",
+ "acceptance.comments.resolvedSummary": "Đã giải quyết · {{name}} · {{count}} tin nhắn",
+ "acceptance.comments.roundCompletedBy": "{{name}} đã hoàn thành vòng {{round}}",
+ "acceptance.comments.roundContext": "Vòng {{round}}",
+ "acceptance.comments.roundLanded": "Vòng {{round}} đã kết thúc",
+ "acceptance.comments.send": "Gửi",
+ "acceptance.comments.title": "Thảo luận",
+ "acceptance.comments.updateFailed": "Không thể cập nhật bình luận. Vui lòng thử lại.",
+ "acceptance.comments.withdraw": "Rút lại phê duyệt",
+ "acceptance.comments.withdrawDescription": "Bạn có thể rút lại hoặc phê duyệt lại bất cứ lúc nào khi vòng còn mở — chỉ trạng thái cuối cùng khi chủ sở hữu quyết định mới được tính.",
+ "acceptance.comments.youApproved": "Bạn đã phê duyệt vòng {{round}}",
+ "acceptance.comments.youApprovedNoRound": "Bạn đã phê duyệt giao hàng này",
"acceptance.detail.suggestion": "Gợi ý",
"acceptance.error.description": "Kiểm tra kết nối của bạn và thử tải lại trạng thái chấp nhận này.",
"acceptance.error.title": "Không thể tải trạng thái chấp nhận",
diff --git a/locales/zh-TW/verify.json b/locales/zh-TW/verify.json
index 1a3ca4cc292..649b3f1b456 100644
--- a/locales/zh-TW/verify.json
+++ b/locales/zh-TW/verify.json
@@ -79,6 +79,58 @@
"acceptance.checks.rerunHint": "相同的檢查在 {{count}} 回合中運行;最後一回合為準。",
"acceptance.checks.title": "接受檢查",
"acceptance.checks.viewTrace": "查看驗證執行",
+ "acceptance.comments.addReaction": "新增反應",
+ "acceptance.comments.approvalCount": "{{count}} 位審核者已批准",
+ "acceptance.comments.approve": "批准此交付",
+ "acceptance.comments.approveAgain": "再次批准此輪",
+ "acceptance.comments.approveDescription": "您的審核意見。這不會改變接受狀態——只有擁有者才能接受交付。",
+ "acceptance.comments.approveSummaryPlaceholder": "一行摘要(可選)",
+ "acceptance.comments.approved": "已批准",
+ "acceptance.comments.approvedAtRound": "已批准(第 {{round}} 輪)",
+ "acceptance.comments.approvedBy": "{{name}} 批准了此交付",
+ "acceptance.comments.approvedByAtRound": "{{name}} 批准了第 {{round}} 輪",
+ "acceptance.comments.author.agent": "代理",
+ "acceptance.comments.author.deactivated": "已停用",
+ "acceptance.comments.author.former": "前成員",
+ "acceptance.comments.collapseThread": "收起",
+ "acceptance.comments.commentEvidence": "對區域發表評論",
+ "acceptance.comments.commented": "{{time}} 發表了評論",
+ "acceptance.comments.copyLink": "複製連結",
+ "acceptance.comments.createFailed": "發表評論失敗。請再試一次。",
+ "acceptance.comments.delete": "刪除",
+ "acceptance.comments.deleteConfirm": "確定要刪除此評論?",
+ "acceptance.comments.deleteFailed": "刪除評論失敗。請再試一次。",
+ "acceptance.comments.deleted": "此評論已被刪除",
+ "acceptance.comments.empty": "尚無討論。",
+ "acceptance.comments.evidenceFromRound": "來自第 {{round}} 輪的證據——在後續輪次中被替換",
+ "acceptance.comments.evidenceThisRound": "此檢查現在顯示的證據",
+ "acceptance.comments.historicalRegions": "後續輪次替換的證據中有 {{count}} 個區域註記",
+ "acceptance.comments.linkCopied": "連結已複製",
+ "acceptance.comments.loadFailed": "加載討論失敗。請刷新。",
+ "acceptance.comments.moreActions": "更多操作",
+ "acceptance.comments.participants": "參與者",
+ "acceptance.comments.placeholder": "對此交付發表意見…",
+ "acceptance.comments.readOnly": "您可以閱讀討論;加入工作區以參與。",
+ "acceptance.comments.region": "區域",
+ "acceptance.comments.regionCount": "{{count}} 個區域註記",
+ "acceptance.comments.regionHint": "在圖片上拖動框,然後撰寫您的註記。",
+ "acceptance.comments.regionMissing": "請先圈選一個區域。",
+ "acceptance.comments.regionModalTitle": "圈選您指的地方",
+ "acceptance.comments.reopen": "重新開啟",
+ "acceptance.comments.reply": "回覆",
+ "acceptance.comments.replyPlaceholder": "回覆…",
+ "acceptance.comments.resolve": "標記為已解決",
+ "acceptance.comments.resolvedSummary": "已解決 · {{name}} · {{count}} 則訊息",
+ "acceptance.comments.roundCompletedBy": "{{name}} 完成了第 {{round}} 輪",
+ "acceptance.comments.roundContext": "第 {{round}} 輪",
+ "acceptance.comments.roundLanded": "第 {{round}} 輪已落地",
+ "acceptance.comments.send": "發送",
+ "acceptance.comments.title": "討論",
+ "acceptance.comments.updateFailed": "更新評論失敗。請再試一次。",
+ "acceptance.comments.withdraw": "撤回批准",
+ "acceptance.comments.withdrawDescription": "您可以在輪次開放期間隨時撤回或重新給予批准——只有擁有者決定時的狀態才算數。",
+ "acceptance.comments.youApproved": "您批准了第 {{round}} 輪",
+ "acceptance.comments.youApprovedNoRound": "您批准了此交付",
"acceptance.detail.suggestion": "建議",
"acceptance.error.description": "檢查您的連接並重試加載此接受。",
"acceptance.error.title": "無法加載接受",
diff --git a/packages/builtin-skills/src/lobehub/references/bot-feishu.ts b/packages/builtin-skills/src/lobehub/references/bot-feishu.ts
index 52605a41abf..af6c0af0fec 100644
--- a/packages/builtin-skills/src/lobehub/references/bot-feishu.ts
+++ b/packages/builtin-skills/src/lobehub/references/bot-feishu.ts
@@ -74,6 +74,8 @@ Connect a Feishu custom app bot to your agent.
- \`im:message.group_at_msg\` — receive @bot messages in groups (if needed)
- \`im:message:readonly\` — read chat history (needed for \`readMessages\`)
- \`im:message.group_msg\` — 「获取群组中所有消息」, read **group** chat history; required *in addition to* \`im:message:readonly\`, otherwise history reads in groups fail with \`230027 权限不足\`. Search 权限管理 by the Chinese name — the console does not match on the code. It is 免审, but the app must be re-published (创建版本 → 发布) before it takes effect. Do NOT confuse it with \`im:message.group_msg.include_bot:read\`(获取群组中用户和机器人发送的消息), which governs the receive-message event, not history reads
+ - \`docx:document:readonly\` — 「查看新版文档」, lets \`readDocument\` pull the text of docx documents (智能纪要 / meeting minutes, specs) shared into the chat. The document must ALSO be visible to the app: sharing it into a group the bot is in is not enough — the owner adds the app as a collaborator (文档「分享」→ 添加协作者 → 搜索应用名), or the knowledge space grants the app access
+ - \`wiki:wiki:readonly\` — only if users share \`/wiki/\` links; resolves a wiki page to the docx behind it
3. Publish the app (see Step 7) for permissions to take effect
### Step 7: Publish the App
diff --git a/packages/builtin-skills/src/lobehub/references/bot-lark.ts b/packages/builtin-skills/src/lobehub/references/bot-lark.ts
index 248c035c449..329cde20edc 100644
--- a/packages/builtin-skills/src/lobehub/references/bot-lark.ts
+++ b/packages/builtin-skills/src/lobehub/references/bot-lark.ts
@@ -73,6 +73,8 @@ Connect a Lark custom app bot to your agent. Lark is the international version o
- \`im:message.group_at_msg:readonly\` — receive @bot mentions in groups (if needed)
- \`im:message:readonly\` — read chat history (needed for \`readMessages\`)
- \`im:message.group_msg\` — "获取群组中所有消息", read **group** chat history; required *in addition to* \`im:message:readonly\`, otherwise history reads in groups fail with \`230027 Permission denied\`. Search Permissions & Scopes by that display name — the console does not match on the code. No review is required, but the app must be re-published for it to take effect. Do NOT confuse it with \`im:message.group_msg.include_bot:read\`, which governs the receive-message event, not history reads
+ - \`docx:document:readonly\` — "View new docs", lets \`readDocument\` pull the text of docx documents (meeting minutes, specs) shared into the chat. The document must ALSO be visible to the app: sharing it into a group the bot is in is not enough — the owner adds the app as a collaborator (Share → add collaborator → search the app name), or the wiki space grants the app access
+ - \`wiki:wiki:readonly\` — only if users share \`/wiki/\` links; resolves a wiki page to the docx behind it
### Step 7: Publish the App
diff --git a/packages/builtin-tool-message/src/ExecutionRuntime/index.ts b/packages/builtin-tool-message/src/ExecutionRuntime/index.ts
index a87e92b257b..5e65db5f342 100644
--- a/packages/builtin-tool-message/src/ExecutionRuntime/index.ts
+++ b/packages/builtin-tool-message/src/ExecutionRuntime/index.ts
@@ -53,6 +53,8 @@ import type {
PlatformInfo,
ReactToMessageParams,
ReactToMessageState,
+ ReadDocumentParams,
+ ReadDocumentState,
ReadMessagesParams,
ReadMessagesState,
ReplyToThreadParams,
@@ -133,6 +135,8 @@ export type {
PlatformInfo,
ReactToMessageParams,
ReactToMessageState,
+ ReadDocumentParams,
+ ReadDocumentState,
ReadMessagesParams,
ReadMessagesState,
ReplyToThreadParams,
@@ -179,6 +183,12 @@ export interface MessageRuntimeService {
listThreads: (params: ListThreadsParams) => Promise<ListThreadsState>;
pinMessage: (params: PinMessageParams) => Promise<PinMessageState>;
reactToMessage: (params: ReactToMessageParams) => Promise<ReactToMessageState>;
+ /**
+ * Read a cloud document linked from the chat. Optional: only platforms
+ * with a document API (Feishu/Lark docx) implement it; the runtime reports
+ * "not supported" elsewhere and `messageCapabilities` trims the tool.
+ */
+ readDocument?: (params: ReadDocumentParams) => Promise<ReadDocumentState>;
readMessages: (params: ReadMessagesParams) => Promise<ReadMessagesState>;
replyToThread: (params: ReplyToThreadParams) => Promise<ReplyToThreadState>;
searchMessages: (params: SearchMessagesParams) => Promise<SearchMessagesState>;
@@ -296,6 +306,46 @@ export class MessageExecutionRuntime {
}
}
+ async readDocument(params: ReadDocumentParams): Promise<BuiltinServerRuntimeOutput> {
+ if (!this.service.readDocument) {
+ return {
+ content: `readDocument is not supported on ${params.platform}`,
+ success: false,
+ };
+ }
+ if (!params.url && !params.documentId) {
+ return {
+ content: 'readDocument error: pass the document `url` (preferred) or its `documentId`',
+ success: false,
+ };
+ }
+ try {
+ const result = await this.service.readDocument(params);
+ const header = [
+ `Document${result.title ? `: ${result.title}` : ''}`,
+ result.url ? `URL: ${result.url}` : undefined,
+ result.documentId
+ ? `ID: ${result.documentId}${result.kind ? ` (${result.kind})` : ''}`
+ : undefined,
+ ]
+ .filter(Boolean)
+ .join('\n');
+ const truncatedHint = result.truncated
+ ? '\n\n[Content truncated — the document is longer than what fits here]'
+ : '';
+ return {
+ content: `${header}\n\n${result.content?.trim() || '(empty document)'}${truncatedHint}`,
+ state: result,
+ success: true,
+ };
+ } catch (e) {
+ return {
+ content: `readDocument error: ${(e as Error).message}`,
+ success: false,
+ };
+ }
+ }
+
async editMessage(params: EditMessageParams): Promise<BuiltinServerRuntimeOutput> {
try {
const result = await this.service.editMessage(params);
diff --git a/packages/builtin-tool-message/src/client/Inspector/index.ts b/packages/builtin-tool-message/src/client/Inspector/index.ts
index 386c3e0ec63..ba6771762b7 100644
--- a/packages/builtin-tool-message/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-message/src/client/Inspector/index.ts
@@ -4,4 +4,5 @@ import { MessageApiName } from '../../types';
export const MessageInspectors: Record<string, any> = {
[MessageApiName.sendMessage]: undefined,
[MessageApiName.readMessages]: undefined,
+ [MessageApiName.readDocument]: undefined,
};
diff --git a/packages/builtin-tool-message/src/client/Render/index.ts b/packages/builtin-tool-message/src/client/Render/index.ts
index edd29610396..24e3fff9bb4 100644
--- a/packages/builtin-tool-message/src/client/Render/index.ts
+++ b/packages/builtin-tool-message/src/client/Render/index.ts
@@ -3,5 +3,6 @@ import { MessageApiName } from '../../types';
// Placeholder renders — add custom render components per API as needed
export const MessageRenders: Record<string, any> = {
[MessageApiName.readMessages]: undefined,
+ [MessageApiName.readDocument]: undefined,
[MessageApiName.searchMessages]: undefined,
};
diff --git a/packages/builtin-tool-message/src/executor/index.ts b/packages/builtin-tool-message/src/executor/index.ts
index 2f9866ba63b..92a582da8eb 100644
--- a/packages/builtin-tool-message/src/executor/index.ts
+++ b/packages/builtin-tool-message/src/executor/index.ts
@@ -25,6 +25,7 @@ import type {
ListThreadsParams,
PinMessageParams,
ReactToMessageParams,
+ ReadDocumentParams,
ReadMessagesParams,
ReplyToThreadParams,
SearchMessagesParams,
@@ -67,6 +68,13 @@ class MessageExecutor extends BaseExecutor<typeof MessageApiName> {
return this.runtime.readMessages(params);
};
+ readDocument = async (
+ params: ReadDocumentParams,
+ _ctx?: BuiltinToolContext,
+ ): Promise<BuiltinToolResult> => {
+ return this.runtime.readDocument(params);
+ };
+
editMessage = async (
params: EditMessageParams,
_ctx?: BuiltinToolContext,
diff --git a/packages/builtin-tool-message/src/manifest.ts b/packages/builtin-tool-message/src/manifest.ts
index 6ca50d31414..c1e88f41a7d 100644
--- a/packages/builtin-tool-message/src/manifest.ts
+++ b/packages/builtin-tool-message/src/manifest.ts
@@ -286,6 +286,33 @@ export const MessageManifest: BuiltinToolManifest = {
type: 'object',
},
},
+ {
+ description:
+ 'Read the full text of a cloud document shared in the chat (Feishu/Lark docx, wiki pages, meeting minutes / 智能纪要 documents). Pass the document URL exactly as it appears in the message. Use this IMMEDIATELY whenever the user points at a document link ("看这份纪要", "总结这个文档") or a message you read contains one — never ask the user to paste the content.',
+ name: MessageApiName.readDocument,
+ parameters: {
+ additionalProperties: false,
+ properties: {
+ documentId: {
+ description:
+ 'Platform document ID / token, only when you have it without a URL. Prefer `url`.',
+ type: 'string',
+ },
+ platform: {
+ description: 'Target messaging platform',
+ enum: platformEnum,
+ type: 'string',
+ },
+ url: {
+ description:
+ 'Document URL as it appeared in the chat, e.g. https://<tenant>.feishu.cn/docx/<token> or a /wiki/ link.',
+ type: 'string',
+ },
+ },
+ required: ['platform'],
+ type: 'object',
+ },
+ },
{
description: 'Edit an existing message. Only the message author can edit their messages.',
name: MessageApiName.editMessage,
diff --git a/packages/builtin-tool-message/src/systemRole.ts b/packages/builtin-tool-message/src/systemRole.ts
index 8365368a47a..8d40830b5f5 100644
--- a/packages/builtin-tool-message/src/systemRole.ts
+++ b/packages/builtin-tool-message/src/systemRole.ts
@@ -134,6 +134,7 @@ Skipping step 1 will silently wipe other entries.
1. **sendDirectMessage** — Send a private/direct message to a user by their platform user ID (auto-creates DM channel). Supports **\`attachments\`** for outbound media (see \`<attachments>\`).
2. **sendMessage** — Send a message to a channel or conversation. Supports **\`attachments\`** for outbound media.
3. **readMessages** — Read recent messages from a channel (supports pagination via before/after)
+ - **readDocument** — Read the full text of a cloud document linked in the chat (Feishu/Lark docx / wiki / 智能纪要). Available only on platforms with a document API; pass the URL from the message.
4. **editMessage** — Edit an existing message (author only)
5. **deleteMessage** — Delete a message (requires permissions)
6. **searchMessages** — Search messages by query, optionally filter by author
@@ -207,6 +208,7 @@ For platforms with degradation rules, prefer URL-sourced \`image\` attachments w
- No pins, channel listing, or polls
- Uses appId and appSecret for authentication
- \`readMessages\`: use \`startTime\`/\`endTime\` (Unix second timestamps) instead of \`before\`/\`after\` (message IDs). Use \`cursor\` from the response's \`nextCursor\` to paginate through pages.
+- Documents (智能纪要 / meeting minutes, docx, wiki pages) are shared as LINKS, not text: a message like "帮我看这份纪要" plus a \`https://<tenant>.feishu.cn/docx/<token>\` URL contains no body. Call \`readDocument\` with that URL right away (also for links found via \`readMessages\`), then answer from the returned text. Never reply with only the link or ask the user to paste the content. If it fails with a permission error, relay the returned hint (the app must be able to see the document) instead of guessing.
**QQ:**
- Supports sending messages to groups, guild channels, and direct messages
diff --git a/packages/builtin-tool-message/src/types.ts b/packages/builtin-tool-message/src/types.ts
index 5a70d407d91..d380ed052e7 100644
--- a/packages/builtin-tool-message/src/types.ts
+++ b/packages/builtin-tool-message/src/types.ts
@@ -27,6 +27,7 @@ export const MessageApiName = {
listPins: 'listPins',
pinMessage: 'pinMessage',
reactToMessage: 'reactToMessage',
+ readDocument: 'readDocument',
readMessages: 'readMessages',
searchMessages: 'searchMessages',
sendMessage: 'sendMessage',
@@ -202,6 +203,35 @@ export interface MessageItem {
timestamp: string;
}
+// --- Documents ---
+
+export interface ReadDocumentParams {
+ /**
+ * Platform document ID, for callers that already hold one (e.g. a Feishu
+ * docx token). Either this or `url` is required; `url` wins when both given.
+ */
+ documentId?: string;
+ /** Platform to read from */
+ platform: MessagePlatformType;
+ /** Document URL as it appeared in the chat (e.g. `https://x.feishu.cn/docx/<token>`) */
+ url?: string;
+}
+
+export interface ReadDocumentState {
+ /** Plain-text body of the document */
+ content?: string;
+ /** Resolved document ID on the platform */
+ documentId?: string;
+ /** Document kind on the platform (e.g. `docx`, `wiki`) */
+ kind?: string;
+ platform?: string;
+ title?: string;
+ /** True when the body was cut to fit the tool result */
+ truncated?: boolean;
+ /** Canonical URL of the document, when known */
+ url?: string;
+}
+
export interface EditMessageParams {
/** Channel ID where the message is */
channelId: string;
diff --git a/packages/chat-adapter-feishu/src/adapter.test.ts b/packages/chat-adapter-feishu/src/adapter.test.ts
index d1060b71ab8..cfc6545676e 100644
--- a/packages/chat-adapter-feishu/src/adapter.test.ts
+++ b/packages/chat-adapter-feishu/src/adapter.test.ts
@@ -222,6 +222,129 @@ describe('LarkAdapter', () => {
expect(mockChat.processMessage).not.toHaveBeenCalled();
});
+ it('should process a post (rich text) message carrying a document link', async () => {
+ // A user @mentioning the bot and pasting a docx link produces a `post`
+ // body — before flattening, it had no `text` field and was dropped.
+ const msg = makeLarkMessage({
+ content: JSON.stringify({
+ content: [
+ [
+ { tag: 'at', user_id: 'ou_bot', user_name: 'Bot' },
+ { tag: 'text', text: ' 看下 ' },
+ { href: 'https://x.feishu.cn/docx/AAA', tag: 'a', text: '纪要' },
+ ],
+ ],
+ title: '',
+ }),
+ message_type: 'post',
+ });
+ const res = await adapter.handleWebhook(makeRequest(makeWebhookPayload(msg)));
+
+ expect(res.status).toBe(200);
+ expect(mockChat.processMessage).toHaveBeenCalledTimes(1);
+ const message = await mockChat.processMessage.mock.calls[0][2]();
+ expect(message.text).toBe('@Bot 看下 纪要 (https://x.feishu.cn/docx/AAA)');
+ });
+
+ it('should process an @bot + text + image post with persistent attachment metadata', async () => {
+ (adapter as any)._botUserId = 'ou_bot';
+ const msg = makeLarkMessage({
+ content: JSON.stringify({
+ content: [
+ [
+ { tag: 'at', user_id: 'ou_bot', user_name: 'TestBot' },
+ { tag: 'text', text: ' 看这张图' },
+ { tag: 'img', image_key: 'img_inline' },
+ ],
+ ],
+ }),
+ mentions: [{ id: { open_id: 'ou_bot' }, key: '@_user_1', name: 'TestBot' }],
+ message_type: 'post',
+ });
+
+ const res = await adapter.handleWebhook(makeRequest(makeWebhookPayload(msg)));
+
+ expect(res.status).toBe(200);
+ expect(mockChat.processMessage).toHaveBeenCalledTimes(1);
+ const message = await mockChat.processMessage.mock.calls[0][2]();
+ expect(message.text).toBe('@TestBot 看这张图[image]');
+ expect(message.isMention).toBe(true);
+ expect(message.attachments).toEqual([
+ {
+ fetchMetadata: { imageKey: 'img_inline' },
+ mimeType: 'image/jpeg',
+ name: 'image-1.jpg',
+ type: 'image',
+ },
+ ]);
+ expect(message.toJSON().attachments).toEqual(message.attachments);
+ });
+
+ it('should process an image-only content_v2 post', async () => {
+ const msg = makeLarkMessage({
+ content: JSON.stringify({ content_v2: [[{ tag: 'img', image_key: 'img_only' }]] }),
+ message_type: 'post',
+ });
+
+ await adapter.handleWebhook(makeRequest(makeWebhookPayload(msg)));
+
+ expect(mockChat.processMessage).toHaveBeenCalledTimes(1);
+ const message = await mockChat.processMessage.mock.calls[0][2]();
+ expect(message.attachments).toHaveLength(1);
+ });
+
+ it.each([true, false])(
+ 'preserves card button links with visible text: %s',
+ async (withText) => {
+ const url = 'https://x.feishu.cn/docx/CardTok';
+ const msg = makeLarkMessage({
+ content: JSON.stringify({
+ elements: [
+ {
+ tag: 'button',
+ ...(withText ? { text: { content: 'Read notes', tag: 'plain_text' } } : {}),
+ url,
+ },
+ ],
+ }),
+ message_type: 'interactive',
+ });
+ const expected = `${withText ? 'Read notes\n' : ''}[links: ${url}]`;
+
+ expect(adapter.parseMessage(msg).text).toBe(expected);
+ const response = await adapter.handleWebhook(makeRequest(makeWebhookPayload(msg)));
+
+ expect(response.status).toBe(200);
+ expect(mockChat.processMessage).toHaveBeenCalledTimes(1);
+ const message = await mockChat.processMessage.mock.calls[0][2]();
+ expect(message.text).toBe(expected);
+ },
+ );
+
+ it('should process an interactive card that carries text', async () => {
+ const msg = makeLarkMessage({
+ content: JSON.stringify({
+ elements: [{ tag: 'div', text: { content: '会议纪要已生成', tag: 'lark_md' } }],
+ }),
+ message_type: 'interactive',
+ });
+ const res = await adapter.handleWebhook(makeRequest(makeWebhookPayload(msg)));
+
+ expect(res.status).toBe(200);
+ expect(mockChat.processMessage).toHaveBeenCalledTimes(1);
+ });
+
+ it('should still skip unknown message types with no text at all', async () => {
+ const msg = makeLarkMessage({
+ content: JSON.stringify({ chat_id: 'oc_other' }),
+ message_type: 'share_chat',
+ });
+ const res = await adapter.handleWebhook(makeRequest(makeWebhookPayload(msg)));
+
+ expect(res.status).toBe(200);
+ expect(mockChat.processMessage).not.toHaveBeenCalled();
+ });
+
it('should process image message', async () => {
const msg = makeLarkMessage({
content: JSON.stringify({ image_key: 'img_test_key' }),
@@ -497,6 +620,19 @@ describe('LarkAdapter', () => {
expect(message.text).toBe('hello');
});
+ it('should flatten a post body into text with its links', () => {
+ const raw = makeLarkMessage({
+ content: JSON.stringify({
+ content: [[{ href: 'https://x.feishu.cn/docx/AAA', tag: 'a', text: '纪要' }]],
+ title: '智能纪要',
+ }),
+ message_type: 'post',
+ });
+ const message = adapter.parseMessage(raw);
+ expect(message.text).toBe('智能纪要\n纪要 (https://x.feishu.cn/docx/AAA)');
+ expect(message.attachments).toEqual([]);
+ });
+
it('should create metadata-only attachment for image message', () => {
const raw = makeLarkMessage({
content: JSON.stringify({ image_key: 'img_lazy' }),
@@ -679,10 +815,33 @@ describe('extractMediaMetadata', () => {
expect(extractMediaMetadata(makeLarkMessage())).toEqual([]);
});
- it('returns empty array for post messages', () => {
+ it('returns metadata-only attachments for every post image in rich-text order', () => {
expect(
- extractMediaMetadata(makeLarkMessage({ message_type: 'post', content: JSON.stringify({}) })),
- ).toEqual([]);
+ extractMediaMetadata(
+ makeLarkMessage({
+ message_type: 'post',
+ content: JSON.stringify({
+ content_v2: [
+ [{ tag: 'img', image_key: 'img_1' }],
+ [{ tag: 'md', text: '![second](img_2) ![public](https://example.com/a.png)' }],
+ ],
+ }),
+ }),
+ ),
+ ).toEqual([
+ {
+ fetchMetadata: { imageKey: 'img_1' },
+ mimeType: 'image/jpeg',
+ name: 'image-1.jpg',
+ type: 'image',
+ },
+ {
+ fetchMetadata: { imageKey: 'img_2' },
+ mimeType: 'image/jpeg',
+ name: 'image-2.jpg',
+ type: 'image',
+ },
+ ]);
});
it('returns empty array for malformed content JSON', () => {
@@ -923,6 +1082,49 @@ describe('downloadMediaFromRawMessage', () => {
expect(warn).toHaveBeenCalled();
});
+
+ it('downloads post images in order and keeps later images when one item fails', async () => {
+ const secondBytes = Buffer.from('second');
+ const thirdBytes = Buffer.from('third');
+ downloadSpy
+ .mockRejectedValueOnce(new Error('first failed'))
+ .mockResolvedValueOnce(secondBytes)
+ .mockResolvedValueOnce(thirdBytes);
+ const warn = vi.fn();
+
+ const result = await downloadMediaFromRawMessage(
+ api,
+ makeLarkMessage({
+ content: JSON.stringify({
+ content_v2: [
+ [
+ { tag: 'img', image_key: 'img_1' },
+ { tag: 'md', text: '![second](img_2)' },
+ ],
+ [{ tag: 'img', image_key: 'img_3' }],
+ ],
+ }),
+ message_type: 'post',
+ }),
+ { warn },
+ );
+
+ expect(downloadSpy.mock.calls).toEqual([
+ ['om_test_msg_001', 'img_1', 'image'],
+ ['om_test_msg_001', 'img_2', 'image'],
+ ['om_test_msg_001', 'img_3', 'image'],
+ ]);
+ expect(result).toEqual([
+ { buffer: secondBytes, mimeType: 'image/jpeg', name: 'image-2.jpg', type: 'image' },
+ { buffer: thirdBytes, mimeType: 'image/jpeg', name: 'image-3.jpg', type: 'image' },
+ ]);
+ expect(warn).toHaveBeenCalledWith(
+ 'Failed to download post image %s for message %s: %s',
+ 'img_1',
+ 'om_test_msg_001',
+ expect.any(Error),
+ );
+ });
});
describe('LarkAdapter.fetchMessages', () => {
diff --git a/packages/chat-adapter-feishu/src/adapter.ts b/packages/chat-adapter-feishu/src/adapter.ts
index cf659cf581b..5d9ae028e9e 100644
--- a/packages/chat-adapter-feishu/src/adapter.ts
+++ b/packages/chat-adapter-feishu/src/adapter.ts
@@ -17,6 +17,7 @@ import { Message, parseMarkdown } from 'chat';
import { LarkApiClient } from './api';
import { decryptLarkEvent } from './crypto';
+import { flattenLarkMessageContent } from './docLinks';
import { LarkFormatConverter } from './format-converter';
import { toFeishuEmojiType } from './reactionEmoji';
import type {
@@ -29,6 +30,13 @@ import type {
type WarnFn = (message: string, ...args: unknown[]) => void;
+/**
+ * Message types whose body is a media key rather than text. They go through
+ * the attachment pipeline (`extractMediaMetadata` / `downloadMediaFromRawMessage`)
+ * and carry no inline text worth parsing.
+ */
+const MEDIA_MESSAGE_TYPES = new Set(['image', 'file', 'audio', 'media', 'sticker']);
+
/**
* Encode a Lark/Feishu thread ID with optional inline chat type.
*
@@ -113,7 +121,19 @@ export function decodeLarkThreadId(
*/
export function extractMediaMetadata(raw: LarkRawMessage): Attachment[] {
const messageType = raw.message_type;
- if (messageType === 'text' || messageType === 'post') return [];
+ if (messageType === 'text') return [];
+
+ if (messageType === 'post') {
+ return flattenLarkMessageContent(messageType, raw.content).imageKeys.map(
+ (imageKey, index) =>
+ ({
+ fetchMetadata: { imageKey },
+ mimeType: 'image/jpeg',
+ name: `image-${index + 1}.jpg`,
+ type: 'image',
+ }) as Attachment,
+ );
+ }
let content: Record<string, string>;
try {
@@ -174,7 +194,33 @@ export async function downloadMediaFromRawMessage(
const warn: WarnFn = logger?.warn?.bind(logger) ?? (() => {});
const messageType = raw.message_type;
- if (messageType === 'text' || messageType === 'post') return [];
+ if (messageType === 'text') return [];
+
+ if (messageType === 'post') {
+ const { imageKeys } = flattenLarkMessageContent(messageType, raw.content);
+ const attachments: Attachment[] = [];
+
+ for (const [index, imageKey] of imageKeys.entries()) {
+ try {
+ const buffer = await api.downloadResource(raw.message_id, imageKey, 'image');
+ attachments.push({
+ buffer,
+ mimeType: 'image/jpeg',
+ name: `image-${index + 1}.jpg`,
+ type: 'image',
+ } as Attachment);
+ } catch (error) {
+ warn(
+ 'Failed to download post image %s for message %s: %s',
+ imageKey,
+ raw.message_id,
+ error,
+ );
+ }
+ }
+
+ return attachments;
+ }
let content: Record<string, string>;
try {
@@ -395,30 +441,17 @@ export class LarkAdapter implements Adapter<LarkThreadId, LarkRawMessage> {
this.p2pChatIds.add(message.chat_id);
}
- // Extract text content (for text messages) or media description
+ // Extract text content or a media marker. `text` is the only body that
+ // is a plain string; rich text (`post`), cards (`interactive`) and shares
+ // are flattened so a document link pasted with an @mention still reaches
+ // the bot instead of being dropped as "empty".
const messageType = message.message_type;
- let messageText = '';
- let hasMedia = false;
-
- try {
- const content = JSON.parse(message.content);
- switch (messageType) {
- case 'text': {
- messageText = content.text || '';
- break;
- }
- case 'image':
- case 'file':
- case 'audio':
- case 'media':
- case 'sticker': {
- hasMedia = true;
- break;
- }
- }
- } catch {
- // malformed content
- }
+ const hasStandaloneMedia = MEDIA_MESSAGE_TYPES.has(messageType);
+ const flattened = hasStandaloneMedia
+ ? undefined
+ : flattenLarkMessageContent(messageType, message.content);
+ const hasMedia = hasStandaloneMedia || Boolean(flattened?.imageKeys.length);
+ const messageText = flattened?.text ?? '';
if (!messageText.trim() && !hasMedia) {
return Response.json({ ok: true });
@@ -537,13 +570,9 @@ export class LarkAdapter implements Adapter<LarkThreadId, LarkRawMessage> {
// ------------------------------------------------------------------
parseMessage(raw: LarkRawMessage): Message<LarkRawMessage> {
- let text = '';
- try {
- const content = JSON.parse(raw.content);
- text = content.text || '';
- } catch {
- // malformed
- }
+ const text = MEDIA_MESSAGE_TYPES.has(raw.message_type)
+ ? ''
+ : flattenLarkMessageContent(raw.message_type, raw.content).text;
// Strip @mention markers
const cleanText = text
diff --git a/packages/chat-adapter-feishu/src/api.test.ts b/packages/chat-adapter-feishu/src/api.test.ts
new file mode 100644
index 00000000000..4a989191f4b
--- /dev/null
+++ b/packages/chat-adapter-feishu/src/api.test.ts
@@ -0,0 +1,119 @@
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+
+import { LarkApiClient } from './api';
+
+const jsonResponse = (body: unknown, status = 200) =>
+ new Response(JSON.stringify(body), {
+ headers: { 'Content-Type': 'application/json' },
+ status,
+ });
+
+const tokenResponse = () =>
+ jsonResponse({ code: 0, expire: 7200, msg: 'ok', tenant_access_token: 't-abc' });
+
+describe('LarkApiClient cloud documents', () => {
+ let fetchMock: ReturnType<typeof vi.fn>;
+
+ beforeEach(() => {
+ fetchMock = vi.fn();
+ vi.stubGlobal('fetch', fetchMock);
+ });
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ vi.unstubAllEnvs();
+ });
+
+ it('getDocxRawContent hits the raw_content endpoint with the tenant token', async () => {
+ fetchMock
+ .mockResolvedValueOnce(tokenResponse())
+ .mockResolvedValueOnce(jsonResponse({ code: 0, data: { content: '标题\n正文' }, msg: 'ok' }));
+
+ const api = new LarkApiClient('cli_app', 'secret', 'feishu');
+ await expect(api.getDocxRawContent('doxcnABC')).resolves.toBe('标题\n正文');
+
+ const [url, init] = fetchMock.mock.calls[1];
+ expect(url).toBe('https://open.feishu.cn/open-apis/docx/v1/documents/doxcnABC/raw_content');
+ expect(init.method).toBe('GET');
+ expect(init.headers.Authorization).toBe('Bearer t-abc');
+ });
+
+ it('getDocxDocument returns title and revision', async () => {
+ fetchMock.mockResolvedValueOnce(tokenResponse()).mockResolvedValueOnce(
+ jsonResponse({
+ code: 0,
+ data: { document: { document_id: 'doxcnABC', revision_id: 12, title: '评审会纪要' } },
+ msg: 'ok',
+ }),
+ );
+
+ const api = new LarkApiClient('cli_app', 'secret', 'lark');
+ await expect(api.getDocxDocument('doxcnABC')).resolves.toEqual({
+ documentId: 'doxcnABC',
+ revisionId: 12,
+ title: '评审会纪要',
+ });
+ expect(fetchMock.mock.calls[1][0]).toBe(
+ 'https://open.larksuite.com/open-apis/docx/v1/documents/doxcnABC',
+ );
+ });
+
+ it('getWikiNode resolves the wrapped object token', async () => {
+ fetchMock.mockResolvedValueOnce(tokenResponse()).mockResolvedValueOnce(
+ jsonResponse({
+ code: 0,
+ data: {
+ node: { node_token: 'wikcnX', obj_token: 'doxcnY', obj_type: 'docx', title: 'Wiki 页' },
+ },
+ msg: 'ok',
+ }),
+ );
+
+ const api = new LarkApiClient('cli_app', 'secret', 'feishu');
+ await expect(api.getWikiNode('wikcnX')).resolves.toEqual({
+ nodeToken: 'wikcnX',
+ objToken: 'doxcnY',
+ objType: 'docx',
+ title: 'Wiki 页',
+ });
+ expect(fetchMock.mock.calls[1][0]).toBe(
+ 'https://open.feishu.cn/open-apis/wiki/v2/spaces/get_node?token=wikcnX',
+ );
+ });
+
+ it('honours LARK_API_BASE_URL for every call, auth included', async () => {
+ vi.stubEnv('LARK_API_BASE_URL', 'http://127.0.0.1:4190/open-apis/');
+ fetchMock
+ .mockResolvedValueOnce(tokenResponse())
+ .mockResolvedValueOnce(jsonResponse({ code: 0, data: { content: 'x' }, msg: 'ok' }));
+
+ const api = new LarkApiClient('cli_app', 'secret', 'feishu');
+ await api.getDocxRawContent('doxcnABC');
+
+ expect(fetchMock.mock.calls[0][0]).toBe(
+ 'http://127.0.0.1:4190/open-apis/auth/v3/tenant_access_token/internal',
+ );
+ expect(fetchMock.mock.calls[1][0]).toBe(
+ 'http://127.0.0.1:4190/open-apis/docx/v1/documents/doxcnABC/raw_content',
+ );
+ });
+
+ it('surfaces the Feishu error code and permission violation on failure', async () => {
+ fetchMock.mockResolvedValueOnce(tokenResponse()).mockResolvedValueOnce(
+ jsonResponse({
+ code: 1770032,
+ error: {
+ permission_violations: [
+ { description: '查看新版文档', subject: 'docx:document:readonly', type: 'scope' },
+ ],
+ },
+ msg: 'forbidden',
+ }),
+ );
+
+ const api = new LarkApiClient('cli_app', 'secret', 'feishu');
+ await expect(api.getDocxRawContent('doxcnABC')).rejects.toThrow(
+ /1770032 forbidden \(missing permission — docx:document:readonly: 查看新版文档\)/,
+ );
+ });
+});
diff --git a/packages/chat-adapter-feishu/src/api.ts b/packages/chat-adapter-feishu/src/api.ts
index 9058f27dc14..1862b51a42c 100644
--- a/packages/chat-adapter-feishu/src/api.ts
+++ b/packages/chat-adapter-feishu/src/api.ts
@@ -5,6 +5,18 @@ const BASE_URLS: Record<string, string> = {
const MAX_TEXT_LENGTH = 4000;
+/**
+ * `LARK_API_BASE_URL` redirects every call (auth included) to a stand-in Open
+ * API — the seam a local acceptance run uses to drive the real client without
+ * a Feishu tenant. Unset in production, where the platform picks the host.
+ */
+const resolveBaseUrl = (platform: string): string => {
+ const override =
+ typeof process === 'undefined' ? undefined : process.env?.LARK_API_BASE_URL?.trim();
+ if (override) return override.replace(/\/$/, '');
+ return BASE_URLS[platform] || BASE_URLS.lark;
+};
+
/**
* Lightweight wrapper around the Lark/Feishu Open API.
*
@@ -21,7 +33,7 @@ export class LarkApiClient {
constructor(appId: string, appSecret: string, platform: string = 'lark') {
this.appId = appId;
this.appSecret = appSecret;
- this.baseUrl = BASE_URLS[platform] || BASE_URLS.lark;
+ this.baseUrl = resolveBaseUrl(platform);
}
// ------------------------------------------------------------------
@@ -246,6 +258,64 @@ export class LarkApiClient {
return Buffer.from(await response.arrayBuffer());
}
+ // ------------------------------------------------------------------
+ // Cloud documents (docx / wiki)
+ // ------------------------------------------------------------------
+
+ /**
+ * Metadata of a docx document: title + revision. Needs
+ * `docx:document:readonly` (or `docx:document`) on the app, AND the
+ * document must be visible to the app — via a group the bot is in, or by
+ * adding the app as a collaborator.
+ *
+ * @see https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/get
+ */
+ async getDocxDocument(
+ documentId: string,
+ ): Promise<{ documentId: string; revisionId?: number; title?: string }> {
+ const data = await this.call('GET', `/docx/v1/documents/${documentId}`, {});
+ const doc = data.data?.document ?? {};
+ return {
+ documentId: doc.document_id ?? documentId,
+ revisionId: doc.revision_id,
+ title: doc.title,
+ };
+ }
+
+ /**
+ * Plain-text body of a docx document (headings, paragraphs, table cells
+ * flattened into text — no block structure). Same scope as
+ * {@link getDocxDocument}. Rate-limited to 5 req/s per app.
+ *
+ * @see https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/raw_content
+ */
+ async getDocxRawContent(documentId: string): Promise<string> {
+ const data = await this.call('GET', `/docx/v1/documents/${documentId}/raw_content`, {});
+ return typeof data.data?.content === 'string' ? data.data.content : '';
+ }
+
+ /**
+ * Resolve a wiki node token to the underlying object it wraps. A wiki
+ * link (`/wiki/<token>`) is a tree node, not a document; the document
+ * token to feed the docx endpoints is `obj_token` (when `obj_type` is
+ * `docx`). Needs `wiki:wiki:readonly` (or `wiki:wiki`) on the app.
+ *
+ * @see https://open.feishu.cn/document/server-docs/docs/wiki-v2/space-node/get_node
+ */
+ async getWikiNode(
+ token: string,
+ ): Promise<{ nodeToken: string; objToken?: string; objType?: string; title?: string }> {
+ const params = new URLSearchParams({ token });
+ const data = await this.call('GET', `/wiki/v2/spaces/get_node?${params.toString()}`, {});
+ const node = data.data?.node ?? {};
+ return {
+ nodeToken: node.node_token ?? token,
+ objToken: node.obj_token,
+ objType: node.obj_type,
+ title: node.title,
+ };
+ }
+
// ------------------------------------------------------------------
// Auth
// ------------------------------------------------------------------
diff --git a/packages/chat-adapter-feishu/src/docLinks.test.ts b/packages/chat-adapter-feishu/src/docLinks.test.ts
new file mode 100644
index 00000000000..ad1537f57c7
--- /dev/null
+++ b/packages/chat-adapter-feishu/src/docLinks.test.ts
@@ -0,0 +1,223 @@
+import { describe, expect, it } from 'vitest';
+
+import { extractLarkDocLinks, flattenLarkMessageContent, parseLarkDocUrl } from './docLinks';
+
+describe('parseLarkDocUrl', () => {
+ it('extracts the token from a docx link and ignores query / fragment', () => {
+ expect(
+ parseLarkDocUrl('https://lobe-hub.feishu.cn/docx/Abc123DefGhi456?from=chat#heading'),
+ ).toEqual({
+ host: 'lobe-hub.feishu.cn',
+ kind: 'docx',
+ token: 'Abc123DefGhi456',
+ url: 'https://lobe-hub.feishu.cn/docx/Abc123DefGhi456',
+ });
+ });
+
+ it.each([
+ ['https://x.larksuite.com/wiki/WikiTok3n', 'wiki', 'WikiTok3n'],
+ ['https://x.feishu.cn/docs/legacyDocTok', 'doc', 'legacyDocTok'],
+ ['https://x.feishu.cn/minutes/obcn1234', 'minutes', 'obcn1234'],
+ ['https://x.feishu.cn/sheets/shtcn1234', 'sheets', 'shtcn1234'],
+ ['https://x.feishu.cn/base/bascn1234', 'base', 'bascn1234'],
+ ['http://x.larkoffice.com/file/boxcn1234', 'file', 'boxcn1234'],
+ ])('recognises %s as %s', (url, kind, token) => {
+ expect(parseLarkDocUrl(url)).toMatchObject({ kind, token });
+ });
+
+ it('rejects non-document and non-Feishu URLs', () => {
+ expect(parseLarkDocUrl('https://lobe-hub.feishu.cn/space/home')).toBeUndefined();
+ expect(parseLarkDocUrl('https://docs.google.com/document/d/abc')).toBeUndefined();
+ expect(parseLarkDocUrl('docx/Abc123')).toBeUndefined();
+ expect(parseLarkDocUrl('see https://x.feishu.cn/docx/Abc123')).toBeUndefined();
+ });
+});
+
+describe('extractLarkDocLinks', () => {
+ it('finds every distinct document link in free text, in order', () => {
+ const text = [
+ '会议纪要 https://lobe-hub.feishu.cn/docx/AAA?from=chat 和',
+ 'https://lobe-hub.feishu.cn/wiki/BBB ,再看一次 https://lobe-hub.feishu.cn/docx/AAA',
+ ].join(' ');
+ expect(extractLarkDocLinks(text).map((l) => `${l.kind}:${l.token}`)).toEqual([
+ 'docx:AAA',
+ 'wiki:BBB',
+ ]);
+ });
+
+ it('returns an empty list when there is nothing to find', () => {
+ expect(extractLarkDocLinks('hello https://example.com')).toEqual([]);
+ });
+});
+
+describe('flattenLarkMessageContent', () => {
+ it('returns the text and its links for a text message', () => {
+ const result = flattenLarkMessageContent(
+ 'text',
+ JSON.stringify({ text: '看下 https://lobe-hub.feishu.cn/docx/AAA' }),
+ );
+ expect(result.text).toBe('看下 https://lobe-hub.feishu.cn/docx/AAA');
+ expect(result.links).toEqual(['https://lobe-hub.feishu.cn/docx/AAA']);
+ expect(result.imageKeys).toEqual([]);
+ });
+
+ it('renders a post (rich text) receive-event body with its anchors', () => {
+ const content = {
+ content: [
+ [
+ { tag: 'at', user_id: 'ou_bot', user_name: 'LobeHub CAO' },
+ { tag: 'text', text: ' 帮我看这份纪要 ' },
+ { href: 'https://lobe-hub.feishu.cn/docx/AAA', tag: 'a', text: '远程设备研讨会' },
+ ],
+ [{ tag: 'img', image_key: 'img_1' }],
+ ],
+ title: '智能纪要',
+ };
+ const result = flattenLarkMessageContent('post', JSON.stringify(content));
+ expect(result.text).toBe(
+ '智能纪要\n@LobeHub CAO 帮我看这份纪要 远程设备研讨会 (https://lobe-hub.feishu.cn/docx/AAA)\n[image]',
+ );
+ expect(result.links).toEqual(['https://lobe-hub.feishu.cn/docx/AAA']);
+ expect(result.imageKeys).toEqual(['img_1']);
+ });
+
+ it('prefers content_v2 and extracts Feishu image keys from native markdown in order', () => {
+ const content = {
+ content: [[{ tag: 'img', image_key: 'img_legacy' }]],
+ content_v2: [
+ [{ tag: 'md', text: '第一段 ![截图](img_v3_first)' }],
+ [],
+ [
+ { tag: 'text', text: '第二段' },
+ { tag: 'img', image_key: 'img_v3_second' },
+ { tag: 'md', text: ' ![外链](https://example.com/image.png)' },
+ ],
+ ],
+ title: '标题',
+ };
+
+ const result = flattenLarkMessageContent('post', JSON.stringify(content));
+
+ expect(result.text).toBe(
+ '标题\n第一段 [image]\n\n第二段[image] ![外链](https://example.com/image.png)',
+ );
+ expect(result.imageKeys).toEqual(['img_v3_first', 'img_v3_second']);
+ });
+
+ it('unwraps locale-keyed content_v2 post bodies', () => {
+ const content = {
+ zh_cn: {
+ content_v2: [[{ tag: 'img', image_key: 'img_locale' }]],
+ title: '本地化标题',
+ },
+ };
+ const result = flattenLarkMessageContent('post', content);
+
+ expect(result.text).toBe('本地化标题\n[image]');
+ expect(result.imageKeys).toEqual(['img_locale']);
+ });
+
+ it.each([undefined, [], null, 'invalid'])(
+ 'falls back to classic content for unusable v2: %s',
+ (content_v2) => {
+ const result = flattenLarkMessageContent('post', {
+ content: [
+ [
+ { tag: 'text', text: 'classic' },
+ { tag: 'img', image_key: 'img_classic' },
+ ],
+ ],
+ content_v2,
+ });
+ expect(result.text).toBe('classic[image]');
+ expect(result.imageKeys).toEqual(['img_classic']);
+ },
+ );
+
+ it('does not download markdown examples or external images', () => {
+ const result = flattenLarkMessageContent('post', {
+ content_v2: [
+ [
+ {
+ tag: 'md',
+ text: '`![example](img_code)`\n```md\n![example](img_fenced)\n```\n![remote](https://example.com/a.png)\n![real](img_real)',
+ },
+ ],
+ ],
+ });
+ expect(result.imageKeys).toEqual(['img_real']);
+ expect(result.text).toBe(
+ '`![example](img_code)`\n```md\n![example](img_fenced)\n```\n![remote](https://example.com/a.png)\n[image]',
+ );
+ });
+
+ it('keeps escaped image syntax and code spans with arbitrary backtick delimiters', () => {
+ const text = '\\![escaped](img_escaped) ````![code](img_code)```` ![real](img_real)';
+ const result = flattenLarkMessageContent('post', {
+ content_v2: [[{ tag: 'md', text }]],
+ });
+
+ expect(result.imageKeys).toEqual(['img_real']);
+ expect(result.text).toBe('\\![escaped](img_escaped) ````![code](img_code)```` [image]');
+ });
+
+ it.each(['![', '![](!'])('handles repeated incomplete image syntax: %s', (prefix) => {
+ const text = prefix.repeat(30_000);
+ const started = performance.now();
+ const result = flattenLarkMessageContent('post', {
+ content_v2: [[{ tag: 'md', text }]],
+ });
+
+ expect(result.imageKeys).toEqual([]);
+ expect(result.text).toBe(text);
+ expect(performance.now() - started).toBeLessThan(2000);
+ });
+
+ it('unwraps a locale-keyed post body', () => {
+ const content = {
+ zh_cn: { content: [[{ tag: 'text', text: 'hello' }]], title: 'T' },
+ };
+ expect(flattenLarkMessageContent('post', content).text).toBe('T\nhello');
+ });
+
+ it('harvests text and urls from an interactive card', () => {
+ const card = {
+ elements: [
+ { tag: 'div', text: { content: '**参会人**:A、B', tag: 'lark_md' } },
+ {
+ actions: [
+ {
+ tag: 'button',
+ text: { content: '查看纪要', tag: 'plain_text' },
+ url: 'https://lobe-hub.feishu.cn/docx/CCC',
+ },
+ ],
+ tag: 'action',
+ },
+ ],
+ header: { title: { content: '9/9 多Agent协作方案评审会', tag: 'plain_text' } },
+ };
+ const result = flattenLarkMessageContent('interactive', JSON.stringify(card));
+ expect(result.text).toBe(
+ '**参会人**:A、B\n查看纪要\n9/9 多Agent协作方案评审会\n[links: https://lobe-hub.feishu.cn/docx/CCC]',
+ );
+ expect(result.links).toEqual(['https://lobe-hub.feishu.cn/docx/CCC']);
+ });
+
+ it('keeps malformed content as-is instead of throwing', () => {
+ const result = flattenLarkMessageContent('text', 'not json https://x.feishu.cn/docx/DDD');
+ expect(result.text).toBe('not json https://x.feishu.cn/docx/DDD');
+ expect(result.links).toEqual(['https://x.feishu.cn/docx/DDD']);
+ });
+
+ it('surfaces only the file name for media bodies', () => {
+ expect(
+ flattenLarkMessageContent('file', JSON.stringify({ file_key: 'f', file_name: 'a.pdf' })),
+ ).toEqual({ imageKeys: [], links: [], text: '[file] a.pdf' });
+ expect(flattenLarkMessageContent('image', JSON.stringify({ image_key: 'i' }))).toEqual({
+ imageKeys: [],
+ links: [],
+ text: '',
+ });
+ });
+});
diff --git a/packages/chat-adapter-feishu/src/docLinks.ts b/packages/chat-adapter-feishu/src/docLinks.ts
new file mode 100644
index 00000000000..94c6931d987
--- /dev/null
+++ b/packages/chat-adapter-feishu/src/docLinks.ts
@@ -0,0 +1,321 @@
+/**
+ * Feishu / Lark cloud-document links and message-content flattening.
+ *
+ * Two problems live here:
+ *
+ * 1. A document shared into a chat is a URL, not a body. Meeting minutes
+ * (智能纪要), wiki pages and docx files all arrive as
+ * `https://<tenant>.feishu.cn/docx/<token>`-style links; the token in
+ * that URL is what the Docs API wants. `parseLarkDocUrl` pulls it out.
+ * 2. The receive event / history API hand us `content` as a JSON string
+ * whose shape depends on `message_type`. Only `text` is trivially a
+ * string — rich text (`post`) is a nested element tree, cards
+ * (`interactive`) are arbitrary JSON. `flattenLarkMessageContent`
+ * reduces every shape to "plain text + the links it carries" so
+ * callers do not need per-type knowledge to see a document link.
+ */
+
+export type LarkDocKind =
+ 'base' | 'doc' | 'docx' | 'file' | 'minutes' | 'sheets' | 'slides' | 'wiki';
+
+export interface LarkDocLink {
+ /** Host the link points at, e.g. `lobe-hub.feishu.cn`. */
+ host: string;
+ kind: LarkDocKind;
+ /** Document / node token, e.g. `doxcnXXXX` for docx or the wiki node token. */
+ token: string;
+ /** The URL as it appeared, without query string or fragment. */
+ url: string;
+}
+
+const DOC_HOST_PATTERN = String.raw`[\w-]+(?:\.[\w-]+)*\.(?:feishu\.cn|larksuite\.com|larkoffice\.com|feishu\.net)`;
+
+/**
+ * Path segments Feishu uses for cloud documents. `docs` is the legacy
+ * "doc" product (kept distinct: it is NOT readable through the docx API),
+ * `base` is Bitable. `space` is not a document path and is left out.
+ */
+const DOC_PATH_KINDS: Record<string, LarkDocKind> = {
+ base: 'base',
+ doc: 'doc',
+ docs: 'doc',
+ docx: 'docx',
+ file: 'file',
+ minutes: 'minutes',
+ sheets: 'sheets',
+ slides: 'slides',
+ wiki: 'wiki',
+};
+
+const DOC_URL_RE = new RegExp(
+ String.raw`https?://(${DOC_HOST_PATTERN})/(base|docs|doc|docx|file|minutes|sheets|slides|wiki)/([\w-]+)`,
+ 'gi',
+);
+
+/** Any http(s) URL — used to surface non-document links from cards / rich text. */
+const ANY_URL_RE = /https?:\/\/[^\s"'<>)\]]+/g;
+
+/**
+ * Parse one Feishu / Lark cloud-document URL. Returns `undefined` for
+ * anything that is not a document link on a Feishu / Lark host.
+ */
+export function parseLarkDocUrl(url: string): LarkDocLink | undefined {
+ const trimmed = url.trim();
+ const re = new RegExp(DOC_URL_RE.source, 'i');
+ const match = re.exec(trimmed);
+ if (!match || match.index !== 0) return undefined;
+
+ const [matched, host, path, token] = match;
+ const kind = DOC_PATH_KINDS[path.toLowerCase()];
+ if (!kind) return undefined;
+
+ return { host, kind, token, url: matched };
+}
+
+/**
+ * Collect every distinct Feishu / Lark document link in a piece of text,
+ * in order of first appearance.
+ */
+export function extractLarkDocLinks(text: string): LarkDocLink[] {
+ const seen = new Set<string>();
+ const links: LarkDocLink[] = [];
+ for (const match of text.matchAll(DOC_URL_RE)) {
+ const link = parseLarkDocUrl(match[0]);
+ if (!link || seen.has(link.url)) continue;
+ seen.add(link.url);
+ links.push(link);
+ }
+ return links;
+}
+
+export interface FlattenedLarkContent {
+ /** Feishu message image keys found in post nodes, in rich-text order. */
+ imageKeys: string[];
+ /** Every http(s) link found in the content, document links included, deduplicated. */
+ links: string[];
+ /** Plain-text rendering of the content; empty when nothing textual exists. */
+ text: string;
+}
+
+const LINK_KEYS = new Set([
+ 'href',
+ 'url',
+ 'link',
+ 'pc_url',
+ 'android_url',
+ 'ios_url',
+ 'default_url',
+]);
+const TEXT_KEYS = new Set(['text', 'content', 'title', 'label', 'summary', 'file_name', 'name']);
+// Excluding nested label openers and matching only native image destinations
+// prevents repeated incomplete image markers from rescanning the remaining text.
+const MARKDOWN_IMAGE_SCAN_RE =
+ /(\\[\s\S]|```[\s\S]*?```|~~~[\s\S]*?~~~|``[\s\S]*?``|`[^`\n]*`)|!\[[^[\]]*\]\((img_[\w-]+)(?:\s+["'][^"']*["'])?\)/g;
+
+function pushUnique(list: string[], seen: Set<string>, value: string) {
+ if (!value || seen.has(value)) return;
+ seen.add(value);
+ list.push(value);
+}
+
+function collectUrlsFromString(value: string, links: string[], seen: Set<string>) {
+ for (const m of value.matchAll(ANY_URL_RE)) pushUnique(links, seen, m[0]);
+}
+
+function renderPostMarkdown(value: string, imageKeys: string[]): string {
+ return value.replaceAll(MARKDOWN_IMAGE_SCAN_RE, (match, literal, imageKey) => {
+ if (literal || !imageKey) return match;
+ imageKeys.push(imageKey);
+ // Native image keys are delivered as attachments, not browser image URLs.
+ return '[image]';
+ });
+}
+
+/**
+ * Render one `post` element. Post content is `[[element, ...], ...]` — an
+ * array of paragraphs, each an array of inline elements tagged
+ * `text` / `a` / `at` / `img` / `media` / `emotion` / `code_block` / `hr`.
+ */
+function renderPostElement(
+ el: any,
+ links: string[],
+ seen: Set<string>,
+ imageKeys: string[],
+): string {
+ if (!el || typeof el !== 'object') return '';
+ switch (el.tag) {
+ case 'text': {
+ return typeof el.text === 'string' ? el.text : '';
+ }
+ case 'a': {
+ const href = typeof el.href === 'string' ? el.href : '';
+ const label = typeof el.text === 'string' ? el.text : '';
+ if (href) pushUnique(links, seen, href);
+ if (href && label && label !== href) return `${label} (${href})`;
+ return href || label;
+ }
+ case 'at': {
+ // Mention placeholders are stripped by the adapter the same way text
+ // mentions are; keep the display name so the sentence still reads.
+ const name = typeof el.user_name === 'string' ? el.user_name : '';
+ return name ? `@${name}` : '';
+ }
+ case 'code_block': {
+ return typeof el.text === 'string' ? `\n${el.text}\n` : '';
+ }
+ case 'img': {
+ if (typeof el.image_key === 'string' && el.image_key) imageKeys.push(el.image_key);
+ return '[image]';
+ }
+ case 'md': {
+ const text = typeof el.text === 'string' ? el.text : '';
+ collectUrlsFromString(text, links, seen);
+ return renderPostMarkdown(text, imageKeys);
+ }
+ case 'media': {
+ return '[video]';
+ }
+ case 'emotion': {
+ return typeof el.emoji_type === 'string' ? `[${el.emoji_type}]` : '';
+ }
+ default: {
+ return typeof el.text === 'string' ? el.text : '';
+ }
+ }
+}
+
+function renderPost(content: any, links: string[], seen: Set<string>, imageKeys: string[]): string {
+ // Receive events carry `{ title, content: [[...]] }`; outbound / some
+ // history rows nest that under a locale key (`{ zh_cn: { title, content } }`).
+ // Newer post bodies may provide `content_v2`; a non-empty v2 body wins.
+ let post = content;
+ const hasPostBody = (value: any) =>
+ value &&
+ typeof value === 'object' &&
+ (Array.isArray(value.content) || Array.isArray(value.content_v2));
+
+ if (post && typeof post === 'object' && !hasPostBody(post)) {
+ const localized = Object.values(post).find((value: any) => hasPostBody(value));
+ if (localized) post = localized;
+ }
+ if (!post || typeof post !== 'object') return '';
+
+ const lines: string[] = [];
+ if (typeof post.title === 'string' && post.title.trim()) lines.push(post.title.trim());
+
+ const paragraphs: any[] =
+ Array.isArray(post.content_v2) && post.content_v2.length > 0
+ ? post.content_v2
+ : Array.isArray(post.content)
+ ? post.content
+ : [];
+ for (const paragraph of paragraphs) {
+ const elements = Array.isArray(paragraph) ? paragraph : [paragraph];
+ const line = elements.map((el) => renderPostElement(el, links, seen, imageKeys)).join('');
+ lines.push(line.trim());
+ }
+ return lines.join('\n').trim();
+}
+
+/**
+ * Generic walk for card JSON and any message type we have no schema for:
+ * every string under a text-ish key becomes a line, every string under a
+ * link-ish key (or containing a URL) contributes to `links`.
+ */
+function walkGeneric(
+ node: any,
+ lines: string[],
+ links: string[],
+ seen: Set<string>,
+ depth = 0,
+): void {
+ if (depth > 12 || node === null || node === undefined) return;
+
+ if (typeof node === 'string') {
+ collectUrlsFromString(node, links, seen);
+ return;
+ }
+ if (Array.isArray(node)) {
+ for (const item of node) walkGeneric(item, lines, links, seen, depth + 1);
+ return;
+ }
+ if (typeof node !== 'object') return;
+
+ for (const [key, value] of Object.entries(node)) {
+ if (typeof value === 'string') {
+ if (LINK_KEYS.has(key)) {
+ if (/^https?:\/\//.test(value)) pushUnique(links, seen, value);
+ } else if (TEXT_KEYS.has(key)) {
+ const trimmed = value.trim();
+ if (trimmed && !lines.includes(trimmed)) lines.push(trimmed);
+ collectUrlsFromString(value, links, seen);
+ } else {
+ collectUrlsFromString(value, links, seen);
+ }
+ } else {
+ walkGeneric(value, lines, links, seen, depth + 1);
+ }
+ }
+}
+
+/**
+ * Reduce a Feishu / Lark message body to plain text plus the links it
+ * carries. `content` may be the raw JSON string from the API or an
+ * already-parsed object. Never throws: malformed content yields the raw
+ * string as text (matching the previous `readMessages` fallback).
+ */
+export function flattenLarkMessageContent(
+ messageType: string | undefined,
+ content: unknown,
+): FlattenedLarkContent {
+ const links: string[] = [];
+ const imageKeys: string[] = [];
+ const seen = new Set<string>();
+
+ let parsed: any = content;
+ if (typeof content === 'string') {
+ try {
+ parsed = JSON.parse(content);
+ } catch {
+ collectUrlsFromString(content, links, seen);
+ return { imageKeys, links, text: content };
+ }
+ }
+
+ let text: string;
+ switch (messageType) {
+ case 'text': {
+ text = typeof parsed?.text === 'string' ? parsed.text : '';
+ collectUrlsFromString(text, links, seen);
+ break;
+ }
+ case 'post': {
+ text = renderPost(parsed, links, seen, imageKeys);
+ break;
+ }
+ case 'image':
+ case 'file':
+ case 'audio':
+ case 'media':
+ case 'sticker': {
+ // Media bodies are handled by the attachment pipeline; a file name is
+ // the only text worth surfacing.
+ text = typeof parsed?.file_name === 'string' ? `[file] ${parsed.file_name}` : '';
+ break;
+ }
+ default: {
+ // `interactive` cards, share_* messages, system notices and anything
+ // newer than this switch: harvest whatever text and links exist.
+ const lines: string[] = [];
+ walkGeneric(parsed, lines, links, seen);
+ text = lines.join('\n');
+ }
+ }
+
+ const missingLinks = links.filter((link) => !text.includes(link));
+ if (missingLinks.length > 0) {
+ text = `${text}\n[links: ${missingLinks.join(' ')}]`.trim();
+ }
+
+ return { imageKeys, links, text };
+}
diff --git a/packages/chat-adapter-feishu/src/index.ts b/packages/chat-adapter-feishu/src/index.ts
index 693c8b19686..a13e174c6e4 100644
--- a/packages/chat-adapter-feishu/src/index.ts
+++ b/packages/chat-adapter-feishu/src/index.ts
@@ -8,6 +8,14 @@ export {
} from './adapter';
export { LarkApiClient } from './api';
export { decryptLarkEvent } from './crypto';
+export {
+ extractLarkDocLinks,
+ type FlattenedLarkContent,
+ flattenLarkMessageContent,
+ type LarkDocKind,
+ type LarkDocLink,
+ parseLarkDocUrl,
+} from './docLinks';
export { LarkFormatConverter } from './format-converter';
export { supportedFeishuEmojiTypes, toFeishuEmojiType } from './reactionEmoji';
export type {
diff --git a/src/store/tool/slices/builtin/executors/lobe-message/trpcAdapters.ts b/src/store/tool/slices/builtin/executors/lobe-message/trpcAdapters.ts
index a7d463cbf33..8060ce15fab 100644
--- a/src/store/tool/slices/builtin/executors/lobe-message/trpcAdapters.ts
+++ b/src/store/tool/slices/builtin/executors/lobe-message/trpcAdapters.ts
@@ -261,6 +261,10 @@ export const trpcMessageService: MessageRuntimeService = {
return lambdaClient.botMessage.readMessages.query(await buildTrpcInput(params)) as any;
},
+ readDocument: async (params) => {
+ return lambdaClient.botMessage.readDocument.query(await buildTrpcInput(params)) as any;
+ },
+
editMessage: async (params) => {
return lambdaClient.botMessage.editMessage.mutate(await buildTrpcInput(params)) as any;
},