@workclaw/openclaw-workclaw 1.0.17 → 1.0.19

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 (147) hide show
  1. package/README.md +364 -325
  2. package/dist/api.d.ts +3 -0
  3. package/dist/api.js +3 -0
  4. package/dist/index.d.ts +11 -0
  5. package/dist/index.js +263 -0
  6. package/dist/setup-entry.d.ts +2 -0
  7. package/dist/setup-entry.js +12 -0
  8. package/dist/src/accounts.d.ts +66 -0
  9. package/dist/src/accounts.js +279 -0
  10. package/dist/src/api/accounts-api.d.ts +2 -0
  11. package/dist/src/api/accounts-api.js +130 -0
  12. package/dist/src/api/prompts-api.d.ts +2 -0
  13. package/dist/src/api/prompts-api.js +103 -0
  14. package/dist/src/api/session-api.d.ts +2 -0
  15. package/dist/src/api/session-api.js +207 -0
  16. package/dist/src/api/skills-api.d.ts +2 -0
  17. package/dist/src/api/skills-api.js +64 -0
  18. package/dist/src/api/workspace.d.ts +3 -0
  19. package/dist/src/api/workspace.js +28 -0
  20. package/dist/src/channel.d.ts +11 -0
  21. package/dist/src/channel.js +198 -0
  22. package/dist/src/config-schema.d.ts +93 -0
  23. package/dist/src/config-schema.js +56 -0
  24. package/dist/src/connection/workclaw-client.d.ts +147 -0
  25. package/dist/src/connection/workclaw-client.js +351 -0
  26. package/dist/src/gateway/agent-handlers.d.ts +12 -0
  27. package/dist/src/gateway/agent-handlers.js +433 -0
  28. package/dist/src/gateway/config-writer.d.ts +71 -0
  29. package/dist/src/gateway/config-writer.js +312 -0
  30. package/dist/src/gateway/message-context.d.ts +76 -0
  31. package/dist/src/gateway/message-context.js +499 -0
  32. package/dist/src/gateway/message-dispatcher.d.ts +19 -0
  33. package/dist/src/gateway/message-dispatcher.js +512 -0
  34. package/dist/src/gateway/reconnect.d.ts +27 -0
  35. package/dist/src/gateway/reconnect.js +206 -0
  36. package/dist/src/gateway/skills-handler.d.ts +29 -0
  37. package/dist/src/gateway/skills-handler.js +576 -0
  38. package/dist/src/gateway/skills-list-handler.d.ts +27 -0
  39. package/dist/src/gateway/skills-list-handler.js +233 -0
  40. package/dist/src/gateway/tools-list-handler.d.ts +30 -0
  41. package/dist/src/gateway/tools-list-handler.js +101 -0
  42. package/dist/src/gateway/workclaw-gateway.d.ts +14 -0
  43. package/dist/src/gateway/workclaw-gateway.js +223 -0
  44. package/dist/src/media/upload.d.ts +13 -0
  45. package/dist/src/media/upload.js +125 -0
  46. package/dist/src/outbound/index.d.ts +36 -0
  47. package/dist/src/outbound/index.js +123 -0
  48. package/dist/src/outbound/workclaw-sender.d.ts +36 -0
  49. package/dist/src/outbound/workclaw-sender.js +95 -0
  50. package/dist/src/runtime.d.ts +116 -0
  51. package/dist/src/runtime.js +374 -0
  52. package/dist/src/secret-contract-api.d.ts +4 -0
  53. package/dist/src/secret-contract-api.js +4 -0
  54. package/dist/src/send.d.ts +1 -0
  55. package/dist/src/send.js +1 -0
  56. package/dist/src/setup-api.d.ts +3 -0
  57. package/dist/src/setup-api.js +3 -0
  58. package/dist/src/setup-core.d.ts +3 -0
  59. package/dist/src/setup-core.js +13 -0
  60. package/dist/src/setup-surface.d.ts +7 -0
  61. package/dist/src/setup-surface.js +363 -0
  62. package/dist/src/tools/openclaw-workclaw-cron/api/index.d.ts +93 -0
  63. package/dist/src/tools/openclaw-workclaw-cron/api/index.js +209 -0
  64. package/dist/src/tools/openclaw-workclaw-cron/index.d.ts +10 -0
  65. package/{src/tools/openclaw-workclaw-cron/index.ts → dist/src/tools/openclaw-workclaw-cron/index.js} +33 -39
  66. package/dist/src/tools/openclaw-workclaw-cron/src/add/params.d.ts +16 -0
  67. package/dist/src/tools/openclaw-workclaw-cron/src/add/params.js +152 -0
  68. package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.d.ts +18 -0
  69. package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.js +162 -0
  70. package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.d.ts +14 -0
  71. package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.js +80 -0
  72. package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.d.ts +14 -0
  73. package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.js +107 -0
  74. package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.d.ts +14 -0
  75. package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.js +80 -0
  76. package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.d.ts +14 -0
  77. package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.js +107 -0
  78. package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.d.ts +17 -0
  79. package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.js +127 -0
  80. package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.d.ts +14 -0
  81. package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.js +87 -0
  82. package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.d.ts +14 -0
  83. package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.js +107 -0
  84. package/dist/src/tools/openclaw-workclaw-cron/src/update/params.d.ts +17 -0
  85. package/dist/src/tools/openclaw-workclaw-cron/src/update/params.js +164 -0
  86. package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.d.ts +18 -0
  87. package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.js +135 -0
  88. package/dist/src/tools/openclaw-workclaw-cron/types/index.d.ts +52 -0
  89. package/dist/src/tools/openclaw-workclaw-cron/types/index.js +4 -0
  90. package/dist/src/tools/openclaw-workclaw-cron/utils/index.d.ts +40 -0
  91. package/dist/src/tools/openclaw-workclaw-cron/utils/index.js +122 -0
  92. package/dist/src/tools/openclaw-workclaw-system/index.d.ts +10 -0
  93. package/{src/tools/openclaw-workclaw-system/index.ts → dist/src/tools/openclaw-workclaw-system/index.js} +15 -17
  94. package/dist/src/tools/openclaw-workclaw-system/src/get/index.d.ts +8 -0
  95. package/dist/src/tools/openclaw-workclaw-system/src/get/index.js +64 -0
  96. package/dist/src/tools/openclaw-workclaw-system/src/token/index.d.ts +8 -0
  97. package/dist/src/tools/openclaw-workclaw-system/src/token/index.js +78 -0
  98. package/dist/src/types.d.ts +39 -0
  99. package/dist/src/types.js +1 -0
  100. package/dist/src/utils/content.d.ts +15 -0
  101. package/dist/src/utils/content.js +38 -0
  102. package/openclaw.plugin.json +1 -0
  103. package/package.json +62 -42
  104. package/skills/openclaw-workclaw-cron/SKILL.md +45 -28
  105. package/index.ts +0 -302
  106. package/src/accounts.ts +0 -287
  107. package/src/api/accounts-api.ts +0 -157
  108. package/src/api/prompts-api.ts +0 -123
  109. package/src/api/session-api.ts +0 -247
  110. package/src/api/skills-api.ts +0 -74
  111. package/src/api/workspace.ts +0 -43
  112. package/src/channel.ts +0 -227
  113. package/src/config-schema.ts +0 -110
  114. package/src/connection/workclaw-client.ts +0 -656
  115. package/src/gateway/agent-handlers.ts +0 -557
  116. package/src/gateway/config-writer.ts +0 -311
  117. package/src/gateway/message-context.ts +0 -422
  118. package/src/gateway/message-dispatcher.ts +0 -601
  119. package/src/gateway/reconnect.ts +0 -149
  120. package/src/gateway/skills-handler.ts +0 -805
  121. package/src/gateway/skills-list-handler.ts +0 -332
  122. package/src/gateway/tools-list-handler.ts +0 -162
  123. package/src/gateway/workclaw-gateway.ts +0 -525
  124. package/src/media/upload.ts +0 -168
  125. package/src/outbound/index.ts +0 -183
  126. package/src/outbound/workclaw-sender.ts +0 -157
  127. package/src/runtime.ts +0 -400
  128. package/src/send.ts +0 -1
  129. package/src/tools/openclaw-workclaw-cron/api/index.ts +0 -326
  130. package/src/tools/openclaw-workclaw-cron/src/add/params.ts +0 -176
  131. package/src/tools/openclaw-workclaw-cron/src/add/sync.ts +0 -188
  132. package/src/tools/openclaw-workclaw-cron/src/disable/params.ts +0 -100
  133. package/src/tools/openclaw-workclaw-cron/src/disable/sync.ts +0 -127
  134. package/src/tools/openclaw-workclaw-cron/src/enable/params.ts +0 -100
  135. package/src/tools/openclaw-workclaw-cron/src/enable/sync.ts +0 -127
  136. package/src/tools/openclaw-workclaw-cron/src/notify/sync.ts +0 -148
  137. package/src/tools/openclaw-workclaw-cron/src/remove/params.ts +0 -109
  138. package/src/tools/openclaw-workclaw-cron/src/remove/sync.ts +0 -127
  139. package/src/tools/openclaw-workclaw-cron/src/update/params.ts +0 -197
  140. package/src/tools/openclaw-workclaw-cron/src/update/sync.ts +0 -161
  141. package/src/tools/openclaw-workclaw-cron/types/index.ts +0 -55
  142. package/src/tools/openclaw-workclaw-cron/utils/index.ts +0 -141
  143. package/src/tools/openclaw-workclaw-system/src/get/index.ts +0 -77
  144. package/src/tools/openclaw-workclaw-system/src/token/index.ts +0 -93
  145. package/src/types.ts +0 -60
  146. package/src/utils/content.ts +0 -40
  147. package/tsconfig.json +0 -11
@@ -0,0 +1,78 @@
1
+ /**
2
+ * 智小途系统信息工具 - 获取用户 AccessToken
3
+ */
4
+ import { resolveWorkclawAccountWithCache } from '../../../../accounts.js';
5
+ import { getWorkclawAccessToken } from '../../../../connection/workclaw-client.js';
6
+ /**
7
+ * 构造工具返回结果
8
+ */
9
+ function json(data) {
10
+ return {
11
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
12
+ details: data,
13
+ };
14
+ }
15
+ /**
16
+ * 获取用户 AccessToken 工具
17
+ */
18
+ function getOpenclawWorkclawSystemTokenTool(api) {
19
+ return (ctx) => {
20
+ return {
21
+ name: 'openclaw-workclaw-system-token',
22
+ label: '智小途获取 AccessToken',
23
+ description: '获取用户的 AccessToken',
24
+ execute: async () => {
25
+ api.logger.info('[智小途-系统信息] 开始获取 AccessToken');
26
+ const accountId = ctx?.agentAccountId;
27
+ if (!accountId) {
28
+ api.logger.warn('[智小途-系统信息] 无法获取账户 ID');
29
+ return json({ error: '无法获取账户 ID(accountId),请确保已配置账户' });
30
+ }
31
+ api.logger.info(`[智小途-系统信息] accountId=${accountId}`);
32
+ const accountConfig = resolveWorkclawAccountWithCache({
33
+ cfg: ctx.config,
34
+ accountId,
35
+ });
36
+ if (!accountConfig.configured) {
37
+ api.logger.error('[智小途-系统信息] 账户未配置');
38
+ return json({ error: '账户未配置,请检查账户配置' });
39
+ }
40
+ const accConfig = accountConfig.config;
41
+ try {
42
+ const tokenCacheKey = accConfig.appKey || accountId;
43
+ api.logger.info(`[智小途-系统信息] 正在获取 AccessToken,accountId=${accountId}`);
44
+ const accessToken = await getWorkclawAccessToken(tokenCacheKey, {
45
+ baseUrl: accConfig.baseUrl,
46
+ appKey: accConfig.appKey,
47
+ appSecret: accConfig.appSecret,
48
+ allowInsecureTls: accConfig.allowInsecureTls,
49
+ requestTimeout: accConfig.requestTimeout,
50
+ });
51
+ api.logger.info('[智小途-系统信息] AccessToken 获取成功');
52
+ return json({
53
+ code: 0,
54
+ message: 'AccessToken 获取成功',
55
+ data: {
56
+ accessToken,
57
+ },
58
+ });
59
+ }
60
+ catch (error) {
61
+ api.logger.error(`[智小途-系统信息] AccessToken 获取失败 ${error.message}`);
62
+ return json({
63
+ code: -1,
64
+ error: error.message || 'AccessToken 获取失败',
65
+ });
66
+ }
67
+ },
68
+ };
69
+ };
70
+ }
71
+ /**
72
+ * 注册获取用户 AccessToken 工具
73
+ */
74
+ export function registerOpenclawWorkclawSystemTokenTool(api) {
75
+ api.registerTool(getOpenclawWorkclawSystemTokenTool(api), {
76
+ name: 'openclaw-workclaw-system-token',
77
+ });
78
+ }
@@ -0,0 +1,39 @@
1
+ import type { workclawConfigSchema, workclawAccountConfigSchema, z } from "./config-schema.js";
2
+ export type WorkclawConfig = z.infer<typeof workclawConfigSchema>;
3
+ export type WorkclawAccountConfig = z.infer<typeof workclawAccountConfigSchema>;
4
+ export type WorkclawConnectionMode = "websocket" | "webhook";
5
+ export type ResolvedWorkclawAccount = {
6
+ accountId: string;
7
+ enabled: boolean;
8
+ configured: boolean;
9
+ name?: string;
10
+ config: WorkclawFullAccountConfig;
11
+ };
12
+ export type ResolvedOpenClawWorkclawAccount = ResolvedWorkclawAccount;
13
+ export type WorkclawIdType = "open_id" | "user_id" | "union_id" | "chat_id";
14
+ export type WorkclawSendResult = {
15
+ messageId: string;
16
+ chatId: string;
17
+ };
18
+ export interface WorkClawBaseConfig {
19
+ baseUrl?: string;
20
+ websocketUrl?: string;
21
+ appKey?: string;
22
+ appSecret?: string;
23
+ localIp?: string;
24
+ allowInsecureTls?: boolean;
25
+ requestTimeout?: number;
26
+ userId?: string | number;
27
+ replyEndpoint?: string;
28
+ pushEndpoint?: string;
29
+ [key: string]: any;
30
+ }
31
+ export interface WorkClawAccountConfig {
32
+ agentId?: string | number;
33
+ userId?: string | number;
34
+ openConversationId?: string;
35
+ [key: string]: any;
36
+ }
37
+ export type WorkClawConfig = WorkClawBaseConfig & WorkClawAccountConfig;
38
+ export type WorkclawFullAccountConfig = WorkclawConfig & Partial<WorkclawAccountConfig>;
39
+ export type ResolvedWorkclawAccountConfig = WorkclawFullAccountConfig;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Content extraction utilities - copied from SDK's internal implementations
3
+ * node_modules/openclaw/dist/plugin-sdk/thread-bindings-SYAnWHuW.js (collectTextContentBlocks)
4
+ * node_modules/openclaw/dist/auth-profiles-DRjqKE3G.js (extractToolResultText)
5
+ */
6
+ /**
7
+ * Extract text blocks from chat content array.
8
+ * Handles content format: [{ type: "text", text: "..." }]
9
+ */
10
+ export declare function collectTextContentBlocks(content: unknown): string[];
11
+ /**
12
+ * Extract plain text from a tool result object.
13
+ * Handles result.content as array of text blocks or direct text fields.
14
+ */
15
+ export declare function extractToolResultText(result: unknown): string | undefined;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Content extraction utilities - copied from SDK's internal implementations
3
+ * node_modules/openclaw/dist/plugin-sdk/thread-bindings-SYAnWHuW.js (collectTextContentBlocks)
4
+ * node_modules/openclaw/dist/auth-profiles-DRjqKE3G.js (extractToolResultText)
5
+ */
6
+ /**
7
+ * Extract text blocks from chat content array.
8
+ * Handles content format: [{ type: "text", text: "..." }]
9
+ */
10
+ export function collectTextContentBlocks(content) {
11
+ if (!Array.isArray(content))
12
+ return [];
13
+ const parts = [];
14
+ for (const block of content) {
15
+ if (!block || typeof block !== "object")
16
+ continue;
17
+ const rec = block;
18
+ if (rec.type === "text" && typeof rec.text === "string")
19
+ parts.push(rec.text);
20
+ }
21
+ return parts;
22
+ }
23
+ /**
24
+ * Extract plain text from a tool result object.
25
+ * Handles result.content as array of text blocks or direct text fields.
26
+ */
27
+ export function extractToolResultText(result) {
28
+ if (!result || typeof result !== "object")
29
+ return;
30
+ const record = result;
31
+ const texts = collectTextContentBlocks(record.content).map((item) => {
32
+ const trimmed = item.trim();
33
+ return trimmed ? trimmed : void 0;
34
+ }).filter((value) => Boolean(value));
35
+ if (texts.length === 0)
36
+ return;
37
+ return texts.join("\n");
38
+ }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "id": "openclaw-workclaw",
3
+ "kind": "channel",
3
4
  "channels": ["openclaw-workclaw"],
