@qingflow-tech/qingflow-cli 1.1.43-beta.3 → 1.1.43-beta.5

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.
Files changed (39) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/pyproject.toml +1 -1
  4. package/skills/qingflow-app-form/SKILL.md +12 -9
  5. package/skills/qingflow-cli/reference/builder/30-schema-fields.md +15 -13
  6. package/src/qingflow_mcp/app_form_compat.py +11 -27
  7. package/src/qingflow_mcp/app_form_validator.py +298 -35
  8. package/src/qingflow_mcp/builder_facade/app_form.py +777 -150
  9. package/src/qingflow_mcp/builder_facade/app_form_schema.py +164 -8
  10. package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +5 -0
  11. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +299 -239
  12. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +82 -27
  13. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +82 -27
  14. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +82 -30
  15. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +113 -37
  16. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +87 -64
  17. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +82 -27
  18. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +82 -27
  19. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +83 -28
  20. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +82 -27
  21. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +82 -27
  22. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +82 -27
  23. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +83 -28
  24. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +82 -27
  25. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +82 -27
  26. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +82 -27
  27. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +95 -40
  28. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +100 -28
  29. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +82 -27
  30. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +82 -27
  31. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +201 -111
  32. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +82 -27
  33. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/formula.json +1594 -0
  34. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +143 -161
  35. package/src/qingflow_mcp/builder_facade/service.py +3 -2
  36. package/src/qingflow_mcp/cli/commands/builder.py +2 -0
  37. package/src/qingflow_mcp/response_trim.py +2 -0
  38. package/src/qingflow_mcp/server_app_builder.py +9 -4
  39. package/src/qingflow_mcp/tools/ai_builder_tools.py +13 -3
@@ -15,9 +15,6 @@
15
15
  "type": "string"
16
16
  }
17
17
  },
18
- "required": [
19
- "name"
20
- ],
21
18
  "type": "object"
22
19
  },
23
20
  "AnswerValue": {
@@ -232,7 +229,7 @@
232
229
  },
