Skip to content

Embedding: run under an app's own identity, extension variants, release assets - #3

Merged
sheehanmunim merged 3 commits into
mainfrom
feat/embedding
Sep 19, 2026
Merged

sheehanmunim merged 3 commits into
mainfrom
feat/embedding

Conversation

@sheehanmunim

Copy link
Copy Markdown
Member

Stacked on #2 (0.4.0). Based on feat/0.4.0-hardening because #2 is not merged yet; once #2 lands, retarget this to main.

MT Code is moving from carrying its own copies of this server (Swift, Rust, extension) to shipping the munim-computer-use release binary. This PR adds what that needs, without changing anything for standalone users.

Identity (Swift + Rust, same keys)

Resolved at startup from --profile <json|file> (any argument position) or COMPUTER_USE_PROFILE; COMPUTER_USE_SUPPORT_DIR, _BRIDGE_SOCKET, _ENV_PREFIX, _AGENT_CURSOR_NAME, _AGENT_CURSOR_BUNDLE_ID, _HISTORY_DIR override single fields.

key effect
name support dir, bridge socket and Windows pipe move under this name
envPrefix tunables read as <prefix>BROWSER, <prefix>AGENT_CURSOR, … before COMPUTER_USE_*
agentCursorName / agentCursorBundleId overlay .app/executable/window class and bundle id, and the hit-test skip
historyDir default --root for computer-history
nativeHostNames / extensionIds / nativeHostDescription what install-native-host registers

New subcommands: install-native-host [--binary P] (wrapper that replays the profile + a host manifest per name in every Chrome/Chromium profile dir, registry on Windows; idempotent), and identity (prints the resolved values).

Defaults are unchanged: same support dirs, bridge socket, pipe name, overlay bundle id com.munimtech.computer-use.agent-cursor (TCC), native host names, serverInfo mt-desktop. Unknown profile keys are ignored with a warning so an older binary tolerates a newer embedder.

Extension

  • Ported from MT Code's copy: groups titled plainly and told apart by a colour hashed from the client id; agent tabs wear the pointer composited over the site's own dimmed favicon, and any tab that leaves the agent's hands (release, cleanup, ungrouped leftovers) gets its original icon back. Adoption now uses that restore path (0.4.0's persisted [id, favicon] pairs still load).
  • Host list and group title live in a marked block; scripts/build-extension.mjs builds a variant (hosts, title, name, key, version) and prints its extension id. The stock build keeps id kgdolgnijopbghhomnblabjkmjhnoage.

Release assets

release-assets.yml (dispatch against the draft release) adds Linux x64/arm64 tarballs and munim-computer-use-chrome-extension.zip, and rewrites SHA256SUMS.txt over all assets. MT Code pins those hashes.

Verified

  • macOS: swift build -c release; identity default vs MT profile; install-native-host into a throwaway CFFIXED_USER_HOME (wrapper, profile.json, manifest contents); an MT-profile server binds mtcode-desktop/bridge.sock and the generated wrapper connects to it while a default-identity relay does not; MTCODE_DESKTOP_BROWSER=0 via envPrefix hides the 12 browser tools (30 → 18); bad profile exits 2.
  • Windows (Blade): cargo test --locked 78 passed; release build; identity + install-native-host with a test profile (pipe cu-embed-test-bridge-<user>, .cmd wrapper, registry keys), then cleaned up.
  • node chrome-extension/background.test.mjs (13), node scripts/build-extension.test.mjs (3), node scripts/check-tool-parity.mjs (30 tools, identical).
  • Linux: covered by CI on this PR.

Not released, tagged or published.

Aside: com.munimtech.computer-use.desktop contains a -, which Chrome's host-name rule does not allow, so that legacy host has probably never been reachable. Left as-is.

Copilot AI lite review requested due to automatic review settings September 19, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…config

Ports the favicon and group identity MT Code's copy of the extension had:
every agent group is titled plainly (no client-id suffix) and told apart by
a colour hashed from the client id, so a reconnecting agent keeps its colour.
Agent tabs wear the pointer composited over a dimmed copy of the site's own
favicon, both layers inlined as data URLs, and the page's original icon is
recorded in the page so any tab that leaves the agent's hands (release,
cleanup, ungrouped leftovers) gets it back. Adoption now uses that restore
path, so `adopted` is a plain set; 0.4.0's persisted [id, favicon] pairs
still load.

The native-messaging host list and group title move into a marked block
that scripts/build-extension.mjs rewrites, so an app that runs the server
under its own identity can build a variant with its own host names, title,
name and key; the script prints the resulting extension id.
…ll-native-host

An app that ships the binary in its own bundle (MT Code does) needs it to
stay out of a standalone install's way on the same machine. Both servers now
resolve an identity at startup from `--profile <json|file>` (any position)
or COMPUTER_USE_PROFILE, with COMPUTER_USE_SUPPORT_DIR, _BRIDGE_SOCKET,
_ENV_PREFIX, _AGENT_CURSOR_NAME, _AGENT_CURSOR_BUNDLE_ID and _HISTORY_DIR
overriding single fields:

- name: moves the support dir, bridge socket and Windows pipe under it
- envPrefix: tunables are read as <prefix>BROWSER etc. before COMPUTER_USE_*
- agentCursorName / agentCursorBundleId: the overlay's .app, executable,
  window class and bundle id (and the hit-test skip that ignores it)
- historyDir: default --root for computer-history
- nativeHostNames / extensionIds / nativeHostDescription: what the new
  `install-native-host` subcommand registers

`install-native-host` writes a wrapper that replays the profile into the
relay Chrome starts, plus a host manifest per name in every Chrome/Chromium
profile dir (the registry on Windows), rewriting nothing already current so
an app can call it on every launch. `identity` prints the resolved values.

With no profile everything is exactly as before: same paths, pipe name,
overlay bundle id (TCC keys on it), host names and serverInfo `mt-desktop`.
release-assets.yml (workflow_dispatch against the draft release) builds
Linux x64/arm64 tarballs and the extension zip, uploads them and rewrites
SHA256SUMS.txt over every asset, so an embedding app can pin all of them.
CI runs the build-extension test; install.ps1 points at the right target dir.
@sheehanmunim
sheehanmunim merged commit 8d424a7 into main Sep 19, 2026
4 checks passed
@sheehanmunim
sheehanmunim deleted the feat/embedding branch September 19, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants