solace-agent-mesh 0.2.1__py3-none-any.whl → 0.2.2__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.

Files changed (28) hide show
  1. solace_agent_mesh/agents/global/actions/plantuml_diagram.py +94 -36
  2. solace_agent_mesh/cli/__init__.py +1 -1
  3. solace_agent_mesh/cli/commands/add/agent.py +1 -1
  4. solace_agent_mesh/cli/commands/add/copy_from_plugin.py +1 -1
  5. solace_agent_mesh/cli/commands/add/gateway.py +2 -2
  6. solace_agent_mesh/cli/commands/init/check_if_already_done.py +1 -1
  7. solace_agent_mesh/cli/commands/init/init.py +17 -48
  8. solace_agent_mesh/cli/commands/init/web_init_step.py +32 -0
  9. solace_agent_mesh/cli/commands/plugin/create.py +3 -3
  10. solace_agent_mesh/cli/main.py +6 -0
  11. solace_agent_mesh/config_portal/frontend/static/client/Solace_community_logo.png +0 -0
  12. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-b13CSm84.js +42 -0
  13. solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-8147e469.js → manifest-c92a7808.js} +1 -1
  14. solace_agent_mesh/config_portal/frontend/static/client/assets/root-DX4gQ516.css +1 -0
  15. solace_agent_mesh/config_portal/frontend/static/client/index.html +2 -2
  16. solace_agent_mesh/orchestrator/components/orchestrator_stimulus_processor_component.py +18 -1
  17. solace_agent_mesh/services/history_service/history_providers/sql_history_provider.py +1 -1
  18. solace_agent_mesh/services/llm_service/components/llm_request_component.py +54 -31
  19. solace_agent_mesh/templates/rest-api-default-config.yaml +4 -2
  20. solace_agent_mesh/templates/web-default-config.yaml +4 -2
  21. {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.2.dist-info}/METADATA +2 -2
  22. {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.2.dist-info}/RECORD +26 -24
  23. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-DRPGOzHj.js +0 -42
  24. solace_agent_mesh/config_portal/frontend/static/client/assets/root-hhS5izs8.css +0 -1
  25. /solace_agent_mesh/config_portal/frontend/static/client/assets/{root-DgMDqKDc.js → root-BApq5dPK.js} +0 -0
  26. {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.2.dist-info}/WHEEL +0 -0
  27. {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.2.dist-info}/entry_points.txt +0 -0
  28. {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.2.dist-info}/licenses/LICENSE +0 -0
@@ -3,6 +3,8 @@
3
3
  import platform
4
4
  import os
5
5
  import tempfile
6
+ import uuid
7
+ import shutil
6
8
  import subprocess
7
9
 
8
10
  from solace_ai_connector.common.log import log
@@ -11,11 +13,51 @@ from ....common.action_response import ActionResponse
11
13
  from ....services.file_service import FileService
12
14
 
13
15
  PLANTUML_PROMPT = """Generate a PlantUML markup language for the given description by the user. Supports sequence diagrams, class diagrams, use case diagrams, activity diagrams, component diagrams, state diagrams, and timing diagrams. Newlines must be escaped with a backslash and put quotes around participants names. Respond only with PlantUML markup, do not include any other text, symbols or quotes.
14
- Rules to follow for sequence diagrams:
15
- - Do not use variables if they are not declared as participants.
16
- - Only use notes to cover one or two participants per line.
17
- - Do not use the `activate` or `deactivate` commands directly after a delay notation (`...`), whether directly or with a note in between.
18
- - Do not use the `activate` or `deactivate` commands twice in a row, whether directly or with a note in between.
16
+
17
+ Rules to follow for all diagrams:
18
+ - Always include @startuml at the beginning and @enduml at the end
19
+ - Use simple quotes for names, not double quotes
20
+ - Avoid using <<stereotype>> syntax in state diagrams unless absolutely necessary
21
+ - For state diagrams, use simple state names without spaces (like LoginScreen instead of "Login Screen")
22
+ - If you need descriptive names, use the 'as' keyword (e.g., [*] --> LoginScreen as "Login Screen")
23
+ - Don't use variables if they are not declared
24
+ - Never skip lines
25
+ - For notes in all diagrams:
26
+ - Use the simple syntax: `note over Participant: Text` without any positioning numbers
27
+ - Do not use positioning numbers (like `at 25`) in note commands
28
+ - Never combine multiple participants in a single note
29
+
30
+ Rules for sequence diagrams:
31
+ - Only use notes to cover one or two participants per line
32
+ - Do not use the `activate` or `deactivate` commands directly after a delay notation (`...`), whether directly or with a note in between
33
+ - Do not use the `activate` or `deactivate` commands twice in a row, whether directly or with a note in between
34
+
35
+ Rules for activity diagrams:
36
+ - Do not use the `backward:` keyword for loops or returning to previous steps
37
+ - Instead, use the label and goto pattern:
38
+ 1. Add a label to the target activity: `label label_name`
39
+ 2. Use goto to reference that label: `goto label_name`
40
+ - Always place labels immediately after the activity they refer to
41
+ - Labels should use lowercase with underscores for readability (e.g., `label browse_products`)
42
+
43
+ Rules for state diagrams:
44
+ - Use simple state names without spaces and without quotes
45
+ - When stereotypes are absolutely necessary, use the correct syntax:
46
+ - For existing states: `state StateName <<stereotype>>`
47
+ - For new states with descriptions: `state "Description" as StateName <<stereotype>>`
48
+ - Always place stereotypes after the state name, not before
49
+ - If using skinparam for stereotype styling, ensure it's properly defined: `skinparam state \{ BackgroundColor<<stereotype>> Color\}
50
+ - For notes in state diagrams:
51
+ - Do NOT use `note over StateName` syntax (this is for sequence diagrams)
52
+ - Instead use directional positioning: `note left of StateName`, `note right of StateName`, `note top of StateName`, or `note bottom of StateName`
53
+ - Example: `note left of OrderCreated : Initial customer order`
54
+
55
+ Rules for timing diagrams:
56
+ - Never include notes
57
+ - For 'robust' participants, use named states instead of symbolic states
58
+ - CORRECT: `PS is "ON"` or `PS is ON`
59
+ - INCORRECT: `PS is {+}` or `PS is {-}`
60
+ - For 'concise' participants, use numeric values (e.g., `BP is 10`)
19
61
  """
20
62
 
21
63
 
@@ -42,10 +84,6 @@ class PlantUmlDiagram(Action):
42
84
  )
43
85
 
44
86
  def invoke(self, params, meta={}) -> ActionResponse:
45
- if platform.system() == "Windows":
46
- return ActionResponse(
47
- message=f"Unfortunately, the PlantUML is not available on {platform.system()}"
48
- )
49
87
  # Do a local command to run plantuml -tpng
50
88
  description = params.get("diagram_description")
51
89
  agent = self.get_agent()
@@ -70,34 +108,54 @@ class PlantUmlDiagram(Action):
70
108
  if not expression.endswith("@enduml"):
71
109
  expression = f"{expression}\n@enduml"
72
110
  log.debug("PlantUML expression: %s", expression)
73
- img_path = None
74
111
  files = []
75
- with tempfile.NamedTemporaryFile(delete=True) as temp:
76
- temp.write(expression.encode())
77
- temp.flush()
78
- dir_path = os.path.dirname(temp.name)
79
- img_path = f"{dir_path}/{os.path.basename(temp.name)}.png"
80
-
81
- try:
82
- subprocess.run(
83
- ["plantuml", "-tpng", temp.name, "-o", dir_path],
84
- check=True,
85
- capture_output=True,
86
- text=True,
87
- )
88
- file_service = FileService()
89
- file_meta = file_service.upload_from_file(
90
- img_path,
91
- meta.get("session_id"),
92
- data_source="Global Agent - PlantUML Action",
93
- )
94
- files.append(file_meta)
95
-
96
- except subprocess.CalledProcessError as e:
97
- log.error("Subprocess failed with stderr: %s", e.stderr)
98
- return ActionResponse(
99
- message=f"Failed to create diagram: {e.stderr}",
100
- )
112
+
113
+ try:
114
+ temp_dir = tempfile.mkdtemp()
115
+ # Create a unique filename with .puml extension
116
+ diagram_id = str(uuid.uuid4())
117
+ puml_filename = f"diagram_{diagram_id}.puml"
118
+ puml_path = os.path.join(temp_dir, puml_filename)
119
+ png_path = os.path.join(temp_dir, f"diagram_{diagram_id}.png")
120
+
121
+ # Write PlantUML content to input file
122
+ with open(puml_path, 'w', encoding='utf-8') as f:
123
+ f.write(expression)
124
+
125
+ # Run PlantUML
126
+ subprocess.run(
127
+ ["plantuml", "-tpng", puml_path, "-o", temp_dir],
128
+ shell=platform.system() == "Windows",
129
+ check=True,
130
+ capture_output=True,
131
+ text=True,
132
+ )
133
+
134
+ # Upload the generated image
135
+ file_service = FileService()
136
+ file_meta = file_service.upload_from_file(
137
+ png_path,
138
+ meta.get("session_id"),
139
+ data_source="Global Agent - PlantUML Action",
140
+ )
141
+ files.append(file_meta)
142
+
143
+ except FileNotFoundError as e:
144
+ log.error("PlantUML executable not found: %s", str(e))
145
+ return ActionResponse(
146
+ message="PlantUML executable not found. Please ensure PlantUML is installed and available in PATH.",
147
+ )
148
+ except subprocess.CalledProcessError as e:
149
+ log.error("Subprocess failed with stderr: %s", str(e))
150
+ return ActionResponse(
151
+ message=f"Failed to create diagram: {str(e)}",
152
+ )
153
+ finally:
154
+ if 'temp_dir' in locals() and os.path.exists(temp_dir):
155
+ try:
156
+ shutil.rmtree(temp_dir) # Remove directory and all contents
157
+ except:
158
+ pass
101
159
 
