Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge branch 'worktree-agent-a1b995daa94e4e1b7' | 1 | // Stand-ins for identity, events, security and billing, so the repos |
| 2 | // service answers anonymous git requests with `wrangler dev` (repos.jsonc). | |
| 3 | // | |
| Merge main into Artifacts Phase 2 | 4 | // - Identity knows one person, `dev` (secret `dev-push-secret`), the owner |
| 5 | // of the `acme` workspace, so pushes can be tried (push-check.mjs); any | |
| 6 | // other credentials name no one, and no workspace was renamed or | |
| 7 | // aliased. Public repositories can be cloned without signing in. | |
| Merge branch 'worktree-agent-a1b995daa94e4e1b7' | 8 | // - Events takes every event and audit entry and logs them. |
| 9 | // - Security has allowed no secrets; billing says every workspace is free. | |
| 10 | ||
| 11 | export default { | |
| 12 | async fetch(request) { | |
| 13 | const method = new URL(request.url).pathname.replace(/^\/rpc\//, ""); | |
| 14 | const args = await request.json().catch(() => ({})); | |
| 15 | const json = (value) => Response.json(value); | |
| 16 | switch (method) { | |
| 17 | case "user_for_git_credentials": | |
| Merge main into Artifacts Phase 2 | 18 | return json( |
| 19 | args.username === "dev" && args.secret === "dev-push-secret" | |
| 20 | ? { id: "usr_dev", username: "dev", kind: "user", verified: true, workspaces: [{ slug: "acme", role: "owner" }] } | |
| 21 | : null, | |
| 22 | ); | |
| Merge branch 'worktree-agent-a1b995daa94e4e1b7' | 23 | case "resolve_slug": |
| Merge branch 'worktree-agent-a8385d293d42c913a' | 24 | case "resolve_alias": |
| Merge branch 'worktree-agent-a1b995daa94e4e1b7' | 25 | return json(null); |
| 26 | case "is_free": | |
| 27 | case "plan": | |
| 28 | return json({ free: true }); | |
| 29 | default: | |
| 30 | console.log(`stub ${method}`, JSON.stringify(args).slice(0, 200)); | |
| 31 | return json(null); | |
| 32 | } | |
| 33 | }, | |
| 34 | }; |
This file's history is long; its oldest lines are credited to the oldest commit read.