@qingflow-tech/qingflow-cli 1.1.45-beta.5 → 1.1.45-beta.6

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 CHANGED
@@ -7,7 +7,7 @@ Qingflow CLI 是轻流面向开发者和 AI Agent 的命令行工具。它把轻
7
7
  ## 安装
8
8
 
9
9
  ```bash
10
- npm install @qingflow-tech/qingflow-cli@1.1.45-beta.5
10
+ npm install @qingflow-tech/qingflow-cli@1.1.45-beta.6
11
11
  ```
12
12
 
13
13
  推荐从官网复制这一条一键安装 Qingflow CLI:
@@ -21,7 +21,7 @@ npx qingflow-cli@latest install
21
21
  ## 运行
22
22
 
23
23
  ```bash
24
- npx -y -p @qingflow-tech/qingflow-cli@1.1.45-beta.5 qingflow
24
+ npx -y -p @qingflow-tech/qingflow-cli@1.1.45-beta.6 qingflow
25
25
  ```
26
26
 
27
27
  全局安装后可以直接运行:
@@ -62,7 +62,7 @@ qingflow-skills install --agent codex --scope user
62
62
  如果你通过一次性 `npx -p` 执行 skills 安装,建议加 `--copy`,避免 symlink 指向 npm 临时执行缓存:
63
63
 
64
64
  ```bash
65
- npx -y -p @qingflow-tech/qingflow-cli@1.1.45-beta.5 qingflow-skills install --agent codex --scope user --copy
65
+ npx -y -p @qingflow-tech/qingflow-cli@1.1.45-beta.6 qingflow-skills install --agent codex --scope user --copy
66
66
  ```
67
67
 
68
68
  `qingflow-skills install` 默认使用 symlink,且遇到同名 skill 不会覆盖;只有显式传入 `--force` 才会替换。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingflow-tech/qingflow-cli",
3
- "version": "1.1.45-beta.5",
3
+ "version": "1.1.45-beta.6",
4
4
  "description": "Human-friendly Qingflow command line interface for auth, record operations, import, tasks, and stable builder flows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qingflow-mcp"
7
- version = "1.1.45b5"
7
+ version = "1.1.45b6"
8
8
  description = "User-authenticated MCP server for Qingflow"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -20,6 +20,8 @@ Workflow examples depend on live `builder flow schema`, field ids, role ids, and
20
20
 
21
21
  ## Recommended write path
22
22
 
23
+ - Workflow editing is temporarily unavailable in the CLI. Before a flow write, the CLI reads the current `spec.nodes`; when the current node count exceeds 5, it stops without writing and reports that the feature is under maintenance. The submitted spec node count does not affect this decision.
24
+ - Writes remain available when the current flow has 5 or fewer nodes, including initial workflow creation.
23
25
  - Before applying a workflow, verify the app has an explicit business status select field such as `状态`, `处理状态`, `审批状态`, `工单状态`, `计划状态`, `报工状态`, or `单据状态`. Domain result fields are not enough by themselves: for example, `检验结论` should be paired with `处理状态`.
24
26
  - For workflow creation or replacement, always use `builder flow get` / `builder flow schema`, then submit a complete WorkflowSpec with `--spec-file`.
25
27
  - Do not use `--nodes-file` + `--transitions-file` in skill-led workflow builds. Even simple linear workflows should be represented as WorkflowSpec.
@@ -30,6 +32,8 @@ Workflow examples depend on live `builder flow schema`, field ids, role ids, and
30
32
 
31
33
  All workflow creation and replacement uses WorkflowSpec through `--spec-file`. Existing-node maintenance can use `--patch-nodes-file` after readback. This is the only skill-led workflow write path for linear, branching, Q-Robot, approval, filling, and cc flows.
32
34
 
35
+ While editing is under maintenance, the CLI blocks either input mode when the current flow has more than 5 nodes. It does not reject a creation because the new WorkflowSpec itself has more than 5 nodes.
36
+
33
37
  ## Detailed workflow docs
34
38
 
35
39
  Use [workflow/README.md](./workflow/README.md) for full staged workflow modeling and [workflow/workflow-schema.json](./workflow/workflow-schema.json) for schema validation.
@@ -19,8 +19,8 @@
19
19
  |------|------|
20
20
  | `qingflow builder flow schema --json` | 获取最新 WorkflowSpecDTO JSON Schema |
21
21
  | `qingflow builder flow get --app-key <KEY>` | 读取当前工作流 spec |
22
- | `qingflow --json builder flow apply --app-key <KEY> --spec-file <FILE>` | 主链路:部署/更新 WorkflowSpec |
23
- | `qingflow --json builder flow apply --app-key <KEY> --patch-nodes-file <PATCH>` | 局部修改现有节点 |
22
+ | `qingflow --json builder flow apply --app-key <KEY> --spec-file <FILE>` | 主链路:创建 WorkflowSpec;当前流程节点数超过 5 时,编辑功能维护中 |
23
+ | `qingflow --json builder flow apply --app-key <KEY> --patch-nodes-file <PATCH>` | 局部修改现有节点;当前功能维护中 |
24
24
  | `qingflow builder member search --query <关键词>` | 搜索成员 |
25
25
  | `qingflow builder role search --keyword <关键词>` | 搜索角色 |
26
26
  | `qingflow --json app get --app-key <KEY>` | 获取应用信息(字段列表等) |
@@ -42,7 +42,7 @@
42
42
 
43
43
  ---
44
44
 
