@josephyan/qingflow-cli 0.2.0-beta.1007 → 0.2.0-beta.1010

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.
@@ -96,6 +96,7 @@ class ResourceReadTools(ToolBase):
96
96
  )
97
97
  )
98
98
  if system_view is not None:
99
+ export_capability = _view_export_capability_payload(supported=True)
99
100
  return self._run(
100
101
  profile,
101
102
  lambda session_profile, _context: {
@@ -106,11 +107,17 @@ class ResourceReadTools(ToolBase):
106
107
  {
107
108
  "code": "VIEW_APP_KEY_UNRESOLVED",
108
109
  "message": f"view_get could not resolve app_key for system view `{view_id}`; keep using the app_key from the parent app context.",
109
- }
110
+ },
111
+ {
112
+ "code": "VIEW_EXPORT_APP_CONTEXT_REQUIRED",
113
+ "message": f"view_get supports exporting `{view_id}`, but the export call still needs the parent app context `app_key`.",
114
+ },
110
115
  ],
111
116
  "verification": {
112
117
  "view_exists": True,
113
118
  "descriptor_only": True,
119
+ "export_route_supported": export_capability["supported"],
120
+ "export_permission_verified": export_capability["permission_verified"],
114
121
  },
115
122
  "data": {
116
123
  "app_key": None,
@@ -120,15 +127,19 @@ class ResourceReadTools(ToolBase):
120
127
  "view_type": system_view["view_type"],
121
128
  "visible_columns": [],
122
129
  "analysis_supported": system_view["analysis_supported"],
130
+ "export_capability": export_capability,
123
131
  },
124
132
  },
125
133
  )
126
134
 
127
135
  def runner(session_profile, context):
136
+ export_capability = _view_export_capability_payload(supported=True)
128
137
  warnings: list[JSONObject] = []
129
138
  verification = {
130
139
  "view_exists": True,
131
140
  "questions_verified": True,
141
+ "export_route_supported": export_capability["supported"],
142
+ "export_permission_verified": export_capability["permission_verified"],
132
143
  }
133
144
  config = self.backend.request("GET", context, f"/view/{view_key}/viewConfig")
134
145
  base_info = self.backend.request("GET", context, f"/view/{view_key}/viewConfig/baseInfo")
@@ -165,6 +176,12 @@ class ResourceReadTools(ToolBase):
165
176
  "message": f"view_get could not resolve app_key for `{view_id}` from view metadata; keep using the app_key from the parent app or portal context.",
166
177
  }
167
178
  )
179
+ warnings.append(
180
+ {
181
+ "code": "VIEW_EXPORT_APP_CONTEXT_REQUIRED",
182
+ "message": f"view_get supports exporting `{view_id}`, but the export call still needs an explicit `app_key` from the parent app context.",
183
+ }
184
+ )
168
185
  return {
169
186
  "profile": profile,
170
187
  "ws_id": session_profile.selected_ws_id,
@@ -186,6 +203,7 @@ class ResourceReadTools(ToolBase):
186
203
  if str(item.get("queTitle") or item.get("title") or "").strip()
187
204
  ],
188
205
  "analysis_supported": _analysis_supported_for_view_type(raw_view_type or None),
206
+ "export_capability": export_capability,
189
207
  },
190
208
  }
191
209
 
@@ -464,6 +482,17 @@ def _lookup_system_view_descriptor(view_id: str) -> dict[str, Any] | None:
464
482
  return None
465
483
 
466
484
 
485
+ def _view_export_capability_payload(*, supported: bool) -> JSONObject:
486
+ return {
487
+ "supported": supported,
488
+ "tool": "record_export_start",
489
+ "format": "xlsx",
490
+ "async": True,
491
+ "requires_app_key": True,
492
+ "permission_verified": False,
493
+ }
494
+
495
+
467
496
  def _normalize_view_type(view_type: Any) -> str | None:
468
497
  value = str(view_type or "").strip()
469
498
  if not value: