@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.
Files changed (195) hide show
  1. package/README.md +20 -33
  2. package/README.zh-CN.md +14 -34
  3. package/agents/agentflow-node-executor-code.md +13 -3
  4. package/agents/agentflow-node-executor-planning.md +13 -3
  5. package/agents/agentflow-node-executor-requirement.md +13 -3
  6. package/agents/agentflow-node-executor-test.md +13 -3
  7. package/agents/agentflow-node-executor-ui.md +13 -3
  8. package/agents/agentflow-node-executor.md +13 -3
  9. package/agents/en/agentflow-node-executor.md +13 -3
  10. package/agents/zh/agentflow-node-executor.md +13 -3
  11. package/bin/agentflow.mjs +3 -3
  12. package/bin/lib/admin-builtin-pipelines.mjs +3 -2
  13. package/bin/lib/agent-runners.mjs +0 -929
  14. package/bin/lib/auth.mjs +2 -1
  15. package/bin/lib/catalog-agents.mjs +2 -1
  16. package/bin/lib/catalog-flows.mjs +167 -88
  17. package/bin/lib/composer-agent.mjs +3 -793
  18. package/bin/lib/composer-skill-router.mjs +3 -323
  19. package/bin/lib/exec-buffered.mjs +32 -0
  20. package/bin/lib/flow-dsl/cli.mjs +276 -0
  21. package/bin/lib/flow-dsl/codegen.mjs +358 -0
  22. package/bin/lib/flow-dsl/defs.mjs +103 -0
  23. package/bin/lib/flow-dsl/index.mjs +77 -0
  24. package/bin/lib/flow-dsl/ir.mjs +305 -0
  25. package/bin/lib/flow-dsl/layout.mjs +115 -0
  26. package/bin/lib/flow-dsl/legacy-yaml.mjs +268 -0
  27. package/bin/lib/flow-dsl/lint.mjs +241 -0
  28. package/bin/lib/flow-dsl/packages.mjs +251 -0
  29. package/bin/lib/flow-dsl/parser.mjs +444 -0
  30. package/bin/lib/flow-import.mjs +96 -26
  31. package/bin/lib/flow-write.mjs +48 -12
  32. package/bin/lib/help.mjs +10 -30
  33. package/bin/lib/html-escape.mjs +19 -0
  34. package/bin/lib/http-util.mjs +49 -0
  35. package/bin/lib/legacy-flow-execution.mjs +43 -0
  36. package/bin/lib/locales/en.json +1 -1
  37. package/bin/lib/locales/zh.json +1 -1
  38. package/bin/lib/main.mjs +153 -283
  39. package/bin/lib/marketplace.mjs +206 -61
  40. package/bin/lib/model-config.mjs +10 -0
  41. package/bin/lib/node-package-archive.mjs +240 -0
  42. package/bin/lib/node-package-bootstrap.mjs +72 -0
  43. package/bin/lib/node-package-manifest.mjs +174 -0
  44. package/bin/lib/paths.mjs +42 -19
  45. package/bin/lib/prd-workflow-routes.mjs +2949 -0
  46. package/bin/lib/prd-workflow-server.mjs +4884 -0
  47. package/bin/lib/run-events.mjs +0 -66
  48. package/bin/lib/schedule-config.mjs +4 -4
  49. package/bin/lib/skill-runtime.mjs +35 -0
  50. package/bin/lib/startup-storage-migrations.mjs +274 -0
  51. package/bin/lib/ui-server.mjs +1106 -18013
  52. package/bin/lib/user-env.mjs +16 -0
  53. package/bin/lib/workspace-auto-layout.mjs +234 -0
  54. package/bin/lib/workspace-flow-store.mjs +478 -0
  55. package/bin/lib/workspace-graph-merge.mjs +41 -34
  56. package/bin/lib/workspace-preview.mjs +74 -0
  57. package/bin/lib/workspace-routes.mjs +3088 -0
  58. package/bin/lib/workspace-server.mjs +6199 -0
  59. package/bin/lib/workspace-state.mjs +331 -0
  60. package/bin/lib/workspace.mjs +2 -1
  61. package/builtin/nodes/agent_subAgent.md +1 -0
  62. package/builtin/nodes/control_agent_toBool.md +2 -0
  63. package/builtin/nodes/control_anyOne.md +2 -0
  64. package/builtin/nodes/control_cancelled.md +2 -0
  65. package/builtin/nodes/control_cd_workspace.md +5 -11
  66. package/builtin/nodes/control_delay.md +2 -0
  67. package/builtin/nodes/control_end.md +2 -0
  68. package/builtin/nodes/control_if.md +1 -0
  69. package/builtin/nodes/control_interval_loop.md +2 -0
  70. package/builtin/nodes/control_load_mcp.md +24 -0
  71. package/builtin/nodes/control_load_skills.md +8 -23
  72. package/builtin/nodes/control_start.md +2 -0
  73. package/builtin/nodes/control_toBool.md +2 -0
  74. package/builtin/nodes/control_user_workspace.md +2 -0
  75. package/builtin/nodes/control_wait_until.md +2 -0
  76. package/builtin/nodes/display_ascii.md +1 -0
  77. package/builtin/nodes/display_chart.md +1 -0
  78. package/builtin/nodes/display_html.md +1 -0
  79. package/builtin/nodes/display_image.md +1 -0
  80. package/builtin/nodes/display_markdown.md +1 -0
  81. package/builtin/nodes/display_mermaid.md +1 -0
  82. package/builtin/nodes/display_react_app.md +1 -0
  83. package/builtin/nodes/display_table.md +1 -0
  84. package/builtin/nodes/provide_bool.md +1 -0
  85. package/builtin/nodes/provide_file.md +1 -0
  86. package/builtin/nodes/provide_password.md +1 -0
  87. package/builtin/nodes/provide_str.md +1 -0
  88. package/builtin/nodes/tool_display_share_link.md +1 -0
  89. package/builtin/nodes/tool_get_env.md +2 -0
  90. package/builtin/nodes/tool_git_checkout.md +1 -0
  91. package/builtin/nodes/tool_git_worktree_load.md +1 -0
  92. package/builtin/nodes/tool_git_worktree_unload.md +1 -0
  93. package/builtin/nodes/tool_gitlab_create_mr.md +1 -0
  94. package/builtin/nodes/tool_jenkins_build.md +2 -0
  95. package/builtin/nodes/tool_load_key.md +2 -0
  96. package/builtin/nodes/tool_nodejs.md +17 -19
  97. package/builtin/nodes/tool_print.md +2 -0
  98. package/builtin/nodes/tool_save_key.md +2 -0
  99. package/builtin/nodes/tool_set_run_env.md +1 -0
  100. package/builtin/nodes/tool_user_ask.md +2 -0
  101. package/builtin/nodes/tool_user_check.md +2 -0
  102. package/builtin/nodes/tool_wecom_send_app_markdown.md +1 -0
  103. package/builtin/nodes/tool_wecom_send_group_markdown.md +1 -0
  104. package/builtin/nodes/workspace_one_click_task.md +44 -0
  105. package/builtin/nodes/workspace_run.md +16 -0
  106. package/builtin/nodes/workspace_scheduled_run.md +16 -0
  107. package/builtin/pipelines/module-migrate/scripts/gate.mjs +37 -0
  108. package/builtin/pipelines/module-migrate/scripts/static-check.mjs +82 -0
  109. package/builtin/pipelines/module-migrate/workspace.flow.js +172 -0
  110. package/builtin/pipelines/module-migrate/workspace.layout.json +134 -0
  111. package/builtin/pipelines/new/scripts/lint-flow.mjs +38 -0
  112. package/builtin/pipelines/new/workspace.flow.js +91 -0
  113. package/builtin/pipelines/new/workspace.layout.json +70 -0
  114. package/builtin/web-ui/dist/assets/{WorkflowAssistantThread-DPbR2UaN.js → WorkflowAssistantThread-CKClwj96.js} +1 -1
  115. package/builtin/web-ui/dist/assets/index-BZ5KqLur.js +870 -0
  116. package/builtin/web-ui/dist/assets/index-CEXmmwM2.css +1 -0
  117. package/builtin/web-ui/dist/index.html +2 -2
  118. package/package.json +2 -1
  119. package/reference/flow-control-capabilities.md +77 -158
  120. package/reference/flow-layout.md +1 -1
  121. package/reference/flow-prompt-handler-check.md +2 -2
  122. package/skills/agentflow-author-flow/SKILL.md +8 -47
  123. package/skills/agentflow-cli/SKILL.md +158 -25
  124. package/skills/agentflow-cli/agents/openai.yaml +2 -2
  125. package/skills/agentflow-cli/scripts/agentflow-cli.mjs +668 -18
  126. package/skills/agentflow-cli/scripts/agentflow-runtime.mjs +97 -0
  127. package/skills/agentflow-flow-add-instances/SKILL.md +7 -248
  128. package/skills/agentflow-flow-dsl/SKILL.md +206 -0
  129. package/skills/agentflow-flow-dsl/agents/openai.yaml +4 -0
  130. package/skills/agentflow-flow-dsl/references/node-calls.md +39 -0
  131. package/skills/agentflow-flow-edit-node-fields/SKILL.md +4 -73
  132. package/skills/agentflow-flow-recipes/SKILL.md +7 -18
  133. package/skills/agentflow-flow-recipes/references/recipes.md +97 -43
  134. package/skills/agentflow-flow-sync-ui/SKILL.md +3 -54
  135. package/skills/agentflow-node-dsl/SKILL.md +212 -0
  136. package/skills/agentflow-node-dsl/agents/openai.yaml +4 -0
  137. package/skills/agentflow-node-reference/SKILL.md +5 -4
  138. package/skills/agentflow-node-reference/references/builtin-nodes.md +166 -115
  139. package/skills/agentflow-placeholder-reference/SKILL.md +2 -2
  140. package/skills/agentflow-runtime-reference/SKILL.md +2 -2
  141. package/skills/agentflow-runtime-reference/references/runtime.md +1 -1
  142. package/skills/agentflow-workspace-ascii/SKILL.md +9 -16
  143. package/skills/agentflow-workspace-graph/SKILL.md +62 -48
  144. package/skills/agentflow-workspace-html/SKILL.md +7 -2
  145. package/skills/agentflow-workspace-image/SKILL.md +6 -2
  146. package/skills/agentflow-workspace-markdown/SKILL.md +14 -21
  147. package/skills/agentflow-workspace-mermaid/SKILL.md +8 -16
  148. package/bin/lib/api-runner.mjs +0 -387
  149. package/bin/lib/apply.mjs +0 -903
  150. package/bin/lib/composer-flow-instances.mjs +0 -68
  151. package/bin/lib/composer-flow-skeleton.mjs +0 -334
  152. package/bin/lib/composer-flow-validate.mjs +0 -47
  153. package/bin/lib/composer-model-router.mjs +0 -185
  154. package/bin/lib/composer-node-schema.mjs +0 -303
  155. package/bin/lib/composer-planner.mjs +0 -751
  156. package/bin/lib/composer-script-ops.mjs +0 -233
  157. package/bin/lib/flow-static-preview.mjs +0 -104
  158. package/bin/lib/hub-login.mjs +0 -54
  159. package/bin/lib/hub-publish.mjs +0 -159
  160. package/bin/lib/hub-remote.mjs +0 -189
  161. package/bin/lib/hub.mjs +0 -299
  162. package/bin/lib/jenkins.mjs +0 -380
  163. package/bin/lib/node-execute.mjs +0 -539
  164. package/bin/lib/normalize-node-tool-command.mjs +0 -97
  165. package/bin/lib/runtime-context.mjs +0 -243
  166. package/bin/lib/scheduler.mjs +0 -601
  167. package/bin/lib/ui-print.mjs +0 -94
  168. package/bin/pipeline/build-node-prompt.mjs +0 -271
  169. package/bin/pipeline/check-cache.mjs +0 -191
  170. package/bin/pipeline/check-flow.mjs +0 -543
  171. package/bin/pipeline/collect-nodes.mjs +0 -212
  172. package/bin/pipeline/compute-cache-md5.mjs +0 -177
  173. package/bin/pipeline/ensure-run-dir.mjs +0 -71
  174. package/bin/pipeline/gc.mjs +0 -129
  175. package/bin/pipeline/get-env.mjs +0 -59
  176. package/bin/pipeline/get-resolved-values.mjs +0 -344
  177. package/bin/pipeline/load-key.mjs +0 -62
  178. package/bin/pipeline/parse-flow.mjs +0 -708
  179. package/bin/pipeline/post-process-control-if.mjs +0 -23
  180. package/bin/pipeline/post-process-node.mjs +0 -490
  181. package/bin/pipeline/pre-process-node.mjs +0 -1430
  182. package/bin/pipeline/resolve-inputs.mjs +0 -201
  183. package/bin/pipeline/run-tool-nodejs.mjs +0 -167
  184. package/bin/pipeline/save-key.mjs +0 -93
  185. package/bin/pipeline/snapshot-prior-round.mjs +0 -70
  186. package/bin/pipeline/validate-for-ui.mjs +0 -234
  187. package/bin/pipeline/validate-script-output.mjs +0 -130
  188. package/bin/pipeline/write-result.mjs +0 -182
  189. package/builtin/pipelines/module-migrate/flow.yaml +0 -819
  190. package/builtin/pipelines/new/flow.yaml +0 -545
  191. package/builtin/pipelines/new/scripts/check-flow.mjs +0 -9
  192. package/builtin/pipelines/new/scripts/collect-nodes.mjs +0 -211
  193. package/builtin/web-ui/dist/assets/index-BSCpd5la.js +0 -889
  194. package/builtin/web-ui/dist/assets/index-DZ328oSo.css +0 -1
  195. package/skills/agentflow-node-authoring/SKILL.md +0 -57
