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
|
|
@ -10,8 +10,11 @@ const meta: Meta<typeof ToolDetailPanel> = {
|
|||
onFormChange: fn(),
|
||||
onExecute: fn(),
|
||||
onCancel: fn(),
|
||||
onRunAsTaskChange: fn(),
|
||||
formValues: {},
|
||||
isExecuting: false,
|
||||
serverSupportsTaskToolCalls: false,
|
||||
runAsTask: false,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -142,3 +145,45 @@ export const WithProgress: Story = {
|
|||
formValues: { batchSize: 100 },
|
||||
},
|
||||
};
|
||||
|
||||
const optionalTaskTool: Tool = {
|
||||
name: "summarize_corpus",
|
||||
description: "Summarizes a large corpus — can run as a background task",
|
||||
execution: { taskSupport: "optional" },
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
corpus: { type: "string", description: "Text to summarize" },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const requiredTaskTool: Tool = {
|
||||
name: "train_model",
|
||||
description: "Long-running training job — always runs as a task",
|
||||
execution: { taskSupport: "required" },
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
dataset: { type: "string", description: "Dataset id" },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Server supports task tool calls + tool is `optional`: the toggle renders
|
||||
// enabled and off by default.
|
||||
export const RunAsTaskOptional: Story = {
|
||||
args: {
|
||||
tool: optionalTaskTool,
|
||||
serverSupportsTaskToolCalls: true,
|
||||
runAsTask: false,
|
||||
},
|
||||
};
|
||||
|
||||
// Tool is `required`: the toggle is forced on and disabled.
|
||||
export const RunAsTaskRequired: Story = {
|
||||
args: {
|
||||
tool: requiredTaskTool,
|
||||
serverSupportsTaskToolCalls: true,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue