import * as v from "valibot" import { createPageMessageSchema } from "./createPage.js" import { getPageMessageSchema } from "./getPage.js" import { getUserMessageSchema } from "./getUser.js" import { invalidHostMessageSchema } from "./invalidHostMessage.js" import { listUsersMessageSchema } from "./listUsers.js" import { queryDataSourceMessageSchema } from "./queryDataSource.js" import { readyMessageSchema } from "./ready.js" import { resizeMessageSchema } from "./resize.js" import { updatePageMessageSchema } from "./updatePage.js" /** * Union of every message the sandbox is allowed to send the host. Useful for hosts to validate * inbound traffic from sandboxes without re-implementing validation logic. */ export const sandboxToHostMessageSchema = v.union([ readyMessageSchema, queryDataSourceMessageSchema, createPageMessageSchema, getPageMessageSchema, getUserMessageSchema, listUsersMessageSchema, updatePageMessageSchema, resizeMessageSchema, invalidHostMessageSchema, ]) export type SandboxToHostMessage = v.InferOutput< typeof sandboxToHostMessageSchema >