@josephyan/qingflow-cli 1.1.4 → 1.1.6
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 +7 -3
- package/docs/local-agent-install.md +57 -6
- package/entry_point.py +1 -1
- package/npm/bin/qingflow-skills.mjs +5 -0
- package/npm/bin/qingflow.mjs +1 -34
- package/npm/lib/runtime.mjs +21 -101
- package/npm/scripts/postinstall.mjs +1 -10
- package/package.json +3 -2
- package/pyproject.toml +1 -1
- package/skills/qingflow-cli/SKILL.md +58 -44
- package/skills/qingflow-cli/manifest.yaml +1 -1
- package/skills/qingflow-cli/reference/00-INDEX.md +35 -0
- package/skills/qingflow-cli/reference/builder/10-build-single-app.md +38 -0
- package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +39 -0
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_SCHEMA_APPLY_FIELD_TYPES_AND_SCENARIOS.md → builder/30-schema-fields.md} +52 -10
- package/skills/qingflow-cli/reference/builder/40-layout.md +52 -0
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md → builder/50-views.md} +39 -15
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_BUILDER_CHARTS_WORKFLOW.md → builder/60-charts.md} +36 -13
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_BUILDER_PORTAL_WORKFLOW.md → builder/70-portal.md} +36 -13
- package/skills/qingflow-cli/reference/builder/80-buttons-associated-resources.md +41 -0
- package/skills/qingflow-cli/reference/builder/90-workflow.md +34 -0
- package/skills/qingflow-cli/reference/builder/99-publish-verify.md +46 -0
- package/skills/qingflow-cli/reference/builder/README.md +41 -0
- package/skills/qingflow-cli/reference/builder/code-integrations/README.md +130 -0
- package/skills/qingflow-cli/reference/builder/code-integrations/code-block.md +66 -0
- package/skills/qingflow-cli/reference/builder/code-integrations/q-linker.md +77 -0
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_BUILDER_APP_DELIVERY_WORKFLOW.md → builder/reference/app-delivery-sop.md} +26 -16
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/README.md +293 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/build-complete-system.md +809 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/build-single-app.md +830 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/complete-system-development-guide.md +123 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/create-app.md +182 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/environments.md +63 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/flow-actors-and-permissions.md +142 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/gotchas.md +108 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/match-rules.md +114 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/public-surface-sync.md +75 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/single-app-development-guide.md +58 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/solution-playbooks.md +52 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/tool-selection.md +107 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/update-flow.md +7 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/update-layout.md +7 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/update-schema.md +7 -0
- package/skills/qingflow-cli/reference/builder/reference/legacy-playbooks/update-views.md +7 -0
- package/skills/qingflow-cli/reference/builder/workflow/01-overview.md +45 -0
- package/skills/qingflow-cli/reference/builder/workflow/02-update-mode.md +53 -0
- package/skills/qingflow-cli/reference/builder/workflow/03-flow-patterns.md +57 -0
- package/skills/qingflow-cli/reference/builder/workflow/04-stage1-business-modeling.md +131 -0
- package/skills/qingflow-cli/reference/builder/workflow/05-stage2-members-roles.md +29 -0
- package/skills/qingflow-cli/reference/builder/workflow/06-stage3-build-spec.md +165 -0
- package/skills/qingflow-cli/reference/builder/workflow/07-stage4-validate-spec.md +33 -0
- package/skills/qingflow-cli/reference/builder/workflow/08-stage5-apply-verify.md +51 -0
- package/skills/qingflow-cli/reference/builder/workflow/09-stage6-summary.md +88 -0
- package/skills/qingflow-cli/reference/builder/workflow/10-node-config-reference.md +93 -0
- package/skills/qingflow-cli/reference/builder/workflow/11-troubleshooting.md +15 -0
- package/skills/qingflow-cli/reference/builder/workflow/README.md +88 -0
- package/skills/qingflow-cli/reference/builder/workflow/workflow-schema.json +1754 -0
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_ADMIN_CHEATSHEET.md → core/QINGFLOW_CLI_ADMIN_CHEATSHEET.md} +3 -3
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md → core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md} +6 -6
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_EXPLORATION_REPORT.md → core/QINGFLOW_CLI_EXPLORATION_REPORT.md} +2 -2
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_FIELD_DATA_TYPES.md → core/QINGFLOW_CLI_FIELD_DATA_TYPES.md} +11 -11
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_MEMBER_CHEATSHEET.md → core/QINGFLOW_CLI_MEMBER_CHEATSHEET.md} +4 -4
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md → core/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md} +4 -4
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md → record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md} +3 -3
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_DELETE_WORKFLOW.md +31 -0
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md → record/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md} +4 -4
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md → record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md} +7 -7
- package/skills/qingflow-cli/reference/record/analysis/README.md +130 -0
- package/skills/qingflow-cli/reference/record/analysis/analysis-gotchas.md +91 -0
- package/skills/qingflow-cli/reference/record/analysis/analysis-patterns.md +112 -0
- package/skills/qingflow-cli/reference/record/analysis/business-context.md +74 -0
- package/skills/qingflow-cli/reference/record/analysis/confidence-reporting.md +69 -0
- package/skills/qingflow-cli/reference/record/analysis/data-access-playbook.md +106 -0
- package/skills/qingflow-cli/reference/record/analysis/pandas-recipes.md +172 -0
- package/skills/qingflow-cli/reference/record/analysis/report-format.md +76 -0
- package/skills/qingflow-cli/reference/record/insert/README.md +75 -0
- package/skills/qingflow-cli/reference/{QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md → task/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md} +5 -5
- package/skills/qingflow-cli/reference/task/ops/README.md +131 -0
- package/skills/qingflow-cli/reference/task/ops/environments.md +43 -0
- package/skills/qingflow-cli/reference/task/ops/workflow-usage.md +26 -0
- package/skills/qingflow-cli/scripts/validate_system_build_summary.py +124 -0
- package/skills/qingflow-cli/scripts/workflow/diff_flow_spec.py +275 -0
- package/skills/qingflow-cli/scripts/workflow/validate_flow_spec.py +605 -0
- package/skills/qingflow-mcp-setup/SKILL.md +115 -0
- package/skills/qingflow-mcp-setup/agents/openai.yaml +4 -0
- package/skills/qingflow-mcp-setup/references/claude-desktop.md +34 -0
- package/skills/qingflow-mcp-setup/references/environments.md +62 -0
- package/skills/qingflow-mcp-setup/references/generic-stdio.md +32 -0
- package/skills/qingflow-mcp-setup/scripts/check_local_server.sh +38 -0
- package/src/qingflow_mcp/__init__.py +1 -1
- package/src/qingflow_mcp/__main__.py +6 -2
- package/src/qingflow_mcp/builder_facade/models.py +282 -102
- package/src/qingflow_mcp/builder_facade/service.py +4192 -935
- package/src/qingflow_mcp/cli/commands/builder.py +316 -298
- package/src/qingflow_mcp/cli/commands/chart.py +1 -1
- package/src/qingflow_mcp/cli/commands/common.py +12 -3
- package/src/qingflow_mcp/cli/commands/exports.py +2 -2
- package/src/qingflow_mcp/cli/commands/imports.py +3 -3
- package/src/qingflow_mcp/cli/commands/portal.py +2 -2
- package/src/qingflow_mcp/cli/commands/record.py +101 -27
- package/src/qingflow_mcp/cli/commands/task.py +28 -47
- package/src/qingflow_mcp/cli/commands/view.py +1 -1
- package/src/qingflow_mcp/cli/context.py +0 -3
- package/src/qingflow_mcp/cli/formatters.py +784 -16
- package/src/qingflow_mcp/cli/main.py +117 -33
- package/src/qingflow_mcp/errors.py +43 -2
- package/src/qingflow_mcp/public_surface.py +26 -17
- package/src/qingflow_mcp/response_trim.py +81 -17
- package/src/qingflow_mcp/server.py +14 -12
- package/src/qingflow_mcp/server_app_builder.py +65 -21
- package/src/qingflow_mcp/server_app_user.py +22 -16
- package/src/qingflow_mcp/session_store.py +11 -7
- package/src/qingflow_mcp/solution/compiler/__init__.py +3 -1
- package/src/qingflow_mcp/solution/compiler/workflow_compiler.py +173 -0
- package/src/qingflow_mcp/solution/executor.py +245 -18
- package/src/qingflow_mcp/tools/ai_builder_tools.py +1780 -406
- package/src/qingflow_mcp/tools/app_tools.py +184 -43
- package/src/qingflow_mcp/tools/approval_tools.py +197 -35
- package/src/qingflow_mcp/tools/auth_tools.py +92 -16
- package/src/qingflow_mcp/tools/code_block_tools.py +298 -40
- package/src/qingflow_mcp/tools/custom_button_tools.py +64 -10
- package/src/qingflow_mcp/tools/directory_tools.py +236 -72
- package/src/qingflow_mcp/tools/export_tools.py +244 -34
- package/src/qingflow_mcp/tools/feedback_tools.py +9 -0
- package/src/qingflow_mcp/tools/file_tools.py +9 -3
- package/src/qingflow_mcp/tools/import_tools.py +336 -49
- package/src/qingflow_mcp/tools/navigation_tools.py +91 -12
- package/src/qingflow_mcp/tools/package_tools.py +118 -6
- package/src/qingflow_mcp/tools/portal_tools.py +39 -3
- package/src/qingflow_mcp/tools/qingbi_report_tools.py +116 -7
- package/src/qingflow_mcp/tools/record_tools.py +1141 -356
- package/src/qingflow_mcp/tools/resource_read_tools.py +188 -39
- package/src/qingflow_mcp/tools/role_tools.py +80 -9
- package/src/qingflow_mcp/tools/solution_tools.py +59 -45
- package/src/qingflow_mcp/tools/task_context_tools.py +662 -158
- package/src/qingflow_mcp/tools/task_tools.py +113 -29
- package/src/qingflow_mcp/tools/view_tools.py +106 -3
- package/src/qingflow_mcp/tools/workflow_tools.py +48 -4
- package/src/qingflow_mcp/tools/workspace_tools.py +71 -3
- /package/skills/qingflow-cli/reference/{QINGFLOW_CLI_BUILDER_MATCH_RULES.md → builder/reference/match-rules.md} +0 -0
- /package/skills/qingflow-cli/reference/{QINGFLOW_CLI_BUILDER_WORKSPACE_ICONS.md → builder/reference/workspace-icons.md} +0 -0
- /package/skills/qingflow-cli/reference/{charts_remove.example.json → examples/charts/charts_remove.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{charts_reorder.example.json → examples/charts/charts_reorder.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{charts_upsert_bar.example.json → examples/charts/charts_upsert_bar.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{charts_upsert_dashboard_starter.example.json → examples/charts/charts_upsert_dashboard_starter.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{charts_upsert_minimal.example.json → examples/charts/charts_upsert_minimal.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{portal_sections_all_types.example.json → examples/portal/portal_sections_all_types.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{portal_sections_five_types.example.json → examples/portal/portal_sections_five_types.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{portal_sections_standard_workbench.example.json → examples/portal/portal_sections_standard_workbench.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{_batch_schema_complex.json → examples/schema/_batch_schema_complex.json} +0 -0
- /package/skills/qingflow-cli/reference/{_batch_schema_scalar.json → examples/schema/_batch_schema_scalar.json} +0 -0
- /package/skills/qingflow-cli/reference/{schema_add_fields_minimal.example.json → examples/schema/schema_add_fields_minimal.example.json} +0 -0
- /package/skills/qingflow-cli/reference/{schema_apply_add_fields_all_types.json → examples/schema/schema_apply_add_fields_all_types.json} +0 -0
- /package/skills/qingflow-cli/reference/{views_upsert_table_minimal.example.json → examples/views/views_upsert_table_minimal.example.json} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Qingflow CLI 管理员命令速查表(Skill Reference)
|
|
2
2
|
|
|
3
3
|
> **适用**:`qingflow --json auth whoami` 中具备 **租户/工作区级管理、应用检索、导入、搭建配置** 等权限的账号(如 **超级管理员、应用管理员** 等,`permission_level` 以服务端为准)。
|
|
4
|
-
> **与普通成员对照**:权限较窄时请用 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)**;**主流程与落盘规则**以 **[SKILL.md](
|
|
4
|
+
> **与普通成员对照**:权限较窄时请用 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)**;**主流程与落盘规则**以 **[SKILL.md](../../SKILL.md)** 为准。需要 **全子命令「一次可复制」逐项模板**时可参阅同目录 **[QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md](./QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md)**(任选,默认执行技能不必打开)。
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
## 4. 记录数据
|
|
45
45
|
|
|
46
|
-
与 **[成员速查](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)** 及 **[SKILL.md](
|
|
46
|
+
与 **[成员速查](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)** 及 **[SKILL.md](../../SKILL.md)**「命令速查」一致:`record schema browse`、`record list`、`record access` **必须** `--view-id`。查询类遵守 **SKILL 落盘**:`record list`、`get`、`access`、`schema browse` 等。最终统计结论、分析报告、趋势/排名/比例/分布统一使用 **[record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`**。
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
## 8. 必败反例
|
|
89
89
|
|
|
90
|
-
与 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)** 常见踩雷、**[SKILL.md](
|
|
90
|
+
与 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)** 常见踩雷、**[SKILL.md](../../SKILL.md)**「命令速查」末段「必败形态」一致;**逐条 CLI 形态表**另见 **[QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md](./QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md)** §9:`record list` 缺 `view-id`、子命令错引号、builder 缺 query/keyword、`import status` 多 selector。
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Qingflow CLI:获取数据工作流(应用记录)
|
|
2
2
|
|
|
3
3
|
> **用途**:使用当前 CLI 会话,从「选定应用」到「读懂列含义 + 样本/模糊定位 / 单条详情」的**推荐闭环**;下表 **左列**可与常见 **编排/内部接口**命名对照,**右列**仅为本 CLI 命令。
|
|
4
|
-
> **新版口径**:`record_list` 不是批量分析入口,而是样本浏览和模糊定位入口;`record_get` 是前端详情页首屏上下文入口;全量日志用 `record logs`;分析取数统一转
|
|
5
|
-
> **关联**:权限、`view_id` 选取雷区、成员最短路径速查见 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)**;**字段 `kind` / 数据类型**见 **[QINGFLOW_CLI_FIELD_DATA_TYPES.md](./QINGFLOW_CLI_FIELD_DATA_TYPES.md)**;**新建记录**见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](
|
|
4
|
+
> **新版口径**:`record_list` 不是批量分析入口,而是样本浏览和模糊定位入口;`record_get` 是前端详情页首屏上下文入口;全量日志用 `record logs`;分析取数统一转 [record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`。
|
|
5
|
+
> **关联**:权限、`view_id` 选取雷区、成员最短路径速查见 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)**;**字段 `kind` / 数据类型**见 **[QINGFLOW_CLI_FIELD_DATA_TYPES.md](./QINGFLOW_CLI_FIELD_DATA_TYPES.md)**;**新建记录**见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](../record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md)**;**更新记录**见 **[QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md](../record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md)**;最终统计结论统一使用 **[record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`**;主技能规则见 **[../SKILL.md](../../SKILL.md)**。
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -30,10 +30,10 @@ app get(解析 accessible_views,选定 VIEW_ID)
|
|
|
30
30
|
→ (可选)record logs(需要完整审计日志时再拉全量日志 JSONL)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
- **仅当你只需要「快速确认有无数据」**时,可以省略 `schema browse`,直接 `app get` → `record list`(与成员速查表「最短路径」一致)。
|
|
34
|
-
- **当你需要稳定映射列名、写过滤条件或对接自动化**时,应按上表**显式**走 `schema browse`,避免对着 `list` 里中文列名猜字段定义。
|
|
33
|
+
- **仅当你只需要「快速确认有无数据」**时,可以省略 `schema browse`,直接 `app get` → `record list`(与成员速查表「最短路径」一致)。
|
|
34
|
+
- **当你需要稳定映射列名、写过滤条件或对接自动化**时,应按上表**显式**走 `schema browse`,避免对着 `list` 里中文列名猜字段定义。
|
|
35
35
|
- **当用户只给出模糊信息定位单条数据**时,走 `record schema browse` 确认可搜索字段,再用 `record list --query ... --query-field ...` 返回候选;只有候选明确后才 `record get`。
|
|
36
|
-
-
|
|
36
|
+
- **需要分组/聚合统计、最终统计结论、分析报告、趋势/排名/比例/分布**时,必须按 **[record/analysis](../record/analysis/README.md)** 执行 `app get -> record schema browse -> record access -> Python/pandas -> final answer`。
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
@@ -122,7 +122,7 @@ qingflow --json record logs \
|
|
|
122
122
|
|
|
123
123
|
## `view_id` 选取(成员侧必读摘要)
|
|
124
124
|
|
|
125
|
-
- **`system:all` 等业务系统视图**:实跑可用于 `schema browse` + `record list`(具体以租户配置为准)。显式传入的 `view_id` 必须按前端当前视图忠实执行;`system:all` 报 40002 / 40027 / 404 / 500 时,不要自动换成 `system:initiated`、`system:todo` 等其它系统视图,除非用户或前端 URL / `app get.accessible_views` 重新指定了那个视图。
|
|
125
|
+
- **`system:all` 等业务系统视图**:实跑可用于 `schema browse` + `record list`(具体以租户配置为准)。显式传入的 `view_id` 必须按前端当前视图忠实执行;`system:all` 报 40002 / 40027 / 404 / 500 时,不要自动换成 `system:initiated`、`system:todo` 等其它系统视图,除非用户或前端 URL / `app get.accessible_views` 重新指定了那个视图。
|
|
126
126
|
- **`CUSTOM_VIEW_LIST_UNAVAILABLE`**:只说明 `app get` 没能列出 custom view;若已有 `system:*` 可用,不要把它当作应用或记录读取失败。
|
|
127
127
|
- **`custom:` 后仅数字**(如 `custom:1`):成员侧常见 **`schema browse` / `list` / `access` 均 40038**,应**跳过**,改选 **`custom:` 带字母后缀**或其它可用视图(详见成员速查表「先有通路、再要有数据」)。
|
|
128
128
|
- **待办 / 已办 / 抄送「任务箱」**:不要用旧文档里的 `system:todo` 等视图充当任务中心;应使用 **`task list --task-box …`**(见主技能 **待办 SOP**)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Qingflow CLI 当前版本审计备忘
|
|
2
2
|
|
|
3
|
-
> 本文件只记录当前 CLI 与 skill 主路径容易混淆的事实。它不是执行 SOP;具体任务仍按 [SKILL.md](
|
|
3
|
+
> 本文件只记录当前 CLI 与 skill 主路径容易混淆的事实。它不是执行 SOP;具体任务仍按 [SKILL.md](../../SKILL.md) 与对应专题 reference 执行。CLI 升级后优先重新跑 `qingflow ... --help` 复核。
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
- `builder` 与 `build` 等价;默认写法仍推荐 `builder`。
|
|
11
11
|
- `record schema`:公开主路径为 `browse`、`insert`、`update`、`import`、`code-block`;`applicant` 仅为兼容保留入口,不作为推荐链路。
|
|
12
12
|
- `record` 公开执行入口:`list`、`access`、`get`、`logs`、`insert`、`update`、`delete`、`code-block-run`。
|
|
13
|
-
-
|
|
13
|
+
- 最终统计结论统一按 [record/analysis](../record/analysis/README.md) 走 `record access -> Python/pandas`,不要寻找或使用其它聚合捷径。
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Qingflow CLI:字段数据类型(Schema / 列表 / 写入)
|
|
2
2
|
|
|
3
3
|
> **用途**:说明 **`record schema …`** 的 **`fields[]`**、**`record list` / `record get` / `record access`** 行内值、以及 **insert/update 写入 payload** 的常见对应关系;并单独说明 **选项联动、关联记录、引用填充、公式/系统题、AI 与受限类型** 等在 CLI 下的表现与处置。
|
|
4
|
-
> **依据**:当前 CLI 在 **`--json`** 下会对 **schema** 响应做 **裁剪**:通常只保留本节列出的键;**`kind`** 由内部写入类别归并而来(见下表)。**`que_type` 等若未出现在输出中**,以 **`kind` + 实跑预检** 为准。
|
|
5
|
-
> **关联**:写入值细节与成员/部门见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](
|
|
4
|
+
> **依据**:当前 CLI 在 **`--json`** 下会对 **schema** 响应做 **裁剪**:通常只保留本节列出的键;**`kind`** 由内部写入类别归并而来(见下表)。**`que_type` 等若未出现在输出中**,以 **`kind` + 实跑预检** 为准。
|
|
5
|
+
> **关联**:写入值细节与成员/部门见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](../record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md)**;更新流程见 **[QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md](../record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md)**;只读见 **[QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](./QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md)**;**搭建侧** **`app_schema_apply` 的 `type`(与本文 `kind` 命名体系不同)**见 **[30-schema-fields.md](../builder/30-schema-fields.md)**;主技能 **[../SKILL.md](../../SKILL.md)**。
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
| **`department`** | `department_list` | 部门名或 id 形态 | 优先自然语言字符串,如 `"直销部"`;`needs_confirmation` 时按候选改显式对象/id |
|
|
37
37
|
| **`relation`** | `relation_record`(**§3.2**) | 常为关联展示字段或 `apply_id` 相关信息 | **`apply_id`**、可解析对象或自然语言;多匹配会返回 `needs_confirmation`,需选候选后重试 |
|
|
38
38
|
| **`attachment`** | `attachment_list` | URL、文件名或结构化附件对象 | **`{"value"或"url", "name"?}`**;常需 **`builder file upload-local` 先上传** |
|
|
39
|
-
| **`address`** | `address_parts`(**对外 `kind` 常被映射进 `scalar`**,以实跑为准) | 对象或分段地址 | **省/市/区/detail 对象** 或 **有序片段数组**(见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](
|
|
39
|
+
| **`address`** | `address_parts`(**对外 `kind` 常被映射进 `scalar`**,以实跑为准) | 对象或分段地址 | **省/市/区/detail 对象** 或 **有序片段数组**(见 **[QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](../record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md)**) |
|
|
40
40
|
| **`subtable`** | `subtable_rows` | **行数组**;行内键为子列 title | **行数组**;行内 **`title → 值`**;更新行可带 **`row_id`/`__row_id__`**(见实现) |
|
|
41
41
|
| **`unsupported`** | `unsupported_direct_write`(**§3.4、§3.5**) | 只读/仅流程内填写等 | **勿直接写入**;预检会 `UNSUPPORTED_WRITE` / 类似 blockers |
|
|
42
42
|
|
|
43
43
|
说明:
|
|
44
44
|
|
|
45
|
-
- **单选/多选**在对外 `kind` 上 **同是 `select`**;以 **`options` 是否存在 + 业务语义** 区分;多选写入用 **数组**。
|
|
46
|
-
- **`scalar`** 是 **桶类型**:文本、数字、金额、日期、布尔等在对外展示上常同为 `scalar`,**具体校验以后端与预检为准**。
|
|
45
|
+
- **单选/多选**在对外 `kind` 上 **同是 `select`**;以 **`options` 是否存在 + 业务语义** 区分;多选写入用 **数组**。
|
|
46
|
+
- **`scalar`** 是 **桶类型**:文本、数字、金额、日期、布尔等在对外展示上常同为 `scalar`,**具体校验以后端与预检为准**。
|
|
47
47
|
- **`field_id=0`** 等系统列可能为 **`system`+只读**;不要写入 insert/update payload(见创建文档「系统维护字段」)。
|
|
48
48
|
|
|
49
49
|
---
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
| **多选** | 内部题类型常为 **12、15**;对外仍为 **`kind=select`**(与单选 **同名 kind**) | **列表/详情**:常为 **字符串数组** 或可解析的多值结构。写入:传 **JSON 数组**(每个元素对应一个选项值) |
|
|
61
61
|
| **区分单多选** | 精简 schema **仅有 `kind`+`options`** | 以 **表单配置 / 同一 `title` 在别处的表现 / 写入预检** 为准;**唯一写入层面**的硬规则是:**多选必须按数组传** |
|
|
62
62
|
|
|
63
|
-
**选项联动(控制显隐、必填等)**
|
|
63
|
+
**选项联动(控制显隐、必填等)**
|
|
64
64
|
|
|
65
|
-
- 实现上来自 **题目关系 + 选项上的联动题 id**(如其它题因当前选项而被激活)。
|
|
66
|
-
- **`record schema browse` 的 `--json`**:精简 `fields[]` 可能不展示完整 `linkage` / 联动明细;新建记录以
|
|
65
|
+
- 实现上来自 **题目关系 + 选项上的联动题 id**(如其它题因当前选项而被激活)。
|
|
66
|
+
- **`record schema browse` 的 `--json`**:精简 `fields[]` 可能不展示完整 `linkage` / 联动明细;新建记录以 [record/insert](../record/insert/README.md) 的 `record schema insert` 为准,不要用兼容保留的 applicant schema 入口替代。
|
|
67
67
|
- **写入时**:若更新返回提示 **上游未选、联动未激活、字段尚未显示**,应 **先写或改 payload 里处于上游的选项(或其它驱动题)**,再写下游;必要时用 **`record schema update --record-id …`** 诊断当前记录下 **`required_fields` / `optional_fields` / `payload_template`**。
|
|
68
68
|
|
|
69
69
|
### 3.2 关联字段(关联记录)
|
|
@@ -119,9 +119,9 @@
|
|
|
119
119
|
## 5. 读者操作建议
|
|
120
120
|
|
|
121
121
|
1. **按场景取上下文**:只读/定位视图列用 `record schema browse --view-id …`;新建用 `record schema insert --app-key …`;更新用 `record get --record-id …` 先读当前记录详情,再用 `record update` 写入;`record schema update --record-id …` 只在失败、字段歧义或显式诊断时使用。
|
|
122
|
-
2. **数据分析**:最终统计结论、分析报告、趋势/排名/比例/分布必须走
|
|
123
|
-
3. **看 `kind` + `options` / `row_fields` / `target_app_key`**,并对照 **§3 特殊字段** 判断是否存在联动、引用或只读带出。
|
|
124
|
-
4. **选项联动 / 引用带出**:先写 **驱动题**,再写 **被带出的题**;只读带出列 **不要强写**。
|
|
122
|
+
2. **数据分析**:最终统计结论、分析报告、趋势/排名/比例/分布必须走 **[record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`**。
|
|
123
|
+
3. **看 `kind` + `options` / `row_fields` / `target_app_key`**,并对照 **§3 特殊字段** 判断是否存在联动、引用或只读带出。
|
|
124
|
+
4. **选项联动 / 引用带出**:先写 **驱动题**,再写 **被带出的题**;只读带出列 **不要强写**。
|
|
125
125
|
5. **写入前缩小 payload**;insert 默认用 `record insert --items-file`,单条也是 `items` 数组一行。根据 **`status` / `blockers` / `field_errors` / `failed_fields` / `created_record_ids`** 迭代(`--json` 在 stdout)。
|
|
126
126
|
|
|
127
127
|
---
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Qingflow CLI 普通成员命令速查表
|
|
2
2
|
|
|
3
3
|
> **适用对象**:当前会话为 **普通/基本成员**(`permission_level` 非租户/应用管理员、`import_capability` 常为无导入权等)。Wingent Momo runtime 下不要先跑 `auth whoami`;只有业务失败、账号不确定或排障时才核对身份。
|
|
4
|
-
> **与主技能关系**:请以 **[SKILL.md](
|
|
4
|
+
> **与主技能关系**:请以 **[SKILL.md](../../SKILL.md)**(本目录上一级)的规则与命令速查表为准。**本表**:成员侧最短读数与高概率通路;**租户/管理员向差异**请参阅同目录 **[QINGFLOW_CLI_ADMIN_CHEATSHEET.md](./QINGFLOW_CLI_ADMIN_CHEATSHEET.md)**。
|
|
5
5
|
> **可选补充**:同一目录 **[QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md](./QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md)** 收录 **全体角色通用**的子命令逐项模板(与本文分工:本文偏「成员能跑通的策略」,ONE_SHOT 偏「参数逐项闭合示例」)。
|
|
6
6
|
|
|
7
7
|
> **实证**:以下结论以会话内 `qingflow …` 为准;换账号/环境请以 `qingflow … -h` 与必要的身份核对结果为准。
|
|
8
8
|
|
|
9
9
|
**统一习惯**
|
|
10
10
|
|
|
11
|
-
- **只读拉取表单记录的最短链路**:见本节 **「最短路径:普通成员只读记录数据」**(可省略 `schema browse`)。**需先拉浏览视图表结构**时见 **[QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](./QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md)**;最终统计结论统一使用
|
|
11
|
+
- **只读拉取表单记录的最短链路**:见本节 **「最短路径:普通成员只读记录数据」**(可省略 `schema browse`)。**需先拉浏览视图表结构**时见 **[QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](./QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md)**;最终统计结论统一使用 **[record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`**;**字段 `kind` / 数据形态**见 **[QINGFLOW_CLI_FIELD_DATA_TYPES.md](./QINGFLOW_CLI_FIELD_DATA_TYPES.md)**;**新建记录默认批量 JSON 链路**见 **[record/insert](../record/insert/README.md)**(CLI 为 `record insert --items-file`,成员/部门/关联优先自然语言);**浏览视图下更新记录**见 **[QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md](../record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md)**。
|
|
12
12
|
- 避免无必要地先绕 `workspace`、`view get`。
|
|
13
13
|
- 加 `--json`,便于区分 **CONFIG_ERROR**(少参)与 **backend**(权限/业务)。
|
|
14
14
|
- `app get` / `portal list` 等业务体常在 `**{ "data": { ... } }`** 里:取 `accessible_views`、`items` 前先 unwrap `data`。
|
|
@@ -145,7 +145,7 @@ qingflow --json record list \
|
|
|
145
145
|
|
|
146
146
|
## 5. 扩展链路(含 workspace / schema)
|
|
147
147
|
|
|
148
|
-
若你还要 **核对当前工作区** 或 **先看 browse 字段**,在 **§「最短路径」** 之外可增加(顺序仍建议 **先最短再扩展**)。注意:最终统计结论、分析报告、趋势/排名/比例/分布必须使用
|
|
148
|
+
若你还要 **核对当前工作区** 或 **先看 browse 字段**,在 **§「最短路径」** 之外可增加(顺序仍建议 **先最短再扩展**)。注意:最终统计结论、分析报告、趋势/排名/比例/分布必须使用 [record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`:
|
|
149
149
|
|
|
150
150
|
```bash
|
|
151
151
|
qingflow --json auth whoami # 仅业务失败、账号不确定或需要写清当前租户上下文时
|
|
@@ -170,7 +170,7 @@ qingflow --json record list --app-key <APP_KEY> --view-id <VIEW_ID>
|
|
|
170
170
|
|
|
171
171
|
| 文档 | 用途 |
|
|
172
172
|
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
173
|
-
| [SKILL.md](
|
|
173
|
+
| [SKILL.md](../../SKILL.md) | **主文档**:认证、落盘规则、正文「命令速查」与高危操作节选。 |
|
|
174
174
|
| [QINGFLOW_CLI_ADMIN_CHEATSHEET.md](./QINGFLOW_CLI_ADMIN_CHEATSHEET.md) | **导入 / `builder role search` 等**管理向差异与成员侧失败对照。 |
|
|
175
175
|
| [QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md](./QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md) | 可选:全角色通用;各节「一次可复制」命令块与附录必败清单。 |
|
|
176
176
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **面向普通/基本成员账号时**:更易踩 **应用搜索/import/角色检索** 等权限类失败,请先读 **[QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./QINGFLOW_CLI_MEMBER_CHEATSHEET.md)**(策略与最短读数路径);**管理向差异**参阅 **[QINGFLOW_CLI_ADMIN_CHEATSHEET.md](./QINGFLOW_CLI_ADMIN_CHEATSHEET.md)**。
|
|
4
4
|
|
|
5
|
-
> **本文档目的**:按**场景**给出**形态正确、参数闭合**时的命令模板,便于复制后替换占位符即跑,减少「缺参 / 引号 / 根级选项」类返工。
|
|
5
|
+
> **本文档目的**:按**场景**给出**形态正确、参数闭合**时的命令模板,便于复制后替换占位符即跑,减少「缺参 / 引号 / 根级选项」类返工。
|
|
6
6
|
> **不是**「任何账号、任何租户、任何时刻都 100% HTTP 200」——若遇 `59004`(流币/AI 配额)、401、或目标资源不存在,仍可能失败;那种情况属于**环境与权限**,不是本表要解决的「命令写对一次成」问题。
|
|
7
7
|
|
|
8
8
|
**统一建议**
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
|
|
74
74
|
| 场景 | 一次成功写法 | 必填/注意 |
|
|
75
75
|
| ----------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
76
|
-
| Insert schema | `qingflow --json record schema insert --app-key <APP_KEY>` | 新建记录默认走
|
|
76
|
+
| Insert schema | `qingflow --json record schema insert --app-key <APP_KEY>` | 新建记录默认走 [record/insert](../record/insert/README.md);CLI 用 insert-ready schema + `record insert --items-file`。 |
|
|
77
77
|
| Import / code-block schema | `qingflow --json record schema import --app-key <APP_KEY>` / `qingflow --json record schema code-block --app-key <APP_KEY>` | 仅在导入或代码块任务明确需要时使用。 |
|
|
78
78
|
| Schema:browse(浏览态字段) | `qingflow --json record schema browse --app-key <APP_KEY> --view-id <VIEW_ID>` | **必须 `--view-id`**;不要用引号包住 `record schema browse` 整段。 |
|
|
79
79
|
| 列表/候选定位(运行时强校验) | `qingflow --json record list --app-key <APP_KEY> --view-id <VIEW_ID>` | **必须 `--view-id`**;默认最多返回 10 条,适合样本/模糊定位;可加 `--query` / `--query-field`。 |
|
|
80
|
-
| 分析取数 | `qingflow --json record access --app-key <APP_KEY> --view-id <VIEW_ID> --columns-file columns.json --where-file where.json` | 最终统计结论统一使用
|
|
80
|
+
| 分析取数 | `qingflow --json record access --app-key <APP_KEY> --view-id <VIEW_ID> --columns-file columns.json --where-file where.json` | 最终统计结论统一使用 [record/analysis](../record/analysis/README.md) 的 `record access -> Python/pandas`。 |
|
|
81
81
|
| 单条读取 | `qingflow --json record get --app-key <APP_KEY> --record-id <RECORD_ID>` | **必须** `--record-id`;返回前端详情页首屏上下文、引用、图片/文件资产。 |
|
|
82
82
|
| 全量记录日志 | `qingflow --json record logs --app-key <APP_KEY> --record-id <RECORD_ID> [--view-id <VIEW_ID>]` | 仅在需要完整审计/日志历史时使用;全量数据日志和流程日志写本地 JSONL。 |
|
|
83
83
|
|
|
@@ -156,4 +156,4 @@
|
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
|
|
159
|
-
*文档生成说明:与 **[../SKILL.md](
|
|
159
|
+
*文档生成说明:与 **[../SKILL.md](../../SKILL.md)**、[QINGFLOW_CLI_EXPLORATION_REPORT.md](./QINGFLOW_CLI_EXPLORATION_REPORT.md) 对齐;若 CLI 版本升级,请以 `qingflow … -h` 为准做小步修订。*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**创建记录详细规则见**:[record/insert/README.md](./insert/README.md)。
|
|
6
6
|
|
|
7
7
|
CLI 对应主路径:
|
|
8
8
|
|
|
@@ -11,9 +11,9 @@ qingflow --json record schema insert --app-key <APP_KEY> > tmp/qingflow_insert_s
|
|
|
11
11
|
qingflow --json record insert --app-key <APP_KEY> --items-file tmp/records.json > tmp/qingflow_insert_result.json
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
不要用 `record schema applicant` 代替 `
|
|
14
|
+
不要用 `record schema applicant` 代替 `record schema insert` 的主路径;新建记录需要 insert-ready schema 里的 `required_fields`、`optional_fields`、`payload_template`、`format_hint`、`expected_format`、`example_value` 和字段级 `options`。
|
|
15
15
|
|
|
16
|
-
成员、部门、关联记录、选项、附件等特殊字段按
|
|
16
|
+
成员、部门、关联记录、选项、附件等特殊字段按 [record/insert/README.md](./insert/README.md) 写:先读 insert schema;部门/成员不能自造候选;选项值必须来自 schema `options` 的文本或 id;关联记录批量写入优先 `record_id`,自然名称只在唯一匹配时使用;附件先上传再写返回值。
|
|
17
17
|
|
|
18
18
|
追加样例数据时也必须 schema-first:按 `required_fields` 补齐必填;按 `expected_format/example_value` 选择数值、金额、日期等格式;按 `options` 生成选项值。不要按业务常识自造“正常/已完成/高优先级”等 schema 里不存在的选项。比例、完成率、评分、百分比等字段也按 schema 示例写;如果字段被建成金额/整数类而不接受小数,不要强塞 decimal,改用符合 schema 的整数值,或回到 builder 阶段把字段建模为 `number`。
|
|
19
19
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Qingflow CLI:删除记录 SOP
|
|
2
|
+
|
|
3
|
+
删除记录是高风险写操作,默认先定位、再确认目标、再最小删除。
|
|
4
|
+
|
|
5
|
+
## 主链路
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
qingflow --json record list --app-key <APP_KEY> --view-id <VIEW_ID> --query "<关键词>"
|
|
9
|
+
qingflow --json record get --app-key <APP_KEY> --record-id <RECORD_ID> --view-id <VIEW_ID>
|
|
10
|
+
qingflow --json record delete --app-key <APP_KEY> --record-id <RECORD_ID> --view-id system:all
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
批量删除用文件传 record ids:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
qingflow --json record delete --app-key <APP_KEY> --record-ids-file tmp/delete_record_ids.json --view-id system:all
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`tmp/delete_record_ids.json` 是记录 ID 数组:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
["535734615263924225", "535734615263924226"]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 规则
|
|
26
|
+
|
|
27
|
+
1. 先用 `record list` 或 `record get` 解析精确 `record_id`,不要用模糊标题直接删。
|
|
28
|
+
2. 高风险或批量删除前,向用户确认记录数量、关键字段和应用名。
|
|
29
|
+
3. `record delete` 必须传可访问的系统 `--view-id system:*`;读取定位时可以使用 custom/system view,删除提交时不要传 `custom:*`、`list_type`,也不要省略系统视图上下文。
|
|
30
|
+
4. 删除后需要验证时,用 `record get` 或 `record list` 读回确认;读回 404/不存在才代表已删除,权限型 40002 只说明当前读回路径不可见。
|
|
31
|
+
5. 批量删除若出现部分成功,按返回的成功/失败项只处理失败 ID,不要重放全批。
|
|
@@ -111,8 +111,8 @@ qingflow --json import repair \
|
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
- **未加** `--authorized-file-modification` → **`IMPORT_REPAIR_NOT_AUTHORIZED`**。
|
|
114
|
-
- **`--repair`** 可重复;允许集合(实现 **`SAFE_REPAIRS`**):
|
|
115
|
-
**`normalize_headers`**、**`trim_trailing_blank_rows`**、**`normalize_enum_values`**、**`normalize_date_formats`**、**`normalize_number_formats`**、**`normalize_url_cells`**。
|
|
114
|
+
- **`--repair`** 可重复;允许集合(实现 **`SAFE_REPAIRS`**):
|
|
115
|
+
**`normalize_headers`**、**`trim_trailing_blank_rows`**、**`normalize_enum_values`**、**`normalize_date_formats`**、**`normalize_number_formats`**、**`normalize_url_cells`**。
|
|
116
116
|
**省略 `--repair`** 时实现默认对 **全集** 尝试。
|
|
117
117
|
- **仅 `.xlsx`**;**合并单元格表格** 在 **`normalize_headers`** 等路径上可能触发 **`MergedCell` 只读** 类异常(实跑曾遇到);此时应改模板或跳过 repair、重新导出模板再 **`verify`**。
|
|
118
118
|
|
|
@@ -172,5 +172,5 @@ qingflow --json import status --app-key "<APP_KEY>" \
|
|
|
172
172
|
|
|
173
173
|
## 7. 交叉引用
|
|
174
174
|
|
|
175
|
-
- 主技能 [SKILL.md](
|
|
176
|
-
- [QINGFLOW_CLI_ADMIN_CHEATSHEET.md](
|
|
175
|
+
- 主技能 [SKILL.md](../../SKILL.md):**落盘**、导入类权限码 **`IMPORT_*`** 提示。
|
|
176
|
+
- [QINGFLOW_CLI_ADMIN_CHEATSHEET.md](../core/QINGFLOW_CLI_ADMIN_CHEATSHEET.md):管理侧与 **`IMPORT_*`** 失败排查。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Qingflow CLI:更新记录工作流(详情后直接写入)
|
|
2
2
|
|
|
3
3
|
> **用途**:使用当前 CLI 会话读取目标记录详情后,用 **`record update`** 直接提交差异字段。主链路是 `record get -> record update`;字段范围不清、候选歧义或失败排查时,才追加 **`record schema update`**。
|
|
4
|
-
> **关联**:只读列表/详情见 **[QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](
|
|
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)**。
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -25,8 +25,8 @@ record get(得到 RECORD_ID、当前值、fields[].title/field_id/kind;已
|
|
|
25
25
|
→ record update --fields-file [--view-id](只提交需要改的题;大 JSON 落盘)
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
**何时先 `app get` / `record list`**:不知道 `view_id` 或 `record_id` 时,先用 `app get` 选视图,再用 `record list` 定位候选。已知 `record_id` 但已知前端/custom view 时,直接 `record get --view-id <VIEW_ID>`。
|
|
29
|
-
**何时追加 `record schema browse`**:只在需要提前看视图表头或搜索字段时使用;`record get` 已经会返回单条详情所需字段信息。
|
|
28
|
+
**何时先 `app get` / `record list`**:不知道 `view_id` 或 `record_id` 时,先用 `app get` 选视图,再用 `record list` 定位候选。已知 `record_id` 但已知前端/custom view 时,直接 `record get --view-id <VIEW_ID>`。
|
|
29
|
+
**何时追加 `record schema browse`**:只在需要提前看视图表头或搜索字段时使用;`record get` 已经会返回单条详情所需字段信息。
|
|
30
30
|
**何时追加 `record schema update`**:该命令 **必须 `record_id`**,返回 **`writable_fields` / `payload_template` / `available_update_routes` / `recommended_update_route`**,只用于排查「能改什么」和「会走哪条更新路径」。已知前端/custom view 时同样带 `--view-id`,让诊断优先探测同一个详情页上下文;字段明确时不要把它当必经步骤。
|
|
31
31
|
|
|
32
32
|
**更新路径自动选择**:`record update --view-id <VIEW_ID>` 会优先用这个 view 做字段解析和 custom view 写入候选;未传时自动探测可读 route。写入时仍会先尝试 **数据管理员直改**,若后端返回权限拒绝,再 fallback 到 **前端同源 custom view 详情编辑路径**;如果当前用户存在这条记录的唯一待办且目标字段在当前节点可编辑,最后会尝试 **workflow save-only**。成功时响应中的 **`update_route`** 是最终成功路径;失败时再查看失败原因与路线诊断。若诊断里有 `40002`,只代表某条 route 被拒绝,不一定表示用户对记录完全无编辑能力。
|
|
@@ -111,10 +111,10 @@ qingflow --json record schema update \
|
|
|
111
111
|
|
|
112
112
|
## 批量模式(`--items-file`)
|
|
113
113
|
|
|
114
|
-
- **不可**与 **`--record-id` / `--fields-file`** 同时使用。
|
|
114
|
+
- **不可**与 **`--record-id` / `--fields-file`** 同时使用。
|
|
115
115
|
- `items` 为 **数组**,每项为对象,至少包含:
|
|
116
116
|
- **`record_id`**:正整数(字符串或可解析数字均可,以 CLI 校验为准)
|
|
117
|
-
- **`fields`**:与单条相同的「标题 → 值」map
|
|
117
|
+
- **`fields`**:与单条相同的「标题 → 值」map
|
|
118
118
|
|
|
119
119
|
示例:
|
|
120
120
|
|
|
@@ -139,8 +139,8 @@ qingflow --json record schema update \
|
|
|
139
139
|
|
|
140
140
|
## 安全与落盘
|
|
141
141
|
|
|
142
|
-
- **`record update` 为写操作**;仅在授权环境、**必要时**对测试应用演练。
|
|
143
|
-
- **`list` / `get` / `schema browse` / `schema update` / 更新结果** 体大量时按主技能 **落盘规则** 重定向。
|
|
142
|
+
- **`record update` 为写操作**;仅在授权环境、**必要时**对测试应用演练。
|
|
143
|
+
- **`list` / `get` / `schema browse` / `schema update` / 更新结果** 体大量时按主技能 **落盘规则** 重定向。
|
|
144
144
|
- 主技能 **危险操作** 中对 `record update --dry-run`(批量)的说明仍适用。
|
|
145
145
|
|
|
146
146
|
---
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Qingflow CLI Record Analysis
|
|
2
|
+
|
|
3
|
+
Use this section for final statistical conclusions: counts, distributions, ratios, averages, rankings, trends, comparisons, and analysis reports.
|
|
4
|
+
|
|
5
|
+
Default path, every time:
|
|
6
|
+
|
|
7
|
+
```text
|
|
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
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
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:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
qingflow record access \
|
|
81
|
+
--app-key APP_KEY \
|
|
82
|
+
--view-id system:all \
|
|
83
|
+
--columns-file columns.json \
|
|
84
|
+
--where-file where.json \
|
|
85
|
+
--order-by-file order_by.json \
|
|
86
|
+
--json
|
|
87
|
+
```
|
|
88
|
+
|
|
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.
|
|
115
|
+
|
|
116
|
+
## References
|
|
117
|
+
|
|
118
|
+
Load only what is needed:
|
|
119
|
+
|
|
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)
|
|
127
|
+
|
|
128
|
+
## Feedback Escalation
|
|
129
|
+
|
|
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`.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Analysis Gotchas
|
|
2
|
+
|
|
3
|
+
## Do Not Skip Schema
|
|
4
|
+
|
|
5
|
+
Correct path:
|
|
6
|
+
|
|
7
|
+
1. `app_get`
|
|
8
|
+
2. `record_browse_schema_get`
|
|
9
|
+
3. `record_access`
|
|
10
|
+
4. Python
|
|
11
|
+
|
|
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
|
+
|
|
14
|
+
## Do Not Use Export For Analysis
|
|
15
|
+
|
|
16
|
+
Export tools are for user-requested files. Analysis uses `record_access` because it returns structured completeness and compact field metadata.
|
|
17
|
+
|
|
18
|
+
## Do Not Treat `record_list` As Full Data
|
|
19
|
+
|
|
20
|
+
`record_list` is sample/browse only. It can be capped and should not justify:
|
|
21
|
+
|
|
22
|
+
- average
|
|
23
|
+
- share
|
|
24
|
+
- ranking
|
|
25
|
+
- trend
|
|
26
|
+
- regional distribution
|
|
27
|
+
- "all data" insights
|
|
28
|
+
|
|
29
|
+
## Do Not Control Paging
|
|
30
|
+
|
|
31
|
+
`record_access` owns paging internally.
|
|
32
|
+
|
|
33
|
+
Do not invent:
|
|
34
|
+
|
|
35
|
+
- `page`
|
|
36
|
+
- `page_size`
|
|
37
|
+
- `limit`
|
|
38
|
+
- `requested_pages`
|
|
39
|
+
- `scan_max_pages`
|
|
40
|
+
- `max_rows`
|
|
41
|
+
- `timeout`
|
|
42
|
+
|
|
43
|
+
## Do Not Print Raw CSV
|
|
44
|
+
|
|
45
|
+
Read CSV files with pandas. Summarize computed results, not raw rows.
|
|
46
|
+
|
|
47
|
+
## Do Not Rename Source Files
|
|
48
|
+
|
|
49
|
+
CSV columns are directly readable and field-id anchored: `record_id`, `<字段标题>__field_<id>`. Use those columns directly in pandas.
|
|
50
|
+
|
|
51
|
+
## Do Not Trust Sparse Dimensions
|
|
52
|
+
|
|
53
|
+
Before final grouping, run a field-quality profile. If the selected field is mostly blank, say so and downgrade the claim.
|
|
54
|
+
|
|
55
|
+
Rules of thumb:
|
|
56
|
+
|
|
57
|
+
- Overall blank rate above 40%: not a primary conclusion dimension.
|
|
58
|
+
- Any compared period blank rate above 80%: do not use that field for period comparison.
|
|
59
|
+
- A sparse field can support only `已填写样本观察`.
|
|
60
|
+
|
|
61
|
+
If the user asks for a semantic field such as `板块`, test nearby candidates like product, platform, module, stage, source, owner, or department before concluding.
|
|
62
|
+
|
|
63
|
+
## Do Not Hide Incomplete Access
|
|
64
|
+
|
|
65
|
+
If `needs_scope`, no CSV exists. Ask for a time/business scope.
|
|
66
|
+
|
|
67
|
+
If `partial`, use only subset wording and avoid full-population claims.
|
|
68
|
+
|
|
69
|
+
If field meaning is ambiguous, ask the user to confirm from a short list.
|
|
70
|
+
|
|
71
|
+
## Do Not Guess Metrics
|
|
72
|
+
|
|
73
|
+
Before fetching data, decide whether the request needs count, sum, average, distinct count, ratio, ranking, trend, or comparison.
|
|
74
|
+
|
|
75
|
+
## Do Not Call A Ratio Without Denominator
|
|
76
|
+
|
|
77
|
+
For penetration, conversion, or share:
|
|
78
|
+
|
|
79
|
+
1. define numerator
|
|
80
|
+
2. define denominator
|
|
81
|
+
3. query compatible source data
|
|
82
|
+
4. compute in Python
|
|
83
|
+
5. report numerator and denominator
|
|
84
|
+
|
|
85
|
+
## Normalize Relative Dates
|
|
86
|
+
|
|
87
|
+
Convert relative phrases into exact ranges before `record_access`.
|
|
88
|
+
|
|
89
|
+
- `今年5月` -> exact May 1 to May 31 in the current year
|
|
90
|
+
- `去年同期` -> same date range in previous year
|
|
91
|
+
- `最近30天` -> exact rolling start/end dates
|