@josephyan/qingflow-cli 0.2.0-beta.1013 → 0.2.0-beta.1014

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 @josephyan/qingflow-cli@0.2.0-beta.1013
6
+ npm install @josephyan/qingflow-cli@0.2.0-beta.1014
7
7
  ```
8
8
 
9
9
  Run:
10
10
 
11
11
  ```bash
12
- npx -y -p @josephyan/qingflow-cli@0.2.0-beta.1013 qingflow
12
+ npx -y -p @josephyan/qingflow-cli@0.2.0-beta.1014 qingflow
13
13
  ```
14
14
 
15
15
  Environment:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@josephyan/qingflow-cli",
3
- "version": "0.2.0-beta.1013",
3
+ "version": "0.2.0-beta.1014",
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 = "0.2.0b1013"
7
+ version = "0.2.0b1014"
8
8
  description = "User-authenticated MCP server for Qingflow"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -5,7 +5,7 @@ from pathlib import Path
5
5
 
6
6
  __all__ = ["__version__"]
7
7
 
8
- _FALLBACK_VERSION = "0.2.0b1013"
8
+ _FALLBACK_VERSION = "0.2.0b1014"
9
9
 
10
10
 
11
11
  def _resolve_local_pyproject_version() -> str | None:
@@ -8794,7 +8794,13 @@ class RecordTools(ToolBase):
8794
8794
  except json.JSONDecodeError:
8795
8795
  parsed = None
8796
8796
  if isinstance(parsed, dict):
8797
- error_payload["error_code"] = parsed.get("error_code") or cast(JSONObject, parsed.get("details", {})).get("error_code") or error_payload["error_code"]
8797
+ parsed_details = parsed.get("details")
8798
+ details_payload = cast(JSONObject, parsed_details) if isinstance(parsed_details, dict) else None
8799
+ error_payload["error_code"] = (
8800
+ parsed.get("error_code")
8801
+ or (details_payload.get("error_code") if details_payload is not None else None)
8802
+ or error_payload["error_code"]
8803
+ )
8798
8804
  error_payload["message"] = parsed.get("message") or error_payload["message"]
8799
8805
  if parsed.get("backend_code") is not None:
8800
8806
  error_payload["backend_code"] = parsed.get("backend_code")
@@ -10089,11 +10095,20 @@ class RecordTools(ToolBase):
10089
10095
  """执行内部辅助逻辑。"""
10090
10096
  if not app_key:
10091
10097
  raise_tool_error(QingflowApiError.config_error("app_key is required"))
10092
- try:
10093
- normalized_apply_id = normalize_positive_id_int(apply_id, field_name="apply_id")
10094
- except QingflowApiError:
10095
- raise_tool_error(QingflowApiError.config_error("apply_id must be positive"))
10096
- return normalized_apply_id
10098
+ return self._normalize_internal_backend_id(apply_id, field_name="apply_id")
10099
+
10100
+ def _normalize_internal_backend_id(self, value: Any, *, field_name: str) -> int:
10101
+ """Normalize backend/apply ids after the public boundary has already preserved long string ids."""
10102
+ if value in (None, "") or isinstance(value, bool):
10103
+ raise_tool_error(QingflowApiError.config_error(f"{field_name} must be positive"))
10104
+ if isinstance(value, int):
10105
+ if value <= 0:
10106
+ raise_tool_error(QingflowApiError.config_error(f"{field_name} must be positive"))
10107
+ return value
10108
+ text = stringify_backend_id(value)
10109
+ if text is None or not text.isdecimal() or int(text) <= 0:
10110
+ raise_tool_error(QingflowApiError.config_error(f"{field_name} must be positive"))
10111
+ return int(text)
10097
10112
 
10098
10113
  def _validate_record_write(self, app_key: str, answers: list[JSONObject], apply_id: int | None = None) -> None:
10099
10114
  """执行内部辅助逻辑。"""