Skip to content

Commit 67ecf18

Browse files
style: apply biome lint fixes
Co-authored-by: paveltarno <Paveltarno@users.noreply.github.com>
1 parent 93fc922 commit 67ecf18

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

src/core/resources/agent/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ interface AgentFileEntry {
5757
filePath: string;
5858
}
5959

60-
async function readAgentFiles(
61-
agentsDir: string
62-
): Promise<AgentFileEntry[]> {
60+
async function readAgentFiles(agentsDir: string): Promise<AgentFileEntry[]> {
6361
if (!(await pathExists(agentsDir))) {
6462
return [];
6563
}

tests/core/agents_write.spec.ts

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@ import { mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises";
22
import { tmpdir } from "node:os";
33
import { join } from "node:path";
44
import { describe, expect, it } from "vitest";
5-
import type { AgentConfigApiResponse } from "../../src/core/resources/agent/schema.js";
65
import {
76
readAllAgents,
87
writeAgents,
98
} from "../../src/core/resources/agent/config.js";
9+
import type { AgentConfigApiResponse } from "../../src/core/resources/agent/schema.js";
1010

1111
describe("writeAgents", () => {
1212
it("writes remote agents to files", async () => {
1313
const tmpDir = await mkdtemp(join(tmpdir(), "agents-test-"));
1414

1515
try {
1616
const remoteAgents: AgentConfigApiResponse[] = [
17-
{ name: "support", description: "Help desk", instructions: "Be helpful" },
17+
{
18+
name: "support",
19+
description: "Help desk",
20+
instructions: "Be helpful",
21+
},
1822
{ name: "sales", description: "Sales bot", instructions: "Sell stuff" },
1923
];
2024

@@ -36,13 +40,21 @@ describe("writeAgents", () => {
3640

3741
try {
3842
const initial: AgentConfigApiResponse[] = [
39-
{ name: "support", description: "Help desk", instructions: "Be helpful" },
43+
{
44+
name: "support",
45+
description: "Help desk",
46+
instructions: "Be helpful",
47+
},
4048
{ name: "sales", description: "Sales bot", instructions: "Sell stuff" },
4149
];
4250
await writeAgents(tmpDir, initial);
4351

4452
const remote: AgentConfigApiResponse[] = [
45-
{ name: "support", description: "Help desk", instructions: "Be helpful" },
53+
{
54+
name: "support",
55+
description: "Help desk",
56+
instructions: "Be helpful",
57+
},
4658
];
4759
const { written, deleted } = await writeAgents(tmpDir, remote);
4860

@@ -71,7 +83,11 @@ describe("writeAgents", () => {
7183
);
7284

7385
const remoteAgents: AgentConfigApiResponse[] = [
74-
{ name: "support", description: "Updated help desk", instructions: "Be very helpful" },
86+
{
87+
name: "support",
88+
description: "Updated help desk",
89+
instructions: "Be very helpful",
90+
},
7591
];
7692

7793
const { written, deleted } = await writeAgents(tmpDir, remoteAgents);
@@ -113,7 +129,11 @@ describe("writeAgents", () => {
113129
);
114130

115131
const remoteAgents: AgentConfigApiResponse[] = [
116-
{ name: "support", description: "Help desk", instructions: "Be helpful" },
132+
{
133+
name: "support",
134+
description: "Help desk",
135+
instructions: "Be helpful",
136+
},
117137
];
118138

119139
const { written, deleted } = await writeAgents(tmpDir, remoteAgents);
@@ -136,7 +156,11 @@ describe("writeAgents", () => {
136156
await writeFile(join(tmpDir, "support.jsonc"), fileContent);
137157

138158
const remoteAgents: AgentConfigApiResponse[] = [
139-
{ name: "support", description: "Help desk", instructions: "Be helpful" },
159+
{
160+
name: "support",
161+
description: "Help desk",
162+
instructions: "Be helpful",
163+
},
140164
];
141165

142166
const { written, deleted } = await writeAgents(tmpDir, remoteAgents);
@@ -159,7 +183,11 @@ describe("writeAgents", () => {
159183
await writeFile(join(tmpDir, "support.jsonc"), fileContent);
160184

161185
const remoteAgents: AgentConfigApiResponse[] = [
162-
{ name: "support", description: "Updated help desk", instructions: "Be very helpful" },
186+
{
187+
name: "support",
188+
description: "Updated help desk",
189+
instructions: "Be very helpful",
190+
},
163191
];
164192

165193
const { written, deleted } = await writeAgents(tmpDir, remoteAgents);

0 commit comments

Comments
 (0)