点击后打开沙箱
This commit is contained in:
1 parent
4fab13c728
commit
1cfa93e855
2 files changed
+14
-1
No files matched your search
@@ -170,10 +170,13 @@ function ToolStep({
|
|||||||
const display = getStepDisplay(step.key, step.label, step.args);
|
const display = getStepDisplay(step.key, step.label, step.args);
|
||||||
const argNode = renderStepArgs(step.key, step.args, resolveAgentName);
|
const argNode = renderStepArgs(step.key, step.args, resolveAgentName);
|
||||||
const [, toolName] = step.key.split(":");
|
const [, toolName] = step.key.split(":");
|
||||||
|
// read_file 也可点 —— 验证类「查看文件…」步骤常出现在最后一条,点击后在沙箱里
|
||||||
|
// 查看该文件内容(走虚拟预览或 outputs HTTP)。主聊天只让 write 类可点,这里增强。
|
||||||
const isArtifactStep =
|
const isArtifactStep =
|
||||||
toolName === "write_file" ||
|
toolName === "write_file" ||
|
||||||
toolName === "str_replace" ||
|
toolName === "str_replace" ||
|
||||||
toolName === "present_files";
|
toolName === "present_files" ||
|
||||||
|
toolName === "read_file";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChainOfThoughtStep
|
<ChainOfThoughtStep
|
||||||
|
|||||||
@@ -557,6 +557,16 @@ export function useStep2Orchestration(
|
|||||||
openSeatVirtualArtifact(seatThreadId, virtualUrl, false);
|
openSeatVirtualArtifact(seatThreadId, virtualUrl, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (toolName === "read_file") {
|
||||||
|
// 验证类「查看文件…」步骤:用 args.path 在沙箱预览该文件。
|
||||||
|
// openArtifactPreview 内部 findSeatArtifactSource 优先按 path 命中流式期间
|
||||||
|
// write_file 缓存的内容(虚拟预览);未命中再走 seat thread 的 outputs HTTP。
|
||||||
|
const path = step.args?.path;
|
||||||
|
if (typeof path === "string" && path) {
|
||||||
|
openArtifactPreview(seatThreadId, path);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (toolName === "present_files") {
|
if (toolName === "present_files") {
|
||||||
const filepaths = step.args?.filepaths;
|
const filepaths = step.args?.filepaths;
|
||||||
if (Array.isArray(filepaths)) {
|
if (Array.isArray(filepaths)) {
|
||||||
|
|||||||
Reference in new issue
Block a user