@fieldwangai/agentflow 0.1.156 → 0.1.159
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/flow-dsl/codegen.mjs +33 -22
- package/bin/lib/flow-dsl/parser.mjs +24 -4
- package/bin/lib/jenkins.mjs +368 -0
- package/bin/lib/legacy-flow-execution.mjs +0 -1
- package/bin/lib/locales/en.json +4 -0
- package/bin/lib/locales/zh.json +4 -0
- package/bin/lib/mcp-server.mjs +1 -0
- package/bin/lib/ui-server.mjs +72 -0
- package/bin/lib/workspace-routes.mjs +113 -9
- package/bin/lib/workspace-server.mjs +416 -9
- package/builtin/nodes/display_code.md +39 -0
- package/builtin/nodes/tool_jenkins_build.md +5 -4
- package/builtin/web-ui/dist/assets/{WorkflowAssistantThread-ClNxY2Wu.js → WorkflowAssistantThread-CY19DsYq.js} +1 -1
- package/builtin/web-ui/dist/assets/index-B9ppXv7e.css +1 -0
- package/builtin/web-ui/dist/assets/index-CdEQWRrp.js +872 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +1 -1
- package/skills/agentflow-flow-dsl/SKILL.md +14 -1
- package/skills/agentflow-flow-dsl/references/node-calls.md +2 -0
- package/skills/agentflow-node-dsl/SKILL.md +27 -3
- package/skills/agentflow-node-reference/references/builtin-nodes.md +16 -0
- package/builtin/web-ui/dist/assets/index-BJzMYRK3.js +0 -870
- package/builtin/web-ui/dist/assets/index-CEXmmwM2.css +0 -1
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
@keyframes af-app-loading-slide { from { transform: translateX(-115%); } to { transform: translateX(250%); } }
|
|
31
31
|
@media (prefers-reduced-motion: reduce) { .af-app-loading__track span { width: 100%; animation: none; } }
|
|
32
32
|
</style>
|
|
33
|
-
<script type="module" crossorigin src="/assets/index-
|
|
34
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
33
|
+
<script type="module" crossorigin src="/assets/index-CdEQWRrp.js"></script>
|
|
34
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B9ppXv7e.css">
|
|
35
35
|
</head>
|
|
36
36
|
<body>
|
|
37
37
|
<div id="root">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fieldwangai/agentflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.159",
|
|
4
4
|
"description": "Orchestration system for long-running complex agent tasks using Cursor, OpenCode, Claude Code, or Codex as execution backends",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/agentflow.mjs",
|
|
@@ -47,6 +47,19 @@ lint 不通过先修结构,不要排版。`layout` 默认只给缺坐标的新
|
|
|
47
47
|
自动排版按依赖从左到右放置,控制主链保持同一视觉轴,数据源放在上方,展示节点与同层主链
|
|
48
48
|
错开,分支纵向展开。不要为了“看起来差不多”自行猜坐标。
|
|
49
49
|
|
|
50
|
+
## 交付状态与用户验收
|
|
51
|
+
|
|
52
|
+
`lint`、`layout`、自动化测试和 Mock 外部服务都属于 **Agent 测试环境**。完成这些只能说
|
|
53
|
+
“开发验证通过,待生产同构验收”,不能说“可上线”。
|
|
54
|
+
|
|
55
|
+
完成流程后必须主动请用户在真实或生产同构环境做最终验收。给出精确的启动/输入步骤、
|
|
56
|
+
预期路径和结果、需要回传的日志或截图,并要求实际跑到流程终点。涉及 Jenkins、企业微信、
|
|
57
|
+
GitLab 等外部系统时,必须验证真实请求、账号权限、网络、环境变量、输出以及下游连线;Mock 结果
|
|
58
|
+
不能代替这一步。需要凭证或会产生外部副作用时,先获得用户确认。
|
|
59
|
+
|
|
60
|
+
用户明确确认实际流程跑通后,才能将状态更新为“生产同构验收通过,可发布/可上线”。如果流程里有
|
|
61
|
+
自定义代码节点,同时遵守 `agentflow-node-dsl` 里更严格的两级验证闸门。
|
|
62
|
+
|
|
50
63
|
## 图结构:workspace.flow.js
|
|
51
64
|
|
|
52
65
|
```js
|
|
@@ -191,7 +204,7 @@ const doc = display.html("使用说明", { content: file("docs/guide.html") });
|
|
|
191
204
|
| 要 AI 理解 / 判断 / 生成 | `agent.subAgent` |
|
|
192
205
|
| 行为由输入完全决定,逻辑复杂 | **建代码节点** `nodes/<name>/index.mjs` |
|
|
193
206
|
| 一行 shell 就能搞定 | `tool.nodejs("名字", {}, \`node -e "..."\`)` |
|
|
194
|
-
| 给用户看结果 | `display.markdown` / `.html` / `.chart` / `.table` |
|
|
207
|
+
| 给用户看结果 | `display.markdown` / `.code` / `.html` / `.chart` / `.table` |
|
|
195
208
|
| 加载 skills 给下游 agent | `control.loadSkills` → `skillsContext` |
|
|
196
209
|
| 加载知识库 / 代码仓 | `control.cdWorkspace` → `knowledgeContext` |
|
|
197
210
|
| 固定文本 / 密钥 | `provide.str` / `provide.password` |
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
| `control.userWorkspace` | — | workspaceContext:text, cwd:file |
|
|
16
16
|
| `display.ascii` | content:text | content:text |
|
|
17
17
|
| `display.chart` | content:text, filePath:file, workspaceContext:text | content:text |
|
|
18
|
+
| `display.code` | content:text, language:text, fileName:text, wrap:bool | content:text |
|
|
18
19
|
| `display.html` | content:text, filePath:file, workspaceContext:text | content:text |
|
|
19
20
|
| `display.image` | src:text, filePath:file, alt:text, workspaceContext:text | src:text |
|
|
20
21
|
| `display.markdown` | content:text | content:text |
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
| `tool.gitlabCreateMr` | repoPath:file, gitContext:text, workspaceContext:text, sourceBranch:text, targetBranch:text, title:text, description:text, draft:bool, labels:text, push:bool, remote:text, tokenEnv:text, gitlabApiBase:text, removeSourceBranch:bool, squash:bool | mrUrl:text, created:bool, mrIid:text, projectId:text, sourceBranch:text, targetBranch:text, title:text, message:text |
|
|
31
32
|
| `tool.gitWorktreeLoad` | repoPath:file, branch:text, worktreePath:file, pruneMissing:bool, force:bool, gitContext:text, workspaceContext:text | worktreePath:file, branch:text, commit:text, workspaceContext:text, gitContext:text |
|
|
32
33
|
| `tool.gitWorktreeUnload` | repoPath:file, worktreePath:file, gitContext:text, workspaceContext:text, force:bool, prune:bool | removed:bool, workspaceContext:text, message:text |
|
|
34
|
+
| `tool.jenkinsBuild` | job:text, parameters:text, credentialRef:text, pollInterval:text, timeout:text | status:text, url:text, qrUrl:text |
|
|
33
35
|
| `tool.nodejs` | workspaceContext:text, skillsContext:text, mcpContext:text | result:text |
|
|
34
36
|
| `tool.setRunEnv` | key:text, value:text, variables:text | keys:text, count:text |
|
|
35
37
|
| `tool.wecomSendAppMarkdown` | markdown:text, toUser:text, corpId:text, corpSecret:text, agentId:text, accessToken:text | sent:bool, message:text, response:text |
|
|
@@ -130,13 +130,37 @@ await fs.writeFile(p, csvText); await fs.writeFile(outputs.deduped, p); // ✗
|
|
|
130
130
|
`node_modules`;跨端包当前只应依赖 Node 内置模块或包内自带源码。
|
|
131
131
|
和 `workspace.flow.js` 那种「禁一切控制流」的结构文件完全两套规则。
|
|
132
132
|
|
|
133
|
-
##
|
|
133
|
+
## 两级验证与上线闸门
|
|
134
|
+
|
|
135
|
+
节点实现后必须把验证分成两级,不得把 Agent 自己的测试冒充成上线验收。
|
|
136
|
+
|
|
137
|
+
### A. Agent 测试环境(开发验证)
|
|
138
|
+
|
|
139
|
+
Agent 自行完成且保留可重现证据:
|
|
140
|
+
|
|
141
|
+
- 单元测试、声明/引脚契约测试、错误与恢复路径
|
|
142
|
+
- Mock 或隔离沙箱中的端到端流程
|
|
143
|
+
- DSL lint、画布实际执行、输入输出和下游连线
|
|
144
|
+
- 节点包含 `scripts/` / `templates/` / `assets/` 时,用完整 ZIP 安装后再跑一次,不得只测 `index.mjs`
|
|
134
145
|
|
|
135
146
|
```bash
|
|
136
|
-
agentflow flow dsl lint <flowDir>
|
|
147
|
+
agentflow flow dsl lint <flowDir>
|
|
137
148
|
```
|
|
138
149
|
|
|
139
|
-
|
|
150
|
+
这一级通过后只能汇报:**开发验证通过,待生产同构验收**。
|
|
151
|
+
|
|
152
|
+
### B. 用户生产同构验收(上线前必须)
|
|
153
|
+
|
|
154
|
+
完成 A 后必须主动请求用户做最终跑通,不得自行判定“可上线”。先交付一份简短验收单:
|
|
155
|
+
|
|
156
|
+
- 使用的真实/预发服务、账号权限、网络、环境变量和完整节点包
|
|
157
|
+
- 用户要执行的精确操作与输入;会触发外部副作用时先说明
|
|
158
|
+
- 预期的节点状态、输出、下游行为,以及失败/超时/重启恢复等关键路径
|
|
159
|
+
- 需要回传的截图、日志、产物 URL 或其他证据
|
|
160
|
+
|
|
161
|
+
对 Jenkins、企业微信、GitLab 等外部系统,Mock 成功不能代替真实服务验收;最终流程必须真正触发外部系统并跑到下游。如果需要凭证或会产生外部副作用,等用户提供/确认后再执行。
|
|
162
|
+
|
|
163
|
+
只有用户明确确认 B 通过,才能汇报:**生产同构验收通过,可发布/可上线**。在此之前必须将任务状态说成“待用户验收”,不得说“已完成”、“已可上线”或“全流程已跑通”。
|
|
140
164
|
|
|
141
165
|
## 发布给别的流程用
|
|
142
166
|
|
|
@@ -128,6 +128,14 @@
|
|
|
128
128
|
- Inputs: 0. `prev`:node; 1. `repoPath`:file; 2. `gitContext`:text; 3. `workspaceContext`:text; 4. `sourceBranch`:text; 5. `targetBranch`:text; 6. `title`:text; 7. `description`:text; 8. `draft`:bool = false; 9. `labels`:text; 10. `push`:bool = true; 11. `remote`:text = origin; 12. `tokenEnv`:text; 13. `gitlabApiBase`:text; 14. `removeSourceBranch`:bool = false; 15. `squash`:bool = false
|
|
129
129
|
- Outputs: 0. `next`:node; 1. `mrUrl`:text; 2. `created`:bool; 3. `mrIid`:text; 4. `projectId`:text; 5. `sourceBranch`:text; 6. `targetBranch`:text; 7. `title`:text; 8. `message`:text
|
|
130
130
|
|
|
131
|
+
### tool_jenkins_build
|
|
132
|
+
|
|
133
|
+
- Display: Jenkins Build
|
|
134
|
+
- Description: Trigger one Jenkins job and durably monitor it until completion. The node persists queue/build checkpoints and uses server-side deferred polling at `pollInterval`: the Workspace request returns in a waiting state instead of keeping an HTTP request or worker asleep. The AgentFlow server registry wakes the flow again and continues downstream after completion. An existing queueId/buildNumber is reused after a run or AgentFlow server interruption, so a resumed run does not trigger the job again. Jenkins FAILURE/ABORTED/TIMEOUT are business outcomes and continue to downstream notification nodes. Authentication, configuration, and repeated platform request errors fail the AgentFlow node. Credentials are read from environment configuration. `credentialRef: team-ci` selects `JENKINS_TEAM_CI_BASE_URL`, `JENKINS_TEAM_CI_USERNAME`, and `JENKINS_TEAM_CI_TOKEN`, falling back to the standard `JENKINS_BASE_URL`, `JENKINS_USERNAME`, and `JENKINS_TOKEN` variables.
|
|
135
|
+
- Runtime: local-only
|
|
136
|
+
- Inputs: 0. `prev`:node; 1. `job`:text; 2. `parameters`:text = {}; 3. `credentialRef`:text; 4. `pollInterval`:text = 30s; 5. `timeout`:text = 2h
|
|
137
|
+
- Outputs: 0. `next`:node; 1. `status`:text; 2. `url`:text; 3. `qrUrl`:text
|
|
138
|
+
|
|
131
139
|
### tool_nodejs
|
|
132
140
|
|
|
133
141
|
- Display: NodeJs
|
|
@@ -178,6 +186,14 @@
|
|
|
178
186
|
- Inputs: 0. `prev`:node; 1. `content`:text; 2. `filePath`:file; 3. `workspaceContext`:text
|
|
179
187
|
- Outputs: 0. `content`:text; 1. `next`:node
|
|
180
188
|
|
|
189
|
+
### display_code
|
|
190
|
+
|
|
191
|
+
- Display: Code Display
|
|
192
|
+
- Description: Display source code with language highlighting, line numbers, copy, wrap, and download controls; passes content downstream as text
|
|
193
|
+
- Runtime: local-only
|
|
194
|
+
- Inputs: 0. `prev`:node; 1. `content`:text; 2. `language`:text; 3. `fileName`:text; 4. `wrap`:bool = false
|
|
195
|
+
- Outputs: 0. `content`:text; 1. `next`:node
|
|
196
|
+
|
|
181
197
|
### display_html
|
|
182
198
|
|
|
183
199
|
- Display: HTML Display
|