@openagents-org/agent-launcher 0.2.118 → 0.2.119
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/workspace-prompt.js +2 -2
- package/src/cli.js +33 -14
- package/src/mcp-server.js +8 -8
package/package.json
CHANGED
|
@@ -209,9 +209,9 @@ function buildApiSkillsPrompt({ endpoint, workspaceId, token, agentName, channel
|
|
|
209
209
|
sections.push(
|
|
210
210
|
'\n### Message History\n\n' +
|
|
211
211
|
'**Get recent messages in the current channel:**\n' +
|
|
212
|
-
`\`curl -s -H "${h}" "${baseUrl}/v1/events?network=${workspaceId}&channel=${channelName}&type=workspace.message&limit=20"\`\n\n` +
|
|
212
|
+
`\`curl -s -H "${h}" "${baseUrl}/v1/events?network=${workspaceId}&channel=${channelName}&type=workspace.message&sort=desc&limit=20"\`\n\n` +
|
|
213
213
|
'**Get messages from a specific channel:**\n' +
|
|
214
|
-
`\`curl -s -H "${h}" "${baseUrl}/v1/events?network=${workspaceId}&channel=CHANNEL_NAME&type=workspace.message&limit=20"\`\n`
|
|
214
|
+
`\`curl -s -H "${h}" "${baseUrl}/v1/events?network=${workspaceId}&channel=CHANNEL_NAME&type=workspace.message&sort=desc&limit=20"\`\n`
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
// Post status update
|
package/src/cli.js
CHANGED
|
@@ -441,10 +441,29 @@ async function cmdEnv(connector, flags, positional) {
|
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
async function cmdToolMode(connector, _flags, positional) {
|
|
444
|
-
const
|
|
445
|
-
const
|
|
444
|
+
const first = positional[0];
|
|
445
|
+
const second = positional[1];
|
|
446
|
+
|
|
447
|
+
// agn tool-mode --all <mode>
|
|
448
|
+
if (first === '--all') {
|
|
449
|
+
const targetMode = second;
|
|
450
|
+
if (!targetMode || (targetMode !== 'mcp' && targetMode !== 'skills')) {
|
|
451
|
+
print("Usage: agn tool-mode --all <mcp|skills>");
|
|
452
|
+
process.exitCode = 1;
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const agents = connector.config.getAgents();
|
|
456
|
+
if (agents.length === 0) { print('No agents configured'); return; }
|
|
457
|
+
for (const a of agents) {
|
|
458
|
+
connector.config.updateAgent(a.name, { tool_mode: targetMode });
|
|
459
|
+
print(` ${a.name}: ${a.tool_mode || 'mcp'} → ${targetMode}`);
|
|
460
|
+
}
|
|
461
|
+
try { connector.sendDaemonCommand('reload'); } catch {}
|
|
462
|
+
print(`\nSet all ${agents.length} agent(s) to '${targetMode}' mode.`);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
446
465
|
|
|
447
|
-
if (!
|
|
466
|
+
if (!first) {
|
|
448
467
|
// Show tool mode for all agents
|
|
449
468
|
const agents = connector.config.getAgents();
|
|
450
469
|
if (agents.length === 0) {
|
|
@@ -454,29 +473,29 @@ async function cmdToolMode(connector, _flags, positional) {
|
|
|
454
473
|
for (const a of agents) {
|
|
455
474
|
print(` ${a.name}: ${a.tool_mode || 'mcp'}`);
|
|
456
475
|
}
|
|
457
|
-
print('\nUsage: agn tool-mode <agent> <mcp|skills>');
|
|
476
|
+
print('\nUsage: agn tool-mode <agent|--all> <mcp|skills>');
|
|
458
477
|
return;
|
|
459
478
|
}
|
|
460
479
|
|
|
461
|
-
if (!
|
|
480
|
+
if (!second) {
|
|
462
481
|
// Show tool mode for specific agent
|
|
463
|
-
const agent = connector.config.getAgent(
|
|
464
|
-
if (!agent) { print(`Agent '${
|
|
465
|
-
print(`${
|
|
466
|
-
print('\nUsage: agn tool-mode <agent> <mcp|skills>');
|
|
482
|
+
const agent = connector.config.getAgent(first);
|
|
483
|
+
if (!agent) { print(`Agent '${first}' not found`); process.exitCode = 1; return; }
|
|
484
|
+
print(`${first}: ${agent.tool_mode || 'mcp'}`);
|
|
485
|
+
print('\nUsage: agn tool-mode <agent|--all> <mcp|skills>');
|
|
467
486
|
return;
|
|
468
487
|
}
|
|
469
488
|
|
|
470
|
-
if (
|
|
471
|
-
print(`Invalid mode: ${
|
|
489
|
+
if (second !== 'mcp' && second !== 'skills') {
|
|
490
|
+
print(`Invalid mode: ${second}. Must be 'mcp' or 'skills'.`);
|
|
472
491
|
process.exitCode = 1;
|
|
473
492
|
return;
|
|
474
493
|
}
|
|
475
494
|
|
|
476
|
-
connector.config.updateAgent(
|
|
495
|
+
connector.config.updateAgent(first, { tool_mode: second });
|
|
477
496
|
try { connector.sendDaemonCommand('reload'); } catch {}
|
|
478
|
-
print(`Set tool mode for ${
|
|
479
|
-
if (
|
|
497
|
+
print(`Set tool mode for ${first} to '${second}'`);
|
|
498
|
+
if (second === 'skills') {
|
|
480
499
|
print('Agent will use SKILL.md (Bash + curl) instead of MCP server for workspace tools.');
|
|
481
500
|
} else {
|
|
482
501
|
print('Agent will use MCP server for workspace tools (default).');
|
package/src/mcp-server.js
CHANGED
|
@@ -409,16 +409,16 @@ class McpServer {
|
|
|
409
409
|
case 'workspace_get_history': {
|
|
410
410
|
const limit = args.limit || 20;
|
|
411
411
|
const channel = args.channel || this.channelName;
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
const
|
|
418
|
-
const
|
|
419
|
-
if (type === 'status') return null; // skip status updates
|
|
412
|
+
const messages = await this.ws.getRecentMessages(this.workspaceId, channel, this.token, limit);
|
|
413
|
+
if (!messages.length) return text('No messages yet.');
|
|
414
|
+
const lines = messages.map((m) => {
|
|
415
|
+
const mt = m.messageType || 'chat';
|
|
416
|
+
if (mt === 'status') return null;
|
|
417
|
+
const sender = m.senderName || m.senderType || '';
|
|
418
|
+
const content = m.content || '';
|
|
420
419
|
return `[${sender}] ${content}`;
|
|
421
420
|
}).filter(Boolean);
|
|
421
|
+
if (!lines.length) return text('No messages yet.');
|
|
422
422
|
return text(lines.join('\n'));
|
|
423
423
|
}
|
|
424
424
|
|