@fieldwangai/agentflow 0.1.149 → 0.1.154
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/README.md +20 -33
- package/README.zh-CN.md +14 -34
- package/agents/agentflow-node-executor-code.md +13 -3
- package/agents/agentflow-node-executor-planning.md +13 -3
- package/agents/agentflow-node-executor-requirement.md +13 -3
- package/agents/agentflow-node-executor-test.md +13 -3
- package/agents/agentflow-node-executor-ui.md +13 -3
- package/agents/agentflow-node-executor.md +13 -3
- package/agents/en/agentflow-node-executor.md +13 -3
- package/agents/zh/agentflow-node-executor.md +13 -3
- package/bin/agentflow.mjs +3 -3
- package/bin/lib/admin-builtin-pipelines.mjs +3 -2
- package/bin/lib/agent-runners.mjs +0 -929
- package/bin/lib/auth.mjs +2 -1
- package/bin/lib/catalog-agents.mjs +2 -1
- package/bin/lib/catalog-flows.mjs +167 -88
- package/bin/lib/composer-agent.mjs +3 -793
- package/bin/lib/composer-skill-router.mjs +3 -323
- package/bin/lib/exec-buffered.mjs +32 -0
- package/bin/lib/flow-dsl/cli.mjs +276 -0
- package/bin/lib/flow-dsl/codegen.mjs +358 -0
- package/bin/lib/flow-dsl/defs.mjs +103 -0
- package/bin/lib/flow-dsl/index.mjs +77 -0
- package/bin/lib/flow-dsl/ir.mjs +305 -0
- package/bin/lib/flow-dsl/layout.mjs +115 -0
- package/bin/lib/flow-dsl/legacy-yaml.mjs +268 -0
- package/bin/lib/flow-dsl/lint.mjs +241 -0
- package/bin/lib/flow-dsl/packages.mjs +251 -0
- package/bin/lib/flow-dsl/parser.mjs +444 -0
- package/bin/lib/flow-import.mjs +96 -26
- package/bin/lib/flow-write.mjs +48 -12
- package/bin/lib/help.mjs +10 -30
- package/bin/lib/html-escape.mjs +19 -0
- package/bin/lib/http-util.mjs +49 -0
- package/bin/lib/legacy-flow-execution.mjs +43 -0
- package/bin/lib/locales/en.json +1 -1
- package/bin/lib/locales/zh.json +1 -1
- package/bin/lib/main.mjs +153 -283
- package/bin/lib/marketplace.mjs +206 -61
- package/bin/lib/model-config.mjs +10 -0
- package/bin/lib/node-package-archive.mjs +240 -0
- package/bin/lib/node-package-bootstrap.mjs +72 -0
- package/bin/lib/node-package-manifest.mjs +174 -0
- package/bin/lib/paths.mjs +42 -19
- package/bin/lib/prd-workflow-routes.mjs +2949 -0
- package/bin/lib/prd-workflow-server.mjs +4884 -0
- package/bin/lib/run-events.mjs +0 -66
- package/bin/lib/schedule-config.mjs +4 -4
- package/bin/lib/skill-runtime.mjs +35 -0
- package/bin/lib/startup-storage-migrations.mjs +274 -0
- package/bin/lib/ui-server.mjs +1106 -18013
- package/bin/lib/user-env.mjs +16 -0
- package/bin/lib/workspace-auto-layout.mjs +234 -0
- package/bin/lib/workspace-flow-store.mjs +478 -0
- package/bin/lib/workspace-graph-merge.mjs +41 -34
- package/bin/lib/workspace-preview.mjs +74 -0
- package/bin/lib/workspace-routes.mjs +3088 -0
- package/bin/lib/workspace-server.mjs +6199 -0
- package/bin/lib/workspace-state.mjs +331 -0
- package/bin/lib/workspace.mjs +2 -1
- package/builtin/nodes/agent_subAgent.md +1 -0
- package/builtin/nodes/control_agent_toBool.md +2 -0
- package/builtin/nodes/control_anyOne.md +2 -0
- package/builtin/nodes/control_cancelled.md +2 -0
- package/builtin/nodes/control_cd_workspace.md +5 -11
- package/builtin/nodes/control_delay.md +2 -0
- package/builtin/nodes/control_end.md +2 -0
- package/builtin/nodes/control_if.md +1 -0
- package/builtin/nodes/control_interval_loop.md +2 -0
- package/builtin/nodes/control_load_mcp.md +24 -0
- package/builtin/nodes/control_load_skills.md +8 -23
- package/builtin/nodes/control_start.md +2 -0
- package/builtin/nodes/control_toBool.md +2 -0
- package/builtin/nodes/control_user_workspace.md +2 -0
- package/builtin/nodes/control_wait_until.md +2 -0
- package/builtin/nodes/display_ascii.md +1 -0
- package/builtin/nodes/display_chart.md +1 -0
- package/builtin/nodes/display_html.md +1 -0
- package/builtin/nodes/display_image.md +1 -0
- package/builtin/nodes/display_markdown.md +1 -0
- package/builtin/nodes/display_mermaid.md +1 -0
- package/builtin/nodes/display_react_app.md +1 -0
- package/builtin/nodes/display_table.md +1 -0
- package/builtin/nodes/provide_bool.md +1 -0
- package/builtin/nodes/provide_file.md +1 -0
- package/builtin/nodes/provide_password.md +1 -0
- package/builtin/nodes/provide_str.md +1 -0
- package/builtin/nodes/tool_display_share_link.md +1 -0
- package/builtin/nodes/tool_get_env.md +2 -0
- package/builtin/nodes/tool_git_checkout.md +1 -0
- package/builtin/nodes/tool_git_worktree_load.md +1 -0
- package/builtin/nodes/tool_git_worktree_unload.md +1 -0
- package/builtin/nodes/tool_gitlab_create_mr.md +1 -0
- package/builtin/nodes/tool_jenkins_build.md +2 -0
- package/builtin/nodes/tool_load_key.md +2 -0
- package/builtin/nodes/tool_nodejs.md +17 -19
- package/builtin/nodes/tool_print.md +2 -0
- package/builtin/nodes/tool_save_key.md +2 -0
- package/builtin/nodes/tool_set_run_env.md +1 -0
- package/builtin/nodes/tool_user_ask.md +2 -0
- package/builtin/nodes/tool_user_check.md +2 -0
- package/builtin/nodes/tool_wecom_send_app_markdown.md +1 -0
- package/builtin/nodes/tool_wecom_send_group_markdown.md +1 -0
- package/builtin/nodes/workspace_one_click_task.md +44 -0
- package/builtin/nodes/workspace_run.md +16 -0
- package/builtin/nodes/workspace_scheduled_run.md +16 -0
- package/builtin/pipelines/module-migrate/scripts/gate.mjs +37 -0
- package/builtin/pipelines/module-migrate/scripts/static-check.mjs +82 -0
- package/builtin/pipelines/module-migrate/workspace.flow.js +172 -0
- package/builtin/pipelines/module-migrate/workspace.layout.json +134 -0
- package/builtin/pipelines/new/scripts/lint-flow.mjs +38 -0
- package/builtin/pipelines/new/workspace.flow.js +91 -0
- package/builtin/pipelines/new/workspace.layout.json +70 -0
- package/builtin/web-ui/dist/assets/{WorkflowAssistantThread-DPbR2UaN.js → WorkflowAssistantThread-CKClwj96.js} +1 -1
- package/builtin/web-ui/dist/assets/index-BZ5KqLur.js +870 -0
- package/builtin/web-ui/dist/assets/index-CEXmmwM2.css +1 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +2 -1
- package/reference/flow-control-capabilities.md +77 -158
- package/reference/flow-layout.md +1 -1
- package/reference/flow-prompt-handler-check.md +2 -2
- package/skills/agentflow-author-flow/SKILL.md +8 -47
- package/skills/agentflow-cli/SKILL.md +158 -25
- package/skills/agentflow-cli/agents/openai.yaml +2 -2
- package/skills/agentflow-cli/scripts/agentflow-cli.mjs +668 -18
- package/skills/agentflow-cli/scripts/agentflow-runtime.mjs +97 -0
- package/skills/agentflow-flow-add-instances/SKILL.md +7 -248
- package/skills/agentflow-flow-dsl/SKILL.md +206 -0
- package/skills/agentflow-flow-dsl/agents/openai.yaml +4 -0
- package/skills/agentflow-flow-dsl/references/node-calls.md +39 -0
- package/skills/agentflow-flow-edit-node-fields/SKILL.md +4 -73
- package/skills/agentflow-flow-recipes/SKILL.md +7 -18
- package/skills/agentflow-flow-recipes/references/recipes.md +97 -43
- package/skills/agentflow-flow-sync-ui/SKILL.md +3 -54
- package/skills/agentflow-node-dsl/SKILL.md +212 -0
- package/skills/agentflow-node-dsl/agents/openai.yaml +4 -0
- package/skills/agentflow-node-reference/SKILL.md +5 -4
- package/skills/agentflow-node-reference/references/builtin-nodes.md +166 -115
- package/skills/agentflow-placeholder-reference/SKILL.md +2 -2
- package/skills/agentflow-runtime-reference/SKILL.md +2 -2
- package/skills/agentflow-runtime-reference/references/runtime.md +1 -1
- package/skills/agentflow-workspace-ascii/SKILL.md +9 -16
- package/skills/agentflow-workspace-graph/SKILL.md +62 -48
- package/skills/agentflow-workspace-html/SKILL.md +7 -2
- package/skills/agentflow-workspace-image/SKILL.md +6 -2
- package/skills/agentflow-workspace-markdown/SKILL.md +14 -21
- package/skills/agentflow-workspace-mermaid/SKILL.md +8 -16
- package/bin/lib/api-runner.mjs +0 -387
- package/bin/lib/apply.mjs +0 -903
- package/bin/lib/composer-flow-instances.mjs +0 -68
- package/bin/lib/composer-flow-skeleton.mjs +0 -334
- package/bin/lib/composer-flow-validate.mjs +0 -47
- package/bin/lib/composer-model-router.mjs +0 -185
- package/bin/lib/composer-node-schema.mjs +0 -303
- package/bin/lib/composer-planner.mjs +0 -751
- package/bin/lib/composer-script-ops.mjs +0 -233
- package/bin/lib/flow-static-preview.mjs +0 -104
- package/bin/lib/hub-login.mjs +0 -54
- package/bin/lib/hub-publish.mjs +0 -159
- package/bin/lib/hub-remote.mjs +0 -189
- package/bin/lib/hub.mjs +0 -299
- package/bin/lib/jenkins.mjs +0 -380
- package/bin/lib/node-execute.mjs +0 -539
- package/bin/lib/normalize-node-tool-command.mjs +0 -97
- package/bin/lib/runtime-context.mjs +0 -243
- package/bin/lib/scheduler.mjs +0 -601
- package/bin/lib/ui-print.mjs +0 -94
- package/bin/pipeline/build-node-prompt.mjs +0 -271
- package/bin/pipeline/check-cache.mjs +0 -191
- package/bin/pipeline/check-flow.mjs +0 -543
- package/bin/pipeline/collect-nodes.mjs +0 -212
- package/bin/pipeline/compute-cache-md5.mjs +0 -177
- package/bin/pipeline/ensure-run-dir.mjs +0 -71
- package/bin/pipeline/gc.mjs +0 -129
- package/bin/pipeline/get-env.mjs +0 -59
- package/bin/pipeline/get-resolved-values.mjs +0 -344
- package/bin/pipeline/load-key.mjs +0 -62
- package/bin/pipeline/parse-flow.mjs +0 -708
- package/bin/pipeline/post-process-control-if.mjs +0 -23
- package/bin/pipeline/post-process-node.mjs +0 -490
- package/bin/pipeline/pre-process-node.mjs +0 -1430
- package/bin/pipeline/resolve-inputs.mjs +0 -201
- package/bin/pipeline/run-tool-nodejs.mjs +0 -167
- package/bin/pipeline/save-key.mjs +0 -93
- package/bin/pipeline/snapshot-prior-round.mjs +0 -70
- package/bin/pipeline/validate-for-ui.mjs +0 -234
- package/bin/pipeline/validate-script-output.mjs +0 -130
- package/bin/pipeline/write-result.mjs +0 -182
- package/builtin/pipelines/module-migrate/flow.yaml +0 -819
- package/builtin/pipelines/new/flow.yaml +0 -545
- package/builtin/pipelines/new/scripts/check-flow.mjs +0 -9
- package/builtin/pipelines/new/scripts/collect-nodes.mjs +0 -211
- package/builtin/web-ui/dist/assets/index-BSCpd5la.js +0 -889
- package/builtin/web-ui/dist/assets/index-DZ328oSo.css +0 -1
- package/skills/agentflow-node-authoring/SKILL.md +0 -57
package/README.md
CHANGED
|
@@ -65,30 +65,17 @@ npm install -g @fieldwangai/agentflow
|
|
|
65
65
|
# Launch Web UI (port 8765)
|
|
66
66
|
agentflow ui
|
|
67
67
|
|
|
68
|
-
#
|
|
69
|
-
agentflow
|
|
68
|
+
# Upload a Workspace graph to a server-side temporary preview project
|
|
69
|
+
node skills/agentflow-cli/scripts/agentflow-cli.mjs workspace-preview \
|
|
70
|
+
--file .workspace/agentflow/pipelines/my-flow/workspace.graph.json \
|
|
71
|
+
--ttl-seconds 7200
|
|
70
72
|
|
|
71
|
-
# Or run a flow directly
|
|
72
|
-
agentflow apply <FlowName>
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
## AgentFlow Hub
|
|
75
|
+
Runs are started from the Workspace graph in the Web UI, or on a schedule via a
|
|
76
|
+
`workspace_scheduled_run` node.
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# Browse flows from the command line
|
|
83
|
-
agentflow list-remote
|
|
84
|
-
|
|
85
|
-
# Download a flow
|
|
86
|
-
agentflow download <slug>
|
|
87
|
-
|
|
88
|
-
# Publish your flow to the Hub
|
|
89
|
-
agentflow login
|
|
90
|
-
agentflow publish <FlowName> --tags "migration,review"
|
|
91
|
-
```
|
|
78
|
+
From source: `git clone` → `npm install` → `npm link`.
|
|
92
79
|
|
|
93
80
|
## Creating Flows
|
|
94
81
|
|
|
@@ -108,25 +95,26 @@ Create a code review flow:
|
|
|
108
95
|
4. Loop until all pass
|
|
109
96
|
```
|
|
110
97
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
## Running & Recovery
|
|
98
|
+
Complex flows are built in three phases: topology → node details → wiring & validation (auto-repairs up to 5 times). Note the Workspace runtime executes a DAG — cyclic graphs are rejected, so describe check-then-fix work as forward steps rather than a loop.
|
|
114
99
|
|
|
115
|
-
|
|
116
|
-
# Execute
|
|
117
|
-
agentflow apply <FlowName>
|
|
100
|
+
## Running
|
|
118
101
|
|
|
119
|
-
|
|
120
|
-
|
|
102
|
+
Runs start from the Workspace graph: open the flow in the Web UI and hit **Run**, or add a
|
|
103
|
+
`workspace_scheduled_run` node for cron-driven runs. Every node's inputs, outputs and state
|
|
104
|
+
are persisted under the flow's run directory.
|
|
121
105
|
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
The legacy Start/End Pipeline runtime is retired — `agentflow apply` / `resume` / `replay`
|
|
107
|
+
and the `/api/flow/run*` endpoints no longer execute anything.
|
|
124
108
|
|
|
125
|
-
|
|
126
|
-
|
|
109
|
+
```bash
|
|
110
|
+
# Check node status of a run
|
|
111
|
+
agentflow run-status <FlowName> <uuid>
|
|
127
112
|
|
|
128
113
|
# View agent reasoning
|
|
129
114
|
agentflow extract-thinking <FlowName> <uuid>
|
|
115
|
+
|
|
116
|
+
# Validate a flow definition
|
|
117
|
+
agentflow validate <FlowName>
|
|
130
118
|
```
|
|
131
119
|
|
|
132
120
|
## Skills
|
|
@@ -158,7 +146,6 @@ For example, tell Codex/Cursor: “Use `agentflow-author-flow` to generate a Flo
|
|
|
158
146
|
|---------|-------------|
|
|
159
147
|
| `list` | List all pipelines |
|
|
160
148
|
| `ui` | Start Web UI |
|
|
161
|
-
| `flow preview <FlowName\|flow.yaml>` | Generate a single-file static Flow preview; use `--output` to choose the HTML path |
|
|
162
149
|
| `apply` | Execute flow |
|
|
163
150
|
| `validate` | Validate flow structure |
|
|
164
151
|
| `resume` | Resume from breakpoint |
|
package/README.zh-CN.md
CHANGED
|
@@ -64,30 +64,11 @@ npm install -g @fieldwangai/agentflow
|
|
|
64
64
|
# 启动 Web UI(端口 8765)
|
|
65
65
|
agentflow ui
|
|
66
66
|
|
|
67
|
-
# 生成并打开平台同款画布的单文件静态预览(无需本地服务)
|
|
68
|
-
agentflow flow preview ./my-flow/flow.yaml
|
|
69
|
-
|
|
70
|
-
# 或直接运行流程
|
|
71
|
-
agentflow apply <FlowName>
|
|
72
67
|
```
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## AgentFlow Hub
|
|
77
|
-
|
|
78
|
-
在 **[agentflow-hub.com](https://agentflow-hub.com)** 浏览、下载和分享社区工作流。
|
|
69
|
+
运行从 Web UI 的 Workspace 图发起;需要定时执行时在图里加 `workspace_scheduled_run` 节点。
|
|
79
70
|
|
|
80
|
-
|
|
81
|
-
# 浏览社区工作流
|
|
82
|
-
agentflow list-remote
|
|
83
|
-
|
|
84
|
-
# 下载工作流
|
|
85
|
-
agentflow download <slug>
|
|
86
|
-
|
|
87
|
-
# 发布你的工作流
|
|
88
|
-
agentflow login
|
|
89
|
-
agentflow publish <FlowName> --tags "migration,review"
|
|
90
|
-
```
|
|
71
|
+
从源码开发:`git clone` → `npm install` → `npm link`
|
|
91
72
|
|
|
92
73
|
## 创建流程
|
|
93
74
|
|
|
@@ -107,25 +88,25 @@ Web UI 中 — 新建流水线 → 从面板拖节点到画布 → 连线 →
|
|
|
107
88
|
4. 没通过就继续修,直到全过
|
|
108
89
|
```
|
|
109
90
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## 运行与恢复
|
|
91
|
+
复杂流程分三阶段构建:拓扑 → 节点详情 → 连线校验(自动修复最多 5 次)。注意 Workspace 运行时执行的是 DAG,有环的图会被拒绝,所以「检查—修复—复检」要描述成向前推进的步骤,而不是回环。
|
|
113
92
|
|
|
114
|
-
|
|
115
|
-
# 执行
|
|
116
|
-
agentflow apply <FlowName>
|
|
93
|
+
## 运行
|
|
117
94
|
|
|
118
|
-
|
|
119
|
-
|
|
95
|
+
运行从 Workspace 图发起:在 Web UI 打开流程点 **Run**,或在图里加 `workspace_scheduled_run`
|
|
96
|
+
节点做定时执行。每个节点的输入、输出与状态都会持久化到该流程的 run 目录。
|
|
120
97
|
|
|
121
|
-
|
|
122
|
-
|
|
98
|
+
旧版 Start/End Pipeline 运行时已下线 —— `agentflow apply` / `resume` / `replay` 与
|
|
99
|
+
`/api/flow/run*` 接口不再执行任何流程。
|
|
123
100
|
|
|
124
|
-
|
|
125
|
-
|
|
101
|
+
```bash
|
|
102
|
+
# 查看某次运行的节点状态
|
|
103
|
+
agentflow run-status <FlowName> <uuid>
|
|
126
104
|
|
|
127
105
|
# 查看 agent 推理过程
|
|
128
106
|
agentflow extract-thinking <FlowName> <uuid>
|
|
107
|
+
|
|
108
|
+
# 校验流程定义
|
|
109
|
+
agentflow validate <FlowName>
|
|
129
110
|
```
|
|
130
111
|
|
|
131
112
|
## 技能
|
|
@@ -157,7 +138,6 @@ AgentFlow 提供专用技能用于常见操作:
|
|
|
157
138
|
|------|------|
|
|
158
139
|
| `list` | 列出所有流水线 |
|
|
159
140
|
| `ui` | 启动 Web UI |
|
|
160
|
-
| `flow preview <FlowName\|flow.yaml>` | 生成平台同款画布的单文件静态 Flow 预览;可用 `--output` 指定 HTML |
|
|
161
141
|
| `apply` | 执行流程 |
|
|
162
142
|
| `validate` | 校验流程结构 |
|
|
163
143
|
| `resume` | 断点续跑 |
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
以代码实现为核心:理清需求与接口,编写或修改代码,确保可运行、通过类型检查与项目规范,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
先做规划(目标拆解、步骤与依赖、可选方案),再按规划执行并产出结果,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
侧重需求理解与拆解,按上述任务完成执行,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
侧重测试与验证,执行并产出结果,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
理解设计稿或规格(Figma、标注、描述),实现或调整组件与样式,保证布局、间距、层级、断点与 RTL
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
理解设计稿或规格(Figma、标注、描述),实现或调整组件与样式,保证布局、间距、层级、断点与 RTL 等与设计一致;必要时做走查与修正,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
按上述任务完成执行,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
Complete the task as described above. If the node involves file writing operations, they can be executed.
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
Complete the task as described above. If the node involves file writing operations, they can be executed.
|
|
31
|
+
|
|
32
|
+
**Returning the result**: the body of your final reply *is* this node's result. AgentFlow writes it to `AGENTFLOW_RESULT_FILE` for you — do not create that file and do not print a path. If the node declares extra output slots, emit exactly one agentflow envelope and nothing else:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<full result body, each line indented two spaces>
|
|
38
|
+
outParams:
|
|
39
|
+
<slotName>: <short value>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Reporting failure**: on a real failure, exit non-zero or state the reason in your reply — do not call any CLI to write status.
|
|
@@ -27,7 +27,17 @@ ${taskBody}
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
按上述任务完成执行,节点中如有写入文件的操作可以执行。
|
|
31
|
+
|
|
32
|
+
**结果回传**:最终回复的正文就是本节点的结果,AgentFlow 会自行写入 `AGENTFLOW_RESULT_FILE`——不要自己创建该文件,也不要输出文件路径。若节点声明了额外的 output 槽,则最终**只**输出一个 agentflow envelope:
|
|
33
|
+
|
|
33
34
|
```
|
|
35
|
+
---agentflow
|
|
36
|
+
result: |
|
|
37
|
+
<完整结果正文,每行缩进两个空格>
|
|
38
|
+
outParams:
|
|
39
|
+
<槽位名>: <短值>
|
|
40
|
+
---end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**失败上报**:任务明确失败时,直接以非零退出码结束,或在回复中说明失败原因——不要调用任何 CLI 写状态。
|
package/bin/agentflow.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* AgentFlow CLI
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* AgentFlow CLI entry point.
|
|
4
|
+
* Flow execution lives in the Workspace graph (Web UI Run / workspace_scheduled_run);
|
|
5
|
+
* this CLI covers catalog, validation, Hub and the local UI server.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { createRequire } from "module";
|
|
@@ -3,6 +3,7 @@ import path from "path";
|
|
|
3
3
|
import {
|
|
4
4
|
getAgentflowDataRoot,
|
|
5
5
|
getUserPipelinesRoot,
|
|
6
|
+
isFlowDir,
|
|
6
7
|
} from "./paths.mjs";
|
|
7
8
|
|
|
8
9
|
const CONFIG_FILENAME = "admin-builtin-pipelines.json";
|
|
@@ -57,7 +58,7 @@ export function resolveAdminBuiltinPipelineDir(flowId) {
|
|
|
57
58
|
const entry = config.promoted.find((item) => item.id === id);
|
|
58
59
|
if (!entry) return "";
|
|
59
60
|
const dir = path.join(getUserPipelinesRoot(entry.ownerUserId), entry.id);
|
|
60
|
-
return
|
|
61
|
+
return isFlowDir(dir) ? dir : "";
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
export function updateAdminBuiltinPipelineConfig(action, payload = {}, actor = {}) {
|
|
@@ -68,7 +69,7 @@ export function updateAdminBuiltinPipelineConfig(action, payload = {}, actor = {
|
|
|
68
69
|
const ownerUserId = String(payload.ownerUserId || actor.userId || "").trim();
|
|
69
70
|
if (!ownerUserId) return { ok: false, error: "Missing ownerUserId" };
|
|
70
71
|
const dir = path.join(getUserPipelinesRoot(ownerUserId), flowId);
|
|
71
|
-
if (!
|
|
72
|
+
if (!isFlowDir(dir)) return { ok: false, error: "Pipeline not found" };
|
|
72
73
|
const promoted = config.promoted.filter((item) => item.id !== flowId);
|
|
73
74
|
promoted.unshift({
|
|
74
75
|
id: flowId,
|