Add runtime Fetcher Capability adapters#21
Merged
Conversation
…05/26/runtime-adapters-on-hosted
commit: |
…05/26/runtime-adapters-on-hosted
…05/26/runtime-adapters-on-hosted
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 82ef44b. Configure here.
…05/26/runtime-adapters-on-hosted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds runtime adapter entry points on top of the now-merged gateway-owned addressing model.
captun/node,captun/bun, andcaptun/denoruntime adapter entry points for accepting Fetcher Capabilities outside Cloudflare Workerscaptunas the high-level client/Cloudflare entry point while sharing the Fetcher Stub plumbing throughsrc/server-core.ts/weatherapp, and callsready({ url })beforecreateCaptunTunnel({ gateway })resolvesThe examples are intentionally repetitive: each runtime folder has a self-contained weather server plus its own test helper, so a reviewer can open one folder and see the complete runtime shape without following a shared app module or fixture module.
Example Shapes
Each example exposes a normal
/weatherroute. When a Captun client connects to/__intercept-egress-traffic, outbound weather API calls go through that Fetcher Stub; otherwise they fall back to the runtime's regularfetch.Node
Bun
Deno
Cloudflare Workers
Verification
pnpm exec vitest run test/hosted-worker.test.tspnpm run checkpnpm testpnpm run buildpnpm pack --pack-destination /tmp/captun-pack-runtime-ignoremenpx --yes --package @arethetypeswrong/cli@0.18.2 --package fflate@0.8.2 attw /tmp/captun-pack-runtime-ignoreme/captun-0.0.2.tgz --profile esm-only