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,72 @@
|
|
|
1
|
+
"""Presenter for pipeline execution costs by step command output."""
|
|
2
|
+
|
|
3
|
+
from decimal import Decimal
|
|
4
|
+
|
|
5
|
+
from alloy_runtime_types.dtos.pipeline_costs import StepCostBreakdown
|
|
6
|
+
|
|
7
|
+
from cli.infrastructure.output import OutputService
|
|
8
|
+
from cli.infrastructure.renderers.list_renderer import ColumnConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _format_cost(cost: Decimal | None) -> str:
|
|
12
|
+
if cost is None:
|
|
13
|
+
return "-"
|
|
14
|
+
return f"${cost:.4f}"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def present_execution_costs_by_step(entries: list[StepCostBreakdown]) -> None:
|
|
18
|
+
output = OutputService.get()
|
|
19
|
+
|
|
20
|
+
if not entries:
|
|
21
|
+
output.info("No cost data by step found for this execution")
|
|
22
|
+
return
|
|
23
|
+
|
|
24
|
+
columns = [
|
|
25
|
+
ColumnConfig(
|
|
26
|
+
source_field="step_order",
|
|
27
|
+
header_label="Order",
|
|
28
|
+
formatter=str,
|
|
29
|
+
compact_line=1,
|
|
30
|
+
compact_style="cyan",
|
|
31
|
+
),
|
|
32
|
+
ColumnConfig(
|
|
33
|
+
source_field="step_name",
|
|
34
|
+
header_label="Step Name",
|
|
35
|
+
compact_line=1,
|
|
36
|
+
compact_style="green",
|
|
37
|
+
),
|
|
38
|
+
ColumnConfig(
|
|
39
|
+
source_field="execution_count",
|
|
40
|
+
header_label="Executions",
|
|
41
|
+
formatter=str,
|
|
42
|
+
compact_line=1,
|
|
43
|
+
compact_style="white",
|
|
44
|
+
),
|
|
45
|
+
ColumnConfig(
|
|
46
|
+
source_field="llm_cost_usd",
|
|
47
|
+
header_label="LLM Cost",
|
|
48
|
+
formatter=_format_cost,
|
|
49
|
+
compact_line=2,
|
|
50
|
+
compact_style="dim",
|
|
51
|
+
),
|
|
52
|
+
ColumnConfig(
|
|
53
|
+
source_field="rag_cost_usd",
|
|
54
|
+
header_label="RAG Cost",
|
|
55
|
+
formatter=_format_cost,
|
|
56
|
+
compact_line=2,
|
|
57
|
+
compact_style="dim",
|
|
58
|
+
),
|
|
59
|
+
ColumnConfig(
|
|
60
|
+
source_field="total_cost_usd",
|
|
61
|
+
header_label="Total Cost",
|
|
62
|
+
formatter=_format_cost,
|
|
63
|
+
compact_line=1,
|
|
64
|
+
compact_style="green bold",
|
|
65
|
+
),
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
output.table(
|
|
69
|
+
items=entries, # type: ignore[arg-type]
|
|
70
|
+
title=f"Costs by Step ({len(entries)} steps)",
|
|
71
|
+
columns=columns,
|
|
72
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Pipeline execution get command implementation."""
|
|
2
|
+
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from cli.commands.flag_utils import validate_uuid
|
|
8
|
+
from cli.commands.pipelines.executions.presenter import present_execution_detail
|
|
9
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def pipelines_executions_get_command(
|
|
13
|
+
pipeline_id: str = typer.Argument(
|
|
14
|
+
...,
|
|
15
|
+
help="Pipeline UUID",
|
|
16
|
+
),
|
|
17
|
+
execution_id: str = typer.Argument(
|
|
18
|
+
...,
|
|
19
|
+
help="Execution UUID",
|
|
20
|
+
),
|
|
21
|
+
) -> None:
|
|
22
|
+
"""Get details of a pipeline execution.
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
ai pipelines executions get 123e4567... 456e7890...
|
|
26
|
+
"""
|
|
27
|
+
p_uuid = validate_uuid(pipeline_id, "pipeline")
|
|
28
|
+
e_uuid = validate_uuid(execution_id, "execution")
|
|
29
|
+
_execute_get(pipeline_id=p_uuid, execution_id=e_uuid)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@async_command
|
|
33
|
+
async def _execute_get(pipeline_id: UUID, execution_id: UUID) -> None:
|
|
34
|
+
"""Execute get execution operation."""
|
|
35
|
+
async with authenticated_client() as (_config, client):
|
|
36
|
+
response = await client.get_pipeline_execution(pipeline_id, execution_id)
|
|
37
|
+
|
|
38
|
+
present_execution_detail(response)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""Pipeline executions list command implementation."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import Annotated, Optional
|
|
5
|
+
from uuid import UUID
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from cli.commands.flag_utils import validate_uuid
|
|
10
|
+
from cli.commands.pipelines.executions.presenter import present_executions_list
|
|
11
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
12
|
+
from cli.infrastructure.file_content import FileContentError, resolve_content
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def pipelines_executions_list_command(
|
|
16
|
+
pipeline_id: str = typer.Argument(
|
|
17
|
+
...,
|
|
18
|
+
help="Pipeline UUID",
|
|
19
|
+
),
|
|
20
|
+
status: Optional[str] = typer.Option(
|
|
21
|
+
None,
|
|
22
|
+
"--status",
|
|
23
|
+
help="Filter by status (pending, running, completed, failed)",
|
|
24
|
+
),
|
|
25
|
+
external_id: Optional[str] = typer.Option(
|
|
26
|
+
None,
|
|
27
|
+
"--external-id",
|
|
28
|
+
help="Filter by exact external_id",
|
|
29
|
+
),
|
|
30
|
+
search: Optional[str] = typer.Option(
|
|
31
|
+
None,
|
|
32
|
+
"-s",
|
|
33
|
+
"--search",
|
|
34
|
+
help="Fuzzy search on external_id",
|
|
35
|
+
),
|
|
36
|
+
tag: Annotated[
|
|
37
|
+
list[str] | None,
|
|
38
|
+
typer.Option(
|
|
39
|
+
"--tag",
|
|
40
|
+
help="Filter by tag path (repeatable, e.g., --tag pipeline.test)",
|
|
41
|
+
),
|
|
42
|
+
] = None,
|
|
43
|
+
metadata_filter: Optional[str] = typer.Option(
|
|
44
|
+
None,
|
|
45
|
+
"--metadata-filter",
|
|
46
|
+
help="Filter by metadata as JSON string or @file.json",
|
|
47
|
+
),
|
|
48
|
+
limit: int = typer.Option(
|
|
49
|
+
50,
|
|
50
|
+
"-l",
|
|
51
|
+
"--limit",
|
|
52
|
+
min=1,
|
|
53
|
+
max=100,
|
|
54
|
+
help="Max results",
|
|
55
|
+
),
|
|
56
|
+
offset: int = typer.Option(
|
|
57
|
+
0,
|
|
58
|
+
"--offset",
|
|
59
|
+
min=0,
|
|
60
|
+
help="Skip N results",
|
|
61
|
+
),
|
|
62
|
+
) -> None:
|
|
63
|
+
"""List executions for a pipeline.
|
|
64
|
+
|
|
65
|
+
Examples:
|
|
66
|
+
ai pipelines executions list 123e4567-89ab...
|
|
67
|
+
ai pipelines executions list 123e4567-89ab... --status completed
|
|
68
|
+
ai pipelines executions list 123e4567-89ab... --tag pipeline.test --tag batch.weekly
|
|
69
|
+
ai pipelines executions list 123e4567-89ab... --metadata-filter '{"env": "prod"}'
|
|
70
|
+
"""
|
|
71
|
+
pipeline_uuid = validate_uuid(pipeline_id, "pipeline")
|
|
72
|
+
|
|
73
|
+
# Parse metadata_filter if provided
|
|
74
|
+
metadata_filter_str: str | None = None
|
|
75
|
+
if metadata_filter:
|
|
76
|
+
try:
|
|
77
|
+
resolved = resolve_content(metadata_filter)
|
|
78
|
+
except FileContentError as e:
|
|
79
|
+
raise typer.BadParameter(str(e))
|
|
80
|
+
if resolved:
|
|
81
|
+
try:
|
|
82
|
+
json.loads(resolved)
|
|
83
|
+
except json.JSONDecodeError as e:
|
|
84
|
+
raise typer.BadParameter(f"Invalid JSON: {e}")
|
|
85
|
+
metadata_filter_str = resolved
|
|
86
|
+
|
|
87
|
+
_execute_list(
|
|
88
|
+
pipeline_id=pipeline_uuid,
|
|
89
|
+
status=status,
|
|
90
|
+
external_id=external_id,
|
|
91
|
+
search=search,
|
|
92
|
+
tag_paths=tag,
|
|
93
|
+
metadata_filter=metadata_filter_str,
|
|
94
|
+
limit=limit,
|
|
95
|
+
offset=offset,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@async_command
|
|
100
|
+
async def _execute_list(
|
|
101
|
+
pipeline_id: UUID,
|
|
102
|
+
status: Optional[str],
|
|
103
|
+
external_id: Optional[str],
|
|
104
|
+
search: Optional[str],
|
|
105
|
+
tag_paths: Optional[list[str]],
|
|
106
|
+
metadata_filter: Optional[str],
|
|
107
|
+
limit: int,
|
|
108
|
+
offset: int,
|
|
109
|
+
) -> None:
|
|
110
|
+
"""Execute list executions operation."""
|
|
111
|
+
async with authenticated_client() as (_config, client):
|
|
112
|
+
response = await client.list_pipeline_executions(
|
|
113
|
+
pipeline_id,
|
|
114
|
+
status=status,
|
|
115
|
+
external_id=external_id,
|
|
116
|
+
search=search,
|
|
117
|
+
tag_paths=tag_paths,
|
|
118
|
+
metadata_filter=metadata_filter,
|
|
119
|
+
limit=limit,
|
|
120
|
+
offset=offset,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
present_executions_list(response)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Presenters for pipeline executions command output."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import cast
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
|
|
8
|
+
from alloy_runtime_types.dtos.pipeline import (
|
|
9
|
+
GetPipelineExecutionResponse,
|
|
10
|
+
ListPipelineExecutionsResponse,
|
|
11
|
+
PipelineExecutionDetail,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
from cli.infrastructure.formatting.fields import format_datetime, format_optional
|
|
15
|
+
from cli.infrastructure.output import OutputService
|
|
16
|
+
from cli.infrastructure.renderers.entity_renderer import FieldConfig
|
|
17
|
+
from cli.infrastructure.renderers.list_renderer import ColumnConfig
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _format_status(status: str) -> str:
|
|
21
|
+
"""Format status with color hints."""
|
|
22
|
+
return status
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _format_duration(duration_ms: int | None) -> str:
|
|
26
|
+
"""Format duration in human-readable format."""
|
|
27
|
+
if not duration_ms:
|
|
28
|
+
return "-"
|
|
29
|
+
if duration_ms < 1000:
|
|
30
|
+
return f"{duration_ms}ms"
|
|
31
|
+
return f"{duration_ms / 1000:.1f}s"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def present_executions_list(response: ListPipelineExecutionsResponse) -> None:
|
|
35
|
+
"""Present list of executions with Rich table formatting."""
|
|
36
|
+
output = OutputService.get()
|
|
37
|
+
|
|
38
|
+
if not response.executions:
|
|
39
|
+
output.info("No executions found")
|
|
40
|
+
return
|
|
41
|
+
|
|
42
|
+
columns = [
|
|
43
|
+
ColumnConfig(
|
|
44
|
+
source_field="id",
|
|
45
|
+
header_label="ID",
|
|
46
|
+
compact_line=1,
|
|
47
|
+
compact_style="cyan",
|
|
48
|
+
),
|
|
49
|
+
ColumnConfig(
|
|
50
|
+
source_field="status",
|
|
51
|
+
header_label="Status",
|
|
52
|
+
formatter=_format_status,
|
|
53
|
+
compact_line=1,
|
|
54
|
+
compact_style="yellow",
|
|
55
|
+
),
|
|
56
|
+
ColumnConfig(
|
|
57
|
+
source_field="total_duration_ms",
|
|
58
|
+
header_label="Duration",
|
|
59
|
+
formatter=_format_duration,
|
|
60
|
+
compact_line=1,
|
|
61
|
+
compact_style="green",
|
|
62
|
+
),
|
|
63
|
+
ColumnConfig(
|
|
64
|
+
source_field="queued_at",
|
|
65
|
+
header_label="Queued",
|
|
66
|
+
formatter=lambda x: x.strftime("%Y-%m-%d %H:%M") if x else "-",
|
|
67
|
+
compact_line=2,
|
|
68
|
+
compact_style="blue",
|
|
69
|
+
),
|
|
70
|
+
ColumnConfig(
|
|
71
|
+
source_field="external_id",
|
|
72
|
+
header_label="External ID",
|
|
73
|
+
formatter=lambda x: x or "-",
|
|
74
|
+
compact_line=2,
|
|
75
|
+
compact_style="dim",
|
|
76
|
+
),
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
output.table(
|
|
80
|
+
items=cast(list[BaseModel], response.executions),
|
|
81
|
+
title=f"Executions ({response.total})",
|
|
82
|
+
columns=columns,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _format_tags_from_execution(execution: PipelineExecutionDetail) -> str:
|
|
87
|
+
"""Format tags for display."""
|
|
88
|
+
if not execution.tags:
|
|
89
|
+
return "(none)"
|
|
90
|
+
return ", ".join(t.tag_path for t in execution.tags)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def present_execution_detail(response: GetPipelineExecutionResponse) -> None:
|
|
94
|
+
"""Present execution details with Rich formatting."""
|
|
95
|
+
output = OutputService.get()
|
|
96
|
+
execution = response.execution
|
|
97
|
+
|
|
98
|
+
fields = [
|
|
99
|
+
FieldConfig("id", "Execution ID", str),
|
|
100
|
+
FieldConfig("pipeline_definition_id", "Pipeline ID", str),
|
|
101
|
+
FieldConfig("status", "Status"),
|
|
102
|
+
FieldConfig("external_id", "External ID", format_optional),
|
|
103
|
+
FieldConfig("queued_at", "Queued At", format_datetime),
|
|
104
|
+
FieldConfig(
|
|
105
|
+
"started_at", "Started At", lambda v: format_optional(v, format_datetime)
|
|
106
|
+
),
|
|
107
|
+
FieldConfig(
|
|
108
|
+
"completed_at",
|
|
109
|
+
"Completed At",
|
|
110
|
+
lambda v: format_optional(v, format_datetime),
|
|
111
|
+
),
|
|
112
|
+
FieldConfig("total_duration_ms", "Duration", lambda v: _format_duration(v)),
|
|
113
|
+
FieldConfig("error_message", "Error", format_optional),
|
|
114
|
+
FieldConfig("tags", "Tags", lambda _: _format_tags_from_execution(execution)),
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
output.entity(execution, f"Execution: {execution.status}", fields)
|
|
118
|
+
|
|
119
|
+
# Show result data if present
|
|
120
|
+
if execution.result_data:
|
|
121
|
+
result_str = json.dumps(execution.result_data, indent=2)
|
|
122
|
+
if len(result_str) > 1000:
|
|
123
|
+
result_str = result_str[:1000] + "\n..."
|
|
124
|
+
output.info(f"Result:\n{result_str}")
|
|
125
|
+
|
|
126
|
+
# Show stdout/stderr if present
|
|
127
|
+
if execution.execution_stdout:
|
|
128
|
+
output.info(f"Stdout:\n{execution.execution_stdout[:500]}")
|
|
129
|
+
|
|
130
|
+
if execution.execution_stderr:
|
|
131
|
+
output.warning(f"Stderr:\n{execution.execution_stderr[:500]}")
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Pipeline execution rerun command implementation."""
|
|
2
|
+
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from cli.commands.flag_utils import validate_uuid
|
|
8
|
+
from cli.commands.pipelines.execute.presenter import present_execution_result
|
|
9
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def pipelines_executions_rerun_command(
|
|
13
|
+
pipeline_id: str = typer.Argument(
|
|
14
|
+
...,
|
|
15
|
+
help="Pipeline UUID",
|
|
16
|
+
),
|
|
17
|
+
execution_id: str = typer.Argument(
|
|
18
|
+
...,
|
|
19
|
+
help="Execution UUID to rerun",
|
|
20
|
+
),
|
|
21
|
+
) -> None:
|
|
22
|
+
"""Re-run a failed or paused pipeline execution.
|
|
23
|
+
|
|
24
|
+
Completed steps are automatically skipped via idempotent cache-hits.
|
|
25
|
+
Use after approving a checkpoint to resume pipeline execution.
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
ai pipelines executions rerun 123e4567... 456e7890...
|
|
29
|
+
"""
|
|
30
|
+
p_uuid = validate_uuid(pipeline_id, "pipeline")
|
|
31
|
+
e_uuid = validate_uuid(execution_id, "execution")
|
|
32
|
+
_execute_rerun(pipeline_id=p_uuid, execution_id=e_uuid)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@async_command
|
|
36
|
+
async def _execute_rerun(pipeline_id: UUID, execution_id: UUID) -> None:
|
|
37
|
+
"""Execute rerun pipeline operation."""
|
|
38
|
+
async with authenticated_client() as (_config, client):
|
|
39
|
+
response = await client.rerun_pipeline_execution(pipeline_id, execution_id)
|
|
40
|
+
|
|
41
|
+
present_execution_result(response)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Empty per project convention - import directly from submodules
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""Pipeline execution update command implementation."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import Any, Optional, cast
|
|
5
|
+
from uuid import UUID
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from alloy_runtime_types.dtos.pipeline import UpdatePipelineExecutionRequest
|
|
10
|
+
|
|
11
|
+
from cli.commands.flag_utils import (
|
|
12
|
+
parse_tags,
|
|
13
|
+
require_exclusive,
|
|
14
|
+
require_update_flags,
|
|
15
|
+
validate_uuid,
|
|
16
|
+
)
|
|
17
|
+
from cli.commands.pipelines.executions.update.presenter import present_execution_update
|
|
18
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def pipeline_execution_update_command(
|
|
22
|
+
pipeline_id: str = typer.Argument(
|
|
23
|
+
...,
|
|
24
|
+
help="Pipeline UUID",
|
|
25
|
+
),
|
|
26
|
+
execution_id: str = typer.Argument(
|
|
27
|
+
...,
|
|
28
|
+
help="Execution UUID",
|
|
29
|
+
),
|
|
30
|
+
metadata: Optional[str] = typer.Option(
|
|
31
|
+
None,
|
|
32
|
+
"--metadata",
|
|
33
|
+
help='Replace metadata with JSON (e.g. \'{"key": "value"}\')',
|
|
34
|
+
),
|
|
35
|
+
metadata_merge: Optional[str] = typer.Option(
|
|
36
|
+
None,
|
|
37
|
+
"--metadata-merge",
|
|
38
|
+
help="Merge these JSON keys into existing metadata",
|
|
39
|
+
),
|
|
40
|
+
tags: Optional[str] = typer.Option(
|
|
41
|
+
None,
|
|
42
|
+
"--tags",
|
|
43
|
+
help="Replace tags (comma-separated, e.g. 'reviewed,approved')",
|
|
44
|
+
),
|
|
45
|
+
) -> None:
|
|
46
|
+
"""Update a pipeline execution's metadata or tags.
|
|
47
|
+
|
|
48
|
+
Examples:
|
|
49
|
+
ai pipelines executions update 123e... 456e... --metadata '{"status": "reviewed"}'
|
|
50
|
+
ai pipelines executions update 123e... 456e... --metadata-merge '{"step": 2}'
|
|
51
|
+
ai pipelines executions update 123e... 456e... --tags reviewed,approved
|
|
52
|
+
"""
|
|
53
|
+
pipeline_uuid = validate_uuid(pipeline_id, "pipeline")
|
|
54
|
+
execution_uuid = validate_uuid(execution_id, "execution")
|
|
55
|
+
|
|
56
|
+
require_exclusive(
|
|
57
|
+
("--metadata", metadata),
|
|
58
|
+
("--metadata-merge", metadata_merge),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
require_update_flags(
|
|
62
|
+
("--metadata", metadata),
|
|
63
|
+
("--metadata-merge", metadata_merge),
|
|
64
|
+
("--tags", tags),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
parsed_metadata = _parse_json(metadata) if metadata else None
|
|
68
|
+
parsed_metadata_merge = _parse_json(metadata_merge) if metadata_merge else None
|
|
69
|
+
parsed_tags = parse_tags(tags) if tags else None
|
|
70
|
+
|
|
71
|
+
_execute_update(
|
|
72
|
+
pipeline_id=pipeline_uuid,
|
|
73
|
+
execution_id=execution_uuid,
|
|
74
|
+
metadata=parsed_metadata,
|
|
75
|
+
metadata_merge=parsed_metadata_merge,
|
|
76
|
+
tags=parsed_tags,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _parse_json(value: str) -> dict[str, Any]:
|
|
81
|
+
try:
|
|
82
|
+
result = json.loads(value)
|
|
83
|
+
if not isinstance(result, dict):
|
|
84
|
+
raise typer.BadParameter("JSON must be an object")
|
|
85
|
+
return cast(dict[str, Any], result)
|
|
86
|
+
except json.JSONDecodeError as e:
|
|
87
|
+
raise typer.BadParameter(f"Invalid JSON: {e}")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@async_command
|
|
91
|
+
async def _execute_update(
|
|
92
|
+
pipeline_id: UUID,
|
|
93
|
+
execution_id: UUID,
|
|
94
|
+
metadata: dict[str, Any] | None,
|
|
95
|
+
metadata_merge: dict[str, Any] | None,
|
|
96
|
+
tags: list[str] | None,
|
|
97
|
+
) -> None:
|
|
98
|
+
async with authenticated_client() as (_config, client):
|
|
99
|
+
request = UpdatePipelineExecutionRequest(
|
|
100
|
+
metadata=metadata,
|
|
101
|
+
metadata_merge=metadata_merge,
|
|
102
|
+
tags=tags,
|
|
103
|
+
)
|
|
104
|
+
response = await client.update_pipeline_execution(
|
|
105
|
+
pipeline_id,
|
|
106
|
+
execution_id,
|
|
107
|
+
request,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
present_execution_update(response)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Presenter for pipeline execution update command output."""
|
|
2
|
+
|
|
3
|
+
from alloy_runtime_types.dtos.pipeline import UpdatePipelineExecutionResponse
|
|
4
|
+
|
|
5
|
+
from cli.infrastructure.output import OutputService
|
|
6
|
+
from cli.infrastructure.renderers.entity_renderer import FieldConfig
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def present_execution_update(response: UpdatePipelineExecutionResponse) -> None:
|
|
10
|
+
output = OutputService.get()
|
|
11
|
+
execution = response.execution
|
|
12
|
+
|
|
13
|
+
fields = [
|
|
14
|
+
FieldConfig("id", "Execution ID", str),
|
|
15
|
+
FieldConfig("pipeline_definition_id", "Pipeline ID", str),
|
|
16
|
+
FieldConfig("status", "Status"),
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
output.entity(execution, "Execution Updated", fields)
|
|
20
|
+
|
|
21
|
+
if execution.tags:
|
|
22
|
+
tag_paths = ", ".join(t.tag_path for t in execution.tags)
|
|
23
|
+
output.info(f"Tags: {tag_paths}")
|
|
24
|
+
else:
|
|
25
|
+
output.info("Tags: (none)")
|
|
26
|
+
|
|
27
|
+
if execution.metadata:
|
|
28
|
+
output.info(f"Metadata: {execution.metadata}")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Empty per project convention - import directly from submodules
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Pipeline get command implementation."""
|
|
2
|
+
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from cli.commands.flag_utils import validate_uuid
|
|
8
|
+
from cli.commands.pipelines.get.presenter import present_pipeline
|
|
9
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def pipelines_get_command(
|
|
13
|
+
pipeline_id: str = typer.Argument(
|
|
14
|
+
...,
|
|
15
|
+
help="Pipeline UUID",
|
|
16
|
+
),
|
|
17
|
+
) -> None:
|
|
18
|
+
"""Get details of a pipeline.
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
ai pipelines get 123e4567-89ab-cdef-0123-456789abcdef
|
|
22
|
+
"""
|
|
23
|
+
pipeline_uuid = validate_uuid(pipeline_id, "pipeline")
|
|
24
|
+
_execute_get(pipeline_id=pipeline_uuid)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@async_command
|
|
28
|
+
async def _execute_get(pipeline_id: UUID) -> None:
|
|
29
|
+
"""Execute get pipeline operation."""
|
|
30
|
+
async with authenticated_client() as (_config, client):
|
|
31
|
+
response = await client.get_pipeline(pipeline_id)
|
|
32
|
+
|
|
33
|
+
present_pipeline(response)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Presenter for pipeline get command output."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from rich.panel import Panel
|
|
7
|
+
from rich.syntax import Syntax
|
|
8
|
+
|
|
9
|
+
from alloy_runtime_types.dtos.pipeline import GetPipelineResponse
|
|
10
|
+
|
|
11
|
+
from cli.infrastructure.formatting.fields import format_datetime, format_optional
|
|
12
|
+
from cli.infrastructure.output import OutputService
|
|
13
|
+
from cli.infrastructure.renderers.entity_renderer import FieldConfig
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _format_input_schema(schema: dict[str, Any] | None) -> str:
|
|
17
|
+
"""Format input schema for display."""
|
|
18
|
+
if not schema:
|
|
19
|
+
return "(none)"
|
|
20
|
+
schema_str = json.dumps(schema, indent=2)
|
|
21
|
+
return schema_str[:100] + "..." if len(schema_str) > 100 else schema_str
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def present_pipeline(response: GetPipelineResponse) -> None:
|
|
25
|
+
"""Present pipeline details with Rich formatting."""
|
|
26
|
+
output = OutputService.get()
|
|
27
|
+
|
|
28
|
+
fields = [
|
|
29
|
+
FieldConfig("id", "ID", str),
|
|
30
|
+
FieldConfig("name", "Name"),
|
|
31
|
+
FieldConfig("description", "Description", format_optional),
|
|
32
|
+
FieldConfig("is_public", "Public", lambda v: "Yes" if v else "No"),
|
|
33
|
+
FieldConfig("created_at", "Created", format_datetime),
|
|
34
|
+
FieldConfig("updated_at", "Updated", format_datetime),
|
|
35
|
+
FieldConfig("input_schema", "Input Schema", _format_input_schema),
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
output.entity(response, f"Pipeline: {response.name}", fields)
|
|
39
|
+
|
|
40
|
+
# Show module content if available (only for owners)
|
|
41
|
+
if response.module_content:
|
|
42
|
+
syntax = Syntax(
|
|
43
|
+
response.module_content,
|
|
44
|
+
"python",
|
|
45
|
+
theme="monokai",
|
|
46
|
+
line_numbers=True,
|
|
47
|
+
)
|
|
48
|
+
output.console.print(Panel(syntax, title="Module Content"))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Empty per project convention - import directly from submodules
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Pipelines list command implementation."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from cli.commands.pipelines.list.presenter import present_pipelines_list
|
|
8
|
+
from cli.infrastructure.command import async_command, authenticated_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def pipelines_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 pipelines accessible to you.
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
ai pipelines list
|
|
37
|
+
ai pipelines list -s "content"
|
|
38
|
+
ai pipelines list -l 20
|
|
39
|
+
"""
|
|
40
|
+
_execute_list(search=search, limit=limit, offset=offset)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@async_command
|
|
44
|
+
async def _execute_list(search: Optional[str], limit: int, offset: int) -> None:
|
|
45
|
+
"""Execute list pipelines operation."""
|
|
46
|
+
async with authenticated_client() as (_config, client):
|
|
47
|
+
response = await client.list_pipelines(
|
|
48
|
+
search=search,
|
|
49
|
+
limit=limit,
|
|
50
|
+
offset=offset,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
present_pipelines_list(response)
|