leos-agent 6.1.0 → 6.1.1

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 ADDED
@@ -0,0 +1,43 @@
1
+ <!-- Generated by scripts/render_adapters.py; do not edit. -->
2
+
3
+ # Leo's Agent
4
+
5
+ Leo's Agent is a portable agent operating policy: cost-tiered model routing, specialist subagent roles, process skills, execute-then-review discipline, and a narrow catastrophic-command guard.
6
+
7
+ This npm package is the **OpenCode** distribution. Claude Code, Codex, Cursor, and Hermes each install it through their own plugin system — see [the repository](https://github.com/foxhatleo/leos-agent) for those.
8
+
9
+ ## Install
10
+
11
+ Add it to `~/.config/opencode/opencode.json`:
12
+
13
+ ```json
14
+ { "$schema": "https://opencode.ai/config.json", "plugin": ["leos-agent"] }
15
+ ```
16
+
17
+ Start a new OpenCode session. The plugin registers the skills directory, the 6 subagent roles, and the operating policy, and installs the bash deletion tripwire.
18
+
19
+ If the skills do not appear, register the path by hand — npm installs into OpenCode's own cache and the location varies by version:
20
+
21
+ ```json
22
+ { "skills": { "paths": ["~/.cache/opencode/node_modules/leos-agent/skills"] } }
23
+ ```
24
+
25
+ ## Model tiers
26
+
27
+ Tier names describe the kind of work, not a fixed provider model.
28
+
29
+ | Tier | Model | Effort |
30
+ |---|---|---|
31
+ | Fable | `moonshotai/kimi-k3` | native default |
32
+ | Opus | `moonshotai/kimi-k3` | native default |
33
+ | Sonnet | `z-ai/glm-5.2` | native default |
34
+ | Haiku | `z-ai/glm-5.2` | native default |
35
+
36
+ Fable and Opus collapse onto one model here, so `expert` is not registered as an agent and escalation caps at Opus. Retier by editing `config/models.json` and re-running `scripts/render_adapters.py`.
37
+
38
+ ## Links
39
+
40
+ - [Repository and full documentation](https://github.com/foxhatleo/leos-agent)
41
+ - [Operating policy](https://github.com/foxhatleo/leos-agent/blob/main/plugins/leo/skills/using-leo/SKILL.md)
42
+
43
+ MIT licensed.
@@ -1,4 +1,6 @@
1
- // Leo's OpenCode bridge: registers the leo:* skills dir, injects the
1
+ // Leo's OpenCode bridge: registers the skills dir by path (OpenCode names
2
+ // each skill from its own frontmatter, so there is no leo: prefix here as
3
+ // there is on Claude Code and Hermes), injects the
2
4
  // generated subagent roster from adapters/opencode/agents.json, assembles
3
5
  // the using-leo policy plus the OpenCode mapping appendix and hands it to
4
6
  // OpenCode through config.instructions (belt) and the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leos-agent",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "Leo's agent operating policy: cost-tiered routing, subagent roles, review gates, guardrails.",
5
5
  "type": "module",
6
6
  "main": "adapters/opencode/plugin.js",
@@ -252,7 +252,11 @@ def _mapping_docs(config):
252
252
  "coarse `rm -rf` bash denies as a stopgap for opencode#5894 (unconfirmed whether "
253
253
  "`tool.execute.before` also intercepts subagent bash); the precise tripwire stays "
254
254
  "`hooks/bash-guard.py` on the primary agent.\n"
255
- "\nNo `EnterWorktree` tool exists here — use leo:worktrees' raw `git worktree` fallback for "
255
+ "\nSkills are invoked by bare name here — `brainstorming`, `verification` not with the "
256
+ "`leo:` prefix the policy above uses. The plugin registers the skills directory by path, so "
257
+ "OpenCode names each skill from its own `name:` frontmatter and applies no plugin "
258
+ "namespace. Read `leo:<skill>` anywhere in the policy as `<skill>` on this harness.\n"
259
+ "\nNo `EnterWorktree` tool exists here — use the worktrees skill's raw `git worktree` fallback for "
256
260
  "isolated branch work. State reads and writes go through `python3 <plugin-root>/scripts/state.py` "
257
261
  "(`get` / `merge` / `path`), same contract as every other harness. There is no Workflow tool "
258
262
  "and no `cost-tiered-fix.js` here — a batch of independent tasks is fanned out as manual "
@@ -262,6 +266,50 @@ def _mapping_docs(config):
262
266
  }
263
267
 
264
268
 
269
+ def _payload_readme(config):
270
+ """The npm landing page for `leos-agent`.
271
+
272
+ The root README cannot be symlinked in: every harness copies or caches
273
+ this payload on its own, so a link pointing outside it dangles, and the
274
+ packaging tests forbid symlinks here for exactly that reason. Generating
275
+ it instead keeps one source and lets --check catch drift.
276
+
277
+ Scoped to OpenCode deliberately — npm is only how OpenCode installs this.
278
+ Every other harness has a native marketplace, and its instructions would
279
+ be noise on this page.
280
+ """
281
+ opencode = config["harnesses"]["opencode"]
282
+ return (
283
+ GENERATED
284
+ + "\n# Leo's Agent\n\n"
285
+ "Leo's Agent is a portable agent operating policy: cost-tiered model routing, specialist "
286
+ "subagent roles, process skills, execute-then-review discipline, and a narrow "
287
+ "catastrophic-command guard.\n\n"
288
+ "This npm package is the **OpenCode** distribution. Claude Code, Codex, Cursor, and Hermes "
289
+ "each install it through their own plugin system — see "
290
+ "[the repository](https://github.com/foxhatleo/leos-agent) for those.\n\n"
291
+ "## Install\n\n"
292
+ "Add it to `~/.config/opencode/opencode.json`:\n\n"
293
+ '```json\n{ "$schema": "https://opencode.ai/config.json", "plugin": ["leos-agent"] }\n```\n\n'
294
+ "Start a new OpenCode session. The plugin registers the skills directory, the "
295
+ f"{len(json.loads(_opencode_agents(config)))} subagent roles, and the operating policy, and installs the "
296
+ "bash deletion tripwire.\n\n"
297
+ "If the skills do not appear, register the path by hand — npm installs into OpenCode's own "
298
+ "cache and the location varies by version:\n\n"
299
+ '```json\n{ "skills": { "paths": ["~/.cache/opencode/node_modules/leos-agent/skills"] } }\n```\n\n'
300
+ "## Model tiers\n\n"
301
+ "Tier names describe the kind of work, not a fixed provider model.\n\n"
302
+ + _table({tier: opencode[tier] for tier in ("fable", "opus", "sonnet", "haiku")})
303
+ + "\n\nFable and Opus collapse onto one model here, so `expert` is not registered as an "
304
+ "agent and escalation caps at Opus. Retier by editing `config/models.json` and re-running "
305
+ "`scripts/render_adapters.py`.\n\n"
306
+ "## Links\n\n"
307
+ "- [Repository and full documentation](https://github.com/foxhatleo/leos-agent)\n"
308
+ "- [Operating policy](https://github.com/foxhatleo/leos-agent/blob/main/plugins/leo/skills/using-leo/SKILL.md)\n\n"
309
+ "MIT licensed.\n"
310
+ )
311
+
312
+
265
313
  def render(config):
266
314
  outputs = {}
267
315
  for role, tier in sorted(config["roles"].items()):
@@ -274,6 +322,7 @@ def render(config):
274
322
  for harness, content in _mapping_docs(config).items():
275
323
  outputs[ROOT / "skills" / "using-leo" / "references" / f"{harness}-mapping.md"] = content
276
324
  outputs[ROOT / "adapters" / "opencode" / "agents.json"] = _opencode_agents(config)
325
+ outputs[ROOT / "README.md"] = _payload_readme(config)
277
326
 
278
327
  # The manifest is no longer rewritten here: per-install model overrides
279
328
  # were retired along with the placeholder they fed. Retiering means editing
@@ -305,6 +354,7 @@ def main():
305
354
  "agents/*.md",
306
355
  "adapters/cursor/agents/*.md",
307
356
  "adapters/opencode/agents.json",
357
+ "README.md",
308
358
  "skills/using-leo/references/*-mapping.md",
309
359
  ):
310
360
  for path in sorted(ROOT.glob(pattern)):
@@ -14,7 +14,9 @@ Roles register as native OpenCode agents (from `adapters/opencode/agents.json`,
14
14
 
15
15
  Read-only is harness-enforced here, unlike Codex and Cursor: read-only roles carry a generated `permission.edit: deny`, so an off-policy write attempt is refused by OpenCode itself, not merely discouraged by the prompt. Write-capable agents additionally carry coarse `rm -rf` bash denies as a stopgap for opencode#5894 (unconfirmed whether `tool.execute.before` also intercepts subagent bash); the precise tripwire stays `hooks/bash-guard.py` on the primary agent.
16
16
 
17
- No `EnterWorktree` tool exists here — use leo:worktrees' raw `git worktree` fallback for isolated branch work. State reads and writes go through `python3 <plugin-root>/scripts/state.py` (`get` / `merge` / `path`), same contract as every other harness. There is no Workflow tool and no `cost-tiered-fix.js` here a batch of independent tasks is fanned out as manual parallel task-tool subagent spawns instead.
17
+ Skills are invoked by bare name here — `brainstorming`, `verification` not with the `leo:` prefix the policy above uses. The plugin registers the skills directory by path, so OpenCode names each skill from its own `name:` frontmatter and applies no plugin namespace. Read `leo:<skill>` anywhere in the policy as `<skill>` on this harness.
18
+
19
+ No `EnterWorktree` tool exists here — use the worktrees skill's raw `git worktree` fallback for isolated branch work. State reads and writes go through `python3 <plugin-root>/scripts/state.py` (`get` / `merge` / `path`), same contract as every other harness. There is no Workflow tool and no `cost-tiered-fix.js` here — a batch of independent tasks is fanned out as manual parallel task-tool subagent spawns instead.
18
20
 
19
21
  Tier collapse here: Fable≡Opus (`moonshotai/kimi-k3`), Sonnet≡Haiku (`z-ai/glm-5.2`) — routing between collapsed rungs buys role, not power. Fable is not a real rung: `expert` cannot break a deadlock a collapsed Opus already lost, so cap escalation at Opus and report.
20
22