agentbnb 8.2.3 → 8.3.1
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-GKVTD4EZ.js → chunk-77KGEDH4.js} +1 -1
- package/dist/{chunk-QCGIG7WW.js → chunk-7IQE34QK.js} +14 -7
- package/dist/{chunk-LKLKYXLV.js → chunk-BARHNIKG.js} +10 -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 +203 -237
- 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-OERS5BE7.js → request-KJNKR27T.js} +76 -71
- package/dist/{serve-skill-E6EJQYAK.js → serve-skill-GC6NIQ5T.js} +10 -11
- package/dist/{server-46VEG2W7.js → server-YVLMQ2BO.js} +11 -10
- package/dist/{service-coordinator-KMSA6BST.js → service-coordinator-SCP2YIFT.js} +420 -171
- package/dist/{skill-config-FETXPNVP.js → skill-config-5O2VR546.js} +1 -1
- package/dist/skills/agentbnb/bootstrap.js +532 -256
- package/dist/websocket-client-3U27WJUU.js +7 -0
- package/dist/{websocket-client-4Z5P54RU.js → websocket-client-SNDF3B6N.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-MCED4GDW.js +0 -1572
- package/dist/chunk-NWIQJ2CL.js +0 -108
- package/dist/chunk-TUCEDQGM.js +0 -44
- 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
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
settleProviderEarning
|
|
3
|
-
} from "./chunk-WNXXLCV5.js";
|
|
4
1
|
import {
|
|
5
2
|
resolveTargetCapability
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7DZHKCG.js";
|
|
7
4
|
import {
|
|
8
5
|
getBalance,
|
|
9
6
|
holdEscrow,
|
|
10
7
|
releaseEscrow,
|
|
11
8
|
settleEscrow
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
verifyEscrowReceipt
|
|
15
|
-
} from "./chunk-EJKW57ZV.js";
|
|
9
|
+
} from "./chunk-F3KIEVJ2.js";
|
|
16
10
|
import {
|
|
17
11
|
loadConfig
|
|
18
12
|
} from "./chunk-75OC6E4F.js";
|
|
@@ -20,10 +14,10 @@ import {
|
|
|
20
14
|
getCard,
|
|
21
15
|
insertRequestLog,
|
|
22
16
|
updateReputation
|
|
23
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5AIYALBX.js";
|
|
24
18
|
import {
|
|
25
19
|
AgentBnBError
|
|
26
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-I7KWA7OB.js";
|
|
27
21
|
|
|
28
22
|
// src/gateway/execute.ts
|
|
29
23
|
import { randomUUID } from "crypto";
|
|
@@ -105,23 +99,17 @@ async function executeCapabilityRequest(opts) {
|
|
|
105
99
|
cardName = card.name;
|
|
106
100
|
}
|
|
107
101
|
let escrowId = null;
|
|
108
|
-
let isRemoteEscrow = false;
|
|
109
102
|
if (relayAuthorized) {
|
|
110
103
|
} else if (receipt) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
const receiptAge = Date.now() - new Date(receipt.timestamp).getTime();
|
|
121
|
-
if (receiptAge > 5 * 60 * 1e3) {
|
|
122
|
-
return { success: false, error: { code: -32603, message: "Escrow receipt expired" } };
|
|
104
|
+
if (creditsNeeded > 0) {
|
|
105
|
+
return {
|
|
106
|
+
success: false,
|
|
107
|
+
error: {
|
|
108
|
+
code: -32603,
|
|
109
|
+
message: "Direct HTTP paid remote settlement is disabled. Route paid requests through relay."
|
|
110
|
+
}
|
|
111
|
+
};
|
|
123
112
|
}
|
|
124
|
-
isRemoteEscrow = true;
|
|
125
113
|
} else {
|
|
126
114
|
try {
|
|
127
115
|
const balance = getBalance(creditDb, requester);
|
|
@@ -135,9 +123,8 @@ async function executeCapabilityRequest(opts) {
|
|
|
135
123
|
}
|
|
136
124
|
}
|
|
137
125
|
const startMs = Date.now();
|
|
138
|
-
const receiptData = isRemoteEscrow ? { receipt_released: true } : void 0;
|
|
139
126
|
const handleFailure = (status, latencyMs, message, failureReason = "bad_execution") => {
|
|
140
|
-
if (
|
|
127
|
+
if (escrowId) releaseEscrow(creditDb, escrowId);
|
|
141
128
|
if (failureReason === "bad_execution" || failureReason === "auth_error") {
|
|
142
129
|
updateReputation(registryDb, cardId, false, latencyMs);
|
|
143
130
|
}
|
|
@@ -156,15 +143,10 @@ async function executeCapabilityRequest(opts) {
|
|
|
156
143
|
});
|
|
157
144
|
} catch {
|
|
158
145
|
}
|
|
159
|
-
return {
|
|
160
|
-
success: false,
|
|
161
|
-
error: { code: -32603, message, ...receiptData ? { data: receiptData } : {} }
|
|
162
|
-
};
|
|
146
|
+
return { success: false, error: { code: -32603, message } };
|
|
163
147
|
};
|
|
164
148
|
const handleSuccess = (result, latencyMs) => {
|
|
165
|
-
if (
|
|
166
|
-
settleProviderEarning(creditDb, card.owner, receipt);
|
|
167
|
-
} else if (escrowId) {
|
|
149
|
+
if (escrowId) {
|
|
168
150
|
settleEscrow(creditDb, escrowId, card.owner);
|
|
169
151
|
}
|
|
170
152
|
updateReputation(registryDb, cardId, true, latencyMs);
|
|
@@ -192,12 +174,7 @@ async function executeCapabilityRequest(opts) {
|
|
|
192
174
|
latencyMs
|
|
193
175
|
}).catch(() => {
|
|
194
176
|
});
|
|
195
|
-
|
|
196
|
-
...typeof result === "object" && result !== null ? result : { data: result },
|
|
197
|
-
receipt_settled: true,
|
|
198
|
-
receipt_nonce: receipt.nonce
|
|
199
|
-
} : result;
|
|
200
|
-
return { success: true, result: successResult };
|
|
177
|
+
return { success: true, result };
|
|
201
178
|
};
|
|
202
179
|
if (skillExecutor) {
|
|
203
180
|
let targetSkillId = resolvedSkillId ?? skillId;
|
|
@@ -35,6 +35,16 @@ var CapabilityCardSchema = z.object({
|
|
|
35
35
|
schedule: z.string().optional()
|
|
36
36
|
// cron expression
|
|
37
37
|
}),
|
|
38
|
+
/**
|
|
39
|
+
* Provider-estimated typical execution duration in milliseconds.
|
|
40
|
+
* Used by requesters to derive default client-side timeouts.
|
|
41
|
+
*/
|
|
42
|
+
expected_duration_ms: z.number().positive().optional(),
|
|
43
|
+
/**
|
|
44
|
+
* Provider hard timeout in milliseconds.
|
|
45
|
+
* Used as a fallback timeout hint when expected_duration_ms is unavailable.
|
|
46
|
+
*/
|
|
47
|
+
hard_timeout_ms: z.number().positive().optional(),
|
|
38
48
|
powered_by: z.array(PoweredBySchema).optional(),
|
|
39
49
|
/**
|
|
40
50
|
* Private per-card metadata. Stripped from all API and CLI responses —
|
|
@@ -88,6 +98,16 @@ var SkillSchema = z.object({
|
|
|
88
98
|
credits_per_minute: z.number().nonnegative().optional(),
|
|
89
99
|
free_tier: z.number().nonnegative().optional()
|
|
90
100
|
}),
|
|
101
|
+
/**
|
|
102
|
+
* Provider-estimated typical execution duration in milliseconds.
|
|
103
|
+
* Used by requesters to derive default client-side timeouts.
|
|
104
|
+
*/
|
|
105
|
+
expected_duration_ms: z.number().positive().optional(),
|
|
106
|
+
/**
|
|
107
|
+
* Provider hard timeout in milliseconds.
|
|
108
|
+
* Used as a fallback timeout hint when expected_duration_ms is unavailable.
|
|
109
|
+
*/
|
|
110
|
+
hard_timeout_ms: z.number().positive().optional(),
|
|
91
111
|
/** Per-skill online flag — overrides card-level availability for this skill. */
|
|
92
112
|
availability: z.object({ online: z.boolean() }).optional(),
|
|
93
113
|
powered_by: z.array(PoweredBySchema).optional(),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
insertCard
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5AIYALBX.js";
|
|
4
4
|
import {
|
|
5
5
|
CapabilityCardSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I7KWA7OB.js";
|
|
7
7
|
|
|
8
8
|
// src/skills/publish-capability.ts
|
|
9
9
|
import { randomUUID } from "crypto";
|
|
@@ -127,6 +127,7 @@ function publishFromSoul(db, soulContent, owner) {
|
|
|
127
127
|
return card;
|
|
128
128
|
}
|
|
129
129
|
function skillConfigToSkill(config) {
|
|
130
|
+
const hardTimeoutMs = typeof config.timeout_ms === "number" ? config.timeout_ms : void 0;
|
|
130
131
|
return {
|
|
131
132
|
id: config.id,
|
|
132
133
|
name: config.name,
|
|
@@ -135,6 +136,8 @@ function skillConfigToSkill(config) {
|
|
|
135
136
|
inputs: [],
|
|
136
137
|
outputs: [],
|
|
137
138
|
pricing: config.pricing,
|
|
139
|
+
...config.expected_duration_ms !== void 0 && { expected_duration_ms: config.expected_duration_ms },
|
|
140
|
+
...hardTimeoutMs !== void 0 && { hard_timeout_ms: hardTimeoutMs },
|
|
138
141
|
...config.capability_types !== void 0 && { capability_types: config.capability_types },
|
|
139
142
|
...config.requires_capabilities !== void 0 && { requires_capabilities: config.requires_capabilities },
|
|
140
143
|
...config.visibility !== void 0 && { visibility: config.visibility }
|