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.
- 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 +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-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 +528 -253
- 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
package/dist/chunk-NWIQJ2CL.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// src/credit/reliability-metrics.ts
|
|
2
|
-
var RELIABILITY_METRICS_SCHEMA = `
|
|
3
|
-
CREATE TABLE IF NOT EXISTS provider_reliability_metrics (
|
|
4
|
-
owner TEXT PRIMARY KEY,
|
|
5
|
-
current_streak INTEGER NOT NULL DEFAULT 0,
|
|
6
|
-
longest_streak INTEGER NOT NULL DEFAULT 0,
|
|
7
|
-
total_hires INTEGER NOT NULL DEFAULT 0,
|
|
8
|
-
repeat_hires INTEGER NOT NULL DEFAULT 0,
|
|
9
|
-
feedback_count INTEGER NOT NULL DEFAULT 0,
|
|
10
|
-
feedback_sum REAL NOT NULL DEFAULT 0,
|
|
11
|
-
availability_checks INTEGER NOT NULL DEFAULT 0,
|
|
12
|
-
availability_hits INTEGER NOT NULL DEFAULT 0,
|
|
13
|
-
cycle_start TEXT NOT NULL,
|
|
14
|
-
updated_at TEXT NOT NULL
|
|
15
|
-
);
|
|
16
|
-
`;
|
|
17
|
-
function ensureReliabilityTable(db) {
|
|
18
|
-
db.exec(RELIABILITY_METRICS_SCHEMA);
|
|
19
|
-
}
|
|
20
|
-
function ensureRow(db, owner) {
|
|
21
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
22
|
-
db.prepare(
|
|
23
|
-
`INSERT OR IGNORE INTO provider_reliability_metrics
|
|
24
|
-
(owner, current_streak, longest_streak, total_hires, repeat_hires,
|
|
25
|
-
feedback_count, feedback_sum, availability_checks, availability_hits,
|
|
26
|
-
cycle_start, updated_at)
|
|
27
|
-
VALUES (?, 0, 0, 0, 0, 0, 0, 0, 0, ?, ?)`
|
|
28
|
-
).run(owner, now, now);
|
|
29
|
-
}
|
|
30
|
-
function recordSuccessfulHire(db, providerOwner, consumerOwner) {
|
|
31
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
32
|
-
ensureRow(db, providerOwner);
|
|
33
|
-
const isRepeat = db.prepare(
|
|
34
|
-
`SELECT COUNT(*) as cnt FROM credit_transactions
|
|
35
|
-
WHERE owner = ? AND reason = 'settlement'
|
|
36
|
-
AND reference_id IN (
|
|
37
|
-
SELECT id FROM credit_escrow WHERE owner = ?
|
|
38
|
-
)`
|
|
39
|
-
).get(providerOwner, consumerOwner);
|
|
40
|
-
const repeatIncrement = (isRepeat?.cnt ?? 0) > 0 ? 1 : 0;
|
|
41
|
-
db.prepare(
|
|
42
|
-
`UPDATE provider_reliability_metrics
|
|
43
|
-
SET current_streak = current_streak + 1,
|
|
44
|
-
longest_streak = MAX(longest_streak, current_streak + 1),
|
|
45
|
-
total_hires = total_hires + 1,
|
|
46
|
-
repeat_hires = repeat_hires + ?,
|
|
47
|
-
updated_at = ?
|
|
48
|
-
WHERE owner = ?`
|
|
49
|
-
).run(repeatIncrement, now, providerOwner);
|
|
50
|
-
}
|
|
51
|
-
function recordQualityFailure(db, providerOwner) {
|
|
52
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
53
|
-
ensureRow(db, providerOwner);
|
|
54
|
-
db.prepare(
|
|
55
|
-
`UPDATE provider_reliability_metrics
|
|
56
|
-
SET current_streak = 0, updated_at = ?
|
|
57
|
-
WHERE owner = ?`
|
|
58
|
-
).run(now, providerOwner);
|
|
59
|
-
}
|
|
60
|
-
function recordFeedback(db, providerOwner, score) {
|
|
61
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
62
|
-
ensureRow(db, providerOwner);
|
|
63
|
-
db.prepare(
|
|
64
|
-
`UPDATE provider_reliability_metrics
|
|
65
|
-
SET feedback_count = feedback_count + 1,
|
|
66
|
-
feedback_sum = feedback_sum + ?,
|
|
67
|
-
updated_at = ?
|
|
68
|
-
WHERE owner = ?`
|
|
69
|
-
).run(score, now, providerOwner);
|
|
70
|
-
}
|
|
71
|
-
function recordAvailabilityCheck(db, providerOwner, wasAvailable) {
|
|
72
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
73
|
-
ensureRow(db, providerOwner);
|
|
74
|
-
db.prepare(
|
|
75
|
-
`UPDATE provider_reliability_metrics
|
|
76
|
-
SET availability_checks = availability_checks + 1,
|
|
77
|
-
availability_hits = availability_hits + ?,
|
|
78
|
-
updated_at = ?
|
|
79
|
-
WHERE owner = ?`
|
|
80
|
-
).run(wasAvailable ? 1 : 0, now, providerOwner);
|
|
81
|
-
}
|
|
82
|
-
function getReliabilityMetrics(db, owner) {
|
|
83
|
-
const row = db.prepare(
|
|
84
|
-
`SELECT current_streak, longest_streak, total_hires, repeat_hires,
|
|
85
|
-
feedback_count, feedback_sum, availability_checks, availability_hits
|
|
86
|
-
FROM provider_reliability_metrics WHERE owner = ?`
|
|
87
|
-
).get(owner);
|
|
88
|
-
if (!row) return null;
|
|
89
|
-
return {
|
|
90
|
-
current_streak: row.current_streak,
|
|
91
|
-
longest_streak: row.longest_streak,
|
|
92
|
-
total_hires: row.total_hires,
|
|
93
|
-
repeat_hires: row.repeat_hires,
|
|
94
|
-
repeat_hire_rate: row.total_hires > 0 ? row.repeat_hires / row.total_hires : 0,
|
|
95
|
-
avg_feedback_score: row.feedback_count > 0 ? row.feedback_sum / row.feedback_count : 0,
|
|
96
|
-
availability_rate: row.availability_checks > 0 ? row.availability_hits / row.availability_checks : 0
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export {
|
|
101
|
-
RELIABILITY_METRICS_SCHEMA,
|
|
102
|
-
ensureReliabilityTable,
|
|
103
|
-
recordSuccessfulHire,
|
|
104
|
-
recordQualityFailure,
|
|
105
|
-
recordFeedback,
|
|
106
|
-
recordAvailabilityCheck,
|
|
107
|
-
getReliabilityMetrics
|
|
108
|
-
};
|
package/dist/chunk-TUCEDQGM.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
holdEscrow
|
|
3
|
-
} from "./chunk-RYISHSHB.js";
|
|
4
|
-
import {
|
|
5
|
-
signEscrowReceipt
|
|
6
|
-
} from "./chunk-EJKW57ZV.js";
|
|
7
|
-
|
|
8
|
-
// src/credit/escrow-receipt.ts
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
import { randomUUID } from "crypto";
|
|
11
|
-
var EscrowReceiptSchema = z.object({
|
|
12
|
-
requester_owner: z.string().min(1),
|
|
13
|
-
requester_agent_id: z.string().optional(),
|
|
14
|
-
requester_public_key: z.string().min(1),
|
|
15
|
-
amount: z.number().positive(),
|
|
16
|
-
card_id: z.string().min(1),
|
|
17
|
-
skill_id: z.string().optional(),
|
|
18
|
-
timestamp: z.string(),
|
|
19
|
-
nonce: z.string().uuid(),
|
|
20
|
-
signature: z.string().min(1)
|
|
21
|
-
});
|
|
22
|
-
function createSignedEscrowReceipt(db, privateKey, publicKey, opts) {
|
|
23
|
-
const escrowId = holdEscrow(db, opts.owner, opts.amount, opts.cardId);
|
|
24
|
-
const receiptData = {
|
|
25
|
-
requester_owner: opts.owner,
|
|
26
|
-
...opts.agent_id ? { requester_agent_id: opts.agent_id } : {},
|
|
27
|
-
requester_public_key: publicKey.toString("hex"),
|
|
28
|
-
amount: opts.amount,
|
|
29
|
-
card_id: opts.cardId,
|
|
30
|
-
...opts.skillId ? { skill_id: opts.skillId } : {},
|
|
31
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
|
-
nonce: randomUUID()
|
|
33
|
-
};
|
|
34
|
-
const signature = signEscrowReceipt(receiptData, privateKey);
|
|
35
|
-
const receipt = {
|
|
36
|
-
...receiptData,
|
|
37
|
-
signature
|
|
38
|
-
};
|
|
39
|
-
return { escrowId, receipt };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
createSignedEscrowReceipt
|
|
44
|
-
};
|
package/dist/chunk-WNXXLCV5.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NETWORK_FEE_RATE,
|
|
3
|
-
confirmEscrowDebit,
|
|
4
|
-
recordEarning,
|
|
5
|
-
releaseEscrow
|
|
6
|
-
} from "./chunk-RYISHSHB.js";
|
|
7
|
-
|
|
8
|
-
// src/credit/settlement.ts
|
|
9
|
-
function settleProviderEarning(providerDb, providerOwner, receipt) {
|
|
10
|
-
const feeAmount = Math.floor(receipt.amount * NETWORK_FEE_RATE);
|
|
11
|
-
const providerAmount = receipt.amount - feeAmount;
|
|
12
|
-
recordEarning(
|
|
13
|
-
providerDb,
|
|
14
|
-
providerOwner,
|
|
15
|
-
providerAmount,
|
|
16
|
-
receipt.card_id,
|
|
17
|
-
receipt.nonce
|
|
18
|
-
);
|
|
19
|
-
return { settled: true };
|
|
20
|
-
}
|
|
21
|
-
function settleRequesterEscrow(requesterDb, escrowId) {
|
|
22
|
-
confirmEscrowDebit(requesterDb, escrowId);
|
|
23
|
-
}
|
|
24
|
-
function releaseRequesterEscrow(requesterDb, escrowId) {
|
|
25
|
-
releaseEscrow(requesterDb, escrowId);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
settleProviderEarning,
|
|
30
|
-
settleRequesterEscrow,
|
|
31
|
-
releaseRequesterEscrow
|
|
32
|
-
};
|
package/dist/client-XOLP5IUZ.js
DELETED
package/dist/conduct-VPUYTNEA.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
conductAction
|
|
3
|
-
} from "./chunk-MWOXW7JQ.js";
|
|
4
|
-
import "./chunk-QCGIG7WW.js";
|
|
5
|
-
import "./chunk-3MJT4PZG.js";
|
|
6
|
-
import "./chunk-QHZGOG3O.js";
|
|
7
|
-
import "./chunk-GKVTD4EZ.js";
|
|
8
|
-
import "./chunk-CQFBNTGT.js";
|
|
9
|
-
import "./chunk-RYISHSHB.js";
|
|
10
|
-
import "./chunk-NWIQJ2CL.js";
|
|
11
|
-
import "./chunk-CKOOVZOI.js";
|
|
12
|
-
import "./chunk-EJKW57ZV.js";
|
|
13
|
-
import "./chunk-5AH3CMOX.js";
|
|
14
|
-
import "./chunk-75OC6E4F.js";
|
|
15
|
-
import "./chunk-Z4MCGKTL.js";
|
|
16
|
-
import "./chunk-SSK653A6.js";
|
|
17
|
-
import "./chunk-S3V6R3EN.js";
|
|
18
|
-
import "./chunk-WVY2W7AA.js";
|
|
19
|
-
export {
|
|
20
|
-
conductAction
|
|
21
|
-
};
|
package/dist/execute-NNDCXTN4.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
executeCapabilityBatch,
|
|
3
|
-
executeCapabilityRequest
|
|
4
|
-
} from "./chunk-EG6RS4JC.js";
|
|
5
|
-
import "./chunk-MCED4GDW.js";
|
|
6
|
-
import "./chunk-NWIQJ2CL.js";
|
|
7
|
-
import "./chunk-EJKW57ZV.js";
|
|
8
|
-
import "./chunk-IVOYM3WG.js";
|
|
9
|
-
import "./chunk-WVY2W7AA.js";
|
|
10
|
-
export {
|
|
11
|
-
executeCapabilityBatch,
|
|
12
|
-
executeCapabilityRequest
|
|
13
|
-
};
|
package/dist/execute-RIRHTIBU.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
executeCapabilityBatch,
|
|
3
|
-
executeCapabilityRequest
|
|
4
|
-
} from "./chunk-XBGVQMQJ.js";
|
|
5
|
-
import "./chunk-WNXXLCV5.js";
|
|
6
|
-
import "./chunk-CQFBNTGT.js";
|
|
7
|
-
import "./chunk-RYISHSHB.js";
|
|
8
|
-
import "./chunk-NWIQJ2CL.js";
|
|
9
|
-
import "./chunk-EJKW57ZV.js";
|
|
10
|
-
import "./chunk-75OC6E4F.js";
|
|
11
|
-
import "./chunk-S3V6R3EN.js";
|
|
12
|
-
import "./chunk-WVY2W7AA.js";
|
|
13
|
-
export {
|
|
14
|
-
executeCapabilityBatch,
|
|
15
|
-
executeCapabilityRequest
|
|
16
|
-
};
|