feat: add in-chat skill discovery and local registry install command
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
|
||||
import { createApproveCommand, createApprovalsCommand, createContextCommand, createDenyCommand, createElevateCommand, createModelCommand, createQueueCommand, createResearchCommand, createTransferCommand } from './index.js';
|
||||
import { createApproveCommand, createApprovalsCommand, createContextCommand, createDenyCommand, createElevateCommand, createModelCommand, createQueueCommand, createResearchCommand, createSkillCommand, createTransferCommand } from './index.js';
|
||||
|
||||
describe('builtin /model command', () => {
|
||||
it('passes through the full argument string', async () => {
|
||||
@@ -241,3 +241,19 @@ describe('builtin approval commands', () => {
|
||||
expect(result).toEqual({ handled: true, text: 'denied' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('builtin /skill command', () => {
|
||||
it('passes subcommand text to skillCommand service', async () => {
|
||||
const cmd = createSkillCommand();
|
||||
const skillCommand = vi.fn(() => 'ok');
|
||||
const result = await cmd.execute(['search', 'calendar'], {
|
||||
channel: 'test',
|
||||
senderId: 'user',
|
||||
sessionId: 's1',
|
||||
rawInput: '/skill search calendar',
|
||||
services: { skillCommand },
|
||||
});
|
||||
expect(skillCommand).toHaveBeenCalledWith('search calendar');
|
||||
expect(result).toEqual({ handled: true, text: 'ok' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user