agentbnb 5.1.6 → 5.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -602,13 +602,22 @@ async function executeCapabilityRequest(opts) {
602
602
  return { success: false, error: { code: -32602, message: `Card not found: ${cardId}` } };
603
603
  }
604
604
  if (requester === card.owner && !relayAuthorized) {
605
- return {
606
- success: false,
607
- error: {
608
- code: -32603,
609
- message: `Self-request blocked: requester (${requester}) is the card owner. Set AGENTBNB_DIR to your agent's config directory before calling agentbnb request.`
610
- }
611
- };
605
+ const msg = `Self-request blocked: requester (${requester}) is the card owner. Set AGENTBNB_DIR to your agent's config directory before calling agentbnb request.`;
606
+ try {
607
+ insertRequestLog(registryDb, {
608
+ id: randomUUID2(),
609
+ card_id: cardId,
610
+ card_name: card.name,
611
+ skill_id: skillId,
612
+ requester,
613
+ status: "failure",
614
+ latency_ms: 0,
615
+ credits_charged: 0,
616
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
617
+ });
618
+ } catch {
619
+ }
620
+ return { success: false, error: { code: -32603, message: msg } };
612
621
  }
613
622
  let creditsNeeded;
614
623
  let cardName;
@@ -710,7 +719,19 @@ async function executeCapabilityRequest(opts) {
710
719
  return { success: true, result: successResult };
711
720
  };
712
721
  if (skillExecutor) {
713
- const targetSkillId = resolvedSkillId ?? skillId ?? cardId;
722
+ let targetSkillId = resolvedSkillId ?? skillId;
723
+ if (!targetSkillId) {
724
+ const available = skillExecutor.listSkills();
725
+ if (available.length > 0) {
726
+ targetSkillId = available[0];
727
+ } else {
728
+ return handleFailure(
729
+ "failure",
730
+ Date.now() - startMs,
731
+ "No skill_id specified and no skills registered on this provider."
732
+ );
733
+ }
734
+ }
714
735
  try {
715
736
  const execResult = await skillExecutor.execute(targetSkillId, params, onProgress);
716
737
  if (!execResult.success) {
@@ -41,13 +41,22 @@ async function executeCapabilityRequest(opts) {
41
41
  return { success: false, error: { code: -32602, message: `Card not found: ${cardId}` } };
42
42
  }
43
43
  if (requester === card.owner && !relayAuthorized) {
44
- return {
45
- success: false,
46
- error: {
47
- code: -32603,
48
- message: `Self-request blocked: requester (${requester}) is the card owner. Set AGENTBNB_DIR to your agent's config directory before calling agentbnb request.`
49
- }
50
- };
44
+ const msg = `Self-request blocked: requester (${requester}) is the card owner. Set AGENTBNB_DIR to your agent's config directory before calling agentbnb request.`;
45
+ try {
46
+ insertRequestLog(registryDb, {
47
+ id: randomUUID(),
48
+ card_id: cardId,
49
+ card_name: card.name,
50
+ skill_id: skillId,
51
+ requester,
52
+ status: "failure",
53
+ latency_ms: 0,
54
+ credits_charged: 0,
55
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
56
+ });
57
+ } catch {
58
+ }
59
+ return { success: false, error: { code: -32603, message: msg } };
51
60
  }
52
61
  let creditsNeeded;
53
62
  let cardName;
@@ -149,7 +158,19 @@ async function executeCapabilityRequest(opts) {
149
158
  return { success: true, result: successResult };
150
159
  };
151
160
  if (skillExecutor) {
152
- const targetSkillId = resolvedSkillId ?? skillId ?? cardId;
161
+ let targetSkillId = resolvedSkillId ?? skillId;
162
+ if (!targetSkillId) {
163
+ const available = skillExecutor.listSkills();
164
+ if (available.length > 0) {
165
+ targetSkillId = available[0];
166
+ } else {
167
+ return handleFailure(
168
+ "failure",
169
+ Date.now() - startMs,
170
+ "No skill_id specified and no skills registered on this provider."
171
+ );
172
+ }
173
+ }
153
174
  try {
154
175
  const execResult = await skillExecutor.execute(targetSkillId, params, onProgress);
155
176
  if (!execResult.success) {
package/dist/cli/index.js CHANGED
@@ -1559,7 +1559,7 @@ program.command("serve").description("Start the AgentBnB gateway server").option
1559
1559
  process.exit(1);
1560
1560
  }
1561
1561
  const { ProcessGuard } = await import("../process-guard-CC7CNRQJ.js");
1562
- const { ServiceCoordinator } = await import("../service-coordinator-JB6VM6SF.js");
1562
+ const { ServiceCoordinator } = await import("../service-coordinator-HHK455RQ.js");
1563
1563
  const port = opts.port ? parseInt(opts.port, 10) : config.gateway_port;
1564
1564
  const registryPort = parseInt(opts.registryPort, 10);
1565
1565
  if (!Number.isFinite(port) || !Number.isFinite(registryPort)) {
@@ -1928,7 +1928,7 @@ Feedback for skill: ${opts.skill} (${feedbacks.length} entries)
1928
1928
  }
1929
1929
  });
1930
1930
  program.command("mcp-server").description("Start an MCP (Model Context Protocol) server for IDE integration").action(async () => {
1931
- const { startMcpServer } = await import("../server-RKVZ4HXC.js");
1931
+ const { startMcpServer } = await import("../server-WY7KWD3X.js");
1932
1932
  await startMcpServer();
1933
1933
  });
1934
1934
  await program.parseAsync(process.argv);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeCapabilityBatch,
3
3
  executeCapabilityRequest
4
- } from "./chunk-DC5AC6UA.js";
4
+ } from "./chunk-EPIWHNB2.js";
5
5
  import "./chunk-CRFCWD6V.js";
6
6
  import "./chunk-WGZ5AGOX.js";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeCapabilityBatch,
3
3
  executeCapabilityRequest
4
- } from "./chunk-ZZVFYYUA.js";
4
+ } from "./chunk-QQFBFV4V.js";
5
5
  import "./chunk-UKT6H7YT.js";
