@qingflow-tech/qingflow-cli 1.0.31 → 1.0.32

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
@@ -3,13 +3,13 @@
3
3
  Install:
4
4
 
5
5
  ```bash
6
- npm install @qingflow-tech/qingflow-cli@1.0.31
6
+ npm install @qingflow-tech/qingflow-cli@1.0.32
7
7
  ```
8
8
 
9
9
  Run:
10
10
 
11
11
  ```bash
12
- npx -y -p @qingflow-tech/qingflow-cli@1.0.31 qingflow
12
+ npx -y -p @qingflow-tech/qingflow-cli@1.0.32 qingflow
13
13
  ```
14
14
 
15
15
  Environment:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingflow-tech/qingflow-cli",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
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.0.31"
7
+ version = "1.0.32"
8
8
  description = "User-authenticated MCP server for Qingflow"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -22,10 +22,11 @@
22
22
 
23
23
  ---
24
24
 
25
- ## 2. 定位方式(二选一,勿混用半截参数)
25
+ ## 2. 定位方式
26
26
 
27
27
  - **唯一默认路径**:全程使用列表里拿到的 `**task_id`**(字符串十进制;与大雪花 ID 一致时保持 **引号 / JSON 字符串** 习惯,避免其它子系统精度问题)。`task_id` 必须来自 `task_list.data.items[].task_id`,不是列表序号、record_id 或 workflow_node_id。
28
- - `app_key / record_id / workflow_node_id` 只用于用户已明确提供完整 locator 的排障场景;智能体不要从其它输出里自行拼三键。
28
+ - `task_action_execute` / `task action` **只使用 `task_id` 定位**。不要传 `app_key`、`record_id`、`workflow_node_id`,也不要从其它输出里自行拼三键。
29
+ - `task get` / `task log` / `task report` 的底层读接口仍可能保留完整 locator 作为兼容排障能力;主链路不使用。
29
30
 
30
31
  ---
31
32
 
@@ -110,6 +111,7 @@ qingflow --json task action \
110
111
 
111
112
  **约束摘要**(与实现一致):
112
113
 
114
+ - **定位只认 `task_id`**:来自 `task list` 的 `data.items[].task_id`;`app_key`、`record_id`、`workflow_node_id` 不是动作执行入参。
113
115
  - `**approve` / `reject`**:执行上下文以当前待办详情或用户/前端已给出的显式 `formId` 为准;只有缺少 `formId` 时才兜底读取应用 baseInfo。不要把应用 baseInfo 的 `40002` 当作待办动作最终无权结论,最终是否可执行以后端审批动作接口为准。
114
116
  - `**save_only`**:必须 提供非空 `**--fields-file`**(或 payload 与 fields 不能同时塞 `answers` 与 fields,具体以报错为准)。以当前待办节点的 `data.editable_fields` / `editableQueIds` 为准;若 `editableQueIds` 被当前权限链路挡住,但任务详情里的 `queAuthSetting` 已暴露可编辑字段,CLI 会按任务详情继续允许 save-only,并由最终保存接口裁决。申请表单 schema 或辅助 `editableQueIds` 的 `40002` 不是待办字段保存的最终无权结论。
115
117
  - `**transfer**`:`**payload` 内需要** `target_member_id`(或别名 `uid` / `targetMemberId`);不能转给当前登录人。
