@fieldwangai/agentflow 0.1.36 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/ui-server.mjs +12 -6
- package/builtin/web-ui/dist/assets/index-B0FRh8GY.js +214 -0
- package/builtin/web-ui/dist/assets/index-xdncUuHG.css +1 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +1 -1
- package/builtin/web-ui/dist/assets/index-7-343AUn.js +0 -214
- package/builtin/web-ui/dist/assets/index-CPsrRISH.css +0 -1
package/bin/lib/ui-server.mjs
CHANGED
|
@@ -1207,9 +1207,10 @@ function buildWorkspaceGeneratePrompt(payload) {
|
|
|
1207
1207
|
].join("\n")
|
|
1208
1208
|
: [
|
|
1209
1209
|
"你是 AgentFlow Workspace Composer。",
|
|
1210
|
-
"
|
|
1211
|
-
"
|
|
1212
|
-
"
|
|
1210
|
+
"默认以用户当前选择的 workspace 节点作为上下文范围;选中节点不是让你重建整张画布的授权。",
|
|
1211
|
+
"默认不要修改 workspace.graph.json,不要新增/删除/重连画布节点;只有当用户明确要求“更新画布、加节点、改连线、展示成节点、生成流程”时,才编辑 workspace.graph.json。",
|
|
1212
|
+
"如果用户请求生成或恢复文档/文件,可以直接在 workspace 文件系统中完成,最终只输出简短结果:改了什么、路径在哪里、是否需要下一步。",
|
|
1213
|
+
"不要在最终回答中列出过程性步骤,例如“先查看结构”“继续检索”“正在生成”;这些属于执行过程,不属于最终结果。",
|
|
1213
1214
|
].join("\n");
|
|
1214
1215
|
return [
|
|
1215
1216
|
"你正在 AgentFlow 的 Workspace 工作画布中执行任务。",
|
|
@@ -3050,7 +3051,8 @@ export function startUiServer({
|
|
|
3050
3051
|
const promptText = buildWorkspaceGeneratePrompt({ ...payload, skillsBlock });
|
|
3051
3052
|
const modelKey = typeof payload?.model === "string" ? payload.model.trim() : "";
|
|
3052
3053
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
3053
|
-
let
|
|
3054
|
+
let attemptResult = "";
|
|
3055
|
+
const assistantSegments = [];
|
|
3054
3056
|
try {
|
|
3055
3057
|
if (attempt > 1) {
|
|
3056
3058
|
events.push({
|
|
@@ -3068,12 +3070,16 @@ export function startUiServer({
|
|
|
3068
3070
|
onStreamEvent: (ev) => {
|
|
3069
3071
|
events.push(ev);
|
|
3070
3072
|
if (ev?.type === "natural" && ev.kind === "assistant" && typeof ev.text === "string") {
|
|
3071
|
-
|
|
3073
|
+
const text = ev.text.trim();
|
|
3074
|
+
if (text) assistantSegments.push(text);
|
|
3075
|
+
} else if (ev?.type === "natural" && ev.kind === "result" && typeof ev.text === "string") {
|
|
3076
|
+
const text = ev.text.trim();
|
|
3077
|
+
if (text) attemptResult = text;
|
|
3072
3078
|
}
|
|
3073
3079
|
},
|
|
3074
3080
|
});
|
|
3075
3081
|
await handle.finished;
|
|
3076
|
-
content =
|
|
3082
|
+
content = attemptResult || assistantSegments.at(-1) || "";
|
|
3077
3083
|
break;
|
|
3078
3084
|
} catch (e) {
|
|
3079
3085
|
if (attempt < maxAttempts && isTransientAgentNetworkError(e)) {
|