@qingflow-tech/qingflow-cli 1.1.50-beta.5 → 1.1.51
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 +4 -4
- package/npm/lib/runtime.mjs +13 -29
- package/package.json +1 -1
- package/pyproject.toml +2 -8
- package/skills/qingflow-cli/SKILL.md +322 -93
- package/skills/qingflow-cli/manifest.yaml +1 -1
- package/skills/qingflow-cli/reference/00-INDEX.md +4 -4
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_ADMIN_CHEATSHEET.md +1 -1
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +9 -3
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md +137 -3
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_EXPLORATION_REPORT.md +4 -6
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_FIELD_DATA_TYPES.md +14 -14
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_MEMBER_CHEATSHEET.md +19 -20
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md +14 -18
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md +12 -7
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md +1 -2
- package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +2 -3
- package/skills/qingflow-cli/reference/builder/30-schema-fields.md +5 -9
- package/skills/qingflow-cli/reference/builder/50-views.md +191 -192
- package/skills/qingflow-cli/reference/builder/80-buttons-associated-resources.md +0 -2
- package/skills/qingflow-cli/reference/builder/README.md +1 -1
- package/skills/qingflow-cli/reference/builder/reference/app-delivery-sop.md +6 -6
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_ADMIN_CHEATSHEET.md +1 -1
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md +95 -76
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_EXPLORATION_REPORT.md +4 -6
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_FIELD_DATA_TYPES.md +13 -13
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_MEMBER_CHEATSHEET.md +19 -20
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md +14 -18
- package/skills/qingflow-cli/reference/examples/README.md +1 -1
- package/skills/qingflow-cli/reference/examples/views/views_batch_full.example.json +159 -0
- package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json +36 -30
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md +1 -2
- package/skills/qingflow-cli/reference/record/analysis/README.md +113 -21
- package/skills/qingflow-cli/reference/record/analysis/analysis-gotchas.md +10 -10
- package/skills/qingflow-cli/reference/record/analysis/analysis-patterns.md +9 -9
- package/skills/qingflow-cli/reference/record/analysis/business-context.md +1 -1
- package/skills/qingflow-cli/reference/record/analysis/confidence-reporting.md +10 -10
- package/skills/qingflow-cli/reference/record/analysis/data-access-playbook.md +80 -52
- package/skills/qingflow-cli/reference/record/analysis/pandas-recipes.md +2 -2
- package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +42 -0
- package/skills/qingflow-common/SKILL.md +4 -7
- package/src/qingflow_mcp/__init__.py +1 -1
- package/src/qingflow_mcp/app_form_compat.py +0 -3
- package/src/qingflow_mcp/app_form_validator.py +17 -69
- package/src/qingflow_mcp/builder_facade/app_form.py +100 -497
- package/src/qingflow_mcp/builder_facade/models.py +17 -227
- package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +0 -1
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +30 -64
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +10 -6
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +10 -6
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +18 -11
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +10 -6
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +10 -6
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +10 -6
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +15 -46
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +27 -61
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +8 -4
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/formula.json +0 -43
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +12 -7
- package/src/qingflow_mcp/builder_facade/service.py +539 -1671
- package/src/qingflow_mcp/builder_facade/workflow_spec.py +1 -1
- package/src/qingflow_mcp/cli/commands/__init__.py +1 -2
- package/src/qingflow_mcp/cli/commands/builder.py +55 -76
- package/src/qingflow_mcp/cli/commands/record.py +1 -1
- package/src/qingflow_mcp/cli/context.py +0 -3
- package/src/qingflow_mcp/cli/formatters.py +1 -97
- package/src/qingflow_mcp/config.py +1 -0
- package/src/qingflow_mcp/public_surface.py +0 -8
- package/src/qingflow_mcp/response_trim.py +2 -11
- package/src/qingflow_mcp/server.py +0 -2
- package/src/qingflow_mcp/server_app_builder.py +10 -34
- package/src/qingflow_mcp/server_app_user.py +0 -4
- package/src/qingflow_mcp/solution/compiler/view_compiler.py +1 -2
- package/src/qingflow_mcp/solution/executor.py +8 -96
- package/src/qingflow_mcp/solution/spec_models.py +0 -1
- package/src/qingflow_mcp/tools/ai_builder_tools.py +398 -218
- package/src/qingflow_mcp/tools/base.py +42 -10
- package/src/qingflow_mcp/tools/record_tools.py +46 -11
- package/src/qingflow_mcp/tools/solution_tools.py +0 -2
- package/src/qingflow_mcp/tools/view_tools.py +6 -0
- package/skills/qingflow-cli/reference/data/README.md +0 -32
- package/skills/qingflow-cli/reference/examples/views/views_apply_v1alpha1.example.json +0 -14
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_SPECIALIZED_WORKFLOW.md +0 -50
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/rich_text.json +0 -146
- package/src/qingflow_mcp/builder_facade/schemas/views/manifest.json +0 -42
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/complete.json +0 -1245
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/button-config.json +0 -53
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/data-permission.json +0 -60
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/display.json +0 -73
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/operation-permission.json +0 -48
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/query-condition.json +0 -47
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/summary.json +0 -319
- package/src/qingflow_mcp/builder_facade/views_extract.py +0 -592
- package/src/qingflow_mcp/builder_facade/views_schema.py +0 -400
- package/src/qingflow_mcp/cli/commands/data.py +0 -134
- package/src/qingflow_mcp/tools/csv_export.py +0 -168
- package/src/qingflow_mcp/tools/data_tools.py +0 -284
- package/src/qingflow_mcp/tools/view_writer.py +0 -44
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"views": [
|
|
3
|
+
{
|
|
4
|
+
"operation": "upsert",
|
|
5
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
6
|
+
"name": "生产工单执行视图",
|
|
7
|
+
"type": "table",
|
|
8
|
+
"columns": ["工单编号", "产品", "工单状态", "负责人", "计划完成日期"],
|
|
9
|
+
"filters": [
|
|
10
|
+
{"field_name": "工单状态", "operator": "in", "values": ["待排产", "生产中"]},
|
|
11
|
+
{"field_name": "产品", "operator": "contains", "value": "标准"},
|
|
12
|
+
{"field_name": "计划完成日期", "operator": "lte", "value": "2026-07-31"}
|
|
13
|
+
],
|
|
14
|
+
"query_conditions": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"exact": false,
|
|
17
|
+
"hide_before_query": false,
|
|
18
|
+
"rows": [["工单编号", "工单状态"], ["负责人", "计划完成日期"]]
|
|
19
|
+
},
|
|
20
|
+
"visibility": {
|
|
21
|
+
"mode": "workspace",
|
|
22
|
+
"selectors": {},
|
|
23
|
+
"external_mode": "not",
|
|
24
|
+
"external_selectors": {}
|
|
25
|
+
},
|
|
26
|
+
"action_buttons": [
|
|
27
|
+
{
|
|
28
|
+
"client_key": "create_quality_from_list",
|
|
29
|
+
"text": "行内创建质检",
|
|
30
|
+
"action": "add_data",
|
|
31
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
32
|
+
"field_mappings": [
|
|
33
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
34
|
+
],
|
|
35
|
+
"default_values": {"处理状态": "待处理"},
|
|
36
|
+
"placement": "list",
|
|
37
|
+
"primary": true,
|
|
38
|
+
"style_preset": "primary_blue",
|
|
39
|
+
"visible_when": [
|
|
40
|
+
{"field_name": "工单状态", "operator": "eq", "value": "生产中"}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"client_key": "create_quality_from_detail",
|
|
45
|
+
"text": "详情创建质检",
|
|
46
|
+
"action": "add_data",
|
|
47
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
48
|
+
"field_mappings": [
|
|
49
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
50
|
+
],
|
|
51
|
+
"default_values": {"处理状态": "待处理"},
|
|
52
|
+
"placement": "detail",
|
|
53
|
+
"style_preset": "neutral_outline"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"client_key": "open_work_order_sop",
|
|
57
|
+
"text": "打开SOP",
|
|
58
|
+
"action": "link",
|
|
59
|
+
"url": "https://example.com/sop/work-order",
|
|
60
|
+
"placement": "header",
|
|
61
|
+
"style_preset": "text_blue"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"operation": "upsert",
|
|
67
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
68
|
+
"name": "工单状态看板",
|
|
69
|
+
"type": "board",
|
|
70
|
+
"columns": ["工单编号", "产品", "负责人", "计划完成日期"],
|
|
71
|
+
"group_by": "工单状态",
|
|
72
|
+
"filters": [
|
|
73
|
+
{"field_name": "工单状态", "operator": "not_empty"},
|
|
74
|
+
{"field_name": "关闭日期", "operator": "is_empty"}
|
|
75
|
+
],
|
|
76
|
+
"query_conditions": {
|
|
77
|
+
"enabled": true,
|
|
78
|
+
"rows": [["工单编号", "负责人"], ["计划完成日期"]]
|
|
79
|
+
},
|
|
80
|
+
"action_buttons": [
|
|
81
|
+
{
|
|
82
|
+
"text": "看板行内创建质检",
|
|
83
|
+
"action": "add_data",
|
|
84
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
85
|
+
"field_mappings": [
|
|
86
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
87
|
+
],
|
|
88
|
+
"placement": "list",
|
|
89
|
+
"visible_when": [
|
|
90
|
+
{"field_name": "工单状态", "operator": "eq", "value": "已完工"}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"text": "看板详情创建质检",
|
|
95
|
+
"action": "add_data",
|
|
96
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
97
|
+
"field_mappings": [
|
|
98
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
99
|
+
],
|
|
100
|
+
"placement": "detail"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"operation": "upsert",
|
|
106
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
107
|
+
"name": "工单计划甘特图",
|
|
108
|
+
"type": "gantt",
|
|
109
|
+
"columns": ["工单编号", "产品", "工单状态", "计划开始日期", "计划完成日期"],
|
|
110
|
+
"start_field": "计划开始日期",
|
|
111
|
+
"end_field": "计划完成日期",
|
|
112
|
+
"title_field": "工单编号",
|
|
113
|
+
"filters": [
|
|
114
|
+
{"field_name": "计划开始日期", "operator": "gte", "value": "2026-07-01"}
|
|
115
|
+
],
|
|
116
|
+
"query_conditions": {
|
|
117
|
+
"enabled": true,
|
|
118
|
+
"rows": [["工单编号", "工单状态"], ["计划开始日期", "计划完成日期"]]
|
|
119
|
+
},
|
|
120
|
+
"action_buttons": [
|
|
121
|
+
{
|
|
122
|
+
"text": "详情查看排产说明",
|
|
123
|
+
"action": "link",
|
|
124
|
+
"url": "https://example.com/sop/schedule",
|
|
125
|
+
"placement": "detail"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"operation": "patch",
|
|
131
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
132
|
+
"view_key": "RAW_VIEW_KEY_TO_PATCH",
|
|
133
|
+
"set": {
|
|
134
|
+
"columns": ["工单编号", "工单状态", "负责人"],
|
|
135
|
+
"filters": [
|
|
136
|
+
{"field_name": "工单状态", "operator": "neq", "value": "已关闭"}
|
|
137
|
+
],
|
|
138
|
+
"query_conditions": {
|
|
139
|
+
"enabled": true,
|
|
140
|
+
"rows": [["工单编号", "工单状态"], ["负责人"]]
|
|
141
|
+
},
|
|
142
|
+
"action_buttons": [
|
|
143
|
+
{
|
|
144
|
+
"text": "补充详情按钮",
|
|
145
|
+
"action": "link",
|
|
146
|
+
"url": "https://example.com/detail-help",
|
|
147
|
+
"placement": "detail"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"action_buttons_mode": "merge"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"operation": "remove",
|
|
155
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
156
|
+
"view_key": "RAW_VIEW_KEY_TO_REMOVE"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json
CHANGED
|
@@ -1,36 +1,42 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"type": "table",
|
|
4
|
-
"columns": [100, 101, 102, 103],
|
|
5
|
-
"filters": [
|
|
6
|
-
{"que_id": 100, "operator": "neq", "value": "已关闭"}
|
|
7
|
-
],
|
|
8
|
-
"query_conditions": {
|
|
9
|
-
"enabled": true,
|
|
10
|
-
"exact": false,
|
|
11
|
-
"hide_before_query": false,
|
|
12
|
-
"rows": [["主记录编号", "主记录名称"], ["状态", "负责人"]]
|
|
13
|
-
},
|
|
14
|
-
"action_buttons": [
|
|
2
|
+
"views": [
|
|
15
3
|
{
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
4
|
+
"operation": "upsert",
|
|
5
|
+
"app_key": "APP_KEY",
|
|
6
|
+
"name": "示例业务操作视图_CLI模板",
|
|
7
|
+
"type": "table",
|
|
8
|
+
"columns": ["主记录编号", "主记录名称", "状态", "负责人"],
|
|
9
|
+
"filters": [
|
|
10
|
+
{"field_name": "状态", "operator": "neq", "value": "已关闭"}
|
|
21
11
|
],
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
12
|
+
"query_conditions": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"exact": false,
|
|
15
|
+
"hide_before_query": false,
|
|
16
|
+
"rows": [["主记录编号", "主记录名称"], ["状态", "负责人"]]
|
|
17
|
+
},
|
|
18
|
+
"action_buttons": [
|
|
19
|
+
{
|
|
20
|
+
"text": "行内创建子记录",
|
|
21
|
+
"action": "add_data",
|
|
22
|
+
"target_app_key": "TARGET_APP_KEY",
|
|
23
|
+
"field_mappings": [
|
|
24
|
+
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
25
|
+
],
|
|
26
|
+
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
27
|
+
"placement": "list"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"text": "详情创建子记录",
|
|
31
|
+
"action": "add_data",
|
|
32
|
+
"target_app_key": "TARGET_APP_KEY",
|
|
33
|
+
"field_mappings": [
|
|
34
|
+
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
35
|
+
],
|
|
36
|
+
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
37
|
+
"placement": "detail"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
34
40
|
}
|
|
35
41
|
]
|
|
36
42
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Qingflow CLI:更新记录工作流(详情后直接写入)
|
|
2
2
|
|
|
3
|
-
> **兼容范围**:本文仅限用户明确要求旧 CLI `record` 兼容入口时使用。默认更新必须切换到 [data 操作说明](../data/README.md) 的 `data get` → `data update`;禁止在 data update 失败后自动回退本文链路。
|
|
4
3
|
> **用途**:使用当前 CLI 会话读取目标记录详情后,用 **`record update`** 直接提交差异字段。主链路是 `record get -> record update`;字段范围不清、候选歧义或失败排查时,才追加 **`record schema update`**。
|
|
5
|
-
>
|
|
4
|
+
> **关联**:只读列表/详情见 **[QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](../core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md)**;**字段 `kind` 与写入值总表**见 **[QINGFLOW_CLI_FIELD_DATA_TYPES.md](../core/QINGFLOW_CLI_FIELD_DATA_TYPES.md)**;最终统计结论统一使用 **[record/analysis](./analysis/README.md) 的 `record access -> Python/pandas`**;**成员 / 部门等** 的细颗粒写入见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](./QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md)**;主技能 **[../SKILL.md](../../SKILL.md)**。
|
|
6
5
|
|
|
7
6
|
---
|
|
8
7
|
|
|
@@ -1,38 +1,130 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Qingflow CLI Record Analysis
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this section for final statistical conclusions: counts, distributions, ratios, averages, rankings, trends, comparisons, and analysis reports.
|
|
4
|
+
|
|
5
|
+
Default path, every time:
|
|
4
6
|
|
|
5
7
|
```text
|
|
6
|
-
|
|
8
|
+
app get -> record schema browse(view_id=...) -> record access -> Python/pandas -> final answer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use the CLI entry:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
qingflow record --help
|
|
15
|
+
qingflow record access --help
|
|
16
|
+
qingflow record access --app-key APP_KEY --view-id VIEW_ID --columns-file columns.json --where-file where.json --order-by-file order_by.json --json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The CLI command is under the `record` command group, so the discovery path is: first inspect `qingflow record --help`, then inspect `qingflow record access --help`.
|
|
20
|
+
|
|
21
|
+
## Hard Rules
|
|
22
|
+
|
|
23
|
+
- Never start analysis from `record_list`, export, QingBI, or guessed field ids.
|
|
24
|
+
- Never conclude `record_access` is unavailable just because it is not visible as a top-level MCP tool; check the CLI path `qingflow record access`.
|
|
25
|
+
- Never call `record access` before `record schema browse`.
|
|
26
|
+
- Use only field ids returned by `record schema browse`.
|
|
27
|
+
- If `app_get.accessible_views[].analysis_supported=false`, do not use that view for `record_access`.
|
|
28
|
+
- Prefer an explicit time range or business filter. If the user gives none and the table may be large, ask for scope or use a clearly provided month/quarter/year.
|
|
29
|
+
- Read every CSV shard in `record_access.files[].local_path` with Python. Do not print raw CSV or load raw rows into model context.
|
|
30
|
+
- Before final analysis, run a field-quality profile in pandas: row count, null rate, distinct count, and period coverage for candidate grouping fields.
|
|
31
|
+
- Do not use a high-missing field as the main conclusion dimension. If a candidate dimension is sparse, downgrade it to an `已填写样本观察` and choose a cleaner semantic fallback when available.
|
|
32
|
+
- Full final conclusions require `record_access.complete=true` and `record_access.safe_for_final_conclusion=true`.
|
|
33
|
+
- `record_list` is only for sample inspection after the aggregate result is understood.
|
|
34
|
+
- `record_get` is only for single-record detail verification, logs, references, images, or readable attachments. Read images from `media_assets.items[].local_path`; read documents/tables from `file_assets.items[].local_path` and `extraction.text_path`.
|
|
35
|
+
- `record_export_direct` is only for explicit export/download/Excel requests.
|
|
36
|
+
- `chart_get` / QingBI is only for user-provided report URLs or chart ids.
|
|
37
|
+
|
|
38
|
+
## Tool Selection
|
|
39
|
+
|
|
40
|
+
| Need | Tool |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Batch analysis, statistics, comparison, report | `record access -> Python` |
|
|
43
|
+
| Browse a few example rows | `record_list` |
|
|
44
|
+
| Inspect one record, logs, references, images, attachments | `record_get` |
|
|
45
|
+
| User asks to export/download/Excel | `record_export_direct` |
|
|
46
|
+
| User gives report URL or chart id | `chart_get` |
|
|
47
|
+
| Todo/workflow task actions | `reference/task/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md` |
|
|
48
|
+
|
|
49
|
+
## Standard Procedure
|
|
50
|
+
|
|
51
|
+
1. Run `app get` and choose a table-style `view_id` from `accessible_views`.
|
|
52
|
+
2. Run `record schema browse --app-key APP_KEY --view-id VIEW_ID`.
|
|
53
|
+
3. Decide metric intent before fetching data: `count`, `sum`, `avg`, `distinct_count`, ratio, ranking, trend, or comparison.
|
|
54
|
+
4. Choose minimal `record_access.columns`, plus `where` and `order_by`.
|
|
55
|
+
5. Run `qingflow record access`.
|
|
56
|
+
6. Read all returned CSV files in Python; use `fields[]` only when field-id metadata is needed.
|
|
57
|
+
7. Run field-quality checks for all candidate dimensions.
|
|
58
|
+
8. Compute results in pandas.
|
|
59
|
+
9. Report numbers with scope, field choices, field-quality caveats, completeness, and business assumptions.
|
|
60
|
+
|
|
61
|
+
Use field-id DSLs only:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"app_key": "APP_KEY",
|
|
66
|
+
"view_id": "system:all",
|
|
67
|
+
"columns": [{ "field_id": 2 }, { "field_id": 18 }],
|
|
68
|
+
"where": [{ "field_id": 2, "op": "between", "value": ["2026-05-01", "2026-05-31"] }],
|
|
69
|
+
"order_by": [{ "field_id": 2, "direction": "asc" }]
|
|
70
|
+
}
|
|
7
71
|
```
|
|
8
72
|
|
|
9
|
-
|
|
73
|
+
Never pass `page`, `page_size`, `limit`, `max_rows`, `timeout`, or `profile` to `record_access`.
|
|
74
|
+
|
|
75
|
+
CSV columns are already readable and field-id anchored, for example `项目状态__field_343283094`. Do not expect separate `schema.json` or `README.md` files.
|
|
76
|
+
|
|
77
|
+
For CLI use, write JSON argument files instead of embedding large JSON in shell text:
|
|
10
78
|
|
|
11
79
|
```bash
|
|
12
|
-
qingflow
|
|
13
|
-
qingflow data query --help
|
|
14
|
-
qingflow --json data query \
|
|
80
|
+
qingflow record access \
|
|
15
81
|
--app-key APP_KEY \
|
|
82
|
+
--view-id system:all \
|
|
16
83
|
--columns-file columns.json \
|
|
17
84
|
--where-file where.json \
|
|
18
|
-
--
|
|
19
|
-
--
|
|
85
|
+
--order-by-file order_by.json \
|
|
86
|
+
--json
|
|
20
87
|
```
|
|
21
88
|
|
|
22
|
-
|
|
89
|
+
## Status Handling
|
|
90
|
+
|
|
91
|
+
Read `record_access.status` before reading files or writing conclusions.
|
|
92
|
+
|
|
93
|
+
- `status=success`, `complete=true`, `safe_for_final_conclusion=true`: full-scope answer is allowed.
|
|
94
|
+
- `status=needs_scope`: no CSV was written. Ask for a time/business range or retry with a user-provided period using `scope.suggested_time_fields`.
|
|
95
|
+
- `status=partial`: read returned files only as a subset. Do not give a full-population conclusion.
|
|
96
|
+
- `complete=false`, `truncated=true`, or `safe_for_final_conclusion=false`: answer as `初步观察` or ask for a narrower scope.
|
|
97
|
+
|
|
98
|
+
## Business Context
|
|
99
|
+
|
|
100
|
+
If the question mentions department, team, region, owner group, stage, product line, or a named business scope, check whether aliases or child scopes matter before concluding. Use explicit mappings provided by the user or local context; otherwise ask a short clarification.
|
|
101
|
+
|
|
102
|
+
Example: if `烈焰组` and `飓风组` are sub-departments of `北斗部门`, apply that mapping in Python and state it in the answer.
|
|
103
|
+
|
|
104
|
+
## Output Shape
|
|
105
|
+
|
|
106
|
+
Default to:
|
|
107
|
+
|
|
108
|
+
1. `结论`
|
|
109
|
+
2. `关键数据`
|
|
110
|
+
3. `口径与范围`
|
|
111
|
+
4. `可信度 / 限制`
|
|
112
|
+
|
|
113
|
+
Concrete numbers are mandatory. Ratios require both numerator and denominator. Trends require a time field and explicit date range. Rankings must come from a sorted pandas result.
|
|
114
|
+
If a requested dimension has poor quality, say so explicitly and provide the nearest reliable fallback dimension, for example platform or product instead of a mostly empty module field.
|
|
23
115
|
|
|
24
|
-
##
|
|
116
|
+
## References
|
|
25
117
|
|
|
26
|
-
|
|
27
|
-
- 用 Python/pandas 读取全部 `files[].local_path`,不要把原始 CSV 行打印到模型上下文。
|
|
28
|
-
- 完整总体结论必须同时满足 `complete=true`、`truncated=false`、`safe_for_final_conclusion=true`。
|
|
29
|
-
- `status=needs_scope` 时 `files` 为空;读取 `scope.reported_total` 与 `scope.row_threshold`,请求时间或业务范围后重试。
|
|
30
|
-
- `status=partial` 或任一完整性条件不满足时,只能给出局部观察,或收窄范围后重试。
|
|
31
|
-
- 最终分组前检查行数、空值率、唯一值数量与时间覆盖;高缺失维度只能作为“已填写样本观察”。
|
|
32
|
-
- `record list` 仅用于样本核查,不能代替全量 CSV;导出工具只用于用户明确要求下载文件的场景。
|
|
118
|
+
Load only what is needed:
|
|
33
119
|
|
|
34
|
-
|
|
120
|
+
- Data access status machine: [references/data-access-playbook.md](./data-access-playbook.md)
|
|
121
|
+
- Python/pandas templates: [references/pandas-recipes.md](./pandas-recipes.md)
|
|
122
|
+
- Analysis patterns: [references/analysis-patterns.md](./analysis-patterns.md)
|
|
123
|
+
- Business mappings and scope: [references/business-context.md](./business-context.md)
|
|
124
|
+
- Confidence and final wording: [references/confidence-reporting.md](./confidence-reporting.md)
|
|
125
|
+
- Common mistakes: [references/analysis-gotchas.md](./analysis-gotchas.md)
|
|
126
|
+
- Report templates: [references/report-format.md](./report-format.md)
|
|
35
127
|
|
|
36
|
-
|
|
128
|
+
## Feedback Escalation
|
|
37
129
|
|
|
38
|
-
|
|
130
|
+
If the desired analysis cannot be completed because of missing capability, unsupported data shape, or an awkward workflow after reasonable attempts, summarize the exact gap and ask whether to submit product feedback. Only after explicit user confirmation, call `feedback_submit`.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Analysis Gotchas
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Do Not Skip Schema
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Correct path:
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2. `
|
|
9
|
-
3.
|
|
10
|
-
4. Python
|
|
7
|
+
1. `app_get`
|
|
8
|
+
2. `record_browse_schema_get`
|
|
9
|
+
3. `record_access`
|
|
10
|
+
4. Python
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
`record_browse_schema_get` returns readable fields for the selected view. Missing fields are permission or view-scope boundaries, not invitations to guess hidden ids.
|
|
13
13
|
|
|
14
14
|
## Do Not Use Export For Analysis
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Export tools are for user-requested files. Analysis uses `record_access` because it returns structured completeness and compact field metadata.
|
|
17
17
|
|
|
18
18
|
## Do Not Treat `record_list` As Full Data
|
|
19
19
|
|
|
@@ -28,7 +28,7 @@ data 工具返回的 schema、字段错误与访问范围是事实源;缺失
|
|
|
28
28
|
|
|
29
29
|
## Do Not Control Paging
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`record_access` owns paging internally.
|
|
32
32
|
|
|
33
33
|
Do not invent:
|
|
34
34
|
|
|
@@ -84,7 +84,7 @@ For penetration, conversion, or share:
|
|
|
84
84
|
|
|
85
85
|
## Normalize Relative Dates
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
Convert relative phrases into exact ranges before `record_access`.
|
|
88
88
|
|
|
89
89
|
- `今年5月` -> exact May 1 to May 31 in the current year
|
|
90
90
|
- `去年同期` -> same date range in previous year
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Canonical Sequence
|
|
4
4
|
|
|
5
|
-
1.
|
|
6
|
-
2.
|
|
7
|
-
3.
|
|
8
|
-
4.
|
|
9
|
-
5. `
|
|
10
|
-
6. Python
|
|
5
|
+
1. `app_get`
|
|
6
|
+
2. `record_browse_schema_get`
|
|
7
|
+
3. decide metric intent
|
|
8
|
+
4. choose `record_access.columns / where / order_by`
|
|
9
|
+
5. `record_access`
|
|
10
|
+
6. Python over every returned CSV shard
|
|
11
11
|
7. optional `record_list` or `record_get` only for sample/detail verification
|
|
12
12
|
|
|
13
13
|
Metric intent must be one of:
|
|
@@ -74,7 +74,7 @@ If denominator is missing or scope differs, do not call the result a rate.
|
|
|
74
74
|
|
|
75
75
|
## Trend
|
|
76
76
|
|
|
77
|
-
1.
|
|
77
|
+
1. Choose a date/time field from `suggested_time_fields`.
|
|
78
78
|
2. Convert relative phrases into exact date ranges.
|
|
79
79
|
3. Fetch the date field and metrics.
|
|
80
80
|
4. Bucket in pandas by day/week/month/quarter/year.
|
|
@@ -104,8 +104,8 @@ Never use `record_list` alone for final averages, shares, rankings, trends, or d
|
|
|
104
104
|
|
|
105
105
|
If the exact field is unclear:
|
|
106
106
|
|
|
107
|
-
1.
|
|
108
|
-
2.
|
|
107
|
+
1. inspect `record_browse_schema_get.fields`
|
|
108
|
+
2. use titles and suggested fields
|
|
109
109
|
3. if one candidate is clearly dominant, proceed
|
|
110
110
|
4. otherwise ask the user to confirm
|
|
111
111
|
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
Use `全量可信结论` only when:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- `record_browse_schema_get` was used
|
|
8
|
+
- data came from `record_access`
|
|
9
9
|
- all returned CSV shards were read in Python
|
|
10
|
-
- `complete=true`
|
|
11
|
-
- `truncated=false`
|
|
12
|
-
- `safe_for_final_conclusion=true`
|
|
10
|
+
- `record_access.complete=true`
|
|
11
|
+
- `record_access.truncated=false`
|
|
12
|
+
- `record_access.safe_for_final_conclusion=true`
|
|
13
13
|
- metric definitions are complete
|
|
14
14
|
- denominator exists for every ratio
|
|
15
15
|
- time fields and date ranges are explicit
|
|
@@ -19,11 +19,11 @@ Use `全量可信结论` only when:
|
|
|
19
19
|
|
|
20
20
|
Use `初步观察` when:
|
|
21
21
|
|
|
22
|
-
- `status=needs_scope`
|
|
23
|
-
- `status=partial`
|
|
24
|
-
- `complete=false`
|
|
25
|
-
- `truncated=true`
|
|
26
|
-
- `safe_for_final_conclusion=false`
|
|
22
|
+
- `record_access.status=needs_scope`
|
|
23
|
+
- `record_access.status=partial`
|
|
24
|
+
- `record_access.complete=false`
|
|
25
|
+
- `record_access.truncated=true`
|
|
26
|
+
- `record_access.safe_for_final_conclusion=false`
|
|
27
27
|
- evidence came from `record_list`
|
|
28
28
|
- scope or saved view filter is unverified
|
|
29
29
|
|