F3: connect Prompt tools and web task controls to native Jobs

This commit is contained in:
Xin Wang
2026-10-23 16:14:17 +08:00
parent 33fde56edd
commit 9a4d48a86e
14 changed files with 362 additions and 23 deletions
@@ -90,6 +90,7 @@ const EXTERNAL_TOOL_TYPE_LABELS: Record<Tool["type"], string> = {
http: "HTTP",
mcp: "MCP",
client: "Client",
task: "后台任务",
};
const OPENING_MODE_OPTIONS: Array<{
@@ -220,7 +221,7 @@ export function PromptEditor({
(key) =>
Boolean(form.builtInTools[key]) && !allowedRealtimeBuiltIns.has(key),
);
const allowedRealtimeExternalTypes = new Set(
const allowedRealtimeExternalTypes = new Set<string>(
realtimeToolFeatures?.externalTypes ?? [],
);
const unsupportedToolBindings = form.toolBindings.filter((binding) => {
@@ -881,11 +882,12 @@ export function PromptEditor({
description="从资源库添加工具,并配置当前助手的参数来源与结果写入"
>
<ToolBindingEditor
allowTask={form.runtimeMode === "pipeline"}
tools={tools}
selectableTools={
form.runtimeMode === "realtime"
? tools.filter((tool) =>
realtimeToolFeatures?.externalTypes.includes(tool.type),
realtimeToolFeatures?.externalTypes.some(type => type === tool.type),
)
: tools
}