@qingflow-tech/qingflow-cli 1.1.42 → 1.1.43-beta.1

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 (42) hide show
  1. package/README.md +4 -4
  2. package/package.json +2 -1
  3. package/pyproject.toml +3 -2
  4. package/src/qingflow_mcp/app_form_compat.py +115 -0
  5. package/src/qingflow_mcp/app_form_validator.py +199 -0
  6. package/src/qingflow_mcp/builder_facade/app_form.py +2836 -0
  7. package/src/qingflow_mcp/builder_facade/app_form_schema.py +269 -0
  8. package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +37 -0
  9. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +1766 -0
  10. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +76 -0
  11. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +76 -0
  12. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +76 -0
  13. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +223 -0
  14. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +538 -0
  15. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +76 -0
  16. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +76 -0
  17. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +149 -0
  18. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +76 -0
  19. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +76 -0
  20. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +76 -0
  21. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +76 -0
  22. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +92 -0
  23. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +76 -0
  24. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +76 -0
  25. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +338 -0
  26. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +137 -0
  27. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +92 -0
  28. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +92 -0
  29. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +810 -0
  30. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +76 -0
  31. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +713 -0
  32. package/src/qingflow_mcp/builder_facade/service.py +5 -2
  33. package/src/qingflow_mcp/cli/commands/builder.py +91 -28
  34. package/src/qingflow_mcp/cli/json_io.py +21 -2
  35. package/src/qingflow_mcp/cli/main.py +3 -39
  36. package/src/qingflow_mcp/cloud_oauth_proxy.py +96 -3
  37. package/src/qingflow_mcp/public_surface.py +5 -2
  38. package/src/qingflow_mcp/response_trim.py +8 -0
  39. package/src/qingflow_mcp/server_app_builder.py +38 -86
  40. package/src/qingflow_mcp/server_cloud.py +66 -1
  41. package/src/qingflow_mcp/tools/ai_builder_tools.py +93 -100
  42. package/src/qingflow_mcp/tools/app_tools.py +46 -65
