MCPcopy
hub / github.com/wshobson/agents / _opencode_frontmatter

Function _opencode_frontmatter

tools/adapters/opencode.py:132–151  ·  view source on GitHub ↗
(fm: dict)

Source from the content-addressed store, hash-verified

130
131
132def _opencode_frontmatter(fm: dict) -> str:
133 lines = ["---"]
134 for k, v in fm.items():
135 if isinstance(v, dict):
136 lines.append(f"{k}:")
137 for sk, sv in v.items():
138 lines.append(f" {sk}: {sv}")
139 elif isinstance(v, list):
140 lines.append(f"{k}:")
141 for item in v:
142 lines.append(f" - {item}")
143 elif isinstance(v, bool):
144 lines.append(f"{k}: {'true' if v else 'false'}")
145 elif v is None:
146 continue
147 else:
148 value = str(v).replace("\n", " ").strip()
149 lines.append(f"{k}: {value}")
150 lines.append("---")
151 return "\n".join(lines)
152
153
154def _opencode_skill_id(plugin: PluginSource, skill: SkillSource) -> str:

Callers 3

_emit_skillMethod · 0.85
_emit_agentMethod · 0.85
_emit_commandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected