@clowder-ai/enterprise-workflow 0.0.0-stage → 0.1.0-alpha.2

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 (43) hide show
  1. package/README.en.md +38 -0
  2. package/README.md +19 -2
  3. package/assets/icon.svg +5 -0
  4. package/dist/LarkActionService.d.ts +117 -0
  5. package/dist/LarkActionService.d.ts.map +1 -0
  6. package/dist/LarkActionService.js +189 -0
  7. package/dist/LarkActionService.js.map +1 -0
  8. package/dist/LarkCliExecutor.d.ts +83 -0
  9. package/dist/LarkCliExecutor.d.ts.map +1 -0
  10. package/dist/LarkCliExecutor.js +180 -0
  11. package/dist/LarkCliExecutor.js.map +1 -0
  12. package/dist/WeComActionService.d.ts +75 -0
  13. package/dist/WeComActionService.d.ts.map +1 -0
  14. package/dist/WeComActionService.js +183 -0
  15. package/dist/WeComActionService.js.map +1 -0
  16. package/dist/WeComCliExecutor.d.ts +61 -0
  17. package/dist/WeComCliExecutor.d.ts.map +1 -0
  18. package/dist/WeComCliExecutor.js +136 -0
  19. package/dist/WeComCliExecutor.js.map +1 -0
  20. package/dist/index.d.ts +8 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +8 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/lark-types.d.ts +120 -0
  25. package/dist/lark-types.d.ts.map +1 -0
  26. package/dist/lark-types.js +18 -0
  27. package/dist/lark-types.js.map +1 -0
  28. package/dist/logger.d.ts +13 -0
  29. package/dist/logger.d.ts.map +1 -0
  30. package/dist/logger.js +22 -0
  31. package/dist/logger.js.map +1 -0
  32. package/dist/plugin-entrypoint.d.ts +38 -0
  33. package/dist/plugin-entrypoint.d.ts.map +1 -0
  34. package/dist/plugin-entrypoint.js +180 -0
  35. package/dist/plugin-entrypoint.js.map +1 -0
  36. package/dist/wecom-types.d.ts +85 -0
  37. package/dist/wecom-types.d.ts.map +1 -0
  38. package/dist/wecom-types.js +8 -0
  39. package/dist/wecom-types.js.map +1 -0
  40. package/npm-shrinkwrap.json +687 -0
  41. package/package.json +59 -4
  42. package/plugin.yaml +220 -0
  43. package/skills/enterprise-workflow/SKILL.md +209 -0
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@clowder-ai/enterprise-workflow",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-alpha.2",
4
+ "description": "WeCom and Lark enterprise workflow tools for Clowder AI hosts",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./manifest": "./plugin.yaml"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "dist",
18
+ "plugin.yaml",
19
+ "README.md",
20
+ "assets",
21
+ "skills",
22
+ "npm-shrinkwrap.json",
23
+ "README.en.md"
24
+ ],
25
+ "engines": {
26
+ "node": ">=20.0.0"
27
+ },
28
+ "scripts": {
29
+ "build": "pnpm clean && tsc -p tsconfig.build.json",
30
+ "typecheck": "tsc -p tsconfig.build.json --noEmit && tsc -p tsconfig.test.json",
31
+ "test": "node --import tsx --test src/**/*.test.ts",
32
+ "lint": "tsc -p tsconfig.build.json --noEmit && tsc -p tsconfig.test.json",
33
+ "clean": "rm -rf dist",
34
+ "prepack": "pnpm build"
35
+ },
36
+ "dependencies": {
37
+ "@clowder-ai/plugin-sdk": "0.2.0-beta.21",
38
+ "ajv": "8.20.0"
39
+ },
40
+ "devDependencies": {
41
+ "@clowder-ai/plugin-contract": "0.1.0-beta.37",
42
+ "@types/node": "^20.17.0",
43
+ "tsx": "^4.19.0",
44
+ "typescript": "^5.7.0",
45
+ "yaml": "2.9.0"
46
+ },
47
+ "keywords": [
48
+ "clowder-ai",
49
+ "enterprise",
50
+ "feishu",
51
+ "lark",
52
+ "plugin",
53
+ "wecom",
54
+ "workflow"
55
+ ],
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://github.com/zts212653/clowder-ai-plugins.git",
59
+ "directory": "packages/enterprise-workflow"
60
+ }
61
+ }
package/plugin.yaml ADDED
@@ -0,0 +1,220 @@
1
+ pluginId: official.enterprise-workflow
2
+ version: 0.1.0-alpha.2
3
+ contractVersion: 0.1.0
4
+ name: Enterprise Workflow
5
+ description:
6
+ default: Create governed WeCom and Lark documents, tasks, tables, meetings, and workflows.
7
+ translations:
8
+ zh-CN: 通过受治理的企微与飞书工具创建文档、任务、表格、会议和工作流。
9
+ icon:
10
+ type: svg
11
+ src: assets/icon.svg
12
+ configuration:
13
+ - key: wecomCliPath
14
+ label: wecom-cli path
15
+ description: Executable name or absolute path for the locally installed wecom-cli.
16
+ kind: string
17
+ required: true
18
+ default: wecom-cli
19
+ - key: larkCliPath
20
+ label: lark-cli path
21
+ description: Executable name or absolute path for the locally installed lark-cli.
22
+ kind: string
23
+ required: true
24
+ default: lark-cli
25
+ contributions:
26
+ - type: tool
27
+ id: wecom-actions
28
+ name: wecom_action
29
+ description: Create a governed WeCom document, smart table, todo, meeting, or complete workflow.
30
+ inputSchema:
31
+ type: object
32
+ oneOf:
33
+ - type: object
34
+ additionalProperties: false
35
+ properties:
36
+ action: { const: create_doc }
37
+ docName: { type: string, minLength: 1, maxLength: 200 }
38
+ content: { type: string, maxLength: 500000 }
39
+ required: [action, docName]
40
+ - type: object
41
+ additionalProperties: false
42
+ properties:
43
+ action: { const: create_smart_table }
44
+ tableName: { type: string, minLength: 1, maxLength: 200 }
45
+ fields:
46
+ type: array
47
+ maxItems: 50
48
+ items:
49
+ type: object
50
+ additionalProperties: false
51
+ properties:
52
+ fieldTitle: { type: string }
53
+ fieldType: { type: string }
54
+ required: [fieldTitle, fieldType]
55
+ records:
56
+ type: array
57
+ maxItems: 200
58
+ items: { type: object }
59
+ required: [action, tableName, fields, records]
60
+ - type: object
61
+ additionalProperties: false
62
+ properties:
63
+ action: { const: create_todo }
64
+ content: { type: string, minLength: 1, maxLength: 2000 }
65
+ followerUserIds:
66
+ type: array
67
+ minItems: 1
68
+ maxItems: 50
69
+ items: { type: string }
70
+ remindTime: { type: string }
71
+ required: [action, content, followerUserIds]
72
+ - type: object
73
+ additionalProperties: false
74
+ properties:
75
+ action: { const: create_meeting }
76
+ title: { type: string, minLength: 1, maxLength: 200 }
77
+ startDatetime: { type: string, minLength: 1 }
78
+ durationSeconds: { type: integer, minimum: 300, maximum: 86400 }
79
+ inviteeUserIds:
80
+ type: array
81
+ minItems: 1
82
+ maxItems: 100
83
+ items: { type: string }
84
+ required: [action, title, startDatetime, durationSeconds, inviteeUserIds]
85
+ - type: object
86
+ additionalProperties: false
87
+ properties:
88
+ action: { const: golden_chain }
89
+ docName: { type: string, minLength: 1, maxLength: 200 }
90
+ docContent: { type: string, minLength: 1, maxLength: 500000 }
91
+ tableName: { type: string, minLength: 1, maxLength: 200 }
92
+ tasks:
93
+ type: array
94
+ minItems: 1
95
+ maxItems: 50
96
+ items:
97
+ type: object
98
+ additionalProperties: false
99
+ properties:
100
+ content: { type: string, minLength: 1 }
101
+ assigneeUserId: { type: string, minLength: 1 }
102
+ remindTime: { type: string }
103
+ required: [content, assigneeUserId]
104
+ meetingTitle: { type: string, minLength: 1, maxLength: 200 }
105
+ meetingStart: { type: string, minLength: 1 }
106
+ meetingDurationSeconds: { type: integer, minimum: 300, maximum: 86400 }
107
+ meetingInviteeUserIds:
108
+ type: array
109
+ minItems: 1
110
+ maxItems: 100
111
+ items: { type: string }
112
+ required: [action, docName, docContent, tableName, tasks, meetingTitle, meetingStart, meetingDurationSeconds, meetingInviteeUserIds]
113
+ action:
114
+ method: wecom.action
115
+ - type: tool
116
+ id: lark-actions
117
+ name: lark_action
118
+ description: Create a governed Lark document, Base, task, calendar event, slides deck, or complete workflow.
119
+ inputSchema:
120
+ type: object
121
+ oneOf:
122
+ - type: object
123
+ additionalProperties: false
124
+ properties:
125
+ action: { const: create_doc }
126
+ title: { type: string, minLength: 1, maxLength: 200 }
127
+ markdown: { type: string, maxLength: 500000 }
128
+ folderToken: { type: string }
129
+ required: [action, title]
130
+ - type: object
131
+ additionalProperties: false
132
+ properties:
133
+ action: { const: create_base }
134
+ name: { type: string, minLength: 1, maxLength: 200 }
135
+ folderToken: { type: string }
136
+ timeZone: { type: string }
137
+ required: [action, name]
138
+ - type: object
139
+ additionalProperties: false
140
+ properties:
141
+ action: { const: create_task }
142
+ summary: { type: string, minLength: 1, maxLength: 500 }
143
+ description: { type: string, maxLength: 10000 }
144
+ assigneeOpenId: { type: string }
145
+ due: { type: string }
146
+ idempotencyKey: { type: string }
147
+ required: [action, summary]
148
+ - type: object
149
+ additionalProperties: false
150
+ properties:
151
+ action: { const: create_calendar_event }
152
+ summary: { type: string, minLength: 1, maxLength: 200 }
153
+ description: { type: string, maxLength: 10000 }
154
+ start: { type: string, minLength: 1 }
155
+ end: { type: string, minLength: 1 }
156
+ attendeeOpenIds:
157
+ type: array
158
+ maxItems: 100
159
+ items: { type: string }
160
+ calendarId: { type: string }
161
+ rrule: { type: string }
162
+ required: [action, summary, start, end]
163
+ - type: object
164
+ additionalProperties: false
165
+ properties:
166
+ action: { const: create_slides }
167
+ title: { type: string, minLength: 1, maxLength: 200 }
168
+ folderToken: { type: string }
169
+ required: [action, title]
170
+ - type: object
171
+ additionalProperties: false
172
+ properties:
173
+ action: { const: golden_chain }
174
+ docTitle: { type: string, minLength: 1, maxLength: 200 }
175
+ docMarkdown: { type: string, minLength: 1, maxLength: 500000 }
176
+ baseName: { type: string, minLength: 1, maxLength: 200 }
177
+ tasks:
178
+ type: array
179
+ minItems: 1
180
+ maxItems: 50
181
+ items:
182
+ type: object
183
+ additionalProperties: false
184
+ properties:
185
+ summary: { type: string, minLength: 1 }
186
+ assigneeOpenId: { type: string, minLength: 1 }
187
+ due: { type: string }
188
+ description: { type: string }
189
+ required: [summary, assigneeOpenId]
190
+ calendarSummary: { type: string, minLength: 1, maxLength: 200 }
191
+ calendarStart: { type: string, minLength: 1 }
192
+ calendarEnd: { type: string, minLength: 1 }
193
+ calendarAttendeeOpenIds:
194
+ type: array
195
+ minItems: 1
196
+ maxItems: 100
197
+ items: { type: string }
198
+ includeSlides: { type: boolean }
199
+ required: [action, docTitle, docMarkdown, baseName, tasks, calendarSummary, calendarStart, calendarEnd, calendarAttendeeOpenIds]
200
+ action:
201
+ method: lark.action
202
+ - type: skill
203
+ id: enterprise-workflow-skill
204
+ path: skills/enterprise-workflow
205
+ features:
206
+ - id: enterprise-actions
207
+ name: Enterprise workflow actions
208
+ resources: []
209
+ contributions:
210
+ - type: tool
211
+ id: wecom-actions
212
+ - type: tool
213
+ id: lark-actions
214
+ - type: skill
215
+ id: enterprise-workflow-skill
216
+ capabilities:
217
+ - plugin.config.read
218
+ runtime:
219
+ transport: builtin
220
+ entrypoint: dist/plugin-entrypoint.js
@@ -0,0 +1,209 @@
1
+ ---
2
+ name: enterprise-workflow
3
+ description: >
4
+ 企业 IM 工作流自动化:文档、表格、待办/任务、会议/日程一键创建。
5
+ Use when: operator要求创建企微/飞书的文档、表格、待办、会议、日程、幻灯片,或一句话生成完整工作流。
6
+ Not for: 普通聊天、消息收发、会议纪要 intake,或插件安装与配置。
7
+ Output: 通过 Host 的 plugin_call 返回企业资源 handle 与链接。
8
+ triggers:
9
+ - 创建文档
10
+ - 创建表格
11
+ - 创建待办
12
+ - 创建任务
13
+ - 创建会议
14
+ - 创建日程
15
+ - 幻灯片
16
+ - golden chain
17
+ - 工作流
18
+ - 飞书
19
+ - lark
20
+ - 企微
21
+ - wecom
22
+ ---
23
+
24
+ # Enterprise Workflow — 企业 IM 工作流自动化
25
+
26
+ 这个 skill 使用已安装插件 `official.enterprise-workflow` 的声明式工具。Host 负责调用身份、
27
+ 审计、实时实例与授权校验;插件负责通过本机官方 CLI 创建资源。
28
+
29
+ ## 调用纪律
30
+
31
+ 1. 先用 `plugin_get` 确认插件已启用且运行。
32
+ 2. 每次操作前用 `plugin_list_tools({ pluginId: "official.enterprise-workflow" })` 读取实时 schema。
33
+ 3. 只从返回结果选择以下精确坐标之一:
34
+ - `contributionId: "wecom-actions"`, `toolName: "wecom_action"`
35
+ - `contributionId: "lark-actions"`, `toolName: "lark_action"`
36
+ 4. 用 `plugin_call`,把 action 参数放入 `arguments`。
37
+ 5. 不猜 schema,不传 `invocationId` / `callbackToken`,不调用旧 `/api/callbacks/*-action`,不裸调 CLI。
38
+
39
+ 调用外壳:
40
+
41
+ ```json
42
+ {
43
+ "pluginId": "official.enterprise-workflow",
44
+ "contributionId": "wecom-actions",
45
+ "toolName": "wecom_action",
46
+ "arguments": {
47
+ "action": "create_doc",
48
+ "docName": "会议纪要",
49
+ "content": "# 纪要"
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## 平台选择
55
+
56
+ | operator 提到 | 工具 |
57
+ |---|---|
58
+ | 企微 / WeCom / 企业微信 | `wecom_action` |
59
+ | 飞书 / Feishu / Lark | `lark_action` |
60
+ | 只说企业 IM | 先问平台;不要自行跨租户创建 |
61
+
62
+ ## WeCom actions
63
+
64
+ ### 创建文档
65
+
66
+ ```json
67
+ { "action": "create_doc", "docName": "会议纪要", "content": "# 纪要\n..." }
68
+ ```
69
+
70
+ ### 创建智能表格
71
+
72
+ ```json
73
+ {
74
+ "action": "create_smart_table",
75
+ "tableName": "Bug 跟踪表",
76
+ "fields": [
77
+ { "fieldTitle": "Bug", "fieldType": "FIELD_TYPE_TEXT" },
78
+ { "fieldTitle": "优先级", "fieldType": "FIELD_TYPE_SINGLE_SELECT" }
79
+ ],
80
+ "records": [{ "Bug": "登录超时", "优先级": "P1" }]
81
+ }
82
+ ```
83
+
84
+ ### 创建待办
85
+
86
+ ```json
87
+ {
88
+ "action": "create_todo",
89
+ "content": "Review PRD",
90
+ "followerUserIds": ["zhangsan"],
91
+ "remindTime": "2026-04-20 09:00:00"
92
+ }
93
+ ```
94
+
95
+ ### 创建会议
96
+
97
+ ```json
98
+ {
99
+ "action": "create_meeting",
100
+ "title": "评审",
101
+ "startDatetime": "2026-04-20 14:00",
102
+ "durationSeconds": 3600,
103
+ "inviteeUserIds": ["zhangsan"]
104
+ }
105
+ ```
106
+
107
+ ### WeCom golden chain
108
+
109
+ ```json
110
+ {
111
+ "action": "golden_chain",
112
+ "docName": "Q2 产品 PRD",
113
+ "docContent": "# Q2 产品规划\n...",
114
+ "tableName": "Q2 任务跟踪表",
115
+ "tasks": [
116
+ { "content": "完成 API 设计", "assigneeUserId": "zhangsan", "remindTime": "2026-04-20 09:00:00" }
117
+ ],
118
+ "meetingTitle": "Q2 PRD 评审会",
119
+ "meetingStart": "2026-04-20 14:00",
120
+ "meetingDurationSeconds": 3600,
121
+ "meetingInviteeUserIds": ["zhangsan", "lisi"]
122
+ }
123
+ ```
124
+
125
+ ## Lark actions
126
+
127
+ ### 创建文档
128
+
129
+ ```json
130
+ { "action": "create_doc", "title": "会议纪要", "markdown": "# 纪要\n..." }
131
+ ```
132
+
133
+ ### 创建多维表
134
+
135
+ ```json
136
+ { "action": "create_base", "name": "Bug 跟踪表", "timeZone": "Asia/Shanghai" }
137
+ ```
138
+
139
+ ### 创建任务
140
+
141
+ ```json
142
+ {
143
+ "action": "create_task",
144
+ "summary": "Review PRD",
145
+ "assigneeOpenId": "ou_xxx",
146
+ "due": "2026-04-20"
147
+ }
148
+ ```
149
+
150
+ ### 创建日程
151
+
152
+ ```json
153
+ {
154
+ "action": "create_calendar_event",
155
+ "summary": "评审",
156
+ "start": "2026-04-20T14:00:00+08:00",
157
+ "end": "2026-04-20T15:00:00+08:00",
158
+ "attendeeOpenIds": ["ou_xxx"]
159
+ }
160
+ ```
161
+
162
+ ### 创建幻灯片
163
+
164
+ ```json
165
+ { "action": "create_slides", "title": "Q2 Deck" }
166
+ ```
167
+
168
+ ### Lark golden chain
169
+
170
+ ```json
171
+ {
172
+ "action": "golden_chain",
173
+ "docTitle": "Q2 产品 PRD",
174
+ "docMarkdown": "# Q2 产品规划\n...",
175
+ "baseName": "Q2 任务跟踪表",
176
+ "tasks": [
177
+ { "summary": "完成 API 设计", "assigneeOpenId": "ou_xxx", "due": "+3d" }
178
+ ],
179
+ "calendarSummary": "Q2 PRD 评审会",
180
+ "calendarStart": "2026-04-20T14:00:00+08:00",
181
+ "calendarEnd": "2026-04-20T15:00:00+08:00",
182
+ "calendarAttendeeOpenIds": ["ou_xxx", "ou_yyy"],
183
+ "includeSlides": true
184
+ }
185
+ ```
186
+
187
+ ## 结果与失败
188
+
189
+ - 成功结果直接是所选 action 的资源 handle;`golden_chain` 还包含可回贴的 `summary`。
190
+ - `INVALID_INPUT`:参数不符合 `plugin_list_tools` 返回的 schema;修正参数,不要重试原请求。
191
+ - `VENDOR_API_ERROR`:厂商 API 拒绝,等价于旧回调的 502;根据错误码和权限处理。
192
+ - `CLI_UNAVAILABLE`:CLI 路径无效、未安装、未登录或超时,等价于旧回调的 503;请 operator 修复本机配置。
193
+ - `CLI_PROTOCOL_ERROR`:CLI 输出与已验证协议不符;停止操作并报告,不要把它降级成“没找到资源”。
194
+
195
+ ## 回贴格式
196
+
197
+ 只回贴实际返回的 handle,不虚构 URL、用户或会议链接。示例:
198
+
199
+ ```text
200
+ 已完成工作流创建:
201
+
202
+ 📄 文档: Q2 产品 PRD — <returned URL>
203
+ 📊 表格: Q2 任务跟踪表 — <returned URL>
204
+ ✅ 任务: 2 条已分发
205
+ 🗓 日程: Q2 PRD 评审会
206
+ ```
207
+
208
+ 未知 user ID / open ID 时先向 operator 索取或使用已授权的通讯录能力;本插件没有用户搜索工具,
209
+ 不得绕过 `plugin_call` 直接调用 CLI 搜索。