4
5
  "skills": ["./skills"],
5
6
  "configSchema": {
package/package.json CHANGED
@@ -1,42 +1,62 @@
1
- {
2
- "name": "@workclaw/openclaw-workclaw",
3
- "type": "module",
4
- "version": "1.0.17",
5
- "description": "OpenClaw WorkClaw channel plugin",
6
- "license": "MIT",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "peerDependencies": {
11
- "openclaw": "^2026.3.13",
12
- "typescript": "^5.6.3"
13
- },
14
- "dependencies": {
15
- "undici": "^7.16.0",
16
- "ws": "^8.19.0",
17
- "zod": "^4.3.6"
18
- },
19
- "openclaw": {
20
- "extensions": [
21
- "./index.ts"
22
- ],
23
- "channel": {
24
- "id": "openclaw-workclaw",
25
- "label": "openclaw-workclaw",
26
- "selectionLabel": "智小途",
27
- "docsPath": "/channels/openclaw-workclaw",
28
- "docsLabel": "openclaw-workclaw",
29
- "blurb": "智小途 企业通讯平台集成",
30
- "aliases": [
31
- "openclaw-workclaw"
32
- ],
33
- "order": 35,
34
- "quickstartAllowFrom": true
35
- },
36
- "install": {
37
- "npmSpec": "@workclaw/openclaw-workclaw",
38
- "localPath": "extensions/openclaw-workclaw",
39
- "defaultChoice": "npm"
40
- }
41
- }
42
- }
1
+ {
2
+ "name": "@workclaw/openclaw-workclaw",
3
+ "type": "module",
4
+ "version": "1.0.19",
5
+ "description": "openclaw-workclaw channel plugin",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "!dist/tests",
14
+ "!dist/**/*.test.js",
15
+ "!dist/**/*.test.d.ts",
16
+ "!dist/vitest.config.js",
17
+ "!dist/vitest.config.d.ts",
18
+ "templates",
19
+ "skills",
20
+ "openclaw.plugin.json"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc"
24
+ },
25
+ "peerDependencies": {
26
+ "openclaw": "2026.4.14",
27
+ "typescript": "^5.6.3"
28
+ },
29
+ "dependencies": {
30
+ "undici": "^7.16.0",
31
+ "ws": "^8.19.0",
32
+ "zod": "^4.3.6"
33
+ },
34
+ "openclaw": {
35
+ "extensions": [
36
+ "./dist/index.js"
37
+ ],
38
+ "setupEntry": "./dist/setup-entry.js",
39
+ "channel": {
40
+ "id": "openclaw-workclaw",
41
+ "label": "openclaw-workclaw",
42
+ "selectionLabel": "智小途",
43
+ "docsPath": "/channels/openclaw-workclaw",
44
+ "docsLabel": "openclaw-workclaw",
45
+ "blurb": "智小途 企业通讯平台集成",
46
+ "aliases": [
47
+ "openclaw-workclaw"
48
+ ],
49
+ "order": 35,
50
+ "quickstartAllowFrom": true
51
+ },
52
+ "compat": {
53
+ "pluginApi": "2026.4.14",
54
+ "minGatewayVersion": "2026.4.14"
55
+ },
56
+ "install": {
57
+ "npmSpec": "@workclaw/openclaw-workclaw",
58
+ "localPath": "extensions/openclaw-workclaw",
59
+ "defaultChoice": "npm"
60
+ }
61
+ }
62
+ }
@@ -15,13 +15,21 @@ always: true
15
15
 
