@ai-setting/roy-agent-core 1.7.33 → 1.7.34

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.
@@ -11,7 +11,7 @@ import {
11
11
  larkCliHandler,
12
12
  resolveBountyIMSystemPrompt,
13
13
  timerHandler
14
- } from "../../shared/@ai-setting/roy-agent-core-jq8rmmm6.js";
14
+ } from "../../shared/@ai-setting/roy-agent-core-ybg8sayk.js";
15
15
  import"../../shared/@ai-setting/roy-agent-core-0nz53t5v.js";
16
16
  import {
17
17
  BUILT_IN_EVENT_SOURCE_TYPES,
package/dist/env/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  EventSourceComponent,
16
16
  builtInHandlers,
17
17
  larkCliHandler
18
- } from "../shared/@ai-setting/roy-agent-core-jq8rmmm6.js";
18
+ } from "../shared/@ai-setting/roy-agent-core-ybg8sayk.js";
19
19
  import"../shared/@ai-setting/roy-agent-core-0nz53t5v.js";
20
20
  import {
21
21
  EventSourceInitHooks,
package/dist/index.js CHANGED
@@ -92,7 +92,7 @@ import {
92
92
  larkCliHandler,
93
93
  resolveBountyIMSystemPrompt,
94
94
  timerHandler
95
- } from "./shared/@ai-setting/roy-agent-core-jq8rmmm6.js";
95
+ } from "./shared/@ai-setting/roy-agent-core-ybg8sayk.js";
96
96
  import {
97
97
  LogTraceComponent,
98
98
  LogTraceConfigSchema
@@ -870,6 +870,17 @@ function buildLarkRecommendedAction(opts) {
870
870
  `处理飞书 ${scopeWord}消息并以机器人身份回复${profileWarn}。`,
871
871
  `scope: ${scopeHint}。`,
872
872
  ``,
873
+ `## ⭐ 关键: 所有飞书回复必须用 --markdown flag (不要用 --text, 也不要裸调用)`,
874
+ `lark-cli 默认会让消息渲染成 plain text — 你的 Markdown 标签 (<at> mention、列表、`,
875
+ `**bold**、code block、表格等) 会被当成字面字符显示, 用户看到的就是`,
876
+ `一堆 raw 符号, 完全没法用。`,
877
+ `正确做法: 调 im +messages-{send,reply} 时必须显式加 --markdown <content>,`,
878
+ `飞书才会按 Markdown 渲染 rich format。`,
879
+ `**严禁**: 使用 --text flag (直接导致 rich format 失效, 是最常见的回归路径)`,
880
+ ` 使用 --msg-type text (同理, --msg-type post 也可以但需对应结构,`,
881
+ ` 最稳的仍然是 --markdown flag)`,
882
+ ` 不加任何 content flag (会按 plain text 默认值处理)`,
883
+ ``,
873
884
  `## 安全传 Markdown(必读,避免飞书收到字面 $ 和字面反斜杠+n)`,
874
885
  `多行 / 复杂 Markdown 必须先写入临时 .md 文件,再 cat 出来当 --markdown 的值。`,
875
886
  `原因:agent 工具调用层不做 shell 展开。`,
@@ -880,7 +891,7 @@ function buildLarkRecommendedAction(opts) {
880
891
  ` cat > "$reply_file" <<'LARK_REPLY_EOF' # 3. 写入 Markdown(heredoc 单引号防 shell 展开)`,
881
892
  ` ...(这里是回复的 Markdown 内容,可以多行 / 含特殊字符)`,
882
893
  ` LARK_REPLY_EOF`,
883
- ` lark-cli ${profileFlag}im +messages-reply --message-id <取自 replyTo.messageId> --as bot --markdown "$(cat "$reply_file")" # 4. 真正调用`,
894
+ ` lark-cli ${profileFlag}im +messages-reply --message-id <取自 replyTo.messageId> --as bot --markdown "$(cat "$reply_file")" # 4. 真正调用 (注意 --markdown flag, 不要用 --text)`,
884
895
  ``,
885
896
  `## 禁止(用 words 描述,避免被 LLM 当字面 trap 抄)`,
886
897
  `- 禁止把多行 Markdown 直接拼进 --markdown 参数`,
@@ -888,6 +899,8 @@ function buildLarkRecommendedAction(opts) {
888
899
  `- 禁止字面反斜杠+n(即 \\n 两个字符,不是 0x0A 控制字符)`,
889
900
  `- 禁止 stdin 形式传 Markdown(--markdown 后接一个短横线作为值的写法)`,
890
901
  `- 禁止 at-file 形式传 Markdown(--markdown 后接 @ 符号加文件名的写法)`,
902
+ `- 禁止 --text flag(让 lark-cli 把消息当 plain text, rich format 全部失效 — 见顶部说明)`,
903
+ `- 禁止 --msg-type text(同理, --msg-type post 可选但需对应结构, 仍不如 --markdown flag 稳)`,
891
904
  ``,
892
905
  `## 必须使用 replyTo 里给定的值`,
893
906
  `profile / chatId / messageId / --as bot 必须原样取自 recommendedAction.replyTo;不要凭印象自己拼接。`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-core",
3
- "version": "1.7.33",
3
+ "version": "1.7.34",
4
4
  "type": "module",
5
5
  "description": "Core SDK for roy-agent - Environment, Components, Tools, Sessions, Tasks",
6
6
  "main": "./dist/index.js",