@qingflow-tech/qingflow-app-user-mcp 1.1.1 → 1.1.2
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/tools/task_context_tools.py +35 -11
package/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Install:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @qingflow-tech/qingflow-app-user-mcp@1.1.
|
|
6
|
+
npm install @qingflow-tech/qingflow-app-user-mcp@1.1.2
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y -p @qingflow-tech/qingflow-app-user-mcp@1.1.
|
|
12
|
+
npx -y -p @qingflow-tech/qingflow-app-user-mcp@1.1.2 qingflow-app-user-mcp
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Environment:
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -33,6 +33,7 @@ from .record_tools import (
|
|
|
33
33
|
_collect_question_relations,
|
|
34
34
|
_field_ref_payload,
|
|
35
35
|
_merge_field_indexes,
|
|
36
|
+
_normalize_form_schema,
|
|
36
37
|
_subtable_descendant_ids,
|
|
37
38
|
)
|
|
38
39
|
from .task_tools import TaskTools, _task_page_amount, _task_page_items, _task_page_total
|
|
@@ -2487,21 +2488,43 @@ class TaskContextTools(ToolBase):
|
|
|
2487
2488
|
) -> dict[str, Any]:
|
|
2488
2489
|
"""执行内部辅助逻辑。"""
|
|
2489
2490
|
record_id_text = stringify_backend_id(record_id)
|
|
2491
|
+
schema_warnings: list[JSONObject] = []
|
|
2490
2492
|
try:
|
|
2491
|
-
app_schema =
|
|
2493
|
+
app_schema = _normalize_form_schema(
|
|
2494
|
+
self.backend.request(
|
|
2495
|
+
"GET",
|
|
2496
|
+
context,
|
|
2497
|
+
f"/app/{app_key}/form",
|
|
2498
|
+
params={"type": 3, "auditNodeId": workflow_node_id},
|
|
2499
|
+
)
|
|
2500
|
+
)
|
|
2492
2501
|
except QingflowApiError as error:
|
|
2493
2502
|
if not _is_task_optional_read_error(error):
|
|
2494
2503
|
raise
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
source_error=error,
|
|
2504
|
+
schema_warnings.append(
|
|
2505
|
+
{
|
|
2506
|
+
"code": "TASK_NODE_UPDATE_SCHEMA_UNAVAILABLE",
|
|
2507
|
+
"message": "task update schema fell back to the applicant form because the processing-node form was unavailable in this permission context.",
|
|
2508
|
+
"backend_code": error.backend_code,
|
|
2509
|
+
"http_status": error.http_status,
|
|
2510
|
+
"request_id": error.request_id,
|
|
2511
|
+
}
|
|
2504
2512
|
)
|
|
2513
|
+
try:
|
|
2514
|
+
app_schema = self._record_tools._get_form_schema(profile, context, app_key, force_refresh=False)
|
|
2515
|
+
except QingflowApiError as fallback_error:
|
|
2516
|
+
if not _is_task_optional_read_error(fallback_error):
|
|
2517
|
+
raise
|
|
2518
|
+
return self._build_task_update_schema_from_runtime_answers(
|
|
2519
|
+
profile=profile,
|
|
2520
|
+
context=context,
|
|
2521
|
+
app_key=app_key,
|
|
2522
|
+
record_id=record_id,
|
|
2523
|
+
workflow_node_id=workflow_node_id,
|
|
2524
|
+
node_info=node_info,
|
|
2525
|
+
current_answers=current_answers,
|
|
2526
|
+
source_error=fallback_error,
|
|
2527
|
+
)
|
|
2505
2528
|
|
|
2506
2529
|
question_relations = _collect_question_relations(app_schema)
|
|
2507
2530
|
linked_field_ids = _collect_linked_required_field_ids(question_relations)
|
|
@@ -2512,12 +2535,13 @@ class TaskContextTools(ToolBase):
|
|
|
2512
2535
|
linked_field_ids=linked_field_ids,
|
|
2513
2536
|
)
|
|
2514
2537
|
index = _merge_field_indexes(base_index, linked_hidden_index)
|
|
2515
|
-
editable_question_ids,
|
|
2538
|
+
editable_question_ids, editable_warnings, source = self._resolve_task_editable_question_ids(
|
|
2516
2539
|
context,
|
|
2517
2540
|
app_key=app_key,
|
|
2518
2541
|
workflow_node_id=workflow_node_id,
|
|
2519
2542
|
node_info=node_info,
|
|
2520
2543
|
)
|
|
2544
|
+
schema_warnings.extend(editable_warnings)
|
|
2521
2545
|
index, augmentation_warnings = self._augment_task_editable_field_index(
|
|
2522
2546
|
index=index,
|
|
2523
2547
|
current_answers=current_answers,
|