larkway 0.3.40 → 0.3.41

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.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  You @ the bot in a Feishu thread. It runs on your machine — reading your real codebase, executing commands, opening MRs — and posts the result back. You define what the agent knows and what it can do. Larkway just carries the messages.
10
10
 
11
- **Current release: v0.3.40**
11
+ **Current release: v0.3.41**
12
12
 
13
13
  ---
14
14
 
package/README.zh.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  你在飞书话题里 @ bot,它在你的机器上运行——读真实代码库、执行命令、开 MR——把结果贴回飞书。你定义 agent 知道什么、能做什么。Larkway 只负责传递消息。
10
10
 
11
- **当前版本:v0.3.40**
11
+ **当前版本:v0.3.41**
12
12
 
13
13
  ---
14
14
 
package/dist/main.js CHANGED
@@ -116656,6 +116656,9 @@ function buildTopicDeepLink(chatId, threadId) {
116656
116656
  const t = encodeURIComponent(threadId);
116657
116657
  return `https://applink.feishu.cn/client/thread/open?open_chat_id=${c}&open_thread_id=${t}&openchatid=${c}&openthreadid=${t}&thread_position=-1`;
116658
116658
  }
116659
+ function realTopicThreadId(threadId) {
116660
+ return typeof threadId === "string" && threadId.startsWith("omt_") ? threadId : void 0;
116661
+ }
116659
116662
  var LOOKUP_TIMEOUT_MS = 5e3;
116660
116663
  var CACHE_MAX = 200;
116661
116664
  async function withTimeout2(p, ms, label) {
@@ -122608,7 +122611,7 @@ var BridgeHandler = class {
122608
122611
  let deferredTaskRootProbe;
122609
122612
  {
122610
122613
  const rootId = typeof parsed.raw.root_id === "string" && parsed.raw.root_id ? parsed.raw.root_id : void 0;
122611
- const rawThreadId = typeof parsed.raw.thread_id === "string" && parsed.raw.thread_id ? parsed.raw.thread_id : void 0;
122614
+ const rawThreadId = realTopicThreadId(parsed.raw.thread_id);
122612
122615
  if (rootId && this.deps.messageLookup) {
122613
122616
  const probe = this.deps.messageLookup.get(rootId).catch(() => void 0);
122614
122617
  if (rawThreadId) {
@@ -122618,10 +122621,11 @@ var BridgeHandler = class {
122618
122621
  if (info?.msgType === "todo" && info.content) {
122619
122622
  const todo = parseTodoShareContent(info.content);
122620
122623
  if (todo) {
122624
+ const probeThreadId = realTopicThreadId(info.threadId);
122621
122625
  taskRootInfo = {
122622
122626
  guid: todo.taskGuid,
122623
122627
  summary: todo.summaryText,
122624
- topicLink: info.threadId ? buildTopicDeepLink(parsed.chatId, info.threadId) : void 0
122628
+ topicLink: probeThreadId ? buildTopicDeepLink(parsed.chatId, probeThreadId) : void 0
122625
122629
  };
122626
122630
  replyInThread = true;
122627
122631
  replyAnchorId = rootId;
@@ -122716,7 +122720,10 @@ var BridgeHandler = class {
122716
122720
  inputPreview: parsed.text,
122717
122721
  target: {
122718
122722
  chatId: parsed.chatId,
122719
- threadId: typeof parsed.raw.thread_id === "string" && parsed.raw.thread_id ? parsed.raw.thread_id : void 0,
122723
+ // omt_* only (see realTopicThreadId): passing a reply-chain om_*
122724
+ // id as receive_id_type=thread_id anchored the COT bubble onto a
122725
+ // stray thread on the TRIGGER message (2026-07-08 dogfood).
122726
+ threadId: realTopicThreadId(parsed.raw.thread_id),
122720
122727
  originMessageId
122721
122728
  }
122722
122729
  });
@@ -123077,19 +123084,21 @@ var BridgeHandler = class {
123077
123084
  if (info?.msgType === "todo" && info.content) {
123078
123085
  const todo = parseTodoShareContent(info.content);
123079
123086
  if (todo) {
123080
- const rawThreadId = typeof parsed.raw.thread_id === "string" && parsed.raw.thread_id ? parsed.raw.thread_id : void 0;
123087
+ const rawThreadId = realTopicThreadId(parsed.raw.thread_id);
123088
+ const probeThreadId = realTopicThreadId(info.threadId);
123081
123089
  taskRootInfo = {
123082
123090
  guid: todo.taskGuid,
123083
123091
  summary: todo.summaryText,
123084
- topicLink: rawThreadId ? buildTopicDeepLink(parsed.chatId, rawThreadId) : info.threadId ? buildTopicDeepLink(parsed.chatId, info.threadId) : void 0
123092
+ topicLink: rawThreadId ? buildTopicDeepLink(parsed.chatId, rawThreadId) : probeThreadId ? buildTopicDeepLink(parsed.chatId, probeThreadId) : void 0
123085
123093
  };
123086
123094
  }
123087
123095
  }
123088
123096
  }
123089
123097
  if (taskRootInfo && !taskRootInfo.topicLink && replyAnchorId !== messageId && this.deps.messageLookup) {
123090
123098
  const refreshed = await this.deps.messageLookup.get(replyAnchorId, { refresh: true }).catch(() => void 0);
123091
- if (refreshed?.threadId) {
123092
- taskRootInfo.topicLink = buildTopicDeepLink(parsed.chatId, refreshed.threadId);
123099
+ const refreshedThreadId = realTopicThreadId(refreshed?.threadId);
123100
+ if (refreshedThreadId) {
123101
+ taskRootInfo.topicLink = buildTopicDeepLink(parsed.chatId, refreshedThreadId);
123093
123102
  }
123094
123103
  }
123095
123104
  const prompt = await renderPrompt({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkway",
3
- "version": "0.3.40",
3
+ "version": "0.3.41",
4
4
  "description": "Thin bridge: Feishu thread to local Claude Code CLI",
5
5
  "license": "MIT",
6
6
  "author": "Chuck Wu (chuckwu0)",