@openclaw/feishu 2026.5.10-beta.3 → 2026.5.10-beta.4

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/dist/api.js CHANGED
@@ -2,7 +2,7 @@ import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as bu
2
2
  import { n as createFeishuThreadBindingManager, r as getFeishuThreadBindingManager, t as __testing } from "./thread-bindings-D5kDxq_j.js";
3
3
  import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-BUPKo9Al.js";
4
4
  import { r as listEnabledFeishuAccounts } from "./accounts-CP4tDW-z.js";
5
- import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-B8MvcN0A.js";
5
+ import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-BfpzGx67.js";
6
6
  import { t as getFeishuRuntime } from "./runtime-CG0DuRCy.js";
7
7
  import { a as jsonToolResult, d as registerFeishuChatTools, f as createFeishuToolClient, m as resolveFeishuToolAccount, n as registerFeishuDriveTools, o as toolExecutionErrorResult, p as resolveAnyEnabledFeishuToolsConfig, s as unknownToolActionResult } from "./drive-BocW3yO6.js";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -402,6 +402,7 @@ const feishuSetupAdapter = {
402
402
  //#endregion
403
403
  //#region extensions/feishu/src/setup-surface.ts
404
404
  const channel = "feishu";
405
+ const SCAN_TO_CREATE_TP = "ob_cli_app";
405
406
  function normalizeString(value) {
406
407
  if (typeof value !== "string") return;
407
408
  return value.trim() || void 0;
@@ -535,24 +536,50 @@ function applyNewAppSecurityPolicy(cfg, accountId, openId, groupPolicy) {
535
536
  next = patchFeishuConfig(next, accountId, groupPatch);
536
537
  return next;
537
538
  }
538
- async function runScanToCreate(prompter) {
539
+ async function promptFeishuDomain(params) {
540
+ return await params.prompter.select({
541
+ message: "Which Feishu domain?",
542
+ options: [{
543
+ value: "feishu",
544
+ label: "Feishu (feishu.cn) - China"
545
+ }, {
546
+ value: "lark",
547
+ label: "Lark (larksuite.com) - International"
548
+ }],
549
+ initialValue: params.initialValue ?? "feishu"
550
+ });
551
+ }
552
+ async function promptFeishuSetupMethod(prompter) {
553
+ return await prompter.select({
554
+ message: "How do you want to connect Feishu?",
555
+ options: [{
556
+ value: "manual",
557
+ label: "Enter App ID and App Secret manually"
558
+ }, {
559
+ value: "scan",
560
+ label: "Scan a QR code to create a bot automatically"
561
+ }],
562
+ initialValue: "manual"
563
+ });
564
+ }
565
+ async function runScanToCreate(prompter, domain) {
539
566
  const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await import("./app-registration-B8qc1MCM.js");
540
567
  try {
541
- await initAppRegistration("feishu");
568
+ await initAppRegistration(domain);
542
569
  } catch {
543
570
  await prompter.note("Scan-to-create is not available in this environment. Falling back to manual input.", "Feishu setup");
544
571
  return null;
545
572
  }
546
- const begin = await beginAppRegistration("feishu");
547
- await prompter.note("Scan the QR with Lark/Feishu on your phone.", "Feishu scan-to-create");
573
+ const begin = await beginAppRegistration(domain);
574
+ await prompter.note("Scan the QR with Lark/Feishu on your phone. If the mobile app does not react, rerun setup and choose manual input.", "Feishu scan-to-create");
548
575
  await printQrCode(begin.qrUrl);
549
576
  const progress = prompter.progress("Fetching configuration results...");
550
577
  const outcome = await pollAppRegistration({
551
578
  deviceCode: begin.deviceCode,
552
579
  interval: begin.interval,
553
580
  expireIn: begin.expireIn,
554
- initialDomain: "feishu",
555
- tp: "ob_app"
581
+ initialDomain: domain,
582
+ tp: SCAN_TO_CREATE_TP
556
583
  });
557
584
  switch (outcome.status) {
558
585
  case "success":
@@ -582,7 +609,14 @@ async function runNewAppFlow(params) {
582
609
  let appSecretProbeValue = null;
583
610
  let scanDomain;
584
611
  let scanOpenId;
585
- const scanResult = await runScanToCreate(prompter);
612
+ const currentDomain = (next.channels?.feishu)?.domain ?? "feishu";
613
+ const setupMethod = await promptFeishuSetupMethod(prompter);
614
+ const selectedDomain = await promptFeishuDomain({
615
+ prompter,
616
+ initialValue: currentDomain
617
+ });
618
+ scanDomain = selectedDomain;
619
+ const scanResult = setupMethod === "scan" ? await runScanToCreate(prompter, selectedDomain) : null;
586
620
  if (scanResult) {
587
621
  appId = scanResult.appId;
588
622
  appSecret = scanResult.appSecret;
@@ -590,20 +624,7 @@ async function runNewAppFlow(params) {
590
624
  scanDomain = scanResult.domain;
591
625
  scanOpenId = scanResult.openId;
592
626
  } else {
593
- const feishuCfg = next.channels?.feishu;
594
627
  await noteFeishuCredentialHelp(prompter);
595
- const currentDomain = feishuCfg?.domain ?? "feishu";
596
- scanDomain = await prompter.select({
597
- message: "Which Feishu domain?",
598
- options: [{
599
- value: "feishu",
600
- label: "Feishu (feishu.cn) - China"
601
- }, {
602
- value: "lark",
603
- label: "Lark (larksuite.com) - International"
604
- }],
605
- initialValue: currentDomain
606
- });
607
628
  appId = await promptFeishuAppId({
608
629
  prompter,
609
630
  initialValue: normalizeString(process.env.FEISHU_APP_ID)
@@ -631,7 +652,7 @@ async function runNewAppFlow(params) {
631
652
  scanOpenId = await getAppOwnerOpenId({
632
653
  appId,
633
654
  appSecret: appSecretProbeValue,
634
- domain: scanDomain
655
+ domain: selectedDomain
635
656
  });
636
657
  }
637
658
  }
@@ -1654,7 +1675,7 @@ const feishuPlugin = createChatChannelPlugin({
1654
1675
  })
1655
1676
  }),
1656
1677
  gateway: { startAccount: async (ctx) => {
1657
- const { monitorFeishuProvider } = await import("./monitor-CRLokwPT.js");
1678
+ const { monitorFeishuProvider } = await import("./monitor-BZgAq8ET.js");
1658
1679
  const account = resolveFeishuRuntimeAccount({
1659
1680
  cfg: ctx.cfg,
1660
1681
  accountId: ctx.accountId
@@ -1,2 +1,2 @@
1
- import { t as feishuPlugin } from "./channel-B8MvcN0A.js";
1
+ import { t as feishuPlugin } from "./channel-BfpzGx67.js";
2
2
  export { feishuPlugin };
@@ -3,7 +3,7 @@ import { l as fetchBotIdentityForMonitor } from "./monitor.state-D1WkvOGG.js";
3
3
  //#region extensions/feishu/src/monitor.ts
4
4
  let monitorAccountRuntimePromise;
5
5
  async function loadMonitorAccountRuntime() {
6
- monitorAccountRuntimePromise ??= import("./monitor.account-DfYwuKno.js");
6
+ monitorAccountRuntimePromise ??= import("./monitor.account-CI4_rDnC.js");
7
7
  return await monitorAccountRuntimePromise;
8
8
  }
9
9
  async function monitorFeishuProvider(opts = {}) {
@@ -4844,16 +4844,21 @@ function firstString(...values) {
4844
4844
  if (trimmed) return trimmed;
4845
4845
  }
4846
4846
  }
4847
+ function readFeishuIdentityField(value, field) {
4848
+ if (!isRecord$3(value)) return;
4849
+ return firstString(value[field]);
4850
+ }
4847
4851
  function parseFeishuCardActionEventPayload(value) {
4848
4852
  if (!isRecord$3(value)) return null;
4849
4853
  const operator = isRecord$3(value.operator) ? value.operator : {};
4850
4854
  const action = value.action;
4851
4855
  const context = isRecord$3(value.context) ? value.context : {};
4852
4856
  if (!isRecord$3(action)) return null;
4857
+ const operatorUserId = operator.user_id;
4853
4858
  const token = readString$2(value.token);
4854
- const openId = firstString(operator.open_id, value.open_id, context.open_id);
4855
- const userId = firstString(operator.user_id, value.user_id, context.user_id);
4856
- const unionId = firstString(operator.union_id);
4859
+ const openId = firstString(operator.open_id, readFeishuIdentityField(operatorUserId, "open_id"), value.open_id, context.open_id);
4860
+ const userId = firstString(operator.user_id, readFeishuIdentityField(operatorUserId, "user_id"), value.user_id, context.user_id);
4861
+ const unionId = firstString(operator.union_id, readFeishuIdentityField(operatorUserId, "union_id"));
4857
4862
  const tag = readString$2(action.tag);
4858
4863
  const actionValue = action.value;
4859
4864
  const openMessageId = firstString(value.open_message_id, context.open_message_id);
package/dist/setup-api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-B8MvcN0A.js";
1
+ import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-BfpzGx67.js";
2
2
  export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/feishu",
3
- "version": "2026.5.10-beta.3",
3
+ "version": "2026.5.10-beta.4",
4
4
  "description": "OpenClaw Feishu/Lark channel plugin (community maintained by @m1heng)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "openclaw": "workspace:*"
18
18
  },
19
19
  "peerDependencies": {
20
- "openclaw": ">=2026.5.10-beta.3"
20
+ "openclaw": ">=2026.5.10-beta.4"
21
21
  },
22
22
  "peerDependenciesMeta": {
23
23
  "openclaw": {
@@ -48,10 +48,10 @@
48
48
  "minHostVersion": ">=2026.4.25"
49
49
  },
50
50
  "compat": {
51
- "pluginApi": ">=2026.5.10-beta.3"
51
+ "pluginApi": ">=2026.5.10-beta.4"
52
52
  },
53
53
  "build": {
54
- "openclawVersion": "2026.5.10-beta.3"
54
+ "openclawVersion": "2026.5.10-beta.4"
55
55
  },
56
56
  "release": {
57
57
  "publishToClawHub": true,