Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
2.5 KiB
P8-012 Scratchpad — Gateway /agent, /provider, /mission, /prdy, /tools Commands
Objective
Add gateway-executed commands: /agent, /provider, /mission, /prdy, /tools.
Key feature: /provider login OAuth flow with Valkey poll token.
Plan
- Read all relevant files (done)
- Update
command-registry.service.ts— add 5 new command registrations - Update
commands.module.ts— wire Redis injection for executor - Update
command-executor.service.ts— add 5 new command handlers + Redis injection - Write spec file for new commands
- Run quality gates (typecheck, lint, format:check, test)
- Commit and push
Key Decisions
- Redis pattern: same as GCModule — use
REDIStoken injected from a QueueHandle factory CommandDeftype fields:scope: 'core'|'agent'|'skill'|'plugin'|'admin',args?: CommandArgDef[],execution: 'local'|'socket'|'rest'|'hybrid'- No
categoryorusagefields — instruction spec was wrong on that SlashCommandResultPayload.conversationIdis typed asstring(notstring | undefined) per the type- Provider commands are
scope: 'agent'since they relate to agent configuration - Redis injection: add a
COMMANDS_REDIStoken in commands module, inject via factory pattern same as GCModule
Progress
- command-registry.service.ts updated
- commands.module.ts updated (add Redis provider)
- command-executor.service.ts updated (add Redis injection + handlers)
- spec file written
- quality gates pass
- commit + push + PR
Risks
conversationIdtyping:SlashCommandResultPayload.conversationIdisstring, but some handler calls passundefined. Need to check if it's optional.
After reviewing types: conversationId: string in SlashCommandResultPayload — not optional. Must pass empty string or actual ID. Looking at existing code: message: 'Start a new conversation...' returns { command, conversationId, ... } where conversationId comes from payload which is always a string per SlashCommandPayload. For provider commands that don't have a conversationId, pass empty string '' or the payload's conversationId.
Actually looking at the spec more carefully: handleProvider returns conversationId: undefined. But the type says string. This would be a TypeScript error. I'll use '' as a fallback or adjust. Let me re-examine...
The SlashCommandResultPayload interface says conversationId: string — not optional. But the spec says conversationId: undefined. I'll use payload.conversationId (passing it through) since it comes from the payload.