6
6
  import "./chunk-DFBX3BBD.js";
7
7
  import "./chunk-EANI2N2V.js";
package/dist/index.js CHANGED
@@ -947,13 +947,22 @@ async function executeCapabilityRequest(opts) {
947
947
  return { success: false, error: { code: -32602, message: `Card not found: ${cardId}` } };
948
948
  }
949
949
  if (requester === card.owner && !relayAuthorized) {
950
- return {
951
- success: false,
952
- error: {
953
- code: -32603,
954
- message: `Self-request blocked: requester (${requester}) is the card owner. Set AGENTBNB_DIR to your agent's config directory before calling agentbnb request.`
955
- }
956
- };
950
+ const msg = `Self-request blocked: requester (${requester}) is the card owner. Set AGENTBNB_DIR to your agent's config directory before calling agentbnb request.`;
951
+ try {
952
+ insertRequestLog(registryDb, {
953
+ id: randomUUID5(),
954
+ card_id: cardId,
955
+ card_name: card.name,
956
+ skill_id: skillId,
957
+ requester,
958
+ status: "failure",
959
+ latency_ms: 0,
960
+ credits_charged: 0,
961
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
962
+ });
963
+ } catch {
964
+ }
965
+ return { success: false, error: { code: -32603, message: msg } };
957
966
  }
958
967
  let creditsNeeded;
959
968
  let cardName;
@@ -1055,7 +1064,19 @@ async function executeCapabilityRequest(opts) {
1055
1064
  return { success: true, result: successResult };
1056
1065
  };
