@qingflow-tech/qingflow-cli 1.1.47-beta.1 → 1.1.47-beta.3

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.
@@ -326,7 +326,7 @@ def _trim_workspace_get(payload: JSONObject) -> None:
326
326
 
327
327
  def _trim_app_list_like(payload: JSONObject) -> None:
328
328
  payload.pop("apps", None)
329
- _trim_item_list(payload, "items", allowed=("app_key", "app_name", "package_name"))
329
+ _trim_item_list(payload, "items", allowed=("app_key", "app_name", "package_name", "uri"))
330
330
 
331
331
 
332
332
  def _trim_app_get(payload: JSONObject) -> None:
@@ -334,7 +334,7 @@ def _trim_app_get(payload: JSONObject) -> None:
334
334
  _trim_nested_item_list(
335
335
  payload,
336
336
  ("data", "accessible_views"),
337
- allowed=("view_id", "name", "analysis_supported", "list_supported", "kind"),
337
+ allowed=("view_id", "name", "analysis_supported", "list_supported", "kind", "uri"),
338
338
  )
339
339
 
340
340
 
@@ -1148,7 +1148,6 @@ def _register_policy(domains: tuple[str, ...], names: tuple[str, ...], transform
1148
1148
 
1149
1149
 
1150
1150
  _register_policy((USER_DOMAIN, BUILDER_DOMAIN), ("auth_use_credential", "auth_whoami"), _trim_auth_payload)
1151
- _register_policy((USER_DOMAIN,), ("get_login_link",), _trim_login_link)
1152
1151
  _register_policy((USER_DOMAIN, BUILDER_DOMAIN), ("auth_logout",), _trim_auth_logout)
1153
1152
  _register_policy((USER_DOMAIN, BUILDER_DOMAIN), ("workspace_list",), _trim_workspace_list)
1154
1153
  _register_policy((USER_DOMAIN, BUILDER_DOMAIN), ("workspace_get", "workspace_select"), _trim_workspace_get)
@@ -1223,6 +1222,7 @@ _register_policy(
1223
1222
  _trim_directory,
1224
1223
  )
1225
1224
  _register_policy((USER_DOMAIN, BUILDER_DOMAIN), ("feedback_submit",), _trim_feedback)
1225
+ _register_policy((USER_DOMAIN, BUILDER_DOMAIN), ("get_login_link",), _trim_login_link)
1226
1226
  _register_policy(
1227
1227
  (USER_DOMAIN,),
1228
1228
  (
@@ -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,
@@ -33,12 +33,15 @@ def build_user_server(*, stateless_http: bool = False) -> FastMCP:
33
33
 
34
34
  ## 页面交接
35
35
 
36
- 用户需要查看结果、继续编辑、处理业务或进入工作区页面时,使用 `get_login_link`;纯数据查询不自动签发链接。
36
+ 创建、修改或安装轻流资源后,最终回复主动提供主要结果的可点击页面入口,无需等待用户再次索要。采用“完成结果 + 查看入口”,文案使用“在轻流中查看应用/应用包/视图”,不默认称为“继续编辑”。用户明确要求查看或打开页面时也适用以下规则。
37
+ 默认只交付用户请求的主要结果:安装方案默认提供应用包入口;直接创建或修改应用、视图时提供对应入口;用户明确要求多个主要对象时分别提供。使用业务结果中的稳定 `uri`,按 URI 去重,不为全部子资源预签票据。
38
+ 主要对象没有可靠 URI 时说明限制,不猜地址,也不替换为不相关页面。部分成功时仅交付已确认成功且可定位的主要结果,保留失败或未验证说明。纯数据问答、中间读取、失败资源和删除操作不自动签发;用户明确要求不提供链接时遵从。
37
39
  目标路径由业务工具或领域 Skill 根据真实前端路由确定,不由票据工具根据业务标识推导。
38
40
  已知目标传可选 `redirect_path`;明确指定页面但路径未知时继续定位或说明限制,不猜测,也不静默改为首页。
39
41
  搜索未命中时继续搜索 `login` 或查看服务工具列表,不擅自打开固定正式站点;鉴权或工具失败时如实说明。
40
- 临近交付时再签发,使用返回的完整 URL。要求“给我链接”时仅交付,不提前消费;要求“打开”时才调用浏览器。
41
- 浏览器不可用时提供可点击链接;用“查看记录”“继续编辑”等文案,不展示工作区数字 ID 或原始 JSON。
42
+ 目标浏览器登录态未知时,默认用资源 URI 的同源 pathname 调用 `get_login_link`,为每个实际展示的入口分别签发,不额外追问登录态;只有已有用户确认同一浏览器、网页域名、账号和工作区已登录且无失效信号的事实时,才直接交付稳定 URI。调用过票据工具、自动化浏览器已登录或之前签发过票据均不能证明用户浏览器已登录,已消费链接也不能复用。
43
+ 临近交付时再签发,使用返回的完整 URL。用户未要求打开时仅交付,不提前消费;要求“打开”时才调用浏览器。签发失败时说明免登录链接未生成,并提供标注“需登录”的稳定 URI 作为备用入口,不重做业务操作。机器结果继续保留稳定 URI,临时登录链接仅用于面向用户交付。
44
+ 浏览器不可用时提供可点击链接,不假称已经打开,不展示工作区数字 ID 或原始 JSON。
42
45
  链接约 5 分钟内一次性有效,不能作为长期书签;安全验证及原有业务权限不变。
43
46
 
44
47
  ## App Discovery