@downcity/plugins 1.0.145 → 1.0.148

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 (108) hide show
  1. package/bin/asr/Plugin.js +8 -8
  2. package/bin/asr/Plugin.js.map +1 -1
  3. package/bin/auth/types/AuthPlugin.js +3 -3
  4. package/bin/auth/types/AuthPlugin.js.map +1 -1
  5. package/bin/chat/PROMPT.direct.d.ts +1 -1
  6. package/bin/chat/PROMPT.direct.d.ts.map +1 -1
  7. package/bin/chat/PROMPT.direct.js +1 -1
  8. package/bin/chat/PROMPT.direct.js.map +1 -1
  9. package/bin/chat/channels/feishu/PROMPT.direct.d.ts +1 -1
  10. package/bin/chat/channels/feishu/PROMPT.direct.d.ts.map +1 -1
  11. package/bin/chat/channels/feishu/PROMPT.direct.js +1 -1
  12. package/bin/chat/channels/feishu/PROMPT.direct.js.map +1 -1
  13. package/bin/chat/channels/qq/PROMPT.direct.d.ts +1 -1
  14. package/bin/chat/channels/qq/PROMPT.direct.d.ts.map +1 -1
  15. package/bin/chat/channels/qq/PROMPT.direct.js +1 -1
  16. package/bin/chat/channels/qq/PROMPT.direct.js.map +1 -1
  17. package/bin/chat/runtime/ChatAuthorizationRuntime.js +5 -5
  18. package/bin/chat/runtime/ChatAuthorizationRuntime.js.map +1 -1
  19. package/bin/chat/runtime/ChatPluginActionRegistry.js +61 -61
  20. package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -1
  21. package/bin/chat/runtime/ChatSessionContextComposer.d.ts +2 -2
  22. package/bin/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -1
  23. package/bin/chat/runtime/ChatSessionTypes.d.ts +1 -1
  24. package/bin/chat/runtime/ChatSessionTypes.d.ts.map +1 -1
  25. package/bin/contact/Action.js +48 -48
  26. package/bin/contact/Action.js.map +1 -1
  27. package/bin/contact/PROMPT.d.ts +1 -1
  28. package/bin/contact/PROMPT.d.ts.map +1 -1
  29. package/bin/contact/PROMPT.js +1 -1
  30. package/bin/contact/PROMPT.js.map +1 -1
  31. package/bin/contact/runtime/ChatRuntime.js.map +1 -1
  32. package/bin/image/ImagePlugin.js +21 -21
  33. package/bin/image/ImagePlugin.js.map +1 -1
  34. package/bin/memory/Action.js +2 -2
  35. package/bin/memory/Action.js.map +1 -1
  36. package/bin/memory/MemoryPlugin.js +50 -50
  37. package/bin/memory/MemoryPlugin.js.map +1 -1
  38. package/bin/skill/PROMPT.d.ts +1 -1
  39. package/bin/skill/PROMPT.d.ts.map +1 -1
  40. package/bin/skill/PROMPT.js +1 -1
  41. package/bin/skill/PROMPT.js.map +1 -1
  42. package/bin/skill/Plugin.js +23 -23
  43. package/bin/skill/Plugin.js.map +1 -1
  44. package/bin/task/Action.js +1 -1
  45. package/bin/task/Action.js.map +1 -1
  46. package/bin/task/PROMPT.d.ts +1 -1
  47. package/bin/task/PROMPT.d.ts.map +1 -1
  48. package/bin/task/PROMPT.js +1 -1
  49. package/bin/task/PROMPT.js.map +1 -1
  50. package/bin/task/runtime/Runner.js +2 -2
  51. package/bin/task/runtime/Runner.js.map +1 -1
  52. package/bin/task/runtime/TaskPluginActionRegistry.js +73 -73
  53. package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -1
  54. package/bin/task/runtime/TaskRunnerProgress.js +1 -1
  55. package/bin/task/runtime/TaskRunnerProgress.js.map +1 -1
  56. package/bin/task/runtime/TaskRunnerScript.js +3 -3
  57. package/bin/task/runtime/TaskRunnerScript.js.map +1 -1
  58. package/bin/task/runtime/TaskRunnerSession.js +3 -3
  59. package/bin/task/runtime/TaskRunnerSession.js.map +1 -1
  60. package/bin/tts/Plugin.js +7 -7
  61. package/bin/tts/Plugin.js.map +1 -1
  62. package/bin/web/PROMPT.d.ts +1 -1
  63. package/bin/web/PROMPT.d.ts.map +1 -1
  64. package/bin/web/PROMPT.js +1 -1
  65. package/bin/web/PROMPT.js.map +1 -1
  66. package/bin/web/Plugin.js +8 -8
  67. package/bin/web/Plugin.js.map +1 -1
  68. package/bin/workboard/Plugin.js +2 -2
  69. package/bin/workboard/Plugin.js.map +1 -1
  70. package/bin/workboard/runtime/Normalizer.js +1 -1
  71. package/bin/workboard/runtime/Normalizer.js.map +1 -1
  72. package/package.json +3 -3
  73. package/src/asr/Plugin.ts +8 -8
  74. package/src/auth/types/AuthPlugin.ts +3 -3
  75. package/src/chat/PROMPT.direct.ts +1 -1
  76. package/src/chat/PROMPT.direct.ts.txt +32 -32
  77. package/src/chat/channels/feishu/PROMPT.direct.ts +1 -1
  78. package/src/chat/channels/feishu/PROMPT.direct.ts.txt +2 -2
  79. package/src/chat/channels/qq/PROMPT.direct.ts +1 -1
  80. package/src/chat/channels/qq/PROMPT.direct.ts.txt +11 -9
  81. package/src/chat/runtime/ChatAuthorizationRuntime.ts +5 -5
  82. package/src/chat/runtime/ChatPluginActionRegistry.ts +61 -61
  83. package/src/chat/runtime/ChatSessionContextComposer.ts +2 -2
  84. package/src/chat/runtime/ChatSessionTypes.ts +1 -1
  85. package/src/contact/Action.ts +48 -48
  86. package/src/contact/PROMPT.ts +1 -1
  87. package/src/contact/PROMPT.ts.txt +22 -22
  88. package/src/contact/runtime/ChatRuntime.ts +2 -2
  89. package/src/image/ImagePlugin.ts +21 -21
  90. package/src/memory/Action.ts +2 -2
  91. package/src/memory/MemoryPlugin.ts +50 -50
  92. package/src/skill/PROMPT.ts +1 -1
  93. package/src/skill/PROMPT.ts.txt +5 -6
  94. package/src/skill/Plugin.ts +23 -23
  95. package/src/task/Action.ts +1 -1
  96. package/src/task/PROMPT.ts +1 -1
  97. package/src/task/PROMPT.ts.txt +159 -159
  98. package/src/task/runtime/Runner.ts +2 -2
  99. package/src/task/runtime/TaskPluginActionRegistry.ts +73 -73
  100. package/src/task/runtime/TaskRunnerProgress.ts +1 -1
  101. package/src/task/runtime/TaskRunnerScript.ts +3 -3
  102. package/src/task/runtime/TaskRunnerSession.ts +3 -3
  103. package/src/tts/Plugin.ts +7 -7
  104. package/src/web/PROMPT.ts +1 -1
  105. package/src/web/PROMPT.ts.txt +31 -31
  106. package/src/web/Plugin.ts +8 -8
  107. package/src/workboard/Plugin.ts +2 -2
  108. package/src/workboard/runtime/Normalizer.ts +1 -1
