solace-agent-mesh 1.4.6__py3-none-any.whl → 1.4.8__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.
Potentially problematic release.
This version of solace-agent-mesh might be problematic. Click here for more details.
- solace_agent_mesh/agent/adk/runner.py +24 -8
- solace_agent_mesh/agent/sac/component.py +13 -1
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/{0e682baa.da822665.js → 0e682baa.d054e1d8.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/166ab619.e27886d9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{1c6e87d2.43771adc.js → 1c6e87d2.e056b7e0.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/453a82a6.3c6bb61d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/483cef9a.4736f2d8.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{4c2787c2.fc6804f2.js → 4c2787c2.c1290a40.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/{5b4258a4.dff11eca.js → 5b4258a4.fdfd2325.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/{75384d09.abdf9cf9.js → 75384d09.c19e8b51.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/85387663.be2bc838.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/945fb41e.16e00776.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a12a4955.25fbed32.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/a3a92b25.af35e313.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ae0e903d.5fe5203f.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/bac0be12.17de4316.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/cee5d587.47904f5e.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/d6a81ee7.829198f1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.ed8dd236.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f897a61a.126663fe.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{fbfa3e75.aca209c9.js → fbfa3e75.e144b16c.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/main.86924c42.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.0d2ff2b6.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/rbac-setup-guilde/index.html +201 -0
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/single-sign-on/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-technical-migration-map/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +7 -7
- solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +6 -6
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +7 -7
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +12 -13
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/litellm_models/index.html +49 -0
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +6 -6
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +6 -6
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +8 -8
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +7 -7
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-python-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +6 -6
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +7 -7
- solace_agent_mesh/assets/docs/lunr-index-1759246102819.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1759246102819.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/assets/docs/sitemap.xml +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +6 -3
- solace_agent_mesh/cli/commands/init_cmd/__init__.py +3 -3
- solace_agent_mesh/cli/commands/init_cmd/broker_step.py +1 -1
- solace_agent_mesh/cli/commands/init_cmd/env_step.py +1 -1
- solace_agent_mesh/cli/commands/init_cmd/init_cmd_llm.txt +4 -4
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +12 -1
- solace_agent_mesh/cli/commands/plugin_cmd/install_cmd.py +5 -5
- solace_agent_mesh/client/webui/frontend/static/assets/main-B0PHV3hm.js +339 -0
- solace_agent_mesh/client/webui/frontend/static/index.html +1 -1
- solace_agent_mesh/config_portal/backend/common.py +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/{_index-bFMKlzKf.js → _index-BNuqpWDc.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-89db7c30.js → manifest-44d62be6.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/index.html +1 -1
- solace_agent_mesh/gateway/http_sse/alembic/versions/20250916_f6e7d8c9b0a1_convert_timestamps_to_epoch_and_align_columns.py +112 -42
- solace_agent_mesh/gateway/http_sse/app.py +0 -28
- solace_agent_mesh/gateway/http_sse/component.py +21 -15
- solace_agent_mesh/gateway/http_sse/dependencies.py +84 -88
- solace_agent_mesh/gateway/http_sse/main.py +37 -15
- solace_agent_mesh/gateway/http_sse/repository/entities/message.py +3 -1
- solace_agent_mesh/gateway/http_sse/repository/entities/session.py +3 -1
- solace_agent_mesh/gateway/http_sse/repository/interfaces.py +5 -0
- solace_agent_mesh/gateway/http_sse/repository/message_repository.py +25 -23
- solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +12 -4
- solace_agent_mesh/gateway/http_sse/repository/models/message_model.py +19 -1
- solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +19 -1
- solace_agent_mesh/gateway/http_sse/repository/session_repository.py +46 -42
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +199 -59
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/__init__.py +1 -6
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +3 -17
- solace_agent_mesh/gateway/http_sse/routers/people.py +4 -37
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +33 -68
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +54 -28
- solace_agent_mesh/gateway/http_sse/services/session_service.py +60 -28
- solace_agent_mesh/gateway/http_sse/shared/__init__.py +122 -1
- solace_agent_mesh/gateway/http_sse/shared/base_repository.py +278 -0
- solace_agent_mesh/gateway/http_sse/shared/database_exceptions.py +274 -0
- solace_agent_mesh/gateway/http_sse/shared/database_helpers.py +43 -0
- solace_agent_mesh/gateway/http_sse/shared/error_dto.py +107 -0
- solace_agent_mesh/gateway/http_sse/shared/exception_handlers.py +192 -0
- solace_agent_mesh/gateway/http_sse/shared/exceptions.py +192 -0
- solace_agent_mesh/gateway/http_sse/shared/pagination.py +138 -0
- solace_agent_mesh/gateway/http_sse/shared/response_utils.py +134 -0
- solace_agent_mesh/gateway/http_sse/shared/utils.py +22 -0
- solace_agent_mesh/templates/plugin_agent_config_template.yaml +1 -1
- solace_agent_mesh/templates/plugin_custom_config_template.yaml +1 -1
- solace_agent_mesh/templates/plugin_gateway_config_template.yaml +1 -1
- solace_agent_mesh/templates/shared_config.yaml +1 -1
- {solace_agent_mesh-1.4.6.dist-info → solace_agent_mesh-1.4.8.dist-info}/METADATA +34 -35
- {solace_agent_mesh-1.4.6.dist-info → solace_agent_mesh-1.4.8.dist-info}/RECORD +123 -110
- solace_agent_mesh/assets/docs/assets/js/166ab619.e8f3a7c7.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/483cef9a.8d318c2f.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/85387663.6bf41934.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/945fb41e.abf2be91.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/a3a92b25.1d029b81.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/ae0e903d.c786e887.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/bac0be12.27ee2c26.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/beecea0d.8bbd852c.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/cee5d587.f1e1ca86.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/f284c35a.2b2f5048.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/f897a61a.bc634a3e.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/main.72d74e33.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.3dcfaf51.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1758893005563.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1758893005563.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-BKIoiLSu.js +0 -339
- /solace_agent_mesh/assets/docs/assets/js/{main.72d74e33.js.LICENSE.txt → main.86924c42.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.4.6.dist-info → solace_agent_mesh-1.4.8.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.4.6.dist-info → solace_agent_mesh-1.4.8.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.4.6.dist-info → solace_agent_mesh-1.4.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/assets/favicon-BLgzUch9.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Solace Agent Mesh</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-B0PHV3hm.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vendor-CS5YMf8a.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/client-B9p_nFNA.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/main-ChRwcV89.css">
|
|
@@ -34,7 +34,7 @@ AGENT_DEFAULTS = {
|
|
|
34
34
|
"enable_embed_resolution": True,
|
|
35
35
|
"enable_artifact_content_instruction": True,
|
|
36
36
|
"tools": "[]",
|
|
37
|
-
"session_service_type":
|
|
37
|
+
"session_service_type": USE_DEFAULT_SHARED_SESSION,
|
|
38
38
|
"session_service_behavior": "PERSISTENT",
|
|
39
39
|
"artifact_service_type": USE_DEFAULT_SHARED_ARTIFACT,
|
|
40
40
|
"artifact_service_base_path": "/tmp/samv2",
|
|
@@ -32,7 +32,7 @@ import{j as r,r as k,t as yr,v as di}from"./index-DzNKzXrc.js";function en({step
|
|
|
32
32
|
${l}
|
|
33
33
|
`,autoComplete:"off"}),C&&m&&r.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:r.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-solace-green"})}),h&&w.length>0&&r.jsx("div",{ref:A,className:"absolute z-10 w-full mt-1 border bg-white border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto",children:r.jsx("ul",{children:w.map((I,v)=>r.jsx("li",{onClick:()=>y(I),onKeyDown:N=>N.key==="Enter"&&y(I),className:"px-3 py-2 cursor-pointer hover:bg-stone-300",tabIndex:0,children:I},v))})})]})}const xn={openai:"https://api.openai.com/v1",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com/v1beta/openai",aws:"https://bedrock-runtime.us-east-1.amazonaws.com",cohere:"https://api.cohere.ai/compatibility/v1"},vi=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google Gemini"},{value:"azure",label:"Azure"},{value:"openai_compatible",label:"OpenAI Compatible Provider"}],kr={openai:"openai",anthropic:"anthropic",google:"openai",openai_compatible:"openai",azure:"azure"},wi={openai:["o3-mini","o3-mini-high","o3-mini-low","o1","o1-preview","o1-mini","gpt-4.5-preview","gpt-4o","gpt-4o-mini"],anthropic:["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","claude-3-opus-20240229","claude-3-haiku-20240307"],google:["gemini-2.0-flash-001","gemini-2.0-pro-exp-02-05","gemini-2.0-flash-lite-001","gemini-2.0-flash-thinking-exp-01-21","gemini-1.5-flash-002","gemini-1.5-pro-002"],bedrock:["amazon.nova-pro-v1:0","amazon.nova-pro-latency-optimized-v1:0","amazon.nova-lite-v1:0","amazon.nova-micro-v1:0","anthropic.claude-3-7-sonnet-20250219-v1:0","anthropic.claude-3-5-sonnet-20241022-v2:0","anthropic.claude-3-5-haiku-20241022-v1:0","anthropic.claude-3-5-sonnet-20240620-v1:0","anthropic.claude-3-opus-20240229-v1:0","anthropic.claude-3-sonnet-20240229-v1:0","anthropic.claude-3-haiku-20240307-v1:0"],custom:[]};async function ki(e,t){try{const n=e.endsWith("/")?e:`${e}/`,i=await fetch(`${n}v1/models`,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!i.ok)throw new Error(`Failed to fetch models: ${i.status}`);const s=await i.json();return s.data&&Array.isArray(s.data)?s.data.filter(a=>a.id).map(a=>a.id):s.models&&Array.isArray(s.models)?s.models.filter(a=>a.id??a.name).map(a=>a.id??a.name):Array.isArray(s)?s.filter(a=>a.id??a.name).map(a=>a.id??a.name):[]}catch(n){return console.error("Error fetching models:",n),[]}}const jr=(e,t)=>e.includes("/")?e:`${kr[t]||t}/${e}`;function Sr({data:e,updateData:t,onNext:n,onPrevious:i}){const{llm_provider:s,llm_endpoint_url:a,llm_api_key:o,llm_model_name:l}=e,[u,c]=k.useState({}),[d,m]=k.useState(!1),[h,p]=k.useState(null),[w,b]=k.useState(!1),[C,g]=k.useState([]),[_,A]=k.useState(!1),[R,L]=k.useState(null);k.useEffect(()=>{const S={};s||(S.llm_provider="openai"),Object.keys(S).length>0&&t(S)},[e,t]),k.useEffect(()=>{if(s){const S={};if(R!==null&&R!==s){if(S.llm_model_name="",s!=="openai_compatible"){const F=xn[s]||"";S.llm_endpoint_url=F}else S.llm_endpoint_url="";Object.keys(S).length>0&&t(S)}L(s)}},[s,R,t]),k.useEffect(()=>{g(s&&s!=="openai_compatible"?wi[s]||[]:[])},[s]);const y=S=>{t({[S.target.name]:S.target.value})},I=k.useCallback(async()=>{if(s==="openai_compatible"&&a&&o){A(!0);try{const S=await ki(a,o);g(S)}catch(S){console.error("Error fetching models:",S)}finally{A(!1)}}return[]},[s,a,o]),v=()=>{const S={};let F=!0;return s||(S.llm_provider="LLM provider is required",F=!1),s==="openai_compatible"&&!a&&(S.llm_endpoint_url="LLM endpoint is required for OpenAI compatible endpoint}",F=!1),l||(S.llm_model_name="LLM model name is required",F=!1),o||(S.llm_api_key="LLM API key is required",F=!1),c(S),F},N=async()=>{m(!0),p(null);try{const S=s!=="openai_compatible"&&xn[s]||a,F=jr(l||"",s||""),O=await(await fetch("/api/test_llm_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:F,api_key:o,base_url:S})})).json();O.status==="success"?(m(!1),n()):(p(O.message??"Failed to test LLM configuration"),b(!0),m(!1))}catch(S){p(S instanceof Error?`Error: ${S.message}`:"An unexpected error occurred while testing the LLM configuration"),b(!0),m(!1)}},z=S=>{S.preventDefault(),v()&&N()};return r.jsxs("form",{onSubmit:z,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{className:"mb-4",children:'Configure your AI service provider for language models. To use a LLM provider not in the dropdown choose "OpenAI Compatible Provider" and enter your base URL, API key and model name.'}),r.jsxs("div",{className:"border-b border-gray-200 pb-4 mb-4",children:[r.jsx("h3",{className:"text-lg font-medium mb-4 text-gray-700 font-semibold",children:"Language Model Configuration"}),r.jsx(P,{label:"LLM Provider",htmlFor:"llm_provider",error:u.llm_provider,required:!0,children:r.jsx(se,{id:"llm_provider",name:"llm_provider",value:s||"",onChange:y,options:vi})}),(s==="openai_compatible"||s==="azure")&&r.jsx(P,{label:"LLM Endpoint URL",htmlFor:"llm_endpoint_url",error:u.llm_endpoint_url,required:!0,children:r.jsx(G,{id:"llm_endpoint_url",name:"llm_endpoint_url",value:a||"",onChange:y,placeholder:"https://api.example.com/v1"})}),r.jsx(P,{label:"LLM API Key",htmlFor:"llm_api_key",error:u.llm_api_key,required:!0,children:r.jsx(G,{id:"llm_api_key",name:"llm_api_key",type:"password",value:o||"",onChange:y,placeholder:"Enter your API key"})}),s==="azure"&&r.jsxs(vr,{className:"mb-4",children:[r.jsx("strong",{children:"Important:"}),' For Azure, in the "LLM Model Name" field, enter your ',r.jsx("strong",{children:"deployment name"})," (not the underlying model name). Your Azure deployment name is the name you assigned when you deployed the model in Azure OpenAI Service. For more details, refer to the"," ",r.jsx("a",{href:"https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal#deploy-a-model",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Azure documentation"}),"."]}),r.jsx(P,{label:"LLM Model Name",htmlFor:"llm_model_name",error:u.llm_model_name,helpText:"Select or type a model name",required:!0,children:r.jsx(wr,{id:"llm_model_name",name:"llm_model_name",value:l||"",onChange:y,placeholder:"Select or type a model name",suggestions:C,onFocus:s==="openai_compatible"?I:void 0,showLoadingIndicator:_})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:i,disabled:e.setupPath==="quick",variant:"outline",children:"Previous"}),r.jsx(Y,{type:"submit",children:"Next"})]}),d&&r.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full text-center",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Testing LLM Configuration"}),r.jsx("div",{className:"flex justify-center mb-4",children:r.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-solace-green"})}),r.jsx("p",{children:"Please wait while we test your LLM configuration..."})]})}),w&&r.jsx(_i,{title:"Connection Test Failed",message:`We couldn't connect to your AI provider: ${h}
|
|
34
34
|
Please check your API key, model name, and endpoint URL (if applicable).
|
|
35
|
-
Do you want to skip this check and continue anyway?`,onConfirm:()=>{b(!1),n()},onCancel:()=>{b(!1)}})]})}const Ae=({id:e,label:t,values:n,onChange:i,placeholder:s,helpText:a,error:o,required:l,inputButtonText:u="Add",inputPlaceholder:c="Type and press Add..."})=>{const[d,m]=k.useState(""),h=C=>{m(C.target.value)},p=()=>{if(d.trim()!==""){if(n.includes(d.trim())){m("");return}i([...n,d.trim()]),m("")}},w=C=>{i(n.filter(g=>g!==C))},b=C=>{C.key==="Enter"&&(C.preventDefault(),p())};return r.jsxs(P,{label:t,htmlFor:e,helpText:a,error:o,required:l,children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[r.jsx(G,{id:e,name:e,value:d,onChange:h,onKeyDown:b,placeholder:c,className:"flex-grow"}),r.jsx(Y,{onClick:p,variant:"secondary",type:"button",children:u})]}),n.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 mt-2 p-2 border border-gray-200 rounded-md min-h-[40px]",children:n.map((C,g)=>r.jsxs("div",{className:"flex items-center bg-gray-100 text-gray-700 text-sm font-medium px-3 py-1 rounded-full",children:[r.jsx("span",{children:C}),r.jsx("button",{type:"button",onClick:()=>w(C),className:"ml-2 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":`Remove ${C}`,children:"×"})]},g))}),n.length===0&&s&&r.jsx("div",{className:"mt-2 p-2 border border-dashed border-gray-300 rounded-md min-h-[40px] flex items-center justify-center",children:r.jsx("p",{className:"text-sm text-gray-400",children:s})})]})};function be({id:e,checked:t,onChange:n,label:i,disabled:s=!1,className:a=""}){const o=l=>{n(l.target.checked)};return r.jsxs("div",{className:`flex items-center ${a}`,children:[r.jsx("input",{id:e,type:"checkbox",checked:t,onChange:o,disabled:s,className:"h-4 w-4 text-solace-green focus:ring-solace-green border-gray-300 rounded"}),i&&r.jsx("label",{htmlFor:e,className:"ml-2 block text-sm text-gray-700",children:i})]})}const ji=[{value:"memory",label:"Memory: Store session data in memory"},{value:"vertex_rag",label:"Vertex RAG: Use Google Vertex AI for RAG capabilities"}],Si=[{value:"PERSISTENT",label:"Persistent: Keep session history indefinitely"},{value:"RUN_BASED",label:"Run-based: Clear session history after each run"}],Ni=[{value:"memory",label:"Memory: Store artifacts in memory (temporary)"},{value:"filesystem",label:"Filesystem: Store artifacts on disk"},{value:"gcs",label:"GCS: Store artifacts in Google Cloud Storage"}],Ci=[{value:"namespace",label:"Namespace: Share artifacts within the namespace"},{value:"app",label:"App: Isolate artifacts by app name"},{value:"custom",label:"Custom: Use a custom scope identifier"}],Ai=[{value:"ignore",label:"Ignore: Do not include artifacts in messages"},{value:"embed",label:"Embed: Include base64 data in messages"},{value:"reference",label:"Reference: Include fetch URI in messages"}];function Ei({data:e,updateData:t,onNext:n,onPrevious:i}){const[s,a]=k.useState({}),[o,l]=k.useState(!1),u=(M,ie)=>{if(M==null)return ie;if(Array.isArray(M))return M.map(he=>String(he).trim()).filter(he=>he.length>0);const Te=String(M).trim();return Te===""?[]:Te.split(",").map(he=>he.trim()).filter(he=>he.length>0)},c=e,[d,m]=k.useState(c.agent_name||"OrchestratorAgent"),[h,p]=k.useState(c.supports_streaming!==!1),[w,b]=k.useState(c.session_service_type||"memory"),[C,g]=k.useState(c.orchestrator_database_url||""),[_,A]=k.useState(c.session_service_behavior||"PERSISTENT"),[R,L]=k.useState(c.artifact_service_type||"filesystem"),[y,I]=k.useState(c.artifact_service_base_path||"/tmp/samv2"),[v,N]=k.useState(c.artifact_service_scope||"namespace"),[z,S]=k.useState(c.artifact_handling_mode||"reference"),[F,D]=k.useState(c.enable_embed_resolution!==!1),[O,U]=k.useState(c.enable_artifact_content_instruction!==!1),[ee,B]=k.useState(c.agent_card_description||"The Orchestrator component. It manages tasks, and coordinating multi-agent workflows."),[q,X]=k.useState(u(c.agent_card_default_input_modes,["text"])),[f,ne]=k.useState(u(c.agent_card_default_output_modes,["text","file"])),[le,x]=k.useState(c.agent_discovery_enabled!==!1),[ae,_e]=k.useState(c.agent_card_publishing_interval||10),[re,Ie]=k.useState(u(c.inter_agent_communication_allow_list,["*"])),[ve,Ne]=k.useState(u(c.inter_agent_communication_deny_list,[])),[we,Fe]=k.useState(c.inter_agent_communication_timeout||180);k.useEffect(()=>{o||(c.agent_name&&m(c.agent_name),c.supports_streaming!==void 0&&p(c.supports_streaming),c.session_service_type&&b(c.session_service_type),c.session_service_behavior&&A(c.session_service_behavior),c.artifact_service_type&&L(c.artifact_service_type),c.artifact_service_base_path&&I(c.artifact_service_base_path),c.artifact_service_scope&&N(c.artifact_service_scope),c.artifact_handling_mode&&S(c.artifact_handling_mode),c.enable_embed_resolution!==void 0&&D(c.enable_embed_resolution),c.enable_artifact_content_instruction!==void 0&&U(c.enable_artifact_content_instruction),c.agent_card_description&&B(c.agent_card_description),c.agent_card_default_input_modes!==void 0&&X(u(c.agent_card_default_input_modes,["text"])),c.agent_card_default_output_modes!==void 0&&ne(u(c.agent_card_default_output_modes,["text","file"])),c.agent_discovery_enabled!==void 0&&x(c.agent_discovery_enabled),c.agent_card_publishing_interval&&_e(c.agent_card_publishing_interval),c.inter_agent_communication_allow_list!==void 0&&Ie(u(c.inter_agent_communication_allow_list,["*"])),c.inter_agent_communication_deny_list!==void 0&&Ne(u(c.inter_agent_communication_deny_list,[])),c.inter_agent_communication_timeout&&Fe(c.inter_agent_communication_timeout),l(!0))},[e,o]);const bt=M=>{m(M.target.value),t({agent_name:M.target.value})},_t=M=>{p(M),t({supports_streaming:M})},vt=M=>{b(M.target.value),t({session_service_type:M.target.value})},nt=M=>{A(M.target.value),t({session_service_behavior:M.target.value})},rt=M=>{L(M.target.value),t({artifact_service_type:M.target.value})},it=M=>{I(M.target.value),t({artifact_service_base_path:M.target.value})},wt=M=>{N(M.target.value),t({artifact_service_scope:M.target.value})},st=M=>{S(M.target.value),t({artifact_handling_mode:M.target.value})},at=M=>{D(M),t({enable_embed_resolution:M})},kt=M=>{U(M),t({enable_artifact_content_instruction:M})},jt=M=>{B(M.target.value),t({agent_card_description:M.target.value})},St=M=>{X(M),t({agent_card_default_input_modes:M})},Nt=M=>{ne(M),t({agent_card_default_output_modes:M})},Ct=M=>{x(M),t({agent_discovery_enabled:M})},j=M=>{_e(Number(M.target.value)),t({agent_card_publishing_interval:Number(M.target.value)})},T=M=>{Ie(M),t({inter_agent_communication_allow_list:M})},V=M=>{Ne(M),t({inter_agent_communication_deny_list:M})},J=M=>{Fe(Number(M.target.value)),t({inter_agent_communication_timeout:Number(M.target.value)})},Q=()=>{const M={};let ie=!0;return d?/^[a-zA-Z0-9_]+$/.test(d)||(M.agentName="Agent name can only contain letters, numbers, and underscores.",ie=!1):(M.agentName="Agent name is required",ie=!1),R==="filesystem"&&!y&&(M.artifactBasePath="Artifact base path is required for filesystem service",ie=!1),(!ae||ae<=0)&&(M.cardPublishingInterval="Publishing interval must be a positive number",ie=!1),(!we||we<=0)&&(M.communicationTimeout="Communication timeout must be a positive number",ie=!1),a(M),ie},pe=M=>{M.preventDefault(),Q()&&n()};return r.jsxs("form",{onSubmit:pe,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{className:"mb-4",children:"Configure the main orchestrator for your Solace Agent Mesh system. This will set up the agent that orchestrates communication between components."}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx("div",{className:"col-span-2",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Basic Configuration"})}),r.jsx(P,{label:"Agent Name",htmlFor:"agent_name",error:s.agentName,required:!0,helpText:"The name can only contain letters, numbers, and underscores.",children:r.jsx(G,{id:"agent_name",value:d,onChange:bt,placeholder:"OrchestratorAgent",required:!0})}),r.jsx(P,{label:"Supports Streaming",htmlFor:"supports_streaming",helpText:"Enable streaming support for the agent",children:r.jsx(be,{id:"supports_streaming",checked:h,onChange:_t,label:"Enable streaming support"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Session Service"})}),r.jsx(P,{label:"Session Service Type",htmlFor:"session_service_type",required:!0,children:r.jsx(se,{id:"session_service_type",options:ji,value:w,onChange:vt})}),r.jsx(P,{label:"Session Behavior",htmlFor:"session_behavior",required:!0,children:r.jsx(se,{id:"session_behavior",options:Si,value:_,onChange:nt})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Artifact Service"})}),r.jsx(P,{label:"Artifact Service Type",htmlFor:"artifact_service_type",required:!0,children:r.jsx(se,{id:"artifact_service_type",options:Ni,value:R,onChange:rt})}),R==="filesystem"&&r.jsx(P,{label:"Artifact Base Path",htmlFor:"artifact_base_path",error:s.artifactBasePath,required:!0,children:r.jsx(G,{id:"artifact_base_path",value:y,onChange:it,placeholder:"/tmp/samv2"})}),r.jsx(P,{label:"Artifact Scope",htmlFor:"artifact_scope",required:!0,children:r.jsx(se,{id:"artifact_scope",options:Ci,value:v,onChange:wt})}),r.jsx(P,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",required:!0,children:r.jsx(se,{id:"artifact_handling_mode",options:Ai,value:z,onChange:st})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Feature Flags"})}),r.jsx(P,{label:"Enable Embed Resolution",htmlFor:"enable_embed_resolution",children:r.jsx(be,{id:"enable_embed_resolution",checked:F,onChange:at,label:"Enable embed resolution"})}),r.jsx(P,{label:"Enable Artifact Content Instruction",htmlFor:"enable_artifact_content_instruction",children:r.jsx(be,{id:"enable_artifact_content_instruction",checked:O,onChange:kt,label:"Enable artifact content instruction"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Card"})}),r.jsx("div",{className:"col-span-2",children:r.jsx(P,{label:"Agent Card Description",htmlFor:"agent_card_description",required:!0,children:r.jsx(G,{id:"agent_card_description",value:ee,onChange:jt,placeholder:"A helpful assistant accessed via a custom endpoint, capable of delegating tasks."})})}),r.jsx(Ae,{id:"default_input_modes",label:"Default Input Modes",values:q,onChange:St,helpText:"Enter input modes (e.g., text). Press Enter or comma to add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),r.jsx(Ae,{id:"default_output_modes",label:"Default Output Modes",values:f,onChange:Nt,helpText:"Enter output modes (e.g., text, file). Press Enter or comma to add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., text, file"}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Discovery"})}),r.jsx(P,{label:"Enable Agent Discovery",htmlFor:"agent_discovery_enabled",children:r.jsx(be,{id:"agent_discovery_enabled",checked:le,onChange:Ct,label:"Enable agent discovery"})}),r.jsx(P,{label:"Card Publishing Interval",htmlFor:"card_publishing_interval",error:s.cardPublishingInterval,helpText:"Interval in seconds for publishing agent card",required:!0,children:r.jsx(G,{id:"card_publishing_interval",type:"number",value:ae.toString(),onChange:j,placeholder:"10"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Inter-Agent Communication"})}),r.jsx(Ae,{id:"allow_list",label:"Allow List",values:re,onChange:T,helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*). Press Enter or comma to add.",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),r.jsx(Ae,{id:"deny_list",label:"Deny List",values:ve,onChange:V,helpText:"Agent name patterns to deny delegation to. Press Enter or comma to add.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),r.jsx(P,{label:"Communication Timeout",htmlFor:"communication_timeout",error:s.communicationTimeout,helpText:"Timeout in seconds for inter-agent communication",required:!0,children:r.jsx(G,{id:"communication_timeout",type:"number",value:we.toString(),onChange:J,placeholder:"30"})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:i,variant:"outline",children:"Previous"}),r.jsx(Y,{type:"submit",children:"Next"})]})]})}function Ii({data:e,updateData:t,onNext:n,onPrevious:i}){const[s,a]=k.useState({}),o=e;k.useEffect(()=>{const m={add_webui_gateway:o.add_webui_gateway??!1,webui_session_secret_key:o.webui_session_secret_key??"",webui_fastapi_host:o.webui_fastapi_host??"127.0.0.1",webui_fastapi_port:o.webui_fastapi_port??8e3,webui_enable_embed_resolution:o.webui_enable_embed_resolution??!0,webui_frontend_welcome_message:o.webui_frontend_welcome_message??"",webui_frontend_bot_name:o.webui_frontend_bot_name??"Solace Agent Mesh",webui_frontend_collect_feedback:o.webui_frontend_collect_feedback??!1},h={};for(const p in m)o[p]===void 0&&m[p]!==void 0&&(h[p]=m[p]);Object.keys(h).length>0&&t(h)},[]);const l=m=>{const{name:h,value:p,type:w}=m.target;t(w==="number"?{[h]:p===""?"":Number(p)}:{[h]:p})},u=(m,h)=>{t({[m]:h})},c=()=>{const m={};let h=!0;return o.add_webui_gateway&&(o.webui_session_secret_key||(m.webui_session_secret_key="Session Secret Key is required.",h=!1),o.webui_fastapi_host||(m.webui_fastapi_host="FastAPI Host is required.",h=!1),o.webui_fastapi_port===void 0?(m.webui_fastapi_port="FastAPI Port is required.",h=!1):(isNaN(Number(o.webui_fastapi_port))||Number(o.webui_fastapi_port)<=0)&&(m.webui_fastapi_port="FastAPI Port must be a positive number.",h=!1)),a(m),h},d=m=>{m.preventDefault(),c()&&n()};return r.jsxs("form",{onSubmit:d,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{className:"mb-4",children:"Optionally, configure a Web UI Gateway to interact with your Solace Agent Mesh. This provides a Web UI chat interface."}),r.jsx(P,{label:"",htmlFor:"add_webui_gateway",children:r.jsx(be,{id:"add_webui_gateway",checked:o.add_webui_gateway||!1,onChange:m=>u("add_webui_gateway",m),label:"Add Web UI Gateway"})}),o.add_webui_gateway&&r.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md mt-4",children:[r.jsx("h3",{className:"text-md font-medium text-gray-800 mb-3",children:"Web UI Gateway Configuration"}),r.jsx(P,{label:"Session Secret Key",htmlFor:"webui_session_secret_key",error:s.webui_session_secret_key,required:!0,children:r.jsx(G,{id:"webui_session_secret_key",name:"webui_session_secret_key",type:"password",value:o.webui_session_secret_key||"",onChange:l,placeholder:"Enter a strong secret key"})}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx(P,{label:"FastAPI Host",htmlFor:"webui_fastapi_host",error:s.webui_fastapi_host,required:!0,children:r.jsx(G,{id:"webui_fastapi_host",name:"webui_fastapi_host",value:o.webui_fastapi_host||"127.0.0.1",onChange:l,placeholder:"127.0.0.1"})}),r.jsx(P,{label:"FastAPI Port",htmlFor:"webui_fastapi_port",error:s.webui_fastapi_port,required:!0,children:r.jsx(G,{id:"webui_fastapi_port",name:"webui_fastapi_port",type:"number",value:o.webui_fastapi_port===void 0?"":String(o.webui_fastapi_port),onChange:l,placeholder:"8000"})})]}),r.jsx(P,{label:"",htmlFor:"webui_enable_embed_resolution",children:r.jsx(be,{id:"webui_enable_embed_resolution",checked:o.webui_enable_embed_resolution||!1,onChange:m=>u("webui_enable_embed_resolution",m),label:"Enable Embed Resolution in Web UI"})}),r.jsx("h4",{className:"text-sm font-medium text-gray-700 mt-3 mb-2",children:"Frontend Customization"}),r.jsx(P,{label:"Frontend Welcome Message",htmlFor:"webui_frontend_welcome_message",error:s.webui_frontend_welcome_message,children:r.jsx(G,{id:"webui_frontend_welcome_message",name:"webui_frontend_welcome_message",value:o.webui_frontend_welcome_message||"",onChange:l,placeholder:"Welcome to the Solace Agent Mesh!"})}),r.jsx(P,{label:"Frontend Bot Name",htmlFor:"webui_frontend_bot_name",error:s.webui_frontend_bot_name,children:r.jsx(G,{id:"webui_frontend_bot_name",name:"webui_frontend_bot_name",value:o.webui_frontend_bot_name||"Solace Agent Mesh",onChange:l,placeholder:"Solace Agent Mesh"})}),r.jsx(P,{label:"",htmlFor:"webui_frontend_collect_feedback",children:r.jsx(be,{id:"webui_frontend_collect_feedback",checked:o.webui_frontend_collect_feedback||!1,onChange:m=>u("webui_frontend_collect_feedback",m),label:"Enable Feedback Collection in Frontend"})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:i,variant:"outline",type:"button",children:"Previous"}),r.jsx(Y,{type:"submit",children:"Next"})]})]})}const Ti=["llm","ai","api","url","vpn"],Pi=["broker_password","llm_api_key","webui_session_secret_key"],yn={Project:["namespace"],Broker:["dev_mode","broker_type","broker_url","broker_vpn","broker_username","broker_password"],"AI Provider":["llm_model_name","llm_endpoint_url","llm_api_key"],Orchestrator:["agent_name","supports_streaming","session_service_type","session_service_behavior","artifact_service_type","artifact_service_base_path","artifact_service_scope","artifact_handling_mode","enable_embed_resolution","enable_artifact_content_instruction","agent_card_description","agent_card_default_input_modes","agent_card_default_output_modes","agent_discovery_enabled","agent_card_publishing_interval","inter_agent_communication_allow_list","inter_agent_communication_deny_list","inter_agent_communication_timeout"],"Web UI":["add_webui_gateway","webui_frontend_welcome_message","webui_frontend_bot_name","webui_frontend_collect_feedback","webui_session_secret_key","webui_fastapi_host","webui_fastapi_port","webui_enable_embed_resolution"]};function Nr({data:e,updateData:t,onPrevious:n}){const[i,s]=k.useState(!1),[a,o]=k.useState(null),l=g=>g===void 0||g===""||Array.isArray(g)&&g.length===0,u=g=>g.split("_").map(_=>Ti.includes(_.toLowerCase())?_.toUpperCase():_.charAt(0).toUpperCase()+_.slice(1)).join(" "),c=(g,_)=>Pi.includes(g)||g.toUpperCase().includes("API_KEY")?_?"••••••••":"Not provided":typeof _=="boolean"?_?"Yes":"No":Array.isArray(_)?_.join(", "):_?String(_):"Not provided",d=g=>{switch(g){case"solace":return"Existing Solace Pub/Sub+ broker";case"container":return"New local Solace PubSub+ broker container (podman/docker)";case"dev_mode":return"Run in 'dev mode' - all in one process (not recommended for production)";default:return g}},m=()=>{const g=e.broker_type;return e.dev_mode?r.jsx("div",{children:r.jsxs("div",{className:"mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Type:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d("dev_mode")})]})}):r.jsxs("div",{children:[r.jsxs("div",{className:"mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Type:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d(g)})]}),g==="container"&&r.jsx("div",{className:"pl-4 border-l-2 border-gray-300 mb-2",children:r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Container Engine:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.container_engine)??"Docker"})]})}),(g==="solace"||g==="container")&&r.jsxs("div",{className:"pl-4 border-l-2 border-gray-300",children:[r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Broker URL:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_url)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Broker VPN:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_vpn)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Username:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_username)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Password:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c("broker_password",e.broker_password)})]})]})]})},h=(g,_)=>_.some(R=>!l(e[R]))?r.jsxs("div",{className:"pb-4 mb-4 border-b border-gray-300 last:border-0 last:mb-0 last:pb-0",children:[r.jsx("h4",{className:"font-semibold text-solace-blue mb-3",children:g}),r.jsx("div",{className:"space-y-3",children:_.map(R=>l(e[R])?null:R==="dev_mode"?r.jsx("div",{children:m()},R):r.jsxs("div",{className:"flex mb-1",children:[r.jsxs("span",{className:"text-gray-600",children:[u(R),":"]}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c(R,e[R])})]},R))})]},g):null,p=g=>{const _={...g};return _.namespace&&!String(_.namespace).endsWith("/")&&(_.namespace+="/"),_.container_started&&delete _.container_started,_.llm_provider&&(_.llm_provider=kr[_.llm_provider]),_.llm_model_name&&_.llm_provider&&(_.llm_model_name=jr(String(_.llm_model_name),String(_.llm_provider)),delete _.llm_provider),e.broker_type==="container"&&(e.broker_type="solace"),_},w=async(g=!0)=>{const _=p(e);console.log("Submitting configuration:",_);try{const A=await fetch("api/save_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g?{..._,force:!0}:_)}),R=await A.json();if(!A.ok)throw new Error(`HTTP error ${A.status}: ${R.message??"Unknown error"}`);if(R.status==="success"){console.log("Configuration sent successfully!"),t({showSuccess:!0});try{const L=await fetch("api/shutdown",{method:"POST"});L.ok?console.log("Shutdown request sent successfully"):console.warn("Shutdown request failed:",L.status)}catch(L){console.error("Error sending shutdown request:",L)}}else throw new Error(R.message??"Failed to save configuration")}catch(A){o(A instanceof Error?A.message:"An unknown error occurred"),console.error("Error saving configuration:",A)}finally{s(!1)}},b=async()=>{s(!0),o(null),await w()},C=g=>{g.preventDefault(),b()};return r.jsx("div",{className:"space-y-6",children:r.jsxs("form",{onSubmit:C,children:[r.jsx("div",{className:"bg-gray-100 border border-gray-300 rounded-md p-5 space-y-4",children:e.setupPath==="quick"?h("AI Provider",yn["AI Provider"]):Object.entries(yn).map(([g,_])=>h(g,_))}),a&&r.jsxs("div",{className:"p-4 bg-red-50 text-red-700 rounded-md border border-red-200",children:[r.jsx("p",{className:"font-medium",children:"Error initializing project"}),r.jsx("p",{children:a})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:n,variant:"outline",type:"button",children:"Previous"}),r.jsx(Y,{type:"submit",disabled:i,children:i?r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("span",{children:"Initializing..."})]}):"Initialize Project"})]})]})})}const Mi=({icon:e,title:t,description:n,time:i,link:s})=>r.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"block bg-white rounded-lg shadow-sm border border-gray-100 hover:shadow-md transition-all duration-200 hover:border-solace-blue/30 group h-full",children:r.jsxs("div",{className:"p-5 flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("span",{className:"text-2xl mr-3",children:e}),r.jsx("h4",{className:"text-lg font-medium text-gray-800 group-hover:text-solace-blue transition-colors",children:t})]}),r.jsx("div",{className:"bg-gray-100 text-gray-600 px-3 py-1 rounded-full text-xs font-medium",children:i})]}),r.jsx("p",{className:"text-gray-600 text-sm flex-grow mb-4",children:n}),r.jsx("div",{className:"mt-auto flex justify-end",children:r.jsxs("span",{className:"text-solace-blue text-sm font-medium flex items-center group-hover:translate-x-1 transition-transform",children:["View Tutorial",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]})}),Fi=({icon:e,title:t,description:n,link:i})=>r.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"flex p-4 bg-gray-50 hover:bg-gray-100 rounded-lg border border-gray-200 transition-colors group",children:[r.jsx("div",{className:"mr-4 bg-solace-blue bg-opacity-10 p-3 rounded-lg text-solace-blue group-hover:bg-opacity-20",children:e}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-gray-800",children:t}),r.jsx("p",{className:"text-sm text-gray-600",children:n})]})]});function Li({text:e}){const[t,n]=k.useState(!1),i=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy text:",a)}},s=()=>t?r.jsx("svg",{className:"w-5 h-5 text-green-500 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):r.jsx("svg",{className:"w-5 h-5 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})});return r.jsx("button",{onClick:i,className:"text-white transition-colors opacity-100","aria-label":t?"Copied":"Copy to clipboard",children:s()})}function tn({title:e,message:t,initTab:n}){const[i,s]=k.useState(n??"getting-started"),a=3,o=i==="getting-started"?0:i==="tutorials"?1:2,l="Operation Successful!",u="Your configuration has been saved. You're now ready to proceed.",c=g=>g===0?"tutorials":g===1?"documentation":"getting-started",d=g=>g===1?"getting-started":g===2?"tutorials":"documentation",m=()=>{if(o<a-1){const g=c(o);s(g)}},h=()=>{if(o>0){const g=d(o);s(g)}},p=g=>{const _="px-4 py-3 text-sm font-medium ";return i===g?_+"text-solace-blue border-b-2 border-solace-blue":_+"text-gray-500 hover:text-solace-blue"},w=[{icon:"🌤️",title:"Weather Agent",description:"Build an agent that gives Solace Agent Mesh the ability to access real-time weather information.",time:"~5 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/custom-agent"},{icon:"🗃️",title:"SQL Database Integration",description:"Enable Solace Agent Mesh to answer company-specific questions using a sample coffee company database.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/sql-database"},{icon:"🧠",title:"MCP Integration",description:"Integrating a Model Context Protocol (MCP) Server into Solace Agent Mesh.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/mcp-integration"},{icon:"💬",title:"Slack Integration",description:"Chat with Solace Agent Mesh directly from Slack.",time:"~20-30 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/slack-integration"}],b=[{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:"Getting Started",description:"Introduction and basic concepts",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),title:"Architecture",description:"System architecture and design",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/component-overview"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})}),title:"Tutorials",description:"Step-by-step guides",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/event-mesh-gateway"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),title:"User Guides",description:"User Guides for various components",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/user-guide/solace-ai-connector"}],C=()=>i==="getting-started"?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"})}),"Your Configuration Files"]}),r.jsx("p",{className:"text-gray-600 mb-4",children:"Your configurations have been saved in the following files:"}),r.jsxs("div",{className:"flex space-x-4 mb-4",children:[r.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[r.jsx("code",{className:"text-solace-blue font-mono",children:".env"}),r.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Environment variables"})]}),r.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[r.jsx("code",{className:"text-solace-blue font-mono",children:"configs/shared_config.yaml"}),r.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Config file"})]})]})]}),r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"})}),"Start the Service"]}),r.jsx("p",{className:"text-gray-600 mb-4",children:"To start Solace Agent Mesh directly, run:"}),r.jsxs("div",{className:"bg-gray-800 text-gray-200 p-4 rounded-md font-mono text-sm mb-4 flex items-center justify-between group relative",children:[r.jsx("code",{children:"sam run"}),r.jsx(Li,{text:"sam run"})]}),r.jsxs("p",{className:"text-gray-600",children:["You can use"," ",r.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"sam"})," as a shorthand for"," ",r.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"solace-agent-mesh"})," ","in all commands."]})]})]}):i==="tutorials"?r.jsxs("div",{children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-800 mb-2",children:"Hands-on Tutorials"}),r.jsx("p",{className:"text-gray-600",children:"Ready to go further? Here are some practical tutorials to help you leverage the full potential of Solace Agent Mesh."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:w.map(g=>r.jsx(Mi,{icon:g.icon,title:g.title,description:g.description,time:g.time,link:g.link},g.title))})]}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"Documentation Resources"]}),r.jsx("p",{className:"text-gray-600 mb-6",children:"Explore our comprehensive documentation to get the most out of Solace Agent Mesh:"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:b.map(g=>r.jsx(Fi,{icon:g.icon,title:g.title,description:g.description,link:g.link},g.title))}),r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("a",{href:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-5 py-2 rounded-md bg-solace-blue text-white hover:bg-solace-blue-dark transition-colors",children:["View Documentation",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})})]}),r.jsxs("div",{className:"p-6 bg-gradient-to-b from-solace-blue-light to-blue-50 rounded-lg text-center",children:[r.jsx("h3",{className:"text-lg font-medium text-solace-blue mb-2",children:"Connect with the Community"}),r.jsx("p",{className:"text-gray-600 mb-4",children:"Solace Agent Mesh is open source! We welcome contributions and discussions from the community."}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row justify-center items-stretch gap-4",children:[r.jsxs("a",{href:"https://github.com/SolaceLabs/solace-agent-mesh",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",className:"mb-2 text-solace-blue group-hover:text-white transition-colors",children:r.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",fill:"currentColor"})}),r.jsx("span",{className:"font-medium",children:"GitHub Repository"})]}),r.jsxs("a",{href:"https://solace.community/c/solace-agent-mesh/16",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[r.jsx("img",{src:"data:image/png;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAACnCAMAAAC1m4byAAAAM1BMVEUAAAAAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJWmhxYbAAAAEHRSTlMAECAwQFBgcICPn6+/z9/vIxqCigAAFnJJREFUeNrs1w1ymzAQQGH9IYQQ0t7/tJ2606ndJHhxiZt433eAZVj0hpEDAAAAAAAAAAAAAAAA8NWFpOEAfGdFNByA74zQAQMIHTCA0AEDpo3QAQNCboQOGBBWQgcMyIQOGDATOmBAJ3Tg9S2EDry+idCB15cIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB04U/rNu/P4lHK5SCl+hdDTlU/cZLnIZy3Tp5+CA/5ByEsbcmWr5U0FWUSkOL041ya3eiuT/0+hp7y0Tf7SWy1n9hPnyyZvtJqDe1gq11scbcnRAceFeZN3tRLdH74fCn2qQz6wzeHZocfSZEdf5xPq8Xkd8oG+xIc+TXt3WE0OOCStsqPX7N0vVfShxzpk15b980KPS5db+hT18ir7+uwPTmw7w4p3gFZoctdWc0q5iTr01OS+UcJTQve5i1Yvw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c//J3ri0Mu0Qi4gl03mnZUNmuv2M9hjSu/b+NfrM4qs38451/Wn4ZXS8TJ+3BQJbqv8cktwEcxVbdy4ItGXFWz9vrsQeyYAkvb2q3xy+wvcQ11fR+I6fkb8aJK9CiAWPaARZyCOhTnng8JMFR0frO2in+tSlA8LSOWCYmU3DL7NSd0uLthZibiXg95zhVdn+Jkdz0DZmvOD7yPFYhRonObtd8E/wsdP9jWB/N4+YjNDy5Ru6viFEzPfwJ8z8HlvRDr7jJZ+BVakdpmVfNU5mOiE+pcgWC1KOX+wqmiss7L/AEHuwpoRW5H7P9Vyl16PLSA6fmPoMJz2N1/UZBlWY053C+sMWqBXoTajHOOUu/WaMUffKrYIcuijfvCGCXgjmX7bG7NKjsOOH4ubTSbEtCLXM3uvjiG/Cpq27+qGH7VMFveMj1/I4eAyWQcaubh3oiByWQgG07eR1QwmYxDOJzUMcP2yY9Dz7D9hYQ5nE9Gsszh/IUEDZPJOKTFSQVT88kPZJmav5BjhclkGELPpfP3ceiZgpuMQ+oDJ+/CH2Ym4CZDWc3kTWilJEwmk8lkMplMJpPJZDKZTCaTyWQymUwmk8lkMplMJpPJZDKZTCb/8/wHtHUhcGqvStMAAAAASUVORK5CYII=",alt:"Solace Community Forum Logo",className:"max-h-8 mb-2 object-contain"}),r.jsx("span",{className:"font-medium",children:"Community Forum"})]})]})]})]});return r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs("div",{className:"p-8 bg-gradient-to-br from-green-50 to-blue-50 rounded-xl mb-8 text-center relative overflow-hidden",children:[r.jsxs("div",{className:"relative z-10",children:[r.jsx("div",{className:"inline-block bg-green-100 p-3 rounded-full mb-4",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-10 w-10 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:e||l}),r.jsx("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:t||u}),r.jsxs("div",{className:"inline-flex items-center px-4 py-2 bg-solace-blue text-white rounded-full shadow-sm",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v3.586L7.707 9.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 10.586V7z",clipRule:"evenodd"})}),"Configuration saved successfully"]})]}),r.jsx("div",{className:"absolute top-0 right-0 -mt-10 -mr-10 h-40 w-40 bg-green-200 opacity-50 rounded-full"}),r.jsx("div",{className:"absolute bottom-0 left-0 -mb-10 -ml-10 h-32 w-32 bg-green-200 opacity-50 rounded-full"})]}),r.jsxs("div",{className:"flex items-center mb-6 border-b",children:[r.jsxs("div",{className:"flex-1 flex",children:[r.jsx("button",{onClick:()=>s("getting-started"),className:p("getting-started"),children:"Getting Started"}),r.jsx("button",{onClick:()=>s("tutorials"),className:p("tutorials"),children:"Tutorials"}),r.jsx("button",{onClick:()=>s("documentation"),className:p("documentation"),children:"Documentation"})]}),r.jsxs("div",{className:"text-gray-500 text-sm mr-4 flex items-center",children:["Page ",o+1," of ",a]})]}),C(),r.jsxs("div",{className:"mt-8 flex justify-between items-center",children:[r.jsx("div",{className:"text-sm text-gray-500",children:r.jsxs("span",{className:"md:hidden",children:["Page ",o+1," of ",a]})}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsx(Y,{onClick:h,variant:"outline",type:"button",disabled:o===0,children:"Previous"}),r.jsx(Y,{onClick:m,type:"button",disabled:o===a-1,children:"Next"})]})]})]})}const At={id:"path-selection",title:"Setup Path",description:"Choose your setup path",component:hi},bn=[{id:"project-setup",title:"Project Structure",description:"Set up your project namespace",component:gi},{id:"broker-setup",title:"Broker Setup",description:"Configure your Solace PubSub+ broker connection",component:bi},{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"orchestrator-setup",title:"Orchestrator",description:"Configure your main orchestrator",component:Ei},{id:"webui-gateway-setup",title:"Web UI Gateway",description:"Configure the optional Web UI Gateway",component:Ii},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}],_n=[{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}];function Ri(){const[e,t]=k.useState(0),[n,i]=k.useState({}),[s,a]=k.useState(!1),[o,l]=k.useState(null),[u,c]=k.useState(null),[d,m]=k.useState(!1),[h,p]=k.useState([At]);k.useEffect(()=>{u&&(a(!0),fetch(`/api/default_options?path=${u}`).then(L=>{if(!L.ok)throw new Error("Failed to fetch default options");return L.json()}).then(L=>{if(L!=null&&L.default_options){const y=L.default_options;i(I=>({...I,...y})),a(!1)}else throw new Error("Invalid response format")}).catch(L=>{console.error("Error fetching default options:",L),l("Failed to connect to server, is the init process still running?"),a(!1)}))},[u]),k.useEffect(()=>{u==="quick"?p([At,..._n]):u==="advanced"&&p([At,...bn])},[u]);const w=h[e],b=L=>{L.setupPath&&typeof L.setupPath=="string"&&L.setupPath!==u&&c(L.setupPath),L.showSuccess&&m(!0),i(y=>({...y,...L}))},C=()=>{e<h.length-1&&t(e+1)},g=()=>{e>0&&t(e-1)};if(s&&e>0)return r.jsxs("div",{className:"max-w-4xl mx-auto p-6 flex flex-col items-center justify-center min-h-[400px]",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-solace-blue",children:"Solace Agent Mesh Initialization"}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 w-full text-center",children:[r.jsxs("div",{className:"animate-pulse flex flex-col items-center",children:[r.jsx("div",{className:"h-4 w-1/2 bg-gray-200 rounded mb-4"}),r.jsx("div",{className:"h-10 w-3/4 bg-gray-200 rounded"})]}),r.jsx("p",{className:"mt-4",children:"Loading configuration options..."})]})]});if(o)return r.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[r.jsxs("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4",role:"alert",children:[r.jsx("p",{className:"font-bold",children:"Error"}),r.jsx("p",{children:o})]}),r.jsx("div",{className:"mt-4 flex justify-center",children:r.jsx("button",{onClick:()=>window.location.reload(),className:"bg-solace-blue hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Retry"})})]})]});if(d)return r.jsx("div",{className:"max-w-4xl mx-auto p-6",children:r.jsx(tn,{title:"Solace Agent Mesh Initialized Successfully!",message:"Your project configuration has been saved. You are now ready to start building and running agents."})});const _=w==null?void 0:w.component;if(!_)return r.jsx("div",{className:"text-center p-10 text-red-600",children:"Error: Setup step not found."});const A=e>0,R=()=>u==="quick"?_n:u==="advanced"?bn:[];return r.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),A&&r.jsx("div",{className:"mb-8",children:r.jsx(en,{steps:R(),currentStepIndex:e>0?e-1:0,onStepClick:()=>{}})}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[r.jsx("h2",{className:"text-xl font-bold mb-2 text-solace-blue",children:w.title}),r.jsx("p",{className:"text-gray-600 mb-6",children:w.description}),r.jsx(_,{data:n,updateData:b,onNext:C,onPrevious:g})]})]})}const Oi=[{value:"planning",label:"Planning Model (*planning_model)"},{value:"general",label:"General Model (*general_model)"},{value:"image_gen",label:"Image Generation Model (*image_gen_model)"},{value:"report_gen",label:"Report Generation Model (*report_gen_model)"},{value:"multimodal",label:"Multimodal Model (*multimodal_model)"},{value:"gemini_pro",label:"Gemini Pro Model (*gemini_pro_model)"}],zi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=l=>{const{name:u,value:c,type:d}=l.target,m=d==="checkbox"?l.target.checked:c;t({[u]:m})},a=()=>{if(!e.agent_name||e.agent_name.trim()===""){alert("Agent Name is required.");return}let l=e.instruction;if(typeof l=="string"&&l.includes("__AGENT_NAME__")){const u=e.agent_name;l=l.replace(/__AGENT_NAME__/g,u),t({instruction:l})}n()},o=e.instruction||`You are a helpful assistant named ${e.agent_name||"NewAgent"}, accessed via a custom endpoint.`;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"Agent Name",htmlFor:"agent_name",required:!0,helpText:"Unique name for this agent (will be PascalCase by the system).",children:r.jsx(G,{id:"agent_name",name:"agent_name",value:e.agent_name||"",onChange:s,placeholder:"MyNewAgent",required:!0})}),r.jsx(P,{label:"A2A Namespace",htmlFor:"namespace",helpText:"A2A topic namespace (e.g., myorg/dev). Can use ${NAMESPACE} for environment variable.",children:r.jsx(G,{id:"namespace",name:"namespace",value:e.namespace||"",onChange:s,placeholder:"${NAMESPACE}"})}),r.jsx(P,{label:"Model Type",htmlFor:"model_type",required:!0,children:r.jsx(se,{id:"model_type",name:"model_type",value:e.model_type||"planning",onChange:s,options:Oi})}),r.jsx(P,{label:"Instruction",htmlFor:"instruction",helpText:"System instruction for the agent. Use __AGENT_NAME__ to refer to the agent's name.",children:r.jsx("textarea",{id:"instruction",name:"instruction",value:e.instruction!==void 0?e.instruction:o.replace("__AGENT_NAME__",e.agent_name||"NewAgent"),onChange:s,rows:4,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"You are a helpful assistant..."})}),r.jsx(P,{label:"",htmlFor:"supports_streaming",children:r.jsx(be,{id:"supports_streaming",checked:e.supports_streaming===void 0?!0:!!e.supports_streaming,onChange:l=>t({supports_streaming:l}),label:"Supports Streaming (host capability for A2A tasks/sendSubscribe)"})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",disabled:!0,children:"Previous"}),r.jsx("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},dt="use_default_shared_session",mt="use_default_shared_artifact",Di=[{value:dt,label:"Use Default (from shared_config.yaml)"},{value:"memory",label:"Memory (In-Process)"},{value:"vertex_rag",label:"Vertex RAG (Google Cloud)"}],Bi=[{value:"PERSISTENT",label:"Persistent (Retains history across runs)"},{value:"RUN_BASED",label:"Run-based (Clears history after each run)"}],qi=[{value:mt,label:"Use Default (from shared_config.yaml)"},{value:"memory",label:"Memory (In-Process, temporary)"},{value:"filesystem",label:"Filesystem (Local disk storage)"},{value:"gcs",label:"Google Cloud Storage (GCS)"}],Ui=[{value:"namespace",label:"Namespace (Shared by all agents in namespace)"},{value:"app",label:"App (Isolated to this agent instance)"}],Hi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=c=>{const{name:d,value:m}=c.target,h={[d]:m};d==="session_service_type"?m===dt?h.session_service_behavior=void 0:e.session_service_behavior||(h.session_service_behavior="PERSISTENT"):d==="artifact_service_type"&&(m===mt?(h.artifact_service_base_path=void 0,h.artifact_service_scope=void 0):(e.artifact_service_scope||(h.artifact_service_scope="namespace"),m==="filesystem"&&!e.artifact_service_base_path&&(h.artifact_service_base_path="/tmp/samv2"))),t(h)},a=c=>{t({[c.target.name]:c.target.value})},o=()=>{if(e.artifact_service_type==="filesystem"&&(!e.artifact_service_base_path||e.artifact_service_base_path.trim()==="")){alert("Artifact Service Base Path is required when type is Filesystem and not using default.");return}n()},l=e.session_service_type!==dt,u=e.artifact_service_type!==mt;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{children:"Configure how your agent stores session history and handles artifacts (files). You can use default settings from a shared project configuration or define them specifically for this agent."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Session Service"}),r.jsx(P,{label:"Session Service Configuration",htmlFor:"session_service_type",required:!0,children:r.jsx(se,{id:"session_service_type",name:"session_service_type",value:e.session_service_type||dt,onChange:s,options:Di})}),l&&r.jsx(P,{label:"Session Service Behavior",htmlFor:"session_service_behavior",required:!0,children:r.jsx(se,{id:"session_service_behavior",name:"session_service_behavior",value:e.session_service_behavior||"PERSISTENT",onChange:a,options:Bi})}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Artifact Service"}),r.jsx(P,{label:"Artifact Service Configuration",htmlFor:"artifact_service_type",required:!0,children:r.jsx(se,{id:"artifact_service_type",name:"artifact_service_type",value:e.artifact_service_type||mt,onChange:s,options:qi})}),u&&e.artifact_service_type==="filesystem"&&r.jsx(P,{label:"Artifact Service Base Path",htmlFor:"artifact_service_base_path",required:!0,helpText:"Base directory path for filesystem artifact storage.",children:r.jsx(G,{id:"artifact_service_base_path",name:"artifact_service_base_path",value:e.artifact_service_base_path||"/tmp/samv2",onChange:a,placeholder:"/tmp/samv2",required:!0})}),u&&r.jsx(P,{label:"Artifact Service Scope",htmlFor:"artifact_service_scope",required:!0,children:r.jsx(se,{id:"artifact_service_scope",name:"artifact_service_scope",value:e.artifact_service_scope||"namespace",onChange:a,options:Ui})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},Cr=({title:e,onClose:t,children:n})=>r.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50 flex justify-center items-center p-4",children:r.jsxs("div",{className:"relative bg-white w-full max-w-2xl mx-auto rounded-lg shadow-xl p-6",children:[r.jsxs("div",{className:"flex justify-between items-center border-b pb-3 mb-4",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e}),r.jsx("button",{onClick:t,className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center","aria-label":"Close modal",children:r.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),r.jsx("div",{children:n})]})}),Et={id:void 0,tool_type:"",tool_name:"",tool_description:"",group_name:"",component_module:"",function_name:"",component_base_path:"",connection_params_str:"{}",environment_variables_str:"{}",tool_config_str:"{}",connection_params:void 0,environment_variables:void 0,required_scopes:[],tool_config:void 0},Le=(e,t=void 0)=>{if(e===void 0||e.trim()===""||e.trim()==="{}")return t;try{const n=JSON.parse(e);return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:t}catch(n){return console.warn("Failed to parse JSON string:",e,n),t}},Vi=({data:e,updateData:t,onNext:n,onPrevious:i,availableTools:s})=>{const[a,o]=k.useState(!1),[l,u]=k.useState(Et),[c,d]=k.useState("initial"),[m,h]=k.useState(null),[p,w]=k.useState({}),b=Array.isArray(e.tools)?e.tools:[],C=()=>{u({...Et,id:Date.now().toString()}),h(null),w({}),d("initial"),o(!0)},g=v=>{v.tool_type==="builtin-group"?d("builtin-group"):v.tool_type==="builtin"?d("builtin-tool"):d("custom");const N={...Et,...v,id:v.id||Date.now().toString(),tool_type:v.tool_type||"",connection_params_str:v.connection_params?JSON.stringify(v.connection_params,null,2):"{}",environment_variables_str:v.environment_variables?JSON.stringify(v.environment_variables,null,2):"{}",tool_config_str:v.tool_config?JSON.stringify(v.tool_config,null,2):"{}",required_scopes:Array.isArray(v.required_scopes)?v.required_scopes:[]};u(N),h(v.id||null),w({}),o(!0)},_=v=>{const{name:N,value:z}=v.target;if(u(S=>({...S,[N]:z})),N==="connection_params_str"||N==="environment_variables_str"||N==="tool_config_str")if(z.trim()===""||z.trim()==="{}")w(S=>({...S,[N]:void 0}));else try{const S=JSON.parse(z);typeof S!="object"||S===null||Array.isArray(S)?w(F=>({...F,[N]:"Must be a valid JSON object."})):N==="connection_params_str"&&(!S.type||!S.command||!S.args)?w(F=>({...F,[N]:"Connection parameters must include type, command, and args."})):w(F=>({...F,[N]:void 0}))}catch{w(F=>({...F,[N]:"Invalid JSON format."}))}},A=(v,N)=>{u(z=>({...z,[v]:N}))},R=()=>{const v={};if(l.tool_type||(v.tool_type="Tool type is required."),l.tool_type==="builtin-group"?l.group_name||(v.group_name="Group name is required."):l.tool_type==="builtin"?l.tool_name||(v.tool_name="Tool name is required."):l.tool_type==="python"?(l.component_module||(v.component_module="Component module is required."),l.function_name||(v.function_name="Function name is required.")):l.tool_type==="mcp"&&(!l.connection_params_str||l.connection_params_str.trim()==="{}")&&(v.connection_params_str="Connection parameters are required for MCP tools."),l.connection_params_str)try{Le(l.connection_params_str,void 0)}catch{v.connection_params_str="Invalid JSON format for Connection Parameters."}if(l.environment_variables_str)try{Le(l.environment_variables_str,void 0)}catch{v.environment_variables_str="Invalid JSON format for Environment Variables."}if(l.tool_config_str)try{Le(l.tool_config_str,void 0)}catch{v.tool_config_str="Invalid JSON format for Tool Config."}return w(v),Object.keys(v).length===0},L=()=>{if(!R())return;const v={id:l.id||Date.now().toString(),tool_type:l.tool_type};let N;switch(l.tool_type){case"builtin-group":N={...v,group_name:l.group_name};break;case"builtin":N={...v,tool_name:l.tool_name};break;case"python":N={...v,tool_name:l.tool_name||void 0,tool_description:l.tool_description||void 0,component_module:l.component_module||void 0,function_name:l.function_name||void 0,component_base_path:l.component_base_path||void 0,tool_config:Le(l.tool_config_str,void 0),required_scopes:l.required_scopes||[]};break;case"mcp":N={...v,tool_name:l.tool_name||void 0,connection_params:Le(l.connection_params_str,void 0),environment_variables:Le(l.environment_variables_str,void 0),tool_config:Le(l.tool_config_str,void 0),required_scopes:l.required_scopes||[]};break;default:o(!1);return}let z;m?z=b.map(S=>S.id===m?N:S):z=[...b,N],t({tools:z}),o(!1),h(null)},y=v=>{v&&t({tools:b.filter(N=>N.id!==v)})},I=v=>{const N=[];return v.tool_type==="builtin-group"?N.push(`Group: ${v.group_name}`):v.tool_name?N.push(`Name: ${v.tool_name}`):v.tool_type==="python"&&v.function_name&&N.push(`Func: ${v.function_name}`),v.component_module&&N.push(`Module: ${v.component_module}`),N.join(", ")||"No details"};return r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{children:"Define custom tools for your agent. Tools can be Python functions, MCP servers, or built-in ADK capabilities. The final tools configuration will be submitted as a list of tool objects."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Custom Tools"}),r.jsx(Y,{onClick:C,variant:"secondary",children:"+ Add Tool"}),b.length>0?r.jsx("div",{className:"mt-4 space-y-3",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 border",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Details"}),r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:b.map((v,N)=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-700",children:v.tool_type}),r.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-500 max-w-xs truncate",title:I(v),children:I(v)}),r.jsxs("td",{className:"px-4 py-2 whitespace-nowrap text-sm space-x-2",children:[r.jsx(Y,{onClick:()=>g(v),variant:"outline",children:"Edit"}),r.jsx(Y,{onClick:()=>y(v.id),variant:"outline",className:"text-red-600 border-red-300 hover:bg-red-50",children:"Delete"})]})]},v.id||N))})]})}):r.jsx("p",{className:"text-gray-500 mt-4",children:"No tools configured yet."}),a&&r.jsx(Cr,{title:m?"Edit Tool":"Add New Tool",onClose:()=>o(!1),children:r.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto p-1",children:[c==="initial"&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm text-gray-600",children:"What kind of tool do you want to add?"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"builtin-group"})),d("builtin-group")},variant:"secondary",className:"w-full justify-start",children:"Group of Built-in Tools"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"builtin"})),d("builtin-tool")},variant:"secondary",className:"w-full justify-start",children:"Single Built-in Tool"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"python"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"Python Tool"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"mcp"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"MCP Tool"})]}),c==="builtin-group"&&r.jsx(P,{label:"Built-in Tool Group",htmlFor:"group_name",error:p.group_name,required:!0,children:r.jsx(se,{id:"group_name",name:"group_name",value:l.group_name||"",onChange:_,options:[{value:"",label:"Select a group..."},...s&&"groups"in s&&s.groups?Object.keys(s.groups).map(v=>({value:v,label:`${v.replace(/_/g," ").replace(/\b\w/g,N=>N.toUpperCase())} - ${s.groups[v].description}`})):[]]})}),c==="builtin-tool"&&r.jsx(P,{label:"Built-in Tool Name",htmlFor:"tool_name",error:p.tool_name,required:!0,children:r.jsx(wr,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_,suggestions:s&&"tools"in s&&s.tools?Object.keys(s.tools):[],placeholder:"Select a built-in tool..."})}),c==="custom"&&r.jsxs(r.Fragment,{children:[l.tool_type==="python"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Optional: A descriptive name for this Python tool. Overwrites the python function name",children:r.jsx(G,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_})}),r.jsx(P,{label:"Tool Description (Optional)",htmlFor:"tool_description",error:p.tool_description,helpText:"Optional: A brief description of what this tool does. Overwrites the python function docs",children:r.jsx(G,{id:"tool_description",name:"tool_description",value:l.tool_description||"",onChange:_,placeholder:"e.g., Fetch user profile data"})}),r.jsx(P,{label:"Component Module",htmlFor:"component_module",error:p.component_module,required:!0,children:r.jsx(G,{id:"component_module",name:"component_module",value:l.component_module||"",onChange:_,placeholder:"e.g., my_agent.custom_tools"})}),r.jsx(P,{label:"Function Name",htmlFor:"function_name",error:p.function_name,required:!0,children:r.jsx(G,{id:"function_name",name:"function_name",value:l.function_name||"",onChange:_,placeholder:"e.g., my_tool_function"})}),r.jsx(P,{label:"Component Base Path (Optional)",htmlFor:"component_base_path",error:p.component_base_path,helpText:"Base path for module resolution if not in PYTHONPATH.",children:r.jsx(G,{id:"component_base_path",name:"component_base_path",value:l.component_base_path||"",onChange:_,placeholder:"e.g., src/plugins"})})]}),l.tool_type==="mcp"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"MCP Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Name of the specific MCP tool (optional if using all tools from MCP server)",children:r.jsx(G,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_})}),r.jsx(P,{label:"Connection Parameters (JSON)",htmlFor:"connection_params_str",error:p.connection_params_str,helpText:'E.g., {"type": "stdio", "command": "cmd", "args":[]}',children:r.jsx("textarea",{id:"connection_params_str",name:"connection_params_str",rows:4,value:l.connection_params_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})}),r.jsx(P,{label:"Environment Variables (JSON, Optional)",htmlFor:"environment_variables_str",error:p.environment_variables_str,children:r.jsx("textarea",{id:"environment_variables_str",name:"environment_variables_str",rows:3,value:l.environment_variables_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})})]})]}),(c==="builtin-tool"||c==="custom")&&r.jsxs(r.Fragment,{children:[r.jsx(Ae,{id:"required_scopes",label:"Required Scopes (Optional)",values:l.required_scopes||[],onChange:v=>A("required_scopes",v),helpText:"Enter required OAuth scopes and press Add.",placeholder:"No scopes added yet.",inputPlaceholder:"e.g., read:profile"}),r.jsx(P,{label:"Tool Config (JSON, Optional)",htmlFor:"tool_config_str",error:p.tool_config_str,helpText:"Tool-specific configuration like API keys, model names etc.",children:r.jsx("textarea",{id:"tool_config_str",name:"tool_config_str",rows:3,value:l.tool_config_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})})]}),c!=="initial"&&r.jsxs("div",{className:"flex justify-end space-x-2 mt-6 pt-4 border-t",children:[r.jsx(Y,{onClick:()=>o(!1),variant:"outline",children:"Cancel"}),r.jsx(Y,{onClick:L,children:m?"Update Tool":"Add Tool"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx(Y,{type:"button",onClick:i,variant:"outline",children:"Previous"}),r.jsx(Y,{type:"button",onClick:n,children:"Next"})]})]})},Wi=[{value:"ignore",label:"Ignore (Do not include artifacts in A2A messages)"},{value:"embed",label:"Embed (Include base64 artifact data in A2A messages)"},{value:"reference",label:"Reference (Include artifact fetch URI in A2A messages)"}],Gi=({data:e,updateData:t,onNext:n,onPrevious:i})=>r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{children:"Configure various features and behaviors for your agent, such as built-in tools and how artifacts are handled."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Built-in Tools & Features"}),r.jsx(P,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",helpText:"How artifacts created by this agent are represented in A2A messages.",children:r.jsx(se,{id:"artifact_handling_mode",name:"artifact_handling_mode",value:e.artifact_handling_mode||"ignore",onChange:s=>t({artifact_handling_mode:s.target.value}),options:Wi})}),r.jsxs("div",{className:"space-y-3 mt-4",children:[r.jsx(P,{label:"",htmlFor:"enable_embed_resolution",children:r.jsx(be,{id:"enable_embed_resolution",checked:e.enable_embed_resolution===void 0?!0:!!e.enable_embed_resolution,onChange:s=>t({enable_embed_resolution:s}),label:"Enable Embed Resolution (for dynamic content like state, math in prompts)"})}),r.jsx(P,{label:"",htmlFor:"enable_artifact_content_instruction",children:r.jsx(be,{id:"enable_artifact_content_instruction",checked:e.enable_artifact_content_instruction===void 0?!0:!!e.enable_artifact_content_instruction,onChange:s=>t({enable_artifact_content_instruction:s}),label:"Enable Artifact Content Instruction (for late-stage artifact content embedding)"})})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]}),Ji=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),Yi=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),Xi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const[s,a]=k.useState(!1),[o,l]=k.useState(null),[u,c]=k.useState(null),[d,m]=k.useState({}),[h,p]=k.useState(null);k.useEffect(()=>{s&&(o?(m(o),c(o.id)):(m({}),c(null)),p(null))},[o,s]);const w=y=>{const{name:I,value:v,type:N}=y.target,z=N==="checkbox"?y.target.checked:v;t({[I]:z})},b=y=>{const{name:I,value:v}=y.target;m(N=>({...N,[I]:v}))},C=()=>{if(!d.id||d.id.trim()===""||!d.name||d.name.trim()===""||!d.description||d.description.trim()===""){p("Skill ID, Name, and Description are required and cannot be empty.");return}p(null);const y=Array.isArray(e.agent_card_skills)?[...e.agent_card_skills]:[],I=d.id,v=y.findIndex(N=>N.id===I);if(o){if(u!==I&&v!==-1){p(`Skill ID "${I}" already exists. Please use a unique ID.`);return}const N=y.findIndex(z=>z.id===u);if(N!==-1)y[N]={...d};else{p("Error finding the original skill to update.");return}}else{if(v!==-1){p(`Skill ID "${I}" already exists. Please use a unique ID.`);return}y.push({...d})}t({agent_card_skills:y}),a(!1),l(null),c(null)},g=y=>{l(y),a(!0)},_=()=>{l(null),a(!0)},A=y=>{const I=Array.isArray(e.agent_card_skills)?e.agent_card_skills:[];t({agent_card_skills:I.filter(v=>v.id!==y)})},R=y=>{const{name:I,value:v}=y.target;t({[I]:v===""?void 0:Number(v)})},L="A helpful assistant capable of complex tasks.";return r.jsxs("div",{className:"space-y-6",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Agent Card & Discovery"}),r.jsx(P,{label:"Agent Card Description",htmlFor:"agent_card_description",helpText:"A concise description of the agent's capabilities.",children:r.jsx("textarea",{id:"agent_card_description",name:"agent_card_description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:e.agent_card_description||L,onChange:w,placeholder:L})}),r.jsx(Ae,{id:"agent_card_default_input_modes",label:"Default Input Modes",values:e.agent_card_default_input_modes||[],onChange:y=>t({agent_card_default_input_modes:y}),helpText:"Enter input modes (e.g., text, file) and press Add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),r.jsx(Ae,{id:"agent_card_default_output_modes",label:"Default Output Modes",values:e.agent_card_default_output_modes||[],onChange:y=>t({agent_card_default_output_modes:y}),helpText:"Enter output modes (e.g., text, file) and press Add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., file"}),r.jsxs(P,{label:"Skills",htmlFor:"add_skill_button",children:[r.jsx("div",{className:"mb-2",children:r.jsx(Y,{type:"button",variant:"outline",onClick:_,children:"Add New Skill"})}),e.agent_card_skills&&e.agent_card_skills.length>0?r.jsx("div",{className:"overflow-x-auto border rounded-md",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 text-sm",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"ID"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Name"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Description"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.agent_card_skills.map(y=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-3 py-2 whitespace-nowrap font-mono text-xs",children:y.id}),r.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:y.name}),r.jsx("td",{className:"px-3 py-2 break-words max-w-xs",children:y.description}),r.jsxs("td",{className:"px-3 py-2 whitespace-nowrap space-x-2",children:[r.jsx(Y,{variant:"secondary",onClick:()=>g(y),"aria-label":"Edit skill",children:r.jsx(Ji,{})}),r.jsx(Y,{variant:"secondary",onClick:()=>A(y.id),className:"text-red-600 hover:text-red-800","aria-label":"Delete skill",children:r.jsx(Yi,{})})]})]},y.id))})]})}):r.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"No skills defined yet."})]}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Discovery & Communication"}),r.jsx(P,{label:"Agent Card Publishing Interval (seconds)",htmlFor:"agent_card_publishing_interval",helpText:"Set to 0 to disable periodic publishing.",children:r.jsx(G,{id:"agent_card_publishing_interval",name:"agent_card_publishing_interval",type:"number",value:e.agent_card_publishing_interval===void 0?"10":String(e.agent_card_publishing_interval),onChange:R,placeholder:"10"})}),r.jsx(P,{label:"",htmlFor:"agent_discovery_enabled",children:r.jsx(be,{id:"agent_discovery_enabled",checked:e.agent_discovery_enabled===void 0?!1:!!e.agent_discovery_enabled,onChange:y=>t({agent_discovery_enabled:y}),label:"Enable Agent Discovery (allows this agent to find and delegate to peers)"})}),r.jsx(Ae,{id:"inter_agent_communication_allow_list",label:"Inter-Agent Allow List",values:e.inter_agent_communication_allow_list||[],onChange:y=>t({inter_agent_communication_allow_list:y}),helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*).",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),r.jsx(Ae,{id:"inter_agent_communication_deny_list",label:"Inter-Agent Deny List",values:e.inter_agent_communication_deny_list||[],onChange:y=>t({inter_agent_communication_deny_list:y}),helpText:"Agent name patterns to deny delegation to.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),r.jsx(P,{label:"Inter-Agent Request Timeout (seconds)",htmlFor:"inter_agent_communication_timeout",children:r.jsx(G,{id:"inter_agent_communication_timeout",name:"inter_agent_communication_timeout",type:"number",value:e.inter_agent_communication_timeout===void 0?"30":String(e.inter_agent_communication_timeout),onChange:R,placeholder:"30"})}),s&&r.jsx(Cr,{onClose:()=>{a(!1),l(null),c(null)},title:o?"Edit Skill":"Add New Skill",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx(P,{label:"Skill ID (e.g., function_name)",htmlFor:"skill_id",required:!0,helpText:"Unique identifier for the skill.",children:r.jsx(G,{id:"skill_id",name:"id",value:d.id||"",onChange:b,placeholder:"e.g., getWeather",disabled:!1})}),r.jsx(P,{label:"Skill Name (Display Name)",htmlFor:"skill_name",required:!0,children:r.jsx(G,{id:"skill_name",name:"name",value:d.name||"",onChange:b,placeholder:"e.g., Data Analysis"})}),r.jsx(P,{label:"Skill Description",htmlFor:"skill_description",required:!0,children:r.jsx("textarea",{id:"skill_description",name:"description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:d.description||"",onChange:b,placeholder:"e.g., Can analyze CSV data and generate reports."})}),h&&r.jsx("p",{className:"text-sm text-red-600",children:h}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-2",children:[r.jsx(Y,{type:"button",variant:"secondary",onClick:()=>{a(!1),l(null),c(null)},children:"Cancel"}),r.jsx(Y,{type:"button",onClick:C,children:o?"Update Skill":"Add Skill"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},$i=({data:e,updateData:t,onPrevious:n,serverUrl:i=""})=>{const s=async()=>{console.log("Submitting agent configuration:",e);try{const a=JSON.parse(JSON.stringify(e));if(!Array.isArray(a.agent_card_skills)&&a.agent_card_skills_str)try{const c=JSON.parse(a.agent_card_skills_str);Array.isArray(c)?a.agent_card_skills=c:(console.warn("Parsed agent_card_skills_str was not an array, ensuring agent_card_skills is empty array."),a.agent_card_skills=[])}catch(c){console.warn("Could not parse agent_card_skills_str as JSON, ensuring agent_card_skills is empty array.",c),a.agent_card_skills=[]}else Array.isArray(a.agent_card_skills)||(a.agent_card_skills=[]);delete a.agent_card_skills_str,Array.isArray(a.tools)&&(a.tools=a.tools.map(c=>{const d={};return c.tool_type&&(d.tool_type=c.tool_type),c.tool_name&&(d.tool_name=c.tool_name),c.tool_description&&(d.tool_description=c.tool_description),c.group_name&&(d.group_name=c.group_name),c.component_module&&(d.component_module=c.component_module),c.function_name&&(d.function_name=c.function_name),c.component_base_path&&(d.component_base_path=c.component_base_path),c.connection_params&&(d.connection_params=c.connection_params),c.environment_variables&&(d.environment_variables=c.environment_variables),c.required_scopes&&c.required_scopes.length>0&&(d.required_scopes=c.required_scopes),c.tool_config&&(d.tool_config=c.tool_config),d.tool_type?d:(console.error("Tool is missing tool_type:",c),null)}).filter(c=>c!==null));const o={agent_name_input:e.agent_name,config:a},l=await fetch(`${i}/api/save_agent_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),u=await l.json();l.ok&&u.status==="success"?(setTimeout(async()=>{try{await fetch(`${i}/api/shutdown`,{method:"POST"})}catch{}},200),t&&t({showSuccessScreen_agent:!0})):alert(`Error saving agent: ${u.message||"Unknown error"}`)}catch(a){alert(`Failed to save agent: ${a instanceof Error?a.message:String(a)}`)}};return r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Review and Submit Agent Configuration"}),r.jsx("pre",{className:"bg-gray-100 p-3 rounded overflow-x-auto text-xs max-h-96",children:JSON.stringify(e,null,2)}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{onClick:s,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",children:"Save Agent & Finish"})]})]})},ot=[{id:"agent-basic",title:"Basic Info",description:"Name, model, instruction",component:zi},{id:"agent-services",title:"Services",description:"Session & artifact services",component:Hi},{id:"agent-features",title:"Features",description:"Enable built-in features",component:Gi},{id:"agent-tools",title:"Custom Tools",description:"Define custom tools for the agent",component:Vi},{id:"agent-card",title:"Agent Card & Comms",description:"Discovery and communication settings",component:Xi},{id:"agent-review",title:"Review & Submit",description:"Review and save configuration",component:$i}];function Qi(){var b;const[e,t]=k.useState(0),[n,i]=k.useState({}),[s,a]=k.useState(!0),[o,l]=k.useState(null),[u,c]=k.useState([]),d="";k.useEffect(()=>{Promise.all([fetch("/api/form_schema?type=agent"),fetch("/api/available_tools")]).then(async([C,g])=>{if(!C.ok)throw new Error(`Failed to fetch agent form schema (status: ${C.status})`);if(!g.ok)throw new Error(`Failed to fetch available tools (status: ${g.status})`);const _=await C.json(),A=await g.json();if((_==null?void 0:_.status)!=="success"||!(_!=null&&_.defaults))throw new Error((_==null?void 0:_.message)||"Invalid response for agent form schema");if((A==null?void 0:A.status)!=="success")throw new Error((A==null?void 0:A.message)||"Invalid response for available tools");c(A);const R=_.defaults,L={...R,agent_card_default_input_modes:(R.agent_card_default_input_modes_str||"text").split(",").map(y=>y.trim()).filter(Boolean),agent_card_default_output_modes:(R.agent_card_default_output_modes_str||"text,file").split(",").map(y=>y.trim()).filter(Boolean),inter_agent_communication_allow_list:(R.inter_agent_communication_allow_list_str||"*").split(",").map(y=>y.trim()).filter(Boolean),inter_agent_communication_deny_list:(R.inter_agent_communication_deny_list_str||"").split(",").map(y=>y.trim()).filter(Boolean),agent_card_skills_str:R.agent_card_skills_str||"[]",agent_card_skills:[],tools:Array.isArray(R.tools)?R.tools:[],showSuccessScreen_agent:!1};delete L.agent_card_default_input_modes_str,delete L.agent_card_default_output_modes_str,delete L.inter_agent_communication_allow_list_str,delete L.inter_agent_communication_deny_list_str;try{const y=JSON.parse(L.agent_card_skills_str||"[]");Array.isArray(y)&&(L.agent_card_skills=y.filter(I=>typeof I=="object"&&I!==null&&"id"in I&&typeof I.id=="string"&&"name"in I&&typeof I.name=="string"&&"description"in I&&typeof I.description=="string"))}catch(y){console.warn("Could not parse agent_card_skills_str from defaults:",y),L.agent_card_skills=[]}i(L)}).catch(C=>{console.error("Error fetching initial data:",C),l(`Failed to load agent configuration form: ${C instanceof Error?C.message:String(C)}`)}).finally(()=>a(!1))},[]);const m=k.useCallback(C=>{i(g=>({...g,...C}))},[]);k.useEffect(()=>{if(s)return;const C=[];C.push({id:"default-artifact-management",tool_type:"builtin-group",group_name:"artifact_management"}),m({tools:C})},[m,s]);const h=k.useCallback(()=>{e<ot.length-1&&t(C=>C+1)},[e]),p=k.useCallback(()=>{e>0&&t(C=>C-1)},[e]);if(s)return r.jsx("div",{className:"text-center p-10",children:"Loading agent configuration form..."});if(o)return r.jsx("div",{className:"text-center p-10 text-red-600",children:r.jsxs("p",{children:["Error: ",o]})});if(n.showSuccessScreen_agent){let C="Agent Configured Successfully!";return n.agent_name&&(C=`Agent "${n.agent_name}" configured successfully!`),r.jsx("div",{className:"max-w-2xl mx-auto p-6",children:r.jsx(tn,{title:C,message:"Your new agent configuration has been saved.",initTab:"tutorials"})})}const w=(b=ot[e])==null?void 0:b.component;return w?r.jsxs("div",{className:"max-w-2xl mx-auto p-4",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center text-solace-purple",children:"Add New Agent"}),ot.length>1&&r.jsx("div",{className:"mb-8",children:r.jsx(en,{steps:ot,currentStepIndex:e})}),r.jsx("div",{className:"bg-white rounded-lg shadow-xl p-6 min-h-[500px]",children:r.jsx(w,{data:n,updateData:m,onNext:h,onPrevious:p,serverUrl:d,availableTools:u})})]}):r.jsxs("div",{className:"text-center p-10 text-red-600",children:["Error: Configuration step not found for index ",e,"."]})}/**
|
|
35
|
+
Do you want to skip this check and continue anyway?`,onConfirm:()=>{b(!1),n()},onCancel:()=>{b(!1)}})]})}const Ae=({id:e,label:t,values:n,onChange:i,placeholder:s,helpText:a,error:o,required:l,inputButtonText:u="Add",inputPlaceholder:c="Type and press Add..."})=>{const[d,m]=k.useState(""),h=C=>{m(C.target.value)},p=()=>{if(d.trim()!==""){if(n.includes(d.trim())){m("");return}i([...n,d.trim()]),m("")}},w=C=>{i(n.filter(g=>g!==C))},b=C=>{C.key==="Enter"&&(C.preventDefault(),p())};return r.jsxs(P,{label:t,htmlFor:e,helpText:a,error:o,required:l,children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[r.jsx(G,{id:e,name:e,value:d,onChange:h,onKeyDown:b,placeholder:c,className:"flex-grow"}),r.jsx(Y,{onClick:p,variant:"secondary",type:"button",children:u})]}),n.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 mt-2 p-2 border border-gray-200 rounded-md min-h-[40px]",children:n.map((C,g)=>r.jsxs("div",{className:"flex items-center bg-gray-100 text-gray-700 text-sm font-medium px-3 py-1 rounded-full",children:[r.jsx("span",{children:C}),r.jsx("button",{type:"button",onClick:()=>w(C),className:"ml-2 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":`Remove ${C}`,children:"×"})]},g))}),n.length===0&&s&&r.jsx("div",{className:"mt-2 p-2 border border-dashed border-gray-300 rounded-md min-h-[40px] flex items-center justify-center",children:r.jsx("p",{className:"text-sm text-gray-400",children:s})})]})};function be({id:e,checked:t,onChange:n,label:i,disabled:s=!1,className:a=""}){const o=l=>{n(l.target.checked)};return r.jsxs("div",{className:`flex items-center ${a}`,children:[r.jsx("input",{id:e,type:"checkbox",checked:t,onChange:o,disabled:s,className:"h-4 w-4 text-solace-green focus:ring-solace-green border-gray-300 rounded"}),i&&r.jsx("label",{htmlFor:e,className:"ml-2 block text-sm text-gray-700",children:i})]})}const ji=[{value:"sql",label:"SQL: Use a SQL database for session data"},{value:"memory",label:"Memory: Store session data in memory"},{value:"vertex_rag",label:"Vertex RAG: Use Google Vertex AI for RAG capabilities"}],Si=[{value:"PERSISTENT",label:"Persistent: Keep session history indefinitely"},{value:"RUN_BASED",label:"Run-based: Clear session history after each run"}],Ni=[{value:"memory",label:"Memory: Store artifacts in memory (temporary)"},{value:"filesystem",label:"Filesystem: Store artifacts on disk"},{value:"gcs",label:"GCS: Store artifacts in Google Cloud Storage"}],Ci=[{value:"namespace",label:"Namespace: Share artifacts within the namespace"},{value:"app",label:"App: Isolate artifacts by app name"},{value:"custom",label:"Custom: Use a custom scope identifier"}],Ai=[{value:"ignore",label:"Ignore: Do not include artifacts in messages"},{value:"embed",label:"Embed: Include base64 data in messages"},{value:"reference",label:"Reference: Include fetch URI in messages"}];function Ei({data:e,updateData:t,onNext:n,onPrevious:i}){const[s,a]=k.useState({}),[o,l]=k.useState(!1),u=(M,ie)=>{if(M==null)return ie;if(Array.isArray(M))return M.map(he=>String(he).trim()).filter(he=>he.length>0);const Te=String(M).trim();return Te===""?[]:Te.split(",").map(he=>he.trim()).filter(he=>he.length>0)},c=e,[d,m]=k.useState(c.agent_name||"OrchestratorAgent"),[h,p]=k.useState(c.supports_streaming!==!1),[w,b]=k.useState(c.session_service_type||"sql"),[C,g]=k.useState(c.orchestrator_database_url||""),[_,A]=k.useState(c.session_service_behavior||"PERSISTENT"),[R,L]=k.useState(c.artifact_service_type||"filesystem"),[y,I]=k.useState(c.artifact_service_base_path||"/tmp/samv2"),[v,N]=k.useState(c.artifact_service_scope||"namespace"),[z,S]=k.useState(c.artifact_handling_mode||"reference"),[F,D]=k.useState(c.enable_embed_resolution!==!1),[O,U]=k.useState(c.enable_artifact_content_instruction!==!1),[ee,B]=k.useState(c.agent_card_description||"The Orchestrator component. It manages tasks, and coordinating multi-agent workflows."),[q,X]=k.useState(u(c.agent_card_default_input_modes,["text"])),[f,ne]=k.useState(u(c.agent_card_default_output_modes,["text","file"])),[le,x]=k.useState(c.agent_discovery_enabled!==!1),[ae,_e]=k.useState(c.agent_card_publishing_interval||10),[re,Ie]=k.useState(u(c.inter_agent_communication_allow_list,["*"])),[ve,Ne]=k.useState(u(c.inter_agent_communication_deny_list,[])),[we,Fe]=k.useState(c.inter_agent_communication_timeout||180);k.useEffect(()=>{o||(c.agent_name&&m(c.agent_name),c.supports_streaming!==void 0&&p(c.supports_streaming),c.session_service_type&&b(c.session_service_type),c.session_service_behavior&&A(c.session_service_behavior),c.artifact_service_type&&L(c.artifact_service_type),c.artifact_service_base_path&&I(c.artifact_service_base_path),c.artifact_service_scope&&N(c.artifact_service_scope),c.artifact_handling_mode&&S(c.artifact_handling_mode),c.enable_embed_resolution!==void 0&&D(c.enable_embed_resolution),c.enable_artifact_content_instruction!==void 0&&U(c.enable_artifact_content_instruction),c.agent_card_description&&B(c.agent_card_description),c.agent_card_default_input_modes!==void 0&&X(u(c.agent_card_default_input_modes,["text"])),c.agent_card_default_output_modes!==void 0&&ne(u(c.agent_card_default_output_modes,["text","file"])),c.agent_discovery_enabled!==void 0&&x(c.agent_discovery_enabled),c.agent_card_publishing_interval&&_e(c.agent_card_publishing_interval),c.inter_agent_communication_allow_list!==void 0&&Ie(u(c.inter_agent_communication_allow_list,["*"])),c.inter_agent_communication_deny_list!==void 0&&Ne(u(c.inter_agent_communication_deny_list,[])),c.inter_agent_communication_timeout&&Fe(c.inter_agent_communication_timeout),l(!0))},[e,o]);const bt=M=>{m(M.target.value),t({agent_name:M.target.value})},_t=M=>{p(M),t({supports_streaming:M})},vt=M=>{b(M.target.value),t({session_service_type:M.target.value})},nt=M=>{A(M.target.value),t({session_service_behavior:M.target.value})},rt=M=>{L(M.target.value),t({artifact_service_type:M.target.value})},it=M=>{I(M.target.value),t({artifact_service_base_path:M.target.value})},wt=M=>{N(M.target.value),t({artifact_service_scope:M.target.value})},st=M=>{S(M.target.value),t({artifact_handling_mode:M.target.value})},at=M=>{D(M),t({enable_embed_resolution:M})},kt=M=>{U(M),t({enable_artifact_content_instruction:M})},jt=M=>{B(M.target.value),t({agent_card_description:M.target.value})},St=M=>{X(M),t({agent_card_default_input_modes:M})},Nt=M=>{ne(M),t({agent_card_default_output_modes:M})},Ct=M=>{x(M),t({agent_discovery_enabled:M})},j=M=>{_e(Number(M.target.value)),t({agent_card_publishing_interval:Number(M.target.value)})},T=M=>{Ie(M),t({inter_agent_communication_allow_list:M})},V=M=>{Ne(M),t({inter_agent_communication_deny_list:M})},J=M=>{Fe(Number(M.target.value)),t({inter_agent_communication_timeout:Number(M.target.value)})},Q=()=>{const M={};let ie=!0;return d?/^[a-zA-Z0-9_]+$/.test(d)||(M.agentName="Agent name can only contain letters, numbers, and underscores.",ie=!1):(M.agentName="Agent name is required",ie=!1),R==="filesystem"&&!y&&(M.artifactBasePath="Artifact base path is required for filesystem service",ie=!1),(!ae||ae<=0)&&(M.cardPublishingInterval="Publishing interval must be a positive number",ie=!1),(!we||we<=0)&&(M.communicationTimeout="Communication timeout must be a positive number",ie=!1),a(M),ie},pe=M=>{M.preventDefault(),Q()&&n()};return r.jsxs("form",{onSubmit:pe,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{className:"mb-4",children:"Configure the main orchestrator for your Solace Agent Mesh system. This will set up the agent that orchestrates communication between components."}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx("div",{className:"col-span-2",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Basic Configuration"})}),r.jsx(P,{label:"Agent Name",htmlFor:"agent_name",error:s.agentName,required:!0,helpText:"The name can only contain letters, numbers, and underscores.",children:r.jsx(G,{id:"agent_name",value:d,onChange:bt,placeholder:"OrchestratorAgent",required:!0})}),r.jsx(P,{label:"Supports Streaming",htmlFor:"supports_streaming",helpText:"Enable streaming support for the agent",children:r.jsx(be,{id:"supports_streaming",checked:h,onChange:_t,label:"Enable streaming support"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Session Service"})}),r.jsx(P,{label:"Session Service Type",htmlFor:"session_service_type",required:!0,children:r.jsx(se,{id:"session_service_type",options:ji,value:w,onChange:vt})}),r.jsx(P,{label:"Session Behavior",htmlFor:"session_behavior",required:!0,children:r.jsx(se,{id:"session_behavior",options:Si,value:_,onChange:nt})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Artifact Service"})}),r.jsx(P,{label:"Artifact Service Type",htmlFor:"artifact_service_type",required:!0,children:r.jsx(se,{id:"artifact_service_type",options:Ni,value:R,onChange:rt})}),R==="filesystem"&&r.jsx(P,{label:"Artifact Base Path",htmlFor:"artifact_base_path",error:s.artifactBasePath,required:!0,children:r.jsx(G,{id:"artifact_base_path",value:y,onChange:it,placeholder:"/tmp/samv2"})}),r.jsx(P,{label:"Artifact Scope",htmlFor:"artifact_scope",required:!0,children:r.jsx(se,{id:"artifact_scope",options:Ci,value:v,onChange:wt})}),r.jsx(P,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",required:!0,children:r.jsx(se,{id:"artifact_handling_mode",options:Ai,value:z,onChange:st})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Feature Flags"})}),r.jsx(P,{label:"Enable Embed Resolution",htmlFor:"enable_embed_resolution",children:r.jsx(be,{id:"enable_embed_resolution",checked:F,onChange:at,label:"Enable embed resolution"})}),r.jsx(P,{label:"Enable Artifact Content Instruction",htmlFor:"enable_artifact_content_instruction",children:r.jsx(be,{id:"enable_artifact_content_instruction",checked:O,onChange:kt,label:"Enable artifact content instruction"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Card"})}),r.jsx("div",{className:"col-span-2",children:r.jsx(P,{label:"Agent Card Description",htmlFor:"agent_card_description",required:!0,children:r.jsx(G,{id:"agent_card_description",value:ee,onChange:jt,placeholder:"A helpful assistant accessed via a custom endpoint, capable of delegating tasks."})})}),r.jsx(Ae,{id:"default_input_modes",label:"Default Input Modes",values:q,onChange:St,helpText:"Enter input modes (e.g., text). Press Enter or comma to add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),r.jsx(Ae,{id:"default_output_modes",label:"Default Output Modes",values:f,onChange:Nt,helpText:"Enter output modes (e.g., text, file). Press Enter or comma to add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., text, file"}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Discovery"})}),r.jsx(P,{label:"Enable Agent Discovery",htmlFor:"agent_discovery_enabled",children:r.jsx(be,{id:"agent_discovery_enabled",checked:le,onChange:Ct,label:"Enable agent discovery"})}),r.jsx(P,{label:"Card Publishing Interval",htmlFor:"card_publishing_interval",error:s.cardPublishingInterval,helpText:"Interval in seconds for publishing agent card",required:!0,children:r.jsx(G,{id:"card_publishing_interval",type:"number",value:ae.toString(),onChange:j,placeholder:"10"})}),r.jsx("div",{className:"col-span-2 mt-4",children:r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Inter-Agent Communication"})}),r.jsx(Ae,{id:"allow_list",label:"Allow List",values:re,onChange:T,helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*). Press Enter or comma to add.",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),r.jsx(Ae,{id:"deny_list",label:"Deny List",values:ve,onChange:V,helpText:"Agent name patterns to deny delegation to. Press Enter or comma to add.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),r.jsx(P,{label:"Communication Timeout",htmlFor:"communication_timeout",error:s.communicationTimeout,helpText:"Timeout in seconds for inter-agent communication",required:!0,children:r.jsx(G,{id:"communication_timeout",type:"number",value:we.toString(),onChange:J,placeholder:"30"})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:i,variant:"outline",children:"Previous"}),r.jsx(Y,{type:"submit",children:"Next"})]})]})}function Ii({data:e,updateData:t,onNext:n,onPrevious:i}){const[s,a]=k.useState({}),o=e;k.useEffect(()=>{const m={add_webui_gateway:o.add_webui_gateway??!1,webui_session_secret_key:o.webui_session_secret_key??"",webui_fastapi_host:o.webui_fastapi_host??"127.0.0.1",webui_fastapi_port:o.webui_fastapi_port??8e3,webui_enable_embed_resolution:o.webui_enable_embed_resolution??!0,webui_frontend_welcome_message:o.webui_frontend_welcome_message??"",webui_frontend_bot_name:o.webui_frontend_bot_name??"Solace Agent Mesh",webui_frontend_collect_feedback:o.webui_frontend_collect_feedback??!1},h={};for(const p in m)o[p]===void 0&&m[p]!==void 0&&(h[p]=m[p]);Object.keys(h).length>0&&t(h)},[]);const l=m=>{const{name:h,value:p,type:w}=m.target;t(w==="number"?{[h]:p===""?"":Number(p)}:{[h]:p})},u=(m,h)=>{t({[m]:h})},c=()=>{const m={};let h=!0;return o.add_webui_gateway&&(o.webui_session_secret_key||(m.webui_session_secret_key="Session Secret Key is required.",h=!1),o.webui_fastapi_host||(m.webui_fastapi_host="FastAPI Host is required.",h=!1),o.webui_fastapi_port===void 0?(m.webui_fastapi_port="FastAPI Port is required.",h=!1):(isNaN(Number(o.webui_fastapi_port))||Number(o.webui_fastapi_port)<=0)&&(m.webui_fastapi_port="FastAPI Port must be a positive number.",h=!1)),a(m),h},d=m=>{m.preventDefault(),c()&&n()};return r.jsxs("form",{onSubmit:d,children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{className:"mb-4",children:"Optionally, configure a Web UI Gateway to interact with your Solace Agent Mesh. This provides a Web UI chat interface."}),r.jsx(P,{label:"",htmlFor:"add_webui_gateway",children:r.jsx(be,{id:"add_webui_gateway",checked:o.add_webui_gateway||!1,onChange:m=>u("add_webui_gateway",m),label:"Add Web UI Gateway"})}),o.add_webui_gateway&&r.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md mt-4",children:[r.jsx("h3",{className:"text-md font-medium text-gray-800 mb-3",children:"Web UI Gateway Configuration"}),r.jsx(P,{label:"Session Secret Key",htmlFor:"webui_session_secret_key",error:s.webui_session_secret_key,required:!0,children:r.jsx(G,{id:"webui_session_secret_key",name:"webui_session_secret_key",type:"password",value:o.webui_session_secret_key||"",onChange:l,placeholder:"Enter a strong secret key"})}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx(P,{label:"FastAPI Host",htmlFor:"webui_fastapi_host",error:s.webui_fastapi_host,required:!0,children:r.jsx(G,{id:"webui_fastapi_host",name:"webui_fastapi_host",value:o.webui_fastapi_host||"127.0.0.1",onChange:l,placeholder:"127.0.0.1"})}),r.jsx(P,{label:"FastAPI Port",htmlFor:"webui_fastapi_port",error:s.webui_fastapi_port,required:!0,children:r.jsx(G,{id:"webui_fastapi_port",name:"webui_fastapi_port",type:"number",value:o.webui_fastapi_port===void 0?"":String(o.webui_fastapi_port),onChange:l,placeholder:"8000"})})]}),r.jsx(P,{label:"",htmlFor:"webui_enable_embed_resolution",children:r.jsx(be,{id:"webui_enable_embed_resolution",checked:o.webui_enable_embed_resolution||!1,onChange:m=>u("webui_enable_embed_resolution",m),label:"Enable Embed Resolution in Web UI"})}),r.jsx("h4",{className:"text-sm font-medium text-gray-700 mt-3 mb-2",children:"Frontend Customization"}),r.jsx(P,{label:"Frontend Welcome Message",htmlFor:"webui_frontend_welcome_message",error:s.webui_frontend_welcome_message,children:r.jsx(G,{id:"webui_frontend_welcome_message",name:"webui_frontend_welcome_message",value:o.webui_frontend_welcome_message||"",onChange:l,placeholder:"Welcome to the Solace Agent Mesh!"})}),r.jsx(P,{label:"Frontend Bot Name",htmlFor:"webui_frontend_bot_name",error:s.webui_frontend_bot_name,children:r.jsx(G,{id:"webui_frontend_bot_name",name:"webui_frontend_bot_name",value:o.webui_frontend_bot_name||"Solace Agent Mesh",onChange:l,placeholder:"Solace Agent Mesh"})}),r.jsx(P,{label:"",htmlFor:"webui_frontend_collect_feedback",children:r.jsx(be,{id:"webui_frontend_collect_feedback",checked:o.webui_frontend_collect_feedback||!1,onChange:m=>u("webui_frontend_collect_feedback",m),label:"Enable Feedback Collection in Frontend"})})]})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:i,variant:"outline",type:"button",children:"Previous"}),r.jsx(Y,{type:"submit",children:"Next"})]})]})}const Ti=["llm","ai","api","url","vpn"],Pi=["broker_password","llm_api_key","webui_session_secret_key"],yn={Project:["namespace"],Broker:["dev_mode","broker_type","broker_url","broker_vpn","broker_username","broker_password"],"AI Provider":["llm_model_name","llm_endpoint_url","llm_api_key"],Orchestrator:["agent_name","supports_streaming","session_service_type","session_service_behavior","artifact_service_type","artifact_service_base_path","artifact_service_scope","artifact_handling_mode","enable_embed_resolution","enable_artifact_content_instruction","agent_card_description","agent_card_default_input_modes","agent_card_default_output_modes","agent_discovery_enabled","agent_card_publishing_interval","inter_agent_communication_allow_list","inter_agent_communication_deny_list","inter_agent_communication_timeout"],"Web UI":["add_webui_gateway","webui_frontend_welcome_message","webui_frontend_bot_name","webui_frontend_collect_feedback","webui_session_secret_key","webui_fastapi_host","webui_fastapi_port","webui_enable_embed_resolution"]};function Nr({data:e,updateData:t,onPrevious:n}){const[i,s]=k.useState(!1),[a,o]=k.useState(null),l=g=>g===void 0||g===""||Array.isArray(g)&&g.length===0,u=g=>g.split("_").map(_=>Ti.includes(_.toLowerCase())?_.toUpperCase():_.charAt(0).toUpperCase()+_.slice(1)).join(" "),c=(g,_)=>Pi.includes(g)||g.toUpperCase().includes("API_KEY")?_?"••••••••":"Not provided":typeof _=="boolean"?_?"Yes":"No":Array.isArray(_)?_.join(", "):_?String(_):"Not provided",d=g=>{switch(g){case"solace":return"Existing Solace Pub/Sub+ broker";case"container":return"New local Solace PubSub+ broker container (podman/docker)";case"dev_mode":return"Run in 'dev mode' - all in one process (not recommended for production)";default:return g}},m=()=>{const g=e.broker_type;return e.dev_mode?r.jsx("div",{children:r.jsxs("div",{className:"mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Type:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d("dev_mode")})]})}):r.jsxs("div",{children:[r.jsxs("div",{className:"mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Type:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d(g)})]}),g==="container"&&r.jsx("div",{className:"pl-4 border-l-2 border-gray-300 mb-2",children:r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Container Engine:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.container_engine)??"Docker"})]})}),(g==="solace"||g==="container")&&r.jsxs("div",{className:"pl-4 border-l-2 border-gray-300",children:[r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Broker URL:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_url)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Broker VPN:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_vpn)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Username:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_username)})]}),r.jsxs("div",{className:"flex mb-1",children:[r.jsx("span",{className:"text-gray-600",children:"Password:"}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c("broker_password",e.broker_password)})]})]})]})},h=(g,_)=>_.some(R=>!l(e[R]))?r.jsxs("div",{className:"pb-4 mb-4 border-b border-gray-300 last:border-0 last:mb-0 last:pb-0",children:[r.jsx("h4",{className:"font-semibold text-solace-blue mb-3",children:g}),r.jsx("div",{className:"space-y-3",children:_.map(R=>l(e[R])?null:R==="dev_mode"?r.jsx("div",{children:m()},R):r.jsxs("div",{className:"flex mb-1",children:[r.jsxs("span",{className:"text-gray-600",children:[u(R),":"]}),r.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c(R,e[R])})]},R))})]},g):null,p=g=>{const _={...g};return _.namespace&&!String(_.namespace).endsWith("/")&&(_.namespace+="/"),_.container_started&&delete _.container_started,_.llm_provider&&(_.llm_provider=kr[_.llm_provider]),_.llm_model_name&&_.llm_provider&&(_.llm_model_name=jr(String(_.llm_model_name),String(_.llm_provider)),delete _.llm_provider),e.broker_type==="container"&&(e.broker_type="solace"),_},w=async(g=!0)=>{const _=p(e);console.log("Submitting configuration:",_);try{const A=await fetch("api/save_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g?{..._,force:!0}:_)}),R=await A.json();if(!A.ok)throw new Error(`HTTP error ${A.status}: ${R.message??"Unknown error"}`);if(R.status==="success"){console.log("Configuration sent successfully!"),t({showSuccess:!0});try{const L=await fetch("api/shutdown",{method:"POST"});L.ok?console.log("Shutdown request sent successfully"):console.warn("Shutdown request failed:",L.status)}catch(L){console.error("Error sending shutdown request:",L)}}else throw new Error(R.message??"Failed to save configuration")}catch(A){o(A instanceof Error?A.message:"An unknown error occurred"),console.error("Error saving configuration:",A)}finally{s(!1)}},b=async()=>{s(!0),o(null),await w()},C=g=>{g.preventDefault(),b()};return r.jsx("div",{className:"space-y-6",children:r.jsxs("form",{onSubmit:C,children:[r.jsx("div",{className:"bg-gray-100 border border-gray-300 rounded-md p-5 space-y-4",children:e.setupPath==="quick"?h("AI Provider",yn["AI Provider"]):Object.entries(yn).map(([g,_])=>h(g,_))}),a&&r.jsxs("div",{className:"p-4 bg-red-50 text-red-700 rounded-md border border-red-200",children:[r.jsx("p",{className:"font-medium",children:"Error initializing project"}),r.jsx("p",{children:a})]}),r.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[r.jsx(Y,{onClick:n,variant:"outline",type:"button",children:"Previous"}),r.jsx(Y,{type:"submit",disabled:i,children:i?r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("span",{children:"Initializing..."})]}):"Initialize Project"})]})]})})}const Mi=({icon:e,title:t,description:n,time:i,link:s})=>r.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"block bg-white rounded-lg shadow-sm border border-gray-100 hover:shadow-md transition-all duration-200 hover:border-solace-blue/30 group h-full",children:r.jsxs("div",{className:"p-5 flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("span",{className:"text-2xl mr-3",children:e}),r.jsx("h4",{className:"text-lg font-medium text-gray-800 group-hover:text-solace-blue transition-colors",children:t})]}),r.jsx("div",{className:"bg-gray-100 text-gray-600 px-3 py-1 rounded-full text-xs font-medium",children:i})]}),r.jsx("p",{className:"text-gray-600 text-sm flex-grow mb-4",children:n}),r.jsx("div",{className:"mt-auto flex justify-end",children:r.jsxs("span",{className:"text-solace-blue text-sm font-medium flex items-center group-hover:translate-x-1 transition-transform",children:["View Tutorial",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]})}),Fi=({icon:e,title:t,description:n,link:i})=>r.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"flex p-4 bg-gray-50 hover:bg-gray-100 rounded-lg border border-gray-200 transition-colors group",children:[r.jsx("div",{className:"mr-4 bg-solace-blue bg-opacity-10 p-3 rounded-lg text-solace-blue group-hover:bg-opacity-20",children:e}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-gray-800",children:t}),r.jsx("p",{className:"text-sm text-gray-600",children:n})]})]});function Li({text:e}){const[t,n]=k.useState(!1),i=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy text:",a)}},s=()=>t?r.jsx("svg",{className:"w-5 h-5 text-green-500 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):r.jsx("svg",{className:"w-5 h-5 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})});return r.jsx("button",{onClick:i,className:"text-white transition-colors opacity-100","aria-label":t?"Copied":"Copy to clipboard",children:s()})}function tn({title:e,message:t,initTab:n}){const[i,s]=k.useState(n??"getting-started"),a=3,o=i==="getting-started"?0:i==="tutorials"?1:2,l="Operation Successful!",u="Your configuration has been saved. You're now ready to proceed.",c=g=>g===0?"tutorials":g===1?"documentation":"getting-started",d=g=>g===1?"getting-started":g===2?"tutorials":"documentation",m=()=>{if(o<a-1){const g=c(o);s(g)}},h=()=>{if(o>0){const g=d(o);s(g)}},p=g=>{const _="px-4 py-3 text-sm font-medium ";return i===g?_+"text-solace-blue border-b-2 border-solace-blue":_+"text-gray-500 hover:text-solace-blue"},w=[{icon:"🌤️",title:"Weather Agent",description:"Build an agent that gives Solace Agent Mesh the ability to access real-time weather information.",time:"~5 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/custom-agent"},{icon:"🗃️",title:"SQL Database Integration",description:"Enable Solace Agent Mesh to answer company-specific questions using a sample coffee company database.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/sql-database"},{icon:"🧠",title:"MCP Integration",description:"Integrating a Model Context Protocol (MCP) Server into Solace Agent Mesh.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/mcp-integration"},{icon:"💬",title:"Slack Integration",description:"Chat with Solace Agent Mesh directly from Slack.",time:"~20-30 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/slack-integration"}],b=[{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:"Getting Started",description:"Introduction and basic concepts",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),title:"Architecture",description:"System architecture and design",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/component-overview"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})}),title:"Tutorials",description:"Step-by-step guides",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/tutorials/event-mesh-gateway"},{icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),title:"User Guides",description:"User Guides for various components",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/user-guide/solace-ai-connector"}],C=()=>i==="getting-started"?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"})}),"Your Configuration Files"]}),r.jsx("p",{className:"text-gray-600 mb-4",children:"Your configurations have been saved in the following files:"}),r.jsxs("div",{className:"flex space-x-4 mb-4",children:[r.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[r.jsx("code",{className:"text-solace-blue font-mono",children:".env"}),r.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Environment variables"})]}),r.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[r.jsx("code",{className:"text-solace-blue font-mono",children:"configs/shared_config.yaml"}),r.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Config file"})]})]})]}),r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"})}),"Start the Service"]}),r.jsx("p",{className:"text-gray-600 mb-4",children:"To start Solace Agent Mesh directly, run:"}),r.jsxs("div",{className:"bg-gray-800 text-gray-200 p-4 rounded-md font-mono text-sm mb-4 flex items-center justify-between group relative",children:[r.jsx("code",{children:"sam run"}),r.jsx(Li,{text:"sam run"})]}),r.jsxs("p",{className:"text-gray-600",children:["You can use"," ",r.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"sam"})," as a shorthand for"," ",r.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"solace-agent-mesh"})," ","in all commands."]})]})]}):i==="tutorials"?r.jsxs("div",{children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-800 mb-2",children:"Hands-on Tutorials"}),r.jsx("p",{className:"text-gray-600",children:"Ready to go further? Here are some practical tutorials to help you leverage the full potential of Solace Agent Mesh."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:w.map(g=>r.jsx(Mi,{icon:g.icon,title:g.title,description:g.description,time:g.time,link:g.link},g.title))})]}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"Documentation Resources"]}),r.jsx("p",{className:"text-gray-600 mb-6",children:"Explore our comprehensive documentation to get the most out of Solace Agent Mesh:"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:b.map(g=>r.jsx(Fi,{icon:g.icon,title:g.title,description:g.description,link:g.link},g.title))}),r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("a",{href:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-5 py-2 rounded-md bg-solace-blue text-white hover:bg-solace-blue-dark transition-colors",children:["View Documentation",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})})]}),r.jsxs("div",{className:"p-6 bg-gradient-to-b from-solace-blue-light to-blue-50 rounded-lg text-center",children:[r.jsx("h3",{className:"text-lg font-medium text-solace-blue mb-2",children:"Connect with the Community"}),r.jsx("p",{className:"text-gray-600 mb-4",children:"Solace Agent Mesh is open source! We welcome contributions and discussions from the community."}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row justify-center items-stretch gap-4",children:[r.jsxs("a",{href:"https://github.com/SolaceLabs/solace-agent-mesh",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",className:"mb-2 text-solace-blue group-hover:text-white transition-colors",children:r.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",fill:"currentColor"})}),r.jsx("span",{className:"font-medium",children:"GitHub Repository"})]}),r.jsxs("a",{href:"https://solace.community/c/solace-agent-mesh/16",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[r.jsx("img",{src:"data:image/png;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAACnCAMAAAC1m4byAAAAM1BMVEUAAAAAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJWmhxYbAAAAEHRSTlMAECAwQFBgcICPn6+/z9/vIxqCigAAFnJJREFUeNrs1w1ymzAQQGH9IYQQ0t7/tJ2606ndJHhxiZt433eAZVj0hpEDAAAAAAAAAAAAAAAA8NWFpOEAfGdFNByA74zQAQMIHTCA0AEDpo3QA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YII=",alt:"Solace Community Forum Logo",className:"max-h-8 mb-2 object-contain"}),r.jsx("span",{className:"font-medium",children:"Community Forum"})]})]})]})]});return r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs("div",{className:"p-8 bg-gradient-to-br from-green-50 to-blue-50 rounded-xl mb-8 text-center relative overflow-hidden",children:[r.jsxs("div",{className:"relative z-10",children:[r.jsx("div",{className:"inline-block bg-green-100 p-3 rounded-full mb-4",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-10 w-10 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:e||l}),r.jsx("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:t||u}),r.jsxs("div",{className:"inline-flex items-center px-4 py-2 bg-solace-blue text-white rounded-full shadow-sm",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v3.586L7.707 9.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 10.586V7z",clipRule:"evenodd"})}),"Configuration saved successfully"]})]}),r.jsx("div",{className:"absolute top-0 right-0 -mt-10 -mr-10 h-40 w-40 bg-green-200 opacity-50 rounded-full"}),r.jsx("div",{className:"absolute bottom-0 left-0 -mb-10 -ml-10 h-32 w-32 bg-green-200 opacity-50 rounded-full"})]}),r.jsxs("div",{className:"flex items-center mb-6 border-b",children:[r.jsxs("div",{className:"flex-1 flex",children:[r.jsx("button",{onClick:()=>s("getting-started"),className:p("getting-started"),children:"Getting Started"}),r.jsx("button",{onClick:()=>s("tutorials"),className:p("tutorials"),children:"Tutorials"}),r.jsx("button",{onClick:()=>s("documentation"),className:p("documentation"),children:"Documentation"})]}),r.jsxs("div",{className:"text-gray-500 text-sm mr-4 flex items-center",children:["Page ",o+1," of ",a]})]}),C(),r.jsxs("div",{className:"mt-8 flex justify-between items-center",children:[r.jsx("div",{className:"text-sm text-gray-500",children:r.jsxs("span",{className:"md:hidden",children:["Page ",o+1," of ",a]})}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsx(Y,{onClick:h,variant:"outline",type:"button",disabled:o===0,children:"Previous"}),r.jsx(Y,{onClick:m,type:"button",disabled:o===a-1,children:"Next"})]})]})]})}const At={id:"path-selection",title:"Setup Path",description:"Choose your setup path",component:hi},bn=[{id:"project-setup",title:"Project Structure",description:"Set up your project namespace",component:gi},{id:"broker-setup",title:"Broker Setup",description:"Configure your Solace PubSub+ broker connection",component:bi},{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"orchestrator-setup",title:"Orchestrator",description:"Configure your main orchestrator",component:Ei},{id:"webui-gateway-setup",title:"Web UI Gateway",description:"Configure the optional Web UI Gateway",component:Ii},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}],_n=[{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}];function Ri(){const[e,t]=k.useState(0),[n,i]=k.useState({}),[s,a]=k.useState(!1),[o,l]=k.useState(null),[u,c]=k.useState(null),[d,m]=k.useState(!1),[h,p]=k.useState([At]);k.useEffect(()=>{u&&(a(!0),fetch(`/api/default_options?path=${u}`).then(L=>{if(!L.ok)throw new Error("Failed to fetch default options");return L.json()}).then(L=>{if(L!=null&&L.default_options){const y=L.default_options;i(I=>({...I,...y})),a(!1)}else throw new Error("Invalid response format")}).catch(L=>{console.error("Error fetching default options:",L),l("Failed to connect to server, is the init process still running?"),a(!1)}))},[u]),k.useEffect(()=>{u==="quick"?p([At,..._n]):u==="advanced"&&p([At,...bn])},[u]);const w=h[e],b=L=>{L.setupPath&&typeof L.setupPath=="string"&&L.setupPath!==u&&c(L.setupPath),L.showSuccess&&m(!0),i(y=>({...y,...L}))},C=()=>{e<h.length-1&&t(e+1)},g=()=>{e>0&&t(e-1)};if(s&&e>0)return r.jsxs("div",{className:"max-w-4xl mx-auto p-6 flex flex-col items-center justify-center min-h-[400px]",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-solace-blue",children:"Solace Agent Mesh Initialization"}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 w-full text-center",children:[r.jsxs("div",{className:"animate-pulse flex flex-col items-center",children:[r.jsx("div",{className:"h-4 w-1/2 bg-gray-200 rounded mb-4"}),r.jsx("div",{className:"h-10 w-3/4 bg-gray-200 rounded"})]}),r.jsx("p",{className:"mt-4",children:"Loading configuration options..."})]})]});if(o)return r.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[r.jsxs("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4",role:"alert",children:[r.jsx("p",{className:"font-bold",children:"Error"}),r.jsx("p",{children:o})]}),r.jsx("div",{className:"mt-4 flex justify-center",children:r.jsx("button",{onClick:()=>window.location.reload(),className:"bg-solace-blue hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Retry"})})]})]});if(d)return r.jsx("div",{className:"max-w-4xl mx-auto p-6",children:r.jsx(tn,{title:"Solace Agent Mesh Initialized Successfully!",message:"Your project configuration has been saved. You are now ready to start building and running agents."})});const _=w==null?void 0:w.component;if(!_)return r.jsx("div",{className:"text-center p-10 text-red-600",children:"Error: Setup step not found."});const A=e>0,R=()=>u==="quick"?_n:u==="advanced"?bn:[];return r.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[r.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),A&&r.jsx("div",{className:"mb-8",children:r.jsx(en,{steps:R(),currentStepIndex:e>0?e-1:0,onStepClick:()=>{}})}),r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[r.jsx("h2",{className:"text-xl font-bold mb-2 text-solace-blue",children:w.title}),r.jsx("p",{className:"text-gray-600 mb-6",children:w.description}),r.jsx(_,{data:n,updateData:b,onNext:C,onPrevious:g})]})]})}const Oi=[{value:"planning",label:"Planning Model (*planning_model)"},{value:"general",label:"General Model (*general_model)"},{value:"image_gen",label:"Image Generation Model (*image_gen_model)"},{value:"report_gen",label:"Report Generation Model (*report_gen_model)"},{value:"multimodal",label:"Multimodal Model (*multimodal_model)"},{value:"gemini_pro",label:"Gemini Pro Model (*gemini_pro_model)"}],zi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=l=>{const{name:u,value:c,type:d}=l.target,m=d==="checkbox"?l.target.checked:c;t({[u]:m})},a=()=>{if(!e.agent_name||e.agent_name.trim()===""){alert("Agent Name is required.");return}let l=e.instruction;if(typeof l=="string"&&l.includes("__AGENT_NAME__")){const u=e.agent_name;l=l.replace(/__AGENT_NAME__/g,u),t({instruction:l})}n()},o=e.instruction||`You are a helpful assistant named ${e.agent_name||"NewAgent"}, accessed via a custom endpoint.`;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(P,{label:"Agent Name",htmlFor:"agent_name",required:!0,helpText:"Unique name for this agent (will be PascalCase by the system).",children:r.jsx(G,{id:"agent_name",name:"agent_name",value:e.agent_name||"",onChange:s,placeholder:"MyNewAgent",required:!0})}),r.jsx(P,{label:"A2A Namespace",htmlFor:"namespace",helpText:"A2A topic namespace (e.g., myorg/dev). Can use ${NAMESPACE} for environment variable.",children:r.jsx(G,{id:"namespace",name:"namespace",value:e.namespace||"",onChange:s,placeholder:"${NAMESPACE}"})}),r.jsx(P,{label:"Model Type",htmlFor:"model_type",required:!0,children:r.jsx(se,{id:"model_type",name:"model_type",value:e.model_type||"planning",onChange:s,options:Oi})}),r.jsx(P,{label:"Instruction",htmlFor:"instruction",helpText:"System instruction for the agent. Use __AGENT_NAME__ to refer to the agent's name.",children:r.jsx("textarea",{id:"instruction",name:"instruction",value:e.instruction!==void 0?e.instruction:o.replace("__AGENT_NAME__",e.agent_name||"NewAgent"),onChange:s,rows:4,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"You are a helpful assistant..."})}),r.jsx(P,{label:"",htmlFor:"supports_streaming",children:r.jsx(be,{id:"supports_streaming",checked:e.supports_streaming===void 0?!0:!!e.supports_streaming,onChange:l=>t({supports_streaming:l}),label:"Supports Streaming (host capability for A2A tasks/sendSubscribe)"})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",disabled:!0,children:"Previous"}),r.jsx("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},dt="use_default_shared_session",mt="use_default_shared_artifact",Di=[{value:dt,label:"Use Default (from shared_config.yaml)"},{value:"memory",label:"Memory (In-Process)"},{value:"sql",label:"SQL (Relational Database)"},{value:"vertex_rag",label:"Vertex RAG (Google Cloud)"}],Bi=[{value:"PERSISTENT",label:"Persistent (Retains history across runs)"},{value:"RUN_BASED",label:"Run-based (Clears history after each run)"}],qi=[{value:mt,label:"Use Default (from shared_config.yaml)"},{value:"memory",label:"Memory (In-Process, temporary)"},{value:"filesystem",label:"Filesystem (Local disk storage)"},{value:"gcs",label:"Google Cloud Storage (GCS)"}],Ui=[{value:"namespace",label:"Namespace (Shared by all agents in namespace)"},{value:"app",label:"App (Isolated to this agent instance)"}],Hi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const s=c=>{const{name:d,value:m}=c.target,h={[d]:m};d==="session_service_type"?(m===dt?h.session_service_behavior=void 0:e.session_service_behavior||(h.session_service_behavior="PERSISTENT"),m==="sql"?h.database_url="default_agent_db":h.database_url=void 0):d==="artifact_service_type"&&(m===mt?(h.artifact_service_base_path=void 0,h.artifact_service_scope=void 0):(e.artifact_service_scope||(h.artifact_service_scope="namespace"),m==="filesystem"&&!e.artifact_service_base_path&&(h.artifact_service_base_path="/tmp/samv2"))),t(h)},a=c=>{t({[c.target.name]:c.target.value})},o=()=>{if(e.artifact_service_type==="filesystem"&&(!e.artifact_service_base_path||e.artifact_service_base_path.trim()==="")){alert("Artifact Service Base Path is required when type is Filesystem and not using default.");return}n()},l=e.session_service_type!==dt,u=e.artifact_service_type!==mt;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{children:"Configure how your agent stores session history and handles artifacts (files). You can use default settings from a shared project configuration or define them specifically for this agent."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Session Service"}),r.jsx(P,{label:"Session Service Configuration",htmlFor:"session_service_type",required:!0,children:r.jsx(se,{id:"session_service_type",name:"session_service_type",value:e.session_service_type||dt,onChange:s,options:Di})}),l&&r.jsx(P,{label:"Session Service Behavior",htmlFor:"session_service_behavior",required:!0,children:r.jsx(se,{id:"session_service_behavior",name:"session_service_behavior",value:e.session_service_behavior||"PERSISTENT",onChange:a,options:Bi})}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Artifact Service"}),r.jsx(P,{label:"Artifact Service Configuration",htmlFor:"artifact_service_type",required:!0,children:r.jsx(se,{id:"artifact_service_type",name:"artifact_service_type",value:e.artifact_service_type||mt,onChange:s,options:qi})}),u&&e.artifact_service_type==="filesystem"&&r.jsx(P,{label:"Artifact Service Base Path",htmlFor:"artifact_service_base_path",required:!0,helpText:"Base directory path for filesystem artifact storage.",children:r.jsx(G,{id:"artifact_service_base_path",name:"artifact_service_base_path",value:e.artifact_service_base_path||"/tmp/samv2",onChange:a,placeholder:"/tmp/samv2",required:!0})}),u&&r.jsx(P,{label:"Artifact Service Scope",htmlFor:"artifact_service_scope",required:!0,children:r.jsx(se,{id:"artifact_service_scope",name:"artifact_service_scope",value:e.artifact_service_scope||"namespace",onChange:a,options:Ui})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},Cr=({title:e,onClose:t,children:n})=>r.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50 flex justify-center items-center p-4",children:r.jsxs("div",{className:"relative bg-white w-full max-w-2xl mx-auto rounded-lg shadow-xl p-6",children:[r.jsxs("div",{className:"flex justify-between items-center border-b pb-3 mb-4",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e}),r.jsx("button",{onClick:t,className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center","aria-label":"Close modal",children:r.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),r.jsx("div",{children:n})]})}),Et={id:void 0,tool_type:"",tool_name:"",tool_description:"",group_name:"",component_module:"",function_name:"",component_base_path:"",connection_params_str:"{}",environment_variables_str:"{}",tool_config_str:"{}",connection_params:void 0,environment_variables:void 0,required_scopes:[],tool_config:void 0},Le=(e,t=void 0)=>{if(e===void 0||e.trim()===""||e.trim()==="{}")return t;try{const n=JSON.parse(e);return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:t}catch(n){return console.warn("Failed to parse JSON string:",e,n),t}},Vi=({data:e,updateData:t,onNext:n,onPrevious:i,availableTools:s})=>{const[a,o]=k.useState(!1),[l,u]=k.useState(Et),[c,d]=k.useState("initial"),[m,h]=k.useState(null),[p,w]=k.useState({}),b=Array.isArray(e.tools)?e.tools:[],C=()=>{u({...Et,id:Date.now().toString()}),h(null),w({}),d("initial"),o(!0)},g=v=>{v.tool_type==="builtin-group"?d("builtin-group"):v.tool_type==="builtin"?d("builtin-tool"):d("custom");const N={...Et,...v,id:v.id||Date.now().toString(),tool_type:v.tool_type||"",connection_params_str:v.connection_params?JSON.stringify(v.connection_params,null,2):"{}",environment_variables_str:v.environment_variables?JSON.stringify(v.environment_variables,null,2):"{}",tool_config_str:v.tool_config?JSON.stringify(v.tool_config,null,2):"{}",required_scopes:Array.isArray(v.required_scopes)?v.required_scopes:[]};u(N),h(v.id||null),w({}),o(!0)},_=v=>{const{name:N,value:z}=v.target;if(u(S=>({...S,[N]:z})),N==="connection_params_str"||N==="environment_variables_str"||N==="tool_config_str")if(z.trim()===""||z.trim()==="{}")w(S=>({...S,[N]:void 0}));else try{const S=JSON.parse(z);typeof S!="object"||S===null||Array.isArray(S)?w(F=>({...F,[N]:"Must be a valid JSON object."})):N==="connection_params_str"&&(!S.type||!S.command||!S.args)?w(F=>({...F,[N]:"Connection parameters must include type, command, and args."})):w(F=>({...F,[N]:void 0}))}catch{w(F=>({...F,[N]:"Invalid JSON format."}))}},A=(v,N)=>{u(z=>({...z,[v]:N}))},R=()=>{const v={};if(l.tool_type||(v.tool_type="Tool type is required."),l.tool_type==="builtin-group"?l.group_name||(v.group_name="Group name is required."):l.tool_type==="builtin"?l.tool_name||(v.tool_name="Tool name is required."):l.tool_type==="python"?(l.component_module||(v.component_module="Component module is required."),l.function_name||(v.function_name="Function name is required.")):l.tool_type==="mcp"&&(!l.connection_params_str||l.connection_params_str.trim()==="{}")&&(v.connection_params_str="Connection parameters are required for MCP tools."),l.connection_params_str)try{Le(l.connection_params_str,void 0)}catch{v.connection_params_str="Invalid JSON format for Connection Parameters."}if(l.environment_variables_str)try{Le(l.environment_variables_str,void 0)}catch{v.environment_variables_str="Invalid JSON format for Environment Variables."}if(l.tool_config_str)try{Le(l.tool_config_str,void 0)}catch{v.tool_config_str="Invalid JSON format for Tool Config."}return w(v),Object.keys(v).length===0},L=()=>{if(!R())return;const v={id:l.id||Date.now().toString(),tool_type:l.tool_type};let N;switch(l.tool_type){case"builtin-group":N={...v,group_name:l.group_name};break;case"builtin":N={...v,tool_name:l.tool_name};break;case"python":N={...v,tool_name:l.tool_name||void 0,tool_description:l.tool_description||void 0,component_module:l.component_module||void 0,function_name:l.function_name||void 0,component_base_path:l.component_base_path||void 0,tool_config:Le(l.tool_config_str,void 0),required_scopes:l.required_scopes||[]};break;case"mcp":N={...v,tool_name:l.tool_name||void 0,connection_params:Le(l.connection_params_str,void 0),environment_variables:Le(l.environment_variables_str,void 0),tool_config:Le(l.tool_config_str,void 0),required_scopes:l.required_scopes||[]};break;default:o(!1);return}let z;m?z=b.map(S=>S.id===m?N:S):z=[...b,N],t({tools:z}),o(!1),h(null)},y=v=>{v&&t({tools:b.filter(N=>N.id!==v)})},I=v=>{const N=[];return v.tool_type==="builtin-group"?N.push(`Group: ${v.group_name}`):v.tool_name?N.push(`Name: ${v.tool_name}`):v.tool_type==="python"&&v.function_name&&N.push(`Func: ${v.function_name}`),v.component_module&&N.push(`Module: ${v.component_module}`),N.join(", ")||"No details"};return r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{children:"Define custom tools for your agent. Tools can be Python functions, MCP servers, or built-in ADK capabilities. The final tools configuration will be submitted as a list of tool objects."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Custom Tools"}),r.jsx(Y,{onClick:C,variant:"secondary",children:"+ Add Tool"}),b.length>0?r.jsx("div",{className:"mt-4 space-y-3",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 border",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Details"}),r.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:b.map((v,N)=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-700",children:v.tool_type}),r.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-500 max-w-xs truncate",title:I(v),children:I(v)}),r.jsxs("td",{className:"px-4 py-2 whitespace-nowrap text-sm space-x-2",children:[r.jsx(Y,{onClick:()=>g(v),variant:"outline",children:"Edit"}),r.jsx(Y,{onClick:()=>y(v.id),variant:"outline",className:"text-red-600 border-red-300 hover:bg-red-50",children:"Delete"})]})]},v.id||N))})]})}):r.jsx("p",{className:"text-gray-500 mt-4",children:"No tools configured yet."}),a&&r.jsx(Cr,{title:m?"Edit Tool":"Add New Tool",onClose:()=>o(!1),children:r.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto p-1",children:[c==="initial"&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm text-gray-600",children:"What kind of tool do you want to add?"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"builtin-group"})),d("builtin-group")},variant:"secondary",className:"w-full justify-start",children:"Group of Built-in Tools"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"builtin"})),d("builtin-tool")},variant:"secondary",className:"w-full justify-start",children:"Single Built-in Tool"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"python"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"Python Tool"}),r.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"mcp"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"MCP Tool"})]}),c==="builtin-group"&&r.jsx(P,{label:"Built-in Tool Group",htmlFor:"group_name",error:p.group_name,required:!0,children:r.jsx(se,{id:"group_name",name:"group_name",value:l.group_name||"",onChange:_,options:[{value:"",label:"Select a group..."},...s&&"groups"in s&&s.groups?Object.keys(s.groups).map(v=>({value:v,label:`${v.replace(/_/g," ").replace(/\b\w/g,N=>N.toUpperCase())} - ${s.groups[v].description}`})):[]]})}),c==="builtin-tool"&&r.jsx(P,{label:"Built-in Tool Name",htmlFor:"tool_name",error:p.tool_name,required:!0,children:r.jsx(wr,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_,suggestions:s&&"tools"in s&&s.tools?Object.keys(s.tools):[],placeholder:"Select a built-in tool..."})}),c==="custom"&&r.jsxs(r.Fragment,{children:[l.tool_type==="python"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Optional: A descriptive name for this Python tool. Overwrites the python function name",children:r.jsx(G,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_})}),r.jsx(P,{label:"Tool Description (Optional)",htmlFor:"tool_description",error:p.tool_description,helpText:"Optional: A brief description of what this tool does. Overwrites the python function docs",children:r.jsx(G,{id:"tool_description",name:"tool_description",value:l.tool_description||"",onChange:_,placeholder:"e.g., Fetch user profile data"})}),r.jsx(P,{label:"Component Module",htmlFor:"component_module",error:p.component_module,required:!0,children:r.jsx(G,{id:"component_module",name:"component_module",value:l.component_module||"",onChange:_,placeholder:"e.g., my_agent.custom_tools"})}),r.jsx(P,{label:"Function Name",htmlFor:"function_name",error:p.function_name,required:!0,children:r.jsx(G,{id:"function_name",name:"function_name",value:l.function_name||"",onChange:_,placeholder:"e.g., my_tool_function"})}),r.jsx(P,{label:"Component Base Path (Optional)",htmlFor:"component_base_path",error:p.component_base_path,helpText:"Base path for module resolution if not in PYTHONPATH.",children:r.jsx(G,{id:"component_base_path",name:"component_base_path",value:l.component_base_path||"",onChange:_,placeholder:"e.g., src/plugins"})})]}),l.tool_type==="mcp"&&r.jsxs(r.Fragment,{children:[r.jsx(P,{label:"MCP Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Name of the specific MCP tool (optional if using all tools from MCP server)",children:r.jsx(G,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_})}),r.jsx(P,{label:"Connection Parameters (JSON)",htmlFor:"connection_params_str",error:p.connection_params_str,helpText:'E.g., {"type": "stdio", "command": "cmd", "args":[]}',children:r.jsx("textarea",{id:"connection_params_str",name:"connection_params_str",rows:4,value:l.connection_params_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})}),r.jsx(P,{label:"Environment Variables (JSON, Optional)",htmlFor:"environment_variables_str",error:p.environment_variables_str,children:r.jsx("textarea",{id:"environment_variables_str",name:"environment_variables_str",rows:3,value:l.environment_variables_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})})]})]}),(c==="builtin-tool"||c==="custom")&&r.jsxs(r.Fragment,{children:[r.jsx(Ae,{id:"required_scopes",label:"Required Scopes (Optional)",values:l.required_scopes||[],onChange:v=>A("required_scopes",v),helpText:"Enter required OAuth scopes and press Add.",placeholder:"No scopes added yet.",inputPlaceholder:"e.g., read:profile"}),r.jsx(P,{label:"Tool Config (JSON, Optional)",htmlFor:"tool_config_str",error:p.tool_config_str,helpText:"Tool-specific configuration like API keys, model names etc.",children:r.jsx("textarea",{id:"tool_config_str",name:"tool_config_str",rows:3,value:l.tool_config_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})})]}),c!=="initial"&&r.jsxs("div",{className:"flex justify-end space-x-2 mt-6 pt-4 border-t",children:[r.jsx(Y,{onClick:()=>o(!1),variant:"outline",children:"Cancel"}),r.jsx(Y,{onClick:L,children:m?"Update Tool":"Add Tool"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx(Y,{type:"button",onClick:i,variant:"outline",children:"Previous"}),r.jsx(Y,{type:"button",onClick:n,children:"Next"})]})]})},Wi=[{value:"ignore",label:"Ignore (Do not include artifacts in A2A messages)"},{value:"embed",label:"Embed (Include base64 artifact data in A2A messages)"},{value:"reference",label:"Reference (Include artifact fetch URI in A2A messages)"}],Gi=({data:e,updateData:t,onNext:n,onPrevious:i})=>r.jsxs("div",{className:"space-y-6",children:[r.jsx(Ee,{children:"Configure various features and behaviors for your agent, such as built-in tools and how artifacts are handled."}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Built-in Tools & Features"}),r.jsx(P,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",helpText:"How artifacts created by this agent are represented in A2A messages.",children:r.jsx(se,{id:"artifact_handling_mode",name:"artifact_handling_mode",value:e.artifact_handling_mode||"ignore",onChange:s=>t({artifact_handling_mode:s.target.value}),options:Wi})}),r.jsxs("div",{className:"space-y-3 mt-4",children:[r.jsx(P,{label:"",htmlFor:"enable_embed_resolution",children:r.jsx(be,{id:"enable_embed_resolution",checked:e.enable_embed_resolution===void 0?!0:!!e.enable_embed_resolution,onChange:s=>t({enable_embed_resolution:s}),label:"Enable Embed Resolution (for dynamic content like state, math in prompts)"})}),r.jsx(P,{label:"",htmlFor:"enable_artifact_content_instruction",children:r.jsx(be,{id:"enable_artifact_content_instruction",checked:e.enable_artifact_content_instruction===void 0?!0:!!e.enable_artifact_content_instruction,onChange:s=>t({enable_artifact_content_instruction:s}),label:"Enable Artifact Content Instruction (for late-stage artifact content embedding)"})})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]}),Ji=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),Yi=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),Xi=({data:e,updateData:t,onNext:n,onPrevious:i})=>{const[s,a]=k.useState(!1),[o,l]=k.useState(null),[u,c]=k.useState(null),[d,m]=k.useState({}),[h,p]=k.useState(null);k.useEffect(()=>{s&&(o?(m(o),c(o.id)):(m({}),c(null)),p(null))},[o,s]);const w=y=>{const{name:I,value:v,type:N}=y.target,z=N==="checkbox"?y.target.checked:v;t({[I]:z})},b=y=>{const{name:I,value:v}=y.target;m(N=>({...N,[I]:v}))},C=()=>{if(!d.id||d.id.trim()===""||!d.name||d.name.trim()===""||!d.description||d.description.trim()===""){p("Skill ID, Name, and Description are required and cannot be empty.");return}p(null);const y=Array.isArray(e.agent_card_skills)?[...e.agent_card_skills]:[],I=d.id,v=y.findIndex(N=>N.id===I);if(o){if(u!==I&&v!==-1){p(`Skill ID "${I}" already exists. Please use a unique ID.`);return}const N=y.findIndex(z=>z.id===u);if(N!==-1)y[N]={...d};else{p("Error finding the original skill to update.");return}}else{if(v!==-1){p(`Skill ID "${I}" already exists. Please use a unique ID.`);return}y.push({...d})}t({agent_card_skills:y}),a(!1),l(null),c(null)},g=y=>{l(y),a(!0)},_=()=>{l(null),a(!0)},A=y=>{const I=Array.isArray(e.agent_card_skills)?e.agent_card_skills:[];t({agent_card_skills:I.filter(v=>v.id!==y)})},R=y=>{const{name:I,value:v}=y.target;t({[I]:v===""?void 0:Number(v)})},L="A helpful assistant capable of complex tasks.";return r.jsxs("div",{className:"space-y-6",children:[r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Agent Card & Discovery"}),r.jsx(P,{label:"Agent Card Description",htmlFor:"agent_card_description",helpText:"A concise description of the agent's capabilities.",children:r.jsx("textarea",{id:"agent_card_description",name:"agent_card_description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:e.agent_card_description||L,onChange:w,placeholder:L})}),r.jsx(Ae,{id:"agent_card_default_input_modes",label:"Default Input Modes",values:e.agent_card_default_input_modes||[],onChange:y=>t({agent_card_default_input_modes:y}),helpText:"Enter input modes (e.g., text, file) and press Add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),r.jsx(Ae,{id:"agent_card_default_output_modes",label:"Default Output Modes",values:e.agent_card_default_output_modes||[],onChange:y=>t({agent_card_default_output_modes:y}),helpText:"Enter output modes (e.g., text, file) and press Add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., file"}),r.jsxs(P,{label:"Skills",htmlFor:"add_skill_button",children:[r.jsx("div",{className:"mb-2",children:r.jsx(Y,{type:"button",variant:"outline",onClick:_,children:"Add New Skill"})}),e.agent_card_skills&&e.agent_card_skills.length>0?r.jsx("div",{className:"overflow-x-auto border rounded-md",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 text-sm",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"ID"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Name"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Description"}),r.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.agent_card_skills.map(y=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-3 py-2 whitespace-nowrap font-mono text-xs",children:y.id}),r.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:y.name}),r.jsx("td",{className:"px-3 py-2 break-words max-w-xs",children:y.description}),r.jsxs("td",{className:"px-3 py-2 whitespace-nowrap space-x-2",children:[r.jsx(Y,{variant:"secondary",onClick:()=>g(y),"aria-label":"Edit skill",children:r.jsx(Ji,{})}),r.jsx(Y,{variant:"secondary",onClick:()=>A(y.id),className:"text-red-600 hover:text-red-800","aria-label":"Delete skill",children:r.jsx(Yi,{})})]})]},y.id))})]})}):r.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"No skills defined yet."})]}),r.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Discovery & Communication"}),r.jsx(P,{label:"Agent Card Publishing Interval (seconds)",htmlFor:"agent_card_publishing_interval",helpText:"Set to 0 to disable periodic publishing.",children:r.jsx(G,{id:"agent_card_publishing_interval",name:"agent_card_publishing_interval",type:"number",value:e.agent_card_publishing_interval===void 0?"10":String(e.agent_card_publishing_interval),onChange:R,placeholder:"10"})}),r.jsx(P,{label:"",htmlFor:"agent_discovery_enabled",children:r.jsx(be,{id:"agent_discovery_enabled",checked:e.agent_discovery_enabled===void 0?!1:!!e.agent_discovery_enabled,onChange:y=>t({agent_discovery_enabled:y}),label:"Enable Agent Discovery (allows this agent to find and delegate to peers)"})}),r.jsx(Ae,{id:"inter_agent_communication_allow_list",label:"Inter-Agent Allow List",values:e.inter_agent_communication_allow_list||[],onChange:y=>t({inter_agent_communication_allow_list:y}),helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*).",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),r.jsx(Ae,{id:"inter_agent_communication_deny_list",label:"Inter-Agent Deny List",values:e.inter_agent_communication_deny_list||[],onChange:y=>t({inter_agent_communication_deny_list:y}),helpText:"Agent name patterns to deny delegation to.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),r.jsx(P,{label:"Inter-Agent Request Timeout (seconds)",htmlFor:"inter_agent_communication_timeout",children:r.jsx(G,{id:"inter_agent_communication_timeout",name:"inter_agent_communication_timeout",type:"number",value:e.inter_agent_communication_timeout===void 0?"30":String(e.inter_agent_communication_timeout),onChange:R,placeholder:"30"})}),s&&r.jsx(Cr,{onClose:()=>{a(!1),l(null),c(null)},title:o?"Edit Skill":"Add New Skill",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx(P,{label:"Skill ID (e.g., function_name)",htmlFor:"skill_id",required:!0,helpText:"Unique identifier for the skill.",children:r.jsx(G,{id:"skill_id",name:"id",value:d.id||"",onChange:b,placeholder:"e.g., getWeather",disabled:!1})}),r.jsx(P,{label:"Skill Name (Display Name)",htmlFor:"skill_name",required:!0,children:r.jsx(G,{id:"skill_name",name:"name",value:d.name||"",onChange:b,placeholder:"e.g., Data Analysis"})}),r.jsx(P,{label:"Skill Description",htmlFor:"skill_description",required:!0,children:r.jsx("textarea",{id:"skill_description",name:"description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:d.description||"",onChange:b,placeholder:"e.g., Can analyze CSV data and generate reports."})}),h&&r.jsx("p",{className:"text-sm text-red-600",children:h}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-2",children:[r.jsx(Y,{type:"button",variant:"secondary",onClick:()=>{a(!1),l(null),c(null)},children:"Cancel"}),r.jsx(Y,{type:"button",onClick:C,children:o?"Update Skill":"Add Skill"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},$i=({data:e,updateData:t,onPrevious:n,serverUrl:i=""})=>{const s=async()=>{console.log("Submitting agent configuration:",e);try{const a=JSON.parse(JSON.stringify(e));if(!Array.isArray(a.agent_card_skills)&&a.agent_card_skills_str)try{const c=JSON.parse(a.agent_card_skills_str);Array.isArray(c)?a.agent_card_skills=c:(console.warn("Parsed agent_card_skills_str was not an array, ensuring agent_card_skills is empty array."),a.agent_card_skills=[])}catch(c){console.warn("Could not parse agent_card_skills_str as JSON, ensuring agent_card_skills is empty array.",c),a.agent_card_skills=[]}else Array.isArray(a.agent_card_skills)||(a.agent_card_skills=[]);delete a.agent_card_skills_str,Array.isArray(a.tools)&&(a.tools=a.tools.map(c=>{const d={};return c.tool_type&&(d.tool_type=c.tool_type),c.tool_name&&(d.tool_name=c.tool_name),c.tool_description&&(d.tool_description=c.tool_description),c.group_name&&(d.group_name=c.group_name),c.component_module&&(d.component_module=c.component_module),c.function_name&&(d.function_name=c.function_name),c.component_base_path&&(d.component_base_path=c.component_base_path),c.connection_params&&(d.connection_params=c.connection_params),c.environment_variables&&(d.environment_variables=c.environment_variables),c.required_scopes&&c.required_scopes.length>0&&(d.required_scopes=c.required_scopes),c.tool_config&&(d.tool_config=c.tool_config),d.tool_type?d:(console.error("Tool is missing tool_type:",c),null)}).filter(c=>c!==null));const o={agent_name_input:e.agent_name,config:a},l=await fetch(`${i}/api/save_agent_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),u=await l.json();l.ok&&u.status==="success"?(setTimeout(async()=>{try{await fetch(`${i}/api/shutdown`,{method:"POST"})}catch{}},200),t&&t({showSuccessScreen_agent:!0})):alert(`Error saving agent: ${u.message||"Unknown error"}`)}catch(a){alert(`Failed to save agent: ${a instanceof Error?a.message:String(a)}`)}};return r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Review and Submit Agent Configuration"}),r.jsx("pre",{className:"bg-gray-100 p-3 rounded overflow-x-auto text-xs max-h-96",children:JSON.stringify(e,null,2)}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),r.jsx("button",{onClick:s,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",children:"Save Agent & Finish"})]})]})},ot=[{id:"agent-basic",title:"Basic Info",description:"Name, model, instruction",component:zi},{id:"agent-services",title:"Services",description:"Session & artifact services",component:Hi},{id:"agent-features",title:"Features",description:"Enable built-in features",component:Gi},{id:"agent-tools",title:"Custom Tools",description:"Define custom tools for the agent",component:Vi},{id:"agent-card",title:"Agent Card & Comms",description:"Discovery and communication settings",component:Xi},{id:"agent-review",title:"Review & Submit",description:"Review and save configuration",component:$i}];function Qi(){var b;const[e,t]=k.useState(0),[n,i]=k.useState({}),[s,a]=k.useState(!0),[o,l]=k.useState(null),[u,c]=k.useState([]),d="";k.useEffect(()=>{Promise.all([fetch("/api/form_schema?type=agent"),fetch("/api/available_tools")]).then(async([C,g])=>{if(!C.ok)throw new Error(`Failed to fetch agent form schema (status: ${C.status})`);if(!g.ok)throw new Error(`Failed to fetch available tools (status: ${g.status})`);const _=await C.json(),A=await g.json();if((_==null?void 0:_.status)!=="success"||!(_!=null&&_.defaults))throw new Error((_==null?void 0:_.message)||"Invalid response for agent form schema");if((A==null?void 0:A.status)!=="success")throw new Error((A==null?void 0:A.message)||"Invalid response for available tools");c(A);const R=_.defaults,L={...R,agent_card_default_input_modes:(R.agent_card_default_input_modes_str||"text").split(",").map(y=>y.trim()).filter(Boolean),agent_card_default_output_modes:(R.agent_card_default_output_modes_str||"text,file").split(",").map(y=>y.trim()).filter(Boolean),inter_agent_communication_allow_list:(R.inter_agent_communication_allow_list_str||"*").split(",").map(y=>y.trim()).filter(Boolean),inter_agent_communication_deny_list:(R.inter_agent_communication_deny_list_str||"").split(",").map(y=>y.trim()).filter(Boolean),agent_card_skills_str:R.agent_card_skills_str||"[]",agent_card_skills:[],tools:Array.isArray(R.tools)?R.tools:[],showSuccessScreen_agent:!1};delete L.agent_card_default_input_modes_str,delete L.agent_card_default_output_modes_str,delete L.inter_agent_communication_allow_list_str,delete L.inter_agent_communication_deny_list_str;try{const y=JSON.parse(L.agent_card_skills_str||"[]");Array.isArray(y)&&(L.agent_card_skills=y.filter(I=>typeof I=="object"&&I!==null&&"id"in I&&typeof I.id=="string"&&"name"in I&&typeof I.name=="string"&&"description"in I&&typeof I.description=="string"))}catch(y){console.warn("Could not parse agent_card_skills_str from defaults:",y),L.agent_card_skills=[]}i(L)}).catch(C=>{console.error("Error fetching initial data:",C),l(`Failed to load agent configuration form: ${C instanceof Error?C.message:String(C)}`)}).finally(()=>a(!1))},[]);const m=k.useCallback(C=>{i(g=>({...g,...C}))},[]);k.useEffect(()=>{if(s)return;const C=[];C.push({id:"default-artifact-management",tool_type:"builtin-group",group_name:"artifact_management"}),m({tools:C})},[m,s]);const h=k.useCallback(()=>{e<ot.length-1&&t(C=>C+1)},[e]),p=k.useCallback(()=>{e>0&&t(C=>C-1)},[e]);if(s)return r.jsx("div",{className:"text-center p-10",children:"Loading agent configuration form..."});if(o)return r.jsx("div",{className:"text-center p-10 text-red-600",children:r.jsxs("p",{children:["Error: ",o]})});if(n.showSuccessScreen_agent){let C="Agent Configured Successfully!";return n.agent_name&&(C=`Agent "${n.agent_name}" configured successfully!`),r.jsx("div",{className:"max-w-2xl mx-auto p-6",children:r.jsx(tn,{title:C,message:"Your new agent configuration has been saved.",initTab:"tutorials"})})}const w=(b=ot[e])==null?void 0:b.component;return w?r.jsxs("div",{className:"max-w-2xl mx-auto p-4",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center text-solace-purple",children:"Add New Agent"}),ot.length>1&&r.jsx("div",{className:"mb-8",children:r.jsx(en,{steps:ot,currentStepIndex:e})}),r.jsx("div",{className:"bg-white rounded-lg shadow-xl p-6 min-h-[500px]",children:r.jsx(w,{data:n,updateData:m,onNext:h,onPrevious:p,serverUrl:d,availableTools:u})})]}):r.jsxs("div",{className:"text-center p-10 text-red-600",children:["Error: Configuration step not found for index ",e,"."]})}/**
|
|
36
36
|
* @license lucide-react v0.542.0 - ISC
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__remixManifest={"entry":{"module":"/assets/entry.client-mvZjNKiz.js","imports":["/assets/index-DzNKzXrc.js","/assets/components-Rk0n-9cK.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/root-BWvk5-gF.js","imports":["/assets/index-DzNKzXrc.js","/assets/components-Rk0n-9cK.js"],"css":["/assets/root-DxRwaWiE.css"]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_index-
|
|
1
|
+
window.__remixManifest={"entry":{"module":"/assets/entry.client-mvZjNKiz.js","imports":["/assets/index-DzNKzXrc.js","/assets/components-Rk0n-9cK.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/root-BWvk5-gF.js","imports":["/assets/index-DzNKzXrc.js","/assets/components-Rk0n-9cK.js"],"css":["/assets/root-DxRwaWiE.css"]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_index-BNuqpWDc.js","imports":["/assets/index-DzNKzXrc.js"],"css":[]}},"url":"/assets/manifest-44d62be6.js","version":"44d62be6"};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/assets/root-DxRwaWiE.css"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"/></head><body><p>Loading...</p><link rel="modulepreload" href="/assets/manifest-
|
|
2
|
+
<html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/assets/root-DxRwaWiE.css"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"/></head><body><p>Loading...</p><link rel="modulepreload" href="/assets/manifest-44d62be6.js"/><link rel="modulepreload" href="/assets/entry.client-mvZjNKiz.js"/><link rel="modulepreload" href="/assets/index-DzNKzXrc.js"/><link rel="modulepreload" href="/assets/components-Rk0n-9cK.js"/><link rel="modulepreload" href="/assets/root-BWvk5-gF.js"/><script>window.__remixContext = {"basename":"/","future":{"v3_fetcherPersist":false,"v3_relativeSplatPath":false,"v3_throwAbortReason":false,"v3_routeConfig":false,"v3_singleFetch":false,"v3_lazyRouteDiscovery":false,"unstable_optimizeDeps":false},"isSpaMode":true,"state":{"loaderData":{"root":null,"routes/_index":null},"actionData":null,"errors":null}};</script><script type="module" async="">import "/assets/manifest-44d62be6.js";
|
|
3
3
|
import * as route0 from "/assets/root-BWvk5-gF.js";
|
|
4
4
|
|
|
5
5
|
window.__remixRouteModules = {"root":route0};
|