@qingflow-tech/qingflow-cli 1.1.2 → 1.1.34

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 (103) hide show
  1. package/README.md +2 -2
  2. package/docs/local-agent-install.md +10 -0
  3. package/package.json +1 -1
  4. package/pyproject.toml +1 -1
  5. package/skills/qingflow-cli/SKILL.md +61 -47
  6. package/skills/qingflow-cli/manifest.yaml +1 -1
  7. package/skills/qingflow-cli/reference/00-INDEX.md +35 -0
  8. package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_APP_DELIVERY_WORKFLOW.md +21 -477
  9. package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +44 -290
  10. package/skills/qingflow-cli/reference/QINGFLOW_CLI_SCHEMA_APPLY_FIELD_TYPES_AND_SCENARIOS.md +11 -102
  11. package/skills/qingflow-cli/reference/builder/10-build-single-app.md +57 -0
  12. package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +84 -0
  13. package/skills/qingflow-cli/reference/builder/30-schema-fields.md +317 -0
  14. package/skills/qingflow-cli/reference/builder/40-layout.md +70 -0
  15. package/skills/qingflow-cli/reference/builder/50-views.md +540 -0
  16. package/skills/qingflow-cli/reference/builder/60-charts.md +328 -0
  17. package/skills/qingflow-cli/reference/builder/70-portal.md +372 -0
  18. package/skills/qingflow-cli/reference/builder/80-buttons-associated-resources.md +148 -0
  19. package/skills/qingflow-cli/reference/builder/90-workflow.md +35 -0
  20. package/skills/qingflow-cli/reference/builder/99-publish-verify.md +64 -0
  21. package/skills/qingflow-cli/reference/builder/README.md +62 -0
  22. package/skills/qingflow-cli/reference/builder/code-integrations/README.md +130 -0
  23. package/skills/qingflow-cli/reference/builder/code-integrations/code-block.md +66 -0
  24. package/skills/qingflow-cli/reference/builder/code-integrations/q-linker.md +77 -0
  25. package/skills/qingflow-cli/reference/builder/reference/app-delivery-sop.md +508 -0
  26. package/skills/qingflow-cli/reference/builder/reference/match-rules.md +229 -0
  27. package/skills/qingflow-cli/reference/builder/reference/workspace-icons.md +89 -0
  28. package/skills/qingflow-cli/reference/builder/workflow/01-overview.md +48 -0
  29. package/skills/qingflow-cli/reference/builder/workflow/02-update-mode.md +63 -0
  30. package/skills/qingflow-cli/reference/builder/workflow/03-flow-patterns.md +59 -0
  31. package/skills/qingflow-cli/reference/builder/workflow/04-stage1-business-modeling.md +131 -0
  32. package/skills/qingflow-cli/reference/builder/workflow/05-stage2-members-roles.md +29 -0
  33. package/skills/qingflow-cli/reference/builder/workflow/06-stage3-build-spec.md +211 -0
  34. package/skills/qingflow-cli/reference/builder/workflow/07-stage4-validate-spec.md +36 -0
  35. package/skills/qingflow-cli/reference/builder/workflow/08-stage5-apply-verify.md +66 -0
  36. package/skills/qingflow-cli/reference/builder/workflow/09-stage6-summary.md +88 -0
  37. package/skills/qingflow-cli/reference/builder/workflow/10-node-config-reference.md +93 -0
  38. package/skills/qingflow-cli/reference/builder/workflow/11-troubleshooting.md +18 -0
  39. package/skills/qingflow-cli/reference/builder/workflow/README.md +88 -0
  40. package/skills/qingflow-cli/reference/builder/workflow/workflow-schema.json +1754 -0
  41. package/skills/qingflow-cli/reference/charts_upsert_dashboard_starter.example.json +81 -0
  42. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_ADMIN_CHEATSHEET.md +94 -0
  43. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md +139 -0
  44. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_EXPLORATION_REPORT.md +84 -0
  45. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_FIELD_DATA_TYPES.md +129 -0
  46. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_MEMBER_CHEATSHEET.md +195 -0
  47. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md +159 -0
  48. package/skills/qingflow-cli/reference/examples/README.md +17 -0
  49. package/skills/qingflow-cli/reference/examples/associated/associated_resources_semantic_full.example.json +50 -0
  50. package/skills/qingflow-cli/reference/examples/buttons/custom_buttons_advanced.example.json +56 -0
  51. package/skills/qingflow-cli/reference/examples/charts/charts_remove.example.json +1 -0
  52. package/skills/qingflow-cli/reference/examples/charts/charts_reorder.example.json +1 -0
  53. package/skills/qingflow-cli/reference/examples/charts/charts_upsert_bar.example.json +8 -0
  54. package/skills/qingflow-cli/reference/examples/charts/charts_upsert_dashboard_starter.example.json +118 -0
  55. package/skills/qingflow-cli/reference/examples/charts/charts_upsert_minimal.example.json +13 -0
  56. package/skills/qingflow-cli/reference/examples/layout/layout_sections_full.example.json +22 -0
  57. package/skills/qingflow-cli/reference/examples/portal/portal_sections_all_types.example.json +145 -0
  58. package/skills/qingflow-cli/reference/examples/portal/portal_sections_five_types.example.json +126 -0
  59. package/skills/qingflow-cli/reference/examples/portal/portal_sections_standard_workbench.example.json +178 -0
  60. package/skills/qingflow-cli/reference/examples/record/record_insert_all_field_types.example.json +35 -0
  61. package/skills/qingflow-cli/reference/examples/schema/_batch_schema_complex.json +18 -0
  62. package/skills/qingflow-cli/reference/examples/schema/_batch_schema_scalar.json +17 -0
  63. package/skills/qingflow-cli/reference/examples/schema/schema_add_fields_minimal.example.json +7 -0
  64. package/skills/qingflow-cli/reference/examples/schema/schema_apply_add_fields_all_types.json +78 -0
  65. package/skills/qingflow-cli/reference/examples/schema/schema_multi_app_form_relation_layout.example.json +166 -0
  66. package/skills/qingflow-cli/reference/examples/schema/schema_single_app_form_standard.example.json +95 -0
  67. package/skills/qingflow-cli/reference/examples/views/views_batch_full.example.json +159 -0
  68. package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json +42 -0
  69. package/skills/qingflow-cli/reference/portal_sections_all_types.example.json +18 -4
  70. package/skills/qingflow-cli/reference/portal_sections_five_types.example.json +3 -3
  71. package/skills/qingflow-cli/reference/portal_sections_standard_workbench.example.json +57 -7
  72. package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md +22 -0
  73. package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_DELETE_WORKFLOW.md +31 -0
  74. package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md +176 -0
  75. package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md +167 -0
  76. package/skills/qingflow-cli/reference/record/analysis/README.md +130 -0
  77. package/skills/qingflow-cli/reference/record/analysis/analysis-gotchas.md +91 -0
  78. package/skills/qingflow-cli/reference/record/analysis/analysis-patterns.md +112 -0
  79. package/skills/qingflow-cli/reference/record/analysis/business-context.md +74 -0
  80. package/skills/qingflow-cli/reference/record/analysis/confidence-reporting.md +69 -0
  81. package/skills/qingflow-cli/reference/record/analysis/data-access-playbook.md +106 -0
  82. package/skills/qingflow-cli/reference/record/analysis/pandas-recipes.md +172 -0
  83. package/skills/qingflow-cli/reference/record/analysis/report-format.md +76 -0
  84. package/skills/qingflow-cli/reference/record/insert/README.md +125 -0
  85. package/skills/qingflow-cli/reference/schema_apply_add_fields_all_types.json +1 -1
  86. package/skills/qingflow-cli/reference/task/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md +153 -0
  87. package/skills/qingflow-cli/reference/task/ops/README.md +134 -0
  88. package/skills/qingflow-cli/reference/task/ops/environments.md +43 -0
  89. package/skills/qingflow-cli/reference/task/ops/workflow-usage.md +29 -0
  90. package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +42 -7
  91. package/skills/qingflow-cli/scripts/validate_system_build_summary.py +124 -0
  92. package/skills/qingflow-cli/scripts/workflow/diff_flow_spec.py +275 -0
  93. package/skills/qingflow-cli/scripts/workflow/validate_flow_spec.py +627 -0
  94. package/src/qingflow_mcp/builder_facade/models.py +413 -119
  95. package/src/qingflow_mcp/builder_facade/service.py +4238 -666
  96. package/src/qingflow_mcp/cli/commands/builder.py +232 -75
  97. package/src/qingflow_mcp/cli/main.py +34 -0
  98. package/src/qingflow_mcp/public_surface.py +10 -0
  99. package/src/qingflow_mcp/server_app_builder.py +62 -34
  100. package/src/qingflow_mcp/solution/compiler/workflow_compiler.py +173 -0
  101. package/src/qingflow_mcp/solution/executor.py +2 -0
  102. package/src/qingflow_mcp/tools/ai_builder_tools.py +2649 -457
  103. package/src/qingflow_mcp/tools/record_tools.py +23 -11