@@ -1,53 +1,53 @@
1
- # Chat Plugin 使用说明
1
+ # Chat Plugin Instructions
2
2
 
3
- ## 用户可见回复规则
3
+ ## User-Visible Reply Rules
4
4
 
5
- - 当前模式下,直接输出,即会发送消息给到用户对应的channel
5
+ - In the current mode, your direct assistant output is sent as a message to the user's corresponding channel.
6
6
 
7
- ## 输出协议
7
+ ## Output Protocol
8
8
 
9
- - 需要普通回复时,直接输出文本即可。文本顶部可用 frontmatter metadata (optional),字段语义与 chat plugin direct send 协议保持一致:
9
+ - For a normal reply, output plain text directly. Optional frontmatter metadata may appear at the very top of the text. Field semantics match the chat plugin direct-send protocol:
10
10
 
11
- - `delay` / `delayMs`:延迟发送毫秒数。
12
- - `time` / `sendAt` / `sendAtMs`:定时发送时间。
13
- - `reply`:是否使用 reply 语义发送。
14
- - `messageId`:目标 `message_id`(群聊推荐)。
15
- - `react`:发送表情反应。
16
- - 单个字符串:`react: "👍"`
17
- - 或对象/数组:`emoji/big`
18
- - 设置 `messageId` 时,`react` 会优先复用该消息作为目标消息。
19
- - 附件使用 `<file type="...">path</file>`(支持 `document/photo/voice/audio/video`)。
20
- - 附件路径必须是项目内可访问的相对路径。多附件可输出多个 `<file>` 标签。
11
+ - `delay` / `delayMs`: delay before sending, in milliseconds.
12
+ - `time` / `sendAt` / `sendAtMs`: scheduled send time.
13
+ - `reply`: whether to send with reply semantics.
14
+ - `messageId`: target `message_id`, recommended for group chats.
15
+ - `react`: send an emoji reaction.
16
+ - Single string: `react: "thumbs up"`
17
+ - Or an object/array: `emoji/big`
18
+ - When `messageId` is set, `react` reuses that message as the target first.
19
+ - Attachments use `<file type="...">path</file>` and support `document/photo/voice/audio/video`.
20
+ - Attachment paths must be relative paths accessible inside the project. For multiple attachments, output multiple `<file>` tags.
21
21
 
