@openclaw/feishu 2026.5.16-beta.2 → 2026.5.16-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
@@ -1469,11 +1469,12 @@ function registerFeishuDocTools(api) {
1469
1469
  }
1470
1470
  //#endregion
1471
1471
  //#region extensions/feishu/src/wiki-schema.ts
1472
+ const WIKI_SPACE_ID_DESCRIPTION = "Knowledge space ID. Treat as an opaque string and keep it quoted; never pass numeric-looking IDs as numbers.";
1472
1473
  const FeishuWikiSchema = Type.Union([
1473
1474
  Type.Object({ action: Type.Literal("spaces") }),
1474
1475
  Type.Object({
1475
1476
  action: Type.Literal("nodes"),
1476
- space_id: Type.String({ description: "Knowledge space ID" }),
1477
+ space_id: Type.String({ description: WIKI_SPACE_ID_DESCRIPTION }),
1477
1478
  parent_node_token: Type.Optional(Type.String({ description: "Parent node token (optional, omit for root)" }))
1478
1479
  }),
1479
1480
  Type.Object({
@@ -1483,11 +1484,11 @@ const FeishuWikiSchema = Type.Union([
1483
1484
  Type.Object({
1484
1485
  action: Type.Literal("search"),
1485
1486
  query: Type.String({ description: "Search query" }),
1486
- space_id: Type.Optional(Type.String({ description: "Limit search to this space (optional)" }))
1487
+ space_id: Type.Optional(Type.String({ description: "Limit search to this knowledge space. Treat as an opaque string and keep it quoted; never pass numeric-looking IDs as numbers." }))
1487
1488
  }),
1488
1489
  Type.Object({
1489
1490
  action: Type.Literal("create"),
1490
- space_id: Type.String({ description: "Knowledge space ID" }),
1491
+ space_id: Type.String({ description: WIKI_SPACE_ID_DESCRIPTION }),
1491
1492
  title: Type.String({ description: "Node title" }),
1492
1493
  obj_type: Type.Optional(Type.Union([
1493
1494
  Type.Literal("docx"),
@@ -1498,14 +1499,14 @@ const FeishuWikiSchema = Type.Union([
1498
1499
  }),
1499
1500
  Type.Object({
1500
1501
  action: Type.Literal("move"),
1501
- space_id: Type.String({ description: "Source knowledge space ID" }),
1502
+ space_id: Type.String({ description: "Source knowledge space ID. Treat as an opaque string and keep it quoted; never pass numeric-looking IDs as numbers." }),
1502
1503
  node_token: Type.String({ description: "Node token to move" }),
1503
- target_space_id: Type.Optional(Type.String({ description: "Target space ID (optional, same space if omitted)" })),
1504
+ target_space_id: Type.Optional(Type.String({ description: "Target knowledge space ID (optional, same space if omitted). Treat as an opaque string and keep it quoted; never pass numeric-looking IDs as numbers." })),
1504
1505
  target_parent_token: Type.Optional(Type.String({ description: "Target parent node token (optional, root if omitted)" }))
1505
1506
  }),
1506
1507
  Type.Object({
1507
1508
  action: Type.Literal("rename"),
1508
- space_id: Type.String({ description: "Knowledge space ID" }),
1509
+ space_id: Type.String({ description: WIKI_SPACE_ID_DESCRIPTION }),
1509
1510
  node_token: Type.String({ description: "Node token to rename" }),
1510
1511
  title: Type.String({ description: "New title" })
1511
1512
  })
@@ -1513,6 +1514,16 @@ const FeishuWikiSchema = Type.Union([
1513
1514
  //#endregion
1514
1515
  //#region extensions/feishu/src/wiki.ts
1515
1516
  const WIKI_ACCESS_HINT = "To grant wiki access: Open wiki space → Settings → Members → Add the bot. See: https://open.feishu.cn/document/server-docs/docs/wiki-v2/wiki-qa#a40ad4ca";
1517
+ function requireWikiSpaceId(value, fieldName) {
1518
+ if (typeof value !== "string") throw new Error(`${fieldName} must be a string. Feishu wiki space IDs are opaque identifiers; pass them quoted to avoid JavaScript number precision loss.`);
1519
+ const trimmed = value.trim();
1520
+ if (!trimmed) throw new Error(`${fieldName} must not be empty.`);
1521
+ return trimmed;
1522
+ }
1523
+ function optionalWikiSpaceId(value, fieldName) {
1524
+ if (value === void 0 || value === null || value === "") return;
1525
+ return requireWikiSpaceId(value, fieldName);
1526
+ }
1516
1527
  async function listSpaces(client) {
1517
1528
  const res = await client.wiki.space.list({});
1518
1529
  if (res.code !== 0) throw new Error(res.msg);
@@ -1623,19 +1634,34 @@ function registerFeishuWikiTools(api) {
1623
1634
  async execute(_toolCallId, params) {
1624
1635
  const p = params;
1625
1636
  try {
1626
- const client = createFeishuToolClient({
1637
+ const createClient = () => createFeishuToolClient({
1627
1638
  api,
1628
1639
  executeParams: p,
1629
1640
  defaultAccountId
1630
1641
  });
1631
1642
  switch (p.action) {
1632
- case "spaces": return jsonToolResult(await listSpaces(client));
1633
- case "nodes": return jsonToolResult(await listNodes(client, p.space_id, p.parent_node_token));
1634
- case "get": return jsonToolResult(await getNode(client, p.token));
1635
- case "search": return jsonToolResult({ error: "Search is not available. Use feishu_wiki with action: 'nodes' to browse or action: 'get' to lookup by token." });
1636
- case "create": return jsonToolResult(await createNode(client, p.space_id, p.title, p.obj_type, p.parent_node_token));
1637
- case "move": return jsonToolResult(await moveNode(client, p.space_id, p.node_token, p.target_space_id, p.target_parent_token));
1638
- case "rename": return jsonToolResult(await renameNode(client, p.space_id, p.node_token, p.title));
1643
+ case "spaces": return jsonToolResult(await listSpaces(createClient()));
1644
+ case "nodes": {
1645
+ const spaceId = requireWikiSpaceId(p.space_id, "space_id");
1646
+ return jsonToolResult(await listNodes(createClient(), spaceId, p.parent_node_token));
1647
+ }
1648
+ case "get": return jsonToolResult(await getNode(createClient(), p.token));
1649
+ case "search":
1650
+ optionalWikiSpaceId(p.space_id, "space_id");
1651
+ createClient();
1652
+ return jsonToolResult({ error: "Search is not available. Use feishu_wiki with action: 'nodes' to browse or action: 'get' to lookup by token." });
1653
+ case "create": {
1654
+ const spaceId = requireWikiSpaceId(p.space_id, "space_id");
1655
+ return jsonToolResult(await createNode(createClient(), spaceId, p.title, p.obj_type, p.parent_node_token));
1656
+ }
1657
+ case "move": {
1658
+ const spaceId = requireWikiSpaceId(p.space_id, "space_id");
1659
+ return jsonToolResult(await moveNode(createClient(), spaceId, p.node_token, optionalWikiSpaceId(p.target_space_id, "target_space_id"), p.target_parent_token));
1660
+ }
1661
+ case "rename": {
1662
+ const spaceId = requireWikiSpaceId(p.space_id, "space_id");
1663
+ return jsonToolResult(await renameNode(createClient(), spaceId, p.node_token, p.title));
1664
+ }
1639
1665
  default: return unknownToolActionResult(p.action);
1640
1666
  }
1641
1667
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/feishu",
3
- "version": "2026.5.16-beta.2",
3
+ "version": "2026.5.16-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.16-beta.2"
20
+ "openclaw": ">=2026.5.16-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.16-beta.2"
51
+ "pluginApi": ">=2026.5.16-beta.4"
52
52
  },
53
53
  "build": {
54
- "openclawVersion": "2026.5.16-beta.2"
54
+ "openclawVersion": "2026.5.16-beta.4"
55
55
  },
56
56
  "release": {
57
57
  "publishToClawHub": true,
@@ -8,6 +8,8 @@ description: |
8
8
 
9
9
  Single tool `feishu_wiki` for knowledge base operations.
10
10
 
11
+ Wiki `space_id` values are opaque strings. Always keep them quoted in tool calls, even when they contain only digits; passing a long numeric-looking ID as a number can corrupt the suffix due to JavaScript number precision limits.
12
+
11
13
  ## Token Extraction
12
14
 
13
15
  From URL `https://xxx.feishu.cn/wiki/ABC123def` → `token` = `ABC123def`