@@ -7,75 +7,36 @@
7
7
  - `tool_nodejs` needs an executable `script`; `body` is documentation when `script` exists.
8
8
  - `agent_subAgent` is for semantic/code/text reasoning tasks.
9
9
  - Local-only nodes are executed by AgentFlow runtime and do not call an agent.
10
+ - The Workspace runtime executes a DAG; cyclic graphs are rejected. Express check-then-fix as forward steps.
10
11
  - Edge handles are positional: `input-0`, `output-0`, etc. Match slot order exactly.
11
12
 
12
13
  ## agent
13
14
 
14
15
  ### agent_subAgent
15
16
 
16
- - Display: SubAgent
17
- - Description: 利用 SubAgent 执行任务;可接收 workspaceContext 切换执行工作区,并接收 skillsContext 注入已加载 skills
17
+ - Display: 子 Agent
18
+ - Description: 利用子 Agent 执行任务;可接收 knowledgeContext 读取知识库,可接收 workspaceContext 切换执行工作区,并接收 skillsContext / mcpContext 注入已加载 skills 与 MCP 工具清单。
18
19
  - Runtime: agent/runner
19
- - Inputs: 0. `prev`:node; 1. `workspaceContext`:text; 2. `skillsContext`:text
20
- - Outputs: 0. `next`:node
21
-
22
- ## control
23
-
24
- ### control_agent_toBool
25
-
26
- - Display: Agent ToBool
27
- - Description: AI-powered boolean judgment: an agent evaluates the input value and writes true/false to prediction. Use for non-deterministic scenarios requiring semantic understanding.
28
- - Runtime: agent/runner
29
- - Inputs: 0. `prev`:node; 1. `value`:text
30
- - Outputs: 0. `next`:node; 1. `prediction`:bool
20
+ - Inputs: 0. `prev`:node; 1. `workspaceContext`:text; 2. `skillsContext`:text; 3. `mcpContext`:text; 4. `knowledgeContext`:text
21
+ - Outputs: 0. `next`:node; 1. `result`:text
31
22
 
