mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
feat(tui): register /skills slash command to open Skills Hub
Intercept bare /skills locally and flip overlay.skillsHub, so the overlay opens instantly without waiting on slash.exec. /skills <args> still forwards to slash.exec and paginates any output. Tests cover both branches.
This commit is contained in:
parent
ef284e021a
commit
949b8f5521
2 changed files with 43 additions and 1 deletions
|
|
@ -17,6 +17,26 @@ describe('createSlashHandler', () => {
|
|||
expect(getOverlayState().picker).toBe(true)
|
||||
})
|
||||
|
||||
it('opens the skills hub locally for bare /skills', () => {
|
||||
const ctx = buildCtx()
|
||||
|
||||
expect(createSlashHandler(ctx)('/skills')).toBe(true)
|
||||
expect(getOverlayState().skillsHub).toBe(true)
|
||||
expect(ctx.gateway.rpc).not.toHaveBeenCalled()
|
||||
expect(ctx.gateway.gw.request).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('falls through /skills with args to slash.exec without opening overlay', () => {
|
||||
const ctx = buildCtx()
|
||||
|
||||
expect(createSlashHandler(ctx)('/skills install foo')).toBe(true)
|
||||
expect(getOverlayState().skillsHub).toBe(false)
|
||||
expect(ctx.gateway.rpc).toHaveBeenCalledWith('slash.exec', {
|
||||
command: 'skills install foo',
|
||||
session_id: null
|
||||
})
|
||||
})
|
||||
|
||||
it('cycles details mode and persists it', async () => {
|
||||
const ctx = buildCtx()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue