mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-03 02:11:48 +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
|
|
@ -1,7 +1,29 @@
|
|||
import type { ToolsConfigureResponse } from '../../../gatewayTypes.js'
|
||||
import type { SlashExecResponse, ToolsConfigureResponse } from '../../../gatewayTypes.js'
|
||||
import { patchOverlayState } from '../../overlayStore.js'
|
||||
import type { SlashCommand } from '../types.js'
|
||||
|
||||
export const opsCommands: SlashCommand[] = [
|
||||
{
|
||||
help: 'browse, inspect, and install skills',
|
||||
name: 'skills',
|
||||
run: (arg, ctx) => {
|
||||
if (!arg.trim()) {
|
||||
return patchOverlayState({ skillsHub: true })
|
||||
}
|
||||
|
||||
ctx.gateway
|
||||
.rpc<SlashExecResponse>('slash.exec', { command: `skills ${arg}`, session_id: ctx.sid })
|
||||
.then(
|
||||
ctx.guarded<SlashExecResponse>(r => {
|
||||
if (r.output) {
|
||||
ctx.transcript.page(r.output, 'Skills')
|
||||
}
|
||||
})
|
||||
)
|
||||
.catch(ctx.guardedErr)
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
help: 'enable or disable tools (client-side history reset on change)',
|
||||
name: 'tools',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue