@bobotu/feishu-fork 0.1.0

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +922 -0
  3. package/index.ts +65 -0
  4. package/openclaw.plugin.json +10 -0
  5. package/package.json +72 -0
  6. package/skills/feishu-doc/SKILL.md +161 -0
  7. package/skills/feishu-doc/references/block-types.md +102 -0
  8. package/skills/feishu-drive/SKILL.md +96 -0
  9. package/skills/feishu-perm/SKILL.md +90 -0
  10. package/skills/feishu-task/SKILL.md +210 -0
  11. package/skills/feishu-wiki/SKILL.md +96 -0
  12. package/src/accounts.ts +140 -0
  13. package/src/bitable-tools/actions.ts +199 -0
  14. package/src/bitable-tools/common.ts +90 -0
  15. package/src/bitable-tools/index.ts +1 -0
  16. package/src/bitable-tools/meta.ts +80 -0
  17. package/src/bitable-tools/register.ts +195 -0
  18. package/src/bitable-tools/schemas.ts +221 -0
  19. package/src/bot.ts +1125 -0
  20. package/src/channel.ts +334 -0
  21. package/src/client.ts +114 -0
  22. package/src/config-schema.ts +237 -0
  23. package/src/dedup.ts +54 -0
  24. package/src/directory.ts +165 -0
  25. package/src/doc-tools/actions.ts +341 -0
  26. package/src/doc-tools/common.ts +33 -0
  27. package/src/doc-tools/index.ts +2 -0
  28. package/src/doc-tools/register.ts +90 -0
  29. package/src/doc-tools/schemas.ts +85 -0
  30. package/src/doc-write-service.ts +711 -0
  31. package/src/drive-tools/actions.ts +182 -0
  32. package/src/drive-tools/common.ts +18 -0
  33. package/src/drive-tools/index.ts +2 -0
  34. package/src/drive-tools/register.ts +71 -0
  35. package/src/drive-tools/schemas.ts +67 -0
  36. package/src/dynamic-agent.ts +135 -0
  37. package/src/external-keys.ts +19 -0
  38. package/src/media.ts +510 -0
  39. package/src/mention.ts +121 -0
  40. package/src/monitor.ts +323 -0
  41. package/src/onboarding.ts +449 -0
  42. package/src/outbound.ts +40 -0
  43. package/src/perm-tools/actions.ts +111 -0
  44. package/src/perm-tools/common.ts +18 -0
  45. package/src/perm-tools/index.ts +2 -0
  46. package/src/perm-tools/register.ts +65 -0
  47. package/src/perm-tools/schemas.ts +52 -0
  48. package/src/policy.ts +117 -0
  49. package/src/probe.ts +147 -0
  50. package/src/reactions.ts +160 -0
  51. package/src/reply-dispatcher.ts +240 -0
  52. package/src/runtime.ts +14 -0
  53. package/src/send.ts +391 -0
  54. package/src/streaming-card.ts +211 -0
  55. package/src/targets.ts +58 -0
  56. package/src/task-tools/actions.ts +590 -0
  57. package/src/task-tools/common.ts +18 -0
  58. package/src/task-tools/constants.ts +13 -0
  59. package/src/task-tools/index.ts +1 -0
  60. package/src/task-tools/register.ts +263 -0
  61. package/src/task-tools/schemas.ts +567 -0
  62. package/src/text/markdown-links.ts +104 -0
  63. package/src/tools-common/feishu-api.ts +184 -0
  64. package/src/tools-common/tool-context.ts +23 -0
  65. package/src/tools-common/tool-exec.ts +73 -0
  66. package/src/tools-config.ts +22 -0
  67. package/src/types.ts +79 -0
  68. package/src/typing.ts +75 -0
  69. package/src/wiki-tools/actions.ts +166 -0
  70. package/src/wiki-tools/common.ts +18 -0
  71. package/src/wiki-tools/index.ts +2 -0
  72. package/src/wiki-tools/register.ts +66 -0
  73. package/src/wiki-tools/schemas.ts +55 -0
