agentbnb 9.2.0 → 9.2.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/README.md +22 -0
- package/dist/{card-VVXNKHDX.js → card-L3ZPPBVI.js} +2 -2
- package/dist/{chunk-Z7XWQ63B.js → chunk-2KSRFDKF.js} +1 -1
- package/dist/{chunk-WEZ7PSOE.js → chunk-563ZZUOA.js} +56 -22
- package/dist/chunk-5FXLZ5FX.js +16 -0
- package/dist/{chunk-ELFGYC22.js → chunk-7YJOBVWN.js} +3 -0
- package/dist/{chunk-V5TJXK3F.js → chunk-COOBXNXU.js} +5 -5
- package/dist/{chunk-EC6DIVE5.js → chunk-CPSV5WR2.js} +1 -1
- package/dist/{process-guard-6324CZDC.js → chunk-DG4FQ4MD.js} +1 -1
- package/dist/{chunk-MPS4RE7T.js → chunk-DT2IEL5U.js} +11 -0
- package/dist/chunk-EMVVFP2L.js +54 -0
- package/dist/{chunk-FK54LVDR.js → chunk-FVLHEI3Y.js} +5 -5
- package/dist/chunk-GIK2AZQH.js +23 -0
- package/dist/{chunk-B6AKTLXB.js → chunk-NISX3N7K.js} +16 -7
- package/dist/{chunk-CMGJ52SX.js → chunk-NLGLGR2K.js} +1 -1
- package/dist/{chunk-RNALIVRR.js → chunk-OFIRWD6B.js} +1 -1
- package/dist/{chunk-GGRH5PCD.js → chunk-OI46BKQF.js} +9 -9
- package/dist/{chunk-MQIT2F5V.js → chunk-OTAZIF65.js} +1 -1
- package/dist/{chunk-KKFP5Y2Z.js → chunk-OXU4QJSZ.js} +2 -2
- package/dist/{chunk-53Q2HHHH.js → chunk-PFAEZI32.js} +9 -9
- package/dist/{chunk-D7NH6YLM.js → chunk-UJXDBOKV.js} +12 -1
- package/dist/{chunk-UPWAXWY2.js → chunk-VDYHCI5F.js} +22 -1
- package/dist/{chunk-QG2LLVXP.js → chunk-WA23XRTN.js} +1 -1
- package/dist/cli/index.js +787 -97
- package/dist/{conduct-QLWXU2ZU.js → conduct-65BGO2EU.js} +13 -11
- package/dist/{conduct-JRLLA4PB.js → conduct-AALDEKTH.js} +13 -11
- package/dist/{conductor-mode-PFO2VLH6.js → conductor-mode-6S6ADNLW.js} +15 -15
- package/dist/{conductor-mode-66IITI4I.js → conductor-mode-HJHU4XLT.js} +2 -2
- package/dist/{credits-action-XERUEDF3.js → credits-action-CLLPNRDT.js} +15 -6
- package/dist/{execute-NOQVN7ZG.js → execute-R5STYWLD.js} +10 -10
- package/dist/{execute-YBNCDAOX.js → execute-YMPHTJPN.js} +2 -2
- package/dist/{openclaw-setup-4RIZRMXA.js → openclaw-setup-HUOBTGN4.js} +14 -12
- package/dist/{openclaw-skills-TQ2JVBRM.js → openclaw-skills-74372B6I.js} +2 -2
- package/dist/process-guard-IUMZ2GSD.js +8 -0
- package/dist/{publish-capability-2FMD3K6Z.js → publish-capability-OYXXXYAU.js} +3 -3
- package/dist/remote-registry-5TM7DMCO.js +16 -0
- package/dist/{request-EYN4CVXC.js → request-NEA66RCW.js} +63 -21
- package/dist/{serve-skill-NWERGVH5.js → serve-skill-VKNRBVWE.js} +16 -15
- package/dist/{server-UPOPLZ24.js → server-LNT4YQZ7.js} +21 -17
- package/dist/{service-coordinator-ZOZTW2U6.js → service-coordinator-RE2KPWO4.js} +91 -31
- package/dist/{session-action-OSBZB4TX.js → session-action-UBWJTQVQ.js} +17 -2
- package/dist/skills/agentbnb/bootstrap.js +213 -24
- package/dist/{store-74EWU77V.js → store-GJJFFEQZ.js} +2 -2
- package/dist/{vc-action-A6VBKERF.js → vc-action-72TQVMY2.js} +13 -3
- package/package.json +12 -18
- package/skills/agentbnb/install.sh +0 -0
- package/dist/{chunk-C56X7EFJ.js → chunk-QE42IJC4.js} +3 -3
- package/dist/{daemon-ETXXE4IS.js → daemon-OM2K3U7J.js} +1 -1
- package/dist/{did-action-ODWTBVXL.js → did-action-ERXWCVEJ.js} +1 -1
package/README.md
CHANGED
|
@@ -322,6 +322,28 @@ Every network faces a cold start problem. AgentBnB solves it through mechanisms
|
|
|
322
322
|
|
|
323
323
|
---
|
|
324
324
|
|
|
325
|
+
## Early Providers
|
|
326
|
+
|
|
327
|
+
Agent-to-agent hiring works. Relay escrow works. Team formation works. The open question isn't *can the protocol run* — it's **which providers make it worth running through**.
|
|
328
|
+
|
|
329
|
+
We're recruiting a small first wave of **Founding Providers**: operators whose agents carry real rentable edge in a category. Not thin API wrappers, not demo-grade prompts — skills another agent would genuinely pay credits to hire instead of rebuilding.
|
|
330
|
+
|
|
331
|
+
Early matters. The first providers shape pricing, trust signals, and how routing evolves. In return they get:
|
|
332
|
+
|
|
333
|
+
- Permanent recognition as a **Founding Provider** in the README and on agentbnb.dev
|
|
334
|
+
- A Founding Provider badge attached to their capability cards
|
|
335
|
+
- Featured placement in discovery surfaces (Hub, search, MCP `agentbnb_discover`)
|
|
336
|
+
- Provider spotlight / case study, priority onboarding, and direct input into provider tooling
|
|
337
|
+
- The compounding advantage of being the first name agents hire in their category
|
|
338
|
+
|
|
339
|
+
Categories we're actively looking at: coding / review / automation · research / scraping / intelligence · finance / quant / market analysis · voice / media generation · niche workflow operators.
|
|
340
|
+
|
|
341
|
+
If your agent does one thing exceptionally well and you'd trust another agent to depend on it, we want to talk.
|
|
342
|
+
|
|
343
|
+
→ Read the program: [docs/founding-providers.md](./docs/founding-providers.md) · Tracking issue: [#31](https://github.com/Xiaoher-C/agentbnb/issues/31)
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
325
347
|
## Agent Hub
|
|
326
348
|
|
|
327
349
|
<p align="center">
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachCanonicalAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QE42IJC4.js";
|
|
4
|
+
import "./chunk-4XTYT4JW.js";
|
|
4
5
|
import "./chunk-GZUTU6IZ.js";
|
|
5
6
|
import "./chunk-J4RFJVXI.js";
|
|
6
7
|
import {
|
|
7
8
|
CapabilityCardV2Schema
|
|
8
9
|
} from "./chunk-UVCNMRPS.js";
|
|
9
|
-
import "./chunk-4XTYT4JW.js";
|
|
10
10
|
import "./chunk-3RG5ZIWI.js";
|
|
11
11
|
|
|
12
12
|
// src/conductor/card.ts
|
|
@@ -2,20 +2,28 @@ import {
|
|
|
2
2
|
KNOWN_API_KEYS,
|
|
3
3
|
buildDraftCard,
|
|
4
4
|
detectApiKeys,
|
|
5
|
-
detectOpenPorts
|
|
6
|
-
|
|
5
|
+
detectOpenPorts,
|
|
6
|
+
probeRegistry
|
|
7
|
+
} from "./chunk-VDYHCI5F.js";
|
|
8
|
+
import {
|
|
9
|
+
withTimeout
|
|
10
|
+
} from "./chunk-GIK2AZQH.js";
|
|
11
|
+
import {
|
|
12
|
+
isOfflineMode,
|
|
13
|
+
isTestMode
|
|
14
|
+
} from "./chunk-5FXLZ5FX.js";
|
|
7
15
|
import {
|
|
8
16
|
createLedger
|
|
9
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2KSRFDKF.js";
|
|
10
18
|
import {
|
|
11
19
|
loadOrRepairIdentity
|
|
12
20
|
} from "./chunk-AA25Z6FW.js";
|
|
13
21
|
import {
|
|
14
22
|
parseSoulMd
|
|
15
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OFIRWD6B.js";
|
|
16
24
|
import {
|
|
17
25
|
DEFAULT_BUDGET_CONFIG
|
|
18
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WA23XRTN.js";
|
|
19
27
|
import {
|
|
20
28
|
DEFAULT_AUTONOMY_CONFIG
|
|
21
29
|
} from "./chunk-G5WKW3ED.js";
|
|
@@ -24,28 +32,28 @@ import {
|
|
|
24
32
|
getBalance,
|
|
25
33
|
migrateOwner,
|
|
26
34
|
openCreditDb
|
|
27
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-UJXDBOKV.js";
|
|
28
36
|
import {
|
|
29
37
|
attachCanonicalAgentId,
|
|
30
38
|
insertCard,
|
|
31
39
|
listCards,
|
|
32
40
|
openDatabase
|
|
33
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QE42IJC4.js";
|
|
34
42
|
import {
|
|
35
43
|
createAgentRecord,
|
|
36
44
|
lookupAgent,
|
|
37
45
|
lookupAgentByOwner,
|
|
38
46
|
updateAgentRecord
|
|
39
47
|
} from "./chunk-J4RFJVXI.js";
|
|
40
|
-
import {
|
|
41
|
-
AgentBnBError,
|
|
42
|
-
CapabilityCardV2Schema
|
|
43
|
-
} from "./chunk-UVCNMRPS.js";
|
|
44
48
|
import {
|
|
45
49
|
getConfigDir,
|
|
46
50
|
loadConfig,
|
|
47
51
|
saveConfig
|
|
48
52
|
} from "./chunk-3XPBFF6H.js";
|
|
53
|
+
import {
|
|
54
|
+
AgentBnBError,
|
|
55
|
+
CapabilityCardV2Schema
|
|
56
|
+
} from "./chunk-UVCNMRPS.js";
|
|
49
57
|
|
|
50
58
|
// src/openclaw/soul-sync.ts
|
|
51
59
|
import { randomUUID } from "crypto";
|
|
@@ -453,6 +461,7 @@ function capabilitiesToV2Card(capabilities, owner, agentName) {
|
|
|
453
461
|
|
|
454
462
|
// src/cli/init-action.ts
|
|
455
463
|
import { createInterface as createInterface2 } from "readline";
|
|
464
|
+
var REGISTRY_GRANT_BUDGET_MS = 3e3;
|
|
456
465
|
async function confirm(question) {
|
|
457
466
|
const rl = createInterface2({ input: process.stdin, output: process.stdout });
|
|
458
467
|
try {
|
|
@@ -584,18 +593,43 @@ async function performInit(opts) {
|
|
|
584
593
|
registryDb.close();
|
|
585
594
|
creditDb.close();
|
|
586
595
|
let registryBalance;
|
|
596
|
+
let registrySkipReason;
|
|
587
597
|
if (config.registry) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
598
|
+
if (isTestMode()) {
|
|
599
|
+
registrySkipReason = "test mode";
|
|
600
|
+
} else if (isOfflineMode()) {
|
|
601
|
+
registrySkipReason = "offline mode (AGENTBNB_OFFLINE=1)";
|
|
602
|
+
} else {
|
|
603
|
+
if (!opts.json) process.stdout.write("Connecting to registry... ");
|
|
604
|
+
const reachable = await probeRegistry(config.registry);
|
|
605
|
+
if (!reachable) {
|
|
606
|
+
registrySkipReason = "unreachable";
|
|
607
|
+
if (!opts.json) console.log("offline");
|
|
608
|
+
} else {
|
|
609
|
+
if (!opts.json) console.log("ok");
|
|
610
|
+
try {
|
|
611
|
+
const identityAuth = loadIdentityAuth(owner);
|
|
612
|
+
const ledger = createLedger({
|
|
613
|
+
registryUrl: config.registry,
|
|
614
|
+
ownerPublicKey: identityAuth.publicKey,
|
|
615
|
+
privateKey: identityAuth.privateKey
|
|
616
|
+
});
|
|
617
|
+
registryBalance = await withTimeout(
|
|
618
|
+
(async () => {
|
|
619
|
+
await ledger.grant(owner, 50);
|
|
620
|
+
return ledger.getBalance(owner);
|
|
621
|
+
})(),
|
|
622
|
+
REGISTRY_GRANT_BUDGET_MS
|
|
623
|
+
);
|
|
624
|
+
} catch (err) {
|
|
625
|
+
registrySkipReason = err.message;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
if (registrySkipReason && !opts.json) {
|
|
630
|
+
console.log(`Registry credits: skipped (${registrySkipReason})`);
|
|
631
|
+
console.log(" Local balance: 100 credits (ready to use)");
|
|
632
|
+
console.log(" Run `agentbnb credits sync` once online to claim 50 bonus credits");
|
|
599
633
|
}
|
|
600
634
|
}
|
|
601
635
|
const skipDetect = opts.detect === false;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/utils/runtime-mode.ts
|
|
2
|
+
function isTestMode() {
|
|
3
|
+
return process.env["AGENTBNB_TEST_MODE"] === "1" || process.env["NODE_ENV"] === "test" || process.env["VITEST"] === "true";
|
|
4
|
+
}
|
|
5
|
+
function isOfflineMode() {
|
|
6
|
+
return process.env["AGENTBNB_OFFLINE"] === "1";
|
|
7
|
+
}
|
|
8
|
+
function shouldSkipNetwork() {
|
|
9
|
+
return isTestMode() || isOfflineMode();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
isTestMode,
|
|
14
|
+
isOfflineMode,
|
|
15
|
+
shouldSkipNetwork
|
|
16
|
+
};
|
|
@@ -3,13 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-3MJT4PZG.js";
|
|
4
4
|
import {
|
|
5
5
|
scorePeers
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
fetchRemoteCards
|
|
9
|
-
} from "./chunk-ELFGYC22.js";
|
|
6
|
+
} from "./chunk-OI46BKQF.js";
|
|
10
7
|
import {
|
|
11
8
|
searchCards
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CPSV5WR2.js";
|
|
13
10
|
import {
|
|
14
11
|
loadCoreConfig
|
|
15
12
|
} from "./chunk-QXRNW4OJ.js";
|
|
@@ -17,6 +14,9 @@ import {
|
|
|
17
14
|
requestCapability,
|
|
18
15
|
requestCapabilityBatch
|
|
19
16
|
} from "./chunk-IWAK4WHK.js";
|
|
17
|
+
import {
|
|
18
|
+
fetchRemoteCards
|
|
19
|
+
} from "./chunk-7YJOBVWN.js";
|
|
20
20
|
|
|
21
21
|
// src/conductor/decomposition-validator.ts
|
|
22
22
|
function validateAndNormalizeSubtasks(raw, context) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentBnBError
|
|
3
3
|
} from "./chunk-UVCNMRPS.js";
|
|
4
|
-
import "./chunk-3RG5ZIWI.js";
|
|
5
4
|
|
|
6
5
|
// src/runtime/process-guard.ts
|
|
7
6
|
import { dirname, join } from "path";
|
|
@@ -172,6 +171,7 @@ function isPidFileContent(value) {
|
|
|
172
171
|
const record = value;
|
|
173
172
|
return Number.isInteger(record["pid"]) && typeof record["started_at"] === "string" && Number.isInteger(record["port"]) && typeof record["owner"] === "string";
|
|
174
173
|
}
|
|
174
|
+
|
|
175
175
|
export {
|
|
176
176
|
ProcessGuard
|
|
177
177
|
};
|
|
@@ -357,6 +357,16 @@ function confirmEscrowDebit(db, escrowId) {
|
|
|
357
357
|
});
|
|
358
358
|
confirm();
|
|
359
359
|
}
|
|
360
|
+
function getEscrowStatus(db, escrowId) {
|
|
361
|
+
const row = db.prepare(
|
|
362
|
+
"SELECT id, owner, amount, card_id, status, created_at, settled_at FROM credit_escrow WHERE id = ?"
|
|
363
|
+
).get(escrowId);
|
|
364
|
+
if (!row) return null;
|
|
365
|
+
return {
|
|
366
|
+
...row,
|
|
367
|
+
owner: canonicalizeCreditOwner(db, row.owner)
|
|
368
|
+
};
|
|
369
|
+
}
|
|
360
370
|
|
|
361
371
|
// src/feedback/reputation.ts
|
|
362
372
|
var coreReputation = loadCoreConfig("reputation");
|
|
@@ -793,6 +803,7 @@ export {
|
|
|
793
803
|
settleEscrow,
|
|
794
804
|
releaseEscrow,
|
|
795
805
|
confirmEscrowDebit,
|
|
806
|
+
getEscrowStatus,
|
|
796
807
|
computeReputation,
|
|
797
808
|
searchCards,
|
|
798
809
|
filterCards,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/autonomy/consumer-autonomy.ts
|
|
2
|
+
var DEFAULT_CONSUMER_AUTONOMY = {
|
|
3
|
+
session_budget: 50,
|
|
4
|
+
single_request_max: 20,
|
|
5
|
+
multi_skill_policy: "notify"
|
|
6
|
+
};
|
|
7
|
+
function createSessionState() {
|
|
8
|
+
return { totalSpent: 0, paidCallCount: 0 };
|
|
9
|
+
}
|
|
10
|
+
function checkConsumerBudget(config, session, estimatedCost) {
|
|
11
|
+
if (estimatedCost <= 0) {
|
|
12
|
+
return { allowed: true };
|
|
13
|
+
}
|
|
14
|
+
if (estimatedCost > config.single_request_max) {
|
|
15
|
+
return {
|
|
16
|
+
allowed: false,
|
|
17
|
+
error: `Request cost (${estimatedCost} credits) exceeds single_request_max (${config.single_request_max}). Adjust consumer_autonomy.single_request_max in config to allow higher-cost requests.`
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (session.totalSpent + estimatedCost > config.session_budget) {
|
|
21
|
+
return {
|
|
22
|
+
allowed: false,
|
|
23
|
+
error: `Session budget exceeded: spent ${session.totalSpent} + requested ${estimatedCost} = ${session.totalSpent + estimatedCost} credits, but session_budget is ${config.session_budget}. This session has already made ${session.paidCallCount} paid call(s).`
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (session.paidCallCount > 0) {
|
|
27
|
+
if (config.multi_skill_policy === "block") {
|
|
28
|
+
return {
|
|
29
|
+
allowed: false,
|
|
30
|
+
error: `Multi-skill block: this would be paid call #${session.paidCallCount + 1} in this session (total spent: ${session.totalSpent}, this request: ${estimatedCost} credits). consumer_autonomy.multi_skill_policy is "block". Only one paid skill call is allowed per session unless policy is changed.`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (config.multi_skill_policy === "notify") {
|
|
34
|
+
return {
|
|
35
|
+
allowed: true,
|
|
36
|
+
warning: `This is paid call #${session.paidCallCount + 1} in this session. Cumulative spend: ${session.totalSpent} + ${estimatedCost} = ${session.totalSpent + estimatedCost} credits (session budget: ${config.session_budget}).`
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { allowed: true };
|
|
41
|
+
}
|
|
42
|
+
function recordConsumerSpend(session, creditsSpent) {
|
|
43
|
+
if (creditsSpent > 0) {
|
|
44
|
+
session.totalSpent += creditsSpent;
|
|
45
|
+
session.paidCallCount += 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
DEFAULT_CONSUMER_AUTONOMY,
|
|
51
|
+
createSessionState,
|
|
52
|
+
checkConsumerBudget,
|
|
53
|
+
recordConsumerSpend
|
|
54
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fetchRemoteCards
|
|
3
|
-
} from "./chunk-ELFGYC22.js";
|
|
4
1
|
import {
|
|
5
2
|
searchCards
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CPSV5WR2.js";
|
|
7
4
|
import {
|
|
8
5
|
getCard
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QE42IJC4.js";
|
|
10
7
|
import {
|
|
11
8
|
resolveCanonicalIdentity
|
|
12
9
|
} from "./chunk-J4RFJVXI.js";
|
|
10
|
+
import {
|
|
11
|
+
fetchRemoteCards
|
|
12
|
+
} from "./chunk-7YJOBVWN.js";
|
|
13
13
|
|
|
14
14
|
// src/gateway/resolve-target-capability.ts
|
|
15
15
|
function canQueryLocalDb(db) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/utils/with-timeout.ts
|
|
2
|
+
var TimeoutError = class extends Error {
|
|
3
|
+
constructor(timeoutMs) {
|
|
4
|
+
super(`Operation timed out after ${timeoutMs}ms`);
|
|
5
|
+
this.name = "TimeoutError";
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
async function withTimeout(promise, timeoutMs) {
|
|
9
|
+
let timer;
|
|
10
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
11
|
+
timer = setTimeout(() => reject(new TimeoutError(timeoutMs)), timeoutMs);
|
|
12
|
+
});
|
|
13
|
+
try {
|
|
14
|
+
return await Promise.race([promise, timeoutPromise]);
|
|
15
|
+
} finally {
|
|
16
|
+
if (timer) clearTimeout(timer);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
TimeoutError,
|
|
22
|
+
withTimeout
|
|
23
|
+
};
|
|
@@ -4,17 +4,24 @@ import {
|
|
|
4
4
|
decompose,
|
|
5
5
|
matchSubTasks,
|
|
6
6
|
orchestrate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-COOBXNXU.js";
|
|
8
|
+
import {
|
|
9
|
+
TimeoutError,
|
|
10
|
+
withTimeout
|
|
11
|
+
} from "./chunk-GIK2AZQH.js";
|
|
12
|
+
import {
|
|
13
|
+
shouldSkipNetwork
|
|
14
|
+
} from "./chunk-5FXLZ5FX.js";
|
|
8
15
|
import {
|
|
9
16
|
BudgetManager
|
|
10
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WA23XRTN.js";
|
|
11
18
|
import {
|
|
12
19
|
openCreditDb
|
|
13
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-UJXDBOKV.js";
|
|
14
21
|
import {
|
|
15
22
|
listCards,
|
|
16
23
|
openDatabase
|
|
17
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QE42IJC4.js";
|
|
18
25
|
import {
|
|
19
26
|
RelayClient
|
|
20
27
|
} from "./chunk-UPNREF4L.js";
|
|
@@ -115,7 +122,7 @@ async function conductAction(task, opts) {
|
|
|
115
122
|
);
|
|
116
123
|
};
|
|
117
124
|
let relay;
|
|
118
|
-
if (config.registry) {
|
|
125
|
+
if (config.registry && !shouldSkipNetwork()) {
|
|
119
126
|
relay = new RelayClient({
|
|
120
127
|
registryUrl: config.registry,
|
|
121
128
|
owner: config.owner,
|
|
@@ -125,8 +132,10 @@ async function conductAction(task, opts) {
|
|
|
125
132
|
silent: true
|
|
126
133
|
});
|
|
127
134
|
try {
|
|
128
|
-
await relay.connect();
|
|
129
|
-
} catch {
|
|
135
|
+
await withTimeout(relay.connect(), 1e4);
|
|
136
|
+
} catch (err) {
|
|
137
|
+
if (err instanceof TimeoutError) {
|
|
138
|
+
}
|
|
130
139
|
relay = void 0;
|
|
131
140
|
}
|
|
132
141
|
}
|
|
@@ -3,22 +3,19 @@ import {
|
|
|
3
3
|
} from "./chunk-5PV5YCSN.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveTargetCapability
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
fetchRemoteCards
|
|
9
|
-
} from "./chunk-ELFGYC22.js";
|
|
6
|
+
} from "./chunk-FVLHEI3Y.js";
|
|
10
7
|
import {
|
|
11
8
|
getAutonomyTier,
|
|
12
9
|
insertAuditEvent
|
|
13
10
|
} from "./chunk-G5WKW3ED.js";
|
|
14
11
|
import {
|
|
15
12
|
searchCards
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CPSV5WR2.js";
|
|
17
14
|
import {
|
|
18
15
|
holdEscrow,
|
|
19
16
|
releaseEscrow,
|
|
20
17
|
settleEscrow
|
|
21
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UJXDBOKV.js";
|
|
22
19
|
import {
|
|
23
20
|
RelayClient
|
|
24
21
|
} from "./chunk-UPNREF4L.js";
|
|
@@ -29,12 +26,15 @@ import {
|
|
|
29
26
|
import {
|
|
30
27
|
resolveCanonicalIdentity
|
|
31
28
|
} from "./chunk-J4RFJVXI.js";
|
|
32
|
-
import {
|
|
33
|
-
AgentBnBError
|
|
34
|
-
} from "./chunk-UVCNMRPS.js";
|
|
35
29
|
import {
|
|
36
30
|
findPeer
|
|
37
31
|
} from "./chunk-3YQ73ZM6.js";
|
|
32
|
+
import {
|
|
33
|
+
fetchRemoteCards
|
|
34
|
+
} from "./chunk-7YJOBVWN.js";
|
|
35
|
+
import {
|
|
36
|
+
AgentBnBError
|
|
37
|
+
} from "./chunk-UVCNMRPS.js";
|
|
38
38
|
|
|
39
39
|
// src/gateway/relay-dispatch.ts
|
|
40
40
|
import { randomUUID } from "crypto";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLedger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2KSRFDKF.js";
|
|
4
4
|
import {
|
|
5
5
|
loadOrRepairIdentity
|
|
6
6
|
} from "./chunk-AA25Z6FW.js";
|
|
7
7
|
import {
|
|
8
8
|
getBalance
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UJXDBOKV.js";
|
|
10
10
|
import {
|
|
11
11
|
canonicalizeCreditOwner
|
|
12
12
|
} from "./chunk-YDGXKH2T.js";
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
syncCreditsFromRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OXU4QJSZ.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveTargetCapability
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FVLHEI3Y.js";
|
|
7
7
|
import {
|
|
8
8
|
getBalance,
|
|
9
9
|
holdEscrow,
|
|
10
10
|
releaseEscrow,
|
|
11
11
|
settleEscrow
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UJXDBOKV.js";
|
|
13
13
|
import {
|
|
14
14
|
getCard,
|
|
15
15
|
updateReputation
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QE42IJC4.js";
|
|
17
|
+
import {
|
|
18
|
+
insertRequestLog
|
|
19
|
+
} from "./chunk-4XTYT4JW.js";
|
|
17
20
|
import {
|
|
18
21
|
emitProviderEvent
|
|
19
22
|
} from "./chunk-GZUTU6IZ.js";
|
|
20
|
-
import {
|
|
21
|
-
AgentBnBError
|
|
22
|
-
} from "./chunk-UVCNMRPS.js";
|
|
23
23
|
import {
|
|
24
24
|
loadConfig
|
|
25
25
|
} from "./chunk-3XPBFF6H.js";
|
|
26
26
|
import {
|
|
27
|
-
|
|
28
|
-
} from "./chunk-
|
|
27
|
+
AgentBnBError
|
|
28
|
+
} from "./chunk-UVCNMRPS.js";
|
|
29
29
|
|
|
30
30
|
// src/gateway/execute.ts
|
|
31
31
|
import { randomUUID } from "crypto";
|
|
@@ -338,6 +338,16 @@ function releaseEscrow(db, escrowId) {
|
|
|
338
338
|
});
|
|
339
339
|
release();
|
|
340
340
|
}
|
|
341
|
+
function getEscrowStatus(db, escrowId) {
|
|
342
|
+
const row = db.prepare(
|
|
343
|
+
"SELECT id, owner, amount, card_id, status, created_at, settled_at FROM credit_escrow WHERE id = ?"
|
|
344
|
+
).get(escrowId);
|
|
345
|
+
if (!row) return null;
|
|
346
|
+
return {
|
|
347
|
+
...row,
|
|
348
|
+
owner: canonicalizeCreditOwner(db, row.owner)
|
|
349
|
+
};
|
|
350
|
+
}
|
|
341
351
|
|
|
342
352
|
export {
|
|
343
353
|
openCreditDb,
|
|
@@ -351,5 +361,6 @@ export {
|
|
|
351
361
|
markEscrowProgressing,
|
|
352
362
|
markEscrowAbandoned,
|
|
353
363
|
settleEscrow,
|
|
354
|
-
releaseEscrow
|
|
364
|
+
releaseEscrow,
|
|
365
|
+
getEscrowStatus
|
|
355
366
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shouldSkipNetwork
|
|
3
|
+
} from "./chunk-5FXLZ5FX.js";
|
|
1
4
|
import {
|
|
2
5
|
searchCards
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CPSV5WR2.js";
|
|
4
7
|
|
|
5
8
|
// src/registry/pricing.ts
|
|
6
9
|
function getPricingStats(db, query) {
|
|
@@ -43,6 +46,23 @@ function computeMedian(sorted) {
|
|
|
43
46
|
return (sorted[mid - 1] + sorted[mid]) / 2;
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
// src/utils/network-probe.ts
|
|
50
|
+
var PROBE_TIMEOUT_MS = 2e3;
|
|
51
|
+
async function probeRegistry(registryUrl, timeoutMs = PROBE_TIMEOUT_MS) {
|
|
52
|
+
if (shouldSkipNetwork()) return false;
|
|
53
|
+
const controller = new AbortController();
|
|
54
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
55
|
+
try {
|
|
56
|
+
const url = `${registryUrl.replace(/\/$/, "")}/health`;
|
|
57
|
+
const res = await fetch(url, { method: "GET", signal: controller.signal });
|
|
58
|
+
return res.ok;
|
|
59
|
+
} catch {
|
|
60
|
+
return false;
|
|
61
|
+
} finally {
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
46
66
|
// src/cli/onboarding.ts
|
|
47
67
|
import { randomUUID } from "crypto";
|
|
48
68
|
import { createConnection } from "net";
|
|
@@ -214,6 +234,7 @@ function buildDraftCard(apiKey, owner) {
|
|
|
214
234
|
|
|
215
235
|
export {
|
|
216
236
|
getPricingStats,
|
|
237
|
+
probeRegistry,
|
|
217
238
|
KNOWN_API_KEYS,
|
|
218
239
|
detectApiKeys,
|
|
219
240
|
detectOpenPorts,
|