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:
@@ -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) =>
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user