openclaw-openagent 1.0.13 → 1.0.14
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/dist/src/messaging/executor.d.ts +2 -3
- package/dist/src/messaging/executor.js +4 -31
- package/dist/src/plugin-ui/assets/openagent-override.js +4 -5
- package/dist/src/runtime/update-checker.d.ts +1 -1
- package/dist/src/runtime/update-checker.js +9 -46
- package/package.json +1 -3
- package/src/app/channel-tools.ts +0 -249
- package/src/app/discovery-tools.ts +0 -273
- package/src/app/download-file-tool.ts +0 -133
- package/src/app/hooks.ts +0 -144
- package/src/app/index.ts +0 -84
- package/src/app/messaging-tools.ts +0 -79
- package/src/app/ops-tools.ts +0 -155
- package/src/app/remote-agent-tool.ts +0 -762
- package/src/app/types.ts +0 -68
- package/src/app/upload-file-tool.ts +0 -411
- package/src/app/verbose-preflight.ts +0 -190
- package/src/auth/config.ts +0 -266
- package/src/auth/credential-manager.ts +0 -146
- package/src/auth/index.ts +0 -24
- package/src/auth/verify.ts +0 -99
- package/src/channel.ts +0 -566
- package/src/compat.ts +0 -94
- package/src/config/config-schema.ts +0 -45
- package/src/messaging/aggregator.ts +0 -120
- package/src/messaging/collector.ts +0 -89
- package/src/messaging/executor.ts +0 -72
- package/src/messaging/inbound.ts +0 -150
- package/src/messaging/index.ts +0 -11
- package/src/messaging/mention-protocol.ts +0 -94
- package/src/messaging/process-c2c-request.ts +0 -564
- package/src/messaging/process-message.ts +0 -373
- package/src/messaging/scheduler.ts +0 -55
- package/src/messaging/types.ts +0 -38
- package/src/plugin-ui/adapters/oc-2026-04.js +0 -103
- package/src/plugin-ui/adapters/oc-2026-05.js +0 -125
- package/src/plugin-ui/adapters/oc-2026-06.js +0 -125
- package/src/plugin-ui/adapters/oc-unknown.js +0 -48
- package/src/plugin-ui/assets/agentbook-icon.svg +0 -5
- package/src/plugin-ui/assets/bg.png +0 -0
- package/src/plugin-ui/assets/icon.png +0 -0
- package/src/plugin-ui/assets/magic.svg +0 -5
- package/src/plugin-ui/assets/openagent-override.js +0 -11263
- package/src/plugin-ui/build.cjs +0 -463
- package/src/plugin-ui/index.ts +0 -18
- package/src/plugin-ui/modules/agent-book/panel/agent-book.js +0 -570
- package/src/plugin-ui/modules/agent-book/panel/agent-card.js +0 -170
- package/src/plugin-ui/modules/agent-book/panel/agent-data.js +0 -643
- package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +0 -665
- package/src/plugin-ui/modules/agent-book/panel/mention-state.js +0 -206
- package/src/plugin-ui/modules/agent-book/panel/styles.js +0 -832
- package/src/plugin-ui/modules/agent-book/panel/theme-adapter.js +0 -86
- package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +0 -295
- package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +0 -211
- package/src/plugin-ui/modules/agent-book/scanner.js +0 -131
- package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +0 -500
- package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +0 -652
- package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +0 -262
- package/src/plugin-ui/modules/loader/bootstrap.js +0 -133
- package/src/plugin-ui/modules/loader/shared-state.js +0 -838
- package/src/plugin-ui/modules/loader/ws-intercept.js +0 -199
- package/src/plugin-ui/modules/remote-agent/chunk-parser.js +0 -161
- package/src/plugin-ui/modules/remote-agent/execution-card.js +0 -530
- package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +0 -256
- package/src/plugin-ui/modules/remote-agent/media-links.js +0 -151
- package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +0 -134
- package/src/plugin-ui/modules/remote-agent/output-card.js +0 -342
- package/src/plugin-ui/modules/remote-agent/progress-store.js +0 -363
- package/src/plugin-ui/modules/remote-agent/render-hooks.js +0 -1700
- package/src/plugin-ui/modules/remote-agent/styles.js +0 -903
- package/src/plugin-ui/modules/remote-agent/tool-card-model.js +0 -130
- package/src/plugin-ui/postinstall-deploy.cjs +0 -52
- package/src/plugin-ui/ui-extension-loader/backup.ts +0 -92
- package/src/plugin-ui/ui-extension-loader/index.ts +0 -276
- package/src/plugin-ui/ui-extension-loader/locator.ts +0 -152
- package/src/plugin-ui/ui-extension-loader/manifest.ts +0 -57
- package/src/plugin-ui/ui-extension-loader/registry-regex.ts +0 -944
- package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +0 -70
- package/src/plugin-ui/ui-extension-loader/types.ts +0 -72
- package/src/proxy/auth-proxy.ts +0 -414
- package/src/runtime/account.ts +0 -549
- package/src/runtime/index.ts +0 -7
- package/src/runtime/plugin-runtime.ts +0 -94
- package/src/runtime/registry.ts +0 -71
- package/src/runtime/update-checker.ts +0 -286
- package/src/sdk/CLASS_MAP.md +0 -143
- package/src/sdk/index.d.ts +0 -126
- package/src/sdk/index.js +0 -23990
- package/src/sdk/modules/cloud-search-module.js +0 -1117
- package/src/sdk/modules/follow-module.js +0 -1069
- package/src/sdk/modules/group-module.js +0 -7397
- package/src/sdk/modules/relationship-module.js +0 -2269
- package/src/sdk/modules/signaling-module.js +0 -1468
- package/src/sdk/modules/tim-upload-plugin.js +0 -730
- package/src/sdk/node-env/http-request.js +0 -90
- package/src/sdk/node-env/index.js +0 -57
- package/src/sdk/node-env/storage.js +0 -114
- package/src/sdk/package.json +0 -10
- package/src/sdk/tsconfig.json +0 -16
- package/src/state/pending-invocation-store.ts +0 -43
- package/src/state/store.ts +0 -756
- package/src/tim/c2c.ts +0 -451
- package/src/tim/channels.ts +0 -364
- package/src/tim/client.ts +0 -330
- package/src/tim/index.ts +0 -18
- package/src/tim/messages.ts +0 -166
- package/src/tim/sdk-logger-init.ts +0 -50
- package/src/tools.ts +0 -10
- package/src/transport/factory.ts +0 -95
- package/src/transport/oasn/index.ts +0 -17
- package/src/transport/oasn/oasn-agent-card.ts +0 -111
- package/src/transport/oasn/oasn-discovery.ts +0 -108
- package/src/transport/oasn/oasn-files.ts +0 -210
- package/src/transport/oasn/oasn-http.ts +0 -529
- package/src/transport/oasn/oasn-invocation.ts +0 -604
- package/src/transport/oasn/oasn-normalize.ts +0 -133
- package/src/transport/oasn/oasn-register.ts +0 -33
- package/src/transport/oasn/oasn-transport.ts +0 -318
- package/src/transport/oasn/oasn-types.ts +0 -404
- package/src/transport/tim/index.ts +0 -8
- package/src/transport/tim/tim-transport.ts +0 -515
- package/src/transport/types.ts +0 -538
- package/src/types/openclaw-plugin-sdk-media-store.d.ts +0 -9
- package/src/types/openclaw.d.ts +0 -97
- package/src/types/tencentcloud-chat.d.ts +0 -15
- package/src/util/http.ts +0 -113
- package/src/util/logger.ts +0 -131
- package/src/util/url-resolver.ts +0 -77
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Messaging Tools — 4 message-related tools
|
|
3
|
-
*
|
|
4
|
-
* send_message, get_messages, set_channel_skill, get_channel_skill
|
|
5
|
-
* Note: skill tools are in channel-tools.ts since they manage channel metadata
|
|
6
|
-
*
|
|
7
|
-
* This file contains: send_message, get_messages
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { registry } from '../runtime/registry.js';
|
|
11
|
-
import { logger } from '../util/logger.js';
|
|
12
|
-
import { toolResult, type ToolDescriptor, type ToolParams, type ToolResult } from './types.js';
|
|
13
|
-
|
|
14
|
-
function fail(error: string): ToolResult {
|
|
15
|
-
return toolResult(JSON.stringify({ success: false, error }));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function getRuntime() {
|
|
19
|
-
const rt = registry.getDefault();
|
|
20
|
-
if (!rt || !rt.isRunning) return null;
|
|
21
|
-
return rt;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function createSendMessageTool(): ToolDescriptor {
|
|
25
|
-
return {
|
|
26
|
-
name: 'openagent_send_message',
|
|
27
|
-
label: 'Send OpenAgent Message',
|
|
28
|
-
description: 'Send a text message to a channel',
|
|
29
|
-
parameters: {
|
|
30
|
-
type: 'object',
|
|
31
|
-
properties: {
|
|
32
|
-
channelId: { type: 'string', description: 'Channel ID' },
|
|
33
|
-
text: { type: 'string', description: 'Message text' },
|
|
34
|
-
},
|
|
35
|
-
required: ['channelId', 'text'],
|
|
36
|
-
},
|
|
37
|
-
async execute(_id: unknown, params: ToolParams) {
|
|
38
|
-
const rt = getRuntime();
|
|
39
|
-
if (!rt) return fail('Not connected');
|
|
40
|
-
try {
|
|
41
|
-
const result = await rt.sendMessage(String(params.channelId), String(params.text));
|
|
42
|
-
if (rt.store) {
|
|
43
|
-
rt.store.updateLastReply(String(params.channelId));
|
|
44
|
-
}
|
|
45
|
-
return toolResult(JSON.stringify({ success: true, messageId: result.messageId }));
|
|
46
|
-
} catch (err) {
|
|
47
|
-
return fail((err as Error).message);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function createGetMessagesTool(): ToolDescriptor {
|
|
54
|
-
return {
|
|
55
|
-
name: 'openagent_get_messages',
|
|
56
|
-
label: 'Get Channel Messages',
|
|
57
|
-
description: 'Get recent messages from a channel (must join channel first)',
|
|
58
|
-
parameters: {
|
|
59
|
-
type: 'object',
|
|
60
|
-
properties: {
|
|
61
|
-
channelId: { type: 'string', description: 'Channel ID' },
|
|
62
|
-
count: { type: 'integer', description: 'Number of messages (default 15)' },
|
|
63
|
-
},
|
|
64
|
-
required: ['channelId'],
|
|
65
|
-
},
|
|
66
|
-
async execute(_id: unknown, params: ToolParams) {
|
|
67
|
-
const rt = getRuntime();
|
|
68
|
-
if (!rt) return fail('Not connected');
|
|
69
|
-
try {
|
|
70
|
-
const count = (params.count as number) || 15;
|
|
71
|
-
const messages = await rt.fetchMessages(String(params.channelId), count);
|
|
72
|
-
return toolResult(JSON.stringify({ success: true, messages }));
|
|
73
|
-
} catch (err) {
|
|
74
|
-
logger.error(`[tools] getMessages error: ${(err as Error).message}`);
|
|
75
|
-
return fail((err as Error).message);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
package/src/app/ops-tools.ts
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ops Tools — 4 operational tools
|
|
3
|
-
*
|
|
4
|
-
* set_strategy, get_status, set_purpose, get_purpose
|
|
5
|
-
*
|
|
6
|
-
* Contract ref: §0.2 refactoring-plan.md
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { registry } from '../runtime/registry.js';
|
|
10
|
-
import { toolResult, type ToolDescriptor, type ToolResult } from './types.js';
|
|
11
|
-
|
|
12
|
-
function fail(error: string): ToolResult {
|
|
13
|
-
return toolResult(JSON.stringify({ success: false, error }));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function getRuntime() {
|
|
17
|
-
const rt = registry.getDefault();
|
|
18
|
-
if (!rt || !rt.isRunning) return null;
|
|
19
|
-
return rt;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function createSetStrategyTool(): ToolDescriptor {
|
|
23
|
-
return {
|
|
24
|
-
name: 'openagent_set_strategy',
|
|
25
|
-
label: 'Set Message Strategy',
|
|
26
|
-
description: 'Configure how you receive and respond to channel messages. Changes take effect immediately.',
|
|
27
|
-
parameters: {
|
|
28
|
-
type: 'object',
|
|
29
|
-
properties: {
|
|
30
|
-
batchWindowMs: { type: 'integer', description: 'How long to collect messages before processing (ms, default 20000)' },
|
|
31
|
-
maxBatchSize: { type: 'integer', description: 'Max messages to buffer before forced flush (default 20)' },
|
|
32
|
-
},
|
|
33
|
-
required: [],
|
|
34
|
-
},
|
|
35
|
-
async execute(_id, params) {
|
|
36
|
-
const rt = getRuntime();
|
|
37
|
-
if (!rt) return fail('Not connected');
|
|
38
|
-
try {
|
|
39
|
-
const newConfig: { batchWindowMs?: number; maxBatchSize?: number } = {};
|
|
40
|
-
if (params?.batchWindowMs != null) newConfig.batchWindowMs = Number(params.batchWindowMs);
|
|
41
|
-
if (params?.maxBatchSize != null) newConfig.maxBatchSize = Number(params.maxBatchSize);
|
|
42
|
-
const current = rt.updateStrategy(newConfig);
|
|
43
|
-
return toolResult(JSON.stringify({
|
|
44
|
-
success: true,
|
|
45
|
-
batchWindowMs: current.batchWindowMs,
|
|
46
|
-
maxBatchSize: current.maxBatchSize,
|
|
47
|
-
}));
|
|
48
|
-
} catch (err) {
|
|
49
|
-
return fail((err as Error).message);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* get_status — frozen return shape per §0.2:
|
|
57
|
-
*
|
|
58
|
-
* {
|
|
59
|
-
* success, connected, agentId,
|
|
60
|
-
* schedulerQueueSize, joinedChannels,
|
|
61
|
-
* channels: [{ id, name, lastVisit, lastReply, lastMsgSeq }]
|
|
62
|
-
* }
|
|
63
|
-
*/
|
|
64
|
-
export function createGetStatusTool(): ToolDescriptor {
|
|
65
|
-
return {
|
|
66
|
-
name: 'openagent_get_status',
|
|
67
|
-
label: 'Get OpenAgent Status',
|
|
68
|
-
description: 'Get current status of the OpenAgent connection and channel state',
|
|
69
|
-
parameters: { type: 'object', properties: {}, required: [] },
|
|
70
|
-
async execute() {
|
|
71
|
-
const rt = getRuntime();
|
|
72
|
-
if (!rt) {
|
|
73
|
-
return fail('OpenAgent is not running');
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
const joined = rt.store?.getJoinedChannels() || [];
|
|
77
|
-
return toolResult(JSON.stringify({
|
|
78
|
-
success: true,
|
|
79
|
-
connected: rt.client?.isReady ?? false,
|
|
80
|
-
agentId: rt.client?.agentId ?? '',
|
|
81
|
-
schedulerQueueSize: rt.schedulerQueueSize,
|
|
82
|
-
joinedChannels: joined.length,
|
|
83
|
-
channels: joined.map((c: { channel_id: string; channel_name: string; last_visit: number; last_reply: number; last_msg_seq: number }) => ({
|
|
84
|
-
id: c.channel_id,
|
|
85
|
-
name: c.channel_name,
|
|
86
|
-
lastVisit: c.last_visit ? new Date(c.last_visit).toISOString() : 'never',
|
|
87
|
-
lastReply: c.last_reply ? new Date(c.last_reply).toISOString() : 'never',
|
|
88
|
-
lastMsgSeq: c.last_msg_seq,
|
|
89
|
-
})),
|
|
90
|
-
}));
|
|
91
|
-
} catch (err) {
|
|
92
|
-
return fail((err as Error).message);
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function createSetPurposeTool(): ToolDescriptor {
|
|
99
|
-
return {
|
|
100
|
-
name: 'openagent_set_purpose',
|
|
101
|
-
label: 'Set Channel Purpose',
|
|
102
|
-
description: 'Set or update your purpose/goal for a channel',
|
|
103
|
-
parameters: {
|
|
104
|
-
type: 'object',
|
|
105
|
-
properties: {
|
|
106
|
-
channelId: { type: 'string', description: 'Channel ID' },
|
|
107
|
-
purpose: { type: 'string', description: 'Your purpose/goal for this channel' },
|
|
108
|
-
},
|
|
109
|
-
required: ['channelId', 'purpose'],
|
|
110
|
-
},
|
|
111
|
-
async execute(_id, params) {
|
|
112
|
-
const rt = getRuntime();
|
|
113
|
-
if (!rt?.store) return fail('Not connected');
|
|
114
|
-
try {
|
|
115
|
-
rt.store.setPurpose(String(params.channelId), String(params.purpose));
|
|
116
|
-
return toolResult(JSON.stringify({
|
|
117
|
-
success: true,
|
|
118
|
-
channelId: params.channelId,
|
|
119
|
-
purpose: params.purpose,
|
|
120
|
-
}));
|
|
121
|
-
} catch (err) {
|
|
122
|
-
return fail((err as Error).message);
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function createGetPurposeTool(): ToolDescriptor {
|
|
129
|
-
return {
|
|
130
|
-
name: 'openagent_get_purpose',
|
|
131
|
-
label: 'Get Channel Purpose',
|
|
132
|
-
description: 'Get your current purpose/goal for a channel',
|
|
133
|
-
parameters: {
|
|
134
|
-
type: 'object',
|
|
135
|
-
properties: {
|
|
136
|
-
channelId: { type: 'string', description: 'Channel ID' },
|
|
137
|
-
},
|
|
138
|
-
required: ['channelId'],
|
|
139
|
-
},
|
|
140
|
-
async execute(_id, params) {
|
|
141
|
-
const rt = getRuntime();
|
|
142
|
-
if (!rt?.store) return fail('Not connected');
|
|
143
|
-
try {
|
|
144
|
-
const purpose = rt.store.getPurpose(String(params.channelId));
|
|
145
|
-
return toolResult(JSON.stringify({
|
|
146
|
-
success: true,
|
|
147
|
-
channelId: params.channelId,
|
|
148
|
-
purpose: purpose || '(no purpose set)',
|
|
149
|
-
}));
|
|
150
|
-
} catch (err) {
|
|
151
|
-
return fail((err as Error).message);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
}
|