@michengai/dsh-im-connect 1.0.41 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/CHANGELOG.zh-CN.md +21 -0
  3. package/README.de.md +19 -1
  4. package/README.en.md +29 -2
  5. package/README.es.md +19 -1
  6. package/README.fr.md +19 -1
  7. package/README.ja.md +20 -1
  8. package/README.md +29 -2
  9. package/README.pt.md +19 -1
  10. package/README.ru.md +19 -1
  11. package/README.zh-CN.md +29 -2
  12. package/client.js +40 -3
  13. package/lib/channels/factory.d.ts +1 -0
  14. package/lib/channels/factory.d.ts.map +1 -1
  15. package/lib/channels/factory.js +2 -2
  16. package/lib/channels/factory.js.map +1 -1
  17. package/lib/channels/feishu.d.ts +28 -0
  18. package/lib/channels/feishu.d.ts.map +1 -1
  19. package/lib/channels/feishu.js +527 -34
  20. package/lib/channels/feishu.js.map +1 -1
  21. package/lib/channels/meta.d.ts.map +1 -1
  22. package/lib/channels/meta.js +2 -0
  23. package/lib/channels/meta.js.map +1 -1
  24. package/lib/client.js +40 -3
  25. package/lib/engine/assistant-text.d.ts +3 -0
  26. package/lib/engine/assistant-text.d.ts.map +1 -1
  27. package/lib/engine/assistant-text.js +20 -1
  28. package/lib/engine/assistant-text.js.map +1 -1
  29. package/lib/engine/gateway.d.ts +4 -1
  30. package/lib/engine/gateway.d.ts.map +1 -1
  31. package/lib/engine/gateway.js +26 -3
  32. package/lib/engine/gateway.js.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/manager.d.ts +1 -0
  36. package/lib/manager.d.ts.map +1 -1
  37. package/lib/manager.js +20 -2
  38. package/lib/manager.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/channels/factory.ts +3 -3
  41. package/src/channels/feishu.ts +565 -39
  42. package/src/channels/meta.ts +2 -0
  43. package/src/engine/assistant-text.ts +18 -1
  44. package/src/engine/gateway.ts +23 -3
  45. package/src/index.ts +1 -1
  46. package/src/manager.ts +19 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.43] - 2026-11-17
4
+
5
+ ### Feishu & Lark Thinking Process
6
+
7
+ - **Native thinking process bubbles**: Added support for displaying model reasoning (Thinking Process) in Feishu and Lark. Direct messages and main group chats use official native thinking process bubbles that can be expanded to review the complete chain of thought.
8
+ - **In-thread collapsible fallback**: In group message threads, reasoning automatically falls back to an expandable card panel (`collapsible_panel`), ensuring thought processes stay within the thread without leaking to the main lobby; smoothly falls back to cards if the tenant lacks native permissions.
9
+ - **Long reasoning & complex emoji display**: Improved presentation for long reasoning steps and composite emojis (such as diverse family and skin-tone emoji sequences), preventing split characters, garbled text, or corrupted symbols when displaying lengthy thought processes.
10
+ - **How to enable**: Navigate to Settings → IM Connect → Feishu/Lark account settings, and set "Thinking process display" to "Collapsed" (defaults to system preference).
11
+
12
+ ## [1.0.42] - 2026-11-17
13
+
14
+ ### Feishu Threads & Reply Experience
15
+
16
+ - **Thread session isolation**: Added a "Thread session isolation" toggle in Feishu and Lark account settings. When enabled, group message threads maintain isolated conversation sessions and context bounded by each thread; disabled by default (shares group context).
17
+ - **Accurate in-thread replies**: Improved reply routing for Feishu group messages and threads, ensuring responses stay strictly within the original thread and eliminating unintended fallbacks to the main lobby.
18
+ - **Interactive cards & buttons**: Added parsing support for Feishu interactive card messages; button interactions within a thread retain full thread context, ensuring approvals and option choices resolve in place.
19
+
20
+ ### Delivery & Silent Protocol
21
+
22
+ - **Silent reply protocol**: Added support for `NO_REPLY` (and `<<<NO_REPLY>>>`) silent markers. When the assistant determines no user-visible response is needed, it finishes the turn silently without sending fallback notice cards.
23
+
3
24
  ## [1.0.41] - 2026-11-15
4
25
 
5
26
  ### UI & Layout Fixes
@@ -1,5 +1,26 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.0.43] - 2026-11-17
4
+
5
+ ### 飞书与 Lark 思考过程展示
6
+
7
+ - **原生思考过程支持**:飞书与 Lark 渠道支持折叠展示模型的思考过程(Thinking Process)。在私聊与群大厅普通消息中,采用官方原生思考过程气泡展示,可展开查看完整推理思维链。
8
+ - **话题内平滑折叠卡片**:群聊话题回复串(Thread)中自动平滑降级为折叠卡片展示思考过程,确保思维链留在话题串内,绝不出串污染群公屏;租户未开通原生权限时同样平滑折叠展示。
9
+ - **长思维链与复杂表情保护**:优化长思考过程的分段展示与表情符号解析,完整保护复合表情(如包含多种肤色与多成员的 Emoji 组合),彻底避免分段时出现乱码或文字渲染割裂。
10
+ - **开启方式**:进入「设置 → 即时通讯 → 飞书/Lark 账号详情」,将「展示思考过程」选项设为「折叠展示」(默认跟随系统)。
11
+
12
+ ## [1.0.42] - 2026-11-17
13
+
14
+ ### 飞书话题与回复体验
15
+
16
+ - **群聊回复串会话隔离**:飞书与 Lark 账号设置新增「群回复串会话隔离」开关。开启后,群聊内消息回复串按话题独立隔离会话与上下文;默认关闭(保持大厅共享上下文)。
17
+ - **话题内精准回复**:优化飞书群聊回复特定消息与话题串的路由机制,确保回复消息精准锁定在原话题串内,杜绝偶现回退至大厅公屏的问题。
18
+ - **卡片消息与交互支持**:支持解析飞书富文本交互卡片消息正文;在群聊话题内点击卡片交互按钮时,完整保留话题上下文,审批与选项选择精准落串生效。
19
+
20
+ ### 消息投递与静默协议
21
+
22
+ - **静默回复支持**:支持 `NO_REPLY`(或 `<<<NO_REPLY>>>`)静默标记。当助手判断当前场景无需向用户发送可见内容时,自动静默收口当前回合,不再发送「未返回可投递的结果」提示卡片。
23
+
3
24
  ## [1.0.41] - 2026-11-15
4
25
 
5
26
  ### 界面与布局修复
package/README.de.md CHANGED
@@ -101,7 +101,11 @@ Erreichbar über die Verwaltung unter **Plugins → @michengai/dsh-im-connect**:
101
101
 
102
102
  ### 4. Einklappbare Denkprozess-Anzeige (`thinkingDisplay`)
103
103
  - **Standard**: Aus (`off`)
104
- - **Funktion**: Übermittelt den Denkprozess des Modells auf Telegram als einklappbaren Zitatblock (`<blockquote expandable>`).
104
+ - **Funktion**: Übermittelt den Denkprozess des Modells auf Telegram als einklappbaren Zitatblock (`<blockquote expandable>`) sowie auf Feishu/Lark als nativen Denkprozess bzw. einklappbare Karte in Threads.
105
+
106
+ ### 5. Feishu-Thread-Sitzungsisolation (`threadSessions`)
107
+ - **Standard**: Deaktiviert (`false`)
108
+ - **Funktion**: Wenn aktiviert, behalten Antwort-Threads in Feishu-Gruppen isolierte Sitzungen und Kontexte basierend auf der Root-Nachrichten-ID. Standardmäßig teilen alle Threads den Gruppenkontext.
105
109
 
106
110
  ## Nutzung und Befehle
107
111
 
@@ -118,6 +122,20 @@ Erreichbar über die Verwaltung unter **Plugins → @michengai/dsh-im-connect**:
118
122
  | Modell & Denkaufwand | `/models`, `/model <Name>`, `/reasoning [Stufe]` | Passt das Modell zur Laufzeit an |
119
123
  | Sitzungsverwaltung | `/sessions`, `/session <Nummer/ID>`, `/rename <Titel>`, `/fork` | Sitzungen auflisten, wechseln, umbenennen oder forken |
120
124
  | Zustellwiederherstellung | `/delivery`, `/delivery retry <ID>` | Sendet unterbrochene Nachrichten erneut |
125
+ | Thread-Isolation | In den Feishu-/Lark-Kontoeinstellungen aktivieren | Isoliert Antwort-Threads in eigene Kontexte (Standard: aus) |
126
+ | Stille Antwort | `NO_REPLY` oder `<<<NO_REPLY>>>` in der Modellausgabe | Beendet den Turn lautlos ohne Platzhalter-Benachrichtigungen |
127
+
128
+ ### Feishu-Threads und interaktive Karten
129
+
130
+ - **Präzise Thread-Antworten**: Verwendet gezielt die Feishu `reply`-API mit der Root-Nachrichten-ID, um Nachrichten präzise im Thread zu halten.
131
+ - **Kartenextraktion**: Extrahiert Text und Schaltflächen aus interaktiven Feishu-Karten mit automatischer Kürzung.
132
+ - **Schaltflächen-Callbacks**: Klicks auf Kartenschaltflächen in Threads behalten den vollen Thread-Kontext für Genehmigungen und Auswahlen.
133
+
134
+ ### Stille Antwort (`NO_REPLY`)
135
+
136
+ Wenn der Agent entscheidet, dass keine sichtbare Antwort erforderlich ist:
137
+ - Das Modell gibt `NO_REPLY` oder `<<<NO_REPLY>>>` aus.
138
+ - Das Gateway unterdrückt Hinweiskarten („Verarbeitung beendet ohne Ergebnis“) vollständig.
121
139
 
122
140
  ### Automatische Telegram-Themenbenennung
123
141
 
package/README.en.md CHANGED
@@ -297,7 +297,9 @@ Native configuration options are provided here. Their values are persisted in `c
297
297
 
298
298
  ### 4. Collapsible thinking message (`thinkingDisplay`)
299
299
  - **Default**: off (`mode: 'off'`).
300
- - **What it does**: when enabled, the model's reasoning is sent as a separate Telegram collapsible quote (`<blockquote expandable>`) — about three lines collapsed, tap "show more" to expand. The same message is edited in place during the turn and retitled "🧠 Thought process" when the turn ends.
300
+ - **What it does**: when enabled, the model's reasoning is presented in an expandable form:
301
+ - **Telegram**: sent as a separate collapsible quote (`<blockquote expandable>`), about three lines collapsed, tap "show more" to expand; edited in place during the turn and retitled "🧠 Thought process" when the turn ends.
302
+ - **Feishu / Lark**: sent as an official native thinking-process bubble (`/open-apis/im/v1/message_cot`) for direct messages and main chat; seamlessly falls back to a collapsible card (`collapsible_panel`) within group message threads or when the tenant lacks native CoT permission, preventing reasoning from leaking outside threads.
301
303
  - **Example** (plugin config slot):
302
304
  ```yaml
303
305
  thinkingDisplay:
@@ -306,12 +308,23 @@ Native configuration options are provided here. Their values are persisted in `c
306
308
  intervalMs: 2000 # minimum interval between refreshes
307
309
  maxChars: 3500 # per-message cap; longer text is truncated and noted
308
310
  ```
309
- - **Channel and UI support**: implemented for Telegram; can be enabled in **Settings → IM Assistant → Telegram Account** by selecting **Collapsed** in the **Show thinking process** dropdown. Other channels ignore the setting and keep the existing status line.
311
+ - **Channel and UI support**: implemented for Telegram, Feishu, and Lark; can be enabled in **Settings → IM Assistant → Account Details** by selecting **Collapsed** in the **Show thinking process** dropdown. Other channels ignore the setting and keep the existing status line.
310
312
  - **Boundaries and privacy**: collapsing is client-side display, not access control; everyone who can read the group message can expand the reasoning. Enable only where sharing reasoning is intentional. Thinking is not counted as final-answer delivery or included in automatic recovery.
311
313
  - **Resources and lifecycle**: off/unsupported channels retain no raw reasoning. When enabled, each turn retains at most a 4096 UTF-16-unit prefix plus a scalar character count. Pending refreshes coalesce to the latest snapshot; cancellation, rebinding, muting, unloading and turn replacement prevent stale output.
312
314
  - **Ranges**: `minChars` 0–4096 (also applied on final), `intervalMs` 1000–60000, `maxChars` 200–4096. Finite out-of-range values are clamped, nonfinite values use defaults. HTML escaping, labels, wrappers and truncation notes all fit the budget without splitting emoji surrogate pairs.
313
315
  - **Fallback**: only a definite HTML entity rejection switches to plain text, which persists for later edits in that turn. Unknown network outcomes, authentication failures and rate limits do not trigger a format-switch resend.
314
316
 
317
+ ### 5. Feishu thread session isolation (`threadSessions`)
318
+ - **Default**: disabled (`false`)
319
+ - **Description**: When enabled, message threads in Feishu group chats maintain independent sessions and conversation context bounded by their root message ID. When disabled, all threads share the main group session context.
320
+ - **UI Configuration**: Toggle **Thread session isolation** directly in **Settings → IM Assistant → Feishu / Lark Account Settings**; takes effect dynamically via account restart upon saving.
321
+ - **Example** (account or plugin configuration):
322
+ ```json
323
+ {
324
+ "threadSessions": "true"
325
+ }
326
+ ```
327
+
315
328
  ## Usage
316
329
 
317
330
  Open **Settings → IM Assistant**, select **Add account** under the target channel, then choose that account's workspace, model, permission, private-access mode, and send mode. To register a new workspace, click **Add workspace…** in the dropdown footer to invoke the system folder picker (manual path inputs are disallowed); hosts lacking native folder pickers show "This Host cannot create workspaces" (upgrade to one of the supported host releases listed in Requirements, or add via the host sidebar).
@@ -338,6 +351,8 @@ Open **Settings → IM Assistant**, select **Add account** under the target chan
338
351
  | Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
339
352
  | Answer an interactive question | Reply with an option number or text; separate multiple choices with commas, or enter a custom answer | Multiple questions arrive in order; only the initiating user can answer in a group |
340
353
  | Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
354
+ | Feishu thread isolation | Open Settings on the Feishu / Lark account row and toggle Thread session isolation | Group message threads maintain isolated sessions and context; disabled by default (shares group context) |
355
+ | Silent reply protocol | Include `NO_REPLY` or `<<<NO_REPLY>>>` in the model output | When the agent determines no reply is required, the plugin silently finishes the turn without sending fallback notice cards |
341
356
  | Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
342
357
 
343
358
  After `/workspace`, `/new` and continuing after archiving the current session keep the selected workspace and use the account model, Agent preset, and permission preset. `/session` and `/fork` preserve the original session configuration.
@@ -348,6 +363,18 @@ Explicitly binding a session with `/session` restores its output, including when
348
363
 
349
364
  DingTalk replies prefer official AI Card streaming. If card creation fails, plain text preserves line breaks; code fences and list markers remain literal. QQ replies use official markdown and keep headings, bold text, links, and tables; only a platform rejection falls back to plain text (where tables become lists). Telegram replies are sent as Rich Messages with Markdown so headings, bold text, and tables render, falling back to plain text when that method is unavailable; do not enable Webhook on the same bot. Feishu normal replies also use card Markdown, so headings and tables render; cards are split so none holds more than five tables, with a plain-text fallback. Long replies split with structure awareness: table chunks repeat the header, code fences are re-closed, and the `(n/m)` marker only prefixes prose chunks. `/help` is grouped as getting around / sessions and workspaces / models and reasoning / tasks and delivery, with one entry per feature and the usable aliases marked; group titles are bold while the rest of the command copy stays plain text, which keeps them scannable on a phone. Discord renders headings, bold text, code, and lists on the client but has no Markdown tables, and mobile clients cannot scroll horizontally, so pipe tables become a vertical block per row (first two columns as a bold title, remaining columns as `header: value`). Everything else is sent verbatim. Do not configure a Discord Interactions Endpoint URL, or button clicks will not arrive through the Gateway. Slack also has no Markdown tables and no `#` headings, so outgoing text is converted to mrkdwn: headings become a bold whole line, tables become the same vertical block, `**bold**` becomes `*bold*`, and links become `<url|label>`, while code fences stay untouched.
350
365
 
366
+ ### Feishu threads & interactive cards
367
+
368
+ - **Accurate thread replies**: When replying to specific messages or threads in Feishu group chats, the assistant precisely invokes Feishu's `reply` API targeting the root message ID, eliminating fallback drops into the group lobby.
369
+ - **Card message extraction**: Supports parsing Feishu interactive card content (recursively extracting text, buttons, and Markdown elements) with automatic safe truncation to prevent data loss.
370
+ - **In-thread card button callbacks**: Interactive card button clicks within a thread preserve full original thread context, ensuring approvals and option selections resolve inside the correct thread.
371
+
372
+ ### Silent reply protocol (`NO_REPLY`)
373
+
374
+ In group chats or automated workflows, when the agent decides no user-visible response is needed (e.g. routine background check passing, scheduled job completion, or mentions where speaking is unnecessary):
375
+ - The model outputs `NO_REPLY` or `<<<NO_REPLY>>>` (either standalone or as a trailing marker).
376
+ - The gateway detects the silent marker and finishes the turn silently, fully suppressing the "Processing completed with no deliverable result" placeholder card to keep chats clean.
377
+
351
378
  ### Telegram topic naming
352
379
 
353
380
  Telegram topics are automatically named once from the first non-fallback session title; later conversation titles do not keep changing the topic name. `/rename <title>` explicitly synchronizes the topic name. Ordinary chats are unaffected. The bot needs permission to rename the topic.
package/README.es.md CHANGED
@@ -101,7 +101,11 @@ Disponible desde el panel de administración en **Complementos → @michengai/ds
101
101
 
102
102
  ### 4. Mensaje de pensamiento plegable (`thinkingDisplay`)
103
103
  - **Predeterminado**: Desactivado (`off`)
104
- - **Función**: Envía la cadena de pensamiento del modelo en Telegram dentro de un bloque de cita plegable (`<blockquote expandable>`).
104
+ - **Función**: Envía la cadena de pensamiento del modelo en Telegram (`<blockquote expandable>`) y Feishu/Lark (proceso de pensamiento nativo o tarjeta plegable en hilos).
105
+
106
+ ### 5. Aislamiento de sesiones de hilos en Feishu (`threadSessions`)
107
+ - **Predeterminado**: Desactivado (`false`)
108
+ - **Función**: Cuando está habilitado, los hilos de respuesta en grupos de Feishu mantienen sesiones y contextos independientes basados en el ID del mensaje raíz. De forma predeterminada, todos los hilos comparten el contexto del grupo.
105
109
 
106
110
  ## Uso y comandos
107
111
 
@@ -118,6 +122,20 @@ Abra **Configuración → Asistente IM**, elija **Añadir cuenta** en el canal d
118
122
  | Modelo y razonamiento | `/models`, `/model <nombre>`, `/reasoning [nivel]` | Ajusta el modelo y esfuerzo de razonamiento |
119
123
  | Gestión de sesiones | `/sessions`, `/session <número/ID>`, `/rename <título>`, `/fork` | Lista, cambia, renombra o bifurca sesiones |
120
124
  | Recuperación de entregas | `/delivery`, `/delivery retry <ID>` | Reenvía mensajes que fallaron por desconexión |
125
+ | Aislamiento de hilos | Activar en la configuración de la cuenta de Feishu / Lark | Mantiene los hilos de respuesta en contextos aislados (predeterminado: desactivado) |
126
+ | Respuesta silenciosa | `NO_REPLY` o `<<<NO_REPLY>>>` en la salida del modelo | Finaliza el turno en silencio sin tarjetas de notificación de marcador de posición |
127
+
128
+ ### Hilos de Feishu y tarjetas interactivas
129
+
130
+ - **Respuestas precisas en hilos**: Utiliza con precisión la API `reply` de Feishu dirigida al ID del mensaje raíz, evitando que las respuestas caigan en el chat general.
131
+ - **Extracción de tarjetas**: Extrae texto y botones de tarjetas interactivas de Feishu con truncamiento seguro automático.
132
+ - **Retorno de botones en hilos**: Las pulsaciones de botones de tarjetas interactivas dentro de un hilo preservan el contexto original para aprobaciones y selecciones.
133
+
134
+ ### Protocolo de respuesta silenciosa (`NO_REPLY`)
135
+
136
+ Cuando el agente determina que no se requiere una respuesta visible para el usuario:
137
+ - El modelo emite `NO_REPLY` o `<<<NO_REPLY>>>`.
138
+ - La pasarela suprime por completo las tarjetas de aviso ("Procesamiento completado sin resultado").
121
139
 
122
140
  ### Nombres automáticos de temas en Telegram
123
141
 
package/README.fr.md CHANGED
@@ -101,7 +101,11 @@ Gérée depuis le panneau **Extensions → @michengai/dsh-im-connect** :
101
101
 
102
102
  ### 4. Affichage repliable de la réflexion (`thinkingDisplay`)
103
103
  - **Défaut** : Désactivé (`off`)
104
- - **Fonction** : Transmet le cheminement de pensée du modèle sous forme de bloc de citation repliable Telegram (`<blockquote expandable>`).
104
+ - **Fonction** : Transmet le cheminement de pensée du modèle sous forme de bloc de citation repliable Telegram (`<blockquote expandable>`) ou de bulle native / carte repliable Feishu/Lark.
105
+
106
+ ### 5. Isolation des sessions de fil Feishu (`threadSessions`)
107
+ - **Défaut** : Désactivé (`false`)
108
+ - **Fonction** : Lorsqu'activé, les fils de réponse (threads) dans les groupes Feishu conservent des sessions et contextes indépendants basés sur l'ID du message racine. Par défaut, tous les fils partagent le contexte du groupe.
105
109
 
106
110
  ## Utilisation et commandes
