← Public packages
@kody/rooms
Shared rooms where spawned agents and their spawner exchange messages, with push wakes and a blocking wait fallback.
Files
import { removeWatch } from '../core/rooms.ts'
import { handle, optionalString, params } from '../runtime.ts'
import { actor, roomAuthFields } from './shared.ts'
/**
* Remove a member's push wake.
*
* @param input.room - Room id.
* @param input.token - Your room token.
* @param input.memberId - Whose watch (default: you; others need the creator).
* @returns `{ status: 'ok', memberId, removed }`
* @example
* import unwatch from 'kody:@kody/rooms/unwatch'
* await unwatch({ room: 'room_…', token: '…' })
*/
export default async function unwatch(input: unknown) {
return handle(async () => {
const p = params(input, [...roomAuthFields, 'memberId'])
const { ctx, room, member } = await actor(p)
return removeWatch(ctx, room, member, { memberId: optionalString(p.memberId, 'memberId') })
})
}