@qingflow-tech/qingflow-cli 1.1.61-beta.3 → 1.1.61-beta.4

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 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.61-beta.3
10
+ npm install @qingflow-tech/qingflow-cli@1.1.61-beta.4
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.61-beta.3 qingflow
24
+ npx -y -p @qingflow-tech/qingflow-cli@1.1.61-beta.4 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.61-beta.3 qingflow-skills install --agent codex --scope user --copy
65
+ npx -y -p @qingflow-tech/qingflow-cli@1.1.61-beta.4 qingflow-skills install --agent codex --scope user --copy
66
66
  ```
67
67
 
68
68
  `qingflow-skills install` 默认使用 symlink,且遇到同名 skill 不会覆盖;只有显式传入 `--force` 才会替换。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingflow-tech/qingflow-cli",
3
- "version": "1.1.61-beta.3",
3
+ "version": "1.1.61-beta.4",
4
4
  "description": "Human-friendly Qingflow command line interface for auth, record operations, import, tasks, and stable builder flows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
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.61b3"
7
+ version = "1.1.61b4"
8
8
  description = "User-authenticated MCP server for Qingflow"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -14,6 +14,8 @@ description: |
14
14
 
15
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
16
 
17
+ 首次解析 `data query/get` 响应前,阅读 [data 响应结构与解析](./reference/data/README.md#响应结构与解析),按同次响应中的 schema 与记录结构读取目标字段。
18
+
17
19
  ## 关联文件
18
20
 
19
21
 
@@ -10,6 +10,44 @@
10
10
 
11
11
  参数、JSON 文件形状和可选项必须来自当前工具 schema、当次 `--help` 或响应字段能力,不得从其他命令推测。
12
12
 
13
+ ## 响应结构与解析
14
+
15
+ `data query` 的记录位于 `records.items[]`,`data get` 的单条记录位于 `record`。两者的业务值都在各记录的 `fields` 对象中,以十进制 `field_id` 字符串为键;不要从记录顶层按字段 id 取值。
16
+
17
+ `schema.fields[]` 是字段元数据,包含两种结构:系统字段使用 `key` 与 `kind=system`,对应记录顶层的 `record_id/creator/updated_at`;业务字段使用 `field_id/title/data_type/cardinality`,对应记录的 `fields`。按是否包含 `field_id` 识别业务字段(`field_id=0` 也有效),类型读取 `data_type`。子表的列定义在 `children` 中,各行同样以字段 id 字符串为键。
18
+
19
+ 以下是只保留解析所需字段的 query 响应示例:
20
+
21
+ ```json
22
+ {
23
+ "schema": {"fields": [
24
+ {"key": "record_id", "kind": "system"},
25
+ {"field_id": 0, "title": "编号", "data_type": "number", "cardinality": "one"},
26
+ {"field_id": 101, "title": "名称", "data_type": "text", "cardinality": "one"}
27
+ ]},
28
+ "records": {"items": [
29
+ {"record_id": "1", "fields": {"0": 0, "101": "示例"}}
30
+ ]}
31
+ }
32
+ ```
33
+
34
+ JSON 落盘后,先确认记录结构,再按用户目标选择字段;例如只查看首条记录的「名称」:
35
+
36
+ ```python
37
+ field = next(f for f in payload["schema"]["fields"]
38
+ if "field_id" in f and f["title"] == "名称")
39
+ key = str(field["field_id"])
40
+ for record in payload["records"]["items"][:1]:
41
+ values = record["fields"]
42
+ assert isinstance(values, dict), "记录 fields 结构不符合预期"
43
+ if key in values:
44
+ print({"record_id": record["record_id"], "title": field["title"], "value": values[key]})
45
+ else:
46
+ print({"record_id": record["record_id"], "title": field["title"], "returned": False})
47
+ ```
48
+
49
+ 键未返回与值为 `null` 是不同情况;`0` 和 `false` 是有效值,不要用真假判断把它们归为空。结构不符合预期或字段键缺失时,检查同次响应的 schema、`access`、`hints` 与首条记录的结构,必要时对同一记录执行 `data get` 复核;不能把解析失败或未返回字段直接报告为业务数据为空。
50
+
13
51
  ## 字段能力合同
14
52
 
15
53
  1. 首次操作当前应用时,只通过只读 `data query/get` 请求 `include_schema=true`,读取同一次响应中的 `schema` 与递归 `field_capabilities`;不得用 insert/update 探测能力。