MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / resolveOpencodeFileTemplate

Function resolveOpencodeFileTemplate

src/features/opencode-config.ts:84–102  ·  view source on GitHub ↗
({
  value,
  configDir,
}: {
  value: string;
  configDir: string;
})

Source from the content-addressed store, hash-verified

82 * @see https://opencode.ai/docs/agents/
83 */
84export async function resolveOpencodeFileTemplate({
85 value,
86 configDir,
87}: {
88 value: string;
89 configDir: string;
90}): Promise<string> {
91 const match = OPENCODE_FILE_TEMPLATE_PATTERN.exec(value);
92 if (!match) {
93 return value;
94 }
95
96 const referencedPath = match[1]?.trim().replace(/^\.\//, "");
97 if (!referencedPath) {
98 return value;
99 }
100
101 return (await readFileContentOrNull(join(configDir, referencedPath))) ?? value;
102}

Callers 2

Calls 1

readFileContentOrNullFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…