chore: Lint extensions folder.

This commit is contained in:
cpojer
2026-01-31 22:13:48 +09:00
parent 4f2166c503
commit 230ca789e2
221 changed files with 4006 additions and 1583 deletions
@@ -36,7 +36,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: JSON.stringify({ foo: "bar" }) }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
const res = await tool.execute("id", { prompt: "return foo" });
expect((res as any).details.json).toEqual({ foo: "bar" });
});
@@ -46,7 +46,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: '```json\n{"ok":true}\n```' }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
const res = await tool.execute("id", { prompt: "return ok" });
expect((res as any).details.json).toEqual({ ok: true });
});
@@ -56,7 +56,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: JSON.stringify({ foo: "bar" }) }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
const schema = {
type: "object",
properties: { foo: { type: "string" } },
@@ -72,7 +72,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: "not-json" }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
await expect(tool.execute("id", { prompt: "x" })).rejects.toThrow(/invalid json/i);
});
@@ -81,7 +81,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: JSON.stringify({ foo: 1 }) }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
const schema = { type: "object", properties: { foo: { type: "string" } }, required: ["foo"] };
await expect(tool.execute("id", { prompt: "x", schema })).rejects.toThrow(/match schema/i);
});
@@ -91,7 +91,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: JSON.stringify({ ok: true }) }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
await tool.execute("id", { prompt: "x", provider: "anthropic", model: "claude-4-sonnet" });
const call = (runEmbeddedPiAgent as any).mock.calls[0]?.[0];
expect(call.provider).toBe("anthropic");
@@ -104,7 +104,7 @@ describe("llm-task tool (json-only)", () => {
payloads: [{ text: JSON.stringify({ ok: true }) }],
});
const tool = createLlmTaskTool(
fakeApi({ pluginConfig: { allowedModels: ["openai-codex/gpt-5.2"] } }) as any,
fakeApi({ pluginConfig: { allowedModels: ["openai-codex/gpt-5.2"] } }),
);
await expect(
tool.execute("id", { prompt: "x", provider: "anthropic", model: "claude-4-sonnet" }),
@@ -116,7 +116,7 @@ describe("llm-task tool (json-only)", () => {
meta: {},
payloads: [{ text: JSON.stringify({ ok: true }) }],
});
const tool = createLlmTaskTool(fakeApi() as any);
const tool = createLlmTaskTool(fakeApi());
await tool.execute("id", { prompt: "x" });
const call = (runEmbeddedPiAgent as any).mock.calls[0]?.[0];
expect(call.disableTools).toBe(true);