Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8e48f26
aap-164: add sidebar and layout ui
YaroslavPlaksii91 Jun 24, 2025
344a4ea
resolve conflict
YaroslavPlaksii91 Jun 24, 2025
ada85b2
Add auth ui
YaroslavPlaksii91 Jun 25, 2025
fee36b3
Chat list styles
YaroslavPlaksii91 Jun 25, 2025
63399af
change scroll styles
YaroslavPlaksii91 Jun 26, 2025
1fcb74e
fix header styles
YaroslavPlaksii91 Jun 26, 2025
274fbe4
add shadcn component library
YaroslavPlaksii91 Jun 26, 2025
dc586ac
resolve conflict
YaroslavPlaksii91 Jun 26, 2025
b932cf6
auth refactoring
YaroslavPlaksii91 Jun 27, 2025
1ebb893
A2A/MCP ui
YaroslavPlaksii91 Jun 27, 2025
1dcb265
components refactoring
YaroslavPlaksii91 Jun 28, 2025
e4a6701
add settings ui
YaroslavPlaksii91 Jun 29, 2025
c7c6ec0
add agents ui
YaroslavPlaksii91 Jun 29, 2025
25b9800
fix settings ui
YaroslavPlaksii91 Jun 30, 2025
41ba621
fix models validation
YaroslavPlaksii91 Jun 30, 2025
ddf058b
Add chat page UI
YaroslavPlaksii91 Jul 1, 2025
98e262d
Add flows UI
YaroslavPlaksii91 Jul 1, 2025
8138eb4
Add trace details UI
YaroslavPlaksii91 Jul 2, 2025
b344225
Fix node styles
YaroslavPlaksii91 Jul 2, 2025
772f517
fix styles
YaroslavPlaksii91 Jul 2, 2025
e8a6246
fix trace flow
YaroslavPlaksii91 Jul 2, 2025
8100262
Merge branch 'main' into feat/aap-164
YaroslavPlaksii91 Jul 2, 2025
a99c361
fix logo paths
YaroslavPlaksii91 Jul 2, 2025
a502d5c
add icons
YaroslavPlaksii91 Jul 2, 2025
4710192
fix settings styles
YaroslavPlaksii91 Jul 3, 2025
6f305fd
Merge branch 'main' into feat/aap-164
YaroslavPlaksii91 Jul 3, 2025
6690633
fix ui styles
YaroslavPlaksii91 Jul 3, 2025
6c1900a
fix text labels
YaroslavPlaksii91 Jul 3, 2025
3938d84
fix trace page styles
YaroslavPlaksii91 Jul 3, 2025
887c229
fix model card label
YaroslavPlaksii91 Jul 3, 2025
8a78b4d
fix flow name
YaroslavPlaksii91 Jul 3, 2025
0d469f0
fix nodes position
YaroslavPlaksii91 Jul 3, 2025
b806fed
router refactoring
YaroslavPlaksii91 Jul 4, 2025
17c71ce
fix nodes positions
YaroslavPlaksii91 Jul 4, 2025
fa93f50
add toaster
YaroslavPlaksii91 Jul 4, 2025
385bc79
AAP-184: Hotfix: incorrect reencryption of the api_key
valentynslivko Jul 4, 2025
b5b89ab
fix flow position
YaroslavPlaksii91 Jul 4, 2025
6c5d7a9
Merge branch 'feat/aap-164' of github.com:genai-works-org/genai-agent…
YaroslavPlaksii91 Jul 4, 2025
ebc8091
fix scroll
YaroslavPlaksii91 Jul 4, 2025
5c64185
Fix: chat name when only file was uploaded
valentynslivko Jul 4, 2025
b7d73d6
Fix: remove timestamp from chat title on empty initial message
valentynslivko Jul 7, 2025
d29a3d1
Fix: unique server url per user constaint instead of plain unique field
valentynslivko Jul 7, 2025
4b58c55
Hotfix: code style in migrations
valentynslivko Jul 7, 2025
39515cc
add hint for llm context
YaroslavPlaksii91 Jul 7, 2025
ffc42b7
Merge branch 'feat/aap-164' of github.com:genai-works-org/genai-agent…
YaroslavPlaksii91 Jul 7, 2025
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ examples/
*.webp

# Portable Network Graphics
*.png

# Animated Portable Network Graphics
*.apng
Expand All @@ -225,7 +224,6 @@ examples/
*.tif

# Scalable Vector Graphics
*.svg
*.svgz

# Portable Document Format
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""Unique mcp/a2a server url per user constraint

Revision ID: 8403bb364491
Revises: 046a06a0b0a4
Create Date: 2025-07-07 13:05:36.680696

