Skip to content
Merged
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</p>

<p align="center">
<img src="https://img.shields.io/badge/version-0.2.17-blue" alt="Version 0.2.17" />
<img src="https://img.shields.io/badge/version-0.2.18-blue" alt="Version 0.2.18" />
<img src="https://img.shields.io/badge/A2A-v0.3.0-blueviolet" alt="A2A v0.3.0" />
<img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License" />
<img src="https://img.shields.io/badge/status-beta-orange" alt="Status: Beta" />
Expand Down Expand Up @@ -235,7 +235,8 @@ Each agent has an A2A Agent Card describing its capabilities:
],
"capabilities": { "streaming": false, "pushNotifications": false },
"defaultInputModes": ["text/plain"],
"defaultOutputModes": ["text/plain"]
"defaultOutputModes": ["text/plain"],
"fundingAddress": "0x742d...8f4a"
}
```

Expand Down Expand Up @@ -449,7 +450,7 @@ The protocol version is defined in a single place:

```typescript
// protocol/src/types.ts
export const REEF_VERSION = "0.2.17";
export const REEF_VERSION = "0.2.18";
export const A2A_PROTOCOL_VERSION = "0.3.0";
```

Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reef-protocol/client",
"version": "0.2.17",
"version": "0.2.18",
"description": "Reef Protocol client — daemon, CLI, and identity management",
"type": "module",
"main": "dist/daemon.js",
Expand Down
2 changes: 1 addition & 1 deletion directory/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@reef-protocol/directory",
"private": true,
"version": "0.2.17",
"version": "0.2.18",
"description": "Reef Protocol directory server — agent discovery and network stats",
"type": "module",
"main": "dist/index.js",
Expand Down
16 changes: 16 additions & 0 deletions directory/src/migrations/00011_add-funding-address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { DataTypes, type Sequelize } from "sequelize";

export async function up({ context: sequelize }: { context: Sequelize }) {
const qi = sequelize.getQueryInterface();

await qi.addColumn("agents", "funding_address", {
type: DataTypes.STRING(42),
allowNull: true,
defaultValue: null,
});
}

export async function down({ context: sequelize }: { context: Sequelize }) {
const qi = sequelize.getQueryInterface();
await qi.removeColumn("agents", "funding_address");
}
7 changes: 7 additions & 0 deletions directory/src/models/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface AgentAttributes {
reputation_updated_at: Date | null;
country: string | null;
icon_url: string | null;
funding_address: string | null;
}

export class Agent extends Model<AgentAttributes> {
Expand All @@ -41,6 +42,7 @@ export class Agent extends Model<AgentAttributes> {
declare reputation_updated_at: Date | null;
declare country: string | null;
declare icon_url: string | null;
declare funding_address: string | null;
declare readonly created_at: Date;
declare readonly updated_at: Date;
}
Expand Down Expand Up @@ -133,6 +135,11 @@ export function initAgentModel(sequelize: Sequelize): void {
allowNull: true,
defaultValue: null,
},
funding_address: {
type: DataTypes.STRING(42),
allowNull: true,
defaultValue: null,
},
},
{
sequelize,
Expand Down
6 changes: 6 additions & 0 deletions directory/src/routes/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ agentsRouter.post("/register", registrationLimiter, async (req, res, next) => {
const skillTags = agentCard.skills.flatMap((s) => s.tags);
const iconUrl = (agentCard as unknown as Record<string, unknown>)
.iconUrl as string | undefined;
const fundingAddress = (agentCard as unknown as Record<string, unknown>)
.fundingAddress as string | undefined;

let agent = await Agent.findByPk(addr);

Expand All @@ -70,6 +72,7 @@ agentsRouter.post("/register", registrationLimiter, async (req, res, next) => {
last_heartbeat: new Date(),
agent_card: agentCard,
icon_url: iconUrl || agent.icon_url,
funding_address: fundingAddress || agent.funding_address,
});
} else {
agent = await Agent.create({
Expand All @@ -90,6 +93,7 @@ agentsRouter.post("/register", registrationLimiter, async (req, res, next) => {
app_interactions: {},
reputation_updated_at: null,
icon_url: iconUrl || null,
funding_address: fundingAddress || null,
});
}

Expand Down Expand Up @@ -152,6 +156,7 @@ agentsRouter.get("/search", searchLimiter, async (req, res, next) => {
availability: a.availability,
agentCard: a.agent_card,
iconUrl: a.icon_url ?? null,
fundingAddress: a.funding_address ?? null,
registeredAt: a.created_at?.toISOString(),
lastHeartbeat: a.last_heartbeat?.toISOString(),
reputationScore: a.reputation_score,
Expand Down Expand Up @@ -378,6 +383,7 @@ agentsRouter.get("/:address", readLimiter, async (req, res, next) => {
tasksFailed: agent.tasks_failed,
totalInteractions: agent.total_interactions,
country: agent.country ?? null,
fundingAddress: agent.funding_address ?? null,
});
} catch (err) {
next(err);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
"typescript-eslint": "^8.56.0",
"vitest": "^3.0.0"
},
"version": "0.2.17"
"version": "0.2.18"
}
2 changes: 1 addition & 1 deletion protocol/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reef-protocol/protocol",
"version": "0.2.17",
"version": "0.2.18",
"description": "Shared message types, envelope codec, and validation for Reef Protocol",
"type": "module",
"main": "dist/index.js",
Expand Down
6 changes: 5 additions & 1 deletion protocol/src/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function buildReefAgentCard(
name: string,
description: string,
skills: AgentSkill[],
options?: { iconUrl?: string },
options?: { iconUrl?: string; fundingAddress?: string },
): AgentCard {
const card: AgentCard = {
name,
Expand All @@ -105,6 +105,10 @@ export function buildReefAgentCard(
if (options?.iconUrl) {
(card as unknown as Record<string, unknown>).iconUrl = options.iconUrl;
}
if (options?.fundingAddress) {
(card as unknown as Record<string, unknown>).fundingAddress =
options.fundingAddress;
}
return card;
}

Expand Down
4 changes: 3 additions & 1 deletion protocol/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { AgentCard } from "@a2a-js/sdk";

export const REEF_VERSION = "0.2.17";
export const REEF_VERSION = "0.2.18";
export const A2A_PROTOCOL_VERSION = "0.3.0";
export const DEFAULT_DIRECTORY_URL =
"https://reef-protocol-production.up.railway.app";
Expand Down Expand Up @@ -104,6 +104,8 @@ export interface AgentSearchResult {
agentCard: AgentCard | null;
/** URL to an icon/avatar image for this agent */
iconUrl?: string | null;
/** Base wallet address for receiving USDC payments */
fundingAddress?: string | null;
registeredAt?: string;
lastHeartbeat?: string;
reputationScore?: number;
Expand Down
1 change: 1 addition & 0 deletions protocol/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const agentCardSchema = z.object({
defaultOutputModes: z.array(z.string()),
preferredTransport: z.string().optional(),
iconUrl: z.string().url().optional(),
fundingAddress: z.string().optional(),
provider: z
.object({
organization: z.string(),
Expand Down