Skip to content

Commit 81cdfa3

Browse files
authored
Merge pull request #57 from Reef-Network/staging
staging 2 main
2 parents 88c93cd + e401f16 commit 81cdfa3

File tree

11 files changed

+28
-19
lines changed

11 files changed

+28
-19
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</p>
1313

1414
<p align="center">
15-
<img src="https://img.shields.io/badge/version-0.2.16-blue" alt="Version 0.2.16" />
15+
<img src="https://img.shields.io/badge/version-0.2.17-blue" alt="Version 0.2.17" />
1616
<img src="https://img.shields.io/badge/A2A-v0.3.0-blueviolet" alt="A2A v0.3.0" />
1717
<img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License" />
1818
<img src="https://img.shields.io/badge/status-beta-orange" alt="Status: Beta" />
@@ -449,7 +449,7 @@ The protocol version is defined in a single place:
449449

450450
```typescript
451451
// protocol/src/types.ts
452-
export const REEF_VERSION = "0.2.16";
452+
export const REEF_VERSION = "0.2.17";
453453
export const A2A_PROTOCOL_VERSION = "0.3.0";
454454
```
455455

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reef-protocol/client",
3-
"version": "0.2.16",
3+
"version": "0.2.17",
44
"description": "Reef Protocol client — daemon, CLI, and identity management",
55
"type": "module",
66
"main": "dist/daemon.js",

client/src/app-markdown.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ function parseFrontmatter(text: string): FrontmatterMap {
157157
const items: FrontmatterMap[] = [];
158158
i++;
159159
while (i < lines.length) {
160+
// Skip blank lines between array items
161+
if (!lines[i].trim()) {
162+
i++;
163+
continue;
164+
}
160165
const itemLine = lines[i];
161166
if (!itemLine.match(/^\s+-\s/)) break;
162167

@@ -176,8 +181,7 @@ function parseFrontmatter(text: string): FrontmatterMap {
176181
const contLine = lines[i];
177182
if (
178183
contLine.match(/^\s+-\s/) || // next array item
179-
!contLine.match(/^\s/) || // back to top-level
180-
!contLine.trim()
184+
!contLine.match(/^\s/) // back to top-level
181185
) {
182186
break;
183187
}

directory/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@reef-protocol/directory",
33
"private": true,
4-
"version": "0.2.16",
4+
"version": "0.2.17",
55
"description": "Reef Protocol directory server — agent discovery and network stats",
66
"type": "module",
77
"main": "dist/index.js",

directory/src/__tests__/api.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@ describe("heartbeat piggybacking for coordinated apps", () => {
649649
expect(appRes.status).toBe(200);
650650
expect(appRes.body.availability).toBe("available");
651651
expect(appRes.body.tasksCompleted).toBe(3);
652-
expect(appRes.body.totalInteractions).toBe(3);
652+
// totalInteractions is tracked independently via appInteractions, not piggybacked
653+
expect(appRes.body.totalInteractions).toBe(0);
653654
});
654655

655656
it("does not piggyback on unrelated agent heartbeat", async () => {
@@ -807,19 +808,23 @@ describe("GET /apps/search?sortBy=interactions", () => {
807808
}),
808809
});
809810

810-
// Send heartbeat with high interaction count
811+
// Send heartbeat with appInteractions to increment the app's total_interactions
811812
const payload = await signedHeartbeat({
812813
address: highAddr,
813814
_account: highInteractionAccount,
814-
telemetry: { tasksCompleted: 50, tasksFailed: 5 },
815+
telemetry: {
816+
tasksCompleted: 50,
817+
tasksFailed: 5,
818+
appInteractions: { "high-interact-app": 55 },
819+
},
815820
});
816821
await request.post("/agents/heartbeat").send(payload);
817822

818823
const res = await request.get("/apps/search?sortBy=interactions");
819824
expect(res.status).toBe(200);
820825
expect(res.body.apps.length).toBeGreaterThan(0);
821826

822-
// high-interact-app should be first since it has 55 interactions
827+
// high-interact-app should be first since it has 55 interactions via appInteractions
823828
expect(res.body.apps[0].appId).toBe("high-interact-app");
824829
});
825830
});

directory/src/routes/agents.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,12 @@ agentsRouter.post("/heartbeat", heartbeatLimiter, async (req, res, next) => {
282282
last_refreshed: now,
283283
tasks_completed: newTasksCompleted,
284284
tasks_failed: newTasksFailed,
285-
total_interactions: newTasksCompleted + newTasksFailed,
286285
};
287286

288287
const appInput = toAppReputationInput({
289288
...coordApp.get({ plain: true }),
290289
tasks_completed: newTasksCompleted,
291290
tasks_failed: newTasksFailed,
292-
total_interactions: newTasksCompleted + newTasksFailed,
293291
created_at: coordApp.created_at ?? now,
294292
} as App);
295293

directory/src/routes/apps.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ appsRouter.post("/register", registrationLimiter, async (req, res, next) => {
3737
const body = appRegisterPayloadSchema.parse(req.body);
3838
const addr = body.address.toLowerCase();
3939
const manifest = body.manifest;
40-
const coordinatorAddr = manifest.coordinatorAddress?.toLowerCase() || null;
41-
42-
const isCoordinated = !!manifest.coordinatorAddress;
40+
const isCoordinated =
41+
manifest.type === "coordinated" || !!manifest.coordinatorAddress;
42+
const coordinatorAddr = isCoordinated
43+
? manifest.coordinatorAddress?.toLowerCase() || addr
44+
: null;
4345

4446
let app = await App.findByPk(body.appId);
4547

openclaw/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reef-protocol/reef-openclaw",
3-
"version": "0.2.15",
3+
"version": "0.2.17",
44
"description": "Reef Protocol channel plugin for OpenClaw — receive and respond to A2A messages",
55
"type": "module",
66
"main": "dist/index.js",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
"typescript-eslint": "^8.56.0",
3333
"vitest": "^3.0.0"
3434
},
35-
"version": "0.2.16"
35+
"version": "0.2.17"
3636
}

protocol/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reef-protocol/protocol",
3-
"version": "0.2.16",
3+
"version": "0.2.17",
44
"description": "Shared message types, envelope codec, and validation for Reef Protocol",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)