233
230
  "DataRelationCondition": {
234
231
  "additionalProperties": false,
235
- "description": "一条数据关联过滤条件。",
232
+ "description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。",
236
233
  "properties": {
237
234
  "operand": {
238
235
  "$ref": "#/$defs/DataRelationOperand",
@@ -358,7 +355,7 @@
358
355
  ]
359
356
  },
360
357
  "DataRelationFilters": {
361
- "description": "simple 模式的外层组为 OR、组内条件为 AND;advanced 模式使用完整公式。",
358
+ "description": "simple 模式的外层组为 OR、组内条件为 AND;advanced 模式使用完整公式。simple 条件只声明业务值,builder 会生成后端保存所需的 judgeValues 和 judgeValueDetails,不要在声明中直接填写这两个后端属性。",
362
359
  "oneOf": [
363
360
  {
364
361
  "additionalProperties": false,
@@ -414,9 +411,9 @@
414
411
  "const": "literal"
415
412
  },
416
413
  "values": {
417
- "description": "字面量值列表。",
414
+ "description": "固定比较值列表;值必须使用字符串。选择类来源字段填写已有选项的展示文本,builder 会在 apply 时解析为后端 optId;解析不到会在写入前报错。is_empty/is_not_empty 必须传空数组,其他运算符至少传一项。",
418
415
  "items": {
419
- "$ref": "#/$defs/JsonValue"
416
+ "type": "string"
420
417
  },
421
418
  "type": "array"
422
419
  }
@@ -915,15 +912,71 @@
915
912
  "type": "object"
916
913
  },
917
914
  "FieldCommon": {
915
+ "allOf": [
916
+ {
917
+ "if": {
918
+ "properties": {
919
+ "defaultType": {
920
+ "const": 2
921
+ }
922
+ },
923
+ "required": [
924
+ "defaultType"
925
+ ]
926
+ },
927
+ "then": {
928
+ "properties": {
929
+ "defaultValue": {
930
+ "type": "null"
931
+ }
932
+ }
933
+ }
934
+ },
935
+ {
936
+ "if": {
937
+ "properties": {
938
+ "defaultType": {
939
+ "const": 3
940
+ }
941
+ },
942
+ "required": [
943
+ "defaultType"
944
+ ]
945
+ },
946
+ "then": {
947
+ "properties": {
948
+ "defaultValue": {
949
+ "minLength": 1,
950
+ "type": [
951
+ "string",
952
+ "null"
953
+ ]
954
+ }
955
+ }
956
+ }
957
+ }
958
+ ],
959
+ "anyOf": [
960
+ {
961
+ "required": [
962
+ "queId"
963
+ ]
964
+ },
965
+ {
966
+ "required": [
967
+ "name"
968
+ ]
969
+ }
970
+ ],
918
971
  "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
919
972
  "properties": {
920
- "dataTitle": {
921
- "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
973
+ "beingRequired": {
974
+ "description": "该字段是否必填;缺失时保留已有字段当前值。",
922
975
  "type": "boolean"
923
976
  },
924
977
  "defaultType": {
925
978
  "default": 1,
926
- "description": "默认值类型;1 表示静态值,2 表示关联/绑定值,3 表示公式值。",
979
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
927
980
  "enum": [
928
981
  1,
929
982
  2,
@@ -933,39 +986,40 @@
933
986
  },
934
987
  "defaultValue": {
935
988
  "$ref": "#/$defs/ScalarDefaultValue",
936
- "description": "普通字段的标量默认值;表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
937
- },
938
- "description": {
939
- "description": "字段说明;null 或空字符串表示清空。",
940
- "type": [
941
- "string",
942
- "null"
943
- ]
989
+ "description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
944
990
  },
945
991
  "name": {
946
- "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
992
+ "description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
947
993
  "minLength": 1,
948
994
  "type": "string"
949
995
  },
950
996
  "queId": {
951
- "description": "已有字段的后端 ID;get 返回,新增字段省略。",
997
+ "description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
952
998
  "minimum": 1,
953
999
  "type": "integer"
954
1000
  },
955
- "required": {
956
- "description": "是否必填;缺失时保留已有字段当前值。",
957
- "type": "boolean"
1001
+ "questionDescription": {
1002
+ "description": "字段说明;null 或空字符串表示清空。",
1003
+ "type": [
1004
+ "string",
1005
+ "null"
1006
+ ]
1007
+ },
1008
+ "questionType": {
1009
+ "description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
1010
+ "type": "string"
958
1011
  },
959
1012
  "width": {
960
- "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
961
- "maximum": 100,
962
- "minimum": 1,
1013
+ "description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
1014
+ "enum": [
1015
+ 25,
1016
+ 50,
1017
+ 75,
1018
+ 100
1019
+ ],
963
1020
  "type": "integer"
964
1021
  }
965
1022
  },
966
- "required": [
967
- "name"
968
- ],
969
1023
  "type": "object"
970
1024
  },
971
1025
  "FieldSelector": {
@@ -982,7 +1036,7 @@
982
1036
  ]
983
1037
  }
984
1038
  ],
985
- "description": "跨字段引用选择器;至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
1039
+ "description": "字段选择器;用于定位应用的数据标题、数据封面、自定义编号取值来源或其他配置引用的字段。至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
986
1040
  "properties": {
987
1041
  "name": {
988
1042
  "description": "字段名称;仅在当前作用域内唯一时可用于解析。",
@@ -997,34 +1051,10 @@
997
1051
  },
998
1052
  "type": "object"
999
1053
  },
1000
- "JsonValue": {
1001
- "description": "数据关联字面量支持的任意 JSON 值。",
1002
- "oneOf": [
1003
- {
1004
- "type": "null"
1005
- },
1006
- {
1007
- "type": "boolean"
1008
- },
1009
- {
1010
- "type": "number"
1011
- },
1012
- {
1013
- "type": "string"
1014
- },
1015
- {
1016
- "items": {
1017
- "$ref": "#/$defs/JsonValue"
1018
- },
1019
- "type": "array"
1020
- },
1021
- {
1022
- "additionalProperties": {
1023
- "$ref": "#/$defs/JsonValue"
1024
- },
1025
- "type": "object"
1026
- }
1027
- ]
1054
+ "FormulaExpression": {
1055
+ "description": "轻流公式表达式的解码文本;字段引用形如 #queId_<queId>$,由后端 Formula 引擎解析。",
1056
+ "minLength": 1,
1057
+ "type": "string"
1028
1058
  },
1029
1059
  "MemberConfig": {
1030
1060
  "additionalProperties": false,
@@ -1374,11 +1404,23 @@
1374
1404
  "description": "引用字段配置;引用其他应用中的数据。",
1375
1405
  "properties": {
1376
1406
  "beingDefaultFormulaAutoFillEnabled": {
1407
+ "description": "是否启用引用字段的默认值公式自动填充。",
1377
1408
  "type": [
1378
1409
  "boolean",
1379
1410
  "null"
1380
1411
  ]
1381
1412
  },
1413
+ "defaultValueFormula": {
1414
+ "description": "引用字段默认值自动填充使用的公式;仅在 beingDefaultFormulaAutoFillEnabled 为 true 时执行,null 表示清除。",
1415
+ "oneOf": [
1416
+ {
1417
+ "type": "null"
1418
+ },
1419
+ {
1420
+ "$ref": "#/$defs/FormulaExpression"
1421
+ }
1422
+ ]
1423
+ },
1382
1424
  "defaultValueMatchRules": {
1383
1425
  "type": [
1384
1426
  "array",
@@ -1445,11 +1487,9 @@
1445
1487
  "type": "object"
1446
1488
  },
1447
1489
  "ScalarDefaultValue": {
1448
- "description": "不包含对象或数组的普通字段默认值。",
1490
+ "description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。defaultType 为 3 时,通过 AppForm Schema 查询能力传入当前 schema_version 并设置 schema_kind=formula 获取公式语法、字段引用、运算符和全部函数说明;CLI 使用 builder app-form schema --schema-kind formula。需要配置结构化默认值时,传入当前 schema_version,并将字段的 questionType 作为 field_type 获取字段详细 Schema。",
1449
1491
  "type": [
1450
1492
  "null",
1451
- "boolean",
1452
- "number",
1453
1493
  "string"
1454
1494
  ]
1455
1495
  },
@@ -1512,7 +1552,7 @@
1512
1552
  "config": {
1513
1553
  "$ref": "#/$defs/TextConfig"
1514
1554
  },
1515
- "type": {
1555
+ "questionType": {
1516
1556
  "enum": [
1517
1557
  "text",
1518
1558
  "long_text",
@@ -1522,7 +1562,7 @@
1522
1562
  }
1523
1563
  },
1524
1564
  "required": [
1525
- "type"
1565
+ "questionType"
1526
1566
  ]
1527
1567
  },
1528
1568
  {
@@ -1530,12 +1570,12 @@
1530
1570
  "config": {
1531
1571
  "$ref": "#/$defs/PhoneConfig"
1532
1572
  },
1533
- "type": {
1573
+ "questionType": {
1534
1574
  "const": "phone"
1535
1575
  }
1536
1576
  },
1537
1577
  "required": [
1538
- "type"
1578
+ "questionType"
1539
1579
  ]
1540
1580
  },
1541
1581
  {
@@ -1543,12 +1583,12 @@
1543
1583
  "config": {
1544
1584
  "$ref": "#/$defs/NumberConfig"
1545
1585
  },
1546
- "type": {
1586
+ "questionType": {
1547
1587
  "const": "number"
1548
1588
  }
1549
1589
  },
1550
1590
  "required": [
1551
- "type"
1591
+ "questionType"
1552
1592
  ]
1553
1593
  },
1554
1594
  {
@@ -1556,12 +1596,12 @@
1556
1596
  "config": {
1557
1597
  "$ref": "#/$defs/EmptyConfig"
1558
1598
  },
1559
- "type": {
1599
+ "questionType": {
1560
1600
  "const": "date"
1561
1601
  }
1562
1602
  },
1563
1603
  "required": [
1564
- "type"
1604
+ "questionType"
1565
1605
  ]
1566
1606
  },
1567
1607
  {
@@ -1569,12 +1609,12 @@
1569
1609
  "config": {
1570
1610
  "$ref": "#/$defs/AttachmentConfig"
1571
1611
  },
1572
- "type": {
1612
+ "questionType": {
1573
1613
  "const": "attachment"
1574
1614
  }
1575
1615
  },
1576
1616
  "required": [
1577
- "type"
1617
+ "questionType"
1578
1618
  ]
1579
1619
  },
1580
1620
  {
@@ -1582,12 +1622,12 @@
1582
1622
  "config": {
1583
1623
  "$ref": "#/$defs/MemberConfig"
1584
1624
  },
1585
- "type": {
1625
+ "questionType": {
1586
1626
  "const": "member"
1587
1627
  }
1588
1628
  },
1589
1629
  "required": [
1590
- "type"
1630
+ "questionType"
1591
1631
  ]
1592
1632
  },
1593
1633
  {
@@ -1595,7 +1635,7 @@
1595
1635
  "config": {
1596
1636
  "$ref": "#/$defs/ChoiceConfig"
1597
1637
  },
1598
- "type": {
1638
+ "questionType": {
1599
1639
  "enum": [
1600
1640
  "single_choice",
1601
1641
  "single_select",
@@ -1604,7 +1644,7 @@
1604
1644
  }
1605
1645
  },
1606
1646
  "required": [
1607
- "type",
1647
+ "questionType",
1608
1648
  "config"
1609
1649
  ]
1610
1650
  },
@@ -1613,12 +1653,12 @@
1613
1653
  "config": {
1614
1654
  "$ref": "#/$defs/DepartmentConfig"
1615
1655
  },
1616
- "type": {
1656
+ "questionType": {
1617
1657
  "const": "department"
1618
1658
  }
1619
1659
  },
1620
1660
  "required": [
1621
- "type",
1661
+ "questionType",
1622
1662
  "config"
1623
1663
  ]
1624
1664
  },
@@ -1627,12 +1667,12 @@
1627
1667
  "config": {
1628
1668
  "$ref": "#/$defs/RelationConfig"
1629
1669
  },
1630
- "type": {
1670
+ "questionType": {
1631
1671
  "const": "relation"
1632
1672
  }
1633
1673
  },
1634
1674
  "required": [
1635
- "type",
1675
+ "questionType",
1636
1676
  "config"
1637
1677
  ]
1638
1678
  },
@@ -1641,12 +1681,12 @@
1641
1681
  "config": {
1642
1682
  "$ref": "#/$defs/DataRelationConfig"
1643
1683
  },
1644
- "type": {
1684
+ "questionType": {
1645
1685
  "const": "data_relation"
1646
1686
  }
1647
1687
  },
1648
1688
  "required": [
1649
- "type",
1689
+ "questionType",
1650
1690
  "config"
1651
1691
  ]
1652
1692
  }
@@ -1658,11 +1698,71 @@
1658
1698
  "unevaluatedProperties": false
1659
1699
  },
1660
1700
  "SubFieldCommon": {
1661
- "description": "表格子字段的公共属性;不允许 dataTitle、dataCover 或 width。",
1701
+ "allOf": [
1702
+ {
1703
+ "if": {
1704
+ "properties": {
1705
+ "defaultType": {
1706
+ "const": 2
1707
+ }
1708
+ },
1709
+ "required": [
1710
+ "defaultType"
1711
+ ]
1712
+ },
1713
+ "then": {
1714
+ "properties": {
1715
+ "defaultValue": {
1716
+ "type": "null"
1717
+ }
1718
+ }
1719
+ }
1720
+ },
1721
+ {
1722
+ "if": {
1723
+ "properties": {
1724
+ "defaultType": {
1725
+ "const": 3
1726
+ }
1727
+ },
1728
+ "required": [
1729
+ "defaultType"
1730
+ ]
1731
+ },
1732
+ "then": {
1733
+ "properties": {
1734
+ "defaultValue": {
1735
+ "minLength": 1,
1736
+ "type": [
1737
+ "string",
1738
+ "null"
1739
+ ]
1740
+ }
1741
+ }
1742
+ }
1743
+ }
1744
+ ],
1745
+ "anyOf": [
1746
+ {
1747
+ "required": [
1748
+ "queId"
1749
+ ]
1750
+ },
1751
+ {
1752
+ "required": [
1753
+ "name"
1754
+ ]
1755
+ }
1756
+ ],
1757
+ "description": "表格子字段的公共属性;不允许 width,也不能被应用级数据标题或数据封面选择器选中。",
1662
1758
  "properties": {
1759
+ "beingRequired": {
1760
+ "description": "该子字段是否必填;缺失时保留当前值。",
1761
+ "type": "boolean"
1762
+ },
1663
1763
  "defaultType": {
1664
1764
  "default": 1,
1665
- "description": "默认值类型;1 表示静态值,2 表示关联/绑定值,3 表示公式值。",
1765
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
1666
1766
  "enum": [
1667
1767
  1,
1668
1768
  2,
@@ -1671,41 +1771,31 @@
1671
1771
  "type": "integer"
1672
1772
  },
1673
1773
  "defaultValue": {
1674
- "description": "表单填写时的默认值;显式 null 表示清除默认值。",
1675
- "type": [
1676
- "null",
1677
- "boolean",
1678
- "number",
1679
- "string",
1680
- "array",
1681
- "object"
1682
- ]
1683
- },
1684
- "description": {
1685
- "description": "子字段说明;null 或空字符串表示清空。",
1686
- "type": [
1687
- "string",
1688
- "null"
1689
- ]
1774
+ "$ref": "#/$defs/ScalarDefaultValue",
1775
+ "description": "表单填写时的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。显式 null 表示清除默认值。"
1690
1776
  },
1691
1777
  "name": {
1692
- "description": "子字段展示名称;在所属表格内唯一。",
1778
+ "description": "子字段展示名称;新增子字段必填,已有子字段可在携带 queId 时省略。",
1693
1779
  "minLength": 1,
1694
1780
  "type": "string"
1695
1781
  },
1696
1782
  "queId": {
1697
- "description": "已有子字段的后端 ID;新增时省略。",
1783
+ "description": "已有子字段的后端 ID;更新时用于精确定位并复用,新增子字段通常省略。",
1698
1784
  "minimum": 1,
1699
1785
  "type": "integer"
1700
1786
  },
1701
- "required": {
1702
- "description": "是否必填;缺失时保留当前值。",
1703
- "type": "boolean"
1787
+ "questionDescription": {
1788
+ "description": "子字段说明;null 或空字符串表示清空。",
1789
+ "type": [
1790
+ "string",
1791
+ "null"
1792
+ ]
1793
+ },
1794
+ "questionType": {
1795
+ "description": "子字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
1796
+ "type": "string"
1704
1797
  }
1705
1798
  },
1706
- "required": [
1707
- "name"
1708
- ],
1709
1799
  "type": "object"
1710
1800
  },
1711
1801
  "SubtableConfig": {
@@ -1808,19 +1898,19 @@
1808
1898
  "config": {
1809
1899
  "$ref": "#/$defs/SubtableConfig"
1810
1900
  },
1901
+ "questionType": {
1902
+ "const": "subtable"
1903
+ },
1811
1904
  "subfields": {
1812
1905
  "items": {
1813
1906
  "$ref": "#/$defs/SubField"
1814
1907
  },
1815
1908
  "minItems": 1,
1816
1909
  "type": "array"
1817
- },
1818
- "type": {
1819
- "const": "subtable"
1820
1910
  }
1821
1911
  },
1822
1912
  "required": [
1823
- "type",
1913
+ "questionType",
1824
1914
  "subfields"
1825
1915
  ]
1826
1916
  }