infinicode 2.8.77 → 2.8.79

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.
@@ -293,7 +293,7 @@ export const DEFAULT_COMMANDS = [
293
293
  {
294
294
  name: 'node',
295
295
  description: 'Inspect a node, run a command on it, or send it a task',
296
- usage: '/node <name> [/command | task text]',
296
+ usage: '/node <name> [--agent opencode|codex|claude|gemini|kernel] [/command | task text]',
297
297
  async run(ctx) {
298
298
  const fed = needMesh(ctx);
299
299
  if ('ok' in fed)
@@ -306,7 +306,18 @@ export const DEFAULT_COMMANDS = [
306
306
  if (!node)
307
307
  return err(`No node matching "${name}". Try /nodes.`);
308
308
  const isSelf = node.nodeId === fed.identity.nodeId;
309
- const rest = args.slice(1).join(' ').trim();
309
+ const taskArgs = args.slice(1);
310
+ let agent;
311
+ if (taskArgs[0] === '--agent') {
312
+ const requested = taskArgs[1];
313
+ const allowed = ['opencode', 'codex', 'claude', 'gemini', 'kernel'];
314
+ if (!requested || !allowed.includes(requested)) {
315
+ return err(`Invalid agent "${requested ?? ''}". Use: ${allowed.join(', ')}`);
316
+ }
317
+ agent = requested;
318
+ taskArgs.splice(0, 2);
319
+ }
320
+ const rest = taskArgs.join(' ').trim();
310
321
  // No payload → show the node's detail card.
311
322
  if (!rest) {
312
323
  const role = isSelf ? fed.getRole() : await fed.getRoleOf(node.nodeId).catch(() => null);
@@ -341,7 +352,12 @@ export const DEFAULT_COMMANDS = [
341
352
  const preview = mission.tasks.map(t => t.output?.content?.slice(0, 400)).filter(Boolean).join('\n---\n');
342
353
  return ok(`[${node.displayName}] ${mission.status}\n${preview || '(no output)'}`);
343
354
  }
344
- const res = await fed.dispatch({ description: rest, capabilities: ['reasoning', 'coding'], prompt: rest }, { preferNodeId: node.nodeId }, { wait: true, timeoutMs: 180_000 });
355
+ const capabilities = [
356
+ 'reasoning',
357
+ 'coding',
358
+ ...(agent && agent !== 'kernel' ? [`backend:${agent}`] : []),
359
+ ];
360
+ const res = await fed.dispatch({ description: rest, capabilities, prompt: rest, agent }, { preferNodeId: node.nodeId }, { wait: true, timeoutMs: 180_000 });
345
361
  if (!res)
346
362
  return err(`Dispatch to ${node.displayName} failed (node unreachable or not capable).`);
347
363
  const body = res.record.outputs?.map(o => o.content ?? o.error ?? `[${o.status}]`).join('\n---\n');