@sjawhar/pi-legion-envoy 0.5.0 → 0.7.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 CHANGED
@@ -64,29 +64,25 @@ OMP at extension files it does not contain.
64
64
 
65
65
  ## Dispatch
66
66
 
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
67
+ Every OMP session — Legion sessions included — gets a native `dispatch` tool from this
68
+ extension when `dispatch.enabled` is true in the shared envoy.json
70
69
  (`~/.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 is how any agent — an interactive session or
73
- a headless Legion role — raises a durable question to the human: the thread lands as a
74
- GitHub issue in the session cwd's repo (or an explicit `repo`), carries the session's
75
- provenance, and shows up on the Dispatch dashboard. The `dispatch` skill (shipped in
76
- `skills/`) says when to use it. Replies route back to the asking session, which is
77
- auto-subscribed to the thread's GitHub topic; a Legion role's session survives kill/resume
78
- because Legion resurrection resumes the same OMP session file, so the reply still lands.
79
- Lifecycle and scope decisions still go through `hub` to the owning architect Dispatch is
80
- for durable questions to the human, not for coordination between roles.
81
-
82
- No manual mount is needed: the package-root `.mcp.json` ships the server with the
83
- package, so any session that loads it (installed plugin, `--extension`, the Legion
84
- daemon's repo checkout) discovers `dispatch` automatically. The committed manifest
85
- runs `./bin/dispatch-mcp-shim.ts` from source; the release workflow points the
86
- published tarball at the self-contained `./dist/bin/dispatch-mcp-shim.js`. A
87
- same-named `dispatch` entry in `~/.omp/agent/mcp.json` would override the package
88
- mount remove machine-local entries rather than maintaining both.
89
-
90
- The shim forwards newline-delimited JSON-RPC from stdin to the dispatch server's Streamable
91
- HTTP `/mcp` endpoint with a cached GitHub bearer from the user's `gh` shim. The
92
- bearer refreshes before expiry and retries once immediately after a 401 response.
70
+ `DISPATCH_MCP_URL` names a service endpoint explicitly. The service URL comes from
71
+ `dispatch.serverUrl` (default `http://localhost:8766`). Dispatch is how any agent — an
72
+ interactive session or a headless Legion role — raises a durable question to the human
73
+ and keeps the conversation on one GitHub issue: `subject` opens a thread, `thread: N`
74
+ continues one. Each call reads the session's id and title from OMP, resolves the cwd's
75
+ GitHub repo, mints a GitHub token with `gh auth token` in the session cwd, and makes one
76
+ stateless request to the dispatch service, which writes the issue or comment. The
77
+ `dispatch` skill (shipped in `skills/`) says when and how to ask. Replies route back to the
78
+ asking session, which is auto-subscribed to the thread's GitHub topic on every successful
79
+ call; a Legion role's session survives kill/resume because Legion resurrection resumes the
80
+ same OMP session file. Lifecycle and scope decisions still go through `hub` to the owning
81
+ architect Dispatch is for durable questions to the human, not for coordination between roles.
82
+
83
+ The tool's model-facing schema is the shared contract's zod shape
84
+ (`@legion/envoy-client/dispatch-contract`) serialised to JSON Schema, so OMP shows the model
85
+ the same arguments and descriptions as every other host.
86
+
87
+ An invalid envoy.json disables the tool and the session is told why on start; a machine
88
+ without dispatch configured has no `dispatch` tool at all.