MCPcopy Index your code
hub / github.com/AI45Lab/Code / writeAgentDir

Function writeAgentDir

sdk/node/test_serve.mjs:39–57  ·  view source on GitHub ↗
({ withSchedule, withTools })

Source from the content-addressed store, hash-verified

37}
38
39function writeAgentDir({ withSchedule, withTools }) {
40 const base = fs.mkdtempSync(path.join(os.tmpdir(), 'a3s-node-serve-'))
41 fs.writeFileSync(path.join(base, 'instructions.md'), 'You are a terse test agent. Answer in one word.')
42 if (withSchedule) {
43 fs.mkdirSync(path.join(base, 'schedules'))
44 fs.writeFileSync(
45 path.join(base, 'schedules', 'tick.md'),
46 '---\ncron: "* * * * * *"\nname: tick\n---\nReply with exactly one word: PONG',
47 )
48 }
49 if (withTools) {
50 fs.mkdirSync(path.join(base, 'tools'))
51 fs.writeFileSync(
52 path.join(base, 'tools', 'echo.md'),
53 '---\nkind: script\nname: echo-tool\npath: scripts/echo.js\n---\nEcho tool.\n',
54 )
55 }
56 return base
57}
58
59function repoConfig() {
60 if (process.env.A3S_CONFIG_FILE && fs.existsSync(process.env.A3S_CONFIG_FILE)) {

Callers 1

test_serve.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected