feat: add in-chat skill discovery and local registry install command

This commit is contained in:
William Valentin
2026-02-18 10:41:12 -08:00
parent f34a974210
commit 02fa604c7c
9 changed files with 267 additions and 4 deletions
+17 -1
View File
@@ -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' });
});
});