32
- ### control_anyOne
23
+ ### workspace_one_click_task
33
24
 
34
- - Display: AnyOne
35
- - Description: Continues to next when any upstream input is ready
25
+ - Display: 一键任务
26
+ - Description: 输入任务描述,选择 Skills、workspace 上下文和输出类型后直接运行;等价于「Load Skills + Agent + Display」的合并节点。
36
27
  - Runtime: agent/runner
37
- - Inputs: 0. `prev1`:node; 1. `prev2`:node
38
- - Outputs: 0. `next`:node
28
+ - Inputs: 0. `prev`:node; 1. `skillKeys`:text; 2. `includeWorkspaceContext`:bool = true; 3. `displayType`:text = markdown; 4. `knowledgeContext`:text; 5. `workspaceContext`:text
29
+ - Outputs: 0. `next`:node; 1. `content`:text; 2. `displayType`:text = markdown
39
30
 
40
- ### control_cancelled
41
-
42
- - Display: Cancelled
43
- - Description: Check whether the current run/watch has been cancelled. Use cancelled output with control_if.
44
- - Runtime: local-only
45
- - Inputs: 0. `prev`:node; 1. `watchId`:text
46
- - Outputs: 0. `next`:node; 1. `cancelled`:bool
31
+ ## control
47
32
 
48
33
  ### control_cd_workspace
49
34
 
50
- - Display: CD Workspace
51
- - Description: Switch the runtime workspace context for downstream nodes without changing the AgentFlow pipeline workspace. Modes: - `set`: switch to target, keep previous stack unchanged. - `push`: switch to target and save the incoming context as previous. - `pop`: restore the previous context. `target` supports `${workspaceRoot}`, `${pipelineWorkspace}`, `${flowDir}`, absolute paths, and paths relative to current workspace context.
52
- - Runtime: local-only
53
- - Inputs: 0. `prev`:node; 1. `target`:text = ${pipelineWorkspace}; 2. `mode`:text = set; 3. `label`:text; 4. `workspaceContext`:text
54
- - Outputs: 0. `next`:node; 1. `workspaceContext`:text; 2. `cwd`:file; 3. `previous`:text
55
-
56
- ### control_deadline
57
-
58
- - Display: Deadline
59
- - Description: Compute whether a deadline has expired. Use expired output with control_if.
60
- - Runtime: local-only
61
- - Inputs: 0. `prev`:node; 1. `startAt`:text; 2. `duration`:text; 3. `deadlineAt`:text; 4. `timezone`:text = Asia/Shanghai
62
- - Outputs: 0. `next`:node; 1. `expired`:bool; 2. `deadlineAt`:text
63
-
64
- ### control_delay
65
-
66
- - Display: Delay
67
- - Description: Persistently wait for a relative duration, then continue when scheduler resumes this run.
68
- - Runtime: local-only
69
- - Inputs: 0. `prev`:node; 1. `duration`:text = 10m
70
- - Outputs: 0. `next`:node; 1. `wakeAt`:text
71
-
72
- ### control_end
73
-
74
- - Display: End
75
- - Description: End point of AgentFlow, flow terminates after this node
35
+ - Display: 加载知识库
36
+ - Description: Load one or more read-only knowledge sources for downstream Agent nodes. This node does not change the runtime cwd. It publishes `knowledgeContext` for reading/searching referenced repos or folders. `workspaceContext` and `cwd` are retained as legacy compatibility outputs for the first source.
76
37
  - Runtime: local-only
77
- - Inputs: 0. `prev`:node
78
- - Outputs:
38
+ - Inputs: 0. `prev`:node; 1. `path`:text; 2. `label`:text; 3. `knowledgeContext`:text; 4. `workspaceContext`:text
39
+ - Outputs: 0. `next`:node; 1. `knowledgeContext`:text; 2. `workspaceContext`:text; 3. `cwd`:file
79
40
 
80
41
  ### control_if
81
42
 
@@ -85,114 +46,196 @@
85
46
  - Inputs: 0. `prev`:node; 1. `prediction`:bool
86
47
  - Outputs: 0. `next1`:node; 1. `next2`:node
87
48
 
88
- ### control_interval_loop
49
+ ### control_load_mcp
89
50
 
90
- - Display: IntervalLoop
91
- - Description: Wait by interval and branch to continue, done, timeout, or cancelled for watch-style flows.
51
+ - Display: Load MCP
52
+ - Description: 加载所选 Cursor MCP Server 的工具清单,通过 mcpContext 传给下游 agent 节点。
92
53
  - Runtime: local-only
