Generated from services/crossfire/node/packages/kernel/src/history-context.ts at
2b2da4dfDefinitions#
All code blocks below are TypeScript declarations copied from the server. They document validation, not JSON to send or code to paste into a chat. Clients can use any HTTP library without importing these declarations. check.object rejects unknown fields. Custom functions and refinements specify additional checks.
Imported definitions#
MAX_HISTORY_CONTEXT#
MAX_HISTORY_CONTEXT = 260roomContext#
export function roomContext(room: string): string { return 'room/' + room; }contextRoom#
export function contextRoom(context: string): string | null { return context.startsWith('room/') ? context.slice(5) : null; }validHistoryContext#
export function validHistoryContext(context: string): boolean {
const room = contextRoom(context);
return context === 'shared' || context === 'control' || room !== null && opaqueIdentifier(room);
}Related definitions: