alloy-runtime-cli 0.1.0__py3-none-any.whl
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.
- alloy_runtime_cli-0.1.0.dist-info/METADATA +61 -0
- alloy_runtime_cli-0.1.0.dist-info/RECORD +451 -0
- alloy_runtime_cli-0.1.0.dist-info/WHEEL +5 -0
- alloy_runtime_cli-0.1.0.dist-info/entry_points.txt +2 -0
- alloy_runtime_cli-0.1.0.dist-info/top_level.txt +1 -0
- cli/__init__.py +0 -0
- cli/commands/__init__.py +0 -0
- cli/commands/admin/__init__.py +0 -0
- cli/commands/admin/bootstrap_command.py +118 -0
- cli/commands/admin/credentials/__init__.py +0 -0
- cli/commands/admin/credentials/create/__init__.py +0 -0
- cli/commands/admin/credentials/create/command.py +148 -0
- cli/commands/admin/credentials/create/presenter.py +16 -0
- cli/commands/admin/credentials/grant/__init__.py +0 -0
- cli/commands/admin/credentials/grant/command.py +119 -0
- cli/commands/admin/credentials/grant/fields.py +33 -0
- cli/commands/admin/credentials/grant/presenter.py +23 -0
- cli/commands/agents/__init__.py +0 -0
- cli/commands/agents/create/__init__.py +0 -0
- cli/commands/agents/create/command.py +475 -0
- cli/commands/agents/create/fields.py +64 -0
- cli/commands/agents/create/presenter.py +68 -0
- cli/commands/agents/delete/__init__.py +0 -0
- cli/commands/agents/delete/command.py +47 -0
- cli/commands/agents/delete/presenter.py +16 -0
- cli/commands/agents/get/command.py +37 -0
- cli/commands/agents/get/presenter.py +32 -0
- cli/commands/agents/list/__init__.py +1 -0
- cli/commands/agents/list/command.py +54 -0
- cli/commands/agents/list/presenter.py +82 -0
- cli/commands/agents/update/__init__.py +0 -0
- cli/commands/agents/update/command.py +435 -0
- cli/commands/agents/update/fields.py +40 -0
- cli/commands/agents/update/presenter.py +68 -0
- cli/commands/audio/__init__.py +0 -0
- cli/commands/audio/transcribe/__init__.py +0 -0
- cli/commands/audio/transcribe/command.py +144 -0
- cli/commands/audio/transcribe/presenter.py +15 -0
- cli/commands/auth/__init__.py +0 -0
- cli/commands/auth/login/__init__.py +0 -0
- cli/commands/auth/login/command.py +80 -0
- cli/commands/auth/signup/__init__.py +0 -0
- cli/commands/auth/signup/command.py +115 -0
- cli/commands/billing/__init__.py +1 -0
- cli/commands/billing/costs/__init__.py +1 -0
- cli/commands/billing/costs/by_agent/__init__.py +1 -0
- cli/commands/billing/costs/by_agent/command.py +57 -0
- cli/commands/billing/costs/by_agent/presenter.py +81 -0
- cli/commands/billing/costs/by_model/__init__.py +1 -0
- cli/commands/billing/costs/by_model/command.py +57 -0
- cli/commands/billing/costs/by_model/presenter.py +80 -0
- cli/commands/billing/costs/daily/__init__.py +1 -0
- cli/commands/billing/costs/daily/command.py +55 -0
- cli/commands/billing/costs/daily/presenter.py +75 -0
- cli/commands/billing/costs/summary/__init__.py +1 -0
- cli/commands/billing/costs/summary/command.py +57 -0
- cli/commands/billing/costs/summary/presenter.py +42 -0
- cli/commands/billing/projects/__init__.py +1 -0
- cli/commands/billing/projects/create/__init__.py +1 -0
- cli/commands/billing/projects/create/command.py +60 -0
- cli/commands/billing/projects/create/presenter.py +26 -0
- cli/commands/billing/projects/get/__init__.py +1 -0
- cli/commands/billing/projects/get/command.py +33 -0
- cli/commands/billing/projects/get/presenter.py +32 -0
- cli/commands/billing/projects/list/__init__.py +1 -0
- cli/commands/billing/projects/list/command.py +40 -0
- cli/commands/billing/projects/list/presenter.py +57 -0
- cli/commands/content/__init__.py +1 -0
- cli/commands/content/delete/__init__.py +0 -0
- cli/commands/content/delete/command.py +49 -0
- cli/commands/content/delete/presenter.py +18 -0
- cli/commands/content/edit/__init__.py +1 -0
- cli/commands/content/edit/command.py +155 -0
- cli/commands/content/edit/editor.py +150 -0
- cli/commands/content/edit/presenter.py +146 -0
- cli/commands/content/get/__init__.py +1 -0
- cli/commands/content/get/command.py +39 -0
- cli/commands/content/get/presenter.py +176 -0
- cli/commands/content/list/__init__.py +1 -0
- cli/commands/content/list/command.py +347 -0
- cli/commands/content/list/export_formatters.py +409 -0
- cli/commands/content/list/export_handler.py +165 -0
- cli/commands/content/list/presenter.py +190 -0
- cli/commands/credentials/__init__.py +0 -0
- cli/commands/credentials/create/__init__.py +0 -0
- cli/commands/credentials/create/command.py +165 -0
- cli/commands/credentials/create/fields.py +38 -0
- cli/commands/credentials/create/presenter.py +20 -0
- cli/commands/credentials/update/__init__.py +0 -0
- cli/commands/credentials/update/command.py +53 -0
- cli/commands/credentials/update/fields.py +71 -0
- cli/commands/credentials/update/presenter.py +16 -0
- cli/commands/flag_utils.py +366 -0
- cli/commands/generate/__init__.py +0 -0
- cli/commands/generate/cancel/__init__.py +1 -0
- cli/commands/generate/cancel/command.py +44 -0
- cli/commands/generate/cancel/presenter.py +26 -0
- cli/commands/generate/status/__init__.py +1 -0
- cli/commands/generate/status/command.py +58 -0
- cli/commands/generate/status/presenter.py +78 -0
- cli/commands/generate/text/__init__.py +0 -0
- cli/commands/generate/text/command.py +1325 -0
- cli/commands/generate/text/concurrent_renderer.py +355 -0
- cli/commands/generate/text/presenter.py +287 -0
- cli/commands/generate/text/stream_renderer.py +129 -0
- cli/commands/knowledge/__init__.py +0 -0
- cli/commands/knowledge/collections/__init__.py +0 -0
- cli/commands/knowledge/collections/cluster/__init__.py +0 -0
- cli/commands/knowledge/collections/cluster/command.py +64 -0
- cli/commands/knowledge/collections/cluster/presenter.py +74 -0
- cli/commands/knowledge/collections/cluster_status/__init__.py +0 -0
- cli/commands/knowledge/collections/cluster_status/command.py +46 -0
- cli/commands/knowledge/collections/cluster_status/presenter.py +10 -0
- cli/commands/knowledge/collections/create/__init__.py +0 -0
- cli/commands/knowledge/collections/create/command.py +137 -0
- cli/commands/knowledge/collections/create/presenter.py +38 -0
- cli/commands/knowledge/collections/delete/__init__.py +1 -0
- cli/commands/knowledge/collections/delete/command.py +47 -0
- cli/commands/knowledge/collections/delete/presenter.py +20 -0
- cli/commands/knowledge/collections/get/__init__.py +1 -0
- cli/commands/knowledge/collections/get/command.py +30 -0
- cli/commands/knowledge/collections/get/presenter.py +44 -0
- cli/commands/knowledge/collections/list/__init__.py +1 -0
- cli/commands/knowledge/collections/list/command.py +41 -0
- cli/commands/knowledge/collections/list/presenter.py +68 -0
- cli/commands/knowledge/collections/update/__init__.py +0 -0
- cli/commands/knowledge/collections/update/command.py +97 -0
- cli/commands/knowledge/collections/update/presenter.py +42 -0
- cli/commands/knowledge/documents/__init__.py +0 -0
- cli/commands/knowledge/documents/bulk_metadata/__init__.py +0 -0
- cli/commands/knowledge/documents/bulk_metadata/command.py +119 -0
- cli/commands/knowledge/documents/bulk_metadata/presenter.py +36 -0
- cli/commands/knowledge/documents/delete/__init__.py +0 -0
- cli/commands/knowledge/documents/delete/command.py +47 -0
- cli/commands/knowledge/documents/delete/presenter.py +20 -0
- cli/commands/knowledge/documents/get/__init__.py +0 -0
- cli/commands/knowledge/documents/get/command.py +39 -0
- cli/commands/knowledge/documents/get/presenter.py +78 -0
- cli/commands/knowledge/documents/ingest/__init__.py +0 -0
- cli/commands/knowledge/documents/ingest/command.py +222 -0
- cli/commands/knowledge/documents/ingest/presenter.py +41 -0
- cli/commands/knowledge/documents/list/__init__.py +0 -0
- cli/commands/knowledge/documents/list/command.py +69 -0
- cli/commands/knowledge/documents/list/presenter.py +86 -0
- cli/commands/knowledge/documents/reingest/__init__.py +0 -0
- cli/commands/knowledge/documents/reingest/command.py +102 -0
- cli/commands/knowledge/documents/reingest/presenter.py +70 -0
- cli/commands/knowledge/documents/update/__init__.py +0 -0
- cli/commands/knowledge/documents/update/command.py +85 -0
- cli/commands/knowledge/documents/update/presenter.py +37 -0
- cli/commands/knowledge/recover/__init__.py +0 -0
- cli/commands/knowledge/recover/command.py +46 -0
- cli/commands/knowledge/recover/presenter.py +79 -0
- cli/commands/knowledge/search/__init__.py +0 -0
- cli/commands/knowledge/search/command.py +218 -0
- cli/commands/knowledge/search/presenter.py +111 -0
- cli/commands/knowledge/synthesis/__init__.py +0 -0
- cli/commands/knowledge/synthesis/create/__init__.py +0 -0
- cli/commands/knowledge/synthesis/create/command.py +127 -0
- cli/commands/knowledge/synthesis/create/presenter.py +33 -0
- cli/commands/knowledge/synthesis/delete/__init__.py +0 -0
- cli/commands/knowledge/synthesis/delete/command.py +53 -0
- cli/commands/knowledge/synthesis/delete/presenter.py +31 -0
- cli/commands/knowledge/synthesis/get/__init__.py +0 -0
- cli/commands/knowledge/synthesis/get/command.py +55 -0
- cli/commands/knowledge/synthesis/get/presenter.py +114 -0
- cli/commands/knowledge/synthesis/list/__init__.py +0 -0
- cli/commands/knowledge/synthesis/list/command.py +132 -0
- cli/commands/knowledge/synthesis/list/presenter.py +84 -0
- cli/commands/knowledge/synthesis/refresh/__init__.py +0 -0
- cli/commands/knowledge/synthesis/refresh/command.py +42 -0
- cli/commands/knowledge/synthesis/refresh/presenter.py +33 -0
- cli/commands/knowledge/synthesis/update/__init__.py +0 -0
- cli/commands/knowledge/synthesis/update/command.py +76 -0
- cli/commands/knowledge/synthesis/update/presenter.py +41 -0
- cli/commands/models/__init__.py +0 -0
- cli/commands/models/list/__init__.py +0 -0
- cli/commands/models/list/command.py +84 -0
- cli/commands/models/list/presenter.py +114 -0
- cli/commands/organizations/__init__.py +0 -0
- cli/commands/organizations/create/command.py +32 -0
- cli/commands/organizations/create/presenter.py +9 -0
- cli/commands/pipelines/__init__.py +1 -0
- cli/commands/pipelines/approvals/__init__.py +1 -0
- cli/commands/pipelines/approvals/decide_command.py +77 -0
- cli/commands/pipelines/approvals/get_command.py +44 -0
- cli/commands/pipelines/approvals/presenter.py +56 -0
- cli/commands/pipelines/costs/__init__.py +1 -0
- cli/commands/pipelines/costs/command.py +57 -0
- cli/commands/pipelines/costs/daily_command.py +54 -0
- cli/commands/pipelines/costs/daily_presenter.py +59 -0
- cli/commands/pipelines/costs/presenter.py +37 -0
- cli/commands/pipelines/create/__init__.py +1 -0
- cli/commands/pipelines/create/command.py +103 -0
- cli/commands/pipelines/create/presenter.py +22 -0
- cli/commands/pipelines/env_vars/__init__.py +1 -0
- cli/commands/pipelines/env_vars/command.py +51 -0
- cli/commands/pipelines/env_vars/presenter.py +16 -0
- cli/commands/pipelines/execute/__init__.py +1 -0
- cli/commands/pipelines/execute/command.py +142 -0
- cli/commands/pipelines/execute/presenter.py +47 -0
- cli/commands/pipelines/executions/__init__.py +1 -0
- cli/commands/pipelines/executions/costs/__init__.py +1 -0
- cli/commands/pipelines/executions/costs/command.py +48 -0
- cli/commands/pipelines/executions/costs/presenter.py +29 -0
- cli/commands/pipelines/executions/costs_by_model/__init__.py +1 -0
- cli/commands/pipelines/executions/costs_by_model/command.py +50 -0
- cli/commands/pipelines/executions/costs_by_model/presenter.py +78 -0
- cli/commands/pipelines/executions/costs_by_step/__init__.py +1 -0
- cli/commands/pipelines/executions/costs_by_step/command.py +50 -0
- cli/commands/pipelines/executions/costs_by_step/presenter.py +72 -0
- cli/commands/pipelines/executions/get_command.py +38 -0
- cli/commands/pipelines/executions/list_command.py +123 -0
- cli/commands/pipelines/executions/presenter.py +131 -0
- cli/commands/pipelines/executions/rerun_command.py +41 -0
- cli/commands/pipelines/executions/update/__init__.py +1 -0
- cli/commands/pipelines/executions/update/command.py +110 -0
- cli/commands/pipelines/executions/update/presenter.py +28 -0
- cli/commands/pipelines/get/__init__.py +1 -0
- cli/commands/pipelines/get/command.py +33 -0
- cli/commands/pipelines/get/presenter.py +48 -0
- cli/commands/pipelines/list/__init__.py +1 -0
- cli/commands/pipelines/list/command.py +53 -0
- cli/commands/pipelines/list/presenter.py +66 -0
- cli/commands/pipelines/schedules/__init__.py +1 -0
- cli/commands/pipelines/schedules/create_command.py +119 -0
- cli/commands/pipelines/schedules/create_presenter.py +35 -0
- cli/commands/pipelines/schedules/delete_command.py +52 -0
- cli/commands/pipelines/schedules/env_vars_command.py +59 -0
- cli/commands/pipelines/schedules/env_vars_presenter.py +16 -0
- cli/commands/pipelines/schedules/get_command.py +38 -0
- cli/commands/pipelines/schedules/list_command.py +33 -0
- cli/commands/pipelines/schedules/once_command.py +90 -0
- cli/commands/pipelines/schedules/once_presenter.py +30 -0
- cli/commands/pipelines/schedules/presenter.py +104 -0
- cli/commands/pipelines/schedules/update_command.py +139 -0
- cli/commands/pipelines/schedules/update_presenter.py +29 -0
- cli/commands/render/__init__.py +0 -0
- cli/commands/render/html_to_image/__init__.py +0 -0
- cli/commands/render/html_to_image/command.py +170 -0
- cli/commands/schemas/__init__.py +0 -0
- cli/commands/schemas/create/__init__.py +0 -0
- cli/commands/schemas/create/command.py +122 -0
- cli/commands/schemas/create/presenter.py +53 -0
- cli/commands/schemas/delete/command.py +45 -0
- cli/commands/schemas/delete/presenter.py +9 -0
- cli/commands/schemas/get/__init__.py +0 -0
- cli/commands/schemas/get/command.py +56 -0
- cli/commands/schemas/get/presenter.py +129 -0
- cli/commands/schemas/list/__init__.py +0 -0
- cli/commands/schemas/list/command.py +64 -0
- cli/commands/schemas/list/presenter.py +133 -0
- cli/commands/schemas/update/__init__.py +0 -0
- cli/commands/schemas/update/command.py +369 -0
- cli/commands/schemas/update/presenter.py +53 -0
- cli/commands/sessions/__init__.py +1 -0
- cli/commands/sessions/delete/__init__.py +1 -0
- cli/commands/sessions/delete/command.py +47 -0
- cli/commands/sessions/delete/presenter.py +10 -0
- cli/commands/sessions/get/__init__.py +1 -0
- cli/commands/sessions/get/command.py +42 -0
- cli/commands/sessions/get/presenter.py +59 -0
- cli/commands/sessions/list/__init__.py +1 -0
- cli/commands/sessions/list/command.py +61 -0
- cli/commands/sessions/list/presenter.py +68 -0
- cli/commands/sessions/messages/__init__.py +1 -0
- cli/commands/sessions/messages/command.py +78 -0
- cli/commands/sessions/messages/presenter.py +79 -0
- cli/commands/shared_flags.py +500 -0
- cli/commands/sync/__init__.py +0 -0
- cli/commands/sync/command.py +45 -0
- cli/commands/sync/presenter.py +49 -0
- cli/commands/tags/__init__.py +1 -0
- cli/commands/tags/create/__init__.py +1 -0
- cli/commands/tags/create/command.py +60 -0
- cli/commands/tags/delete/__init__.py +1 -0
- cli/commands/tags/delete/command.py +47 -0
- cli/commands/tags/delete/presenter.py +10 -0
- cli/commands/tags/get/command.py +31 -0
- cli/commands/tags/get/presenter.py +23 -0
- cli/commands/tags/list/__init__.py +1 -0
- cli/commands/tags/list/command.py +52 -0
- cli/commands/tags/list/presenter.py +49 -0
- cli/commands/tags/update/command.py +64 -0
- cli/commands/tags/update/presenter.py +9 -0
- cli/commands/templates/__init__.py +0 -0
- cli/commands/templates/create/__init__.py +0 -0
- cli/commands/templates/create/command.py +152 -0
- cli/commands/templates/create/presenter.py +86 -0
- cli/commands/templates/delete/__init__.py +0 -0
- cli/commands/templates/delete/command.py +47 -0
- cli/commands/templates/delete/presenter.py +16 -0
- cli/commands/templates/get/__init__.py +0 -0
- cli/commands/templates/get/command.py +52 -0
- cli/commands/templates/get/presenter.py +233 -0
- cli/commands/templates/get_by_version/command.py +32 -0
- cli/commands/templates/get_by_version/presenter.py +30 -0
- cli/commands/templates/list/__init__.py +1 -0
- cli/commands/templates/list/command.py +102 -0
- cli/commands/templates/list/presenter.py +93 -0
- cli/commands/templates/render/__init__.py +0 -0
- cli/commands/templates/render/command.py +115 -0
- cli/commands/templates/render/presenter.py +276 -0
- cli/commands/templates/update/__init__.py +0 -0
- cli/commands/templates/update/command.py +199 -0
- cli/commands/templates/update/presenter.py +94 -0
- cli/commands/templates/version/__init__.py +1 -0
- cli/commands/templates/version/command.py +116 -0
- cli/commands/templates/version/presenter.py +100 -0
- cli/commands/tool_configs/__init__.py +0 -0
- cli/commands/tool_configs/create/__init__.py +0 -0
- cli/commands/tool_configs/create/command.py +118 -0
- cli/commands/tool_configs/create/presenter.py +53 -0
- cli/commands/tool_configs/delete/__init__.py +0 -0
- cli/commands/tool_configs/delete/command.py +47 -0
- cli/commands/tool_configs/delete/presenter.py +18 -0
- cli/commands/tool_configs/get/__init__.py +0 -0
- cli/commands/tool_configs/get/command.py +31 -0
- cli/commands/tool_configs/get/presenter.py +62 -0
- cli/commands/tool_configs/list/__init__.py +0 -0
- cli/commands/tool_configs/list/command.py +59 -0
- cli/commands/tool_configs/list/presenter.py +60 -0
- cli/commands/tool_configs/update/__init__.py +0 -0
- cli/commands/tool_configs/update/command.py +128 -0
- cli/commands/tool_configs/update/presenter.py +53 -0
- cli/commands/tools/__init__.py +1 -0
- cli/commands/tools/get/__init__.py +1 -0
- cli/commands/tools/get/command.py +42 -0
- cli/commands/tools/get/presenter.py +45 -0
- cli/commands/tools/list/__init__.py +1 -0
- cli/commands/tools/list/command.py +56 -0
- cli/commands/tools/list/presenter.py +44 -0
- cli/commands/users/__init__.py +0 -0
- cli/commands/users/create/command.py +53 -0
- cli/commands/users/create/presenter.py +9 -0
- cli/commands/whoami/__init__.py +0 -0
- cli/commands/whoami/command.py +42 -0
- cli/infrastructure/__init__.py +0 -0
- cli/infrastructure/auth_storage.py +71 -0
- cli/infrastructure/client_factory.py +36 -0
- cli/infrastructure/command.py +75 -0
- cli/infrastructure/config.py +188 -0
- cli/infrastructure/console.py +27 -0
- cli/infrastructure/editor.py +138 -0
- cli/infrastructure/error_display.py +178 -0
- cli/infrastructure/field_extractor.py +360 -0
- cli/infrastructure/file_content.py +210 -0
- cli/infrastructure/filter_parser.py +256 -0
- cli/infrastructure/formatters/__init__.py +0 -0
- cli/infrastructure/formatters/base.py +99 -0
- cli/infrastructure/formatters/compact_formatter.py +245 -0
- cli/infrastructure/formatters/json_formatter.py +84 -0
- cli/infrastructure/formatters/lines_formatter.py +102 -0
- cli/infrastructure/formatting/__init__.py +0 -0
- cli/infrastructure/formatting/fields.py +193 -0
- cli/infrastructure/forms/__init__.py +0 -0
- cli/infrastructure/forms/agent_picker.py +123 -0
- cli/infrastructure/forms/agent_tool_editor.py +384 -0
- cli/infrastructure/forms/agent_tools_manager.py +212 -0
- cli/infrastructure/forms/base_picker.py +469 -0
- cli/infrastructure/forms/components.py +126 -0
- cli/infrastructure/forms/json_schema_builder.py +149 -0
- cli/infrastructure/forms/model_picker.py +134 -0
- cli/infrastructure/forms/parsers.py +173 -0
- cli/infrastructure/forms/resolution_modal.py +302 -0
- cli/infrastructure/forms/schema_picker.py +137 -0
- cli/infrastructure/forms/tag_management_modal.py +103 -0
- cli/infrastructure/forms/tag_picker.py +207 -0
- cli/infrastructure/forms/template_picker.py +131 -0
- cli/infrastructure/forms/tool_config_picker.py +130 -0
- cli/infrastructure/forms/tool_picker.py +103 -0
- cli/infrastructure/injection/__init__.py +0 -0
- cli/infrastructure/injection/parser.py +302 -0
- cli/infrastructure/injection/resolver.py +399 -0
- cli/infrastructure/kv_parser.py +130 -0
- cli/infrastructure/local_storage.py +227 -0
- cli/infrastructure/macro_parser.py +215 -0
- cli/infrastructure/output.py +192 -0
- cli/infrastructure/provider_setup.py +81 -0
- cli/infrastructure/renderers/__init__.py +0 -0
- cli/infrastructure/renderers/entity_renderer.py +77 -0
- cli/infrastructure/renderers/list_renderer.py +114 -0
- cli/infrastructure/scope_utils.py +47 -0
- cli/infrastructure/spinner.py +101 -0
- cli/infrastructure/tui/__init__.py +0 -0
- cli/infrastructure/tui/clipboard.py +41 -0
- cli/infrastructure/tui/formatters.py +105 -0
- cli/infrastructure/tui/preview.py +14 -0
- cli/infrastructure/tui/selectable.py +198 -0
- cli/infrastructure/validation/__init__.py +0 -0
- cli/infrastructure/validation/tag_validation.py +74 -0
- cli/main.py +759 -0
- cli/tui/__init__.py +0 -0
- cli/tui/app.py +199 -0
- cli/tui/app_store.py +73 -0
- cli/tui/chat/__init__.py +0 -0
- cli/tui/chat/commands/__init__.py +0 -0
- cli/tui/chat/commands/base.py +65 -0
- cli/tui/chat/commands/create_session.py +135 -0
- cli/tui/chat/commands/load_session.py +119 -0
- cli/tui/chat/commands/regenerate.py +120 -0
- cli/tui/chat/commands/reload_session.py +63 -0
- cli/tui/chat/commands/send_message.py +190 -0
- cli/tui/chat/commands/undo.py +66 -0
- cli/tui/chat/editor.py +71 -0
- cli/tui/chat/messages.py +223 -0
- cli/tui/chat/pane.py +141 -0
- cli/tui/chat/renderers/__init__.py +0 -0
- cli/tui/chat/renderers/base.py +72 -0
- cli/tui/chat/renderers/markdown.py +250 -0
- cli/tui/chat/renderers/plain.py +83 -0
- cli/tui/chat/screen.py +1155 -0
- cli/tui/chat/services/__init__.py +0 -0
- cli/tui/chat/services/injection.py +386 -0
- cli/tui/chat/services/name_generator.py +256 -0
- cli/tui/chat/slash_commands.py +424 -0
- cli/tui/chat/store.py +280 -0
- cli/tui/chat/types.py +220 -0
- cli/tui/chat/widgets/__init__.py +0 -0
- cli/tui/chat/widgets/chat_header.py +75 -0
- cli/tui/chat/widgets/chat_input.py +362 -0
- cli/tui/chat/widgets/injection_popup.py +161 -0
- cli/tui/chat/widgets/message_display.py +287 -0
- cli/tui/chat/widgets/session_sidebar.py +214 -0
- cli/tui/chat/widgets/welcome_screen.py +290 -0
- cli/tui/screens/__init__.py +0 -0
- cli/tui/screens/agents.py +344 -0
- cli/tui/screens/base.py +301 -0
- cli/tui/screens/content.py +508 -0
- cli/tui/screens/dashboard.py +89 -0
- cli/tui/screens/models.py +96 -0
- cli/tui/screens/nav_screen.py +186 -0
- cli/tui/screens/schemas.py +522 -0
- cli/tui/screens/templates.py +734 -0
- cli/tui/screens/tool_configs.py +335 -0
- cli/tui/styles/__init__.py +0 -0
- cli/tui/widgets/__init__.py +0 -0
- cli/tui/widgets/agent_create_modal.py +139 -0
- cli/tui/widgets/agent_form_modal.py +659 -0
- cli/tui/widgets/agent_update_modal.py +299 -0
- cli/tui/widgets/base_form_modal.py +77 -0
- cli/tui/widgets/confirm_modal.py +75 -0
- cli/tui/widgets/help_modal.py +145 -0
- cli/tui/widgets/new_session_modal.py +328 -0
- cli/tui/widgets/schema_create_modal.py +271 -0
- cli/tui/widgets/schema_update_modal.py +188 -0
- cli/tui/widgets/status_footer.py +147 -0
- cli/tui/widgets/template_create_modal.py +502 -0
- cli/tui/widgets/template_update_modal.py +308 -0
- cli/tui/widgets/tool_config_create_modal.py +216 -0
- cli/tui/widgets/tool_config_update_modal.py +208 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Agents get command implementation."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
|
|
5
|
+
from cli.commands.agents.get.presenter import present_agent_details
|
|
6
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def agents_get_command(
|
|
10
|
+
agent: str = typer.Argument(
|
|
11
|
+
...,
|
|
12
|
+
help="Agent name or UUID",
|
|
13
|
+
),
|
|
14
|
+
) -> None:
|
|
15
|
+
"""Get details of a single agent.
|
|
16
|
+
|
|
17
|
+
Retrieves the full agent configuration including models and tools.
|
|
18
|
+
The agent can be specified by name or UUID.
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
ai agents get my-agent
|
|
22
|
+
ai agents get 123e4567-89ab-cdef-0123-456789abcdef
|
|
23
|
+
"""
|
|
24
|
+
_execute_get(agent_identifier=agent)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@async_command
|
|
28
|
+
async def _execute_get(agent_identifier: str) -> None:
|
|
29
|
+
"""Execute get agent operation.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
agent_identifier: Agent name or UUID
|
|
33
|
+
"""
|
|
34
|
+
async with authenticated_client() as (_config, client):
|
|
35
|
+
response = await client.get_agent(agent_identifier)
|
|
36
|
+
|
|
37
|
+
present_agent_details(response)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Presenter for agents get command output."""
|
|
2
|
+
|
|
3
|
+
from rich.table import Table
|
|
4
|
+
|
|
5
|
+
from cli.infrastructure.output import OutputService
|
|
6
|
+
from alloy_runtime_types.dtos.agents import GetAgentResponse
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def present_agent_details(response: GetAgentResponse) -> None:
|
|
10
|
+
"""Present agent details with Rich formatting.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
response: GetAgentResponse from server
|
|
14
|
+
"""
|
|
15
|
+
output = OutputService.get()
|
|
16
|
+
|
|
17
|
+
output.success(f"Retrieved agent: {response.name}")
|
|
18
|
+
|
|
19
|
+
table = Table(show_header=False, box=None, padding=(0, 1))
|
|
20
|
+
table.add_column("Field", style="dim", width=20)
|
|
21
|
+
table.add_column("Value")
|
|
22
|
+
|
|
23
|
+
table.add_row("ID", str(response.id))
|
|
24
|
+
table.add_row("Name", response.name)
|
|
25
|
+
table.add_row("Description", response.description or "-")
|
|
26
|
+
table.add_row("Models", f"{len(response.models)} configured")
|
|
27
|
+
table.add_row("Tools", f"{len(response.tools)} configured")
|
|
28
|
+
table.add_row(
|
|
29
|
+
"Tags", ", ".join(t.tag_path for t in response.tags) if response.tags else "-"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
output.console.print(table)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Agents list command implementation."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from cli.commands.agents.list.presenter import present_agents_list
|
|
8
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def agents_list_command(
|
|
12
|
+
search: Optional[str] = typer.Option(
|
|
13
|
+
None,
|
|
14
|
+
"-s",
|
|
15
|
+
"--search",
|
|
16
|
+
help="Fuzzy search terms",
|
|
17
|
+
),
|
|
18
|
+
limit: int = typer.Option(
|
|
19
|
+
50,
|
|
20
|
+
"-l",
|
|
21
|
+
"--limit",
|
|
22
|
+
min=1,
|
|
23
|
+
max=100,
|
|
24
|
+
help="Max results",
|
|
25
|
+
),
|
|
26
|
+
offset: int = typer.Option(
|
|
27
|
+
0,
|
|
28
|
+
"--offset",
|
|
29
|
+
min=0,
|
|
30
|
+
help="Skip N results",
|
|
31
|
+
),
|
|
32
|
+
) -> None:
|
|
33
|
+
"""List agents accessible to you.
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
ai agents list
|
|
37
|
+
ai agents list -s "claude opus"
|
|
38
|
+
ai agents list -l 20
|
|
39
|
+
ai agents list -s bot -l 10 --offset 20
|
|
40
|
+
"""
|
|
41
|
+
_execute_list(search=search, limit=limit, offset=offset)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@async_command
|
|
45
|
+
async def _execute_list(search: Optional[str], limit: int, offset: int) -> None:
|
|
46
|
+
"""Execute list agents operation."""
|
|
47
|
+
async with authenticated_client() as (_config, client):
|
|
48
|
+
response = await client.list_agents(
|
|
49
|
+
search=search,
|
|
50
|
+
limit=limit,
|
|
51
|
+
offset=offset,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
present_agents_list(response)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Presenter for agents list command output."""
|
|
2
|
+
|
|
3
|
+
from alloy_runtime_types.dtos.agents import ListAgentsResponse
|
|
4
|
+
|
|
5
|
+
from cli.infrastructure.output import OutputService
|
|
6
|
+
from cli.infrastructure.renderers.list_renderer import ColumnConfig
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _format_description(description: str | None) -> str:
|
|
10
|
+
"""Format description for display, truncating if too long.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
description: Optional description text
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
Formatted description string
|
|
17
|
+
"""
|
|
18
|
+
if not description:
|
|
19
|
+
return "-"
|
|
20
|
+
if len(description) > 120:
|
|
21
|
+
return description[:117] + "..."
|
|
22
|
+
return description
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def present_agents_list(response: ListAgentsResponse) -> None:
|
|
26
|
+
"""Present list of agents with Rich table formatting.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
response: List agents response from server
|
|
30
|
+
"""
|
|
31
|
+
output = OutputService.get()
|
|
32
|
+
|
|
33
|
+
if not response.agents:
|
|
34
|
+
output.info("No agents found")
|
|
35
|
+
return
|
|
36
|
+
|
|
37
|
+
# Define table columns with compact layout configuration
|
|
38
|
+
# Line 1 (primary): ID, model count, created - machine-readable data
|
|
39
|
+
# Line 2 (detail): Name, description - human-readable content
|
|
40
|
+
columns = [
|
|
41
|
+
ColumnConfig(
|
|
42
|
+
source_field="id",
|
|
43
|
+
header_label="ID",
|
|
44
|
+
compact_line=1,
|
|
45
|
+
compact_style="cyan",
|
|
46
|
+
),
|
|
47
|
+
ColumnConfig(
|
|
48
|
+
source_field="model_count",
|
|
49
|
+
header_label="Models",
|
|
50
|
+
align="right",
|
|
51
|
+
formatter=lambda x: f"{x} models" if x else "0 models",
|
|
52
|
+
compact_line=1,
|
|
53
|
+
compact_style="green",
|
|
54
|
+
),
|
|
55
|
+
ColumnConfig(
|
|
56
|
+
source_field="created_at",
|
|
57
|
+
header_label="Created",
|
|
58
|
+
formatter=lambda x: x.strftime("%Y-%m-%d") if x else "-",
|
|
59
|
+
compact_line=1,
|
|
60
|
+
compact_style="blue",
|
|
61
|
+
),
|
|
62
|
+
ColumnConfig(
|
|
63
|
+
source_field="name",
|
|
64
|
+
header_label="Name",
|
|
65
|
+
compact_line=2,
|
|
66
|
+
compact_style="white bold",
|
|
67
|
+
),
|
|
68
|
+
ColumnConfig(
|
|
69
|
+
source_field="description",
|
|
70
|
+
header_label="Description",
|
|
71
|
+
formatter=_format_description,
|
|
72
|
+
compact_line=2,
|
|
73
|
+
compact_style="dim",
|
|
74
|
+
),
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# Render table
|
|
78
|
+
output.table(
|
|
79
|
+
items=response.agents, # type: ignore[arg-type]
|
|
80
|
+
title=f"Agents ({response.total})",
|
|
81
|
+
columns=columns,
|
|
82
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
"""Agent update command implementation."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Annotated, Any, Optional, cast
|
|
6
|
+
from uuid import UUID
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
|
|
10
|
+
from cli.commands.agents.create.command import parse_tools
|
|
11
|
+
from cli.commands.agents.update.presenter import present_agent_update_success
|
|
12
|
+
from cli.commands.flag_utils import (
|
|
13
|
+
parse_tags,
|
|
14
|
+
require_exclusive,
|
|
15
|
+
require_together,
|
|
16
|
+
require_update_flags,
|
|
17
|
+
validate_provider,
|
|
18
|
+
)
|
|
19
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
20
|
+
from cli.infrastructure.file_content import FileContentError, resolve_content
|
|
21
|
+
from alloy_runtime_types.dtos.agents import AgentModelConfig, UpdateAgentRequest
|
|
22
|
+
from alloy_runtime_types.dtos.generation import GenerationParameters
|
|
23
|
+
from alloy_runtime_sdk.exceptions.errors import NotFoundError
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
REQUEST_HEADERS = Annotated[
|
|
27
|
+
Optional[list[str]],
|
|
28
|
+
typer.Option(
|
|
29
|
+
"-H",
|
|
30
|
+
"--header",
|
|
31
|
+
help="Request header (key:value). Repeatable.",
|
|
32
|
+
),
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def agents_update_command(
|
|
37
|
+
agent: str = typer.Argument(..., help="Agent name or UUID"),
|
|
38
|
+
name: Optional[str] = typer.Option(
|
|
39
|
+
None,
|
|
40
|
+
"-n",
|
|
41
|
+
"--name",
|
|
42
|
+
help="New name",
|
|
43
|
+
),
|
|
44
|
+
description: Optional[str] = typer.Option(
|
|
45
|
+
None,
|
|
46
|
+
"-d",
|
|
47
|
+
"--description",
|
|
48
|
+
help="New description",
|
|
49
|
+
),
|
|
50
|
+
provider: Optional[str] = typer.Option(
|
|
51
|
+
None,
|
|
52
|
+
"-p",
|
|
53
|
+
"--provider",
|
|
54
|
+
help="New provider (requires --model)",
|
|
55
|
+
),
|
|
56
|
+
model: Optional[str] = typer.Option(
|
|
57
|
+
None,
|
|
58
|
+
"-M",
|
|
59
|
+
"--model",
|
|
60
|
+
help="New model (requires --provider)",
|
|
61
|
+
),
|
|
62
|
+
tags: Optional[str] = typer.Option(
|
|
63
|
+
None,
|
|
64
|
+
"-t",
|
|
65
|
+
"--tags",
|
|
66
|
+
help="Comma-separated tags (replaces all existing tags)",
|
|
67
|
+
),
|
|
68
|
+
clear_tags: bool = typer.Option(
|
|
69
|
+
False,
|
|
70
|
+
"--clear-tags",
|
|
71
|
+
help="Remove all tags from agent",
|
|
72
|
+
),
|
|
73
|
+
temperature: Optional[float] = typer.Option(
|
|
74
|
+
None,
|
|
75
|
+
"-T",
|
|
76
|
+
"--temperature",
|
|
77
|
+
help="Temperature (0.0-2.0)",
|
|
78
|
+
),
|
|
79
|
+
max_tokens: Optional[int] = typer.Option(
|
|
80
|
+
None,
|
|
81
|
+
"--max-tokens",
|
|
82
|
+
help="Max tokens to generate",
|
|
83
|
+
),
|
|
84
|
+
top_p: Optional[float] = typer.Option(
|
|
85
|
+
None,
|
|
86
|
+
"--top-p",
|
|
87
|
+
help="Nucleus sampling (0.0-1.0)",
|
|
88
|
+
),
|
|
89
|
+
top_k: Optional[int] = typer.Option(
|
|
90
|
+
None,
|
|
91
|
+
"--top-k",
|
|
92
|
+
help="Top-k sampling",
|
|
93
|
+
),
|
|
94
|
+
frequency_penalty: Optional[float] = typer.Option(
|
|
95
|
+
None,
|
|
96
|
+
"--frequency-penalty",
|
|
97
|
+
help="Frequency penalty (-2.0 to 2.0)",
|
|
98
|
+
),
|
|
99
|
+
presence_penalty: Optional[float] = typer.Option(
|
|
100
|
+
None,
|
|
101
|
+
"--presence-penalty",
|
|
102
|
+
help="Presence penalty (-2.0 to 2.0)",
|
|
103
|
+
),
|
|
104
|
+
seed: Optional[int] = typer.Option(
|
|
105
|
+
None,
|
|
106
|
+
"--seed",
|
|
107
|
+
help="Random seed for reproducibility",
|
|
108
|
+
),
|
|
109
|
+
stop: Optional[str] = typer.Option(
|
|
110
|
+
None,
|
|
111
|
+
"--stop",
|
|
112
|
+
help="Stop sequence(s). Comma-separated for multiple.",
|
|
113
|
+
),
|
|
114
|
+
logprobs: Optional[bool] = typer.Option(
|
|
115
|
+
None,
|
|
116
|
+
"--logprobs/--no-logprobs",
|
|
117
|
+
help="Include log probabilities in response",
|
|
118
|
+
),
|
|
119
|
+
top_logprobs: Optional[int] = typer.Option(
|
|
120
|
+
None,
|
|
121
|
+
"--top-logprobs",
|
|
122
|
+
help="Number of top log probs to return (1-20)",
|
|
123
|
+
),
|
|
124
|
+
user: Optional[str] = typer.Option(
|
|
125
|
+
None,
|
|
126
|
+
"--user",
|
|
127
|
+
help="End-user ID for tracking",
|
|
128
|
+
),
|
|
129
|
+
system_template_id: Optional[UUID] = typer.Option(
|
|
130
|
+
None,
|
|
131
|
+
"--system-template",
|
|
132
|
+
help="System template UUID",
|
|
133
|
+
),
|
|
134
|
+
system_version_id: Optional[UUID] = typer.Option(
|
|
135
|
+
None,
|
|
136
|
+
"--system-version",
|
|
137
|
+
help="System instruction version UUID",
|
|
138
|
+
),
|
|
139
|
+
input_schema_id: Optional[UUID] = typer.Option(
|
|
140
|
+
None,
|
|
141
|
+
"--input-schema",
|
|
142
|
+
help="Input schema UUID",
|
|
143
|
+
),
|
|
144
|
+
output_schema_id: Optional[UUID] = typer.Option(
|
|
145
|
+
None,
|
|
146
|
+
"--output-schema",
|
|
147
|
+
help="Output schema UUID (mutually exclusive with --output-schema-def)",
|
|
148
|
+
),
|
|
149
|
+
output_schema_def: Optional[str] = typer.Option(
|
|
150
|
+
None,
|
|
151
|
+
"--output-schema-def",
|
|
152
|
+
help="Inline output schema JSON (or @file.json). Mutually exclusive with --output-schema.",
|
|
153
|
+
),
|
|
154
|
+
clear_description: bool = typer.Option(
|
|
155
|
+
False,
|
|
156
|
+
"--clear-description",
|
|
157
|
+
help="Clear description",
|
|
158
|
+
),
|
|
159
|
+
headers: REQUEST_HEADERS = None,
|
|
160
|
+
tools: Optional[str] = typer.Option(
|
|
161
|
+
None,
|
|
162
|
+
"--tools",
|
|
163
|
+
help="JSON array of tool configs (or @file.json). Replaces all existing tools.",
|
|
164
|
+
),
|
|
165
|
+
tools_file: Optional[Path] = typer.Option(
|
|
166
|
+
None,
|
|
167
|
+
"--tools-file",
|
|
168
|
+
help="Path to JSON file with tool configs. Replaces all existing tools.",
|
|
169
|
+
exists=True,
|
|
170
|
+
readable=True,
|
|
171
|
+
),
|
|
172
|
+
clear_tools: bool = typer.Option(
|
|
173
|
+
False,
|
|
174
|
+
"--clear-tools",
|
|
175
|
+
help="Remove all tools from agent",
|
|
176
|
+
),
|
|
177
|
+
) -> None:
|
|
178
|
+
"""Update an existing agent.
|
|
179
|
+
|
|
180
|
+
Only specified fields are updated; others are preserved.
|
|
181
|
+
To update the model, provide both --provider and --model.
|
|
182
|
+
|
|
183
|
+
Examples:
|
|
184
|
+
ai agents update my-agent -n "New Name"
|
|
185
|
+
ai agents update my-agent -d "Updated description"
|
|
186
|
+
ai agents update my-agent --clear-description
|
|
187
|
+
ai agents update my-agent -p anthropic -M claude-3-5-sonnet-20241022
|
|
188
|
+
ai agents update my-agent -T 0.9 --max-tokens 2000
|
|
189
|
+
ai agents update my-agent -t "new,tags"
|
|
190
|
+
ai agents update my-agent --clear-tags
|
|
191
|
+
ai agents update my-agent --tools '[{"tool_id": "web_search"}]'
|
|
192
|
+
ai agents update my-agent --clear-tools
|
|
193
|
+
ai agents update my-agent --top-p 0.9 --frequency-penalty 0.5
|
|
194
|
+
ai agents update my-agent --output-schema-def '{"type": "object"}'
|
|
195
|
+
ai agents update my-agent -H 'anthropic-beta:context-1m-2025-08-07'
|
|
196
|
+
"""
|
|
197
|
+
require_together(("--provider", provider), ("--model", model))
|
|
198
|
+
|
|
199
|
+
require_exclusive(
|
|
200
|
+
("--tools", tools),
|
|
201
|
+
("--tools-file", tools_file),
|
|
202
|
+
("--clear-tools", clear_tools),
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
require_exclusive(
|
|
206
|
+
("--tags", tags),
|
|
207
|
+
("--clear-tags", clear_tags),
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
require_exclusive(
|
|
211
|
+
("--output-schema", output_schema_id),
|
|
212
|
+
("--output-schema-def", output_schema_def),
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
try:
|
|
216
|
+
resolved_output_schema_def = resolve_content(output_schema_def)
|
|
217
|
+
except FileContentError as e:
|
|
218
|
+
raise typer.BadParameter(str(e))
|
|
219
|
+
|
|
220
|
+
parsed_headers: dict[str, str] | None = None
|
|
221
|
+
if headers:
|
|
222
|
+
parsed_headers = {}
|
|
223
|
+
for h in headers:
|
|
224
|
+
if ":" not in h:
|
|
225
|
+
raise typer.BadParameter(
|
|
226
|
+
f"Invalid header format '{h}'. Use 'key:value' format."
|
|
227
|
+
)
|
|
228
|
+
key, value = h.split(":", 1)
|
|
229
|
+
parsed_headers[key.strip()] = value.strip()
|
|
230
|
+
|
|
231
|
+
stop_sequences: str | list[str] | None = None
|
|
232
|
+
if stop:
|
|
233
|
+
if "," in stop:
|
|
234
|
+
stop_sequences = [s.strip() for s in stop.split(",") if s.strip()]
|
|
235
|
+
else:
|
|
236
|
+
stop_sequences = stop
|
|
237
|
+
|
|
238
|
+
output_schema_dict: dict[str, Any] | None = None
|
|
239
|
+
if resolved_output_schema_def:
|
|
240
|
+
try:
|
|
241
|
+
parsed = json.loads(resolved_output_schema_def)
|
|
242
|
+
if not isinstance(parsed, dict):
|
|
243
|
+
raise typer.BadParameter("--output-schema-def must be a JSON object")
|
|
244
|
+
output_schema_dict = cast(dict[str, Any], parsed)
|
|
245
|
+
except json.JSONDecodeError as e:
|
|
246
|
+
raise typer.BadParameter(f"Invalid JSON in --output-schema-def: {e}")
|
|
247
|
+
|
|
248
|
+
require_update_flags(
|
|
249
|
+
("--name", name),
|
|
250
|
+
("--description", description),
|
|
251
|
+
("--provider", provider),
|
|
252
|
+
("--tags", tags),
|
|
253
|
+
("--clear-tags", clear_tags),
|
|
254
|
+
("--temperature", temperature),
|
|
255
|
+
("--max-tokens", max_tokens),
|
|
256
|
+
("--top-p", top_p),
|
|
257
|
+
("--top-k", top_k),
|
|
258
|
+
("--frequency-penalty", frequency_penalty),
|
|
259
|
+
("--presence-penalty", presence_penalty),
|
|
260
|
+
("--seed", seed),
|
|
261
|
+
("--stop", stop),
|
|
262
|
+
("--logprobs", logprobs),
|
|
263
|
+
("--top-logprobs", top_logprobs),
|
|
264
|
+
("--user", user),
|
|
265
|
+
("--system-template", system_template_id),
|
|
266
|
+
("--system-version", system_version_id),
|
|
267
|
+
("--input-schema", input_schema_id),
|
|
268
|
+
("--output-schema", output_schema_id),
|
|
269
|
+
("--output-schema-def", output_schema_def),
|
|
270
|
+
("--clear-description", clear_description),
|
|
271
|
+
("--header", headers),
|
|
272
|
+
("--tools", tools),
|
|
273
|
+
("--tools-file", tools_file),
|
|
274
|
+
("--clear-tools", clear_tools),
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
_execute_update(
|
|
278
|
+
agent_identifier=agent,
|
|
279
|
+
name=name,
|
|
280
|
+
description=description,
|
|
281
|
+
provider=provider,
|
|
282
|
+
model=model,
|
|
283
|
+
tags=tags,
|
|
284
|
+
clear_tags=clear_tags,
|
|
285
|
+
temperature=temperature,
|
|
286
|
+
max_tokens=max_tokens,
|
|
287
|
+
top_p=top_p,
|
|
288
|
+
top_k=top_k,
|
|
289
|
+
frequency_penalty=frequency_penalty,
|
|
290
|
+
presence_penalty=presence_penalty,
|
|
291
|
+
seed=seed,
|
|
292
|
+
stop_sequences=stop_sequences,
|
|
293
|
+
logprobs=logprobs,
|
|
294
|
+
top_logprobs=top_logprobs,
|
|
295
|
+
user=user,
|
|
296
|
+
system_template_id=system_template_id,
|
|
297
|
+
system_version_id=system_version_id,
|
|
298
|
+
input_schema_id=input_schema_id,
|
|
299
|
+
output_schema_id=output_schema_id,
|
|
300
|
+
output_schema_dict=output_schema_dict,
|
|
301
|
+
clear_description=clear_description,
|
|
302
|
+
headers=parsed_headers,
|
|
303
|
+
tools=tools,
|
|
304
|
+
tools_file=tools_file,
|
|
305
|
+
clear_tools=clear_tools,
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
@async_command
|
|
310
|
+
async def _execute_update(
|
|
311
|
+
agent_identifier: str,
|
|
312
|
+
name: Optional[str],
|
|
313
|
+
description: Optional[str],
|
|
314
|
+
provider: Optional[str],
|
|
315
|
+
model: Optional[str],
|
|
316
|
+
tags: Optional[str],
|
|
317
|
+
clear_tags: bool,
|
|
318
|
+
temperature: Optional[float],
|
|
319
|
+
max_tokens: Optional[int],
|
|
320
|
+
top_p: Optional[float],
|
|
321
|
+
top_k: Optional[int],
|
|
322
|
+
frequency_penalty: Optional[float],
|
|
323
|
+
presence_penalty: Optional[float],
|
|
324
|
+
seed: Optional[int],
|
|
325
|
+
stop_sequences: str | list[str] | None,
|
|
326
|
+
logprobs: Optional[bool],
|
|
327
|
+
top_logprobs: Optional[int],
|
|
328
|
+
user: Optional[str],
|
|
329
|
+
system_template_id: Optional[UUID],
|
|
330
|
+
system_version_id: Optional[UUID],
|
|
331
|
+
input_schema_id: Optional[UUID],
|
|
332
|
+
output_schema_id: Optional[UUID],
|
|
333
|
+
output_schema_dict: dict[str, Any] | None,
|
|
334
|
+
clear_description: bool,
|
|
335
|
+
headers: dict[str, str] | None,
|
|
336
|
+
tools: Optional[str],
|
|
337
|
+
tools_file: Optional[Path],
|
|
338
|
+
clear_tools: bool,
|
|
339
|
+
) -> None:
|
|
340
|
+
"""Execute the agent update operation."""
|
|
341
|
+
models: list[AgentModelConfig] | None = None
|
|
342
|
+
if provider is not None and model is not None:
|
|
343
|
+
provider_enum = validate_provider(provider)
|
|
344
|
+
models = [
|
|
345
|
+
AgentModelConfig(
|
|
346
|
+
provider_key=provider_enum,
|
|
347
|
+
provider_model_name=model,
|
|
348
|
+
preference_order=0,
|
|
349
|
+
)
|
|
350
|
+
]
|
|
351
|
+
|
|
352
|
+
request_data: dict[str, Any] = {}
|
|
353
|
+
|
|
354
|
+
if name is not None:
|
|
355
|
+
request_data["name"] = name
|
|
356
|
+
|
|
357
|
+
if description is not None:
|
|
358
|
+
request_data["description"] = description
|
|
359
|
+
elif clear_description:
|
|
360
|
+
request_data["description"] = None
|
|
361
|
+
|
|
362
|
+
if models is not None:
|
|
363
|
+
request_data["models"] = models
|
|
364
|
+
|
|
365
|
+
if clear_tags:
|
|
366
|
+
request_data["tags"] = []
|
|
367
|
+
elif tags is not None:
|
|
368
|
+
request_data["tags"] = parse_tags(tags)
|
|
369
|
+
|
|
370
|
+
if system_template_id is not None:
|
|
371
|
+
request_data["system_instruction_template"] = str(system_template_id)
|
|
372
|
+
|
|
373
|
+
if system_version_id is not None:
|
|
374
|
+
request_data["system_instruction_version_id"] = str(system_version_id)
|
|
375
|
+
|
|
376
|
+
if input_schema_id is not None:
|
|
377
|
+
request_data["input_schema_id"] = str(input_schema_id)
|
|
378
|
+
|
|
379
|
+
if output_schema_id is not None:
|
|
380
|
+
request_data["output_schema_id"] = str(output_schema_id)
|
|
381
|
+
|
|
382
|
+
if output_schema_dict is not None:
|
|
383
|
+
request_data["output_schema"] = output_schema_dict
|
|
384
|
+
|
|
385
|
+
if headers is not None:
|
|
386
|
+
request_data["default_request_headers"] = headers
|
|
387
|
+
|
|
388
|
+
gen_params_fields = [
|
|
389
|
+
temperature,
|
|
390
|
+
max_tokens,
|
|
391
|
+
top_p,
|
|
392
|
+
top_k,
|
|
393
|
+
frequency_penalty,
|
|
394
|
+
presence_penalty,
|
|
395
|
+
seed,
|
|
396
|
+
stop_sequences,
|
|
397
|
+
logprobs,
|
|
398
|
+
top_logprobs,
|
|
399
|
+
user,
|
|
400
|
+
]
|
|
401
|
+
if any(p is not None for p in gen_params_fields):
|
|
402
|
+
request_data["generation_params"] = GenerationParameters(
|
|
403
|
+
temperature=temperature,
|
|
404
|
+
max_tokens=max_tokens,
|
|
405
|
+
top_p=top_p,
|
|
406
|
+
top_k=top_k,
|
|
407
|
+
frequency_penalty=frequency_penalty,
|
|
408
|
+
presence_penalty=presence_penalty,
|
|
409
|
+
seed=seed,
|
|
410
|
+
stop=stop_sequences,
|
|
411
|
+
logprobs=logprobs,
|
|
412
|
+
top_logprobs=top_logprobs,
|
|
413
|
+
user=user,
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
if clear_tools:
|
|
417
|
+
request_data["tools"] = []
|
|
418
|
+
elif tools is not None or tools_file is not None:
|
|
419
|
+
tool_configs = parse_tools(tools, tools_file)
|
|
420
|
+
if tool_configs is not None:
|
|
421
|
+
request_data["tools"] = tool_configs
|
|
422
|
+
|
|
423
|
+
request = UpdateAgentRequest(**request_data)
|
|
424
|
+
|
|
425
|
+
async with authenticated_client() as (_, client):
|
|
426
|
+
try:
|
|
427
|
+
agent_data = await client.get_agent(agent_identifier)
|
|
428
|
+
except NotFoundError:
|
|
429
|
+
raise typer.BadParameter(
|
|
430
|
+
f"Agent '{agent_identifier}' not found. Use 'ai agents list' to see available agents."
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
response = await client.update_agent(agent_data.id, request)
|
|
434
|
+
|
|
435
|
+
present_agent_update_success(response)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Field definitions for agent update presentation."""
|
|
2
|
+
|
|
3
|
+
from alloy_runtime_types.dtos.agents import UpdateAgentResponse
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def format_models(response: UpdateAgentResponse) -> str:
|
|
7
|
+
"""Format models list for display."""
|
|
8
|
+
return ", ".join(
|
|
9
|
+
f"{m.provider_key.value}:{m.provider_model_name}" for m in response.models
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def format_tools(response: UpdateAgentResponse) -> str:
|
|
14
|
+
"""Format tools list for display."""
|
|
15
|
+
if not response.tools:
|
|
16
|
+
return "(none)"
|
|
17
|
+
return ", ".join(t.tool_id for t in response.tools)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def format_tags(response: UpdateAgentResponse) -> str:
|
|
21
|
+
"""Format tags list for display."""
|
|
22
|
+
if not response.tags:
|
|
23
|
+
return "(none)"
|
|
24
|
+
return ", ".join(t.tag_path for t in response.tags)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def format_generation_params(response: UpdateAgentResponse) -> str:
|
|
28
|
+
"""Format generation parameters for display."""
|
|
29
|
+
if not response.generation_params:
|
|
30
|
+
return "(default)"
|
|
31
|
+
|
|
32
|
+
params: list[str] = []
|
|
33
|
+
if response.generation_params.temperature is not None:
|
|
34
|
+
params.append(f"temp={response.generation_params.temperature}")
|
|
35
|
+
if response.generation_params.max_tokens is not None:
|
|
36
|
+
params.append(f"max_tokens={response.generation_params.max_tokens}")
|
|
37
|
+
if response.generation_params.reasoning_effort is not None:
|
|
38
|
+
params.append(f"reasoning={response.generation_params.reasoning_effort}")
|
|
39
|
+
|
|
40
|
+
return ", ".join(params) if params else "(default)"
|