@fieldwangai/agentflow 0.1.159 → 0.1.160
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/catalog-flows.mjs +10 -1
- package/bin/lib/control-while.mjs +336 -0
- package/bin/lib/flow-dsl/codegen.mjs +74 -11
- package/bin/lib/flow-dsl/ir.mjs +33 -2
- package/bin/lib/flow-dsl/lint.mjs +128 -3
- package/bin/lib/flow-dsl/parser.mjs +168 -4
- package/bin/lib/marketplace.mjs +10 -2
- package/bin/lib/node-package-manifest.mjs +7 -2
- package/bin/lib/node-ui-kit.mjs +156 -0
- package/bin/lib/paths.mjs +2 -0
- package/bin/lib/workspace-flow-store.mjs +11 -2
- package/bin/lib/workspace-graph-merge.mjs +3 -0
- package/bin/lib/workspace-routes.mjs +10 -1
- package/bin/lib/workspace-server.mjs +592 -11
- package/bin/pipeline/validate-flow.mjs +3 -3
- package/builtin/nodes/control_parse_json.md +25 -0
- package/builtin/nodes/control_subflow_call.md +27 -0
- package/builtin/nodes/control_while.md +124 -0
- package/builtin/nodes/provide_json.md +14 -0
- package/builtin/nodes/workspace_subflow_input.md +14 -0
- package/builtin/pipelines/subflow-preview/workspace.flow.js +29 -0
- package/builtin/pipelines/subflow-preview/workspace.layout.json +38 -0
- package/builtin/pipelines/subflow-preview/workspace.nodes.json +19 -0
- package/builtin/pipelines/subflow-preview/workspace.state.json +93 -0
- package/builtin/pipelines/while-subflow-preview/workspace.flow.js +55 -0
- package/builtin/pipelines/while-subflow-preview/workspace.layout.json +66 -0
- package/builtin/pipelines/while-subflow-preview/workspace.nodes.json +49 -0
- package/builtin/pipelines/while-subflow-preview/workspace.state.json +194 -0
- package/builtin/web-ui/dist/assets/{WorkflowAssistantThread-CY19DsYq.js → WorkflowAssistantThread-Bfo9Ythw.js} +1 -1
- package/builtin/web-ui/dist/assets/index-XbeI5foV.js +872 -0
- package/builtin/web-ui/dist/assets/index-e1omCEau.css +1 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +2 -1
- package/reference/flow-control-capabilities.md +41 -16
- package/shared/slot-types.js +58 -0
- package/skills/agentflow-flow-dsl/SKILL.md +60 -6
- package/skills/agentflow-flow-dsl/references/node-calls.md +3 -0
- package/skills/agentflow-flow-dsl/references/subflow-authoring.md +230 -0
- package/skills/agentflow-node-dsl/SKILL.md +39 -0
- package/skills/agentflow-node-reference/references/builtin-nodes.md +25 -0
- package/builtin/web-ui/dist/assets/index-B9ppXv7e.css +0 -1
- package/builtin/web-ui/dist/assets/index-CdEQWRrp.js +0 -872
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
## Rules Of Thumb
|
|
6
6
|
|
|
7
7
|
- `tool_nodejs` needs an executable `script`; `body` is documentation when `script` exists.
|
|
8
|
+
- `control_while` runs bounded Condition/Body subflows without adding a graph cycle; one-step scripts are legacy compatibility.
|
|
8
9
|
- `agent_subAgent` is for semantic/code/text reasoning tasks.
|
|
9
10
|
- Local-only nodes are executed by AgentFlow runtime and do not call an agent.
|
|
10
11
|
- The Workspace runtime executes a DAG; cyclic graphs are rejected. Express check-then-fix as forward steps.
|
|
@@ -62,6 +63,14 @@
|
|
|
62
63
|
- Inputs: 0. `prev`:node; 1. `skillKeys`:text
|
|
63
64
|
- Outputs: 0. `next`:node; 1. `skillsContext`:text
|
|
64
65
|
|
|
66
|
+
### control_parse_json
|
|
67
|
+
|
|
68
|
+
- Display: Parse JSON
|
|
69
|
+
- Description: 显式解析并校验文本 JSON,成功后输出 json 类型;解析失败会终止本次运行。
|
|
70
|
+
- Runtime: local-only
|
|
71
|
+
- Inputs: 0. `prev`:node; 1. `value`:text
|
|
72
|
+
- Outputs: 0. `next`:node; 1. `result`:json = null
|
|
73
|
+
|
|
65
74
|
### control_user_workspace
|
|
66
75
|
|
|
67
76
|
- Display: User Workspace
|
|
@@ -70,6 +79,14 @@
|
|
|
70
79
|
- Inputs: 0. `prev`:node
|
|
71
80
|
- Outputs: 0. `next`:node; 1. `workspaceContext`:text; 2. `cwd`:file
|
|
72
81
|
|
|
82
|
+
### control_while
|
|
83
|
+
|
|
84
|
+
- Display: While
|
|
85
|
+
- Description: Repeatedly execute either an explicit Condition/Body subflow pair or one legacy deterministic step command (`script` or `scriptRef`) without adding a cycle to the Workspace graph. A Run restarted after `wait` resumes from the saved output state. Preferred DSL form: `control.while("Advance", { state, maxIterations, timeout }, conditionFlow, bodyFlow)`. Condition must accept `state` and `iteration`, and return `decision` plus optional `summary`. Only `continue` invokes Body. Body must accept `state`, `iteration`, and `idempotencyKey`, and return the next `state` plus optional `summary`. `wait`, `done`, and `fail` skip Body. In legacy script mode, the command runs once per iteration and stdout must be exactly one JSON object: `{"decision":"continue|wait|done|fail","state":{},"summary":"..."}`. `continue` starts another iteration, `wait` pauses this Run before downstream nodes, `done` continues downstream, and `fail` fails the node. A missing `state` keeps the previous state. Each step receives `AGENTFLOW_WHILE_STATE` (JSON), the absolute `AGENTFLOW_WHILE_ITERATION`, `AGENTFLOW_WHILE_MAX_ITERATIONS`, `AGENTFLOW_WHILE_TIMEOUT_MS`, and a stable per-iteration `AGENTFLOW_WHILE_IDEMPOTENCY_KEY`. Pass the idempotency key to external write APIs when they support one. Write progress logs to stderr because stdout is reserved for the decision object. The command also supports the same runtime placeholders as `tool.nodejs`, including `${flowDir}` and `${workspaceRoot}`. A waiting checkpoint retains state, history, elapsed active time, and the next absolute iteration. `maxIterations` and `timeout` are cumulative across resumes. A changed input resets the checkpoint; a matching but malformed checkpoint fails closed. Step output is schema-strict and bounded: unknown fields are rejected, state/stdout are limited to 1 MiB, stderr to 256 KiB, and summary to 4000 characters.
|
|
86
|
+
- Runtime: bounded Condition/Body state machine
|
|
87
|
+
- Inputs: 0. `prev`:node; 1. `state`:json = null; 2. `maxIterations`:text = 20; 3. `timeout`:text = 30m
|
|
88
|
+
- Outputs: 0. `next`:node; 1. `result`:json; 2. `state`:json = null; 3. `decision`:text; 4. `iterations`:text = 0; 5. `summary`:text; 6. `history`:json = []; 7. `checkpointFingerprint`:text
|
|
89
|
+
|
|
73
90
|
### workspace_run
|
|
74
91
|
|
|
75
92
|
- Display: Run
|
|
@@ -260,6 +277,14 @@
|
|
|
260
277
|
- Inputs: 无
|
|
261
278
|
- Outputs: 0. `value`:file
|
|
262
279
|
|
|
280
|
+
### provide_json
|
|
281
|
+
|
|
282
|
+
- Display: JSON
|
|
283
|
+
- Description: 提供经过校验的 JSON 值,输出可以直接连接 json 类型输入。
|
|
284
|
+
- Runtime: local-only
|
|
285
|
+
- Inputs: 无
|
|
286
|
+
- Outputs: 0. `value`:json = null
|
|
287
|
+
|
|
263
288
|
### provide_password
|
|
264
289
|
|
|
265
290
|
- Display: Password
|