cyberlegion 0.3.2 → 0.5.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/.claude-plugin/plugin.json +20 -0
- package/.codex-plugin/plugin.json +20 -0
- package/.plugin/pins.json +3 -0
- package/agents/headless-legate.md +59 -0
- package/bin/cyberlegion.mjs +18 -1
- package/dist/cli.mjs +7823 -72
- package/dist/index.d.mts +262 -11
- package/dist/index.mjs +2298 -4
- package/package.json +10 -3
- package/plugin.json +24 -0
- package/readme.md +63 -0
- package/skills/dispatch-governance/README.md +29 -0
- package/skills/dispatch-governance/SKILL.md +143 -0
- package/skills/dispatch-governance/scripts/cyberlegion.mjs +31 -0
- package/skills/init-cyberlegion/README.md +14 -0
- package/skills/init-cyberlegion/SKILL.md +112 -0
- package/skills/init-cyberlegion/scripts/cyberlegion.mjs +31 -0
- package/skills/legate/README.md +22 -0
- package/skills/legate/SKILL.md +62 -0
- package/skills/legate/scripts/cyberlegion.mjs +31 -0
- package/skills/manage-inbox/README.md +12 -0
- package/skills/manage-inbox/SKILL.md +90 -0
- package/skills/manage-inbox/scripts/cyberlegion.mjs +31 -0
- package/skills/relay-governance/README.md +36 -0
- package/skills/relay-governance/SKILL.md +204 -0
- package/skills/relay-governance/scripts/cyberlegion.mjs +31 -0
- package/skills/session-adapter-governance/README.md +17 -0
- package/skills/session-adapter-governance/SKILL.md +74 -0
- package/skills/subagent-backend-governance/README.md +35 -0
- package/skills/subagent-backend-governance/SKILL.md +99 -0
- package/skills/subagent-backend-governance/scripts/cyberlegion.mjs +31 -0
- package/dist/cli.d.mts +0 -12
- package/dist/watch-D33fQcUI.mjs +0 -2044
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cyberlegion",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Agent session spawning, messaging, and dispatch — the Legion and its Legate.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "unional"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/cyberuni/cyberlegion",
|
|
9
|
+
"repository": "https://github.com/cyberuni/cyberlegion",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"agent",
|
|
12
|
+
"dispatch",
|
|
13
|
+
"inter-agent",
|
|
14
|
+
"multiplexer"
|
|
15
|
+
],
|
|
16
|
+
"skills": "./skills",
|
|
17
|
+
"agents": [
|
|
18
|
+
"./agents/headless-legate.md"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cyberlegion",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Agent session spawning, messaging, and dispatch — the Legion and its Legate.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "unional"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/cyberuni/cyberlegion",
|
|
9
|
+
"repository": "https://github.com/cyberuni/cyberlegion",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"agent",
|
|
12
|
+
"dispatch",
|
|
13
|
+
"inter-agent",
|
|
14
|
+
"multiplexer"
|
|
15
|
+
],
|
|
16
|
+
"skills": "./skills",
|
|
17
|
+
"agents": [
|
|
18
|
+
"./agents/headless-legate.md"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: headless-legate
|
|
3
|
+
description: "Internal cyberlegion gateway realized headless — the Legate musters and commands the Legion's units when there is no user channel: it runs the same classify-then-dispatch flow the `legate` gateway runs in-session, fans out one unit per brief, awaits or collects each result, and batches needs-input up its relay instead of asking live. Spawned by name from the gateway; never user-triggered; no user channel."
|
|
4
|
+
model: sonnet
|
|
5
|
+
effort: medium
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# headless-legate
|
|
9
|
+
|
|
10
|
+
The **headless realization of the `legate` gateway** — summoned when there is no user or peer
|
|
11
|
+
channel to relay a dispatch request through (an unattended trigger, a multi-unit fan-out). It is
|
|
12
|
+
**not** a separate role: it runs the exact same classify → route flow the gateway skill runs
|
|
13
|
+
in-session, with `dispatch-governance` loaded the same way. It holds no logic the gateway +
|
|
14
|
+
`dispatch-governance` do not already carry — it is that flow, headless.
|
|
15
|
+
|
|
16
|
+
**Model choice.** `sonnet` at `effort: medium` — the Legate's own work is classification and CLI
|
|
17
|
+
orchestration (resolve an agent def, probe the environment, pick a strategy, shell out), not deep
|
|
18
|
+
reasoning. The heavy reasoning happens **inside** whichever unit it dispatches to (a channel peer or
|
|
19
|
+
a subagent running its own brief), never in the Legate itself. Routing judgment does not need a
|
|
20
|
+
frontier-tier model; escalate the model only on the dispatched unit's own agent-def, never on the
|
|
21
|
+
Legate.
|
|
22
|
+
|
|
23
|
+
Load `dispatch-governance` the same way the gateway does, and run its procedure exactly — resolve
|
|
24
|
+
the agent def, probe for a multiplexer, pick channel / run-inline / subagent, execute with the
|
|
25
|
+
`cyberlegion` CLI primitives (`subagent-backend-governance` for the subagent path). Also load
|
|
26
|
+
`relay-governance` — the contract for how you report and how an unanswerable question gets home.
|
|
27
|
+
|
|
28
|
+
## Report and ask via relay-governance
|
|
29
|
+
|
|
30
|
+
How this Legate reports its result and surfaces anything it cannot answer is **not** restated here —
|
|
31
|
+
it is `relay-governance`, keyed on the Legate's own lifecycle. In brief: the Legate never asks live;
|
|
32
|
+
it **batches** into its return packet every point the in-session gateway would surface to a user (an
|
|
33
|
+
ambiguous role resolution, a dispatched unit's `needsInput`, a `run-inline` verdict it has no seat to
|
|
34
|
+
serve — returned as `needsInput` naming the role + brief), and whatever spawned it owns the relay and
|
|
35
|
+
re-invokes once answers land. If the Legate itself was started **frameless** (a bare scheduler run
|
|
36
|
+
with no spawner awaiting its return), `relay-governance`'s frameless branch applies: push the report
|
|
37
|
+
to the standing owner and exit. Read `relay-governance` for the full fork; do not re-derive it here.
|
|
38
|
+
|
|
39
|
+
## Fan out — the muster loop
|
|
40
|
+
|
|
41
|
+
The one thing genuinely the Legate's own, above single-dispatch routing: given a **batch** of briefs,
|
|
42
|
+
resolve each one's strategy independently (a batch may mix channel and subagent units) and run them —
|
|
43
|
+
subagent dispatches may run concurrently (each is its own resolve/Task-invoke/Task-result round-trip); channel
|
|
44
|
+
dispatches each occupy a pane, so cap concurrency to what the environment's multiplexer can host.
|
|
45
|
+
Collect every unit's `DispatchResult` before returning.
|
|
46
|
+
|
|
47
|
+
## Stateless per muster
|
|
48
|
+
|
|
49
|
+
The Legate is spawned cold for each muster (one fan-out batch or one unattended trigger) and carries
|
|
50
|
+
no memory across musters. Derive everything it needs from what it is handed — the brief(s), any
|
|
51
|
+
verdict schema, and the environment it probes fresh via `mux doctor`. Never assume a prior
|
|
52
|
+
muster's resolved strategy or environment probe still holds.
|
|
53
|
+
|
|
54
|
+
## Spawn depth
|
|
55
|
+
|
|
56
|
+
The Legate spawns dispatched units (via `subagent-backend-governance`'s Task-tool invocation, or a
|
|
57
|
+
channel peer's own session); it does not spawn another Legate. Do not design for a Legate spawning a
|
|
58
|
+
Legate — a nested fan-out re-enters the same gateway + `dispatch-governance` flow in the newly
|
|
59
|
+
spawned unit's own context, if that unit itself needs to dispatch further.
|
package/bin/cyberlegion.mjs
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
2
3
|
import { dirname, join } from 'node:path'
|
|
3
4
|
import { fileURLToPath } from 'node:url'
|
|
4
5
|
|
|
5
6
|
const dir = dirname(fileURLToPath(import.meta.url))
|
|
6
|
-
const
|
|
7
|
+
const cli = join(dir, '..', 'dist', 'cli.mjs')
|
|
8
|
+
|
|
9
|
+
// A plugin installed from a source checkout carries whatever the checkout carries, and no install
|
|
10
|
+
// step runs after the copy. Without the built CLI, a bare import dies with ERR_MODULE_NOT_FOUND and
|
|
11
|
+
// no way forward; say what is missing and name the exact published version that runs instead.
|
|
12
|
+
if (!existsSync(cli)) {
|
|
13
|
+
const { version } = JSON.parse(readFileSync(join(dir, '..', 'package.json'), 'utf8'))
|
|
14
|
+
process.stderr.write(
|
|
15
|
+
`cyberlegion: the built CLI is missing: ${cli}\n` +
|
|
16
|
+
'This install has no dist/ — it is a source checkout that was never built.\n' +
|
|
17
|
+
`Run the published CLI of the same version instead: npx -y cyberlegion@${version}\n` +
|
|
18
|
+
`Or build it in place: pnpm install && pnpm build (in ${join(dir, '..')})\n`,
|
|
19
|
+
)
|
|
20
|
+
process.exit(1)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const { runCli } = await import(cli)
|
|
7
24
|
await runCli()
|