93
- - Inputs: 0. `prev`:node; 1. `done`:bool; 2. `cancelled`:bool; 3. `interval`:text = 10m; 4. `startAt`:text; 5. `duration`:text; 6. `deadlineAt`:text; 7. `timezone`:text = Asia/Shanghai
94
- - Outputs: 0. `continue`:node; 1. `done`:node; 2. `timeout`:node; 3. `cancelled`:node; 4. `wakeAt`:text; 5. `expired`:bool; 6. `deadlineAt`:text
54
+ - Inputs: 0. `prev`:node; 1. `serverNames`:text
55
+ - Outputs: 0. `next`:node; 1. `mcpContext`:text
95
56
 
96
57
  ### control_load_skills
97
58
 
98
59
  - Display: Load Skills
99
- - Description: Load SKILL.md files from the current workspace context, pipeline workspace, explicit paths, or both. The output `skillsContext` can be connected to downstream agent nodes. Loaded skills are injected into the node prompt under "已加载 Skills". Sources: - `current-workspace` - `pipeline-workspace` - `explicit-paths` - `all` Merge modes: - `replace` - `append` - `prepend`
60
+ - Description: Load the currently selected Workspace skill collection for downstream agent nodes. Set `skillKeys` to skill names or registry keys, then connect `skillsContext` to downstream agent/tool nodes. Loaded skills are injected into the node prompt under "已加载 Skills" Skill key examples: - `agentflow-flow-add-instances` - `workspace-agents:agentflow-flow-edit-node-fields` - `global-codex:some-skill`
100
61
  - Runtime: local-only
101
- - Inputs: 0. `prev`:node; 1. `source`:text = current-workspace; 2. `paths`:text; 3. `include`:text; 4. `exclude`:text; 5. `mergeMode`:text = replace; 6. `workspaceContext`:text; 7. `skillsContext`:text
102
- - Outputs: 0. `next`:node; 1. `skillsContext`:text; 2. `loadedCount`:text; 3. `summary`:text
62
+ - Inputs: 0. `prev`:node; 1. `skillKeys`:text
63
+ - Outputs: 0. `next`:node; 1. `skillsContext`:text
103
64
 
104
- ### control_start
65
+ ### control_user_workspace
105
66
 
106
- - Display: Start
107
- - Description: Entry point of AgentFlow, all flows should start from this node
67
+ - Display: User Workspace
68
+ - Description: Output a workspace context pointing to the current user's home directory.
108
69
  - Runtime: local-only
109
- - Inputs:
110
- - Outputs: 0. `next`:node
70
+ - Inputs: 0. `prev`:node
71
+ - Outputs: 0. `next`:node; 1. `workspaceContext`:text; 2. `cwd`:file
111
72
 
112
- ### control_toBool
73
+ ### workspace_run
113
74
 
114
- - Display: ToBool
115
- - Description: Script-based boolean conversion: executes script to produce true/false prediction. Like tool_nodejs but enforces bool output. Must have script field.
116
- - Runtime: agent/runner
117
- - Inputs: 0. `prev`:node; 1. `value`:text
118
- - Outputs: 0. `next`:node; 1. `prediction`:bool
75
+ - Display: Run
76
+ - Description: Workspace 图的运行入口。点击运行时,从本节点出发沿控制边选出子图并执行;本节点自身不产生输出。
77
+ - Runtime: local-only
78
+ - Inputs: 0. `prev`:node
79
+ - Outputs: 0. `next`:node
119
80
 
120
- ### control_wait_until
81
+ ### workspace_scheduled_run
121
82
 
122
- - Display: WaitUntil
123
- - Description: Persistently wait until an absolute time, then continue when scheduler resumes this run.
83
+ - Display: Scheduled Run
84
+ - Description: 定时运行入口。与 Run 相同的执行语义,区别是由调度器按节点 body 中的 JSON 排程配置触发。
124
85
  - Runtime: local-only
125
- - Inputs: 0. `prev`:node; 1. `until`:text; 2. `timezone`:text = Asia/Shanghai
126
- - Outputs: 0. `next`:node; 1. `wakeAt`:text
86
+ - Inputs: 0. `prev`:node
87
+ - Outputs: 0. `next`:node
127
88
 
128
89
  ## tool
129
90
 
130
- ### tool_get_env
91
+ ### tool_display_share_link
131
92
 
132
- - Display: GetEnv
133
- - Description: Get environment variable value
134
- - Runtime: agent/runner
135
- - Inputs: 0. `key`:text
136
- - Outputs: 0. `value`:text
93
+ - Display: Display Share Link
94
+ - Description: Create a public share link for upstream Display nodes
95
+ - Runtime: local-only
96
+ - Inputs: 0. `prev`:node; 1. `title`:text; 2. `layout`:text = single; 3. `nodeIds`:text; 4. `baseUrl`:text
97
+ - Outputs: 0. `next`:node; 1. `url`:text; 2. `shareId`:text; 3. `expiresAt`:text
137
98
 
138
99
  ### tool_git_checkout
139
100
 
140
101
  - Display: Git Checkout
141
- - Description: Clone or update a Git repository and expose it as a workspace context for downstream nodes. - `repoUrl` is required. - `targetDir` may be absolute or relative to the current workspace context. - If `targetDir` is empty, the repository is cloned into `${pipelineWorkspace}/.workspace/agentflow/git-repos/<repo-name>`. - Set `includeSubmodules` to `true` to clone/update Git submodules recursively. - The `workspaceContext` output can be connected to CD Workspace, Load Skills, agent, or tool nodes.
102
+ - Description: Clone or update a Git repository and expose it as a workspace context for downstream nodes. - `repoUrl` is required. - `targetDir` may be absolute or relative to the current workspace context. - If `targetDir` is empty, the repository is cloned into `${pipelineWorkspace}/.workspace/agentflow/git-repos/<repo-name>`. For user pipelines, `${pipelineWorkspace}` follows the Admin Settings AgentFlow Data Root. - Set `includeSubmodules` to `true` to clone/update Git submodules recursively. - The `workspaceContext` output can be connected to CD Workspace, Load Skills, agent, or tool nodes. - The `gitContext` output can be connected to Worktree, GitLab MR, or other Git nodes.
142
103
  - Runtime: local-only
143
- - Inputs: 0. `prev`:node; 1. `repoUrl`:text; 2. `branch`:text; 3. `targetDir`:text; 4. `pullIfExists`:bool = true; 5. `includeSubmodules`:bool = false; 6. `workspaceContext`:text
144
- - Outputs: 0. `next`:node; 1. `repoPath`:file; 2. `branch`:text; 3. `commit`:text; 4. `changed`:bool; 5. `workspaceContext`:text
104
+ - Inputs: 0. `prev`:node; 1. `repoUrl`:text; 2. `branch`:text; 3. `targetDir`:text; 4. `pullIfExists`:bool = true; 5. `includeSubmodules`:bool = false; 6. `remote`:text = origin; 7. `workspaceContext`:text
105
+ - Outputs: 0. `next`:node; 1. `repoPath`:file; 2. `branch`:text; 3. `commit`:text; 4. `changed`:bool; 5. `workspaceContext`:text; 6. `gitContext`:text
145
106
 
146
- ### tool_load_key
107
+ ### tool_git_worktree_load
147
108
 
148
- - Display: LoadKey
149
- - Description: Load key-value from global storage
150
- - Runtime: agent/runner
151
- - Inputs: 0. `prev`:node; 1. `key`:text
152
- - Outputs: 0. `next`:node; 1. `result`:text
109
+ - Display: Load Worktree
110
+ - Description: Create or reuse a Git worktree and expose it as the downstream workspace context. - `repoPath` is required unless `gitContext.repoPath` is connected. - `workspaceContext` is required so the node can preserve the previous execution context. - `branch` is optional. When empty, AgentFlow creates a detached worktree at the current HEAD. - `worktreePath` is optional. When empty, AgentFlow creates a temporary worktree under the current run temp directory. - A worktree created by this node during the current Workspace run is removed when the run finishes or is stopped, even when `worktreePath` is explicitly set. - Existing registered worktrees under the current flow workspace are also removed after the run, covering leftovers from previous interrupted runs. - Existing registered worktrees outside the current flow workspace are reused and not removed automatically unless this run created them. - Existing worktree paths are reused only when they are registered by `git worktree list` for the given repo. - `pruneMissing` defaults to true. When Git has a registered worktree whose directory is missing, AgentFlow runs `git worktree prune` before adding it again. - `force` defaults to false. When true, AgentFlow passes `--force` to `git worktree add`.
111
+ - Runtime: local-only
112
+ - Inputs: 0. `prev`:node; 1. `repoPath`:file; 2. `branch`:text; 3. `worktreePath`:file; 4. `pruneMissing`:bool = true; 5. `force`:bool = false; 6. `gitContext`:text; 7. `workspaceContext`:text
113
+ - Outputs: 0. `next`:node; 1. `worktreePath`:file; 2. `branch`:text; 3. `commit`:text; 4. `workspaceContext`:text; 5. `gitContext`:text
114
+
115
+ ### tool_git_worktree_unload
116
+
117
+ - Display: Unload Worktree
118
+ - Description: Remove a Git worktree. - `workspaceContext` is required. Its `cwd` is used as the worktree to remove. - `repoPath`, `worktreePath` and `gitContext` are optional compatibility overrides. - By default `force` is false; dirty worktrees fail instead of being removed. - By default `prune` is true.
119
+ - Runtime: local-only
120
+ - Inputs: 0. `prev`:node; 1. `repoPath`:file; 2. `worktreePath`:file; 3. `gitContext`:text; 4. `workspaceContext`:text; 5. `force`:bool = false; 6. `prune`:bool = true
121
+ - Outputs: 0. `next`:node; 1. `removed`:bool; 2. `workspaceContext`:text; 3. `message`:text
122
+
123
+ ### tool_gitlab_create_mr
124
+
125
+ - Display: Create GitLab MR
126
+ - Description: Create or reuse a GitLab merge request for the current branch. - `gitContext` and `workspaceContext` can be connected from Git Checkout / Load Worktree. - `repoPath` is optional. When empty, AgentFlow uses `gitContext.worktreePath`, `gitContext.repoPath`, or `workspaceContext.cwd`. - `sourceBranch`, `targetBranch`, `title`, `description`, `draft`, and `labels` are optional. When empty, AgentFlow derives sensible defaults from git. - `tokenEnv` is optional. Defaults to `GITLAB_TOKEN,GITLAB_PRIVATE_TOKEN`. - `gitlabApiBase` is optional. When empty, AgentFlow uses `https://${gitContext.host}/api/v4`.
127
+ - Runtime: local-only
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
+ - 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
153
130
 
154
131
  ### tool_nodejs
155
132
 
156
133
  - Display: NodeJs
157
- - Description: Execute Node.js script via agentflow apply -ai run-tool-nodejs. **Success/Failure:** Determined by script process **exit code**—0 = success, non-0 = failed. **Result Output:** Script stdout directly becomes result slot content (plain text, e.g., `console.log("hello")`). When stdout is empty and exit code is non-0, stderr info will be written to failure message. **JSON Compatible (Optional):** If stdout is `{"err_code":0,"message":{"result":"..."}}` format, err_code will override exit code semantics, message.result writes to result slot. Only use when needing different success/failure semantics than exit code. **Direct Execution Mode (Recommended):** Set `script` field in flow.yaml instance, pipeline will skip AI and execute directly. `script` supports ${} placeholders (workspaceRoot, pipelineWorkspace, flowName, runDir, flowDir and all input/output slots), values are auto shell-quoted. When a CD Workspace node is connected, `workspaceRoot` is the current execution workspace; `pipelineWorkspace` is the original pipeline workspace. flowDir is absolute path of current pipeline flow.yaml directory, can be used to reference scripts in same directory. Example: `script: node ${flowDir}/scripts/my-check.mjs --root ${workspaceRoot} --input ${todo}` **Pin Path Constraint (Important):** File paths read/written by script **must be passed via pins**, forbidden to construct output paths inside script. - All input slots with type 'file' (e.g., `figma_tree`, `semantic_outline`) are parsed from upstream connections by pipeline, script receives via CLI args. - All output slots with type 'file' (e.g., `restore_todolist`, `screenshot_map`) are generated by pipeline as absolute paths following `output/<instanceId>/node_<instanceId>_<slot>.md` convention, script receives via CLI args and writes directly. - Use `${slotName}` in `script` field to get correct path, e.g., `--figma-tree ${figma_tree} --output ${restore_todolist}`. - **Forbidden** to use `outDirForNode`, manually write `node_<instance>_xxx.json` etc. in scriptthis causes script output path mismatch with pipeline parser convention, downstream nodes cannot find files. **AI Execution Mode (Legacy):** Without `script` field, AI agent reads body and manually executes commands. **Underlying Usage:** agentflow apply -ai run-tool-nodejs <workspaceRoot> <flowName> <uuid> <instanceId> [execId] -- <scriptCmd> [args...]
134
+ - Description: Execute a Node.js script. The Workspace runtime spawns the command directly — no agent involved. **Success/Failure:** Determined by the script process **exit code** — 0 = success, non-0 = failed. **Result Output:** Script stdout becomes the `result` slot content (plain text, e.g. `console.log("hello")`). When stdout is empty and the exit code is non-0, stderr is written to the failure message. Do **not** wrap stdout in a JSON envelope. **Script placeholders:** `script` (inline) or `scriptRef` (file) support `${}` placeholders — `workspaceRoot` / `pipelineWorkspace` / `flowDir` (all three resolve to the scoped workspace root), `cwd`, `nodeRunDir`, `nodeTmpDir`, `outputsDir`, `scriptRef`, plus every input and output slot name. Values are auto shell-quoted, so do not add your own quotes. Example: `script: node ${flowDir}/scripts/my-check.mjs --root ${workspaceRoot} --input ${todo}` **Pin Path Constraint (Important):** File paths read/written by the script **must be passed via pins**; never construct output paths inside the script. - Input slots of type `file` are resolved from upstream connections; the script receives them as CLI args. - Output slots of type `file` are resolved to absolute paths by the runtime; the script writes to them directly. - Reference them with `${slotName}` in `script`, e.g. `--figma-tree ${figma_tree} --output ${restore_todolist}`. - **Forbidden** to invent output paths inside the script — downstream nodes will not find the files. **Scripts under `scripts/` must be referenced as `${flowDir}/scripts/xxx.mjs`.**
158
135
  - Runtime: direct script when script exists, otherwise agent
