feat(agentctl): runGuildMeshTripleStickerJourney for Phase 803
3-peer sticker upsert journey with guildStickerNamed matchers on both guests. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Agent control plane for Pearcord — send the same IPC messages the UI sends, read `view` snapshots, and run scripted journeys against a **live worker** or an in-process **headless** session.
|
Agent control plane for Pearcord — send the same IPC messages the UI sends, read `view` snapshots, and run scripted journeys against a **live worker** or an in-process **headless** session.
|
||||||
|
|
||||||
|
**Phase 803 (v0.8.770):** `runGuildMeshTripleStickerJourney` (3-peer custom sticker). Bundle: `npm run test:ci-phase803`.
|
||||||
|
|
||||||
**Phase 802 (v0.8.769):** `runGuildMeshTripleEmojiJourney` (3-peer custom emoji). Bundle: `npm run test:ci-phase802`.
|
**Phase 802 (v0.8.769):** `runGuildMeshTripleEmojiJourney` (3-peer custom emoji). Bundle: `npm run test:ci-phase802`.
|
||||||
|
|
||||||
**Phase 801 (v0.8.768):** `runGuildMeshTripleChannelLifecycleJourney` (3-peer create + delete). Bundle: `npm run test:ci-phase801`.
|
**Phase 801 (v0.8.768):** `runGuildMeshTripleChannelLifecycleJourney` (3-peer create + delete). Bundle: `npm run test:ci-phase801`.
|
||||||
|
|||||||
+66
@@ -5448,6 +5448,72 @@ class HeadlessSession {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Phase 803: 3-peer mesh — host custom sticker visible on both guests. */
|
||||||
|
async runGuildMeshTripleStickerJourney () {
|
||||||
|
const { connectGuildMeshTriple } = require('./mesh-helpers')
|
||||||
|
const token = `mesh803_${Date.now()}`
|
||||||
|
const stickerGif = Buffer.from(
|
||||||
|
'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
|
||||||
|
'base64'
|
||||||
|
)
|
||||||
|
const base = path.join(os.tmpdir(), `pearcord-agentctl-sticker803-${Date.now()}`)
|
||||||
|
const host = new HeadlessSession({ storagePath: path.join(base, 'host') })
|
||||||
|
const guest1 = new HeadlessSession({ storagePath: path.join(base, 'guest1') })
|
||||||
|
const guest2 = new HeadlessSession({ storagePath: path.join(base, 'guest2') })
|
||||||
|
await host.start()
|
||||||
|
await guest1.start()
|
||||||
|
await guest2.start()
|
||||||
|
try {
|
||||||
|
await host.registerUser({ username: 'sthost803', displayName: 'Sticker Host 803' })
|
||||||
|
await host.createGuild({ name: 'Sticker Triple 803', publicListing: false })
|
||||||
|
await host.wait({ mode: 'guild' }, 45000)
|
||||||
|
const invite = await host.platform.createInvite().catch(() => null)
|
||||||
|
const code = invite?.shareCode || invite?.code
|
||||||
|
if (!code) throw new Error('host invite missing')
|
||||||
|
await guest1.registerUser({ username: 'stguest803a', displayName: 'Sticker Guest 803a' })
|
||||||
|
await guest2.registerUser({ username: 'stguest803b', displayName: 'Sticker Guest 803b' })
|
||||||
|
await guest1.ipc({ type: 'join-invite', code })
|
||||||
|
await guest2.ipc({ type: 'join-invite', code })
|
||||||
|
await guest1.wait({ mode: 'guild' }, 45000)
|
||||||
|
await guest2.wait({ mode: 'guild' }, 45000)
|
||||||
|
await connectGuildMeshTriple(
|
||||||
|
host.platform,
|
||||||
|
guest1.platform,
|
||||||
|
guest2.platform,
|
||||||
|
50000
|
||||||
|
)
|
||||||
|
await host.wait({ meshPeersMin: 1 }, 30000)
|
||||||
|
await guest1.wait({ meshPeersMin: 1 }, 30000)
|
||||||
|
await guest2.wait({ meshPeersMin: 1 }, 30000)
|
||||||
|
await host.upsertGuildSticker({
|
||||||
|
name: token,
|
||||||
|
description: 'Mesh 803 sticker',
|
||||||
|
image: {
|
||||||
|
data: stickerGif,
|
||||||
|
filename: `${token}.gif`,
|
||||||
|
mimeType: 'image/gif'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
for (const p of [host.platform, guest1.platform, guest2.platform]) {
|
||||||
|
if (typeof p.requestGuildSyncFanout === 'function') {
|
||||||
|
p.requestGuildSyncFanout()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await guest1.wait({ guildStickerNamed: token }, 90000)
|
||||||
|
await guest2.wait({ guildStickerNamed: token }, 90000)
|
||||||
|
const g1v = await guest1.refreshView()
|
||||||
|
const g2v = await guest2.refreshView()
|
||||||
|
const hit1 = (g1v.guildStickers || []).find((s) => s.name === token)
|
||||||
|
const hit2 = (g2v.guildStickers || []).find((s) => s.name === token)
|
||||||
|
if (!hit1 || !hit2) throw new Error('guest missing custom sticker on triple mesh')
|
||||||
|
return { stickerName: token }
|
||||||
|
} finally {
|
||||||
|
await host.close()
|
||||||
|
await guest1.close()
|
||||||
|
await guest2.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Phase 791: 2-peer mesh — host custom sticker visible in guest guildStickers. */
|
/** Phase 791: 2-peer mesh — host custom sticker visible in guest guildStickers. */
|
||||||
async runGuildMeshStickerJourney () {
|
async runGuildMeshStickerJourney () {
|
||||||
const { connectGuildMeshPeers } = require('./mesh-helpers')
|
const { connectGuildMeshPeers } = require('./mesh-helpers')
|
||||||
|
|||||||
Reference in New Issue
Block a user