Files
template-app/modules/agent/module.convex.ts
T

24 lines
1013 B
TypeScript

// The Convex profile binding of the agent module, shipped fail-closed for a future wiring: the
// integration review kept the module Postgres-only because a run's tool calls leave the process
// (the registry client, the AI gateway) and the run job has no composed Convex Node action yet
// (see README.md). The job fails closed here so the work can only reach the platform SDKs through
// a composed Node action, never the Convex transaction dispatcher — the same arrangement as
// documents' OCR.
import { defineModule, internal, type JobDef } from "@conusai-kit/core"
import { z } from "zod"
import { RUN_JOB } from "./contract/index.js"
import { AGENT_MODULE_BASE } from "./module.shared.js"
const actionOnly: JobDef<{ runId: string }> = {
payload: z.object({ runId: z.string() }),
async handler() {
throw internal(`${RUN_JOB} must run through the Convex Node action boundary`)
},
}
export const convexAgentModule = defineModule({
...AGENT_MODULE_BASE,
jobs: { [RUN_JOB]: actionOnly },
})