Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
chore: add contributor cla (#5745)
teo621ea847a558
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.ymlnew file mode 100644index 0000000000..c2155f67ac--- /dev/null+++ b/.github/workflows/cla.yml@@ -0,0 +1,143 @@+# DO NOT EDIT — regenerate with `cargo x workflows` (from the repository root).+# Source: tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs+name: CLA+'on':+ issue_comment:+ types:+ - created+ pull_request_target:+ types:+ - opened+ - synchronize+ - reopened+jobs:+ cla:+ if: github.event_name == 'pull_request_target' || (github.event.issue.pull_request && startsWith(github.event.comment.body, '@macro-bot'))+ name: CLA+ runs-on: namespace-profile-linux-tiny-no-cache+ permissions:+ issues: write+ pull-requests: write+ statuses: write+ steps:+ - name: Run CLA check+ uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b+ with:+ github-token: ${{ secrets.GITHUB_TOKEN }}+ script: |+ const WORKER_ORIGIN = 'https://macro-cla.macroverse.workers.dev';+ const SIGN_URL = `${WORKER_ORIGIN}/cla`;+ const STATUS_CONTEXT = 'cla';+ const { owner, repo } = context.repo;++ // GET /orgs/{org}/members/{username}: 204 → member, 404 → not a+ // member, 302 → the probing token itself lacks org visibility (treated+ // as not-a-member: fail closed). Anything else is an infra error.+ async function isOrgMember(username) {+ const res = await fetch(+ `https://api.github.com/orgs/${owner}/members/${encodeURIComponent(username)}`,+ {+ headers: {+ authorization: `Bearer ${process.env.ORG_READ_TOKEN}`,+ accept: 'application/vnd.github+json',+ 'user-agent': 'macro-cla-action',+ 'x-github-api-version': '2022-11-28',+ },+ redirect: 'manual',+ },+ );+ if (res.status === 204) return true;+ if (res.status === 404 || res.status === 302) return false;+ throw new Error(`org membership probe for ${username} returned ${res.status}`);+ }++ async function setStatus(sha, state, description) {+ await github.rest.repos.createCommitStatus({+ owner, repo, sha, state,+ context: STATUS_CONTEXT,+ description,+ target_url: SIGN_URL,+ });+ core.info(`cla → ${state}: ${description}`);+ }++ // The check is a pure function of (author, org membership, signature+ // store); nothing here reads or writes any other state.+ async function runCheck(pr) {+ const author = pr.user;+ const sha = pr.head.sha;+ if (author.type === 'Bot') {+ return setStatus(sha, 'success', 'bot account — CLA not required');+ }+ // The probe throws on rate limits and unexpected responses. Publish+ // the infra error rather than letting it escape: an uncaught throw+ // fails the step without ever creating the status, which reads as a+ // permanently pending check instead of a diagnosable failure.+ let isMember;+ try {+ isMember = await isOrgMember(author.login);+ } catch (err) {+ core.warning(`CLA org membership probe failed: ${err.message}`);+ return setStatus(sha, 'failure',+ 'CLA infrastructure error — comment "@macro-bot check" to retry');+ }+ if (isMember) {+ return setStatus(sha, 'success', 'macro-inc member — covered by CIIA');+ }+ let result;+ try {+ const res = await fetch(`${WORKER_ORIGIN}/cla/check?github_id=${author.id}`, {+ headers: { authorization: `Bearer ${process.env.CLA_CHECK_API_KEY}` },+ });+ if (!res.ok) throw new Error(`worker returned ${res.status}`);+ result = await res.json();+ } catch (err) {+ // Fail closed, but say why: this is an infra failure, not "unsigned".+ core.warning(`CLA worker check failed: ${err.message}`);+ return setStatus(sha, 'failure',+ 'CLA infrastructure error — comment "@macro-bot check" to retry');+ }+ if (result.signed) {+ return setStatus(sha, 'success', `CLA ${result.version} signed`);+ }+ return setStatus(sha, 'failure',+ `CLA not signed — see CONTRIBUTING.md, sign at ${SIGN_URL}`);+ }++ if (context.eventName === 'pull_request_target') {+ await runCheck(context.payload.pull_request);+ } else {+ const command = (context.payload.comment.body ?? '').split('\n')[0].trim();+ const prNumber = context.issue.number;+ if (command === '@macro-bot /cla') {+ // Invitation is a maintainer-only communication act; it does not+ // touch check state (the check is already red for an unsigned+ // author). Arbitrary users must not be able to make the bot ping+ // PR authors, so non-members just get a thumbs-down.+ if (await isOrgMember(context.payload.comment.user.login)) {+ const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: prNumber });+ await github.rest.issues.createComment({+ owner, repo, issue_number: prNumber,+ body: [+ `@${pr.user.login} — we'd like to merge this. Before we can, we need you to sign the`,+ 'Macro CLA (one time, covers all future contributions):',+ `**${SIGN_URL}**`,+ 'Once signed, comment `@macro-bot check` here and the CLA check will go green.',+ ].join('\n'),+ });+ } else {+ await github.rest.reactions.createForIssueComment({+ owner, repo, comment_id: context.payload.comment.id, content: '-1',+ });+ }+ } else if (command === '@macro-bot check') {+ const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: prNumber });+ await runCheck(pr);+ }+ }+ env:+ ORG_READ_TOKEN: ${{ secrets.CLA_ORG_READ_TOKEN || github.token }}+ CLA_CHECK_API_KEY: ${{ secrets.CLA_CHECK_API_KEY }}+concurrency:+ group: cla-${{ github.event.pull_request.number || github.event.issue.number }}+ cancel-in-progress: falsediff --git a/.github/workflows/deploy_cla_worker.yml b/.github/workflows/deploy_cla_worker.ymlnew file mode 100644index 0000000000..7040ab9749--- /dev/null+++ b/.github/workflows/deploy_cla_worker.yml@@ -0,0 +1,39 @@+# DO NOT EDIT — regenerate with `cargo x workflows` (from the repository root).+# Source: tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cla_worker.rs+name: Deploy CLA Worker+'on':+ push:+ branches:+ - main+ paths:+ - '.github/workflows/deploy_cla_worker.yml'+ - services/cla-worker/**+ workflow_dispatch: {}+jobs:+ deploy:+ name: Deploy to Cloudflare+ runs-on: namespace-profile-linux-small+ steps:+ - name: Checkout+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ with:+ clean: 'false'+ persist-credentials: 'false'+ - name: Setup Bun+ uses: oven-sh/setup-bun@v2+ - name: Setup Node+ uses: actions/setup-node@v4+ with:+ node-version: '22'+ - name: Install dependencies+ run: bun install --frozen-lockfile+ working-directory: services/cla-worker+ - name: Deploy with wrangler+ run: bun run deploy+ env:+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}+ CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}+ working-directory: services/cla-worker+concurrency:+ group: ${{ github.workflow }}+ cancel-in-progress: falsediff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 5e6faa5c41..86a16aea7e 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -54,6 +54,22 @@ See [docs/RUNNING_LOCALLY.md](docs/RUNNING_LOCALLY.md) for running the full app- If you changed SQL queries or migrations, run `just prepare_db` from therepository root to refresh the sqlx cache.+## Contributor License Agreement++Before we can merge a PR from outside the macro-inc GitHub org, you need to+have signed the Macro CLA. It's a one-time signature that covers all your+future contributions:++1. Every PR runs a required check named `cla`. If you haven't signed, it+ shows red — that's expected and doesn't block review.+2. Sign at **<https://macro-cla.macroverse.workers.dev/cla>** ("Sign with+ GitHub"; we request no OAuth scopes, only your public identity).+3. Comment `@macro-bot check` on your PR and the check re-runs and goes+ green.++macro-inc org members are exempt (employee agreements already cover their+contributions), as are bot accounts like Dependabot.+## LicenseBy contributing, you agree that your contributions will be licensed under thediff --git a/services/cla-worker/CLA.md b/services/cla-worker/CLA.mdnew file mode 100644index 0000000000..496ac8c349--- /dev/null+++ b/services/cla-worker/CLA.md@@ -0,0 +1,128 @@+# Macro Contributor License Agreement++**Version: 2026-08-19**++You (the contributor) are entering into an agreement with CoParse Inc., the+company behind Macro.++- You're giving Macro permission to use, modify, sublicense, and share your+ contributions.+- You keep ownership of your contributions — this is a license, not a+ transfer.+- You assure us that the contributions are truly your own and you have the+ legal right to share them.+- You're not required to support your contributions, but you're welcome to if+ you wish.+- If you ever notice an error or change in the details you've given us, you+ agree to let us know.++In short, this agreement covers the terms for your contributions to Macro's+projects. It does not change your rights to use your own Contributions for+any other purpose.++---++**Legally binding section follows:**++By submitting a Contribution to CoParse Inc., doing business as Macro+("Company"), you hereby accept and agree to the terms and conditions set+forth in this Contributor License Agreement (the "Agreement") for Your+present and future Contributions submitted to Company. Except for the+license granted herein to Company and recipients of software distributed or+made available by Company, You reserve all right, title, and interest in and+to Your Contributions.++## 1. Definitions.++"Contributor", "You", and "Your" shall mean the copyright owner or legal+entity authorized by the copyright owner that is making this Agreement with+Company. For legal entities, the entity making a Contribution and all other+entities that control, are controlled by, or are under common control with+that entity are considered to be a single Contributor. For the purposes of+this definition, "control" means (i) the power, direct or indirect, to cause+the direction or management of such entity, whether by contract or+otherwise, or (ii) ownership of fifty percent (50%) or more of the+outstanding shares, or (iii) beneficial ownership of such entity.++"Contribution" shall mean any original work of authorship, including any+modifications or additions to an existing work, that is intentionally+submitted by You to Company for inclusion in, or documentation of, any of+the products owned or managed by Company (the "Work"). For the purposes of+this definition, "submitted" means any form of electronic, verbal, or+written communication sent to Company or its representatives, including but+not limited to communication on electronic mailing lists, source code+control systems, and issue tracking or collaboration systems that are+managed by, or on behalf of, Company for the purpose of discussing and+improving the Work, but excluding communication that is conspicuously marked+or otherwise designated in writing by You as "Not a Contribution."++## 2. Grant of Copyright License.++Subject to the terms and conditions of this Agreement, You hereby grant to+Company, and to recipients of software distributed or made available by+Company, a perpetual, worldwide, non-exclusive, no-charge, royalty-free,+irrevocable copyright license to reproduce, prepare derivative works of,+publicly display, publicly perform, sublicense, and distribute Your+Contributions and such derivative works.++## 3. Grant of Patent License.++Subject to the terms and conditions of this Agreement, You hereby grant to+Company and to recipients of software distributed or made available by+Company a perpetual, worldwide, non-exclusive, no-charge, royalty-free,+irrevocable (except as stated in this section) patent license to make, have+made, use, offer to sell, sell, import, and otherwise transfer the Work,+where such license applies only to those patent claims licensable by You+that are necessarily infringed by Your Contribution(s) alone or by+combination of Your Contribution(s) with the Work to which such+Contribution(s) was submitted. If any entity institutes patent litigation+against You or any other entity (including a cross-claim or counterclaim in+a lawsuit) alleging that Your Contribution, or the Work to which You have+contributed, constitutes direct or contributory patent infringement, then+any patent licenses granted to that entity under this Agreement for that+Contribution or Work shall terminate as of the date such litigation is+filed.++## 4. Authority.++You represent that You are legally entitled to grant the above licenses. If+Your employer(s) has rights to intellectual property that You create that+includes Your Contributions, You represent that You have received permission+to make Contributions on behalf of that employer, that Your employer has+waived such rights for Your Contributions to Company, or that Your employer+has executed a separate Corporate Contributor License Agreement with+Company.++## 5. Originality.++You represent that each of Your Contributions is Your original creation (see+Section 7 for submissions on behalf of others). You represent that Your+Contribution submissions include complete details of any third-party license+or other restriction (including, but not limited to, related patents and+trademarks) of which You are personally aware and which are associated with+any part of Your Contributions.++## 6. No Support Obligation; No Warranty.++You are not expected to provide support for Your Contributions, except to+the extent You desire to provide support. You may provide support for free,+for a fee, or not at all. Unless required by applicable law or agreed to in+writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,+without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,+MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.++## 7. Third-Party Works.++Should You wish to submit work that is not Your original creation, You may+submit it to Company separately from any Contribution, identifying the+complete details of its source and of any license or other restriction+(including, but not limited to, related patents, trademarks, and license+agreements) of which You are personally aware, and conspicuously marking the+work as "Submitted on behalf of a third-party: [named here]".++## 8. Notification.++You agree to notify Company of any facts or circumstances of which You+become aware that would make these representations inaccurate in any+respect.diff --git a/services/cla-worker/README.md b/services/cla-worker/README.mdnew file mode 100644index 0000000000..ff88d15ec8--- /dev/null+++ b/services/cla-worker/README.md@@ -0,0 +1,81 @@+# cla-worker++Cloudflare Worker that collects and looks up Macro CLA signatures. Together+with the `cla.yml` GitHub workflow (generated from+`tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs`) it enforces the+CLA policy on `macro-inc/macro` pull requests.++## What it does++- `GET /cla` — serves [CLA.md](CLA.md) with a "Sign with GitHub" link.+ `?signed=1` renders the post-signature confirmation (the signer's receipt).+- `GET /cla/callback` — GitHub OAuth callback. Exchanges the code, reads the+ signer's public identity (`{ id, login }`), inserts a signature row, and+ redirects to the confirmation page. The OAuth token is requested with zero+ scopes, used for exactly one API call, and never stored.+- `GET /cla/check?github_id=<int>` — `Authorization: Bearer <CHECK_API_KEY>`+ gated lookup used by the enforcement Action. Returns+ `{ "signed": true, "version": "…" }` / `{ "signed": false, "version": null }`.+- Weekly cron — dumps the full `signatures` table as JSON to R2 under+ `cla-signatures/YYYY-MM-DD.json`, so the evidence never lives solely in D1.++## The store++One append-only D1 table, keyed on `(github_id, cla_version)`. `github_id` is+GitHub's immutable numeric user ID — never the login, which is mutable and+recyclable. Rows are never mutated or deleted; re-signing the same version is+an idempotent no-op (`INSERT OR IGNORE`), and signing a new version is a new+row.++## Versioning the CLA text++`CLA_VERSION` (wrangler.jsonc) is a date tag bumped only when CLA.md changes+materially. Never edit CLA.md without bumping — the check must never claim+someone agreed to words they didn't see. Whether pre-bump signatures still+satisfy `/cla/check` is a policy decision made at bump time: the check query+in `src/index.ts` is strict (current version only) by default; widen it to a+`cla_version IN (...)` allowlist to grandfather old versions or manually+inserted `ccla:<company>` rows.++## One-time setup++1. `wrangler d1 create macro-cla` and put the returned `database_id` in+ wrangler.jsonc, then `wrangler d1 migrations apply macro-cla --remote`.+2. `wrangler r2 bucket create macro-cla-exports`.+3. Create a GitHub **OAuth App** (not a GitHub App) under the macro-inc org+ with callback URL+ `https://macro-cla.macroverse.workers.dev/cla/callback`. Put the client ID+ in wrangler.jsonc (`GITHUB_CLIENT_ID`); `wrangler secret put+ GITHUB_CLIENT_SECRET`.+4. `wrangler secret put CHECK_API_KEY` with a long random value, and store+ the same value as the `CLA_CHECK_API_KEY` repo secret in `macro-inc/macro`.+5. Optionally set a `CLA_ORG_READ_TOKEN` repo secret (a `read:org` token) so+ the Action can see *private* org members; without it only public members+ are exempt from signing.+6. `bun run deploy` (or push to `main` — `deploy_cla_worker.yml` is+ path-gated on this directory). The deploy script applies pending D1+ migrations first.+7. In branch protection on `main`, mark the `cla` commit status as a required+ check.++> **Legal review**: CLA.md is a standard Apache-ICLA-derived draft. Have it+> reviewed by counsel before pointing real contributors at it; if the text+> changes, bump `CLA_VERSION` in the same commit.++## Hosting++Served at `https://macro-cla.macroverse.workers.dev` like the account's other+workers — the macro.com DNS zone is on Route 53, so a Cloudflare custom+domain isn't available. If the worker ever moves to a vanity host, update+together: the OAuth app callback URL, `WORKER_ORIGIN` in+`tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs` (then regenerate+workflows), CONTRIBUTING.md, and this file. The signature store is+unaffected by a host move.++## Development++```+bun install+bun run check # typecheck+bun run dev # local dev (uses a local D1/R2 simulacrum)+```diff --git a/services/cla-worker/bun.lock b/services/cla-worker/bun.locknew file mode 100644index 0000000000..6a93853f9c--- /dev/null+++ b/services/cla-worker/bun.lock@@ -0,0 +1,201 @@+{+ "lockfileVersion": 1,+ "configVersion": 1,+ "workspaces": {+ "": {+ "name": "cla-worker",+ "devDependencies": {+ "@cloudflare/workers-types": "^4.20250712.0",+ "typescript": "^5.7.3",+ "wrangler": "^4.25.1",+ },+ },+ },+ "packages": {+ "@cloudflare/kv-asset-handler": ["@cloudflare/[email protected]", "", {}, "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg=="],++ "@cloudflare/unenv-preset": ["@cloudflare/[email protected]", "", { "peerDependencies": { "unenv": "2.0.0-rc.24", "workerd": ">1.20260305.0 <2.0.0-0" }, "optionalPeers": ["workerd"] }, "sha512-ECxObrMfyTl5bhQf/lZCXwo5G6xX9IAUo+nDMKK4SZ8m4Jvvxp52vilxyySSWh2YTZz8+HQ07qGH/2rEom1vDw=="],++ "@cloudflare/workerd-darwin-64": ["@cloudflare/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-7PsLdcz6pT9EMd1EJGZEgMyYRfs0CHxGs62PS2L1w3s6+xGmQcRXKm/zoMftmqZF45JBa4MzFeownRKbRt/x5g=="],++ "@cloudflare/workerd-darwin-arm64": ["@cloudflare/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-60wtg8ng7FVWeOg/UMbZ9Ye0sslpRRAKoftPbdtuH2volq676quxVr6Zm2EjVULH/JFZeCn72dbLlrnbh0Mpcw=="],++ "@cloudflare/workerd-linux-64": ["@cloudflare/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-MuqKIHPo0Qyo8MZMmy0lP2B5PeAL7f4T9Fu4Usk3QdbV4JIrKG/OoybN3Ign7m/Dff+L1Oo/ZHydB+hEg1ueFw=="],++ "@cloudflare/workerd-linux-arm64": ["@cloudflare/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-XNFtJ5rIqJxnY6ISjkfbhT/ODiWJ6LcBvNbntuPD6I/F2k7aZeKgPaXrvWvKde66LXyzFKzc8Hn+Ydx4shevQg=="],++ "@cloudflare/workerd-windows-64": ["@cloudflare/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-PiIUWrhbMg3quolwjgMvPOd75vKESjT4aDm7nL6mSjL5IOgmpO/zKstXnYfnEH3pq7sC0UCvKlF8ZPcfsh8NMw=="],++ "@cloudflare/workers-types": ["@cloudflare/[email protected]", "", {}, "sha512-mOhf5TUEB1m2vPrxtqoIGfz0fUC9xyxRDx5gWHy5s+OCo6dcV+g7wI1R7gYCMFohhqF/2y2xeKVwMwCJjfn/WA=="],++ "@cspotcode/source-map-support": ["@cspotcode/[email protected]", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="],++ "@emnapi/runtime": ["@emnapi/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="],++ "@esbuild/aix-ppc64": ["@esbuild/[email protected]", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ=="],++ "@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ=="],++ "@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg=="],++ "@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng=="],++ "@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q=="],++ "@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ=="],++ "@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw=="],++ "@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ=="],++ "@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ=="],++ "@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g=="],++ "@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w=="],++ "@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg=="],++ "@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ=="],++ "@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ=="],++ "@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ=="],++ "@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag=="],++ "@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA=="],++ "@esbuild/netbsd-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw=="],++ "@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg=="],++ "@esbuild/openbsd-arm64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q=="],++ "@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw=="],++ "@esbuild/openharmony-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg=="],++ "@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ=="],++ "@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA=="],++ "@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg=="],++ "@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="],++ "@img/colour": ["@img/[email protected]", "", {}, "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ=="],++ "@img/sharp-darwin-arm64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.1" }, "os": "darwin", "cpu": "arm64" }, "sha512-eEieHsMksAW4IiO5NzauESRl2D2qz3J/kwUxUrSfV06A93eEaRfMpHXyUb1mAqrR7i8U9A0GRqE9pjn6u1Jjpg=="],++ "@img/sharp-darwin-x64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.1" }, "os": "darwin", "cpu": "x64" }, "sha512-BaktuGPCeHJMARpodR8jK4uKiZrPAy9WrfQW0sdI37clracq8Bp01AYS3SZgi5FS/y5twa9t4+LIuuxQjqRrWw=="],++ "@img/sharp-freebsd-wasm32": ["@img/[email protected]", "", { "dependencies": { "@img/sharp-wasm32": "0.35.2" }, "os": "freebsd" }, "sha512-YoAxdnd8hPUkvLHd3bWY+YA8nw3xM/RyRopYucNsWHVSan8NLVM3X2volsfoRDcXdUJPg6tXahSd7HXPK7lRnw=="],++ "@img/sharp-libvips-darwin-arm64": ["@img/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-4V/M3roRMTYjiwZY9IOVQOE8OyeCxFAkYmyZDrZl51uOKjibm3oeEJ4WAmLxutAfzFbC9jqUiPs2gbnGflH+7g=="],++ "@img/sharp-libvips-darwin-x64": ["@img/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-c0/DxItpJv2+dGhgycJBBgotdqruGYDvA79drdh0MD1dFpy7JzJ/PlXwi1H4rFf0eTy8tgbI91aHDnZIceY3jQ=="],++ "@img/sharp-libvips-linux-arm": ["@img/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-aGGy9aWzXgHBG7HNyQPWorZthlp7+x6fDRoPAQbGO3ThcttuTyKIx3NuSHb6zb4gBNq6/yNn9f1cy9nFKS/Vmg=="],++ "@img/sharp-libvips-linux-arm64": ["@img/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-JznefmcK9j1JKPz8AkQDh89kjojubyfOasWBPKfzMIhPwsgDy9evpE/naJTXXXmghS1iFwR8u/kTwh/I2/+GCw=="],++ "@img/sharp-libvips-linux-ppc64": ["@img/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-1EkwGNCZk6iWNCMWqrvdJ+r1j0PT1zIz60CNPhYnJlK/zyeWqlsPZIe+ocBVqPF8k/Ssee/NCk+tE9Ryrko6ng=="],++ "@img/sharp-libvips-linux-riscv64": ["@img/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-Ilays+w2bXdnxzxtQdmXR62u8o8GYa3eL4+Gr+1KiE4xperMZUslRaVPJwwPkzlHEjGfXAfRVAa/7CYCtSqsBw=="],++ "@img/sharp-libvips-linux-s390x": ["@img/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-VfBwVHQTbRoj4XlpA/KLZ7ltgMpz+4WSejFzQ+GnoImjo1PtEJ59QB2qR1xQEeRPYIkNrPIm2L4cICMvz4C2ew=="],++ "@img/sharp-libvips-linux-x64": ["@img/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-+c8ukgwU62DS54nCAjw7keOfHUkmr0B5QHEdcOqRnodF/MNXJbVI8Eopoj4B/0H8Asr65I+A4Amrn7a85/md6A=="],++ "@img/sharp-libvips-linuxmusl-arm64": ["@img/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-qlKb/pwbkAi1WMsJrYHk7CuDrd12s27U2QnRhFYUoJNrRCmkosMTttuRFat/DDB3IlDm5qE1TJgZ4JDnHX8Ldw=="],++ "@img/sharp-libvips-linuxmusl-x64": ["@img/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-yO21HwoUVLN8Qa+/SBjQLMYwBWAVJjeGPNe+hc0OUeMeifEtJqu5a1c4HayE1nNpDih9y3/KkoltfkDodmKAlg=="],++ "@img/sharp-linux-arm": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.1" }, "os": "linux", "cpu": "arm" }, "sha512-SE4kzF2mepn6z+6E7L6lsV8FzuLL6IPQdyX8ZiwROAG/G8td+hP/m7FsFPwidtrF19gvajuC9l6TxAVcsA4S7A=="],++ "@img/sharp-linux-arm64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.1" }, "os": "linux", "cpu": "arm64" }, "sha512-af12Pnd0ZGu2HfP8NayB0kk6eC/lrfbQE6HlR4jD+34wdJ1Vw9TF6TMn6ZvffT+WgqVsl0hRbmNvz2u/23VmwA=="],++ "@img/sharp-linux-ppc64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.1" }, "os": "linux", "cpu": "ppc64" }, "sha512-hYSBm7zcNtDCozCxQHYZJiu63b/bXsgRZuOxCIBZsStMM9Vap47iFHdbX4kCvQsblPB/k+clhELpdQJHQLSHvg=="],++ "@img/sharp-linux-riscv64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.1" }, "os": "linux", "cpu": "none" }, "sha512-qQt0Kc13+Hoan/Awq/qMSQw3L+RI1NCRPgD5cUJ/1WSSmIoysLOc72jlRM3E0OHN9Yr313jgeQ2T+zW+F03QFA=="],++ "@img/sharp-linux-s390x": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.1" }, "os": "linux", "cpu": "s390x" }, "sha512-E4fLLfRPzDLlEeDaTzI98OFLcv++WL5ChLLMwPoVd0CIoZQqupBSNbOisPL5am9XsbQ9T84+iiMpUvbFtkunbA=="],++ "@img/sharp-linux-x64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.1" }, "os": "linux", "cpu": "x64" }, "sha512-gi0zFJJRLswfCZmHtJdikXPOc5u7qamSOS3NHedLqLd4W8Q0NqjdBr6TTRIgsfFjqfTsHFgdfvJ9LwqSgcHiAA=="],++ "@img/sharp-linuxmusl-arm64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.1" }, "os": "linux", "cpu": "arm64" }, "sha512-siWbOW1u6HFnFLrp0waKyW7VEf7jYvcDWdrXEFa8AkdAQgEvuu5Fz8/Y70w9EeqAdwDtfU012BhEHHaDqvQNzg=="],++ "@img/sharp-linuxmusl-x64": ["@img/[email protected]", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.1" }, "os": "linux", "cpu": "x64" }, "sha512-YBqMMcjDi4QGYiSn4vNOYBhmlC4z5AXqkOUUqI2e0AFA4urNv4ESgOgwNl3K+4etQhha0twXlzeF20bbULm9Yg=="],++ "@img/sharp-wasm32": ["@img/[email protected]", "", { "dependencies": { "@emnapi/runtime": "^1.11.1" } }, "sha512-Mrv4JQNYVQ94xH+jzZ9r+gowleN8mv2FTgKT+PI6bx5C0G8TdNYndu161pg2i7uoBwxy2ImPMHrJOM2LZef7Bw=="],++ "@img/sharp-webcontainers-wasm32": ["@img/[email protected]", "", { "dependencies": { "@img/sharp-wasm32": "0.35.2" }, "cpu": "none" }, "sha512-QNV27pxs9wpApEiCfvHM1RDoP1w1+2KrUWWDPEhEwg+latvOrfuhWrHWZKwdSFwU6jh3myjw/yOCRsUIuOft3g=="],++ "@img/sharp-win32-arm64": ["@img/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-BiVRYc/t6/Vl3e1hBx0hugG4oN9Pydf4fgMSpxTQJmwGUg/YoXTWHiFeRymHfCZzifxu4F4rpk/I67D0LQ20wQ=="],++ "@img/sharp-win32-ia32": ["@img/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-YYEhx9PImCC7T0tI8JDMi4DB9LwLCXCU5OWNYEXAxh5Q1ShKkyC6byxzoBJ3gEFDnH2lQckWuDe70G7mB2XJog=="],++ "@img/sharp-win32-x64": ["@img/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ=="],++ "@jridgewell/resolve-uri": ["@jridgewell/[email protected]", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],++ "@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],++ "@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="],++ "@poppinss/colors": ["@poppinss/[email protected]", "", { "dependencies": { "kleur": "^4.1.5" } }, "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg=="],++ "@poppinss/dumper": ["@poppinss/[email protected]", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@sindresorhus/is": "^7.0.2", "supports-color": "^10.0.0" } }, "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw=="],++ "@poppinss/exception": ["@poppinss/[email protected]", "", {}, "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw=="],++ "@sindresorhus/is": ["@sindresorhus/[email protected]", "", {}, "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw=="],++ "@speed-highlight/core": ["@speed-highlight/[email protected]", "", {}, "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw=="],++ "blake3-wasm": ["[email protected]", "", {}, "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g=="],++ "cookie": ["[email protected]", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="],++ "detect-libc": ["[email protected]", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],++ "error-stack-parser-es": ["[email protected]", "", {}, "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA=="],++ "esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="],++ "fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],++ "kleur": ["[email protected]", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="],++ "miniflare": ["[email protected]", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.35.2", "undici": "7.29.0", "workerd": "1.20260815.1", "ws": "8.21.0", "youch": "4.1.0-beta.10" } }, "sha512-YAaGj4Sh5f4fqHKiMQ8zRHDOOM5IGUVtMhnLIeyjuQfU+9P6hcOTrHUVtbfj/ZPay9Kzik4pWELB39pGgefjiQ=="],++ "path-to-regexp": ["[email protected]", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="],++ "pathe": ["[email protected]", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],++ "semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="],++ "sharp": ["[email protected]", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.4" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.2", "@img/sharp-darwin-x64": "0.35.2", "@img/sharp-freebsd-wasm32": "0.35.2", "@img/sharp-libvips-darwin-arm64": "1.3.1", "@img/sharp-libvips-darwin-x64": "1.3.1", "@img/sharp-libvips-linux-arm": "1.3.1", "@img/sharp-libvips-linux-arm64": "1.3.1", "@img/sharp-libvips-linux-ppc64": "1.3.1", "@img/sharp-libvips-linux-riscv64": "1.3.1", "@img/sharp-libvips-linux-s390x": "1.3.1", "@img/sharp-libvips-linux-x64": "1.3.1", "@img/sharp-libvips-linuxmusl-arm64": "1.3.1", "@img/sharp-libvips-linuxmusl-x64": "1.3.1", "@img/sharp-linux-arm": "0.35.2", "@img/sharp-linux-arm64": "0.35.2", "@img/sharp-linux-ppc64": "0.35.2", "@img/sharp-linux-riscv64": "0.35.2", "@img/sharp-linux-s390x": "0.35.2", "@img/sharp-linux-x64": "0.35.2", "@img/sharp-linuxmusl-arm64": "0.35.2", "@img/sharp-linuxmusl-x64": "0.35.2", "@img/sharp-webcontainers-wasm32": "0.35.2", "@img/sharp-win32-arm64": "0.35.2", "@img/sharp-win32-ia32": "0.35.2", "@img/sharp-win32-x64": "0.35.2" } }, "sha512-FVtFjtBCMiJS6yb5CX7Sop45WFMpeGw6oRKuJnXYgf/f1ms/D7LE/ZUSNxnW7rZ/dbslQWYkoqFHGPaDBtaK4w=="],++ "supports-color": ["[email protected]", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="],++ "tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],++ "typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],++ "undici": ["[email protected]", "", {}, "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw=="],++ "unenv": ["[email protected]", "", { "dependencies": { "pathe": "^2.0.3" } }, "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw=="],++ "workerd": ["[email protected]", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20260815.1", "@cloudflare/workerd-darwin-arm64": "1.20260815.1", "@cloudflare/workerd-linux-64": "1.20260815.1", "@cloudflare/workerd-linux-arm64": "1.20260815.1", "@cloudflare/workerd-windows-64": "1.20260815.1" }, "bin": { "workerd": "bin/workerd" } }, "sha512-8bArFkHmlp7qFEKVPyNzDzHzS35gc2fg0PYBcDtaNLF7UCDryCX2BQnpkUkTHYIy824IRrHOTwOEoTj0sUO2Fg=="],++ "wrangler": ["[email protected]", "", { "dependencies": { "@cloudflare/kv-asset-handler": "0.5.0", "@cloudflare/unenv-preset": "2.16.1", "blake3-wasm": "2.1.5", "esbuild": "0.28.1", "miniflare": "5.20260815.0-alpha", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.24", "workerd": "1.20260815.1" }, "optionalDependencies": { "fsevents": "2.3.3" }, "peerDependencies": { "@cloudflare/workers-types": "^5.20260815.1" }, "optionalPeers": ["@cloudflare/workers-types"], "bin": { "wrangler": "bin/wrangler.js", "wrangler2": "bin/wrangler.js", "cf-wrangler": "bin/cf-wrangler.js" } }, "sha512-75euoZKjVTJYFy+Xhctt/5JlZL4M6A4xmovZsUlep+6GHcCm14n9VtdGzNIybOW2t8wuNxRj5iMUwjT5E7Ctog=="],++ "ws": ["[email protected]", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g=="],++ "youch": ["[email protected]", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@poppinss/dumper": "^0.6.4", "@speed-highlight/core": "^1.2.7", "cookie": "^1.0.2", "youch-core": "^0.3.3" } }, "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ=="],++ "youch-core": ["[email protected]", "", { "dependencies": { "@poppinss/exception": "^1.2.2", "error-stack-parser-es": "^1.0.5" } }, "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA=="],+ }+}diff --git a/services/cla-worker/migrations/0001_signatures.sql b/services/cla-worker/migrations/0001_signatures.sqlnew file mode 100644index 0000000000..938bcfafb8--- /dev/null+++ b/services/cla-worker/migrations/0001_signatures.sql@@ -0,0 +1,13 @@+-- Append-only signature store. Keyed on GitHub's immutable numeric user ID —+-- never the login, which is mutable and recyclable. A user signs each CLA+-- version at most once; signing a new version is a new row. Rows are never+-- mutated or deleted; corrections are new rows or a manual D1 operation with+-- a paper trail.+CREATE TABLE IF NOT EXISTS signatures (+ github_id INTEGER NOT NULL, -- immutable numeric GitHub user ID+ github_login TEXT NOT NULL, -- login at signing time; display only, never keyed on+ cla_version TEXT NOT NULL, -- version tag of the text they agreed to+ signed_at TEXT NOT NULL, -- ISO 8601 UTC+ ip TEXT, -- evidentiary; from CF-Connecting-IP+ PRIMARY KEY (github_id, cla_version)+);diff --git a/services/cla-worker/package.json b/services/cla-worker/package.jsonnew file mode 100644index 0000000000..ae0df2c03d--- /dev/null+++ b/services/cla-worker/package.json@@ -0,0 +1,16 @@+{+ "name": "cla-worker",+ "version": "0.0.1",+ "private": true,+ "type": "module",+ "scripts": {+ "dev": "wrangler dev",+ "deploy": "wrangler d1 migrations apply macro-cla --remote && wrangler deploy",+ "check": "tsc --noEmit"+ },+ "devDependencies": {+ "@cloudflare/workers-types": "^4.20250712.0",+ "typescript": "^5.7.3",+ "wrangler": "^4.25.1"+ }+}diff --git a/services/cla-worker/src/index.ts b/services/cla-worker/src/index.tsnew file mode 100644index 0000000000..14ca5a02c1--- /dev/null+++ b/services/cla-worker/src/index.ts@@ -0,0 +1,524 @@+/**+ * Macro CLA signing worker.+ *+ * Routes:+ * GET /cla – the CLA text with a "Sign with GitHub" link+ * (?signed=1 renders the post-signature confirmation)+ * GET /cla/callback – GitHub OAuth callback; records the signature+ * GET /cla/check – bearer-gated lookup for the enforcement Action+ *+ * Cron: weekly full-table JSON dump to R2.+ *+ * Design constraints (see the spec / README): no sessions, no framework, no+ * client JS. Signatures are keyed on GitHub's immutable numeric user ID and+ * versioned against the CLA text; the store is append-only. The OAuth token+ * is requested with zero scopes, used for exactly one API call, and never+ * stored. Every failure mode resolves to "not signed".+ */++// Bundled as a text module (see `rules` in wrangler.jsonc) so the served text+// and CLA_VERSION deploy atomically and can never drift.+import claMarkdown from "../CLA.md";++export interface Env {+ DB: D1Database;+ EXPORTS: R2Bucket;+ GITHUB_CLIENT_ID: string;+ GITHUB_CLIENT_SECRET: string;+ CHECK_API_KEY: string;+ CLA_VERSION: string;+}++const STATE_COOKIE = "cla_oauth_state";+/// Signing must complete within this window or the state cookie expires.+const STATE_COOKIE_MAX_AGE_SECONDS = 600;++const RECEIPT_COOKIE = "cla_receipt";+/// How long the confirmation page stays viewable after signing. Short: it is+/// a receipt for the person who just signed, not a durable record — the D1+/// row is the record.+const RECEIPT_COOKIE_MAX_AGE_SECONDS = 600;++export default {+ async fetch(request: Request, env: Env): Promise<Response> {+ if (request.method !== "GET") {+ return new Response("method not allowed", { status: 405 });+ }+ const url = new URL(request.url);+ switch (url.pathname) {+ case "/cla":+ return claPage(request, url, env);+ case "/cla/callback":+ return callback(request, url, env);+ case "/cla/check":+ return check(request, url, env);+ default:+ return new Response("not found", { status: 404 });+ }+ },++ async scheduled(_controller: ScheduledController, env: Env): Promise<void> {+ await exportSignatures(env);+ },+} satisfies ExportedHandler<Env>;++// ---------------------------------------------------------------------------+// GET /cla++async function claPage(request: Request, url: URL, env: Env): Promise<Response> {+ // Post-callback redirect target: refreshing this page never replays the+ // OAuth code exchange. The receipt cookie — not the query string — is what+ // authorizes the confirmation, so `?signed=1` alone renders nothing; an+ // absent or invalid receipt just falls through to the agreement.+ if (url.searchParams.get("signed") === "1") {+ const receipt = await readReceipt(env, readCookie(request, RECEIPT_COOKIE));+ if (receipt) {+ return confirmationPage(receipt, env);+ }+ }++ const nonce = randomHex(16);+ const signature = await hmacHex(env.GITHUB_CLIENT_SECRET, nonce);+ const authorizeUrl =+ "https://github.com/login/oauth/authorize" ++ `?client_id=${encodeURIComponent(env.GITHUB_CLIENT_ID)}` ++ `&state=${nonce}`;++ const body = pageShell(+ "Macro Contributor License Agreement",+ `${renderMarkdown(claMarkdown)}+ <div class="sign">+ <a class="button" href="${escapeHtml(authorizeUrl)}" rel="nofollow">Sign with GitHub</a>+ <p class="fine">Signing in with GitHub records your agreement to version+ ${escapeHtml(env.CLA_VERSION)} of this document against your GitHub+ account's numeric user ID, along with the time of signing and the IP+ address the signature was submitted from. We request no OAuth scopes —+ only your public GitHub identity.</p>+ </div>`,+ );++ return htmlResponse(body, 200, {+ // Standard CSRF handling: the nonce round-trips through GitHub as+ // `state` and must match this HMAC-signed, short-lived cookie.+ "Set-Cookie":+ `${STATE_COOKIE}=${nonce}.${signature}; Max-Age=${STATE_COOKIE_MAX_AGE_SECONDS}; ` ++ "Path=/cla; Secure; HttpOnly; SameSite=Lax",+ });+}++function confirmationPage(receipt: Receipt, env: Env): Response {+ // Display-only echo of what the callback just wrote; the D1 row is the+ // record.+ const who = ` as <strong>@${escapeHtml(receipt.login)}</strong>`;+ const when = receipt.signed_at+ ? ` on <strong>${escapeHtml(receipt.signed_at)}</strong>`+ : "";+ const body = pageShell(+ "CLA signed",+ `<h1>Signed ✓</h1>+ <p>You signed version <strong>${escapeHtml(env.CLA_VERSION)}</strong> of the+ Macro Contributor License Agreement${who}${when}. This covers all your+ future contributions — no need to sign again.</p>+ <p>If a pull request of yours has a red <code>cla</code> check, comment+ <code>@macro-bot check</code> on it and the check will re-run.</p>+ <p><a href="/cla">View the agreement</a></p>`,+ );+ return htmlResponse(body, 200);+}++// ---------------------------------------------------------------------------+// GET /cla/callback++async function callback(request: Request, url: URL, env: Env): Promise<Response> {+ const code = url.searchParams.get("code");+ const state = url.searchParams.get("state");+ if (!code || !state) {+ return errorPage("Missing OAuth parameters.", 400);+ }++ const cookie = readCookie(request, STATE_COOKIE);+ if (!cookie || !(await verifyState(env, cookie, state))) {+ return errorPage("State verification failed. Your signing session may have expired.", 403);+ }++ const tokenResponse = await fetch("https://github.com/login/oauth/access_token", {+ method: "POST",+ headers: { "Content-Type": "application/json", Accept: "application/json" },+ body: JSON.stringify({+ client_id: env.GITHUB_CLIENT_ID,+ client_secret: env.GITHUB_CLIENT_SECRET,+ code,+ }),+ });+ if (!tokenResponse.ok) {+ return errorPage("GitHub rejected the sign-in code exchange.", 502);+ }+ const token = ((await tokenResponse.json()) as { access_token?: string }).access_token;+ if (!token) {+ return errorPage("GitHub did not return an access token.", 502);+ }++ // The token's only use. It is never stored.+ const userResponse = await fetch("https://api.github.com/user", {+ headers: {+ Authorization: `Bearer ${token}`,+ Accept: "application/vnd.github+json",+ "User-Agent": "macro-cla-worker",+ "X-GitHub-Api-Version": "2022-11-28",+ },+ });+ if (!userResponse.ok) {+ return errorPage("Could not read your GitHub identity.", 502);+ }+ const user = (await userResponse.json()) as { id: number; login: string };+ if (typeof user.id !== "number" || typeof user.login !== "string") {+ return errorPage("GitHub returned an unexpected identity payload.", 502);+ }++ // INSERT OR IGNORE makes re-signing the same version idempotent: the+ // original row (and its signed_at) stands.+ await env.DB.prepare(+ "INSERT OR IGNORE INTO signatures (github_id, github_login, cla_version, signed_at, ip) VALUES (?1, ?2, ?3, ?4, ?5)",+ )+ .bind(+ user.id,+ user.login,+ env.CLA_VERSION,+ new Date().toISOString(),+ request.headers.get("CF-Connecting-IP"),+ )+ .run();++ const row = await env.DB.prepare(+ "SELECT signed_at FROM signatures WHERE github_id = ?1 AND cla_version = ?2",+ )+ .bind(user.id, env.CLA_VERSION)+ .first<{ signed_at: string }>();++ const confirmation = new URL("/cla", url.origin);+ confirmation.searchParams.set("signed", "1");++ const headers = new Headers({ Location: confirmation.toString() });+ headers.append(+ "Set-Cookie",+ `${STATE_COOKIE}=; Max-Age=0; Path=/cla; Secure; HttpOnly; SameSite=Lax`,+ );+ headers.append(+ "Set-Cookie",+ `${RECEIPT_COOKIE}=${await issueReceipt(env, {+ login: user.login,+ signed_at: row?.signed_at ?? "",+ })}; Max-Age=${RECEIPT_COOKIE_MAX_AGE_SECONDS}; ` ++ "Path=/cla; Secure; HttpOnly; SameSite=Lax",+ );+ return new Response(null, { status: 302, headers });+}++/// What the confirmation page displays back to the signer.+interface Receipt {+ login: string;+ signed_at: string;+}++/// Mint an HMAC-signed confirmation receipt. Without this the confirmation+/// page would render from query parameters, letting anyone craft a URL that+/// claims any account signed. Enforcement never reads this — it reads D1 —+/// but a receipt people screenshot should not be forgeable.+async function issueReceipt(env: Env, receipt: Receipt): Promise<string> {+ const payload = base64UrlEncode(JSON.stringify(receipt));+ return `${payload}.${await hmacHex(env.GITHUB_CLIENT_SECRET, payload)}`;+}++/// Verify and decode a receipt cookie. Any tampering, truncation, or garbage+/// resolves to `null`, which renders the agreement instead of a confirmation.+async function readReceipt(env: Env, cookie: string | null): Promise<Receipt | null> {+ if (!cookie) {+ return null;+ }+ const separator = cookie.lastIndexOf(".");+ if (separator <= 0) {+ return null;+ }+ const payload = cookie.slice(0, separator);+ const signature = cookie.slice(separator + 1);+ const expected = await hmacHex(env.GITHUB_CLIENT_SECRET, payload);+ if (!(await timingSafeEqualStrings(signature, expected))) {+ return null;+ }+ try {+ const parsed = JSON.parse(base64UrlDecode(payload)) as Partial<Receipt>;+ if (typeof parsed.login !== "string" || typeof parsed.signed_at !== "string") {+ return null;+ }+ return { login: parsed.login, signed_at: parsed.signed_at };+ } catch {+ return null;+ }+}++async function verifyState(env: Env, cookie: string, state: string): Promise<boolean> {+ const separator = cookie.lastIndexOf(".");+ if (separator <= 0) {+ return false;+ }+ const nonce = cookie.slice(0, separator);+ const signature = cookie.slice(separator + 1);+ const expected = await hmacHex(env.GITHUB_CLIENT_SECRET, nonce);+ return (await timingSafeEqualStrings(signature, expected)) && (await timingSafeEqualStrings(state, nonce));+}++// ---------------------------------------------------------------------------+// GET /cla/check++async function check(request: Request, url: URL, env: Env): Promise<Response> {+ const authorization = request.headers.get("Authorization") ?? "";+ const presented = authorization.startsWith("Bearer ") ? authorization.slice("Bearer ".length) : "";+ if (!presented || !(await timingSafeEqualStrings(presented, env.CHECK_API_KEY))) {+ return new Response("unauthorized", { status: 401 });+ }++ const githubId = url.searchParams.get("github_id") ?? "";+ if (!/^\d+$/.test(githubId)) {+ return new Response("github_id must be a numeric GitHub user id", { status: 400 });+ }++ // Strict versioning policy: only current-version rows pass. If a CLA bump+ // decides to grandfather earlier versions (or a CCLA `ccla:<company>` tag),+ // widen this to a `cla_version IN (...)` allowlist — that decision is made+ // at bump time, never implicitly.+ const row = await env.DB.prepare(+ "SELECT cla_version FROM signatures WHERE github_id = ?1 AND cla_version = ?2",+ )+ .bind(Number(githubId), env.CLA_VERSION)+ .first<{ cla_version: string }>();++ return Response.json(+ row ? { signed: true, version: row.cla_version } : { signed: false, version: null },+ );+}++// ---------------------------------------------------------------------------+// Weekly R2 export++async function exportSignatures(env: Env): Promise<void> {+ const { results } = await env.DB.prepare(+ "SELECT github_id, github_login, cla_version, signed_at, ip FROM signatures ORDER BY signed_at",+ ).all();+ const day = new Date().toISOString().slice(0, 10);+ await env.EXPORTS.put(`cla-signatures/${day}.json`, JSON.stringify(results, null, 2), {+ httpMetadata: { contentType: "application/json" },+ });+}++// ---------------------------------------------------------------------------+// Crypto helpers++function randomHex(bytes: number): string {+ const buffer = new Uint8Array(bytes);+ crypto.getRandomValues(buffer);+ return hex(buffer);+}++async function hmacHex(secret: string, message: string): Promise<string> {+ const key = await crypto.subtle.importKey(+ "raw",+ new TextEncoder().encode(secret),+ { name: "HMAC", hash: "SHA-256" },+ false,+ ["sign"],+ );+ const signature = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(message));+ return hex(new Uint8Array(signature));+}++/// Constant-time string comparison. Hashing both sides first equalizes the+/// lengths `timingSafeEqual` requires without leaking length information.+async function timingSafeEqualStrings(a: string, b: string): Promise<boolean> {+ const encoder = new TextEncoder();+ const [digestA, digestB] = await Promise.all([+ crypto.subtle.digest("SHA-256", encoder.encode(a)),+ crypto.subtle.digest("SHA-256", encoder.encode(b)),+ ]);+ return crypto.subtle.timingSafeEqual(digestA, digestB);+}++// Receipt payloads are ASCII by construction (GitHub logins and ISO+// timestamps), so btoa/atob are safe here.+function base64UrlEncode(text: string): string {+ return btoa(text).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");+}++function base64UrlDecode(text: string): string {+ const padded = text.replaceAll("-", "+").replaceAll("_", "/");+ return atob(padded + "=".repeat((4 - (padded.length % 4)) % 4));+}++function hex(buffer: Uint8Array): string {+ return Array.from(buffer, (byte) => byte.toString(16).padStart(2, "0")).join("");+}++function readCookie(request: Request, name: string): string | null {+ const header = request.headers.get("Cookie") ?? "";+ for (const part of header.split(";")) {+ const [key, ...rest] = part.trim().split("=");+ if (key === name) {+ return rest.join("=");+ }+ }+ return null;+}++// ---------------------------------------------------------------------------+// Rendering. A deliberately tiny markdown subset (headings, paragraphs,+// lists, hr, bold, code, links) — enough for CLA.md, which we author. Input+// is HTML-escaped before any markup is applied.++function renderMarkdown(markdown: string): string {+ const out: string[] = [];+ let list: "ul" | "ol" | null = null;+ let paragraph: string[] = [];++ const closeList = () => {+ if (list) {+ out.push(`</${list}>`);+ list = null;+ }+ };+ const closeParagraph = () => {+ if (paragraph.length > 0) {+ out.push(`<p>${inlineMarkdown(paragraph.join(" "))}</p>`);+ paragraph = [];+ }+ };++ for (const rawLine of markdown.split("\n")) {+ const line = rawLine.trimEnd();+ const heading = /^(#{1,6}) +(.*)$/.exec(line);+ const bullet = /^[-*] +(.*)$/.exec(line);+ const numbered = /^\d+\. +(.*)$/.exec(line);++ if (line === "") {+ closeParagraph();+ closeList();+ } else if (/^-{3,}$/.test(line)) {+ closeParagraph();+ closeList();+ out.push("<hr>");+ } else if (heading) {+ closeParagraph();+ closeList();+ const level = heading[1].length;+ out.push(`<h${level}>${inlineMarkdown(heading[2])}</h${level}>`);+ } else if (bullet || numbered) {+ closeParagraph();+ const kind = bullet ? "ul" : "ol";+ if (list !== kind) {+ closeList();+ out.push(`<${kind}>`);+ list = kind;+ }+ out.push(`<li>${inlineMarkdown((bullet ?? numbered)![1])}</li>`);+ } else if (list) {+ // Hard-wrapped continuation of the previous list item.+ const last = out.pop()!;+ out.push(last.replace(/<\/li>$/, ` ${inlineMarkdown(line.trim())}</li>`));+ } else {+ paragraph.push(line);+ }+ }+ closeParagraph();+ closeList();+ return out.join("\n");+}++function inlineMarkdown(text: string): string {+ return escapeHtml(text)+ .replace(/`([^`]+)`/g, "<code>$1</code>")+ .replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")+ .replace(+ /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,+ '<a href="$2" rel="noopener noreferrer">$1</a>',+ );+}++function escapeHtml(text: string): string {+ return text+ .replaceAll("&", "&")+ .replaceAll("<", "<")+ .replaceAll(">", ">")+ .replaceAll('"', """)+ .replaceAll("'", "'");+}++// The Macro M mark (apps/web/src/components/icon/macro-logo.svg), inlined so+// the page stays a single self-contained response.+const LOGO_SVG = `<svg width="34" height="34" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">+ <path d="M0 10.014v6.801a.75.75 0 0 0 .225.513l2.742 2.644 2.002-.8v-7.099l-2.97-2.859z"/>+ <path d="M4.078 4.8v5.786l1.36 1.309v1.313L12.481 20l2.002-.8-.001-7.1L6.078 4z"/>+ <path d="M13.594 4.8v5.786l1.36 1.311-.013 1.3L22 20 24 19.2V12.42a.75.75 0 0 0-.225-.533L15.595 4z"/>+</svg>`;++// The app's favicon (apps/web/public/macro-favicon.svg) in white, inlined as+// a data URI so the worker serves a single self-contained page.+const FAVICON_DATA_URI =+ "data:image/svg+xml," ++ "%3Csvg width='100%25' height='100%25' fill='%23ffffff' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E" ++ "%3Cpath d='m6.25 4.038-2.242 0.8792v5.8184l-1.756-1.6582-2.242 0.8792v6.6766c0 0.2568 0.106 0.502 0.292 0.6784l2.794 2.6422 2.244-0.879v-5.8184l7.084 6.6974 2.244-0.879v-5.8184l7.086 6.6976 2.24-0.8792v-6.6766c0-0.2568-0.104-0.5022-0.292-0.6784l-8.124-7.6816-2.244 0.879v5.8184z'/%3E" ++ "%3C/svg%3E";++function pageShell(title: string, content: string): string {+ return `<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<meta name="robots" content="noindex">+<meta name="color-scheme" content="dark">+<link rel="icon" type="image/svg+xml" href="${FAVICON_DATA_URI}">+<title>${escapeHtml(title)}</title>+<style>+ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;+ line-height: 1.6; color: #c9c9cc; background: #1a1a1c; margin: 0; }+ main { max-width: 44rem; margin: 0 auto; padding: 3rem 1.5rem 5rem; }+ .logo { color: #fff; margin-bottom: 1.4rem; }+ h1, h2, strong { color: #f4f4f5; }+ h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; margin-top: 2.2rem; }+ a { color: #f4f4f5; }+ ul { padding-left: 1.3rem; }+ li { margin: 0.35rem 0; }+ code { background: #2a2a2e; color: #e7e7ea; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.9em; }+ hr { border: none; border-top: 1px solid #2b2b2e; margin: 2.2rem 0; }+ .sign { margin-top: 2.8rem; text-align: center; }+ .button { display: inline-block; background: #f4f4f5; color: #1a1a1c; text-decoration: none;+ padding: 0.7rem 1.6rem; border-radius: 6px; font-weight: 600; }+ .button:hover { background: #fff; }+ .fine { color: #8b8b90; font-size: 0.85rem; max-width: 34rem; margin: 1.1rem auto 0; }+</style>+</head>+<body>+<main>+<div class="logo">${LOGO_SVG}</div>+${content}+</main>+</body>+</html>`;+}++function htmlResponse(body: string, status: number, headers: Record<string, string> = {}): Response {+ return new Response(body, {+ status,+ headers: { "Content-Type": "text/html; charset=utf-8", ...headers },+ });+}++function errorPage(message: string, status: number): Response {+ return htmlResponse(+ pageShell(+ "CLA signing failed",+ `<h1>Something went wrong</h1>+ <p>${escapeHtml(message)}</p>+ <p><a href="/cla">Try again</a></p>`,+ ),+ status,+ );+}diff --git a/services/cla-worker/src/modules.d.ts b/services/cla-worker/src/modules.d.tsnew file mode 100644index 0000000000..130cfe49ac--- /dev/null+++ b/services/cla-worker/src/modules.d.ts@@ -0,0 +1,5 @@+// Markdown files are bundled as text modules (see `rules` in wrangler.jsonc).+declare module "*.md" {+ const text: string;+ export default text;+}diff --git a/services/cla-worker/tsconfig.json b/services/cla-worker/tsconfig.jsonnew file mode 100644index 0000000000..6870db88dc--- /dev/null+++ b/services/cla-worker/tsconfig.json@@ -0,0 +1,17 @@+{+ "compilerOptions": {+ "target": "ESNext",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "skipLibCheck": true,+ "lib": ["ESNext"],+ "types": ["@cloudflare/workers-types"],+ "noEmit": true,+ "isolatedModules": true,+ "esModuleInterop": true,+ "resolveJsonModule": true+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules"]+}diff --git a/services/cla-worker/wrangler.jsonc b/services/cla-worker/wrangler.jsoncnew file mode 100644index 0000000000..443e9979b5--- /dev/null+++ b/services/cla-worker/wrangler.jsonc@@ -0,0 +1,70 @@+{+ "$schema": "node_modules/wrangler/config-schema.json",+ "name": "macro-cla",+ "main": "src/index.ts",+ "compatibility_date": "2025-07-22",+ "observability": {+ "enabled": true+ },+ // CLA.md is bundled as a text module so the served text and CLA_VERSION are+ // deployed atomically and can never drift from each other.+ "rules": [+ {+ "type": "Text",+ "globs": [+ "**/*.md"+ ],+ "fallthrough": true+ }+ ],+ // Served on workers.dev like the account's other workers (the macro.com+ // zone is on Route 53, so a Cloudflare custom domain isn't available).+ // Moving to a vanity host later only means updating the OAuth app callback+ // and WORKER_ORIGIN in tooling/xtask/.../workflows/cla.rs — the signature+ // store is unaffected.+ "workers_dev": true,+ "vars": {+ // Client ID of the "Macro CLA" GitHub OAuth App (not a GitHub App).+ // Callback URL must be+ // https://macro-cla.macroverse.workers.dev/cla/callback. The matching+ // GITHUB_CLIENT_SECRET and CHECK_API_KEY are Worker secrets — see README.+ "GITHUB_CLIENT_ID": "Ov23liHJwqaYS2VRXWNr",+ // Date tag of the current CLA text. Bump ONLY together with a material+ // change to CLA.md; never edit the text without bumping (see README).+ "CLA_VERSION": "2026-08-19"+ },+ "d1_databases": [+ {+ "binding": "DB",+ "database_name": "macro-cla",+ // From `wrangler d1 create macro-cla` — see README.+ "database_id": "a040e03d-dacc-4d84-afca-5b34c6a26f81"+ },+ {+ "binding": "macro_cla",+ "database_name": "macro-cla",+ "database_id": "a040e03d-dacc-4d84-afca-5b34c6a26f81",+ "remote": true+ }+ ],+ "r2_buckets": [+ {+ "binding": "EXPORTS",+ "bucket_name": "macro-cla-exports"+ },+ {+ "bucket_name": "macro-cla-exports",+ "binding": "macro_cla_exports",+ "remote": true+ }+ ],+ "triggers": {+ // Weekly full-table dump to R2 — evidence must not live solely in D1.+ "crons": [+ "0 6 * * 1"+ ]+ },+ "dev": {+ "port": 8099+ }+}\ No newline at end of filediff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rsnew file mode 100644index 0000000000..cc167f7b38--- /dev/null+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs@@ -0,0 +1,212 @@+//! `CLA` — enforces the Contributor License Agreement on PRs.+//!+//! Produces the required `cla` commit status. The check is a pure function of+//! (author identity, org membership, signature store): bots pass, macro-inc+//! org members pass (their CIIA assigns IP to CoParse Inc., superseding the+//! CLA), everyone else needs a signature on file with the signing worker+//! (`services/cla-worker`). No labels, no stored state; re-runs are+//! idempotent. If the worker is unreachable the check fails *closed* with an+//! infrastructure-error description.+//!+//! Two triggers:+//! - `pull_request_target` (opened / synchronize / reopened): set the status,+//! silently — the bot never comments unprompted.+//! - `issue_comment` (created) on PRs: `@macro-bot /cla` (org members only)+//! posts the signing invitation; `@macro-bot check` (anyone) re-runs the+//! check.+//!+//! `pull_request_target` runs with base-repo secrets on fork PRs, so this job+//! must never check out or execute PR head code — there is deliberately no+//! checkout step; it only reads event metadata and calls two APIs.++use gh_workflow::{+ Concurrency, Event, Expression, IssueComment, IssueCommentType, Job, Level, Permissions,+ PullRequestTarget, PullRequestType, Step, Use, Workflow,+};++use crate::workflows::runners;++/// Base URL of the signing worker (`services/cla-worker`). On workers.dev+/// like the account's other workers; if it ever moves to a vanity host,+/// update this constant, the OAuth app callback URL, CONTRIBUTING.md, and+/// the worker README together.+const WORKER_ORIGIN: &str = "https://macro-cla.macroverse.workers.dev";++/// Build the workflow.+pub fn cla() -> Workflow {+ Workflow::new("CLA")+ .on(Event::default()+ .pull_request_target(+ PullRequestTarget::default()+ .add_type(PullRequestType::Opened)+ .add_type(PullRequestType::Synchronize)+ .add_type(PullRequestType::Reopened),+ )+ .issue_comment(IssueComment::default().add_type(IssueCommentType::Created)))+ // Serialize runs per PR so a burst of events can't interleave status+ // writes; never cancel — a dropped run could leave a stale status.+ .concurrency(+ Concurrency::new(Expression::new(+ "cla-${{ github.event.pull_request.number || github.event.issue.number }}",+ ))+ .cancel_in_progress(false),+ )+ .add_job("cla", cla_job())+}++fn cla_job() -> Job {+ Job::default()+ .name("CLA")+ .runs_on(runners::Runner::TinyNoCache.to_string())+ // Skip non-PR comments and comments that can't be a command; the+ // command itself is exact-matched in the script.+ .cond(Expression::new(+ "github.event_name == 'pull_request_target' || \+ (github.event.issue.pull_request && startsWith(github.event.comment.body, '@macro-bot'))",+ ))+ .permissions(Permissions {+ statuses: Some(Level::Write),+ pull_requests: Some(Level::Write),+ issues: Some(Level::Write),+ ..Default::default()+ })+ .add_step(cla_script())+}++fn cla_script() -> Step<Use> {+ Step::new("Run CLA check")+ .uses(+ "actions",+ "github-script",+ "f28e40c7f34bde8b3046d885e986cb6290c5673b",+ )+ // Org-membership probe. The default GITHUB_TOKEN only sees public org+ // members; set the CLA_ORG_READ_TOKEN secret (read:org PAT or app+ // token) so private members pass without signing.+ .add_env((+ "ORG_READ_TOKEN",+ "${{ secrets.CLA_ORG_READ_TOKEN || github.token }}",+ ))+ // Shared secret for the signing worker's /cla/check endpoint.+ .add_env(("CLA_CHECK_API_KEY", "${{ secrets.CLA_CHECK_API_KEY }}"))+ .add_with(("github-token", "${{ secrets.GITHUB_TOKEN }}"))+ .add_with(("script", script()))+}++/// The whole enforcement logic. Comment bodies are only ever read from the+/// runtime event payload (never template-interpolated), so untrusted text+/// cannot inject into this script.+fn script() -> String {+ indoc::formatdoc! {r#"+ const WORKER_ORIGIN = '{WORKER_ORIGIN}';+ const SIGN_URL = `${{WORKER_ORIGIN}}/cla`;+ const STATUS_CONTEXT = 'cla';+ const {{ owner, repo }} = context.repo;++ // GET /orgs/{{org}}/members/{{username}}: 204 → member, 404 → not a+ // member, 302 → the probing token itself lacks org visibility (treated+ // as not-a-member: fail closed). Anything else is an infra error.+ async function isOrgMember(username) {{+ const res = await fetch(+ `https://api.github.com/orgs/${{owner}}/members/${{encodeURIComponent(username)}}`,+ {{+ headers: {{+ authorization: `Bearer ${{process.env.ORG_READ_TOKEN}}`,+ accept: 'application/vnd.github+json',+ 'user-agent': 'macro-cla-action',+ 'x-github-api-version': '2022-11-28',+ }},+ redirect: 'manual',+ }},+ );+ if (res.status === 204) return true;+ if (res.status === 404 || res.status === 302) return false;+ throw new Error(`org membership probe for ${{username}} returned ${{res.status}}`);+ }}++ async function setStatus(sha, state, description) {{+ await github.rest.repos.createCommitStatus({{+ owner, repo, sha, state,+ context: STATUS_CONTEXT,+ description,+ target_url: SIGN_URL,+ }});+ core.info(`cla → ${{state}}: ${{description}}`);+ }}++ // The check is a pure function of (author, org membership, signature+ // store); nothing here reads or writes any other state.+ async function runCheck(pr) {{+ const author = pr.user;+ const sha = pr.head.sha;+ if (author.type === 'Bot') {{+ return setStatus(sha, 'success', 'bot account — CLA not required');+ }}+ // The probe throws on rate limits and unexpected responses. Publish+ // the infra error rather than letting it escape: an uncaught throw+ // fails the step without ever creating the status, which reads as a+ // permanently pending check instead of a diagnosable failure.+ let isMember;+ try {{+ isMember = await isOrgMember(author.login);+ }} catch (err) {{+ core.warning(`CLA org membership probe failed: ${{err.message}}`);+ return setStatus(sha, 'failure',+ 'CLA infrastructure error — comment "@macro-bot check" to retry');+ }}+ if (isMember) {{+ return setStatus(sha, 'success', 'macro-inc member — covered by CIIA');+ }}+ let result;+ try {{+ const res = await fetch(`${{WORKER_ORIGIN}}/cla/check?github_id=${{author.id}}`, {{+ headers: {{ authorization: `Bearer ${{process.env.CLA_CHECK_API_KEY}}` }},+ }});+ if (!res.ok) throw new Error(`worker returned ${{res.status}}`);+ result = await res.json();+ }} catch (err) {{+ // Fail closed, but say why: this is an infra failure, not "unsigned".+ core.warning(`CLA worker check failed: ${{err.message}}`);+ return setStatus(sha, 'failure',+ 'CLA infrastructure error — comment "@macro-bot check" to retry');+ }}+ if (result.signed) {{+ return setStatus(sha, 'success', `CLA ${{result.version}} signed`);+ }}+ return setStatus(sha, 'failure',+ `CLA not signed — see CONTRIBUTING.md, sign at ${{SIGN_URL}}`);+ }}++ if (context.eventName === 'pull_request_target') {{+ await runCheck(context.payload.pull_request);+ }} else {{+ const command = (context.payload.comment.body ?? '').split('\n')[0].trim();+ const prNumber = context.issue.number;+ if (command === '@macro-bot /cla') {{+ // Invitation is a maintainer-only communication act; it does not+ // touch check state (the check is already red for an unsigned+ // author). Arbitrary users must not be able to make the bot ping+ // PR authors, so non-members just get a thumbs-down.+ if (await isOrgMember(context.payload.comment.user.login)) {{+ const {{ data: pr }} = await github.rest.pulls.get({{ owner, repo, pull_number: prNumber }});+ await github.rest.issues.createComment({{+ owner, repo, issue_number: prNumber,+ body: [+ `@${{pr.user.login}} — we'd like to merge this. Before we can, we need you to sign the`,+ 'Macro CLA (one time, covers all future contributions):',+ `**${{SIGN_URL}}**`,+ 'Once signed, comment `@macro-bot check` here and the CLA check will go green.',+ ].join('\n'),+ }});+ }} else {{+ await github.rest.reactions.createForIssueComment({{+ owner, repo, comment_id: context.payload.comment.id, content: '-1',+ }});+ }}+ }} else if (command === '@macro-bot check') {{+ const {{ data: pr }} = await github.rest.pulls.get({{ owner, repo, pull_number: prNumber }});+ await runCheck(pr);+ }}+ }}+ "#}+}diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cla_worker.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cla_worker.rsnew file mode 100644index 0000000000..35a94436c8--- /dev/null+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cla_worker.rs@@ -0,0 +1,64 @@+//! `Deploy CLA Worker` — deploys the `cla-worker` Cloudflare Worker+//! (`services/cla-worker`) via wrangler. Generated into+//! `deploy_cla_worker.yml`.+//!+//! Push to `main` (path-gated) auto-deploys; `workflow_dispatch` allows a+//! manual redeploy. There is a single production instance — the worker is a+//! legal-record store, not something with meaningful dev/prod split. The+//! `deploy` script applies pending D1 migrations before `wrangler deploy`.++use gh_workflow::{+ Concurrency, Event, Expression, Job, Push, Run, Step, Use, Workflow, WorkflowDispatch,+};++use crate::workflows::{runners, steps, vars};++/// Build the workflow.+pub fn deploy_cla_worker() -> Workflow {+ Workflow::new("Deploy CLA Worker")+ .on(Event::default()+ .push(+ Push::default()+ .add_branch("main")+ .add_path(xtask_paths::repo_glob!(+ ".github/workflows/deploy_cla_worker.yml"+ ))+ .add_path(xtask_paths::repo_glob!("services/cla-worker/**")),+ )+ .workflow_dispatch(WorkflowDispatch::default()))+ .concurrency(+ Concurrency::new(Expression::new("${{ github.workflow }}")).cancel_in_progress(false),+ )+ .add_job("deploy", deploy())+}++fn deploy() -> Job {+ Job::default()+ .name("Deploy to Cloudflare")+ .runs_on(runners::Runner::Small.to_string())+ .add_step(steps::checkout(false, false))+ .add_step(steps::setup_bun())+ .add_step(setup_node())+ .add_step(install_deps())+ .add_step(deploy_step())+}++fn setup_node() -> Step<Use> {+ Step::new("Setup Node")+ .uses("actions", "setup-node", "v4")+ .add_with(("node-version", "22"))+}++fn install_deps() -> Step<Run> {+ Step::new("Install dependencies")+ .run("bun install --frozen-lockfile")+ .working_directory(xtask_paths::repo_dir!("services/cla-worker"))+}++fn deploy_step() -> Step<Run> {+ Step::new("Deploy with wrangler")+ .run("bun run deploy")+ .working_directory(xtask_paths::repo_dir!("services/cla-worker"))+ .add_env(("CLOUDFLARE_API_TOKEN", vars::CLOUDFLARE_API_TOKEN))+ .add_env(("CLOUDFLARE_ACCOUNT_ID", vars::CLOUDFLARE_ACCOUNT_ID))+}diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/mod.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/mod.rsindex c98480b09f..95219fd6a5 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/mod.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/mod.rs@@ -19,12 +19,14 @@ mod cargo_deny;mod cargo_workspace_dependency_check;mod check_generated;mod check_node_modules_nix;+mod cla;mod cleanup_preview;mod code_check_cloud_storage;mod code_check_conventions;mod code_check_infra;mod deploy_ai_editing_worker;mod deploy_all_services;+mod deploy_cla_worker;mod deploy_fusionauth_instance;mod deploy_on_push;mod deploy_preview;@@ -149,6 +151,11 @@ const WORKFLOWS: &[WorkflowFile] = &[render_gh_workflow(cargo_workspace_dependency_check::cargo_workspace_dependency_check)()},},+ WorkflowFile {+ slug: "cla",+ file_name: "cla.yml",+ render_yaml: || render_gh_workflow(cla::cla)(),+ },WorkflowFile {slug: "cleanup_preview",file_name: "cleanup_preview.yml",@@ -179,6 +186,11 @@ const WORKFLOWS: &[WorkflowFile] = &[)},},+ WorkflowFile {+ slug: "deploy_cla_worker",+ file_name: "deploy_cla_worker.yml",+ render_yaml: || render_gh_workflow(deploy_cla_worker::deploy_cla_worker)(),+ },WorkflowFile {slug: "deploy_on_push",file_name: "deploy_on_push.yml",