MCPcopy Index your code
hub / github.com/coder/mux / createAgentFile

Function createAgentFile

tests/ui/agents/picker.test.ts:94–102  ·  view source on GitHub ↗

* Create a custom agent definition file in the workspace.

(
  workspacePath: string,
  agentId: string,
  content: string
)

Source from the content-addressed store, hash-verified

92 * Create a custom agent definition file in the workspace.
93 */
94async function createAgentFile(
95 workspacePath: string,
96 agentId: string,
97 content: string
98): Promise<void> {
99 const agentsDir = path.join(workspacePath, ".mux", "agents");
100 await fs.mkdir(agentsDir, { recursive: true });
101 await fs.writeFile(path.join(agentsDir, `${agentId}.md`), content);
102}
103
104/**
105 * Remove a custom agent definition file from the workspace.

Callers 1

picker.test.tsFile · 0.85

Calls 1

writeFileMethod · 0.65

Tested by

no test coverage detected