Repository navigation
Development
Jeremy edited this page Mar 31, 2026
·
1 revision
opencode-omoc-swarm/
├── plugins/
│ ├── omoc-swarm.ts ← main plugin (all 8 tools)
│ ├── registry.ts ← persistent swarm registry
│ ├── registry.test.ts ← unit tests for registry
│ ├── registry-roundtrip.test.ts ← roundtrip serialization tests
│ ├── state.ts ← event log + memory + path reservation
│ └── migration.test.ts ← migration tests
├── bin/
│ └── oc-swarm ← tmux launcher script
├── scripts/
│ ├── oc-swarm-smoke.test.sh ← dependency smoke test
│ └── oc-swarm-e2e.test.sh ← live E2E test suite
├── templates/
│ ├── bin/opencode ← wrapper for per-project bin/
│ └── .envrc ← direnv config
├── lib/
│ └── observe.ts ← observability CLI implementation
├── types/
│ └── ... ← shared TypeScript types
├── benchmarks/
│ └── ... ← performance benchmarks
├── governance/
│ └── ... ← repo governance config
├── platforms/
│ └── registry.json ← platform registry
├── n8n-workflows/
│ └── inbound-intake.json ← n8n workflow for intake automation
├── package.json
├── tsconfig.json
└── bun.lock
# Unit tests (registry, state)
bun run plugins/registry.test.ts
bun run plugins/registry-roundtrip.test.ts
# Smoke test (checks dependencies)
bash scripts/oc-swarm-smoke.test.sh
# Live E2E tests (requires opencode on PATH)
bun run test:e2e
# All CI checks
bun run ci
# All CI + E2E
bun run ci:with-e2eNote: Live E2E tests skip gracefully if opencode is not available on PATH.
bun run observe stats
bun run observe history <swarmId>
bun run observe export <swarmId> json
bun run memory list
bun run eval- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make changes to
plugins/omoc-swarm.ts(andregistry.ts/state.tsas needed) - Add tests in
plugins/*.test.ts - Run the full test suite:
bun run ci - Open a Pull Request
- TypeScript strict mode
- No external runtime dependencies (only
@opencode-ai/sdkand@opencode-ai/plugin) - All tool parameters must use
schema.*from the plugin SDK - Every tool must append an event via
appendSwarmEvent
"swarm.mytool": tool({
description: "What this tool does.",
args: {
id: schema.string().min(1).optional().describe("Optional swarm id"),
// ... other args
},
async execute(args: any, context: any) {
const result = await resolveSwarm(client, args.id, context.sessionID, context.directory, context.worktree);
if ("error" in result) return result.error;
await appendSwarmEvent(context.directory, {
type: "swarm.mytool",
swarmId: result.swarmId,
sessionID: context.sessionID,
data: { /* ... */ },
});
return "result string";
},
}),- Queue runner support is not implemented
- Title parsing is only a legacy discovery fallback; registry state is the source of truth for agent identity
-
swarm.maxrequires a git repository — bare repos and non-git directories are not supported - The selector in MAX mode sees unified diffs only, not full file content; very large changes may degrade selector quality