@workclaw/openclaw-workclaw 1.0.23 → 1.0.25

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 (104) hide show
  1. package/package.json +1 -1
  2. package/src/gateway/workclaw-gateway.ts +8 -2
  3. package/dist/api.d.ts +0 -3
  4. package/dist/api.js +0 -3
  5. package/dist/index.d.ts +0 -11
  6. package/dist/index.js +0 -264
  7. package/dist/setup-entry.d.ts +0 -2
  8. package/dist/setup-entry.js +0 -12
  9. package/dist/src/accounts.d.ts +0 -66
  10. package/dist/src/accounts.js +0 -279
  11. package/dist/src/api/accounts-api.d.ts +0 -2
  12. package/dist/src/api/accounts-api.js +0 -130
  13. package/dist/src/api/prompts-api.d.ts +0 -2
  14. package/dist/src/api/prompts-api.js +0 -103
  15. package/dist/src/api/session-api.d.ts +0 -2
  16. package/dist/src/api/session-api.js +0 -207
  17. package/dist/src/api/skills-api.d.ts +0 -2
  18. package/dist/src/api/skills-api.js +0 -64
  19. package/dist/src/api/workspace.d.ts +0 -3
  20. package/dist/src/api/workspace.js +0 -30
  21. package/dist/src/channel.d.ts +0 -11
  22. package/dist/src/channel.js +0 -199
  23. package/dist/src/config-schema.d.ts +0 -93
  24. package/dist/src/config-schema.js +0 -56
  25. package/dist/src/connection/workclaw-client.d.ts +0 -147
  26. package/dist/src/connection/workclaw-client.js +0 -351
  27. package/dist/src/gateway/agent-handlers.d.ts +0 -12
  28. package/dist/src/gateway/agent-handlers.js +0 -433
  29. package/dist/src/gateway/config-writer.d.ts +0 -71
  30. package/dist/src/gateway/config-writer.js +0 -302
  31. package/dist/src/gateway/cron-tasks-handler.d.ts +0 -19
  32. package/dist/src/gateway/cron-tasks-handler.js +0 -188
  33. package/dist/src/gateway/message-context.d.ts +0 -80
  34. package/dist/src/gateway/message-context.js +0 -509
  35. package/dist/src/gateway/message-dispatcher.d.ts +0 -18
  36. package/dist/src/gateway/message-dispatcher.js +0 -572
  37. package/dist/src/gateway/reconnect.d.ts +0 -27
  38. package/dist/src/gateway/reconnect.js +0 -210
  39. package/dist/src/gateway/skills-handler.d.ts +0 -29
  40. package/dist/src/gateway/skills-handler.js +0 -615
  41. package/dist/src/gateway/skills-list-handler.d.ts +0 -27
  42. package/dist/src/gateway/skills-list-handler.js +0 -233
  43. package/dist/src/gateway/tools-list-handler.d.ts +0 -30
  44. package/dist/src/gateway/tools-list-handler.js +0 -101
  45. package/dist/src/gateway/workclaw-gateway.d.ts +0 -14
  46. package/dist/src/gateway/workclaw-gateway.js +0 -237
  47. package/dist/src/media/upload.d.ts +0 -13
  48. package/dist/src/media/upload.js +0 -125
  49. package/dist/src/outbound/index.d.ts +0 -36
  50. package/dist/src/outbound/index.js +0 -123
  51. package/dist/src/outbound/workclaw-sender.d.ts +0 -36
  52. package/dist/src/outbound/workclaw-sender.js +0 -95
  53. package/dist/src/runtime.d.ts +0 -116
  54. package/dist/src/runtime.js +0 -374
  55. package/dist/src/secret-contract-api.d.ts +0 -4
  56. package/dist/src/secret-contract-api.js +0 -4
  57. package/dist/src/send.d.ts +0 -1
  58. package/dist/src/send.js +0 -1
  59. package/dist/src/setup-api.d.ts +0 -3
  60. package/dist/src/setup-api.js +0 -3
  61. package/dist/src/setup-core.d.ts +0 -3
  62. package/dist/src/setup-core.js +0 -13
  63. package/dist/src/setup-surface.d.ts +0 -7
  64. package/dist/src/setup-surface.js +0 -363
  65. package/dist/src/tools/openclaw-workclaw-cron/api/index.d.ts +0 -93
  66. package/dist/src/tools/openclaw-workclaw-cron/api/index.js +0 -209
  67. package/dist/src/tools/openclaw-workclaw-cron/index.d.ts +0 -10
  68. package/dist/src/tools/openclaw-workclaw-cron/index.js +0 -33
  69. package/dist/src/tools/openclaw-workclaw-cron/src/add/params.d.ts +0 -16
  70. package/dist/src/tools/openclaw-workclaw-cron/src/add/params.js +0 -152
  71. package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.d.ts +0 -18
  72. package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.js +0 -162
  73. package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.d.ts +0 -14
  74. package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.js +0 -80
  75. package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.d.ts +0 -14
  76. package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.js +0 -107
  77. package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.d.ts +0 -14
  78. package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.js +0 -80
  79. package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.d.ts +0 -14
  80. package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.js +0 -107
  81. package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.d.ts +0 -17
  82. package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.js +0 -127
  83. package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.d.ts +0 -14
  84. package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.js +0 -87
  85. package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.d.ts +0 -14
  86. package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.js +0 -107
  87. package/dist/src/tools/openclaw-workclaw-cron/src/update/params.d.ts +0 -17
  88. package/dist/src/tools/openclaw-workclaw-cron/src/update/params.js +0 -164
  89. package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.d.ts +0 -18
  90. package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.js +0 -135
  91. package/dist/src/tools/openclaw-workclaw-cron/types/index.d.ts +0 -52
  92. package/dist/src/tools/openclaw-workclaw-cron/types/index.js +0 -4
  93. package/dist/src/tools/openclaw-workclaw-cron/utils/index.d.ts +0 -40
  94. package/dist/src/tools/openclaw-workclaw-cron/utils/index.js +0 -122
  95. package/dist/src/tools/openclaw-workclaw-system/index.d.ts +0 -10
  96. package/dist/src/tools/openclaw-workclaw-system/index.js +0 -15
  97. package/dist/src/tools/openclaw-workclaw-system/src/get/index.d.ts +0 -8
  98. package/dist/src/tools/openclaw-workclaw-system/src/get/index.js +0 -64
  99. package/dist/src/tools/openclaw-workclaw-system/src/token/index.d.ts +0 -8
  100. package/dist/src/tools/openclaw-workclaw-system/src/token/index.js +0 -78
  101. package/dist/src/types.d.ts +0 -39
  102. package/dist/src/types.js +0 -1
  103. package/dist/src/utils/content.d.ts +0 -15
  104. package/dist/src/utils/content.js +0 -38
@@ -1,78 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
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;
package/dist/src/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
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;
@@ -1,38 +0,0 @@
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
- }