Go 36 lines
package cockpit
// agentsRenderer emits the whole selected playbook set as one AGENTS.md — the
// cross-tool agent-instructions convention, plain Markdown with no
// frontmatter. AGENTS.md is purely advisory (no tool-permission enforcement
// of any kind), so the file leads with the ADVISORY banner and a fidelity
// report. It is an aggregate target: one shared file for the set, emitted via
// the GenerateAll/VerifyAll/OffAll path (the per-playbook Renderer methods
// exist for interface completeness but are off the emit path — Generate
// rejects aggregate targets).
type agentsRenderer struct{}
func (agentsRenderer) Target() string { return "agents" }
// Enforcement reports that AGENTS.md is advisory only. It satisfies the
// Fidelity interface.
func (agentsRenderer) Enforcement() Enforcement { return EnforcementAdvisory }
// AggRelPath is the single shared artifact path for the whole set.
func (agentsRenderer) AggRelPath() string { return "AGENTS.md" }
// RenderAll renders the set as one AGENTS.md document, deterministic in set
// order (renderAggregateMarkdown sorts by Name).
func (agentsRenderer) RenderAll(ps []Playbook) ([]byte, error) {
return renderAggregateMarkdown(ps,
"AGENTS.md — eeco-generated agent playbooks",
"This file aggregates the eeco cockpit playbooks for any AGENTS.md-aware tool."), nil
}
// RelPath / Render satisfy Renderer for interface completeness; the aggregate
// emit path (GenerateAll) is what actually drives this target.
func (r agentsRenderer) RelPath(Playbook) string { return r.AggRelPath() }
func (r agentsRenderer) Render(p Playbook) ([]byte, error) {
return r.RenderAll([]Playbook{p})
}