-
Notifications
You must be signed in to change notification settings - Fork 79
feat(channels): add chrome-extension interface id and per-capability host proxy gating #24111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
noanflaherty
merged 9 commits into
noanflaherty/host-browser-proxy-phase-2
from
run-plan/host-browser-ph2/pr-4
Apr 7, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fd25c30
feat(channels): add chrome-extension interface id and per-capability …
noanflaherty e8e10d1
Merge remote-tracking branch 'origin/main' into run-plan/host-browser…
noanflaherty 924a415
Merge remote-tracking branch 'origin/noanflaherty/host-browser-proxy-…
noanflaherty b7902e0
fix(channels): keep hostBrowserProxy available for non-interactive ch…
noanflaherty 911aa3e
fix(channels): targeted hostBrowserProxy enable without relaxing hasN…
noanflaherty beda525
fix(channels): drop 'historically' from JSDoc and tighten chrome-exte…
noanflaherty d450875
test: add restoreBrowserProxyAvailability to Conversation mocks
noanflaherty 833d9e9
fix(routes): optional-chain restoreBrowserProxyAvailability for test …
noanflaherty ae8e7df
test: allowlist chrome-extension-native-host in gateway-only guard
noanflaherty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
|
|
||
| import { | ||
| INTERACTIVE_INTERFACES, | ||
| INTERFACE_IDS, | ||
| isInterfaceId, | ||
| supportsHostProxy, | ||
| } from "../types.js"; | ||
|
|
||
| describe("INTERFACE_IDS", () => { | ||
| test("includes chrome-extension", () => { | ||
| expect( | ||
| (INTERFACE_IDS as readonly string[]).includes("chrome-extension"), | ||
| ).toBe(true); | ||
| }); | ||
|
|
||
| test("still includes macos and other existing interfaces", () => { | ||
| for (const id of [ | ||
| "macos", | ||
| "ios", | ||
| "cli", | ||
| "telegram", | ||
| "phone", | ||
| "vellum", | ||
| "whatsapp", | ||
| "slack", | ||
| "email", | ||
| ]) { | ||
| expect((INTERFACE_IDS as readonly string[]).includes(id)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe("INTERACTIVE_INTERFACES", () => { | ||
| test("does NOT include chrome-extension", () => { | ||
| // Chrome extensions don't render SSE-backed prompter UI, so they must | ||
| // stay out of the interactive set even though they have an InterfaceId. | ||
| expect(INTERACTIVE_INTERFACES.has("chrome-extension" as never)).toBe(false); | ||
| }); | ||
|
|
||
| test("still includes macos", () => { | ||
| expect(INTERACTIVE_INTERFACES.has("macos")).toBe(true); | ||
| }); | ||
| }); | ||
|
|
||
| describe("isInterfaceId", () => { | ||
| test("returns true for chrome-extension", () => { | ||
| expect(isInterfaceId("chrome-extension")).toBe(true); | ||
| }); | ||
|
|
||
| test("returns true for macos", () => { | ||
| expect(isInterfaceId("macos")).toBe(true); | ||
| }); | ||
|
|
||
| test("returns false for unknown interface", () => { | ||
| expect(isInterfaceId("safari-extension")).toBe(false); | ||
| }); | ||
| }); | ||
|
|
||
| describe("supportsHostProxy", () => { | ||
| // ── macOS: supports every capability, and the no-arg form returns true. ── | ||
| test("macos returns true (no capability)", () => { | ||
| expect(supportsHostProxy("macos")).toBe(true); | ||
| }); | ||
|
|
||
| test("macos returns true for host_bash", () => { | ||
| expect(supportsHostProxy("macos", "host_bash")).toBe(true); | ||
| }); | ||
|
|
||
| test("macos returns true for host_file", () => { | ||
| expect(supportsHostProxy("macos", "host_file")).toBe(true); | ||
| }); | ||
|
|
||
| test("macos returns true for host_cu", () => { | ||
| expect(supportsHostProxy("macos", "host_cu")).toBe(true); | ||
| }); | ||
|
|
||
| test("macos returns true for host_browser", () => { | ||
| expect(supportsHostProxy("macos", "host_browser")).toBe(true); | ||
| }); | ||
|
|
||
| // ── chrome-extension: only host_browser. ── | ||
| test("chrome-extension returns false (no capability)", () => { | ||
| // Chrome extension does not support "any host proxy at all" — it only | ||
| // supports host_browser, so the no-arg form must return false to keep | ||
| // existing call sites that guard desktop-only behavior unchanged. | ||
| expect(supportsHostProxy("chrome-extension")).toBe(false); | ||
| }); | ||
|
|
||
| test("chrome-extension returns true for host_browser", () => { | ||
| expect(supportsHostProxy("chrome-extension", "host_browser")).toBe(true); | ||
| }); | ||
|
|
||
| test("chrome-extension returns false for host_bash", () => { | ||
| expect(supportsHostProxy("chrome-extension", "host_bash")).toBe(false); | ||
| }); | ||
|
|
||
| test("chrome-extension returns false for host_file", () => { | ||
| expect(supportsHostProxy("chrome-extension", "host_file")).toBe(false); | ||
| }); | ||
|
|
||
| test("chrome-extension returns false for host_cu", () => { | ||
| expect(supportsHostProxy("chrome-extension", "host_cu")).toBe(false); | ||
| }); | ||
|
|
||
| // ── Non-supporting interfaces: false in all forms. ── | ||
| test("cli returns false (no capability)", () => { | ||
| expect(supportsHostProxy("cli")).toBe(false); | ||
| }); | ||
|
|
||
| test("cli returns false for host_bash", () => { | ||
| expect(supportsHostProxy("cli", "host_bash")).toBe(false); | ||
| }); | ||
|
|
||
| test("cli returns false for host_browser", () => { | ||
| expect(supportsHostProxy("cli", "host_browser")).toBe(false); | ||
| }); | ||
|
|
||
| test("telegram returns false (no capability)", () => { | ||
| expect(supportsHostProxy("telegram")).toBe(false); | ||
| }); | ||
|
|
||
| test("telegram returns false for host_browser", () => { | ||
| expect(supportsHostProxy("telegram", "host_browser")).toBe(false); | ||
| }); | ||
|
|
||
| test("vellum returns false (no capability)", () => { | ||
| expect(supportsHostProxy("vellum")).toBe(false); | ||
| }); | ||
|
|
||
| test("email returns false for host_browser", () => { | ||
| expect(supportsHostProxy("email", "host_browser")).toBe(false); | ||
| }); | ||
| }); |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.