The proactive agents that run this site. Each agent is a single
agent({ ... }) call against the proactive-runtime SDK contract.
The shape we target (private spec, will be published as @agent-relay/agent):
import { agent } from "@agent-relay/agent";
agent({
workspace: "support",
schedule: "*/5 * * * *",
watch: ["/zendesk/tickets/**"],
inbox: ["@self"],
onEvent: async (ctx, event) => {
// event.type is "cron.tick" | "relayfile.changed" | "relaycast.message"
},
});One handler. Three triggers. One workspace. The whole API for the 90% case.
@agent-relay/agent is not yet published. Until it is, the agents import
from agents/shared/sdk.ts — a local mirror of the spec types plus a no-op
agent() shim. When the package ships, the shim file gets one diff:
- export { agent, type AgentDefinition } from "./local-shim";
+ export { agent, type AgentDefinition } from "@agent-relay/agent";Every agent file then runs unchanged.
| File | Trigger | What it does |
|---|---|---|
notion-to-blog/agent.ts |
change | Watch Notion drafts DB; on status=ready, MDX → PR. |
weekly-digest/agent.ts |
time | Saturday 09:00 UTC. Web + Reddit → one rolling GitHub issue. |
sunday-ping/agent.ts |
time | Sunday 09:00 ET. Reads digest, drafts outline, Slack DM. |
pr-reviewer/agent.ts |
change | Watch repo PRs; deploy preview, dead-link, copy-edit notes. |
manual-chatbot/agent.ts |
message | DMs + #manual. RAG over published essays. Refuses by default. |
Every agent calls writeLogEntry(...) from shared/log.ts so the public
/agent page stays current. That page is the receipts.
# Type-check the agents alongside the rest of the site
npx tsc --noEmitTo exercise an agent's behavior without the runtime, call its onEvent
directly from a test with a mock Context and AgentEvent. The shim's
agent() registers the definition and returns; it does not dispatch events.
relay loginrelay workspaces create proactive-agentsrelay providers connect github notion slack reddit tavilyrelay deploy agents/weekly-digest/agent.ts(and similar for the others)
The runtime reads the agent({...}) definition, registers schedules with
relaycron, watch globs with relayfile, channel subscriptions with relaycast,
and starts dispatching events to onEvent.