Skip to content

Commit dbc0667

Browse files
committed
fix: lint errors — biome formatting + noExplicitAny in schema-validate
1 parent 9b18e13 commit dbc0667

File tree

11 files changed

+87
-27
lines changed

11 files changed

+87
-27
lines changed

bm-client.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ describe("BmClient MCP behavior", () => {
212212
})
213213

214214
it("search omits metadata args when not provided", async () => {
215-
const callTool = jest.fn().mockResolvedValue(
216-
mcpResult({ results: [] }),
217-
)
215+
const callTool = jest.fn().mockResolvedValue(mcpResult({ results: [] }))
218216
setConnected(client, callTool)
219217

220218
await client.search("test", 10)

bm-client.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ export interface SchemaInferResult {
142142
export interface SchemaDiffResult {
143143
entity_type: string
144144
schema_found: boolean
145-
new_fields: Array<{ name: string; source: string; count: number; total: number; percentage: number }>
145+
new_fields: Array<{
146+
name: string
147+
source: string
148+
count: number
149+
total: number
150+
percentage: number
151+
}>
146152
dropped_fields: Array<{ name: string; source: string; declared_in?: string }>
147153
cardinality_changes: string[]
148154
}

commands/skills.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ describe("skill slash commands", () => {
1515
const names = (
1616
mockApi.registerCommand as jest.MockedFunction<any>
1717
).mock.calls.map((call: any[]) => call[0].name)
18-
expect(names).toEqual(["tasks", "reflect", "defrag", "schema", "notes", "metadata-search"])
18+
expect(names).toEqual([
19+
"tasks",
20+
"reflect",
21+
"defrag",
22+
"schema",
23+
"notes",
24+
"metadata-search",
25+
])
1926
})
2027

2128
it("should set correct metadata on each command", () => {

commands/skills.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ const SKILLS = [
1919
},
2020
{ name: "defrag", dir: "memory-defrag", desc: "Memory defrag workflow" },
2121
{ name: "schema", dir: "memory-schema", desc: "Schema management workflow" },
22-
{ name: "notes", dir: "memory-notes", desc: "How to write well-structured notes" },
23-
{ name: "metadata-search", dir: "memory-metadata-search", desc: "Structured metadata search workflow" },
22+
{
23+
name: "notes",
24+
dir: "memory-notes",
25+
desc: "How to write well-structured notes",
26+
},
27+
{
28+
name: "metadata-search",
29+
dir: "memory-metadata-search",
30+
desc: "Structured metadata search workflow",
31+
},
2432
] as const
2533

2634
export function registerSkillCommands(api: OpenClawPluginApi): void {

tools/context.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ describe("context tool", () => {
7777
],
7878
related_results: [
7979
{
80-
type: "entity", title: "Related Note 1",
80+
type: "entity",
81+
title: "Related Note 1",
8182
permalink: "related-note-1",
8283
relation_type: "references",
8384
},
8485
{
85-
type: "entity", title: "Related Note 2",
86+
type: "entity",
87+
title: "Related Note 2",
8688
permalink: "related-note-2",
8789
relation_type: "follows_from",
8890
},
@@ -211,7 +213,8 @@ describe("context tool", () => {
211213
observations: [{ category: "note", content: "Single observation" }],
212214
related_results: [
213215
{
214-
type: "entity", title: "Related to Second",
216+
type: "entity",
217+
title: "Related to Second",
215218
permalink: "related-to-second",
216219
relation_type: "depends_on",
217220
},
@@ -315,12 +318,14 @@ describe("context tool", () => {
315318
observations: [],
316319
related_results: [
317320
{
318-
type: "entity", title: "Related Note with Long Title",
321+
type: "entity",
322+
title: "Related Note with Long Title",
319323
permalink: "related-note-with-long-title",
320324
relation_type: "references",
321325
},
322326
{
323-
type: "entity", title: "Short Note",
327+
type: "entity",
328+
title: "Short Note",
324329
permalink: "short",
325330
relation_type: "follows_from",
326331
},

tools/context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export function registerContextTool(
8383
const label = r.relation_type
8484
? `${r.relation_type} → **${r.title}**`
8585
: `**${r.title}**`
86-
return r.permalink ? `- ${label} (${r.permalink})` : `- ${label}`
86+
return r.permalink
87+
? `- ${label} (${r.permalink})`
88+
: `- ${label}`
8789
})
8890
.join("\n")
8991
sections.push(`### Related\n${rels}`)

tools/schema-diff.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,18 @@ describe("schema-diff tool", () => {
4141
;(mockClient.schemaDiff as jest.MockedFunction<any>).mockResolvedValue({
4242
entity_type: "person",
4343
schema_found: true,
44-
new_fields: [{ name: "phone", source: "observation", count: 6, total: 10, percentage: 0.6 }],
45-
dropped_fields: [{ name: "fax", source: "observation", declared_in: "schema" }],
44+
new_fields: [
45+
{
46+
name: "phone",
47+
source: "observation",
48+
count: 6,
49+
total: 10,
50+
percentage: 0.6,
51+
},
52+
],
53+
dropped_fields: [
54+
{ name: "fax", source: "observation", declared_in: "schema" },
55+
],
4656
cardinality_changes: [],
4757
})
4858

tools/schema-infer.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@ describe("schema-infer tool", () => {
4242
entity_type: "person",
4343
notes_analyzed: 12,
4444
field_frequencies: [
45-
{ name: "name", percentage: 1.0, count: 12, total: 12, source: "observation" },
46-
{ name: "email", percentage: 0.75, count: 9, total: 12, source: "observation" },
45+
{
46+
name: "name",
47+
percentage: 1.0,
48+
count: 12,
49+
total: 12,
50+
source: "observation",
51+
},
52+
{
53+
name: "email",
54+
percentage: 0.75,
55+
count: 9,
56+
total: 12,
57+
source: "observation",
58+
},
4759
],
4860
suggested_schema: { name: "string", "email?": "string" },
4961
suggested_required: ["name"],

tools/schema-validate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export function registerSchemaValidateTool(
4949
)
5050

5151
// Handle error responses from BM (e.g., no schema found)
52-
if ("error" in result && typeof (result as any).error === "string") {
52+
const resultRecord = result as Record<string, unknown>
53+
if ("error" in result && typeof resultRecord.error === "string") {
5354
return {
54-
content: [{ type: "text" as const, text: (result as any).error }],
55+
content: [{ type: "text" as const, text: resultRecord.error }],
5556
}
5657
}
5758

tools/search.test.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ describe("search tool", () => {
8888
limit: 5,
8989
})
9090

91-
expect(mockClient.search).toHaveBeenCalledWith("test query", 5, undefined, undefined)
91+
expect(mockClient.search).toHaveBeenCalledWith(
92+
"test query",
93+
5,
94+
undefined,
95+
undefined,
96+
)
9297
expect(result).toEqual({
9398
content: [
9499
{
@@ -318,11 +323,16 @@ describe("search tool", () => {
318323
status: "in-progress",
319324
})
320325

321-
expect(mockClient.search).toHaveBeenCalledWith("oauth flow", 5, "research", {
322-
filters: { confidence: { $gt: 0.7 } },
323-
tags: ["security"],
324-
status: "in-progress",
325-
})
326+
expect(mockClient.search).toHaveBeenCalledWith(
327+
"oauth flow",
328+
5,
329+
"research",
330+
{
331+
filters: { confidence: { $gt: 0.7 } },
332+
tags: ["security"],
333+
status: "in-progress",
334+
},
335+
)
326336
})
327337

328338
it("should not pass metadata when no metadata params provided", async () => {

0 commit comments

Comments
 (0)