1057
1066
  if (skillExecutor) {
1058
- const targetSkillId = resolvedSkillId ?? skillId ?? cardId;
1067
+ let targetSkillId = resolvedSkillId ?? skillId;
1068
+ if (!targetSkillId) {
1069
+ const available = skillExecutor.listSkills();
1070
+ if (available.length > 0) {
1071
+ targetSkillId = available[0];
1072
+ } else {
1073
+ return handleFailure(
1074
+ "failure",
1075
+ Date.now() - startMs,
1076
+ "No skill_id specified and no skills registered on this provider."
1077
+ );
1078
+ }
1079
+ }
1059
1080
  try {
1060
1081
  const execResult = await skillExecutor.execute(targetSkillId, params, onProgress);
1061
1082
  if (!execResult.success) {
@@ -4,7 +4,7 @@ import {
4
4
  import "./chunk-QT7TEVNV.js";
5
5
  import {
6
6
  executeCapabilityRequest
7
- } from "./chunk-ZZVFYYUA.js";
7
+ } from "./chunk-QQFBFV4V.js";
8
8
  import "./chunk-UKT6H7YT.js";
9
9
  import {
10
10
  listCards,
@@ -277,7 +277,7 @@ async function startMcpServer() {
277
277
  registerPublishTool(server, ctx);
278
278
  const { registerRequestTool } = await import("./request-YOWPXVLQ.js");
279
279
  const { registerConductTool } = await import("./conduct-KM6ZNJGE.js");
280
- const { registerServeSkillTool } = await import("./serve-skill-EZSFLMAM.js");
280
+ const { registerServeSkillTool } = await import("./serve-skill-IH7UAJNR.js");
281
281
  registerRequestTool(server, ctx);
282
282
  registerConductTool(server, ctx);
283
283
  registerServeSkillTool(server, ctx);
@@ -41,7 +41,7 @@ import {
41
41
  import {
42
42
  executeCapabilityBatch,
43
43
  executeCapabilityRequest
44
- } from "./chunk-ZZVFYYUA.js";
44
+ } from "./chunk-QQFBFV4V.js";
45
45
  import "./chunk-UKT6H7YT.js";
46
46
  import {
47
47
  getActivityFeed,
@@ -4593,7 +4593,7 @@ var ServiceCoordinator = class {
4593
4593
  }
4594
4594
  if (opts.registryUrl && opts.relay) {
4595
4595
  const { RelayClient } = await import("./websocket-client-6IIDGXKB.js");
4596
- const { executeCapabilityRequest: executeCapabilityRequest2 } = await import("./execute-RKBWFIDK.js");
4596
+ const { executeCapabilityRequest: executeCapabilityRequest2 } = await import("./execute-T7Y6RKSW.js");
4597
4597
  const cards = listCards(this.runtime.registryDb, this.config.owner);
4598
4598
  const card = cards[0] ?? {
4599
4599
  id: randomUUID5(),
@@ -36,7 +36,7 @@ import {
36
36
  updateCard,
37
37
  updateSkillAvailability,
38
38
  updateSkillIdleRate
39
- } from "../../chunk-DC5AC6UA.js";
39
+ } from "../../chunk-EPIWHNB2.js";
40
40
  import {
41
41
  bootstrapAgent,
42
42
  generateKeyPair,
@@ -5431,7 +5431,7 @@ var ServiceCoordinator = class {
5431
5431
  }
5432
5432
  if (opts.registryUrl && opts.relay) {
5433
5433
  const { RelayClient: RelayClient2 } = await import("../../websocket-client-WRN3HO73.js");
5434
- const { executeCapabilityRequest: executeCapabilityRequest2 } = await import("../../execute-BH7A37T4.js");
5434
+ const { executeCapabilityRequest: executeCapabilityRequest2 } = await import("../../execute-4D4ITQCL.js");
5435
5435
  const cards = listCards(this.runtime.registryDb, this.config.owner);
5436
5436
  const card = cards[0] ?? {
5437
5437
  id: randomUUID6(),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "workspaces": [
4
4
  "packages/*"
5
5
  ],
6
- "version": "5.1.6",
6
+ "version": "5.1.8",
7
7
  "description": "P2P Agent Capability Sharing Protocol — Airbnb for AI agent pipelines",
8
8
  "type": "module",
9
9
  "main": "dist/index.js",
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "Requires Node.js >= 20 and pnpm. Designed for OpenClaw agents. Compatible with Claude Code, Gemini CLI, and other AgentSkills-compatible tools."
6
6
  metadata:
7
7
  author: "Cheng Wen Chen"
8
- version: "5.1.6"
8
+ version: "5.1.8"
9
9
  tags: "ai-agent-skill,claude-code,agent-skills,p2p,capability-sharing"
10
10
  ---
11
11