@josephyan/qingflow-cli 0.2.0-beta.78 → 0.2.0-beta.79
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 +2 -2
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/qingflow_mcp/__init__.py +1 -1
- package/src/qingflow_mcp/builder_facade/models.py +109 -0
- package/src/qingflow_mcp/builder_facade/service.py +761 -18
- package/src/qingflow_mcp/cli/commands/builder.py +33 -0
- package/src/qingflow_mcp/public_surface.py +2 -0
- package/src/qingflow_mcp/server_app_builder.py +28 -1
- package/src/qingflow_mcp/tools/ai_builder_tools.py +280 -19
|
@@ -89,8 +89,21 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
|
|
|
89
89
|
package_create.add_argument("--package-name", required=True)
|
|
90
90
|
package_create.add_argument("--icon")
|
|
91
91
|
package_create.add_argument("--color")
|
|
92
|
+
package_create.add_argument("--visibility-file")
|
|
92
93
|
package_create.set_defaults(handler=_handle_package_create, format_hint="builder_summary")
|
|
93
94
|
|
|
95
|
+
package_get = package_subparsers.add_parser("get", help="读取应用包详情")
|
|
96
|
+
package_get.add_argument("--tag-id", type=int, required=True)
|
|
97
|
+
package_get.set_defaults(handler=_handle_package_get, format_hint="builder_summary")
|
|
98
|
+
|
|
99
|
+
package_update = package_subparsers.add_parser("update", help="更新应用包")
|
|
100
|
+
package_update.add_argument("--tag-id", type=int, required=True)
|
|
101
|
+
package_update.add_argument("--package-name")
|
|
102
|
+
package_update.add_argument("--icon")
|
|
103
|
+
package_update.add_argument("--color")
|
|
104
|
+
package_update.add_argument("--visibility-file")
|
|
105
|
+
package_update.set_defaults(handler=_handle_package_update, format_hint="builder_summary")
|
|
106
|
+
|
|
94
107
|
package_attach_app = package_subparsers.add_parser("attach-app", help="将应用挂载到应用包")
|
|
95
108
|
package_attach_app.add_argument("--tag-id", type=int, required=True)
|
|
96
109
|
package_attach_app.add_argument("--app-key", required=True)
|
|
@@ -172,6 +185,7 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
|
|
|
172
185
|
portal_apply.add_argument("--package-tag-id", type=int)
|
|
173
186
|
portal_apply.add_argument("--publish", action=argparse.BooleanOptionalAction, default=True)
|
|
174
187
|
portal_apply.add_argument("--sections-file", required=True)
|
|
188
|
+
portal_apply.add_argument("--visibility-file")
|
|
175
189
|
portal_apply.add_argument("--auth-file")
|
|
176
190
|
portal_apply.add_argument("--icon")
|
|
177
191
|
portal_apply.add_argument("--color")
|
|
@@ -189,6 +203,7 @@ def register(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) ->
|
|
|
189
203
|
schema_apply_apply.add_argument("--app-title", default="")
|
|
190
204
|
schema_apply_apply.add_argument("--icon")
|
|
191
205
|
schema_apply_apply.add_argument("--color")
|
|
206
|
+
schema_apply_apply.add_argument("--visibility-file")
|
|
192
207
|
schema_apply_apply.add_argument("--create-if-missing", action="store_true")
|
|
193
208
|
schema_apply_apply.add_argument("--publish", action=argparse.BooleanOptionalAction, default=True)
|
|
194
209
|
schema_apply_apply.add_argument("--add-fields-file")
|
|
@@ -339,6 +354,22 @@ def _handle_package_create(args: argparse.Namespace, context: CliContext) -> dic
|
|
|
339
354
|
package_name=args.package_name,
|
|
340
355
|
icon=args.icon,
|
|
341
356
|
color=args.color,
|
|
357
|
+
visibility=load_object_arg(args.visibility_file, option_name="--visibility-file"),
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
def _handle_package_get(args: argparse.Namespace, context: CliContext) -> dict:
|
|
362
|
+
return context.builder.package_get(profile=args.profile, tag_id=args.tag_id)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def _handle_package_update(args: argparse.Namespace, context: CliContext) -> dict:
|
|
366
|
+
return context.builder.package_update(
|
|
367
|
+
profile=args.profile,
|
|
368
|
+
tag_id=args.tag_id,
|
|
369
|
+
package_name=args.package_name,
|
|
370
|
+
icon=args.icon,
|
|
371
|
+
color=args.color,
|
|
372
|
+
visibility=load_object_arg(args.visibility_file, option_name="--visibility-file"),
|
|
342
373
|
)
|
|
343
374
|
|
|
344
375
|
|
|
@@ -477,6 +508,7 @@ def _handle_schema_apply(args: argparse.Namespace, context: CliContext) -> dict:
|
|
|
477
508
|
app_title=args.app_title,
|
|
478
509
|
icon=args.icon,
|
|
479
510
|
color=args.color,
|
|
511
|
+
visibility=load_object_arg(args.visibility_file, option_name="--visibility-file"),
|
|
480
512
|
create_if_missing=bool(args.create_if_missing),
|
|
481
513
|
publish=bool(args.publish),
|
|
482
514
|
add_fields=load_list_arg(args.add_fields_file, option_name="--add-fields-file"),
|
|
@@ -547,6 +579,7 @@ def _handle_portal_apply(args: argparse.Namespace, context: CliContext) -> dict:
|
|
|
547
579
|
package_tag_id=args.package_tag_id,
|
|
548
580
|
publish=bool(args.publish),
|
|
549
581
|
sections=require_list_arg(args.sections_file, option_name="--sections-file"),
|
|
582
|
+
visibility=load_object_arg(args.visibility_file, option_name="--visibility-file"),
|
|
550
583
|
auth=load_object_arg(args.auth_file, option_name="--auth-file"),
|
|
551
584
|
icon=args.icon,
|
|
552
585
|
color=args.color,
|
|
@@ -119,6 +119,8 @@ BUILDER_PUBLIC_TOOL_SPECS: tuple[PublicToolSpec, ...] = (
|
|
|
119
119
|
PublicToolSpec(BUILDER_DOMAIN, "package_resolve", ("package_resolve",), ("builder", "package", "resolve"), has_contract=True, cli_show_effective_context=True),
|
|
120
120
|
PublicToolSpec(BUILDER_DOMAIN, "builder_tool_contract", ("builder_tool_contract",), ("builder", "contract"), has_contract=False),
|
|
121
121
|
PublicToolSpec(BUILDER_DOMAIN, "package_create", ("package_create",), ("builder", "package", "create"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
122
|
+
PublicToolSpec(BUILDER_DOMAIN, "package_get", ("package_get",), ("builder", "package", "get"), has_contract=True, cli_show_effective_context=True),
|
|
123
|
+
PublicToolSpec(BUILDER_DOMAIN, "package_update", ("package_update",), ("builder", "package", "update"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
122
124
|
PublicToolSpec(BUILDER_DOMAIN, "solution_install", ("solution_install",), ("builder", "solution", "install"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
123
125
|
PublicToolSpec(BUILDER_DOMAIN, "member_search", ("member_search",), ("builder", "member", "search"), has_contract=True, cli_show_effective_context=True),
|
|
124
126
|
PublicToolSpec(BUILDER_DOMAIN, "role_search", ("role_search",), ("builder", "role", "search"), has_contract=True, cli_show_effective_context=True),
|
|
@@ -197,8 +197,31 @@ def build_builder_server() -> FastMCP:
|
|
|
197
197
|
package_name: str = "",
|
|
198
198
|
icon: str | None = None,
|
|
199
199
|
color: str | None = None,
|
|
200
|
+
visibility: dict | None = None,
|
|
200
201
|
) -> dict:
|
|
201
|
-
return ai_builder.package_create(profile=profile, package_name=package_name, icon=icon, color=color)
|
|
202
|
+
return ai_builder.package_create(profile=profile, package_name=package_name, icon=icon, color=color, visibility=visibility)
|
|
203
|
+
|
|
204
|
+
@server.tool()
|
|
205
|
+
def package_get(profile: str = DEFAULT_PROFILE, tag_id: int = 0) -> dict:
|
|
206
|
+
return ai_builder.package_get(profile=profile, tag_id=tag_id)
|
|
207
|
+
|
|
208
|
+
@server.tool()
|
|
209
|
+
def package_update(
|
|
210
|
+
profile: str = DEFAULT_PROFILE,
|
|
211
|
+
tag_id: int = 0,
|
|
212
|
+
package_name: str | None = None,
|
|
213
|
+
icon: str | None = None,
|
|
214
|
+
color: str | None = None,
|
|
215
|
+
visibility: dict | None = None,
|
|
216
|
+
) -> dict:
|
|
217
|
+
return ai_builder.package_update(
|
|
218
|
+
profile=profile,
|
|
219
|
+
tag_id=tag_id,
|
|
220
|
+
package_name=package_name,
|
|
221
|
+
icon=icon,
|
|
222
|
+
color=color,
|
|
223
|
+
visibility=visibility,
|
|
224
|
+
)
|
|
202
225
|
|
|
203
226
|
@server.tool()
|
|
204
227
|
def solution_install(
|
|
@@ -388,6 +411,7 @@ def build_builder_server() -> FastMCP:
|
|
|
388
411
|
app_title: str = "",
|
|
389
412
|
icon: str = "",
|
|
390
413
|
color: str = "",
|
|
414
|
+
visibility: dict | None = None,
|
|
391
415
|
create_if_missing: bool = False,
|
|
392
416
|
publish: bool = True,
|
|
393
417
|
add_fields: list[dict] | None = None,
|
|
@@ -417,6 +441,7 @@ def build_builder_server() -> FastMCP:
|
|
|
417
441
|
app_title=app_title,
|
|
418
442
|
icon=icon,
|
|
419
443
|
color=color,
|
|
444
|
+
visibility=visibility,
|
|
420
445
|
create_if_missing=create_if_missing,
|
|
421
446
|
publish=publish,
|
|
422
447
|
add_fields=add_fields or [],
|
|
@@ -492,6 +517,7 @@ def build_builder_server() -> FastMCP:
|
|
|
492
517
|
package_tag_id: int | None = None,
|
|
493
518
|
publish: bool = True,
|
|
494
519
|
sections: list[dict] | None = None,
|
|
520
|
+
visibility: dict | None = None,
|
|
495
521
|
auth: dict | None = None,
|
|
496
522
|
icon: str | None = None,
|
|
497
523
|
color: str | None = None,
|
|
@@ -519,6 +545,7 @@ def build_builder_server() -> FastMCP:
|
|
|
519
545
|
package_tag_id=package_tag_id,
|
|
520
546
|
publish=publish,
|
|
521
547
|
sections=sections or [],
|
|
548
|
+
visibility=visibility,
|
|
522
549
|
auth=auth,
|
|
523
550
|
icon=icon,
|
|
524
551
|
color=color,
|