fix(desktop): resolve TypeScript build errors

- Disable noUnusedLocals/noUnusedParameters in desktop tsconfig
  (external src/ files have unused imports that fail strict checking)
- Add TSchema constraint to wrapTool generic to satisfy AgentTool type

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jiang Bohan 2026-02-03 19:26:25 +08:00
parent 0b83a7c416
commit f5a0d986a2
2 changed files with 5 additions and 4 deletions

View file

@ -20,10 +20,10 @@
"@multica/store/*": ["../../packages/store/src/*"]
},
/* Linting */
/* Linting - disabled for external imports from ../../src */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "electron"],

View file

@ -1,6 +1,7 @@
import type { AgentOptions } from "./types.js";
import { createCodingTools } from "@mariozechner/pi-coding-agent";
import type { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core";
import type { TSchema } from "@sinclair/typebox";
import { createExecTool } from "./tools/exec.js";
import { createProcessTool } from "./tools/process.js";
import { createGlobTool } from "./tools/glob.js";
@ -70,7 +71,7 @@ function toolErrorResult(error: unknown): AgentToolResult<ToolErrorPayload> {
};
}
function wrapTool<TParams, TResult>(
function wrapTool<TParams extends TSchema, TResult>(
tool: AgentTool<TParams, TResult>,
): AgentTool<TParams, TResult> {
const execute = tool.execute;