159
- - Inputs: 0. `prev`:node; 1. `workspaceContext`:text; 2. `skillsContext`:text
136
+ - Inputs: 0. `prev`:node; 1. `workspaceContext`:text; 2. `skillsContext`:text; 3. `mcpContext`:text
160
137
  - Outputs: 0. `next`:node; 1. `result`:text
161
138
 
162
- ### tool_print
139
+ ### tool_set_run_env
140
+
141
+ - Display: Set Run Env
142
+ - Description: Set environment variables for downstream nodes in the current workspace run
143
+ - Runtime: local-only
144
+ - Inputs: 0. `prev`:node; 1. `key`:text; 2. `value`:text; 3. `variables`:text
145
+ - Outputs: 0. `next`:node; 1. `keys`:text; 2. `count`:text
146
+
147
+ ### tool_wecom_send_app_markdown
148
+
149
+ - Display: WeCom Direct Markdown
150
+ - Description: Send Markdown message to WeCom users through an enterprise application
151
+ - Runtime: local-only
152
+ - Inputs: 0. `prev`:node; 1. `markdown`:text; 2. `toUser`:text; 3. `corpId`:text; 4. `corpSecret`:text; 5. `agentId`:text; 6. `accessToken`:text
153
+ - Outputs: 0. `next`:node; 1. `sent`:bool; 2. `message`:text; 3. `response`:text
154
+
155
+ ### tool_wecom_send_group_markdown
156
+
157
+ - Display: WeCom Group Chat Markdown
158
+ - Description: Send Markdown message to a WeCom group robot webhook
159
+ - Runtime: local-only
160
+ - Inputs: 0. `prev`:node; 1. `markdown`:text; 2. `webhookUrl`:text; 3. `webhookKey`:text
161
+ - Outputs: 0. `next`:node; 1. `sent`:bool; 2. `message`:text; 3. `response`:text
162
+
163
+ ## display
164
+
165
+ ### display_ascii
163
166
 
164
- - Display: Print
165
- - Description: Output content to user with special font style
167
+ - Display: ASCII Display
168
+ - Description: Display ASCII diagram content in workspace canvas; passes diagram text downstream as text
166
169
  - Runtime: local-only
167
170
  - Inputs: 0. `prev`:node; 1. `content`:text
168
- - Outputs: 0. `next`:node
171
+ - Outputs: 0. `content`:text; 1. `next`:node
169
172
 
170
- ### tool_save_key
173
+ ### display_chart
171
174
 
172
- - Display: SaveKey
173
- - Description: Save key-value pair to global storage
174
- - Runtime: agent/runner
175
- - Inputs: 0. `prev`:node; 1. `key`:text; 2. `value`:text
176
- - Outputs: 0. `next`:node
175
+ - Display: Chart Display
176
+ - Description: Display a JSON ChartSpec with ECharts in workspace canvas; passes the JSON downstream as text
177
+ - Runtime: local-only
178
+ - Inputs: 0. `prev`:node; 1. `content`:text; 2. `filePath`:file; 3. `workspaceContext`:text
179
+ - Outputs: 0. `content`:text; 1. `next`:node
177
180
 
178
- ### tool_user_ask
181
+ ### display_html
179
182
 
180
- - Display: UserAsk
181
- - Description: 等待用户从多个选项中选择一个,流程暂停;按用户选择沿对应出边分支继续。每个 output 槽位对应一条分支,槽位的 description 作为选项文案。
183
+ - Display: HTML Display
184
+ - Description: Display HTML content in workspace canvas; passes HTML downstream as text
182
185
  - Runtime: local-only
183
- - Inputs: 0. `prev`:node; 1. `question`:file
184
- - Outputs: 0. `option_0`:node; 1. `option_1`:node
186
+ - Inputs: 0. `prev`:node; 1. `content`:text; 2. `filePath`:file; 3. `workspaceContext`:text
187
+ - Outputs: 0. `content`:text; 1. `next`:node
185
188
 
186
- ### tool_user_check
189
+ ### display_image
187
190
 
188
- - Display: UserCheck
189
- - Description: 等待用户确认,流程暂停。展示确认内容给用户,用户可编辑/AI修改后保存,回复 "继续" 后重启流程。
191
+ - Display: Image Display
192
+ - Description: Display an image URL, data URL, or image path in workspace canvas; passes source downstream as text
190
193
  - Runtime: local-only
191
- - Inputs: 0. `prev`:node; 1. `content`:file
192
- - Outputs: 0. `next`:node; 1. `content`:file
194
+ - Inputs: 0. `prev`:node; 1. `src`:text; 2. `filePath`:file; 3. `alt`:text; 4. `workspaceContext`:text
195
+ - Outputs: 0. `src`:text; 1. `next`:node
196
+
197
+ ### display_markdown
198
+
199
+ - Display: Markdown Display
200
+ - Description: Display Markdown content in workspace canvas; passes content downstream as text
201
+ - Runtime: local-only
202
+ - Inputs: 0. `prev`:node; 1. `content`:text
203
+ - Outputs: 0. `content`:text; 1. `next`:node
204
+
205
+ ### display_mermaid
206
+
207
+ - Display: Mermaid Display
208
+ - Description: Display Mermaid diagram source in workspace canvas; passes diagram source downstream as text
209
+ - Runtime: local-only
210
+ - Inputs: 0. `prev`:node; 1. `content`:text
211
+ - Outputs: 0. `content`:text; 1. `next`:node
212
+
213
+ ### display_react_app
214
+
215
+ - Display: React App
216
+ - Description: Display a small React project in a sandboxed workspace iframe and pass the project JSON downstream
217
+ - Runtime: local-only
218
+ - Inputs: 0. `prev`:node; 1. `content`:text; 2. `filePath`:file; 3. `workspaceContext`:text
219
+ - Outputs: 0. `content`:text; 1. `next`:node
220
+
221
+ ### display_table
222
+
223
+ - Display: Table Display
224
+ - Description: Display table data in workspace canvas; accepts JSON, Markdown table, CSV, or TSV and passes the text downstream
225
+ - Runtime: local-only
226
+ - Inputs: 0. `prev`:node; 1. `content`:text; 2. `filePath`:file; 3. `workspaceContext`:text
227
+ - Outputs: 0. `content`:text; 1. `next`:node
193
228
 
