@qingflow-tech/qingflow-cli 1.1.62-beta.2 → 1.1.63-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.
- package/README.md +3 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/qingflow_mcp/builder_facade/app_form.py +5 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +59 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +59 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +59 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +59 -0
- package/src/qingflow_mcp/tools/record_tools.py +37 -2
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.63-beta.1
|
|
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.63-beta.1 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.63-beta.1 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.
|
|
3
|
+
"version": "1.1.63-beta.1",
|
|
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
|
@@ -876,6 +876,7 @@ class AppFormNormalizer:
|
|
|
876
876
|
"maxValue": question.get("maxValue"),
|
|
877
877
|
"decimalDigit": question.get("decimalDigit"),
|
|
878
878
|
"numberFormat": question.get("numberFormat"),
|
|
879
|
+
"numberFormatOptions": question.get("numberFormatOptions"),
|
|
879
880
|
"currencyStatus": question.get("currencyStatus"),
|
|
880
881
|
"currencyType": question.get("currencyType"),
|
|
881
882
|
"canDecimal": question.get("canDecimal"),
|
|
@@ -2563,6 +2564,10 @@ class AppFormCompiler:
|
|
|
2563
2564
|
for key in ("numberLimitStatus", "minValue", "maxValue", "decimalDigit", "numberFormat", "currencyStatus", "currencyType", "canDecimal", "noRepeat", "canScan", "scanType"):
|
|
2564
2565
|
if key in config:
|
|
2565
2566
|
question[key] = config[key]
|
|
2567
|
+
# 新数字格式配置存于 question_extra_attr,经 POST /form 的同名对象回写;
|
|
2568
|
+
# 不配置时保留 _question_template 携带的现值,避免 round-trip 丢失.
|
|
2569
|
+
if isinstance(config.get("numberFormatOptions"), dict):
|
|
2570
|
+
question["numberFormatOptions"] = deepcopy(config["numberFormatOptions"])
|
|
2566
2571
|
if field_type == "amount" and "canDecimal" not in question:
|
|
2567
2572
|
question["canDecimal"] = True
|
|
2568
2573
|
elif field_type in CHOICE_TYPES:
|
|
@@ -1660,6 +1660,65 @@
|
|
|
1660
1660
|
"null"
|
|
1661
1661
|
]
|
|
1662
1662
|
},
|
|
1663
|
+
"numberFormatOptions": {
|
|
1664
|
+
"description": "新数字格式配置,存于字段扩展属性(question_extra_attr),与旧 numberFormat/canDecimal 相互独立;style 非空即生效,小数位缺省时按后端默认最多 10 位;传对象写入配置,null 或缺省沿用现值。",
|
|
1665
|
+
"oneOf": [
|
|
1666
|
+
{
|
|
1667
|
+
"type": "null"
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
"additionalProperties": false,
|
|
1671
|
+
"properties": {
|
|
1672
|
+
"maximumFractionDigits": {
|
|
1673
|
+
"description": "最多小数位(0-10);0 表示仅整数。",
|
|
1674
|
+
"maximum": 10,
|
|
1675
|
+
"minimum": 0,
|
|
1676
|
+
"type": [
|
|
1677
|
+
"integer",
|
|
1678
|
+
"null"
|
|
1679
|
+
]
|
|
1680
|
+
},
|
|
1681
|
+
"minimumFractionDigits": {
|
|
1682
|
+
"description": "最少小数位(0-10)。",
|
|
1683
|
+
"maximum": 10,
|
|
1684
|
+
"minimum": 0,
|
|
1685
|
+
"type": [
|
|
1686
|
+
"integer",
|
|
1687
|
+
"null"
|
|
1688
|
+
]
|
|
1689
|
+
},
|
|
1690
|
+
"minimumIntegerDigits": {
|
|
1691
|
+
"description": "最少整数位(1-21)。",
|
|
1692
|
+
"maximum": 21,
|
|
1693
|
+
"minimum": 1,
|
|
1694
|
+
"type": [
|
|
1695
|
+
"integer",
|
|
1696
|
+
"null"
|
|
1697
|
+
]
|
|
1698
|
+
},
|
|
1699
|
+
"style": {
|
|
1700
|
+
"description": "数字样式:decimal 普通数字,percent 百分比。",
|
|
1701
|
+
"enum": [
|
|
1702
|
+
"decimal",
|
|
1703
|
+
"percent"
|
|
1704
|
+
],
|
|
1705
|
+
"type": "string"
|
|
1706
|
+
},
|
|
1707
|
+
"useGrouping": {
|
|
1708
|
+
"description": "是否显示千分位分隔符。",
|
|
1709
|
+
"type": [
|
|
1710
|
+
"boolean",
|
|
1711
|
+
"null"
|
|
1712
|
+
]
|
|
1713
|
+
}
|
|
1714
|
+
},
|
|
1715
|
+
"required": [
|
|
1716
|
+
"style"
|
|
1717
|
+
],
|
|
1718
|
+
"type": "object"
|
|
1719
|
+
}
|
|
1720
|
+
]
|
|
1721
|
+
},
|
|
1663
1722
|
"numberLimitStatus": {
|
|
1664
1723
|
"description": "是否启用最小值和最大值限制。",
|
|
1665
1724
|
"type": [
|
|
@@ -180,6 +180,65 @@
|
|
|
180
180
|
"null"
|
|
181
181
|
]
|
|
182
182
|
},
|
|
183
|
+
"numberFormatOptions": {
|
|
184
|
+
"description": "新数字格式配置,存于字段扩展属性(question_extra_attr),与旧 numberFormat/canDecimal 相互独立;style 非空即生效,小数位缺省时按后端默认最多 10 位;传对象写入配置,null 或缺省沿用现值。",
|
|
185
|
+
"oneOf": [
|
|
186
|
+
{
|
|
187
|
+
"type": "null"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"properties": {
|
|
192
|
+
"maximumFractionDigits": {
|
|
193
|
+
"description": "最多小数位(0-10);0 表示仅整数。",
|
|
194
|
+
"maximum": 10,
|
|
195
|
+
"minimum": 0,
|
|
196
|
+
"type": [
|
|
197
|
+
"integer",
|
|
198
|
+
"null"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"minimumFractionDigits": {
|
|
202
|
+
"description": "最少小数位(0-10)。",
|
|
203
|
+
"maximum": 10,
|
|
204
|
+
"minimum": 0,
|
|
205
|
+
"type": [
|
|
206
|
+
"integer",
|
|
207
|
+
"null"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"minimumIntegerDigits": {
|
|
211
|
+
"description": "最少整数位(1-21)。",
|
|
212
|
+
"maximum": 21,
|
|
213
|
+
"minimum": 1,
|
|
214
|
+
"type": [
|
|
215
|
+
"integer",
|
|
216
|
+
"null"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"style": {
|
|
220
|
+
"description": "数字样式:decimal 普通数字,percent 百分比。",
|
|
221
|
+
"enum": [
|
|
222
|
+
"decimal",
|
|
223
|
+
"percent"
|
|
224
|
+
],
|
|
225
|
+
"type": "string"
|
|
226
|
+
},
|
|
227
|
+
"useGrouping": {
|
|
228
|
+
"description": "是否显示千分位分隔符。",
|
|
229
|
+
"type": [
|
|
230
|
+
"boolean",
|
|
231
|
+
"null"
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"required": [
|
|
236
|
+
"style"
|
|
237
|
+
],
|
|
238
|
+
"type": "object"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
},
|
|
183
242
|
"numberLimitStatus": {
|
|
184
243
|
"description": "是否启用最小值和最大值限制。",
|
|
185
244
|
"type": [
|
|
@@ -180,6 +180,65 @@
|
|
|
180
180
|
"null"
|
|
181
181
|
]
|
|
182
182
|
},
|
|
183
|
+
"numberFormatOptions": {
|
|
184
|
+
"description": "新数字格式配置,存于字段扩展属性(question_extra_attr),与旧 numberFormat/canDecimal 相互独立;style 非空即生效,小数位缺省时按后端默认最多 10 位;传对象写入配置,null 或缺省沿用现值。",
|
|
185
|
+
"oneOf": [
|
|
186
|
+
{
|
|
187
|
+
"type": "null"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"properties": {
|
|
192
|
+
"maximumFractionDigits": {
|
|
193
|
+
"description": "最多小数位(0-10);0 表示仅整数。",
|
|
194
|
+
"maximum": 10,
|
|
195
|
+
"minimum": 0,
|
|
196
|
+
"type": [
|
|
197
|
+
"integer",
|
|
198
|
+
"null"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"minimumFractionDigits": {
|
|
202
|
+
"description": "最少小数位(0-10)。",
|
|
203
|
+
"maximum": 10,
|
|
204
|
+
"minimum": 0,
|
|
205
|
+
"type": [
|
|
206
|
+
"integer",
|
|
207
|
+
"null"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"minimumIntegerDigits": {
|
|
211
|
+
"description": "最少整数位(1-21)。",
|
|
212
|
+
"maximum": 21,
|
|
213
|
+
"minimum": 1,
|
|
214
|
+
"type": [
|
|
215
|
+
"integer",
|
|
216
|
+
"null"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"style": {
|
|
220
|
+
"description": "数字样式:decimal 普通数字,percent 百分比。",
|
|
221
|
+
"enum": [
|
|
222
|
+
"decimal",
|
|
223
|
+
"percent"
|
|
224
|
+
],
|
|
225
|
+
"type": "string"
|
|
226
|
+
},
|
|
227
|
+
"useGrouping": {
|
|
228
|
+
"description": "是否显示千分位分隔符。",
|
|
229
|
+
"type": [
|
|
230
|
+
"boolean",
|
|
231
|
+
"null"
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"required": [
|
|
236
|
+
"style"
|
|
237
|
+
],
|
|
238
|
+
"type": "object"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
},
|
|
183
242
|
"numberLimitStatus": {
|
|
184
243
|
"description": "是否启用最小值和最大值限制。",
|
|
185
244
|
"type": [
|
|
@@ -1323,6 +1323,65 @@
|
|
|
1323
1323
|
"null"
|
|
1324
1324
|
]
|
|
1325
1325
|
},
|
|
1326
|
+
"numberFormatOptions": {
|
|
1327
|
+
"description": "新数字格式配置,存于字段扩展属性(question_extra_attr),与旧 numberFormat/canDecimal 相互独立;style 非空即生效,小数位缺省时按后端默认最多 10 位;传对象写入配置,null 或缺省沿用现值。",
|
|
1328
|
+
"oneOf": [
|
|
1329
|
+
{
|
|
1330
|
+
"type": "null"
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
"additionalProperties": false,
|
|
1334
|
+
"properties": {
|
|
1335
|
+
"maximumFractionDigits": {
|
|
1336
|
+
"description": "最多小数位(0-10);0 表示仅整数。",
|
|
1337
|
+
"maximum": 10,
|
|
1338
|
+
"minimum": 0,
|
|
1339
|
+
"type": [
|
|
1340
|
+
"integer",
|
|
1341
|
+
"null"
|
|
1342
|
+
]
|
|
1343
|
+
},
|
|
1344
|
+
"minimumFractionDigits": {
|
|
1345
|
+
"description": "最少小数位(0-10)。",
|
|
1346
|
+
"maximum": 10,
|
|
1347
|
+
"minimum": 0,
|
|
1348
|
+
"type": [
|
|
1349
|
+
"integer",
|
|
1350
|
+
"null"
|
|
1351
|
+
]
|
|
1352
|
+
},
|
|
1353
|
+
"minimumIntegerDigits": {
|
|
1354
|
+
"description": "最少整数位(1-21)。",
|
|
1355
|
+
"maximum": 21,
|
|
1356
|
+
"minimum": 1,
|
|
1357
|
+
"type": [
|
|
1358
|
+
"integer",
|
|
1359
|
+
"null"
|
|
1360
|
+
]
|
|
1361
|
+
},
|
|
1362
|
+
"style": {
|
|
1363
|
+
"description": "数字样式:decimal 普通数字,percent 百分比。",
|
|
1364
|
+
"enum": [
|
|
1365
|
+
"decimal",
|
|
1366
|
+
"percent"
|
|
1367
|
+
],
|
|
1368
|
+
"type": "string"
|
|
1369
|
+
},
|
|
1370
|
+
"useGrouping": {
|
|
1371
|
+
"description": "是否显示千分位分隔符。",
|
|
1372
|
+
"type": [
|
|
1373
|
+
"boolean",
|
|
1374
|
+
"null"
|
|
1375
|
+
]
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1378
|
+
"required": [
|
|
1379
|
+
"style"
|
|
1380
|
+
],
|
|
1381
|
+
"type": "object"
|
|
1382
|
+
}
|
|
1383
|
+
]
|
|
1384
|
+
},
|
|
1326
1385
|
"numberLimitStatus": {
|
|
1327
1386
|
"description": "是否启用最小值和最大值限制。",
|
|
1328
1387
|
"type": [
|
|
@@ -18694,6 +18694,41 @@ def _coerce_amount(value: JSONValue) -> float | None:
|
|
|
18694
18694
|
return None
|
|
18695
18695
|
|
|
18696
18696
|
|
|
18697
|
+
def _decimal_flag_allows_decimal(value: JSONValue) -> bool:
|
|
18698
|
+
"""兼容历史数据里 canDecimal 以字符串形态落库的情况("yes"/"true" 视为开,其余视为关)."""
|
|
18699
|
+
if value is True:
|
|
18700
|
+
return True
|
|
18701
|
+
if isinstance(value, str):
|
|
18702
|
+
return value.strip().lower() in {"true", "yes", "1"}
|
|
18703
|
+
return False
|
|
18704
|
+
|
|
18705
|
+
|
|
18706
|
+
def _number_format_options_allow_decimal(raw: JSONObject | None) -> bool:
|
|
18707
|
+
"""新数字格式配置(numberFormatOptions,存于 question_extra_attr)是否允许小数.
|
|
18708
|
+
|
|
18709
|
+
后端语义(NumberFormatOptions.normalize/fromColumns):style 非空才算新格式生效;
|
|
18710
|
+
maximumFractionDigits 未填时默认 MAX_FRACTION_DIGITS=10;为 0 表示仅整数.
|
|
18711
|
+
"""
|
|
18712
|
+
options = (raw or {}).get("numberFormatOptions") if isinstance(raw, dict) else None
|
|
18713
|
+
if not isinstance(options, dict):
|
|
18714
|
+
return False
|
|
18715
|
+
if not _normalize_optional_text(options.get("style")):
|
|
18716
|
+
return False
|
|
18717
|
+
maximum = _coerce_count(options.get("maximumFractionDigits"))
|
|
18718
|
+
if maximum is None:
|
|
18719
|
+
return True
|
|
18720
|
+
minimum = _coerce_count(options.get("minimumFractionDigits")) or 0
|
|
18721
|
+
return maximum > 0 or minimum > 0
|
|
18722
|
+
|
|
18723
|
+
|
|
18724
|
+
def _number_field_allows_decimal(field: FormField) -> bool:
|
|
18725
|
+
"""数字字段能否写小数:旧开关 canDecimal 或新 numberFormatOptions 任一生效即可."""
|
|
18726
|
+
raw = field.raw if isinstance(field.raw, dict) else {}
|
|
18727
|
+
if _decimal_flag_allows_decimal(raw.get("canDecimal")):
|
|
18728
|
+
return True
|
|
18729
|
+
return _number_format_options_allow_decimal(raw)
|
|
18730
|
+
|
|
18731
|
+
|
|
18697
18732
|
def _normalize_amount_value_for_write(field: FormField, value: JSONValue) -> str:
|
|
18698
18733
|
if isinstance(value, bool) or value is None:
|
|
18699
18734
|
raise RecordInputError(
|
|
@@ -18741,7 +18776,7 @@ def _normalize_amount_value_for_write(field: FormField, value: JSONValue) -> str
|
|
|
18741
18776
|
details={"field": _field_ref_payload(field), "received_value": value},
|
|
18742
18777
|
)
|
|
18743
18778
|
|
|
18744
|
-
allow_decimal =
|
|
18779
|
+
allow_decimal = _number_field_allows_decimal(field)
|
|
18745
18780
|
if not allow_decimal:
|
|
18746
18781
|
integral_value = decimal_value.to_integral_value()
|
|
18747
18782
|
if decimal_value != integral_value:
|
|
@@ -20927,7 +20962,7 @@ def _write_format_for_field(field: FormField) -> JSONObject:
|
|
|
20927
20962
|
if field.que_type in DATE_QUE_TYPES:
|
|
20928
20963
|
return _write_support_payload(support_level="full", kind="date_string", examples=["2026-03-13 10:00:00"])
|
|
20929
20964
|
if field.que_type == 8:
|
|
20930
|
-
allow_decimal =
|
|
20965
|
+
allow_decimal = _number_field_allows_decimal(field)
|
|
20931
20966
|
payload = _write_support_payload(
|
|
20932
20967
|
support_level="full",
|
|
20933
20968
|
kind="amount_number",
|