@qingflow-tech/qingflow-app-builder-mcp 1.0.40 → 1.0.41

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.
@@ -4037,7 +4037,11 @@ class RecordTools(ToolBase):
4037
4037
  "field_id": field_id,
4038
4038
  "error_code": error_code,
4039
4039
  "message": self._record_write_semantic_error_message(error_code, error.get("message")),
4040
- "next_action": self._record_write_next_action_for_error(error_code),
4040
+ "next_action": self._record_write_next_action_for_error(
4041
+ error_code,
4042
+ expected_format=expected_format,
4043
+ field_payload=field_payload,
4044
+ ),
4041
4045
  }
4042
4046
  if expected_format is not None:
4043
4047
  payload["expected_format"] = expected_format
@@ -4148,8 +4152,30 @@ class RecordTools(ToolBase):
4148
4152
  return _normalize_optional_text(fallback) or "字段值格式不正确。"
4149
4153
  return _normalize_optional_text(fallback) or "字段写入失败。"
4150
4154
 
4151
- def _record_write_next_action_for_error(self, error_code: str) -> str:
4155
+ def _record_write_next_action_for_error(
4156
+ self,
4157
+ error_code: str,
4158
+ *,
4159
+ expected_format: JSONObject | None = None,
4160
+ field_payload: JSONObject | None = None,
4161
+ ) -> str:
4152
4162
  """执行内部辅助逻辑。"""
4163
+ kind = _normalize_optional_text((expected_format or {}).get("kind"))
4164
+ field_title = (
4165
+ _normalize_optional_text((field_payload or {}).get("que_title"))
4166
+ or _normalize_optional_text((field_payload or {}).get("title"))
4167
+ or "该字段"
4168
+ )
4169
+ if kind == "member_list":
4170
+ return f"{field_title} 需要有效成员;用唯一姓名/邮箱/id,歧义时先调用 record_member_candidates 后只重试本行。"
4171
+ if kind == "department_list":
4172
+ return f"{field_title} 需要有效部门;用候选范围内的部门名/id/object,歧义或不确定时先调用 record_department_candidates 后只重试本行。"
4173
+ if kind == "relation_record":
4174
+ return f"{field_title} 需要关联记录;优先改用目标记录 record_id/apply_id,或使用可唯一命中的显示文本后只重试本行。"
4175
+ if kind == "attachment_list":
4176
+ return f"{field_title} 需要附件值;先用 file_upload_local 上传文件,再写返回的 value/url 后只重试本行。"
4177
+ if kind in {"single_select", "multi_select"}:
4178
+ return f"{field_title} 需要选项值;使用 schema options 中的标签或 option id,修正后只重试本行。"
4153
4179
  if error_code == "MISSING_REQUIRED_FIELD":
4154
4180
  return "补充该字段后只重试本行。"
4155
4181
  if error_code in {"FIELD_NOT_FOUND", "AMBIGUOUS_FIELD"}: