legate 0.1.0
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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +345 -0
- data/bin/legate +13 -0
- data/examples/00_quickstart.rb +51 -0
- data/examples/01_simple_agent.rb +105 -0
- data/examples/02_multi_tool_agent.rb +140 -0
- data/examples/03_custom_tool.rb +93 -0
- data/examples/04_agent_instructions.rb +84 -0
- data/examples/05_state_and_sessions.rb +91 -0
- data/examples/06_callbacks.rb +186 -0
- data/examples/07_async_jobs.rb +112 -0
- data/examples/08_loop_agent.rb +197 -0
- data/examples/09_sequential_workflow.rb +40 -0
- data/examples/10_parallel_workflow.rb +34 -0
- data/examples/11_agent_delegation.rb +24 -0
- data/examples/12_http_client_tool.rb +156 -0
- data/examples/13_authentication.rb +220 -0
- data/examples/14_mcp_client.rb +154 -0
- data/examples/15_mcp_server.rb +79 -0
- data/examples/16_webhooks.rb +91 -0
- data/examples/README_sequential_agents.md +164 -0
- data/examples/advanced/auth/cookie_auth_tool.rb +146 -0
- data/examples/advanced/auth/custom_auth_flows_example.rb +626 -0
- data/examples/advanced/auth/excon_middleware.rb +317 -0
- data/examples/advanced/auth/excon_middleware_auth.rb +399 -0
- data/examples/advanced/auth/fiber_auth_example.rb +281 -0
- data/examples/advanced/auth/fiber_oidc_example.rb +403 -0
- data/examples/advanced/auth/httpbin_bearer_tool.rb +159 -0
- data/examples/advanced/auth/oauth2_auth.rb +419 -0
- data/examples/advanced/auth/oidc_auth.rb +514 -0
- data/examples/advanced/auth/openweather_api.rb +251 -0
- data/examples/advanced/auth/openweather_tool.rb +153 -0
- data/examples/advanced/auth/query_param_middleware_test.rb +138 -0
- data/examples/advanced/auth/service_account.rb +135 -0
- data/examples/advanced/auth/test_with_httpbin.rb +202 -0
- data/examples/advanced/auth/token_lifecycle_example.rb +428 -0
- data/examples/advanced/callback_monitoring.rb +679 -0
- data/examples/advanced/mas/fixed_delegation_example.rb +191 -0
- data/examples/advanced/mas/loop_workflow.rb +28 -0
- data/examples/advanced/mas/mock_planner.rb +77 -0
- data/examples/advanced/mas/proper_delegation_example.rb +276 -0
- data/examples/advanced/mcp/legate_mcp_server_resource_example.rb +182 -0
- data/examples/advanced/mcp/mcp_resource_server_example.rb +309 -0
- data/examples/advanced/mcp/mcp_server_async.rb +76 -0
- data/examples/advanced/mcp/mcp_server_async_tools.rb +122 -0
- data/examples/advanced/mcp/mcp_server_legate_agent.rb +95 -0
- data/examples/advanced/mcp/mcp_server_rack.rb +89 -0
- data/examples/advanced/random_calculator.rb +104 -0
- data/examples/advanced/sleep_agent.rb +153 -0
- data/examples/advanced/webhooks/webhook_e2e_runner.rb +110 -0
- data/examples/advanced/webhooks/webhook_receiver_agent.rb +58 -0
- data/examples/advanced/workflows/task_refinement_loop_agent.rb +278 -0
- data/examples/advanced/workflows/travel_planner_auto_sequential.rb +444 -0
- data/examples/advanced/workflows/travel_planner_parallel.rb +656 -0
- data/examples/advanced/workflows/travel_planner_sequential.rb +512 -0
- data/examples/tools/oauth2_example.rb +136 -0
- data/examples/tools/sleepy_tool.rb +42 -0
- data/lib/legate/activity_log.rb +71 -0
- data/lib/legate/agent.rb +959 -0
- data/lib/legate/agent_code_generator.rb +185 -0
- data/lib/legate/agent_definition.rb +812 -0
- data/lib/legate/agentic/decision.rb +49 -0
- data/lib/legate/agentic/loop.rb +134 -0
- data/lib/legate/agentic.rb +5 -0
- data/lib/legate/agents/loop_agent.rb +248 -0
- data/lib/legate/agents/parallel_agent.rb +163 -0
- data/lib/legate/agents/sequential_agent.rb +190 -0
- data/lib/legate/agents.rb +14 -0
- data/lib/legate/auth/config.rb +148 -0
- data/lib/legate/auth/coordinator.rb +218 -0
- data/lib/legate/auth/coordinators/oauth2_coordinator.rb +99 -0
- data/lib/legate/auth/coordinators/oidc_coordinator.rb +68 -0
- data/lib/legate/auth/coordinators/service_account_coordinator.rb +122 -0
- data/lib/legate/auth/credential.rb +157 -0
- data/lib/legate/auth/encryption.rb +108 -0
- data/lib/legate/auth/error.rb +94 -0
- data/lib/legate/auth/exchanged_credential.rb +180 -0
- data/lib/legate/auth/excon_middleware.rb +285 -0
- data/lib/legate/auth/http_client_utils.rb +364 -0
- data/lib/legate/auth/manager.rb +531 -0
- data/lib/legate/auth/manager_store.rb +394 -0
- data/lib/legate/auth/middleware_factory.rb +290 -0
- data/lib/legate/auth/runner.rb +279 -0
- data/lib/legate/auth/scheme.rb +125 -0
- data/lib/legate/auth/schemes/api_key.rb +212 -0
- data/lib/legate/auth/schemes/google_service_account.rb +108 -0
- data/lib/legate/auth/schemes/http_bearer.rb +98 -0
- data/lib/legate/auth/schemes/oauth2.rb +396 -0
- data/lib/legate/auth/schemes/openid_connect.rb +346 -0
- data/lib/legate/auth/schemes/service_account.rb +388 -0
- data/lib/legate/auth/schemes.rb +40 -0
- data/lib/legate/auth/token_manager.rb +362 -0
- data/lib/legate/auth/token_store.rb +86 -0
- data/lib/legate/auth/tool_context_extension.rb +97 -0
- data/lib/legate/auth/tool_integration.rb +188 -0
- data/lib/legate/auth/url_guard.rb +81 -0
- data/lib/legate/auth.rb +453 -0
- data/lib/legate/callbacks/callback_context.rb +71 -0
- data/lib/legate/cli/agent_commands.rb +950 -0
- data/lib/legate/cli/auth_commands.rb +520 -0
- data/lib/legate/cli/base_command.rb +24 -0
- data/lib/legate/cli/deployment_commands.rb +934 -0
- data/lib/legate/cli/output_helper.rb +108 -0
- data/lib/legate/cli/session_commands.rb +138 -0
- data/lib/legate/cli/skaffold_commands.rb +223 -0
- data/lib/legate/cli/tool_commands.rb +261 -0
- data/lib/legate/cli/web_commands.rb +182 -0
- data/lib/legate/cli.rb +40 -0
- data/lib/legate/configuration/webhooks.rb +113 -0
- data/lib/legate/configuration.rb +39 -0
- data/lib/legate/definition_store.rb +23 -0
- data/lib/legate/errors.rb +118 -0
- data/lib/legate/event.rb +161 -0
- data/lib/legate/gemini_ai_beta_patch.rb +39 -0
- data/lib/legate/generators/agent_generator.rb +412 -0
- data/lib/legate/generators/code_validator.rb +48 -0
- data/lib/legate/generators/legate/install_generator.rb +35 -0
- data/lib/legate/generators/legate/templates/create_legate_tables.rb.tt +36 -0
- data/lib/legate/generators/legate/templates/initializer.rb +18 -0
- data/lib/legate/generators/runtime_tool_loader.rb +76 -0
- data/lib/legate/generators/tool_generator.rb +408 -0
- data/lib/legate/generators.rb +11 -0
- data/lib/legate/global_definition_registry.rb +506 -0
- data/lib/legate/global_tool_manager.rb +135 -0
- data/lib/legate/llm/adapter.rb +69 -0
- data/lib/legate/llm/gemini.rb +172 -0
- data/lib/legate/llm/ollama.rb +80 -0
- data/lib/legate/llm.rb +34 -0
- data/lib/legate/mcp/client.rb +320 -0
- data/lib/legate/mcp/connection/sse.rb +292 -0
- data/lib/legate/mcp/connection/stdio.rb +273 -0
- data/lib/legate/mcp/connection_manager.rb +103 -0
- data/lib/legate/mcp/server/legate_agent_adapter.rb +170 -0
- data/lib/legate/mcp/server/legate_direct_agent_adapter.rb +140 -0
- data/lib/legate/mcp/server/legate_tool_adapter.rb +119 -0
- data/lib/legate/mcp/tool_wrapper.rb +138 -0
- data/lib/legate/mcp/util/schema_converter.rb +134 -0
- data/lib/legate/mcp.rb +23 -0
- data/lib/legate/plan_executor.rb +375 -0
- data/lib/legate/planner.rb +839 -0
- data/lib/legate/rails/railtie.rb +43 -0
- data/lib/legate/rails.rb +9 -0
- data/lib/legate/redaction.rb +32 -0
- data/lib/legate/session.rb +299 -0
- data/lib/legate/session_service/active_record.rb +300 -0
- data/lib/legate/session_service/base.rb +68 -0
- data/lib/legate/session_service/event_broadcast.rb +74 -0
- data/lib/legate/session_service/in_memory.rb +188 -0
- data/lib/legate/tool/metadata_dsl.rb +122 -0
- data/lib/legate/tool.rb +276 -0
- data/lib/legate/tool_code_generator.rb +103 -0
- data/lib/legate/tool_context.rb +350 -0
- data/lib/legate/tool_loader.rb +39 -0
- data/lib/legate/tool_registry.rb +73 -0
- data/lib/legate/tool_result.rb +61 -0
- data/lib/legate/tools/agent_tool.rb +187 -0
- data/lib/legate/tools/base/http_client.rb +319 -0
- data/lib/legate/tools/base/safe_url.rb +56 -0
- data/lib/legate/tools/base_async_job_tool.rb +91 -0
- data/lib/legate/tools/calculator.rb +89 -0
- data/lib/legate/tools/cat_facts.rb +81 -0
- data/lib/legate/tools/check_job_status_tool.rb +48 -0
- data/lib/legate/tools/current_time_tool.rb +64 -0
- data/lib/legate/tools/echo.rb +43 -0
- data/lib/legate/tools/http_request_tool.rb +105 -0
- data/lib/legate/tools/random_number_tool.rb +64 -0
- data/lib/legate/tools/read_webpage_tool.rb +92 -0
- data/lib/legate/tools/sleepy_tool.rb +74 -0
- data/lib/legate/tools/webhook_tool.rb +146 -0
- data/lib/legate/version.rb +5 -0
- data/lib/legate/web/app.rb +984 -0
- data/lib/legate/web/public/css/main.css +4980 -0
- data/lib/legate/web/public/images/favicon-256.png +0 -0
- data/lib/legate/web/public/images/favicon-32.png +0 -0
- data/lib/legate/web/public/images/legate-logo-dark.png +0 -0
- data/lib/legate/web/public/images/legate-logo-light.png +0 -0
- data/lib/legate/web/public/js/legate.js +616 -0
- data/lib/legate/web/public/styles/main.scss +4402 -0
- data/lib/legate/web/routes/agent_authentication_routes.rb +530 -0
- data/lib/legate/web/routes/agent_definition_routes.rb +803 -0
- data/lib/legate/web/routes/agent_generator_routes.rb +80 -0
- data/lib/legate/web/routes/agent_interaction_routes.rb +734 -0
- data/lib/legate/web/routes/agent_runtime_routes.rb +323 -0
- data/lib/legate/web/routes/api_routes.rb +56 -0
- data/lib/legate/web/routes/authentication_routes.rb +1541 -0
- data/lib/legate/web/routes/core_routes.rb +111 -0
- data/lib/legate/web/routes/documentation_routes.rb +220 -0
- data/lib/legate/web/routes/tool_generator_routes.rb +81 -0
- data/lib/legate/web/routes/tools_ui_routes.rb +207 -0
- data/lib/legate/web/sass_compiler.rb +73 -0
- data/lib/legate/web/views/_active_session_info.slim +25 -0
- data/lib/legate/web/views/_activity_list.slim +55 -0
- data/lib/legate/web/views/_agent_card.slim +56 -0
- data/lib/legate/web/views/_agent_generator_modal.slim +382 -0
- data/lib/legate/web/views/_agent_status_controls.slim +71 -0
- data/lib/legate/web/views/_agent_tool_table.slim +74 -0
- data/lib/legate/web/views/_chat_message.slim +95 -0
- data/lib/legate/web/views/_display_agent_configuration.slim +26 -0
- data/lib/legate/web/views/_display_agent_description.slim +11 -0
- data/lib/legate/web/views/_display_agent_fallback.slim +15 -0
- data/lib/legate/web/views/_display_agent_hierarchy.slim +93 -0
- data/lib/legate/web/views/_display_agent_instruction.slim +17 -0
- data/lib/legate/web/views/_display_agent_mcp.slim +13 -0
- data/lib/legate/web/views/_display_agent_model.slim +17 -0
- data/lib/legate/web/views/_display_agent_name.slim +42 -0
- data/lib/legate/web/views/_display_agent_output_key.slim +26 -0
- data/lib/legate/web/views/_display_agent_type.slim +65 -0
- data/lib/legate/web/views/_edit_agent_configuration.slim +74 -0
- data/lib/legate/web/views/_edit_agent_description.slim +16 -0
- data/lib/legate/web/views/_edit_agent_fallback.slim +25 -0
- data/lib/legate/web/views/_edit_agent_hierarchy.slim +98 -0
- data/lib/legate/web/views/_edit_agent_instruction.slim +49 -0
- data/lib/legate/web/views/_edit_agent_mcp.slim +33 -0
- data/lib/legate/web/views/_edit_agent_model.slim +23 -0
- data/lib/legate/web/views/_edit_agent_output_key.slim +36 -0
- data/lib/legate/web/views/_edit_agent_tools.slim +40 -0
- data/lib/legate/web/views/_edit_agent_type.slim +67 -0
- data/lib/legate/web/views/_session_error.slim +4 -0
- data/lib/legate/web/views/_skeleton.slim +69 -0
- data/lib/legate/web/views/_tool_card.slim +9 -0
- data/lib/legate/web/views/_tool_generator_modal.slim +311 -0
- data/lib/legate/web/views/agent.slim +436 -0
- data/lib/legate/web/views/agent_auth.slim +562 -0
- data/lib/legate/web/views/agents.slim +369 -0
- data/lib/legate/web/views/auth.slim +112 -0
- data/lib/legate/web/views/auth_credential_detail.slim +327 -0
- data/lib/legate/web/views/auth_credentials.slim +261 -0
- data/lib/legate/web/views/auth_debug.slim +94 -0
- data/lib/legate/web/views/auth_mapping_detail.slim +151 -0
- data/lib/legate/web/views/auth_mapping_new.slim +123 -0
- data/lib/legate/web/views/auth_mappings.slim +120 -0
- data/lib/legate/web/views/auth_scheme_detail.slim +274 -0
- data/lib/legate/web/views/auth_schemes.slim +259 -0
- data/lib/legate/web/views/auth_test.slim +418 -0
- data/lib/legate/web/views/chat.slim +192 -0
- data/lib/legate/web/views/docs_index.slim +105 -0
- data/lib/legate/web/views/docs_show.slim +105 -0
- data/lib/legate/web/views/error_404.slim +5 -0
- data/lib/legate/web/views/index.slim +148 -0
- data/lib/legate/web/views/layout.slim +144 -0
- data/lib/legate/web/views/tool_detail.slim +87 -0
- data/lib/legate/web/views/tools.slim +50 -0
- data/lib/legate/web/webhook_listener.rb +367 -0
- data/lib/legate/web.rb +9 -0
- data/lib/legate.rb +220 -0
- data/public/docs/advanced/callbacks.md +828 -0
- data/public/docs/advanced/mcp_schema_conversion.md +59 -0
- data/public/docs/authentication/api_reference/config.md +210 -0
- data/public/docs/authentication/api_reference/credential.md +246 -0
- data/public/docs/authentication/api_reference/encryption.md +218 -0
- data/public/docs/authentication/api_reference/exchanged_credential.md +271 -0
- data/public/docs/authentication/api_reference/excon_middleware.md +175 -0
- data/public/docs/authentication/api_reference/index.md +30 -0
- data/public/docs/authentication/api_reference/scheme.md +250 -0
- data/public/docs/authentication/api_reference/schemes/api_key.md +175 -0
- data/public/docs/authentication/api_reference/schemes/google_service_account.md +221 -0
- data/public/docs/authentication/api_reference/schemes/http_bearer.md +169 -0
- data/public/docs/authentication/api_reference/schemes/oauth2.md +343 -0
- data/public/docs/authentication/api_reference/schemes/oidc.md +73 -0
- data/public/docs/authentication/api_reference/schemes/openid_connect.md +311 -0
- data/public/docs/authentication/api_reference/schemes/service_account.md +287 -0
- data/public/docs/authentication/api_reference/token_manager.md +221 -0
- data/public/docs/authentication/api_reference/token_store.md +146 -0
- data/public/docs/authentication/api_reference/tool_context_extension.md +166 -0
- data/public/docs/authentication/guides/api_key.md +190 -0
- data/public/docs/authentication/guides/bearer.md +172 -0
- data/public/docs/authentication/guides/configuration.md +255 -0
- data/public/docs/authentication/guides/custom_flow.md +523 -0
- data/public/docs/authentication/guides/index.md +24 -0
- data/public/docs/authentication/guides/migration.md +435 -0
- data/public/docs/authentication/guides/oauth2.md +252 -0
- data/public/docs/authentication/guides/oidc.md +241 -0
- data/public/docs/authentication/guides/overview.md +155 -0
- data/public/docs/authentication/guides/secure_storage.md +301 -0
- data/public/docs/authentication/guides/service_account.md +228 -0
- data/public/docs/authentication/guides/token_lifecycle.md +295 -0
- data/public/docs/authentication/guides/web_ui_integration.md +504 -0
- data/public/docs/authentication/index.md +58 -0
- data/public/docs/authentication/troubleshooting/credential_storage.md +550 -0
- data/public/docs/authentication/troubleshooting/environment_variables.md +540 -0
- data/public/docs/authentication/troubleshooting/index.md +11 -0
- data/public/docs/authentication/troubleshooting/oauth2_issues.md +220 -0
- data/public/docs/authentication/troubleshooting/oidc_issues.md +412 -0
- data/public/docs/authentication/troubleshooting/token_refresh.md +338 -0
- data/public/docs/cli/legate_cli_usage.md +363 -0
- data/public/docs/core_concepts/legate_agent_lifecycle.md +124 -0
- data/public/docs/core_concepts/legate_architecture_overview.md +110 -0
- data/public/docs/core_concepts/legate_configuration.md +116 -0
- data/public/docs/core_concepts/legate_definition_store.md +102 -0
- data/public/docs/core_concepts/legate_planner.md +94 -0
- data/public/docs/core_concepts/legate_session_service.md +104 -0
- data/public/docs/error_handling/legate_error_handling.md +122 -0
- data/public/docs/examples.md +199 -0
- data/public/docs/getting_started.md +111 -0
- data/public/docs/guides/agentic_agents.md +137 -0
- data/public/docs/guides/ai_code_generators.md +437 -0
- data/public/docs/guides/auto_loading.md +326 -0
- data/public/docs/guides/configuring_agent_webhooks.md +219 -0
- data/public/docs/guides/http_client_usage.md +264 -0
- data/public/docs/guides/llm_providers.md +137 -0
- data/public/docs/guides/mcp_client_integration.md +232 -0
- data/public/docs/guides/mcp_server_exposure.md +206 -0
- data/public/docs/guides/rails_integration.md +128 -0
- data/public/docs/guides/sending_outbound_webhooks.md +227 -0
- data/public/docs/guides/streaming.md +112 -0
- data/public/docs/guides/webhooks.md +288 -0
- data/public/docs/introduction.md +51 -0
- data/public/docs/multi_agent_systems/advanced_features.md +57 -0
- data/public/docs/multi_agent_systems/agent_delegation.md +190 -0
- data/public/docs/multi_agent_systems/agent_hierarchy.md +49 -0
- data/public/docs/multi_agent_systems/state_management.md +47 -0
- data/public/docs/multi_agent_systems/workflow_agents.md +72 -0
- data/public/docs/tools/legate_built_in_tools.md +332 -0
- data/public/docs/tools/legate_tools_and_registry.md +263 -0
- data/public/docs/web_ui/legate_web_ui.md +137 -0
- metadata +823 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/ File: lib/legate/web/views/agents.slim
|
|
2
|
+
.content.mb-4
|
|
3
|
+
h1.title.is-2 Agents
|
|
4
|
+
p.subtitle Manage agent definitions and runtime instances.
|
|
5
|
+
|
|
6
|
+
/ Stat strip — derived from the current view models
|
|
7
|
+
- _total_agents = @view_agents ? @view_agents.size : 0
|
|
8
|
+
- _running_agents = @view_agents ? @view_agents.count { |a| a[:running] } : 0
|
|
9
|
+
- _tool_count = @available_tools ? @available_tools.size : 0
|
|
10
|
+
.stat-strip.mb-5
|
|
11
|
+
.stat-card
|
|
12
|
+
.stat-icon
|
|
13
|
+
i.fas.fa-robot
|
|
14
|
+
.stat-body
|
|
15
|
+
.stat-value= _total_agents
|
|
16
|
+
.stat-label Total Agents
|
|
17
|
+
.stat-card
|
|
18
|
+
.stat-icon.is-accent
|
|
19
|
+
i.fas.fa-circle-play
|
|
20
|
+
.stat-body
|
|
21
|
+
.stat-value
|
|
22
|
+
= _running_agents
|
|
23
|
+
span.stat-suffix= "/#{_total_agents}"
|
|
24
|
+
.stat-label Running
|
|
25
|
+
.stat-card
|
|
26
|
+
.stat-icon.is-info
|
|
27
|
+
i.fas.fa-screwdriver-wrench
|
|
28
|
+
.stat-body
|
|
29
|
+
.stat-value= _tool_count
|
|
30
|
+
.stat-label Available Tools
|
|
31
|
+
|
|
32
|
+
/ AI Generator button - prominent placement
|
|
33
|
+
.buttons.mb-4
|
|
34
|
+
button.button.is-medium.ai-generate-btn(onclick="openAgentGeneratorModal()")
|
|
35
|
+
span.icon
|
|
36
|
+
i.fas.fa-wand-magic-sparkles
|
|
37
|
+
span
|
|
38
|
+
strong Build with AI Builder
|
|
39
|
+
|
|
40
|
+
details.box.mb-5.create-agent-details( _="on closeCreateAgentForm from body remove @open" )
|
|
41
|
+
summary.is-clickable
|
|
42
|
+
span.icon.mr-2
|
|
43
|
+
i.fas.fa-plus-circle
|
|
44
|
+
strong Create New Agent Definition
|
|
45
|
+
|
|
46
|
+
.mt-4
|
|
47
|
+
form(hx-post="/agents" hx-target="#agent-list-grid" hx-swap="beforeend" _="on htmx:afterRequest call this.reset() then call destroyCodeMirrorInstance('mcp_servers_json') then call destroyCodeMirrorInstance('instruction') then call filterAgents()")
|
|
48
|
+
|
|
49
|
+
/ ===== Basic Information Section =====
|
|
50
|
+
.form-section
|
|
51
|
+
.form-section-header
|
|
52
|
+
span.icon
|
|
53
|
+
i.fas.fa-info-circle
|
|
54
|
+
span Basic Information
|
|
55
|
+
.form-section-content
|
|
56
|
+
.columns.is-multiline
|
|
57
|
+
.column.is-half
|
|
58
|
+
.field
|
|
59
|
+
label.label Name
|
|
60
|
+
.control.has-icons-left
|
|
61
|
+
input.input(type="text" name="name" placeholder="unique-agent-name" required=true)
|
|
62
|
+
span.icon.is-small.is-left
|
|
63
|
+
i.fas.fa-robot
|
|
64
|
+
.column.is-half
|
|
65
|
+
.field
|
|
66
|
+
label.label for="agent_type" Agent Type
|
|
67
|
+
.control.has-icons-left
|
|
68
|
+
.select.is-fullwidth
|
|
69
|
+
select#agent_type(name="agent_type" onchange="toggleWorkflowFields()")
|
|
70
|
+
option(value="llm" selected=true) LLM Agent
|
|
71
|
+
option(value="sequential") Sequential Workflow
|
|
72
|
+
option(value="parallel") Parallel Workflow
|
|
73
|
+
option(value="loop") Loop Workflow
|
|
74
|
+
span.icon.is-small.is-left
|
|
75
|
+
i.fas.fa-cog
|
|
76
|
+
p.help
|
|
77
|
+
| LLM uses AI for task execution.
|
|
78
|
+
| Workflow agents orchestrate other agents.
|
|
79
|
+
.column.is-half
|
|
80
|
+
.field
|
|
81
|
+
label.label for="planning_strategy" Planning Strategy
|
|
82
|
+
.control.has-icons-left
|
|
83
|
+
.select.is-fullwidth
|
|
84
|
+
select#planning_strategy(name="planning_strategy")
|
|
85
|
+
option(value="plan" selected=true) Plan (default)
|
|
86
|
+
option(value="react") ReAct (agentic loop)
|
|
87
|
+
span.icon.is-small.is-left
|
|
88
|
+
i.fas.fa-route
|
|
89
|
+
p.help
|
|
90
|
+
| LLM agents only. ReAct acts one step at a time, reacting to each tool result.
|
|
91
|
+
.column.is-full
|
|
92
|
+
.field
|
|
93
|
+
label.label for="description" Description
|
|
94
|
+
.control
|
|
95
|
+
textarea.textarea#description name="description" placeholder="What does this agent do?" required="required" rows="2"
|
|
96
|
+
.column.is-full
|
|
97
|
+
.field
|
|
98
|
+
label.label for="output_key" Output Key
|
|
99
|
+
.control.has-icons-left
|
|
100
|
+
input.input(type="text" name="output_key" placeholder="result_key")
|
|
101
|
+
span.icon.is-small.is-left
|
|
102
|
+
i.fas.fa-key
|
|
103
|
+
p.help Optional key to store the agent's final result in the session state.
|
|
104
|
+
|
|
105
|
+
/ ===== Model Configuration Section =====
|
|
106
|
+
.form-section#model-config-section
|
|
107
|
+
.form-section-header
|
|
108
|
+
span.icon
|
|
109
|
+
i.fas.fa-brain
|
|
110
|
+
span Model Configuration
|
|
111
|
+
.form-section-content
|
|
112
|
+
.columns
|
|
113
|
+
.column.is-half
|
|
114
|
+
.field
|
|
115
|
+
label.label for="model" Language Model
|
|
116
|
+
.control.has-icons-left
|
|
117
|
+
.select.is-fullwidth
|
|
118
|
+
select(name="model")
|
|
119
|
+
- default_model = Legate::Agent::DEFAULT_MODEL
|
|
120
|
+
- @available_models.each do |model_name|
|
|
121
|
+
option(value=model_name selected=(model_name == default_model)) = model_name
|
|
122
|
+
span.icon.is-small.is-left
|
|
123
|
+
i.fas.fa-microchip
|
|
124
|
+
.column.is-half
|
|
125
|
+
.field
|
|
126
|
+
label.label Planning Fallback
|
|
127
|
+
.control.has-icons-left
|
|
128
|
+
.select.is-fullwidth
|
|
129
|
+
select(name="fallback_mode")
|
|
130
|
+
option(value="error" selected=true) Return Error Message
|
|
131
|
+
option(value="echo") Attempt Echo Tool (if available)
|
|
132
|
+
span.icon.is-small.is-left
|
|
133
|
+
i.fas.fa-random
|
|
134
|
+
p.help Select behavior when the agent cannot determine which tool to use.
|
|
135
|
+
|
|
136
|
+
/ ===== Instructions Section =====
|
|
137
|
+
.form-section
|
|
138
|
+
.form-section-header
|
|
139
|
+
span.icon
|
|
140
|
+
i.fas.fa-file-alt
|
|
141
|
+
span Instructions
|
|
142
|
+
.form-section-content
|
|
143
|
+
.field
|
|
144
|
+
label.label for="instruction" System Prompt
|
|
145
|
+
.control
|
|
146
|
+
textarea.textarea#instruction name="instruction" rows="5" placeholder="Guide the agent's behavior, persona, and tool usage..."
|
|
147
|
+
p.help Guide the agent's behavior, persona, and tool usage. Markdown is supported by some models.
|
|
148
|
+
|
|
149
|
+
/ ===== Tools & Integrations Section =====
|
|
150
|
+
.form-section
|
|
151
|
+
.form-section-header
|
|
152
|
+
span.icon
|
|
153
|
+
i.fas.fa-toolbox
|
|
154
|
+
span Tools & Integrations
|
|
155
|
+
.form-section-content
|
|
156
|
+
.columns
|
|
157
|
+
.column.is-half
|
|
158
|
+
.field
|
|
159
|
+
label.label Tools
|
|
160
|
+
.control
|
|
161
|
+
- if @available_tools && !@available_tools.empty?
|
|
162
|
+
.panel.tool-selection-panel
|
|
163
|
+
p.panel-heading Available Tools
|
|
164
|
+
- @available_tools.each do |tool_info|
|
|
165
|
+
label.panel-block.is-clickable
|
|
166
|
+
input.mr-3(type="checkbox" name="tools[]" value=tool_info[:name])
|
|
167
|
+
span
|
|
168
|
+
strong #{tool_info[:name].to_s.capitalize}
|
|
169
|
+
br
|
|
170
|
+
small.has-text-grey #{tool_info[:description]}
|
|
171
|
+
- else
|
|
172
|
+
.notification.is-warning.is-light No tools available for selection.
|
|
173
|
+
.column.is-half
|
|
174
|
+
.field
|
|
175
|
+
label.label for="mcp_servers_json" MCP Server Configurations (JSON Array)
|
|
176
|
+
.control
|
|
177
|
+
textarea.textarea#mcp_servers_json name="mcp_servers_json" rows="5" placeholder='[{"type": "stdio", "command": "..."}]'
|
|
178
|
+
p.help
|
|
179
|
+
| Enter a valid JSON array or leave empty. Example:
|
|
180
|
+
code | [{"type": "stdio", "command": "npx", "args": [...]}]
|
|
181
|
+
|
|
182
|
+
/ ===== Workflow Configuration / Delegation Section =====
|
|
183
|
+
.form-section#workflow-configuration-section style="display: none;"
|
|
184
|
+
.form-section-header
|
|
185
|
+
span.icon
|
|
186
|
+
i.fas.fa-project-diagram
|
|
187
|
+
span#workflow-section-title Workflow Configuration
|
|
188
|
+
.form-section-content
|
|
189
|
+
.field
|
|
190
|
+
label.label#sub-agent-label Workflow Sub-Agents
|
|
191
|
+
p.help.mb-3#sub-agent-help
|
|
192
|
+
| Select agents to include in this workflow. For sequential workflows, the order is important.
|
|
193
|
+
| These agents must already be created before they can be added to a workflow.
|
|
194
|
+
.control
|
|
195
|
+
- all_agent_names = @view_agents ? @view_agents.map { |agent| agent[:name] } : []
|
|
196
|
+
- if all_agent_names.any?
|
|
197
|
+
.panel.sub-agent-selection-panel
|
|
198
|
+
p.panel-heading Available Agents
|
|
199
|
+
- all_agent_names.each do |agent_name|
|
|
200
|
+
label.panel-block.is-clickable
|
|
201
|
+
input.mr-3(type="checkbox" name="sub_agent_names[]" value=agent_name)
|
|
202
|
+
span = agent_name
|
|
203
|
+
|
|
204
|
+
/ Additional dropdown for sequential workflow with ordering instructions
|
|
205
|
+
.field.mt-3#sequential-workflow-ordering style="display: none;"
|
|
206
|
+
label.label.is-size-6 Execution Order
|
|
207
|
+
p.help.is-size-7.mb-2
|
|
208
|
+
| For sequential workflows, agents will execute in the order they are selected above.
|
|
209
|
+
| First selected = first executed.
|
|
210
|
+
.notification.is-info.is-light
|
|
211
|
+
span.icon.mr-2
|
|
212
|
+
i.fas.fa-info-circle
|
|
213
|
+
| Tip: After creating the workflow, you can edit the hierarchy to reorder the agents.
|
|
214
|
+
- else
|
|
215
|
+
.notification.is-warning.is-light
|
|
216
|
+
| No other agents available to select as sub-agents.
|
|
217
|
+
| Create some regular agents first before creating a workflow.
|
|
218
|
+
|
|
219
|
+
/ Loop Specific Parameters
|
|
220
|
+
.field#loop-parameters-container style="display: none;"
|
|
221
|
+
label.label Loop Configuration
|
|
222
|
+
.columns
|
|
223
|
+
.column.is-one-third
|
|
224
|
+
.field
|
|
225
|
+
label.label.is-small Max Iterations
|
|
226
|
+
.control
|
|
227
|
+
input.input.is-small(type="number" name="loop_max_iterations" placeholder="10" min="1")
|
|
228
|
+
.column.is-one-third
|
|
229
|
+
.field
|
|
230
|
+
label.label.is-small Condition State Key
|
|
231
|
+
.control
|
|
232
|
+
input.input.is-small(type="text" name="loop_condition_state_key" placeholder="e.g. task_complete")
|
|
233
|
+
.column.is-one-third
|
|
234
|
+
.field
|
|
235
|
+
label.label.is-small Expected Value
|
|
236
|
+
.control
|
|
237
|
+
input.input.is-small(type="text" name="loop_condition_expected_value" placeholder="e.g. true")
|
|
238
|
+
|
|
239
|
+
.field.mt-5
|
|
240
|
+
.control
|
|
241
|
+
button.button.is-link(type="submit")
|
|
242
|
+
span.icon
|
|
243
|
+
i.fas.fa-save
|
|
244
|
+
span Create Agent Definition
|
|
245
|
+
|
|
246
|
+
.legion-section
|
|
247
|
+
.legion-header
|
|
248
|
+
.legion-header-left
|
|
249
|
+
h2.title.is-4.mb-0 Deployed Legion
|
|
250
|
+
span.legion-count#legion-count
|
|
251
|
+
.legion-header-right
|
|
252
|
+
.control.has-icons-left.search-with-shortcut
|
|
253
|
+
input.input#agent-search-input type="text" placeholder="Search agents..." onkeyup="filterAgents()"
|
|
254
|
+
span.icon.is-left
|
|
255
|
+
i.fas.fa-search
|
|
256
|
+
span.keyboard-hint
|
|
257
|
+
kbd ⌘K
|
|
258
|
+
|
|
259
|
+
/ Card grid — HTMX start/stop/delete/create swap individual .agent-card elements
|
|
260
|
+
#agent-list-grid.legion-grid(data-testid="agent-list-grid")
|
|
261
|
+
- if @view_agents && !@view_agents.empty?
|
|
262
|
+
- @view_agents.each do |agent_info|
|
|
263
|
+
== slim :_agent_card, locals: { agent_info: agent_info, available_tools: @available_tools }
|
|
264
|
+
|
|
265
|
+
/ Empty state — hidden whenever any cards are present (toggled by JS on filter/create)
|
|
266
|
+
#no-agents-state.legion-empty(class=(@view_agents && !@view_agents.empty? ? 'is-hidden' : ''))
|
|
267
|
+
span.icon.is-large.has-text-grey-lighter
|
|
268
|
+
i.fas.fa-robot.fa-3x
|
|
269
|
+
p.title.is-5.mt-4.has-text-grey No agents defined yet
|
|
270
|
+
p.subtitle.is-6.has-text-grey-light Get started by creating your first agent
|
|
271
|
+
.buttons.is-centered.mt-4
|
|
272
|
+
a.button.is-primary.is-outlined(href="#" onclick="document.querySelector('.create-agent-details').open = true; return false;")
|
|
273
|
+
span.icon
|
|
274
|
+
i.fas.fa-plus
|
|
275
|
+
span Create Agent
|
|
276
|
+
|
|
277
|
+
javascript:
|
|
278
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
279
|
+
// Initialize form fields based on selected agent type
|
|
280
|
+
toggleWorkflowFields();
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
function filterAgents() {
|
|
284
|
+
const input = document.getElementById('agent-search-input');
|
|
285
|
+
const filter = input ? input.value.toLowerCase().trim() : '';
|
|
286
|
+
const cards = document.querySelectorAll('#agent-list-grid .agent-card');
|
|
287
|
+
const emptyState = document.getElementById('no-agents-state');
|
|
288
|
+
const countEl = document.getElementById('legion-count');
|
|
289
|
+
|
|
290
|
+
let shown = 0;
|
|
291
|
+
cards.forEach(card => {
|
|
292
|
+
// data-search holds name + description + tools + model, pre-lowercased
|
|
293
|
+
const haystack = card.getAttribute('data-search') || card.textContent.toLowerCase();
|
|
294
|
+
const match = filter === '' || haystack.includes(filter);
|
|
295
|
+
card.style.display = match ? '' : 'none';
|
|
296
|
+
if (match) shown++;
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
// Empty state shows only when there are no cards at all (not when a search
|
|
300
|
+
// simply matches nothing — that gets the placeholder hint instead).
|
|
301
|
+
if (emptyState) emptyState.classList.toggle('is-hidden', cards.length > 0);
|
|
302
|
+
|
|
303
|
+
// Live count of agents in the legion
|
|
304
|
+
if (countEl) countEl.textContent = cards.length ? `${cards.length}` : '';
|
|
305
|
+
|
|
306
|
+
if (input) {
|
|
307
|
+
input.placeholder = (filter !== '')
|
|
308
|
+
? `${shown} result${shown !== 1 ? 's' : ''} found`
|
|
309
|
+
: 'Search agents...';
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Initialise the legion count on load.
|
|
314
|
+
document.addEventListener('DOMContentLoaded', filterAgents);
|
|
315
|
+
|
|
316
|
+
function toggleWorkflowFields() {
|
|
317
|
+
const agentType = document.getElementById('agent_type').value;
|
|
318
|
+
|
|
319
|
+
// Toggle display of model configuration section based on agent type
|
|
320
|
+
const modelConfigSection = document.getElementById('model-config-section');
|
|
321
|
+
if (agentType === 'llm') {
|
|
322
|
+
modelConfigSection.style.display = '';
|
|
323
|
+
} else {
|
|
324
|
+
modelConfigSection.style.display = 'none';
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Toggle display of workflow/delegation configuration section
|
|
328
|
+
const workflowSection = document.getElementById('workflow-configuration-section');
|
|
329
|
+
const sectionTitle = document.getElementById('workflow-section-title');
|
|
330
|
+
const subAgentLabel = document.getElementById('sub-agent-label');
|
|
331
|
+
const subAgentHelp = document.getElementById('sub-agent-help');
|
|
332
|
+
const loopParams = document.getElementById('loop-parameters-container');
|
|
333
|
+
const orderingSection = document.getElementById('sequential-workflow-ordering');
|
|
334
|
+
|
|
335
|
+
// We always show the section now, but customize text
|
|
336
|
+
workflowSection.style.display = '';
|
|
337
|
+
|
|
338
|
+
// Reset displays
|
|
339
|
+
loopParams.style.display = 'none';
|
|
340
|
+
if(orderingSection) orderingSection.style.display = 'none';
|
|
341
|
+
|
|
342
|
+
if (agentType === 'llm') {
|
|
343
|
+
sectionTitle.textContent = "Delegation Configuration";
|
|
344
|
+
subAgentLabel.textContent = "Delegation Targets";
|
|
345
|
+
subAgentHelp.innerHTML = "Select other agents that this LLM agent can delegate tasks to.";
|
|
346
|
+
} else {
|
|
347
|
+
sectionTitle.textContent = "Workflow Configuration";
|
|
348
|
+
subAgentLabel.textContent = "Workflow Sub-Agents";
|
|
349
|
+
|
|
350
|
+
// Check if there are any agents available for selection
|
|
351
|
+
const agentsAvailable = workflowSection.querySelector('.sub-agent-selection-panel') !== null;
|
|
352
|
+
|
|
353
|
+
if (agentType === 'sequential') {
|
|
354
|
+
subAgentHelp.innerHTML = 'Select agents to execute in sequence. The order of selection matters.';
|
|
355
|
+
if (orderingSection) orderingSection.style.display = agentsAvailable ? '' : 'none';
|
|
356
|
+
} else if (agentType === 'parallel') {
|
|
357
|
+
subAgentHelp.innerHTML = 'Select agents to execute concurrently. All selected agents will run at the same time.';
|
|
358
|
+
} else if (agentType === 'loop') {
|
|
359
|
+
subAgentHelp.innerHTML = 'Select agents to execute in a loop until a condition is met.';
|
|
360
|
+
loopParams.style.display = '';
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/ Include the AI Agent Generator Modal
|
|
366
|
+
== slim :_agent_generator_modal, layout: false
|
|
367
|
+
|
|
368
|
+
/ Tool generator modal — enables the "Build →" handoff for suggested tools
|
|
369
|
+
== slim :_tool_generator_modal, layout: false
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/ File: lib/legate/web/views/auth.slim
|
|
2
|
+
.content.has-text-centered.mb-6
|
|
3
|
+
h1.title.is-2 Authentication Management
|
|
4
|
+
p.subtitle.is-4 Configure and manage authentication schemes for Legate agents
|
|
5
|
+
|
|
6
|
+
- if @auth_manager_available
|
|
7
|
+
.columns.is-centered.is-multiline
|
|
8
|
+
.column.is-one-third
|
|
9
|
+
.card.has-text-centered
|
|
10
|
+
.card-content
|
|
11
|
+
span.icon.is-large.has-text-primary.mb-3
|
|
12
|
+
i.fas.fa-key.fa-3x
|
|
13
|
+
h2.title.is-4 Schemes
|
|
14
|
+
p.subtitle.is-6 #{@schemes_count} registered
|
|
15
|
+
p Manage authentication schemes like OAuth2, API Keys, and Service Accounts
|
|
16
|
+
.buttons.is-centered.mt-4
|
|
17
|
+
a.button.is-primary(href="/auth/schemes")
|
|
18
|
+
span.icon
|
|
19
|
+
i.fas.fa-eye
|
|
20
|
+
span View Schemes
|
|
21
|
+
|
|
22
|
+
.column.is-one-third
|
|
23
|
+
.card.has-text-centered
|
|
24
|
+
.card-content
|
|
25
|
+
span.icon.is-large.has-text-primary.mb-3
|
|
26
|
+
i.fas.fa-id-card.fa-3x
|
|
27
|
+
h2.title.is-4 Credentials
|
|
28
|
+
p.subtitle.is-6 #{@credentials_count} configured
|
|
29
|
+
p Securely manage authentication credentials for external services
|
|
30
|
+
.buttons.is-centered.mt-4
|
|
31
|
+
a.button.is-primary(href="/auth/credentials")
|
|
32
|
+
span.icon
|
|
33
|
+
i.fas.fa-eye
|
|
34
|
+
span View Credentials
|
|
35
|
+
|
|
36
|
+
.column.is-one-third
|
|
37
|
+
.card.has-text-centered
|
|
38
|
+
.card-content
|
|
39
|
+
span.icon.is-large.has-text-primary.mb-3
|
|
40
|
+
i.fas.fa-sitemap.fa-3x
|
|
41
|
+
h2.title.is-4 URL Mappings
|
|
42
|
+
p.subtitle.is-6 #{@mappings_count} configured
|
|
43
|
+
p Configure which authentication to use for specific URLs and services
|
|
44
|
+
.buttons.is-centered.mt-4
|
|
45
|
+
a.button.is-primary(href="/auth/mappings")
|
|
46
|
+
span.icon
|
|
47
|
+
i.fas.fa-eye
|
|
48
|
+
span View Mappings
|
|
49
|
+
|
|
50
|
+
.columns.is-centered.mt-5
|
|
51
|
+
.column.is-one-third
|
|
52
|
+
.card.has-text-centered
|
|
53
|
+
.card-content
|
|
54
|
+
span.icon.is-large.has-text-primary.mb-3
|
|
55
|
+
i.fas.fa-vial.fa-3x
|
|
56
|
+
h2.title.is-4 Testing Tools
|
|
57
|
+
p Test and validate your authentication configurations
|
|
58
|
+
.buttons.is-centered.mt-4
|
|
59
|
+
a.button.is-danger(href="/auth/test")
|
|
60
|
+
span.icon
|
|
61
|
+
i.fas.fa-play
|
|
62
|
+
span Test Authentication
|
|
63
|
+
|
|
64
|
+
.column.is-one-third
|
|
65
|
+
.card.has-text-centered
|
|
66
|
+
.card-content
|
|
67
|
+
span.icon.is-large.has-text-primary.mb-3
|
|
68
|
+
i.fas.fa-bug.fa-3x
|
|
69
|
+
h2.title.is-4 Debug Information
|
|
70
|
+
p View detailed information about the authentication manager state
|
|
71
|
+
.buttons.is-centered.mt-4
|
|
72
|
+
a.button.is-warning(href="/auth/debug")
|
|
73
|
+
span.icon
|
|
74
|
+
i.fas.fa-search
|
|
75
|
+
span Debug Info
|
|
76
|
+
|
|
77
|
+
- else
|
|
78
|
+
.columns.is-centered
|
|
79
|
+
.column.is-half
|
|
80
|
+
.notification.is-danger
|
|
81
|
+
h3.title.is-4 Authentication Manager Unavailable
|
|
82
|
+
p The authentication manager is not available. This could be due to:
|
|
83
|
+
ul.mt-3
|
|
84
|
+
li Authentication system not initialized
|
|
85
|
+
li Missing required dependencies
|
|
86
|
+
li Configuration error
|
|
87
|
+
- if @error_message
|
|
88
|
+
.message.is-danger.mt-4
|
|
89
|
+
.message-header
|
|
90
|
+
p Error Details
|
|
91
|
+
.message-body
|
|
92
|
+
pre = @error_message
|
|
93
|
+
|
|
94
|
+
.content.mt-6
|
|
95
|
+
h2.title.is-4 About Authentication Management
|
|
96
|
+
.columns
|
|
97
|
+
.column.is-half
|
|
98
|
+
.content
|
|
99
|
+
h3.title.is-5 What is this for?
|
|
100
|
+
p This authentication management system helps you configure how your Legate agents authenticate with external services.
|
|
101
|
+
ul
|
|
102
|
+
li <strong>Schemes</strong>: Different authentication methods (OAuth2, API Keys, etc.)
|
|
103
|
+
li <strong>Credentials</strong>: The actual authentication data (keys, tokens, etc.)
|
|
104
|
+
li <strong>URL Mappings</strong>: Rules for which authentication to use for specific services
|
|
105
|
+
.column.is-half
|
|
106
|
+
.content
|
|
107
|
+
h3.title.is-5 Getting Started
|
|
108
|
+
ol
|
|
109
|
+
li Configure authentication schemes for the types of services you'll use
|
|
110
|
+
li Add credentials for your specific accounts and API keys
|
|
111
|
+
li Set up URL mappings to automatically apply the right authentication
|
|
112
|
+
li Test your configurations to ensure they work correctly
|