Composable OpenCode agent architectures and model fleets
  • TypeScript 87.6%
  • JavaScript 12.4%
Find a file
Luciano Nery 39097556c0
refactor!: rename architectures to fleets and extract shared lines
A fleet (fleets/<id>/fleet.json) now owns agent topology, prompts, and
context-memory bindings. Model chains move out of per-fleet route slots into
one shared catalog of lines (lines/<id>.json); an enabled agent references a
line as "line": "$name", so one chain is written once instead of per agent.

- validation: add validateLine and reshape validateFleet to resolve line
  references against the catalog and reject inline line definitions
- loader: load the global line catalog, resolve each fleet's lines per agent,
  and expose requireFleet/requireLine
- state: { fleet, fleetActivatedAt }; an explicit use replaces an unreadable
  prior state file instead of refusing to run
- runtime and plugin: each agent takes the primary of the line it binds, and an
  agent-less retry falls back to the fleet's optional defaultLine
- cli: fleet and $line selectors, a lines command, and resolved chains plus
  line usage in list and show
- diagnostics: independent line and fleet inspection before the strict loader,
  LINE_INVALID/LINES_*/FLEET_INVALID codes, and line-based catalog locations
- schemas and examples: fleet-v1 describes the roster, line-v1 the chain; the
  bundled example ships four shared lines and two fleets
- docs: concepts, configuration, CLI, diagnostics, security model, OpenCode
  integration, migration mapping, ADR 0004, and ADR 0001 marked superseded
2026-09-23 14:27:08 +02:00
docs refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
examples/software-team refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
schemas refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
scripts feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
src refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
.gitignore feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
.npmignore feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
AGENTS.md feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
CHANGELOG.md refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
CODE_OF_CONDUCT.md feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
CONTRIBUTING.md feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
LICENSE feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
package-lock.json feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
package.json refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
README.md refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
ROADMAP.md refactor!: rename architectures to fleets and extract shared lines 2026-09-23 14:27:08 +02:00
SECURITY.txt feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
tsconfig.json feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00
tsconfig.test.json feat: bootstrap agents-fleet 2026-09-17 12:10:02 +02:00

agents-fleet

Pre-release: version 0.1.0-dev.0; configuration and plugin APIs may change. Supported Node.js versions are ^22.22.2 || ^24.15.0 || >=26.0.0.

agents-fleet is a small TypeScript package for selecting validated agent fleets and shared model lines for OpenCode V2. A fleet owns the static agent roster, prompts, and context-memory bindings. A line is a named model chain — a primary plus optional fallbacks — defined once in a shared catalog and referenced from agents as $name, so the same chain is never repeated per agent. A setup-time activation snapshot keeps a running service consistent while the files change on disk.

lines/frontier.json          openai/gpt-5-codex -> anthropic/claude-sonnet-4 -> openrouter/openai/gpt-5-codex
lines/economy.json           google/gemini-2.0-flash -> openai/gpt-4.1-mini
fleets/software-team/fleet.json
  build     -> $frontier
  coder     -> $standard
  reviewer  -> $economy

Quickstart

npm install
npm run build
node dist/cli.js init ./my-agents-fleet
AGENTS_FLEET_HOME="$PWD/my-agents-fleet" node dist/cli.js validate
AGENTS_FLEET_HOME="$PWD/my-agents-fleet" node dist/cli.js doctor --offline
AGENTS_FLEET_HOME="$PWD/my-agents-fleet" node dist/cli.js list
AGENTS_FLEET_HOME="$PWD/my-agents-fleet" node dist/cli.js use software-team --no-restart

The bundled software-team configuration is illustrative. Initialization includes the free and software-team fleets plus the economy, free, frontier, and standard lines; when no activation state exists, the deterministic default is free. The free fleet binds the single zero-cost $free line to every enabled agent, routing them to the exact OpenCode model opencode/muse-spark-1.3-contributor-free (Muse Spark 1.3 Free), an active model discovered from the current OpenCode catalog. OpenCode remains responsible for provider authentication and model availability; this project never manages credentials.

Commands and integration

Use agents-fleet --help for the complete CLI. Install the default OpenCode V2 plugin from dist/plugin.js (or the package agents-fleet/plugin) in your OpenCode configuration. The read-only doctor command validates authoring and can compare agents, providers, models, and variants with a running OpenCode V2 service. This pre-release is source-install oriented and is not published to npm. See configuration, diagnostics, and OpenCode integration.