Skip to main content
Glama
messages.ts1.22 kB
import z from "zod/v4"; import { EnvelopedMessage } from "../metadata.js"; import { setupChangePayloadSchema } from "./setup-change.js"; import { usageStatsPayloadSchema } from "./usage-stats.js"; // Raw payload schemas export const WebappBoundPayloads = { setupChange: setupChangePayloadSchema, usageStats: usageStatsPayloadSchema, } as const; export type WebappBoundPayload = (typeof WebappBoundPayloads)[keyof typeof WebappBoundPayloads]; export const WEBAPP_BOUND_EVENTS = { SETUP_CHANGE: "setup-change", USAGE_STATS: "usage-stats", } as const; export type WebappBoundEventName = (typeof WEBAPP_BOUND_EVENTS)[keyof typeof WEBAPP_BOUND_EVENTS]; // This maps the kebab-case event names to their payload schemas (raw payloads) export type WebappBoundPayloadOf<E extends WebappBoundEventName> = E extends typeof WEBAPP_BOUND_EVENTS.SETUP_CHANGE ? z.input<typeof setupChangePayloadSchema> : E extends typeof WEBAPP_BOUND_EVENTS.USAGE_STATS ? z.input<typeof usageStatsPayloadSchema> : never; // This maps the kebab-case event names to their enveloped message types export type WebappBoundEnvelopedOf<E extends WebappBoundEventName> = EnvelopedMessage<WebappBoundPayloadOf<E>>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server