102
160
  return ActionResponse(
103
161
  message=f"diagram created with the plantUML: \n```\n{expression}\n```",
@@ -1 +1 @@
1
- __version__ = "0.2.1"
1
+ __version__ = "0.2.2"
@@ -101,7 +101,7 @@ def add_agent_command(name):
101
101
 
102
102
  click.echo(f"Created sample action at: {get_display_path(action_path)}")
103
103
 
104
- temp_file = os.path.join(config_directory, "__TEMPLATES_WILL_BE_HERE__")
104
+ temp_file = os.path.join(config_directory, ".gitkeep")
105
105
  if os.path.exists(temp_file):
106
106
  os.remove(temp_file)
107
107
  except IOError as e:
@@ -83,7 +83,7 @@ def copy_from_plugin(name, plugin_name, entity_type):
83
83
  log_error("Invalid entity type.")
84
84
  return 1
85
85
 
86
- temp_file = os.path.join(config_directory, "__TEMPLATES_WILL_BE_HERE__")
86
+ temp_file = os.path.join(config_directory, ".gitkeep")
87
87
  if os.path.exists(temp_file):
88
88
  os.remove(temp_file)
89
89
 
@@ -289,7 +289,7 @@ def add_gateway_command(name, interfaces):
289
289
 
290
290
  created_file_names.append(gateway_config_path)
291
291
 
292
- temp_file = os.path.join(config_directory, "__TEMPLATES_WILL_BE_HERE__")
292
+ temp_file = os.path.join(config_directory, ".gitkeep")
293
293
  if os.path.exists(temp_file):
294
294
  os.remove(temp_file)
295
295
 
@@ -328,7 +328,7 @@ def add_interface_command(name):
328
328
  try:
329
329
  os.makedirs(interfaces_directory, exist_ok=True)
330
330
 
331
- temp_file = os.path.join(interfaces_directory, "__INTERFACES_WILL_BE_HERE__")
331
+ temp_file = os.path.join(interfaces_directory, ".gitkeep")
332
332
  if os.path.exists(temp_file):
333
333
  os.remove(temp_file)
334
334
 
@@ -9,5 +9,5 @@ def check_if_already_done(options, default_options, none_interactive, abort):
9
9
  config_path = Config.user_config_file
10
10
  if os.path.exists(config_path):
11
11
  abort(
12
- "The project has already been initialized. If you want to reinitialize the project, please delete the solace-agent-mesh.yaml file."
12
+ "The project has already been initialized. If you want to reinitialize the project, please delete the solace-agent-mesh.yaml file"
13
13
  )
@@ -9,11 +9,8 @@ from .create_config_file_step import create_config_file_step
9
9
  from .file_service_step import file_service_step
10
10
  from .project_structure_step import project_structure_step
11
11
  from .create_other_project_files_step import create_other_project_files_step
12
- from solace_agent_mesh.config_portal.backend.server import run_flask
13
- import click
14
- import multiprocessing
15
- import sys
16
- import time
12
+ from .web_init_step import web_init_step
13
+
17
14
  from cli.utils import (
18
15
  log_error,
19
16
  ask_yes_no_question,
@@ -36,9 +33,15 @@ def init_command(options={}):
36
33
  if "skip" in options and options["skip"]:
37
34
  skip = True
38
35
 
36
+ click.echo(click.style("Initializing Solace Agent Mesh", bold=True, fg="blue"))
37
+ check_if_already_done(options, default_options, skip, abort)
38
+
39
+ use_web_based_init = options.get("use_web_based_init", False)
40
+ if not use_web_based_init and not skip:
41
+ use_web_based_init = ask_yes_no_question("Would you like to configure your project through a web interface in your browser?", True)
42
+
39
43
  # no description for hidden steps
40
- steps = [
41
- ("", check_if_already_done),
44
+ cli_steps = [
42
45
  ("Project structure setup", project_structure_step),
43
46
  ("Broker setup", broker_step),
44
47
  ("AI provider setup", ai_provider_step),
@@ -48,48 +51,14 @@ def init_command(options={}):
48
51
  ("Setting up project", create_other_project_files_step),
49
52
  ]
50
53
 
51
- check_if_already_done(options, default_options, skip, abort)
52
-
53
- click.echo(click.style("Initializing Solace Agent Mesh", bold=True, fg="blue"))
54
- use_web_based_init = ask_yes_no_question("Would you like to configure your project through a web interface in your browser?", True)
55
-
56
- if use_web_based_init and not skip:
57
-
58
- with multiprocessing.Manager() as manager:
59
- # Create a shared configuration dictionary
60
- shared_config = manager.dict()
61
-
62
- # Start the Flask server with the shared config
63
- init_gui_process = multiprocessing.Process(
64
- target=run_flask,
65
- args=("127.0.0.1", 5002, shared_config)
66
- )
67
- init_gui_process.start()
68
-
69
- click.echo(click.style("Web configuration portal is running at http://127.0.0.1:5002", fg="green"))
70
- click.echo("Complete the configuration in your browser to continue...")
71
-
72
- # Wait for the Flask server to finish
73
- init_gui_process.join()
74
-
75
- # Get the configuration from the shared dictionary
76
- if shared_config:
77
- # Convert from manager.dict to regular dict
78
- config_from_portal = dict(shared_config)
79
- options.update(config_from_portal)
80
- click.echo(click.style("Configuration received from portal", fg="green"))
81
-
82
- #if web configuration portal is used, skip the steps that are already done
83
- steps_if_web_setup_used = [
84
- ("", create_config_file_step),
85
- ("", create_other_project_files_step),
86
- ]
87
- steps = steps_if_web_setup_used
88
- else:
89
- click.echo(click.style("Web configuration failed, please try again.", fg="red"))
90
- return
91
-
54
+ web_steps = [
55
+ ("Initilize in web", web_init_step),
56
+ ("", create_config_file_step),
57
+ ("", create_other_project_files_step),
58
+ ]
92
59
 
60
+ steps = web_steps if use_web_based_init else cli_steps
61
+
93
62
  non_hidden_steps_count = len([step for step in steps if step[0]])
94
63
 
95
64
  step = 0
@@ -0,0 +1,32 @@
1
+ import click
2
+ import multiprocessing
3
+ from solace_agent_mesh.config_portal.backend.server import run_flask
4
+
5
+ def web_init_step(options, default_options, none_interactive, abort):
6
+ if not none_interactive:
7
+ with multiprocessing.Manager() as manager:
8
+ # Create a shared configuration dictionary
9
+ shared_config = manager.dict()
10
+
11
+ # Start the Flask server with the shared config
12
+ init_gui_process = multiprocessing.Process(
13
+ target=run_flask,
14
+ args=("127.0.0.1", 5002, shared_config)
15
+ )
16
+ init_gui_process.start()
17
+
18
+ click.echo(click.style("Web configuration portal is running at http://127.0.0.1:5002", fg="green"))
19
+ click.echo("Complete the configuration in your browser to continue...")
20
+
21
+ # Wait for the Flask server to finish
22
+ init_gui_process.join()
23
+
24
+ # Get the configuration from the shared dictionary
25
+ if shared_config:
26
+ # Convert from manager.dict to regular dict
27
+ config_from_portal = dict(shared_config)
28
+ options.update(config_from_portal)
29
+ click.echo(click.style("Configuration received from portal", fg="green"))
30
+
31
+ else:
32
+ abort("Web configuration failed, please try again.")
@@ -8,7 +8,7 @@ from cli.utils import log_error, ask_question
8
8
 
9
9
  DEFAULT_DESCRIPTION = "A solace-agent-mesh plugin project."
10
10
  DEFAULT_AUTHOR = "Author Name"
11
- EMPTY_FILE_MSG = "THIS WILL IS ONLY HERE TO PREVENT GIT FROM IGNORING THIS DIRECTORY"
11
+ EMPTY_FILE_MSG = ""
12
12
 
13
13
  def create_command(
14
14
  path: str, description: str = None, author: str = None, skip: bool = False
@@ -87,10 +87,10 @@ def create_command(
87
87
  with open(os.path.join(py_path, "__init__.py"), "w", encoding="utf-8") as f:
88
88
  f.write("")
89
89
 
90
- with open(os.path.join("configs", "__TEMPLATES_WILL_BE_HERE__"), "w", encoding="utf-8") as f:
90
+ with open(os.path.join("configs", ".gitkeep"), "w", encoding="utf-8") as f:
91
91
  f.write(EMPTY_FILE_MSG)
92
92
 
93
- with open(os.path.join("interfaces", "__INTERFACES_WILL_BE_HERE__"), "w", encoding="utf-8") as f:
93
+ with open(os.path.join("interfaces", ".gitkeep"), "w", encoding="utf-8") as f:
94
94
  f.write(EMPTY_FILE_MSG)
95
95
 
96
96
  with open(os.path.join("src", "__init__.py"), "w", encoding="utf-8") as f:
@@ -153,6 +153,12 @@ def visualize(port, find_unused_port, host, use_env):
153
153
  default=False,
154
154
  help="Non-interactive mode. Skip all the prompts, Uses provided options and default values.",
155
155
  )
156
+ @click.option(
157
+ "--use-web-based-init",
158
+ is_flag=True,
159
+ default=False,
160
+ help="Launch the browser-based initialization interface directly, skipping the prompt.",
161
+ )
156
162
  @click.option(
157
163
  "--namespace",
158
164
  help="project namespace",
@@ -0,0 +1,42 @@
1
+ import{j as e,r as g}from"./index-BJHAE5s4.js";function re({steps:s,currentStepIndex:t,onStepClick:c}){return e.jsxs("div",{className:"relative w-full",children:[e.jsx("div",{className:"absolute top-5 left-0 right-0 h-1 bg-gray-300 mr-9 ml-9",children:e.jsx("div",{className:"h-full bg-solace-green transition-all duration-300 ease-in-out",style:{width:t===0?"0%":`${t/(s.length-1)*100}%`}})}),e.jsx("div",{className:"flex items-center justify-between w-full relative z-10",children:s.map((a,i)=>{const d=i===t,m=i<t;return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("button",{onClick:()=>c==null?void 0:c(i),disabled:!c,className:`
2
+ w-10 h-10 rounded-full flex items-center justify-center
3
+ font-bold transition-colors duration-300
4
+ ${d?"bg-solace-green text-white":""}
5
+ ${m?"bg-solace-dark-green text-white":""}
6
+ ${!d&&!m?"bg-gray-200 text-gray-600":""}
7
+ ${c?"cursor-pointer":"cursor-default"}
8
+ `,children:m?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):i+1}),e.jsx("span",{className:`
9
+ mt-2 text-xs font-medium text-center
10
+ ${d?"text-solace-green":""}
11
+ ${m?"text-solace-dark-green":""}
12
+ ${!d&&!m?"text-gray-500":""}
13
+ `,children:a.title})]},a.id)})})]})}function L({children:s,onClick:t,disabled:c=!1,variant:a="primary",type:i="button",className:d=""}){const m="py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",v={primary:"bg-solace-green hover:bg-solace-dark-green text-white focus:ring-solace-green disabled:bg-solace-green/50",secondary:"bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500 disabled:bg-gray-100 disabled:text-gray-400",outline:"border border-gray-300 hover:bg-gray-50 text-gray-700 focus:ring-solace-green disabled:text-gray-400"};return e.jsx("button",{type:i,className:`${m} ${v[a]} ${d}`,onClick:t,disabled:c,children:s})}const J=()=>e.jsx("svg",{className:"w-4 h-4 mr-1.5 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),X={quick:{title:"Get Started Quickly",timeEstimate:"2 minutes",timeColor:"green",description:"Simple setup with recommended defaults",features:["Connect AI provider","Uses sensible defaults for everything else"]},advanced:{title:"Advanced Setup",timeEstimate:"10 minutes",timeColor:"blue",description:"Full control over all configuration options",features:["Set namespace for topic prefixes","Specify broker settings","Connect AI provider","Customize built-in agents","Configure file service"]}},ne=["Ready-to-use Solace Agent Mesh with basic capabilities","Chat interface and REST API for immediate testing","Foundation for adding more agents later"],te=({pathType:s,isSelected:t,onSelect:c})=>{const a=X[s];return e.jsxs("div",{className:`
14
+ border rounded-lg p-6 cursor-pointer transition-all
15
+ ${t?"border-solace-blue bg-solace-light-blue/10 shadow-md":"border-gray-200 hover:border-solace-blue/50 hover:bg-gray-50"}
16
+ `,onClick:c,children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx("h3",{className:"text-xl font-bold text-solace-blue",children:a.title}),e.jsx("span",{className:`bg-${a.timeColor}-100 text-${a.timeColor}-800 text-xs font-medium px-2.5 py-0.5 rounded`,children:a.timeEstimate})]}),e.jsx("p",{className:"text-gray-600 mb-4",children:a.description}),e.jsx("div",{children:e.jsx("ul",{className:"space-y-2 text-sm text-gray-600",children:a.features.map(i=>e.jsxs("li",{className:"flex items-center",children:[e.jsx(J,{}),i]},i))})})]})};function ie({data:s,updateData:t,onNext:c,onPrevious:a}){const[i,d]=g.useState(s.setupPath??null),m=o=>{d(o),t({setupPath:o})},v=()=>{i&&c()};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:Object.keys(X).map(o=>e.jsx(te,{pathType:o,isSelected:i===o,onSelect:()=>m(o)},o))}),e.jsxs("div",{className:"mt-6 p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-solace-blue mb-3",children:"What you'll get after setup:"}),e.jsx("ul",{className:"space-y-2 text-gray-700",children:ne.map(o=>e.jsxs("li",{className:"flex items-center",children:[e.jsx(J,{}),o]},o))})]}),e.jsx("div",{className:"mt-8 flex justify-end",children:e.jsx(L,{onClick:v,disabled:!i,children:"Continue"})})]})}function S({label:s,htmlFor:t,error:c,children:a,helpText:i,required:d=!1}){return e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 mb-1",children:[s,d&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),a,i&&e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:i}),c&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:c})]})}function R({id:s,type:t="text",name:c,value:a,onChange:i,placeholder:d="",required:m=!1,disabled:v=!1,className:o="",autoFocus:j=!1}){return e.jsx("input",{id:s,name:c||s,type:t,value:a,onChange:i,placeholder:d,required:m,disabled:v,autoFocus:j,className:`
17
+ w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
18
+ focus:outline-none focus:ring-blue-500 focus:border-blue-500
19
+ disabled:bg-gray-100 disabled:text-gray-500
20
+ ${o}
21
+ `})}function T({children:s,className:t=""}){return e.jsx("div",{className:`p-4 bg-blue-50 rounded-md ${t}`,children:e.jsx("p",{className:"text-sm text-blue-800",children:s})})}function U({children:s,className:t=""}){return e.jsx("div",{className:`p-4 bg-yellow-50 rounded-md ${t}`,children:e.jsx("p",{className:"text-sm text-yellow-800",children:s})})}function oe({children:s,variant:t="info",className:c=""}){const a={info:"bg-blue-50 text-blue-800",success:"bg-green-50 text-green-800",error:"bg-red-50 text-red-800",loading:"bg-blue-50 text-blue-800"};return e.jsx("div",{className:`p-3 rounded-md ${a[t]} ${c}`,children:e.jsx("p",{className:"text-sm",children:s})})}function le({data:s,updateData:t,onNext:c,onPrevious:a}){var m;const i=v=>{t({[v.target.name]:v.target.value})},d=v=>{v.preventDefault(),c()};return e.jsxs("form",{onSubmit:d,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(T,{className:"mb-4",children:"The namespace is a unique identifier that will be prefixed to all your event topics in the Solace Agent Mesh. Choose something meaningful to your organization or project."}),e.jsx(S,{label:"Project Namespace",htmlFor:"namespace",helpText:"Any simple text identifier that makes sense for your project (e.g., 'my-project', 'acme-corp')",required:!0,children:e.jsx(R,{id:"namespace",name:"namespace",value:s.namespace,onChange:i,placeholder:"Enter a namespace (e.g., my-project)",required:!0})})]}),e.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[e.jsx(L,{onClick:a,variant:"outline",disabled:!0,children:"Previous"}),e.jsx(L,{type:"submit",disabled:!((m=s.namespace)!=null&&m.trim()),children:"Next"})]})]})}function B({id:s,options:t,value:c,onChange:a,name:i,required:d=!1,disabled:m=!1,className:v=""}){return e.jsxs("div",{className:"relative",children:[e.jsx("select",{id:s,name:i||s,value:c,onChange:a,required:d,disabled:m,className:`
22
+ w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
23
+ focus:outline-none focus:ring-blue-500 focus:border-blue-500
24
+ disabled:bg-gray-100 disabled:text-gray-500
25
+ appearance-none
26
+ pr-10
27
+ ${v}
28
+ `,children:t.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2",children:e.jsx("svg",{className:"h-6 w-6 text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})}const ae=[{value:"solace",label:"Existing Solace Pub/Sub+ broker"},{value:"container",label:"New local Solace PubSub+ broker container"},{value:"dev_mode",label:"Dev mode (simplified setup)"}],ce=[{value:"podman",label:"Podman"},{value:"docker",label:"Docker"}];function de({data:s,updateData:t,onNext:c,onPrevious:a}){const[i,d]=g.useState({}),[m,v]=g.useState(!1),[o,j]=g.useState({isRunning:!1,success:s.container_started===!0,message:s.container_started?"Container already started successfully":""});g.useEffect(()=>{!s.container_engine&&s.broker_type==="container"&&t({container_engine:"podman"}),s.container_engine&&s.broker_type!=="container"&&t({container_engine:""}),s.broker_type!=="dev_mode"?t({dev_mode:!1}):s.broker_type==="dev_mode"&&t({dev_mode:!0})},[s.broker_type]);const N=x=>{t({[x.target.name]:x.target.value})},w=()=>{const x={};let _=!0;return y==="solace"&&(s.broker_url||(x.broker_url="Broker URL is required",_=!1),s.broker_vpn||(x.broker_vpn="VPN name is required",_=!1),s.broker_username||(x.broker_username="Username is required",_=!1),s.broker_password||(x.broker_password="Password is required",_=!1)),y==="container"&&!o.success&&(x.container="You must successfully run the container before proceeding",_=!1),d(x),_},f=async()=>{v(!0),j({isRunning:!0,success:!1,message:"Starting container..."});try{const _=await(await fetch("api/runcontainer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({container_engine:s.container_engine})})).json();_.status==="success"?(j({isRunning:!1,success:!0,message:_.message??"Container started successfully!"}),t({container_engine:s.container_engine,container_started:!0})):(j({isRunning:!1,success:!1,message:_.message??"Failed to start container. Please try again."}),t({container_started:!1}))}catch(x){j({isRunning:!1,success:!1,message:x instanceof Error?x.message:"An unexpected error occurred"}),t({container_started:!1})}finally{v(!1)}},C=x=>{x.preventDefault(),w()&&c()},y=s.broker_type,E=y==="solace",M=y==="container",I=()=>o.isRunning?"loading":o.success?"success":"error",l=()=>m?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),e.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"})]}),"Starting Container..."]}):o.success?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Container Running"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download and Run Container"]});return e.jsxs("form",{onSubmit:C,children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(S,{label:"Broker Type",htmlFor:"broker_type",required:!0,children:e.jsx(B,{id:"broker_type",name:"broker_type",options:ae,value:y,onChange:N,disabled:o.success&&s.broker_type==="container"})}),E&&e.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md",children:[e.jsx(T,{className:"mb-4",children:"Connect to an existing Solace PubSub+ broker running locally or in the cloud. You will need your broker credentials."}),e.jsx(S,{label:"Broker URL",htmlFor:"broker_url",error:i.broker_url,required:!0,children:e.jsx(R,{id:"broker_url",name:"broker_url",value:s.broker_url||"",onChange:N,placeholder:"ws://localhost:8008"})}),e.jsx(S,{label:"VPN Name",htmlFor:"broker_vpn",error:i.broker_vpn,required:!0,children:e.jsx(R,{id:"broker_vpn",name:"broker_vpn",value:s.broker_vpn||"",onChange:N,placeholder:"default"})}),e.jsx(S,{label:"Username",htmlFor:"broker_username",error:i.broker_username,required:!0,children:e.jsx(R,{id:"broker_username",name:"broker_username",value:s.broker_username||"",onChange:N,placeholder:"default"})}),e.jsx(S,{label:"Password",htmlFor:"broker_password",error:i.broker_password,required:!0,children:e.jsx(R,{id:"broker_password",name:"broker_password",type:"password",value:s.broker_password||"",onChange:N,placeholder:"Enter password"})})]}),M&&e.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md",children:[e.jsx(T,{className:"mb-4",children:"This option will download and run a local Solace PubSub+ broker container on your machine using Docker or Podman. You need to have Docker or Podman installed on your system."}),e.jsx(S,{label:"Container Engine",htmlFor:"container_engine",helpText:"Select the container engine installed on your system",required:!0,children:e.jsx(B,{id:"container_engine",name:"container_engine",options:ce,value:s.container_engine??"",onChange:N,disabled:o.isRunning||o.success})}),i.container&&e.jsx("div",{className:"text-sm text-red-600 mt-1 bg-red-50 p-2 border-l-4 border-red-500",children:i.container}),o.message&&e.jsx(oe,{variant:I(),children:o.message}),e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx(L,{onClick:f,disabled:m||o.success,variant:"primary",type:"button",className:"flex items-center justify-center gap-2",children:l()}),o.success&&e.jsxs("div",{className:"mt-2 flex items-center text-sm text-green-600",children:[e.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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"})}),"Container is running. You may proceed to the next step."]}),!o.success&&!m&&!o.message&&e.jsxs("div",{className:"mt-2 flex items-center text-sm text-blue-600",children:[e.jsxs("svg",{className:"h-4 w-4 mr-1",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"8"})]}),"You must start the container before proceeding to the next step"]})]})})]}),y==="dev_mode"&&e.jsxs(U,{children:[e.jsx("strong",{children:"Warning:"})," Dev mode runs everything in a single process and is not recommended for production use."]})]}),e.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[e.jsx(L,{onClick:a,variant:"outline",type:"button",children:"Previous"}),e.jsxs(L,{type:"submit",disabled:m||y==="container"&&!o.success,variant:y==="container"&&!o.success?"secondary":"primary",children:[y==="container"&&!o.success&&!m&&e.jsxs("span",{className:"flex items-center",children:[e.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Run Container First"]}),!(y==="container"&&!o.success&&!m)&&"Next"]})]})]})}function $({id:s,checked:t,onChange:c,disabled:a=!1}){const[i,d]=g.useState(t);g.useEffect(()=>{d(t)},[t]);const m=()=>{if(!a){const v=!i;d(v),c(v)}};return e.jsx("div",{className:"inline-block",children:e.jsxs("label",{htmlFor:s,className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",id:s,name:s,checked:i,onChange:m,disabled:a,className:"sr-only"}),e.jsx("div",{className:`
29
+ relative w-11 h-6 rounded-full transition-colors duration-300 ease-in-out
30
+ ${i?"bg-solace-green":"bg-gray-300"}
31
+ ${a?"opacity-50":""}
32
+ `,children:e.jsx("span",{className:`
33
+ absolute top-1 left-1 bg-white w-4 h-4 rounded-full shadow transform transition-transform duration-300 ease-in-out
34
+ ${i?"translate-x-5":"translate-x-0"}
35
+ `})}),e.jsx("span",{className:"sr-only",children:i?"Enabled":"Disabled"})]})})}function me({title:s="Confirmation Required",message:t,onConfirm:c,onCancel:a}){return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:s}),e.jsx("p",{className:"mb-6 text-gray-700",children:t}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx(L,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(L,{onClick:c,children:"Continue"})]})]})})}function W({id:s,name:t,value:c,onChange:a,placeholder:i="",required:d=!1,disabled:m=!1,className:v="",autoFocus:o=!1,suggestions:j,onFocus:N,fetchSuggestions:w,showLoadingIndicator:f=!1}){const[C,y]=g.useState(!1),[E,M]=g.useState([]),[I,l]=g.useState(!1),x=g.useRef(null),_=g.useRef(null);g.useEffect(()=>{if(j&&j.length>0){const u=j.filter(k=>k!=null).filter(k=>k.toLowerCase().includes((c||"").toLowerCase()));M(u)}else M([])},[c,j]),g.useEffect(()=>{const u=k=>{x.current&&!x.current.contains(k.target)&&_.current&&!_.current.contains(k.target)&&y(!1)};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]);const n=async()=>{if(N&&N(),w)try{l(!0);const u=await w();u&&u.length>0&&M(u)}catch(u){console.error("Error fetching suggestions:",u)}finally{l(!1)}},r=()=>{y(!0)},p=u=>{var F;a({target:{name:t||s,value:u}}),y(!1),(F=x.current)==null||F.focus()};return e.jsxs("div",{className:"relative w-full",children:[e.jsx("input",{ref:x,id:s,name:t||s,type:"text",value:c||"",onChange:a,onFocus:n,onClick:r,placeholder:i,required:d,disabled:m,autoFocus:o,className:`
36
+ w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
37
+ focus:outline-none focus:ring-blue-500 focus:border-blue-500
38
+ disabled:bg-gray-100 disabled:text-gray-500
39
+ ${v}
40
+ `,autoComplete:"off"}),I&&f&&e.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-solace-green"})}),C&&E.length>0&&e.jsx("div",{ref:_,className:"absolute z-10 w-full mt-1 border bg-white border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto",children:e.jsx("ul",{children:E.map((u,k)=>e.jsx("li",{onClick:()=>p(u),className:"px-3 py-2 cursor-pointer hover:bg-stone-300",children:u},k))})})]})}const q={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"},Q=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google Gemini"},{value:"azure",label:"Azure"},{value:"openai_compatible",label:"OpenAI Compatible Provider"}],ue=[{value:"openai",label:"OpenAI"},{value:"google",label:"Google Gemini"},{value:"cohere",label:"Cohere"},{value:"openai_compatible",label:"OpenAI Compatible Provider"}],Z={openai:"openai",anthropic:"anthropic",google:"openai",openai_compatible:"openai",azure:"azure"},pe={openai:"openai",google:"openai",cohere:"cohere",openai_compatible:"openai"},he={openai:["text-embedding-3-small","text-embedding-3-large","text-embedding-ada-002"],google:["gemini-embedding-exp-03-07"],cohere:["embed-english-v3.0","embed-multilingual-v3.0","embed-english-light-v3.0","embed-multilingual-light-v3.0"],openai_compatible:[]},ge=[{value:"openai",label:"OpenAI"},{value:"openai_compatible",label:"OpenAI Compatible Provider"}],xe={openai:"openai",google:"gemini",openai_compatible:"openai"},O={openai:["dall-e-3","dall-e-2"],google:["imagen-3","imagen-2"],openai_compatible:[]},be={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 fe(s,t){try{const c=s.endsWith("/")?s:`${s}/`,a=await fetch(`${c}v1/models`,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!a.ok)throw new Error(`Failed to fetch models: ${a.status}`);const i=await a.json();return i.data&&Array.isArray(i.data)?i.data.filter(d=>d.id).map(d=>d.id):i.models&&Array.isArray(i.models)?i.models.filter(d=>d.id??d.name).map(d=>d.id??d.name):Array.isArray(i)?i.filter(d=>d.id??d.name).map(d=>d.id??d.name):[]}catch(c){return console.error("Error fetching models:",c),[]}}const V=(s,t)=>s.includes("/")?s:`${Z[t]||t}/${s}`;function ee({data:s,updateData:t,onNext:c,onPrevious:a}){const[i,d]=g.useState({}),[m,v]=g.useState(!1),[o,j]=g.useState(null),[N,w]=g.useState(!1),[f,C]=g.useState([]),[y,E]=g.useState([]),[M,I]=g.useState(!1),[l,x]=g.useState(null),[_,n]=g.useState(null);g.useEffect(()=>{console.log(s.setupPath);const b={};s.llm_provider||(b.llm_provider="openai"),s.embedding_provider||(b.embedding_provider="openai"),s.embedding_service_enabled===void 0&&(b.embedding_service_enabled=!0),Object.keys(b).length>0&&t(b)},[s,t]),g.useEffect(()=>{if(s.llm_provider){const b={};if(l!==null&&l!==s.llm_provider){if(b.llm_model_name="",s.llm_provider!=="openai_compatible"){const P=q[s.llm_provider]||"";b.llm_endpoint_url=P}else b.llm_endpoint_url="";Object.keys(b).length>0&&t(b)}x(s.llm_provider)}},[s.llm_provider,l,t]),g.useEffect(()=>{if(s.embedding_provider&&s.embedding_service_enabled){const b={};if(_!==null&&_!==s.embedding_provider){if(b.embedding_model_name="",s.embedding_provider!=="openai_compatible"){const P=q[s.embedding_provider]||"";b.embedding_endpoint_url=P}else b.embedding_endpoint_url="";Object.keys(b).length>0&&t(b)}n(s.embedding_provider)}},[s.embedding_provider,_,t,s.embedding_service_enabled]),g.useEffect(()=>{s.llm_provider&&s.llm_provider!=="openai_compatible"?C(be[s.llm_provider]||[]):C([])},[s.llm_provider]),g.useEffect(()=>{s.embedding_provider&&s.embedding_provider!=="openai_compatible"?E(he[s.embedding_provider]||[]):E([])},[s.embedding_provider]);const r=b=>{t({[b.target.name]:b.target.value})},p=b=>{t({embedding_service_enabled:b}),b||d({...i,embedding_provider:"",embedding_endpoint_url:"",embedding_api_key:"",embedding_model_name:""})},u=g.useCallback(async()=>{if(s.llm_provider==="openai_compatible"&&s.llm_endpoint_url&&s.llm_api_key){I(!0);try{const b=await fe(s.llm_endpoint_url,s.llm_api_key);C(b)}catch(b){console.error("Error fetching models:",b)}finally{I(!1)}}return[]},[s.llm_provider,s.llm_endpoint_url,s.llm_api_key]),k=()=>{const b={};let P=!0;return s.llm_provider||(b.llm_provider="LLM provider is required",P=!1),s.llm_provider==="openai_compatible"&&!s.llm_endpoint_url&&(b.llm_endpoint_url="LLM endpoint is required for OpenAI compatible endpoint}",P=!1),s.llm_model_name||(b.llm_model_name="LLM model name is required",P=!1),s.llm_api_key||(b.llm_api_key="LLM API key is required",P=!1),s.setupPath==="advanced"&&s.embedding_service_enabled&&(s.embedding_provider||(b.embedding_provider="Embedding provider is required",P=!1),s.embedding_endpoint_url||(b.embedding_endpoint_url="Embedding endpoint is required",P=!1),s.embedding_model_name||(b.embedding_model_name="Embedding model name is required",P=!1),s.embedding_api_key||(b.embedding_api_key="Embedding API key is required",P=!1)),d(b),P},F=async()=>{v(!0),j(null);try{const b=s.llm_provider!=="openai_compatible"&&q[s.llm_provider]||s.llm_endpoint_url,P=V(s.llm_model_name,s.llm_provider),D=await(await fetch("/api/test_llm_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:P,api_key:s.llm_api_key,base_url:b})})).json();D.status==="success"?(v(!1),c()):(j(D.message??"Failed to test LLM configuration"),w(!0),v(!1))}catch(b){j(b instanceof Error?`Error: ${b.message}`:"An unexpected error occurred while testing the LLM configuration"),w(!0),v(!1)}},z=b=>{b.preventDefault(),k()&&F()};return e.jsxs("form",{onSubmit:z,children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(T,{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.'}),e.jsxs("div",{className:"border-b border-gray-200 pb-4 mb-4",children:[e.jsx("h3",{className:"text-lg font-medium mb-4 text-gray-700 font-semibold",children:"Language Model Configuration"}),e.jsx(S,{label:"LLM Provider",htmlFor:"llm_provider",error:i.llm_provider,required:!0,children:e.jsx(B,{id:"llm_provider",name:"llm_provider",value:s.llm_provider||"",onChange:r,options:Q})}),(s.llm_provider==="openai_compatible"||s.llm_provider==="azure")&&e.jsx(S,{label:"LLM Endpoint URL",htmlFor:"llm_endpoint_url",error:i.llm_endpoint_url,required:!0,children:e.jsx(R,{id:"llm_endpoint_url",name:"llm_endpoint_url",value:s.llm_endpoint_url,onChange:r,placeholder:"https://api.example.com/v1",autoFocus:!0})}),e.jsx(S,{label:"LLM API Key",htmlFor:"llm_api_key",error:i.llm_api_key,required:!0,children:e.jsx(R,{id:"llm_api_key",name:"llm_api_key",type:"password",value:s.llm_api_key,onChange:r,placeholder:"Enter your API key"})}),s.llm_provider==="azure"&&e.jsxs(U,{className:"mb-4",children:[e.jsx("strong",{children:"Important:"}),' For Azure, in the "LLM Model Name" field, enter your ',e.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 ",e.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"}),"."]}),e.jsx(S,{label:"LLM Model Name",htmlFor:"llm_model_name",error:i.llm_model_name,helpText:"Select or type a model name",required:!0,children:e.jsx(W,{id:"llm_model_name",name:"llm_model_name",value:s.llm_model_name,onChange:r,placeholder:"Select or type a model name",suggestions:f,onFocus:s.llm_provider==="openai_compatible"?u:void 0,showLoadingIndicator:M})})]}),s.setupPath==="advanced"&&e.jsxs(e.Fragment,{children:[e.jsxs(T,{children:[e.jsxs("a",{href:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/user-guide/advanced/services/embedding-service",target:"_blank",rel:"noopener noreferrer",className:"font-medium underline inline-flex items-center",children:["The Embedding Service",e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3.5 w-3.5 ml-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})," ","provides a unified interface for agents to request text, image, or multi-modal embeddings through the Solace Agent Mesh."]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-700 font-semibold",children:"Embedding Model Configuration"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-3 text-sm text-gray-600",children:"Enable Embedding Service"}),e.jsx($,{id:"embedding_service_enabled",checked:s.embedding_service_enabled,onChange:p})]})]}),s.embedding_service_enabled&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(S,{label:"Embedding Provider",htmlFor:"embedding_provider",error:i.embedding_provider,required:!0,children:e.jsx(B,{id:"embedding_provider",name:"embedding_provider",value:s.embedding_provider||"",onChange:r,options:ue})}),s.embedding_provider==="openai_compatible"&&e.jsx(S,{label:"Embedding Endpoint URL",htmlFor:"embedding_endpoint_url",error:i.embedding_endpoint_url,required:!0,children:e.jsx(R,{id:"embedding_endpoint_url",name:"embedding_endpoint_url",value:s.embedding_endpoint_url||"",onChange:r,placeholder:"https://api.example.com/v1"})}),e.jsx(S,{label:"Embedding API Key",htmlFor:"embedding_api_key",error:i.embedding_api_key,required:!0,children:e.jsx(R,{id:"embedding_api_key",name:"embedding_api_key",type:"password",value:s.embedding_api_key||"",onChange:r,placeholder:"Enter your API key"})}),e.jsx(S,{label:"Embedding Model Name",htmlFor:"embedding_model_name",error:i.embedding_model_name,required:!0,children:e.jsx(W,{id:"embedding_model_name",name:"embedding_model_name",value:s.embedding_model_name,onChange:r,placeholder:"Select or type a model name",suggestions:y,showLoadingIndicator:M})})]})]})]})]}),e.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[e.jsx(L,{onClick:a,disabled:s.setupPath==="quick",variant:"outline",children:"Previous"}),e.jsx(L,{type:"submit",children:"Next"})]}),m&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full text-center",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Testing LLM Configuration"}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-solace-green"})}),e.jsx("p",{children:"Please wait while we test your LLM configuration..."})]})}),N&&e.jsx(me,{title:"Connection Test Failed",message:`We couldn't connect to your AI provider: ${o}
41
+ Please check your API key, model name, and endpoint URL (if applicable).
42
+ Do you want to skip this check and continue anyway?`,onConfirm:()=>{w(!1),c()},onCancel:()=>{w(!1)}})]})}const A={webRequest:{id:"web_request",name:"Web Request Agent",description:"Can make queries to web to get real-time data"},imageProcessing:{id:"image_processing",name:"Image Processing Agent",description:"Generate images from text or convert images to text"}},h={provider:"IMAGE_GEN_PROVIDER",endpoint:"IMAGE_GEN_ENDPOINT",apiKey:"IMAGE_GEN_API_KEY",model:"IMAGE_GEN_MODEL"};function ve({data:s,updateData:t,onNext:c,onPrevious:a}){const[i,d]=g.useState(s.built_in_agent??[]),[m,v]=g.useState({}),[o,j]=g.useState({}),[N,w]=g.useState([]),f=l=>{const n=Object.entries(l).filter(([r,p])=>p!=="").map(([r,p])=>`${r}=${p}`);t({env_var:n})};g.useEffect(()=>{const l={};if(s.env_var&&Array.isArray(s.env_var)&&s.env_var.forEach(x=>{if(x.includes("=")){const[_,n]=x.split("=");l[_]=n}}),i.includes(A.imageProcessing.id)){l[h.provider]||(l[h.provider]="openai");const x=l[h.provider];!l[h.endpoint]&&x!=="openai_compatible"&&(l[h.endpoint]=q[x]||""),l[h.apiKey]||(l[h.apiKey]=""),l[h.model]||(l[h.model]=""),x&&x!=="openai_compatible"&&w(O[x]||[])}v(l)},[s.env_var]);const C=(l,x)=>{const _={...m,[l]:x};v(_),o[l]&&j({...o,[l]:""}),f(_)},y=(l,x)=>{let _;if(x){if(_=i.includes(l)?i:[...i,l],l===A.imageProcessing.id&&!i.includes(A.imageProcessing.id)){const n={...m},r="openai";n[h.provider]=r,n[h.endpoint]=q[r],n[h.apiKey]="",n[h.model]="",v(n),w(O[r]||[]),f(n)}}else if(_=i.filter(n=>n!==l),l===A.imageProcessing.id){const n={...m},r={...o};Object.values(h).forEach(p=>{delete n[p],delete r[p]}),v(n),j(r),f(n)}d(_),t({built_in_agent:_})},E=l=>{const x={...m,[h.provider]:l,[h.model]:""};l!=="openai_compatible"?(x[h.endpoint]=q[l]||"",w(O[l]||[])):(x[h.endpoint]="",w([])),v(x);const _=[h.provider,h.model,h.endpoint],n={...o};_.forEach(r=>{n[r]&&delete n[r]}),Object.keys(n).length!==Object.keys(o).length&&j(n),f(x)},M=()=>{const l={};let x=!0;return i.includes(A.imageProcessing.id)&&(m[h.provider]||(l[h.provider]="Image Generation Provider is required",x=!1),m[h.provider]==="openai_compatible"&&!m[h.endpoint]&&(l[h.endpoint]="Image Generation Endpoint is required",x=!1),m[h.apiKey]||(l[h.apiKey]="Image Generation API Key is required",x=!1),m[h.model]||(l[h.model]="Image Generation Model is required",x=!1)),j(l),x},I=l=>{l.preventDefault(),M()&&c()};return e.jsxs("form",{onSubmit:I,children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(T,{className:"mb-4",children:"Enable and configure built-in agents to extend your system's capabilities."}),e.jsx("div",{className:"flex flex-col p-4 border border-gray-200 rounded-md",children:e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-solace-blue",children:A.webRequest.name}),e.jsx("p",{className:"text-sm text-gray-500",children:A.webRequest.description})]}),e.jsx($,{id:`toggle_${A.webRequest.id}`,checked:i.includes(A.webRequest.id),onChange:l=>y(A.webRequest.id,l)})]})}),e.jsxs("div",{className:"flex flex-col p-4 border border-gray-200 rounded-md",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-solace-blue",children:A.imageProcessing.name}),e.jsx("p",{className:"text-sm text-gray-500",children:A.imageProcessing.description})]}),e.jsx($,{id:`toggle_${A.imageProcessing.id}`,checked:i.includes(A.imageProcessing.id),onChange:l=>y(A.imageProcessing.id,l)})]}),i.includes(A.imageProcessing.id)&&e.jsxs("div",{className:"space-y-4 mt-4 pt-4 border-t border-gray-200",children:[e.jsx(S,{label:"Image Generation Provider",htmlFor:h.provider,error:o[h.provider],required:!0,children:e.jsx(B,{id:h.provider,name:h.provider,value:m[h.provider]||"",onChange:l=>E(l.target.value),options:ge})}),m[h.provider]==="openai_compatible"&&e.jsx(S,{label:"Image Generation Endpoint",htmlFor:h.endpoint,error:o[h.endpoint],required:!0,children:e.jsx(R,{id:h.endpoint,name:h.endpoint,type:"text",value:m[h.endpoint]||"",onChange:l=>C(h.endpoint,l.target.value),placeholder:"Enter endpoint URL"})}),e.jsx(S,{label:"Image Generation API Key",htmlFor:h.apiKey,error:o[h.apiKey],required:!0,children:e.jsx(R,{id:h.apiKey,name:h.apiKey,type:"password",value:m[h.apiKey]||"",onChange:l=>C(h.apiKey,l.target.value),placeholder:"Enter API key"})}),e.jsx(S,{label:"Image Generation Model",htmlFor:h.model,error:o[h.model],required:!0,children:e.jsx(W,{id:h.model,name:h.model,value:m[h.model]||"",onChange:l=>C(h.model,l.target.value),placeholder:"Select or type a model name",suggestions:N,onFocus:()=>{const l=m[h.provider]||"openai";l!=="openai_compatible"&&w(O[l]||[])}})})]})]})]}),e.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[e.jsx(L,{onClick:a,variant:"outline",type:"button",children:"Previous"}),e.jsx(L,{type:"submit",children:"Next"})]})]})}const _e=[{value:"volume",label:"Volume: Use a local volume (directory) to store files"},{value:"bucket",label:"Bucket: Use a cloud bucket to store files (Must use AWS S3 API)"}];function je({data:s,updateData:t,onNext:c,onPrevious:a}){const[i,d]=g.useState({}),[m,v]=g.useState(""),[o,j]=g.useState(""),[N,w]=g.useState(""),[f,C]=g.useState(!1),[y,E]=g.useState(s.file_service_provider||"volume");g.useEffect(()=>{if(f)return;const r=s.file_service_provider||"volume";if(E(r),r==="volume"){let p="/tmp/solace-agent-mesh";if(s.file_service_config&&Array.isArray(s.file_service_config)){const u=s.file_service_config.find(k=>k.startsWith("directory="));u&&(p=u.split("=")[1])}v(p),s.file_service_config||t({file_service_provider:r,file_service_config:[`directory=${p}`]})}else if(r==="bucket"&&s.file_service_config&&Array.isArray(s.file_service_config)){const p=s.file_service_config.find(k=>k.startsWith("bucket_name=")),u=s.file_service_config.find(k=>k.startsWith("endpoint_url="));p&&j(p.split("=")[1]),u&&w(u.split("=")[1])}C(!0)},[s,f,t]);const M=r=>{const p=r.target.value;E(p),p==="volume"?t({file_service_provider:p,file_service_config:[`directory=${m||"/tmp/solace-agent-mesh"}`]}):p==="bucket"&&t({file_service_provider:p,file_service_config:[`bucket_name=${o}`,`endpoint_url=${N}`]})},I=r=>{const p=r.target.value;v(p),t({file_service_config:[`directory=${p}`]})},l=r=>{const p=r.target.value;j(p),t({file_service_config:[`bucket_name=${p}`,...N?[`endpoint_url=${N}`]:[]]})},x=r=>{const p=r.target.value;w(p),t({file_service_config:[...o?[`bucket_name=${o}`]:[],`endpoint_url=${p}`]})},_=()=>{const r={};let p=!0;return y==="volume"?m||(r.volumePath="Volume path is required",p=!1):y==="bucket"&&(o||(r.bucketName="Bucket name is required",p=!1),N||(r.endpointUrl="Endpoint URL is required",p=!1)),d(r),p},n=r=>{r.preventDefault(),_()&&c()};return e.jsxs("form",{onSubmit:n,children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(T,{className:"mb-4",children:"Choose how you want to store files in your Solace Agent Mesh system."}),e.jsx(S,{label:"File Service Provider",htmlFor:"file_service_provider",required:!0,children:e.jsx(B,{id:"file_service_provider",name:"file_service_provider",options:_e,value:y,onChange:M})}),y==="volume"&&e.jsx(S,{label:"Volume Path",htmlFor:"volumePath",helpText:"The directory path where files will be stored",error:i.volumePath,required:!0,children:e.jsx(R,{id:"volumePath",name:"volumePath",value:m,onChange:I,placeholder:"/tmp/solace-agent-mesh",autoFocus:!0})}),y==="bucket"&&e.jsxs(e.Fragment,{children:[e.jsx(S,{label:"Bucket Name",htmlFor:"bucketName",helpText:"The name of the S3 bucket to use for file storage",error:i.bucketName,required:!0,children:e.jsx(R,{id:"bucketName",name:"bucketName",value:o,onChange:l,placeholder:"my-s3-bucket"})}),e.jsx(S,{label:"Endpoint URL",htmlFor:"endpointUrl",helpText:"The S3 service endpoint URL",error:i.endpointUrl,required:!0,children:e.jsx(R,{id:"endpointUrl",name:"endpointUrl",value:N,onChange:x,placeholder:"https://s3.amazonaws.com"})}),e.jsxs(U,{children:[e.jsx("strong",{children:"Note:"})," You can setup the Boto3 authentication configuration in the ./solace-agent-mesh.yaml file"]})]})]}),e.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[e.jsx(L,{onClick:a,variant:"outline",children:"Previous"}),e.jsx(L,{type:"submit",children:"Next"})]})]})}const ye=["llm","ai","api","url","vpn"],Ne=["broker_password","llm_api_key","embedding_api_key"],K={Project:["namespace"],Broker:["broker_type"],"AI Providers":["llm_model_name","llm_endpoint_url","llm_api_key","embedding_model_name","embedding_endpoint_url","embedding_api_key"],"Built-in Agents":["built_in_agent"],"File Service":["file_service_provider","file_service_config"]};function se({data:s,updateData:t,onPrevious:c}){const[a,i]=g.useState(!1),[d,m]=g.useState(null),v=g.useMemo(()=>{const n={};return Object.values(A).forEach(r=>{n[r.id]={name:r.name}}),n},[]),o=n=>n===void 0||n===""||Array.isArray(n)&&n.length===0,j=n=>n.split("_").map(r=>ye.includes(r.toLowerCase())?r.toUpperCase():r.charAt(0).toUpperCase()+r.slice(1)).join(" "),N=(n,r)=>Ne.includes(n)||n.toUpperCase().includes("API_KEY")?r&&r.length>0?"••••••••":"Not provided":typeof r=="boolean"?r?"Yes":"No":Array.isArray(r)?r.join(", "):r&&r.toString().length>0?r.toString():"Not provided",w=n=>{switch(n){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 n}},f=()=>{const n=s.broker_type;return n?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Type:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:w(n)})]}),n==="container"&&e.jsx("div",{className:"pl-4 border-l-2 border-gray-300 mb-2",children:e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Container Engine:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.container_engine??"Docker"})]})}),(n==="solace"||n==="container")&&e.jsxs("div",{className:"pl-4 border-l-2 border-gray-300",children:[e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Broker URL:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.broker_url})]}),e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Broker VPN:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.broker_vpn})]}),e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Username:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.broker_username})]}),e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Password:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:N("broker_password",s.broker_password)})]})]})]}):null},C=n=>e.jsx("div",{className:"space-y-2 pl-1",children:n.map(r=>{const p=v[r]||{name:r};return e.jsxs("div",{className:"flex items-center",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-600 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),e.jsx("div",{children:e.jsx("span",{className:"font-medium text-gray-900",children:p.name})})]},r)})}),y=n=>{var u,k,F;const r=n.some(z=>z.startsWith("directory=")),p=n.some(z=>z.startsWith("bucket_name="));if(r){const z=(u=n.find(b=>b.startsWith("directory=")))==null?void 0:u.split("=")[1];return e.jsx("div",{className:"pl-4 border-l-2 border-gray-300",children:e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Volume Path:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:z})]})})}if(p){const z=(k=n.find(P=>P.startsWith("bucket_name=")))==null?void 0:k.split("=")[1],b=(F=n.find(P=>P.startsWith("endpoint_url=")))==null?void 0:F.split("=")[1];return e.jsxs("div",{className:"pl-4 border-l-2 border-gray-300",children:[e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Bucket Name:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:z})]}),e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Endpoint URL:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:b})]})]})}return e.jsx("div",{className:"font-medium text-gray-900",children:n.join(", ")})},E=n=>{const r=Q.find(p=>p.value===n);return r?r.label:n},M=(n,r)=>r.some(u=>!o(s[u]))?n==="AI Providers"?e.jsxs("div",{className:"pb-4 mb-4 border-b border-gray-300 last:border-0 last:mb-0 last:pb-0",children:[e.jsx("h4",{className:"font-semibold text-solace-blue mb-3",children:n}),e.jsxs("div",{className:"space-y-3",children:[s.llm_model_name&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"LLM Model Name:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.llm_model_name})]}),s.llm_provider&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"LLM Provider:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:E(s.llm_provider)})]}),s.llm_provider==="openai_compatible"&&s.llm_endpoint_url&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"LLM Endpoint URL:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.llm_endpoint_url})]}),s.llm_api_key&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"LLM API Key:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:N("llm_api_key",s.llm_api_key)})]}),s.setupPath==="advanced"&&e.jsx(e.Fragment,{children:s.embedding_service_enabled===!0&&e.jsxs(e.Fragment,{children:[s.embedding_model_name&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Embedding Model Name:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.embedding_model_name})]}),s.embedding_provider&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Embedding Provider:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:E(s.embedding_provider)})]}),s.embedding_provider==="openai_compatible"&&s.embedding_endpoint_url&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Embedding Endpoint URL:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:s.embedding_endpoint_url})]}),s.embedding_api_key&&e.jsxs("div",{className:"flex mb-1",children:[e.jsx("span",{className:"text-gray-600",children:"Embedding API Key:"}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:N("embedding_api_key",s.embedding_api_key)})]})]})})]})]},n):e.jsxs("div",{className:"pb-4 mb-4 border-b border-gray-300 last:border-0 last:mb-0 last:pb-0",children:[e.jsx("h4",{className:"font-semibold text-solace-blue mb-3",children:n}),e.jsx("div",{className:"space-y-3",children:r.map(u=>o(s[u])?null:u==="broker_type"?e.jsx("div",{children:f()},u):u==="built_in_agent"&&Array.isArray(s[u])?e.jsx("div",{children:C(s[u])},u):u==="file_service_config"&&Array.isArray(s[u])?e.jsx("div",{children:y(s[u])},u):e.jsxs("div",{className:"flex mb-1",children:[e.jsxs("span",{className:"text-gray-600",children:[j(u),":"]}),e.jsx("span",{className:"font-medium text-gray-900 ml-2",children:N(u,s[u])})]},u))})]},n):null,I=n=>{if(n.namespace&&!n.namespace.endsWith("/")&&(n.namespace+="/"),n.container_started&&delete n.container_started,n.llm_provider&&(n.llm_provider=Z[n.llm_provider]),n.embedding_provider&&(n.embedding_provider=pe[n.embedding_provider]),n.llm_model_name&&n.llm_provider&&(n.llm_model_name=V(n.llm_model_name,n.llm_provider),delete n.llm_provider),n.embedding_service_enabled||(n.embedding_api_key="",n.embedding_model_name="",n.embedding_endpoint_url=""),n.embedding_model_name&&n.embedding_provider&&(n.embedding_model_name=V(n.embedding_model_name,n.embedding_provider),delete n.embedding_provider),n.env_var&&Array.isArray(n.env_var)){let r="",p="";if(n.env_var.forEach(u=>{u.startsWith("IMAGE_GEN_PROVIDER=")&&(r=u.split("=")[1]),u.startsWith("IMAGE_GEN_MODEL=")&&(p=u.split("=")[1])}),r&&p){const u=xe[r]||r,k=V(p,u);n.env_var=n.env_var.map(F=>F.startsWith("IMAGE_GEN_MODEL=")?`IMAGE_GEN_MODEL=${k}`:F.startsWith("IMAGE_GEN_PROVIDER=")?null:F).filter(Boolean)}}},l=async(n=!0)=>{I(s),console.log("Submitting configuration:",s);try{const r=await fetch("api/save_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n?{...s,force:!0}:s)}),p=await r.json();if(!r.ok)throw new Error(`HTTP error ${r.status}: ${p.message??"Unknown error"}`);if(p.status==="success"){console.log("Configuration sent successfully!"),t({showSuccess:!0});try{const u=await fetch("api/shutdown",{method:"POST"});u.ok?console.log("Shutdown request sent successfully"):console.warn("Shutdown request failed:",u.status)}catch(u){console.error("Error sending shutdown request:",u)}}else throw new Error(p.message??"Failed to save configuration")}catch(r){m(r instanceof Error?r.message:"An unknown error occurred"),console.error("Error saving configuration:",r)}finally{i(!1)}},x=async()=>{i(!0),m(null),await l()},_=n=>{n.preventDefault(),x()};return e.jsx("div",{className:"space-y-6",children:e.jsxs("form",{onSubmit:_,children:[e.jsx("div",{className:"bg-gray-100 border border-gray-300 rounded-md p-5 space-y-4",children:s.setupPath==="quick"?M("AI Providers",K["AI Providers"]):Object.entries(K).map(([n,r])=>M(n,r))}),d&&e.jsxs("div",{className:"p-4 bg-red-50 text-red-700 rounded-md border border-red-200",children:[e.jsx("p",{className:"font-medium",children:"Error initializing project"}),e.jsx("p",{children:d})]}),e.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[e.jsx(L,{onClick:c,variant:"outline",type:"button",children:"Previous"}),e.jsx(L,{type:"submit",disabled:a,children:a?e.jsxs("div",{className:"flex items-center space-x-2",children:[e.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:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.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"})]}),e.jsx("span",{children:"Initializing..."})]}):"Initialize Project"})]})]})})}const we=({icon:s,title:t,description:c,time:a,link:i})=>e.jsx("a",{href:i,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:e.jsxs("div",{className:"p-5 flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"text-2xl mr-3",children:s}),e.jsx("h4",{className:"text-lg font-medium text-gray-800 group-hover:text-solace-blue transition-colors",children:t})]}),e.jsx("div",{className:"bg-gray-100 text-gray-600 px-3 py-1 rounded-full text-xs font-medium",children:a})]}),e.jsx("p",{className:"text-gray-600 text-sm flex-grow mb-4",children:c}),e.jsx("div",{className:"mt-auto flex justify-end",children:e.jsxs("span",{className:"text-solace-blue text-sm font-medium flex items-center group-hover:translate-x-1 transition-transform",children:["View Tutorial",e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]})}),ke=({icon:s,title:t,description:c,link:a})=>e.jsxs("a",{href:a,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:[e.jsx("div",{className:"mr-4 bg-solace-blue bg-opacity-10 p-3 rounded-lg text-solace-blue group-hover:bg-opacity-20",children:s}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-gray-800",children:t}),e.jsx("p",{className:"text-sm text-gray-600",children:c})]})]});function Se({text:s}){const[t,c]=g.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(d){console.error("Failed to copy text:",d)}},i=()=>t?e.jsx("svg",{className:"w-5 h-5 text-green-500 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-5 h-5 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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 e.jsx("button",{onClick:a,className:"text-white transition-colors opacity-100","aria-label":t?"Copied":"Copy to clipboard",children:i()})}function Ce(){const[s,t]=g.useState("getting-started"),c=3,a=s==="getting-started"?0:s==="tutorials"?1:2,i=f=>f===0?"tutorials":f===1?"documentation":"getting-started",d=f=>f===1?"getting-started":f===2?"tutorials":"documentation",m=()=>{if(a<c-1){const f=i(a);t(f)}},v=()=>{if(a>0){const f=d(a);t(f)}},o=f=>{const C="px-4 py-3 text-sm font-medium ";return s===f?C+"text-solace-blue border-b-2 border-solace-blue":C+"text-gray-500 hover:text-solace-blue"},j=[{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://github.com/SolaceLabs/solace-agent-mesh-core-plugins/tree/main/sam-geo-information"},{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"}],N=[{icon:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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"}],w=()=>s==="getting-started"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[e.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[e.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:e.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"]}),e.jsx("p",{className:"text-gray-600 mb-4",children:"Your configurations have been saved in the following files:"}),e.jsxs("div",{className:"flex space-x-4 mb-4",children:[e.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[e.jsx("code",{className:"text-solace-blue font-mono",children:".env"}),e.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Environment variables"})]}),e.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[e.jsx("code",{className:"text-solace-blue font-mono",children:"solace-agent-mesh.yaml"}),e.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Configuration file"})]})]})]}),e.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[e.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[e.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:e.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"]}),e.jsx("p",{className:"text-gray-600 mb-4",children:"To start Solace Agent Mesh directly, run:"}),e.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:[e.jsx("code",{children:"sam run -b"}),e.jsx(Se,{text:"sam run -b"})]}),e.jsxs("p",{className:"text-gray-600",children:["You can use ",e.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"sam"})," as a shorthand for ",e.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"solace-agent-mesh"})," in all commands."]})]})]}):s==="tutorials"?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-800 mb-2",children:"Hands-on Tutorials"}),e.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."})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:j.map(f=>e.jsx(we,{icon:f.icon,title:f.title,description:f.description,time:f.time,link:f.link},f.title))})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[e.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[e.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:e.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"]}),e.jsx("p",{className:"text-gray-600 mb-6",children:"Explore our comprehensive documentation to get the most out of Solace Agent Mesh:"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:N.map(f=>e.jsx(ke,{icon:f.icon,title:f.title,description:f.description,link:f.link},f.title))}),e.jsx("div",{className:"mt-6 text-center",children:e.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",e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})})]}),e.jsxs("div",{className:"p-6 bg-gradient-to-b from-solace-blue-light to-blue-50 rounded-lg text-center",children:[e.jsx("h3",{className:"text-lg font-medium text-solace-blue mb-2",children:"Connect with the Community"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"Solace Agent Mesh is open source! We welcome contributions and discussions from the community."}),e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row justify-center items-stretch gap-4",children:[e.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:[e.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:e.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"})}),e.jsx("span",{className:"font-medium",children:"GitHub Repository"})]}),e.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:[e.jsx("img",{src:"Solace_community_logo.png",alt:"Solace Community Forum Logo",className:"max-h-8 mb-2 object-contain"}),e.jsx("span",{className:"font-medium",children:"Community Forum"})]})]})]})]});return e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.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:[e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"inline-block bg-green-100 p-3 rounded-full mb-4",children:e.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:e.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"})})}),e.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:"Solace Agent Mesh Initialized Successfully!"}),e.jsx("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:"Your configuration has been saved and your project has been set up. You're now ready to start exploring the capabilities of Solace Agent Mesh."}),e.jsxs("div",{className:"inline-flex items-center px-4 py-2 bg-solace-blue text-white rounded-full shadow-sm",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.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"]})]}),e.jsx("div",{className:"absolute top-0 right-0 -mt-10 -mr-10 h-40 w-40 bg-green-200 opacity-50 rounded-full"}),e.jsx("div",{className:"absolute bottom-0 left-0 -mb-10 -ml-10 h-32 w-32 bg-green-200 opacity-50 rounded-full"})]}),e.jsxs("div",{className:"flex items-center mb-6 border-b",children:[e.jsxs("div",{className:"flex-1 flex",children:[e.jsx("button",{onClick:()=>t("getting-started"),className:o("getting-started"),children:"Getting Started"}),e.jsx("button",{onClick:()=>t("tutorials"),className:o("tutorials"),children:"Tutorials"}),e.jsx("button",{onClick:()=>t("documentation"),className:o("documentation"),children:"Documentation"})]}),e.jsxs("div",{className:"text-gray-500 text-sm mr-4 flex items-center",children:["Page ",a+1," of ",c]})]}),w(),e.jsxs("div",{className:"mt-8 flex justify-between items-center",children:[e.jsx("div",{className:"text-sm text-gray-500",children:e.jsxs("span",{className:"md:hidden",children:["Page ",a+1," of ",c]})}),e.jsxs("div",{className:"flex space-x-4",children:[e.jsx(L,{onClick:v,variant:"outline",type:"button",disabled:a===0,children:"Previous"}),e.jsx(L,{onClick:m,type:"button",disabled:a===c-1,children:"Next"})]})]})]})}const G={id:"path-selection",title:"Setup Path",description:"Choose your setup path",component:ie},Y=[{id:"project-setup",title:"Project Structure",description:"Set up your project namespace",component:le},{id:"broker-setup",title:"Broker Setup",description:"Configure your Solace PubSub+ broker connection",component:de},{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:ee},{id:"builtin-agent-setup",title:"Built-in Agents",description:"Enable and configure built-in agents",component:ve},{id:"file-service-setup",title:"File Service",description:"Configure storage for your files",component:je},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:se}],H=[{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:ee},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:se}];function Ee(){const[s,t]=g.useState(0),[c,a]=g.useState({}),[i,d]=g.useState(!1),[m,v]=g.useState(null),[o,j]=g.useState(null),[N,w]=g.useState(!1),[f,C]=g.useState([G]);g.useEffect(()=>{o&&(d(!0),fetch(`/api/default_options?path=${o}`).then(r=>{if(!r.ok)throw new Error("Failed to fetch default options");return r.json()}).then(r=>{if(r!=null&&r.default_options){const p=r.default_options;y(p),a({...c,...p}),d(!1)}else throw new Error("Invalid response format")}).catch(r=>{console.error("Error fetching default options:",r),v("Failed to connect to server, is the init process still running?"),d(!1)}))},[o]);const y=r=>{r.llm_model_name&&delete r.llm_model_name,r.embedding_model_name&&delete r.embedding_model_name};g.useEffect(()=>{o==="quick"?C([G,...H]):o==="advanced"&&C([G,...Y])},[o]);const E=f[s],M=r=>{r.setupPath&&r.setupPath!==o&&j(r.setupPath),r.showSuccess===!0&&w(!0),a({...c,...r})},I=()=>{s<f.length-1&&t(s+1)},l=()=>{s>0&&t(s-1)};if(i&&s>0)return e.jsxs("div",{className:"max-w-4xl mx-auto p-6 flex flex-col items-center justify-center min-h-[400px]",children:[e.jsx("h1",{className:"text-3xl font-bold mb-8 text-solace-blue",children:"Solace Agent Mesh Initialization"}),e.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 w-full text-center",children:[e.jsxs("div",{className:"animate-pulse flex flex-col items-center",children:[e.jsx("div",{className:"h-4 w-1/2 bg-gray-200 rounded mb-4"}),e.jsx("div",{className:"h-10 w-3/4 bg-gray-200 rounded"})]}),e.jsx("p",{className:"mt-4",children:"Loading configuration options..."})]})]});if(m)return e.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[e.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),e.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[e.jsxs("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4",role:"alert",children:[e.jsx("p",{className:"font-bold",children:"Error"}),e.jsx("p",{children:m})]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.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(N)return e.jsx("div",{className:"max-w-4xl mx-auto p-6",children:e.jsx(Ce,{})});const x=E.component,_=s>0,n=()=>o==="quick"?H:o==="advanced"?Y:[];return e.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[e.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),_&&e.jsx("div",{className:"mb-8",children:e.jsx(re,{steps:n(),currentStepIndex:s>0?s-1:0,onStepClick:r=>{}})}),e.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-bold mb-2 text-solace-blue",children:E.title}),e.jsx("p",{className:"text-gray-600 mb-6",children:E.description}),e.jsx(x,{data:c,updateData:M,onNext:I,onPrevious:l})]})]})}const Me=()=>[{title:"Solace Agent Mesh Initializer"},{name:"description",content:"Initialize your Solace Agent Mesh project"}];function Ae(){return e.jsx("div",{className:"min-h-screen bg-gray-50 py-8",children:e.jsx(Ee,{})})}export{Ae as default,Me as meta};
@@ -1 +1 @@
1
- window.__remixManifest={"entry":{"module":"/assets/entry.client-DX1misIU.js","imports":["/assets/index-BJHAE5s4.js","/assets/components-ZIfdTbrV.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/root-DgMDqKDc.js","imports":["/assets/index-BJHAE5s4.js","/assets/components-ZIfdTbrV.js"],"css":["/assets/root-hhS5izs8.css"]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_index-DRPGOzHj.js","imports":["/assets/index-BJHAE5s4.js"],"css":[]}},"url":"/assets/manifest-8147e469.js","version":"8147e469"};
1
+ window.__remixManifest={"entry":{"module":"/assets/entry.client-DX1misIU.js","imports":["/assets/index-BJHAE5s4.js","/assets/components-ZIfdTbrV.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/root-BApq5dPK.js","imports":["/assets/index-BJHAE5s4.js","/assets/components-ZIfdTbrV.js"],"css":["/assets/root-DX4gQ516.css"]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_index-b13CSm84.js","imports":["/assets/index-BJHAE5s4.js"],"css":[]}},"url":"/assets/manifest-c92a7808.js","version":"c92a7808"};