22
- ### 示例
22
+ ### Example
23
23
 
24
24
  ```text
25
25
  ---
26
26
  reply: true
27
27
  messageId: "128"
28
28
  react:
29
- - emoji: ""
29
+ - emoji: "done"
30
30
  ---
31
- 这是今天的报告。
31
+ Here is today's report.
32
32
  <file type="document">reports/daily.md</file>
33
33
  ```
34
34
 
35
- ### 协议约束
35
+ ### Protocol Constraints
36
36
 
37
- - frontmatter 必须位于文本最开头(`---` 包裹)。
38
- - `<file>` 附件标签外,不要使用尖括号格式做控制参数。
37
+ - Frontmatter must be at the very beginning of the text and wrapped with `---`.
38
+ - Except for `<file>` attachment tags, do not use angle-bracket syntax for control parameters.
39
39
 
40
- ## 跨协议/跨平台操作
40
+ ## Cross-Protocol Or Cross-Platform Operations
41
41
 
42
- - 当前会话内回复优先直接输出文本,系统会自动发送到当前 channel
43
- - 当任务需要跨会话、跨平台或复杂路由,使用 chat plugin action。
44
- - 如果当前工具集中存在 `plugin_call`,可通过 `plugin_call({ plugin: "chat", action: "send", payload })` `plugin_call({ plugin: "chat", action: "react", payload })` 触发。
45
- - metadata 只适用于当前会话内的 direct 出站,不要拿 metadata 做跨 chat 路由。
46
- - 如果不清楚跨 chat 路由参数,应先读取当前 chat context 或调用 chat plugin 的查询类 action,而不是猜测。
42
+ - For replies inside the current conversation, prefer outputting text directly. The system will send it to the current channel automatically.
43
+ - When a task needs cross-conversation, cross-platform, or complex routing, use chat plugin actions.
44
+ - If `plugin_call` is available, call `plugin_call({ plugin: "chat", action: "send", payload })` or `plugin_call({ plugin: "chat", action: "react", payload })`.
45
+ - Metadata applies only to direct outbound messages in the current conversation. Do not use metadata for cross-chat routing.
46
+ - If cross-chat routing parameters are unclear, first read the current chat context or call chat plugin query actions instead of guessing.
47
47
 
48
- ## 入站消息结构(仅供内部理解)
48
+ ## Inbound Message Structure
49
49
 
50
- - 每条入队用户消息包含 `<info>...</info>` 元信息块 + 用户正文。
51
- - `<info>` 仅保留 user/request 元信息,例如 `user_id`、`username`、`message_id`、`permissions`、`received_at`。
52
- - 当前 chat 路由环境(例如 `channel`、`session_id`、`chat_key`、`chat_id`)会通过 system prompt 单独注入,不再混在 `<info>` 里。
53
- - `<info>` 不要原样回传给用户。
50
+ - Each queued user message contains an `<info>...</info>` metadata block plus the user text.
51
+ - `<info>` keeps only user/request metadata such as `user_id`, `username`, `message_id`, `permissions`, and `received_at`.
52
+ - The current chat routing environment, such as `channel`, `session_id`, `chat_key`, and `chat_id`, is injected separately through the system prompt and is no longer mixed into `<info>`.
53
+ - Do not echo `<info>` back to the user.
@@ -4,6 +4,6 @@
4
4
  */
5
5
 
6
6
  // Source: src/chat/channels/feishu/PROMPT.direct.ts.txt
7
- const TEXT_MODULE_CONTENT = "# Feishu Channel\n\n## 使用约束\n\n- 你的直接输出自动发送到当前飞书会话。\n";
7
+ const TEXT_MODULE_CONTENT = "# Feishu Channel\n\n## Usage Constraints\n\n- Your direct output is automatically sent to the current Feishu conversation.\n";
8
8
 
9
9
  export default TEXT_MODULE_CONTENT;
@@ -1,5 +1,5 @@
1
1
  # Feishu Channel
2
2
 
3
- ## 使用约束
3
+ ## Usage Constraints
4
4
 
5
- - 你的直接输出自动发送到当前飞书会话。
5
+ - Your direct output is automatically sent to the current Feishu conversation.
@@ -4,6 +4,6 @@
4
4
  */
5
5
 
6
6
  // Source: src/chat/channels/qq/PROMPT.direct.ts.txt
