@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.
- package/package.json +1 -1
- package/src/gateway/workclaw-gateway.ts +8 -2
- package/dist/api.d.ts +0 -3
- package/dist/api.js +0 -3
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -264
- package/dist/setup-entry.d.ts +0 -2
- package/dist/setup-entry.js +0 -12
- package/dist/src/accounts.d.ts +0 -66
- package/dist/src/accounts.js +0 -279
- package/dist/src/api/accounts-api.d.ts +0 -2
- package/dist/src/api/accounts-api.js +0 -130
- package/dist/src/api/prompts-api.d.ts +0 -2
- package/dist/src/api/prompts-api.js +0 -103
- package/dist/src/api/session-api.d.ts +0 -2
- package/dist/src/api/session-api.js +0 -207
- package/dist/src/api/skills-api.d.ts +0 -2
- package/dist/src/api/skills-api.js +0 -64
- package/dist/src/api/workspace.d.ts +0 -3
- package/dist/src/api/workspace.js +0 -30
- package/dist/src/channel.d.ts +0 -11
- package/dist/src/channel.js +0 -199
- package/dist/src/config-schema.d.ts +0 -93
- package/dist/src/config-schema.js +0 -56
- package/dist/src/connection/workclaw-client.d.ts +0 -147
- package/dist/src/connection/workclaw-client.js +0 -351
- package/dist/src/gateway/agent-handlers.d.ts +0 -12
- package/dist/src/gateway/agent-handlers.js +0 -433
- package/dist/src/gateway/config-writer.d.ts +0 -71
- package/dist/src/gateway/config-writer.js +0 -302
- package/dist/src/gateway/cron-tasks-handler.d.ts +0 -19
- package/dist/src/gateway/cron-tasks-handler.js +0 -188
- package/dist/src/gateway/message-context.d.ts +0 -80
- package/dist/src/gateway/message-context.js +0 -509
- package/dist/src/gateway/message-dispatcher.d.ts +0 -18
- package/dist/src/gateway/message-dispatcher.js +0 -572
- package/dist/src/gateway/reconnect.d.ts +0 -27
- package/dist/src/gateway/reconnect.js +0 -210
- package/dist/src/gateway/skills-handler.d.ts +0 -29
- package/dist/src/gateway/skills-handler.js +0 -615
- package/dist/src/gateway/skills-list-handler.d.ts +0 -27
- package/dist/src/gateway/skills-list-handler.js +0 -233
- package/dist/src/gateway/tools-list-handler.d.ts +0 -30
- package/dist/src/gateway/tools-list-handler.js +0 -101
- package/dist/src/gateway/workclaw-gateway.d.ts +0 -14
- package/dist/src/gateway/workclaw-gateway.js +0 -237
- package/dist/src/media/upload.d.ts +0 -13
- package/dist/src/media/upload.js +0 -125
- package/dist/src/outbound/index.d.ts +0 -36
- package/dist/src/outbound/index.js +0 -123
- package/dist/src/outbound/workclaw-sender.d.ts +0 -36
- package/dist/src/outbound/workclaw-sender.js +0 -95
- package/dist/src/runtime.d.ts +0 -116
- package/dist/src/runtime.js +0 -374
- package/dist/src/secret-contract-api.d.ts +0 -4
- package/dist/src/secret-contract-api.js +0 -4
- package/dist/src/send.d.ts +0 -1
- package/dist/src/send.js +0 -1
- package/dist/src/setup-api.d.ts +0 -3
- package/dist/src/setup-api.js +0 -3
- package/dist/src/setup-core.d.ts +0 -3
- package/dist/src/setup-core.js +0 -13
- package/dist/src/setup-surface.d.ts +0 -7
- package/dist/src/setup-surface.js +0 -363
- package/dist/src/tools/openclaw-workclaw-cron/api/index.d.ts +0 -93
- package/dist/src/tools/openclaw-workclaw-cron/api/index.js +0 -209
- package/dist/src/tools/openclaw-workclaw-cron/index.d.ts +0 -10
- package/dist/src/tools/openclaw-workclaw-cron/index.js +0 -33
- package/dist/src/tools/openclaw-workclaw-cron/src/add/params.d.ts +0 -16
- package/dist/src/tools/openclaw-workclaw-cron/src/add/params.js +0 -152
- package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.d.ts +0 -18
- package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.js +0 -162
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.d.ts +0 -14
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.js +0 -80
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.d.ts +0 -14
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.js +0 -107
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.d.ts +0 -14
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.js +0 -80
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.d.ts +0 -14
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.js +0 -107
- package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.d.ts +0 -17
- package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.js +0 -127
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.d.ts +0 -14
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.js +0 -87
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.d.ts +0 -14
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.js +0 -107
- package/dist/src/tools/openclaw-workclaw-cron/src/update/params.d.ts +0 -17
- package/dist/src/tools/openclaw-workclaw-cron/src/update/params.js +0 -164
- package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.d.ts +0 -18
- package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.js +0 -135
- package/dist/src/tools/openclaw-workclaw-cron/types/index.d.ts +0 -52
- package/dist/src/tools/openclaw-workclaw-cron/types/index.js +0 -4
- package/dist/src/tools/openclaw-workclaw-cron/utils/index.d.ts +0 -40
- package/dist/src/tools/openclaw-workclaw-cron/utils/index.js +0 -122
- package/dist/src/tools/openclaw-workclaw-system/index.d.ts +0 -10
- package/dist/src/tools/openclaw-workclaw-system/index.js +0 -15
- package/dist/src/tools/openclaw-workclaw-system/src/get/index.d.ts +0 -8
- package/dist/src/tools/openclaw-workclaw-system/src/get/index.js +0 -64
- package/dist/src/tools/openclaw-workclaw-system/src/token/index.d.ts +0 -8
- package/dist/src/tools/openclaw-workclaw-system/src/token/index.js +0 -78
- package/dist/src/types.d.ts +0 -39
- package/dist/src/types.js +0 -1
- package/dist/src/utils/content.d.ts +0 -15
- 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
|
-
}
|
package/dist/src/types.d.ts
DELETED
|
@@ -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
|
-
}
|