Switch to double quotes and reformat codebase with Biome
This commit is contained in:
@@ -19,9 +19,7 @@ function hasMeaningfulUnknownValue(value: unknown): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function hasMeaningfulToolCallDetail(
|
||||
detail: ToolCallDetail | undefined
|
||||
): boolean {
|
||||
export function hasMeaningfulToolCallDetail(detail: ToolCallDetail | undefined): boolean {
|
||||
if (!detail) {
|
||||
return false;
|
||||
}
|
||||
@@ -32,9 +30,7 @@ export function hasMeaningfulToolCallDetail(
|
||||
case "read":
|
||||
return Boolean(detail.filePath || detail.content);
|
||||
case "edit":
|
||||
return Boolean(
|
||||
detail.filePath || detail.unifiedDiff || detail.oldString || detail.newString
|
||||
);
|
||||
return Boolean(detail.filePath || detail.unifiedDiff || detail.oldString || detail.newString);
|
||||
case "write":
|
||||
return Boolean(detail.filePath || detail.content);
|
||||
case "search":
|
||||
@@ -43,7 +39,7 @@ export function hasMeaningfulToolCallDetail(
|
||||
detail.content ||
|
||||
(detail.filePaths && detail.filePaths.length > 0) ||
|
||||
(detail.webResults && detail.webResults.length > 0) ||
|
||||
(detail.annotations && detail.annotations.length > 0)
|
||||
(detail.annotations && detail.annotations.length > 0),
|
||||
);
|
||||
case "fetch":
|
||||
return Boolean(detail.url || detail.result || detail.codeText);
|
||||
@@ -51,18 +47,12 @@ export function hasMeaningfulToolCallDetail(
|
||||
return Boolean(detail.branchName || detail.worktreePath || detail.log);
|
||||
case "sub_agent":
|
||||
return Boolean(
|
||||
detail.subAgentType ||
|
||||
detail.description ||
|
||||
detail.log ||
|
||||
detail.actions.length > 0
|
||||
detail.subAgentType || detail.description || detail.log || detail.actions.length > 0,
|
||||
);
|
||||
case "plain_text":
|
||||
return Boolean(detail.label || detail.text);
|
||||
case "unknown":
|
||||
return (
|
||||
hasMeaningfulUnknownValue(detail.input) ||
|
||||
hasMeaningfulUnknownValue(detail.output)
|
||||
);
|
||||
return hasMeaningfulUnknownValue(detail.input) || hasMeaningfulUnknownValue(detail.output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +61,6 @@ export function isPendingToolCallDetail(params: {
|
||||
status: "executing" | "running" | "completed" | "failed" | "canceled";
|
||||
error: unknown | null | undefined;
|
||||
}): boolean {
|
||||
const isRunning =
|
||||
params.status === "running" || params.status === "executing";
|
||||
const isRunning = params.status === "running" || params.status === "executing";
|
||||
return isRunning && params.error == null && !hasMeaningfulToolCallDetail(params.detail);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user