Deploy
Types that flow from infrastructure to runtime code
Notation Deploy lets you build infrastructure and application code in a unified TypeScript project. Iterate fast and catch issues before they reach production.
Get startedimport { $lambda, sqs, type LambdaHandler } from "@notation/aws/lambda";
import { orderQueue } from "./infra";
const lambda = $lambda({
id: "process-orders",
event: () => sqs.bind(orderQueue),
});
export const handler: LambdaHandler<typeof lambda> = async (event) => {
for (const record of event.Records) {
const { body: order } = await lambda.decode(record);
await fulfil(order.orderId, order.quantity);
}
};import { queue } from "@notation/aws/sqs";
import { Order } from "./schema";
export const orderQueue = queue({
id: "orders",
schema: Order,
});import * as v from "valibot";
export const Order = v.object({
orderId: v.string(),
quantity: v.number(),
});Durable
Durable workflows that run almost anywhere
Notation Durable provides guaranteed execution that is fast, portable and easy to reason about. Runs anywhere with SQLite.
Get startedimport { workflow } from "@notation/durable";
import { Order, Stock } from "./stores";
export default workflow(async function* (step, event) {
const order = step.store(Order, { id: event.params.orderId });
const stock = step.store(Stock, { id: event.params.sku });
const address = yield* order.when("paid", (state) => state.paid && state.address);
yield* stock.take("reserve", (state) => state.count > 0, (draft) => {
draft.count -= 1;
});
yield* step.run("ship", () => dispatchPackage(order.id, address));
});import { defineStore } from "@notation/durable";
import * as v from "valibot";
export const Order = defineStore(
"order",
v.object({ paid: v.boolean(), address: v.optional(v.string()) }),
{ initial: () => ({ paid: false }) }
);
export const Stock = defineStore(
"stock",
v.object({ count: v.number() }),
{ initial: () => ({ count: 0 }) }
);Factory
Primitives for building provider-agnostic software factories
Notation Factory lets you connect the platforms you already use, such as GitHub and Slack, to coding agents running in remote containers.
Get startedimport { Container, Trigger } from "@notation/factory";
import * as claude from "@notation/factory-claude";
import * as github from "@notation/factory-github";
const gh = github.Connection.get("acme-agents").channel({ id: "issues" });
new Trigger("mention", {
event: gh.issueComment({ mention: "@claude" }),
worktree: (e) => `issue-${e.issue.number}`,
agent: new claude.Agent("coder"),
container: new Container("dev"),
});import * as cloudflare from "@notation/factory-cloudflare";
import * as github from "@notation/factory-github";
const vault = new cloudflare.Vault("vault");
const router = new cloudflare.Router("router", { vault });
const gh = new github.Connection("acme-agents", { org: "acme", router });
new github.CodeHost("github", { connection: gh, allow: [{ owner: "acme" }] });
new cloudflare.Deployer("deployer", { router, vault });