"""

from typing import Sequence, Union

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "8403bb364491"
down_revision: Union[str, None] = "046a06a0b0a4"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint("a2acards_server_url_key", "a2acards", type_="unique")
op.create_unique_constraint(
"uq_a2a_card_server_url", "a2acards", ["creator_id", "server_url"]
)
op.drop_constraint("mcpservers_server_url_key", "mcpservers", type_="unique")
op.create_unique_constraint(
"uq_mcp_server_url", "mcpservers", ["creator_id", "server_url"]
)
# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint("uq_mcp_server_url", "mcpservers", type_="unique")
op.create_unique_constraint(
"mcpservers_server_url_key", "mcpservers", ["server_url"]
)
op.drop_constraint("uq_a2a_card_server_url", "a2acards", type_="unique")
op.create_unique_constraint("a2acards_server_url_key", "a2acards", ["server_url"])
# ### end Alembic commands ###
11 changes: 9 additions & 2 deletions backend/src/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class MCPServer(Base):
name: Mapped[str] = mapped_column(nullable=True)
description: Mapped[str] = mapped_column(nullable=True)

server_url: Mapped[str] = mapped_column(unique=True, nullable=False)
server_url: Mapped[str] = mapped_column(nullable=False)

mcp_tools: Mapped[List["MCPTool"]] = relationship(back_populates="mcp_server")

Expand All @@ -306,6 +306,10 @@ class MCPServer(Base):

is_active: Mapped[bool]

__table_args__ = (
UniqueConstraint("creator_id", "server_url", name="uq_mcp_server_url"),
)

def __repr__(self) -> str:
return f"<MCPServer(host={self.server_url!r}>"

Expand Down Expand Up @@ -336,7 +340,7 @@ class A2ACard(Base):
alias: Mapped[str] = mapped_column(nullable=True)
description: Mapped[str] = mapped_column(nullable=True)

server_url: Mapped[str] = mapped_column(unique=True, nullable=False)
server_url: Mapped[str] = mapped_column(nullable=False)
card_content: Mapped[not_null_json_column]

is_active: Mapped[bool]
Expand All @@ -349,6 +353,9 @@ class A2ACard(Base):
creator_id: Mapped[uuid.UUID] = mapped_column(
ForeignKey("users.id", ondelete="CASCADE"), nullable=True, index=True
)
__table_args__ = (
UniqueConstraint("creator_id", "server_url", name="uq_a2a_card_server_url"),
)


class ChatMessage(Base):
Expand Down
4 changes: 4 additions & 0 deletions backend/src/repositories/a2a.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import traceback
from datetime import datetime
from typing import Optional
from uuid import UUID
Expand Down Expand Up @@ -112,6 +113,9 @@ async def add_url(
)

except IntegrityError:
print("=" * 30)
print(traceback.format_exc())
print("=" * 30)
await db.rollback()
return await self.update_server_is_active_state(
db=db, user_id=user_id, agent_dto=a2a_card_dto
Expand Down
13 changes: 13 additions & 0 deletions backend/src/repositories/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sqlalchemy import and_, select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import selectinload
from src.auth.encrypt import decrypt_secret
from src.models import ModelConfig, ModelProvider, User
from src.repositories.base import CRUDBase
from src.schemas.api.model_config.dto import ModelConfigDTO, ModelProviderDTO
Expand Down Expand Up @@ -289,6 +290,18 @@ async def update_provider(
upd_in.api_key = None
return await self.update(db=db, db_obj=provider_obj, obj_in=upd_in.dump())

try:
new_api_key = decrypt_secret(upd_in.api_key)
prev_api_key = decrypt_secret(provider_obj.api_key)
if prev_api_key == new_api_key:
return await self.update(
db=db, db_obj=provider_obj, obj_in=upd_in.dump()
)
except ValueError:
# result of 'prev_api_key' decryption is a value that differs from the previously
# encrypted key -> cryptography library raises ValueError -> apply encryption to the new value
pass

api_key = validate_and_encrypt_provider_api_key(api_key=upd_in.api_key)
upd_in.api_key = api_key
return await self.update(db=db, db_obj=provider_obj, obj_in=upd_in.dump())
Expand Down
4 changes: 4 additions & 0 deletions backend/src/routes/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

settings = get_settings()
logger = logging.getLogger(__name__)

ws_router = APIRouter()


Expand Down Expand Up @@ -151,6 +152,9 @@ async def handle_frontend_ws(
f"Message validation failed. Details: {validation_exception_handler(exc=e)}" # noqa: E501
)
chat_title = message_obj.message[:20]
if not chat_title:
chat_title = "New Chat"

chat = await chat_repo.get_chat_by_session_id(
db=db, session_id=session_id, user_model=user_model
)
Expand Down
21 changes: 21 additions & 0 deletions frontend/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "./tailwind.config.js",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/utils/utils",
"ui": "@/components/ui",
"lib": "@/utils",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
Loading