@qingflow-tech/qingflow-app-builder-mcp 1.0.21 → 1.0.22
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.22
|
|
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.22 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 {}
|
|
@@ -1273,6 +1330,7 @@ _FORMATTERS = {
|
|
|
1273
1330
|
"chart_get": _format_chart_get,
|
|
1274
1331
|
"record_list": _format_record_list,
|
|
1275
1332
|
"record_access": _format_record_access,
|
|
1333
|
+
"record_candidates": _format_record_candidates,
|
|
1276
1334
|
"record_get": _format_record_get,
|
|
1277
1335
|
"record_logs": _format_record_logs,
|
|
1278
1336
|
"record_write": _format_record_write,
|