Wires the ported Tasks screen + core task subsystem through App.tsx: sticky Clear Completed, cancel/refresh error toasts, core-side per-task progress correlation, Run-as-task on the Tools screen (gated on server support), per-server Task TTL, and live task-status toasts.
This commit is contained in:
parent
8923a9bbf9
commit
ed6eda7492
1 changed files with 1192 additions and 40 deletions
|
|
@ -22,6 +22,12 @@ export interface ToolsUiState {
|
|||
selectedToolName?: string;
|
||||
formValues: Record<string, unknown>;
|
||||
search: string;
|
||||
// Screen-level "Run as task" toggle, shared across tools (not per-tool):
|
||||
// selecting a different tool keeps the current value. Persists across tab
|
||||
// navigation like the rest of the UI state, and is only honored for the
|
||||
// selected tool when its `execution.taskSupport` is "optional" (a "required"
|
||||
// tool is always run as a task, "forbidden" never) — see ToolDetailPanel.
|
||||
runAsTask: boolean;
|
||||
}
|
||||
|
||||
export interface ToolsScreenProps {
|
||||
|
|
@ -29,9 +35,15 @@ export interface ToolsScreenProps {
|
|||
callState?: ToolCallState;
|
||||
ui: ToolsUiState;
|
||||
listChanged: boolean;
|
||||
/** Whether the connected server advertises task-augmented tool calls. */
|
||||
serverSupportsTaskToolCalls: boolean;
|
||||
onUiChange: (next: ToolsUiState) => void;
|
||||
onRefreshList: () => void;
|
||||
onCallTool: (name: string, args: Record<string, unknown>) => void;
|
||||
onCallTool: (
|
||||
name: string,
|
||||
args: Record<string, unknown>,
|
||||
runAsTask?: boolean,
|
||||
) => void;
|
||||
onCancelCall?: () => void;
|
||||
onClearResult?: () => void;
|
||||
}
|
||||
|
|
@ -92,6 +104,7 @@ export function ToolsScreen({
|
|||
callState,
|
||||
ui,
|
||||
listChanged,
|
||||
serverSupportsTaskToolCalls,
|
||||
onUiChange,
|
||||
onRefreshList,
|
||||
onCallTool,
|
||||
|
|
@ -139,10 +152,17 @@ export function ToolsScreen({
|
|||
formValues={formValues}
|
||||
isExecuting={isExecuting}
|
||||
progress={callState?.progress}
|
||||
serverSupportsTaskToolCalls={serverSupportsTaskToolCalls}
|
||||
runAsTask={ui.runAsTask}
|
||||
onRunAsTaskChange={(value) =>
|
||||
onUiChange({ ...ui, runAsTask: value })
|
||||
}
|
||||
onFormChange={(values) =>
|
||||
onUiChange({ ...ui, formValues: values })
|
||||
}
|
||||
onExecute={() => onCallTool(selectedTool.name, formValues)}
|
||||
onExecute={(runAsTask) =>
|
||||
onCallTool(selectedTool.name, formValues, runAsTask)
|
||||
}
|
||||
onCancel={() => onCancelCall?.()}
|
||||
/>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Reference in a new issue