194
229
  ## provide
195
230
 
231
+ ### provide_bool
232
+
233
+ - Display: Boolean
234
+ - Description: Provide a boolean value directly, value will be passed to downstream as true or false
235
+ - Runtime: local-only
236
+ - Inputs: 无
237
+ - Outputs: 0. `value`:bool = false
238
+
196
239
  ### provide_file
197
240
 
198
241
  - Display: File
@@ -201,6 +244,14 @@
201
244
  - Inputs: 无
202
245
  - Outputs: 0. `value`:file
203
246
 
247
+ ### provide_password
248
+
249
+ - Display: Password
250
+ - Description: Provide a secret text value without showing it on the node card
251
+ - Runtime: local-only
252
+ - Inputs: 无
253
+ - Outputs: 0. `value`:text
254
+
204
255
  ### provide_str
205
256
 
206
257
  - Display: String
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agentflow-placeholder-reference
3
3
  description: >-
4
- AgentFlow 占位符参考。用于编写 body/script 中的 ${workspaceRoot}、${pipelineWorkspace}、
4
+ AgentFlow Workspace 节点占位符参考。用于编写 body/script 中的 ${workspaceRoot}、${pipelineWorkspace}、
5
5
  ${flowDir}、${runDir}、${input.xxx}、${output.xxx} 等变量。
6
6
  ---
7
7
 
@@ -17,7 +17,7 @@ description: >-
17
17
 
18
18
  - 读 [placeholders.md](references/placeholders.md)。
19
19
  - 不要在 `script` 中给 `${workspaceRoot}` 这类占位符再包一层双引号;AgentFlow 会 shell-quote。
20
- - flow 自带脚本优先用 `${flowDir}/scripts/...`。
20
+ - Workspace 节点脚本优先使用 `${workspaceRoot}`;`${flowDir}` / `${pipelineWorkspace}` 仅兼容历史 Pipeline 资源。
21
21
 
22
22
  ## Reference
23
23
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agentflow-runtime-reference
3
3
  description: >-
4
- AgentFlow 运行时参考。用于理解 pipeline/workspace 目录、runBuild、
4
+ AgentFlow Workspace 运行时参考。用于理解 workspace 图、runBuild、
5
5
  intermediate/output/result 文件、workspaceContext/skillsContext 传递和 CD Workspace 行为。
6
6
  ---
7
7
 
@@ -18,7 +18,7 @@ description: >-
18
18
 
19
19
  - 读 [runtime.md](references/runtime.md) 了解目录与上下文。
20
20
  - 下游 agent/tool 的当前执行目录由 `workspaceContext` 决定。
21
- - pipeline 自己的文件永远通过 `pipelineWorkspace` / `flowDir` 找,不要在 CD 后误用 `workspaceRoot`。
21
+ - 新任务优先使用 Workspace 图和 `workspaceRoot`;历史 Pipeline 的 `pipelineWorkspace` / `flowDir` 仅用于迁移和审计。
22
22
 
23
23
  ## Reference
24
24
 
@@ -61,4 +61,4 @@ Important files:
61
61
 
62
62
  - Edge values are resolved by handle index.
63
63
  - File slots usually pass paths; text slots may read upstream output file content.
64
- - `tool_print.content` should receive the display text. If missing, `tool_print` may fallback to upstream result body.
64
+ - `display_*.content` should receive the text to render. Pick the display type that matches the payload (`display_markdown`, `display_html`, `display_table`, `display_chart`, …).
@@ -2,7 +2,7 @@
2
2
  name: agentflow-workspace-ascii
3
3
  description: >-
4
4
  AgentFlow Workspace ASCII 图展示技能。用于生成目录树、文本框图、流程草图等
5
- 等宽 ASCII 内容,并写入 display_ascii 节点的 workspace.graph.json。
5
+ 等宽 ASCII 内容,并写入 workspace.flow.js display.ascii 节点。
6
6
  ---
7
7
 
8
8
  # AgentFlow Workspace ASCII
@@ -11,21 +11,14 @@ description: >-
11
11
 
12
12
  ## 生成节点
13
13
 
14
- 新增或更新 `workspace.graph.json` 中的 `display_ascii` instance:
15
-
16
- ```json
17
- {
18
- "definitionId": "display_ascii",
19
- "label": "目录树",
20
- "body": "app/\n|-- src/\n|-- package.json",
21
- "input": [
22
- { "type": "node", "name": "prev", "value": "" },
23
- { "type": "text", "name": "content", "value": "app/\n|-- src/\n|-- package.json" }
24
- ],
25
- "output": [
26
- { "type": "text", "name": "content", "value": "app/\n|-- src/\n|-- package.json" }
27
- ]
28
- }
14
+ `workspace.flow.js` 里新增或更新一个 `display.ascii` 节点:
15
+
16
+ ```js
17
+ const tree = display.ascii("目录树", {
18
+ content: `app/
19
+ |-- src/
20
+ |-- package.json`,
21
+ });
29
22
  ```
30
23
 
31
24
  `body`、`input.content.value`、`output.content.value` 使用同一份 ASCII 文本。
@@ -2,7 +2,7 @@
2
2
  name: agentflow-workspace-graph
3
3
  description: >-
4
4
  AgentFlow Workspace 画布编辑技能。用于在 Workspace 视图中创建或修改
5
- workspace.graph.json,新增展示节点、上下文节点和连线;不修改正式 flow.yaml。
5
+ workspace.flow.js,新增展示节点、上下文节点和连线;不修改正式 flow.yaml。
6
6
  ---
7
7
 
8
8
  # AgentFlow Workspace Graph
@@ -11,61 +11,75 @@ description: >-
11
11
 
12
12
  ## 目标文件
13
13
 
14
- 优先修改当前 pipeline 目录下的 `workspace.graph.json`。不要修改正式 `flow.yaml`,除非用户明确要求并且 UI 勾选允许修改 flow.yaml。
15
-
16
- `workspace.graph.json` 结构:
17
-
18
- ```json
19
- {
20
- "version": 1,
21
- "instances": {
22
- "node_id": {
23
- "definitionId": "display_markdown",
24
- "label": "标题",
25
- "body": "展示内容",
26
- "input": [
27
- { "type": "node", "name": "prev", "value": "" },
28
- { "type": "text", "name": "content", "value": "展示内容" }
29
- ],
30
- "output": [
31
- { "type": "text", "name": "content", "value": "展示内容" }
32
- ]
33
- }
34
- },
35
- "edges": [
36
- { "source": "a", "target": "b", "sourceHandle": "output-0", "targetHandle": "input-0" }
37
- ],
38
- "ui": {
39
- "nodePositions": { "node_id": { "x": 320, "y": 180 } },
40
- "nodeSizes": { "node_id": { "width": 760, "height": 520 } }
41
- }
42
- }
14
+ 画布就是代码:改当前 Workspace 项目目录下的 **`workspace.flow.js`**。不要修改历史
15
+ `flow.yaml`,也不要写 `workspace.graph.json`——那是已经退役的格式,写了不会被读。
16
+
17
+ ```
18
+ workspace.flow.js ← 改这个
19
+ workspace.layout.json 坐标,平台维护,别碰
20
+ workspace.nodes.json 图片等机器属性,平台维护,别碰
21
+ workspace.state.json 运行产出,平台维护,别碰
22
+ ```
23
+
24
+ 坐标不用管:新节点平台会自动排布,写死坐标反而会覆盖用户调过的位置。
25
+
26
+ ## 写法
27
+
28
+ ```js
29
+ import { agent, control, display, flow } from "agentflow/flow";
30
+
31
+ const notes = display.markdown("项目结构分析", {
32
+ content: `# 项目结构分析
33
+
34
+ - src/ 业务代码
35
+ - bin/ CLI 入口`,
36
+ });
37
+ ```
38
+
39
+ | 位置 | 含义 |
40
+ |------|------|
41
+ | 第 1 个参数(字符串) | 节点显示名 |
42
+ | 第 2 个参数(对象) | 输入引脚,每个键都是引脚名 |
43
+ | 第 3 个参数(字符串) | body:agent 的 prompt、`tool.nodejs` 的命令 |
44
+ | `const 变量名` | 节点 id |
45
+ | `x.slotName` | 引用上游输出引脚 = 连一条数据线 |
46
+
47
+ 连线和控制流:
48
+
49
+ ```js
50
+ const summary = agent.subAgent("总结", { source: notes.content }, `把上面的结构讲清楚`);
51
+ const show = display.markdown("总结", { content: summary.result });
52
+ export const run = flow("Run", summary, show);
43
53
  ```