7
- const TEXT_MODULE_CONTENT = "# QQ Adapter 使用说明(direct 模式)\n\n## 能力范围\n- 负责 QQ 官方机器人网关(WebSocket)消息接入与发送。\n- 入站消息会由 chat plugin runtime 映射到内部 `sessionId`(随机分配并持久化)。\n\n## 使用约束\n- direct 模式下,你输出的 assistant 文本会自动发送到当前 QQ 会话。\n- QQ 出站回复依赖入站消息上下文(如 `chatType` `messageId`);跨会话发送请使用 chat plugin action,不要在 direct metadata 中写 `chatKey`。\n- 群聊消息默认全量接入,不需要 `@` 触发。\n- 适配器会过滤机器人自回环消息并做入站去重,避免“自己回复自己”的循环。\n";
7
+ const TEXT_MODULE_CONTENT = "# QQ Adapter Instructions (Direct Mode)\n\n## Capability Scope\n\n- Handles message ingress and sending for the official QQ bot gateway over WebSocket.\n- Inbound messages are mapped by the chat plugin runtime to an internal `sessionId`, which is randomly assigned and persisted.\n\n## Usage Constraints\n\n- In direct mode, your assistant text output is automatically sent to the current QQ conversation.\n- QQ outbound replies depend on inbound message context such as `chatType` and `messageId`. For cross-conversation sending, use chat plugin actions instead of writing `chatKey` in direct metadata.\n- Group messages are ingested in full by default and do not require an `@` mention.\n- The adapter filters bot self-loop messages and deduplicates inbound messages to avoid \"replying to itself\" loops.\n";
8
8
 
9
9
  export default TEXT_MODULE_CONTENT;
@@ -1,11 +1,13 @@
1
- # QQ Adapter 使用说明(direct 模式)
1
+ # QQ Adapter Instructions (Direct Mode)
2
2
 
3
- ## 能力范围
4
- - 负责 QQ 官方机器人网关(WebSocket)消息接入与发送。
5
- - 入站消息会由 chat plugin runtime 映射到内部 `sessionId`(随机分配并持久化)。
3
+ ## Capability Scope
6
4
 