45
- 无论线性、分支、Q-Robot、审批、填写还是抄送流程,新建和替换都使用 WorkflowSpec `--spec-file`;已有节点的小修改才使用 `--patch-nodes-file`。不要在技能主链路使用 `--nodes-file` + `--transitions-file`。
45
+ 无论线性、分支、Q-Robot、审批、填写还是抄送流程,新建和替换都使用 WorkflowSpec `--spec-file`;已有节点的小修改才使用 `--patch-nodes-file`。当前 CLI 会按调用前的 `spec.nodes` 数判断:超过 5 个节点即停止编辑并提示功能维护中,不以提交后的节点数判断;当前节点数为 5 个及以下时允许写入,初始流程创建包含在内。不要在技能主链路使用 `--nodes-file` + `--transitions-file`。
46
46
 
47
47
  ← 返回主流程:[../SKILL.md](../../../SKILL.md)
48
48
  → 下一步:[02-update-mode.md](02-update-mode.md)
@@ -2,6 +2,8 @@
2
2
 
3
3
  当应用已有工作流时,进入**更新模式**。核心原则是**最小修改**——只改动必要的部分,保持其他结构不变。
4
4
 
5
+ 当前 CLI 的流程编辑功能维护中:写入前读取当前 `spec.nodes`,节点数超过 5 时会停止操作并返回维护提示,不会发起流程写入。判定只基于更新前的节点数,不基于本次提交后会变成多少节点;当前节点数为 5 个及以下时仍允许写入,初始流程创建包含在内。
6
+
5
7
  ## 为什么要保持节点 ID 稳定
6
8
 
7
9
  后端可能存储了 spec 中不支持的运行时配置(如审批策略、超时规则、高级权限等),这些配置与节点 ID 绑定。一旦修改节点 ID,后端会将其视为「删除旧节点 + 创建新节点」,导致不支持的配置全部丢失。
@@ -23,6 +23,11 @@ from ..json_io import load_json_value
23
23
  from .common import load_list_arg, load_object_arg, parse_bool_text, raise_config_error, require_list_arg
24
24
 
25
25
 
26
+ # BEGIN temporary flow edit maintenance guard: remove this block when flow editing is restored.
27
+ FLOW_EDIT_MAINTENANCE_NODE_THRESHOLD = 5
28
+ # END temporary flow edit maintenance guard.
29
+
30
+
26
31
  def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
27
32
  parser = subparsers.add_parser("builder", aliases=["build"], help="稳定 builder 命令")
28
33
  builder_subparsers = parser.add_subparsers(dest="builder_command", required=True)
@@ -1259,6 +1264,30 @@ def _handle_flow_apply(args: argparse.Namespace, context: CliContext) -> dict:
1259
1264
  "builder flow apply requires exactly one input mode: --spec-file or --patch-nodes-file.",
1260
1265
  fix_hint="Use --spec-file for a complete WorkflowSpec, or --patch-nodes-file for targeted edits after builder flow get.",
1261
1266
  )
1267
+ # BEGIN temporary flow edit maintenance guard: remove this block when flow editing is restored.
1268
+ current_flow = context.builder.app_flow_get(profile=args.profile, app_key=args.app_key)
1269
+ if str(current_flow.get("status") or "").lower() != "success":
1270
+ return current_flow
1271
+ current_node_count = _flow_spec_node_count(current_flow)
1272
+ if current_node_count is None:
1273
+ raise_config_error(
1274
+ "无法读取当前流程节点,未执行流程变更。",
1275
+ fix_hint="当前流程状态无法确认,未执行流程变更。请稍后重试。",
1276
+ error_code="FLOW_STATE_UNAVAILABLE",
1277
+ details={"app_key": args.app_key},
1278
+ )
1279
+ if current_node_count > FLOW_EDIT_MAINTENANCE_NODE_THRESHOLD:
1280
+ raise_config_error(
1281
+ "功能维护中,暂时不允许处理",
1282
+ fix_hint="当前流程节点超过 5 个,流程编辑功能维护中;请稍后重试。",
1283
+ error_code="FLOW_EDIT_UNDER_MAINTENANCE",
1284
+ details={
1285
+ "app_key": args.app_key,
1286
+ "current_node_count": current_node_count,
1287
+ "maintenance_node_threshold": FLOW_EDIT_MAINTENANCE_NODE_THRESHOLD,
1288
+ },
1289
+ )
1290
+ # END temporary flow edit maintenance guard.
1262
1291
  if patch_nodes:
1263
1292
  return context.builder.app_flow_apply(
1264
1293
  profile=args.profile,
@@ -1283,6 +1312,18 @@ def _handle_flow_apply(args: argparse.Namespace, context: CliContext) -> dict:
1283
1312
  )
1284
1313
 
1285
1314
 
1315
+ # BEGIN temporary flow edit maintenance guard: remove this helper when flow editing is restored.
1316
+ def _flow_spec_node_count(flow_result: dict) -> int | None:
1317
+ spec = flow_result.get("spec")
1318
+ if not isinstance(spec, dict):
1319
+ return None
1320
+ nodes = spec.get("nodes")
1321
+ return len(nodes) if isinstance(nodes, list) else None
1322
+
1323
+
1324
+ # END temporary flow edit maintenance guard.
1325
+
1326
+
1286
1327
  def _handle_flow_schema(args: argparse.Namespace, context: CliContext) -> dict:
1287
1328
  return context.builder.app_flow_get_schema(profile=args.profile, schema_version=args.schema_version)
1288
1329