107
111
 
@@ -118,6 +122,20 @@ Ouvrez **Paramètres → Assistant IM**, cliquez sur **Ajouter un compte** et co
118
122
  | Modèle et raisonnement | `/models`, `/model <nom>`, `/reasoning [niveau]` | Ajuste dynamiquement le modèle |
119
123
  | Gestion des sessions | `/sessions`, `/session <numéro/ID>`, `/rename <titre>`, `/fork` | Liste, bascule, renomme ou duplique une session |
120
124
  | Récupération des envois | `/delivery`, `/delivery retry <ID>` | Réexpédie les messages interrompus |
125
+ | Isolation de fil | À activer dans les paramètres du compte Feishu / Lark | Isole les fils de réponse dans des contextes distincts (désactivé par défaut) |
126
+ | Réponse silencieuse | `NO_REPLY` ou `<<<NO_REPLY>>>` dans la sortie du modèle | Termine le tour en silence sans cartes d'avertissement inutiles |
127
+
128
+ ### Fils de discussion Feishu et cartes interactives
129
+
130
+ - **Réponses précises dans les fils** : Utilise précisément l'API `reply` de Feishu ciblant l'ID du message racine, évitant que les messages ne retombent dans le fil général du groupe.
131
+ - **Extraction des cartes** : Extrait le texte et les boutons des cartes interactives Feishu avec troncature sécurisée automatique.
132
+ - **Rappels des boutons dans les fils** : Les clics sur les boutons de carte interactive au sein d'un fil conservent le contexte d'origine pour les approbations et sélections.
133
+
134
+ ### Protocole de réponse silencieuse (`NO_REPLY`)
135
+
136
+ Lorsque l'agent décide qu'aucune réponse visible n'est nécessaire pour l'utilisateur :
137
+ - Le modèle émet `NO_REPLY` ou `<<<NO_REPLY>>>`.
138
+ - La passerelle supprime totalement les cartes d'avertissement (« Traitement terminé sans résultat »).
121
139
 
122
140
  ### Titrage automatique des sujets Telegram
123
141
 
package/README.ja.md CHANGED
@@ -158,7 +158,12 @@ dsh plugin --profile web add @michengai/dsh-im-connect --registry=https://regist
158
158
 
159
159
  ### 4. 思考プロセスの折りたたみ表示 (`thinkingDisplay`)
160
160
  - **デフォルト**: オフ (`off`)
161
- - **機能**: モデルの思考プロセスを Telegram の折りたたみ引用ブロック(`<blockquote expandable>`)として送信し、タップで展開できるようにします。
161
+ - **機能**: モデルの思考プロセスを Telegram(折りたたみ引用ブロック `<blockquote expandable>`)および Feishu/Lark(ネイティブ思考プロセスおよびスレッド内カード折りたたみ)として送信し、タップで展開できるようにします。
162
+
163
+ ### 5. 飛書(Feishu)スレッドセッション分離 (`threadSessions`)
164
+ - **デフォルト**: 無効 (`false`)
165
+ - **機能**: 有効にすると、飛書グループ内のスレッド(Thread)ごとに独立したセッションとコンテキストが保持されます。無効時はグループ全体で1つのセッションを共有します。
166
+ - **UI 設定**: 「設定 → IM アシスタント → 飛書 / Lark アカウント設定」から「スレッドセッション分離」を切り替えられます。
162
167
 
163
168
  ## 使用方法
164
169
 
@@ -177,6 +182,20 @@ dsh plugin --profile web add @michengai/dsh-im-connect --registry=https://regist
177
182
  | モデル / 推論 | `/models`, `/model <名前>`, `/reasoning [強度]` | モデルおよび推論強度の動的変更 |
178
183
  | セッション管理 | `/sessions`, `/session <番号/ID>`, `/rename <名前>`, `/fork` | セッション一覧、切り替え、名前変更、分岐 |
179
184
  | 配信復旧 | `/delivery`, `/delivery retry <ID>` | 配信失敗メッセージの再送 |
185
+ | スレッド分離 | 飛書 / Lark アカウント設定で「スレッドセッション分離」を有効化 | グループ返信スレッドごとに独立したコンテキストを保持(デフォルト無効) |
186
+ | 静黙応答プロトコル | モデル出力に `NO_REPLY` または `<<<NO_REPLY>>>` を含める | 応答不要と判断した場合、プレースホルダー通知を送らず静かにターンを完了 |
187
+
188
+ ### 飛書スレッドとインタラクティブカード
189
+
190
+ - **スレッド返信**: 飛書グループ内の特定メッセージやスレッドに返信する際、ルートメッセージIDを対象として正確にスレッド内へ返信します。
191
+ - **カードメッセージ解析**: 飛書のインタラクティブカードメッセージのテキストを再帰的に抽出し、安全に長文を切り詰めます。
192
+ - **スレッド内ボタンコールバック**: スレッド内のカードボタン操作時も元のスレッドコンテキストを維持し、承認や選択が確実にスレッド内へ反映されます。
193
+
194
+ ### 静黙応答プロトコル (`NO_REPLY`)
195
+
196
+ グループチャットや自動化タスクにおいて、エージェントがユーザーへの返信テキストが不要と判断した場合(定期チェック合格時や発言不要のメンション時など):
197
+ - モデル出力に `NO_REPLY` または `<<<NO_REPLY>>>` を指定します。
198
+ - ゲートウェイがこの静黙マーカーを検知すると、ターンを静かに終了し、「処理が完了しましたが配信可能な結果がありませんでした」という通知カードの送信を完全に抑制します。
180
199
 
181
200
  ### Telegram トピック命名
182
201
 
package/README.md CHANGED
@@ -297,7 +297,9 @@ dsh --profile web --dump-config
297
297
 
298
298
  ### 4. 思考过程折叠消息 (`thinkingDisplay`)
299
299
  - **默认状态**:关闭(`mode: 'off'`)
300
- - **功能说明**:开启后,模型的思考过程会单独发成一条 Telegram「可折叠引用块」消息(`<blockquote expandable>`),默认只显示约三行,点「显示更多」展开;同一回合就地编辑,回合结束时标题变为「🧠 思考过程」。
300
+ - **功能说明**:开启后,模型的思考过程会单独呈现:
301
+ - **Telegram**:发成一条「可折叠引用块」消息(`<blockquote expandable>`),默认显示约三行,点「显示更多」展开;同一回合就地编辑,回合结束时标题变为「🧠 思考过程」。
302
+ - **飞书 / Lark**:私聊与群大厅普通消息走飞书官方原生思考过程气泡(`/open-apis/im/v1/message_cot`);群话题回复串(Thread)或租户无原生 CoT 权限时自动平滑降级为飞书交互卡片折叠面板(`collapsible_panel`),确保过程绝不出串污染群大厅。
301
303
  - **配置示例**(插件配置槽位):
302
304
  ```yaml
303
305
  thinkingDisplay:
@@ -306,12 +308,23 @@ dsh --profile web --dump-config
306
308
  intervalMs: 2000 # 两次刷新的最小间隔
307
309
  maxChars: 3500 # 单条上限,超出截断并注明
308
310
  ```
