@sjawhar/opencode-legion-envoy 1.31.2 → 1.32.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/dist/src/server.js +11 -1
- package/package.json +1 -1
- package/skills/legion-controller/SKILL.md +20 -0
package/dist/src/server.js
CHANGED
|
@@ -14231,6 +14231,12 @@ var stateTreeLocator = discriminatedUnion("runtime", [
|
|
|
14231
14231
|
stateTmuxLocator.extend({ ompSessionFile: nonEmptyString.optional() }),
|
|
14232
14232
|
stateK8sLocator.extend({ ompSessionFile: nonEmptyString.optional() })
|
|
14233
14233
|
]);
|
|
14234
|
+
var stateExternalControllerLocator = strictObject({
|
|
14235
|
+
runtime: literal("kubernetes"),
|
|
14236
|
+
external: literal(true),
|
|
14237
|
+
sessionId: nonEmptyString,
|
|
14238
|
+
registeredAt: number2().int().nonnegative()
|
|
14239
|
+
});
|
|
14234
14240
|
var stateIssue = strictObject({
|
|
14235
14241
|
key: nonEmptyString,
|
|
14236
14242
|
title: string2(),
|
|
@@ -14286,7 +14292,7 @@ var LegionDaemonApi = {
|
|
|
14286
14292
|
queue: array(nonEmptyString)
|
|
14287
14293
|
}),
|
|
14288
14294
|
gates: record(string2(), stateGate),
|
|
14289
|
-
controllerLocator: stateTreeLocator.optional(),
|
|
14295
|
+
controllerLocator: union([stateTreeLocator, stateExternalControllerLocator]).optional(),
|
|
14290
14296
|
roles: record(string2(), stateRole),
|
|
14291
14297
|
controllerPendingNotices: number2().int().nonnegative(),
|
|
14292
14298
|
pendingStatusWrites: array(nonEmptyString),
|
|
@@ -14301,6 +14307,10 @@ var LegionDaemonApi = {
|
|
|
14301
14307
|
}),
|
|
14302
14308
|
response: object({})
|
|
14303
14309
|
},
|
|
14310
|
+
ControllerSecret: {
|
|
14311
|
+
request: strictObject({}),
|
|
14312
|
+
response: object({ secret: nonEmptyString })
|
|
14313
|
+
},
|
|
14304
14314
|
ProcessStarted: {
|
|
14305
14315
|
request: strictObject({
|
|
14306
14316
|
tree: nonEmptyString,
|
package/package.json
CHANGED
|
@@ -64,6 +64,26 @@ command run `/legion-claim-controller` again.
|
|
|
64
64
|
This handshake lets the daemon redeliver held controller work. It does not turn the controller
|
|
65
65
|
into a state holder: daemon state and the Dispatch project remain authoritative.
|
|
66
66
|
|
|
67
|
+
### Started by the operator (runtime: kubernetes)
|
|
68
|
+
|
|
69
|
+
When the daemon runs inside a Kubernetes cluster it cannot open a terminal anywhere, so nobody
|
|
70
|
+
launched your pane: the operator ran `legion controller start --config controller.yaml
|
|
71
|
+
[--daemon-url <port-forward>]` on their own machine, and you are that foreground OMP session.
|
|
72
|
+
The command fetched a fresh controller secret from the daemon with the operator's token, wrote it
|
|
73
|
+
to a 0600 file under `LEGION_STATE_DIR` (`~/.local/state/legion/<project>-controller` by default)
|
|
74
|
+
beside the `gh` shim and the `legion` launcher, and started you with `LEGION_CONTROLLER=1` and
|
|
75
|
+
the same environment a tmux controller pane carries — so the extension claims the role and calls
|
|
76
|
+
`/controller/ready` exactly as under tmux, and nothing changes in how you handle wakes. The
|
|
77
|
+
daemon records you as `controllerLocator: {runtime: "kubernetes", external: true, sessionId,
|
|
78
|
+
registeredAt}` and reads your liveness from the Envoy role registry (the holder of
|
|
79
|
+
`legion-<project>-controller` and its `last_seen`), not from a pane: keep the session running.
|
|
80
|
+
Exiting it leaves the project without a controller until the operator runs the command again —
|
|
81
|
+
the daemon logs `controller not registered; run legion controller start` once per boot-timeout
|
|
82
|
+
interval and launches nothing itself. `legion state`, `legion gh -- <args>`, and
|
|
83
|
+
`legion status <KEY> <status>` work here over `LEGION_DAEMON_URL` (the port-forward). A second
|
|
84
|
+
`legion controller start` replaces you: it mints a new secret, so your grants stop working and
|
|
85
|
+
the role moves to the new session.
|
|
86
|
+
|
|
67
87
|
## Deployment instructions
|
|
68
88
|
|
|
69
89
|
Deployment instructions, when present, are the operator's standing rules for this repository —
|