@@ -0,0 +1,62 @@
1
+ # Builder Index
2
+
3
+ This directory is for Qingflow system-building work through `qingflow builder ...`.
4
+
5
+ ## Choose the main path
6
+
7
+ | Situation | Read |
8
+ |-----------|------|
9
+ | User asks for one app only | [10-build-single-app.md](./10-build-single-app.md) |
10
+ | User asks for a complete system, app package, or several related apps | [20-build-complete-system.md](./20-build-complete-system.md) |
11
+ | User asks to change one existing resource | Read that resource document directly: [fields](./30-schema-fields.md), [layout](./40-layout.md), [views](./50-views.md), [charts](./60-charts.md), [portal](./70-portal.md), [associated resources](./80-buttons-associated-resources.md), or [workflow](./90-workflow.md) |
12
+
13
+ ## Decision gate before writing
14
+
15
+ | Evidence | Action |
16
+ |----------|--------|
17
+ | User gives an `app_key`, `view_key`, `chart_id`, `dash_key`, or exact existing package id | Treat the task as an update to that existing target unless the user explicitly asks for a new one |
18
+ | User names several business objects/forms/modules, or asks for a “系统 / 应用包” | Use the complete-system path; do not compress them into one app |
19
+ | Same or very similar package/app already exists and user did not say extend or replace | Stop and ask whether to extend existing, repair missing parts, or create a new package/app |
20
+ | Existing readback already contains part of the requested system | List the verified existing resources, identify gaps, and patch only missing/incorrect slices |
21
+ | Write timed out, returned `partial_success`, `write_executed=true`, or `safe_to_retry=false` | Read back before retrying; do not create `V2`, `测试`, timestamp, or random-suffix resources |
22
+
23
+ ## Default build order
24
+
25
+ ```text
26
+ package -> schema/apps with form -> workflow if requested/needed -> views -> portal with chart -> publish/readback verify
27
+ ```
28
+
29
+ Rules:
30
+
31
+ - Complete systems create app shells, fields, relation fields, and form layout with one `builder schema apply --apps-file` call.
32
+ - Complete systems use exactly one main schema shape: `{package_id, apps}`, with each app carrying `client_key + app_name + icon + color + form`.
33
+ - Same-batch relations use `relation.target_app_ref` pointing to another `apps[].client_key`; do not create apps first just to get `target_app_key`.
34
+ - Complete systems and new single apps define fields through `form`; fields and form sections/rows are one creation intent.
35
+ - Do not use `add_fields`, separate `layout` payloads, or `builder layout apply` for new app creation. Use them only for existing-app maintenance.
36
+ - Single-app builds use one app path; do not add relation fields unless the user asks for cross-app modeling.
37
+ - Workflow is conditional: build it only when the user asks for approval, fill/copy, reminders, process routing, task handling, or the business process clearly cannot work without it.
38
+ - Portal chart sections use one `chart` field: `{"chart_id":"..."}` to reuse an existing QingBI chart, or `{"app_key":"...","name":"...","chart_type":"...",...}` to create/update the needed chart inline.
39
+ - Buttons are part of the view design: declare them in the target view with `action_buttons`.
40
+ - Update instructions live inside the resource document. Do not use `update-*` as a separate main route.
41
+ - Batch read, batch write, and patch are resource-specific variants, not separate workflows.
42
+
43
+ ## File responsibilities
44
+
45
+ | File | Responsibility |
46
+ |------|----------------|
47
+ | [10-build-single-app.md](./10-build-single-app.md) | One-app delivery order and completion standard |
48
+ | [20-build-complete-system.md](./20-build-complete-system.md) | Multi-app package delivery order and relation strategy |
49
+ | [30-schema-fields.md](./30-schema-fields.md) | Field types, schema apply, data title/cover, schema updates |
50
+ | [40-layout.md](./40-layout.md) | Existing-app form layout maintenance only; new app creation uses `form` in schema apply |
51
+ | [50-views.md](./50-views.md) | Table/card/board/gantt views, filters, query panel, view patches, ordinary view action buttons |
52
+ | [60-charts.md](./60-charts.md) | Standalone QingBI chart maintenance; portal dashboards normally use section `chart` for missing reports |
53
+ | [70-portal.md](./70-portal.md) | Portal apply/delete, standard workbench layout, component config, section `chart` |
54
+ | [80-buttons-associated-resources.md](./80-buttons-associated-resources.md) | Associated views/reports and context mappings; standalone button maintenance only when the user explicitly asks to maintain existing button bodies outside view design |
55
+ | [90-workflow.md](./90-workflow.md) | WorkflowSpec, patch_nodes, workflow verification |
56
+ | [99-publish-verify.md](./99-publish-verify.md) | Publish verification, partial success, readback-before-retry |
57
+
58
+ ## Example files
59
+
60
+ Use [../examples/README.md](../examples/README.md) as the example index. Main build documents stay concise; full JSON bases live under `reference/examples/<resource>/`.
61
+
62
+ Low-level historical notes start from [reference/app-delivery-sop.md](./reference/app-delivery-sop.md). Do not use them to choose the app/relation/layout creation path; the current creation path is this index plus [20-build-complete-system.md](./20-build-complete-system.md) and [30-schema-fields.md](./30-schema-fields.md).
@@ -0,0 +1,130 @@
1
+ # Qingflow CLI Code Block / Q-Linker Builder
2
+
3
+ Use this section when the user wants to build or repair:
4
+ - `code_block` fields
5
+ - `q_linker` fields
6
+ - output alias parsing
7
+ - target field binding
8
+ - form configurations that depend on code block or Q-Linker relations
9
+
10
+ Do not use this section for generic field CRUD or runtime execution debugging unless those are strictly supporting code block or Q-Linker configuration work.
11
+
12
+ ## Core Rule
13
+
14
+ Treat code blocks and Q-Linkers as **integration fields**, not ordinary fields.
15
+
16
+ For both of them, the public builder request may look like one step, but the real backend form structure has multiple layers. Never invent a new backend meaning. Only compile into the backend structures that already exist.
17
+
18
+ ## Mental Model
19
+
20
+ ### Code block
21
+
22
+ There are three conceptual layers:
23
+
24
+ 1. Code block field itself
25
+ 2. Parsed output aliases
26
+ 3. Target field bindings
27
+
28
+ Current builder support:
29
+ - configure the code block field itself
30
+ - configure input insertion into code content
31
+ - configure alias parsing
32
+
33
+ Important:
34
+ - keep `qf_output = {...}` as a plain assignment
35
+ - do not emit `const qf_output =` or `let qf_output =`
36
+
37
+ ### Q-Linker
38
+
39
+ There are two conceptual layers:
40
+
41
+ 1. Q-Linker field itself via `remoteLookupConfig`
42
+ 2. Target field bindings via relation-default + `questionRelations(relationType=Q_LINKER)`
43
+
44
+ Current builder support:
45
+ - one-step high-level config through `q_linker_binding`
46
+ - internal compilation into existing backend payloads
47
+
48
+ ## Operating Order
49
+
50
+ For code block or Q-Linker work, use this order:
51
+
52
+ 1. Resolve the app and read fields:
53
+ - `qingflow builder app resolve`
54
+ - `qingflow builder app get fields`
55
+ 2. Confirm the target field set already exists.
56
+ 3. Apply schema updates with `qingflow builder schema apply`.
57
+ 4. Read fields again and verify:
58
+ - field type
59
+ - alias config
60
+ - target field binding shape
61
+ 5. For page-safety checks, use user-side schema or insert checks:
62
+ - `qingflow record schema insert`
63
+ - optional safe `qingflow record insert`
64
+
65
+ Do not treat raw apply success as enough. Always re-read the field config.
66
+
67
+ ## Code Block Rules
68
+
69
+ Read [code-block.md](./code-block.md) before changing a code block field.
70
+
71
+ Use builder high-level config only for:
72
+ - input field insertion
73
+ - code content
74
+ - alias parsing
75
+ - auto trigger
76
+ - custom button text
77
+
78
+ When binding outputs to target fields, do not guess payload shape from memory. Follow the current builder implementation and the readback shape.
79
+
80
+ Hard rules:
81
+ - target fields must already exist
82
+ - keep target field types business-compatible
83
+ - if a page starts hanging on “关联中”, inspect whether the target field default type or relation config was written incorrectly
84
+
85
+ ## Q-Linker Rules
86
+
87
+ Read [q-linker.md](./q-linker.md) before changing a Q-Linker field.
88
+
89
+ First-stage stable support is only:
90
+ - custom mode
91
+ - request config
92
+ - alias parsing
93
+ - target field binding
94
+ - auto trigger / button text
95
+
96
+ Do not generate:
97
+ - template mode
98
+ - openApp/light-wing branches
99
+ - subtable table-match bindings
100
+
101
+ Hard rules:
102
+ - `outputs[*].target_field` is required
103
+ - use only supported target field types
104
+ - on rebinding, old target fields must be restored from relation-default to safe default type
105
+ - `resultFormatPath` must preserve backend-required alias metadata
106
+
107
+ ## Verification Checklist
108
+
109
+ After each code block or Q-Linker change, verify all of these:
110
+
111
+ - `qingflow builder app get ... fields` shows the intended field type
112
+ - the high-level config is readable and stable
113
+ - target fields still have valid types
114
+ - insert schema can be opened
115
+ - record insert does not get blocked by malformed integration config
116
+
117
+ If the task explicitly includes runtime verification, keep it separate from configuration verification.
118
+
119
+ ## Common Pitfalls
120
+
121
+ - Writing code block code with `const qf_output =`
122
+ - Treating a Q-Linker or code block binding as a plain field default
123
+ - Forgetting to restore old target fields after unbinding
124
+ - Using unsupported target field types
125
+ - Assuming apply success means the form page can open
126
+
127
+ ## References
128
+
129
+ - Code block details: [references/code-block.md](./code-block.md)
130
+ - Q-Linker details: [references/q-linker.md](./q-linker.md)
@@ -0,0 +1,66 @@
1
+ # Code Block Builder Notes
2
+
3
+ ## What Builder Should Configure
4
+
5
+ - code block field type
6
+ - code content
7
+ - inserted input fields inside code content
8
+ - alias parsing
9
+ - auto trigger
10
+ - custom button text
11
+
12
+ ## Stable Writing Rules
13
+
14
+ - Always emit `qf_output = {...}`
15
+ - Never emit `const qf_output = {...}`
16
+ - Never emit `let qf_output = {...}`
17
+
18
+ ## Useful CRM Pattern
19
+
20
+ Inputs:
21
+ - customer name
22
+ - source
23
+ - budget
24
+ - timing
25
+ - decision-maker flag
26
+
27
+ Outputs:
28
+ - score
29
+ - level
30
+ - priority
31
+ - summary
32
+ - next follow date
33
+
34
+ ## Target Field Rules
35
+
36
+ Required:
37
+ - every `outputs[*].target_field` must point to an existing field
38
+
39
+ Allowed target field types:
40
+ - text
41
+ - long text
42
+ - number
43
+ - amount
44
+ - date
45
+ - datetime
46
+ - single select
47
+ - multi select
48
+ - boolean
49
+
50
+ Do not bind code block outputs to:
51
+ - q_linker
52
+ - code_block
53
+ - relation
54
+ - subtable
55
+ - attachment
56
+ - member
57
+ - department
58
+ - address
59
+
60
+ ## Safe Verification
61
+
62
+ - `qingflow builder app get ... fields`
63
+ - `qingflow record schema insert`
64
+ - optional `record_code_block_run`
65
+
66
+ Treat configuration verification and runtime verification as separate checks.
@@ -0,0 +1,77 @@
1
+ # Q-Linker Builder Notes
2
+
3
+ ## What Builder Should Configure
4
+
5
+ - `remoteLookupConfig`
6
+ - alias parsing
7
+ - target field binding
8
+ - auto trigger
9
+ - custom button text
10
+
11
+ ## Current Supported Scope
12
+
13
+ - custom mode only
14
+ - standard request fields
15
+ - alias path parsing
16
+ - target field binding to existing ordinary fields
17
+
18
+ ## Recommended Public APIs For Samples
19
+
20
+ ### Httpbin
21
+
22
+ - URL: `https://httpbin.org/get`
23
+ - Good for:
24
+ - query echo
25
+ - request URL echo
26
+
27
+ Useful paths:
28
+ - `$.args.keyword`
29
+ - `$.url`
30
+
31
+ ### Open-Meteo Geocoding
32
+
33
+ - URL: `https://geocoding-api.open-meteo.com/v1/search`
34
+ - Good for:
35
+ - place normalization
36
+ - country
37
+ - lat/lng summary
38
+
39
+ Useful paths:
40
+ - `$.results[0].name`
41
+ - `$.results[0].country`
42
+ - `$.results[0].latitude`
43
+ - `$.results[0].longitude`
44
+
45
+ ## Target Field Rules
46
+
47
+ Required:
48
+ - every `outputs[*].target_field` must point to an existing field
49
+
50
+ Prefer:
51
+ - text
52
+ - long text
53
+ - number
54
+ - amount
55
+ - date
56
+ - datetime
57
+ - single select
58
+ - multi select
59
+ - boolean
60
+
61
+ Avoid:
62
+ - q_linker
63
+ - code_block
64
+ - relation
65
+ - subtable
66
+ - attachment
67
+ - member
68
+ - department
69
+ - address
70
+
71
+ ## Safe Verification
72
+
73
+ - `qingflow builder app get ... fields`
74
+ - `qingflow record schema insert`
75
+ - `record_insert`
76
+
77
+ This verifies that the configuration does not break the form page, even before runtime execution is tested.