Skip to content

Commit

Permalink
agent conflict changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BRama10 committed Sep 25, 2024
1 parent 53e1231 commit fbb3ff5
Show file tree
Hide file tree
Showing 84 changed files with 43 additions and 17,316 deletions.
2 changes: 1 addition & 1 deletion agenthub/app/agents/ContentLayout/AgentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function AgentCard({ item }: AgentCardProps) {

return (
<article className="overview-card-wrapper group ">
<a className="block p-2" href={`/agents/${item.name}`}>
<a className="block p-2" href={`/agents/${item.name}+${item.version}`}>
<header className="flex items-center mb-0.5" title={item.name}>
<AgentSVG />
<h4 className="text-md truncate font-mono text-black dark:group-hover:text-yellow-500 group-hover:text-blue-500 text-smd">
Expand Down
6 changes: 4 additions & 2 deletions agenthub/app/agents/[name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import AgentPage, { Agent } from "./agent";

export default async function Page({ params }: { params: { name: string } }) {
// let agentInfo: Agent;

const res = await fetch(`${baseUrl}/api/get_agent_by_name?name=${params.name}`);
// console.log(params.name.split('%2B'))
const res = await fetch(`${baseUrl}/api/get_agent_by_name_and_version?name=${params.name.split('%2B')[0]}&version=${params.name.split('%2B')[1]}`);
const agentInfo: Agent = await res.json();

console.log(agentInfo)

return <AgentPage agent={agentInfo} />
}
4 changes: 3 additions & 1 deletion agenthub/app/agents/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export const AgentList: AgentItem[] = [];
// export const AgentList =

export const AgentListGenerator: () => Promise<AgentItem[]> = async () => {
const res = await fetch(`${baseUrl}/api/get_all_agents/light`);
const res = await fetch(`${baseUrl}/api/get_all_agents/light`, { cache: 'no-store' });
const res_ = await res.json();

const values: AgentItem[] = Object.values(res_);

console.log('length', res_)

return values;
}

Expand Down
3 changes: 3 additions & 0 deletions agenthub/app/api/download/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export async function GET(request: Request): Promise<NextResponse> {
name,
author
},
orderBy: {
version: 'desc'
},
include: {
files: true
}
Expand Down
29 changes: 29 additions & 0 deletions agenthub/app/api/get_agent_by_name_and_version/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { NextResponse } from 'next/server';
import prisma from '../../../lib/prisma'

export async function GET(request: Request): Promise<NextResponse> {
const { searchParams } = new URL(request.url);
const name = searchParams.get('name');
const version = searchParams.get('version');

console.log(name, version)

if (name && version) {
const result = await prisma.agent.findFirst({
where: {
name,
version
},
include: {
files: true
}
});

if (result != null) {
return NextResponse.json({ ...result });
}
}


return NextResponse.json({ status: 'fail' });
}
2 changes: 1 addition & 1 deletion agenthub/app/api/get_all_agents/light/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import prisma from '../../../../lib/prisma'

export async function GET(request: Request): Promise<NextResponse> {
//linter
console.log(request)
// console.log(request)

const result = await prisma.agent.findMany({
select: {
Expand Down
2 changes: 1 addition & 1 deletion agenthub/app/api/get_all_agents/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import prisma from '../../../lib/prisma'

export async function GET(request: Request): Promise<NextResponse> {
//linter
console.log(request)
// console.log(request)
const result = await prisma.agent.findMany();

return NextResponse.json({...result});
Expand Down
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def transform_string(input_string: str):
input_string.split("/")[:-1]
)

agents = manager.list_available_agents()
agents = list(set(manager.list_available_agents()))
print(agents)
agent_names = [transform_string(a.get("agent")) for a in agents]

Expand Down
3 changes: 0 additions & 3 deletions web/.eslintrc.json

This file was deleted.

2 changes: 0 additions & 2 deletions web/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions web/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions web/agents/agent.ts

This file was deleted.

107 changes: 0 additions & 107 deletions web/agents/build.ts

This file was deleted.

1 change: 0 additions & 1 deletion web/agents/constants.ts

This file was deleted.

62 changes: 0 additions & 62 deletions web/agents/graph.ts

This file was deleted.

Loading

0 comments on commit fbb3ff5

Please sign in to comment.