@qingflow-tech/qingflow-cli 1.1.47 → 1.1.48-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/npm/lib/runtime.mjs +29 -13
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/skills/qingflow-cli/SKILL.md +37 -1
- package/skills/qingflow-common/SKILL.md +7 -1
- package/src/qingflow_mcp/builder_facade/service.py +119 -1
- package/src/qingflow_mcp/cli/commands/__init__.py +2 -1
- package/src/qingflow_mcp/cli/commands/auth.py +8 -0
- package/src/qingflow_mcp/cli/commands/data.py +134 -0
- package/src/qingflow_mcp/cli/context.py +6 -0
- package/src/qingflow_mcp/cli/formatters.py +163 -3
- package/src/qingflow_mcp/cli/main.py +4 -1
- package/src/qingflow_mcp/config.py +39 -0
- package/src/qingflow_mcp/public_surface.py +7 -0
- package/src/qingflow_mcp/resource_uri.py +241 -0
- package/src/qingflow_mcp/response_trim.py +10 -2
- package/src/qingflow_mcp/server.py +4 -0
- package/src/qingflow_mcp/server_app_builder.py +16 -0
- package/src/qingflow_mcp/server_app_user.py +24 -0
- package/src/qingflow_mcp/tools/ai_builder_tools.py +208 -39
- package/src/qingflow_mcp/tools/app_tools.py +52 -13
- package/src/qingflow_mcp/tools/csv_export.py +168 -0
- package/src/qingflow_mcp/tools/data_tools.py +271 -0
- package/src/qingflow_mcp/tools/login_link_tools.py +142 -0
- package/src/qingflow_mcp/tools/record_tools.py +11 -46
- package/src/qingflow_mcp/tools/resource_read_tools.py +13 -0
|
@@ -7,12 +7,14 @@ from mcp.server.fastmcp import FastMCP
|
|
|
7
7
|
from .backend_client import BackendClient
|
|
8
8
|
from .session_store import SessionStore
|
|
9
9
|
from .tools.app_tools import AppTools
|
|
10
|
+
from .tools.data_tools import DataTools
|
|
10
11
|
from .tools.auth_tools import AuthTools
|
|
11
12
|
from .tools.code_block_tools import CodeBlockTools
|
|
12
13
|
from .tools.feedback_tools import FeedbackTools
|
|
13
14
|
from .tools.export_tools import ExportTools
|
|
14
15
|
from .tools.file_tools import FileTools
|
|
15
16
|
from .tools.import_tools import ImportTools
|
|
17
|
+
from .tools.login_link_tools import LoginLinkTools
|
|
16
18
|
from .tools.package_tools import PackageTools
|
|
17
19
|
from .tools.navigation_tools import NavigationTools
|
|
18
20
|
from .tools.directory_tools import DirectoryTools
|
|
@@ -238,6 +240,7 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
238
240
|
sessions = SessionStore()
|
|
239
241
|
backend = BackendClient()
|
|
240
242
|
AuthTools(sessions, backend).register(server)
|
|
243
|
+
LoginLinkTools(sessions, backend).register(server)
|
|
241
244
|
FeedbackTools(backend, mcp_side="通用").register(server)
|
|
242
245
|
WorkspaceTools(sessions, backend).register(server)
|
|
243
246
|
FileTools(sessions, backend).register(server)
|
|
@@ -247,6 +250,7 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
247
250
|
TaskContextTools(sessions, backend).register(server)
|
|
248
251
|
RoleTools(sessions, backend).register(server)
|
|
249
252
|
AppTools(sessions, backend).register(server)
|
|
253
|
+
DataTools(sessions, backend).register(server)
|
|
250
254
|
QingbiReportTools(sessions, backend).register(server)
|
|
251
255
|
PackageTools(sessions, backend).register(server)
|
|
252
256
|
NavigationTools(sessions, backend).register(server)
|
|
@@ -9,6 +9,7 @@ from .config import DEFAULT_PROFILE
|
|
|
9
9
|
from .response_trim import BUILDER_SERVER_METHOD_MAP, trim_error_response, trim_public_response, wrap_trimmed_methods
|
|
10
10
|
from .session_store import SessionStore
|
|
11
11
|
from .tools.ai_builder_tools import AiBuilderTools
|
|
12
|
+
from .tools.login_link_tools import LOGIN_LINK_DESCRIPTION, LoginLinkTools
|
|
12
13
|
from .tools.auth_tools import AuthTools
|
|
13
14
|
from .tools.feedback_tools import FeedbackTools
|
|
14
15
|
from .tools.file_tools import FileTools
|
|
@@ -41,6 +42,16 @@ def build_builder_server() -> FastMCP:
|
|
|
41
42
|
"member_search/role_search/role_create when workflow assignees must come from the directory or role catalog, preferring roles over explicit members unless the user explicitly names members, "
|
|
42
43
|
"then app_form_apply for complete app form targets, explicit app_delete for application deletion, and app_flow_apply/app_views_apply/app_associated_resources_apply/app_charts_apply/portal_apply/portal_delete for non-form patches. app_custom_buttons_apply is maintenance-only for explicit standalone button work outside normal view design. These apply/delete tools perform validation, normalization, writes, and readback verification where applicable. AppForm publishes only after a draft change or when the published form lags behind; views noop requests skip publish, app_custom_buttons_apply and app_associated_resources_apply publish after at least one write succeeds and expose no draft-only parameter, charts are immediate-live without publish and resolve targets by chart_id first then exact unique chart name, portal updates use replace semantics only when sections are supplied and edit-mode base-info-only updates may omit sections, portal delete separates DELETE execution from readback verification, portal pc layout is a 24-column grid and mobile is a 6-column grid so omit position or use layout_preset when unsure, publish=false only guarantees draft/base-info updates for tools that still expose that parameter, and flow should use publish=false whenever you only want draft/precheck behavior. "
|
|
43
44
|
"Builder apply/write outputs include schema_version, operation, summary, and resources[]; use resources[].id/key/name/ids/parent as the stable UI and agent display entry, and keep legacy fields such as field_diff/views_diff/chart_results only for compatibility or troubleshooting. "
|
|
45
|
+
"创建、修改或安装轻流资源后,最终回复主动提供主要结果的可点击页面入口,无需等待用户再次索要。"
|
|
46
|
+
"采用“完成结果 + 查看入口”,文案使用“在轻流中查看应用/应用包/视图”,不默认称为“继续编辑”。"
|
|
47
|
+
"默认只交付用户请求的主要结果:安装方案默认提供应用包入口;直接创建或修改应用、视图时提供对应入口;用户明确要求多个主要对象时分别提供。"
|
|
48
|
+
"使用业务结果中的稳定 `uri`,按 URI 去重,不为全部子资源预签票据;主要对象没有可靠 URI 时说明限制,不猜地址,也不替换为不相关页面。"
|
|
49
|
+
"部分成功时仅交付已确认成功且可定位的主要结果,保留失败或未验证说明。"
|
|
50
|
+
"纯数据问答、中间读取、失败资源和删除操作不自动签发;用户明确要求不提供链接时遵从。用户明确要求查看或打开页面时也使用已确认的路径。"
|
|
51
|
+
"目标浏览器登录态未知时,临近交付用资源 URI 的同源 pathname 调用 get_login_link,为每个实际展示的入口分别签发,使用返回的完整 URL,不额外追问登录态。"
|
|
52
|
+
"只有已有用户确认同一浏览器、网页域名、账号和工作区已登录且无失效信号的事实时,才直接交付稳定 URI;调用过票据工具、自动化浏览器已登录或之前签发过票据均不能证明用户浏览器已登录,已消费链接不可复用。"
|
|
53
|
+
"用户未要求打开时不提前打开或消费链接;浏览器不可用时提供可点击链接,不假称已经打开。"
|
|
54
|
+
"签发失败时说明免登录链接未生成,提供标注“需登录”的稳定 URI 作为备用入口,不重做业务操作。机器结果继续保留稳定 URI,临时登录链接仅用于面向用户交付。 "
|
|
44
55
|
"For existing object parameter replacement, prefer patch_views, patch_buttons, patch_resources, and patch_charts with set/unset; the tool reads current config and full-saves internally, while upsert_* is for creation or full target configuration and should not be used as an incomplete partial update. "
|
|
45
56
|
"For builder delete/remove apply results, separate delete execution from readback verification: after DELETE is sent, resources expose delete_executed, readback_status, and safe_to_retry_delete=false. If readback_status is unavailable or still_exists, do not blindly repeat the delete; confirm later with app_get/view_get/chart_get or the relevant apply readback. Views/buttons use single-item readback; associated resources use one app-level resource-pool readback because there is no confirmed single-item GET. "
|
|
46
57
|
"For builder write/apply results, separate write execution from final readback verification: status=partial_success with write_executed=true and safe_to_retry=false means the write was sent or succeeded, while final readback, publish verification, or metadata confirmation is pending or permission-restricted. Report it as written but unverified; do not repeat the same write blindly. "
|
|
@@ -64,6 +75,7 @@ def build_builder_server() -> FastMCP:
|
|
|
64
75
|
workspace = wrap_trimmed_methods(WorkspaceTools(sessions, backend), BUILDER_SERVER_METHOD_MAP)
|
|
65
76
|
files = wrap_trimmed_methods(FileTools(sessions, backend), BUILDER_SERVER_METHOD_MAP)
|
|
66
77
|
ai_builder = wrap_trimmed_methods(AiBuilderTools(sessions, backend), BUILDER_SERVER_METHOD_MAP)
|
|
78
|
+
login_link = LoginLinkTools(sessions, backend)
|
|
67
79
|
feedback = FeedbackTools(backend, mcp_side="App Builder MCP")
|
|
68
80
|
|
|
69
81
|
@server.tool()
|
|
@@ -90,6 +102,10 @@ def build_builder_server() -> FastMCP:
|
|
|
90
102
|
def auth_logout(profile: str = DEFAULT_PROFILE, forget_persisted: bool = False) -> dict:
|
|
91
103
|
return auth.auth_logout(profile=profile, forget_persisted=forget_persisted)
|
|
92
104
|
|
|
105
|
+
@server.tool(description=LOGIN_LINK_DESCRIPTION)
|
|
106
|
+
def get_login_link(profile: str = DEFAULT_PROFILE, redirect_path: str = "") -> dict:
|
|
107
|
+
return login_link.get_login_link(profile=profile, redirect_path=redirect_path)
|
|
108
|
+
|
|
93
109
|
@server.tool()
|
|
94
110
|
def workspace_list(
|
|
95
111
|
profile: str = DEFAULT_PROFILE,
|
|
@@ -10,6 +10,7 @@ from .config import DEFAULT_PROFILE
|
|
|
10
10
|
from .response_trim import USER_SERVER_METHOD_MAP, trim_error_response, trim_public_response, wrap_trimmed_methods
|
|
11
11
|
from .session_store import SessionStore
|
|
12
12
|
from .tools.app_tools import AppTools
|
|
13
|
+
from .tools.data_tools import DataTools
|
|
13
14
|
from .tools.auth_tools import AuthTools
|
|
14
15
|
from .tools.code_block_tools import CodeBlockTools
|
|
15
16
|
from .tools.directory_tools import DirectoryTools
|
|
@@ -17,6 +18,7 @@ from .tools.export_tools import ExportTools
|
|
|
17
18
|
from .tools.feedback_tools import FeedbackTools
|
|
18
19
|
from .tools.file_tools import FileTools
|
|
19
20
|
from .tools.import_tools import ImportTools
|
|
21
|
+
from .tools.login_link_tools import LOGIN_LINK_DESCRIPTION, LoginLinkTools
|
|
20
22
|
from .tools.resource_read_tools import ResourceReadTools
|
|
21
23
|
from .tools.task_context_tools import TaskContextTools
|
|
22
24
|
from .tools.workspace_tools import WorkspaceTools
|
|
@@ -30,6 +32,19 @@ def build_user_server(*, stateless_http: bool = False) -> FastMCP:
|
|
|
30
32
|
stateless_http=stateless_http,
|
|
31
33
|
instructions=f"""Use this server for Qingflow operational workflows. Current date: `{today.isoformat()}`.
|
|
32
34
|
|
|
35
|
+
## 页面交接
|
|
36
|
+
|
|
37
|
+
创建、修改或安装轻流资源后,最终回复主动提供主要结果的可点击页面入口,无需等待用户再次索要。采用“完成结果 + 查看入口”,文案使用“在轻流中查看应用/应用包/视图”,不默认称为“继续编辑”。用户明确要求查看或打开页面时也适用以下规则。
|
|
38
|
+
默认只交付用户请求的主要结果:安装方案默认提供应用包入口;直接创建或修改应用、视图时提供对应入口;用户明确要求多个主要对象时分别提供。使用业务结果中的稳定 `uri`,按 URI 去重,不为全部子资源预签票据。
|
|
39
|
+
主要对象没有可靠 URI 时说明限制,不猜地址,也不替换为不相关页面。部分成功时仅交付已确认成功且可定位的主要结果,保留失败或未验证说明。纯数据问答、中间读取、失败资源和删除操作不自动签发;用户明确要求不提供链接时遵从。
|
|
40
|
+
目标路径由业务工具或领域 Skill 根据真实前端路由确定,不由票据工具根据业务标识推导。
|
|
41
|
+
已知目标传可选 `redirect_path`;明确指定页面但路径未知时继续定位或说明限制,不猜测,也不静默改为首页。
|
|
42
|
+
搜索未命中时继续搜索 `login` 或查看服务工具列表,不擅自打开固定正式站点;鉴权或工具失败时如实说明。
|
|
43
|
+
目标浏览器登录态未知时,默认用资源 URI 的同源 pathname 调用 `get_login_link`,为每个实际展示的入口分别签发,不额外追问登录态;只有已有用户确认同一浏览器、网页域名、账号和工作区已登录且无失效信号的事实时,才直接交付稳定 URI。调用过票据工具、自动化浏览器已登录或之前签发过票据均不能证明用户浏览器已登录,已消费链接也不能复用。
|
|
44
|
+
临近交付时再签发,使用返回的完整 URL。用户未要求打开时仅交付,不提前消费;要求“打开”时才调用浏览器。签发失败时说明免登录链接未生成,并提供标注“需登录”的稳定 URI 作为备用入口,不重做业务操作。机器结果继续保留稳定 URI,临时登录链接仅用于面向用户交付。
|
|
45
|
+
浏览器不可用时提供可点击链接,不假称已经打开,不展示工作区数字 ID 或原始 JSON。
|
|
46
|
+
链接约 5 分钟内一次性有效,不能作为长期书签;安全验证及原有业务权限不变。
|
|
47
|
+
|
|
33
48
|
## App Discovery
|
|
34
49
|
|
|
35
50
|
If `app_key` is unknown, use `app_list` first. Pass `query` to filter visible apps by keyword.
|
|
@@ -228,6 +243,7 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
228
243
|
backend = BackendClient()
|
|
229
244
|
auth = wrap_trimmed_methods(AuthTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
230
245
|
apps = wrap_trimmed_methods(AppTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
246
|
+
data_tools = wrap_trimmed_methods(DataTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
231
247
|
workspace = wrap_trimmed_methods(WorkspaceTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
232
248
|
file_tools = wrap_trimmed_methods(FileTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
233
249
|
imports = wrap_trimmed_methods(ImportTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
@@ -237,6 +253,7 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
237
253
|
code_block_tools = wrap_trimmed_methods(CodeBlockTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
238
254
|
task_context_tools = wrap_trimmed_methods(TaskContextTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
239
255
|
directory_tools = wrap_trimmed_methods(DirectoryTools(sessions, backend), USER_SERVER_METHOD_MAP)
|
|
256
|
+
login_link = LoginLinkTools(sessions, backend)
|
|
240
257
|
|
|
241
258
|
@server.tool()
|
|
242
259
|
def auth_use_credential(
|
|
@@ -258,6 +275,11 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
258
275
|
def auth_whoami(profile: str = DEFAULT_PROFILE) -> dict:
|
|
259
276
|
return auth.auth_whoami(profile=profile)
|
|
260
277
|
|
|
278
|
+
@server.tool(description=LOGIN_LINK_DESCRIPTION)
|
|
279
|
+
def get_login_link(profile: str = DEFAULT_PROFILE, redirect_path: str = "") -> dict:
|
|
280
|
+
"""获取一次性免登录链接;redirect_path 可选,仅接受站内业务路径,省略进入首页。"""
|
|
281
|
+
return login_link.get_login_link(profile=profile, redirect_path=redirect_path)
|
|
282
|
+
|
|
261
283
|
@server.tool()
|
|
262
284
|
def auth_logout(profile: str = DEFAULT_PROFILE, forget_persisted: bool = False) -> dict:
|
|
263
285
|
return auth.auth_logout(profile=profile, forget_persisted=forget_persisted)
|
|
@@ -375,6 +397,8 @@ If the current MCP capability is unsupported, the workflow is awkward, or the us
|
|
|
375
397
|
def app_get(profile: str = DEFAULT_PROFILE, app_key: str = "") -> dict:
|
|
376
398
|
return apps.app_get(profile=profile, app_key=app_key)
|
|
377
399
|
|
|
400
|
+
data_tools.register(server)
|
|
401
|
+
|
|
378
402
|
@server.tool()
|
|
379
403
|
def portal_list(profile: str = DEFAULT_PROFILE) -> dict:
|
|
380
404
|
return resources.portal_list(profile=profile)
|