@m2canvas/connect 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/adapters/claude-agent-acp/package-lock.json +1535 -0
- package/adapters/claude-agent-acp/package.json +8 -0
- package/adapters/codex-acp/package-lock.json +364 -0
- package/adapters/codex-acp/package.json +9 -0
- package/dist/bridge/acp-guard.js +92 -0
- package/dist/bridge/adapters.js +146 -0
- package/dist/bridge/agents.js +73 -0
- package/dist/bridge/env.js +107 -0
- package/dist/bridge/exec.js +90 -0
- package/dist/bridge/lifecycle.js +24 -0
- package/dist/bridge/m2-config.js +38 -0
- package/dist/bridge/main.js +245 -0
- package/dist/bridge/pairing.js +242 -0
- package/dist/bridge/precheck-parse.js +246 -0
- package/dist/bridge/precheck.js +149 -0
- package/dist/bridge/processes.js +212 -0
- package/dist/bridge/protocol.js +62 -0
- package/dist/bridge/security.js +52 -0
- package/dist/bridge/server.js +365 -0
- package/dist/bridge/service.js +109 -0
- package/dist/cli.js +8 -2
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -25,3 +25,22 @@ Clients that already have an entry pointing at `mcp.m2ui.ai`, under any name, ar
|
|
|
25
25
|
Options: `--client <id>` sets up only that client; `--dry-run` shows the plan without changing anything; `--yes` skips the confirmation.
|
|
26
26
|
|
|
27
27
|
After setup, restart each client so it loads the new server.
|
|
28
|
+
|
|
29
|
+
## Local agent bridge
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx -y @m2canvas/connect@latest bridge
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Lets M2 (in Chrome or another Chromium browser) start and talk to the agents on this machine over [ACP](https://agentclientprotocol.com): Claude Code, Codex, Cursor CLI, OpenCode and Qoder. Run it in the project directory you want the agents to work in, and keep the window open.
|
|
36
|
+
|
|
37
|
+
- **Local only.** It listens on `127.0.0.1:47821` and only accepts pages from `https://m2ui.ai`. Other sites, other machines and other hosts are refused before a connection is made. (`--dev` also accepts a local M2 dev server on port 5173; any app you serve on that port could then ask to pair, so only use it while developing M2.)
|
|
38
|
+
- **Pairing gives the page your agents.** A paired page can make these agents read and change files and run commands as you, the same as typing into them yourself. Only enter the code into M2.
|
|
39
|
+
- **Pairing.** The first time, M2 asks for the pairing code printed in this window; the window also shows which site is asking. After that the page remembers the pairing for 30 days of inactivity. After too many wrong codes, new pages can't pair until you restart the bridge (pages already paired keep working); close the page the window names first. `bridge --unpair` forgets all paired pages.
|
|
40
|
+
- **Your own logins.** Agents use their own sign-in and their own M2 MCP setup; the bridge never signs in for you. It starts agents with a minimal environment, so variables set by a host app (for example `ANTHROPIC_BASE_URL` inside Claude Code) don't leak into them.
|
|
41
|
+
- **Claude and Codex** run through pinned versions of the official adapters (`@agentclientprotocol/claude-agent-acp@0.84.0`, `@agentclientprotocol/codex-acp@2.1.0`). They are installed on first use into `~/.m2canvas/acp-adapters/` from the lockfiles in this package (a few hundred MB each, because they bundle the agent). Codex then needs its own M2 sign-in once, with the bundled `codex`; M2 shows the exact command.
|
|
42
|
+
- Cursor runs as `agent acp`, OpenCode as `opencode acp`, Qoder as `qodercli --acp`.
|
|
43
|
+
|
|
44
|
+
Agent sessions start in that directory.
|
|
45
|
+
|
|
46
|
+
Options: `--port <n>`, `--cwd <dir>` (default: current directory), `--verbose` (also print agent stderr), `--dev` (also accept the local M2 dev server).
|