agentbnb 8.2.3 → 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.
Files changed (62) hide show
  1. package/dist/{card-EX2EYGCZ.js → card-BN643ZOY.js} +6 -2
  2. package/dist/card-T2XJZA5A.js +92 -0
  3. package/dist/{chunk-3LWBH7P3.js → chunk-4NFJ3VYZ.js} +20 -1
  4. package/dist/chunk-5AIYALBX.js +857 -0
  5. package/dist/chunk-6QMDJVMS.js +238 -0
  6. package/dist/{chunk-LKLKYXLV.js → chunk-74LZDEDT.js} +6 -4
  7. package/dist/{chunk-GKVTD4EZ.js → chunk-77KGEDH4.js} +1 -1
  8. package/dist/{chunk-QCGIG7WW.js → chunk-7IQE34QK.js} +14 -7
  9. package/dist/{chunk-QHZGOG3O.js → chunk-D242QZCR.js} +168 -41
  10. package/dist/chunk-EE3V3DXK.js +60 -0
  11. package/dist/{chunk-RYISHSHB.js → chunk-F3KIEVJ2.js} +207 -265
  12. package/dist/{chunk-XBGVQMQJ.js → chunk-FELGHDCA.js} +16 -39
  13. package/dist/{chunk-EJKW57ZV.js → chunk-GIEJVKZZ.js} +1 -1
  14. package/dist/{chunk-WVY2W7AA.js → chunk-I7KWA7OB.js} +20 -0
  15. package/dist/{chunk-4IPJJRTP.js → chunk-IGQNP3ZO.js} +5 -2
  16. package/dist/chunk-NQANA6WH.js +797 -0
  17. package/dist/{chunk-Z4MCGKTL.js → chunk-NX27AFPA.js} +15 -2
  18. package/dist/{chunk-Z2GEFFDO.js → chunk-O4Q7BRG6.js} +2 -2
  19. package/dist/{chunk-SSK653A6.js → chunk-PQIP7EXY.js} +6 -0
  20. package/dist/{chunk-EG6RS4JC.js → chunk-QFPXZITP.js} +20 -65
  21. package/dist/chunk-R4F4XII4.js +264 -0
  22. package/dist/{chunk-DYQOFGGI.js → chunk-RVBW2QXU.js} +178 -49
  23. package/dist/{chunk-CQFBNTGT.js → chunk-S7DZHKCG.js} +25 -12
  24. package/dist/chunk-U6LP4KWN.js +238 -0
  25. package/dist/{chunk-MWOXW7JQ.js → chunk-VJ7XBEY6.js} +24 -16
  26. package/dist/chunk-WTHMHNKC.js +129 -0
  27. package/dist/{chunk-OCSU2S6W.js → chunk-WX3GZVFG.js} +2 -1
  28. package/dist/{chunk-CKOOVZOI.js → chunk-YKMBFQC2.js} +37 -5
  29. package/dist/{chunk-S3V6R3EN.js → chunk-ZU2TP7CN.js} +70 -27
  30. package/dist/cli/index.js +203 -237
  31. package/dist/client-OKJJ3UP2.js +19 -0
  32. package/dist/client-UQBGCIPA.js +20 -0
  33. package/dist/conduct-4JDMWBQD.js +22 -0
  34. package/dist/{conduct-AZFLNUX3.js → conduct-VYYBCPHA.js} +14 -13
  35. package/dist/{conductor-mode-WKB42PYM.js → conductor-mode-OPGQJFLA.js} +12 -8
  36. package/dist/{conductor-mode-PLTB6MS3.js → conductor-mode-SBDCRIX6.js} +16 -11
  37. package/dist/execute-FZLQGIXB.js +14 -0
  38. package/dist/execute-TEZPQ5WP.js +15 -0
  39. package/dist/index.d.ts +172 -11
  40. package/dist/index.js +1529 -433
  41. package/dist/{process-guard-GH5LRNWO.js → process-guard-TNSUNHSR.js} +1 -1
  42. package/dist/{publish-capability-QDR2QIZ2.js → publish-capability-HVYILTPR.js} +4 -3
  43. package/dist/{reliability-metrics-QG7WC5QK.js → reliability-metrics-G7LPUYJD.js} +3 -1
  44. package/dist/reliability-metrics-RRUKJ4ME.js +20 -0
  45. package/dist/{request-OERS5BE7.js → request-KJNKR27T.js} +76 -71
  46. package/dist/{serve-skill-E6EJQYAK.js → serve-skill-GC6NIQ5T.js} +10 -11
  47. package/dist/{server-46VEG2W7.js → server-YV3XPTX5.js} +11 -10
  48. package/dist/{service-coordinator-KMSA6BST.js → service-coordinator-RY5AKUZS.js} +420 -171
  49. package/dist/{skill-config-FETXPNVP.js → skill-config-5O2VR546.js} +1 -1
  50. package/dist/skills/agentbnb/bootstrap.js +528 -253
  51. package/dist/websocket-client-3U27WJUU.js +7 -0
  52. package/dist/{websocket-client-4Z5P54RU.js → websocket-client-SNDF3B6N.js} +1 -1
  53. package/package.json +1 -1
  54. package/dist/chunk-MCED4GDW.js +0 -1572
  55. package/dist/chunk-NWIQJ2CL.js +0 -108
  56. package/dist/chunk-TUCEDQGM.js +0 -44
  57. package/dist/chunk-WNXXLCV5.js +0 -32
  58. package/dist/client-XOLP5IUZ.js +0 -12
  59. package/dist/conduct-VPUYTNEA.js +0 -21
  60. package/dist/execute-NNDCXTN4.js +0 -13
  61. package/dist/execute-RIRHTIBU.js +0 -16
  62. 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-CQFBNTGT.js";
3
+ } from "./chunk-S7DZHKCG.js";
7
4
  import {
8
5
  getBalance,
9
6
  holdEscrow,
10
7
  releaseEscrow,
11
8
  settleEscrow
12
- } from "./chunk-RYISHSHB.js";
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-S3V6R3EN.js";
17
+ } from "./chunk-5AIYALBX.js";
24
18
  import {
25
19
  AgentBnBError
26
- } from "./chunk-WVY2W7AA.js";
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
- const { signature, ...receiptData2 } = receipt;
112
- const publicKeyBuf = Buffer.from(receipt.requester_public_key, "hex");
113
- const valid = verifyEscrowReceipt(receiptData2, signature, publicKeyBuf);
114
- if (!valid) {
115
- return { success: false, error: { code: -32603, message: "Invalid escrow receipt signature" } };
116
- }
117
- if (receipt.amount < creditsNeeded) {
118
- return { success: false, error: { code: -32603, message: "Insufficient escrow amount" } };
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 (!isRemoteEscrow && escrowId) releaseEscrow(creditDb, escrowId);
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 (isRemoteEscrow && receipt) {
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
- const successResult = isRemoteEscrow ? {
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;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AgentBnBError
3
- } from "./chunk-WVY2W7AA.js";
3
+ } from "./chunk-I7KWA7OB.js";
4
4
 
5
5
  // src/credit/signing.ts
6
6
  import { generateKeyPairSync, sign, verify, createPublicKey, createPrivateKey } from "crypto";
@@ -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-S3V6R3EN.js";
3
+ } from "./chunk-5AIYALBX.js";
4
4
  import {
5
5
  CapabilityCardSchema
6
- } from "./chunk-WVY2W7AA.js";
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 }