@fieldwangai/agentflow 0.1.160 → 0.1.162
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/auth.mjs +231 -14
- package/bin/lib/catalog-flows.mjs +2 -0
- package/bin/lib/cli-auth-page.mjs +103 -0
- package/bin/lib/skill-runtime.mjs +6 -0
- package/bin/lib/table.mjs +2 -3
- package/bin/lib/ui-server.mjs +220 -17
- package/bin/lib/workspace-draft.mjs +74 -0
- package/bin/lib/workspace-routes.mjs +297 -4
- package/bin/lib/workspace-server.mjs +6 -0
- package/builtin/nodes/control_while.md +5 -5
- package/builtin/pipelines/new/workspace.flow.js +1 -1
- package/builtin/web-ui/dist/assets/{WorkflowAssistantThread-Bfo9Ythw.js → WorkflowAssistantThread-CTrXOZ00.js} +1 -1
- package/builtin/web-ui/dist/assets/{index-e1omCEau.css → index-5uJFccdX.css} +1 -1
- package/builtin/web-ui/dist/assets/{index-XbeI5foV.js → index-BeUfNQRL.js} +4 -3
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +5 -1
- package/skills/agentflow-author-flow/SKILL.md +81 -8
- package/skills/agentflow-author-flow/agents/openai.yaml +3 -3
- package/skills/agentflow-cli/SKILL.md +130 -25
- package/skills/agentflow-cli/agents/openai.yaml +2 -2
- package/skills/agentflow-cli/runtime/bin/lib/skill-runtime.mjs +14765 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/agent_subAgent.md +34 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_agent_toBool.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_anyOne.md +19 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_cancelled.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_cd_workspace.md +50 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_delay.md +31 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_end.md +13 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_if.md +21 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_interval_loop.md +55 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_load_mcp.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_load_skills.md +35 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_parse_json.md +25 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_start.md +13 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_subflow_call.md +27 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_toBool.md +27 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_user_workspace.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_wait_until.md +34 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_while.md +124 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_ascii.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_chart.md +32 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_code.md +39 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_html.md +32 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_image.md +36 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_markdown.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_mermaid.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_react_app.md +53 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_table.md +32 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_bool.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_file.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_json.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_password.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_str.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_display_share_link.md +47 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_get_env.md +20 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_git_checkout.md +70 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_git_worktree_load.md +73 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_git_worktree_unload.md +52 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_gitlab_create_mr.md +114 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_jenkins_build.md +67 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_load_key.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_nodejs.md +52 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_print.md +21 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_save_key.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_set_run_env.md +38 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_user_ask.md +27 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_user_check.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_wecom_send_app_markdown.md +57 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_wecom_send_group_markdown.md +45 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_one_click_task.md +44 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_run.md +16 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_scheduled_run.md +16 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_subflow_input.md +14 -0
- package/skills/agentflow-cli/runtime/package.json +6 -0
- package/skills/agentflow-cli/scripts/agentflow-auth-store.mjs +113 -0
- package/skills/agentflow-cli/scripts/agentflow-cli.mjs +393 -28
- package/skills/agentflow-cli/scripts/agentflow-runtime.mjs +11 -4
- package/skills/agentflow-flow-add-instances/SKILL.md +2 -2
- package/skills/agentflow-flow-dsl/SKILL.md +25 -6
- package/skills/agentflow-flow-dsl/agents/openai.yaml +2 -2
- package/skills/agentflow-flow-edit-node-fields/SKILL.md +3 -3
- package/skills/agentflow-flow-recipes/SKILL.md +1 -1
- package/skills/agentflow-flow-recipes/references/recipes.md +1 -2
- package/skills/agentflow-flow-sync-ui/SKILL.md +1 -1
- package/skills/agentflow-node-dsl/SKILL.md +5 -13
- package/skills/agentflow-workspace-markdown/SKILL.md +1 -1
- package/skills/agentflow-workspace-graph/SKILL.md +0 -85
|
@@ -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-BeUfNQRL.js"></script>
|
|
34
|
+
<link rel="stylesheet" crossorigin href="/assets/index-5uJFccdX.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.162",
|
|
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",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"test": "node --test test/*.test.mjs",
|
|
51
51
|
"postinstall": "node bin/ensure-workspace-reference.mjs",
|
|
52
52
|
"build:web-ui": "cd builtin/web-ui && npm install && npm run build",
|
|
53
|
+
"build:agentflow-cli-skill-runtime": "node scripts/build-agentflow-cli-skill-runtime.mjs",
|
|
53
54
|
"build:website": "cd website && npm install && npm run build",
|
|
54
55
|
"dev": "AGENTFLOW_DEV=1 node bin/agentflow.mjs ui",
|
|
55
56
|
"dev:web": "cd builtin/web-ui && npm run dev",
|
|
@@ -69,5 +70,8 @@
|
|
|
69
70
|
"ora": "^9.3.0",
|
|
70
71
|
"sharp": "^0.34.5",
|
|
71
72
|
"update-notifier": "^7.0.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"esbuild": "^0.28.2"
|
|
72
76
|
}
|
|
73
77
|
}
|
|
@@ -1,16 +1,89 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentflow-author-flow
|
|
3
|
-
description:
|
|
3
|
+
description: Create an AgentFlow from a user's idea, iterate in a private runnable Draft Workspace, show the preview URL, test and inspect outputs, then publish the approved graph and explicitly configure Scheduled Run activation. Use for end-to-end requests such as “创建一个流程”, “给我 Preview”, “试运行并动态修改”, “发布这个 Flow”, “配置定时运行”, “make a temporary flow”, or “run it on a schedule”.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# AgentFlow Flow Lifecycle
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Orchestrate the complete authoring lifecycle. Use `agentflow-flow-dsl` for graph structure,
|
|
9
|
+
`agentflow-node-dsl` when deterministic custom code is needed, and `agentflow-cli` for Draft,
|
|
10
|
+
execution, publication, and schedule operations. Read those selected Skills completely before acting.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
## Required lifecycle
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
1. Check `agentflow-cli config`. Require authorization and `localRuntime.available: true`. If
|
|
15
|
+
authorization is missing, run `agentflow-cli auth start`, return the URL to the user, and run
|
|
16
|
+
`auth complete` after approval; never ask the user to paste a personal Token. The Runtime is
|
|
17
|
+
bundled with the Skill; if unavailable, update/reinstall the SkillHub package instead of
|
|
18
|
+
installing an npm CLI.
|
|
19
|
+
2. Translate the user's idea into a local `workspace.flow.js`. Search the remote node catalog before
|
|
20
|
+
creating a custom node package.
|
|
21
|
+
3. Run DSL lint, then layout. Do not upload an invalid or unreadable graph.
|
|
22
|
+
4. Create a private runnable Draft:
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
```bash
|
|
25
|
+
node <agentflow-cli-skill-dir>/scripts/agentflow-cli.mjs draft-create \
|
|
26
|
+
--file <flowDir> --ttl-seconds 7200
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Add `--with-dependencies` when `<flowDir>/nodes/` exists. Return the Draft URL to the user. A Draft
|
|
30
|
+
is hidden from the formal Flow list, writable in the Workspace UI, and runnable. Its Scheduled Run
|
|
31
|
+
nodes are always suppressed and cannot trigger real Cron jobs.
|
|
32
|
+
|
|
33
|
+
5. Test the intended Run or Scheduled Run entry manually with `draft-run`. Inspect returned display
|
|
34
|
+
outputs; use run status and logs for failures or long-running work. Obtain confirmation before a
|
|
35
|
+
test that calls an external service or has business side effects.
|
|
36
|
+
6. Keep the revision returned by every Draft mutation. Apply feedback to the same Draft. If the user
|
|
37
|
+
edited in the UI, pull the Draft before changing a stale local DSL:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
node <agentflow-cli-skill-dir>/scripts/agentflow-cli.mjs draft-pull \
|
|
41
|
+
--draft-id <draft-id> --output <flowDir> --replace
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then edit locally, lint/layout again, and update against that exact revision:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node <agentflow-cli-skill-dir>/scripts/agentflow-cli.mjs draft-update \
|
|
48
|
+
--draft-id <draft-id> \
|
|
49
|
+
--base-revision <last-revision> \
|
|
50
|
+
--file <flowDir>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
On a revision conflict, stop and pull before reapplying the intended change; never overwrite UI
|
|
54
|
+
edits with a stale local graph. Repeat preview and execution until the user accepts the actual
|
|
55
|
+
output. Do not treat lint, Mock data, or a visual-only preview as production-equivalent acceptance.
|
|
56
|
+
7. Before publication, state the exact Draft ID, target Flow ID, destination, and schedule mode. Wait
|
|
57
|
+
for explicit confirmation. Publication defaults to personal space and scheduling disabled.
|
|
58
|
+
8. Promote the exact tested Draft:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node <agentflow-cli-skill-dir>/scripts/agentflow-cli.mjs draft-publish \
|
|
62
|
+
--draft-id <draft-id> \
|
|
63
|
+
--flow-id <flow-id> \
|
|
64
|
+
--target-space personal \
|
|
65
|
+
--schedule disabled
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use `--schedule enabled` only when the user explicitly wants automatic execution. Promotion is
|
|
69
|
+
create-only; do not replace an existing Flow without a separate explicit decision.
|
|
70
|
+
9. When scheduling is enabled, verify the returned schedule and run `schedule-list --flow-id
|
|
71
|
+
<flow-id>`. Report it as armed only when `enabled: true`, status is not invalid/error, and
|
|
72
|
+
`nextRunAt` is present. Include Cron, timezone, overlap policy, and next run time in the handoff.
|
|
73
|
+
|
|
74
|
+
## Schedule changes after publication
|
|
75
|
+
|
|
76
|
+
Use `schedule-enable`, `schedule-disable`, or `schedule-set`; do not republish the whole graph merely
|
|
77
|
+
to flip an operational switch. Use `schedule-run-now` for a manual verification of the scheduled
|
|
78
|
+
entry. Re-read `schedule-list` after every mutation.
|
|
79
|
+
|
|
80
|
+
## Safety gates
|
|
81
|
+
|
|
82
|
+
- Keep read-only `workspace-preview` for sharing only. It cannot run or save; use a Draft for review
|
|
83
|
+
plus execution.
|
|
84
|
+
- Never activate Draft schedules. Draft configuration is design data only.
|
|
85
|
+
- Do not embed tokens, passwords, cookies, or local absolute paths in DSL or node packages.
|
|
86
|
+
- Do not claim external integrations are ready from Mock execution. Require the user's real account,
|
|
87
|
+
network, credentials, and downstream evidence.
|
|
88
|
+
- If the user requests publication but has not reviewed the Draft output, stop at the Draft and ask
|
|
89
|
+
for confirmation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
|
-
display_name: "AgentFlow
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "
|
|
2
|
+
display_name: "AgentFlow 流程创作"
|
|
3
|
+
short_description: "创建、预览、试运行、修改、发布并配置定时 Flow"
|
|
4
|
+
default_prompt: "使用 $agentflow-author-flow 把我的想法做成可运行 Draft,和我一起修改;确认后再发布,并按我的选择配置定时运行。"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentflow-cli
|
|
3
|
-
description: Direct AgentFlow operation through a bundled
|
|
3
|
+
description: Direct AgentFlow operation through a bundled browser-authorized CLI, without MCP or npm. Use when Codex needs to authorize AgentFlow access, create, update, run, or publish temporary Workspace drafts; search, publish, install, or synchronize versioned node packages; pull or publish portable Workspace DSL flows; manage scheduled runs; upload read-only previews; run or inspect Workspace graphs; or read logs and display outputs through AgentFlow HTTP APIs.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# AgentFlow CLI
|
|
@@ -52,21 +52,44 @@ For other SkillHub-supported agents, change the agent name:
|
|
|
52
52
|
skillhub install agentflow-cli --global --agent claude-code
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
After installation,
|
|
55
|
+
After installation, authorize the CLI through the AgentFlow browser page. Do not add an MCP server for this skill.
|
|
56
|
+
The Skill already includes the version-matched local Runtime used for Workspace DSL parsing,
|
|
57
|
+
lint/layout, and node-package operations. Do not install an npm package or put `agentflow` on
|
|
58
|
+
`PATH`. `AGENTFLOW_PACKAGE_ROOT` and `--agentflow-package-root` are development overrides only.
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
`PATH`. The bundled skill intentionally does not copy AgentFlow's parser/runtime modules. It locates
|
|
59
|
-
the runtime from an explicit `--agentflow-package-root`, `AGENTFLOW_PACKAGE_ROOT`, the current
|
|
60
|
-
project's `node_modules`, or the `agentflow` executable on `PATH`.
|
|
61
|
-
|
|
62
|
-
Verify both token and runtime discovery before local DSL or node-package work:
|
|
60
|
+
Verify both authorization and runtime discovery before local DSL or node-package work:
|
|
63
61
|
|
|
64
62
|
```bash
|
|
65
63
|
node <skill-dir>/scripts/agentflow-cli.mjs config
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
Require `localRuntime.available: true`.
|
|
69
|
-
runtime
|
|
66
|
+
Require `localRuntime.available: true`. A normal SkillHub installation resolves
|
|
67
|
+
`<skill-dir>/runtime`; if it does not, reinstall or update `agentflow-cli` from SkillHub rather than
|
|
68
|
+
installing a separate CLI package. Pure remote reporting commands can still run without a local
|
|
69
|
+
Runtime, but package creation, installation, Flow pull/publish, and Workspace graph parsing cannot.
|
|
70
|
+
|
|
71
|
+
## Browser authorization
|
|
72
|
+
|
|
73
|
+
When `config` reports `hasToken: false`, do not ask the user to paste a token. Start a non-blocking
|
|
74
|
+
authorization and return its `verificationUrl`:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
node <skill-dir>/scripts/agentflow-cli.mjs auth start
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The user opens the URL, logs in to AgentFlow if necessary, reviews the requested access, and clicks
|
|
81
|
+
Allow. After the user says authorization is complete, exchange the pending one-time request:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
node <skill-dir>/scripts/agentflow-cli.mjs auth complete
|
|
85
|
+
node <skill-dir>/scripts/agentflow-cli.mjs auth status
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`auth start` never prints the secret device code. `auth complete` saves a separate CLI credential in
|
|
89
|
+
`~/.agentflow/auth.json` with owner-only permissions; it never copies the browser cookie. Use
|
|
90
|
+
`AGENTFLOW_AUTH_FILE` only for isolated automation or tests. Revoke the CLI Session and clear its
|
|
91
|
+
local profile with `auth logout`. Do not send the authorization URL to anyone except the requesting
|
|
92
|
+
user; although it contains no access token, it represents an active approval request.
|
|
70
93
|
|
|
71
94
|
## Configuration
|
|
72
95
|
|
|
@@ -75,10 +98,12 @@ The CLI reads configuration in this order:
|
|
|
75
98
|
1. CLI flags: `--base-url`, `--token`
|
|
76
99
|
2. Environment variables: `AGENTFLOW_BASE_URL`, `AGENTFLOW_TOKEN`, `AGENTFLOW_SESSION_TOKEN`
|
|
77
100
|
3. Env files: `AGENTFLOW_ENV_FILE`, then `.env`, `.agentflow.env`, then `~/.agentflow.env`
|
|
101
|
+
4. Browser-authorized profile: `~/.agentflow/auth.json`
|
|
78
102
|
|
|
79
103
|
Default base URL: `http://ai.mengma.bigo.inner/`.
|
|
80
104
|
|
|
81
|
-
|
|
105
|
+
For CI or service accounts, `AGENTFLOW_TOKEN` or `AGENTFLOW_SESSION_TOKEN` overrides the saved
|
|
106
|
+
profile. Never print any token in the final answer or logs.
|
|
82
107
|
|
|
83
108
|
Example `.env`:
|
|
84
109
|
|
|
@@ -104,16 +129,14 @@ List flows:
|
|
|
104
129
|
node <skill-dir>/scripts/agentflow-cli.mjs list-flows
|
|
105
130
|
```
|
|
106
131
|
|
|
107
|
-
|
|
108
|
-
Node DSL workflow is documented in `agentflow-node-dsl`):
|
|
132
|
+
Validate and lay out Workspace DSL with the same bundled CLI:
|
|
109
133
|
|
|
110
134
|
```bash
|
|
111
|
-
agentflow
|
|
112
|
-
|
|
113
|
-
agentflow validate MyFlow --json
|
|
135
|
+
node <skill-dir>/scripts/agentflow-cli.mjs dsl-lint --file <flowDir>
|
|
136
|
+
node <skill-dir>/scripts/agentflow-cli.mjs dsl-layout --file <flowDir>
|
|
114
137
|
```
|
|
115
138
|
|
|
116
|
-
|
|
139
|
+
Add `--all` to `dsl-layout` only for a new graph or an explicitly requested full rearrangement.
|
|
117
140
|
|
|
118
141
|
To distribute a complete package directory (including `scripts/`, `templates/`, or assets) through
|
|
119
142
|
an AgentFlow server, use the token-backed commands. The CLI packs the directory as ZIP; `index.mjs`
|
|
@@ -158,8 +181,8 @@ import myNode from "marketplace:my_node@1.0.0";
|
|
|
158
181
|
const result = myNode("My node", { input: "value" });
|
|
159
182
|
```
|
|
160
183
|
|
|
161
|
-
Run
|
|
162
|
-
|
|
184
|
+
Run the bundled `dsl-lint` command with that workspace as `--workspace-root` before publishing the
|
|
185
|
+
flow. `publish-flow` also checks that the server contains every exact imported version before it
|
|
163
186
|
writes the Flow. Do not unpack ZIPs by hand or copy only `index.mjs`; relative package files are part
|
|
164
187
|
of the node's versioned content.
|
|
165
188
|
|
|
@@ -169,7 +192,8 @@ Publish a new local Flow after the user has reviewed it:
|
|
|
169
192
|
node <skill-dir>/scripts/agentflow-cli.mjs publish-flow \
|
|
170
193
|
--flow-id release-check \
|
|
171
194
|
--file .workspace/agentflow/pipelines/release-check/flow.yaml \
|
|
172
|
-
--target-space personal
|
|
195
|
+
--target-space personal \
|
|
196
|
+
--schedule disabled
|
|
173
197
|
```
|
|
174
198
|
|
|
175
199
|
When the reviewed code Flow contains `nodes/`, publish the Flow and all complete package directories
|
|
@@ -180,6 +204,7 @@ node <skill-dir>/scripts/agentflow-cli.mjs publish-flow \
|
|
|
180
204
|
--flow-id release-check \
|
|
181
205
|
--file .workspace/agentflow/pipelines/release-check \
|
|
182
206
|
--target-space personal \
|
|
207
|
+
--schedule disabled \
|
|
183
208
|
--with-dependencies
|
|
184
209
|
```
|
|
185
210
|
|
|
@@ -188,7 +213,7 @@ and rewrites relative node imports only in the upload payload. It never edits lo
|
|
|
188
213
|
`workspace.flow.js`. Without `--with-dependencies`, `publish-flow` continues to reject Flow directories
|
|
189
214
|
that contain `nodes/` or `workspace.nodes.json` rather than silently dropping them.
|
|
190
215
|
|
|
191
|
-
Destinations are `personal`, `workspace`, and `team`. `team` creates a workspace Flow and shares it as editor with the current account's active team. Publishing is create-only by default. If the exact Flow already exists, stop and ask whether to update it; only after explicit confirmation rerun with `--replace`. Replacement first reads the server revision and submits it with the update.
|
|
216
|
+
Destinations are `personal`, `workspace`, and `team`. `team` creates a workspace Flow and shares it as editor with the current account's active team. `publish-flow` defaults to `--schedule disabled`; use `enabled` only after explicit confirmation, and reserve `preserve` for migrations. Publishing is create-only by default. If the exact Flow already exists, stop and ask whether to update it; only after explicit confirmation rerun with `--replace`. Replacement first reads the server revision and submits it with the update.
|
|
192
217
|
|
|
193
218
|
Read one flow graph:
|
|
194
219
|
|
|
@@ -249,6 +274,82 @@ This is for visual review only. It does not publish a formal Flow/Pipeline or
|
|
|
249
274
|
create schedules. The returned temporary project is hidden from the normal
|
|
250
275
|
Flow list and must not be treated as a durable source of truth.
|
|
251
276
|
|
|
277
|
+
## Runnable Workspace drafts
|
|
278
|
+
|
|
279
|
+
For the review-and-test loop, use a Draft instead of the read-only Preview. A Draft is private to
|
|
280
|
+
the token owner, hidden from the formal Flow list, writable in the Workspace UI, runnable, and
|
|
281
|
+
automatically removed after its TTL. Scheduled Run nodes may be present, but Draft saves never arm
|
|
282
|
+
real schedules.
|
|
283
|
+
|
|
284
|
+
Create one after DSL lint and layout:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
node <skill-dir>/scripts/agentflow-cli.mjs draft-create \
|
|
288
|
+
--file .workspace/agentflow/pipelines/<flow-id> \
|
|
289
|
+
--ttl-seconds 7200
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
If the Flow contains local `nodes/`, add `--with-dependencies`; this uploads the complete immutable
|
|
293
|
+
packages before creating the Draft. Reuse the returned Draft and URL while iterating:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
node <skill-dir>/scripts/agentflow-cli.mjs draft-pull \
|
|
297
|
+
--draft-id <draft-id> \
|
|
298
|
+
--output .workspace/agentflow/pipelines/<flow-id> \
|
|
299
|
+
--replace
|
|
300
|
+
|
|
301
|
+
node <skill-dir>/scripts/agentflow-cli.mjs draft-update \
|
|
302
|
+
--draft-id <draft-id> \
|
|
303
|
+
--base-revision <revision-from-create-update-or-pull> \
|
|
304
|
+
--file .workspace/agentflow/pipelines/<flow-id>
|
|
305
|
+
|
|
306
|
+
node <skill-dir>/scripts/agentflow-cli.mjs draft-run \
|
|
307
|
+
--draft-id <draft-id> \
|
|
308
|
+
--run-node-id <run-node-id> \
|
|
309
|
+
--input topic=hello
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
`draft-update` resets previous runtime output unless `--keep-runtime` is passed. It requires the
|
|
313
|
+
revision returned by the preceding create, update, or pull and rejects stale updates. If the user
|
|
314
|
+
edited the Draft in the UI, run `draft-pull` before changing the local DSL; do not retry a 409 with
|
|
315
|
+
an invented or freshly fetched revision against an unrefreshed local file.
|
|
316
|
+
|
|
317
|
+
After the user explicitly approves the tested Draft, promote that exact graph. Scheduling defaults
|
|
318
|
+
to disabled; choose `enabled` only after the user asked to activate it:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
node <skill-dir>/scripts/agentflow-cli.mjs draft-publish \
|
|
322
|
+
--draft-id <draft-id> \
|
|
323
|
+
--flow-id <flow-id> \
|
|
324
|
+
--target-space personal \
|
|
325
|
+
--schedule disabled
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Promotion is create-only and keeps the Draft until TTL expiry for recovery. `--schedule enabled`
|
|
329
|
+
enables every Scheduled Run entry and fails when the Draft has none. `--schedule preserve` retains
|
|
330
|
+
the graph values and is for advanced migrations, not the normal confirmation flow.
|
|
331
|
+
|
|
332
|
+
## Scheduled Run operations
|
|
333
|
+
|
|
334
|
+
Manage published Workspace schedules explicitly:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
node <skill-dir>/scripts/agentflow-cli.mjs schedule-list --flow-id <flow-id>
|
|
338
|
+
node <skill-dir>/scripts/agentflow-cli.mjs schedule-enable \
|
|
339
|
+
--flow-id <flow-id> --schedule-node-id <node-id>
|
|
340
|
+
node <skill-dir>/scripts/agentflow-cli.mjs schedule-disable \
|
|
341
|
+
--flow-id <flow-id> --schedule-node-id <node-id>
|
|
342
|
+
node <skill-dir>/scripts/agentflow-cli.mjs schedule-set \
|
|
343
|
+
--flow-id <flow-id> --schedule-node-id <node-id> \
|
|
344
|
+
--enabled true --cron "0 8 * * *" --timezone Asia/Shanghai --overlap-policy skip
|
|
345
|
+
node <skill-dir>/scripts/agentflow-cli.mjs schedule-run-now \
|
|
346
|
+
--flow-id <flow-id> --schedule-node-id <node-id>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
After publishing or changing a schedule, require `enabled`, `lastStatus`, and `nextRunAt` in the
|
|
350
|
+
returned schedule state before reporting it as armed. Draft schedule configuration is visible and
|
|
351
|
+
editable but returns `suppressed: true` and never gets a `nextRunAt` registration.
|
|
352
|
+
|
|
252
353
|
Run a Workspace graph:
|
|
253
354
|
|
|
254
355
|
```bash
|
|
@@ -306,14 +407,18 @@ The only admin write exception is audited version-membership repair. Read its st
|
|
|
306
407
|
|
|
307
408
|
## Workflow
|
|
308
409
|
|
|
309
|
-
1. Check
|
|
410
|
+
1. Check authorization with `config`. If missing, use `auth start`, give the URL to the user, then
|
|
411
|
+
run `auth complete` only after the user approves it.
|
|
310
412
|
2. Use `list-workspace` or `list-flows` to discover Flow/Pipeline targets only. Use `node-package-search` before creating a new code node. Use `publish-flow` only after a local Flow has passed validation and the user has confirmed the preview.
|
|
311
|
-
3.
|
|
312
|
-
4. Use `
|
|
413
|
+
3. For a new user-authored Flow, prefer `draft-create` → `draft-run`/`draft-update` → explicit user confirmation → `draft-publish`. Keep `workspace-preview` for read-only sharing.
|
|
414
|
+
4. Use `run` to start a published flow. If the task needs the generated page/text, inspect returned `displayOutputs` or call `display-outputs`.
|
|
415
|
+
5. Use `status`, `list-run-by-workspace`, and `logs` when a run is active, failed, or needs debugging. Use `schedule-list` after every schedule mutation or scheduled publish.
|
|
313
416
|
|
|
314
417
|
## Failure Handling
|
|
315
418
|
|
|
316
|
-
- If
|
|
419
|
+
- If authorization is missing, use `auth start` and return the URL. Do not ask the user to paste a
|
|
420
|
+
personal Token into the conversation. Use environment Tokens only for non-interactive CI or
|
|
421
|
+
service accounts.
|
|
317
422
|
- If `publish-flow` returns 409, do not add `--replace` automatically. Ask the user to confirm updating the existing Flow.
|
|
318
423
|
- If team publishing says no active team is assigned, keep the local draft and ask the user to choose personal/workspace or have an admin assign the account to a team.
|
|
319
424
|
- If the API returns 401/403, do not retry with a printed token. Ask the user to refresh the token.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "AgentFlow CLI"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $agentflow-cli to
|
|
3
|
+
short_description: "Draft, test, publish, and schedule AgentFlow workspaces"
|
|
4
|
+
default_prompt: "Use $agentflow-cli to create a runnable Draft, test it, publish it after confirmation, and manage its schedule."
|