309
- - **渠道与界面支持**:目前由 Telegram 实现,可在「设置 → IM助理 → Telegram 账号」中通过「展示思考过程」下拉选择「折叠展示」一键开启;其他渠道会忽略该配置,只保留原有状态行。
311
+ - **渠道与界面支持**:目前由 Telegram、飞书与 Lark 实现,可在「设置 → IM助理 → 账号详情」中通过「展示思考过程」下拉选择「折叠展示」一键开启;其他渠道会忽略该配置,只保留原有状态行。
310
312
  - **边界与隐私**:折叠是客户端展示,不是访问控制,群内所有能看到消息的人均能点击展开思考内容。请只在明确允许公开展示思维链的部署中开启;思考消息不会被算作最终答案的送达或自动补发内容。
311
313
  - **资源与生命周期**:关闭或渠道不支持时不缓存思考原文;开启时每回合最多保留 4096 个 UTF-16 单元的前缀和总字数。刷新合并为最新快照,停止、换绑、静音、卸载及下一回合会阻止过期输出。
312
314
  - **参数范围**:`minChars` 为 0–4096(结束时同样适用),`intervalMs` 为 1000–60000,`maxChars` 为 200–4096;超界值收敛到范围,非有限数字使用默认值。实际 HTML 转义、标题、标签与截断提示均计入预算,不切开 emoji 代理对。
313
315
  - **格式降级**:仅在平台明确拒绝 HTML 实体时切到纯文本,并在该回合后续编辑中保持纯文本;网络结果不明、鉴权失败、限流不会通过换格式重发绕过。
314
316
 
317
+ ### 5. 飞书群回复串会话隔离 (`threadSessions`)
318
+ - **默认状态**:关闭(`false`)
319
+ - **功能说明**:开启后,飞书群聊中的消息回复串(Thread / 话题)将以根消息 ID 为边界建立独立的会话与上下文;关闭时,群聊内所有回复串与大厅消息共享同一个群聊会话上下文。
320
+ - **界面配置**:在「设置 → IM助理 → 飞书 / Lark 账号设置」中,可直接切换「群回复串会话隔离」开关,保存后动态重启账号生效。
321
+ - **配置示例**(账号配置或插件配置):
322
+ ```json
323
+ {
324
+ "threadSessions": "true"
325
+ }
326
+ ```
327
+
315
328
  ## 使用
316
329
 
317
330
  打开「设置 → IM助理」,在目标渠道点击「添加账号」,并为该账号选择工作区、模型、权限、私聊准入和发送方式。若需要新工作区,可展开工作区下拉列表点击底部的「添加工作区…」直接调起系统文件选择器(禁止手输路径);不支持原生目录选择器的宿主会提示「当前 Host 无法新增工作区」,请升级到「环境要求」中列出的受支持宿主版本,或直接在宿主侧栏添加工作区。
@@ -338,10 +351,24 @@ dsh --profile web --dump-config
338
351
  | 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
339
352
  | 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
340
353
  | 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
354
+ | 飞书回复串隔离 | 点击飞书 / Lark 账号右侧「设置」,在弹窗中打开「群回复串会话隔离」 | 开启后群聊回复串按话题独立隔离会话与上下文;默认关闭(保持大厅共享上下文) |
355
+ | 静默回复协议 | 在模型输出中包含 `NO_REPLY` 或 `<<<NO_REPLY>>>` | 当 Agent 判断当前场景无需向用户回复时,插件静默完成回合,不发送「未返回可投递的结果」占位卡片 |
341
356
  | 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
342
357
 
343
358
  通过 `/workspace` 新建后,`/new` 和当前会话归档后的续聊会保留所选工作区,并使用账号配置的模型、Agent 与权限预设。`/session` 接续已有会话、`/fork` 分叉则保留原会话配置。
344
359
 
360
+ ### 飞书话题与卡片消息
361
+
362
+ - **话题精准回复**:在飞书群聊中回复特定消息或话题串时,助手会精准使用飞书 `reply` 接口将消息回复至原话题(以根消息 ID 为目标),杜绝因误用话题 ID 回退至群大厅公屏的问题。
363
+ - **卡片消息解析**:支持解析飞书 interactive 富文本卡片消息内容(递归提取卡片内的文本、按钮及 Markdown 元素),超长卡片内容自动安全截断,避免消息丢失。
364
+ - **话题内卡片按钮回调**:在话题串内点击交互卡片按钮时,回调事件完整保留原始话题上下文,审批或交互选择精准落串生效。
365
+
366
+ ### 静默回复协议 (`NO_REPLY`)
367
+
368
+ 在群聊或自动化工作流中,如果 Agent 处理完毕后判断无需向聊天发送任何可见文本(例如心跳巡检无异常、后台定时完成或在群聊中被提到但无需公开发言):
369
+ - 模型可输出 `NO_REPLY` 或 `<<<NO_REPLY>>>`(可单独输出或作为回复末尾标记)。
370
+ - 网关检测到静默标记后,将自动静默收口当前回合,彻底抑制「本次处理已结束,未返回可投递的结果」兜底提示卡片,保持聊天界面整洁安静。
371
+
345
372
  ### Telegram 话题命名
346
373
 
347
374
  Telegram 话题默认使用第一条非兜底会话标题自动命名一次,之后不会随对话频繁变化。`/rename <名称>` 会显式同步话题名;普通聊天不受影响。机器人需要拥有该话题的改名权限。
package/README.pt.md CHANGED
@@ -101,7 +101,11 @@ Acessível no painel em **Plugins → @michengai/dsh-im-connect**:
101
101
 
102
102
  ### 4. Bloco recolhível de raciocínio (`thinkingDisplay`)
103
103
  - **Padrão**: Desativado (`off`)
104
- - **Função**: Envia a cadeia de pensamento no Telegram dentro de uma citação expansível (`<blockquote expandable>`).
104
+ - **Função**: Envia a cadeia de pensamento no Telegram (`<blockquote expandable>`) e Feishu/Lark (processo nativo de pensamento ou cartão recolhível em tópicos).
105
+
106
+ ### 5. Isolamento de sessões de tópicos no Feishu (`threadSessions`)
107
+ - **Padrão**: Desativado (`false`)
108
+ - **Função**: Quando ativado, os tópicos de resposta em grupos do Feishu mantêm sessões e contextos isolados baseados no ID da mensagem raiz. Por padrão, todos os tópicos compartilham o contexto do grupo.
105
109
 
106
110
  ## Uso e comandos
107
111
 
@@ -118,6 +122,20 @@ Abra **Configurações → Assistente IM**, clique em **Adicionar conta** e conf
118
122
  | Modelo e raciocínio | `/models`, `/model <nome>`, `/reasoning [nível]` | Ajusta o modelo dinamicamente |
119
123
  | Gerenciar sessões | `/sessions`, `/session <número/ID>`, `/rename <título>`, `/fork` | Lista, alterna, renomeia ou duplica sessões |
120
124
  | Recuperação de envio | `/delivery`, `/delivery retry <ID>` | Reenvia mensagens interrompidas |
125
+ | Isolamento de tópicos | Ativar nas configurações da conta Feishu / Lark | Mantém os tópicos de resposta em contextos isolados (padrão: desativado) |
126
+ | Resposta silenciosa | `NO_REPLY` ou `<<<NO_REPLY>>>` na saída do modelo | Finaliza o turno silenciosamente sem cartões de aviso |
127
+
128
+ ### Tópicos do Feishu e cartões interativos
129
+
130
+ - **Respostas precisas em tópicos**: Utiliza com precisão a API `reply` do Feishu direcionada ao ID da mensagem raiz, evitando que as mensagens caiam no chat principal.
131
+ - **Extração de cartões**: Extrai texto e botões de cartões interativos do Feishu com truncamento seguro automático.
132
+ - **Retorno de botões em tópicos**: Os cliques em botões de cartões interativos dentro de um tópico preservam o contexto original para aprovações e seleções.
133
+
134
+ ### Protocolo de resposta silenciosa (`NO_REPLY`)
135
+
136
+ Quando o agente decide que nenhuma resposta visível ao usuário é necessária:
137
+ - O modelo emite `NO_REPLY` ou `<<<NO_REPLY>>>`.
138
+ - O gateway suprime totalmente os cartões de aviso ("Processamento concluído sem resultado").
121
139
 
