agentbnb 8.2.2 → 8.3.0
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.
- package/dist/{card-EX2EYGCZ.js → card-BN643ZOY.js} +6 -2
- package/dist/card-T2XJZA5A.js +92 -0
- package/dist/{chunk-3LWBH7P3.js → chunk-4NFJ3VYZ.js} +20 -1
- package/dist/chunk-5AIYALBX.js +857 -0
- package/dist/chunk-6QMDJVMS.js +238 -0
- package/dist/{chunk-LKLKYXLV.js → chunk-74LZDEDT.js} +6 -4
- package/dist/{chunk-GKVTD4EZ.js → chunk-77KGEDH4.js} +1 -1
- package/dist/{chunk-QCGIG7WW.js → chunk-7IQE34QK.js} +14 -7
- package/dist/{chunk-QHZGOG3O.js → chunk-D242QZCR.js} +168 -41
- package/dist/chunk-EE3V3DXK.js +60 -0
- package/dist/{chunk-RYISHSHB.js → chunk-F3KIEVJ2.js} +207 -265
- package/dist/{chunk-XBGVQMQJ.js → chunk-FELGHDCA.js} +16 -39
- package/dist/{chunk-EJKW57ZV.js → chunk-GIEJVKZZ.js} +1 -1
- package/dist/{chunk-WVY2W7AA.js → chunk-I7KWA7OB.js} +20 -0
- package/dist/{chunk-4IPJJRTP.js → chunk-IGQNP3ZO.js} +5 -2
- package/dist/chunk-NQANA6WH.js +797 -0
- package/dist/{chunk-Z4MCGKTL.js → chunk-NX27AFPA.js} +15 -2
- package/dist/{chunk-Z2GEFFDO.js → chunk-O4Q7BRG6.js} +2 -2
- package/dist/{chunk-SSK653A6.js → chunk-PQIP7EXY.js} +6 -0
- package/dist/{chunk-EG6RS4JC.js → chunk-QFPXZITP.js} +20 -65
- package/dist/chunk-R4F4XII4.js +264 -0
- package/dist/{chunk-DYQOFGGI.js → chunk-RVBW2QXU.js} +178 -49
- package/dist/{chunk-CQFBNTGT.js → chunk-S7DZHKCG.js} +25 -12
- package/dist/chunk-U6LP4KWN.js +238 -0
- package/dist/{chunk-MWOXW7JQ.js → chunk-VJ7XBEY6.js} +24 -16
- package/dist/chunk-WTHMHNKC.js +129 -0
- package/dist/{chunk-OCSU2S6W.js → chunk-WX3GZVFG.js} +2 -1
- package/dist/{chunk-CKOOVZOI.js → chunk-YKMBFQC2.js} +37 -5
- package/dist/{chunk-S3V6R3EN.js → chunk-ZU2TP7CN.js} +70 -27
- package/dist/cli/index.js +211 -278
- package/dist/client-OKJJ3UP2.js +19 -0
- package/dist/client-UQBGCIPA.js +20 -0
- package/dist/conduct-4JDMWBQD.js +22 -0
- package/dist/{conduct-AZFLNUX3.js → conduct-VYYBCPHA.js} +14 -13
- package/dist/{conductor-mode-WKB42PYM.js → conductor-mode-OPGQJFLA.js} +12 -8
- package/dist/{conductor-mode-PLTB6MS3.js → conductor-mode-SBDCRIX6.js} +16 -11
- package/dist/execute-FZLQGIXB.js +14 -0
- package/dist/execute-TEZPQ5WP.js +15 -0
- package/dist/index.d.ts +172 -11
- package/dist/index.js +1529 -433
- package/dist/{process-guard-GH5LRNWO.js → process-guard-TNSUNHSR.js} +1 -1
- package/dist/{publish-capability-QDR2QIZ2.js → publish-capability-HVYILTPR.js} +4 -3
- package/dist/{reliability-metrics-QG7WC5QK.js → reliability-metrics-G7LPUYJD.js} +3 -1
- package/dist/reliability-metrics-RRUKJ4ME.js +20 -0
- package/dist/{request-NX7GSPIG.js → request-KJNKR27T.js} +96 -43
- package/dist/{serve-skill-E6EJQYAK.js → serve-skill-GC6NIQ5T.js} +10 -11
- package/dist/{server-VBCT32FC.js → server-YV3XPTX5.js} +11 -10
- package/dist/{service-coordinator-KMSA6BST.js → service-coordinator-RY5AKUZS.js} +420 -171
- package/dist/{skill-config-FETXPNVP.js → skill-config-5O2VR546.js} +1 -1
- package/dist/skills/agentbnb/bootstrap.js +550 -231
- package/dist/websocket-client-3U27WJUU.js +7 -0
- package/dist/{websocket-client-4Z5P54RU.js → websocket-client-SNDF3B6N.js} +1 -1
- package/package.json +18 -12
- package/skills/agentbnb/install.sh +0 -0
- package/dist/chunk-MCED4GDW.js +0 -1572
- package/dist/chunk-NWIQJ2CL.js +0 -108
- package/dist/chunk-WNXXLCV5.js +0 -32
- package/dist/client-XOLP5IUZ.js +0 -12
- package/dist/conduct-VPUYTNEA.js +0 -21
- package/dist/execute-NNDCXTN4.js +0 -13
- package/dist/execute-RIRHTIBU.js +0 -16
- package/dist/websocket-client-QOVARTRN.js +0 -7
|
@@ -2,9 +2,10 @@ import {
|
|
|
2
2
|
parseSoulMd,
|
|
3
3
|
publishFromSoul,
|
|
4
4
|
skillConfigToSkill
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-IGQNP3ZO.js";
|
|
6
|
+
import "./chunk-5AIYALBX.js";
|
|
7
|
+
import "./chunk-WTHMHNKC.js";
|
|
8
|
+
import "./chunk-I7KWA7OB.js";
|
|
8
9
|
export {
|
|
9
10
|
parseSoulMd,
|
|
10
11
|
publishFromSoul,
|
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
recordFeedback,
|
|
7
7
|
recordQualityFailure,
|
|
8
8
|
recordSuccessfulHire
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6QMDJVMS.js";
|
|
10
|
+
import "./chunk-EE3V3DXK.js";
|
|
11
|
+
import "./chunk-I7KWA7OB.js";
|
|
10
12
|
export {
|
|
11
13
|
RELIABILITY_METRICS_SCHEMA,
|
|
12
14
|
ensureReliabilityTable,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RELIABILITY_METRICS_SCHEMA,
|
|
3
|
+
ensureReliabilityTable,
|
|
4
|
+
getReliabilityMetrics,
|
|
5
|
+
recordAvailabilityCheck,
|
|
6
|
+
recordFeedback,
|
|
7
|
+
recordQualityFailure,
|
|
8
|
+
recordSuccessfulHire
|
|
9
|
+
} from "./chunk-U6LP4KWN.js";
|
|
10
|
+
import "./chunk-WTHMHNKC.js";
|
|
11
|
+
import "./chunk-I7KWA7OB.js";
|
|
12
|
+
export {
|
|
13
|
+
RELIABILITY_METRICS_SCHEMA,
|
|
14
|
+
ensureReliabilityTable,
|
|
15
|
+
getReliabilityMetrics,
|
|
16
|
+
recordAvailabilityCheck,
|
|
17
|
+
recordFeedback,
|
|
18
|
+
recordQualityFailure,
|
|
19
|
+
recordSuccessfulHire
|
|
20
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AutoRequestor,
|
|
3
3
|
BudgetManager,
|
|
4
|
-
DEFAULT_BUDGET_CONFIG
|
|
5
|
-
|
|
4
|
+
DEFAULT_BUDGET_CONFIG,
|
|
5
|
+
requestViaTemporaryRelay
|
|
6
|
+
} from "./chunk-D242QZCR.js";
|
|
6
7
|
import {
|
|
7
8
|
DEFAULT_AUTONOMY_CONFIG
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-77KGEDH4.js";
|
|
10
|
+
import "./chunk-S7DZHKCG.js";
|
|
10
11
|
import {
|
|
11
12
|
openCreditDb
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-F3KIEVJ2.js";
|
|
14
|
+
import "./chunk-NX27AFPA.js";
|
|
15
|
+
import "./chunk-PQIP7EXY.js";
|
|
14
16
|
import {
|
|
15
17
|
requestCapability
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YKMBFQC2.js";
|
|
17
19
|
import {
|
|
18
20
|
loadKeyPair
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GIEJVKZZ.js";
|
|
22
|
+
import "./chunk-U6LP4KWN.js";
|
|
20
23
|
import "./chunk-5AH3CMOX.js";
|
|
21
24
|
import "./chunk-75OC6E4F.js";
|
|
22
|
-
import {
|
|
23
|
-
RelayClient
|
|
24
|
-
} from "./chunk-Z4MCGKTL.js";
|
|
25
|
-
import "./chunk-SSK653A6.js";
|
|
26
25
|
import {
|
|
27
26
|
openDatabase
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-5AIYALBX.js";
|
|
28
|
+
import "./chunk-WTHMHNKC.js";
|
|
29
|
+
import "./chunk-I7KWA7OB.js";
|
|
30
30
|
|
|
31
31
|
// src/mcp/tools/request.ts
|
|
32
32
|
import { z } from "zod";
|
|
@@ -35,8 +35,35 @@ var requestInputSchema = {
|
|
|
35
35
|
card_id: z.string().optional().describe("Direct card ID to request (skips search)"),
|
|
36
36
|
skill_id: z.string().optional().describe("Specific skill within a v2.0 card"),
|
|
37
37
|
params: z.record(z.unknown()).optional().describe("Input parameters for the capability"),
|
|
38
|
-
max_cost: z.number().optional().default(50).describe("Maximum credits to spend")
|
|
38
|
+
max_cost: z.number().optional().default(50).describe("Maximum credits to spend"),
|
|
39
|
+
timeout_ms: z.number().positive().optional().describe("Requester timeout override in milliseconds")
|
|
39
40
|
};
|
|
41
|
+
function parsePositiveNumber(value) {
|
|
42
|
+
return typeof value === "number" && value > 0 ? value : void 0;
|
|
43
|
+
}
|
|
44
|
+
function deriveTimeoutHintFromCard(remoteCard, skillId) {
|
|
45
|
+
const topLevelHint = {
|
|
46
|
+
expected_duration_ms: parsePositiveNumber(remoteCard["expected_duration_ms"]),
|
|
47
|
+
hard_timeout_ms: parsePositiveNumber(remoteCard["hard_timeout_ms"])
|
|
48
|
+
};
|
|
49
|
+
const skills = remoteCard["skills"];
|
|
50
|
+
if (!Array.isArray(skills)) {
|
|
51
|
+
return topLevelHint.expected_duration_ms !== void 0 || topLevelHint.hard_timeout_ms !== void 0 ? topLevelHint : void 0;
|
|
52
|
+
}
|
|
53
|
+
const selectedSkill = skillId ? skills.find((candidate) => {
|
|
54
|
+
if (!candidate || typeof candidate !== "object") return false;
|
|
55
|
+
return candidate["id"] === skillId;
|
|
56
|
+
}) : skills[0];
|
|
57
|
+
if (!selectedSkill || typeof selectedSkill !== "object") {
|
|
58
|
+
return topLevelHint.expected_duration_ms !== void 0 || topLevelHint.hard_timeout_ms !== void 0 ? topLevelHint : void 0;
|
|
59
|
+
}
|
|
60
|
+
const skillRecord = selectedSkill;
|
|
61
|
+
const skillHint = {
|
|
62
|
+
expected_duration_ms: parsePositiveNumber(skillRecord["expected_duration_ms"]) ?? topLevelHint.expected_duration_ms,
|
|
63
|
+
hard_timeout_ms: parsePositiveNumber(skillRecord["hard_timeout_ms"]) ?? topLevelHint.hard_timeout_ms
|
|
64
|
+
};
|
|
65
|
+
return skillHint.expected_duration_ms !== void 0 || skillHint.hard_timeout_ms !== void 0 ? skillHint : void 0;
|
|
66
|
+
}
|
|
40
67
|
async function handleRequest(args, ctx) {
|
|
41
68
|
try {
|
|
42
69
|
const maxCost = args.max_cost ?? 50;
|
|
@@ -100,6 +127,7 @@ async function handleRequest(args, ctx) {
|
|
|
100
127
|
token: ctx.config.token,
|
|
101
128
|
cardId,
|
|
102
129
|
params: { ...args.params ?? {}, ...args.skill_id ? { skill_id: args.skill_id } : {}, requester: ctx.config.owner },
|
|
130
|
+
timeoutMs: args.timeout_ms,
|
|
103
131
|
identity: identityAuth
|
|
104
132
|
});
|
|
105
133
|
return {
|
|
@@ -128,45 +156,70 @@ async function handleRequest(args, ctx) {
|
|
|
128
156
|
};
|
|
129
157
|
}
|
|
130
158
|
const targetOwner = remoteCard["owner"] ?? remoteCard["agent_name"];
|
|
159
|
+
const targetAgentId = typeof remoteCard["agent_id"] === "string" ? remoteCard["agent_id"] : void 0;
|
|
131
160
|
const gatewayUrl = remoteCard["gateway_url"];
|
|
161
|
+
const timeoutHint = deriveTimeoutHintFromCard(remoteCard, args.skill_id);
|
|
132
162
|
if (gatewayUrl) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
try {
|
|
154
|
-
await relay.connect();
|
|
155
|
-
const result = await relay.request({
|
|
163
|
+
let remoteCost = 0;
|
|
164
|
+
const remoteSkills = remoteCard["skills"];
|
|
165
|
+
if (Array.isArray(remoteSkills)) {
|
|
166
|
+
const matchedSkill = args.skill_id ? remoteSkills.find((s) => s.id === args.skill_id) : remoteSkills[0];
|
|
167
|
+
remoteCost = matchedSkill?.pricing?.credits_per_call ?? 0;
|
|
168
|
+
} else {
|
|
169
|
+
const remotePricing = remoteCard["pricing"];
|
|
170
|
+
remoteCost = remotePricing?.credits_per_call ?? 0;
|
|
171
|
+
}
|
|
172
|
+
if (remoteCost > 0) {
|
|
173
|
+
if (!targetOwner) {
|
|
174
|
+
return {
|
|
175
|
+
content: [{ type: "text", text: JSON.stringify({ success: false, error: "Paid remote request requires a target owner for relay routing" }) }]
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const result = await requestViaTemporaryRelay({
|
|
179
|
+
registryUrl: ctx.config.registry,
|
|
180
|
+
owner: ctx.config.owner,
|
|
181
|
+
token: ctx.config.token ?? "",
|
|
156
182
|
targetOwner,
|
|
183
|
+
targetAgentId,
|
|
157
184
|
cardId,
|
|
158
185
|
skillId: args.skill_id,
|
|
159
|
-
params: args.params ?? {},
|
|
160
|
-
|
|
161
|
-
|
|
186
|
+
params: { ...args.params ?? {}, ...args.skill_id ? { skill_id: args.skill_id } : {}, requester: ctx.config.owner },
|
|
187
|
+
timeoutMs: args.timeout_ms
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
content: [{ type: "text", text: JSON.stringify({ success: true, result }, null, 2) }]
|
|
191
|
+
};
|
|
192
|
+
} else {
|
|
193
|
+
const result = await requestCapability({
|
|
194
|
+
gatewayUrl,
|
|
195
|
+
token: ctx.config.token ?? "",
|
|
196
|
+
cardId,
|
|
197
|
+
params: { ...args.params ?? {}, ...args.skill_id ? { skill_id: args.skill_id } : {}, requester: ctx.config.owner },
|
|
198
|
+
timeoutMs: args.timeout_ms,
|
|
199
|
+
timeoutHint,
|
|
200
|
+
identity: identityAuth
|
|
162
201
|
});
|
|
163
202
|
return {
|
|
164
203
|
content: [{ type: "text", text: JSON.stringify({ success: true, result }, null, 2) }]
|
|
165
204
|
};
|
|
166
|
-
} finally {
|
|
167
|
-
relay.disconnect();
|
|
168
205
|
}
|
|
169
206
|
}
|
|
207
|
+
if (targetOwner) {
|
|
208
|
+
const result = await requestViaTemporaryRelay({
|
|
209
|
+
registryUrl: ctx.config.registry,
|
|
210
|
+
owner: ctx.config.owner,
|
|
211
|
+
token: ctx.config.token ?? "",
|
|
212
|
+
targetOwner,
|
|
213
|
+
targetAgentId,
|
|
214
|
+
cardId,
|
|
215
|
+
skillId: args.skill_id,
|
|
216
|
+
params: { ...args.params ?? {}, ...args.skill_id ? { skill_id: args.skill_id } : {} },
|
|
217
|
+
timeoutMs: args.timeout_ms
|
|
218
|
+
});
|
|
219
|
+
return {
|
|
220
|
+
content: [{ type: "text", text: JSON.stringify({ success: true, result }, null, 2) }]
|
|
221
|
+
};
|
|
222
|
+
}
|
|
170
223
|
return {
|
|
171
224
|
content: [{ type: "text", text: JSON.stringify({ success: false, error: "Remote card has no gateway_url and no owner for relay routing" }) }]
|
|
172
225
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCapabilityRequest
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-CQFBNTGT.js";
|
|
3
|
+
} from "./chunk-FELGHDCA.js";
|
|
4
|
+
import "./chunk-S7DZHKCG.js";
|
|
6
5
|
import {
|
|
7
6
|
openCreditDb
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-NWIQJ2CL.js";
|
|
10
|
-
import "./chunk-EJKW57ZV.js";
|
|
11
|
-
import "./chunk-75OC6E4F.js";
|
|
7
|
+
} from "./chunk-F3KIEVJ2.js";
|
|
12
8
|
import {
|
|
13
9
|
RelayClient
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-NX27AFPA.js";
|
|
11
|
+
import "./chunk-PQIP7EXY.js";
|
|
12
|
+
import "./chunk-U6LP4KWN.js";
|
|
13
|
+
import "./chunk-75OC6E4F.js";
|
|
16
14
|
import {
|
|
17
15
|
listCards,
|
|
18
16
|
openDatabase
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-5AIYALBX.js";
|
|
18
|
+
import "./chunk-WTHMHNKC.js";
|
|
19
|
+
import "./chunk-I7KWA7OB.js";
|
|
21
20
|
|
|
22
21
|
// src/mcp/tools/serve-skill.ts
|
|
23
22
|
import { z } from "zod";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLedger,
|
|
3
3
|
ensureIdentity
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-74LZDEDT.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchRemoteCards,
|
|
7
7
|
getBalance,
|
|
8
8
|
mergeResults,
|
|
9
9
|
openCreditDb,
|
|
10
10
|
searchCards
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-NWIQJ2CL.js";
|
|
11
|
+
} from "./chunk-F3KIEVJ2.js";
|
|
13
12
|
import {
|
|
14
13
|
loadKeyPair
|
|
15
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GIEJVKZZ.js";
|
|
15
|
+
import "./chunk-U6LP4KWN.js";
|
|
16
16
|
import {
|
|
17
17
|
getConfigDir,
|
|
18
18
|
loadConfig
|
|
@@ -20,10 +20,11 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
insertCard,
|
|
22
22
|
openDatabase
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5AIYALBX.js";
|
|
24
|
+
import "./chunk-WTHMHNKC.js";
|
|
24
25
|
import {
|
|
25
26
|
AnyCardSchema
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-I7KWA7OB.js";
|
|
27
28
|
|
|
28
29
|
// src/mcp/server.ts
|
|
29
30
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -247,7 +248,7 @@ function registerPublishTool(server, ctx) {
|
|
|
247
248
|
}
|
|
248
249
|
|
|
249
250
|
// src/mcp/server.ts
|
|
250
|
-
var VERSION = "8.
|
|
251
|
+
var VERSION = true ? "8.3.0" : "0.0.0-dev";
|
|
251
252
|
async function startMcpServer() {
|
|
252
253
|
const config = loadConfig();
|
|
253
254
|
if (!config) {
|
|
@@ -268,9 +269,9 @@ async function startMcpServer() {
|
|
|
268
269
|
registerDiscoverTool(server, ctx);
|
|
269
270
|
registerStatusTool(server, ctx);
|
|
270
271
|
registerPublishTool(server, ctx);
|
|
271
|
-
const { registerRequestTool } = await import("./request-
|
|
272
|
-
const { registerConductTool } = await import("./conduct-
|
|
273
|
-
const { registerServeSkillTool } = await import("./serve-skill-
|
|
272
|
+
const { registerRequestTool } = await import("./request-KJNKR27T.js");
|
|
273
|
+
const { registerConductTool } = await import("./conduct-VYYBCPHA.js");
|
|
274
|
+
const { registerServeSkillTool } = await import("./serve-skill-GC6NIQ5T.js");
|
|
274
275
|
registerRequestTool(server, ctx);
|
|
275
276
|
registerConductTool(server, ctx);
|
|
276
277
|
registerServeSkillTool(server, ctx);
|