(fm: dict)
| 130 | |
| 131 | |
| 132 | def _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 | |
| 154 | def _opencode_skill_id(plugin: PluginSource, skill: SkillSource) -> str: |
no outgoing calls
no test coverage detected