fix: resolve TypeScript build errors in AI agent files
Fix const assertion on ternary, unused parameter, and readonly array assignment that caused tsc to fail during pnpm build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,7 +85,7 @@ export function useAiAgent() {
|
||||
...m,
|
||||
actions: m.actions.map(a =>
|
||||
a.label.includes(toolId.slice(-6))
|
||||
? { ...a, status: (isError ? 'error' : 'done') as const, label: formatToolResult(a.tool, result) }
|
||||
? { ...a, status: isError ? 'error' as const : 'done' as const, label: formatToolResult(a.tool, result) }
|
||||
: a,
|
||||
),
|
||||
}))
|
||||
@@ -144,7 +144,7 @@ function isWriteTool(name: string): boolean {
|
||||
return WRITE_TOOLS.has(name)
|
||||
}
|
||||
|
||||
function extractPathFromArgs(toolName: string, args: Record<string, unknown>): string | null {
|
||||
function extractPathFromArgs(_toolName: string, args: Record<string, unknown>): string | null {
|
||||
if (args.path && typeof args.path === 'string') return args.path
|
||||
if (args.source_path && typeof args.source_path === 'string') return args.source_path
|
||||
return null
|
||||
|
||||
@@ -309,7 +309,7 @@ export async function runAgentLoop(
|
||||
|
||||
let response: AnthropicMessage
|
||||
try {
|
||||
response = await callAnthropicAgent(messages, systemPrompt, model, AGENT_TOOLS)
|
||||
response = await callAnthropicAgent(messages, systemPrompt, model, AGENT_TOOLS as unknown as unknown[])
|
||||
} catch (err) {
|
||||
callbacks.onError(err instanceof Error ? err.message : 'Unknown error')
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user