MCPcopy
hub / github.com/anomalyco/opencode / decode

Function decode

packages/core/src/config/plugin/command.ts:70–83  ·  view source on GitHub ↗
(directory: string, filepath: string, content: string)

Source from the content-addressed store, hash-verified

68}
69
70function decode(directory: string, filepath: string, content: string) {
71 const markdown = ConfigMarkdown.parseOption(content)
72 if (!markdown) return
73 const info = Option.getOrUndefined(decodeCommand({ ...markdown.data, template: markdown.content.trim() }))
74 if (!info) return
75 return {
76 name: path
77 .relative(directory, filepath)
78 .replaceAll("\\", "/")
79 .replace(/^(command|commands)\//, "")
80 .replace(/\.md$/, ""),
81 info,
82 }
83}

Callers 1

loadDirectoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected