@sjawhar/pi-legion-envoy 0.2.0 → 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/.mcp.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "mcpServers": {
3
+ "dispatch": {
4
+ "command": "./dist/bin/dispatch-mcp-shim.js"
5
+ }
6
+ }
7
+ }
package/README.md CHANGED
@@ -64,31 +64,26 @@ OMP at extension files it does not contain.
64
64
 
65
65
  ## Dispatch
66
66
 
67
- Legion sessions use the `envoy_dispatch` tool from `extensions/legion.ts`: it routes through
68
- the Legion daemon's architect-only, tree-scoped `/legion/v1/dispatch-threads` endpoint, which
69
- also registers the thread so replies route back to the tree. The raw dispatch MCP tool is
70
- deliberately not served to Legion sessions — the shared shim exits without serving when it
71
- sees a Legion environment (`LEGION_TREE`/`LEGION_CONTROLLER`), so phase workers cannot bypass
72
- the architect gate with ambient GitHub authority.
73
-
74
- Interactive OMP sessions get the `dispatch` MCP tool the way OpenCode sessions do: the shared
75
- `@legion/envoy-client` shim mounts as a stdio MCP server, and it serves only when
76
- `dispatch.enabled` is true in the shared envoy.json (`~/.config/opencode/envoy.json`,
77
- shallow-merged with `<cwd>/.opencode/envoy.json`) or `DISPATCH_MCP_URL` is set explicitly.
78
- The server URL comes from `dispatch.serverUrl` (default `http://localhost:8766`).
79
-
80
- Mount it in `~/.omp/agent/mcp.json` (user-wide) or `.omp/mcp.json` (per project):
81
-
82
- ```json
83
- {
84
- "mcpServers": {
85
- "dispatch": {
86
- "command": "bun",
87
- "args": ["<checkout>/packages/envoy-client/bin/dispatch-mcp-shim.ts"]
88
- }
89
- }
90
- }
91
- ```
67
+ Every OMP session — Legion sessions included — gets the `dispatch` MCP tool the way
68
+ OpenCode sessions do: the shared `@legion/envoy-client` shim mounts as a stdio MCP server,
69
+ and it serves when `dispatch.enabled` is true in the shared envoy.json
70
+ (`~/.config/opencode/envoy.json`, shallow-merged with `<cwd>/.opencode/envoy.json`) or
71
+ `DISPATCH_MCP_URL` is set explicitly. The server URL comes from `dispatch.serverUrl`
72
+ (default `http://localhost:8766`). Dispatch exists so headless unattended agents —
73
+ Legion architects, planners, phase workers — can raise durable questions to the human.
74
+ Replies route back to the asking session, which is auto-subscribed to the thread's
75
+ GitHub topic; a Legion role's session survives kill/resume because Legion resurrection
76
+ resumes the same OMP session file, so the reply still lands. Lifecycle and scope
77
+ decisions still go through `hub` to the owning architect — Dispatch is for durable
78
+ questions to the human, not for coordination between roles.
79
+
80
+ No manual mount is needed: the package-root `.mcp.json` ships the server with the
81
+ package, so any session that loads it (installed plugin, `--extension`, the Legion
82
+ daemon's repo checkout) discovers `dispatch` automatically. The committed manifest
83
+ runs `./bin/dispatch-mcp-shim.ts` from source; the release workflow points the
84
+ published tarball at the self-contained `./dist/bin/dispatch-mcp-shim.js`. A
85
+ same-named `dispatch` entry in `~/.omp/agent/mcp.json` would override the package
86
+ mount — remove machine-local entries rather than maintaining both.
92
87
 
93
88
  The shim forwards newline-delimited JSON-RPC from stdin to the dispatch server's Streamable
94
89
  HTTP `/mcp` endpoint with a cached GitHub bearer from the user's `gh` shim. The