feat(agentctl): guild bot headless helpers (Phase 539)
Expose createGuildBotInstallToken, installGuildBotFromToken, sendGuildBotMessage, and verifyGuildBotToken for bot automation. 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).
|
`AgentClient` resolves RPC replies before treating `{ event: "state" | "sidecar" }` push lines as events (fixes `wait-event` responses that include an `event` field).
|
||||||
|
|
||||||
|
**v0.8.502 (Phase 539):** Headless `createGuildBotInstallToken`/`installGuildBotFromToken`/`sendGuildBotMessage`/`verifyGuildBotToken` for bot automation. Bundle: `npm run test:agentctl-phase539-bots` (chains `test:agentctl-phase490-bots`).
|
||||||
|
|
||||||
**v0.8.501 (Phase 538):** Headless `registerGuildSlashCommands`/`deleteGuildSlashCommand`/`executeGuildSlashCommand` for slash automation. Bundle: `npm run test:agentctl-phase538-slash` (chains `test:agentctl-phase489-slash`).
|
**v0.8.501 (Phase 538):** Headless `registerGuildSlashCommands`/`deleteGuildSlashCommand`/`executeGuildSlashCommand` for slash automation. Bundle: `npm run test:agentctl-phase538-slash` (chains `test:agentctl-phase489-slash`).
|
||||||
|
|
||||||
**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.500 (Phase 537):** Headless `createGuildChannelWebhook`/`deleteGuildChannelWebhook`/`executeGuildChannelWebhook` for webhook automation. Bundle: `npm run test:agentctl-phase537-webhooks` (chains `test:agentctl-phase488-webhooks`).
|
||||||
|
|||||||
+30
@@ -676,6 +676,36 @@ class HeadlessSession {
|
|||||||
return msg
|
return msg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async createGuildBotInstallToken (opts = {}) {
|
||||||
|
if (!this.platform) throw new Error('headless not started')
|
||||||
|
const out = await this.platform.createBotInstallToken(opts)
|
||||||
|
await this.refreshView()
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
async installGuildBotFromToken (token) {
|
||||||
|
if (!this.platform) throw new Error('headless not started')
|
||||||
|
const out = await this.platform.installBotFromToken(token)
|
||||||
|
await this.refreshView()
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
async verifyGuildBotToken (token) {
|
||||||
|
if (!this.platform) throw new Error('headless not started')
|
||||||
|
return this.platform.verifyBotToken(token)
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendGuildBotMessage (botId, content, opts = {}) {
|
||||||
|
if (!this.platform) throw new Error('headless not started')
|
||||||
|
const msg = await this.platform.sendBotMessage({
|
||||||
|
botId,
|
||||||
|
content,
|
||||||
|
channelId: opts.channelId
|
||||||
|
})
|
||||||
|
await this.refreshView()
|
||||||
|
return msg
|
||||||
|
}
|
||||||
|
|
||||||
async banGuildMember (userId, reason) {
|
async banGuildMember (userId, reason) {
|
||||||
if (!this.platform) throw new Error('headless not started')
|
if (!this.platform) throw new Error('headless not started')
|
||||||
const ban = await this.platform.banMember({ userId, reason })
|
const ban = await this.platform.banMember({ userId, reason })
|
||||||
|
|||||||
Reference in New Issue
Block a user