examples/ directory of the repository holds one
program per subject. Each index.ts is harness code you run; each scripts/*.ts is what a model would write, and runs in
Rewind’s sandbox.
Quickstart
A toolset with the
http tool and a host tool, a worker, a run and its output.Agent loop
Claude (
anthropic.ts) and the OpenAI Responses API (openai.ts) with the agent tools.Human approval
A refund that waits for a manager’s signal, then for the harness to approve the payment call.
Host tools
Failures the script catches, idempotency keys, a question answered days later by its token.
Workflows
A typed workflow, a script that fans out over its runs, a run started by name.
End users
Namespaces, an end user’s token, quotas and their refusals, revocation.
Webhooks
A subscription, verified deliveries,
run.suspended and run.completed.Testing
Type-checking, scenarios in virtual time, a fork that fixes a failed run, a cassette.
Run them
Node 22.18 or later, which runs TypeScript as is, and pnpm.api.github.com without credentials: GitHub allows 60 such requests an hour. pnpm webhooks needs
a URL Rewind can deliver to: a public https:// URL (a tunnel to your machine, in WEBHOOK_URL), or a server of your
own started with --allow-private-webhooks.