mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
refactor(commands): drop /provider, /plan handler, and clean up slash registry (#15047)
* refactor(commands): drop /provider and clean up slash registry * refactor(commands): drop /plan special handler — use plain skill dispatch
This commit is contained in:
parent
b29287258a
commit
b2e124d082
20 changed files with 21 additions and 535 deletions
|
|
@ -281,36 +281,6 @@ describe('createSlashHandler', () => {
|
|||
expect(ctx.transcript.page).not.toHaveBeenCalled()
|
||||
expect(ctx.transcript.sys).toHaveBeenCalledWith('no conversation yet')
|
||||
})
|
||||
|
||||
it('handles send-type dispatch for /plan command', async () => {
|
||||
const planMessage = 'Plan skill content loaded'
|
||||
|
||||
const ctx = buildCtx({
|
||||
gateway: {
|
||||
gw: {
|
||||
getLogTail: vi.fn(() => ''),
|
||||
request: vi.fn((method: string) => {
|
||||
if (method === 'slash.exec') {
|
||||
return Promise.reject(new Error('pending-input command'))
|
||||
}
|
||||
|
||||
if (method === 'command.dispatch') {
|
||||
return Promise.resolve({ type: 'send', message: planMessage })
|
||||
}
|
||||
|
||||
return Promise.resolve({})
|
||||
})
|
||||
},
|
||||
rpc: vi.fn(() => Promise.resolve({}))
|
||||
}
|
||||
})
|
||||
|
||||
const h = createSlashHandler(ctx)
|
||||
expect(h('/plan create a REST API')).toBe(true)
|
||||
await vi.waitFor(() => {
|
||||
expect(ctx.transcript.send).toHaveBeenCalledWith(planMessage)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const buildCtx = (overrides: Partial<Ctx> = {}): Ctx => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue