@mazac-fox/opencode-fleet-contractsCanonical ID, telemetry, artifact, and health contracts shared across the OpenCode plugin fleet. Consumed directly by CLIs/daemons; re-exported from @mazac-fox/opencode-host-adapter for plugin authors.
0
11
近 7 天 6
22.0
生态多维模型
3 个月前
2026-05-21
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@mazac-fox/opencode-fleet-contracts@0.1.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@mazac-fox/opencode-fleet-contracts@0.1.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @mazac-fox/opencode-fleet-contractsopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Canonical contracts for the OpenCode plugin fleet: branded IDs, FleetContext, telemetry envelopes, artifact references, and HealthReport. Hand-written validators; runtime dep ulid only.
Modules
| Export | Purpose |
|---|---|
ids |
Branded ID types, new* / parse* (and legacy parsers where applicable) |
context |
FleetContext, decodeFleetContext, merge helpers |
telemetry |
FleetTelemetryEnvelope, validateTelemetryEnvelope, makeEnvelope |
artifacts |
ArtifactKind, ArtifactRef, parsers |
health |
HealthReport, validate/normalize helpers |
Plugins often consume this via @mazac-fox/opencode-host-adapter to avoid duplicate package instances.
Quick start
bun add @mazac-fox/opencode-fleet-contracts
import { newCorrelationId, validateHealthReport } from "@mazac-fox/opencode-fleet-contracts";
Rules: no as on unknown, use parsers; additive schema changes only unless schema_version migration is approved. AGENTS.md.
Development
bun install
bun run check
Fleet stack (context)
| Piece | Role |
|---|---|
| This package | Shared IDs and envelopes |
| opencode-host-adapter | wrapPlugin, telemetry emit, contract tests |
| opencode-fleet | Install, doctor, test, generate config |
| Plugins | Conductor, Engram, Concord, Codemem |
License
MIT