@@ -162,9 +162,6 @@ def _handle_action(args: argparse.Namespace, context: CliContext) -> dict:
162
162
  return context.task.task_action_execute(
163
163
  profile=args.profile,
164
164
  task_id=args.task_id,
165
- app_key=args.app_key or "",
166
- record_id=args.record_id or "",
167
- workflow_node_id=int(args.workflow_node_id or 0),
168
165
  action=args.action,
169
166
  payload=payload,
170
167
  fields=fields,
@@ -225,9 +222,6 @@ def _run_task_workbench_task_loop(args: argparse.Namespace, context: CliContext)
225
222
  result = context.task.task_action_execute(
226
223
  profile=args.profile,
227
224
  task_id=args.task_id,
228
- app_key=args.app_key or "",
229
- record_id=args.record_id or "",
230
- workflow_node_id=int(args.workflow_node_id or 0),
231
225
  action=args.action,
232
226
  payload=payload_selection,
233
227
  fields={},
@@ -186,7 +186,7 @@ Use `record_code_block_run` when the user wants to execute a form code-block fie
186
186
  - `task_list` returns task-card summaries keyed by `task_id`.
187
187
  - For detail reads and actions, pass the exact `task_id` from `task_list.data.items[].task_id`.
188
188
  - `task_id` is not a row number, list index, record id, or workflow node id.
189
- - Do not reconstruct task actions from `app_key + record_id + workflow_node_id` unless the user explicitly provides that full locator for troubleshooting.
189
+ - `task_action_execute` only uses `task_id`; do not reconstruct or pass `app_key + record_id + workflow_node_id` for actions.
190
190
  - `task_workflow_log_get(task_id=...)` and `task_associated_report_detail_get(task_id=...)` are also supported for the current todo context.
191
191
  - Use `task_associated_report_detail_get` for associated view or report details.
192
192
  - Use `task_workflow_log_get` for the current task context workflow log page. For full record-level data/workflow logs, first choose an accessible view with `app_get`, then call `record_logs_get(app_key, record_id, view_id)` with that same explicit `view_id`.
@@ -191,7 +191,7 @@ Use export only when the user explicitly asks to export/download/generate an Exc
191
191
  - `task_list` returns task-card summaries keyed by `task_id`.
192
192
  - For detail reads and actions, pass the exact `task_id` from `task_list.data.items[].task_id`.
193
193
  - `task_id` is not a row number, list index, record id, or workflow node id.
194
- - Do not reconstruct task actions from `app_key + record_id + workflow_node_id` unless the user explicitly provides that full locator for troubleshooting.
194
+ - `task_action_execute` only uses `task_id`; do not reconstruct or pass `app_key + record_id + workflow_node_id` for actions.
195
195
  - `task_workflow_log_get(task_id=...)` and `task_associated_report_detail_get(task_id=...)` are also supported for the current todo context.
196
196
  - Use `task_associated_report_detail_get` for associated view or report details.
197
197
  - Use `task_workflow_log_get` for the current task context workflow log page. For full record-level data/workflow logs, first choose an accessible view with `app_get`, then call `record_logs_get(app_key, record_id, view_id)` with that same explicit `view_id`.
@@ -1055,7 +1055,7 @@ class ApprovalTools(ToolBase):
1055
1055
  if node_id is None:
1056
1056
  node_payload = dict(payload or {})
1057
1057
  node_id = self._extract_node_id(node_payload)
1058
- delegated = TaskContextTools(self.sessions, self.backend).task_action_execute(
1058
+ delegated = TaskContextTools(self.sessions, self.backend)._task_action_execute_with_locator(
1059
1059
  profile=profile,
1060
1060
  app_key=app_key,
1061
1061
  record_id=record_id,
@@ -126,9 +126,6 @@ class TaskContextTools(ToolBase):
126
126
  return self.task_action_execute(
127
127
  profile=profile,
128
128
  task_id=task_id,
129
- app_key="",
130
- record_id="",
131
- workflow_node_id=0,
132
129
  action=action,
133
130
  payload=payload or {},
134
131
  fields=fields or {},
@@ -317,9 +314,7 @@ class TaskContextTools(ToolBase):
317
314
  self,
318
315
  *,
319
316
  profile: str,
320
- app_key: str,
321
- record_id: Any,
322
- workflow_node_id: int,
317
+ task_id: Any,
323
318
  fields: dict[str, Any] | None = None,
324
319
  ) -> dict[str, Any]:
325
320
  """执行任务相关逻辑。"""
@@ -328,9 +323,7 @@ class TaskContextTools(ToolBase):
328
323
  raise_tool_error(QingflowApiError.config_error("fields is required and must be non-empty for task_save_only"))
329
324
  return self.task_action_execute(
330
325
  profile=profile,
331
- app_key=app_key,
332
- record_id=record_id,
333
- workflow_node_id=workflow_node_id,
326
+ task_id=task_id,
334
327
  action="save_only",
335
328
  payload={},
336
329
  fields=field_updates,
@@ -338,6 +331,34 @@ class TaskContextTools(ToolBase):
338
331
 
339
332
  @tool_cn_name("执行任务动作")
340
333
  def task_action_execute(
334
+ self,
335
+ *,
336
+ profile: str,
337
+ task_id: Any,
338
+ action: str,
339
+ payload: dict[str, Any],
340
+ fields: dict[str, Any] | None = None,
341
+ ) -> dict[str, Any]:
342
+ """执行任务相关逻辑。"""
343
+ if task_id in (None, ""):
344
+ raise_tool_error(
345
+ QingflowApiError.config_error(
346
+ "task_id is required for task_action_execute; get it from task_list.data.items[].task_id"
347
+ )
348
+ )
349
+
350
+ return self._task_action_execute_with_locator(
351
+ profile=profile,
352
+ task_id=task_id,
353
+ app_key="",
354
+ record_id="",
355
+ workflow_node_id=0,
356
+ action=action,
357
+ payload=payload,
358
+ fields=fields,
359
+ )
360
+
361
+ def _task_action_execute_with_locator(
341
362
  self,
342
363
  *,
343
364
  profile: str,
@@ -349,10 +370,8 @@ class TaskContextTools(ToolBase):
349
370
  payload: dict[str, Any],
350
371
  fields: dict[str, Any] | None = None,
351
372
  ) -> dict[str, Any]:
352
- """执行任务相关逻辑。"""
353
373
  if task_id in (None, ""):
354
374
  normalize_positive_id_int(record_id, field_name="record_id")
355
-
356
375
  normalized_action = (action or "").strip().lower()
357
376
  if normalized_action not in {"approve", "reject", "rollback", "transfer", "urge", "save_only"}:
358
377
  raise_tool_error(
@@ -492,7 +511,7 @@ class TaskContextTools(ToolBase):
492
511
  raise_tool_error(QingflowApiError.config_error(message))
493
512
  raise_tool_error(
494
513
  QingflowApiError.config_error(
495
- f"task action '{normalized_action}' is not currently available for app_key='{resolved_app_key}' record_id={record_id_text} workflow_node_id={resolved_workflow_node_id}"
514
+ f"task action '{normalized_action}' is not currently available for task_id='{task_id_text}'"
496
515
  )
497
516
  )
498
517
  feedback_required_for = capabilities.get("action_constraints", {}).get("feedback_required_for") or []