@josephyan/qingflow-cli 0.2.0-beta.77 → 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 +110 -1
- package/src/qingflow_mcp/builder_facade/service.py +800 -33
- package/src/qingflow_mcp/cli/commands/builder.py +33 -0
- package/src/qingflow_mcp/cli/main.py +29 -0
- package/src/qingflow_mcp/public_surface.py +63 -52
- 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,
|
|
@@ -6,6 +6,7 @@ import sys
|
|
|
6
6
|
from typing import Any, Callable, TextIO
|
|
7
7
|
|
|
8
8
|
from ..errors import QingflowApiError
|
|
9
|
+
from ..public_surface import cli_public_tool_spec_from_namespace
|
|
9
10
|
from ..response_trim import resolve_cli_tool_name, trim_error_response, trim_public_response
|
|
10
11
|
from .context import CliContext, build_cli_context
|
|
11
12
|
from .formatters import emit_json_result, emit_text_result
|
|
@@ -49,6 +50,8 @@ def run(
|
|
|
49
50
|
return 2
|
|
50
51
|
context = context_factory()
|
|
51
52
|
try:
|
|
53
|
+
if not bool(args.json):
|
|
54
|
+
_emit_cli_effective_context_notice(args, context, stream=err)
|
|
52
55
|
result = handler(args, context)
|
|
53
56
|
except RuntimeError as exc:
|
|
54
57
|
payload = trim_error_response(_parse_error_payload(exc))
|
|
@@ -145,5 +148,31 @@ def _result_exit_code(result: dict[str, Any]) -> int:
|
|
|
145
148
|
return 0
|
|
146
149
|
|
|
147
150
|
|
|
151
|
+
def _emit_cli_effective_context_notice(args: argparse.Namespace, context: CliContext, *, stream: TextIO) -> None:
|
|
152
|
+
spec = cli_public_tool_spec_from_namespace(args)
|
|
153
|
+
if spec is None or not spec.cli_show_effective_context:
|
|
154
|
+
return
|
|
155
|
+
sessions = getattr(context, "sessions", None)
|
|
156
|
+
if sessions is None or not hasattr(sessions, "get_profile"):
|
|
157
|
+
return
|
|
158
|
+
profile_name = str(getattr(args, "profile", "default") or "default")
|
|
159
|
+
try:
|
|
160
|
+
session_profile = sessions.get_profile(profile_name)
|
|
161
|
+
except Exception:
|
|
162
|
+
session_profile = None
|
|
163
|
+
workspace_id = getattr(session_profile, "selected_ws_id", None) if session_profile is not None else None
|
|
164
|
+
workspace_name = getattr(session_profile, "selected_ws_name", None) if session_profile is not None else None
|
|
165
|
+
if workspace_id is None:
|
|
166
|
+
workspace_label = "(not selected)"
|
|
167
|
+
elif workspace_name:
|
|
168
|
+
workspace_label = f"{workspace_name} ({workspace_id})"
|
|
169
|
+
else:
|
|
170
|
+
workspace_label = str(workspace_id)
|
|
171
|
+
lines = [f"Context: profile={profile_name} workspace={workspace_label}"]
|
|
172
|
+
if spec.cli_context_write and profile_name == "default":
|
|
173
|
+
lines.append("Warning: using default profile for a workspace-sensitive write command")
|
|
174
|
+
stream.write("\n".join(lines) + "\n")
|
|
175
|
+
|
|
176
|
+
|
|
148
177
|
if __name__ == "__main__":
|
|
149
178
|
main()
|
|
@@ -17,6 +17,8 @@ class PublicToolSpec:
|
|
|
17
17
|
mcp_public: bool = True
|
|
18
18
|
cli_public: bool = True
|
|
19
19
|
has_contract: bool = False
|
|
20
|
+
cli_show_effective_context: bool = False
|
|
21
|
+
cli_context_write: bool = False
|
|
20
22
|
|
|
21
23
|
@property
|
|
22
24
|
def trim_key(self) -> str:
|
|
@@ -34,13 +36,13 @@ USER_PUBLIC_TOOL_SPECS: tuple[PublicToolSpec, ...] = (
|
|
|
34
36
|
PublicToolSpec(USER_DOMAIN, "auth_logout", ("auth_logout",), ("auth", "logout")),
|
|
35
37
|
PublicToolSpec(USER_DOMAIN, "workspace_list", ("workspace_list",), ("workspace", "list")),
|
|
36
38
|
PublicToolSpec(USER_DOMAIN, "workspace_select", ("workspace_select",), ("workspace", "select")),
|
|
37
|
-
PublicToolSpec(USER_DOMAIN, "app_list", ("app_list",), ("app", "list")),
|
|
38
|
-
PublicToolSpec(USER_DOMAIN, "app_search", ("app_search",), ("app", "search")),
|
|
39
|
-
PublicToolSpec(USER_DOMAIN, "app_get", ("app_get",), ("app", "get")),
|
|
40
|
-
PublicToolSpec(USER_DOMAIN, "portal_list", ("portal_list",), ("portal", "list")),
|
|
41
|
-
PublicToolSpec(USER_DOMAIN, "portal_get", ("portal_get",), ("portal", "get")),
|
|
42
|
-
PublicToolSpec(USER_DOMAIN, "view_get", ("view_get",), ("view", "get")),
|
|
43
|
-
PublicToolSpec(USER_DOMAIN, "chart_get", ("chart_get",), ("chart", "get")),
|
|
39
|
+
PublicToolSpec(USER_DOMAIN, "app_list", ("app_list",), ("app", "list"), cli_show_effective_context=True),
|
|
40
|
+
PublicToolSpec(USER_DOMAIN, "app_search", ("app_search",), ("app", "search"), cli_show_effective_context=True),
|
|
41
|
+
PublicToolSpec(USER_DOMAIN, "app_get", ("app_get",), ("app", "get"), cli_show_effective_context=True),
|
|
42
|
+
PublicToolSpec(USER_DOMAIN, "portal_list", ("portal_list",), ("portal", "list"), cli_show_effective_context=True),
|
|
43
|
+
PublicToolSpec(USER_DOMAIN, "portal_get", ("portal_get",), ("portal", "get"), cli_show_effective_context=True),
|
|
44
|
+
PublicToolSpec(USER_DOMAIN, "view_get", ("view_get",), ("view", "get"), cli_show_effective_context=True),
|
|
45
|
+
PublicToolSpec(USER_DOMAIN, "chart_get", ("chart_get",), ("chart", "get"), cli_show_effective_context=True),
|
|
44
46
|
PublicToolSpec(USER_DOMAIN, "file_get_upload_info", ("file_get_upload_info",), cli_public=False),
|
|
45
47
|
PublicToolSpec(USER_DOMAIN, "file_upload_local", ("file_upload_local",), cli_public=False),
|
|
46
48
|
PublicToolSpec(USER_DOMAIN, "feedback_submit", ("feedback_submit",), cli_public=False),
|
|
@@ -78,22 +80,22 @@ USER_PUBLIC_TOOL_SPECS: tuple[PublicToolSpec, ...] = (
|
|
|
78
80
|
PublicToolSpec(USER_DOMAIN, "record_member_candidates", ("record_member_candidates",), cli_public=False),
|
|
79
81
|
PublicToolSpec(USER_DOMAIN, "record_department_candidates", ("record_department_candidates",), cli_public=False),
|
|
80
82
|
PublicToolSpec(USER_DOMAIN, "record_analyze", ("record_analyze",), ("record", "analyze")),
|
|
81
|
-
PublicToolSpec(USER_DOMAIN, "record_list", ("record_list",), ("record", "list")),
|
|
82
|
-
PublicToolSpec(USER_DOMAIN, "record_get", ("record_get_public",), ("record", "get")),
|
|
83
|
-
PublicToolSpec(USER_DOMAIN, "record_insert", ("record_insert_public",), ("record", "insert")),
|
|
84
|
-
PublicToolSpec(USER_DOMAIN, "record_update", ("record_update_public",), ("record", "update")),
|
|
85
|
-
PublicToolSpec(USER_DOMAIN, "record_delete", ("record_delete_public",), ("record", "delete")),
|
|
83
|
+
PublicToolSpec(USER_DOMAIN, "record_list", ("record_list",), ("record", "list"), cli_show_effective_context=True),
|
|
84
|
+
PublicToolSpec(USER_DOMAIN, "record_get", ("record_get_public",), ("record", "get"), cli_show_effective_context=True),
|
|
85
|
+
PublicToolSpec(USER_DOMAIN, "record_insert", ("record_insert_public",), ("record", "insert"), cli_show_effective_context=True, cli_context_write=True),
|
|
86
|
+
PublicToolSpec(USER_DOMAIN, "record_update", ("record_update_public",), ("record", "update"), cli_show_effective_context=True, cli_context_write=True),
|
|
87
|
+
PublicToolSpec(USER_DOMAIN, "record_delete", ("record_delete_public",), ("record", "delete"), cli_show_effective_context=True, cli_context_write=True),
|
|
86
88
|
PublicToolSpec(USER_DOMAIN, "record_import_template_get", ("record_import_template_get",), ("import", "template")),
|
|
87
89
|
PublicToolSpec(USER_DOMAIN, "record_import_verify", ("record_import_verify",), ("import", "verify")),
|
|
88
90
|
PublicToolSpec(USER_DOMAIN, "record_import_repair_local", ("record_import_repair_local",), ("import", "repair")),
|
|
89
91
|
PublicToolSpec(USER_DOMAIN, "record_import_start", ("record_import_start",), ("import", "start")),
|
|
90
92
|
PublicToolSpec(USER_DOMAIN, "record_import_status_get", ("record_import_status_get",), ("import", "status")),
|
|
91
|
-
PublicToolSpec(USER_DOMAIN, "record_code_block_run", ("record_code_block_run",), ("record", "code-block-run")),
|
|
92
|
-
PublicToolSpec(USER_DOMAIN, "task_list", ("task_list",), ("task", "list")),
|
|
93
|
-
PublicToolSpec(USER_DOMAIN, "task_get", ("task_get",), ("task", "get")),
|
|
94
|
-
PublicToolSpec(USER_DOMAIN, "task_action_execute", ("task_action_execute",), ("task", "action")),
|
|
95
|
-
PublicToolSpec(USER_DOMAIN, "task_associated_report_detail_get", ("task_associated_report_detail_get",), cli_public=False),
|
|
96
|
-
PublicToolSpec(USER_DOMAIN, "task_workflow_log_get", ("task_workflow_log_get",), ("task", "log")),
|
|
93
|
+
PublicToolSpec(USER_DOMAIN, "record_code_block_run", ("record_code_block_run",), ("record", "code-block-run"), cli_show_effective_context=True, cli_context_write=True),
|
|
94
|
+
PublicToolSpec(USER_DOMAIN, "task_list", ("task_list",), ("task", "list"), cli_show_effective_context=True),
|
|
95
|
+
PublicToolSpec(USER_DOMAIN, "task_get", ("task_get",), ("task", "get"), cli_show_effective_context=True),
|
|
96
|
+
PublicToolSpec(USER_DOMAIN, "task_action_execute", ("task_action_execute",), ("task", "action"), cli_show_effective_context=True, cli_context_write=True),
|
|
97
|
+
PublicToolSpec(USER_DOMAIN, "task_associated_report_detail_get", ("task_associated_report_detail_get",), cli_public=False, cli_show_effective_context=True),
|
|
98
|
+
PublicToolSpec(USER_DOMAIN, "task_workflow_log_get", ("task_workflow_log_get",), ("task", "log"), cli_show_effective_context=True),
|
|
97
99
|
PublicToolSpec(USER_DOMAIN, "directory_search", ("directory_search",), cli_public=False),
|
|
98
100
|
PublicToolSpec(USER_DOMAIN, "directory_list_internal_users", ("directory_list_internal_users",), cli_public=False),
|
|
99
101
|
PublicToolSpec(USER_DOMAIN, "directory_list_all_internal_users", ("directory_list_all_internal_users",), cli_public=False),
|
|
@@ -111,42 +113,44 @@ BUILDER_PUBLIC_TOOL_SPECS: tuple[PublicToolSpec, ...] = (
|
|
|
111
113
|
PublicToolSpec(BUILDER_DOMAIN, "auth_logout", ("auth_logout",), ("builder", "auth", "logout"), cli_public=False),
|
|
112
114
|
PublicToolSpec(BUILDER_DOMAIN, "workspace_list", ("workspace_list",), ("builder", "workspace", "list"), cli_public=False),
|
|
113
115
|
PublicToolSpec(BUILDER_DOMAIN, "workspace_select", ("workspace_select",), ("builder", "workspace", "select"), cli_public=False),
|
|
114
|
-
PublicToolSpec(BUILDER_DOMAIN, "file_upload_local", ("file_upload_local",), ("builder", "file", "upload-local"), has_contract=True),
|
|
116
|
+
PublicToolSpec(BUILDER_DOMAIN, "file_upload_local", ("file_upload_local",), ("builder", "file", "upload-local"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
115
117
|
PublicToolSpec(BUILDER_DOMAIN, "feedback_submit", ("feedback_submit",), ("builder", "feedback", "submit"), has_contract=True),
|
|
116
|
-
PublicToolSpec(BUILDER_DOMAIN, "package_list", ("package_list",), ("builder", "package", "list"), has_contract=True),
|
|
117
|
-
PublicToolSpec(BUILDER_DOMAIN, "package_resolve", ("package_resolve",), ("builder", "package", "resolve"), has_contract=True),
|
|
118
|
+
PublicToolSpec(BUILDER_DOMAIN, "package_list", ("package_list",), ("builder", "package", "list"), has_contract=True, cli_show_effective_context=True),
|
|
119
|
+
PublicToolSpec(BUILDER_DOMAIN, "package_resolve", ("package_resolve",), ("builder", "package", "resolve"), has_contract=True, cli_show_effective_context=True),
|
|
118
120
|
PublicToolSpec(BUILDER_DOMAIN, "builder_tool_contract", ("builder_tool_contract",), ("builder", "contract"), has_contract=False),
|
|
119
|
-
PublicToolSpec(BUILDER_DOMAIN, "package_create", ("package_create",), ("builder", "package", "create"), has_contract=True),
|
|
120
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
121
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
122
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
123
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
124
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
125
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
126
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
127
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
128
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
129
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
130
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
131
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
132
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
133
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
134
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
135
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
136
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
137
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
138
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
139
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
140
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
141
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
142
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
143
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
144
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
145
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
146
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
147
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
148
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
149
|
-
PublicToolSpec(BUILDER_DOMAIN, "
|
|
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),
|
|
124
|
+
PublicToolSpec(BUILDER_DOMAIN, "solution_install", ("solution_install",), ("builder", "solution", "install"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
125
|
+
PublicToolSpec(BUILDER_DOMAIN, "member_search", ("member_search",), ("builder", "member", "search"), has_contract=True, cli_show_effective_context=True),
|
|
126
|
+
PublicToolSpec(BUILDER_DOMAIN, "role_search", ("role_search",), ("builder", "role", "search"), has_contract=True, cli_show_effective_context=True),
|
|
127
|
+
PublicToolSpec(BUILDER_DOMAIN, "role_create", ("role_create",), ("builder", "role", "create"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
128
|
+
PublicToolSpec(BUILDER_DOMAIN, "package_attach_app", ("package_attach_app",), ("builder", "package", "attach-app"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
129
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_release_edit_lock_if_mine", ("app_release_edit_lock_if_mine",), ("builder", "app", "release-edit-lock-if-mine"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
130
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_resolve", ("app_resolve",), ("builder", "app", "resolve"), has_contract=True, cli_show_effective_context=True),
|
|
131
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_custom_button_list", ("app_custom_button_list",), ("builder", "button", "list"), has_contract=True, cli_show_effective_context=True),
|
|
132
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_custom_button_get", ("app_custom_button_get",), ("builder", "button", "get"), has_contract=True, cli_show_effective_context=True),
|
|
133
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_custom_button_create", ("app_custom_button_create",), ("builder", "button", "create"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
134
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_custom_button_update", ("app_custom_button_update",), ("builder", "button", "update"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
135
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_custom_button_delete", ("app_custom_button_delete",), ("builder", "button", "delete"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
136
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_get", ("app_get",), ("builder", "app", "get", "summary"), has_contract=True, cli_show_effective_context=True),
|
|
137
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_get_fields", ("app_get_fields",), ("builder", "app", "get", "fields"), has_contract=True, cli_show_effective_context=True),
|
|
138
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_repair_code_blocks", ("app_repair_code_blocks",), ("builder", "app", "repair-code-blocks"), has_contract=True, cli_show_effective_context=True),
|
|
139
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_get_layout", ("app_get_layout",), ("builder", "app", "get", "layout"), has_contract=True, cli_show_effective_context=True),
|
|
140
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_get_views", ("app_get_views",), ("builder", "app", "get", "views"), has_contract=True, cli_show_effective_context=True),
|
|
141
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_get_flow", ("app_get_flow",), ("builder", "app", "get", "flow"), has_contract=True, cli_show_effective_context=True),
|
|
142
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_get_charts", ("app_get_charts",), ("builder", "app", "get", "charts"), has_contract=True, cli_show_effective_context=True),
|
|
143
|
+
PublicToolSpec(BUILDER_DOMAIN, "portal_list", ("portal_list",), ("builder", "portal", "list"), has_contract=True, cli_show_effective_context=True),
|
|
144
|
+
PublicToolSpec(BUILDER_DOMAIN, "portal_get", ("portal_get",), ("builder", "portal", "get"), has_contract=True, cli_show_effective_context=True),
|
|
145
|
+
PublicToolSpec(BUILDER_DOMAIN, "view_get", ("view_get",), ("builder", "view", "get"), has_contract=True, cli_show_effective_context=True),
|
|
146
|
+
PublicToolSpec(BUILDER_DOMAIN, "chart_get", ("chart_get",), ("builder", "chart", "get"), has_contract=True, cli_show_effective_context=True),
|
|
147
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_schema_apply", ("app_schema_apply",), ("builder", "schema", "apply"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
148
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_layout_apply", ("app_layout_apply",), ("builder", "layout", "apply"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
149
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_flow_apply", ("app_flow_apply",), ("builder", "flow", "apply"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
150
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_views_apply", ("app_views_apply",), ("builder", "views", "apply"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
151
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_charts_apply", ("app_charts_apply",), ("builder", "charts", "apply"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
152
|
+
PublicToolSpec(BUILDER_DOMAIN, "portal_apply", ("portal_apply",), ("builder", "portal", "apply"), has_contract=True, cli_show_effective_context=True, cli_context_write=True),
|
|
153
|
+
PublicToolSpec(BUILDER_DOMAIN, "app_publish_verify", ("app_publish_verify",), ("builder", "publish", "verify"), has_contract=True, cli_show_effective_context=True),
|
|
150
154
|
)
|
|
151
155
|
|
|
152
156
|
|
|
@@ -195,6 +199,13 @@ def cli_trim_key_from_namespace(args: Namespace) -> str | None:
|
|
|
195
199
|
return spec.trim_key if spec is not None else None
|
|
196
200
|
|
|
197
201
|
|
|
202
|
+
def cli_public_tool_spec_from_namespace(args: Namespace) -> PublicToolSpec | None:
|
|
203
|
+
route = cli_route_from_namespace(args)
|
|
204
|
+
if route is None:
|
|
205
|
+
return None
|
|
206
|
+
return PUBLIC_TOOL_BY_CLI_ROUTE.get(route)
|
|
207
|
+
|
|
208
|
+
|
|
198
209
|
def cli_route_from_namespace(args: Namespace) -> tuple[str, ...] | None:
|
|
199
210
|
command = getattr(args, "command", None)
|
|
200
211
|
if not isinstance(command, str) or not command:
|
|
@@ -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,
|