16
16
  你没有内存或后台线程,口头承诺"到时候提醒"是无效的——只有调用工具才能真正注册定时任务。
17
17
 
18
- **🔒 参数强制规则**:
19
- - ❌ **严禁**将 `kind: "cron"` 转换为 `--at` 参数
20
- - **必须**保持 `kind: "cron"` 不变
21
- - **严禁**将 cron 表达式转换为绝对时间(--at)
22
- - ✅ **必须**使用 cron 表达式格式(--cron)
23
- - **必须**使用 `--session isolated + --message`(agentTurn),**禁止**使用 `--system-event`
24
- - ✅ **必须**使用 `--channel "openclaw-workclaw"`
18
+ **🔒 时间格式强制规则(核心!)**:
19
+
20
+ 1. **所有时间都必须转换为 cron 表达式**
21
+ - 相对时间(如 `5m`、`1h`、`1h30m`、`2d`)会自动转换为 cron 表达式
22
+ - 你只需要传入用户说的原始时间,工具会自动转换
23
+ - 示例:`"5分钟后提醒"` 传入 `time: "5m"` 工具转换为 cron 表达式
24
+
25
+ 2. **严禁使用 `--at` 参数**
26
+ - ❌ 禁止将 cron 表达式转换为 `--at` 绝对时间参数
27
+ - ✅ 必须使用 `--cron` 参数传递 cron 表达式
28
+ - ❌ 禁止使用任何绝对时间格式(如 ISO 时间戳)
29
+
30
+ 3. **禁止使用其他定时方式**
31
+ - ❌ 禁止使用 `--at`、`--every`、`--deliver` 等参数
32
+ - ✅ 只能使用 `--cron` 参数
25
33
 
26
34
  ***
27
35
 
@@ -68,24 +76,26 @@ always: true
68
76
 
69
77
  | 参数 | 说明 | 示例 |
70
78
  |------|------|------|
71
- | `time` | 时间描述,支持相对时间(5m、1h)和 cron 表达式(0 8 * * *) | `"5m"` / `"0 8 * * *"` |
79
+ | `time` | **时间(核心!)**,支持相对时间和 cron 表达式,工具会自动统一转换为 cron 表达式 | `"5m"` / `"0 8 * * *"` |
72
80
  | `name` | 任务名称 | `"喝水提醒"` |
73
81
  | `message` | 提醒内容 | `"该喝水了"` |
74
82
 
75
- ### ⏰ 时间格式
83
+ ### ⏰ 时间格式说明
76
84
 
77
- **相对时间**:
78
- - `5m` - 5分钟后
79
- - `1h` - 1小时后
80
- - `1h30m` - 1.5小时后
81
- - `2d` - 2天后
85
+ **⚠️ 重要:所有时间都会被自动转换为 cron 表达式**
82
86
 
83
- **注意:提醒时间不能少于 2 分钟**
87
+ **支持的输入格式**:
88
+ | 输入格式 | 示例 | 说明 |
89
+ |---------|------|------|
90
+ | 相对时间 | `5m` | 5分钟后 |
91
+ | 相对时间 | `1h` | 1小时后 |
92
+ | 相对时间 | `1h30m` | 1.5小时后 |
93
+ | 相对时间 | `2d` | 2天后 |
94
+ | cron 表达式 | `0 8 * * *` | 每天早上8点 |
95
+ | cron 表达式 | `0 22 * * *` | 每天晚上10点 |
96
+ | cron 表达式 | `0 9 * * 1-5` | 工作日早上9点 |
84
97
 
