@openagents-org/agent-launcher 0.2.19 → 0.2.20
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/adapters/openclaw.js +30 -2
package/package.json
CHANGED
package/src/adapters/openclaw.js
CHANGED
|
@@ -220,9 +220,37 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
220
220
|
let stdout = '';
|
|
221
221
|
let stderr = '';
|
|
222
222
|
|
|
223
|
-
//
|
|
223
|
+
// Tool name → human-readable status
|
|
224
|
+
const toolLabels = {
|
|
225
|
+
exec: 'Running command...',
|
|
226
|
+
read: 'Reading file...',
|
|
227
|
+
write: 'Writing file...',
|
|
228
|
+
edit: 'Editing file...',
|
|
229
|
+
browser: 'Using browser...',
|
|
230
|
+
web_search: 'Searching the web...',
|
|
231
|
+
web_fetch: 'Fetching webpage...',
|
|
232
|
+
process: 'Running process...',
|
|
233
|
+
image_generate: 'Generating image...',
|
|
234
|
+
memory_search: 'Searching memory...',
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// Stream stderr in real-time to detect tool usage
|
|
224
238
|
if (proc.stdout) proc.stdout.on('data', (d) => { stdout += d; });
|
|
225
|
-
if (proc.stderr) proc.stderr.on('data', (d) => {
|
|
239
|
+
if (proc.stderr) proc.stderr.on('data', (d) => {
|
|
240
|
+
const chunk = d.toString();
|
|
241
|
+
stderr += chunk;
|
|
242
|
+
stdout += chunk;
|
|
243
|
+
|
|
244
|
+
// Parse diagnostic lines for tool start/end events
|
|
245
|
+
for (const line of chunk.split('\n')) {
|
|
246
|
+
const toolStart = line.match(/embedded run tool start:.*tool=(\w+)/);
|
|
247
|
+
if (toolStart) {
|
|
248
|
+
const toolName = toolStart[1];
|
|
249
|
+
const label = toolLabels[toolName] || `Using ${toolName}...`;
|
|
250
|
+
try { this.sendStatus(channel, label); } catch {}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
226
254
|
|
|
227
255
|
proc.on('error', (err) => reject(err));
|
|
228
256
|
proc.on('exit', (code) => {
|