Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Open
Show file tree
Hide file tree
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
613 changes: 613 additions & 0 deletions PROTOCOLS.md

Large diffs are not rendered by default.

830 changes: 326 additions & 504 deletions README.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions gemini-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
"args": ["-m", "mcp_server_git"],
"description": "Git operations through MCP protocol"
},
"Puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"],
"description": "Browser automation with Puppeteer MCP server"
},
"Sequential Thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
Expand Down
6,250 changes: 3,106 additions & 3,144 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
"dotenv": "^16.3.1",
"eventemitter3": "^5.0.1",
"express": "^4.18.2",
"ffmpeg-static": "^5.2.0",
"google-auth-library": "^10.2.1",
"googleapis": "^118.0.0",
"helmet": "^7.1.0",
Expand Down Expand Up @@ -151,7 +150,6 @@
"@modelcontextprotocol/server-filesystem": "^2025.8.21",
"@modelcontextprotocol/server-github": "^2025.4.8",
"@modelcontextprotocol/server-memory": "^2025.8.4",
"@modelcontextprotocol/server-puppeteer": "^2025.5.12",
"@modelcontextprotocol/server-redis": "^2025.4.25",
"@modelcontextprotocol/server-sequential-thinking": "^2025.7.1",
"@rollup/plugin-commonjs": "^25.0.7",
Expand All @@ -169,6 +167,7 @@
"@types/lodash": "^4.14.201",
"@types/multer": "^1.4.9",
"@types/node": "^20.19.21",
"@types/react": "^19.2.4",
"@types/uuid": "^9.0.6",
"@types/ws": "^8.5.8",
"@typescript-eslint/eslint-plugin": "^6.9.1",
Expand All @@ -183,10 +182,15 @@
"eslint-plugin-security": "^1.7.1",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"ink": "^6.5.0",
"ink-select-input": "^6.2.0",
"ink-spinner": "^5.0.0",
"ink-text-input": "^6.0.0",
"lint-staged": "^15.0.2",
"mcp-omnisearch": "^0.0.15",
"nodemon": "^3.0.1",
"prettier": "^3.0.3",
"react": "^19.2.0",
"rollup": "^4.3.0",
"rollup-plugin-visualizer": "^5.9.2",
"semantic-release": "^22.0.5",
Expand All @@ -195,7 +199,7 @@
},
"optionalDependencies": {
"canvas": "^2.11.2",
"puppeteer": "^24.16.2",
"playwright": "^1.48.0",
"sharp": "^0.33.0"
},
"lint-staged": {
Expand Down
267 changes: 267 additions & 0 deletions packages/core/protocols/a2a/agent-card.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
/**
* Agent Card Management
* Handles agent discovery and capability advertisement
*/

import { AgentCard, Capability, AgentEndpoint } from './types.js';

Check warning on line 6 in packages/core/protocols/a2a/agent-card.ts

View check run for this annotation

codefactor.io / CodeFactor

packages/core/protocols/a2a/agent-card.ts#L6

'AgentEndpoint' is defined but never used. (@typescript-eslint/no-unused-vars)
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Unused import AgentEndpoint.

Suggested change
import { AgentCard, Capability, AgentEndpoint } from './types.js';
import { AgentCard, Capability } from './types.js';

Copilot uses AI. Check for mistakes.

export class AgentCardManager {
private agentCards: Map<string, AgentCard> = new Map();

/**
* Register an agent
*/
registerAgent(card: AgentCard): void {
this.agentCards.set(card.id, card);
console.log(`[A2A] Registered agent: ${card.name} (${card.id})`);

Check notice on line 16 in packages/core/protocols/a2a/agent-card.ts

View check run for this annotation

codefactor.io / CodeFactor

packages/core/protocols/a2a/agent-card.ts#L16

Unexpected console statement. (no-console)
}

/**
* Unregister an agent
*/
unregisterAgent(agentId: string): boolean {
const removed = this.agentCards.delete(agentId);
if (removed) {
console.log(`[A2A] Unregistered agent: ${agentId}`);

Check notice on line 25 in packages/core/protocols/a2a/agent-card.ts

View check run for this annotation

codefactor.io / CodeFactor

packages/core/protocols/a2a/agent-card.ts#L25

Unexpected console statement. (no-console)
}
return removed;
}

/**
* Get agent card by ID
*/
getAgent(agentId: string): AgentCard | undefined {
return this.agentCards.get(agentId);
}

/**
* Discover agents by capability
*/
discoverAgents(capability?: string): AgentCard[] {
const agents = Array.from(this.agentCards.values());

if (!capability) {
return agents;
}

return agents.filter(agent =>
agent.capabilities.some(cap => cap.name === capability || cap.id === capability)
);
}

/**
* Find agents matching criteria
*/
findAgents(filters: {
capabilities?: string[];
protocols?: string[];
name?: string;
}): AgentCard[] {
let agents = Array.from(this.agentCards.values());

// Filter by capabilities
if (filters.capabilities && filters.capabilities.length > 0) {
agents = agents.filter(agent =>
filters.capabilities!.every(reqCap =>
agent.capabilities.some(cap => cap.name === reqCap || cap.id === reqCap)
)
);
}

// Filter by protocols
if (filters.protocols && filters.protocols.length > 0) {
agents = agents.filter(agent =>
agent.capabilities.some(cap =>
filters.protocols!.some(proto => cap.protocols.includes(proto))
)
);
}

// Filter by name
if (filters.name) {
const searchTerm = filters.name.toLowerCase();
agents = agents.filter(agent =>
agent.name.toLowerCase().includes(searchTerm) ||
agent.description.toLowerCase().includes(searchTerm)
);
}

return agents;
}

/**
* Get all registered agents
*/
getAllAgents(): AgentCard[] {
return Array.from(this.agentCards.values());
}

/**
* Check if agent has capability
*/
hasCapability(agentId: string, capabilityId: string): boolean {
const agent = this.agentCards.get(agentId);
if (!agent) {
return false;
}

return agent.capabilities.some(cap => cap.id === capabilityId || cap.name === capabilityId);
}

/**
* Get capability details
*/
getCapability(agentId: string, capabilityId: string): Capability | undefined {
const agent = this.agentCards.get(agentId);
if (!agent) {
return undefined;
}

return agent.capabilities.find(cap => cap.id === capabilityId || cap.name === capabilityId);
}

/**
* Update agent card
*/
updateAgent(agentId: string, updates: Partial<AgentCard>): boolean {
const agent = this.agentCards.get(agentId);
if (!agent) {
return false;
}

const updated = { ...agent, ...updates, id: agent.id }; // Preserve ID
this.agentCards.set(agentId, updated);
console.log(`[A2A] Updated agent: ${agentId}`);

Check notice on line 134 in packages/core/protocols/a2a/agent-card.ts

View check run for this annotation

codefactor.io / CodeFactor

packages/core/protocols/a2a/agent-card.ts#L134

Unexpected console statement. (no-console)
return true;
}

/**
* Export agent cards (for persistence)
*/
exportCards(): AgentCard[] {
return Array.from(this.agentCards.values());
}

/**
* Import agent cards (from persistence)
*/
importCards(cards: AgentCard[]): void {
for (const card of cards) {
this.agentCards.set(card.id, card);
}
console.log(`[A2A] Imported ${cards.length} agent cards`);

Check notice on line 152 in packages/core/protocols/a2a/agent-card.ts

View check run for this annotation

codefactor.io / CodeFactor

packages/core/protocols/a2a/agent-card.ts#L152

Unexpected console statement. (no-console)
}

/**
* Clear all agents
*/
clear(): void {
this.agentCards.clear();
console.log('[A2A] Cleared all agent cards');

Check notice on line 160 in packages/core/protocols/a2a/agent-card.ts

View check run for this annotation

codefactor.io / CodeFactor

packages/core/protocols/a2a/agent-card.ts#L160

Unexpected console statement. (no-console)
}

/**
* Get agent count
*/
count(): number {
return this.agentCards.size;
}
}

/**
* Create Gemini-Flow's own agent card
*/
export function createGeminiFlowAgentCard(): AgentCard {
return {
id: 'gemini-flow-orchestrator',
name: 'Gemini-Flow Orchestrator',
description: 'Quantum-ready AI orchestration platform for Google services',
version: '1.0.0',
capabilities: [
{
id: 'orchestrate',
name: 'AI Orchestration',
description: 'Orchestrate multiple AI services and agents',
inputSchema: {
type: 'object',
properties: {
task: { type: 'string' },
services: { type: 'array' },
options: { type: 'object' }
},
required: ['task']
},
outputSchema: {
type: 'object',
properties: {
result: { type: 'any' },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The outputSchema for the orchestrate capability uses { type: 'any' } for the result. This weakens the schema contract and provides no information about the expected output structure. It's better to define a more specific schema, even if it's a union of possible result types. If any is truly necessary, a comment explaining why would improve clarity.

metrics: { type: 'object' }
}
},
protocols: ['A2A/1.0', 'AP2/1.0', 'MCP/1.0']
},
{
id: 'quantum-optimize',
name: 'Quantum Optimization',
description: 'Optimize problems using quantum computing',
inputSchema: {
type: 'object',
properties: {
problem: { type: 'string' },
algorithm: { type: 'string' },
parameters: { type: 'object' }
},
required: ['problem']
},
outputSchema: {
type: 'object',
properties: {
solution: { type: 'any' },
circuit: { type: 'object' }
}
},
protocols: ['A2A/1.0']
},
{
id: 'browser-automate',
name: 'Browser Automation',
description: 'Automate Google services via Playwright',
inputSchema: {
type: 'object',
properties: {
service: { type: 'string' },
action: { type: 'string' },
params: { type: 'object' }
},
required: ['service', 'action']
},
outputSchema: {
type: 'object',
properties: {
result: { type: 'any' },
screenshot: { type: 'string' }
}
},
protocols: ['A2A/1.0']
}
],
endpoints: [
{
url: 'http://localhost:3000/a2a',
protocol: 'http',
transport: 'json-rpc'
}
],
authentication: {
type: 'bearer',
bearerFormat: 'JWT'
},
metadata: {
author: 'clduab11',
repository: 'https://github.com/clduab11/gemini-flow',
protocols: ['A2A/1.0', 'AP2/1.0', 'MCP/1.0'],
quantumReady: true,
ultraSupport: true
}
};
}
Loading
Loading