@@ -0,0 +1,149 @@
1
+ {
2
+ "$defs": {
3
+ "DepartmentConfig": {
4
+ "additionalProperties": false,
5
+ "description": "部门字段的可选范围配置。",
6
+ "properties": {
7
+ "departmentScope": {
8
+ "$ref": "#/$defs/DepartmentScope"
9
+ }
10
+ },
11
+ "required": [
12
+ "departmentScope"
13
+ ],
14
+ "type": "object"
15
+ },
16
+ "DepartmentScope": {
17
+ "description": "all 表示全部部门;custom 表示仅允许指定部门。",
18
+ "oneOf": [
19
+ {
20
+ "additionalProperties": false,
21
+ "properties": {
22
+ "includeSubDeparts": {
23
+ "description": "是否包含所选部门的下级部门。",
24
+ "type": "boolean"
25
+ },
26
+ "mode": {
27
+ "const": "all"
28
+ }
29
+ },
30
+ "required": [
31
+ "mode"
32
+ ],
33
+ "type": "object"
34
+ },
35
+ {
36
+ "additionalProperties": false,
37
+ "properties": {
38
+ "departments": {
39
+ "description": "custom 模式允许选择的部门列表。",
40
+ "items": {
41
+ "$ref": "#/$defs/DepartmentSelector"
42
+ },
43
+ "minItems": 1,
44
+ "type": "array"
45
+ },
46
+ "includeSubDeparts": {
47
+ "description": "是否包含指定部门的下级部门。",
48
+ "type": "boolean"
49
+ },
50
+ "mode": {
51
+ "const": "custom"
52
+ }
53
+ },
54
+ "required": [
55
+ "mode",
56
+ "departments"
57
+ ],
58
+ "type": "object"
59
+ }
60
+ ]
61
+ },
62
+ "DepartmentSelector": {
63
+ "additionalProperties": false,
64
+ "description": "部门身份;deptId 必填,deptName 仅用于展示。",
65
+ "properties": {
66
+ "deptId": {
67
+ "minimum": 1,
68
+ "type": "integer"
69
+ },
70
+ "deptName": {
71
+ "minLength": 1,
72
+ "type": "string"
73
+ }
74
+ },
75
+ "required": [
76
+ "deptId"
77
+ ],
78
+ "type": "object"
79
+ },
80
+ "FieldCommon": {
81
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
82
+ "properties": {
83
+ "dataCover": {
84
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
85
+ "type": "boolean"
86
+ },
87
+ "dataTitle": {
88
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
89
+ "type": "boolean"
90
+ },
91
+ "description": {
92
+ "description": "字段说明;null 或空字符串表示清空。",
93
+ "type": [
94
+ "string",
95
+ "null"
96
+ ]
97
+ },
98
+ "name": {
99
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
100
+ "minLength": 1,
101
+ "type": "string"
102
+ },
103
+ "queId": {
104
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
105
+ "minimum": 1,
106
+ "type": "integer"
107
+ },
108
+ "required": {
109
+ "description": "是否必填;缺失时保留已有字段当前值。",
110
+ "type": "boolean"
111
+ },
112
+ "width": {
113
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
114
+ "maximum": 100,
115
+ "minimum": 1,
116
+ "type": "integer"
117
+ }
118
+ },
119
+ "required": [
120
+ "name"
121
+ ],
122
+ "type": "object"
123
+ }
124
+ },
125
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/department.json",
126
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
127
+ "allOf": [
128
+ {
129
+ "$ref": "#/$defs/FieldCommon"
130
+ },
131
+ {
132
+ "properties": {
133
+ "config": {
134
+ "$ref": "#/$defs/DepartmentConfig"
135
+ },
136
+ "type": {
137
+ "const": "department"
138
+ }
139
+ },
140
+ "required": [
141
+ "type",
142
+ "config"
143
+ ]
144
+ }
145
+ ],
146
+ "title": "Qingflow AppForm v1alpha1 department field",
147
+ "type": "object",
148
+ "unevaluatedProperties": false
149
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$defs": {
3
+ "EmptyConfig": {
4
+ "additionalProperties": false,
5
+ "description": "该字段类型没有特殊配置。",
6
+ "type": "object"
7
+ },
8
+ "FieldCommon": {
9
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
10
+ "properties": {
11
+ "dataCover": {
12
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
13
+ "type": "boolean"
14
+ },
15
+ "dataTitle": {
16
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
17
+ "type": "boolean"
18
+ },
19
+ "description": {
20
+ "description": "字段说明;null 或空字符串表示清空。",
21
+ "type": [
22
+ "string",
23
+ "null"
24
+ ]
25
+ },
26
+ "name": {
27
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
28
+ "minLength": 1,
29
+ "type": "string"
30
+ },
31
+ "queId": {
32
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
33
+ "minimum": 1,
34
+ "type": "integer"
35
+ },
36
+ "required": {
37
+ "description": "是否必填;缺失时保留已有字段当前值。",
38
+ "type": "boolean"
39
+ },
40
+ "width": {
41
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
42
+ "maximum": 100,
43
+ "minimum": 1,
44
+ "type": "integer"
45
+ }
46
+ },
47
+ "required": [
48
+ "name"
49
+ ],
50
+ "type": "object"
51
+ }
52
+ },
53
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/email.json",
54
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
55
+ "allOf": [
56
+ {
57
+ "$ref": "#/$defs/FieldCommon"
58
+ },
59
+ {
60
+ "properties": {
61
+ "config": {
62
+ "$ref": "#/$defs/EmptyConfig"
63
+ },
64
+ "type": {
65
+ "const": "email"
66
+ }
67
+ },
68
+ "required": [
69
+ "type"
70
+ ]
71
+ }
72
+ ],
73
+ "title": "Qingflow AppForm v1alpha1 email field",
74
+ "type": "object",
75
+ "unevaluatedProperties": false
76
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$defs": {
3
+ "EmptyConfig": {
4
+ "additionalProperties": false,
5
+ "description": "该字段类型没有特殊配置。",
6
+ "type": "object"
7
+ },
8
+ "FieldCommon": {
9
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
10
+ "properties": {
11
+ "dataCover": {
12
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
13
+ "type": "boolean"
14
+ },
15
+ "dataTitle": {
16
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
17
+ "type": "boolean"
18
+ },
19
+ "description": {
20
+ "description": "字段说明;null 或空字符串表示清空。",
21
+ "type": [
22
+ "string",
23
+ "null"
24
+ ]
25
+ },
26
+ "name": {
27
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
28
+ "minLength": 1,
29
+ "type": "string"
30
+ },
31
+ "queId": {
32
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
33
+ "minimum": 1,
34
+ "type": "integer"
35
+ },
36
+ "required": {
37
+ "description": "是否必填;缺失时保留已有字段当前值。",
38
+ "type": "boolean"
39
+ },
40
+ "width": {
41
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
42
+ "maximum": 100,
43
+ "minimum": 1,
44
+ "type": "integer"
45
+ }
46
+ },
47
+ "required": [
48
+ "name"
49
+ ],
50
+ "type": "object"
51
+ }
52
+ },
53
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/link.json",
54
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
55
+ "allOf": [
56
+ {
57
+ "$ref": "#/$defs/FieldCommon"
58
+ },
59
+ {
60
+ "properties": {
61
+ "config": {
62
+ "$ref": "#/$defs/EmptyConfig"
63
+ },
64
+ "type": {
65
+ "const": "link"
66
+ }
67
+ },
68
+ "required": [
69
+ "type"
70
+ ]
71
+ }
72
+ ],
73
+ "title": "Qingflow AppForm v1alpha1 link field",
74
+ "type": "object",
75
+ "unevaluatedProperties": false
76
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$defs": {
3
+ "EmptyConfig": {
4
+ "additionalProperties": false,
5
+ "description": "该字段类型没有特殊配置。",
6
+ "type": "object"
7
+ },
8
+ "FieldCommon": {
9
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
10
+ "properties": {
11
+ "dataCover": {
12
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
13
+ "type": "boolean"
14
+ },
15
+ "dataTitle": {
16
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
17
+ "type": "boolean"
18
+ },
19
+ "description": {
20
+ "description": "字段说明;null 或空字符串表示清空。",
21
+ "type": [
22
+ "string",
23
+ "null"
24
+ ]
25
+ },
26
+ "name": {
27
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
28
+ "minLength": 1,
29
+ "type": "string"
30
+ },
31
+ "queId": {
32
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
33
+ "minimum": 1,
34
+ "type": "integer"
35
+ },
36
+ "required": {
37
+ "description": "是否必填;缺失时保留已有字段当前值。",
38
+ "type": "boolean"
39
+ },
40
+ "width": {
41
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
42
+ "maximum": 100,
43
+ "minimum": 1,
44
+ "type": "integer"
45
+ }
46
+ },
47
+ "required": [
48
+ "name"
49
+ ],
50
+ "type": "object"
51
+ }
52
+ },
53
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/long_text.json",
54
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
55
+ "allOf": [
56
+ {
57
+ "$ref": "#/$defs/FieldCommon"
58
+ },
59
+ {
60
+ "properties": {
61
+ "config": {
62
+ "$ref": "#/$defs/EmptyConfig"
63
+ },
64
+ "type": {
65
+ "const": "long_text"
66
+ }
67
+ },
68
+ "required": [
69
+ "type"
70
+ ]
71
+ }
72
+ ],
73
+ "title": "Qingflow AppForm v1alpha1 long_text field",
74
+ "type": "object",
75
+ "unevaluatedProperties": false
76
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$defs": {
3
+ "EmptyConfig": {
4
+ "additionalProperties": false,
5
+ "description": "该字段类型没有特殊配置。",
6
+ "type": "object"
7
+ },
8
+ "FieldCommon": {
9
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
10
+ "properties": {
11
+ "dataCover": {
12
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
13
+ "type": "boolean"
14
+ },
15
+ "dataTitle": {
16
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
17
+ "type": "boolean"
18
+ },
19
+ "description": {
20
+ "description": "字段说明;null 或空字符串表示清空。",
21
+ "type": [
22
+ "string",
23
+ "null"
24
+ ]
25
+ },
26
+ "name": {
27
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
28
+ "minLength": 1,
29
+ "type": "string"
30
+ },
31
+ "queId": {
32
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
33
+ "minimum": 1,
34
+ "type": "integer"
35
+ },
36
+ "required": {
37
+ "description": "是否必填;缺失时保留已有字段当前值。",
38
+ "type": "boolean"
39
+ },
40
+ "width": {
41
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
42
+ "maximum": 100,
43
+ "minimum": 1,
44
+ "type": "integer"
45
+ }
46
+ },
47
+ "required": [
48
+ "name"
49
+ ],
50
+ "type": "object"
51
+ }
52
+ },
53
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/member.json",
54
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
55
+ "allOf": [
56
+ {
57
+ "$ref": "#/$defs/FieldCommon"
58
+ },
59
+ {
60
+ "properties": {
61
+ "config": {
62
+ "$ref": "#/$defs/EmptyConfig"
63
+ },
64
+ "type": {
65
+ "const": "member"
66
+ }
67
+ },
68
+ "required": [
69
+ "type"
70
+ ]
71
+ }
72
+ ],
73
+ "title": "Qingflow AppForm v1alpha1 member field",
74
+ "type": "object",
75
+ "unevaluatedProperties": false
76
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "$defs": {
3
+ "ChoiceConfig": {
4
+ "additionalProperties": false,
5
+ "description": "选择类字段配置。",
6
+ "properties": {
7
+ "options": {
8
+ "description": "非空有序选项文案;缺失选项表示从该字段配置中删除。",
9
+ "items": {
10
+ "minLength": 1,
11
+ "type": "string"
12
+ },
13
+ "minItems": 1,
14
+ "type": "array",
15
+ "uniqueItems": true
16
+ }
17
+ },
18
+ "required": [
19
+ "options"
20
+ ],
21
+ "type": "object"
22
+ },
23
+ "FieldCommon": {
24
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
25
+ "properties": {
26
+ "dataCover": {
27
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
28
+ "type": "boolean"
29
+ },
30
+ "dataTitle": {
31
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
32
+ "type": "boolean"
33
+ },
34
+ "description": {
35
+ "description": "字段说明;null 或空字符串表示清空。",
36
+ "type": [
37
+ "string",
38
+ "null"
39
+ ]
40
+ },
41
+ "name": {
42
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
43
+ "minLength": 1,
44
+ "type": "string"
45
+ },
46
+ "queId": {
47
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
48
+ "minimum": 1,
49
+ "type": "integer"
50
+ },
51
+ "required": {
52
+ "description": "是否必填;缺失时保留已有字段当前值。",
53
+ "type": "boolean"
54
+ },
55
+ "width": {
56
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
57
+ "maximum": 100,
58
+ "minimum": 1,
59
+ "type": "integer"
60
+ }
61
+ },
62
+ "required": [
63
+ "name"
64
+ ],
65
+ "type": "object"
66
+ }
67
+ },
68
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/multi_select.json",
69
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
70
+ "allOf": [
71
+ {
72
+ "$ref": "#/$defs/FieldCommon"
73
+ },
74
+ {
75
+ "properties": {
76
+ "config": {
77
+ "$ref": "#/$defs/ChoiceConfig"
78
+ },
79
+ "type": {
80
+ "const": "multi_select"
81
+ }
82
+ },
83
+ "required": [
84
+ "type",
85
+ "config"
86
+ ]
87
+ }
88
+ ],
89
+ "title": "Qingflow AppForm v1alpha1 multi_select field",
90
+ "type": "object",
91
+ "unevaluatedProperties": false
92
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$defs": {
3
+ "EmptyConfig": {
4
+ "additionalProperties": false,
5
+ "description": "该字段类型没有特殊配置。",
6
+ "type": "object"
7
+ },
8
+ "FieldCommon": {
9
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
10
+ "properties": {
11
+ "dataCover": {
12
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
13
+ "type": "boolean"
14
+ },
15
+ "dataTitle": {
16
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
17
+ "type": "boolean"
18
+ },
19
+ "description": {
20
+ "description": "字段说明;null 或空字符串表示清空。",
21
+ "type": [
22
+ "string",
23
+ "null"
24
+ ]
25
+ },
26
+ "name": {
27
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
28
+ "minLength": 1,
29
+ "type": "string"
30
+ },
31
+ "queId": {
32
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
33
+ "minimum": 1,
34
+ "type": "integer"
35
+ },
36
+ "required": {
37
+ "description": "是否必填;缺失时保留已有字段当前值。",
38
+ "type": "boolean"
39
+ },
40
+ "width": {
41
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
42
+ "maximum": 100,
43
+ "minimum": 1,
44
+ "type": "integer"
45
+ }
46
+ },
47
+ "required": [
48
+ "name"
49
+ ],
50
+ "type": "object"
51
+ }
52
+ },
53
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1/fields/number.json",
54
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
55
+ "allOf": [
56
+ {
57
+ "$ref": "#/$defs/FieldCommon"
58
+ },
59
+ {
60
+ "properties": {
61
+ "config": {
62
+ "$ref": "#/$defs/EmptyConfig"
63
+ },
64
+ "type": {
65
+ "const": "number"
66
+ }
67
+ },
68
+ "required": [
69
+ "type"
70
+ ]
71
+ }
72
+ ],
73
+ "title": "Qingflow AppForm v1alpha1 number field",
74
+ "type": "object",
75
+ "unevaluatedProperties": false
76
+ }