feat(agentctl): headless slash register and slashCommandsMin asserts

registerSlashCommands step and slashCommandsIncludes wait keys for Phase 430.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-23 17:05:18 -04:00
co-authored by Cursor
parent 725d880ea1
commit 8468893510
2 changed files with 21 additions and 0 deletions
+12
View File
@@ -170,6 +170,18 @@ function matchView (view, spec) {
if ((view?.guildWebhooks || []).length < Number(expected)) return false
continue
}
if (key === 'slashCommandsMin') {
if ((view?.slashCommands || []).length < Number(expected)) return false
continue
}
if (key === 'slashCommandsIncludes') {
const needle = String(expected).toLowerCase()
const hit = (view?.slashCommands || []).some(
(c) => String(c?.name || '').toLowerCase() === needle
)
if (!hit) return false
continue
}
if (key === 'auditLogIncludesAction') {
const needle = String(expected)
const hit = (view?.auditLog || []).some((e) =>
+9
View File
@@ -482,6 +482,15 @@ class HeadlessSession {
})
results.push({ createWebhookActiveChannel: true, channelId: chId })
}
if (step.registerSlashCommands) {
const commands = Array.isArray(step.registerSlashCommands)
? step.registerSlashCommands
: step.registerSlashCommands?.commands || [
{ name: 'echo', description: 'Repeat your text back' }
]
await this.ipc({ type: 'register-slash-commands', commands })
results.push({ registerSlashCommands: true, count: commands.length })
}
if (step.executeLastChannelWebhook) {
const spec =
step.executeLastChannelWebhook && typeof step.executeLastChannelWebhook === 'object'