@josephyan/qingflow-app-builder-mcp 1.1.17 → 1.1.18
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 +2 -2
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/skills/qingflow-app-builder/SKILL.md +56 -11
- package/skills/qingflow-app-builder/references/complete-system-development-guide.md +54 -5
- package/skills/qingflow-app-builder/references/create-app.md +10 -1
- package/skills/qingflow-app-builder/references/gotchas.md +17 -3
- package/skills/qingflow-app-builder/references/single-app-development-guide.md +33 -4
- package/skills/qingflow-app-builder/references/tool-selection.md +20 -4
- package/skills/qingflow-app-builder/references/update-schema.md +11 -0
- package/skills/qingflow-app-builder/references/update-views.md +49 -0
- package/src/qingflow_mcp/builder_facade/models.py +35 -2
- package/src/qingflow_mcp/builder_facade/service.py +66 -13
- package/src/qingflow_mcp/cli/commands/builder.py +6 -3
- package/src/qingflow_mcp/server_app_builder.py +6 -3
- package/src/qingflow_mcp/tools/ai_builder_tools.py +391 -24
package/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Install:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @josephyan/qingflow-app-builder-mcp@1.1.
|
|
6
|
+
npm install @josephyan/qingflow-app-builder-mcp@1.1.18
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y -p @josephyan/qingflow-app-builder-mcp@1.1.
|
|
12
|
+
npx -y -p @josephyan/qingflow-app-builder-mcp@1.1.18 qingflow-app-builder-mcp
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Environment:
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -7,7 +7,7 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow App Builder
|
|
9
9
|
|
|
10
|
-
> **Skill 版本**:`qingflow-skills-2026.06.
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.28.3`(入口文档版本;CLI 实际执行包以 `qingflow --json version` 返回的 `package / version / package_root / skill_version` 为准)。
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
13
|
|
|
@@ -47,11 +47,24 @@ For complete systems, `apps[]` should use stable `client_key` values. Same-call
|
|
|
47
47
|
|
|
48
48
|
If a complete-system `app_schema_apply` times out, returns `partial_success`, returns `write_executed=true`, has `safe_to_retry=false`, or has incomplete readback, treat it as an uncertain write, not as a failed create. The next action is always `readback_before_retry`: read the package/app/fields first, compare intended `client_key`/`app_name`/relations against reality, and only then repair the missing slice. Do not retry the whole multi-app create, create `V2`/`测试`/random-suffix apps, or split the system into single-app rebuilds to bypass a duplicate/conflict.
|
|
49
49
|
|
|
50
|
+
Before any write, apply this decision gate:
|
|
51
|
+
|
|
52
|
+
| Evidence | Action |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Exact `app_key`, `view_key`, `chart_id`, `dash_key`, or `package_id` is provided | Update that existing target unless the user explicitly asks for a new one |
|
|
55
|
+
| Several forms/modules or a “system/package” are requested | Use the complete-system path; do not compress them into one app |
|
|
56
|
+
| Same/similar package or app already exists and user did not say extend/replace/new | Stop and ask which target strategy to use |
|
|
57
|
+
| Readback already contains part of the requested build | Patch only verified missing or incorrect slices |
|
|
58
|
+
| Write state is uncertain | Read back before retrying; do not create duplicate names with suffixes |
|
|
59
|
+
|
|
50
60
|
Builder schema inputs should follow agent-intuitive semantics:
|
|
51
61
|
|
|
62
|
+
- choose field type by business intent first: title/short text -> `text`; notes/description -> `multiline`; status/type/stage -> `select` with `options`; labels/multiple choices -> `multi_select`; quantities/ratios/scores/durations -> `number`; money -> `amount`; cross-app link -> `relation`
|
|
63
|
+
- field types in drafts may use intuitive aliases: `multiline -> long_text`, `select -> single_select`, `multi_select -> multi_select`, `amount -> amount`, `phone -> phone`; readback returns canonical types and that is not a schema mismatch
|
|
52
64
|
- primary icon syntax is `icon + color`, for example `icon: "table", color: "blue"`; `icon_name/icon_color`, `icon_config`, and `icon: {name, color}` are compatibility aliases only
|
|
53
|
-
-
|
|
54
|
-
- relation fields need a target plus `
|
|
65
|
+
- select-style field `options` may be strings or objects such as `{label, value}`; tools normalize to option labels
|
|
66
|
+
- relation fields need a target plus object selectors: same-batch `target_app_ref`, existing app `target_app_key`, `display_field: {"name": "..."}`, and `visible_fields: [{"name": "..."}]`
|
|
67
|
+
- do not impose an artificial one-relation-field-per-app limit; create the relation fields the business model needs, then rely on backend validation and readback
|
|
55
68
|
- do not create built-in system fields as form fields: `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, `流程标题`. They are platform-generated; only reference supported system fields where a tool explicitly says so, such as button `source_field: "数据ID"`
|
|
56
69
|
|
|
57
70
|
## Public Tools You Should Think In
|
|
@@ -87,10 +100,23 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
87
100
|
- `portal_apply` is the public write path
|
|
88
101
|
- in edit mode, omitting `sections` means “preserve existing layout and update base info only”
|
|
89
102
|
- supplying `sections` means full replace semantics for sections
|
|
103
|
+
- `patch_sections[]` is the preferred path for changing one existing portal block
|
|
104
|
+
- do not confuse form layout with portal layout: form layout uses field-name `rows`; portal layout uses component `position.pc.x/y/cols/rows`
|
|
105
|
+
- portal PC layout uses a 24-column grid; components with the same `y` must share the same `rows`, and their `cols` should sum to 24 unless the user explicitly wants blank space
|
|
106
|
+
- standard workbench heights: metric cards `rows=5`, BI charts `rows=7`, data views `rows=11`
|
|
107
|
+
- business-entry grid sections must include real `config.items[]`; do not submit an empty grid container
|
|
108
|
+
- build portals only after referenced apps, raw `view_key`s, and chart ids/keys are known by readback
|
|
109
|
+
- standard order is business entry -> metric cards -> BI charts -> concrete data views
|
|
110
|
+
- do not use platform default views such as `全部数据` / `我的数据` as the main portal views
|
|
111
|
+
- do not use `source_type: "filter"` as the normal automation path; portal filter is raw/unstable and not part of the unified filter DSL
|
|
90
112
|
- Chart work:
|
|
91
113
|
- `app_charts_apply` is the public write path for app-source QingBI report bodies/configs; it creates/updates reports with `dataSourceType=qingflow`
|
|
92
114
|
- dataset BI reports are not created or edited by `app_charts_apply` yet; create them in QingBI first, then attach the existing report with `app_associated_resources_apply` and `report_source="dataset"`
|
|
93
115
|
- it does not attach the report to the Qingflow app associated-resource display; use `app_associated_resources_apply` for that
|
|
116
|
+
- use `app_get_fields.chart_fields` as the source for dimensions, metrics, and filters; normal record/form fields are not enough
|
|
117
|
+
- choose chart type by goal: `target/indicator` for one KPI, `bar/columnar/pie` for distribution, `line/area` for trend, `table/detail/summary` for tabular summaries, `dualaxes` for two-metric comparison
|
|
118
|
+
- use semantic metrics: `count(*)`, `sum(金额)`, `avg(工时)`, `group_by`, `where`; do not handwrite raw `indicator_field_ids`, `selectedMetrics`, or QingBI filter matrices on the main path
|
|
119
|
+
- do not use `summary` for a single metric card; use `target` / `indicator`
|
|
94
120
|
- supported `chart_type` values include legacy public aliases `target`, `table` and QingBI types such as `summary`, `columnar`, `area`, `stacked_area`, `funnel`, `waterfall`, `gauge`, `heatmap`, `histogram`, `treemap`, `radar`, `stacked_bar`, `stacked_column`, `scatter`, `ring`, `rose`, `dualaxes`, `map`, and `timeline`
|
|
95
121
|
- chart `filters` use the unified fixed-filter DSL: `field_name + operator + value/values`; the tool compiles them to QingBI string judge types
|
|
96
122
|
- for complete systems, submit `upsert_charts` in batches of 4-8. More than 8 upserts is blocked before write with `CHART_UPSERT_BATCH_TOO_LARGE`; execute `details.suggested_batch_payloads[]` one batch at a time.
|
|
@@ -98,13 +124,22 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
98
124
|
- `visibility` is a public capability and should be treated as a base-only permission update
|
|
99
125
|
- do not model chart visibility changes as raw config rewrites
|
|
100
126
|
- Button work:
|
|
101
|
-
-
|
|
127
|
+
- for normal view-specific business buttons, prefer `app_views_apply.upsert_views[].action_buttons` or `patch_views[].set.action_buttons`; design the view and its actions together
|
|
128
|
+
- use `app_custom_buttons_apply` for advanced button maintenance: style/icon changes, cross-view reuse, deleting button bodies, bulk reordering view bindings, or exact qRobot/wings configs
|
|
102
129
|
- use `patch_buttons` for changing a single existing button parameter such as URL, text, icon, style, or add-data mapping
|
|
130
|
+
- choose by user intent first: current record -> downstream record uses `add_data`; global independent entry uses `header`; URL/SOP/help uses `link`; approval/status transition/close task is workflow/task/automation, not a fake normal button
|
|
131
|
+
- action choice:
|
|
132
|
+
- current record -> downstream/child record: use `add_data` in view `action_buttons`, or `addData` in standalone buttons, with `target_app_key + field_mappings`
|
|
133
|
+
- global independent create: use `add_data`/`addData` on `header` without current-record `source_field`
|
|
134
|
+
- SOP/external/fixed page: use `link` with `url`
|
|
135
|
+
- existing automation only: use `qRobot`/`wings` only when the user provides exact config
|
|
136
|
+
- approval/status transition/close task is not a generic button action; model workflow/task action first, or use existing automation. Do not fake it with `link`
|
|
103
137
|
- for add-data buttons, use `trigger_add_data_config.target_app_key + field_mappings/default_values`; do not handwrite raw `que_relation`
|
|
104
138
|
- use `field_mappings` for dynamic current-record values, including system fields such as `数据ID` (`field_id=-17`) and `编号` (`field_id=0`)
|
|
105
139
|
- to prefill a target relation field with the current source record, map `{"source_field": "数据ID", "target_field": "目标引用字段"}`; use `default_values` only for static constants
|
|
106
140
|
- if field type compatibility is unclear, read [references/match-rules.md](references/match-rules.md)
|
|
107
|
-
-
|
|
141
|
+
- placement choice: `header` is global and has no current-row context; `list` is row/list action and maps to backend `INSIDE`; `detail` is the safest current-record context action. Do not use current-record `field_mappings` on `header`
|
|
142
|
+
- bind advanced standalone buttons to views through `view_configs[].buttons[]`; default to `placement`: `header` or `detail`
|
|
108
143
|
- builder `view_configs[].view_key` uses the raw key from `app_get.views[].view_key`, without a `custom:` prefix
|
|
109
144
|
- `buttons` is required in merge mode; do not send a view config with only `view_key`
|
|
110
145
|
- `view_configs[].mode` defaults to `merge`; use `mode: "replace"` or an explicit empty `buttons: []` to clear a view's custom button bindings
|
|
@@ -128,6 +163,7 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
128
163
|
- do not create platform default/system views named `全部数据`, `我的数据`, `我发起的`, `待办`, `已办`, or `抄送`; they are built in. New views must use business-specific names. To change a built-in view, patch by its existing raw `view_key`
|
|
129
164
|
- use `builder_tool_contract` whenever the minimal legal shape is unclear
|
|
130
165
|
- keep view `filters` and `query_conditions` separate: `filters` use `field_name + operator + value/values` and are fixed saved filters; `query_conditions` configure the frontend query panel fields and only take effect after users enter query values
|
|
166
|
+
- choose condition/matching surface by intent: fixed saved filters -> `filters`; frontend query panel -> `query_conditions.rows`; current-record associated report/view filtering -> `match_mappings`; current-record add-data prefill -> `field_mappings`; button visibility -> `visible_when` / `button_limit`
|
|
131
167
|
- keep relation/attachment/subtable/address/Q-Linker/code-block fields out of `query_conditions`; member/department fields may be used as query-panel fields when readback supports them. Use `filters` for fixed filters or associated-resource `match_mappings` for current-record related report/view matching
|
|
132
168
|
- new views default the associated report/view display area to visible with `limit_type="all"`; existing views preserve their current associated-resource display unless `associated_resources` is explicitly patched
|
|
133
169
|
- configure associated reports/views through `app_associated_resources_apply`, not through `app_views_apply`
|
|
@@ -149,14 +185,14 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
149
185
|
- fields -> `app_get_fields`
|
|
150
186
|
- layout -> `app_get_layout`
|
|
151
187
|
- views -> `app_get_views` only when the app_get compact list is not enough
|
|
152
|
-
- flow -> `app_get_flow`
|
|
188
|
+
- flow -> `app_get_flow` only when the task involves approval, fill/copy, reminders, process routing, task handling, or flow repair
|
|
153
189
|
- charts -> `app_get_charts` only when the app_get compact list is not enough
|
|
154
190
|
- portal -> `portal_get`
|
|
155
191
|
6. If the public shape is unclear, call `builder_tool_contract`
|
|
156
192
|
7. Apply the smallest patch tool that fits:
|
|
157
193
|
- fields -> `app_schema_apply`
|
|
158
194
|
- layout -> `app_layout_apply`
|
|
159
|
-
- flow -> `app_flow_apply`
|
|
195
|
+
- flow -> `app_flow_apply` only when workflow is requested or clearly required
|
|
160
196
|
- existing views -> `app_views_apply.patch_views`; new/full views -> `app_views_apply.upsert_views`
|
|
161
197
|
- existing buttons -> `app_custom_buttons_apply.patch_buttons`; new/full buttons -> `app_custom_buttons_apply.upsert_buttons`
|
|
162
198
|
- existing associated resources -> `app_associated_resources_apply.patch_resources`; new/full resources -> `app_associated_resources_apply.upsert_resources`
|
|
@@ -179,6 +215,7 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
179
215
|
- When creating or updating fields, configure the app data title/cover directly in field JSON: `as_data_title: true` is required on exactly one readable top-level title field; `as_data_cover: true` is optional and only valid on one top-level `attachment` field.
|
|
180
216
|
- Do not add platform system fields to `add_fields`; if the user asks for record id, number, applicant, creation/update time, or workflow status, use the built-in data/list/readback fields instead of creating duplicate controls.
|
|
181
217
|
- If the same validation error repeats twice, stop guessing and re-read `builder_tool_contract`.
|
|
218
|
+
- Do not create workflows just to make a build look complete. If no approval/fill/copy/reminder/process-routing requirement exists, report workflow as not requested/not configured.
|
|
182
219
|
- For workflow assignees, prefer `role_search` over explicit members unless the user explicitly wants named members.
|
|
183
220
|
- Public flow building is still intentionally limited to stable linear workflows. If a requirement sounds like branches/conditions, explain the limitation instead of freehanding unsupported graph shapes.
|
|
184
221
|
- Respect collaborative edit locks. Only use `app_release_edit_lock_if_mine` when the lock owner is the current authenticated user.
|
|
@@ -192,9 +229,17 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
192
229
|
- Use legacy fields such as `field_diff`, `views_diff`, `chart_results`, `created/updated/removed`, and `verification` only for compatibility and troubleshooting.
|
|
193
230
|
- Treat post-write readback as the source of truth, not just write status codes.
|
|
194
231
|
- `success` means write and verification completed; `partial_success` means the write landed or may have landed but verification is incomplete. If `write_executed=true`, `safe_to_retry=false`, or readback is unavailable, do `readback_before_retry` before any create retry.
|
|
232
|
+
- Final status rule:
|
|
233
|
+
- write result answers whether the write was attempted
|
|
234
|
+
- readback answers what actually exists
|
|
235
|
+
- publish/portal verification answers whether it is front-end visible
|
|
236
|
+
- validation/contract error with `write_executed=false` is a real failure and can be fixed/retried
|
|
237
|
+
- `partial_success`, timeout, post-write 40002/404, or readback unavailable is not enough to call the write failed; read back first and patch only proven gaps
|
|
195
238
|
- For portals, distinguish clearly between:
|
|
196
239
|
- base-info-only update with layout preserved
|
|
197
240
|
- full sections replace
|
|
241
|
+
- patching one section with `patch_sections[]`
|
|
242
|
+
- layout validity: same-row `rows`, same-row `cols` sum, and non-empty grid `items`
|
|
198
243
|
- For object apply tools, distinguish clearly between:
|
|
199
244
|
- `patch_*`: public partial parameter replacement; the tool hydrates current config and full-saves internally
|
|
200
245
|
- `upsert_*`: create or full target configuration; omitted fields may mean default/clear depending on that object
|
|
@@ -220,17 +265,17 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
220
265
|
- Add/update/remove fields: `app_schema_apply`
|
|
221
266
|
- Merge or replace layout: `app_layout_apply`
|
|
222
267
|
- Replace workflow: `app_flow_apply`
|
|
223
|
-
- Upsert/patch/remove views
|
|
224
|
-
-
|
|
268
|
+
- Upsert/patch/remove views, including ordinary view-specific `action_buttons`: `app_views_apply`
|
|
269
|
+
- Advanced custom button maintenance and cross-view binding: `app_custom_buttons_apply`
|
|
225
270
|
- Upsert/patch/remove app associated reports/views and per-view display: `app_associated_resources_apply`
|
|
226
271
|
- Upsert/patch/remove/reorder charts: `app_charts_apply`
|
|
227
272
|
- Create or update portal pages: `portal_apply`
|
|
228
273
|
- Release your own stale edit lock: `app_release_edit_lock_if_mine`
|
|
229
274
|
- Final publish verification: `app_publish_verify`
|
|
230
275
|
|
|
231
|
-
## Button Pattern
|
|
276
|
+
## Advanced Button Pattern
|
|
232
277
|
|
|
233
|
-
Use `app_custom_buttons_apply`
|
|
278
|
+
For ordinary view-specific buttons, prefer `app_views_apply` with `action_buttons`; see [references/update-views.md](references/update-views.md). Use `app_custom_buttons_apply` only when you need standalone/advanced maintenance: custom style or icon, cross-view reuse, deleting button bodies, bulk binding reorder, or exact qRobot/wings config.
|
|
234
279
|
|
|
235
280
|
```json
|
|
236
281
|
{
|
|
@@ -19,6 +19,7 @@ Required:
|
|
|
19
19
|
Strongly recommended:
|
|
20
20
|
|
|
21
21
|
- cross-app relation fields for the main business links
|
|
22
|
+
- 1-3 concrete business buttons on core operating views through `app_views_apply.action_buttons`
|
|
22
23
|
- core metric charts and BI charts using semantic `metric`, `metrics`, `group_by`, and `where`
|
|
23
24
|
- a standard portal: business entry area, core metrics, BI charts, then concrete data views
|
|
24
25
|
- portal grid/business-entry sections contain real `config.items[]`, not empty containers
|
|
@@ -39,18 +40,23 @@ Optional:
|
|
|
39
40
|
2. Draft all apps and relations with stable `client_key` values.
|
|
40
41
|
3. Run one multi-app `app_schema_apply` with `apps[]`.
|
|
41
42
|
4. If write result is uncertain, run readback before retrying.
|
|
42
|
-
5. For each app, apply layout
|
|
43
|
-
6.
|
|
44
|
-
7.
|
|
45
|
-
8.
|
|
46
|
-
9.
|
|
43
|
+
5. For each app, apply layout.
|
|
44
|
+
6. Apply workflow with `app_flow_apply` when the user asks for approval, fill, copy, reminders, or process routing.
|
|
45
|
+
7. Apply views; declare ordinary business buttons in `action_buttons` while designing the core operating views.
|
|
46
|
+
8. Create charts before portals when the portal needs metrics or BI sections. Submit chart upserts in batches of 4-8; if `CHART_UPSERT_BATCH_TOO_LARGE` appears, execute `details.suggested_batch_payloads[]` one at a time.
|
|
47
|
+
9. Add associated resources and advanced standalone buttons when they are part of the requested business process.
|
|
48
|
+
10. Create portal only after referenced apps, views, and charts are known.
|
|
49
|
+
11. Before the final response, write the complete-system delivery summary file described below.
|
|
47
50
|
|
|
48
51
|
## Field Modeling Rules
|
|
49
52
|
|
|
50
53
|
- Use agent-friendly field types in drafts: `text`, `multiline`, `select`, `multi_select`, `number`, `amount`, `date`, `datetime`, `member`, `department`, `attachment`, `relation`. The tool normalizes aliases such as `multiline -> long_text` and `select -> single_select`.
|
|
54
|
+
- Readback may show canonical field types such as `long_text` or `single_select`; do not rewrite fields just because aliases were normalized.
|
|
51
55
|
- Create only business fields. Do not create platform system fields listed in Required; reference them only where a tool explicitly supports system fields, such as button `source_field: "数据ID"`.
|
|
52
56
|
- Use `number` for ratios, completion rates, scores, percentages, durations, and quantities that may need decimals. Use `amount` only for currency/money semantics. This prevents sample data from producing decimal values for a field that the backend treats as integer money.
|
|
53
57
|
- For select fields, define the option set during schema design. Later sample data must use only those option labels or ids.
|
|
58
|
+
- Relation fields must include `target_app_ref` for same-batch apps or `target_app_key` for existing apps, plus `display_field: {"name": "..."}` and `visible_fields: [{"name": "..."}]`; do not write bare strings for display/visible field selectors.
|
|
59
|
+
- Do not impose a one-relation-field-per-app limit. Model the real business links and let backend validation/readback decide whether a specific relation is unsupported.
|
|
54
60
|
|
|
55
61
|
## View Query Rules
|
|
56
62
|
|
|
@@ -60,6 +66,29 @@ Optional:
|
|
|
60
66
|
- Do not put relation, attachment, subtable/subfield, address, Q-Linker, or code-block fields in `query_conditions`.
|
|
61
67
|
- For current-record related views/reports, use `app_associated_resources_apply.match_mappings`, not `query_conditions`.
|
|
62
68
|
|
|
69
|
+
## Chart Rules
|
|
70
|
+
|
|
71
|
+
- Read `app_get_fields.chart_fields` before chart apply; normal form fields are not enough for QingBI dimensions, metrics, or filters.
|
|
72
|
+
- Use semantic chart input first: `metric`, `metrics`, `group_by`, and `where`.
|
|
73
|
+
- One KPI card uses `target` / `indicator` with `metric: "count(*)"` or `metric: "sum(金额)"`.
|
|
74
|
+
- Grouped distribution uses `bar` / `columnar` / `pie` with `group_by + metric`.
|
|
75
|
+
- Trend uses `line` / `area` / `columnar` with a date/month `group_by`.
|
|
76
|
+
- Two-metric comparison uses `dualaxes` with `left_metric` and `right_metric`.
|
|
77
|
+
- Do not use `summary` for a single KPI; `summary` is for table-style grouped summaries.
|
|
78
|
+
- Do not handwrite raw `indicator_field_ids`, `selectedMetrics`, or QingBI filter matrices on the main path.
|
|
79
|
+
- For complete systems, submit new charts in batches of 4-8.
|
|
80
|
+
|
|
81
|
+
## Button Rules
|
|
82
|
+
|
|
83
|
+
- Design ordinary business buttons with the view: `app_views_apply.upsert_views[].action_buttons` or `patch_views[].set.action_buttons`.
|
|
84
|
+
- Use `app_custom_buttons_apply` only for style/icon changes, cross-view reuse, deleting button bodies, bulk binding reorder, or exact qRobot/wings configs.
|
|
85
|
+
- Use `add_data` when a current record creates a downstream/child record, such as order -> acceptance, work order -> inspection, or customer -> follow-up. Configure `target_app_key + field_mappings`; map `source_field: "数据ID"` to the target relation/reference field when linking back to the source record.
|
|
86
|
+
- Use `link` only for SOP, help, external system, or fixed URL navigation. Do not use `link` to fake approval, status transition, or data writeback.
|
|
87
|
+
- Use `qRobot`/`wings` only when the user provides exact existing automation config. Do not invent ids, parameters, or hidden automation.
|
|
88
|
+
- Prefer `detail` for current-record add-data actions, `list` for row actions, and `header` for global actions with no current-row context. Do not use current-record `field_mappings` on `header`.
|
|
89
|
+
- Approval, rejection, close-task, and status transition should be modeled as workflow/task behavior or existing automation; they are not generic custom-button types.
|
|
90
|
+
- Do not claim a complete operational system if all core operating views have no buttons and no reason is given.
|
|
91
|
+
|
|
63
92
|
## Delivery Summary File
|
|
64
93
|
|
|
65
94
|
For complete-system builds, create or update one local JSON file before the final response:
|
|
@@ -98,9 +127,21 @@ Rules:
|
|
|
98
127
|
- If a required resource is not verified, put it in `partial_items` or `needs_followup` instead of reporting the system as fully complete.
|
|
99
128
|
- If the user later adds a data-entry task, keep that separate from the system-build summary unless the user explicitly wants one combined report.
|
|
100
129
|
- The final response should match this file: completed resources, unverified items, frontend visibility, and follow-up needs must not contradict the JSON.
|
|
130
|
+
- `front_end_visible=true` only when the relevant portal/app publish or live readback proves it. Backend write success alone is not enough.
|
|
131
|
+
- Do not mark workflow as missing when the user did not ask for approval, fill, copy, reminders, or process routing. Report it as "not requested/not configured".
|
|
132
|
+
- If `partial_items` or `needs_followup` is non-empty, the final status is partial, not complete.
|
|
101
133
|
- When running from the CLI repo or a test harness, validate the file with:
|
|
102
134
|
`python scripts/validate_system_build_summary.py tmp/qingflow_system_build_summary.json`.
|
|
103
135
|
|
|
136
|
+
Final response shape:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
已完成:...
|
|
140
|
+
未验证/待确认:...
|
|
141
|
+
前端可见:是/否/未确认
|
|
142
|
+
需要继续修复:是/否;原因...
|
|
143
|
+
```
|
|
144
|
+
|
|
104
145
|
## Recovery Rules
|
|
105
146
|
|
|
106
147
|
- Timeout, `partial_success`, `write_executed=true`, `safe_to_retry=false`, or incomplete readback means `write_may_have_succeeded`.
|
|
@@ -115,9 +156,17 @@ Rules:
|
|
|
115
156
|
- Metrics: one row of 4-6 indicator/target cards with portal section `role: "metric"`; recommended height 5.
|
|
116
157
|
- BI charts: one row of 2-3 charts, 1-2 rows; recommended height 7.
|
|
117
158
|
- Data views: one row of 1-2 concrete views, 1-2 rows; recommended height 11.
|
|
159
|
+
- PC layout uses 24 columns. Components in the same row share the same `y`, must have the same `rows`, and their `cols` should sum to 24.
|
|
160
|
+
- Business-entry grid components must include real `config.items[]` entries linking to apps or portals; never submit an empty grid container.
|
|
161
|
+
- Build the portal only after referenced apps, raw `view_key`s, and chart ids/keys have been read back.
|
|
162
|
+
- Standard section order is business entry -> metric cards -> BI charts -> concrete business views.
|
|
163
|
+
- Do not reference platform default views such as `全部数据` / `我的数据` as main portal data views.
|
|
164
|
+
- Do not use portal `source_type: "filter"` as the normal automation path; it is raw/unstable and not part of the unified filter DSL.
|
|
118
165
|
|
|
119
166
|
## Stop Conditions
|
|
120
167
|
|
|
121
168
|
- If the user only asked for one app, switch to the single-app guide.
|
|
169
|
+
- If a same/similar package or app set already exists and the user did not say whether to extend, repair, replace, or create new, stop and ask. Do not start probing with new names.
|
|
170
|
+
- If readback shows part of the requested system already exists, list existing apps/fields/views/charts/portal, identify gaps, and patch only the missing or incorrect slices.
|
|
122
171
|
- If required package/app/field/relation readback contradicts the intended model, repair the specific missing slice before building dependent resources.
|
|
123
172
|
- If a public tool cannot express a needed business feature, state the gap and ask before using any fallback or submitting feedback.
|
|
@@ -47,6 +47,15 @@ If that multi-app call times out, returns `partial_success`, returns `write_exec
|
|
|
47
47
|
|
|
48
48
|
When designing fields, do not add platform system fields such as `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, or `流程标题`. Qingflow provides them automatically; create only business fields.
|
|
49
49
|
|
|
50
|
+
Field authoring rules:
|
|
51
|
+
|
|
52
|
+
- Use intuitive field types in drafts: `text`, `multiline`, `select`, `multi_select`, `number`, `amount`, `date`, `datetime`, `member`, `department`, `attachment`, `relation`.
|
|
53
|
+
- The tool normalizes aliases before writing: `multiline -> long_text`, `select -> single_select`, `checkbox -> multi_select`, `currency -> amount`, `mobile -> phone`. Readback may show canonical types; that is not a failed write.
|
|
54
|
+
- Every new app must have exactly one top-level `as_data_title: true` field. `as_data_cover: true` is optional and only valid on a top-level `attachment`.
|
|
55
|
+
- Select fields must define `options` during schema design. Options may be strings or objects such as `{"label": "进行中"}`; sample data must use those labels or ids.
|
|
56
|
+
- Relation fields must use `target_app_ref` for same-batch apps or `target_app_key` for existing apps, plus object selectors: `display_field: {"name": "..."}` and `visible_fields: [{"name": "..."}]`. Do not write bare strings for display/visible field selectors.
|
|
57
|
+
- Do not impose a one-relation-field-per-app limit. Model the real business links and let backend validation/readback decide.
|
|
58
|
+
|
|
50
59
|
Create a new package only after the user confirms package creation:
|
|
51
60
|
|
|
52
61
|
```json
|
|
@@ -92,7 +101,7 @@ Apply schema for a new app:
|
|
|
92
101
|
{"name": "客户名称", "type": "text", "required": true},
|
|
93
102
|
{"name": "订单封面", "type": "attachment", "as_data_cover": true},
|
|
94
103
|
{"name": "订单金额", "type": "amount"},
|
|
95
|
-
{"name": "状态", "type": "
|
|
104
|
+
{"name": "状态", "type": "select", "options": [{"label": "草稿"}, {"label": "进行中"}, {"label": "已完成"}], "required": true}
|
|
96
105
|
],
|
|
97
106
|
"update_fields": [],
|
|
98
107
|
"remove_fields": []
|
|
@@ -33,18 +33,25 @@
|
|
|
33
33
|
- Use `app_associated_resources_apply` only when an existing BI report or view needs to appear in the Qingflow app associated-resource area or a specific view.
|
|
34
34
|
- `app_charts_apply` currently creates/updates app-source BI reports only (`dataSourceType=qingflow`); dataset BI reports can only be attached when they already exist.
|
|
35
35
|
- Creating a chart with `app_charts_apply` does not automatically show it in the Qingflow app UI; attach it separately if display is required.
|
|
36
|
+
- Main chart config should use semantic `metric`, `metrics`, `group_by`, and `where`; avoid raw `indicator_field_ids`, `selectedMetrics`, and QingBI filter matrices unless diagnosing or preserving existing raw config.
|
|
36
37
|
- `target` and `table` remain compatibility aliases for QingBI `indicator` and `detail`; use the real QingBI chart type when you need a specific type such as `summary`, `columnar`, `stacked_bar`, `scatter`, or `dualaxes`.
|
|
38
|
+
- Use `app_get_fields.chart_fields` as the source for dimensions, metrics, and filters. Record schema fields or normal form fields are not enough for chart apply.
|
|
39
|
+
- Use `target` / `indicator` for one metric card; do not use `summary` for a single KPI.
|
|
37
40
|
|
|
38
41
|
## Custom buttons
|
|
39
42
|
|
|
40
|
-
-
|
|
43
|
+
- For ordinary view-specific business buttons, use `app_views_apply` with `action_buttons`; do not use legacy `app_views_apply.buttons` unless you are maintaining an old full-replacement patch.
|
|
44
|
+
- Use `app_custom_buttons_apply` for advanced button creation/update/removal and view placement: custom style/icon, cross-view reuse, deleting button bodies, bulk binding reorder, or exact qRobot/wings configs.
|
|
41
45
|
- When changing one existing button parameter, use `patch_buttons` with `set/unset`. Do not send a partial `upsert_buttons` object and expect the backend to preserve hidden required fields.
|
|
46
|
+
- `addData` / `add_data` creates a related/downstream Qingflow record; use current-record `field_mappings` only on `detail` or `list`. `link` only opens a URL. `qRobot`/`wings` require user-provided exact config and must not be invented.
|
|
42
47
|
- For add-data buttons, prefer semantic `trigger_add_data_config.target_app_key`, `field_mappings`, and `default_values`.
|
|
43
48
|
- Do not handwrite raw `que_relation` unless you are preserving an existing backend config. If `field_mappings` and `que_relation` are mixed, the tool blocks the write.
|
|
44
49
|
- `field_mappings.source_field` can use source app fields and supported system fields such as `数据ID` (`field_id=-17`) and `编号` (`field_id=0`).
|
|
45
50
|
- To fill a target relation field with the current source record, map `{"source_field": "数据ID", "target_field": "目标引用字段"}`. Use `default_values` only for static constants.
|
|
51
|
+
- Do not put current-record `field_mappings` on a `header` button; `header` has no current row. Use `detail` or `list` for current-record add-data actions.
|
|
52
|
+
- Do not model approval, rejection, close-task, or status transition as a generic `link` button. Use workflow/task behavior, or `qRobot`/`wings` only when the user provides existing automation config.
|
|
46
53
|
- For field type compatibility, read `references/match-rules.md`.
|
|
47
|
-
-
|
|
54
|
+
- Use `header` for global actions with no current-row context, `detail` for safest current-record actions, and `list` for row/list actions.
|
|
48
55
|
- `view_configs[].buttons` is required in merge mode. Do not send a view config with only `view_key`; it is blocked to avoid no-op writes and accidental publish.
|
|
49
56
|
- Builder view configs use raw `view_key` from `app_get.views[].view_key`; do not prefix it with `custom:`. The `custom:<viewKey>` form is for record-data `view_id`.
|
|
50
57
|
- View button bindings merge by default. Use `view_configs[].mode="replace"` to replace the full set, or pass an explicit empty `buttons: []` when you intend to clear all custom button bindings for that view.
|
|
@@ -73,7 +80,14 @@
|
|
|
73
80
|
- The backend may still save a full payload. The MCP/CLI patch path is responsible for reading current config and preserving fields the user did not mention.
|
|
74
81
|
- Do not use `upsert_views`, `upsert_buttons`, `upsert_resources`, or `upsert_charts` for a tiny parameter replacement unless you are deliberately providing the full desired target config.
|
|
75
82
|
- `app_layout_apply(mode=merge)` is already a safe layout merge path; `mode=replace` is full layout replacement.
|
|
76
|
-
- `portal_apply` without `sections` is base-info-only. Supplying `sections` replaces the portal sections list.
|
|
83
|
+
- `portal_apply` without `sections` is base-info-only. Supplying `sections` replaces the portal sections list; use `patch_sections[]` for one-section updates.
|
|
84
|
+
- PC portal layout is 24-column. Group components by the same `y`: all components in that row must have the same `rows`, and their `cols` should sum to 24 unless the user explicitly wants blank space.
|
|
85
|
+
- Standard workbench heights: metric cards `rows=5`, BI charts `rows=7`, data views `rows=11`.
|
|
86
|
+
- Business-entry `grid` sections must include real `config.items[]`; an empty grid container is not a valid business entrance.
|
|
87
|
+
- Build portals only after referenced apps, raw `view_key`s, and chart ids/keys are known by readback. Intended names are not enough.
|
|
88
|
+
- Use standard order: business entry -> metric cards -> BI charts -> concrete data views.
|
|
89
|
+
- Do not use platform default views such as `全部数据` / `我的数据` as the main portal views.
|
|
90
|
+
- Do not use portal `source_type: "filter"` as the normal automation path; it is raw/unstable and not part of the unified filter DSL.
|
|
77
91
|
- `app_flow_apply` is intentionally replace-only for the public linear workflow graph.
|
|
78
92
|
|
|
79
93
|
## Workflow dependencies
|
|
@@ -17,8 +17,9 @@ Required:
|
|
|
17
17
|
Strongly recommended:
|
|
18
18
|
|
|
19
19
|
- saved filters and query panel fields for the main operating views
|
|
20
|
+
- 1-3 concrete business buttons on core operating views through `app_views_apply.action_buttons`, when the view has real actions
|
|
20
21
|
- simple charts when the app has status, amount, date, or owner fields worth tracking
|
|
21
|
-
- associated resources or buttons only when they support a concrete workflow
|
|
22
|
+
- associated resources or advanced standalone buttons only when they support a concrete workflow
|
|
22
23
|
|
|
23
24
|
Optional:
|
|
24
25
|
|
|
@@ -35,13 +36,18 @@ Workflow preflight:
|
|
|
35
36
|
2. Read current fields: `app_get_fields`.
|
|
36
37
|
3. Apply fields with `app_schema_apply`.
|
|
37
38
|
4. Apply layout with `app_layout_apply`.
|
|
38
|
-
5. Apply
|
|
39
|
-
6. Apply
|
|
40
|
-
7.
|
|
39
|
+
5. Apply workflow with `app_flow_apply` when the user asks for approval, fill, copy, reminders, or process routing.
|
|
40
|
+
6. Apply views with `app_views_apply` when list/table/card/gantt behavior is part of the request; declare ordinary business buttons in `action_buttons` while designing the view.
|
|
41
|
+
7. Apply charts/associated resources/advanced standalone buttons only if they are part of the app's actual workflow.
|
|
42
|
+
8. Use `app_publish_verify` only when explicit live verification is required.
|
|
41
43
|
|
|
42
44
|
## Field Rules
|
|
43
45
|
|
|
44
46
|
- Use agent-friendly field types where possible: `text`, `multiline`, `select`, `multi_select`, `number`, `amount`, `date`, `datetime`, `member`, `department`, `attachment`, `relation`.
|
|
47
|
+
- The tool normalizes aliases: `multiline -> long_text`, `select -> single_select`, `checkbox -> multi_select`. Readback may show canonical types; do not treat that as a failed write.
|
|
48
|
+
- Select fields must define `options` during schema design. Options may be strings or objects such as `{"label": "进行中"}`; later sample data should use those option labels or ids.
|
|
49
|
+
- Relation fields are for real cross-object links. If used, include `target_app_key` for an existing app or `target_app_ref` for a same-batch app, plus `display_field: {"name": "..."}` and `visible_fields: [{"name": "..."}]`.
|
|
50
|
+
- Do not impose a one-relation-field limit. Add the relation fields the business needs, then rely on backend validation and readback.
|
|
45
51
|
- Do not create `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, or `流程标题`.
|
|
46
52
|
- Do not create built-in default views such as `全部数据` or `我的数据`; Qingflow provides system views.
|
|
47
53
|
|
|
@@ -51,8 +57,31 @@ Workflow preflight:
|
|
|
51
57
|
- Put only query-panel fields in `query_conditions.rows`: text, long text, number, amount, date/datetime, select, member, department, phone, email, or boolean.
|
|
52
58
|
- Do not put relation, attachment, subtable/subfield, address, Q-Linker, or code-block fields in `query_conditions`; use fixed `filters` or associated-resource `match_mappings` instead.
|
|
53
59
|
|
|
60
|
+
## Chart Rules
|
|
61
|
+
|
|
62
|
+
- Read `app_get_fields.chart_fields` before chart apply; normal form fields are not enough for QingBI dimensions, metrics, or filters.
|
|
63
|
+
- Use semantic chart input first: `metric`, `metrics`, `group_by`, and `where`.
|
|
64
|
+
- One KPI card uses `target` / `indicator` with `metric: "count(*)"` or `metric: "sum(金额)"`.
|
|
65
|
+
- Grouped distribution uses `bar` / `columnar` / `pie` with `group_by + metric`.
|
|
66
|
+
- Trend uses `line` / `area` / `columnar` with a date/month `group_by`.
|
|
67
|
+
- Do not use `summary` for a single KPI; `summary` is for table-style grouped summaries.
|
|
68
|
+
- Do not handwrite raw `indicator_field_ids`, `selectedMetrics`, or QingBI filter matrices on the main path.
|
|
69
|
+
|
|
70
|
+
## Button Rules
|
|
71
|
+
|
|
72
|
+
- Use `action_buttons` for ordinary buttons tied to one view.
|
|
73
|
+
- Use `app_custom_buttons_apply` only for style/icon changes, cross-view reuse, deleting button bodies, bulk binding reorder, or exact qRobot/wings configs.
|
|
74
|
+
- Use `add_data` when a current record creates a downstream/child record; configure `target_app_key + field_mappings`, usually mapping `source_field: "数据ID"` to the target relation/reference field.
|
|
75
|
+
- Use `link` only for SOP, help, external system, or fixed URL navigation. Do not use it to fake approval, status transition, or data writeback.
|
|
76
|
+
- Use `qRobot`/`wings` only when the user provides exact existing automation config.
|
|
77
|
+
- Prefer `detail` for current-record add-data actions, `list` for row actions, and `header` for global actions with no current-row context. Do not use current-record `field_mappings` on `header`.
|
|
78
|
+
- Approval, rejection, close-task, and status transition should be workflow/task behavior or existing automation; they are not generic custom-button types.
|
|
79
|
+
|
|
54
80
|
## Stop Conditions
|
|
55
81
|
|
|
56
82
|
- If the task actually needs multiple business objects, stop and switch to the complete-system guide.
|
|
83
|
+
- If an existing app with the same or very similar name appears and the user did not explicitly say update, extend, or create new, stop and ask which target to use.
|
|
84
|
+
- If readback shows the requested app already has some resources, patch the verified gaps instead of recreating the app.
|
|
57
85
|
- If a write returns `partial_success`, `write_executed=true`, or `safe_to_retry=false`, read back before retrying.
|
|
58
86
|
- If the same validation error repeats twice, re-read `builder_tool_contract` instead of guessing.
|
|
87
|
+
- Do not create `V2`, `测试`, timestamp, or random-suffix apps to bypass duplicate names in a real business package.
|
|
@@ -25,6 +25,16 @@ Use this split consistently:
|
|
|
25
25
|
- Single app: `app_resolve/app_get` first, then app-scoped apply tools.
|
|
26
26
|
- Record/task/data operation: leave builder and use record/task skills.
|
|
27
27
|
|
|
28
|
+
Decision gate before writing:
|
|
29
|
+
|
|
30
|
+
| Evidence | Action |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| User gives an `app_key`, `view_key`, `chart_id`, `dash_key`, or exact `package_id` | Treat the task as an update to that existing target unless the user explicitly asks for a new one |
|
|
33
|
+
| User names several forms/modules or asks for a system/package | Use the complete-system path; do not compress them into one app |
|
|
34
|
+
| Same or very similar package/app already exists and the user did not say extend/replace/new | Stop and ask whether to extend existing, repair missing parts, or create a new target |
|
|
35
|
+
| Existing readback already contains part of the requested system | List verified existing resources, identify gaps, and patch only missing or incorrect slices |
|
|
36
|
+
| A write is uncertain: timeout, `partial_success`, `write_executed=true`, or `safe_to_retry=false` | Read back before retrying; do not create `V2`, `测试`, timestamp, or random-suffix resources |
|
|
37
|
+
|
|
28
38
|
## Resolve
|
|
29
39
|
|
|
30
40
|
- `package_get`: read one known package by `package_id`; it reads package `baseInfo` first and may warn `PACKAGE_DETAIL_READ_DEGRADED` when the richer detail endpoint needs package edit/add-app permission. Treat that warning as degraded detail, not as package-read failure.
|
|
@@ -52,11 +62,11 @@ These execute normalized patches. Some app apply tools publish by default and st
|
|
|
52
62
|
- `app_schema_apply`: create app shell or change fields
|
|
53
63
|
- `app_layout_apply`: merge or replace layout
|
|
54
64
|
- `app_flow_apply`: replace workflow
|
|
55
|
-
- `app_views_apply`: use `patch_views` for existing-view parameter replacement; use `upsert_views` for creation or full target config; remove views by key; new views default associated report/view display to visible with `limit_type="all"`
|
|
56
|
-
- `app_custom_buttons_apply`:
|
|
65
|
+
- `app_views_apply`: use `patch_views` for existing-view parameter replacement; use `upsert_views` for creation or full target config; remove views by key; for normal view-specific business buttons, declare `action_buttons` in the view object or `patch_views[].set`; new views default associated report/view display to visible with `limit_type="all"`
|
|
66
|
+
- `app_custom_buttons_apply`: advanced custom-button maintenance only: style/icon changes, cross-view reuse, deleting button bodies, bulk reordering bindings, or exact qRobot/wings configs. Use `patch_buttons` for existing-button parameter replacement; use `upsert_buttons` for creation or full target config; bind buttons to header/detail/list view positions; `placement=list` maps to the backend `INSIDE` row/list button position; merge-mode view configs require `buttons`; use `view_configs[].mode="replace"` or `buttons=[]` to clear a view's custom button bindings. For child-record creation linked to the current source record, map `source_field: "数据ID"` to the target relation field.
|
|
57
67
|
- `app_associated_resources_apply`: attach existing BI reports/views to the Qingflow app associated-resource pool and per-view display area; it does not create or edit QingBI report bodies/configs. Permission is split like the backend: resource pool writes use EditAppAuth, while `view_configs` uses the view config/DataManageAuth path. Use `patch_resources` for existing associated-resource parameter replacement; use `upsert_resources` for creation or full target config; `view_configs`, remove, and reorder may reference existing resources by internal `associated_item_id` or by `chart_id`/`chart_key`/`view_key`; use `match_mappings` with `target_field + operator + source_field/value` for associated view/report filters; publishes after successful writes; omit raw `sourceType`, and use `report_source="dataset"` only to attach an existing BI dataset report. Before `upsert_resources`, read `app_get.associated_resources` and reuse an existing matching `target_app_key + view_key/chart_key`; repeated upsert can create duplicates because `client_key` is only valid inside one apply call.
|
|
58
|
-
- `app_charts_apply`: create/edit/remove/reorder app-source QingBI report bodies/configs with `dataSourceType=qingflow`; it does not create/edit dataset BI reports and does not attach reports to Qingflow app associated-resource display. Use `filters` with `field_name + operator + value/values`; the tool compiles them to QingBI string judge types. Use `patch_charts` for existing-chart parameter replacement; use `upsert_charts` for creation or full target config;
|
|
59
|
-
- `portal_apply`: create or replace-update portal pages; use `dash_key` for update mode or `package_id + dash_name` for create mode; create mode only prechecks package add_app, matching backend portal creation; edit mode may omit `sections` for base-info-only updates; when sections are supplied they still use replace semantics
|
|
68
|
+
- `app_charts_apply`: create/edit/remove/reorder app-source QingBI report bodies/configs with `dataSourceType=qingflow`; it does not create/edit dataset BI reports and does not attach reports to Qingflow app associated-resource display. Use `app_get_fields.chart_fields` as the source for dimensions, metrics, and filters. Use semantic `metric`, `metrics`, `group_by`, and `where`: `target/indicator` for one KPI, `bar/columnar/pie` for distribution, `line/area` for trend, `table/detail/summary` for tabular summaries, and `dualaxes` for two-metric comparison. Do not use `summary` for a single metric card. Use `filters` with `field_name + operator + value/values`; the tool compiles them to QingBI string judge types. Use `patch_charts` for existing-chart parameter replacement; use `upsert_charts` for creation or full target config; avoid raw `indicator_field_ids`, `selectedMetrics`, and QingBI filter matrices on the main path; charts are immediate-live and do not publish; use `chart_id` when names are not unique; for complete systems, submit large chart sets in batches of 4-8 upserts. More than 8 upserts is blocked before write with `CHART_UPSERT_BATCH_TOO_LARGE`; execute `details.suggested_batch_payloads[]` one batch at a time.
|
|
69
|
+
- `portal_apply`: create or replace-update portal pages; use `dash_key` for update mode or `package_id + dash_name` for create mode; create mode only prechecks package add_app, matching backend portal creation; edit mode may omit `sections` for base-info-only updates; when sections are supplied they still use replace semantics. Build portals only after referenced apps, raw `view_key`s, and chart ids/keys are known. PC layout uses 24 columns: components with the same `y` must have the same `rows`, same-row `cols` should sum to 24, metric cards use `rows=5`, BI charts use `rows=7`, data views use `rows=11`, and business-entry grids must include real `config.items[]`. Use business entry -> metrics -> BI charts -> concrete data views; do not use platform default views or raw `source_type: "filter"` as the main path.
|
|
60
70
|
|
|
61
71
|
For object-level updates, the safe partial syntax is `patch_*` with the object's real selector field plus `set` and optional `unset`. `selector` is only a concept, not a literal key. Examples: `patch_views: [{"view_key": "VIEW_KEY", "set": {...}}]`, `patch_buttons: [{"button_id": 1001, "set": {...}}]`, `patch_resources: [{"associated_item_id": 123, "set": {...}}]`, `patch_charts: [{"chart_id": 456, "set": {...}}]`. The tool reads the current backend config, merges the patch, then submits the full backend payload internally. Do not send a partial `upsert_*` and expect missing required fields to be preserved.
|
|
62
72
|
|
|
@@ -80,12 +90,18 @@ For object-level updates, the safe partial syntax is `patch_*` with the object's
|
|
|
80
90
|
`builder_tool_contract -> app_get_fields -> app_get_flow -> role_search/member_search -> app_flow_apply -> app_get_flow`
|
|
81
91
|
- Add views:
|
|
82
92
|
`builder_tool_contract -> app_get_fields -> app_get_views -> app_views_apply.patch_views/upsert_views -> app_get_views`
|
|
93
|
+
- Add ordinary view buttons:
|
|
94
|
+
`app_get_views -> app_views_apply.patch_views/upsert_views with action_buttons -> app_get_views`
|
|
95
|
+
- Maintain advanced custom buttons:
|
|
96
|
+
`app_get -> app_custom_buttons_apply.patch_buttons/upsert_buttons + view_configs -> app_get_views`
|
|
83
97
|
- Add QingBI charts:
|
|
84
98
|
`builder_tool_contract -> app_get_fields -> app_get_charts -> app_charts_apply.patch_charts/upsert_charts -> app_get_charts`
|
|
85
99
|
- Show an existing QingBI chart inside a Qingflow app/view:
|
|
86
100
|
`app_get -> app_associated_resources_apply.upsert_resources/patch_resources + view_configs -> app_get`
|
|
87
101
|
- Create or update a portal:
|
|
88
102
|
`builder_tool_contract -> portal_get -> portal_apply -> portal_get`
|
|
103
|
+
- Patch one portal section:
|
|
104
|
+
`portal_get -> portal_apply.patch_sections[] -> portal_get`
|
|
89
105
|
|
|
90
106
|
## Avoid
|
|
91
107
|
|
|
@@ -12,6 +12,16 @@ Use this when the app already exists and the task is only about fields.
|
|
|
12
12
|
|
|
13
13
|
Do not add platform system fields as form controls: `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, `流程标题`. They are generated by Qingflow; use readback/list fields when you need them.
|
|
14
14
|
|
|
15
|
+
Field patch rules:
|
|
16
|
+
|
|
17
|
+
- Re-read fields first, then choose `add_fields`, `update_fields`, or `remove_fields`. If a field already exists, use `update_fields` instead of adding a duplicate.
|
|
18
|
+
- Drafts may use intuitive type aliases: `multiline -> long_text`, `select -> single_select`, `checkbox -> multi_select`, `currency -> amount`, `mobile -> phone`. Readback canonical types are normal and do not prove a failed update.
|
|
19
|
+
- `title` and `label` are accepted aliases for `name`, but the preferred public key is `name`.
|
|
20
|
+
- Keep exactly one top-level data title field after the patch. `as_data_cover` is optional and only valid on top-level `attachment`.
|
|
21
|
+
- Select fields must keep a clear `options` set. Sample data and filters should use those option labels or ids.
|
|
22
|
+
- Relation fields must use `target_app_key` for existing apps, or `target_app_ref` only in same-batch app creation. `display_field` and `visible_fields` are selector objects such as `{"name": "客户名称"}`, not bare strings.
|
|
23
|
+
- Do not impose a one-relation-field limit when updating schema; add the relation fields the business needs and rely on backend validation/readback.
|
|
24
|
+
|
|
15
25
|
Read current fields first:
|
|
16
26
|
|
|
17
27
|
```json
|
|
@@ -66,6 +76,7 @@ Treat it as uncertain write state. Read back with `app_get_fields` before retryi
|
|
|
66
76
|
|
|
67
77
|
- `title` and `label` are accepted aliases for `name`
|
|
68
78
|
- `textarea -> long_text`
|
|
79
|
+
- `multiline` / `multiline_text -> long_text`
|
|
69
80
|
- `currency -> amount`
|
|
70
81
|
- `mobile -> phone`
|
|
71
82
|
- `select/radio -> single_select`
|
|
@@ -38,6 +38,13 @@ Canonical rules before any example:
|
|
|
38
38
|
- If `app_get.views` or `app_get_views` shows duplicate view names, include `view_key` in `upsert_views[]` and update that exact target
|
|
39
39
|
- Builder view writes always use the raw `view_key` from `app_get.views[].view_key`, such as `emsrao25rs02`. Do not pass `custom:emsrao25rs02`; that prefixed form is only for record-data `view_id`.
|
|
40
40
|
- For an existing view, prefer `patch_views` for parameter replacement. Do not send a partial `upsert_views` object such as only `name/type/query_conditions`; backend view saves require other type-specific fields, and the patch path preserves them for you.
|
|
41
|
+
- For ordinary view-specific business buttons, declare `action_buttons` inside `upsert_views[]` or `patch_views[].set`. Use `app_custom_buttons_apply` only for style/icon changes, cross-view reuse, deleting button bodies, bulk binding reorder, or exact qRobot/wings configs.
|
|
42
|
+
- Choose the button by user intent before choosing a trigger type:
|
|
43
|
+
- current record -> downstream/related record: `add_data` with `target_app_key + field_mappings`
|
|
44
|
+
- global independent entry: `add_data` on `header` without current-record `source_field`
|
|
45
|
+
- URL/SOP/help page: `link` with `url`
|
|
46
|
+
- approval/status transition/close task: do not fake it with a normal button; use workflow/task action or exact existing automation config
|
|
47
|
+
- Button placement choice: `header` is global and has no current-row context; `list` is row/list action; `detail` is the safest current-record context action. Do not use current-record `field_mappings` on `header`.
|
|
41
48
|
|
|
42
49
|
Apply a business table view:
|
|
43
50
|
|
|
@@ -62,6 +69,48 @@ Apply a business table view:
|
|
|
62
69
|
```
|
|
63
70
|
After `app_views_apply` returns canonical arguments or blocking issues, prefer reusing its `suggested_next_call.arguments` directly. Do not rewrite aliases back into non-canonical keys such as `column_names`.
|
|
64
71
|
|
|
72
|
+
Create a table view with ordinary business buttons:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"tool_name": "app_views_apply",
|
|
77
|
+
"arguments": {
|
|
78
|
+
"profile": "default",
|
|
79
|
+
"app_key": "APP_123",
|
|
80
|
+
"publish": true,
|
|
81
|
+
"upsert_views": [
|
|
82
|
+
{
|
|
83
|
+
"name": "工单执行视图",
|
|
84
|
+
"type": "table",
|
|
85
|
+
"columns": ["工单编号", "产品", "状态", "负责人"],
|
|
86
|
+
"action_buttons": [
|
|
87
|
+
{
|
|
88
|
+
"text": "创建质检单",
|
|
89
|
+
"action": "add_data",
|
|
90
|
+
"target_app_key": "QUALITY_APP",
|
|
91
|
+
"field_mappings": [
|
|
92
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
93
|
+
],
|
|
94
|
+
"default_values": {"处理状态": "待处理"},
|
|
95
|
+
"placement": "detail",
|
|
96
|
+
"visible_when": [
|
|
97
|
+
{"field_name": "状态", "operator": "eq", "value": "已完工"}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"text": "查看作业说明",
|
|
102
|
+
"action": "link",
|
|
103
|
+
"url": "https://example.com/sop",
|
|
104
|
+
"placement": "header"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"remove_views": []
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
65
114
|
Existing table view: replace only frontend query conditions:
|
|
66
115
|
|
|
67
116
|
```json
|