7
- ## 使用约束
8
- - direct 模式下,你输出的 assistant 文本会自动发送到当前 QQ 会话。
9
- - QQ 出站回复依赖入站消息上下文(如 `chatType` 与 `messageId`);跨会话发送请使用 chat plugin action,不要在 direct metadata 中写 `chatKey`。
10
- - 群聊消息默认全量接入,不需要 `@` 触发。
11
- - 适配器会过滤机器人自回环消息并做入站去重,避免“自己回复自己”的循环。
5
+ - Handles message ingress and sending for the official QQ bot gateway over WebSocket.
6
+ - Inbound messages are mapped by the chat plugin runtime to an internal `sessionId`, which is randomly assigned and persisted.
7
+
8
+ ## Usage Constraints
9
+
10
+ - In direct mode, your assistant text output is automatically sent to the current QQ conversation.
11
+ - QQ outbound replies depend on inbound message context such as `chatType` and `messageId`. For cross-conversation sending, use chat plugin actions instead of writing `chatKey` in direct metadata.
12
+ - Group messages are ingested in full by default and do not require an `@` mention.
13
+ - The adapter filters bot self-loop messages and deduplicates inbound messages to avoid "replying to itself" loops.
@@ -165,7 +165,7 @@ export function createChatAuthorizationResolves(): PluginResolves {
165
165
  export function createChatAuthorizationActions(): PluginActions {
166
166
  return {
167
167
  [CHAT_AUTHORIZATION_ACTIONS.snapshot]: createAction({
168
- description: "读取 chat 授权快照(catalog/config/users/chats)。",
168
+ description: "Read chat authorization snapshot (catalog/config/users/chats).",
169
169
  input_schema: {
170
170
  zod: z.object({}).passthrough(),
171
171
  json_schema: { type: "object", properties: {} },
@@ -181,7 +181,7 @@ export function createChatAuthorizationActions(): PluginActions {
181
181
  },
182
182
  }),
183
183
  [CHAT_AUTHORIZATION_ACTIONS.readConfig]: createAction({
184
- description: "读取当前 chat 授权配置。",
184
+ description: "Read current chat authorization config.",
185
185
  input_schema: {
186
186
  zod: z.object({}).passthrough(),
187
187
  json_schema: { type: "object", properties: {} },
@@ -194,7 +194,7 @@ export function createChatAuthorizationActions(): PluginActions {
194
194
  },
195
195
  }),
196
196
  [CHAT_AUTHORIZATION_ACTIONS.writeConfig]: createAction({
197
- description: "写入 chat 授权配置(整体覆盖)。",
197
+ description: "Write chat authorization config as a full replacement.",
198
198
  input_schema: {
199
199
  zod: z.object({
200
200
  config: z.record(z.string(), z.unknown()).optional(),
@@ -202,7 +202,7 @@ export function createChatAuthorizationActions(): PluginActions {
202
202
  json_schema: {
203
203
  type: "object",
204
204
  properties: {
205
- config: { type: "object", description: "授权配置" },
205
+ config: { type: "object", description: "Authorization config." },
206
206
  },
207
207
  },
208
208
  },
@@ -225,7 +225,7 @@ export function createChatAuthorizationActions(): PluginActions {
225
225
  },
226
226
  }),
227
227
  [CHAT_AUTHORIZATION_ACTIONS.setUserRole]: createAction({
228
- description: "为某个渠道用户设置角色。",
228
+ description: "Set the role for a channel user.",
229
229
  input_schema: {
230
230
  zod: z.object({
231
231
  channel: z.enum(["telegram", "feishu", "qq"]),
@@ -104,15 +104,15 @@ export function createChatPluginActions(params: {
104
104
  }): PluginActions {
105
105
  return {
106
106
  status: createAction({
107
- description: "查看 chat 渠道连接状态。",
107
+ description: "View chat channel connection status.",
108
108
  input_schema: {
109
109
  zod: z.object({}).passthrough(),
110
110
  json_schema: { type: "object", properties: {}, additionalProperties: true },
111
111
  },
112
112
  command: {
113
- description: "查看 chat 渠道连接状态",
113
+ description: "View chat channel connection status.",
114
114
  configure(command: Command) {
115
- command.option("--channel <name>", "指定渠道(telegram|feishu|qq");
115
+ command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
116
116
  },
117
117
  mapInput: mapChatChannelCommandInput,
118
118
  },
@@ -125,15 +125,15 @@ export function createChatPluginActions(params: {
125
125
  },
126
126
  }),
127
127
  test: createAction({
128
- description: "测试 chat 渠道连通性。",
128
+ description: "Test chat channel connectivity.",
129
129
  input_schema: {
130
130
  zod: z.object({}).passthrough(),
131
131
  json_schema: { type: "object", properties: {}, additionalProperties: true },
132
132
  },
133
133
  command: {
134
- description: "测试 chat 渠道连通性",
134
+ description: "Test chat channel connectivity.",
135
135
  configure(command: Command) {
136
- command.option("--channel <name>", "指定渠道(telegram|feishu|qq");
136
+ command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
137
137
  },
138
138
  mapInput: mapChatChannelCommandInput,
139
139
  },
@@ -146,15 +146,15 @@ export function createChatPluginActions(params: {
146
146
  },
147
147
  }),
148
148
  reconnect: createAction({
149
- description: "重连 chat 渠道(默认全部)。",
149
+ description: "Reconnect chat channels, all by default.",
150
150
  input_schema: {
151
151
  zod: z.object({}).passthrough(),
152
152
  json_schema: { type: "object", properties: {}, additionalProperties: true },
153
153
  },
154
154
  command: {
155
- description: "重连 chat 渠道(默认全部)",
155
+ description: "Reconnect chat channels, all by default.",
156
156
  configure(command: Command) {
157
- command.option("--channel <name>", "指定渠道(telegram|feishu|qq");
157
+ command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
158
158
  },
159
159
  mapInput: mapChatChannelCommandInput,
160
160
  },
@@ -167,15 +167,15 @@ export function createChatPluginActions(params: {
167
167
  },
168
168
  }),
169
169
  open: createAction({
170
- description: "打开(启用)指定 chat 渠道。",
170
+ description: "Open and enable the specified chat channel.",
171
171
  input_schema: {
172
172
  zod: z.object({}).passthrough(),
173
173
  json_schema: { type: "object", properties: {}, additionalProperties: true },
174
174
  },
175
175
  command: {
176
- description: "打开 chat 渠道(enabled=true,已配置则尝试启动)",
176
+ description: "Open chat channel (enabled=true, and start it if configured).",
177
177
  configure(command: Command) {
178
- command.option("--channel <name>", "指定渠道(telegram|feishu|qq");
178
+ command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
179
179
  },
180
180
  mapInput: mapChatChannelCommandInput,
181
181
  },
@@ -188,15 +188,15 @@ export function createChatPluginActions(params: {
188
188
  },
189
189
  }),
190
190
  close: createAction({
191
- description: "关闭(禁用)指定 chat 渠道。",
191
+ description: "Close and disable the specified chat channel.",
192
192
  input_schema: {
193
193
  zod: z.object({}).passthrough(),
194
194
  json_schema: { type: "object", properties: {}, additionalProperties: true },
195
195
  },
196
196
  command: {
197
- description: "关闭 chat 渠道(enabled=false,并停止运行)",
197
+ description: "Close chat channel (enabled=false and stop runtime).",
198
198
  configure(command: Command) {
199
- command.option("--channel <name>", "指定渠道(telegram|feishu|qq");
199
+ command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
200
200
  },
201
201
  mapInput: mapChatChannelCommandInput,
202
202
  },
@@ -209,15 +209,15 @@ export function createChatPluginActions(params: {
209
209
  },
210
210
  }),
211
211
  configuration: createAction({
212
- description: "查看 chat 渠道配置元信息。",
212
+ description: "View chat channel configuration metadata.",
213
213
  input_schema: {
214
214
  zod: z.object({}).passthrough(),
215
215
  json_schema: { type: "object", properties: {}, additionalProperties: true },
216
216
  },
217
217
  command: {
218
- description: "查看 chat 渠道配置元信息(字段、类型、说明)",
218
+ description: "View chat channel configuration metadata (fields, types, descriptions).",
219
219
  configure(command: Command) {
220
- command.option("--channel <name>", "指定渠道(telegram|feishu|qq");
220
+ command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
221
221
  },
222
222
  mapInput: mapChatChannelCommandInput,
223
223
  },
@@ -229,21 +229,21 @@ export function createChatPluginActions(params: {
229
229
  },
230
230
  }),
231
231
  configure: createAction({
232
- description: "更新 chat 渠道运行态参数。",
232
+ description: "Update runtime parameters for a chat channel.",
233
233
  input_schema: {
234
234
  zod: z.object({}).passthrough(),
235
235
  json_schema: { type: "object", properties: {}, additionalProperties: true },
236
236
  },
237
237
  command: {
238
- description: "更新 chat 渠道运行态参数(可选立即重载)",
238
+ description: "Update runtime parameters for a chat channel, optionally restarting it immediately.",
239
239
  configure(command: Command) {
240
240
  command
241
- .requiredOption("--channel <name>", "指定渠道(telegram|feishu|qq")
241
+ .requiredOption("--channel <name>", "Specify channel (telegram|feishu|qq).")
242
242
  .requiredOption(
243
243
  "--config-json <json>",
244
- "配置 patch JSON(例如 '{\"channelAccountId\":\"qq-main\",\"enabled\":true}'",
244
+ "Configuration patch JSON, for example '{\"channelAccountId\":\"qq-main\",\"enabled\":true}'.",
245
245
  )
246
- .option("--restart", "配置后立即重载渠道", false);
246
+ .option("--restart", "Restart the channel immediately after configuration.", false);
247
247
  },
248
248
  mapInput: mapChatConfigureCommandInput,
249
249
  },
@@ -256,18 +256,18 @@ export function createChatPluginActions(params: {
256
256
  },
257
257
  }),
258
258
  list: createAction({
259
- description: "列出当前 agent 已记录的 chat 会话。",
259
+ description: "List chat conversations recorded by the current agent.",
260
260
  input_schema: {
261
261
  zod: z.object({}).passthrough(),
262
262
  json_schema: { type: "object", properties: {}, additionalProperties: true },
263
263
  },
264
264
  command: {
265
- description: "列出当前 agent 已记录的 chat 会话(chatTitle/chatKey",
265
+ description: "List chat conversations recorded by the current agent (chatTitle/chatKey).",
266
266
  configure(command: Command) {
267
267
  command
268
- .option("--channel <name>", "渠道过滤(telegram|feishu|qq")
269
- .option("--limit <n>", "返回最近 N 条(默认 50")
270
- .option("--q <text>", "关键词过滤(title/chatId/sessionId/actor");
268
+ .option("--channel <name>", "Filter by channel (telegram|feishu|qq).")
269
+ .option("--limit <n>", "Return the latest N records, default 50.")
270
+ .option("--q <text>", "Keyword filter (title/chatId/sessionId/actor).");
271
271
  },
272
272
  mapInput: mapChatListCommandInput,
273
273
  },
@@ -279,17 +279,17 @@ export function createChatPluginActions(params: {
279
279
  },
280
280
  }),
281
281
  info: createAction({
282
- description: "查看指定 chat 会话的路由/路径/上下文快照。",
282
+ description: "View route, paths, and context snapshot for a specified chat conversation.",
283
283
  input_schema: {
284
284
  zod: z.object({}).passthrough(),
285
285
  json_schema: { type: "object", properties: {}, additionalProperties: true },
286
286
  },
287
287
  command: {
288
- description: "查看指定 chat 会话信息(路由/本地路径/上下文快照)",
288
+ description: "View specified chat conversation info (route/local paths/context snapshot).",
289
289
  configure(command: Command) {
290
290
  command
291
- .option("--chat-key <chatKey>", "目标 chatKey(不传则尝试读取 DC_CTX_CHAT_KEY")
292
- .option("--session-id <sessionId>", "显式指定 sessionId(优先级更高)");
291
+ .option("--chat-key <chatKey>", "Target chatKey; reads DC_CTX_CHAT_KEY if omitted.")
292
+ .option("--session-id <sessionId>", "Explicit sessionId, with higher priority.");
293
293
  },
294
294
  mapInput: mapChatInfoCommandInput,
295
295
  },
@@ -301,23 +301,23 @@ export function createChatPluginActions(params: {
301
301
  },
302
302
  }),
303
303
  send: createAction({
304
- description: "向目标 chatKey 发送消息(支持文本/附件/延迟)。",
304
+ description: "Send a message to the target chatKey, supporting text, attachments, and delay.",
305
305
  input_schema: {
306
306
  zod: z.object({}).passthrough(),
307
307
  json_schema: { type: "object", properties: {}, additionalProperties: true },
308
308
  },
309
309
  command: {
310
- description: "发送消息到目标 chatKey",
310
+ description: "Send a message to the target chatKey.",
311
311
  configure(command: Command) {
312
312
  command
313
- .option("--text <text>", "消息正文")
314
- .option("--stdin", "从标准输入读取消息正文", false)
315
- .option("--text-file <file>", "从文件读取消息正文(相对当前目录)")
316
- .option("--reply", "显式使用 reply_to_message 回复目标消息", false)
317
- .option("--message-id <id>", "显式指定 reply 目标消息 ID")
313
+ .option("--text <text>", "Message body.")
314
+ .option("--stdin", "Read message body from stdin.", false)
315
+ .option("--text-file <file>", "Read message body from a file relative to the current directory.")
316
+ .option("--reply", "Explicitly reply to the target message with reply_to_message.", false)
317
+ .option("--message-id <id>", "Explicit reply target message ID.")
318
318
  .option(
319
319
  "--chat-key <chatKey>",
320
- "目标 chatKey(不传则尝试读取 DC_CTX_CHAT_KEY",
320
+ "Target chatKey; reads DC_CTX_CHAT_KEY if omitted.",
321
321
  );
322
322
  attachCommandHelpText(command, CHAT_SEND_HELP_TEXT);
323
323
  },
@@ -331,21 +331,21 @@ export function createChatPluginActions(params: {
331
331
  },
332
332
  }),
333
333
  react: createAction({
334
- description: "给目标消息贴表情(当前仅 Telegram 支持)。",
334
+ description: "React to a target message, currently supported only by Telegram.",
335
335
  input_schema: {
336
336
  zod: z.object({}).passthrough(),
337
337
  json_schema: { type: "object", properties: {}, additionalProperties: true },
338
338
  },
339
339
  command: {
340
- description: "给目标消息贴表情(当前仅 Telegram 支持)",
340
+ description: "React to a target message, currently supported only by Telegram.",
341
341
  configure(command: Command) {
342
342
  command
343
- .option("--emoji <emoji>", "表情字符(默认 👍)")
344
- .option("--big", "使用大表情效果(Telegram is_big", false)
345
- .option("--message-id <id>", "目标消息 ID(默认尝试从 chat meta 回填)")
343
+ .option("--emoji <emoji>", "Emoji character, default thumbs-up.")
344
+ .option("--big", "Use large reaction effect (Telegram is_big).", false)
345
+ .option("--message-id <id>", "Target message ID; defaults to chat meta when available.")
346
346
  .option(
347
347
  "--chat-key <chatKey>",
348
- "目标 chatKey(不传则尝试读取 DC_CTX_CHAT_KEY",
348
+ "Target chatKey; reads DC_CTX_CHAT_KEY if omitted.",
349
349
  );
350
350
  attachCommandHelpText(command, CHAT_REACT_HELP_TEXT);
351
351
  },
@@ -359,15 +359,15 @@ export function createChatPluginActions(params: {
359
359
  },
360
360
  }),
361
361
  context: createAction({
362
- description: "查看当前会话上下文快照。",
362
+ description: "View current conversation context snapshot.",
363
363
  input_schema: {
364
364
  zod: z.object({}).passthrough(),
365
365
  json_schema: { type: "object", properties: {}, additionalProperties: true },
366
366
  },
367
367
  command: {
368
- description: "查看当前会话上下文快照",
368
+ description: "View current conversation context snapshot.",
369
369
  configure(command: Command) {
370
- command.option("--chat-key <chatKey>", "显式覆盖 chatKey");
370
+ command.option("--chat-key <chatKey>", "Explicitly override chatKey.");
371
371
  },
372
372
  mapInput(input) {
373
373
  const chatKey =
@@ -385,17 +385,17 @@ export function createChatPluginActions(params: {
385
385
  },
386
386
  }),
387
387
  delete: createAction({
388
- description: "彻底删除指定 chat 会话(映射+历史+context)。",
388
+ description: "Permanently delete a specified chat conversation, including mapping, history, and context.",
389
389
  input_schema: {
390
390
  zod: z.object({}).passthrough(),
391
391
  json_schema: { type: "object", properties: {}, additionalProperties: true },
392
392
  },
393
393
  command: {
394
- description: "彻底删除指定 chat 会话(映射+历史+context",
394
+ description: "Permanently delete a specified chat conversation, including mapping, history, and context.",
395
395
  configure(command: Command) {
396
396
  command
397
- .option("--chat-key <chatKey>", "显式指定 chatKey")
398
- .option("--session-id <sessionId>", "显式指定 sessionId");
397
+ .option("--chat-key <chatKey>", "Explicit chatKey.")
398
+ .option("--session-id <sessionId>", "Explicit sessionId.");
399
399
  },
400
400
  mapInput: mapChatDeleteCommandInput,
401
401
  },
@@ -407,24 +407,24 @@ export function createChatPluginActions(params: {
407
407
  },
408
408
  }),
409
409
  history: createAction({
410
- description: "读取 chat 历史消息。",
410
+ description: "Read chat history messages.",
411
411
  input_schema: {
412
412
  zod: z.object({}).passthrough(),
413
413
  json_schema: { type: "object", properties: {}, additionalProperties: true },
414
414
  },
415
415
  command: {
416
- description: "读取 chat 历史消息(默认最近 30 条)",
416
+ description: "Read chat history messages, defaulting to the latest 30.",
417
417
  configure(command: Command) {
418
418
  command
419
- .option("--chat-key <chatKey>", "显式覆盖 chatKey")
420
- .option("--session-id <sessionId>", "显式覆盖 sessionId")
421
- .option("--limit <n>", "返回最近 N 条(默认 30")
419
+ .option("--chat-key <chatKey>", "Explicitly override chatKey.")
420
+ .option("--session-id <sessionId>", "Explicitly override sessionId.")
421
+ .option("--limit <n>", "Return the latest N records, default 30.")
422
422
  .option(
423
423
  "--direction <direction>",
424
- "方向过滤(all|inbound|outbound",
424
+ "Direction filter (all|inbound|outbound).",
425
425
  )
426
- .option("--before-ts <ts>", "仅返回 ts 小于该值的记录(毫秒)")
427
- .option("--after-ts <ts>", "仅返回 ts 大于该值的记录(毫秒)");
426
+ .option("--before-ts <ts>", "Return only records with ts lower than this value, in milliseconds.")
427
+ .option("--after-ts <ts>", "Return only records with ts greater than this value, in milliseconds.");
428
428
  },
429
429
  mapInput: mapChatHistoryCommandInput,
430
430
  },
@@ -10,7 +10,7 @@
10
10
  import type { ModelMessage, Tool } from "ai";
11
11
  import { drainInjectedUserMessages } from "@downcity/agent/internal/executor/SessionRunScope.js";
12
12
  import { LocalSessionContextComposer } from "@downcity/agent/internal/executor/composer/context/LocalSessionContextComposer.js";
13
- import type { SessionMessageV1 } from "@downcity/agent/internal/executor/types/SessionMessages.js";
13
+ import type { SessionRecordV1 } from "@downcity/agent/internal/executor/types/SessionRecords.js";
14
14
  import type { SessionSystemMessage } from "@downcity/agent/internal/executor/types/SessionPrompts.js";
15
15
  import type { ChatSessionTurnState } from "@/chat/runtime/ChatSessionTypes.js";
16
16
 
@@ -49,7 +49,7 @@ export class ChatSessionContextComposer extends LocalSessionContextComposer {
49
49
  input: {
50
50
  system: SessionSystemMessage[];
51
51
  appendMergedUserMessages: (
52
- messages: SessionMessageV1[],
52
+ messages: SessionRecordV1[],
53
53
  ) => Promise<ModelMessage[]>;
54
54
  },
55
55
  ): (input: { messages?: ModelMessage[] }) => Promise<{
@@ -6,7 +6,7 @@
6
6
  * - 普通 Session 仍可复用基础 `run / append*` 能力,不强耦合 chat 语义。
7
7
  */
8
8
 
9
- import type { SessionUserMessageV1 } from "@downcity/agent/internal/executor/types/SessionMessages.js";
9
+ import type { SessionUserMessageV1 } from "@downcity/agent/internal/executor/types/SessionRecords.js";
10
10
  import type { SessionAssistantStepCallback } from "@downcity/agent/internal/executor/types/SessionRun.js";
11
11
 
12
12
  /**