feat(agentctl): guild webhook headless helpers (Phase 537)
Expose createGuildChannelWebhook, deleteGuildChannelWebhook, and executeGuildChannelWebhook for webhook automation and document phase537 bundle. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -17,6 +17,8 @@ Both modes use **`pearcord-ui-flow` `dispatchUiMessage`** — the same handler a
|
||||
|
||||
`AgentClient` resolves RPC replies before treating `{ event: "state" | "sidecar" }` push lines as events (fixes `wait-event` responses that include an `event` field).
|
||||
|
||||
**v0.8.500 (Phase 537):** Headless `createGuildChannelWebhook`/`deleteGuildChannelWebhook`/`executeGuildChannelWebhook` for webhook automation. Bundle: `npm run test:agentctl-phase537-webhooks` (chains `test:agentctl-phase488-webhooks`).
|
||||
|
||||
**v0.8.499 (Phase 536):** Headless `exportGuildAuditLog(opts)` wraps `platform.exportAuditLog` for compliance automation. Bundle: `npm run test:agentctl-phase536-compliance` (chains `test:agentctl-phase487-compliance`).
|
||||
|
||||
**v0.8.486 (Phase 523):** Headless `sendGuildEmbedMessage(content)` and `resolveGuildEmbed(content)` for link-preview automation. Bundle: `npm run test:agentctl-phase523-embeds` (app repo; chains `test:embed` + `test:agentctl-embed-message`).
|
||||
|
||||
+29
@@ -626,6 +626,35 @@ class HeadlessSession {
|
||||
return out
|
||||
}
|
||||
|
||||
async createGuildChannelWebhook (channelId, name, opts = {}) {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
const out = await this.platform.createChannelWebhook({
|
||||
channelId,
|
||||
name,
|
||||
avatarUrl: opts.avatarUrl
|
||||
})
|
||||
await this.refreshView()
|
||||
return out
|
||||
}
|
||||
|
||||
async deleteGuildChannelWebhook (webhookId) {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
const removed = await this.platform.deleteChannelWebhook(webhookId)
|
||||
await this.refreshView()
|
||||
return removed
|
||||
}
|
||||
|
||||
async executeGuildChannelWebhook (token, content, opts = {}) {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
const msg = await this.platform.executeChannelWebhook({
|
||||
token,
|
||||
content,
|
||||
username: opts.username
|
||||
})
|
||||
await this.refreshView()
|
||||
return msg
|
||||
}
|
||||
|
||||
async banGuildMember (userId, reason) {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
const ban = await this.platform.banMember({ userId, reason })
|
||||
|
||||
Reference in New Issue
Block a user