85
- **cron 表达式**:
86
- - `0 8 * * *` - 每天早上8点
87
- - `0 22 * * *` - 每天晚上10点
88
- - `0 9 * * 1-5` - 工作日早上9点
98
+ **⚠️ 提醒时间不能少于 2 分钟**
89
99
 
90
100
  ### 🔍 OpenClaw cron 工具返回值格式(重要!)
91
101
 
@@ -220,7 +230,7 @@ always: true
220
230
  | 参数 | 说明 | 示例 |
221
231
  |------|------|------|
222
232
  | `jobId` | OpenClaw 任务 ID | `"123456"` |
223
- | `time` | 时间描述,支持相对时间(5m、1h)和 cron 表达式 | `"10m"` / `"0 9 * * *"` |
233
+ | `time` | **时间(核心!)**,支持相对时间和 cron 表达式,工具会自动统一转换为 cron 表达式 | `"10m"` / `"0 9 * * *"` |
224
234
  | `name` | 任务名称 | `"新喝水提醒"` |
225
235
  | `message` | 提醒内容 | `"该喝水了"` |
226
236
 
@@ -443,16 +453,23 @@ AI回复2(任务被删除):"🗑️ 该提醒已被删除,无法重新
443
453
 
444
454
  ## 🚫 严禁事项
