foliko 1.1.64 → 1.1.65
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/.agent/data/plugins-state.json +8 -0
- package/.agent/sessions/cli_default.json +313 -133
- package/package.json +1 -1
- package/plugins/audit-plugin.js +11 -7
- package/plugins/coordinator-plugin.js +14 -12
- package/plugins/data-splitter-plugin.js +323 -0
- package/plugins/default-plugins.js +12 -1
- package/plugins/extension-executor-plugin.js +2 -2
- package/plugins/file-system-plugin.js +68 -50
- package/plugins/gate-trading.js +10 -10
- package/plugins/install-plugin.js +3 -3
- package/plugins/memory-plugin.js +8 -11
- package/plugins/plugin-manager-plugin.js +9 -11
- package/plugins/qq-plugin.js +8 -8
- package/plugins/rules-plugin.js +7 -7
- package/plugins/scheduler-plugin.js +22 -18
- package/plugins/session-plugin.js +14 -14
- package/plugins/storage-plugin.js +11 -10
- package/plugins/subagent-plugin.js +13 -9
- package/plugins/think-plugin.js +63 -59
- package/plugins/tools-plugin.js +8 -8
- package/plugins/weixin-plugin.js +5 -5
- package/src/capabilities/skill-manager.js +23 -15
- package/src/capabilities/workflow-engine.js +2 -2
- package/src/core/agent-chat.js +20 -9
- package/src/executors/mcp-executor.js +11 -9
- package/src/utils/data-splitter.js +345 -0
package/plugins/gate-trading.js
CHANGED
|
@@ -64,7 +64,7 @@ class GateTradingPlugin extends Plugin {
|
|
|
64
64
|
this.secretKey = args.secret;
|
|
65
65
|
const fs = require('fs');
|
|
66
66
|
fs.writeFileSync(__dirname + '/.env', `GATE_API_KEY=${args.api_key}\nGATE_SECRET_KEY=${args.secret}\n`);
|
|
67
|
-
return { success: true,
|
|
67
|
+
return { success: true, data: 'Gate API 密钥已成功配置' };
|
|
68
68
|
},
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -86,7 +86,7 @@ class GateTradingPlugin extends Plugin {
|
|
|
86
86
|
this.apiKey = '';
|
|
87
87
|
this.secretKey = '';
|
|
88
88
|
try { require('fs').unlinkSync(__dirname + '/.env'); } catch (e) {}
|
|
89
|
-
return { success: true,
|
|
89
|
+
return { success: true, data: 'API 配置已清除' };
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -99,7 +99,7 @@ class GateTradingPlugin extends Plugin {
|
|
|
99
99
|
this._checkAuth();
|
|
100
100
|
const spotApi = this._createSpotApi();
|
|
101
101
|
const currencies = await spotApi.listCurrencies();
|
|
102
|
-
return { success: true,
|
|
102
|
+
return { success: true, data: 'API 连接成功,密钥有效', metadata: { currencyCount: currencies.body.length } };
|
|
103
103
|
} catch (error) { return { success: false, error: error.message }; }
|
|
104
104
|
},
|
|
105
105
|
});
|
|
@@ -118,18 +118,18 @@ class GateTradingPlugin extends Plugin {
|
|
|
118
118
|
const { currency_pair, info_type } = args;
|
|
119
119
|
if (info_type === 'book' || !info_type) {
|
|
120
120
|
const book = await spotApi.listOrderBook(currency_pair, { limit: 10 });
|
|
121
|
-
return { success: true,
|
|
121
|
+
return { success: true, data: { bids: book.body.bids, asks: book.body.asks }, metadata: { type: 'order_book', currency_pair } };
|
|
122
122
|
} else if (info_type === 'tickers') {
|
|
123
123
|
const tickers = await spotApi.listTickers(currency_pair);
|
|
124
124
|
const t = tickers.body.find(x => x.currencyPair === currency_pair) || tickers.body[0];
|
|
125
125
|
return {
|
|
126
|
-
success: true, type: 'ticker', currency_pair: t.currencyPair,
|
|
126
|
+
success: true, data: { type: 'ticker', currency_pair: t.currencyPair,
|
|
127
127
|
last: t.last, high_24h: t.high24h, low_24h: t.low24h,
|
|
128
|
-
volume_24h: t.baseVolume, quote_volume_24h: t.quoteVolume, change_percentage_24h: t.changePercentage,
|
|
128
|
+
volume_24h: t.baseVolume, quote_volume_24h: t.quoteVolume, change_percentage_24h: t.changePercentage },
|
|
129
129
|
};
|
|
130
130
|
} else if (info_type === 'trades') {
|
|
131
131
|
const trades = await spotApi.listTrades(currency_pair);
|
|
132
|
-
return { success: true,
|
|
132
|
+
return { success: true, data: trades.body.slice(0, 20), metadata: { type: 'trades', currency_pair } };
|
|
133
133
|
}
|
|
134
134
|
return { success: false, error: '未知的信息类型' };
|
|
135
135
|
} catch (error) { return { success: false, error: error.message }; }
|
|
@@ -152,7 +152,7 @@ class GateTradingPlugin extends Plugin {
|
|
|
152
152
|
const nonZero = balances.filter(b => parseFloat(b.available) > 0 || parseFloat(b.locked) > 0);
|
|
153
153
|
return {
|
|
154
154
|
success: true,
|
|
155
|
-
|
|
155
|
+
data: nonZero.map(b => ({
|
|
156
156
|
currency: b.currency, available: b.available, locked: b.locked,
|
|
157
157
|
total: parseFloat(b.available) + parseFloat(b.locked),
|
|
158
158
|
})),
|
|
@@ -180,9 +180,9 @@ class GateTradingPlugin extends Plugin {
|
|
|
180
180
|
const result = await spotApi.createOrder(order);
|
|
181
181
|
const r = result.body;
|
|
182
182
|
return {
|
|
183
|
-
success: true, order_id: r.id, currency_pair: r.currency_pair,
|
|
183
|
+
success: true, data: { order_id: r.id, currency_pair: r.currency_pair,
|
|
184
184
|
type: r.type, side: r.side, amount: r.amount,
|
|
185
|
-
price: r.price, status: r.status, create_time: r.create_time,
|
|
185
|
+
price: r.price, status: r.status, create_time: r.create_time },
|
|
186
186
|
};
|
|
187
187
|
} catch (error) { return { success: false, error: error.message }; }
|
|
188
188
|
},
|
|
@@ -104,7 +104,7 @@ class InstallPlugin extends Plugin {
|
|
|
104
104
|
|
|
105
105
|
return {
|
|
106
106
|
success: true,
|
|
107
|
-
|
|
107
|
+
data: `Successfully installed ${packageName} to ${installPath}`
|
|
108
108
|
}
|
|
109
109
|
} catch (err) {
|
|
110
110
|
return {
|
|
@@ -141,7 +141,7 @@ class InstallPlugin extends Plugin {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
if (packages.length === 0) {
|
|
144
|
-
return { success: true,
|
|
144
|
+
return { success: true, data: 'No dependencies to install' }
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// 确保目标目录存在
|
|
@@ -159,7 +159,7 @@ class InstallPlugin extends Plugin {
|
|
|
159
159
|
|
|
160
160
|
return {
|
|
161
161
|
success: true,
|
|
162
|
-
|
|
162
|
+
data: `Successfully installed ${packages.length} dependencies to ${installPath}`
|
|
163
163
|
}
|
|
164
164
|
} catch (err) {
|
|
165
165
|
return {
|
package/plugins/memory-plugin.js
CHANGED
|
@@ -625,8 +625,7 @@ class MemoryPlugin extends Plugin {
|
|
|
625
625
|
|
|
626
626
|
return {
|
|
627
627
|
success: true,
|
|
628
|
-
|
|
629
|
-
memories: results.map(m => ({
|
|
628
|
+
data: results.map(m => ({
|
|
630
629
|
id: m.id,
|
|
631
630
|
name: m.name,
|
|
632
631
|
type: m.type,
|
|
@@ -665,8 +664,8 @@ class MemoryPlugin extends Plugin {
|
|
|
665
664
|
|
|
666
665
|
return {
|
|
667
666
|
success: true,
|
|
668
|
-
|
|
669
|
-
|
|
667
|
+
data: `Memory created: ${memory.id}`,
|
|
668
|
+
metadata: { id: memory.id }
|
|
670
669
|
}
|
|
671
670
|
} catch (err) {
|
|
672
671
|
return { success: false, error: err.message }
|
|
@@ -694,8 +693,7 @@ class MemoryPlugin extends Plugin {
|
|
|
694
693
|
|
|
695
694
|
return {
|
|
696
695
|
success: true,
|
|
697
|
-
|
|
698
|
-
memories: memories.map(m => ({
|
|
696
|
+
data: memories.map(m => ({
|
|
699
697
|
id: m.id,
|
|
700
698
|
name: m.name,
|
|
701
699
|
type: m.type,
|
|
@@ -752,8 +750,8 @@ class MemoryPlugin extends Plugin {
|
|
|
752
750
|
const memory = this._store.update(args.id, updates)
|
|
753
751
|
return {
|
|
754
752
|
success: true,
|
|
755
|
-
|
|
756
|
-
|
|
753
|
+
data: `Memory updated: ${memory.id}`,
|
|
754
|
+
metadata: { id: memory.id }
|
|
757
755
|
}
|
|
758
756
|
} catch (err) {
|
|
759
757
|
return { success: false, error: err.message }
|
|
@@ -776,7 +774,7 @@ class MemoryPlugin extends Plugin {
|
|
|
776
774
|
}
|
|
777
775
|
return {
|
|
778
776
|
success: true,
|
|
779
|
-
|
|
777
|
+
data: {
|
|
780
778
|
id: memory.id,
|
|
781
779
|
name: memory.name,
|
|
782
780
|
type: memory.type,
|
|
@@ -803,8 +801,7 @@ class MemoryPlugin extends Plugin {
|
|
|
803
801
|
const projects = this._store.getProjects()
|
|
804
802
|
return {
|
|
805
803
|
success: true,
|
|
806
|
-
stats,
|
|
807
|
-
projects
|
|
804
|
+
data: { stats, projects }
|
|
808
805
|
}
|
|
809
806
|
} catch (err) {
|
|
810
807
|
return { success: false, error: err.message }
|
|
@@ -160,7 +160,7 @@ class PluginManagerPlugin extends Plugin {
|
|
|
160
160
|
const contents = await response.json();
|
|
161
161
|
|
|
162
162
|
if (!Array.isArray(contents) || contents.length === 0) {
|
|
163
|
-
return { success: true,
|
|
163
|
+
return { success: true, data: [], metadata: { message: 'No plugins found in repository' } };
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
const plugins = [];
|
|
@@ -198,9 +198,8 @@ class PluginManagerPlugin extends Plugin {
|
|
|
198
198
|
|
|
199
199
|
return {
|
|
200
200
|
success: true,
|
|
201
|
-
plugins,
|
|
202
|
-
repo,
|
|
203
|
-
count: plugins.length,
|
|
201
|
+
data: plugins,
|
|
202
|
+
metadata: { repo, count: plugins.length },
|
|
204
203
|
};
|
|
205
204
|
|
|
206
205
|
} catch (err) {
|
|
@@ -303,8 +302,8 @@ class PluginManagerPlugin extends Plugin {
|
|
|
303
302
|
if (!status.trim()) {
|
|
304
303
|
return {
|
|
305
304
|
success: true,
|
|
306
|
-
|
|
307
|
-
repo,
|
|
305
|
+
data: `No changes to commit for plugin "${pluginName}"`,
|
|
306
|
+
metadata: { repo },
|
|
308
307
|
};
|
|
309
308
|
}
|
|
310
309
|
|
|
@@ -315,9 +314,8 @@ class PluginManagerPlugin extends Plugin {
|
|
|
315
314
|
|
|
316
315
|
return {
|
|
317
316
|
success: true,
|
|
318
|
-
|
|
319
|
-
repo,
|
|
320
|
-
path: `${pluginName}/${pluginName}.js`,
|
|
317
|
+
data: `Plugin "${pluginName}" published successfully`,
|
|
318
|
+
metadata: { repo, path: `${pluginName}/${pluginName}.js` },
|
|
321
319
|
};
|
|
322
320
|
|
|
323
321
|
} catch (err) {
|
|
@@ -387,8 +385,8 @@ class PluginManagerPlugin extends Plugin {
|
|
|
387
385
|
|
|
388
386
|
return {
|
|
389
387
|
success: true,
|
|
390
|
-
|
|
391
|
-
path: targetDir,
|
|
388
|
+
data: `Plugin "${pluginName}" installed successfully`,
|
|
389
|
+
metadata: { path: targetDir },
|
|
392
390
|
};
|
|
393
391
|
|
|
394
392
|
} catch (err) {
|
package/plugins/qq-plugin.js
CHANGED
|
@@ -175,7 +175,7 @@ class QQPlugin extends Plugin {
|
|
|
175
175
|
// 降级为普通发送
|
|
176
176
|
await this._client.sendC2CMessage({ openid, content })
|
|
177
177
|
}
|
|
178
|
-
return { success: true,
|
|
178
|
+
return { success: true, data: '消息发送成功' }
|
|
179
179
|
} catch (err) {
|
|
180
180
|
log.error(`消息发送失败: ${err.message}`)
|
|
181
181
|
return { error: err.message }
|
|
@@ -198,7 +198,7 @@ class QQPlugin extends Plugin {
|
|
|
198
198
|
imageUrl,
|
|
199
199
|
content,
|
|
200
200
|
})
|
|
201
|
-
return { success: true,
|
|
201
|
+
return { success: true, data: '图片发送成功' }
|
|
202
202
|
} catch (err) {
|
|
203
203
|
log.error(`图片发送失败: ${err.message}`)
|
|
204
204
|
return { error: err.message }
|
|
@@ -227,13 +227,13 @@ class QQPlugin extends Plugin {
|
|
|
227
227
|
try {
|
|
228
228
|
if (imageExts.includes(ext)) {
|
|
229
229
|
await this._client.sendC2CLocalImageMessage({ openid, filePath, content })
|
|
230
|
-
return { success: true,
|
|
230
|
+
return { success: true, data: '图片发送成功' }
|
|
231
231
|
} else if (voiceExts.includes(ext)) {
|
|
232
232
|
await this._client.sendC2CLocalVoiceMessage({ openid, filePath })
|
|
233
|
-
return { success: true,
|
|
233
|
+
return { success: true, data: '语音发送成功' }
|
|
234
234
|
} else if (videoExts.includes(ext)) {
|
|
235
235
|
await this._client.sendC2CLocalVideoMessage({ openid, filePath, content })
|
|
236
|
-
return { success: true,
|
|
236
|
+
return { success: true, data: '视频发送成功' }
|
|
237
237
|
} else {
|
|
238
238
|
// 未知格式,当作文件处理
|
|
239
239
|
return this._sendFile(openid, filePath, content)
|
|
@@ -263,7 +263,7 @@ class QQPlugin extends Plugin {
|
|
|
263
263
|
filePath,
|
|
264
264
|
content,
|
|
265
265
|
})
|
|
266
|
-
return { success: true,
|
|
266
|
+
return { success: true, data: '文件发送成功' }
|
|
267
267
|
} catch (err) {
|
|
268
268
|
log.error(`文件发送失败: ${err.message}`)
|
|
269
269
|
return { error: err.message }
|
|
@@ -285,7 +285,7 @@ class QQPlugin extends Plugin {
|
|
|
285
285
|
groupOpenid,
|
|
286
286
|
content,
|
|
287
287
|
})
|
|
288
|
-
return { success: true,
|
|
288
|
+
return { success: true, data: '群消息发送成功' }
|
|
289
289
|
} catch (err) {
|
|
290
290
|
log.error(`群消息发送失败: ${err.message}`)
|
|
291
291
|
return { error: err.message }
|
|
@@ -311,7 +311,7 @@ class QQPlugin extends Plugin {
|
|
|
311
311
|
filePath: imagePath,
|
|
312
312
|
content,
|
|
313
313
|
})
|
|
314
|
-
return { success: true,
|
|
314
|
+
return { success: true, data: '群图片发送成功' }
|
|
315
315
|
} catch (err) {
|
|
316
316
|
log.error(`群图片发送失败: ${err.message}`)
|
|
317
317
|
return { error: err.message }
|
package/plugins/rules-plugin.js
CHANGED
|
@@ -74,14 +74,14 @@ class RulesPlugin extends Plugin {
|
|
|
74
74
|
execute: async () => {
|
|
75
75
|
return {
|
|
76
76
|
success: true,
|
|
77
|
-
|
|
77
|
+
data: this._rules.map(r => ({
|
|
78
78
|
name: r.name,
|
|
79
79
|
type: r.type,
|
|
80
80
|
target: r.target,
|
|
81
81
|
description: r.description,
|
|
82
82
|
enabled: r.enabled
|
|
83
83
|
})),
|
|
84
|
-
total: this._rules.length
|
|
84
|
+
metadata: { total: this._rules.length }
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
})
|
|
@@ -108,7 +108,7 @@ class RulesPlugin extends Plugin {
|
|
|
108
108
|
enabled: true
|
|
109
109
|
}
|
|
110
110
|
this._rules.push(rule)
|
|
111
|
-
return { success: true,
|
|
111
|
+
return { success: true, data: `规则已添加: ${rule.name}` }
|
|
112
112
|
}
|
|
113
113
|
})
|
|
114
114
|
|
|
@@ -124,7 +124,7 @@ class RulesPlugin extends Plugin {
|
|
|
124
124
|
return { success: false, error: 'Rule not found' }
|
|
125
125
|
}
|
|
126
126
|
this._rules.splice(index, 1)
|
|
127
|
-
return { success: true,
|
|
127
|
+
return { success: true, data: `规则已移除: ${args.name}` }
|
|
128
128
|
}
|
|
129
129
|
})
|
|
130
130
|
|
|
@@ -135,7 +135,7 @@ class RulesPlugin extends Plugin {
|
|
|
135
135
|
execute: async () => {
|
|
136
136
|
return {
|
|
137
137
|
success: true,
|
|
138
|
-
|
|
138
|
+
data: { ...this._ruleStats }
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
})
|
|
@@ -151,8 +151,8 @@ class RulesPlugin extends Plugin {
|
|
|
151
151
|
const result = this.evaluate(args.target, args.input || {})
|
|
152
152
|
return {
|
|
153
153
|
success: true,
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
data: {
|
|
155
|
+
target: args.target,
|
|
156
156
|
allowed: result.allowed,
|
|
157
157
|
ruleName: result.rule?.name || null,
|
|
158
158
|
ruleType: result.rule?.type || null
|
|
@@ -227,15 +227,17 @@ class SchedulerPlugin extends Plugin {
|
|
|
227
227
|
this._saveTasks()
|
|
228
228
|
return {
|
|
229
229
|
success: true,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
230
|
+
data: repeat ? 'Shell 定时任务已创建 (重复执行)' : 'Shell 任务已创建',
|
|
231
|
+
metadata: {
|
|
232
|
+
taskId: task.id,
|
|
233
|
+
name: task.name,
|
|
234
|
+
type: 'shell',
|
|
235
|
+
shell,
|
|
236
|
+
scheduleTime,
|
|
237
|
+
cronExpression: task.cronExpression,
|
|
238
|
+
sessionId: sessionId || 'default',
|
|
239
|
+
notify: task.notify
|
|
240
|
+
}
|
|
239
241
|
}
|
|
240
242
|
} else {
|
|
241
243
|
// 一次性 Shell 任务
|
|
@@ -276,15 +278,17 @@ class SchedulerPlugin extends Plugin {
|
|
|
276
278
|
this._saveTasks()
|
|
277
279
|
return {
|
|
278
280
|
success: true,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
data: 'Shell 任务已创建',
|
|
282
|
+
metadata: {
|
|
283
|
+
taskId: task.id,
|
|
284
|
+
name: task.name,
|
|
285
|
+
type: 'shell',
|
|
286
|
+
shell,
|
|
287
|
+
scheduleTime,
|
|
288
|
+
executeAt: runAt.toISOString(),
|
|
289
|
+
sessionId: sessionId || 'default',
|
|
290
|
+
notify: task.notify
|
|
291
|
+
}
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
}
|
|
@@ -173,8 +173,7 @@ class SessionPlugin extends Plugin {
|
|
|
173
173
|
const session = this.createSession(sessionId, { metadata: args.metadata })
|
|
174
174
|
return {
|
|
175
175
|
success: true,
|
|
176
|
-
sessionId: session.id,
|
|
177
|
-
createdAt: session.createdAt
|
|
176
|
+
data: { sessionId: session.id, createdAt: session.createdAt }
|
|
178
177
|
}
|
|
179
178
|
}
|
|
180
179
|
})
|
|
@@ -192,11 +191,13 @@ class SessionPlugin extends Plugin {
|
|
|
192
191
|
}
|
|
193
192
|
return {
|
|
194
193
|
success: true,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
data: {
|
|
195
|
+
sessionId: session.id,
|
|
196
|
+
messageCount: session.messages.length,
|
|
197
|
+
variables: Object.keys(session.variables),
|
|
198
|
+
createdAt: session.createdAt,
|
|
199
|
+
lastActive: session.lastActive
|
|
200
|
+
}
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
})
|
|
@@ -209,8 +210,8 @@ class SessionPlugin extends Plugin {
|
|
|
209
210
|
const sessions = this.listSessions()
|
|
210
211
|
return {
|
|
211
212
|
success: true,
|
|
212
|
-
sessions,
|
|
213
|
-
total: sessions.length
|
|
213
|
+
data: sessions,
|
|
214
|
+
metadata: { total: sessions.length }
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
217
|
})
|
|
@@ -223,7 +224,7 @@ class SessionPlugin extends Plugin {
|
|
|
223
224
|
}),
|
|
224
225
|
execute: async (args) => {
|
|
225
226
|
const deleted = this.deleteSession(args.sessionId)
|
|
226
|
-
return { success: deleted,
|
|
227
|
+
return { success: deleted, data: `会话 ${args.sessionId} 已${deleted ? '删除' : '删除失败'}` }
|
|
227
228
|
}
|
|
228
229
|
})
|
|
229
230
|
|
|
@@ -238,9 +239,8 @@ class SessionPlugin extends Plugin {
|
|
|
238
239
|
const history = this.getHistory(args.sessionId, args.limit)
|
|
239
240
|
return {
|
|
240
241
|
success: true,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
count: history.length
|
|
242
|
+
data: history,
|
|
243
|
+
metadata: { sessionId: args.sessionId, count: history.length }
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
})
|
|
@@ -252,7 +252,7 @@ class SessionPlugin extends Plugin {
|
|
|
252
252
|
execute: async () => {
|
|
253
253
|
return {
|
|
254
254
|
success: true,
|
|
255
|
-
|
|
255
|
+
data: this.getMemoryStats()
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
})
|
|
@@ -64,7 +64,7 @@ class StoragePlugin extends Plugin {
|
|
|
64
64
|
await this._persistToFile()
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
return { success: true, key: args.key, namespace: ns }
|
|
67
|
+
return { success: true, data: { key: args.key, namespace: ns } }
|
|
68
68
|
} catch (err) {
|
|
69
69
|
return { success: false, error: err.message }
|
|
70
70
|
}
|
|
@@ -89,10 +89,12 @@ class StoragePlugin extends Plugin {
|
|
|
89
89
|
|
|
90
90
|
return {
|
|
91
91
|
success: true,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
data: {
|
|
93
|
+
key: args.key,
|
|
94
|
+
namespace: ns,
|
|
95
|
+
value: entry.value,
|
|
96
|
+
updatedAt: entry.updatedAt
|
|
97
|
+
}
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
})
|
|
@@ -114,7 +116,7 @@ class StoragePlugin extends Plugin {
|
|
|
114
116
|
await this._persistToFile()
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
return { success: true, deleted: existed, key: args.key }
|
|
119
|
+
return { success: true, data: { deleted: existed, key: args.key } }
|
|
118
120
|
}
|
|
119
121
|
})
|
|
120
122
|
|
|
@@ -137,9 +139,8 @@ class StoragePlugin extends Plugin {
|
|
|
137
139
|
|
|
138
140
|
return {
|
|
139
141
|
success: true,
|
|
140
|
-
|
|
141
|
-
keys
|
|
142
|
-
count: keys.length
|
|
142
|
+
data: keys,
|
|
143
|
+
metadata: { namespace: ns, count: keys.length }
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
})
|
|
@@ -166,7 +167,7 @@ class StoragePlugin extends Plugin {
|
|
|
166
167
|
await this._persistToFile()
|
|
167
168
|
}
|
|
168
169
|
|
|
169
|
-
return { success: true, namespace: ns, cleared: count }
|
|
170
|
+
return { success: true, data: { namespace: ns, cleared: count } }
|
|
170
171
|
}
|
|
171
172
|
})
|
|
172
173
|
|
|
@@ -460,7 +460,7 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
460
460
|
description: p.description,
|
|
461
461
|
toolCount: p._agent ? p._agent.getTools().length : 0
|
|
462
462
|
}))
|
|
463
|
-
return { success: true, agents }
|
|
463
|
+
return { success: true, data: agents }
|
|
464
464
|
}
|
|
465
465
|
})
|
|
466
466
|
|
|
@@ -485,9 +485,11 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
485
485
|
|
|
486
486
|
return {
|
|
487
487
|
success: true,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
data: result?.message || result?.content || result,
|
|
489
|
+
metadata: {
|
|
490
|
+
agent: args.agentName,
|
|
491
|
+
success: result.success !== false
|
|
492
|
+
}
|
|
491
493
|
}
|
|
492
494
|
} catch (err) {
|
|
493
495
|
return { success: false, error: err.message }
|
|
@@ -502,7 +504,7 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
502
504
|
execute: async () => {
|
|
503
505
|
try {
|
|
504
506
|
this.reload(this._framework)
|
|
505
|
-
return { success: true,
|
|
507
|
+
return { success: true, data: '子Agent配置已重新加载' }
|
|
506
508
|
} catch (err) {
|
|
507
509
|
return { success: false, error: err.message }
|
|
508
510
|
}
|
|
@@ -527,7 +529,7 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
527
529
|
description: p.description,
|
|
528
530
|
toolCount: p._agent ? p._agent.getTools().length : 0
|
|
529
531
|
}))
|
|
530
|
-
return { success: true, agents }
|
|
532
|
+
return { success: true, data: agents }
|
|
531
533
|
}
|
|
532
534
|
})
|
|
533
535
|
|
|
@@ -551,9 +553,11 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
551
553
|
}
|
|
552
554
|
return {
|
|
553
555
|
success: true,
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
556
|
+
data: result.message || result,
|
|
557
|
+
metadata: {
|
|
558
|
+
agent: args.agentName,
|
|
559
|
+
success: result.success !== false
|
|
560
|
+
}
|
|
557
561
|
}
|
|
558
562
|
} catch (err) {
|
|
559
563
|
return { success: false, error: err.message }
|