Files

24 lines
683 B
TypeScript

// The events of the agent module. A web write publishes the request; the module's own subscriber
// (in the worker's outbox relay) enqueues the run job with the run id as its singleton key, so a
// start, a cancel or a review resumes the one job.
import { defineEvent } from "@conusai-kit/core"
import { z } from "zod"
const inProject = {
orgId: z.string(),
workspaceId: z.string(),
projectId: z.string(),
}
/** A run was asked to start (or resume after a cancel/review decision). */
export const runResumeRequested = defineEvent(
"agent.runResumeRequested",
z.object({
...inProject,
runId: z.string(),
}),
)
export const AGENT_EVENTS = [runResumeRequested]