@qingflow-tech/qingflow-app-builder-mcp 1.0.21 → 1.0.23
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.
|
|
6
|
+
npm install @qingflow-tech/qingflow-app-builder-mcp@1.0.23
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y -p @qingflow-tech/qingflow-app-builder-mcp@1.0.
|
|
12
|
+
npx -y -p @qingflow-tech/qingflow-app-builder-mcp@1.0.23 qingflow-app-builder-mcp
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Environment:
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -65,7 +65,7 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
|
|
|
65
65
|
member_candidates.add_argument("--record-id")
|
|
66
66
|
member_candidates.add_argument("--workflow-node-id", type=int)
|
|
67
67
|
member_candidates.add_argument("--fields-file")
|
|
68
|
-
member_candidates.set_defaults(handler=_handle_member_candidates, format_hint="")
|
|
68
|
+
member_candidates.set_defaults(handler=_handle_member_candidates, format_hint="record_candidates")
|
|
69
69
|
|
|
70
70
|
department_candidates = record_subparsers.add_parser("department-candidates", help="读取部门字段候选项")
|
|
71
71
|
department_candidates.add_argument("--app-key", required=True)
|
|
@@ -76,7 +76,7 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
|
|
|
76
76
|
department_candidates.add_argument("--record-id")
|
|
77
77
|
department_candidates.add_argument("--workflow-node-id", type=int)
|
|
78
78
|
department_candidates.add_argument("--fields-file")
|
|
79
|
-
department_candidates.set_defaults(handler=_handle_department_candidates, format_hint="")
|
|
79
|
+
department_candidates.set_defaults(handler=_handle_department_candidates, format_hint="record_candidates")
|
|
80
80
|
|
|
81
81
|
list_parser = record_subparsers.add_parser("list", help="列出记录")
|
|
82
82
|
list_parser.add_argument("--app-key", required=True)
|
|
@@ -395,6 +395,63 @@ def _format_record_access(result: dict[str, Any]) -> str:
|
|
|
395
395
|
return "\n".join(lines) + "\n"
|
|
396
396
|
|
|
397
397
|
|
|
398
|
+
def _format_record_candidates(result: dict[str, Any]) -> str:
|
|
399
|
+
data = result.get("data") if isinstance(result.get("data"), dict) else {}
|
|
400
|
+
selection = data.get("selection") if isinstance(data.get("selection"), dict) else {}
|
|
401
|
+
pagination = data.get("pagination") if isinstance(data.get("pagination"), dict) else {}
|
|
402
|
+
items = data.get("items") if isinstance(data.get("items"), list) else []
|
|
403
|
+
lines = [
|
|
404
|
+
f"Field: {selection.get('field_title') or '-'} ({selection.get('field_id') or '-'})",
|
|
405
|
+
f"App Key: {selection.get('app_key') or '-'}",
|
|
406
|
+
f"Scope Source: {data.get('scope_source') or '-'}",
|
|
407
|
+
f"Keyword: {selection.get('keyword') if selection.get('keyword') not in (None, '') else '-'}",
|
|
408
|
+
]
|
|
409
|
+
if selection.get("record_id") not in (None, "") or selection.get("workflow_node_id") not in (None, "") or selection.get("fields_present"):
|
|
410
|
+
lines.append(
|
|
411
|
+
"Runtime Context: "
|
|
412
|
+
f"record_id={selection.get('record_id') or '-'} / "
|
|
413
|
+
f"workflow_node_id={selection.get('workflow_node_id') or '-'} / "
|
|
414
|
+
f"fields_present={selection.get('fields_present')}"
|
|
415
|
+
)
|
|
416
|
+
if pagination:
|
|
417
|
+
lines.append(
|
|
418
|
+
"Pagination: "
|
|
419
|
+
f"page={pagination.get('page')} / "
|
|
420
|
+
f"page_size={pagination.get('page_size')} / "
|
|
421
|
+
f"returned={pagination.get('returned_items')} / "
|
|
422
|
+
f"total={pagination.get('reported_total')} / "
|
|
423
|
+
f"pages={pagination.get('page_amount')}"
|
|
424
|
+
)
|
|
425
|
+
lines.append(f"Candidates: {len(items)}")
|
|
426
|
+
for item in items[:20]:
|
|
427
|
+
if not isinstance(item, dict):
|
|
428
|
+
lines.append(f"- {item}")
|
|
429
|
+
continue
|
|
430
|
+
parts = [str(item.get("value") or item.get("name") or item.get("id") or "-")]
|
|
431
|
+
if item.get("id") not in (None, ""):
|
|
432
|
+
parts.append(f"id={item.get('id')}")
|
|
433
|
+
if item.get("userId") not in (None, ""):
|
|
434
|
+
parts.append(f"userId={item.get('userId')}")
|
|
435
|
+
if item.get("email") not in (None, ""):
|
|
436
|
+
parts.append(f"email={item.get('email')}")
|
|
437
|
+
if item.get("path") not in (None, ""):
|
|
438
|
+
parts.append(f"path={item.get('path')}")
|
|
439
|
+
sources = item.get("sources") if isinstance(item.get("sources"), list) else []
|
|
440
|
+
source_labels = [
|
|
441
|
+
str(source.get("kind"))
|
|
442
|
+
for source in sources
|
|
443
|
+
if isinstance(source, dict) and source.get("kind") not in (None, "")
|
|
444
|
+
]
|
|
445
|
+
if source_labels:
|
|
446
|
+
parts.append("sources=" + ",".join(source_labels))
|
|
447
|
+
lines.append("- " + " / ".join(parts))
|
|
448
|
+
if len(items) > 20:
|
|
449
|
+
lines.append(f"... {len(items) - 20} more")
|
|
450
|
+
_append_warnings(lines, result.get("warnings"))
|
|
451
|
+
_append_verification(lines, result.get("verification"))
|
|
452
|
+
return "\n".join(lines) + "\n"
|
|
453
|
+
|
|
454
|
+
|
|
398
455
|
def _format_record_get(result: dict[str, Any]) -> str:
|
|
399
456
|
record = result.get("record") if isinstance(result.get("record"), dict) else {}
|
|
400
457
|
app = result.get("app") if isinstance(result.get("app"), dict) else {}
|
|
@@ -1021,18 +1078,76 @@ def _format_export_direct(result: dict[str, Any]) -> str:
|
|
|
1021
1078
|
|
|
1022
1079
|
def _format_builder_summary(result: dict[str, Any]) -> str:
|
|
1023
1080
|
lines = []
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1081
|
+
emitted: set[str] = set()
|
|
1082
|
+
for key, label in (
|
|
1083
|
+
("status", "Status"),
|
|
1084
|
+
("message", "Message"),
|
|
1085
|
+
("app_key", "App Key"),
|
|
1086
|
+
("dash_key", "Dash Key"),
|
|
1087
|
+
("view_key", "View Key"),
|
|
1088
|
+
("chart_id", "Chart ID"),
|
|
1089
|
+
("package_id", "Package ID"),
|
|
1090
|
+
("verified", "Verified"),
|
|
1091
|
+
("write_executed", "Write Executed"),
|
|
1092
|
+
("delete_executed", "Delete Executed"),
|
|
1093
|
+
("safe_to_retry", "Safe To Retry"),
|
|
1094
|
+
):
|
|
1095
|
+
if key in result and result.get(key) not in (None, ""):
|
|
1096
|
+
lines.append(f"{label}: {result.get(key)}")
|
|
1097
|
+
emitted.add(key)
|
|
1098
|
+
for key, value in result.items():
|
|
1099
|
+
if key in emitted or key in {"data", "warnings", "verification", "details", "result", "raw"}:
|
|
1100
|
+
continue
|
|
1101
|
+
if isinstance(value, (str, int, float, bool)) or value is None:
|
|
1102
|
+
lines.append(f"{key}: {value}")
|
|
1032
1103
|
data = result.get("data")
|
|
1033
1104
|
if isinstance(data, dict):
|
|
1034
1105
|
scalar_lines = _dict_scalar_lines(data)
|
|
1035
|
-
|
|
1106
|
+
if scalar_lines:
|
|
1107
|
+
lines.append("Data:")
|
|
1108
|
+
lines.extend(f"- {line}" for line in scalar_lines[:12])
|
|
1109
|
+
for key in (
|
|
1110
|
+
"items",
|
|
1111
|
+
"apps",
|
|
1112
|
+
"fields",
|
|
1113
|
+
"sections",
|
|
1114
|
+
"components",
|
|
1115
|
+
"questions",
|
|
1116
|
+
"views",
|
|
1117
|
+
"charts",
|
|
1118
|
+
"buttons",
|
|
1119
|
+
"associations",
|
|
1120
|
+
"package_ids",
|
|
1121
|
+
"app_keys",
|
|
1122
|
+
):
|
|
1123
|
+
value = result.get(key)
|
|
1124
|
+
if isinstance(value, list):
|
|
1125
|
+
lines.append(f"{key}: {len(value)}")
|
|
1126
|
+
components = result.get("components") if isinstance(result.get("components"), list) else []
|
|
1127
|
+
if components:
|
|
1128
|
+
lines.append("Component Refs:")
|
|
1129
|
+
for item in components[:8]:
|
|
1130
|
+
if not isinstance(item, dict):
|
|
1131
|
+
continue
|
|
1132
|
+
chart_ref = item.get("chart_ref") if isinstance(item.get("chart_ref"), dict) else {}
|
|
1133
|
+
view_ref = item.get("view_ref") if isinstance(item.get("view_ref"), dict) else {}
|
|
1134
|
+
source_type = item.get("source_type") or item.get("type") or "unknown"
|
|
1135
|
+
title = item.get("title")
|
|
1136
|
+
if chart_ref:
|
|
1137
|
+
lines.append(f"- {source_type}: {title or chart_ref.get('chart_name') or '-'} / chart_id={chart_ref.get('chart_id') or '-'}")
|
|
1138
|
+
elif view_ref:
|
|
1139
|
+
lines.append(
|
|
1140
|
+
f"- {source_type}: {title or view_ref.get('view_name') or '-'} / "
|
|
1141
|
+
f"view_key={view_ref.get('view_key') or '-'} / app_key={view_ref.get('app_key') or '-'}"
|
|
1142
|
+
)
|
|
1143
|
+
else:
|
|
1144
|
+
lines.append(f"- {source_type}: {title or '-'}")
|
|
1145
|
+
if isinstance(result.get("base"), dict):
|
|
1146
|
+
lines.append(f"Base Keys: {', '.join(str(key) for key in list(result['base'].keys())[:12])}")
|
|
1147
|
+
if isinstance(result.get("config"), dict):
|
|
1148
|
+
lines.append(f"Config Keys: {', '.join(str(key) for key in list(result['config'].keys())[:12])}")
|
|
1149
|
+
if isinstance(result.get("visibility"), dict):
|
|
1150
|
+
lines.append(f"Visibility Keys: {', '.join(str(key) for key in list(result['visibility'].keys())[:12])}")
|
|
1036
1151
|
_append_warnings(lines, result.get("warnings"))
|
|
1037
1152
|
_append_verification(lines, result.get("verification"))
|
|
1038
1153
|
if not lines:
|
|
@@ -1273,6 +1388,7 @@ _FORMATTERS = {
|
|
|
1273
1388
|
"chart_get": _format_chart_get,
|
|
1274
1389
|
"record_list": _format_record_list,
|
|
1275
1390
|
"record_access": _format_record_access,
|
|
1391
|
+
"record_candidates": _format_record_candidates,
|
|
1276
1392
|
"record_get": _format_record_get,
|
|
1277
1393
|
"record_logs": _format_record_logs,
|
|
1278
1394
|
"record_write": _format_record_write,
|