@qingflow-tech/qingflow-cli 1.1.38 → 1.1.40
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 +7 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/qingflow_mcp/builder_facade/service.py +8 -8
- package/src/qingflow_mcp/server_cloud.py +89 -3
- package/src/qingflow_mcp/tools/ai_builder_tools.py +1 -59
- package/src/qingflow_mcp/tools/app_tools.py +15 -29
- package/src/qingflow_mcp/tools/approval_tools.py +16 -40
- package/src/qingflow_mcp/tools/auth_tools.py +1 -4
- package/src/qingflow_mcp/tools/base.py +16 -34
- package/src/qingflow_mcp/tools/code_block_tools.py +2 -5
- package/src/qingflow_mcp/tools/custom_button_tools.py +6 -11
- package/src/qingflow_mcp/tools/directory_tools.py +9 -16
- package/src/qingflow_mcp/tools/export_tools.py +5 -9
- package/src/qingflow_mcp/tools/feedback_tools.py +0 -2
- package/src/qingflow_mcp/tools/file_tools.py +3 -5
- package/src/qingflow_mcp/tools/import_tools.py +7 -13
- package/src/qingflow_mcp/tools/navigation_tools.py +12 -23
- package/src/qingflow_mcp/tools/package_tools.py +11 -21
- package/src/qingflow_mcp/tools/portal_tools.py +9 -17
- package/src/qingflow_mcp/tools/qingbi_report_tools.py +18 -23
- package/src/qingflow_mcp/tools/record_tools.py +97 -53
- package/src/qingflow_mcp/tools/repository_dev_tools.py +4 -7
- package/src/qingflow_mcp/tools/resource_read_tools.py +6 -9
- package/src/qingflow_mcp/tools/role_tools.py +5 -9
- package/src/qingflow_mcp/tools/solution_tools.py +4 -16
- package/src/qingflow_mcp/tools/task_context_tools.py +6 -12
- package/src/qingflow_mcp/tools/task_tools.py +12 -29
- package/src/qingflow_mcp/tools/view_tools.py +23 -32
- package/src/qingflow_mcp/tools/workflow_tools.py +30 -47
- package/src/qingflow_mcp/tools/workspace_tools.py +5 -9
|
@@ -32,7 +32,7 @@ from ..list_type_labels import (
|
|
|
32
32
|
get_system_view_id,
|
|
33
33
|
get_system_view_name,
|
|
34
34
|
)
|
|
35
|
-
from .base import ToolBase
|
|
35
|
+
from .base import ToolBase
|
|
36
36
|
from .directory_tools import _directory_has_more, _directory_items
|
|
37
37
|
|
|
38
38
|
|
|
@@ -640,7 +640,6 @@ class RecordTools(ToolBase):
|
|
|
640
640
|
output_profile=output_profile,
|
|
641
641
|
)
|
|
642
642
|
|
|
643
|
-
@tool_cn_name("记录 Schema")
|
|
644
643
|
def record_schema_get(
|
|
645
644
|
self,
|
|
646
645
|
*,
|
|
@@ -764,9 +763,8 @@ class RecordTools(ToolBase):
|
|
|
764
763
|
response["field_count"] = len(fields)
|
|
765
764
|
return response
|
|
766
765
|
|
|
767
|
-
return self._run_record_tool(profile, runner)
|
|
766
|
+
return self._run_record_tool(profile, runner, tool_name="记录 Schema")
|
|
768
767
|
|
|
769
|
-
@tool_cn_name("新增记录 Schema")
|
|
770
768
|
def record_insert_schema_get_public(
|
|
771
769
|
self,
|
|
772
770
|
*,
|
|
@@ -881,9 +879,8 @@ class RecordTools(ToolBase):
|
|
|
881
879
|
)
|
|
882
880
|
return response
|
|
883
881
|
|
|
884
|
-
return self._run_record_tool(profile, runner)
|
|
882
|
+
return self._run_record_tool(profile, runner, tool_name="新增记录 Schema")
|
|
885
883
|
|
|
886
|
-
@tool_cn_name("浏览记录 Schema")
|
|
887
884
|
def record_browse_schema_get_public(
|
|
888
885
|
self,
|
|
889
886
|
*,
|
|
@@ -901,7 +898,6 @@ class RecordTools(ToolBase):
|
|
|
901
898
|
output_profile=output_profile,
|
|
902
899
|
)
|
|
903
900
|
|
|
904
|
-
@tool_cn_name("更新记录 Schema")
|
|
905
901
|
def record_update_schema_get_public(
|
|
906
902
|
self,
|
|
907
903
|
*,
|
|
@@ -1140,7 +1136,7 @@ class RecordTools(ToolBase):
|
|
|
1140
1136
|
response["route_probe_summary"] = probe_summary
|
|
1141
1137
|
return response
|
|
1142
1138
|
|
|
1143
|
-
return self._run_record_tool(profile, runner)
|
|
1139
|
+
return self._run_record_tool(profile, runner, tool_name="更新记录 Schema")
|
|
1144
1140
|
|
|
1145
1141
|
def _record_update_schema_available_routes(self, matched_probes: list[RecordContextRouteProbe]) -> list[JSONObject]:
|
|
1146
1142
|
routes: list[JSONObject] = [
|
|
@@ -1476,7 +1472,6 @@ class RecordTools(ToolBase):
|
|
|
1476
1472
|
]
|
|
1477
1473
|
return "<text>"
|
|
1478
1474
|
|
|
1479
|
-
@tool_cn_name("成员候选项")
|
|
1480
1475
|
def record_member_candidates(
|
|
1481
1476
|
self,
|
|
1482
1477
|
*,
|
|
@@ -1618,9 +1613,8 @@ class RecordTools(ToolBase):
|
|
|
1618
1613
|
},
|
|
1619
1614
|
}
|
|
1620
1615
|
|
|
1621
|
-
return self._run_record_tool(profile, runner)
|
|
1616
|
+
return self._run_record_tool(profile, runner, tool_name="成员候选项")
|
|
1622
1617
|
|
|
1623
|
-
@tool_cn_name("部门候选项")
|
|
1624
1618
|
def record_department_candidates(
|
|
1625
1619
|
self,
|
|
1626
1620
|
*,
|
|
@@ -1779,9 +1773,8 @@ class RecordTools(ToolBase):
|
|
|
1779
1773
|
},
|
|
1780
1774
|
}
|
|
1781
1775
|
|
|
1782
|
-
return self._run_record_tool(profile, runner)
|
|
1776
|
+
return self._run_record_tool(profile, runner, tool_name="部门候选项")
|
|
1783
1777
|
|
|
1784
|
-
@tool_cn_name("记录分析")
|
|
1785
1778
|
def record_analyze(
|
|
1786
1779
|
self,
|
|
1787
1780
|
*,
|
|
@@ -1883,9 +1876,8 @@ class RecordTools(ToolBase):
|
|
|
1883
1876
|
extra_warnings=legacy_warnings + compatibility_warnings,
|
|
1884
1877
|
)
|
|
1885
1878
|
|
|
1886
|
-
return self._run_record_tool(profile, runner)
|
|
1879
|
+
return self._run_record_tool(profile, runner, tool_name="记录分析")
|
|
1887
1880
|
|
|
1888
|
-
@tool_cn_name("记录列表")
|
|
1889
1881
|
def record_list(
|
|
1890
1882
|
self,
|
|
1891
1883
|
*,
|
|
@@ -1942,6 +1934,7 @@ class RecordTools(ToolBase):
|
|
|
1942
1934
|
view_key=view_key,
|
|
1943
1935
|
view_name=view_name,
|
|
1944
1936
|
allow_default=False,
|
|
1937
|
+
tool_name="记录列表",
|
|
1945
1938
|
)
|
|
1946
1939
|
if not _view_type_supports_analysis(view_route.view_type):
|
|
1947
1940
|
raise_tool_error(
|
|
@@ -2086,9 +2079,8 @@ class RecordTools(ToolBase):
|
|
|
2086
2079
|
}
|
|
2087
2080
|
return response
|
|
2088
2081
|
|
|
2089
|
-
return self._run_record_tool(profile, runner)
|
|
2082
|
+
return self._run_record_tool(profile, runner, tool_name="记录列表")
|
|
2090
2083
|
|
|
2091
|
-
@tool_cn_name("记录访问")
|
|
2092
2084
|
def record_access(
|
|
2093
2085
|
self,
|
|
2094
2086
|
*,
|
|
@@ -2124,6 +2116,7 @@ class RecordTools(ToolBase):
|
|
|
2124
2116
|
view_key=None,
|
|
2125
2117
|
view_name=None,
|
|
2126
2118
|
allow_default=False,
|
|
2119
|
+
tool_name="记录访问",
|
|
2127
2120
|
)
|
|
2128
2121
|
if not _view_type_supports_analysis(view_route.view_type):
|
|
2129
2122
|
raise_tool_error(
|
|
@@ -2397,9 +2390,8 @@ class RecordTools(ToolBase):
|
|
|
2397
2390
|
"request_route": self._request_route_payload(context),
|
|
2398
2391
|
}
|
|
2399
2392
|
|
|
2400
|
-
return self._run_record_tool(profile, runner)
|
|
2393
|
+
return self._run_record_tool(profile, runner, tool_name="记录访问")
|
|
2401
2394
|
|
|
2402
|
-
@tool_cn_name("记录详情")
|
|
2403
2395
|
def record_get_public(
|
|
2404
2396
|
self,
|
|
2405
2397
|
*,
|
|
@@ -2481,9 +2473,8 @@ class RecordTools(ToolBase):
|
|
|
2481
2473
|
last_error = candidate_exc
|
|
2482
2474
|
raise last_error
|
|
2483
2475
|
|
|
2484
|
-
return self._run_record_tool(profile, runner)
|
|
2476
|
+
return self._run_record_tool(profile, runner, tool_name="记录详情")
|
|
2485
2477
|
|
|
2486
|
-
@tool_cn_name("记录全量日志")
|
|
2487
2478
|
def record_logs_get(
|
|
2488
2479
|
self,
|
|
2489
2480
|
*,
|
|
@@ -2650,7 +2641,7 @@ class RecordTools(ToolBase):
|
|
|
2650
2641
|
payload["summary_path"] = str(summary_path)
|
|
2651
2642
|
return payload
|
|
2652
2643
|
|
|
2653
|
-
return self._run_record_tool(profile, runner)
|
|
2644
|
+
return self._run_record_tool(profile, runner, tool_name="记录全量日志")
|
|
2654
2645
|
|
|
2655
2646
|
def _record_get_detail_context(
|
|
2656
2647
|
self,
|
|
@@ -3648,7 +3639,6 @@ class RecordTools(ToolBase):
|
|
|
3648
3639
|
return refreshed_url
|
|
3649
3640
|
return None
|
|
3650
3641
|
|
|
3651
|
-
@tool_cn_name("新增记录")
|
|
3652
3642
|
def record_insert_public(
|
|
3653
3643
|
self,
|
|
3654
3644
|
*,
|
|
@@ -3672,6 +3662,7 @@ class RecordTools(ToolBase):
|
|
|
3672
3662
|
items=normalized_items,
|
|
3673
3663
|
verify_write=verify_write,
|
|
3674
3664
|
output_profile=normalized_output_profile,
|
|
3665
|
+
tool_name="新增记录",
|
|
3675
3666
|
)
|
|
3676
3667
|
if fields is not None and not isinstance(fields, dict):
|
|
3677
3668
|
raise_tool_error(QingflowApiError.config_error("fields must be an object map keyed by field title"))
|
|
@@ -3684,6 +3675,7 @@ class RecordTools(ToolBase):
|
|
|
3684
3675
|
verify_write=verify_write,
|
|
3685
3676
|
output_profile=normalized_output_profile,
|
|
3686
3677
|
capture_exceptions=False,
|
|
3678
|
+
tool_name="新增记录",
|
|
3687
3679
|
)
|
|
3688
3680
|
|
|
3689
3681
|
def _reject_record_insert_system_fields(self, field_maps: list[JSONObject]) -> None:
|
|
@@ -3713,6 +3705,7 @@ class RecordTools(ToolBase):
|
|
|
3713
3705
|
verify_write: bool,
|
|
3714
3706
|
output_profile: str,
|
|
3715
3707
|
capture_exceptions: bool,
|
|
3708
|
+
tool_name: str = "新增记录",
|
|
3716
3709
|
) -> JSONObject:
|
|
3717
3710
|
"""执行内部辅助逻辑。"""
|
|
3718
3711
|
submit_type_value = self._normalize_record_write_submit_type("submit")
|
|
@@ -3730,6 +3723,7 @@ class RecordTools(ToolBase):
|
|
|
3730
3723
|
list_type=None,
|
|
3731
3724
|
view_key=None,
|
|
3732
3725
|
view_name=None,
|
|
3726
|
+
tool_name=tool_name,
|
|
3733
3727
|
)
|
|
3734
3728
|
preflight_used_force_refresh = self._record_preflight_used_force_refresh(raw_preflight)
|
|
3735
3729
|
preflight_data = cast(JSONObject, raw_preflight.get("data", {}))
|
|
@@ -3821,6 +3815,7 @@ class RecordTools(ToolBase):
|
|
|
3821
3815
|
items: list[JSONObject],
|
|
3822
3816
|
verify_write: bool,
|
|
3823
3817
|
output_profile: str,
|
|
3818
|
+
tool_name: str = "新增记录",
|
|
3824
3819
|
) -> JSONObject:
|
|
3825
3820
|
"""执行内部辅助逻辑。"""
|
|
3826
3821
|
responses: list[JSONObject] = []
|
|
@@ -3833,6 +3828,7 @@ class RecordTools(ToolBase):
|
|
|
3833
3828
|
verify_write=verify_write,
|
|
3834
3829
|
output_profile=output_profile,
|
|
3835
3830
|
capture_exceptions=True,
|
|
3831
|
+
tool_name=tool_name,
|
|
3836
3832
|
)
|
|
3837
3833
|
)
|
|
3838
3834
|
return self._record_insert_batch_response(
|
|
@@ -4182,7 +4178,6 @@ class RecordTools(ToolBase):
|
|
|
4182
4178
|
return "重新调用 schema 工具确认字段标题或 field_id 后,只重试本行。"
|
|
4183
4179
|
return "修正该字段值后只重试本行。"
|
|
4184
4180
|
|
|
4185
|
-
@tool_cn_name("更新记录")
|
|
4186
4181
|
def record_update_public(
|
|
4187
4182
|
self,
|
|
4188
4183
|
*,
|
|
@@ -4216,6 +4211,7 @@ class RecordTools(ToolBase):
|
|
|
4216
4211
|
dry_run=dry_run,
|
|
4217
4212
|
verify_write=verify_write,
|
|
4218
4213
|
output_profile=normalized_output_profile,
|
|
4214
|
+
tool_name="更新记录",
|
|
4219
4215
|
)
|
|
4220
4216
|
if dry_run:
|
|
4221
4217
|
raise_tool_error(QingflowApiError.config_error("dry_run currently requires items"))
|
|
@@ -4232,6 +4228,7 @@ class RecordTools(ToolBase):
|
|
|
4232
4228
|
view_id=view_id,
|
|
4233
4229
|
verify_write=verify_write,
|
|
4234
4230
|
output_profile=normalized_output_profile,
|
|
4231
|
+
tool_name="更新记录",
|
|
4235
4232
|
)
|
|
4236
4233
|
|
|
4237
4234
|
def _record_update_public_single(
|
|
@@ -4245,6 +4242,7 @@ class RecordTools(ToolBase):
|
|
|
4245
4242
|
verify_write: bool,
|
|
4246
4243
|
output_profile: str,
|
|
4247
4244
|
capture_exceptions: bool = False,
|
|
4245
|
+
tool_name: str = "更新记录",
|
|
4248
4246
|
) -> JSONObject:
|
|
4249
4247
|
"""执行内部辅助逻辑。"""
|
|
4250
4248
|
write_state = {"attempted": False}
|
|
@@ -4258,6 +4256,7 @@ class RecordTools(ToolBase):
|
|
|
4258
4256
|
verify_write=verify_write,
|
|
4259
4257
|
output_profile=output_profile,
|
|
4260
4258
|
write_attempted_ref=lambda value: write_state.__setitem__("attempted", value),
|
|
4259
|
+
tool_name=tool_name,
|
|
4261
4260
|
)
|
|
4262
4261
|
except (QingflowApiError, RuntimeError) as exc:
|
|
4263
4262
|
if not capture_exceptions:
|
|
@@ -4284,6 +4283,7 @@ class RecordTools(ToolBase):
|
|
|
4284
4283
|
verify_write: bool,
|
|
4285
4284
|
output_profile: str,
|
|
4286
4285
|
write_attempted_ref: Callable[[bool], None],
|
|
4286
|
+
tool_name: str = "更新记录",
|
|
4287
4287
|
) -> JSONObject:
|
|
4288
4288
|
"""执行内部辅助逻辑。"""
|
|
4289
4289
|
preflight_kwargs: dict[str, Any] = {
|
|
@@ -4295,6 +4295,7 @@ class RecordTools(ToolBase):
|
|
|
4295
4295
|
}
|
|
4296
4296
|
if view_id is not None:
|
|
4297
4297
|
preflight_kwargs["preferred_view_id"] = view_id
|
|
4298
|
+
preflight_kwargs["tool_name"] = tool_name
|
|
4298
4299
|
raw_preflight = self._preflight_record_update_with_auto_view(**preflight_kwargs)
|
|
4299
4300
|
preflight_used_force_refresh = self._record_preflight_used_force_refresh(raw_preflight)
|
|
4300
4301
|
preflight_data = cast(JSONObject, raw_preflight.get("data", {}))
|
|
@@ -4324,6 +4325,7 @@ class RecordTools(ToolBase):
|
|
|
4324
4325
|
preflight_data=preflight_data,
|
|
4325
4326
|
verify_write=verify_write,
|
|
4326
4327
|
force_refresh_form=preflight_used_force_refresh,
|
|
4328
|
+
tool_name=tool_name,
|
|
4327
4329
|
)
|
|
4328
4330
|
if route_blocker is not None:
|
|
4329
4331
|
return self._record_update_route_blocked_response(
|
|
@@ -4357,6 +4359,7 @@ class RecordTools(ToolBase):
|
|
|
4357
4359
|
preflight_data: JSONObject,
|
|
4358
4360
|
verify_write: bool,
|
|
4359
4361
|
force_refresh_form: bool,
|
|
4362
|
+
tool_name: str = "更新记录",
|
|
4360
4363
|
) -> tuple[JSONObject | None, list[JSONObject], JSONObject | None]:
|
|
4361
4364
|
"""Try record update routes in the same order a frontend user would expect."""
|
|
4362
4365
|
tried_routes: list[JSONObject] = []
|
|
@@ -4421,6 +4424,7 @@ class RecordTools(ToolBase):
|
|
|
4421
4424
|
answers=normalized_answers,
|
|
4422
4425
|
verify_write=verify_write,
|
|
4423
4426
|
force_refresh_form=force_refresh_form,
|
|
4427
|
+
tool_name=tool_name,
|
|
4424
4428
|
)
|
|
4425
4429
|
view_attempt["status"] = "success"
|
|
4426
4430
|
tried_routes.append(view_attempt)
|
|
@@ -4471,6 +4475,7 @@ class RecordTools(ToolBase):
|
|
|
4471
4475
|
answers=normalized_answers,
|
|
4472
4476
|
verify_write=verify_write,
|
|
4473
4477
|
force_refresh_form=force_refresh_form,
|
|
4478
|
+
tool_name=tool_name,
|
|
4474
4479
|
)
|
|
4475
4480
|
task_attempt["status"] = "success"
|
|
4476
4481
|
tried_routes.append(task_attempt)
|
|
@@ -4800,7 +4805,7 @@ class RecordTools(ToolBase):
|
|
|
4800
4805
|
"effective_editable_question_ids": sorted(effective_editable_question_ids),
|
|
4801
4806
|
}
|
|
4802
4807
|
|
|
4803
|
-
return self._run_record_tool(profile, runner)
|
|
4808
|
+
return self._run_record_tool(profile, runner, tool_name="更新记录")
|
|
4804
4809
|
|
|
4805
4810
|
def _record_update_compact_task_match(self, item: JSONObject) -> JSONObject:
|
|
4806
4811
|
return {
|
|
@@ -4896,6 +4901,7 @@ class RecordTools(ToolBase):
|
|
|
4896
4901
|
answers: list[JSONObject],
|
|
4897
4902
|
verify_write: bool,
|
|
4898
4903
|
force_refresh_form: bool,
|
|
4904
|
+
tool_name: str = "更新记录",
|
|
4899
4905
|
) -> JSONObject:
|
|
4900
4906
|
normalized_apply_id = self._validate_app_and_record(app_key, apply_id)
|
|
4901
4907
|
normalized_view_key = view_key.strip()
|
|
@@ -4942,7 +4948,7 @@ class RecordTools(ToolBase):
|
|
|
4942
4948
|
target="record data",
|
|
4943
4949
|
)
|
|
4944
4950
|
|
|
4945
|
-
return self._run_record_tool(profile, runner)
|
|
4951
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
4946
4952
|
|
|
4947
4953
|
def _record_update_via_task_save_only(
|
|
4948
4954
|
self,
|
|
@@ -4954,6 +4960,7 @@ class RecordTools(ToolBase):
|
|
|
4954
4960
|
answers: list[JSONObject],
|
|
4955
4961
|
verify_write: bool,
|
|
4956
4962
|
force_refresh_form: bool,
|
|
4963
|
+
tool_name: str = "更新记录",
|
|
4957
4964
|
) -> JSONObject:
|
|
4958
4965
|
normalized_apply_id = self._validate_app_and_record(app_key, apply_id)
|
|
4959
4966
|
if workflow_node_id <= 0:
|
|
@@ -4998,7 +5005,7 @@ class RecordTools(ToolBase):
|
|
|
4998
5005
|
target="record data",
|
|
4999
5006
|
)
|
|
5000
5007
|
|
|
5001
|
-
return self._run_record_tool(profile, runner)
|
|
5008
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
5002
5009
|
|
|
5003
5010
|
def _record_update_public_batch(
|
|
5004
5011
|
self,
|
|
@@ -5010,6 +5017,7 @@ class RecordTools(ToolBase):
|
|
|
5010
5017
|
dry_run: bool,
|
|
5011
5018
|
verify_write: bool,
|
|
5012
5019
|
output_profile: str,
|
|
5020
|
+
tool_name: str = "更新记录",
|
|
5013
5021
|
) -> JSONObject:
|
|
5014
5022
|
"""执行内部辅助逻辑。"""
|
|
5015
5023
|
preflight_responses = [
|
|
@@ -5020,6 +5028,7 @@ class RecordTools(ToolBase):
|
|
|
5020
5028
|
fields=cast(JSONObject, item["fields"]),
|
|
5021
5029
|
view_id=view_id,
|
|
5022
5030
|
output_profile=output_profile,
|
|
5031
|
+
tool_name=tool_name,
|
|
5023
5032
|
)
|
|
5024
5033
|
for item in items
|
|
5025
5034
|
]
|
|
@@ -5051,6 +5060,7 @@ class RecordTools(ToolBase):
|
|
|
5051
5060
|
verify_write=verify_write,
|
|
5052
5061
|
output_profile=output_profile,
|
|
5053
5062
|
capture_exceptions=True,
|
|
5063
|
+
tool_name=tool_name,
|
|
5054
5064
|
)
|
|
5055
5065
|
)
|
|
5056
5066
|
except (QingflowApiError, RuntimeError) as exc:
|
|
@@ -5083,6 +5093,7 @@ class RecordTools(ToolBase):
|
|
|
5083
5093
|
fields: JSONObject,
|
|
5084
5094
|
view_id: str | None,
|
|
5085
5095
|
output_profile: str,
|
|
5096
|
+
tool_name: str = "更新记录",
|
|
5086
5097
|
) -> JSONObject:
|
|
5087
5098
|
"""执行内部辅助逻辑。"""
|
|
5088
5099
|
preflight_kwargs: dict[str, Any] = {
|
|
@@ -5094,6 +5105,7 @@ class RecordTools(ToolBase):
|
|
|
5094
5105
|
}
|
|
5095
5106
|
if view_id is not None:
|
|
5096
5107
|
preflight_kwargs["preferred_view_id"] = view_id
|
|
5108
|
+
preflight_kwargs["tool_name"] = tool_name
|
|
5097
5109
|
raw_preflight = self._preflight_record_update_with_auto_view(**preflight_kwargs)
|
|
5098
5110
|
preflight_data = cast(JSONObject, raw_preflight.get("data", {}))
|
|
5099
5111
|
normalized_payload = self._record_write_normalized_payload(
|
|
@@ -5336,6 +5348,7 @@ class RecordTools(ToolBase):
|
|
|
5336
5348
|
fields: JSONObject,
|
|
5337
5349
|
preferred_view_id: str | None = None,
|
|
5338
5350
|
force_refresh_form: bool,
|
|
5351
|
+
tool_name: str = "更新记录",
|
|
5339
5352
|
) -> JSONObject:
|
|
5340
5353
|
"""执行内部辅助逻辑。"""
|
|
5341
5354
|
def runner(session_profile, context):
|
|
@@ -5617,7 +5630,7 @@ class RecordTools(ToolBase):
|
|
|
5617
5630
|
cast(JSONObject, result.setdefault("data", {}))["schema_force_refreshed"] = True
|
|
5618
5631
|
return result
|
|
5619
5632
|
|
|
5620
|
-
return self._run_record_tool(profile, runner)
|
|
5633
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
5621
5634
|
|
|
5622
5635
|
def _build_record_update_union_preflight(
|
|
5623
5636
|
self,
|
|
@@ -6182,7 +6195,6 @@ class RecordTools(ToolBase):
|
|
|
6182
6195
|
dept_member_cache={},
|
|
6183
6196
|
)
|
|
6184
6197
|
|
|
6185
|
-
@tool_cn_name("删除记录")
|
|
6186
6198
|
def record_delete_public(
|
|
6187
6199
|
self,
|
|
6188
6200
|
*,
|
|
@@ -6227,6 +6239,7 @@ class RecordTools(ToolBase):
|
|
|
6227
6239
|
list_type=delete_list_type,
|
|
6228
6240
|
normalized_payload=normalized_payload,
|
|
6229
6241
|
output_profile=normalized_output_profile,
|
|
6242
|
+
tool_name="删除记录",
|
|
6230
6243
|
)
|
|
6231
6244
|
|
|
6232
6245
|
def _resolve_record_delete_list_type(self, *, view_id: str | None, list_type: int | None) -> int:
|
|
@@ -6286,6 +6299,7 @@ class RecordTools(ToolBase):
|
|
|
6286
6299
|
list_type: int,
|
|
6287
6300
|
normalized_payload: JSONObject,
|
|
6288
6301
|
output_profile: str,
|
|
6302
|
+
tool_name: str = "删除记录",
|
|
6289
6303
|
) -> JSONObject:
|
|
6290
6304
|
items: list[JSONObject] = []
|
|
6291
6305
|
request_route: JSONObject | None = None
|
|
@@ -6293,7 +6307,13 @@ class RecordTools(ToolBase):
|
|
|
6293
6307
|
for index, delete_id in enumerate(delete_ids):
|
|
6294
6308
|
record_id_text = stringify_backend_id(delete_id)
|
|
6295
6309
|
try:
|
|
6296
|
-
raw_apply = self._record_delete_many(
|
|
6310
|
+
raw_apply = self._record_delete_many(
|
|
6311
|
+
profile=profile,
|
|
6312
|
+
app_key=app_key,
|
|
6313
|
+
record_ids=[delete_id],
|
|
6314
|
+
list_type=list_type,
|
|
6315
|
+
tool_name=tool_name,
|
|
6316
|
+
)
|
|
6297
6317
|
request_route = cast(JSONObject, raw_apply.get("request_route")) if isinstance(raw_apply.get("request_route"), dict) else request_route
|
|
6298
6318
|
ws_id = raw_apply.get("ws_id", ws_id)
|
|
6299
6319
|
single_payload = {
|
|
@@ -6399,7 +6419,6 @@ class RecordTools(ToolBase):
|
|
|
6399
6419
|
},
|
|
6400
6420
|
}
|
|
6401
6421
|
|
|
6402
|
-
@tool_cn_name("写入记录")
|
|
6403
6422
|
def record_write(
|
|
6404
6423
|
self,
|
|
6405
6424
|
*,
|
|
@@ -6462,6 +6481,7 @@ class RecordTools(ToolBase):
|
|
|
6462
6481
|
list_type=list_type,
|
|
6463
6482
|
view_key=view_key,
|
|
6464
6483
|
view_name=view_name,
|
|
6484
|
+
tool_name="写入记录",
|
|
6465
6485
|
)
|
|
6466
6486
|
preflight_used_force_refresh = self._record_preflight_used_force_refresh(raw_preflight)
|
|
6467
6487
|
preflight_data = cast(JSONObject, raw_preflight.get("data", {}))
|
|
@@ -6536,6 +6556,7 @@ class RecordTools(ToolBase):
|
|
|
6536
6556
|
list_type=list_type,
|
|
6537
6557
|
view_key=view_key,
|
|
6538
6558
|
view_name=view_name,
|
|
6559
|
+
tool_name="写入记录",
|
|
6539
6560
|
)
|
|
6540
6561
|
preflight_used_force_refresh = self._record_preflight_used_force_refresh(raw_preflight)
|
|
6541
6562
|
preflight_data = cast(JSONObject, raw_preflight.get("data", {}))
|
|
@@ -6605,7 +6626,13 @@ class RecordTools(ToolBase):
|
|
|
6605
6626
|
"submit_type": submit_type_value,
|
|
6606
6627
|
"selection": {"view_id": view_id, "list_type": delete_list_type},
|
|
6607
6628
|
}
|
|
6608
|
-
raw_apply = self._record_delete_many(
|
|
6629
|
+
raw_apply = self._record_delete_many(
|
|
6630
|
+
profile=profile,
|
|
6631
|
+
app_key=app_key,
|
|
6632
|
+
record_ids=delete_ids,
|
|
6633
|
+
list_type=delete_list_type,
|
|
6634
|
+
tool_name="写入记录",
|
|
6635
|
+
)
|
|
6609
6636
|
return self._record_write_apply_response(
|
|
6610
6637
|
raw_apply,
|
|
6611
6638
|
operation="delete",
|
|
@@ -8800,6 +8827,7 @@ class RecordTools(ToolBase):
|
|
|
8800
8827
|
list_type: int | None,
|
|
8801
8828
|
view_key: str | None,
|
|
8802
8829
|
view_name: str | None,
|
|
8830
|
+
tool_name: str = "写入记录",
|
|
8803
8831
|
) -> JSONObject:
|
|
8804
8832
|
"""执行内部辅助逻辑。"""
|
|
8805
8833
|
if not app_key:
|
|
@@ -8845,7 +8873,7 @@ class RecordTools(ToolBase):
|
|
|
8845
8873
|
"data": plan_data,
|
|
8846
8874
|
}
|
|
8847
8875
|
|
|
8848
|
-
return self._run_record_tool(profile, runner)
|
|
8876
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
8849
8877
|
|
|
8850
8878
|
def _build_record_write_preflight(
|
|
8851
8879
|
self,
|
|
@@ -9372,7 +9400,6 @@ class RecordTools(ToolBase):
|
|
|
9372
9400
|
merged_by_id[que_id] = item
|
|
9373
9401
|
return [merged_by_id[que_id] for que_id in order]
|
|
9374
9402
|
|
|
9375
|
-
@tool_cn_name("查询记录")
|
|
9376
9403
|
def record_query(
|
|
9377
9404
|
self,
|
|
9378
9405
|
*,
|
|
@@ -9430,6 +9457,7 @@ class RecordTools(ToolBase):
|
|
|
9430
9457
|
max_columns=max_columns,
|
|
9431
9458
|
output_profile=output_profile,
|
|
9432
9459
|
list_type=list_type,
|
|
9460
|
+
tool_name="查询记录",
|
|
9433
9461
|
)
|
|
9434
9462
|
return self._record_query_list(
|
|
9435
9463
|
profile=profile,
|
|
@@ -9450,9 +9478,9 @@ class RecordTools(ToolBase):
|
|
|
9450
9478
|
list_type=list_type,
|
|
9451
9479
|
view_key=view_key,
|
|
9452
9480
|
view_name=view_name,
|
|
9481
|
+
tool_name="查询记录",
|
|
9453
9482
|
)
|
|
9454
9483
|
|
|
9455
|
-
@tool_cn_name("创建记录")
|
|
9456
9484
|
def record_create(
|
|
9457
9485
|
self,
|
|
9458
9486
|
*,
|
|
@@ -9507,12 +9535,11 @@ class RecordTools(ToolBase):
|
|
|
9507
9535
|
"resource": _record_resource_payload(apply_id),
|
|
9508
9536
|
}
|
|
9509
9537
|
|
|
9510
|
-
return self._run_record_tool(profile, runner)
|
|
9538
|
+
return self._run_record_tool(profile, runner, tool_name="创建记录")
|
|
9511
9539
|
|
|
9512
9540
|
# listType 降级顺序(内部 record_get)
|
|
9513
9541
|
_INTERNAL_GET_LIST_TYPE_FALLBACKS = [DEFAULT_RECORD_LIST_TYPE, 14, 1, 2, 12]
|
|
9514
9542
|
|
|
9515
|
-
@tool_cn_name("获取记录")
|
|
9516
9543
|
def record_get(
|
|
9517
9544
|
self,
|
|
9518
9545
|
*,
|
|
@@ -9570,9 +9597,8 @@ class RecordTools(ToolBase):
|
|
|
9570
9597
|
"result": result,
|
|
9571
9598
|
}
|
|
9572
9599
|
|
|
9573
|
-
return self._run_record_tool(profile, runner)
|
|
9600
|
+
return self._run_record_tool(profile, runner, tool_name="获取记录")
|
|
9574
9601
|
|
|
9575
|
-
@tool_cn_name("搜索记录")
|
|
9576
9602
|
def record_search(
|
|
9577
9603
|
self,
|
|
9578
9604
|
*,
|
|
@@ -9638,9 +9664,8 @@ class RecordTools(ToolBase):
|
|
|
9638
9664
|
"effective_count": effective_count,
|
|
9639
9665
|
}
|
|
9640
9666
|
|
|
9641
|
-
return self._run_record_tool(profile, runner)
|
|
9667
|
+
return self._run_record_tool(profile, runner, tool_name="搜索记录")
|
|
9642
9668
|
|
|
9643
|
-
@tool_cn_name("修改记录")
|
|
9644
9669
|
def record_update(
|
|
9645
9670
|
self,
|
|
9646
9671
|
*,
|
|
@@ -9727,9 +9752,8 @@ class RecordTools(ToolBase):
|
|
|
9727
9752
|
target="record data",
|
|
9728
9753
|
)
|
|
9729
9754
|
|
|
9730
|
-
return self._run_record_tool(profile, runner)
|
|
9755
|
+
return self._run_record_tool(profile, runner, tool_name="修改记录")
|
|
9731
9756
|
|
|
9732
|
-
@tool_cn_name("删除记录(兼容)")
|
|
9733
9757
|
def record_delete(self, *, profile: str, app_key: str, apply_id: int, list_type: int) -> JSONObject:
|
|
9734
9758
|
"""执行记录相关逻辑。"""
|
|
9735
9759
|
normalized_apply_id = self._validate_app_and_record(app_key, apply_id)
|
|
@@ -9756,7 +9780,7 @@ class RecordTools(ToolBase):
|
|
|
9756
9780
|
target="record data",
|
|
9757
9781
|
)
|
|
9758
9782
|
|
|
9759
|
-
return self._run_record_tool(profile, runner)
|
|
9783
|
+
return self._run_record_tool(profile, runner, tool_name="删除记录(兼容)")
|
|
9760
9784
|
|
|
9761
9785
|
def _record_query_record(
|
|
9762
9786
|
self,
|
|
@@ -9768,6 +9792,7 @@ class RecordTools(ToolBase):
|
|
|
9768
9792
|
max_columns: int | None,
|
|
9769
9793
|
output_profile: str,
|
|
9770
9794
|
list_type: int,
|
|
9795
|
+
tool_name: str = "查询记录",
|
|
9771
9796
|
) -> JSONObject:
|
|
9772
9797
|
"""执行内部辅助逻辑。"""
|
|
9773
9798
|
if not app_key:
|
|
@@ -9846,7 +9871,7 @@ class RecordTools(ToolBase):
|
|
|
9846
9871
|
}
|
|
9847
9872
|
return response
|
|
9848
9873
|
|
|
9849
|
-
return self._run_record_tool(profile, runner)
|
|
9874
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
9850
9875
|
|
|
9851
9876
|
def _record_query_list(
|
|
9852
9877
|
self,
|
|
@@ -9869,6 +9894,7 @@ class RecordTools(ToolBase):
|
|
|
9869
9894
|
list_type: int,
|
|
9870
9895
|
view_key: str | None = None,
|
|
9871
9896
|
view_name: str | None = None,
|
|
9897
|
+
tool_name: str = "查询记录",
|
|
9872
9898
|
) -> JSONObject:
|
|
9873
9899
|
"""执行内部辅助逻辑。"""
|
|
9874
9900
|
if not app_key:
|
|
@@ -10128,7 +10154,7 @@ class RecordTools(ToolBase):
|
|
|
10128
10154
|
}
|
|
10129
10155
|
return response
|
|
10130
10156
|
|
|
10131
|
-
return self._run_record_tool(profile, runner)
|
|
10157
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
10132
10158
|
|
|
10133
10159
|
def _record_list_query_view_fields(
|
|
10134
10160
|
self,
|
|
@@ -10729,12 +10755,13 @@ class RecordTools(ToolBase):
|
|
|
10729
10755
|
profile: str,
|
|
10730
10756
|
app_key: str,
|
|
10731
10757
|
resolved_view: AccessibleViewRoute,
|
|
10758
|
+
tool_name: str = "记录列表",
|
|
10732
10759
|
) -> list[int]:
|
|
10733
10760
|
"""执行内部辅助逻辑。"""
|
|
10734
10761
|
def runner(_session_profile, context):
|
|
10735
10762
|
return self._derive_public_list_columns(profile, context, app_key, resolved_view)
|
|
10736
10763
|
|
|
10737
|
-
return cast(list[int], self._run_record_tool(profile, runner))
|
|
10764
|
+
return cast(list[int], self._run_record_tool(profile, runner, tool_name=tool_name))
|
|
10738
10765
|
|
|
10739
10766
|
def _resolve_record_list_query_fields_for_public(
|
|
10740
10767
|
self,
|
|
@@ -10743,6 +10770,7 @@ class RecordTools(ToolBase):
|
|
|
10743
10770
|
app_key: str,
|
|
10744
10771
|
resolved_view: AccessibleViewRoute,
|
|
10745
10772
|
selectors: list[int],
|
|
10773
|
+
tool_name: str = "记录列表",
|
|
10746
10774
|
) -> list[int]:
|
|
10747
10775
|
"""Resolve record_list query_fields against the selected view-readable schema."""
|
|
10748
10776
|
if not selectors:
|
|
@@ -10759,7 +10787,7 @@ class RecordTools(ToolBase):
|
|
|
10759
10787
|
index = cast(FieldIndex, browse_scope["index"])
|
|
10760
10788
|
return self._resolve_record_list_query_fields(selectors, index, view_route=resolved_view)
|
|
10761
10789
|
|
|
10762
|
-
return cast(list[int], self._run_record_tool(profile, runner))
|
|
10790
|
+
return cast(list[int], self._run_record_tool(profile, runner, tool_name=tool_name))
|
|
10763
10791
|
|
|
10764
10792
|
def _derive_public_list_columns(
|
|
10765
10793
|
self,
|
|
@@ -10842,6 +10870,7 @@ class RecordTools(ToolBase):
|
|
|
10842
10870
|
view_key: str | None,
|
|
10843
10871
|
view_name: str | None,
|
|
10844
10872
|
allow_default: bool,
|
|
10873
|
+
tool_name: str = "记录列表",
|
|
10845
10874
|
) -> tuple[AccessibleViewRoute, list[JSONObject]]:
|
|
10846
10875
|
"""执行内部辅助逻辑。"""
|
|
10847
10876
|
def runner(_session_profile, context):
|
|
@@ -10856,7 +10885,7 @@ class RecordTools(ToolBase):
|
|
|
10856
10885
|
allow_default=allow_default,
|
|
10857
10886
|
)
|
|
10858
10887
|
|
|
10859
|
-
return self._run_record_tool(profile, runner)
|
|
10888
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
10860
10889
|
|
|
10861
10890
|
def _resolve_accessible_view_route(
|
|
10862
10891
|
self,
|
|
@@ -11993,10 +12022,17 @@ class RecordTools(ToolBase):
|
|
|
11993
12022
|
except RecordInputError:
|
|
11994
12023
|
return None
|
|
11995
12024
|
|
|
11996
|
-
def _run_record_tool(
|
|
12025
|
+
def _run_record_tool(
|
|
12026
|
+
self,
|
|
12027
|
+
profile: str,
|
|
12028
|
+
func,
|
|
12029
|
+
*,
|
|
12030
|
+
require_workspace: bool = True,
|
|
12031
|
+
tool_name: str,
|
|
12032
|
+
): # type: ignore[no-untyped-def]
|
|
11997
12033
|
"""执行内部辅助逻辑。"""
|
|
11998
12034
|
try:
|
|
11999
|
-
return self._run(profile, func, require_workspace=require_workspace)
|
|
12035
|
+
return self._run(profile, func, require_workspace=require_workspace, tool_name=tool_name)
|
|
12000
12036
|
except RecordInputError as error:
|
|
12001
12037
|
raise_tool_error(
|
|
12002
12038
|
QingflowApiError(
|
|
@@ -12622,7 +12658,15 @@ class RecordTools(ToolBase):
|
|
|
12622
12658
|
)
|
|
12623
12659
|
return errors
|
|
12624
12660
|
|
|
12625
|
-
def _record_delete_many(
|
|
12661
|
+
def _record_delete_many(
|
|
12662
|
+
self,
|
|
12663
|
+
*,
|
|
12664
|
+
profile: str,
|
|
12665
|
+
app_key: str,
|
|
12666
|
+
record_ids: list[int],
|
|
12667
|
+
list_type: int = DEFAULT_RECORD_LIST_TYPE,
|
|
12668
|
+
tool_name: str = "删除记录",
|
|
12669
|
+
) -> JSONObject:
|
|
12626
12670
|
"""执行内部辅助逻辑。"""
|
|
12627
12671
|
if not app_key:
|
|
12628
12672
|
raise_tool_error(QingflowApiError.config_error("app_key is required"))
|
|
@@ -12646,7 +12690,7 @@ class RecordTools(ToolBase):
|
|
|
12646
12690
|
"ok": True,
|
|
12647
12691
|
}
|
|
12648
12692
|
|
|
12649
|
-
return self._run_record_tool(profile, runner)
|
|
12693
|
+
return self._run_record_tool(profile, runner, tool_name=tool_name)
|
|
12650
12694
|
|
|
12651
12695
|
def _resolve_field_selector(self, selector: str | int | None, index: FieldIndex, *, location: str) -> FormField:
|
|
12652
12696
|
"""执行内部辅助逻辑。"""
|