@qingflow-tech/qingflow-app-builder-mcp 1.0.22 → 1.0.24

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 @qingflow-tech/qingflow-app-builder-mcp@1.0.22
6
+ npm install @qingflow-tech/qingflow-app-builder-mcp@1.0.24
7
7
  ```
8
8
 
9
9
  Run:
10
10
 
11
11
  ```bash
12
- npx -y -p @qingflow-tech/qingflow-app-builder-mcp@1.0.22 qingflow-app-builder-mcp
12
+ npx -y -p @qingflow-tech/qingflow-app-builder-mcp@1.0.24 qingflow-app-builder-mcp
13
13
  ```
14
14
 
15
15
  Environment:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingflow-tech/qingflow-app-builder-mcp",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Builder MCP for Qingflow app/package/system design and staged solution workflows.",
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 = "1.0.22"
7
+ version = "1.0.24"
8
8
  description = "User-authenticated MCP server for Qingflow"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -26,7 +26,7 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
26
26
 
27
27
  schema_applicant = schema_subparsers.add_parser("applicant", help=argparse.SUPPRESS)
28
28
  schema_applicant.add_argument("--app-key", required=True)
29
- schema_applicant.set_defaults(handler=_handle_schema_applicant, format_hint="")
29
+ schema_applicant.set_defaults(handler=_handle_schema_applicant, format_hint="record_schema")
30
30
  schema_subparsers._choices_actions = [ # type: ignore[attr-defined]
31
31
  action
32
32
  for action in schema_subparsers._choices_actions # type: ignore[attr-defined]
@@ -36,25 +36,25 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
36
36
  schema_browse = schema_subparsers.add_parser("browse", help="读取浏览视图表结构")
37
37
  schema_browse.add_argument("--app-key", required=True)
38
38
  schema_browse.add_argument("--view-id", required=True)
39
- schema_browse.set_defaults(handler=_handle_schema_browse, format_hint="")
39
+ schema_browse.set_defaults(handler=_handle_schema_browse, format_hint="record_schema")
40
40
 
41
41
  schema_insert = schema_subparsers.add_parser("insert", help="读取新增记录表结构")
42
42
  schema_insert.add_argument("--app-key", required=True)
43
- schema_insert.set_defaults(handler=_handle_schema_insert, format_hint="")
43
+ schema_insert.set_defaults(handler=_handle_schema_insert, format_hint="record_schema")
44
44
 
45
45
  schema_update = schema_subparsers.add_parser("update", help="读取更新记录表结构")
46
46
  schema_update.add_argument("--app-key", required=True)
47
47
  schema_update.add_argument("--record-id", required=True)
48
48
  schema_update.add_argument("--view-id")
49
- schema_update.set_defaults(handler=_handle_schema_update, format_hint="")
49
+ schema_update.set_defaults(handler=_handle_schema_update, format_hint="record_schema")
50
50
 
51
51
  schema_import = schema_subparsers.add_parser("import", help="读取导入表结构")
52
52
  schema_import.add_argument("--app-key", required=True)
53
- schema_import.set_defaults(handler=_handle_schema_import, format_hint="")
53
+ schema_import.set_defaults(handler=_handle_schema_import, format_hint="record_schema")
54
54
 
55
55
  schema_code_block = schema_subparsers.add_parser("code-block", help="读取代码块执行表结构")
56
56
  schema_code_block.add_argument("--app-key", required=True)
57
- schema_code_block.set_defaults(handler=_handle_schema_code_block, format_hint="")
57
+ schema_code_block.set_defaults(handler=_handle_schema_code_block, format_hint="record_schema")
58
58
 
59
59
  member_candidates = record_subparsers.add_parser("member-candidates", help="读取成员字段候选项")
60
60
  member_candidates.add_argument("--app-key", required=True)
@@ -452,6 +452,102 @@ def _format_record_candidates(result: dict[str, Any]) -> str:
452
452
  return "\n".join(lines) + "\n"
453
453
 
454
454
 
455
+ def _format_record_schema(result: dict[str, Any]) -> str:
456
+ lines = [
457
+ f"Status: {result.get('status') or '-'}",
458
+ f"App Key: {result.get('app_key') or '-'}",
459
+ f"Schema Scope: {result.get('schema_scope') or '-'}",
460
+ ]
461
+ if result.get("record_id") not in (None, ""):
462
+ lines.append(f"Record ID: {result.get('record_id')}")
463
+ view_resolution = result.get("view_resolution") if isinstance(result.get("view_resolution"), dict) else {}
464
+ view_id = view_resolution.get("view_id") or view_resolution.get("id")
465
+ if view_id:
466
+ lines.append(f"View ID: {view_id}")
467
+ if result.get("schema_fingerprint") not in (None, ""):
468
+ lines.append(f"Schema Fingerprint: {result.get('schema_fingerprint')}")
469
+
470
+ sections: list[tuple[str, list[Any]]] = []
471
+ for key, label in (
472
+ ("fields", "Fields"),
473
+ ("required_fields", "Required Fields"),
474
+ ("optional_fields", "Optional Fields"),
475
+ ("runtime_linked_required_fields", "Runtime Linked Required Fields"),
476
+ ("writable_fields", "Writable Fields"),
477
+ ("columns", "Import Columns"),
478
+ ("input_fields", "Input Fields"),
479
+ ("code_block_fields", "Code Block Fields"),
480
+ ("ambiguous_fields", "Ambiguous Fields"),
481
+ ):
482
+ value = result.get(key)
483
+ if isinstance(value, list):
484
+ sections.append((label, value))
485
+
486
+ for label, items in sections:
487
+ lines.append(f"{label}: {len(items)}")
488
+ for item in items[:20]:
489
+ if isinstance(item, dict):
490
+ lines.append("- " + _schema_item_summary(item))
491
+ else:
492
+ lines.append(f"- {item}")
493
+ if len(items) > 20:
494
+ lines.append(f"... {len(items) - 20} more")
495
+
496
+ payload_template = result.get("payload_template") if isinstance(result.get("payload_template"), dict) else {}
497
+ if payload_template:
498
+ lines.append("Payload Template Keys: " + ", ".join(str(key) for key in list(payload_template.keys())[:20]))
499
+
500
+ available_routes = result.get("available_update_routes") if isinstance(result.get("available_update_routes"), list) else []
501
+ if available_routes:
502
+ route_labels = [
503
+ str(item.get("route_type") or item.get("endpoint_kind") or item.get("view_id") or "-")
504
+ for item in available_routes[:8]
505
+ if isinstance(item, dict)
506
+ ]
507
+ lines.append("Available Update Routes: " + ", ".join(route_labels))
508
+
509
+ suggested_next_call = result.get("suggested_next_call") if isinstance(result.get("suggested_next_call"), dict) else {}
510
+ if suggested_next_call.get("tool_name"):
511
+ lines.append(f"Suggested Next Call: {suggested_next_call.get('tool_name')}")
512
+
513
+ _append_warnings(lines, result.get("warnings"))
514
+ _append_verification(lines, result.get("verification"))
515
+ return "\n".join(lines) + "\n"
516
+
517
+
518
+ def _schema_item_summary(item: dict[str, Any]) -> str:
519
+ field_id = (
520
+ item.get("field_id")
521
+ or item.get("que_id")
522
+ or item.get("queId")
523
+ or item.get("id")
524
+ or item.get("selector")
525
+ or "-"
526
+ )
527
+ title = item.get("title") or item.get("que_title") or item.get("queTitle") or item.get("name") or item.get("selector") or "-"
528
+ kind = item.get("kind") or item.get("write_kind") or item.get("que_type") or item.get("queType") or item.get("type") or "-"
529
+ parts = [f"{title} ({field_id})", f"kind={kind}"]
530
+ for key in ("required", "writable", "may_become_required", "requires_lookup", "requires_upload"):
531
+ if key in item:
532
+ parts.append(f"{key}={item.get(key)}")
533
+ if item.get("import_value_format") not in (None, ""):
534
+ parts.append(f"import_value_format={item.get('import_value_format')}")
535
+ if item.get("target_app_key") not in (None, ""):
536
+ parts.append(f"target_app_key={item.get('target_app_key')}")
537
+ options = item.get("options") if isinstance(item.get("options"), list) else []
538
+ if options:
539
+ parts.append(f"options={len(options)}")
540
+ bound_outputs = item.get("bound_output_fields") if isinstance(item.get("bound_output_fields"), list) else []
541
+ if bound_outputs:
542
+ parts.append("bound_outputs=" + ",".join(str(value) for value in bound_outputs[:5]))
543
+ aliases = item.get("configured_aliases") if isinstance(item.get("configured_aliases"), list) else []
544
+ if aliases:
545
+ parts.append("aliases=" + ",".join(str(value) for value in aliases[:5]))
546
+ if item.get("format_hint") not in (None, ""):
547
+ parts.append(f"hint={item.get('format_hint')}")
548
+ return " / ".join(parts)
549
+
550
+
455
551
  def _format_record_get(result: dict[str, Any]) -> str:
456
552
  record = result.get("record") if isinstance(result.get("record"), dict) else {}
457
553
  app = result.get("app") if isinstance(result.get("app"), dict) else {}
@@ -1078,18 +1174,76 @@ def _format_export_direct(result: dict[str, Any]) -> str:
1078
1174
 
1079
1175
  def _format_builder_summary(result: dict[str, Any]) -> str:
1080
1176
  lines = []
1081
- if "status" in result:
1082
- lines.append(f"Status: {result.get('status')}")
1083
- if "app_key" in result:
1084
- lines.append(f"App Key: {result.get('app_key')}")
1085
- if "dash_key" in result:
1086
- lines.append(f"Dash Key: {result.get('dash_key')}")
1087
- if "verified" in result:
1088
- lines.append(f"Verified: {result.get('verified')}")
1177
+ emitted: set[str] = set()
1178
+ for key, label in (
1179
+ ("status", "Status"),
1180
+ ("message", "Message"),
1181
+ ("app_key", "App Key"),
1182
+ ("dash_key", "Dash Key"),
1183
+ ("view_key", "View Key"),
1184
+ ("chart_id", "Chart ID"),
1185
+ ("package_id", "Package ID"),
1186
+ ("verified", "Verified"),
1187
+ ("write_executed", "Write Executed"),
1188
+ ("delete_executed", "Delete Executed"),
1189
+ ("safe_to_retry", "Safe To Retry"),
1190
+ ):
1191
+ if key in result and result.get(key) not in (None, ""):
1192
+ lines.append(f"{label}: {result.get(key)}")
1193
+ emitted.add(key)
1194
+ for key, value in result.items():
1195
+ if key in emitted or key in {"data", "warnings", "verification", "details", "result", "raw"}:
1196
+ continue
1197
+ if isinstance(value, (str, int, float, bool)) or value is None:
1198
+ lines.append(f"{key}: {value}")
1089
1199
  data = result.get("data")
1090
1200
  if isinstance(data, dict):
1091
1201
  scalar_lines = _dict_scalar_lines(data)
1092
- lines.extend(scalar_lines[:8])
1202
+ if scalar_lines:
1203
+ lines.append("Data:")
1204
+ lines.extend(f"- {line}" for line in scalar_lines[:12])
1205
+ for key in (
1206
+ "items",
1207
+ "apps",
1208
+ "fields",
1209
+ "sections",
1210
+ "components",
1211
+ "questions",
1212
+ "views",
1213
+ "charts",
1214
+ "buttons",
1215
+ "associations",
1216
+ "package_ids",
1217
+ "app_keys",
1218
+ ):
1219
+ value = result.get(key)
1220
+ if isinstance(value, list):
1221
+ lines.append(f"{key}: {len(value)}")
1222
+ components = result.get("components") if isinstance(result.get("components"), list) else []
1223
+ if components:
1224
+ lines.append("Component Refs:")
1225
+ for item in components[:8]:
1226
+ if not isinstance(item, dict):
1227
+ continue
1228
+ chart_ref = item.get("chart_ref") if isinstance(item.get("chart_ref"), dict) else {}
1229
+ view_ref = item.get("view_ref") if isinstance(item.get("view_ref"), dict) else {}
1230
+ source_type = item.get("source_type") or item.get("type") or "unknown"
1231
+ title = item.get("title")
1232
+ if chart_ref:
1233
+ lines.append(f"- {source_type}: {title or chart_ref.get('chart_name') or '-'} / chart_id={chart_ref.get('chart_id') or '-'}")
1234
+ elif view_ref:
1235
+ lines.append(
1236
+ f"- {source_type}: {title or view_ref.get('view_name') or '-'} / "
1237
+ f"view_key={view_ref.get('view_key') or '-'} / app_key={view_ref.get('app_key') or '-'}"
1238
+ )
1239
+ else:
1240
+ lines.append(f"- {source_type}: {title or '-'}")
1241
+ if isinstance(result.get("base"), dict):
1242
+ lines.append(f"Base Keys: {', '.join(str(key) for key in list(result['base'].keys())[:12])}")
1243
+ if isinstance(result.get("config"), dict):
1244
+ lines.append(f"Config Keys: {', '.join(str(key) for key in list(result['config'].keys())[:12])}")
1245
+ if isinstance(result.get("visibility"), dict):
1246
+ lines.append(f"Visibility Keys: {', '.join(str(key) for key in list(result['visibility'].keys())[:12])}")
1093
1247
  _append_warnings(lines, result.get("warnings"))
1094
1248
  _append_verification(lines, result.get("verification"))
1095
1249
  if not lines:
@@ -1331,6 +1485,7 @@ _FORMATTERS = {
1331
1485
  "record_list": _format_record_list,
1332
1486
  "record_access": _format_record_access,
1333
1487
  "record_candidates": _format_record_candidates,
1488
+ "record_schema": _format_record_schema,
1334
1489
  "record_get": _format_record_get,
1335
1490
  "record_logs": _format_record_logs,
1336
1491
  "record_write": _format_record_write,