122
140
  ### Nomenclatura automática de tópicos no Telegram
123
141
 
package/README.ru.md CHANGED
@@ -101,7 +101,11 @@
101
101
 
102
102
  ### 4. Сворачиваемый блок цепочки мыслей (`thinkingDisplay`)
103
103
  - **По умолчанию**: Отключено (`off`)
104
- - **Назначение**: Передает процесс рассуждений модели в Telegram в виде сворачиваемой цитаты (`<blockquote expandable>`).
104
+ - **Назначение**: Передает процесс рассуждений модели в Telegram (сворачиваемая цитата `<blockquote expandable>`) и Feishu/Lark (нативный процесс CoT или сворачиваемая карточка в тредах).
105
+
106
+ ### 5. Изоляция сессий тредов в Feishu (`threadSessions`)
107
+ - **По умолчанию**: Отключено (`false`)
108
+ - **Назначение**: При включении ветки ответов (треды) в группах Feishu изолируются в отдельные сессии и контексты по идентификатору корневого сообщения. По умолчанию все треды используют общий контекст группы.
105
109
 
106
110
  ## Использование и команды
107
111
 
@@ -118,6 +122,20 @@
118
122
  | Модель и размышления | `/models`, `/model <имя>`, `/reasoning [уровень]` | Динамически настраивает модель |
119
123
  | Управление сессиями | `/sessions`, `/session <номер/ID>`, `/rename <имя>`, `/fork` | Список, смена, переименование или ветвление сессий |
120
124
  | Повтор отправки | `/delivery`, `/delivery retry <ID>` | Повторно отправляет прерванные сообщения |
125
+ | Изоляция тредов | Включить в настройках аккаунта Feishu / Lark | Изолирует ветки ответов в отдельные сессии (по умолчанию: выкл.) |
126
+ | Тихий ответ | `NO_REPLY` или `<<<NO_REPLY>>>` в выводе модели | Завершает ход без отправки лишних карточек-заглушек |
127
+
128
+ ### Треды Feishu и интерактивные карточки
129
+
130
+ - **Точные ответы в тредах**: Использует API `reply` Feishu с указанием ID корневого сообщения, предотвращая случайный сброс ответов в общий чат.
131
+ - **Извлечение содержимого карточек**: Извлекает текст и кнопки интерактивных карточек Feishu с автоматической безопасной обрезкой.
132
+ - **Обработка нажатий кнопок в треде**: Нажатия кнопок карточек внутри треда сохраняют исходный контекст для утверждений и выбора вариантов.
133
+
134
+ ### Протокол тихого ответа (`NO_REPLY`)
135
+
136
+ Если агент решает, что отправка видимого ответа пользователю не требуется:
137
+ - Модель выводит `NO_REPLY` или `<<<NO_REPLY>>>`.
138
+ - Шлюз полностью подавляет отправку служебных карточек («Обработка завершена, результат отсутствует»).
121
139
 
122
140
  ### Автоматическое именование тем в Telegram
123
141
 
package/README.zh-CN.md CHANGED
@@ -297,7 +297,9 @@ dsh --profile web --dump-config
297
297
 
298
298
  ### 4. 思考过程折叠消息 (`thinkingDisplay`)
299
299
  - **默认状态**:关闭(`mode: 'off'`)
300
- - **功能说明**:开启后,模型的思考过程会单独发成一条 Telegram「可折叠引用块」消息(`<blockquote expandable>`),默认只显示约三行,点「显示更多」展开;同一回合就地编辑,回合结束时标题变为「🧠 思考过程」。
300
+ - **功能说明**:开启后,模型的思考过程会单独呈现:
301
+ - **Telegram**:发成一条「可折叠引用块」消息(`<blockquote expandable>`),默认显示约三行,点「显示更多」展开;同一回合就地编辑,回合结束时标题变为「🧠 思考过程」。
302
+ - **飞书 / Lark**:私聊与群大厅普通消息走飞书官方原生思考过程气泡(`/open-apis/im/v1/message_cot`);群话题回复串(Thread)或租户无原生 CoT 权限时自动平滑降级为飞书交互卡片折叠面板(`collapsible_panel`),确保过程绝不出串污染群大厅。
301
303
  - **配置示例**(插件配置槽位):
302
304
  ```yaml
303
305
  thinkingDisplay:
@@ -306,12 +308,23 @@ dsh --profile web --dump-config
306
308
  intervalMs: 2000 # 两次刷新的最小间隔
307
309
  maxChars: 3500 # 单条上限,超出截断并注明
308
310
  ```
309
- - **渠道与界面支持**:目前由 Telegram 实现,可在「设置 → IM助理 → Telegram 账号」中通过「展示思考过程」下拉选择「折叠展示」一键开启;其他渠道会忽略该配置,只保留原有状态行。
311
+ - **渠道与界面支持**:目前由 Telegram、飞书与 Lark 实现,可在「设置 → IM助理 → 账号详情」中通过「展示思考过程」下拉选择「折叠展示」一键开启;其他渠道会忽略该配置,只保留原有状态行。
310
312
  - **边界与隐私**:折叠是客户端展示,不是访问控制,群内所有能看到消息的人均能点击展开思考内容。请只在明确允许公开展示思维链的部署中开启;思考消息不会被算作最终答案的送达或自动补发内容。
311
313
  - **资源与生命周期**:关闭或渠道不支持时不缓存思考原文;开启时每回合最多保留 4096 个 UTF-16 单元的前缀和总字数。刷新合并为最新快照,停止、换绑、静音、卸载及下一回合会阻止过期输出。
312
314
  - **参数范围**:`minChars` 为 0–4096(结束时同样适用),`intervalMs` 为 1000–60000,`maxChars` 为 200–4096;超界值收敛到范围,非有限数字使用默认值。实际 HTML 转义、标题、标签与截断提示均计入预算,不切开 emoji 代理对。
313
315
  - **格式降级**:仅在平台明确拒绝 HTML 实体时切到纯文本,并在该回合后续编辑中保持纯文本;网络结果不明、鉴权失败、限流不会通过换格式重发绕过。
314
316
 
317
+ ### 5. 飞书群回复串会话隔离 (`threadSessions`)
318
+ - **默认状态**:关闭(`false`)
319
+ - **功能说明**:开启后,飞书群聊中的消息回复串(Thread / 话题)将以根消息 ID 为边界建立独立的会话与上下文;关闭时,群聊内所有回复串与大厅消息共享同一个群聊会话上下文。
320
+ - **界面配置**:在「设置 → IM助理 → 飞书 / Lark 账号设置」中,可直接切换「群回复串会话隔离」开关,保存后动态重启账号生效。
321
+ - **配置示例**(账号配置或插件配置):
322
+ ```json
323
+ {
324
+ "threadSessions": "true"
325
+ }
326
+ ```
327
+
315
328
  ## 使用
316
329
 
