@sjawhar/pi-envoy 9.7.0 → 10.0.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 +51 -17
- package/dist/dispatch.js +643 -225
- package/dist/envoy.js +870 -317
- package/dist/skills/dispatch/references/api.md +16 -3
- package/dist/skills/dispatch/references/asks.md +3 -3
- package/dist/skills/dispatch/references/issues.md +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,34 +106,68 @@ The extension registers no Dispatch tool. Agents reach Dispatch through the `dis
|
|
|
106
106
|
their shell: `dispatch --help` lists its commands, `dispatch <command> --help` each one's flags and
|
|
107
107
|
an example, and the `dispatch` skill teaches when to use each. The package ships `bin/dispatch`, a
|
|
108
108
|
shim that runs the bundled `dist/dispatch.js` (built from `@legion/envoy-client`'s
|
|
109
|
-
`bin/dispatch.ts`) with `bun`. At load the extension puts that `bin/` first on `PATH
|
|
110
|
-
`DISPATCH_HOST=omp
|
|
111
|
-
session's id, so a command acts as the
|
|
109
|
+
`bin/dispatch.ts`) with `bun`. At load the extension puts that `bin/` first on `PATH`, sets
|
|
110
|
+
`DISPATCH_HOST=omp` and hands the session's envoy.json on as `ENVOY_CONFIG_FILE`; each session
|
|
111
|
+
start, switch and branch sets `DISPATCH_SESSION_ID` to the session's id, so a command acts as the
|
|
112
|
+
session whose shell ran it and reads the file that session reads.
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
A session reads one envoy.json, with a section for Dispatch and one for Envoy:
|
|
114
115
|
|
|
115
116
|
```json
|
|
116
117
|
{
|
|
117
118
|
"dispatch": {
|
|
118
119
|
"enabled": true,
|
|
119
120
|
"serverUrl": "https://dispatch.example",
|
|
120
|
-
"token": "
|
|
121
|
+
"token": "!secrets get DISPATCH_TOKEN"
|
|
122
|
+
},
|
|
123
|
+
"envoy": {
|
|
124
|
+
"enabled": true,
|
|
125
|
+
"url": "http://127.0.0.1:9020",
|
|
126
|
+
"natsUrls": ["nats://nats.internal.example:4222"],
|
|
127
|
+
"natsSeed": "!secrets get NATS_NKEY_SEED"
|
|
121
128
|
}
|
|
122
129
|
}
|
|
123
130
|
```
|
|
124
131
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
An Oh My Pi profile (`OMP_PROFILE` other than `default`) reads `$PI_CODING_AGENT_DIR/envoy.json`;
|
|
133
|
+
any other session reads the file `ENVOY_CONFIG_FILE` names, else
|
|
134
|
+
`${XDG_CONFIG_HOME:-~/.config}/legion/envoy.json`. The session's `dispatch` command reads the file
|
|
135
|
+
the session chose, which the extension hands it in `ENVOY_CONFIG_FILE`. The `dispatch` section of a
|
|
136
|
+
`<cwd>/.envoy/envoy.json` merges over it: its server is used only with the token written beside it,
|
|
137
|
+
and its token only beside its own server. An `envoy` section there is not read, which the start
|
|
138
|
+
notice says, and a checkout's file that is not valid refuses Dispatch alone, and only while
|
|
139
|
+
`DISPATCH_URL` is unset. Each section is resolved on its own: `enabled: false` turns it off, and a
|
|
140
|
+
missing file contributes nothing, so each section is then on only when its variables name it. A
|
|
141
|
+
`token` or `natsSeed` starting with `!` is a command whose trimmed output is the value (10 s, its
|
|
142
|
+
exit status deciding; never run from a checkout's file). `DISPATCH_URL`, `DISPATCH_TOKEN_FILE`,
|
|
143
|
+
`DISPATCH_TOKEN`, `ENVOY_URL`, `ENVOY_NATS_URL`, `ENVOY_TOKEN_FILE`, `ENVOY_TOKEN`,
|
|
144
|
+
`NATS_NKEY_SEED_FILE` and `NATS_NKEY_SEED` each override their own field; a file's token goes with
|
|
145
|
+
`DISPATCH_URL` or `ENVOY_URL` only when it names the file's own server, and a file's seed with
|
|
146
|
+
`ENVOY_NATS_URL` only when it names the file's NATS servers, so another server needs its own token
|
|
147
|
+
or seed variable. `DISPATCH_TOKEN_FILE` (a path whose trimmed contents are the token — how the
|
|
148
|
+
Legion daemon delivers it to a pane) never falls back when unreadable. Omitting
|
|
149
|
+
`dispatch.serverUrl` while `dispatch.enabled` is true targets `http://localhost:8766`, the Go
|
|
150
|
+
server's listen address. With Envoy off the session has no Envoy tools and takes no inbound
|
|
151
|
+
messages; with Envoy on and no NATS server, or with its NATS seed refused (a seed that pairs with
|
|
152
|
+
other servers, a failing `natsSeed` command, a seed variable that cannot be read), it keeps the
|
|
153
|
+
tools and `/whoami`, takes no inbound messages, connects to no NATS server, and refuses
|
|
154
|
+
`envoy_subscribe` and the Legion role claim with `inbound messages are off for this session: <why>`,
|
|
155
|
+
the claim before any listener call, so a Legion process fails its boot rather than hold a role
|
|
156
|
+
whose tasks reach nobody. When a
|
|
157
|
+
section is off for a reason worth saying, the session says so once at its start:
|
|
158
|
+
`envoy: no envoy.json at <path>: Dispatch and Envoy are off`, the section's error, what a
|
|
159
|
+
checkout's file holds that is not read, or that inbound messages are off and why. Invalid configuration, an
|
|
160
|
+
invalid URL, or an empty token makes every `dispatch` command exit 2 naming the source of the error.
|
|
161
|
+
|
|
162
|
+
`~/.config/opencode/envoy.json` and a checkout's `.opencode/envoy.json` are not read. While the old
|
|
163
|
+
user file is there and the session's file is missing, Dispatch and Envoy stay off unless a variable
|
|
164
|
+
names one, and the start notice says the old file is not read and what to do: for
|
|
165
|
+
`~/.config/legion/envoy.json`,
|
|
166
|
+
`mkdir -p ~/.config/legion && mv ~/.config/opencode/envoy.json ~/.config/legion/`; for a profile's
|
|
167
|
+
own file, copy or link the old file to it, or write it; under a relocated `XDG_CONFIG_HOME`, only
|
|
168
|
+
that it is not read there. While a checkout has no `.envoy/envoy.json`, the start notice and the
|
|
169
|
+
`dispatch` command name the rename of its `.opencode/envoy.json`. A top-level `natsUrls` is
|
|
170
|
+
refused, naming `envoy.natsUrls`.
|
|
137
171
|
|
|
138
172
|
A command that writes to an owner names either an issue (`--issue`, a native `KEY` or an external
|
|
139
173
|
`owner/repo#n` reference) or an unlinked project document (`--project` plus `--artifact`). A Legion
|