This repository is an executable companion to the five-part Code Mode series. Check out the branch for the article you are reading, run its evaluation, and inspect the small diff from the previous checkpoint.
| Part | Branch | What it demonstrates |
|---|---|---|
| 1 | part-1-direct-tools |
Two direct MCP file tools return the source content to the model. |
| 2 | part-2-generic-code-mode |
One generic code tool runs a generated file transformation through a typed Drive facade. |
| 3 | part-3-search |
Generated search code inspects a server-side, pre-resolved OpenAPI specification. |
| 4 | part-4-local-execute |
Generated code makes one narrow request through a host-owned api.request() helper. |
| 5 | part-5-dynamic-workers |
Cloudflare Dynamic Workers replace local evaluation with isolated search and execute runtimes. |
Install once at the repository root with pnpm install. Each checkpoint documents its expected local URLs and runs its claim with pnpm evaluate. pnpm typecheck checks the TypeScript in the active checkpoint.
The current checkpoint runs generated code in local Cloudflare Dynamic Workers. It intentionally uses an unauthenticated fixture and minimal origin-only egress control; production authentication, authorization, and deployment are out of scope.