317
330
  打开「设置 → IM助理」,在目标渠道点击「添加账号」,并为该账号选择工作区、模型、权限、私聊准入和发送方式。若需要新工作区,可展开工作区下拉列表点击底部的「添加工作区…」直接调起系统文件选择器(禁止手输路径);不支持原生目录选择器的宿主会提示「当前 Host 无法新增工作区」,请升级到「环境要求」中列出的受支持宿主版本,或直接在宿主侧栏添加工作区。
@@ -338,10 +351,24 @@ dsh --profile web --dump-config
338
351
  | 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
339
352
  | 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
340
353
  | 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
354
+ | 飞书回复串隔离 | 点击飞书 / Lark 账号右侧「设置」,在弹窗中打开「群回复串会话隔离」 | 开启后群聊回复串按话题独立隔离会话与上下文;默认关闭(保持大厅共享上下文) |
355
+ | 静默回复协议 | 在模型输出中包含 `NO_REPLY` 或 `<<<NO_REPLY>>>` | 当 Agent 判断当前场景无需向用户回复时,插件静默完成回合,不发送「未返回可投递的结果」占位卡片 |
341
356
  | 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
342
357
 
343
358
  通过 `/workspace` 新建后,`/new` 和当前会话归档后的续聊会保留所选工作区,并使用账号配置的模型、Agent 与权限预设。`/session` 接续已有会话、`/fork` 分叉则保留原会话配置。
344
359
 
360
+ ### 飞书话题与卡片消息
361
+
362
+ - **话题精准回复**:在飞书群聊中回复特定消息或话题串时,助手会精准使用飞书 `reply` 接口将消息回复至原话题(以根消息 ID 为目标),杜绝因误用话题 ID 回退至群大厅公屏的问题。
363
+ - **卡片消息解析**:支持解析飞书 interactive 富文本卡片消息内容(递归提取卡片内的文本、按钮及 Markdown 元素),超长卡片内容自动安全截断,避免消息丢失。
364
+ - **话题内卡片按钮回调**:在话题串内点击交互卡片按钮时,回调事件完整保留原始话题上下文,审批或交互选择精准落串生效。
365
+
366
+ ### 静默回复协议 (`NO_REPLY`)
367
+
368
+ 在群聊或自动化工作流中,如果 Agent 处理完毕后判断无需向聊天发送任何可见文本(例如心跳巡检无异常、后台定时完成或在群聊中被提到但无需公开发言):
369
+ - 模型可输出 `NO_REPLY` 或 `<<<NO_REPLY>>>`(可单独输出或作为回复末尾标记)。
370
+ - 网关检测到静默标记后,将自动静默收口当前回合,彻底抑制「本次处理已结束,未返回可投递的结果」兜底提示卡片,保持聊天界面整洁安静。
371
+
345
372
  ### Telegram 话题命名
346
373
 
347
374
  Telegram 话题默认使用第一条非兜底会话标题自动命名一次,之后不会随对话频繁变化。`/rename <名称>` 会显式同步话题名;普通聊天不受影响。机器人需要拥有该话题的改名权限。
