@josephyan/qingflow-cli 1.0.10 → 1.1.1
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 +3 -3
- package/npm/bin/qingflow.mjs +32 -1
- package/npm/lib/runtime.mjs +43 -2
- package/package.json +1 -1
- package/pyproject.toml +2 -1
- package/skills/qingflow-cli/SKILL.md +440 -0
- package/skills/qingflow-cli/manifest.yaml +10 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_ADMIN_CHEATSHEET.md +94 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_APP_DELIVERY_WORKFLOW.md +485 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_CHARTS_WORKFLOW.md +237 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_MATCH_RULES.md +137 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_PORTAL_WORKFLOW.md +263 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +304 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_WORKSPACE_ICONS.md +41 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md +139 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_EXPLORATION_REPORT.md +84 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_FIELD_DATA_TYPES.md +129 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_MEMBER_CHEATSHEET.md +195 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md +159 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md +20 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md +176 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md +163 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_SCHEMA_APPLY_FIELD_TYPES_AND_SCENARIOS.md +107 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md +151 -0
- package/skills/qingflow-cli/reference/_batch_schema_complex.json +18 -0
- package/skills/qingflow-cli/reference/_batch_schema_scalar.json +17 -0
- package/skills/qingflow-cli/reference/charts_remove.example.json +1 -0
- package/skills/qingflow-cli/reference/charts_reorder.example.json +1 -0
- package/skills/qingflow-cli/reference/charts_upsert_bar.example.json +8 -0
- package/skills/qingflow-cli/reference/charts_upsert_dashboard_starter.example.json +37 -0
- package/skills/qingflow-cli/reference/charts_upsert_minimal.example.json +13 -0
- package/skills/qingflow-cli/reference/portal_sections_all_types.example.json +131 -0
- package/skills/qingflow-cli/reference/portal_sections_five_types.example.json +126 -0
- package/skills/qingflow-cli/reference/portal_sections_standard_workbench.example.json +128 -0
- package/skills/qingflow-cli/reference/schema_add_fields_minimal.example.json +7 -0
- package/skills/qingflow-cli/reference/schema_apply_add_fields_all_types.json +78 -0
- package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +7 -0
- package/skills/qingflow-cli/scripts/builder-package-from-app-list.py +140 -0
- package/skills/qingflow-cli/scripts/find-app-by-keyword.py +132 -0
- package/skills/qingflow-cli/scripts/validate_qingflow_output_files.py +87 -0
- package/src/qingflow_mcp/__init__.py +1 -1
- package/src/qingflow_mcp/builder_facade/models.py +532 -48
- package/src/qingflow_mcp/builder_facade/service.py +9194 -2384
- package/src/qingflow_mcp/builder_facade/workflow_spec.py +111 -0
- package/src/qingflow_mcp/cli/commands/app.py +3 -16
- package/src/qingflow_mcp/cli/commands/builder.py +354 -56
- package/src/qingflow_mcp/cli/commands/record.py +89 -4
- package/src/qingflow_mcp/cli/formatters.py +53 -15
- package/src/qingflow_mcp/cli/main.py +204 -3
- package/src/qingflow_mcp/public_surface.py +11 -8
- package/src/qingflow_mcp/response_trim.py +185 -46
- package/src/qingflow_mcp/server.py +18 -15
- package/src/qingflow_mcp/server_app_builder.py +108 -30
- package/src/qingflow_mcp/server_app_user.py +20 -21
- package/src/qingflow_mcp/solution/compiler/__init__.py +1 -3
- package/src/qingflow_mcp/solution/compiler/icon_utils.py +294 -0
- package/src/qingflow_mcp/solution/executor.py +3 -133
- package/src/qingflow_mcp/tools/ai_builder_tools.py +2617 -440
- package/src/qingflow_mcp/tools/app_tools.py +53 -8
- package/src/qingflow_mcp/tools/package_tools.py +16 -2
- package/src/qingflow_mcp/tools/record_tools.py +3408 -599
- package/src/qingflow_mcp/tools/resource_read_tools.py +3 -0
- package/src/qingflow_mcp/tools/solution_tools.py +30 -2
- package/src/qingflow_mcp/tools/workflow_tools.py +3 -31
- package/src/qingflow_mcp/solution/compiler/workflow_compiler.py +0 -173
|
@@ -35,13 +35,23 @@ def build_builder_server() -> FastMCP:
|
|
|
35
35
|
"Follow the resource path resolve -> summary read -> apply -> publish_verify. "
|
|
36
36
|
"Use builder_tool_contract when you need a machine-readable contract, aliases, allowed enums, or a minimal valid example for a public builder tool. "
|
|
37
37
|
"Use solution_install when the user explicitly wants to install a packaged solution/template by solution_key, optionally copying bundled demo data. "
|
|
38
|
-
"
|
|
39
|
-
"
|
|
38
|
+
"Use package_list to find visible app packages by keyword and package_get to read package detail before editing; if creating or updating an app package may be appropriate, use package_apply with explicit user intent; otherwise use app_resolve to locate app resources, "
|
|
39
|
+
"Use workspace_icon_catalog_get before creating app packages, apps, or portals when supported icon/color candidates are needed; new workspace resources require explicit non-template icon + color, and the CLI validates choices without inferring business defaults. "
|
|
40
|
+
"app_get as the default app map read, then app_get_fields/app_repair_code_blocks/app_get_layout/app_get_views/app_get_flow/app_flow_get/app_flow_get_schema/app_get_charts/portal_list/portal_get/view_get/chart_get for focused configuration reads, "
|
|
40
41
|
"member_search/role_search/role_create when workflow assignees must come from the directory or role catalog, preferring roles over explicit members unless the user explicitly names members, "
|
|
41
|
-
"then app_schema_apply/app_layout_apply/app_flow_apply/app_views_apply/app_charts_apply/portal_apply to execute normalized patches; these apply tools perform planning, normalization, and dependency checks internally where applicable. Schema/layout/views noop requests skip publish, charts are immediate-live without publish and resolve targets by chart_id first then exact unique chart name, portal updates use replace semantics only when sections are supplied and edit-mode base-info-only updates may omit sections, publish=false only guarantees draft/base-info updates, and flow should use publish=false whenever you only want draft/precheck behavior. "
|
|
42
|
+
"then app_schema_apply/app_layout_apply/app_flow_apply/app_views_apply/app_custom_buttons_apply/app_associated_resources_apply/app_charts_apply/portal_apply to execute normalized patches; these apply tools perform planning, normalization, and dependency checks internally where applicable. Schema/layout/views noop requests skip publish, app_custom_buttons_apply and app_associated_resources_apply publish after at least one write succeeds and expose no draft-only parameter, charts are immediate-live without publish and resolve targets by chart_id first then exact unique chart name, portal updates use replace semantics only when sections are supplied and edit-mode base-info-only updates may omit sections, portal pc layout is a 24-column grid and mobile is a 6-column grid so omit position or use layout_preset when unsure, publish=false only guarantees draft/base-info updates for tools that still expose that parameter, and flow should use publish=false whenever you only want draft/precheck behavior. "
|
|
43
|
+
"Builder apply/write outputs include schema_version, operation, summary, and resources[]; use resources[].id/key/name/ids/parent as the stable UI and agent display entry, and keep legacy fields such as field_diff/views_diff/chart_results only for compatibility or troubleshooting. "
|
|
44
|
+
"For existing object parameter replacement, prefer patch_views, patch_buttons, patch_resources, and patch_charts with set/unset; the tool reads current config and full-saves internally, while upsert_* is for creation or full target configuration and should not be used as an incomplete partial update. "
|
|
45
|
+
"For builder delete/remove apply results, separate delete execution from readback verification: after DELETE is sent, resources expose delete_executed, readback_status, and safe_to_retry_delete=false. If readback_status is unavailable or still_exists, do not blindly repeat the delete; confirm later with app_get/view_get/chart_get or the relevant apply readback. Views/buttons use single-item readback; associated resources use one app-level resource-pool readback because there is no confirmed single-item GET. "
|
|
46
|
+
"For app_schema_apply, configure data title and data cover directly in field JSON with as_data_title=true and as_data_cover=true; data title is required and exactly one field may be marked, while data cover is optional and must be a top-level attachment field. For multi-app creation, pass apps[]/--apps-file on app_schema_apply; each item may have client_key, and relation fields may use target_app_ref to point at another same-call client_key. "
|
|
47
|
+
"For app_views_apply, keep fixed saved filters in filters and configure the frontend query panel separately with query_conditions; query_conditions.rows is a matrix of field names compiled to backend queryCondition queIds. New views default associated report/view display to visible with limit_type=all; existing views preserve their current associated display unless associated_resources is explicitly patched. "
|
|
48
|
+
"For custom button body create/update/delete and view placement, use app_custom_buttons_apply. For addData buttons, prefer trigger_add_data_config.target_app_key + field_mappings/default_values; do not ask agents to write raw que_relation unless maintaining a legacy config. field_mappings.source_field accepts source schema fields and supported system fields: 数据ID/row_record_id/apply_id/_id means current record id (-17), 编号/record_number means visible record number (0). To fill a target relation with the current record, map {'source_field': '数据ID', 'target_field': '目标引用字段'}; default_values is only for static constants. View button bindings merge by default and merge-mode view_configs must include buttons; use view_configs[].mode=replace or explicit buttons=[] only when clearing/replacing existing bindings is intended. Builder view_key arguments are raw keys from app_get.views[].view_key and must not be prefixed with custom:. "
|
|
49
|
+
"For BI reports, keep report-body development separate from Qingflow in-app display: use app_charts_apply to create, update, remove, or reorder app-source QingBI chart bodies/configs with dataSourceType=qingflow; chart dimension/metric/filter/query fields must come from app_get_fields.chart_fields, not record schema or form-only fields; dataset BI reports are not created or edited by app_charts_apply yet and should be created in QingBI first, then attached with app_associated_resources_apply using report_source=dataset. "
|
|
50
|
+
"For associated views/reports, use app_associated_resources_apply. Use match_mappings for filtering associated resources: dynamic current-record conditions use source_field, static conditions use value. match_mappings also supports 数据ID(-17) and 编号(0). Do not ask agents to write raw match_rules unless preserving a legacy backend config. "
|
|
51
|
+
"For associated reports/views, use app_associated_resources_apply for both the app-level associated_resources pool and per-view display config; associated_item_id is the app-level form_asos_chart.id, and view_configs/remove/reorder may also pass an existing resource's chart_id/chart_key/view_key because the tool resolves those to the internal id. Before creating an associated resource, read app_get.associated_resources and reuse an existing matching target_app_key + view_key/chart_key through patch_resources; client_key only works inside one apply call and is not persisted. Do not ask agents to pass backend raw sourceType: views infer the internal Qingflow view source, reports default to BI app reports, and dataset reports use report_source=dataset. "
|
|
42
52
|
"For code_block fields with output bindings, always use qf_output assignment rather than const/let qf_output, and use app_repair_code_blocks when an existing form hangs because output-bound fields stay loading. "
|
|
43
53
|
"Use package_apply to manage package metadata, visibility, grouping, and ordering, and app_publish_verify for explicit final publish verification. "
|
|
44
|
-
"For workflow edits,
|
|
54
|
+
"For workflow edits, use app_flow_get_schema and app_flow_get (GET-first), author a complete WorkflowSpecDTO in spec, then app_flow_apply; CLI equivalent is qingflow builder flow schema|get|apply --spec-file. Do not use general-server legacy workflow config reads (auditNodes list/detail, global settings, qsource config reads); they are removed. "
|
|
45
55
|
"If builder writes are blocked by the current user's own edit lock, use app_release_edit_lock_if_mine with the lock owner details from the failed result. "
|
|
46
56
|
"Do not handcraft internal solution payloads or rely on build_id/stage/repair. "
|
|
47
57
|
"If the current MCP capability is unsupported, the workflow is awkward, or the user's need still cannot be satisfied after reasonable use, first summarize the gap, ask whether to submit feedback, and call feedback_submit only after explicit user confirmation."
|
|
@@ -169,6 +179,14 @@ def build_builder_server() -> FastMCP:
|
|
|
169
179
|
def builder_tool_contract(tool_name: str = "") -> dict:
|
|
170
180
|
return ai_builder.builder_tool_contract(tool_name=tool_name)
|
|
171
181
|
|
|
182
|
+
@server.tool()
|
|
183
|
+
def workspace_icon_catalog_get(profile: str = DEFAULT_PROFILE) -> dict:
|
|
184
|
+
return ai_builder.workspace_icon_catalog_get(profile=profile)
|
|
185
|
+
|
|
186
|
+
@server.tool()
|
|
187
|
+
def package_list(profile: str = DEFAULT_PROFILE, trial_status: str = "all", query: str = "") -> dict:
|
|
188
|
+
return ai_builder.package_list(profile=profile, trial_status=trial_status, query=query)
|
|
189
|
+
|
|
172
190
|
@server.tool()
|
|
173
191
|
def package_get(profile: str = DEFAULT_PROFILE, package_id: int = 0) -> dict:
|
|
174
192
|
return ai_builder.package_get(profile=profile, package_id=package_id)
|
|
@@ -295,29 +313,42 @@ def build_builder_server() -> FastMCP:
|
|
|
295
313
|
return ai_builder.button_style_catalog_get(profile=profile)
|
|
296
314
|
|
|
297
315
|
@server.tool()
|
|
298
|
-
def
|
|
299
|
-
return ai_builder.app_custom_button_list(profile=profile, app_key=app_key)
|
|
300
|
-
|
|
301
|
-
@server.tool()
|
|
302
|
-
def app_custom_button_get(profile: str = DEFAULT_PROFILE, app_key: str = "", button_id: int = 0) -> dict:
|
|
303
|
-
return ai_builder.app_custom_button_get(profile=profile, app_key=app_key, button_id=button_id)
|
|
304
|
-
|
|
305
|
-
@server.tool()
|
|
306
|
-
def app_custom_button_create(profile: str = DEFAULT_PROFILE, app_key: str = "", payload: dict | None = None) -> dict:
|
|
307
|
-
return ai_builder.app_custom_button_create(profile=profile, app_key=app_key, payload=payload or {})
|
|
308
|
-
|
|
309
|
-
@server.tool()
|
|
310
|
-
def app_custom_button_update(
|
|
316
|
+
def app_custom_buttons_apply(
|
|
311
317
|
profile: str = DEFAULT_PROFILE,
|
|
312
318
|
app_key: str = "",
|
|
313
|
-
|
|
314
|
-
|
|
319
|
+
upsert_buttons: list[dict] | None = None,
|
|
320
|
+
patch_buttons: list[dict] | None = None,
|
|
321
|
+
remove_buttons: list[dict] | None = None,
|
|
322
|
+
view_configs: list[dict] | None = None,
|
|
315
323
|
) -> dict:
|
|
316
|
-
return ai_builder.
|
|
324
|
+
return ai_builder.app_custom_buttons_apply(
|
|
325
|
+
profile=profile,
|
|
326
|
+
app_key=app_key,
|
|
327
|
+
upsert_buttons=upsert_buttons or [],
|
|
328
|
+
patch_buttons=patch_buttons or [],
|
|
329
|
+
remove_buttons=remove_buttons or [],
|
|
330
|
+
view_configs=view_configs or [],
|
|
331
|
+
)
|
|
317
332
|
|
|
318
333
|
@server.tool()
|
|
319
|
-
def
|
|
320
|
-
|
|
334
|
+
def app_associated_resources_apply(
|
|
335
|
+
profile: str = DEFAULT_PROFILE,
|
|
336
|
+
app_key: str = "",
|
|
337
|
+
upsert_resources: list[dict] | None = None,
|
|
338
|
+
patch_resources: list[dict] | None = None,
|
|
339
|
+
remove_associated_item_ids: list[int] | None = None,
|
|
340
|
+
reorder_associated_item_ids: list[int] | None = None,
|
|
341
|
+
view_configs: list[dict] | None = None,
|
|
342
|
+
) -> dict:
|
|
343
|
+
return ai_builder.app_associated_resources_apply(
|
|
344
|
+
profile=profile,
|
|
345
|
+
app_key=app_key,
|
|
346
|
+
upsert_resources=upsert_resources or [],
|
|
347
|
+
patch_resources=patch_resources or [],
|
|
348
|
+
remove_associated_item_ids=remove_associated_item_ids or [],
|
|
349
|
+
reorder_associated_item_ids=reorder_associated_item_ids or [],
|
|
350
|
+
view_configs=view_configs or [],
|
|
351
|
+
)
|
|
321
352
|
|
|
322
353
|
@server.tool()
|
|
323
354
|
def app_get(profile: str = DEFAULT_PROFILE, app_key: str = "") -> dict:
|
|
@@ -387,7 +418,30 @@ def build_builder_server() -> FastMCP:
|
|
|
387
418
|
add_fields: list[dict] | None = None,
|
|
388
419
|
update_fields: list[dict] | None = None,
|
|
389
420
|
remove_fields: list[dict] | None = None,
|
|
421
|
+
apps: list[dict] | None = None,
|
|
390
422
|
) -> dict:
|
|
423
|
+
if apps:
|
|
424
|
+
if app_key or app_name or app_title or add_fields or update_fields or remove_fields:
|
|
425
|
+
return _config_failure(
|
|
426
|
+
"app_schema_apply multi-app mode accepts package_id/create_if_missing plus apps only.",
|
|
427
|
+
fix_hint="Use `apps` for batch mode, or use the single-app arguments without `apps`.",
|
|
428
|
+
)
|
|
429
|
+
if package_id is None:
|
|
430
|
+
return _config_failure(
|
|
431
|
+
"app_schema_apply multi-app mode requires package_id.",
|
|
432
|
+
fix_hint="Pass `package_id` and `apps[].app_name` for new apps, or `apps[].app_key` for existing apps.",
|
|
433
|
+
)
|
|
434
|
+
return ai_builder.app_schema_apply(
|
|
435
|
+
profile=profile,
|
|
436
|
+
package_id=package_id,
|
|
437
|
+
visibility=visibility,
|
|
438
|
+
create_if_missing=create_if_missing,
|
|
439
|
+
publish=publish,
|
|
440
|
+
add_fields=[],
|
|
441
|
+
update_fields=[],
|
|
442
|
+
remove_fields=[],
|
|
443
|
+
apps=apps,
|
|
444
|
+
)
|
|
391
445
|
has_app_key = bool((app_key or "").strip())
|
|
392
446
|
has_app_name = bool((app_name or "").strip())
|
|
393
447
|
has_app_title = bool((app_title or "").strip())
|
|
@@ -417,6 +471,7 @@ def build_builder_server() -> FastMCP:
|
|
|
417
471
|
add_fields=add_fields or [],
|
|
418
472
|
update_fields=update_fields or [],
|
|
419
473
|
remove_fields=remove_fields or [],
|
|
474
|
+
apps=[],
|
|
420
475
|
)
|
|
421
476
|
|
|
422
477
|
@server.tool()
|
|
@@ -429,22 +484,30 @@ def build_builder_server() -> FastMCP:
|
|
|
429
484
|
) -> dict:
|
|
430
485
|
return ai_builder.app_layout_apply(profile=profile, app_key=app_key, mode=mode, publish=publish, sections=sections or [])
|
|
431
486
|
|
|
487
|
+
@server.tool()
|
|
488
|
+
def app_flow_get(profile: str = DEFAULT_PROFILE, app_key: str = "", version_id: str = "") -> dict:
|
|
489
|
+
return ai_builder.app_get_flow(profile=profile, app_key=app_key, version_id=version_id or None)
|
|
490
|
+
|
|
491
|
+
@server.tool()
|
|
492
|
+
def app_flow_get_schema(profile: str = DEFAULT_PROFILE, schema_version: str = "") -> dict:
|
|
493
|
+
return ai_builder.app_flow_get_schema(profile=profile, schema_version=schema_version or None)
|
|
494
|
+
|
|
432
495
|
@server.tool()
|
|
433
496
|
def app_flow_apply(
|
|
434
497
|
profile: str = DEFAULT_PROFILE,
|
|
435
498
|
app_key: str = "",
|
|
436
|
-
mode: str = "replace",
|
|
437
499
|
publish: bool = True,
|
|
438
|
-
|
|
439
|
-
|
|
500
|
+
spec: dict | None = None,
|
|
501
|
+
idempotency_key: str = "",
|
|
502
|
+
schema_version: str = "",
|
|
440
503
|
) -> dict:
|
|
441
504
|
return ai_builder.app_flow_apply(
|
|
442
505
|
profile=profile,
|
|
443
506
|
app_key=app_key,
|
|
444
|
-
mode=mode,
|
|
445
507
|
publish=publish,
|
|
446
|
-
|
|
447
|
-
|
|
508
|
+
spec=spec or {},
|
|
509
|
+
idempotency_key=idempotency_key or None,
|
|
510
|
+
schema_version=schema_version or None,
|
|
448
511
|
)
|
|
449
512
|
|
|
450
513
|
@server.tool()
|
|
@@ -453,6 +516,7 @@ def build_builder_server() -> FastMCP:
|
|
|
453
516
|
app_key: str = "",
|
|
454
517
|
publish: bool = True,
|
|
455
518
|
upsert_views: list[dict] | None = None,
|
|
519
|
+
patch_views: list[dict] | None = None,
|
|
456
520
|
remove_views: list[str] | None = None,
|
|
457
521
|
) -> dict:
|
|
458
522
|
return ai_builder.app_views_apply(
|
|
@@ -460,6 +524,7 @@ def build_builder_server() -> FastMCP:
|
|
|
460
524
|
app_key=app_key,
|
|
461
525
|
publish=publish,
|
|
462
526
|
upsert_views=upsert_views or [],
|
|
527
|
+
patch_views=patch_views or [],
|
|
463
528
|
remove_views=remove_views or [],
|
|
464
529
|
)
|
|
465
530
|
|
|
@@ -468,6 +533,7 @@ def build_builder_server() -> FastMCP:
|
|
|
468
533
|
profile: str = DEFAULT_PROFILE,
|
|
469
534
|
app_key: str = "",
|
|
470
535
|
upsert_charts: list[dict] | None = None,
|
|
536
|
+
patch_charts: list[dict] | None = None,
|
|
471
537
|
remove_chart_ids: list[str] | None = None,
|
|
472
538
|
reorder_chart_ids: list[str] | None = None,
|
|
473
539
|
) -> dict:
|
|
@@ -475,6 +541,7 @@ def build_builder_server() -> FastMCP:
|
|
|
475
541
|
profile=profile,
|
|
476
542
|
app_key=app_key,
|
|
477
543
|
upsert_charts=upsert_charts or [],
|
|
544
|
+
patch_charts=patch_charts or [],
|
|
478
545
|
remove_chart_ids=remove_chart_ids or [],
|
|
479
546
|
reorder_chart_ids=reorder_chart_ids or [],
|
|
480
547
|
)
|
|
@@ -484,9 +551,12 @@ def build_builder_server() -> FastMCP:
|
|
|
484
551
|
profile: str = DEFAULT_PROFILE,
|
|
485
552
|
dash_key: str = "",
|
|
486
553
|
dash_name: str = "",
|
|
554
|
+
name: str = "",
|
|
487
555
|
package_id: int | None = None,
|
|
488
556
|
publish: bool = True,
|
|
489
557
|
sections: list[dict] | None = None,
|
|
558
|
+
pages: list[dict] | None = None,
|
|
559
|
+
layout_preset: str = "",
|
|
490
560
|
visibility: dict | None = None,
|
|
491
561
|
auth: dict | None = None,
|
|
492
562
|
icon: str | None = None,
|
|
@@ -494,10 +564,14 @@ def build_builder_server() -> FastMCP:
|
|
|
494
564
|
hide_copyright: bool | None = None,
|
|
495
565
|
dash_global_config: dict | None = None,
|
|
496
566
|
config: dict | None = None,
|
|
567
|
+
payload: dict | None = None,
|
|
497
568
|
) -> dict:
|
|
569
|
+
payload = payload if isinstance(payload, dict) else {}
|
|
498
570
|
has_dash_key = bool((dash_key or "").strip())
|
|
499
|
-
|
|
500
|
-
|
|
571
|
+
effective_dash_name = (dash_name or name or str(payload.get("dash_name") or payload.get("dashName") or payload.get("name") or "")).strip()
|
|
572
|
+
has_dash_name = bool(effective_dash_name)
|
|
573
|
+
effective_package_id = package_id if package_id is not None else payload.get("package_id") or payload.get("packageId") or payload.get("package_tag_id")
|
|
574
|
+
has_package_id = effective_package_id is not None
|
|
501
575
|
if has_dash_key and has_package_id:
|
|
502
576
|
return _config_failure(
|
|
503
577
|
"portal_apply accepts exactly one selector mode.",
|
|
@@ -512,9 +586,12 @@ def build_builder_server() -> FastMCP:
|
|
|
512
586
|
profile=profile,
|
|
513
587
|
dash_key=dash_key,
|
|
514
588
|
dash_name=dash_name,
|
|
589
|
+
name=name,
|
|
515
590
|
package_id=package_id,
|
|
516
591
|
publish=publish,
|
|
517
592
|
sections=sections or [],
|
|
593
|
+
pages=pages or [],
|
|
594
|
+
layout_preset=layout_preset,
|
|
518
595
|
visibility=visibility,
|
|
519
596
|
auth=auth,
|
|
520
597
|
icon=icon,
|
|
@@ -522,6 +599,7 @@ def build_builder_server() -> FastMCP:
|
|
|
522
599
|
hide_copyright=hide_copyright,
|
|
523
600
|
dash_global_config=dash_global_config,
|
|
524
601
|
config=config or {},
|
|
602
|
+
payload=payload,
|
|
525
603
|
)
|
|
526
604
|
|
|
527
605
|
@server.tool()
|
|
@@ -31,7 +31,7 @@ def build_user_server() -> FastMCP:
|
|
|
31
31
|
|
|
32
32
|
## App Discovery
|
|
33
33
|
|
|
34
|
-
If `app_key` is unknown, use `app_list`
|
|
34
|
+
If `app_key` is unknown, use `app_list` first. Pass `query` to filter visible apps by keyword.
|
|
35
35
|
If the app is known but the data range is not, use `app_get` first and choose from `accessible_views`.
|
|
36
36
|
If an accessible view has `analysis_supported=false`, do not use it for `record_access` or `record_list`. `boardView` and `ganttView` are special UI views, not data-access targets.
|
|
37
37
|
`view_get(view_id=...)` also returns `export_capability`; it only means there is a supported export route, not that export permission has been verified.
|
|
@@ -47,9 +47,9 @@ If an accessible view has `analysis_supported=false`, do not use it for `record_
|
|
|
47
47
|
## Schema-First Rule
|
|
48
48
|
|
|
49
49
|
Call `record_insert_schema_get` before `record_insert`.
|
|
50
|
-
|
|
50
|
+
For simple field changes after the target record is clear, call `record_update` directly. Use `record_update_schema_get` for diagnostics, ambiguous fields, or complex writable-scope inspection.
|
|
51
51
|
Call `record_code_block_schema_get` before `record_code_block_run`.
|
|
52
|
-
Call `app_get` first when the data range is unclear, then use `record_browse_schema_get(view_id=...)` before `record_access`, `record_list`, or `
|
|
52
|
+
Call `app_get` first when the data range is unclear, then use `record_browse_schema_get(view_id=...)` before `record_access`, `record_list`, `record_get`, or `record_logs_get`.
|
|
53
53
|
Call `record_import_schema_get` when the import field mapping is unclear before template download or verify.
|
|
54
54
|
|
|
55
55
|
- All `field_id` values must come from the schema response.
|
|
@@ -59,9 +59,9 @@ Call `record_import_schema_get` when the import field mapping is unclear before
|
|
|
59
59
|
|
|
60
60
|
`record_insert_schema_get` returns the current user's insert-ready applicant schema; read `required_fields`, `optional_fields`, `runtime_linked_required_fields`, and `payload_template`.
|
|
61
61
|
Inside `optional_fields`, any field with `may_become_required=true` is still writable, but may become required when linked visibility or option-driven runtime rules activate.
|
|
62
|
-
`record_update_schema_get` returns the current record's overall update-ready writable field set across matched accessible views; read `writable_fields` and `
|
|
62
|
+
`record_update_schema_get` returns the current record's overall update-ready writable field set and route diagnostics across matched accessible views; read `writable_fields`, `payload_template`, `available_update_routes`, and `recommended_update_route`.
|
|
63
63
|
`record_browse_schema_get(view_id=...)` returns the same readable fields shown in the selected Qingflow table view header.
|
|
64
|
-
`record_access.fields`
|
|
64
|
+
`record_access.fields` / CSV columns and `record_list.columns / where / order_by / query_fields` use that exact same view schema; a missing field means it is not readable in that view.
|
|
65
65
|
`searchQueIds` is a backend full-text search scope, not an output-column/projection mechanism.
|
|
66
66
|
`record_code_block_schema_get` returns code-block-ready schema for exact code block field selection.
|
|
67
67
|
`record_import_schema_get` returns import-ready column metadata.
|
|
@@ -102,9 +102,9 @@ Analysis answers must include concrete numbers. When applicable, include percent
|
|
|
102
102
|
|
|
103
103
|
## Record CRUD Path
|
|
104
104
|
|
|
105
|
-
`app_get -> record_browse_schema_get(view_id=...) -> record_list / record_get`
|
|
106
|
-
`record_insert_schema_get -> record_insert`
|
|
107
|
-
`record_update_schema_get -> record_update`
|
|
105
|
+
`app_get -> record_browse_schema_get(view_id=...) -> record_list / record_get / record_logs_get`
|
|
106
|
+
`record_insert_schema_get -> record_insert(items)`
|
|
107
|
+
`record_update` for simple updates; `record_update_schema_get -> record_update` when the writable field scope is unclear.
|
|
108
108
|
`record_list / record_get -> record_delete`
|
|
109
109
|
`record_code_block_schema_get -> record_code_block_run`
|
|
110
110
|
`portal_list -> portal_get -> chart_get / view_get`
|
|
@@ -116,22 +116,25 @@ Analysis answers must include concrete numbers. When applicable, include percent
|
|
|
116
116
|
- Use `order_by` items as `{{field_id, direction}}`
|
|
117
117
|
- Legacy forms such as bare integer `field_id`, `fieldId`, `operator`, `values`, or `order` may still parse, but they are compatibility-only and not the canonical DSL
|
|
118
118
|
|
|
119
|
-
- `record_insert`
|
|
120
|
-
- `record_update` uses a field-title keyed `fields` map
|
|
119
|
+
- `record_insert` defaults to an applicant-node `items` array; each item contains a field-title keyed `fields` map. A single insert is one item.
|
|
120
|
+
- `record_update` uses a field-title keyed `fields` map. It first tries the data-manager direct update route, then falls back to the frontend custom-view detail edit route when the selected view can cover the payload; if a unique current-user todo task for the same record exposes editable fields, it can finally use the workflow save-only route. Read `update_route` and `tried_routes` after execution.
|
|
121
121
|
- For insert, `runtime_linked_required_fields` means required-but-not-directly-writable fields that are usually supplied by runtime linkage or upstream context.
|
|
122
122
|
- For insert, fields marked `may_become_required=true` stay in `optional_fields`; they are still directly writable, but linked visibility or option-driven rules can make them required at runtime.
|
|
123
123
|
- Read field-level `linkage` whenever present on `record_insert_schema_get` or `record_update_schema_get`; it is the static hint for linked visibility, reference-driven auto fill, and formula/default auto-fill behavior.
|
|
124
124
|
- `linkage.sources` lists upstream field titles that influence the current field; `linkage.affects_fields` lists downstream fields that may change when the current field changes.
|
|
125
125
|
- `linkage.kind=logic_visibility` means linked visibility or option-driven rules are involved; `linkage.kind=reference_fill` means reference/default matching logic is involved; `linkage.kind=formula_fill` means formula/default auto-fill logic is involved.
|
|
126
|
-
- `record_update_schema_get` exposes the overall writable field set for the record, but not every field combination is guaranteed; `record_update` still needs one single matched
|
|
126
|
+
- `record_update_schema_get` exposes the overall writable field set and update route candidates for the record, but not every field combination is guaranteed; `record_update` still needs data-manager permission, one single matched custom view that can cover the payload, or one unique editable current-user todo task.
|
|
127
127
|
- `record_delete` deletes by `record_id` or `record_ids`.
|
|
128
|
-
- `record_get` is the single-record frontend detail context tool. It returns detail-page visible fields, one-level relation targets, first-page data/workflow logs, associated views/reports, local readable image assets
|
|
129
|
-
-
|
|
128
|
+
- `record_get` is the single-record frontend detail context tool. It returns detail-page visible fields, one-level relation targets, first-page data/workflow logs, associated views/reports, local readable image assets, local downloadable file assets, unavailable context, and `semantic_context`.
|
|
129
|
+
- Use `record_logs_get` only when the user needs the full visible data/workflow log history for a specific record. It writes JSONL files locally and returns file paths plus completeness metadata; do not expect full log arrays in the response.
|
|
130
|
+
- Read record images from `record_get.media_assets.items[].local_path` when `readable_by_agent=true`; read attachments/documents/tables from `record_get.file_assets.items[].local_path` and `extraction.text_path` when present. `record_get` follows the frontend storage cookie redirect path for Qingflow attachments, and remote file URLs should not be treated as directly readable.
|
|
130
131
|
- `record_get.columns` are focus hints only; they do not project the detail fields. Read facts from top-level `fields[]`.
|
|
131
132
|
- When readback shape matters after insert or update, prefer `record_get` for human/detail-page context, or `record_list(..., output_profile="normalized")` for batch-shaped normalized rows.
|
|
132
133
|
|
|
133
134
|
- Read relation targets from `record_insert_schema_get` / `record_update_schema_get` relation metadata before preparing relation writes.
|
|
134
|
-
- Member and
|
|
135
|
+
- Member, department, and relation fields may be written with natural strings directly on `record_insert` / `record_update`; only fall back to candidate tools when the user wants explicit candidate browsing or the write returns ambiguity that needs confirmation.
|
|
136
|
+
- CLI-only agents can use `qingflow record member-candidates --app-key APP_KEY --field-id FIELD_ID --keyword NAME --json` or `qingflow record department-candidates --app-key APP_KEY --field-id FIELD_ID --keyword DEPT --json` for that fallback.
|
|
137
|
+
- For batch insert `partial_success`, read `created_record_ids`, failed `items[].row_number`, and `failed_fields`; repair only failed rows and never retry the whole batch after any row has `write_executed=true`.
|
|
135
138
|
- When candidate browsing must match a real update/write scope, pass `record_id`, `workflow_node_id`, and any pending `fields` context to the candidate tool; otherwise the candidate result is only a static applicant-node preview.
|
|
136
139
|
- If explicit candidate browsing is needed for default-all member or department fields, prefer those field candidate tools instead of starting with `directory_*`.
|
|
137
140
|
|
|
@@ -188,7 +191,7 @@ Use export only when the user explicitly asks to export/download/generate an Exc
|
|
|
188
191
|
- `task_action_execute(task_id=..., action=...)` is also supported; MCP resolves the current todo locator internally before calling the real action route.
|
|
189
192
|
- `task_workflow_log_get(task_id=...)` and `task_associated_report_detail_get(task_id=...)` are also supported for the current todo context.
|
|
190
193
|
- Use `task_associated_report_detail_get` for associated view or report details.
|
|
191
|
-
- Use `task_workflow_log_get` for
|
|
194
|
+
- Use `task_workflow_log_get` for the current task context workflow log page. For full record-level data/workflow logs, use `record_logs_get(app_key, record_id, view_id?)`.
|
|
192
195
|
- Task actions operate on `app_key + record_id + workflow_node_id`, not `task_id`.
|
|
193
196
|
- Treat `task_action_execute` as the tool-level action enum surface; the current task's real actions are only the ones listed in `task_get.capabilities.available_actions`.
|
|
194
197
|
- Use `task_action_execute(action="save_only", fields=...)` when the user wants to save editable field changes on the current node without advancing the workflow.
|
|
@@ -358,12 +361,8 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
358
361
|
)
|
|
359
362
|
|
|
360
363
|
@server.tool()
|
|
361
|
-
def app_list(profile: str = DEFAULT_PROFILE) -> dict:
|
|
362
|
-
return apps.app_list(profile=profile)
|
|
363
|
-
|
|
364
|
-
@server.tool()
|
|
365
|
-
def app_search(profile: str = DEFAULT_PROFILE, keyword: str = "", page_num: int = 1, page_size: int = 50) -> dict:
|
|
366
|
-
return apps.app_search(profile=profile, keyword=keyword, page_num=page_num, page_size=page_size)
|
|
364
|
+
def app_list(profile: str = DEFAULT_PROFILE, query: str = "", keyword: str = "") -> dict:
|
|
365
|
+
return apps.app_list(profile=profile, query=query, keyword=keyword)
|
|
367
366
|
|
|
368
367
|
@server.tool()
|
|
369
368
|
def app_get(profile: str = DEFAULT_PROFILE, app_key: str = "") -> dict:
|
|
@@ -10,8 +10,6 @@ from .navigation_compiler import compile_navigation
|
|
|
10
10
|
from .package_compiler import compile_package
|
|
11
11
|
from .portal_compiler import compile_portal
|
|
12
12
|
from .view_compiler import compile_views
|
|
13
|
-
from .workflow_compiler import compile_workflow
|
|
14
|
-
|
|
15
13
|
|
|
16
14
|
@dataclass(slots=True)
|
|
17
15
|
class ExecutionStep:
|
|
@@ -101,7 +99,7 @@ def compile_solution(spec: SolutionSpec) -> CompiledSolution:
|
|
|
101
99
|
|
|
102
100
|
def compile_entity(entity: EntitySpec, *, include_package: bool) -> CompiledEntity:
|
|
103
101
|
app_create_payload, form_base_payload, form_relation_payload, field_specs, field_labels = compile_entity_form(entity, include_package=include_package)
|
|
104
|
-
workflow_plan =
|
|
102
|
+
workflow_plan = None
|
|
105
103
|
view_plans = compile_views(entity)
|
|
106
104
|
chart_plans = compile_charts(entity)
|
|
107
105
|
return CompiledEntity(
|