@qingflow-tech/qingflow-cli 1.1.50 → 1.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
- package/pyproject.toml +8 -2
- package/skills/qingflow-cli/SKILL.md +115 -3
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +3 -9
- package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +3 -2
- package/skills/qingflow-cli/reference/builder/30-schema-fields.md +9 -5
- package/skills/qingflow-cli/reference/builder/50-views.md +192 -191
- package/skills/qingflow-cli/reference/builder/80-buttons-associated-resources.md +2 -0
- 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/data/README.md +1 -1
- package/skills/qingflow-cli/reference/examples/README.md +1 -1
- package/skills/qingflow-cli/reference/examples/views/views_apply_v1alpha1.example.json +14 -0
- package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json +30 -36
- package/src/qingflow_mcp/app_form_compat.py +3 -0
- package/src/qingflow_mcp/app_form_validator.py +69 -17
- package/src/qingflow_mcp/builder_facade/app_form.py +497 -100
- package/src/qingflow_mcp/builder_facade/models.py +227 -17
- package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +1 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +64 -30
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +6 -10
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +6 -10
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +11 -18
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +6 -10
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +6 -10
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +6 -10
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +46 -15
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/rich_text.json +146 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +61 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +4 -8
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/formula.json +43 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +7 -12
- package/src/qingflow_mcp/builder_facade/schemas/views/manifest.json +42 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/complete.json +1245 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/button-config.json +53 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/data-permission.json +60 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/display.json +73 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/operation-permission.json +48 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/query-condition.json +47 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/summary.json +319 -0
- package/src/qingflow_mcp/builder_facade/service.py +1666 -509
- package/src/qingflow_mcp/builder_facade/views_extract.py +592 -0
- package/src/qingflow_mcp/builder_facade/views_schema.py +400 -0
- package/src/qingflow_mcp/cli/commands/builder.py +76 -55
- package/src/qingflow_mcp/config.py +1 -0
- package/src/qingflow_mcp/public_surface.py +3 -0
- package/src/qingflow_mcp/response_trim.py +11 -2
- package/src/qingflow_mcp/server_app_builder.py +34 -10
- package/src/qingflow_mcp/solution/compiler/view_compiler.py +2 -1
- package/src/qingflow_mcp/solution/executor.py +96 -8
- package/src/qingflow_mcp/solution/spec_models.py +1 -0
- package/src/qingflow_mcp/tools/ai_builder_tools.py +218 -398
- package/src/qingflow_mcp/tools/base.py +42 -10
- package/src/qingflow_mcp/tools/solution_tools.py +2 -0
- package/src/qingflow_mcp/tools/view_tools.py +0 -6
- package/src/qingflow_mcp/tools/view_writer.py +44 -0
- package/skills/qingflow-cli/reference/examples/views/views_batch_full.example.json +0 -159
- package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +0 -42
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Qingflow CLI 是轻流面向开发者和 AI Agent 的命令行工具。它把轻
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @qingflow-tech/qingflow-cli@1.1.
|
|
10
|
+
npm install @qingflow-tech/qingflow-cli@1.1.53
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
推荐从官网复制这一条一键安装 Qingflow CLI:
|
|
@@ -21,7 +21,7 @@ npx qingflow-cli@latest install
|
|
|
21
21
|
## 运行
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npx -y -p @qingflow-tech/qingflow-cli@1.1.
|
|
24
|
+
npx -y -p @qingflow-tech/qingflow-cli@1.1.53 qingflow
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
全局安装后可以直接运行:
|
|
@@ -62,7 +62,7 @@ qingflow-skills install --agent codex --scope user
|
|
|
62
62
|
如果你通过一次性 `npx -p` 执行 skills 安装,建议加 `--copy`,避免 symlink 指向 npm 临时执行缓存:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
npx -y -p @qingflow-tech/qingflow-cli@1.1.
|
|
65
|
+
npx -y -p @qingflow-tech/qingflow-cli@1.1.53 qingflow-skills install --agent codex --scope user --copy
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
`qingflow-skills install` 默认使用 symlink,且遇到同名 skill 不会覆盖;只有显式传入 `--force` 才会替换。
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qingflow-mcp"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.53"
|
|
8
8
|
description = "User-authenticated MCP server for Qingflow"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -32,6 +32,7 @@ dependencies = [
|
|
|
32
32
|
"pycryptodome>=3.20,<4.0",
|
|
33
33
|
"pypdf>=5.0,<6.0",
|
|
34
34
|
"python-socketio[client]>=5.11,<6.0",
|
|
35
|
+
"referencing>=0.35,<1.0",
|
|
35
36
|
"redis>=5.0,<6.0",
|
|
36
37
|
"uvicorn>=0.30,<1.0",
|
|
37
38
|
]
|
|
@@ -40,6 +41,7 @@ dependencies = [
|
|
|
40
41
|
dev = [
|
|
41
42
|
"pytest>=8.3,<9.0",
|
|
42
43
|
"respx>=0.22,<1.0",
|
|
44
|
+
"pymysql>=1.2.2",
|
|
43
45
|
]
|
|
44
46
|
build = [
|
|
45
47
|
"pyinstaller>=6.0,<7.0",
|
|
@@ -63,7 +65,11 @@ Issues = "https://github.com/qingflow/qingflow-mcp/issues"
|
|
|
63
65
|
where = ["src"]
|
|
64
66
|
|
|
65
67
|
[tool.setuptools.package-data]
|
|
66
|
-
qingflow_mcp = [
|
|
68
|
+
qingflow_mcp = [
|
|
69
|
+
"py.typed",
|
|
70
|
+
"builder_facade/schemas/app_form/**/*.json",
|
|
71
|
+
"builder_facade/schemas/views/**/*.json",
|
|
72
|
+
]
|
|
67
73
|
|
|
68
74
|
[tool.pytest.ini_options]
|
|
69
75
|
testpaths = ["tests"]
|
|
@@ -3,14 +3,54 @@ name: qingflow-cli
|
|
|
3
3
|
description: |
|
|
4
4
|
【强制】在执行或编排任何 qingflow CLI 命令前必须优先加载本 Skill。
|
|
5
5
|
Qingflow CLI 主入口:规定命令执行与 JSON 落盘方式,并把普通应用数据默认路由到 data;task、builder、import、日志、附件和代码块按专项参考执行。
|
|
6
|
+
Qingflow CLI 包以本 Skill 作为 CLI 主入口;record/app-builder/task/workflow 等相关说明按场景组织在 reference 子目录。
|
|
7
|
+
指导安装、执行上下文失败恢复、查询与写入;规定 task/record/import/builder 查询落盘;覆盖普通成员读数、字段 kind 与数据形态、任务上下文、批量导入、record access/list/get/insert/update/delete 与管理端边界。
|
|
8
|
+
Builder SOP 按智能体任务路径组织:完整系统、单应用、AppForm、视图、报表、门户、关联资源、流程、发布校验;表单字段、分组、布局和应用设置统一使用 versioned AppForm;按钮随视图 action_buttons 声明;更新动作并入对应资源文档,批量读/批量写/局部改依各资源契约执行;视图 apply 每次仅处理一个视图的一种操作,不支持批量创建或混合操作;明细见「关联文件」表与文末命令索引。
|
|
6
9
|
---
|
|
7
10
|
|
|
8
11
|
# Qingflow CLI 使用技能
|
|
9
12
|
|
|
10
13
|
> **Skill 版本**:`qingflow-skills-2026.09.22.01`。CLI 实际版本与安装路径以 `qingflow --json version` 为准。
|
|
11
14
|
|
|
12
|
-
本 Skill 负责 CLI 入口、文件约定和业务分流。已知 `app_key` 时直接执行 `data query/get
|
|
13
|
-
|
|
15
|
+
本 Skill 负责 CLI 入口、文件约定和业务分流。已知 `app_key` 时直接执行 `data query/get`。只有应用名称时,先用 `qingflow --json app list --query "应用名称"` 查找当前工作区的可见应用,并核对返回项的 `app_name/title`;目标明确且唯一时取其 `app_key` 再查询,否则请用户确认。不要把应用名称直接传给 `--app-key`,也不要为定位名称转向 builder 或切换工作区。字段能力、权限范围与下一步动作以当前工具 schema、data 响应和 `hints` 为准。
|
|
16
|
+
|
|
17
|
+
## 关联文件
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
| 文件 | 说明 |
|
|
21
|
+
| ------------------------------------------------------------------------------------------------ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
22
|
+
| `manifest.yaml` | 技能清单 |
|
|
23
|
+
| [reference/00-INDEX.md](./reference/00-INDEX.md) | **总导航**:按用户目标选择 record / task / builder 文档;复杂任务先读 |
|
|
24
|
+
| [reference/QINGFLOW_CLI_MEMBER_CHEATSHEET.md](./reference/core/QINGFLOW_CLI_MEMBER_CHEATSHEET.md) | **普通成员**主线:最短路径、`view_id`、与管理命令的差异预期 |
|
|
25
|
+
| [reference/QINGFLOW_CLI_FIELD_DATA_TYPES.md](./reference/core/QINGFLOW_CLI_FIELD_DATA_TYPES.md) | **字段数据类型**:`record schema …` 的 `fields[]`(`field_id`、`title`、`kind`、`options`…);`record list/get/access` 与写入 payload 的形态对照 |
|
|
26
|
+
| [reference/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](./reference/core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md) | **应用记录获取数据**:`app get`(`accessible_views`)→ `record schema browse` → `record list(query)` 模糊定位 / `record get` 详情页首屏上下文 / `record logs` 全量日志;分析取数转 `record_access` |
|
|
27
|
+
| [reference/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md](./reference/task/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md) | **任务(待办已办)上下文 SOP**:`task list` → `task get` → `task log` → `task report` → `task action`;只把 `task_id` 作为主定位参数 |
|
|
28
|
+
| [reference/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md) | **批量导入 SOP**:`app_get`(**`import_capability`**)→ `record_import_template_get` → `record_import_verify` →(可选)`record_import_repair_local` → `record_import_start` → `record_import_status_get`;CLI `import` / `record schema import` |
|
|
29
|
+
| [reference/builder/README.md](./reference/builder/README.md) | **Builder 总导航**:完整系统、单应用、字段、布局、视图、报表、门户、按钮/关联资源、流程、发布校验 |
|
|
30
|
+
| [reference/builder/10-build-single-app.md](./reference/builder/10-build-single-app.md) | **单应用搭建主入口**:一个应用端到端交付顺序 |
|
|
31
|
+
| [reference/builder/20-build-complete-system.md](./reference/builder/20-build-complete-system.md) | **完整系统/应用包主入口**:多应用、跨应用 relation、门户闭环 |
|
|
32
|
+
| [reference/builder/30-schema-fields.md](./reference/builder/30-schema-fields.md) | **字段 / schema**:字段类型、直觉别名、数据标题/封面、schema 创建与更新 |
|
|
33
|
+
| [reference/builder/40-layout.md](./reference/builder/40-layout.md) | **布局维护**:仅用于已有应用的分组、`rows` 矩阵、布局修复;新建应用布局写在 `form` 内 |
|
|
34
|
+
| [reference/builder/50-views.md](./reference/builder/50-views.md) | **视图**:表格/卡片/看板/甘特、固定筛选、查询面板、视图 patch |
|
|
35
|
+
| [reference/builder/60-charts.md](./reference/builder/60-charts.md) | **报表 / QingBI**:指标卡、图表、语义聚合、筛选、排序、更新 |
|
|
36
|
+
| [reference/builder/70-portal.md](./reference/builder/70-portal.md) | **门户**:标准工作台、业务入口、指标、图表、视图组件、发布 |
|
|
37
|
+
| [reference/builder/80-buttons-associated-resources.md](./reference/builder/80-buttons-associated-resources.md) | **关联资源 / 非主链路按钮维护**:关联视图/报表、`match_mappings`、上下文传参;按钮配置看视图文档 `action_buttons`;创建自定义按钮前先 `button get --button-text` 查重复用 |
|
|
38
|
+
| [reference/builder/90-workflow.md](./reference/builder/90-workflow.md) | **流程**:WorkflowSpec、`patch_nodes`、角色/成员、流程回读 |
|
|
39
|
+
| [reference/builder/99-publish-verify.md](./reference/builder/99-publish-verify.md) | **发布与回读**:`publish verify`、partial/readback 处理、最终汇报口径 |
|
|
40
|
+
| [reference/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md) | **新建记录**:`record schema insert -> record insert --items-file`;成员/部门/关联优先自然语言输入;细节见 [record/insert](./reference/record/insert/README.md) |
|
|
41
|
+
| [reference/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md) | **更新记录**:主链路是 `record get` → 智能体按 `fields[]` 组 key/value → **`record update`**;`record schema update` 仅用于失败后诊断可写字段/路径 |
|
|
42
|
+
| [reference/QINGFLOW_CLI_RECORD_DELETE_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_DELETE_WORKFLOW.md) | **删除记录**:`record list/get` 精确定位 → `record delete --app-key --record-id --view-id system:*`;批量用 `--record-ids-file` |
|
|
43
|
+
| [reference/record/analysis/README.md](./reference/record/analysis/README.md) | **数据分析**:最终统计结论、分析报告、趋势/排名/比例/分布统一走 `record access -> Python/pandas` |
|
|
44
|
+
| [reference/builder/reference/app-delivery-sop.md](./reference/builder/reference/app-delivery-sop.md) | **底层交付参考**:历史完整 SOP、权限、系统列和工具细节;不是主入口 |
|
|
45
|
+
| [reference/builder/reference/workspace-icons.md](./reference/builder/reference/workspace-icons.md) | **图标参考**:`builder icon catalog`;新建应用包、应用、门户必须显式选择非 `template` 的 `icon + color` |
|
|
46
|
+
| [reference/builder/reference/match-rules.md](./reference/builder/reference/match-rules.md) | **统一筛选 / 条件写法**:`filters`、`visible_when`、QingBI 图表筛选、工作流条件、`match_mappings`、`field_mappings` 的 `operator/value` 规则 |
|
|
47
|
+
| [reference/builder/workflow/README.md](./reference/builder/workflow/README.md) | **工作流搭建**:已有应用的流程建模、节点配置、`builder flow apply` 与 `patch_nodes` |
|
|
48
|
+
| [reference/builder/code-integrations/README.md](./reference/builder/code-integrations/README.md) | **代码块 / Q-Linker 配置**:字段别名、绑定、输入字段插入和配置排障 |
|
|
49
|
+
| [reference/QINGFLOW_CLI_ADMIN_CHEATSHEET.md](./reference/core/QINGFLOW_CLI_ADMIN_CHEATSHEET.md) | **管理员**:检索、导入等与成员差异(主技能正文不展开) |
|
|
50
|
+
| [reference/QINGFLOW_CLI_EXPLORATION_REPORT.md](./reference/core/QINGFLOW_CLI_EXPLORATION_REPORT.md) | CLI 实测与 argparse/服务端对齐备忘 |
|
|
51
|
+
| [reference/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md](./reference/core/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md) | **可选**:全角色「一次可复制」分项模板;默认执行技能**不必**打开 |
|
|
52
|
+
| [scripts/find-app-by-keyword.py](./scripts/find-app-by-keyword.py) | **旧版 CLI 兼容脚本**:当 `app list --query` 不可用时,用 `app list` 本地解析;默认优先使用 `qingflow --json app list --query <关键词>` |
|
|
53
|
+
| [scripts/builder-package-from-app-list.py](./scripts/builder-package-from-app-list.py) | **旧版 CLI 兼容脚本**:当 `builder package list` 不可用时,才从 `app list` 曲线反查 **`package_name` / `resolve-id`**;新版默认直接用 `qingflow --json builder package list --query <关键词>` |
|
|
14
54
|
## CLI 执行与 JSON 落盘
|
|
15
55
|
|
|
16
56
|
1. 已知业务目标时直接执行目标命令,不固定前置 `auth whoami`、`workspace get` 或 `workspace select`。只有业务命令明确返回未登录、会话失效或工作区错误后,才恢复上下文并重试原命令。
|
|
@@ -42,7 +82,8 @@ echo "$QINGFLOW_CREDENTIAL" | qingflow --profile default auth use-credential \
|
|
|
42
82
|
| 用户意图 | 默认入口 | 专项说明 |
|
|
43
83
|
| --- | --- | --- |
|
|
44
84
|
| 普通应用数据查询、单条读取、直接增删改 | `qingflow data query/get/insert/update/delete` | [data 操作说明](./reference/data/README.md) |
|
|
45
|
-
|
|
|
85
|
+
| 简单筛选计数(例如“有几条”) | `data query --where-file`,读取 `records.total` | [data 操作说明](./reference/data/README.md) |
|
|
86
|
+
| 分布、比例、排名、趋势等需要全量样本的分析 | `data query --all --output csv -> Python/pandas` | [数据分析说明](./reference/record/analysis/README.md) |
|
|
46
87
|
| 待办、已办、抄送、审批、转交或退回 | `qingflow task ...` | [任务上下文 SOP](./reference/task/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md) |
|
|
47
88
|
| Excel 模板、文件校验、修复、启动导入与状态 | `qingflow import ...` / `record schema import` | [批量导入 SOP](./reference/record/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md) |
|
|
48
89
|
| 应用、表单、字段、视图、报表、门户与流程搭建 | `qingflow builder ...` | [Builder 总导航](./reference/builder/README.md) |
|
|
@@ -61,6 +102,77 @@ echo "$QINGFLOW_CREDENTIAL" | qingflow --profile default auth use-credential \
|
|
|
61
102
|
qingflow --json data query --app-key APP_KEY > tmp/qingflow_data_query.json
|
|
62
103
|
```
|
|
63
104
|
|
|
105
|
+
常用参数:`--credential-stdin`、`--password-stdin`、`--persist` / `--forget-persisted`;详见 `qingflow auth --help`。
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 输出落盘规则(task / record / import / builder 查询类)
|
|
110
|
+
|
|
111
|
+
以下 **必须** 将标准输出重定向到文件(如 `tmp/qingflow_*.json`),**禁止**把终端大 JSON 直接交给 LLM;后续用读文件 / 脚本处理。
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
| 子系统 | 必须落盘的子命令 |
|
|
115
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| **task** | `list`、`get`、`log`、`report` |
|
|
117
|
+
| **import** | `template`、`verify`、`repair`、`start`、`status`(**`verify` / `start` 链依赖本机 `~/.qingflow-mcp` 校验/任务落盘,自动化须开放写权限**) |
|
|
118
|
+
| **builder** | **`app get`(summary/app map、fields、layout、views、flow、charts;summary 含 `custom_buttons` / `associated_resources`)**、`contract`、`app-form schema/get/validate/apply`;以及 **`views schema/get/validate/apply` / `button apply` / `associated-resource apply` / `flow apply` / `charts apply` / `portal apply` / `portal delete` / `publish verify` / `package apply`** 等大 JSON 响应 |
|
|
119
|
+
| **record** | `list`、`get`、`logs`、`access`、`schema browse`;以及 `schema insert` / `schema update` / `schema import` / `schema code-block` 等大体积 schema 子命令(体量大时同上);**创建前列字段时用 `schema insert` / `record_insert_schema_get` 同上**;**写操作 `insert` / `update` 响应体大时同样建议落盘** |
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
**规则摘要**
|
|
123
|
+
|
|
124
|
+
- 重定向示例:`qingflow --json record list … > tmp/qingflow_records.json`
|
|
125
|
+
- 线上真实测试、子智能体并行任务、批量 `--*-file` 入参优先使用**绝对路径**,或在命令前固定确认 `pwd`;不要假设子智能体当前目录与主线程一致。
|
|
126
|
+
- `auth`、`workspace`、`app`、`portal`、`view`、**非上述列出的**等,可直接终端查看或按需落盘。
|
|
127
|
+
- 错误在使用 **`--json`** 时多在 **stdout** 的 JSON 信封里;stderr 多为 argparse usage。
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 应用记录:获取数据工作流(推荐闭环)
|
|
132
|
+
|
|
133
|
+
与常见 **编排/API 文档**里的命名对齐时的固定顺序为:
|
|
134
|
+
|
|
135
|
+
1. **`app_get`**:`qingflow --json app get --app-key <APP_KEY>` → 在 **`data.accessible_views`**(或等价路径)选取 **`view_id`**。
|
|
136
|
+
2. **`record_schema_get`(`schema_mode=browse`)**:`qingflow --json record schema browse --app-key <APP_KEY> --view-id <VIEW_ID>`(CLI 子命令 **`browse`** 即浏览视图表结构)。
|
|
137
|
+
3. **`record_list` / `record_get` / `record_logs_get`**:`record list …` 用于样本浏览或模糊定位候选;`record get --record-id …` 下钻单条前端详情页首屏上下文(字段、首屏日志、引用、图片与文件资产);只有需要完整审计历史时,再用 `record logs --record-id …` 读取全量数据日志和流程日志 JSONL。
|
|
138
|
+
|
|
139
|
+
`app get` 里的 `CUSTOM_VIEW_LIST_UNAVAILABLE` 表示自定义视图列表读取被权限或后端限制降级;若 `accessible_views` 中仍有 `system:*`,可继续用该视图读数。若没有任何视图,再回到前端 URL、`app list` 可见应用、或用户提供的 `viewgraphKey` 补充上下文,不要直接断言应用不可读。
|
|
140
|
+
`app get.data.can_create=false` 才表示 applicant/create 路径不可用;创建权限探测遇到 auth / server 等非权限类错误时应直接按失败处理,不要包装成“未知创建权限”或“用户无新建权限”。
|
|
141
|
+
|
|
142
|
+
**细则、响应解包、`view_id` 雷区与命令模板**见 **[reference/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md](./reference/core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md)**(编写前已对当前 CLI **实跑**校验)。若仅需「最快看一眼有没有行」,可省略 **`schema browse`**,直接走下文「最短路径」。如果用户要任何最终统计结论、分析报告、趋势/排名/比例/分布,按 **[record/analysis](./reference/record/analysis/README.md)** 执行 `record access -> Python/pandas`。
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 应用记录:创建记录工作流(申请节点 → 写入)
|
|
147
|
+
|
|
148
|
+
推荐顺序:
|
|
149
|
+
|
|
150
|
+
1. **`record schema insert`**:先读取 insert-ready schema、`required_fields`、`payload_template`、`format_hint`、`example_value`、联动与运行时必填提示。
|
|
151
|
+
2. **`record insert --items-file`**:单条也是 `items` 数组的一行;成员、部门、关联字段优先写自然语言(如 `"张三"`、`"直销部"`、`"海军军医大学"`),仅在返回 `needs_confirmation` 时再让用户确认候选。
|
|
152
|
+
3. **写后读回**:单条重要数据用 `record get`,批量样本用 `record list` 或业务视图校验;`partial_success` 只重试失败行,不重放全批。
|
|
153
|
+
|
|
154
|
+
**细则、字段 JSON 结构与排障**见 **[reference/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md)**。
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 应用记录:更新记录工作流(详情 → 写入)
|
|
159
|
+
|
|
160
|
+
主链路是先读详情,再直接提交用户要求修改的 key/value。不要把 `record schema update` 当成更新前置步骤:
|
|
161
|
+
|
|
162
|
+
1. **`record get`** → 拿 **`record_id`、当前值、fields[].title / field_id / kind**;已知前端/自定义视图时必须带同一个 **`--view-id`**。未知时 CLI 会先试默认 `system:all`,权限拒绝后再尝试可访问视图,但智能体仍优先从 `app get.accessible_views` 取 view。
|
|
163
|
+
2. 智能体根据 `record get.fields[]` 和用户要求,组一个只包含待改字段的 JSON 对象(标题 → 值)。字段必须来自当前详情上下文的 `fields[]`;带 `--view-id` 时,视图隐藏的字段不要强写。若用户要求改的字段不在当前 `record get.fields[]`,先换到包含该字段的视图/详情上下文,或用 `record schema update` 做失败诊断。
|
|
164
|
+
3. **`record update`** → **`--record-id` + `--fields-file`**,已知前端视图时同样带 **`--view-id`** 让 CLI 优先走该 view;批量用 **`--items-file`**(**`--dry-run` 仅批量**)。
|
|
165
|
+
4. 只有字段范围不清、候选歧义、或 `record update` 失败时,才用 **`record schema update`** 诊断本条记录的 **`writable_fields / payload_template / available_update_routes`**;已知前端视图时同样带 **`--view-id`**,让诊断优先探测同一个详情页上下文。
|
|
166
|
+
|
|
167
|
+
**更新路径**:`record update` 会自动先尝试数据管理员直改,再 fallback 到前端同源的 custom view 详情编辑路径;如果当前用户存在这条记录的唯一待办且目标字段在当前节点可编辑,最后会尝试 workflow save-only。成功时只需要读 **`status / update_route / verification_status`**;失败时再读失败原因与路线诊断。不要把中间 route 或辅助 schema/readback 探测的 40002 / 40027 / 404 当作最终失败。
|
|
168
|
+
|
|
169
|
+
**大号 `record_id`(常见于 Snowflake 类 id)**:若干 CLI 版本在 **`record update` 写入路径**上对 `apply_id` 会做 **JavaScript 安全整数**相关校验,`list`/`get`/`schema update` 仍可能正常而 **更新落库报错**(常为 `apply_id must be positive`)。排障见 **[reference/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md)**。业务统计与最终结论仍必须按 **[record/analysis](./reference/record/analysis/README.md)** 使用 `record access -> Python/pandas`。
|
|
170
|
+
|
|
171
|
+
**命令模板、批量 `items` 形态、与新建相同的写入值约定**(按 **`kind`** 分题型见 **[QINGFLOW_CLI_FIELD_DATA_TYPES.md](./reference/core/QINGFLOW_CLI_FIELD_DATA_TYPES.md)**)见 **[reference/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md](./reference/record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md)**。
|
|
172
|
+
|
|
173
|
+
**成员 / 部门候选排障**:若成员、部门字段返回 `needs_confirmation` 或候选不清,使用 `qingflow record member-candidates` / `qingflow record department-candidates`;它们优先走表单字段候选范围接口(与前端选择器一致)。不要改用通讯录管理类查询去“补候选”,那会把普通成员误带到 ContactAuth 管理权限链路。
|
|
174
|
+
|
|
175
|
+
**部门名筛选 / 写入**:`record list/access/analyze/insert/update` 遇到部门字段时可直接传部门名或候选对象;CLI 会优先走成员可见的目录搜索解析部门。不要先用通讯录管理接口查询部门 id,否则普通成员容易被 ContactAuth 错误阻挡。
|
|
64
176
|
### 字段筛选
|
|
65
177
|
|
|
66
178
|
先运行一次不带 `columns` 的 query,从返回的 `schema` 与递归 `field_capabilities` 准确定位 `field_id`,并确认该字段暴露的 `filter_operators` 与 `value_shape`。再写筛选文件:
|
|
@@ -7,19 +7,15 @@ This file is kept only for old cross-links. Use the current canonical document i
|
|
|
7
7
|
Current main path:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
qingflow builder views apply --
|
|
10
|
+
qingflow builder views apply --app-key APP_KEY --view-file /abs/path/view.json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Use
|
|
13
|
+
Use `--app-key APP_KEY --view-file /abs/path/view.json`. The file contains one direct view object.
|
|
14
14
|
|
|
15
15
|
Minimum current shape:
|
|
16
16
|
|
|
17
17
|
```json
|
|
18
18
|
{
|
|
19
|
-
"views": [
|
|
20
|
-
{
|
|
21
|
-
"operation": "upsert",
|
|
22
|
-
"app_key": "APP_KEY",
|
|
23
19
|
"name": "订单跟进视图",
|
|
24
20
|
"type": "table",
|
|
25
21
|
"columns": ["订单编号", "客户名称", "状态", "负责人"],
|
|
@@ -50,9 +46,7 @@ Minimum current shape:
|
|
|
50
46
|
]
|
|
51
47
|
}
|
|
52
48
|
]
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
49
|
}
|
|
56
50
|
```
|
|
57
51
|
|
|
58
|
-
|
|
52
|
+
Each `builder views apply` call handles one operation on one view: pass one `--view-file`, one-item `patch_views`, or one-item `remove_views`; do not combine these operation modes.
|
|
@@ -22,10 +22,11 @@ package apply/get -> AppForm schema/get/apply per app -> app readback -> workflo
|
|
|
22
22
|
- Do not call the retired `builder schema apply` or `builder layout apply` routes, and do not use their `add_fields`, `apps-file`, or `form-file` payloads as the current path.
|
|
23
23
|
- For relations, create relation-independent apps first, read back their published `appKey`s, then submit complete declarations using the canonical relation shape and known target app keys.
|
|
24
24
|
- One app may contain multiple `relation` fields when the business model needs them.
|
|
25
|
-
- Relation selectors use the AppForm camelCase shape, not bare strings: write `config.
|
|
25
|
+
- Relation selectors use the AppForm camelCase shape, not bare strings: write ordered `config.displayFields: [{"field":{"name":"产品编码"},"auth":"visible"}]` (include hidden items) and `config.twoWayBoundField: {"queId":N}` when the binding is two-way (omit for one-way). `config.targetAppKey` must be a target app key confirmed by readback.
|
|
26
26
|
- If AppForm apply times out or returns uncertain write state, perform draft/published form readback before retrying. Do not recreate apps with `V2`, `测试`, or random suffixes.
|
|
27
27
|
- 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.
|
|
28
28
|
- 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.
|
|
29
|
+
- `builder views apply` is declarative and handles one view operation per call. When a system needs multiple views, submit each view in a separate call; do not send batch view declarations.
|
|
29
30
|
- Do not create default views such as `全部数据` or `我的数据`; those are platform defaults.
|
|
30
31
|
- New business views must include `query_conditions`; do not create business views that only define columns, filters, and buttons but lack a frontend query panel.
|
|
31
32
|
- New business views must include shortcut buttons through `action_buttons`; every core operating view must configure both `placement: "list"` and `placement: "detail"` buttons. Do not create core operating views that only contain columns and filters.
|
|
@@ -72,7 +73,7 @@ A complete system is not just several created apps. Before reporting completion,
|
|
|
72
73
|
|
|
73
74
|
- Package exists, and its `package_id` is known.
|
|
74
75
|
- Every core business object is a separate app with `app_key`, `app_name`, `icon`, `color`, and exactly one readable data title field.
|
|
75
|
-
- Cross-app relation fields are present where the business model needs them; each relation uses a confirmed `targetAppKey` and object selectors in `config.
|
|
76
|
+
- Cross-app relation fields are present where the business model needs them; each relation uses a confirmed `targetAppKey` and object selectors in `config.displayFields[].field` (+ `twoWayBoundField` for two-way bindings).
|
|
76
77
|
- Core apps were created with complete AppForm declarations, so fields and readable form sections/rows were submitted together.
|
|
77
78
|
- Core operating views exist and their `query_conditions` and `action_buttons` are verified; list-row buttons and detail-page buttons are both configured through the view.
|
|
78
79
|
- Each new app has 5 realistic sample records unless the user explicitly skipped sample data.
|
|
@@ -185,7 +185,7 @@ current CLI payload.
|
|
|
185
185
|
| 负责人、审批人、参与人 | `member` | 不要创建“申请人/提交人”等平台系统字段 |
|
|
186
186
|
| 部门、组织 | `department` | 可按需要补 `config.departmentScope` |
|
|
187
187
|
| 图片、文件、附件 | `attachment` | 只有顶层 `attachment` 可被应用级 `dataCoverField` 选择 |
|
|
188
|
-
| 跨应用业务对象关系 | `relation` | 使用已确认的 `targetAppKey
|
|
188
|
+
| 跨应用业务对象关系 | `relation` | 使用已确认的 `targetAppKey`;展示字段写有序 `displayFields[]`(含 `auth`),双向绑定写 `twoWayBoundField`;旧 `displayField`/`visibleFields` 兼容窗口内仍可读 |
|
|
189
189
|
|
|
190
190
|
禁止创建平台系统字段:`数据ID`、`编号`、`申请人`、`申请时间`、`创建人`、`创建时间`、`提交人`、`提交时间`、`更新时间`、`更新人`、`当前流程状态`、`当前处理人`、`当前处理节点`、`流程标题`。需要引用系统字段时,只在工具明确支持的位置引用,例如按钮 `source_field: "数据ID"`。
|
|
191
191
|
|
|
@@ -243,7 +243,7 @@ current CLI payload.
|
|
|
243
243
|
|--------|----------|-----------------|
|
|
244
244
|
| 标量与选择器 | `name` + `questionType`(+ 业务 `beingRequired` 等) | `questionDescription`、`beingRequired`;数据标题和封面在应用级 `dataTitleField/dataCoverField` 中选择;**`single_select` / `multi_select` 的 `config.options` 是非空字符串数组**,如 `["A", "B"]` |
|
|
245
245
|
| `department` | 同左 | **`config.departmentScope`**:`mode: all \| custom`;`custom` 时 **`departments[]`**(含 `deptId` 等) |
|
|
246
|
-
| `relation` | **`targetAppKey`**;另需 **`
|
|
246
|
+
| `relation` | **`targetAppKey`**;另需 **`displayFields[]`**(含 `field`+`auth`;可为空列表——空 = 双向绑定未配展示字段的存量形态,round-trip 空↔空稳定;与旧形态不可混用、条目 queId 不可重复) | **`relationMode`**;双向绑定加 **`twoWayBoundField`**(省略 = 单向);目标应用元数据不可读时先读已发布表单,不要猜目标 key |
|
|
247
247
|
| `subtable` | **`subfields[]` 非空** | 子列递归同父级规则;使用 Schema 返回的 camelCase 子字段配置 |
|
|
248
248
|
| `q_linker` | **`config.qLinkerBinding`**:`inputs`、`request`、**`outputs[]` 每项须含 `targetField`**(能解析到本表单字段) | `request.url` 等须符合**租户/后端远程查询策略**;以字段类型 Schema 返回的配置为准 |
|
|
249
249
|
| `code_block` | **`config.codeBlockBinding`**:`inputs`、`code`、**`outputs[]` + `targetField`**;配置 outputs 时,代码必须显式写 **`qf_output = {...}`**,仅 `return {...}` 不会产生可回写结果,且每个 `outputs[].path` 必须从 `qf_output` 取值 | 以字段类型 Schema 返回的 camelCase 配置为准 |
|
|
@@ -265,13 +265,17 @@ current CLI payload.
|
|
|
265
265
|
"config": {
|
|
266
266
|
"targetAppKey": "PRODUCT_APP_KEY",
|
|
267
267
|
"relationMode": "single",
|
|
268
|
-
"
|
|
269
|
-
"
|
|
268
|
+
"twoWayBoundField": {"name": "产品编码"},
|
|
269
|
+
"displayFields": [
|
|
270
|
+
{"field": {"name": "产品编码"}, "auth": "visible"},
|
|
271
|
+
{"field": {"name": "产品名称"}, "auth": "hidden"},
|
|
272
|
+
{"field": {"name": "产品线"}, "auth": "visible"}
|
|
273
|
+
]
|
|
270
274
|
}
|
|
271
275
|
}
|
|
272
276
|
```
|
|
273
277
|
|
|
274
|
-
只在目标应用已经创建并通过 readback 确认后填写 `targetAppKey`。如果返回选择器校验错误,修复 `config.
|
|
278
|
+
只在目标应用已经创建并通过 readback 确认后填写 `targetAppKey`。如果返回选择器校验错误,修复 `config.displayFields[].field` / `config.twoWayBoundField`,不要重建应用或改 `appKey`。旧形态 `displayField`/`visibleFields` 在兼容窗口内仍可读(displayField 同时视为双向绑定目标),新声明一律用 `displayFields`。
|
|
275
279
|
|
|
276
280
|
引用字段的公式默认值写在 `config.defaultValueFormula`,表达式必须符合固定版本 `relation` 字段详情中的 `FormulaExpression`。不要把后端 `referenceConfig` 字段名或其他 Schema 版本的公式写法直接放进声明。
|
|
277
281
|
|