@josephyan/qingflow-cli 0.2.0-beta.67 → 0.2.0-beta.69
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 +2 -2
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/qingflow_mcp/builder_facade/models.py +348 -2
- package/src/qingflow_mcp/builder_facade/service.py +2006 -149
- package/src/qingflow_mcp/cli/commands/record.py +2 -0
- package/src/qingflow_mcp/server.py +2 -1
- package/src/qingflow_mcp/server_app_user.py +2 -1
- package/src/qingflow_mcp/solution/compiler/form_compiler.py +29 -0
- package/src/qingflow_mcp/solution/spec_models.py +2 -0
- package/src/qingflow_mcp/tools/ai_builder_tools.py +99 -10
- package/src/qingflow_mcp/tools/approval_tools.py +31 -2
- package/src/qingflow_mcp/tools/code_block_tools.py +91 -14
- package/src/qingflow_mcp/tools/record_tools.py +549 -185
- package/src/qingflow_mcp/tools/task_context_tools.py +26 -1
|
@@ -214,6 +214,7 @@ class TaskContextTools(ToolBase):
|
|
|
214
214
|
workflow_node_id=workflow_node_id,
|
|
215
215
|
include_candidates=include_candidates,
|
|
216
216
|
include_associated_reports=include_associated_reports,
|
|
217
|
+
current_uid=session_profile.uid,
|
|
217
218
|
)
|
|
218
219
|
return {
|
|
219
220
|
"profile": profile,
|
|
@@ -265,6 +266,7 @@ class TaskContextTools(ToolBase):
|
|
|
265
266
|
workflow_node_id=workflow_node_id,
|
|
266
267
|
include_candidates=False,
|
|
267
268
|
include_associated_reports=False,
|
|
269
|
+
current_uid=session_profile.uid,
|
|
268
270
|
)
|
|
269
271
|
except QingflowApiError as error:
|
|
270
272
|
if error.backend_code == 46001:
|
|
@@ -284,6 +286,14 @@ class TaskContextTools(ToolBase):
|
|
|
284
286
|
raise_tool_error(
|
|
285
287
|
QingflowApiError.config_error("fields is required and must be non-empty for action 'save_only'")
|
|
286
288
|
)
|
|
289
|
+
if normalized_action == "transfer":
|
|
290
|
+
target_member_id = self._extract_positive_int(body, "target_member_id", aliases=("uid", "targetMemberId"))
|
|
291
|
+
if target_member_id == session_profile.uid:
|
|
292
|
+
raise_tool_error(
|
|
293
|
+
QingflowApiError.config_error(
|
|
294
|
+
"task transfer does not support transferring to the current user; choose another transfer member"
|
|
295
|
+
)
|
|
296
|
+
)
|
|
287
297
|
capabilities = task_context.get("capabilities") or {}
|
|
288
298
|
available_actions = capabilities.get("available_actions") or []
|
|
289
299
|
if normalized_action not in available_actions:
|
|
@@ -912,6 +922,7 @@ class TaskContextTools(ToolBase):
|
|
|
912
922
|
workflow_node_id=workflow_node_id,
|
|
913
923
|
include_candidates=False,
|
|
914
924
|
include_associated_reports=True,
|
|
925
|
+
current_uid=session_profile.uid,
|
|
915
926
|
)
|
|
916
927
|
report_item = self._find_associated_report(task_context, report_id)
|
|
917
928
|
if report_item is None:
|
|
@@ -1094,6 +1105,7 @@ class TaskContextTools(ToolBase):
|
|
|
1094
1105
|
workflow_node_id=workflow_node_id,
|
|
1095
1106
|
include_candidates=False,
|
|
1096
1107
|
include_associated_reports=False,
|
|
1108
|
+
current_uid=session_profile.uid,
|
|
1097
1109
|
)
|
|
1098
1110
|
visibility = task_context.get("visibility") or {}
|
|
1099
1111
|
if not visibility.get("audit_record_visible"):
|
|
@@ -1149,6 +1161,7 @@ class TaskContextTools(ToolBase):
|
|
|
1149
1161
|
workflow_node_id: int,
|
|
1150
1162
|
include_candidates: bool,
|
|
1151
1163
|
include_associated_reports: bool,
|
|
1164
|
+
current_uid: int | None = None,
|
|
1152
1165
|
) -> dict[str, Any]:
|
|
1153
1166
|
audit_infos = self.backend.request(
|
|
1154
1167
|
"GET",
|
|
@@ -1198,7 +1211,7 @@ class TaskContextTools(ToolBase):
|
|
|
1198
1211
|
f"/app/{app_key}/apply/{record_id}/transfer/member",
|
|
1199
1212
|
params={"pageNum": 1, "pageSize": 20, "auditNodeId": workflow_node_id},
|
|
1200
1213
|
)
|
|
1201
|
-
transfer_items = _approval_page_items(transfer_result)
|
|
1214
|
+
transfer_items = self._filter_transfer_members(_approval_page_items(transfer_result), current_uid=current_uid)
|
|
1202
1215
|
|
|
1203
1216
|
update_schema_state = self._build_task_update_schema(
|
|
1204
1217
|
profile=profile,
|
|
@@ -1736,6 +1749,18 @@ class TaskContextTools(ToolBase):
|
|
|
1736
1749
|
return [item for item in revert_nodes if isinstance(item, dict)]
|
|
1737
1750
|
return [item for item in _approval_page_items(payload) if isinstance(item, dict)]
|
|
1738
1751
|
|
|
1752
|
+
def _filter_transfer_members(self, items: Any, *, current_uid: int | None) -> list[dict[str, Any]]:
|
|
1753
|
+
if not isinstance(items, list):
|
|
1754
|
+
return []
|
|
1755
|
+
filtered: list[dict[str, Any]] = []
|
|
1756
|
+
for item in items:
|
|
1757
|
+
if not isinstance(item, dict):
|
|
1758
|
+
continue
|
|
1759
|
+
if current_uid is not None and item.get("uid") == current_uid:
|
|
1760
|
+
continue
|
|
1761
|
+
filtered.append(item)
|
|
1762
|
+
return filtered
|
|
1763
|
+
|
|
1739
1764
|
def _find_associated_report(self, task_context: dict[str, Any], report_id: int) -> dict[str, Any] | None:
|
|
1740
1765
|
associated_reports = ((task_context.get("associated_reports") or {}).get("items") or [])
|
|
1741
1766
|
for item in associated_reports:
|