UNPKG

@convex-dev/agent

Version:

A agent component for Convex.

18 lines (16 loc) 703 B
/// <reference types="vite/client" /> import type { TestConvex } from "convex-test"; import type { GenericSchema, SchemaDefinition } from "convex/server"; import schema from "./component/schema.js"; const modules = import.meta.glob("./component/**/*.ts"); /** * Register the component with the test convex instance. * @param t - The test convex instance, e.g. from calling `convexTest`. * @param name - The name of the component, as registered in convex.config.ts. */ export function register< Schema extends SchemaDefinition<GenericSchema, boolean>, >(t: TestConvex<Schema>, name: string = "agent") { t.registerComponent(name, schema, modules); } export default { register, schema, modules };