44
54
 
45
- ## 节点使用规则
55
+ 只放一个展示节点、不需要跑的,不用写 `flow(...)`,声明出来就行。
46
56
 
47
- - 用 `display_markdown` 展示 Markdown 正文、分析报告、会议纪要、代码结构说明。
48
- - 用 `display_mermaid` 展示 Mermaid 图源码。
49
- - 用 `display_ascii` 展示 ASCII 图。
50
- - 用 `display_html` 展示可交互 HTML 原型或富 UI 片段。
51
- - 用 `display_image` 展示图片 URL、data URL 或图片路径。
52
- - 用 `display_chart` 展示 ChartSpec JSON 图表。
53
- - 用 `display_table` 展示结构化表格数据。
54
- - 用普通 pipeline 节点作为上下文节点时,保持 `instances` 结构与 flow.yaml instance 一致,但它只属于 workspace graph。
55
- - 每个新增 instance 必须有 `ui.nodePositions`。
56
- - 展示节点建议写 `ui.nodeSizes`,避免内容区域过小。
57
+ ## 铁律
57
58
 
58
- ## 连接语义
59
+ 1. 节点全部声明在**模块顶层**
60
+ 2. **禁一切控制流**:`if` / `for` / `while` / `?:` / `.map()` / `await` / 箭头函数 /
61
+ 动态属性。这个文件永不执行、只被静态解析,出现这些就还原不出图。要写逻辑就建代码
62
+ 节点 `nodes/<name>/index.mjs`
63
+ 3. 一个输出可接多个输入;**一个输入只能接一条边**;不能成环
64
+ 4. 改完跑 `agentflow flow dsl lint <flowDir>` 自查
59
65
 
60
- 展示节点的输入:
66
+ 完整语法和全部可用节点见 **agentflow-flow-dsl** skill。
61
67
 
62
- - `input[0]` / `targetHandle: "input-0"`:node prev,用于连接上游上下文。
63
- - `input[1]`:text content,展示内容。
68
+ ## 展示节点选型
64
69
 
65
- 展示节点的输出:
70
+ - `display.markdown` — Markdown 正文、分析报告、会议纪要、代码结构说明
71
+ - `display.mermaid` — Mermaid 图源码
72
+ - `display.ascii` — ASCII 图
73
+ - `display.html` — 可交互 HTML 原型或富 UI 片段
74
+ - `display.image` — 图片 URL、data URL 或图片路径
75
+ - `display.chart` — ChartSpec JSON 图表
76
+ - `display.table` — 结构化表格数据
66
77
 
67
- - `output[0]` / `sourceHandle: "output-0"`:text content,可作为后续 agent 的上下文输入。
78
+ 内容写在 `content` 引脚上;平台会同时把它当作节点正文。展示节点的 `content` 输出可以
79
+ 接给后续 agent 当上下文。
68
80
 
69
81
  ## 输出要求
70
82
 
71
- 当用户要求“生成/展示/放到 workspace 画布”时,直接编辑 `workspace.graph.json`。完成后简要说明新增或修改了哪些 workspace 节点。
83
+ 用户要求「生成/展示/放到 workspace 画布」时,直接编辑 `workspace.flow.js`。需要所见即所得
84
+ 的线上画布,再用 `agentflow-cli workspace-preview --file <flowDir>` 上传到服务器临时
85
+ Workspace;不要把临时项目当作正式源版本。完成后简要说明新增或修改了哪些节点。
@@ -60,6 +60,11 @@ HTML 展示节点接收完整 HTML 文档或 HTML fragment:
60
60
 
61
61
  ## 节点写入
62
62
 
63
- 新增或更新 `workspace.graph.json` 中的 `display_html` instance 时,`body`、`input.content.value`、`output.content.value` 使用同一份 HTML。
63
+ `workspace.flow.js` 里写一个 `display.html` 节点,HTML 放 `content` 引脚:
64
64
 
65
- 建议默认尺寸:宽 430-760,高 640-860,按原型复杂度调整。
65
+ ```js
66
+ const proto = display.html("原型", { content: file("docs/proto.html") });
67
+ ```
68
+
69
+ 超过 3000 字符就像上面这样抽成 `docs/*.html`——整页 HTML 内联会把流程结构淹没。
70
+ 尺寸由平台维护,不要手写。
@@ -47,6 +47,10 @@ description: >-
47
47
 
48
48
  ## 节点写入
49
49
 
50
- 新增或更新 `workspace.graph.json` 中的 `display_image` instance 时,`body`、`input.src.value`、`output.src.value` 使用同一份图片 src。
50
+ `workspace.flow.js` 里写一个 `display.image` 节点,图片地址放 `src` 引脚:
51
51
 
52
- 建议默认尺寸:宽 520-760,高 420-680。
52
+ ```js
53
+ const shot = display.image("截图", { src: "outputs/image.png" });
54
+ ```
55
+
56
+ 尺寸由平台维护,不要手写。