package/client.js CHANGED
@@ -653,6 +653,8 @@ window.__ModuleLoader__.load({
653
653
  "account.telegramThinkingDisplayCollapsed": "折叠展示",
654
654
  "account.telegramThinkingDisplayNote": "开启后,模型的思考过程会以可折叠引用块单独发送,点击可展开查看。群聊中所有成员均可展开,请在允许分享思考的部署开启。",
655
655
  "account.telegramThinkingDisplayOff": "关闭",
656
+ "account.threadSessions": "群回复串会话隔离",
657
+ "account.threadSessionsNote": "开启后飞书群聊回复串将按话题独立会话与上下文;默认关闭。",
656
658
  "account.workspace": "工作区",
657
659
  "action.addAccount": "添加账号",
658
660
  "action.approve": "批准",
@@ -955,6 +957,8 @@ window.__ModuleLoader__.load({
955
957
  "account.telegramThinkingDisplayCollapsed": "Collapsed",
956
958
  "account.telegramThinkingDisplayNote": "When enabled, reasoning is sent as an expandable quote block that users can tap to expand. All group members can view expanded reasoning.",
957
959
  "account.telegramThinkingDisplayOff": "Off",
960
+ "account.threadSessions": "Thread session isolation",
961
+ "account.threadSessionsNote": "When enabled, group message threads are isolated into separate sessions; disabled by default.",
958
962
  "account.workspace": "Workspace",
959
963
  "action.addAccount": "Add account",
960
964
  "action.approve": "Approve",
@@ -1257,6 +1261,8 @@ window.__ModuleLoader__.load({
1257
1261
  "account.telegramThinkingDisplayCollapsed": "折りたたみ表示",
1258
1262
  "account.telegramThinkingDisplayNote": "有効にすると、思考過程が折りたたみ可能な引用ブロックとして送信され、タップして展開できます。グループ内の全員が展開して閲覧可能です。",
1259
1263
  "account.telegramThinkingDisplayOff": "オフ",
1264
+ "account.threadSessions": "スレッドセッション分離",
1265
+ "account.threadSessionsNote": "有効にすると、グループ返信スレッドごとに独立したセッションとコンテキストが保持されます。デフォルトは無効です。",
1260
1266
  "account.workspace": "ワークスペース",
1261
1267
  "action.addAccount": "アカウントを追加",
1262
1268
  "action.approve": "承認",
@@ -1559,6 +1565,8 @@ window.__ModuleLoader__.load({
1559
1565
  "account.telegramThinkingDisplayCollapsed": "Plegado",
1560
1566
  "account.telegramThinkingDisplayNote": "Cuando está habilitado, el razonamiento se envía como un bloque de cita desplegable que los usuarios pueden tocar para expandir. Todos los miembros pueden verlo.",
1561
1567
  "account.telegramThinkingDisplayOff": "Desactivado",
1568
+ "account.threadSessions": "Aislamiento de sesiones de hilos",
1569
+ "account.threadSessionsNote": "Al activarse, los hilos de mensajes en grupos se aíslan en sesiones independientes; desactivado por defecto.",
1562
1570
  "account.workspace": "Espacio de trabajo",
1563
1571
  "action.addAccount": "Añadir cuenta",
1564
1572
  "action.approve": "Aprobar",
@@ -1861,6 +1869,8 @@ window.__ModuleLoader__.load({
1861
1869
  "account.telegramThinkingDisplayCollapsed": "Replié",
1862
1870
  "account.telegramThinkingDisplayNote": "Si activé, le raisonnement est envoyé sous forme de bloc de citation pliable pouvant être déroulé au toucher. Visible par tous les membres du groupe.",
1863
1871
  "account.telegramThinkingDisplayOff": "Désactivé",
1872
+ "account.threadSessions": "Isolation des sessions de fil",
1873
+ "account.threadSessionsNote": "Une fois activé, les fils de messages de groupe sont isolés dans des sessions distinctes ; désactivé par défaut.",
1864
1874
  "account.workspace": "Espace de travail",
1865
1875
  "action.addAccount": "Ajouter un compte",
1866
1876
  "action.approve": "Approuver",
@@ -2163,6 +2173,8 @@ window.__ModuleLoader__.load({
2163
2173
  "account.telegramThinkingDisplayCollapsed": "Eingeklappt",
2164
2174
  "account.telegramThinkingDisplayNote": "Wenn aktiviert, wird das Reasoning als einklappbarer Zitatblock gesendet, der angetippt werden kann. Alle Gruppenmitglieder können ihn einsehen.",
2165
2175
  "account.telegramThinkingDisplayOff": "Aus",
2176
+ "account.threadSessions": "Thread-Sitzungsisolation",
2177
+ "account.threadSessionsNote": "Wenn aktiviert, werden Gruppen-Nachrichten-Threads in separate Sitzungen isoliert; standardmäßig deaktiviert.",
2166
2178
  "account.workspace": "Arbeitsbereich",
2167
2179
  "action.addAccount": "Konto hinzufügen",
2168
2180
  "action.approve": "Genehmigen",
@@ -2465,6 +2477,8 @@ window.__ModuleLoader__.load({
2465
2477
  "account.telegramThinkingDisplayCollapsed": "Свернуто",
2466
2478
  "account.telegramThinkingDisplayNote": "Если включено, ход мыслей отправляется в виде сворачиваемого цитатного блока. Все участники группы могут развернуть и просмотреть его.",
2467
2479
  "account.telegramThinkingDisplayOff": "Выкл",
2480
+ "account.threadSessions": "Изоляция сессий тредов",
2481
+ "account.threadSessionsNote": "При включении цепочки ответов в группах изолируются в отдельные сессии; по умолчанию выключено.",
2468
2482
  "account.workspace": "Рабочая область",
2469
2483
  "action.addAccount": "Добавить аккаунт",
2470
2484
  "action.approve": "Одобрить",
@@ -2766,7 +2780,9 @@ window.__ModuleLoader__.load({
2766
2780
  "account.telegramThinkingDisplay": "Exibir processo de pensamento",
2767
2781
  "account.telegramThinkingDisplayCollapsed": "Recolhido",
2768
2782
  "account.telegramThinkingDisplayNote": "Quando ativado, o raciocínio é enviado como um bloco de citação expansível que pode ser aberto com um toque. Visível para todos no grupo.",
2769
- "account.telegramThinkingDisplayOff": "Desativado",
2783
+ "account.telegramThinkingDisplayOff": "Desactivado",
2784
+ "account.threadSessions": "Isolamento de sessões de tópicos",
2785
+ "account.threadSessionsNote": "Quando ativado, os tópicos de mensagens em grupos são isolados em sessões separadas; desativado por padrão.",
2770
2786
  "account.workspace": "Espaço de trabalho",
2771
2787
  "action.addAccount": "Adicionar conta",
2772
2788
  "action.approve": "Aprovar",
@@ -4560,7 +4576,7 @@ body:not([data-ds-dark-theme]) .ima-section-card{background:var(--dsw-alias-bg-l
4560
4576
  setDraft(account);
4561
4577
  setProxyModeDraft(account.proxyMode || "inherit");
4562
4578
  setNote("");
4563
- }, [account.id, account.cwd, account.permission, account.agentPreset, account.privateAccess, account.sendMode, account.sessionIdleMinutes, account.segmentReply, account.segmentDelayMinSecs, account.segmentDelayMaxSecs, account.proxyMode, account.proxyConfigured, JSON.stringify(account.commandPermissions), account.receiveEnabled, account.assistant && account.assistant.provider, account.assistant && account.assistant.model, account.assistant && account.assistant.reasoningEffort, account.thinkingDisplay]);
4579
+ }, [account.id, account.cwd, account.permission, account.agentPreset, account.privateAccess, account.sendMode, account.sessionIdleMinutes, account.segmentReply, account.segmentDelayMinSecs, account.segmentDelayMaxSecs, account.proxyMode, account.proxyConfigured, JSON.stringify(account.commandPermissions), account.receiveEnabled, account.threadSessions, account.assistant && account.assistant.provider, account.assistant && account.assistant.model, account.assistant && account.assistant.reasoningEffort, account.thinkingDisplay]);
4564
4580
  useEffect(() => {
4565
4581
  if (accountIdRef.current !== account.id) {
4566
4582
  accountIdRef.current = account.id;
@@ -4610,6 +4626,11 @@ body:not([data-ds-dark-theme]) .ima-section-card{background:var(--dsw-alias-bg-l
4610
4626
  payload.thinkingDisplay = patch.thinkingDisplay;
4611
4627
  }
4612
4628
  }
4629
+ if (account.platform === "feishu" || account.platform === "lark") {
4630
+ if (Object.prototype.hasOwnProperty.call(patch, "threadSessions")) {
4631
+ payload.threadSessions = patch.threadSessions;
4632
+ }
4633
+ }
4613
4634
  return onSave(account.id, payload).then((ok) => {
4614
4635
  if (seq === saveSeq.current) setNote(ok ? "status.saved" : "error.save");
4615
4636
  return ok;
@@ -4650,7 +4671,7 @@ body:not([data-ds-dark-theme]) .ima-section-card{background:var(--dsw-alias-bg-l
4650
4671
  h(AccountSettingsPicker, {
4651
4672
  value: draft,
4652
4673
  onChange: applySettings,
4653
- thinkingDisplaySupported: account.platform === "telegram",
4674
+ thinkingDisplaySupported: account.platform === "telegram" || account.platform === "feishu" || account.platform === "lark",
4654
4675
  segmentReplySupported: account.segmentReplySupported !== false,
4655
4676
  catalog,
4656
4677
  permissions,
@@ -4749,6 +4770,22 @@ body:not([data-ds-dark-theme]) .ima-section-card{background:var(--dsw-alias-bg-l
4749
4770
  })(),
4750
4771
  h("div", { className: "ima-picker-note" }, t("account.telegramGroupPolicyNote")),
4751
4772
  ),
4773
+ (account.platform === "feishu" || account.platform === "lark") && h("div", { className: "ima-thread-sessions-settings" },
4774
+ h("div", { className: "ima-picker-field wide" },
4775
+ h("span", { className: "ima-picker-label" }, t("account.threadSessions")),
4776
+ h(Switch, {
4777
+ role: "switch",
4778
+ checked: Boolean(draft.threadSessions ?? account.threadSessions),
4779
+ "aria-checked": Boolean(draft.threadSessions ?? account.threadSessions),
4780
+ "aria-label": t("account.threadSessions"),
4781
+ onChange: (checked) => {
4782
+ setDraft({ ...draft, threadSessions: checked });
4783
+ save({ threadSessions: checked });
4784
+ },
4785
+ }),
4786
+ ),
4787
+ h("div", { className: "ima-picker-note" }, t("account.threadSessionsNote")),
4788
+ ),
4752
4789
  h(CommandPermissionSettings, { value: draft.commandPermissions, onSave: commandPermissions => save({ commandPermissions }), t }),
4753
4790
  note && h("div", { className: note === "status.saved" ? "ima-save-note ok" : "ima-save-note" }, t(note)),
4754
4791
  h("div", { className: "ima-inspector-actions" },
@@ -7,5 +7,6 @@ export declare function createChannelAdapter(id: ChannelId, config: Record<strin
7
7
  get(name: string): unknown;
8
8
  };
9
9
  onWeixinBotToken?: (token: string | undefined) => void | Promise<void>;
10
+ loadFeishuSdk?: () => Promise<typeof import('@larksuiteoapi/node-sdk')>;
10
11
  }): ChannelAdapter | undefined;
11
12
  //# sourceMappingURL=factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/channels/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAYxD,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,GACrK,cAAc,GAAG,SAAS,CAiD5B"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/channels/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAYxD,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,yBAAyB,CAAC,CAAC,CAAA;CAAE,GAC9O,cAAc,GAAG,SAAS,CAiD5B"}