This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Cloudflare Worker that serves as a proxy for the latest Development.netcanvas asset from GitHub releases. It provides a stable URL that always resolves to the most recent @codaco/development-protocol release from the complexdatacollective/network-canvas-monorepo repository, solving CORS issues when accessing GitHub assets directly.
pnpm dev- Start local development server (runs on http://localhost:8787/)pnpm deploy- Deploy worker to Cloudflarepnpm cf-typegen- Generate TypeScript types for Cloudflare Worker environment
The worker implements a single fetch handler that:
- Fetches all releases from GitHub API (not just latest, since latest is rarely a development protocol release)
- Filters for development protocol releases using naming pattern
@codaco/development-protocol-YYYYMMDDHHMMSS-SHA - Sorts by timestamp extracted from release names to find the most recent
- Proxies the Development.netcanvas asset with proper CORS headers
- Handles OPTIONS requests for CORS preflight
- Biome configuration: Inherits from root (tabs for indentation, 120 char line width, double quotes)
- TypeScript: Strict mode with isolated modules
- Type definitions for external APIs (GitHubRelease, GitHubAsset)
- Async/await pattern for HTTP requests with proper error handling
- CORS headers on all responses with 5-minute caching
- Uses Web APIs only (no Node.js APIs available in Cloudflare Workers)
- Timestamp extraction uses regex:
/@codaco\/development-protocol-(\d{14})/ - Release sorting is done by comparing timestamp strings lexicographically
- Proper error responses with appropriate HTTP status codes
- Response streaming for large assets