@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
|
@@ -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:
|
|
17
|
-
- Description:
|
|
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
|
-
###
|
|
23
|
+
### workspace_one_click_task
|
|
33
24
|
|
|
34
|
-
- Display:
|
|
35
|
-
- Description:
|
|
25
|
+
- Display: 一键任务
|
|
26
|
+
- Description: 输入任务描述,选择 Skills、workspace 上下文和输出类型后直接运行;等价于「Load Skills + 子 Agent + Display」的合并节点。
|
|
36
27
|
- Runtime: agent/runner
|
|
37
|
-
- Inputs: 0. `
|
|
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
|
-
|
|
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:
|
|
51
|
-
- Description:
|
|
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
|
-
###
|
|
49
|
+
### control_load_mcp
|
|
89
50
|
|
|
90
|
-
- Display:
|
|
91
|
-
- Description:
|
|
51
|
+
- Display: Load MCP
|
|
52
|
+
- Description: 加载所选 Cursor MCP Server 的工具清单,通过 mcpContext 传给下游 agent 节点。
|
|
92
53
|
- Runtime: local-only
|
|
93
|
-
- Inputs: 0. `prev`:node; 1. `
|
|
94
|
-
- Outputs: 0. `
|
|
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
|
|
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. `
|
|
102
|
-
- Outputs: 0. `next`:node; 1. `skillsContext`:text
|
|
62
|
+
- Inputs: 0. `prev`:node; 1. `skillKeys`:text
|
|
63
|
+
- Outputs: 0. `next`:node; 1. `skillsContext`:text
|
|
103
64
|
|
|
104
|
-
###
|
|
65
|
+
### control_user_workspace
|
|
105
66
|
|
|
106
|
-
- Display:
|
|
107
|
-
- Description:
|
|
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
|
-
###
|
|
73
|
+
### workspace_run
|
|
113
74
|
|
|
114
|
-
- Display:
|
|
115
|
-
- Description:
|
|
116
|
-
- Runtime:
|
|
117
|
-
- Inputs: 0. `prev`:node
|
|
118
|
-
- Outputs: 0. `next`:node
|
|
75
|
+
- Display: Run
|
|
76
|
+
- Description: Workspace 图的运行入口。点击运行时,从本节点出发沿控制边选出子图并执行;本节点自身不产生输出。
|
|
77
|
+
- Runtime: local-only
|
|
78
|
+
- Inputs: 0. `prev`:node
|
|
79
|
+
- Outputs: 0. `next`:node
|
|
119
80
|
|
|
120
|
-
###
|
|
81
|
+
### workspace_scheduled_run
|
|
121
82
|
|
|
122
|
-
- Display:
|
|
123
|
-
- Description:
|
|
83
|
+
- Display: Scheduled Run
|
|
84
|
+
- Description: 定时运行入口。与 Run 相同的执行语义,区别是由调度器按节点 body 中的 JSON 排程配置触发。
|
|
124
85
|
- Runtime: local-only
|
|
125
|
-
- Inputs: 0. `prev`:node
|
|
126
|
-
- Outputs: 0. `next`:node
|
|
86
|
+
- Inputs: 0. `prev`:node
|
|
87
|
+
- Outputs: 0. `next`:node
|
|
127
88
|
|
|
128
89
|
## tool
|
|
129
90
|
|
|
130
|
-
###
|
|
91
|
+
### tool_display_share_link
|
|
131
92
|
|
|
132
|
-
- Display:
|
|
133
|
-
- Description:
|
|
134
|
-
- Runtime:
|
|
135
|
-
- Inputs: 0. `
|
|
136
|
-
- Outputs: 0. `
|
|
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
|
-
###
|
|
107
|
+
### tool_git_worktree_load
|
|
147
108
|
|
|
148
|
-
- Display:
|
|
149
|
-
- Description:
|
|
150
|
-
- Runtime:
|
|
151
|
-
- Inputs: 0. `prev`:node; 1. `
|
|
152
|
-
- Outputs: 0. `next`:node; 1. `
|
|
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
|
|
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
|
-
###
|
|
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:
|
|
165
|
-
- Description:
|
|
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
|
-
###
|
|
173
|
+
### display_chart
|
|
171
174
|
|
|
172
|
-
- Display:
|
|
173
|
-
- Description:
|
|
174
|
-
- Runtime:
|
|
175
|
-
- Inputs: 0. `prev`:node; 1. `
|
|
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
|
-
###
|
|
181
|
+
### display_html
|
|
179
182
|
|
|
180
|
-
- Display:
|
|
181
|
-
- 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. `
|
|
184
|
-
- Outputs: 0. `
|
|
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
|
-
###
|
|
189
|
+
### display_image
|
|
187
190
|
|
|
188
|
-
- Display:
|
|
189
|
-
- Description:
|
|
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. `
|
|
192
|
-
- Outputs: 0. `
|
|
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
|
|
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
|
-
-
|
|
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 运行时参考。用于理解
|
|
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
|
-
-
|
|
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
|
-
- `
|
|
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 内容,并写入
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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.
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
+
内容写在 `content` 引脚上;平台会同时把它当作节点正文。展示节点的 `content` 输出可以
|
|
79
|
+
接给后续 agent 当上下文。
|
|
68
80
|
|
|
69
81
|
## 输出要求
|
|
70
82
|
|
|
71
|
-
|
|
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
|
-
|
|
63
|
+
在 `workspace.flow.js` 里写一个 `display.html` 节点,HTML 放 `content` 引脚:
|
|
64
64
|
|
|
65
|
-
|
|
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
|
-
|
|
50
|
+
在 `workspace.flow.js` 里写一个 `display.image` 节点,图片地址放 `src` 引脚:
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
```js
|
|
53
|
+
const shot = display.image("截图", { src: "outputs/image.png" });
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
尺寸由平台维护,不要手写。
|