445
455
 
456
+ ### ⏰ 时间格式相关(最严禁!)
457
+
458
+ - ❌ **严禁**使用 `--at` 参数或其他绝对时间格式
459
+ - ❌ **严禁**将 cron 表达式转换为 `--at` 绝对时间
460
+ - ❌ **严禁**使用 `--every`、`--deliver` 等其他定时参数
461
+ - ✅ **必须**使用 `--cron` 参数传递 cron 表达式
462
+
463
+ ### 🔧 工具调用相关
464
+
446
465
  - ❌ **严禁**只说"好的,我会提醒你"而不调用工具
447
- - ❌ **严禁**在定时任务触发时不调用 `openclaw-workclaw-cron-notify-sync`
448
466
  - ❌ **严禁**传递虚构的 `jobId`,必须从 cron 工具返回值中提取
449
467
  - ❌ **严禁**跳过任何一步骤,必须按顺序执行:参数生成 → cron 工具 → 后端同步
450
- - ❌ **严禁**将 `kind: "cron"` 转换为 `--at` 参数,必须保持 `kind: "cron"` 不变
451
- - ❌ **严禁**将 cron 表达式转换为绝对时间(--at),必须使用 cron 表达式格式(--cron)
452
- - ❌ **严禁**轻易说"任务已被移除",应先尝试启用(enable)操作
468
+ - ❌ **严禁**在定时任务触发时不调用 `openclaw-workclaw-cron-notify-sync`
453
469
  - ❌ **严禁**直接使用 `cron` 命令创建/修改/删除定时任务,必须通过工具参数生成后执行
454
470
  - ❌ **严禁**绕过本 SKILL 中定义的工具流程自行实现定时功能
455
- - ❌ **严禁**使用其他任何未在本 SKILL 中列出的定时任务相关工具
456
- - ❌ **严禁**使用 `--system-event`,必须使用 `--message`(agentTurn)
457
- - **严禁**使用 `--session current`,必须使用 `--session isolated`
458
- - ❌ **严禁**使用 `--channel "last"`,必须使用 `--channel "openclaw-workclaw"`
471
+ - ❌ **严禁**轻易说"任务已被移除",应先尝试启用(enable)操作
472
+
473
+ ### 📝 CLI 参数相关
474
+
475
+ - ❌ **严禁**使用 `--system-event`