@@ -0,0 +1,85 @@
1
+ import { Type, type Static } from "@sinclair/typebox";
2
+
3
+ export const FeishuDocSchema = Type.Union([
4
+ Type.Object({
5
+ action: Type.Literal("read"),
6
+ doc_token: Type.String({
7
+ description:
8
+ "Document token (extract from URL /docx/XXX or /docs/XXX). Supports both new (docx) and legacy (doc) formats.",
9
+ }),
10
+ }),
11
+ Type.Object({
12
+ action: Type.Literal("write"),
13
+ doc_token: Type.String({ description: "Document token" }),
14
+ content: Type.String({
15
+ description: "Markdown content to write (replaces entire document content)",
16
+ }),
17
+ }),
18
+ Type.Object({
19
+ action: Type.Literal("append"),
20
+ doc_token: Type.String({ description: "Document token" }),
21
+ content: Type.String({ description: "Markdown content to append to end of document" }),
22
+ }),
23
+ Type.Object({
24
+ action: Type.Literal("create"),
25
+ title: Type.String({ description: "Document title" }),
26
+ folder_token: Type.Optional(Type.String({ description: "Target folder token (optional)" })),
27
+ }),
28
+ Type.Object({
29
+ action: Type.Literal("create_and_write"),
30
+ title: Type.String({ description: "Document title" }),
31
+ content: Type.String({
32
+ description: "Markdown content to write immediately after document creation",
33
+ }),
34
+ folder_token: Type.Optional(Type.String({ description: "Target folder token (optional)" })),
35
+ }),
36
+ Type.Object({
37
+ action: Type.Literal("list_blocks"),
38
+ doc_token: Type.String({ description: "Document token" }),
39
+ }),
40
+ Type.Object({
41
+ action: Type.Literal("get_block"),
42
+ doc_token: Type.String({ description: "Document token" }),
43
+ block_id: Type.String({ description: "Block ID (from list_blocks)" }),
44
+ }),
45
+ Type.Object({
46
+ action: Type.Literal("update_block"),
47
+ doc_token: Type.String({ description: "Document token" }),
48
+ block_id: Type.String({ description: "Block ID (from list_blocks)" }),
49
+ content: Type.String({ description: "New text content" }),
50
+ }),
51
+ Type.Object({
52
+ action: Type.Literal("delete_block"),
53
+ doc_token: Type.String({ description: "Document token" }),
54
+ block_id: Type.String({ description: "Block ID" }),
55
+ }),
56
+ Type.Object({
57
+ action: Type.Literal("list_comments"),
58
+ doc_token: Type.String({ description: "Document token" }),
59
+ page_token: Type.Optional(Type.String({ description: "Page token for pagination" })),
60
+ page_size: Type.Optional(
61
+ Type.Integer({ minimum: 1, description: "Page size, default 50 (positive integer)" }),
62
+ ),
63
+ }),
64
+ Type.Object({
65
+ action: Type.Literal("create_comment"),
66
+ doc_token: Type.String({ description: "Document token" }),
67
+ content: Type.String({ description: "Comment content" }),
68
+ }),
69
+ Type.Object({
70
+ action: Type.Literal("get_comment"),
71
+ doc_token: Type.String({ description: "Document token" }),
72
+ comment_id: Type.String({ description: "Comment ID" }),
73
+ }),
74
+ Type.Object({
75
+ action: Type.Literal("list_comment_replies"),
76
+ doc_token: Type.String({ description: "Document token" }),
77
+ comment_id: Type.String({ description: "Comment ID" }),
78
+ page_token: Type.Optional(Type.String({ description: "Page token for pagination" })),
79
+ page_size: Type.Optional(
80
+ Type.Integer({ minimum: 1, description: "Page size, default 50 (positive integer)" }),
81
+ ),
82
+ }),
83
+ ]);
84
+
85
+ export type FeishuDocParams = Static<typeof FeishuDocSchema>;