mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 21:02:40 +02:00
chore: ran linting
This commit is contained in:
parent
323f7f2b4a
commit
c674fb3054
37 changed files with 972 additions and 920 deletions
|
|
@ -380,38 +380,42 @@ function ExecuteCompleted({
|
|||
// Tool UI
|
||||
// ============================================================================
|
||||
|
||||
export const SandboxExecuteToolUI = ({ args, result, status }: ToolCallMessagePartProps<ExecuteArgs, ExecuteResult>) => {
|
||||
const command = args.command || "…";
|
||||
export const SandboxExecuteToolUI = ({
|
||||
args,
|
||||
result,
|
||||
status,
|
||||
}: ToolCallMessagePartProps<ExecuteArgs, ExecuteResult>) => {
|
||||
const command = args.command || "…";
|
||||
|
||||
if (status.type === "running" || status.type === "requires-action") {
|
||||
return <ExecuteLoading command={command} />;
|
||||
if (status.type === "running" || status.type === "requires-action") {
|
||||
return <ExecuteLoading command={command} />;
|
||||
}
|
||||
|
||||
if (status.type === "incomplete") {
|
||||
if (status.reason === "cancelled") {
|
||||
return <ExecuteCancelledState command={command} />;
|
||||
}
|
||||
|
||||
if (status.type === "incomplete") {
|
||||
if (status.reason === "cancelled") {
|
||||
return <ExecuteCancelledState command={command} />;
|
||||
}
|
||||
if (status.reason === "error") {
|
||||
return (
|
||||
<ExecuteErrorState
|
||||
command={command}
|
||||
error={typeof status.error === "string" ? status.error : "An error occurred"}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (status.reason === "error") {
|
||||
return (
|
||||
<ExecuteErrorState
|
||||
command={command}
|
||||
error={typeof status.error === "string" ? status.error : "An error occurred"}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
return <ExecuteLoading command={command} />;
|
||||
}
|
||||
if (!result) {
|
||||
return <ExecuteLoading command={command} />;
|
||||
}
|
||||
|
||||
if (result.error && !result.result && !result.output) {
|
||||
return <ExecuteErrorState command={command} error={result.error} />;
|
||||
}
|
||||
if (result.error && !result.result && !result.output) {
|
||||
return <ExecuteErrorState command={command} error={result.error} />;
|
||||
}
|
||||
|
||||
const parsed = parseExecuteResult(result);
|
||||
const threadId = result.thread_id || null;
|
||||
return <ExecuteCompleted command={command} parsed={parsed} threadId={threadId} />;
|
||||
const parsed = parseExecuteResult(result);
|
||||
const threadId = result.thread_id || null;
|
||||
return <ExecuteCompleted command={command} parsed={parsed} threadId={threadId} />;
|
||||
};
|
||||
|
||||
export { ExecuteArgsSchema, ExecuteResultSchema, type ExecuteArgs, type ExecuteResult };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue