agentbnb 8.3.2 → 8.4.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-T2XJZA5A.js → card-HYTD2BJQ.js} +1 -1
- package/dist/{chunk-S7DZHKCG.js → chunk-2PP5MQPD.js} +5 -3
- package/dist/{chunk-75OC6E4F.js → chunk-3XPBFF6H.js} +1 -0
- package/dist/{chunk-5AH3CMOX.js → chunk-3YQ73ZM6.js} +1 -1
- package/dist/{chunk-FELGHDCA.js → chunk-6FZ4WYQL.js} +38 -4
- package/dist/{chunk-D242QZCR.js → chunk-6XCN62YU.js} +10 -54
- package/dist/chunk-AZKVGC5T.js +53 -0
- package/dist/{chunk-NHVHLUYS.js → chunk-CFHCG5FE.js} +6 -217
- package/dist/{chunk-5AIYALBX.js → chunk-COA2D7QM.js} +4 -3
- package/dist/chunk-G5WKW3ED.js +41 -0
- package/dist/{chunk-F3KIEVJ2.js → chunk-HU46M4JA.js} +2 -87
- package/dist/{chunk-77KGEDH4.js → chunk-MZSVVG55.js} +2 -41
- package/dist/chunk-PCQEHIGF.js +750 -0
- package/dist/chunk-PIPCGRCR.js +91 -0
- package/dist/{chunk-QFPXZITP.js → chunk-PMRTQ2RL.js} +34 -0
- package/dist/{chunk-7IQE34QK.js → chunk-UF6R2RVN.js} +5 -3
- package/dist/{chunk-IGQNP3ZO.js → chunk-VAAEBCMU.js} +1 -1
- package/dist/chunk-VRPLSK34.js +214 -0
- package/dist/{chunk-BARHNIKG.js → chunk-WK2QSO4E.js} +1 -1
- package/dist/chunk-WPB5LFGI.js +132 -0
- package/dist/chunk-XGOA5J2K.js +173 -0
- package/dist/{chunk-VJ7XBEY6.js → chunk-Z5726VPY.js} +6 -6
- package/dist/cli/index.js +118 -789
- package/dist/conduct-FZPUMPCI.js +25 -0
- package/dist/{conduct-VYYBCPHA.js → conduct-J2NXU6RM.js} +12 -9
- package/dist/{conductor-mode-SBDCRIX6.js → conductor-mode-HNNMWZIH.js} +11 -8
- package/dist/config-IRWLG6IW.js +12 -0
- package/dist/{execute-FZLQGIXB.js → execute-UAD5T3BQ.js} +1 -1
- package/dist/{execute-TEZPQ5WP.js → execute-UP46R7KS.js} +6 -5
- package/dist/index.js +34 -0
- package/dist/openclaw-setup-KA72IIEW.js +296 -0
- package/dist/openclaw-skills-CT673RBL.js +370 -0
- package/dist/{peers-K7FSHPN3.js → peers-F2EWUMVQ.js} +2 -2
- package/dist/{publish-capability-HVYILTPR.js → publish-capability-GNH5FHKG.js} +2 -2
- package/dist/{request-KJNKR27T.js → request-IM3ZLAOA.js} +13 -9
- package/dist/scanner-F5VNV5FP.js +8 -0
- package/dist/{serve-skill-GC6NIQ5T.js → serve-skill-6RKMVDMK.js} +6 -5
- package/dist/{server-6I7GU2OZ.js → server-MH7FTZFN.js} +11 -9
- package/dist/{service-coordinator-LZJCAQSJ.js → service-coordinator-R5LZVM6A.js} +31 -26
- package/dist/skills/agentbnb/bootstrap.js +34 -2
- package/dist/store-4Z446745.js +32 -0
- package/dist/writer-4QJ3U3WE.js +16 -0
- package/package.json +1 -1
- package/skills/agentbnb/bootstrap.ts +45 -2
- package/dist/conduct-4JDMWBQD.js +0 -22
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-U6LP4KWN.js";
|
|
7
7
|
import {
|
|
8
8
|
getFeedbackForProvider
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-COA2D7QM.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureAgentsTable
|
|
12
12
|
} from "./chunk-WTHMHNKC.js";
|
|
@@ -531,89 +531,6 @@ function releaseEscrow(db, escrowId) {
|
|
|
531
531
|
release();
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
// src/cli/remote-registry.ts
|
|
535
|
-
var RegistryTimeoutError = class extends AgentBnBError {
|
|
536
|
-
constructor(url) {
|
|
537
|
-
super(
|
|
538
|
-
`Registry at ${url} did not respond within 5s. Showing local results only.`,
|
|
539
|
-
"REGISTRY_TIMEOUT"
|
|
540
|
-
);
|
|
541
|
-
this.name = "RegistryTimeoutError";
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
var RegistryConnectionError = class extends AgentBnBError {
|
|
545
|
-
constructor(url) {
|
|
546
|
-
super(
|
|
547
|
-
`Cannot reach ${url}. Is the registry running? Showing local results only.`,
|
|
548
|
-
"REGISTRY_CONNECTION"
|
|
549
|
-
);
|
|
550
|
-
this.name = "RegistryConnectionError";
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
var RegistryAuthError = class extends AgentBnBError {
|
|
554
|
-
constructor(url) {
|
|
555
|
-
super(
|
|
556
|
-
`Authentication failed for ${url}. Run \`agentbnb config set token <your-token>\`.`,
|
|
557
|
-
"REGISTRY_AUTH"
|
|
558
|
-
);
|
|
559
|
-
this.name = "RegistryAuthError";
|
|
560
|
-
}
|
|
561
|
-
};
|
|
562
|
-
async function fetchRemoteCards(registryUrl, params, timeoutMs = 5e3) {
|
|
563
|
-
let cardsUrl;
|
|
564
|
-
try {
|
|
565
|
-
cardsUrl = new URL("/cards", registryUrl);
|
|
566
|
-
} catch {
|
|
567
|
-
throw new AgentBnBError(`Invalid registry URL: ${registryUrl}`, "INVALID_REGISTRY_URL");
|
|
568
|
-
}
|
|
569
|
-
const searchParams = new URLSearchParams();
|
|
570
|
-
if (params.q !== void 0) searchParams.set("q", params.q);
|
|
571
|
-
if (params.level !== void 0) searchParams.set("level", String(params.level));
|
|
572
|
-
if (params.online !== void 0) searchParams.set("online", String(params.online));
|
|
573
|
-
if (params.tag !== void 0) searchParams.set("tag", params.tag);
|
|
574
|
-
searchParams.set("limit", "100");
|
|
575
|
-
cardsUrl.search = searchParams.toString();
|
|
576
|
-
const controller = new AbortController();
|
|
577
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
578
|
-
let response;
|
|
579
|
-
try {
|
|
580
|
-
response = await fetch(cardsUrl.toString(), { signal: controller.signal });
|
|
581
|
-
} catch (err) {
|
|
582
|
-
clearTimeout(timer);
|
|
583
|
-
const isTimeout = err instanceof Error && err.name === "AbortError";
|
|
584
|
-
if (isTimeout) {
|
|
585
|
-
throw new RegistryTimeoutError(registryUrl);
|
|
586
|
-
}
|
|
587
|
-
throw new RegistryConnectionError(registryUrl);
|
|
588
|
-
} finally {
|
|
589
|
-
clearTimeout(timer);
|
|
590
|
-
}
|
|
591
|
-
if (response.status === 401 || response.status === 403) {
|
|
592
|
-
throw new RegistryAuthError(registryUrl);
|
|
593
|
-
}
|
|
594
|
-
if (!response.ok) {
|
|
595
|
-
throw new RegistryConnectionError(registryUrl);
|
|
596
|
-
}
|
|
597
|
-
const body = await response.json();
|
|
598
|
-
return body.items;
|
|
599
|
-
}
|
|
600
|
-
function mergeResults(localCards, remoteCards, hasQuery) {
|
|
601
|
-
const taggedLocal = localCards.map((c) => ({ ...c, source: "local" }));
|
|
602
|
-
const taggedRemote = remoteCards.map((c) => ({ ...c, source: "remote" }));
|
|
603
|
-
const localIds = new Set(localCards.map((c) => c.id));
|
|
604
|
-
const dedupedRemote = taggedRemote.filter((c) => !localIds.has(c.id));
|
|
605
|
-
if (!hasQuery) {
|
|
606
|
-
return [...taggedLocal, ...dedupedRemote];
|
|
607
|
-
}
|
|
608
|
-
const result = [];
|
|
609
|
-
const maxLen = Math.max(taggedLocal.length, dedupedRemote.length);
|
|
610
|
-
for (let i = 0; i < maxLen; i++) {
|
|
611
|
-
if (i < taggedLocal.length) result.push(taggedLocal[i]);
|
|
612
|
-
if (i < dedupedRemote.length) result.push(dedupedRemote[i]);
|
|
613
|
-
}
|
|
614
|
-
return result;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
534
|
export {
|
|
618
535
|
openCreditDb,
|
|
619
536
|
bootstrapAgent,
|
|
@@ -629,7 +546,5 @@ export {
|
|
|
629
546
|
markEscrowProgressing,
|
|
630
547
|
markEscrowAbandoned,
|
|
631
548
|
settleEscrow,
|
|
632
|
-
releaseEscrow
|
|
633
|
-
fetchRemoteCards,
|
|
634
|
-
mergeResults
|
|
549
|
+
releaseEscrow
|
|
635
550
|
};
|
|
@@ -2,46 +2,10 @@ import {
|
|
|
2
2
|
AgentBnBError
|
|
3
3
|
} from "./chunk-I7KWA7OB.js";
|
|
4
4
|
|
|
5
|
-
// src/autonomy/tiers.ts
|
|
6
|
-
import { randomUUID } from "crypto";
|
|
7
|
-
var DEFAULT_AUTONOMY_CONFIG = {
|
|
8
|
-
tier1_max_credits: 0,
|
|
9
|
-
tier2_max_credits: 0
|
|
10
|
-
};
|
|
11
|
-
function getAutonomyTier(creditAmount, config) {
|
|
12
|
-
if (creditAmount < config.tier1_max_credits) return 1;
|
|
13
|
-
if (creditAmount < config.tier2_max_credits) return 2;
|
|
14
|
-
return 3;
|
|
15
|
-
}
|
|
16
|
-
function insertAuditEvent(db, event) {
|
|
17
|
-
const isShareEvent = event.type === "auto_share" || event.type === "auto_share_notify" || event.type === "auto_share_pending";
|
|
18
|
-
const cardId = isShareEvent ? "system" : event.card_id;
|
|
19
|
-
const creditsCharged = isShareEvent ? 0 : event.credits;
|
|
20
|
-
const stmt = db.prepare(`
|
|
21
|
-
INSERT INTO request_log (
|
|
22
|
-
id, card_id, card_name, requester, status, latency_ms, credits_charged,
|
|
23
|
-
created_at, skill_id, action_type, tier_invoked
|
|
24
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
25
|
-
`);
|
|
26
|
-
stmt.run(
|
|
27
|
-
randomUUID(),
|
|
28
|
-
cardId,
|
|
29
|
-
"autonomy-audit",
|
|
30
|
-
"self",
|
|
31
|
-
"success",
|
|
32
|
-
0,
|
|
33
|
-
creditsCharged,
|
|
34
|
-
(/* @__PURE__ */ new Date()).toISOString(),
|
|
35
|
-
event.skill_id,
|
|
36
|
-
event.type,
|
|
37
|
-
event.tier_invoked
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
5
|
// src/autonomy/pending-requests.ts
|
|
42
|
-
import { randomUUID
|
|
6
|
+
import { randomUUID } from "crypto";
|
|
43
7
|
function createPendingRequest(db, opts) {
|
|
44
|
-
const id =
|
|
8
|
+
const id = randomUUID();
|
|
45
9
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
46
10
|
const paramsJson = opts.params !== void 0 ? JSON.stringify(opts.params) : null;
|
|
47
11
|
db.prepare(`
|
|
@@ -80,9 +44,6 @@ function resolvePendingRequest(db, id, resolution) {
|
|
|
80
44
|
}
|
|
81
45
|
|
|
82
46
|
export {
|
|
83
|
-
DEFAULT_AUTONOMY_CONFIG,
|
|
84
|
-
getAutonomyTier,
|
|
85
|
-
insertAuditEvent,
|
|
86
47
|
createPendingRequest,
|
|
87
48
|
listPendingRequests,
|
|
88
49
|
resolvePendingRequest
|