Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions samples/client/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
"scripts": {
"serve:agent:restaurant": "cd ../../agent/adk/restaurant_finder && uv run .",
"serve:agent:contact_lookup": "cd ../../agent/adk/contact_lookup && uv run .",
"serve:agent:orchestrator": "cd ../../agent/adk/orchestrator && uv run .",
"serve:agent:restaurant:orchestrator": "cd ../../agent/adk/restaurant_finder && uv run . --port=10003",
"serve:agent:contact_lookup:orchestrator": "cd ../../agent/adk/contact_lookup && uv run . --port=10004",
"serve:agent:rizzcharts:orchestrator": "cd ../../agent/adk/rizzcharts && uv run . --port=10005",
"serve:agent:orchestrator": "cd ../../agent/adk/orchestrator && uv run . --port=10002 --subagent_urls=http://localhost:10003 --subagent_urls=http://localhost:10004 --subagent_urls=http://localhost:10005",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The ports for the subagents (10003, 10004, 10005) are hardcoded in this script and also in the serve:agent:*:orchestrator scripts on lines 13-15. This duplication means that if a port number changes, it must be updated in two places, which is error-prone and violates the DRY principle. Consider using a mechanism to define these ports only once. For example, you could use a tool like cross-env to set environment variables for the ports and reference them in the scripts, making them more robust and easier to maintain.

"serve:shell": "cd shell && npm run dev",
"build:renderer": "cd ../../../renderers && for dir in 'web_core' 'markdown/markdown-it' 'lit'; do (cd \"$dir\" && npm install && npm run build); done",
"demo:restaurant": "npm install && npm run build:renderer && concurrently -k -n \"SHELL,REST\" -c \"magenta,blue\" \"npm run serve:shell\" \"npm run serve:agent:restaurant\"",
"demo:contact": "npm install && npm run build:renderer && concurrently -k -n \"SHELL,CONT1\" -c \"magenta,green\" \"npm run serve:shell\" \"npm run serve:agent:contact_lookup\"",
"demo:orchestrator": "npm install && npm run build:renderer && concurrently -k -n \"SHELL,ORCH\" -c \"magenta,cyan\" \"npm run serve:shell\" \"npm run serve:agent:orchestrator\""
"demo:orchestrator": "npm install && npm run build:renderer && concurrently -k -n \"SHELL,REST,CONT,RIZZ,ORCH\" -c \"magenta,blue,green,yellow,cyan\" \"npm run serve:shell\" \"npm run serve:agent:restaurant:orchestrator\" \"npm run serve:agent:contact_lookup:orchestrator\" \"npm run serve:agent:rizzcharts:orchestrator\" \"npm run serve:agent:orchestrator\""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This script definition is very long, which harms readability and maintainability. To make it cleaner, you could extract the logic for running the subagents into a separate helper script.

For example, you could add a serve:subagents:orchestrator script:

"serve:subagents:orchestrator": "concurrently -k -n \"REST,CONT,RIZZ\" -c \"blue,green,yellow\" \"npm run serve:agent:restaurant:orchestrator\" \"npm run serve:agent:contact_lookup:orchestrator\" \"npm run serve:agent:rizzcharts:orchestrator\""

Then, the demo:orchestrator script would be much simpler:

"demo:orchestrator": "npm install && npm run build:renderer && concurrently -k -n \"SHELL,AGENTS,ORCH\" -c \"magenta,white,cyan\" \"npm run serve:shell\" \"npm run serve:subagents:orchestrator\" \"npm run serve:agent:orchestrator\""

},
"devDependencies": {
"concurrently": "9.2.1"
Expand Down